« first day (941 days earlier)      last day (4013 days later) » 

8:00 PM
0
Q: <built-in>:1:2: warning: use of C++0x long long integer constant [-Wlong-long]

wilxWhat is this warning about? It seems to be warning about long long constants in built ins. This is from GCC version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1). In file included from ../include/log4cplus/helpers/stringhelper.h:36:0, from ../tests/performance_test/main.cxx:6: <built-in>...

Any ideas?
 
These dogs greet me like I'm the awesomest person in the world.
 
@StackedCrooked well, that's dogs for you. Cats are much more honest.
 
@AnkurSharma take those values and save them to "img.bmp". DONE!
 
I don't think the dogs are being dishonest.
 
Dogs are dumb.
 
8:01 PM
@wilx Oh yes.
 
people are dumb too
 
@hyde So?
 
Dogs are intelligent. They can form a team with humans. For police work etc.
 
Dogs were engineered by humans to be a slave race.
 
Xeo
@StackedCrooked Glad you think so. :)
 
8:02 PM
Of course they form a team with humans. They need us.
 
Yeah, dogs are more intelligent, cats are so one dimensional always defensive.
Much more interaction with dogs
 
@ScottW that's a good bitch.
 
wtf...where are my posts? u deleted them?
 
yes
 
@AnkurSharma yeah, they sucked
 
8:04 PM
@AnkurSharma You did not read our rules, it seems.
 
@ScottW here's a sausage
 
what are your rules - to talk about dogs and suasage and shit and not about programming???
13
 
yes
 
@AnkurSharma yes, if you read the rules you would've known this
 
@AnkurSharma this is a good time to chill for a while,this is a great room try not to rage now.
 
8:07 PM
@AnkurSharma just read the newbie hints, and heed them. I don't think there's nothing personal going on here, this room is just not what you thought it is, so you got the reception you got (messages deleted).
 
@DeadMG might have been a bit aggressive in his binning, but still.
 
Xeo
He's a tiny puppy, of course he's acting all aggressive and mighty.
 
no
 
@Xeo Compensating for something, hmm?
 
He is the binmaster, not for us to try to understand.
 
8:09 PM
not for foo's like you
 
room topic changed to Lounge<C++>: Well doesn't it suck, just to know I'm right? [c++] [c++11] [emoticons] [no-helpdesk]
 
Thanks- what a great room .
 
Indeed it is
 
no problem
any time
 
8:10 PM
@AnkurSharma Also, careful there: you sound like you think we owe you something.
 
local types! I require local types.
actually
I'm not sure that is required.
 
Xeo
For lambdas?
 
no.
Wide has a kind of semi-ADL thing going on and I think that I can use that to get what I am looking for
 
Xeo
Where do you put the lambda types? At namespace scope?
 
although I need to extend it to check both arguments
@Xeo In the Wide compiler, they don't have to go anywhere.
 
Xeo
8:18 PM
hm
 
but lexically, their parent is the parent of the function they come from.
 
@DeadMG main.lambda153641as3d0a40we46qw5e0501a65sd4() ?
 
Xeo
So you have a type floating the ether, basically?
 
yes
 
8:21 PM
@MooingDuck hi! how are you doing?
 
user142019
Hello motherfuckers.
 
wtf where is my shift key u deleted it?
 
user142019
3D printers look funny.
 
room topic changed to Lounge<C++>: Well doesn't it suck, just to know I'm right? PS learn to type "you" [c++] [c++11] [emoticons] [no-helpdesk]
 
Late answer to high-traffic question:
0
A: Check if a string contains a string in C++

nonemanwill#include <string>//std::string #include <string.h>//strlen #include <iostream>//std::cout, std::endl //Searches a string for string in var 'me', returns the starting position of //the found string +1 if successfull. //On failure it returns 0. unsigned int str_find(const char*str, const char* me,...

Keep it or nuke it?
 
user142019
8:31 PM
Nuke it.
 
user142019
The code example is fucking terrible.
 
user142019
Xor wat.
 
@CatPlusPlus Silly Cat.
 
hehe
 
user142019
const char* wat
 
8:32 PM
> Note i'm just showing an implementation(don't replace std::string::find), it's sad to direct apprentices to an immediate answer.
 
@rightfold in the butt?
 
