CUBRID it! Programming ContestJune 1st – 22nd 2011
What is this contest all about?
CUBRID it! is an online programming contest which requires finding and coding the best solution for a SQL related problem we will be proposing.
This programming contest is organized by the CUBRID Open Source community once every year.
This year the contest will be held between June 1st and June 22nd.
CUBRID it! is open to all talented developers who are willing to challenge their skills and compare themselves to other passionate developers from all around the world.
In the end, it’s all about coding and having fun, together with other CUBRID fans!
To participate in the contest, you must be at least 18 years old. The contest is open to both individuals and teams. Participants must agree that the code they submit will have one of the following open source licenses attached: GPL or BSD. If not specified explicitly, a GPL v2 license will be assumed by default.
If you are selected as a contest winner, you agree that we may publicize your name or your user id, and the description of work you did for the contest.
How is the contest organized?
The participants will use their own resources ( computers ) to code the solution, using either PHP or JAVA. When the code is ready, all it is required to do is to upload it to our website ( we will provide an easy to use upload mechanism ). The code will be tested using a CUBRID 8.3.1 installation, Java 6.x and PHP 5.3.x.
The winners will be selected by a jury which will judge based on the below criteria:
- Correctness of the solution
- Efficiency of the solution
More precisely, this is how the points will be granted (there are max. 100 points that can be granted to each participant):
- 0-80 points for the correctness of the solution
- 0-5 points for the performance ( execution speed )
- 0-5 points for the coding quality, including code documentation
- 0-5 points if the code works fine also in CUBRID 8.4.0 beta!
- 0-5 points for your feedback, suggestions; we would like to hear back from you, including your ideas regarding the next year contest :)
The contest problem can be found here.
Remember, you can only submit your code until June 22nd, 2011, 12 AM GMT using the form below:
Don't upload multiple files, make an archive containing all your source files and add a descriptive readme.txt if you feel it is necesarry.
You can also submit your solution via mail at contact [at] cubrid.org, just mention "CUBRID it!" in the subject of your mail.
The contest winners will be announced on www.cubrid.org and will be notified via e-mail/twitter, by July 1st 2011.
We have great prizes for you! The 10 participants, who will score the highest, will get the following prizes:
- 1st place - Apple iPad 2
- 2nd and 3rd place - Amazon Kindle
- 4th and 5th place - Nikon Coolpix S3100 Digital Camera
- 6th to 10th place - Amazon 50$ gift certificates
The prizes will be delivered directly to your address!
Contest & Community
If you would like to discuss ideas, give feedback and discuss anything related to this contest, please use the CUBRID it! forum.
You can also contact us by email, at firstname.lastname@example.org .
Don’t hesitate to ask us if you need help understanding and solving the problem – we are more than happy to help!
Along with the main programming contest there will be another contest, for those who want to contribute spreading the word about this contest! In other words, you get the chance to win twice!
It will be up to you to choose to participate in both competitions or in only one of them - there are no restrictions.
How to contribute?
- Post on your blog about the contest or about CUBRID overall
- Tweet on Twitter
- Post on your Facebook wall or groups
- Let you friends know about the contest through forums, and so on…
If you decide to write something, let us know the URL of the resource your post and you may win one of the following great prizes:
- 1 Apple iPod
- 2 Amazon gift certificate ( 100$ )
- 5 Amazon gift certificate ( 50$ )
By retweeting the official CUBRID it! start message you are automatically enrolled in the lottery for one of the above prizes. You retweet it by clicking or you can check out the original message here.
Given all the tables in a database (but only the user tables, not also the system tables), determine:
- The value which occurs the most times (is duplicated the most times) in the database and it is “non-numeric”! (“non-numeric” means that the respective value does not contain only digits – it must contain at least one non-digit character; for example, “1298” is “numeric”, but “12,98” is “non-numeric” ( and also “12.98” ), because it contains the “,” character ; same goes for “-100” – it is considered “non-numeric” as well, because of the “-” sign).
- The number of occurrences for the value found above.
- Assume that the result to the problem is unique; there are no multiple values with the same maximum number of occurrences – just one single value is the most duplicated.
- If a table column data type is not a string-type, then consider the respective values in the column as casted to “string”; this means that you should deal only with string or string-converted/casted values when doing the analysis. When converting a data type to string, assume that no extra characters will be added (for example, a number converted to string, no matter the system locale or regional settings, will not “get” thousands separators )
- The tables in the database contain only columns of the following data types: VARCHAR, CHAR, STRING, INT, SMALLINT, BIGINT, NUMERIC, FLOAT, DOUBLE, DATE, TIME, DATETIME and TIMESTAMP.
- The maximum length of any of the table column values, converted to string, is 255.
- There are no restrictions on the memory used, however we will grant points for the memory usage solution efficiency.
- It is allowed to create new tables/objects in the database, with the condition of deleting them when the program ends.
- The database name where the program is executed is “contest”; the username is “public”; the password is empty. But you don’t need to do anything - the template code we are providing will take care of the connection to the database with the correct parameters.
The output results must be stored by you in a table named “results”, which has the following structure:
Column Data type userid VARCHAR(64) most_duplicated_value VARCHAR(255) total_occurrences INTEGER execution_time INTEGER
You don’t need to create this table in your submitted code – it will be already created in the database where we will test your code.
But you will need to populate it! You must:
- Set the “userid” to you own user
- Set the “most_duplicated_value” and the “total_occurrences” to the results you found
- Do not populate the “execution_time” column – the template code we provide will do this automatically.
For Windows users that use Eclipse to code their solution we have prepared an all in one archive that contains everything you need. You can download it from here.
In order to help you get started on your coding we prepared some startup files. If you choose to code the solution in PHP you can download the files from here ( PDO ) or here ( PHP API ). If you choose Java you can get the files from here.
In the three tables below, the “non-numeric” value which occurs the most times is “xyz” (9 times).
Here is the script to create the ”results” table in your own development database, so you can properly test your code before you submit it:
CREATE TABLE "results"( "userid" varchar(64) NOT NULL, "most_duplicated_value" varchar(255) NOT NULL, "total_occurrences" integer, "execution_time" integer, CONSTRAINT pk_results_userid_most_duplicated_value PRIMARY KEY("userid","most_duplicated_value") );
In order to code the solution for the proposed problem you will need to have CUBRID 8.3.1 installed and a Java or PHP distribution (or both, if you plan on submitting solutions in both Java and PHP). Depending on your OS, please choose the appropriate CUBRID version from the ones below.
|OS||CUBRID 8.3.1||OS Requirements||CPU|
|Windows 32bit||CUBRID-Windows-x86-188.8.131.522.exe||* Windows XP Home 32bit
* Windows XP Pro
* Windows 2003
* Windows Vista 32bit
* Intel EM64T
|Windows 64bit||CUBRID-Windows-x64-184.108.40.2062.exe||* Windows Vista 64bit||* Intel EM64T
|Linux 32bit||CUBRID-8.3.1.0173-linux.i386.sh||* Over CentOS 4
* Over Fedora 4
* Over Ubuntu 6.10
* Over openSUSE 11
* Over Gentoo 2007
* Over Asianux 2
* Over Debian 4
* Intel EM64T
|Linux 64bit||CUBRID-220.127.116.113-linux.x86_64.sh||* Over CentOS 4
* Fedora 11
* Ubuntu 9.04
|* Intel EM64T
If you choose to code in PHP, you will need to have the appropriate CUBRID PHP driver installed. You can use the PHP Driver or even the CUBRID PDO Driver – it is up to you to decide which ones fit your better.
As for the CUBRID Jdbc driver, it is automatically installed along with the CUBRID distribution, in the jdbc folder.
To make things easier, we will provide startup code templates, for both Java and PHP.
If you have questions or things to clarify about the tools or libraries to use, don’t worry, just let us know and will help.
Be a real CUBRID fan!
One thing you can do, for example, is to support our efforts by posting a small article/banner on your website or blog and let everyone know about the CUBRID it! contest.
CUBRID it! banner embeddable code ( 240px Width, 150px height )
CUBRID it! banner embeddable code ( 200px Width, 125px height )
CUBRID it! banner embeddable code ( 160px Width, 100px height )
We will highly appreciate every your effort to let other users know about CUBRID – a high performance open source database which is a best choice whenever you need one! Thank you!
On behalf of CUBRID open source database project we are proud to announce the fifth community competition with prizes worth the challenge. The...
Greatings to everyone!
This is how we are going to call our new environment (CUBRID Quizland), the virtual space where you can challenge yourself with database related quizz...