« first day (1985 days earlier)      last day (2966 days later) » 

12:00 AM
@sehe No, I just use a framework that's based on reactive and it might do a good enough job
 
:D
 
@JanUlrich Just use a web browser
 
...
defining away the real question
 
When the web browser becomes your GUI host, then you get mostly automatic compatibility with most clients through just their web browser. Even realtime stuff is doable since we have AJAX
 
The browser can't receive on UDP ports
 
12:01 AM
@sehe The browser can be paired with a backend server that can
 
@VermillionAzure could it run on a raspberry pi?
 
@VermillionAzure Byebye lowlat
 
Xeo
@LucDanton hmm, sorry, still doesn't quite ring a bell. guess there might've been something with either figures (though I don't think I would've posted about that here) or games.
 
@JanUlrich that's for sure
 
@JanUlrich I dunno if it's powerful enough to handle everything but most likely if you try to keep things simple
 
12:02 AM
I need a fast browser. More than AJAX support should not be needed.
 
@sehe I guess I'll have to take your word for it (I don't really pay that much attention to piano). I have heard some (famous) violinists make some pretty rude comments about a few composers though. I guess they didn't say the concertos were unplayable, but they did express regret at the degree to which some emphasized (the equivalent of) fireworks rather than real depth.
 
where to get a webserver?
 
user406009
Guys, do you remember if sizeof(*((int*)(NULL))); breaks the rules or not?
 
i thought about NanoHTTP
 
Xeo
@Lalaland doesn't, still bad (use declval)
 
12:04 AM
okay thanks everybody
 
@JerryCoffin Oh yes. That happens. But you can't call yourself "concert pianist" without mastering at least the iron repertory (a Beethoven, Rach, Liszt and perhaps some side dishes like Brahms, Mozart, Prokofiev or even Grieg and Schumann). All of these pretty much spell that you can play that exemplary sonata. With some level of comfort
 
@Lalaland It's an unevaluated context, so the fact that it would otherwise dereference a null pointer doesn't lead to UB.
 
@JanUlrich Maybe try something with Python
 
user406009
Perfect.
 
@VermillionAzure that's not gonna host nodejs? Node comes with it's own AFAIK
 