So let me post you this horrible abomination of the code with no explanation at all!
 
user142019
unsigned int wat
 
user142019
strlen wat
 
user142019
Even recursion with ^regex would be better than this.
 
8:33 PM
strlen your mom
 
@Mysticial the xor \0 is cute. I say keep it.
 
user142019
I have no idea what the hell he means by those xors.
 
user142019
Some retarded "optimization"?
 
x ^ 0 = x
 
user142019
Because compilers are even more retarded than the author of the code?
 
8:35 PM
@DeadMG Thats the cute part
 
user142019
-1 This code is so bad and hopeless that I don't even wanna talk about it. — rightfold 9 secs ago
 
user142019
inb4 diamond mod comes in and deletes comment.
 
@ScottW if ( x ^=x ) cout<<"How about a nice game of tic tac toe?"<<endl; }
 
why, using xor like that for equality testing seems brilliant, genius.
std::string needs to overload ^ too, clearly
 
user142019
@hyde No, it's absolutely fucking retarded.
 
user142019
8:39 PM
Only an idiot would do it.
 
Xeo
Psst: Sarcasm
 
user142019
@Xeo Psst: Internet
 
@rightfold You're bad and you have no excuse
 
@rightfold You can find the </sarcasm> tag if you view source.
@rightfold We tried to do double sarcasm tags in the late 80's. That was maybe the basic science. Is it working now?
 
I'd think suggesting xor for string is a good enough hint
though now I actually want one. Requirement: it has to make sense, and follow the logic of doing it twice will restore original string.
 
8:42 PM
@ScottW Unsatisfiable
 
The xor swap is a nice idea, the xor double linked list pointer is elegant, most other stuff is just plain stupid.
 
user142019
I can hear music coming out of my printer. I think the paper's jammin' again.
 
XOR swap is dumb and pretty much useless
 
> dat pun
 
@CaptainGiraffe XOR swap is a dumb and bad idea.
 
8:43 PM
@hyde See: XOR "encryption"
 
also, wtf xor double linked list pointer?
 
@DeadMG Why dumb? Bad yes, dumb no.
 
user142019
@DeadMG Saves space.
 
@rightfold No, it doesn't.
if you look at the assembly result, it also has to use temporary registers.
 
@AnkurSharma oh this guy is sharp
 
8:44 PM
the only difference between XOR swap and regular swap is that in regular swap, you can see this temporary clearly, whereas in XOR swap the compiler has to generate far more of them
 
Can you not ping people that should be gone forever
I know it's hard to not click shit but do try
 
@DeadMG Look at a stupid machine please. The Knuth machine is a very good machine for us too look at. Everything else should be handled by compilers
 
@CaptainGiraffe What?
 
I also could not understand what the fuck
 
Xeo
@thecoshman also waiting for the next UHC episode?
 
user142019
8:46 PM
Arrays ftw.
 
arguing registers for an xor swap is futile.
 
@Xeo is that tonight? I am now :P
 
user142019
@Xeo Utrecht Haskell Compiler?
 
Xeo
@thecoshman Should be, right?
The last one was Sunday
 
@rightfold shut up newb :P
 
8:47 PM
Compiler is free to implement swap however it wants
But using XOR swap directly means you're an idiot
 
@CaptainGiraffe Yeah, cause it's no better than a regular swap for registers.
 
@CatPlusPlus well yeah, but xor cipher expects same length of plaintext and key, doesn't it?
 
@Xeo I have no idea, even people who say their schedules I fail to know what to expect when :P
@DeadMG nice aim
 
quiet you
 
@hyde No that is OTP one time pad
 
8:47 PM
@hyde Repeat the key until it matches the length of plaintext/ciphertext
 
@DeadMG yes of bloody course
 
Or derive it somehow I guess
It's a dumb algorithm that's not very useful so who cares
 
@CaptainGiraffe Then on what basis are you arguing that it is not a very dumb idea?
 
@DeadMG doubly linked lists
 
what the fuck do they have to do with XOR swaps
 
user142019
8:49 PM
For some reason I believe some people here no matter what they say because they're better programmers than I am.
 
@DeadMG Almost everything
 
user142019
And I shouldn't do that. It's bad.
 
Ell
You know what a dumb idea is - posting a screenshot of your java ide where your font is comic sans
 
