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
| problem4 :: Int | |
| problem4 = max $ filter isPalindrome $ nub numbers | |
| where numbers = let numList = [100 .. 999] in [ x*y | x <- numList, y <- numList ] |
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
| master!euler/haskell *> ghci 4/euler4.hs | |
| GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help | |
| Loading package ghc-prim ... linking ... done. | |
| Loading package integer-gmp ... linking ... done. | |
| Loading package base ... linking ... done. | |
| Loading package ffi-1.0 ... linking ... done. | |
| [1 of 1] Compiling Main ( 4/euler4.hs, interpreted ) | |
| Ok, modules loaded: Main. | |
| *Main> main | |
| Loading package array-0.3.0.0 ... linking ... done. |
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
| import reddit # http://github.com/mellort/reddit_api | |
| import tinyurl # http://pypi.python.org/pypi/TinyUrl/0.1.0 | |
| r = reddit.Reddit() | |
| r.login(username='...', password='...') | |
| items = [(l.title, tinyurl.create_one(l.url)) for l in r.get_saved_links()] | |
| for item in items: print "%s -- %s\n" % item |
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
| In [62]: mutagen.File? | |
| Type: function | |
| Base Class: <type 'function'> | |
| String Form: <function File at 0x1141140> | |
| Namespace: Interactive | |
| File: /usr/lib/python2.6/site-packages/mutagen/__init__.py | |
| Definition: mutagen.File(filename, options=None, easy=False) | |
| Docstring: | |
| Guess the type of the file and try to open it. | |
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
| for k, v in itertools.izip(self.__hdr_fields__, | |
| struct.unpack(self.__hdr_fmt__, buf[:self.__hdr_len__])): | |
| setattr(self, k, v) |
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
| #!/bin/bash | |
| shingle_size=4 | |
| feature_count=1024 | |
| if [[ ! -d $1 || ! -d $2 ]]; then | |
| echo "Usage: <dir1> <dir2>" | |
| exit 1 | |
| fi | |
| simhash -f $feature_count -s $shingle_size -w $1/*.class | |
| simhash -f $feature_count -s $shingle_size -w $2/*.class |
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
| $ wget http://codepad.org/y4D2CSk3 -O cardlist.txt | |
| $ ./cards2spoiler.py > test | |
| C: Abyssal Gatekeeper | |
| C: Acidic Slime | |
| C: Act of Treason | |
| C: Adarkar Valkyrie | |
| C: Adarkar Wastes | |
| C: Adventuring Gear | |
| C: Aether Spellbomb | |
| Traceback (most recent call last): |
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
| 1 Mox Emerald | |
| 1 Mox Jet | |
| 1 Mox Pearl | |
| 1 Mox Ruby | |
| 1 Mox Sapphire | |
| 1 Black Lotus | |
| 1 Sol Ring | |
| 1 Mana Crypt | |
| 1 Island |
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 | |
| """ | |
| Implements a Tree data structure for annotated MAC Addresses. This is useful for lookups where more precision than just the MAC vendor is useful (eg, a specific model, NIC series, etc). | |
| Works with python 2 and 3 | |
| """ | |
| from __future__ import print_function |
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
| SB: 2 Trygon Predator | |
| SB: 1 Forest | |
| SB: 1 Helm of Obedience | |
| SB: 1 Rebuild | |
| SB: 2 Hurkyl's Recall | |
| SB: 2 Island | |
| SB: 2 Pithing Needle | |
| SB: 4 Leyline of the Void | |
| 1 Ancestral Recall | |
| 1 Black Lotus |