Tuesday, March 25, 2014

Telerik UI Designer Fix for Asp.Net Ajax

Having trouble with Telerik UI in design mode (btw, I don't usually even look at web form pages in design mode anymore, but some still do).  If you get some weird stuff happening, this might be your fix.

Go to whatever visual studio version you are using and open the visual studio command prompt in admin mode (right click the shortcut, run as administrator...the command prompt might be named something slightly different depending on what version of VS you are using).

Then copy / paste this into the command prompt (changing this slightly for whatever version of the .net framework telerik version your have installed, if you have multiple versions installed do this for each one). Also note depending on what version of the Telerik controls you have installed, you might have to change the "UI for ASP.Net...." path to whatever path your telerik bin lies in.

 gacutil /i "C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX Q1 2014\Bin40\Telerik.Web.Design.dll  

I hope this helps someone, credit goes to my boss for finding this.

Sunday, March 16, 2014

Software Tip: HWMonitor from CPUID

In the process of upgrading my laptop's hard drive I had noticed that my machine was running a little hotter than it should be.  In the process of trying to diagnose why I found this little utility for Windows machines called HWMonitor, which comes in a free and pay for version.  It gives you nice real time stats on voltage, temp, and wear and tear on your laptop's battery.


Samsung SSD 840 EVO 250 GB Upgrade

Update! See gotcha at the end.

Why the Upgrade

So I have been putting my laptop through it's paces.  It is on about 14 hours a day 7 days a week.  I think on several occasions I've packed it up and accidentally left it on.  I recently noticed the hard drive start to "click".  I ran some utilities on the hard drive and everything came back as the drive was healthy, but I noticed my drive starting hang coming out of sleep mode.  Rather than take the risk of being down for a while, I decided to install a new drive.  I selected a Samsung SSD 840 EVO.  I didn't want to spend too much money so I went with a 250 GB model, which I now kind of regret.  I wish I would have ponied up for a 500 GB version, but that is what I get for being frugal.  I believe Seagate makes a hybrid SSD drive that cost a lot less per Gigabyte that might be worth looking into.  I went vanity and wanted to get a full SSD though.

Why the Samsung SSD 840 EVO 

  •  Samsung had the lowest failure rate (from the data I could find) out of all the manufactures.  I also saw some videos online about the predicted failure rate of this SSD was into decades even with heavy use per day.
  • I've had great luck with Samsung products in the past.
  • The drive came with some cloning software.
  • The drive came with a mounting kit for desktops (in the future) and a USB 2 to Sata cable.
  • I couldn't afford the pro version, but both versions had very fast read and write rates compared to other SSD's.
I paid a little bit more (about $50) for the Samsung but with the cloning software and USB 2 to Sata cable I figured the price was about even.

Upgrade Walkthrough

  1. I backed up all my critical data (just in case) on both an external and a flash thumb drive
  2. Install the included software (one gotcha, the "Samsung Magician" software seemed to hang at the end of install, but I reinstalled it and everything was fine).
  3. I plugged in the Samsung SSD to a USB port.
  4. I fired up the cloning software.  Essentially you hit start, click a few things, and then let it rip.  The first time I ran it it seemed to hang and I got impatient and cancelled.  I rebooted and ran the "Data Migration" (the cloning part of the software) again and it hung at the same spot.  I let it run this time and eventually the cloning completed (A little over two hours for about 196 gigs).
  5. I shut down, swapped the SSD for my current hard drive, then rebooted.
  6. The SSD did not boot as it said there was a boot error on boot up.  This had something to do with Windows 7 copy protection.  So I found a Windows 7 install disk and booted off it, and ran repair.  That took about five minutes and then I rebooted.  This time the SSD booted normally.  Done!

A Few Gotchas and Suggestions

  • If you can afford it, get the 500 gig version if you are on the fence.  I ended up getting a 128 Gig USB 3.0 drive to keep some of my junk files in, I realize now I should have just got the 500 gig version of the SSD.  Oh well.
  • Buying a Sata to USB 3 cable (comes with some drive enclosures I think) the cloning can be done probably a lot faster.
  • You do need a Windows install disk if you are using modern versions of Windows so you can run the system repair after cloning the drive.
  • Before cloning the drive, I would remove all the junk you can off your drive (delete or move to external) so the cloning will go faster (if using USB 2).
  • I originally tried to clone the drive with 230 gigs, the cloning software said that was too large.  So even though you are buying a 250 GB drive what you can clone is probably closer to 200 gigs.


Is my computer faster now?  Yes.  It boots up faster, and applications load faster compared to my old 5400 RPM drive.  I haven't done any heavy 3D rendering, gaming, or video editing yet so I can't really say how much faster doing that with an SSD vs a 5400 RPM hard drive is. My laptop is a lot quieter now (though some of that is due to me blowing out the fan duct).  As far as battery life, I would expect to gain a little but my batter is in pretty bad shape so I can can't accurately say.  Make sure you have a Windows install disk (you probably need the same Operating System version, but not necessarily the same version (I fixed my boot problems on my 64 bit Windows Home Premium laptop using a Windows 7 Ultimate DVD).  I will say this, I was dreading having to rebuild my machine from scratch, the cloning was sure nice.  Sure, on Windows boxes the conventional wisdom is that you need to rebuild your machine every year or two anyway, but I've had this laptop for two years running Windows 7 and it seems to be doing fine, so that cloning software sure came in handy.  Sure you can buy Norton Ghost or try to use Clonix, but the Samsung Data Migration software was nearly idiot proof and worked well.  

I am happy, I just wish I would have gotten the 500 Gig drive. Check out the Amazon prices.

Samsung Electronics 840 EVO-Series 250GB 2.5-Inch SATA III Single Unit Version Internal Solid State Drive MZ-7TE250BW

Samsung Electronics 840 EVO-Series 500GB 2.5-Inch SATA III Single Unit Version Internal Solid State Drive MZ-7TE500BW


One important note.  You will have to turn on system restore auto saves on your new cloned drive!

Saturday, March 15, 2014

Software Tip: Clonezilla

I've had really good luck with my latest HP laptop...but I did a few stupid things with it and now the hard drive is occasionally "clicking" and becoming unresponsive, a bad sign.  So I decided to get a new drive.  In the process of researching I found an open source alternative to Norton Ghost called Clonezilla.  Some of you might find it useful.


Thursday, March 06, 2014

India and China Dominate World Programming (By Search Term Anyway)

I decided to go on a rampage and do gather some Google Trends data over the last year on keyword searches related to programming.  Globally this is what I found-

Search Term Top 3 Cities Globally
ASP.Net New Okhla Industrial Development Area, Hyderabad, Gurgaon
SQL New Okhla Industrial Development Area, Gurgaon, Hyderabad
C# New Okhla Industrial Development Area, Hyderabad, Chennai
MySQL Beijing, New Okhla Industrial Development Area, Shanghai
iOS Singapore, Ho Chi Minh City, Hanoi (San Francisco 6th, New York 9th)
Actionscript Beijing, Seoul, Saint Petersburg (San Francisco 9th)
Android Tehrān, Jakarta, Surabaya
Java Bangalore, Hyderabad, Chennai
Microsoft SQL Server New Okhla Industrial Development Area, Gurgaon, Hyderabad
Photoshop Manila, Ho Chi Minh City, Surabaya
javascript New Okhla Industrial Development Area, Beijing, Hyderabad
Node.js Beijing, Shanghai, Seoul (San Jose 4rth, San Francisco 5th, Seattle 7th, Austin 8th)
AngularJS Beijing, New Okhla Industrial Development Area, Shanghai (San Francisco 4th, San Jose 7th)
PHP Dhaka, Ahmedabad, Chennai
C++ Beijing, Shanghai, Bangalore
HTML5 New Okhla Industrial Development Area, Hyderabad, Chennai

What does this mean? It means to me that most of the world's programming is being done in India and Asia. I no longer think this is due to outsourcing from the West but I'm sure that plays a big role. In my book the future will always belong to those who have the skills and know-how to make things happen. If Google programming search term trends are any indicator, the future is belonging to India and Asia more and more. I also compared some base programming languages to each other to see how they stacked up as far as traffic.

From the data Android OS programmers in India will rule the world :)