One pointer for prev and next?
 
Ell
why do that to people, it's just plain wrong :/
 
8:49 PM
@rightfold fool. Don't blindly trust any single source, ever
 
I can swap two integers by generating a program that sends itself to a remote server where it creates two temporary files writes integers to them moves them around a bit and then generates another program that sends itself back and outputs swapped integers on the original machine!
This is brilliant!
 
user142019
@Ell posting screenshots is bad anyway.
 
@CaptainGiraffe So you're ~saving space~ by cutting usable address space in half?
Yeah I can see how is that a good idea
 
@CatPlusPlus Please don't Cat.
 
Hmm, I guess for string ^, the shorter operand would have to be 0-padded to get equal lengths, to have all A^B==B^A, A^B^B==A and B^A^A=B hold. Assuming 0-terminated string, of course.
 
user142019
8:51 PM
Use == and don't be a retard.
 
Terminator is an implementation detail and shouldn't participate
 
@CaptainGiraffe Show code.
 
user142019
== means equals to. ^ means bitwise xor. Your intention is equals to, not bitwise xor.
 
@xeo you seen GB's terawhatchamagigacraft series?
 
@CaptainGiraffe Please don't what, call dumb ideas out?
@rightfold Reminds me of that shitty "should I use * or << to multiply"
 
Xeo
8:52 PM
@thecoshman Part of the first episode
 
Or maybe it was division
 
Xeo
Looked kinda cool, but don't have the time to follow it
 
To @DeadMG and @CatPlusPlus I'm showing one pointer in a bidirectional linked list.
 
Division
 
user142019
@CatPlusPlus or this LOL
 
8:53 PM
201
A: Which is better option to use for dividing an integer number by 2?

