« first day (2444 days earlier)      last day (2504 days later) » 
00:00 - 21:0021:00 - 00:00

9:00 PM
> Every programmer educated in the recent centuries should be more familiar with 0xFF than with his girlfriend, if any.
lol
 
user1804599
@fredoverflow PHP uses | -size instead of % size for finding hash table buckets, because it's faster when you know the size is a power of two
 
@rightfold Do you mean &(size-1)?
 
user1804599
@fredoverflow they did that before, but they switched for some reason
 
user1804599
They cast to unsigned after the negation though
 
user1804599
And they cache it
 
user1804599
9:06 PM
It's a field in the hash table structure that is set to (unsigned)-size whenever size is updated.
 
user1804599
I think it has to do with -0 being 0.
 
user1804599
And they use 0 as some sort of sentinel value
 
@fredoverflow Timely obfuscation
 
user1804599
9:34 PM
I so much prefer everything lowercase in my code.
 
user1804599
This is one thing I really like about C++.
 
you can always go lisp
 
user1804599
Please define "lisp".
 
user1804599
 
Beetje sloppy. Tweet more.
 
user1804599
9:48 PM
???
 
user1804599
What's sloppy about it?
 
user1804599
Oh OK.
 
It seems a bit long winded.
> "Je doet niet je best
Als je niet test"
> "Al doe je zo je best,
Het is niks zonder test"
 
user1804599
But I like having an additional line that doesn't rhyme
 
user1804599
So I have a mapping from timestamps to floats
 
user1804599
9:53 PM
Actually
 
user1804599
So I have a timeline cut into consecutive chunks of equal duration
 
user1804599
And some of these chunks are ocupied by N floats, where N is the same for each chunk
 
user1804599
It is only ever read from and appended onto
 
user1804599
What would be a nice data structure for such a sparse list of chunks?
 
@rightfold Then make it Haiku
 
user1804599
9:55 PM
Maybe I can use a hash table.
 
@rightfold wut - can you make it semantically rich (human)
 
user1804599
OK w8
 
Ah. I get it now. "occupied" (lol). But yeah, you have data for some chunks, and if there's data, you have N of it.
Seems a nobrainer: any associative (chunk, optional<data_t>) container. Which one depends on what kind of indexing
 
user1804599
 
user1804599
Black ones have floats in them. Gray ones are all NaN and can be omitted from storage.
 
user1804599
10:01 PM
A tricky thing is when appending, I want to append onto a specific point in time. I will have to find out which chunk that point in time is in.
 
user1804599
And I append a sequence of values, which may overflow a chunk.
 
user1804599
But I can just loop over the values and append each one individually.
 
user1804599
If I use std::unordered_map then it automatically creates new chunks when I use operator[]. :D
 
@rightfold ICL might be interesting icl::interval_map<std::chrono::time_point, circular_list<8, float> >
 
user1804599
I don't know the chunk size at compile-time though.
 
user1804599
10:05 PM
But I can just use boost::container::small_vector or std::vector.
 
That's too flexible in the time domain, but you could have very nifty stuff using combiners (e.g. if chunks are 1h wide, you could say ds.add(interval::right_open(10_oclock, 13_oclock), 4.15f) and have it update the 3 slots involved, regardless of how many items were already there
@rightfold ^
 
user1804599
So I have an array of floats, and I want to append this array onto the container, starting at a specific time point.
 
That's still more flexible than you require (since map keys are "logically" not fixed-width)
 
user1804599
Thanks, I'll look into Boost.Icl.
 
10:07 PM
@rightfold Oh, you mean, across subsequent time slots?
 
user1804599
Yeah.
 
user1804599
For example you may have a chunk width of 2s, with 10 elements in each chunk.
 
user1804599
And then you want to insert 10 elements, starting at time 1s.
 
user1804599
Then five will go in the second half of chunk 1, and five will go in the first half of chunk 2.
 
What is the real goal. Perf statistics?
 
10:12 PM
@rightfold How sparse?
 
inb4 it's bursty
 
user1804599
Very sparse.
 
user1804599
auto& chunk = chunk_at(now());
for (auto value : values) {
  if (chunk.size() == chunk_size) {
    chunk = next(chunk);
  }
  chunk.push_back(value);
}
 
user1804599
I imagine this working.
 
user1804599
Where chunk_at returns the chunk that contains a point in time.
 
user1804599
10:15 PM
And next returns the chunk following another chunk.
 
It's code. It will work.
 
user1804599
Both allocate as necessary.
 
