317932-318467

317760-322518 subjects 318166-318810

^ [QUIZ] Long Division (#180)
317932 [matt moss.na] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ 318065 [list.push gm] Here is my solution
+ 318066 [sepp2k googl] This isn't thoroughly tested but it seems to work. It supports specifying a
| 318068 [kbloom gmail] I'm posting Sebastian's solution to the newsgroup, because I don't know
+ 318206 [list.push gm] This is about the same as my first solution.
+ 318238 [shourya.sarc] =20
+ 318467 [matt moss.na] Apologies for lack of summary... mid-terms and stuff. Will try to have

^ IO.popen max length
317935 [emanuelef ti] I'm using IO.popen for launching an executable, the line is quite long
318108 [emanuelef ti] It works aupgrading to 186-26

^ Error Exception if script doesn't run
317938 [johnsheahan ] I need to know if my script fails to run for any reason and capture the
317941 [b.candler po] begin
+ 317958 [johnsheahan ] that does exactly what I had hoped....thanks alot!
+ 317967 [johnsheahan ] I notice that any shell commands that I have in the script that fail do
  317972 [vjoel path.b] irb(main):002:0> unless system "false"; puts "failed!"; end
  317974 [johnsheahan ] It seems to work but not for this command, perhaps since scp gets
  + 317979 [TimHunter nc] In the general case, when a command succeeds it returns 0 and when it
  | 317992 [johnsheahan ] Based on what you have described, I think I have figured out a way to
  | + 317993 [henrik nyh.s] It is an error code, so it's sometimes other values than 1. Success is always 0.
  | + 318058 [b.candler po] That's because the low-order 8 bits of $? encode something different;
  |   318076 [johnsheahan ] `cp /xhome/jsmith/js.txt /home/jsmith/js2.txt`
  |   + 318077 [mguterl gmai] Look into __LINE__
  |   + 318146 [b.candler po] Use __FILE__ and __LINE__
  |     318147 [johnsheahan ] That really helps clear things up..thanks.
  |     318164 [johnsheahan ] I finally figured out the last problem which was why some of my Ruby
  |     318192 [nobu ruby-la] I'd rather use popen.
  |     + 318216 [johnsheahan ] wow! so much better!
  |     + 318263 [johnsheahan ] Would you happen to know how to send an attachment using the popen code?
  |       318288 [nobu ruby-la] See RFC5322 and RFC2387.
  + 318036 [driodeiros g] I would recommend using rsync instead of scp.

^ installing gems in a batch file
317944 [mario betwar] I'm trying to write a batch file to install all the external libraries
317964 [keeperotphon] You should use the call command in a batch file to continue on to the next
318115 [mario betwar] Thanks a lot!!!

^ [OT] Re: I found way to protect Source Code! :)
317956 [ara.t.howard] you know C can be de-compiled right?
318287 [shourya.sarc] =20

^ Re: spreadsheet 0.6.0 Released
317960 [mark thomasz] 0.7.0: Improved Format support/Styles
317961 [james.herdma] Hah.  Sorry about that.  It seems I need to get a stronger cup of coffee.

^ [ANN] Prawn 0.2.1, 0.2.2 (Fast, nimble PDF generator for Ruby)
317963 [gregory.t.br] A new release of Prawn is out, with some bug fixes and a couple

^ Counting
317966 [thomas.clark] How would i go about making Ruby count to say 1000 usin only multiples
+ 317968 [cdemyanovich] multiples = []
| 317970 [damnbigman g] You should be able to ignore the % 2 bit as if it's divisible by 6 then it's
+ 317969 [wrsh07 gmail] Can you elaborate a bit more?
+ 317971 [rohit.namjos] Using the fact that a multiple of 6 must be a multiple of 2 - apart from 2
+ 317973 [thomas.clark] Sorry i meant to say 2 and 5
| 317975 [Rob AgileCon] You should just have the professor post the assignment directly and it
| 317976 [thomas.clark] what youmean the proffesor
| 317977 [synfinatic g] who hands out homework assignments asking for arbitrary and generally
+ 317991 [w_a_x_man ya] (1..1000).select{|n| 0 == n % 10 }
| + 317995 [cdemyanovich] I like that approach, William. Thanks for the deodorant. ;-)
| + 317998 [joe talkhous] Don't need no stinkin' select either;)  It's much faster if you don't
|   318003 [cdemyanovich] The OP needs multiples of 2 and 6. Since all multiples of 6 are also
|   + 318033 [caduceass gm] Well, I don't think he meant all multiples of (2 AND 6), or in this
|   | 318034 [caduceass gm] With 'he', I meant the OP.
|   + 318134 [joe talkhous] Right, as per my caveat n must be divisible by d*2.   You can't
+ 318043 [gregory.t.br] FizzBuzz FAIL!
+ 318239 [lloyd 2live4] If you want numbers that are divisible by 2 *or* 6, then that is all

