« first day (356 days earlier)      last day (4598 days later) » 

1:00 PM
Yes, you did.
 
what do people use it for?
except statistics.
 
27 secs ago, by IntermediateHacker
I've never needed to use R/
Tenth character.
 
I meant the R Programming Language
Lol.
 
Programming language != general-purpose programming language.
 
@IntermediateHacker Except statistics? Nothing. It's for statistics.
What do people use C++ for? Except programming.
 
1:02 PM
Can u use R in your maths exam?
I'd love to score an A in stats
 
R won't do that magically to you.
 
@RMartinhoFernandes They use C++ for hardware design
C++ is also used for hardware design, where the design is initially described in C++, then analyzed, architecturally constrained, and scheduled to create a register-transfer level hardware description language via high-level synthesis.[7]
Wikipedia
 
Oh, well, bad example.
 
Yay! I beat the bot!
 
@RMartinhoFernandes I wonder if you can do numerical stuff (other than statistics) though. May not be the best tool for the job but I guess it has capabilities?
 
1:07 PM
And maybe some graphics?
 
@IntermediateHacker Actually that would be writing a program in C++ that can compute a solution.
 
Like stats graphics? :P
 
But 'writing a program' can be quite creative when it comes to C++.
 
What do people use cars for? Except killing themselves.
 
The Wikipedia claim is a bit dubious, it's like claiming that C++ is a language for representing FSM or other automata.
 
1:08 PM
Oh, wait, that's another bad example.
 
