/* BeejBlog */

Richard Feynman (Nobel Physicist, 1918 - 1988)

Richard_Feynman

Just kinda catching up with how “fun smart” this guy was… worked on the Manhattan project, all kinds of creative physics problem solving, “Original Prophet of Nanotechnology”, Nobel prize in Physics 1965, liked strip clubs, art and bongo drums… there are at least two semi-auto biographies out there in public circulation… I’m reading “Surely You’re Joking, Mr. Feynman!” right now… also a few enjoyable BBC Horizon videos featuring a fair amount of direct interview content: “The Pleasure of Finding Things Out (1981)”, “The Quest for Tannu Tuva (1988)” and “No Ordinary Genius (1993)

My first real WPF exposure

Having a fairly “good time” getting up to speed on a WPF based app for my day job.

Highlights:

  • Coming from ASP.Net the last few years it’s nice to see so much similarity and convergence in how one thinks about building GUI’s in the two environments… specifically TEMPLATE based UI’ing in XAML… if you’re an ASP.Net head, think of a Repeater and how you can customize exactly what you want each row to look like via the ItemTemplate… WPF is like that on steroids… the template stuff gets pretty deep and thick pretty fast and i don’t ‘get it’ all just yet… but it’s coming as I go along looking for examples out in the wild for what I know can be done.
  • Laying out a UI in XAML as if it was HTML feels very intuitive… nesting element tags within tags, setting margins for pixel perfect whitespace aesthetics, using the various free flow containers that automatically stretch to fill in the size of the current window is all grand to see finally available over in Windows land.
  • Speaking of the free flowing UI… this can’t be understated… everything is finally geared towards this kind of layout… you actually have to work at it to “hard code” elements at a specific X,Y position… using the various panels Stack, Wrap, Dock, ‘Grid’ just makes sense after whipping up Web UI’s for years… very good stuff
  • The templating really opens up the guts of all the stock WPF controls to extensive tinkering way beyond any Microsoft based GUI building framework we’ve had to date… there are tons of annoying esoteric gotchas to be found in how all the little pieces of the stock controls hang together but one can rest with confidence that if you take the time to dissect, you will be able to force it to do whatever you want… there are tools like “snoop” which give you a full tree breakdown of a running UI’s widget hierarchy… then starting with a known element reference you can walk up or down the widget hierarchy in code to dial in on exactly which chunk needs to be tweaked.
  • The amount of flexibility in the syntax for databinding to various objects is mind boggling… binding to your own custom business objects is well covered… but also binding to .Net framework and UI elements is just as possible if the situation demands… I’m sticking with DataTable/DataView binding via thin BO property wrappers for now versus maintaining a BO property per field… i really abhor a full blown OO business object layer, especially if I have control over the database like in this situation.
  • This is a good example of h0w “elegantly” all of the current .Net stuff hangs together… targeting a specific WPF DataGrid column via Linq lambda function:

    static public void GridSort(DataGrid Grid, string ColumnName, ListSortDirection Direction)
    {
      Grid.Columns.Where(c => c.SortMemberPath == ColumnName).Single().SortDirection = Direction;
    }

Nailing the Google ad model

Excellent article in Nov.2009 Wired about how Demand Media algorithmically nailed the keyword-search-to-primo-ad-space game: “The Answer Factory

Scott Hanselman's 2009 Ultimate Developer and Power Users Tool List for Windows

Scott Hanselman's 2009 Ultimate Developer and Power Users Tool List for Windows

Just too dang good to relegate to a simple Delicious bookmark !

1.8” ZIF HD/SSD & SD/SDHC Notes

1.8” HD (My Samsung Q1U takes a ZIF connector)

  • My current current Toshiba 60GB (MK6008GAH) – starts out at an unremarkable 22MB/s reads for small files and dwindles down to 10MB/s for large files; Random access = 19.1ms; capped by the 100MB/s PATA interface that it’s not even coming close to touching… i wonder if this is all to blame on the tablet’s low end hardware…
  • Toshiba makes a 240GB (MK2431GAH) but it’s not PC boot compatible
  • Next one down that seems to be PC compatible is the 120GB MK1214GAH, $90 @ eBay
  • I don’t get it, i can’t find any numbers on actual transfer rates for these drives… everywhere just quotes the PATA interface rate (100MB/s)
  • Very decent looking 1.8” enclosure (and soft pouch) with ZIF to USB interface for dirt on eBay ($2.42 + $7.00 shipping)

SSD

  • 128GB = ~$400 eBay – KingSpec = 67MB/s reads, 51MB/s writes
  • 64GB = ~$200  eBay - KingSpec

SD

  • Currently have a Transcend 16GB Class 6 - flat 16MB/s across the board reads; 1.2ms random access
  • Folks are definitely running 32GB capacity SDHC’s in the Q1U
  • Fastest 32GB SDHC is “SanDisc Extreme III” 30MB/s reads (“Class 10”), Amazon = $190 (this one makes no sense at all… totally overshadowed by 64GB SSD size & speed for that price)
  • Next fastest 32GB SDHC “SanDisc Ultra II” 15MB/s reads (Class 6), NewEgg = $88 (and this doesn’t make much sense either, might as well just get the $90 120GB Toshiba HD)

Yet Another Simple Audit Table Approach (YASATA :)

Feedback Update #1 [2009-11-15]:

  • Two different vectors of peer feedback highlight my myopia for sending all the audit data to a single table… and yes, why the heck i felt comfortable cramming disparate data into one table in the first place seems very bonehead :)  having mirror copies of each table where the audit data resides seems much more KISS… and i figure i better scramble my design in that direction before anybody really gets cranking on this new system
  • Another point of feedback is SQL Server 2008’s “Change Data Control” (CDC) facility… i wasn’t actively tracking on this and it’ll be great to head towards… the author even suggests that there is some support for this in SQL Server 2005… given the basic approach, coding something ourselves doesn’t seem that tough… it’s probably stuff like the built-in automatic schema change handling in 2008 that we’d be missing in 2005.

