pphaneuf: (Angry Tongue)
Related to my previous post, I would like to use MySQL++ as an counter-example: it's "result set" object does not have a "no more rows" method, it simply throws an exception when it is at the end.

See, this is a good example of something that is not exceptional at all.
pphaneuf: (Default)
[livejournal.com profile] wlach wrote an excellent article recently on how to use (and not use!) assertions properly, and it reminded me of some of my reflections on assertions and exceptions (warning: this is mostly written with C++ in mind, which does not have checked exceptions, no matter what you may think).

Read more... )

So, don't go forward and assert, but rather, go forward and throw!
pphaneuf: (Default)
Wow, I'm quite busy these days, haven't been writing (or reading, for that matter!) much...

Mostly, it's to blame on the quest for a place to live in that's going on. I'd like to buy, this time around, so this makes it a couple of notches more complicated than what I'm used to (I've never been an owner, so this is all new to me). The numbers bandied around are making me quite dizzy! Hopefully, we should come out of this with a nice place, but in the meantime, it's time for "let's save up money like crazy for the cash down", so on top of being busy with this stuff, it'll also make me less visible than I usually am (well, uh, it should still be better than the last year!).

In other more geeky news, I think I am succumbing to the coding style of the C++ standard library with regard to naming. For method names, there's more than a few people who are going to think "finally!" (I used to favour a Java-style interCap, like "readUntil", now I tend to prefer "read_until"). This makes a lot of sense, since this is also more common in C and Perl code. But the more controversial part is that the standard library uses all lowercase for class names (it's "unordered_set", not "UnorderedSet"), and I'm getting a crush on those too... Perl, Ruby and Python are using FullyCapitalized style for those, and so are a number of C++ programmers I know, but I'm finding that there is something to be said for adopting the style of the language. I'm also using namespaces and exceptions (mostly in constructors and object-returning methods) more, these days.

So either I'm becoming stylish, or I'm becoming senile. Oh well.

Also, it would seem that the giant jackhammers are following me.
pphaneuf: (Default)
Seems like I'm now a senior something-or-other at Cypra Media, which did cause me a bit of grief. It's a "targeted marketing" company, meaning at the moment that they'll be sending out emails with ads in them to people who, weirdly enough, asked for it.

I would have liked maybe a bit more "completely new and different" maybe, and while they seem open-minded, they're not quite an actual free/open source software company, merely using a lot of it. But C++ and Perl are two of my favourites at the moment (mostly for their ratio of how much I can bend them to my will to how much they suck), and I think I might be in for learning some AJAXy JavaScript hackery in the process, which I've been meaning to do for a while, so that's that. They're Scrum fans there, which is better than being, say, RUP! Still, I'm more of a chaos model type of person, myself. We'll see, I want to try Scrum first, as it doesn't look completely nuts.

So I'll be starting there as soon as tomorrow!

Installers

Jul. 26th, 2007 03:23 pm
pphaneuf: (Default)
I was reading What's Wrong With Setup.exe?, and so was Avery, apparently.

I pretty much agree with Avery (and commented so on Jeff's blog), but I'd like to comment on how tricky the part about the DMG files is. The problem is that Mac OS X bundles aren't a single file (that could therefore be downloaded "just like that" and would be very intuitive), but is really a directory full of files (that thus can't be fetched off a web server as a single unit).

I guess Apple was focusing more on the shrink-wrap software publisher's point of view (normally shipping an actual CD-ROM), and kind of provided a virtual equivalent, but it does feel a bit weird.

One solution could be to ZIP the bundle, and give the operating system the ability to run them directly. You could then just download an application, and run it, no weird installation, nothing. It'd be a challenge, for sure. For example, the fault handler in the kernel would have to be able to find the page inside of a compressed ZIP file, if you "do it right". You could cheat and decompress it silently, but that'd could make launching a big application with lots of resources very slow, which is exactly what using a bundle is supposed to help with in the first place (by demand-loading resources). I know about the "stuff the resources inside the EXE" trick, but bundles can (and often do) have multiple binaries.

