December 4th, 2008 Rusty
Holy CRAP!
I tried to commit my changes to svn and was greeted by a very distressing message: “cannot delete lock, the directory is corrupt or unreadable”.
I tried a few hacks to get around it but apparently my trunk was littered with these unfortunate locks. I have no idea what this means at a low level except that either Windows or Svn(or tortoise) took a big fat dump in my directory
Google to the Rescue
As usual, Google turned up forums where people had the same issue. The only suggestion was to run chkdsk on the drive. One person reported success using a utility called “unlocker” but indicated that the program ran chkdsk. Ok, how do you do that, exactly? in VMWare?
Running Chkdsk under VMWare Fusion
Turns out its really easy. Bring up a command line and type “chkdsk /R C:”. You’ll be told the volume is currently in use and asked if you’d like to run chkdsk the next time Windows is restarted. Answer “Y” and then reboot.
During step 2 of 5, chkdsk reported 15 variations of “Deleting index entry lock in index $130 of file 38956″. That sure sounds like my problem. I hope it is because step 4 of 5 takes forever. It might be wise to use the commandline switch that tells chkdsk to do a less vigorous check of files. I didn’t so I am waiting…
Vista to XP to Server 2003
I started using Vista on this computer and finally just couldn’t take the slowness anymore. I switched to XP but soon realized that all the locked down features were getting in my way. I am now developing on Windows Server 2003 and until today, was very, very happy. Now I am waiting to Windows to do its funky chicken dance, yet again. At least Server tells me what it is doing while I am unable to get my work done. Vista wasn’t nearly so communicative. Its like having a good friend who always says that really offensive thing at the most inopportune time. 90% of the time, you are having a good time. Every now and then you’d like to kick him in the teeth.
hey, thirty minutes later and its done!
..and the verdict is: (waiting… waiting… waiting… ugh! still waiting… FIXED
Posted in VMWare, Windows | No Comments »
November 22nd, 2008 Rusty
When I read Apple’s article, I found it to be completely invalid. This article is at least accurate. However, assumptions are made that you know what they hell they are talking about. This post helped me quite a bit to understand what that “.gdbinit” file is and how to fix my mistyped “echo ” >> .gdbinit”Moving on, then…If you are a ruby fan, Dr. Nic rocks the down under. I started with this but tried to organize my class directory structure and messed up compatibility. Additionally, I am learning ruby so this was stacking a learning curve on top of a learning curve which created some sort of twisted double helix inverted unto itself. So for the less skilled who want everything in a single esoteric language (Obj c), XCode ships with OCUnit. Unfortunately, setting it up is similar in complexity to cloning hairless cats in the presence of a pitbull so there is a nice helper project from, who else, google.I had a couple of confusing points (more than usual) so I will share for other noob’s benefit.read wiki tutorial: iPhoneUnitTesting Where the HELL is the build log?
Successful… Wonderful. WTF is the build log? Click on the word “Successful” down thar at the bottom of the project window and you’ll get
Hmm, still no “build log”…Hey! That bar between the Editor and the Overview has some buttons. Start mashing those maybe?
There’s our huckleberry!Now you see this:
And there’s the line I was looking for: Executed 0 tests, with 0 failures (0 unexpected) in 0.001 (0.001) secondsTwice, no less!Awesome… Two days lost trying to set up testing but that will be earned back ten fold as this app moves from learning experience with relatively exciting product to truly engaging, innovative exploitation of revolutionary technology�
Tags: OCUnit, XCode
Posted in iPhone SDK | No Comments »
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 | 1 Comment »
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 | 1 Comment »
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 »