« first day (1138 days earlier)      last day (3813 days later) » 

10:00 AM
@DeadMG Meh - error-handling overflow.
 
user1804599
Monuds.
 
Donuts
Hmm.. I think I should do some food-shopping.
 
user1804599
Burritos.
 
OK, shopping now!
 
user1804599
Be sure to buy burritos.
 
JBL
10:04 AM
Mmh, I'd like some burritos.
 
Maybe Subway do them.
 
user1804599
Noo. That’s bad for your health.
 
@Telkitty That looks kinda brave..
.. or maybe the big raptor just enjoys a tail-cleaning?
 
user1804599
10:13 AM
I’m going to sell my earwax.
 
@rightfold Somehow, I'll resist the temptation to star that.
 
Xeo
0
Q: Evaluate non-type template argument in conditionnal macro

VincentI want to implement the for each idiom for traversing all pixels/voxels of a 2d/3d matrix. Depending on the dimension, we have 2 loops or 3 loops. The code seems like that : //template class for point template<int Dim> struct Point{ int _data[Dim]; int & operator ()( int index){return _d...

Oh GAWD
 
user1804599
 
@Xeo Somehow, I'll resist the temptation to open that.
 
user1804599
Within Temptation.
 
10:24 AM
> I do not want to use boost for dependency reasons.
lol, dependency reasons
 
9:24pm & all I can think of is cake ... I am doomed to be a fatty :'(
also because I went shopping and bought one not long ago
 
Is waking up a thread through a std::condition_variable expensive (requires synchronization) on the notifying thread (NOT the thread being woken up)?
 
Depends on what expensive means.
It should be the cheapest synchronisation needed.
 
but it does require sync?
 
Some sort of atomic write.
 
10:27 AM
why not a regular write?
 
@nightcracker No way out of it.
@nightcracker Because regular writes are not visible in other threads.
 
what do you mean, I could just write to a shared memory location without sync, can't I?
 
And other threads don't have to read that value.
 
let me illustrate with an example, why wouldn't this work? (pseudocode) gist.github.com/nightcracker/7673623
 
Because there is no order relation between the code in the two threads.
Atomic and synchronisation operations establish order relations. No way out of it.
 
10:31 AM
What is an order relation?
 
It defines which side-effects are visible.
 
Is a write to shared memory considered a side-effect?
 
For this matter, everything that could be visible outside is a side-effect.
 
So what you're saying is that a "global" variable is basically local if you do not use synced writes?
 
@nightcracker The optimizer assumes that the memory is not shared.
if you do not use an atomic or otherwise synchronized write, then it is assumed that it is local.
 
10:34 AM
Wow..
 
You need wake_up = true; to have a happens-before relation with while (!wake_up);. Without it, the compiler is free to optimise the loop to if(!wake_up) loop_forever();.
 
Just do the synchro. Synchro is only expensive if you insist on designing to make it so. If you are signaling the arrival of one char in a queue, it is relatively expensive. If you are signaling the arrival of a 50MB buffer object reference in a queue, it is not relatively expensive.
 
(But these things go deeper than the optimiser; the CPU also messes things up)
 
So there is no cheap way to notify another thread (think < 10 cycles)?
 
oh yeah, the CPU also has buttloads of fun with instruction reordering and stuff.
@nightcracker An atomic operation is the lowest you can go.
 
10:35 AM
@nightcracker Haha! LOL! 10 cycles!
 
If we do finally make quantum computers a reality, how on earth are we going to use 'em?
 
the Standard atomics can be quite relaxed.
if you don't need anything stronger.
 
note that the notification is allowed to be "fuzzy" - there is no need for a "guarantee" that it is woken up, or that it wakes up again if it already was awake
 
but
I believe that x86 does not offer anything cheaper than SC-DRF.
in hardware
 
AFAIK all sync just destroys CPU pipelines
 
10:38 AM
well
 
It kinda has to...
 
do you have actual profiler data showing that your synchronization is a problem?
 
no, this is an excercise I'm doing for fun
not a problem I'm having
 
remember that your implementation might well take a lock every time you call malloc(), let alone the sync involved in switching into kernel mode or something.
 
yeah, which is why I'm writing this thread-safe pool allocator :P
 
10:39 AM
so the reality is that an atomic op is really negligible.
 
