Posts filed under 'developers'
And oldie-but-goodie …
Mel’s job was to re-write the blackjack program for the RPC-4000. (Port? What does that mean?) The new computer had a one-plus-one addressing scheme, in which each machine instruction, in addition to the operation code and the address of the needed operand, had a second address that indicated where, on the revolving drum, the next instruction was located. In modern parlance, every single instruction was followed by a GO TO! Put *that* in Pascal’s pipe and smoke it.
Mel loved the RPC-4000 because he could optimize his code: that is, locate instructions on the drum so that just as one finished its job, the next would be just arriving at the “read head” and available for immediate execution. There was a program to do that job, an “optimizing assembler”, but Mel refused to use it.
“You never know where it’s going to put things”, he explained, “so you’d have to use separate constants”.
June 30th, 2009
Click image to go to Announcement page.
Hopefully I’ll get a chance to install it and write a half-decent review soon (for the Ruby/Ruby on Rails part at least)

June 29th, 2009
Regarding my post yesterday about Netbean’s new 6.7 rc releases …
While my initial user experience was dandy, I have since discovered some show stopping bugs.
- When trying to import your plugins from a previous version (6.5 in my case), the screen that pop up mysteriously disables mouse clicks.
So you basically get stuck at a screen like this one …

… with no possible way of moving forward or back.
I had to kill the netbeans process and restart (happened in both rc2 and rc3).
To be fair, after restarting, I had no more problems … the plugins seemed to have imported just fine.
- I also discovered another odd problem while trying to work on migration files in Rails. After Netbeans produced one intellisense dropdown, the entire IDE would start freezing on every 2 or three key strokes … making itself unusable. I had this problem in rc2, no such problem with rc3.
- On the plus side, startup time is *a lot* faster than in 6.5. As soon as I loaded a few modules the startup speed went back to be cell-phone-customer-service slow, so no plus there.
+ The whole netbeans process seems to be self contained now. It used to be that when you looked in process explorer, you’d see Netbeans, nbexec and java, with the real size of netbeans contained in the Java process.
This, happily, is no longer the case. Netbeans still easily tops 200MB of memory though :\
- Trying to create a new rails app, the browse button on this screen does not work, terrible eh?

June 18th, 2009
PS: This worked for Netbeans 6.7 RC2, however it will HORRIBLY break any attempt to use irb from the windows command line
If you right click on a project in Netbeans then go to ‘Ruby Shell (IRB)’, you should get dropped into a ruby IRB window.
Unfortunately for most of you on windows, you might get this instead …

An easy fix is to go to irb.bat and comment out the first 7 lines of code so that it looks like this
#@echo off
#@if not "%~d0" == "~d0" goto WinNT
#\bin\ruby -x "/bin/irb.bat" %1 %2 %3 %4 %5 %6 %7 %8 %9
#@goto endofruby
#:WinNT
#"%~dp0ruby" -x "%~f0" %*
#@goto endofruby
#!/bin/ruby
#
# irb.rb - intaractive ruby
# $Release Version: 0.9.5 $
# $Revision: 11708 $
# $Date: 2007-02-13 08:01:19 +0900 (Tue, 13 Feb 2007) $
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
require "irb"
if __FILE__ == $0
IRB.start(__FILE__)
else
# check -e option
if /^-e$/ =~ $0
IRB.start(__FILE__)
else
IRB.setup(__FILE__)
end
end
__END__
:endofruby
June 17th, 2009

I’d been using 6.5 for the last couple of months, forgetting to look for updates in my RSS feed, when I came across the announcement of Netbeans 6.7 RC 2.
I quickly downloaded it and started using it, when I found out that RC3 was released just yesterday as well, I’ve downloaded it, but since I’m in the middle of a slew of projects I won’t be installing it until the weekend.
However with RC2, I am impressed that they finally fixed the silly problem of each version of Netbeans not importing settings from previous versions.
The install went smoothly and I was up and running faster than usual.
The things that jumped out at me are
+ There is no annoying subversion connection window that jumps up in the output section for each project that you’re working on any more
- The Ruby irb output window still doesn’t work for me (see screenshot)

- Still no word wrap (I know they’ve said to expect it in version 7.0, but seriously …)
- I spent almost 2 hours yesterday trying to figure out what changed between RC3 and RC2, and I couldn’t do it.
If you can, please drop me a line.
Apparently with each new release, the documentation page updates to the current release. So basically there isn’t a release page for RC2 any longer (please fix this guys).
+ For Ruby on Rails here are the things that are new (nothing exciting really)
Here are the release notes for RC3
Ruby and Rails
- Remote debugging support
- Improvements to Ruby constants support
- Run and debug actions for test cases and suites included in context menu
- Support for Shoulda tests
enjoy.
June 17th, 2009
I was trying to find out how the NY Giants did last night, so I could incorporate it into a nice little jibe I was going to hurl at a friend of mine, so I went in and typed “NY Giants” … into the search box, to start the ever familiar process of clicking on links and backing up until I found what I wanted.
Guess what came up?