But they could certainly bite the bullet and find a way, I'm sure.

Note that the Apple approach also follows Avery's first advice. Preference files are created as they are needed, while running the application. It also means that a system administrator can simply put up a read-only file share on the network with the applications used in the office, and it'll Just Work (tm).
pphaneuf: (Default)
I'm in a weird headspace these days. This is the first time I'm unemployed in, what, ten years? Totalling about four jobless months since I dropped out of school (which was no big loss!), and it was willingly both times, once again to move to Montreal. I'm being a bit of a homebody, which is not that different from my year in France (yes, I'd go to work, but that'd be almost all I'd go out for), but this time I'm not depressed, I'm just, you know, at home. Rather relaxing, I must admit, but better not over-extend this!

I went out photo-walking with [livejournal.com profile] jul3z last Saturday, which was quite nice. I had nearly zero inspiration for photos for a long time now, and coming back to Montreal, I've had it coming back to me, but seems like I was never carrying my camera at the right times (despite carrying it around a good deal, doh!). We went along the Lachine Canal toward the Old Port, and while it was a good time chatting along with her, mid-day sun and my self-imposed restricting myself to my 28mm/f1.8 didn't make for anything great, I feel, but it was nice pushing myself a bit, and I did spot a few places that could make very interesting photos with better light (by the way, [livejournal.com profile] jul3z, here's that chain that's gone missing!).

