« first day (468 days earlier)      last day (4482 days later) » 

2:01 AM
@SethCarnegie Btw, the answer to that is that it will always return the ID of the kernel thread, which won't serve to identify a thread from that library. Sorry for the delay :S
This is one such library: gnu.org/software/pth
 
@RMartinhoFernandes no problem, I had guessed the answer from the discussion you guys were having, thanks for the confirmation though
 
Xeo
lol
 
Hahaha
1
A: loop through several vectors

GrizzlyYou could put the the vectors in a vector<std::pair<std::string, std::vector<...>*>: std::vector<std::pair<std::string, std::vector<std::string>*> > vectors; vectors.emplace_back(std::string("vec_one"), &vec_one); //or push_back(std::make_pair(...)) in C++03 ...

He accepted the answer that he said wouldn't work :S
 
Hocus focus.
 
man
I shouldn't start characters and then give them derogatory names
 
2:05 AM
Characters?
Like POO, PILE OF?
 
on World of Warcraft
I started a new Paladin and then called it Imbadin
 
Ah, right.
 
hahaha :D
Imbadin? :)
 
yep
 
@Xeo I just stuck -lsupc++ on my alias and moved on.
 
2:08 AM
Nice name. :) Sounds like patte.
 
@DeadMG How is that derogatory?
 
because it implies that paladins are imbalanced
 
Paladins are truly the strongest in the game.
 
but I've never played a ninjadin before so
 
2:10 AM
The seconds ones are shamans.
 
nah, I'd have to say druids
the only class that can tank, heal, and do both spell and physical DPS
 
yea, druids are fine too, but I think shamans rulez :)
 
frost mages are great to play
 
frost mages and palas are bugged
at least they were once I played it
 
harhar
"You're a quick learner, Imbadin."
 
2:17 AM
:)
 
0
Q: How to have only one instance of a class?

Darf ZonIs there a way to create a only instance in a class? At this moment, I'm trying to create only one instance of Random class. Several times I need use it with a certain seed. Is possible to change the seed later? I'm not sure, I guess to do this is a singleton. UPDATE: What I need is to have a...

Sigh.
 
@RMartinhoFernandes Akhil says "Singleton is the Best!"
 
check my answer :P
 
lol @ the comment.
 
hahah :)
 
2:20 AM
@DeadMG Restuta does not approve
 
meh
 
I like trolling :)
however not on stackoverflow
 
no other reason to be here
it's not like I get help with my problems except from this chat
 
Kinda, but you must sometimes ask a Q. to boost popularity of SOF.
 
what do I care about SO's popularity?
it's usefulness to me has run it's course
 
2:32 AM
nothing runs it's course, until all testifies for it. ( old Chinese proverb )
 
user406009
This a really offtopic question, but does anyone know of a boost::asio equivelent for python?
 
send_to ?
 
pyasio?
(I'm making stuff up)
 
What did you make, @RMartinhoFernandes? :)
 
@DzekTrek I care about old Chinese proverbs why?
 
2:36 AM
ARrgh, I can't simply put -lsupc++ in the alias. Stupid ld order of dependencies!
 
find the author and ask him exactly how it relates to my situation and I'll consider his words
until then, it's vague crap
 
user406009
@DeadMG Why haven't you released the super-secret specifications for your language yet?
 
still writing them
 
Li Ten Zha is the author, writer of the book "Seven dragons and a woman in red"
 
I've been thinking about writing a book
 
2:38 AM
Yea, what about?
 
a poor, noble computer scientist who has to flee after he accidentally breaks all known computer security systems
with his dog
 
Ah, fiction.
 
also he has a nasty habit of hallucinating about his wife
 
Like Cob in Inception?
 
no
those are just dreams
more like Six in Battlestar Galactica
although with less of the "GOD DID IT"
 
I was more thinking along the lines of a literal 20 minutes into the future
i.e., effectively present
 
the main problem is that I haven't developed the villains very far
i.e., at all
 
What about us, programmers, runners of the technological advance of the humankind?
Setting our sails to the new age, age of AI.
 
