« first day (1623 days earlier)      last day (3311 days later) » 

Xeo
6:00 PM
Maybe not quite generic enough, but not wrong
 
Would be better with scoped enums, but the answer predates them
 
Dammit. Gonna need 20% more storage to detect the bottom of recursion.
 
Xeo
This is complete nonsense. Which member of AnimalFlags is represented by the expression HasClaws | CanFly? This is not what enums are for. Use integers and constants. — Lightness Races in Orbit 10 mins ago
Aaaand you're wrong there
The domain of an enum type is the domain of its underlying type - it's only that certain ones have been given a name.
 
Or... I can hoist that into a parameter and now I only need O(log n) storage.
Nice.
 
@CatPlusPlus Figure out the physics, or user-friendly controls?
 
6:03 PM
Ha, I'm going all PhD on this.
 
Xeo
wat
"going all PhD" is a sign of insanity
> im Moment greifen zu viele Nutzer gleichzeitig auf unser Buchungssystem zu.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
union cell {
    struct { cell* quadrants[4]; cell* future; } macro;
    bool micro;
};
No tag!
 
lol
 
Wait.
Why keep the surrounding struct anyway.
 
Xeo
@R.MartinhoFernandes and you'll know how to access what how?
 
6:06 PM
wtf r u doing
 
5 mins ago, by R. Martinho Fernandes
Or... I can hoist that into a parameter and now I only need O(log n) storage.
 
@Xeo Yes, I'm aware that it's legal to make that conversion.
@Xeo It's just stupid.
 
Xeo
@LightnessRacesinOrbit It's not. vOv
 
@R.MartinhoFernandes What are you doing, exactly?
 
6:07 PM
@Xeo Now I privatise the contents of the union and the members will know how to deal with it.
 
seeing a union out of you is uncharacteristic behaviour
 
@Puppy Implementing Life.
 
as in, game of?
 
i see
 
6:08 PM
Wanna support gigantic boards and trillions of generations.
 
I thought that was accomplished mostly by having the board be represented sparsely rather than densely
 
@Puppy That's what the cell above is.
 
Xeo
Bahn.de's trolling me.
 
@R.MartinhoFernandes std::unordered_map<BoardPosition, Cell> board;?
 
Xeo
I change days twice in the ticket finder, and it presents me with that inane message.
 
6:09 PM
@Puppy Ah, but that gets slow really fast.
 
how so?
it's a hash table- you get O(1).
 
You O(N*T) on the size of the board N and number of generations T.
You can get a lot better than that.
 
nah
the board only has a Cell member for each alive cell.
a "dead" cell is represented by not being in the board at all.
then the size of the board is effectively irrelevant.
 
@Puppy No, it's not; not when you consider patterns that grow polynomially, or exponentially.
 
Yay reinstalled windows
IE is such a great browser
 
6:11 PM
@R.MartinhoFernandes Sure, but that's number of cells, not size of board. And I don't see how you can do better than number of cells * generation number.
 
Xeo
@R.MartinhoFernandes Hm, that's a smart representation.
 
@Puppy You can compute polynomially-growing patterns in logarithmic time and space.
 
how?
 
Hashlife is a memoized algorithm for computing the long-term fate of a given starting configuration in Conway's Game of Life and related cellular automata, much more quickly than would be possible using alternative algorithms that simulate each time step of each cell of the automaton. The algorithm was first described by Bill Gosper in the early 1980s while he was engaged in research at the Xerox Palo Alto Research Center. Hashlife was originally implemented on Symbolics Lisp machines with the aid of the Flavors extension. == Hashlife == Hashlife is designed to exploit large amounts of spatial...
 
Fresh Windows install, with IE instead of chrome, RAM usage dropped from 3.5+ to 1.8 GB
 
6:12 PM
@Puppy By reusing subpatterns. And reusing iterations of those subpatterns (the future pointers in my structure).
 
hmm
deduplication is a nice touch but I guess that I'm only seeing that benefit in the case of specific patterns.
 
@Puppy Life is ripe with them.
 
