Rectangle 27 8

Both Ruby and Python are fairly distant from the Lisp traditions of immutable data, programs as data, and macros. But Ruby is very nearly a clone of Smalltalk (and I hope will grow more like Smalltalk as the Perlish cruft is deprecated), and Smalltalk, like Lisp, is a language that takes one idea to extremes. Based on your desire to do cool hacks on the language level I'd go with Ruby, as it inherits a lot of the metaprogramming mindset from Smalltalk, and that mindset is connected to the Lisp tradition.

Please advise on Ruby vs Python, for someone who likes LISP a lot - St...

python ruby lisp
Rectangle 27 8

Both Ruby and Python are fairly distant from the Lisp traditions of immutable data, programs as data, and macros. But Ruby is very nearly a clone of Smalltalk (and I hope will grow more like Smalltalk as the Perlish cruft is deprecated), and Smalltalk, like Lisp, is a language that takes one idea to extremes. Based on your desire to do cool hacks on the language level I'd go with Ruby, as it inherits a lot of the metaprogramming mindset from Smalltalk, and that mindset is connected to the Lisp tradition.

Please advise on Ruby vs Python, for someone who likes LISP a lot - St...

python ruby lisp
Rectangle 27 3

I am a Pythonista; however, based on your requirements, especially the "cool hacks on the language level", I would suggest you work on Ruby. Ruby is more flexible in the Perl way and you can do a lot of hacks; Python is targeted towards readability, which is a very good thing, and generally language hacks are a little frowned upon. Ruby's basic types can be modified in a hackish way that typically prototype languages allow, while Python's basic types are more suited for subclassing.

By the way, I would add a minor correction: both Ruby and Python are very, very object-oriented, and neither is intended to be used for quick-and-dirty scripts the Perl way. Among the two, Ruby is syntactically more similar to Perl than Python.

Please advise on Ruby vs Python, for someone who likes LISP a lot - St...

python ruby lisp
Rectangle 27 3

I am a Pythonista; however, based on your requirements, especially the "cool hacks on the language level", I would suggest you work on Ruby. Ruby is more flexible in the Perl way and you can do a lot of hacks; Python is targeted towards readability, which is a very good thing, and generally language hacks are a little frowned upon. Ruby's basic types can be modified in a hackish way that typically prototype languages allow, while Python's basic types are more suited for subclassing.

By the way, I would add a minor correction: both Ruby and Python are very, very object-oriented, and neither is intended to be used for quick-and-dirty scripts the Perl way. Among the two, Ruby is syntactically more similar to Perl than Python.

Please advise on Ruby vs Python, for someone who likes LISP a lot - St...

python ruby lisp
Rectangle 27 4

Yes! Try rvm. It is awesome, you can have many different versions of Ruby, and for each one you can have different versions of gems. And you can run the same tests on all those versions. Isn't that cool?!

$ rvm install ruby-1.8.7 --default
$ gem install rails -v 1.0.0
$ rvm gemset create rails238
$ rvm 1.8.7@rails238
$ gem install rails -v 2.3.8
$ rvm 1.8.7
$ rvm 1.8.7@rails238

You can make 2.3.8 as default one with

$ rvm use 1.8.7@rails238 --default

I need to have Rails 1.0 and Rails 2.3.8 (the latest stable version) in my mac. And I have to use 1.0 for some projects and 2.3.8 for others... Can i Do it without installing a huge separate stack of ruby environment ?

rubygems - Can I have/use different Versions of rails in the same mach...

ruby-on-rails rubygems
Rectangle 27 4

Yes! Try rvm. It is awesome, you can have many different versions of Ruby, and for each one you can have different versions of gems. And you can run the same tests on all those versions. Isn't that cool?!

$ rvm install ruby-1.8.7 --default
$ gem install rails -v 1.0.0
$ rvm gemset create rails238
$ rvm 1.8.7@rails238
$ gem install rails -v 2.3.8
$ rvm 1.8.7
$ rvm 1.8.7@rails238

You can make 2.3.8 as default one with

$ rvm use 1.8.7@rails238 --default

I need to have Rails 1.0 and Rails 2.3.8 (the latest stable version) in my mac. And I have to use 1.0 for some projects and 2.3.8 for others... Can i Do it without installing a huge separate stack of ruby environment ?

rubygems - Can I have/use different Versions of rails in the same mach...

ruby-on-rails rubygems
Rectangle 27 2