@GamesBrainiac they are a reality... just not practical particle yet.
 
they have factored the number 15 damnit!
they're real - the answer was 3x5!
 
synchronization is only really expensive when you are contending.
otherwise it's pretty cheap.
 
JBL
@GamesBrainiac Like computers ?
 
@GamesBrainiac as far as use goes, I believe working things out where there are many many solutions to try, brute forcing sort of solutions.
 
10:41 AM
hmm, maybe I won't make a shared free-list then
 
@thecoshman Only a little bit.
 
but that would mean all deallocated object's memory goes to the thread it's free'd on
so if you only allocate in one thread and deallocate in another you leak memory
 
IIRC, a QM can execute a brute-force-search in the square root of the time it would take a classical computer.
but that's not a very big speedup considering the size of the problems in question- even the square root is still insurmountably large.
 
it makes 128-bit symmetric encryption iffy
 
JBL
It's a start !
 
10:43 AM
in like 50 years
or <random guess>
 
the real benefits are in stuff like integer factorization, where a QM can do it in polynomial time whereas a classical machine is non-polynomial.
 
but so far, they have only use a few Qubits at a time... as I understand it, rather then each new Qubit doubling the options, its like an order of magnitude more
 
i.e., the problem was moved to a completely different complexity class.
 
as I understand it, that hardest thing with quantum computers is working out how to use them effectively. Just slapping crysis on one is not going to let you ramp the settings all the way up
 
well right now that's not a big deal because we don't have any worth actually programming :P
 
10:47 AM
@thecoshman Hmm. Well, I just don't understand how you'd make use of something that does many things at the same time. I mean imperative programming would go out the window.
 
fucking barry scot starting playing on grooveshark ¬_¬
@GamesBrainiac exactly, it is a huge shift in how you solve problems.
 
@thecoshman I mean descriptions of what a quantum computer can do are fuzzy at best.
 
like puppy said, factoring huge integers is a big task right now, but for quantum computers should be relatively trivial.
@GamesBrainiac because knowledge of what they can do is fuzzy at best
 
@nightcracker 6 to 8 weeks
 
@R.MartinhoFernandes fixed
fuck one box
 
10:49 AM
Add a dot at the start.
 
like .http?
or . http?
 
@thecoshman One thing documentaries and papers have made very clear, and that is they will be faster. But, if we don't even know what they're doing, then it will become a problematic scenario indeed.
 
@nightcracker This.
 
@GamesBrainiac that's kind of a misleading thing to say. An F1 car is not faster on your daily commute to work, as it will almost certainly fail to make it without getting too cold and stalling.
 
hmm, I kinda disagree.
a QM can be used to optimize regular programs far more effectively than conventional optimizers.
and the same holds true for optimizing e.g. the layout of CPU cores.
if we gain QMs, classical programs and hardware should see a good speedup.
 
user1804599
10:54 AM
dt)r0 :3
 
what the fuck
pool_alloc.cpp:3:1: error: 'condition_variable' in namespace 'std' does not name a type
yes I do have #include <condition_variable>
 
gcc version 4.8.1 (rev5, Built by MinGW-W64 project)
yes
 
Yeah, no threading.
 
at all?
damn
 
10:55 AM
Well, maybe there's some stuff now, but I haven't been following.
I think you can find other builds around with that stuff.
Did you try nuwen.net/mingw.html?
 
nope
I use mingw-w64
 
> I recommend that anyone who is learning Standard C++ and who uses Windows for a primary development environment should use two compilers: the most modern version of Microsoft Visual C++ (currently 2013) and the most modern version of GCC, the GNU Compiler Collection. Using two compilers that conform closely to the Standard subjects your code to more strenuous trials than using a single compiler would.
> Using two compilers that conform closely to the Standard
lol
two
 
