« first day (561 days earlier)      last day (4386 days later) » 

7:03 PM
@thecoshman it's always snack time.
 
Who could help me with f**king threads? What is the best design to organize queues for each incoming requst? Which pattern should be used?
 
@user1131997 what kind of requests?
 
@classdaknok_t tcp-sockets
 
@user1131997 use a thread pool
 
@ScottW very funny :)
@Abyx Know about that, but I don't understand how does it work , if I want to do this manually? thank you for advice
 
7:05 PM
@ScottW what the hell was the point of that answer? Does it amuse you to take the piss?
 
@Abyx a thread pool, is that an object which keeps track of threads to be executed?
@TomW if you don't want such answers, you shouldn't come to Lounge<C++>.
 
@classdaknok_t it's not "an object", it's thread pool. e.g. Windows have it out-of-the-box
 
@Abyx ah the OS manages it?
 
@classdaknok_t It holds a bunch of threads, and schedules tasks on them.
 
@classdaknok_t OS can manage it if OS provides such thing
 
7:07 PM
Ah I think I got it. It makes sure that not too many threads are executed at once, right?
 
@classdaknok_t yep. it allows to re-use threads
 
Now I realize that I've always used thread pools when using Grand Central Dispatch. :P
Thanks for the explanation.
 
@user1131997, regarding to networking, I'd recommend to use boost.asio, or at least look at approaches it uses
 
@Abyx Why do you use boost? if my aim is to organize queues manually? What is the best pattern, "abstract factory" or what? thank you!
 
7:14 PM
"Why do you use boost?" Because today's boost is tomorrow's standard library.
 
Because it works.
 
It's very high quality. Why reinvent the wheel?
 
AbstractFactory?
 
The best pattern is singleton!
 
Especially if the singleton happens to be an abstract factory
That uses a template method.
 
7:15 PM
fot better understading what are you doing, not just calling SOME_SHIT *obj = new SOME_SHIT();

obj->CallReadyMethodWhichWillDoAllWorkForYou();
 
Why would you use abstract factories for a thread pooling system? You don't even need polymorphism for it.
 
@user1131997 Why not let the constructor do the initialization?
 
AbstractProblemFactory
 
@classdaknok_t polymorphism is just additional stuff, you could use it or not, it's just desidn-requirements or own-desire as I think
 
@user1131997 SOME_SHIT *obj = new SOME_SHIT(); is something you shouldn't do, by the way.
I would just use an std::queue<std::function<void()>>, then use some platform-specific magic to wire it up to a thread pooling system. The std::function<void()> is the task. Is this the right way, anyone?
 
7:20 PM
I like template <typename Fun> thread_pool::queue(Fun) (or std::function if you want ABI stability or something).
 
how do I get a unique_ptr out of a vector, I don't mean use it from the vector, I want it to no longer me in the vector and to then return it...
 
Doesn't threadpool use binary trees for handling threads in its object?
 
Move it out, and erase it.
 
@RMartinhoFernandes you would need to store the function somewhere, right? So unless you want to experience pain, you have to use std::function.
 
@RMartinhoFernandes why not just thread_pool::instance().queue(f) ?
 
7:22 PM
auto temp = std::move(myVector[ID]);
myVector.erase(ID);
return std::move(temp);
@RMartinhoFernandes like so?
 
@Abyx Oh, that was a declaration of a member, not a call.
@thecoshman Yeah.
 
sweet :D
thanks
 
You don't need the last std::move in the return though. Local variables are automatically moved in returns.
@classdaknok_t Unless you're using VC, which is still broken.
 
Meh, lag.
 
oooh, clever stuff
 
7:24 PM
@RMartinhoFernandes Damn they mess stuff up badly, don't they, again and again.
 
@rubenvb Microsoft.
 
@rubenvb Not their fault on VS2010.
 
man I would love a beer right now
 
They used the rules that were on draft at the time, which didn't include this.
But for VC11 there's no excuse. Bash away.
 
How often do they update their compiler?
Once a year?
 
7:26 PM
@RMartinhoFernandes but it became their fault once they didn't fix it in VC11
@classdaknok_t once every two.
 
44 secs ago, by R. Martinho Fernandes
But for VC11 there's no excuse. Bash away.
 
