« first day (750 days earlier)      last day (4203 days later) » 

user142019
6:00 PM
@Ell you can always change it later.
 
Ell
yea
 
user142019
I’d consider this legitimate use of new, except for one thing: exception safety.
 
user142019
That’s a problem.
 
Ell
if theres other stuff in the c_handler function, it doesn't look excpetion safe
 
Alf has reading comprehension problems and appears to be paranoid/delusional. (Paranoid because he thinks I have a "source"; delusional because he fancies himself a C++ expert.) Best to just ignore him. — Nemo 42 mins ago
 
Ell
6:00 PM
I thought of that before you said it, honest :L
 
user142019
@Ell what about something like the following?
 
^ I just flagged this. I don't understand such hate.
 
isnt there a boost regex lib already built so I can download it and use?
 
user142019
char* foo = new char[str.size()];
std::copy(std::begin(str), std::end(str), foo);
g_signal_connect(instance, foo, [] (char* _name) {
    std::unique_ptr<char[]> name{name}; // add comment for clarity
}, data);
 
user142019
:P
 
user142019
6:02 PM
@Cheersandhth.-Alf dubbed
 
Ell
@Zoidberg'-- how does that work? o.O
 
I dont want to build this stuff. the docs are confusing
 
user406009
@rogcg Which part is confusing?
 
user1174868
C++ is so confusing compared to scheme
 
Xeo
6:03 PM
@Ell Create temporary unique_ptr which will immediately delete the string
 
user406009
These guys have prebuilt ones: boostpro.com
 
Xeo
I don't see why not simply use delete [] name;, though.
 
user142019
@Ell it deletes the string when the c_handler exits.
 
user142019
@Xeo he has other stuff in the callback, so delete[] may not be exception safe.
 
Ell
ohh got you
 
Xeo
6:04 PM
@Zoidberg'-- Oh, right.
 
user406009
But I don't think they support VS2012.
 
I cant understand this part of building with visual studio, bjam, unicode and ICU Support. I use g++, not this stuff they say..

http://www.boost.org/doc/libs/1_51_0/libs/regex/doc/html/boost_regex/install.html
 
user142019
@Ell maybe encapsulate g_signal_connect in a C++ function that handles all this stuff?
 
Ell
yeah that's what I'm doing now
 
user142019
lol
 
user406009
6:06 PM
@rogcg Good luck.
 
hahaha
also I cant run this make on windows
 
Ell
use of deleted function ‘boost::signal<void()>::signal(const boost::signal<void()>&)’
that is a copy ctor right?
 
user142019
Yes.
 
user142019
I don’t like signals.
 
user142019
I prefer notifications. I implement them with ØMQ.
 
user406009
6:08 PM
@Ell Trying to map boost::signals to glib's signals?
 
Ell
@Lalaland yeah
I can't see where I'm copy constructing though >.<
does unordered_map need copy constructible or something?
 
@Zoidberg'-- Wish I had gotten rep from it. :(
 
user142019
@Rapptz you got a star at least. :P
 
user406009
@Ell Did you use emplace to insert the signal?
 
Ell
@Lalaland I use [] :P
std::get<1>(*userdat).signals[std::get<0>(*userdat)]();
 
6:10 PM
[] requires default constructible (for the mapped type).
 
Ell
where userdat is {Widget&, signal_name = std::string}
oh yes of course it does
do I have to use find instead?
or can I just not do it?
wait a second. boost::signal is default constructible isn't it?
 
user142019
Just use POSIX signals. :P
 
user406009
Yeah.
 
Ell
I don't want posix signals:L
 
user406009
@Ell If I was you I would start commenting out lines until you find where the copy ctr is being called.
 
user406009
6:14 PM
Brute force sometimes works.
 
user142019
@Ell of course not. If you want to use POSIX signals you’re a moron.
 
user142019
..
¬
 
Ell
ahh wait. yeah it's copy constructed at []
 
while trying to run gcc.mak to build boost regex, it says nothing to be done to gcc.mak. WTF??
 
Ell
because it's returned, isn't it?
wait not it's not: T& operator[] ahh
 
6:20 PM
any idea?
mkdir -p gcc/boost_regex-gcc-1_50
The syntax of the command is incorrect.
make: *** [gcc/boost_regex-gcc-1_50] Error 1
 
user406009
@Ell From a test sample on my computer, unordered_map requires move constructor.
 
user406009
Check if boost::signal has one.
 
user406009
God, the edit functionality is screwed up. Stupid daylight savings time.
 
Ell
it indeed appears to be [] that causes the error.
okay now I'm confused again!
okay so std::unordered_map<string, boost::signal<void()>> causes a compile error because signal is not copy constructible
 
@chris Yes, I do remember that. And I feel kinda silly now for not remembering that uniform initialization syntax solves the brevity problem. But you do need it to be at least one character longer than const std::vector<int> & = {}, need to name the parameter, otherwise it's not of much use ;)
 
user406009
6:32 PM
@Ell I have found the solution.
 
