« first day (578 days earlier)      last day (4371 days later) » 

12:15 AM
morning, bitches
 
mawning biatches
 
you forgot the "bitches"
 
lol
what you doing?
 
watching Thor
or, more accurately, wallowing in my own pain
 
linux isnt any more crappy than windows
 
12:20 AM
@DeadMG oh that sucks
 
at least with linux though, if you want to see the sourcecode to the entire os, you can
 
@TonyTheLion I know.
 
feel like crap -> buy cookies -> now feel even worse
 
Oh, need a distraction? I just posted a horrible Vim contraption over here:
 
12:21 AM
woah
 
@sehe amagad giant wall of code?
 
O sweet mother of...
Oneboxing even fails when linking across rooms :)
There. Fixed
 
@sehe what language is that?
 
Vim script
 
oh vim
 
12:24 AM
@TonyTheLion I used his question as a finger exercise. I still want to make my own grammar aware textobject thingy one day. I love Resharper's 'Extend Selection' (and Shrink Selection) actions, and allthough Vim's text objects are really similar, they're not quite syntax aware
I intend to wire a simple Python parser at first, and perhaps libclang later
 
@sehe I don't know what a vim "textobject" is
I don't use vim
 
Poor sod. It is nice :)
 
yea, I gotta learn it someday
 