Highlights/Assumptions/Considerations [2009-11-05]:

  • SQL Server - there’s probably some SQL Server (2005) dependencies in here … As far as developer oriented databases go, I friggin LUUUV the way one can make SQL Server dance, especially as of version 2005… XML datatype, VARCHAR(max), .Net stored procs, funcs and aggregates… man this is the life!! :)
  • Stored Procedures – i can’t think of any reason why this approach would be stored proc dependent but if it is, i’m glad…  i love procs… i’m one of those guys that would really love to sit down with you (and a couple pints ;) and discuss the merits of coding business logic in stored procs… yep i said it… i’d even go so far to say that stored procs can be your true one and only business layer <gasp!! ;>
  • ADO.Net – this writeup also sorta assumes that you’re implementing in ADO.Net (because of the connection string specifics)
  • Custom Datalayer – I’ve implemented this technique as a graft onto my existing custom datalayer (it’s got one class, can you guess what it’s called? ;)  That code is included below… it’s very bare bones… which I think is a good thing, so that you can take and repurpose how you like.
  • SqlDataSource Compatibility – after i got it all working i realized that i’d dabbled a little with using SqlDataSources in this project as well as my own custom datalayer… i’m happy to report it was a very quick mod to bring them into the program.
  • Single Standard PK Column Name – i generally data model with a GUID PK on all my primary “business” entities and an INT PK on Code Tables… so my code takes advantage of knowing that there’s going to be a column named {Table}ID on every table… the main place this plays in is joining INSERTED & DELETED together in the Audit_Triggers
  • ** UserName Context – logging the UserName that is performing a given data update to the Audit table is accomplished via a little trick i’ve been meaning to explore for quite some (and it seems to work! :)… given the usual web/database constraints i run into, it makes the most sense to have a single database login from the web app… therefore, establishing the UserName context is a bit of a challenge… the trick is to have your datalayer tack on the current username via the connection string parameter “Workstation ID”… and then retrieving it in T-SQL via the HOST_NAME() function… yep that’s a bit of a hack :)  but for my purposes i think it fits ok…
    • connection pooling was the first consideration that struck me… from what i understand, pooling is based on each unique connection string, so yes this probably negates the benefits of a larger shared pool of connections… this is something to keep in mind if you plan on having a lot of concurrent users firing auditable queries…
    • one immediate optimization would be to make sure only update procs specify the Workstation ID so that all the read queries would run full bore on the whole pool.
  • Triggers – i went ahead and based this approach on triggers… I’ve sorta grown up to despise triggers because they can trip you up just when you start to forget about them… one example is when you want to perform bulk data loads and really would prefer not to execute the trigger logic… in this case since the triggers are code gen’d i’ll have an easy script to drop/re-create and I plan on wrapping that in an on/off proc to make it as convenient as possible… I’m just going to have to keep an eye on how annoying they get over time within the scope of maintaining the application where i’ve applied this technique… one mitigation would be to fall back to moving the audit logic directly into the update procs… in that case it still seems fairly straightforward to code gen an equivalent approach to triggers’ “inserted/deleted” pseudo tables since i tend to code procs as either upserts or deletes which gives good context to tee off of.
    • Audit_Trigger_CodeGen – once i got the T-SQL banged out of one trigger it was easy to turn it into a dyn-sql loop that generates the necessary triggers for all the tables in your database… that code is included below as well.
  • Changes only – from reading the forums it seems like most folks are like me in that they’re interested in seeing the changes specifically and not just a raw dump of all the old and new data where an update has been applied… most of the wonky responders say something like, “you should be logging all of it so you have it all for other purposes and then you can write a routine that displays only the changes”… ok yes, but then the person is still asking the same questions, where’s the code/technique to filter out just the changes, because that’s all i want to see right now… well, my code only logs the changes… i did that because i thought about it for 2 nanosecs and i didn’t like the idea of writing something that would be scanning every row to show me what i really wanted… plus it does seem like this data could add up… yeah yeah, drives are cheap these days so we can all throw data storage considerations to the wind! right… but maybe your organization isn’t standing at the ready, waiting to toss you some more drive space the moment you raise your hand.
  • Exceptions to the rule – of course i quickly ran into a couple situations where a simple audit trigger just wasn’t going to do the trick… in these exceptional cases it strikes me as very reasonable to exclude those particular tables from the Audit_Trigger_CodeGen and code the custom auditing directly into the update procs… you can log it all in the same Audit table so i think the approach still holds together nicely from a consistency standpoint.
  • Automatic Schema Change Awareness – The HashBytes() T-SQL function is used to store the column signature that existed when the Audit_Trigger_CodeGen was last run … there’s a little subroutine proc that checks to see whether this hash is the same and refreshes the table’s trigger definition accordingly… if you’re really worried about runaway columns then throw a call to this checker proc at the beginning of all your update procs … currently i’m just keeping this off to the side and running a refresh when i know i’ve added a new column so i don’t have that nagging feeling that i’m zapping some nano-secs of performance for no good reason.
  • So yes, lots of assumptions and caveats but not too shabby when it honestly came together in just 1.5 days of dedicated coding.

Teaser screen shots:

image image

Code Attachments:

  • First off, i’m rolling with “Google Docs” here until i find something better, they don’t support certain filetypes like .cs, so save-as accordingly
  • Secondly, if Google Docs prompts you for a login and you don’t feel like creating an account, just change the URL to HTTPS and refresh… after that it will create the appropriate cookie and HTTP links will work… yep it’s a known bug
  • DataLayer.cs – the greatest Proc class ever writen ;)
  • ReflectionHelpers.cs (referenced in DataLayer.cs so you’ll want it)
  • Audit_Trigger_Checker.sql – the HashBytes() stuff
  • Audit_Trigger_CodeGen.sql – here’s the beef
  • SqlDataSource_snippet.cs.sql – how to slap in SqlDataSources w/o much effort
  • Audit Table:

    CREATE TABLE [Audit](
        [TableName] [varchar](50) NOT NULL,
        [DateStamp] [datetime] NOT NULL,
        [UserName] [varchar](50) NOT NULL,
        [Type] [varchar](20) NULL,
        [Details] [xml] NOT NULL
    )

  • Example Proc class call:

      using (Proc Provider_iu = new Proc("Provider_iu", User.Identity.Name))
      {
        if (Provider_iu.ExecuteNonQuery(lblProviderMessage, false))
        {
          lbxProviders.Items.Add(new ListItem(Provider_iu["@Name"].ToString(), Provider_iu["@ProviderID"].ToString()));
          lbxProviders.SelectedIndex = lbxProviders.Items.Count - 1;
          lbxProviders_SelectedIndexChanged(null, null);
        }
      }

