« first day (694 days earlier)      last day (4256 days later) » 

@jalf woah...
 
Ell
8:23 AM
Lol @frog in space
 
in my current company using std is prohibited. and I cannot use template I need to do a for loop instead of using std algorithms. and I cannot use iterators too. ;( have anybody faced this before ?
 
Ell
Using std is prohibited? Whaaaat?
 
Ya you cannot use std::list, std::vector
 
Ell
you are not allowed to use templates either?
 
Yep
I cannot write functors by overloading operator()
 
Ell
8:27 AM
What on earth is the reason for those?
 
THESE ARE COMPLEX
 
Ell
Seriously that's messed up,
every beginner starts with std::vector and std::string :o
 
There is QList, there is QVector in QT
use them
even when you don't need QT use QT's data structures
 
Ell
That seems a bit pointless to me, maybe I just haven't been shown enough issues with std
 
@Blank I must say I'm baffled/flustered how you can confirm that and not respond to the next line:
22 hours ago, by sehe
I'd say this should exactly that: '<,'>g/^/t '>
 
8:32 AM
The architect is from Java/.net background. and whenever I do any such think I get a mail asking "why are you making things complex"
 
Headhunter etc.
 
@Blank That should do. Another :'<,'>d (or, shorter :*d) would remove the original. Anyways, if it's just flipping: :'<,'>!tac would be fiiine for me :)
 
Do Java have template, algorithms etc .. ?
 
Ell
java has bodged up generics, but no templates
 
bodged up ?
 
Ell
8:33 AM
And java has its own container classes
Not sure about algorithms
 
But how do you say list<int> in Java ?
if there is no templates ?
 
ArrayList or LinkedList
 
Ell
Well you can do that but they aren't called templates
 
but it doesn't specify the element type ?
 
Ell
they are actually just a list<object> with a few extra compiler checks or something, can't remember
 
8:35 AM
@NeelBasu The point is, they're not actually generic. Not in the way that CLR has generics. And not - at all- in the way that C++ has compiletime generics even
@Ell Precisely. Compiler checks only, no runtime checks and no performance speciailizations.
 
C++ doesn't have runtime checks either.
 
@NeelBasu think about what List<int> will do in Java. In .NET, you'd get an actual array of ints in the implementation
 
Ell
C++ templates are code generators
 
@LucDanton You don't need them since it stays strong typed.
@LucDanton In C++ you'd want runtime checks with type erasure
 
@sehe So whats the difference with template ?
 
8:38 AM
Is it just me or is the orchestration of condition variables, mutexes and locks very delicate and error prone?
 
@sehe I really think you have a problem with terminology here.
 
Ell
18
Q: What are the differences between "generic" types in C++ and Java?

popopomeJava has the generic keyword and C++ provides a very strong programming model with templates. So then, what is the difference between C++ and Java generics?

 
@StackedCrooked Yes. "Locks don't scale" is the usual form the wisdom is condensed into.
 
Locks are one thing. But when using condition.notify_one() and condition.wait(lock); I often get deadlocks, due to errors in my code. Maybe it's just lack of experience...
 
@Ell It looks like what Java says generic is merely a concept check in C++ ?
 
8:42 AM
@StackedCrooked You should wait on a condition. I don't mean a condition variable object, I mean a logical condition.
 
I started to realize that during my most recent debugging session.
 
What is the behavior of % operator in C and C++ throughout the standard?
I went through this question: stackoverflow.com/questions/7594508/…
It mentions implementation-defined behaviour in C++03 - Well, I have to believe it since I cannot find the draft. For C, I searched through C99 and C11 document - nothing about undefined / implementation-defined for % operator with negative number
 
C and C++ have converged to the same behaviour in that respect.
 
Ell
@neelbasu well whatever it is, java generics aren't near as useful as c++ templates
 
So.... what will i be after i = 7,i++,i++;?
 
It will be: 9!
 
Ell
why use commas?
 
For sport.
 
I don't follow
i++ returns the previous value...
so... am I missing something obvious?
 
9:15 AM
@LuchianGrigore 9. ; ends the statement, so it does not matter if you use ++i or i++.
 
Doesn't matter what it returns. What matters is that i++ increments i.
 
And , is a sequence point, just like ;.
 
I want to "encrypt and decrypt with a key" facility in C. Could anyone tell any simple library for this?
 
@shiplu.mokadd.im std::shuffle?
 
@StackedCrooked it does. i=i++ won't modify i...
 
9:16 AM
, is like ; except that , is between expressions and ; is between statements.
 
@LuchianGrigore That's undefined behavior.
 
@LuchianGrigore You have no sequence point there.
 
Ell
@shiplu.mokadd.im hmmmm openssl?
 
@StackedCrooked Stacked I am trying to use C
 
Sequence points like , and ; guarantee that one operation is complete before the following starts.
 
9:17 AM
@Ell Ell Its an open source project. I think someone opensssl is not compatible
 
nah, sorry, that's java
:D
I'll just leave now :D
 
Java is evil.
 
@daknøk Btw did you sleep with that girl?
 
@StackedCrooked I never said I would.
Only that she wanted it.
 
Ell
why didn't you want it?
 
9:20 AM
I never said I didn’t want it.
 
Ell
so you both wanted it. but you didn't?
 
You're as cryptic as that library this guy is looking for.
 
Well, that we wanted it doesn’t mean that her parents agreed with us. xD
 
^couldn't get it up
 
Ell
@daknøk her parents don't have to know. but I know that situation and it sucks le big time
 
9:22 AM
Don’t have to know?
She lives with her parents.
 
Ell
so invite her to your place
 
And I’m not really a ninja.
 
Ell
or do it somewhere else
 
@Ell On her birthday, good idea!
 
Ell
you can be ninja when you want to be ninja
ahh okay :L
 
9:23 AM
:P
 
Ell
well do it another day, like today :D
 
I have to go to school tomorrow at 8:30.
 
Ell
does she go to your school?
 
No, she also has to go to school tomorrow at 8:30, and her school is 80 km from here.
 
Ell
aw well that sucks :/
 
9:25 AM
lolz xD
 
Ell
meet after school?
 
I’m going to poke random strangers on Facebook just to troll them.
 
She's pulling it off.
 
Ell
9:49 AM
is jessie ware well known?
 
@Ell All I know is that she's rated highly on alternative music chart in Belgium. ^ This one is currently rated a little higher.
 
Ell
ahh okay
 
Belgian artist. Has the home advantage :)
 
Ell
first 30 seconds don't please me :L
the chipmunk voice I mean :o
but yeah it's okayyy
 
Not that good really.
 
10:04 AM
@StackedCrooked Belgium is fictional.
 
@daknøk Belgium is awesome
 
Belgium has such low self-esteem that it tries to claim fame by saying that French fries are really a Belgian invention.
 
They are.. -.-
 
Belgium has Brussels.
 
It's likely true, just not a really strong accomplishment.
Frying potato isn't rocket science you know :p
 
10:07 AM
Brussels is the heart of the European Union, which sucks.
Rocket science ain’t rocket science.
 
We have one of the better universities if you look at the charts.. accomplishment enough. Anyway I'm not gonna go deeper into it I got a more important question x')
 
I recently read post about rocket scientist having trouble with the DVD player controls. So it was concluded that DVD players are in fact more complicated than rocket science.
I probably missed the point of that article.
 
Hi guys don't know if this is the right spot to ask but there must be some computer science engineers here who might know ^^.. It's a question from an exam computer architecture and don't know exactly 'what' to answer.. In pipelining you can have hazards. (data hazards, control hazards..) now the professor gives the def. of a hazard as 'A hazard is the possibility for the program to deviate from the sequenial semantic flow' then he asks 'What does semantic mean here'?
I thought it was like 'The normal logical flow of the program' and if the semantics are 'wrong' then certain registers, instructions don't really do what they were intended for anymore?
 
