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
/* | |
Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
This example code is in the public domain. | |
*/ | |
// Pin 13 has an LED connected on most Arduino boards. | |
// give it a name: | |
int led = 13; |
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
# conky configuration | |
# | |
# The list of variables has been removed from this file in favour | |
# of keeping the documentation more maintainable. | |
# Check http://conky.sf.net for an up-to-date-list. | |
# | |
# For ideas about how to modify conky, please see: | |
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/ | |
# | |
# For help with conky, please see: |
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
# Problem A. Graphics Settings | |
''' | |
Example input: | |
1 | |
vsync 10 | |
640 480 10000000 | |
2 | |
Off vsync | |
Resolution 320 240 | |
''' |
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
def multiples(max, div): | |
results = list() | |
for i in range(1, max): | |
if not all(map(lambda x: i % x, div)): | |
results.append(i) | |
return results | |
a = multiples(1000, [3, 5]) | |
sum(a) |
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
def grabber(): | |
s = raw_input("files: ") | |
delim = "C:\\" | |
files = [delim+x for x in s.split(delim) if x] | |
return files |
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
from django.core.files.uploadedfile import InMemoryUploadedFile | |
import cStringIO | |
import StringIO | |
from urllib2 import urlopen | |
from PIL import Image as PILImage | |
import re | |
import os | |
from xml.dom import minidom | |
from mutaku.blog.models import Post, Image | |
from mutaku.tools.extras import findext |
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
'''Create a print job string for page range by supplying | |
a total range of pages and an exclude list (such as graphical | |
pages or ones simply not needed). | |
Example: | |
In [1]: from printer_jobs_strings import make_print_string | |
In [2]: pages = range(0, 25) | |
In [3]: exclude = [3, 6, 7, 8, 15, 24] | |
In [4]: make_print_string(pages, exclude) | |
Out[5]: '0-2,4-5,9-14,16-23' |
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
from urllib2 import urlopen | |
URLfail = False | |
try: | |
code = urlopen(the_url).code | |
if code >= 400: | |
URLfail = True | |
except: | |
URLfail = True |
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
Enter number of digits: | |
999 - symmetry | |
start 999999 - stop 100 | |
xx | |
SsSs | |
floor : 1001 ceiling : 999 | |
floor : 999 ceiling : 999 | |
floor : 999 ceiling : 999 | |
997799 | |
999 , 999 |
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
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <iomanip> | |
using namespace std; | |
/* Practicing examples from http://web.cse.msu.edu/~cse231/python2Cpp.html | |
and http://code.google.com/edu/languages/cpp/basics/getting-started.html */ |