« first day (573 days earlier)      last day (4372 days later) » 

12:03 PM
fuck, my neck hurts :(
 
Want a neck massage?
 
yes plix
 
Ok
 
Morning.
So we chatted in the C room for a while last night, got this: chat.stackoverflow.com/rooms/9614/conversation/…
I'm having trouble with my code though...
char* mycstring::mystrcopy(char *dest, const char *src){
        if(*src == 0){
                *dest = 0;
                return dest;
        }

        *dest = *src;
        return mystrcopy(src+1, dest+1)-1;
}
compiling this causes the following error:
 
Oh, hey, C has a room.
3
 
12:06 PM
mycstring.cpp: In member function ‘char* mycstring::mystrcopy(char*, const char*)’:
mycstring.cpp:12: error: invalid conversion from ‘const char*’ to ‘char*’
mycstring.cpp:12: error: initializing argument 1 of ‘char* mycstring::mystrcopy(char*, const char*)’
 
Don't compile C code as C++?
 
@Moshe just constify your formal arguments
 
@CatPlusPlus, Heh it's for class.
@CheersandhthAlf What do you mean?
Line 12 is the recursive return, btw.
 
i meant the result type
char const*
 
return type?
 
12:07 PM
What for?
 
Recursive strcpy?
 
You can't pass const char* as char*.
 
i meant, now I'm confused. that's the same mess as in std::strcpy
 
And can't strcpy be written in like 2 lines?
 
strcpy returns the destination.
 
12:08 PM
@CheersandhthAlf We're trying to rewrite some of the c string methods. For HW.
 
@Moshe src and dest are swapped...
 
Wait, is this correct? while(dest++ = src++); return dest;
 
@Pubby No.
 
@Pubby No.
 
12:09 PM
@Pubby No.
 
the loop seems ok
 
Can't assign to rvalues.
 
while (*dest++ = *src++);
 
it's not ok. i'm not awake
 
12:10 PM
But that's terrible ugly shortcut.
 
i nead coffee
 
Oh right. But doesn't it increment too far?
 
Heh
 
@Pubby I say it doesn't increment too far enough!
 
It increments just far enough to insert nul at the end.
 
12:11 PM
@Pubby It's okay to increment to one past the end.
 
Oh right, I got confused
 
Obviously if you want to return destination, you need to make a copy first.
 
was thinking \0 was one past :S
 
@CatPlusPlus No, it's pointing after the terminator.
It's post-increment.
 
Okay, you're right and I suck.
6
 
12:13 PM
Is there any benefit in having std::strcpy return the start of string?
 
@RMartinhoFernandes Good call, thanks!
 
End of string is so much nicer more useful
 
@Pubby Mimics assignment operator (why do you think dest comes first?).
 
C strings are so ugly, it doesn't really matter.
Returning end might make repeated calls better.
 
The only one I still have to do is the string compare function...
 
12:14 PM
@RMartinhoFernandes But strings make more sense to be streamed
 
Ooh, I remember!
 
@Pubby Don't look at me, I wasn't the one that picked mimicking = as a design goal.
 
12:28 PM
@RMartinhoFernandes I mimick your mother!
 
If you mimic a mimic, what are you mimicking?
 
@CatPlusPlus My awesomeness.
 
what was the name of that white noise site @sbi posted a while ago?
found it :D
 
12:47 PM
If I want noise I'll just eat a bag of crisps.
 
first time I've given it a go
 
Like I'm doing right now. :D
Go eat a bag of crisps.
@ScottW You merican!
Chips are fried potato sticks.
Frietjes!
 
@ScottW freedom fries
 
I've heard they fry chicken at the KFC. 3:
I'm afryed.
 
12:55 PM
why does this not work:
 
@ScottW Ever tried a kapsalon?
 
char *aCString = "hello";
cout << aCString;
That causes a Bus error.
 
@ScottW It's fries with döner and molten cheese.
@Moshe make it a const char* in the first place.
Also: complete code. It should work.
@ScottW it is.
But it fills like hell.
 
@classdaknok_t Can't use const, manipulating the strings.
Well, here's the code.
 
@Moshe you cannot manipulate a string literal.
 
12:56 PM
I've written a string library.
 
It's undefined behavior.
 
And a driver for it.
@classdaknok_t Hrm...
 
Copy the string literal if you want to modify it, or put it in a char array. char aCString[] = "hello";
 
char *aCString is the same thing as char aCString.
An array, for my purposes is simply a pointer to the first character.
 
no, not the same
 
12:58 PM
Ok, not the same.
Here's my C string implementation class:
 
char aCString is not an array
just a single char
 
@TonyTheLion with a * it's an array
 
@Moshe no, with a * it's a pointer.
With a [] or [N] it's an array.
 
@Moshe it's a pointer to the first element of an array, an array is this char[] arr
 
Arrays can decay to pointers to their first elements.
 
1:00 PM
yes, but that does not imply that they are the same
they are not the same
 
Ok, fair enough, irrelevant for now.
 
First of all, char foo[] = "barbazqux"; then sizeof(foo) == 10, while with char* foo = "barbazqux";, sizeof(foo) == sizeof(char*).
 
indeed
 
Well, what's the dealio with my driver?
 
But anyway, you were modifying a string literal. You cannot do that.
No, he cannot either.
Mighty?
 
1:03 PM
strcpy already exists
@Moshe why are you reinventing the wheel?
 
> Whether all string literals are distinct (that is, are stored in nonoverlapping objects) is implementation- defined. The effect of attempting to modify a string literal is undefined.
2.14.5 String literals [lex.string] clause 12.
@TonyTheLion std::copy already exists FTFY.
 
@TonyTheLion HW
 
@Moshe Does it work when you don't use it with a string literal?
 
@classdaknok_t Example? I'm not sure what you mean.
 
1:07 PM
Well, use char foo[] = "hello"; instead of char* foo = "hello";.
 
anyways, seems airport wifi sucks
 
Also, char *hello = 'Hello'; declares a pointer and assigns it an int.
 
@classdaknok_t Fixed that already, thanks.
 
Well, let's see now...
 
1:08 PM
@TonyTheLion 'Hello' is an int.
 
explain?
 
@TonyTheLion character literals containing multiple characters are ints, as per the standard.
typeid('a') == typeid(char) && typeid('aa') == typeid(int)
 
woah
why is that exactly?
 
@TonyTheLion Because a char isn't wide enough to hold multiple bytes.
An int is.
 
@classdaknokt Thanks, it works!
 
1:10 PM
:)
 
