Tuesday, December 23, 2014

Trends in Web Development for 2014

Here are a few trends for 2014 I inked out of Google Trends for the past year.  Some may find them of interest.

-- And here are job listing from Dice, which might be useful to trend.

asp.net 3276
ruby on rails 1919
php 2115
Java 13616
node.js 473
photoshop 473
sharepoint 2288
wordpress 237
sql server 25901
Android 1916
Mobile 7281
sqlite 50
mysql 2348
HTML 5  14453
dotnetnuke 9
jquery 3592
angular 764
javascript 8532
bootstrap 586
WPF 470

Friday, November 07, 2014

SQLite Windows and Mono Compatible

I haven't tried this yet, but if you have a .net project that needs to use SQLite on both Mono and Window's platforms, I found this comment interesting.

Taken from here http://www.codeproject.com/Articles/821149/Universal-System-Data-Sqlite-binary-for-NET-and-Mo

You could just use Mono.Data.SQLite PinmemberWilliam Ivanski22-Sep-14 4:16 
I copied the file "Mono.Data.SQLite.dll" from Mono to my application bin folder.

I also copied "sqlite3.dll" from SQLite website.

It works flawlessly under both .NET/Windows and Mono/Linux.

Friday, October 03, 2014

Dates in Javascript and the Underscore Framework

I haven't posted much as I've been busy.  I pan to post a few articles this month, just not sure when I will get to them.  In the meanwhile here is a good article on Javascript dates, which I have to deal with from time to time.


Also a framework which might be useful is _underscore.js.  Looks like some useful cross-browser functionality.


Thursday, July 10, 2014

Using Nuget with Team Foundation Server

Just a heads up...

Can you use Nuget to get packages if you are using Microsoft Team Foundation Server?  Yes...but you have to do some work arounds so the default answer is NO.  The issue is that when you download packages depending on how workspaces are setup on each developer's machine problems could happen.  At least for me at this point it is better to download what you need from say codeplex and install things dropping a dll in a folder and then adding a reference in your project (with copy local set in properties) to the dll.

I screwed up a project using Nuget without knowing things need to be tweaked.

More info here-http://stackoverflow.com/questions/6344119/nuget-and-tfs-best-practices

Monday, June 09, 2014

WCFExtras No Longer Needed In ASP.Net 4.5+ For Flat WSDLs

So I started a new WCF Service Application Project in Visual Studio 2013.  I soon ran into the "Where are all the missing parts of my WSDL?"  I then remembered something about needing WCFExtras to generate "flat" WSDLs with all the pieces parts in WCF.  In googling around about the difference between WCFExtras and WCFExtrasPlus was I found some good news...

WCF in the .Net framework 4.5+ will generate "flat" WSDLs for you without the need of WCFExtras!

All you need to do is have your connecting clients point themselves to..


Just add the ?singwsdl at the end of your service.svc and the full WSDL for your WCF is exposed without any missing pieces parts.


Here is a [LINK] for more info.

Thursday, May 29, 2014

A Few SQLite Tips

 SQLite http://sqlite.org/ is an open source database that is written in C.  It is similar to say an access .mdb file or a Microsoft SQL Server CE file only databases in that it is a file and runs in the same process (well, some caviots here with newer mods to SQLite but I'm not familiar enough there to comment) as your deployed program.  It is used by Firefox, Chrome, a lot of phone app developers, and now by me.  SQL Server is overkill for many of the little web applications I write and although I like SQL Server Compact Edition it looks like it is dead in the water [LINK].

1) Once you have created a table in SQLite, you cannot add a new column to that table with the alter command that has a default value [LINK].

2) It seems like time for SQLite is defaulted to GMT, which in my opinion is a good thing.  For default dates in tables, use CURRENT_TIMESTAMP.

3) SQLite-Net looks really cool, but I haven't been able to hack it to work for web development.  If you are using Windows 8 and developing APPS or Desktop applications, take a look at it. [LINK].

4) A really great and free GUI manager for SQLite is a plugin for Firefox called SQLite Manager. Look for it in the Firefox Plugins.  More info [LINK].

5) It looks like the main .Net SQLite Data Connection enabler is System.Data.Sqlite.  The full Nuget package contains Linq and Entity Framework support.  More info [LINK].

