

Instagram Engineer Challenge solved with Javascript - triptych
http://feval.info/instagram/canvas.html
Image processing challenge solved using javascript and HTML5 canvas.
======
Mgccl
This challenge is the first real life program I wrote with Haskell.

[https://github.com/Mgccl/mgccl-
haskell/blob/master/random/un...](https://github.com/Mgccl/mgccl-
haskell/blob/master/random/unshredder.hs) (so it seems I don't like to specify
the type of my functions...)

Explanation is here: [http://chaoxuprime.com/2011/11/a-solution-to-Instagram-
engin...](http://chaoxuprime.com/2011/11/a-solution-to-Instagram-engineering-
challenge-the-unshredder-in-haskell)

~~~
nandemo
Very nice.

Care for some unsolicited hlint-like suggestions?

Why not simply this:

    
    
        img <- readImage "file.png" 
        -- instead of this?
        t <- readImage "file.png"
        let img = t
    

Why not this:

    
    
        map (y!!) x  
        foldr ((:).(y!!)) []　x　-- instead of this?
    

Note that a way of reading _fold g []_ is that replaces the list constructor
(:) (aka _cons_ ) with g. So (:) as argument of fold is probably not
idiomatic, since _foldr (:) []_ is the same as _id_.

~~~
Mgccl
Thanks. hlint-like suggestions are always welcome.

I have no idea what was in my mind when I wrote

    
    
      foldr ((:).(y!!)) []　x

------
ronilan
Mine from the weekend here: <http://ronilan.com/instagram-unshredder/>

~~~
reledi
I preferred yours. You at least gave some comments about the solution.

------
Timothee
Note that image 3 and 5 are slightly NSFW.

~~~
magicalhobo
The source code is also NSFW: "_analizeColumn"

~~~
verroq
That's probably a mispelling of _analyseColumn.

------
ricardobeat
I (kind of) solved it with CoffeeScript but thought it wasn't a good idea to
publish… if you do it's not a challenge anymore, is it?

<https://github.com/ricardobeat/instagram-challenge>

------
eridius
Very neat. Makes me kind of embarrassed that I never got around to actually
solving this challenge. I've had the web page open on my laptop since it first
showed up on HN.

------
HeyImAlex
Me too, and no response. I really wanted that T-Shirt...
<http://www.solesavoria.com/instagram/v2/>

------
carnevalem
You might also be interested in DARPA's similar challenge:
<http://www.shredderchallenge.com/>

~~~
espes
Or for a similar, easier task, problem 3 "life" from this year's FARIO:
<http://orac.amt.edu.au/fario/11/problems_en.pdf>

Here's case 8 to give you an idea: <http://i.imgur.com/1fFzO.png> :P

Test data here: <http://dl.dropbox.com/u/76985/life-all-linux.zip>

------
rjenkins
Here's mine <https://github.com/rjenkins/instagram-html5-unshredder>

demo here <http://memoization.com/unshred.html>

------
swang
So is this challenge over? I submitted an entry using Canvas as well but
allowed users to drop image in from their desktop (only works in
Chrome/Firefox though). Haven't heard from anyone at Instagram.

~~~
rjenkins
funny, that's exactly how mine works. Haven't heard anything either

------
touchcream
I solved it in ocaml, I only had this development environment this week end
but it was fun. I didn't posted it on my blog but if someone wants it, just
ask ;)

------
vidoss
Another one <http://vidoss.github.com/>

------
coreyrecvlohe
Great job! Excellent coding style btw.

------
asdfqwer1234
so can someone actually explain how this works?

~~~
the-cakeboss
While I didn't look at how he did it, if I were to write something to do this,
I would first locate each slice of the image. This could be accomplished using
a rudimentary edge detection algorithm ( ie starting from the left, compare
each column of pixels with the next, any large differences of course means an
edge ). After that I might assign a weighted value to each edge of a slice,
and then sort based upon those values.

------
ggwicz
Nice work!

------
cleverjake
Really impressive work, great job.

