pphaneuf: (Default)
The wire/plug of my in-ear headphones has started flaking out, so I switched to the iPod stock earbuds. I had forgotten how annoying earbuds are.

On the short walk from home to the metro, they fell out of my ear twice, and they keep moving around, needing to adjust them all the time, with sound levels varying all the time. On the upside, I can hear my surroundings better, but right now, in the metro, it turned into a negative. Forget hearing any subtleties, too...

To be clear, I'm not taking aim at the Apple earbuds, but at earbuds in general. Of note, Apple will soon offers in-ear headphones as an upgrade.
pphaneuf: (Default)

I use to post entries to my online diary from my Palm, while I was riding the metro. Looks like I can do that again, thanks to some LiveJournal app! Although I do not ride the metro much, these days... And hopefully, my iPod touch will be spared the untimely demise(s) of my Palms!

pphaneuf: (Shades)
So last Saturday, we embarked on a bit of painting. You see, the paint in our apartment is some sort of "priming basic paint", which isn't totally awful to look at (unlike primer), but isn't quite awesome either, it's prime quality being that it's easy to paint over. After we recently discovered that this quality also made it a fairly hospitable surface for mold, we decided we'd paint the bathrooms with a more appropriate type of paint. While we were there, we also wanted to paint some of the doors a darker shade, a bit like the cupboards.

Unfortunately, after sleeping at [livejournal.com profile] azrhey's parents and going to [livejournal.com profile] liberation_now and [livejournal.com profile] tygrbabe's brunchwarming (where several attempts to make us explode with delicious food were made!), we came back and saw that there was actually a number of screw-ups we hadn't noticed the day before that piled up to make it downright disastrous.

So there has been episodes of peeling off misapplied paint, sanding down some defects, putting in some spackle in places, and repainting some insufficiently covered areas. The bathrooms are more or less back under control, although the doors still need work.

That's combined with finally getting the delivery (albeit a bit later, and taking longer than expected) of the custom wall unit we had ordered a while back for the living room. It's very nice, although it has some of the warts of a one-off, such has just about zero cable routing and the very stylish smoked glass door apparently messing with the PVR's remote control. There was a small mistake in the design, but we actually like it better than what we wanted originally, so there (we'll be able to have a small bar in it!). Still, a fine piece of furniture. Now we just need to get more DVDs to stuff in its gigantic drawers!

It seems like I'm the worst bike mechanic in the world. For a few days now, I was hearing a bit of a metallic noise when I was going over potholes and cracks in the pavement, as if a screw was loose and a washer was bouncing around on it. I tried to locate the origin of the sound, grabbing my cables, derailleurs, and various other mechanical parts, all the while going along Notre-Dame (not the safest plan, by the way). No luck. So I stopped by Belleville Cycle Co-op on the way to work, worried that this might lead eventually to something more serious, like a broken chain or whatnot, and the guy there put me to shame. One of the unused bottle cage screws was loose, and the spacing washer was bouncing around on it. Duh! I swear I checked those guys, but there's four of them, and I as I was doing that while riding, I guess I skipped the culprit... Argh.

[livejournal.com profile] azrhey and I took a small break today to go to the Akoha, uh, thing. We've both left wondering a bit about where the money is going to be coming from (but you have to admit that you get to wonder about that for most of what you see on the Internet, and yet, it's there!), but it's a pretty cool and generally positive idea. I'll try to do well as a tester. :-)

Coming back from there, I saw a pretty sweet bike locked on St-Laurent, a Specialized Langster Seattle. I guess that for a fixie, getting it all done like that is kind of cheating, and I'm not entirely sure of what I want yet in a fixie anyway, but it looks damned nice (the Chicago colour is very nice, but the Seattle handlebars are more to my liking). The Seattle one has a coffee cup holder? Uh, anyway...
pphaneuf: (Enlightened)
So I went for a weekend in San Francisco... I was planning on that already, so I had packed a light raincoat and a few long-sleeved shirts, so I wouldn't look like a tourist, but as it turned out, I forgot them in Mountain View and looked like a tourist anyway! After obtaining a lender bike for the weekend (thanks Noé!) and deciding to leave my laptop at the office so I could travel light, I hopped on the Google shuttle and managed to get the wireless Internet they have onboard working on my iPod touch. This was already kind of cool, but I was totally amazed when I thought I would consult the map and I pressed the "go to my location" button, just for the heck of it, and it actually got it! I was then further amazed at how it seemed to do a kind of pseudo-tracking, updating my position every ten seconds or so... So I didn't feel quite as lost as I did the last time.

