Wednesday, June 25, 2014

Migrating Classic ASP to MVC 5 using Scaffolding

This week I started working on a new website application which will update a previously setup project in Classic ASP. The new application will be setup as Database First MVC Model as the current website already has lots of user demographics and trainings information.

I have read many documentation on MVC but haven’t gone about implementing MVC on a large scale project so this will be solution which will let me test out all possibilities of MVC. The application is using the default MVC project with Bootstrap 3 and updates applied from nuget Manager. I will also be using the github as a repository so code does not gets lost.

One of the things I right away ran into when I setup the scaffolding is the “default” database values not being populated, it’s the fault in the database setup but the issue is even noticeable in ASPNetRoles table.

After the auto generated controller was added, I have added the below line before the “SaveChanges()” is called to resolve a uncaught exception when creating a new role and I have removed the id input box on the auto generated Create.cshtml page.

aspNetRole.Id = System.Guid.NewGuid().ToString();
db.AspNetRoles.Add(aspNetRole);
db.SaveChanges();


This is a beginning of the migration, I wonder what kind of hurdles I may run into, but hopefully they will not be showstoppers.

Tuesday, April 22, 2014

GitHub and Cheat sheets

Getting comfortable with GitHub branches, publishing using GitHub Desktop app and Cygwin Server Services with Putty. The first week with GitHub was not easy as I do not use the Linux shell for often and the github “origin” keyword required little getting use to.

As all things are not created equal, I am learning to create some cheat sheets for softwares and applications. It is not humanly possible to remember all things all the time and I am starting to notice my limitations in recalling at moment’s notice specific commands, shortcuts or steps in any given project.

For the super blessed one search online may result in instant answer, but for people like me the search result (a.k.a Artificial Intelligence) seems to play games with mind. It never returns the same results over time and it takes too much of the precious time when trying to solve a problem within minutes, so I can move on to the next task. On the other hand scanning a book for solution or waiting for the peers to reply to the question seems endless hours.

On many occasions the cheat sheet would not solve the problem but it can surely reduce the time from searching online or waiting on peers; as time is of the essence when facing multiple tasks that are needed to be completed.

The list below should be customized to your preference as it is the list that has worked for me.

  1. Microsoft Excel
  2. Google Drive – Spreadsheet
  3. Microsoft OneNote
  4. Notepad text files

Thursday, February 20, 2014

Watchguard XTM330 Configuration Lost

Yesterday was a panic day as the Watchguard XTM330 firewall just decided to crash and burn. The display never goes into a safe mode but it displays it’s “starting” until the buttons are held and if I let go of the button, it will show the “Watchguard” text display.

What’s biting me back is that I do not have a backup of the configuration and this system seems to have reset to Factory default. Why would a working system go blank when no one accessed the server room.

After installing Watchguard System Manager, I was hopeful that I can get a backup, but sadly it connects based on Factory Default settings and not based on the configurations I had over a year.

Hopefully the rush delivery of different system will be in my hands by end of the day so that the internal network will be up and running by tomorrow.

I am still holding on to the hope that, once the current system is returned Watchguard tech team would be able to retrieve my configuration, as that would really help in setting up the new system or at least comparing it, to make sure no special settings are missing.

Thursday, December 12, 2013

Google Chrome Incognito Two Windows Sharing Data from one another

I have two separate Google Apps account and today I happen to open them up in two separate Google Chrome Incognito Windows.

Two windows two different instances, works well with Google Apps Email or Gmail, both render different Gmail accounts. But there seems to be a caveat, the less restricted Google Apps accounts seems to penetrate the second Incognito window tabs when opening services like “Sites” or “Offers” and ask for permissions to log-in with the second windows credential even though in the next sibling tab the Gmail is running fine.

The “Offers” services automatically displays offers based on the second windows “Credential”. Only after Gmail refreshed does the other services start picking up the same windows credentials.

I assume that this is an expected issue if using the normal browser or if the email itself was behaving same, but because Gmail works flawlessly, it just begs the question why the other Google services not able to support features that Gmail supports.

Is Gmail the first to get this service while others may get this in the future?

Character map Checkmark display in HTML

If you like to use a checkmark for your web page, than use this Unicode “✔” in your html code.

I had a quiz page, where I wanted to display the checkmark if the user answered the question correctly.

I first tried to find which font offers a checkmark symbol.

Second, after much trial and error I noticed the Wingding Font has the checkmark but not the Winding 3 Font. After using the CSS Font-family and src attribute to make it all work, I wasn’t totally sure on the licensing issue and the winding font kept resulting into a lowercase “a” rather than the checkmark in html.

Finally, I was able to solve the issue by referencing the Wikipedia Character Map reference guide and adding html render prefix of “&#x” to the numeric value from reference guide and the post prefix of “;”, to result in an html symbol, that displays checkmark. ✔

Tuesday, November 26, 2013

How to stop HDInsight Services For Windows

My installation of “HDInsights Services For Windows” on my “Windows 8.1 Pro” is more of learning rather than a server level always on installation. I started seeing many Java Platform SE binary(s) running in the task manager and forgot that these were the services being run by Apache Hadoop.

It is always a good idea to set the services on development machines to run in manual mode but in case you forget to set it up or you like to find a easy way to stop or start the services, than check out the below sample, as these services may be renamed or additional added or removed since my blog being posted.

For stopping OR starting all the “Apache Hadoop” Services, use a batch file, and run this file with elevated permissions.

File name: Services_Stop_Apache_Hadoop.bat

***************************************
echo Services Stop Apache Hadoop

NET STOP datanode
NET STOP derbyserver
NET STOP historyserver
NET STOP hiveserver
NET STOP hiveserver2
NET STOP hwi
NET STOP jobtracker
NET STOP metastore
NET STOP namenode
NET STOP oozieservice
NET STOP secondarynamenode
NET STOP tasktracker
NET STOP templeton
******************************************

File name: Services_Start_Apache_Hadoop.bat

***************************************
echo Services Start Apache Hadoop

NET START datanode
NET START derbyserver
NET START historyserver
NET START hiveserver
NET START hiveserver2
NET START hwi
NET START jobtracker
NET START metastore
NET START namenode
NET START oozieservice
NET START secondarynamenode
NET START tasktracker
NET START templeton
******************************************

If you are constantly stopping the service’s on each system restart than it’s better to set these services in the “Administrator Tools >> Service” applet to start “Manual”, or in case of always starting the services, then set the option to “Automatic” start.

Wednesday, July 3, 2013

Did I just lost Windows Explorer in Windows 8.1 Preview?

Very strange experience today with Windows 8.1 Preview. I lost the option to access my “C” drive. On first go, I was prompted to switch to Sky drive for documents and photos, and obviously I said “Don’t ask again” and boom, the crash of task bar. Then I selected a shortcut link to one of my favorite folders and I can access folder structure like, my downloads, my documents but not the “C” drive root.

Very strange, I just hope it’s a fixable issue as, this will really be annoying to work with if I keep running into the “Windows Explorer” crash cycle.