« first day (207 days earlier)      last day (4740 days later) » 

12:00 AM
@Raynos In the short term, not much -- it's so huge that it would take a long time before anybody could do much with it. In the longer term, I think it becomes almost impossible to predict. I suspect, oddly enough, that it would lead to considerably greater respect for Microsoft. I think a lot of people who blindly assume all their (Microsoft's) code is horrible would be forced to admit that a lot of it is better than they currently believe.
 
A quick change of subject, has anyone here interviewed with G**gL3 ?
I'm accepting tips/suggestions of all kinds.
 
@karlphillip well, you could do as I did when I got their "hi there, you might like to work for us" letter and tell them you`re not interested :-)
 
any technical phone interviews? I heard they are hiring a lot this year, and Microsoft.
@RonaldLandheerCieslak I didn't tell them that.
 
well, that is about as much "help" as I can give on the subject ;-)
saves the hassle of a bunch of interviews, though :-)
 
12:16 AM
Doesn't really land you a job, though.
 
Ogre3D is ucky
Singletons everywhere
 
Singletons, gotta love them, man
or hate them.
 
I love SO, though
solved my annoying problem with LINQ to SQL
 
12:59 AM
boost::optional is spamming me with warnings about base classes with non-virtual destructors. Is this normal?
 
@MartinhoFernandes depends: is there anything virtual in your derived classes?
 
I haven't used anything yet. Just #include <boost/optional.hpp> and bam! 84 warnings. Just wondering if it was expected.
 
@MartinhoFernandes Never happened to me
@MartinhoFernandes are your boost headers in a custom folder or in the system folders?
 
1:18 AM
They're all in a custom folder, under %programfiles%\boost_1_46_1_\, but I have that path in the include list.
I'm using GCC with Code::Blocks if that matters.
 
@MartinhoFernandes if that's the case you might be interested to gcc using the -isys instead of -I command
that way GCC treats whatever is included from there as a system header and suppresses warnings
I believe that's how you never get warnings from system headers even when cranking up the options
 
Oh, I thought that was because the stdlib was a piece of perfection and compiled without any warnings ;)
 
@MartinhoFernandes I like to use -Wconversion; I'd be surprised if no implicit conversions were used in the glibc or libstdc++
 
1:33 AM
@Luc thanks, the -isystem thing silenced the warnings. I don't plan on deriving from anything, so I think I can ignore them safely.
 
@MartinhoFernandes I assumed those warnings came from the Boost code though
 
urgh
I want to sleep, but work to do
 
@LucDanton Yes, of course! Mostly mpl::bool_<false>.
Whatever that is.
 
it's a compile-time meta-programming boolean constant that is false
but that shouldn't have anything virtual in it
can you paste the warning messages to pastebin?
 
@Ronald it derives from mpl::integral_constant so I guess that's that
 
1:36 AM
Sure, let me change back the compiler flags.
 
does it have any virtual methods?
 
@Ronald Well no, it is meta-programming
 
that's what I thought (I don't have Boost on this computer)
but then GCC shouldn't complain
 
Is there a reason not to simply use false for that?
 
yes: it has to be a meta-function that returns false
 
1:37 AM
@Ronald But you know what mpl::bool_ is :D
 
@LucDanton of course
I just don't understand why GCC would complain about the base class' destructor not being virtual for a meta-function
the only reason why it should complain is when there's a virtual method in the derived class
 
@Ronald some warnings are here not for correctness but for 'good style'
 
I've derived from traits classes without any warning in my user code so I think that's a pretty arcane warning, unless something changed from a previous version of gcc
 
I'm running 4.5.
 
1:40 AM
but IIRC, the warning from GCC (which I'd like to see) is intended to make the base class polymorphic if the derived class looks like it should be polymorphic..
 
@MartinhoFernandes I'm interested in your gcc command line options
 
@MartinhoFernandes me too
and the warning messages
 
(paste coming soon, my disk decided to take a nap...)
 
I usually compile with -Wall -Werror and have never seen those warnings with boost::optional
so I am intrigued
 
I'm using: -Wall -std=c++0x -Weffc++. Hmm, maybe that last one is the culprit. I toggled it on a while back and completely forgot about it.
 
1:43 AM
@MartinhoFernandes It probably is
It's a warning that's fine for 1998 if you write OO code but that's about it I think
 
@MartinhoFernandes yup
Effective C++
style guideline says base classes should have virtual destructors
-Wnon-virtual-dtor (C++ and Objective-C++ only)
Warn when a class has virtual functions and accessible non-virtual destructor, in which case it would be possible but unsafe to delete an instance of a derived class through a pointer to the base class. This warning is also enabled if -Weffc++ is specified.
it's the "virtual functions and" I don't get, though
unless the warning is even stricter if it's for effective C++
 
Here's the (now irrelevant) compiler output: pastebin.com/2S0Paa0c
 
Well there seems to be something missing from the GCC docs, unless mpl::integral_constant suddenly gained function members...
@MartinhoFernandes Also if you enable 'full command-line logging' in the codeblocks options for the compiler you can copy the gcc invocation
 
@LucDanton I hope it's the GCC docs
gotta go - good night :-)
 
@LucDanton Good to know. Thanks for the help. Good night.
 
1:53 AM
@MartinhoFernandes same to you
 
 
5 hours later…
6:34 AM
ouh did I miss something?
morning btw
 
you missed a chat about OpenGL and DirectX
 
@JerryCoffin I hate Linux graphics (google this :) but the state in which the Linux gui is (including graphics anc OpenGL support) is really poor there is basically Nvidias proprietary drivers which replace most of Linux/X11 broken stuff.
 
 
2 hours later…
8:48 AM
hi guys!
I have a prob. I want to share with you guys.. :
0
Q: Setting up a test environment for real-time testing of a high-speed mass data transfer protocol

echo9Hi guys..! ..and gals too! :) I have been working on a High speed mass data transfer protocol, and I am now ready for testing it in a live environment. Programmed in C++ natively for Linux. Although I would like to first test it in a LAN environment but I am confused as to how should I set up a...

 
@echo9 This is definitely not my forte but can iptables handle this sort of things? i.e. using a third computer to route?
Also did you check the suggested questions related to yours? I can see stackoverflow.com/questions/262282/network-simulator
 
@LucDanton Gee.. Thanks
 
@echo9 Sorry about that, you'll have to find a real networking guy
 
@LucDanton hehe.. yeah
 
is there an easy way how I can print out numbers in columns in C++?
Eg not like
-1 23
1 13
-12 14
But
- 1 23
1 13
-12 14
 
9:01 AM
@Nils I don't see the difference in your posts?
 
hrmm chat fucked it up
 
@Nils Assuming you're using streams, have you tried std::setw?
 
well there should be aligned naturally as you would write it on paper, @LucDanton I don't even know about it, let me googld
 
nah
@LucDanton It should take the number width into account
still ugly
 
9:08 AM
@Nils like the number of digits in it?
 
yes
 
You're doing it wrong
I'll show you
 
:)
I think I coded this once manually, but I think in Java or so, don't remember it exactly..
 
setw is not used to introduce spacing
it's to specify how wide the next insert will take
the next insert gets its own field
 
thanks! @LucDanton
 
9:14 AM
notice that the first column gets some spacing
 
But you have to call setw every time, there is no switch where you can setw permantently
 
Which is why I made it in a loop
 
ok
 
@Nils There is a Boost library that can get you around that boost.org/doc/libs/1_46_1/libs/io/doc/ios_state.html
on the other hand, there also is Boost.Format, but it's more general
 
ok
 
9:20 AM
@LucDanton what's this declaration const int (*end)[4] ? Is that an array of pointers?
 
I feel like Boost.Format would be too much if you're just doing some easy formatting like your silly examples
@Tony yes
It's also an iterator for the data array
which happen to be an array of array
so it's more of an iterator where the value_type is int[4] really
 
@LucDanton ok and they are of type const int?
or const pointers to int?
 
pointers to const int yes
not const
 
oh cool, just making sure I read that correctly
 
I increment it to loop the array
notice the tricky *end declaration, too... the second one
 
9:22 AM
What's the way to iterate over two lists with the same length at the same time? Guess you need two iterators, can you create and increment them in one for loop? Like codepad.org/egp0obWd
 
this sizeof *data returns what?
 
@Nils you have to bring up the iterators declaration out of the loop
because they're not of the same type (I assume)
 
ok
 
data is const int[4][2]
*data is const int[4]
so sizeof *data is 4*sizeof(const int)
@Nils I misread that
 
@LucDanton hmm interesting way of doing things
 
9:24 AM
you can do std::list<scalar>::iterator ita = a.begin(), itb = b.begin()
they are of the same type after all
 
@LucDanton you could've used a vector<vector<int> >, or were you doing it this way for a reason?
 
@Tony when doing short examples I use raw arrays and this is how you iterate over raw arrays
 
@LucDanton oh ok
just curious really
 
@Tony here it is refactored codepad.org/I7Pi0KIV
 
@LucDanton Just came into my mind that one of them is of type int, it doesn't work in this case. Never mind I replaced it with a while loop, initializing the iterators out of the loop and increment them as the last statements in the loop.
 
9:28 AM
given T array[N], the range to iterate over is [array, array + sizeof array/sizeof *array)
and the type to iterate over is T*
I suppose this is some holdover over C
outside of examples I typically use std::array or std::vector
 
@LucDanton cool thx :)
 
std::cout.precision(n) is strange
seems to have no effect until I set precision to like 20 or so
 
@Nils I'd rather use std::setprecision cplusplus.com/reference/iostream/manipulators/setprecision
but this isn't relevant to your problem however, this would behave the same I believe...
I think the page however explains the behaviour you're seeing
 
9:45 AM
hello @CatPlusPlus
 
@Nils Perhaps you'd want fixed point notation to come with the precision?
 
@TonyTheTiger Hi.
 
how are you today?
 
hi
 
are there actually CPU (ie FPU) instructions to calculate logarithms?
or are these combinations of multiple instructions?
hi @DeadMG
 
9:59 AM
I think that they might
but I'm not sure
 
oh ok
 
@Tony en.wikipedia.org/wiki/X86_instruction_listings mentions FYL2X [ y * log2(x) ]
 
maybe we can continue our graphics discussion... lol
 
I don't know if it's actually good practice to use them though
 
@LucDanton me neither, I was merely curious
what do you say? are enums threadsafe in their very nature?
 
10:04 AM
enums are no more or less threadsafe than any integral value
 
Immutable values are thread-safe.
 
the question doesn't reference immutable values at all
 
I would expect enums to be immutable.
They're just constants, right?
 
@MartinhoFernandes Enum values are, well, values but enum variables are, well, variables
 
Oh, nevermind, then. Still waking up.
 
10:36 AM
you're not the only one
I desperately need to get to sleep, but I've got to go to a group meeting at 2 and then doctor's at 3:50
 
hope the doc has something to help you feel better
 
should fuckin' hope so
round 4
 
3
Q: How can I cast or convert boost bind to C function pointer?

CianticSuppose I have this: void func(WCHAR* pythonStatement) { // Do something with pythonStatement } And I need to convert it to void function(void) like this: bind(func, TEXT("console.write('test')")) Now I have struct like this: typedef void (__cdecl * PFUNCPLUGINCMD)(); struct FuncItem { ...

Is this possible?
 
10:51 AM
Not directly, because in this case the bind expression has state
So need to setup a freestanding function + global state to pass the functor
writing an answer right now
someone did it before
 
sbi
11:09 AM
1
A: How can I cast or convert boost bind to C function pointer?

Kirill V. LyadvinskyYou could convert bind object to boost::function, then use target to get the plain pointer: boost::function<void ()> fn = bind(func, "something"); pFunc = *fn.target<PFUNCPLUGINCMD>();

 
we just had tht question linked
 
@DeadMG sbi linked to an answer.
 
wait a minute
 
I'm amazed. How does that work? (and more importantly, does that work if the boost::function was not created from a function pointer?)
 
you can do that?
yeah
 
11:10 AM
I'm pretty sure it's not for that
is it?
Yeah it's some RTTI-enabled introspection
 
sbi
@LucDanton I don't think it has anything to do with RTTI. The exact function type is passed as a template argument, after all.
 
@sbi "If this stores a target of type Functor, returns the address of the target. Otherwise, returns the NULL pointer"
const std::type_info& target_type() const;
There's no magic here...
 
sbi
Actually, it shouldn't be hard to pick a specific instance of a static member function template and return that. The problem is where they hide the necessary object.
@LucDanton Where's that from?
@LucDanton I never said there would.
 
@sbi It would be possible to implement what you think target does, but that's not what target is for
well the official docs :|
 
yeah
 
sbi
11:16 AM
@LucDanton Ah. Unfortunately, I hadn't had time to play with C++ for most of the last two years, so my knowledge of anything starting with TR1 is quite sparse.
 
MSDN says that Target will only return it if it's the underlying type of the function object
so more like a dynamic_cast
 
The Boost developers are way too sane to implement something that depends on global state
and now it has been accepted as the answer... great
 
@LucDanton So, it doesn't work?
 
sbi
@LucDanton Of course. Which is why I was so puzzled.
 
no
 
11:18 AM
No, there ain't such a thing as a free meal...
 
sbi
@LucDanton O-kayyyy. So what does it do then?
 
@sbi Nothing. It just returns the underlying object, if you guessed it's type correctly.
:(
 
@sbi: As I said, it effectively serves as a dynamic_cast to test the underlying type
 
sbi
Ah, it seems it only returns whatever function stores when it stores exactly what's passed as a template argument.
 
Am I the only one who RTFM here?
 
11:20 AM
no, I just did
 
sbi
Yeah, thanks @Martinho and @Dead, I just figured it out from the boost docs.
 
I should be working
but I might just tell my team I'm sick
 
3
Q: How get smallest n, that 2 ^ n >= x for given integer x in O(1)?

Mihran HovsepyanHow for given unsigned integer x find the smallest n, that 2 ^ n ≥ x in O(1)? in other words I want to find the index of higher set bit in binary format of x (plus 1 if x is not power of 2) in O(1) (not depended on size of integer and size of byte).

I think I found a duplicate. Vote to close?
 
I just realised the question is asking for a constant-time integral log
 
@FredOverflow I don't know, seems like a different problem to me. There's the O(1) constraint, and >= instead of =. The latter one might not make a difference in the answers, but the former certainly does.
 
11:34 AM
here's a question
I'm really kinda tired and worked through the night
now I've got a team meeting and want to blow it off, and I've been considering saying that I'm sick
 
And "call BSR" is hardly an algorithm (I know that it is, but it's probably not what the OP expected).
 
is that really bad?
 
@Martinho 2 ^ n, not 2 * n <- nevermind
 
@DeadMG If I were one of your team mates, I probably wouldn't be happy about it.
 
true
but if you were one of my teammates, you're an asshole anyway
 
sbi
11:46 AM
@DeadMG That largely depends on factors we don't know. (Like: How tired are you really? How important is that meeting? How much do the others really "deserve" you ducking out? etc.)
 
@DeadMG Tell them you've met someone else, it's really not their fault, and you want to stay friends!
 
well, honestly, I know that this is stereotypical of people my age, but I seriously can't handle missing my beauty sleep :(
 
hi alll
I have a question(general) regarding C++
 
@DeadMG If you just tell them that you're tired because you've been working through the night, wouldn't that be a better excuse?
(besides being the truth)
 
well, it likely would be, except I doubt that they would see it that way
I mean, fundamentally, I don't trust them to see things in a reasonable fashion
 
11:50 AM
@asma So... will you ask the question?
 
@DeadMG why so?
 
well
 
Nah, s/he's gonna keep it for his/herself. Why give it away, when you can be the one with it?
 
yeah
 
basically they told me my work was wrong because I didn't rip off someone else enough, and that they knew this because other groups on the same course have extensively ripped off the someone in question
 
11:51 AM
can we do web development in C++?
 
@DeadMG oh gosh
whatever happened to learning instead of copy&paste?
 
@DeadMG Ok, you're right, they're assholes.
 
@DeadMG You mean amazon, right?
 
yeah
 
@asma You could, but why would you want to? There are certainly other languages that will get you quicker to results.
 
11:53 AM
@asma I know of CppCMS (which is not a CMS) but I've never used it: cppcms.sourceforge.net/wikipp/en/page/main
 
oh
I officially hate ASP.NET now
 
@DeadMG sleep is more important, screw everyone else :)
 
they have a Tuple class, like std::tuple in C++0x
apparently, you can use anonymous types in SQL, but not Tuple types
and they keep calling events and stuff when it shouldn't happen, and not submitting to the database when it should
 
yeah i know but I just asked a random question came into my mind
im basically a .net developer
 
which makes me very grumpy about it because I spent two hours working on a web page yesterday
 
11:55 AM
@LucDanton Thankss :)
 
only to find out that if I'd used an anonymous type instead of a Tuple, I'd have solved the problem in five minutes
and the problem only arose in the first place because a teammate was a total moron about the database design
 
@asma As a general guideline, I would advice against C++ unless you are 100% certain that you need the raw power and you know how to handle it.
 
that btw should be printed on the first page of every c++ book
☃ oh look a snowman in ascII
 
that's Unicode, I think
 
@DeadMG: it's ASCII, the means of artistic expression, but not ASCII, the character encoding.
Two different things. :P
 
12:00 PM
@Reno It might scare potential readers off. On the other hand, reading lots of C++ books is the only way to obtain real C++ knowledge...
 
@FredO: I learned almost everything I know through some shitty basic tutorials and answering questions wrongly here
does that mean that my knowledge is a lie? :(
 
let me check, someone told me it was ascii o_o'
 
@FredOverflow While dodging the seriously bad ones.
And you can always learn from mistakes. Those are easy to get in C++.
 
@MartinhoFernandes ...which is about 90% of the books out there ;)
 
I don't think I'd understand exception safety so well without Herb Sutter
 
12:04 PM
Okay @FredOverflow
 
12:16 PM
Reading books?!
/me just read the C++ faq lite and cplusplus.com
ah and one scott meyers book
 
@Nils Which one?
 
more effective c++ I think
not sure
 
His worst book in my opinion, very outdated.
 
d'ouh!
well I can't just read, I also have to try it out..
 
sbi
@FredOverflow I answered with a compile-time solution: stackoverflow.com/questions/5962302/… :)
@Nils That would be the wrong one to start out with.
 
12:29 PM
 
its even worse you might bring down the whole internets D:
or something
 
I doubt that very much
 
Its long drawn but the chinese actually had a chance of bringing down google using operation aurora. And google is basically gateway to the internet
 
12:59 PM
Heh. Looks like somebody did not like my answer: stackoverflow.com/questions/5949803/…
 
1:19 PM
hi all
 
@Reno That can be achieved much easier:
 
@vaibhavjani what did you say to me /?
@vaibhavjani what did say to me and then you removed.why?
btw , your profile picture is my fav
..because i like that ..
 
1:46 PM
@Miss forget it bye
 
hmm
ok as you wish ..bye
 
 
1 hour later…
when you have something like this struct test_resbuf *pRetval = NULL; you makes the pointer points to nowhere, right?
 
yes
 
and if I do that pRetval = NULL, im making all places it points = NULL right?
 
@cyberrog you're setting that pointer to NULL, meaning it doesn't point to anything
 
no, you are setting only this variable
if thats your only pointer that is pointing somewhere and you set it to NULL to are making an memory leak
 
2:57 PM
@TonyTheTiger Remember, laziness is a virtue
 
@LucDanton heheh :)
 
@LucDanton First look at the way it is implemented there...
 
@AProgrammer Well this sort of thing usually requires first class support from the language, doesn't it?
 
@LucDanton Why would that be? Having lambdas makes that really easy to implement.
 
Are component-based entity system (where component = hot structure, script = event/message handler) is designed around Data-oriented design?
 
3:02 PM
@LucDanton I think so.
@MartinhoFernandes A big use of lazyness is to put lazy value in data structure
I.E. IMVHO, lazyness is not just call by name with memoization.
 
@AProgrammer you mean, like Haskell? I think it's just a matter of syntax.
 
@MartinhoFernandes I'd rather use a lambda DSL than use a generic lazy<T> without first class language support; but only because of the syntax, it could be pulled off with the same power
 
What do you do for a living? I'm a hairdresser!:wq
 
@Nils a hairdresser and you write code in your free time?
2
 
nah of course not, a friend of mine sent me that.. as a joke
 
3:11 PM
@Nils lulz
 
3:25 PM
@TonyTheTiger do u use vim?
 
hello world!
 
@Nils only when coding under Linux
 
it works!
 
3:47 PM
ok
in the end, I was a bit of a mean fuck, and didn't go AND didn't give any reason
 
@DeadMG I think that's way worse than making up an excuse.
 
yeah
well, I can still post one, but it'll be after the event
 
all I'm really concerned about is that my doctor finally arranged for me to get various tests
 
why are you concerned about that?
 
3:53 PM
because it's great news
 
good :)
 
or rather, I just noticed what you mean
it is my primary consideration, not my main concern
 
oh I see
 

« first day (207 days earlier)      last day (4740 days later) »