renvoie la taille d'un fichier , mise en forme (octets, kilooctets , mega ...)
495191
function fileSize($fichier)
	{
		$taille_fichier = "0";

		$taille_fichier = filesize($fichier);
		if ($taille_fichier >= 1073741824) 
		{
			$taille_fichier = round($taille_fichier / 1073741824 * 100) / 100 . " Go";
		}
		elseif ($taille_fichier >= 1048576) 
		{
			$taille_fichier = round($taille_fichier / 1048576 * 100) / 100 . " Mo";
		}
		elseif ($taille_fichier >= 1024) 
		{
			$taille_fichier = round($taille_fichier / 1024 * 100) / 100 . " Ko";
		}
		else 
		{
			$taille_fichier = $taille_fichier . " o";
		}

		return $taille_fichier;
	}
9733
void readFromFile() throws IOException {
		final Counter counter = new CounterStorage(this).readFromFile();
		if (counter != null) {
			final Counter newCounter = clone();
			startDate = counter.getStartDate();
			requests.clear();
			for (final CounterRequest request : counter.getRequests()) {
				requests.put(request.getName(), request);
			}
			if (errors != null) {
				errors.clear();
				errors.addAll(counter.getErrors());
			}
			// on ajoute les nouvelles requêtes enregistrées avant de lire le fichier
			// (par ex. les premières requêtes collectées par le serveur de collecte lors de l'initialisation)
			addRequestsAndErrors(newCounter);
		}
	}