mm and my Office and Onedrive should come soon
with the tablet I bought hopefully
nice
reinstalling windows almost feels like buying a new PC
now I wonder if I should install Haskell Platform or Haskell compiler directly
and whether to get MSYS
 
@Puppy Especially when you consider the deduplication across time.
 
user1804599
so what's with the Factorio thing
 
6:16 PM
A thousand gliders moving across the plane end up costing only retrieval time.
 
user1804599
when's the release?
 
What the fuck happened to the starboard?
lol
 
Someone polluted it
 
Xeo
> Hashlife is also significantly more complex to implement. For example, it needs a dedicated garbage collector to remove unused nodes from the cache.
huh
 
@Xeo You can also not garbage collect anything and leave nodes for future runs :D
 
Xeo
6:20 PM
lol
 
@BartekBanachewicz I booted into windows today. Used it for 2 minutes, waited for 35 minutes for it to shutdown. Obviously, that is to be expected since the last time I used windows was 2 weeks ago, so you get the barrage of updates (o.O)
 
Xeo
inb4 patterns that are never reused :P
 
I.e., when you start a new world, you don't have to discard the cells from the old one.
 
@sehe Dunno, I typically set updated to auto install so I don't get things like that
 
Xeo
@R.MartinhoFernandes That can explode quite nastily, no?
 
user1804599
6:22 PM
aaa ADL
 
@AndyProwl as much as it pains me to betray another bear, I strongly suspect the koala.
Although if we accept the "purely random noise" hypothesis, then anyone¹ could be to blame (¹ having lost their mind)
 
user1804599
#define noadl(f) (f)
noadl(f)(x)
 
user1804599
:D
 
@BartekBanachewicz Of course you do. Hint. Auto install doesn't function when you're booted into linux
 
@Xeo FWIW, it's simple to do an aggressive cleanup: start at the root, copy all cells it touches to another container, destroy the old one.
 
Xeo
6:23 PM
@R.MartinhoFernandes Yeah, simple reachable scan
 
I'll see if it's worth adding something fancier with access times.
 
@sehe the easy solution is to not use Linux as userspace system
 
Access time is tricky here.
The algorithm doesn't do "time".
It's all "space-time".
 
@sehe That would not be no(o)ble of him
 
You can easily end up reusing cells from the "future".
 
Xeo
6:25 PM
Btw @R.MartinhoFernandes, are you going to allocate the cells dynamically? Gotta have to, right? Else you'de invalidate them all the time
 
@Xeo Yeah.
Er. no.
Lemme think.
 
clearly yes.
 
Well, not directly, I mean.
I think I'll just stick them in a deque.
Then keep a hash table with pointers.
 
Damn: 8 cores and 128GB on a Mini-ITX I want one of those.
 
Xeo
right, that's also an option
 
6:30 PM
Oh, wait, rehashing doesn't invalidate references.
Just the hash table, then.
 
I think that it can?
 
Iterators it does. Not references.
 
I don't quite recall, but I think I remember being quite pissed off that unordered_map's invalidation guarantees were shit.
 
The implementation keeps the bucket nodes and merely relinks them.
 
Xeo
@R.MartinhoFernandes oooh, right
 
6:32 PM
not sure why that would i nvalidate iterators
 
slack hacked
 
@Puppy They know which bucket they are iterating at.
 
maybe their ordering would change, but I don't see why the actual iterators would become invalid
 
@Puppy Well you could maybe continue iterating, but risk iterating through items you did before, or some items never being iterated through.
Doesn't seem very useful.
 
Why the fuck am I in front of my computer on a friday night?
 
6:33 PM
or, say, erase the element.
 
@Puppy More precisely, an existing iterator could all of a sudden become an end iterator.
I think invalidation is the right choice there.
 
hmm.
I think that in Wide I will make the hash map in the library offer linked-list invalidation guarantees.
 
How do you do that without tracking and updating all existing iterators?
 
from memory
 
6:36 PM
What?
 
all you have to do is make the items be stored in a linked-list, then make the objects in the bucket be pointers to items in the list.
 
