This is beyond amazing! The guy who drew this picture deserves a Nobel prize, this looks so realistic! Could you tell it was drawn?
Feature in email clients
May 23, 2006This post talks about what would be a “killer” feature of email clients: warning you when the words “attach”, “attached”, “attachement” or other forms thereof appear in the body of the email, but with no actual attachments. A way to make sure you attached your resume when you apply for a job.
Now, I wouldn’t call that an awesome feature, but as soon as I read the post, my first thought was “people who use an Emacs mail client can do that”. They can do it, not because it’s already there, but because they can hack their client, so that when they do the key chord sequence to send the email, before calling the send-mail function (or whatever it’s called), they can insert code to look for the regex “attach.*” and check the attachements on the email.
A more killer feature of email clients would be the ability to add hooks so that this type of feature does not need to be thought of by the designer of the client, just that they envisionned that people would want to do things with their software that they had never anticipated. This creates a community of third-party addons, which is always very popular: just look at Firefox.
24 finale
May 23, 2006Yesterday was 24’s finale. Who else saw the ending coming from a mile? I won’t say what it is so that I do not ruin it for people who’ve yet to see it, but suffice to say that it was pretty clear what was going to happen after Jack resurfaced to help CTU. Still, a great 2 hours of non-stop action!
I got tattoos
May 21, 2006Saturday, my friend Anne-Marie and I went to a tattoo shop to get information on tattoos, how much it costs, how long it takes, what kind of art has the artist done before, how long has he done tattoos, health issues, etc. We got to the place at 3:40 PM and by 4:10 PM, we had very satisfying answers, the artist had our trust, so we asked when we could come back to get them done. “Do you want them right now?” he asked. I left home thinking that this could possibly happen, so I was ready, but clearly Anne-Marie was taken a bit aback. However, she has a tendency to want things as soon as possible, so she agreed too.
Anne-Marie went first, she wanted two tattoos, one on her shoulder blade and one on her lower back. Since she wasn’t sure about what she wanted in her back, she only got the one on her shoulder blade. She got a stylized flower in a tribal style. She was surprised when she realized that it wasn’t as painful as she thought it might be. Her tattoo was quite small, and the artist was finished in about 20-25 minutes. The result was a very nice, little tattoo.
The artist then asked me if I wanted to go. I had brought my designs with me, so I said yeah. He copied the designs (the letters Pi and Phi) on a thin sheet of paper, put them on my arms so that I could see how big they would be, where they would be, etc. When I was satisfied with all the parameters, he got to work. He started with Pi on my left arm. It was my first tattoo ever, so I wondered if it would be painful. Surprisingly, like Anne-Marie, it wasn’t nearly as bad as I thought. It was more annoying than painful to tell the truth. Whenever he would remove the needle, the mild pain would instantly go away. So it wasn’t too bad. Since the designs were pretty simple and not very big, I estimate it took him 40-50 minutes to finish both arms.
I am very happy with the results, when I get a digital camera, I will take pictures and post the results here.
π ϕ
Update: the pi and phi I posted don’t represent what the tattoos look like. Font problem I guess.
My thoughts on Python 2.5
May 17, 2006Many of you know that I once was quite the Python enthusiast before Ruby pulled me back to the land of Smalltalk-like OO and blocks. I haven’t done much, if any, Python in nearly two years, so I lost touch with the language. The last addition that I remember were method decorators, which I found complex and I thought that they were not in the spirit of Python’s simplicity. Yesterday, I found the list of new features in Python 2.5, and I’d like to comment on some of them as an outsider to the language.
PEP 308: Conditional Expressions
Basically, people were tired of writing code like this:
if foo: x = bar else: x = baz
They wanted something that could fit on one line, similar to the C family’s ternary operator (?:). Since the ternary operator can make some code cryptic, GvR decided to go with another syntax:
x = bar if foo else baz
Coming from Ruby, the condition coming after the “then” clause is not new. However, the else part is something Ruby doesn’t support (you must use the ternary operator in that case). I don’t think that syntax is so bad, though I understand that many Pythonistas don’t like it. It reads a little funny, the else could’ve maybe been replaced by “otherwise” which would’ve made the whole statement sound like basic english (“X equals bar if foo otherwise, baz”).
A little syntactic addition, I don’t think it will help or hurt Python, just make some code a little more brief.
PEP 309: Partial Function Application
This one is interesting. If I understand it correctly, they brought currying (a feature found in some functional languages such as Haskell, ML or Qi) to Python. Basically, it allows you to create functions by supplying only certain parameters to another function. As an example:
import functional def multiply(x, y): return x * y multiply_by_3 = functional.partial(multiply, 3) multiply_by_3(4) #=> Will return 12
Pretty nice for folks who like functional programming, this sure is a feature that I would like to see in more languages.
PEP 341: Unified try/except/finally
Before Python 2.5, you could not use except and finally in the same exception catching block. That is now a thing of the past. Good job. Not much else to say, most other languages have it already.
PEP 343: The ‘with’ statement
This one, I’m not sure how I feel about: on one hand, it makes idioms found in Ruby, Smalltalk and Lisp possible, such as making sure that when you work with a file, it will be closed even if an exception occurs. This makes many programming tasks easier. On the other hand, it seems pretty complicated to implement. You need to add two methods to your class, __enter__() and __exit__(), but that seems to me like you can only do one thing with “with” per class. On the other hand, languages like Smalltalk or Ruby use blocks passed as parameters to the method, so an object of one class can have multiple methods that do different things when you pass a block. Doesn’t it seem limiting that Python would allow only one action per class to be done with the “with” statement? Maybe I don’t quite understand it. If anyone can shed some light, I sure would appreciate.
As for the other new features, I don’t have much to say about them.
I made cookies!
May 15, 2006I decided that I wanted to hone my culinary skills, so from now on, I’m gonna try and cook more often. Tonight, I made something simple, chocolate chip cookies. It’s kind of weird though, I’m on a diet and I’m making food. Anyone hungry? :)
Haskell used to develop Linspire?
May 15, 2006Thanks to Reddit, I found a story about how Haskell is used in Linspire to make different support tools for the distribution. Does this sound believable to anyone, or does it look like a late, late April’s Fool joke? If it is true, I would love to read more about the choice of Haskell, why it was prefered to the other alternatives, what lessons they learned, etc.
Posted by gnuvince
Posted by gnuvince
Posted by gnuvince