« first day (369 days earlier)      last day (4562 days later) » 

7:00 PM
Oh, Eclipse has "move this class to its own file" automatic thingy.
 
@CatPlusPlus Yep, You can start by createding an inner class, then double click the classname and press Ctrl-Alt-T for quicker access.
I've been working a great portion in Java for the last 3 months.
Try imagining how unworkable the language would be without the Eclipse conveniences.
@CatPlusPlus By your logic has anyone really been far even as decided to use even go want to do look more like?
 
@RMartinhoFernandes I just got back from the competition. We got second place ($250).
 
@Maxpm Nice :)
 
:D
I'm really happy.
 
@Maxpm What was the competition about?
 
7:06 PM
I'm not really good at programming competitions. It requires you to have a quick mind that allows you to hack a good enough design in a short time. That's really not my style. Kudos to those that are good at it though.
 
@SSight3 Programming, of course.
 
Knitting.
 
@Maxpm Obviously, but what was the task assigned?
 
@StackedCrooked Yeah, I pulled some hacks that I'll certainly lose sleep over.
for (int Foo = OuterFoo; Foo < SomeContainerSize;)
 
@Maxpm NOO NOO MEMORY LEAKS I DIDN'T MEAN TO REASSIGN wakes up What a bizarre dream I just had.
 
7:08 PM
No memory leaks after the process has terminated.
 
@SSight3 Teams were given six problems. Standings were based on who could finish the most, with ties settled by how long it took you. There was one bin-packing problem, a Conway numbers thing...
 
Inner enum in Java has no access to the enclosing object?
 
I can just imagine this giant, monster pointer growling because delete hadn't been called.
 
@CatPlusPlus Not unless you pass it as an argument to the constructor. (I think.)
 
@SSight3 C++ Fanfic, interesting.
 
7:09 PM
@Maxpm Sounds challenging enough. And most certainly already out of my depth.
 
If you have to use delete manually, you're doing it wrong.
@StackedCrooked Well, screw enums then.
 
@SSight3 I read something about a nightmare where you're stuck in an infinite loop on SO a while back.
 
@CatPlusPlus Seems like normal behavior. A C++ inner class can't acces it's surrounding class, can it?
 
No, but Java's can.
 
@Maxpm Well, in one dream, I was dreaming about how a function could determine what types I was using when I passed it. I thought it was such a fantastic discovery and it would revolutionise my whole C++ coding experience... but of course, I was just dreaming... if only.
 
7:12 PM
@SSight3 Er... Templates?
 
@Maxpm No, determines what types, as in, can tell if you just pased an int or float. Or something like that. It didn't make any sense after I woke up. All I knew was you assigned something in the function arguments.
 
@CatPlusPlus You mean that the inner class instance can access the enclosing instance? (I think I suddenly realize the difference between static and non-static inner classes.)
 
if (typeid(T) == typeid(int))
 
@StackedCrooked Yes.
 
@SSight3 Since the types have to match the function signature it naturally knows the argument types..?
 
7:14 PM
Apparently you can't make enums in such type at all.
Java is sometimes so laughable. Oh wait, no, it's always laughable.
 
@Maxpm That sort of thing actually exists? What. I always told that C++ couldn't do such trickery. What value does typeid return, if anything? Ooh, shiny!
 
@SSight3 Please don't actually use typeid unless you really need to, which you probably don't.
 
@Maxpm I won't. But it's curious to see something of the dream is possible. I wish... I knew what function I was even writing or what exactly I was improving. I sometimes see code on the walls when I wake up. They also don't make any sense.
 
It returns std::type_info.
 
@CatPlusPlus Can you use it to dereference things automatically?
 
7:17 PM
You can also do typeid(T).name(), which I believe is implementation-defined.
 
It sucks that typeid(T).name() returns a funny string.
It should return the actual name.
 
@Maxpm So basically, I dreamed code that is actually possible? Not that I could make any sense of it.
 
