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
<html><head> | |
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | |
<title>A* demo</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script> | |
<script type="text/javascript"> | |
var size=81, fielddom, g, h; | |
var zeroes, walls, open, clos, camefrom, lastwalls, lastopen, lastclos; | |
var curx=Math.floor(size/2), cury=3; | |
var active = 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
#!/usr/bin/perl | |
@t=("D.J. Vajazzle", | |
"Tu Madre", | |
"Royal Rooters", | |
"The Darkhorse", | |
"The Mighty Hamsters", | |
"Amish Rake Fight", | |
"PhineusGageHeadaches", | |
"Misfit Chinese Food", |
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
DATE | AWAY TEAM | HOME TEAM | LOCATION | LATITUDE | LONGITUDE | |
---|---|---|---|---|---|---|
2011-03-31 | Padres | Cardinals | Busch Stadium | 38.62378 | -90.19249 | |
2011-03-31 | Giants | Dodgers | Dodger Stadium | 34.07388 | -118.23996 | |
2011-03-31 | Braves | Nationals | Nationals Park | 38.872778 | -77.0075 | |
2011-03-31 | Brewers | Reds | Great American Ballpark | 39.09714 | -84.50707 | |
2011-03-31 | Angels | Royals | Kauffman Stadium | 39.05158 | -94.4801 | |
2011-03-31 | Tigers | Yankees | Yankee Stadium | 40.829167 | -73.926389 | |
2011-04-01 | Mariners | Athletics | Oakland Coliseum | 37.75162 | -122.20052 | |
2011-04-01 | Twins | Blue Jays | Rogers Centre | 43.6414 | -79.38917 | |
2011-04-01 | Pirates | Cubs | Wrigley Field | 41.94822 | -87.65536 |
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
DATE | AWAY TEAM | HOME TEAM | STADIUM | LAT | LON | |
---|---|---|---|---|---|---|
2012-03-28 | Mariners | Athletics | Tokyo Dome | 35.705658 | 139.751914 | |
2012-03-29 | Mariners | Athletics | Tokyo Dome | 35.705658 | 139.751914 | |
2012-04-04 | Cardinals | Marlins | New Marlins Ballpark | 25.778056 | -80.219722 | |
2012-04-05 | Blue Jays | Indians | Progressive Field | 41.49601 | -81.68511 | |
2012-04-05 | Braves | Mets | Citi Field | 40.756944 | -73.845833 | |
2012-04-05 | Dodgers | Padres | PETCO Park | 32.70724 | -117.15708 | |
2012-04-05 | Marlins | Reds | Great American Ball Park | 39.09714 | -84.50707 | |
2012-04-05 | Nationals | Cubs | Wrigley Field | 41.94822 | -87.65536 | |
2012-04-05 | Phillies | Pirates | PNC Park | 40.44684 | -80.0056 |
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 | |
include 'minmaxheap.php'; | |
/* A min-heap that will restrict itself to a maximum of some number of values. | |
* Implemented internally as a min-max heap. | |
* | |
* Public API: | |
* - Contructor takes a number, used as the maximum number of values allowed on the heap | |
* - count() - returns the number of elements on the heap |
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
// This is the source code for Integer.bitCount() for Java 1.5+ | |
// <http://www.docjar.com/html/api/java/lang/Integer.java.html> line 1132 | |
public static int bitCount(int i) { | |
i = i - ((i >>> 1) & 0x55555555); | |
i = (i & 0x33333333) + ((i >>> 2) & 0x33333333); | |
i = (i + (i >>> 4)) & 0x0f0f0f0f; | |
i = i + (i >>> 8); | |
i = i + (i >>> 16); | |
return i & 0x3f; |
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
ALTER FUNCTION dbo.fnBase36 | |
( | |
@Val BIGINT | |
) | |
RETURNS VARCHAR(9) | |
AS | |
BEGIN | |
DECLARE @Result VARCHAR(9) = '' | |
IF (@Val <= 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
// ==UserScript== | |
// @name Metafilter country flags | |
// @namespace http://plutor.org/ | |
// @description Add a flag next to users | |
// @include http://metafilter.com/* | |
// @include http://*.metafilter.com/* | |
// ==/UserScript== | |
/* -- Configuration variables, sort of --------------------------------- */ |
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
from random import shuffle | |
import time | |
def generate_array(size): | |
result = [i for i in range(0, size)] | |
shuffle(result) | |
return result | |
def is_in_order(a, size): | |
if (len(a) != size): |
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
"""Splay tree | |
Logan Ingalls <[email protected]> | |
Sept 3, 2012 | |
Note that I only implemented insert and find. Delete is trivial, | |
and isn't the interesting part of splay trees. Some of these | |
algorithms would be simpler, but I chose to do this without parent | |
links from the tree nodes. | |
Example output on my desktop computer: |
OlderNewer