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
/** | |
* Recursive with no class level or local variables, | |
* a single int (the one passed in), | |
* a single call to print | |
* a single call to itself | |
* a single assignment | |
* a single if() statement (not counting ternaries) | |
* @param a | |
*/ | |
public static void rc(int 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
package cs.pack; | |
import java.util.ArrayList; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.lang.reflect.Array; | |
import java.lang.reflect.Field; | |
import java.nio.ByteBuffer; | |
import java.nio.ByteOrder; |
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
package org.csdgn.crypt; | |
import java.util.Arrays; | |
/** | |
* Tested against the actual RFC. | |
* | |
* @author Chase (Robert Maupin) | |
* @see {@link http://tools.ietf.org/rfc/rfc4503.txt} | |
*/ |
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 /* Copyright(c) 2013 Robert Maupin. Released under the ZLIB License. */ | |
if(count($_FILES) > 0) { | |
extract($_FILES['file']); | |
list($w,$h,$type)=getimagesize($tmp_name); | |
/*see exif-imagetype() documentation :) */ | |
if(!$type||$type>3||filesize($tmp_name)>1024*200) | |
exit(); | |
$ext=image_type_to_extension($type,false); | |
$md5=md5_file($tmp_name); | |
move_uploaded_file($tmp_name,$n="img/$md5.$ext"); |
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
package org.csdgn.crypt; | |
import java.util.Arrays; | |
/** | |
* Tested against the actual RFC. | |
* This implementation is optimized for code length. | |
* Please do not use this version in production, use the much faster unrolled version here: https://gist.github.com/2814851 | |
* @author Robert Maupin | |
* @see {@link http://tools.ietf.org/rfc/rfc4503.txt} |
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 /* Copyright(c) 2013 Robert Maupin. Released under the ZLIB License. */ | |
date_default_timezone_set('GMT'); | |
define('DB','chan.db'); | |
$max_image_size_kb = 1024*1024; | |
$thumbnail_size = 150; | |
$thumbnail_quality = 70; | |
$db = new PDO('sqlite:'.DB, 0, 0, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); | |
function query($sql, $params = NULL) { | |
global $db; | |
$s = $db->prepare($sql); |
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
/* I prefer the singleton class creation method. */ | |
var CSUtil = { | |
TWO_PI: Math.PI * 2, | |
TO_DEG: 180/Math.PI, | |
/** | |
* Returns the angle from x1y1 to x2y2. This function will accept | |
* robot.position, scannedRobot.position, and wrap. | |
*/ | |
angleTo: function(p,q) { |
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
/** | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2013-2014 Robert Maupin | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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 <stdlib.h> | |
#include <windows.h> | |
#include <objidl.h> | |
#include <gdiplus.h> | |
using namespace Gdiplus; | |
wchar_t* characters = | |
//Hiragana | |
L"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもや" |
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
package hash | |
type Hasher interface { | |
Update(uint8) | |
UpdateArray([]uint8) | |
Hash() uint32 | |
Reset() | |
} | |
const ( |
OlderNewer