Tuesday, February 05, 2008

Visual Studio Context Menu - The Himalayas of Menus

This is just ridiculous:

Vs-context-menu

I could seriously eliminate about 10–12 items from there and never miss them again.  For the others that I use occasionally, they would be better served on a top menu, not when I right-click.  All of the source control things should be grouped in a sub-menu or something, because this thing is just way too crowded.

Any way to control this chaos?

Saturday, January 12, 2008

Visual Studio 2008 CSS Support - Not Quite

One of the often-touted new features of VS 2008 is the improved CSS support.

I like having intellisense for CSS, sure, but I dont’ want to have a warning for classes that don’t exist…. like this:

Vs2008-css-warning

That green squiggly indicates a compiler warning.  It can’t find the CSS class, (which is referenced in the Master Page). 

But there are other reasons why you might want to define a class without defining an associated style.  You might be using it to distinctly select elements from the DOM using javascript. 

The ever-so-awesome prototype framework introduced this syntax:

$$(‘.info’)

which would select all of the elements with a class name of “info” for you to work with.

Just about every other javascript library out there now supports this syntax (or a similar one).

If this bugs you, you can turn it off by checking this box (in Tools -> Options) :

Vs2008-turn-off-html-errors

You may not want to do this, though…  it could potentially save you time if you’re looking for a rendering bug.

Another part of VS 2008 that I don’t really care about is this CSS designer.  I can’t imagine anyone who would actually use this.

I mean, come on… look at it!

Vs2008-css-builder

I guess if you don’t know CSS very well, you might want some options.  But that form is more confusing to me than border-top: solid 1px #999;.

(and one could argue, if you don’t know CSS, should you be defining styles at all?)

I really applaud Microsoft’s attempt to bring a better CSS development experience to the masses, but I think they missed the mark on this one.

Thursday, December 20, 2007

What I do

Looks like a new blog meme is starting…  I was tagged by my good friend Shey who’s wanting to know what we all do. (sorry it took me so long to respond!)

So…  what would you say… you DO here?

Office-space-what-do-you-do

Well, I’m a consultant, so my role sometimes changes.  Currently I’m a lead developer for an energy company, involved in a Lotus Notes to .NET Migration.

There are roughly 80 applications, some targeted for SharePoint 2007, some custom ASP.NET, and some Windows Forms.

We decided to use SubSonic for data access.  Most of my readers know that I’m a DDD bigot and prefer persistence ignorant business entities and yada-yada-yada.  But sometimes you just have a simple domain model and there’s no reason to go into the effort of introducing NHibernate on a team that’s unfamiliar with ORM’s in general.  (NHibernate just has too steep of a learning curve).  SubSonic shines with simple domain models, and it allows us to be very productive very quickly.

In retrospect I think I would have favored using Castle ActiveRecord.  We wouldn’t benefit from code-gen unless we made some custom templates for CodeSmith, but the main point would be that we can decouple the database from the application code.  It turned out that some database naming standards were in place that favored very common abbreviations for just about any type of database column.  This resulted in polluting our object model with poor names and I implemented a cheap work-around using partial classes and vanity properties.  But the stink is still present .

We’re also using Team System, which is a less than desirable experience in my opinion.  TFS SCC is okay, but it’s no Subversion.  We do our database development with DB Pro and I’ve found that to be both a blessing and a hinderance.  I’m starting to realize that with all of this tooling that MSFT is selling, a better experience can be had with a bit of patience, process maturity, and some open source software.

Where’s all the good info on DB Pro anyway?  All I’ve found are press release/feature list blogs and links to marketing material.

For testing we’re using MSTest, and if I had it my way I’d rip it all out and replace it with NUnit.  MSTest is more annoying than its worth, and we’re not using any of the build quality features anyway, so we wouldn’t be missing out on anything.  I use TestDriven.NET so I never even see the VS Test Runner.

For the build process we use NAnt, but we haven’t setup continuous integration.  Why?  Frankly because I haven’t had the time.  (I can hear the argument that I don’t have time NOT to already).  I have targets setup to build up the database (both incremental and from scratch), generate code with SubSonicCommander, compile all of the source and run the tests.  Continuous Integration is the next logical step, and I hope I can implement it soon.

In summary, here are the tools, frameworks and libraries that I’m using:

  • SubSonic
  • NAnt
  • WCF
  • VSTS 2005 + DB Pro
  • TFS Source Control
  • Prototype / Scriptaculous (for most ajax and dhtml stuff)
  • ASP.NET Ajax / Control Toolkit (for UpdatePanel and the Calendar)
  • MSTest (yuck)
  • Enterprise Library Logging
  • RhinoMocks
  • TestDriven.NET
  • Console2!

To get this thing spreading like wild-fire, I’m going to tag…

