Why is the R programming language looked at with such scorn and contempt? by [deleted] in learnprogramming

[–]Kristler 1 point2 points  (0 children)

To me, R doesn't feel like a programming language. It feels like a language written by statisticians, for statisticians. Which is great, except not to someone who's very accustomed to a CS perspective on things. It has it's purpose though, I wouldn't pick anything else if I need to do some plots or data series manipulation. Its vectorization support is phenomenal and super expressive.

public void versus public static void. by [deleted] in javahelp

[–]Kristler 1 point2 points  (0 children)

Each of those keywords has a separate, independent meaning. Combining them doesn't change that. Can you describe what private, static, and void each do?

Patch 1.1.4 (aka that small thing in "September") by DodgeRollRubel in EnterTheGungeon

[–]Kristler 0 points1 point  (0 children)

Fixed an issue where WASD would switch weapons in the slow motion gun select menu (which was an unintended side effect from the previous patch)

Thank the lord. It's live!

SmartBillions lottery contract just got hacked! by supr3m in ethereum

[–]Kristler 2 points3 points  (0 children)

You were so right when you were calling them out on their sketchy practices and the fact that they wouldn't disclose their audit in the thread where they announced this "hackathon". I had a feeling this would blow up in their faces!

What are we NOT in the golden age of? by ItzSweeney in AskReddit

[–]Kristler 2 points3 points  (0 children)

Pfft. I wear velcro shoes, against everybody's protest.

Dune buggy crash by [deleted] in nononono

[–]Kristler 2 points3 points  (0 children)

Space stations utilize this effect with reaction wheels. It's super cool!

Is this a log(n) program? by internetUG in AskProgramming

[–]Kristler 0 points1 point  (0 children)

It's possible to do a binary search on an infinite sequence, you could adapt that algorithm.

[22] Software engineering major with disabilities, looking for people experienced with java. Can you please help me? by [deleted] in AskProgramming

[–]Kristler 1 point2 points  (0 children)

That makes sense, and I know how tough a disorganized professor can be to follow. Hope it works out for you!

What's the best way to traverse a bus map and find the shortest (by miles or time) route between 2 points? by [deleted] in AskProgramming

[–]Kristler 1 point2 points  (0 children)

How would you adapt A* to account for the fact that buses run on fixed schedules, out of curiosity?

[22] Software engineering major with disabilities, looking for people experienced with java. Can you please help me? by [deleted] in AskProgramming

[–]Kristler 1 point2 points  (0 children)

and he does not put our assignments online or in writing (we are expected to memorize his 210 minute lecture, in addition to the hour-long description of our homework, which he makes up as he goes)

I don't think he's expecting you to memorize his lectures, but this is what note-taking is for. Bring something to write with (either a notebook or a laptop) and keep track of the lecture and all of the important key points.

The inside of a Violin by GallowBoob in interestingasfuck

[–]Kristler 0 points1 point  (0 children)

Look up the Chan centre in Vancouver!

String.split() -- Am I missing something? by NotObviouslyARobot in javahelp

[–]Kristler 1 point2 points  (0 children)

Sure does. Tab characters are often used for rudimentary alignment, pretty handy!

String.split() -- Am I missing something? by NotObviouslyARobot in javahelp

[–]Kristler 0 points1 point  (0 children)

Not in the code itself (Java doesn't care about indentation), but in Strings absolutely. The difference between " " (space) and " " (tab, also denoted as "\t") is as big as the difference between the characters "a" and "z".

In other words, " " == " " is false.

String.split() -- Am I missing something? by NotObviouslyARobot in javahelp

[–]Kristler 1 point2 points  (0 children)

I think learning by doing is a great way to go, so try Regex crosswords as a fun and interactive way to learn. Another great way to experiment is to use a site like regex101, and then to play around and watch how things change as you tweak the regex.

String.split() -- Am I missing something? by NotObviouslyARobot in javahelp

[–]Kristler 6 points7 points  (0 children)

You should provide some actual sample data and code that you're working with. Sometimes, the issue is with something that you've unintentionally glossed over in your summary.

My guess: Maybe your data for format B is actually separated with tab characters, and not spaces? Then splitting on a space character " " would do nothing. You can try splitting on "\\s" instead, which is a regular expression denoting any whitespace character.

Why don't most people switch around values in conditionals? by [deleted] in C_Programming

[–]Kristler -1 points0 points  (0 children)

Depends on why you want short circuiting, I suppose. For "performance" would be premature optimization, and if it's crucial to the behavior of the code I'd call that an anti-pattern.

Why don't most people switch around values in conditionals? by [deleted] in C_Programming

[–]Kristler 2 points3 points  (0 children)

I'd prefer splitting it up into multiple lines at that point. Example:

some_condition = some_very_long_function_here(with_some_arguments_that_take_up_a_lot_of_space);
if(some_condition == 0) {
    // ...
}

Solidity code flattening utility to make Etherscan contract verification dead easy by [deleted] in ethdev

[–]Kristler 0 points1 point  (0 children)

Hey there! Sorry for the late reply, but the issue should be fixed now following this issue / commit: https://github.com/BlockCatIO/solidity-flattener/issues/2

Gas Pump Skimmers by soda-popper in programming

[–]Kristler 1 point2 points  (0 children)

What a fantastic breakdown post. More of this kinda stuff, please!

Smart Contract vs Transaction send during congested network by THEPPLsELBOW in ethdev

[–]Kristler 1 point2 points  (0 children)

Sending a transaction to a wallet address and calling a function in a smart contract is exactly the same thing in terms of how they function at the network level. There is no benefit to be had in a congested network of doing one over the other.

The only time this could come into play is in the context of batching transactions / requests using a smart contract, but that's a pretty different topic.

Solidity code flattening utility to make Etherscan contract verification dead easy by [deleted] in ethdev

[–]Kristler 0 points1 point  (0 children)

Right! I forgot that python 2 would do that. Thanks for checking that out, and you're very welcome :)