« first day (641 days earlier)      last day (4290 days later) » 

8:00 AM
It has nothing to do with strings.
 
so when you have your LINQ query, what do you have? some data structure of commands and operands?
also... if you are serializing, it implies you are wanting to deserialize, which means run time creation of a LINQ query, and this question, well the answers to it, imply that LINQ is designed for use with static compilation
and whilst serialization does not have to, it very often is done to a string format
 
@thecoshman It's not.
 
@R.MartinhoFernandes indeed it is not, I was looking at like it is sql, but I already see the difference
 
@KarimA. Here: relinq.codeplex.com someone already did the work of figuring out a good model for you :)
not to start a flame war, but this is precisely the reason I really hate C++. Not everyone is a library developer. Most of the time in the enterprise systems world, people write bad codes with no documentation. Yet poor documentation is never a real problem with Java --End of rant-- : p — TommyQ 35 mins ago
haha.
 
8:19 AM
@sehe Free advertising, yay!
 
@R.MartinhoFernandes poor misguided fool
 
STOP. PINGING. ME.
 
@Cicada who's pinging you?
 
@Cicada oh, hi @Cicada
@Cicada btw, it wasn't me that was pinging you.
Anyone know who was pinging @Cicada?
 
Yes, I do. It doesn't matter.
 
8:23 AM
@Xeo updated my answer to @FredOverflow's question, I think it's accurate now:
3
A: Implicitly treating returned lvalue as rvalue

refpRegarding parenthesized expressions [√] You are wrong when talking about parenthesized expressions and that it shouldn't be able to trigger a move when being returned and containing only the name of a moveable object. 5.1.1/1      General      [expr.pr...

 
@rubenvb I've no Idea who was pinging @Cicada
 
@Cicada Ok.
@Cicada I got it.
 
The C++ standard distinguishes between classes with only public members, no custom ctor and no virtual functions and normal classes, right? At least when it comes to initialization. How are the first called?
 
Aggregates.
 
@Nils they differ in terms of what's allowed to be done with them, yes.
 
8:28 AM
Which were relaxed to 'only one accessibility for all members' from just public IIRC.
 
Yes but I don't find the relevant sections anymore :(
 
@Nils if all members are as trivial as you have described it's considered a POD type (Plain Old Data)
 
Ah that's POD.
 
@Nils 3 concepts: POD, trivial, standard layout
 
What is trivial and standard layout?
 
8:29 AM
How are POD different from aggregates again? Is it that POD are objects of a user-defined struct/class while aggregates are more general (e.g. can also be array)?
 
9.10 "A POD struct109 is a non-union class that is both a trivial class and a standard-layout class, and has no
non-static data members of type non-POD struct, non-POD union (or array of such types)."
thx :)
 
@StackedCrooked Aggregates are not recursive in their definition.
 
60
Q: What are Aggregates and PODs and how/why are they special?

Armen TsirunyanThis FAQ is about Aggregates and PODs and covers the following material: What are Aggregates? What are PODs (Plain Old Data)? How are they related? How and why are they special? What changes for C++11?

All in there.
 
thx :)
 
Well, @StackedCrooked and @thecoshman, I think we plinged @Cicada to death...
 
8:43 AM
I so knew you guys were gonna do this.
I am amused.
 
@Cicada Did I miss out on something?
 
@Cicada we could hardly let you be disappointed could we
 
@Cicada Oh ok. :P
@Cicada I think I got it.
 
@Cicada was there something that inspired you to post that, or is this another classic 'troll' from you?
 
8:46 AM
Write less efficient code. — ta.speot.is 12 mins ago
^^ lol
 
I'm not trying to be "that" guy, but this answer has gotten like 8 answers since it's started, votes flying everywhere.. shouldn't this be the most appropriate answer to his question?
0
A: constructors for structs that don't do anything

refpDeclaring an empty constructor has side-effects.. Even though your constructor has an empty body it is still considered to be a constructor, and therefore certain object properties will be lost - such as the object being POD. Some cases require the use of Plain Old Data-types, which can make it...

 
@thecoshman There was something (and some messages after)
 
@refp You're being "that" guy.
 
@R.MartinhoFernandes I'm always "that" guy, without trying :(
 
@refp you're a prick sometimes. And a longer answer isn't always received better by the audience. TL;DR kind of stuff. Not everyone wants a full academic explanation of stuff.
 
8:54 AM
@rubenvb :( then you won't be happy about my update to the post in question :/
I supplied more information
 
It annoys me that you're constantly linking to your answers every time you update something. I know how to use the bookmarks in my browser.
 
@Mysticial I don't think this will help much, but I do like icecream
 
@thecoshman +1 nice. :)
 
@R.MartinhoFernandes I didn't link it now
 