Cat Plus PlusDoes the first one look like dividing? No. If you want to divide, use x / 2. Compiler can optimise it to use bit-shift if possible (it's called strength reduction), which makes it a useless micro-optimisation if you do it on your own.

 
@Xeo I like the mod idea, but I'll just stick to FTB... would be cool to start from such basic stuff and take it all the way up to fusion magik :P
 
struct Magic { int data; Magic * bidi; };
 
forst link is 0 0 ^ bid is next
 
But in English please
 
user142019
8:55 PM
@CaptainGiraffe ads sdsa das ggew 423 ewr 664x 4 6 && cc vx yteter is next
 
Also congrats you saved a word on a list node, and complicated the implementation to the point where nobody will ever want to maintain it
 
@CatPlusPlus no
 
@CatPlusPlus Yes that xor is an extremely complex operation.
 
This shit is something for deep compiler internals, not something you should use directly
Not that it's an optimisation compilers would do
 
If we look at std::list we find similar shit
 
Xeo
8:58 PM
@CaptainGiraffe Erm what
 
@Xeo What what? I'm full here
@Xeo Oh, 0 ^ bidi
 
user1182183
probbly easy for you guys but I can't seem to figure it out... I have class a, and class b within class a, how do I access a variable in class a from class b ?
 
I'm not compiling shit as I type.
 
Xeo
That doesn't make any sense
 
I thought you guys would be more ?responsive? to this
 
9:01 PM
@CaptainGiraffe What?
Let's see
 
user142019
@CaptainGiraffe no of course not.
 
Dinkumware: nope
libstdcxx: nope
I bet libc++ doesn't do shit like this either
 
user142019
It doesn't.
 
It's not an useful optimisation, and it complicates the implementation significantly
And if you're going to reply "XOR is easy hurr blurff" then just don't
There is a thing called being too clever
 
Yes agrred not a useful optmisation
 
9:03 PM
I have never seen this before
all you've said is 0 ^ bidi as your argument
 
user142019
Linked lists are boring.
 
and secondly
I don't see what compressing two pointers into one has to do with the XOR swap
 
@ThePet You need an instance?
 
user142019
@ThePet void b::foo() { a x; x.that_variable; }
 
Xeo
Uhm, guys, maybe I'm just being crazy and forgetting something but... 0 ^ x is just x, no?
 
9:04 PM
Yes
 
user142019
No
 
user142019
It depends on the type of x and how ^ is overloaded.
 
user142019
:trollface:
 
Oh shut up
 
Xeo
So wtf is @CaptainGiraffe smoking?
 
user142019
9:06 PM
This reminds me of my teacher saying you should use & and | in Java for Booleans since they're faster or something like that.
 
I said The xor swap is a nice idea, the xor double linked list pointer is elegant, most other stuff is just plain stupid.
 
user142019
It's not elegant.
 
user142019
It's a big ugly hack.
 
Xeo
The "xor double link" isn't elegant, it's plain not working unless I'm forgetting / missing something
 
user142019
9:08 PM
Walter Bright said something that is quite applicable here.
 
@rightfold "Your XOR tricks are not clever"?
 
user142019
Planes look good not because they're designed to look good but because they're designed to fly well and as a result they look good.
 
user142019
And the same happens with code.
 
user142019
If you write code that's maintainable and well-designed, it looks good.
 
@rightfold That is one of the most stupid remarks I've ever heard.
 
user142019
9:10 PM
Maintainability is neat.
 
@CaptainGiraffe The XOR swap is a dumb idea
 
user142019
@CaptainGiraffe I once heard one about xor double linked lists being elegant.
 
and can someone explain to me how this xor double linked list pointer actually works?
 
@Xeo xor double linked list is probably UB in C/C++, but it certainly works in practice (use assembly if you don't want to write non-standard C), and is fairly clever too. But drawbacks outweight the benefits, like, always.
 
Xeo
Yes, please.
 
9:11 PM
@rightfold Well tell me a snippet you consider elegant.
 
Xeo
Because so far Captain only said 0 ^ some_ptr which is just some_ptr
 
user142019
@DeadMG struct node { T value; node* ptr; } if you xor ptr with address of previous node you get pointer to next node and vice versa.
 
So you still have to keep two pointers in the iterator
Well that's an improvement
 
@CatPlusPlus no not relly
Why does @hyde +1 need to ,tel you this?
 
Xeo
9:14 PM
> While traversing the list you need to remember the address of the previously accessed node in order to calculate the next node's address.
 
This is compact and elegant by most definnitionns
 
> To start traversing the list in either direction from some point, you need the address of two consecutive items, not just one.
It's not fucking elegant jesus fuck
 
user142019
@CaptainGiraffe T tmp = a; a = b; b = tmp;
 
user142019
Imagine newlines.
 
I'd call it a hack. Which does not rule out it being elegant as well
 
9:14 PM
Ugh
 
This form of linked list may be inadvisable:
    General-purpose debugging tools cannot follow the XOR chain, making debugging more difficult; [1]
    The price for the decrease in memory usage is an increase in code complexity, making maintenance more expensive;
    Most garbage collection schemes do not work with data structures that do not contain literal pointers;
    XOR of pointers is not defined in some contexts (e.g., the C language), although many languages provide some kind of type conversion between pointers and integers;
 
So big fucking please
 
Elegant my ass
 
show me anything elegant in 10 lines or less
 
9:15 PM
What
What the fuck are you on about
 
No not the square root approximaation
 
@rightfold And std::move.
 
@Mysticial Time to vote to delete, IMO.
 
@user1690130 hi. I don't hang out in the lounge much anymore since people at my work got suspicious that I wasn't working enough.
 
user142019
@DeadMG Imagine C#. :')
 
Xeo
9:16 PM
Also, please tell me how an iterator does not need to keep two pointers around now.
 
@DeadMG didnt we agree on something not compiler bound the last hour?
 
You're trying to sell a data structure which lists more drawbacks than advantages as elegant, and now you're falling back to "show me something elegant" which is completely unrelated and has no context and WHAT THE FUCK
 
I'm not trying to sell a data structure. The this id prev + next is elegant
 
user142019
No it's absolutely terrible.
 
user142019
The idea is bad and confusing and the implementation is complex.
 
9:19 PM
You know what, I don't care
You're not even bothering to speak English
 
user142019
It's a hack to save one pointer in every node.
 
user142019
And you still need those pointers while iterating.
 
@CatPlusPlus I apologise it is my third language
 
user142019
So you only save memory when you never iterate the list, IOW making it completely pointless since it doesn't provide random access either.
 
user142019
And how often do you iterate a list both forward and backward.
 
9:21 PM
PLEASE I'm not advocating this as an actual structure. The pointer solution Is in my opinion elegant
 
@rightfold wut are you talking about saving memory only if not iterating? if you have a million elements, you save for example 4 megabytes, while your iterator takes 4 bytes extra.
 
user142019
Oh right whoops.
 
@CaptainGiraffe What
 
@ScottW Sure #define elegant PICASSO
 
user142019
Either you act normal and tell us what you actually mean or you STFU and GTFO.
 
user142019
9:23 PM
Also, please go implement a XOR doubly linked list in Piet and tell us how elegant it is.
 
@hyde Or I could save vastly more than that by unrolling the list.
 
user142019
Oh I see now I have homework for tomorrow.
 
@DeadMG by "unrolling list", do you mean turning it into an array list, or what?
 
user142019
Some Android shit.
 
user142019
@hyde or a list of arrays.
 
user142019
9:26 PM
Why?
 
user142019
HAHHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHAH‌​AHAHAHAHHAHAHAHAHAHAHAHAHHAHAHAHAHAHAHA
 
user142019
We must buy a book about Git for school.
 
user142019
Ain't gonna happen.
 
user142019
But hey, at least we'll use version control this time.
 
user142019
Please make me into a corpse.
 
user142019
9:29 PM
U an stukk akuve abd tyoubg,
 
user142019
I meant, "I am still alive and typing."
 
> and incidentally I have come to decide that "EA" is an abbreviation of "EAARGH"
 
user142019
@MooingDuck lol
 
user142019
9:41 PM
This seems like a horrible optimization LOL.
 
does gcc -D require a space, is it -D FOO or does -DFOO work?
 
user142019
The latter works for sure.
 
@thecoshman Only -DFOO works
 
Xeo
Without space is what I normally see
 
interesting response, but I like cat's most :D
 
user142019
9:52 PM
What about -I?
 
user142019
In clang it works with and without a space.
 
that works with a space, not sure if you have to use a space though
 
user142019
I always use a space after -I.
 
@MooingDuck oh no worries! I am hardly ever here anyways :) I just wanted to say hello and see how you were doing. I also wanted to thank you so much for your help this past winter. I have made such tremendous progress with my programs!! I've actually been able to write several scripts now!
salut @EtiennedeMartel
 
Xeo
Meh, UHC will have to wait till tomorrow it seems. Not up yet, and I want to head to sleep. :|
 
9:54 PM
@user1690130 excellent! good work
 
yeah, my build system seems to be coming along nicely. Though I now need to sort out glload to continue testing it :P
 
@user1690130 On se connaît?
 
@Xeo same here :(
 
@MooingDuck thanks. i know i was frustrating to deal with. i really appreciate your patience
@EtiennedeMartel pas exactement. nous nous parlions cette fevrier un peu.
 
hay, less croaking
 
9:55 PM
@user1690130 I wrote a tutorial for our product in a language I don't speak :D
 
Holy shit I took a look at gcc.gnu.org/projects/beginner.html
 
user142019
> Fisting can cause laceration or perforation of the vagina, perineum, rectum, and/or colon, resulting in serious injury and even death.
 
@MooingDuck impressive! which language, might i ask?
 
Xeo
Also, aw, Haskell's list comprehension doesn#t seem to like ZipList - I thought it used do-notation under the hood?
 
user142019
That's fucking sick dude.
 
9:55 PM
@user1690130 French
 
Ctrl+F "Break up enormous conditionals"
 
@MooingDuck oh cool! i was just talking in french with @EtiennedeMartel! :)
 
@Xeo Code?
 
@rightfold It's a smart move.
 
i would have loved to help
it would have been the least that i could have done!
 
9:56 PM
There are monad comprehensions that do desugar to do-notation I think
But ZipList is an applicative not a monad
So I'm not sure what are you trying to achieve
 
Xeo
Ah, true
 
user142019
@CatPlusPlus I can confirm.
 
Xeo
I somehow thought of it as a monad. Nvm me
 
user142019
Generalization of list comprehensions.
 
@MooingDuck do you know much about proxy connections to websites? (or anybody else here?)
 
user142019
9:57 PM
It's a language extension, though. hackage.haskell.org/trac/ghc/wiki/MonadComprehensions
 
@user1690130 I know very little
 
@rightfold Doesn't look too bad
Also seriously take a look at that "enormous conditionals" thing
 

« first day (941 days earlier)      last day (4013 days later) »