They use cars to kill patients...
why the silence? :(
 
2
A: Is there a way to escape a C preprocessor directive?

Marcelo CantosHere's one trick that seems to work: #define HASH() # ... HASH()ifdef __cplusplus class foo { }; HASH()endif You'll have to use cpp directly, since a compiler will try to immediately consume the preprocessor output and won't know what to do with the unprocessed directives.

Nasty.
 
"Antepreprocessing"?
Unsurprisingly I get google hits for that.
 
1:25 PM
6 mins ago, by R. Martinho Fernandes
Nasty.
I agree
why would someone want to output a preprocessor directive?
 
To generate code with preprocessor directives?
The usage seems reasonable to me. It's just that the tool that was chosen is not the best.
 
You'll have to use cpp directly, ?
How do u use cpp directly?
 
$ cpp path/to/file
 
seems interesting. I am gonna try it out
#define DEF #define
i wonder if this will ever work.
 
I don't think it's supposed to, but I can't be sure.
And, it's not like "this should not work" has ever stopped compiler implementers.
# is the token paste operator.
 
1:32 PM
isnt't it ## and # is stringify?
 
It stringizes marco args.
 
@Benoit Oh, right.
That.
Anyway, it needs a macro parameter to be valid.
 
I wonder how many years (if ever) will it take for c++ to eliminate the use of the preprocessor
It's one of their biggest design goals
 
Is it a design goal? I know B.S. hates the CPP, but that doesn't mean it's a design goal.
Even if C++ removed the preprocessor it would probably still be supported by the compilers.
 
Are there any C++ compilers that don't do C?
 
1:37 PM
Perhaps the macro syntax could be implemented as language features :D
 
Yeah. they tried to do it with #define
 
meh port forwarding on my router seems to not work for some odd reason
 
the const keyword
 
@StackedCrooked Macros are a language feature.
 
lol.
how to write "unmaintainable code"
 
1:40 PM
@RMartinhoFernandes MSVC
 
Creative Miss-spelling
If you must use descriptive variable and function names, misspell them. By misspelling in some function and variable names, and spelling it correctly in others (such as SetPintleOpening SetPintalClosing) we effectively negate the use of grep or IDE search techniques. It works amazingly well. Add an international flavor by spelling tory or tori in different theatres/theaters.
 
@LucDanton I seem to recall it having an option to choose between C and C++. Granted they're probably still stuck with C89.
 
yeah, MSVC doesn't have C99 support
or rather, it's only very limited
 
Much of the skill in writing unmaintainable code is the art of naming variables and methods. They don't matter at all to the compiler. That gives you huge latitude to use them to befuddle the maintenance programmer.
 
1:45 PM
@IntermediateHacker From there:
Friendly Friend
Use as often as possible the friend-declaration in C++. Combine this with handing the pointer of the creating class to a created class. Now you don't need to fritter away your time in thinking about interfaces. Additionally you should use the keywords private and protected to prove that your classes are well encapsulated.
 
@Benoit Lol. I'm gonna write code this way from now on. :D
 
Remember, he has a chainsaw.
 
@RMartinhoFernandes you mean the guy maintaining the code
?
 
Yes. He also lives next door to you.
And he is a diagnosed psychopath.
 
@RMartinhoFernandes Then just declare him your friendship.
 
1:51 PM
class me { friend psychopath; };
 
Great, now the psychopath has access to your private parts.
I don't want to know why you would want that.
 
keep her satisfied, obviously
 
6 mins ago, by R. Martinho Fernandes
Remember, he has a chainsaw.
 
you say he, I say she, prove me wrong
 
"chainsaw".
 
1:54 PM
what if all DeadMG's private parts are const?
 
heh
by the way
I'm a complete genius and owned my PROLOG coursework
 
You mentioned that before.
Both the genius part, and the PROLOG part.
-1
Q: Can someone explain the WHY behind the WHAT of pointers?

ultramaxI can't for the life of me find any reading that gives every day life examples of pointer usage or WHEN, specifically, you'd want to use them. Can anyone explain that to me? It's really the only thing holding me back in regard to pointers is WHEN I should use them.

 
sbi
@RMartinhoFernandes Why did you guys close that question? It's perfectly valid!
 
@sbi Duplicate I assume.
 
Sorry, I messed up on the close reason :(
I posted a link to the dupe, and to another relevant question.
 
sbi
2:04 PM
@LucDanton "closed as not constructive"
 
@sbi If there are several reasons doesn't the system act silly?
 
close as dupe seems reasonable to me
 
sbi
@LucDanton Yeah, it states the reason that the majority picked.
Mhmm. That makes me wonder what the system does if five users close a question with five different close reasons.
Oh well, they might just pick the first one then.
 
I think the problem is that too many close-voting users don't really understand or care about the close reasons, so they just pick whatever the others picked.
(or they screw up, like I did.)
 
There isn't a way to make a object function parameter const in java? Only the reference can be but not the object itself
public void change(final MyObject final obj)
 
2:09 PM
@LewsTherin What would it mean for the object itself to be const since methods can't be overloaded on const in Java?
 
error
 
What would you do with such a reference?
 
@LucDanton Access public final fields!
Except everyone hides those behind a getter.
 
@LucDanton you just confused me... methods ocan't be overloaded on const? I mean the object passed shouldn't be modifiable
 
@LewsTherin I never said that. Please make a complete quote.
 
sbi
2:10 PM
@RMartinhoFernandes I think that, generally, too many none-dupe questions are closed on SO.
 
> methods can't be overloaded on const
Emphasis added.
 
@LucDanton huh
 
What does that mean
 
@LewsTherin Right, but what would it mean for an object to not be modifiable? Show me a use of such a reference.
 
@sbi Surely you agree that one is a dupe of this one: stackoverflow.com/q/162941/46642
 
2:12 PM
Ok a simple one is a copy constructor, we can make the object passed in const
 
sbi
@RMartinhoFernandes Yeah, I do. In fact, I put a dupe header into stackoverflow.com/questions/7688283/….
 
But there's not guarantee that the copy constructor doesn't modify its argument, is there? (Not familiar enough with Java here.)
 
foo(foo other) { other.mutatingOperation(); }
 
sbi
@RMartinhoFernandes Damn! :)
 
2:13 PM
@LucDanton yeah come on you know what I mean :)
 