@SSight3 Probably, yeah.
 
@SSight3 What do you mean by dereference? You can dereference pointers.
@Maxpm It is.
 
@CatPlusPlus Like, convert a void * pointer to a type, perhaps as defined by typeid?
 
7:20 PM
@SSight3 You wouldn't use typeid for that, casts are compile-time constructs.
 
@SSight3 I asked that question on SO proper a little while back.
 
void* should generally be avoided, but what you're looking for is either reinterpret_cast<T*>(ptr) or static_cast<T*>(ptr). I forgot which should be used with void*.
 
Here's an Ideone example of typeid(): ideone.com/Tq9h7
 
@Maxpm Thank you.
@CatPlusPlus Okay.
 
Here's that question:
3
Q: Typecasting with type_info

MaxpmI've stored a pointer to a type_info object. int MyVariable = 123; const std::type_info* Datatype = &typeid(MyVariable); How might I use this to typecast another variable to that type? I tried this, but it doesn't work: std::cout << ((*Datatype)3.14) << std::endl; Using the...

 
7:26 PM
@Maxpm Intriguing posts. If I may be permitted, all classes just occupy a certain number of bytes in memory, correct? And I wouldn't need to typecast so much as use a class with 1, 2, 3 bytes etc respectively?
 
@Maxpm oh, you're confused about runtime versus compile time and type versus variable. that's a lot to untangle in one answer. so none of them managed it completely.
 
@AlfPSteinbach I don't think I'm confused. Maybe I was at the time. I don't remember.
 
you was
 
If you downcast using reinterpret_cast can it result in an invalid result even if you downcasted to the correct type? (Because of pointer offsets for subtypes.)
 
Why would you downcast with reinterpret_cast?
 
7:31 PM
Makefiles suck. The better approach is to write all code in single source file. You can use a userspace filesystem to make it appear as multiple files.
And it will link faster as well.
 
Not really, because then you can't parallelise compilation.
 
Even then.
Ok. It should be measured.
We should bet money.
 
And if you use LTO/LTCG, then it won't make much difference in linking time anyway
 
Also use SCons, not make, and suddenly it's not really a problem.
 
7:34 PM
If people want to show they don't care about something, why do they go to such lengths to make GIFs about it?
 
Which problem is gone with SCons?
Compilation speed?
 
Makefiles sucking.
 
@StackedCrooked yes
 
I've read a little about SCons and it seems nice though. I think it's cool it can do multicore compilation accross multiple directories.
@AlfPSteinbach Recently noticed that a colleague of mine used the "Java notation" for downcasting objects. In the C++ codebase.
 
Java notation? You mean C-style casts?
 
7:37 PM
Yep.
 
Smack him.
 
I would. But I'm too shy.
 
@StackedCrooked in addition to invoking reinterpret_cast that notation lets him cast to inaccessible base. smack him.
 
Hire someone to smack him.
 
And this is how bureaucracy was born...
 
7:38 PM
That's an idea.
 
I'm torn again. Should I work on that work thing that has supposed another deadline tomorrow, go to sleep, or play around with GL/FreeType.
Choices, choices.
 
Throw dice to determine you choice. And then decide on something else anyway.
 
Roll d20 to proceed.
 
Dammit my Chrome app went from 996 users to 991 users. I was hoping to hit the 1000 mark.
 
We need an 8-ball bot.
 
7:43 PM
There's an iPhone app for that if I remember well.
 
I don't have or want an iPhone, so meh.
There are web apps for that, but then again, I'm too lazy. We had an 8-ball bot back on IRC. :<
 
@CatPlusPlus There's an app for that too.
 
user457812
FreeType is pretty fun to play with
 
We used to have an irc bot at work. We could make it speak though an electric rabbit.
Nabaztag, I always forget the name.
Everytime a woman entered the office someone made it say: "You want to fuck?"
 
Do want.
Is it cheap?
 