It is when you say =i{ to reindent a scope block, and cib to replace a whole parameter list at once stuff like that. yatPP to create two copies of an XML element, complete with nested tags, if any. Stuff like that
 
ah I see
 
12:31 AM
Anyways, time to hit the sack.
Gonna be walking my kids to school in 5.5 hours - they get to go on their own bikes on the days I bring them
 
per Wikipedia, C++ is an "intermediate-level language", to be honest, I didn't find C++ to be that easy to learn.
 
Are you sure they were referring to the complexity level?
 
I think they refer to abstraction level
 
what else would they be referring to?
 
12:32 AM
@TonyTheLion That's because C++ is a half-language, not a real language.
 
@TonyTheLion I think they refer to abstraction level - as in not highlevel, but not too lowlevel either
 
@sehe ah maybe that was what it refers to then
@DeadMG lol
 
@TonyTheLion compared to assembly it's easy
@TonyTheLion compared to c# it's hard
@TonyTheLion so it's intermediate to who ever wrote that article, and their dumb.
 
C is so simple that it's hard.
 
@johnathon Or lisp, or factor, or ...
@MooingDuck lisp wins that movement
 
12:34 AM
@sehe whitespace
 
@MooingDuck the ellipsis was for befunge, malbolge, standard ML, brainfuck, whitespace and their lot
 
@johnathon > their dumb
*twitch
 
@sehe personally i find languages (in general) that have such extreme abstractions rather difficult to understand at times, and that to me makes them harder than c++
 
@DeadMG Arguably 2-and-a-half really: firstly, there's C, then there is the ++ part and lastly there is TMP
 
@sehe the esoteric languages?
 
12:36 AM
LOL
 
@johnathon erm, wasn't that what I was saying?
 
@sehe yes, i was just agreeing with you
 
@MooingDuck I was actually referring to a broader group. Factor and Lisp would not be considered esoteric, I suppose. I still think their style makes it harder to do 'actual stuff' in it
@MooingDuck I found that C is so simple, it is hard to see how simple it is. I'm slowly growing an appreciation for C over the years (from being forcibly exposed to C projects)
 
@sehe When you described what "the ellipsis was for", almost all of those are esoteric :D
 
@MooingDuck Almost being the operative word, there
 
12:39 AM
@sehe I appreciate C's simplicity. It's like legos. But sometimes you really need more. (RAII)
 
Anyways, I was hitting the sack. <Ctrl-Alt-End> and bye bye!
 
12:57 AM
@MooingDuck RAII = love.
2
 
fuckadoodleoo
 
1:22 AM
Holy shit...
 
@Mysticial well that was idiotic
 
hi guys
i have an object which contains a sequence container .. every element in the sequence container contains a unique processID. every process a set of questions each having a unique qeustionID and a counter that represents how many times that questions fails ....
which sequence container should i use to store this object as i want to serialize this object at the end of my program and reload once the program runs again
i think i cannot use map as map would not allow something like map<question,counter>
any suggestions
 
1:45 AM
@Atif Why wouldn't it?
And why shouldn't the question contain the counter?
 
can i modify the value in map ? I was under the impression that once a value is entered for a key, it cannot be modified
 
@Atif The value can change, the key has to be constant
 
@Atif No, that's not true. It's the key which has to be constant.
 
ohhhhhh then perhaps i can use the map
 
You'll just need to provide a comparator type or an operator< for the question type
 
1:48 AM
thank you guys ... let me try it out and get back here
you mean overload the < operator to navigate to the right question ?
 
@Atif Yeah
 
yeah that i can do
thanks again .. let me try it out and see how it works
i would ask about the serialization shortly ... once I get this to work correctly
 
2:08 AM
std::map<std::int,std::map<std::int,std::int>> mymap;

is this declaration wrong ?
 
well, int isn't in the std:: namespace
 
had to do this instead ... std::map<int,map<int,int>> mymap;
 
it's just a primative
 
yeah got it ... my bad
 
I thought question was the type?
Or was this unrelated?
 
2:11 AM
yeah had to remove the std
 
2:40 AM
@Collin okay i ran into a problem ..... i declared a variable called counter and initialized it to 0 .... when a question fails, i do map[processID][questionID] = ++counter;
okay ... stupid question .... let me correct it myself and rephrase my question
 
@thecoshman Yes, colour depth and screen refresh rate. Nobody really changes BPP any more and LCDs have fixed refresh rate, but whatever.
 
hi
it's any person here?
 
2:58 AM
@innuendoreplay it's any person here, perhaps. it could be any one of us.
 
hey Dave ... how are you bro ?
 
ok you?
@CatPlusPlus what is the C++ equivalent of catnip?
 
m doin ok also
 
0
Q: Array: accept string print to screen

RoundRobinHi how do i accept to names from the user and print them back to the screen using arrays this the code i working with int array[500]; char array2[200]; printf("Please Enter The number of names: "); scanf("%d",&num); for(i=0;i<num;i++) { array[i]=0; ...

 
i can find a key in map by doing iterator = map.find(key) and this would take the iterator to the key position if key is found .... but if my map is defined as map<key1,map<key2,value>> ... how would I further search key 2 after doing iterator = map.find(key1) in order to reach for the value ?
 
3:05 AM
I want to answer this, but the level of fail in the question seems like I'd have to write a book to help this poor bloke
@atif
map<int,map<int,value> > foo; auto it = foo.find(1); auto it2 = (*it).find(1);
I think
 
let me check and verify it
 
let me see
using std::map;
map<int,map<int,double> > foo;
auto it = (foo.find(1))->second;
auto it2 = it.find(2);
so you could technically do
auto myval = foo.find(1)->second.find(2)->second();
get your value in one line
C++11 may even optimize some temporaries out for you if you're lucky :-P
@Atif ping
 
thanks Dave ... let me check it and see if this works ...
 
WAIT a second
are you searching for the nested map int,value pair?
I just thought you were asking about how to search then use that result to search again
 
@stdOrgnlDave i want to check if key1 and key 2 already exist in the map defined as map<key1,map<key2,value>> ... if they exist, i want to increase the value by +1 (value is a counter for key2) ... otherwise create insert map[key1][key2] = value
 
3:19 AM
@Atif so you want to check if key1 and key2 occur anywhere in any map?
 
@stdOrgnlDave yeah only in this map ... i have only one map
 
basically i want to store a history of every question of every process that fails ... and when i run my program multiple times ... if the same question for a process fails in the second run, i want to increase the counter so that it shows that the question failed 2 times
 
so map1 is what?
 
so its basically map<processID,map<questionID,# of times questionID fails>>
 
3:23 AM
er, does map<key1,map<key2,value>> make sense for your situation? You might try map<pair<key1,key2>, value>
 
@MooingDuck you got me thinking now ... this actually looks like a better idea
 
@Atif it may or may not be
 
I am certainly confused by what is trying to be accomplished :-D
 
@Atif actually, considering what you are doing, I'd go with a vector<QAStruct> where QAStruct contains a vector of Answers, including how many times each one has been... whatever
since I assume the keys are sequential numbers?
 
@stdOrgnlDave let me explain ... i want to create a map of type map<key1,map<key2,value>> .... an insert in the map would be something like map[1][2] = 1; where 1 is key1 and 2 is key2
 
3:33 AM
@Atif is there a reason you don't just used fixed sized arrays or somesuch?
 
@Atif why not vectors or arrays? Will you be adding questions often?
 
let me tell you guys what i want to achieve
I run my audit program which audits the processes and questions inside each process .... so in the end i have something like Process1-> Question1 failed ... Process2->question3 failed .... and so on
 
no wait @Atif I'd love to help but I stayed up late last night helping someone figure out k^4 * n^2 * (N_L ^ d) or something slightly more complex. I'm not up for another night of problem-solving
so...sorry but cya :-(
 
i want to save which questions failed for which processes and serialize it to a file when my main program exits .... when i run the program for the 2nd time with a new input, i want to load this data from the serialized file ... and if Process1->question1 fails again, i want to increase the counter to keep tract that process1->question1 has failed two times now ...
hence map<key1,map<key2,value>> used as map<processID,map<questionID,counter>>
@stdOrgnlDave no probs bro ... have a good night
@MooingDuck what do you think i should use ... and then off course how
 
@stdOrgnlDave now dave, now you see me :))
 
3:46 AM
I want std::clamp.
 
4:13 AM
@CatPlusPlus What's it do?
 
Er, clamp?
 
Ah, that clarifies everything ;)
> constrain a value to lie between two further values
That?
 