lolz
none
although GCC is a lot damn closer than MSVC
but AFAIK no conforming compiler for C++ exists
the language is just too damn complicated
(this is about 2003, let's not even begin talking 11)
 
Since 11 removed export it's a lot easier now.
 
0
A: Does casting types depend on big/little endian?

Boris IvanovYes you right. You can simulate Endianness using ntohl() function #include <stdio.h> int main(void) { // your code goes here int a=0x10000001; char b; b=(char)ntohl(a); printf("%#x \n",b); return 0; } http://ideone.com/cq7Ejs

urgh
 
10:59 AM
> simulate Endianness what on bloody earth does that mean
 
fuck knows
 
Xeo
@nightcracker Define "conforming". Modulo bugs?
 
@R.MartinhoFernandes He means two collections of unrelated bugs from both compilers. It's a new way of improving your debugging skills.
 
@Xeo no bugs, inconsistencies, introductions of "extensions", wrongly set macro variables, etc
@Xeo there might be a conforming C compiler for a certain version of the specification in every regard if you use the right compiler with the right settings, but I even doubt that
 
Xeo
Well then good luck ever having anything conform to the standard. At that point, "conforming" becomes meaningless if you don't exclude bugs.
 
11:01 AM
Don't get me wrong though - I'm not trying to imply that non-conforming is non-usable or that conforming is easy to reach
hell it's almost impossible
 
@thecoshman Hmm, that does not say much. I mean, a QM can carry out computations simultaneous, one documentary I've watched said that it was akin to having a lot of cores. So, would that not lead to much faster program execution if we can take advantage of it cc @DeadMG
 
does anyone have experience with this library? tinycthread.bitsnbites.eu
 
@GamesBrainiac That's a very simplistic view of it. It's not actually equivalent to having an exponential number of cores at all. It can be viewed that way for some problems and not others.
 
@nightcracker I don't see how settings matter. The standard doesn't specify that a compiler has to be invoked in any particular way.
Saying GCC is not conformant because you have to say -std=c++11 and a bunch of other stuff is nonsensical.
 
@R.MartinhoFernandes I mean settings to turn off extensions for example
 
11:04 AM
@nightcracker Yes, those are irrelevant.
 
@GamesBrainiac yes, but just having lots of core does not make any program faster, you have to write your program to really take advantage of that.
 
You can consider every invocation with different settings a different compiler
but that's just a way to think - I can see where you're coming from
 
@thecoshman Hence my if statement.
 
and you're right that the way the compiler is invoked is outside of the scope of the standard (or how it conforms)
 
@DeadMG my point is, QM can be faster when applied to the right problems. Those that it can be applied to will be so much faster with QM
 
11:05 AM
yep.
 
@DeadMG More complicated, how so? I've been trying to understand it, since I feel as though it would make concurrent programming the norm.
 
@GamesBrainiac Well, I'm not an expert on QM either. But right now, nobody knows if there is a quantum algorithm that will execute in polynomial time for any exponential time classical algorithm.
for example, there's no proof if 3-SAT can be solved in polynomial time on a QM.
hell, nobody can even decide if 3-SAT can be solved in polynomial time on a classical computer.
the quantum complexity classes are even less understood than the classical ones.
 
@GamesBrainiac Why would it do that?
 
also, don't be thinking that QM is just letting you run many thing in parallel. It is not running many cores like a conventional computer. It is letting you try (more or less) every possible input at once to see which input combination gives you the desired output... so maybe it's better to think of it in terms of functional programming?
at least, that's how I understand it
 
that's not accurate either.
 
11:11 AM
@R.MartinhoFernandes I was still holding on to the idea of multiple cores, so if that is the case, then you'd need programming languages that could take advantage, of the paralellism that it provides.
 
yeah but QM is not parallelism
 
@thecoshman That sounds even more powerful than having loads of cores.
 
@GamesBrainiac Quantum programming isn't just like classical programming but more parallel. You would need a complete rebuild from scratch. And nobody really knows how to program a QM.
 
it's like seperate universes you need to implode into the right result
 
you can only make a program for a QM if you're a theoretical physicist, and even then, it's one of the hardest things around.
I read an interview with Peter Shor and he said that even he didn't really understand his own algorithm.
 
Xeo
11:13 AM
Don't qubits just allow more information the more qubits you have entangled?
 
only theoretical physicists used to program computers 60 years ago, so we'll see
 
@GamesBrainiac For a good start, you can start wit this rule: any way mainstream media depicts quantum computing is wrong.
 
@R.MartinhoFernandes s/quantum //
 
@Xeo Not quite. You can only read one of two states from any given qubit.
 
11:14 AM
@R.MartinhoFernandes I think that rule has even broader applications ;)
 
