« first day (410 days earlier)      last day (4540 days later) » 

4:00 PM
I find the "varying the fastest" terminology very weird and confusing, FWIW
 
I don't see the logic of why it initializes the first ... ah wait
the second example could be confusing if they used a float[4][4]
but they didn't... to avoid confusion
 
I thought that all lambdas operator() was const?
 
@DeadMG No, capture-by-value produces modifiable nonstatic members.
 
ghci> x
[1,2,3]
ghci> let c3 arg = ((f (zipWith delete)) repeat) arg
ghci> c3 x
[[2,3],[1,3],[1,2]]
ghci> let c3 = ((f (zipWith delete)) repeat)
ghci> c3 x

<interactive>:1:4:
    Couldn't match expected type `()' with actual type `Integer'
    Expected type: [()]
      Actual type: [Integer]
    In the first argument of `c3', namely `x'
    In the expression: c3 x
ghci> _
?
 
it doesn't matter anyway, I read the error again and found the more accurate problem
 
sbi
4:04 PM
There's a Haskell room, you know.
8
 
yay!
it finally compiles
and it didn't even error?
wow
 
@AlfPSteinbach Do :t c3.
 
no
 
ghci> :t c3
c3 :: [()] -> [[()]]
ghci>
I have to convince it that it's not that type?
ghci> let c3 arg = ((f (zipWith delete)) repeat) arg
ghci> :t c3
c3 :: Eq a => [a] -> [[a]]
ghci> _
 
What's f?
 
cpx
4:10 PM
@rubenvb a POD has to be an aggregate but an aggregate doesn't have to be POD.
 
ghci> let f g h arg = (g arg)(h arg)
ghci> :t f
f :: (t2 -> t1 -> t) -> (t2 -> t1) -> t2 -> t
ghci>
 
fgharg? No wonder the compiler choked.
 
huh i don't see it
 
@cpx No, a POD may have base classes but an aggregate cannot.
(And I was wrong about bases needing to be empty, apparently they just have to be standard layout as well.)
 
4:15 PM
sigh, A POD struct is a non-union class that is both a trivial class and a standard-layout class, and has no non-static data members of type non-POD struct, non-POD union (or array of such types). Similarly, a POD union is a union that is both a trivial class and a standard layout class, and has no non-static data members of type non-POD struct, non-POD union (or array of such types). A POD class is a class that is either a POD struct or a POD union
but then that isn't as clear as the definition for aggregates :(
I'll have to copy-paste some more to make it clear :/
Not going to do that
 
How is one clearer than the other? They're both relatively random laundry lists of requirements.
 
@Potatoswatter the latter refers to the non-trivial definition of "trivial" and "standard-layout", the former does not :)
 
I'm a bit confused by "no non-static data members of type non-POD struct". Since C++11 now allows bases, it should be "no subobjects of type non-POD struct"… right?
Otherwise a non-trivially copyable base could get in.
 
my eyes are bleeding
 
owch, that's gotta hurt
how do you mop up the blood from eyes? I mean, it'd be unfun to wipe them with a cloth or something
 
4:22 PM
You should probably not be sitting and chatting on the internet. Get to a hospital.
On the other hand, your typing accuracy hasn't suffered, which is commendable.
 
oh come on, most of us should be touchtypists by now
although I have to admit, I can type significantly faster when looking at the keyboard, it's really not necessary for me
 
Um, looking at the screen is also helpful.
 
I never look at the keyboard.
 
eh
I very rarely look at the keyboard because it's harder to correct errors when you can't see the output
 
There's also the matter of blood getting into the keyboard and making a short circuit.
 
4:24 PM
but it definitely does enable me to type a lot faster, in the general case
 
Xeo
I don't get it. When I leave my PC alone for a few hours and then get back, it turns the display back on but after that nothing else happens. I can't move the mouse, nothing on the screen happens, it just hangs. Sometimes for up to five minutes, no matted what I do. After that, it's just working as usual again.
 
I'd smell hardware error in that
 
could be very slow HDD spinning up :)
 
Xeo
SSD :s
 
very slow SSD spinup speed? <facepalm>
 
Xeo
4:26 PM
What?
 
HDD spinning up takes seconds, not minutes
lol
SSDs don't spin up ^^
 
@Xeo Needs to finish uploading to the botnet.
Solution: run a LAN to your neighbor's house to speed the peer-to-peer connection.
 
