This file contains hidden or 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
60.times{|a|puts (0..240).map{|b|x=i=0;x=x*x+Complex(b/4.0-45,a-30)/30until x.abs>4||99<i+=1;i>99?'#':'.'}*''} |
This file contains hidden or 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/ruby | |
require 'nokogiri' | |
require 'open-uri' | |
# Handle command line | |
account = ARGV.shift || 'jl_2' | |
num = ARGV.shift || 10 | |
if num.to_i > 200 | |
puts "Can only fetch up to 200 tweets at a time." |
This file contains hidden or 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
/* gpxparse.c | |
Copyright (c) 2010, Jeremiah LaRocco [email protected] | |
Permission to use, copy, modify, and/or distribute this software for any | |
purpose with or without fee is hereby granted, provided that the above | |
copyright notice and this permission notice appear in all copies. | |
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
This file contains hidden or 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 | |
# pyget.py | |
# Copyright (c) 2010, Jeremiah LaRocco [email protected] | |
# Permission to use, copy, modify, and/or distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. |
This file contains hidden or 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 | |
# select_demo.pl | |
# Copyright (c) 2010, Jeremiah LaRocco [email protected] | |
# Permission to use, copy, modify, and/or distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. |
This file contains hidden or 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/python3 | |
# flickrtests.py | |
# Copyright (c) 2010, Jeremiah LaRocco [email protected] | |
# Permission to use, copy, modify, and/or distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. |
This file contains hidden or 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
;; Copyright (c) 2010 Jeremiah LaRocco | |
;; All rights reserved. | |
;; Redistribution and use in source and binary forms, with or without | |
;; modification, are permitted provided that the following conditions | |
;; are met: | |
;; 1. Redistributions of source code must retain the above copyright | |
;; notice, this list of conditions and the following disclaimer. | |
;; 2. Redistributions in binary form must reproduce the above copyright | |
;; notice, this list of conditions and the following disclaimer in the |
This file contains hidden or 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 | |
def is_palindrome(number): | |
return str(number) == str(number)[::-1] | |
if __name__ == "__main__": | |
# Assumes that the largest palindrome will be created by two numbers in the range 900-1000 | |
print('{}*{} = {}'.format(*max((i,j,i*j) | |
for i in range(1000, 900, -1) | |
for j in range(1000, 900, -1) |
This file contains hidden or 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
-- Convert an Nfa to a Dfa using the algorithms from section 3.7.1 of the "Dragon book" | |
toDfa :: Nfa -> Dfa | |
toDfa nfa = | |
let | |
dstrt = e_closure nfa (n_start nfa) | |
init = Map.fromList [(dstrt, genStates dstrt)] | |
dfa = getps init | |
stateNames = genStateMap dfa | |
partial = Map.mapKeys (\x -> lookupDefault x 0 stateNames) dfa | |
dfaTrans = Map.map (\x -> Map.map (\y -> (lookupDefault y 0 stateNames)) x) partial |
This file contains hidden or 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/python3 | |
import urllib.request | |
import xml.dom.minidom | |
fh = urllib.request.urlopen('http://twitter.com/statuses/user_timeline/jl_2.xml') | |
doc = xml.dom.minidom.parse(fh) | |
for stat in doc.getElementsByTagName("status"): | |
print('Date: {}\nTweet: {}'.format(stat.getElementsByTagName("created_at")[0].firstChild.nodeValue, | |
stat.getElementsByTagName("text")[0].firstChild.nodeValue)) |
OlderNewer