POV-Ray : Newsgroups : povray.off-topic : Project Euler Server Time
11 Oct 2024 09:17:49 EDT (-0400)
  Project Euler (Message 42 to 51 of 51)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Mueen Nawaz
Subject: Re: Project Euler metadiscussion
Date: 30 Nov 2007 20:42:33
Message: <4750bc09@news.povray.org>
Invisible wrote:
>>> Well, for "find the millionth prime number" or something, there's not
>>> much to check. But when the problem is "sum all the primes below 1
>>> million", it might be nice to know, for example, how many primes there
>>> are. (Or rather, be able to ask "are there 722 primes?" and get a yes/no
>>> answer.)
>>
>>     That'd make it easier to solve, though.
> 
> Well yes - but do you have any idea how frustrating it is to spend hours
> trying to make your program work when you don't even know what part is
> broken? Knowing which part is broken doesn't tell you how to fix it, it
> just tells you which part needs fixing...

	I don't see it being an issue for this problem.

	Write a program that sums all primes below n. You can test it for n=100
by hand. Unless you're using a weird algorithm, it should work for any
n, unless you have overflow, which I suspect you don't worry about in
Haskell, anyway.

	There's a reason most problems come with at least one example: To test
your code. It helps, but do you realize how difficult it is to implement
what you're asking? How is the site owner supposed to guess what
questions are useful for you?

> (Also, a number of questions give insufficient detail to figure out what
> the correct answer is.)

	Can you give me an example? I haven't come across any thus far.

> I've asked many times. Nobody ever recommends anything.

	Well, Scott's friend recommended one. Looks fine, but I'll point out
that the $4.99/mo is only for the first year. I already said I use
Dreamhost. You have to pay a year in advance, but they give you over 90
days to cancel.

	My recommendation about features (I actually have many, but this is
often overlooked): Make sure they provide you SSH/Telnet access.
Midnight Commander installed would be a bonus (must for me).

> (I hate Perl, and PHP would probably be the same. I'd probably want to
> do my CGI scripting in Haskell - and by the looks of it, the only way to
> do *that* is to go for a virtual server package rather than a simple web
> hosting package. That's A LOT of extra complexity, and it's expensive.)

	You may want to try Django (Python) or Ruby on Rails. In which case
make sure the hosting company allows it (as opposed to "supporting" it).

	I don't want to code PHP either. However, having a webserver allows me
to install PHP web software (gallery, blog, wiki, CMS, and much more).
Which I use very frequently.

> [BTW, I find it interesting that all hosting packages offer MySQL or SQL
> Server, but none offer PostgreSQL...]

	Some do. A number of web software you may want to install may still
require MySQL, though.

>>     That's sort of the point. Take Problem 43:
> 
> Actually I didn't - mainly because I don't know what "pandigital" means.

	Google it.

	They actually explain it (albeit poorly) in the first problem they use it.

> Personally, I find that as you come up with better algorithms it gets
> *easier* to code, not harder. ;-) Maybe that's just because I use
> Haskell... The Mathematica solutions are similarly easy.

	For me, that happens after more thought. Initially any advanced idea I
come up with after a first attempt is ugly. Then I abstract a little and
it gets nicer.


-- 
As a child my family's menu consisted of two choices: "Take it, or leave
it."


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Invisible
Subject: Re: Project Euler metadiscussion
Date: 3 Dec 2007 04:50:59
Message: <4753d183$1@news.povray.org>
Mueen Nawaz wrote:

>> (Also, a number of questions give insufficient detail to figure out what
>> the correct answer is.)
> 
> 	Can you give me an example? I haven't come across any thus far.

6 is not an amicable number because it's only amciable with itself. This 
was not made clear anywhere, and it took an absurd amount of time to 
figure out why my working program was producing the "wrong" answer.

There were several others like that... I don't remember which now.

> 	My recommendation about features (I actually have many, but this is
> often overlooked): Make sure they provide you SSH/Telnet access.
> Midnight Commander installed would be a bonus (must for me).

I wouldn't use Telnet if you paid me. SSH though... (And presumably SSH 
means you can use SFTP too? I wonder if there are tools to synchronise 
folders over SFTP...)

>> Personally, I find that as you come up with better algorithms it gets
>> *easier* to code, not harder. ;-) Maybe that's just because I use
>> Haskell... The Mathematica solutions are similarly easy.
> 
> 	For me, that happens after more thought. Initially any advanced idea I
> come up with after a first attempt is ugly. Then I abstract a little and
> it gets nicer.

...or that, yes. ;-)


Post a reply to this message

From: scott
Subject: Re: Project Euler metadiscussion
Date: 3 Dec 2007 09:16:36
Message: <47540fc4$1@news.povray.org>
> 6 is not an amicable number because it's only amciable with itself. This 
> was not made clear anywhere,

Ermm, it says in the question that:

