« first day (283 days earlier)      last day (4891 days later) » 

15:00
And if it is?
The second doesn't compile.
An example: std::vector<int> x(10); vs std::vector<int> x = 10;
The second doesn't compile.
It could also call a conversion operator instead of a constructor.
In that case the same reasoning applies, except that explicit operators only exist in C++11.
Do you mean that X x; T t = x; could call X::operator T ?
357
Q: What is the best comment in source code you have ever encountered?

Thomas Bratt This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. More info: http://stackoverflow.com/faq What is the best comment in sou...

this shit is funny :P
Ok, so these two syntax are definitively not equivalent. I note.
Background : There's this one tutorial site where many of my friends had learn programming, and I always doubted the quality of its content.
15:07
The equivalent with conversion operators.
So I wanted to check it out to see if it's good or not.
Well, if it says those are the same, it's wrong.
I always though it was a 💩y website, but I only read it quickly
I think I'll write a list of errors, like the guys from w3fools.com did.
@kbok let me guess: cplusplus.com?
user402642
@kbok fredosaurus.com/notes-cpp/oop-condestructors/… -- not sure if it's relevant. but I was taught in class that the two declarations you gave above are calling the same copy constructor
15:10
@DeadMG It's a french one
@kbok Seems like POO, PILE OF is getting popular.
@kbok Which one?
Bahahahahaha
@EtiennedeMartel :)
15:11
I know these guys
Really ?
I got like 2.5k posts on their damn forums
room topic changed to Lounge<C++>: Why have one infinity, if you can have 💩?
@MartinhoFernandes It's cool, but firefox won't display it. I'll look for a unicode font that supports it.
Their C++ tutorial used to be worse
It took the good old "C before C++" approach
15:12
The one in Lion is hilarious.
@EtiennedeMartel Yep. The PHP one was awful also.
Their POO, PILE OF character has eyes and a smile.
And colors.
@MartinhoFernandes pics or it didn't happen
Fonts have glyphs.
user402642
15:13
question about this struct: struct kiss_fft_state{
int nfft;
int inverse;
int factors[2*MAXFACTORS];
kiss_fft_cpx twiddles[1];
};
I posted one a while back in this chat. I'll dig it up.
user402642
the kiss_fft_cpx twiddles[1], is declared as an array of 1 element, why? is this a matter of style? malloc related?
user402642
what's the difference between just declaring a pointer instead?
Jul 23 at 4:26, by Martinho Fernandes
user image
@CarlodelMundo The array's memory will be allocated. A pointer will just point to garbage.
15:14
@Carlo: It's known as the "struct hack". It's basically used to pretend that the array actually has a variable length.
@EtiennedeMartel I spent nearly my whole scolarity trying to convince people not to go to this site. No luck. Now everyone I know who learned programming there sucks.
user402642
I see. So when malloc allocates memory... we allocate space for a pointer + whatever type it is
@kbok It's a shame, though, because there's some very good programmers lurking on the forums.
Though, I believe they read these tutorials because they suck, and not the other way around.
You just need to stay as far as possible from the tutorials.
15:15
Now they're doing management :)
for example, you could do kiss_fft_state* ptr = (cast) malloc(sizeof(kiss_fft_state) + sizeof(kiss_fft_cpx_twiddles) * 10); ptr->twiddles[5];
Well, it's an error that can be offset by explaining explicit ctors somewhere else.
but doing so is actually undefined behaviour, and it's a dumb thing to do in C++ anyway
C99 has flexible array members for that.
@MartinhoFernandes holy 💩 !
We need a shell script named 💩.sh
user402642
15:17
I see. Thanks for the background. I'm reading up more on 'struct hacks' and it makes more sense from a C standpoint
it's a dumb thing to do
I think the flashy POO, PILE OF is part of the Mac experience.
Experience crap the way Steve intended.
@MartinhoFernandes The Steve Wayâ„¢
15:19
Btw, there's a Chrome extension to experience the web the way Steve intended.
Oh? What does it do?
It replaces all Flash objects with the iPhone cube.
And every URL becomes a big WebObjects mess.
Unlike FlashBlock and similar plugins, it doesn't let you click to activate the Flash.
Yeah, but Flash is a thing of the past anyway
The future is full of HTML5 and partial standards compliance.
15:20
Not really, no.
If that is true someone spilled the past all over the present.
The future is 💩.
It's too late. W3 dicked around and now we have flash.
Yeah, that's the problem with the past.
It's always one second before now.
The real problem is that the need to control slows down the ability to innovate.
15:21
Gotta love design by committee.
@cat I'm back to my green icon? Do you see the default gravatar or a pic?
Even W3C doesn't take W3C seriously.
by the way
would it be a hideously bad idea to start altering the Bison skeleton?
Next version will be HTML💩.
@Xaade Some greenish geometrical stuff.
Hmm.... why is it borked
15:24
It's the old green identicon.
Guess the pic got deleted..... stupid internets
You know what, I think I'll bind 💩 to my keyboard layout.
You're going multicultural, right?
Btw, it was Google and Apple that requested the addition of POO, PILE OF to the Unicode standard.
I have AltGr+V free.
And AltGr+F.
And Y.
They wanted to cater to their Japanese crowd.
15:26
@CatPlusPlus How do you do that ?
And apparently, Japanese need special icons to write "shit" in their phones.
Apple needed a character that could describe their products in the full.
@kbok With MSKLC.
Using standard layouts is too mainstream.
my email reverted back. Don't know why. A user profile restore, or merging a profile?
btw, has anyone had any luck setting up a altgr-intl layout on windows ?
What does that mean?
My default layout makes extensive use of AltGr.
15:28
what's altgr?
The right Alt key. It's to the right of space bar.
To the left of the right Ctrl key.
@MartinhoFernandes It's a layout where you can type in accentuated characters by first typing altgr + an accent key such as ' , ` or ^
It's equivalent to Alt+Ctrl in Windows.
@kbok Oh, mine has accents are their own keys.
Annoying that is.
a
nope.... can't do it.....
How do you set that up?
15:30
You can use dead keys for accenting, but I don't know how customisable is that.
I use a us keyboard and switch to fr all the time. That's annoying.
And, well, it's annoying.
I use a PT layout and switch to US to write code.
user402642
Suppose ptr facbuf points to location 0, then does the assignment: *facbuf++ = p; write to location 0 or location 1?
15:32
AltGr+7 and AltGr+9 for { and } is 💩.
user402642
@Cat Thanks
@CatPlusPlus I had no luck using MSKLC to create a POO, PILE OF-enabled layout.
Why not? It doesn't support the whole Unicode codepoint space?
no one can figure out why a MFC editable combobox selects text whenever you move it.
This is awesome
.
Look at it from the bright side. You have discovered one of the unsolved problems in programming. ;)
15:39
Well, it only occurs if you've selected an item in the list. Then you have the GUI move the combobox for whatever reason (implementing anchoring in MFC). And the combobox receives a select text message out of nowhere (so it probably is coming from MFC buried code).
I can't stop it from happening, even after subclassing the edit.
Does selecting text activate the launch codes?
@kbok Why? It doesn't seem to fail validation for me.
And testing works, too.
why are you using MFC?
Probably not by choice.
Nobody uses MFC by choice.
2
15:42
@CatPlusPlus I have a dialog box saying "CL.EXE returned 1. RC.EXE returned 1. LINK.EXE returned 1." Very helpful.
@kbok Worksforme.
@kbok What are you compiling?
Oh.
> The problem is on a system with 8.3 file names (aka short file names) disabled -- since the default install dir is in "Program Files" and has other spaces in the app dir, the tool converts to short file names for the compile, which obviously fails when short file names are disabled. The workaround would be to install MSKLC to a directory that does not have spaces in the path.
Wait, you're not telling me that keyboard layouts are stuff compiled with MSVC are you?
@MartinhoFernandes Looks like it is ;)
It's a DLL apparently
15:46
It is.
Ok, it's probably just resources and boilerplate DLL stuff then.
Hence the RC.EXE.
It just generated 500K worth of installers, DLL, etc.
It exports KbdLayerDescriptor function, which returns a layout as a KBDTABLES struct.
I think.
@0A0D certainly NOT by choice.
ok
I have a grammatical problem, and I'm looking for a little advice
in "DeadMG++", then case statements can be expressions, which are evaluated at compile-time
15:50
gramagical
Use jQuery.
the problem is that type literals are also expressions
so you can use things like
case type : { stuff } : statements
and Bison is right that it's quite ambiguous, since case type : statements is also valid
case this->getType(): hmm
and what about run-time type info. Your case would be ambiguous for sure.
might just introduce double semicolon for one of them
Double what?
;;
?
15:53
method(interface A, interface B, interface C)
{ switch (typeof(C)) { case typeof(A): {} case typeof(B): {} } }
@DeadMG UB?
no, I meant, double colon
so instead of switch(something) case something : statements, I'd have switch(something) case something :: statements
@Xaade No, why would it be?
What if typeof(A) == typeof(B) ?
I changed the semantics of switch/case from what they are currently to being a simple == chain
Both cases have the same value.
then you did something stupid
15:55
That doesn't compile if checked at compile time.
@DeadMG So, it's just sugar (sweetness is debatable) for if-else chains?
yes
but also the compiler has the option of using hash or binary search if the types support it
or jump tables or whatever
I thought that case conditions have to resolve to absolute values.
they do, in C++
and they have to be integral, too
15:56
But not in your language?
nope
This is Madness!!!!
they don't have to be compile-time either, although obviously the compiler can't do much if they aren't apart from compare each for equality
Can't compilers "jump-table-ize" "switchable if-chains"?
Madness???? This is DeadMG++!!!!
15:57
I expect they probably can
Madness is overrated.
but the idea is that in C++, switch/case is pretty rarely used because it's so heavily restricted
whereas for me, then it's syntactic sugar, with a side order of optimization if possible
I'm not a big fan of the C variety of switch statements.
oh, yeah
in C++ you can do dumb things, too, like
You're fixing the problem with break right?
15:59
switch(expression) { do_something(); case 5: something_else(); } because it's just another compound statement
Implicit fallthrough, I mean.
yes, I am
now you can continue for fall-through
I hate the way C# "fixed" that: compiler complains if you don't break or return or some other jump.
And to fallthrough... goto case 42;
that sucks
Rob
Rob
16:00
To be honest I didn't mind the implicit fall through, I've used it a few times. :x
Not sure if that's a smell.
it can be fine, if it's very clear
but in the general case, it's a Bad Thingâ„¢
by the way
@Rob fallthrough can be useful, yes. It's just not what you want most of the time, and that's why it shouldn't be implicit.
I've also been considering dropping map and unordered_map and just having one single associative_container kind of thing
They're different things.
where if the type is hashable, then it'll be a hash, else it might be a BST if < is provided, else it'll just be linear lookups
16:02
Have different performance expectations
@DeadMG Why not let the user pick?
0
Q: URL inside parenthesis are not automatically hyperlinked

BrAvada KedavranSimilar to this question. While cleaning up some URL shortened links, I noticed that links are not automatically hyperlinked when enclosed in parens. For example, (http://meta.stackoverflow.com) and http://meta.stackoverflow.com <- properly hyperlinked. I imagine this has to do with the r...

I've nothing against that
@0A0D Interesting, here in the chat onebox, it works!
Rob
Rob
@MartinhoFernandes, I agree that it shouldn't be implicit... you think requiring an explicit continue; for fall-through would be preferable to C#'s solution ?
@MartinhoFernandes I know ! Weird...
16:04
Well, goto is more flexible than continue, but continue would be enough to make me happy.
I dropped goto for now, but I'll probably add it back in at some point
Rob
Rob
o_O
Ohh, a goto case -- I assumed goto line
Rob
Rob
Yea, that would be nice.
I think I'd still prefer if-chains, though.
More flexible.
Rob
Rob
16:07
I was impressed with Scala's pattern matching when I first saw it
well, switch/case is still only good for ==
you can't change the operator
Oh, but pattern matching is not at all like the C variety of swich.
Rob
Rob
I realize that, but it's so nice :)
I haven't seen Scala, but I like boo's pattern matching construct.
teatime
16:11
Looked at it. Yeah, Scala's seem nice.
Rob
Rob
Looking for a reference to Boo's right now :p
Docs are rather scarce :(
Aaaaargh
knowing-me-knowing-whatever has found the VC++ Team blog, and he's as stupid as ever there
Who's that?
he's changed his name a couple of times, I guess
Well, at least he's consistent with the stupidity, even if he's not with the name.
I'd rather inconsistency than consistently bad
nah, it is the same guy. There are comments on SO targeted at him using the same name
is how I just found his SO profile
16:31
We're not alone. We're together.
:P
we're all in this together
we'll go together when we go
glowing green with radiation, we'll all go together when we go
Rob
Rob
Anyone played with Go! at all?
I tried a few samples a while back.
But Windows support sucked at the time.
@Rob same, tried a few samples
Rob
Rob
Hmm, I'll have to look into it and see if Windows support has improved
16:36
I heard so.
I've not really looked to much at it
36
Q: Can Go compiler be installed on Windows?

user208987I've been looking on golang.org for a Windows compiler, but I can't seem to find it. I can only see Linux and OS X compilers. Does anyone know if Go programming can be done on Windows, or is it something that Google hasn't implemented yet?

Rob
Rob
Oh wow it has pointers
@Rob I believe it was written in C
But no pointer arithmetic.
So, it's more like mutable references.
16:38
So, I am going to order Effective C++ and Design Patterns, any objections?
DP sucks.
Or so I've gathered from my wanderings.
It mentions Singletons, and not in a rant written with the blood of weeping children collected at midnight of Summer solstice under the light of a full moon.
the only thing I know for sure about Design Patterns is that everybody orgasms over it and sees patterns everywhere even when they're utterly unnecessary
Design Patterns is the cause of those FooBazManagerFactories you see in Java
Yes, but I need to learn them anyway right?
@DeadMG Don't throw the baby away with the bathwater.. there are instances where design patterns are useful in modularity
You need to know their names to communicate.
16:41
So If an employer comes to me with that lingo, I know what he or his team is talking about
Rob
Rob
But looks like Go! doesn't have any constructs for immutability, hmm
It's good to know them so you can say "Ah, you can solve that with a template method" and get your message across in a succint way.
Yeah, that is my main reason to buy it
They're not helpful when you start to ask "What pattern should I use?"
I think I am "mature" enough in terms of programming to not be infected by hypes like that, just because the "cool kids" from java do it
16:44
@MartinhoFernandes We back to sex again, eh?
2
Well, go for it then.
Design patterns should be able to be automated
@CatPlusPlus Gosh. You're... right.
I heard that the C++ in Design Patterns is ugly.
It's from pre-standard times though.
I thought it was in Smalltalk
the code
I think there's a bit of both.
16:48
I've never ever seen a Smalltalk piece of code
You're not worthy.
I find Smalltalk environments to be silly.
You know what's worse than a crappy question?
Five crappy questions.
In one.
-3
Q: c++ header files problem

ASHISH NEGIQ1. do our c++ file in which we have main() should have #include "other_files.cpp" and not #include "other_files.h" Q2. my files are mostly templates ... error undefined reference to other_file_class :: constructor_of_class and also for other methods when doing #include "other_files.h" HE...

I see 4.
Tomalak edited it.
@MartinhoFernandes that made my head hurt
16:53
There was what seemed like an unnumbered one at the end.
At least it's not 4 walls of code annotated with "doesn't work, help".
it might as well be
Good old std::does_not_work_error.
I just love those kind of questions.
Here's 10000 lines of my code, and it doesn't work. EOQ
Rob
Rob
Hmm, speaking of Smalltalk
16:57
So, how's the weather?
Rob
Rob
Has anyone ever done Smalltalk message passing?
Oh, that kind of small talk.
Rob
Rob
:P
@Rob every time I tried the nuns smack me with a ruler so I eventually gave up
smacked*
Rob
Rob
Heh. An instructor used Smalltalk's message passing as an example of MVC, and argued that MVC is not used the same way now, in languages without message passing.
And the analogy was sort of lost on me.

« first day (283 days earlier)      last day (4891 days later) »