This is my first time making my own program, so please say anything that could help me, thanks
from easygui import *
import random
choice = ["+", "-", "x"]
question_number = 1
correct = 0
msgbox("This program is to help you get better at doing maths, you will get given a random set of random qu...
You may have answered your own question. @Bergi 's accepted answer indicates Parse promises are not A+ compliant by default and the first code review point says that after making them compliant "Exceptions in then callbacks are caught and lead to the rejection of the result promise, instead of a global error". It would seem you can use Parse and JS promises together provided you make Parse promises compliant first. — Traktor5330 secs ago
Doing something n times
You have a loop asking 10 questions, which you implement like:
question_number = 1
...
while question_number <= 10:
...
question_number = question_number + 1
...
This works, but we can do better. The problem with this loop is that it's error-prone. It's thr...
I managed to get help enough to clear 1/3 of my issues and 2/3 of the blocker risk issues
Martin Seamus "Marty" McFly is a fictional character in the Back to the Future trilogy. He is portrayed by actor Michael J. Fox. Marty also appears in the animated series, where he was voiced by David Kaufman. In the videogame by Telltale Games, he is voiced by A.J Locascio; in addition, Fox voiced Marty's future counterparts at the end of the game. In 2008, Marty McFly was selected by Empire magazine as the 12th Greatest Movie Character of All Time.
Eric Stoltz was originally cast as Marty McFly, but after five weeks of shooting scenes for the first film, director Robert Zemeckis and executive...
public CommandState GetCommandState(GoToImplementationCommandArgs args, Func<CommandState> nextHandler)
{
// Because this is expensive to compute, we just always say yes
return CommandState.Available;
}
This code is a page scraper using HtmlAgilityPack that creates a DOM document upon construction and allows for node manipulation afterward.
HtmlAgilityPack uses XPath Selectors for selecting nodes.
An example use case would look like:
var me = new PageScraper("http://codereview.stackexchange.c...
Please review my implementation of the MineSweeper-Game Kata. Any and all feedback will be much appreciated. I would love to hear your feedback on readability, simplicity, performance, and any code smells. I even welcome nitpicking. Overall I want to know is the code clean (I know there is always...
Pro tip: if you ever need to do a proof-of-concept demo for a non-techie, and you haven't had time to make it look pretty, then do something obviously deliberate to make it look ugly. That way they don't get hung up nitpicking the UI when you want them to focus on the functionality.
First two comments from my general business teacher:
> You’re off to an outstanding start in our discussions! You exceeded both the frequency and quality requirements by posting multiple high quality and full credit posts on more than two different days and you started by Wednesday. I’m looking forward to hearing more from you in the coming weeks!
> You did an awesome job with the online research assignment! There was just one correction. Question 2 asked for 4 Do’s and 4 Don’ts for naming a business. You provided only 2 of each. (-1.5)
So, instead of fixing a bug I made, my colleague comments "WHY DID YOU ADD THIS?" above the line in question, and then made and tagged me in an issue -__-
Next release of Rubberduck will introduce a very cool @Folder annotation system that the Code Explorer will use to organize modules into - you guessed it - folders:
...which is tremendously awesome, because VBA doesn't have any concept of namespace, and the VBE doesn't offer anything better th...
please check my simple code of to top smooth scroll,
is it good written or no may be some suggestions
may be you have some suggestions
function SmoothScroll(){
var current = document.getElementById("top").offsetTop,
topY = document.body.offsetTop;
var t;
var timer_is_on = 0;
this.timedCou...
I have a simple full-stack Javascript Application. It uses NodeJS, ExpressJS, and ClementineJS.
My application is supposed to mimick this codepen.
I am doing that successfully, but I have a ton of logic in my index.js file. I was just wondering if there was another, more appropriate way to stru...
I have built a program that handles the basic scheduling requests for CodinGame's Super Computer challenge.
Specifications (taken from CodinGame)
The Goal
In the Computer2000 data center, you are responsible for planning the usage of a supercomputer for scientists. ​Therefore you've decide...
You want something fast and efficient.
But did you really check what this method does :
public static long intSqrt1(long number) {
long sqrt = 0L;
while ((sqrt + 1) * (sqrt + 1) <= number) {
sqrt++;
}
return sqrt;
}
Your counting 3 times sqrt with 1.
I don't see any r...
@Heslacher hey there ;)
I'm stunned that @rolfl didn't say anything about that
This is my first Spark Application. I am using "ALS.train" for training the model - Model Factorization. The total time that the Application takes is approx 45 mins.
What can I do further to increase its performance? (Decrease time mainly)
Am I missing any coding standard or guidelines that s...
if (string.IsNullOrEmpty(url))
{
throw new Exception("url is empty");
}
Throwing a general Exception is mostly bad. If the url parameter is null you should throw an ArgumentNullException and if it is "empty" you should throw an ArgumentException like so
if (url == null) { throw new A...
I prefer DigitalOcean for generic virtual machine servers
AWS EC2 is okay but they're (relatively more) expensive and their interface is complicated but AWS works quite nicely if you're using other AWS services as well because they all link together.
Putting it another way, DO is so cheap that I could have one of their lower end virtual machines on for months without noticing the money missing from my account. It's about 5$ for a basic machine and 10$ for a slightly less basic machine per month
They are okay, just make sure that you set a secure password.
When you set up a box it will ask you for a public key but you won't be able to log on without a password (for some reason) which you will have to get using the reset password flow
Don't set the password to password thinking you're safe because you have public key crytography..
I did that, within 6 hours my box (that wasn't on any DNS) was bruteforced and infected by a botnet
static_cast is a clear and conscious decision to make a very particular kind of conversion. It therefore adds to clarity of intention. It's also very handy as a marker to search source files for conversions in a code review, bug or upgrading exercise. — Dan Allen22 secs ago
I am fairly new to C++ and here is a piece of code I wrote while I was looking into the copy constructor working. The code compiles perfectly on MSVC. I am using VS2005 as IDE and using C++03.
My intention was to see how a copy constructor can be defined for a pointer member object of a class (M...
Just a quick question, as googling it lead to not any (good) results: Can CryEngine 3 be used from within Java? And if so, would it be a good choice or not?
Currently I am trying something in jME3 (jMonkey) and it seems to be doing pretty well, only I think that CryEngine 3 should be capable of ...
> Do Browsergames. Than you can do the all the logic on the server in Java and just the presentation in flash or html5. But currently this limits you basically to 2D, because WebGL, etc. are not mature and fast enough to do a 3D game with an high end graphics.
There are plenty of complicated algorithms to find inorder successor and predecessor on internet, few of them even augment a parent pointer, I've tried in my algorithm to do it using simple recursive traversal.
I've used a data structure called Window that'll store elements in following way :
I...
I'm trying to reason about whether an OOP-model for neural networks would create a big performance post as opposed to using double[][], the one big advantage I can see about the latter is that all memory is in one block
@5gon12eder I thought of posting it there but I wasn't sure whether what I wanted was a code review. Can you please suggest the changes here? — ubuntugod42 secs ago
@JanHudec Thanks. How can I move this question to CodeReview? I tried to ask it in the CR Help Desk suggested by Dan Pantry, but I need atleast 20 reps to post a message there. — ubuntugodjust now
time produces good enough times for benchmarks that run over one second otherwise the time it took exec()ing a process may be large compared to its run-time.
However, when benchmarking you should watch out for context switching. That is, another process may be using CPU thus contending for CPU w...
What I am doing in one sentence
Checking out the branch Update-1 from the Roslyn github repository, building the csc.exe, and compiling a random Solution with the csc.exe version I just built myself.
Expected result
I expect the performance to be comparable to the original Roslyn version which...
I wrote what will probably be my canonical "what is global and why not to use it" post, if any Pythoners have free time and want to give me feedback on it: http://codereview.stackexchange.com/a/117135/72910
I am not a lawyer.
I am reviewing a suggested edit where a user created a jsFiddle from the code in someone elses question. I believe this breaches the CC-BY-SA 3.0 license that the code in the question was under.
The license information from the jsFiddle page says:
All code belongs to the...
I had been writing code for segmented sieve of Eratosthenes. This code is for the Prime Generator problem from SPOJ.
I previously had posted a question here at code review when I had TLE problem because I was using Sieve of Eratosthenes. But the answers didn't help me avoid TLE.
So I started u...
Some questions link to the code they want reviewed, which is against site policy. Should one edit the code into the question in these cases?
The problem I see is that all content on Stack Exchange is cc-wiki, which may not correspond to the wishes of the author. This is probably fine when the ...
@rolfl Not exactly, I have a model of a neural network in Groovy, I'm going to rewrite that to Java today... It's pretty much a NeuronLayer[] which consists of Neuron[], and each neuron has a List<NeuronConnection> and every of those connections has a double weight
Now consider that the network is already constructed at this point, is there a performance cost with iterating over those arrays/lists and getting the weight value? As opposed to directly encoding it in a double[][] weights
The only direct cost I can think of is that those objects are likely scattered through memory, while the array is not
Consider a network of 1600 input neurons, 200 hidden layer neurons, 4 output neurons: That gives us 1804 neuron objects and 1600 x 200 + 200 x 4 = 320800 neuron connections
@skiwi - a trampoline method is a "jump" method that gets you from where you are, to where your data is ... essentially it is typically 2 things. It's a long jump in memory to a function, combined with a need to pull a new cache location in to memory.
You then bounce back from that location and continue execution
How much should I worry about things like Neuron#getWeight() or directly accessing Neuron#weight if it's in a Neuron[] as compared to storing the values directly as double[] (or even better a float[])
I'm trying to unit test how my class responds to a NEST 1.7 IElasticClient's return values, using NUnit 2.6.4 and Moq 4.2. I feel mocking the Get function requires very "heavy" It.IsAny calls, and am mainly looking for feedback on how to mock IElasticClient in a way that my tests remain readable....
I started of with pseudocode in my book, then went to Groovy, realized that it is really horribly slow for this, rewriting to Java, then Java primitive arrays, then trying to see how to multithread it in Java, then OpenCL... sounds like a plan?
@skiwi Yes - for performance, primitives will almost always win out. But, it can make you have to re-build some "useful" Java utilities.... and leads to procedural code more than OOP
I have seen 10X improvements and more, with transforms to primitives.
I have also seen benefits to taking OOP structures, harvesting data in a loop from the various parts, and accumulating it in to primitive systems just to process it.....
But, before you do any of that, I strongly recommend you get a clear benchmark and baseline of what you currently have.
For every neuron I store its inputs and outputs as neuron connections, which mean I have an overhead of neurons_in_layer x some constant cost, while I can always iterate in the same pattern
Now I'm wondering if "Software Engineer" is the correct job title to be looking for when I'm more into this kind of stuff than programming simple stuff
Though this kind of role can be found in many companies I think, even in gaming companies there are loads of challenges if you want to design the server backend
Job titles are just weird. My supervisor and me don't really know what to call what I do. Engineer was one suggestion but I think it implied much more... robustness.