Skip to content

Instantly share code, notes, and snippets.

View rakotomandimby's full-sized avatar

Rakotomandimby Mihamina rakotomandimby

View GitHub Profile
@rakotomandimby
rakotomandimby / rktmb.php
Created September 21, 2011 11:12
A test PHP file
<?php
print "mihamina";
?>
@rakotomandimby
rakotomandimby / factorielle.php
Created September 23, 2011 16:36
Une putain de petite epreuve que des ingénieurs n'arrive pas à reussir...
<?php
if((isset($_REQUEST['nombre']) && is_numeric($_REQUEST['nombre'])) && ($_REQUEST['nombre'] < 20))
{
$max=$_REQUEST['nombre'];
$resultat=1;
for($i=1; $i<=$max; $i++) { $resultat=$resultat*$i;}
$message="Factorielle(".$max.") => ".$resultat;
}
else
{
@rakotomandimby
rakotomandimby / factorielle.html
Created September 28, 2011 07:19
La partie HTML
<html>
<head>
<title>Factorielle</title>
</head>
<body>
<h1>Factorielle</h1>
<div>Entrer un nombre:</div>
<div>
<form name="factorielle">
<input id="requete" type="text" value="" onkeyup="resultat()">
@rakotomandimby
rakotomandimby / wiki-user-qcm
Created January 4, 2012 08:42
QCM wiki user
#set($user = $userAccessor.getUser())
<iframe src="http://hostname/qcm?user=$user.name"></iframe>
<?php
class ArticleModel
{
public static function getArticleIds()
{
$xml = new XMLReader();
$tmp = $xml->open('encheres.xml');
while($xml->read())
<?php
class PersonModel
{
public static function getPersonIds()
{
$xml = new XMLReader();
$tmp = $xml->open('encheres.xml');
while($xml->read())
{
<?php
class PersonModel
{
public function __construct($id)
{
$xml = new XMLReader();
$tmp = $xml->open('encheres.xml');
while($xml->read())
{
<?php
class ArticleModel
{
public function __construct($id)
{
$xml = new XMLReader();
@rakotomandimby
rakotomandimby / beauc.js
Created May 28, 2013 10:08
Texte avec des commentaires pas beaux
var div=document.getElementById("font"); /* accéder au noeud élément qui a pour id font */
var tprin=document.createElement('H1'); /* créer un titre h1 et l'affecte dans une variable tprin */
var text1= document.createTextNode('TABLE DE MULTIPLICATION'); /* créer un texte et le nomme par une variable text1 */
tprin.appendChild(text1); /* fait de text1 un noeud enfant de tprin, c'est-à-dire text1 est un texte qui est présent dans tprin*/
div.appendChild(tprin); /* tprin est noeud enfant de div */
var tab=document.createElement("TABLE"); /* créer un noeud element table ie tableau */
div.appendChild(tab); /* mettre table dans div */
for(var ligne=0;ligne<=2;ligne++) /* boucler les lignes suivant z
@rakotomandimby
rakotomandimby / ModelPassage.php
Created June 21, 2013 13:27
Ennoncé exo PHP
<?php
class ModelPassage
{
public function __construct($recherche)
{
$this->recherche=$recherche;
$this->bdd_en=new PDO('mysql:host=localhost; dbname=bible','dev','dev');
$this->requete_existence_livre_en=$this->bdd_en->prepare('SELECT * FROM kjv WHERE bname = :chercher');
$this->bdd_fr=new PDO('mysql:host=localhost; dbname=bible_fr','dev','dev');
$this->requete_existence_livre_fr=$this->bdd_fr->prepare('SELECT * FROM ref_bible WHERE livre = :chercher');