« first day (422 days earlier)      last day (4508 days later) » 

Xeo
5:00 PM
/facepalm
 
sbi
@RMartinhoFernandes I couldn't hold back:
@cliffski Oh boy. The STL is a framework, an _idea_, that embraces fixed-size arrays the same way as std::vector or std::list. Read a book.
Now a bunch of twittering game programmers will already be grinding their pitchforks.
 
Xeo
That cliffski guy doesn't have boost, huh? boost::array
or a C++11 library
 
sbi
@Xeo No! That would be STL again, and soooo much slower!
 
or just plain std::vector
djeezes
 
Xeo
@CatPlusPlus Though. cin.sync() oughta work to.
 
5:03 PM
He had some funny replies.
@cliffski i almost always use fixed arrays, maybe im oldskool, but i like static memory!
 
sbi
@RMartinhoFernandes Well, with that user name...
 
@Xeo Dunno, I rarely use cin.
 
Hello, everybody
 
sbi
@RMartinhoFernandes I thought that, since I had once put my foot in...
@TomNullpointer Yeah, and with all the buffer overflows caused by using fixed-sized buffers, us programmers will never be unemployed. #fail
 
Xeo
5:09 PM
0
A: Call function with parameters extracted from string

XeoThis is generally not that easy to accomplish. I wrote a little wrapper class around std::function once that extracts the arguments from a std::istream. Here's an example using C++11: #include <map> #include <string> #include <iostream> #include <sstream> #include <fun...

Mwahaha
 
@sbi I'd upvote that if I could.
 
sbi
@RMartinhoFernandes On Twitter, you do this by retweeting it.
 
I have a silly question. For example I can do this:
cv::Mat dstMat;
cap.captureFrame(dstMat);

// converting cv::Mat -> IplImage
IplImage dst;
dst = dstMat;

And it works, but I need to work with IplImage* type.
I've tried:
IplImage* dst = 0;
dst = &dstMat;

and it doesn't work. What is my mistake? Why I can't assing to IplImage* variable & of other variable?
 
Xeo
Did I mention I love variadic templates?
@Innuendo & returns a pointer, simple as that.
 
if & retunrs a pointer, than it should be ok. in the second example dst is of pointer type ( IplImage* )
 
5:11 PM
just because b = a works does not mean that b* = &a should work, at all
when you do dst = dstMat; that involves a conversion function
which will not be called in the case of the pointer
so the compiler correctly tells you that you've done itwrong
 
The type of &dstMat is cv::Mat* not IplImage*.
 
Xeo
Oh, wait, I overlooked part of the code
 
This is what the "programming" section of my local library looks like.
 
Ah, library.
 
Four more shelves of the same shit.
 
5:13 PM
so, there is written convertion function of cv::Mat in IplImage, but not from cv::Mat* to IplImage* ?
 
Its a branch of a major metropolitan library, and there are no C++ books system-wide
 
@Innuendo Exactly.
 
searching "c++" in their index is impossible, it's broken
 
Ok, I understood - thank you
Thank you guys, good luck!
 
sbi
@keithlayne Seems to be a library for dummies. :)
 
5:15 PM
Even in the library in the armpit of the earth where I used to live there were real programming books
@sbi Don't worry, I got your joke
It's annoying, the bookstores are the size of a Walmart here and the shelves are pretty much black and yellow in the computer section
And a lot of the good C++ books are not yet in eBook format.
 
sbi
@keithlayne I dunno. I don't think I get a good C++ book in the general bookshop I frequent in the shopping mall around the corner. I'd have to order it online.
 
Xeo
I was slightly surprised (positively) when I found "Effective C++ 3rd Edition" in my schools library
 
I would expect that the university library would be much better.
I won't have access to that for another month however.
Are they marketed in your country with the title "X for Merkins"? :)
 
I have an awesome picture along those lines, gotta find it
 
Xeo
5:20 PM
afk catching some food
try{
  throw food("apple");
}catch(food& f){
  eat(f);
}
 
nomnom
 
sbi
@Xeo apple up; throw up;
 
Xeo
@sbi "Best code comments" thread on SO
throw up; // ha ha
 
sbi
@Xeo Yeah, it was there, too, but I think I had seen that before.
 
@sbi Right, done.
 
sbi
5:28 PM
@RMartinhoFernandes I know. :)
 
50% sale on GOG on almost everything.
 
I'm baffled by the shitty quality of my phone's camera.
 
Yay, I've now bought a new 72 pin connector for my NES
 
I always knew it sucked, but now that I've actually tried it once...
It hurts the eyes.
 