user406009
 
Ell
I use at()
 
.at() has bound checking and throws std::out_of_range error.
 
Ell
ahh yes find
 
user406009
@Ell 1. You need to use emplace to insert the element so as to avoid the copy. 2. boost::signal does not support move semantics so a wrapper unique_ptr is required. 3. If you are using gcc, it does not support emplace, so boost::unordede_map is required.
 
Ell
6:35 PM
wait I don't understand this - why does it need a wrapper?
it's default constructible so it should be able to be constructed in the map
I need to write a moveable signal wrapper class
@Lalaland how would I go abouts writing a wrapper around boost::signal to make it movable? without putting it into a unique_ptr?
 
user406009
@Ell Ah, nvm, you are right. Boost::unorded_map does the sane thing and requires no wrapper.
 
user406009
GCC's std::unordered_map is just a really lame implementation.
 
Ell
so it's GCCs fault? o.O
 
user406009
Seems that way.
 
Ell
it doesn't work with boost::unordered_map either
 
6:49 PM
What are you trying to compile?
 
user406009
@Ell this compiles for me ideone.com/85c4I3
 
Ell
`std::unordered_map<std::string, boost::signal<void()>> m;`
then do `m[];`
@Lalaland hmm. what compiler are you using?
 
user406009
gcc version 4.6.3 (Debian 4.6.3-1)
 
Doesn't compile on GCC 4.7.1
 
Ell
Ubuntu/Linaro 4.6.3-1ubuntu5
that's definately complaining about the copy ctor: use of deleted function ‘boost::signal<void()>::signal(const boost::signal<void()>&)’
but I don't understand where it is trying to copy
well I know it's doing it in [] but I'm not sure why
T& operator[]( const Key& key );
 
6:57 PM
@Ell how about showing the code instead of (just) the eror mesage?
 
Ell
I don't think the code will help, it's just 4 lines or so. But I will anyway, gimme a sec
@Cheersandhth.-Alf pastebin.com/FMCTTvgf
also I think it will try and delete twice, but that isn't the issue
 
user406009
@Ell try boost::unordered_map.
 
user406009
It seems to work on my computer with that implementation.
 
Ell
doesn't work on mine. When you are testing the compile, are you trying to access via []?
oops, I will try the emplace thing
 
well i can's see the copy construction
but i would use a pointer in the tuple, not a reference
 
Ell
7:04 PM
right kk. howcome?
 
user406009
Lol
 
user406009
I will be back to help you in a moment. Just need to spend some time brushing the dust off my psychic hat. — Lightness Races in Orbit 4 mins ago
 
user142019
Man.
 
user142019
My keyboard is so fucking nasty.
 
Ell
"error: ‘class std::unordered_map<std::basic_string<char>, boost::signal<void()> >’ has no member named ‘emplace’"
is it really just gcc's implementation? I'm almost entirely sure it's my fault
 
7:09 PM
@Ell it's gcc impl
emplace is not yet supported on associative containers
 
user142019
@Ell y u no use C++11.
 
Ell
darnn
 
user142019
Oh wait, it’s GCC’s crappy code formatter.
 
@bamboon Really?
Wow.
 
@R.MartinhoFernandes yeah
 
7:10 PM
23.2.4 Associative containers Partial Missing emplace members
 
user406009
It is supported on boost::unordered_map.
 
user142019
emplace is so awesome.
 
user406009
As always, boost provides what the library developers fail to complete.
 
0
A: Class is undefined

Cheers and hth. - Alfin your quest text you claim the error message is identifier "copyString" is undefined while in your graphic you claim the error message is Error: identifier "getStringLength" is undefined this is self-contradictory. either you have two error messages, contrary to the claim of one, or...

 
user142019
Boost is awesome because it’s not an ISO standard.
 
7:11 PM
^ Yay! I answered another nonsense question! :-)
 
Why don't they just take boost and slap it into the standard library
Save everyone the trouble.
 
Ell
hmm boost does seem to support it
 
just s/boost/std done.
 
user142019
@Cheersandhth.-Alf Det er ikke et svar!
 
@Zoidberg'-- it's the best the OP can get so far, helping him on his way towards better understanding of both the QA process, and the programming
 
user142019
7:13 PM
.-----------------.
|    FOOLVILLE    |
|                 |
| POPULATION:  OP |
|-----------------|
|                 |
|                 |
|                 |
 
or very tired
or a troll
who knows
 
That looks better suited as a comment, not an answer.
You're not answering anything..
 
@Rapptz what do you think can be answered in the sense of answering a question?
that is, what question do you see
 
Does it matter? That isn't an answer
 
@Rapptz so, does that matter, do you think?
maybe, i'm focusing on helping the person, while you seem to be focusing on SO "rules"?
 
7:17 PM
If you want to help the person by telling them they need to copy paste their code then it should be a comment
Funny enough, it already is a comment.
All the other answers are indefinitely more helpful than "why didn't you paste your code, OP?"
 