@thecoshman We already had this discussion before, but I disagree with the first sentence.
 
8:58 AM
@Mysticial I might edit in some more 'helpful' things he can do to use up the CPU
 
@R.MartinhoFernandes but I will stop doing that, sorry.
 
@R.MartinhoFernandes depends very much on the situation really
 
@thecoshman Yes, that's the conclusion we reached the other time :)
No need to rehash everything again.
 
we'll just leave it at that then :P and I did say normally, not always
@R.MartinhoFernandes is that 'we' as in just us two, or 'we' as in the room?
 
@thecoshman Maybe someone quipped something or other, but it was primarily us both.
 
9:02 AM
@R.MartinhoFernandes oh... well, it must have left a lasting impression on me :P
 
Ok, I need to go to work now. Later.
 
A New Rant On CUDA™
Kindly provided by me.
The profiler sucks: it crashes when you profile.
 
@Cicada maybe your code is broken or just sucks?
 
No it crashes even before launching my sucky broken code.
 
@Cicada Hard to get worse than that. My compiler doesn't compile. My refrigerator doesn't refrigerate. My exterminator doesn't exterminate.
 
9:14 AM
My Chat Room doesn't chat room.
 
@Cicada on Linux?
 
Yeah.
 
Can confirm this.
export CUDA_PROFILE=1
export CUDA_PROFILE_CONFIG=$HOME/.cuda_profile_config
You probably still need the profiler to view the results.
I'm quite disappointed to hear that they didn't fix this, I used cudaprof about a year ago.
 
9:30 AM
@Cicada you don't profile with a profiler, silly you
 
> include/ogonek/ucd.h++:248:14: fatal error: no type named 'vector' in namespace 'std'; did you mean 'hecto'?
Thank you very much clang.
 
lol
 
@R.MartinhoFernandes ew, .h++
I really hate it when people don't finish sentences properly, is it really that hard to
 
How would you name this "Implementing a Stack with operation to get minimum", for a blog post?
 
@VinayakGarg what do you mean, to get minimum?
 
9:34 AM
@thecoshman:Just like a heap gives you minimum/maximum element.
 
@VinayakGarg oh... so you are just going through the stack, keep track of which element is the 'smallest'
 
Oh it would be better as "Implementing a Stack with operation to get minimum element"
@thecoshman:right, I am just not able to make a nice title
 
"Getting the smallest element from a Stack"
ronsil man
 
But you can't get the smallest element from Stack? That would be a confusing title
 
is that not what you just said you where doing?
 
9:39 AM
BTW I found a question on SO titled "Design a datastructure to support stack operations and to find minimun"
But this is a question, how do you name a blog title
 
Couldn't you just write a vector wrapper and iterate over that?
 
@VinayakGarg as in, because you can only see the top of the stack?
 
yeah
 
@rubenvb That's a catchy title.
room topic changed to Lounge<C++>: The new topic was lost in the mail. [c++] [c++11] [c++-faq]
 
"The stack that could give minimum in O(1)"
 
9:48 AM
I see... well, if you maintain a true stack, you can't really do this
 
Right, we need a extra stack to do it
 
@VinayakGarg what is it that you are wanting to do? do you really need a true stack, why not just a vector like @rubenvb suggested?
@VinayakGarg TWO stacks? oh no no no
 
@thecoshman He's wanting to post on his blog.
And needs a title.
 
¬_¬ I hate you sometimes robot
 
Seriously, you can read the post once it is posted.
 
9:50 AM
@thecoshman:Why not 2 stacks?
 
@VinayakGarg duplicates the data needlessly
 
Not if the second uses pointers.
 
if you need stack like functionality, but want be able to see all the data, use a vector, maybe wrap it. if you need ordered data use a tree
 
It's basically trading space for time.
 
@thecoshman:It is just a solution for some stupid interview question, :) no need to worry about duplication.
 
9:53 AM
except, when you pop from the main stack, how do you remove the equivalent from the size ordered stack?
 
@thecoshman It's either the top one, or there's nothing to pop.
 
except, when you need to ensure that if you pop from the data, you remove the pointer from the ordered stack, else you get a invalid pointer
 
Only if there's something to pop.
 
@thecoshman:here is a nice answer on SO stackoverflow.com/a/2217147/558094
 
size of data stack = size of order stack, no?
 
9:55 AM
No.
 
might be, but not necessary
 
You would know that if you had read the post.
Which isn't posted yet.
 
reading the answer now :P
 
@VinayakGarg I like this one.
 
@R.MartinhoFernandes:Which one? Er, what one?
 
9:57 AM
Click the little gray arrow on my message :)
 
lol
Sadly, people don't appreciate humour
 
oh ok then, I see how that works
 
all people, all the time
 
yeah, using ram to save CPU time
 
