Which set of libraries and tools would you recommend to use for development SOAP-service onRuby 1.9 - soap-tools, web-servers, or maybe a web-framework?
Hi,
I have a sql script file that upon import creates a table in a MySQL database and fills it with 2800 record. These are all the postal codes for the country Belgium.
Now I would like to make a Rubyon Rails database migration file from this. Any idea how I can do this?
Thanks,
Michael
Is it possible to read binary in ruby file and execute it directly in memory?
for example something like this:
x = IO.read('/bin/ls')
execute(x)
I tried system(x) but it doesn't work
ArgumentError: string contains null byte
I have seen this sample written in Ruby code, how i can simulate it in C language?
Open3.popen3(command) do |stdin, stdout, stderr|
@stop_stdin = stdin
while !stdout.eof do
output = stdout.read(1024 * 100)
list_pipes.each do |out|
out.print output
end
end
end
I am looking for a system to parallelise my tests in a Rubyon Rails app (using rspec, cucumber) that works using JRuby.
The systems I can find (hydra, parallel-test) look like they use forking, which is problematic in a JRuby environment.
Every time I try to debug my Rails app via Netbeans I get a ...
"Could not connect to web server - cannot show http://localhost:3000"
Rails - 2.3.5
Ruby - 1.8.7-p249
Anyone know how to resolve this?
Thanks
Hi,
I was going over some pages from WikiVS, that I quote from:
because lambdas in Python are restricted to expressions and cannot contain statements
I would like to know what would be a good example (or more) where this restriction would be, preferably compared to the Ruby language.
Thank you for your answers, comments and feedback!
In the effort to learn python and/or ruby, I was wondering how a file shredder would be implemented? I would like it to take in a file as an argument and then employ an algorithm to make that file unrecoverable. Would possibly add the support for multiple files or even whole directories later.
I am looking to host multiple rubyon rails apps and want to use lighttpd or nginx.How do I do multiple name server configuration. ?
I know how to do it in apache through webmin control panel.But trying to move away from apache here
I want to unescape the following string:
'\u00020\u0002Standard\u00023\u0002Doe John\u000169\u0002\u0010\u0002Lorem\u0002\u0011\u0002Ipsum\u0002\u0014\u0002'
Javascripts unescape function works ok, however how can I unescape it in ruby?
Take in mind that unescape(previousString) is 0Standard3Doe John69LoremIpsum.
I'm not sure what to call this, so I'll give an example.
In PHP
1==2 || 2 returns 1 or true
In Ruby
1==2 || 2 returns 2 (The second statement if the first evaluates to false).
Is there any short way to implement similar thing in PHP?
Any recommendation on libraries to do audio processing in Ruby. I need to do the following two tasks:
Find silences, for which I'm happy to just be able to iterate over each sample in the wave.
Cut and paste pieces of wav files to form a new wav file.
Convert wav to mp3, which I will probably leave to lame anyway.
I'm looking for the equivalent of NAudio, a C# library.
What are the best practices for reading and writing binary data in Ruby?
In the code sample below I needed to send a binary file using over HTTP (as POST data):
f = File.new("resp.der", "r") # binary file
begin
while true
out.syswrite(f.sysread(1)) # out is an output stream (type IO)
end
rescue EOFError => err
puts "Sent response."
end
While this code seems to do a good job, it probably isn't very idiomatic. How can I improve it?
Hello,
how would I develop an Email client in Ruby-on-rails taking Gmail as an example? I would be especially interested in the send email functions
Thanks for any pointers
In ruby, how do I test that one array not only has the elements of another array, but contain them in that particular order?
correct_combination = [1, 2, 3, 4, 5]
[1, 5, 8, 2, 3, 4, 5].function_name(correct_combination) # => false
[8, 10, 1, 2, 3, 4, 5, 9].function_name(correct_combination) # => true
I tried using include, but that is used to test whether [1,2,3].include?(2) is true or not.
Hello,
I've a remote cgi script hosted on Apache using SSL. It takes in two input variables a and b.
I want to call call the cgi script with right input variables using ruby.
Any clues would be appreciated.
I'm trying to write a ruby script which automatically downloads some files from some server ever 30-45 minutes (to prevent overload) as long as my computer is turned on. It's possible that my computer might be turned off at some point, but the download should resume (probably re-download the current file).
I already have the file list but I can't figure out how to make such a script to run autonomously.
What are some ways I can do this?
I found ruby class Timeout very useful for my project.
But i need to run a block of code in background and keep it under a timeout..
For example
Timeout::timeout(2) { block.call }
How to do that?
Inspired by this discussion, after some googling I wasn't able to find an answer to a pretty simple question regarding methods in Ruby: are they objects or not?
There are different opinions here and there, and I would really like to hear, let's say, an in-depth explanation.
I'm aware of Object#method method, which takes a method name and returns a Method instance, but, on the other hand, there's a similar thing you can do with blocks to make them into Proc instances, and blocks aren't objects, so what makes methods any different?
If I'm building a library in ruby, what's the best way to allow users of the library to set module-wide settings that will be available to all sub classes etc of the library?
A good example would be if I'm writing a library for posting to a webservice:
TheService::File.upload("myfile.txt") # Uploads anonymously
TheService::Settings.login("myuser","mypass") # Or any other similar way of doing this
TheService::File.upload("myfile.txt") # Uploads as 'myuser'
The idea would be that unless TheService::Settings.logout is called then all TheService operations would be conducted under myuser's account.
Any ideas?