@Rapptz the paraphrase is very misleading
it seems argumentative
i think it's less helpful to not lead the OP towards copying and pasting code
i don't think anyone can really disagree with that
 
user142019
@Cheersandhth.-Alf +1 because I don’t give a fuck about the “answer should be comment” bullshit.
 
I'm not saying "it isn't helpful", I'm saying it isn't an answer. An answer is supposed to answer the question. A comment should be used for clarification and other things regarding the question itself.
 
i think, with the question itself self-contradictory and without the necessary details, any attempt at an answer must necessarily be pure guesswork, hypothesis
 
Xeo
Why the fuck are my youtube vids stopping at random points in the video...
 
user142019
7:24 PM
Terrible questions deserve terrible answers.
 
@Zoidberg'-- You have the weirdest primitive idea of karma there. Do you really think that works?
 
Xeo
Seriously, wtf is it with the videos...
 
user142019
@sehe Karma? I’m an atheist.
 
user142019
I might move to Flanders.
 
@Zoidberg'-- Or just abrasive today:
.@rasmus what were you smoking when you designed PHP?
 
user142019
7:38 PM
@sehe abrasive?
 
A less PC word for "abrasive" would be "asshole".
 
@Zoidberg'-- You can look it up
 
user142019
abrasive |əˈbreɪsɪv|
adjective
showing little concern for the feelings of others; harsh
 
user142019
Well, if Rasmus had feelings he wouldn’t have made PHP so crappy.
 
Right. Scientific fact. I forgot
 
7:40 PM
@Zoidberg'-- Rasmus was only going for popularity.
 
@CaptainGiraffe And he succeeded.
 
Emotional intelligence is that thing stupid people hang on to to avoid suicide, right?
 
@sehe I hate to say it but a whoosh is required here.
 
user142019
Mnesia is awesome.
 
(^ see, I can be abrasive too)
 
7:41 PM
@R.MartinhoFernandes I can't hang onto it. I fear I don't have any to begin with :) Serves me well
> Three longitudinal and six cross-sectional studies of medical students demonstrated a significant decrease in empathy during medical school…
 
@R.MartinhoFernandes Well, this escalated quickly.
 
@DeadMG ^ ever considered med school?
@CaptainGiraffe s/this/that/ for proper idiom?
 
@sehe Mea culpa.
 
Xeo
rage :|
 
> surgeons are near the top of the list of professions whose members frequently show psychopathic traits
I missed my vocation
@Xeo What? inb4 Defragment, raid rebuilding, lost backup?
 
7:44 PM
@Xeo Youtube is being fucking stupid for me too.
 
Xeo
20 mins ago, by Xeo
Why the fuck are my youtube vids stopping at random points in the video...
 
Yeah that's happening to me too.
 
Xeo
It pauses, and nothing happens if I hit the play button.
 
@Xeo Oh. That. Well. Windows? Link to sample that fails?
 
If I press it twice it plays again.
 
Xeo
7:45 PM
Unless I either reload the vid, change the resolution (forcing it to reload) or explicitly stop and resume the download.
 
@Rapptz It'll play again in three days. This is in support of the Romney campaign
 
Xeo
Some 2 minutes in was the first time for me
 
@sehe The mormons are different from the Amish?
 
Xeo
The play button changes from the pause sign to the play sign and nothing happens when I click it. :|
 
user142019
How do I convert a binary to a string in Erlang?
 
7:46 PM
@CaptainGiraffe Amish don't do internet
 
Xeo
15:03 again...
 
@sehe To me it seems the mormons do it very poorly too.
 
@CaptainGiraffe Ambiguity there :0
 
@sehe Yeah, I was curious who would do the smashing. I'm happy you let me have the honours.
 
@Xeo Decontextified.
 
7:48 PM
@Xeo No pause/blocks till 2'53'' yet
 
Xeo
@R.MartinhoFernandes Crap.
@sehe :|
 
@R.MartinhoFernandes "Decontextified" a new word for the new world. Thanks.
 
Xeo
Okay, I can atleast say that it's not adblock, since I just disabled that.
 
Jul 18 at 22:55, by sehe
No need to decontextify
 
@sehe Updated. CC attribution.
SA?
 
7:52 PM
@CaptainGiraffe OK by me (anyways, required on SO, IIRC)
I'm sure I didn't invent a word there
 
@sehe One rarely does, attribution though goes a long way. Rapptz get to google analyze these wordz. Rapptz go...
@Rapptz first known use 1977, we are moving quickly here.
 
I found a library while googling it on Github.
 
user142019
You know.
 
Did I mention I love Javascript?
 
user142019
7:56 PM
I might get a smartphone.
 
Welcome to 2005.
 
user142019
 
user142019
Only a different color.
 
@Zoidberg'-- 100% awesomeness
 
7:58 PM
Yeah I like the Lumia 920, looks cool.
 
user142019
Only problem is that it runs IE.
 
user142019
Maybe there’s Google Chrome for it or Firefox or Opera.
 

« first day (750 days earlier)      last day (4203 days later) »