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

Als
7:00 PM
@RMartinhoFernandes: I am quoting from the page
 
no in another thread @AlfPSteinbach told noah that he shall stop trolling and calling "valuable C++ people" names or something like that
i think @AlfPSteinbach refers to that
 
@LewsTherin Vincenzo rocara scuarzalupi brancaleoni!!
 
Als
oh Valuable C++ People congratulations are in order :)
Darn why no one thinks I am valuable?
 
7:01 PM
@MrAnubis ok you won
what the hell is that lol
 
@LewsTherin a name of french guy from pink panther the movie lol
 
wow long name
 
Als
Oh wait let me check what happened to the thread @sbi started on meta about my problem!
I haven't got any updates about it in my lil box
 
@AlfPSteinbach seriously he just said "come on slut lemme put my dick into your mouth"
 
Testicles.
 
Als
7:04 PM
@JohannesSchaublitb: Why did he say that?
 
balls
 
Als
Oh no updates on my problem
 
ballsac
 
lol
 
Als
@LewsTherin: Shhh...you call porn, pron u better call balls bulls
 
lol
 
@Als you got the wrong guy lol
 
"In the cases of Paul and Noah that includes public ***ual harassement, posting
allegations about the ***ual practices of well known C++ authorities."
lol
 
@MrAnubis they always do that :P
 
@AlfPSteinbach BTW thanks I appreciate xD
 
7:05 PM
@LewsTherin lulz
 
Als
@MrAnubis: Oh did I, Too many kids on the loose here
 
Guys quick question : Should i wrap printf in critical sections in a multithreaded environment?
 
Als
Quick ansswer: Maybe
 
Have you guys seen this? youtube.com/watch?v=UF8uR6Z6KLc
It's actually really good
 
Maybe?
 
Als
7:09 PM
@user982723: Is printf thread safe?
 
Even knowing if printf is thread safe or not, it depends.
 
Als
@RMartinhoFernandes: Are you done editing, or should we wait?
lol
 
Did I mention I like edits?
 
I think it's thread safe since i removed the crit sects and the result was pretty much the expected 1-1 1-2 ..... 2-1 2-2
 
Als
@user982723: printf can never be reliable in multithreaded enviornment, why do you want to use it?
 
7:11 PM
Though most of the tutorials on the net do lock printfs
 
It might work on the architecture you have now, but on another it might not. It depends on the memory order as well.
 
@RMartinhoFernandes yeah :)
 
And whether it being threadsafe or not matters depends on what you're doing.
 
Alright then , i guess , since i can add pretty much 'unlimited' crit sects windows wouldnt mind if i added some more :).
 
Als
Frankly, I have seen too many weird behaviors while using printf in threaded enviornment atleast on Linux
 
Als
so, I would refrain from it.
 
@user982723 But the performance of your program will mind.
 
auto is c++11 isn't it? I don't think VC2010 supports it
 
You have to use memory barriers to be sure. I guess every critical section uses that. It would be strange otherwise
 
Nevermind the auto (but VS10 does support it). It's not the point.
 
7:15 PM
@user982723 it is supported in VS2010
 
The point is that even if printf were "threadsafe", it would not help in that code.
 
i guess microsoft is one step ahead
 
@user982723 Not really.
 
they added auto before being approved by iso , didn't they?
 
@user982723 Ahead of what/whom?
 
7:16 PM
Right, and they're not adding anything now that it's been approved.
 
c++11 is the name of the most recent iteration of the C++ programming language, replacing C++03, approved by the ISO as of 12 August 2011 // wikipedia
visual studio 2010 was released in ... well 2010
 
And we are in 2011.
Unless my time machine fired off accidentally :)
VS11 (2012) will have little more than VS10 has now. And the standard is now complete.
 
Als
I have a training tommorow...on saturday!
 
@Als Training of what?
Paintball?
 
table tennis
._.
 
7:20 PM
nice
i like that
 