Java doesn't really have copy constructors
 
I don't what to do other.hello = "Hello" ; in the invoked function
 
@LewsTherin I do, but does the language? That's what matters.
There's not much you can do with a hypothetical const object if the language can't distinguish mutating operations from non-mutating operations, is the point.
So Java doesn't allow you to do what you want because it doesn't have const (for the general case).
 
Of course it doesn't. That's not object-oriented.
Or something.
 
But I can do this final foo other ; in main and otherwould be const
 
2:16 PM
no
 
Only the reference. You said it yourself before.
 
it only makes that reference const
 
yeah
So I suppose the only way is to use access modifiers or the data members final if it doesn't change
 
@LewsTherin The language does make a difference between dereferencing, which is non-mutating, and assignment, which is mutating, in this case.
 
@LucDanton yeah while the reference can be used to modify the object, the reference cannot be changed. There is no point in making a parameter object reference const then
..I assume that is right then
 
2:24 PM
It is :)
 
Ha ha lol cool thanks.
How does a cow say moo polymorphically?
Someone seriously needs to add polymorphism and polymorphically to the dictionary
 
It's a traditional silly inheritance example.
 
Ah I'm hungry now
Would you ever have wrapper classes for non primitive types
 
uh
would I ever wrap a class in another class?
 
I don't know, you tell me...
that's why I asked :)
 
2:31 PM
That's a pattern. It's called Adapter.
 
Omfg again confused...I haven't read up on Adapter classes but I thought Adapters were used to implement only certain methods in an Interface
What does that have to do with wrapping a class in another class..
 
Unless you're wrapping the classes for some other reason.
 
@LewsTherin Well, that's usually what wrapping involves.
 
cout << "Shoot me!" ; exit(0);
 
can anyone give me a router model that supports UPnP and port forwarding?
 
2:36 PM
uh
all of them since about 2000?
 
Yeah, and they're all as crappy.
 
true
 
At least all the ones I ever bought.
 
we have a D-Link here which is very good
good routers are very expensive, I find, but they can be worth the price
crappy routers are, well, crappy
 
And common.
 
2:40 PM
yea I have this officeconnect from 3COM, it's shit
can't even get the port forwarding to work properly
wtf
 
2:55 PM
Ok guys look at this
 
2
Q: performance test between two directions of a 2D array