7:46 PM
Dunno. Probably.
 
Or is it one of those that are actually cheaper to buy as raw parts?
 
Around 100-150 EUR
Kind of expensive for what it is.
 
user457812
@StackedCrooked I have one of those
 
user457812
Don't think I ever got it to work
 
i've got a c question if anyone could help
 
8:01 PM
@Questioneer: Not sure how much help I can be, but try it anyway.
 
@sbi I wouldn't call Java or C# "toy languages."
:1717001 I forget: Does reply time traveling work?
Apparently not.
 
@CatPlusPlus Have you've been working within the C-code of CPython?
 
Oh, the message ID is different. It looks like IDs are global, not by room.
 
@ManofOneWay You mean the API or the internals?
 
@CatPlusPlus Internals
 
8:09 PM
@Maxpm Yes. But even if you guess, you need to edit the message for it to render properly for others.
@ManofOneWay Nope.
We've got 1000000th, soon we'll be getting 2000000th.
 
How extensive is the Stack Exchange API? I don't suppose it lets you post chat messages, does it?
 
sbi
Oct 15 at 19:03, by sbi
What I hate about C# is that I feel like Anders is holding my hand all the time, gently nudging me to go the ways he paved for his flock, trying to prevent me to stray from the few true paths. C++, OTOH, is pure freedom. Bjarne created a powerful monster, and he not afraid to let me ride it wherever I want to go, being certain it will survive anything we might encounter.
 
No, it's read-only.
Though they're planning to do auth for 2.0, I think.
 
sbi
@sbi Actually it does. I have no idea what you wanted to do with that link, but the only problem with it is that it doesn't link to a question in this room.
 
Hmm.
@sbi It didn't ping someone in another chatroom, did it?
 
sbi
8:13 PM
@sbi If you know a future message id, you can link to it.
 
sbi
@Maxpm I don't believe this works.
 
Ignore this, as well.
 
sbi
@Maxpm That's a hard philosophical dilemma. because, if I ignore this, I don't get to read that I should be ignoring it.
 
I once heard an interview with Anders on se-radio and I didn't find him to be very likable.
 
sbi
8:17 PM
@sbi This works, too, if you only add some text behind the number.
I suggest you now take any further experiments to the sandbox. We've been through this a long time ago and don't need it.
One more hint, @Maxpm: You can edit your old messages. I thought this was well-known, but since it seems to have escaped you, you might want to read the newbie hints.
 
what's with all the monologue in this room?
 
Hi me!
 
sbi
Anyway, I'm off to bed now. Good night, folks!
 
@Maxpm Congratulations!
 
@RMartinhoFernandes Why, thank you. :)
@sbi I'm aware. I didn't want sbi's philosophical dilemma to look stupid.
A Dart "Hello World" program that "compiles" to almost 18,000 lines of JavaScript.
 
8:31 PM
We know. So what? jQuery + jQuery UI is about or even over 20k SLOC.
Nobody seems to have noticed.
Prototype + scriptaculous was probably even bigger than that, and people still used it.
 
I suppose the deployed versions were minified.
 
This can be, too.
 
20K LOC seems like a significant overhead to page size.
 
Abstractions over other kinds of abstractions to get an interface closer to the abstractions under those abstractions...
 