Its like they read my mind!
Funny, but it illustrates *exactly* why Google is kicking everybody’s ass at search.
They write software that anticipates the needs of its users.
You should be asking yourself if your software, business, employees or personal service does the same.
December 8th, 2008
I’m a big fan of the Netbeans IDE, because I love the support it provides for Ruby on Rails.
It means that I upgrade my IDE to the latest release (Milestones, Betas etc) as soon as it comes out, but it also means that with every upgrade, I have to physically go and set every … single … option … again.
Sounds painful doesn’t it?
It is.
Luckily , I found a blog post that describes how to solve this problem and import your netbeans settings from version to version.
This is something that needs to be fixed in Netbeans … that and including a word wrap option … and cakephp support … oops … getting carried away there
November 30th, 2008
I was going through my google analytics logs today and I noticed that a lot of folks were coming to my site on Google searches for stuff like ‘print_r + ruby on rails‘.
So I figured I’d write a blog post about it, because I’ve had the same problem.
What you’re looking for is ‘inspect’.
If you have an array, hash or object that you want to take a quick-and-dirty look at just type in
objectname.inspect
eg:
posts.inspect
or if you’re in rails just do …
render :text => posts.inspect and return false
and you’ll get an output of the contents of said array, hash or object.
Here is a screen capture of a quick irb session to show you how it works.

I hope this helps.
May 1st, 2008
The more I work with Ruby and Ruby on Rails, the more I begin to understand (though not necessarily agree with) a lot of the vitriol that has been aimed at PHP over the years by developers using other more rigorous languages.
A few weeks back I ran into this little speed bump while working with Ruby on Rails, where I was trying to do a multiple assignment like this
Most seasoned Rubyists will be waving their arms around and yelling “NOOOOOO!!!”
But coming from a PHP background this seemed perfectly okay to me.
Let me go off on a (relevant) tangent here and show you how the PHP code for this assignment would work
$x = $y = $z = array();
$x = 'me';
print_r($x);
print_r($y);
print_r($z);
the output from this is
me Array() Array()
Notice how the variables $y and $z remain arrays?
Now lets look at the same ruby code.

You can see that when we do an assignment of
ALL the variables point to the same array, so changing one item, changes all the other variables!
This is because arrays, hashes and certain objects are passed by reference not by value.
I say “certain” objects because the assignment
… doesn’t work the same way – as you can see above – even though the quoted string “you” is an object in Ruby.
So be careful PHPsters … this cost me a couple of hours in my project.
Hopefully you can skate around this one if you come across it.
April 29th, 2008
This one took a little bit but I finally figured it out …
@xml = render_component_as_string :controller => “quote”, :action => “xml”, :params => {:request_id => 100}
This would run the action “xml” of the controller “quote” and pass the parameter “100″ to it to do so.
Whatever would have been displayed at /quote/xml/100 is now stored in @xml
This allows you get the output from any action …. anywhere, also allowing you to pass parameters to it in the process.
Even better, this actually runs the action and its view (unlike render :action, which just renders the action view).
For more details, go to the Ruby On Rails Manual > Using components
April 17th, 2008
After weeks of anticipation , the apache module that allows you to upload your ruby on rails application to the server and have it “just work” has just been released.
I’ve just downloaded the source code from their git repository (git rocks!!) and am trying to see if it’ll install on windows.
Update: It won’t install on windows and there are no plans to ever allow it to (damned Linux elitists!!!
).

April 11th, 2008
I’ve been interested in moving to the new Versioning system championed by none other than Linus Torvalds … creator of Linux.
But I’m on a windows box (and I like it here) and didn’t want to deal with using cygwin to manage repositories in Git.
Cue this succinct blog post on how to run Git on windows.
enjoy.
April 4th, 2008
Thanks for Justin Cook for doing all the leg work on this one.
All you have to do is create a new table from the old one, which filters out the duplicate entries
1
2
3
| CREATE TABLE new_table AS
SELECT * FROM old_table WHERE 1
GROUP BY [colum_to_remove_duplicates_from]; |
so as an example
1
2
| CREATE TABLE news_new AS
SELECT * FROM news WHERE 1 GROUP BY [title];<!--more--> |
Now you just have to go in and rename the news db to news_old (for the newbies to this … don’t drop the table immediately, at least until you’re sure the new one works fine).
Then rename news_new to news
Phpmyadmin should make all this easy (click on the “Operations” tab), but in case you are working from the console, here is the syntax you need to know
1
| RENAME TABLE new_table TO old_table; |
That isn’t all that you have to do, however. The new table will be missing its primary key and auto increment settings as well as any other indexes that you may have had on the old table.
Go in and set the primary key (first) back on the column that had it, then (secondly … the order matters) clear out the default value on it and set it to auto increment.
You can re-add your indexes later … be sure to put a unique index on the column you were having trouble with.

March 27th, 2008
I have just blown 4 – 5 hours on this “feature” of PHP and I thought someone else would care to know.
You can’t use numeric keys for sessions in php!
so stuff like
$_SESSION['1234'] = 'boo";
… won’t work because PHP’s session handling mechanism simply refuses to store that particular session variable.
Even worse, it fails silently, leading you to think your brain has fried itself.
Personally, I just thought something funky was up with PHP5 (google searches seemed to indicate problems with PHP5 sessions, so I focused on that).
But after trying version 5.2.4, 5.1.6 and still having the same problem I finally tried it out in PHP4 and … still had the problem. Then I seriously started trying to track down the bug.
After finally finding it and writing the right Google query (thanks for nothing Google
) … I found a couple of articles that point out this problem.
So I’m writing this with an SEO’ed title that should hopefully grab the right folks, before they blow hours trying to figure this out.
Please go and vote for this feature to be fixed (made to fail loudly … so you know exactly what is wrong).
Add a comment if you do.
March 27th, 2008
Life is too short not to have garbage collection …
- Awesome quote from a developer Jon Cooper who I was talking with at SxSWi.
He was talking about writing code in .NET and coding speed reliant modules in C++ or C.
March 11th, 2008
Previous Posts