well, it could be the operating system hibernating or sleeping, and then taking an unusual (i.e, bug) amount of time to reload
 
Need some help with Unix command to rename a file extension from *.zip to *.txt
 
there was such a bug, I know, in a recent version of Windows
 
4:27 PM
@0x8badf00d Why would you do that.
 
mv doesn't work for that scenario.
 
@0x8badf00d this is the C++ lounge, but what about mv *.zip *.txt doesn't work?
 
@CatPlusPlus Its not necessarily from .zip to .txt but any file extension. I just gave an example.
 
man rename
 
@rubenvb That's not how the shell wildcard works
 
4:29 PM
rename .zip .txt foo.zip
 
I hate the shell wildcard
 
Or mv foo.zip foo.txt. rename will work for larger amount of files.
 
Xeo
Hm, only 2 important Windows updates.
Ooooookaaaay.... now my cursor made funny moves again
just moved to the upper right corner in a slow motion..
 
Wait, nope.
 
Xeo
didn't react until 5 seconds later..
 
4:31 PM
Bit different, but too lazy.
 
Best bet on the botnet.
 
btw
would someone ping me if @jalf drops in?
 
Xeo
Either my PC is the start of the technical revolution and is currently mocking me, or it has a bug.
@DeadMG That would be easy in in IRC with mIRC :D
 
@DeadMG since you just pinged him, hopefully he will oblige
 
well, it doesn't matter anyway, cause I remembered that I have two screens and can just leave the chat open on the other
 
Xeo
4:33 PM
on *:JOIN:#:{ if ($nick == jalf) msg DeadMG jalf's here }
 
which is what I was going to do anywway
 
@Xeo: you can lure the bug out with some honey, or maybe you should just spray some RAID in your PC
(every pun intended)
 
cpx
@Potatoswatter oh i see, they changed the definition in new standard. In C++03, a POD-struct is an aggregate class.
 
@CatPlusPlus I need to use wildcard.
there is only one file with .zip extension that I want to rename as .txt
 
If there is only one, then you don't need to use wildcard.
 
4:36 PM
In theory, you can use the shell to echo a C++ program into a file, compile it, and let that rename the file :)
 
Xeo
lol
True meta programming, eh?
 
no, just plain evil :)
 
I am writing a shell script though. No human intervention.
 
Xeo
Is multiline possible in shell?
 
Filename has some numbers and weird naming convention I don
don't want user to mistype it.
 
4:38 PM
@Xeo multiline isn't necessary for C++, you've got ;
 
Xeo
You can edit your previous messages if you hit the up arrow key
@rubenvb Not for includes, the preprocessor is newline delimited
 
@Xeo crap, didn't think about that :(
 
Ah, C++ printers...
1
Q: How to get to know the printer is a real one or a paperless printer?

sooraj subramanyaHow can a C++ program distinguish an actual printer from a virtual printer (e.g. a PDF creator)?

 
@Xeo In bash, yes.
Dunno about others.
 
Xeo
@rubenvb Content of the program: int main(){ system("rename .zip .txt foo.zip"); } :D
 
4:40 PM
@Xeo lol
 
g++ -o foo - <<EOF
blah blah
EOF
 
Xeo
hm
echo "int main(){ system(\"rename .zip .txt foo.zip\"); }" > foo.c && gcc -o foo foo.c && ./foo
 
@Xeo dust
 