posted on March 27, 2015 by Raman Sharma

Earlier this week we announced the availability of the first preview of the Visual Studio 2015 tools for building Windows 10 applications. C++ continues to be an important language for building Windows apps and in this blog post, we want to highlight...(read more)

 
or iterators into the list.
then on erasure just erase that item from the list and the bucket.
then the iterators into the container don't need to give a shit about the buckets and what happens to them.
 
Xeo
@Puppy That's the typical implementation
 
and the order of the list doesn't change on erasure or insertion.
I need to cook food for my guests tomorrow
first time using my new lidless pan.
 
user1804599
6:41 PM
Shit, stack overflow error.
 
@Puppy Ah. Well the committee wanted to avoid forcing all those pointers, I guess :S
 
@райтфолд All the building blocks are there .You just need to connect them. (Actually, I remember seeing you using strands. So you know about this stuff. Why don't you like it?)
 
user1804599
 
@R.MartinhoFernandes If the user wants to avoid a couple indirections because he's in a super-fuckin-tight loop, he can re-implement the container as far as I'm concerned.
 
6:43 PM
@райтфолд A strand is a fiber.
 
user1804599
Nice.
 
@райтфолд Oh, right that's what I saw. I misremembered and thought it was using strands.
 
user1804599
I use Boost.Coroutine for fibers.
 
user1804599
Thing is, there's a bug in my JIT compiler.
 
user1804599
The program runs correctly in the interpreter, but the JITted code causes a bus error.
 
6:44 PM
@райтфолд You use a strand to ensure certain things you post on an io_service won't run in different threads.
 
user1804599
@R.MartinhoFernandes Oh, I don't care what thread they run in.
 
@райтфолд of course it does (I've experimented with implementing asio_handler_allocate over tbb::scalable_allocator. But a ringbuffer could probably work here.)
 
user1804599
@StackedCrooked I can optimise out the shared pointer if the functor is copyable.
 
@райтфолд Might be useful for administrative work.
 
user1804599
Ah, I found the stack overflow.
 
6:46 PM
@райтфолд Wait, actually it doesn't guarantee same thread. Only non-concurrent execution.
Similar, but not quite.
 
user1804599
I want parallel execution. That's why I'm using threads in the first place.
 
user1804599
Otherwise I'd do fine with just one thread for code and one for I/O.
 
user1804599
This isn't JavaScript!
 
I really like the asio system. It's a very nice decomposition.
 
It's of course horrible.
 
6:48 PM
@райтфолд lol
 
All C++'s faults.
 
user1804599
std::function in stack traces is nice:
 
yep
stepping through std::function with the debugger is even nicer :P
 
Are anonymous structs in C++ now?
@StackedCrooked Sigh, Visual Studio.
 
user1804599
6:49 PM
@R.MartinhoFernandes I use them with -pedantic, so seems so.
 
user1804599
Yeah. struct : base { }; works.
 
user1804599
Can't have ctor because shitty C++ uses class name for ctor. :<
 
Haven't used VS in the last couple of years. I usually have to do with GDB over ssh.
 
6:50 PM
I meant as members of unions.
sheepish grin.
@StackedCrooked skip
 
user1804599
Oh, that. No idea.
 
Yeah, but it's tricky. You need to skip many times, but not one time too many.
 
user1804599
@StackedCrooked On Coliru you can use printf 'run\nbt\n' | gdb ./a.out. :)
 
@StackedCrooked Er. It's a one-time procedure.
 
I have not yet succeeded in stepping through std::function without accidentally stepping over the actual invoke.
It's true..
I did manage to do that with boost function though.
 
6:53 PM
@StackedCrooked Er. echo "skip file /path/to/libstdc++/dont/remember/the/file/name" >> ~/.gdbinit
 
Oh, right. I haven't tried that yet.
Sorry, I confused skip with step in your former comment.
 
user1804599
aaaa stupid stack overflow
 
Will Linux context switch into a thread if it's blocked on a select? It has to, yeah?
 

« first day (1623 days earlier)      last day (3311 days later) »