We then watched Stranger Than Fiction, which I had seen bits and pieces of on the flight from Casablanca to Montreal. To start off, it has a nice casting, with Will Ferrell (but it's not a Will Ferrell movie at all), Maggie Gyllenhaal, Dustin Hoffman and Emma Thompson, and they did great job of giving some texture to the characters without being too blatant about it. For example, tiny details like Hoffman's character pouring himself some coffee at the start of a conversation, then as it ends, pouring back the content of his mug back into the coffee pot just had be imagine the lifecycle of his coffee, and what it must taste like at the end of the day. The subject is also one that I like, that of finding purpose and meaning in life, but it wasn't some overly cheesy grand meaning either, it was just the same kind of "ordinary" meaningfulness that I experience often, of appreciating what you have and being happy.

[livejournal.com profile] gregorama is right, girls in Montreal are a severe whiplash hazard! (hey, the subject says "random item", you were warned!)

The geeky type can find some dynamic language humour (Perl hackers know that there is indeed such a thing!) involving the Visigoths (that, the Perl hackers might not have known, but they probably suspected) here.

I boggle at how much attention to details Apple has sometimes, and how they manage to instil this attitude to their developer community. While I had previously noticed that, for some reason, moving around word by word in the location bar of my browser using the Control and arrow keys worked in a nicer way in Camino than it did in Firefox, where they use a slightly different set of delimiter characters, and they put the cursor in a different place depending on the direction you're going, avoiding the cases where you get just one character off of where you want to go (say, over a dot or a slash). But I just noticed that while double-clicking on a word selects that word, if you hit the Delete key, it deletes the word and the preceding space. Selecting character by character doesn't "discover" that you stopped at word boundaries, though. Oh well, for all I know, it's going to be in Leopard.

I'm probably one of very few people to be excited by what's coming in C++0x, especially as my top peeve about C++ templates seems to be fixed. One of my big use for template-based meta-programming was to detect errors at compile-time, but providing readable compile-time error messages is currently impossible (my error "messages" are often things like "variable YOU_FORGOT_TO_DO_THIS_THING does not exist", surrounded by a huge chunk of useless, unrelated context). Of course, actual lambda (even though Boost has a really neat hack to do it now) and type inference are very nice to have too. The latter will certainly help cut down on the amount of "foo<bar, baz>::const_iterator it = bob.begin()" typing I'll be doing, as it will now just be "auto it = bob.begin()"! My wrists thank the C++ language committee.

It seems one of my ideas has been picked up by some people in Waterloo, in the form of AideRSS. Now, I want an "Edit" button in the Firefox toolbar that would use AtomPub, okay?
pphaneuf: (Default)
Turns out the memory I bought the other day for my laptop isn't the right one. Seems like the PowerBook G4 15" and 17" use DDR2 memory, but the PowerBook G4 12" (that I have) is plain DDR. Of course, the memory was labeled «PowerBook G4» and «PowerBook G4 12"» respectively, and I didn't see the latter the first time. I returned, hoping that I could score some of the correct memory nonetheless (being stuck with the other one anyway), but all they had was 512MB modules, which is what I already have (and there's only one slot, so I have to replace it).

So, in either case, I have a 1GB 533 MHz DDR2 SO-DIMM memory module (sometimes referred to as being PC4200, from what I can see) for sale, or even better, in exchange for a 1GB 333 MHz DDR SO-DIMM memory module (AKA PC2700, which is what would work in my PowerBook 12").

We went to the [livejournal.com profile] joenotcharles-warming party, where we learned of his upcoming (further) entanglement with [livejournal.com profile] vierge_en_trop. I have to stalk them too, but I forgot why.

I provided some help at [livejournal.com profile] kyotto's move, after which I doused myself with gasoline and met up with [livejournal.com profile] ayria and [livejournal.com profile] jimmysworld to give [livejournal.com profile] ayria's Wii a try. Seems I'm not half bad at baseball, and I even managed to win a game of golf, but she completely destroyed me at boxing, it wasn't even funny! I also learned that I can catch balls with my face quite effectively, but that it doesn't really help. I'm 60 years old in Wii years, but hey, [livejournal.com profile] cpirate is 68, so...
pphaneuf: (Default)
I've been lagging behind in a lot of things (sorry if you've sent me mail and are still waiting for a reply!), but I think it's been good for me.

The day after we arrived, I managed to catch [livejournal.com profile] serendipity_wpg's last show on the Fringe, where I met [livejournal.com profile] wlach, [livejournal.com profile] cpirate and [livejournal.com profile] scjody, without anything being scheduled. After a choriço poutine at Mondo Fritz, I even crossed pzion on the way home. This was pretty cool, for a first day out, having such nice random encounters even in a city of three million people!

After getting all my money turned into Canadian currency, I tried to pick myself a nice Linksys WRTSL54GS, to hook ourselves up with some wireless Internet (with some hackability in mind!), to no avail. I ran into the WRT350N the next day, which seems to be the replacement model (had some issues with it at first, but it works perfectly for me once I restricted it to "b" and "g" wireless).

I also went for a drink with [livejournal.com profile] azrhey, [livejournal.com profile] cpirate, [livejournal.com profile] liberation_now and [livejournal.com profile] tygrbabe, which had me somewhat fiddly, but (of course!) proved to be quite enjoyable.

There was a visit by [livejournal.com profile] sps, [livejournal.com profile] swestrup and [livejournal.com profile] taxlady, where Settlers of Catan was played and I was soundly beaten to a pulp. I had cheese curds to console myself, which I was missing terribly!

I saw some of my old gang from cégep, where Mare Nostrum was played and I almost won, but Brain won finally. The usual...

I got myself some new shoes, which I find pretty nifty, but I then had the very silly idea of going for a walk before going to lab-synthèse-01. Going for a walk with new shoes, gah. I had soft ice cream to console myself. I had to leave before [livejournal.com profile] lautreamax got on, due to logistical constraints (also known as "living way the hell over there"), but I did catch (and enjoy!) his co-conspirator's set. More electronic music, more!

And today, we went downtown where I chatted with people for a bit while sipping coffee, walked around lazily and managed to randomly catch a 60% off deal on memory for my laptop at Compusmart's closing sale. Now writing this sitting on the lawn of the Place-des-Arts, from a spot in the shade, taking it easy with the Jazz Fest in the background... Nice!
pphaneuf: (Shades)
Today, we went out shopping a bit, to spend some of my truck wages (pretty popular in France, where apparently, as long as it doesn't say "euro", it hardly is taxable) before we leave. Got myself the new Arcade Fire album, a one of those fast CompactFlash, a shirt and a chocolate recipe book.

Not covered by my truck wages is a titanium watch from a collection I saw during our visit in February 2006 (where I almost bought one!). I have a strange relationship with watches, as I don't like timekeeping very much (I'd like to keep it simple, for example), but due to my snob, yuppie side (also expressed in my taste for expensive sunglasses, argh), I like nicely designed watches, probably as the only kind of jewelry I seem to tolerate on myself. Since I'm a snobbish bastard, I never found a watch that I'd like to wear, and I'd certainly not get a "normal utilitarian watch". In fact, I think I haven't owned a watch since, well, something like 1994 or 1995! So, after twelve years or so, I finally found something classy, made out of one of my favourite materials, and for a reaonable price, a nice souvenir.

To compensate for the classiness of that watch, I had some Kraft Dinner for, well, dinner. At about that time, the Toulouse Football Club beat the team from Bordeaux, thus qualifying them for the Champions League next year.

This, of course, leads to a bunch of people having apparently decided to blow up parts of Toulouse. Ah, the French...
pphaneuf: (Default)
As it turns out, this year's change in the implementation of daylight "savings" ended up not saving anything, and actually just causing extra annoyance. The US Congress seems completely taken by surprise by the fact that changing the time does not magically create more sunlight. That extra hour in the evening, scientists and the Department of Energy reminds them, is actually offset by an hour less in the morning! Imagine that!

Seems like there is not even a measurable energy savings. If anything, the biggest impact of the daylight savings change is that a bunch of computerized gadgets needed to be updated, and people with their Blackberry and Palm not being sure if the time was adjusted (some changed the time manually, only to have it change by another at the old switch-over date, for example).

Down with daylight savings! End the madness!
pphaneuf: (Default)

We're at the right place
Originally uploaded by Pierre Phaneuf.
After a smooth flight, [livejournal.com profile] azrhey and I arrived in Copenhagen Wednesday evening, greeted by [livejournal.com profile] skjalm, who's kindly keeping us safe from the elements, even kicking himself out of his own bed! Not to mention use and abuse of his Internet, booze, food, and what-not! He made us a very nice dinner of home-made lasagna, accompanied with some of the tasty mead that he's made himself. And a solid eggs and bacon breakfast the next morning.

Read more... )

Photos from that trip can be found here.
pphaneuf: (Oatmeal)
OMG, I so want one of these!

Reboot

May. 12th, 2007 07:45 pm
pphaneuf: (Default)
Last weekend, I got my residency permit turned down, which, to make a long story short, means that we'll be heading back to Canada. Seems like I was misdirected by the Consulat de France in Montreal, and from what I hear, it seems to be something they've done a few times ([livejournal.com profile] azrhey worked in a place here where they hire a lot of foreigners, due to language skills).

So, it looks like I'm going to be looking for a job back in Montreal.

My weapons of choice are C++ and Perl, but being a Unix/Linux hacker, of course, I am not limited to those, they're just the ones I'm most deadly with. I am comfortable with meta-programming (mostly, but not limited to that of C++ templates), continuations/coroutines, closures, multithreading, as well as event-driven state machines. I am quite effective at code refactoring, particularly in strongly typed languages, where I can use the typing system to my advantage.

I am deeply intimate with Unix/Linux, mainly in the area of network programming (sockets, networking protocols, other forms of IPC). On Linux, I am quite familiar with a number of the high-performance APIs. I have a deep knowledge of the HTTP protocol (and some of its derivatives). I have experience writing Apache modules. I know the difference between bandwidth and latency (and wish more people did too). I have some experience with developing distributed software. I have a higher-than-average knowledge of ELF and Mach-O binary formats, particularly of how symbol resolution works. I know a good deal about component software (dynamically loading modules, for example), and ABI stability issues. While I am not a master at it, I have some Linux kernel development experience as well. I know what make is doing, and why.

Finally, I also have some experience doing project and release management, where I feel I did a pretty good job, and would certainly like to do more of it. I am familiar with the free and open source software community, belonging to a number of projects, including some that were part of my work.
pphaneuf: (Default)
[livejournal.com profile] lkcl posted a reply to my previous post...

Oh, lkcl, you're a bit of a pessimistic, there. unlink is also atomic, not just rename. ;-)

But what I'm looking after right now isn't just a general message-passing operation (I already do that at a higher level, between various subsystems, using shared memory for local or sockets for remote recipients), more specifically the best way to take advantage of multiple cores as much as possible to process file descriptor events.

You have to cut the libc people some slack, though, they don't have locks around every single functions. I'd be amazingly appalled if strncmp() took a lock, for example! And as I described, I already used processes and shared-memory for higher-level concurrency, this threading is only for the very lowest level, when I have no choice and I'm pushed to the edge. Note that the code is already written as a state machines, using the threads to run more than one state machine at once (there is one state machine per connection or so, more or less). I'm planning on having a lock on the state machine instance, so that a single state machine cannot be executed on more than one thread at once, so that the code inside of it can make that assumption (that still allows me to handle multiple independent connections at once).

On Linux, epoll already does that in an atomic way, for me, in its edge-triggered mode. You can just have multiple threads call epoll_wait(), a given event will be sent to only one thread, until it is re-armed. But the specific requirement here is "compatibility layer for portability to other POSIX platforms", hence the use of crummy old select(). Of course, if I need high-load scalability on some big iron, I'll be sure to not use that layer, and go for epoll, kqueue() or something like that!

That said, I'd like a link to that message-passing work, it sounds interesting.
pphaneuf: (Enlightened)
I must be very silly, but I just realized that a Unix pipe is a semaphore. It's better in some aspects (is select()able) and worse in others (SEM_VALUE_MAX is lower). Cool.

In that context, the "signal handler that writes to a pipe" trick makes a new kind of sense (the semaphore equivalent, sem_post(), is the only synchronization function that is safe to use in a signal handler).
pphaneuf: (Default)
Here's the challenge: a select()-based event dispatcher that can scale from single-threaded to multi-threaded efficiently, preferably as simple as possible and able to be effectively edge-triggered (even if select() itself is level-triggered).

Read more... )