@VinayakGarg I'm confused now. (Also, it's not unheard of me missing a joke.)
 
10:00 AM
@R.MartinhoFernandes:Don't worry you missed nothing
@R.MartinhoFernandes:If I post that title (which I will), people might not understand it
 
I think it's more important for the title to spark interest. Understanding can come from the actual content.
 
Hopefuly
 
Win32 question: Given a windows handle how can I get the thread id of the thread that created it? So far I crated a CWindow attached it to the handle and took the thread id of that cwindow.
 
BTW does anyone know how to format the code on blogspot? Wordpress has nice formatting for code.
 
but it seems to crash sometimes.
 
This is what is on wordpress too
Can it work on blogspot?
 
@VinayakGarg It's what I used here: imcompiling.blogspot.pt/2009/06/pipes.html
Works fine.
 
@R.MartinhoFernandes:Portuguese hmm...
 
Bah, Eclipse, the great IDE, has trouble with rendering text properly.
Again.
 
10:08 AM
Chrome offered the translation
 
@CatPlusPlus lol, the great IDE.
Right.
 
@CatPlusPlus well... depends what you expect from and IDE
 
I expect it not to randomly crash, or worse: just randomly start acting insanely.
 
it does have lots of great short cuts to help you along, especially when dealing with Java
 
Have you checked the superb feature "File > Restart"?
 
10:09 AM
If it cannot edit text, then it's fucking failure.
 
¬_¬ what's that?
 
It's quite useful, especially when it gets completely batshit insane.
Instead of closing and reopening manually, you have that feature built-in!
 
Yeah.
 
@R.MartinhoFernandes it managed to close...
 
Seriously, what does reliable software need a built-in "restart" menu item for?
 
10:12 AM
I told it to refactor something yesterday, and it ended up modifying "App" to "Apppppppppppppppppppppppppppppp" in an XML file. And <activity something="Options" .../> to <actiOptionssssssssssssssssssss/> or something like that.
 
oh thank you very much, now my workspace is locked, again (╯°□°)╯︵ ┻━┻
 
What? You hit Restart?
 
Eclipse, you are on my hate list
oh, nope, it was just taking it fucking FOREVER to actually restart ¬_¬
 
@R.MartinhoFernandes My IM has one. It's useful when you're experimenting with stuff that requires restart.
 
@CatPlusPlus Erm, why doesn't it restart automatically?
 
10:13 AM
I mean editing stuff outside of it.
 
Also, what's an IM?
 
@R.MartinhoFernandes usually, Instant messenger
 
indeed
 
All I know is that I've used Eclipse's restart feature a lot in the past month. All because it freaks out and there's no other solution.
I strongly suspect it's all because of stupid catch(Exception e) {} spread throughout its code, as is common in Java.
 
10:15 AM
@R.MartinhoFernandes:Posso aprender português?
 
@VinayakGarg Why not?
 
@R.MartinhoFernandes oh, you can't let those exceptions by, you got'a catch them all!
 
Just for fun? would it be hard?
 
Isn't it there a shorthand for creating a constructor that zero-initializes all members?
 
I'm a bit biased for that. I learned it since I started speaking. It's just natural for me, I'm not sure I can say if it's hard.
 
10:18 AM
@R.MartinhoFernandes:Right, you can't tell
 
@Cicada the default one...
 
@thecoshman Mind typo.
 
@Cicada I want a blue one :D
 
@Cicada I don't think so.
 
@Cicada oh, didn't see your edit, you can initialise to zero with myStruct anObj = {0} but only for PODS IIRC
 
10:21 AM
Are there so many members?
 
No not that much. 10-15 maybe.
 
I'm sure you can solve this by throwing templates and/or regex at it
 
@Mysticial is it somehow possible for, say a * b to be superior to 1.0 when a and b <= 1.0 ? (In double precision).
 
@Cicada didn't you ask this before?
 
@thecoshman Yes, you can make a zero_initialized<T> wrapper and declare all members like that.
 
10:23 AM
I don't think so.
 
@Cicada That's not a real question. :P
 
Meh.
 
@Cicada a = -2, b = -2
 
What do you mean by "superior"?
 
10:24 AM
@R.MartinhoFernandes perhaps some CRTP as well?
 
Sorry, here's more detail: I'm doing a dot product on normalized 4D vectors. Classical implementation. Can the result be strictly above 1.0 or under -1.0 ?
(In theory, it's the cosine of the two vectors, so it shouldn't. But floating point is silly. Just making sure.)
 
It can definitely be rounded out of that range...
 
crap
Well thanks!
 
@Cicada assuming your inputs are in the range -1 to 1, you will be fine, except for potential rounding errors
 
> you will be fine, except for potential rounding errors
= you're not gonna be fine
 
10:27 AM
You'll be half-fine.
 
