Skip to content

Instantly share code, notes, and snippets.

for num in range(0,config.MAX_NUMBER_OF_GENERATIONS):
children = evolution_tools.make_children(survivor,config.GENERATION_SIZE)
survivor = evolution_tools.survive_selectively(children,GOAL_ORGANISM)
print str(num*config.GENERATION_SIZE) + ': ' + ''.join(survivor)
if ''.join(survivor) == ''.join(GOAL_ORGANISM):
print 'GOAL REACHED!'
print 'ORGANISMS SAMPLED: ' + str(num*config.GENERATION_SIZE)
break
# takes an organism and returns a copy that may be mutated
def copy_and_mutate(organism):
# first, make a copy
new_organism = list(organism);
# to start the mutation action, define events and their string constants
letter_change = 'LETTER_CHANGE'
letter_deletion = 'LETTER_DELETION'
insert_space = 'INSERT_SPACE'

How I was Advised to 'Get Laid' when Voicing Negative Feedback

Some days, the Internet is full of wonder. Other days, some random person across the Atlantic advises you to get laid. This is one such story.

It all started innocently enough. A content service company - Writing Bold - had sent me three emails offering their services. You know the kind:

I contacted you recently with regard to Writing Bold's services, and wanted to follow-up to see if there might be an opportunity for us to talk further.

Since this was the third email they sent me, I thought I'd let them know they were bothering me. I replied:

@davidkatz
davidkatz / gist:6404423
Last active December 22, 2015 02:38
Wavedeck: iOS Developer Wanted
This is Wavedeck: http://www.youtube.com/watch?v=qqYycJnCxE0
It's a fast video messenger, and it marries the ease of audio with the humanity of video. You kind of need to use it to get it, here's a [download link](https://itunes.apple.com/us/app/wavedeck-fast-video-walkie/id489188581?mt=8).
Wavedeck has been through a lot in the last two years. Several major iterations, a pivot, two [well](http://jacobian.org/) [known](http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/) developers. We shifted our plans and resources until we found the right product, and now we're there. Wavedeck is growing and it needs you to grow up with.
Your job is scaling and building Wavedeck's future, we have some really exciting features planned. Our existing codebase needs to be put on some solid ground, so you should enjoy bringing order into a complex system.
The job has some hard requirements:
Build target WDTestingGrounds
CpResource /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/ResourceRules.plist /Users/davidkatz/Library/Developer/Xcode/DerivedData/WDTestingGrounds-dmorglrxwbccclakrabbdqvspyyf/Build/Products/Debug-iphoneos/WDTestingGrounds.app/ResourceRules.plist
cd /Users/davidkatz/Dropbox/Code/WDTestingGround/WDTestingGrounds
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/ResourceRules.plist /Users/davidkatz/Library/Developer/Xcode/DerivedData/WDTestingGrounds-dmorglrxwbccclakrabbdqvspyyf/Build/Products/Debug-iphoneos/WDTestingGrounds.app
ProcessPCH /Users/davidkatz/Library/Developer/
{
"time_window": {
"1": {
"available_from": "12:00",
"available_to": "16:00"
},
"2": {
"available_from": "12:00",
"available_to": "16:00"
},
// calculate final required offset
int initialImageCenter = rectInTableView.origin.y + rectInTableView.size.height/2;
int screenWidth = [UIScreen mainScreen].bounds.size.width;
int currentDistanceFromCenter = screenWidth/2 - initialImageCenter;
int finalHorizontalOffset = currentDistanceFromCenter;
// calculate current offset based on drag position
int maxDragDistance = 100; // say we want the animation to complete while the finger drags up to 100 pixels
int currentDragRatio = currentDragDistance / maxDragDistance // assuming currentDragDistance is available
int currentHorizontalOffset = currentDragRatio*finalHorizontalOffset
//
# Order Received Webhook
# Order Shipped Webhook