Anyone has suggestions for improvements? They are most welcome!
pphaneuf: (Default)
A good while ago, I declared my preference for edge-triggered events (for I/O), because in my mind, it most closely paralleled the actual workings of the hardware (IRQs being triggered when new data arrives on network interfaces or when a read/write request to disk is completed). I also figured that since it was possible to emulate level-triggered efficiently on top of edge- (that's what happens when you use close-to-the-metal "abstractions"), it probably was the more flexible choice.

Read more... )
pphaneuf: (Default)
We drank cheap sparkling wine the other day. When I say cheap, I mean 0.87 euro for a bottle. That's 1.34 CAD at the current rate.

I am also hacking on a modern C++ implementation of property lists. I am also getting rather hooked by some aspects of Boost. The binder is astonishingly clever and asio looks very promising. I'm also told their boost::function does not use a virtual method (unlike my attempt, WvCallback), which I'll have to look into.

No, there is no relation between the drinking and the hacking. :-P
pphaneuf: (Geeky)
Ok, so I in my last post, I was saying that software patents aren't too evil, that DRM still is quite evil (here a related link to Tim Bray, who's talking about the famous Linn company putting out DRM-free, higher-than-CD-quality music, props to them!), and so that I am switching to MP3.

I had been doing some research, so I figured I'd share some of my resources, while I'm there.

