« first day (888 days earlier)      last day (4054 days later) » 

11:01 AM
"How can I improve my mastery over those words of power so that my incantations are more powerful"
At first I thought that 'software as magic' was a truly enchanting idea. The problem is that I don't like other wizards.
 
@LucDanton you know I always found that creating something truely etherial was facinating
 
It is!
 
software doesn't exist in a way people percieve
 
@R.MartinhoFernandes cv-ed
 
Although I love my brother programmer
I'm just inclined that way
 
11:06 AM
@BartekBanachewicz Hey, was it you who recently started using R?
 
@BartekBanachewicz I answered it with a shell session dump of compiling both and diffing the assembly.
 
@KonradRudolph why, no.
 
@thecoshman How interesting :P
 
Also, wait, C++ allows if(...) int x = 42;?
 
Xeo
Yes?
 
11:09 AM
that is not valid C++ syntax
 
Xeo
Unless ... is not meant as a placeholder
 
@R.MartinhoFernandes nope
 
well, why should it not? if creates a scope, right?
 
No it doesn't.
 
@BartekBanachewicz Ah damn. Who was it then? I need input from a geeky R user
 
11:10 AM
@FredOverflow g++ compiles fine with just the warning about unused vars.
 
@FredOverflow so you need explicit braces for a new scope?
 
Xeo
@FredOverflow Yes it does
 
I thought it wasn't allowed either, but that's because I always -Werror it.
 
Well, I'll be damned. Is this C++11?
Maybe I confused it with Java.
 
if (true) int x = 42; is IMHO the same as if (true) { int x = 42; }, which is obviously correct
 
Xeo
11:11 AM
@FredOverflow That should even be C99
 
user142019
@Xeo is or is not?
 
I don't get it. What were you guys expecting?
 
@KonradRudolph the only one I could remotely connect with R would be @Zoidberg
 
Do you think these helper macros are a bad practice? I clean them up, but I guess name conflicts are still possible if they were previously defined by another party. Lol it doesn't even work.
 
Xeo
@Zoidberg It is allowed if you replace ... with some actual condition
 