2005, 2008, 2010, 2012.
but they finish "updating" about a year before release, so...
 
2012, really.
 
Oh God. So if there is a bug you are screwed? You have to wait two years?
 
@classdaknok_t You've got connect.microsoft.com
The place where they can ignore you.
 
7:28 PM
There's a service pack in the middle!
 
@rubenvb They can close their bugs as WONTFIX and BYDESIGN
 
Which can break as many things as it fixes, but hey, nobody's perfect right.
 
@DeadMG That's like filing a bug "clang segfaults when using lambda expressions." Closed as by design. -_-
 
@classdaknok_t You can get a service pack. If a fix doesn't make it to the service pack, buy a new product.
 
@classdaknok_t no, that was closed because it wasn't implemented at all then. A couple of months later, they got it in.
 
7:29 PM
@classdaknok_t Yes, once the two-year wait is over you have to pay for the fixes.
 
@DeadMG You forgot the good old CNR.
 
Is the compiler free? If it isn't, then I understand it; the manager must be paid anyway so he doesn't care.
 
Demonstrates the big gaping hole in software legalese
software vendors aren't under any obligation to supply software that works
 
Otherwise it's just bullshit.
 
Compiler is free.
But you have to wait for a new Windows SDK, hawhaw.
 
7:31 PM
Even a bug in VS, which you pay for - no obligation
 
No, there's that free VS edition I forgot the designation of.
 
in my very limited understanding, most jurisdictions interpret software to be a creative work - and therefore cannot be wrong
 
Then I don't understand their problem. Why not just release after every bug fix, or once per week or something? It shouldn't be such a big deal.
 
@EtiennedeMartel CNR?
 
Because they have 8 layers of management on top of 'em.
 
7:31 PM
@CatPlusPlus Express.
@DeadMG Could Not Reproduce, I suppose.
 
You're then making the same argument as "This music is rubbish, therefore the CD I've just bought is broken"
 
ah
 
What R. said.
 
Someone from VC team said they're pushing for more frequent releases, but hell knows.
 
in the eyes of the law
 
7:32 PM
We'll see after 11 goes RTM.
 
@classdaknok_t Herb Sutter mentioned they plan to do something in that spirit for VC.
 
@TomW The law is blind.
Maybe the VC team is a clusterfuck.
 
@RMartinhoFernandes cool.
Maybe VC is a clusterfuck.
 
@EtiennedeMartel "Maybe"?
 
@TomW But company releasing software that doesn't work at all is fucked. Bad bands will still have fans.
 
7:33 PM
@RMartinhoFernandes Oh, you.
 
I have noticed a startling lack of messages of mine in the starboard.
 
One thing I don't understand either is: why the fuck does IntelliSense not use the same parser as the compiler? Why do they take all the effort to write a C++ parser twice, one of which understands C++11 partially, and the other one not at all?
 
@classdaknok_t because !clang
Every IDE does this, until clang came around, and IDE writers finally have the means to do the sensible thing.
 
Xcode doesn't. :P
That said, Xcode sucks.
 
Well, Xcode is cool in its Clanginess
 
7:36 PM
It would be cool if it could be used with the SVN builds.
 
@classdaknok_t Can't you hack/work around that?
 
I imagine all/most Apple devs on LLVM use Xcode
 
Anyway, clang 3.1 is going on RC, so it should be out relatively soon.
 
You know what feature Xcode needs? The ability to fucking switch compilers.
 
7:37 PM
You know what Xcode needs? To stop existing.
 
@rubenvb Apple patches clang for every Xcode version and adds some more command-line options which the regular clang doesn't understand. Then when you set CC to /clang/bin/clang (or wherever it's installed) you get an error "unrecognized option".
 
@EtiennedeMartel But, Steve Jobs knows exactly what compiler you want to use.
 
GCC 4.2?
Sorry, but no.
 
@rubenvb knew
 
@EtiennedeMartel The newest Xcode defaults to Clang IIRC.
@classdaknok_t Trust me, he still does ;-)
 
7:38 PM
@rubenvb depends on the project template you use.
 
Apple can't use newer GCC.
 
License crap.
 
Licensing issues. That's why they started Clang in the first place.
 
/sstarted/hopped on/
 