Which is ungood.
 
depending on how precise you need to be, you could just lame out and clamp the values
 
The most members I ever had in a single class: 101.
 
Gonna clamp, yes.
 
you'll be fuzzily fine...hm.
 
10:28 AM
Problem is, clamp = 2 branches.
 
see, I'm not just a pirate face
 
although, to get -1 or 1 the vectors would have to be parallel or antiparallel
 
@Cicada Not if you do it using SSE. :P
 
@Mysticial CUDA
 
10:29 AM
ah
 
CUSHIT
 
@ecatmur antiparallel... perpendicular?
@Cicada why is that such a problem?
 
@thecoshman reversed
 
@thecoshman because branching on gpu kills performance like hell
 
@Cicada You might be able to get away with intentionally purtubing the sum downwards.
 
10:30 AM
@thecoshman Branches on GPU => Very bad.
 
is there not an optimised clamp function?
 
Nope, even NVIDIA uses branches.
 
You think branching on CPUs is bad. CPUs can guess which way the train will go. But on a GPU, the train will take the time to go both ways.
 
I'm gonna say that if your normalisation is successful then you'll be fine
 
10:33 AM
@Mysticial All the trains will stop and go one at a time?
 
@Mysticial I loved that answer of yours.
 
@R.MartinhoFernandes Probably more like, go one way, backup. Go the other way - always. IIRC, unless all threads go the same direction, they will all execute both paths but predicated so that the threads that aren't taking the branch will null out the instructions until they rejoin.
 
@Mysticial sounds like quantum-higgs-god trains you've got there
 
@Cicada how are the vectors normalised?
 
10:35 AM
Anyways, 5:35 AM here. I need to sleep. Night...
 
Good night.
@ecatmur I just divide by length.
 
@Cicada that might not even guarantee that ||a|| <= 1
 
wait... are you normalising a normalised vector?
 
dot producting normalised vectors iirc
 
10:38 AM
No, she's normalising a normalised normalised vector.
 
oh yes
 
Just to be sure.
 
although, that was a page ago and I can't be bothered to scroll up
 
@R.MartinhoFernandes shut up you
 
@ecatmur What.
Normalise ALL the vectors.
 
10:39 AM
@ecatmur it shouldn't, a normalised vector should have length 1, exactly
 
@thecoshman Like floating point math is exact.
 
@R.MartinhoFernandes which is where the problem is :P
 
@thecoshman Sorry, I'm prone to silliness when I lack sleep.
 
@R.MartinhoFernandes got hibernate for a bit then... we will power you later, honest
 
Nah, I'm supposed to be working.
 
10:42 AM
@R.MartinhoFernandes and...?
 
@thecoshman try [1, 5, 0, 0]
normalise by sqrt(26)
I get the length of the resulting vector as 1.0000000000000002
 
that's a floating point rounding error
 
@thecoshman yes, quite
 
@Cicada "Isn't it there a shorthand for creating a constructor that zero-initializes all members" for PODs there is
 
((1/((1^2+5^2)^-2))^2+(5/((1^2+5^2)^-2))^2)^-2=1
assuming I haven't fudged the brackets
 
10:50 AM
@Nils There is? How so? You can't put a default constructor on a POD.
 
yes but you can zero initialize it
 
That's not the same thing.
 
@Nils you can zero initialise, using ={0}, but you can't do it automatically, it has to be done by the calle at initialisation
if your class HAS to have all values set to zero, it should not rely on the person creating the class to know they must create in such a way
 
yes but writing = {0} once, compared to initialize every member in the list
 
@Nils except, what happens when some one doesn't do it that way? your class is now broken
the constructor is responsible for making a valid object, not the caller
 
10:53 AM
I ended up with an innner struct holding all ptrs which are zero initialized
 
@thecoshman true, try it without the last sqrt though
 
then initialize my inner struct in the ctor
kinda automatically
 
Meh, I just do blah member = 0; or whatnot.
 
@ecatmur ¬_¬
@Nils my mental maths is not that good
@R.MartinhoFernandes it's too old school for these whipper snappers
 
What? I was expect "that's too recent".
 
10:56 AM
maybe I misunderstood what you did
 
@thecoshman why the ¬_¬ face?
 
struct foo {
    int bar = 0;
    double* ptr = nullptr;
    bool qux = false;
};
 
@R.MartinhoFernandes wan't some one please think of the encapsulation!
 
What encapsulation?
 
@R.MartinhoFernandes precisely!
 
10:58 AM
@R.MartinhoFernandes in 11 yes
 
There's nothing to encapsulate. A foo is a triplet of a bar, a ptr and a qux.
Anything you make up on top of that is worthless.
 
om nom nom time
 

« first day (641 days earlier)      last day (4290 days later) »