Als
@RMartinhoFernandes: Linux Internals! And since the manager wants to take off I have to be there to supervise the team taking the training
:(
Processes is what they teach tommorow!
 
You'll be a supervisor and you're unhappy?
;)
 
Als
@RMartinhoFernandes: I am already a supervisor
i dont like being one on weekends
 
Als
lol
@RMartinhoFernandes: Haven't you read my profile anytime?
 
7:22 PM
"Technical Lead"?
 
Als
yeah Surprising I know, Thats me
 
Sorry, I don't understand suit very well :)
 
Als
suit?
 
@Als language used by those who wear suits.
 
Als
7:23 PM
I do not wear suits
I wear pants and shirts on formal days and casuals on weekends
 
"Suit" is a derogatory term for "management".
Because they usually wear suits.
FWIW, I was just joking, I wasn't trying to imply anything about you.
 
Als
I am kinda stuck in between being management and being development
I am more of in development rather
My previous job was more management
btw you work as @RMartinhoFernandes
 
@Als I'm guessing he's referring to the suit-oriented language in a typical resume. In a resume, you didn't "get some lazy moron to fix his unreadable, untestable, memory leak-infested code"; you "collaborated with the team to improve quality and enhance shareholder value", or some such crap.
 
Right, that!
 
today there was an interview and the question was "write the fibonacci function, using an iterative algorithm"
 
7:29 PM
@Als I'm not employed at the moment.
And, unfortunately, I'm still a student.
 
Als
@JerryCoffin: Oh right
 
they said you need three variables. but I think two variables should be sufficient
 
Als
@RMartinhoFernandes: Uhm? You used to be employed then
if i remember
 
Yes, until last month.
It was a temporary job.
 
I think it is enough to say int a, b; a = b = 1; for(int i = 0; i < n; i++) { b = b + a; a = b - a; } return b;
 
Als
7:31 PM
@JohannesSchaublitb: they were not trying to find a genius Johannes you know
 
Counting variables is meaningless. Make one of type std::pair<int, int> then.
 
What @Luc said!
 
Als
A normal sincere programmer must be what they must need
 
@Als no they did not say "you need three variables". but they said it can only be done with at least 3
but I think it works like above with two
 
@JohannesSchaublitb Sounds like one too many people saw posts about the number who can't write FizzBuzz correctly and memorized it, so the interviewers have moved onto another trivial one.
 
7:32 PM
lol
 
Als
lol
 
No variables: +>++[-<<[->+>+<<]>>>+]
 
I too thought at least 3 are needed but afterwards I noticed it works with 2
 
evening derps
 
Als
err...I have a Q
Isn't it irrelevant whether one can do it in 2 or 3 variables, As long as one can just do it in an interview?
 
7:34 PM
@JohannesSchaublitb std::tie(a, b) = std::make_tuple(b, a + b); if you're afraid of tricks.
 
@LucDanton That's... awesome.
 
Als
I am going to quote Scott Meyers on this:
"I hate anything that asks me to design on the spot. That's asking to demonstrate a skill rarely required on the job in a high-stress environment, where it is difficult for a candidate to accurately prove their abilities. I think it's fundamentally an unfair thing to request of a candidate."
 
@LucDanton nice one
 
I really use and abuse std::tuple these days. It's a really fun class.
 
7:36 PM
hmmm getting into tuple are we? :P
 
Pity the syntax is a bit tiresome.
 
when I'm in an interview I cannot think normally. i'm just too hip xD
 
@RMartinhoFernandes I don't usually use std::tie as it often involves separating definition from initialization.
 
Als
okay off for the day guys..have a good one
 
More inclined to do auto foobar = /* tuple from outer space */; auto&& foo = get<0>(foobar); auto&& bar = get<1>(foobar);
 
7:38 PM
/* tuple 9 from outer space */. FTFY.
 
Does "9-tuple from outer space" preserves the joke while adding some mathematical flair?
 
Possibly.
It's fine to make bad jokes about Plan 9, because it fits in the theme.
 
Hah.
 
Hey again guys
 