Big Swinging Developer

This Jay Grieves guy totally rules!!
Jay for president!
I want to work for this guy!!
Random testimonial: “Jay gave me enough reason to finally install GreaseMonkey and enable trackbacks in my Blogger –Brent Anderson”

HTML <Table> tag has a handy <Caption> sub-tag

(again, who knew?!)

  • Found it here under “Photo Albums that Wrap”.
  • Coupled with the “display: inline” style on the table…
  • it winds up being the perfect answer for showing nicely wrapped DVD covers (basically the same as a photo album).
  • Don’t miss the Align attribute to place it either above or below the table.
  • I’m sure this will come in handy in many places requiring a well contained but still wrappable block.

The Perfect Desktop

I’ve finally achieved my own OS X like desktop nirvana on Windows 7:

  • StarDock’s ObjectDock for the main OS X cool factor dock at the bottom
  • After long searching for a way to reliably replicate all the Windows Notification Area functionality, I finally realized that running the standard Windows Taskbar minimized at the top of the screen is an excellent solution to the personal aesthetic I’ve been seeking.
    • StarDock’s ObjectBar was pretty good but not perfect… there are several great skins that makes it look just like the Mac, and it replicates the Notification Area quite well.  Unfortunately, for example, the volume icon did not work properly.  It would not pop up the volume slider window (which is apparently technically called a “Thumbnail Toolbar” in the Windows User Experience Guidelines).
    • I love that the built in volume slider popup responds to the mouse wheel… that’s perfectly convenient for a quick change.
  • An old tool called TClock allowed me to configure the clock exactly how I wanted it to include the date.  Without this little tweak, when the Taskbar is this minimized, the native clock only displays the time.  This little gem let’s you configure everything about the clock and even several other interesting Taskbar properties… like transparency, etc.  Highly recommended.
  • StacksDocklet by Arshi2009 is awesome for replicating the sexy OSX stack effect… I’m using this to house my favorite little utilities & control panels.
  • As you can see I’m running a couple other cool Docklets for the Weather and Clock (both come with ObjectDock), CPU Usage and System Sleep (which is actually scrolled off the far right of the screenshot).

 image

Play History for your Blog – Part Deux (or “Get Orgler’ized”)

  • I use to hang with the Monkey… but now I’m back with the Llama
  • So hopefully you’re already a WinAmp fan if you’re reading this but if not, load up the latest WinAmp (v5.56 at the moment)
  • Orgler is the name for WinAmp’s recent Play History plug-in
  • Sign up for a music.AOL.com account via the Orgler options menu shown below (this provides the bucket for your personal play history data… takes 2 seconds, no fee)
  • Play some music :)
  • (a) Your feed will start showing up at a URL like this: http://music.aol.com/profile/beej126@hotmail.com
  • Now here’s the fun part… fire up Yahoo Pipes
  • Search for Orgler and you should find my published pipe that already does the right filtering
  • Clone it and replace the “Fetch Page” URL with your own like (a) above
  • Then you can publish it to your blog with various badges… sure wish I could show you a screenshot of that but the Yahoo gods appear to have the pipe usage quota dialed way down low… I run into 999 errors all over the place.
  • I didn’t have any luck with the specific Blogger badge… never changed from a continual “working on it…” style generic Pipes image… So I just went with a plain vanilla RSS feed widget.

image image image

“Blogumus” – Blogger Label Tag 3D Cloud Widget

Open Air PC

Update 2015-01-07: Replacing the HDD cage fan - mine got a bad case of the rattles
  • Nutshell: Silverstone FM83
  • 92mm fan on 80mm mount holes = somewhat rare
    • Looks to be manufac'd circa 2007 by the packaging... nothing stays around forever = get it now if you ever think you're going to want it
    • i've got a bunch of spare straight "square" 80mm fans... i'll probably just burn one of those "next time" even though the air flow won't be elegant.
  •  it fits like a glove in the Skeleton's fan shroud... really tight fit but it does cram
  • i used the included grommets to secure the skeleton's fan grill to it's outer shroud via the stock screws since this new fan's casing is thinner and doesn't provide a point of contact for the screws... works great, very snug... totally silent all around
  • the speed control is a little overkill but kinda cool
  • those drives are 2 x 4TB in RAID1 for my primary backup storage so i tend to think a little TLC like this lifetime cooling is a worthwhile investment
After: Antec Skeleton (installed Sunday 13 December 2009)
  • My own overclocking results, full PC specs, etc.
  • Good review
  • He makes a few other good points about a couple engineering misses in this initial model… e.g. must add your cards after!?! you slide in the tray…it’d be nice to think there will be a V2 someday.
  • Honestly took me about 5 hours to set it all up… I went slow and methodical… nice thing was, everything fit and worked how I wanted upon first powerup.
  • I think I like the new “Scythe Zipang 2” cooler I landed on… especially if it keeps up on the temps with only the big fan up top… haven’t had a chance to run a real “full crank” test to check temps yet… can’t wait to see what my top over clock is going to be now.
  • There is more vertical clearance than I was anticipating (see photos below)… almost wonder if i could’ve gotten away with my existing vertical oriented cooler… but a horizontal form factor like this Zipang-2 definitely seems more in line with the big top down blower central to this design.
  • No real change in the overall noise signature… still dead silent… I’m satisfied.
  • It’s quite the beasts as far as desk footprint… I do really like being able to leave the motherboard flat.
  • The only real downside for me is that previously I had full freedom for component placement such that everything was readily accessible from a preferred direction… once you go with “a box” of any kind you have to accept that certain things are going to be facing an undesirable direction because that’s how the industry has settled on a standard orientation for each part… so my feng shui is a little askew but otherwise it’s very nice that things like the iMON display now have  a proper home…
  • And also it’s good for everything to finally be in a container so that once I do finally get my air compressor (that Sears has obviously bungled APO shipment and I never know if/when is actually going to arrive on this shore It finally arrived), I’ll be able to pick it up and take it outside to blow out all the dust.
Before: Raw Parts on a Shelf ;)  (circa April 2008)

DSC03810IMG_5612-2000x1500



antec_skeleton

DSCF3253-2816x2112

