A few weeks ago, the WiFi stopped working on my brotherâ€™s other laptop, an HP Pavillion dv6200-series. Turns out there have been a lot of problems with a lot of HP laptops, and HP has issued a recall. HP extended the warranty on these machines, and is sending a box to his house for a free repair.
My brother lugged two kids and two laptops from Phoenix. At various times through the day today, Iâ€™ve been surrounded by all four of them.
This particular episode involves a Dell Inspiron 600m. Iâ€™ve never seen a display look like this. Either the LCD is totally shot, or the video card is shot. After some diagnostics with Dell tech support, itâ€™s the video card. Which means a new motherboard.
During the diagnosis, the laptop ceases to boot past the Windows screen, repeatedly bringing up a BSOD about the master partition. Pulling out my trusty new Slax bootable USB key, I can access the data on the HDD, so the drive controller and drive are OK. As long as the drive is OK, the controller doesnâ€™t matterâ€”weâ€™ll have a new one soon anyway, with the rest of the motherboard.
So, itâ€™s off to eBay to locate a new motherboard, and then a Windows restore once he ships me the CDs. Looks like heâ€™s going home with 2 kids and 1 laptop.
One of the great joys a family has when a member works in IT is onsite technical support when we all get together.
Part 1 is popâ€™s laptop, which picked up a nasty malware bug somewhere. Probably one of the hundreds of funny videos he gets sent by all his buddies. Despite AVG and Windows Defender, something got in there and screwed up the userinit.exe. We could get to the welcome screen, but as soon as you clicked the username, youâ€™d be immediately logged out.
I found a great list of free bootable rescue CDs, and downloaded and ran the offering from f-secure. The f-secure disk boots into a network enabled Knoppix environment, and you can grab the latest definitions file via network or onto a USB key, which I did and the software located automatically.
The scan found and and quarantined one infected file, and a couple previous infected versions in the system restore archives. It was the userinit.exe, so now the task becomes replacing it.
The (failed) System Recovery
HP/Compaq doesnâ€™t ship recovery disks anymore. Instead, the recovery is located on a secure partition you boot into. This is important to know, because if I had known this at first, popâ€™s laptop would have been fixed a week ago when he UPSâ€™d it to me. After running the online recovery, I was still unable to log in to Windows. This meant we had to use the destructive restore.
The Data Recovery â€“ Linux to the Rescue
To prevent losing data, I had to boot the system and copy it off. I first tried a Windows LiveCD made with BartPE, but my laptop has an IDE drive, and popâ€™s has SATA, so there were no drivers for his HDD. Plan B was to boot into Linux.
The first Linux attempt was an Ubuntu 8.10 LiveCD. Ubuntu must not support SATA on its LiveCD, because it couldnâ€™t mount the drive.
Next attempt was PC Linux OS, which is my favorite distro running under Parallels. I made a bootable thumb drive following the instructions at PenDriveLinux. We booted and mounted the SATA drive, but by default the thumb drive is not writeable, and I couldnâ€™t enable writing to the drive.
My last attempt was to use Slax. I made a bootable USB key with Slax. Slax is very lightweight, and has an attractive KDE shell, easy networking (using WEP), and a good set of standard utilities for burning CDs and DVDs. Some of the critical data I copied to the thumb drive, and the rest (iTunes, grandbaby photos) had to go on a DVD.
The Destructive Restore
After recovering the data, I had one last-ditch idea, to replace the userinit.exe on popâ€™s machine with the one from my machine. No dice. Donâ€™t know why, but didnâ€™t work.
So, I booted into the recovery mode, and did the destructive restore. Success! After a small amount of configuration, and reinstalling his software (thankfully heâ€™s un-savvy enough to only have a couple programs), he was up and running. And now itâ€™s time to finish changing all the passwords.
Moral of the story
HP/Compaqâ€™s onboard restore partition is handy and well designed, but the simple non-destructive recovery may not be enough after a malware infection. When you need to recover data, Slax is a lifesaver.
Congrats to Brian Bischof for publishing Crystal Reports Encyclopedia for .NET 2005 and 2008, and the redesign of the companion site at http://www.crystalreportsbook.com/.
In the past, I canâ€™t say enough how helpful Brianâ€™s books have been. These are the manuals
Crystal Seagate Business Objects SAP should send out with the software. Brianâ€™s books are very readable, very easy to follow, and have examples in both C# and VB.NET.
If youâ€™re doing any work at all with Crystal Reports, you owe it to yourself to get the corresponding book and get to work.
A question in the asp.net forums wanted to return the following output:
1 bsmith csmith dsmith
but was getting
Since T-SQL (an query languages in general) lacks a lot of the array and concatenation features we take for granted in programming languages, you need to do a little trickery to make this work. There are probably several ways to pull this off, but hereâ€™s what I did.
My first thought was the great creating a CSV list in SQL using coalesce example. But, the tricky part here is that he wanted the ID of the ticket along with the list of the users assigned to the ticket, and you canâ€™t assign a value and retrieve data in the same statement. So that means we have to use some sort of updateable array (which is usually a table variable or temp table in T-SQL) and a loop (Iâ€™m not partial to cursors, so I used a WHILE loop).
The original question had two tables joined together, so I tried to mimic the structure for my solution. The tables I used looked like this:
And hereâ€™s the SQL I ended up with.
— table variable to hold intermediate results
declare @assignments table(ticket_id int, assigned_to varchar(100))
–couple of variables used in the loop
declare @assigned_to varchar(100),
— populate the table var with a list of all tickets
— modify sql to suit your needs
insert into @assignments(ticket_id)
select distinct ticket_id from work_tickets
order by ticket_id
— get the first ticket w/o any assignment information
select top 1 @ticket_id = ticket_id
where assigned_to is null
— if anything was retrieved in the previous query
— when we reach the end of the table, @@rowcount=0 and loop will end
while @@rowcount >0
— get all users assigned to the work ticket and join them into a space
— delimited list
— modify join and where to suit your schema
select @assigned_to = coalesce(@assigned_to + ‘ ‘,”) + convert(varchar(6),user_name)
from work_tickets_assignment as a
inner join work_tickets as t on a.user_id = t.assigned_to_id
where t.ticket_id = @ticket_id
— add the user list into the table var
set assigned_to = @assigned_to
where ticket_id = @ticket_id
— important!! clear the list
set @assigned_to = ”
— get the next ticket w/o assignment info
— loop will end if we’re done
— this query should match the one outside the loop
select top 1 @ticket_id = ticket_id
where assigned_to is null
— return the contents of the table var
select * from @assignments
This have me the exact result the questioner wanted. Itâ€™s not the most scalable piece of code, but in a test on some other data I have, I was able to update over 800+ unique â€œticketsâ€ with over 2000 â€œusersâ€ in under 4 seconds. Like I said, not the most scalable, but it will get the job done for smaller data sets.
Todayâ€™s mail brought a nice present from Microsoftâ€”my copy of SQL Server 2008 Standard Edition from the Heroes Happen Here event in Pittsburgh. Sweet!
I can’t believe I’ve been back for a week, this week has been a blur.
I have to say thank you to the Montreal .NET Community, JS Tougas, Eric Moreau and Guy Barrette in particular.Â JS was my personal tour guide all week, and Eric treated Julie Lerman and myself to lunch on Friday.Â Overall, a great bunch of guys.Â Thanks also to Jim Duffy for the chat on the plane to Philly.Â Hope you got home after your delay.
Montreal .NET UG hosted a party one night, with some excellent beer and munchies.Â JS and I loaded up on poutine before heading over.Â There were giveaways, and I ended up winning an Aspose Total for .NET subscription because I dropped my business card in the pile.Â Awesome!Â That pretty much made the trip a wash for my company.Â I’m looking forward to using that in the very near future.Â JS had to catch his train home, and I had a little work to do, so we gave our door prize tickets to Julie (we’re each claiming 1/3 of anything she won).Â Plus, I wasn’t going to try and navigate the underground by myself after a couple beers.
There was plenty of swag given away at DevTeach.Â Dozens of thumb drives (I won a couple), as well as a big pile of books and I think 5 MSDN subscriptions.Â Microsoft kicked in a copy of Visual Studio 2008 Professional, Expression Web and the Tech-Ed DVDs for all attendees.Â Plus, the ever present messenger bag or backpack to take it all home in (from Leed’s, a local company).
Speaking of the Tech-Ed DVDs, they were produced with a beta of Silverlight, and don’t work with Silverlight 2.0 RTM.Â Eric has more information about how to play the Tech-Ed DVDs.
So now that work is settling down a little, it’s time to do a little knowledge transfer with my team.Â We have some good challenges ahead of us, and some great new knowledge to help us along.
Umm, yeah.Â That could turn into a conference unto itself.Â After you run through the little wizard, you have something pretty easy to use, but under the covers, it’s amazing how much functionality and control they’ve baked in to a version 1 product.
Since EF originated with the ADO.NET team, it’s actually pretty performant.Â In some tests Julie ran for a recent CoDE Magazine article, she shows the EF to be about 10x faster than Linq to SQL (which originated with the C# team, but has been transferred to the ADO.NET Team), and faster than even ADO.NET Data Adapters.
I’m pencilled in to present the EF at Pittsburgh .NET in February, and Nate and I are going to begin to incorporate it into Scrumr.Â That mean’s there’s going to be some serious rearchitecting of the app, but it’ll be worth it in the long run.Â As we go through the process, Nate and I will be blogging about our experiences.
Today I got to meet Nitin, publisher of the awesome and free cheat sheets at http://www.refcardz.com/.Â All free PDF downloads, covering a range of topics.Â They’re introducing 12 new .NET cards next year, but already have Silverlight 2, Core .NET, C# and PowerShell.Â Nitin brought some nicely printed ones for deign patterns and Silverlight 2.Â This was a sweet bit of swag.
A lot of people stayed late at the UG party last night, judging by the low attendance at breakfast and bleary eyes in the early sessions.
My first session was protecting web apps against injection attacks.Â In a way, I’m happy that we already do almost all of the recommended best practices.Â There are a few things I need to touch up when I get back.
The Silverlight toolkit is very cool, I can’t wait to get more into Silverlight and what it can do.Â The follow-up databinding session didn’t go so well, so not much there.
I did win a couple of USB keys today, and Rally Software gave me a handful of Matchbox-size Mini Coopers with their logo for looking at their software.Â Their community edition may find its way into a project in the future as a test drive.
The afternoon is being spent with Rod Paddock and Jim Duffy.Â Rod went through Ajaxing applications and a brief tour of the Ajax Control Toolkit.
The always hilarious Jim Duffy did a great talk on refactoring in VB.NET using the free Refactor! from DevExpress.Â My team can expect to download and install this tool next week.
Last regular session is using Virtual Earth in ASP.NET apps.Â Very excited about this.Â My team at work can expect to see some of this next year.
I’m in Markus Egger’s (Pubisher of CoDE Magazine) “Intro to Silverlight” talk, and he just dropped the bombshell that the next version of Silverlight will support out-of-browser experiences!Â In 2.0, the browser is required to host the controls, but the next version can stand alone.
“Identifying Performance Benchmarks”.Â Awesome.Â This session alone will pay for the trip.Â Cool tip:
select * from orders
will execute the statement once
select * from orders
will execute the statement 500 times.Â Perfmon + profiler = cool, especially when you overlay perfom stats on top of traces.
DB Maintenance Optimization.Â Don’t use Database Maintenance Plans, create your own.Â They’re not a great tool.Â If you have to, research all their options, and choose as few as you need to–you can do some really dumb things.Â Windows 2008 Server has scheduled job to defrag filesystem enabled by default.Â Using SQL on a SAN, check out http://www.sqlcat.com/ for best practices.Â Physical file fragmentation does exist on a SAN, but can be hidden by caching and buffering.Â Diskeeper has some guidance.
Expression Blend is cool.Â We got Expression Web as part of the conference swag, but we have Blend as part of MSDN.Â Blend 2.0 is built in WPF, and parts of VS10 will also be built on WPF.Â Blend 2.5 with the Silverlight tools was changed to be an SP.Â WPF Spy tools can be used to poke around inside of blend.Â Tips: if you don’t know a namespace, hover over the class and hit Ctrl+. to find all namespaces with that class.Â I see some great potential for WPF enabled display of information.
Dynamic Data is awesome in theory.Â It’s immediately most useful in master data admin pages, but special steps are necessary to secure dynamic data.Â This is partly because of issues in securing ASP.NET routing.Â Also, since it can rely on Linq to SQL, dynamic SQL is used, and the login user needs access to all tables we want to access, including the master data tables.Â There is an example on securing dynamic data on Codeplex (access via http://asp.net/dynamicdata/ and go to samples).
Last session of the day is Query Execution Plans, with Brad McGehee again.Â A lot of this I know from Kim Tripp’s webcasts in the past, but SQL 2005 has some differences over SQL 2000.Â I’m amazed he can create such bad databases and queries on purpose for the demonstrations.Â That takes effort when you’ve spent a lot of time figuring out how to do things correctly.
Tonight DotNetRocks recorded a session, and the Montreal .NET UG hosted a party at a nearby bar.Â I ate poutine, which are fries covered with gravy and what translates into “cheese crap”, but what we call curds.Â BTDT, and I don’t think I need another helping this week.