[{"data":1,"prerenderedAt":541},["ShallowReactive",2],{"project-16249048":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":42,"post_text":44,"what":45,"said":55,"maker_in_thread":116,"shape":128,"grid":132,"attempts":502,"same_week":503,"maker_shows":43,"maker_hidden":533,"reader_version":534,"card":535},"16249048","BucketCompressionTrick","How to store a set of four 5-bit values in one 16-bit value","title","Show HN: How to store a set of four 5-bit values in one 16-bit value","https:\u002F\u002Fgithub.com\u002Fisometric\u002FBucketCompressionTrick","github.com","andromeduck",1517101302,2018,188,140,196,2155,10,"notable","languages","data compression technique","library",[24,25,26,27],"bit packing","set encoding","information theory","compression","curious",-0.046,{"positive":31,"neutral":32,"mixed":33,"critical":34},4,31,0,5,40,{"idea":37,"execution":39,"docs":40},{"positive":31,"critical":38},3,{"positive":33,"critical":33},{"positive":33,"critical":41},2,[38,33,33,38,38,33,38,34,38,38,43,38,33,33,33,33,38,34,38,43,38,33,33,33,43,33,33,33,33,33,33,33,38,38,38,38,38,38,43,34],1,null,{"problem":46,"audience":44,"pricing":44,"motivation":44,"time_to_build":44,"stack":52,"openness":53,"stage":54,"team_size":54},{"value":47,"source":48,"evidence":49},"Compactly storing an unordered set of four 5-bit values in 16 bits","maker",[50],{"id":51},"post",[],"open_source","unknown",{"praise":56,"objections":65,"requests":84,"questions":96,"alternatives":108},[57],{"value":58,"source":59,"evidence":60},"Good lesson in information entropy","commenter",[61],{"id":62,"by":63,"text":64},"16249277","psyc","This is a great little lesson in information entropy. I work on similar problems quite often in my work, and understanding this was a pleasant epiphany.",[66,77],{"value":67,"source":59,"evidence":68},"Title is misleading; it stores a set, not an ordered sequence",[69,73],{"id":70,"by":71,"text":72},"16249750","utopcell","The title is deceptive. It should state that the goal is to store a set of four 5-bit values.",{"id":74,"by":75,"text":76},"16249092","amptorn","Ah, without preserving order. That's a set of four 5-bit values, not a sequence of four 5-bit values.",{"value":78,"source":59,"evidence":79},"Relies on a lookup table, making it less interesting",[80],{"id":81,"by":82,"text":83},"16249223","barrkel","The fact that it's using lookup tables to store the mapping between the set of numbers and the encoded 16-bit number makes it less interesting; it basically just enumerates the…",[85],{"value":86,"source":59,"evidence":87},"Explain practical use cases",[88,92],{"id":89,"by":90,"text":91},"16249550","grawprog","It's pretty cool and all but what are the uses for this? What set of 4 un ordered 5-bit numbers would i need to store that I couldn't just store as 3 bytes? I waste only 4 bits…",{"id":93,"by":94,"text":95},"16249556","anonu","What's the practical use for this?",[97],{"value":98,"source":59,"evidence":99},"How is the count of possible sets computed for 4 values of 4 bits",[100,104],{"id":101,"by":102,"text":103},"16249488","sabujp","how are you getting 3876 unique values for a set of 4 4 bit values (16, 16, 16, 16) ?",{"id":105,"by":106,"text":107},"16249727","rasen58","Why is this first line true: \"This works because there are 3876 possible unique values for a set of 4 4 bit values\" Each 4 bit number has 16 possible values. And you can order…",[109],{"value":110,"source":59,"evidence":111},"Combinatorial number system encoding",[112],{"id":113,"by":114,"text":115},"16249458","nightcracker","It is possible to do this in O(1) memory, for arbitrary sized collections, efficiently. The first trick is to make a function that can calculate the nth set with k elements from…",{"comments":117,"answered":31,"key":118},6,[119,122,125],{"id":120,"text":121},"16249441","Is there a way to make it work with just make? I'm way too used to just typing make at this point and it's not too much work to just copy the same makefile everywhere.",{"id":123,"text":124},"16249406","Couldn't you just do that with radix sort or am I missing something?",{"id":126,"text":127},"16249503","So I'm allowed to read\u002Fwrite only once to the backing media? You're right, that does sound impossible. :O",{"commenters":129,"max_depth":130,"maker_replies":117,"first_comment_mins":18,"lifespan_hours":131},84,8,96,[133,135,139,142,145,148,151,154,157,159,162,165,168,171,174,177,180,182,185,187,189,191,194,197,200,202,205,207,210,213,216,220,222,225,228,231,234,238,241,244,246,249,253,256,258,260,262,264,267,269,272,275,276,279,282,285,287,288,291,293,295,297,300,302,305,307,309,311,314,317,318,322,326,329,332,334,337,340,342,345,348,351,353,355,357,359,363,366,368,370,372,373,375,378,380,382,383,386,389,391,394,397,399,402,405,407,409,411,413,416,419,423,427,430,432,435,437,441,443,445,449,451,454,457,459,462,465,468,470,474,477,479,481,483,486,488,492,494,498,500],[74,33,33,134,75,33],"commenter\u002Fneutral\u002Fnone",[136,33,38,137,138,33],"16249141","project\u002Fneutral\u002Fidea","ajkjk",[140,33,33,134,141,33],"16249227","Buttons840",[143,33,33,134,144,33],"16249236","gpm",[146,33,33,134,147,33],"16249261","cameldrv",[149,33,33,134,150,33],"16249309","SilasX",[152,33,33,134,153,33],"16249464","abpavel",[155,33,33,134,156,33],"16249806","arnarbi",[158,33,33,134,138,33],"16250424",[160,33,33,134,161,33],"16249258","londons_explore",[163,33,33,134,164,33],"16249303","jack9",[166,33,38,137,167,33],"16249401","scatters",[169,33,38,137,170,33],"16249596","yorwba",[172,33,33,134,173,33],"16249758","pishpash",[175,33,38,137,176,33],"16250410","bubblethink",[178,33,38,137,179,33],"16250437","bonzini",[181,33,33,134,179,33],"16250435",[183,33,33,134,184,33],"16249608","mturmon",[186,33,33,134,170,33],"16249692",[188,33,33,134,184,33],"16250259",[190,33,33,134,173,33],"16249747",[192,33,38,137,193,33],"16250019","rcthompson",[195,33,33,134,196,33],"16249492","marcoperaza",[198,33,33,134,199,33],"16249501","dboreham",[201,33,33,134,196,33],"16249505",[203,33,33,134,204,33],"16249168","joshuak",[206,33,33,134,170,33],"16249241",[208,33,34,209,204,33],"16249485","project\u002Fpositive\u002Fidea",[211,33,33,134,212,33],"16249528","sweettea",[214,33,38,137,215,33],"16250052","scythe",[217,33,33,218,219,33],"16260598","other\u002Fneutral\u002Fnone","eloff",[221,33,33,134,204,33],"16271068",[223,33,33,224,219,33],"16278841","commenter\u002Fpositive\u002Fnone",[226,33,33,218,227,33],"16249642","ChuckMcM",[229,33,38,137,230,33],"16250090","kuschku",[232,33,33,134,233,33],"16249830","craftyguy",[235,43,43,236,237,33],"16249592","project\u002Fcritical\u002Fidea","yshklarov",[239,43,33,224,240,33],"16250190","uniformlyrandom",[242,43,33,134,243,33],"16250581","ViktorV",[245,41,38,137,71,33],"16249947",[247,41,33,224,248,33],"16250268","shaklee3",[250,38,38,251,252,33],"16249135","maker\u002Fneutral\u002Fnone","bringtheaction",[254,38,33,134,255,33],"16249212","torstenvl",[257,38,33,134,252,33],"16249251",[259,38,33,134,170,33],"16249256",[261,38,33,134,255,33],"16249275",[263,38,33,134,170,33],"16249297",[265,38,33,134,266,33],"16249259","LukeShu",[268,38,33,134,252,33],"16249282",[270,38,33,134,271,33],"16249363","Merad",[273,38,33,134,274,33],"16249516","mehrdadn",[120,38,33,251,11,43],[277,38,33,134,278,33],"16249560","to3m",[280,38,33,134,281,33],"16249686","chungy",[283,38,33,134,284,33],"16251315","majewsky",[286,38,33,134,281,33],"16251523",[113,31,38,137,114,33],[289,31,33,134,290,33],"16249599","sirclueless",[292,31,33,134,114,33],"16249636",[294,31,34,209,290,33],"16249771",[296,31,33,134,114,33],"16249788",[298,31,38,137,299,33],"16249664","tveita",[301,31,33,134,114,33],"16249757",[303,31,33,134,304,33],"16249761","rafael859",[306,31,38,137,299,33],"16250050",[308,31,33,134,215,33],"16249703",[310,31,33,134,114,33],"16249775",[312,31,33,134,313,33],"16250906","syrrim",[315,34,33,218,316,33],"16249962","mgelbart",[81,117,43,236,82,33],[319,117,38,320,321,33],"16250270","project\u002Fneutral\u002Fexecution","hinkley",[323,324,33,218,325,33],"16250275",7,"huftis",[327,324,33,218,328,33],"16250299","steve_musk",[330,324,33,218,331,33],"16250325","Robin_Message",[333,324,33,218,328,33],"16250499",[335,324,33,218,336,33],"16250621","Too",[338,324,33,218,339,33],"16250759","marcan_42",[341,324,33,218,325,33],"16251410",[343,324,33,218,344,33],"16250640","fyi1183",[346,324,33,218,347,33],"16250653","OJFord",[349,324,33,218,350,33],"16250360","TekMol",[352,324,33,218,325,33],"16250422",[354,324,33,218,350,33],"16250805",[356,324,33,218,325,33],"16251347",[70,130,43,358,71,33],"project\u002Fcritical\u002Fdocs",[360,361,33,218,362,33],"16249112",9,"raphlinus",[364,361,33,218,365,33],"16249178","6nf",[367,361,33,134,362,33],"16249248",[369,361,33,218,161,33],"16249294",[371,361,33,134,362,33],"16249386",[123,361,33,134,11,43],[374,361,33,134,362,33],"16249424",[376,361,33,134,377,33],"16249471","joshuamorton",[379,361,33,134,290,33],"16249632",[381,361,33,134,377,33],"16249730",[126,361,33,134,11,43],[384,361,33,134,385,33],"16249345","Franciscouzo",[387,361,33,134,388,33],"16249504","Matheus28",[390,361,33,134,385,33],"16249685",[392,361,33,218,393,33],"16249426","twouhm",[395,361,33,218,396,33],"16249460","_wmd",[398,361,33,134,290,33],"16249651",[400,361,33,134,401,33],"16249665","lalaland1125",[403,361,33,404,388,33],"16249459","other\u002Fneutral\u002Fidea",[406,361,33,134,290,33],"16249684",[408,361,33,134,388,33],"16261561",[410,361,33,134,401,33],"16249769",[412,361,33,134,388,33],"16261556",[414,18,33,404,415,33],"16249713","uiri",[417,18,33,218,418,33],"16250022","olympus",[420,421,33,218,422,33],"16250685",11,"AlphaGeekZulu",[424,425,33,218,426,33],"16251243",12,"YesThatTom2",[428,429,38,320,266,33],"16249232",13,[105,431,38,137,106,33],14,[433,431,33,134,434,33],"16249804","karlding",[436,431,33,134,106,33],"16262634",[438,439,38,137,440,33],"16250042",15,"RandomCSGeek",[442,439,43,236,150,33],"16250063",[62,444,34,209,63,33],16,[446,447,38,137,448,33],"16249595",17,"ttoinou",[101,450,38,137,102,33],18,[452,450,33,134,453,33],"16249558","hikkigaya",[455,450,38,137,456,33],"16249968","2opt",[458,450,38,137,170,33],"16249648",[460,450,38,137,461,33],"16249702","jandrese",[463,450,38,137,464,33],"16250049","lostatseajoshua",[466,450,38,137,467,33],"16250161","pavlov",[469,450,38,137,461,33],"16253857",[471,472,38,320,473,33],"16253606",19,"XtremAlRaven",[475,476,38,137,464,33],"16250057",20,[478,476,38,137,321,33],"16250246",[93,480,38,137,94,33],21,[482,480,33,137,11,43],"16249778",[484,480,38,485,204,33],"16249821","maker\u002Fneutral\u002Fdocs",[487,480,33,485,11,43],"16251057",[489,480,43,490,491,33],"16250736","maker\u002Fcritical\u002Fdocs","pm215",[493,480,33,485,11,43],"16251096",[495,496,33,218,497,33],"16256380",22,"espeed",[89,499,38,137,90,33],23,[501,499,34,209,204,33],"16249683",[],[504,509,514,519,523,528],{"id":505,"name":506,"points":507,"category":508},"16274686","Observable",654,"dev_tools",{"id":510,"name":511,"points":512,"category":513},"16273609","D StatusPage",316,"infrastructure",{"id":515,"name":516,"points":517,"category":518},"16273171","upvote.pub",275,"learning_science",{"id":520,"name":521,"points":522,"category":518},"16237558","Interactive Ansible Tutorial",170,{"id":524,"name":525,"points":526,"category":527},"16259542","Card Proxy Generator",162,"games",{"id":529,"name":530,"points":531,"category":532},"16246485","Project Board",149,"web_saas",false,"v2",{"id":536,"name":5,"line":6,"ai":533,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":537,"top":18,"kw":538,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":539,"url":9,"mix":540,"praise":58,"objection":67,"sub":21},16249048,-0.05,[24,25,26,27],"3003303533130000353130001000000033333315",[31,32,33,34],1794036562955]