6) There is a version of SQLite written in managed .net code, but it looks like it is no longer being revised.  Maybe Microsoft will pick it up.  Info [LINK].  You might be able to hack SQLite-net to use this version, as it looks like it was originally intended to use it.  I tried for a few hours but gave up.  Maybe I'll take another stab at it.

7) There are no stored procs with SQLite (although I believe there is a fork in development that supports that, but I'm not sure how stable it is).  You can however create user defined functions.

8) When to use SQLite [LINK].

9) Interestingly, if you try to connect to a SQLite DB that doesn't exist the SQLite Connection object will create a new blank DB file for you with the name that you were looking for.  This actually caused me some confusion as has an extra character in my connection string and suddenly I couldn't query any of my tables...duh, they didn't exist because I was querying a new database.

10) If you are familiar with Transact SQL and Microsoft SQL Server (or MySQL, Postgress, Oracle) I don't think you will have any problems using SQLite.

11) Data types on columns are more recommendations than set and fast.  I believe if you try you can save strings in int fields and mix and match.  This might have changed with the 3.x version but from what I have been reading this at lest used to be very true.  Who knows in some cases this could be a good thing, but in most if you aren't careful this might cause havoc.

12) For bulk inserts you want to use SQLite transactions else SQLite will be very slow [LINK]

13) SQLite select queries are CASE SENSITIVE by default.  You can get around this by using COLLATE NOCASE after your where condition like select * from mytable where colum1 = @somevalue COLLATE NOCASE.  A post explaining the particulars can be found [HERE].

14) There is no "Select top * or Select top 10" in SQLite.  Instead use limit. Example: "Select blah from mytable where blah order by blah limit 10"

I got my start in web development using classic ASP and Access MDB databases.  I could crank stuff out FAST.  I think now for some of my projects using MVC (thought without most of the MVC, just using Razor pages almost like development with WebMatrix) and SQLite might be a sweet spot for me as far as making development fun and productive.  I plan to update this page as I find more little quirks using SQLite with ASP.Net.  I also will be posting some source code examples.

Tuesday, May 27, 2014

Fixing Telerik's RadToolTip After Latest Releases Broke It


Ok, so I had the following scenario.  I was using a Telerik Radgrid with a gridtemplate column that displayed user comments.  Often the comments were long so I would truncate the comment text that would be displayed, and then I add a RadToolTip with the target of the comment label in the grid that on hover would display the full comment text in a tool tip.  But then something happened...the latest changes broke the tool tip so that if I did anything on the grid like sort, update a row, whatever often the comment tool tip would become blank.  I read that it has something to do with how the radtooltip now stores it's content in the viewstate...well that was the excuse, but IMHO it is broke as it worked before and it doesn't work now.

The Fix

Step 1) Add a RadToolTipManager to your page, outside of your update pannels.  Here is an example

   <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"  
    RelativeTo="Element" Position="TopLeft" Width="450" ManualClose="True" ShowDelay="600"  

Notice there is an OnAjaxUpdate method.  You will have to add that in your code behind, but let's worry about that in a second.

Step 2: Add a or update an existing RadGrid ItemDataBound event so we can add a tool tip on to each comment field.

 if ( e.Item.OwnerTableView.Name == "MasterTableName" && ( e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem ) )  
     Control cntl = e.Item.FindControl ( "mylabelintemplatecontrolidwithtruncatedtext" );  
     if ( cntl != null )  
      if ( this.RadToolTipManager1 != null )  
       this.RadToolTipManager1.TargetControls.Add ( cntl.ClientID, true );  

Note: I'm doing the e.Item.OwnerTableView.Name check because I'm using a grid with detail tables. If you don't have any detail tables you can skip that part of the check.  You might also add in a check to make sure the Radgrid is in read only mode, I didn't but I might go back and do that just to make it more efficient.

