Open Side Menu Go to the Top
Register
Any interest in a Project Euler Group? Any interest in a Project Euler Group?

04-21-2011 , 01:34 AM
Since we have study groups for nearly everything else on here, would there be any interest in starting a group to work through the project Euler problem set?

Would probably want a fairly relaxed pace, at least to start.

Thoughts, interest?

Beat: Site is currently down.
Any interest in a Project Euler Group? Quote
04-21-2011 , 09:48 AM
I've been telling myself forever that I'm going to work through these. Count me in.
Any interest in a Project Euler Group? Quote
04-21-2011 , 10:04 AM
Ye, this looks kinda fun. Would be quite easy to setup if we coordinate using some sort of version control. I would be happy to host it on my github account.
Any interest in a Project Euler Group? Quote
04-21-2011 , 10:12 AM
If we're going to be collaborating did we all want to do it using a single language? Could be a good opportunity to help some learn to program / learn a new language.
Any interest in a Project Euler Group? Quote
04-21-2011 , 10:29 AM
How about putting a poll in this thread?

IMO options would be:
  • C
  • Java
  • Python
  • C++
  • JavaScript
  • Others?

I know JavaScript might seem a bit out of place, but using NodeJS, this would be quite possible, and its quite a good language for mathematical problems. Just thought I would throw that curveball in there.
Any interest in a Project Euler Group? Quote
04-21-2011 , 10:36 AM
I think thats a pretty solid list for it, come to think of it we could choose multiple languages and put them in subdirectories in the version control. I dunno, I'm game for anything, any imperative language anyway.
Any interest in a Project Euler Group? Quote
04-21-2011 , 11:10 AM
Quote:
Originally Posted by diab0lic
I think thats a pretty solid list for it, come to think of it we could choose multiple languages and put them in subdirectories in the version control. I dunno, I'm game for anything, any imperative language anyway.
I think it will be better if we stick to a single language if we are going to collaborate on it... otherwise we will just be duplicating code in various languages rather than trying to solve the problems...
Any interest in a Project Euler Group? Quote
04-21-2011 , 11:19 AM
Yeah I think you're right. In that case shall we run a poll with that list?
Any interest in a Project Euler Group? Quote
04-21-2011 , 11:20 AM
Yeah... hopefully OP will add a poll.... OP?
Any interest in a Project Euler Group? Quote
04-21-2011 , 01:21 PM
Hmm.. I'd be inclined to allow folks to do whatever language they like, or perhaps the stipulation you can't use the same language two weeks in a row?

Some of the easier problems I'd like to tackle in a language I'm weaker in / have no chance to write anything interesting/significant in. Erlang for instance, I've read the book, and played with toy code, but never had to figure out anything "hard".

Some ideas:
- We host somewhere common (thanks Wooster)
- We figure out a rough schedule
- Setup a thread / site to keep track of progress.
- Do walk thrus of our solutions
- Have some sort of shared unit test arrangement, perhaps comparing performance?
Any interest in a Project Euler Group? Quote
04-21-2011 , 01:51 PM
Quote:
Originally Posted by Johnny Douglas
Some of the easier problems I'd like to tackle in a language I'm weaker in / have no chance to write anything interesting/significant in. Erlang for instance, I've read the book, and played with toy code, but never had to figure out anything "hard".
Erlang crossed my mind too when thinking about implementing them in a language that would put me outside my comfort zone for some learning.
Any interest in a Project Euler Group? Quote
04-21-2011 , 01:53 PM
No Haskell?
Any interest in a Project Euler Group? Quote
04-21-2011 , 01:59 PM
Quote:
Originally Posted by gaming_mouse
No Haskell?
Sure, the more the merrier!

Any interest in a Project Euler Group? Quote
04-21-2011 , 04:23 PM
Ok... how about something along these lines:

Starting with the more easy problems, we pick one to all have a go at, and choose (vote?) on the language to use. Depending on the complexity of the problem, it will be open for 1/2/3 weeks.

During those 1/2/3 weeks, anyone is free to work on it in the chosen language.

Solutions should be submitted to a git repository (I think that best way to do this would be that I set up a repo on github that contains a folder for each problem, which in turn contains folders for each users solution).

Once the time is up, each solution is benchmarked, and the fastest solution wins ($$$ prizes?).

The next problem is then chosen and the process repeats itself...

Thoughts?
Any interest in a Project Euler Group? Quote
04-21-2011 , 05:40 PM
This looks good. I like us choosing a language for everyone, as it'll really help to learn the guts of certain languages.

Perhaps once we select the current problem, we can do a vote where we select the language, as some could end up being more or less relevant for selected problems.
Any interest in a Project Euler Group? Quote
04-21-2011 , 09:49 PM
I'm interested.

Perhaps we all solve in all languages and vote on a start language? The problem set is useful for iteratively exploring a language, and can (i assume) highlight the strengths and weaknesses of a language.