> It's easy to chide Space Odyssey for its ambitious forecast of turn-of-the-century space travel, but keep in mind that the film was released in 1968, a full year before we faked the moon landing.
Also, damn, I linked myself to Cracked.
 
2:46 AM
rofl
well, I figured that instead of running and hiding in a city, he would literally flee into some forest
 
A world in which nations wouldn't exist and in which all will be identified simply as humans. A world in which our mind could achieve it's full potential, a world in which a trade between other races is flourishing. :)
 
so this couch-potato academic guy gets stuck trying to catch fish to survive
 
yea, moon landing was nothing but a fraud.
 
Who's he running from?
 
it's such a shame we didn't make it.
 
2:49 AM
I'm sure that virtually every not-very-public agency on the planet would love to have unlimited control over computer communications
 
but at least 60's and later generations gained some hope that some day all of us should experience that feeling.
 
I haven't picked one yet
 
Yea, who wouldn't have to control computer communications
 
nah, they'll probably end up as the questionably moral guys
 
2:50 AM
It's in our nature to find out what the others do.
i.e. spy
 
it's also in our nature to die of dysentery
 
lol
Also, I already have 12 Cracked tabs open.
:S
 
Yes, but statistically speaking that doesn't affect us very much, right? :)
 
Why would TVTropes link to Cracked? That's gotta be against Human Rights.
 
2:52 AM
cracked tabs?
 
@RMartinhoFernandes heh heh
cruel and unusual punishment, huh?
by the way, robot, did you ever watch Stargate Atlantis?
 
Yes, I believe I watched all seasons.
 
do you remember that episode where mckay gets trapped in the underwater jumper?
I was thinking something along those lines, although the hero is a considerably nicer person than McKay
 
And hallucinates with Carter?
 
yes
and has an actual wife to hallucinate about
 
2:55 AM
lol
 
I think that I have decided that McKay is one of my favourite characters
he's like me, but stupider :P
 
To me (and my friends, we used to watch it together), McKay was what kept us coming back.
The show wasn't anything special.
 
he's hilarious in virtually every scene he's in
 
I love that episode when we discover his middle name.
 
yes!
that episode with his sister was awesome
although I do think that they cheated a bit by having the Replicators replace the ZPM he wasted almost immediately afterwards
 
3:02 AM
Did you watch SGU?
 
yes
 
Is it worth it?
 
nah
it's like Battlestar Galactica, except cut all the interesting characters and good plotlines
IMO they definitely made a mistake, because they have two science primary characters and it doesn't really work out
they would have been better served spending the money on more Atlantis, IMO
 
I'd probably watch more Atlantis.
I didn't even try SGU.
 
I wouldn't waste time on it, to be brutally honest
what I think is amusing though is that originally, they weren't even going to include McKay into Atlantis, they had some other science character
but wrote McKay in after the actor applied for the part
imagine how bad it would have been with "INSERT TECHNOMAGIC HERE"
although honestly, I like Zelanka
I also kinda liked Groeden, pity he only lasted a single season
 
3:10 AM
Zelenka cursing was awesome.
 
I know
 
Xeo
3:45 AM
Oooh, I just found revision 6 of the modules proposal: open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3347.pdf
 
user406009
4:01 AM
C++ needed modules years ago.
 
Xeo
Ugh. The Filesystem proposal specifies const T return types for some functions...
Member functions described as returning const string, const wstring, const u16string, or const u32string are permitted to return const string&, const wstring&, const u16string&, or const u32string&, respectively.

    [Note: This allows implementations to avoid unnecessary copies when no conversion is required. Return-by-value is
    specified as const to ensure programs won't break if moved to a return-by-reference implementation. -- end note]
> Template parameters named InputIterator are required meet the requirements for a C++ standard library RandomIterator compliant iterator. The iterator's value type is required to be char, wchar_t, char16_t, or char32_t.
wtf
There is some serious cleanup due in that paper...
 
4:44 AM
ewww, no
no const rvalues, please
 
5:40 AM
@Abyx That's the idea, but the problem with your modification to my demo is that the individual nodes no longer know which member in the other objects they're linking to. All they have is Foo pointers, not the Node pointers required to unlink. So instead of safely, automatically unlinking in the Node destructor, you have a manual and exception-unsafe requirement to manipulate the member Nodes in Foo::~Foo. Otherwise, it's a wonderful simplification :v) .
Hey, you guys know everything. Nutritional question: how bad is it to eat 420 grams (near one pound, or half a kilo) of tuna fish in one meal?
… This is on a regular basis.
 
Xeo
Damn. Clang supports literal operators semantically (aka, definitions of them), but not syntactically (aka, applications of them)
 
@Xeo You should be able to call them manually, at least to test the code somewhat.
 
Xeo
Indeed, that works
So the lexer just doesn't recognize the literals themselves yet
 
There are a lot of arcane rules at the preprocessor level, for example string juxtaposition where one is a user-defined literal and the other isn't (or others aren't).
 
Xeo
6:43 AM
Playing around with operator overloading to create trees is fuuuun: ideone.com/V64Gc
 
@Xeo You even used ->*, nice! Is it gratuitous or or does catcher implement some interface?
 
What does operator->* do again?
 
Xeo
It's just for looking nice
@StackedCrooked Theoretically it's for member pointers
I used it as what it's best used as: The one binary operator with the highest precedence
 
Ah, one operator to rule them all.
 
Xeo
Damn
 
6:54 AM
Kurt Vonnegut called * the sphincter. So that makes ->* the assrape operator.
 
Xeo
I noticed that it's not actually needed: ideone.com/YVLTA
 
Yeah, you were just avoiding putting the main part in parentheses.
 
Xeo
Thanks to my extremely thought-through idea of using parens to delimit directory content
No, you can just remove it and everything will work all the same xD
And with true C++11, I'd of course use a _d literal instead of dir(): "top1"_d
Still, those parens look ugly and I'd really like to remove them, but...
No idea how. :|
 
Well, they serve an essential purpose. How else do you express the scope of a directory?
 
Xeo
Yeah, but they still look ugly. Can't sort that out without an additional operator and an intermediate "noop" dir at the end of every subdirectory
*or, not and
 
7:07 AM
> A horse walks into a bar. Bartender says why the long face. Horse says nothing. It is a horse and cannot talk. It panics at the unfamiliarity of the location and breaks its leg in an attempt to escape. It is put down.
 
7:25 AM
Damn, if the US-Iran tensions don't end soon Oman's economy will be doomed! :(
<--- this person is doomed. poverty may lie ahead.
 
Xeo
7:45 AM
And as it turns out, delimiting the directory contents with paren prevents tons of headache
 
8:11 AM
@Xeo Nice. Now, do a custom literal for names and paths :)
Oh I C you mentioned that earlier
@IntermediateHacker there is a contrast between 'doomed' and 'may lie'.
 
sbi
8:40 AM
@Xeo This violates at least two out of three basic rules of operator overloading. Frown.
@sehe You may not lie, or you are doomed.
@IntermediateHacker Why is that?
 
Xeo
@sbi What, doesn't it increase readability? :(
 
sbi
1. Whenever the meaning of an operator is not obviously clear and undisputed, it should not be overloaded.
2. Always stick to the operator’s well-known semantics.
3. Always provide all out of a set of related operations.
@Xeo I'm not sure about the third, but the first two are definitely violated.
 
I think the commonality of ASCII art representation of directory trees covers 1 and 2.
 
Xeo
Meh, functions actually really suck in that case, because you have to completely invert the tree structure.
 
The only things you need to do to eliminate the overloading is replace the operators with commas, add the "missing" parens, and put function names before those parens. Which is a lot of ugliness, if you really have such large trees to create.
But nothing gets inverted.
 
Xeo
8:49 AM
Nope, it's completely inverted, atleast for free functions. Trying members now
 
sbi
@Potatoswatter Of course, sticking to those two rules, we wouldn't have string concatenation ("adding pointers?") nor the stream operators, nor Boost.Spirit... So, once in a while, they need to be violated. These rules are guidelines for beginners, and for beginners is strictly advisable to stick to them. But there's still a difference even between being an experience C++ programmer and being an experience C++ programmer plus having the boost community behind you when you do this.
When you run into a strange codebase using operators this creatively, it does warrant a raised eyebrow, and it might take you a while to get what the code is doing. That's contrary to what operator overloading was invented for: making code easier to understand.
 
