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
import os | |
import sys | |
import traceback | |
from functools import wraps | |
from multiprocessing import Process, Queue | |
def processify(func): | |
'''Decorator to run a function as a process. |
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
Coding: | |
http://jobs.readwriteweb.com/ # supports RSS to get jobs | |
http://angel.co/jobs # supports APIs to get jobs | |
http://startuply.com/ # supports RSS to get jobs | |
http://jobs.37signals.com/ # supports RSS to get jobs | |
http://www.dice.com/ # supports RSS and JSON to search for jobs | |
http://jobs.github.com/ # supports RSS | |
http://www.craigslist.org # supports RSS and XML to post and read jobs | |
http://www.reddit.com/ # supports posting posts through bots, and reading RSS | |
http://news.ycombinator.com/jobs # supports RSS for reading jobs |
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: http://stackoverflow.com/questions/1228299/change-one-character-in-a-string-in-python | |
# | |
# TypeError: 'str' object does not support item assignment | |
# If you have a string in python and you want to replace a char by index, you will get that error. | |
# I searched online and a lot of people have spammed the search results with answers that are not really related. | |
# I found the answer on StackOverFlow, and I decided to write a small functon to implement it | |
# Note: it creates a new string everytime you call it. | |
# in [4]: replaceByIndexString(0,'@','foobar') | |
# Out[4]: '@oobar' | |
# In [5]: replaceByIndexString(1,'@','foobar') |
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
# by Ahmed Hassan | |
import random | |
from math import log | |
def powerMod(a,n,m): | |
num_roots_operation = int(log(n)/log(2)) | |
all_roots_calc =[] | |
all_roots_calc.append(a) | |