« first day (295 days earlier)      last day (4670 days later) » 

6:00 PM
I still have a nagging feeling in allowing client code to do e | f even when the enumeration might not be meant to be used that way.
Probably going to add a library-code safe guard.
 
You could add traits.
 
enum struct E { ... }; template<> struct is_strict_enum<E>: std::false_type {}; or some such.
@RMartinhoFernandes Great minds etc.
 
Shh, don't say that!
Jul 29 at 21:56, by Martinho Fernandes
Great minds are unique. Mediocre minds think alike.
@LucDanton I'd call it something like is_flags_enum.
 
@RMartinhoFernandes Wow, I never thought of that!
 
6:03 PM
Yeah about those names.
We have scoped/unscoped. We have the underlying types.
What do we call an enum that is not meant to be used as an integral type?
i.e. the logical allowed values are strictly the enumerators.
 
Hmm, strict kinda makes sense. After you said that.
 
Well I liked your trait because it's true that the bitwise operators enable a type to be used as a flag.
Then it's a matter of finding a name for the trait that enables the arithmetic operators.
i.e. the default is a 'strict' type that requires uses of static_cast to be subverted (that's client-code beware, so acceptable).
Then different traits for fine-grained control of operators, where a strict (but not strictest) usage are flags, and the most lenient usage is an arithmetic type with named special values.
 
I like it.
 
Making the 'default' (i.e. the library-code doesn't specify anything) the strictest, combined with the is_enum trait means that we don't need a namespace as protection too. Less burden on client-code.
 
6:15 PM
Hi, could anyone help me with the full form of RAII used in C++?
 
Er, with what?
 
Hey! ideone.com/d4E5D. GCC dos not support std::underlying_type yet?
 
user53670
hi
 
Mine does, I used it for my operator| test.
 
I'll try 4.6.
 
user53670
6:18 PM
Does anybody knows how to design a bit torrent
 
user53670
client?
 
I hope I do.
I'm working on one.
 
user53670
I want to write one in C++
 
user53670
to practice my skills
 
@Cat plus plus if you were responding to me - i have seen in many posts people use the term RAII w.r.t C++ was wondering what it is..
 
6:19 PM
RAII means Resource Acquisition is Initialisation.
 
oh thanks
 
user53670
@RMartinhoFernandes what are the main components? is it hard to write my own client?
 
I've been planning the asynchronous parts for about a month now.
 
Some people call it Scope-Based Resource Management.
 
I don't find it particularly hard, because the protocol is rather simple, and the algorithms are well documented.
 
6:21 PM
oh cud u point me to any C++ concept where it is used..?
 
I'm sure we have it explained in .
 
user53670
@RMartinhoFernandes How to get start
 
oh thanks will check that
 
20
Q: Does C++ support 'finally' blocks? (And what's this 'RAII' I keep hearing about?)

KevinDoes C++ support 'finally' blocks? What is the RAII idiom? What is the difference between C++'s RAII idiom and C#'s 'using' statement?

 
@Kim Start by reading the specification: bittorrent.org/beps/bep_0003.html
 
6:22 PM
thanks
 
At first I found it a bit confusing because of the way it's written, but it is rather simple.
 
Most BT craziness starts with DHT.
 
There's a similar documented maintained by the community that is a bit clearer: wiki.theory.org/BitTorrentSpecification
@CatPlusPlus that's an extension.
 
There are BEPs that no modern BT client cannot not implement.
 
Yeah, that's true, but I wouldn't recommend starting with the DHT.
 
6:24 PM
DHT, PEX, web seeding, private torrents.
I know, just saying. :P
 
@JohnPMK FWIW a common error in learning to use RAII is writing e.g. std::lock_guard(some_mutex) instead of std::lock_guard lock(some_mutex).
 
@LucDanton Oh, nasty.
 
user53670
@RMartinhoFernandes What are the main components of the client?
 
Client.
 
@RMartinhoFernandes Making it a function doesn't even improve the situation: auto l = lock(some_mutex); vs lock(some_mutex). Plus it needs a movable type so additional complexity.
 
6:27 PM
@Kim I have decided to separate the thing into roughly the following main components: storage, message exchange, request scheduler, and peer finder.
 
user53670
@RMartinhoFernandes What kind of message should be exchanged?
 
Those are described in detail the protocol specification.
It's basically stuff like "I want to download from you", "You can download from me", "Give me this piece", "I have completed this piece!".
 
user53670
messages between clients, or messages between client and tracker?
 
Between clients. Interaction with the tracker isn't much.
It's mainly "I want in. Gimme peers." and "Gimme more peers."
 
user53670
@RMartinhoFernandes Ok I will read the protocal. Thanks for the advice
 
6:31 PM
You're welcome. Good luck!
 
A C++11 solution would do std::lock(some_mutex, [&] { do_stuff; });
 
lock_guard and unique_lock are completely fine, esp. considering e.g. condition_variable. (Also the name std::lock is taken.)
 
Hmm, g++ 4.6 doesn't have std::underlying_type :(
@Luc you're using 4.7, right?
 
Yes.
> gcc version 4.7.0 20110709 (experimental) [trunk revision 176106] (Debian 20110709-1)
 
Guess, I'll have to fetch the trunk and build one too :(
 
6:45 PM
Let me check the header to see if it's worth it though.
For all I know it's always int.
Well it seems to be implemented.
 
So, it's not always int right?
 
what even is std::underlying_type?
 
A metafunction that yields the underlying type of an enum.
 
Wouldn't decltype(ENUM_VALUE) work?
 
6:48 PM
Oh, right, it'd return enum if anything.
 
Given enum class foo { bar };, decltype(foo::bar) yields foo.
 
@RMartinhoFernandes A small test reveals it returns long long for enum class E: long long {};. Make of that what you will.
 
std::underlying_type<foo>::type should be int.
 
7:01 PM
@Luc: hmm, compound assignment will not be possible.
 
Compiles with GCC.
 
Aren't compound assignment operators required to be member functions?
 
I'm pretty sure about plain assignment but that's about it.
 
Oh, you're right.
 
I think the only thing that miffed me about not having 'member functions' for scoped enums is not having conversion operators.
 
7:10 PM
Yeah, that hurts if you don't control the target type.
 
At the moment I'm divided on whether it hurts or whether my design attempts are silly :)
 
I've got a nesting problem
I've got way too much nested stuff
I really need to condense my syntax
 
I've purposefully downgraded a use of enum struct E { ... to struct E { enum { ... once but with today's insight about operators I'd reconsider that.
@RMartinhoFernandes How would you go about having named values for std::get? Which was the motivation for my scoped-enum-that-still-implicitly-converts-to-integral-type, and was obsoleted by my named stuff?
 
ok
how about if I added virtual and/or static to be per-block qualifiers?
 
sbi
Evening.
 
7:19 PM
thanks for your support on Programmers, @sbi
 
@LucDanton Dunno, I'd probably go with something like that scoped-enum-that-still-implicitly-converts-to-integral-type thing.
 
sbi
@DeadMG That guy is plain silly. Prolly learned Java 5 years ago and now thinks he knows what the term means.
 
lol
 
sbi
Gentlemen, @Dead and me could use some support here. Those youngsters have no idea their pet language wasn't the first.
 
Oh, I really don't want to enter a discussion about the Real Meaning™ of Yet Another Over-Overloaded Term™.
3
 
7:22 PM
lol
just upvote me and leave :P
 
sbi
@RMartinhoFernandes No need to enter the discussion. Just upvote the right comments and be done. :)
Really, I hate those which look at these seemingly unchallenged assumptions and downvote a question without really knowing.
 
@sbi I don't consider the answer worth upvoting.
 
what do you guys think of "block" syntax?
 
sbi
@LucDanton Maybe it isn't. @Jerry's answer most definitely is much better. But @Dead's isn't worth three downvotes either. That's silly.
 
7:27 PM
I'd prefer ditching the block keyword and just using something like public static runtime {}.
 
been thinking about that
also
my allocator example is actually quite rare, because it's self-modifying, whereas most metafunctions are not
 
user53670
I want to ask a question
 
user53670
How to arrange the folder of a project
 
I think the only "right" answer is "as you wish" :P
 
user53670
if there are 4 component , should we create 4 folders, and add them all to /project/src?
 
7:33 PM
I usually order it by dependencies
like I have a Windows folder, and within that a DirectX folder
oh, by the way
 
user53670
lots of people have the src, doc, and put some sub folders in the src
 
I broke my second screen :(
@Kim Lots of people commit suicide every year. You gonna follow them?
 
user53670
..
 
@Kim You can always rearrange later.
 
sbi
@RMartinhoFernandes Actually, it's not. "Object instance" is just plain silly in any language I know.
 
7:35 PM
@sbi I was answering @Kim !
 
sbi
@RMartinhoFernandes Oh. Sorry. :(
 
it's raining
and I'm second-screen-less :(
 
sbi
@DeadMG <pavlov> ...again. </pavlov>
 
user53670
@RMartinhoFernandes ok i just use 4 folder to contain my code
 
what's pavlov?
 
sbi
7:38 PM
How do you break screens? Are you angry?
 
Ivan Petrovich Pavlov (; February 27, 1936) was a famous Russian physiologist. Inspired by the progressive ideas which D. I. Pisarev, the most eminent of the Russian literary critics of the 1860s and I. M. Sechenov, the father of Russian physiology, were spreading, Pavlov abandoned his religious career and decided to devote his life to science. In 1870 he enrolled in the physics and mathematics faculty at the University of Saint Petersburg to take the course in natural science. Life and research Ivan Pavlov was born in Ryazan in the Central Federal District of Russia, where his father...
 
sbi
@DeadMG Who, not what, is Pavlov.
 
rofl
 
the oneboxed picture is of his dog
 
7:39 PM
:P
 
ooooh, the creepy salivation guy
 
@DeadMG The oneboxed picture is never right!
 
sbi
It's raining again is a famous song of the (early?) 80ies. By a super band of the time. I can't here "it's raining" without pavloving "...again."
 
also, Windows noticed that I had an illegal copy
 
You have an illegal copy?
 
7:48 PM
well, Microsoft will give me a copy for free, but I have to call them up and all that shit
it's easier to just pirate it
 
I get all my copies from MSDNAA.
 
also, the boot selector on my motherboard doesn't work properly and it's a real hassle for me to reinstall Windows
yes, me too
but they only issue one key
you have to call them up if you want to install again
 
Not for my University :P
 
and I used it last year
lol
 
I never found the limit on Windows copies.
I did found that VS10 Ultimate is limited to one.
But I can have at least three copies of VS10 Premium.
 
7:50 PM
I don't need more than one copy
but it clearly said that if I wanted to install more than once, I had to call up
and at the time, I reinstalled about every month or so
they seem to have cut that particular restriction
but you can't downgrade from Ultimate to Professional, I'd have to reinstall, which would be a considerable bitch
 
> You shouldn't trust any statistic you haven't forged yourself.
Well, now that Windows knows that you are worthless pirate scum using an illegal copy, you'll have to reinstall anyway, no?
 
ah
all it does is whine at me on boot and take away my desktop picture
 
Taking away your desktop picture sounds childish.
 
I know
but the thing is, it's really getting to me
I normally work in the dark with the light from my screens as the major source of light in the room
but my second screen is totally dark
so having my first screen also being dark is kind of putting me off
 
sbi
"There once was an X from place B, Who satisfied predicate P, The X did thing A, In a specified way, Resulting in circumstance C." #limerick
 
8:03 PM
lol
 
rofl
 
Well, it lacks the obscenity.
(At least I am not seeing it.)
 
sbi
What's with this room's fixation on sex and obscenities?
 
It's a limerick.
Usually there's some obscenity in it.
 
8:09 PM
Well, there's a limerick package for fortune. Most of the limericks in there are obscene.
I've been spoiled.
 
sbi
@RMartinhoFernandes Which brings us back to my original question.
 
@sbi I try not to upvote to 'counter' downvotes, I think it's somewhat of a subversion of the system.
 
@sbi I don't see how. I explained why I have a pavlovian expectation of obscenity when I see a limerick.
 
@sbi me
 
sbi
@RMartinhoFernandes I suppose it's somewhat intrinsic to a programmer chat: Lot's of young males, plagued by testosterone, but being too geeky to load it off on some girl.
 
8:12 PM
I'm the cause of this rooms obsession with sex
 
sbi
@TonyTheTiger See, I mentioned "sex" and you showed up!?
 
@sbi hahahahahah
 
sbi
Does it make "pling" for you every time someone write "sex" in here?
 
@sbi yea well, I always happen to open this tab when sex is mentioned, I guess my sexdar picks it up quite well :P
 
"Roses are red, violets are blue, I'll fuck you with a rake."
 
8:13 PM
wtf?
 
There you go, obscenity.
 
@CatPlusPlus lol wtf!
 
sbi
@CatPlusPlus That's not a limerick, it's violent, and reflects bad on you. (If such a thing is possible, anyway.)
 
Though it's probably older than that.
 
@sbi FWIW the dirtier kind has been the norm for the limericks I've encountered.
 
8:15 PM
@sbi I wouldn't know the difference between a limerick and non-limerick. :P
 
I don't see how that relates to the chatroom I'm in right now.
 
@LucDanton Exactly.
 
sbi
@LucDanton The youth today - if they encounter poetry at all, it's dirty...
 
what the hell other kind of poetry is even remotely interesting?
 
meh, what else do you expect?
 
sbi
8:16 PM
@LucDanton I have met people elsewhere who know non-obscene limericks.
 
What kind of poetry is interesting at all.
 
sbi
I know this is hard to imagine for you, boys.
 
Analysing poetry in high school made me hate it with passion.
 
<cave> what does stfu mean??
<nso> shut the fuck up
<cave> sor-ry.. it was a simple question.. no reason to get so mad..
rofl
 
Now that I think of it, school made me hate quite a lot of things.
 
8:19 PM
@CatPlusPlus this looks like a subreddit for you catworldproblems
 
@CatPlusPlus Pretty much this.
 
sbi
Do these people actually know which images they invoke when they use a nick like "cave"?
 
Images of a cave?
 
@sbi what images do you get when see "cave"?
I mean, I don't see anything weird about it, just a cave really
 
Now who's being dirty.
 
8:21 PM
a dirty, filthy ... cave, full of wet, slippery ... muck
 
******************* [explicit content]
 
@RMartinhoFernandes those are some caves alright
 
what about cave men?
or women?
 
Even if I turn SafeSearch off, I can't see anything wrong.
 
8:24 PM
lol
 
sbi
@TonyTheTiger Nick Cave, of course!
 
@sbi don't know him
so wouldn't have thought about him
 
sbi
@TonyTheTiger <sigh> I know. </sigh>
 
@sbi ugh :(
 
sbi
@TonyTheTiger I meant that none of you kids know him, not that you somehow stand out from the sad crowd.
 
8:27 PM
Here's the limerick fortune database I mentioned earlier: pastebin.com/d35KtgLp (contains explicit content)
@sbi I know him!
 
@sbi oh thanks for comforting my mind :P
@RMartinhoFernandes you're weird then...
 
sbi
@RMartinhoFernandes Makes you stand out.
 
@TonyTheTiger I'm weird because I know some famous musician?
(And happen to enjoy his music)
 
@RMartinhoFernandes yea... lol :)
 
The only Cave I know can burn your house down with lemons.
 
sbi
8:31 PM
> I hate the feeling of discovering bands that I could have been listening to for years, but was unaware of. I'm old enough to have been excited when "Tender Prey" came out. Now it just feels like one big "What If?"
> I guess it takes a certain level of maturity to really appreciate Nick Cave.
From a comment on the video I linked to.
 
hmmmm
I wonder if my dad has heard of him
 
@CatPlusPlus when life gives you lemons, don't make lemonade. turn those lemons into hand grenades and throw them right back at life!
 
man, I was just trying to come up with some witty way to make a reference to Nick Cave before when you talked about someone "whose nick is cave"
guess I was too slow
 
sbi
In this video (same song) Blixa looks like John Lennon.
 
I know John Lennon.
 
sbi
8:36 PM
@jalf Hark, hark! Another enlightened one!
 
@TonyTheTiger oh come on, don't tell me you've never heard youtube.com/watch?v=AjTY8ildtFU on the radio or something
 
sbi
@jalf Unfortunately, that was aired a lot. It's bad, though, and it's a bad record.
 
@DeadMG Yeah!
 
sbi
@TonyTheTiger You know, even from you I would have expected at least that.
 
I'm considering playing Fallout all night and then regretting it in the morning.
 
8:37 PM
@jalf yes I have heard that :)
@sbi heheh
 
Hi all !
 
@sbi eh, I like it :)
 
Any one using Xcode 4 for C++ applications ?
 
although to a large extent because of the lyrics. Tickles my sense of humor, I guess
 
8:40 PM
I don't see that as particularly NSFW
 
sbi
@jalf You know, I really like his ballads more than most of the rest (Mercy Seat being a very notable of the exceptions), but Murder Ballads was a bad one.
 
@DeadMG probably depends on your work
 
@jalf True. Which is none at all, so it can be safe for my ... work
 
Being lazy is hard work, too.
I mean, it won't do itself.
 
hahahh
 
8:42 PM
>>> Failed to emerge sys-devel/gcc-4.5.3, Log file:
Great.
So now GCC ICEs when compiling itself.
 
sbi
@TonyTheTiger "One in three porn viewers are women." What? Really? That does surprise me.
 
hahah
 
Is 4.6 stable enough for general use?
Portage still hardmasks it.
 
hardmask?
 
I was able to break 4.6 without any trouble
 
8:47 PM
Disables the installation until enabled manually.
 
4.6.1 actually compiled my code though
but I'd steer clear of 4.6.0
 
so here's the critical question
do I have anything important on my SSD?
 
mmm... yes?
Did I guess correctly?
What did I win?
 
dunno, I put everything I can think of on my mechanical drive
lol
 
@CatPlusPlus I've unmasked it and found it stable.
 
8:49 PM
@DeadMG what you gonna do to your SSD?
format it?
 
or is it a "should I put anything important on my SSD?"
 
yeah, I need to reinstall Windows
 
ah
 
ugh, I hate reinstalling Windows
 
I keep nearly everything important on my mechanical drive
 
8:50 PM
Then reinstall Windows, you don't need to recreate filesystem for that.
 
the only question is whether "everything" and "nearly everything" are close enough
 
I don't mind it so much after I figured out how to put everything other than \windows on another partition
\users and \program files and everything goes on a different partition now, so I can pretty much nuke my windows partition at will
 
unfortunately, some tools like Visual Studio refuse to install entirely to another partition
I hate those programs where they aren't "re-entrant" and depend on registry settings and whatnot
 
nah, that's no problem. :)
you fix up the registry settings as well
 
uh, manually?
 
8:51 PM
and add a few symlinks to catch the programs which hardcode install paths
 
don't some files have to go into like System32, like essential DLL's?
 
that guide has worked perfectly for me the last 4 times or so I've installed Windows
 
hmmm cool :)
 
well
WinDirStat makes me think that I've accounted for all my SSD space
and I also re-directed my Visual Studio projects directory so I know that's a WinRAR and my Cygwin directory too
aah, what could possibly go wrong?
 
@DeadMG apart from losing some vital piece of data, you mean?
 
8:53 PM
lol
the only thing I have on here that I would really cry if I lost would be my source code
and I know for absolutely sure that it's safe
 
ah
 
everything else would just be a hassle to download again
but then, at 20Mb/s, I don't have that much of a problem with downloading
 
emails? Digital signatures? ssh keys? netbanking thingies?
 
@CatPlusPlus Like jalf, I have had a much better experience with 4.6.1 than 4.6.0. So if you have access to that I'd recommend it. I can't recommend 4.6.0 because I haven't touched 4.5.x in a long time.
 
sbi
@jalf A Windows 7 guide has worked well for you the last four times you installed Windows? Four times since Windows 7? To call that bad luck would be the mother of all understatements.
 
8:55 PM
any important documents?
 
@jalf How do you account for registry settings like COM registration an other crap?
 
@jalf no, no, no, no, no
 
@sbi I've had to install on a handful different computers by now :)
 
also
it might assist me to have the graphics driver for my actual vendor of graphics card
 
@RMartinhoFernandes what about them? They don't depend on programs being installed on the windows partition
 
8:56 PM
and not have the old one kicking around
 
@LucDanton Well, Portage builds from source, so I'd just copy and rename the ebuild if it weren't already there.
 
sbi
@jalf Doesn't your company have sys admins to do that? I mean, I did install my machine myself, but others...? No way.
 
@jalf But some programs that are "installed" depend on them, and they won't be found on a fresh install of Windows.
 
@sbi Nah, on my private desktop and laptop, and I had to set up my brother's computer as well
add in a reinstall or two, and I dualboot on the desktop as well
it adds up :)
 
I don't think I've ever reinstalled Windows for reason other than HDD failure.
 
8:57 PM
@RMartinhoFernandes I still don't see the problem. Why would any of that suddenly cause problems?
 
Well, NT at least, 9x was crap.
 
I do it for FunCakes™
mmmm.... cakes.... made of fun!
 
@jalf Er, because when program X goes looking for COM component 3d42f6de-993b-409e-b55b-111537c1ef5f, it's not registered. (I might be misunderstanding something.)
 

« first day (295 days earlier)      last day (4670 days later) »