Quantcast

Bike Directions on Google Maps

Hooray! Google Maps now tells you how to get to places by bike!

Banff Mountain Film Festival

This is going to be at the Palace of Fine Arts on Wednesday and Thursday. It looks awesome. We should go!

Here’s a list of films that are playing (though I’m not sure which films are playing on which night).

Denne’s Aliens

How adorable is this font?! It’s designed by Denise Bentulan and you can download it for free over here.

Replacing URLs with links… halp?

I found this crazy regex for matching URLs in python. Even though some very smart people went through the trouble of concocting that regex, I can’t seem to use for all test cases… hmm.

I’m trying to turn bare urls into links for our Twitter sidebar widget, and it almost works, except for the last crazy case below (query string + anchor):

#!/usr/bin/python
 
import re
 
def convertLinks(str):
    #crazy regex from Shag, based on http://flanders.co.nz/2009/11/08/a-good-url-regular-expression-repost/
 
    prog = re.compile(r'(?#FQURL)(?:(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/)(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)*(?#TopLevel Domains)(?:[a-z]+\.?))(?#Port)(?::[\d]{1,5})?\.?(?#Directories)(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/|)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?|(?#BareURL)(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\d]{1,5})?\.?(?#Directories)(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/|)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?)')
 
    return prog.sub(r'<a href="\g&lt;0&gt;">\g&lt;0&gt;</a>', str)
 
#single url
print convertLinks('http://tikirobot.net\n')
 
#string
print convertLinks('See http://tikirobot.net for more info.\n')
 
#string w/ anchor
print convertLinks('See http://tikirobot.net/#foo for more info.\n')
 
#two urls in a string
print convertLinks('See http://tikirobot.net or http://wikipedia.org for more info.\n')
 
#some test urls from flanders.co.nz
print convertLinks('This is a google search: http://www.google.com/search?q=good+url+regex&amp;rls=com.microsoft:*&amp;ie=UTF-8&amp;oe=UTF-8&amp;startIndex=&amp;startPage=1\n')
 
print convertLinks('ftp://joe:password@ftp.filetransferprotocal.com is a ftp url\n')
 
print convertLinks('There is a bare url google.ru somewhere in this sentence\n')
 
#test cases from shag
print convertLinks('query string: https://some-url.com/?query=&amp;name=joe&amp;filter=*.*\n')
 
print convertLinks('both a query string and an anchor with no host name separator slash: https://some-url.com?query=&amp;name=joe?filter=*.*#some_anchor\n')
 
print convertLinks('both a query string and an anchor: https://some-url.com/?query=&amp;name=joe&amp;filter=*.*#some_anchor\n')
 
print convertLinks('DNS name with a concluding period: http://some-url.com./\n')
 
print convertLinks('DNS name with a concluding period and query string: http://some-url.com./?foo=bar\n')
 
print convertLinks('single-component DNS name plus root: http://to./\n')
 
print convertLinks('single-component DNS name: http://to/\n')
 
print convertLinks('words with slashes: unread/unregistered\n')

Also note my double-grouping on the regex.. There must be a better way!
Update, figured out that the group zero backreference is \g<0> (\0 doesn’t work, so I was double-grouping so that I could use \1).

Little help, regex ninjas? Update 2: Shag to the rescue!

Updates 3, 4, and 5: Shag has provided us with a even moar better regex in the comments.. Yay Shag!!!!!

Fever Ray WANTS YOUR BRAIN

Karin Dreijer Andersson made it on to Resident Advisor’s Top 100 albums of the ’00s list twice, once for her solo album as Fever Ray and again for her collaboration with her brother as The Knife.

Here is an acceptance speech that Fever Ray gave at an awards show in Sweeden. It is one of the best acceptance speeches ever given:

A ramp for Mom!



A ramp for Mom!, originally uploaded by tiki.robot.

-raj

Merry Christmas!



Merry Christmas!, originally uploaded by tiki.robot.

new bakery coming to bernal!!



new bakery coming to bernal!!, originally uploaded by tiki.robot.

Someone sent me this info about it

Introducing Sandbox Bakery, the latest sliver of a corner spot bringing together the best of a Japanese deli and French bakery, opening next Monday in Bernal Heights.

Brought to you by ex-Slanted Door pastry chef Mutsumi Takehara (who also baked at La Farine and Chez Panisse), Sandbox brings an East meets West, morning-to-afternoon, bakery-and-deli lineup, complete with Ritual Roasters and De La Paz coffee that’s extracted through a cone-shaped single drip filter-the way they do it in Japan.

Once a motorcycle repair shop, this crisp take-out counter in front of the sizable working kitchen has a vague likening to Mt. Fuji, with a flinty stone wall and gleaming white subway tiles. And from the crack of dawn, the fresh-baked aromas of buttery chocolate croissants and Swiss dill biscuits wafting through the neighborhood will lure you to the automatic sliding-glass doors at the corner of Cortland and Gates.

In case French pastries get you in the mood for a little Japanese street food (when don’t they?), the Yuzu-Sage Tart and the deli-style Teriyaki Chicken Rice Burger (that’s two pieces of griddled sticky rice instead of a traditional bun) will be yours for the taking.

may

Thank you Team Twiizers!



Thank you Team Twiizers!, originally uploaded by tiki.robot.

monkey hats!


spotted on caltrain tonight.

-may
monkey hats!, originally uploaded by tiki.robot.

another Bambi sighting on my way to work

may

Cupcakes via Nokia 900



Cupcakes via Nokia 900, originally uploaded by tiki.robot.

this is a macro test shot taken from a Nokia n900! Cupcakes from Cako. N900 from Finland.

Don’t mind if I do



Don’t mind if I do, originally uploaded by tiki.robot.

A tasty Duff!



A tasty Duff!, originally uploaded by tiki.robot.

Bender and Zoidberg go trick or treating

skylight at the internet archive’s new bldg

may

Book Server Launch at the Internet Archive

may

puddles ain’t got nothin on me



puddles ain’t got nothin on me, originally uploaded by tiki.robot.

may

Decompression



Decompression, originally uploaded by tiki.robot.

Decompression



Decompression, originally uploaded by tiki.robot.

Dahi Vada



Dahi Vada, originally uploaded by tiki.robot.

Dosa in japntown

Bollywood Hills



Bollywood Hills, originally uploaded by tiki.robot.

At Dosa, having yummy drinks!

today’s food find at the alemany farmer’s market

squash blossoms and some kind of japanese mushroom. the mushroom lady
said they’re called nematodes but I think I must have heard wrong
because the internet tells me that nematodes are worms.

may

Raj &tam



Raj &tam, originally uploaded by tiki.robot.

Raj and Ralf at the Wind Harp



Raj and Ralf at the Wind Harp, originally uploaded by tiki.robot.

Before hitting our first 7-Eleven for a free slurpee on 7/11.

Older Posts »