Ruby T-Shirt Idea

Keywords: advocacy, silly t-shirts, Request For Feedback

Hello from Yet Another Newbie Ruby User,
I am not religious about languages, but have been really enjoying Ruby
and need a new T-shirt for around the office. So I thought I would
make one.

Picture this in bold red print on a white shirt

class RubyFan < OOProgrammer
include OpenSource
def initialize( name, talent )
super( name, talent )
# adjust for inherent Rubyness
@productivity = CodeFu.MASTER * talent
@stress_level = @stress_level / 2
@street_cred = true;
end
end

http://ruby-lang.org

any thoughts? Anything inherantly un-rubyish?

– Ozten

I like the idea of Ruby t-shirts, but your code snipet is rather long for
a t-shirt. It has to be quick and catchy. How about this:

a, b = b, a
Who needs temp variables?
http://www.ruby-lang.org

Cheers,
Daniel.

···

On Thu, Jul 10, 2003 at 07:35:51AM +0900, Austin King wrote:

Keywords: advocacy, silly t-shirts, Request For Feedback

Hello from Yet Another Newbie Ruby User,
I am not religious about languages, but have been really enjoying Ruby
and need a new T-shirt for around the office. So I thought I would
make one.

Picture this in bold red print on a white shirt

class RubyFan < OOProgrammer
include OpenSource
def initialize( name, talent )
super( name, talent )

adjust for inherent Rubyness

@productivity = CodeFu.MASTER * talent
@stress_level = @stress_level / 2
@street_cred = true;
end
end

http://ruby-lang.org

any thoughts? Anything inherantly un-rubyish?

– Ozten


Daniel Carrera | OpenPGP fingerprint:
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html

Note that the semicolon isn’t needed.

Regards,

Brian.

···

On Thu, Jul 10, 2003 at 07:35:51AM +0900, Austin King wrote:

class RubyFan < OOProgrammer
include OpenSource
def initialize( name, talent )
super( name, talent )

adjust for inherent Rubyness

@productivity = CodeFu.MASTER * talent
@stress_level = @stress_level / 2
@street_cred = true;
end
end

That’s good. I came up with the following:

class Ruby < Scripting_Languages
include Perl
include Python
end

Ian

···

On Thu 10 Jul 2003 at 07:35:51 +0900, Austin King wrote:

Keywords: advocacy, silly t-shirts, Request For Feedback

Hello from Yet Another Newbie Ruby User,
I am not religious about languages, but have been really enjoying Ruby
and need a new T-shirt for around the office. So I thought I would
make one.

Picture this in bold red print on a white shirt

class RubyFan < OOProgrammer
include OpenSource
def initialize( name, talent )
super( name, talent )

adjust for inherent Rubyness

@productivity = CodeFu.MASTER * talent
@stress_level = @stress_level / 2
@street_cred = true;
end
end

http://ruby-lang.org

any thoughts? Anything inherantly un-rubyish?


Ian Macdonald | Kramer’s Law: You can never tell which way
System Administrator | the train went by looking at the tracks.
ian@caliban.org |
http://www.caliban.org |
>

5.times { puts ‘ruby r0x!’}

···

il Thu, 10 Jul 2003 07:40:13 +0900, Daniel Carrera dcarrera@math.umd.edu ha scritto::

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I like the idea of Ruby t-shirts, but your code snipet is rather long for
a t-shirt. It has to be quick and catchy. How about this:

a, b = b, a
Who needs temp variables?
http://www.ruby-lang.org

Daniel Carrera graced us by uttering:

I like the idea of Ruby t-shirts, but your code snipet is
rather long for a t-shirt. It has to be quick and catchy. How
about this:

a, b = b, a
Who needs temp variables?
http://www.ruby-lang.org

Perl and Python both do this. Python even uses the same syntax.

What can we use that demonstrates something that Ruby’s uniquely
useful for in 4 lines or less?

Tim Hammerquist

···


This text is protected by Double-ROT13 encryption.
Any attempt to decode this text is a violation of the DMCA/WIPO acts.