Hazards? NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP.
 
:p
nobody..?
owh well I'll just put my money on my own answer then : )
 
10:19 AM
// What do you think of the practice of return null when not found?
Item * findItem(...);
 
@StackedCrooked Everyone
*does it from time to time
 
@StackedCrooked in C++? Return a reference.
Not found = exception or std::end(container).
 
10:34 AM
There's also boost::optional, which is probably better than a pointer since it builds on value semantics.
 
And which isn’t movable. :<
Ah well, shouldn’t be a problem with RVO.
 
It isn't movable? Bummer.
 
5
Q: Is it possible to move a boost::optional?

daknøkI've been trying to define a defaulted move constructor in a class with a boost::optional member variable. #include <boost/optional.hpp> #include <utility> #include <vector> struct bar {std::vector<int> vec;}; struct foo { foo() = default; foo(foo&&) = defau...

 
@StackedCrooked Getting C++11 move semantics into every Boost library seems to be a major undertaking.
 
@FredOverflow They don’t have to do it for every library at once.
 
10:38 AM
Boost didn't anticipate too well to that then.
 
"Java has the generic keyword " --- Huh? o.O — missingfaktor Jan 15 '10 at 18:38
lol
 
Java has-a generic.
Do you pass arguments by const-ref once they are greater that 64-bit, or do you also do this for bigger objects.
 
std::string is only 32 bits on some implementations.
I don't think the guideline "if object bigger than n bits pass by const reference" is of any practical use, except for scalar types.
 
10:54 AM
I mean object size bigger than largest native register.
And I was talking about POD-like types.
 
I pass by reference to const if I don't know the type (hello template code) and I only want to read.
 
I do that as well.
 
Ah, okay. I pass PODs up to 4 words by value, but that's just me :)
 
I pass everything by const reference unless I’m going to move or copy it anyway. Also scalars are by value.
 
If in doubt, measure.
 
10:55 AM
But for example IPv4Header is 20 bytes.
 
Pass it by value. The less indirections you have, the more optimization can the compiler do. Reference and pointers get in the way too often.
 
I feel tempted to do so.
 
I pass it by const reference until I find out there is a bottleneck there in the indirection.
 
Because a 20-byte copy is always cheap. But aliasing issues that might occur are more expensive.
 
@daknøk Which is also fine. It won't matter in 98% of the cases, anyway.
 
10:57 AM
But a stack-allocated object that you pass by reference into a function is probably not vulnerable to aliasing trouble. At least that's what my gut feeling tells me :P
Because that would be stupid.
 
I like 98% by the way, because the remaining 2% is 1:49, and those are both squares :)
 
@StackedCrooked restrict! Who cares about portability? :p
 
Portability also has its restrictions.
 
lol
Does C11 have restrict?
 
Yes.
 
10:59 AM
Cool, so C can finally be as fast as Fortran after 40 years :)
 
std::unique_ptr<T> restrict foo; would be interesting.
clang does support restrict just like const and volatile after non-static function members.
class foo {
public:
    void bar() restrict;
};
But that’s a language extension, obviously.
@FredOverflow C99 already had restrict.
 
How can i use c++ libraries on sublimetext with minGW?
 
@daknøk Oh, I thought it was rejected back then.
@zyngawow What is sublimetext?
 
C++ doesn’t have restrict.
@FredOverflow The best editor ever.
 
Then it has documentation where you can find info on include directory and library directory settings.
 
11:01 AM
Also it is an editor, not an IDE.
 
Can i just save the header file in the source folder?
 
> Sublime Text: The text editor you'll fall in love with
sounds intriguing
 
Sounds true.
 
@zyngawow Depends on your compiler and whether you want to use the #include <foo> or #include "foo" syntax I guess :)
 
I dont care about syntax, i just want to do it the simplest way, I come from Java and it was soooo easy
 
11:03 AM
@daknøk Oh, shareware. I haven't seen that in years.
 
@zyngawow I suggest Haskell.
 
@zyngawow How do you compile? Do you have a build script? Or does sublimetext have a compile button or something?
 
I have a build script for Sublime
 
show it
 
{
"path": "C:\\MinGW\\bin\\",
"cmd": ["c++.exe", "-static", "-o", "$file_base_name", "$file"]
}
 
11:05 AM
6
Q: g++: how to specify preference of library path?

Heinrich SchmetterlingI'm compiling a c++ program using g++ and ld. I have a .so library I want to be used during linking. However, a library of the same name exists in /usr/local/lib, and ld is choosing that library over the one I'm directly specifying. How can I fix this? For the examples below, my library file is ...

 
u now, CPATH for headers
 
1
Q: How do I include a path to libraries in g++

mrswmmrI am trying to include the path to extra libraries in my makefile, but I can't figure out how to get the compiler to use that path. so far I have: g++ -g -Wall testing.cpp fileparameters.cpp main.cpp -o test and I want to include the path to /data[...]/lib because testing.cpp includes file...

 
itlooks like this last question is about include paths, and the first is about library paths?
googling turned up the -L option immediately (for libs), but not the environment variable
 
Use GHC and Cabal and you’ll never have any problems.
Also UNIX-like OS, not Windows.
 
Might cause problems with overload-resolution.
 
11:11 AM
Who cares about patterns. If what you do does the job it’s fine.
 
Sometimes it does more than just its job.
I've been doing the weirdest kind of stuff lately.
 
You’re experimenting!
 
@daknøk The multiple selections are awesome. I think I have already fallen in love!
 
^ Somehow they manage to condense red wine and mix it with butter (on top)
 
I’d like to ask for a few undelete votes, please
This is the answer I’d like to accept but the owner has deleted it, no idea why:
 
11:16 AM
foo
 
baz
 
@KonradRudolph i think u should respect the wish of the poster. he probably realized there is something wrong with the answer. this is one of the situations where the SO style of hindering communication (her: no way to contact person) becomes painful
knurre
voff
 
@Cheersandhth.-Alf Hm. It works though and seems R-y so there isn’t any style objection either
 
@KonradRudolph Just click "edit", copy the answer to the clipboard, create your own answer, paste, accept, profit :)
 
11:23 AM
@FredOverflow In fact, that’s what I’m about to do, until the original poster undeletes his
There, done
0
A: Iterate over cartesian product of vectors

Konrad RudolphSven Hohenstein has posted what I consider the “correct” answer (at any rate, that’s the solution I ended up using, and it’s beautiful). Since he’s deleted his answer I’ll post it here. If there’s any objection to this answer which I don’t see, please tell me in the comments. You could use the...

 
My colleagues often use the expression "That's not very OO" when talking about a bad code design.
:D
 
So bad is good?
 
Head explodes.
No it just plain bad either way.
:P
 
bad
adjective
2 having the required qualities; of a high standard: a bad restaurant | his marks are just not bad enough.
• skilled at doing or dealing with a specified thing: I'm bad at crosswords | he was bad with children.
• healthy, strong, or well: she's not feeling too bad.
• useful, advantageous, or beneficial in effect: too much sun is not bad for you.
• appropriate to a particular purpose: this is a bad month for planting seeds.
• (of language) with correct grammar and pronunciation: she speaks bad English.
 
Ok I think "bad" was a right choice of words.
I was reading in Atwood's book about how 98% of programmers are not capable of solving the most trivial problems. That's kind of hard to believe. I'd like to subtly test some of my colleagues. Not to make fun of them, but simply to verify if the numbers are factual.
 
11:34 AM
That’s because 98% of programmers learnt programming at school.
 
I guess many novice programmers think of programming as creating a class and adding getters and setters.
A bit like typing letters.
 
Programming is learnt in your spare time because you find it interesting. Not because your teacher wants you to.
Like most things.
I have had three years of French class, still I cannot construct a single decent French sentence; I never found it any interesting and I never cared.
I don’t even know the conjugations of être.
 
