« first day (2175 days earlier)      last day (2770 days later) » 

user1804599
8:05 PM
I want to store a hash table on disk.
 
@rightfold Do you want to be able to manipulate it on disk, or just write it out, read it back in, and re-generate a similar hash table from what was stored? What sort of collision resolution are you using?
 
@Mysticial JSON is much easier than xml ^^; Well done
 
alright
I rendered the world's most boring React component
 
user1804599
@JerryCoffin Read and write entries independently, on collision retain both entries.
 
user1804599
A multimap.
 
8:10 PM
sigh I'm doing a few answers to up my rep and help out with questions and it looks like one of them was downvoted because my code-from-memory that had slightly incorrect syntax (or because the other answerer was protecting their answer). ...anyways, no big deal.
To what extent should I thoroughly research/validate an answer before posting in comparison to iteratively fleshing it out after posting?
@Puppy An imaginary one?
 
no
I rendered a frame counter in the top-left corner of the screen
 
Oh, that's not too bad. It can be made into a fun game of trying to drop the frame rate significantly.
 
Ell
ohey
TIL y++ + y++ is now defined
 
user1804599
lol
 
8:28 PM
@Aaron3468 XML is fugly.
For that matter, I consider JSON to be fairly ugly as well with the key-quotes.
So I did away with that.
 
user1804599
S-expressions.
 
@rightfold The question is whether you want to support manipulating the data as it exists on disk (like a database) or whether it's just a serialized form of a map--i.e., you manipulate data only in memory, and use the disk only to persist state between executions. Looked at slightly differently, might you need to store more data than will fit in memory at once?
 
user1804599
The entries are read-only.
 
user1804599
Yeah, it'll be a lot of data.
 
download moar ram
 
8:34 PM
> Syntax error
> Syntax Error
> Syntax error
LOOKS VALID TO ME, OCAML, WANNA GIVE ME A HINT AS TO WHERE?
Salts the earth.
 
user1804599
SSCCE.
 
I dun wanna. I feel stupid already. :<
 
Did I just enter Lounge<OCaml>?
 
user1804599
No SSCCE, no help.
 
Maybe I don't want help. Maybe I just want to Rage Against The Machine.
 
8:40 PM
> Syntax error: **** YOU I WONT DO WHAT YOU TELL ME
 
@rightfold Are you set on writing your own, or are you willing to use existing code? Do you want a server process or code to embed into yours? Do you want high availability/distributed storage? Not to be a pest about it, but the number of variations is why there are ten zillion different key/value storage engines around.
 
@ThePhD problems?
 
So, as a quick question.
If you want to have a function in OCaml take multiple arguments
the way to do it is to instead take something with 1 or 2 arguments, then return a function, and then have that take 1 argument, and then return?
... Did nobody think to, I dunno. Make syntactic sugar for that?
 
@ThePhD What?!
 
@ThePhD Are you trying to make your code bland? That sounds like de-currying
 
8:44 PM
I'm trying to make my code work.
 
(or currying, depending on what exactly you're doing)
 
By trying out weird transformations and hating myself for doing it.
 
@rightfold For a server process, I'd consider Ambry. Specifically designed for BLOB storage (i.e., chunks of immutable data). I don't know of any for embedding that's oriented specifically toward immutable data; my first choice would probably be Symas LMDB.
 
Ell
@ThePhD functions are curried by default
I'm p sure
 
@ThePhD Show me the code that doesn't work for you.
Because there's no limit to 2 arguments or any other nonsense like that; functions are curried by the language (...that's how you stay sane in purely functional languages...).
 
8:50 PM
I think I'm being haunted... Whenever I post an answer, a pedant interjects because although I conveyed the content of the answer, I failed to use the proper jargon in one sentence. I think I need a duck to overcome this reliably-consistent pedantry.
On one hand I understand the need to have concise, accurate terminology. On the other hand, many newbies don't have the capacity to learn from an answer which relies on this terminology. I'm not writing answers for the experts...
 
@ThePhD I'm serious - it's useless to senselessly fight with simple things when others want to help. You'll spend your fair share of time fighting with non-simple things we can't help you with, so please stop wasting your own time! :P
 
9:15 PM
Professor's not gonna meet with me for a while...
Guess I'm fucked.
@Griwes Sigh.
 
why would an AVL tree rotation complexity be O(logn) if there is at most only 2 rotations per insertion to an AVL tree? Is this for delete cases?
 
Because you still ahve to traverse through the tree, don't you?
 
@ThePhD Yes, isn't that the traversal/search complexity common to BSTs?
once you reach the point, the actual rotation is at most 2 rotations, and then balancing back up to the imbalanced point
 
Yes, so even if you have a +2, in BigO notation that just gets erased and you're left with the actual complexity which is logN, right?
 
but then why is the red black tree given a rotation complexity of O(1)?
don't you need to search down to the insertion point for that too?
:33178940 ok but if the constant time gets washed out from the log time, then shouldn't the constant rotation of the red black also get washed out by it's equally log time complex search to the insertion point?
 
Ven
9:24 PM
@ThePhD it's all done for you.
 
I guess I don't know anything about red blacks except they're balanced and BSTs. There must be a trick to get to the insertion point faster than in the AVL
 
