Cheat.sh ou l'aide en ligne pour la programmation¶
vous pouvez, par la commande curl, récupérer des informations sur des méthodes de programmation.
via un terminal suivez cette syntaxe :
> curl cheat.sh/[langage_de_programmation]/[une]+[question]+[sur]+[la]+[programmation]
il s'agit d'un moteur de recherche, aussi les questions doivent être posées en Anglais et les espaces sont remplacés par des +
Exemple :
# grdorin @ fablabLT in ~/Script [15:41:51] 
$ curl cheat.sh/c/fork+process        
/* The code is equal to this: */
 int hijo;
 int main(int argc, char*argv[]){
     if (argc < 2) return 1; // let s not crash
     // assume i and N are global variables not shown...
     N=atoi(argv[1]);
     i = 0;
     if (N < 1) return 0; // do not enter loop if N < 1
     do {
         hijo=fork();
     } while (hijo <= 0 && ++i < N);
 }
/*
 * From this we can more easily see, that for the original parent
 * process, where `hijo` value is the pid of the first child, the loop
 * condition is false immediately, and loop ends.
 * 
 * Same repeats for every child process, so a process can only be parent
 * (`hijo > 0`) for one forked process.
 * 
 * [hyde] [so/q/72628831] [cc by-sa 3.0]
 */
sachez qu'il s'agit d'un projet contributif et libre. toutes personnes peuvent tenter de participer. s'il n'y a pas de réponse à une question posée le programme va tenter d'en trouver une sur Stackoverflow, ce qui n'est pas toujours très précis.