« first day (745 days earlier)      last day (3264 days later) » 

9:00 PM
@Lyle'sMug Sounds like a good summer project.
 
0
Q: Conway's Game of Life-JavaScript

ZacharyI cannot figure out how to move to the next generation or if my "rules" even make sense or work. I have the neighbors declared and working. I do not know where to go from here or how to do it. I need help getting started on these issues. HTML Code <!DOCTYPE html> <html> <head> <title>G...

 
@Mast Jetpack JoyRide
 
9:19 PM
O...m...g...
> Hey there,

I’m really sorry to send you an email like this.
I would use twitter but an email will be easier.

I just saw one of your post on stackoverflow
http://stackoverflow.com/questions/29737903/parse-not-displaying-all-data-in-tables

and i would like to know if you would mind sharing your code for the table view.
I’m new to parse and swift and i’m having quiet some issue to populate all the cell after getting the data from parse.
Probably an issue with block and asynchronous data but i’m really getting stuck.
 
Oh god, popcorn is stuck on the back of my tounge... NOOOOOOOOOO
 
So, I just got that email.
If you click that link, you'll see that my only involvement with the question is via editing it.
I've posted no comments and posted no answers
 
I feel like all of my Python answers are "broken records".
 
Greetings
 
Greetings
 
9:30 PM
Hello @IsmaelMiguel
 
May I ask just something really quick?
It will sound like I'm fishing for views
But basically I'm stuck until someone says "your code sucks"
Just a few days
I only will ask someone to look at the comment matching and say something about it.
 
Monking
 
I'm writting the CSS highlighter and I need to know how bad it is
 
@IsmaelMiguel Your code SUCKS! (happy now?)
3
 
Before I go around touching on comment
 
9:33 PM
@Heslacher ǫniʞnoM
 
@SimonAndréForsberg A reason would be nice.
 
oh... right.
 
hey @EthanBierlein
 
I'm not asking an answer in the question
I'm not asking anything else
I just need an opinion on that very specific bit, before I spread bad code everywhere and need to change it everywhere
 
9:34 PM
That's the final result
 
The comment matching looks like it works fine to me, if that is what you want to know
 
What I wanted to know is how many crimes I have in that piece of code
 
I don't see one for inline -- this is a comment though, does that work too?
 
You can copy it to a new answer and test it there (clicking in the "Edit this snippet")
But yes, it works
 
Your comment highlighting works fine, unlike mine.
 
9:36 PM
Can I check yours?
 
My highlighter still highlights keywords and such inside comments.
 
@IsmaelMiguel So which piece of code specifically? The JS code? The CSS/HTML? The SQL?
 
@Phrancis The Javascript. Just look for the 2nd code block. Around line 8.
 
Completely a non-sequitur, but:
16
Q: Can I build a space elevator from superman's hair?

Lump In Superman IV: The Quest for Peace (imdb) a single strand of Superman's hair is seen suspending a 1000lbs weight. Is is possible to build a space elevator from strands of a super strong human-hair-like material? How long would it take to harvest enough hair from a superbeing like superman to...

 
9:39 PM
The first code block looks like the meat of it (to me at least), the 2nd code block is mostly just regexes
 
@Phrancis Exactly. That's that part, but just the 2nd element.
 
Is there any reason you're not using strict mode?
 
@EthanBierlein From what I can see, you did it differently than me. I'm only highlighting the text nodes, you are doing it directly with the innerTextfrom the element.
@Phrancis Not really. It seems to work fine with and without it.
 
in JavaScript on Stack Overflow Chat, May 2 at 20:16, by Madara Uchiha
@Phrancis Always always always strict mode. No exceptions.
 
@Phrancis Stupid question: why?
 
9:44 PM
throw anException;
 
Variable scope safety, mostly
var i = "hello";
for (var i = 0; i < 5; i++) {
    console.log(i); // 0,1,2,3,4
}
console.log(i); // 5

________________________________________

"use strict";
let i = "hello";
for (let i = 0; i < 5; i++) {
    console.log(i); // 0,1,2,3,4
}
console.log(i); // "hello"
 
@Phrancis I think that is showcasing the let+"strict mode" effect, and not one or the other.
@nhgrif Was that for me?
 
Well yes, but the guys I talked to say they almost never use var, always let
 
1
Q: Using setTimeout to get scrolling chat window to work, but doesn't feel like the ideal solution

BrendanMy friend and I are working on a bare-bones chat web app, using Angular on the front end. He's using Swampdragon for some of the real-time stuff. My task that I set out to achieve was to get the chat window to scroll to the bottom when a chat room is loaded (most relevant bit is $dragon.onChanne...

 
What does let do?
 
