dans.blog


The miscellaneous ramblings and thoughts of Dan G. Switzer, II

Using RegEx in your IDE to speed up coding...

Nathan Strutz posted a cool tip using regular expressions to speed up coding which uses a regular expression to convert a single line list of variables into something actually useful.

You have a list of values on lines and you want to want to apply some code to each:

first_name
middle_initial
last_name
phone
country
state_province
city

Select the lines, and use your IDE's find/replace tool with the regex option. In Eclipse, this is just CTRL+F and check the checkbox. Use this as the search pattern:

^(.+)$

This regex says to select any line with at least one character in it and store it in a character group.

Some code like this would be the replace pattern:
querySetCell(myQuery, "$1", "");

Replace them all and your code will be generated in an instant. The regex will drop each line's content into the $1 backreference.

That's a tip I'll have to remember.


Free icons from DryIcons

DryIcons.com has released 5 free icon sets. I'm a terrible artist, so the more free icon sets I can find, the better off I am when I'm designing an interface. Here's what DryIcons is offering:

Ruby Multimedia Icon Set - 13 High Quality Web Icons
WYSIWYG Sapphire Icon Set - 47 High Quality Web Icons
WYSIWYG Classic Icon Set - 47 High Quality Web Icons
Blue Velvet Icon Set - 86 High Quality Web Icons
Aesthetica Icon Set - 160 High Quality Web Icons


Flash Player 9.0.115.0 (Update 3) Content Debugger released...

As many of you know, Flash Player v9.0.115.0 was released yesterday. I've been using Flash Player v9.0.64.0 since I recently completed a project using the Flex 3 beta. I see from the list of fixes, that issue #212379 (audio playback in swf off sync) has been addressed—which I'm hoping fixes the problem I've seen in lots of streaming video recently.

I always have trouble finding the Flash Player Content Debugger downloads so I wanted to make sure to provide a link. You'd think the page would be easy to find, but I always have to search for it. You'll only find the page in Adobe's Support section for the Flash Player.

Here are the links directly to the Windows versions:

I've just installed the updated versions, so hopefully I don't run into any problems!


Searching for an Eclipse Color Picker...

I was trying to find an Eclipse-based color picker that worked as a view this afternoon. I can't believe nobody has created one, but from the looks of my Google searches no one has. It would really be great to have a color wheel with the features of Adobe's Kuler available right from Eclipse.

If anyone knows of a really good color swatch/picker for Eclipse, please let me know.

However, I did come across ColorCop in my search—which I'm going to try out and see how it works for me. There's no installer and it's free, with an option to donate via PayPal if you find the program useful.

more…


WinMerge is a great Open Source Diff tool

In the past I've blogged about some free Windows-based Diff tools—like ExamDiff. However I recently came across WinMerge—an "Open Source visual text file differencing and merging tool for Win32 platforms."

I've only been playing around with it for a couple of days, but I'm very impressed so far. It does a very good job visualizing the differences in files and has a lot of configuration options (such as how to interpret whitespace.) You create patch files, merge the changes together and even compare folder contents.

The feature I really like is Windows Explorer Context Menu integration. The context menu allows you to select two files in Windows Explorer and right-click and select the "Compare" option and instantly get a diff from those two files. There's also an option called "Compare To" which allows you to select a single file and then you can explore to another folder highlight a second file and select the "Compare" option to compare those two files. I really like this option. For me this is generally much more convienent than open the program and using an "Open" dialog to compare two files. I just find when I need to compare two files and I'm not already in Eclipse, then I'm probably looking at the files in Explorer—so the context menu integration is extremely convienent.

more…


Amazing Flash Game - Get The Glass

My brother sent me this link just a few minutes ago. This has to be one of the most impressive pieces of Flash I've seen in a long, long time. Kudos to the firm that did this work for the California Milk Processor Board (aka Got Milk?)

get_the_glass.png

Looks like the old URL is now taken over by spammers. The game can still be found here: http://www.crazygames.com/game/get-the-glass


Configuring Windows Authentication with Apache 2.2.x and Subversion

I've been working on our development server at work to try to help streamline some process. This included upgrade Subversion and Apache to the latest versions and installing Trac (so we can better track software issues.)

In order to really simplify being able to give developers and contractors access to the appropriate areas, I wanted to try and simplify the process by configuring Apache to use Windows Authentication. This allows us to control who has access to what, just by making them members of the appropriate groups.

Since I'm new to Apache, this whole process has taken longer than what I wanted—but I certainly learned a lot in the process.

more…


Generate PDFs from within Flex

I came across a post today on Ryan Stewart's blog about a Flex project called AlivePDF created by Thibault Imbert.