Jason Meredith
Evan Hoff
Bil Simser
Justice Gray (keep it professional Justice!  No weekend details!)
Peter Seale

…get to it guys!  What do YOU do?

Tuesday, December 11, 2007

Google Launches a Chart API

Google recently released a URL API for charting.

What's a URL API, you ask?  Well you open an image to a specially formatted url, and google returns you a chart.  You can do some pretty amazing things with this API.

Check out these samples:
       

The last one was created with this url:
http://chart.apis.google.com/chart?cht=p3&chd=s:Uf9a&chs=200x100&chl=A|B|C|D

The urls are a little bit cryptic as you can tell, but this allows you to use one source for charting regardless of your language or platform.  A .NET wrapper is sure to spring up in the next couple days that will allow you to take advantage of this API with a more structured format.

Update:  Boy did I underestimate the community.  Chris Pietschmann already created an ASP.NET 2.0 Server Control to leverage the Google Chart API in .NET.

I'm wondering how they are able to handle all of this.  Not only is it a lot of traffic to handle (but they're obviously pros at that by now) but it takes a significant amount of CPU cycles to generate a graph like that on the fly.  How do they keep their response times so quick?
 

Friday, October 05, 2007

SubSonic Gives Us Migrations

SubSonic, a dead-simple code-generator / ActiveRecord ORM tool, is about to release a kick-ass new feature.  Migrations are an awesome tool that exists in Rails, but we haven't had a solid .NET equivalent yet.  I hope that SubSonic Migrations will live up to the hype.

I've blogged about the need for this before.  I've been wanting to use VSTS DB Pro in this way, but the tool just isn't meant to provide evolutionary db support.

My current project relies on SubSonic for the code-generation, but our database development is done through DB Pro.  I think this is a great tool, but I fear that it's really missing something.  I'm sure the next version will be much better, as is generally true with Microsoft products.  1st versions often take some time to meld, get some good feedback from the general public, and get the usage stories streamlined.