SED – Insert text after match

General syntax:
  • sed “s/search-for-regex/& replace-with/” filename.txt
Example:
  • sed "s/BEGIN AS/& \n\nSET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED/" Plans_s.sql
Explanation:
  • s/search-for-regex/replace-with/ = search and replace command
  • & = the matched text (effectively leaves the matched text alone rather than “replacing” it)
  • \n = carriage return

Mind Manager

  • http://www.mindjet.com/products/mindmanager-8-win/overview
  • This product has been around for several years now.
  • I’m very satisfied with how quickly I’m getting up to speed reading “Mind Manager for Dummies” on my tablet/eReader.
  • The book helps understand the serious potential these Mind Mapping tools have for pulling together all the different types of material we try to mange ourselves with these days… web pages, PDF’s, docs, eMails, project plans, diagrams, etc. etc.
  • The book also made me realize that the UI actually operates on a few very simple choices available to getting started beyond staring at a blank page
  • I really like the “brainstorm mode” where you work with a single edit box and the enter key.  You get to stay in heads down brain dump mode as fast as you can spew out ideas, the tool throws each phrase out on the diagram as a box and then when you’ve emptied out, you go back and connect all the boxes… it’s a pretty neat feeling.
  • It is very liberating to have a tool make the jumble in your head look this “pretty” so quickly.
  • You can cut and paste ANYTHING from the Windows landscape into your diagram to be a “box” that can be related to other boxes… I have been using Outlook & OneNote messages as my rudimentary “idea gathering notepad” but the automatic graphical layout of Mind Manager feels much more expressive even for a very non-right brain guy like me… it’s sorta like being able to relationally diagram everything you’re trying to think about
  • There are tons of templates on the mind manager web site that give an idea of what it can be used for… meeting notes, project planning,  requirements gathering, balanced score card, status report, presentations, brainstorming sessions, etc.
  • It’s quite capable at exporting into more traditional formats like PowerPoint & HTML to share with others… it will readily “flatten” out the visual hierarchy into a text only MSWord outline document.
  • MindJet also has a “Catalyst” product which claims to be an online collaboration environment enabling Mind Mapping in groups… I haven’t tried this yet but it makes a ton of sense at face value… makes me immediately wonder about mashing this with Google Wave.
  • As they say, a picture is worth 1000 words…
    • ok yes this is admittedly very trivial content but that’s actually one point of benefit… namely, flushing the trivial things out of the preciously limited forefront of your head so you can get on to bigger and better things

Snap6Snap7

Google Wave – WOW

For all you folks working on any kind of collaboration solution, this seems like THE thing to have on your radar…

It’s not just a standalone product but an API to be woven into our own mashups.

Here’s the gen-x attention span version… very handy to start getting a quick feel.

Watch the long video directly on YouTube so you can maximize it.

Seems like this was announced this May (at the Google “I/O”  ’09 conference).

Just a sampling of immediate highlights:
  • EVER-Y-THING is REALTIME!!!  anybody watching the “Wave” space can make edits (think of it as very robust chat) and everybody also gets to see all the updates being made in realtime…
  • folks that are then invited to the wave later can “replay” the collaborative edits from start to finish with change tracking highlights to call out each edit
  • it’s combined eMail & IM in same space
  • Everyone eMail-like response thread get hierarchically structured (ala forums)
  • The “extensions” that have already been developed to run atop the Wave API are amazing…
  • Like at the very end of the demo… they show a chat with instant language translation!! … one person chats in english which translates to the other guy in french (and vice versa) and they can both type and see what they’re saying in real time... the other web mashups where they enhance existing online services (e.g. bug tracker site) with Wave’s realtime collaboration abilities are very drool worthy

 

Magic Motorcycle Juice

Credit where credit is due, I got this recipe from a colleague named Gary Phelps works out of Baumholder Germany.

Start with a 2 gal plastic gas can so you’ve got a nice easy carry container and plenty of room to work with.

  • 1 Gal of the best apple cider you can get your hands on
  • 1L Vodka (cheap)
  • 1/4 to 1/3L Brandy (cheap)
  • 6 oz Cinnamon candy (“Cinnamon Hearts” work well)

Wait for the candy to dissolve and then have at it.

During the cold season, warm it up and top it off with whip cream.

Warning: Has been known to cause tattoos and children.  Consume at your own risk! ;-)

Continuous Ink Supply System (CISS)

The "CISS" ink kit I went with is <$60 USD and if you're a friend I’d obviously help you set it up… this unit has been working solidly for two years now.


Once you get your head around this ink tank thing, it’s a totally simple concept which just works… It feels SO awesome to finally flip the bird to the whole cartridge rat race and let your family crank out ink sucking job after job without a care in the world!
It took me a while to understand a couple things and I can save you the learning curve.
Once it’s setup you literally don’t have to think about ink ever again but for a level check every six months and dump in some more super cheapo bulk ink if anything is low.
The rare ink refilling moment is potentially a little messy if you miss the tank spout … but nothing major if you work the whole affair inside of a big Tupperware container or some such… and then you just dump any spillover down the sink because it’s so dirt cheap.

I’ve been getting replacement bulk ink for ~$15 per each 8 oz. bottle of color from Atlantic Inkjet.
8 oz is a ton of ink compared to a little cartridge... for reference, the cartridges for my Canon only hold 13 mL... that's 0.43 oz... so a bottle is 18.6 times the size of a cartridge... if you assume you can get recycled cartridges at 1/3 retail (~$5) [Amazon reference]... you’d still be looking at $93 for the same amount of ink you get for $15 in a bottle… that’s a factor of 6 at least… I’m typically happy if I can cut a recurring expense in half… divide it by 6 and you’ve significantly changed the game.

Interview Notes – Are you a team player?

