Ask a Question related to Ruby, Design and Development.
-
Jim Weirich #1
Line Noise (was Punctuation as noise)
On Wed, 2003-08-20 at 13:49, Hal E. Fulton wrote:
Hal Fulton wrote:
I did something like this a while back when a Java programmer complained> I cranked out a quick bit of ugly code (see
> below). Obviously it's crude -- e.g., it doesn't
> take note of strings or comments (and it's not
> clear what it should do if it did).
about all that "line noise" in Ruby. I pointed out that Java used much
more puncuation than the typical Ruby program and wrote the following
program to demonstrate...
#!/usr/bin/env ruby
ARGV.each { |fn|
noise = open(fn) { |file| file.read }.gsub(/[A-Za-z0-9_ \t\n]/m, "")
puts "#{fn} (#{noise.size}): #{noise}"
}
Runnnig this over a set of programs written in different languages
gives...
animal.cc (83):
#<>{
)=;};:{
);};:
){::<<"\";}:{
);};:
){::<<"\";}(){*[]={,};(=;<;++)[]->();;}
Animal.java (67):
{{();}{(){..("");}}{(){..("");}}([]){[]=[]{(),()};(=;<.;++)[].();}}
animal.pl (41): ;{{};}{"\";};{{};}{"\";};$(->,->){$->();}
animal.py (23):
):""
):""[(),()]:.()
animal.rb (10): """"[.,.].
Onestepback.org is down at the moment, but I'll post the code for all
the animal programs there when it comes back online.
--
-- Jim Weirich [email]jweirich@one.net[/email] [url]http://onestepback.org[/url]
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
Jim Weirich Guest
-
no add noise???
Is there nowhere you can add noise to a gradient - or an object? Is this a crazy ommision? Would it be that hard to implement? Getho -
Punctuation as noise
> I have noticed an odd effect already, though. The In my scrpts directory, I have a half dozen each very small ruby and perl scripts. For the... -
Ultra 30 noise
I know there's been a fair bit of comment on this in the past so apologies for raking over old ground. Usual story: I have a U30, it's quite noisy,... -
E-20 noise
Todd Walker <twalker294@hotmail.com> wrote in message news:MPG.1976ab0ab7f6cf5098a31b@news-server.jam.rr.com... using I would still be curious... -
E-250 noise
Hi, First I say, the english isn't my mother language, and my grammar is awful, I know. Excuse me, please. I want to buy a second hand E-250...



Reply With Quote