Well… the main problem I see here is that the application isn't general enough that it would be used throughout any codebase.
But overloading / and | to produce a generic tree structure, and then providing a function using that as a spec for a directory tree, would be good.
You could perhaps provide the overloads in a separate namespace, and produce Boost Graph output. Then code cannot access the operators without using namespace pretty_trees;, ideally at block scope.
 
Xeo
Anyone else reminded of a certain language when looking at main?
 
sbi
I once wrote a class lib for creating XML files. Basically, this is the very same principle of a hierarchic structure. I did it by creating objects, each representing a tag that needs to be written. You needed to pass the parent tag to any tag you created, which provided an implicit tree structure, and any tag would be closed when either it went out of scope or a sibling is created.
The result is code that very closely resembles what you will later find in the XML file and is easily recognized by anyone looking at it.
 
@Xeo Yeah, now it sucks and lisps.
 
Xeo
9:02 AM
I admit that it may read nicer, but the parens were overwhelming me. I really had to guess at some point whether I needed a closing paren and new function call, or not, or whatever...
 
sbi
@Xeo Using my scheme, your code creating the folders could look like this:
filesystem::directory folder_structure("root");
  filesystem::directory top1(folder_structure, "top1");
    filesystem::directory sub1(top1, "sub1");
    filesystem::directory sub2(top1, "sub2");
      filesystem::directory sub21(sub2, "sub21");
    filesystem::directory sub3(top1, "sub3");
  filesystem::directory top2(folder_structure, "top2");
  filesystem::directory top3(folder_structure, "top3");
    filesystem::directory sub1(top3, "sub1");
      filesystem::directory sub11(sub1, "sub11");
I really fought with Letdown there.
 
9:19 AM
@Xeo What? C? Whitespace? Br*infuck? Yeah, it has parens too. Reminds me of Linq-To-Xml document construction (which rocks) or even Turbo Visions TMenu/TMenuItem/TSubMenu chaining constructors (which rocks slightly less, but it was a bit older
@Xeo Ah missed one: I think with all that whitespace it looks like Wide-C :)
 
9:35 AM
@sbi I see your idea, but I always think of XML nodes as having 0...n children, rather then a mandatory parent. Though I suppose from a code point of view, having both will allow for much faster (simpler) traversal, and if I understand you correctly, this XML class of yours was specifically for writing XML to a file
 
Writing XML that way would cause the close tags to be written by destructors, and then you can't throw/can't report failure.
 
sbi
9:56 AM
@thecoshman This is never traversed, its just been used to write into a stream.
@Potatoswatter Since it was used to write to streams, the stream's state was where errors were reported, so this wasn't a big deal.
But, yeah, in principle you are right, this could be a problem.
 
10:18 AM
15
Q: Frankly, do you prefer Cowboy coding?

bigownMost programmers defending methodologies politically correct like Agile, Waterfall, RUP, etc. Some of them follow the methodology but not all of them. Frankly, if you can choose the methodology, you certainly would go to mainstream "correct" methodologies or you would prefer the "easier" methodol...

funny question :)
 
Cowboy coders are often unaware of the personal factors that let them get away with their bad habits… they think nobody spends very long on any particular project, and perhaps never discuss programming at length with anyone who's any good.
 
mawning
 
Good Morning
 
10:38 AM
@sbi yeah! Correct interpretation of what you said!
 
Xeo
  _O/ Arrgh-!!           o
   |__-- -- -- -- -- --==X>
 _/_____________________/_\
