Latest Entries »

10 Most Downloaded iTunes Songs

Rack ‘em.

But, if Lady Gaga has given us anything (other than a migraine) – its Igor Presnyakov’s beautiful rendition of “Poker Face” that is 10000 times better than the original. THIS is a musician.

I have officially ditched and uninstalled Adobe Dreamweaver as of last week.

Adobe Dreamweaver, an IDE of choice out of reason of limited option and necessity, I had been looking at it as nothing more than bloatware as its performance started degrading over time. It was ‘okay’ for Coldfusion development (only due to the code intelligence really), but I don’t do that primarily anymore, only when handling legacy stuff and that is rare these days. It also costs a few grand a year to upgrade to the latest version of CS with enough licenses to supply the office, and I don’t agree with that either. I see the value in Photoshop, but not much else. That money is better used elsewhere. I mean what is Dreamweaver anyway other than a pricey text editor? Does anyone really use Spry or all the crap inside Dreamweaver? I’m betting on ‘no’ and if they are, god help them.

Also, I was getting increasingly frustrated with TortoiseSVN client, its bugginess, clunky UI and major hog of system resources. It would often slow me down as it was doing whatever it does in the background in regards to caching. If I had more than 5 projects that were SVN managed, I would lock up quite often when browsing around the file system. I assume Tortoise was trying to update the caches with the remote server. It was even worse when we used hosted Beanstalk SVN outside the office.

Enter Eclipse. I have used Eclipse sparingly in the past, in 2006 and 2007 when it was not quite as stable as it is today. I also had a good trial run of Aptana, before they discontinued support for PHP. Aptana was based off of Eclipse, it had FTP/SFTP/SVN integration (Eclipse itself did not back then) and the tools necessary to get the job done. However, we still did Coldfusion at the time, and it wasn’t good for that. So the effort was shelved. Now we are Drupal/PHP ninjas, and it was time to revisit this IDE and step into the upper tier of application development.

I demo’ed Komodo Edit, Eclipse PDT, and Aptana. Aptana did not support PHP anymore, only older versions did, and it was prone to crashing on our machines quite a bit. It was immediately thrown out the window. Komodo would seem like a good fit, but the free version does not support debugging, CVS/FTP/SFTP/SVN integration. It was also disqualified. So we’re back to Eclipse PDT.

After spending 20 minutes customizing the preferences to my liking, we were up and running. I installed the Subversive SVN plugin with appropriate SVN connectors. I can’t begin to tell you how much better this is than using TortoiseSVN. Integration within the IDE is essential, and powerful. I have the SVN repos in one monitor and my workspace in another monitor. After reading a little documentation, all it takes is a simple Check Out command from the SVN Perspective, and Eclipse does the rest. It can check out a site that is 1000-2000 files in about 30 seconds very quickly (Tortoise would choke), automatically create the project for you in your workspace, and you’re ready to develop. Compare that to having to Check Out to a directory somewhere, open Dreamweaver, create a site, find the files, blah blah blah. That shit is amateur and time consuming and these days and time is money.

Another great thing about Eclipse is they have stable releases for Windows, OSX, and Linux in both 32 and 64 bit. I can take Eclipse, add the plugins I need, then put that on a USB drive and use it from any other Windows or OSX system where needed and nothing will have changed. Try that with other IDEs that require installation and all that headache. That’s right, Eclipse doesn’t require installing. For example, I could take Eclipse PDT, add the plugins that we need, and distribute it on the local network. Boom, every employee has the same uniform version of Eclipse without requiring any configuration, plugin downloading, or license activation.

Giggity.

I Miss Arcades

I miss arcades.

I know there are still arcades in some degree of its definition out there, but it’s just not what it used to be, not like when I was growing up. It must be hard for publishers/developers to even produce ideas for arcade units anymore given the technology available in the consumer market like the Xbox 360 or Playstation 3. From a financial standpoint I can see where its not worth it for them. Hell, I have a Playstation 3, and previously had a 360. Both come with online stores, both also have a ton of vintage games for sale (with new features). The thought of even going to an arcade is already considered a ‘back in the day’ sort of past time. Honestly, you can turn on your system and in a few minutes be playing with people around the world. What’s the incentive to leave the house?

But really, who doesn’t miss the classic arcade? Arcades where the lights were dimmer than its surroundings, enhanced by the warm glow of rows of games, warmer than outside from all the machinery. The blips, bloops, the beautiful sounds of quarters dropping into the coin slot. Players squaring off in heated rounds of Mortal Kombat or Street Fighter, collaborating in the six man X-Men game, crowds gathered around watching someone on a hot pinball streak or people enjoying a good lap in Daytona USA. Arcades where $5 would last you for hours, everyone lined up to play the new Ninja Turtles game or The Simpsons epic game.

For me, my love of arcades began when I was 5 or 6. One of the very first games I recall playing was Spy Hunter- how can you not love this game? Classic ‘Peter Gunn’ like theme as you weave in and out of cars trying to take you out, going 100 miles an hour and getting upgrades by driving up into tractor trailers every so often. If it wasn’t that, it was Gauntlet, Galaga, Gyruss, Pac Man, Donkey Kong or anything like them. One thing was for sure, if I wasn’t spending time saving up quarters, the rest of it was dropping them into these games and just enjoying the experience.

