February 2005 - Posts - Jon Galloway

February 2005 - Posts

[OT] Animated short film - Ryan

No way for this meme to become tired. You will need time and bandwidth to see these animated shorts.

I have been hearing a lot of buzz about “Ryan,” and unable to find it online, until now.

[Source: Oscar Nominated Animated Shorts - SINGLE-EYE-TWILIGHT]

Here's a direct link to Ryan (Window Media 300kbps). It's 10 minutes and pretty interesting in my opinion. A nice counterpoint to Pooh's Heffalump Movie , which we saw this evening as well.

And while I'm at it, please help Save Toby!

Posted by Jon Galloway | with no comments
Filed under:

[firefox] Pass on the 1.0.1 release

Mozilla Foundation Announces Update to Firefox - 1.0.1 is out for you Firefox users.
[Source: The Daily Grind 567]

Firefox 1.0.1 is out, but I don't recommend installing it. Wait for the automatic update when 1.0.2 comes out in a week or so.

I upgraded from 1.0 to 1.0.1 and got repeated crashes. Checked out MozillaZine and found a few threads that said to uninstall 1.0 first, but that didn't fix it for me. Others said to just wait, which is what I'll be doing.

I uninstalled all versions, then installed Firefox 1.0. Working great again.

[tip] Knoppix cheat code for Virtual PC Video

Summary
Enter this "cheat code" at the initial startup prompt when using Knoppix based Linux Live CD's under Virtual PC:
knoppix xserver=XFree86 xmodule=s3 depth= 16

Long Version
Knoppix video drivers default to 24 bit color depth, and Virtual PC's emulated S3 Trio video adapter only goes up to 16 bit color depth. As a result, running Knoppix under VPC drops back to 256 color mode. This wouldn't be much of a problem with plain Linux since you can configure your display and reboot, but reboots with a Live CD forget all changes and you're back to square one.

This applies to Knoppix variants like Monoppix (Knoppix with Mono - give it a try!) as well.

You can get by with an ugly 256 color display for some programs (like Konsole and Konqueror), but many are completely unusable (Monodevelop and Mozilla, for instance).  I'm guessing the KDE elements were designed for 256 colors, while Gnome / GTK apps require higher color depth, but that's just speculation.

This video problem has been known to reduce grown men like Stefano to tears (if we judge from the emoticon, he's still distraught about it to this day!):

This is the moment to cry... Monodevelop is totally unreadable and unusable under VPC (as you can see on the image ).

Weep no more, Stefano! I finally came up with the Knoppix "cheat code" to set the color depth correctly under VPC:

knoppix xserver=XFree86 xmodule=s3 depth= 16

[ASP.NET] Scaleout Server - Distributed in-memory ASP.NET session state

Most server-farm applications store fast-changing workload data, such as ASP.NET session-state, in a centralized, back-end database. A new software product, called ScaleOut StateServer , improves performance by hosting session-state directly on the farm using distributed, in-memory storage.

Source: Scalable Session-State Storage for ASP.NET Server Farms Released - TheServerSide.NET

Saw this a few weeks ago on TheServerSide.NET and keep forgetting to post on it.

This is a really cool solution to managing ASP.NET session state in a load balanced environment. ASP.NET offers three session state options out of the box, but they all have problems when you're load balanced:

  • InProc - Doesn't work when load balanced since state is not shared between webservers
  • ASP.NET StateServer - Single point of failure, requires round trips to the state server for every page hit[1]
  • SQL Server Session State - Still a single point of failure unless you're clustered, requires an extra database hit for every page hit[1], can cause database locking (MSKB 843400, which I've experienced first hand)

Or, as the ScaleOut StateServer site site tells it:

We went through some hoops with this on a recent project - We used SQL Server State, which pained me because we'd removed most of the database hits through aggressive caching and had to add per-page database hits for session state lookup. Then we ran into locking issues and ended up dropping back to InProc with sticky bit until we are able to test the hotfix for the locking problems.

The ScaleOut StateServer 's solution is really slick:

To save and restore session-state, ScaleOut StateServer extends ASP.NET’s InProc mode for the sessionState attribute. Do not confuse this setting with the alternative StateServer mode, which is designed for use with Microsoft’s built-in, single host, session-state server.