Assuming some form of this question will never die evokes a significant response from my background threads…

  • fundamental work perspective (FWP) #1  - it’s easy to knee jerk a “yes, of course i am!” with the idea that you think you can get along with just about anybody… but a flip side of the coin is to consider those non contributors that take advantage of the true contributors in a team… “the leech” would be at the malicious end of the spectrum but in general it’s pretty challenging to assemble a group of people with skills sets matching well enough that they can all just be thrown in a box and expect them to be a productive team… if that’s the best management you are capable of, then you should probably focus on highly productive individuals first and plan on learning the next level if you’re lucky… anyone that’s asking me “am i a team player” is begging all sorts of questions about how good they are at forming teams… have they ever led a team to multiple reproducible successes… and now define that success… how was it measured?
  • FWP #1.1 – i do however get that positive responses to one’s own “teamwork capacity” is the kind of ammunition one needs in these moments rather than “dodging” an interviewers questions with more questions… so something i truly believe down deep goes something like this… the things that each one of us “know” or understand should absolutely not be held as guarded secrets to protect & justify one’s own existence… I’ll admit, this may be the attitude of someone that has been extremely “lucky” with one solid job after the next ever since i left college and that is now a 16 year run… part of that luck i think is that software development is just such a critical need under any rock you turn over… the world i see needs way more developers than it has on hand… there are just SOOOO many problems that need solving… and that leads me to my point… the knowledge we each have should be absolutely “given away” to our fellow employees in the trenches with us as fast as one can possibly accomplish the knowledge transfer by whatever means available… (over beers after work is one of my personal favorite knowledge transfer opportunities! :)  AND THEN once we all know what we know, we can finally move on the to “good stuff”, right??  i mean the stuff i know, by definition, must’ve been fairly easy to comprehend… so lets all get to that level and then help boost each other up to the next level and the next and the next and maybe after a while we’ll really be “somewhere”… so in a nutshell, i do not believe in “hoarding knowledge”… i flippin hate people that practice this behavior… i pity them for their small mindedness… i initially assume they learned it from some other hoarder and try to sit down with them in a non charged moment and see if there’s any hope of seeing things differently… i wanna whack the managers that allow this to happen with the bozo bowling pin and tell them to WAKE UP…  you’re wasting your own valuable resources, in these lean times!?!  that is not good for the shareholders dude/dudette…
  • i ‘spose i’m just puking out the obvious at this point but this is the core reason for formal education… to get us up to some baseline knowledge set so that a human’s life isn’t wasted solving the same stupid things generations did prior… so we can EVOLVE… please please please GOD, we NEED to evolve… we are still such children running around doing such mindless things… don’t get me wrong, life is generally good, but MAN do we “waste” it on trivial pursuits… myself doggedly included

GPS / Mapping / Garmin - Tips

  • GMapToGPX – Export Google Maps route to GPX which then imports to all Garmin stuff ,etc.
  • Garmin Connect.com – Seems like a fun way to start posting our routes and sharing.
  • MapMyRide.com - route sharing forum that does have Germany content

SQL Server Import and Export Wizard with MSDE2000 (aka DTSWizard)

Crazy Proxy Remote Virtual World, or – my first courtship with Google Voice

Live in Germany, just got invited to Google Voice (YES!)… anxious to get this rolling so RDP’d into my home machine from work …. course Google don’t support outside US yet but I only want a US number to give to my friends back home anyway … immediately went Proxy spelunking… landed on PHProxy first since it has a convenient FireFox plugin… got me through the front door on the Google Voice US check but all the Ajax stuff was failing… FoxyProxy next… hmm lots of instructions… looks flexible… why don’t any of these things comes with a default proxy list yet???  plugged in a proxy from nntime.com… that resolved to an Amazon.com server of all places… Google caught it and blocked … chose another one on port 443… that seems to be working much better … cool I get a list of numbers to choose from now!  Bonus! one of them in area code (Chicagoland - 708) even has my preferred nickname embedded nicely at the end of the number :) … ok now they want a forwarding number, guess I’ll plug in my Skype “Online Number” that i’ve been using while waiting for Google Voice to show me some love… cool they accepted it… ok now they call it for verification… gotta plug in a number when they call… looks like i should be able to with Skype little keypad thingy… damn, it’s not taking and i don’t have any audio at work… WAIT, i have a pair of crappy speakers in the closet!  ok i can hear them prompting me now… but it still won’t take the code entered on the keypad <arg>!!! multiple tries, all of them say “'i’m sorry i can’t recognize your entry”… guess i gotta wait ‘til i get home… sure hope the issue is with the remoting in and not with the Skype translation… guess wost case i’ll get a buddy to answer the Google call :)  AWESOME!  Skype-In worked like a champ directly from my desktop at home… i’m in baby!!

ASP.Net (& Ajax) Notes

