303363-314857

303151-346817 subjects 303576-340369

^ Silly issue with if / else with pingecho
303363 [khurrum1 gma] I'm positive that this is something incredibly silly. I have a text file
+ 303368 [khurrum1 gma] Argh... sorry. I just had to chomp the computername.
+ 303577 [Gennady.Byst] DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbToga2h1cnJ1bTFAZ21haWwu

^ How can a code block access an object's variables?
303365 [l33tb0y gmai] Dear Rubyists,
+ 303372 [jj traveliq.] You can pass arguments to block.call which can then be accessed by the
+ 303383 [rick.denatal] class FileReader
  303411 [shortcutter ] No, the complete expression will skip empty lines as well we lines that
  + 303532 [l33tb0y gmai] You are correct.  I was wrong with that regular expression.  I was
  + 303550 [rick.denatal] Right you are, for some reason I failed to see the square brackets.

^ Constants in modules
303374 [lcrespom gma] I need to do something like this (this is a simplified version of some
303375 [jj traveliq.] Two things - firstly, Ruby is interpreted, so invert_hash needs to be
303389 [lcrespom gma] Yes, it works!!
303416 [davebass mus] Yes, this is a common gotcha.

^ File.open auto-close
303379 [slarbi gmail] I know opening a file and passing a block will execute the block in context
+ 303380 [radek.bulat ] Tm8sIGZpbGUgd29uJ3QgYmUgY2xvc2VkICh5b3UgZGlkbid0IHBhc3MgYmxvY2spIGFuZCB5b3Ug
| 303388 [slarbi gmail] MjAwOC81LzI5IFJhZG9zs2F3IEJ1s2F0IDxyYWRlay5idWxhdEBnbWFpbC5jb20+OgoKPiBObywg
+ 303382 [jj traveliq.] It's even easier :) Try

^ Mysterious behavior with loops
303381 [ericlin852 g] a = [1,2,3]
303384 [stefano.croc] Iterating on an array while deleting elements from it is usually a bad idea,
303397 [ericlin852 g] Thanks Stefano, that definitely answered my question.  It's quite

^ ShellExecute and Win32OLE callback
303390 [rrallan gmai] I'm trying to add a callback to a ShellExecute call. (Or at least get
303418 [s.korteling ] You need ShellExecuteEx (see
303423 [rrallan gmai] Thanks Siep;

^ Ruby .read image upside down?
303394 [contact prog] I'm discorvering a strange issue when reading in an image being sent by
303395 [contact prog] Ruby .read image upside down?
303406 [leslieviljoe] Can you save the data back from the database in a file and then look at a
304872 [contact prog] Still no luck.  I've looked at the .read function and dumped its

^ $: from C or from ruby
303396 [andre.nho gm] I'm inspecting the value of $: (the 'require' path) under windows. If

^ Gems not working
303398 [jimh avatar-] I am currently not able to install any gems. I was using Gem 1.1.1 but
+ 303407 [leslieviljoe] Have you tried a couple of times? The errors just look like a slow
| 303522 [jimh avatar-] That's what I thought, but other win32 machines on the same subnet work
| 303525 [hassan.schro] Are you running IPV6 on this system? If so, I'd try disabling that -- no
+ 303628 [tom infoethe] Hm, that "yaml" file is 20 MB now... is your client timing out, or maybe
  303654 [ttmrichter g] The gem servers at rubyforge and whoever hosts for ruby on rails seem to
  + 303656 [ttmrichter g] Since I've had to reinstall all my gems after the upgrade to 1.8.7,
  | + 303673 [tom infoethe] sudo gem install actionmailer RedCloth [... etc ...]
  | | 303688 [ttmrichter g] The problem with this is that if -- scratch that, when -- it fails, I
  | | 303689 [tom infoethe] Ah right, because the gem client is timing out, gotcha.
  | | 303707 [ttmrichter g] There's a lot that surprises me in the recent gem releases (1.0+).  The
  | | 303741 [tom infoethe] Yours,
  | | 303748 [ttmrichter g] Thanks, Tom.  Lack of sleep made me not even think about looking at
  | | 303790 [leslieviljoe] Sorry to repost this, but it should probably have been attached to
  | + 304040 [drbrain segm] No, there is no problem with the rubyforge mirrors.
  |   314857 [spam chovy.c] appears to be a 403 if i go directly to
  + 304039 [drbrain segm] I do not have this problem, and my usage of RubyGems with remote

^ start_command SCP did not finish successfully (1) (Net::SC
303400 [hellolinus g] require 'net/scp'

^ instance method adding another instance method to the class
303401 [neeraj.jsr g] class Person
303417 [davebass mus] It's not necessary to instantiate Person; changing the last line to
303427 [rick.denatal] It's because a nested def doesn't define a method in the class of the

^ Ruby-Processing library
303402 [sandipfloyd ] I am using the ruby-processing library made available on the GitHub

^ Re: start_command SCP did not finish successfully -> sftp
303414 [hellolinus g] I have found on Infoq some exampel code to do the upload iwth sftp.

^ Quickie: Monkey patching Array
303420 [leon tim-onl] A quick question: is it possible to monkey patch the Array [] method in
+ 303422 [aredridel nb] Try [], not []=. They're different methods.
+ 303425 [mikael hoilu] You monkey patched the []=3D method, not the [] method. Try
| 303428 [leon tim-onl] I know it's bad behaviour :) But I'm just fiddling with ruby.
| + 303429 [mikael hoilu] That's an array literal, not Array#[]. No way to overload that, I'm =20
| + 303430 [s.korteling ] try
|   + 303435 [reidmix yaho] you are just assigning a to an array literal
|   + 303464 [leon tim-onl] Hee Siep,
|     303466 [leon tim-onl] Ah, I read the post about the array literal.
+ 303426 [s.korteling ] You redefined the []= method, not the [] method.

^ PHP to Ruby (associative array to Hash)
303421 [s.d comcast.] In the following PHP function, both 'types' and 'groups' are associative
+ 303431 [jan.svitok g] -  types = { 'aac'   => 'audio/x-aac',
+ 303432 [towb gmx.net] Only FalseClass and NilClass are false in Ruby, so if it can be an empty
+ 303479 [Joerg.Mittag] This is my take. I shuffled things around a bit, e.g. using constants
  303545 [s.d comcast.] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  + 303557 [caduceass gm] * is not pointer notation here.  One way to think about it is that it
  + 303558 [jan.svitok g] * is not a pointer, it is so-called splat operator (google: ruby

^ How do i replace actual value in the query with variables?
303434 [aumart gmail] I try to set up a loop to put the data in the array into the oracle
+ 303436 [caduceass gm] You can expand within double quotes using "#{my_var}", so maybe
| 303458 [kubo jiubao.] conn.exec( "UPDATE SCH_EVENT SET P_ID = 2444334 where RANK = :1 AND
| 303548 [caduceass gm] How can you not still do insecure injection with this?
| 303699 [ninja slapha] Well, if you use single quotes for your SQL string, you can't because either
+ 303498 [andreas.warb] for q in 0..4

^ Newbie question: Value from YML file into a class...
303437 [mcpierce gma] On my project we're using ActiveLdap. One of our classes, called Account. It
303442 [ara.t.howard] probably the yaml keys are strings and you are accessing them via

^ This Week in Ruby (May 29, 2008)
303440 [acangiano gm] Cheers,

^ Newby Question: Check image size before getting with Net::Http
303445 [ruchira.bomi] Dear Expert,
303447 [phasis gmail] require 'net/http'
303517 [ruchira.bomi] Thank you very much Park.

^ Find files
303446 [clement.ow a] using the Find module and search for files and at the same time have
+ 303463 [jgabrielygal] Sorry, I don't have more time to look deeper into this, but with
+ 303468 [botpena gmai] where does this $d1 come from?
| 303717 [clement.ow a] It is a date object in the format of MM-YY, in which this object is used
| 303724 [shortcutter ] <snip/>
+ 303503 [shortcutter ] #!/bin/env ruby
  303505 [shortcutter ] Sorry, hit "send" too early.

^ [ANN] Gerbil 2.1.0
303455 [ snk gna.org] Gerbil

^ how to generate ascii code?
303460 [martin angle] Dear all,
+ 303465 [Paul.McArdle] '76'.to_i.chr
+ 303467 [phasis gmail] irb(main):001:0> require 'cgi'
| + 303547 [davebass mus] Actually CGI.escape and CGI.unescape are such short methods that you can
| + 303703 [martin angle] Dear Park Heesob,
|   303706 [phasis gmail] Take a look at cgi.rb. It is easy to understand.
|   303712 [martin angle] Dear Park,
|   303714 [phasis gmail] Of course you don't need to require cgi.
|   303835 [martin angle] Dear Park,
|   303836 [martin angle] I got the ascii code of hexa decimal value using
|   303854 [joec_49 hotm] What is the best book for an experienced programmer (Perl, C#, VisualBasic,=
+ 303521 [Rob AgileCon] You might consider googling "lexical analysis" because the particular

^ [OT] 7 Ruby Programming ebook
303462 [damphyr free] Yes it is, but I can't resist the temptation anymore. You can draw a

^ Address search algorithms
303469 [raasdnil gma] Heya all,
+ 303476 [dandiebolt y] ziplookup (1.0.0)
| 303477 [flo andersgr] Actually, i had such a problem. You problem is
+ 303480 [eleanor game] Assuming these are UK-only addresses, at the very least you should
  303494 [raasdnil gma] Thanks all for your tips!
  303497 [eleanor game] You have my sympathy ;)

^ split a string at tab positions
303470 [suresh.amrit] I am a newbie to ruby and when i tried to split a string at tab
+ 303471 [botpena gmai] probably your editor is converting the tab to spaces.
+ 303472 [thehcdreamer] first, you should use double quote when you want to escape a character.
| 303474 [suresh.amrit] Thank you both. It was the double quote issue...when i gave split "\t"
+ 303473 [skraemer min] Regexes take the form /.../ (see http://www.ruby-doc.org/core/classes/Regexp.html)
| 303772 [mo_mail ongh] I think his piece of code also works - in my mind, the problem is the
+ 303771 [mo_mail ongh] The problem is the '\t' - anything inside single quotes is not touched

^ Using gem to deploy a autoconf packages, expriences?
303478 [florian.ebel] I'm just thinking about how well suited RubyGems might be
303535 [pbrannan atd] - Specify all the autoconf-generated files to be included in the gem

^ How do you convert a hexadecimal number to a binary number?
303481 [small.busine] I can't find a clue how to convert a hexadecimal number to a binary
+ 303482 [thehcdreamer] number.to_s(2)
+ 303483 [billk cts.co] => "1011111011101111"

^ defining Private/Protected class attributes
303484 [cmonoxide gm] If I would like to define some private/protected class attributes, I
+ 303485 [dblack rubyp] class C
+ 303516 [s.korteling ] class Test
  303586 [cmonoxide gm] Thanks all!

^ Proc multiple returns?
303486 [c00lryguy gm] def foo(&block)
+ 303487 [dblack rubyp] def foo
| 303489 [dblack rubyp] foo { break "bar", "baz" }
| 303561 [c00lryguy gm] Almost. 'break' well...breaks it though, cause im recursively calling
+ 303495 [andreas.warb] irb(main):010:0> def foo(&block); block.call if block; end
  303496 [c00lryguy gm] You dont understand, I'm making a simple HTML module for easy document
  + 303499 [andreas.warb] Andreas
  | 303501 [c00lryguy gm] Yeah I know, I've looked at this before i started makin this. I'm really
  + 303500 [AEtzold gmx.] Dear Ryan,
  | 303529 [c00lryguy gm] You cant use the return function within procs.
  | 303565 [ara.t.howard] but
  | 303568 [c00lryguy gm] Beautiful, thanks alot man!
  + 303564 [ara.t.howard] require 'rubygems'

^ Re: How do you convert a hexadecimal number to a binary numb
303488 [c00lryguy gm] From http://www.tek-tips.com/viewthread.cfm?qid=1026407&page=1
303490 [small.busine] Big thanks for the quick reply, Ryan!
303491 [c00lryguy gm] NP, I just happened to needed this same info like two days ago

^ Ruby 1.9 migration problem on Windows
303492 [andreas.warb] I have an application, which currently runs under ruby 1.8.6. I want to

^ not a valid win32 application?? help, please
303493 [dark_sgtphoe] I don't understand why my computer won't run any of my Ruby programs
+ 303526 [damnbigman g] Has something reset your path?
+ 303538 [davebass mus] Operating system and exact error message?

^ in the callback why I must use self
303507 [neeraj.jsr g] class User < ActiveRecord::Base
303513 [jameskilton ] The issue here is that the parser can't tell the difference between
303524 [Rob AgileCon] ...and the reason Ruby can't has to do with the dynamic way that

^ Re: How do i replace actual value in the query with variable
303514 [c00lryguy gm] (0..4).each { |q| conn.exec( 'UPDATE SCH_EVENT SET P_ID = 2444334 where
303543 [cmdjackryan ] Gotta love an SQL injection waiting to happen..
+ 303560 [caduceass gm] Umm... duh.  It was probably an example.  Anybody worth their grain of
+ 303567 [flo andersgr] Converting to a number type before using the value is injection safe.
  303570 [aumart gmail] Yeah.. this is just a example.....

^ getting standard error and output from ruby script in real time
303519 [stefano.croc] I'm trying to write an editor for ruby in ruby using the KDE4 bindings for
+ 303536 [davebass mus] It's to do with buffering. Buffering takes place within Ruby (I think)
| 303596 [stefano.croc] Thanks for the information. I think I'll look at the source code of some tool
| 303597 [Rob AgileCon] $stdout.sync = true; $stdout.flush
| 303607 [stefano.croc] I don't think that would work. If I understand correctly what you mean, that
| + 303616 [Rob AgileCon] If you have no need to maintain separate streams do the equivalent of =20=
| + 303626 [ara.t.howard] what you want to do is easily accomplished using session.rb
|   303642 [stefano.croc] Thanks for telling me about session. Unfortunately, it still doesn't work. I
+ 303566 [xcampanoli g] STDERR.puts
  303595 [stefano.croc] I know that puts writes on standard output, this is what I want it to do. It's

^ Eclipse RDT plugin
303527 [tahura hotma] I'm fixing a bug on an existing Ruby application. Everything I know
303600 [netcam gmail] Use the eclipse dynamic lang toolkit for ruby DLTK and just configure

^ parsing a URI's base authority
303531 [a.flow tisca] I am looking for a ruby library to reliably determine the base

^ full path require
303533 [aidy.lewis g] Is it possible to find out the full path of all the files that have
+ 303539 [ara.t.howard] oops - ignore that other post, i meant
+ 303540 [ara.t.howard] puts $:.map{|path| File.expand_path path}

^ ruby gem to do https connection
303537 [junkone1 gma] is there a ruby gem that can do a https connection to the following

^ Problem of trying to get gmail atom feed in ruby
303549 [carfield gma] http = Net::HTTP::new('mail.google.com', 443);

^ IDE Supporting Global Class List (Yes I searched)
303554 [humanx2000 h] Before I post this, I did search this site + google for the answer. I
303555 [huw darkneon] Can you explain what you mean by a Global Project Class view. I am one
303556 [humanx2000 h] PHPED http://www.nusphere.com/products/phped_52/large_image1.htm
303563 [huw darkneon] We have RDoc documentation in tooltips or in a docked window. We have

^ gdata-ruby and all other Google Data Api'S
303559 [dsisnero gma] There are about 5 projects that implement various google apis, be it

^ The Gems Repository Stats
303562 [leslieviljoe] Wondering why the endless "bulk updating" takes so long I looked that
304034 [drbrain segm] You are looking at RubyGems 0.9.4 or older, so this code is at least
304051 [leslieviljoe] Probably my regular expressions letting me down, I thought this was
304060 [drbrain segm] Yes, 2-4 weeks out.  I have to go through the rest of the tracker

^ Unbuffered output with Logger (newbie question)
303569 [ericlin852 g] I'm trying to use Ruby's built-in Logger facility, and I'm not able to
303592 [davebass mus] File is a subclass of IO, and IO has a flush method, which File
303605 [shortcutter ] There is a much better option: create the File with File::SYNC.  You
303687 [ericlin852 g] It appears File::SYNC doesn't exist (at least not in my copy of

^ splitting help needed
303571 [dark_sgtphoe] I have a program that someone on this forum helped me fix before that
+ 303573 [s.korteling ] The method split splits up a string and it will put the parts in an
| + 303575 [dark_sgtphoe] Well, it isn't writing a new file for each line... but, it's not listing
| | 303579 [dblack rubyp] It's writing a new file for each element in the input. You're writing
| | 303584 [dark_sgtphoe] Ohhh, I see... thank you so much! :-D
| | 303585 [tristin.colb] No need to waste space being facetious.
| + 303581 [bbxx789_05ss] str = "hello world goodbye"
| | + 303590 [dblack rubyp] My benchmarks suggest that it's a little faster (about 10%).
| | | 303619 [bbxx789_05ss] I did--8 years ago.
| | | 303620 [bbxx789_05ss] user     system      total        real
| | + 303593 [davebass mus] Larry Wall (Perl supremo) has called this sort of thing LTS: leaning
| |   303594 [dblack rubyp] I always figured it's easiest just to learn the regex stuff and get it
| |   303598 [rick.denatal] Some of the features Ruby 'stole' from Perl are things I use fairly
| |   + 303608 [shortcutter ] That's true.  I usually try to compact code in order to increase
| |   | 303618 [dblack rubyp] I do think that one of the great things about Ruby is that, to a
| |   | 303644 [shortcutter ] Absolutely agree.
| |   + 303617 [dblack rubyp] I like code golf, as long as it's clear that it's code golf -- that
| + 303591 [dblack rubyp] Actually without an argument it will split on any amount of
+ 303574 [s.korteling ] Oh. Well, you will end up with the cities New, York, Chicago, Boston.
threads.html
top