« first day (1844 days earlier)      last day (2158 days later) » 

12:00 AM
RELOAD! There are 5312 unanswered questions (89.9938% answered)
 
12:46 AM
If you provide more context, this would be appropriate for Code Review. Right now though, it's vague and inappropriate for both Stack Overflow and Code Review. — Carcigenicate 46 secs ago
Wrong site, I'm afraid. If you have working code that you'd just like to have peer-reviewed, you should ask on Code Review instead. This site is for questions related to problem (non-working) code. — Ken White 29 secs ago
Please don't listen to the first two commentators and post this on Code Review. This is a snippet and there's no guarantee that it works. — Makoto 8 secs ago
 
 
2 hours later…
3:05 AM
0
Q: java.lang.OutOfMemoryError: Java heap space while trying to solve a 8 puzzle using DFBnB

Liana78I have the following code for DFBnB and I'm trying to solve a puzzle using it. The problem is that is gives me the exception from above,I know that there is a solution for the puzzle because i already solved it using BFS,A*,IDA* and IDDFS. the w(current,child.get(i)) function just gives out the c...

 
3:33 AM
I suggest you put all that aside and just write your code and make sure it works. Then post all your code on Code Review for review and ask if it can be improved and if it follows SOLID. — CodingYoshi 20 secs ago
 
4:28 AM
I'm voting to close this question as off-topic because this question belongs on Code Review. — zwer 49 secs ago
 
4:48 AM
0
Q: my begginer game java

joshI'm trying to make a game. it's a cop and robber game and I'm running into problems very early. the game does not wait for my input and it just continuously loops. please help import java.util.Random; import java.util.Scanner; public class Main { public static void main(String[] args) { ...

0
Q: Function to generate pyspark diff and return differences in line

shannona2013I have written a function that takes two pyspark dataframes and creates a diff in line. Here is the function. I am struggling to get it to scale with 100s of columns. IE get around the for loop calling .join() 100s of times...I am stuck, or maybe tired and looking for some suggestions! def di...

 
5:04 AM
0
Q: Simple Math Game in JavaScript

Lou BagelCreated a simple math (addition/subtraction) game to practice my JavaScript. Any feedback on the JavaScript appreciated. Can play in: CodePen Instructions: A math equation will show up and simply press the corresponding number on your keyboard to answer. Speed game so no need to press enter o...

 
5:20 AM
0
Q: Night Mode using css and javascript

Zeyad EtmanI just added a new feature to my portfolio, Night Mode, i created it with css and session storage in javascript, I want you to review my css of night files, i feel it filled with !important i'm sure this is a bad practice, Can anyone help me make them better? My second question, the default mode ...

 
5:51 AM
0
Q: Python task scheduler

yangmillstheorySubmit tasks to a scheduler, allowing them to be run at a future time. Tasks can be submitted in any order, and non-running tasks can be cancelled. I used a min-heap to prioritize the next task, and a threading.Condition to communicate between a "watcher" thread that sleeps until the next task...

 
6:40 AM
0
Q: Best approach for showing multiple d3js charts on the same page

Katherine MaurusI created two graphs in d3js: a bar chart and a donut chart. These two graphs use the same json object for data and share an input range and the radio button, however, are in two different pages. This is the code of the bar chart: <html lang='en'> <head> <meta charset='utf-8'> ...

 
6:55 AM
0
Q: What condition would be better to use? Switch vs if condition

