I was looking into compressing JavaScript files and came across this JavaScript compressor by Dean Edwards. On the site he offers a .NET port by Jesse Hansen, which I have just ‘hacked’ to recursively duplicate a directory with the .js files compressed. I say 'hacked' as it was a bit of a rush job, but it seems to work. It also lets you put in a 'header' which allows you to put an author/copyright notice at the top of each of the compressed files. The dupicate folder is created in the same location as the orginal and named the same as the original with '_packed' appended.
The original code is covered by a ‘GNU LGPL’ licence, so I’m posting my modifications here for anyone who might need or want them. I made my changes in Visual Studio 2008 so if you want to open the project you will need a copy (the free/express version should work fine). You will also need the .NET framework installed, I think the installer will prompt you to download it if you don't already have it installed.
This post is for all the users of my Virgin Mobile Gadget to explain why it is not working and I have not put out an update.
Firstly, I have been flat out since I have moved to Adelaide, working and studying engineering is taking up almost all of my time. Secondly, Virgin has changed the html on their website; such that it is no longer practical to use Regular Expressions to extract data from the web pages as it does currently, (I have tried with no success).
However, there is still hope, I have replied to a few people saying that I am working on a new version and this is still the case, it is just taking longer than expected.
This is mainly because I have designed a completely new architecture for the gadget, which unfortunately means it needs to be mostly re-written. It will however have the following benefits:
It is using the jquery library, which speeds up development (when I get a chance to do it).
Data retrieval code can be updated more easily.
The gadget will update itself automatically with no need to re-install.
Support for other services here and overseas can be added (e.g. Telstra, Virgin USA).
Google will be supported through an iGoogle Gadget which works with both iGoogle Hompages and the Google Desktop Sidebar.
Most people will have heard of the new iPod Shuffle by now and as you know it has the controls on the earphones and not the main unit. This means you can't use it with good quality headphones or plug it into your stereo for playing music with friends etc. Which is just a pain, but then again anyone who sees this as a problem, probably isn't in the target market for the shuffle!
Also isn't this Sony's design? They had an on wire control for their CD and MiniDisc players way way back.
Anyway I wanted to share how I thought Apple should have implemented the controls on the new shuffle.
The Mechanism
Rather than having the controls on the headphone wire, the shuffle body should have a capacitive strip down the front. The strip would sense your finger just like the click wheel on existing iPods.
Control
You can then use a series of simple and intuitive gestures to control your music.
Gesture
Control
Play/Pause
Touch once to pause or play the current song.
Next Song
Slide your finger from left to right across the shuffle to go to the next song.
Previous Song
Slide your finger from right to left across the shuffle to go to the previous song.
Voice Over
Double touch the shuffle to have it voice over the current artist and song name.
Choose Playlist
Slide your finger back and forth to activate the voice over playlist selection. Single touch to select a playlist after playlist selection has been activated.
Volume
To increase the volume slide left to right and hold, let go when the volume is at the desired level.
To decrease the volume slide right to left and hold, let go when the volume is at the desired level.
Conclusion
I think that this setup would be much easier to use, headphone/stereo friendly and a lot simpler/cleaner looking.
It is also possible that the unit is too small and would start trying to play when you were clipping it on to things, but hey thats what the on/off switch is for right...
I found myself needing to create new sql users and roles with permissions from existing users in the database in order to tidy up some database logins. After an hour or so of searching I still hadn't found anything like what I was looking for so I asked on experts exchange.
One of the users posted this great sql script from Vyas website which creates a SQL script to set the permissions on a user or role to that of an existing user or role.
All you need to generate a change script is set the @OldUser and @NewUser parameters to those in your database and run the script. The great thing then is that you can edit the script that this script generates (eg remove some grant or denys to certain objects) before you execute it on your database.