kefen: (Innocent ahem)

Honestly, what's the worst, here? That I'm writing dirty, dirty MUSH code in 2013? On a Friday evening? Alone with a beer? In a text editor for which I created a specific syntax highlighting configuration?

Or maybe the fact I'm having so much FUN doing it?
kefen: (Rather Doubtful)
While I wouldn't say all of that stuff is exactly common knowledge, most people brave enough to be around me when I'm in a geeky mood still know about a few things: that I love Python, that I love C, that I hate Oracle and anything it touches, that I hate Java (see previous statement) and that, having to use it at work, I'm really not fond of the Eclipse IDE.

(If none of what I just wrote makes any sense to you, please do not be alarmed, it's perfectly natural. Just smile, wave and cautiously back up until you're out of sight and earshot. I promise I won't take offense. :))

Otherwise, read more and laugh at me... )
kefen: (Yay)
It's not that I really mind working with libxml... I do hate XML with a passion, and for a lot of reasons that are completely irrelevant to this post.

What really irks me is that the online documentation is ugly and, most of all, difficult, even borderline painful to read. Honestly, have a look at and remember the glorious days of RTC modems and Netscape...

So, yeah, the 90's faxed, they want their FrontPage floppy disk back!
kefen: (Ohmygod)
It's weird to suddenly realize, while checking the man page for rindex() — and subsequently for strrchr(), since the former is apparently deprecated — that pretty much all I know about C-strings and the functions to deal with them, I learned while hacking away at the source code of TinyMUSH 3, back when I knew nothing about Unicode, character sets, Linux or, in fact, programming in general, and we were trying to come up with a French-friendly version of the server.


Honestly, sometimes I'm amazed that I ever had sex.
kefen: (Default)
So a colleague wrote an innocent enough post on his favorite social network page, at coffee break this morning. It was innocuous enough:

"0x35 = 53"

Now, if you're a normal person, you'll probably go: "Huh?"

If you're a normal person who just happens to know what hexadecimal is, you may go: "Hey, that's true! Amusing."

If you're enough of a nerd, you may have gone: "Well, DUH!"

Now, I'm a software engineer, so of course, my reaction was: "Hey, neat! I wonder how often that phenomenon occurs for, say, numbers up to a million. Quick, to the Python prompt!"

About one minute and half later, I had figured out how to compute that the quick and dirty way in Python. It took about half another minute for my poor computer to crunch the numbers and come up with the rather disappointingly short list:

0x35    =    53
0x173   =   371
0x1415  =  5141
0x18499 = 99481

(Technically, the list also contains numbers 0 to 9, but that's the boring trivial case.)

Funnily enough, the results are the same for numbers up to a billion — it took my computer a bit longer to figure that one out.

The line of Python code used to come up with these results was — gotta love list comprehension:

["0x%X = %d" % (n,n) for n in range(1000000000) if "%X" % n == ("%d" % n)[::-1]]

(EDIT: Of course, it is terribly suboptimal. Every number whose hexadecimal representation contains the symbols A to F is never going to meet the conditions anyway and should be skipped early. Same for number with trailing zeroes. And so on... Look, I did that real quick, all right? :))

Sigh. The things I do for fun... I should really be ashamed. And, no, I honestly didn't expect anyone out there to find that interesting either, but... y'know... That was quick, cheap and easy fun! :)
kefen: (Knowing grin)
... be it an incredibly nerdy and insignificant one.

If you remember, we have a crappy old workstation which is vital for my job — oooh yeah, so very vital, as I'm spending virtually all my workdays using it, of late. I keep trying to get rid of it, I've got the software part running in an emulator, but there is a piece of hardware we still need, namely, a rather old1 Mac modem apparently made in France if you'd believe such a thing. It's got a very specific card reader/writer in it2, this is the only reason why we bother with it.

That old piece of junk only worked with the Macintosh workstation, with a rather intricate, proprietary cable.

Well, I finally got it to work on my regular PC with a standard parallel cable, a parallel-to-serial converter, and my good old faithful pyserial module3.

Now I just have to write a nice little communication library — and I actually love doing that — and then, bye bye obsolete workstation.

Of course, that modem is dying, and will just pass away sooner or later — probably sooner than later, of course — but until then, it can be used on any workstation we want, and that will be MUCH more convenient.

Small victory, but hey, I'll take any I can get!

1. Well, by my standards, a modem made in 1989 ought to be considered old.
2. You may be wondering why in Hell this modem comes with a specific card reader/writer. We did too. Then we've been told that it was so that you could update the modem's firmware with a smartcard. At which point we all shrugged and went 'eh, whatever'!
3. Honestly, that module is my swiss-army knife at work, I couldn't live without it!
kefen: (Default)
How do you call something that's been working so perfectly for the past ten years that nobody ever felt the need to touch it?



Let me explain...

What I was paid for this afternoon... (warning, quite technical) )

Honestly, I may be less of a geek than I used to be, but you can't deny that sometimes the simplest console tools are the best for a job like that.

It was easy, and somehow gratifying, in a "I knew it'd work" kind of way.


kefen: (Default)

June 2014

22 232425262728


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 28th, 2017 04:29 am
Powered by Dreamwidth Studios