First  |  Prev |  Next  |  Last
Pages: 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
data structure
Hello All, I would like to implement a tree with the following properties. 1. The tree is balanced. 2. Each node has a max of 5 sub nodes and min of ceil(5/2) sub nodes. 3. The tree remains static. Number of nodes known from the beginning. How would I implement this in ruby? Thanks, Vandana. ... 1 Jul 2008 05:08
Newbie Question On Ruby Quiz
I'm a programming and Ruby newbie. I wanted to build some programs, so I started Best of Ruby Quiz. The first quiz is MadLibs (http://www.rubyquiz.com/quiz28.html) and, given the answer, I can't even get it to work. I have a ruby file with the answer in it: # use Ruby's standard template engine require "er... 29 Jun 2008 20:21
How to doing a "grep -v" to hide "---" line added by Hash#to_yaml?
Shashank Agarwal wrote: {1=>2,"ABC" => {"a"=>"A","b"=>"B"}}.to_yaml.sub("--- \n", '') Awesome. Totally forgot about negative indexes. I would use the .sub option because it is explicit about what it is removing. However, the Hash did not add the --- . It is part of the YAML standard as the start of... 30 Jun 2008 08:36
Combinations of Letters and Numbers (was: Re: Random Generationof Characters)
Theoretically yes, but that wouldn't be efficient because ultimately the goal is to find ones that are not yet posted on the site. -- Posted via http://www.ruby-forum.com/. ... 30 Jun 2008 03:29
Is Logger thread safe?
Hi, in my program I use threads and a Logger instante accessible from any thread. Must I do something to make the Logger thread safe? I've looked at the Logger code and it seems that it uses Mutex in some methods and does a: require 'monitor' Is then Logger class thread safe and I can call its methods (@lo... 29 Jun 2008 16:14
implicit vs explicit self in private methods
I'm trying to understand the difference between implicitly and explicitly calling a private method and am hoping someone could shed some light on this for me. class Tester def public_hello_good say_hello end def public_hello_bad self.say_hello end private def say_hello "hello" e... 29 Jun 2008 16:14
Any book on CGI programming in Ruby?
Do anyone know of a book about CGI programming with the Ruby language? I've been unable to locate one on a Swedish internet bookstore. ------------------------------------------------------ "Home is not where you are born, but where your heart finds peace" - Tommy Nordgren, "The dying old crone" tommy.nordgren(a)com... 1 Jul 2008 07:11
Statistician I (#167)
Here's my own submission for this problem. Once you wrap your head around a few bits of the regular expression, it's pretty simple to understand. class Rule attr_reader :fields def initialize(str) patt = str.gsub(/\[(.+?)\]/, '(?:\1)?').gsub(/<(.+?)>/, '(.+?)') @pattern = Regexp.new('^' + pat... 3 Jul 2008 16:37
Lampes fluocompacts et gradateurs.
S�hk� [Jukka Lukkari, 14.05.2008] S�hk�n kulutus jatkaa laskuaan S�hk�n kulutus j�i huhtikuussa runsaan prosentin edellisvuotta pienemm�ksi. Vuoden nelj�n ensimm�isen kuukauden aikana s�hk�� on Suomessa kulunut 32,3 gigawattituntia eli yli kaksi prosenttia viime vuotta v�hemm�n. Aika hurjaa pudotusta kun ... 29 Jun 2008 15:13
rjb heap size OR call ruby methods from java
I've been using rjb (ruby java bridge) to use a method from a Java library. Problem is, that I run out of heap while running that method. I'm on a Windows machine, and I increased the max heap size for Java from the Control Panel, but the problem continued. Is there a way to fix that? If not, is it possible to c... 30 Jun 2008 11:41
First  |  Prev |  Next  |  Last
Pages: 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317