Hola!

Mostly Technical

Staying Up-To-Date Is Hard Work (But Fun)

I was watching an online training video yesterday and found myself agreeing with everything that the presenter was saying.  The online video is provided by Pluralsight and the name of the course is "JavaScript the Good Parts" presented by Douglas Crockford.  Mr. Crockford makes it clear, at least to me, that writing software is hard work; and I couldn't agree more.

Recently I been trying to update my skills to include modern web and mobile development.  Now, I say modern web because I've been doing web development for years but never fully understanding and applying the separation of concerns that are provided with HTML5, CSS3, and JavaScript.  And, not until recently have I been concerned with my websites being responsive.

Getting up to speed with the newest incarnation of these technologies and methodologies is taking me longer than anticipated, and it definitely takes work and effort to get it right.  But the satisfaction of getting it right once in a while or solving a problem makes it all worth the effort.

So how does "Hard Work" === "Fun"?  The only way that I can explain it is by comparing it to the joy of ridding a bicycle 60 miles without stopping (something I do once a year at a family event): it's hard and painful but at the end the feeling of accomplishment makes it all worth the while.

SVN to TFS 2012 (Migration)

I have been using SVN at work as a version repository for many years now.  Recently it was decided that we are going to use TFS 2012 and that our projects needed to be migrated from SVN to TFS preserving as much history as possible.  So I started my research by searching the internet’s most common forums for technical questions.  Here is what I found and how I did it:

1.  Install an SVN server and point it to your SVN repositories.  I had to do this because our repositories are all files based.
2. Install Git and migrate the SVN projects to git repositories.
3. Install Git-tf and migrate the git repositories to TFS 2012

At the end it all sounds as simple as following a three step process – which it is – but the reality is that each of the steps can be a project within itself.   I documented the process and if you are interested in finding out how I did it, you can download the PDF file of my notes. 

SVN2TFS.pdf (80.41 kb) 

Enjoy…

Thinking About Tomorrow

A friend of mine just sent me the following email and I want to share it because I know that there’s plenty of truth to what she’s saying:

Funny thing at work: we’re always implementing solutions for today, never tomorrow.  And to make things worse we're using yesterday’s technology.  Maybe it’s just me, but I read a lot of blogs, technology news, Q&A forums, and can’t help but notice that my experience is not unique.  There are plenty of people still having to deal with Visual SourceSafe, Internet Explorer 8 and older, XP operating systems, Access Databases, old versions of SQL Server instances, legacy applications that have to be maintained and updated using old versions of IDE tools, the list goes on and on.

But to my defense – and in defense of my coworkers – it’s not entirely our fault.  We “really” don’t want to work with old technology, outdated tools, and we certainly don’t want to update and maintain legacy code.  We (I think I can speak for most) much rather be working with TFS, Mercurial, Git, or SVN for software versioning; rewriting old solutions using modern frameworks; and designing responsive and mobile websites/applications.  But the attitude of those in leadership positions is: we don’t have time for doing things right – maybe not with those exact words, but the message is the same.

If there is any consolation in knowing that we’re in the same boat as many other software developers in the world then we are comforted.  But I’m not.  I keep on thinking about tomorrow and read, practice, and learn new things.  Maybe tomorrow my supervisors will see the light.  And when that happens I’ll be ready.

Just saying…

SQL CE and EF 5.x Code First Approach

I needed to create a solution for a demo project hosted in the cloud (web). Visual Studio has some very nice templates for doing some RAD solution but I was determined to use SQL CE for reasons that I won’t get into at this moment. I also won’t get into the discovery process of how long or how hard it was to figure it out. I’ll just say that I hope to save somebody some time and effort by posting my final approach. Here are the steps:

1. Create an empty MVC4 project (it doesn’t have to be an empty project this was just quicker and simpler for me).

2. Install the NuGet EntityFramework.SqlServerCompact package

3. Add the following line of code to the Global.asax.cs Application_Start method:

    Database.DefaultConnectionFactory =
            new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");

4. Remove the ConnectionString section from the Web.config file (if it’s there – had different results with VS2010 and VS2012).

5. Create the class that is going to be used for the creation of the database and schema (I created mine inside the Models folder). Here is the one I used for testing:

public class Comments
{
  [Key]
  public int ID { get; set; }
  [Required]
  public string Message { get; set; }
  public string Date { get; set; }
}

6. Add the following using statement to the class just created:

    using System.ComponentModel.DataAnnotations;

7. Build the project

8. Right-click on the Controllers folder and select add controller option.

9. Give your controller a name. I named it CommentController

10. Select the Template: Controller with read/write actions and views…

11. From the Model class drop-down select model class created in step #5

12. From the Data context class drop-down select new data context

13. Give it a name. I named it CommentContext

14. Click on the Add button

15. Build and run your application. Add the view to the URL address. Example:

     http://localhost:11013/Comment

You should now be able to add, edit, and delete items to the SQL CE database. You can view the database and its contents by right-clicking on the App_Data folder of the project and selecting Add Existing Item, then selecting the database that was added to the App_Data folder. If you need to modify the database schema you can double-click on the database to open Server Explorer.