The output of Dart doesn't need to be minified.
It's not to be sent over the wire, it's to be generated on the client.
(At least that's what the guys at Google dream of.)
 
8:34 PM
@RMartinhoFernandes I imagine a manager yelling: "No. It has to be maximized!"
 
Dart is meh, but complaining that it compiles down to 18k SLOC, when 99.999999% of that is library boilerplate, is lol.
 
To how many lines does a program that outputs "Hello world!" twice produce?
18k+1?
 
@RMartinhoFernandes Probably, yes.
 
Our app has about 50k SLOC of combined JavaScript (with all libraries).
And that doesn't count libraries loaded from remote, like Google APIs.
 
I'll be right back; I want to see how many lines of asm a "Hello World" program in C produces, and then one in C++.
 
8:37 PM
About 20.
 
@Maxpm Someone did that in the comments with GCC, a little over 200
 
@CatPlusPlus It's not really S LOC if that's what it's compiling to, is it...?
 
But it won't have the libraries included.
 
Compiled in debug mode?
 
@Maxpm Details.
 
8:38 PM
Sure. Debug, with no explicit optimizations.
 
That's a silly comparison.
 
libc + libstdc++ is probably around several MB.
 
Plus, no one compiles without optimizations.
 
13 months later: Google discontinues the Dart project.
 
Well, you could optimise for size, disabling inlines and stuff.
Not that the code size matters too much.
 
8:40 PM
Oh noes but bloat blah blah blah
See, I used the word "bloat" there.
 
I think we can all agree that JavaScript is higher-level than assembly, anyway. The point is, something compiling to JavaScript should naturally output less lines of code than something compiling to assembly language.
 
apples and oranges, really
 
It outputs one line of code.
The rest is standard library and runtime support.
 
68 lines for C.
 
Not counting standard library and runtime support.
 
8:44 PM
377 for C++.
 
Text file with no wrapped lines, really?
 
Yeah :D I copy pasted it to a text editor...
 
So I found a tty file in my home folder. Its contents:
SHIT
asdfa
sd
fasd
f
I really have no idea.
 
sbi
 
8:55 PM
@DeadMG Have you any place to stay at now?
 
> It's called Accessibility, and it's the most important thing in the computing world. The. Most. Important. Thing.
Stevey never fails to entice.
> But I'll argue that Accessibility is actually more important than Security because dialing Accessibility to zero means you have no product at all, whereas dialing Security to zero can still get you a reasonably successful product such as the Playstation Network.
 
> One of the team members marched in and told me about it when they launched, and I asked: "So is it the Stalker API?" She got all glum and said "Yeah." I mean, I was joking, but no... the only API call we offer is to get someone's stream.
 
Accessibility may be the most popular thing in the computing world, but certainly not the most important.
I'm not going to write a C++ tutorial to accompany my library.
 
9:27 PM
^ I like.
 
9:38 PM
room topic changed to Lounge<C++>: One templated rvalue reference to bind them all [c++] [c++11] [c++-faq]
 
@CatPlusPlus Do you know how frame objects work in Python?
Or any other Python guru here?
 
What do you need that for?
 
I need to understand the structure of byte code interpretation
Let's say we have a code block, for example a function body
That code block will be executed in an execution frame.
Is that the same as a frame object?
 
Generally knowing exact CPython internals isn't very useful. If the documentation in the code is not enough, then you probably should try Python mailing lists.
 
Well, it's useful in the sense that a course I'm taking right now is all about editing CPython internal code. The bad part is that the CPython project is poorly documented, and it's more than 500.000 lines of code
 
9:52 PM
What course is that.
 
It's called Large Scale Programming
It's very bad
very very bad
 
Well, choosing C for large scale programs is usually bad.
 
Sure, but the course is all about communicating and all that shit. You are assigned teams of 6 people, and then you should co-operate to succeed
as usual, 3-4 of the students are not doing anything
1 dropped
I hate these assigned team courses
 
They're designed to be hated.
 
And loved by students that sucks
 
9:58 PM
Ideone is being a slowpoke again.
 
10:14 PM
imagine that
 
10:31 PM
I'm soo soo sorry but I have to ask again
hi all btw
I was told that a class always has an implicit member initializers list, if one wasn't explicitly declared.. is it for every variable?
 
I'm not sure but I think scalar members (or is it PODs?) are not initialized.
Also, narrowing conversions are blowing up my SFINAE.
 
what is SFINAE
 
Can I hope it is a GCC bug?
@LewsTherin Oh, nothing about your problem. It's a template meta-programming technique.
 
ah ok
That sounds ugh..whenever I hear it
Substitution failure is not an error ? :)
 
