1. Dan 55 Silver badge

    Ah, just like real projects

    What do you mean you weren't told you should have started on the 28th of June?

    Is it also possible to request a language that is less noddy than Java, VB, Swift, C'Dent, Node, PHP, or Python?

    1. richardcox13
      Boffin

      Re: Ah, just like real projects

      > Is it also possible to request a language that is less noddy

      Indeed, what's wrong with Ook, a Befunge, or – perhaps best – whitespace?

    2. Adam 1 Silver badge

      Re: Ah, just like real projects

      How about TrumpScript?

      1. Prst. V.Jeltz Silver badge

        Re: Ah, just like real projects

        I was gonna do i batch file , just for novelty , and to make it 100 times more comlicated and ugly code , but if cmd not in the list and will be ignored maybe its a little too much effort for a joke no one will hear

    3. Anonymous Coward
      Anonymous Coward

      Re: Ah, just like real projects

      Why use something "less noddy" ... all the specified languages are overkill as I managaed to do it in 30 lines of awk.

  2. CrashM

    Something wrong with C#?

    1. Law

      That was my thought... clearly VB is considered retro enough to be cool again?!

  3. JimmyPage Silver badge
    Boffin

    Language ...

    My first thought was T-SQL ...

    1. Ian Michael Gumby Silver badge
      Boffin

      @JimmyPage Re: Language ...

      SQL ... yes you can do it. However it would be pretty slow and you would need a SQL engine ... (Isn't that outside of the rules ? )

      However, it would be trivial to do in Scala.

      Which means its trivial in Java or C too.

      Seriously... is this a contest to stretch your skills or for college kids?

  4. Anonymous Coward
    Thumb Up

    My entry

    I can supply more codes if needed.

    <!doctype html>

    <html lang="en">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <base href="http://www.theregister.co.uk/"> <title>The Reg Coding competition – 10 times as hard as the last one! • The Register Forums</title>

    <link rel=alternate type="application/atom+xml" href="http://forums.theregister.co.uk/feed/forum/2016/07/13/the_reg_coding_competition_10_times_as_hard_as_the_last_one/" title="Posts in this topic">

    <link rel=stylesheet href="http://www.theregister.co.uk/style_picker/forums?a"> <script>

    var RegArticle={id:179309,pf:0,af:0,bms:0,cat:'news',ec:[],kw:[['competition','Competition'],['coding','Coding']],short_url:'http://reg.cx/2mN3',cp:1,noads:[],ads:['ibmcds16-11753'],author:'David Gordon',vid:0}

    </script>

    <style type="text/css">#forums-nav-link { font-weight: bold }</style>

    <link rel=stylesheet type="text/css" href="/style_picker/design?ca">

    <style>

    #sec-none a,

    #sub-sec-none a {

    font-weight: bold;

    }

    </style>

    <link rel=alternate type="application/atom+xml" href="/headlines.atom" title="The Register: whole site">

    <script src="/Design/javascript/_.js?ca"></script>

    <script>var RegEditWindowMins = 10;</script> </head>

  5. Anonymous Coward
    Anonymous Coward

    Seriously...

    ...no real languages to choose from there... and 60 seconds!!!

    I would fail anything that took more that 1second.... is this the state of programming in 2016 !

    1. Little Mouse

      Re: Seriously...

      But this might be a chance to put the infamous "Bubble-sort" algorithm that we were forced to learn decades ago to some practical use(!?)

      That said, even on today's kit it still might take more than 60 seconds...

      1. boltar Silver badge

        Re: Seriously...

        The IT director here who knows how to code in C (badly and has no formal dev training , hes a stats guy) actually used a bubble sort in the original code for this place. it took around 5 mins to sort 50K keys! I swapped it out for a shell sort (couldn't use standard qsort() function for reasons I wont bore you with and didnt have time to roll my own) which brought the sort time down to 0.3 secs.

        Other wonders of his original code included 3000 lines functions, the entire program in one 20K file, next to no comments, fixed sized char[] arrays (with some nice overflow bugs) using "if (0)" instead of #ifdefs and single letter variable and array names everywhere.

        Never let non coders near an editor or compiler!

        1. Jason Bloomberg Silver badge
          Paris Hilton

          Re: Seriously...

          [i]Never let non coders near an editor or compiler![/i]

          I have to admit, back in the days when a 286 with 4MB was the best one had, I had to convert a huge stock database with new part codes and a new format, each entry a line of text. Had it all done bar sorting it and that was proving a challenge at the time. Up popped a sales droid, who imported it into Excel which had it sorted and done before I even blinked.

    2. fajensen Silver badge

      Re: Seriously...

      I does say "on the judges' computer" - This *could* be a vintage 80486SX machine with 320 K of RAM and Win-XP, left open to the internet for 24 hours before the evaluation.

    3. 2+2=5 Silver badge

      Re: Seriously...

      > I would fail anything that took more that 1second.... is this the state of programming in 2016 !

      Since there is no mention of an upper limit on the number of datasets, I'm sure I could produce an input file that would cause your entry to either crash or take longer than 1 sec. ;-)

      1. Anonymous Coward
        Anonymous Coward

        Re: Seriously...

        ", I'm sure I could produce an input file that would cause your entry to either crash or take longer than 1 sec. ;-)"

        ...why would it crash? Are you assuming it would be written by an idiot!

    4. Munchausen's proxy
      Pint

      Re: Seriously...

      "is this the state of programming in 2016 !"

      The state of programming in 2016 is that you should allocate at least 58.5 seconds to initialize the JVM, load the python interpreter, load the GUI framework libraries, establish a connection to the local MySQL server (and start the server if this is the first execution), then display a splash screen, load libraries from 8 different remote repositories, and display the first banner ad.

      Hello, world.

      1. Dan 55 Silver badge

        Re: Seriously...

        I hope there's no need to left pad "Hello, world" or your program's screwed before it's started.

  6. fajensen Silver badge
    IT Angle

    This sounds totally too easy, I don't get it!

    Two months to rip out *one* Python program with stdio and some "trixy" formatting rules?

    How much work is this going to be, really? Is there only one question - "The Question"?. Or is it one per week, day, hour, phase o' the moon? The "Time Limit" paragraph hints at "Questions"?!

    1. haiku

      Re: This sounds totally too easy, I don't get it!

      How much work is this going to be, really? Is there only one question - "The Question"?. Or is it one per week, day, hour, phase o' the moon? The "Time Limit" paragraph hints at "Questions"?!"

      Exactly my first thought.

      Then I realised that the actual challenge was in fact more life-like: make sense of an ambiguous specification ... !

  7. boltar Silver badge

    They want a serious coding competition yet no C or C++?

    But they allow PHP and VB where "lashing something together" is the modus operandi!? Wtf?? And what the hell is C'Dent??

    1. Warm Braw Silver badge

      Re: They want a serious coding competition yet no C or C++?

      And what the hell is C'Dent??

      It's a distraction for those with too much time on their hands.

      1. boltar Silver badge

        Re: They want a serious coding competition yet no C or C++?

        "It's a distraction for those with too much time on their hands."

        Looks like another "seemed like a good idea at the time" which will soon disappear when the students writing it get bored and move on to something else. I honestly can't imagine man people bothering to spend the time learning it given if they're into cross platform programming they probably already know Java or Python and will simply use them directly. And if they're webdevs they won't even understand the concept of cross compilers.

    2. Anonymous Coward
      Anonymous Coward

      Re: They want a serious coding competition yet no C or C++?

      Having read through the problem then looked to me like about 10mins work with sed/awk/sort/etc

      1. Warm Braw Silver badge

        Re: They want a serious coding competition yet no C or C++?

        looked to me like about 10mins work

        That's presumably why they don't let you see the data beforehand. I would imagine there are cases where T>B (for example) and where the precision of T is such that careless floating-point arithmetic will result in the wrong value when rounded down. I'm sure there's more beneath the surface - including the fact that there is no information about the size of the dataset, which could be enormous.

        1. John70

          Re: They want a serious coding competition yet no C or C++?

          It looks like they want script kiddies to have a chance at winning and not just have the competition open to proper programmers.

          1. boltar Silver badge

            Re: They want a serious coding competition yet no C or C++?

            "It looks like they want script kiddies to have a chance at winning and not just have the competition open to proper programmers."

            I think its safe to assume each dataset can fit in and be sorted in memory. If part of the problem is to do external sorting in files then thats exponentially harder! However there's nothing that suggests that.

      2. boltar Silver badge

        Re: They want a serious coding competition yet no C or C++?

        "Having read through the problem then looked to me like about 10mins work with sed/awk/sort/etc"

        Getting sort to sort each dataset individually just via a pipe from awk or sed could be ... interesting. I suppose you could process each dataset in awk then use system() to shell out to sort but that starts to get messy pretty quickly.

    3. Indolent Wretch

      Re: They want a serious coding competition yet no C or C++?

      Surely that's the point. They don't want code just lashed together but allow languages that some would say actively encourage it. Makes the judging a lot easier.

  8. adnim Silver badge
    Facepalm

    ...consideration to proper design?

    Self taught, not sure what proper design is. My fail I guess.

    Note: none of my code has been exploited yet but I suspect that is due to the obscurity of the sites on which it is being run rather than my coding skill.

    Procedural PHP 49 lines.

    OO PHP 110 lines.

    I notice the sample data file has been corrected.

    Should I enter? Perhaps I should search "PHP proper design considerations" before I submit my Stack Exchange copy/paste solution.

  9. This post has been deleted by a moderator

  10. euant

    10 times as hard as the last one!

    God knows how easy the last one was then! I imagine a child could have completed it.

  11. Tom 7 Silver badge

    Is this an extension of yesterdays IBM article

    I'm not opening a console for the prizes on offer.

  12. bpfh

    Some of the specs a missing...

    - Is the data file supplied on the command line or will it be present in the same folder as the script?

    - What is the file encoding of the input and output file? ASCII? ANSI? UTF-x? EBCDIC?

    - What end of line marker can be expcted? \n \r\n ?

    - Reagan & REAGAN are the same person? Can we expect a unique key of 1 name per event?

    1. f-den
      Thumb Down

      Re: Some of the specs a missing...

      Doesn't mention Python 2 or Python 3, or which standard libraries can be used. Python 3 IS the real language of course.

    2. jzl

      Re: Some of the specs a missing...

      - Reagan & REAGAN are the same person? Can we expect a unique key of 1 name per event?

      Yes. Human names are the same even if they're in capitals. Do you really need a spec to know that?

      1. Dan 55 Silver badge

        Re: Some of the specs a missing...

        Yes. Human names are the same even if they're in capitals. Do you really need a spec to know that?

        * For some Western European languages using the Latin alphabet. Possibly.

    3. jzl

      Re: Some of the specs a missing...

      The art of programming is modelling a problem in a computer in a useful way.

      The problem is almost always ambiguous and much of the skill comes in your ability to cope with the ambiguity and use your best interpretation to deal with it. Presumably this is part of the test.

    4. Uplink

      Re: Some of the specs a missing...

      From your set of questions, it's only output EOL that I cannot deduce with total accuracy...

      > Is the data file supplied on the command line or will it be present in the same folder as the script?

      "[...] read its input from a file called Decathlon.dat and send its input to a file called Decathlon.out."

      That looks like "files in the same directory" with the given hardcoded names.

      Additionally: "Your program must produce no screen output."

      > What is the file encoding of the input and output file? ASCII? ANSI? UTF-x? EBCDIC?

      I'd go with ASCII encoding ("letters", "hyphenated"), but UTF-8 would probably work with my code too, as I wouldn't care about what non-space bytes they separate by spaces and tabs. And then the numbers are all in the 7-bit part of ASCII. Who uses ANSI and EBCDIC with Node, Java or Python anyway? That means they're not even options.

      > What end of line marker can be expcted? \n \r\n ?

      For input I'd just assume \n and treat \r as "whitespace", because the specs allow for trailing whitespace. For output... that's a tricky one, given that "extraneous output will cause an automatic failure".

      I'd go with \n for output only because except VB all the others can run on non-Windows platforms (Linux, BSD, Mac) and produce \n EOLs in those environments. They're promoting cloudiness, and they mainly run Linux in there... I also just realised that Swift is Mac-only, so... \n it is then.

      > Reagan & REAGAN are the same person? Can we expect a unique key of 1 name per event?

      "Names and event abbreviations must be treated as case-insensitive"

      "You may assume that there will be no more than one entry in each data set for a given event for a given competitor, and that there will not be more than one competitor with the same name."

      That being said... the terms and conditions say "[...] the fastest and most accurate code"... so you if submit something in Python you're guaranteed to not win anything since Java and Swift will just smoke you. Node is fast, but still way behind Java and Swift.

  13. Blipvert

    Go on....

    With all the other commentards complaining that its too easy why don't you 'diss' them all, El Reg, and give the Alienware rig to me?

    Have i mentioned that The Register is brilliant? Well you are, aren't you.

  14. John70

    VB

    Which VB is it? Is it VB for Applications, VB Script, VB 6, VB.NET ?

    1. Prst. V.Jeltz Silver badge

      Re: VB

      good question, I wanna know if VBscript is ok

      its a subset of VB isnt it?

  15. Rich 2

    Language????

    Errrr C or C++ ?

    Because neither of these are used at all in the real world are they?

    And WTF are Swift, C'Dent and Node? Oh and you forgot Twat

    Clearly a competition that only the cool kids (ie those that don't actually work on anything real or important) can enter

  16. David Nash Silver badge

    C'Dent

    Nothing to do with Arthur Dent as far as I can see, unfortunately.

    From the Website:

    "C'Dent is a new Acmeist programming language for writing portable modules. It is based on the computer programming principle known as H.O.P.E. (Hack Once, Please Everyone)"

    Hmmmm. Hack Once sounds quite a bit like lashing together.

  17. caffeine addict Silver badge

    Wow, we are a load of language snobs, aren't we?

    1. richardcox13

      > Wow, we are a load of language snobs, aren't we?

      Not really, not (until now) a single mention on Clojure, OCAML, Haskell, …

    2. zb

      What about BASIC?

  18. jzl

    I'd love to enter

    But this competition looks like bait for Shoreditch wannabe developers (or "hackers" as they seem to want to be known).

    Where are C or even C#? What kind of coding competition goes to the effort of having a choice of languages, but leaves out the biggest ones?

    Also, frankly, the question is trivial. But I guess it's good to get the kids interested in software.

  19. nijam

    I had a Perl one-liner a few years back that did scoring for tetrathlons, but obviously you don't want to know about that.

  20. SteveK

    Doesn't say what the judging criteria are, other than if it fails to produce the right output it gets disqualified. Which of the entries wins: shortest code, quickest runtime, fewest uses of the letter 'i'?

    Or is it just pick a winner out of a hat?

    1. Adam 1 Silver badge

      Ah, all of those criteria are mapped to a particular activity like 100m or hurdles or javelin. The programs can then score and rank themselves to find the winner.

  21. adnim Silver badge
    Devil

    A real challenge would be

    names and scores to be read from a file of any common use document or image file format such as

    odt, ods, doc, docx, pdf, rtf, xml, html, png, jpg or gif.

    However I would expect more than a Facebook controlled toy and a gaming system as a reward

  22. John Ellin
    FAIL

    Managed C++/CLI

    I'm upset. It's bad enough that C++ has been left out, but as I'm now being forced to wrap loads of legacy C++ APIs in ".NET friendly wrappers" (small amount of vomit in back of throat), I think it would be appropriate to include C++/CLI as well as C++.

    1. Anonymous Coward
      Anonymous Coward

      Re: Managed C++/CLI

      I don't think the limited languages should be an issue.

      If you've been programming long enough to be any good at C++, then you should be able to knock up a solution for each of these languages.

      1. Christian Berger Silver badge

        Re: Managed C++/CLI

        Actually what I've seen with many people who claim to be good at C++ is that they usually are extremely closed minded and try to stuff everything into what they know.

        Also all programming environments have their strengths and weaknesses. For example PHP is good for teaching about SQL-Injections. C++ is good for writing books about and giving lessons.

        In practice you must choose the tools that make sense for the problem you are trying to attack. Limiting yourself to some currently "fashionable" language, like this contest does, is a bad idea.

  23. JeffyPoooh Silver badge
    Pint

    Don't forget the fun that 'backspace stuffing' can enable...

    Use a routine to stuff your source code text with backspaces, ^h (ASCII 08 IIRC).

    Done correctly in conjunction with same line comments, your apparent source code can appear to do one thing, while actually doing something else when executed.

    The scope for mischief is essentially unlimited. One can literally do anything.

    1. JeffyPoooh Silver badge
      Pint

      Re: Don't forget the fun that 'backspace stuffing' can enable...

      More details, copied from an older post.

      Within many environments, the user display will dutifully obey the backspace character (ASCII 8), even embedded within the script or code. So by packing in some ASCII backspaces (using a routine to replace a placeholder character with ASCII 8), actual code can be hidden 'beneath' the backspaces, and decorative fake code can be displayed (after a hidden REM).

      A BASIC example (from ~33 years ago):

      10 PRINT "Yes!"; REM ^h^h^h^h^h^h^h^h^h^h^h "No!"

      LIST

      10 PRINT "No!"

      RUN

      Yes!

      By this means, what is apparently listed and what is actual hidden code can be perfectly independent. The only clue might be the file size, if they're paying attention and counting characters.

      Any environment that obeys the backspace is vulnerable to this mischief.

  24. Christian Berger Silver badge

    The provided tools are non-suitable for the task

    I mean after all those are all "fancy" OOP languages where people spend 90% of their time learning the new feature that doesn't quite solve the problem they think they have.

    The obvious solution on any modern unixoid system is to write a little program, lets say in awk to calculate the scores and write them to a temporary file. If you encounter a #, you close that file, run "sort" over it and format the output. Then you reopen that temporary file and on you go.

    Since processing one "dataset" surely takes _much_ less than 5 seconds, it's unlikely your resulting file will ever touch the disk.

    If the number of lines per "dataset" is small and bounded, you can also store them in RAM, for example in a statically allocated array of structs, with a smaller array containing the order in which it'll be after sorting.

    We live in a world where such problems can be attacked with extremely simple means. For example such a sporting competition might have 2000 contestants with 24 contests. That's 48000 results. Having a 2 dimensional array containing the points is trivial. Even with 128 bit numbers, we are still well below a megabyte. There is no need for a database, you can just write a file and replace it every time a new result comes in.

  25. dvhh

    Could not reproduce example solution

    wrote a solution in C ( for giggle s) and can not reproduce one of the result. second part of the example. I either entered the wrong parameters or something is amiss.

    By the way the htc vice is more fun.

  26. cford

    ...and the winner is?

    Was the winner of the comp ever announced? I entered but got absolutely nothing back...

    1. JudeKay (Written by Reg staff)

      Re: ...and the winner is?

      Hi cford. We ran the announcement on September 21, here - http://www.theregister.co.uk/2016/09/21/programming_competition_roundup/

This topic is closed for new posts.

Biting the hand that feeds IT © 1998–2019