Possible RubyQuiz idea

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

On 4/3/06, Hal F. [email protected] 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

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

On 4/3/06, Hal F. [email protected] 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

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

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

On 4/4/06, [email protected] [email protected] 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

On 4/4/06, [email protected] [email protected] 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.

On 4/4/06 9:48 AM, “[email protected][email protected] 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/

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

On 4/4/06, [email protected] [email protected] 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

On Apr 4, 2006, at 9:48 AM, [email protected] wrote:

Cron? Tchoh.

Martin

too bad launchd isn’t written in ruby

[email protected] 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

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

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

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

On 4/11/06, M. Edward (Ed) Borasky [email protected] 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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs