« first day (459 days earlier)      last day (4473 days later) » 

4:00 PM
I was using a library, either win32 or openCV I think, where all the enums where ended with a special value to force them to be 32 bit
 
padder = 0xFFFFFFFF?
 
@rubenvb yeah, but you would need to know that you could break an int into four chars
 
btw: Google is anti-anti-SOPA, you can visit every wikipedia page in its cache
 
Probably.
 
Xeo
enum x : uint32_t { ... }; :)
 
4:00 PM
@thecoshman But that's not about the library. The language can now express that without the library.
 
@rubenvb You can also turn off JavaScript.
 
@thecoshman the fact is that you don't know that, it's at least 32-bit
 
@RMartinhoFernandes indeed
 
@rubenvb Wikipedia works fine here.
 
that's why int sucks
 
4:01 PM
@RMartinhoFernandes Wikipedia in english?
 
@rubenvb Actually, not, it's 16 bit.
 
Xeo
@rubenvb It could well be 16bit
 
@EtiennedeMartel Yes. I have NoScript.
 
ok, ok, at least 16-bit
whatever, you're only making my point for me
 
That's why I said you need fixed widths for binary I/O.
 
4:02 PM
@RMartinhoFernandes Ah. Well, that explains it. They use JS to display their blackout page.
 
Why do you want it to be 32-bit?
 
Geez.
 
@rubenvb actually, I think it was my point that you can just expect int to be the same as cahr[4]
 
32-bit is so 2000.
 
@thecoshman Actually, it's char[sizeof(int)].
 
4:03 PM
@thecoshman well, you can't really, as it apparantly could be 16-bit and conforming.
which is exactly my point.
 
@RMartinhoFernandes Yep
 
I love how everyone is talking their own thing.
 
@rubenvb I thought your point was something about the library.
 
int means a integer type that is fast on the underlying architecture. Giving it a fixed width defeats that purpose.
 
int is not part of the library.
 
4:04 PM
I feel bad. Let's mock some questions.
 
maybe I am being exceptionally retard, I am trying to say that you can't presume int to be four bytes
 
@StackedCrooked Nice way to put the hurtung truth, bravo!
 
@RMartinhoFernandes that was half an hour ago
 
What @Stacked said.
 
I started about ints about ten minutes back
 