@classdaknok_t but unless a char like "a" is a UNICODE char, then it's only one byte, no?
 
@TonyTheLion yep.
@TonyTheLion Wait I'll look it up in the standard.
 
right, and "aa" would be an array of bytes, IMHO
 
> A character literal is one or more characters enclosed in single quotes, as in ’x’, optionally preceded by one of the letters u, U, or L, as in u’y’, U’z’, or L’x’, respectively. A character literal that does not begin with u, U, or L is an ordinary character literal, also referred to as a narrow-character literal. An ordinary character literal that contains a single c-char has type char, with value equal to the numerical value of the
> encoding of the c-char in the execution character set. An ordinary character literal that contains more than one c-char is a multicharacter literal. A multicharacter literal has type int and implementation-defined value.
 
oh interesting
I learned something :)
 
1:13 PM
Me too! I didn't know the value was implementation-defined.
Any decent compiler spits out a warning when using multibyte character literals without an L prefix, though.
 
WIFI y u so slow?
 
0
Q: What libraries do I need to explicity load on a windows platform which cover unix "ws2_32" and "win32" libraries

GraemeI'm currently porting a piece of JNI to a Windows machine. I've managed to get the code compiling on a windows system and giving me a dll. Unfortunately for me my knowledge of C is more theoretical than it is practical. In my unix system I load the libraries as so: System.loadLibrary("win...

If anyone want's points
 
Try 3G.
 
ugh, 3G is expensive
 
0
A: How can I get around specifying variables in decltype expressions?

Cheers and hth. - AlfIt seems to be a made up (construed, artificial) question, since If you get the lambda from somewhere else, then it's named and no problem binding this. If you're not getting the lambda from somewhere else, then you know the result type. In short, as the problem is currently stated (as I'm wr...

^ Yet another answer that the OP will probably not like very much.
 
1:19 PM
@Graeme Note, however, that showing up just to dump a link to your question and not to participate in discussions (called drive-by linking) is frowned upon. (In fact, regulars might be offended enough to actually downvote the question just to discourage you from doing that again.)Newbie hints.
 
I'm awayting the mooroon's rage...
 
An exception may be if the question is extremely interesting.
 
@classdaknok_t I think I'm a regular. If the others are offended, let them speak for themselves. Speaking on behalf of others (in particular, telling me that I will be offended by me) is stoopid.
 
@classdaknok_t no exceptions
 
@classdaknokt It's the same issue I was talking about for half an hour if you want to scroll up a bit :)
 
1:20 PM
@CheersandhthAlf I didn't write the newbie hints.
 
@classdaknok_t You fucking quoted them.
 
Some people in this room are dicks :P
 
@CheersandhthAlf I don't think I'm following here?
he just quoted the newbie hints, I don't see how you being offended comes into the picture?
 
I was just waiting for the rage of social gaming usually following a technical correct but not expected answer, and then I get the gaming here in the lounge. I am offended. Deeeply.
 
1:22 PM
sorry, I'm not following
 
@TonyTheLion QFT.
 
QFT?
Quit Fucking ??????
 
Lemme state for all (it will not be once), I am not interested in stoopid dominance games. Anyone wanting that, GFY
 
@TonyTheLion Quoted for truth.
 
meh
lol
anyhow, I'll let you get on with your ramblings
 
1:26 PM
Besides, i am not clever today
 
Doesn't SO have some sort of rules regarding downvoting question because "you want to punish someone in hopes of correcting behaviour that you as an individual have decided needs correcting"?
 
@Graeme Nope. You don't even have to give a reason. The site's management thoroughly rejects the idea of forcing people to give a reason, let alone a sane reason, for downvotes.
however, downvoting drive-by linkers is what was suggested to us by a mod, so I doubt they're gonna care
they also suggested flagging the link, but I stopped doing that
 
Seems a little bit like you're missing out on something in the world away from computers if that's how you satisfy your urge to feel like a big man.
 
actually, I'm currently trying to be a smaller man
 
The fact that it wasn't a drive by link puts a hole in the ethical high ground :P
 
1:30 PM
1. I've never seen you before. 2. Your question has nothing, at all, to do with C++. 3. None of the other chatters indicated that it was, in fact, not a drive-by. Therefore, the only logical conclusion is that it's a drive-by.
 
huh, wasn't @graeme here yesterday?
 
not that I saw
in any case, a single downvote is hardly the end of the world
 
I'm in here fairly irregularly to be fair - but was literally only talking about this same problem about 2 hours ago.
I'm just a bit taken aback by how massively hostile it is in here
It's not like a logged in and called your mum a whore :P
 
I actually wouldn't care if you did in the slightest
it's pretty rare that anyone else can keep up with my graphic descriptions of their mother's negative qualities anyway
 
@DeadMG You SOB! :-)
 
1:38 PM
@CheersandhthAlf What? It's true- I'm simply the most creative and excellent person in the chat.
 
@DeadMG sry, lame pun (you a dog and all that)
 
woof woof
 
1:59 PM
oh... another dog
 
@Graeme You just can't take people seriously here. We're constantly teasing each other and joking.
> It was difficult, but I was finally able to fap to this. — from popsci.com/technology/article/2012-05/… (somewhat NSFW, high chance of wanting several minutes of your life back once you watch it)
 
2:19 PM
@Graeme l agree.. it is quite hostile... its really too bad because it discourages involvement
 
@Scottymac if you can't beat 'em, join 'em
 
@RMartinhoFernandes The problem with saying "this is just the way we talk to each other" is that new people are not aware of this... and the negative banter, downvoting commnets etc.. can be quite off putting.... its hard to "read" tone/intent of text message ... almost need markup tags <voice style=sarcasm> comment....</voice>
 
Rewrote the question once I found the answer BTW:
0
A: JNI - How to find missing libraries when confronted with "[lib].dll: Can't find dependent libraries"

GraemeI didn't know this but you can use a program called DEPENDS.exe to discover the dll's which are used by the target. In my case this highlighted the only dll not already registered, meaning I could simply add it to the %PATH% in order to get my program running.

 
I have found that approaching people on the Internet without assuming malice first works better (probably works well IRL as well, but I don't have much experience there). Yes, it's hard to read tone in written text. So don't do it.
 
@SethCarnegie when i first joined tried to answer a question.. I was immediately downvoted (for an opinion), and was then asked to join the chat room so people could explain why i was downvoted... but people downvoted met to the point that I could not participate in the chat room.... that was a hostile intro to C++ Lounge
 
2:27 PM
@Scottymac well you're here now
 
@Scottymac It's a rite of passage!
(That was a joke, btw)
 
@SethCarnegie mostly as an observer...
@RMartinhoFernandes cheers
 
<voice style="joke">You're sure doing a lot of talking for an observer</voice>
 
@SethCarnegie *gag reel*
 
2:31 PM
@Scottymac FWIW, we have requested before to be given the ability to allow specific people to chat regardless of reputation (that would be simpler than trying to control a mob of disgruntled C++ pedants), but that was not implemented. :(
 
@Scottymac Unfortunately, we don't control that effect.
 
Why not make the room a Gallery
 
That would work the opposite.
 
We are not art
 
then only us sexy room owners (so all of us except the robot) would be able to chat
 
2:33 PM
I'm not sure if I should resent that.
Robots are not made for sexy, they're made for functional.
 
Nope - Gallery allows anyone to be given write access by the room owners
 
@Graeme Gallery requires the owners to manually approve each and every other user.
 
@RMartinhoFernandes cool... i guess the take-away... is be restrained when downvoting newbies..
 
Yup
 
As is, anyone with 20 rep can talk.
I think that's better than "anyone with 20 rep that requested permission and was given so by the owners"
 
2:36 PM
Which requires enough room owners to deal with it, which means regulars eventually become room owners and mean room owners have responsibilities to go with the power.
simples
... fricking annoying to have a pop up every other minute says "<blah blah> want's write access", but still, works as long as room owners are happy to share responsibility of the room.
 
oh sweet lord... if you think you have problems working with words styles, I give you...
 
But we already have the same responsibility, except without popups.
 
> Heading 4,h4,H4,E4,Map Title,Heading Four,Req,Heading 4.,H4-Heading4,l4+toc4,heading 4,Numbered List,4,H4-Heading 4,a.,Heading4,ph,h41,H41,H42,h42,H43,h43,H411,h411,H421,h421,H44,h44,H412,h412,H‌​422,h422,H431,h431,H45,h45,H413,h413,H423,h423,H432,h432
what the hell is going on?
 
@thecoshman What is that?
 
Oh... thought you suggested you didn't have the ability to allow specific people to chat
 
2:39 PM
@RMartinhoFernandes one the heading styles to be used in this document I need to work on
all sense of normality is gone
 
@Graeme The problem I mentioned is that no one with less than 20 rep can chat.
We can't give those people access even if we want to. It's part of the system.
All the others already have it.
 
Why would you want people with under 20 rep to chat?
 
14 mins ago, by Scottymac
@SethCarnegie when i first joined tried to answer a question.. I was immediately downvoted (for an opinion), and was then asked to join the chat room so people could explain why i was downvoted... but people downvoted met to the point that I could not participate in the chat room.... that was a hostile intro to C++ Lounge
 
@Graeme We do- in the case that the room is a gallery. We can do nothing about the 20 rep minimum, though
 
@Graeme because we don't get enough stupid questions clearly
 
2:41 PM
"Accidents" happen :)
 
@RMartinhoFernandes i understand... but it all happened within the first 10 mins of me singing on... it was a rather rude welcome.... water under the bridge now....
but i'm still hesitant to answer questions...
 
dang
still can't get my fourth component to work out
 
@thecoshman I'm not saying they should be allowed by default. I just think it would be useful if owners could allow it on a case-by-case basis (like for clarifying downvotes when chat is more appropriate for doing so than comments).
 
@Scottymac Honestly, answering questions is a no-lose situation in the general case. It's +10 for an upvote, -2 for a downvote.
and when you have more rep, it would take so many downvotes to make a serious dent that it's laughable and you could post "Fuck you" for 100 answers and still be left with most of it
 
@Scottymac and if you delete it you recover all the rep you lost anyway
 
2:44 PM
Is it legal to make specialisations for things in the standard namespace (like begin) as long as you don't specialise them for things in the standard namespace?
 
I would know, I've been known to post "Fuck you" as an answer on occassion
 
@SethCarnegie it's legal for user defined types
 
@DeadMG Doing that would probably get you a ban due to flags.
 
Ok thanks
 
true
 
2:45 PM
@RMartinhoFernandes I am sure that there are a few valid cases for wanting a under 20 rep people in a room, but I doubt it is enough to warrant the effort
 
@awoodland didn't know that... thx
 
@thecoshman I think there is little effort. The UI is already in place: it's the same we can use to grant gallery access: in fact it reads "Even when this room is read-only or their reputation is too low, these users will be able to talk in this room.", but it just doesn't quite work as advertised.
Go figure.
@DeadMG lol
 
@RMartinhoFernandes What, does it surprise you that I would post that? :P
 
@DeadMG No, it doesn't surprise me, but I find it funny for some reason I won't bother probing.
 
2:49 PM
can anyone make more sense of the comments on: stackoverflow.com/questions/10552255/… - I thought he was asking how to distinguish between enum and non-enum, but the comments imply he's asking for two overloads and a template which contradicts what the question says..
 
@RMartinhoFernandes huh, lazy devs :P
 
user image
7
For the benefit of "mortals" and "mortals" behind stupid proxies.
 
Silly corpnet blocking dropbox. /qq
 
@SamDeHaan Better?
 
2:53 PM
@RMartinhoFernandes hehee... as a Linux developer I am blissfully unaffected by MS issues...
often find myself saying similar comments anyway
 
@Scottymac Yeah, the POSIX API is even worse.
I mean, what the fuck does stat do?
 
Gives you file information.
 
@Scottymac as in you develop only targeting linux, or you actively work on linux kernel?
 
having to ask the question is a bad sign
 
Linux is the OS on the cluster I write applications for...
 
2:55 PM
it should be named GetFileInformation or get_file_information or someshit like that
 
don't contribute to the kernel !
 
@DeadMG Oh, I didn't read the "Yeah, the POSIX API is even worse." part and thought you were asking a real question, for some reason.
 
@RMartinhoFernandes As if I'd ever lower myself to having to work on Linux ^^
 
@Scottymac Anyway, if you feel you can contribute, do so. Posting good answers is nice, but posting bad answers can also work for good as you (hopefully) end up learning something.
 
@Scottymac <enter pedantic mode> oh, what kernel does your Linux OS use?
 
2:57 PM
we run a ROCKS cluster.. so centos
 
aaargh
damn fourth component
 
@RMartinhoFernandes totally... I find a LOT of answers on SO... and would certainly love to contribute... but most of the people in this room have lightning fast responses !!
 
Yeah, that can be a problem :)
 
@DeadMG at least it doesn't have 20 gazillion options I have to pass NULL into because I don't care about them
 
@Scottymac The real problem with competing with me for answers is that my answers always demonstrate a keen insight into the problem and an excellent grasp of language fundamentals, as the image above demonstrated.
 
2:59 PM
lol
 

« first day (573 days earlier)      last day (4372 days later) »