943403
public static void fe_mul121666(int[] h,int[] f)
{
  int f0 = f[0];
  int f1 = f[1];
  int f2 = f[2];
  int f3 = f[3];
  int f4 = f[4];
  int f5 = f[5];
  int f6 = f[6];
  int f7 = f[7];
  int f8 = f[8];
  int f9 = f[9];
  long h0 = f0 * (long) 121666;
  long h1 = f1 * (long) 121666;
  long h2 = f2 * (long) 121666;
  long h3 = f3 * (long) 121666;
  long h4 = f4 * (long) 121666;
  long h5 = f5 * (long) 121666;
  long h6 = f6 * (long) 121666;
  long h7 = f7 * (long) 121666;
  long h8 = f8 * (long) 121666;
  long h9 = f9 * (long) 121666;
  long carry0;
  long carry1;
  long carry2;
  long carry3;
  long carry4;
  long carry5;
  long carry6;
  long carry7;
  long carry8;
  long carry9;

  carry9 = (h9 + (long) (1<<24)) >> 25; h0 += carry9 * 19; h9 -= carry9 << 25;
  carry1 = (h1 + (long) (1<<24)) >> 25; h2 += carry1; h1 -= carry1 << 25;
  carry3 = (h3 + (long) (1<<24)) >> 25; h4 += carry3; h3 -= carry3 << 25;
  carry5 = (h5 + (long) (1<<24)) >> 25; h6 += carry5; h5 -= carry5 << 25;
  carry7 = (h7 + (long) (1<<24)) >> 25; h8 += carry7; h7 -= carry7 << 25;

  carry0 = (h0 + (long) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
  carry2 = (h2 + (long) (1<<25)) >> 26; h3 += carry2; h2 -= carry2 << 26;
  carry4 = (h4 + (long) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
  carry6 = (h6 + (long) (1<<25)) >> 26; h7 += carry6; h6 -= carry6 << 26;
  carry8 = (h8 + (long) (1<<25)) >> 26; h9 += carry8; h8 -= carry8 << 26;

  h[0] = (int)h0;
  h[1] = (int)h1;
  h[2] = (int)h2;
  h[3] = (int)h3;
  h[4] = (int)h4;
  h[5] = (int)h5;
  h[6] = (int)h6;
  h[7] = (int)h7;
  h[8] = (int)h8;
  h[9] = (int)h9;
}
250901
private double[] calculateMaximumSlope( BitMatrix analizedMatrix, RandomIter pitRandomIter, WritableRandomIter tcaRandomIter,
            int col, int row ) {
        double[] maxSlopeData = new double[10];
        int n = 1, m = 1;

        double dirmax = 0f, e1min = -9999f, e2min = -9999f;

        analizedMatrix.mark(col, row);
        tcaRandomIter.setSample(col, row, 0, 1);
        double pendmax = 0f;
        maxSlopeData[3] = pitRandomIter.getSampleDouble(col, row, 0);
        /*
         * per ogni triangolo calcolo la pendenza massima e la direzione di
         * deflusso reale.
         */
        for( int j = 0; j <= 7; j++ ) {
            n = tri[j][0];
            m = tri[j][1];

            maxSlopeData[4] = pitRandomIter.getSampleDouble(col + order[n][1], row + order[n][0], 0);
            maxSlopeData[5] = pitRandomIter.getSampleDouble(col + order[m][1], row + order[m][0], 0);
            /*
             * verifico che i punti attorno al pixel considerato non siano
             * novalue. In questo caso trascuro il triangolo.
             */
            if (!isNovalue(maxSlopeData[4]) && !isNovalue(maxSlopeData[5])) {
                calculateMaxSlopeAndDirection4Triangles(maxSlopeData);
                if (maxSlopeData[1] > pendmax) {
                    dirmax = maxSlopeData[2];
                    pendmax = maxSlopeData[1];
                    /* - direzione cardinale */
                    maxSlopeData[7] = tri[j][0];
                    /* - direzione diagonale */
                    maxSlopeData[8] = tri[j][1];
                    /* - segno del triangolo */
                    maxSlopeData[9] = tri[j][2];
                    /*
                     * - quote del triangolo avente pendenza
                     * maggiore
                     */
                    e1min = maxSlopeData[4];
                    /*
                     * non necessariamente sono le quote
                     * minime.
                     */
                    e2min = maxSlopeData[5];
                }
            }
        }
        maxSlopeData[1] = pendmax;
        maxSlopeData[2] = dirmax;
        maxSlopeData[4] = e1min;
        maxSlopeData[5] = e2min;

        return maxSlopeData;
    }
164066
function Steps(list,strength) {
        /**
         * liste des paliers
         */
        this.list = list || [];
        /**
         * force de l'aimantation
         */
        this.strength = JSYG.isNumeric(strength) ? strength : 10;
        /**
         * type de données ("scale" pour liste d'échelles ou "dim" pour liste de dimensions)
         */
        this.type = 'dim';
    }
1153839
def getWithDateFormat(self, name, default="", parent_search=False, multikeys_search=False):
		
		# récupération de la valeur
		value = self.get(name, default, parent_search, multikeys_search)

		# récupération d'un delta dans le nom
		#  {dd-10} donne 10 jours avant le jour d'aujourd'hui
		#  {H+12} donne 12 heures après l'heure courante
		# delta_d = int(re.findall(r"[+|-]\d+", value)[0]) if value.startswith("{dd") else 0

		# objet de date interne
		d = FastDate()

		# récupation des dates
		now = d.convert()

		tomorrow = d.tomorrow()
		yesterday = d.yesterday()

		weekday_tomorrow = d.weekday_tomorrow()
		weekday_yesterday = d.weekday_yesterday()

		weekend_tomorrow = d.weekend_tomorrow()
		weekend_yesterday = d.weekend_yesterday()

		working_tomorrow = d.working_tomorrow()
		working_yesterday = d.working_yesterday()

		# formatage de la valeur
		return value.format(
			yyyy=now.year,
			mm=now.strftime("%m"),
			dd=now.strftime("%d"),
			H=now.strftime("%H"),
			M=now.strftime("%M"),
			S=now.strftime("%S"),
			mm_human=now.strftime("%B"),

			tomorrow_yyyy=tomorrow.year,
			tomorrow_mm=tomorrow.strftime("%m"),
			tomorrow_dd=tomorrow.strftime("%d"),
			tomorrow_H=tomorrow.strftime("%H"),
			tomorrow_M=tomorrow.strftime("%M"),
			tomorrow_S=tomorrow.strftime("%S"),
			tomorrow_mm_human=tomorrow.strftime("%B"),

			yesterday_yyyy=yesterday.year,
			yesterday_mm=yesterday.strftime("%m"),
			yesterday_dd=yesterday.strftime("%d"),
			yesterday_H=yesterday.strftime("%H"),
			yesterday_M=yesterday.strftime("%M"),
			yesterday_S=yesterday.strftime("%S"),
			yesterday_mm_human=yesterday.strftime("%B"),

			weekday_yesterday_yyyy=weekday_yesterday.year,
			weekday_yesterday_mm=weekday_yesterday.strftime("%m"),
			weekday_yesterday_dd=weekday_yesterday.strftime("%d"),
			weekday_yesterday_H=weekday_yesterday.strftime("%H"),
			weekday_yesterday_M=weekday_yesterday.strftime("%M"),
			weekday_yesterday_S=weekday_yesterday.strftime("%S"),
			weekday_yesterday_mm_human=weekday_yesterday.strftime("%B"),

			weekday_tomorrow_yyyy=weekday_tomorrow.year,
			weekday_tomorrow_mm=weekday_tomorrow.strftime("%m"),
			weekday_tomorrow_dd=weekday_tomorrow.strftime("%d"),
			weekday_tomorrow_H=weekday_tomorrow.strftime("%H"),
			weekday_tomorrow_M=weekday_tomorrow.strftime("%M"),
			weekday_tomorrow_S=weekday_tomorrow.strftime("%S"),
			weekday_tomorrow_mm_human=weekday_tomorrow.strftime("%B"),

			weekend_yesterday_yyyy=weekend_yesterday.year,
			weekend_yesterday_mm=weekend_yesterday.strftime("%m"),
			weekend_yesterday_dd=weekend_yesterday.strftime("%d"),
			weekend_yesterday_H=weekend_yesterday.strftime("%H"),
			weekend_yesterday_M=weekend_yesterday.strftime("%M"),
			weekend_yesterday_S=weekend_yesterday.strftime("%S"),
			weekend_yesterday_mm_human=weekend_yesterday.strftime("%B"),

			weekend_tomorrow_yyyy=weekend_tomorrow.year,
			weekend_tomorrow_mm=weekend_tomorrow.strftime("%m"),
			weekend_tomorrow_dd=weekend_tomorrow.strftime("%d"),
			weekend_tomorrow_H=weekend_tomorrow.strftime("%H"),
			weekend_tomorrow_M=weekend_tomorrow.strftime("%M"),
			weekend_tomorrow_S=weekend_tomorrow.strftime("%S"),
			weekend_tomorrow_mm_human=weekend_tomorrow.strftime("%B"),

			working_tomorrow_yyyy=working_tomorrow.year,
			working_tomorrow_mm=working_tomorrow.strftime("%m"),
			working_tomorrow_dd=working_tomorrow.strftime("%d"),
			working_tomorrow_H=working_tomorrow.strftime("%H"),
			working_tomorrow_M=working_tomorrow.strftime("%M"),
			working_tomorrow_S=working_tomorrow.strftime("%S"),
			working_tomorrow_mm_human=working_tomorrow.strftime("%B"),

			working_yesterday_yyyy=working_yesterday.year,
			working_yesterday_mm=working_yesterday.strftime("%m"),
			working_yesterday_dd=working_yesterday.strftime("%d"),
			working_yesterday_H=working_yesterday.strftime("%H"),
			working_yesterday_M=working_yesterday.strftime("%M"),
			working_yesterday_S=working_yesterday.strftime("%S"),
			working_yesterday_mm_human=working_yesterday.strftime("%B"),
		)
3167
public function formulaireActualites($params = array())
    {
        $html = "";
        $f    = new formGenerator();
        $d    = new dateObject();
        $c    = new calqueObject();
        $this->addToJsHeader("<script>".$c->getJSScrollHeight()."</script>");
        $html                                    .= $c->getDiv(array('width'=>900, 'lienSrcIFrame'=>'', 'titre'=>'Prévisualisation'));
        $idActualite                              = 0;
        $boutonNouveau                            = "";
        $boutonSupprimer                          = "";
        $boutonPrevisualiser                      = "<input type='button' name='previsualisation' value='Prévisualisation' onclick=\"tinyMCE.triggerSave(true,true);document.getElementById('".$c->getJSDivId()."').style.top=(50+getScrollHeight())+'px';document.getElementById('".$c->getJSIFrameId()."').src='".$this->creerUrl('', 'previsualisationActualite', array())."';".$c->getJSOpenPopup()."\">";
        $boutonValiderEtEnvoiMailPrevisualisation = "<input type='button' name='valideEtEnvoi' id='valideEtEnvoi' value=\"Envoyer le mail tout de suite\" onclick=\"document.getElementById('formActu').action+='&previsualisationMail=1';document.getElementById('formActu').submit();\">
        <input type='button' name='valideEtPrev' id='valideEtPrev' value='"._("Prévisualiser le mail")."' onclick=\"document.getElementById('formActu').action+='&previsualisationMail=1&preview=1';document.getElementById('formActu').setAttribute('target', '_blank'); document.getElementById('formActu').submit();\">
        <input type='button' name='testMail' id='testMail' value='"._("Envoyer un mail de test")."' onclick=\"document.getElementById('formActu').action+='&previsualisationMail=1&preview=1&testMail=1';document.getElementById('formActu').setAttribute('target', '_blank'); document.getElementById('formActu').submit();\">
        ";
        if (isset($this->variablesGet['archiIdActualite']) && $this->variablesGet['archiIdActualite']!='') {
            $idActualite           = $this->variablesGet['archiIdActualite'];
            $reqActu               = "SELECT date,titre, sousTitre,photoIllustration, texte,urlFichier, fichierPdf, desactive,texteMailHebdomadaire,envoiMailHebdomadaire FROM actualites WHERE idActualite='".$idActualite."'";
            $resActu               = $this->connexionBdd->requete($reqActu);
            $fetchActu             = mysql_fetch_assoc($resActu);
            $date                  = $d->toFrenchAffichage($fetchActu['date']);
            $titre                 = $fetchActu['titre'];
            $sousTitre             = $fetchActu['sousTitre'];
            $illustration          = $fetchActu['photoIllustration'];
            $description           = $fetchActu['texte'];
            $urlFichier            = $fetchActu['urlFichier'];
            $fichierPdf            = $fetchActu['fichierPdf'];
            $isDesactivated        = $fetchActu['desactive'];
            $texteMailHebdomadaire = $fetchActu['texteMailHebdomadaire'];
            $isEnvoi               = $fetchActu['envoiMailHebdomadaire'];
            $formAction            = $this->creerUrl('modifierActu', 'adminActualites', array('archiIdActualite'=>$idActualite));
            $boutonNouveau         = "<input type='button' name='nouveauButton' value='Nouveau' onclick=\"location.href='".$this->creerUrl('', 'adminActualites', array())."'\">";
            $boutonSupprimer       = "<input type='button' name='supprimerBouton' value='Supprimer' onclick=\"location.href='".$this->creerUrl('supprimerActu', 'adminActualites', array("idActuSuppr"=>$idActualite))."'\">";
        } else {
            $date                  = date("d/m/Y");
            $titre                 = "";
            $sousTitre             = "";
            $illustration          = "";
            $description           = "";
            $urlFichier            = "";
            $fichierPdf            = "";
            $isDesactivated        = 0;
            $texteMailHebdomadaire = "";
            $isEnvoi               = 0;
            $formAction            = $this->creerUrl('ajouterActu', 'adminActualites', array('check'=>1));

            // check sert juste a ne pas avoir a gerer le ? ou le & dans l'url quand on rajoute un parametre en js
        }
        $idActualitePathImage = "";
        if ($idActualite!=0) {
            $idActualitePathImage = $idActualite;
        }

        // bibliotheques d'images
        $fileObject    = new fileObject();
        $arrayFiles    = $fileObject->getListeFichiersArrayFrom($this->getCheminPhysique()."images/actualites/".$idActualite."/");
        $listeFichiers = "";
        $t             = new tableau();
        foreach ($arrayFiles as $indiceFichier=>$fichier) {
            if (strtolower($fileObject->getExtensionFromFile($fichier))=='jpg' || strtolower($fileObject->getExtensionFromFile($fichier))=='gif' || strtolower($fileObject->getExtensionFromFile($fichier))=='png') {
                $t->addValue("<a onclick='injectInTinyMce(\"<img src=\\\"".$this->getUrlImage()."actualites/".$idActualite."/".str_replace("'", "\\\'", $fichier)."\\\" border=0>\");'><img src=\"".$this->getUrlImage()."actualites/".$idActualite."/".$fichier."\" border=0 width=100 height=100></a>");
                $t->addValue("$fichier");
            } else {
                $t->addValue("&nbsp;");
                $t->addValue("$fichier");
            }
        }
        $listeFichiers = $t->createTable(2);
        $gestionBibliothequeImages = "Bibliothèque d'images de l'actualité <span style='font-size:11px;'>(cliquez sur une image pour l'inserer à la position du curseur)</span> : <div id='listeFichiers' style='background-color:#87CEFF;width:300px;height:200px;overflow:scroll;'>".$listeFichiers."</div>";
        $this->addToJsHeader(
            "<script>
                function injectInTinyMce(txt)
                {
                    tinyMCE.execInstanceCommand('texte','mceInsertContent',false,txt);
                }
                
                function goRedim(idActualite)
                {
                    // validation du formulaire pour creer l'identifiant de l'actu et pouvoir ranger les photos
                    document.getElementById('formActu').submit();
                }
            </script>"
        );

        // on ne gere pas de timestamp , on assume que seul l'admin fera des mises a jour des actualités
        $applet       = $fileObject->getAppletUploadMultiple(array('cheminApplet'=>$this->getUrlRacine()."/includes/", 'uploadDirPart1'=>$this->getCheminPhysique()."images/", 'uploadDirPart2'=>"uploadMultipleActualites/", 'jsFunctionNameOnExit'=>"goRedim($idActualite)"));
        $configFields = array('idActualite'=>array('libelle'=>"idActualite", 'type'=>'hidden', 'required'=>true, 'value'=>'', 'forceValueTo'=>$idActualite, 'htmlCode'=>'', 'error'=>''), 'desactive'=>array('libelle'=>"désactiver", 'type'=>'singleCheckBox', 'required'=>false, 'value'=>'', 'forceValueTo'=>'1', 'isChecked'=>$isDesactivated, 'htmlCode'=>'', 'error'=>'', 'default'=>''), 'date'=>array('libelle'=>"date", 'withDatePicker'=>true, 'type'=>'date', 'required'=>true, 'value'=>'', 'forceValueTo'=>$date, 'htmlCode'=>'', 'error'=>''), 'titre'=>array('libelle'=>"titre", 'type'=>'text', 'required'=>false, 'value'=>'', 'forceValueTo'=>$titre, 'htmlCode'=>"style='width:300px;'", 'error'=>''), 'sousTitre'=>array('libelle'=>"sous-titre", 'type'=>'text', 'required'=>false, 'value'=>'', 'forceValueTo'=>$sousTitre, 'htmlCode'=>"style='width:300px;'", 'error'=>''), 'photoIllustration'=>array('libelle'=>"illustration", 'type'=>'uploadImage', 'required'=>false, 'value'=>'', 'forceValueTo'=>$illustration, 'physicalImagePathForTestExists'=>$this->getCheminPhysique()."images/actualites/".$idActualitePathImage."/", 'urlImagePathForDisplayInForm'=>$this->getUrlImage()."actualites/".$idActualitePathImage."/", 'htmlCode'=>'', 'error'=>''), 'texte'=>array('libelle'=>"description", 'type'=>'tinyMCE', 'required'=>false, 'value'=>'', 'forceValueTo'=>$description, 'htmlCode'=>"cols=80 rows=30", 'error'=>'', 'htmlCode2'=>$gestionBibliothequeImages."<div><a onclick=\"if(document.getElementById('divApplet').style.display=='none'){document.getElementById('divApplet').style.display='block';}else{document.getElementById('divApplet').style.display='none';}\" style='cursor:pointer;'>Voir/cacher ajouter une image</a></div><div id='divApplet' style='float:left;display:none'>".$applet."</div>"), 'urlFichier'=>array('libelle'=>"url redirection", 'type'=>'text', 'required'=>false, 'value'=>'', 'forceValueTo'=>$urlFichier, 'htmlCode'=>"style='width:300px;'", 'error'=>''), 'fichierPdf'=>array('libelle'=>"fichier pdf", 'type'=>'text', 'required'=>false, 'value'=>'', 'forceValueTo'=>$fichierPdf, 'htmlCode'=>"style='width:300px;'", 'error'=>''), 'texteMailHebdomadaire'=>array('libelle'=>"description mail hebdomadaire <span style='color:red;'>(ne pas oublier de préciser le titre)</span>", 'type'=>'tinyMCE', 'required'=>false, 'value'=>'', 'forceValueTo'=>$texteMailHebdomadaire, 'htmlCode'=>"cols=80 rows=30", 'error'=>''), 'envoiMailHebdomadaire'=>array('libelle'=>"envoi avec la newsletter hebdomadaire", 'type'=>'singleCheckBox', 'required'=>false, 'value'=>'', 'forceValueTo'=>'1', 'isChecked'=>$isEnvoi, 'htmlCode'=>'', 'error'=>'', 'default'=>''));
        $configForm   = array("fields"=>$configFields, 'formAction'=>$formAction, 'codeHtmlAfterSubmitButton'=>$boutonNouveau.$boutonSupprimer.$boutonPrevisualiser.$boutonValiderEtEnvoiMailPrevisualisation, 'formName'=>'formActu');
        $html        .= $f->afficherFromArray($configForm);
        return $html;
    }
1182049
def allonge(f):
    
    if not f:
        return ""

    return f

    ## TODO : Implementer correctement la suite

    taille = len(f)
    # Je sais que le morceau à attacher commence par une consonne.
    if f[taille-2] in consonnes and not f[-2:].lower() in ["āe", "āu", "ēu",  "ōe"]:
        f = re.sub("[a\u0103]([" + consonnes + "])$", "\u0101\\1", f)
        f = re.sub("[e\u0115]([" + consonnes + "])$", "\u0113\\1", f)
        f = re.sub("[i\u012d]([" + consonnes + "])$", "\u012b\\1", f)
        f = re.sub("[o\u014F]([" + consonnes + "])$", "\u014d\\1", f)
        f = re.sub("[u\u016d]([" + consonnes + "])$", "\u016b\\1", f)
        f = re.sub("[y\u0233]([" + consonnes + "])$", "\u045e\\1", f)
        f = re.sub("[A\u0102]([" + consonnes + "])$", "\u0100\\1", f)
        f = re.sub("[E\u0114]([" + consonnes + "])$", "\u0112\\1", f)
        f = re.sub("[I\u012c]([" + consonnes + "])$", "\u012a\\1", f)
        f = re.sub("[O\u014e]([" + consonnes + "])$", "\u014c\\1", f)
        f = re.sub("[U\u016c]([" + consonnes + "])$", "\u016a\\1", f)
        f = re.sub("[Y\u0232]([" + consonnes + "])$", "\u040e\\1", f)
        return f
38189
private function hpkp(): array
    {
        // TODO : lever une exception si les champs hashes et max-age sont vide, car ils doivent tous les deux avoir une valeur chacun (cad un hash au minimum + un maxage)
        $values = [];
        foreach ($this->security['hpkp']['hashes'] as $hash) {
            $values[] = sprintf('pin-sha256="%s"', $hash);
        }
        $values[] = sprintf('max-age=%d', $this->security['hpkp']['max-age']);
        if ($this->security['hpkp']['include-sub-domains']) {
            $values[] = 'includeSubDomains';
        }
        if (! empty($this->security['hpkp']['report-uri'])) {
            $values[] = sprintf('report-uri="%s"', $this->security['hpkp']['report-uri']);
        }
        $header = $this->security['hpkp']['report-only']
            ? 'Public-Key-Pins-Report-Only'
            : 'Public-Key-Pins';

        return [$header => implode('; ', $values)];
    }
854869
private static PCM clear_colonne(PCM pcm, PCM pcm_return){
		List<Feature> pdts = pcm.getConcreteFeatures();
		List<Cell> cells = new ArrayList<Cell>() ;
		for (Feature pr : pdts) {
			float nbCellsEmpty = 0 ;
			// On ajoute les cellules du product dans une liste
			cells = pr.getCells();
			// On traite les infos des cellules
			for(Cell c : cells){
				if(c.getContent().isEmpty()){
					nbCellsEmpty ++ ;
				}
			}
			if(cells.size() != 0){
				System.out.println("Dans les colonnes -- > \n Nombre de cellule vide :" + nbCellsEmpty + "\n Nombre de cellule : " + cells.size());
				System.out.println("Valeur du if : " + nbCellsEmpty/cells.size());
				if(!((nbCellsEmpty/cells.size()) > RATIO_EMPTY_CELL)){
					System.out.println("on ajoute la colonne !");
					pcm_return.addFeature(pr);;
				}
			}
		}
		
		return pcm_return;
	}
1356909
public function ajouter()
    {
        $newIdPersonne=0;
        $formulaire = new formGenerator();
        if (isset($this->variablesPost['submit'])) {
            $modeAffichage='';
            if (isset($this->variablesGet['modeAffichage']) && $this->variablesGet['modeAffichage']!='') {
                $modeAffichage = $this->variablesGet['modeAffichage'];
            }


            switch ($modeAffichage) {
                case 'nouveauDossier':
                case "modifEvenement":
                    $tabForm = array(
                    'prenom'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'nom'        => array('default'=> '',  'value' => '',  'required'=>true, 'error'=>'', 'type'=>'text'),
                    'description'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'dateNaissance'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'date'),
                    'dateDeces'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'date'),
                    'metier'    => array('default'=> 'aucune' ,  'value' => '',  'required'=>false , 'error'=>'', 'type'=>'numeric',  'checkExist'=>
                                    array('table'=> 'metier',  'primaryKey'=> 'idMetier')));

                    break;

                default:
                    $tabForm = array(
                    'prenom'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'nom'        => array('default'=> '',  'value' => '',  'required'=>true, 'error'=>'', 'type'=>'text'),
                    'description'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'nouveauMetier'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'text'),
                    'dateNaissance'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'date'),
                    'dateDeces'    => array('default'=> '',  'value' => '',  'required'=>false, 'error'=>'', 'type'=>'date'),
                    'metier'    => array('default'=> 'aucune' ,  'value' => '',  'required'=>false , 'error'=>'', 'type'=>'numeric',  'checkExist'=>
                                    array('table'=> 'metier',  'primaryKey'=> 'idMetier')));

                    break;
            }
            $erreur = $formulaire->getArrayFromPost($tabForm);

            if (count($erreur) === 0) {
                $prenom = mysql_escape_string($tabForm['prenom']['value']);
                $nom    = mysql_escape_string($tabForm['nom']['value']);
                $description   = isset($_POST['descriptionPerson'])?mysql_escape_string($_POST['descriptionPerson']):mysql_escape_string(htmlspecialchars($tabForm['description']['value']));
                $dateNaissance = $this->date->toBdd($this->date->convertYears($tabForm['dateNaissance']['value']));
                $dateDeces     = $this->date->toBdd($this->date->convertYears($tabForm['dateDeces']['value']));

                /*if (!empty($tabForm['nouveauMetier']['value']))
                {
                    // nouveau metier
                    $nomMetier = mysql_escape_string($tabForm['nouveauMetier']['value']);
                    $sql = "SELECT idMetier FROM metier WHERE nom='".$nomMetier."' LIMIT 1";
                    $rep = $this->connexionBdd->requete($sql);
                    if (mysql_num_rows($rep) === 1)
                    {
                        $res = mysql_fetch_object($rep);
                        $idMetier = $res->idMetier;
                        echo "métier existe";
                    }
                    else
                    {
                        $sql = "INSERT INTO metier (nom) VALUES ('".$nomMetier."')";
                        $this->connexionBdd->requete($sql);
                        $idMetier = mysql_insert_id();
                        echo 'métier existe pas';
                    }
                }
                else if (empty($tabForm['metier']['error']) AND !empty($tabForm['metier']['value']))
                {*/
                    // valeur du select
                    $idMetier      = $tabForm['metier']['value'];
                    //echo 'métier select';
                /*}
                else
                {
                    // choix par défaut
                    $idMetier = 1;
                    echo 'défaut';
                }*/
                $sql ="INSERT INTO personne (prenom,  nom,  dateNaissance,  dateDeces,  description,  idMetier ) VALUES
                    ('".$prenom."', '".$nom."', '".$dateNaissance."', '".$dateDeces."', '".$description."', ".$idMetier.")";


                $this->connexionBdd->requete($sql);

                $newIdPersonne = mysql_insert_id();
            } else {
                $this->erreurs->ajouter($tabForm);
            }
            $this->erreurs->ajouter($tabForm);
        }

        return $newIdPersonne;
    }
