« first day (699 days earlier)      last day (4475 days later) » 

12:00
Because being a developer is lame.
@ereOn ConcreteMultipletonPOJOClass
@TonyTheLion No, it wouldn't be valid. malloc() returns a void*. You can't cast that to a int** without looking like an insane idiot.
@TonyTheLion If it were possible to express int (*)[size], it would be valid, assuming the rules of C when it comes to lifetimes are similar enough to those of C++.
Xeo
Xeo
@LucDanton So, the question is, should I say to never std::move automatic value type variables?
@Insilico I thought it was different in C. In C++ you'd have to cast that, but I'm not so sure about C
12:01
did you guys see those topless pictures of Kate Middleton?
@DeadMG: I took them actually.
@Xeo I don't know how to put it in simple terms while still being palatable tbh. I'm not saying the answer needs fixing, I'm pointing out the technicality.
@Neil In C, you don't have to cast the void* to an int*. What I'm saying is you can't go from void* to int** without someone thinking WTF IS THIS.
@DeadMG she forgot to cc me
Xeo
Xeo
I think I see what you mean. int&& rv = get_int(); return rv; will not automatically move - or will it?
12:03
@Insilico I agree. As I mentioned earlier, I think you could. But could and should are not friends
@Xeo Won't.
Xeo
Xeo
And I need to amend that answer anyways to include the fact that the variable type and the function return type after RemoveCVing them needs to be the same (It's actually a precondition for copy elision, but people might not know that)
I do think that you could cast anything into anything in C at your own peril
Honestly multidimensional arrays in C or C++ are a pain in the ass.
@Insilico I don't disagree
std::vector<std::vector<int>> vv is much easier :P
12:06
You're better off just allocating a giant 1D array and fake multidimensional indexing.
Xeo
Xeo
@LucDanton Right, if the return type is int, it won't, since the cv-unqualified type isn't the same (precondition for copy elision)
I wonder about when the return type is int&&, though.
@TonyTheLion So you have multidimensional vectors, not arrays. :-P
@Xeo Won't either.
Xeo
Xeo
nvm, a reference is not an object, right?
12:07
Right.
@Xeo Yes, references are not objects.
sbi
sbi
Oh, the robot's away? Damn. Anyone else here knows any Powershell?
@sbi You trying to make me projectile vomit?
@sbi Unfortunately I don't know enough Powershell to answer that question. :-/
The extent of my Powershell capabilities is renaming files en masse.
sbi
sbi
@Neil Thanks for showing how much you care.
12:09
I know about PowerShell.
@sbi I hate it.
@sbi It's not what you think. It's actually vomit that smells like spring
sigh
I hit my head enough times to know to stay away from dos shell and bash
I only use ant scripts now since they'll work on any os
@Neil Wut
12:11
I know nothing
2
sbi
sbi
@sehe Let's say I'm not fond of it, but it's OK, certainly much better than batch files, and IMO also better then bash.
Apache Ant is a software tool for automating software build processes. It is similar to Make but is implemented using the Java language, requires the Java platform, and is best suited to building Java projects. The most immediately noticeable difference between Ant and Make is that Ant uses XML to describe the build process and its dependencies, whereas Make uses Makefile format. By default the XML file is named build.xml. Ant is an Apache project. It is open source software, and is released under the Apache Software License. History Ant ("Another Neat Tool") was conceived by James D...
Fuck anything with the word Apache in it
meh
@sbi Bash is a tough deal too. But I don't see PowerShell as being better. In my case, it is YetAnotherAwkwardSyntaxMess to learn
sbi
sbi
@TonyTheLion Your parents been shot by them damn indsmen?
12:13
huh?
lol
@TonyTheLion Apache software has many very good libraries.
hope you're not referring to Xerces
cause that's horrible
sbi
sbi
@sehe PS has the objective advantage that it can pipe arbitrary types, instead of only text. That makes some operations a lot easier.
$SvnInfoXml = [xml] $(svn info --xml $path.FullName)
if(!$?)
{
  throw "No svn info for path `"$($path.FullName)`""
}
return $SvnInfoXml.info.entry.url
WTF?
@sbi That would be fine in csharp.exe
if(!$?)
lol
12:15
@sbi I laugh at you.
@sbi That's neat. Nothing I couln't do in bash. Just use one more external. Xmlstarlet, xmllint --xquery and just regular python / perl stuff (that's cheating? Well, it is more flexible too)
Have you ever tried passing parameters containing spaces and quotation marks in a batch file? HAVE YOU!?
@DeadMG it's a trigraph :P
sbi
sbi
@sehe ??
@DeadMG Think %ERRORLEVEL.
I have no idea what %ERRORLEVEL is.
12:17
It's almost literally a pain in the ass, since you're having to sit in the same spot all day fixing your batch files
Xeo
Xeo
@DeadMG think return value of last command
Windows has its own peculiar way of dealing with executable parameters
Apr 18 at 13:34, by R. Martinho Fernandes
$ cat hello-world.cs
#!/usr/bin/csharp
Console.WriteLine("Hello world!");
$ chmod +x hello-world.cs
$ ./hello-world.cs
Hello world!
$
sbi
sbi
@sehe I know you can do that. You can get the same info as pure text from svn, after all. I, however, always needed some Unix command line guru within arm's reach to do such stuff. And it's very easy to do just in Powershell.
@DeadMG DOS batch scripts.
ah ok
I'mma just stop asking questions now since it's way out of my expertise
and oh fuck me, Google recruiter is calling me in 10 minutes.
12:19
@DeadMG Are you nervous ?
yes
PS is to command shells as Silverlight is to flash - pathetic attempt to recover lost ground by Microsoft
@sbi You just came in looking for your local PS guru! (Just kidding.)
Yeah, because bash is so much better.
And not arcane at all.
bash is flexible, and that makes all the difference
12:20
Lol.
PowerShell at least was designed and not cobbled together.
flexibility makes a whole lot of difference
(disclaimer: IDK what you're talking about, but flexibility is important)
@DeadMG Do you know if it will be a test now?
I've no idea.
I think she wants to get a feel for what I'm interested in, but I'm not sure
sbi
sbi
@LucDanton Yeah, but the robot isn't here!
If some of you wish to read the Qt-Style Design in C++ document, I'd be glad to have your opinion.
12:22
@DeadMG Oh it's a girl, then it will be no test
sbi
sbi
@Neil I have the feeling you're way out of your depth here. As I've already said further up, bash only allows passing strings between commands, PS allows passing anything. How then can bash be considered to be more flexible?
@ManofOneWay I doubt if she'll be asking questions to determine which font he likes best
sbi
sbi
@ManofOneWay Ouch.
@ereOn So far the document is actually pretty decent.
I wouldn't put too much emphasis on "Be easy to memorize" though.
A non-shitty IDE makes that point somewhat moot.
@DeadMG The most I've had on a phone interview was some very basic techy questions. Then they also just want to know about you and your experience etc
12:25
@sbi That's kind of irrelevant
When are you going to be able to pick Bash over PS?
Common one: What is the difference between a pointer and a reference?
Been asked that a dozen times on phone interviews
sbi
sbi
@TonyTheLion I think there's an FAQ entry for that.
@sbi Likely
Qt's concept of "Static Polymorphism" might be confused with the CRTP.
sbi
sbi
@Neil What?
12:27
@TonyTheLion Pointer sucks. :v
@TonyTheLion Well, one would have expected that my CV clearly indicated that I had none.
@sbi What?
sbi
sbi
@Neil How in the world is that irrelevant?
@DeadMG They will probably still ask more details.
@Neil How is that irrelevant, how does that make any sense.
12:28
My my, two people asking me how it is irrelevant when my very next line explained what I meant by that.
> Which is best for out-parameters, pointers or references?
Neither. Use return values instead of out-parameters.
yo momma
LOL
doc.trolltech.com/qq/qq13-apis.html is not bad except for the "Pointers or References?" section.
@Neil Yeah, it still doesn't make sense.
PS is not flexible because... what?
here comes robot @sbi
12:31
What's up?
sbi
sbi
@Neil I have no idea what you are asking with that next line, but I could pick bash over PS anytime.
24 mins ago, by sbi
Oh, the robot's away? Damn. Anyone else here knows any Powershell?
@TonyTheLion Thanks!
I wouldn't pick bash for anything ever. I wouldn't pick PS, either, but still.
BASH is good for sequentializing downloads. Or just download scripts.
@sbi :) I'll have a quick look, but I'm having lunch in a few minutes or hours depending on the disposition of the other denizens of this physical room.
12:37
It's okay, you don't have to starve yourself on our account.
sbi
sbi
@LucDanton Speak for yourself!
@LucDanton Oh god, that's not what I meant.
That's a late lunch.
Argon walked into a bar. Bartender says "We don't serve your kind here". Argon was too noble to react.
@sbi I don't think you can do that with a single parameter set.
But it should be doable with more than one.
12:45
@TonyTheLion badum-tish.com
sbi
sbi
@R.MartinhoFernandes Ok, thanks. I will take up the cow-worker who suggested on the issue as soon as I get hold of him.
Look up the ParameterSetName argument of the Parameter attribute..
sbi
sbi
@R.MartinhoFernandes Oops. What does that mean?
@sbi You can have different sets of parameters, kinda like overloads, and PS will pick the one that fits best.
sbi
sbi
12:47
@R.MartinhoFernandes Ah, Ok. I did that, too, in the command line libraries I implemented. Lemme look that up.
user1182183
Have to admint the system at my school is secured enough to keep me away from sensetive data : p congratz lol, didn't expect them to do that. 4 years ago it was a different story.
Xeo
Xeo
2
Q: C++ Conditional operator performance

KolyunyaI've a conditional statement foo which is false in 99.9% cases. And I have a conditional statement bar which is true in ~50% cases. And I want some action be done if both statements are true. So I almost certainly know that foo is false and I want to check it only if bar is true. Will the code ...

I love it when people leave out the important details.
right
it actually didn't go that badly at all
Xeo
Xeo
Your phone screening?
@Xeo In performance questions, details never matter, silly.
user1182183
12:55
hmm kinda wondering how fast an if statement actually is with var == var2
user1182183
how to test that? :P
Xeo
Xeo
@R.MartinhoFernandes Of course, my bad.
@GamErix Like this:
Xeo
Xeo
@GamErix at most two loads and a cmp + conditional jump. If var1 and var2 are built-in types.
If not, two loads and a call to the respective operator==
12:56
asked me some algorithm and data structure questiosn
@GamErix You don't test it. Unless all your program does is compare one variable to another.
user1182183
@Xeo ye but assembly code takes time to execute, I'm just wondering how fast my PC can do that
@GamErix Then don't let assembly code near your CPU.
In case all your program does is compare one variable to another, then you can test it by just running the program.
user1182183
12:57
@R.MartinhoFernandes sorry i ment binary code
Then you ask yourself: "Did that run fast enough?" and answer "Yes."
user1182183
forgot that exe's aren't asm...
@GamErix Then don't let binary code near your CPU.
@GamErix oh noes, things take time to execute.
user1182183
@R.MartinhoFernandes int a,b; a = 1,b = 2; /*start measure*/ if(a ==b){} /*stop time measure */ print
12:58
What about?
This doesn't measure anything.
user1182183
I don't think C standart has high res timers?
Mostly because all of that code will be optimised out.
Benchmarking an isolated equality comparison is already silly in itself, but doing it when the compiler can precompute it is even worse.
Xeo
Xeo
12:59
Wtf, the bool question seems to have had a rollback
Without any edit history
user1182183
@R.MartinhoFernandes then i'll assign a pseudo random generated value? :P
voting to close
@Xeo It was the OP, within five minutes of the previous edit.
@Xeo Someone posted a duplicate?
who's with me?

« first day (699 days earlier)      last day (4475 days later) »