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 | |
/* create a test image */ | |
$im = @imagecreate(100, 20) or die("Cannot Initialize new GD image stream"); | |
$background_color = imagecolorallocate($im, 255, 255, 255); | |
$text_color = imagecolorallocate($im, 0, 0, 0); | |
imagestring($im, 1, 5, 5, "Hello, World!", $text_color); | |
/*** | |
* Assumptions: |
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 | |
/** | |
* Writes the given text with a border into the image using TrueType fonts. | |
* @author John Ciacia | |
* @param image An image resource | |
* @param size The font size | |
* @param angle The angle in degrees to rotate the text | |
* @param x Upper left corner of the text | |
* @param y Lower left corner of the text | |
* @param textcolor This is the color of the main text |
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
/* K&R2 60-63 */ | |
char *itoa(int n, char s[]) | |
{ | |
int c, i, j, sign; | |
if((sign = n) < 0) | |
n = -n; | |
do { | |
s[i++] = n % 10 + '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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Sierpinski Triangle</title> | |
</head> | |
<body> | |
<canvas id="sierpinski"> | |
Oops! Your browser does not support HTML5 Canvas. |
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
* (load "permute.lsp") | |
; Loading #p"/home/john/permute.lsp". | |
T | |
* (p (list 'a 'b 'c 'd 'e)) | |
((A B C D E) (A B C E D) (A B D C E) (A B D E C) (A B E C D) (A B E D C) | |
(A C B D E) (A C B E D) (A C D B E) (A C D E B) (A C E B D) (A C E D B) | |
(A D B C E) (A D B E C) (A D C B E) (A D C E B) (A D E B C) (A D E C B) | |
(A E B C D) (A E B D C) (A E C B D) (A E C D B) (A E D B C) (A E D C B) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>jQuery Autocomplete Demo</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js" type="text/javascript"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquer | |
y-ui.min.js" type="text/javascript"></script> | |
</head> |
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 | |
$a = array(3, 2, 1, 5, 9, 0, 7, 4, 6, 8); | |
while(!is_sorted($a)) | |
shuffle($a); | |
print_r($a); | |
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
//because I can... | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
int main(int argc, char **argv) { | |
if(argc != 3) |
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> | |
/** | |
* This code will calculate e | |
* as the sum of the infinite series | |
* 1/1! + 1/2! + 1/3! + ... + 1/n! | |
* g++ e.c | |
* ./a.out | |
*/ | |
int factorial(unsigned int i); |
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 | |
/** | |
* Calculate the binary value needed to | |
* display hexidecmal 0-F on a seven-segment | |
* display for an ARM | |
*/ | |
(strpos($argv[1], "a") !== false) ? $a = 1 : $a = 0; | |
(strpos($argv[1], "b") !== false) ? $b = 1 : $b = 0; | |
(strpos($argv[1], "c") !== false) ? $c = 1 : $c = 0; |
OlderNewer