SUCs - The iPhone

We had a Site Under Construction session for the iPhone.

Posted at on 8/29/08 by | 0 comments | Filed under:

Vim: About time we learned this

I gave Show & Tell today about Vim. Nothing too in depth. Just some basic commands. I wish I had mad Vim skillz.

Posted at on 8/19/08 by | 0 comments | Filed under:

"Site Under Construction" sessions (or SUC sessions for short)

During my quarterly reviews with each of my team members, I am discovering some commonalities in what people would like to learn.

A common goal seems to be “to get better at application design”.

Good design is a great goal. But, like anything worth accomplishing, it is difficult. Good design can be difficult to learn and teach. And, is more experiential than anything else.

One of the reasons is because “design” encompasses so many disciplines. Also, the most difficult thing about good design is that a lot of attributes of good design are in conflict with each other.


  • Copy vs. Graphics

  • User vs. Non-user

  • Usefulness vs. Stickiness

  • Art and Color vs. Transparency

  • Functionality vs. Simplicity

  • Consistency vs. Flexibility


How do you learn that? How do you teach that? You can read books. You can attend some classes. There are certainly “official” ways to master this.

Just think about it.


I think another way is to just be mindful of it. Think about it all the time. When you log onto Gmail every morning, think about why it is good or bad. When you use Finder, think about it. Why does the Dock work the way it does?

Just think. You don’t have to be correct. But, at least, you are analyzing. You don’t have to write it down. But, you should file it away in your cloud brain for use later.

So, to help accomplish this, my team is going to start doing "Site Under Construction” sessions. I like to call them "this (insert whatever here) SUCs". We will put up a website, applications, or device or whatever. And, we will just discuss it. The good and the bad. There is no correct answer.

Posted at on 8/14/08 by | 1 comments | Filed under: , ,

Customize Apple Terminal's Title Bar and Prompt

I like to show my username, computer name, and current path in my Terminal's prompt. But, it would also be nice to show it in the title bar.

Just add this line (or replace it if you already have one) in your ~/.bash_profile file.

export PS1='\u@\h:\w\$ \033]2;${USER}@$(hostname):${PWD}\007'


This will make your Terminal window look something like this:

Picture 1


If you want to be really hard core, you can customize your tabs too.

Use this: Show remote host names as tab titles in Terminal.

Basically, you create hard links to the ssh binary with the name of the remote host as the name of the hard link. And, since Terminal displays "ssh" in the tab, you can get Terminal to display the hard link's name instead. Makes sense to me. But, I don't need it.

Posted at on 8/12/08 by | 0 comments | Filed under:

Innovations in Ruby

Posted by the guys at RailsEnvy.com for a talk they gave at Ruby Hoedown. http://www.railsenvy.com/assets/2008/8/8/RubyInnovation.pdf

Some interesting things that I did not know about.

Posted at on by | 0 comments | Filed under: ,

What you need in order to become a Ruby on Rails developer

I often get asked and see forum/blog post asking this question (or some variation of it):

"What do I need in order to start Ruby on Rails development?"

The following may not apply to all. But, face it. Admit it. There can be only one way. So, just follow this simple step to more joy and bliss. Here is the step to take. Yes, there is only one step.

Grow some balls


You need . . . To leave your crappy job. To admit that the technology platform you committed the last 5 years to is crap. To be happy about what you do everyday. To realize that the boss you hate really deserves it and doesn't deserve to continually make money off your efforts. To wake up and smell the Ruby.

Also, you need to stop drinking with your worthless "buddies". And, start spending some time learning Ruby, and Rails.
"But, but, but . . . those are my budz, my free time, my weekends . . . wha, wha, whahaaa".
Forget that! Those bums aren't going to help make you great. If that is your concern, then just stop reading now.

So, tell me about your balls growthage


"But, that's easy for you to say. I am in (insert some worthless excuse here) . . . blah, blah, blabbity, blah, blah . . ."


So, before you start thinking that I am just blowing smoke, here is my testimony.

I started in Java development. Became an expert in the IBM WebSphere stuff (when I started with it, it was all MQ this, MQ that). Grew into "Systems Architect", "Project Manager" . . . (insert whatever title you want here). Discovered it was boring as heck keeping track of people's hours and arguing over requirements with a client. Start to learn Rails. And, here's the key part. Wait for it . . .

I LEFT my job to do Rails. I took a pay cut (about 12%). I left all that "expertise" that I built up behind. I did all this with a wife, a one year old daughter (at the time), and a mortgage, and school debt.

That's some Rambo-esque courage! But, you can do it too!

What's the technology that you left behind?