So as far as ASP.NET knows, it's just using InProc session state. Behind the scenes, though, Scaleout Server is syncing states across UDP with two other webservers in the farm. It's scalable, since it only keeps three copies of a session's state regardless of the number of servers in the farm (up to 64, they say). Their support information shows that they're hooking into ASP.NET with an Http Module.

The obligatory purty pictures:

With SQL Server Session StateWith ScaleOut

Disclosures: 
No, I haven't had a chance to try it out yet, although they do offer a free 30 day demo so you can try it out for me.
No, I don't have any affiliation with ScaleOut and don't get anything for talking them up.

[1] I've heard rumors that unnecessary lookups are avoided if subsequent hits go to the same server, although I haven't verified this.

Posted by Jon Galloway | 3 comment(s)
Filed under: ,

[code] ASP.NET Busy Box 1.2 (Processing... Please Wait)

Summary: We often need to provide a user message informing the user that their request is “processing”.  Like the hour-glass mouse pointer lets the Windows user know the system is busy processing their last request, I have a simple, clean, and effect solution to providing this on web pages.

BusyBox Demo
http://blogs.crsw.com/mark/samples/BusyBoxDemo/Default.aspx

[via  Building a Better Busy Box (Processing… Please Wait) - Ver 1.2]

Check out the demo - very nice eye-candy to entertain your user while running long running operations like file uploads, webservice calls, etc. [update: failed humor attempt removed]

Posted by Jon Galloway | 8 comment(s)
Filed under:

[code] How to create a splash screen for your application

Cool code from David Kean to add a professional looking Splash Screen for a .NET Winform app:
How to create a splash screen for your application