Yes, that's it.
 
10:42 PM
lol, I won't ask what that means...
In this code : ideone.com/MjW25
If I hadn't specified the initializers lists, would the compiler write one for me to create every field?
 
Not for the int.
Also, you could have initialized the string in the initialization list.
 
Why not?
 
No idea. It's a nasty "feature".
 
So when is the int variable created? Because that was what I asking before...if it isn't done by the compiler....
 
10:44 PM
@RMartinhoFernandes Which list the second or first?
 
Look at line 9.
I'm initializing the string, but not the int. The int gets garbage.
 
It also doesn't do for the string :(
 
The string gets null ... I guess
 
The string gets initialized with the default ctor, which makes an empty string.
There are no null strings in C++ (thank god!).
 
10:46 PM
So a string never references a null value?
So it is actually string("")
 
More like n(), but the result is the same as n("").
@LewsTherin Never, a string always as a valid value.
 
Oh cool, so when is the int created if not in the initializers list?
 
See? The string gets empty, and the int gets garbage.
@LewsTherin The int is there, it's just not initialized.
You can initialize it later: ideone.com/HeF0P
 
@RMartinhoFernandes But I thought the fields were created on initialization. I'm trying hard to imagine it.
 
But it's usually better to initialize things in constructors.
@LewsTherin Yes, the space for the members is there, but no value is set.
 
10:51 PM
I'm sorry but that doesn't make any sense to me
I was told that the declaration field wasn't executable code, true?
 
Right.
int main() {
    int x;
    std::cout << x;
}
What do you expect this to output?
 
@RMartinhoFernandes Random crap... stack value
 
The same thing happens with the int member.
Wait, maybe this was a bad example. Damn.
 
lol
@RMartinhoFernandes In your example I understand that space is created for x, but not initialized to anything.. but in a class declaration... it doesn't still make sense... How is space created for x or the pod?
 
The same way space is allocated for everything else.
On the stack it might be just something like (pseudo-assembly) %esp += sizeof(A).
On the heap it's probably more complicated, but it's something like looking for a free space large enough for an A, and marking it occupied.
The mechanism is not really important.
 
10:58 PM
So when you guys mean created... it means giving it an initial value.
 
Initialization is done after the space is allocated.
 
I just realized I've been passing a C function a null pointer. I wonder why it didn't segfault...
 
@RMartinhoFernandes Now that makes sense
 
And for the int class member, no initialization is done unless you ask for it explicitly. I have no idea why this is, but it's probably the usual "don't pay for what you don't use."
Though I think in this case, it's a bit silly.
 
mmn, although your explanation makes sense, if the declarations aren't executable how does it know the space allocated?
 
11:00 PM
The compiler knows the size of every type.
You can ask for it with sizeof(T).
When you declare struct T { int x; int y; }; the compiler will compute the size of T considering the size of each member.
 
What's the "safe" way to do printf() with just a string, again? Just printf("String literal", "")?
 
@RMartinhoFernandes That's what I am wondering, how would it know for a class/struct declaration as its fields are non executable code?
@Maxpm What do you mean?
 
@Maxpm printf("String literal");. Don't do it with non-literals.
@LewsTherin The declarations are there in the code!
 
@RMartinhoFernandes So printf("Foo") is fine, but printf(Bar) is not?
 
11:04 PM
The compiler uses them to compute the size, but doesn't generate code from them.
 
@Maxpm no
 
@Maxpm Right. Imagine if Bar is actually "%d %d".
 
@RMartinhoFernandes well in that case it should work?
 
@LewsTherin printf() can be a security vulnerability if you pass it a source string without a format string.
@RMartinhoFernandes Ah, makes sense. Thanks!
 
@LewsTherin No! It will be nasty, because there are no arguments to get the values from!
 