Xeo
I wonder if coders are masochsits by definition. I mean, we enjoy something where we get denied by the compiler again and again.
 
5:30 PM
I could probably make a better looking painting.
 
sbi
@RMartinhoFernandes You're not supposed to poke it into your eye, you know?
 
@Xeo No, it's just those doing metaprogramming in C++.
 
sbi
@CatPlusPlus Doing template meta-programming in C++ is well beyond masochism.
 
Xeo
> [3] inform moderator flags remaining
 
That is not what they're called here.
 
Yay, green pixels.
 
@sbi This is how a photo from it looks.
Maximum quality settings.
 
Xeo
@RMartinhoFernandes That looks like my 0.3megapixel webcam from 6 years ago!
 
sbi
@RMartinhoFernandes You need to let a little light into the room when taking pictures, you know?
 
I didn't upscale anything.
 
5:32 PM
Oh, there are books in there.
 
the sci-fi shelf?
 
@sbi The room is lit!
 
sbi
@keithlayne Known Space.
 
!!room!!
 
lol
And there's a light flash thingy in the phone, just in case.
 
sbi
5:34 PM
room topic changed to Kitchen<C++>: Today: Grilled newbie with dummy sauce. [c++] [c++11] [c++-faq]
 
I'm torn between going to the shop and not going to the shop.
 
sbi
@CatPlusPlus What's that mean?
 
Room on fire.
 
@sbi Fun.
 
sbi
5:35 PM
@RMartinhoFernandes Yes?
 
@sbi "!!room!!" = "room on fire".
It's Dwarf Fortress notation.
 
Do you guys have "Cool American" Doritos?
 
sbi
@RMartinhoFernandes I understood this, but I wonder where it's fr... Never mind.
 
If I go to the shop, I'd have to go the ATM, too.
More things to do. I don't like that.
 