Xeo
> syntax error at (eval 1) line 1, near "."
:(
 
echo 'int main() { system("..."); }' | gcc -x c -o foo - && ./foo
 
Xeo
4:45 PM
oh, yeah, piping
Not really used to the shell yet
But it does produce the foo.c and compiles fine
 
Damn, I can see flags. It's a strange experience.
 
Xeo
@EtiennedeMartel Believe me, it's an annoying experience.
Especially in chat.
 
You can just UserCSS them away.
 
There was a flag where someone said "fuck".
I marked it as invalid.
That'll teach 'em.
 
Xeo
There was a flagstorm in this room where every message containing "fuck" was flagged by some idiot who randomly wandered into this room.
 
4:48 PM
Yes
It cost the guy a position in the moderator elections
Never seen so many downvotes
 
Xeo
Oh, really?
link!
 
that was far from the only reason he was downvoted
 
Xeo
link link link! I wanna kick in too!
 
the guy acted like that everywhere, it wasn't just to us
 
Look for "genesis"
@DeadMG Indeed, but that's why I downvoted him.
 
Xeo
4:50 PM
"Windows needs to be restarted for updates to be installed" -> "remind me in: 4 hours"
@EtiennedeMartel Thanks
 
You know, that's why I'm not sure that automatically giving moderator rights to anyone with sufficient reputation is a good idea
Reputation is too easy to get
 
Xeo
@EtiennedeMartel How do you know he was the one who flagged all those posts?
 
37
A: Why am I suspended from chatting for a message that&#39;s from May this year?

sbiSome teenager, who never answered a single C++ question on SO, and who was never before seen in the C++ chat room, storms into the room, actively searches the room's history for words and phrases he finds offensive and then goes on a rampage flagging a bunch of old messages. Of course, given just...

 
Xeo
@EtiennedeMartel Ahh
 
i don't yet understand how people harvest rep points at SO
i understand that guy genesis did
but how?
 
4:56 PM
Good question
I've been here for more than two years, and I have less reputation than people who've been here for 3 months
(By "here", I mean SO)
 
anyway haskell problem partially solved, i just put following in an external file:
f g h a = (g a)(h a)

c3 :: Eq a => [a] -> [[a]]
c3 = ((f (zipWith delete)) repeat)
but i sure wish there was some easy way to type in the interpreter what you can say in a file
 
0
Q: Can standard container templates be instantiated with incomplete types?

PotatoswatterSometimes it's useful to instantiate a standard container with an incomplete type to obtain a recursive structure: struct multi_tree_node { std::vector< multi_tree > child; }; struct trie_node { std::map< char, trie_node > next; }; This tends to work because containers don...

 
You basically manipulate the system so that your clunky answer shows up on pages less visited, with OPs that are less knowledgeable. You post a quick, barely correct answer ASAP, then edit later to be solid so when people that know better do show up they don't downvote. Then you ride the vote feedback wave. IMO it's a bad thing, because it lowers the overall quality of the site, and because downvotes have less of an impact than upvotes.

Also if anyone did downvote your quicky, you'll likely get sympathy votes just as soon as your edit is done.
 
Yeah, genesis was here for 6 months and he has 1.8k answers.
I don't even have 300
 
When written down, it doesn't seem to be bad, because 1) you're going to edit into a good answer, and 2) if your answer is still bad, you still get negvoted. However, neg votes don't punish harsh enough when people are gaming rep.
I think it would be fair to also display voteup/votedown ratio.
 
Xeo
5:05 PM
-2 rep.. yeah... hurts so hard. :) Even with 2 down and 2 up votes, you still got +16 rep
 
It's essentially treating SO as a game rather than a QA site
 
Xeo
@Xaade Uhm, you can see them if you have (I think) 5k+ rep. Just click on the post score
Oh, wait, ratio
 
The point of this site, is that people who truly know answers that will help, should answer. Popping in with half-baked answers just to earn rep, is bad for the site.
 
I agree
downvotes don't punish enough
you can post answers which are plain wrong and just shrug it off
 
-5 would be good
 
5:08 PM
I mean, it would take thousands of downvotes to put a significant dent in the rep of someone like me
 
Maybe even -10
 
@Xeo I mean a total ratio of up/down that is reflected by their rep. If you want to divide between Q and As, that's another story. The point would be you'd see someone with 1000/2000 even though they have a rep of 6000.
 
well, I definitely think that for a specific answer, you should not gain rep if you have 0 score total
 
@DeadMG That's the problem. You wouldn't want a single question nuking your whole rep.
 
I doubt it would happen.
 
5:09 PM
it would never happen
 
It could if it was -10
 
even if you posted something like "Fuck you all to hell", a mod would delete it
 
Xeo
And even if, just delete the question
 
If your answer sucks that much, just delete it
 
Xeo
Restores all the rep
 
5:09 PM
but what's more likely is that because highest voted answers go first
even on the more popular questions
 
-10 and 100 votes, that's 1k right there. I'd have no rep.
 
people don't downvote the bad answers; they just upvote the good ones
 
Why would somebody downvote you 100 times?
 
Xeo
@EtiennedeMartel Serial downvoting.
If somebody has a grudge against you
 
Unless he has something specific against you.
 
5:10 PM
@Xeo We already have mods and meta to handle that. It's a separate problem.
 
Contact a mod, then
The problem is the user, not the system
 
I think there should be a max amount of up and down votes per question / answer. Only the first X up and the first X downs count.
Or, you get diminishing returns from each vote.
 
