Loading ...
[Plus récent] [Plus ancien] [Meilleur rang] [Mauvais rang]

PCR Postit

Video

::

Pourquoi chevauché une moto est si sensuel

[Maximiser] [Trackback]
Date : 2008-03-19@17:40:51
Rang : 0

PHP

::

Point ou virgule : Question existentielle

[Trackback]
Date : 2008-03-14@15:02:55
Rang : 0

Super question existentielle du vendredi :D est ce plus rapide de faire :

echo ' '.$i;

ou

echo ' ',$i;

Le code de test :

ob_start();
$time = microtime(true);
for ($i = 0; $i < 1000000; $i++)
{
        echo ' ', $i;
}
ob_clean();
echo microtime(true) - $time, "\\n";
ob_start();
$time = microtime(true);
for ($i = 0; $i < 1000000; $i++)
{
        echo ' '.$i;
}
ob_clean();
echo microtime(true) - $time, "\\n";

La réponse de ce test super important dont on connaît la réponse par avance :

1.5555839538574
1.7078490257263

Donc ',' est notre champion du super benchmark youpi :D

PHP

::

pagination à l'aide d'une fonction

[Trackback]
Date : 2007-11-21@15:44:55
Rang : 0

Ce petit bout de code bien pratique permet d'avoir une fonction de pagination universelle. Du moins elle fonctionne sur tous les sites permettant l'utilisation du $_GET dans les urls.

/**
* Retourne un tableau contenant les liens pour une pagination
*
* Ex: getPagination($_SERVER['REQUEST_URI'],55,10)
*
* Avec comme appel http://www.monsite.com/index.php?dummy1=4508654&dummy2=1&edit=1&p=2
*
* array
* 0 => string '<a href="/index.php?dummy1=4508654&amp;dummy2=1&amp;edit=1&amp;p=0">&lt;&lt;</a>'
* 1 => string '<a href="/index.php?dummy1=4508654&amp;dummy2=1&amp;edit=1&amp;p=1">&lt;</a>'
* 2 => string '<a href="/index.php?dummy1=4508654&amp;dummy2=1&amp;edit=1&amp;p=1">2</a>'
* 3 => string '<a href="/index.php?dummy1=4508654&amp;dummy2=1&amp;edit=1&amp;p=0">1</a>'
* 4 => string '<span>3</span>'
* 5 => string '<a href="/index.php?dummy1=4508654&amp;dummy2=1&amp;edit=1&amp;p=3">4</a>'
* 6 => string '<a href="/index.php?dummy1=4508654&amp;dummy2=1&amp;edit=1&amp;p=4">5</a>'
* 7 => string '<a href="/index.php?dummy1=4508654&amp;dummy2=1&amp;edit=1&amp;p=3">&gt;</a>'
* 8 => string '<a href="/index.php?dummy1=4508654&amp;dummy2=1&amp;edit=1&amp;p=5">&gt;&gt;</a>'
*
* @param string $url url de base pour la pagination (ex: $_SERVER['REQUEST_URI'])
* @param int $foundRows nombre de ligne total (SQL_CALC_FOUND_ROWS)
* @param int $limitPerPage nombre limite d'element par pages
* @param int $displayPages nombre de pages afficher a droite (ou a gauche) de la page courante
* @param string $pageArg index du $_GET pour cette pagination
* @param string $firstLabel texte (ou balise img ...) pour la première page
* @param string $previousLabel texte (ou balise img ...) pour la page précédente
* @param string $nextLabel texte (ou balise img ...) pour la page suivante
* @param string $lastLabel texte (ou balise img ...) pour la dernière page
* @return array
*/

