\"} ;window.thread_json=[{"no":3436,"resto":0,"com":"Wish nodejs had pointers....","title":"Wish nodejs had pointers....","name":"Anonymous","time":1588984788,"last_modified":1589155620,"tn_h":255,"tn_w":255,"h":500,"w":500,"board":"b","fsize":532442,"filename":"61a12805462f1cf92145991a3895b05a","ext":"webm","file_id":"1588984787611","location":"luna","md5":"61a12805462f1cf92145991a3895b05a","last_replies":[{"no":3444,"resto":3436,"com":"You can pass objects by reference. That's the closest thing to a pointer you can get in Javascript. If you really need to handle pointers directly though, you probably shouldn't be using a highly abstracted scripting language like Javascript and might want to look into using a compiled programming language like C/C++ or Rust.","name":"Anonymous","time":1588997002,"last_modified":1588997002,"board":"b","cites":[{"post":"3446","board":"b","host":"3436"}]},{"no":3446,"resto":3436,"com":"[c b|3436|3444]\>\>\>/b/3444[/c][br][/br]Caching idea would be best done with a dictionary hashes going to pointers. The best alternative I can think of is associating ids to hashes and hashes to ids, but waste. At the point where it gets too complicated I think the only node solution is a Redis in memory database. In the least this allows you to go horizontal with it's master slave database thingy","name":"Anonymous","time":1588997411,"last_modified":1588997411,"board":"b","cites":[{"post":"3448","board":"b","host":"3436"}]},{"no":3448,"resto":3436,"com":"[c b|3436|3446]\>\>\>/b/3446[/c][br][/br][s quote]\>is associating ids to hashes and hashes to ids[/s][br][/br]is associating ids to hashes and ids to caches","name":"Anonymous","time":1588998187,"last_modified":1588998187,"board":"b"},{"no":3449,"resto":3436,"com":"What are you trying to accomplish? What are the hashes for?","name":"Anonymous","time":1589000213,"last_modified":1589000213,"board":"b","cites":[{"post":"3450","board":"b","host":"3436"}]},{"no":3450,"resto":3436,"com":"[c b|3436|3449]\>\>\>/b/3449[/c][br][/br]prevent redundancy when storing data[br][/br][br][/br]---[br][/br][br][/br]opts = {noimage:true, notext:false, somethingirrelevant:tr[wbr][/wbr]ue};[br][/br]optshash_1 = hash(opts);[br][/br]console.log(optshash_1[wbr][/wbr]);[br][/br]// \"101\"[br][/br]value_1 = \"\
asdf\
\"; // a very large string[br][/br][br][/br]opts = {noimage:true, notext:false, somethingirrelevant:fa[wbr][/wbr]lse};[br][/br]optshash_2 = hash(opts);[br][/br]console.log(optshash_2[wbr][/wbr]);[br][/br]// \"100\"[br][/br]value_2 = \"\asdf\
\"; // a very large identical string[br][/br][br][/br]store.push({optshash_2[wbr][/wbr]:value_2});[br][/br]store.push({optshash_1[wbr][/wbr]:value_1});[br][/br][br][/br]// values 2 and 1 are identical yet taking up two memory spaces.[br][/br]// if two clients have different options and are trying to get the same data this is a waste[br][/br]// The alternative prevents redundant information[br][/br][br][/br]index_store.push({opts[wbr][/wbr]hash_1:0});[br][/br]index_store.push({opts[wbr][/wbr]hash_2:0});[br][/br]store = [value_1];","name":"Anonymous","time":1589000856,"last_modified":1589000856,"board":"b","cites":[{"post":"3452","board":"b","host":"3436"}]},{"no":3451,"resto":3436,"com":"[s quote]\>index_store.push({[wbr][/wbr]optshash_1:0});[/s][br][/br][s quote]\>index_store.push({[wbr][/wbr]optshash_2:0});[/s][br][/br]index_store[optshash_1[wbr][/wbr]] = 0;[br][/br]index_store[optshash_2[wbr][/wbr]] = 0;[br][/br]because then it's a dict, which was what I was aiming for","name":"Anonymous","time":1589001362,"last_modified":1589001362,"board":"b"},{"no":3452,"resto":3436,"com":"[c b|3436|3450]\>\>\>/b/3450[/c][br][/br]How does the software know the strings are identical? Is there a comparison at some point?","name":"Anonymous","time":1589001509,"last_modified":1589001509,"board":"b","cites":[{"post":"3454","board":"b","host":"3436"}]},{"no":3453,"resto":3436,"com":"nerds will get swirlies","title":"202963212289e035205a168b83935bdf.png","opt":"sage","name":"Anonymous","time":1589002200,"last_modified":1589002200,"tn_h":175,"tn_w":175,"h":1500,"w":1500,"board":"b","fsize":1029769,"filename":"202963212289e035205a168b83935bdf","ext":"png","file_id":"1589002200078","location":"haiji","md5":"202963212289e035205a168b83935bdf","cites":[{"post":"3455","board":"b","host":"3436"}]},{"no":3454,"resto":3436,"com":"[c b|3436|3452]\>\>\>/b/3452[/c][br][/br]The options are the decider for what you get. no Comparision, it's a hash table.[br][/br][br][/br][br][/br]//setting the store[br][/br][br][/br]var index_store = {};[br][/br]var store = [];[br][/br][br][/br]function hash(opts){[br][/br] return \"\" + (opts.noimage ? 1 : 0) + (opts.notext ? 1 : 0) + (opts.somethingirrelev[wbr][/wbr]an ? 1 : 0);[br][/br]}[br][/br][br][/br]function storeValue(optshash, value){[br][/br] index_store[optshash] = store.length;[br][/br] store.push(value);[br][/br]}[br][/br][br][/br][br][/br]var opts_1 = hash({noimage:true, notext:false, somethingirrelevant:tr[wbr][/wbr]ue});[br][/br]var value_1 = \"asdf\";[br][/br]storeValue(opts_1 , value_1);[br][/br][br][/br]var opts_2 = hash({noimage:true, notext:false, somethingirrelevant:fa[wbr][/wbr]lse});[br][/br]var value_2 = \"asdf\";[br][/br]storeValue(opts_2 , value_2);[br][/br][br][/br][br][/br]// later evaluation[br][/br]var opts_1 = hash({noimage:true, notext:false, somethingirrelevant:tr[wbr][/wbr]ue});[br][/br]function getIfCached(opts){[br][/br] if(index_store[opts])[br][/br] return store[index_store[opts[wbr][/wbr]]];[br][/br]}[br][/br][br][/br]var opts_3 = hash({noimage:false, notext:false, somethingirrelevant:tr[wbr][/wbr]ue});[br][/br][br][/br]console.log(getIfCache[wbr][/wbr]d(opts_1));[br][/br]//asdf[br][/br]console.log(getIfCache[wbr][/wbr]d(opts_2));[br][/br]//asdf[br][/br]console.log(getIfCache[wbr][/wbr]d(opts_3));[br][/br]//undefined","name":"Anonymous","time":1589002230,"last_modified":1589002230,"board":"b"},{"no":3455,"resto":3436,"com":"[c b|3436|3453]\>\>\>/b/3453[/c][br][/br]rude!","name":"Anonymous","time":1589002273,"last_modified":1589002273,"board":"b"},{"no":3457,"resto":3436,"com":"It's procedural generation of items with a hash table which stores the end result of decisions. The options are the seeds which decide the outcome.","name":"Anonymous","time":1589002541,"last_modified":1589002541,"board":"b"},{"no":3458,"resto":3436,"com":"oh shoot, I realize a mistake","name":"Anonymous","time":1589002686,"last_modified":1589002686,"board":"b"},{"no":3459,"resto":3436,"com":"I see, you have to make a pretty serious string comparison to save yourself the ram..[br][/br][br][/br]---[br][/br]//setting the store[br][/br][br][/br]var index_store = {};[br][/br]var store = [];[br][/br][br][/br]function hash(opts){[br][/br] return \"\" + (opts.noimage ? 1 : 0) + (opts.notext ? 1 : 0) + (opts.somethingirrelev[wbr][/wbr]ant? 1 : 0);[br][/br]}[br][/br][br][/br]function storeValue(optshash, value){[br][/br] var cont = true;[br][/br] for (var i = 0 ; i \< store.length ; i++){[br][/br] if(value == store[i]) {[br][/br] cont = false;[br][/br] break;[br][/br] }[br][/br] }[br][/br] if(cont)[br][/br] store.push(value);[br][/br] index_store[optshash] = store.length - 1;[br][/br]}[br][/br][br][/br][br][/br]var opts_1 = hash({noimage:true, notext:false, somethingirrelevant:tr[wbr][/wbr]ue});[br][/br]var value_1 = \"asdf\";[br][/br]storeValue(opts_1 , value_1);[br][/br][br][/br]var opts_2 = hash({noimage:true, notext:false, somethingirrelevant:fa[wbr][/wbr]lse});[br][/br]var value_2 = \"asdf\";[br][/br]storeValue(opts_2 , value_2);[br][/br][br][/br]console.log(store.leng[wbr][/wbr]th);[br][/br]// 1[br][/br][br][/br]// later evaluation[br][/br]var opts_1 = hash({noimage:true, notext:false, somethingirrelevant:tr[wbr][/wbr]ue});[br][/br]function getIfCached(opts){[br][/br] if(index_store[opts] != undefined)[br][/br] return store[index_store[opts[wbr][/wbr]]];[br][/br]}[br][/br][br][/br]var opts_3 = hash({noimage:false, notext:false, somethingirrelevant:tr[wbr][/wbr]ue});[br][/br][br][/br]console.log(getIfCache[wbr][/wbr]d(opts_1));[br][/br]//asdf[br][/br]console.log(getIfCache[wbr][/wbr]d(opts_2));[br][/br]//asdf[br][/br]console.log(getIfCache[wbr][/wbr]d(opts_3));[br][/br]//undefined","name":"Anonymous","time":1589003084,"last_modified":1589003084,"board":"b"},{"no":3460,"resto":3436,"com":"A warning: If you use the object-as-dictionary hack, you need to make that none of your keys can ever be any of the following:[br][/br][br][/br]\"constructor\"[br][/br]\"__proto__\"[br][/br]\"__noSuchMethod__\"[br][/br]\"__defineGetter__\"[br][/br]\"__defineSetter__\"[br][/br]\"__lookupGetter__\"[br][/br]\"__lookupSetter__\"[br][/br]\"hasOwnProperty\"[br][/br]\"isPrototypeOf\"[br][/br]\"propertyIsEnumerable\"[br][/br]\"toLocaleString\"[br][/br]\"toString\"[br][/br]\"unwatch\"[br][/br]\"valueOf\"[br][/br]\"watch\"[br][/br][br][/br]Or anything else that may get added to the Object prototype in the future, or by software you run. If any of these strings are used as a key, you may get unexpected behavior or even security problems. The key \"__proto__\" is especially dangerous. Look up \"prototype pollution\" for examples of the problems it's caused.[br][/br][br][/br]Alternatively, consider using Map.[br][/br][If you really need to use objects, Object.create(null) is a solution, but the only reasons I can think of to use that is to create objects for JSON.stringify or to security-patch existing code.]","name":"Anonymous","time":1589004601,"last_modified":1589004601,"board":"b","cites":[{"post":"3462","board":"b","host":"3436"}]},{"no":3461,"resto":3436,"com":"It might be a good idea to remove any known irrelevant options before looking the string up in your cache to prevent the string from needing to be regenerated. (Or the extra code might slow things down; it's something you'd need to test.)","name":"Anonymous","time":1589005177,"last_modified":1589005177,"board":"b","cites":[{"post":"3462","board":"b","host":"3436"}]},{"no":3462,"resto":3436,"com":"[c b|3436|3460]\>\>\>/b/3460[/c][br][/br]Map. Sounds better than an object.[br][/br]I guess I should add that data is stored as a component_string and a last_used_time. When the cache is filled it's going to boot out the oldest item. This way popular things don't get removed from a cache causing temporary slowdowns and when a googlebot crawls every page it doesn't impact viewers.[br][/br][br][/br][c b|3436|3461]\>\>\>/b/3461[/c][br][/br]It's crossed my mind but it's trying to predict the outcome of results when it might not always be black or white.","name":"Anonymous","time":1589008882,"last_modified":1589008882,"board":"b"},{"no":3464,"resto":3436,"com":"If you want the cache to do you any good, it's probably a good idea to minimize the number of options that can affect the HTML of a post.","name":"Anonymous","time":1589010164,"last_modified":1589010164,"board":"b","cites":[{"post":"3465","board":"b","host":"3436"}]},{"no":3465,"resto":3436,"com":"[c b|3436|3464]\>\>\>/b/3464[/c][br][/br]yeah, only the necessary settings are put into a cookie for rendering. I dropped a few things that I didn't think were worthwhile. The 3 cache specific variables of server rendering are embedding thumbnail vs standard embed, Reverse image included or not and post stub, missing(not included) or full post. Even then I could take out the reverse image cookie and put that in localstore. A 200mb cache can hold a lot of 1kb posts. [br][/br][br][/br]The other big thing is the sorting type, but posts are cached so it's just a matter of working out client and server to be consistent.[br][/br][br][/br]Default mode will be where posts are added as you scroll(infinite scrolling) either in the index or inside of a thread so the server won't die when it hits a 1000 post load that it may or may not have fully cached. A page won't be completely loaded unless a GET flag is set or the user sets the option to be given paged mode. The concept of pages could potentially just vanish unless an archive requests it.","name":"Anonymous","time":1589011689,"last_modified":1589011689,"board":"b","cites":[{"post":"3467","board":"b","host":"3436"}]},{"no":3466,"resto":3436,"com":"and an update system is going to be another component so the main server can notify the SSR server that it needs to either adjust contents according to the given message. So things like the WiP score counter, ban messages and edits are accounted for so that the server can stay up to date with that,","name":"Anonymous","time":1589012167,"last_modified":1589012167,"board":"b"},{"no":3467,"resto":3436,"com":"[c b|3436|3465]\>\>\>/b/3465[/c][br][/br]If I were expecting someone to take it to the level of a complete noscript system then someone could potentially cache it all. Every component and build it themselves. [br][/br][br][/br]I'd also like people to maybe prefer using a desktop application for kissu([u https://www.electronjs.org/]https://www.electronjs[wbr][/wbr].org/[/u]) or mobile app([u https://reactnative.dev/)]https://reactnative.dev/)[/u]. [br][/br][br][/br]So the server side rendering is only one piece of my plan here and things can be done through direct HTTP server messages.","name":"Anonymous","time":1589012406,"last_modified":1589012406,"board":"b"},{"no":3476,"resto":3436,"com":"wish I was a tech wiz","name":"Anonymous","time":1589155620,"last_modified":1589155620,"board":"b","cites":[{"post":"12316","board":"b","host":"3436"}]},{"no":12316,"resto":3436,"com":"[c b|3436|3476]\>\>\>/b/3476[/c][br][/br]be the change you want to see in the world","opt":"sage","name":"Anonymous","time":1709260073,"last_modified":1709260073,"board":"b"}],"similar_threads":[{"no":13175,"com":"[s quote]\>Lap:[/s][br][/br]#7808[br][/br][br][/br][s quote]\>Countdown to Al-Saud GP:[/s][br][/br][br][/br][s quote]\>Previous thread:[/s][br][/br]gone[br][/br][br][/br][br][/br][s quote]\>Fernando Alonso F1 Grands Prix since last win:[/s][br][/br]205 (204 starts)[br][/br][br][/br][s quote]\>Nico HΓΌlkenberg F1 Grands Prix without ever scoring a podium:[/s][br][/br]234 (231 starts)[br][/br][br][/br][s quote]\>2025 WDC Standings[/s][br][/br]NOR: 77 (+15)[br][/br]PIA: 74 (+25)[br][/br]VER: 69 (+8)[br][/br]RUS: 63 (+18)[br][/br]LEC: 32 (+12)[br][/br][br][/br][s quote]\>2025 WCC Standings[/s][br][/br]McLaren Mercedes: 151 (+40)[br][/br]Mercedes: 93 (+18)[br][/br]Red Bull Racing Honda RBPT: 71 (+10)[br][/br]Ferrari: 57 (+22)[br][/br]Haas Ferrari: 20 (+5)[br][/br][br][/br][s quote]\>2025 WEC Standings[/s][br][/br]LAW: 323.96 (+79.17)[br][/br]HAM: 260.36 (+62.50)[br][/br]SAI: 253.06 (+48.96)[br][/br][br][/br][s quote]\>News:[/s][br][/br]4chan has died[br][/br]/f1/ remains","title":"/f1/ - Relentless Formula One General - End of Days..","tn_h":144,"tn_w":255,"board":"b","ext":"gif","file_id":"1744745127269"},{"no":13311,"com":"Can the mods tell me why you locked my thread instead of deleting it? Was it because you didn't want it to show up in the bans list?","title":"Can the mods tell me why you locked my thread instead..","tn_h":255,"tn_w":193,"board":"b","ext":"jpg","file_id":"1745136594981"},{"no":13339,"com":"I post here whenever someone's IP gets permitted.","title":"Rangeban Whitelist Thread","tn_h":218,"tn_w":255,"board":"b","ext":"png","file_id":"1745212335690"},{"no":13419,"com":"Do you think on /b/ we can have a thread where we discuss and add more emotes to the yukkuri stream and also maybe ask verm for a better way of autocompleting them and maybe making some emotes in this thread that'd work while trying to adhere to some core design of not making anything too obnoxiously large or whatever? Also change the stream intro?","title":"Do you think on /b/ we can have a thread where we discuss..","tn_h":255,"tn_w":180,"board":"b","ext":"jpg","file_id":"1745369089957"},{"no":13551,"com":"I'm thinking about purchasing an adspace on 4chan now that it's back so we can make it clear alternatives exist and there are greener pastures like our beloved Kissu.[br][/br]I just need the right banner, was thinking about a desktop header for all japanese-related boards. I just need a good banner, needs to be 728x90. I could make one myself but I'm not super good at Photoshop.","title":"I'm thinking about purchasing an adspace on 4chan now..","tn_h":255,"tn_w":255,"board":"b","ext":"jpg","file_id":"1745742531035"},{"no":13682,"com":"[ul]I've got a couple of things that Kissu has had on the backlog for a while.[/ul] Some new, some old.[br][/br][b][e]I want to know if there's anything to add to this list[/e][/b]. [br][/br]It's a bit disorganized because some features blend into others. Like adding a better search to kissu would also tie into building up an archive where posts are stored longterm in a more compressed form.[br][/br]I'll make a poll to see what's most desired later. But I wanted to give the chance to bring up anything I may have forgotten. [br][/br]Like maybe there's a more general maintenance goal that's requested or perhaps some 4chanX feature exists you'd like to see moved over.[br][/br][br][/br]This is more a preliminary check to see if I missed anything for a future poll and to gauge any interests.[br][/br][br][/br][ul]New Websites for more features[/ul][br][/br][b]A Search feature as a new website[/b][br][/br]This combines with: [b]Longterm Archive feature as a new website[/b][br][/br][b]A cross site threadwatcher as a new website[/b]. An idea I spoke of here [u https://kissu.moe/qa/thread/151827#qa-152927]https://kissu.moe/qa/thread/151827#qa-152927[/u]. With stats tracking(replace marge.moe)[br][/br][b]Stats tracking website[/b] as I said above. Just ties into the idea of a threadwatcher[br][/br][ul]Vichan replacements[/ul][br][/br][e]This divides into several concepts each distinct:[/e][br][/br][b]moderator panel remakes[/b]. The thing that might be interesting here is working out a way to encrypt data such that only admins with private keys can see IPs and other sensitive info. Otherwise it's scrambled in the case of a hack.[br][/br][b]Server side posting+reporting+dele[wbr][/wbr]ting software remakes[/b][br][/br][b]Replace MySQL database with a more contemporary solution[/b]. Of the same idea but a separate task.[br][/br]The end results of these goals would be making kissu's older software open source while the new one continues being hidden/proprietary.[br][/br][ul]UI Rewrites[/ul][br][/br][b]Into another framework(svelte)[/b] to create better performance and remove technical debt[br][/br][b]Tauri Desktop App + Mobile application[/b]. Which also ties into the above since it would be a new framework.[br][/br][b]New HTML page to replace Vichan's Twig templaters[/b]","title":"PrePoll Feature Check","tn_h":255,"tn_w":171,"board":"b","ext":"jpg","file_id":"1746575851356"},{"no":13912,"com":"Ewww, why is this in C*m*c S*ns?","title":"Ewww, why is this in C*m*c S*ns?","tn_h":128,"tn_w":255,"board":"b","ext":"png","file_id":"1749304667643"},{"no":14025,"com":"Did you hear them say the wrong thing and continue travel?","title":"Did you hear them say the wrong thing and continue..","tn_h":255,"tn_w":255,"board":"b","ext":"jpeg","file_id":"1752662568107"},{"no":14201,"com":"Why does this site have a Steam chat, but not a Steam group?[br][/br][br][/br]Verniy, make us an official Kissu Steam group: [u https://steamcommunity.com/actions/GroupCreate]https://steamcommunity.com/actions/GroupCreate[/u]","title":"Why does this site have a Steam chat, but not a Steam..","tn_h":225,"tn_w":225,"board":"b","ext":"jpg","file_id":"1756190315705"}],"reply_count":22}] ;window.page_no=0