Google Chrome ….

Google’s running their own ads? :)  (An Ad from Google that appeared on my web site in the past few days).

image

Also, if you’d like to read the whole Google Chrome comic, it’s available from Google here. There are some PDFs as well floating around, but they’re not higher quality (in terms of resolution).

C# Extension methods and strings …

Thomas posted an interesting experiment regarding the use of extension methods on strings. He noticed that it’s possible to add an extension method to a string, and that it’s still called even when the string object is null. Given that it’s just syntactic sugar, it makes perfect sense, but it’s so odd to see code like this:

image

I wouldn’t use this as it just feels wrong to call a method on an object that is null. But, it’s a nifty trick (and something you should watch out for in your extension methods!).

Coding Challenge #21

Coding Challenge Series / Technical Interview Series

Create a function which copies byte data from a source location to a destination location (you might use pointers or an array depending on the programming language). The function must copy using this pattern: 8 bytes, skip 8 bytes, 4 bytes, skip 8 bytes, 8 bytes, … repeat (+8,-8,+4,-8….).

Bonus points for really nailing the performance of this one.

 

(Are you enjoying this series? I’d appreciate a comment if you’d like me to continue the series. It takes more time than I’d like to admit to create and post these entries every week.)

Moral Challenge #1

OK, this won’t be a series, but I asked my wife the following question on the way home from work tonight … I’m curious to see what your response is to the same question:

If next week, you could receive a check in the amount of 10 times your annual salary, with only a single condition, would you? The only condition: three of your coworkers, who you are good friends with, will loose their jobs within 2 weeks if you accept the money offer (and they will know you took the money).

Do you accept the money? (If you try to be sneaky with my wording, don’t bother. That takes the punch out of the moral dilemma.)

(And if you were thinking about giving some of the money to your coworkers — many countries have established laws about the amount of money you can give to another person without serious tax complications — for the purposes of this challenge, assume you can’t give them any of this money).

Google Chrome … it’s here (for Windows)

Downloaded and installed … it’s fast (and one of the easiest installs I’ve seen for any application. Kudos to Google for bucking the trend of awful application installers).

image 

The maximized mode is particularly clean — it doesn’t use a Windows title bar at all – so the first browser tab is the element in the upper left corner of the screen.

As described in the Chrome comic, it is using a process for every tab:

image

It would be nice if I could easily tell which browser tab was represented by each process (for memory analysis). I randomly killed one of the processes. When I clicked on the browser tabs, Chrome displayed this in the place of the tab’s content that I had killed:

image

(Aw, Snap! Something went wrong while displaying this webpage. To continue, press Reload or go to another page.)

:)

Chrome is available for XP/Vista only for now and may be downloaded here.

 

Update: about:memory in the address bar of Chrome takes you to the “stats for nerds”:

image

Or you can right click on the task bar icon, select Task Manager, and click the “Stats for Nerds” link at the bottom of the dialog:

image