If d(a) = b and d(b) = a, where a (doesn't equal) b, then a and b are an 
amicable pair and each of a and b are called amicable numbers.

Seems pretty clear that 6 is not an amicable number to me...


Post a reply to this message

From: Invisible
Subject: Re: Project Euler metadiscussion
Date: 3 Dec 2007 09:36:16
Message: <47541460$1@news.povray.org>
scott wrote:
>> 6 is not an amicable number because it's only amciable with itself. 
>> This was not made clear anywhere,
> 
> Ermm, it says in the question that:
> 
> If d(a) = b and d(b) = a, where a (doesn't equal) b, then a and b are an 
> amicable pair and each of a and b are called amicable numbers.
> 
> Seems pretty clear that 6 is not an amicable number to me...

Interesting. I don't remember that being there... (And the comments in 
the forum indicated that I wasn't the only person to get this wrong.) 
Maybe they changed it or something...


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Project Euler metadiscussion
Date: 3 Dec 2007 20:46:38
Message: <4754b17e$1@news.povray.org>
Invisible wrote:
> I wouldn't use Telnet if you paid me. SSH though... (And presumably SSH
> means you can use SFTP too? I wonder if there are tools to synchronise
> folders over SFTP...)

	Yes, generally SSH implies SFTP.

	And I'd be surprised if you can't synchronize using SFTP. I don't
really do that, though - I just use Subversion (which they provide...).

	You don't HAVE to use SSH - but I think if you can use UNIX, you should
get it - much easier editing files that way.

-- 
Do Not Attempt to Traverse a Chasm in Two Leaps...


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Orchid XP v7
Subject: Re: Project Euler metadiscussion
Date: 4 Dec 2007 13:40:41
Message: <47559f29@news.povray.org>
Mueen Nawaz wrote:
> Invisible wrote:
>> I wouldn't use Telnet if you paid me. SSH though... (And presumably SSH
>> means you can use SFTP too? I wonder if there are tools to synchronise
>> folders over SFTP...)
> 
> 	Yes, generally SSH implies SFTP.
> 
> 	And I'd be surprised if you can't synchronize using SFTP. I don't
> really do that, though - I just use Subversion (which they provide...).
> 
> 	You don't HAVE to use SSH - but I think if you can use UNIX, you should
> get it - much easier editing files that way.

Most of my HTML is machine-generated. ;-)


Post a reply to this message

From: Warp
Subject: Re: Project Euler metadiscussion
Date: 4 Dec 2007 14:55:18
Message: <4755b0a6@news.povray.org>
Mueen Nawaz <m.n### [at] ieeeorg> wrote:
>         And I'd be surprised if you can't synchronize using SFTP.

  I think the most common tool for synchronization (if we don't go to
versioning systems) in unix is rsync. It can copy files using ssh, so it
should be as secure.

-- 
                                                          - Warp


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Project Euler metadiscussion
Date: 4 Dec 2007 19:28:24
Message: <4755f0a8@news.povray.org>
Invisible wrote:
...
> I wouldn't use Telnet if you paid me. SSH though... (And presumably SSH
> means you can use SFTP too? I wonder if there are tools to synchronise
> folders over SFTP...)
...

I think that should be possible with sshfs and rsync:

http://en.wikipedia.org/wiki/SSHFS
http://en.wikipedia.org/wiki/Rsync

-- 
Tor Olav
http://subcube.com


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Project Euler metadiscussion
Date: 7 Dec 2007 12:35:00
Message: <web.47598367c1cfe1938d41112e0@news.povray.org>
Tor Olav Kristensen <tor### [at] TOBEREMOVEDgmailcom> wrote:
> Invisible wrote:
> ...
> > I wouldn't use Telnet if you paid me. SSH though... (And presumably SSH
> > means you can use SFTP too? I wonder if there are tools to synchronise
> > folders over SFTP...)
> ...
>
> I think that should be possible with sshfs and rsync:

It seems that ssh and rsync are sufficient.

"rsync Tips & Tricks":
http://sial.org/howto/rsync/

"Using rsync over ssh":
http://www.oreilly.com/pub/h/38

rsync manual:
http://samba.anu.edu.au/ftp/rsync/rsync.html

Here's an excerpt from that manual:

"Once installed, you can use rsync to any machine that you can
access via a remote shell (as well as some that you can access
using the rsync daemon-mode protocol). For remote transfers, a
modern rsync uses ssh for its communications, but it may have
been configured to use a different remote shell by default,
such as rsh or remsh.

You can also specify any remote shell you like, either by
using the -e command line option, or by setting the RSYNC_RSH
environment variable.

Note that rsync must be installed on both the source and
destination machines."

--
Tor Olav
http://subcube.com


Post a reply to this message

From: Invisible
Subject: Re: Project Euler metadiscussion
Date: 13 Dec 2007 05:55:59
Message: <47610fbf$1@news.povray.org>
Damnit, this Project Euler metadiscussion isn't even a metadiscussion 
about Project Euler! o_O


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.