« first day (208 days earlier)      last day (4739 days later) » 

12:02 PM
and starting to get annoyed that a supposedly simple task at work has kept me busy for something like 2 weeks now
 
@jalf oh no, I do know that feeling
what is that 'simple task" if I may ask
 
we're preparing to switch to git for our source control. So I wrote a python script to pull all the code from the old (horrible) system, and push it into a git repo
and it just keeps choking on odd corner cases
 
@jalf ugh
it's not like I have any idea how to use GIT
is it better then SourceSafe?
 
isn't everything? :D
well, git is the new black, don'tcherknow?
I'm still kind of torn on it. It's a DVCS, which is good, and it's got great community support and such
but I still hate it in terms of the syntax and inconsistency of various commands, and just the unnecessary complexity of it
you can't really use it effectively until you know far too much about the internals of its repository metadata
 
A good API should make advanced stuff possible, but keep simple stuff easy. Git still kinda fails on that second one.
4
 
12:11 PM
yep
but for my workplace, I honestly can't think of a better option. I'd love to have gone with bzr, but we need something that integrates with eclipse and jira, and bzr does neither
hg would've been another option, and maybe, in retrospect, I should've pushed for that instead
but after spending the better part of a week figuring out git, the thought of having to research yet another SCM just made my head hurt
 
template<class InputIterator, class Function> Function for_each(InputIterator first, InputIterator last, Function f);
What are the requirements on Function type?
Does it need to be assignable/copy constructible?
 
for for_each? Yeah, has to be copy constructible
 
You can cheat around this using std::ref though
 
Heh.
 
Or so I believe
 
12:16 PM
yeah
although if you have a need for that, it's usually a strong hint that you should've been using another algorithm than for_each
 
I think it's also correct in the spirit since copies of a reference_wrapper are equivalent...
 
Well, what if I want to pass function object that contains a reference and does not have own cctor and assignment operator? Then there should be no defaults. This is for string concatenation/accumulation.
 
can't you use std::accumulate?
that's kind of intended for accumulating ;)
 
Always remember: std::transform is map, std::accumulate is fold
3
 
I thought I could excep that the STD says "binary_op shall not cause side effects."
 
12:18 PM
what side effects do you need though?
 
The std::string concatenation.
Passing the accumulated string around seems rather wasteful.
 
nah, the copies are optimized away
 
Root of all evil and all that
 
I don't think so, in this case.
 
if you write your functor correctly, it will
don't take the accumulated string by const ref
accumulate is designed to allow efficient accumulation. Don't throw it away until you've tried it and benchmarked it ;)
 
12:24 PM
Seriously, I do not believe much optimization is possible in this case.
I know about copy ellison and such.
But that won't work on either acc = acc + *i or acc = binary_op(acc, *i) when acc is a std::string.
 
@jalf git's UI is (usually considered) more complex and harder to use than hg's; but the main difference between them is the ecosystem, such as github vs bitbucket or the integration you mentioned
in other words, pretty much what you said with "but I still hate [git] in terms of the syntax and inconsistency of various commands, and just the unnecessary complexity of it" :)
 
@wilx I don't see why it shouldn't be possible. Of course, it might require you to put a bit of thought into which args are taken by value and which by const ref, and what to swap and when, but fundamentally, I see no reason why it shouldn't work
of course, assuming a c++0x compiler, move semantics would likely make it a lot simpler
anyway, write the code first, then reason about its performance
doing it the other way around just wastes your time ;)
 
I have the code, already.
And C++0x is out of the question.
 
what does your functor look like then?
 
And I do not see how could copy elison help in this case.
 
12:32 PM
why not?
the accumulated value is just a temporary that's returned and passed to the next iteration. It sounds like exactly what copy elision is designed for
 
I mean, it could elide the copy ctor used for the construction of the return value but it will still have to assign back to the acc which is essentially another copy.
 
or is there some constraint I'm missing?
what do you mean "back to the acc"?
 
acc = binary_op(acc, *i)
This is assignment, not construction.
 
so? the implementatino could just swap them
discarding the old value
 
12:37 PM
Two passes really ?
 
what's the problem with two passes?
 
the alternative is potentially more reallocations
 
exactly
 
so my gut feeling is that this would be faster. But I can imagine datasets where it wouldn't be true as well
 
sure, nothing is perfect in every case
 
12:39 PM
again, give it a shot. if performance matters, it should be measured
 