Xeo
That would also be mean
Because some questions/answers are really great, and they deserve the rep
 
That way you can't get nuked, drive bys hurt less, and you still prevent gaming.
 
Xeo
Better, just take the score of the post.
 
5:12 PM
@Xeo No, they don't.
 
Xeo
0 score, 0 rep. 10 score, 100 rep. -2 score, -20 rep
 
most very highly voted answers don't deserve anything like as many votes as they get
I've got a +200 answer on Programmers, and it was about 100 characters of the fucking obvious
 
I'm saying, you have a max rep limit, so have a max neg rep limit.
 
Xeo
@DeadMG I especially said "some". And that means a selected few.
 
When people see a high score, they have the compulsion to upvote it even before they read it
 
5:13 PM
how upvoted you get is a function of how many people view the question, effectively, given a minimum quality answer that's already on top
not how worthy the answer is
 
Xeo
Like the questions/answer by some in here
 
There might be one, and I just don't know.
 
Get fast enough, and you can be the top voted answer.
Then, watch the rep come to you
 
I'd have no problem capping votes at +10 or +25
 
Xeo
@DeadMG Well, that's another aspect
 
5:13 PM
the difference between serial downvoting and mass answer upvoting
is that serial downvoters get banned and the downvotes corrected by moderators
but if you post 100 characters in thirty seconds that just happens to get viewed by 20k people, there's no auto-correction for that except rep cap
 
The problem is that you did nothing wrong.
 
but in my opinion, the rep should be capped per question
like, say, +500 and -500
dished out proportionally by the number of votes
so if you're the only guy who answers and you get +1 or 0, you get +500 or something
 
Xeo
23
Q: Mitigating publicity-driven vote inflation

Tomalak Geret'kalFollowing the Reddit debacle™ back in January, we've had another instance today of a question becoming overwhelmingly popular due to external "advertising". As soon as Joel tweeted about Eric Lippert's fantastic answer, the viewcount shot up. The OP received three gold badges for the question, w...

 
@DeadMG Well, I think that problem is because the community lets the max daily rep limiter solve that problem, without thinking about questions that daily hit the cap on their own through the feedback effect. Sometimes allowing a person to never have to do anything again for a week.
 
It's funny because that guy got a lot of rep real fast
 
5:18 PM
but the daily rep limiter doesn't solve that problem at all
partly because you can hit the daily rep limit on every day for a week
and partly because you still get badges & shit
and partly because it drowns out other perfectly good or even better answers
 
Simple solution.
 
Anyway, gotta go
See ya all!
 
Votes are capped at +25 and -25.
Upvotes count for 5 rep.
Anyone can vote for the question. But if it's at 25 already, their vote won't mean anything unless someone else downvotes.
 
Xeo
Ugh... my sight is shacking..
 
uh, shocking? :P
 
5:22 PM
I have no problem sorting through questions that would have been at 100 or more compared to a answer at 50. If it made it to +25, it's a good answer.
Maybe you can sort by the hidden votes as well. There won't be this feedback effect, because people will see two answers at 25, and read both before voting.
 
Xeo
Ugh, it's just 6:30 pm, but I'm so sleepy, I'll leave early. g'night everyone.
 
ok
I restructured my project so as not to have one single header that pulls in all the external components and random utilities
that's better, right?
 
What does this guy mean?
0
Q: The exactly use of string comparison operator __TO-DO__ in Bash

KyrolI'd like to know the exactly and correct way to use TO-DO in a Bash script. I don't understand how to use it.

 
cpx
night
btw, how do you say night while yawning, like mawning?
 
@cpx "M. Night"?
 
cpx
5:35 PM
hmm
 
Xeo
naaaight
 
… Shyamalan?
 
evening all
I have a simple task which I am having trouble with
I have a C interface, so I need to read a series of lines from a file and put them in a vector of char*, but the pointers point to junk when my function exits
void get_command(const std::string& filename, std::vector<char*>& commands)
{
	std::fstream file(filename.c_str());

	std::string temp;
	while(std::getline( file, temp)) {
		char* buff = new char[temp.size() + 1];
		buff = const_cast<char*>(temp.c_str());
		buff[temp.size() + 1] = '\0';
		commands.push_back(buff);
	}

	file.close();
}
 
easy, a dangling participle! "with which I am having trouble"
 
lol
what have I done wrong?
 