Windows 8–The Good Parts

A couple of months ago I installed Windows 8 beta on my three year old laptop that originally came preloaded with Windows Vista.  Having read many articles and blogs about W8 I wasn’t sold on the new operating system and decided to install it on a separate hard drive making my computer a double boot system and only booting into W8 once in a while to get acquainted with the OS.  Now that W8 has finally been released to the general public I upgraded my laptop and removed my W7 operating system all together – and couldn’t be happier.  Here’s why:

1.  My system boots up from a cold start in less than half the time it used to take under W7.

2.  When it's time to turn the computer off it shuts down faster.  And I mean a lot faster.

3.  The start screen is much nicer to look at than the W7 desktop and the live titles are: Alive!  I just don’t know how else to describe them.  I get live and real time information on many of my W8 apps such as Bing, News, Weather, Travel, Stock Market, Calendar, Mail, and the People app hooks me up with messages and events from my Twitter, Facebook, LinkedIn, and Live accounts.

4.  There are keyboard shortcuts for almost everything I need to do.  Some of the most commonly used by me are: Win+F (search files), Win+W (search control panel), Win+X (administration options), Win+C (charms, time and date, and battery status).  Check out the following blog for plenty more: http://www.hanselman.com/blog/Windows8ProductivityWhoMovedMyCheeseOhThereItIs.aspx

5.  To run and application such as Word, Excel, FileZilla, or any other program all I have to do is start typing the name of the application and it will magically appear on the screen.  If the application’s name is highlighted all I have to do is press the enter key or click once with the mouse.

6.  If I don’t remember the name of the application all I have to do is use the keyboard shortcut of Win+Q and the screen is filled out with the name of all installed applications on my computer.  All nicely organized with much better looking icons than what the W7 Start Menu provides.

7.  All of my previously installed programs (remember that I upgraded from W7) still work, and they all feel more responsive.

8.  Some cool W8 apps: Mail, Calendar, People, Messaging, Netflix, SkyDrive, Skype, and Photos just to name a few.

9.  And the best part: the cost of upgrading is only $39.99.  Don’t take my word for it.  Check it out: http://windows.microsoft.com/en-US/windows/buy

 

See yea,

Migrating WordPress and BlogEngine.Net Blogs

I moved my blogs from one hosting site to another within the Godaddy environment and found out that it was harder than I expected, but the end results were better than expected. The migration was harder than I expected because I was expecting to be able to just request that my blog site be moved from one hosting account to the other since I own both accounts. I soon found out that even though I owned both accounts the migration (or move) of my blogs required creating the blog, backing up the database, copying some folder and files by using an FTP tool, restoring the database to the newly created account, and finally tweaking the new blog site settings as needed; not a simple process.

After trying the migration process by following the instructions sent to me by Godaddy’s support and not managing to get the site up and running (probably my fault, and probably it was me doing something wrong) I decided to follow a different path for both of my sites and the results have exceeded my expectations. Here are the steps:

  1. Create the blog sites (one WordPress and one BlogEngine.Net)
  2. Backup the old site’s content and settings by using the export functions provided in the administrator section.
  3. Restore the WordPress and BlogEngine.Net content and settings into their respective blog platforms.
  4. Open the old blog in one browser window and the new blog in a separate browser window and ensuring that the settings in the new blog were the same as those in the old blog.

That’s pretty much it. The better than expected results are the following:

  1. Both blogs are now responsive. Meaning they display well when viewed in different platforms such as computer screens, tablets, and smart phones.
  2. Both load much faster than they did before; more so for the BlogEngine.Net blog.
  3. Both blogs look much better than they did before the migration; this time the WordPress blog comes out ahead.

I really like the fact that they are responsive and I’m especially pleased with BlogEngine.Net because it detects when the request is coming from a smart phone and it collapses the articles into buttons. Very cool.

10 Developer Tools and an Application Hosting

A little over a month ago Scott Hanselman compiled a list of what he considers to be the ultimate developer and power user tools for Windows.   You can read the list here: Scott Hanselman's 2011 Ultimate Developer and Power Users Tool List for Windows.  I came across his list a few years ago and I even created a shortcut to that list in my favorite’s folder.  Many of the items he recommended back then I have used and also recommended to coworkers and friends throughout the years.  Now the list is updated and I couldn’t be happier.  I already tried a few of the new tools he is recommending and would like to just take a minute to list those (in his list) that I use on a regular basis.

Paint.NET– I install this program on all my computers and it has become the De facto image processing tool I use whenever I need to do some serious editing.

7-Zip – Same as above for all my compressing decompressing of zipped files regardless of format.

DropBox – Best in its category and free.  Easy to install, works like magic, and the best feature: saves file versions.

Windows Live Writer – One application that helps me manage three blog sites.

Microsoft Web Platform InstallerSaves me a ton of time whenever I want to set up a computer for web development.

Notepad++ – Is what notepad should have been but is not. 

Fiddler – Whenever I need to know what is happening behind the scenes when debugging or simply running a website.

