Fabien Potencier presents : Symfony 2 Comments Off
here are the slides. Enjoy !
here are the slides. Enjoy !
La grand messe d’Apple étant finie, l’émotion de voir Steve Job parler étant passée, nous pouvons désormais nous pencher à froid sur la bête qui nous a été présenté.
Beaucoup de blogs vont relayer les infos concernant les capacités de la machine et je vous laisse le soin d’aller consulter le wMag du klub iPad pour vous renseigner à ce sujet.
Parlons plutôt de ce qui a manqué cruellement lors de cette keynote. Ou plutôt de ce qu’on nous présente comme un objet révolutionnaire et qui n’est qu’un mashup de deux produit en cummulant plus les inconvénients que les avantages.
Concrêtement l’iPad c’est quoi ?
mais alors pourquoi parler de produit innovant, d’outils du futur ?
si je ne m’abuse :
Et bien rien de tout ça dans l’iPad! Pour moi il s’agit d’un joujou high-tech qui peut s’avérer pratique pour pas mal d’utilisations mais qui ne redore pas le blason d’Apple en terme d’innovation et de révolution des moeurs. Rien de brillant chez les mac depuis longtemps, et à part l’épisode iPhone rien de vraiment nouveau parmis tout les produits Apple. Apple ne créé plus du rêve, il vends des produit à la mode …
Ha si ! j’oubliais de mentionner les efforts considérable d’Apple pour améliorer la sensibilité des capteurs d’immersion !
Le dernier nés de ma collection de joujou high-tech :

(merci à ma femme qui a bien voulu :D et @leboncoin.fr où les occasions sont super !)
Pour les résultats, voir le widget flickr qui a fait son apparition sur ce blog.
Test et présentation de la bête prochainement.
Thanks to fabien Potencier for this hint :
Twitter is everywhere nowadays. Odds are eventually you will want to tweet from PHP. No need to use one of the numerous PHP Twitter libraries, as tweeting is as simple as using the PHP built-in file_get_contents() function:
function tweet($message, $username, $password)
{
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => sprintf("Authorization: Basic %s\r\n", base64_encode($username.':'.$password)).
"Content-type: application/x-www-form-urlencoded\r\n",
'content' => http_build_query(array('status' => $message)),
'timeout' => 5,
),
));
$ret = file_get_contents('http://twitter.com/statuses/update.xml', false, $context);return false !== $ret;
}Pretty easy, no? Using the tweet() function is of course a piece of cake:
tweet(‘From PHP, yeah…’, ‘fabpot’, ‘Pa$$’)
;
source : http://fabien.potencier.org/article/20/tweeting-from-php
Tags: devloppement, PHP, twitterSuite à un crash de disque dur (paix à son âme) je profite de cette install tout fraîche de macosx 10.6 pour bien configurer mon environnement.
Pour mémo:
export PATH=~/bin:$PATHcd ~/bin && ln -s /Applications/MAMP/bin/php5/php phpln -s /Applications/MAMP/Library/bin/mysqladmin mysqladmin
ln -s /Applications/MAMP/Library/bin/mysql mysql
ln -s /Applications/MAMP/Library/bin/mysqldump mysqldumpBon évidemment l’idéal aurait été de faire un Rsync du dernier backup sur la lunxbox mais bon c’ets moins marrant ;-)
Tags: Apple, bonne pratiques, gist, Macosx, MAMP, mysql, PHP, rsync, script, SSH, sysadmin, tipsDepuis quelques temps, impossible d’ouvrir un PDF dans safari sans devoir manuellement sélectionner l’emplacement de Adobe PDF Viewer. À l’origine, Safari ouvre les PDF avec aperçu, plutôt pratique quand on connait la différence énorme de performance de Aperçu et Adobe PDF viewer, en faveur d’Aperçu.
La solution est simple :
ouvrez un terminal et naviguez jusqu’à “Macintosh HD -> Library -> Internet Plug-Ins”
cd /Library/Internet\ Plug-Ins/
puis
rm -Rf AdobePDFViewer.plugin/
un petit redémarrage de Safari et le tour est joué.

Display PDF in Safari with aperçu
In many database-based projects you have to show your visitors that this “thing” is similar to this other one. For example, this blog post is similar to this other one. That’s a crucial functionnality and at first sight it’s looks easy to create.
let’s start with this basic example :
In a blog, a “blog_post” has many “tag”. These relations are stored in a “blog_post_tag” table. When a blog post is displayed, we want to show the list of similar post to the current blog_post. Our “blog_post_tag” table just store “blog_post_id” and “tag_id“.
I wanted to get all blog post that have the same associated tag. But, in this database-relation context “the same” may only mean only one of them. Quite annoying. So i finally get something that worked, and that was based on this kind of algorythm:
blogPostTags = $myBlogPost->getTags
postList = array()
foreach(blogPostTags as currentTag)
tempPostList = getAllBlogPostByTag(currentTag)
postList = array_merge(postList, array_diff(tempPostList,postList)
endforeach
Quite awfull isn’t it ? after two hours spent on something else and got back to home and discussed with friends (and whatever you want. Who said IT guy do not have a social life ?!) i just looked back at this problem and finally wrote this :
SELECT COUNT(tag_id) as similarity, blog_post_id FROM blog_post_tag
WHERE tag_id IN (
SELECT tag_id FROM blog_post_tag WHERE blog_post_id = ?
)
GROUP BY blog_post_id
And that’s all. This SQL code gives you how many common tag you have between all the post that have at least on tag in common with a specific blog_post (replace ‘?’ by the correct value). Now just have to write it whith the Doctrine syntax ;-)
Just remember : when it sucks, just take a break !
Tags: devloppement, mysql, tipsSQLSTATE[HY000]: General error: 1005 Can't create table
in a
symfony doctrine-build-all-load
command line means you have different integer size in your primary keys references
especially, sfDoctrineGuardPlugin use a integer(4) as primary key definition so, if you want to link your own ‘user’ class to sfGaurdUser class, you’ll have to define sf_uard_user_id as integer(4).
thanks to clear-cache.fr !
Tags: devloppement, mysql, symfony, tips