By Ryan on March 10, 2010
You probably already figured this one out if you use git. But if you’re new to all of those awesome git tricks, well, here you go.
I always forget to checkout the branch I just created, so having it wrapped up in a single command is absolutely perfect.
git checkout -b [name of new branch]
That takes care [...]
Posted in Tips | Tagged branch, checkout, create, git
By Ryan on March 3, 2010
Adding a jar to an eclipse project is normally really easy. I came home from school today after adding the AP Computer Science gridworld jar. I always have to add external libraries twice because at school we have OSX and at home I have Windows, so the file paths don’t match up.
So after trying to [...]
Posted in Java, Tips
By Ryan on February 25, 2010
On a recent project, I used ajax to render a full cell of a table upon clicking it. I found that without some kind of queue, my clients would click on a bunch to expand them, but only the first would render. Mootools offers a plugin in mootools more called Request.Queue, but that wasn’t what [...]
Posted in Mootools | Tagged ajax, chain, link, Mootools, queue, request
By Ryan on February 22, 2010
Today I was using one of CakePHP’s helper methods, $text->truncate. It gave me these errors and I can’t say I was pleased about it. It reminded me that sometimes, functions aren’t a piece of cake.
Warning (2): array_merge() [function.array-merge]: Argument #2 is not an array [CORE/cake/libs/view/helpers/text.php, line 184]
Warning (2): extract() [function.extract]: First argument should be an [...]
Posted in PHP | Tagged CakePHP, Error, helper, PHP, truncate
By Ryan on February 19, 2010
I recently deployed a CakePHP application to a 1and1 server. I was presented with a wonderful 500 Internal Server Error. That only means one thing: a .htaccess was messed up somewhere.
There were many places that pointed me in the right direction to fix this problem. It was definitely an annoying hitch. Seriously, there’s that [...]
Posted in PHP, Tips | Tagged 1and1, 500, CakePHP, Error, internal, server
By Ryan on February 16, 2010
CakePHP does make somethings really easy, and sometimes, not so easy. I like to have a testing setting and a production setting stored in my databases.php. Your DATABASE_CONFIG object of course contains those arrays of settings. So the question is, how do you switch exactly?
It is never mentioned specifically in the documentation, but you can [...]
Posted in PHP, Tips | Tagged CakePHP, database, model, PHP, settings
By Ryan on February 11, 2010
My Computer Science discovers interesting things sometimes. Recently we were doing a little practice with Exceptions and try-catch blocks. One of our projects was to handle division by zero and not crash the program. That sounds like a ordinary project, but as it turns out, it was a more surprising than anyone would have ever [...]
Posted in Java | Tagged division, double, Java
By Ryan on February 8, 2010
Firebug will scream and shout about Invalid Object Initialization if you mess just a little something up. Firebug does this a lot. It is an unhelpful error because Firebug will direct you to the first line of your object, not where the problem is.
Firebug gave me this, more or less. That wasn’t helpful. (Why did [...]
Posted in Javascript, Tips | Tagged Error, Javascript
By Ryan on February 3, 2010
When I get a new computer I always do a couple of things immediately upon getting to the Windows Desktop. One of those things is enabling the showing of extensions and hidden files. You should do it too, it can save tons of headaches.
Open windows explorer either via the taskbar shortcut or by computer [...]
Posted in Tips, Wordpress | Tagged extensions, hidden files, windows 7
By Ryan on February 1, 2010
I recently converted my old Windows Vista computer into a Ubuntu server after getting tired of my old virtual box virtual machine. It still had a decent graphics card (an nVidia 9500 GT) so I wanted to at least checkout Compiz Fusion. I had some trouble getting it up though. So here’s the deal.
First Go
As [...]
Posted in Tips | Tagged drivers, graphics, nvidia, ttyl, ubuntu