@FredNurk: That's pretty much what I have except using std::for_each()(which is probably wrong because it results into warnings about returning address (reference) to local variable or temporary).
I can always write the loop :)
I just wanted to know if it is possible to write efficient concatenation using one of the accumulate()/for_each()/etc. functions.
 
loops are clear, unambiguous, and unclever; when a loop meets your goal, prefer it to a convoluted use of something from <algorithm>
 
I see no reason why it couldn't be done using for_each, and storing a referecne to the accumulating string inside the functor
but as @FredNurk says, a loop would likely be simpler and more readable in this case
 
remember, clever is bad:
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian Kernighan
 
you'd be using the algorithm in a way it's not really intended for, so it'd likely confuse the reader
 
12:42 PM
@jalf: That was my earlier question: chat.stackoverflow.com/transcript/message/706844#706844
 
it has to be copy constructible
but doesn't need to be assignable
and even if it did, you could trivially replace the reference with a pointer :)
 
Alright. For_each() it is then.
 
hi all
 
because it's the most convoluted solution?
I jsut said it's possible to coax for_each into working. I agree with Fred it's not the right way to do it
 
if i have state A, that have 17 frames , and each frame have 14 features, then
how many featues are there in state A?
 
12:45 PM
Frames? Features?
Is this some GFX thing?
 
no
its HMM
right now its just a maths question
 
HMM?
 
right now its is math question , so forget hMM
 
then what's the relation between states, frames and features?
 
@Miss 238
 
1:03 PM
Isn't it 30491346729331195904 ?
(or 14 ^ 17)
Maybe I oversimplified :)
It very much depends on what the relationships are... Different ways to count 'features'.
 
@jv42 indeed, I like your 14**17, just as valid as my 17*14 :)
 
@Fred: yup both are valid
 
I'd go with 14
we don't know that the frames contain different features
 
if we're getting unique features, the answer could very well be one
 
problem solved :)
 
1:12 PM
Is compiler jealousy a real thing? gcc hangs when I try to build clang
3
 
@jalf sure, it knows it won't be there for long!
 
@jalf hahah compiler jealousy! fun fun :)
 
@TonyTheTiger cos of the new Android gadgets such as android boards or light bulbs, well all the nerdy stuff :D
 
@Nils oh lulz
boost::system::error_code any idea where the error codes are described?
I am reading from a socket and I get an error saying "end of file"
not exactly descriptive I'd say
error code = 2
 
1:32 PM
@TonyTheTiger Boost.Asio?
 
yep
I think I know what the issue is
I am trying to read to a buffer that is bigger then what I need
and I'm guessing it's trying to fill the entire buffer
but that's just not possible, as there isn't that much data on my socket
so how can I read from a socket without knowing the length of the stream on my socket using boost::asio?
 
Because there is a list of all the error codes in the Boost.Asio docs but there isn't much of a description...
 
@TonyTheTiger async_read_some vs async_read
 
hey
 
1:46 PM
any idea for my question?
 
@JohannesSchaublitb which question?
 
8
Q: Why is it disallowed for partial specialization in a non-type argument to use nested template parameters

Johannes Schaub - litbI have this code template<int N, bool C = true> struct A; template<int N> struct A<N, !(N % 5)> { /* ... */ }; // should work A<25> a; That is, for numbers N that are divisible by 5, the compiler should use the partial specialization. But the compiler won't accept t...

 
@FredNurk hmm
@JohannesSchaublitb how could the compiler know up front whether this is true or not (N % 5)?
 
N is a template parameter, so it's known when the template is instantiated
 
@TonyTheTiger i don'T understand what you mean
can you please give a problematic example?
 
cpx
1:50 PM
@JohannesSchaublitb hi
I'm just started learning about templates :P
 
@JohannesSchaublitb doesn't matter, wasn't relevant it seems anyways
i'm not good enough at templates to answer your question
 
@JohannesSchaublitb Partial specialization is not in the index of D&E. For rationale question not covered in D&E, I think usenet and the committee reflectors are better avenue than SO as they are frequented by some people who were there at the time.
 
whydon't they frequent SO
 
James Kanze, Howard Hinnant do. I can't answer for the others.
 
2:06 PM
hi all
i want to share some slides of pdf file.. so i just need some slides from that pdf..how can i extract slides from a pdf file
 
cpx
@Miss My guess is you need a professional version of acrobat.
 
i have that
i want to share some problem with you people but how do i extract slides from pdf
 