5:38 PM
Anyway, my copy of Ringworld finally arrived, so now I have an almost complete collection of Known Space books (I'm missing Neutron Star which is out of fucking print). I wanted to take a picture of my shelf, but my phone's camera sucks.
 
sounds like ringworm
 
sbi
@keithlayne "And you know what they call a Quarter Pounder with Cheese in Paris?" "They don't call it a Quarter Pounder with Cheese?" "Nah, man, they got the metric system. They wouldn't know what the fuck a Quarter Pounder is." "What do they call it?" "They call it a Royale with Cheese."
 
Metric system FTW.
 
@sbi I didn't know you were black.
 
sbi
5:40 PM
@RMartinhoFernandes Wait. You hadn't read Ringworld?
 
@sbi I had. I didn't own a copy :)
 
sbi
@keithlayne Huh?
 
I'm just picturing a bonobo quoting Samuel L. Jackson. It's a compelling image.
 
sbi
@RMartinhoFernandes Ah. It's a tick of mine, too. I want to own the books I have read and liked.
@keithlayne If you're talking about image, you need to picture a gorilla. Sigh. Did I ever mention I resent I told that story? I should have kept it to myself.
 
And reading them before I own them has the advantage that I don't have to take care to keep them in a near pristine state!
 
5:43 PM
lol at new chat room title
:P
 
@sbi I don't know that story.
 
sbi
@RMartinhoFernandes I don't mind books looking like they were read anymore.
 
@sbi Are you calling Mr. L. Jackson a gorilla?
ebooks forever remain pristine
 
Ebooks don't have trees in them.
 
sbi
@keithlayne Yeah, that's the problem. You newbies here are picking up fragments of a story you never heard about and think my avatar is a bonobo. That's so ridiculous.
 
5:45 PM
You can't put e-books on a shelf.
 
I know it's a gorilla.
 
sbi
@keithlayne Yeah, but they don't make your room looking lived-in.
@RMartinhoFernandes You were faster again.
 
@RMartinhoFernandes virtualization is all the rage. Mine are on a virtual shelf.
 
sbi
@keithlayne Well, then, if you picture me, you need to imagine a gorilla, not a bonobo.
 
You seem much more bonobo-ish, always talking about family and all.
 
sbi
5:46 PM
@keithlayne So your ebook reader looks lived-in. Nice, but over here we live in apartments.
 
Also on GOG, free Empire Earth.
 
@sbi it's not even in the reader. It's on a virtual shelf in teh cloudz. Sounds heavenly.
 
sbi
@keithlayne It's not like gorillas didn't have families. What differentiates bonobos from the rest of the apes is their enthusiasm for sex. With you being a Merkin, I fail at imagining you seeing sex as family value.
@keithlayne You keep living on your cloud. I prefer my apartment.
 
@sbi Actually I know very little about bonobos, I just remember reading at the zoo that they're very family-oriented. Pretty sure they still fling poo though.
 
5:50 PM
Ow.
 
sbi
@keithlayne "Family-oriented"?! ROTFL! They are sex maniacs, plain and simple. They resolve all their disputes by sex, and we're not only talking hetero vaginal sex between adults here. Male, female, old, young — these guys know how to have fun with each other. Shakes head. Only Merkins would mask this as "family oriented".
 
"you know, for the kids!"
So they're like prison gorillas?
 
sbi
@keithlayne If you want to prevent your kids from seeing apes doing this, you cannot have bonobos in the zoo. You cannot stand five minutes in front of their cage without seeing them copulating.
@keithlayne What's a "prison gorilla"?
 
a gorilla who was convicted of murder?
 
5:56 PM
My next trip to the zoo will be more interesting now, I'm sure.
 
or fraud
that gorilla at the end cell, he ran a Ponzi scheme
scammed the other gorillas out of shittons of bamboo
 
> Bonobo males occasionally engage in various forms of male-male genital behavior. In one form, two males hang from a tree limb face-to-face while "penis fencing".
 
sbi
@keithlayne Be sure to prepare your kids. See youtube.com/watch?v=82GUjPConiE. (First classic scene after only 30secs, and it gets down/uphill from there.)
@keithlayne And did you read about gg rubbing?
 
OMG bonobos have ginormous balls!!!
 
Ugh.
@sbi What's "gg rubbing"?
 
sbi
6:05 PM
@keithlayne They are generally bigger for promiscuitive species. And bonobos are the very definition of promiscuity.
 
wikipedia bro
 
sbi
@RMartinhoFernandes See here.
 
@sbi This has been truly educational. Those guys don't waste time when they get down either.
 
The newbie. how does he taste
 
We saved the balls for you.
 
6:09 PM
Lol
 
hello habibi
 
@Pubby habibi? u know arabic?
keif halik?
 
sbi
@keithlayne Chimpanzee groups are patriarchal, and very violent. Conflicts are "solved" by brute force, clever politics (like a weaker male overthrowing the boss with the help of an ally, which will then get special rights under the new boss), and they don't hesitate to kill for political ascend. When you give food to chimps, it's all scream and murder. With bonobos that's very different.
Their societies are matriarchal, the females are in charge. When you hand them food, they start an orgy to ease the excitement, and after that the females start to hand out the food. If they get into conflict, it's fornicating again. Frankly, I find that very re-assuring. We are not the violent apes with a thin film of culture our violence. We also share genes with Make-Love-Not-War relatives.
 
user457812
6:13 PM
What's up for lunch today?
 
@IntermediateHacker No hablo arabic
 
Everyone knows "habibi".
 
hablo arabic???
 
user457812
@IntermediateHacker He's using Spanish there. -_-
 
user457812
Well, sort of.
 
6:14 PM
oh. i didn't know spanish and arabic were similar.
 
user457812
I highly doubt they are.
 
> 85,9G of 451,4G free.
Waaah.
 
there's a tasteless joke in there somewhere that I'm fighting to keep in.
 
sbi
@CatPlusPlus Accidentally deleted all your porn?
 
6:15 PM
I don't keep porn, that's silly.
 
sbi
@keithlayne In where? (If you guys would only properly reference what you're replying to, this world^Wroom would be a much better place.)
 
@keithlayne please share it with the class.
@CatPlusPlus maybe u just keep filesystems.
 
 
sbi
@IntermediateHacker I don't think the @Cat is as straight as that.
 
@sbi I think it was clear what I was referring to. (see how I referred to the wrong post there?)
 
6:18 PM
@sbi lol. u call getting turned on by filesystems straight?
 
Maybe I should move Steam to external drive.
 
sbi
@keithlayne Not clear to me. I have no idea whether you see a joke in what I wrote, Spanish believed to be similar to Arabic, or in "XG of YG free".
 
Lol, check out the Body Rule.
 
sbi
@IntermediateHacker "Comparatively" is the term here.
 
6:20 PM
@sbi lol. I always knew cats had issues.
 
To most in here the body rule should be "then read docs of std::vector"
 
@sbi It was about Arabs and Mexicans
@JohannesSchaublitb now that's just dirty
 
Wow i shall stop using the SO chat on the phone
 
@keithlayne what was the joke?
@JohannesSchaublitb SO doesn't work on my phone. I have Symbian.
 
The the ajax traffic it makes is just perv
 
6:26 PM
It wasn't a fully formed joke. It was just a fetus.
 
ok, now I'm really curious.
 
The quote counter counts up like crazy
Quota i mean
 
whether or not jokes are alive yet at conception is up for debate
 
suspense .....
 
It's using pull model with frequent polling for some reason, instead of long polling and push.
 
6:28 PM
@JohannesSchaublitb quota?
 
@CatPlusPlus FWIW, it's convenient on a bad connection like mine to get the warning that I've recently disconnected.
 
so I asked this earlier, but I'm wondering why boost doesn't have a bignum library? Seems like a really useful thing, and one that is often hand-rolled, and the GMP interface for C++ leaves something to be desired IMO.
 
I guess someone just has to step up and do it
doing it right is not easy, nor fun
I think lots of boost was just fun, experimenting with the language to solve common problems
bignum is kind of specialized IMHO
 
bignum requires assembly, which GMP can do but Boost cannot, unless it links to GMP, which would be bending the rules quite a bit
you'd be better off contributing an alternative wrapper to GMP and hoping it's adopted
 
boost can do assembly
 
6:43 PM
Yeah, I'm not so up to speed on Boost licensing considerations
 
see the Boost.Context library for example
 
I think it would be a step in the right direction to have a correct C++ bignum library.
 
If I need bignum, I use MPIR.
 
@Mankarse I suppose, with a LOT of #if's. It certainly wouldn't be fun.
 
I think it would be a great addition to the standard library
 
6:45 PM
I don't remember last time I needed it, though.
 
^ that's my point
 
I'd rather have Filesystem and Process in stdlib before any bignum stuff.
 
filesystem ftw!
 
If you just want big numbers but don't care about performance, you can implement carry-lookahead addition with std::bitset…
 
finally no hacks needed to open a UTF16 filename with GCC on windows!
 
6:46 PM
What's so bad about GMP/MPIR interfaces?
 
@Potatoswatter lol the whole point of bignum's is performance. Otherwise you could just implement a bunch of integers overflowing into each other when necessary. Which wouldn't be such a ba implementation IMHO. Any thoughts?
 
Filesystem is the only thing in for TR2 so far.
 
The point of bignum is precision more than performance.
Same with arbitrary precision floats.
It's even in the name.
 
GMP = GNU Maximum Performance. Everyone knows that.
 
no use for all the precision if it takes aeons to get to that 100th digit. That's why GMP is so good.
 
6:49 PM
2009 VO24, ~310m-680m in diameter, just passed the Earth at 14km/s, missing by ~twenty-two million, three hundred thousand km.
 
Depends on the use.
 
sbi
@RMartinhoFernandes Why do you post that? At 22.3M km it's way off.
 
It's silly.
 
It's a portable panic generator.
 
sbi
@RMartinhoFernandes ??
 
6:53 PM
@sbi It posted that just because I found it silly.
Do I need any other reason?
top tip#1 When you write some funky low level stuff involving void* casting. Make sure you aren't sloppy on the copy+paste. BUG FIXED. #c++
 
sbi
@RMartinhoFernandes I don't understand what's silly about that rock.
 
@sbi The @lowflyingrocks account is the silly thing.
 
sbi
@RMartinhoFernandes Oh my.
@RMartinhoFernandes Ah, Ok. Now I understand. (I like it, though.)
 
Oh, you follow it too? lol.
Ugh, debugging GLSL sucks.
 
GLSL sucks. Too many versions
and it tries to be like C when you can't use it like C
 
7:04 PM
@Potatoswatter yeah, but that's a pain. Can't really think of any "modern" languages that don't support arbitrarily large integers out of the box
 
@Pubby I'm stuck with a single version :)
 
wait
 
@keithlayne Java?
 
OpenGL did something that didn't suck?
 
@RMartinhoFernandes java.math.BigInteger? Or are you mocking me again?
 
7:06 PM
Oh, didn't knew about that :P
But that's sucky anyway. No overloaded operators.
 
yeah, but it works. Even if it is Java.
and if I'm not mistaken, the performance is decent too.
That settles it, I'm moving to Java for good. Curse you, C++, that was the last straw!!!
 
I'm flagging that!
 
<deleted>
 
user457812
I'm not sure how to call off the ninjas...
 
user457812
keith, you might want to board up the house.
 
7:10 PM
Kind of my point about the other things you guys mentioned, they already exist in Boost. And have for a while. And are needed in the standard library. Which will take time, but Boost is the place to be.
 
Don't worry, they only want you. Your wife and kids are safe.
 
user457812
Well, funny thing about that...
 
Unless I use them as human shields.
 
You wouldn't!
 
I'm a dirty ol' bastard.
 
7:11 PM
your wife and kids sure wouldn't want to be your wife and kids
 
I have no idea what that meant. I'm awesome. Recognize.
 
"Mommy, why is daddy using Eclipse waiting for Eclipse to load?"
2
 
"He says it has good plugin support, but he keeps falling asleep waiting for it to load"
too slow
 
@keithlayne sheesh, just use libgmpxx
 
Ha, I don't actually need it. It's just a matter of principle.
 
user457812
7:13 PM
"He says it's beautiful, but why does he cry whenever he talks about it?"
 
stl container question, what is the way to write a function which accepts lists and vector for the same parameter?
I hope not templates ;)
 
Iterators.
And templates.
 
What else would it be?
 
STL Containers now without templates. Intorducing SL Containers!
 
lol
 
7:19 PM
Stop being a wuss.
 
in other words, Java's Standard library
 
ieuw, Java.
 
Crap, my wife came home. Ixnay on the human ield-sha.
 
evening
 
lol
@TonyTheLion Hi.
 
7:23 PM
heh
hi @TonyTheLion
So the stl list and vector do not derive from a common collection class or something?
 
0
A: Quicksort review

Loki Astari@Victor: Cover all the points I wanted: So just one very minor not pick. int a[] = {1, 7, 3, 6, 5, 9, 2, 0, 4, 8}; int len = sizeof(a)/sizeof(int); Prefer to define this in terms of the actual elements. Then if you change the type of the array you only need to change in one place: int len = ...

 
why would they?
templates cover that situation just fine
 
I guess that if we had concepts, these kind of questions would be less frequent.
 
why?
 
7:30 PM
hi
 
Duck typing doesn't cause any problems. You would still need to explicitly use templates with the concepts, right?
 
Yes, but the base class question could be easily answered.
 
it is now
"no"
 
Well, remember that "without templates" was part of the question…
 
7:33 PM
Why was the decision made in favor of templates and against a common base class?
 
Xeo
Because it's just plain better?
 
because base classes are significantly slower and less flexible than templates
 
@Nils A common base class would require virtual inheritance, leading to what DeadMG says.
 
and in addition, you'd have an awful lot of hassle with things like iterators
you'd have to heap allocate them, etc
 
7:38 PM
ic thx @DeadMG
 
you'd be deciding, wastefully, an awful lot at runtime, for no advantage
and then you'd get fucked for the stuff which can't be decided at runtime
 
sbi
@DeadMG Because that's how container libs were done before the STL came along.
@RMartinhoFernandes Then we would instead have questions regarding their abysmal syntax.
 
true, but it's my understanding that many features in C++ existed purely to support the STL
 
sbi
@Potatoswatter O.M.G.
 
What's this?
 
7:41 PM
A snowman.
 
sbi
@RMartinhoFernandes It's called a snowman. You wouldn't know.
 
(Also, @sbi, notice how this one has the correct messages coloured.)
 
sbi
@DeadMG I assumed that the question was because someone asked this, so I explained why people ask this.
@RMartinhoFernandes Just as faked as the snowman.
 
eh
imo, there's no natural reason to assume that collection variance should be implemented by inheritance, assuming that you know that inheritance and templates both exist
 
@sbi Oh, well, it's always a lost battle with C++, isn't it?
 
7:45 PM
Hi:)
 