user406009
12:06 AM
@Xeo This is C code :(
 
user406009
I cry with every line.
 
user406009
All the void* casts.
 
user406009
All the stupid linked lists.
 
@sehe it's own what?
 
... web server?
 
12:07 AM
@sehe I dunno I guess either is fine
@Lalaland Oh goodie you should try generics in C next
 
@Lalaland "Stupid linked list" is redundant.
 
@JerryCoffin At least the singly-linked ones
 
@sehe something should answer the ajax requests to update the GUI (the website rendered by webbrowser). That's how I understand this
 
user406009
@sehe It technically does, but people like to use better one like nginx to serve static assets.
 
@JanUlrich well yes. But you can choose the backend
 
12:09 AM
@JanUlrich yeah that's pretty essential
 
user406009
And just use node for the dynamic content.
 
@Lalaland man can you stick to the topic. oh you're not Cinch. Of course static assets are a different thing.
 
@Lalaland He says he's going to be displaying data based on UDP packet transmission so maybe something reactive might be good
 
^
 
AASN I had this idea that most web frameworks were reactive. And then I tried Django's tutorial and I was confused.
 
12:11 AM
@VermillionAzure I suppose--we probably need a somewhat stronger word than just "stupid" to properly describe doubly linked lists.
 
@JerryCoffin Oh I remember this we had a whole argument on linked lists
 
@JerryCoffin 'doubly stupid'
 
@Morwenn Hm, .. I don't think you can make x <compose> y <compose> z work though.
 
@VermillionAzure I'll take your word for it.
 
user406009
@sehe I should have been more clear. People usually use node and nginx together.
 
12:12 AM
@JerryCoffin I think it was on #programming though
 
user406009
Or node + apache together.
 
yup very much
 
@VermillionAzure If it was, it must have been with somebody else.
 
The question: is a memory-pooled linked list already linked before hand without dynamic allocation still a linked list?
 
Yes. Because it links nodes.
 
12:13 AM
And i was like "well yes" and he's like "but that's not a real linked list but I guess it is"
 
@VermillionAzure Why would that be an interesting question?
 
@JerryCoffin That was his question not mine lol
 
user406009
@VermillionAzure There are some of those as well.
 
user406009
They are still linked lists.
 
user image
15
 
12:13 AM
@VermillionAzure Using pool or not is mostly irrelevant
 
@VermillionAzure I think that's pretty solid assurance that this discussion was with somebody other than me in any case.
 
@JerryCoffin Yeah it wasn't you I remember now
 
user406009
@sehe Valgrind doesn't work either on this codebase.
 
@milleniumbug Could be relevant in a few cases...
 
boost::intrusive has linked lists that don't require node allocation.
 
user406009
12:14 AM
I am truly lost.
 
@Lalaland Perhaps you might want to look into Infer and wait for the future
 
@VermillionAzure What is a linked list then, according to your definition?
 
user406009
@sehe Don't go into HN expecting sanity.
 
user406009
You should point that quote out to Cicada. He loves HN.
 
12:16 AM
I won't
 
@StackedCrooked Wait I said it was. A linked list is a data structure comprised of nodes that keep references or pointers to nodes such that iteration is the sequenced dereferencing of node references or pointers.
 
@Lalaland Added
 
How does pooling affect that?
 
@sehe didn’t work
 
:( But you found it. Thanks for picking up after me.
 
12:18 AM
well, I had clicked it already
 
@LucDanton I think they "fixed" it. It didn't work the other day either
 
@StackedCrooked Eh what I had in mind was some scheme such that referencing and slicing can be statically-decided or something like that. But that's dumb so it's not really a linked list
 
Kinda like boost::mpl::list..?
More like boost::fusion::list probably.
 
@StackedCrooked No idea but it would be a different data structure already because it would have different runtime characteristics
A list with random access due to knowledge at compile-time might as well be an array or vector
 
Dreaming about magic unicorn datastructures
@VermillionAzure Yup. Mathematics is some strong shit
 
12:21 AM
@sehe What are you talking about
 
user406009
@Borgleader That's HN for you.
 
@sehe I'll code something then
 
@Borgleader facepalm --force
12
 
-with-lease
 
user406009
12:28 AM
@sehe That original poster is the gift which keeps on giving.
 
user406009
He just posts BS after BS, all of it making little to no sense.
 
@milleniumbug holy crap :p
I suppose a linked list with pool allocated nodes could be sort of neat. You could have cheap-ish insertion, reordering and whatnot, but you could: iterate linearly over the storage (in unspecified order), or explicitly reorder the storage beforehand and relink the list. You could provide fastbegin and fastend member functions :D
 
@melak47 yup
that's the point of it
 
Theres a flaggot in another room
 
Uh oh, I did not heed the "do not feed the Cinch after midnight" sign.
 
12:40 AM
@melak47 I'd imagine it'd be a good structure for graphs... maybe
 
user406009
@VermillionAzure a practical for example would be like a list of entities in a game.
 
@VermillionAzure ...for a graph with a predefined structure (rather than being build "on the fly" from some external data).
 
user406009
You would want insertion deletion and interation over all.
 
@melak47 However, if the nodes are like a struct Node { Node* next; T t; }; then that still feels like wasteful usage of cache lines :)
 
@JerryCoffin Well you can treat each node as a bucket for edges and then tag on metadata as some sort of tree
 
12:43 AM
Still it would be way better than a classic linked list.
 
@StackedCrooked If i'm not mistaken the used linked list algorithms used in data structures make use of multiple edges stored in one node
 
user406009
@StackedCrooked you could use an int offset instead of a full pointer.
 
If nodes would be allocated inside chunks of a certain alignment then you can use the address of the node to obtain its index inside its chunk.
 
@StackedCrooked Yes that is exactly what could be done and that'd be a huge speedup for iteration too
 
This seems like a cool idea I want to try out some time.
 
12:44 AM
@StackedCrooked of course the node would be a template<typename T, typename NodeOrderPolicy> struct Node { std::tuple<std::conditional_t<NodeOrderPolicy::value, T, Node*>, std::conditional_t<NodeOrderPolicy::value, Node*, T> data; }; :p
 
hint: all of this has been done
 
@sehe most likely
 
and it will be done by me much better :P
 
:)
 
