In a recent post, I talked about generic lists and how we have been using them at work as a replacement for the DataTable class. For the most part, it has been a real pleasure getting rid of DataTable, but I will admit that there are certain situations in which a DataTable is easier to code for. This is primarily because DataTables are mature and robust, and several helper classes already exist in the .NET framework to process them. The Fill function for the SqlDataAdapter, for example, will automatically load a DataTable with the result of an SQL command for you, which is extremely convenient. There are other classes such as DataView that make manipulative tasks (like sorting and filtering) a piece of cake. For instance, say you have a DataTable populated with about 500 rows and…
[ Read More ]Javascript is a very unique language, and I think that has become more and more apparent over the years. Crockford said it best - it's the worlds most misunderstood programming language. And yet it has somehow managed to evolve into a sheer necessity of the web. I can blatantly recall my very first programming experience with Javascript, back in 1998. I spent over an hour trying to figure out why my one line of code to get a form element was not working. Then I found out that Javscript was a case-sensitive language, and this really pissed me off. I could use whatever case I wanted in HTML, so why does Javascript have to be any different?! Regardless of your level of experience as a programmer (in general), you should probably expect some introductory hiccups upon first learning Javascript. I believe that such initial frustrations are why the…
[ Read More ]I'm a huge fan of generic lists. They have numerous benefits, and because of that I've been campaigning them at work to the other programmers. The response has been very good. Although given that our previous method was powered by DataTables, it is not much of a surprise that generic lists have evolved into the preference. A question came up today about adding the capability to export a GridView's data source to a Microsoft Excel spreadsheet, and it just so happens the GridView was bound to a List. This is the first time this has come up. We've had several grids export to Excel, and a common function to handle most of the workload was in place, but unfortuntely it was built for a DataTable instance. This task was accomplished fairly simply with DataTables, because it was unnecessary to worry about the parameter type - it was always a DataTable. The function loops through all the rows and builds a tab/line delimited string of data and returns it. DataTables also made it simple to…
[ Read More ]It's finally that time of year again. The time to shut down the computers. The time to relax and put the mind at ease. The time to pigeonhole the daily tasks that are seemingly important, and realize that they are actually humdrum. The time to part myself from this electronics-infatuated lifestyle, in an effort to maintain natural sanity.
It's the third week of August, and that means one thing to me: fishing time. Tomorrow morning, bright and early, I will be on my way to Minnesota again to spend a computer-free week with nature, with the mere objective of chillaxing. This is an annual vacation for me, and I could almost classify such a trip as essential for anybody who uses computers for several hours a day (given that you are not disturbed enough to say you'd have sex with computers). Escaping the shackles that are the keyboard and mouse…
[ Read More ]I've been saving up money for a little while now, with hopes of revamping my office at home to accomodate my ever-growing computing needs wants. I was finally able to purchase all that I wanted, and now I am quite happy with my home within my home. It's amazing how dropping a few grand on yourself can change your whole outlook on life. The ultimate addition to my office is obviously a new computer, but before I could go down that route I decided it would be best to get a new desk first. I'm sold on the multiple monitors concept, so I needed a spacious desk with room for at least two big LCDs for the new machine. Also, my old computer (ha, I can call it old now) still has plenty of life left, so I needed a desk that could accomodate it as well, without being cluttered. After shopping at a multitude of stores around town…
I am a huge fan of CSS sprites, a technique used to create image-based hover effects on a web page. It's clever and very efficient because both "image states" are contained in a single image, eliminating the need to make two requests to the server. It tends to go hand-in-hand with image replacement to create an appealing effect while retaining accessibility and search engine optimization. Having to use background images sort of limits the flexibility to an extent. I realized this when I wanted to use sprites with the <input type="image" /> tag for submitting a form. Since this tag sets the path to the image as an attribute, the classic method of applying sprites with background images cannot be used. The same challenge is…
[ Read More ]Today I am going to share an interesting and super-cool way to create a dynamic hover effect for images. I call this flexible format the "cookie-cutter effect", and you'll find out why in a moment. First, I shall go off on a tangent to maintain my reputation. This day in age, alot of navigational bars on web sites are image-based. Designers prefer to use graphics because it helps make the navigation more stunning and visually appealing (eye candy). Another thing that is becoming nearly mandatory is a hover effect for each of the links, meaning the image changes slightly when the user has positioned their cursor over it. This sends an instant visual cue to the user and lets them know exactly what they are pointing at. It may seem a little silly to think a user does not know where their mouse is pointed, but that certainly is not the case. The map in the center of your local shopping mall with a big arrow that says "You are here" is not silly either, it is…
[ Read More ]In this post I will share a solution that I reached the other day regarding an InvalidOperationException that I was receiving when attempting to consume a SOAP web service with DIME attachments. Hopefully this will save you some time, as I was unable to find a good solution online when I encountered the error. DIME attachments are a Microsoft standard that has recently been deemed obsolete. Basically, it's a method of transmitting binary data via SOAP, in which the raw data is delivered after the SOAP envelope. By keeping the data outside of the envelope, it does not have to be Base64 encoded (which would be required to keep the XML valid). Subsequently, the attachment does not have to be consumed by an XML parser on the client-side. This approach dramatically increases the performance of both the client and the server. Although effective, DIME has already been replaced by a newer standard called…
[ Read More ]A couple days ago I made a blog post about a simple HTTP handler written in ASP.NET. The purpose? To spit out 404 errors for .css file requests on CSS Naked Day. That handler will undoubtedly work great, but it does have one minor maintenance-related flaw. Each year you will have to update the constant date value to be accurate. Granted, that is a simple task, but it still requires time and a little bit of effort. Dustin Diaz left a comment notifying me of a nice JSON file sitting out on GoogleCode that I could tap…
[ Read More ]UPDATE: I have came up with a better zero-maintenance solution thanks to a comment by Dustin. The one bellow will still work, you just have to maintain the date constant that is defined at the top of the handler.
I kinda like the idea of CSS Naked Day, which was thought up by Dustin Diaz (a Google fellow) a couple of years ago. I have decided to participate. If you have a personal web site, I would encourage you to do the same. If your web site runs on ASP.NET (highly recommended), you can use the HTTP handler below. I wrote it today and am implementing on my blog. On CSS Naked Day, which is defined at the top of the handler in a constant, it will return a 404…
[ Read More ]