devnThis code (A) executes much faster (10 times) then the second one: for(int w=0; w<width; w++) { for(int h=1; h<height; h++) { image[h][w] = (1-a)*image[h][w] + a*image[h-1][w]; } } Second one: for(int h=0; h<height; h++) { for(int w=1; w<wid...

 
thats easy..a compiler can perform optimization if traverses column wise
 
aix's answer makes sense to me, but doesn't match the observed results.
 
"However an object of a class type such as an object of class String might be of any size. The memory location for a variable of type String is of a fixed size.
so it cannot store an arbitrarily long string. It can however store the address of any string since there is a limit to the size of an address"
I get the last part, the size of the address is fixed ok. But the memory location of a variable of type String is of a fixed size...wtf?
 
Confusing, and irrelevant.
 
2:59 PM
?
The author is explaining references and stuff
 
You're talking about a Java String, right?
 
yeah
 
Well, what difference does that make?
It basically says "a reference can refer to data of various sizes".
 
"The memory location for a variable of type String is of a fixed size."
but it can be of variable length
 
@RMartinhoFernandes What's with the silly differences in iteration bounds?
 
3:03 PM
If, instead of "memory location" and "variable" and stuff, the explanation used terms that make sense in Java, it could be easier to understand.
"A reference to a String can refer to data of various sizes."
That's it.
@LucDanton No idea, but I don't think that would case a tenfold increase.
 
Yeah your way makes more sense
 
I get a 2x difference on ideone (matrix of double), but with the first one slower, as I expected. I think the OP messed up somewhere.
 
(H-1)*W vs H*(W-1) memory strips.
Meaning the difference in data size is W - H (former minus latter).
Make the image eleven times as wide as its high and there you go. (Actually those numbers don't work like that, but still, it skews.)
Well, other way around actually.
 
Right, that could be it too. I used a square matrix.
> Also, there is no health risk in using the shift key. – avakar 1 min ago
This is genius.
(Even if not entirely accurate.)
> Regarding FTW ATW LOL BBQ HACK , I don't think we have many lolcode programmers here. Regarding !!!! et al, the english language also has the ?, . and , operators. Multiple exclamation marks lead to undefined behaviour (one example of undefined behaviour is this comment) – phresnel 10 mins ago
This is even more genius!
 
3:19 PM
why are you folks discussing java
 
sbi
@AlfPSteinbach Yeah, isn't it the same guys who were discussing Haskell here only yesterday? :)
 
@sbi yes
 
:(
no upnp on my router it seems, or at least my NAS won't find it
damn it
 
3:43 PM
@RMartinhoFernandes I'm thinking back to what we said about safe operators for scoped enums (also looking at your code). Did we only cover enums as flag and arithmetic types?
 
@LucDanton What else is there?
I think I'm missing the bit shift operators.
 
There's one usage left for emulated scoped enum: with std::get and the like.
struct parameters { enum { foo, bar }; }; typedef std::tuple<ns::foo, ns::bar> parameter_tuple;
Then std::get<parameters::foo>(some_tuple); is possible, and if there's a new type in the namespace ns which we want in the parameter_tuple client code isn't sensitive to shuffling.
 
Assuming two types ns::foo and ns::bar?
 
@RMartinhoFernandes Precisely (of course the enumerators can have different names).
AFAIK it's simply not possible without writing one's own get.
Perhaps a using declaration?
template<scoped_enumerator E> using get = std::get<to_underlying_type(E)>;?
 
Hmm, that could work, but you need one such using declaration for each client enum.
And zero library code.
 
3:48 PM
@LucDanton there's no ns::foo. i think you're just talking gibberish.
 
3 mins ago, by R. Martinho Fernandes
Assuming two types ns::foo and ns::bar?
 
@AlfPSteinbach There is no main either. What made you believe it's a complete and independent code snippet?
 
@LucDanton they're conducive to rational discussion
 
@AlfPSteinbach Then ask for the complete and independent code snippet.
 
I think I should've used a macro instead of typedef typename std::underlying_type<E>::type underlying; everywhere.
 
3:52 PM
@AlfPSteinbach They're never welcome in the chat and belong in a paste anyway, what did you expect?
 
In fact, I could have macro'ed out a lot more than that. That code is extremely repetitive.
 
@RMartinhoFernandes Wait, what happens if we use SFINAE for a template using decl.?
 
well i didn't expect this kind of discussion in chat. it's like psychobabble. using enum to name parameters stored in a tuple, it's rube goldberg.
now we had haskell, then java, then c++ rube goldberg constructions. what's next?
 
Come on, we can't even discuss C++ now?
 
@AlfPSteinbach It's faster than writing a class. Wrapping a tuple is painful-ish.
Sometimes I want to be data-oriented and I don't need to make an abstraction out of everything.
@AlfPSteinbach Anyway unlike psychobabble this is something that is actually already happening in my code. If I can get away with using a scoped enum instead of emulating them, I would do that.
Or has happened.
 
3:57 PM
@AlfPSteinbach You're probably missing context from previous conversations.
 
exactly my thoughts
 
@LucDanton You'd need something like template <typename E, E e, typename = /* SFINAE with is_tag trait */>, no?
 
@Alf What's with the outburst? I don't mind you participating in the discussion but we only get an angry-sounding rant. I wish you'd fully participate; or you can ignore the discussion altogether but the tirades bring nothing of value.
@RMartinhoFernandes I'm skeptical of the whole idea, I'd except hard-errors unless in a template context (i.e. where SFINAE would trigger even without the using decl.).
 
hello all
Does anyone here have socket programming experience?
 
I thought Clang had template using declarations :(
 
4:05 PM
@LucDanton Howard Hinnant just told me it has. A few minutes ago.
@mtahmed Once I implemented UPD Plus. And the next year it was UDP++!
And I still haven't passed that class.
 
Well I have the 2.9 release so I guess that means it's in the upcoming 3.0.
 
So, this year I'll probably have to implement UDP+++ or something.
2
A: less verbose way to declare multidimensional std::array

Howard HinnantA template alias might help out: #include <array> template <class T, unsigned I, unsigned J> using Matrix = std::array<std::array<T, I>, J>; int main() { Matrix<int, 3, 4> matrix; }

Here.
 
Europe -> Art?
 
that's what it says
I like mexico, Tequilla and Pr0n :)
 
4:10 PM
Well I have access to a more up-to-date Clang build but that doesn't seem to be enough.
 
Well, I'm European, so I'm biased, but is Art really what the rest of the world thinks when they think of Europe?
Seems like we got the only good things (including Scandinavia).
Oh, there's "freedom" on the other side.
 
sbi
@RMartinhoFernandes I invoke Gorski's Law.
 
I'm not a Merkin.
I'm Made in the Old World.
 
sbi
@RMartinhoFernandes No, but those who made the map probably are.
 
Oh right. That makes sense.
 
sbi
4:15 PM
Also, that freedom is seriously limited by religious bigotry.
@RMartinhoFernandes Of course, it does. I wouldn't have said it otherwise. (Now the puppy is rubbing off on me.)
 
oo, another free t-shirt!
 
oohhh where from?
 
SO
 
80
Q: Stack Overflow T-shirt, 3rd anniversary edition

JinI was talking to Jarrod the other night about the early days of Stack Overflow. I then realized SO came out of private Beta three years ago. What better way to celebrate this milestone than making a T-shirt for it? I wanted to come up with a design that's interesting and regular SO users can r...

 
Looks like a filler to me.
 
so hard to figure out US sizes though. Last time I got XL and that was practically a tent
 
(Not the T-shirt, the pic Tony posted)
I think there should be two sizes: Martinho and not-Martinho.
 
"One size fits one."
 
4:23 PM
@RMartinhoFernandes ok this is the right link
 
Stupid quickmeme, trying to trick you into not hotlinking.
 
@RMartinhoFernandes how'd you fix it?
 
@TonyTheLion I used the Light Side of the Source.
I cut the filler out with my lightsaber.
 
sbi
> If you're a user on the first five pages of stackoverflow.com/users?tab=reputation&filter=all, we'd like to thank you for being AWESOME by sending you a custom, special edition third anniversary Stack Overflow t-shirt.
Oh.
 
huh, sounds like magic to me :P
 
4:28 PM
@sbi :( I'm way beyond that.
 
much better design than last time
 
yea me way beyond that to :(
 
the first shirt was just a big SO logo across the chest
 
They should make that first 15 pages.
 
yea, remember seeing those
 
4:29 PM
Or top 1% overall.
Whatever makes me get a free t-shirt works.
 
sbi
@RMartinhoFernandes You're beyond being on the first five pages? What comes after that?
 
Er, the sixth page?
 
@sbi the next five pages
 
"beyond the pages we know"
 
4:31 PM
what else would come after that? Unicorns? Porn?
 
it's probably undefined
 
sbi
I thought "the next five" come behind the first five. But it seems this joke was beyond you.
 
meh, I didn't get the joke either
 
sbi
Anyway, they are shipping 180 across the world. Not too greedy, actually.
 
security eh
thanks google :P
 
4:33 PM
@sbi Beyond, adverb. Happening or continuing after (a specified time or event)
I was a bit liberal and ignore the "time or event" part.
 
That's illegal here, too.
 
sbi
@RMartinhoFernandes See. You are beyond the first five pages after you have been on them. My saying.
 
The law doesn't point masturbation out specifically, but since it's a distracting activity, it's forbidden while driving.
 
4:35 PM
lol
how would a police officer catch someone doing it, do they stop drivers and ask them: "Are you masturbating?" if not, carry on.
lulz
 
sbi
@RMartinhoFernandes But he is not charged with "distracting activity."
 
he is charged with lewdness and public indecency
but he was in his damn car
 
sbi
@TonyTheLion And what's more: he is charged with lewdness 17 times for a single incident.
@TonyTheLion I guess this makes a case for darkened windows, no? :)
 
@sbi guess so
 
Als
Hmm Masturbation talks...no wonder @TonyTheLion is in right now
:)
 
4:42 PM
lol, I happened to start that conversation by posting that NSFW link
lol
who else would start a conversation about something sexual on this chat?
 
Many people. Specially women.
 
Als
Yes, You are correct, hence the happened to in your statement was wrong
:)
 
Als
@RMartinhoFernandes: Women, discussing sex in this chat?
thats a myth!
 
there's women in this chat?????
wait... wut???
 
4:44 PM
@Als Nevermind, that was a reference to a stupid joke.
Calm down lion.
 
Als
We were promised wine women not so long before and now the bot is hiding something from us!
 
nothing ever happens in this boring life of mine, so I get excited about little things very easily :P
 
i think there's a greater chance of finding women on /. than here
 
Xeo
Mornin'
 
4:45 PM
Yeah, right.
 
Als
uhm is that the woman you were talking about? @RMartinhoFernandes
:P
 
Good one :)
lol
 
Als
haha
 
Xeo
I came in at the wrong time again...
 
Als
@TonyTheLion, theres the woman for ya..
:P
 
4:46 PM
just like the guy on the highway :)
 
Xeo
Anyway, I got my first job interview on wednesday \o/
 
Als
@Xeo: Congrats and All the Best!
 
Xeo
Related question: what's a good starting salary for a junior programmer?
 
sbi
@Xeo You might not want to enter the interview room with "morning", though - especially at 7pm.
@Xeo What are you interviewing for?
 
4:50 PM
@sbi I always great everyone with "Hi" (or the Portuguese equivalent) at every time of the day. That's extremely safe.
 
Xeo
C & C++ coder in general
 
sbi
@Xeo In Berlin? How big is the company?
 
Als
Oh well I jusst look around and smile foolishly saying hello :P
 
Xeo
No, Würzburg. And fairly big I believe, but you can see for yourself: HandyGames
 
ohhh I know nice thing happening in my life
I"m travelling again :)
wooo
 
sbi
4:55 PM
@Xeo That's not big, that's maybe 30 people, no?
Anyway, I don't know much about the game industry, except that so many young developers want to work there, that they can pick their slaves.
 
2 digits is not big.
 
the one I last interviewed for had 100 people
combined in Belgium and California
 
@TonyTheLion Are all these travels because you feel like it, or because you need it?
If I'm not asking too much.
 
@RMartinhoFernandes mostly because I feel like it, and sometimes because I need it :)
 
Xeo
From what I always hear, its exactly the devs that are in high demand, wherever you ask
 
sbi
4:57 PM
@Xeo If it wasn't game industry, as a junior I'd start haggling with 2.5-3k, with the idea of asking for a raise when I had proven myself after a year.
 
@sbi why do you say "if it wasn't"
does Game Industry pay worse?
 
sbi
3 mins ago, by sbi
Anyway, I don't know much about the game industry, except that so many young developers want to work there, that they can pick their slaves.
 
I need to go to Germany. That's like, three to four times more than here.
 
@sbi oh... slaves eh
 
sbi
@RMartinhoFernandes Well, you will have to see this in relation to the costs of living, of course. (I am not saying we do not get more even then. I dunno.)
 

« first day (356 days earlier)      last day (4598 days later) »