^ soma - send snippets from vim to irb
317981 [martindemell] martin

^ Hiding default console window
317987 [matma.rex gm] that's not important now, and saves it back. It's called by other
317988 [phasis gmail] You should use rubyw.exe in that case.
+ 317994 [matma.rex gm] Thank you!
+ 318022 [vjoel path.b] and if you're using the 1-click ruby, then .rbw is already associated

^ define_method inside a module
317989 [mr.damien ho] I am trying to use some dynamic features of ruby.
+ 317990 [mr.damien ho] I pushed enter too fast, here are the missing code
+ 318027 [vjoel path.b] class C
  318109 [mr.damien ho] seems not to work neither
  318119 [dblack rubyp] That's because name is not in scope inside the class definition body
  + 318120 [shortcutter ] Also, watch closely the contents of "name" and how you (OP) use it.
  + 318410 [mr.damien ho] Thanks for you answers, I will check that.

^ Ruby and OpenSSL: no such file to load -- openssl (RuntimeError)
317996 [reddvinylene] ./script/../config/../vendor/rails/railties/lib/initializer.rb:253:in
+ 317997 [reddvinylene] I just tried compiling/installing openssl-0.9.8i-1 manually, but that
| 317999 [mguterl gmai] I'm no expert in this arena, but you may need to recompile ruby after
| 318001 [reddvinylene] Yeah, good idea, but sorry, it made no difference.
+ 318069 [shortcutter ] Maybe you got your environment messed up.  Did you try adding