Yeah. std::min(max, std::max(min, value))
 
@CatPlusPlus as a function or a type?
 
Ideally, both. And with an option of specifying open or half-open intervals.
 
4:19 AM
@CatPlusPlus half open intervals?
 
(min, max] or [min, max).
 
That snippet above is for [min, max].
Not if interval ends are not valid values.
 
I think bounding with open/half open floats would be weird. What would it do, throw an exception?
and for integers, just have closed intervals, solves all the problems
 
std::min(std::nextafter(max, max - epsilon), std::max(std::nextafter(min, min + epsilon), value));
 
4:22 AM
AND WHY ARE THE BATTLE NET SERVERS DOWN
@CatPlusPlus eh, it's wierd, but acceptable
 
Why would it throw an exception?
It needs to return previous/next value after the bound.
 
@CatPlusPlus since the "previous" value after the bound is strange when it comes to floats, and might not even exist
what if there's no value in that range, then an exception?
 
Why not?
epsilon here should be rather large, 0.01 or something. Then nextafter will return next representable float in that direction.
It always moves inside the float domain, I don't see why there should be no value.
 
There exist ranges inside the min/max of floats where there are no representable values for float.
if I could load ideone or something I'd find one such, but I seem to only kinda sorta have internet right now.
 
@MooingDuck They go to "infinity".
 
4:33 AM
There exist ranges inside the min/max of floats where there are no representable values for float.
@GManNickG ish
 
Your internet is sure having fun. :) Yes, that's why it's in quotes.
 
@GManNickG if my internet was worth half what I pay, I'd be playing Diablo :(
 
:(
 
incorporated most of @thecoshman's suggestions/remarks, and added about 5 pages
 
waaaait... isn't it like 6am where Cat is?
 
4:45 AM
more like 8, i think, in Poland
oh, 7
 
I can't load webpages to find out, I'll take your word on it
@CatPlusPlus [10000002.5, 10000003.5] has no valid floating point values.
 
5:02 AM
@MooingDuck He knows that :)
 
can i use max_element on a variable member of a vector element ?
 
@Atif What do you mean?
 
@GManNickG
class Process{ int id; double weight; };
class Master { vector<Process> my_vector};

can i iterate through my_vector and find the element with maximum weight by using max_element
 
Yeah, there's a second version of max_element that takes a comparison predicate.
So with lambda's: std::max_element(my_vector.begin(), my_vector.end(), [](const Process& largest, const Process& next){ return largest.weight < next.weight; });
 
5:23 AM
this would return an iterator to the element witht he largest weight ... right ?
 
Yup.
 
@GManNickG awesome ... works like magic .. thanks
 
5:38 AM
@Atif Magical thinking is a bad habit for programmers :)
 
@StackedCrooked lol i know ...
 
6:10 AM
@GManNickG i have another question if you are here ?
 
You should say it anyway, since others may help!
 
i have a map defined as map<key1,map<key2,value>> .... value is a counter and contains the number of times the pair <key1,key2> is found ... how can I perform this check so that if <key1,key2> occurs for the first time, i set the value as 1 and for every next occurrence, increase the value by value+1
 
@Mystical got a new avatar? But the chatroom one is the same?
 
6:28 AM
@Atif It sounds like you should be using std::multiset<std::pair<key1, key2>>.
Or if you're only counting, std::map<std::pair<key1, key2>, value>.
 