sbi
@DeadMG That's because you are so young, you basically grew up with the STL. It's only a decade old, remember? (Well, all those Truly Object-Oriented Languages™ still doing it the way container libs in C++ did it a decade ago might be another factor.)
 
tis true
I forgot that there used to be a stone age
 
sbi
@DeadMG Back then we made fire rubbing two monochrome monitors together. I tell ya...
 
lol
 
sbi
7:48 PM
@RMartinhoFernandes Yeah, indeed. The best syntactic improvement they came up with is allowing >> to close a template declaration... And that's easily compensated for by introducing^Wsneaking lambda functions into the syntax.
 
now
I swear I was doing .... something .... before I started playing Battlefield 3
 
Xeo
your compiler?
 
probably that
 
Xeo
Writing your grammer down?
 
sbi
@DeadMG You were procrastinating. (That was easy. You never do anythign else.)
 
7:49 PM
lol
 
Deciding to write tests.
ducks
 
technically, I also eat, and sleep
 
user457812
Those probably count as procrastination
 
Ooh new name
Has anyone got a <working> link for timestomp?
 
"timestomp"?
 
7:58 PM
times tamp?
 
can I template both, the container and the element?
 
Timestomp? Anti computer forensics tool?
The one that changes the date stamps on files
 
@Nils For your quicksort?
 
yes
 
Template on the iterator type instead. And take two iterators.
 

« first day (422 days earlier)      last day (4508 days later) »