Possible RubyQuiz idea


#1

This might be too easy, it’s JEG2’s call.

Read in an ordinary crontab file and print out a list of
jobs that will run in the next N minutes.

Just a thought.

Cheers,
Hal


#2

On 4/3/06, Hal F. removed_email_address@domain.invalid wrote:

This might be too easy, it’s JEG2’s call.

Read in an ordinary crontab file and print out a list of
jobs that will run in the next N minutes.

Fairly easy, but with some interesting edge cases (t + N crossing an
hour, day, month, or year boundary; dealing with leap years; dealing
with summer time/winter time switches).

-austin


#3

On Tue, 4 Apr 2006, Austin Z. wrote:

On 4/3/06, Hal F. removed_email_address@domain.invalid wrote:

This might be too easy, it’s JEG2’s call.

Read in an ordinary crontab file and print out a list of
jobs that will run in the next N minutes.

Fairly easy, but with some interesting edge cases (t + N crossing an
hour, day, month, or year boundary; dealing with leap years; dealing
with summer time/winter time switches).

not to mention cron supports variables, ranges, wildcards, and lists!

-a


#4

On Apr 4, 2006, at 6:30 AM, Robert D. wrote:

Rewriting cron in ruby

Call me crazy, but that one sounds like fun to me. :smiley:

James Edward G. II


#5

On Tue, Apr 04, 2006 at 10:36:24PM +0900, James Edward G. II wrote:

On Apr 4, 2006, at 6:30 AM, Robert D. wrote:

Rewriting cron in ruby

Call me crazy, but that one sounds like fun to me. :smiley:

You should aim high, and think “bigger than cron”.

Create one convention-over-configuration Ruby program with Needles that
can replace crond, atd, init, supervise, inetd and anything else that
starts a program ever; make it supports port-proxying, lazy loading of
services, signal handling, session-handling and automatic dependency
discovery. Then you’re talking.

Cron? Tchoh.

Martin


#6

On 4/4/06, removed_email_address@domain.invalid removed_email_address@domain.invalid wrote:

hour, day, month, or year boundary; dealing with leap years; dealing

Rewriting cron in ruby


Deux choses sont infinies : l’univers et la bêtise humaine ; en ce qui
concerne l’univers, je n’en ai pas acquis la certitude absolue.

  • Albert Einstein

#7

On 4/4/06, removed_email_address@domain.invalid removed_email_address@domain.invalid wrote:

can replace crond, atd, init, supervise, inetd and anything else that
starts a program ever; make it supports port-proxying, lazy loading of services,
signal handling, session-handling and automatic dependency discovery.
Then you’re talking.

Spend some time looking at CFEngine and CFRuby/libcf if you choose to
go down this path.


#8

On 4/4/06 9:48 AM, “removed_email_address@domain.invalid” removed_email_address@domain.invalid wrote:

can replace crond, atd, init, supervise, inetd and anything else that
starts a program ever; make it supports port-proxying, lazy loading of
services, signal handling, session-handling and automatic dependency
discovery. Then you’re talking.

Cron? Tchoh.

Then watch as people gleefully hack into the newly started
RubyCronolithOfTheGods.

Could be fun though.

Zed A. Shaw


http://mongrel.rubyforge.org/


#9

On Tue, Apr 04, 2006 at 11:25:06PM +0900, pat eyler wrote:

Create one convention-over-configuration Ruby program with Needles that
can replace crond, atd, init, supervise, inetd and anything else that
starts a program ever; make it supports port-proxying, lazy loading of services,
signal handling, session-handling and automatic dependency discovery.
Then you’re talking.

Spend some time looking at CFEngine and CFRuby/libcf if you choose to
go down this path.

Ooh, this looks interesting.

Martin


#10

On 4/4/06, removed_email_address@domain.invalid removed_email_address@domain.invalid wrote:

Create one convention-over-configuration Ruby program with Needles that
can replace crond, atd, init, supervise, inetd and anything else that
starts a program ever; make it supports port-proxying, lazy loading of
services, signal handling, session-handling and automatic dependency
discovery. Then you’re talking.

Cron? Tchoh.

Martin

Do not touch!!! This belongs to Hurd :wink:


Deux choses sont infinies : l’univers et la bêtise humaine ; en ce qui
concerne l’univers, je n’en ai pas acquis la certitude absolue.

  • Albert Einstein

#11

On Apr 4, 2006, at 9:48 AM, removed_email_address@domain.invalid wrote:

Cron? Tchoh.

Martin

too bad launchd isn’t written in ruby


#12

removed_email_address@domain.invalid wrote:

Fairly easy, but with some interesting edge cases (t + N crossing an
hour, day, month, or year boundary; dealing with leap years; dealing
with summer time/winter time switches).

not to mention cron supports variables, ranges, wildcards, and lists!

Yes, it’s ranges, wildcards, and lists that make it interesting
to me, not the edge cases. As for variables, I’m not sure what
you mean.

One reason I mention this idea is that I have had a practical need
for it on several occasions and have never got around to writing
such a tool.

Hal


#13

On Apr 11, 2006, at 9:21 AM, M. Edward (Ed) Borasky wrote:

Given a rectangular matrix, compute its singular value decomposition.

If I am expected to run this as a quiz, I need to see a write-up that
decodes the above line enough that dummies like me could understand
it…

James Edward G. II


#14

OK … here’s my nomination for a RubyQuiz challenge. I’ve posted a
couple of hints, but I’m pretty sure there could be at least 15 unique
solutions.

Given a rectangular matrix, compute its singular value decomposition.

Now, there are a lot of variants just on the problem specification
alone, such as whether the matrix is sparse or dense, whether it fits in
real memory or not and whether you need all of the singular values and
vectors. And there are a lot of variants on the solution methods –
“pure Ruby” or interfacing to an existing C library, etc.

So let’s say “pure Ruby” – no external software in any language. And
let’s specify the most general case – a large sparse “out of core”
solver. The algorithms are in

http://www.netlib.org/tennessee/ut-cs-93-194.ps

The challenge then becomes to create the most efficient implementation
in pure Ruby. So … hacking Ruby itself is allowed, as is hacking
and/or “developing” the virtual machine or swapping in a new one.

Hal F. wrote:


M. Edward (Ed) Borasky

http://linuxcapacityplanning.com


#15

On Apr 11, 2006, at 9:21 AM, M. Edward (Ed) Borasky wrote:

The challenge then becomes to create the most efficient
implementation in pure Ruby. So … hacking Ruby itself is
allowed, as is hacking and/or “developing” the virtual machine or
swapping in a new one.

Also, “hacking Ruby itself” is pretty far beyond the scope of what I
aim for with Ruby Q… We want problems that people can easily
squeeze in. :wink:

James Edward G. II


#16

On 4/11/06, M. Edward (Ed) Borasky removed_email_address@domain.invalid wrote:

for some ideas. Forth is the ultimate “virtual machine” :).

I thought that was Inferno…

Not to detract from Forth, of course. I wonder what a RubyVM
implementation in Forth would look like… or Limbo, for that matter.
:slight_smile:

  • Dimitri

#17

M. Edward (Ed) Borasky wrote:

The challenge then becomes to create the most efficient
implementation in pure Ruby. So … hacking Ruby itself is allowed,
as is hacking and/or “developing” the virtual machine or swapping in a
new one.
Speaking of hacking virtual machines, the GForth project features some
cool hacks using features of GCC that might be of some use to Ruby
implementers. See

http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Engine.html#Engine

for some ideas. Forth is the ultimate “virtual machine” :).


M. Edward (Ed) Borasky

http://linuxcapacityplanning.com