9:47 PM
@Phrancis I want to avoid new-ish stuff.
 
I've always used var for declarations.
 
@IsmaelMiguel Sounds like you're in the wrong profession.
 
foo = 42; // global
var bar = 42; // local
let baz = 42; // tight scope
 
Probably. Web dev isn't something I want to get into too deeply.
 
let only works in "use strict";
 
9:48 PM
@nhgrif Sorry for wanting my code to work on the biggest number of plataforms.
 
I only just create "toy" projects and such.
 
@IsmaelMiguel There's a difference between that and "avoiding new-ish stuff"... I'm not a web dev so I don't know what works on what or what percentage of Internet users are on what version of what.
 
@nhgrif If you were, you would know that 'avoiding new-ish stuff' is an evil thing that must be done. I just hope that ES6 takes over and everybody uses browsers with ES6. Then I can stop 'avoiding new-ish stuff'.
 
JavaScript works on practically everything. But then again, so does Java, and is a far superior language
 
Erm.
Apples & oranges?
 
9:57 PM
Well, yes of course
I guess that wasn't a very good comparison
 
Swift is a far superior language to C#. I wouldn't use Swift to write a Windows application.
 
@Phrancis It is, but you don't have arrow functions in IE11 and Chrome
 
@IsmaelMiguel I thought the only major browsers that didn't support ES6 to a reasonable extent were older versions of IE?
Oh, didn't know about Chrome
 
But it is true, Chrome doesn't support ES6. You need to set a flag, and it won't have arrow functions.
 
I just today had an extended discussion with Madara / Second about js vs. Java and 'backwards compatibility'
 
10:00 PM
I honestly think your selfie answer addresses some good points
 
I smell a but...
 
@Phrancis Was it to me?
 
Yes
 
@nhgrif Is it even possible to use Swift to write a Windows application?
 
I do have one thing to say, but is mostly aesthetic. I think the color scheme you used for the code is difficult to read; semi-dark highlights on black BG
 
10:04 PM
Well, I suck on that part.
 
I think I am starting to understand Delegates and Lambdas!
 
I tried, but I suck
 
more learning after dinner!!
 
What scheme would you suggest?
 
@IsmaelMiguel If that can help I've actually made a number of different CSS templates you're welcome to inspire yourself from. It's for Code Prettify but it should be easy enough to adapt
 
10:05 PM
@SimonAndréForsberg Probably not.
@Lyle'sMug In Java?
 
@Phrancis I will definetively look into them
 
@SimonAndréForsberg I mean... there's only one Swift compiler...
 
@nhgrif aren't delegates the same in every oop language??
 
@nhgrif no in C#
 
10:08 PM
 
@Phrancis Your templates look a lot better than mine.
 
@Vogel612 I don't know.
 
@Vogel612 the syntax is probably different
 
What's your understanding of C# delegates so far?
 
Well in Java delegates are just yet another design pattern...
They're not special
 
10:09 PM
I like Groovy delegates. But that might be a completely different subject.
 
well I looked up Func<> and that helped me out quite a bit. this MVC book had me create an Extension method with a delegate for filtering
 
1
Q: Are real private variables in ES6 possible?

AWolfAt the moment, I'm learing ES6 and how to write classes. And I'd like to know if I'm doing things right and I have some points that are not clear to me. Please find my code here at bitbucket and below. The demo uses System.js for dependency loading, jspm for package management and babel for tra...

0
Q: JavaScript Table Sorting - tablesorter (parse on the fly) vs stupidtable (`data-` attributes)

iambriansreedI am trying to get a grasp as to which jQuery table sorting method/plugin is better. Tablesorter Parses all the table data to sortable data. Stupid Table Plugin Allows the dev to add sortable data to a data- attribute. While "Stupid" doesn't have to parse a crap load of data it can make...

 
a delegate is like a Method placeholder, @nhgrif? or a method variable?
 
Isn't that overcomplicating it??
 
Are you asking or telling? I don't necessarily know what C# means when it talks about delegates.
 
10:10 PM
Why not use a simple Predicate ??
Also I'm probably too java infected then...
 
> C# delegates are similar to pointers to functions, in C or C++. A delegate is a reference type variable that holds the reference to a method. The reference can be changed at runtime.

Delegates are especially used for implementing events and the call-back methods. All delegates are implicitly derived from the System.Delegate class.
from one of the pages I found when trying to figure out what a delegate does.
 
So, see, @Vogel612, they're not the same in all languages.
 