2:16 PM
I have a unsigned char buff[5]and somehow it ends up putting 149 chars in it, that's not good :( so I have UB right, cause my stack is now overflowed
?
 
How did you come to that conclusion? Looking it in the debugger?
 
@MartinhoFernandes cause it doesn't make any sense, how can I allocate memory for five bytes and end up with 149 bytes in it?
it just sounds wrong
and yes I am looking at it in the debugger
it's not crashing or anything
but it's weird
 
Probably just forgot to null-terminate it.
The debugger just keeps looking ahead in memory until it finds a \0.
 
@TonyTheTiger How did you call boost::asio::buffer? boost::asio::buffer(buf)?
 
@Tony, if you have put exactly 5 character in buff, you can get the impression that there are more as debugger (and functions expecting a string instead a buffer) will continue until they get a NUL.
 
2:19 PM
@LucDanton yes
 
@TonyTheTiger try boost::asio::buffer(buf, sizeof buf)
 
so I have 2 buffers
1 is the tempbuff[5] which is filled with the first five bytes received, then I have to check something and then I call read_some on the socket with another char buff[1024], which the read_some fills, but it also writes to the first tempbuff
 
@TonyTheTiger Hard to tell what's happening without some code tbh
 
@LucDanton ok
it won't compile, cause it's missing lots of things to compile, but it shows what is going on
 
are all the buffers of type char[N] ?
I see buff and tbuff passed to boost::asio::buffer
 
2:29 PM
@LucDanton tbuff is unsigned char and the buff is vector<char>
but it says read_some needs special things to work with vector in docs
so I thought I'd take the easy route
donno how to pass vector<char> to it
 
if you use raw arrays pass the length when calling boost::asio::buffer
nah the docs say this is fine
 
only thing is I don't get how it overwrites tempbuff when doing read_some as well as tbuff
and goes out of bounds on tempbuff
maybe because I didn't pass the size of it?
 
all the buffers including tempbuff are members?
 
to boost::asio:buffer?
 
No it's not that
I checked the docs it's fine
 
2:32 PM
@LucDanton yep
	std::vector<char> buff;

	unsigned char tempbuff[5];
	unsigned char tbuff[1024];
 
Does tempbuff get overwritten in each case or only for one?
 
@LucDanton no only when doing the read_some
so tempbuff is normally only containing 5 chars and after read_some it contains 149 chars
which is a bit worrying, seeing it is only supposed to be 5 bytes
 
@TonyTheTiger I see nothing wrong with the snippet; where do you get the 149 figure?
 
@LucDanton it's the size of the string it puts in
I see it while debugging
 
I'm not sure why you ignore the message_size error though
 
2:40 PM
@LucDanton huh?
 
@Tony If you have a boost::asio::error::message_size_error you still proceed; why ?
 
@LucDanton must be a mistake
should it be && instead of || in that if statement?
 
I'm not sure why it shouldn't be just if(!err)
 
i'm confused
not sure why it's doing that, writing to this other buffer
 
3:02 PM
appending a zero-termination char is like so right? tempbuff[6] = '\0';
 
That's UB if tempbuff has size less than 7.
-2
Q: Apply polymorphism concept

user750792 a. Apply polymorphism concept on following activities of department. Identify the method/behavior which is polymorphic in nature. Identify minimum one base class and two derived classes for each polymorphic activity. Use UML notations to draw the diagram.Booking appointment b.Treating patien

 
@MartinhoFernandes size is 6
 
Worst homework question ever. It's not even complete.
 
typical
 
Well, I've seen "here's my homework, do it for me" before. But this "here's a part of my homework. Figure out the missing parts and do it for me" is new to me.
 
3:05 PM
@MartinhoFernandes lol
just vote to close
prob doesn't even what "polymorphic" means
 
@TonyTheTiger If size is 6, you can't access index 6 safely.
(you can take its address though, which is useful for iterators)
 
@MartinhoFernandes ok, just making sure, cause I wasn't entirely certain
 
sbi
I've just put this site on flashblock's whitelist, hoping that this would make FF beep whenever someone sends a message containing @sbi, as IE does. Let's see if this works...
No, it doesn't. :(
Well, it was worth a try.
 
@sbi hello
 
sbi
@TonyTheTiger Oh, it did work!
 
3:09 PM
:)
@sbi cool
 
sbi
Now that I think of it, when I wrote @sbi, this also didn't increment the number of mentionings I see here.
No, it doesn't. Interesting. I do remember you could notify yourself a few months ago when we explored the chat.
 
