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.
C1bcb559f87f356698cfad9f6d630235?d=identicon&s=25 Hal Fulton (Guest)
on 2006-04-04 03: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
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-04-04 06:07
(Received via mailing list)
On 4/3/06, Hal Fulton <hal9000@hypermetrics.com> 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
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2006-04-04 06:10
(Received via mailing list)
On Tue, 4 Apr 2006, Austin Ziegler wrote:

> On 4/3/06, Hal Fulton <hal9000@hypermetrics.com> 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
703fbc991fd63e0e1db54dca9ea31b53?d=identicon&s=25 Robert Dober (Guest)
on 2006-04-04 13:32
(Received via mailing list)
On 4/4/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> 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
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-04-04 15:38
(Received via mailing list)
On Apr 4, 2006, at 6:30 AM, Robert Dober wrote:

> Rewriting cron in ruby

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

James Edward Gray II
D2ce3fc131413e4456054ea24efcca0e?d=identicon&s=25 unknown (Guest)
on 2006-04-04 15:51
(Received via mailing list)
On Tue, Apr 04, 2006 at 10:36:24PM +0900, James Edward Gray II wrote:
> On Apr 4, 2006, at 6:30 AM, Robert Dober 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
8c43ed7f065406bf171c0f3eb32cf615?d=identicon&s=25 Zed Shaw (Guest)
on 2006-04-04 16:03
(Received via mailing list)
On 4/4/06 9:48 AM, "azrael@cream.org" <azrael@cream.org> 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/
Bb6ecee0238ef2461bef3416722b35c5?d=identicon&s=25 pat eyler (Guest)
on 2006-04-04 16:28
(Received via mailing list)
On 4/4/06, azrael@cream.org <azrael@cream.org> 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.
D2ce3fc131413e4456054ea24efcca0e?d=identicon&s=25 unknown (Guest)
on 2006-04-04 16: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
703fbc991fd63e0e1db54dca9ea31b53?d=identicon&s=25 Robert Dober (Guest)
on 2006-04-04 16:58
(Received via mailing list)
On 4/4/06, azrael@cream.org <azrael@cream.org> 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
C1bcb559f87f356698cfad9f6d630235?d=identicon&s=25 Hal Fulton (Guest)
on 2006-04-05 05:59
(Received via mailing list)
ara.t.howard@noaa.gov 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
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-04-05 08:46
(Received via mailing list)
On Apr 4, 2006, at 9:48 AM, azrael@cream.org wrote:

>
> Cron? Tchoh.
>
> Martin
>

too bad launchd isn't written in ruby
3bb23e7770680ea44a2d79e6d10daaed?d=identicon&s=25 M. Edward (Ed) Borasky (Guest)
on 2006-04-11 16: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 Fulton wrote:
>
>
>

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-04-11 16: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 Gray II
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-04-11 16: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 Quiz.  We want problems that people can easily
squeeze in.  ;)

James Edward Gray II
3bb23e7770680ea44a2d79e6d10daaed?d=identicon&s=25 M. Edward (Ed) Borasky (Guest)
on 2006-04-11 16: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
801b207647d808477fc4514568c9d723?d=identicon&s=25 Dimitri Aivaliotis (Guest)
on 2006-04-11 16:58
(Received via mailing list)
On 4/11/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> 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.