Without semantics, I'm not going to guess anymore. I don't know of any real life things that overflow in 8 floats, and wrap in time.
Or at least, I'm unable to think of one now.
 
user1804599
It's just a function from time to floats, cut into chunks
 
nwp
@rightfold oh noes, unnecessary copies!
 
user1804599
10:17 PM
@nwp decltype(value) is float.
 
@rightfold In that case, yes, I'd probably at least start with a hash table.
 
nwp
that's not really an excuse
 
A microscopic view of a spider embryo! (Photo: @austmus) https://t.co/v9KVRX9n1M
/cc @Mikhail
@nwp It is though, because references obscure some optimization opportunities (I don't it plays into this simple code, but still)
 
10:31 PM
Good evening everyone. I mean everyone.
 
Including Jerry Coffin?
3
 
@sehe Is that inside the egg before hatching?
 
@sehe what a cutie
 
@iksemyonov I dunno, you'll have to find the source
@jaggedSpire By implication, no
 
@jaggedSpire Starred, no comments. @JerryCoffin hello. They made me say hello.
I was just reading your answer stackoverflow.com/a/9814453/342384 and really felt like dropping in to say thanks for a nice writeup.
 
11:01 PM
@iksemyonov Hello.
 
@JerryCoffin Sorry, the joke now lives a life of its own..
 
@iksemyonov These things will happen.
 
@JerryCoffin I find my messages starred randomly you know, today I even starred one myself..
 
@iksemyonov Can you star your own messages? I did't know it was possible.
 
@JerryCoffin Not sure, today I starred @jaggedSpire 's pun
Ha, indeed, I can't.
 
11:12 PM
@iksemyonov Its from a famous study on gene duplication, when a spider has has a single copy of a gene they get stubs, when they have two copies they get knees.
 
@JerryCoffin I've made an edit to your answer.
 
Curiously, you can actually keep the spiders without knees a live for a long time
 
@Mikhail Is that for serious? An invalid spider?
 
sorry wrong paper
But yes, that paper did happen
 
Isn't that the same sort of thing that produces crippled human children, a gene mutation? Meaning, that can happen to species as "primitive" as a spider?
 
11:15 PM
Yes, but crippled humans aren't necessarily the product of mutation, and often how the mutation is expressed is very different, and is difficult to de-couple from other abnormalities
 
I know that spiders aren't primitive, I say that in the perspective of human complexity, of course.
 
In that study they "cleanly" edited the genome
 
Sheesh
Well, a spider is dumb, and that was for the sake of a better future, so alright.
 
back in the 90s people figured out that its easy to get insects to have body parts replaced:
 
Re-programming the genes before birth?
 
11:17 PM
Yeah
 
But if I recall correctly, the only creature with a fully decoded genome is that cute worm thing? Meaning that this insect programming was performed with only partial knowledge of the gene code, and that sufficed for the task.
 
The human genome has been, mostly sequenced. You can probably do a de-novo analysis for $100k
Right now there is a big "push" to study emergent behavior trying to understand the role of geometry vs gene expression in developing organisms. Its not clear, for example if, or how, each cell "knows" where its located.
At present, either the cell "knows" its location or there are other unaccounted chemical signals. The mechanisms of this stuff, is at present an active area of research.
Also this is what Western Europeans do instead of looking for a cure for cancer
2
 
considering that cancer is a genetic disease, studying genetic mechanisms sounds like a valid area of study
and secondly, I'm not all that convinced that curing cancer would be a good thing
we already can't afford to support the older people we have, and we have no way of preventing them from just dying again in five years time of heart disease or some other thing
extending people's lives to be happy and productive for longer takes a lot more than just "X killed them? Cure it!"
 
Bert Vogelstein had a "bullshit" paper where he claimed that 2/3 of mutations that lead to cancer are due to pure chance.
Its interesting to evaluate the various financial stake holders in such a conclusion. For example, it makes Tobacco manufactures happy while pathologists - many of who recommend costly screening based on supposed "high-risk" groups might no longer have a biological motivation for establishing these groups.
 
user1804599
Puppy the oncologist
 
11:29 PM
hello
 
Also my paper in Cancer Research got rejected because an actual pathologist reviewed it :-)
 
@Mikhail Starred for mild, righteous, burn.
@user2601177 Are you a bot?
 
no, i just haven't set my username
/r/totallynotrobots
 
Right. I know what usernames are. And I asked about the other thing. So, that's what I expected then.
 
11:50 PM
xD
 
00:00 - 21:0021:00 - 00:00

« first day (2444 days earlier)      last day (2504 days later) »