Archive for January, 2010

Jan 22 2010

SilverDraw Library

Published by Mark under Programming

About a year ago I started work on a set of Silverlight libraries providing controls and classes that implement the primary features of a drawing application. Some of the results of that effort made their way into demos on this site, i.e. the ColorTools and GradientMaker demos. Eventually I also posted a partially complete demo of a drawing program, however not long after that I joined the J. Becker team, and have been heads down working with a small, creative group on some cool Silverlight media management stuff. The upshot of it all is that the drawing libraries, and the application they were designed to support, have been gathering dust.

This morning I received a request from Sweden for the source to GradientMaker, which I’m happy to share. I had previously released the source for the color controls in ColorTools, but the GradientEditor control hadn’t been added at that point. When I got around to implementing it I created a dependency on another small library which I hadn’t released, and so I put off adding the GradientEditor to what was publicly available. Prompted by this morning’s request I have whipped it all into shape and uploaded it to the site. See the download links at the end of the post.

The code is released under a new BSD license. In order to package it I ripped the projects for the two libraries out of the solution I created for the app last year, and placed them into a solution called SilverDraw. It’s a little aspirational at the moment, but I hope to add in some of the other drawing code I have written and release some updates to it soon. There is no documentation, but the code is pretty well-commented. If you have any questions feel free to email me.

Downloads: SilverDraw Assemblies, SilverDraw Source

No responses yet

Jan 19 2010

Still Lost

Published by Mark under Words and Writing

Ok, I admit I have been in the middle of a really unproductive cycle for the last couple of weeks. I’m not talking about work. I’m talking about the other 50% of my life, or more specifically the 50% of that 50% that is available for liesure, and which for some strange reason I can’t explain continues to be devoted in large part to watching old episodes of Lost. I can’t stop. I need help. There is no reason for me to be watching this show. Actually, I did have a sort of rational goal in mind, which was to catch up before the start of the final season. But I’m not sure I’ll make it.

Lost has a great premise, but a tough one to get a long run out of. Gilligan’s Island only made it for three seasons, and that feels like some sort of cosmic constant because I have just started in on Lost’s fourth season on Netflix and it’s just getting ridiculous. There must have been at least some members of the cast and crew looking at those scripts each week and thinking “what the hell?” So far my favorite example of how ludicrous it gets involves the “Looking Glass” underwater station.

First, and maybe funniest, is the moment when Sayid unfurls a blueprint of the station at the Beach Camp, and the title on the document is “Looking Glass Hatch.” Why is this hilariously stupid? The blueprint was created by Dharma, and is a document that pre-dated the castaways’ arrival. The castaways referred to these installations as “hatches” because the first thing Locke found was a metal hatch. The rooms below it then became known as the hatch, and the other rooms they found were by extension hatches. There’s no reason to think any of the original builders would have thought of an underwater habitat and lab as a “hatch” or labelled it that way on a blueprint.

Then there is the whole series of events leading up to Charlie’s checking out. If the Looking Glass station were the source of the jamming signals don’t you think that, before paddling out and trying to dive on it and get inside without SCUBA equipment, you might try, oh, I don’t know, cutting that fat cable leading down to it from the beach? Yes, there could be backup power. It might not work. But I would try it before I got wet, and so would any other rational person. As an aside, what builder sophisticated enough to create an underwater habitat and lab would just leave that cable lying on the damn beach?

Then we get to Charlie in the communications room, where he has just turned off the jamming signal. He knew he was supposed to drown there, and it looks like he has cheated fate. But wait! The Russian guy who got shot in the chest with a speargun is swimming outside the porthole, and he has a grenade! The grenade goes off, the porthole shatters, water is pouring in. What does Charlie do? Does he step through the door he is standing right next to and pull it shut after him? No, he closes it and locks himself in the room. Yea, I get to die!

This is just bad writing. It’s lazy writing. You could rewrite that entire sequence of events, preserve every ounce of drama and mystery, and have it all make sense from start to finish. But to do that you have to think about it, and maybe that’s a luxury television writers don’t have anymore. Or maybe the absurdity itself has some larger meta-purpose that I don’t get yet. I have no idea. But it’s hard to imagine people watching this stuff without laughing.

No responses yet

Jan 15 2010

Getting Lost

Published by Mark under Words and Writing

