- musée mechanique
- if you're in the financial district, check out the old pacific stock exchange (pre-hipster fixie movie Quicksilver with Kevin Bacon was filmed here!) it is now a gym. chuckle at that thought.
- buena vista cafe (ridiculous irish coffee, get bombed so you can handle tourists)
- sfmoma de young/park/beach/cal academy
- twin peaks
- walk around SOMA, where most startups live; majority are in square bounded by [Market, 1st, Folsom, 3rd]
- do not walk around where new Twitter HQ will be; you will step on human feces, and it is next to one of the biggest peepshow theaters
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
len_a=`head -n 4 a | wc | awk '{print $3}'` && len_b=`head -n 4 b | wc | awk '{print $3}'`; cmp a b -n `[ $len_a -gt $len_b ] && echo $len_a || echo $len_b` |
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
// Some enum, could be RateFamilyTypes | |
enum Letters { A, B, C} | |
void Main() | |
{ | |
// List of stringified subset of enum values; could be sourced from XAML | |
HashSet<string> filterList = new HashSet<string>() { "B" }; | |
// Get as typesafe array of enum values (allLetters is an array of Letters) | |
var letterArray = Enum.GetValues(typeof(Letters)); |
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
I am going to give a short talk on the software architecture of Memcached | |
during a workshop [1] I attend next week. | |
As far as I understand, Memcached architecture is simple + sweet: Libevent | |
+ Hashing + Slab allocator. But I haven't even looked at the code yet. | |
Does anyone have a UML diagram of Memcached or something similar ready I | |
could use in my slides next Wednesday? Or any other tips for me? | |
Thank you all a lot in advance! |
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
def _postToZendesk(self, text, originalMsg): | |
try: | |
url = 'http://xignite.zendesk.com/tickets/%s.xml' % (text) | |
body = self._getZendeskMessage(originalMsg) | |
auth_handler = urllib2.HTTPBasicAuthHandler() | |
auth_handler.add_password('Web Password', url,'username', 'password') | |
opener = urllib2.build_opener(auth_handler) | |
request = urllib2.Request(url, data=body) | |
request.add_header('Content-Type', 'application/xml') |
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
# Why do | |
DATE_DIFF('2012-3-1', '2012-3-2') | |
# and | |
DATE_ADD('2012-3-1', INTERVAL 1 DAY) | |
# have different naming conventions? | |
# this returns [0, n] | |
select count(*), datediff(`a`,`b`) from `table` group by datediff(`a`,`b`) | |
# this returns n - k, k > 0 |
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
// Axis2 does not handle .NET's WSDL serialized of enums very much. | |
AdjustmentMethods adj = AdjustmentMethods.Factory.create(); | |
AdjustmentMethods_type0[] adjInnerTypes = new AdjustmentMethods_type0[1]; | |
adjInnerTypes[0] = AdjustmentMethods_type0.Factory.fromString(AdjustmentMethods_type0._SplitOnly, SERVICE_URI); | |
adj.setAdjustmentMethods_type0(adjInnerTypes); | |
getQuotesArguments.setAdjustmentMethod(adj); |
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
Method One - Visitor Retargeting | |
1) tons of websites have extra banner placements available. | |
2) retargeting companies buy those under-impressed locations at a discount. | |
3) visitors come to the site and are tagged/cookied with the retargeting codes. | |
4) tagged visitors leave[the site] and randomly surf the web. | |
5) tagged visitor come across one of the banner locations owned by the retargeting companies. | |
6) [Our] banner is displayed to the tagged visitor, frequently bringing them back to our site. |
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 recommendations as rec | |
from itertools import product | |
from math import sqrt | |
# Going through the exercises in: http://shop.oreilly.com/product/9780596529321.do | |
def all_euclideans(fileName): | |
key = "critics" | |
recdb = rec.read(fileName) | |
criticKeys = recdb[key].keys() |
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
<outline title=".Net General" text=".Net General"> | |
<outline text="Ayende @ Rahien" title="Ayende @ Rahien" type="rss" xmlUrl="http://feeds.feedburner.com/AyendeRahien" htmlUrl="http://ayende.com/blog/"/> | |
<outline text="BCL Team Blog" title="BCL Team Blog" type="rss" xmlUrl="http://blogs.msdn.com/bclteam/rss.xml" htmlUrl="http://blogs.msdn.com/b/bclteam/"/> | |
<outline text="Coding Horror" title="Coding Horror" type="rss" xmlUrl="http://feeds.feedburner.com/codinghorror" htmlUrl="http://www.codinghorror.com/blog/"/> | |
<outline text="Dare Obasanjo aka Carnage4Life" title="Dare Obasanjo aka Carnage4Life" type="rss" xmlUrl="http://feeds.feedburner.com/Carnage4Life" htmlUrl="http://www.25hoursaday.com/weblog/"/> | |
<outline text="Elegant Code" title="Elegant Code" type="rss" xmlUrl="http://elegantcode.com/feed/" htmlUrl="http://elegantcode.com"/> | |
<outline text="Fabulous Adventures In Coding" title="Fabulous Adventures In Coding" type="rss" xmlUrl="http://blogs.msdn.com/ericlippert/rss.xml" htmlUrl="http://blogs.msdn.com/b |