August 16, 2010

Some lessons about Ruby Plugins

Kevin Hallmark @ 11:25 am —

So I have been having trouble getting plugins working with my Ruby app. I followed the directions here: http://peepcode.com/products/rails-2-plugin-patterns and it was working pretty well.

However, I came across two “gotcha’s” that gave me a little trouble.

  1. You have to include init.rb
    This fact was not readily apparent to me, I thought ruby would just take care of it. In my case, I had to add the init.rb into the app. This is probably obvious to you Ruby veterans, but not me as a n00b.
  2. You have to include your plugin’s file into init.rb
    Again, this seems like a no brainer. It’s not. You have to add each file you want your plugin to us to some file included by init.rb.

Obligatory plug for the peepcode above. If you’re just learning about plugins and Ruby, that peepcode is worth every penny

May 12, 2010

Google launched a new design, and I hate it

khallmark @ 10:15 am —

Update 2:

Apparently, you can get the old interface back with a little hack.

http://www.gtricks.com/google-tricks/how-to-get-old-google-interface-or-layout-back/

Update:

You can complain here: http://www.google.com/quality_form

For uniformity, let’s complain using the same options. Select the option from my screenshot below.

Dear Google,

The new left navigation is horrible. Don’t get me wrong, I like the functionality the left rail exposes. I like being able to easily filter my results by content type, date, etc… but I don’t want those features in a left rail.

Simply put, the left rail undermines what originally made Google great: simplicity. Google has always been visually simple, allowing me to easily scan search results. The new left rail is just a distraction. It takes some of the most valuable screen real estate and fills it with something that is not always needed.

The most important information on the page is my search results, not the sorting, filtering, or ordering therein. When I use Google, I want to access search results 100% of the time. The algorithm is so good, most of the time I don’t even need to refine my results because the answer is right there. I want to filter my results significantly less often.

The search filtering might be better suited to a right rail: there when I need it, ignorable when I don’t.

The new left rail also removes an important visual cue from the page: the browser left edge. My brain naturally tracks to the left edge of the browser window, much like reading a book. Now, instead of shiny clean search results, I get the left bar. While there is still a line for visually tracking the edge of search results, its soft coloring doesn’t give you a strong visual cue for the left edge of the content area; the contrast between the browser edge and the page is still a stronger cue. I end up scanning to the left edge of the browser, bringing my attention back to this evil left rail.

I understand that you want to advance your search engine, exposing more features to your customers. I’m all for it. However, those changes should not come at the expense of a tried and true product. You should let long-term customers retain their current configuration, if they desire. Give users the new look by default, but let account holders turn it off.

Remember “New Coke”? Instead of replacing their tried and true product, they could have released it alongside their flagship product. Don’t repeat the mistakes of your predecessors!

Please don’t make me hack it away.

Thanks,

Kevin

March 11, 2010

Recent Downtime

Kevin Hallmark @ 11:34 pm —

Sorry for the recent downtime! Should be back up and good to go. Cool

February 21, 2010

The IKEA Experience

khallmark @ 12:01 am —

I needed a dresser. The one I’ve had since I was a child is falling apart, and it’s just not big enough for both myself and my wife. It was time for a new one. After evaluating all the choice online, I ended up going with Ikea. Instead of ordering it online, I decided we’d trek out to the Ikea store instead. I wanted to have the Ikea Experience.

Suffice to say, it’s an interesting experience.
» read more

February 13, 2010

The new Little Black Hat

Kevin Hallmark @ 9:41 pm —

Welcome to the new Little Black Hat site. Over the next few months, I’m going to be adding some great new features to the site. First, I’m planning to add a project gallery to the site. This will let you see what I have been up to. I’ve also got a few projects to open source, so those should be coming soon as well. For visitors looking for information about my services, there will be something for you too. Overall, I expect things to happen here much more regularly. I love coding sites from scratch, but Wordpress helps me in this time crunch world. No need to reinvent the wheel. :-)

January 28, 2010

Remote Debugging PHP on Mac OS X using xdebug and MacGDBp

khallmark @ 4:38 pm —

A debugger is one of the most powerful development tools available. However, with PHP, debugging a site can be tricky. A lot of times, the host you need to debug is remote. Xdebug, the PHP debugger, solves this problem with their remote debugging feature.