Given the title and what I often write about here, you might think this post is about either losing one’s way, or becoming hopelessly mired in the documentation for some arcane class library. It’s about neither of those things, nor is it concerned with any other variation on the theme of not knowing where you are. Rather, it’s about writing, and the title reflects that I got to thinking about writing while watching a billion episodes of ABC’s drama “Lost.” Well, perhaps not a billion. Anyway, let me explain.

I hardly watch television. I have an HDHomerun on our network and can get 120+ channels at my desktop, but frankly it’s 99% crap. Pick a channel at random and you have a 75% chance of hitting a commercial. Wait the commercial through and you have an 85% chance of finding yourself watching Cops. The remaining 15% of the time is split between informercials and a show on the “History Channel” entitled “Mega-awesome Disasters III: The Earth is Overwhelmed by Ice and then Explodes!” Most of the time I turn it on after work and fall asleep waiting for dinner to be ready.

So I missed the whole “Lost” phenomenon. I was aware of it like a distant cultural carrier-wave, but up until two weeks ago I hadn’t watched a single episode. Then my wife got a Netflix account and I discovered their on-demand streaming library and Windows 7 Media Center integration. If you have a job and responsibility do not sign up for this service. It should be a schedule II controlled substance. Once you start watching there is no reason to stop. An intervention will require physically removing you from your couch with a large putty knife. The service is fast, the quality of the video and audio excellent, and if the library isn’t massive yet, there is still enough to keep you supine for a year. It should be illegal.

One of the titles in the Netflix streaming library is all of “Lost.” I always wondered what the buzz was all about, so I decided to watch a few episodes. I’ve now watched about 35 of them, and will probably watch the remainder of Season 2, at least. But as I have watched it an interesting thing has happened: I’ve transitioned from watching to see where the story goes, to waiting for the next completely absurd plot twist to unfold so I can laugh and launch derisive comments at the monitor. What prompted me to write this post is not that I have been watching “Lost” devolve into a comedy of writing horror, but rather that it seems to me like so much writing these days has succumbed to the same fate.

Making a good story is very hard. I know because I keep trying and failing. Aside from all the other well-cataloged elements a good story requires, its events must be constructed on a foundation of plausibility. You have to get the little things right in order to make the world feel believable and real. Not to say that a good story cannot contain the incredible. The incredible and otherworldly make great story elements. But the incredible has to spring from the credible. When the big incredible thing happens, it has to happen in the context of a world that is wholly credible in all the small details. That’s what allows the reader to disregard reason and leap that small gap from the mundane to the wonderful.

The problem with “Lost” is that virtually nothing about it is plausible. It could have been. There’s no reason why it shouldn’t have been. The big incredible things that happen work very well. It’s just that they happen in a world that is itself absurd. It falls apart the minute you start to think about it. Yet the show is hugely popular and won an Emmy. It makes me wonder if most of the audience ever does think about it. Clearly some get it, and the evident absurdities and incongruities have even led fans to speculate that all the characters actually died on the plane and that they are in purgatory. I don’t think they are, but the viewers might be.

Start with the basic premise of the show. The writers needed to get a group of people into an exotic, isolated location without hope of rescue or recourse to any of the normal amenties of civilization. How did they choose to do that? They had an airliner break up at altitude and dump its three sections onto a mountainous island in the South Pacific, relatively intact and with a substantial number of living humans aboard. Every single aspect of this series of events is implausible in the extreme.

The pilots were on their way to Los Angeles from Sydney when they “lost all communication” and “turned back toward Fiji.” First, airliners don’t lose all communication unless they lose all power. The average airliner has something like four independent radios, as well as satellite communication with the fleet home office. Second, when an airliner breaks up at altitude at full cruise speed (the airliner in Lost was actually in a dive and would have been exceeding cruise speed) it doesn’t come down gently, or in very large pieces. People don’t live through that, or at least not often. There is one case I am aware of where a stewardess was tossed into the tail section of an aircraft after it was split by a bomb. The tail impacted on a forested slope and bounced to a stop and she lived, although very seriously injured. Everyone else on the aircraft was killed. In “Lost” some of the passengers are tossed into the water, some into the jungle, but at least 60-80 of them get up and walk away.