if i use std::map<std::pair<key1, key2>, value>, how would I check the key1/key2 ... the iterator would point me to the pair
how do i check inside the pair
and i mean the syntax to access map<std::pair<key1,key2>,value> ... i can check the element of standalone pair<key1,key2> p by p.first/p.second .... but how to do it once its inside the map
 
You know what tuples are also useful for? Combined keys!
 
7:10 AM
@Atif You just get an iterator to the pair and access it through that.
 
7:25 AM
@StackedCrooked onnly boost tuple, with tuple_comparison.hpp I suppose
@Pubby refresh / reload browser cache
 
@sehe Standard tuples have comparison operators defined.
 
@GManNickG Oh I must be stuck in TR1 memory then. I suppose they will bork when the element types aren't std::les<> comparable?
 
and good morning to you, too..
 
stupid 250MB mail box
 
@sehe §20.4.2.7 if you want to look yourself, but it's defined to use operator< on the types.
 
7:29 AM
I have a call to GetWindowRect in my program. I get a red line under it in visual studio telling me something is wrong with it. The program still runs in debug mode but in release mode the program doesn't compile (identifier not found for the GetClientRect calls). I have windows.h included. Anyone have an idea what might be the problem here?
 
@72con You say it runs in debug but doesn't compile in release...are you running an old version and it doesn't compile in debug either?
 
Just built it to make sure but yes, it actually compiles in debug mode.
 
Then you just have to look for what things are different in release. #ifdef NDEBUG around the windows include, for example, or different project settings for each build type.
 
Nuh, it's a few hundred lines of nothing specific.
I think there has been some erratic behavior on the part of VS. At one point I think I even got rid of the red line.
 
Well try to reduce the problem to something testable and ask on SO.
 
7:35 AM
And indeed, I have the red line there even in debug mode yet it compiles..
 
Keep in mind red lines have nothing to do with the correctness of your program, you shouldn't rely on them for that. They're just hints.
 
k.. thanks.
 
7:49 AM
@GManNickG Well, dang. That strikes me like... what's the rationale there?
 
@sehe But I want to live in the past!
 
At first I thought it would be 'container implementations use std::less for versatility' (since, you could want different comparers for different containers of the same type)
@GManNickG But I noticed, unique_ptr::operator< is defined in terms of std::less<CT> where CT is the common type of the two pointed-to arguments... Mmm. not really consisten at first sight
Similar for shared_ptr
 
8:05 AM
I've don't done a huge amount of work with threads, but I am fairly sure that when you start talking about hundreds of threads running on a server, you are probably doing something wrong
surely such vast numbers of threads for a program is going to start hurting performance
 
Aren't there hundreds of outgoing connections on a server though?
 
I don't think it's just threads for sockets
meh, not too concerned, it's not what I get paid to worry about
just find it strange that when people are talking about the RAM usage being so high, they try running with a lower thread limit. Which makes sense by it self, but just seems like trying to treat the symptoms
 
I think the 100 of threads are just userspace ones too. Dunno though.
 
I'll play the Java card at this point as well :P
 
You've just activated my trap card
 
8:13 AM
what's this, yo-gi-oh?
 
No, ya-go-uh
And wtf is this:
 
@Pubby don't make me flag that shit
 
> Hannah Montana Linux is a unix-like Linux Operating System based on Kubuntu. The Package Manager is Debian apt. The GUI is KDE 4.2 with Hannah Montana themes
Flags aren't strong enough, we need a fucking flame thrower
> You cannot flag your own messages
 
@Pubby need.... more.... flags....
 
@thecoshman Nobody makes you do that
 
8:19 AM
@sehe I'd tell you look at what I was referring to, but you've already seen it, poor soul
 
It's still there. In fact you drew more attention to it by flagging. Way to go
Don't be a hypocrite about it now
@thecoshman The edit isn't enough.
> I'd tell you to look at what I was reffering to, but.... I already did
FTFY ^
 
(╯°□°)╯︵ ┻━┻
Birthdays are good for you. Statistics show that the people who have the most live the longest. LARRY LORENZONI
2
statistics to the rescue once again :P
any way, height maps. Are they still an acceptable way to do large areas of open terrain?
 
Context missing. I'd say, yes. Even if the modeling technique were different, it would still be a height map, despite itself, no?
 
8:44 AM
never mind
 

« first day (578 days earlier)      last day (4371 days later) »