Hooray, I understand exception pointers a bit better now. I amended my write-up on std::promise to include seven test cases for destroying promises.
 
I improved my program performance by 300% by eliminating pointer dereferences and dynamic dispatches.
The resulting code is like 10% the size of the original code.
It's a single header file now.
 
Simplicity is always good.
 
11:43 AM
“I improved my program performance by 100000% by solving race conditions with locks instead of sleep()!” :D
 
@StackedCrooked Less is more.
 
If you are new here, please read the newbie hints right away, and only post here afterwards. Thank you.
18
Imma take a shower. Später.
 
@FredOverflow It's simpler. When I started the rewrite I thought that it would likely end up to be a convoluted heap of templates. But it didn't turn out like that. It's simple and straightforward.
Well, it is my third major attempt..
 
12:04 PM
Does anyone know what this database syntax means?
 
@KerrekSB I forgot what it’s called but it’s a pretty common way of representing relations (R) and dependencies between them
 
I gamble on columns and combined keys.
 
A functional dependency is a constraint between two sets of attributes in a relation from a database. Given a relation R, a set of attributes X in R is said to functionally determine another attribute Y, also in R, (written X → Y) if, and only if, each X value is associated with precisely one Y value. Customarily we call X the determinant set and Y the dependent attribute. Thus, given a tuple and the values of the attributes in X, one can determine the corresponding value of the Y attribute. In simple words, if X value is known, Y value is certainly known. For the purposes of simplicit...
 
@KonradRudolph Hmm. So what does AB->C mean?
 
map<Key<A, B>, C>
 
12:07 PM
Oh OK :-)
@StackedCrooked And key<A,B> is the same as key<pair<A, B>>?
 
I'm just speculating. But I think AB means a combined key.
So yes.
 
@KerrekSB the keys of an element from A and B each, taken together, uniquely identify an element in C
@StackedCrooked yup
 
I wonder if such convenient notations exist for network protocol hierarchies. That would help me with my note-taking.
 
421
Q: What do "branch", "tag" and "trunk" really mean?

grapefruktI've seen these words a lot around Subversion (and I guess general repository) discussions. I have been using SVN for my projects the last few years, but I've never grasped the complete concept of these directories. What do they mean?

Why was this closed? Voted to reopen.
 
user784668
@FredOverflow Because metapolice.
 
12:14 PM
@KonradRudolph Essentially like a pair then?
@FredOverflow Haha, four reopen and four delete votes. Now it just needs a protect vote.
 
FOLKS
all i'm asking for is a nerd fight!
two of my colleagues fighted last friday about whether linux is better than windows and more stable
 
"When in doubt be on the lenient side." I wish the Stack Overflow community would adopt this as a general moderation principle.
 
it was really funny
 
@JohannesSchaub-litb IMO Linux sucks quite bad. I'm using Ubuntu daily at work and I don't like it.
 
@StackedCrooked one of the colleagues tried to disable the screensaver...
 
12:21 PM
And it's mostly the desktop experience that ruins it for me.
 
he disabled one and after waiting 5 minutes more the scree again blacked out
disabling the other... still on!
lol
at the end he tried 5 ways to disable the screensaver and it finally worked
 
Yeah, configuration is a joke.
I messed up something with the audio drivers on my system. Or I installed new drivers that are different from the standard ones provided by Ubuntu. And now I don't have sound anymore. I'm now just waiting for an opportunity to reinstall from scratch again.
 
linux is only good if you kow the entire linux stack
but noone knows it's too big xD
 
I think the Year Of the Linux Desktop will be when the web takes over :)
The whole Linux desktop should be remembered as a embarrassing phase in the history of Linux.
I don't particularly dislike the under-the-hood aspects. I don't really know much about them either.
 
12:28 PM
Nah
Procrastination is good even in the end.
Also I’m awesome.
 
