This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSynonymie(previewBlock, word) { | |
var searchUrl = "http://www.cnrtl.fr/synonymie/"; | |
CmdUtils.previewAjax(previewBlock, { | |
type: "GET", | |
url: searchUrl + word, | |
error: function() { | |
previewBlock.innerHTML = "<i>Error retreiving synonyms list.</i>"; | |
}, | |
success: function(responseData) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright 2006 Bellière Ludovic <xrogaan@gmail.com> | |
# Distributed under the terms of the GNU General Public License v2 | |
PWD=`pwd` | |
DIR="${PWD}" | |
GREEN="[32;01m" | |
RED="[31;01m" | |
CYAN="[36;01m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
float temps, tauxInteretAnnuel, capital, interet, md; | |
const int annee = 365; | |
capital = 10000.00; | |
tauxInteretAnnuel = 0.035; | |
interet = 0; | |
temps = 1000.00/annee; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function genKey($id) { | |
$rand = rand(0, 1000000); | |
$shaRand = sha1($rand); | |
$shaId = sha1($id); | |
$p1 = rand(0,strlen($shaId)*0.2); | |
$p2 = rand(strlen($shaId)*0.6, strlen($shaId)); | |
// on retourne shaRand et une partie du hash de l'id. | |
return uniqid($shaRand.((strlen($p2) >= strlen($shaId)*0.8) ? substr($shaId, -$p2) : substr($shaId, $p1, $p2))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Smarty plugin | |
* @package Smarty | |
* @subpackage plugins | |
*/ | |
/** | |
* Smarty {form_base} function plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$form = new FormBase( 'editer_intitules', // son nom | |
url_from_get_vars( false ), // son url de submit est l'url du script courant (url_from_get_vars) | |
false, // préfixe de clé par défaut | |
array( // liste des champs du form | |
"Informations intitulés", // Titre du chapitre 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "gestion.h" | |
float MOYENNE( float tableau[6]) | |
{ | |
int i,y; | |
float min=tableau[0],somme=0; | |
for (i=0; min<6; i++) { | |
if (tableau[i]<min){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Calcule le nombre de lignes et de colonnes pour afficher un tableau harmonieux | |
* | |
* la taille max demandée. Si $prefer_few_cols est true, génère un tableau avec $maxcols colonnes | |
* et plus de lignes, sinon génère un tableau avec $maxrows lignes et plus de colonnes. | |
* | |
* @param integer $ncells nombre d'éléments à mettre dans le tableau | |
* @param integer $maxcols nombre maxi de colonnes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
define('OBIWANKENOBI', true); | |
function debug($message) { | |
if (OBIWANKENOBI) { | |
if (!is_array($message)) { | |
printf("DEBUG : %s\n", $message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Construit une URL en reprenant l'URL actuelle et certains de ses paramètres GET | |
si $keep est un array, seuls les éléments de $keep sont conservés | |
si $remove est un array, les éléments de $remove sont enlevés | |
si $add est un array( clé => valeur ), ces paramètres sont ajoutés à l'URL | |
exemple : | |
url actuelle : truc.php?a=1&b=2 | |
url_from_get_vars( array( 'a' ), false, array( 'c' => 3 ) ) | |
=> truc.php?a=1&c=3 |
OlderNewer