I was in the right place at the right time at the right age to experience the golden age of the arcade. Companies are trying to instill nostalgia by offering the same games on consoles, but the effect is cheap, flimsy, and cold, at least for me anyway. It’s just not the same. I miss arcades.

Drupal ships with a powerful method of packaging and redistributing your platform configuration called Install Profiles. It is similar to how Linux distro’s work, where you have the same core operating system, but extensive customization results in a different experience (Fedora, Ubuntu, Debian, etc). This allows us to employ rapid application development (RAD) after finalizing a build of a customized Drupal application.

There are some ‘gotchas’ though if you develop custom Drupal modules like we do. During the install process, Drupal only bootstraps the bare minimum to get the job done. I’ve noticed that if a module’s install routine calls functions outside of the .install file, the expected result tends to fail because files other than .install are not included during this loading process. It seems there is a special case for the file to be included, or you have to specify in your install profile to explicitly include the file (which takes a lot of time to do). To be specific, I have seen this happen with Drupal Boost, Drupal Gallery Assist, and our custom module Billboard, which tipped me off to this problem. The issue has since been fixed in Boost (and Billboard).

For us, the issue was creating custom ImageCache presets during a module’s install routine. This worked perfectly if you were going to the Drupal Modules page and enabling Billboard. What happens was the hook_install() function fired, included a definition file, and created presets based on that file. This fails during a Drupal install profile, where you use a script to install and configure Drupal automatically. This same issue occurs in Gallery Assist, and here is how I got around it:

It was pretty apparent that the code needed to come out of the install function. However, I needed to be sure that where I put the code would be compatible to the module loading process, and I’d need to be sure ImageCache was both installed and loaded before running the following code. Otherwise it would error out, and no ImageCache presets would be created.

Drupal has a crucial hook for modules. hook_init() allows you to perform tasks every time the module is loaded. In this case, I wanted to tell it to run a function and check for two default ImageCache presets. If they didn’t exist, create them. This approach solves three issues:

  1. Getting around install profile limitations
  2. Provide default ImageCache presets for Billboard module when it is enabled
  3. Recreate the ImageCache presets if they are accidentally deleted by the user (or developer :) )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function mymodule_init() {
    mymodule_create_default_imagecache_presets();
}
 
function mymodule_create_default_imagecache_presets() {
 
    $default_size = imagecache_preset_by_name('mymodule-default');
    $thumb_size = imagecache_preset_by_name('mymodule-thumb');
 
    if (count($default_size) == 0 || count($thumb_size) == 0) {
        if (count($default_size) == 0) { 
            $mymodule_default_size = "600";
            $mymodule_thumbnail_size = "80";
 
            $presets = array();
 
            // Default size.
            $presets['default'] = array (
            'presetname' => 'mymodule-default',
            'actions' => array (
 
                  'weight' => '0',
                  'module' => 'mymodule',
                  'action' => 'imagecache_scale',
                  'data' => array (
                    'width' => $mymodule_default_size,
                    'height' => '',
                    'upscale' => 0,
                  ),
 
              ),
            );
 
            imagecache_preset_save($presets['default']);
            $presets['default']['actions']['presetid'] = db_last_insert_id('imagecache_preset', 'presetid');
            imagecache_action_save($presets['default']['actions']);
            imagecache_preset_flush($presets['default']);
            imagecache_presets(TRUE);
 
        }
 
        if (count($default_size) == 0) { 
            $presets['thumb'] = array (
            'presetname' => 'mymodule-thumb',
            'actions' => array (
 
                  'weight' => '0',
                  'module' => 'mymodule',
                  'action' => 'imagecache_resize',
                  'data' => 
                    array (
                      'width' => $mymodule_thumbnail_size,
                      'height' => $mymodule_thumbnail_size,
                      'upscale' => 0,
                  ),
 
              ),
            );
 
            imagecache_preset_save($presets['thumb']);
            $presets['thumb']['actions']['presetid'] = db_last_insert_id('imagecache_preset', 'presetid');
            imagecache_action_save($presets['thumb']['actions']);
            imagecache_preset_flush($presets['thumb']);
            imagecache_presets(TRUE);
 
        }
    }
 
    return;
}
?>

What that says basically is ‘hey, do our default ImageCache presets exist?’ if not, it will create them at runtime.

I have tested this a handful of times with positive results, and, it works with install profiles since hook_init() is called after Drupal loads. Food for thought for all you Drupal developers out there. If there is a better way to achieve this feel free to leave a comment.

Powered by WordPress. Theme: Motion by 85ideas.
Kevin Quillen is a web developer on the east coast specializing in web design, web hosting, custom website design, website design, web applications, Coldfusion development, database design, MySQL / MSSQL database & consultation, PHP development, Wordpress themes, iPhone application development, Drupal hosting, Drupal development, logo branding, business logic, custom application programming, Linux and Windows Server management and more. All views and opinions posted in this blog are original. Do not copy without permission, but feel free to share an article.