[{"data":1,"prerenderedAt":462},["ShallowReactive",2],{"project-3040157":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":35,"aspects":36,"strip":44,"post_text":46,"what":47,"said":87,"maker_in_thread":184,"shape":194,"grid":199,"attempts":424,"same_week":425,"maker_shows":33,"maker_hidden":454,"reader_version":455,"card":456},"3040157","VisualSort","Write a sort, watch it go","title","Show HN: Write a sort, watch it go","http:\u002F\u002Fvisualsort.appspot.com\u002F","visualsort.appspot.com","thedufer",1317062193,2011,292,80,14,1097,2,"legend","languages","sorting algorithm visualizer","web_app",[24,25,26,27],"sorting algorithms","visualization","coffeescript","algorithm learning","curious",-0.014,{"positive":31,"neutral":32,"mixed":33,"critical":34},9,29,1,7,46,{"idea":37,"docs":39,"performance":41,"execution":42,"design":43},{"positive":38,"critical":38},3,{"positive":33,"critical":40},0,{"positive":40,"critical":40},{"positive":18,"critical":18},{"positive":33,"critical":33},[45,38,45,33,38,33,38,38,38,38,45,38,40,45,38,33,38,45,38,45,38,38,33,38,33,40,38,33,40,38,38,38,38,45,40,38,40,40,38,38],5,null,{"problem":48,"audience":60,"pricing":46,"motivation":64,"time_to_build":46,"stack":68,"openness":84,"stage":85,"team_size":86},{"value":49,"source":50,"evidence":51},"Hard to see how sorting algorithms work step by step.","commenter",[52,56],{"id":53,"by":54,"text":55},"3040324","oacgnol","This is fantastic for teaching sorting algorithms visually. I'm going to see if I can forward this to my former professors and teachers.",{"id":57,"by":58,"text":59},"3040904","mbostock","Nice, though I think static visualizations illustrate the examples more quickly and are easier to compare: http:\u002F\u002Fcorte.si\u002Fposts\u002Fcode\u002Fvisualisingsorting\u002Findex.html I also love…",{"value":61,"source":50,"evidence":62},"Students and teachers learning sorting algorithms.",[63],{"id":53,"by":54,"text":55},{"value":65,"source":50,"evidence":66},"Teaching sorting algorithms visually.",[67],{"id":53,"by":54,"text":55},[69,80],{"value":70,"source":71,"evidence":72},"CoffeeScript","maker",[73,76],{"id":74,"by":11,"text":75},"3040700","This is exactly what's going on. You can't get a reflow on the page without giving up control, and I didn't want to require people to write asynchronous code to give up control…",{"id":77,"by":78,"text":79},"3040994","scotty79","Yay. My first program in CoffeScript. It was fun to implement algorithm of which I only vaguely remembered how it worked. Details bit me few times before I got it working and…",{"value":81,"source":71,"evidence":82},"JavaScript",[83],{"id":74,"by":11,"text":75},"open_source","launched","unknown",{"praise":88,"objections":105,"requests":121,"questions":146,"alternatives":165},[89,97],{"value":90,"source":50,"evidence":91},"Great for teaching sorting visually",[92,93],{"id":53,"by":54,"text":55},{"id":94,"by":95,"text":96},"3040247","jc4p","It's fantastic. I don't know CoffeeScript so all I did was compare the pre-written ones to each other and see if they did what I expected them to do, but it's a nice visual…",{"value":98,"source":50,"evidence":99},"Fun to write custom sorts",[100,101],{"id":77,"by":78,"text":79},{"id":102,"by":103,"text":104},"3040781","SeoxyS","Had fun writing a gnome-sort in a minute or two: ``` pos = 1 while pos \u003C VA.length if (VA.gte(pos, pos-1)) pos++ else VA.swap(pos, pos-1) if (pos > 1) pos-- else pos++ ```",[106,117],{"value":107,"source":50,"evidence":108},"Quicksort uses poor pivot choice",[109,113],{"id":110,"by":111,"text":112},"3040537","HardyLeung","The quicksort implementation is incorrect. The code simply picking the left-most element as the pivot, and as a result it becomes pathologically slow for nearly-sorted array --…",{"id":114,"by":115,"text":116},"3040561","cschneid","That's still a quicksort - it always has n^2 as its worst case I thought? If you pick the wrong pivot each time.",{"value":118,"source":50,"evidence":119},"Neon yellow color is painful to view",[120],{"id":94,"by":95,"text":96},[122,132,139],{"value":123,"source":50,"evidence":124},"Add cache and branch behaviour simulation",[125,129],{"id":126,"by":127,"text":128},"3041505","pbiggar","I love the stats on the side. Knowing how many comparisons and swaps occur really shows the complexity of the algorithms. And to segue into my own area of interest with sorting,…",{"id":130,"by":127,"text":131},"3044194","Yeah, I can see that. A big problem is that the set sizes where cache effects start to come into effect are much larger than the sizes you're modelling. A level 1 cache is going…",{"value":133,"source":50,"evidence":134},"Allow values outside 1..length and duplicates",[135],{"id":136,"by":137,"text":138},"3040912","eridius","Very neat, but here's a couple of additions I'd like to see: 1. Allow for the array to contain values outside of the range of [1..length]. Ideally, allow for duplicate values as…",{"value":140,"source":50,"evidence":141},"Add shuffle function",[142],{"id":143,"by":144,"text":145},"3040416","ilikejam","Needs a shuffle() function - can't bogosort without it.",[147,154],{"value":148,"source":50,"evidence":149},"How is stack size or memory measured?",[150],{"id":151,"by":152,"text":153},"3040786","DrHankPym","This might be a dumb question, but can you add numbers about the size of the stack to the right-side statistics? I.e. How many variables and calls to functions are stored in…",{"value":155,"source":50,"evidence":156},"Why does nothing display on infinite loops?",[157,161],{"id":158,"by":159,"text":160},"3040507","akavi",">Nothing will display if there is an infinite loop. Did someone solve the halting problem while I wasn't looking?",{"id":162,"by":163,"text":164},"3040640","kingkilr","I assume it just computes every step, and then displays them all.",[166,173,177],{"value":167,"source":50,"evidence":168},"Sorting-algorithms.com visualizations",[169],{"id":170,"by":171,"text":172},"3042458","rnm","This is a good set of sorting visualisations too, presented more compactly (but not customisable): http:\u002F\u002Fwww.sorting-algorithms.com\u002F",{"value":174,"source":50,"evidence":175},"Corte.si sorting visualisations",[176],{"id":57,"by":58,"text":59},{"value":178,"source":50,"evidence":179},"Wikipedia sorting animations",[180],{"id":181,"by":182,"text":183},"3040764","cpeterso","Wikipedia has similar animations for some of its articles about sorting algorithms, e.g.: https:\u002F\u002Fsecure.wikimedia.org\u002Fwikipedia\u002Fen\u002Fwiki\u002FQuicksort",{"comments":185,"answered":38,"key":186},18,[187,188,191],{"id":74,"text":75},{"id":189,"text":190},"3041612","Added as a prewritten sort. Thanks!",{"id":192,"text":193},"3041541","Yes; however, at each step I'm already storing the state of VA.locals. If you can show me how I would get this data, I'd be happy to display it.",{"commenters":195,"max_depth":196,"maker_replies":185,"first_comment_mins":197,"lifespan_hours":198},52,6,24,45,[200,204,208,212,215,218,221,225,228,231,234,235,237,239,243,246,248,249,253,254,256,258,261,262,264,266,270,271,274,277,280,284,287,289,292,295,299,302,305,307,310,313,315,316,318,320,322,324,327,331,334,336,340,342,345,349,354,356,358,362,364,367,369,372,375,377,382,387,391,394,397,400,402,406,408,411,414,417,420,422],[201,40,38,202,203,40],"3040913","project\u002Fneutral\u002Fnone","robinhouston",[205,40,45,206,207,40],"3041799","project\u002Fpositive\u002Fidea","snow_mac",[209,40,40,210,211,40],"3042018","other\u002Fneutral\u002Fnone","boredguy8",[213,33,38,202,214,40],"3040542","mayoff",[216,33,45,217,137,40],"3040895","project\u002Fpositive\u002Fdocs",[219,18,38,202,220,40],"3040517","jethroalias97",[222,18,33,223,224,40],"3041247","project\u002Fcritical\u002Fidea","rfugger",[226,18,40,227,152,40],"3045079","commenter\u002Fneutral\u002Fnone",[229,18,38,202,230,40],"3042436","anonymoushn",[232,18,40,210,233,40],"3043648","iam",[158,38,33,223,159,40],[162,38,38,236,163,40],"project\u002Fneutral\u002Fperformance",[74,38,40,238,11,33],"maker\u002Fneutral\u002Fexecution",[240,241,38,202,242,40],"3040879",4,"jxcole",[244,241,38,202,245,40],"3040915","derobert",[189,241,40,247,11,33],"maker\u002Fpositive\u002Fnone",[151,45,38,236,152,40],[250,45,38,251,252,40],"3041286","project\u002Fneutral\u002Fexecution","mcpherrinm",[192,45,40,238,11,33],[136,196,38,255,137,40],"project\u002Fneutral\u002Fdesign",[257,196,40,247,11,33],"3041609",[259,196,45,260,137,40],"3042291","project\u002Fpositive\u002Fexecution",[77,34,38,202,78,40],[263,34,38,202,78,40],"3041438",[265,34,40,247,11,33],"3041610",[267,268,40,269,11,33],"3040381",8,"project\u002Fneutral\u002Fdocs",[53,31,45,206,54,40],[272,31,45,247,273,40],"3040366","miles_matthias",[94,275,38,276,95,40],10,"project\u002Fmixed\u002Fdesign",[278,275,40,279,11,33],"3040371","maker\u002Fpositive\u002Fdesign",[281,275,33,282,283,40],"3040557","project\u002Fcritical\u002Fdesign","rafedb",[285,275,38,236,286,40],"3041302","T-hawk",[288,275,40,255,11,33],"3041339",[290,275,38,202,291,40],"3043529","alttag",[293,275,45,294,291,40],"3045241","maker\u002Fpositive\u002Fexecution",[296,297,38,202,298,40],"3040447",11,"y0ghur7_xxx",[300,297,38,202,301,40],"3040631","rlivsey",[303,297,38,202,304,40],"3040655","tkahn6",[126,306,45,206,127,40],12,[308,306,40,309,11,33],"3041729","maker\u002Fneutral\u002Fnone",[311,306,38,312,127,40],"3044044","maker\u002Fneutral\u002Fperformance",[314,306,40,312,11,33],"3044144",[130,306,38,312,127,40],[317,306,40,312,11,33],"3048229",[102,319,38,202,103,40],13,[143,16,33,321,144,40],"project\u002Fcritical\u002Fnone",[323,16,40,309,11,33],"3040705",[325,16,38,202,326,40],"3040987","dekz",[328,329,33,223,330,40],"3040784",15,"ginkgo",[332,329,40,333,11,33],"3040815","maker\u002Fneutral\u002Fidea",[57,335,40,210,58,40],16,[337,338,40,210,339,40],"3040582",17,"dannyr",[341,338,40,247,11,33],"3040687",[343,185,38,202,344,40],"3047664","jlnazario",[346,347,38,202,348,40],"3041762",19,"dhathorn",[350,351,33,352,353,40],"3040315",20,"project\u002Fcritical\u002Fexecution","sp332",[355,351,40,238,11,33],"3040359",[357,351,40,227,353,40],"3040363",[359,360,38,255,361,40],"3040832",21,"CountHackulus",[363,360,40,247,11,33],"3041602",[365,366,38,202,230,40],"3042223",22,[181,368,40,210,182,40],23,[370,197,38,269,371,40],"3040975","mdonahoe",[373,197,40,374,11,33],"3041601","maker\u002Fpositive\u002Fdocs",[170,376,40,210,171,40],25,[378,379,38,380,381,40],"3041907",26,"project\u002Fneutral\u002Fidea","js2",[383,384,45,385,386,40],"3042225",27,"project\u002Fpositive\u002Fdesign","Dipen",[388,389,40,210,390,40],"3041716",28,"matlaber",[392,389,40,210,393,40],"3041724","antimora",[395,389,40,210,396,40],"3041961","elliottcarlson",[398,32,45,399,393,40],"3040309","project\u002Fpositive\u002Fnone",[110,401,33,352,111,40],30,[403,401,40,404,405,40],"3040559","commenter\u002Fcritical\u002Fexecution","maggit",[114,401,40,407,115,40],"commenter\u002Fneutral\u002Fexecution",[409,401,40,407,410,40],"3040869","leif",[412,401,40,407,413,40],"3041332","xentronium",[415,401,40,407,416,40],"3042534","Robin_Message",[418,401,38,238,419,40],"3040594","sirclueless",[421,401,38,238,361,40],"3040684",[423,401,40,238,11,33],"3040779",[],[426,431,435,439,444,449],{"id":427,"name":428,"points":429,"category":430},"3045536","HackerThings",364,"web_saas",{"id":432,"name":433,"points":434,"category":430},"3033667","TweetBoard.me",124,{"id":436,"name":437,"points":438,"category":430},"3038317","Promoter",119,{"id":440,"name":441,"points":442,"category":443},"3039926","Fontorie",99,"creative",{"id":445,"name":446,"points":447,"category":448},"3040526","textlaundry.com",91,"productivity",{"id":450,"name":451,"points":452,"category":453},"3028952","10k.aneventapart.com",69,"dev_tools",false,"v2",{"id":457,"name":5,"line":6,"ai":454,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":458,"top":18,"kw":459,"maker":11,"domain":10,"tier":19,"attempts":40,"strip":460,"url":9,"mix":461,"praise":90,"objection":107,"sub":21},3040157,-0.01,[24,25,26,27],"5351313333530531353533131031033335030033",[31,32,33,34],1793990875551]