« first day (2244 days earlier)      last day (1779 days later) » 

12:00 AM
RELOAD! There are 6153 unanswered questions (89.8144% answered)
 
 
1 hour later…
1:16 AM
0
Q: Was wondering if there are any better ways to design an adventure game

Alexander BabichukSo as you will soon be able to tell , I am very new to this programming. But I thought that the best way to learn would be to just jump on in and create my own game. was wondering what things i should learn to improve my craft. here is the main class package Main; import java.util.ArrayList; im...

 
2:15 AM
possible answer invalidation by elisa on question by elisa: codereview.stackexchange.com/posts/222908/revisions
 
1
Q: Sums of all sublists

Akhil PandeyThe parts_sums function in the code takes a list as parameter and then returns sum of all sub-lists present in the list. e.g. if, ls = [1, 4, 6, 4] then ls contains, ls = [1, 4, 6, 4] ls = [4, 6, 4] ls = [6, 4] ls = [4] so the function should return a new list, nsl = [15, 14, 10, 4] def p...

 
2:36 AM
0
Q: Implementing a tic tac toe board in python

CE3601This is my attempt at making a class to represent a game board for tic tac toe. Hopefully its not too bad! BTW I normally hate while loops but i used one because I cant seem to make the for loop look nice for the display. import numpy as np class TicTacToeBoard(): """Class to represent a bo...

 
2:57 AM
@TylerEdwards That's hard to answer without seeing how you've implemented authentication, but as a rule, the cookies that ASP.NET generates are encrypted, assuming you haven't configured them otherwise. If your code works, but you want to know how to improve it, there is Code Review, but make sure you read their tpur before posting a question. — Tieson T. 7 secs ago
 
 
1 hour later…
4:06 AM
usually one would wrap the core calculation in a for(;;){ loop and then use ctrl-c (plus 'q' in your case) to break out of the loop. I think for general programming feedback you should check out either codereview.stackexchange.com or softwareengineering.stackexchange.comAnthony Kong 44 secs ago
 
Monking
 
0
Q: Simple Unit Test in C

LeoVenSimple UnitTest macros utility in C. I decided to make this to be able to more easily organize my tests and I emphasized on readability. Please tell me what you think and if this utility would perform well in big unit tests. timer.h /* Simple timer macros utility */ #ifndef CMC_TIMER_H #define...

 
 
2 hours later…
5:50 AM
Monking
 
 
1 hour later…
7:05 AM
possible answer invalidation by user668074 on question by user668074: codereview.stackexchange.com/posts/222913/revisions
 
7:34 AM
Should be moved to code reviewCristian Traìna 8 secs ago
 
0
Q: Conflict between REACT router and Nginx locations

user3690884I've a react APP in my web server root. And i need to define some locations excluded from react-router i made the Nginx part like this: server { listen 80; listen 443 ssl; server_name mydomain.com www.mydomain.com; client_max_body_size 150m; client_header_timeout 3m; cl...

 
I'd like to see the expected result for the first test case before I say it works as expected. Even if it does, it is a) misleadingly named and b) duplicates the existing functionality of Array(1,2,3) so I don't think it should pass code review. — Thilo 44 secs ago
 
8:40 AM
0
Q: Map tablename to tablename alias in attribute name

elisaI have dataframe like this: date tableName attributeName 2019-03-29 [order as o, costumer] [costumer.customerID, o.orderID] 2019-03-30 [customer c, payment] [payment.paymentID, c.firstName] ... I have a function that map the tableName to attribute, like this: impo...

 
8:56 AM
This question may be better suited for codereview.stackexchange.com since you're looking for improvements on working code :) — frobinsonj 18 secs ago
 
0
Q: Singleton pattern for Redis connection

Mahmudul HaqueRecently I have learned about singleton design pattern. I have tried to implement Redis connection following singleton design pattern. conn/redis.go package conn import ( "sync" "github.com/go-redis/redis" ) // Redis client type Redis struct { *redis.Client } var redisInstance ...

 
9:49 AM
@Feeds RBA
 
I would recommend posting this to code review — Kobe 38 secs ago
I'm voting to close this question as off-topic because this question should be asked in code review. — Yo Yo 50 secs ago
 
0
Q: Finding Factors of a Number - Java Code

SiddharthaHere I have a bit of code written to find factors of a number. Now, if I input 10 into the code, it stops running after finding the second distinct factor. What can I do? package com.company; public class Main { public static void main(String[] args) { System.out.println(printFactors(10)...

1
Q: Javascript how to speed up this function

HasenI have one function in my code to detect edges in a canvas but it's the slowest part of my code and is used everywhere. If I could just optimise this, my whole program would speed up considerably. Maybe something better can be done with Em6? Basically the function goes from the left until it fi...

 
10:21 AM
0
Q: URL assembler in Python

Kaloian KozlevI created a code that will create, or rather assemble a URL based on the configuration. Everything works, however with the expansion of my project I added multiple languages etc. every section only changes very small details in the output however I copy and pasted the majority of the code. (I'm s...

 
10:35 AM
possible answer invalidation by chicks on question by Akhil Pandey: codereview.stackexchange.com/posts/222951/revisions
 
11:02 AM
@GhostCat Why do we use Nullable and NotNull annotations ? To let our IDE warn us about problems. At least I do. Now I got warning which is not valid. Also my code reviewer is always crazy about any warning. — Lukas Hanacek 12 secs ago
 
@Duga Formatting, no problem.
 
12:02 PM
1
Q: Agent based model in Python

SasquatchMy model is based on this game https://en.wikipedia.org/wiki/Ultimatum_game . I won't go into the intuition behind it but generally speaking it functions as follows: The game consists of a n x n lattice on which an agent is placed at each node. During each time step, each player on each node pl...

 
12:23 PM
0
Q: Labeled Ranges: refractor for efficicency?

SumNeuronI am working with some data that requires keeping track of different types of ranges. In other words, there are three key attributes to keep track of: type (str): the "type" of the range start (int): the value at which the range starts stop (int): the value at which the range stops e.g. "Ty...

 
12:37 PM
"Help me optimize my code" isn't really an answerable question on Stack Overflow. If you have working code and you are looking to refactor or improve it in some way then you might try codereview.stackexchange.com But before asking there you are strongly encouraged to (1) format your code to be readable and (2) describe specifically what sort of optimizations/changes you are looking to make and in what way the code isn't "optimized". — David 8 secs ago
 
0
Q: Small module to verify if a Bearer token is still valid

el solo loboI wrote a small module that can be used for a better Bearer Token handling and I would like to discuss what could be the drawbacks of such code and what I could do better. During the last few weeks I often came up with Bearer Token authentication for different API´s and I didn´t like that I wa...

 
1:03 PM
0
Q: let - order of evaluation

mwalRegarding the following code ;; ANSI CL - p37 ;; Run length encoding: expansion ;; > (uncompress '((3 1) 0 1 (4 0) 1)) ;; (1 1 1 0 1 0 0 0 0 1) (defun uncompress (lst) (if (null lst) nil (let ((elt (car lst)) ; [1] (rest (uncompress (cdr lst)))) ...

0
Q: Fills inputs of form

diofloyk function fillFormInputs(data) { $('input[name="name"]').val(data.name); $('input[name="surname"]').val(data.surname); $('input[name="patronymic"]').val(data.patronymic); $('input[name="email"]').val(data.email); $('input[name="skype"]').val(data.skype); $('inp...

 
you should have asked this in code review site — satsvelke 47 secs ago
 
1:24 PM
0
Q: Testing Redux-connected React Component

Bob HornMy tests work, but I just know I'm not doing it correctly. My major concerns: I needed to add the same properties to the mockStore and props (allData, etc.). My React component calls props functions (updateRowBeingEdited, etc.) that exist in the container. In order to make those functions avail...

0
Q: php sort specific row elements

PeterI have an array and want to sort the row elements 1 to 5 lowest to highest. Elements 0 and 6 stay as is. $myArray = array { 2205,16,10,29,30,31,7 2204,16,40,31,33,15,15 2203,10,23,20,29,44,8 2202,33,29,6,27,30,12 } I have tried using: usort, and function arrayOrderBy found on...

 
1:38 PM
I don't get this, why are all commenting when it should be in code review not in SO, no downvote, no one telling to move the Q, etc — satsvelke just now
 
0
Q: Ensure model fits specification

MatzeI am trying to write a tiny FIX protocol implementation. The specification states several data types. Here is a screenshot of the int types: Now I have created a type Length like this: public class Length { [Range(1, int.MaxValue)] public int Value { get; set; } } I would have have...

 
One more thing, why create code review site then, it doesn't matter if it's interesting or not, it has to be in code review — satsvelke 58 secs ago
Managed to fix it using this answer; codereview.stackexchange.com/questions/148273/…Alex 26 secs ago
 
2:11 PM
Thanks, this works perfectly and is a lot more concise than the solution I found here; codereview.stackexchange.com/questions/148273/…Alex 51 secs ago
Sorry, I didn't know there was a code review site. If anyone wants to continue the conversation: codereview.stackexchange.com/questions/222988/…user1747281 36 secs ago
 
-1
Q: Is there a convention of code structure for long mathematical equations?

user1747281[Originally asked from stackoverflow to here] I'm writing a class that performs complex mathematical (trigonometry) operations. Some lines are pretty long, and I was wondering if there's a best practice for laying out the code in a readable way. here's an example method from my code static...

 
@CaptainObvious The way the question is asked makes it primarily opinion based.
 
2:28 PM
actually it's off-topic even if it weren't.
 
2:40 PM
Well, seems that question got closed as "off-topic" on the Code Review site... — Matthew Watson just now
 
0
Q: Light Security Local-Machine Password Encryption

Zly MartinI have a program that makes a call to an SQL database. I cannot use SSH to connect to it (as far as I am aware) or any other more secure method, so Java's SQL connector was used. As the connection requires a username/password, and I want to store the user/pass for ease of making the connection. I...

 
@Vogel612 Yes, in my comment on the question I stated 3 reasons why it was off topic.
 
3:00 PM
possible answer invalidation by user1747281 on question by user1747281: codereview.stackexchange.com/posts/222988/revisions
 
3:13 PM
@Duga Not an invalidation. Question was put on hold as off topic. It required a lot more information.
 
3:25 PM
0
Q: Auto-Complete in PHP using JSON

Eric GarciaCan anyone explain why this auto complete function was working on localhost but is now not working after uploading to server? <tr><td>Part Name: </td><td><input type="text" name="PartNum" class="auto" id="pn" style="width:250px" required></td></tr> <script type="text/jav...

0
Q: Scraping Forum Tables w/ Links Using Beautiful Soup

MSDThis code scrapes post links (among other information) from a table on a forum. While the current code works, I would like to know if there is a better/simpler way of writing it (maybe not as many for-loops?) and with the assumption that additional functionality will be added, such as: Currentl...

 
3:45 PM
0
Q: Installing the VC Redistributable (2015|2017|2019) for both x86 and x64 using Inno Setup

Andrew TruckleI don't have a virtual computer so I am not able to beta test this installation. Therefore I am kindly asking if I have gone about this correctly. It compiles OK. Step 1 I declared these variables: var vcRedist64BitPath: string; vcRedist32BitPath: string; bVcRedist64BitNeeded : boolean; ...

0
Q: Return an unpacked list Python

AnonI have some functions def foo1(): # some code here return bar1 def foo2(): # some different code here return bar2 ... def foo10(): # some other code here return bar10 which is used somewhere else in the code base like def get_bar(): # custom class here base_...

 
@CaptainObvious LCC - hopefully no-one will argue it's not this time.
 
4:05 PM
Monking
 
0
Q: Filtering and creating new columns by condensing the lists for each item information

user11385784I am trying to improve my programming skills at work (analyst) and one of the engineering projects I worked is around ETL. Essentially, we roll up all individuals account information to a single row for each user and their purchases are converted to a list. There are two different logics which us...

 
4:46 PM
-1
Q: 0/1 Knapsack problem Dynamic Programming

justanothertechdudeI am trying to solve this 0/1 knapsack problem in nbweights*totalweight time. Could I get some feedback on this code please? def knapsack(weights, values, maximum_weight): matrix = [ [0] * (1+maximum_weight) for _ in range( len(weights) ) ] for weight in range(len(weights)): for total...

-1
Q: C++ Text-based RPG - Game logic has a flaw

DanielI have been working on a project for a C++ text-based RPG game for a couple of weeks now. I've got a Unit class that's the base class for AI and Player. Then I have a Player class derived from Unit. I've implemented two character classes which have their own objects deriving from Player C++ class...

 
5:08 PM
I'm voting to close this question as off-topic because this is a request for a code review, which is a better fit at the Code Review site. — templatetypedef 45 secs ago
 
5:27 PM
-1
Q: C++ Console Text-Based RPG - switch menu statement behaving very strangely

DanielI've been working on a console text-based game in C++. For every player action I have defined a switch case statement. Often times when I choose option 1(attack), it proceeds to attack the chosen Enemy and then prompts me to choose a character class again which is even before the while cycle. Her...

 
5:47 PM
0
Q: dput() concatenated vector with no quotes, separated by commas in R

VonAn oddly specific task - I have a dataframe with columns with values I need to concatenate in order to prepare a query for a website that requires very specific inputs: unquoted strings, separated by commas. Here's a dput() of a subset of the dataframe with the columns needed: d = structure(lis...

 
 
1 hour later…
6:48 PM
1
Q: 115 line brainfuck interpreter written in C++

ruoholaThis is a simple brainfuck interpreter I've written in C++. It takes a path to a brainfuck source file as a command line argument. The program uses a tape size of 30000 and cell size of one byte. Decrementing a cell's value under 0 will wrap it to 255 and vice versa. I would really appreciate an...

0
Q: Command to measure CPU time and RAM usage of process while making sure it does not go over certain ressource limitation

Remi.bI found an old code (that I probably partially copied from somewhere at the begin with) and I am trying to see if it can be improved. The goal is to write a command is to measure CPU time and RAM peak usage of a process and also would kill the process if it overpass a specified amount of CPU time...

 
7:23 PM
Monking
Could someone with enough rep to see deleted questions tell me if this user already had a similar question to this one a little bit earlier? I could swear I've left a comment there.
 
@AlexV You should be able to search chat for an older deleted question. More importantly, why do you want to know?
 
-1
Q: Full-stack Mini project to expand - Evaluation

hbroleYou can find my mini-project here in Github. So, this is a full-stack project based on Spring Boot (Rest/Mvc) and Angular Frameworks. It's a multi-roles user app which contains the following functionnalities : -User Registration -Authentication (with Spring Security) -For users with 'Admin' rol...

 
@Peilonrayz The chat hint was great. Found it almost immediately. As I read the question it struck me that I had a look at this before and left a comment with a hint how to maybe get on topic. But he almost did the exact opposite of what I was trying to tell him and also the comment was gone. For a short moment I was beginning to think I was imagining it.
 
@AlexV Can confirm duplicate and you did leave a comment. :)
 
@Peilonrayz Aaah... great. Heat has not fully damaged my brain... yet.
 
8:19 PM
-1
Q: Evaluate an expression BST - Daily Coding Challenge

EMLHere is my solution for the Daily Coding Challenge 50 Given an arithmetic expression in the form of a binary search tree, write a function to evaluate it Example * / \ + + / \ / \ 3 2 4 5 Return >> 45 Is this the most efficient way to do this? """Build an operation tre...

 
8:39 PM
0
Q: Looking for feedback on solutions code for problems from cracking the coding interview (C language)