7:44 PM
Andrew Koenig opens for debate, drdobbs.com/blogs/cpp/231900107
"The problem--to the extent that it is a problem--is that someone who sees

a.erase(iter++);

is likely to think that it means the same as

a.erase(iter);
++iter;

even though the first form works and the second doesn't. Such subtleties always carry the risk that future maintainers will fail to grasp them. The point of the article is to invite discussion about how significant that risk is."
 
What are the advantages to having reference and value types, a la Java?
 
Ease of implementation?
 
@Maxpm Although everybody seems to deny it, I think Java got that directly from the idea of expanded types in Eiffel. Java was like Eiffel light, just with curly braces syntax.
 
Has anyone been taking some course in compiler design?
I'm thinking about taking the course next period
 
I had a "Language Processing" (rough translation) course.
We wrote some simple compilers.
Not idea if it covers the same things.
So, this guy asks a a question asking for a simple example of a lambda that escapes with a captured local.
I post a simple example.
And he complains it's too obvious.
 
7:56 PM
@RMartinhoFernandes What did you think about the course? Did it increase your general understanding?
 
Java AWT graphics are pretty painful.
"Here's a Graphics2D class. It has everything you need to do simple shapes and stuff."
 
@ManofOneWay Definitely. I loved it.
 
"Great! Wait, why can't I instantiate it?"
 
@RMartinhoFernandes Nice
 
@Maxpm Lemme guess, you need a factory.
 
7:57 PM
@RMartinhoFernandes We have a winner!
 
The teacher was very cool. And knowledgeable. That may have helped :)
 
what's a factory
 
"You need to get it as an argument to a paint() method."
 
@LewsTherin It's a pattern.
 
"Alright, where do I put that?"
 
7:58 PM
ok
 
"Well, you need to extend a Component and override it."
 
@maxpm: i think you could put the story on a page somewhere?
 
"Fine. But it's still not working."
 
so what happens?
 
"Oh, yeah, you have to add the component to a Window. And to let people actually CLOSE the window, you need to make a new class that extends a window adapter to act as a listener, and then add that so it calls back..."
 
8:00 PM
pretty much the same shit with me
 
Yes, we know how painful pattern orgies heavy APIs can be.
3
 
*Sigh*
So, to recap:
 
A C99 question: Is a char GUARANTEED to always be 1 byte?
 
@ManofOneWay C++ bytes are chars. I don't know about C.
 
Or is the requirement that it's AT LEAST 1 byte?
 
8:03 PM
In C++ a char has size one byte by definition.
 
@ManofOneWay You can check whether the size of char is an octet via CHAR_BIT.
 
@ManofOneWay I don't think so
unicode characters
 
I googled on it and some guy said,
"No, a character isn't guaranteed to be 1 byte. It IS however guaranteed to be AT LEAST 1 byte (see page 23 of the C99 Draft for proof). However, I've never seen "char" be anything other than 1 byte."

And I don't know what to tell from the draft,

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
 
In order to make a window with a rectangle, you need to make a RectangleDrawer that extends Canvas and overrides paint() so it can operate on a Graphics2D object. Now make a new Frame object in your main() method, and add the RectangleDrawer as a component. Also add a new class that extends WindowAdapter and overrides the window close method so it actually does something.
 
Unicode characters are 2 bytes...so maybe it isn't always?
 
8:05 PM
And don't forget to setVisible(true).
 
@LewsTherin unicode is 2 bytes right?
 
yeah
 
@ManofOneWay > An object declared as type char is large enough to store any member of the basic execution character set.
And the latest C99 draft is N1256.
 
@LewsTherin UTF-16 code units take 16 bits.
 
yeah 2bytes
 
8:06 PM
But you need 32-bits to store the whole shebangs.
 
A Unicode codepoint may be encoded as several UTF-16 code units.
A displayable glyph may be comprised of several Unicode codepoints.
(The madness stops at this point.)
 
"A displayable glyph may be comprised of several Unicode codepoints."
but I think that is only the crazy cases
a compound glyph
 
