November 20th, 2008 Rusty
For those friends of mine who work like wandering nomads with laptops, here’s a tip… (if you don’t know me you should move on to other things. Everyone knows I am full of B.S.)
Apre Diem
- The patio is always pleasant and a decent in-town view (lots of trees)
- WiFi isn’t the fastest but always available
- Music is never annoying (and sometimes awesome)
- They have excellent gourmet coffees
- They have excellent food
- They have beer
- They have high Gravity beer
- SO close to everything
- Prices are reasonable
- Did I mention High Gravity Beer?
Now, Power outlets are limited. And if I find you in my seat, You’ll have to roshambo me for it. I go first.
The only drawback would be the occasional smoker. Every now and again you get some bone head who still thinks smoking makes him/her look cool even though it really makes them look like a complete dumb-ass lacking intelligence, self control or self esteem. Usually it encourages me to listen to their phone calls where I wonder why the person on the other line doesn’t tell them what a waste of energy, not to mention oxygen, they really are. Its not that smoking makes you bad (ok, it does, but not cool bad), its that smoking is a coffee shop patio is similar to pleasuring yourself in your high school bathroom. Yeah… I’ll bet that brought back some harsh memories! Stop smoking on my patio, you dufuss.
Posted in Atlanta | No Comments »
November 17th, 2008 Rusty
Lou, of OckhamResearch.com, had an old IBM Thinkpad 600e sitting on a shelf elevating some boxes of archived papers. My 5yo son was visiting me at work and wanted to "type on the computer" so I tried to fire it up. It booted to the log in screen but I didn’t have the password. My son proceeded to draw on the white board. When he’s 15, I’ll just be a geek with a dorky job but for now daddy’s office is fun.
Stop Taunting Me You Silly Twit!
The thinkpad sat there, requesting a password, for several weeks. Lou didn’t know the password either so there it sat, taunting me.
Showing My Age
I grew tired of staring at a Windows NT Workstation…
Memory
All alone in the moonlight
I can smile at the old days
I was beautiful then
…prompt so I tried to wipe it and install Windows XP. The machine boasts a mind blowing Pentium II 366mhz processor with 280MB RAM and a 12 Gig Hard Drive.
Crash & Burn
Upon installing XP, I was greeted by the always ever popular Windows BSOD (blue screen of death). I don’t keep a copy of NT lying around so it was off to Linux world for something that might not crash on this barely used, completely not useful little IBM notebook.
p.s. Wouldn’t it be funny if computers got grey hair and wrinkles like we do?
Plan B
I burned a cd of Ubuntu from their website using my Mac…
Friday night and I need a fight
My motorcycle and a switchblade knife
Handful of grease in my hair feels right
But what I need to make me tight are those…
…uh, where was I? I ran the installer, answered several questions about where I am and how I like my stuff displayed, and launched into a fully functional, very useful and pleasing to use Ubuntu desktop. For the uninitiated, it comes pre-installed with the O/S (duh), Open Office (Word Processing, Spreadsheets, Presentation), Firefox Internet Browser, a bunch of games, a sound recorder, Gimp Image Editor, Photo Manager, Open Office Drawing, Ekiga Soft Phone, Pidgin IM, Transmission BitTorrent Client, Movie Player, Rhythmbox Music Player, the list goes on… it comes loaded with useful programs. It does not however have any of the following included with the installation: trials to aol, msn or netzero; dell notifications irritator, Lenovo restore manager; background update managers; heavy device management utilities; alternate network management or power profile sub systems; OEM crapware. Of course, a fresh install of XP doesn’t have that junk either but then you have to spend several hours assembling all that other stuff and it is not, well, free.
Sweeeeeeeeeeeet, psych!
To see if my new Linux dog could hunt, I launched Firefox. Aw, snap! No wireless. Wireless was a luxury in 1999. I can hardly remember such a time. So I looked into the possibilities and found that this old monster used cardbus architecture. Those were little laptop cards we used to have to buy to enable mobility in mobile computers. You kids are too young to remember.
I seem to recognize your face
Haunting, familiar, yet I cant seem to place it
Cannot find the candle of thought to light your name
Lifetimes are catching up with me
Amazon had a 802.11G Wireless Xtreme Cardbus Adapter (D-Link Wireless 108G) for $8 plus shipping. For $15 I was willing to give it a shot. In two business days, my new cardbus adapter and "Programming in Objective C" book arrived (I never order just one thing from Amazon). I opened it up (the card) and hoped to see a Linux install option…
The time is right your perfume fills my head, the stars get red
And oh the night’s so blue
And then I go and spoil it all, by saying something stupid
My heart sank as I realized I have no experience with Linux and I didn’t know how to get, much less install, drivers for Linux. Visions of vi filled my head. In the mean time, I shoved the card in the slot and watched as the green lights began to blink. Then, as I clicked on the network icon near the top of the screen, I found that it had "installed itself". The computer discovered and enabled the card and the networks were listed in the available networks box. I had to provide my password 3 times, resulting in a timeout on the first 2, but since that time it just connects when it boots like a good little computer should.
Wow is all I can say.
So now we have, for the investment of about 30 minutes and $15 for a wireless card, an extra laptop. It works perfectly for browsing the Internets and will be a perfect machine for my son to type on when he visits me at work. Should he spill his chocolate milk slammer down into the keyboard, it will go back on the shelf from whence it came.
I can’t speak to whether it would be a good choice for a student as their teacher is going to be using Windows. I don’t know exactly how interoperable Open Office is with MS Office but I can tell you that its not as sexy or easy to use. MS Office sets the standard there. However, for an extra computer that is constrained on cpu or memory or both, its a perfect way to get a little extra life out of something that was otherwise beyond its functional lifespan. You don’t have to worry about viruses and its inherently secure and stable.
Posted in Linux, Mac, Windows | No Comments »
November 12th, 2008 Rusty
This was a nifty way to set properties in previous MVC drops. I’ll demonstrate one way to migrate this to the new way of MVC.
<%= Html.RenderUserControl( "~/Views/Components/Pdf/ReportHeader.ascx", ViewData.Model.PrimaryCompany, new { PageNumber = 1, TotalPages = 7 } )%>
First you’ll need to accept ViewData items in your control. The path of least resistance is to set your existing properties using new view data items. This is done inside your user control.
public partial class ReportHeader : System.Web.Mvc.ViewUserControl<Models.Ticker.TickerViewData>
{
public int PageNumber { get; set; }
public int TotalPages { get; set; }
public string TickerUrl { get; set; }
public ReportHeader()
{
this.PageNumber = 1;
this.TotalPages = 5;
}
protected void Page_Load( object sender, EventArgs e )
{
if( ViewData["pageNumber"] != null ) this.PageNumber = (int)ViewData["pageNumber"];
if( ViewData["totalPages"] != null ) this.TotalPages = (int)ViewData["totalPages"];
this.TickerUrl = new gah.Web.Mvc.Helpers.NavigationHelper().GetTickerUrl( ViewData.Model.StockTicker );
}
}
Modify your calling view page. Notice, no <%=
<%
ViewDataDictionary pagingDictionary = new ViewDataDictionary();
pagingDictionary.Add( "pageNumber", 1 );
pagingDictionary.Add( "totalPages", 7 );
Html.RenderPartial( "~/Views/Components/Pdf/ReportHeader.ascx", pagingDictionary );
%>
I was a fan of the old style but this works just as well. Perhaps someone will write the extension that brings back anonymous property mapping…
Posted in Asp.Net, Mvc | No Comments »
November 12th, 2008 Rusty
This is what I used to be able to do:
string html = Html.RenderUserControl( "~/Views/Components/SomeControl.ascx", ViewData["SomeVDKey"], new {Width=200})%>
Nostalgia makes me weep. For a short time, we Asp.Net developers had something so powerful, so flexible, so lovely, so easy to work into any scenario… well, its gone now, get on with it.
After much research, I eventually gave up on my desire to render user controls to a string. The Mvc team is trying to provide a consistent design pattern and felt it was better to require you to execute actions when you want html output. (Its the "we know best" attitude that gets me so fired up). Along the same lines, properties on controls are no longer accessible because some view engines may not respect the object structure and extending the IView or IViewEngine interface would complicate things on that end. Ok, I concede to your values and narcissistic tendencies.
Need begets innovation
Then I came across a place where I absolutely needed my html pre-rendered to a string. My WebForm-based ascx would not accept the child content I was placing in it. The behavior was that any script inside my tags would cause the outside control to fail render yet it rendered the child content - weird and completely unusable. The original design used RenderUserControl to create the html and then set that as a string property in the container control. No, not perfect. But it worked! It is WebForms smashing heads with MVC and the result is a blank page (and a blank stare). I either had to completely reinvent the features or come up with some bridge to bring it back to life.
I really didn’t want to render an action from the view because I had all the data I needed already loaded in ViewData. It hurts my sensibilities to load the whole stack and hit all the expensive resources a second time just for a small part of the page.
Render Html from the Controller
Mike Hadlow had a better idea than all of us. He realized that this need to render the output of an partial page and do something with it falls in the realm of business logic and probably belongs in the controller anyway. He created an extension method for Controller that captures the output of an action as a string of html. Now I can stick that in ViewData and pass it to the view as finished html. Since I call this method after initializing ViewData, it does not require that I make an entire round trip or hit my database or other resources again. Excellent. Thank you so much!
What I have now:
string html = this.CaptureActionHtml<ResearchController>(c => (ViewResult)c.RatingsReturnChart() );
I’m using the extension posted here: http://mikehadlow.blogspot.com/2008/06/mvc-framework-capturing-output-of-view_05.html
That’s not bad. Not bad at all. Now I can pass that html to my view in the ViewData and modify my view to pull it from there rather than render itself. I can deal. Thanks for the save, Mike
Posted in Asp.Net, Mvc | No Comments »
November 10th, 2008 Rusty
Hey San Francisco Coffee Roasting Company, you have the best coffee
That is a genuine compliment from the bottom of my heart. Your coffee ROCKS! Your mocha rules the land of beans. Even your soy milk stands alone (how DO you froth it like that and make it taste just like the good stuff?)
Hey SFCRC, please fix your North location
On N. Highland Ave. in Atlanta, there are two SFCRC locations. One south of Ponce and the other north. The south one is nice but its further from my house. For some reason, I like the north atmosphere better. The north location would have me there twice as often, spending twice my money, if the following were remedied:
- the stench from the coffee roaster in the basement completely ruins any chance of enjoying the outside air. It smells like burning grease. (not a problem inside)
- there are only two power outlets in the whole place. Rumor has it the owner has stated he doesn’t want people with laptops there. Really?
- the wireless is spotty. I can actually live with that but I thought I’d mention it. For a while it was down. I’d recommend you check your sales records during those couple weeks. Seriously. I’ll bet its telling. Don’t forget, it took us a couple weeks to determine that it was fixed. I’d measure that last 7 days where the wireless was not available compared to 7 days at least three weeks past when you restored service.
Again, the BEST coffee. I love the place. I BUY ALL MY BEANS THERE. At least I do when I can work. Sorry, trying to remain positive but my day has been less productive than it could have been and now I am wrapping up. So… great job on the beans and the brew, man. Now stop hating on laptop totin’ yuppie scum and let us give you MORE of our money.
Install some outlets (near the floor under the tables, that would rock) and fix that wreaking stack of smoking stench coming from your basement.
Posted in Blogging | No Comments »
November 10th, 2008 Rusty
“A Watched Pot Never Boils,” my mother always said. Or ws that Mother Goose? Regardless, I decided to make use of my time waiting for Vista to finish its launch sequence and two minute count down.
Here’s an idea, multiple boot profiles. For instance, I’d like a dev lite boot profile. That would be just the OS and Visual Studio with a few browsers and IIS. Don’t need chat, don’t need email, don’t need network discovery or ready boost or fast search indexing or update manager or user experience reporting monitor or Office quick start or adobe quick start or adobe, for that matter, or itunes or SQL Server… I’ll bet that’d shave some time off a reboot!
Hm, sounds like my XP VMWare image is about to grow up
Posted in VMWare, Vista | No Comments »
November 10th, 2008 Rusty
I searched the VMWare site for a place to post this but it appears my 30 days of complimentary support have expired and they believe I should purchase the right to send them an email. ha! I’ve purchased 4 copies of VMWare Fusion, blogged about using VMWare when developing on Vista and XP using a Mac, and generally been a big proponent for the Software. I think I’ve earned my right to send an email. Furthermore, I am spending my time preparing a very solid bit of feedback (while their software messes with my day), I might as well share with the world so all can discuss and understand the need.
Hard Drive Hiccups Kill VMWare Guest
Here’s the deal… When I am working with my VM Vista, and the Hard Drive disconnects from my Mac, the VM Guest (Vista) is killed dead (as if I’d pulled the power cord on the cpu). That’s not all! VMWare then spins and sputters and is unable to close, quit or even restart. Unusual for a Mac, you cannot get the VM back online without a restart. Yeah, I said it, you have to reboot the Mac.
Please Handle Expected Failures
“Don’t unplug the hard drive,” you might say? That certainly is the logical answer, isn’t it? Well, this is the second time today that I am struggling with VMWare, trying to make it let go of whatever it is trying to do so I can start over. In both case, I lost connection to my harddrive as my phone passed the external harddrive resting on the arm of my chair. No idea why it disconnected, be it a bump or some magnetic interference, but it did, twice. Even though I make it a policy never to disconnect without first shutting down VMWare, I experience this sort of thing at least once per week. I use VMWare all day, every day, so I suppose I see more of these kinds of things then most.
Shut Down Reliably
First I’d like to see this sort of interuption dealt with. It seems reasonable to freeze the VM in memory and present a dialog that states, “your VMImage file has been disconnected, please reconnect and click OK or choose KILL to shut down and loose all unsaved information”. That seems like something that should be possible.
Second, when VMWare shuts down, I can’t get my hard drive to eject without quitting VMWare and then waiting a very long time. I assume VMWare is still saving something but tell me so! Leave a dialog up. yo
thanks
Posted in VMWare | No Comments »
November 10th, 2008 Rusty
Used to be we developers had to develop at least two sites: 1 for Mozilla and 1 for Internet Explorer. Netscape was the biggest PITA and I am happy that browser was retired. Now with Firefox, Safari and Chrome all committing to supporting W3C standards, more browsers is a very good thing. Internet Explorer has come a long way to supporting the same standards although Microsoft likes to keep their browser special.
Where is that extra margin coming from?
Sometimes, when floating an element or affecting its layout in some other seemingly unrelated way, you might introduce a little strip of space in your layout that you certainly hadn’t intended. The best way to zero in on the element that is causing the issue is to set background colors of participating elements, using css, to various random colors. This will make your elements solid so you can identify whether the space is inside the "blue" div or actually its child "red" div.
Use Internet Explorers "IE Developers Toolbar" to inspect the browser’s interpretation of your document while its running. Its similar to what you get with FireFox’s FireBug extension except that FireBug is to IE Dev TB what a heat seeking, laser guided missile is to a 5 pump pellet gun. Nonetheless, its very useful. If you aren’t using firebug with firefox yet, go get it immediately …and then come back and finish reading this post.
Using the toolbar, or background color manipulation, to find the element that has the margin or padding added, you are very close to where you need to be to fix it. Try to avoid adding negative margins to fix a problem caused by IE weirdness. Sometimes you have little else and as a last resort can get you on to more important problems.
Look Around a Bit
Once you found your offending element (or pair of elements) don’t become too sure of yourself. If the problem isn’t present in Firefox, its probably something unusual. More often than not, I find that extra margin between two elements, where margins are explicitly set to zero, can be the result of a bordering child in one of the elements setting margin and pushing the parent’s sibling away. It is NOT supposed to do that but we’re talking about some pretty complicated rendering based on competing scripted rules and behaviors and sometimes one rule causes a little hiccup. I almost always find that I can modify how I am spacing child elements so that FF and IE behave the same.
I am proud to say that I don’t believe I have any browser specific "hacks" in my css at this time. I have certainly had to make some adjustments to accommodate browser weirdnesses but these I can live with.
If you just downloaded FireBug, go mess with the Edit Html feature and the css real time modifications. Soooo cool. If you don’t have it yet, choose a career that does not involve web development. You are only causing yourself unneeded pain
Posted in Programming | No Comments »
November 5th, 2008 Rusty
As a follow-up to my post on whether to choose Vista or XP for VMWare Fusion, I thouht I’d add this.
Lunch time, er, Launch Time
I didn’t time it scientifically but I definitely noticed. I had booted my Vista VM and was frustrated by how long I had to wait. I went and got a drink, came back, walked around a bit, checked again, got the mail, fed the dog, and finally, Vista was ready to use.
Then I realized I needed to launch my XP image to check in the changes I’d not yet committed to Subversion. XP launched in about 30 seconds.
One more thing to consider if you shut down when you are done.
p.s. If you use an external drive for VMWare images, always shut down or completely suspend before shutting down the host. Nasty things happen if you don’t. Of course, on occassion, you may get Vistaed on shut down so plan ahead.
Posted in VMWare, Vista | No Comments »
November 5th, 2008 Rusty
I have been using VMWare Fusion on the mac for 8 months or so. Overall, I am extremely happy with the performance and capabilities is gives me. Obviously, running windows on a Mac while also using Mac native apps is a given. However, I also value the isolation it provides to my Windows installation and the flexibility it provides for managing and maintaining my Windows (virtual) machine. Each time I think I would be better off running Windows off the bare metal, all I have to do is peek my head around and watch my dev counterpart, Bill, and his Toshiba running Vista… 8 times out of 10, there’s a spinning blue disc where his mouse icon should be. 2 out of 10, he’s getting Vistaed.
VmWare Considerations
First things, first. If you are planning to run VM, you need space. Unlike a real computer that manages memory judiciously, virtual machines have to hoard it, keep in on one place, and use it in ways that physical machines do not. In return, you get the ability to copy a computer from drive to drive. You can archive an entire machine onto an external device for safe keeping. You can modify it, roll it back, branch it, etc. That’s coooooool.
Hard drive: You need hard drive space. Get as much as possible. Most people recommend using an external harddrive for your VM image. I only recently started doing this for reasons I’ll explain in a minute. I found that my MacBook Pro with a 180G 5400rpm HD was more than fast enough to give me excellent performance with just the internal harddrive. However, that is not very much space when you start adding entire computers to it.
I recently purchased a 500G external portable from Costco.com. It rocks. I purchased that to replace my 160G of the same brand. More on that shortly.
Get no less than 500G. Seriously. If you are going to use an external drive, don’t screw around. I recommend a TB. Here is a SimpleTEch, USB 2.0, bus powered, 1 Terabyte, 7200RPM drive for $150. It’s the model I have but twice the size. I needed mine in a hurry. I wish I’d gotten that instead.
Memory: Max it. Think of VMWare as a mafia henchmen who, when asked how much it cost to save your life, he replies, "how much you got?"
I have 4G in my macBook. I am reading that people have gotten 6 to work. I am probably going to upgrade soon. While I can run one VM and all my necessary tools with 4, I get a little crippled when I fire Adobe Illustrator up while my VM Vista is running. XCode? fuh-get-about it. Xcode is a pig. I can run XCode and one other app. That has nothing to do with VMWare. If you are thinking of developing an iPhone app that connects to Asp.Net, you need all the ram you can slam into that board.
XP or Vista, man, get to the point
Here’s the deal. Vista is prettier. You can hack your XP theme to look a little like Vista. The difference is subtle, but not negligible. Vista with Visual Studio on it is going to require at least 40 Gig of space just for the guts. The same thing using XP? 5 Gig. There’s the single, biggest deal maker for you to worry about.
If you are not hard drive constrained and you have a license for Vista, use Vista. You get IIS 7, no BSOD, a supported OS, up to date driver and hardware support, etc.
If you have limited hard drive space, or you rarely use the image, use XP. You’ll have the challenges of IIS 6 and I have gotten the BSOD once for no apparent reason (although that Vista theme hack could have something to do with it).
What you won’t get, as of this writing, is Vista Aero. I have been wating for that gem to come down the pipe but it must not be a VMWare priority. The only thing I really miss is that cool window rolodex thingy. I could give a rats patooty about window bar transparency.
VM Maintenance
I don’t use snapshots. At least not intentionally. I preder to copy my VM Image to a safe place when I have just cleaned it up and made it archive ready.
Here is a great post about how to shrink your VMWare fusion disk image
NOTE: the catalyst for this post was that I messed up my Vista VM following that recipe. While I ran SDelete, my disk ran out of space.
Running SDelete will require that you have free disk space larger than the disk image you are cleaning. So, if you VMWare Vista image has creeped up to 60 Gigs, and it WILL, you need more than that free.
After SDelete failed to complete and I had to force quit Fusion, I had to dig into the VMWare Image Package to delete the state file so I could launch the machine. This, fortunately, recovered the VM but it left a bunch of orphaned snapshots in the package. Now my 60G image was now 90G! Argh! I tried to deleted snapshots using the menu option in VMWare but this failed. Same issue. Deleting snapshots requires that you have enough space to double the image size. VMWare will consolidate the images by writing 1 new image that includes the result of combingin all the snapshot images, discarding chane deltas.
Running Delete Snapshots will require that you have free disk space larger than the disk image package you are cleaning.
So… all this being said. If you plan to run Vista and use it like a rented mule, you need 200 Gig dedicated to that image. Why 200?! Because you might get lazy, like me, and let your VM become bloated and then wish to clean it up. At that time, you might, like me, be sitting on a 90G iamge that could be 35 fully optimized. In order to get your space back, you need working space.
A little XP Nostalgia
While I labored though that space turmoil, I ran and enhanced my XP image. I’d started playing with it a while back but continued using Vista as it was snappy and reliable. During this whole fiasco, I couldn’t use my Vista VM so I fired up that XP image and worked with it. I’ll say that it reminded me of going from an Acura TL to a Honda Accord. They are both nice cars. The latter is stripped down a little but much more fuel efficient and definitely less expensive. The former is at the same time more powerful and less reliable (at least my TLs have been less reliable). I intentionally did not install everything I usually use on XP so that my image would remain lean and portable.
During this exercise, I discovered some things I could do to make my everyday development experience much more performant. In light of getting back to productivity, I am going to end this post with the following:
Keep you image small, install what you need, make frequent backups and get as much memory and storage as you can afford.
Posted in VMWare, Vista | No Comments »