5:48 PM
Not it, but why is a const_cast instead of a std::vector< const char * >?
buff[temp.size() + 1] = '\0'; // modifies 1 past end, drop the + 1
Hmm… that shows you haven't used valgrind… try using that if you have it
 
: Help people understand the use for a tag.
 
uh
@Tony
lolwot?
 
Wait, you're missing strcpy. No data goes anywhere except the terminating byte
 
he's also leaking memory like a sieve leaks water
 
Yes… lol
Well, that's C for ya.
 
5:53 PM
you need to write the algorithm in C++, and then write just the interface in C
 
hmmm
so I have to strcpy the temp into the buff, and then add the buff to the vector?
can I not use std::copy? or is that a different thing?
 
@TonyTheLion That will work, but it is different. The C++ name for strcpy is std::char_traits<char>::copy.
 
no, no, no
 
oh wow, didn't know that existed
@DeadMG what? no
 
give me a sec
 
6:04 PM
Also, if the C side will be calling free on this command block, you should use malloc instead of new[].
 
write the C++ algorithm first
store the result on the heap
provide C-interface accessors
 
@DeadMG That's not how local classes work…
 
ah, whatever, you get the picture
the point is, there is absolutely no need to go back to strcpy or anything like it
 
and the point is that the C code expects an array of pointers, which it will likely inspect directly and then pass to free. At least that's how I interpret the question. Tony, any clues?
 
I only saw two things in the question: an algorithm, and the need to expose a C-consumable interface
both of which requirements I have met
 
6:17 PM
a QQQQQQueeueueue
0
Q: is this safe? (qt QQueue.dequeue() c++ inline pointer dereference)

njahnkeObject object = *(queue.dequeue()); queue is a QQueue<Object*>. i'm concerned that the dequeued pointer is deleted before i dereference it. of course i can access object's data but that doesn't mean anything. doing it all in one line like this is convenient (i don't want a pointer because...

and deqQQqQQQQuuuueueueueue
 
@DeadMG usually in this kind of situation the C code is legacy, the object is to produce its required binary format
 
6:46 PM
Woo, the yellowness in the reputation summary is back!
 
@Potatoswatter So I didn't use a vector
 
@DeadMG ping
 
@mwmnj What am I supposed to say? Congratulations. You did it your way, contrary to the advice you asked for.
 
Only ~200 more C++ questions, then we have 100,000.
 
ohai jalf
 
6:51 PM
Yay, let's ask more variations of i++++++i.
 
sbi
@AlfPSteinbach He did it by posting gazillions of answer. On the occasion of his election I once calculated his rep/answer ratio, and it was abysmally bad. (I think he has since deleted some of his worst answers.) For half a year, he has been posting an average of 10 answers per day. He has little more than 1 upvote per answer on average, but at 1.8k answers, that's still a lot.
 
so I finished fixing up my lexer
 
quantity over quality, basically
 
> 'a' == 'b' is a great way of saying false in a language without false.
 
atm I'm using the normal [_a-zA-Z][_a-zA-Z0-9]*
 
6:52 PM
@sbi At the time he had less than one upvote per answer. He surely deleted some.
 
but I wanted to check with you about the definition before, about "anything that isn't something else"
 
@DeadMG Star is on the wrong place.
 
@DeadMG Yay, a regex I can understand at first glance!
 
It's [_a-zA-Z][_a-zA-Z0-9]*
 
sorry, used to prefix since that's the C++ syntax :P
 
6:53 PM
Oh, ok.
 
* should have been postfix in C, in retrospect.
 
so if I wanted to do "anything that isn't something else", I'd have something like
!(punctuation || string || character || whitespace)
 
sbi
@RMartinhoFernandes Ah, thanks for remembering that! I forgot.
 
I've got 21.4 rep/answer
 
sbi
@EtiennedeMartel For a while, I, too, played the rep game on SO, but it got old after a while, and I got bored of it. Nowadays I only answer when I happen to stumble into an interesting question that either has no answer yet or has none that I'd approve of. And fuck the rep. My rep increase on SO nowadays is mostly driven by old answers.
@DeadMG If we compare dick sizes now, you might want to have a look at my profile before you boast of your achievements.
 
6:59 PM
heh
I'm not comparing my dick size
for a start, I don't care for rep
 
so my vector has vector<const char*> but my c function wants a char*, what's the best way to convert?
 

« first day (410 days earlier)      last day (4540 days later) »