Yeah, right. Was that really the best the writers could come up with? There was no other way to get this group of people into the situation they wanted? I can think of at least three. “Lost” doesn’t really get any better after the passengers are deposited at the edge of the jungle and struggling to survive. One of my favorite chuckle-inducing scenes was when Sayid turns on a handheld VHF radio and exclaims breathlessly “We have a bar!” It’s as if all the writers are 20 year-olds who think every communications device works like an IPhone. Later he takes that same, single transceiver and by setting up some aluminum antennas in various places he uses that same, single transceiver to attempt to triangulate the position of a radio signal they intercepted. The producers should have hired some of the team that created MacGiver. At least some of the science would be sound.

The silliness just continues to multiply the longer you keep punching up that next episode, from hunting wild boar with a knife, to making use of dynamite that has been sitting in a humid jungle for 90 years. We don’t even have to get into the illogical, irrational way most of the characters behave. And yet I keep watching those episodes on Netflix, and from this and the series persistent popularity the writers might conclude that they have done a bang-up job. And so, from a business perspective, I guess they have. But in terms of quality there is quite a large difference between watching something out of appreciation for its merits, and watching something else out of the morbid fascination of witnessing a trainwreck.

No responses yet

Jan 14 2010

Stripping HTML Comments

Published by Mark under Programming

Over the last couple of days I was working on a system that generates HTML emails. The email content is created by loading and rendering ascx controls that perform the value substitutions into a template, and comments had been included in the templates describing what data items each email required. This morning I realized that the comments were being included in the email bodies, so that using ‘View Source’ would display them. Not a huge deal, but it would be better not to have them in there, so I went looking for a method to strip the HTML comments. Everything I found seemed more cumbersome than necessary, so I threw together this simple recursive method to remove HTML comments from a string. It’s naive with respect to the question “what is a comment in HTML?” For my purposes a comment is the text between the <!– and –> tags, and that’s it. Posting this in case someone finds it useful.

  1. private string StripHtmlComments(string html)
  2. {
  3. int open = html.IndexOf("<!--");
  4. if (open > -1)
  5. {
  6. int close = html.IndexOf("-->");
  7. if (close > open)
  8. {
  9. string newHtml = html.Remove(open, (close - open) + 3);
  10. return StripHtmlComments(newHtml);
  11. }
  12. else throw new FormatException("The input HTML contains mismatched comment tags");
  13. }
  14. else return html;
  15. }

No responses yet