@sbi hmmm
why do you want to hear a sound when you get mentioned, I find it rather annoying
 
sbi
@TonyTheTiger I guess they have fixed that.
 
mmm
 
sbi
@TonyTheTiger Maybe I'll find it annoying, too, but now I can find out. :)
 
3:13 PM
why is it that indigestion tablets are so tasty
 
hmmmm
@DeadMG so you would eat them
 
nom
I'd eat them anyway, kek
 
sbi
@DeadMG Because they put something in to make them so?
 
Yay, now we can spam @sbi with beeps. :P
 
true
but then why do other pills like paracetamol taste so disgusting?
 
sbi
3:15 PM
@MartinhoFernandes If you do that, I'll just turn it off. :)
 
Hmm, this is interesting. Lounge<C++> is the only chat room where people chat.
 
The mention counter only increments when you reply to yourself. Simply mentioning yourself doesn't.
 
is it an atomic increment?
 
(I was just kidding about the spam)
 
sbi
@Raze I'd very much doubt that.
There's probably thousands of chat rooms on the net, if not a million. If everyone would chat here, this would get quite crowded.
 
3:18 PM
I'd expect millions
 
sbi
@MartinhoFernandes Oh.
 
@sbi, I mean in stackoverflow chat.
 
sbi
@sbi Does that beep?
Yep, it does.
 
Where is this mention counter?
 
sbi
@Raze See, the advantage of the C++ chat room is that there's people to chat to. The disadvantage is that the people are C++ programmers, and thus anally obsessed over little details most people don't fuss about. :)
 
3:21 PM
@Raze That little circle on your avatar with the 1 in it.
 
sbi
@Raze It's a small number overlay popping up over the top right of your avatar to the left of the message edit pane.
@MartinhoFernandes Now it's a 2!
 
@sbi, most people don't care about little details, and they find it hard to really understand how computer works, and most of them, if not all, rely on trial and error more than they ought to.
 
sbi
@MartinhoFernandes Anyway, so that theory is proven. However, other people just mentioning @sbi will also increase the counter and beep, me doing so won't. But now I'm not so sure anymore that this used to be different...
@Raze Yes, but what I was trying to say was that, while most programmers are finicky, C++ programmers are anally so. :)
4
 
@sbi oh is it that important, at the end of the day?
 
27 secs ago, by sbi
@Raze Yes, but what I was trying to say was that, while most programmers are finicky, C++ programmers are anally so. :)
 
3:24 PM
@sbi I have learnt that by being here, very much :)
 
sbi
@TonyTheTiger No, definitely not. At the end of the day, only a few things are important. Like: Are the kids already in bed? Is there a beer in the fridge? Do I have to get up early tomorrow? :)
 
@sbi, :) Right. and most others don't care how it works as long as it works.
 
@sbi true :) beer being the top of the list obviously :)
 
And is there food on your table?
 
@Raze not me, I like to know HOW it works!
 
3:27 PM
@TonyT
What just happened?
@TonyTheTiger, you probably know C++.
 
@Raze I got notified
 
@Tony, even without the full name?
 
sbi
@Raze You learn to not to do that as a C++ programmers. "it works as expected" is one of many ways of Undefined Behavior manifesting itself, but "it stops working for no apparent reason" is one that yopu'll find almost as often.
@TonyTheTiger My list already is in decreasing importance. :)
 
@sbi yep, that's the reason I had to do a rewrite of the project I'm doing.
 
@sbi, I know about the "it stops working for no apparent reason" stuff. Been facing it a lot lately.
 
sbi
3:29 PM
@Raze You need to use at least the first three characters from the user name.
 
@To can you hear this?
 
@Raze it's C++, you can't expect anything else
@Raze nope
 
Hmm. interesting.
 
sbi
@Raze No, he cant. @Raze works, @Raz works, too, but @Ra doesn't, and neither does @R.
 
@sbi kinda makes sense really
it would have to be really accidental that the first three letters are the same of a given name
unless they are the same name
 
sbi
3:33 PM
@TonyTheTiger You mean like the 14x27 user named "Tony*" on SO? Very rare, yes, indeed. :)
 
@sbi ugh, I knew you'd say that :)
 
@sbi: It is, however, very rare to find such in this channel
I usually find that only Fred requires disambiguation
 
sbi
@TonyTheTiger Yeah, I kinda have an reputation for putting my finger right into the wound.
 
one example does not disprove "very rare"
 