I found a ton of great information on the HydrogenAudio knowledge base, about which encoders are best, the pros and cons of various lossless formats (those harder to find CDs I also ripped to FLAC, for archival), and such things. For example, whether there was any issues with FLAC (apparently, the biggest thing is that you can't put RIFF chunks in them, but I don't think that should be an issue), or whether Ogg FLAC was it now (not really, only for streaming and other special cases, and you can convert from one to another very quickly). Seems like LAME is pretty much the state of the art for MP3 encoding, and that even the latest version of ID3 tags still kind of suck compared to Ogg Vorbis comments (thankfully, my ripping software, Max, keeps a full superset of all the meta-data in its own files).

Speaking of which, I have to recommend Max, it's a great piece of free software, very flexible and with a number of useful abilities, such as encoding to multiple formats in parallel from a single rip (I did some comparison testing between FLAC, MP3 and Ogg Vorbis on some difficult tracks, to test my encoder settings).

I also encountered one of the more practical annoyances with MP3 already, where (with XMMS, at least) seeking isn't accurate. If you hear a specific bit at the 2 minute mark, restart the song and seek back to the "same place", I often found that the time display is off and that when I reach the same bit, the player says I'm 10 seconds or so past the place I was the previous time. Oh well, I don't seek too often, thankfully, but it certainly made that side-by-side testing I was doing rather annoying.
pphaneuf: (Enlightened)
Okay, so I'm not writing a music player (yet). One could say my "faith" has weakened, where I am taking the opportunity of a re-ripping of my music library to switch from Ogg Vorbis to MP3. Yeah, yeah, I know, I'm a terrible human being, my soul will burn and everything.