(Yes, I'm bored.)
 
10:55 AM
Multi-Dimensional Analog Literals; basically the same idea but in 2006
And it has the appearance of doing useful stuff
 
Xeo
I saw that already. Partly inspired by that
 
  assert( ( o-----o
            |     !
            !     !
            !     !
            !     !
            o-----o ).area == ( o---------o
                                |         !
                                !         !
                                o---------o ).area );
You must really be bored
 
Xeo
Hey, I did that tree thingy this morning. I was already bored by then. :(
And I still want to find a nicer syntax...
 
@Xeo ಠ_ಠ
 
11:11 AM
Goood morning everyone!
We need to have C++ screencasts!
 
We've seen that.
 
The Ruby folks do have a lot of good screencasts.
 
Xeo
I think that's the third time that link was posted here.
 
lol
 
Well, Boost.Log sucks.
Or I'm not clever enough to figure out how it's supposed to work.
 
11:38 AM
@Nils FWIW it's the first time I saw it.
 
11:53 AM
Good morning!
Could someone help me to translate this C code using the C++ operator new?
temp = (struct node *)malloc(sizeof(struct node));
 
temp = new node
depends on how closely you want the behavior to match, of course
the point in having different languages is that that there's no precise one to one translation of every individual line of code
 
Of course :)
 
I guess temp = new (nothrow) node would be the closest match
since that doesn't throw an exception on failure
 
… in this case, it's a pretty direct translation. But good C++ avoids new entirely, and even minimizes use of pointers.
 
I'm implementing the Stack using linked lists
I found on google a snippets of code wrote in C
And of course it uses the malloc() function
 
11:58 AM
@unNaturhal so you don't know even basic C++ and you're trying to write not just one, but two data structures?
that's... optimistic :)
 
It might be better to practice using the C++ standard library. You will very seldom implement any data structure in C++, because they are already provided.
 
...
 
@jalf I think he's putting a stack interface on a linked list structure… that's just one project.
 
Don't worry, I will find a way to do what I need. Thanks anyway...
 
But nevertheless it's better to learn the interface of std::stack< std::list< foo > >.
 
12:00 PM
@Potatoswatter but it still requires you to first build a working linked list, and then correctly adapt it to work as a stack :)
@unNaturhal well, you could start by saying what it is you need :)
 
12:11 PM
How do I get the functionality of std::lower_bound or std::upper_bound in JavaScript+jQuery? Sorry for the cross-language question, but I don't want to attempt to explain the concept to JS kiddies…
Seems none of the JS generics allow early exit, or generalize to it, so I have to roll my own loop.
 
yeah, might have to. I don't think js has anything like the generic C++ algorithms
 
It has indexOf, forEach, sort, etc…
 
So has Acta been implemented? Apparently Denmark&Romania signed
 
@Potatoswatter yeah, but I'm not aware of anything like lower_bound
@LewsTherin Not sure what its status is. I'd guess you can't implement it until after you've signed
 