Step 3) Add your RadToolTipManager Ajax update method.

   protected void RadToolTipManager1_AjaxUpdate ( object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e )  
    for ( int i = 0 ; i < MyGridView.Items.Count ; i++ )  
     if ( MyGridView.Items[ i ].OwnerTableView.Name == "MasterTableName" && ( MyGridView.Items[ i ].ItemType == GridItemType.Item || MyGridView.Items[ i ].ItemType == GridItemType.AlternatingItem ) )  
      /* unfortunately only get client ID back on ajax method, so we have to loop to find matching client ID */  
      Control cntl = MyGridView.Items[ i ].FindControl ( "mylabelintemplatecontrolidwithtruncatedtext" );  
      if ( cntl != null && cntl.ClientID == e.TargetControlID )  
       /* get row ID number */  
       int myID = Convert.ToInt32(MyGridView.Items[ i ].GetDataKeyValue ( "myID" ));  
        /* now get full comment text out of the database */  
        var rv = ( from myrow in ( (DataView)MyDataSet.Select ( DataSourceSelectArguments.Empty ) ).ToTable ().AsEnumerable ()  
              where ( myrow.Field<int> ( "myID" ) == myID )  
              select myrow ).FirstOrDefault ();  
       Label lblInsideToolTip = new Label ();  
       lblInsideToolTip.Text = rv[ "mycommenttextfield" ].ToString ();  
       e.UpdatePanel.ContentTemplateContainer.Controls.Add ( lblInsideToolTip );  

Ok, a few comments on Step 3.  I could only get the ClientID of the target control from the Telerik.Web.UI.ToolTipUpdateEventArgs object, so I had to loop through all of my RadGrid items and then try match client ID's of the column I was looking for.  Kind of a bummer. I elected to grab the comment text from the Dataset itself.  There are other ways of doing this.  Also this is just demo code, you might want to add this in a big try catch or at least check for more nulls.


This seems to work.  I can sort, edit, insert rows and now the comment field's tool tip is always current.  I hope this code helps. Also be sure to add the using System.Linq at the top of the page in your code behind if it isn't there.

Tuesday, May 13, 2014

Web API 2 CRUD Basic Example

Here is a basic Microsoft Web API 2 CRUD example.  The Source code is [HERE] (this gives you the full directory and list of files, just File->Download to download the full zipped project).  I used Visual Studio 2013 and local DB.  I'm not using MVC or any ORM / Entity Framework stuff...this is a very basic example to help get you going.

You will need to change the database path in the web.config file.

Happy Coding!

Monday, May 12, 2014

SQL Dates in Where Clauses

I always forget how to do this, so I'm making a post more for my quick reference than anyone else's.  Anyway, this format should work not matter what culture you format your dates in...using Microsoft SQL Server variants anyway...

WHERE datetime_column BETWEEN '20081220 00:00:00.000'
                          AND '20081220 23:59:59.997'

'YYYYMMDD HH:MM:SS:XXX' xxx being milliseconds.

More information here-


Thursday, April 24, 2014

Javascript GUIDs

