Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 46

Thread: The Greplin Programming Challenge

  1. #21
    Senior Member
    Join Date
    Sep 2010
    Location
    Burnsville, Minnesota, United States
    Posts
    2,799
    Silicon valley is also a great show. This IS the best part of the first season, but it's all really good.

  2. #22
    Tiny Dancer Drewbie's Avatar
    Join Date
    Sep 2010
    Posts
    4,418
    I dunno. The "brought piss to a shit fight" scene is pretty damned good too.

  3. #23
    Darth Small Macheath's Avatar
    Join Date
    Sep 2010
    Posts
    15,125
    My last foray into this thread (which I've been treating as a "programming catch-all thread" for some reason) prompted me to look up the Greplin Programming Challenge again. It's gone. Which led me to look up other programming-puzzler type challenges, which led me to Project Euler. I made an account and have been working my way through some of the early problems. At the moment I'm on #19 out of over 500. This should keep me busy for a long, looong time.

    Avoid spoilers, if you attempt these! The site is actually really nicely organized, where inputting a correct answer unlocks an associated discussion thread for that question.

    At first, I was being all super-purist and implementing everything myself. I'm using Java, so that means I was avoiding any of the obvious niceties built into the language, sticking to primitives and so forth wherever possible... but once I got to #13 and solved it without resorting to BigInteger, I decided I'd paid my dues, and now I'm using everything from Jodd to Guava.

    I was also doing mostly "brute force" solutions at first, even though these are all math problems and there are surely simple formulaic solutions (that I don't know) for all of them. But #15 forced me to look up a mathematical formula, because the "brute force" implementation was taking forever to run. Now that I know the formula for that particular set permutation, I took my solution from like 20-30 lines down to about 4 (and it runs instantly).

    So now, like I said, I'm only on #19 at the moment, but I've already opened myself up to a lot of libraries and formulas, so I'm learning stuff! I'm building up quite a set of common utility functions of my own, too. This is a bunch of fun.

    Edit: The next few were pretty easy. I'm on #23 now.
    Last edited by Macheath; 06-12-2015 at 05:54 PM.

  4. #24
    Senior Member
    Join Date
    Sep 2010
    Location
    Burnsville, Minnesota, United States
    Posts
    2,799
    I'm on #3 so far. I've decided that I'm going to do as many as I can in the firefox javascript console on the page with the problem in it. We'll see how that goes.

  5. #25
    Darth Small Macheath's Avatar
    Join Date
    Sep 2010
    Posts
    15,125
    Yikes, good luck with that.

  6. #26
    Darth Small Macheath's Avatar
    Join Date
    Sep 2010
    Posts
    15,125
    Wooo

    Nice work, bencovi, you've just advanced to Level 1 .
    72707 members (14.66%) have made it this far.

  7. #27
    Senior Member
    Join Date
    Sep 2010
    Location
    Burnsville, Minnesota, United States
    Posts
    2,799
    I've given up on my goal after finishing number 6. After working on 7 for a bit, I started to think "it sure would be nice to have an Iterator" so I've moved to Java.

  8. #28
    Darth Small Macheath's Avatar
    Join Date
    Sep 2010
    Posts
    15,125
    Starting with #26, these are feeling like a whole lot of math and not much programming. I may forge ahead for a while, but it's no longer the "programming puzzlers" sort of experience I was hoping for.

  9. #29
    Darth Small Macheath's Avatar
    Join Date
    Sep 2010
    Posts
    15,125
    I just learned a neat trick with Java's streams, lambdas, and aggregate operations:

    Code:
    ArrayList<Integer> foo = new ArrayList<Integer>(){{add(1);add(3);add(5);}};
    ArrayList<Integer> bar = new ArrayList<Integer>(){{add(2);add(4);add(6);}};
    
    Stream.concat(foo.stream(), bar.stream()).sorted().forEach(System.out::println);
    Yes, other languages have had this kind of stuff forever (in fact, even Java 8 has been out for 18 months). Whatever, Scrooge McProgrammer.

  10. #30
    Senior Member
    Join Date
    Sep 2010
    Location
    Burnsville, Minnesota, United States
    Posts
    2,799
    We're still on Java 1.6 though we should be moving to 1.8 in the next year or so. Functors are definitely something I've missed having moved from C++ in school to Java.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •