« first day (508 days earlier)      last day (4423 days later) » 

2:00 PM
and 17 atm
 
2:12 PM
0
Q: c++ Initialising 2 different iterators in a for loop

DerekI'd like to have a for loop in c++ which constructs 2 different kinds of vector iterator in the initialisation. Here is a rough idea of what I would like: std::vector<double> dubVec; std::vector<int> intVec; double result = 0; dubVec.push_back(3.14); intVec.push_back(1); typedef s...

found duplicate, vote to close please
 
That's brilliant
 
@ScottW It would also falsify the quotation so please don’t do it
 
i commented
 
Xeo
2:22 PM
Whoever flagged that should grow the fuck up.
 
@KonradRudolph You mean "What the f***" ;-)
Anyway, I'm familar with "raw pointers" and "naked pointers", but what are "fucking pointers"?
 
@FredOverflow they're not allowed on SO
 
Xeo
#define cking const
typedef int f;
f*cking pointer = 0;
 
That also works with f***ing pointer , you just get a different type (pointer to pointer to pointer to int) and a different name, of course.
 
2:28 PM
Hey guys.
 
@FredOverflow Maybe it's better with "Wh** the *u*****"
 
@FredOverflow err, int***ing pointer = 0? Doesn't look like valid C++ to me
 
@KonradRudolph Sorry about that edit. You can feel free to change it back if you feel strongly about it.
 
@BilltheLizard it just seems needlessly stupid. Why not just remote the quote if it is a problem?
 
@jalf #define ing const
 
2:30 PM
@CheersandhthAlf I was responding to a flag, so representing the community is exactly what I was doing.
 
Xeo
@FredOverflow Reminds me, I could've just #defined "cking" to nothing.
 
rather than replacing a censored version of an offensive word with a censored version of an offensive word while also falsifying a quote, which just sems... uh..
 
@jalf "If "f***ing" is more acceptable than "f*cking", then shouldn't the edit just remove the quote, rather than falsify it? – jalf" Doesn't make logical sense.
 
@BilltheLizard the community didn't flag it. Some individual did, so you represented that individual
 
@BilltheLizard I feel strongly that the issue is ridiculous. But I don’t feel like debating incompatible cultures. Whoever flagged that is a moron. (I almost said “immature moron” but I’m aware of the irony of writing that.)
 
2:31 PM
#define king   // Does anyone get the Metallica reference?
typedef int f;
f**king pointer = 0;
 
@BilltheLizard fine, that should be "if f*cking is a problem"
but are you saying that when something gets flagged, it is, by definition, "representing the community" when you do what the flagger requested?
I'm not sure that makes logical sense either
 
@KonradRudolph I don't want to debate it either. I agree that they were being overly sensitive (which also seems to be the consensus in the mod room). If you change it back I'll just dismiss any future flags.
 
anyway, I rolled it back already. If it gets flagged to hell, just remove the quote IMO. Point is, it's a quote, it's supposed to say the same as the thing it quoted
 
@jalf No, please don't put words in my mouth. I'm here to speak for myself.
 
3 mins ago, by Bill the Lizard
@CheersandhthAlf I was responding to a flag, so representing the community is exactly what I was doing.
 
2:33 PM
@StackedCrooked Hey, the panel Q&A is pretty good. I was watching this and I was thinking "These are my rock stars!" :)
 
I'm not putting words in your mouth ;)
 
My thoughts exactly when I watched the panel :)
 
which panel?
 
Day 2 of Going Native
 
ooh right
@BilltheLizard: out of curiosity, was the *** thing your idea, or something the flagger suggested as a solution? ;)
have to say it's a creative way to handle that kind of complaints
 
Xeo
2:36 PM
Argh, I wanted to change the topic and then I remembered I'm not a room owner anymore. :/ @FredO, mind adding me again?
 
oh god why?
 
@Xeo How do I do that?
 
Xeo
@jalf I'm wondering if the user maybe thought the censoring was offensive. Would've been an interesting twist. :)
Thanks
 
Done @Xeo
 
2:37 PM
I would have done it if I had known how :)
 
RTFM :P
 
@Xeo i think you're right. bill just exacerbated the problem with his edit!
 
fucking Americans
can't stand the word fuck in a Q&A website, but Hollywood uses it all the damn time
 
Xeo
@TonyTheLion "RT*M"
 
FUCK that pisses me off
@Xeo lol
 
2:39 PM
@TonyTheLion but they usually beep it out again
 
Xeo
room topic changed to Lounge<C++>: Please repeat before entering: "I will not use fucking pointers." [c++] [c++11] [c++-faq]
 
@jalf cause they have a snobbish mentality about cursing
 
Xeo
// great thing you can't flag topics
 
lol, but someone can rant on meta
about it
forex trading is hard
 
@Xeo Am I allowed to use this?
 
2:41 PM
<----- this
 
Xeo
@FredOverflow There are always exception to the rules, else it would be a law. :)
Also, you're already in!
 
@FredOverflow this being a pointer is arguably a design flaw.
 
@KonradRudolph Of course it is.
 
You should never use it, except to initalise a private member T& that(*this);
(jk)
 
I thought that me was usually the preferred way to go about it?
 
2:42 PM
or self
like in Python
 
and Lua
 
but that’s not as funny as that
 
@KonradRudolph How is it a design flaw? There was nothing better around at the time this was invented.
 
could have a better naming
this is confusing to a beginner
 
@FredOverflow Well yes. Ok, it should have been retro-fitted ;)
 
2:43 PM
#define self (*this)
 
Xeo
Reminds me of some Boost code... member function that just forwards to a free function with the signature R foo(T& self, ....)
 
self or me would have been better
 
Xeo
@TonyTheLion Really? "this object"
 
@FredOverflow There was at Standardization, though.
 
@Xeo I didn't think about it like that back when I was an uber noob :P
 
2:44 PM
@DeadMG They standardized an existing language with million of lines of code out there, right?
 
Xeo
@TonyTheLion What did you then think of this?
 
they should have just used #define this (&self), or introduced both
not just left it as suck
 
@Xeo can't remember, only thing I remember is being confused about it
SUCK ALL THE THINGS
 
Xeo
@DeadMG You're free to send a proposal to the C++ committee. :P
 
oops.... that could be seriously misinterpreted :P
 
Xeo
2:46 PM
Yeah, especially coming from you.
 
@TonyTheLion S*** ALL THE THINGS
 
@TonyTheLion As if anyone would view it in the alternative way considering the author.
 
@DeadMG oh :(
 
@Xeo There's too much in C++ to fix. That's why I'm (taking a break from) inventing Wide.
 
2:47 PM
@DeadMG why, cause you wanna fix C++ first?
 
@DeadMG Forget wide, come on board my project, Caliph
it’s been around since 2001
 
Xeo
Yeah, but to fix some stuff, you'd need to fix all the legacy code.
 
Imma invent Narrow
 
I still haven’t produced a spec or a compiler
 
The Caliph ( /) is the head of state in a Caliphate, and the title for the ruler of the Islamic Ummah, an Islamic community ruled by the Shari'ah. It is a transcribed version of the Arabic word   which means "successor" or "representative". Following Muhammad's death in 632, the early leaders of the Muslim nation were called "Khalifat Rasul Allah", the political successors to the messenger of God (referring to Muhammad). Some academics prefer to transliterate the term as Khalīfah. Caliphs were often also referred to as Amīr al-Mu'minīn (أمير المؤمنين) "Commander of the Faithful",...
 
2:48 PM
@TonyTheLion That’s where the name comes from
 
for this ^ ????
oh I thought you wanted to compile that :P
 
Xeo
This is vexing. I'm 1 rep away from 30k.
 
hey
I can invent my own damn language at my own damn pace
 
@Xeo Just remove one of your downvotes.
 
and if I choose to take a break, that's my business
 
2:49 PM
Does Wide have break and continue? :)
 
@FredOverflow Then I can upvote him just to annoy him! mwahaha
 
@DeadMG whoever said anything to imply otherwise?
 
@DeadMG lol
 
@FredOverflow no, he only wants to continue to break C++
lol
true, since I can't run
 
ARGH JAMES KANZE Y U SO ANNOY
"An object has a lifetime determined by the design of the program, not such low level implementation details."
 
2:53 PM
ol
 
IMPLEMENTATIONS ARE IMPORTANT
Why am I the only one who can ever see this?
 
because you're puppy :P
 
fucking people jerking off over how pointlessly high-level they're being
 
@DeadMG It doesn’t help that he uses “object” in place of “resource” … “object” has a well-defined meaning in C++, and his assertion is actually exactly true in C++, because every resource is bound to an object. So everything is perfect
 
2:54 PM
they're having high level orgasms
 
@TonyTheLion What?
 
don't you see that in English the word is completely different then all the other languages
 
yes, but I don't see how that's significant in any way at all
 
IT IS SIGNIFICANT
just take my word for it
 
no
I don't see the significance and will not believe it's significant unless you demonstrate such
 
3:00 PM
@TonyTheLion which word? the english or every other language? :D
 
Spend 10 minutes writing an answer.
[so]
Question has been closed, no new answers will be accepted.
 
lol
@KendallFrey you're trolling me
 
@CatPlusPlus So thats where you've been.
 
@jalf That was my idea, but another mod came up with the same solution. It was sort of a backhanded way of handling the flag while also telling the flagger to lighten up, but obviously I didn't think it all the way through.
 
No, I've been sleeping. Missed all the classes today.
But meh.
 
3:04 PM
is there ever a day where you don't miss classes?
 
Oh, hey, a mod.
Lemme guess, someone didn't like the topic.
 
lol
no, actually
 
@DeadMG in English, we have the 'Anus' it's the technical name for your shiter
 
lulz
lullz
 
3:05 PM
@thecoshman As a person from England, I think I'm fully aware of that fact
 
more specifically, the just inside you part :P
 
actually, no
 
the chat won't let you post the same word twice in a row
 
I thought so...
 
@BilltheLizard yeah, I guess the joke doesn't really come across when others don't know why you made the edit, and modifying a direct quote is never a good idea. But I like it as a way of telling people to lighten up ;)
 
Xeo
3:05 PM
@CatPlusPlus The topic was established after the mod came in :P
 
@CatPlusPlus what question?
 
So he won't have to come again when it's finally flagged!
 
Xeo
@CatPlusPlus Annoying :s
 
Yes.
Also, I should bold mod usernames.
 
3:07 PM
So... it'll be bold.
Ha, perfect.
 
TIL who this mysterious "snooki" is I keep reading about
 
what it do?
 
leme guess. bold mods?
 
3:12 PM
Good god man!
I don't think I haver seen such as nauseating font, and I've seen comic sans!
 
the font is a bit strange, i must admit
 
Wut.
It's Deja Vu Sans Mono.
 
even more reason why it's strange
that name....
 
It's one of the most basic free fonts.
 
I fail to fap to that
 
3:14 PM
its almost identical to Courier New, which i grew up with.
 
Only at this font size.
 
I don't know what font I grew with
I'm not that geeky :P
"fucking pointers", doesn't really sound so erotic
 
they always send you somewhere else
 
yea, keep going around in circles
circle jerk
 
oh, so you're a fan of circularly linked lists?
 
3:18 PM
lol
 
I really do feel like this job as some sort of hidden camera show. Just trying to see how much bull shit wind up crap they can pull on me before I break
 
do as you should do- fail early
 
0xEBFE
 
hmmm
I've seen a lot of people complain about functions that are too long
do you think that 200 lines is too much for one function?
 
3:24 PM
absolutely not
if the code is commented
 
@DeadMG For most functions, yes, absolutely
 
@DeadMG that's a hypothetical question
 
well, I defined a bunch of helper lambdas which are most of the function body
 
Some functions just need to perform complex case distinctions that cannot be shipped off into separate functions easily
but this should be exceedingly rare
 
I don't want to make them members because there's no reason that the rest of the class should be able to access them
 
3:26 PM
chances are, there are sections that could be pulled out into there own function
 
@DeadMG Yup, I find myself doing that also. IMHO, fine although there may come a point where it makes sense to ship all this off into an own encapsulated object
 
tis truecakes
damn
you know, I really don't like 3D rendering code
you have to just hope that you remembered to set all the invisible state
 
yeah, it's kind of a pain like that isn't it
 
c# doesnt help a whole lot either
 
I wish I could have some time to play with my own 3D stuff, but stupid house needs stupid renovations :(
 
3:29 PM
what does C# have to do with anything?
 
C# is so annoying, it annoys you even when your not using it
 
i used c# for that already
 
lol
C#'s not that bad
 
@thecoshman I disagree.
 
not as bad as, say, Java
and it's still above orgasm-dynamism languages like PHP, Python, JS, etc
so, in summary, actually, it's probably my second-favourite language after C++, because there's little competition in the realms of languages which I consider useful
 
3:31 PM
C is my favorite overall I think.
even machine code is fun
 
I have used both Java and C#, whilst I think both languages are about equal in terms of getting on my tits for not being C++, Eclipse makes Java a lot less annoying
 
what, you're not missing any plusses or sharps on that?
 
@thecoshman C# has way stronger generics and lambdas and shit, and even some operator overloading. It's way better than Java.
well, you must be insane, because C is one of the worst languages you could possibly name
 
Indeed, C# does offer a lot of extra shit
 
Xeo
3:32 PM
@thecoshman C# -> Visual Studio
 
C is simple.
 
but, I never had a happy time with C# stupid XNA funky crap
 
that's not a good thing
programming is hard and complicated
 
Xeo
@KendallFrey No. No, it's not.
 
why not?
 
3:33 PM
any "simple" language is just making you do the work instead
for example, in C, freeing the resources, writing every generic function a thousand times, null terminating the strings, all that sort of BS
I assure you, it is much easier, much simpler, and much more effective to use RAII to free the resources than to have to do it yourself
I mean, come on, man, you're writing a computer program on a computer, so use a computer program to automate your repetitive tasks
 
C++ has lots of libraries written for you, which is good and all, but I like C for simple stuff.
 
I'm not sure if I want to continue work on my Java game library... or move back to developing in C++
 
there's no such thing as any stuff that's so simple, C is a good thing
 
Ever write an OS in C++?
 
think I might just stick with Java for the very reason I started in Java
 
3:35 PM
uh
no, I haven't ever written an OS in C++
have you ever written an OS in Prolog?
 
I would have, but C++ isn't simple enough
 
or a game in Brainfuck?
 
@KendallFrey Yes.
 
because, I assure you, that have you written "PROGRAM X" in "LANGUAGE Y" is really an irrelevant question
 
C is not simple, C is primitive.
There's a difference.
 
3:36 PM
for a start, as one single user, I represent about nothing as a statistically relevant sample
 
good point
 
and secondly, if I were ever to write an operating system, I would most assuredly use C++
and thirdly, the Windows kernel has virtually all new development in C++, as far as I am aware
 
i thought i would too
i like low-level stuff i guess
 
C++ can be every bit as low-level as C
C is just doing it manually, not doing it at a different level
 
C++ is still low level... it's just that it is advanced low level :S
 
3:38 PM
ive already played around with microcode
 
Xeo
Abstracted low level. Atleast the stdlib
It abstracts away many painful things
 
i think c++ is a lot more complicated at low level
 
yeah, I know
because the C++ Standard forces you to use classes everywhere, right?
and every bit of bitshifting must be done via template metaprogramming
 
for stuff like linking assembler and mangled function names, yuck
so you go extern "C" i know
back to C
 
only if you have any reason whatsoever to interface with C code
 
3:41 PM
or assembler
 
which you pretty much don't, except for the OS or binary library headers.. which usually come with extern "C" pre-written for you
 
Xeo
1
Q: Why Constructor called 2 time in c++?

Mahesh MeniyaIn this code the constructor is called twice. How do I avoid that? If I uncomment the default constructor code block then code does not give satisfactory output.. And I also want conditional based instantiation of template so I used void pointer. #include<iostream.h> template<class T...

 
extern "C" is not "back to C".
 
Xeo
I... I don't even know what to say...
 
i know
just saying that c++ relies on c style stuff to do that
 
3:43 PM
Also ABI won't be a problem, because you'll be using GCC or Clang anyway.
 
Grrrrrrrrrrrrrrrrrr
I HATE anonymous downvoters
-1
A: Set pointer to a value plus a seperate value

Tony The LionYou can only use offsets with pointers if the pointer points into an array. So if you have char arr[10]; and you fill it up with something, then you could do char *p = arr + calc_offset();, providing you don't go out of bounds of the array.

 
@ScottW good
 
@ScottW look at the comment on my answer?
I don't get what he's saying with structs ...
 
@TonyTheLion I think the downvote is because the answer ignores the standard library's offsetof macro.
 
@CheersandhthAlf meh, I didn't know about that macro
lol not anymore, but he was
 
3:54 PM
> If both the pointer operand and the result point to elements of the same array object, or one past
the last element of the array object, the evaluation shall not produce an overflow; otherwise, the behavior is
undefined.
 
yea, not sure what he meant with the struct thing
@CatPlusPlus is that from the standard?
 
offsetof is not said to do pointer arithmetic, that's an implementation detail.
@TonyTheLion Does it not look like standardese?
 
@ScottW well, not something I've ever seen, and if you can, it's not something that's a usual thing to do
@CatPlusPlus not necessarily
@CatPlusPlus I stole it
for my answer
I assumed it is from the C++ standard
 
Yes, it is.
UB usually compiles.
But you can't reason about the results.
 
Xeo
@ScottW I already commented on that :P
 
4:05 PM
10
Q: Inline assembly language is slower than native C++ code?

user957121I tried to compare the performance of inline assembly language and C++ code, so I wrote a function that add two arrays of size 2000 for 100000 times.Here's the code: #define TIMES 100000 void calcuC(int *x,int *y,int length) { for(int i = 0; i < TIMES; i++) { for(int j = 0; j ...

Pseudo-optimisations don't work. What a surprise.
 
^ Norwegian "Buhund" dogs
"This breed is also extremely headstrong and demonstrates an intense desire to be taught and to learn new things."
Listening to an old G3 record, it strikes me how strange it is that many of the greatest artists are apparently from outer space (Steve Vai), or gay (Yngwie), or baldheaded (Satch).
 
4:23 PM
> X-Y questions: `I sometimes feel the need to sneeze even though it rains, therefore I'd like to know why Chrysler vehicles are not used in movies that feature Oprah Winfrey, at least as far as Hollywood productions go`. (Hint: the question is hard to answer constructively, and most likely will not lead to a solution for your actual problem) – sehe 47 secs ago
@CatPlusPlus Pessimizations work. O horrors!
 
@CatPlusPlus oh... +13/-1 I wonder why people upvote such stuff
The flag of Turkey () is a red flag with a white crescent moon and a star in its centre. The flag is called Ayyıldız (moon-star) or Albayrak (red flag). The Turkish flag is referred to as Alsancak (red banner) in the Turkish national anthem. The star and the moon are two sky elements symbolizing the Tengriist beliefs of the sky-worshiping ancient Turks. In Turkic Mythology four colors are associated with four cardinal directions such as "gök-blue" (east), "ak-white" (west), "al-red" (south) and "kara-black" (north). These colors represent the direction towards the zenith where the Tengri...
^ it's C*
 
4:48 PM
The national flag of Pakistan () was adopted in its present form during a meeting of the Constituent Assembly on August 11, 1947, just three days before the country's independence, when it became the official flag of the Dominion of Pakistan. It was afterwards retained by the current-day Islamic Republic of Pakistan. The flag is a green field with a white crescent moon and five-rayed star at its centre, and a vertical white stripe at the hoist side. Though the green colour is mandated only as 'dark green', its official and most consistent representation is Pakistan green, which is shaded d...
 
oh... another pointer type
 
The flag of Mauritania is the common name for the national flag of Mauritania in north-west Africa. The flag was adopted on April 1, 1959. It was introduced under the instructions of Moktar Ould Daddah, and the subsequent constitution of 22 March 1959. Design The colors of green and gold are considered Pan-African colors. Green is also used to symbolize Islam, and the gold for the sands of the Sahara desert. The crescent and star are symbols of Islam, which is the major religion in the nation. Some writers have also speculated that green symbolises a bright future, and growth. There is...
@Abyx actually, this kind of flag is quite common in asia.
The crescent represents prosperity and the star represents progress.
 
@ScottW that was a rather widespread secret
@Abyx Because none of them have a clue about assembly - and they think it looks cool enough to upvote (just to see whether it will hype)
@IntermediateHacker Are we flag-happy again in this room?
I thought this room didn't appreciate flags in general
 
@sehe lol.
that's a different kind of flag.
 

« first day (508 days earlier)      last day (4423 days later) »