Ven
You've been using it since day one with let add a b = a + b
That's sugar for let add = fun a -> fun b -> a + b
 
Big O notation is reliant on how many elements are iterated. Generally, all operations carry a constant cost. For example, if each insertion takes 8 seconds, it is not reliant on the number of elements, thus it is a complexity of O(1); constant. It's a similar idea; 2 rotations is a constant cost. It won't change as you add more layers.
If I recall, red-black trees don't require searching because of the way they are partitioned. Hold on while I fact-check
 
@Aaron3468 Right, then why is it stated often that the rotation complexity of AVL is log n time while that of the red black is constant time?
 
Ven
@Aaron3468 it's binary search basically
 
9:29 PM
@EwokNightmares No--traversal is just like in AVL. RB does insertions a little faster (and searches a little slower) because it tolerates the tree getting a little more out of balance so it typically doesn't re-balance as often.
 
Ven
... Iirc
 
@EwokNightmares Here we go. No major difference between them, aside from features that will affect performance depending on platform capabilities.
 
If AVL is logn time on rotation, that would imply the number of rotations can vary
@Aaron3468 ok but that is specifying "insertion"
but rotation is part of the insertion, and I read that red/black is constant rotation time and avl is logn rotation time
just freaks me out after I write a couple hundred lines of code based on the assumption I only have to do a couple rotations ever
if I have to recursively rotate as I balance up the tree I could see it taking logn time
 
Relevant. You won't do many rotations, but insertion is O(logn) amortized to O(1)
 
but I don't think that's how it works
@Aaron3468 interesting, thanks for finding that
 
9:36 PM
@EwokNightmares This is comparing apples to oranges. For both, the worst case for any individual insertion is O(log N), and amortized complexity is O(N).
 
Any minimax connect 4 algorithm? I am trying to do it but I don't understand how to code it.
 
@JerryCoffin Amortized O(n)?
 
I know theoretically what minimax means, but not how to code it.
 
@EwokNightmares Yeah, no worries. It looks like the red-black tree can perform very efficiently in many cases, but has the same worst-case as an avl tree. Do note that insertion was a mistake; restoring red-black properties is what amortizes to O(1)
 
@wilx Yes--as you insert a large number of items, the average time per insertion will tend toward a constant.
@Aaron3468 Re-balancing is normally treated as part of the insertion.
 
9:45 PM
Is there a way to jam up a tree so that your past insertions make it impossible to get to a free node?
if you have fixed memory size
 
I prefer honey on my trees
 
I mean so that you can't insert new nodes even if there is space in the tree for it
 
> I usually try to clear my doubts with youtube videos […]. COULD YOU RECOMMEND ME SOME VIDEOS TO INSTRUCT ME ON THE MATTER OR ANYTHING AT ALL REALLY? Thanks
 
@EwokNightmares At least in most cases, the tree itself has no notion of running out of space. You're normally allocating memory for the nodes from the heap. It's certainly possible to fragment the heap to the point that you can only allocate small pieces. Most garbage-collection based systems can (and will) compact the heap as part of garbage collection, preventing this problem.
 
@JerryCoffin I'm using a fixed size array to hold my nodes and traverse with index increments and shifts
so I know the maximum height possible for the tree
 
9:53 PM
@EwokNightmares I'm sorry to hear that.
 
@JerryCoffin lol
 
Bet it's a repost
 
It's supposed to be a frequently updated interval tree and only holds 5 bytes per element, and 3 of those bytes are the balance/max interval information that would be in a pointer based implementation too
so I only need to assign/clear a data pointer to copy the element
 
I remember looking into making vim understands template instantiation backtraces and being relatively disappointed by the compiler errors handling facilities. Now Rust has improved diagnostics that sometimes report more than one location per logical error and this may or may not affect rust.vim cc @R.MartinhoFernandes @sehe
 
> We've also been talking about standardizing a JSON output for the compiler so that IDEs can get more information that way.
there's a thought
 
10:01 PM
Wide beat them to it as per usual ;p
 
@ThePhD What? I'm serious!
 
@sehe if the examples they gave us are representative enough then from the point of view of a machine it’s more or less the same format
 
@Puppy vapor ware is always very quick to market
 
10:16 PM
I saw that coming.
There's code that does something in there, though, so it's not very literal vaporware.
 
Actually literal vapor wear
 
10:45 PM
@LucDanton Oh, it breaks everything :/ I can't get proper navigation with the nightly, only stable.
And I'm not yet ready to dive into the abyss of errorformat
 
> Turns on new errors by default (and removes old skool)
@R.MartinhoFernandes no more old format I think
@R.MartinhoFernandes I can’t find online information on what --error-format accepts outside of =json
 
@LucDanton I meant the vim option.
 
I know, I was suggesting you go back to rustc emitting whatever rust.vim is used to
the --error-format that would plug into 'errorformat', if you will
 
11:37 PM
@R.MartinhoFernandes Obviously there's only one way real way forward here: write code without errors.
 
makes sense
 
@LucDanton Being able to ignore errors simplifies compiler design tremendously as well.
 

« first day (2175 days earlier)      last day (2770 days later) »