After getting together with [livejournal.com profile] morethanreal, dropping off my stuff at her place and inflating the bike's tires (I quickly found out that the brakes were not working well at all either, which was a bit worrying, considering how hilly San Francisco is!), we headed to some show she had heard was recommended that night. It was in a small but pretty cool art gallery, where they had a good number (maybe a hundred or so?) of speakers embedded in wooden sculptures, hanging by wires from the ceiling. The curator later told us that this is an art installation and that they are actually operational, seemed like this could be pretty cool in itself, but as it turns out, the main attraction of the night was a DJ. He was pretty competent, I have to say, and enjoyed his set, despite the fact that we had just missed a part of his performance where he donned a dinosaur suit and hugged everyone in the audience, I was a bit disappointed having missed that! It's funny how people recognize my accent, including in particular the bartender, whom I was asking for a beer. He pointed me at the menu with just two beers available (this was a temporary setup), and I told him that, well, I had no idea what either of those were. So he apologized quickly, asked me if I knew about Unibroue, to which I responded in the affirmative, and he then told me that I would find the first one horrible, and that the other one, well, wasn't nearly as good as Unibroue, but would probably not offend me too much. Heh!

After getting back to [livejournal.com profile] morethanreal's place, there was some inevitable discussion about music, of course, and I introduced her to the new Apple Remote application for her iPhone. She fell in love at first sight, it would seem, she even moved her iPhone dock to put it beside her bed! We were pretty tired, but she had put on Black Eyes's eponymous album, and it is quite good, we just had to finish it before going to sleep.


Tour de Fat
Originally uploaded by Pierre Phaneuf.
The next day, I wasn't feeling too sore from sleeping her couch, which was good, because we were heading out to Tour de Fat! There was a brief stop for chocolatines and cappuccinos, of course, it wouldn't have been civilized otherwise. There were crazy bikes, crazy bands, and crazy beer! Much fun was had, including bouncing around with (very) limited success on a pogo-stick. I then accompanied [livejournal.com profile] morethanreal to a tattooing session (hers, not mine!), which was pretty cool, including a pretty classic Californian laid back surfer artist. I then headed back with her to pick up my stuff, had some (spicy!) burrito on 16th, then headed to [livejournal.com profile] jbdeboer's place, where I elected to stay that night (thanks, by the way!). That place is up. Very, very up. Like, on top. Yowzer. I had some idea of taking a cab from there to the DNA Lounge, but I was too wiped and gave up (fail!).