/lang/problem/user/ layout perhaps?
Any interest in a Project Euler Group? Quote
04-21-2011 , 11:10 PM
knowing nothing about Project Euler, I'm gonna guess an interesting thing about people re-implementing solutions using different language it that's a handy thing to see if you're wondering about one of the other languages.

Similarly though if everyone is working in the same language there's a great chance most participants will learn something new about that language anyway seeing different solutions.

The "fastest solution gets prizes" might be problematic for "slower language", if everyone is in the same language that obv isn't an issue.
Any interest in a Project Euler Group? Quote
04-21-2011 , 11:47 PM
Quote:
Originally Posted by _dave_

The "fastest solution gets prizes" might be problematic for "slower language", if everyone is in the same language that obv isn't an issue.
yeah, I think this is going to be problematic in general, particularly with recent developments that make it hard to move money around.
Any interest in a Project Euler Group? Quote
04-22-2011 , 12:28 AM
Quote:
Originally Posted by Johnny Douglas
yeah, I think this is going to be problematic in general, particularly with recent developments that make it hard to move money around.
i think good old fashioned ego will be the motivator here. some sort of leaderboard is all you need.
Any interest in a Project Euler Group? Quote
04-22-2011 , 03:32 AM
Code:
#include <stdio.h>

int main( void )
{
	printf( "642\n" );
	return 0;
}
PROBLEM 1 SOLVED IN RECORD EXECUTION TIME, BITCHES
Any interest in a Project Euler Group? Quote
04-22-2011 , 04:10 AM
Quote:
Originally Posted by sorrow
I'm interested.

Perhaps we all solve in all languages and vote on a start language? The problem set is useful for iteratively exploring a language, and can (i assume) highlight the strengths and weaknesses of a language.

/lang/problem/user/ layout perhaps?
My vote would still be to choose a different language for each problem and everyone solve the problem in only that language... otherwise we will be spending time duplicating our same code into several languages

Quote:
Originally Posted by _dave_
The "fastest solution gets prizes" might be problematic for "slower language", if everyone is in the same language that obv isn't an issue.
Ye... this is also a strong point for all choosing the same language.

As far as benchmarking the scripts go, i think it would be quite easy to write a small shell script that executes and times all the scripts for the given problem. This means that everyone can run all the scripts locally to confirm which one is fastest. Everyone will have different hardware so the scripts will run at different speeds for different people, but the relative speeds of all the scripts should be the same for everyone.

Also, I agree with gaming_mouse... ego prizes will be better than $$$ to start with.
Any interest in a Project Euler Group? Quote
04-22-2011 , 07:43 AM
I'm on this site for quite some time, so in!

Last edited by wellju; 04-22-2011 at 07:45 AM. Reason: would vote C / C++ obviously
Any interest in a Project Euler Group? Quote
04-22-2011 , 08:36 AM
Ok, I have had another idea.

Did anyone take part in the Google AI challenge?

The way it worked was that you would write your script and upload it to their site. Their servers would then run your script.

The main advantages of this are:
  • No one else will be able to see your code until the submission deadline is over (this would not be the case with github)
  • There would be running stats of who currently has the fastest program for the current problem
  • The upload procedure would be much simpler

This is potentially getting into the realms of over complicating things, but I dont think it would be too much effort to set it up (again, I would be happy to host it on my server).

Lets assume the first problem is written in C. For the purposes of simplicity, I think each program should profile itself. Although this would allow people to potentially cheat by not profiling correctly, it would be very easy to check that the winning solution is profiled correctly.

So... you write your program in C, and its only output should be a) the solution, and b) the time in milliseconds that it took to reach the solution.

You name the program problem1.c, zip it into a folder (2p2username.zip), browser to the server url (2p2euler.example.com) and upload it to the server.

The server unzips, compiles and runs the code, expecting the two outputs. If the code compiles and runs successfully, it is entered into the database.

Browsing to 2p2euler.example.com/problem1 will show a table of the current rankings for that week

2p2user1 - time
2p2user2 - time2
etc..

After the submission deadline, the person at the top of the table wins.

This would require a small amount of setup, but I dont think it would be more than a few hours work.

The big advantage of this method is that you can constantly see what time you need to beat to win that problem.

Thoughts?
Any interest in a Project Euler Group? Quote
04-22-2011 , 08:49 AM
Spoiler:
Code:
; Linux ldo

section .text
  global _start

section .data
message db  '642',0xa
length equ $ - msg

section .text
_start:
  mov edx,length 
  mov ecx,message
  mov ebx,1 
  mov eax,4
  int 0x80

; GG, BBL

  mov ebx,0
  mov eax,1
  int 0x80


Edit: I guess goofy beat me to it :P
Any interest in a Project Euler Group? Quote
04-22-2011 , 09:26 AM
This is a great idea. I will attempt to participate, although my history with Project Euler is that I just don't have a strong enough background in math to do them well.
Any interest in a Project Euler Group? Quote

      
m