function getPagination($url,$foundRows,$limitPerPage,$displayPages = 2,$pageArg = 'p', $firstLabel = '&lt;&lt;',$previousLabel = '&lt;',$nextLabel = '&gt;',$lastLabel = '&gt;&gt;')
{
        $pages = array();
        parse_str(parse_url($url,PHP_URL_QUERY),$arg);
        $currentPage = isset($arg[$pageArg]) ? (int)$arg[$pageArg] : 0;
        unset($arg[$pageArg]);
        $strpos = strpos($url,'?');
        if($strpos !== false)
        {
                $url = substr($url,0,$strpos);
        }
        $url .= '?'.http_build_query($arg,null,'&amp;');
        $lastPage = ceil($foundRows / $limitPerPage) - 1;
        if($lastPage > 0)
        {
                if($currentPage > 0)
                {
                        $pages[] = '<a href="'.$url.'&amp;'.$pageArg.'=0">'.$firstLabel.'</a>';
                        $pages[] = '<a href="'.$url.'&amp;'.$pageArg.'='.($currentPage-1).'">'.$previousLabel.'</a>';
                        for($i = 1,$max = $displayPages+1; $i<$max;$i++)
                        {
                                $p = $currentPage - $i;
                                if($p >= 0)
                                {
                                        $pages[] = '<a href="'.$url.'&amp;'.$pageArg.'='.$p.'">'.($p+1).'</a>';
                                }
                                else
                                {
                                        $p = $max;
                                }
                        }
                }
                $pages[] = '<span>'.($currentPage+1).'</span>';
                if($currentPage < $lastPage)
                {
                        for($i = 1,$max = $displayPages+1; $i<$max;$i++)
                        {
                                $p = $currentPage + $i;
                                if($p <= $lastPage)
                                {
                                        $pages[] = '<a href="'.$url.'&amp;'.$pageArg.'='.$p.'">'.($p+1).'</a>';
                                }
                                else
                                {
                                        $p = $max;
                                }
                        }
                        $pages[] = '<a href="'.$url.'&amp;'.$pageArg.'='.($currentPage+1).'">'.$nextLabel.'</a>';
                        $pages[] = '<a href="'.$url.'&amp;'.$pageArg.'='.($lastPage).'">'.$lastLabel.'</a>';
                }
        }
        return $pages;
}

Linux

::

Partage de connexion nat

[Trackback]
Date : 2007-10-20@13:42:31
Rang : 0

Pour partager sa connexion sous linux avec un réseau du type :

[Internet]---(eth1)[Linux](eth0)---[LAN]

Il faut activer le NAT sur le pc linux :

Pour activer le nat dans le noyau
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

Pour activer le nat dans iptable
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Enfin pour sauver la règle iptable sous ubuntu :
/etc/init.d/iptables save

Logiciels

::

Partage de clavier Synergy

[Trackback]
Date : 2007-08-21@14:46:33
Rang : 0

Synergy est un logiciel qui permet de partager clavier et souris entre plusieurs postes à travers le réseau.
Synergy peut être vu comme une alternative à un KVM ou VNC.
Il existe une version windows et linux pour permettre une maximum de compatibilité.

PHP

::

Problème de header 301 OK au lieu de 301 Moved Permanently

[Trackback]
Date : 2007-07-05@17:30:38
Rang : 0

Petit problème avec PHP, Lors ce que j'effectue une redirection 301 avec le code suivant :
header ('HTTP/1.1 301 Moved Permanently');
Le header envoyé correspond à HTTP/1.x 301 OK
Afin de corriger se petit détail il suffit de remplacer le code précédent par :
header ('Status: 301 Moved Permanently');
Ce problème semble uniquement être valable sur la version CGI de PHP.

PHP

::

PHP benchmark foreach for

[Trackback]
Date : 2007-04-13@11:42:46
Rang : 0

Chose Bizarre en php le foreach est plus rapide que le for.
1.709 ms Pour le foreach 1.944 ms et pour le for.
Trés bizarre.
<?php
$arr=Array(
'cacazcacz',
'cacazezcacz',
'cazcazaeacz',
'cazcaczca',
'cazcaczca',
'cazcaczcaz',
'cazcaccazz',
'cazcaeazcz',
'cazcaceazz',
'cazcaazecz',
'cazcacz',
'cazcdazdacz'
);
$start=time()+microtime();
for ($j=0;$j<1000;$j++)
{
        foreach ($arr as $v)
        {
                $v;
        }
}
var_dump(time()+microtime()-$start);
$start=time()+microtime();
$countArr=count($arr);
for ($j=0;$j<1000;$j++)
{
        
        for($i=0;$i<$countArr;$i++)
        {
                $arr[$i];
        }
}
var_dump(time()+microtime()-$start);
?>

Musique

::