multi-fredding, very difficult
 
3:35 PM
had that joke six hundred million billion trillion times
 
@DeadMG what did @sbi say earlier about being anally frinicky? hmmm
@DeadMG you can't prove that
 
I tend to be not particularly anal at all
@Tony: It doesn't really require proof
 
@DeadMG you code in c++, 'nuff said
 
@TonyTheTiger but can you prove that?
 
just because C++ is a very anal language doesn't mean that I appreciate that specific property of it
 
sbi
3:36 PM
@TonyTheTiger But he failed to see the light that's Prolog. :) I wonder if that's somehow related...
 
@jalf that very statement is its own proof :)
 
@sbi: Probably because you have to walk blindfolded through a maze filled with laser tripwires first
 
@sbi hmm perhaps
 
sbi
@DeadMG Just because there's heavy traffic doesn't mean that I appreciate it. But I still learned to look before crossing the street.
@DeadMG Lasers are light, too, you know. :)
 
@sbi: I just learned to take the subway instead
@sbi: Yes, I know that, don't see how that's relevant
 
sbi
3:38 PM
@DeadMG You have subways to get you across the street??
 
@sbi it's england, expect the unexpected
 
many of our inner-city streets have underpasses
 
Sorry, power fail.
 
we have subways to eat sandwiches :)
2
 
sbi
@Raze Drink a coke/red bull/coffee to restore your power!
 
3:43 PM
pfff what a day, time for a break
 
ooh, a break sounds good. Maybe I'll have one on monday!
 
@jalf ugh
 
it's kind of sad when you look forward to the weekend ending, isn't it?
 
@jalf why are you looking forward to weekend ending?
is it gonna be a boring weekend?
 
because I'm going to spend the weekend packing my stuff and painting the apartment and stuff like that
on monday, I've returned the keys, and it's officially over :D
 
3:47 PM
@jalf oh I see
 
then I just have to live on someone's couch for 6 weeks
 
so where are you gonna put all your stuff?
 
in storage
 
sbi
No offense meant, but that sounds like a case of bad planning to me, @jalf. :)
 
3:50 PM
:)
 
@sbi I have plenty of those in my life :)
 
kind of
 
tomorrow is my last day on this job :p
 
sbi
@TonyTheTiger Wow. Middle of the week, middle of the month? Odd day.
 
been living with my brother for the last year and a half, and we've always had a deal that if one of us wanted to move, he should just do it. So my brother found a cheaper place with a couple of friends, so we're quitting this place
 
sbi
3:51 PM
And then you're lost to us, @Tony, since you're not doing C++ anymore?
 
@sbi tomo is friday
 
and kind of tricky to find a place to rent here atm, especially if you want to pay less than an arm and a leg
 
@sbi, only if coke/red bull/coffee could power a laptop.
 
so I wasted a lot of time on that
then decided to see if I could afford to buy a place instead
 
@sbi of course not, I will continue doing C++ in my free time, and I will continue to roam this room
 
sbi
3:52 PM
@TonyTheTiger You say! That week surely went by like a flash!
 
that was some 3 weeks ago.
 
@sbi and my new job will contain some C++ here and there
 
@sbi hmm... huh...
 
sbi
You live in Copenhagen? And it's cheaper to buy an apartment rather than renting one? Oh boy..
 
found a place and all the formalities went through a couple of days ago, but I can't move in until july 1st
 
sbi
3:53 PM
@Raze Oh, sorry, that was meant to go to @Tony.
 
@sbi hahah
@sbi should be good news to you then
if you like weekends that is :)
 
sbi
@TonyTheTiger I fixed it. Wow, I fixed history! Isn't that great?!
 
@sbi yes pretty cool!!
 
sbi
Well, it seems I failed. I just looked and it seems history is still broken. :(
 
@sbi yeah definitely. Compared to what I'll pay for the loan and everything, it would likely have cost me 25% more per month to rent a similar apartment
and taken a few more months, and a lot of luck
but yeah, bad planning, I don't deny that ;)
 
sbi
3:57 PM
@TonyTheTiger I'll like this one. Nice weather for being in the garden, a friend visiting on Sat, we'll work together for some time, and will BBQ for the rest :), and I won't even have to watch the kids. What more can a man want? Oh, wait...
 
didn't help that it more or less coincided with me starting at my new job though. Didn't leave a lot of time for apartment-hunting
 
@sbi women?
@sbi ugh :(
 

« first day (208 days earlier)      last day (4739 days later) »