« first day (2765 days earlier)      last day (1242 days later) » 

12:00 AM
RELOAD! There are 7134 unanswered questions (89.7293% answered)
 
12:13 AM
0
Q: how to merge two lists based on common key value in python

ErwinRingleyI am trying to get some data from remote server based on fields provided in HTTP/POST request. There are some 1500 fields, however at any given time I can query only 30 fields. So I am breaking the 1500 fields in 50 chucks and making 50 requests to remote host. Return data contains 5000 json reco...

 
 
2 hours later…
2:18 AM
0
Q: Is the math on my Coin Flip Streaks script correct?

JerryTnI am attempting to complete the coin flip streaks problem from automate the boring stuff with python. My code works fine but my only concern is the phrasing of the task. Does the question want us to find the number of samples (100 flips) that contain at least one streak and divide that by the tot...

 
 
1 hour later…
3:27 AM
What exactly is your question? If this is working code and you just want comments on improving it, then you can take it to codereview.stackexchange.com. But, only if it's already working. — jfriend00 1 min ago
 
 
2 hours later…
4:58 AM
codereview.stackexchange.com will do it for free. — Russ J 7 secs ago
 
 
1 hour later…
6:04 AM
Why you want to avoid goto: it's hard to get right, and when you get it right it's even harder to convince other people working on or around your code that you did get it right. It's usually easier to write your way around a goto than it is to defend it through code reviews and the unending barrage of "Never use goto!". — user4581301 30 secs ago
 
6:52 AM
-1
Q: how does this turn based system in python work?

python newbieI've been trying to make a game in pygame and was unable to make a turn based combat system so I looked for references on google and found this code but Im new to programming and dont really understand how it work, I get all the functions and syntax used (except one) but I dont understand how it ...

 
7:34 AM
Is there a question here; or are you just advertising your code? Which is really off-topic. As for your query [, 'I wonder if it can be improved, using the same logic and method I used in it, just with less code'], then that is an opinion and thus off topi as per the SO rules. If you are looking for a 'code review', then that is the StackExchange 'code review' site. Anything can almost always need improvement. — postanote 27 secs ago
if your new implementation is working correctly, and you want it reviewed, then perhaps post it on CodeReview? (traffic there is pretty low though...). the code in the answer does the right thing AFAIAC, I'd do the same, up to the syntax of course. or we could first run the indexing from the previous question, pairing each node's payload with its index. I think tfb hints at that in the initial discussion. then, on such indexed tree, the replacement would go directly to the node in log time, instead of having to search through whole tree in linear time as it does. — Will Ness 10 secs ago
I’m voting to close this question because - it belongs on code review and that site is not listed in the "other sites" list. — Lee_Dailey 11 secs ago
 
 
1 hour later…
8:57 AM
1
Q: How to make a secure login – is my login script secure?

DavidI have a login system for my website that works as follows: In my database I have a table called users with the fields user, password and authentication_token. password contains the hash of the users password. authentication_token contains a unique string with a length of 64 characters. Every pag...

 
 
2 hours later…
11:02 AM
0
Q: 2048 in Matplotlib

Arief Anbiya2048 in Matplotlib How to improve the code? I did an OOP to make 2048 using Matplotlib visualization. The color dictionary is for setting different colors to each number in the game. There are two classes written here: App2048, through which we add interactivity and we run the app, and CellObjec...

 
 
2 hours later…
1:05 PM
Note that you should usually find these kinds of abominations in testing or learning situations. It would never pass any code review of mine, because it's entirely unreadable. So while the course might require you to learn how to parse this kind of mess, it's not a skill that you should require in practice. — Joachim Sauer 52 secs ago
 
0
Q: Understanding difference between SQL statments

Furqan HashimI am confused on how 2 different SQL conditions would work. Suppose I have a table with 3 datetime columns named price_timestamp_a, timestamp_a and original_timestamp_a for product a and 3 datetime column pertaining to product b price_timestamp_b, timestamp_b and original_timestamp_b I want to ch...

 
1:26 PM
A relevant snippet with attention to secure querying practices here: codereview.stackexchange.com/a/252785/141885mickmackusa 35 secs ago
 
0
Q: (from codeabbey) This code is supposed to add or multiply a bunch of numbers and at the end divide by a certain number and outpout the decimals

Roger MasFor example if the numbers are: 5 + 3 * 7 + 10 * 2 * 3 + 1 % 11 then it would multiply and add all the numbers giving 397 and divide by 11 giving 36.09 so therefore it must output 1. My code works in this scenario but if I do more larger numbers it doesn't seem to work. This is what I have #include

 
1:42 PM
Monking
 
