« first day (471 days earlier)      last day (4707 days later) » 

16:00
Pass initializer lists by value.
Okay. Trying it ...
Xeo
Xeo
@TonyTheLion Iterate through, find smallest, find largest, check if difference < 1 :P
@Xeo no, cause I need to make sure the differences is no greater than 1 between each of the items in the vector
@Xeo Not what he wanted.
Xeo
Xeo
16:01
Isn't that implied?
Or do you mean between the consecutive items?
No initializer_list in Visual Studio 2008 :(
user142019
@TonyTheLion sort it and iterate over it, checking if Δvalue < 1 for each value
Xeo
Xeo
Oh, I get it now.
If you sort it, no need for abs.
@Olumide No C++11 at all in VS2008.
Xeo
Xeo
@RMartinhoFernandes SP1 has a bit IIRC
16:03
Oh!
In that case. What's the workaround? Or is there an alternative in boost?
-1
Q: c++ small executable with exception handling

mocaivI have a C++ project that contains a vast amount of exception handling. The added exception handling increases my executable size 10 fold and im trying to figure out a way to reduce the size. any suggestions out there?

"Oh no, my executable is 1MB large, how can I live with it?!?!?!?!"
Xeo
Xeo
void f(char* begin, char* end){ ... }
char args[] = "abc";
f(args, args + sizeof(args));
Is essentially what initializer_list boils down to
Just with nicer syntax.
@CatPlusPlus Apparently he thinks placing the exception stuffs in a static library will result in a smaller executable.
user142019
gonna eat brb
Ok, this works for GCC 4.6.3, but b.count() is zero, why? ideone.com/yDz3h
16:07
@Xeo Right, but recommend begin and end. It avoids accidental sizeof(pointer) and everyone should have them in their toolbox anyway.
Xeo
Xeo
Better idea
And I output the bit values, which get set in the set_some_bits function, but the thread fucks it all up :(
Xeo
Xeo
template<unsigned N>
void f(char (&args)[N]){ ... }
char args[] = "abc";
f(args);
But that's not generic enough!
:P
@RMartinhoFernandes wizard, I need your help
Xeo
Xeo
16:10
@RMartinhoFernandes It got another problem, \0 is in there too. :( Well, char args[] = { 'a', 'b', 'c' }; it is, then.
And I should've known that since this answer.
I'm confused. I just want to call Foo::Bar('a' , 'b' , 'c' ) from the client-side
Xeo
Xeo
@Olumide Overloads.
@WTP Ngleton is the generic term for a class where you have a fixed number of instances
Xeo
Xeo
No other way with VS2008
teh libstdc++ std::thread is messing with pass-by-reference!!
16:13
Problem is that I'm passing between 1 and N characters (sometimes up to 10) at different times.
basterds
Als
Als
holer
Xeo
Xeo
@rubenvb std::ref
@Xeo yay for Xeo!
Xeo
Xeo
16:15
@rubenvb I think that was even intentional
well, it's unexpected for sure
Xeo
Xeo
Well, I don't think so.
Prevents accidental shared state.
Xeo
Xeo
If you ever needed pass-by-value, how would that look like if everything was passed by-reference?
They would need to add std::val.
16:17
well, it's a friggin' thread, shared state is part of the contract
No, it's not.
Especially the one you pass as arguments.
@Xeo the function passed to the constructor would disambiguate
Xeo
Xeo
@RMartinhoFernandes And how would that work? Might aswell just copy it and let it capture by const-ref
@rubenvb I think the current solution is fine
@rubenvb Not if there are overloads. It's not easy to examine function parameter types.
Trust us, we have experience with that.
Xeo
Xeo
@RMartinhoFernandes No, I think especially the ones you pass as arguments are valid shared state.
Als
Als
16:19
-1
Q: Which C Standard should I learn first?

TotoroI'm teaching myself C as a first language and have a desire to be a good C programmer. I plan on reading the C standard(s), but am unsure which version to start with. Your thoughts and experience are appreciated. Thank you!

I trust you guys. I've just been hunting this shitty bug for a day now
Als
Als
Innovative way of learning c
Xeo
Xeo
lol
Innovative - maybe. Bad - for sure.
I'm pretty sure it's not innovative.
I'm sure people thought of that before. At least until they tried it.
Als
Als
@RMartinhoFernandes: Explain. you know someone who did it?
16:21
Find the difference: pastebin.com/GTdG0fDv
ah the, &
ugh
Xeo
Xeo
lol
*connectEE, *connectE0, *connectEI, *connectII
Ugh, what?
now I have "pure virtual method called", great
@RMartinhoFernandes those are unique_ptr's to bitsets of large size
Right, called connectXX.
@Als he is assuming that surely some one already tried learning C by reading the standard, and then realised how stupid an idea it is
16:23
yes, they are connection matrices between Excitatory and Inhibitory neurons
Ah, so it might make sense for someone that knows the domain. Ok. Do go on with your naming scheme then.
lol, it's not like I didn't invent this when I wrote it
pure virtual method called
terminate called without an active exception
@sbi You're mean. You wield the truth like cudgel. :'(
C++ hates me today
I'm considering using cstdarg. Unfortunately, all the examples I've found require a first argument e.g. Bar( n , ... ) and not Bar( ... )
16:26
C++ hates you always.
Xeo
Xeo
@Olumide DON'T
@Olumide There's no way to extract number of arguments from C variadic functions.
You need to specify it explicitly.
And you'll get ints, not unsigned chars.
@CatPlusPlus I'm starting to come to the same conclusion. It was Clang on Windows that sucked again btw, g++ just crashes after coming further in the execution
Or something else, if you're not careful.
16:27
wow, I'm spawning an awesomeload of threads :)
I hope join() closes them again
I'm trying to rip singletons out of GC codebase. Ain't easy.
Xeo
Xeo
@rubenvb Just hope that they'll join you again after setting them free. What if they suddenly develop a hivemind and take your PC over?
Don't you hate it when less and less code compile correctly with every change in one damn place?
@CatPlusPlus @Xeo can you please please be explicit about what should I do. I haven't used variadic macros before. Thanks.
Those aren't variadic macros.
16:29
@Xeo lol. wtf
Xeo
Xeo
@Olumide Do the following: DON'T USE IT
okay
Xeo
Xeo
I'm only saving your from pain here.
So my only alternative is overloads?
16:30
@Xeo You don't make friends with masochists easily, do you?
Xeo
Xeo
22 mins ago, by Xeo
template<unsigned N>
void f(char (&args)[N]){ ... }
char args[] = "abc";
f(args);
You basically have two choices:
@Xeo And like that you can even call it like f("abc"), if you want.
@Xeo You could even template that on the char type, specializing for C-style strings on [w]char[_t] stuff :)
But those are not unsigned chars.
Xeo
Xeo
1. Make it easy on yourself and slightly annyoing on the user and use the above code
2. Make it very hard and annoying on yourself, but easy on the user by overloading
16:31
Thanks but I'm not not passing strings in the normal sense. I am passing non printable ASCII characters that translate to device commands.
And that's the reason for the whole variadic shenanigans?
Xeo
Xeo
unsigned char args[] = { 'a', 'b', 'c' };
"\x01" // oh look at me., I'm non-printable.
wow:
    ___chkstk_ms ()
        at /home/ruben/mingw-w64/toolchain/src/gcc/libgcc/../gcc/config/i386/cygwin.asm:147
    147     /home/ruben/mingw-w64/toolchain/src/gcc/libgcc/../gcc/config/i386/cygwin.asm: No such file or directory.
this is on mingw. Fuck
facepalm for using experimental std::thread on MinGW-w64 GCC.
I think I'm starting to get your point. You created a non type macro. (I started reading a book templates last year.)
I'ma gonna try it now ...
16:34
@rubenvb You've been promoting MinGW-w64 with that, and you never even tried it? You bastard!
@Olumide there's no macros in Xeo's code
Oops I meant. Non-type template.
Xeo
Xeo
correct
@RMartinhoFernandes lol, I was promoting it so someone else would run into shitty problems before me, so I could get the MinGW-w64 people to fix them before I had to use them.
<-- Insufferable n00b. There I said it.
16:35
@Olumide np, everyone is at some point. Some, like me, are never going to get past that point
Ha, except me :P
My "results" part of my presentation on this is going to be very very short
@RMartinhoFernandes yes, but a robot technically isn't "someone"
I didn't inflict my noobness upon the world. Not having ubiquitous Internet access does that to you.
unless you wrote a nifty A.I. library in your spare time for yourself
@rubenvb There we go, carbon chauvinism again.
16:36
Lol.
Wait, that's not an accurate description. Plastic is organic too, i.e., made of carbon...
@RMartinhoFernandes technically/chemically speaking, plastic is really a lot of carbon
yeah
you beat me to it :s
psyche!
16:40
@RMartinhoFernandes go to 59 minutes: youtube.com/watch?v=f7mp6A3Zrtg
robot nightmares!
@Xeo it worked. Thanks! :)
@Xeo I could kiss you ...
But I wont as I'm sure you're not a girl.
@Olumide that's absolutely no reason not to do what you were about to do.
16:46
Since I started to frequent this forum, if you can call the few mins I spend here everyday since last week that, I have become very aware of my ignorance.
@RMartinhoFernandes rofl
sbi
sbi
@RMartinhoFernandes You say this as if wielding the truth would be something to despise.
@sbi You can wield it like... a feather.
sbi
sbi
@Olumide Realizing your own ignorance is a necessary prerequisite to fight it.
@RMartinhoFernandes Yeah, I can do that, too. So?
@Olumide oh yes, SO does that to people. Especially the C++ lounge. But listening to these madmen really results in the best way to solve your problem.
16:49
@sbi So, if you did that, you wouldn't be mean.
I know. But I'm also very much aware of how deep my ignorance is. I almost despair.
wow Google chrome updated, closing youtube tab crashes
@Olumide Isn't that great on some Socratic scale? Better to know that you don't know that not knowing you don't know?
sbi
sbi
@RMartinhoFernandes Maybe. So? What's in for me by not being mean?
basterdz
@sbi how about bananaz?
16:50
@LucDanton at least I know that I don't know. Yay? :-/
sbi
sbi
@rubenvb Peanuts!
@sbi but you're a gorilla, not a... chipmunk?
sbi
sbi
@LucDanton I canceled parsing that when I realized my parser would get lost in this logic maze.
@sbi: the internetz are turning up crazy stuff today: mgtp.bandcamp.com/album/mad-gorillas-tea-party
I do not approve of the music
let that be absolutely clear
it was really only the title
I swear
sbi
sbi
16:54
@Olumide As everyone knows who has been at a birth, the moment the mother-to-be despairs is when experienced midwifes smile, because they know that usually this is the moment when the child is about to come pretty soon.
@rubenvb I'm not even going to click on that. There's children in this room.
@RMartinhoFernandes Ick! Pealing peanuts is half of the appeal of eating them.
@rubenvb Did you ever have a banana? Yeah, thought so. Now I can say: But you're a human, not a monkey! Yes, of course, this is stupid. That was my point, actually.
@sbi I take that to mean I'll soon become a guru too. I've started to listen to C++ talks of Microsoft chnannel9 and read some of Scott Meyer's articles
sbi
sbi
@Olumide There's a long way from despairing over your ignorance to becoming a guru. It takes time and effort to walk that way.
@sbi you have officially confumbled me so badly that my brain is oozing out through my ears
@sbi I know. But I'm seriously determined to do something about it. Whatever is worth doing is worth doing well.
sbi
sbi
16:58
@rubenvb It seems it has been doing that for a while.
Oh, so ear wax is molten brain?
Ah yes, I forgot the most fundamental fact you need to know when hanging out here: a rabbithole has a better chance of curing your insanity.
sbi
sbi
@Olumide The way to become a good C++ programmer is thus: Read books and articles. Write lots of code. Ask lots of questions. Use your brain.
@RMartinhoFernandes What do you know about that? Do robots produce earwax??
@sbi I never said my brain was oozing out.
sbi
sbi
@RMartinhoFernandes I said pealing them is appealing, not being thrown the shells.
@sbi I've been doing the first two but last week I learnt from @RMartinhoFernandes that I need to hang out with people who know more than I do. And he's right. I remember how much I learned during my first software engineering job (before going to do my PhD).
sbi
sbi
@RMartinhoFernandes I never said you said your brain is oozing out.
Its like training to be a good chess player. You've got to study great chess moves (code in our case) and play games. One or the other wont do.
@Olumide except in C++ you need to code the chessgame itself too ;)
@sbi I know that wet earwax is fluorescent.
We can use that to detect some meatbags in the dark.
17:06
One of the things I'm currently trying to get to grips with is creative uses of the SFINAE principle. Real powerful stuff. Sad there aren't very many books on the subject.
sbi
sbi
@Olumide That's not necessarily the first thing one ought to learn about C++. It might not even be the tenth, actually.
Nowadays you can't be a good chess player unless you're a robot. :P
sbi
sbi
@Olumide There's one good book on the subject:
I've been programming C++ for about 7 years bit I'm afraid I have stuck with your dad and moms C++ ,
I have that book in front of me. Its a hard read.
Sometimes it takes weeks to get past a paragraph but I'm sticking with it.
It's a good one.
sbi
sbi
17:08
@Olumide Oops, so you already have the first dozen things to learn behind you. Sorry, I didn't know. Sheepish grin.
I intend to read the book from cover to cover.
I'm currently on page 134
sbi
sbi
@Olumide Do you really find it that had? Mhmm. What had you done with templates before you started to read the book?
The one thing that for some reason took time to sink in my skull regarding SFINAE is that it applies to function templates, meaning that template arguments of class templates won't trigger it.
I have used template based containers and have written function templates -- nothing too big. I've only just become aware that there's a lot more to templates than containers.
17:12
Well that certainly is one of those things you should learn from others -- I wouldn't rely on independently rediscovering TMP and generic programming on my own.
I'm reading the book but I still have a lot of questions based on the esoteric code that I've seen written lately.
sbi
sbi
Well, I guess I have to feed the kids. They're getting annoyingly obtrusive about dinner.
afk
Yeah, that's the problem with humans.
17:50
@RMartinhoFernandes "hard"
@sbi Kids require food???? ..... ..... ..... Oh shit.....
Speaking of food, I think I'm gonna go and find something to eat.
sbi
sbi
@Xaade If you have kids, stuffing their mouths is the least of your worries.
(For example, I now need to bully them into bed. I'd take preparing the table over that any time.)
Keep buying candy and leave it accessible. They'll take care of themselves.
@sbi Honestly, I just drop my kid into the bed. She immediately goes to sleep, after a few laughs.
sbi
sbi
@RMartinhoFernandes Except you then have to spend a lot of time, effort, and money on the dentist.
17:59
@sbi Mine.... can eat..... I mean.... like constantly. Like I'm sure that whole banana just filled her half-apple sized stomach, and then she drinks 8 oz of milk, then snacks on cereal, then eats a toddler meal.... and so on.
After all that, when we go to eat dinner, she gets what we have too.
The funny thing is..... she hasn't gained weight either.
Is that normal?
I mean, on parasit-free people.
You forget being a teenager.
Toddlers constantly eat.
sbi
sbi
@Xaade Oh, my kids do that, too. Well, mostly. One of my sons will call me up to three times before he falls asleep sometimes. But there's more to this. At least here, because I wash my kids before getting them to bed. So with the small ones, I have to make them wash their hands after dinner, get their pajamas, get undressed, wash them, brush their teeth, read a bedtime story, and say good night.
@Xaade How old is she?
@sbi 13 months
Oh.
Kids that age do nothing but eat, sleep, cry and poop.
sbi
sbi
18:03
@Xaade Well, of course she'll eat like a maniac at that age. You can almost see them grow in their first two years. Was she breast-fed?
@sbi you forgot to put the pajamas on.
@sbi yep
sbi
sbi
@Xaade Then it's unlikely she'll get too heavy. It's mostly bottle-fed kids that do that. (Of course, if you only feed them at McDonald's, that changes the odds considerably.)
@RMartinhoFernandes That was earlier. Now she crawls up stairs, pushes a cart, solves puzzles, finds ways onto the dining table....
sbi
sbi
@Xaade Yep. I also skipped over constantly reminding them of what they were supposed to do. Actually, that's the worst part.
@sbi I don't understand how McDonald's is easier. You have to leave the house, order food, bring them back home, then leave the house again because they get hungry in 15 mins.
I find it easier to feed her a banana, some fruit, and cheerios, which she eats all by herself.
sbi
sbi
18:06
@Xaade You can feed them McDonald's-style at home, too. Sweat tea all the time, lots of fat, etc.
I never understood the poor man must feed kids mcdonalds bull.
sbi
sbi
@Xaade Actually, in the long run I found it easier to insist on proper meals from a certain age. I give them as many meals as they want, but nothing in between. Constantly eating is not what I want them to get used to. I go nuts over those mothers on the playground constantly handing out cookies, apples, sweets...
@sbi We don't do sweets. Cherries are sweet enough.
Hi guys :)
18:12
Bananas, Cherries, Carrots, rice crackers, cheerios, etc. No or low salt.
sbi
sbi
@Xaade For my first child, in her first 18 months, raisins was the sweetest she knew. But once they have older siblings, such resolutions go down the drain quickly.
Water and whole milk.
@sbi Yeah, see..... we can't stop her from having something from a different environment....
I'm on my way to eliminating coke from my "diet".
Down to one a day.
I hope you're not talking about the snorting kind.
I realized why I had trouble drinking water.
sbi
sbi
@Xaade Yeah, when they enter kindergarten, all is lost anyway. :) They suddenly learn words you'd never say in their presence, and get to eat stuff you'd never feed them.
18:14
When I drink something else, I sip it..... but when I drink water I try to gulp it. Then I have difficulty controlling breathing, and I literally can't drink water.
I always gulp water. Sipping water is no fun.
sbi
sbi
Well, I think I need to put some more pressure on the kids in the bathroom. They procrastinate. I need to remind them that this time is taken out of their story.
afk
@sbi She had some fajita meat the other day..... and loved it. Eyes lit up like crazy. And then she had some spicy chile..... oh boy.
@sbi or lock them in one day.
18:32
Hurray, the new GCC snapshot has been exorcised!
While reading TMP I realized you should know recursion good :(
and I hate black magic of recursion :(
I keep getting Recursion's leap of faith and loosing it
but wait I'm Anubis!!! , I can do anything :D
You're a Goa'uld?
@EtiennedeMartel nope :) , I'd say to you to believe in me :)
yeah, because that works on educated Western people
18:44
Define "educated".
@EtiennedeMartel The quality of people on whom that doesn't work.
Easy enough.
What's so hard about recursion?
I guess I'll never know.
You know what's hard? Refactoring.
18:46
Nah, that's easy.
while(code_sucks()) clean_code();
By definition, refactoring means working with crap code.
if(code_sucks_too_much()) axe_it_and_get_drunk();
It's more like while (abs(code_suckage_level - previous_code_suckage_level) < 0.001)
>, even.
18:48
Because codes always sucks.
For varying amounts of suckiness.
@CatPlusPlus I don't remember the name of author of article , I which he says "Some peoples never gets recursion"
now I feel I am one of those :D
It's function calling itself, and that's about it.
@CatPlusPlus Indeed it is but sometimes problems solved by recursion are hard to visualize
sbi
sbi
@Xaade Chili, huh? I remember one of my kids happily sucking at a lemon at the age of 5 months. Half a year later, she would have spat it into our faces. :)
Which reminds me: One of my boys, around his first birthday, always wanted to eat and drink what everybody else had, and got really mad if there was something he couldn't get. Which was a problem with things like beer. So one day I bought the most bitter beer I could find, and, when he threw a tandrum because he couldn't get what I had, gave him a few droplets on his tongue. He literally spit it onto my face.
He was very cautious since, and mostly accepted when he wouldn't get something we had. :)
@Xaade What do you mean?
@MrAnubis Not really. Some problems are much easier to solve with recursion.
18:53
@MrAnubis I tend to find solving problems with recursion to be easy.
sbi
sbi
@DeadMG And what does the crazy bunch of the regulars here have to do with "educated western people?"
admittedly true
We're a bunch of psychopaths.
@sbi my dad did that to me. I'm 25, and still don't drink :/
sbi
sbi
@MrAnubis I am afraid I will never get why some people don't get recursion. I always thought if teachers wouldn't make such a fuzz about it, students would learn it much easier.
18:57
it's often teacher making things hard, that makes them hard to comprehend. It's almost as if they never got the point either, and hence cannot convey their understanding
@sbi I always found recursion simpler than English grammar :/
@MooingDuck There's a reason lots of people completely understand the former, but not many completely understand the latter.

« first day (471 days earlier)      last day (4707 days later) »