737311
def encodeSemiOctets(number):
    
    if len(number) % 2 == 1:
        number = number + 'F' # append the "end" indicator
    octets = [int(number[i+1] + number[i], 16) for i in xrange(0, len(number), 2)]
    return bytearray(octets)
533681
function(n) {
				
				// Es un número válido, no empieza por 0X (ej: 02) y solo contiene números y puntuación
				
				return !isNaN(parseFloat(n)) && isFinite(n) && /^(?!0\d)/.test(n) && /^[\d\.]+$/.test(n);

			}
140382
def plot_basis(ax, arm_length=1):
    """"""

    ax.set_xlim3d([-1.0, 1.0])
    ax.set_xlabel('X')

    ax.set_ylim3d([-1.0, 1.0])
    ax.set_ylabel('Y')

    ax.set_zlim3d([-1.0, 1.0])
    ax.set_zlabel('Z')

    # Plot du repère
    # Sa taille est relative à la taille du bras
    ax.plot([0, arm_length * 1.5], [0, 0], [0, 0])
    ax.plot([0, 0], [0, arm_length * 1.5], [0, 0])
    ax.plot([0, 0], [0, 0], [0, arm_length * 1.5])
602850
public static void main(String[] args) throws IOException {

		
		// TODO : le pcm mutate est bien différent du pcm de base, mais les changements ne sont pas pris en compte. A travailler !
		
		// inputpath = args[0];
		inputpath = "off_output/pcms/test_paget/input";
		outputpath = "off_output/pcms/test_paget/output";

		try {


			Stream<Path> paths = Files.walk(Paths.get(inputpath));

			paths.forEach(filePath -> {
				
				if (Files.isRegularFile(filePath) && filePath.toString().endsWith(".pcm")) {
					System.out.println("> PCM read from " + filePath);
				     
					//File pcmFile = new File(filePath.toString());

					PCMContainer pcmC = null ;
					//PCMContainer pcmC = JSONtoPCM.JSONFormatToPCM(JSONReader.importJSON(filePath.toString())) ;
					//PCMLoader loader = new KMFJSONLoader();
					//List<PCMContainer> pcmContainers = null;
					try {
						pcmC = JSONtoPCM.JSONFormatToPCM(JSONReader.importJSON(filePath.toString())) ;
					} catch (Exception e) {
						e.printStackTrace();
					}

//					for (PCMContainer pcmContainer : pcmContainers) {
//						// Get the PCM
						
						PCMInfoContainerMuted pcmic = null;
						
						try {
							System.out.println(pcmic.toString());
							pcmic = new PCMInfoContainerMuted(pcmC);
						} catch (Exception e) {
							e.printStackTrace();
						}
						if (pcmic != null) {
							if (pcmic.isSameSizePcm()) {
								System.out.println("> PCM muted is the same");
							} else {
								pcmC.setPcm(pcmic.getMutedPcm().getPcm());
								KMFJSONExporter pcmExporter = new KMFJSONExporter();
								String pcmString = pcmExporter.export(pcmC);
								
								Path p = Paths.get(outputpath + "muted_" ) ;//filePath.getFileName());
								try {
									Files.write(p, pcmString.getBytes());
								} catch (Exception e) {
									e.printStackTrace();
								}
								System.out.println("> PCM exported to " + p);
							}
						}
						else {
							System.out.println("> PCM corrompu");
						}

				}

			});
			// mongoClient.close();
			paths.close();

		} catch (Exception e) {
			// mongoClient.close();
			e.printStackTrace();
		}
	}
205571
public static function gerar()
    {
        $cnpj = array ();
        for ($i = 0; $i < 8; $i++) {
            $cnpj[$i] = rand(0, 9);
        }
        $cnpj[8]  = 0;
        $cnpj[9]  = 0;
        $cnpj[10] = 0;
        $cnpj[11] = 1;

        // Primeiro dígito
        $multiplicadores = array (5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2);
        $soma            = 0;
        for ($i = 0; $i <= 11; $i++) {
            $soma += $multiplicadores[$i] * $cnpj[$i];
        }
        $d1 = 11 - ($soma % 11);
        if ($d1 >= 10) {
            $d1 = 0;
        }
        $cnpj[12] = $d1;

        // Segundo dígito
        $multiplicadores = array (6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2);
        $soma            = 0;
        for ($i = 0; $i <= 12; $i++) {
            $soma += $multiplicadores[$i] * $cnpj[$i];
        }
        $d2 = 11 - ($soma % 11);
        if ($d2 >= 10) {
            $d2 = 0;
        }
        $cnpj[13] = $d2;

        return static::formatar(implode("", $cnpj));
    }
284425
def _mdens(self,m):
        """"""
        return (self.a/m)**self.alpha/(1.+m/self.a)**(self.betaminusalpha)