Ramblings on technology with a dash of social commentary
RSS icon Email icon Home icon
  • Read Free Book Online: Thinking In Java

    Posted on July 21st, 2010 phpguru No comments
    Read the online e-book, Thinking In Java - free!

    Read the online e-book, Thinking In Java - free!

  • How to set the transparency of the Terminal window on Mac

    Posted on July 16th, 2010 phpguru No comments

    Thanks to this post on MacObserver, which explains you can make your terminal window semi-transparent. It helps, for instance, if you’re trying to type in some sample commands from a web browser in the background.

    1. Just go to Terminal -> Preferences -> Settings -> Window
    2. Click the background color chip
    3. Drag the opacity slider to the left.
  • Spaces Are Very Cool - Keyboard shortcuts to switch between running apps

    Posted on July 13th, 2010 phpguru No comments

    spaces-icon

    If you have a Mac and aren’t using spaces for multi-tasking, you’re missing out on one of the great features of modern OSen. Encapsulation.

    Even novice computer users understand that a computer can run more than one program at once. Using many apps simultaneously is called Multitasking. For example, you can edit your vector artwork in Illustrator, import the .ai file into Photoshop and apply effects to it, and use the PSD in an InDesign layout. You can run all 3 programs at once, and edits are instantly available in the other softwares when saving. As a web developer, I’m routinely running multiple browsers, an IDE (I use NetBeans and Dreamweaver), a text editor (on PC I use UltraEdit and TextMate on Mac), plus Photoshop if I have to work on any design elements.

    Well, multi-tasking is one thing. But are you getting the most out of your 8GB of RAM and quad-core processor? Encapsulation, such as provided by Apple Spaces, takes it one step further and makes staying organized and more efficient easier than ever.

    If you’ve ever spent any time on a laptop after using a dual screen setup, you’ve gotten really friendly with Alt-Tab (application switching) and Control-Tab (tab switching in one browser, or window switching in applications like Photoshop or Microsoft Word).

    As a platform-agnostic PC-at-work / Mac-at-home kinda guy, I always think it’s great when Apple takes a killer feature from the PC world (the reverse applies, too, though less often) and makes it better. For the longest time on Mac, I yearned for an easy way to switch between applications like you could on a PC.

    Keyboard Shortcuts to Switch Between Applications on Windows

    To switch between running programs on Windows PC try these steps:

    1. Hold down the Alt key,
    2. and then press the Tab key,
    3. and press the Tab key to cycle forward through running apps,
    4. or hold the Shift key and press Tab to cycle backward,
    5. and let go of the Alt key to use the selected App

    Go ahead. Launch a few programs and practice. It sounds more complicated than it is and will become second nature to you in no time.

    Anyway, at some point in the past, Apple adopted this feature for OS X… and made it even better.

    Keyboard Shortcuts for switching between running applications on a Mac

    On a Mac, to switch between applications, you need to:

    1. Hold down the Command key,
    2. and then press the Tab key,
    3. and press the Tab key to cycle forward through running apps,
    4. or hold the Shift key and press the Tab key to cycle backward,
    5. and let go of the Command key to switch to the highlighted app,
    6. Or, while still holding the Command key, hover your mouse over any app you want to switch to before letting go of the Command key.

    Just by adding that single OR at the end, Apple made a fantastic productivity tool exceptional.

    For the record, on a Mac, from the running app, you can choose [Application name Menu] -> Hide [Application name] or [Application name menu] -> Hide Others… which applies to the running applications. And you can also option-click on the finder (background application) when you have an application open in the foreground to instantly hide the foreground application. And of course there’s the yellow minimize icon that stuffs the app into a spring-loaded folder in the dock, but I digress.

    appsutil_spaces20090608Now, for the frosting on the cake.

    What are Apple Spaces?

    Imagine having 4 or 8 Macs instead of one. Would you be more productive if had 4 Macs and you could switch between them instantly? Apple Spaces lets you have the appearance of several virtual machines (all copies of your Mac). What’s cool about spaces is now you can run a couple of different browsers in one space, iTunes in another space, and your web development tools in a third space, and all your design apps in a fourth space. This keeps all those floating palettes and application windows more organized and is a great new way to gain even more productivity. By utilizing Spaces, you’ll spend less time application switching because each Space contains its own list of programs assigned to that space. And all those seconds can really add up, especially if you’re on deadline.

    1. Enable Spaces by going to  -> System Preferences -> Exposé and Spaces
    2. Then, to activate Spaces, press fn+F8.
    3. With the Space selector activated, you can drag apps from one space to another,
    4. and to switch between Spaces, you can use Ctrl-Right-Arrow and Ctrl-Left-Arrow to move between spaces,
    5. or to instantly go to a space, hold Ctrl and type the number corresponding to the space, for example, Ctrl-2 instantly switches to the second space.

    Give that a try, Mac guy. If you don’t think Spaces and application switching is useful, you’re wasting time and missing out on the full potential of a modern computer’s power.

    References
    macworld.com
    discussions.apple.com

  • What is ORM and why should you use it?

    Posted on May 11th, 2010 phpguru 2 comments

    I’ve been asking myself this question a bit more lately so I wanted to find some answers. Nowadays, ORM typically stands for Object Relational Mapping, and less commonly, Object Role Modeling, although the two concepts are related. Mainly I am curious about some of the new ORM implementations for Kohana 3, namely Sprig (based on Django) and Jelly.

    The first page on this topic can be found over at Stack Overflow.

    On the StackOverflow page is a link to this post by Glenn Block on the MSDN blog. I found it a bit surprising that this particular post hadn’t been voted on by any other Stack Overflow members as I found it an insightful and succinct explanation of why you might want to consider using ORM.

    I noticed another topic that comes up in relation to ORM is DM, the Domain Model pattern, and DDD, Domain Driven Design. I thought this post entitled DDD - why bother? was an interesting take with a terrific example illustrating the benefits of an ORM system.

    This post was inspired by Koes.

  • Dreamweaver slows me down too

    Posted on January 12th, 2010 phpguru No comments

    This blog is great. Tons of people expressing the same thing I’ve been feeling lately… Dreamweaver is just slow.

    I recently switched from Dreamweaver CS3 on Windows (running under Bootcamp on a Macbook Pro) to Dreamweaver CS4 running under Snow Leopard. I also upgraded from 2GB to 4GB of RAM. Dreamweaver CS4 is almost unusable in Design mode, on longer documents. Maybe I have to run disk utility or something, but sheesh.

    I’ve enjoyed using Dreamweaver for many years, but why is it that as computers get faster and faster, Adobe software gets slower and slower?

    As I’ve pointed out before, Adobe makes some of the most expensive software out there. Why doesn’t it work better?

  • Git for Subversion Users

    Posted on December 23rd, 2009 phpguru No comments

    I just spent a few hours reading up on Git, and have to admit I saw the light. One of the coolest features of Git is that it is distributed and provides an easy way to have a repository made up of smaller sub-repositories (called submodules in Git). Try that with SVN! Why does this matter? What’s so cool about Git? you may be wondering… Well, because the Kohana 3.0 source code is stored in several Git repositories, you can easily checkout the source to a local working copy, including only the modules you want, and also build your application in a local Git repository.

    All of the following links are really helpfu.

    Git for Subversion users, Part 1: Getting started

    Git for Subversion users, Part 2: Taking control

    git-svn is a gateway drug

    Git Manual

    Git User Guide

    Guide on using Git with Kohana

  • Adobe Pushes Flash, PDF to US Government

    Posted on November 6th, 2009 phpguru No comments

    The article about the security vulnerabilities of Adobe Shockwave on Slashdot also posted this, linking to an Ars Technica post about how Adobe is peddling Flash & PDF technology to Uncle Sam. Trouble is, what if you don’t want to install Flash or Acrobat Reader?

    Do you really want to be forced to install Adobe software on your computer in order to access certain government forms and information?

    What if you’re blind, or still use DOS? What if you wanted to access a government form on your phone? Please government, use open standards like Text, XML, XHTML & CSS for various devices, screen readers and easy & fast searchability.

    I admit that I’ve used many interactive forms in the PDF format, always to send the mercenaries more of my hard-earned money.

    So my plea is this: Washington, please! Stop making us all fill out so many damn forms and stick to open, accessible standards, please!

  • Shockwave Breaches Security in a Big Way. Adobe Breaches Etiquette in an even bigger way

    Posted on November 5th, 2009 phpguru No comments

    Slashdot just reported that the Macromedia Adobe Director Shockwave Player may have security holes affecting millions of systems. Not the popular Flash plugin, but the evil twin that disappeared into the shadows years ago.

    This is particularly saddening for a proud former Director and Shockwave developer. If you have the shockwave player installed, just go ahead and dump it.

    I cringe as I say that, know that within the last several months, dozens of really smart people people I have known through the Direct-L and have been helped by countless times over the years are dropping like flies, and finding other platforms for multimedia development in an increasingly hyper-connected online world.

    Back in the day, way before the Internet, before everyone had a modem, there was multimedia. We’re talking the days of floppy disk mailers and DeBabelizer, LivePicture and hypercard. Learning how to compress graphics for a whole interactive experience in under 800k or 1.4mb. A floppy, then a mini CD, then a CD, then a DVD. Making the most engaging theatrics fit on tiny media was only one end of the spectrum. For years, Director was the de-facto coolest way to build intensely immersive, room-filling, museum quality experiences. With Director you can used to be able to connect monitors for gallery shows and museums and plug in lights and control cameras. As amazing as the best Flash websites are, they pale in comparison to the insane stuff we were doing 5 to 10 years ago with installations, fullscreen video, and the first 3D animation software as it essentially became available to the masses. I remember trying out CoSA AfterEffects 1.0. I beta-tested PhotoShop 1.0. I was already cutting rubylith with an exacto and couldn’t wait for Illustrator 88 to come out. I made some of the best posters with LivePicture, painter, Expression and Kai’s Power Tools.

    Anyway, I digress. Reading the Direct-L lately has really sucked. I’ve been debating dropping the subscription for quite a while now, but I somehow enjoy remeniscing as various people describe tasks in Director. Lingo has a quiet elegance to it. It was fun while it lasted.

    I’ll break it down for you. Adobe acquired Director (and Flash and Freehand and Fireworks and some other goodies like ColdFusion server) when they bought Macromedia. Since they had their own tools like Illustrator (bye-bye Freehand) and Photoshop (cya Fireworks), Flash’s smaller runtime and fast vector routines made it ultimately the next cool way to, again, make graphics and stuff smaller (remember the floppy disk mailers?), thereby sealing Director’s fate, since it was more meant for making big projects with pristine media quality for CDs and DVDs, multimedia projects that are just much too big for our slow 24kbps dialup.

    Here’s the painful irony: Now that the web and internet speeds are catching up to delivering amazing quality HD theater experience we once dreamed of, Adobe has let Director languish for so many years that it barely works, and the best and most evangelistic Director gurus have abandonded it in favor of other tools (particularly for online realtime 3D, really the only reason to still play with Shockwave) that are either supported by their makers or open source.

    I really feel for anyone who continued to put their faith in Director and Shockwave over the past few years as Adobe gave you the shaft. It really stings and kills your confidence and enthusiasm for your craft when the tool maker decides to stop making the tool.

    Adobe, you have not only breached security and etiquette, you have alienated some of your biggest fans and most ardent supporters.

    Speaking of which, I just shelled out nearly a grand for my Adobe Master Collection CS4 upgrade for Mac and when I entered my Adobe Master Collection CS3 Windows Serial Number activation said it was invalid. Thank you, Adobe, for squashing some really cool programs and for my $949 30-day trial.

    I think I’m going to download Gimp and use Aviary from now on.

    One final note. If you’re not angry at Adobe, maybe you could be angry at Aptana, as some other smart people I know are, for their recent move to stop supporting their PHP plugin. These software companies are really starting to tick me off. But you really can’t blame Aptana for moving (albeit silently) to become the best Rails IDE, it’s a pretty smart move for the small open-source software provider. At least you Aptana users didn’t spend the last 10 years shelling out thousands of dollars to Aptana for your free web development IDE.

    Update 2009/11/03: Adobe has released some security fixes. So maybe, if you still use Adobe Director and Shockwave, try the Shockwave Player version 11.5.2.602 update.

  • Snap To Grid is Broken in Illustrator and always has been

    Posted on October 18th, 2009 phpguru 1 comment

    I was just reminded of one of the reasons why I hate Adobe. Aside from the fact that they abandoned the great tools from Macromedia including Freehand and Director, even their flagship vector editor, Illustrator, can be extremely frustrating… when it comes to their woefully broken Snap-To-Grid feature.

    At least one other blogger feels the same. I just commented on his blog post about terrible snap to grid performance.

    In a nutshell, it seems perfectly logical. Adobe owns Illustrator, Flash and Photoshop, and these are probably their top 3 sellers, so you’d assume these tools would work well together. Think again. Broken! You create a 1-pixel grid in Illustrator, turn on snap-to-grid and expect everything to just work. Well, it doesn’t.

    Here’s a list of things that just plain don’t work:

    1. You create an object using drawing tools. It’s all snapped to grid perfectly. You can then edit points and drag them off the grid.
    2. You grab a handle with the Free Transform tool. Sometimes it will snap to grid, other times it won’t.
    3. You make a symbol out of an object that is all snapped to the grid, and drag another instance onto the page. Sometimes it snaps, sometimes it doesn’t.
    4. You edit a symbol in context. If it was snapped, sometimes just clicking into the symbol to edit it unsnaps the object points.
    5. You edit a symbol in context to snap the edges and points to the grid and escape the symbol. The symbol is now unsnapped.
    6. You have an object that is snapped to a 1px grid, copy and paste it to Photoshop. Your line edges are now antialiased. They shouldn’t be - a 1px wide piece of vector art in Illustrator becomes a fuzzy blob when pasted.
    7. As Steve pointed out on his post, You type in values for widths or heights of objects that should be on the grid. Save, close and reopen your document and you’ll see that Illustrator added minute amounts of measurements to your object. Presumably these are rounding errors? It’s unclear.
    8. You click the pen tool and assume that when you click to draw a path, all points will always be on the grid. They almost never are.

    There’s probably several more examples. Basically snap-to-grid is useless. Come on Adobe - get your act together.

  • How to Move your Magento Store to a new URL

    Posted on June 20th, 2009 phpguru 2 comments

    Since writing this post on installing Magento, I discovered a lot of unique features of this amazing open source ecommerce platform. With that said, there’s still so much I need to learn about that I decided that I’d rather get a simpler site up for my home page URL, and move my Magento install to the ’store’ directory on my server and create a subdomain for it (store.example.com).

    Moving your Magento store to a new URL is actually incredibly simple, but I did run into one confusing step that I’ll warn you about in a moment.

    Now, like the typical male stereotype, I don’t ask for directions. I’m the type of person that assumes everything will be easy, simple, and straightforward until I discover otherwise, hit a road block, or can’t figure it out on my own. I’ve been burned enough times over the years that I’ve learned one simple thing that can save hours, if not days or even a lifetime of anguish. Backup often.

    1. I start out by synching and creating an entire backup of my Magento install. I did this using Dreamweaver’s synchronize feature and phpMyAdmin to export the current database. I dropped the .sql.gz from phpMyAdmin into the root directory of my local working copy and the created a zip of the whole thing with WinRar.
    2. Next, I created a subdomain in CPanel, called store, and added a new cname record  at my DNS provider.
    3. Third, I updated Dreamweaver’s profile for the site, by adding /store to the remote FTP path field. I clicked Test and it resolved ok.
    4. Next, in Dreamweaver, I clicked the top folder of the site in the Files panel and typed Ctrl-F. I searched the entire Magento installation directory for my original domain name. I figured with this technique I’d discover anywhere Magento’s web-based installer had written its config files to or any path information. This took a little while based on the rather large number of files required to run Magento.
    5. Oddly, I found something in the downloader/pearlib/php directory, changed it, and synchronized. I wasn’t changing my database username or password, so there was no need to edit etc/local.xml.
    6. Next, I logged into the database using phpMyAdmin. I clicked on the main database name in the left panel, then the Search tab on the right. I entered just the part of the domain without the extension, in MySQL wild-card fashion, like so: ‘%example%’ (for example.com, no quotes). I selected every table, and clicked Go.
    7. phpMyAdmin found two rows in the core_config_data table, and a few others in the cms content and log tables. I clicked on core_config_data table’s Browse link, and updated two rows with my new URL, http://store.example.com.
    8. After lunch, my TTL on the cname addition to DNS was propogated, so I gave it a test at http://store.example.com. It half worked. I was getting my site content (the php/html was working), but no CSS, just a blank white Times New Roman site with tell-tale blue links.
    9. Here’s where the hidden gotcha is, that I told you I’d warn you about above.  I hope this saves you some time if you’re reading this post wondering why your Magento store has can’t find the CSS after moving it. Delete the contents of the /var directory. I did this using
      > cd public_html/store/var
      > rm -rf cache
      > rm -rf session

      from SSH.

      I wasted an hour trying to figure out where else Magento could be set to look for the path to CSS files before having the idea that Magento may be making a cache somewhere. As a PHP Fusebox developer, and having used the Smarty template engine, I’d seen a web app create temp files before. It’s not too uncommon for web applications to create some kind of parsed files to help aid performance. Sure enough, Magento creates parsed files in the /var directory, which must be deleted (and rebuilt after applying the new settings).

    10. Browse the site. Did it work? It worked for me.

    Thanks to Damián Culotta for his post on the Magento Forums on this  same subject.