I don't necessarily know exactly what a pointer does either, because I have never learned C or C++ I have a general idea though
 
data.stream().filter(stuff::filter).map(stuff::mapper).reduce(custom::combiner).collect(Collectors.toList())
 
10:13 PM
it's like creating a method parameter in another method
 
Fuuu... mobile chat is a jerk.
 
And actually, looking at the example I just linked, I'd argue that a C# delegate is more like a definition of a function/method signature so that function pointers (which match that signature) can be created.
 
@Lyle'sMug soo... it's just like java's MethodHandle then??
 
What's MethodHandle?
 
@nhgrif that sounds like a good description, but a little confusing.
@Vogel612 not sure what that is either
 
10:15 PM
Java has a Method type.
Java has to use reflection to get a method out and use the Method type to hold a pointer to that method.
 
Method is reflection API
 
C# can use delegates to do it without reflection.
 
And not quit true
 
That's what MethodHandles do
MethodHandles are simpler than Methods
 
10:17 PM
294
A: Understanding events and event handlers in C#

Rex MTo understand event handlers, you need to understand delegates. In C#, you can think of a delegate as a pointer (or a reference) to a method. This is useful because the pointer can be passed around as a value. The central concept of a delegate is its signature, or shape. That is (1) the return t...

 
And it looks like MethodHandle is still more complicated than C#'s delegate.
 
0
Q: Sum of factorial digits

user241506I have seen one algorithmic task and I am not sure if my solution is fully efficient. As input to the method you are given positive integer N. And you should return the sum of values of the digits in a decimal representation of N!. For example, given N = 6 the function should return 9, because N...

 
Gimme a sec to paste from the relevant javadoc
 
And in Objective-C/Swift, we do delegation using the Protocol/Delegate pattern and it is wonderful.
 
> A method handle is a typed, directly executable reference to an underlying method, constructor, field, or similar low-level operation, with optional transformations of arguments or return values.
 
10:19 PM
But actually, C#'s delegate is closer to Objective-C's block or Swift's closure.
Actually no. Those are like lamdas.
 
a lambda makes the Delegate easier to use, from what I have seen in the exercise I am working on
I will look into more after I get home and eat some dinner
 
Well you can make a lambda / closure obey the 'contract' of the delegate...
 
Not easier, it's different.
 
And that's also how java lambdas work...
 
A lambda is essentially just an inline function.
Sort of.
 
10:23 PM
I see.
 
what lang.??
For C# ... maybe... I wouldn't know.
For java ... no definitely not
 
There is no way in the name of god that one can get the ~~illuminati~~ illuminator badge.
 
I'm not sure "inline function" is the best description, but Java lambdas are the same as C# lambdas and the same as Objective-C blocks.
 
For limited definitions of "the same".
 
It's possibly harder for Java/C# devs to see that since in these languages everything has to be called on something--there are no "free" functions.
 
10:27 PM
meh..
 
But... in Objective-C, I could have the following C function:
int add(int a, int b) {
    return a + b;
}
OR, I could have the following Objective-C block:
int (^add)(int a, int b) = ^(int a, int b){
    return a + b;
}
And both do the same thing and work exactly like this:
int four = add(3,1);
For Java or C#, you could do the same thing... the syntax would be different.
Once you get into some specifics and details, I'm sure there are some differences... but for understanding the basics, the gist of them is the same at least up to this point.
 
well ya kind of...
 
And in Objective-C, we can do what C# does with the delegate keyword with our typedef:
 
But what is the point you want to make with that?
 
typedef int (^IntegerMathBlock)(int, int);
 
10:32 PM
that's what @FunctionalInterface does in Java 8...
Just slightly more verbose...
 
@Vogel612 That they are the same, at least up to the point that @Lyle'sMug is ready for when it comes to learning about blocks/lambdas/closures
 
Hmm.. soo they aren't the same....
Eh well.
 
@Vogel612 That's not the same as @FunctionalInterface. @FunctionalInterface is more akin to Objective-C's protocol.
 
On a related note... is there a difference between lambda and closure?
 
-1
Q: The longest subsequence with specified difference between min and max

user241506As an input you have non-empty zero-indexed array of integers. The goal is to find the longest subsequence (any sequence obtained by removing some elements from A), where difference between min value and max value does not exceed 1. For example, given array: 6,10,7,7,9,8 function should return 3....

 
10:35 PM
I don't know enough of the specifics, and I don't know which is which, but some of them make a copy of variables it grabs from its scope, others make a strong reference to it.
So there are memory implications.
 