Java. No, wait. More specifically, J2EE enterprise software integration. That means taking some stupid vendor software, like (insert stupid enterprise vendor software here . . . I'm looking at you Documentum), and making it fit into the business no matter what.

What to read


Ok, after you have done Step 1, you can read ALL of the following. Then, send me a 2-page report.

I am too lazy to provide links. So, you just Google it. Also, this list is current as of this date. It is what I would recommend someone to read as they start with Rails. Some of them are coding books. But, others are not.


  • Getting Real

  • The Ten Faces or Innovation

  • Beyond Java

  • From Java to Ruby

  • Extreme Programming

  • Rails Way

  • Ruby Way

  • Web Standards Solutions



I left off the two "Bibles" of Ruby and Rails. I have those. Both are good. But, I do not regularly use them. So, they are left off the list.

There are only two blogs/podcasts to subscribe to that are worth the time:


  • RailsCasts

  • Rails Envy



It's not code, it's passion


Enough said. If you want to discuss, you know where to find me. Out!

Posted at on 8/11/08 by | 0 comments | Filed under: , ,

Why Apple was correct in pulling "I am Rich"

195117-rich
If you do not know what "I am Rich" is, just Google it.

There are a lot of people talking about how Apple was wrong to pull the application. I have seen a few, all stupid, arguments for not pulling the application, such as . . .

It's art. Huh?

Buyer beware. Whatevs!?

Dumb arguments.

Apple was correct in pulling it.


It is a stupid application. At a stupid price. And, it isn't even funny as a joke. It doesn't even do anything. Make it rotate or sparkle or anything! Apple should continue to pull these dumb-ass applications. In fact, Apple should pull all applications that are just plain bad.

Why? If Apple is going to act as the gatekeeper for iPhone applications (whether I like it or not), then Apple has an implied duty to remove these types of applications. This is key: Apple is the gatekeeper for ALL iPhone apps.

It is all about trust. I think of it as sort of how we all trust Google to return fair search results. Google works hard to remove crap links and sites that try to "game" the system. We trust them.

We need to trust Apple. A developer needs to know that Apple won't allow these dumb-ass applications through. It just dilutes the space, and ruins it for legit developers. A buyer needs to know that they are not going to get jacked.

Editorial: A few statements on what I think about the App Store.

I do not agree with Apple's decision to require all iPhone applications to be distributed via the App Store.


No trial period for applications sucks. How do you get a refund? Apple has unilateral power "approve" it or "reject" it? Huh? So, I have this awesome idea. I work on it for months, and Apple can just reject it? That's really encouraging me to start working on my iPhone application.

The worst part is that the App Store is full of junk. If Apple is going to act as gatekeeper, then they need to do a better job. Some of the apps are not even iPhone applications. A whole bunch of the applications are just SSB's, which you could do already.

If the iPhone applications does not leverage the SDK, then it is NOT an iPhone app.


An iPhone app, in order to be an iPhone application, must use the phone's hardware, or integrate with a native service or application. Otherwise, it is just crap and useless as an iPhone app. You wouldn't call Gmail in Safari a Leopard application?

So, either be The Gatekeeper or don't.


Cerberus
If Apple is going to be gatekeeper, then do a better job of it. Don't let these dumb apps through. Make sure the apps are legit iPhone applications. Trial periods. Refunds. All the stuff that makes any customer experience good.

Or, don't be the gatekeeper. Let the developers deal with it. That's how it is now with Mac applications. What's the diff?

Posted at on 8/8/08 by | 0 comments | Filed under: ,

TextMate: Speed up searching in a project (CMD+Shift+F)

I hate how slow TextMate is when searching in a project. Well, it turns out that it is not really because TextMate's search is slow. It might be. Most likely, the real problem is that, by default, TextMate is searching through ALL your Rails files. ALL, as in logs, vendor/rails, and so forth. This is what is slowing things down.

I don't take any credit for this. This is a tip from Dr. Nic on a TextMate Google Groups thread. But, I will distill it down for you.

Copy this crazy looking piece of regex (at least . . . I think it is regex):

!.*/(\.[^/]*|vendor/rails|doc|rails_root|CVS|log|data_dump|build|_darcs|pkg |_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)? |bundle))$


Fire up TextMate.

Open up Preferences. ("CMD + ," for the cool people.)

Go to Advanced -> Folder References

Picture 1


In the "Folder Pattern" field, delete what is there (you may want to save it somewhere . . . I just gmailed it to myself), and paste in the crazy regex from above.

Done!

Now, TextMate in project search will be much faster!

Posted at on 8/7/08 by | 0 comments | Filed under: ,

Install Memcached on CentOS 5.1

I can use Yum. But, I am going to install from source in order to get the latest builds.

libevent



