Posts

Showing posts from 2010

Back from the Roller Coaster....

Well, September has been a really busy month for me! I got married in the Blue Ridge Mountains, was the best man at my brother's wedding, and spent a week in Florida for the Honeymoon! Well, I am back and will in short order continue adding more code and solutions! Cheers, Mike

A blast from the past!

It was Christmas of 1990 – my junior year of high school. This was a great Christmas for me. Being an avid computer user – my trusty Commodore 64 was used every day back then. If I wasn’t trying to save Skara Brae from Mangar the Dark, I was trying to make money supporting my NASA space station. Well, that Christmas I received what is now my all-time favorite computer. The Commodore Amiga 500 – a true revolutionary leap in home computing at it times. While IBM PC’s where green screen DOS terminals along with Apple Mac’s grey scale graphic user interface, the Amiga boasted true 16-bit, 4096 color palette along with a whole whopping 1 megabyte of ram (who could ever use more?) and a 1.44 MB 3.5in floppy drive. The Amiga 500 was actually a second generation Amiga – the low end price conscience model compared to the much more expensive and expandable Amiga 2000. Commodore had something special and only with their classic inability to market and manage what they had – basically be

Something cool

I am always being asked about ways to do certain things. The most common are how to do things on the web. Well, last night a student asked me about how to make an “Accordion” Menu. She had seen a menu on a website and wanted to do the same thing on hers. Well, I Googled “jQuery Menu” and came across this blog site. http://www.designyourway.net/blog/resources/25-jquery-menus-ready-for-download/ Seems there is a lot of cool menus and source code on this site. Also, you can check out other blog entries for how to do many different things with web technologies. I am going to make sure this site makes it to my bookmarks!

Oracle External Table

I am always being asked to get some data into a database. Most of the time it is just a matter of writing an import or using a bulk import tool to load the data. However, sometimes it’s a little more complicated than that. Well, I have been working with Oracle 10g database lately and love the external table feature. Oracle external tables is a wonderful mechanism that allows you to take an CSV or fixed-length file and logically map it as a database table. The advantage of this over import is a lot of times you have external data that you want to “load” for reporting and scrubbing against, but once the data has been scrubbed, it is useless. This is especially useful where business demands require you to take external data and check against your system. I could have really used this feature when I wrote a process to verify telephone number porting reports. Local Number Portability (LNP) and Wireless Number Portability (WNP) required us to verify “owner” of a number and make sure we turn

Don't be a spammer!

If you are like me, you are always required to make your applications allow the user to complete task and processes. Of course, as humans we always want confirmation when we do something. If we buy something, we want a receipt. Same is true for processes in software. I submit an order at Amazon.com, I want an E-Mail confirming my order, then an E-mail when my order ships with the shipping tracking number. This is no different than for any software I have had to write. One problem I have during development is that I don’t want to start sending out emails all over the dang place nor really want to access the only mail server available to me – my work Exchange server. The guys in IT hate it when you are testing something, accidently make an infinite loop and send out 10,000 test E-Mails before you realize “oops!” Well, I came across a way to use configuration setting in a ASP.NET web app (I don’t see why this wouldn’t work in a winform app either). In your web.config add the following in

Making a resource file programatically

My latest task was to make a set of image files into a single resource file to be used with a project. When the application loaded, it would pull the images into an ImageList for a Treeview. Well, this works fine except you now have 50 small files being distributed in a small folder with your application. The original design goal is to keep images separate while allowing them to be customizable for clients. So while trying to maintain customization, but making things simple and cleaner, I came upon the conclusion that I create a resource file for my icons. First, I decided to make a tool to do all of this. I broke out trusty old VS 2008 and started a Windows Forms Application. To be honest, any chance I get to work on a Windows Form Application, I do. I miss the good ole days of desktop only applications – web apps suck to write and maintain – unless it is an email, blog, or social site type application. Data entry and business processing should have never been moved to the web – but c
I am so glad that after all these years of software development; I still find the amount I don’t know is so much more vastly great in magnitude than what I know. Nothing saddens (and scares) me more to think I would ever get to a point where there is nothing else to do and it will remain the same from here on out. Working with .Net the last few years has been great, but there was a feature in .Net version 3.0 I missed while doing maintenance work with a ASP.NET 2.0 app. .Net Extension Methods is awesome! Jason, a new coworker ( I changed jobs a few weeks back) point me to this http://www.codinghorror.com/blog/2008/07/monkeypatching-for-humans.html Well, after checking this out, I decided to write a few extensions for myself and put them here. public static string Right(this string s, int len) { if (len == 0 s.Length == 0) return ""; if (s.Length <= len) return s; return s.Substring(s.Length -len, len); } public static int WordCount(this string s) { string[] rtn = s.Split(&

.Net DataTable Exercise

Every now and then I need to retrieve some data and show it in a grid... uh who am I kidding, I have to do this ALL the time. Well, here is a simple way to filter your data quick and easy. /* CODE */ GridFieldDAO dao = new GridFieldDAO(); DataTable dt = dao.getDT(); DataRow[] drs = dt.Select("(detailID = 1) AND (detailTypeID = 2)"); DataTable dt2 = dt.Clone(); foreach (DataRow d in drs) { dt2.ImportRow(d); } myGrid.DataSource = dt2; myGrid.DataBind(); /* CODE */ The real magic here is how the DataTable Select() method allows you to get subsets of data for display. Most people filter based off changing paramaters and reloading values from the database. If you want to just display filtering for a whole set, this is easier and more efficent. Enjoy!

Working with some Oracle Constraints

I was working with some code and wanted to add a Check Constraint for my test database. Using Oracle 10g I looked up some syntax reference and lo and behold I found Regular Expressions staring right at me! Quick side note : Coming from a programmers point of view I have to say the Oracle's Database is the most powerful and flexible database I have ever dealt with. You can write ANSI SQL, Oracle flavor SQL, and PL/SQL (not counting using Java for procedure language too). Also, every modern programming language works against it! Heck go to http://www.monster.com and search on Oracle - you'll get OVER 1000 postings. Its a great database and their is a REAL shortage of professionals who can work with it. Anyway, back to my simple constraint. Like I said earlier, Oracle does something I like - they support Regular Expressions in their SQL. Regular Expressions basically allow you to pattern match data to determine if it is what you are looking for for validation, etc. If yo