PCR Jukebox player de musique en ligne

[Trackback]
Date : 2007-02-20@15:43:51
Rang : 0

Voilà il y n'y a pas de raison moi aussi je peux faire un juke-box en ligne :D. Bon l'utilisation est assez limitée mais c'était juste pour voir comment faire :D et puis ça permet de trouver vite fait une musique. Une sorte de moteur de recherche de son :D
http://petitchevalroux.net/jukebox/

MySQL

::

Petit article pour partir sur de bonnes bases ... de données

[Trackback]
Date : 2007-02-06@14:15:16
Rang : 0

On y trouve tout plein de bons conseils qu'on a tendance à oublier sur l'optimisation de base de données MySQL.
http://www.phpinfo.net/page/archives/articles/optimisation-mysql/

A lire

::

Pensez à notre planête

[Maximiser] [Trackback]
Date : 2007-02-01@14:31:42
Rang : 0

Musique

::

Puppetmastaz Video Live

[Maximiser] [Trackback]
Date : 2007-01-27@13:10:58
Rang : 0

Video

::

PicooZ Helicopter RC indoor

[Maximiser] [Trackback]
Date : 2007-01-25@12:49:36
Rang : 0

PCR postit

::

Pcr Postit version en préparation

[Trackback]
Date : 2006-12-08@10:39:46
Rang : 0

A venir
Gestion des tabulations dans les post-it texte
Faire des 304 plus perfomant en vue d'un cache de page a la jpcache
Corriger les dates des mise à jour des post avec la date de dernière modification.
Fonctionnalités supplémentaires
Gestion de flux atoms
Url rewriting pour meilleur référencement
Compression en gz ou bz du shmop_cache pour y mettre plus de données

PCR postit

::

PCR Postit sur Framasoft

[Trackback]
Date : 2006-12-08@09:55:34
Rang : 0

Ca y est PCR Postit est paru sur Framasoft.
Je tiens à remercier Elrik de Framasoft pour sa colaboration et ses précieux conseils lors de la rédaction de cette notice.

Annuaire

::

Pages Hub

[Trackback]
Date : 2006-11-29@17:58:17
Rang : 0

http://www.pageshub.fr/

Notes

::

petitchevalroux en leet

[Trackback]
Date : 2006-11-22@19:25:54
Rang : 0