^ Call to sudo
318000 [jonas.esp go] Is possible to call to sudo before of run a ruby statement (for that
318002 [james.herdma] I think you're talking about passing commands through the 'system' command.
318005 [jonas.esp go] d.
318006 [phlip2005 gm] No. The system command runs sudo in a shell - a separate executing binary
318007 [jonas.esp go] Create the '/usr/local/share/java' directory if it isn't already
318009 [phlip2005 gm] First, puts a string that advises the user why they might need to enter
318017 [jonas.esp go] No. I've to install anything JAR files in that directory.

^ Trying to run an external exe file in ruby
318004 [thijsjanzen ] I'm trying to write a little script that can run several
318028 [w_a_x_man ya] Are you sure that Mastermind.exe is looking in the correct
318050 [thijsjanzen ] yes, that is correct.

^ Low level syntax highlighting tools?
318008 [gregory.t.br] I'll confess I didn't research this deeply, in hopes that someone
+ 318010 [jftran rubyf] I guess no, but if you're using a syntax-colorizing, I think the
| 318011 [gregory.t.br] Cool, I'll look into this, thanks.
+ 318013 [ara.t.howard] it seems like using Hpricot against one of the current highlighters
  318016 [gregory.t.br] Hmm... that's an interesting idea too.  I'll take a quick look at how

^ Record and analyze sound from mic
318012 [sandro.pagan] I'm looking for someone who had already tried (or, at least, has some ideas
318030 [shevegen lin] Are you on Linux? On Linux there are several ways, unfortunately I have

^ Improve my github hack!
318015 [gregory.t.br] bit easier to vendor libs found on github.

^ ### Download Hot Babes Shooting Guns ###
318018 [larrybirdcag] Wet and Wild edition http://militarybodyarmor.blogspot.com/2008/10/law-enforcement-certifications.html

^ Uncompress tar.gz
318019 [jonas.esp go] Which is the best way to uncompress a 'tar.gz' file since Ruby?
+ 318020 [adam_penny h] I'm not sure if I'm misunderstanding you, but wouldn't that be
| 318038 [jonas.esp go] tgz_file = Zlib::GzipReader.new( File.open(file, 'rb') )
| 318049 [jonas.esp go] There is a great library, Facets [1], with many usefull methods and
+ 318024 [adam_penny h] The more I look at your message the more I suspect that you meant using

^ Handling invalid options with OptionParser
318021 [adam_penny h] either target Mac address by selected printer or target MAC address by
318023 [stefano.croc] I guess you can enclose the call to OptionParser#parse! in a begin/rescue
318025 [adam_penny h] Stefano, that's a very big help, thank you very much!
318026 [adam_penny h] invalid option: -l

^ Re: Ruby and OpenSSL: no such file to load -- openssl (Runti
318029 [shevegen lin] Did you

^ Re: mechanize 0.8.4 Released
318031 [shevegen lin] Same here :)

^ Using a result as a constant object?
318035 [phyprabab ya] I am trying to understand how I can use a return from a method as a constant name for a class.  What I am trying to do is take a return I find in a db table and use that name as a class name so that I can use activerecord.  I admit my understanding of ActiveRecord is extremely immature so perhaps I am using it wrong.
+ 318040 [TimHunter nc] If you're getting the class name at run-time how would you write code
| 318057 [artem.vorozt] my_class = Class.new(ActiveRecord::Base) {  set_table_name
| + 318061 [andringa qui] If the ActiveRecord model already exists you can just call constantize
| | 318062 [andringa qui] Should be: ar_model.find(120)
| | 318063 [andringa qui] Be aware that 'constantize' is a method added by ActiveSupport, no
| | 318080 [phyprabab ya] Sjoerd,
| + 318082 [phyprabab ya] Artem,
+ 318073 [b.candler po] def get_name
  318079 [phyprabab ya] Brian,

^ Launch ruby script from Quicksilver
318037 [ajwalters gm] I was wondering if anybody knew how to launch a ruby script from
+ 318041 [driodeiros g] Have you checked if you get any error in the console? Also, does it work
+ 318042 [mikael hoilu] Put the text `#!/usr/bin/env ruby` in the file as the first line, give
  318044 [ajwalters gm] -bash: require: command not found
  318045 [mikael hoilu] Sorry, my silly mistake. It wasn't actually working.
  318046 [ajwalters gm] Nice, that worked.  I think i just needed to specifically set my ruby

^ prob with ranges
318047 [junkone1 gma] i looked at an example
+ 318048 [mguterl gmai] yes it does, you just forgot the separator in your call to print
+ 318056 [sepp2k googl] That doesn't work because 15..10 is an empty range.
| 318070 [junkone1 gma] so i cannot have a range that is decreasing in numbers. for eg
| + 318072 [tpreal gmail] Range is by definition increasing. If you want to iterate over numbers
| + 318074 [matt moss.na] 5.downto(1) do |i|
| + 318075 [TimHunter nc] ri Integer#downto
+ 318184 [quixoticsyco] I used this as a self-tutorial for learning RSpec for the first time.
  318229 [quixoticsyco] I received an email which indicated this needs some explanation.  Yes,

^ Standard File Naming Conventions
318051 [clintpachl g] For a file containing the given class, SomeCoolClass, what would be
318054 [henrik nyh.s] I'm not sure about the Ruby convention here, but I know Ruby on Rails

^ Using captcha
318053 [vkv_devaki r] I'm trying to implement Captcha in my program.Anyone will
318055 [artem.vorozt] I advise you to use Yacaph.

^ Elegance is an attitude
318064 [saleflyingzg] Flyingzg com Online store selling designer replica watche, replica

^ [SOLUTION][QUIZ] Long Division (#180)
318067 [kbloom gmail] class Integer

^ Proc metaprogramming tricks?
318071 [dxm997 gmail] I'm building a DSL and trying some weird syntax structures. My DSL
318087 [transfire gm] =A0 def dsl(&block)
318089 [dxm997 gmail] =0D=0A>> I'm building a DSL and trying some weird syntax structures. My DSL
+ 318090 [mikael hoilu] class C
| 318092 [dxm997 gmail] Yes! Why haven't I thought of this solution?!
| + 318093 [mikael hoilu] That, and
| + 318110 [shortcutter ] initial
+ 318099 [transfire gm] You can just allow them to be defined in Root and then use #inherited

^ Emacs / rcodetools
318088 [leon tim-onl] I'm trying to get emacs running nicely all weekend. But I can't get
318094 [chris.lowis ] (define-key ruby-mode-map (kbd "C-/") 'rct-complete-symbol)
318126 [leon tim-onl] Thanks this works! Do you know if it's also possible to use this outside
318127 [leon tim-onl] OW wait, anything-rcodetools is what I want? I'll try to set that up.

^ a new quotation operator to automatically unindent %q and %Q
318091 [ snk gna.org] Many times I have faced the situation of embedding multi-line strings in
+ 318096 [kbloom gmail] Use the facets gem's String#margin instead?
+ 318097 [mguterl gmai] %s is already in use for symbols.
+ 318098 [transfire gm] %l{
| 318122 [kbloom gmail] Probably because it can easily be done in a library. See the facets gem's
+ 318208 [b.candler po] Just an observation: it will require all the quoted lines to use tabs

^ Question about sendmail by smtp
318100 [lu.xiandong ] I try to send a email by smtp.

^ require sqlite?
318104 [jamal soueid] I wonder why I cannot require sqlite in my ruby app.
+ 318105 [larsch belun] require 'rubygems'
| 318111 [jamal soueid] Thanks, that fixed my problem :)
+ 318107 [stanbench gm] I hope this can solve your problem...

^ Rake Rule name problem
318112 [james dimsum] I my rake file a rule does not seem to produce a correct name.
318113 [james dimsum] That should read
318124 [wpdster gmai] rule '.o' => ['.c'] do |t|
318236 [james dimsum] task :default do
318253 [wpdster gmai] simply a bunch of Ruby code.  When you invoke rake at the command line, it
318312 [james dimsum] Maybe it will work like that but it's not useful.  I don't know until
318325 [wpdster gmai] Sorry, I just meant that to be used as an example to show what was going
318426 [james dimsum] ok I changed the previous script to this

^ Question about sendmail by smtp
318116 [lu.xiandong ] I try to send a email by smtp.

^ Kernel.` doesn't work in drb?
318121 [ittay.dror g] A script has the line

^ ApressDailyDeal - Practical Rails Plugins
318125 [jeffrey.scho] Apress has a daily ebook deal where they discount a single ebook for 24
318174 [mark thomasz] On Oct 20, 8:39=A0am, Jeff Schoolcraft <jeffrey.schoolcr...@gmail.com>

^ Best Command Prompt
318128 [gjhames gmai] There's a good command interpreter for ruby instead of irb? Like
+ 318130 [transfire gm] How is ipython better than irb?
| 318132 [jens.wille u] i always hated that it would store history entries in oldest-first
| 318151 [transfire gm] t (although I hate that
| 318152 [jens.wille u] that would be great! let me know if i can lend a hand.
+ 318133 [shortcutter ] What functionality are you missing in IRB?
  318159 [modnar13 yah] I believe what he's looking for is a *nix command shell (like sh) that
  318160 [hassan.schro] If that's the case: <http://rush.heroku.com/>

^ Way to split a string based on fixed length?
318135 [wayne econof] This is probably a newb question but I can't seem to figure it out.  I
+ 318136 [james graypr] => ["0000000N", "0000000N", "0000000N", "0000000N"]
+ 318137 [onepoint sta] irb(main):001:0> "abcdefghijklmnpqrstuvwxyz".scan /.{8}/
+ 318138 [john.slobbe ] string.unpack "A8A8A4A2" # => ["0000000N", "0000000N", "0000", "00"]
+ 318140 [wayne econof] Awesome!  Thanks much!
+ 318141 [cdemyanovich] I thought String#split with a regex might do it, but I'm not sure why it
  + 318142 [cdemyanovich] D'oh, GMail didn't update the conversation while I was replying. Anyway, you
  + 318143 [chy.causer g] Going a bit off topic here, but I suspect the reason split adds empty
  + 318205 [adam_penny h] Don't quote me on this, but I think that would be because String#split

^ Gems (1.3.0) not visible from ruby (1.8.7)
318139 [joni.niemi v] I'm trying to sftp into another server using net-sftp, but the gems I
+ 318150 [gregory.t.br] It should begin with
+ 318153 [kbloom gmail] You need to
  318199 [joni.niemi v] Thanks, Ken and Gregory, that worked like a dream! I somehow missed the

^ daemons
318148 [phyprabab ya] I know people have probably had success with daemons, however, I am running into issues.  A simple script to daemonize another script fails w/

^ Encrypting using openssl Triple-DES
318149 [jiffier gmai] (DES-EDE3-ECB), but I don't know how to do it. If I create the cipher
318203 [b.candler po] des-ede3-cbc       Three key triple DES EDE in CBC mode
318212 [jiffier gmai] be no way of encrypting with des-ede3-ecb?

^ Problem with last_insert_row_id in sqlite3
318157 [kenneth.m.mc] When I try to use the last_insert_row_id function in sqlite3, I'm
318161 [kenneth.m.mc] Problem solved. The error was in incorrect docs on the web. the proper

^ ruby/mysql connection close problem
318158 [adamhurlburt] I am using the Ruby/mysql module installed from gems and everything is
318186 [rogerpack200] I suppose if you got really desperate you could use mysqlplus then hard

^ [ANN] LiveConsole 0.2.0, a window into your running program.
318162 [1337p337 gma] Hey, uh, here's a long-overdue new release of LiveConsole.  If you've

^ Block method to yield stdout?
318163 [list.rb gmai] All, I've written a distribution service that spawns processes using
+ 318172 [mark thomasz] =A0
| 318185 [list.rb gmai] Thanks Mark for replying. Yes I have used Tail before but what I'm looking
+ 318377 [kbloom gmail] Maybe use Open3, or popen. Worst case, look at how Open3 does a fork/exec
threads.html
top