Forum: Ruby Possible RubyQuiz idea

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Hal F. (Guest)
on 2006-04-04 05:48
(Received via mailing list)
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
Austin Z. (Guest)
on 2006-04-04 08:07
(Received via mailing list)
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
unknown (Guest)
on 2006-04-04 08:10
(Received via mailing list)
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
Robert D. (Guest)
on 2006-04-04 15:32
(Received via mailing list)
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
James G. (Guest)
on 2006-04-04 17:38
(Received via mailing list)
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.  :D

James Edward G. II
unknown (Guest)
on 2006-04-04 17:51
(Received via mailing list)
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.  :D

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
Zed S. (Guest)
on 2006-04-04 18:03
(Received via mailing list)
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://www.zedshaw.com/
http://mongrel.rubyforge.org/
pat eyler (Guest)
on 2006-04-04 18:28
(Received via mailing list)
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.
unknown (Guest)
on 2006-04-04 18:46
(Received via mailing list)
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
Robert D. (Guest)
on 2006-04-04 18:58
(Received via mailing list)
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 ;)

--
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
Hal F. (Guest)
on 2006-04-05 07:59
(Received via mailing list)
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
Logan C. (Guest)
on 2006-04-05 10:46
(Received via mailing list)
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
M. Edward (Ed) Borasky (Guest)
on 2006-04-11 18:24
(Received via mailing list)
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
James G. (Guest)
on 2006-04-11 18:27
(Received via mailing list)
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
James G. (Guest)
on 2006-04-11 18:30
(Received via mailing list)
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.  ;)

James Edward G. II
M. Edward (Ed) Borasky (Guest)
on 2006-04-11 18:49
(Received via mailing list)
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...

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

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Dimitri A. (Guest)
on 2006-04-11 18:58
(Received via mailing list)
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.
:)

- Dimitri
This topic is locked and can not be replied to.