user142019
11:11 AM
@KonradRudolph School forces me to use R. :(
 
@LucDanton "error: unused variable ‘b’ [-Werror=unused-variable]" :P
@StackedCrooked I always prefix my macros.
 
@Zoidberg Ah. Hmm, maybe it was you … anyway, do you happen to have an actionable bind implementation for R? I dislike always having to write functions
 
user142019
@Xeo Oh wait of course.
 
@R.MartinhoFernandes that's -Werror...
 
@BartekBanachewicz I know.
 
user142019
11:12 AM
@KonradRudolph monadic bind?
 
@LucDanton It's an error in Java, so I probably confused it with Java.
 
@R.MartinhoFernandes My visibility macros were just SHARED and whichever the other one for the longest time :< Fixed that recently.
 
@Zoidberg Ah no, not quite … I was thinking bind in the C++ sense, i.e. partial application
 
I have no pity for anyone that uses macros named WHEELS_* or OGONEK_*. I don't step on anyone else's toes.
 
@R.MartinhoFernandes Just realized that I can't call the main macro anymore after cleaning up the helper macros. Doh.
 
user142019
11:13 AM
@KonradRudolph ohh.
 
Xeo
Yay, lunch
 
user142019
// @KonradRudolph
partially.apply <- function(f, ...) {
  capture <- list(...)
  function(...) {
    do.call(f, c(capture, list(...)))
  }
}
 
Also I need 180 more votes on Qs for a badge
 
user142019
Not quite like std::bind, but it comes close.
 
4
Q: Is a declaration valid inside an if block with no actual block?

Lightness Races in OrbitIs the following code valid? If so, what is the scope of x? int main() { if (true) int x = 42; } My intuition says that there is no scope created by the if because no actual block ({}) follows it.

What a sucker.
 
11:16 AM
What?
 
What?
 
Because he asked a question that arose naturally?
 
No, I mean he is just stalking us
 
natural questions
 
@Zoidberg Ah, quite nice … doesn’t work with positional arguments though, right?
 
user1357851
11:17 AM
if(true) x=2; else x=42;
 
Like a vulture, ready to grab his prey
 
user142019
@KonradRudolph not sure.
 
8 mins ago, by Lightness Races in Orbit
that is not valid C++ syntax
He took part in the discussion.
 
user142019
@KonradRudolph I have no idea how to do that.
 
oh nvm then
 
11:17 AM
@BartekBanachewicz Don't be such a meany
 
@R.MartinhoFernandes: Found your answer here
0
A: Is a declaration valid inside an if block with no actual block?

Lightness Races in OrbitGCC 4.7.2 says that, while the code is valid, the scope of x is still simply the conditional (https://ideone.com/MOnO5C). This is due to: [C++11: 6.4/1]: [..] The substatement in a selection-statement (each substatement, in the else form of the if statement) implicitly defines a block scope....

 
user1357851
@R.MartinhoFernandes 5 upvotes???
 
@TonyTheLion I upvoted it
 
user1357851
sometimes I think SO voting system is a joke
 
11:18 AM
@BartekBanachewicz \o/
 
user142019
Maybe ... works with positionals though.
 
user142019
I don't know much about R.
 
@LightnessRacesinOrbit meh, I was just grepping the standard for rationale :(
and you added the reference
 
@Telkitty That can be shortened to x = 42 - 40*true; ;-)
 
user1357851
11:18 AM
I saw a question with 8 downvotes and it was a perfectly legit question
 
There was a discussion about that on Stack Overflow but it didn’t yield any result … but they might just have overlooked something
 
@LightnessRacesinOrbit I think it's missing the part that makes it valid in terms of the grammar.
 
user142019
@FredOverflow eww implicit conversions.
 
@R.MartinhoFernandes OK
 
yeh the rating system and the people who close questions may be a little hasty
 
user142019
11:19 AM
@KonradRudolph spawn a new question!
 
Some languages have if-thingy non-declaration-statement for example.
 
user1357851
@FredOverflow or x=2 full stop
 
user1357851
thanks sherlock
 
@R.MartinhoFernandes Well, really? int x = 42; is a statement
 
@RolandSams we close questions
 
11:21 AM
> How can I pass a given std::vector<float> to a function to match the parameter type float (*parameter)[3] in C++?
huh?
 
@TonyTheLion ouch.
 
@FredOverflow Or maybe x = 42 - (true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true);
 
user1357851
are you forgetting the '-'? thanks for editing your text after my comment
 
What if the variable constructor has side effects? (I know, I am being picky) — Bartek Banachewicz 58 secs ago
 
user1357851
I prefer shell scripting and perl torture scheme
 
11:22 AM
@BartekBanachewicz No, that's quite relevant because that's exactly the use case for this.
@Lightness upvoted now.
 
@R.MartinhoFernandes Thanks :D
I got a downvote on my answer :(
 
lol
I bet it was because someone doesn't get that answering your own question is just fine.
 
@LightnessRacesinOrbit on Q too
 
ffs that really pisses me off
 
11:26 AM
I find if someone really tried to answer and was relevent I willl upvote them
 
this is a PERFECTLY formed Q&A!
it should have 50 upvotes and no downvotes!
compare with all the shite that gets upvotes
 
@LightnessRacesinOrbit lol
 
user1357851
@LightnessRacesinOrbit sounds like you can use some improvements on your rep whoring
 
Improvements suggested: ask crappy questions about weird artificial syntactic constructions. Post on reddit/HN.
 
user image
5
awwww
 
user1357851
11:30 AM
where are the garbage collectors
 
user1357851
Garbage colletion threads are running slow, maybe we should restart the lounge :x
 
Nah, garbage collection has been optimized for objects owned by Telkitty.
 
@Zoidberg For some reason the R folks call this “curry” instead of “partial application”.
 
user142019
88
Q: What is the difference between currying and partial application

SpoonMeiserI'm not exactly sure how to word this question. I learnt what currying was in the first year of university, and have been using it where applicable ever since. However, I quite often see on the Internet various complaints that other peoples examples of currying are not currying, but are actuall...

 
user142019
Once again, the R folks are wrong.
 
user142019
11:33 AM
The already were wrong with 1-based vectors.
 
the R is wrong FTFY
 
A really should read a book from this site in the advanced section. I would probably learn something but I have been short on time lately
 
Xeo
Currying makes partial application easier, but that's about it
 
But anyway, Roxygen’s “curry” does the same as your function (modulo a c) so it’s not helping
 
@KonradRudolph Probably because they have functions with multiple arguments instead?
 
user142019
11:33 AM
Then the name is wrong. :P
 
@RolandSams the sections are a joke. C++ Primer is listed as "beginner" and fuck me if it's a begginer book
 
@BartekBanachewicz It is intended for beginners...
 
@BartekBanachewicz hmm I will have to be wary then
 
It assumes zero C++ knowledge.
What else would it be?
 
@R.MartinhoFernandes Apparently I have zero C++ knowdledge, because some parts of it really make my brain overheat
 
11:35 AM
The fact that it takes a beginner far from the beginner stage is irrelevant.
 
user1357851
It is a beginner's book - that was the book I have used when I was a programming newb
 
@Zoidberg Wait, the c actually is helping, which to be honest I don’t understand …
 
foo(int (&)[5]) is my personal favorite from yesterday
 
(ref:)
19
A: higher level functions in R - is there an official compose operator or curry function?

ShaneBoth of these functions actually exist in the roxygen package (see the source code here) from Peter Danenberg (was originally based on Byron Ellis's solution on R-Help): Curry <- function(FUN,...) { .orig = list(...); function(...) do.call(FUN,c(.orig,list(...))) } Compose <- function...

 
@R.MartinhoFernandes it's extremely deep IMO. Which makes it such a good book in some way :)
 
11:37 AM
@BartekBanachewicz That's the C++, not the book.
:P
 
We already settled that I can't C++.
 
I am just hanging out here to look cool and pretend I know it.
@TonyTheLion NASA writes Lisp <3
 
user1357851
Android layout is still not working out properly, why is this world so mean to me, why???
 
lol NSFWish
 
user142019
11:40 AM
@TonyTheLion lulz
 
Also Kindle cloud reader seems really nice.
 
@TonyTheLion It's perfectly SFW. I don't see the N in it.
 
@R.MartinhoFernandes -ish
 
No, not at all.
Cats are SFW.
 
It's got the word FUCK in it, and a cat spreading it's legs
3
 
11:41 AM
Picard is SFW.
 
user1357851
Oh, got it working $
 
some might consider that Unsafe for work
 
Xeo
@R.MartinhoFernandes Not for @Tony - remember, he's a cat himself
 
@TonyTheLion Oh, right. Sorry, I forgot about the other side of the pond.
 
I'm being considerate here
 
11:42 AM
But the cat is fine.
 
It's... a cat.
 
It's cat porn
 
user1357851
Animals have sex, it is not porn
 
user142019
@FredOverflow where have I seen that before.
 
user142019
11:45 AM
@TonyTheLion ITT: Tony finally prefers same-species porn.
 
@TonyTheLion Charlie Brooker covered this years ago
 
-1
A: rename a file in c++

bash.dWhen working with Visual Studio, you usually work with wide-strings. In order to rename the file you can use MoveFileEx-function, you can rename the file like this. if(!MoveFileEx(tempFileName.c_str(), tempFileName.c_str() + _T("new.txt"), flags )){ //error handling if call fails } See here fo...

^ this needs more downvotes
> Chapter 12 : Dynamic memory
this is gonna get sick.
 
@LightnessRacesinOrbit interesting, thanks :)
so I sent an email to all my C++ coworkers with standard quotes on the use of inline
I have learned pedantry well
 
@BartekBanachewicz Tis fixed.
 
11:54 AM
@BartekBanachewicz I have some little sympathy with the poster. Strings can be concatenated with the '+' operator in other languages and, if you use more than one at a time, it's easy to make this mistake. While being obviously wrong with C-style strings, I have made this mistake more than once. :(
 
1
Q: Availability of threads in a thread pool?

SunilHow to find 60%(Or N%) availability of threads from a thread pool? What is the logic behind this? Parent thread spawning multiple urls using thread pool threads and waiting for the completion of all child threads. Code is given below; Parent Thread public void Save() { List<Job> Job...

this question is silly
 
@LightnessRacesinOrbit lol
 
Also, meh, I don't like string op+.
 
@MartinJames if you use .c_str() explicitly then you should know what you are doing
 
@TonyTheLion Yeah - I did read it, then placed in the 'can't be arsed to reply' bin.
 
11:55 AM
it's fucking c _str()
 
@TonyTheLion do you think they are gonna like that?
 
@BartekBanachewicz Yeah, OK, maybe I'll downvote for not finding the bug, rather than making it. I guess it it glaringly obvious, even without debugging.
 
@bamboon I just sent it as a note and a suggestion
I didn't write it in a way that could be construed as a make wrong
anyways, if they don't like it, then whatever
 

« first day (888 days earlier)      last day (4054 days later) »