user406009
12:46 AM
The main issue I see is that the fast iteration is arbitrarily ordered.
 
I like the idea of unix file descriptors. They are like pointers, but they internally (I assume) are used as indices into tables. This allows to split storage of data into different tables. And to add tables later. This is also something I want to toy with :D
 
@Lalaland well, if you absolutely need a specific order, you can still forcibly reorder
 
@Lalaland what about unitialized elements
 
In C++ there's many ways to encapsulate it. With operator. it could be made fully transparent.
 
user406009
@sehe yeah, if it's sparse that would be another issue.
 
12:48 AM
@sehe I'd imagine you'd keep the used nodes contiguous, and keep the rest at the end or where ever as spare parts
 
that just makes bookkeeping more expensive
 
if you're willing to pay the move/copy cost
or a sentinel value in the next pointer :D
 
all of this is sounding much more like std::vector<T> v; std::vector<std::reference_wrapper<T> > index(v.begin(), v.end());
 
Steal the 16-bits of unused addressing :)
For profit and fun.
 
@StackedCrooked the what?
 
12:50 AM
Pointers in Linux are 48-bit. 16-bit is unused. You can use that as storage.
 
The 16-bits of unused addressing
 
It's boling down to "keep an external ordered traversal over contiguous elements"
 
However, you need to mask them away before attempting to deref the pointer.
 
@CatPlusPlus phamous softporn book by Linus Rammeloo
 
12:51 AM
x64 uses only 48 bits but I'm not sur which bits those are
 
@StackedCrooked ok, neat. why :D
 
@CatPlusPlus Just guess until it doesn't crash anymore.
 
... go sleep :)
Night all
 
@StackedCrooked what if it's every other bit :p
 
Plus I'm fairly sure that you don't want to do that for forward compatibility
 
12:53 AM
or random :p
 
@CatPlusPlus I actually wonder how much code already (secretly) depends on it.
 
@sehe G'night.
 
@sehe night
 
IIRC even boost uses it somewhere.
But if you use a TagPtr wrapper in C++ then you only need to fix it in one place.
 
@StackedCrooked do member function pointers and stuff use those 16 bits, instead of having strange even larger addresses
 
12:55 AM
I don't know really.
Since member function pointers have the size of 2 pointers so I would guess they just use 2x48 bits.
 
> The bits 48–63 are so-called sign extension bits and must be copies of bit 47.
 
@StackedCrooked with MSVC they can be 3 or 4 different sizes IIRC. I thought maybe it was fun like that on linux as well :p
 
Recomputing the pointer every time you want to actually use it might be more costly than just storing those stupid extra bits
After all you got 48-bit address space
Go hog wild
 
Only measuring will tell.
But yeah, I suppose only in very specific circumstances it would yield a big enough benefit to justify the hackishness.
 
The assholes who want to use pointer bits as flags is why we can't have nice things.
@CatPlusPlus I wonder why it needs to be a sign-extension. Zero should suffice.
Easier to enforce in the hardware.
 
1:21 AM
To make using them as flags more annoying, duh
 
is there a standard way of making something un-optimizable?
 
Replace all calls with RPC calls.
Blocking RPC.
Using SOAP.
 
I meant in the sense that the compiler won't optimize it away, not that I want to make it slow :P
 
Over serial port.
@JakubArnold Oh.
volatile and asm volatile.
 
@JakubArnold For what purpose? If it's for microbenchmarking, just use the result.
 
@StackedCrooked those weren't portable no?
 
dunno
 
@Mysticial I was toying with spinlocks, and also some benchmarking/testing purposes
I gotta watch his video again :\ @StackedCrooked do you remember which one it was where he showed the real cool ones?
 
When benchmarking always make sure the input parameters to your routine cannot be determined at compile time. And make sure the output is printed or returned to somewhere the compiler can't see.
I.e argc as input and exit code as output :)
 
