« first day (2693 days earlier)      last day (1321 days later) » 

12:00 AM
RELOAD! There are 6991 unanswered questions (89.7697% answered)
 
0
Q: Priority Queue in Python

SaurabhI've implemented a priority queue without using the built-in heap or PriorityQueue functionalities. The implementation is like a queue in addition to the below: Element with the highest priority is at the front of the queue If an element is not in the queue, it as added after the element contain...

0
Q: ARP-Cache Poisoner to Set Up MitM and DOS attacks

CarcigenicateThis code "poisons" the ARP cache of victim computers. Given the IP addresses of hosts A and B, it will trick A into thinking that I'm B, and B into thinking that I'm A. This means that all the traffic that they send to the other will actually be sent to me, and I can either consume that data (DO...

 
12:34 AM
0
Q: Vim plugin Nudge Lines

S0AndS0I've published a Vim plugin that nudges visually selected lines up or down, which for the most part seems to function as designed. However, I believe there are likely ways that this plugin could be improved. Questions How do I register a movement that takes an optional amount? In other words ...

 
1:13 AM
if you want to get review of your code, you can post to codereview.stackexchange.comMuhammad Dyas Yaskur 46 secs ago
 
 
3 hours later…
3:53 AM
0
Q: rewrite if statement

ameliHow can I rewrite this if statement of which there are a lot. Or how, in principle, it can be rewritten to look good? This app is calculator. How it can be redone with a switch maybe. Or breaking it somehow into small functions function pressNumber(e) { let digit; if (typeof e === 'string'...

 
4:37 AM
Monking
 
0
Q: Laravel Create Invoice

B GI need your suggestions on how to make an invoice system in laravel. So far I created a temporary answer for it but Im not sure if my method of doing it is correct. Here is my invoice_sales migration Schema::create('invoice_sales', function (Blueprint $table) { $table->increments('id...

 
5:03 AM
Sorry, SO is for specific problems. Please ask on Code Review instead. — wjandrea 18 secs ago
 
5:40 AM
@TrentonMcKinney Done. I posted this on code review. (codereview.stackexchange.com/questions/249474/…) — Tommy 27 secs ago
 
5:57 AM
0
Q: Priority based categorization using pandas/python

TommyI'm new to Code Review. I asked the below question on https://stackoverflow.com/ and one of the senior members suggested that this question is more geared towards code review platform rather than stack overflow. Hence, I'm here. My question goes like this. You may find my original question here I...

 
@Peilonrayz I'm honestly not sure lately. It's possible the specific problem is diluted by other reviewing problems lately, but I haven't been keeping as close an eye on it.
 
6:21 AM
1
Q: Semi-generic non-linked list using structs: Safety concerns

NXP5ZBased on my googling around generic lists in C I stumbled upon tagged unions. What I wanted to create was a data structure that can hold int, float, double and char, all in one list. There is a function to add an item to which type information has to be passed. What I am unsure about: I read that...

 
6:46 AM
0
Q: Marching Square algorithm (2)

user366312The following source code is a solution to the Marching Square problem. The explanation of using random numbers in ambiguous cases can be found here. import numpy as np from PIL import Image, ImageDraw im = Image.new('RGB', (500, 300), (128, 128, 128)) draw = ImageDraw.Draw(im) class Square(): ...

 
7:15 AM
possible answer invalidation by Gr3g-prog on question by Gr3g-prog: codereview.stackexchange.com/posts/248888/revisions
 
7:36 AM
0
Q: When the button is clicked it returns a message or displays it. Spring Boot

Leo NakamuraI'm fairly new spring boot and really trying to learn as much as possible. Currently, I'm creating simple vending machine web application. I was able to display the button but don't know how to write out a code when the button is clicked it returns a message or popup window that says "You purchas...

 
8:17 AM
@AJR during code review with developers. You mean I should switch to release and enable debug symbols to be able to set breakpoints.Right? — Michael IV 35 secs ago
 
8:38 AM
Also, having struct members like const double* const inputs is major code smell. It would seem that this program overall could do with some serious code review. — Lundin 36 secs ago
 
9:10 AM
This question really belongs on Code Reviewroganjosh 11 secs ago
This might be a better fit for codereview.stackexchange.com - code review questions are not on topic on SO. — Tomalak 57 secs ago
 
9:26 AM
Note that in order for this to be answerable, you should precisely define what improvement you are looking for. Just "how would you improve this?" is very broad and seems more appropriate for CodeReview – be sure to check their question guide first, though. If you are looking for performance improvements, please clearly define what you consider sufficient – likely not a few ms here or there, but some (how many?) orders of magnitude. — MisterMiyagi 9 secs ago
Alright, so the best way to deal with this is to keep the original code and just suppress it with remarks stating that this will be covered by code review? I don't think n will be 0 or larger than 32 in my case — Alaiko 36 secs ago
 
9:56 AM
In the future please link to the help center and use wording that shows the post may be off-topic when recommending Code Review. Take, "This may be on-topic on Code Review. Please check if it is on-topic and how to post a good question before posting there." — Peilonrayz 29 secs ago
 
@Mast Ah ok, thanks. I've not really noticed it as much lately but I'm thinking that may be a lack of seeing final votes.
@Duga Handled
 
@roganjosh In the future please link to the help center and use wording that shows the post may be off-topic when recommending Code Review. Take, "This may be on-topic on Code Review. Please check if it is on-topic and how to post a good question before posting there." — Peilonrayz 20 secs ago
 
0
Q: Whats wrong in this Power-shell command. unable to add any tags or new line here

Ankit KumarI am using Power-shell core and am forming a html content inside the Powershell. below is the code which i am running from inside. my issue is i am unable to add a new line in the title tag. Also the one after title is also not rendering for some reason. Please find below the output i am getting:...

0
Q: Converting an integer to a hexadecimal string representation in Java

coderoddeI have rolled my own Java method for converting ints to the hexadecimal Strings: import java.util.Arrays; import java.util.Random; public class Main { /** * Converts the input integer into its textual hexadecimal representation. * * @param a the integer to convert. ...

0
Q: Mancala Iterative Deepening

Edwin CarlssonThis is my iterative deepening alpha beta minimax algorithm for a two player game called Mancala, see rules The game and corresponding classes (GameState etc) are provided by another source. I provide my class which optimizes a GameState. All criticism is appreciated. package ai; import java.lan...

 
possible answer invalidation by KM Goh on question by KM Goh: codereview.stackexchange.com/posts/249427/revisions
 
@Duga Handled
 
10:30 AM
possible answer invalidation by mehio hatab on question by mehio hatab: codereview.stackexchange.com/posts/249208/revisions
 
@Duga That's some vandalism. Handled
 
10:54 AM
0
Q: Data-type implementation for multiple dynamic histograms

Khashayar BaghizadehThis is almost exercise 3.2.14. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne (since I am self-studying, I changed it a little bit): Develop a version of Histogram that uses StdDraw, so that a client can create multiple histograms. Use a test client that creat...

0
Q: Clean QuickSort implementation that sorts everything but a single element

hazThis is my first time writing C++. I am trying to implement QuickSort referencing the MIT open course ware slides (Slides 4 and 17 specifically). However, there is a bug: input: 6 10 13 5 8 3 2 11 output: 2 5 3 6 8 11 10 13 I'm not sure why the 5 is out of place. My code seems to mirror the sl...

 
11:36 AM
Thanks wjandrea and Peilonrayz. I didn't know Code Review existed and will use it for questions like these going forward. — Hellyeah 1 min ago
This looks like more of a codereview than a StackOverflow question. We can't objectively answer either of the questions in your last paragraph. — user4815162342 38 secs ago
 
0
Q: String tuple serializer

Piotr Aleksander ChmielowskiPlease review my class which is responsible of serialization and deserialization of the StringTuple data class. data class StringTuple( val first: String, val second: String ) The idea is to serialize StringTuple to ByteArray in the following format: | first string size | first string se...

 
12:09 PM
0
Q: Multiple list comparison Python

HellyeahI have some code that has three lists, and it then checks the index of the second list against the index of the first as long as the first list has six elements. The code will then append to the third list if part of a string matches in the index of the first list. If the string does not match, i...

 
Apologies, I didn't realise there was a code review stack exchange. I will look into providing backpressure because I am experiencing a memory leak in the code that this is written for. You're entirely right about asyncio.wait, I've definitely implemented that wrong. — Ryan Codrai just now
 
12:54 PM
"For resilience" -- Yes, unfortunately the Microsoft HttpClient, FtpWebRequest, and other classes like this have some serious problems. I usually don't like third party libraries, but this is one case where I think you have very little to lose by looking at other options, I'm pretty sure these bugs never got fixed. — jrh 50 secs ago
 
1:27 PM
On the face of it "improve my code" questions should probably go to codereview.stackexchange.com - it's not clear if this is a review request or there's something specific wrong/not working . — freedomn-m 59 secs ago
@freedomn-m "Also, totalCorrect is not adding up properly." It is disqualified for Code Review. — Mast 1 min ago
 
1:48 PM
1
Q: Export Hero information and list of his items to excel sheet/csv

SuuleI created simple export tool for my project. My requirments was to create one csv file for details of my hero which contains name, level, gold etc. And second file for list of items. Both of files contains static header and generated Data. First, let me share my model classes: public class Hero {...

0
Q: How to insert dynamic form in Laravel?

B GI need your help how can I pass the primary key value to the foreign key column in Laravel. invoice_product migration Schema::create('invoice_products', function (Blueprint $table) { $table->id(); $table->integer('invoice_sale_id')->unsigned(); $table->string('...

 
@CaptainObvious broken
 
possible answer invalidation by anki on question by anki: codereview.stackexchange.com/posts/249344/revisions
 
@Duga Looks fine, I'm not seeing anywhere @pacmaninbw commented on the comments
 
2:03 PM
@CaptainObvious @Peilonrayz worse it may be a duplicate.
 
Of this, I don't see an error message and I've not looked through the code. But possibly. codereview.stackexchange.com/q/249473
IIRC they came from SO so...
 
@Duga It is fine, although @anki should know better.
 
Thanks for the double check ^^
 
:)
Numpy
 
ayy
 
2:06 PM
LOL
 
Tell your code reviewer that you will use an enum instead of an int and all will be happy. — Olivier Rogier just now
 
2:37 PM
0
Q: Storing localStorage data as part of rxjs reducer?

noamygI use ngrx in my Angular app to state management. At a certain time I was asked to save some variable to local storage and retrieve it with first load. That made sense to make it as part of the effects, instead of managing one logic for localStorage and another logic for the selectors. So this is...

 
@CaptainObvious @Peilonrayz Did you VTC the original yet?
1 more VTC.
 
@Mast No, I'll read it now but it looks like a wall D:
@Mast I don't think it's MRC or broken. I'm the odd one out closing for UWYA. :(
 
3:09 PM
Need to go off-line so I can debug pointers without upsetting Norton AV.
 
@pacmaninbw Have you tried unplugging Norton AV instead?
 
Monking
 
@Mast closed
 
Gracias.
 
3:21 PM
@pacmaninbw is that now synonymous with no problem?
 
@SᴀᴍOnᴇᴌᴀ Same abbreviation.
 
I knew that... just didn't know we were making the jump
 
Inside jokes are only fun if there's no coordinated effort behind them. They come naturally.
 
4:05 PM
Monking
 
4:17 PM
@kvantour The problem is to replace EVERY character in the substring. BTW, I had asked the same question here, added a new method 4. — hey0god 29 secs ago
 
4:31 PM
Don't do this - I would absolutely reject a code review if someone randomly rewrote variable assignments into an array this way for no reason. You should write clean code that conveys its intention - using an array when one is not required is confusing — Milney 30 secs ago
 
4:42 PM
0
Q: Concurrent Web Crawler

LudisposedDescription As an exercise of learning go concurrency patterns, I decided too build a concurrent web crawler. I made use of the argparse module I put up for review a while back. I'm looking for feedback on my concurrency pattern, but any and all aspect of the code is open to be flamed :) Code pac...

 
5:01 PM
As it stands now, your question is too broad. My suggestion is to, first of all, ask a language-agnostic question on the algorithm here or on cs.stackexchange.com and only after that ask specific questions on implementation. When you'll have a working code you could also ask for a code review on codereview.stackexchange.com. — Georgy 14 secs ago
 
5:56 PM
0
Q: Regex to match each line in a file, with windows and/or linux line break included, even for missing line break at EOF

Enrico Maria De AngelisMy requirement is to match each line of a text file, including the line terminator of each, at most excluding the terminator of the last line, to take into account the crippled, non POSIX-compiant files generated on Windows; each line terminator can be either \n or \r\n. As a consequence, no char...

 
6:46 PM
0
Q: Type-independent vector in C

PhilippHochmannI wanted to create a vector that can be used for different types, as generics do not exist in C. I came up with an implementation that maintains a buffer on the heap and reallocs itself when the buffer size is exceeded. The heart of the implementation are the macros that can be used to retrieve a...

 
7:04 PM
@Mast I go off line so I can safely disable Norton.
@SᴀᴍOnᴇᴌᴀ Only for today. It will get too old too fast otherwise.
 
alrighty - I would say I would not remember that but I presume I have already committed it to memory
this discussion is making it get encoded in my brain even more
its a vicious cycle
anyway, time for lunch - I will be back in an hour
 
Hi Dolly, unfortunately coding style questions are off-topic on Stack Overflow as they are opinion-based. Check out the help center for more information on what questions are a good fit for the site. Code Review or Software Engineering may be a more appropriate site depending on the detail you can provide (e.g. full code for design/implementation improvement recommendations, or general design/paradigm recommendations, respectively). — TylerH 49 secs ago
@mkrieger1 Help-page for commenting, seems to be codereview.se in brackets: Code ReviewHampus Larsson 31 secs ago
 
7:35 PM
i have to admit only now I looked closely. It seems that you also got confused by flipped x/y. In your graph pthread consitenlty takes less time for same input size than the other implementations. 1) your data is not particularly noisy. Any measurement is influenced by noise and you can reduce noise by repeating the measurement. 2) Assuming your code is correct and you can provide a minimal reproducible example, maybe you could try at codereview.stackexchange.comidclev 463035818 57 secs ago
 
1
Q: Creating a C++ style class for storing a data on 2D grid on GPU memory

spiridon_the_sun_rotatorI would like to create a class, which is intended to represent a field of values on a 2D grid. So, I would like to access the elements with a double square bracket A[i][j], and inside the __global__ or __device__ function access the dimensions of the field - nx_, ny_, because I do not want to pas...

 
7:56 PM
@Chris every time I post a character arithmetic answer I get one of these comments. I agree with you entirely and this wouldn't get past a code review with production code. That being said, I've tried to show OP their error without getting lost in the weeds (and their variable name is asciiValue, so we're probably fine here). I could add a part on the "right" way to do this, but at that point I'd just be giving a lesser version of the already great answers below. — scohe001 29 secs ago
 
0
Q: Pure Javascript to create forms and validation check Project

LV98Goal I have developed a random check that I have thought of. I have used purely JavaScript to get used to the language and learn it. I have also used JavaScript to create elements, classes, id etc... and at the end, I have a simple validation check to check if all inputs have been filled. I would...

-1
Q: Which coding style pattern is recommended?

Dolly SinghI know this question may sound weird but I couldn't find the correct approach. So my question is: In a big project we have various different smaller modules/components. Let us suppose "minimap" component. There are two ways we can write this. First: Where we have one index file and we are exporti...

 
8:39 PM
from my experience, it's rely on code review. We tried to determine if there were memory leaks by using some chrome tool to look at active memory usage, but it wasn't anything fancy to track down what causing a leak. I forget what the tool was. — rhavelka 59 secs ago
 
 
1 hour later…
9:39 PM
0
Q: How can I convert this onClick event into a function?

John BeasleyI would like to convert this onClick event into a function. $('#example1').on('click', 'tr > .salesareaCell', function(e){ e.preventDefault(); const dataTable = $('#example1').DataTable(); const rowData = dataTable.row($(this).closest('tr')).data(); let idatt = rowData['UID']; let ...

 
 
1 hour later…
10:54 PM
0
Q: Python assignment

scarletGiven the weight of a letter in grams, determine the cost of the postage: •up to 30g: 60¢ •up to 50g: 90¢ •up to 100g: $1.15 •30¢ for each 50g (or less) after that. e.g. if the weight is 225 grams, you need to pay $2.05 ($1.15 + 30c + 30c + 30c) so far I have this but I can't figure out the last ...

 
11:10 PM
possible answer invalidation by PhilippHochmann on question by PhilippHochmann: codereview.stackexchange.com/posts/249508/revisions
 
@Duga OP just added example usage of code, which appears to be in response to request by @pacmaninbw
Do you have code for unit testing this that you can add to the question? That would provide a better explanation of use then the brief snippet you provided at the top, — pacmaninbw 1 hour ago
I've made an edit extending my example :) — PhilippHochmann 5 mins ago
 
That is a design / code review issue -- not for Stack Overflow. — Prune 28 secs ago
 
11:35 PM
possible answer invalidation by samuelbrody1249 on question by samuelbrody1249: codereview.stackexchange.com/posts/249419/revisions
 
@SᴀᴍOnᴇᴌᴀ @vnp rolled back the edit because it invalidated his answer.
 
I don't know. First of all, it depends on exactly where you're uncertain. Your approach is certainly valid, as you took it from a proven algorithm. I would think that your implementation is what you're really questioning, and that requires testing. For "where to post", you should go to the Stack Exchange main pages and review the existing groups. Code Review only covers improvement of working code. — Prune 32 secs ago
 

« first day (2693 days earlier)      last day (1321 days later) »