It’s been long enough that the little things tripped me when I fired up a new project… so here they are for “next time”:

  • new Guid() – this probably isn’t the one you want… it initializes to all zeros (i.e. {00000000-0000-0000-0000-000000000000})
    • System.Guid.NewGuid() is the one that generates a fresh unique value
  • Getting “Automatic Compilation” to work (i.e. just uploading your source files to the web server and not your \bin folder)
    • Check the <%@ Page > directive & make sure it says CodeFile=”” not CodeBehind=””
    • If not then you’ll be getting errors like “Could not load type …”
    • CodeFile came along with ASP.Net 2.0 and corresponds to a “Web Project” (aka “Web Site”) vs. a “Web Application” which was the only option in ASP.Net 1.x
    • MSDN @ Page Reference 
    • Would love to know what bits need to be twiddled to make CodeFile the default rather than creating a new Web Site project and copying everything over???
    • This guy really goes deep into the differences between Web Sites and Apps <geez, who knew?!?>
  • “Invalid FORMATETC structure”… just reload all the controls in the Ajax toolbox… how annoying
  • “Ajax client-side framework failed to load” error … this is when the shine on all that spiffy new Ajax stuff gets dull in a hurry
    • Absolutely TUUUUNS!! of reasons out there for this… for me it wound up working when I disabled debugging in the web.config on the production server: <compilation debug="False" strict="false"> … ok, yeah, i know that’s not really an answer but i don’t debug on that server anyway so for me it’s a permanent temporary fix ;)
    • Other folks said fire the Add/Remove Programs >  Repair option on .Net Framework 3.5 SP1 (didn’t help for me)
    • or make sure .AXD Extension is setup (was already)
      • IIS6 > {application folder} > (right mouse) Properties > Configuration button > Application extensions
      • IIS7 > Handler Mappings
      • Make sure to uncheck “Verify that file exists”
  • Login / Authentication
    • Great Login control FAQ: http://forums.asp.net/t/1403132.aspx
      • Notably, it shows the necessary “FormsAuthentication.Authenticate(username, password)” bits that’ll let you skip the built in SqlServer Membership support that would otherwise fire by default… handy if you’re going for a quick n’ dirty.
    • Another Q n’ D: throw some hard coded user/passwords under the web.config Forms Authentication tags:

          <system.web>
            <authentication mode="Forms">
              <forms>
                <credentials passwordFormat="Clear">
                  <user name="admin" password="" />
                  <user name="user" password="" />
                </credentials>
              </forms>
            </authentication>

    • And on an intranet where everybody is signed into Windows already, just use Windows authentication for a drop dead easy single-sign-on implementation:
      • <authentication mode="Windows">
      • then Page.User.Identity.Name is their Windows login name… just take that and run with it for your own data based role security, etc.
  • Hierarchical Grid aka Nested Collapsable GridViews via Free/Stock ASP.Net AJAX controls
    • Here’s the baseline example that looks really good: http://mosesofegypt.net/post/Master5cDetail-with-CollapsiblePanelExtender-and-edit-detail-with-HoverMenuExtender-using-GridView.aspx
    • My beef was with the HoverMenu… i think it looks cheesy (screenshot, live demo)… i just wanted to use normal <asp:CommandField>’s to edit GridView rows.
    • Problem was, whenever you would click any of the CommandFields links, the corresponding nested GridView and Panel would just “go away” once the Async Postback’s refresh completed… the Panel appeared to be collapsed but even if you tried to expand it the GridView content was totally gone.
    • Banged all around trying to figure out why by debugging through the events that fired… was about to give up and then finally read something that mentioned Submit buttons behave differently than LinkButtons…
    • So I ditched the CommandField and just tossed in my own LinkButtons to do the same thing and voila, the Grid maintains its state… again, who knew!?
  • DataBinding nested controls declaratively – this was a good tip… but only for READ ONLY stuff
    • rather than messing with code behind, just declare your nested List control’s DataSource like this:
    • DataSource='<%#((DataRowView)Container.DataItem).CreateChildView("ProviderOfficeContact")%>'
    • unfortunately the limited way that _RowEditing just tosses all existing data contexts conflicts with this elegant approach, so you can’t go into edit mode with this kind of approach and have to stick with doing the nested DataSource assignment in the parent’s RowDataBound handler.
  • GridView.RowEditing event – you must set a DataSource and re-GridView.DataBind() in order for the the state of the controls to change to edit mode… what an amazingly inefficient architecture they’ve provided with this databinding stuff… you have to keep running back to the database to get data that hasn’t necessarily changed at all

      {
        gvOffices.EditIndex = e.NewEditIndex;
        gvOffices.DataSource = dataset; //DataMember was set initially and thankfully it persists <unlike anything else in this architecture>
        gvOffices.DataBind();
      }

  • GridView.RowUpdating event
    • if we’re manually databinding (vs a DataSource control) we have to to extract values ourselves (i.e. GridViewUpdateEventArgs.NewValues wil be empty)
    • here’s a good reference to get the values out with the minimum of fuss
    • that page also gives a quick blurb on how to access the “DataKeys”: (sender as GridView).DataKeys[e.RowIndex].Values[fieldName]
  • jQuery:
    • don’t forget to set the DOCTYPE!!! I know this is posted all over the jQuery tutorials, but it’s so subtle i keep forgetting and bang my head for a good hour before i remember:
    • live() vs bind() – live() makes sure you bind to elements that might not be currently available… exactly what you need when you’re doing some Ajax that creates elements dynamically (stumbled on this here, thanks Arnold!!)

Using SourceGear DiffMerge as the Difference/Merge viewer in SourceSafe 2005

Paul Roub’s blog entry

Visual SourceSafe 2005 is located on the Visual Studio 2005 installation media… and yes it does work with Visual Studio 2008 (which does not include it on the installation media).

SQL Split AWK Script

Split the output from SQL Server Management Studio (SSMS) > View > Object Explorer Details > “Script {function|view|procedure} as” into individual files
Note: The current RegEx’s are tailored around the following scripting options (see comments to change):
  • “Include descriptive headers” = true  (this is the default after SSMS 2008 install) – located under:  SSMS > Tools > Options > SQL Server Object Explorer > Scripting > General scripting options)
  • “Schema qualify object names” =  false (NOT the default) - under: … > Object scripting options
Download GAWK.exe for Windows: link1, link2
# example: gawk -f sqlsplit.awk file-to-split.sql

BEGIN {
  outfile = "erase_me.sql" #start off with a dummy file to get the ball rolling
  IGNORECASE = 1
}

END {
  #close off last file
  print "grant "grant" on "arr[1]" to public\ngo\n" >>outfile
  close(outfile)
}