dariogithubI uploaded code solutions for some problems of the book in https://github.com/dariogithub1/cracking-the-code-interview-solutions , I would like to know your rating and potential improvement of the code I wrote. Here an example for the first problem of chapter1 (anagrams): #include <stdio.h> #inc...

0
Q: How can I optimize this code that heavily filters and sorts through database to make the webpage load faster?

Helana BrockMy page (even when it has no data) takes 10+ seconds to load. That's just too long, considering when you finally get to it there's no data. When it has data, it takes even longer. Here is my view, which I'm guessing is the problem: class RewardPointsEarnedReport(TemplateView): template_na...

 
Code Review for asking for improvements. Asking them to rate the quality is still off-topic, even on CR. — Amy 22 secs ago
@Denny - Just make sure to take their tour and visit the help center so that you can be sure you're complying with their rules. — Broots Waymb 29 secs ago
@BrootsWaymb This would be off-topic on Code Review, as it is not their code. — Peilonrayz 20 secs ago
 
9:00 PM
-1
Q: How would you rate this code lines, and what is your improvement

DennyI'm working with other developer code, and would like to know the way that to improve, would like to know more from you all, How would you rate the codes below, 0 (Worst ) to 10 ( Best ) and if you can improve - what is your improved codes or suggestion? Thank you for your all comment/suggestio...

 
9:20 PM
0
Q: A* pathfinding algorithm too slow

