Everything explained at this link:
http://suretalent.blogspot.de/2011/07/how-to-shutdown-windows-2008-without.html
My Tips and Tricks for C#, C, C++, MatLAB, Java, LaTeX, Python and more!
Tuesday, December 29, 2015
Monday, December 7, 2015
Mastering CLASSPATH
Useful information about CLASSPATH at this link
http://kevinboone.net/classpath.html
http://kevinboone.net/classpath.html
Tuesday, December 1, 2015
How to combine gets.chomp and ARGV in a Ruby script
Are trying to learn Ruby? Nice!
You have just written a script that combines gets.chomp and command line arguments via ARGV
and you are getting this error ?
`gets': No such file or directory @ rb_sysopen
Well the solution is to modify slightly gets.chomp, it needs to be $stdin.gets.chomp
Here is a working script (example1.rb) .
# -*- coding: utf-8 -*-
puts ""
puts "Hello World (in Ruby)"
print "Insert some input here: "
user_input = $stdin.gets.chomp
print "You inserted: #{user_input} \n"
# parse 3 command line arguments...
f1, f2, f3 = ARGV
puts "First argument is: #{f1}"
puts "Second argument is: #{f2}"
puts "Third argument is: #{f3}"
Try it!
>> ruby example1.rb Hello1 Hello2 Hello3
You have just written a script that combines gets.chomp and command line arguments via ARGV
and you are getting this error ?
`gets': No such file or directory @ rb_sysopen
Well the solution is to modify slightly gets.chomp, it needs to be $stdin.gets.chomp
Here is a working script (example1.rb) .
# -*- coding: utf-8 -*-
puts ""
puts "Hello World (in Ruby)"
print "Insert some input here: "
user_input = $stdin.gets.chomp
print "You inserted: #{user_input} \n"
# parse 3 command line arguments...
f1, f2, f3 = ARGV
puts "First argument is: #{f1}"
puts "Second argument is: #{f2}"
puts "Third argument is: #{f3}"
Try it!
>> ruby example1.rb Hello1 Hello2 Hello3
Subscribe to:
Posts (Atom)