« first day (2151 days earlier)      last day (1865 days later) » 

12:00 AM
RELOAD! There are 5915 unanswered questions (89.9058% answered)
 
 
1 hour later…
1:29 AM
1
Q: C++ simple password-protected console app

okkv1747vmI have been reading about passwords and hashing algorithms and what not and decided to write a program. Overview: The user should be prompted to create a password the first time the program is executed. They should enter a key and confirm it. If they have executed the program previously, then th...

 
 
2 hours later…
3:05 AM
0
Q: MVC java console tic tac toe

appleguypublic class Model extends TicTacToe { public static boolean hasWon( int [][] matrix ) { boolean retVal = false; //Check for horizontal win for( int row = 0; row < matrix.length; row++ ){ int sum = 0; for( int col = 0; col < matrix[0]....

0
Q: Create functions for web scraping

iron502I built a web scraper to pull a list of jobs on Facebook and other websites but want to break up the code into functions that I can reuse for other websites. This structure is working but I think it can be more efficient with functions. I'm getting stuck on how to structure the functions. It's on...

 
3:53 AM
Threads aren't all that useful in reading a file. Only one can be reading the file at a time. You could read the whole file into memory, divide the the memory up into blocks and fire those blocks to threads to parse, but it's tricky to chop up a text file because the numbers are all different sizes. I suggest starting with dumb and stupid. This gives you a baseline you can improve upon if it is too slow. It's also something you can ask about at Code Review if it's not fast enough for your needs. — user4581301 30 secs ago
 
4:17 AM
This is a code review question. But I would do an if col == 1 and open a {} inside that I would have if number == — Andreas 36 secs ago
I'm voting to close this question as off-topic because it's a code review question. Post the question there instead. SO is for non working code. — Andreas 57 secs ago
 
 
2 hours later…
5:50 AM
Monking
 
6:18 AM
0
Q: AutoSuggest: Better way to implement focus after inserting a snippet

AvcSIntroduction: I am working on a javascript plugin AutoSuggest, My aim is to create an IDE like autocomplete experience in web applications using JavaScript. One of the features I have implemented is focusing a particular portion of inserted snippet after insertion. This is how I am asking input...

0
Q: Continue to get error messages saying "cannot find symbol"

CorbinI am writing a java program for my class but unfortunately I keep getting an out of bounds error when I run my code to this point. We are supposed to get for our professor a desired output--here I am trying to remove something from an array, but instead I always get the error. while (true) { ...

 
6:34 AM
This is an optimisation question and not really suited to stackoverflow, maybe better for code review — Michael Randall 26 secs ago
 
7:16 AM
0
Q: Python pygame displays images to screen from a string/surface buffer, in grey

chwergyI want to display images to the screen in their original colour, but this code is showing greyscale images. I want to use pygame.images.frombuffer() because it is the lowest resource usage. Also looking for formatting critiques and OOP critiques. import pygame # import random colours = { "...

 
 
2 hours later…
8:51 AM
0
Q: optimizing few lines of code in pandas

Waleed SalehI'm trying to optimize the following lines after doing profiling I found them they are slow, I have no experience with optimization, I hope someone helps calculating square root for distance calculation _df['ds'] = np.sqrt(np.array(_df['dx'] ** 2 + _df['dy'] ** 2, dtype=np.float32)) def subtr...

0
Q: How can I streamline this line of code?

CorbinSo I just completed this project for my java programming class and was wondering if there was anyway I could streamline it to really impress my professor. import java.util.Scanner; public class Main { private static Scanner keyboard = new Scanner(System.in); public static void main(String[] ...

 
I have asked question in stack exchange , I figured answer myself with help of Math community , I wrote code wanted to improve my code one of the community member wrote this "Since you have a working code, you can post it in Code review Stack Exchange where I can explain with typeset math." , how do I migrate that same question from stack overflow to code review or should I post a new question in code overview , I have never used it
 
9:14 AM
If this code works, this is rather a question for codereview.stackexchange.com. — deceze ♦ 5 secs ago
Hi Steven, welcome to Stack Overflow! This is a good question and there are certainly things we can show you to improve, but it's in the wrong place. Your code works, you just want to make it better and are looking for people to review it. The place for that is codereview.stackexchange.com . Could you move it there please? — RemcoGerlich 1 min ago
Welcome to stackoverflow! This site is about code which does not work, so if you have a question about coding style, you might want to ask it on codereviewAemyl 1 min ago
 
9:30 AM
0
Q: Need help to optimize this code and make it more compact

user3016638Need help to optimize this code and make it more compact cat failed_degraded_script.sh echo "***Pulling disk states from all frames***" for i in $(cat HPE_FRAMES_IP); do ssh Reports@$i showsys | awk '{print $2","$5}' ; ssh Reports@$i showpd -degraded -failed | awk '{print $1","$2","$3","$5}' ; ...

 
9:48 AM
@nithin Post a new question, make sure that you follow our rules, also this may also help.
 
1
Q: When is explaining code to its author on topic?

Peter TaylorThe question Python: My program is unable to perform addition correctly which asked for an explanation as to why the code was buggy was closed as off-topic; I don't know about the last two close voters, but the first three used the close reason Code not implemented or not working as intended:...

 
10:23 AM
I found bit more details on this, check here.. codereview.stackexchange.com/questions/90911/…Vinod Singh Bist 35 secs ago
 
10:46 AM
0
Q: Returning null from a constructor in a React Class

Kevin AmiranoffI have seen this in a codebase: Class MyComponent extends React.Component { constructor(props) { if(!props.value) return null this.state = { value: props.value } } .... } This is a React Component. I am wondering what could happen if you return early in the c...

 
11:10 AM
Ah ok thank you I'll look into code review. Just for reference though I'm running this from ROS and this data is posted onto a topic that I'll subscribe to. I'm not really sure how ROS handles data but i don't think it would be the same as reading from a file. — Pfrances 24 secs ago
 
11:33 AM
This is not question for SO, try on codereview.stackexchange.comManWithBear 52 secs ago
 
11:44 AM
0
Q: Simple Console Address Book in C# using Dictionary

user2140740I have created a simple C# console app to display an Address Book using Dictionary. I would like to present it in a interview but I am not sure if the code is "interview" worthy. Given below is the Main() method that calls the methods as required. public static void Main(string[] args) { ...

0
Q: Count unique digits in a given number

AdityaHow do I find the number of unique digits in a given number. e.g if 'input1' is 252 it must return 1, since 5 is the non-repeating digit; if 'input1' is 25000 it must return 2, since digits 2 and 5 are the only non-repeating ones. Is there a better way to solve this problem? // COUNT UNIQUE D...

0
Q: Simplifying a firestore querying function

Mohamed MohamedI have this function where it queries through the database and returns a random user if the requirement is met if not then try it again. It works and all but I feel like the code could be better/shorter/faster but I'm running a blank. It's all done through Firestore, where the Serivces.crud.read...

 
12:30 PM
Also, the site is not for performing code reviews. If you want someone to review your code, please use the Code Review site: codereview.stackexchange.com. — rghome 39 secs ago
 
1:11 PM
This question for Code Review community. — Saad Anees 59 secs ago
 
1
Q: C++ observer pattern via boost.signals2

MaxI was looking for a thread safe implementation of the observer pattern. I read https://xinhuang.github.io/posts/2015-02-11-how-a-multi-threaded-implementation-of-the-observer-pattern-can-fail.html and was thinking about point 4 "Don't reinvent the wheel, use Boost.Signals2 instead". So I tried th...

0
Q: Public Function to remove empty or "" elements from a single dimension array

Samuel EversonI've written a function to remove empty or "" value elements from an array or in other words return an array consisting only of elements containing a value. Option Explicit Public Function RemoveBlanksFromArray(ByVal TheArray As Variant) As Variant Dim temp As Variant ReDim temp(LBoun...

 
2:09 PM
0
Q: JS to create Table data dynamically

the thinkerThe following codes generate table row dynamically. I wonder if there are better ways of generating the same data. Also instead of manually coding the heading and the table itself, is it possible to code them with less codes without using the innerHTML function. <table> <thead> <tr> ...

-1
Q: I want to download,copy and print the HTML contents from the grid. From the below code i'm just able to download the data displayed in the grid

sundar pawar$('#tableQnAs').dataTable( { dom: 'Bfrtip', buttons: [ 'copy', 'excelHtml5', 'print', ], For example in grid i'm using Anchor tag where the text appears as "Please Click" in grid the same is downloading but i required the content in Anc...

0
Q: What is an algorithm to solve sudoku in efficient way in c?

yeoescoMy sudoku solver works quite fast and quite good with small data (4*4 and 9*9 sudoku). But with 16*16 it takes too long and doesn't solve 25*25 sudoku at all. How can I improve my program in order to solve big sudoku faster? I use backtracking and recursion. And I think that checking row, column ...

 
3:02 PM
0
Q: Very slow Python data writing

StumblerI have some code that is meant to take the output of a Neural Network and recombine it with the original input data (writing it to file). However, despite the fact that the heavy lifting has already been done by the neural network, the portion of code responsible for this recombination and writin...

0
Q: Simple SOM in Tensorflow

FelixI've implemented a self-organising map in Tensorflow's low-level api. After testing with sklearn's Iris data, the results seem correct. I did implement the algorithm also using NumPy before converting it to tf, because I'm new to Tensorflow, and had no idea whether it would work or not. So of cou...

0
Q: Fast sudoku solver

yeoescoMy sudoku solver works quite fast and quite good with small data (4*4 and 9*9 sudoku). But with 16*16 it takes too long and doesn't solve 25*25 sudoku at all. How can I improve my program in order to solve giant sudoku faster? I use backtracking and recursion. It's hard to explain, but it should ...

 
3:28 PM
Stack Overflow is generally for code that isn't working. You might find the help you're looking for on Code Review.SEesqew 6 secs ago
Your question would be a better fit on Code Review, as your code works and you're seeking improvements and/or constructive criticism. — Amy 29 secs ago
@AhmedBajra With the current phrasing, OP's question is better suited for Code Review.SE. If they acknowledge there's an issue, it'd become more on-topic. — esqew 40 secs ago
 
3:43 PM
I'll move it over to code review. As I've written it is working, but I know it's nowhere close to being a good code. There way a typo, that I've corrected — Sachin 8 secs ago
 
3:56 PM
0
Q: Find the sum of the digits of a given number

AdityaI need to find the sum of the digits of the given number and repeat the process until the value lies between 1 to 9. e.g if the input is 72457 then, 7+2+4+5+7 = 25 2+5 = 7 so , the function should return 7. Also, if the input is a negative number like -72457 the function should return -7....

0
Q: Wrapper for a standard STL-container

MaxOn the Internet, I found just such a wrapper for a standard STL-container std::unordered_map. I am interested in your opinion about its expediency and especially the expediency of redefining the operator(). template <typename KEY, typename VALUE> class MyUnorderedMap { std::unordered_map<...

 
4:20 PM
 
4:52 PM
0
Q: Array of buttons is rendered, by condition one button should not be rendered, how to achive that?

James DelaneyI have array of objects, which contains parametars for buttons whouch should be rendered. Based on type of user(role) who is currently logged in application, I should render 2 or 3 items from array. Here is how rendering looks: <Button.Group size="small" floated="right"> {buttons.map(button =>

0
Q: Implementing a c++ Kafka producer based on librdkafka

swdonTo practice my c++ I decided to implement a simple Kafka producer to wrap the producer in c in librdkafka library. I just want to get your opinion on the way I have implemented teh default, copy and move constructors and make sure what I'm doing is safe. Default constructor: kafka_publisher::...

 
5:16 PM
Monking
 
5:47 PM
0
Q: where should we add Exception handling here

ProgrammerzzzI am reading a custom config section in my app.config and iterating through the URL's to get some response in JSOn and parse it to send the email with the details in there. I got the basic walking skeleton of console App and I wanted to know how do I handle exceptions here, in the calling methods...

0
Q: PHP code structure

NorgulI am making a library which can use different auth mechanisms. I have abstracted the code within an interface: interface Authenticable { public function getName(): string; /** * Based on auth type, return the right format of credentials to be sent to the server * * @param...

 
6:43 PM
What would be the best way to ask for review of code that is part of a large project? Having all of the code's dependencies included in the request for help would essentially be bringing the entire project along, so how should I handle that?
 
@Peilonrayz so I should make a test rig to go with the code if it's not standalone?
Mk
 
@moonheart08 Usually. If you have things separated well you should be able to include the specific code you want reviewed, and appropriate tests relating to that code.
 
7:37 PM
0
Q: Improving the speed of creation for three Perlin Noise Maps in Python?

LuminousNutriaI am interested in learning how I can improve the speed of the code in this pygame file. I iterate over 6400 * 1800 * 3 elements of various numpy arrays here to apply noise values to them. The noise library I'm using can be found on GitHub here. All others are self-explanatory noise-maps. I am c...

 
8:15 PM
possible answer invalidation by greg on question by greg: codereview.stackexchange.com/posts/216068/revisions
 
8:31 PM
-1
Q: Export data from datatable to excel?

sundar pawarI am trying to export data from datatable to excel. I have anchor tag in in column and its coming as text in the excel. Please check my below code $('#tableQnAs').DataTable( { dom: 'Bfrtip', buttons: [ 'copy', 'excel', 'print' ], columnDefs: [ { targets:...

 
9:15 PM
possible answer invalidation by greg on question by greg: codereview.stackexchange.com/posts/216068/revisions
 
9:25 PM
0
Q: Form validation in a variety of different ways depending on the field input

Kappa123I've created code in JavaScript for a form validation in a variety of different ways, including if the field is empty, if it contains special characters, if it has numbers/letters when it shouldn't have, and if it exceeds a certain limit. There's also some special cases when the field asks for a ...

 
10:05 PM
1
Q: 2-team Fraction Quiz/Test in Python 3 with tkinter

Jerry CuiI created a math quiz/game called "Factions". In the game, there are 2 teams. Red team and Blue team. They take turns answering questions relating to fractions. If they get it correct, they gain points equal to the round number * 100. If not, then they lose points equal to the round number * 100....

 
look at what others coded - poker is often used. f.e. codereview.stackexchange.com/questions/144935/…Patrick Artner 50 secs ago
 
 
1 hour later…
11:26 PM
0
Q: Golf game boilerplate

alec935I wrote a program in pygame that basically acts as a physics engine for a ball. You can hit the ball around and your strokes are counted, as well as an extra stroke for going out of bounds. If I do further develop this, I'd make the angle and power display toggleable, but I do like showing them r...

 

« first day (2151 days earlier)      last day (1865 days later) »