André RochaI'm trying to make a pathfinding algorithm for my project. I need it for a simulation and I need it to be fast!!! I watched a few videos explaining the algorithm online and came up with the code below. However, the performance varies a lot considering the start/finish points. My project should...

0
Q: Sum ints on stdin

user45891I have been meaning to learn LISP and for a small task I wanted to find out the sum of all integers on STDIN. So for > clisp a.lisp 1 2 3^D 6 My code is as follows. I have a small helper function, my core function and the invocation of it. (defun read-int() (parse-integer (read-line))) (de...

 
9:53 PM
I think that commentators on the Code Review stack exchange would have helpful comments. codereview.stackexchange.comKyle Parsons 38 secs ago
 
-1
Q: for some reason this isnt working

Alexander BabichukIve been tryna to figure out why this code isnt working, i was following instructions on how to make it online and his worked its suppose to show a title that says broken and a start button that says start package Main; import java.awt.Color; import java.awt.Container; import java.awt.Font; i...

 
10:25 PM
@CaptainObvious for some reason this isnt on topic
2
 
10:41 PM
0
Q: using super-constructor vs methods polymorphism

javapoweredI'm using Java but this applies to any OOP language. What is preferred between these two approaches? First approach: public abstract class Planet { public abstract Colors[] getColors(); public abstract long getWeight(); public abstract int getIdFromEarth(); public abstract boolean isHab...

 
First, as this is working code that you want to improve you should ask this question over at Code Review (they're about improving code, we're about producing creating working code). Second: If "ES6 stuff...is Greek to [you]" think of that as an opportunity, and reason, to learn ES6 (ECMAScript seems to be running on annual updates currently, depending on browser implementation; it's not going to get easier to learn if you put it off). — David Thomas 20 secs ago
 
11:01 PM
0
Q: String ZigZag Conversion C++ 17

gregOverview The string 0123456789 is written in a zigzag pattern (following the path going all the way down, then diagonally moving towards the top right) using a given number of rows. Like this example in the case of 3 rows. 0 4 8 1 3 5 7 9 2 6 This string is then read line by line and co...

 
11:19 PM
I think this is a great lesson in recursion for OP (a beginner). If this was a production code review then, maybe I'd agree, but for this usecase it's fine. And I have absolutely no qualms with recursively calling main because main is just another function in python. — FHTMitchell 56 secs ago
 

« first day (2244 days earlier)      last day (1779 days later) »