Skip to Content »

FlashApe » archive for September, 2008

 Cool MySQL increment/decrement value tip

  • September 28th, 2008
  • 7:34 pm

I needed to adjust a value in a column in a database table by 1, for all rows. I found out you can do it easily by doing this:

PHP:
  1. $sql = "UPDATE images SET displayIndex=displayIndex +1 WHERE gallery_id=1";

Turning that into a function we can specify if we want to increment or decrement the value pretty easily. You can also provide a starting point for the adjustment (so if you delete the item with displayIndex=15, you only want to decrement the displayIndexes greater than 15 by 1) and specify a different value for the WHERE clause:

PHP:
  1. public function updateDisplayIndexes($galleryID, $startIndex, $add = true){
  2.    
  3.     $operator = ($add) ? '+' : '-';
  4.  
  5.     $sql = "UPDATE images SET displayIndex=displayIndex".$operator."1 WHERE gallery_id=$galleryID AND displayIndex> $startIndex"
  6.     $result = mysql_query ($sql);
  7. }

There's a lot more you can do with it but it's been a pretty good starting point.

 Adobe Announces CS 4

  • September 23rd, 2008
  • 12:16 am

Adobe has new info up about the upcoming release of their CS 4 suite. Checked out the Flash content, I'm a little ambivalent...the new features don't really do too much for me, though I have to admit it's nice to see Flash get back to more of it's animation roots. I wonder if they're going to revamp the component architecture again?

 Dropbox rocks

  • September 16th, 2008
  • 11:25 am

If you haven't yet checked out Dropbox, the slick file transfer/sharing/backup tool, you should. It's one of those things that reminds me that computers supposed to be here to make our lives easier, not harder. It's so easy, even my wife was excited about it ("Cooooolll !!!" :) )

Dropbox installs on your computer and completely integrates with the filesystem...it's actually just a folder (your 'Dropbox') you drag files into. In your dropbox you have a public folder, and once you drop a file within the public folder, you can right-click on get the web URL for that file. You can then send that url to anyone you like and they can view that file.

In addition to your Public folder, there is a 'Photos' folder. Dropping images (or a folder of images) into that folder will create a public photo gallery with thumbnails.

You can also create Shared folders within your Dropbox, to be shared only with specific people.

Your drop box also keeps a version history of your files, so you can roll back to a previous version, a la Time Machine.

There are two small downsides I can see so far with Dropbox. First, as of right now they have a 2 gigabyte limit. Two gigs of backup for free is not that bad I guess, but I think 5 would be a better starting point. Regardless of that, they will soon be offering paid plans to increase storage, and I'll be jumping on that immediately...goodbye local hard drive backup.

The other issue I have is that you must place everything within your Dropbox....so for example, if you wanted to share your Iphoto library you would need to copy the images into your Dropbox. I think they are working on allowing for watched folders as well. Mac (and I'm assuming linux) users can get around this by creating symbolic links in the dropbox.

Overall, 4-stars, two thumbs way up for Dropbox.

Note: I have no affiliation with Drobox, it's just love at first sight.

 Dear Adobe - Thanks for the 32gb iPod Touch!

  • September 9th, 2008
  • 10:03 am

A while ago I filled out a survey for Adobe which was offering 32 gb iPods as a prize to random submissions. The other day FedEx dropped one off...woo-hoo! That'll sure motivate somebody to fill out future surveys :)

Thanks again!

 Wow - I’m somebody’s Dad!

  • September 4th, 2008
  • 9:46 am

Last Friday my wife and I welcomed our first child, a boy, into the world. He was born happy, healthy, and, of course, is the most beautiful baby ever to be born in the history of mankind :) . Seriously though, he is absolutely fascinating, I can sit there and just watch him and be completely entertained for hours. Now I can relate to all the dads I spoke to before who kept telling me there's just nothing else like it...they were absolutely right, it's indescribable.