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 | |
public function checkURL($url) { | |
$reg = '%^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@|\d{1,3}(?:\.\d{1,3}){3}|(?:(?:[a-z\d\x{00a1}-\x{ffff}]+-?)*[a-z\d\x{00a1}-\x{ffff}]+)(?:\.(?:[a-z\d\x{00a1}-\x{ffff}]+-?)*[a-z\d\x{00a1}-\x{ffff}]+)*(?:\.[a-z\x{00a1}-\x{ffff}]{2,6}))(?::\d+)?(?:[^\s]*)?$%iu'; | |
$url = htmlspecialchars(trim($url)); | |
if(preg_match($reg,$url)) | |
return true; | |
else | |
{ |
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 trova_data_fiscale($codice) | |
{ | |
$mesi = array('A' => '01', 'B' => '02', 'C' => '03', 'D' => '04', 'E' => '05', 'H' => '06', 'L' => '07', 'M' => '08', 'P' => '09', 'R' => '10', 'S' => '11', 'T' => '12'); | |
$dati_finali = array(); | |
$data_presa = substr(strtoupper($codice),6,5); | |
$anno = substr($data_presa,0,2); | |
$mese = substr($data_presa,2,1); | |
$giorno = strval(substr($data_presa,3,2)); | |
if($giorno >= 40) |
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 <plib/js.h> | |
int main() | |
{ | |
jsJoystick *js[1]; | |
float *assi[1]; | |
int j; | |
jsInit(); |
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 <stdlib.h> | |
#include <time.h> | |
#define DIM 100 | |
void randomico(int *A) | |
{ | |
int i; | |
srand(time(NULL)); |
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 <stdlib.h> | |
void scambia(int*,int*); | |
void stampa(int*,int); | |
void crea(int*,int); | |
void quicksort(int*,int,int); | |
int main() | |
{ |
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
/* | |
* Sommare gli elementi di un vettore A con puntatori e funzioni ricorsive. | |
* Domenico Luciani aka DLion anno 2013 Facoltà di Scienze Informatiche, 1° anno. | |
* 20/02/2013 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
void stampa(int*,int); |
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
/* | |
Blink 2 Led with push button | |
By Domenico Luciani aka DLion | |
http://dlion.it | |
*/ | |
//Using wiringPi library | |
#include <wiringPi.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
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> | |
char*z="ou"; char*(b)="ar"; | |
char*a="Y";char*s=" ";char*c="cfbvujgvm" | |
;int main(int(argc),char*argv[]){printf("%s",a); | |
;char(space)[2];(space)[0]=(s)[0];(space)[1]='\0'; | |
;printf("%s",z);printf("%s",space);printf("%se",b) | |
;char*l=space;printf("%s",l);int(i);char(n)[10]; | |
for(i=0;i<10;i++){n[i]=c[i]-1;}n[9]='\0'; | |
printf("%s",n);printf("%s",".") | |
;printf(("%s"),("\0")); |
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
/* | |
* Prova d'esame di programmazione e laboratorio by Domenico Luciani aka DLion | |
* 01/02/13 - 03:17 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
void convoluzione(int); |
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 wget_thread() | |
{ | |
for i in {1..4}; do | |
wget -rnp -c -N $1 & | |
done | |
} |