hmm, how about global variables? like if I make the loop index static/global, the compiler probably can't assume nobody else touches a global variable, right?
 
1:42 AM
// I often use this trick:
int const volatile volatile_zero = 0; // global
volatile int volatile_sink;
int a = 0 + volatile_zero;
int b = 1 + volatile_zero;
auto result = benchmark(f, a, b);
volatile_sink = result;
@JakubArnold Global variables can be cached in register.
However, any non-inline function call will trigger a flush to memory since the compiler doesn't know if the implementation will read/write to the globals.
 
hmm the volatile trick seems nice ... but huhm, I'm surprised why "any non-inline function"? what if the function is completely empty?
I feel like I should read the whole c++ standard just to get a better grasp on these things ... most of my "intuitions" seem to be wrong every time I ask a question :D
 
With non-inline I mean a like function that is defined in another cpp file.
 
hmm, so cross-.cpp function invocations could only be optimized by a linker, right?
 
Yeah. Whole-program optimization is very common with VS. GCC has LTO, but I rarely use it since often breaks on large projects.
 
hi anyone has a nice small implementation of the Expected<T> class from Andrei's talk that I could steal? :)
 
1:58 AM
@RomanPlášil coliru.stacked-crooked.com/a/dede29aa31a7f240 (not very well tested)
Simplified by using boost::variant.
(Which is nice. But keep in mind that boost::variant can kills your project's compile times.)
 
yeah, I'm not using boost...
 
unrelated question about SSE ... say that I have __m128i x = {0,1,2,3}; and I want to do __m128i y = {x[1], x[2], x[3], N}; where N is just some other int32 variable ... how would I do this in the most efficient manner?
essentially I just want to shift "x" to the left (or rotate) and swap one field
 
Sounds hard, maybe @Mysticial would know
 
That will take at least 2 instructions. Possibly more. I can't think of the exactly solution off the top of my head.
You can do it in 1 with AVX512. But that doesn't exist yet.
 
I only have SSE4 available, so 128bit only :(
but I'm curious, how would you do it with AVX512 with 1?
 
2:12 AM
vpermt2d
It doesn't look like there's a 128-bit version of that even with AVX512-VL. AVX512-VBMI does, and with byte-granularity.
But you can get the same effect with masks.
 
huhm, probably a dumb question, but I can't even figure out how to "shift" or permute the register one to the left :)
at first I thought I'd use _mm_shuffle_epi32, but it doesn't seem to give as much control as _mm_shuffle_epi8
but the 8bit version seems way more complicated on the other hand
 
That AVX512 instruction will let you arbitrarily select elements from either vector. So it can do what you want. But you're not doing it in one instruction with anything less than that.
 
ah I don't need it with one instruction, can be two or three :) I just don't want to store it, do it manually and then load it again to continue computing
 
The only thing I can think of off the top of my head is _mm_shuffle_epi32 with either a move low or a blend depending on where N is coming from and whether it's in the first element or the last element.
 
2:30 AM
I see, thanks :) just found the _MM_SHUFFLE macro and got the shuffle working
 
 
2 hours later…
4:47 AM
mm shuffle
 
5:37 AM
Well, it has been a little dead here, but I'm sure all you Europeans will want to get back up and help out with this emergency:
0
Q: C++ Program not giving proper output (Please help, this assignment is due in 1 1/2 hours!)

Connor SandersSo I'm writing a program that accepts input from a file or user input (I only did file) and then reads student first and last name and test scores then outputs the Highest, lowest, and average with all students letter grades listed in an output file and on screen. I cannot figure out why my progr...

I mean...an hour and a half. Under those circumstances, we transform into the elite code writing service...don't we?
 
 
2 hours later…
Ven
7:13 AM
Waking up and finding out someone's made lookup O(1) on some lists. hype
 
7:26 AM
Hi guise
 
user1804599
HiPE
 
7:42 AM
@JerryCoffin I sure do.
I'm sorry I wasn't awake in time — sehe 6 secs ago
@Ven Is it on reuters yet?
@StackedCrooked lol
 
7:58 AM
awwwww
 
user1804599
8:18 AM
@VeronikaPrüssels your next imitation should be of Donald Trump.
 
Make Trump Hilarious Again
 
user1804599
Make Trump Hillaryous Again
 
I'm sad to hear this. Perhaps you can show us where you are stuck. MCVE helps us direct our energy :) — sehe 11 secs ago
And now we wait
 
user1804599
 
user1804599
lol
 
user1804599
8:32 AM
dat pun
 
user1804599
> This library implements the PSR-3 interface that you can type-hint against in your own libraries to keep a maximum of interoperability. You can also use it in your applications to make sure you can always use another compatible logger at a later time.
 
user1804599
 
> And that's how JavaScript app development works in 2016. ®
lol
 
user1804599
s/works/doesn't work/
 
Are fold expressions still planned for C++17?
 
already in
 
user1804599
eww
 
8:55 AM
iirc the unary folds got removed
 
Cool.
 
@Rapptz nah, the defaults were; i.e. you can (... && pack) but if it’s empty then error
I’m under the impression that concepts-lite has a good chance of making at least the boolean defaults come back ((true && ... && blahbla) is not really nice to look at), but I don’t know for what timeframe
 
9:13 AM
 
Ven
@Zoidberg I've see it.
The guy used WTFPL license. his fault
 
user1804599
It is stupid that you can delete packages that are dependencies.
 
user1804599
You should have to contact npm.
 
Ven
that's not how ownership works
 
it's also stupid how packages are not namespaced under usernames
 
Ven
9:18 AM
So, how to make my LiveScript codegolf work.
GodeColf.
 
user1804599
Get rid of significant indentation.
 
Ven
I should get rid of rightfold.
Also, ; and => allow me to golf however I want.
 
user1804599
trait Logging {
    private ?Logger $logger;

    private function log(int $level, string $message, array<string, string> $context = array()): void {
        if ($this->logger !== null) {
            $this->logger->addRecord($level, $message, $context);
        }
    }
}
 
user1804599
This is really neat.
 
Ven
Just golfed 20 chars using LS's >?= operator \o/
 
9:38 AM
Je suis Charly. Je suis Paris. Je suis Bruxelles. Je suis fed up with people blowing up innocents.
Would it be too soo to be a spelling nazi? /cc @sbi
 
It would be way too soo.
 
Ven
Charly? hah.
 
il n’y a pas de 'y' en français
 
Ven
Vas-y donc avec tes règles.
 
user1804599
@sehe inb4 rant against use of "nazi"
 
nwp
9:48 AM
@sehe do you ever sleep? o.O
 
user1804599
Probably when you are sleeping, so you don't notice.
 
Ven
^
TACTICS
 
@nwp huh. Not usually during the workday, no
@StackedCrooked lol
 
user1804599
Cool, this logging library actually makes it so that every log entry goes on a single fucking line.
 
user1804599
By turning newlines into "\n" and similar tricks (JSON, really).
 
9:54 AM
@sehe this reminds me of a colleague of mine, so painful
 
user1804599
@sehe this reminds me of a colleague of mine, so painful
 
@Zoidberg this reminds me of a colleague of mine, so painful
 
I mean ... in a way, human made terrorist attacks possible. In the ancient times there were less than one person per square kilometer, it's hard to carry out terrorist attacks when you walk for hours and only run into 3 people ...
 
user1804599
anyone used New Relic?
 
lol, kitty never heard of uh, cities, villages, or camps.
 
9:56 AM
kitty's sentences starting with "I mean" are guaranteed fun
 
I am talking about civilizations homo sapients more than 5000 years ago
 
lol, civilizations.
 
> > [we had a performance regression] because I made a structure 16 bytes bigger
> Sounds to me like you either need to increase the cache size […]
 
user1804599
I'm researching new alert systems because Sentry's grouping heuristics are fucking broken.
 
user1804599
It compares stack traces, instead of something less volatile like, say, MESSAGES???!
 
9:59 AM
> homo sapients
 

« first day (1985 days earlier)      last day (2966 days later) »