I am attempting to make a game written in Ruby using the Gosu library (http://www.libgosu.org/) but when I run the game, a console also shows. How do I make sure the console is hidden from the start? thanks in advance, ell
Is there any way to do this? It seems the only possible way to do this is by using ruby/tk and creating a tcl interpreter through that api. However, I'd like to use this on a system with no GUI (x windows). Am I out of options?
Thanks
I have tried using a stemmer but the words it produces are just not upto the mark. It could be great if you could let me know any lemmatizer script there exists for ruby or a lemmatizer gem or an SQL query that bundles out the lemma of a word in the wordnet database.
Cheers !
I'd like to be able to use ruby's OptionParser to parse sub-commands of the form
COMMAND [GLOBAL FLAGS] [SUB-COMMAND [SUB-COMMAND FLAGS]]
like:
git branch -a
gem list foo
I know I could switch to a different option parser library (like Trollop), but I'm interested in learning how to do this from within OptionParser, since I'd like to learn the library better.
Any tips?
Well, the title say it all. I have a ruby script I want running as a service (one I can start and stop) on my Linux box. I was able to find how to do it on Windows here
Some readings point to creating daemons or cron tasks.
I just need something simple I can call on my box's reboot, and can stop/start whenever I please. my script has an internal sleep call, and runs in "eternal loop"
thanks in advance
I am using XMLRPC to get data from a Java server. I use HashMap as return value for a particular remote call. The server puts a long int into the HashMap (which is returned) along with other data. At the client end, which is ruby, I get all other data but for the long int. How can I get this data at the client?
Ruby onRails - UltraSphinx
Hi guys, I'm using Ultrasphinx for the search thing.
My question is : I have the "rake ultrasphinx:daemon:start" running in the background. Now, should I have a cron job that does "rake ultrasphinx:index" regularly or will the daemon take care of indexing whenever a new object is created.
Please, let me know. Its kind of emergency.
Thanks
The program print "hi" contains 10 characters and outputs a string with length 2. Therefore its ratio of output length to program length is 2/10.
My question is what Ruby program has the largest output length to program length ratio
(For program length let's only count non-whitespace characters (i.e., it's easy to minify a program))
I'm using the ruby serial port gem. After I open up the port I send the data I want like this.
sp.write [200.chr, 30.chr, 7.chr, 5.chr, 1.chr, 2.chr, 0.chr, 245.chr].to_s
It doesn't work, but if I put it in a loop of around 200 times:
200.times do
sp.write [200.chr, 30.chr, 7.chr, 5.chr, 1.chr, 2.chr, 0.chr, 245.chr].to_s
end
It works. Any ideas on why this is happening?
I am trying to write a ruby string to a file in such a way that any newline characters embedded in the string remain embedded. This is being written out to a file which will then be processed by another tool.
An example is below.
I want this: 1 [label="this is a\ntest"] \n (second \n is a true newline)
I have tried this: string = '1 [label="this is a\ntest"]' + "\n"
Any thoughts?
I'm developing an application in Rails (2.3.4) and there are some parts that need to run over a secure protocol, for example, the login form, the credit card form, etc.
How can I do just these pages be https, and all other pages remain http?
How can I test ssl in development environment?
I just recently started learning RoR. In Rails by default available Prototype. Why uses it is this library? Why is not jQuery, Dojo, Mootools, ExtJS ...
Is there any way to override the setting of instance variables in Ruby?
Lets say I set an instance variable:
@foo = "bar"
Can I intercept that and do something (like record it or puts, for instance)
I'm an ASP.NET c# developer using VS2010 as my development platform. I am interested in accessing Sketchup models using a web form interface.
Has anyone done this? I am looking for a simple "Hellow World" web application that uses the Ruby Extension model.
I'm using ruby's WSDLFactory to create an rpc driver to access the paypoint soap service and i need to see what xml request is being generated is there a way to do this code or should i try and use something like ethereal
The following piece of code works perfectly in script/console but returns the following error when i compile the same in a ruby script.:
:in `round': wrong number of arguments (1 for 0) (ArgumentError)
tf={"ph"={0=1.33333333333333, 1=1.5}, "fee"={0=1.66666666666667}, "test"={0=1.16666666666667, 1=1.25}, "what"={0=2.0, 1=2.0}, "for"={0=1.5}, "is"={0=1.83333333333333, 1=1.75}}
tf.each{|k,v| v.each{|k1,v1| tf[k][k1]=(v1.round(5))}}
Any Ideas ? Cheers !
I've .NET framework 3.5 installed in my laptop. Just .NET alone, no Visual Studio. How can I run Java, Python, Ruby and Perl programs from the console? What are the commands used for running them?
Do I need to install something else also, for running these language files?
Guys,
Do you know of any tool that would do like RubyonRails' Scaffolding (create simple CRUD pages for any particular class to allow quickly populating a database with dummy data), only which used Java classes with Hibernate for database access, and JSP/JSF for the pages?
It is a drag when you are programming one part of an application, but need data that can only be added with another part that is not ready yet, or very cumbersomely by directly inserting it into the DB.
Here is my script
#!/usr/bin/env ruby
if __FILE__ == $0
`cd ..`
end
which runs fine, but when it exits, I'm back where I started. How can I "export" the changes I've made to the environment?
In Ruby, the following fails with Errno::ENOENT: No such file or directory, even if the file exists:
open('~/some_file')
However, you can do this:
open(File.expand_path('~/some_file'))
Two questions:
Why doesn't open process the tilde as pointing to the home directory?
Is there a slicker way than using
File.expand_path?
Is it possible to tell Ruby in Windows to use only \n instead of r\n?
I'm having an issue where a file is being saved with \r\n and it is causing it to not function properly. Is there a setting somewhere I can change to fix this?
i want to send develop a web app in rubyonrails . which wil send the remainder to the mail and mobile tooo . can some body help me out
thanks in advance
Hello
I've been trying to parse a UTF-16 encoded xml file in Ruby (1.8.7), and I can't seem to find how to do it by searching (google and stack overflow)
Here's the xml file url:
http://www.abc.net.au/triplej/feeds/playout/triplejsydneyplayout.xml?_5366
Getting the xml string from Net::HTTP and passing it to REXML, then calling logger.info xmlDoc.inspect produces: <UNDEFINED> ... </>
Any ideas?
Cheers