There are numerous ways the solve this problem using funky Javascript techniques, often involving iframes, but I think in this situation you need to question why you're using AJAX. Is it actually going to make the site any easier to use for the user? It sounds to me like you're using it cos you think its cool (which in itself isn't always a bad thing) not because it will actually add any value to your visitors. From any normal website, normal hyperlinked documents are nearly always the right thing for the primary navigation. Its what people expect and I wouldn't recommend you go around breaking those expectations based on some fancy technology.

AJAX is awesome and allows you to do many great things, changing a websites navigation is not one of them.

Well done for picking up on this problem though, theres a lot of sites out there that just go ahead with AJAX and don't even think about this!

The site is already using AJAX at the moment. Its a browser game, and everyone's stats are updated on the server every 15 minutes, so based on what page they're on, I AJAX in the new information so the page is already accurate.

So you're already using it in places where it absolutely makes sense to, I don't think extending it in this way also makes sense.

javascript - AJAX and the Browser Back Button - Stack Overflow

javascript html ajax navigation
Rectangle 27 2

If you're considering creating a GUI using a javascript library anyway, why don't you just write a web app instead of an iPhone-native one? It seems like overkill to jailbreak the device just so that you can install a ruby + sinatra web app on it. Can't you just put the ruby web app on a server and create a Safari shortcut to it on the home screen? If you don't have a server, you could always run the website off a PC in your home...

Jailbreaking the OS and running a ruby app onto it would be technically cool, don't get me wrong - I just think it'd end up being a time sink.

Thanks Ben. Unfortunately, one of the places this app would be used just happens to be in a reception dead spot - no phone signal, no 3G, nada! I've already written a couple of iPhone Web apps that run on one of our hosted servers and they work fine; this is just a one-off bit of work, and I can't really justify spending any sort of $$$ on a solution

ruby - Develop iPhone app without a Mac? - Stack Overflow

iphone ruby sinatra
Rectangle 27 2

If you're considering creating a GUI using a javascript library anyway, why don't you just write a web app instead of an iPhone-native one? It seems like overkill to jailbreak the device just so that you can install a ruby + sinatra web app on it. Can't you just put the ruby web app on a server and create a Safari shortcut to it on the home screen? If you don't have a server, you could always run the website off a PC in your home...

Jailbreaking the OS and running a ruby app onto it would be technically cool, don't get me wrong - I just think it'd end up being a time sink.

Thanks Ben. Unfortunately, one of the places this app would be used just happens to be in a reception dead spot - no phone signal, no 3G, nada! I've already written a couple of iPhone Web apps that run on one of our hosted servers and they work fine; this is just a one-off bit of work, and I can't really justify spending any sort of $$$ on a solution

ruby - Develop iPhone app without a Mac? - Stack Overflow

iphone ruby sinatra
Rectangle 27 2

my understanding was that it had little to do with CPU, but the latency in opening of repeated sockets to the other side of the world. even if you have infinite bandwidth, connect latency will slow down the whole process. amplified if your page has dozens of objects. even a persistent connection has a request/response latency but its reduced when you have 2 sockets as on average, one should be streaming data while the other could be blocking. Also, a router is never going to assume a socket connects before letting you write to it. It needs the full round trip handshake. again, i dont claim to be an expert, but this is how i always saw it. what would really be cool is a fully ASYNC protocol (no, not a fully sick protocol).

yeah - that would be my assumption. maybe it is a tradeoff - there is a point where the latency (due to distance) means that it is a real problem

ok, so modern typography would have you connecting to a proxy that is close by (maybe). but then do you extend the question to wether proxies should use persistent connections?

@Michael Neale also, because of things like TCP slow-start, the actual latency penalty is much worse than you would expect.

maybe the trade off is a much shorter timeout period. if you have requests backed up, why shut down the socket and start again? even 1 second would allow a page to load with full persistence and then shut down the sockets immediately after.

webserver - http keep-alive in the modern age - Stack Overflow

http webserver keep-alive haproxy
Rectangle 27 0

I have always been curious about gumstix. It seems more professional than arduino, and it aims at the Linux programmer. I cannot give you a real suggestion, as I've never played with it, but I would definitely go with one of this toys if I had to do and learn some cool hardware programming.

arduino - Hardware Programming - Hands-On Learning - Stack Overflow

arduino robotics hardware-programming
Rectangle 27 0

I found this very elegant way of doing it and it solves one of the things that has always bothered me about KVO which is the large "switch statement" that KVO adds with observeValueForKeyPath. KVO+Blocks is very cool, it eliminates that "switch statement" and it automatically handles removal of the observer so no need to call removeObserver when using ARC (if you are doing your own memory management then I think you need to call removeObserverWithBlockToken, although I have not tried it).

One thing to be careful of, but is true of blocks in general, is if you reference self in your block. You need to do this:

__block blockSelf = self;

if you don't you will end up with a retain cycle. (see Retain cycle on `self` with blocks for more details).

One other thing, it works with ARC if you put -fno-objc-arc on the file. (See this for details How can I disable ARC for a single file in a project?)

I hope that Apple adds something like this to the SDK.

__block doesn't break the retain cycle. You must use __weak

KVO does not force you to use a large switch statement. If you're doing it that way, you may want to reexamine your implementation.

objective c - KVO cleanup of individual observed keys - Stack Overflow

objective-c memory-management key-value-observing