Stupid fucking RMS.
 
7:39 PM
Xcode stops syntax highlighting, code completion and live issues when I enter []{}, and the compiler segfaults.
 
RMS=stallman?
 
@rubenvb Yeah, it does. But the newest Xcode doesn't work on Snow Leopard. I could always just install clang myself, but there's no easy way to tell Xcode to use it.
It's all hard coded somehow.
 
Everyone is happier because of it, so whatever.
 
@awoodland Yeah. I'm a bit annoyed he shares my first two initials.
 
@EtiennedeMartel go to user-defined build settings and add CC and set it to /usr/bin/clang.
 
7:40 PM
Anything Stallman says that might be right is overshadowed by the fact that he's a jerk
6
 
2 mins ago, by class daknok_t
@rubenvb Apple patches clang for every Xcode version and adds some more command-line options which the regular clang doesn't understand. Then when you set CC to /clang/bin/clang (or wherever it's installed) you get an error "unrecognized option".
 
@classdaknok_t You could write a wrapper that discards those options.
 
So how does that help?
 
if I typedef a class, that new type is considered to be a completely separate type right? There is no implicate conversion to one to the other, no polymorphic shit that make the typedefed version look or able to be treated like the original
 
The GPL is a joke. It's a pain in the ass for everybody, except for rms and his minions.
 
7:41 PM
@thecoshman No, they're exactly the same.
 
@thecoshman No. It's the same type.
 
@RMartinhoFernandes good idea.
 