user70960What do you think, what condition would be better to use in this context? What part of the code would you use? Switch-condition: switch (menu.prompt()) { case 1: system("title Test"); break; case 2: system("color f0"); break; case 3: menu.update("Change the console title;...

 
7:15 AM
0
Q: Refactoring callback hell in the function

Olga BI have a function which returns an array of datasets for a chart written with vue-chartjs. The getter getChartData returns an array with three objects with nested objects. I see that my function has a so called 'callback hell' and I want to refactor this. getDatasets() { let datasetLabels = [...

 
Then it sounds like you still want to send true in those cases, in which case a compiler error would be counter-productive. My advice is to go with the obsolete attribute below, change the signature and force everybody over on the new signature after a code review. — Lasse Vågsæther Karlsen 19 secs ago
 
7:43 AM
Monking
 
0
Q: VBA mid way dynamic range concatenate

jacobSheets("sht1").range("$B$"&Last_Used_Row&":$B$1047658").ClearContents Kept getting "expect list seperator" error. Anyone know whats wrong? Been at it for hours

 
8:15 AM
Monking
 
0
Q: Masks for image with OpenCV (Python)

LinkI made this code which create 2 masks. When applied, the result is this: Original image Output import cv2 import numpy as np frame = cv2.imread('image.jpg') h, w = frame.shape[:2] upper_value = int(h / 10) * 5 lower_value = -(int(h / 10) * 3) upper_mask = cv2.rectangle(frame, (0, 0), (w,...

 
9:11 AM
0
Q: update object property based on previous value Object.assign

pro.meanI have one object and its keys value initialized with 0, Now if I want to increase the value of that key from the previous value than how to do it in an efficient manner with the concept of Immutability const nameCounter = { ALPHA: 0, BETA: 0, CHARLIE: 0, PETER: 0 }; if(condtionToIncreaeAlphaC...

1
Q: Split string with adding separator to substring

HelloWorldI wrote my Split() extension, it's main goal is to save delimiters and add them to splitted strings. For example: I have a string "-1-2+3+4-5-6", and separators '+', '-' And I want to have following: "","-1","-2","+3","+4","-5","-6" or "-","1-","2+","3+","4-","5-","6" depends on input separator...

 
9:36 AM
Monking
 
Monking
 
gosh ... yesterday was a holiday, but not everywhere and now I've spent an hour to read up...
 
@Peilonrayz On it, could take a moment though.
 
@Mast Thanks :)
 
9:46 AM
> It also isn't an error with the code but the example-usage code.
If that's true, the question is lacking context to be reviewable. Should that be fixed, it could work.
> We have never required example input for code to be on-topic on Code Review.
No, but it does provide context and we do require context.
> And so with only a little amount of effort, changing the values to the ones on Project Euler, we would be able to tell the code works.
It's not as easy as that. That's putting the responsibility by the wrong person.
@Peilonrayz ^^
 
@Mast What context is it missing?
 
It definitely wasn't obvious the code was working. It looked a heck of a lot like it wasn't.
If the example usage takes forever to complete, it has all odds stacked against it.
 
@Mast It's our responsibility to check if something is off-topic when we vote to close. Yes it would be easier if the OP did this, however I don't see how it's the OP's responsibility.
 
@Peilonrayz I checked whether it worked as expected and it failed to complete on my machine. How long did it take on yours to run?
 
@Mast Did it "failed to complete" or did you decide that it took too long, and stop it?
I didn't run the code, I read it. And saw that it worked as intended. Why brute force when algebra works?
 
9:52 AM
@Peilonrayz My algebra was taking a holiday.
@Peilonrayz I recall giving it half an hour and had to go afterwards.
 
@Mast Lol, I get that way sometimes :)
 
Where do you want me to draw the line, 24h?
 
@Mast I changed the code to run in under a minute
@Mast We, Code Review, don't draw a line.
 
@Peilonrayz actually we do ..
 
@Vogel612 Source?
 
9:55 AM
stuff that provably doesn't terminate is off-topic
incorrect infinite loops
 
@Vogel612 That's "It can't finish" rather than "it takes ages to finish"
 
it can not
but there's cases where "it takes ages to finish" is equivalent to "it cannot"
 
0
Q: Numbers of length N and value less than K

Latika AgarwalI am solving interview question from here. Problem : Given a set of digits (A) in sorted order, find how many numbers of length B are possible whose value is less than number C. Constraints: 1 <= B <= 9, 0 <= C <= 1e9 & 0 <= A[i] <= 9 Input: A = [ 0 1 5], B= 1 , C = 2 ; Output: 2 (0...

 
Consider algorithms with really bad complexity. stuff like O(2^n)
and then OP asks about "how can I make this terminate for an input in the size of a few thousands?"
and the only answer you can give is: "Wait out the heat death of the universe"
 
Ok, and that's why you show it works on small input
> Time-limit-exceeded issues are a special kind of performance problem, where the code handles small test cases very well, but takes an unreasonable amount of time to complete for larger inputs. You may use this tag instead of performance when an online judge rejects your solution to a programming-challenge due to time constraints, or when you need to interrupt your computation because it appears to take much too long to finish.
Is the tag wiki wrong?
 
10:05 AM
@Peilonrayz Exactly. If it works on 10 and 50, I'll believe it should eventually complete for 500 a lot sooner.
And 10 usually doesn't take long for Euler solutions, even if their complexity is awful.
 
@Mast You can do that changif len(list) == 500: to if len(list) == 5:, the example on PE.
 
 
2 hours later…
12:03 PM
Better post this on codereview.stackexchange.com but make sure that the code is complete and works correctly. — skrx 16 secs ago
 
12:23 PM
Monking.
 
0
Q: Compare two values in two different lists

SomarI have two lists: actual_result : [ { 'SubscriptionArn': 'subscriptionarn1', 'Endpoint': 'mail@example.com', 'Owner': 'ownerid', 'TopicArn': 'arn', 'Protocol': 'email' } , { 'SubscriptionArn': 'subscriptionarn2', 'Endpoint': 'queue', 'Owner': 'ownerId', 'TopicArn': 'topicarn', 'Prot...

0
Q: Django social network application - database schema

ArunI am writing a simple social media application in Django. I would like to know whether the following model structure is correct, or how can I improve the schema to get better performance. Do I need to split the following relation into a separate model? Like in this question Models.py class User...

 
12:44 PM
Not really a good fit for stackoverflow. Might be a better fit for codereview.stackexchange.comepascarello 52 secs ago
 
12:56 PM
Not quite sure what you're asking here. Did you try this and it didn't work? Or are you looking for more of a general code review? If it's the latter it might be a better fit for codereview.stackexchange.com — Todd Menier 18 secs ago
 
-1
Q: hi, i am running with problem please help me

alberto melvisspublic partial class Form1 : Form {enter code here SpeechRecognitionEngine speechRecognitionEngine = null; SpeechSynthesizer jarvis = new SpeechSynthesizer(); String[] Arraysocialcommands; String[] Arraysocialresponse; public Form1() { ...

 
1:18 PM
 
0
Q: Business Rule DSL for Values in Domain-Driven Design

Aaron M. EshbachFollowing the patterns from the book Domain Modeling Made Functional, I am implementing a single-case union for the simple values in my domain model instead of using primitives. The union cases have private constructors, and each union type has a module with a create function that validates the ...

0
Q: Creating JIRA task from Email in MS Outlook

khashashinevery day I get 5 to 30 Appointment emails with almost the same content from which I need to create the Tasks in Atlassian Jira. I wrote a macro to automate this process. I've never written anything in vba before and would be grateful for correcting my code. This macro works. There is a function...

 
1:31 PM
@PaulTurner Although it works: 1) It's not very intuitive; and 2) it's not that readable for inexperienced developers to read at a glance. In short, not every developer would easily be able to do a dry code review of it, which could be costly to the company. — CarneyCode 25 secs ago
 
1:52 PM
0
Q: Conway's game of life in pygame

Ryo SuzukiI've made a game of life in pygame. I need it to get it to run as fast as possible. I've done everything I can think of. import random,time,json,ujson import pygame as py from copy import deepcopy dwidth=1500 dheight=800 display=py.display.set_mode((dwidth,dheight)) clock=py.time.Clock() py.in...

 
this sounds like it belongs on code review SE — depperm 25 secs ago
@depperm, oh! there is a code review SE. Thanks! — toliveira 15 secs ago
You should post this over on the CodeReview StackExchange. Make sure to delete this question first, as crossposting isn't allowed. — TJ Wolschon just now
 
2:08 PM
0
Q: Access model value dynamically

RaccoonI'm using Laravel 5.6 and wrote this code. According that all models are one-to-one relationship. This allow me to store strings in database like this `The article for M. {{user.lastname}} is {{user.article.title}}`. And output them on specific blade template like this MyClass::preview( Use...

1
Q: Genetic algorithm for Traveling Salesman

Luke CollinsI have implemented a genetic algorithm in python 3 for a programming assignment, and I think all the logic is correct. A friend of mine has also implemented one which carries out similar logic, however his was done in Java. It took his around 5 seconds to complete 5000 iterations, whereas mine is...

 
2:23 PM
Either use CodeReview like @T — Juan Diego 8 secs ago
 
@Duga anyone opposed to migrating this question?
 
@Malachi seems to be a legit question.
 
i have a question...
IMO it's not a complete, concrete program/thought/review request
since on its own the code does nothing.
 
A bit of a mess on this question. Second opinions?
3
Q: Best approach for showing multiple d3js charts on the same page

Katherine MaurusI created two graphs in d3js: a bar chart and a donut chart. These two graphs use the same json object for data and share an input range and the radio button, however, are in two different pages. This is the code of the bar chart: <html lang='en'> <head> <meta charset='utf-8'> ...

@Malachi Opposed, as it's primarily someone else's code.
The performance problem is likely not due to the multi-monitor support that was added.
 
@200_success Can't this fall into the "OP is now maintaining this code" category?
 
2:35 PM
@ThomasWard It's indentation is broken, and some of the lists don't look like valid Python. However I think the OP hasn't thought half of their stuff through, it's likely broken but they won't admit it.
 
@MathiasEttinger What's to stop anyone from always using that excuse?
 
@MathiasEttinger How does authorship have anything to do with the code not working as the OP intends?
 
@Peilonrayz I don't think those're lists, I think those're JSON
or rather a list of JSON dicts.
which technically is allowed, but poor form.
 
@ThomasWard IIRC JSON requires " for strings. Either way, { endpoint: "arn:aws:lambda:test", isn't valid JSON or Python.
 
ah, missed that because my work monitor is poor
good point
broken code and 'incomplete'
 
2:40 PM
@Peilonrayz Code is said to be working, only slowly.
 
@MathiasEttinger What about "So the two graphs are independent but I would like to make a single page with both charts." and "How can I do?"
 
@Peilonrayz It was not about this question ;)
 
@200_success what do you mean it is someone else's code?
 
@Malachi Read the comments at the top of the code
 
@MathiasEttinger Ooops :)
 
2:45 PM
@ThomasWard Reading @Peilonrayz 's deleted answer, this could look like a case of "please how do I unittest if my output looks like I expect it to"
 
@MathiasEttinger possibly (I can't read deleted answers)
 
The way that I read the context before the code, was that the user changed the code, so I wasn't worried, but I did not check to see how much was changed
 
@ThomasWard Here you go :)
 
@Peilonrayz thank you kindly :)
 
On the other hand (regardless of indentation/formatting issues that I overlooked), why wouldn't tests make a valid target for review? I mean, "I have a piece of code producing an expected result such as <code> and I test it using <code>, but this feels messy. Please advice improvements." is not that different from "I need to code X and I came up with <code> but this looks messy, please advice improvements".
 
2:49 PM
good point
but they've not given us a full unit test here
(there's bits missing, and they don't inform us it's a unittest so without that context it makes no sense)
 
so? arrange-act-assert is pretty much universal for unit-tests.
 
@ThomasWard Yes, that’s why I asked for confirmation in the comments
 
they want a review of the assert-part specifically.
 
hmm, possibly
 
@MathiasEttinger I don't have anything against reviewing tests, it just looks to me like it couldn't possibly work as intended...
The intent is 'is A in B', by checking 'if A is the same as C and B is the same as C', where C is static... Just looks broken in my mind
 
2:55 PM
@Peilonrayz That is your perceived intent, maybe the actual requirements are exactly what is being coded
(And both our answer goes over the edge for nothing by failing tests that should pass?)
Anyway, I do agree that the requirements of the snippet are not great, and gray at best
 
"I want to compare the values of Endpoint and protocol of the first list with the equivalent values in the second list." Sounds to me they want to check if l1_i in l2.
But I agree it's gray
 
Monking!
 
try codereview.stackexchange.com for help with working code. — avigil 33 secs ago
 
3:33 PM
0
Q: How can I make the following python code more efficient?

Ajay ShewaleAny efficient way to solve the following problem assuming data is large. I solved the problem but how can I improve the code, which will make it efficient. any suggestions? Data: movie_sub_themes = { 'Epic': ['Ben Hur', 'Gone With the Wind', 'Lawrence of Arabia'], 'Spy': ['James Bond', 'Salt', ...

0
Q: How do I get announcement arrays to display multiple announcements instead of replacing old value?

WingulMy code is designed to create multiple school announcements; one may be regarding the Basketball Team, the other Kingsmen Club team... Whenever a new announcement's information is went through arrays of things like the announcements description, name, room number; it just replaces the old one an...

0
Q: Calling an Oracle Stored Procedure with C# Code

ADHI came across this code in a project I inherited. I am curious if all the nested using statements make sense to anyone else. Also, wondering if this code could not be written in a better/leaner way? private static Dictionary<string, List<string>> GetSubscriptionKeyList(string proc) { ...

 
4:11 PM
Monking
 
possible answer invalidation by 200_success on question by Lou Bagel: codereview.stackexchange.com/posts/194919/revisions
 
Monking
 
@Duga snippetizing - fine by me
 
@Duga jeez, he changed all the code! might have to hit him with my Mod Hammer ;)
2
I don't think that handle would hold up with all the power I put into my swing
 
4:40 PM
Nested loops is generally the way to go. And if your code is working, but you're just looking for style improvements, Code Review may be a more appropriate place. But whether you're asking here or there, you need to post your code. — Barmar 10 secs ago
 
4:52 PM
0
Q: Generic single linked list

SnorrlaxxxI am a mathematician attempting to become proficient with C++. At the moment I am learning about data structures. I am tried writing a single linked list from scratch with some help from online tutorials. I wanted to see if there is anything that I could improve so that I can study and understand...

 
5:17 PM
2
Q: Playing our home-made games!

Simon ForsbergAs developers we know that it's not always easy to get people to play the games that we make. We also know that it's not always easy to find motivation to work on the games you want to make. This is why, once every other Saturday at 15:00 UTC, we will hold an event for playing home-made games. ...

 
0
Q: How to select the list of players from 2 table in the above order?

Anthonyscreenshot of players selection.I'm automating baseball sports reporter application. My application is a desktop application. I'm using winium tool with java language. These are the players that i need to select:: #players names :: positions Happ = CF Bryant = 3B Ri...

 
@CaptainObvious advice requested for future code
 
5:40 PM
-1
Q: create mongodb $project object using lodash

KDSI want to create mongodb $project object to filter in mongodb aggregation const lodash = require('lodash'); const select = ['_id','username','email','sex']; const selectQur = lodash.reduce(select, function (result, value, key) { result[value] = 1; return result; },{}); My expected resu...

 
@LightnessRacesinOrbit > This depends which country you're working in and the usage there. I'm in Belgium myself and it is quite common to have interviews in English even though job postings are in French and Dutch. It is also quite common for a recruiter to switch languages in the middle of the interview to see how easy you are with both country languages. I've also had interviews where one of the interviewers spoke French and the other Dutch. — Laurent S. 6 hours ago
lolwat
 
6:26 PM
After you finish an implementation with classes, you could head over to codereview.stackexchange.com and ask for critique. — bphi 54 secs ago
 
2
Q: Get all combinations of selecting k elements from an n-sized array

David RefaeliWas asked this today in an interview. Didn't see it before, and spent quite a lot of time getting it to work (tricky with all the recursion). The goal was to find all possible combinations of choosing k elements from a n-sized array (basically the Binomial coefficient) and return them. Unlike ...

 
6:51 PM
because it's 2000 lines of string manipulation. I'm not asking for a code review. — arcee123 51 secs ago
You might look at creating an extension method or using automapper: codereview.stackexchange.com/questions/30839/…Steve Greene 32 secs ago
And we're not offering a code review, we need a Minimal, Complete, and Verifiable example, so that we can help you. What you've given us is not that and we can only make guesses as to what the problem could be. — TJ Wolschon 49 secs ago
 
7:16 PM
So what are everyone's feelings on violating SRP if it's clearly documented as to why that's done?
 
@202_accepted If there is a legitimate/good reason, and it's documented, I think it would be acceptable
 
> This function should test if the provided password is valid, and if so, return true and resave the user with a new salt and potentially a new iteration count.
>
> This violates SRP, as it should ideally call to <see cref="ChangePassword(SqlConnection, String, String, Integer?)"/> with the appropriate information, but that is done to allow a more simple API usage. The goal here is to make sure the user always uses the most up-to-date standards of our implemented password security, so we expect to update them on validation.
That's the documentation of the function. (Or, the summary.)
The idea is to call it as user.PasswordValid(connection, txtPassword.Text), which should also rebuild the salt and iteration count should it be a good password. It means that if we up the iteration count, we can update user passwords with the new count. (Same thing on the salt sizes.)
 
7:35 PM
@JekJek A question where you aren't getting the result you expect does not belong in Code Review, the person who suggested that was wrong. Also, the standard way to "thank" on StackOverflow is to accept an answer you thought was the most helpful. — pkpnd 45 secs ago
 
7:48 PM
0
Q: Is REACT SOLID, can I make a component SOLID?

Luis ValenciaI have created the following React Component and wanted to have feedback about if its SOLID or not, and what can I do to fix it. My structure: And my code as follows: Solid.tsx import * as React from 'react'; import styles from './Solid.module.scss'; import { ISolidProps } from './ISolidPro...

0
Q: Python 3 Text RPG Game

phrazzledAfter posting here before, reading that advice, and doing some research, I re-planned and started over. The first thing I did was to create a map so I could see what I had to code for. https://sta.sh/01tlcemlvumr I then finished the code for the first room in the game to see how my new code st...

 
8:05 PM
0
Q: Loading bar for a text game

ShroomBanditI am using Python 3.6.5 and I made a loading bar for a text game I am writing. I did a lot of trial and error to get the outcome how I wanted, however it seems like I went about it an overly-complicated way. I was wondering if there is a more efficient way to write this? import os import time ...

 
9:03 PM
"The above method works greatly, but I do not know if it scales any good." if your code works then you should probably ask this over at CodeReview. — csmckelvey 38 secs ago
 
 
1 hour later…
10:06 PM
0
Q: Using rotation of proxies within a python script

MITHUI've written a script in python using rotation of proxies which is able to fetch different titles from a website traversing different pages. I've tried to write this scraper in such a way so that it will try using proxies randomly until it can get the titles from that webpage, meaning it will use...

 
Just because a question is said to have "working code" and seems to be on-topic on Code Review, doesn't mean that it is automatically off-topic for Stack Overflow - personally I think this one is too "open-ended" for SO while being perfect for Code Review. Just saying. — Paulo Scardine 38 secs ago
 
11:01 PM
@CaptainObvious one more VTC needed - needs a little more context - especially the title
 
11:16 PM
0
Q: Matchmaking for a multiplayer game

JohnI have working code that needs some optimization for scalability and overall performance. This code basically creates a lobby where users wait for match to be created and link users for a multiplayer game match. PlayerWait player = GameMatchEngine.getInstance().createMatch(userId); if (player.ge...

0
Q: Robot on a Grid: Find a path between two corners with forbidden cells on the road

Igor SoloydenkoProblem statement The problem is defined in the book as following: 8.2 Robot in a Grid Imagine a robot sitting on the upper left corner of grid with r rows and c columns. The robot can only move in two directions, right and down, but certain cells are "off limits" such that the robot cannot ...

 
11:56 PM
Well, your question at Code Review was also considered off topic... I wrote an answer, which I had to delete. At this point I believe that there is no StackExchange site where you can as this. Best luck for you. — Gerardo Furtado 31 secs ago
 

« first day (1844 days earlier)      last day (2158 days later) »