11:05 PM
@RMartinhoFernandes does that mean sizeof(T) is calculated at compile time? or does it use a way to keep track of the sizes?
@RMartinhoFernandes Um, of that done that before... and it worked.. UB? lol
 
@LewsTherin It's calculated at compile time.
@LewsTherin Yes, UB. At best you get a crash. At worst you get an attacker.
 
@RMartinhoFernandes Can I ask how you know all this stuff? They aren't in the books
 
Er, I don't know, I've been reading and learning.
Just like you are now.
 
@RMartinhoFernandes It didn't crash :( I just did char *s="%d" ; printf(s,10);
 
@LewsTherin But that's not what he was doing!
char const*s="%d" ; printf(s);
 
11:08 PM
@RMartinhoFernandes Oh yes that's bad for sure .. I believe it just replaces %d with garbage though
 
It will do more than that.
It will pop stuff out of the stack.
More than was pushed.
Really, it's best to just not do it.
 
@RMartinhoFernandes But there won't be stack corruption will there? Cause in case of vararg functions the caller pops the stack, not the callee
 
cpx
UB == nasal demons? or something more worst?
 
Yeah lol. I don't see why anyone would
 
At least I believe that's how it works
 
11:10 PM
@RMartinhoFernandes thanks for clearing all that stuff for me
 
@Praetorian Oh, maybe. I really don't know many details about calling conventions.
If it's sprintf though, it's even worse.
 
what does that do again...mess with the file?
 
sprintf writes to a buffer.
 
I don't either, but just intuitively, it seems that it maybe impossible for the callee to pop the stack when it comes to vararg, because you could push more arguments than number of format specifiers
 
And a buffer overflow is an easy exploit.
 
11:11 PM
oh that's fprintf ..
 
@Praetorian Good point.
In Template-Haskell you can write a fully type-safe printf.
 
Should my master branch be the development branch or release branch?
 
Whatever you prefer.
It's just a matter of naming.
 
No convention?
 
You don't even need a branch named master.
 
11:16 PM
@RMartinhoFernandes Do you rock at Python?
 
So you could just have dev and release, no master.
 
@RMartinhoFernandes The first one has to be called master. You can't rename/move something that doesn't exist, and for it to exist you need to make the first commit.
You can, of course, rename it after that.
 
But it looks icky in the history, and it might not be worth it.
 
Branch renames do not stick in history (I assume you're talking about git).
@ManofOneWay Not really. I have only wet my feet with it.
 
11:18 PM
@RMartinhoFernandes So if I have a branch called Foo and rename it several commits later to Bar, it'll always just show up as Bar? And yes, git.
 
A branch is a just a pointer to a commit.
When you commit something to branch Foo, you're moving that pointer up.
If you renamed the pointer, the history doesn't change.
 
Ooooooh.
Thank you for the explanation.
 
A git repo is just an amalgamation of commits. Each commit can point to one or more (or zero for the first one) other commits as ancestors. And you can have movable pointers to various commits in that amalgamation: branches. You can also have fixed pointers with info attached: tags.
Some commits kept in the repo have no pointers to them, so you can't access them unless you know their hash. These are left there when you use history-changing commands, like rebase (which basically creates new commits with different ancestors and leaves the old ones around).
From time to time a garbage collection runs to remove these orphans.
There's also a command to list them so you can recover something you lost accidentally, if it wasn't collected yet.
 
11:42 PM
Um in Java evt.getSource() returns a reference to the button or component the action was performed on right? assuming evt is an ActionEvent object
 
so it does return a reference... but I can't access the component functions ... it blocks me out. evt.getSource().getText() ?
 
Ugh, yes.
Uggggh...damn it
How could I miss that
@RMartinhoFernandes Thanks
AH DAMN IT HOW COULD I MISS THAT? :( I'm going to sleep
goodnight @RMartinhoFernandes
 
Good night.
 

« first day (369 days earlier)      last day (4562 days later) »