Smallest device to code ruby on?

On Dec 17, 2007 4:20 AM, Casimir [email protected] wrote:

BTW. You still all big on words and no show, no bite. Lets see you code
that better and maybe then I can admit you may have a point… Or are you
chicken? :stuck_out_tongue:

Csmr

You can’t be serious.

But, if you are, just know that globals show a lack of discipline –
not to mention, lack of elegance – in programming with ruby. You are
kind of fighting the idea of location and control of scope, which is a
powerful tool … one which you are throwing away.

The only time I’ve used globals was to play “golf”.

Todd

Giles B. kirjoitti:

if ($doingNext = nil || $doingNext = “SurfingForPr0n”)
$donation = false
help << $doingNext.replace(“Help End Poverty!”)
It was optimized for readibility, not syntax rules.

Actually I meant the $ everywhere. That’s for globals only. Bad thing.

Ya I kno. But if it wuzn’t globals then it wuld “disappear” once the
block ends and then it all wouldn’t work… You DID try to run that,
right?

BTW. You still all big on words and no show, no bite. Lets see you code
that better and maybe then I can admit you may have a point… Or are you
chicken? :stuck_out_tongue:

Csmr

Csmr wrote, as a reply to Giles’ evilmongering:

BTW. You still all big on words and no show, no bite. Lets see you code
that better

On Mon, 17 Dec 2007 11:21:53 -0500, Giles B. replied:

You were serious about that?

people.each do |person|
person.help(end_poverty)
end

Boom. Done.

