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
bool isPalindrome( char *string, unsigned int l, unsigned int r ) | |
{ | |
if( l >= r )return true; | |
if( string[l] != string[r] ) return false; | |
return isPalindrome( string, l+1, r-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
unsigned int Fib( unsigned int n ) | |
{ | |
if( n == 0 ) return 0; | |
if( (n==1) || (n==2) ) return 1; | |
else return Fib(n-1)+Fib(n-2); | |
} |
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
void *av_malloc(size_t size) | |
{ | |
void *ptr = NULL; | |
#if CONFIG_MEMALIGN_HACK | |
long diff; | |
#endif | |
/* let's disallow possible ambiguous cases */ | |
if (size > (max_alloc_size-32)) | |
return 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
/* let's disallow possible ambiguous cases */ | |
if (size > (max_alloc_size-32)) | |
return 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
#if CONFIG_MEMALIGN_HACK | |
ptr = malloc(size+ALIGN); | |
if(!ptr) | |
return ptr; | |
diff= ((-(long)ptr - 1)&(ALIGN-1)) + 1; | |
ptr = (char*)ptr + diff; | |
((char*)ptr)[-1]= diff; |
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 | |
if( isset($_COOKIE['username']) ) | |
{ | |
if( strcmp($_COOKIE['username'],"Jane") == 0) | |
{ | |
echo "You have successfully logged in as Jane!"; | |
} | |
} | |
?> |
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
if ((unsigned long)(nb) <= (unsigned long)(get_max_fast ())) | |
{ | |
idx = fastbin_index(nb); | |
mfastbinptr* fb = &fastbin (av, idx); | |
mchunkptr pp = *fb; | |
do | |
{ | |
victim = pp; | |
if (victim == NULL) | |
break; |
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
//Rikaard Hosein | |
//811004653 | |
#include <cstdlib> | |
#include <cstdio> | |
#include <climits> | |
#include <memory.h> | |
using namespace std; | |
#define _DEBUG_ |
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
#!/usr/bin/python | |
import os | |
import struct | |
import SocketServer | |
import zlib | |
from Crypto.Cipher import AES | |
from Crypto.Util import Counter | |
# Not the real keys! | |
ENCRYPT_KEY = '0000000000000000000000000000000000000000000000000000000000000000'.decode('hex') |
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
def encrypt(data, ctr): | |
aes = AES.new(ENCRYPT_KEY, AES.MODE_CTR, counter=ctr) | |
return aes.encrypt(zlib.compress(data)) |
OlderNewer