On the upside of being at the top is the good view (hmm, there's the view to Lafayette Park, which can be interesting according to the "near here" feature of some random iPod Flickr app!), although it was a bit cloudy. Biking down Gough was mental, though! I realized at some point that with the intersections being flat, that I couldn't see past them! All of that while going upward of 40 kph, of course. That led me eventually to a nice breakfast at Cafe Petra, since there was too many people at Ritual (and I don't think they have food either). I biked around the Mission, dropped by Good Vibrations (got myself a book), then back up around Market and Stockton, where I resisted the siren call of the Apple Store. I managed to get some excellent coffee at Bluebottle Coffee, once more, and then eventually got lost in the Tenderloin without realizing it, while I was taking photos. It was very sketchy, especially with my big SLR camera hanging from my neck.

Monday, the excitement level was much lower as I went to Barefoot Coffee Roasters with a team-mate who is a fan of good coffee. It is also very good, although I preferred Bluebottle's. As it is customary in Mountain View, we were back home before 10pm.

The next day, we went for dinner on Castro (in Mountain View) at an Italian restaurant with a very colourful owner, who seems to be a big George Michael fan. Excellent service, though, setting up a table just for us (my other team-mates are known there, it would seem), and of course, singing at the table by the owner. There was some ice cream after, and some of us were rebellious and went home past 11pm!

Now, I'm about to be taken out to In-N-Out, which I'm told I just have to go to. Sounds questionable, but hey, I've done worse.
pphaneuf: (Enlightened)
We moved into our new office this week (photos courtesy of MAD, thanks!), and it's pretty damned awesome! Considering the small size of the office (in number of people), it is extremely nice, the food is great, and so is the view (we had a nice view from the 24th floor, but now we're more "in the action", I like that better). Plus, we can easily reach the wifi from the pub nearby, hehe!

While the move was ongoing, we had an off-site activity on Île-Ste-Hélène that was pretty cool, involving, among other things, geo-caching, which I had never done before and is a lot of fun. It can be surprisingly difficult to find a small item, even when given the location within 10 feet! I bike there from home, and it was particularly nice, hitting 40 kph for fairly long stretches and all. On the return trip I was pretty confident that I'd get to the dinner's location first, but when I found out that the likely reason for my swift arrival was a wicked strong headwind, I wasn't so confident anymore. I did arrive first anyway, but I'm told they took a brief detour in a sketchy St-Henri bar first. Crazy people!

Today, we also obtained a vacuum cleaner at home. You're probably thinking that this doesn't really sound all that exciting, and normally, I'd agree with you, but that was before I met the Dyson DC20. As far as box-opening experience goes, relatively speaking (let's face it, it's still just a vacuum cleaner), they're taking lessons from Apple, it looks like. One of the selling points is how it can fit into a small space, and when I got the box, I was a bit worried that it'd be missing, you know, maybe the whole thing?!? But no, it was all in there, and even when assembled, it packs into almost no space, and is very cleverly engineered.

Tomorrow, a rather late in the making haircut.
pphaneuf: (Default)
Something that I have said a number of times is that nowadays, there is almost no reason to pick C over C++ for a new project (one of the few reasons that I know of involve writing execute-in-place code for very small embedded systems, so no, GNOME definitely doesn't qualify!). Worst case, you write exactly the same code you'd have written in C, just avoiding using the new keywords as identifiers, and you then get better warnings (remember, no templates would be involved) and stricter type checking (no more silent casting of void* to pointers to random things! No more setting enums from any random integral junk you happen to have at hand! No more forgetting a header and using a function with the wrong parameters!).

But these slides really put it together, from someone who's generally thought of as neither insane or dumb. Doesn't really have much to do with GCC in particular, other than just the general fact that this is becoming so obvious that even GCC might be making the switch...

Edit: This article by Amit Patel is also pretty good on this subject.
pphaneuf: (I Like Beer)
Uh, there was a traffic jam on my small street today when I left for work?!? Complete with no less than two city buses, trying to work around the cranes and other construction equipment currently cluttering the street... Weird.

Oh, man, I've been meaning to post for exactly two weeks, yet didn't. I did this thing where I thought about hypothetical posts that I'd be writing while on the metro and biking, then forgot to actually post it.

It helps that there has been a fair deal of biking going on, beginning with what I called the Weekend of Doomed Awesomeness for a bit (if only in my head). This started by going to Mutek's Nocturne 3 with [livejournal.com profile] tygrbabe on the Friday. Then, went to the Mondial de la bière with [livejournal.com profile] azrhey in the afternoon, after which [livejournal.com profile] tygrbabe joined us to go to Mutek's Nocturne 4. How to follow this best? Sunday, I showed up at [livejournal.com profile] cpirate's place almost in time (9am-ish, after going to bed at 5am!) for, you know, a little Tour de l'Île (with [livejournal.com profile] scjody as well), after which we stopped for well-deserved poutine at La Banquise (and a coffee, so I could stay conscious). Then (the same day!), [livejournal.com profile] azrhey and I met with [livejournal.com profile] rezendi for a quick pint before catching Le Salaire de la peur at Cinéma du Parc. In case I might have survived, [livejournal.com profile] tygrbabe invited me to see She Wants Revenge for my birthday (got me brownies too, woot!), on the Monday evening (we were joined by [livejournal.com profile] fuzzyilla too, ahoy!).

While I thought Nocturne 3 was quite excellent (Millimetrik and Modeselektor were awesome, Kid Koala very good, although I've seen better sets from him, and the other bands were quite fun too), Nocturne 4 let me a little bit down. Most of the bands didn't "click" with me much, and the whole programme was running late, which combined with the act I wanted to see most (Deadbeat, was excellent!) played last, made for leaving the place extremely late. Still, it was nice too, I just wish I could have slept in the next day!

I'll have to agree with [livejournal.com profile] tygrbabe, She Wants Revenge was good, but they'd have to put out a killer album for me to go to their next show. Some of their opening bands were really wacky and not all that good either, including a "punk" band that sounded like Avril Lavigne on speed.

So after that, I, uh, didn't do much for the two last weeks, as you might have guessed. I did bike to work a lot (for which there was tremendously good weather!), played with my own early birthday gift to myself (a new top-end 24" iMac, Core 2 Duo 3.06 GHz and GeForce 8800 GS, smokin'!) and coded (mostly on Quadra, more than 20 commits just this weekend!). There was a visit from [livejournal.com profile] musicdieu and [livejournal.com profile] cpirate, watching of Euro Cup games, and Munchkins.

[livejournal.com profile] azrhey and I went out on the city last Saturday, was quite nice, and I got myself a nice watch (Danish design and titanium? sign me up!). We ended up going to the cinema and watching You Don't Mess with the Zohan. Yes, I know, I know, but it's actually pretty funny, mostly due to the weird cultural references (fizzy bubbles and hummus, baby!), and was saved because I have a small idea of what's going on in that culture, and would probably have been even funnier if I was actually part of it. I don't really expect it to do well, although there's a fair share of stuff that a lot of North American would find funny (silly fight scenes, sexual jokes), but I laughed really hard at the hacky sack, fish and hummus jokes, myself.

On a closing note, I've had a weird email recently from OkCupid (which I do find entertaining, for various reasons). I often get the "come back to our site so you can see and click ads" emails, but this one was different, telling me that there was one particular user I should message where there was some sort of category 5 crazy outlier match. Apparently, the love of my life is in New York state, which is too bad, because I'm not, ha! It then showed the usual "you might be interested in those people" bunch of people, but as opposed to the usual, this morning it was a bunch of my friends, so, well, I guess it sorts of works? I do like my friends, they're nice and everything. :-P

Moving On

May. 28th, 2008 10:52 am
pphaneuf: (Default)
Reg Braithwaite was writing not long ago about how we can be the biggest obstacle to our own growth. It made me realize how I've dropped things that I was once a staunch supporter of.

I was once a Borland Pascal programmer, and I believed that it was better than C or even C++. I believed that the flexibility of runtime typing would win over the static typing of C++ templates, as computers got faster. I belived that RPC were a great idea, and even worked on an RPC system that would work over dial-up connections (because that's what I had back then). I put in a lot of time working on object persistence and databases. I thought that exceptions were fundamentally bad. I believed that threads were bad, and that event-driven was the way to go.

Now, I believe in message-passing and in letting the OS kernel manage concurrency (but I don't necessarily believe in threads, it's just what I happen to need in order to get efficient message-passing inside a concurrent application that lets the kernel do its work). I wonder when that will become wrong? And what is going to become right?

I like to think I had some vision, occasionally. For example, I once worked on an email processing system for FidoNet (thanks to Tom Jennings, a beacon of awesome!), and my friends called me a nutjob when I told them that I was designing the thing so that it was possible to send messages larger than two gigabytes. What I believed was that we'd get fantastic bandwidth someday where messages this large were feasible (we did! but that was an easy call), and that you'd be able to subscribe to television shows for some small sum, where they would send it to you by email and you'd watch it to your convenience. That's never gonna happen, they said! Ha! HTTP (which I think is used in the iTunes Store) uses the very same chunked encoding that I put in my design back then...

Note that in some cases, I was partly right, but the world changed, and what was right became wrong. For example, the 32-bit variant of Borland Pascal, Delphi, is actually a pretty nice language (ask apenwarr!), and while it isn't going to beat C++ in system programming, like I believed it could, it's giving it a really hard time in Windows application programming, and that level of success despite being an almost entirely proprietary platform is quite amazing. Even Microsoft is buckling under the reality that openness is good for language platforms, trying to have as many people from the outside contributing to .NET (another thing to note: C# was mainly designed by some of the Delphi designers). Imagine what could happen if Borland came to its sense and spat out a Delphi GCC front-end (and use it in their products, making it "the real one", not some afterthought)?

I doubt that's going to happen, though. For application development, I think it's more likely that "scripting languages" like Ruby, Python and JavaScript are going to reach up and take this away from insanely annoying compiled languages like C++ (and maybe even Java).

But hey, what do I know? I once thought RPC was going to be the future!

Packed!

May. 26th, 2008 05:05 pm
pphaneuf: (Default)
Ok, so after going to Festival Kinetik last week (where I nearly snapped my neck ogling!), I booked up this weekend pretty solid: going to Mutek Nocturne 3 and 4 (Friday and Saturday), the Beer Fest on Saturday, the Tour de l'île on Sunday and She Wants Revenge on Monday. It will be both intense and awesome, I think!

Gifted myself with an iMac 24" this weekend (the big one with the GeForce!), ostensibly for my birthday, and managed to play some Battlefield 2142, for, uh, "testing". The testing is pretty conclusive, and it's quite awesome. And, oh, so silent, yet so powerful! I will also be looking forward faster compiling on my old laptop through Xgrid.

I've also come up with a design in my head for doing zero-overdraw overlapping windows with support for alpha transparency. I'm dreaming of a "Quadra HD", and while I don't really know what it'd look like, I know that according to historical figures for development speed, we should release that around 2012 or so! I also got a "pre-opened" gamepad last week, which will allow for adding support for it in Quadra, which has been requested since more or less forever. That could be here as soon as 2009! ;-)
pphaneuf: (Default)
I was wondering how to handle timeouts correctly while blocked for I/O on sockets, with as few system calls as possible.

Thanks to slamb for reminding me of SO_SNDTIMEO/SO_RCVTIMEO! Combined with recv() letting me do short reads, I think I've got what I need for something completely portable.
pphaneuf: (Default)
Being the end of the world and all, I figure I should go into a bit more details, especially as [livejournal.com profile] omnifarious went as far as commenting on this life-altering situation.

He's unfortunately correct about a shared-everything concurrency model being too hard for most people, mainly because the average programmer has a lizard's brain. There's not much I can do about that, unfortunately. We might be having an issue of operating systems here, rather than languages, for that aspect. We can fake it in our Erlang and Newsqueak runtimes, but really, we can only pile so many schedulers up on each others and convince ourselves that we still make sense. That theme comes back later in this post...

[livejournal.com profile] omnifarious's other complaint about threads is that they introduce latency, but I think he's got it backward. Communication introduces latency. Threads let the operating system reduce the overall latency by letting other runs whenever it's possible, instead of being stuck. But if you want to avoid the latency of a specific request, then you have to avoid communication, not threads. Now, that's the thing with a shared-everything model, is that it's kind of promiscuous, and not only is it tempting to poke around in memory that you shouldn't, but sometimes you even do it by accident, when multiple threads touch things that are on the same cache line (better allocators help with that, but you have to be careful still). More points in the "too hard for most people" column.

His analogy of memcached with NUMA is also to the point. While memcached is at the cluster end of the spectrum, at the other end, there is a similar phenomenon with SMP systems that aren't all that symmetrical, multi-cores add another layer, and hyper-threading yet another. All of this should emphasize how complicated writing a scheduler that will do a good job of using this properly is, and that I'm not particularly thrilled at the idea of having to do it myself, when there's a number of rather clever people trying to do it in the kernel.

What really won me over to threading is the implicit I/O. I got screwed over by paging, so I fought back (wasn't going to let myself be pushed around like that!), summoning the evil powers of mlockall(). That's where it struck me that I was forfeiting virtual memory, at this point, and figured that there had to be some way that sucked less. To use multiple cores, I was already going to have to use threads (assuming workloads that need a higher level of integration than processes), so I was already exposed to sharing and synchronization, and as I was working things out, it got clearer that this was one of those things where the worst is getting from one thread to more than one. I was already in it, why not go all the way?

One of the things that didn't appeal to me in threads was getting preempted. It turns out that when you're not too greedy, you get rewarded! A single-threaded, event-driven program is very busy, because it always finds something interesting to do, and when it's really busy, it tends to exhaust its time slice. With a blocking I/O, thread-per-request design, most servers do not overrun their time slice before running into another blocking point. So in practice, the state machine that I tried so hard to implement in user-space works itself out, if I don't eat all the virtual memory space with huge stacks. With futexes, synchronization is really only expensive in case of contention, so that on a single-processor machine, it's actually just fine too! Seems ironic, but none of it would be useful without futexes and a good scheduler, both of which we only recently got.

There's still the case of CPU intensive work, which could introduce trashing between threads and reduced throughput. I haven't figured out the best way to do this yet, but it could be kept under control with something like a semaphore, perhaps? Have it set to the maximum number of CPU intensive tasks you want going, have them wait on it before doing work, post it when they're done (or when there's a good moment to yield)...

[livejournal.com profile] omnifarious is right about being careful about learning from what others have done. Clever use of shared_ptr and immutable data can be used as a form of RCU, and immutable data in general tends to make good friends with being replicated (safely) in many places.

One of the great ironies of this, in my opinion, is that Java got NIO almost just in time for it to it to be obsolete, while we were doing this in C and C++ since, well, almost forever. Sun has this trick for being right, yet do it wrong, it's amazing!
pphaneuf: (Default)
Ok, here we go:

Event-driven non-blocking I/O isn't the way anymore for high-performance network servers, blocking I/O on a bunch of threads is better now.

Wow, I can't believe I just wrote that! Here's a post that describes some of the reasons (this is talking more about Java, but the underlying reasons apply to C++ as well, it's not just JVMs getting wackier at optimizing locking). It depends on your platform (things don't change from being true to being false just out of the blue!), and more specifically, I have NPTL-based Linux 2.6 in mind, at the very least (NPTL is needed for better futex-based synchronization, and 2.6 for the O(1) scheduler and low overhead per thread). You also want to specify the smallest stacks you can get away with, and you also want a 64-bit machine (it has a bigger address space, meaning it will explode later).

The most important thing you need is to think and not be an idiot, but that's not really new.

And when I say "bunch of threads", I really mean it! My current "ideal design" for a web server now involves not just a thread per connection, but a thread per request (of which there can be multiple requests per connection)! Basically, you want one thread reading a request from the socket, then once it's read, fork it off to let it do its work, and have the writing of the reply to the socket be done on the request thread. This allows for as much pipelining as possible.

Still, event-driven I/O is not completely useless, it is still handy in the case of protocols that have long-lived connections which stay quiet for a long time. Examples of that are IRC and LDAP servers, although it's possible that with connection keep-alive, one might want to do that with an HTTP server as well, using event notification to see that a request is arrived, then hand it back to a thread to actually process it.

I also now realize that I was thinking too hard in my previous thoughts on using multiple cores. One could simply have a "waiting strategy" (be it select() or epoll), and something else to process the events (an "executor", I think some people call that?). You could then have a simple single-threaded executor that just runs the callbacks right there and then, no more fuss (think of WvStreams' post_select()), or you could have a fancy-pants thread-poll, whatever you fancied. I was so proud of my little design, now it's all useless. Oh well, live and learn...
pphaneuf: (Default)
It was extremely brief, and you had to pay very close attention, but the sugar season's passed now, and thankfully, [livejournal.com profile] azrhey and I managed to catch some sugar shack action, thanks to my dad inviting us over to his annual thing (which went better than the last time, as I wasn't dying this time!). It was what, [livejournal.com profile] azrhey's third time in a sugar shack in her life? How do they manage over there? ;-)

I went for a lightning trip to New York City, where I thought it'd be a good idea to get a room at the Hotel Chelsea, since, you know, the office is in Chelsea, that'd be convenient, no? I did listen to punk music, but I don't remember stabbing anyone. I didn't write a novel either, but I did write a small piece of code, related to my most recent ranting, where my hack gets similar latency on event handling as busy waiting on the event queue, while using less CPU (and much lower latency, by multiple frames!) than SDL's built-in SDL_WaitEvent.

This last item results in myself restraining myself very hard from going off and making a high-performance game library. Add it to the list of things I could do very well, but that I shouldn't be doing because it's useless. Argh.

[livejournal.com profile] azrhey and I went to see Iron Man, which was pretty damned good, I think. I think that it was a good introduction, although the battle at the end was a bit contrived and short on time. I think Justin Hammer might have been a better choice, with multiple supporting bad guys, but Iron Monger does make for big badaboom. I liked the hints at War Machine, and the small (in that movie, at least) involvement of S.H.I.E.L.D..

I'm now about to register for the Bike Fest, which inconveniently overlaps with MUTEK. The day ride doesn't pose a problem, but I really like the night ride, and that will obviously mean that I'll be missing out on something else... We'll see.

Old Fogeys

Apr. 25th, 2008 12:21 pm
pphaneuf: (Default)
I've become a member of Communauto last week, and combined with getting my bike back, means that I'm at what is going to be my peak mobility for the next little while.

Used Communauto a couple of days later to go to a Quadra hackfest at Rémi's, with [livejournal.com profile] slajoie as well. I've had a surge of interest in Quadra, but it is a delicate thing to do: we need to release a new stable version before we can hack on the "next generation" version, and while we're getting very close now, there is definitely a momentum thing that can be lost just too easily. And now the kind of things left are packaging related, which isn't the most exciting (so help us out, [livejournal.com profile] dgryski!). We've got interesting ideas for future development, but we can't really do any of this for now, since it would make merging from the stable release very annoying (and it already isn't too wonderful at times)...

Getting my bike back meant going to work on bike, and that is ridiculously quick, on the order of six to seven minutes. That's faster than the metro, by a lot (that's only a bit more than the average waiting time, and I don't have to walk to Lionel-Groulx). In my opinion, that's not even good exercise, I hardly have time to break a sweat even if I go fast, so I might end up taking detours on good days (the Lachine Canal bike path is nearby).

Related to Quadra, I've been looking at SDL (which the next version of Quadra uses instead of its internal platform) and SDL_net. It's funny how game developers are so conservative sometimes! I don't know much about 3D games, but in 2D, people seem to develop more or less like they did on DOS more than 10 years ago, which was very limited back then, due to DOS not having much of a driver model. Because of that, since anything more than page flipping and waiting for the vertical retrace (using polling PIO, of course) is specific to every video chipset. A game wanting to use accelerated blits had to basically have its own internal driver model, and when a card was not supported, either the game would look bad (because it would use a software fallback), or would not work at all. In light of that, most games just assumed a basic VGA card (the "Super" part is made of vendor-specific extensions), using 320x200 in 256 colors (like Doom), or 640x480 in 16 colors (ever used Windows' "safe mode"?), with maybe a few extra extensions that were extremely common and mostly the same.

Then, DirectX appeared and all the fancy accelerations became available to games (window systems like X11 and Windows had their own driver model, but could afford to, being bigger projects than most games, and were pretty much the sole users of the accelerations, so they existed). What happened? Game developers kept going pretty much the same way. Some tests by Rémi back then found that using the video memory to video memory color key accelerated blits (with DirectDraw), getting hundreds of frames per second, where the software equivalent could barely pull thirty frames per second on the same machine. About an order of magnitude faster! You'd think game developers would be all over this, but no, they weren't. They were set in their ways, had their own libraries that did it the crappy way, and didn't bother, overall. The biggest user of 2D color keyed blitting is probably something like the Windows desktop icons.

Then, 3D acceleration appeared, and they just didn't have the choice. The thing is, this hardware still isn't completely pervasive, and especially for the target audience of a game like Quadra, who like nice little games and won't have big nVidia monsters in their machines, so using the 3D hardware for that kind of game would leave them in the dust. Nowadays, DirectDraw has been obsoleted and is now a compatibility wrapper on top of Direct3D, so oddly enough, we're back to 2D games having to avoid the acceleration.

Thankfully, in the meantime, the main CPUs and memory became much faster, so you can do pretty cool stuff all in software, but it's kind of a shame, I see all of this CPU being wasted. Think about it: Quadra pulls in at about 70% CPU usage on my 1.5 GHz laptop, so one could think it would "need" about 1 GHz to run adequately, right? Except it worked at just about full frame rate (its engine is bound at 100 frames per second) on my old 100 MHz 486DX! Something weird happened in between...

Game developers seem to be used to blocking APIs and polling so much, it spills over in SDL_net, which uses its sockets in blocking mode, and where one could easily lock up a server remotely by doing something silly like hooking up a debugger to one of the client and pausing it. Maybe unplugging the Ethernet cable would do it too, for a minute or two, until the connection timed out. How awful...
pphaneuf: (Default)
It's been sort of a busy week, but in a good way, for the most part.

There was an unusually high amount of the [livejournal.com profile] tygrbabe this week, having been to her DJing night at the Katacombes, her visiting us at home, then her birthday, then more of her birthday (which involved a bunch of hot people hanging out at my place, so yay!)... That's cool, I think. We've got bait for more visits, in the form of tons of Torchwood and the Dieux du Stade DVD (which might also work very well with [livejournal.com profile] archdiva, hehehe!).

In her most recent visit, she left me some computer hardware to fix up, which is kind of amusing, because we're currently being invaded by electronic equipment already! I got a new television delivered Wednesday, got all sorts of cabling to hook my computers to it (gotta be able to watch the Torchwood!), and we got a PVR cable box (I'd do without broadcast television myself, but [livejournal.com profile] azrhey is a fan, and there's got to be something on?). This means that the place is a bit of a disaster area at the moment, while I try to put all this together in a sensible way.

For anyone looking to get some audio/video cabling, I'd like to point out something rather weird. As you may know (well, if you're still reading past the previous sentence), there's some serious price-gouging going on with A/V cabling. In some cases, it can be understood (analog signals are sensitive to interferences of all sorts, better shielding and conductors do make a difference), but in the modern world of fully-digital HDMI cables, WTF? Unless you have a freakin' ion storm in your living room, the very cheapest digital cable will get you the best possible quality (unless it doesn't, in which case it'll either be very obviously horrible, or outright won't work). Stores liked to sell high-margins cabling, though, so they're still at it anyway. So, I set out to find the cheapest digital cabling possible.

You'd think that Apple would be in on the price gouging, no? Well, apparently, Apple is a bit schizophrenic in that regard. Future Shop had this 4 feet HDMI to DVI cable, which is the cheapest of that type they had (there were some cheaper HDMI-DVI adapters, but with the cable, came out more expensive). At the Apple Store, they have this 2 metre (6.56 feet) HDMI to DVI cable. As I said, as long as they'll work, the image quality will be identical, and the one at the Apple Store is longer. The Apple Store one is also only $19.95, compared to $70.99 for the (shorter) one at Future Shop. That's less than a third the price!

So, less than a third of the price for better stuff? Uh, a bit out of character for Apple, but keep it up, I could use more of that (if only as an "inspiration" for other stores)!
pphaneuf: (Enlightened)
A few weeks back, I found myself having dinner with [livejournal.com profile] tygrbabe, where I discussed with her the fact that I rather enjoy her company. She is one of my favourite persons, after all! She seems to be enjoying my company as well, which I find to be a relief. After all, this was fairly high on my list of things that I didn't think would be happening any time soon, after the events I mentioned in my previous post. But here I was, at the movies, holding hands and giggling. Life is weird, sometimes, but it could be much worse than this, I think!

The movie, by the way, was Charlie Wilson's War, and to make a quick summary, it included much more boobies than I would have expected. It's actually rather good, with some excellent work on the part of Philip Seymour Hoffman, an often underestimated actor, in my opinion. He seems to be often put in quirky roles, does well in them, and I like quirky.

Upon leaving the movie, I glanced at one of the buildings downtown, wondering what is happening at Google with my application there... Oh, yes, I was keeping a lid on it (well, mostly, as I'm hardly the most secretive person around!) until things were becoming a bit more solid, but I have been interviewing with Google recently, after some ex-Nitiot who's now there pointed them my way. [livejournal.com profile] tygrbabe pointed out that they wouldn't exactly hang a giant sign out on the side of the building, so we proceeded to go on a walkabout, where she threatened to push me in a number of snow banks.

After that, as I entered a metro station, I pulled out my mobile phone to send an SMS to the lady [livejournal.com profile] azrhey to let her know that I was coming back, as we had agreed. Doing so, I noticed that I had left it on silent mode, from the movie, and that I had a voice mail message. I check it out, and it turns out that it's an offer from Google! Heh, while I was wondering what was going on, they had contacted me. Which makes me wonder if they have some kind of mind reading device...

A few days after that, I decided to accept the offer. Turns out that this leads to a two weeks orientation that is to be done at their Mountain View campus, the fabled Googleplex. Checking schedules, this lined up to be starting the week after [livejournal.com profile] azrhey and I moved into our new place. As in, we're doing the actual moving on the Saturday, and I have to be there at 8:00 on the Monday. It certainly seems that I'm not content with my life being a roller-coaster, it also has to be doused in kerosene and set ablaze. Otherwise, it's just too boring, right? Thanks to the [livejournal.com profile] cpirate for the extra help!

Our new place is pretty awesome, if a bit dark (there isn't much lighting included, we have to get our own). The bathtub is big and deep, the shower is spacious and has a neat pane of glass instead of a shower curtain. There's a secret passageway to the bedroom. The toilets are fancy dual-flush models (about time we get them here!), albeit with non-standard fitting sizes (argh, the joys of being an owner, I guess). The shower and bathtub faucets have fully separate temperature and flow controls, like I maintain is the proper way (and is the normal way in sane countries like Denmark, and very common in the rest of Europe). We're missing a few items before we can actually have people over properly, like proper lighting so that we don't just sit in the dark.

Now, I'm writing this on the plane from Chicago to San Jose, which is going pretty well up to now, as opposed to my last trip to New York City (which the quick-witted among you will have associated with my Google employment, on top of visiting the fine people I know over there). On top of the Google orientation and overall excitement of being a "Noogler", I hope to visit [livejournal.com profile] morethanreal, see the Computer History Museum (which I've dreamed of for almost twenty years now!), and generally visit San Francisco. Maybe a bit much to pack in my free time, I'll see.

P.S.: You're reading this, therefore I didn't end up in a flaming plane wreck.
pphaneuf: (Default)
Explored New York a bit yesterday with some of my hosts, which was pretty cool and impressive. Already, from the apartment, there is a view on the Manhattan skyline, and getting there, there's a definite feeling of being in a Big Place. That's why I took my 14mm/f2.8 super-wide-angle lens as my only lens, which was a bit of a weird choice. I was glad I had it for some stuff, but other times, the thing I wanted to photography as so small and far away! A cool lens, but I'll need to get used to it, for sure.

[livejournal.com profile] andukar and [livejournal.com profile] a_chatterbox took me out for a late breakfast first, at Max Brenner on 2nd Avenue (they wanted to take me to some other place, but it was full). They're pretty serious about their chocolate, and while the breakfast was nothing too special, the included cappuccino was actually pretty good, while they didn't let me upgrade to a mocha, it came with two small chunks of chocolate, which I promptly threw in the coffee. Tasty!

We then headed to the Grand Central Terminal, where some photos were taken, and the acoustics of the archway next to the lower concourse was tried out.

We walked up 5th Avenue, seeing a vast penny collection set up at the Rockefeller Center, onward to the Fifth Avenue Apple Store. While the store itself is nothing all that special (it's just larger than the one I had seen before, but not huge either), the architecture of it is indeed pretty damned cool. I took advantage of the almost-collapsing US economy to buy a few items, saving something like 30% over the price in Canada. Haha, chumps!

We then walked through Central Park for a bit. This is such a great idea, dropping a huge park in the centre of a city! Definitely the hallmark of an awesome city (check!).

After a while there, [livejournal.com profile] a_chatterbox announced that hot chocolate was called for, as it was a bit chilly, which I could only concur with. So we headed to the Chocolate Bar, where I had a nice hazelnut-flavoured hot chocolate with a chipotle/cinnamon brownie to go with it. Oh yeah.

After a quick visit to the Google office (I walked in front of [livejournal.com profile] ze_dinosaur's office, heh!) to figure out where we'd eat, we set our (metro) sails for Times Square. Wow! The people! The lights! At that point, I was glad I had my super-wide-angle lens, because this place is very big. Like, a lot. And there are people. And lights.

Dinner time being the time, we went to a Thai place not very far from their apartment, where we were joined by [livejournal.com profile] caffeinemonkey, for maximum classiness (first question to him: "was it you or mrwise who pooped in the shower?"). Had some pretty good garlic and pepper beef, with a good helping of wine (especially as I had uncovered a plot to get me drunk the following night!).

We went back and watched Kiss Kiss Bang Bang, which was quite hilarious. I had never even heard of it, but I definitely recommend it!

Good thing that we did some good walking yesterday, because this morning, the weather is pretty crappy (rainy).
pphaneuf: (Default)
Saturday, I attended BarCampMontreal3, which was quite fun. I figured that I should really practice my presentation skills, so Thursday, when I found out it was this Saturday (not the next one as I has thought!), I had to find something to talk about.

I figured there would be a lot of web developers in the audience, and having noticed that a lot of web application platforms tend to disable many HTTP features that helped the web scale to the level it has today, I thought I could share a few tips on how to avoid busting bandwidth caps, deliver a better user experience and overall try to avoid getting featured on uncov.

It was well received, mostly (see the slides), although it felt a bit like a university lecture for some (maybe the blackboard Keynote theme didn't help, and I was also one of the few with a strictly educational presentation that was also technical). Marc-André Cournoyer writes that just one simple trick visibly improved his loading time, so it's not just for those who get millions of visitors! Since at least one person thought that, I guess I should clarify or expand on a few things...

Read more... )
pphaneuf: (Default)
apenwarr: No kidding. Ohh, C++ is so complicated and messy... This is so much easier... Except... Yaaaarrrrghhhhh!

People, if Perl, of all bloody languages/runtimes can do it in a less complicated way (pure reference counting with weak references, deterministic finalization), you're doomed.

Perl. Simpler. Think about that.

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 Sep. 23rd, 2017 09:14 am
Powered by Dreamwidth Studios