Memcached requires libevent. So, get and install libevent first.

wget http://monkey.org/~provos/libevent-1.4.6-stable.tar.gz
tar zxpfv libevent*
cd libevent*
./configure
make
sudo make install


memcached



Next, install memcached.

wget http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz
tar zxpfv memcached*
cd memcached*
./configure
make install


Errors . . . there is always at least one



You may get this error:

error while loading shared libraries: libevent-*: cannot open shared object file: No such file or directory


You need to create a symbolic link. For me, this is the command I needed to run. Yours may differ depending on the release you downloaded.

sudo ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib


Start memcached



memcached -d -m 64 -p 11211


"-d" runs memcached in daemon mode.

"-m" is the amount of memory memcached will use in MB's.

"-p" is the port # for memcached.

Connect to it from Rails 2.1



Rails 2.1 is awesome because of its new caching features. It can support memcached as a cache server. In order to get this to work, add/edit the following line in your config/environment.rb file. Or, you can add/edit your specific environments file, such as config/environments.development.rb file.

config.cache_store = :mem_cache_store, 'IP_ADDRESS_OF_MEMCACHED_SERVER:11211'

Posted at on 8/6/08 by | 3 comments | Filed under: ,

Nobody Goes Full Retard



http://www.youtube.com/watch?v=qrIZfcZu-3I

Check out the comment from vegetta00 about the 10th one down.

Posted at on 8/5/08 by | 0 comments | Filed under:

Even MORE Scrum-esque

Scrum is an "agile" process for software development. Part of the Scrum methodology is The Scrum Meeting.

My team uses Scrum, but we do it even more scrum-esque

At first, we held daily meetings at a consistent time. The purpose of these short meetings were to:

  • Inform the team of your status

  • Help you organize and prioritize your tasks

  • Overcome issues. An issue is not a bug or problem. An example of an issue would be something like, “My ssh access to the QA server stopped working.”


When Scrum meetings work, it is like a well-oiled machine. You should be able to determine the project's status just by listening to everyone else.

Scrum meetings eliminate the cruft, and focuses on the important issues.

But, for my team, we needed to be even MORE Scrum. Meeting everyday was too tiresome, and boring. And, we often discussed other interesting topics, such as "Why Iron Eagle is such an awesome movie."

200px-Iron_eagle


So, we do our Scrum meetings like this:

  • No meetings.
  • Just email.


The emails look like this:

  • What you did yesterday
  • What you will accomplish today
  • Issues


The scrum email should answer the following:

  • Does it inform the team of your status?
  • Does it help you prioritize your tasks?
  • If you were doing the wrong thing, does it let others know that you are doing the wrong thing?


So far, it has been working out pretty well.

Posted at on by | 0 comments | Filed under:

Mac Keyboard Shortcut: Bringing an Application back from a Minimized State

One of my life goals is to completely remove the mouse from my daily interfacing with my Mac.

Ok. So, you all know how to minimize an application window.

Command + M

So, how do you bring it back? Command + Tab does not work. That just puts the focus on the minimized application.

Use:

Command + Tab . . . to switch to the application you want. Then, before you let go of the Command key, press the Alt key, then let go of the Command key while keeping the Alt key down.

It is a little weird, and takes a bit to get used to it. But, once you do, it'll be like second nature.

Out.

Posted at on by | 4 comments | Filed under:

Can an ActiveRecord object destroy itself?

Without getting into real detail, I need this behavior because of a legacy database (Actually, it is not all that "legacy". It is more "enterprise-esque".).

Anyway . . .

Question: Can an ActiveRecord object invoke an instance method, then, while executing that method, destroy itself?

Code example:

@some_object.some_method

Class SomeObject < ActiveRecord::Base
def some_method
...Some really awesome stuff happens here...
self.destroy
end
end

At first, I thought it would work. There are plenty of times where I have invoked a destroy method on an AR object, then use that same AR object later. I do this in controller action methods often.

But, even as I was writing that logic, it did not feel correct. But, Ruby has a tendency to surprise me. So, I gave it a shot.

It turns out that you cannot do this. I am not sure if this is a Ruby or ActiveRecord behavior. If anyone knows, please comment.

To me, it seems like appropriate behavior.

You should not be able to start some set of tasks, one of which causes you to kill yourself, but requires you to finish off the rest of the tasks.

I accomplished the same behavior by creating another object within the instance method, and destroying that object.

Code Example:
@some_object.some_method

Class SomeObject < ActiveRecord::Base
def some_method
...Some really awesome stuff happens here...
SomeObject.find(self).destroy
end
end

Has anyone else come up against this? Am I solving this problem correctly?

Posted at on 8/1/08 by | 5 comments | Filed under: ,