Xeo
@thecoshman bing
 
It's been that way for a long time.
Quite impressive.
 
@Xeo o_0
 
Xeo
11:15 AM
The sound he makes
 
user1804599
@sehe so meta
 
@sehe And it had +2/+2 when I looked at it right now. lol
People are doing great job :D
 
it's clearly an internal youtube 'joke'
 
@Praetorian I think the lack of terminology for this syntax has been confusing me — aaronman 11 hours ago
^ I think it's just called uniform intialization. (What's confusing) /cc @R.MartinhoFernandes thoughts?
Need to get going. Kids out of school. The works. Be back later
 
11:19 AM
I don't call anything uniform initialisation :S
The standard calls it list-initialization.
I really don't know who the fuck thought of "uniform initialisation" as a good name :(
 
user1804599
struct uniform { int color; }
new uniform; // no uniform initialisation
new uniform(); // uniform initialisation
 
Why is this on my screen.
 
why aren't you moving it to the bin?
3
 
Xeo
@R.MartinhoFernandes Marketing statement :(
 
@R.MartinhoFernandes it was originally a typo. 'f' and 'c' are very close to each others on the keyboard. It happens
 
11:36 AM
One day I should stop randomly picking rooms to move stuff to.
 
I guess I'll start calling it by its proper name from now on: unicorn initialization
@R.MartinhoFernandes hah
 
I like the "Two days later..." bit.
 
good lord it is cold out there. (fire alarm)
 
@R.MartinhoFernandes simple things please simple minds :P
 
JBL
11:41 AM
Great, I broke all my consoles at once.
 
Our software needs a configuration setting for the AC frequency of the place you are in.
 
Xeo
@R.MartinhoFernandes I was wondering how you picked them, so as not to move it into an actual discussion happening at that moment
 
@Xeo I type "bin" in the search, and randomly click something without a message counter.
 
Xeo
lol
 
@R.MartinhoFernandes o_0 what software are you working on?
 
11:43 AM
@thecoshman an automatic bin-bot for the chat? :p
 
@thecoshman Apparently it generates enough noise that we have to account for it.
 
(And 50Hz is an important brain activity frequency)
 
@R.MartinhoFernandes I see... question still stands though
oh yeah, brain scan thing
emc is it?
 
user1804599
Yum.
 
11:44 AM
@thecoshman EEG.
 
@R.MartinhoFernandes same thing :P
(hides behind wall of ignorance)
 
user1804599
Chips with mayonnaise, curry and unions and a frikandel with mayonnaise, curry and unions and a rice disk.
 
:( trying to write more neatly... down to like 5 words/minute
 
Xeo
@rightfold unions?
Sounds like something @ThePhD would love to eat.
 
user1804599
Onions.
 
11:49 AM
I want struct foo { foo(...) = aggregate; }; or something.
I.e., explicitly request a ctor that just writes the fields.
So struct point { point(...) = aggregate; private: int x; int y; } would be equivalent to struct point { point(int x, int y) : x(x), y(y) {} private: int x; int y; }
 
Xeo
So you can have list-init and other ctors?
 
So I don't have to write that boilerplate.
 
why does waiting on a condition_variable require a lock?
 
62
Q: Why do pthreads’ condition variable functions require a mutex?

elliottcableI’m reading up on pthread.h; the condition variable related functions (like pthread_cond_wait(3)) require a mutex as an argument. Why? As far as I can tell, I’m going to be creating a mutex just to use as that argument? What is that mutex supposed to do?

 
so it's basically to protect multiple consumers?
what if I only have a single consumer? (that is, there will only ever be one thread waiting for a cond variable, but multiple unlockers - overlapping unlocks get ignored)
 
Xeo
12:05 PM
@R.MartinhoFernandes Well, the only reason to have that boilerplate is when you have other constructors.
 
user3010322
@R.MartinhoFernandes You have to compile it on the platform you like in order to use it. MinGW <-> VC++ Crosstalk hasn't been achieved yet, so even if you get a .dll or .lib to use, at the end of the day it's not really usable by anyone in VC++. Which, I guess VC++ doesn't matter, so you should be all okay to use capnp and leave me behind yet again. :D
 
user3010322
@Xeo Morning noon and night, yo.
 
@nightcracker You have to use the mute anyway. The C++11 API even requires you to pass in the lock guard, so the type system ensures that the mutex is actually locked.
 
@wilx that's inefficient =/
 
@nightcracker: It is not. It is about the only reasonable way to do this.
 
12:21 PM
@ThePhD so if your filewatcher works, why were you saying all those bad things about it? :D
 
user3010322
@melak47 It wasn't working before. :c
 
oh. well thanks for fixing it :p
 
@Xeo Erm, so what? foo() = default doesn't prevent other ctors.
@nightcracker It is not. If what you want is a std::atomic_flag use a std::atomic_flag vOv
Or a std::atomic<bool>.
 
user3010322
Now I have to wrangle RAW_INPUT u.u
 
12:31 PM
 
lol, Club-Mate's logo.
 
@R.MartinhoFernandes Yes ^^
 
@R.MartinhoFernandes but those only provide busy-waits
 
user3010322
@LightnessRacesinOrbit Lucky. :c
 
oh god... thread-local storage is fkin expensive
 
user3010322
12:33 PM
:D
 
user3010322
@R.MartinhoFernandes Hey, I have a tuple question.
 
user3010322
Or, tuple-related question.
 
user3010322
Is there a way to figure out the max number of std::get you can do on a certain type? (for types that support std::get).
 
user3010322
For example, you can std::get 0 and 1 on std::pair, std::get 0, 1, ... n for std::tuple, etc.
 
user3010322
12:36 PM
@bamboon What if I told you I can't use the standard library?
 
@nightcracker I don't get it. You want something that is blocking and not expensive?
@ThePhD We'd told you to fuck off.
 
user3010322
=[
 
user3010322
What if the reason was because I am the standard library implementer?
 
(No, there's no way of using the tuple protocol without using the tuple protocol)
 
@R.MartinhoFernandes I'm actually curious as to how to build a thread-safe pool allocator right now
 
Xeo
12:41 PM
@ThePhD Implement std::tuple_size.
 
user3010322
Bleh.
 
user3010322
Guess I'd better get to specializing.
 
tuples should've been a POD type
haskell does it smart, IMO
 
@bamboon Woah, what a silly question.
 
12:44 PM
Tuples should've been a built-in type :F
 
@Griwes Variadic packs, to be precise.
 
Just because you can do something in library, doesn't mean you should.
 
user3010322
You can have an empty std::tuple, ye?
 
@Griwes that's what I mean
 
@R.MartinhoFernandes Yeah. I got to finally look closely at that thread about packs on std-proposals.
 
user3010322
12:46 PM
Does std::get fallthrough if I give it 0 and a random T ?
 
user3010322
As in, does it just pass the argument through?
 
Xeo
no
 
Don't pass explicit parameters to things that were designed to work with type deduction.
 
user3010322
Hm.
 
user3010322
12:48 PM
This is gonna be hard. =[
 
What are you trying to do?
 
user3010322
Nothing important. :D
 
user3010322
Just putzing around.
 
Xeo
@R.MartinhoFernandes tuple_cat in 20 lines!
 
user3010322
SHUSH YOU.
 
user3010322
12:50 PM
;~;
 
user3010322
I've already wellexceeded20lines ._.
 
Doesn't seem too hard.
My tuple_cat was fucked up but only because it needed tons of remapping.
 
user3010322
I refuse to look at any other code
 
user3010322
until I'm finished with mine. :c
 
Has anyone here used D at any length?
 
user3010322
12:53 PM
Your Mom used the D in depth.
 
Xeo
@R.MartinhoFernandes It's possible, but STL seems to have done a version without dependencies (I imagine that means only <tuple>) in under 20 lines
I can get it in 25 or so with indices
22 hours ago, by Xeo
@ThePhD Hmpf and hmpf.
Also, searching for "hmpf" revealed that mainly us Germans use it in here.
 
@Xeo in C++14 there is a standard class for integer sequences
 
Xeo
@Abyx I know
 
@ThePhD lul
I've been messing around with D recently, really liking it.
#nohomo
 
noponies.
 
12:59 PM
alwaysponies.
 
user1804599
omgponies.
 
yayponies.
 
user1804599
@Suhosin I have used D.
 

« first day (1138 days earlier)      last day (3813 days later) »