:(
well there goes that plan
 
Just give up and use Haskell.
 
GPL = "You want to get paid for writing software? Fuck you."
 
7:42 PM
Not really.
 
@TomW Well, people at Redhat and Suse and Ubuntu would tend to disagree with you...
 
@TomW and it's entirely your choice
 
On an unrelated note, anyone ever used Wubi?
 
The fuck's that?
 
you don't have to use GPL'd code if you don't want to
@CatPlusPlus that ubuntu windows thing?
 
7:43 PM
Yes.
 
Is that the thing that installs Ubuntu on a disk image on a Windows partition?
A friend of mine once tried that and it didn't end well.
 
@RMartinhoFernandes that's the thing
 
Really because nobody would know where to start librarising GCC.
It's a mess.
 
@awoodland That is less than helpful if you’re writing a library …! “well you don’t have to use my code” – “good point, smartass, don’t write a library with that attitude”
 
huh... multiple inheritance, shit's about to get fucked up
 
7:45 PM
You know why GCC can't be used as a library? Because:
 
@thecoshman Why?
 
> … simply changing the form of the interface to include intermediate text files makes it possible to add proprietary optimizers/back ends/front ends/whatever…
 
@awoodland of course I don't, I can just suck on the fact that (if RMS has his way) no non-free alternative exists
 
@RMartinhoFernandes you really think I can handle that much power?
 
@TomW You mean "no free alternative", right?
 
7:46 PM
@KonradRudolph I see it as a "you scratch my back and I'll scratch yours" sort of deal
 
Public domain FTW.
5
 
I think I'm going to make a law: Anyone who sacrifices efficiency and easy of use for ideological reasons has his head stuck up his own ass so deep that he is in danger of choking on his own throat.
 
i.e. if you want to buy into our club you'll need to sign up to our rules
 
@EtiennedeMartel Too long for proper marketing.
 
GPL is as restrictive as proprietary licenses, you just happen to be able to modify the source.
 
7:47 PM
@RMartinhoFernandes ...no. If GPL is the only option, that is the free software. Non-free usually means 'can be used for a commercial project' as opposed to GPL, which pretty much never can.
 
@awoodland Yup, I see the ideal of GPL even though I’m not a fan myself: it’s a very non-unidirectional altruism
 
@RMartinhoFernandes Yeah. Might need to clean this up.
 
@TomW Only if you call GPL'ed stuff "free".
 
@KonradRudolph GPL is like freemasons?
 
I wouldn’t know …
 
7:48 PM
GNU fanboys are a bunch of whiners.
 
@TomW Most "open-source" licenses are usable in commercial projects. I don't see how that makes them "non-free".
 
GPL people call GPL software 'free'
 
@TomW Debian calls the GNU Free documentation license non-free
 
Because someone can benefit from your work! UNACCEPTABLE.
 
BSD is better for everything non-GPL.
 
7:49 PM
Yeah, if I ever open source something, I'd probably go with BSD.
 
I always use the zlib license.
 
I always CC0 anything.
 
GPL is fine for applications, but making a library GPL kills it.
 
@RMartinhoFernandes I thought CC licenses were inappropriate for software?
 
MIT is simpler than NBSD.
Also Unlicense.
 
7:50 PM
I would like to put everything in the public domain, but people said it's not possible with software. >.<
 
@EtiennedeMartel CC0 is.
 
really? Look at winsock - I'd be pissed if I wrote the original BSD stuff and all I got was some lousy credits in a click through agreement nobody ever read
 
@RMartinhoFernandes You can’t do that in Germany
 
CC0 is inappropriate?
 
it is legally impossible to give up your copyright
 
7:50 PM
@EtiennedeMartel Appropriate.
 
@KonradRudolph Eh.
 
@KonradRudolph The lawyers make it so I give up as much as allowed by law. Or something.
 
@KonradRudolph is it possible to not require attribution? That would be extremely close.
 
@classdaknok_t Yes – but I don’t find attribution a bad thing; it doesn’t have to be visible, just in the code, like BSD does it
 
Lawyers deciding about how software should and should not be published is almost as stupid as politicians doing so ...
 
7:52 PM
@KonradRudolph Then if you don't require attribution, allow commercial use and redistribution and modification, you basically have the same thing.
 
@classdaknok_t True. To be honest, I couldn’t explain the difference.
 
@KonradRudolph And that's why I prefer to use something lawyer-designed like CC0. They care about the legalese crap, and I get things as close to my intent as possible.
 
@RMartinhoFernandes My point is that CC0 isn’t compatible with German law
 
@KonradRudolph Why not?
 
it wasn’t lawyer-designed for international use
 
7:53 PM
I like Beerware, but the license doesn't make sense.
/*
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp
 * ----------------------------------------------------------------------------
 */
 
by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.
 
Because what I've written is not written by Poul-Henning Kamp.
 
@RMartinhoFernandes Because, as I said, the German law makes it impossible for you to give up your copyright, which CC0 implies
it’s simply not something you can decide
 
I have twice asked about my problem, but no success :(

http://ideone.com/exCqA

Here is code , which works well with creating thread etc...

Don't know how here organize better request-hanlding without boost/threapool

Please, help me! thank you
 
@KonradRudolph and what will that incompatibility lead to?
 
7:55 PM
It could be because we don't care.
 
German people can't use the code? You're not going to sue them? And they can't sue you, cause you wrote the code.
 
I want to convert a sorted list to a binary tree. The elements in the list are sorted by the index of the parent node. Nodes in the tree are numbered row by row. Is there any algorithm to convert this list to a tree?
 
@rubenvb I don’t know exactly but I do know that this clause exists to annul contracts. So I believe that using CC0 in Germany would lead, if challenged, to a complete annulment of any rights that are granted by it
 
@KonradRudolph It doesn't imply that.
 
which might lead to a major fuck-up
 
7:56 PM
> When the waiver doesn’t work for any reason CC0 acts as a free public license replicating much of intended effect of the waiver, although sometimes even licensing those rights isn’t effective. It varies jurisdiction by jurisdiction.
 
(And assume I have IANAL notices all over my messages)
 
huhuhuh
Beavis
he said "I Anal"
 
@RMartinhoFernandes Ah, smart
I didn’t see that
 
There are many jurisdictions that don't allow you to fully waive all rights. I'm sure CC people thought about that.
 
7:58 PM
@KonradRudolph In fact that was the motivation behind the creation of CC0: the fact that dedicating works to the public domain worldwide isn't simple.
 
If I were president, you would be required to release all rights.
Just to troll Hollywood.
 
Communist!
 
Shoot him!
 
We live in a silly age.
 
In Soviet Daknok, rights reserve YOU!!
 
7:59 PM
@CatPlusPlus Everyone did. Everyone will.
 
But then again, it will probably continue going downhill.
So something.
I need to write that Android crap.
 

« first day (561 days earlier)      last day (4386 days later) »