(yes, the orange color in his screenshot can be replaced with any bitmap you'd like)

Posted by Jon Galloway | with no comments
Filed under:

Favorite .NET linkblogs

When work or family interfere with my information addiction (I'm up to 1594 RSS feeds now [update: see comment below]), I rely on a crack team of linkbloggers to keep me caught up until I can slog through the thousands of unread posts:
http://www.larkware.com/
http://coolthingoftheday.blogspot.com
http://odetocode.com/Blogs/otcnews/
http://www.hanselman.com/blog/ (not technically a linkblog, but he usually catches all the best stuff)
[update: http://www.theserverside.net/rss/index.tss is also pretty helpful, although I don't read it daily if I'm short on time]
 

(Man, do I miss Kent's Takeouts!)

There's no way I can keep up with Scoble's linkblog AND my other feeds. Just way too much? Hey, Mr. Scoble, how about a Linkblog Lite (daily or weekly summary of the top 5 or 10 links)?

Did I miss any?

Posted by Jon Galloway | with no comments
Filed under:

A term for those cool new Google Apps: Ajax

Darren points to a cool article from Adaptive Path that gives a new term for the cool apps Google has been building lately: Ajax (Asynchronous Javascript and XML).

Sure, XMLHTTP async calls are something web developers have been doing for a while, but Google's "iPodded it"[1]. I'm looking forward to those Client Callbacks in Whidbey, especially if the Javascript is cross-browser.

Some cool graphics to tempt you over to the Adaptive Path article:

Adaptive Path has an  rss feed available, highly recommended:


[1] Oh, am I getting into the term coining excitement? Looks that way:
iPodd(ed) v: to leverage existing credibility and slick design to popularize an existing technology.

[link] CSS Based Dropdown Menus (updated)

Scott's articleAn Easier Way to Highlight the Rows of a DataGrid on MouseOver included a link to an old ALA article on the Suckerfish Dropdown [updated] - see the improved Son of Suckerfish Dropdown!

What I like about it:
CSS only approach for browsers with good CSS support. There's a small Javascript fix for CSS challenged browsers (i.e. IE), but it's very light. The Son of Suckerfish code uses only 12 lines of Javascript and supports all current browsers! I like this rather than a heavy DHTML solution because it's lightweight and the is built for forward compatibility with browsers that support CSS rather than browser specific Javascript hacks. The menu.js code for the Whidbey menu control, for instance, is

Sample:
http://www.htmldog.com/articles/suckerfish/example/
http://www.htmldog.com/articles/suckerfish/dropdowns/example/

Article / Code:
http://www.alistapart.com/articles/dropdowns/
http://www.htmldog.com/articles/suckerfish/dropdowns/

Joel got it wrong - Why learning C is a waste of your college time and money

Back in January, Joel Spoelsky wrote a  Career Advice column. It gave some generally good advice to college students, the main points being:

  1. Learn how to write before graduating.
  2. Learn C before graduating.
  3. Learn microeconomics before graduating.
  4. Don't blow off non-CS classes just because they're boring.
  5. Take programming-intensive courses.
  6. Stop worrying about all the jobs going to India.
  7. No matter what you do, get a good summer internship.

[update: note that Joel's advice is to college students in general, not just to computer science majors]

I agreed with everything but (2). I believe learning C before graduating may help some, but hurt just as many. While it might have helped Joel, I don't think it's universally good advice. It's been bugging me for a month now, so it's time to get it in writing. In the interest of hopefully getting comments from someone other than my pals at www.online-cheap-meds-4u.ru and www.poker-gambling-casino.net , I aim for the nearest windmill and present:

Jon's 6 reasons why learing C is a waste of your college time and money:

  1. It's not a skill you'll use in most of the software development jobs you'd want to have
  2. It can give you a false sense of control
  3. It can teach you to get in the way
  4. It can make it hard for you to love famework based development
  5. It can teach you philosophies which will prevent you from really understanding modern programming
  6. It can divert you from the real challenges of software engineering

1. It's not a skill you'll use in most of the software development jobs you'd want to have

 

Without trying to offend anyone who's into this kind of stuff (weirdos!), here are the kind of things you might use C for these days - writing some kind of device driver, maintaining extremely old applications, embeded development on very limited hardware, or maybe writing an operating system or compiler or something. I guess you could like hack away on the Linux (or is that GNU-Linux) kernel.

Hey, if that sounds fun then off to the races. Consider this though - you're not really going to be solving any new problems. If you want to do web development, database development, desktop applications - you know, stuff you can talk about at a party - you're probably not going to be working in C.

 

2. It can give you a false sense of control

 

Quote from Joel's article:

I don't care how much you know about continuations and closures and exception handling: if you can't explain why while (*s++ = *t++); copies a string, or if that isn't the most natural thing in the world to you, well, you're programming based on superstition, as far as I'm concerned: a medical doctor who doesn't know basic anatomy, passing out prescriptions based on what the pharma sales babe said would work.

That sounds good on the surface, but does his code sample really tell you how the string is being copied? It's a symbolic representation of a process which is moving memory, sure, but still several levels of abstraction away from shuttling the bits through memory. Why is this the magic level of abstraction that gives you the edge? Why not assembler?

Worse still is that it can make you think that programming is about telling the computer what to do with its registers and memory. Oops, wait, that memory was magically paged from disk without your knowlege. The compiler applied some optimizations behind your back. Your code is running on top of an operating system, which is rationing out the CPU cycles between tens of processes, and yours gets a measly 10% timeslice. And, hey, what CPU are you on? Any sneaky little tricks going on with your 64 bit hyperthreaded chip? What about two years from now, when you run your app on a virtual server on a multicore chip?

Thinking that you're in the pilot's seat because you're handling pointers is silly. Better to understand that you're asking the CPU(s), through multiple levels of abstraction, to copy a string. Do it politely - this ain't no rowboat anymore, it's a durned space ship.

 

3. It can teach you to get in the way

 

That false sense of control I mentioned before can lead to outsmarting yourself. Some examples:

  • Trying to pool database connections or holding a global connection, not knowing that the data layer is automatically pooling if you let it
  • Overriding the .NET Garbage Collector, assuming that Java / Micro$oft doesn't know how to manage memory nearly as well as you can

In both these cases, a little bit of knowledge is (as rumored) a dangerous thing. If all you learned from C is that you are the boss, you will most certainly write code that plays poorly with others.

4. It can make it hard for you to love framework based development

Moderns programming languages run on top of frameworks. .NET apps use the .NET framework, Java uses J2EE (et. al.), and arguably web apps run on top of a browser / communication communication that constitutes an application framework. The list could go on (GTK, XUL, web service, Flash). Most good frameworks are standards based, and all of them host your solutions so you only solve new problems.

C code, by and large, is not about frameworks. At its best, it uses some libraries and links to some API's. C gives you a toolset that can solve just about any problem, but requires that you solve each and every problem every time. Frameworks were created to obviate solving the same problems in each program you write. Software development has made a steady progression from code to libraries to components to frameworks. Thankfully, you don't need to retrace this path just as you don't need to experience the dark ages to live in the post-renaissance world.

To be productive as a programmer these days, you either need to be learning to get the most out of existing frameworks or helping to build tomorrow's frameworks. To learn to be a productive programmer, you need to learn how to work with frameworks.

Learning to work with a framework takes work. You need to learn research skills that go far beyond fixing syntax errors. You need to learn how to optimally integrate with our environment, what the environment will provide for you, and what's expected of you.

Thankfully, learning to work with a framework is a transferable skill, so the exact framework doesn't matter so much as that you learn how to use a framework - pick an environment and get going.

5. It can teach you philosophies which will prevent you from really understanding modern programming

 

C code is procedural. That means you describe an exact set of steps you want your program to accomplish. If you want to find a value in an array, you write code that loops through each element in the array - a house to house search.

Modern programming is often declarative, meaning that you describe what you want and thing else decides the best way to get it. Databases, for instance, respond to "Queries" - a request for information in a descriptive language. The database maintains indexes to find the data without looking at every line, and the good databases self-optimize based on the questions they're asked most often. To continue the analogy from before, we replace the house to house search with a 411 call. Cursors in database queries are just about always a failure on the programmer's part to describe the problem rather than limitations of the database engines.

A surprising amount of work in current software is described rather than prescribed. HTML, for instance is a markup language that describes content and layout to a browser, which does the hard work of wrapping text, applying styles and enforcing user-defined security settings. XPath and regular expressions some more current technologies which implement declarative programming.

The point here is that modern programming is moving towards Domain Specific Languages (DSL's) which efficiently communicate programmer intent to CPU cycles. C is not a good prototype for any of these DSL's.

6. It can divert you from the real challenges of software engineering

There is significant work to be done today in software engineering that requires fresh, energetic minds. Some examples:

  • We are on the verge of ubiquitous AI - self organizing systems (software and hardware) that will collaboratively solve problems for us. We're still figuring out how to manage them.
  • We've got a lot of disparate systems that still don't communicate well.
  • We are being bombarded by more information than we can currently process. Fixing the U.S. intelligence system to the point that pre-9/11 dots could have been connected requires storage and analysis of 36 Terrabytes per week ongoing (quote from recent IT Conversations - Accelerating Change audiocast). RSS and e-mail volume continue to grow.
  • Computer users need both security and privacy. Neither is relible today.
  • Our current methodologies routinely result in failed projects. (Examples - recent failed $170B FBI project, Mars mission software errors, etc.)
  • Bob in accounting needs a report on recent payment orders to office supply companies, but the data is stored in Excel files on Mary's desktop. Mary is on vacation.
  • Walt in IT just gave two weeks notice. He justtold you that he's been managing several daily FTP transfers of critical company data. He manually inserts into the production database using some scripts his roommate helped him figure out.
  • Marketing promised product X by June. Management budgeted for product .25X by June 2025. You are the developer for product X.
  • Etc.

The point is, today's software development environment is dynamic, evolving, and extremely challenging. If you're going to be of help, you need to do something more productive with your time than learn a 20 year old language. There's plenty to learn - if you're going to take one computer class, make it HTML, Java, C#, VB, SQL, XML, Javascript... anything but C! I've personally interviewed over 100 people for programming positions. I would personally take skills in any of the above technologies over C in my hiring decisions.

Epilogue

In the movie Real Women Have Curves, the main character is a Mexican American girl who's been offered a full scholarship to Columbia. Her mother won't let her accept, giving some bogus reasons about needing to stay near her family. When her father challenges it, she tells him the real reason: she's had to work in a sweatshop her whole life to provide for the family, and there's no way her daughter is going to skate from school to college to the easy life without some time in the sweatshops. It's her turn to work.

When an experienced programmer tells you to learn C nowdays, they're either trying to apply their out of context life experiences to yours, or they're trying to throw you in the sweatshop because that's what they had to do.

There's plenty to learn in computer science circa 2005. Don't waste your time on history unless you want to be a historian.

More Posts Next page »