Wednesday, March 05, 2014

Web Forms: Radio and Checkbox List Javascript Selection / Checked Manipulation

Yes, I know web forms aren't cool and all the hip kids are using MVC. Some of us are stuck enhancing existing applications (I don't want to call applications that bring in 100's of thousands of dollars "legacy").

Anyway, here is the scenario.  I've got a checkboxlist control.  I also have a radiobuttonlist with two entries, "All" and "None".  When I click on the radiobuttonlist I want to either check all the items in the checkboxlist control or uncheck all the items in the checkboxlist control.  I also wanted the checkboxlist control set so once individual items are checked the two options in the radiolistbuttonlist to be deselected / unchecked. I'm using Telerik controls so I can use a limited subset of jQuery, so I used it.

Step 1: Code Behind

On my page load I did this-

     ListItem lst1 = new ListItem ( Classes.Utility.Translate ( "AllLabel" ), "A" );  
     ListItem lst2 = new ListItem ( Classes.Utility.Translate ( "NoneLabel" ), "N" );  
     lst1.Attributes.Add ( "onclick", "SetClear(true)" );  
     lst2.Attributes.Add ( "onclick", "SetClear(false)" );  
     rdoOptions.Items.Add ( lst1 );  
     rdoOptions.Items.Add ( lst2 );  
     chkList.Attributes.Add ( "onclick", "return ClearRadioButtonList()" );  

The translate stuff don't worry about.  Just the way I do translation on the fly (for another post).  Note if you set the onclick event for each item or for all items by setting the onclick for the control rather than the items.

Step 2: Client Side

Here are a few Javascript functions I added-

  function ClearRadioButtonList() {  
     $("#<%= rdoOptions.ClientID %> input[type=radio]").prop('checked', false);  
    function SetClear(b) {  
     $("#<%= chkList.ClientID %> input[type=checkbox]").prop('checked', b);  

And it works!  I hope this helps someone.  These two pages were helpful to me figuring this out-