Archive for the 'Programming' Category

trees in sql – no more nested sets?

November 17, 2006

I looked for sql trees on the net, and it seems there is another method called ‘nested intervals with farey fractions’. This is really heavy math stuff, but looks interesting. Obviously it gets around the problem that on average half of the total nodes of an SQL nested set table must be updated if you [...]

mission of the day: javascript windows

November 17, 2006

Need to get on these for my ActiveAcl plugin. Fortunately there is this “prototype window” thing which makes creating these a no brainer:
http://prototype-window.xilinus.com/

SQL Design Patterns

November 16, 2006

Oh man, I desperatly need this book:
http://www.rampant-books.com/book_2006_1_sql_coding_styles.htm
Too bad it will be published first in October 2007… *grr* It’s so hard to get valuable information on professional SQL usage.

has_many_polymorphs enhanced!

November 6, 2006

http://blog.evanweaver.com/articles/2006/06/02/has_many_polymorphs
Evan really did a great job, adding model namespaces, table names and double polymorphism. Thank you so much! And thanks for the testing credits, though you really improved that as well

rails engines testing with rcov

November 1, 2006

Ever wanted to do coverage tests on an engine? Well, it really hurts that using the default test runner like “rake test:engines:my_engine:rcov” (that is added by the rcov helper plugin for rails) will run the tests, but ignore everything below the “vendor” folder. Unfortunately this includes the engine files as well. And at the time [...]

character encoding in forms

October 30, 2006

Things that give a headache in IE and Firefox – the character encoding when sending form data doesn’t always seem right. Fortunately there is a workaround:
http://www.crazysquirrel.com/computing/general/form-encoding.jspx

breakpointer: where am I?

October 29, 2006

I heard there is a gem around to give you a stack trace in breakpointer, but you can quickly get it without as well. The trick is to raise an exception and immediately catch it, printing it’s stack trace. Blatantly stolen from my Java experience
begin; raise; rescue Exception => e; puts e.backtrace; end

class reloading in ruby

October 29, 2006

Ever wanted to undefine a class in ruby and reload it afterwards? Needed this as I wanted to restart a test suite with the models using table names – tests for the has_many_polymorphs plugin. It’s a dirty hack and doesn’t work with instantiated fixtures, but at least it makes shure the same tests run on [...]

has_many_polymorphs on the way…

October 27, 2006

http://blog.evanweaver.com/articles/2006/06/02/has_many_polymorphs
it’s an absolut “must have” if you plan to do anything with polymorphic associations in rails. Just have a look at it.
I tried to integrate it today with my gacl system – only to find out it doesn’t support models inside modules. Too bad!!!
I refactored my code to make it work *ouch*, but [...]

object oriented design patterns

October 26, 2006

While searching for docs on singleton classes, I stumbled on some ruby features and design patterns I did’t know – at least the delegator pattern was unknown to me…
http://www.rubycentral.com/book/lib_patterns.htmlÂ