I would like to compare 25+ different coding (same programming language, if possible Java but other languages are fine too) implementations of the same homework. Where can I find such homework solution datasets?
-
Cool question . – philshem♦ Mar 29 '14 at 0:49
-
Thanks, but the difficulty of obtaining such data set says long on the lack of data sharing culture in academia (+ privacy hampering research)... I am hoping some MOOC will release interesting data sets at some point, although they are fighting with lawyers right now (not sure how actively though). – Franck Dernoncourt Mar 29 '14 at 4:23
-
Does it have to be homework specifically? You could put together a 'code challenge' and post it CodeGolf.SE – Joe Mar 31 '14 at 1:49
-
Any homework is good, but simple homework is better (say < 200 SLOC). I fear golfing around might produce some weird code :) and also I'm interested in commonalities between solutions while SE golf solutions try to not overlap too much. I have just made my that that request PL-independent to broaden the search. – Franck Dernoncourt Mar 31 '14 at 2:10
-
Are you looking for datasets? – Ulrich Apr 4 '14 at 9:43
Including to other answers, here is one that may help to create a database.
Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.
As the about section said, project Euler is a collection of many mathematical problems and users try to solve them one by one with programming languages. Unfortunately, there isn't a limitation on the programming language you have to use. But if someone track them and collect only those that want, it would create a nice database.
-
I don't know if Project Euler shares their participants' code, but many are hosting on GitHub: github.com/… – philshem♦ Apr 2 '14 at 8:26
-
They don't have an api to share them, but when I am logged in, I can see the forum with all the answers. – Tasos Apr 2 '14 at 8:33
-
1
Note: I've been thinking about this question since it was asked because I think doing text analysis on human-typed computer programming langauges is a very novel idea. I don't think this answer is spot-on, but I hope that it starts the discussion and gets us to a better answer.
The idea
- GitHub is the source of many programming codes these days, in addition to other resources (data sets, code snippets, writing, team projects, etc).
- Many courses and contests require or suggest posting code to GitHub. For that reason, you have many implementations of the same "homework" or assignment.
Option 1:
Kaggle is a predictive modeling and analytics competition (contest) platform with many projects and 95,000 participants (source).
Participants may post their code submissions to GitHub.
Steps:
Visit GitHub and search "kaggle" - direct link
The left menu bar has a breakdown by programming language. Kaggle is heavy with R and Python. The popularity of Java with data-science people is decreasing (more info here). Or maybe it is just Java in general - N-grams link, indeed.com job trends.
So let's choose Python from the filter - search results.
One recent contest was a handwritten digit recognizer. 36 Python results for searching "kaggle digit" and 30 "kaggle digits" on GitHub. Here is a random example of code.
You can see contests have the largest turnout, and then create GitHub searches for those in particular. After some digging you may find one that is Java-centric.
These repositories can be easily and openly be obtained. If you aren't familiar with Git, you can download all the code, or use their API to search and collect code that meets your criterea. Here is the documentation about API search.
Option 2:
- Similar to above, but for MOOCs from places like Coursera instead of Kaggle.
- These online courses often encourage or require posting code to GitHub.
- One example: 173 Java results with tons of Java code for a course called "Programming Mobile Applications for Android Handheld Systems" - GitHub search results.
- With deeper searching you can find tons of code for identical project descriptions.
Option 3:
- Other contests: e.g. here or here
- For example...
Rosetta Code might help you in your task :
Rosetta Code is a programming chrestomathy site. The idea is to present solutions to the same task in as many different languages as possible, to demonstrate how languages are similar and different, and to aid a person with a grounding in one approach to a problem in learning another. Rosetta Code currently has 711 tasks, 131 draft tasks, and is aware of 530 languages, though we do not (and cannot) have solutions to every task in every language.
You can find all the programming tasks on the relevant page and on the page with candidates.
-
1Thanks but for a given problem each solution is written in a different different language. +1 though as it might be useful someday! – Franck Dernoncourt Mar 31 '14 at 14:04
-