« first day (2208 days earlier)      last day (1801 days later) » 

12:00 AM
RELOAD! There are 6055 unanswered questions (89.8529% answered)
 
12:16 AM
0
Q: Optimizing a slow pixel numpy for loop

Jack HalesSo I've had a good read of the following questions: Looping over pixels in an image Fastest way to iterate over numpy array But they both use libraries I'm not using (CPython) or are very specific in their approach and requirement for optimisation. The following is my current simple loop: i...

 
 
3 hours later…
3:31 AM
0
Q: Python program for fibonacci sequence using a recursive function

JustinA Fibonacci sequence is the integer sequence of 0, 1, 1, 2, 3, 5, 8..... The first two terms are 0 and 1. All other terms are obtained by adding the preceding two terms. def recur_fibonacci(n): if n <= 1: return n else: return(recur_fibonacci(n-1) + recur_fibonacci(n-2)) nt...

 
4:12 AM
Monking
 
Monking
 
0
Q: Python program to find the subarray with maximum sum

JustinAn assignment at school required me to write a program for this task (explained): Define the function find_max_subarray that takes a list as argument and two indexes, start and end. It finds the maximum subarray in the range [start, end – 1]. The function find_max_subarray returns the ...

 
 
2 hours later…
6:34 AM
If the code is working then this would be better on codereview.stackexchange.comSome programmer dude 16 secs ago
 
7:08 AM
1
Q: Script to download images from Reddit

Prashant SengarI wrote this script to download images from Reddit. I would like to hear from others on how can I improve this script. import requests as _requests import os as _os class Redpy: def __init__(self, user): """Enter a user agent""" print("hello") self.user = user ...

 
7:47 AM
1
Q: Get all possible subsets from a set of distinct integers using OOP

JustinAn assignment at school required me to write a program for this task: Create a class and define two methods in the class. Method f1 is used to pass an empty list and the sorted list is taken from the user to method f2. Method f2 is used to compute all possible subsets of the list. Th...

 
Monking
 
 
1 hour later…
9:05 AM
0
Q: Find all the factors of a given number

THE EPIC GUYThe most basic code(i guess so) to find all the factors of a number Note:factors include 1 and the number itself Here's the code: c=0 x=int(input("Enter number:")) for i in range(1,x+1): if x%i==0: print("factor",c+1,":",i) c=c+1 print("Total number of factors:",c) Please...

0
Q: Typeclass-oriented example project with implicit classes

Markus AppelThe following code will only be an example of a project that due to (nested) higher kinds heavily relies on typeclasses for it's DSL. When reviewing the code keep in mind that this is an example, so I am not relying on libraries like cats even if they might already provide solutions for what I a...

0
Q: Beginner programmer having problems with first program assignment

mlgI have made a few adjustments, I still can not seem to find the problem. any help would be appreciated. 1 ## 2 # This program computes the price of an order from 3 # the total price and the number of the books that 4 # were ordered from ...

 
9:16 AM
CodeReview is a better place for code that works but you'd like improved (be it in regards of performance, stability or maintainability) — Aaron 15 secs ago
 
9:43 AM
0
Q: Arkanoid Console Game

Sandro4912After doing the Snake Game I decided to go more crazy and made an Arkanoid Clone: Currently this only runs on Windows. I tested it under MSVC2017 with Windows 7. If you want to get it to run on Linux or Mac you have to implement the Part in Console.cpp. I organized the code as following: G...

0
Q: Memory policy with ArrayPool<T>.Shared

NamelessK1NGi've recently released a from scratch set of library Astron, and I wanted to get my memory policy logic reviewed.(you can find a little doc about it here). My first goal was to provide an extandable API to allow the user to implement his own memory policy, but I've also provided some base imple...

 
10:22 AM
0
Q: Creating a Java text-based game map

Stevei got a college project and i'm trying to create a map for my text-based game in Java. My colleague has created this code: public class Mapsystem2 { //δημιουργία των πινάκων maps static int[][] map1= { {0,0,0,0,0,0,3,3,3,3,0,0,0,0,0,0},{0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0},{0,3,3,0,0,0,1,1,1,1,1,1...

 
10:42 AM
0
Q: Check if current time is within the timeframe using Joda-Time

yinderNovice Java developer here. I've never really used a time/date library before and I'm curious how an experienced developer would solve this. You're given 4 ints: startHour, startMinute, endHour and endMinute. Now, check if current time is within the given timeframe. Is there a more clean way of d...

 
@kudlatiger If the code works for you and you only seek "improvement", then maybe try CodeReview SE. — Fildor 50 secs ago
 