@jalf Many of the EU countries have signed AFAIK.. so how can we stop it guys? :(
 
12:18 PM
The Australian Community Television Alliance (ACTA) is a not-for-profit industry association representing free-to-air community television (CTV) channels licensed by the Australian Government under the Cth. Broadcasting Services Act, 1992. ACTA has been established to represent existing and potential CTV licensees and to advance the interests of community television. ACTA is currently governed by an executive group currently consisting of the heads of the capital city CTV stations. Full voting membership of ACTA is open to CTV licensees who broadcast for more than 12 hours per day f...
 
user784668
lol
 
@Potatoswatter ha ha
 
@LewsTherin Let's start a riot?
 
(The disambiguation page does list the international treaty, as well.)
 
throw some molotovs
blow up the internet!
 
12:20 PM
@jalf I'm game if you are xD
@jalf Sounds fair.. all or nothing
 
sweet. I'm game
 
user784668
@LewsTherin Ignore the issue?
 
@Fanael How does that stop it? If I did.. and I streamed a video I could be f*cked
Maybe I will move to a non EU country lol
 
user784668
@LewsTherin It stops you caring. If you stream a video you can get fucked even now as well.
 
@Fanael But it's harder.. if ACTA is ratified or whatever it means I am f*cked quicker
 
user784668
12:27 PM
@LewsTherin Assuming anybody cares that you stream a video. They don't.
 
I want to make french fries, but have no ketchup. Only bean sprouts and strawberry jam. Hmmmmmm………
 
Xeo
@Potatoswatter Mix them to get a ketchup look-alike!
 
taste comes from your mind. Use your willpower!
 
@Fanael If no one cares, what's the point of it?
 
user784668
@LewsTherin I have no clue. And I couldn't care less.
 
user784668
12:31 PM
ACTA is just another piece of shit that ain't gonna change nothing.
 
@Fanael A lot of people are worked up over it for naught then
 
@Fanael Most of the movie/music industry cares. A lot
 
user784668
@jalf Just like they do now, ACTA ain't gonna change nothing in this matter too.
 
@Fanael there's a bit of a difference in how fucked you can be. And how fucked the site which hosts your stream can be. And what kind of burden of proof is required to fuck you
@Fanael have you looked at its contents?
 
user784668
@jalf Have you considered how ineffective it will be to actually follow it?
 
12:35 PM
Today, some kind of proof is required before you can punish someone for copyright infringement
 
user784668
@jalf Wrong. Money is all you need.
 
@Fanael Have you considered how dangerous it is to have someone ineffectively enforcing a law which allows you to fine or imprison virtually anyone, completely bypassing the legal system?
@Fanael Wrong. Show me a single cases today where money was all that was needed
 
@jalf I don't understand how they can fine somebody millions for just one downloaded song
 
user784668
@jalf It happens all the time. We even have a word for that, "corruption".
 
Today, a few people who were known to download music illegally have nevertheless been able to challenge the charges thrown at them for several years, and throughout multiple lawsuits
@Fanael again, do you have an example?
 
12:37 PM
@jalf A lot of money wasted.. again
 
I'm also not sure I see your logic. So what you're saying is it doesn't matter what laws we have, because someone, somewhere might get away with ignoring them? Or more precisely, "we might as well make their actions legal by law"
But again, I'd like you to show me a single example where the entertainment industry, through money and corruption and nothing else, were able to convict someone of copyright infringement
 
user784668
@jalf TPB trial?
 
user784668
What they're doing is legal in Sweden. How else they could've been declared guilty, if not because someone is biased?
 
@Fanael So you're an expert on Swedish copyright law now?
 
user784668
@jalf No, of course not.
 
user784668
12:44 PM
@jalf But Swedish lawyers are, I think.
 
@Fanael and that proves what, exactly?
Also, I asked for an example where money/corruption was all it took
in the TPB case, there was also a lot of actual piracy involved, that's no secret. The question was whether the site owners were responsible for what their users shared via the site. But there's plenty of evidence that piracy took place, and that it took place with the owners' knowledge. So it's clearly not just money
 
user784668
Whatever, you won.
 
also I believe it's been appealed to their high court, so it's not settled yet :)
 
Hey, I need to watch some tv.. do you think it is "safe enough" to stream some?
 
For the record, I think there was a lot of fishy things going on in the trial against tpb. But saying that we might as well legalize even more extreme methods doesn't seem like a good idea to me
 
user784668
12:49 PM
I don't want it to evolve into a flamewar.
 
user784668
It also depends on what country are we talking about.
 
user784668
In USA, it doesn't matter at all. You can be arrested without trial anyway (NDAA 2012).
 
@Fanael I didn't see any flaming going on
 
user784668
ACTA itself means squat, it's not a law. It's just an agreement to implement appropriate laws.
 
@Fanael adn that doesn't mean squat?
agreeing to implement absurd and dangerous laws seems just as dangerous as implementing absurd and dangerous laws
and it's a mechanism for not just implementing absurd and dangerous laws, but for making sure all countries implement similar ones
 
user784668
12:54 PM
@jalf You can always implement them tomorrow (as in the tomorrow that never comes).
 
It eventually does.
 
@jalf So it has to be actually implemented and not automatic?
 
user784668
And these laws can always be rejected, just like all other laws.
 
@Fanael I am hoping on rejection!
 
user784668
ACTA actually has an important upside.
 
12:57 PM
@Fanael ?
 
user784668
It's so controversial that it caused people to realize that the internet is almost a live thing, that its users are quite able to join up to fight with ridiculous law and that the network is not to be messed with.
 

« first day (468 days earlier)      last day (4482 days later) »