@nhgrif that's because a functionalInterface is always an interface which is what obj-c protocols are (from what I gather)
 
@Vogel612 Yes.
This: typedef int (^IntegerMathBlock)(int, int); is for just creating a single function "type" (called IntegerMathBlock in this case)
 
Eh well it's TTGTB and since my head is smoking already I'll just give up here for today ;)
 
11:09 PM
0
Q: Deobfuscate a JavaScript return

Sam HolguinI'm learning RequireJS through deconstructing a code snippet and came across the following compressed return statement: return 0 === rect.width ? !1 : rect.bottom < 0 - this.tolerance ? !1 : (window.innerHeight ? window.innerHeight : document.documentElement.clientHeight) - rect.top < 0 - this.t...

 
11:21 PM
:) the code works, but the output is not even close — Sam Holguin 12 secs ago
 
@CaptainObvious I'm not quite sure if my close reason was good enough. Either way, I've given it my downvote. And yet another mention of "it works, but it doesn't quite work."
 
@Jamal I'm trying to be nice about it, but I really think this should be on SO (with more details about expected vs. actual output)
@Phrancis we're arguing over split milk here.... Both versions work in regards to the end goal, however I would like my version refactoring — Sam Holguin 2 mins ago
 
"the code works, but the output is not even close" what does that even mean
 
This question is more suitable for Code review. — Ashwini Chaudhary 43 secs ago
 
I think that question needs drastic improvements.
 
11:30 PM
Can we go ahead and delete this? I hate to retag it and bump it into the reopen queue.
 
If his code works, he should remove the version he "reverse engineered".
 
-4
Q: Simple betting game in python not working

Kaan ASo the problem I am having with this code is that when I run the code, there are no issues, however when it gets to the result of the dice roll, it does not subtract money if the person lost the bet, and it doesn't add money if the person won the bet, so what do you think the issue may be? Follow...

 
@mjolka Not sure. OP says it works, so, vote of trust
 
Isn't there a Reverse Engineering Stack Exchange?
 
11:32 PM
I'm not saying his question is off-topic here or that his question belongs there, but the reverse engineering aspect of his question is unclear and muddles the question.
 
@Phrancis you're more trusting than i am :)
 
Yeah... "The results aren't even close". Broken.
> But it compiles and runs!
 
@RubberDuck On an absolutely related note:
3
Q: Should the "broken code" close reason be reworded?

nhgrifHere are our current close reasons: As @rolfl explains here, the gist of each of these three close reasons can be roughly summarized as: your code works as intended it is your code (real code) the question must have the right presentation (include the actual code). Importantly,...

 
@mjolka I'm just walking away from that one
 
Self-deleted anyway
 
11:36 PM
I saw that earlier.
 
@nhgrif Maybe they should take it to PPCG, they're experts at obfuscated code...
 
That's not really what he's asking for.
 
I know, I'm mostly joking :)
 
He's not asking for the code to be obfuscated. He's not asking for it to be deobfuscated.
Meh, self-deleted so moo point.
I've not come up with a good idea for how that close reason should be worded yet, but I think it needs work.
 
11:39 PM
Moo
 
Mooooo
 
2 mins ago, by nhgrif
Meh, self-deleted so moo point.
 
MOOOOOOOOOOOOOOOOO
 
Errr... I mean quack!
 
11:40 PM
Am I missing some sort of barn-fest?
2
 
Is this The 2nd Monitor or The Secret Cow Level?
 
BARN-ANIMAL-FEST
 
> Did I miss the onomatopoeia-fest?
 
You guys have never heard of the phrase "moo point"?
 
You mean "moot point"?
 
11:41 PM
It's like a cow's opinion. No one ever listens to cows.
 
I've heard "moot point" more, but it wasn't too hard to figure out that moo point was the same.
 
Lol. No. They don't.
 
Those cow are more bad ass
 
@Marc-Andre I remember when these graphics used to look really good.
Hmm, just earned "Mortarboard" on CR Meta.
 
11:53 PM
Interesting.
That can't be right.
 
Writing code for two hours without pressing compile once sounds like an excellent idea. — nhgrif 7 secs ago
 
Totally.
 
@nhgrif They still look good!
@nhgrif yup, even though there's no reputation on Meta sites, those badges are available just as if there was reputation.
 
Wow, for running ping -c 1000 codereview.stackexchange.com, I'm getting quite a bit of latency on my network.
 
11:59 PM
The lowest latency I get is about 64 bytes from 104.16.12.13: icmp_seq=33 ttl=54 time=459 ms.
 
RELOAD!
 

« first day (745 days earlier)      last day (3264 days later) »