11:10 AM
I think your question is better suited for codereview.stackexchange.com than for Stackoverflow. — hellow 45 secs ago
On a second thought... You are having a problem (which is not quiet clear at first glance), which you want to be resolved. I thought you want a codereview of your implementation — hellow 5 secs ago
 
11:40 AM
0
Q: ConcurrentHashMap with synchronized

EliI am maintaining some code and found some implementation with synchronized key-word on ConcurrentHashMap. It seem unnecessary to me: public class MyClass{ private final Map<(MyObj, Map<String, List<String>>> conMap = new ConcurrentHashMap<>(); //... //adding new record into conMap...

 
11:59 AM
0
Q: Constructor function not kicking in

rawdpiperI came across a practice question where we are asked to write a program that takes in date values for two individuals and then cross check if the dates given are valid, if the date is not valid, a constructor comes in which sets he date back to January 1. The issue I have is the "Date" constructo...

 
Hi Zishan and welcome to Stack Overflow. Stack Overflow is a part of the StackExchange network geared towards helping with specific problems, if you're looking for a code review / refactoring suggestions then I recommend you post this on a different StackExchange site dedicated for that purpose: codereview.stackexchange.comJeremyW 14 secs ago
 
12:19 PM
0
Q: Wait for calculations within loop to finish before return

borkI have two components, charValueMatcher and main. The charValueMatcher module accepts a string which it loops through and formats the string. When it's done, the formatted string is returned. main is simply using this module. charValueMatcher.js module.exports = (string) => { let formatted = ...

0
Q: Countdown - word solver

EMLHere is my countdown word solver if people want to see an example of how it works. I've used the enchant library as my dictionary checker import itertools import enchant word = input("Please enter the letters or words to scramble: ") perm_words = itertools.chain.from_iterable(itertools.permuta...

0
Q: Import and copy paste to template table

C.EdoMy code works fine when I've written it last week and this week when I got new file and run my code, it didn't work to copy paste to another sheet. Can someone helps me please? Option Explicit Sub Import_ClientRating() '1. First Import data 1-to-1 to Table template '2. Used Find function to ...

 
This is really more suited for Code Review. But your code looks fine to me. I see no good reason to change any of it. — glennsl 55 secs ago
 
12:39 PM
0
Q: Cleanest way of making templated friend function with required template parameters visible to ADL

JoeGiven the following example: template<typename T> struct foo { template<typename O> friend foo<O> cast(foo const &) { return {}; } friend foo bar(foo const &) { return {}; } }; int main(int, char**) { foo<int> a; auto b = bar(a); auto c = cast<double>(a); return 0; }...

 
 
1 hour later…
1:41 PM
Greetings, Programs.
 
1:58 PM
The only minor issue I can see is that AgentDistance creates a new class just for sorting that doesn't add meaningful information once that sort is done. Given an instance of that class, you have a Distance property but there's no way to tell where that distance was measured from. This is probably a better fit for code review because your code works. You also found a way not to add the property to Agent. I have a few trivial thoughts but I think code review is a better fit than SO. — Scott Hannen 6 secs ago
 
Monking..
If I'm not gaining enough experience in distributed systems (I have zero exposure), how do I learn it myself?

I'm currently reading designing data intensive applications to handle this gap of knowledge, which is good.I can try and create stuff on Heroku, but It would cost a lot of money to properly try distributed computing.
 
Julia Silge on May 21, 2019

Are education level and job (or career) satisfaction related?

What are the pros and cons of remote work?

Are people in tech overworked? Specifically who, and how much?

 
Do you have any idea how I can tackle this problem? How can I get more knowledge without being exposed to such work. I can spare about 100$ - 200$ maybe per year.
Is there a better place to ask this question?
 
I'm voting to close this question as off-topic because it is asking for a code review (and this thus too broad / opinion based). It could probably be adjusted to be on topic for the code review stackexchange. — Quentin 51 secs ago
Hey Quentin, thanks for the comment. I didn't know about the code review, and am still very new to using StackOverflow. I edited my question for clarity and to pinpoint exactly what I'm trying to figure out. — Chase 46 secs ago
Please clarify your question. Are you requesting a code review? — Ivan Starostin 5 secs ago
@Chase — But you haven't deleted it from Stackoverflow and then asked it on the Code Review Stackexchange. — Quentin just now
@Fildor Is it possible to move this thread to codereview SE? — kudlatiger 44 secs ago
 
2:58 PM
Monking
 
3:20 PM
possible answer invalidation by adot710 on question by adot710: codereview.stackexchange.com/posts/219511/revisions
 
@Duga hmm... it looks like this post has been rolled back a few times
@Duga @Vogel612 thanks for rolling it back - should it be locked or wait to see if OP changes it again?
 
AFAICT the edits were different, and even so, I added the answer invalidation comment for the first time there
 
okay apparently Rolland didn't do that ;| 😏
Today we eliminated a veteran JS zombie :)
 
3:40 PM
@SᴀᴍOnᴇᴌᴀ nice one :)
 
4:05 PM
Monking
 
4:35 PM
0
Q: Singly-linked queue in PHP 7

coderoddeI am learning PHP 7 and decided to implement a simple FIFO singly-linked queue in it: <?php class QueueNode { var $item; var $next; function __construct($item) { $this->item = $item; } function get_item() { return $this->item; } } class Queue { var...

 
5:09 PM
Looks like it still needs a lot of improvements. If the code works, it might rather be a question for Code Review Anyway, you could wrap your bootstrap into a function and do the iterations with replicate. Replace data$variables with data["variable"], don't do summary(boot.fit2) several times, do it one time and store the result in a matrix, rather apply .lm.fit than lm, try to use colMeans of the whole data frame instead of mean of every variable, etc, etc — jay.sf 42 secs ago
 
0
Q: Sorting with IComparable design

Yonatan NirI got a C# class: public class Agent { public string AgentId { set; get; } public double Longitude { set; get; } public double Latitude { set; get; } } There are several agents in several different locations. During the program's lifetime, they can receive a call to another (latit...

 
5:30 PM
@jay.sf Thank you for taking time to review this. I didn't know Code Review was even a forum! I will cross-post this there. I recognize that it needs a lot of work. If you have a minute, could you explain how to make the bootstrap a function? — J Bacon 8 secs ago
 
5:41 PM
1
Q: Countdown number game solution v2 using itertools

EMLI recently posted a solution for the numbers game on the Countdown TV show using a recursive technique. For those unfarmiliar with the rules… A fixed set of numbers (usually 6) are chosen at random A target value is set The player must reach the target value using some or all of the numbers fr...

-2
Q: Am I making use of eloquent relationships properly?

ironchefbadassThe following is working fine but it feels clunky. My name concerns are URL hijacking and is why I'm using firstOrFail() but in the case of my last method for viewing a specific item in a specific container, it feels "wrong" using firstOrFail twice - I feel like I'm not properly using relations...

0
Q: Bias-corrected percentile Bootstrapping Optimization

J BaconI have never posted to this forum, but was referred here. I need some help optimizing my code and run time. If someone had some time to help/explain how to correct various parts, I would be much obliged. I am new to R and trying to help out on a project. I am trying to run a bias-corrected perce...

-2
Q: How can achieve LSTM/RNN history-based prediction by using Keras backend?

MarioFor my experiment, I have a formatted csv file with 1440 columns like following: timestamps[row_index] | feature1 | feature2 | ... | feature1439 | feature1440 | ----------------------------------------------------------------- 1 | 1.00 | 0.32 | 0.30 | 0.30 | ...

0
Q: Please check this code

tonystavI created a feature-rich version of Conway's Game of Life as a coding challenge, and I would like a critique of the code, please. https://github.com/tonystav/GameOfLife (Needed to post code sample, full code available at link above) public class GameOfLife extends JPanel implements ItemListen...

 
6:00 PM
0
Q: Implementation of Dijkstra algorithm

Balkrishan NagpalI am trying to implement Dijkstra algorithm. I try to calculate cost of reaching every node from first node. Though I have tried with couple of graphs and results are correct but I have one doubt which leads me to think that something is wrong with my implementation. Here is my implementation pr...

 
6:20 PM
0
Q: Unity3D shader for rendering 2D sprites with a pseudo-glitch effect

JesseTGI'm making a puzzle game in Unity with sprite-based graphics. When the game is paused, I want to hide most game elements, because I don't want the player to be able to pause and leisurely think about their next move. I could just make the sprites invisible, but I decided to do something more st...

0
Q: Authorization using Entity Framework in ASP.NET MVC

Roberto991. Backstory I recently starting programming and I found out that Entity Framework works perfect for my small-sized applications due its simplicity. I've made my custom authorize attribute for MVC controllers and controller methods to check if the current user has a certain role (which is an en...

-1
Q: CSS class naming convention

cslogicI think every frontend developer knows how BEM works right? If not, that's okay. Just Google it and you'll find a LOT of documentation and articles about it. Personally, I love how intuitive and innovative BEM is. For small components, it works like a charm. But as you project requires longer com...

 
6:31 PM
does this answer look okay? should we ask the user to provide more details?
 
6:42 PM
I'm voting to close this question, since it is too broad for this site to be on-topic and it is already cross posted on CRSᴀᴍ Onᴇᴌᴀ 53 secs ago
possible answer invalidation by Martin Frank on question by Martin Frank: codereview.stackexchange.com/posts/220554/revisions
 
6:59 PM
If you have working code and want help making more efficient, please see CodeReview, which is more tailored for that. If you are in fact having issues with your code, please revert to my previous comment. — Cyril 29 secs ago
 
7:24 PM
@SᴀᴍOnᴇᴌᴀ VLQ, since the content is not enough to be a review
 
7:39 PM
0
Q: php PDO Librery to handler Mysql querys

walter nuñezthis is my Library class. this not have any issues but i want to know if i have any mistake; or way to improve performance: <?php class Class_DbManager { //for select //$Query is array with database index and query string //$Conf is secundary conection data public function GetDat...

 
You're pretty much just asking: "is the structure of my project fine?" And the answer I guess is yes, it is fine, it should work. (Although, your mapStateToProps should probably be users: state.users in this case and your action should just return action.user.) However, I'm not sure what kind of answer you're looking for, SO is for solving specific issues, I think this is more suited for Code Review once you get your project going. — Yannick K 35 secs ago
 
8:18 PM
1
Q: Add one to the last array element

thadeuszlayThe task is taken from leetcode Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant digit is at the head of the list, and each element in the array contain a single digit. You may...

 
9:13 PM
To be honest, you're probably better off asking optimization questions on Code Review, if the code already works. — BigBen 56 secs ago
 
-1
Q: Correcting Bash Oiutput

αԋɱҽԃ αмєяιcαη#!/bin/bash start(){ printf 'Real IP: %s\n' "$(curl -s ifconfig.co)" set -- /etc/openvpn/ovpn_tcp/*.nordvpn.com.tcp.ovpn shift $(( RANDOM % $# )) screen -S vpn -dm openvpn "$1" # connect sleep 5 # wait for connection printf 'VPN IP: %s\n' "$(curl -s ifconfig.co)" } stop(){ screen -...

 
possible answer invalidation by Sᴀᴍ Onᴇᴌᴀ on question by thadeuszlay: codereview.stackexchange.com/posts/213579/revisions
 
9:38 PM
I'm voting to close this question as off-topic because the code is working, so is better off on codereview.stackexchange.com. The question does not appear to be in scope for SO. — Mad Physicist 35 secs ago
 
10:22 PM
Generalized questions on how to improve already-working code belong on Code Review, not Stack Overflow. SO is scoped to questions about specific, narrow problems. — Charles Duffy 19 secs ago
I'm voting to close this question as off-topic because it is asking for a code review (and this thus too broad / opinion based). It could probably be adjusted to be on topic for the code review stackexchange. — Quentin 30 secs ago
See A Guide To Code Review For Stack Overflow Users for guidance on which questions are topical on which site, and what changes are needed to make a question fit in CR's guidelines. — Charles Duffy 41 secs ago
 
10:36 PM
0
Q: Looking to shorten method of parsing arguments in BASH

goose gooseI have here a working method of parsing input arguments however it seems redundant. I would like to shorten this code so it doesn't appear so repetitive. tool.sh <file-to-use> tool.sh <file-to-use> -o <output-file-name> # If arguments are set and equals "-o" then set APP_NAME if [[ -n $3 ]] &&...

 
11:02 PM
I just noticed this user has an auto-comment in the about me section of the profile...
I wonder if that is purposeful...
or maybe it was an accidental paste...
 
0
Q: Simple REST Base Web Server with Unit Tests

jmacncI am building out a simple web server in Go. My goal is to expand on this framework in a different application I am building. Here is my github repo https://github.com/jmacnc/gowebserver Is what I have here using best practices? I am specifically looking for feedback on the tests, and how I ...

 

« first day (2208 days earlier)      last day (1801 days later) »