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 | |
/** | |
* Copyright 2010 Ludovic Bellière. All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without modification, are | |
* permitted provided that the following conditions are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright notice, this list of | |
* conditions and the following disclaimer. | |
* |
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
#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 | |
$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
<?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 | |
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
#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
#!/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
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) { |
NewerOlder