“Please, keep your language clean” (seen on freenode#ruby-lang :slight_smile:

– fxn

···

On Thursday 10 July 2003 01:16, gabriele renzi wrote:

il Thu, 10 Jul 2003 07:40:13 +0900, Daniel Carrera > > dcarrera@math.umd.edu ha scritto::

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I like the idea of Ruby t-shirts, but your code snipet is rather
long for a t-shirt. It has to be quick and catchy. How about
this:

a, b = b, a
Who needs temp variables?
http://www.ruby-lang.org

5.times { puts ‘ruby r0x!’}

Gabriele suggested “4.times { puts ‘Ruby rocks!’ }”. I like it.


Daniel Carrera | OpenPGP fingerprint:
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html

···

On Thu, Jul 10, 2003 at 09:57:35AM +0900, Tim Hammerquist wrote:

Daniel Carrera graced us by uttering:

I like the idea of Ruby t-shirts, but your code snipet is
rather long for a t-shirt. It has to be quick and catchy. How
about this:

a, b = b, a
Who needs temp variables?
http://www.ruby-lang.org

Perl and Python both do this. Python even uses the same syntax.

What can we use that demonstrates something that Ruby’s uniquely
useful for in 4 lines or less?

Daniel Carrera graced us by uttering:

I like the idea of Ruby t-shirts, but your code snipet is
rather long for a t-shirt. It has to be quick and catchy. How
about this:

a, b = b, a
Who needs temp variables?
http://www.ruby-lang.org

Perl and Python both do this. Python even uses the same syntax.

What can we use that demonstrates something that Ruby’s uniquely
useful for in 4 lines or less?

Hmm, there’s the classic “grep in four lines.” Can’t recall
exactly how it looks – I think it used a perlism that I’m
not used to.

Tim Hammerquist

This text is protected by Double-ROT13 encryption.
Any attempt to decode this text is a violation of the DMCA/WIPO acts.

lol… guess we’re all in violation, eh? Hmm, wouldn’t
Double-rot13 be rot26? Or rot0?

Hal

···

----- Original Message -----
From: “Tim Hammerquist” tim@vegeta.ath.cx
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Wednesday, July 09, 2003 7:57 PM
Subject: Re: Ruby T-Shirt Idea


Hal Fulton
hal9000@hypermetrics.com

Saluton!

  • gabriele renzi; 2003-07-10, 12:56 UTC:

5.times { puts ‘ruby r0x!’}

puts ruby.rocks
true

Gis,

Josef ‘Jupp’ Schugt

···


N’attribuez jamais à la malice ce que l’incompétence explique !
– Napoléon

Doesn’t sound that hard. Could someone remind me how to use the File.eachline method? (I
know I’ve gotten it at least partially wrong there).

Or could someone give me a link to PickAxe so I can look it up?

Thanks.


Daniel Carrera | OpenPGP fingerprint:
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html

···

On Thu, Jul 10, 2003 at 12:38:10PM +0900, Hal E. Fulton wrote:

Hmm, there’s the classic “grep in four lines.” Can’t recall
exactly how it looks – I think it used a perlism that I’m
not used to.

I just thought of a dead give-away:

dcarrera ~ $ cat myfile
cat
dog
horse
zebra
tiger
dcarrera ~ $ grep a myfile
cat
zebra
dcarrera ~ $ ruby -e ‘puts ARGF.grep(/a/)’ myfile
cat
zebra

Cheers,


Daniel Carrera | OpenPGP fingerprint:
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html

···

On Thu, Jul 10, 2003 at 12:38:10PM +0900, Hal E. Fulton wrote:

Hmm, there’s the classic “grep in four lines.” Can’t recall
exactly how it looks – I think it used a perlism that I’m
not used to.

What about

require ‘English’
re = ARGV.shift
$DEFAULT_INPUT.each{|x| puts x if x =~ /#{re}/}

??

It’s two lines if you use ‘$<’…

···

On Thu, Jul 10, 2003 at 12:38:10PM +0900, Hal E. Fulton wrote:

What can we use that demonstrates something that Ruby’s uniquely
useful for in 4 lines or less?

Hmm, there’s the classic “grep in four lines.” Can’t recall
exactly how it looks – I think it used a perlism that I’m
not used to.


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Linux: because a PC is a terrible thing to waste
– ksh@cis.ufl.edu put this on Tshirts in '93

=> true

:slight_smile:

···

il Thu, 10 Jul 2003 12:38:10 +0900, “Hal E. Fulton” hal9000@hypermetrics.com ha scritto::

lol… guess we’re all in violation, eh? Hmm, wouldn’t
Double-rot13 be rot26? Or rot0?

x.rot13.rot13

Hal E. Fulton graced us by uttering:

···

Tim Hammerquist tim@vegeta.ath.cx wrote:


This text is protected by Double-ROT13 encryption.
Any attempt to decode this text is a violation of the DMCA/WIPO acts.

lol… guess we’re all in violation, eh? Hmm, wouldn’t
Double-rot13 be rot26? Or rot0?

Actually, it’s rot52, but that’s just because I’m working with a
poker game at the moment. If we apply the same naming scheme as
the DES algorithm, it would be 2rot13, IIRC.

I don’t think it matters much, really. Next to the DMCA,
everything else sounds educated.

Tim Hammerquist

I do die sometimes, but I am doing well.
– Hyatt, “Excel Saga”

Here’s my humble and slightly obscure variation:

class Symbol
def method_missing(verb=‘rocks’, *other_words)
puts [ self.to_s, verb, other_words ].join(’ ')
end
end

:Programming.should(‘be’, ‘fun’)
:Ruby.rules %w[the world of scripting]

Ian

···

On Thu 10 Jul 2003 at 10:00:29 +0900, Daniel Carrera wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Jul 10, 2003 at 09:57:35AM +0900, Tim Hammerquist wrote:

Daniel Carrera graced us by uttering:

What can we use that demonstrates something that Ruby’s uniquely
useful for in 4 lines or less?

Gabriele suggested “4.times { puts ‘Ruby rocks!’ }”. I like it.


Ian Macdonald | Quantum Mechanics is God’s version of
System Administrator | “Trust me.”
ian@caliban.org |
http://www.caliban.org |
>

I’ve always thought that would make an excellent slogan :slight_smile:

Ruby - keep your language clean!

www.ruby-lang.org

If we’re going for unusual ruby features, I think open classes are the
most interesting. “Ruby - open source, open classes!”

martin

···

Xavier Noria fxn@hashref.com wrote:

“Please, keep your language clean” (seen on freenode#ruby-lang :slight_smile:

Okay, ignore my last question (except the one about a link to PicAxe). I just figured the
syntax (basically by trying every possible permutation).

Now I have a new question: Turning a string into a regex.
Example:

dcarrera ~ $ irb

var = “he”
=> “he”
str = “hello world”
=> “hello world”
str =~ /var/
=> nil

What am I doing wrong?

···

On Thu, Jul 10, 2003 at 02:16:15PM +0900, Daniel Carrera wrote:

On Thu, Jul 10, 2003 at 12:38:10PM +0900, Hal E. Fulton wrote:

Hmm, there’s the classic “grep in four lines.” Can’t recall
exactly how it looks – I think it used a perlism that I’m
not used to.

Doesn’t sound that hard. Could someone remind me how to use the File.eachline method? (I
know I’ve gotten it at least partially wrong there).

Or could someone give me a link to PickAxe so I can look it up?

Thanks.

Daniel Carrera | OpenPGP fingerprint:
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html


Daniel Carrera | OpenPGP fingerprint:
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html

Quite right.

The part I can’t remember was one of those
“implicit loop” things that I never use…

BTW, var = Regexp.new(Regexp.escape(var)) will
also do that conversion… probably more than
two ways… :wink:

As for interpolating a variable into a regex,
I’m not sure whether it does automatic escaping
or not. I’d like to think it does, but there
may be some good reason it doesn’t. Too lazy to
test right now…

Hal

···

----- Original Message -----
From: “Daniel Carrera” dcarrera@math.umd.edu
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Thursday, July 10, 2003 12:27 AM
Subject: Re: Ruby T-Shirt Idea

I just thought of a dead give-away:

dcarrera ~ $ cat myfile
cat
dog
horse
zebra
tiger
dcarrera ~ $ grep a myfile
cat
zebra
dcarrera ~ $ ruby -e ‘puts ARGF.grep(/a/)’ myfile
cat
zebra


Hal Fulton
hal9000@hypermetrics.com

Did you see mine? It was one line! (with a semicolon though :slight_smile:


Daniel Carrera | OpenPGP fingerprint:
Graduate TA, Math Dept | 6643 8C8B 3522 66CB D16C D779 2FDD 7DAC 9AF7 7A88
UMD (301) 405-5137 | http://www.math.umd.edu/~dcarrera/pgp.html

···

On Thu, Jul 10, 2003 at 02:47:16PM +0900, Mauricio Fernández wrote:

What about

require ‘English’
re = ARGV.shift
$DEFAULT_INPUT.each{|x| puts x if x =~ /#{re}/}

??

It’s two lines if you use ‘$<’…