/\/***** Object:/ {
  #upon matcing the "object" comment, close off the previous output file
  print "grant "grant" on "arr[1]" to public\ngo\n" >>outfile
  close(outfile)

  #start up the new one
  match($0, /\[(.*)\]/, arr) #change to something like /\[dbo\]\.\[(.*)\]/ if you want “Schema qualify object names” enabled
  outfile = arr[1]".sql"
  print "--$Author:$\n--$Date:$\n--$Modtime:$\n--$History:$\n" > outfile
}

/^(create) +(proc|function|view)/ {

  grant = "execute"
  if ($2 == "view") grant = "select"

  printf "if not exists(select 1 from sysobjects where name = '"arr[1]"')\n\texec('create "$2" "arr[1] >>outfile

  # function is a little trickier because it could be a table or scalar return type requiring slightly different create function signature
  if ($2 == "function") {
 
    lines = ""
    while((getline line) >0) {
      lines = lines line"\n"
      match(line, /returns/, a)
      if (a[0] != "returns") { continue }

      #debug: printf "line = %s, a[0] = %s, a[1] = %s, a[2] = %s, a[3] = %s\n", line, a[0], a[1], a[2], a[3]

      match(line, /table/, a)
      if (a[0] == "table") {
        grant = "select"
        print "() returns table as return select 1 as one')" >>outfile }
      else print "() returns int begin return 0 end')" >>outfile
      break

    }
  }

  #proc/view
  else {
    print " as select 1 as one')" >>outfile
  }

  print "GO" >>outfile

  sub(/create/, "alter") #change the create to alter
  sub(/$/, lines) #tack back on the lines "eaten" to figure out whether function was tabular or scalar
}


{ 
  print  >>outfile
}

Unprotect MS Word Document

  • Here’s the gist – fire up Word, open your file, then select Tools > Macro > “Microsoft Script Editor”, you’ll get an HTML view, search for “UnprotectPassword” and change it to all zero’s – voila!
  • I had to un-check IE > Tools > Internet Options > Advanced > Disable Script Debugging (other) to get the MSE menu item in MS Word enabled.
  • MSE exe location on my system (Office 2003) -  C:\Program Files\Microsoft Office\OFFICE11\MSE7.exe

Media Players

Popcorn Hour boxes - ($200 – $350)

One of the most popular right now… especially Euro/Asian markets… very much a kitchen sink of features

imageimageimage

Patriot (memory company) - “Box Office” ($100)

image image

Iomega – Sreenplay line (<$100 for Iomega ScreenPlay TV Link Director Edition w/o drive)

ScreenPlay TV Link Director Edition Director HD

Seagate – FreeAgent Theater+, GoFlex TV ($120 range)

image image

Mede8er

image

  • $159 for hard drive less model

ASUS – O!Play Air (HDP-R3) (Best One Yet!?)

212208941  212208941_007 212208941_005 m7RevEHHZoGGWUUg_500

  • $130 Street
  • great to see eSATA! finally as well as typical USB
  • WiFi-N built in
  • cardreader slots
  • haven’t found a good review of it yet but 2 folks on Buy.com liked the non air version

 

(Update: 5 Jan 2010) LaCie - LaCinema Rugged HD

LaCinema_Rugged_HD_Top_Angle_Remote LaCinema_Rugged_HD_Back_Bezel

  • Loving the looks of that enclosure!  Nice job there Neil!
  • $175 street seems reasonable including 500GB drive
  • This review uses words like “frustrating” :\

(Update: 5 Jan 2010) Western Digital – WD TV Live (WDBAAN0000NBK)

wdfWDTV_Live

  • Western Digital’s latest lineup has added a “Live” model with network connectivity for $120 street
  • as well as a lower end “Mini” model for $60 street

 

Western Digital – WD TV (WDAVN00BN)
mainimage
Highlights:

  • $100 street
  • HDMI & Component
  • only 4” x 4” x 1.6”, 0.67 lbs
  • carry case doesn’t come with but looks pretty slick

IOGear (GMD2025U120)

Highlights:
  • $120 street w/120GB drive
  • HD is definitely upgradeable (2.5”)
  • “only” component and composite, no HDMI


Cirago (CMC1000)
image image
Highlights:

GPS Receivers

Garmin GPS Models

Here’s the main page for the receiver only products (so called “OEM”)

10x (BlueTooth) - this is the one Andrew and I have

  • I finally got it to work well with my WinXP BlueTooth stack by turning off “AUTO CONNECT” checkbox buried under the BlueTooth virtual serial port properties
  • Andrew has always said it works well with his HP WinCE based hand held
  • Runs on a rechargeable battery so you do have to tether it (with included USB cable) every once in a while to recharge
  • Garmin also included the cigarette lighter power adapter in my package… Pretty sure I wound up with two of these due to a screwed up initial shipment so I have a spare in case you don’t wind up with one… cigarette lighter to mini-usb is kindof a handy thingy to have in general these days… would charge other USB power based stuff like MP3 players etc.
  • $107 retail
  • Garmin GPS 10x Receiver for mobile devices
  • The annoying thing is I managed to find an actual Garmin.com link where it was posted as $50… BUT I DIDN’T SAVE THE DANG LINK <ARG!>
  • Cheapest new street price I’ve seen is around $80 (from reputable vendors like TheNerds.net, etc)
  • eBay has a refurb for $50 at the moment

I still wonder if USB might be slightly easier to deal with than waiting for BlueTooth to connect, especially if you’re primarily using in a static environment like a car and it avoids the rechargeable battery dance so here’s a couple of those…

20x (USB)

  • $70 retail
  • this seems to be the one Garmin “recommends” for their PC oriented mapping products

18x (USB)

  • $85 retail
  • says it’s magnetic to hold onto your dash or something

Mapping Software

Maps

Very interesting (old) BBC series by James Burke - tracks the thread of inventions underlying our specialized society

http://www.youtube.com/results?search_type=&search_query=james+burke&aq=f
I’ve watched episodes 1-4 so far… 4 is a pretty good one
Simply starting at the beginning seems good too
Make sure you take advantage of the preconfigured playlists -- look for “(play all)” -- so they queue up and you can watch them straight through w/o having to continually find the next one -- which really takes away from the enjoyment after a while
Search for “james burke episode xxx” to dial in on each bundle if you’re not seeing it from the URL I gave above… there appear to be at least up to 20 episodes
(btw: My buddy Joel turned me on to it… he’s full of nifty idears… here’s a gratuitous plug for his vlog site: http://joelart.blip.tv/)

My Pick for USB to SATA/IDE (2.5”/3.5”) Adaptor

Highlights:

  • Sabrent Brand, Model: USB-DSC5 - $20
  • 2A Power Supply.  I read that at least one other brand, KingWin maybe, only had a 100mA! feed… and that guy was finding that it wasn’t enough juice for a 3.5”er
  • All the cables/adapters you need… SATA power, SATA Data, gee wonder what that real small one 2nd from the left is for??
  • Normal 3 prong PC style power cable… other brands had the fairly standard 2 prong laptop cable which you might find preferable… I live in Germany and it’s easier for me to find the German style wall plug with the 3 prong cables.

As an aside, I’m swinging back to TigerDirect rather than NewEgg for a while… Tiger really screwed some things up for me at their local stores in Chicago so i was carrying a grudge… but i tend to think their mailorder business has always been decent… NewEgg really jacks you on the APO shipping… i’m such a fickle filly.

(NewEgg does tend to have better product images though, so this links to Tiger but image was pulled from NewEgg :)

image

This “Newer Technology” model looks a little “slicker” but is it really worth $10 more?

image

LED Projectors

This is THE real wave of the future… Finally, we’ll get to leave the whole stupid bulb replacement game behind!  LED light source has lifespan specs of 20,000 hours!  LED’s are the low temp light source we all love in those nifty new flash lights these days.  Contrast specs will also be a thing of the past, they’re rating this model at 100,000:1!!  Looks like they’re still working on getting the light level output up to snuff, this was only rated at a very anemic 800 lumens… i’m sure that’s only a matter of time as well.

Vivitek’s already got a 1080p model out… and it’s only $14k! :)

Endgadget.com’s coverage

ProctorCentral.com’s coverage

image

Starts to make sense why we’re seeing this technology pop up in the pico projector end of the spectrum at first… low res, low brightness, low power, low footprint all combine for a synergistic package at the moment.

image

I just bought a bulb technology projector (LCD based Epson Home Cinema 720)… hopefully by the time my bulb is burning out (3 years??) LED projectors will be down to mainstream prices.

SymLinks (and their ilk) Are Excellent System Restore ‘Glue’

Ok i know this is 20+ years late for anybody that’s enjoyed any of the sweet but non mainstreamy flavors of  ‘nix… but now that Vista (blech!!) and Windows 7’s version of NTFS supports SymLinks (aka Soft) & HardLinks so well we can enjoy ourselves just as much over in Mr. Bill’s backyard (or I guess it’s Mr. Ozzie’s backyard now aint it)

Go get this puppy: Link Shell Extension

Nevermind that his version history starts at 1999 :| We can rest easy that Vista was the first to do an actual Symbolic Link (i.e. softies)… but yeah we’ve been missing out, hardies have been in there since NT4… so we could’ve been having some fun… the biggest downside ‘til now in my naive opinion: the hard flavor couldn’t cross drive letters… yes, just another annoying distraction that could be mitigated in other ways, but now we don’t have to think about it (even less).

My main point here is… i re-re-re-re-re-load Winders at the drop of a hat (i’m kinda neurotic about it… i recommend this behavior… what was that?! don’t listen to the voices?) anyway, i' know i’m not the only one that has rallied the wagons behind saving all their precious files under one root folder and then carries that carpet bag from one system reload to another.  Well SymLinks are here to help. 

Listen up soldier, here’s the straight doo doo: Rather than actually leaving your numerous tweaked files sitting hither and thither at "%appdata%\Microsoft\Internet Explorer\Quick Launch” and “c:\users\beej\favorites” and “c:\windows\system32\drivers\etc\hosts” and and and… leave them all in a nice tidy centralized folder structure of your own design and then SymLink the schnikees out of them.

This shell extension lets you drag and drop to create magical “short cuts” that actually act like the real file but aren’t really there.

You catchin me? No?  Just load the dang thing, right mouse, drag, drop, look for the “Drop Here” menu and throw a dart at your options… there’s various ups and downs to each of the Link flavors… e.g. I noticed that soft links wouldn’t allow navigation from a shared folder entrance… who knew?

Enjoy!  I’m having a blast with them… all over the place.  Can’t wait to re-load again!

Update 09 Oct 2009:  SymLinks are also coming in super handy as a way of centralizing and sharing common source code files (I have a feeling this is something graybeard coders have been doing for years but that you just don’t hear about it much)… I SymLink a “copy” of the common source file into each project folder tree where I want to reuse… obviously this is way easier to manage than keeping track of updating actual copies in every folder… it also helps keep me more honest about sticking to the “code contract” that I originally intended… if I’ve hacked something up for one project, then compiles will bomb and remind me… it forces me to keep things generic and therefore promotes more reusable code.

Toshiba TDP-EW25U Projector – Another Short Throw

I found one more short throw that should definitely be in your sights if that’s what you’re in to:

Toshiba TDP-EW25U Conference Room Projector

Highlights:

  • + 1280 x 800 res - so full 720p natively which is a good
  • + includes a carry case (ok no biggie but nice)
  • + built in handle
  • + sliding window lens cover
  • - slightly less contrast at 2000:1 vs 2500:1 on the Optoma EX525ST but definitely still good
  • - no digital input (this is the bummer that kills it for me)
  • It will take the 3 wire "component" input through the VGA port (as they all seem to)… and my graphics card definitely supports kicking out that 3 wire component signal natively
  • see my “Projector Cables & Connections – More Complex Than You’d Think” … it’s a total tossup as far as what’s going to actually look best between VGA / Component / DVI-HDMI… but that HDMI cable is so dang cute i couldn’t live w/o it! ;)
  • Normal street price is $1200+ but there    was   a refurb of it available at newegg for $720! That's a great bargain compared to the Optoma... I've actually started thinking refurb electronics in general are "fine" and perhaps even better than new stuff because they've received some extra TLC.

Projector Cables & Connections – More Complex Than You’d Think (or “VGA vs Component vs HDMI vs DVI” :)

  • ProjectorCentral.com (2/26/01): “So what is Component Video anyway?
  • ProjectorCentral.com (4/12/01): “Is SVGA enough for good video?
  • ProjectorCentral.com (9/30/04): “DVI and HDMI Video Connections” – so HDMI isn’t some magical cure-all for long distance video cabling (at least it wasn’t circa 2004, perhaps this gap has been closed at this point… i shall soon find out… I’m getting a freebie 25ft HDMI cable with recently ordered projector, so build quality could be iffy… and i’ve gotta adapt it off of my DVI video card which probably drops a couple impedance points at the juncture)
  • ProjectorCentral.com (5/4/05): “DVI and HDMI - Copper or Fiber Optics?” – HDMI over copper should hold up over 25ft but that’s max with solid quality, after that you’re going to see some bad juju.
  • Forum.Ecoustics.com (2/14/05): “DVI/HDMI vs. Component Video -- Which is Better?” – excellent coverage… finally someone makes some point blank statements of difference: “Analog component video is an extremely robust signal type… DVI and HDMI, unfortunately, are not so robust … For reasons known only to the designers of the DVI and HDMI standards, this very sound design principle was ignored… It depends upon your source and display devices, and there's no good way, in principle, to say in advance whether the digital or the analog connection will render a better picture” (booya)
  • And it’s much of the same tossups going on with VGA vs Component from what I’ve read so far.

So basically you just have to try them all with your particular equipment… anything is fair game on what’s going to actually look best.

Some other great writeups from these guys:

They have an absolutely dismal presentation for the amount of excellent hard core data they have to provide… here’s the root “commentary” list where i pulled these.

And this is an excellent feature finder drop down box filter search.