A quick reminder on why MP3 is evil and how Ogg Vorbis will save your eternal soul: Thomson holds some patents on key technologies involved in the MP3 format, those technologies being in the form of mathematical concepts. Some people find the patenting of such intangible things to be stifling innovation, that many these concepts are inherent in nature, and that as such, anyone should be free to use them (some comparing this to patenting something like the Pythagorean theorem, as an algorithm to find the length of the hypothenuse of a right triangle).

After some soul searching, I feel that while this is true to some degree, it is not the most evil aspect of software patents. My issues with software patents are two-fold.

First, the way the process of obtaining those patents seems rather sketchy at best, quite regularly granting completely frivolous patents. Upon application, those often get overturned, but still, this costs money, and if I were to be sued over one, I would most likely be in deep financial trouble, no matter how frivolous the patent. In the case of MP3, I do not feel this is one of those, the thing being filled with psychoaccoustics, modified cosine transforms, polyphase quadrature filter, alias reduction formulas, and other such things guaranteed to give me a headache. These guys are no fly-by-night lawyers trying to make a quick buck, from what I can see.

Second, the duration of patents, for a low cost/revenue ratio industry (like software, as opposed to cars, which are expensive to manufacture) anyway, is quite excessive, in these days of rapid technological advances. Maybe that, yes, Pythagoras should have been granted a patent for his theorem, but the question is how soon should it have expired? Again, in the case of MP3, the oldest reference to those technologies I could find (didn't check very thoroughly!) was around 1986, which isn't shockingly old, but in terms of technology, is starting to get a little dated. I'd say that a 15-20 years expiration on that kind of patent wouldn't be too ridiculous either way, and I'm sure smart inventors would manage to make quite a bit of money in even less time.

So, in short, I'm not technically against software patents, but more against the way they are implemented right now. I suppose I also dislike the way some patent holders keep quiet about their portfolio, until everyone is using the technology, at which point they helpfully point out that every bloody living organism owes them money. Those make me angry.

In any case, for most users, patents are a bit immaterial, it's mostly for developers (especially of free software). It inflates the cost of their iPod by a few dollars, but they can't really tell the difference between that and the rest of the cost.

What's material to people right now, though is DRM, the so-called "digital rights management". Ensuring your rights are properly limited and constrained, that the rights of the poor media corporations aren't being trampled on by nasty people that want to listen or watch the content they lawfully paid for (pesky, those people!).

It's too bad this isn't being done with the arguably superior Ogg Vorbis, but compared to many of the other choices, MP3 is the choice with more freedom, compared to the PlaysForSure and FairPlays of the world. Pirates aren't being stopped, honest people get screwed and I forgot my point.

February 2016

S M T W T F S
 123456
7891011 1213
14151617181920
21222324252627
2829     

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 20th, 2025 02:58 pm
Powered by Dreamwidth Studios