[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

my code hangs

Simon Schuster

9/24/2007 6:18:00 PM

it DID (kind of) work and even exit, but only after going through one
log, rather than appending ALL of them, formatted, into a file like I
wanted, so I added line 13, and a corresponding end at the bottom. :P
now it makes the main_text.txt, but hangs. I'm new to
ruby/programming, just thought this'd be a fun learning project.

http://pastebin.com...

for the future: formatting based way more on keywords in the dialogue,
as well as possibly project gutenberg searches of related/random text
for narrative, and finally using lulu's API (http://api...) or
createspace, if I can find an API for them, to automatically publish
and purchase a copy. could TOTALLY be extended to have commercial
value in record-keeping, for companies that use IM and RSS, if that
were implemented, which it might be anyway because hey, blogs. Title =
Chaptertitle. yeah they'd be short chapters, but I like richard
brautigan and thousands of livejournal users would be aching to see
themselves in print, I'm sure. :)

any help in any of these areas is appreciated! thank you kindly.

2 Answers

Adam Shelly

9/24/2007 6:35:00 PM

0

On 9/24/07, Simon Schuster <significants@gmail.com> wrote:
> it DID (kind of) work and even exit, but only after going through one
> log, rather than appending ALL of them, formatted, into a file like I
> wanted, so I added line 13, and a corresponding end at the bottom. :P
> now it makes the main_text.txt, but hangs.

at line 30 you have:

> until y.length > 9
> log_array.delete_at(x)
> end

as far as I can tell, the delete_at can't affect y.length, so this
will loop forever if y.length <= 9.

-Adam

Simon Schuster

9/25/2007 12:38:00 AM

0

thank you, this fixed this problem

On 9/24/07, Adam Shelly <adam.shelly@gmail.com> wrote:
> On 9/24/07, Simon Schuster <significants@gmail.com> wrote:
> > it DID (kind of) work and even exit, but only after going through one
> > log, rather than appending ALL of them, formatted, into a file like I
> > wanted, so I added line 13, and a corresponding end at the bottom. :P
> > now it makes the main_text.txt, but hangs.
>
> at line 30 you have:
>
> > until y.length > 9
> > log_array.delete_at(x)
> > end
>
> as far as I can tell, the delete_at can't affect y.length, so this
> will loop forever if y.length <= 9.
>
> -Adam
>
>