It seems a lot of bright people have come up with Javascript implementations of GUIDs. The problem with them all seems to be the way Javascript handles both time and randomness. Also different browsers have their hang ups. Anyway, here is a solution that though not perfect has a good chance of generating SQL compliant GUIDs in Javascript with a very low (but not impossible) chance of collisions. Comments welcome.

 function generateUUID(){  
   var d = new Date().getTime();  
   var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {  
     var r = (d + Math.random()*16)%16 | 0;  
     d = Math.floor(d/16);  
     return (c=='x' ? r : (r&0x7|0x8)).toString(16);  
   return uuid;  

The above var d = new Date().getTime() can be improved by some modern Javascript features, but I'm not sure how supported they are. Here are some additional links with good information about Javascript GUIDs and problems with cryptography, randomness, and collisions.


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-


Wednesday, February 26, 2014

Web Forms: Getting the Bound DataRow Values of a Grid Row While in Read Only Mode

OK, I had a Telerik gridview, and I wanted to add a right click event on the rows that would pop a window.  I also wanted to pass some of the data elements on the row clicked in the URL string of the popup window.

On the MasterTableView I had the Primary Key ID in the DataKeyNames property, so I could get the primary key ID from the clicked row using this technique-


But what about the rest of the data?  I could try to get at the data in it's label form on the grid row, but what I really wanted was the underlying data that was bound to the grid.  After tweaking a using a little bit if Linq, I came up with this-

  protected void GridContextMenu_ItemClick ( object sender, RadMenuEventArgs e )  
     string radGridClickedRowIndex = Request.Form[ "radGridClickedRowIndex" ]; //hidden form field  
     int RowIndex = -1;  
     RowIndex = Convert.ToInt32 ( radGridClickedRowIndex );  
     GridDataItem gridRow = GridView.Items[ RowIndex ] as GridDataItem;  
     int ID = Convert.ToInt32(gridRow.GetDataKeyValue ( "ID" ).ToString ());  
     var rv = ( from myrow in ((DataView)GRIDDataSet.Select ( DataSourceSelectArguments.Empty )).ToTable().AsEnumerable ()  
           where ( myrow.Field<int> ( "ID" ) == ID )  
           select myrow ).FirstOrDefault ();  

And then you can access items in the bound data row like this

string myvalue = rv["column_name"].ToString();

Some of you will not get what I'm talking about.  But to a certain group of people I hope this is useful. Remember to include the System.Linq namespaces at the top of the code behind page.

Friday, February 21, 2014

American IT Job Market

So every once in a while I go to dice.com and do key word searches to kind of get an idea an idea of what is hot in the job market.  I'm not looking for a new job, but I like to keep track of what employers are actually looking for.

These are the numbers that I found on my latest searches.  The take aways are up to you.

I did my search on February 20th, 2014. Listed below is the keyword I searched on and the number of jobs that were listed for the USA in the last 30 days.

Java 16109
java developer 10015
UX Developer 1024
HTML 5 2780

Flash 716
javascript 11260
c# 8240
php 3568
Objective C 1893
.net 9332
Ruby on Rails 951

iOS 2584
mobile 9230
Android 2557
Rest 3466
WPF 824
metro 640
Linux 10941
ubuntu 288

Developer 27002
Administrator 8357
Network Administrator 2988
Security 16247
Telecommute 716
cisco 4370
DBA 2569

Monday, February 03, 2014

Firefox Not Working With Visual Studio 2012 / 2013

I did the new Visual Studio 2012/13's options to select which browser you want to debug in...but I ran into a snag lately.

When Firing up a website in Visual Studio 2012 using Firefox a few weird things happened.  First, I had to login...second I got an NT/Anonymous login error...all bad.

So after a few minutes of searching I found the fix.  Left here for reference and hopefully it might help you.  The underlying problem is actually with how Firefox handles SQL authentication.  The fix is opening up about:config in Firefox and changing a few entries.  Use the instructions in the link below and add "localhost".


Wednesday, January 22, 2014

Avoid Common CSS Problems

Here is a useful link in avoiding common CSS problems when you are creating CSS from scratch.

Problems addressed are pushing your footer to the bottom and padding issues.  Basic but if you aren't in CSS everyday but when you are you like to start from scratch this is useful.


Wednesday, January 08, 2014

Combo Boxes in Windows Forms

OK, I know windows forms are viewed as ancient technology by many, but my company still uses windows forms for harnesses to test things sometimes.  It has been awhile since I used windows forms, so I ran into a slight issue in using windows forms combo boxes.

Firstly, the data binding is done slightly differently, as the combo boxes can also be bound easily to objects as well as a traditional say SQL data source.  Example of it being done in code behind on a form.

/* I got my datatable the traditional with a query to the database using a SqlDataAdapter */

mycombobox.DataSource = myDataTable;
mycombobox.DisplayMember = "description"; // your description field from your dataset
mycombobox.ValueMember = "value";  // your key field from your dataset

Slightly different mark up than the web.  Also note there is no databind() needed.

Second, getting the selected value of that combo box has a non-obvious (to me anyways) way of  getting it.  I ended up with something like this-

string selectedvalue  = ((DataRowView)mycombobox.SelectedItem).Row["value"].ToString(); //value = ValueMember

The having to cast the SelectedItem as a DataRowView makes sense when you think about it, but not something that just jumped out at me at first.

So, I hope that helps someone (including me next time I fire up an ancient windows form project).

This threat was helpful on getting the selected value http://www.xtremedotnettalk.com/showthread.php?t=93882

Friday, January 03, 2014

Building the Ultimate Dashboard

This dashboard slide deck is targeting marketing and sales people, but dashboards are useful everywhere, even in games.

45 Useful Javascript Tips

Flippin' Awesome has compiled a list of 45 useful Javascript tips in one useful spot.  Well worth checking out.