I decided to add a message forum, using punBB.
Feel free to join and post what’s on your mind.
I decided to add a message forum, using punBB.
Feel free to join and post what’s on your mind.
One of my current projects at work has an RSS requirement. I’m redesigning the university’s policies website. My customers are concerned that other departments at Purdue have previously copied the content of a policy and placed it on a different site, which is problematic when policies are revised, superseded, or retired.
Implementing an RSS XML file for each policy will allow anyone else to embed a policy in their own site using any web technology while keeping the policies site owners in complete control of the content, no matter where it’s used.
Unfortunately, I had a pretty hard time finding a clear-cut solution for creating XML files dynamically with ColdFusion and SQL. It turns out that it’s not that difficult; it just took a little time to figure it out. One solution involved creating an actual XML file and writing it to the server. This would work for content that never gets updated, but this is a situation where the user needs to be able to implement the RSS in their site and not worry about it again.
The problem is, the XML specification is quite strict. You must be able to pass the file as XML in the header information, which will allow RSS readers (and embedding codes or scripts) to see it and parse it. This is accomplished quite easily through the cfcontent tag. Once you’ve identified the content as XML, you generate the file just like you would a regular HTML-formatted page.
Some quick Googling got me the information I needed on how to create an RSS feed to current specifications - you can check it out on Pete Freitag’s site here.
This is pretty code-heavy, so hit the jump to read the rest.
My freshman year of college, I knew a kid with a Logitech MX700 cordless mouse. The first time I used it, I knew I had to have one. It was only a few months before I bought the Cordless Elite set, with the Elite keyboard and the MX700 mouse.
I have since discovered that this is the number one best mouse in existence. I’m not a gamer, so I don’t need high sensitivity and hair-trigger response. What I do need on a daily basis are the extra mappable keys that the MX700 (and its siblings) provide.
Logitech canned the MX700 several years ago in favor of the (in my opinion, at least) inferior MX1000. They still, however, produce a corded version - the MX518 gaming mouse. This is what I have in my office at work.
I typically map the second button below the scroll wheel to Ctrl+W, so that I can quickly close tabs and child windows in almost any application. There are, however, two applications I frequently use that do not follow the Ctrl+W convention - Outlook 2003 and SQL Server Management Studio. In Outlook, you need to use Esc to close child windows (messages, appointments, etc.). In SQL Studio, Ctrl+F4 is the only shortcut that will close open tabs in the interface.
Today, on a whim, I Googled to see if there was a way to map each of the mouse’s buttons differently for specific applications. Lo and behold, there is! It turns out that the SetPoint software required for Logitech’s newer mice uses XML for the configuration settings, so someone figured out how to enable lots of additional settings via the aptly-named uberOptions.
This application was ridiculously easy to install and use. I didn’t have to restart, or even manually shutdown SetPoint before installing. Once it was installed, I was able to quickly specify mapped keystrokes for Outlook and SQL Server, and was off and running. Changes take effect immediately - you don’t need to restart an application for its specific mappings to work.
If you have an older MX700-like mouse (the MX500, 700, 510, and 310), you can use an application called LogiGamer, although it looks to be a bit clunkier (and requires the .NET 1.1 framework; it’s old enough that it may not be compatible with newer .NET versions).
If you have a Logitech keyboard, uberOptions will allow you to customize all the keyboard’s extra keys on a per-application basis. I’m just glad that I can finally use the same shortcut button for the same purpose in all my applications!
I like to provide clear visual or textual cues for an application. In the admin interface for one of my apps, I provide a pretty easy way of rejecting or accepting form submissions for a class - a red “X” to reject, and a green checkmark to accept. In order to pass these actions to the ColdFusion page on the server side and rely on POST rather than GET, I used the image form control.
You can use images as command buttons in a form pretty easily - <input type=”image”> is a pretty good place to start.
There’s one problem with this - Internet Explorer (including version 7!) doesn’t pass the value attribute of an image control to the server. In ColdFusion, the value is critical, as it’s what’s used to identify controls on the server side (e.g. #arguments.FirstName# would pull the value of whatever control is named FirstName). It does, however, pass the X and Y coordinates of where the user clicked on the image, by adding .X or .Y to the end of whatever is set as the value attribute (e.g. FirstName.X).
The remedy is to use a different value for each image. I was previously treating them all like Submit buttons. In the case of my app, I have one image with a value of “accept” and one with a value of “reject”. My code on the backend looks like this:
<cfif isDefined('arguments.accept.x')> <!--- process the application as accepted ---> <cfelseif isDefined('arguments.reject.x')> <!--- process the application as rejected ---> </cfif>
It’s an easy solution to an annoying problem. The one caveat about this is that IE will also show the user where the form is going to post, by displaying it in the status bar at the bottom of the browser window. While the user can obviously view the source code if they desire, it’s just something to keep in mind.
On one of my current projects, I’ve found myself in need of passing sensitive data through a URL string. I could use an individual form for each link and pass it via POST, but I wanted to see what I might be able to do by way of encrypting the data. Turns out it’s quite easy.
We’re still running ColdFusion MX 6 here, so some of the newer functions are either crippled or nonexistent. Starting with MX 7, the Encrypt function can handle several different encryption algorithms. I’m stuck with ColdFusion’s own algorithm, which isn’t nearly as secure as AES. However, after a little bit of research, I discovered that it’s actually quite easy to encrypt a variable in your querystring data.
This is a four-step process:
Your final code will look something like this:
<!--- Encrypt String ---> <cfset Secret = 'Don''t tell anyone what this value is!'> <cfset TheKey = 'This is my secret key phrase! 5-6-7-8, who do we appreciate?'> <cfset Encrypted = Encrypt(Secret, TheKey)> <cfset Secret64 = ToBase64(Encrypted)> <!--- Decrypt String ---> <cfset UnlockedSecret = Decrypt(ToString(ToBinary(Secret64)), TheKey)>
Simple, huh? My encrypted values look something like JSQuTyoqWkwgCg==. However, depending on what you’re encrypting (numbers, a phrase, an alphanumeric code, etc.), your obfuscated value might look quite a bit different.
While you certainly should use extreme caution with highly sensitive data like bank account or social security numbers, this is a pretty quick and dirty method of obfuscating data that can’t be passed via POST in your application.
At work, we use Microsoft SQL Server 2005. The client software requires Windows authentication to connect to a database. However, the credentials are pulled from your logged in Windows account. If you’re not on Purdue’s domain, you can’t connect. While putting my workstation on the domain wasn’t an issue, I prefer using my local user account on my laptop.
Vista supports fast user switching on a domain (XP does not, unfortunately), so I could switch between local and domain to use the SQL client, but running two profiles simultaneously is a bit of a resource hog.
Windows XP has a handy “Run As…” feature. If you right-click on an executable or shortcut, you can click “Run As…” and enter different credentials to load an application. This is especially handy if an admin needs to run something like the Management Console without logging out the user first.
Vista, for some inexplicable reason, has removed this feature. Fortunately, SysInternals came up with a handy little application that brings back the “Run As…” menu. It registers in Explorer’s context menu, and it can be used at the command line to load an application - which means you can create shortcuts specifically to run something as a different user.
It’s small, easy to install, and works great. You can get it here.
I’m really, annoyingly, obsessively anal about browser compatibility in web design. Even if you’re convinced that none of your users will ever touch Opera, there’s no reason to not make sure your site is usable in Opera…or Lynx, or IE 5.5, or anything else.
There are known ways to hack your CSS so that different browsers (most specifically, IE, but also others like Opera and Safari that have little quirks about how they render certain elements) will still display your content exactly as you like. However, such hacks can be unreliable and make for messy code.
A much, much better and more streamlined way to deal with CSS incompatibility across browsers is to use server-side code to identify the browser agent and add the appropriate stylesheet.
For the projects I do for Purdue, I’ve created a reusable file that I include in all the sites I develop. It checks the browser’s user agent (in ColdFusion, this is the CGI.HTTP_USER_AGENT variable; in PHP it’s $_SERVER['HTTP_USER_AGENT']), looks for a specific word in the agent string, and will include an extra stylesheet if that CSS file exists.
To make my life easier, I use a standard naming convention. For instance, a stylesheet to add Opera-specific CSS is called opera.css. I also add an extra option at the end of my IF statement to handle any browser not listed, by way of other.css. This could be a way to handle versions of IE previous to 5, or other old browsers (Netscape Navigator, anyone?).
I use an additional bit of code so that if the browser is any version of IE, a second stylesheet called ie.css can be used, along with ie5.css, ie6.css, and ie7.css. There are certain CSS bugs that IE 6 and/or 7 have fixed, while other bugs are present in all versions of IE. Using an extra CSS file for all versions of IE makes it easier to handle those browser-specific styles.
To keep my code clean, I also used the ExpandPath function of ColdFusion to make sure an extra browser-specific stylesheet exists for the given user agent. If the file doesn’t exist, the code outputs nothing but an empty variable.
Make sense? Writing the code is extremely easy. This example uses ColdFusion, but you could easily adapt this concept to work with ASP, PHP, Java, or ASP.NET.
<cfset #ThePath# = "/yoursitepath/css"> <!--- retrieve browser engine information ---> <cfif CGI.HTTP_USER_AGENT contains "Firefox"> <cfset browser = "firefox"> <cfelseif CGI.HTTP_USER_AGENT contains "MSIE 7"> <cfset browser = "ie7"> <cfelseif CGI.HTTP_USER_AGENT contains "MSIE 6"> <cfset browser = "ie6"> <cfelseif CGI.HTTP_USER_AGENT contains "MSIE 5"> <cfset browser = "ie5"> <cfelseif CGI.HTTP_USER_AGENT contains "Safari"> <cfset browser = "safari"> <cfelseif CGI.HTTP_USER_AGENT contains "Opera"> <cfset browser = "opera"> <cfelse> <cfset browser = "other"> </cfif> <cfif FileExists(ExpandPath("#ThePath#/#browser#.css"))> <cfset browserCSS = '<link rel="stylesheet" href="#ThePath#/#browser#.css" />'> <cfelse> <cfset browserCSS = ""> </cfif> <!--- this section adds an additional stylesheet to cover all versions of Internet Explorer. ie.css is placed ABOVE browser.css, so version-specific styles will take priority. ---> <cfif browser contains "ie"> <cfif FileExists(ExpandPath("#ThePath#/ie.css"))> <cfset browserCSS = '<link rel="stylesheet" href="#ThePath#/ie.css" />' & '#chr(10)##chr(9)##chr(9)#' & browserCSS > </cfif> </cfif>
Implementation couldn’t be easier. Just add the variable containing the path to the browser-specific CSS file directly after your HTML for importing your main stylesheet:
<link rel="stylesheet" href="/yoursitepath/css/mainstyle.css" /> #browserCSS#
Being the OCD person I am, the #chr(10)##chr(9)##chr(9)# adds tab and linefeed characters to the output, so your source will still look generally clean.
The other benefit to this code snippet is that it creates an additional variable called #browser#. You could use this anywhere in your code to do something browser specific - e.g. if the user is in Safari, put a big “Steve Jobs is lame” banner at the top of the site…the options for sarcasm here are limitless!
Overall, this is a much better solution than using hacks. By relying on the server to make your CSS work the way you want, you have more control over your code. You could even go so far as to put your main style in that variable, so that users who don’t have a supported browser only get the other.css, which could allow you to provide a text-only or unformatted version of your site.
So Firefox 3.0 was released recently. I downloaded it today to see if it was worth upgrading from 1.5 (I skipped 2.0 entirely - too many annoyances for me).
The verdict thus far is, as I used to say when I was 15, “big negative on that one”.
I really don’t see much happiness in the future of Firefox. What I see is yet another great piece of open source software going drastically downhill in an attempt to “reach out” to a wider user base - meaning a dumber user base.
There is a delicate balance between making an app so unusable that nobody downloads it (even though you, as the developer, might find it plenty useful) and making an app so dumbed-down that anyone, including a computer-illiterate 90-year-old, can use it. This is particularly a problem with open-source software.
I’ve been a big fan of how Microsoft does things. I’m sure I’ll get blasted by “real geeks” for saying that, but the fact is, Microsoft’s products cater to everyone - from the stupidest of the stupid users to the most advanced power-using geeks out there. While there are certain things that Linux indeed does better, Windows meets all of my needs as a power user - and all of my mother’s needs as someone who only uses the computer for email and the occasional game of Spider Solitaire.
In the case of OSS, it’s too easy to either make a product really dumbed-down or really complex. This is more or less what happened when Gaim was released as Pidgin several years ago. Since then, Pidgin’s development has gotten drastically more user-unfriendly in an attempt to make it more accessible to people who would otherwise avoid unfamiliar software. In the case of Pidgin, as “features” were added (which translated into actual features being removed, hidden, or dumbed down) and the user base got wind of the changes and requested fixes or reversions, the developers unfortunately were not too interested in listening to their users.
Firefox is a much bigger open-source project compared to Pidgin, which makes me wonder if they’ll be less likely to listen to their users - or more likely because they have such a public presence now. It’s hard to tell, really.
Surprisingly, Firefox 3.0 has made an effort to behave more like Internet Explorer - I tend to believe it should be the other way around. The oversized back button just gets in the way - who even uses the back button anymore? Ctrl+Left is a heck of a lot faster when navigating your page history.
Not only that, but, like IE7, FF 3.0 has condensed the history into a single button. Rather than having arrows next to both back and forward so that you can navigate in either direction in a tab’s page history, it’s all been shoved into a single button. Does this actually increase usability? I tend to think not. When you’re doing a lot of heavy browsing (and lord knows I do that enough), you don’t want to try and work with one list for all your page history - it’s easier when it’s split between what’s behind and what’s ahead in your page history.
The new drop-down URL bar is ridiculously obnoxious. I Googled around a bit to see what others thought, and there’s a pretty clear consensus so far - the new auto search is annoying, frustrating, and at times unusable. While I’m sure there are people who only remember URLs by title, I don’t. I know the actual URL. When I type in “sla” to go to slashdot, I’d rather not have it start throwing back search suggestions and entries from my history or my bookmarks. If I want to find a page in my history, I’ll hit Ctrl+H and search for it in the History sidebar.
I would imagine that this particular problem, given how many people already dislike it, will be fixed soon with an extension.
Then we come to the feature that I was most interested in - memory management. I am a tab addict. On any given day, I’ll generally have between 20 and 40 tabs open in a single Firefox window. On top of that, each tab has enough browsing history that I start to quickly suck up any and all available physical and virtual RAM as Firefox attempts to cache my history in RAM. After a few days of leaving my workstation at Purdue up and running with Firefox open, I’ll look in the task manager to discover that Firefox is using 500MB of RAM (out of 2GB) and another 1.2GB or so of virtual memory. Closing tabs doesn’t fix the problem - the cache is still there. Killing the process entirely and starting over is the only way to free up memory.
I haven’t really put FF 3.0 through the wringer yet on this one. However, in running the same general activities in 1.5 and 3.0 today, both were using almost identical amounts of physical and virtual memory. It’s not a good sign so far, but I’ll have to really do some hardcore browsing to see if 3.0 is actually an improvement over previous releases.
So far, 3.0 has not impressed me. The only feature I’ve seen so far that I liked was the ability to make it remember to always allow SSL certificates with mismatched domains - at work, our development environment’s SSL certificate doesn’t match the server’s URL. It gets annoying to get that “are you sure you want to do this?” popup every time I login (particularly when the login has to expire after an hour). Being able to set it to always authenticate without needing an extension is nice.
Other than that, though, I think I’ll be sticking with 1.5 for awhile longer, much like I’ve been forced to use older versions of Pidgin to compensate for the fact that the developers appear to be writing the application into its grave.
I have friends all over the world. Once in awhile, I make use of the various webcams I own and do a little video chatting. Getting video chat to work well will be for another day - something I learned recently, however, was how to setup a live stream on a webpage. It was surprisingly easy, and works in both Windows Vista and Windows XP.
You need three things : a webcam, a decent high-speed internet connection (the lowest end DSL might not have enough bandwidth to support this well), and Windows Media Encoder, which is available for free from Microsoft. If you’re running Vista, there’s a hotfix you might need (it’s linked on the main WME page), but I have yet to have any problems myself.
You might also want to get a dynamic IP service, like dyndns or no-ip. I used no-ip.org, although they seem to be really big on sending me frequent emails advertising their paid services - I’m not a big fan of free services spamming me about their commerical options. If you don’t use a dynamic IP service with the computer running the webcam, you’ll have to manually update the webpage every time your IP changes.
We’ll walk through how to get setup and going. It’s a bit screenshot heavy, so click the jump to see the rest.
I just finished up a review of the Asus eeePC 4g (701) for Julie over at The Gadgeteer (check it out here). Before i finally got around to writing that review, I hadn’t done a whole lot with my eeePC. Since last night, however, I’ve installed Windows and started looking for ways to make my eeePC as functional as possible.