3d home architect design suite deluxe 8 download . acd see download . acronis disk director suite 9.0 . acronis true image 10 . acronis true image home 2009 download . adobe acrobat 5 . adobe acrobat 6 download . adobe acrobat 7.0 pro download . adobe acrobat 7.0 professional . adobe acrobat 8 pro . adobe acrobat 8 professional download . adobe acrobat 8 standard . adobe acrobat 8.0 professional download . adobe acrobat 9 download . adobe acrobat 9 pro extended download . adobe acrobat reader 5 . adobe acrobat reader 8 download . adobe after effects 7.0 . adobe after effects cs3 professional . adobe after effects cs4 . adobe after effects download . adobe captivate 3 . adobe contribute cs4 download . adobe creative suite 3 design premium . adobe creative suite 4 . adobe creative suite 4 design premium download . adobe creative suite 4 master collection download . adobe creative suite 4 master collection mac . adobe cs2 master collection . adobe cs3 design premium . adobe cs4 design premium . adobe cs4 download . adobe cs4 master collection download . adobe cs4 master collection mac . adobe cs4 web premium . adobe dreamweaver 8 . adobe dreamweaver cs2 download . adobe dreamweaver cs3 . adobe dreamweaver cs4 download . adobe fireworks cs3 . adobe flash 9 . adobe flash cs2 . adobe flash cs4 professional . adobe flash cs4 professional mac . adobe illustrator cs2 . adobe illustrator cs4 mac download . adobe indesign 2.0 . adobe indesign cs4 download . adobe photoshop 12 download . adobe photoshop 6 . adobe photoshop cs . adobe photoshop cs2 download . adobe photoshop cs3 download . adobe photoshop cs3 extended . adobe photoshop cs4 extended . adobe photoshop cs4 extended mac . adobe premiere 6.5 download . adobe premiere pro cs3 . adobe premiere pro cs4 download . adobe presenter 7 download . apple final cut express 5 download . autodesk 3ds max . autodesk 3ds max 2010 . autodesk autocad 2007 . autodesk autocad 2008 . autodesk autocad 2010 download . autodesk autocad architecture 2009 download . autodesk autocad electrical 2010 download . autodesk autocad inventor lt 2010 . autodesk autocad inventor professional suite 2010 (32 bit) . autodesk autocad inventor professional suite 2010 (64 bit) . autodesk autocad mechanical 2010 . autodesk autosketch 9 . autodesk inventor 2008 . autodesk inventor professional 2009 download . avid media composer 2.8 download . cakewalk sonar 7 producer edition . corel painter 10 . corel painter x download . corel photoimpact x3 download . corel video studio pro x2 download . download 2003 microsoft office . download acronis disk director suite 10 . download adobe acrobat 6.0 professional . download adobe acrobat pro . download adobe acrobat reader 6 . download adobe captivate 2 . download adobe contribute 3 . download adobe creative suite 3 . download adobe cs3 . download adobe cs3 master collection . download adobe cs3 master collection mac . download adobe dreamweaver cs4 mac . download adobe fireworks cs4 . download adobe flash 8 . download adobe flash cs3 professional . download adobe flash cs3 professional mac . download adobe illustrator 9.0 . download adobe illustrator cs3 . download adobe illustrator cs4 . download adobe indesign 4 . download adobe indesign cs . download adobe indesign cs3 . download adobe photoshop 7 . download adobe photoshop 7.0 . download adobe premiere 2.0 . download apple final cut express 4 mac . download apple final cut studio . download autodesk 3d studio max 2009 . download autodesk 3d studio max design 2009 . download autodesk autocad 2009 . download autodesk autocad architecture 2010 . download autodesk mudbox 2009 . download corel draw 11 mac . download corel dvd copy 6 plus . download corel video studio 12 . download dreamweaver 4 . download dreamweaver cs2 . download dreamweaver cs3 . download dreamweaver cs4 . download dreamweaver mx 2004 . download intuit quickbooks 2009 premier . download mcafee total protection 2009 . download microsoft autoroute 2007 europe . download microsoft frontpage 2002 . download microsoft money 2004 . download microsoft money 2007 . download microsoft money 2008 . download microsoft money plus 2008 . download microsoft office 2003 professional . download microsoft office 2004 for mac . download microsoft office 2008 for mac . download microsoft office 2008 mac . download microsoft office 97 . download microsoft office enterprise 2007 . download microsoft office for mac . download microsoft office visio professional 2003 . download microsoft office xp . download microsoft streets and trips 2009 . download microsoft windows vista business (64bit) . download microsoft windows vista home basic with sp2 (32 bit) . download microsoft windows vista home premium with sp2 (32 bit) . download microsoft windows vista home premium with sp2 (64 bit) . download microsoft windows vista ultimate (64bit) . download microsoft works 4.5 . download nero 10 . download nero 2009 . download nero 8 ultra edition . download nero burn . download parallels desktop 4.0 for mac . download pctools spyware doctor 5.5 . download quarkxpress 8 . download roxio creator 2009 ultimate . download roxio creator plus . download sony vegas pro 8 . download steinberg nuendo 3 . download symantec winfax pro 10.0 . download vmware workstation 6.5 ace . download vmware workstation 7 . download window xp professional . download windows 7 release . download windows office xp . download windows vista 64 bit . download windows vista ultimate . download windows xp pro sp2 . download windows xp sp1 . download xilisoft video converter ultimate 5.1 . graphisoft archicad 12 . guitar pro 5 mac download . guitar pro 6 . i.r.i.s. readiris pro 11 download . intuit quicken rental property manager 2009 . macromedia dreamweaver . mathworks matlab r2008a . microsoft autoroute 2008 download . microsoft autoroute europe 2009 download . microsoft autoroute express download . microsoft digital image suite 2006 download . microsoft encarta premium 2007 . microsoft encarta premium 2009 . microsoft frontpage 2.0 . microsoft frontpage 2003 download . microsoft frontpage 2007 . microsoft mappoint 2009 north america download . microsoft money 2005 . microsoft money 2007 home & business . microsoft money 2009 . microsoft money plus download . microsoft money premium . microsoft office 2000 download . microsoft office 2002 . microsoft office 2003 enterprise