After trying your code, Ruby sayz:
NameError: undefined local variable or method `people’ for main:Object
from (irb):1 etc.

Dont look done to me.

Yup. I am serious about that, even if I aint serious about this post.
You
better put your funny hat on.

And yanno whats the difference between you an’ me? All u are is HOT
AIRE!
My code works just fine in IRB or as a standalone ruby script. I have
eleet HRRS scills. Haha!

First of all rich North Americans aren’t fat.

I never claimed they all were, simply hoped that you fatsos would
participate, too …

Secondly that’s what Ruby looks like. The code you wrote didn’t even
look like Ruby. You used ifs and globals all over the place and you ran
an iterator on a string without newlines, which does nothing.

Well yanno what, Mr. Big Ruby Shot? My code works great and does exactly
what its supposed to do. I stand by my excellent script.

AND btw its readable by people who dont kno inch of RuwBe. Well…
sorta.

Unlike you know whose code… makes annoying chicken sounds

Thirdly, your spelling is all wrong, and of course I didn’t try to run
it, none of your variables were defined. Virtually none of that code
would run.

It runs 100%, interpreted, virtually, on xen or damn compiled.
neeneenenee-ner

And fourth you really don’t ever use globals, ever.

Watch me. THINK GLOBALLY, ACT LOCALLY.

BTW. You still all big on words and no show, no bite. Lets see you code
that better and maybe then I can admit you may have a point… Or are
you chicken? :stuck_out_tongue:

How old are you? What are you bothering somebody like me for? This
isn’t that kind of list. I think it’s past your bedtime.

Dont try that condescending attitude on me, it wont work on me cowboy. I
aint one of your cartoon foxes. spits

You come around talkin all that trash ‘bout my code. Still you aint got
nothin’ on me and nothin’ to show for your big words but an used
keyboard.

I’m still waiting for your version of that code bit. Man or mouse? I’m
starting to think that talk about Big J being behind your sofa is just
hot air, too.

And all others’ too.

Lets see your best Human Readable “Make A Better World” Ruby-script.
Christmas spirit or Cowboy spirit… or not. .

After all, its a ruby language group. (yes its a code challenge)

“RichFatNorthAmerican”.each do |help|
if ($doingNext = nil || $doingNext = “SurfingForPr0n”)
$donation = false
help << $doingNext.replace(“Help End Poverty!”)
end
end
#Disclaimer: Seems like a nice deal. In reality I have no idea whut it
is!
#do stuff
#…
if $donation == true
$doingNext.gsub!(“Help”, “Aww, relax mang! You already did Help”)
else
$doingNext << " Check out One Laptop per Child Foundation, Invest your money and your time - OLPC Foundation "
end
puts $doingNext

Casimir P.
Art Portfolio: http://csmr.dreamhosters.com

I do like some of the art on your site. The actual art, though,
shouldn’t be copyrighted – I have a pretty cool book called something
like “Mathographics” that has a lot of the same stuff.

I do like the look of your website (no sarcasm there).

This is OT, but I agree, I like some of the artwork on there.

Perhaps we can have a Rubyquiz to create visuals like that that have
distinct meanings, much like one tool I saw on the web ages ago that
analyzed the structures of websites’ HTML and produced visual
node-trees that represented each node on the DOM and colorized
depending on the type of node/content.

Would be fun to make something like that to graph LoC or whatever
other metrics could be visualized.

Thoughts?

On Dec 17, 2007 2:45 PM, Casimir P [email protected]
wrote:

Csmr wrote, as a reply to Giles’ evilmongering:

Lets see your best Human Readable “Make A Better World” Ruby-script.
Christmas spirit or Cowboy spirit… or not. .

After all, its a ruby language group. (yes its a code challenge)

There are better ways to ask for help. Dude, just look at rubyquiz
archives or actual code from raa or rubyforge.

“RichFatNorthAmerican”.each do |help|
if ($doingNext = nil || $doingNext = “SurfingForPr0n”)

BTW, this ^^^^^ if condition will always be true

$doingNext << " Check out One Laptop per Child Foundation, Invest your money and your time - OLPC Foundation "
end
puts $doingNext


Casimir P.
Art Portfolio: http://csmr.dreamhosters.com

I do like some of the art on your site. The actual art, though,
shouldn’t be copyrighted – I have a pretty cool book called something
like “Mathographics” that has a lot of the same stuff.

I do like the look of your website (no sarcasm there).

Todd

On Dec 17, 2007 2:45 PM, Casimir P [email protected] wrote:

Lets see your best Human Readable “Make A Better World” Ruby-script.
Christmas spirit or Cowboy spirit… or not. .

After all, its a ruby language group. (yes its a code challenge)

Todd B. kirjoitti:

There are better ways to ask for help. Dude, just look at rubyquiz
archives or actual code from raa or rubyforge.

I am not asking for help. I already get paid to ruby.

I am just trying to find and explore new ways to approach and code ruby.

Lol plus Giles said my script sucked, which it didnt, hence the
challenge. Now whether there are there any rubyists worthy of the
challenge still remains to be seen. So far none.

“RichFatNorthAmerican”.each do |help|
if ($doingNext = nil || $doingNext = “SurfingForPr0n”)

BTW, this ^^^^^ if condition will always be true

Yes. Its a statement.

I do like some of the art on your site.

Thank you. It is there to be enjoyed by anyone with eyesight and access
to net. I hope you did enjoy the art and the site.

The actual art, though,
shouldn’t be copyrighted

Are you saying that artists are not entitled to the copyrights to their
own (unique) works? So in the same vein programmers, musicians or
screenwriters shouldn’t copyright their works? Nevermind, just get back
to the challenge.

Csmr

On Dec 18, 2007 10:24 AM, Rolando A. [email protected] wrote:

I’m starting to get bored with this thread, so, in an effort to stop
it, let’s see what casimir wrote with his 1337 ruby h4ck1ng abilities:

Yeah, I’m pretty much done with it too, but will chime in for kicks.

1 “RichFatNorthAmerican”.each do |help|
2 if ($doingNext = nil || $doingNext = “SurfingForPr0n”)

The guy/gal either doesn’t know what “if” is for or is simply saying
that any label such as “RichFatNorthAmerican” will never, ever donate
in an obfuscated way. Still, the use of globals I don’t get though,
except maybe for trying to make a statement, which csmr alluded to
earlier in the thread (forgive my run-on sentences).

12 else
13 $doingNext << " Check out One Laptop per Child Foundation, Invest your money and your time - OLPC Foundation
"
14 end
15 puts $doingNext

irb(main):001:0> puts " Check out
One Laptop per Child Foundation, Invest your money and your time - OLPC Foundation"

[snip excellent analysis from Rolando of code misbehavior]

regards,

Rolando A.
Phone: +56-9 97851962
My Amazon Wish List: Amazon.com

Finally, I’ll say to csmr, you either don’t know what you are doing or
you do and are polluting a list with a joke that doesn’t help kids
with free laptops who might want to learn Ruby.

I’ll get off the soapbox now.

Todd

I’m starting to get bored with this thread, so, in an effort to stop
it, let’s see what casimir wrote with his 1337 ruby h4ck1ng abilities:
Note: I’m only doing this because I’m bored, had a terrible night, and
casimir tried to run some pseudo-code before, not even realizing
someone was writing pseudo code. So, I’m going to analyze your code in
the same way (a nonsense operation to some nonsense code):

1 “RichFatNorthAmerican”.each do |help|
2 if ($doingNext = nil || $doingNext = “SurfingForPr0n”)
3 $donation = false
4 help << $doingNext.replace(“Help End Poverty!”)
5 end
6 end
7 #Disclaimer: Seems like a nice deal. In reality I have no idea
whut it is!
8 #do stuff
9 #…
10 if $donation == true
11 $doingNext.gsub!(“Help”, “Aww, relax mang! You already did Help”)
12 else
13 $doingNext << " Check out
http://laptopfoundation.org/participate/
"
14 end
15 puts $doingNext

1: what’s the point of doing “each” to a string?
2: this condition will always be true, remember, conditions should use
==, or === or some other operator that returns a boolean value, unless
you are testing for something else.
4: where’s help defined?
4: what are you replacing?. Here, doingNext is set to “Help End
Poverty!”
10: where do you set donation to true?, because you test in line 2 is
always a “true” value, donation is always set to false.
13: so far, and because the code above, this is always executed.
15: end of nonsense code.

What you wrote is similar to doing something like this:

if nil
here(some, ruby, code)
that(has, no, meaning) << but
with a {
valid syntax
}
end
puts “i’m so kewl with my h4x0r sk1lzz”

Hint for casimir: some times, in order to make a joke or something
similar, people write pseudo-code, that it’s not intended to be run,
and usually its written using the syntax of the language in question,
for instance, what Giles wrote:

people.each do |person|
person.help(end_poverty)
end

is much more valid than what you wrote.

ps: I will not reply to any of your responses in this thread. If you
want to say something, please mail me directly.
Let’s recycle some bits and stop the noise. Please let’s get back to
our regular schedule.

regards,

Its a tough crowd.

Too bad all of you three, Giles, Todd and Rolando are wrong in relation
to how well my code works, or whether some lines actually do anything.
Theres nothing useless or broken in it. I dont deny it could be “better”
ruby.

But none of you can offer nothing but trolling as you replied in
english, not in ruby. If its so bad, show me a better version. Bottom
line: Giles, Todd, Rolando: Put (sum ruby) up or shut up.

More details below:

Rolando A. kirjoitti:

1 “RichFatNorthAmerican”.each do |help|

1: what’s the point of doing “each” to a string?

Its a request…

4: where’s help defined?

On line 1, see above.

4 help << $doingNext.replace(“Help End Poverty!”)

4: what are you replacing?. Here, doingNext is set to “Help End
Poverty!”

Yes. And on line 2 its set to “SurfingForPr0n”. Which is whats replaced.

10: where do you set donation to true?, because you test in line 2 is
always a “true” value, donation is always set to false.

It might be set to true at “do stuff”. But you have to actually do that,
just reading some code wont make it so.

13: so far, and because the code above, this is always executed.

Unless donation is true.

15: end of nonsense code.

Whats nonsense to you is fun to me. Stop taking yourself and your
programs so damn seriously is what I always say.

Let’s recycle some bits and stop the noise. Please let’s get back to
our regular schedule.

On the usenet, no-one can hear you scream…

On Dec 18, 2007 1:06 PM, Todd B. [email protected] wrote:

irb(main):001:0> puts " Check out One Laptop per Child Foundation, Invest your money and your time - OLPC Foundation"

Oops, forgot the “Help end poverty part!”, but I think it’s alright to
do so, since laptops won’t end poverty.

Todd

Please avoid horribly ugly globals such as $doingNext when there are
more elegant solutions available.