Firstly I would like to apologise if this is off topic. I am unsure if it is, as the code written works fine.
Just wondering how I might convert this to JavaScript from JQuery?
The code below expands a menu on click like an accordion but I am trying to rewrite this in JS for practise.
( functi...
I never get to use ECMA6 in production/work so I am hoping you all can help me write better code by reviewing my finished sample:
(function() {
'use strict';
class BudgCalc {
constructor(personFullName, yearlyAfterTaxIncome) {
this.name = personFullName;
...
There is so much wrong with this code, I sincerely hope you're not using this in production. If you are, please contact me at the email listed on my profile and I'll give you a free quick code review. — Leon Cullens14 secs ago
What special privileges do diamond moderators have?
Diamond moderators are human exception handlers. The main function of diamond moderators is to follow up on flagged posts but they also have some special abilities necessary to handle rare exceptional conditions:
They have access to all the ...
> - They can place users in timed suspension, and delete users if necessary.
As a small side-note, the ♦-folk may also include SO employees where needed for admin purposes. Of course, the real trick is managing to get ♦ through both routes... — Marc Gravell ♦Jan 17 '11 at 14:02
> In general, the same courtesies should be extended toward removed moderators as to suspended users: no airing of dirty laundry in public, no bringing up issues faced as a moderator in unrelated discussions, questions raised by other members of the public answered with as little detail as possible. Speculation should be discouraged out of respect for those involved.
What is a Zombie? Why are Code Reviewers so violent and talking about killing Zombies all the time? And what ammo are they talking about? What is a TS? What does RSA mean?
And what other Code Review-specific memes are there?
(As the number of memes grows and grows, and Malachi's wish to vote fo...
or are you playing at one of these stupid warnings like the old "Please don't use the back-button of your browser or resize your browser window" thingies?
Not a good fit for stack overflow, SO is for problems you can't solve. If you wrote an algorithm and it didn't work, ask here, if it did work but you would like a better easy, ask at code review's site — Juan Mendes29 secs ago
I just spent the last few days constructing the currency system for my game, and was wondering if you guys had any suggestions on how—if at all—I could improve it. Before I show the code, let me explain the system as it currently stands. It works a lot like World of Warcraft, in that Copper is au...
I have create a functioning automated traffic light sequence using an array and if statements. It all work correctly but I am wondering if there is anything more I can do to improve my code without changing to structure or way it works, so without the use of dictionary's etc.
<!DOCTYPE html>
<head
I have create a functioning automated traffic light sequence using an array and if statements. It all work correctly but I am wondering if there is anything more I can do to improve my code without changing to structure or way it works, so without the use of dictionary's etc.
<!DOCTYPE html>
<head
@Vogel612 I'm thinking of extracting the Array(x + 1).join(N).split('') thing to a small function of its own... not sure how to reduce duplication in addition to that
In the nineteenth byte, we have an excessive amount of carets (carrots, if you will) that direct one's attention to another message. For example:
Amidst the confusion, I made a userscript that highlights in yellow the pointed-at message when the message in question is clicked.
(function(){
...
I'm using Microsoft's SqlDataConnection type provider. However, the only way I've seen to update a row in the database is to use something similar to this where it updates mutable values:
let updateProduct product =
let currentProduct = query {
for c in context.Product do
where (c.Pro...
One line variable declaration
Please avoid declaring variables on the same line:
var elements = {}, messages;
It's also a great way to royally mess up scope issues if you do it on two lines but still with spaces.
var notAGlobal //, a comma might be here
aGlobal;
Globals
messages...
public enum Coins
Enum type names should be singular, unless they're decorated with a [Flags] attribute:
Use Pascal case for Enum types and value names.
Use abbreviations sparingly.
Do not use an Enum suffix on Enum type names.
Use a singular name for most Enum types, but use a p...
The class should really be a struct. Be it only because you're using a mutable field for GetHashCode. And if adhering to best practices is nitpicking, I'm a happy and proud nitpicker. — Mat's Mug ♦6 secs ago
The code in general is a little difficult to read. I really had an hard time. But I will be randomly jumping around on your code and reviewing it. More will be added with time.
MutationObserver:
This one is the hell on Earth to read!
Look at the nesting:
var observer = new MutationObserver(...
I'm learning some JavaScript and ran into a quirk and was wondering if anyone knew a way to override this behavior. I'd like to be able to test if a value passed to a function is a real number, and I thought using === for the isNaN() check would take care of that, but it doesn't.
Example functio...
RULES:
•Strict tasks must occur at the time the user selected no matter what.
•Flex tasks are in a priority order. Even if there is a gap big enough to fit several flex tasks with lower priority, no flex task can be scheduled until all the tasks with a higher priority are scheduled.
•Flex tas...
> Im sharing this logic because it was hell for me to hold in my brain all at once and I want to improve my coding style and approach. Im aware there is prob lots of room for improvement. Rip me to shreds fellas.
Essentially, It's just me remaking a previous project with it since I find that to be a great way to pick up new things. The two relevant files: https://gist.github.com/Javaliant/29ca389742c230f88229 are the two relevant files. The relevant functions are on line 32 in index.js and 39 on app.html
If you have a specific question regarding a specific problem this is the place to ask it. Asking what is essentially, "How's it look?" does not fit that bill. The codereview site is far better matched for that task. — WhozCraig26 secs ago
This may be on-topic at Code Review, assuming A the code works and B the code isn't hypothetical or incomplete in any way. — Quill16 secs ago
What I'm doing
I am writing a server to work as my games backend. The server is being wrote in C# using UDP as the protocol, while the game is in C++. The biggest thing I've been focusing on was trying to make the packet messages more OOP than what I've typically seen for game servers. As a resu...
I'm the one responsible for your loss of reputation. I originally came across this now deleted question to which you responded with a useless, snarky answer:
$9999 will be the minimum cost. You could ask Mr.Google if you want more details.
I flagged your answer as "rude", which it was. If y...
I'm relatively new to Python, I decided to make a simple battleship game. Is there anything I should do to make it shorter, or in practice, "better"?
from pprint import pprint as pp
import random
#Inputs random and pprint to organize the lists
Rows = 0
Columns = 0
turns = 0
Answer = "NaN"
#Stat...
So I am assuming that I did something wrong, and my AES and RSA encryption and decryption classes are insecure. I plan on using them for a larger project, and want to make sure I didn't completely muff them first. My questions are as follows:
1) What, if anything, makes these two classes insecur...
Looking for some simple tips to fix the bugs in my heapSort. Hopefully it is something simple that I am not comprehending.
I am having a problem with my dumpHeap and extractMax. It seems to put the dumpheap in order but adds a 0 to my array. It still is technically a heap but bothers me why a 0...
I wrote a script that downloads all PDFs found on the web page of a particular government agency. I would have chosen bash for such a task, but I want the script to run in Node.js. The downloaded files are a few hundred kilobytes big, if that matters.
It is the first time I use ES6, but I want ...
I know there are a lot of different solutions to solve the "Dining Philosophers" problem, but I wanted to get some feedback on a solution that I have so far.
My motivation for working on this is to prepare for future job interviews and to get more familiar with threads and C++.
#define P 5
#in...
How would one insert data from an API call to GoogleBooks?
Write a PHP script>
Is this something that can be done in the Mongodb GUI?
for example
call out to https://books.google.com/books?id=x13rhi4k44
and return JSON to import to a collection within a particular database.
Even if the JSON ...
I have written a program to find all anagram groups in a text file. I used first 26 Prime numbers as a mapper for 26 characters for finding anagram groups (Since character_set of all anagrams of a particular word are same, the products of the anagrams are also same ). After finding product of ana...
I have this code that gets the product of two numbers using the Long Method Multiplication I only have 3 hours to get this done or I'll fail my Subject.
The program will ask you to input two numbers to multiply. My problem is, if I input 50 on NumInt1 and 100 on NumInt2, there's no result that is...
Server -A multithreaded chat room server. When a client connects the server requests a screen name by sending the client the text "SUBMITNAME", and keeps requesting a name until a unique one is received. After a client submits a unique name, the server acknowledges with "NAMEACCEPTED". Then all ...
being one of them, I have to say that I am a bit unsure about upvoting. Since I see so few, I'm afraid I might be missing on some standard since I see little to no upvotes already there...
When I compile my code it says that everything checks out but when I run it nothing happens. The program just runs until I kill the terminal.
#include<stdio.h>
int main()
{
float work;
work=0;
char ans[]="No";
while(ans[0]=='N');
{
printf("Hours worked today ");
...
I have a server that uses Java NIO in non-blocking mode. Right now I'm using a single thread for the selector, and four worker threads to process the bytes after the selector reads them in. I'm going to switch to a thread pool soon enough. Anyway, that's not why I'm here.
Take a look at the co...
For all future readers: Look at the Answer from Lutz Horn for a Pythonic solution. My Answer only aims at answering the question without giving code advice (which should be done at Code Review SE ;). — Mailerdaimonjust now
I can see the code review with both "Requested" and "Closed" status in CodeLens indicator, so I don't think status will matter the behavior. Try refresh CodeLens Indicator. And make sure the Code Request work item is linked to the code, and you have permissions to open linked work items. — Cece - MSFT13 secs ago
I've developed easy Game of Life project. I'd highly appreciate any feedback and possibilities to improve my code, both in efficiency and style. It works on list and it's terminal program. I decided not to show you interfaces, it's waste of space, you can figure them out.
Cell.java
public class...
So, Excel worksheets sheets have a codename (really a global object reference). But, do they call it that? noooo. Worksheets have a "Name" property (user-facing) and a "(Name)" property (codename).
Hello i have a method which is not thread safe. The method is:
[HttpGet]
public IHttpActionResult Initials(string ids)
{
if (CurrentLanguage == Languages.German)
DcConfig.set_Language(DcConfig.ConfigType.Auto, Languages.German);
else
DcConfig.set_Language(...