@LucDanton But that's exactly where the madness starts!
Case in point: Zalgo.
shivers
 
@RMartinhoFernandes I don't store the text in the application so I don't care!
 
If most characters are 1 byte (8 bits yes?), surely that would mean there can only be 256 characters?
 
8:10 PM
There can be zillions.
Egyptian hieroglyphics are part of the Universal Character Set.
 
@RMartinhoFernandes How?
 
@KianMayne That equation has unbalanced sides :(
 
POO, PILE OF is part of the Universal Character Set.
 
@LucDanton 2^8?
 
@KianMayne "most".
 
8:11 PM
But if it helps, ASCII is 7 bits. Not sure what exactly 'characters' refer to on either side.
 
@RMartinhoFernandes So the alphabet, numbers, and all the symbols - can they all fit without an extra bit?
 
"most". Not all.
 
But you're correct that you can't at the same time have every value of an octet represent a character and have other characters in your encoding. Pigeonhole principle.
Solution: encodings that have more than 256 characters don't use every value in an octet to represent a character.
 
Or they just stick 32-bits in it.
 
Wait that was correct(ish) the first time around. Stop tricking me.
 
8:16 PM
It's correct.
 
@RMartinhoFernandes link please
 
1
Q: example code of escaping lambdas

NoSenseEtAlI watched the cool clip: http://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2011-C11-Panel-Scott-Meyers-Andrei-Alexandrescu-and-Herb-Sutter and there Andrei(54:00) talks about escaping lambdas that take references to locals. In general I think I get the idea of the problem, but I'm not sure t...

 
@AlfPSteinbach Java doesn't have user-defined expanded types.
@JohannesSchaublitb When was your last interview?
 
@FredOverflow today! haha
but if you mean when I was last interviewed... dunno
 
@LucDanton Oh, is there really a std::tie? I thought that was Boost only.
 
8:20 PM
std::tie exists
 
It's a ghost.
 
@JohannesSchaublitb Just our of curiosity, can you post some interview questions?
 
std::tie, std::forward_as_tuple and std::make_tuple are the three helpers.
 
I will think of some
 
@LucDanton Thank you for mentioning that. I feel more educated having researched that
 
8:21 PM
some weird c++ quiz
 
hey
hey, do u know how can I give FIleSystem more GBs from other Hard disks in Ubuntu?
 
@KianMayne Well you did the reasoning all by yourself :)
 
@hey Not use Linux
 
@KianMayne That won't get him more GBs in Ubuntu.
 
hey
does anyone know?
 
8:23 PM
@hey I usually boot from an install disk/USB to manage that but possibly a preexisting install can use a utility directly. gparted maybe?
 
@RMartinhoFernandes Well it might: using a different operating system may lead to increased productivity which may lead to increased income which could be spent on higher capacity hard drives, hence more data storage from other hard disks
Admittedly, I had to knowingly misinterpret the question to come up with that
 
@JohannesSchaublitb I think in the case of Fibonacci, recursion leads to better readability. Also, you can wank off functional knowledge:
fibs = 0 : scanl (+) 1 fibs
 
hey
I have 500 gb
 
You stole that from Code Golf?
 
hey
and had only 150 used in windows
 
8:25 PM
yes and with functional programming languages, recursive notation is also not inefficient
 
hey
how can it disappear, jesus
 
because of ... what is it called again...
 
TCO.
 
8:25 PM
some fancy word for caching
 
@RMartinhoFernandes It's a well known code snippet, just like that subsets function.
 
no i mean the other thing
where you cache results
 
@JohannesSchaublitb tail call optimization
 
8:26 PM
Memoization.
 
@FredOverflow nope
 
@JohannesSchaublitb Note that the usual terminal recursive implementation of fibs uses two accumulators, which is what prompted me to use std::tie/std::make_tuple.
 
@FredOverflow right, but it's pretty silly to tell me that.
 
@JohannesSchaublitb What exactly are you searching for, can you describe it?
 
