background preloader

Ruby

Facebook Twitter

Read Developing Games With Ruby. A Boy Who Wanted To Create Worlds Once there was a boy who fell in love with this magical device that could bring things to life inside a glaring screen.

Read Developing Games With Ruby

He spent endless hours exploring imaginary worlds, fighting strange creatures, shooting pixelated spaceships, racing boxy cars. The boy kept pondering. “How is this made? I want to create my own worlds…”. Then he discovered programming. What he didn’t give up is writing code for this magical device. Applications got increasingly bigger, they spanned across multiple servers, integrated with each other, became pats of huge infrastructures. Some of these things were useful, some where boring and pointless. Until one day he realized that no one can stop him from following his dream. This boy must live in many software developers, who dream about creating games, but instead sell their software craftsmanship skills to those who need something else. Welcome to the world of game development that was waiting for you all these years. Ruby Version Manager - Installing RVM.

∞Quick (guided) Install Before any other step install mpapis public key (might need gpg2) (see security) gpg --keyserver --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 **Note: can sometimes timeout you may want to use different keyserver - Unless doing guided install you should read all sub-sections under the RVM Section.

Ruby Version Manager - Installing RVM

Install RVM (development version): \curl -sSL | bash Install RVM stable with ruby: \curl -sSL | bash -s stable --ruby Additionally with rails (poor man's railsinstaller): \curl -sSL | bash -s stable --rails Or with jruby, rails and puma:

Web development

Recursive Descent Parser for Ruby. Sometimes strange things happen.

Recursive Descent Parser for Ruby

I've been developing a small, basic recursive descent parser for Ruby called RDParse. Just before writing this post I decided to Google that name, and lo and behold the first result is a Ruby recursive descent parser called RDParse, created by Dennis Ranke, that I posted to Code Snippets for posterity several months ago. Since both of these libraries are unlikely to be used at once and that Dennis doesn't seem to be maintaining his version, I've decided to stick with RDParse as the name of mine for now.

You can download my RDParse as rdparse.rb.txt, just rename it at your end if you want to use it. To use it, you'd do something like this (no syntax coloring as the Syntax gem doesn't appear to cope with the complexity): require 'rdparser' parser = RDParser.new do |g| g.main 'line(s)' g.line 'expression separator(?) Here, a grammar is defined within the RDParser.new block, although it can also be passed in as a parameter in a hash. Parsetree's sexp_processor-4.2.0 Documentation. RubyDoc.info - Library Listing. Treetop – Powerful But Easy Ruby Parser Library.

Gecode/R: Constraint Programming in Ruby.

Gems

Constraint programming in Python. By : Shabda Raaj Imagine this, you want to solve a problem, the algorithm for which you do not know.

Constraint programming in Python

You just know the problem. From wikipedia,Constraints differ from the common primitives of imperative programming languages in that they do not specify a step or sequence of steps to execute, but rather the properties of a solution to be found. Assume that there exists an alternate world where you only need to specify the problem, the computer will find out an algorithm to find it, even better if could you write it in Python. Stop assuming it hapens every day, and this is the magic of constraint programming. Example to solve a + b = 5, a*b=6, don't explain algebra, just tell the relations between variables. From constraint import *problem = Problem()problem.addVariable('a', range(5))problem.addVariable('b', range(5))problem.addConstraint(lambda a, b: a + b == 5)problem.addConstraint(lambda a, b: a * b == 6)problem.getSolutions() Files required On to our program Ok something better Related Posts.

RDoc Documentation. Dependency injection != Inversion of Control. David Heinemeier Hansson, the creator of Rails, recently posted his thoughts on dependency injection.

Dependency injection != Inversion of Control

The post is written in an unhelpful inflammatory style, and it’s inaccurate in its use of the terms involved. In particular, there is a confusing conflation of the ideas of dependency injection, a simple programming pattern I use every day, and Inversion of Control (IoC) containers, which are sometimes called “Dependency Injection containers”. These are a heavyweight implementation of dependency injection wrapped around the whole application.

IoC containers aren’t normally needed in a language like Ruby (and many argue they aren’t needed in Java either) whereas dependency injection is a useful technique in any language to ensure our classes are properly isolated from each other, which leads to better seperation of concerns. Dependency injection Here’s an example of a class which uses a collaborator directly: It seems a trivial change, and perhaps even a backwards step. When coding in Ruby. Ruby Tutorial with Code Samples.