« first day (2138 days earlier)      last day (2800 days later) » 

Xeo
12:00 AM
although I guess a ix * 2 (+ 1) isn't super costly
 
@Mysticial Not to be insulting, but Howard Hinnant (for the obvious example) isn't stupid. Gonna be pretty tough to produce something dramatically faster than his code unless you narrow the scope at least somewhat.
 
Xeo
@JerryCoffin Might have different reqs than the std ones
so that could help
 
at least it provides a good baseline :)
 
Ell
@ThePhD can't you just redirect the output to stderr?
 
@Xeo That was pretty much my point--they'd better. Of course, Howard does also write primarily portable code. With some SIMD magic, you can probably improve performance a fair amount for a lot of typical cases (like instead of walking a list of collisions individually, start with a vector of 8 or so collisions, and look at all 8 concurrently).
 
12:06 AM
@Ven is he a wizard
 
@Ell Yeah, because that won't get old when QtCreator then DESTROYS my entire build configurations because I had to move to another machine.
And it doesn't just destroy it for the new machine: it nukes the settings files for BOTH MACHINES, because WHY FUCKING NOT.
 
@ThePhD did someone mention destruction, possibly of hopes and dreams? :3
 
So, it MAKES me specify things in terms of the command line, which can be machine-agnostic,
but then CRUSHES them the MOMENT I open it on a machine that's not EXACTLY the one I created all of those build configurations on?
How the fuck am I supposed to share my shit with other people, let alone work across multiple machines or set up a cross-platform project for everyone to use?
 
QtDestroyer
7
 
Never have I ever encountered a project specification system so completely fucking allergic to version control or sharing before.
Not even Eclipse was this batshit fucking insane.
 
Ell
12:10 AM
@ThePhD what is stored inside "settings"?
 
@JerryCoffin Definitely a different scope. When I said "fully-generic" what I really meant was the ability to add and remove items. There's still additional restrictions on the keys.
 
Ell
Aren't build scripts & machine dependent setting stored separately?
 
The std interface isn't optimal for our use-case either. So I'm supposed to optimize that as well.
 
@Ell YOU WOULD THINK THIS WOULD BE A THING.
Apparently QtCreator devs haven't been part of the last decade where Version Control was that new, hip thing people used to do work together.
 
The biggest performance offender in std::unordered_map is the hash function and the modulus used to compute the bucket.
 
12:13 AM
QtCreator literally inserts machine IDs and other tracking information in its build spec, so that 20 minutes you spent setting up all the make and ninja calls that it asks for? Fucking blows them up the minute the IDs in the settings file doesn't match. And RATHER than just insert a new entry into the settings file -- since it's FUCKING XML BASED AND COULD JUST ADD ANOTHER NODE FOR MY MACHINE ID -- it instead assumes the whole thing is bunk, flips its shit, and then nukes everything.
 
you know what always makes me feel better after the revelation that the system I'm using is a complete mess and the only reason anything works is ugly hacks
finding someone and convincing them to make the same unwise decisions so they know my pain
 
@Mysticial What would you use instead
 
@AndreasPapadopoulos I would probably get fired if I gave those details. lol
 
so, @ThePhD, I've been contemplating a switch to using QtCreator as my IDE. Why should I?
 
@Mysticial o...kay...
 
12:16 AM
@jaggedSpire Don't. It's a dumb waste of time.
You're better off using VIM and hacking together a shell script.
 
^ Don't. You honestly get more done by coding the GUI yourself in your own IDE
 
@AndreasPapadopoulos A fair number of other hash tables have required the size to be a power of 2, so the modulus is just ANDing with a mask.
 
@ThePhD :< I was hoping to let you have a little vengeance, but your soul is too good for this world
 
@JerryCoffin But that's trivial, everyone knows that
 
@AndreasPapadopoulos Trivial, but effective.
 
12:18 AM
it must be delicious
 
@JerryCoffin Worth getting fired over, surely.
 
@AndreasPapadopoulos Hmm...I don't see how, but maybe I'm just missing the obvious.
 
