My inner child believes that I can shoot guns accurately with no training.
After my American uncle explained how to line up the gun, I shot the bullseye.
This target was shared between four people. I hit the bullseye twice.
The adult part of me is glad that I have access to handguns only when I am visiting the United States.
By Symphony of Science’s John Boswell for PBS Digital Studios
I finally figured out how to mix songs together. I used Audacity, a free, open source audio editing program.
When I was younger, a friend (Tina) thought that Big Pun’s “Still Not a Player” and Brandy/Monica’s “The Boy Is Mine” would sound good remixed together. I think it sounds pretty good. (Update: Link broke.)
If you want to wait for an item to go on sale, but you don’t want to waste your life on RedFlagDeals.com, you can create a Google Alert to automate the act of finding deals applicable to Canadians. Benefit from Canadian crowdsourcing, but have only customized information delivered to your inbox.
Let’s say you want to wait for olive oil to go on sale. Just create a new Google Alert with a search query like:
site:redflagdeals.com "olive oil"
This is a Google search for the term “olive oil” only within the domain redflagdeals.com. Set the “Result type” to “Everything”, “How often” to “As-it-happens”, and “How many” to “All results”.
Whenever somebody creates a new forum post on RFD with the term “olive oil”, you will be notified of the post! Not all notifications will be about deals that you want, but it’s a better system than manually hunting for bargains.
0 -> #ff0000
10 -> #ff4d00
20 -> #ff9900
30 -> #ffe500
40 -> #ccff00
50 -> #80ff00
60 -> #33ff00
70 -> #00e619
80 -> #009966
90 -> #004db3
100 -> #0000ff
-0.5 -> #ff0000
-0.4 -> #ff3333
-0.3 -> #ff6666
-0.2 -> #ff9999
-0.1 -> #ffcccc
0 -> #ffffff
0.1 -> #ccffcc
0.2 -> #99ff99
0.3 -> #66ff66
0.4 -> #33ff33
0.5 -> #00ff00
This is a heatmap-style colouring that represents the relative popularity of Linux distros. Red is hottest and black is coldest.
||Popularity (average hits per day)
I drew this with HTML5 Canvas, but the below image is just a screen capture.
A working demo of these examples—with source code—are in the example.html file in the github repository.
My grandma dressed in fashionable Western clothes and wore her hair in a beehive during the 1960s. She spent her income on chocolates and countless pairs of silk stockings, silk stockings being a luxury item at the time. My grandma thought that being a secretary was the ideal job for a woman, because she thought that secretaries were glamourous.
She thought that red was the prettiest colour, and she hated the colour black. The colour silver was not good enough to her; she deserved gold.
When we went to grandma’s place, there was always an open box of chocolates, which she encouraged us to eat. My grandma sometimes made us a sweet, peanut, dessert soup that tasted like liquid peanut butter. However, she wasn’t always a good cook. Her version of “spaghetti” was fried pasta noodles with ketchup. But she made it for us, because my sister and I liked spaghetti.
Whenever I was bored, I could pore over her National Geographic collection, which she subscribed to for many years. My grandma was smart. She could do lightning-fast mental arithmetic and made sure people didn’t shortchange her. She was literate in English and Chinese, and she learned French and Japanese.
In her later years, my grandma started to forget, and became more depressed and silent. She started having trouble counting. When someone told her that I was her granddaughter, she told them they were crazy. She started losing her appetite, so we gave her Ensure or Boost meal replacement, in chocolate flavour.
My grandmother was 87 when she passed away in her sleep on the morning of January 1st, New Year’s Day. My grandma was a diva, and she was fabulous.
Here are my top four monospace fonts displaying “In 100 years, Gates and Jobs will be forgotten, but Torvalds’ name will live on.”
I first noticed this font when looking at my friend’s printed Java code before a test. I had never seen such a nice-looking monospace font, since I usually work in Ubuntu Linux. I found out that she printed it out in Notepad++, and it was a Windows font named Consolas designed by Lucas de Groot. I prefer free fonts to proprietary (especially Windows) fonts, but Consolas looks the best.
2. DejaVu Sans Mono (‘Monospace’ font of Ubuntu 10.04 Terminal)
This is the default Terminal font of Ubuntu 10.04. It is listed as ‘Monospace’, but ‘Monospace’ is an alias for DejaVu Sans Mono. DejaVu fonts are free. It’s not as nice as Consolas, and the zero is dotted instead of slashed, but it looks very nice on the console.
Inspired by Consolas, Raph Levien designed the free font Inconsolata and released it under the SIL Open Font License. It has a slashed zero, and the dots of the i’s and the periods are circles instead of squares, but the font looks a bit vertically stretched.
4. Anonymous Pro
Anonymous Pro is another free font. The letters are aesthetically proportional and the zero is slashed, but it is a bit over-the-top with some overly serifed numbers and uppercase letters.
Dan Benjamin has a similar list in Top 10 Programming Fonts, if you want to see more favourably-reviewed monospaced fonts.
Perl’s implementation of regular expressions performs much worse than grep’s implementation of regular expressions (i.e., Thompson NFA).
Time to match
I needed to write a Perl script to process numerous large log files, and Perl’s regex matching was not fast enough.
In a Unix/Linux environment, you can call the system() subroutine within Perl to execute shell commands like grep. In appropriate situations, it might be more efficient to call grep instead of using Perl to open files, read them line by line, and match each line against a regular expression. However, I needed backreferences to extract strings within a pattern, and grep only supports backreferences within the regular expression, not backreferences that can be used after.
I managed to reduce my script execution time for a given data set from 20 seconds to 11 seconds by combining grep and native Perl regular expression matching. I found the matching lines of the log files using grep, outputted the results to a temp file, and then used Perl regex matching to process the lines in the temp file.
For another part of my script, I tried using
system("echo '$string' | egrep '$pattern' > /dev/null") == 0
$string =~ m/$pattern/
within a loop, because I thought that (e)grep would always be faster, but system calls are expensive, so it ended up making my script unbearably slow.
In summary, if you need to speed up your Perl script and your Perl script processes text files, calling grep might improve performance. However, calling grep within a loop tends to be inefficient.
On Saturday, I walked from one end of the new TTC subway train to the other.
As I passed by, I grabbed a red handle bar at the top and pulled it down to a vertical position. When I let it go, it moved back to its default horizontal position.
Going south on the Yonge-University-Spadina line means that orange LEDs turn green. The next stop is a flashing LED. If the LED connects to another subway line, it might not turn green after you pass it.
Subway cars are connected together with shiny plates of metal that you can step on.
Posted in Photos
Tagged subway, Toronto, TTC
From my past experience as a job seeker, I performed the best on job interviews when I didn’t care about being weird. Sometimes people give well-meaning advice about what not to do during interviews, but this primes the interviewee into behaving as average as possible and suppressing personality.
For example, a younger peer advised me not to wear my hat, a homburg, to an interview, because it was “weird”. As I approached the interview room, I felt fake for pretending to be a non-hat-wearing person when I would normally wear my hat. I felt self-conscious and awkward, and I pretended to be a normal, non-hat-wearing person.
When the interviewer asked me, “If I was blind, how would you describe the colour blue to me?”, I was more concerned with not being weird, and giving him the answer that I thought he wanted, than with answering honestly and being myself. The other interviewer thought that it would be an “easy” question for me because of my background in cognitive science and artificial intelligence. While one could argue that the question is actually “very difficult” to answer seriously because of the massive scope of the problem, one could also argue that my mind was simply not tuned to creative thinking that day. (Because I didn’t have my hat.)