8:27 PM
1 min ago, by R. Martinho Fernandes
Memoization.
 
@FredOverflow what @RMartinhoFernandes says xD
 
@AlfPSteinbach You said that Java got the distinction between value types and reference types directly from the idea of expanded types in Eiffel. I simply don't see the connection, because there is no such thing as the expanded keyword in Java. Please elaborate.
 
so that when you call fib(5) and it returns something the compiler associates fib_5 with that result
 
@JohannesSchaublitb Haskell doesn't magically use Memoization by default, if that's what you think.
 
@FredOverflow why does it not use such?
it is pure
 
8:29 PM
It's very easy to write an inefficient Fibonacci in Haskell.
 
so it would be a very natural thing to do
 
@JohannesSchaublitb memory overhead?
 
ust like c++ compiles use memoization for template instantiations.
 
That's what disk is for, no?
 
Each function call with new parameters would increase the memory footprint at runtime.
 
8:30 PM
@FredOverflow oh
 
@FredOverflow i'm not sure early Eiffel had the expanded keyword either. "light" means removal of features.
 
hey
no, I don't need give more storage for file system
I need to give more storage for ubuntu...
how can I do that?
 
@JohannesSchaublitb Okay, but you typically don't instantiate a template with thousands or millions of different inputs at compile time.
Haskell programmers don't write functions that compute a particular value recursively; instead, they compute the whole list at once.
 
Like the definition you gave.
 
That's a kind of explicit Memoization, if you will.
 
8:32 PM
arghhhh, something in my PC is interrupting my music playing every so often
sooo annoying
 
@TonyTheLion Maybe malware?
 
how the heck does one figure out what it is?
 
One doesn't. One formats C: and reinstalls everything, typically takes less time.
 
@fred: if that wasn't clear, the value types in Java correspond to the expanded types in early Eiffel, the reference types correspond to the non-expanded types.
 
@FredOverflow Don't let the Cat hear you say that.
 
8:33 PM
@AlfPSteinbach What value types? The primitives like int and float?
 
@FredOverflow yes
 
I would say they just stole them from C.
 
@FredOverflow no, the type system is unlike C (but very much like early Eiffel). the syntax, however, is very C-based.
 
I don't know enough Eiffel for an informed rebuttal :(
 
8:34 PM
He's dead, Jim.
 
People tend to lump Java and C# with C because of the syntax. But the syntax doesn't really matter.
 
Oh, so C++'s syntax problems are actually irrelevant? Goodbye most vexing parse!
 
Goodbye typename and template (at least part of them).
 
@FredOverflow I already told you: T t(U { });!
 
@LucDanton that's most vexing parse solved
 
8:36 PM
Right.
 
what about T t(struct U { });
 
I don't think that will vex anyone.
 
it will be a function declaration
 
@LucDanton Right, and the most vexing parse is C++'s only syntax problem :)
 
but error out
 
8:45 PM
yikes I don't get this ragged arrays stuff double [][] a = new double[3][5] creates a 2d array of 3 rows with a fixed column of size 5. it returns a reference of the first element of the first row to a yeah?
 
I used a 2 dimensional array once. It broke my program
 
That doesn't answer my question :P
maybe you went out of bounds?
 
@LewsTherin There's no array decay in Java, so no it's a reference to a multidimensional array.
 
yeah..but the book has it drawn like that
I agree anyways
so how does this work double [] [] a = new double[3][]
does it create 3 rows? Or will it only create the rows on initialization
so a[0] = new double[3]
 
Don't know enough Java to answer.
I'd hazard the rows are left uninitialized.
 
8:52 PM
Yeah...it creates a 1d array which contains null at first
so a is a reference to 1d array which each elements in turn is a reference to an array in memory lmfao
 
(Type-wise it's still a 2d array, but I get what you mean.)
 
Yeah it is a 2d array
I'm moving too slow..I've to learn inner classes
 
@Lews Memory.as.a.Programming.Concept.in.C.and.C++
 
?
a book?
 
you can read about array deeply in that ebook
 

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