4:04 PM
@EtiennedeMartel Splendid. I read that as `Q. Wikipedia in english?' - 'A. Actually, not, it's 16 bit'
 
Hi I am new here and I am interested only in C console tools for who cares.
 
@sehe well, that sure is going to confuse some one :D
 
@sehe Multiple threads at the same time are confusing. Let's talk about pandas instead.
 
Pandas are evil.
Prove me wrong.
 
Q. Pandas in English?
A. Not one bit!
 
4:05 PM
"screw you guys, I'm going home"
 
@rubenvb So what's your point then?
 
@thecoshman finally
 
Mine is (3, 5).
 
I'm hazarding a guess that a x86 program converted to some obscure 18-bits-in-a-byte architecture is going to have a lot more problems from wrong assumptions than the speed of an int
 
That you can't reliably use int for something it was not built for?
 
4:06 PM
Well, of course, nobody actually cares about obscure platforms.
 
What's the whole discussion about, anyway?
 
Pineapples.
 
@CatPlusPlus that would mean sizeof(int) == 4
for the platforms people care about
 
No, sizeof(int) >= 4.
 
Something.
 
4:07 PM
Is there C coders/room or not?
 
@rubenvb int has a speed?
 
No, everyone hates C.
 
@Georgi Three guesses. Google isn't down due to Sopa. it must be obsolete!
 
@rubenvb So, someone misused int?
 
4:08 PM
@RMartinhoFernandes but then if it's so easy to misuse, why use it at all?
 
@rubenvb I use it because I don't care about PDPs.
 
Xeo
@rubenvb "C++ is easy to misuse, why use it at all?"
 
If I did care, I wouldn't use it .
 
Good thing they didn't misuse a toilet.
 
Let's ban all cars because sometimes, an idiot drives too fast and kills someone.
 
4:09 PM
@RMartinhoFernandes what's a PDP?
@EtiennedeMartel that's actually not a bad idea
 
@sehe Google is not my favorite at all.
 
@rubenvb Old machines with weird word sizes. Like 18-bits and such.
 
"My X are easy to misuse... why use X at all."

nice template:

"My kids are easy to misuse... why use kids at all."
 
Xeo
@rubenvb A series of old computer architectures IIRC
 
@rubenvb I was being sarcastic.
 
4:10 PM
And gasp middle endianness.
 
@sehe Let's start a new meme.
 
Don't forget the stupid middle endianness.
 
@EtiennedeMartel Chatrooms are easy to misuse...
Why use memes at all?
 
The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corporation (DEC) from 1970 into the 1990s, one of a succession of products in the PDP series. The PDP-11 replaced the PDP-8 in many real-time applications, although both product lines lived in parallel for more than 10 years. The PDP-11 had several uniquely innovative features, and was easier to program than its predecessors with its use of general registers. Its successor in the mid-range minicomputer niche was the 32-bit VAX-11. Design features of the PDP-11 influenced the design of microprocessors such as the Mo...
 
@RMartinhoFernandes No, ME = medieval (I hope. It goes in dutch)
 
4:11 PM
@sehe Yeah, sometimes a guy comes in and complains about int, of all things. C++ has a million billion flaws, but no, the guy had to whine about fucking int.
7
 
@RMartinhoFernandes What.
 
Well, that's bad obviously. It should have been spelled 'integer'
 
@EtiennedeMartel in my defence, I started with <initializer_list>
 
@CatPlusPlus You didn't know about middle endianness?
 
Something's really wrong with me. I read that as "Yeah, sometimes a guy comes in and complains about sex, of all things."
 
4:12 PM
It ends in the middle?
 
@sehe Sure, because C++ isn't verbose enough.
 
@StackedCrooked Sex ends in the middle?
 
Brain Y U TROLL ME.
 
@CatPlusPlus And then that guy flags Tony. And Tony gets banned. Again.
 
@RMartinhoFernandes No.
 
4:13 PM
Here's something non-aesthetic to complain about initializer_lists: you can use move semantics with them.
Or make them out of references.
 
Why is Wikipedia so slow?
How come it's slower when it appears to be offline than normally?
 
@CatPlusPlus SOPA blackout, haven't you heard?
 
Oh, I did.
 
What SOPA had a blackout?
 
Good thing it's not soap blackout.
But damn, it's working so slow.
 
4:15 PM
What would need to be added to remove the C preprocessor from C++?
 
Yeah, that's what I'm trying to reach.
 
@rubenvb At least modules.
 
@RMartinhoFernandes Beat me to it.
 
4:16 PM
@CatPlusPlus It's still not fully loaded here either.
Gosh, that thing is really slow.
 
> This ordering is known as PDP-endian.
Ah, that's why.
Also, who cares.
 
@CatPlusPlus it blazing fast here. Just have to hit esc at the right time
 
@CatPlusPlus Well, someone asked what a PDP was.
 
I barely even care about big endian.
 
4:17 PM
@sehe Why? You're not in normal mode?
 
Nope. How?
 
Nobody in this room is ever in normal mode.
 
RARGH
 
@CatPlusPlus @DeadMG is..
 
4:18 PM
@sehe I thought you used Vimperator.
 
@StackedCrooked He appears to be in bear mode right now.
 
It's a little early to wake up from hibernation.
 
@RMartinhoFernandes No, I think vimperator sucks. Too many 'correct' vim-bindings to make the browser work. I'm with Opera 9.2 keybindings.
 
@sehe Oh, then something like NoScript?
 
4:19 PM
@RMartinhoFernandes Escape worked just phine. Or, C-F12, Disable Javascript, Enter
 
Xeo
Robot, mind doing a quick test with GCC 4.7 on this code?
 
@Xeo HEy! I was gonna answer that!
 
Xeo
:P
Please, just test
I'll link here. You hit repcap anyways!
 
@Xeo it works here
 
Xeo
prints 1 0 ?
 
4:21 PM
Has function() method: 1
Has function() method 2: 0
 
Xeo
great.
 
no warnings on -Wall -Wextra -pedantic
 
@Xeo I don't mind. Was just teasing. But GCC seems to have hanged.
 
Xeo
lol
 
Ah, finally.
Yep, prints 1 0.
 
4:22 PM
@rubenvb forgot ffing c++!
 
Every time I see -Wall I think "why wall?"
 
@CatPlusPlus Oh, I don't have to answer that for you. I'm pretty sure you know why.
 
Xeo
@CatPlusPlus That's what I wondered when I first encountered compiler switches..
 
You tried to make sense of compiler switches?
Gosh you're so naïve.
 
Xeo
I tried to make sense of what the fuck a Wall has to do with a compiler
 
4:23 PM
@sehe whut?
 
You just had to show off with that ï, didn't you.
 
As if a Werror had much to do with it?
@CatPlusPlus Hey, I didn't even need to switch layouts!
And it's not used in Portuguese.
I wonder why the fuck it's wasting a perfectly good key.
 
Xeo
First thing I do when I find template questions: Copy-paste the code into Clang.
Having Clang is seriously awesome for answering question on SO
 
. .
ω
 
Xeo
Except when they deal with lambdas, or constexpr, or initializer lists... , but meh.
 
4:30 PM
@rubenvb -Weffc++
 
How (in)efficient would linked lists be for text editing?
 
You don't mean a node per character, right?
 
use a rope
 
Yes. ~20 bytes per char.
 
That sounds painful.
 
4:35 PM
@DeadMG Maybe I'm missing something, but I don't see the benefit of them
 
Ow.
Ropes, zippers, gap buffers.
 
@Pubby You're probably missing something.
 
well, they offer many excellent algorithmic complexities
 
There are many structures adapted to text editing.
 
many text editors use ropes
they're like linked-lists, but especially designed for strings
 
4:36 PM
I don't understand the benefit of sorting by string length
 
You don't need to go crazy with a overhead of 19x the text.
 
Unless you want to compete with VS in terms of memory consumption.
 
@sehe aha, that was too much typing I guess.
 
I want to have something like emacs except use ML for the scripting, figured using lists would make it much easier
 
@Pubby Why ML?
(Not criticizing, just asking)
 
4:38 PM
AFAIK emacs uses ropes.
 
@EtiennedeMartel Well a lazy/pure variant sounds cool for text editing
I can model vim commands as ML function calls
 
Zippers are popular in pure functional languages.
 
Maybe. Maybe I'm also way too imperative to see the point of scripting in a functional language.
 
@RMartinhoFernandes I thought those were for trees.
 
@Pubby They're adapatable to various data structures.
Arrays, lists, trees, you name it.
Ah, found it: One zipper to bind them all, in Haskell.
 
4:43 PM
What about skip lists?
 
didnt google want to censor their logo today?
 
FSF is off too?
 
Dunno. Also has an invalid certificate.
 
@Pubby FSF?
 
4:53 PM
@TonyTheLion GNU stuff fsf.org
 
ah right
 
@bamboon They have a link on their home page.
 
Of course Tony knows about GNU.
He hunts them for meat.
 
@TonyTheLion SOPA - Internet = SPA
 
4:58 PM
@RMartinhoFernandes yea well today I have to do without, the GNU blacked out. :P
meh
how is std::string s; /*do some whatever*/ s = "somestring"; slower then just doing this std::string s = "somestring"; when and where you need it?
I'm just reading "The C++ Programming Language Special Edition" By Bjarne, and it says that the first in my example "can easily be much slower than" the latter
 
<-- waiting for the benchmarking haters & flamers
 
it's just a question, I'm merely curious why such a statement would be made
 
well, I am interested too
however I think most people say "premature optimization" blah
 
That's not premature optimization. It's being smart.
 
sbi
With a well-timed hit on the Esc key, you can view en.wikipedia.org. :)
And:
Take the opportunity to learn a new language today. Only the *English* Wikipedia is black.
:)
 
5:13 PM
Or just disable JS
 
@sbi but once you click on a link it's back to black
 
@bamboon Are you really interested in [C] optimizations?
 
@Pubby then explain the smartness to us dumb people pls
@Georgi yeap
 
sbi
@TonyTheLion ...unless you use another well-timed Esc.
 
@sbi lol, I'll just wait to use it till tomo
 
5:15 PM
@bamboon Me too, I am new here but last night I made a strstr optimized C function, if you care...
 
sbi
I din't know I use Wikipedia that often. In 8hrs I ran into their black home page at least half a dozen times. #DayWithoutWikipedia
 
@bamboon It's like '\n' vs "\n" vs std::endl. It's not premature optimization to use '\n'.
 
@sbi yea I google something today and clicked on the first link, which was Wikipedia, damnit
 
@Pubby ok, and where does that technical difference come from? I mean, the only thing I know is that the CPU can move the first statements around, can't it?
 
@bamboon I dunno, hehe.
 
5:21 PM
@Pubby haha ok.
@TonyTheLion well then it might be worth a question on SO?
 
@Pubby It also makes no difference to use '\n'.
 
@bamboon just writing it
 
@TonyTheLion perfect
 
@CatPlusPlus Yeah, better practice though.
 
std::string s = "somestring"; is subject to copy elision, that's the whole difference.
It should be std::string s("somestring"); anyway.
And yes, it's silly premature optimisation to think about that at all.
 
5:24 PM
0
Q: Suggested speed improvement when defining string with value immediately, instead of delaying

Tony The LionI'm currently reading in "The C++ Programming Language: Special Edition" by Bjarne Stroustrup and on page 133 it states the following: For user-defined types, postponing the definition of a variable until a suitable initializer is available can also lead to better performance. For exampl...

 
Think ctor init lists — default-construct and assign as opposed to directly constructing.
Not that default-constructing string would be in any way slow.
 
hmm, yes valid point
 
5:40 PM
@sbi Just disable JavaScript.
 
why is there an explicit typename or class in the template argument list of a template? Think template <**typename** T> void foo(T);
 
sbi
@RMartinhoFernandes Yeah, I could do that. OTOH, I have found today that the German Wikipedia does catch up.
 
@sbi Oh, you're lucky. You have a decent national Wikipedia :(
 
sbi
@rubenvb Because there's other kinds of templates parameters besides types.
 
There's national Wikipedias?
 
5:42 PM
yes
 
@sbi but that would be deducible/unambiguous?
 
Wikipedia comes in many languages
 
@CatPlusPlus Well, language Wikipedias.
 
sbi
@RMartinhoFernandes I usually only use the English one, because the German one is so much worse.
 
Not really about nations.
 
5:43 PM
I use national wikipedia's to translate
 
sbi
@rubenvb I wouldn't know. But really, even if it were, I'd rather type a few more chars than have another source of subtle errors.
 
@rubenvb typename T says that T in this case is a placeholder for a type. Whereas if you were to have an actual type in your template, template<int N> the compiler know the type of N, so you don't have a placeholder.
 
@rubenvb Yes, they are deducible.
 
@TonyTheLion but template<T,int N> is unambiguous if T is not an existing type and int is.
 
template <typename T, size_t N> size_t f(T (&)[N]) { return N; } is a classic example.
 
5:46 PM
@RMartinhoFernandes wouldn't that break on GNU-extension var-length arrays?
 
@rubenvb well, it's not specific enough for the compiler I guess. the typename keyword ensures that the compiler really knows that you want T to be a placeholder
 
@rubenvb So? It's an extension, it's up to GCC to make it work.
I have no idea how that would behave.
 
Who cares about GNU extensions.
 
Who cares about extensions? MS does.
 
sbi
@RMartinhoFernandes Actually, the German Wikipedia claims to have 1,345,405 articles, the Portuguese says 710,925. That's not that big of a difference.
 
5:47 PM
@sbi It's almost twice as many.
 
@sbi well, it's only about 600,000 more in the German one
.
 
And those 700k+ articles are crappy and written in some bastardized Portuguese from across the Atlantic.
Sometimes they're harder to understand than foreign ones.
 
sbi
@RMartinhoFernandes Yeah, but from what you wrote I expected an order of magnitude.
@RMartinhoFernandes Ok, this might be letting you down. OTOH, how do Brits feel about the "English" Wikipedia?
 
@sbi Oh, I'm not talking about minor spelling things. It's entire sentences full of words I never heard before.
It's not (just) my xenophobia. It's really a difficulty to understand it.
 
sbi
@RMartinhoFernandes Like "lift"/"ride? "Trunk"/"boot"? "Lorry"/"truck"? :)
 
5:51 PM
Hmm. Ok.
 
sbi
I don't know the differences in world-wide Portuguese, so you might have a point there.
 
I guess I cope easier with multiple versions of English than with multiple versions of Portuguese.
Probably because of exposure.
 
@RMartinhoFernandes you make it sound like language is something radioactive
 
hey anyone know any easy text to speech code?
 
sbi
@rubenvb "Language is a virus from outer space." — William S. Burroughs
 
5:57 PM
so does anyone?
 
@sbi Blasphemy!
 
0
Q: Can an excessively deep C++ class hierarchy cause a stack overflow?

Dragos ToaderSuppose I have a C++ program that has excessively deep inheritance as follows: using namespace std; class AbstractParentGeneration0 { private: ... protected: ... public: virtual returnVal funcName(void) = 0; }; class AbstractParentGeneration1: virtual public Abs...

Damn, it's cold. Where is global warming when you need it?
 
6:24 PM
My answer is sooo the best. I even fixed his broked exampel kode.
0
A: MultiTasking not work in my programm on C++11

rubenvbThis call: thread.join(); explicitely tells your program to wait until the function the thread is executing, returns. Your function never returns, so you program never gets past this function call. You can start extra threads between the thread creation and the corresponding call to join(). Fo...

 
user142019
What does he mean by "Ok, thx. What run thread in parallel stream ?"?
 
user142019
or she
 
Programmers are "he"s.
 
@RMartinhoFernandes sexist!
 
@WTP No idea, but he wrote it thrice already.
 
6:28 PM
@WTP <grabs magic ball>
 
@rubenvb Compilers are "she"s.
 
@RMartinhoFernandes what are you? A male robot?
 
user142019
@RMartinhoFernandes true. They do nothing but complaining.
 
the highest voted answer doesn't even say why the thread never "finishes"
pffff
 
user142019
@rubenvb I up voted that one.
 
user142019
6:30 PM
 
@rubenvb well I said that it never leaves the loop, what more to add?
 
Hey, someone else is claiming infinite loops are not allowed in C++!
 
@bamboon the reason the program never quits. The loop is not running in the main thread.
 
user142019
Using the Reddit API now is a pain. ><
 
@rubenvb yeah but there is .join() so it won't stop
 
6:32 PM
@bamboon well, your answer doesn't explain how that works.
 
@rubenvb i will try to be a bit more precise
 
@rubenvb AFAICT, it does.
 
no, delete your answer and upvote mine ;)
 
Anyway, the program may terminate.
 
@RMartinhoFernandes when does the thread finish then?
 
6:34 PM
@rubenvb Anytime the compiler wants.
 
when the function calls abort();?
 
Read David's answer.
 
@RMartinhoFernandes ugh
 
He's right (even though I had to convince him to fix a minor technicality :).
 
is what he says specific to C++*11*?
I thought the equivalence in optimization rule was already part of C
 
6:35 PM
No, this is not about the "as-if" rule.
 
in retrospect, this is a bad question
 
Tin
hi guys, just a short question. i'm trying to store a vector (std::vector<T> data) into a file using std::copy ( std::copy(data.begin(), data.end(), std::ostream_iterator<T>(fid," "))). how could i establish the precision of float numbers? for instance %.4f?
 
This is about what threads must eventually do.
All threads must eventually make progress, and one of the following: 1) terminate,
2) make a call to a library I/O function, 3) access or modify a volatile object, or 3) perform a synchronization operation or an atomic operation.
The implementation is allowed to assume that holds.
So, optimizing the "infinite" loop away is allowed.
 
So in theory, a very long mathematical calculation in loops is allowed to be optimized away?
 
@rubenvb Not if it terminates and the result is used.
 
6:37 PM
@RMartinhoFernandes hmm ok, I guess a compiler can prove that in this case.
 
@Tin You'll have to loop yourself.
Or maybe find something in boost.
 
Ok, thx. What run thread in parallel stream ?
 
@bamboon try #include <Java>
 
Ok, thx. What run thread in parallel stream ?
 
6:40 PM
@rubenvb But well, if you want an infinite empty loop that can't be optimized, it's not that hard... for(volatile int x = 0; ; x = x) {}.
 
from now on, I will post that as an answer to everything
 
haha, I got the checkmark
in your faces
 
^^
but What run thread in parallel stream ?
 
ooh, resolution operator
Is that what they use at the UN?
Would template specialization be coupled with overloading to provide non-template function specialization on specific arguments?
hmm, that would become problematic when passing &myspecializedfunction around
unless that would become dynamically dispatched on the special parameters
runtime penalty
 
Tin
6:50 PM
@RMartinhoFernandes, i just found a way. it's by calling ofstream.setf(), but still can't define the exact number of digits after the decimal point,ofstream.precision is not working in my case. any ideas? pastebin.com/QwzQmh1M
 
In lambda calculus, are parenthesis ever needed if you have application and composition operators?
 
Tin
@rubenvb, thanks a lot!
 
Composition is associative. I'll have to think about application.
 
@Tin Can I has your repz?
 
6:55 PM
@Pubby Yes, you need it. Consider f ap g . h, is it f ap (g . h) or (f ap g) . h?
 
@RMartinhoFernandes Wouldn't that be (((f ap) g) . h)?
 
@Pubby I'm using ap to mean the application operator.
 
Oh
 
Silly me, should've used $.
 
f $ (g . h) then, no?
 
6:58 PM
But what if you want (f $ g) . h?
You need the parentheses.
 
Wouldn't f g . h be that?
 
Ah, so you have two application operators.
 
I guess, although one's not really an operator
 
sbi
@WTP I think it was wrong closing this. I think this was asking about orange::orange() ("resolution operator"), not about member initialization lists. I don't doubt that there's a dupe for this one, too, but this isn't it. // @Als, @Jerry, @RMartinho, @ruben
 

« first day (459 days earlier)      last day (4473 days later) »