Unfortunately, getting remote debugging with xdebug setup on Mac OS X can be a little tricky. This tutorial will help you setup your environment for easy remote debugging using Xdebug and MacGDBp.


» read more

November 5, 2009

PHP 5.3 and the dangers of ‘goto’

khallmark @ 9:14 pm —

PHP 5.3 came out recently. For better or worse, the great PHP gods decided it would be a good idea to add ‘goto’ to the language. Up until now, PHP has never had ‘goto’. The question I’ve been bouncing around in my head is “Why?!”. In my 15 years programming (yes I really have been programming since the age of 10), I don’t think I have ever used a “goto” statement in a real program. Maybe in my first Hypercard stack, or using Basic in my 7th grade computer class, I may have.

My stance has always been, and will always be, ‘goto’ is a crutch for the lazy. It enables bad design. Sure, it might be easier to code one rare algorithm using a ‘goto’ statement. This is not the majority. The majority of algorithms can be implemented without ‘goto’, it just takes more thought. I cannot think of any algorithm that requires ‘goto’.


» read more

July 2, 2009

On the dangers of goto

khallmark @ 12:27 pm —

I had this big long essay prepared, ranting about how much I hate ‘goto’, and why it’s so evil (especially in php). However, xkcd has made that all irrelevant.

http://xkcd.com/292/

Remember kids, friends don’t let friends use ‘goto’. It gets you eaten by a velociraptor. Or grue (if you’re coding in the dark).

May 29, 2009

Setting up Tomcat 5.5 on Mac OS X 10.5

khallmark @ 8:38 am —

Installing Tomcat 5.5 on Mac OS X 10.5 is a fairly easy process. I have adapted and distilled these directions from the Apache Foundation Tomcat Wiki. I also have modified the provided Startup Item provided on the wiki and I have made it available for download from this site.

Installing Tomcat

  1. Download Tomcat 5.5 from the Apache site. You’ll want to download the latest version of the “core” package (this is all you need to get Tomcat started)
  2. Put the contents of the package in your favorite install location. From now on we’ll call it DIRECTORY. I choose to put mine in “/opt/local/tomcat” because this is the location of my MacPorts files. You could easily put it anywhere. Remember DIRECTORY, you’ll need it later.
  3. Fix the permissions. The recommendation by wiki is to set wide open permissions, to make all the files 777. Realistically, I feel like there should be a more restricted permission set that should work.
  4. Open Terminal.app (/Applications/Utilities/Terminal.app)
  5. Navigate to DIRECTORY
  6. Type “./bin/startup.sh” into the Terminal and hit enter
  7. Test the server by going to http://127.0.0.1:8080. You should see a the default Tomcat page, which looks like the image below.

 

Tomcat is working properly

Tomcat is working properly

Installing the StartupItem

Once you get Tomcat installed, you’ll probably want to install the StartupItem as well. This will allow Tomcat to start on boot.

Download the archive

  1. Add this line to /etc/hostconfig as root:
    TOMCAT=-YES-
  2. Open the downloaded archive, it should unzip to a folder called Tomcat
  3. Open up the file named “Tomcat”
    1. Update line 12 of the script to point to your DIRECTORY
      export DIRECTORY=”/opt/local/tomcat”
    2. Update line 15 to point to the version of the JDK you want to use
      export JRE_HOME=”/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home”
  4. Copy the Tomcat folder to /Library/StartupItems/Tomcat
  5. Open Terminal.app and type the following commands
    1. cd /Library/StartupItems
    2. sudo chown -R root:wheel Tomcat
    3. sudo chmod -R 755 Tomcat
  6. Use the script to start/restart the server by typing 
    /Library/StartupItems/Tomcat/Tomcat [start|stop|restart]  
  7. The server will now start on boot
  8. TIP: You might want to add an alias to this script in your .profile
    alias tomcat=”sudo /Library/StartupItems/Tomcat/Tomcat” 

April 30, 2009

In Pursuit of the Perfect Dev Environment: Textmate PHP Syntax Validation

Kevin Hallmark @ 10:07 am —

cssgallery.info has an article about validating your PHP syntax automatically on save using Textmate. This is incredibly valuable. No more uploading files with bad syntax!

http://cssgallery.info/textmate-php-syntax-check/