p3717(h3v4|r0ux

PCR postit

::

PCR Postit 0.7

[Trackback]
Date : 2006-11-22@17:37:18
Rang : 0

- Ajout des postit Flickr
- Ajout des postits Embed video pour les videos youtube, dailymotion, et myspace.
Telechargements
---------------
http://browser.petitchevalroux.net/index.php/PCR-Postit/release/

PCR postit

::

PCR postit sur le net

[Trackback]
Date : 2006-11-11@12:04:02
Rang : 0

http://www.compare-le-net.com/index.php?comparer=annuaire/categorie&categorie=168
http://hotscripts.topdownloads.net/browse.php?cat=813
http://www.pehape.net/skrypty,php,linki,48
http://hotscripts.com/Detailed/59791.html
http://www.phpcs.com/codes/PCR-POSTIT_37679.aspx
http://alibaba.myblox.fr/informatique/index2.html
http://www.pehape.net/skrypty,php,linki,48
http://wiki.framasoft.info/PropositionNotice/PCRPostit
http://annuaire.yagoort.org/rubrique-7-715.html
http://www.en1heure.com/annuaire/index.php?cat_id=106
http://www.comscripts.com/scripts/php.pcr-postit.2168.html
http://www.noogle.fr/annuaire/autres,services-logiciel,1d_92v57.html
http://www.big-annuaire.com/big-categorie-Php-48946.php
http://www.pageshub.fr/internet/blogs/
http://www.e-veryweb.com/blogs-42.html
http://www.annuaire-liens-durs.fr/-scripts-p1-428.html
http://lp.01-depannage-informatique.com/-scripts-p1-428.html
http://www.01-annuaire-liens-durs.com/-scripts-p1-428.html
http://www.2laide.com/index.php?cat=7
http://www.allez-go.com/annuaire/?cat=58&p=9
http://www.kam.olympiquelyonnais.info/annuaire/index.php?cat_id=2&page=2
http://www.bonweb.com/informatique/utilitaires-bureautique-logiciels.php?searchi=10
http://www.annuaire-du-web.info/logiciels-72-13.html
http://www.ezphpportal.com/index.php?pageid=catlist&catid=organizers
http://www.allgratuit.net/index.php?cat=1458
http://www.annuaire-du-web.net/index-57-10.html
http://annuaire.indexweb.info/logiciels-pour-internet,767-1.html
http://www.aidoforum.com/annuaire/webmasters-p2-56.html
http://www.abc-du-gratuit.com/phpranks/conceptiondesiteswebutilitairesdivers.php
http://www.big-referencement.com/

PCR postit

::

PCR Postit 0.6

[Trackback]
Date : 2006-11-08@12:36:36
Rang : 0

- Ajout du calendrier
- Modification pour les pages perso de free
Telechargements
---------------
http://browser.petitchevalroux.net/index.php/PCR-Postit/release/

PCR postit

::

Post Framasoft

[Trackback]
Date : 2006-10-27@20:49:36
Rang : 0

http://forum.framasoft.org/viewtopic.php?p=172315
http://wiki.framasoft.info/PropositionNotice/PCRPostit

PCR postit

::

PCR Postit 0.4

[Trackback]
Date : 2006-10-25@12:44:30
Rang : 0

- Récriture du moteur avec un cache fichier et un cache memoire pour les postits
- Récriture afin de permettre un ajout de différent type de postit (RSS, Text pour l'instant)
- Passage en PHP5
Telechargements
---------------
http://browser.petitchevalroux.net/index.php/PCR-Postit/release/

Liens

::

Photos Quentin Nouvelle zealand

[Trackback]
Date : 2006-10-18@21:18:47
Rang : 0

Portfolio d'un ami qui est en nouvelle zealand
http://fr.pg.photos.yahoo.com/ph/quentinlebegue/my_photos

Liens

::

Plus tard Bd drole

[Trackback]
Date : 2006-10-04@14:38:24
Rang : 0

http://neogrifter.free.fr/plustard/index.php

MySQL

::

Performance Mysql Cluster

[Trackback]
Date : 2006-09-28@11:03:29
Rang : 0

http://dev.mysql.com/tech-resources/articles/mysql_clustering_ch5.pdf

Extension Firefox

::

Paramètre de firefox

[Trackback]
Date : 2006-08-31@16:02:21
Rang : 0

Astuce pour connaitre les paramêtres de firefox
about:config
about:plugins
about:cache

PCR postit

::

PCR Postit 0.3

[Trackback]
Date : 2006-06-17@17:59:38
Rang : 0

Sortie de PCR Postit 0.3
- Correction d'un bug sur certain serveur tempnam créer le fichier postit dans un repertoire par défault
- Génération automatique des entitées XML en fonction de la table de traduction des caratères html Merci à Edis pour son rapport de bug
- Correction d'un bug lors de l'éditions des postits (La date de création était écrasé par la date de modification)
Telechargements
---------------
http://browser.petitchevalroux.net/index.php/PCR-Postit/release/

PCR postit

::

PCR Postit 0.2

[Trackback]
Date : 2006-06-17@12:46:06
Rang : 0

Sortie de PCR Postit 0.2
Correction d'un bug lors de l'édition des postits
Telechargements
---------------
http://browser.petitchevalroux.net/index.php/PCR-Postit/release/

Liens

::

Pageflakes

[Trackback]
Date : 2006-06-10@14:42:10
Rang : 0

Blog ajax
http://www.pageflakes.com/

PCR postit

::

PCR Postit 0.1

[Trackback]
Date : 2006-06-09@12:07:45
Rang : 0

Sortie de PCR Postit 0.1
Telechargements
---------------
http://browser.petitchevalroux.net/index.php/PCR-Postit/release/

PCR postit

::

Post Alsacreations

[Trackback]
Date : 2006-05-21@16:26:29
Rang : 0

http://forum.alsacreations.com/topic-4-14402-1-Div-bloquer-a-100plus-de-float-sous-IE.html

Liens

::

Petitchevalroux

[Trackback]
Date : 2006-05-16@23:26:44
Rang : 0

http://petitchevalroux.free.fr