If I see ...
Jan. 12th, 2008 | 12:33 am
if x == y:
return True
else:
return False
one more time, I'm gonna ... well, be slightly annoyed.
Damn it.
Link | Leave a comment {1} | Add to Memories | Tell a Friend
Fuck you, spellchecker!
Jul. 26th, 2007 | 02:50 pm
Link | Leave a comment | Add to Memories | Tell a Friend
TCP/IP
Jul. 3rd, 2007 | 04:00 pm
A: SYN
B: SYN/ACK
A: ACK (SYN-ACK-ACK)
A: FIN
B: RST
A: ORLY?
B: ORLY?/YARLY
A: YARLY (ORLY?-YARLY-YARLY)
A: NOWAI
B: ONOES
Mine are clearly superior. They're longer. Look at "ORLY?-YARLY-YARLY". That's 0x11 characters. Other protocols, you know, they only go up to 11. But mine to go 0x11. That's, like, a whole numbering system more.
Link | Leave a comment {3} | Add to Memories | Tell a Friend
Python 3000 and lamba lives
Jun. 27th, 2007 | 01:00 pm
http://video.google.com/videoplay?d
Bam. Gotta love that video anchor thing.
Link | Leave a comment {3} | Add to Memories | Tell a Friend
More useless and insane programming stuff for posterity
May. 25th, 2007 | 03:25 pm
print (lambda f, n: f(f, n))(lambda fact, n: fact(fact, n - 1) * n if n > 1 else 1, 5)
I like everything about this line of code, except for it's utter unreadability; particularly the bootstrapping lambda which accepts the "real" lambda as
f, and then passes f to f, all without using any blocks. Of course, this is equivalent:fact = lambda x: x * fact(x - 1) if x > 1 else 1 print fact(5)
Or (perhaps) more readable yet:
def fact(x):
if x > 1:
return fact(x - 1) * x
else:
return 1Aaaand of course you could optimize it for tail call (even though CPython doesn't natively optimize that case, but perhaps Jython does, or you could use a decorator):
def fact(x, acc = 1):
if x > 1:
return fact(x - 1, acc * x)
else:
return accThen there's what I would actually use:
def fact(x):
acc = 1
for i in xrange(2,x):
acc *= i
return acc... Ok. Back to something actually useful, instead of just interesting. :)Link | Leave a comment {3} | Add to Memories | Tell a Friend
Python and programming the language
Feb. 12th, 2007 | 09:48 pm
I am entirely too amused with Python right now. I just made an automatic, threaded queue which transparently wraps any generator. It's twenty lines long. Twenty lines! Beautiful language.
( You can see the code, if you like. )All it takes to use it is to change this:
for token in myGenerator(): doStuff(token)
To this:
for token in BackgroundedGenerator(myGenerator()): doStuff(token)
Or alternatively, this (if you want a maximum size on the queue):
for token in BackgroundedGenerator(myGenerator(), maxQueueSize=50): doStuff(token)
Link | Leave a comment | Add to Memories | Tell a Friend
Outlook 2007
Feb. 8th, 2007 | 12:28 pm
This program is driving me crazy. How can Microsoft make such a huge usability leap in Office 2007 with, say, the ribbon (which is terribly useful), but fail to do one of the most obvious things that an email client needs to do, that is:
The Original
Hi Peter.
Sorry I missed you for lunch.
See you Tuesday?
--
John
The Wrong (Outlook 2007) Way
<-- Response goes here
> -----Original Message-----
> From: John Michaels mailto:john@-------------.net]
> Sent: Thursday, February 08, 2007 11:31 AM
> To: peter@-------------.net
> Subject: Lunch on Tuesday?
>
> Hi Peter.
>
> Sorry I missed you for lunch.
>
> See you Tuesday at 12:00?
>
> --
> John
What's Wrong About the Wrong Way
Why is the Outlook style so annoying? Because it's much harder to follow. If you include the whole message in one chunk at the bottom, when you go to read the response, it's harder to remember what was discussed, and then harder to find and read it so you can remember. It's not so obvious for a short email like this, but when they get longer, or there are many messages, it becomes essencial.
In many technical circles, not quoting in an easy-to-read manner is ... looked down upon ... (to put it mildly), and for good reason—in many cases, these emails are going to be archived and stored so that other people can read them.
The Right Way
John <john@-------------.net> wrote:
>Hi Peter.
>
>Sorry I missed you for lunch.
>
>See you Tuesday at 12:00?
<-- Response goes here
The Result
John <john@-------------.net> wrote:
>Sorry I missed you for lunch.
Don't worry about it. :)
>See you Tuesday at 12:00?
That sounds great! Let's go to the Thai place on Oak Rd. I dare you to get it extra spicy!
--
Peter
The Result #2
Peter <peter@-------------.net> wrote:
>John <john@-------------.net> wrote:
>>See you Tuesday at 12:00?
>That sounds great! Let's go to the Thai place on Oak Rd. I dare you to get it extra spicy!
Ha! I'll take that dare! See you there.
--
John
Even Outlook Express gets this right (or at least has an option for it), and so does literally every other email client I've ever seen. Opera even color-codes (like above), and I'm sure many others do too. Why is Outlook so remarkably brain-dead about plain text (non-HTML) email?
There are a couple of programs around which are supposed to help fix this, including the one I was using with Outlook 2003 (Outlook-QuoteFix), and "Quotefix Macro" (which doesn't seem to work at all, and is not that great of a hack anyway due to one of Outlook 2007's other major flaws, the inability to customize the ribbon).
I'd better stop writing before I start complaining that Outlook-style quoting is not just the only way in Outlook, but it's also the default way, which is even worse (because people will use the default, and send me hard-to-follow email (which, I admit, is already happening)).
Link | Leave a comment {11} | Add to Memories | Tell a Friend
Blu-Ray vs. HD-DVD
Feb. 2nd, 2007 | 09:53 am
Even if Sony is stupid and won't release porn on Blu-Ray.
However, I also think dual-format players are going to become the most popular choice in player, once prices come down.
Link | Leave a comment | Add to Memories | Tell a Friend
iPhone ponderings
Jan. 12th, 2007 | 10:10 pm
Ok. So the iPhone is big news in the blogosphere. Fortunately, my blog is tiny and unnoticed, so I can say whatever I want without any editing or contemplation of whether it would interest anyone else or not. Yay! :P
Plus, I can make comments regarding why the iPhone is better/worse than my personal PDA (which is the best Verizon offers, I consider).
Why the naysayers are full of shit:
They're usually uninformed, or guessing.
In particular, people seem to be complaining about no 3G, battery life, non-user-replaceable-battery, OMFG scratches, the (lack of a) keyboard, no GPS, it's too expensive, that it's Cingular-only (and incidentally how Cingular sucks), how it's a closed system, and finally how the iPhone is really nothing new.
Ok. Let's break it down.
No 3G
This is the biggie, for me. EDGE? 150 kilobits a second if you're lucky? Come on, man. I'd rather have 3G than wifi. Hmm... well, hopefully iPhone 2.0 will have this. Jobs did hint at it.
Battery Life
Jobs says that you get five hours of video/talk time, and 16 hours of music playback. In a device less than half an inch thick. Presuming that's really how long it lasts, that's a damn long time. If you're going to be watching video or talking on the phone for more than FIVE HOURS (!), then go get an iPod extendo-battery. They're everywhere, and they're optional, something a bigger internal battery wouldn't be.
The Battery
You can't replace the battery yourself. Boo-hoo. Yes, it would be better if you could (easily... I'm sure aftermarket kits will show up in no time). Um. Get over it.
OMFG Scratches
The screen is scratch-resistant. If you're worried, put a screen protector over it. The horror.
The (Lack of a) Keyboard
We'll see. I always think "well, what alternative would you prefer?"... I'd prefer the much larger screen. By lots.
No GPS.
This one's got some merit. Come on, even the tiniest cell phones have at least carrier-assisted GPS now. If this thing could be my phone, PDA, to-go Camera, AND personal navigation system, that would be very cool. As it is, however, I use a bluetooth GPS unit anyway, so... at least it's not any worse than my current solution.
It's Too Expensive
Uh-huh. And what would a vaguely comparable solution with seperate devices cost? About the same. And they're not as nice.
Cingular only
Sucks, but from Apple's perspective, nearly unavoidable. There are basically two GSM carriers in the US—Cingular and T-Mobile. T-Mobile blows, and the rest of the world uses GSM. Stupid rest-of-the world...
It's a Closed System
Yeah, we'll see how long that lasts. Keep in mind that Jobs's job right now for the iPhone is to generate enough media attention that everybody and their dog (and particularly geeks, i.e., those who would buy one early on) know everything they possibly would be interested in about the iPhone. What he says (or, really, implies) now is not necessarily reality.
It's Nothing New!
Ok, the Reality Distortion Field has worn off, and people are noticing there are really no or very few completely new features in the iPhone. Even the multi-touch screen is not totally new (I've seen at least one news article from before the iPhone release about a multi-touch screen on a cell phone. Maybe the gimmicky (though useful) sensors are new, but that's not a big deal, it's certainly no revolution in mobile devices.
But you forget. It's one device. Yes, you could have a cell phone/PDA/camera, and a video iPod, and you'd be almost there in terms of functionality, or you could have an iPhone, which is smaller than just your cell phone/PDA, and is much smarter.
You get a call, your music turns off. You don't have to switch to a different headset, because your current one is also your cell phone's. You decide that you need to look up that resturaunt that was just mentioned on your phone call? No problem (presuming you're in range of a Wifi connection -- I'm guessing voice and data won't get along). Etc, etc. Convergance!
Second, while Apple is doing very little new, it's doing it all well, for the first time. Yes, I have a web browser on my phone. It sucks. Yes, I have a cool picture/caller ID interface on my phone. It also sucks, and I bought a third-party app to get just that level of suck. Yes, I have a contact manager. Without Microsoft Voice Command, its interface sucks. Yes, I have a camera, and it sucks too.
Apple, a company which actually cares about its interfaces, has made the first really usable PDA/phone, and thrown in iPod-like functionality at the same time. Yes, there are some problems with its design, it would be really cool if it were a legitamitely open platform, etc, etc, but just look at the thing! If the rest of the interface is as good as the interface shown off by Jobs, it's honestly better at being a cell phone than any cell phone I've ever seen or heard of—and it does tons more.
Link | Leave a comment {2} | Add to Memories | Tell a Friend
iPhone
Jan. 9th, 2007 | 10:29 pm
location: At work
music: Yoko Kanno - Escaflowne Soundtrack - What'cha gonna do???
Oh yes. It will be mine. My precious.
Link | Leave a comment | Add to Memories | Tell a Friend
Wish list
Dec. 19th, 2006 | 04:46 pm
Some random (wealthy) stranger stumble upon this un-oft-updated blog and want to shower me with kindness?
Look no further!
Link | Leave a comment | Add to Memories | Tell a Friend
Because I can't resist
Dec. 8th, 2006 | 09:04 pm

And the text, so when that site dies, I can look back at this blog and know what the hell I was talking about:
What's your seduction style?
The Midas Touch
Everything you touch turns to gold, and it kind of creeps us out. You're completely calculating, but then, you also have a good heart, and are a really nice person. We'd judge, but you keep using your powers for good, not evil, and that's totally charming and sweet. Aww, look at you.
You're so bloody nice. It's like, we could curl up on your lap and feel safe, and drink cocoa and solve the world's problems through cuddling. That's your superpower: cuddles.
You know, I normally find the text for these wildly generic if seemingly applicable to myself (because they seem applicable to everyone), but this one seems shockingly personal. Maybe I'm just egotistical.
Link | Leave a comment | Add to Memories | Tell a Friend
Ponderings on hyperlinks
Dec. 5th, 2006 | 11:48 pm
Warning: I can't imagine how the following could be interesting to anyone but me, but, hey, go for it:
I've been thinking about it for an inordinate amount of time, and I've come up with reasons for my preference about links (see last post), and the reason for my cognitive dissonance on the subject:
First, the realization/postulate which allowed all of this to lay out clearly in my head:
Links are (or should be) a property of noun phrases. Note that this is only true if the link describes a thing (rss feed, HTML page) and not an action ("Add to friends", "bookmark this page").
In other words, a noun phrase describes something. The text of a link should describe the target of the link—if the target of the link is a thing, then the text should be a noun (or noun phrase).
- Therefore, don't say things like "Read the article here.", because you're not providing a link for reading, you're providing a link—the user can save the target, bookmark the link, send the link to someone else, etc. Use "Read the article." Better yet, use "There's a great article on foo over at bar.tld.", if you really must reference the link in such a direct manner.
And therefore: - Since entire sentences are not typically treated mentally as noun phrases (though it could possibly happen—slogans, for example), one should not include the period in the link (and also, you may often omit the verb part of the sentence entirely):
(this is/here is some/whatever) More amusement.
- Aesthetically, adding a period (and most other punctuation) as part of a link looks wrong.
The cognitive dissonance for me was that I could not see why the period should not be considered part of the link (as adding it as part of the link looked wrong), as I erroneously thought that the link was a property of the sentence, and failed to realize that it was only the noun phrase that the link was a property of, not the (implied) sentence.
Link | Leave a comment | Add to Memories | Tell a Friend
And while I'm at it...
Dec. 4th, 2006 | 10:14 pm
To include the full stop/period in a link which comprises an entire sentence, or not to include the full stop/period in a link which comprises an entire sentence, that is the question.
Link | Leave a comment {1} | Add to Memories | Tell a Friend
(no subject)
Dec. 4th, 2006 | 09:04 pm
Oh man. There are so many levels of funny there that it's hard to find the first one.
Link | Leave a comment {1} | Add to Memories | Tell a Friend
Keyboard fever
Sep. 20th, 2006 | 04:40 pm
Link | Leave a comment | Add to Memories | Tell a Friend
Yay Internet meme.
Aug. 14th, 2006 | 10:30 am
| Advanced Global Personality Test Results
|
personality tests by similarminds.com
Link | Leave a comment | Add to Memories | Tell a Friend
Like, merry, like, Christmas
Dec. 25th, 2005 | 01:01 pm
mood: sick / Christmas! :)
Yes, I celebrate Christmas.
No, I'm not wishing you "Happy Holidays".
Yes, I realize that's politically incorrect.
No, I do not care.
Yes, I realize there are other holidays celebrated around this time.
No, Kwanzaa does not count, because I refuse to recognize such bullshit.
Yes, I realize I'll be called racist, stupid, white, and whatever other bullshit insult you can come up with if you're politically correct or a Kwanzaa supporter (roughly the same thing).
No, I do not care.
Yes, of course people can celebrate whatever they like, that doesn't mean I have to lend it credence — it's a made up holiday specifically made to spite the white man.
No, this post format isn't stupid.
Yes, I realize it's gone on too long.
No, I do not care.
Link | Leave a comment | Add to Memories | Tell a Friend
I HAVE A HUGE WANG
Dec. 11th, 2005 | 12:31 am
I am so cool.
Link | Leave a comment | Add to Memories | Tell a Friend
*yawn* - disjointed ramblings
Nov. 14th, 2005 | 03:40 pm
Not that the test was supposed to fail anyone but the exceptionally stupid.
That course was sooo slow. So slow. Damn, it can be a curse to understand so quickly. I don't think people realize how horrible it is to be held back while 2+2=4 is drilled into the sea cows you're sitting in a class with. Well, no more. I shall continue to learn Danish, but not via a school. At least not that one.
Eff.