procrastination is the way to go :P
 
they should have stopped at KDE3.5
it was excellent
now KDE is just a pile of crap
 
They should have switched to OS X.
 
Gnome has also been fucked up.
And then there's Unity.
 
Proprietary software ftw.
 
12:31 PM
I really like my Mac. And I don't think it's solely because of brainwashing.
 
And GPL-licensed libraries are just cancers.
GPL is only fine for programs.
@StackedCrooked that. :D
Or well,
I really like my Macs.
 
@KonradRudolph Grand. I think I've figured it out then. Thanks!
 
19 hours ago, by Tony The Lion
user image
OMFG that'S so awesome
i pee in my pants
 
yep :)
It's a park in Argentina
 
where's the double rainbow??
 
12:36 PM
@JohannesSchaub-litb Looks like some sort of Indiana Jones 4 showdown scene, with the energy bubble and all
 
@JohannesSchaub-litb Hidden in the belly of yo momma.
 
@KerrekSB actually that's real. there's always more light below the area of a rainbow
 
Rainbows are virtual images.
When you reposition your eyes, the rainbow repositions with you.
 
I want to learn more about networking. I think I’m going to write a networking library in C++.
 
12:39 PM
ive always been thinking to write a c++ compiler
 
@JohannesSchaub-litb Hm. Sounds like magic?
 
never got it started
 
@JohannesSchaub-litb Hm. Sounds like magic?
 
I suggest writing a compiler for a more decent language.
 
12:40 PM
C++ is most decent
 
Haskell is the most decent.
 
only for the gurus
 
TIL: I’m a guru.
 
what does it mean
TIL
 
12:47 PM
1 hour ago, by daknøk
If you are new here, please read the newbie hints right away, and only post here afterwards. Thank you.
@JohannesSchaub-litb lol now you can say:
TIL the meaning of TIL.
 
"we want an apparently free environment in which exploration causes desired sequences to happen (Montessori); one that allows kinesthetic, iconic, and symbolic learning — “doing with images makes symbols” (Piaget & Bruner); the user is never trapped in a mode (Grail); the magic is embedded in the familiar (Negroponte); and which acts as a magnifying mirror for the user’s own intelligence (Coleridge)." - Alan Kay
^ I like that phrasing "acts as a magnifying mirror for the user's own intelligence"
but what about users with 0 intelligence?
0*x = 0
 
I.e. all users.
 
Unless money is involved. Then they suddenly become dirty clever bastards.
 
Fuck users.
Without users there wouldn’t be so much time wasted in creating user interfaces.
Would be a much better world.
 
Oh the youth!
 
12:53 PM
Hey, nothing against the youth!
You bejaarde man!
 
I was referring to you.
Ik ben bejaard aan het worden.
Nog even en ik blaas mijn pijp uit.
Is that even a saying?
 
Are you imitating the Nutella advertisements?
 
@StackedCrooked Nog even en ik schiet een kogel door je strot heen.
:P
 
12:55 PM
If you ain’t Dutch, you ain’t much. I’m Dutch, so if you ain’t me, you ain’t much.
 
I fear that my design is transforming into a minefield of overload ambiguities.
Neger.
 
YO MOMMA is much
lol
 
FOR ALL X; YO MOMMA > X.
 
Yo, momma! What’s up!
 
Her nipples.
 
12:57 PM
So went out and bought a TV today
 
@TonyTheLion Your mom did?
 
I'll be able to browse reddit on my TV! Woo :)
@StackedCrooked I wish LOL
 
You really like Reddit don't you?
 
reddit ... how is that hot zone called again there?
 
yes :)
Keeps me occupied in bored hours
 
12:58 PM
@JohannesSchaub-litb girls gone wild
 
@JohannesSchaub-litb reddit.com/r/picsofdeadkids
Some guy thought: I’ll create this subreddit because you know, just because it’s possible.
 
just some places that one doesn't go on reddit
 

« first day (694 days earlier)      last day (4256 days later) »