Ell
@ThePhD it sounds like you're doing something wrong :V
What build system are you using? Qmake?
 
Not-QMake.
 
Ell
What, then?
 
12:22 AM
I'm using it's "run some shell commands" system.
 
Ell
Err
So you're using a different build system
And invoking that from Qt?
 
Yes.
 
Ell
What is that build system?
 
Ninja.
Bootstrapped with Python.
 
Ell
Mkay
What command do you run to build?
@Mysticial how is computing hashes slower than following a linked list?
 
12:28 AM
@Ell When the nodes are in the cache. Which is actually quite often.
 
Ell
@Mysticial which hash are you using at the minute?
I mean, before you changed it to your secret recipe
 
The existing code used either std::unordered_map or std::map.
It isn't called std::unordered_map through. It's whatever the TR was way back.
 
@Mysticial I should implement a method a friend of mine invented several years ago. you start by computing a fairly large hash (say, 64 bits). You then use only some of those bits to select a bucket, but instead of throwing away the rest, you store them in the node as a "confirmer" (or, if it's more convenient, you store all 64 bits in the node). When you do a lookup, you do a hash about like usual.
But, when you look at nodes in a bucket, you compare confirmer values before comparing the whole key. If the confirmers differ, you have a mismatch, and immediately move on to the next node in the bucket. This way you reject the vast majority of mismatches with a single-cycle comparison instead of (for a typical example) walking through the characters of a string.
 
Ell
@Mysticial but which hash?
I mean, the standard doesn't mandate a particular hashing algo does it?
 
12:47 AM
@Ell Whatever the default is. The guys who use these data structures generally aren't CS academics. So they wouldn't know what the better thing to do is. That's kinda my job to make those decisions for everyone else.
I don't know what the default is for strings in unordered_map, but it sure as hell doesn't look pretty under the profiler.
 
murmur something
 
Oh. So that's why it's busted.
Sigh.
Now I need a counter value in my templates.
That's unique between all instantiations.
42
Q: Does C++ support compile-time counters?

PotatoswatterFor the purpose of introspection, sometimes I've wanted to automatically assign serial numbers to types, or something similar. Unfortunately, template metaprogramming is essentially a functional language, and as such lacks global variables or modifiable state which would implement such a counter...

BUAHAHAHA
Fuck that noise.
There's some C macro that has a counter value that's supposed to be unique everytime it's accessed... problem is, it's evaluated before templates, not for each instantiations, so that makes it useless.
 
What are you even doing
 
@AndreasPapadopoulos Making a unique type that cannot be named ever in the same way after its been created.
 
Sounds like a runtime thing?
 
12:55 AM
It kind've is, but the key is generated from a compile-time type signature.
So I was hoping to sprinkle some magic counter++ in the template bit and pray it worked.
 
Use lambdas?
 
@AndreasPapadopoulos That just might do it.
 
1:08 AM
@Mysticial DJ Bernstein is (sort of) our kind of academic--the kind who ensures that things are theoretically solid, but (unlike many others) then does some pretty serious testing, and is willing to admit to times that we don't have a good theory to say why this works better than the others, but it does anyway (IOW, djbhash would be worth a look).
 
 
1 hour later…
2:16 AM
Now I know for sure that stackoverflow/exchange manipulate votes and reps
not do I care
 
Lol, you don't appear have done anything on SO proper since 2013
Okay I need some C++ advice, I have a producer consumer for IO. I want to push to an object that will eventually write the file. Now, I can either roll my own or use Boost's buffered IO. I tried the boost buffering a long, long time ago and didn't seem to see the advantage. What do you guys think...
 
@Mikhail :(
I know, sometimes I feel bad for being a parasite, a chat parasite :'(
 
more like a lurker
 
talkative users are too talkative to be lurkers
 
user406009
@Telkitty You are only a true parasite on SO if you have an ad blocker installed :P
 
user406009
2:25 AM
@Mikhail Have you tried a simple manual approach yet?
 
I watch youtube in chrome with adblock on
 
user406009
@Telkitty Yeah. So do I.
 
user406009
I feel sorta guilty about it.
 
user406009
But less guilty than the disgust I feel watching the stupid ads.
 
user406009
The ethics around adblocking are fascinating.
 
2:27 AM
@Lalaland Thats what I'm using, but ideally the OS would provided this kind of facility. There is a problem with my approach. It works too well on Windows. I get almost ideal performance with CreateFileEx, BUT it destroys other IO devices (cameras). For example, the camera might drop a frame and refuse to start, producing a large beep that can be heard through the hollowed halls of our department.
 
I will user whatever library is available then create ones that are not
also re-write performance critical ones if they are bottle necks
 
That is a really generic statement, you should consider a life as a Java developer.
 
unless you have heaps of time to spare
why are you so sarcastic today?
also I am currently using java, but thanks for reminding me so
 
Somewhere, somebody knows the secrets of high throughput image acquisition.
 
many people knows how to make wheels
 
2:40 AM
do you?
 
depends on what kind of wheel you are talking about, for high throughput image acquisition, no
 
3:13 AM
@Mikhail At first blush, it sounds like it might make sense to keep the code about as it is, but drop its priority a bit (or raise the camera's) so when the camera has data ready, it gets serviced quickly. The rest of the time (presumably little or nothing else using CPU time) your code runs about like it does now.
 
3:55 AM
I'm not even old and I want to give up. .-.
 
@ThePhD Being old and giving up are orthogonal (actually, I felt a lot more like giving up when I was a teenager than I do now).
 
my chickens are old, they never give up asking for food
 
4:19 AM
this has regressed on GCC trunk and now complains about using operator() before its return type is deduced. now to figure out if GCC is wrong about it…
 
4:35 AM
oh! it compiles fine with -std=c++14 and fails only with -std=c++1z, I'm sure it’s worth reporting then
 
 
2 hours later…
6:47 AM
> error: constraint '(is_convertible_from_v<Args, A>&& ... && true)' does not have type 'bool'
pls
 
7:00 AM
I'm bored, I don't want to do anymore mathematical programming puzzles, I want to build something that could be used in a real world software
 
Do a graphic recognition app
 
comparing two images?
 
Take a picture of a plant & the app tells you what it is ...
Or a picture of a leave of a plant
 
Lol, good luck. Definitely not an easy one
 
True
 
7:04 AM
I'd be happy to try doing that if I was a fresh programmer out of uni, because I'd be foolish by that time to not know to what extent is that difficult
 
@Telkitty how's that useful? it's not like anybody goes out anymore
 
Tell that to Pokemon go
 
Ven
Hi
 
What about a file converter? Everyone needs them at some point
 
@Telkitty Don't blame him for you using Java
 
7:06 AM
@Ven Yo monkey ;)
 
@Telkitty I have that installed on my phone. Also has community identification
 
Ven
Damn.
 
s/have/had/
 
@Aaron3468 you need to be more specific, are we takling about encoding, language, or representation?
 
.jpg->.png, or .mp3->.aac. Or if you want a challenge, sure, make a C++ to Java converter
 
7:08 AM
I use whatever it's the easiest for the task at hand
 
Regularly rants in ALL CAPS.
Complains about "that noise"
 
@Aaron3468 the first two are not easy.. but C++ to Java is not difficult
 
...
 
Ofcourse Java to C++ would be much easier, but no one would use that
 
@Khaled.K lol
 
Ven
7:19 AM
@BartekBanachewicz sssh. Just don't...
 
also tomorrow's the big day
so #excited
 
@Aaron3468 I think I like the idea, I'll take on that challenge
 
@BartekBanachewicz getting married?
 
Ven
Yes to his bike
 
RIP
 
7:33 AM
@sehe have I ever bugged you about :S from vim-abolish and word boundaries?
 
@sehe No, giving birth
 
should I build the parser in C++ or in C, would C be really faster if I don't use classes or templates in C++?
 
lol don't parse C++ ever
unless you want to spend the next 20 years doing this
 
use an existing parser and pray to the fucking sun it's a good one
 
So, the problem isn't well defined because Java doesn't have templates, so you can't do source to source conversion. Also Java object lifetimes are different.
 
7:37 AM
you can use clang, but it's still annoying as hell
 
I don't mind it if the challenge is impossible, as long as it's fun to try and learn
 
don’t listen to them, go ahead and do it
 
I know the limitations, for that I'm going to avoid templates and classes for now
 
what about object lifetimes?
 
7:47 AM
in Java you always allocate like obj = new Object();, you cannot create objects on the stack as in C++ like Object obj(); .. so objects on the stack will have obj=null; at the end of the function to call the GC when translated as Java.. something like that
 
@sehe no, first practical motorbike lesson.
I technically should get all the theory lessons first but pff
 
@BartekBanachewicz what type of motorbike you're going for?
 
@Khaled.K you mean on the course?
 
@BartekBanachewicz I mean, the one you'll end up having.
 
@Khaled.K probably something small
because I want it to be able to fit under A2 license
 
Ven
8:01 AM
@Khaled.K java sometimes does stack objects
that's called escape analysis
Is there a way to get a "surprisingly wrong" value with the stdlib using auto and unary/binary operators, like std::vector<bool> with auto that returns a proxy instead of a real bool?
 
Well, you can use auto to get an unsigned type and then underflow during subtraction, happened to me before...
 
@Ven Don't use auto
not when you care about the return type in any degree
 
Ven
I don't (except for iterators, really). but someone is doing codegen
 
@Ven I think that's some sort of optimization, the compiler would've to deal with the code, but from a Java developer perspective, they always use allocations.
 
@Ven vector<bool> in itself is surprisingly wrong, so I would not care much about that.
 
Ven
8:13 AM
the java developer doesn't care about "stack" vs "heap"
just like the c++ standard
Technically every object in java has "undeterministic storage duration".
 
including, file handles :-)
 
Ven
those have user-defined storage duration..:P
 
@Ven nope, we just write things like Object obj = new Object(); .. objects life time is up to whenever it's has no more references (pointers).
 
Ven
that's wrong.
 
@Ven I’m not sure what you mean with the operators, but std::valarray is another thing with pre-auto proxies/expression templates (off the top of my head)
 
Ven
8:15 AM
the lifetime is up when the GC decides it is.
 
^
 
@Ven you can close streams/readers/writers but the "handle" stays alive after that
 
Ven
@LucDanton someone is generating C++ code, and recently introduced auto, trying to see if it can fail in some places
 
Also std::valarray is not relevant to anyone, so... vOv
 
Ven
@ratchetfreak two parts
@Griwes what is it supposedly useful for?
 
8:16 AM
So the two standard-library cases we can think of are not useful at all.
 
@Ven the GC would remove the object while you still have a reference to it?
 
@Ven vector-ish computations.
 
Ven
@Khaled.K no. the GC could remove the object 3 hours after the last reference to it died.
@Griwes and why does nobody care? better to use the already-established libs for that?
 
@Khaled.K it can decide to keep an object alive even long after the last reference disappeared
 
@Ven But there was some problem with it making it mostly unusable, can't remember what exactly it was.
 
8:17 AM
a do-nothing GC is a valid GC
 
@Ven well, if the last reference has died, I don't care when GC decides to visit.
 
Summoning @blelbach (...I doubt this will actually work).
 
Ven
you do care. because it means even after the last reference died, maybe memory isn't reclaimed, maybe the filehandle isn't closed, etc.
 
He explained to me why it's really bad, but I can't remember right now.
 
Ven
@ratchetfreak if you have unlimited ram, filehandles (if you add it to its roles list), etc, sure
 
8:18 AM
I remember I was convinced that it really is unusable.
 
yeah it's not useful for anything but short lived programs
 
Ven
if he ain't here, ..:)
@ratchetfreak actually, that's what the D DMD compiler does.
 
If I cared about vector-ish operations more I'd probably remember the reason. :P
 
@Ven which is short lived
 
well it is not my problem, I'm just going to convert the code, not compile it & run it. My work is going to be on the level of syntax, that's a compiler\envoirnment issue.
 
8:19 AM
@milleniumbug auto is only used in automotive industry
 
Ven
tg
 
if a variable is critical to the car systems you have to use auto
int temperature; // non-critical
auto float speed; // important
 
lol temperature "non-critical"
are we talking engine temperature
 
@BartekBanachewicz hehe
@набиячлэвэли automobil
 
8:22 AM
@milleniumbug yes I know that
@Griwes Probably inside temp if it's not mission critical
 
@Griwes engine temperature has to be marked volatile because it can go over 100 degrees celsius.
 
...
 
Ven
like your mom
 
@Ven what does shenanigans mean?
 
Ven
8:24 AM
@Khaled.K which language am I supposed to translate it to?
 
@Ven Basic English
 
@Khaled.K ...shenanigans
 
register int id;
 
@Griwes that's .. not useful
 
Ven
@Khaled.K A deceitful confidence trick, or mischief causing discomfort or annoyance.
 
@Ven so back to our initial question, should I write the parser in C++ or C, or wouldn't there be much of a performance gap when not using classes\templates?
 
nwp
@Khaled.K what makes you think classes/templates cost performance at all?
 
@Khaled.K structs are literally classes
and member functions are no different than free functions performance-wise
 
Templates mostly cost compiling time and classes are structs with pointers to functions, iirc
 
and templates are code generation
 
nwp
8:32 AM
I should test the compilation time for templates some day. I can imagine that manually duplicating code to remove the templates compiles slower than the original templates.
 
Ven
@Khaled.K it's irrelevant what language you write the translator in
If I had to compile java to C++, it'd buy a yearly pass for std::shared_ptr.
 
...cycles
 
I could write it in python if I wanted. It'd be slow af, but it would work ^^; Might as well write it in C++ for what little performance difference it has with C
 
Ven
what
sometimes I think you say very clever things but at times I'd rather listen to Rightfold talk about comonads.
 
Who?
 
Ven
8:40 AM
you
 
I guess I'll go with C++ then..
 
Haha, rightfold does have some great stories. If I'm clever it's not my intent
 
Hum, new proposals for C2X.
> register int const fourtytwo = 42;
register functions and stuff.
 
what?
 
const-correct _Generic strings functions that work with both narrow and wide character sequences.
 
8:44 AM
You mean that WG14 isn't fully dead yet?
 
@Morwenn u w0t m8
 
Eh, let's just let them lose their required NB count :X
 
@Griwes It proposes to add more rules to register to enable more optimizations, but I couldn't be bothered to read it all.
 
Or take them over with WG21 NBs.
People have been joking about doing that in Oulu... :P
 
@Griwes Of course not, they plan to release a new C2X standard in a few years :D
 
8:45 AM
@Morwenn I think they are at like 5 NBs... which is the required number, IIRC.
 
Basically the only « ground-breaking » changes would be the Decimal TS, the CPLEX TS and the Transactional Memory TS.
Parts of the decimal TS might make it into C2X, but that's pretty much it.
 
// What if we drop the destructor name? What do we need it for anyway?
object.~();
8
Hmm, I kinda like this.
Though IMO the GCC bug allowing foo.~auto(); should be standardized. :P
 
I don't
you don't call the destructor often
 
It's true that named destructors can be a PITA though.
 
@milleniumbug ...I kinda do. :P
 
8:49 AM
write a destroy(object); function
problem solved
 
meh
Operations like that is what I like to be very explicit to the reader.
That reminds me, I should probably update my variant to call std::launder in some places.
 
std::destroy(&a, &a + 1);
 
FTR the code I pasted is from std-proposals.
 
how more explicit can you be than literally naming it destroy
 
nwp
destructify
 
8:51 AM
@milleniumbug foo.~foo_t();
 
while you're at it, write a construct<T>(address, whatever); to avoid writing ::new(static_cast<void*>(address)) T(whatever); every time
 
@nwp go away, crazy jabbascript spirit
 
Oh, better: std::destroy_at(&object); is standard C++17.
 
@Morwenn +1
 
std::exchange(object,std::dev_null)
 
8:53 AM
@milleniumbug Pretty sure you don't need the static_cast...
Or wait.
 
It probably needs an std::addressof though.
 
oh right, that's when getting the address
 
don't you also need to check if it's possible to destroy the object
 
Oh, I don't think I need std::launder, I'm not actually reusing pointers. Interesting.
 
::new(static_cast<void*>(std::addressof(buffer)) T(whatever); // fml
 
8:56 AM
I typically placement new at an aligned_storage_t, though. :P
 
Ven
@Griwes quite a fun bug
shows how it works under the turtles
-1
Q: How to get local storage data in jsonp?

ajayvMy site is hosted on shopify. Now I want to communicate between two domains through jsonp. So i wrote one liquid file which have user email id and user uuid. Now the only problem is i need to access the uuid from local storage. The uuid is a random integer of 6 digits. I tried different approache...

> This failed coz of script inside script.
rip u
 
9:19 AM
guyz
I have a weird small side project I wanted to make
a tinder-like app for stuff
with one end that pushes stuff and the other one that simply says yes/no
 
Ven
why do you want to do that? monies? fame? grills? some weird fetish like dealing with Objective-C?
 
@Ven I need that to send stuff to my GF so that she can easily say "yes" and "no" to it :D
 
Ven
if you already have a gf it's not very tinder-ish now is it
@Borgleader congrats on 10k! I hadn't noticed.
 
@Ven I just need the swipe left/right model
found this but dunno
I was thinking about an android app but maybe a web one makes more sense
 
Ven
I remember doing it in swift, if that interests you. :P (I know you have an android phone)
 
9:24 AM
well it's supposed to run on her phone, but that's also Android
I think I'll make it web based at first
 
Ven
right. I built an app that was called "CaTinder". Like tinder, but for cat shelters. :P
 
Ven
my school didn't like it that much
 
9:38 AM
that web version seems to be doing fine
I just need a firebase no-backend and I'm good to go
 
@Ven show it to us
 
Oo not in the store ..
 
Ven
school project. i dont even have the rights to put it up
 
when I get around, I will steal your code and put it in my store one day
currently not in the mood for robbing poor school kid
 
9:48 AM
@Ven wait school owns the copyright to your projects?
 
Ven
yeah
@Telkitty I mean, if you're fine with getting sued
more generally, you don't have the skill level to reproduce the few missing files in that repository..:)
 
you have the most important ones there: ViewController, AppDelegate etc
FirstViewController too
 
Ven
you're very mistaken if you think those are the most important ones, but hey.
maybe it'll get you learning Swift, and they I can proudly say I taught something to Telkitty.
 
teaching me makes you proud? I am flattered :p
 
woah, someone wants to fork Hate
 
9:54 AM
looks like a cat that needs CaTinder
 
Ven
@BartekBanachewicz add him to repo
 
yeah I responded
I might
eh damn i got an api key for firebase but it responds with auth failed
new firebase API is beyond retarded
fucking google
breaking every single thing they touch
fuck me how could they break it so much
 
Ven
10:22 AM
they googled error messages
 
now it automatically signs in for some reason
wtf
oooh right
it retains a login session
welp
 
Ven
10:58 AM
> @rightfold "Is there a single adjective that means "pure and total"?"
"functional"
 
@Ven communist
 
@Ven my app almost works now
hooked it up to firebase
 
Ven
it's not interesting if it's not managed C++
 
I need to make an iface to add stuff now and an a message if you reach the end
and ofc gathering which was swiped left and which was swiped right
 
11:22 AM
@Ven Thanks :)
 

« first day (2138 days earlier)      last day (2800 days later) »