NuGet – If you are a .NET developer using VS as your IDE you owe it to yourself to look into this package management plugin.

TestDriven.NET – I used to use this testing framework until MS decided to block it from VS2008.  Now I’m using the integrated test framework that comes with VS2010 Professional.

TortoiseSVN and TortoiseHG and BitBucket – I still use the SVN app but I’m slowly transitioning to the Mercurial platform.

One that I did not see on Scott Hanselman’s list and that I would like to mention is:

AppHarbor – It is Azure done right.  Affordable Dot Net application hosting that integrates with BitBucket.  It is amazing!  Don’t take my word for it, try it out…

Adventures with DNN

Getting familiar with DotNetNuke is something that has been in the back of my mind since I heard it had been upgraded to 6.0 and had been completely rewritten in C#.  I first heard of DNN some four years ago from a coworker in charge of designing and creating websites.  Back then I did not entertained the thought of looking into the platform since most of my work had to do with backend programming – implementing the business rules to the solution. 

I again heard about it from another coworker about two years ago.  My coworker implemented a local DNN site on our network that we were using as a sort of bulletin board to share information regarding anything having to do with technology – mostly work related.  He made me an administrator to the site and I did some minor changes to the installed module.

This weekend I have decided to take a second look at the DotNetNuke CMS and after spending most of my weekend installing, implementing, configuring, and pulling out my hairs I’m sharing my experience in my new DNN site.

I present to you my DNN site:  http://abelgaxiola.net/dnn

Getting Started with AppHarbor via BitBucket

A while back I heard a podcast having to do with cloud technology and platform as a service provided by AppHarbor (listen to it here).  At that time I didn’t pay much attention past the fact that it was an interesting conversation regarding a technology that I keep under the radar ever since I attended a talk regarding Amazon’s cloud offerings.  Last time I did anything having to do with similar technology was when MS was promoting Azure by offering limited free accounts.  I remember being very excited and quickly signing up for my free account.  Azure was fun and I did learn some new concepts but was never able to justify converting my free account to a pay account – at least not for my personal consumption.

Well, I don’t have to justify anything anymore.  AppHarbor’s website greets you with the following words: Azure done right.  And after spending some hours working with it I have to conclude that this is indeed the truth.  Disclaimer: I haven’t revisited Azure recently but the last time I checked it was still not free (there is a free 90 days trial but you need a credit card to create the account – you can guess what happens after the 90 days).

If you are a .NET developer and are looking to leverage the power and flexibility of cloud computing allow me to suggest you take a look at AppHarbor and what it has to offer.  Here is my short list of what impressed me the most about AppHarbor.

  1. Extremely fast deployment of .NET solutions.
  2. Integrates with BitBucket in a seamless manner
  3. Free application hosting
  4. Free SQL Server DB (20 MB)

I have to admit that deploying my first app to the cloud via AppHarbor was not as easy as some articles make it to be, but after I was able to resolve my issues the simplicity of deploying became clear.  I have a new perspective regarding the tools and the deployment cycle; from using TortoiseHg, to versioning in the cloud (BitBucket), and automatically deploying to AppHarbor.  The fruits of my labor are nothing to brag about but the learning experience was priceless.  Check it out: http://abeleba.apphb.com/

Here are some articles that got me started:

Using AppHarbor, Bitbucket and Mercurial with ASP.NET and Silverlight

AppHarbor + ASP.NET MVC + Orchard = Awesome

Integrating with Bitbucket

Order Your Picture Files by Renaming Them

Did you ever need to organize a bunch of picture files by renaming them to something that made more sense than the default name given by your photo camera?  I came across this situation just recently while going through a bunch of pictures that had been saved into one folder with descriptive names such as D98765.jpg, 100_5554.jpg, etc. (the names probably reflected the fact that they had been downloaded from different cameras).  I wanted to name the pictures something like “(1)Michelle 2-2-2008”, “(2)Michelle 9-10-2009”, and so on…  Where the date portion was the date the picture was taken.  And because I need to do this for many files I felt that my time was best spent writing a program to do this rather than manually renaming all of the files.

So I wrote a simple program that can be executed in computers running the Windows operating system.  And now that I have the program I decided to make it available to anyone that has similar needs.  You can download the program in zip format by clicking on the following link:  FileRename.zip (5.70 kb)

If you are interested in the code it can be downloaded from here:  FileRenameCode.zip (10.20 kb)

How it works:

1.  Unzip (extract) the program from the zip file.

2.  Double click on the FileRename.exe file.

3.  Select the folder name and path by clicking on the “Select Folder” button.

4.  Check the options you want to use for naming the files (folder name and/or file date)

5.  Click the “Rename” button.

6.  That’s it…

If no naming option is selected the files will be renamed using sequential numbers enclosed in parenthesis.  (1).jpg, (2).jpg, etc.

My advice: since this is a simple program created to fulfill a personal need no extensive testing was performed.  Execute the program against a copy of the files you are planning to rename; once you verify that the renaming was successful you can deleted the originals.

The program will rename any type of file.  Files don’t need to be photos or pictures.  The program will number the files by first ordering them by modified date in ascending order.