In a nutshell, AlivePDF is a Flex library for creating PDFs completely within Flex. Thibault has blogged an example of how easy to save PDFs using the library.

Pretty cool stuff...


IE6/Flash Field Focus Problem

A user reported to me a strange behavior with IE6 and Flash that I've never noticed. If you're using IE6 and there's a SWF on the page when you go to another Application Window and came back to IE6, if the cursor was placed in any text box, the focus will be lost.

The quickest way to verify this bug is to go to the Adobe website and place your cursor in the "Search" box at the top of the page. Now ALT+TAB to another Window. Now ALT+TAB back to IE6. You'll notice the cursor is no longer in the search box.

Now, if you do the same test on the Google website you'll notice this behavior doesn't exist.

more…


Fiddler Issue: Slow running HTTP requests on local IPs (i.e. 192.168.1.*)

For those of you using Fiddler HTTP Debugger (which is a great tool I've blogged about many times in the past,) there appears to be an issue when using IP addresses. This is especially noticable when using private subnet IP addresses (such as 192.168.1.*.)

The problem I was seeing was that requests to my developer server came to a crawl when using Fiddler. Speed to external domains was working fine. If I turned off capturing, speed resumed. I finally was able to figure out that by setting up a DNS entry, speed would resume.

Since this was slowing me down, I sent Eric Law, the developer of Fiddler, an e-mail message reporting the problem. He was very quick in researching the problem.

more…


License Free Photo Resource - everystockphoto

I think I've seen this link before, but there's a great site for license free images called everystockphoto. They currently have over 268,000 free images for download. Definitely worth checking out if you're doing a project on the cheap and need some images to use.

On a related note, iStockphoto is site were you can get very inexpensive photos (from $1 to $5 per image, based on the resolution you want.) The great thing about this site is if you're a photographer, you can sell your pictures on this site. A acquaintance of mine, Todd Smith of SaturatedPixels has been selling his works there for a couple of years. Check out his iStockphoto portfolio.


Sony Should Embrace Homebrew Flash-based Applications

I own a Sony Playstation Portable (PSP). It's a great handheld gaming device—blows away everything else I've seen. However, the one big battle that PSP owners have had w/Sony is wanting to run "homebrew" applications (these are unsigned applications written by users for the PSP and not officially released software.) The original firmware 1.2 had some holes in it that allowed you to pretty easily bypass the mechanisms Sony built-in to allow only signed content to play.

Every since hackers figured out a way to hack the PSP's firmware, it's been a battle between Sony and the hackers. Sony releases a new firmware that fixes the holes and hackers try to figure out another way to bypass the Sony security mechanism to only allow signed content to play.

Each time Sony releases a new firmware, they've generally added some new functionality to the unit. The original PSP firmware didn't include a browser—which was added in the 2.0 release (I believe.) Anyway, Sony tries to entice users to upgrade by offering new features and even having newer games force a user to upgrade. Some hackers are living on old firmware just so they can continue to run their "homebrew" applications.

more…


The future is here: Web 2.1

There's a new Web in town—Web v2.1! A new article over at Something Awful gives a humorous, yet insightful, look at the buzz phrase "Web 2.0".

Web 2.1 is the new standard for web sites and applications in the blogosphere collective information age. It is scaleable and easy to use, as well as being user friendly and designed with the end user in mind. In order to be Web 2.1 compliant, you must follow these guidelines:

  • If it comes to a rest on the floor for less than five seconds, you can eat it
  • No means no
  • Don't expose it to bright lights, get it wet, or feed it after midnight
  • Data is the next Intel Inside
  • If the kick returner signals for a fair catch but drops the ball, the other team can attempt to recover it


Retrieving the wdith/height of a SWF file from ColdFusion

Doug Hughes has been kind enough to share the code he wrote to get the dimensions of a Flash (swf) file using ColdFusion. This could prove to be very handy to anyone running a CF-based CMS or if you're serving up random Flash files.


A "safe" way to compress your JavaScript code...

If you ever do any heavy JavaScript development, you know how large cross browser libraries. The file sizes of these libraries get very large, very quickly. Usually JavaScript files contain a lot of whitespacing and (hopefully) commenting, which can drastically increase the file size—which means for longer download times.

There are many solutions to this problem, but most involve the basic idea of stripping out commenting and taking out the unneccesary whitespacing. While these simple steps can reduce you files nicely, there are better ways.

Alex Russell, the project lead for the Dojo JavaScript Toolkit, has written an open source compression tool called SourceSafe. SourceSafe is based on Rhino, the JavaScript engine used in the Mozilla projects.

more…