« first day (2001 days earlier)      last day (2015 days later) » 

12:00 AM
RELOAD! There are 5768 unanswered questions (89.7176% answered)
For working code, codereview.stackexchange.com might be more appropriate. — Jarod42 36 secs ago
 
12:46 AM
0
Q: Executable Wrapper Around Perl Script on Windows

Gregory NisbetI have ack (the searching tool) "installed" as a single file at C:\ack\bin\ack.pl on a Windows 10 machine and was wondering how to make it executable from the powershell window and other terminals. I wanted to do it ideally without touching the PATHEXT variable and associating an interpreter to ...

 
 
2 hours later…
 
2 hours later…
4:13 AM
 
4:41 AM
0
Q: Median of two sorted arrays (optimal runtime)

loremIpsum1771I've written a solution to the leetcode problem Median of Two Sorted arrays. The solution I anticipated coming up with initially was going to features some kind of binary search on both arrays based on the range of numbers (given that the question calls for a runtime of O(log (m+n))). Along the ...

 
5:12 AM
0
Q: This Code fetches data based on various levels in an hierarchy

suraj13kThese are functions to fetch data in my Repository class for various levels in hierarchy. For example first function is to fetch data based on top level and second function is for second level(so it has input of first level ID) and so on upto 5 levels public async Task<List<object>> GetUniversi...

 
6:11 AM
@RMunroe They better not.
 
6:28 AM
@JesperJuhl "Allocates from a different heap" ???? There is just one heap... Smart pointers would definitely not pass my code review, because real-time audio needs precise control on memory allocation (because of blocking), and old-school allocations provide the best way to see what happens exactly. — Gabor Szanto 59 secs ago
 
 
1 hour later…
0
Q: Reconstructing Matrix scattered over many MPI ranks

nickI have a program that does some matrix computations using MPI (MPICH). Each rank has a slice of the matrix and does the computations on their slice to get a new slice of the matrix. Sometimes I need to synchronize the matrix on the manager for snapshotting, output, etc. so I need all ranks to sen...

 
8:17 AM
0
Q: Lemonbar + perl scripting for workspaces

user9111001I have made this program to simulate polybar's bspwm module. So far, it works flawlessly, however it consumes too much ram and cpu ie 16-30%. I suspect it is the while loop causing the trouble but what can be done to reduce resource usage ? the link to the program

0
Q: A basic multi-dimensional array

YSCI have been lurking on the C++ side of stack-overflow only long enough to know there are a lot of beginners and intermediate programmers baffled by multi-dimensional arrays. I've seen a lot of monstrosities : three stars programmers, cache-unfriendly implementations, vectors of vectors of vectors...

 
possible answer invalidation by Leeloo on question by Leeloo: codereview.stackexchange.com/posts/206249/revisions
I think this question is more appropriate on Code review or Software EngineeringArthur Attout 39 secs ago
Welcome good sir. Because there is no problem to actually solve, you might want to ask this on a another Stack Exchange site geared up for code reviews. How to Ask. Good luck! — MickyD 17 secs ago
possible answer invalidation by Leeloo on question by Leeloo: codereview.stackexchange.com/posts/206249/revisions
 
8:52 AM
@Duga Rolled back and closed.
That's a mess. Post a follow-up instead.
 
 
1 hour later…
10:22 AM
0
Q: Python requests downloading big files in slower speed than wget

faquirThis is a simple toy downloader using python's requests library. I’ve monitored the download process is slower on an ethernet connected box. The realtime speed is measured both on stdout, using get_net_speed() function, and conky. I’m using a 4Mbps connection. When downloading a file using w...

 
10:37 AM
maybe this would be better suited at codereview.stackexchange.comjojo 15 secs ago
 
0
Q: Place arithmetic signs in correct order to get the number

Developer87Given a list of numbers, place signs + or - in order to get the required number. If it's possible then return true, otherwise return false [1, 2, 3, 4, 5, 7]; 12 -> true, because 1 + 2 + 3 + 4 - 5 + 7 = 12 [5, 3]; 7 -> false, because neither 5 + 3 != 7 or 5 - 3 != 7 I came up with the follo...

 
11:16 AM
I'm voting to close this question as off-topic because the code is working and you're asking how to speed it up. Such question should be asked here: codereview.stackexchange.comekad 8 secs ago
We have the Code Review forum for this type of questions. 🙂 — The Infected Drake 11 secs ago
 
0
Q: Longest substring with 2 unique characters in a given string at linear time - Java

JohnThis is my java implementation based on the solution of Aasmund Eldhuset here. Please give your opinion on my code (correctness, efficiency and coding conventions): public static String longest2Str(String s){ int len; int i = 1; int subStart = 0; int nextGroupStart =...

0
Q: How to make my text editor work?

Lynx258Can anyone please help me? I'm trying to write a simple text editor without using malloc, free and atoi, because it's my midterm project for college. I have 2 input files, one with the default text and one with commands, and 1 output file with edited text. Lines in each file should be read, edit...

 
possible answer invalidation by Miloš Ljumović on question by Miloš Ljumović: codereview.stackexchange.com/posts/205009/revisions
 
11:32 AM
@Duga rolled back
 
11:55 AM
0
Q: export button is overlapping with submit button

manish thakurI am calling ajax to get data from my java code in json format and showing that data into html table. What I am doing is, In my HTML UI I have a form which have some inputs field there and a submit button. After clicking on submit button, I am calling ajax and hiding my form and showing the HTML...

 
 
1 hour later…
12:57 PM
0
Q: FizzBuzz with Lambda Expressions in Java

Koray TugayI wanted to create a FizzBuzz in Java that is supposed to be open for extension. So the initial problem is the good old, if divisible by 3 print fizz, if divisible by 5 print buzz, if divisible by both print fizzbuzz, otherwise print the number itself. But I want to be able to change the numbe...

 
1:09 PM
If the code works correctly but the only problem is performance, you could post the full code on codereview.stackexchange.com You should get a better feedback there. — Georgy 31 secs ago
I have a feeling that the Code Review site would be a better fit. — simbabque 8 secs ago
 
0
Q: Chess board Queen Attacking Position

vikrantKindly review this code and suggest improvements, implemented in scala. Problem - Chess board with only one queen piece in it. provided you have pos of queen with you mark all the position where queen can move with X. Code import scala.collection.mutable._ object ChessQueenAttack { val boa...

 
@Donald.McLean Put in an offer on a house, owners countered, I accepted the counter.
 
1:28 PM
-1
Q: Guess the Song name

dominikSo my task is to: • Allows a player to enter their details, which are then authenticated to ensure that they are an authorised player. • Stores a list of song names and artists in an external file. • Selects a song from the file, displaying the artist and the first letter of each word of t...

 
@202_accepted Isn't that fun.
 
No...lol
 
Short of going on a galaxy spanning adventure with danger and wonders at every turn, buying a house is the wildest ride there is.
 
1:43 PM
1
Q: N Queen Problem C++

Sam DanFollowing code is solving n queen problem with c++ using backtracking. I saw other people solution they are very short like 20 to 30 lines. Is there way improve following code? #include <iostream> #include <vector> bool put_in(std::vector<std::vector<int>> &Board, std::vector<std::vector<int>> &...

0
Q: Progress Indicator Makes PI Calculation too Slow

Adrian J GI wrote code to calculate PI to a user specified number of decimal places. It works fine. I wanted to add a progress indication so that the user doesn't have to stare at a flashing cursor for hours on end with no indication of progress. I got something working but it makes the code much, much ...

 
@Donald.McLean I can agree with that.
 
2:14 PM
-1
Q: Decode this or I would like some one to translate this or explain to me what it says

Boy210xmlns="urn:schemas-upnp-org:service-1-0">inurn:samsung.com:device:FileTransferServer:1 [Phone] Galaxy S9 Samsung Electronics http://www.samsung.com file transfer file transfer device 1.0 http://www.samsung.com 200807140950 uuid:c992a9ba-4702-4389-849e-30607b8a3188p2pmac=ce:c0:79:8e:61:b0; urn:sam...

 
If your code currently works as you expect it to work, and all you are asking is how to refactor it into a better solution, then this question is more appropriate for codereview.stackexchange.com . StackOverflow is targeted at coding problems, not refactoring working code. — Taplar 40 secs ago
 
2:51 PM
If your code works, can I suggest you head over to Code Review, there are a lot of things stylistically wrong with this code, that it would help your learning to have pointed out sooner rather than later. — Andy Turner 12 secs ago
 
3:01 PM
0
Q: Sieve Prime Generator CPP SPOJ

GnaneshI did implement Sieve prime generator. The code is pretty fast and consumes less memory. https://www.spoj.com/problems/PRIME1/ But I get "Wrong Answer" when I submit the solution. People online seem to just make the set the max to 32000 and run the solution. I don't exactly get where am I actual...

 
3:16 PM
0
Q: How can I write this jQuery code different and more simple?

MxkertMy HTML: <div class="text-left pb-5"> <h6>Aantal</h6> <input type="text" class="calc" id="aantal" name="aantal" value="100" style="padding-left: 5px"> </div> <div class="text-left pb-5"> <h6>Kleur</h6> <input type="text" class="calc" id="kleur" name="...

 
Monking
 
3:32 PM
0
Q: Minimal regex engine

User319A few months back, I posted a state machine for review. Thanks to the feedback, I was able to greatly simplify the implementation. I am posting the revised version, together with the Regex class which calls it. I think I'm mainly looking for feedback on structure. The relationship between my Nod...

0
Q: Python: Parallelization of GLCM feature computation

SamuelI have many images and want to compute the GLCM properties for every image. Below my code that runs many hours to complete the task: import numpy as np from skimage.feature import greycomatrix, greycoprops ANGLES = [0., np.pi/4., np.pi/2., 3.*np.pi/4.] DISTANCES = [1,2] properties = ["correlati...

 
3:47 PM
-1
Q: lca code in python

SureshI have searched for efficient code to find LCA recursively but did not find it, so I have tried my self. Please some one review this code for finding LCA in python class Node: def __init__(self, value): self.value = value; self.left = None self.right = None def comm...

 
4:15 PM
Stackoverflow isn't the right site for that I'm afraid. You can try this site instead. — Nicholas K 13 secs ago
Please check "Which site?" for general issues and "Code Review or not?"Prune 48 secs ago
 
4:35 PM
0
Q: Increase the speed of pyautogui

SmartManojCurrently I have a python script which have pyautogui module with Autohotkey Script The program starts very slow for the first time to import the module. How to increase the speed of a Python program? Creating a module will have no effect. Will converting to exe improve the speed? from pyautog...

 
4:55 PM
@mabalenk Those questions are more appropriate for a code review. For now, ask yourself why use type int for an array size versus long, unsigned, char, etc. vs size_t? — chux 15 secs ago
 
5:06 PM
0
Q: PHP extension that provides an arbitrary precision decimal floating point type

rtheunissenI recently finished the first version of a new PHP extension (written in C), and I would love to get some feedback on the code. If this is not the right forum or my request does not follow the rules here, I completely understand. I would like to get feedback on performance and best practices in ...

 
@CaptainObvious Someone likes mini-golf.
@CaptainObvious Sure, quote the rule, thinking that the rule doesn't apply to you.
 
@202_accepted Congrats!
 
@Hosch250 Thanks man, this process is seriously a PITA.
 
@CaptainObvious Possibly off-topic due to known bugs.
 
5:21 PM
0
Q: is_array and null coalesce

hjollyif (is_array($input['job'])) { $job = $input['job'] ?? null; } else { $job = $input['job']; } I found this code today, as far as I can tell, it will assign $input['job'] to $job unless it is an empty array. Is there any other possible outcomes?

 
These two programs don't work the same, and there's too much that can be going on behind the scenes (particularly in C++ code). For one, your perl code uses a hash for receivedMessage so it only needs a lookup for $qid, while in C++ you search through` receivedMessage each time. Right there you have _O(N) difference and this is probably happening for (nearly) every line. I agree that you probably want your C++ code reviewed. Note that you'd have to supply other classes involved, as there may be many ctor's going in and out, etc. — zdim 8 secs ago
 
5:37 PM
0
Q: java calculations

vonbI'm trying to make a program to run calculations. This is just part of it. I don't understand why it isn't working. It compiles fine but I'm having issues getting the expected outcomes running it...I'm new to java. String operation; System.out.print("Enter equation as number operator nu...

 
5:48 PM
@Mast There should probably be an exemption to the code-block check for .
 
Hi Martin, totally unrelated. Would you mind taking a look hereHoney 27 secs ago
Hi Alexander, totally unrelated. Would you mind taking a look here? — Honey 52 secs ago
Mabe you should ask this question in Code Review Stack Exchange. — Amessihel 50 secs ago
 
6:08 PM
0
Q: Design a system for creating a coffeeshop menu

HoneyDuring an interview I was asked to design the menu for a coffee shop employee so that the employee would go and add different items to the menu. This is the design that I came up with. I just want to know what other things I'm expected to think of. Are there any problems/complexities that I hav...

 
@CaptainObvious That's going to be another long, long review.
Hm. Maybe not that long.
 
6:23 PM
0
Q: .Net Core Unit Testing with Xunit & Moq

karanI have a web api for which I need to write my unit test case. This is the first time I am writing test case so please bear if some things are trivial. A little info about the data. All the data is stored in our dynamo db table (about 10 col). In my UI I have 2 pages, one for saving data and one ...

 
6:33 PM
@200_success Yes, and all other graphic languages. We went on about that for quite some time.
I almost posted a meta about it, but I was having a little trouble with phrasing it in a clear and constructive manner.
 
-1
Q: Java code finding the largest integer using a for loop

Gavin ReedI can't seem to find out how to finish this. I need basic coding not any shortcuts or anything like that. It just needs to be solved. I've been searching all around and can't seem to find how to do it. Please help. Thanks, Gavin. import java.util.Random; import java.util.Scanner; public class Te...

0
Q: NodeJS: unique GET multi-table function and layout table

Samuel LeitonIm bored to generate functions for different tables, then I started to summarize everything to 1 function, but I am a junior programmer, I hope to find opinions about my code. This is a short example, with 1 tables, but I work with 123 tables and so far it works well, but I hope to get your opin...

0
Q: php empty() and null coalesce operator

hjollyI discovered this today. I would like to simplify it. foreach (['name', 'description'] as $field) { if (!empty($input[$field])) { continue; } $input[$field] = $task_data[$field]; } Here is the code that I would like to replace it with: $input['name...

 
6:54 PM
0
Q: Text-based Connect 4 Game in C#

AjeshI have made Connect 4 in C#. If you have never played Connect 4, it is like Tic Tac Toe, except the pieces fall to the bottom of the grid, and the grid is usually 6x7. This is the first big project I have made in C#, so I don't know if I wrote the program well. How can I improve my code? using ...

 
Requests for "tips or suggestions" suggest you want codereview.stackexchange.comjdv 43 secs ago
@jdv As this is currently pseudo code, it's off-topic on Code Review. Only working code is on-topic there. — Zeta 44 secs ago
 
7:13 PM
Can I get a sanity check on my last review? It's been a while, and it was a long day at work; I feel like I'm blabbing a little bit.
 
possible answer invalidation by Zeta on question by Sam Dan: codereview.stackexchange.com/posts/206325/revisions
 
@Zeta section "the implicit board" replace "decrease" with "increase"
LGTM otherwise
 
Thanks for the review review!
 
also it got to be pretty long in the end, didn't it?
 
-1
Q: Convert template c++ to C#

Cesar Augustoi try convert this teamplate in c++ to c# in use in my project C# but i dont have sure if its correct translate. template<typename T> struct pair { DWORD64 first; T* second; }; template<typename T> struct hash_node { pair<T> mValue; hash_node<T>* mpNext; }; template<typename T>

 
7:26 PM
@Vogel612 Apparently, yeah. If it wasn't for the Pokedex review, it would probably be my longest C++ review so far.
 
wow
 
I would help but I can't read
 
@202_accepted Ah, you switched to Perl?
 
No I just have a headache lol
 
Monking!
 
8:28 PM
TTGTB. Gniknom!
 
8:43 PM
0
Q: Speeding up filtering of DataGridView

JMichaelAs a part of my job I have to create/update scripts to generate reports for validating a tool my company uses for reporting measures that are part of an industry standard we adhere to. Some of those measures are updated each year by the standard's governing body, as well as new ones being added, ...

 
9:14 PM
-1
Q: Hangman in python 3, following this layout:

Devin HahnUsing this algorithm, i was asked to create a hangman game. Im currently working two jobs and havent had enough time to complete it. If anyone can assist in walking me through how its done, or even just do it, it would be greatly appreciated. Base code: def draw_hang_loser(): print(" _______...

0
Q: Fine tuning collision detection

user183152I have a pong-like game, where the paddle position is tied to mouse pointer position. If I move the mouse slowly, the ball bounces as expected. If I move the mouse quickly, however, the ball will likely pass through the paddle. Is there a known way to get better collision detection? I am usin...

0
Q: Lenght of the Longest distinct subarray

Daniel KamandI am trying to know what's wrong with my program that should find the longest distinct subarray, but I didn't find any clue Can someone help please? this is the program: #include <iostream> using namespace std; int main() { int A[250]; int B[250]; int sentinel = -999; int x; int i = 0; int n = ...

 
9:30 PM
0
Q: How to confirm that its a valid melt?

Yousef Samir Layyous Gedeonim trying to create a rummy game in python. I was able to develop the virtual dealer but I was not able to create an algorith to verify if the player is providing valid melt. In order to be a valid melt needs to be of the same suit and in increasing order, at least 3 cards per melt. import rand...

 
9:44 PM
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comJosefZ 6 secs ago
 
wow... nuked three out of the four latest questions ..
this is....
 
9:59 PM
@StringOfArrays: I'd suggest to post this to codereview.stackexchange.comAndriy Tylychko just now
Note: CodeReview only deals in code that works but could work better. It's a great place to go AFTER the bugs have been fixed up, but read through the [How to Ask]9https://codereview.stackexchange.com/help/asking) help pages first. — user4581301 9 secs ago
 

« first day (2001 days earlier)      last day (2015 days later) »