2:28 PM
If this is already working code and your question is "how can i make it more efficient", then I think it is off-topic here at Stack Overflow which deals with specific questions and problems. Check out another SE site, Code Review, which says "If you have a working piece of code from your project and are looking for open-ended feedback. The list of feedback includes performance. Make sure to check their How to Ask page before posting. — Gino Mempin 58 secs ago
 
3:01 PM
Hi, this is probably better suited for Code Review, although, you should check out the guidelines for posting there. — juanpa.arrivillaga 59 secs ago
 
3:12 PM
0
Q: HackerRank itertools.combinations()

FoundABetterNameI was solving the following problem on HackerRank. Here's my solution - from itertools import combinations a = input() ls = list(map(str, a.split())) for i in range(1, int(ls[1])+1): ls2 = [] ls2 = list(map("".join, combinations(ls[0], i))) for elem in ls2: ls2[ls2.index(elem)...

 
3:42 PM
If the code works correctly post to Code Review instead — Guy Incognito 58 secs ago
 
4:27 PM
0
Q: Failed to load resource: the server responded with a status of 405 (Not Allowed) socket.io/?EIO

user13911625Failed to load resource: the server responded with a status of 405 (Not Allowed) socket.io/?EIO=3&transport=polling&t=NOFP7il:1 Failed to load resource: the server responded with a status of 405 (Not Allowed) zone-evergreen.js:2845 POST http://MYDOMAIN.compute.amazonaws.com/sock i am having this ...

0
Q: react component optimization

Łukasz NarógDears I have following component import React from 'react'; import styled from 'styled-components'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { filterTransactionsByDates } from 'Utils/functions'; import {ReactCompo...

 
4:39 PM
You should write a class to hook the events. Responding to Events of Dynamically added ControlsTinMan 19 secs ago
 
4:51 PM
0
Q: Google foobar challenge "prepare the bunnies escape"

sushiwithoutsushiHi I am trying to solve the next problem: You have maps of parts of the space station, each starting at a prison exit and ending at the door to an escape pod. The map is represented as a matrix of 0s and 1s, where 0s are passable space and 1s are impassable walls. The door out of the prison is a...

 
5:13 PM
@Vogel612 Question: If a user gets suspended on another site for voting irregularities there will be no action/warning triggered on the other network sites, right?
While it may be a good idea to take a look, just to be sure.
 
 
2 hours later…
7:08 PM
@Mast Yes I don't think it would affect other network sites, but I'm not sure either
 
7:21 PM
0
Q: Codeforces problem Java code optimization

lostpersonThe problem says: You are given an array a of length 2n. Consider a partition of array a into two subsequences p and q of length n each (each element of array a should be in exactly one subsequence: either in p or in q). Let's sort p in non-decreasing order, and q in non-increasing order, we c...

0
Q: Deleting characters at specified indices

Yogesh PandeyThis is a problem wherein I am given an array of Strings and some of those strings contain a dollar($) character. The task which I am aiming to accomplish here is that I have to remove the characters at the index where this symbol is present as well as at the index before it. And finally, I have ...

 
 
1 hour later…
8:31 PM
Code Review Stack Exchange may be the place to go for. — Bill Huang 23 secs ago
 
9:00 PM
possible answer invalidation by Linny on question by vega69: codereview.stackexchange.com/posts/252647/revisions
 
@Duga Fine
 
9:26 PM
0
Q: Ternary Search Tree find max word

NicaI need to write a maximum function so that it finds that longest word in the Ternary Search Tree and prints it. This is what I have done so far. I have words in the tree such as "canvas", "cats" "van" but it prints None any way. def maximum(self): if self.root == None: return 0 pt...

 
10:09 PM
@Mast While it's not explicitly mentioned in the FAQ on suspensions, I'm sure I can tell you that I can not see private information from other sites in the network
 
10:41 PM
0
Q: Leetcode 17 : Letter Combinations of a Phone Number

cloudy_eclispseProblem Statement Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any lette...

 
11:06 PM
0
Q: Implemented my own version of every() from {purrr}

iamericfletcherI am new to programming / R and new to writing functions. I am working through the book R for Data Science and am on the following exercise: Implement your own version of every() using a for loop. In case you're unaware, the every function from purrr does the following: Do every element of a list...

 
11:31 PM
0
Q: Using Euler-Maruyama method to solve Ornstein-Uhlenbeck equation (SDE)

Iwan PhillipsI am trying to implement the Euler–Maruyama method and use it to solve the Ornstein–Uhlenbeck process. I am basing my code on the wikipedia page where a python implementation is shown. More generally I'm trying to get to grips with stochastic differential equations in c++. This is my code #include <

 

« first day (2765 days earlier)      last day (1242 days later) »