I may be able to take advantage of Migrations, however the DB Project needs to contain all scripts (and they have to be named according to the client's standards).  I wonder if I could create the migrations, execute them, then use sonic.exe to generate the scripts that represent the changes.  I could dump this script in the database project (or import it).

Right now it seems like a Rube-Goldbergian mess.  Any thoughts, ideas, suggestions?

Tuesday, October 02, 2007

Replacing Notepad with Notepad2 on Vista

I hadn’t ever gotten around to replacing Notepad with the most-excellent Notepad2 until today and realized that the method outlined in my older post doesn’t work in Windows Vista due to heightened security.

To replace it on Vista, follow these steps:

  1. Download Notepad2 and put it in a folder somewhere like C:\tools\Notepad2
  2. In Windows Explorer, navigate to C:\Windows\System32
  3. Right-click on notepad.exe and go to Properties
  4. Under the security tab, click Advanced.
  5. Change the owner to MACHINE\Administrators
  6. Close and re-open the properties box.
  7. Go back to the security tab and click “Edit”
  8. Give the Administrators group Full Control over the file.
  9. Now go to a command prompt and type this:
    copy c:\windows\system32\notepad.exe c:\windows\system32\notepad.exe.old
    copy c:\tools\notepad2\notepad2.exe c:\windows\system32\notepad.exe

Voila!  Now you should be back in business.

Now I’m back to wondering why they didn’t just make Notepad better in the first place…

Wednesday, September 19, 2007

Using UserAgentSwitcher to Access Members Only Sites

Ever gone to a site that you found via google that seems to have the EXACT answer to the problem you are looking for?  Then you click on the link and you are shown a page that basically says "You must be a member to access this article."

I can't stand sites like this.  In addition, they are in clear violation of Google's TOS, and they should get dropped from indexing unless the open up the content. 

Why are they in violation of Google's TOS, you ask?  Well basically they are sniffing for googlebot (or any other web crawler) and serving up real content to them.  The data gets indexed, the site's PageRank goes up and the site starts showing high up in the google search results.  But when you or I access the page, we get a different page, telling us that we should pay them money to see the content.

So if you want to give these sites a big middle finger, go download the user agent switcher Firefox extension.  Then add the googlebot useragent to the list.  You can get a huge list of commun useragents here.

Now, find a site that blocks articles to non-members, such as this one:



Change your user agent like so....



And refresh.  Voilà! you're in!


Sunday, August 26, 2007

HoustonTechFest 2007 was a Hit

Houston Tech Fest 2007 was yesterday and it was an amazing success.  Over 600 people were present and I was able to see a lot of old friends and meet some new & interesting people.

I got to chill out with Brad Abrams and a few other folks from Microsoft, and it was great to meet Scott Bateman (fellow Houston blogger and advocate of Continuous Integration).  His talk was most excellent, he was very informative and it showed that he not only understood the concepts, but he was able to explain it all in a way that (I thought) was easily grasped by the audience.

Some of the other speakers included Mike Azocar, John Cook, Tim Rayburn (sorry I missed your talk again Tim!), and David Walker.

Funny thing about Tim’s talk.  I was in the room next door listening to David Walker talk about SOA and WCF, and we could hear Tim through the wall partition.  At one point I heard Tim say, “If you can’t hear me in the back, please shout out and let me know.”  I felt like shouting from our room .

I had two sessions, Advanced CSS & Javascript and ORM with NHibernate.  In the first session, I had a full room (over 100 people!) and the audience was very engaging.  It’s great to have an audience that has so many questions and comments on what you are saying.  It becomes more of a dialog, which I think makes the content so much more valuable for everyone. 

Sometime in the midway point of the talk the projector just turned off.  It’s hard to give a talk on CSS without some visuals, so I continued typing and said “Imagine if you wil…” to a room full of laughter.  About that time the projector turned on again.  I didn’t find out until later, but my friend Wes had sat on the cord and unplugged it, then silently plugged it back in.  Funny how a room full of geeks and nobody thought to check the plug when it turned off.  Ah well.

At the end of the talk I had a couple people come up to shake my hand and a little 4–year old girl came up, touched my arm, then ran away giggling.  (Don’t ask me…).  I really enjoy giving this talk and I would like to branch outside of Houston and start giving it elsewhere around Texas (and the U.S.).

My second session was on NHibernate and it was more cozy, with only 15 people or so.  I think NHibernate is a lot harder to make interesting for an intro class because it is a radically different way of developing applications that most people are exposed to.  There is so much material to cover and only a short amount of time, so I tried to focus on the code and keep the examples short and simple.  I think it was effective, though I’d like to branch off this talk and start giving more advanced lectures on NHibernate.

Thanks to all who came to the event (especially my sessions!).  I hope you all had as much fun as I did.

The files from my presentations can be downloaded here:

File Attachment: AdvancedCSSAndJavascript.zip (1161 KB)

File Attachment: nhibernate.zip (4001 KB)

Also, a lot of people were interested in the tools I was using during my demos.  My favorite text editor is E, which you can get at http://www.e-texteditor.com.  My zooming tool that I use is called Zoomit.  My launching utility is called Launchy and it saves me so much time everyday.  I use ReSharper for Visual Studio nirvana (seriously, get this tool).

Some links I mentioned at the talks:

http://www.csszengarden.com

http://www.exploding-boy.com

http://www.mochikit.com

http://www.prototypejs.org

And finally, my favorite CSS book that I keep recommending to everyone:  CSS Mastery.

Thursday, August 23, 2007

e - Text Editor - no such file exists -- ubygems

There's no doubt that e kicks ass.  On one of my computers, however I was having a problem using some of the bundles.  Specifically some of the bundles utilize cygwin to do their magic.

I was receiving this weird error, where ruby is complaining that it can't locat a file named "ubygems".  Obviously, they are referring to rubygems, and the problem exists when you have a windows install of ruby and a cygwin install of ruby.

To fix it you need to reinstall ruby gems within cygwin.  Download the latest version of rubygems from rubyforge.  Put the tarball in the c:\cygwin\home\USER folder, then open up your cygwin prompt and type:
$ tar -x -f rubygems-0.9.4.tgz  (this will change if you download a different version)
$ cd rubygems-0.9.4
$ unset RUBYOPT
$ ruby setup.rb

At this point rubygems should be installing and you should be good to go.  Back to "e goodness"!

Wednesday, August 08, 2007

e Goes Gold

My favorite text editor for HTML, CSS, JavaScript, Ruby/Rails, etc development just announced its 1.0 stable release.  The beta versions were very good and I rarely ran into issues.

If you aren’t using e, you should check it out:

e

If you’re like me and jealous of the Mac crowd who gets to use TextMate ( /drool ) then this is the best alternative for Windows.  (I hear there is a Linux version coming soon).

But if you’re not privy to what coolness awaits you, allow me to tantalize you with some e-excellence:

  • Keep looking up the exact doctype syntax?  Type doctype<TAB> and a context menu appears allowing you to select your doctype (XHTML 1.0 Transitional for example).   (And you should be using a doctype header).
  • Type head<TAB>, it creates the header section for you, places the cursor right where you put the title, press <TAB> again and you're ready to enter scripts and style sheets.
  • Want more? Try link, style, body, div, table, ul li ... the list goes on.

These are just the HTML bundles. There are a crap-ton of bundles that already exist for TextMate, and they are supported with e.

So head on over to http://www.e-texteditor.com and pick up a trial copy. If you like it, consider buying it. The time you save will surpass the measly $35 you spent in no time. time.

Tags: