« first day (2126 days earlier)      last day (2187 days later) » 

00:00
RELOAD! There are 5876 unanswered questions (89.8934% answered)
00:10
Just saying hi
You haven't told us what the problem is. If there is a problem, post a Minimal, Complete, and Verifiable example (Read the link please, it's not just posting the code). If there is not a problem, it's working code you want critiqued, then this belongs on CodeReview. — ShadowRanger 25 secs ago
0
Q: Return a character in a string of text based on its numerical order and display the list based on the algorithm?

Travis WellsIgnoring that the algorithm is probably false. The character is # d * a da = L(x)/x! + d^d+1x Here, a represents a string and d denotes hamming distance. This hamming distance can be explained in this example. pumpkin pluckin You can see that the hamming distance is contained within 7...

00:31
@BenoîtPilatte Ahoy!
00:46
Monking
01:30
@DerKommissar Always look at the arrows. In Dutch, we got a trick for it. PNP => Pijl naar plaat (arrow towards plate), NPN => Niet Pijl Naar plaat (not arrow towards plate).
01:45
This question should be on codereview.stackexchange.com. — James Ray 56 secs ago
01:55
possible answer invalidation by dhoyt902 on question by dhoyt902: codereview.stackexchange.com/posts/214375/revisions
02:14
0
Q: Flask Database design for a social media site like Twitter

Ni Nisan NijackleThis is a mysql database that is created trhough sqlalchemy. I really don't want to rewrite all of it in sql code, but the code should be understandable if you know a tiny bit a mysql. I am designing a database design for a social media like site as a side project for learning how to handle lar...

possible answer invalidation by dhoyt902 on question by dhoyt902: codereview.stackexchange.com/posts/214375/revisions
Since D3 is the wrong tool for your project as a whole (as I describe here: codereview.stackexchange.com/a/171946/143592) I decided to delete my answer. Well, I'm not aware of any good JS library for plotting functions, but they should exist, just do a good search around. — Gerardo Furtado 9 secs ago
02:39
I rest my case for poorly executed error dialogs.
0
Q: I made a code for a game of Rock paper and scissors, how can I make it less redundant?

Minh TranI have to do a project on a game of rock, paper, and scissors, and the code I have so far is a complete code for the game, but my professor does not like it since it is too redundant. Is there anyway to shorten it or make it more simple? import random while True: bot = random.choice(["Rock",...

Maybe this could help: codereview.stackexchange.com/questions/155385/… Note that, in your case, void Bar(...) is not using universal reference — Amadeus 15 secs ago
03:08
@Phrancis Oh wow.
There's so much wrong with that, I don't know where to start.
03:48
This is highly subjective for SO sadly. Your question may be suitable for another Stack Exchange subsite devoted to code reviews. Be sure to read the relating FAQ before posting though. Good luck! — MickyD 7 secs ago
04:21
I'm voting to close this question as off-topic because requests to review nicely written working code should go to codereview.stackexchange.com — GhostCat 7 secs ago
 
2 hours later…
06:01
0
Q: is there anything that will be a problem? anything that may be more effective other than what i have

Patrick Cootsi'm currently making a text based choose your own adventure game with possible RPG elements. i'm somewhat new at programming, my father is very good ad QB64, but isn't always able to help me with my problems, i'm not asking about story help but with ways i could make my code run more efficiently....

0
Q: how to refactor bash script with many duplicates

MaKoI have a working bash script, but I have many duplicates on the "CURL" body... if ! npm test then # Tell the human about the failure, if the npm output wasn't enough echo >&2 "Testing failed" curl -X POST -H 'Content-type: application/json' --data '{"text":"Tests failed for...

Moking
06:22
@CaptainObvious Do we have a better syntax highlighter for QuickBASIC? That question suffers a lot from incorrect single-quote handling.
Nvm, I used lang-vb, seems good enough.
Read “Least Astonishment” and the Mutable Default Argument - you'll eventually run into it if your go further. BEside that: SO is no "advice giver" - we have a focus on building a Q&A and solve specific problems that are clear answerable - your questions is more of a "here is what I want" - "here is my code" - "no question asked" - "gimme advice" . This is too broad in a SO kind of sense, maybe read what questions to ask at codereview.stackexchange.com - although I am not sure its ok there. — Patrick Artner 15 secs ago
06:53
Hmm.. from what I'm seeing i don't think there's a way for you to have both. I mean the only way for you to see all the delta between fixes and reviews is for you not to rebase after reviews. But now you also don't want commits that are fixes to code reviews. If you ask me, not rebasing might be the better option (at least for your needs). Then just compromise the git blame part. Do git blame and then if theres not enough info just go to that commit hash and then view the string of fixes (commits) that preceed it. — scarletlights 38 secs ago
You could simplify code review by separate commits for check-style changes and fixes/features. — Max Belousov 17 secs ago
0
Q: How to know if today is second or forth Saturday

Rahul PatelThis is working. Is it ok? import calendar from datetime import datetime def second_fourth_saturday(year): holidays = {} for month in range(1, 13): holidays[month] = [] cal = calendar.monthcalendar(year, month) if cal[0][calendar.SATURDAY]: holidays[...

0
Q: Porting bitfields from c++ to C#

Hasan Emrah SüngüI am porting a C++ library, which uses bitfields extensively into C# code. Here is a an example of a bitfield class struct Header{ uint32_t A; uint16_t B: 1; uint16_t C: 1; uint16_t D: 1; uint16_t : 13; uint16_t E; }; When turning this class into a C# class should I keep bitfield...

08:00
Install a code review process instead. The fact you need a tool hints it's way to easy to add such bad stuff unnoticed. — StoryTeller 18 secs ago
As far as I know this is not the role of gcc and it cannot be done with it. You would have better luck with searching for some static analysis tool like cppCheck and implementing custom rule so you can run it before compilation and see all warnings. Good practice would be also to get code review process — wdudzik 37 secs ago
08:45
0
Q: Optimistic validation on tab change

AlexeiI have a rather large UI for editing a user within a Angular application. It is split in multiple tabs and in order to reduce complexity the user cannot change the tab unless there is no validation failure on that particular tab. However, some validation is asynchronously performed on server sid...

0
Q: Optimizing the code of an Angular service with a switch case statement

Codehan25I have a simple Angular Service that pre-configures translations for the ngx-translate library based on the currently logged in business case. I'm not sure if my switch case statement within the if/else block can be written more effective / performant. I currently have no other ideas to improve ...

 
1 hour later…
09:54
0
Q: MySQL: Insert data from one table to another (Million + rows)

Devanshu MisraI have a procedure that collects data from one table and inserts it into another table with same columns, but after correlating with a few other tables. Since the existing table(from which data will be transferred) has more than a million records, the insertion into the other table(into which the...

0
Q: What are the best practices for validating a form using React?

anupI am trying to validate multiple input fields using React. I am using a simple if-else block for each input field but I would like to optimize my code and make it better. I feel there can be a better way to validate multiple input fields. This is the code I am using for validation : - validate...

10:12
0
Q: Why does python add numbers like this?

IsaacProbably a really basic question, and I'm not sure if it's just python. But.... platypus=4 platypus=platypus+5 print(platypus) 9 That part is odd, but understandable. grape=3 grape=9 grape=25 grape=grape+grape+grape print(grape) 75 How is it adding numbers together to get 75?

0
Q: Fetch index of n highest number

Hacker_SamI am using the below logic to get the index of n highest number in cpp. Just wanted to know how to get the complexity and if their is any better approach for the same. C++ Sample: const int noHighestElement = 3 int A[7] = {0, 2, 3, 1,7,1,8}; const int N = sizeof(A) / sizeof(int); for(int i...

10:39
Monking
Monking
10:51
Sorry I might be kinda stress-testing Duga right now and she might be up against the message timeout limits
I deleted 187 tags and their accompanying github releases...
11:05
0
Q: speculum - A simple, straightforward Arch Linux mirror list optimizer

Richard NeumannAfter having had a look at reflector's code base I decided to write a new, more lightweight mirror list optimizer from scratch. The script queries the Arch Linux mirror list JSON endpoint and performs filtering, sorting and limiting of mirrors according to the user's input. Any feedback is welc...

11:41
0
Q: Animal program inheritance

Harry(By LB) I have this CSV file... Type,Noun,ScientificNoun,MinSizeCm,MaxSizeCm,minWeightGrams,maxWeightGrams,Colour,locomotion,Country,NaturalHabitat,Shape of the beak,Colours of the feathers,min length of wingspan cm,max lenght of Wingspan cm Bird,Buzzard,Buteo buteo,51,57,550,1300,Brown,fly,Unit...

Ok my mistake but I dont often use code review — Arefe 29 mins ago
11:59
0
Q: Find all strings matching a giving regex pattern in files in a directory (including all subdirectories)

Tobi Alafin#! python3 # `regexSearch`: Finds all lines matching a given regex in each file in a given folder. # Usage: # The directory to search and regex to be searched for are provided as a command line arguments. # The 1st and 2nd command line arguments are the directory and regex pattern...

12:34
0
Q: Learning C++ - how to write simpler my 1st (game) code with fewer lines

mo2I am learning C++ and I need help to review my first code and see how I could improve it in any way. Any suggestions are welcome. It was tested and it is free of bug. The code is a game called TicTacToe and do the following: 1. Create a 4x4 game board 2. Prompt the first user (the 'x' user) to...

12:52
0
Q: Saving PDF file slow after 10,000 pages in iTextSharp

JeevanI am trying to build a application that creates PDF and saves in local file. I am using this through iTextSharp in C#. I need to save at least 1 lac (100,000) PDF files. After 10,000 files the saving gets slow. The first 10k gets saved in 2 mins, rest of the files take almost 5 hours. I believe...

This could maybe help u : codereview.stackexchange.com/a/67621 (if it helps, please allow me to post it as an answer) — Nenri 1 hour ago
If your code is already working (albeit slow as you mentioned), then codereview would be a better fit for your question than stackoverflow — Icepickle 33 mins ago
13:45
0
Q: Python script that alerts me when specific file gets created

Freya WI wrote a small script that opens a window using PyQt when a specific file gets created. This is to let me know when another program (that I have no control over) has finished calculating something. I know at the end of the calculation a specific file is created. Here is the code: from PyQt5.Q...

possible answer invalidation by O.Mukhtar on question by O.Mukhtar: codereview.stackexchange.com/posts/214421/revisions
14:21
1
Q: Display CommandLine Hangman

Martin Frankyeah, the CLI is working so far, now one application for it is Hangman. one of my minor issues is how to properly print out the hangman: could you please give me hints on how to make the code less hardcoded? I know this class has nothing to do with OO and is not CleanCode but i don't know how ...

14:31
Greetings, Programs.
This question would be better asked on the CodeReview site. — OldCurmudgeon 12 secs ago
0
Q: Many system questions, use static text or upload a file?

galloleonardoI'm making a system to run in the terminal. The same is responsible for asking some questions to the user. The system has several questions, and for each category I created a class containing a dictionary. In this dictionary I have the key that is the question and the value that is the answer (fi...

@DerKommissar Did you see my email yesterday?
@Donald.McLean Yes, I haven't yet had a chance to review it, as I've been swamped with this other project, I'm going to try to get to it tomorrow, if that's alright.
14:45
@DerKommissar Of course - you're a volunteer.
14:56
If your code works and you seek improvements or constructive criticism, Code Review would be a better fit to ask. — Amy 54 secs ago
-1
Q: Common "back" on rails app

RAJKUMAR PALANISAMYThere is any possible to use common back button on rails app, it must visible to all pages. I have tried at application.html.erb like link_to_function "Back", "history.back()" <%= link_to 'Back', :back %> a href="javascript:history.back()" But when I delete post and click back button it Shows ...

15:14
0
Q: A basic calculator in C that uses a loop

O.MukhtarI have created a program that forms a basic calculator in C which includes the basic operations like addition, subtraction, multiplication and division. But in this case I decided to use a Do-While loop. It is working. I would appreciate to be pointed out some mistakes and opinions to make the c...

15:32
0
Q: C++ Pixel/Array manipulation libs

VuwoxI was tired to always perform pixel manipulation one by one, so I started to create my own templated header to perform computation over pixel (RGB, or RGBA), but I also make it for ND for some cases. There are few comments in the code for some features that Im not sure yet. I also develop it a...

16:20
possible answer invalidation by Rahul Patel on question by Rahul Patel: codereview.stackexchange.com/posts/214443/revisions
This question belongs on codereview.stackexchange.com. — jaco0646 28 secs ago
0
Q: Dice rolling Python

EstherI take computer science and I am totally new to the class. My teacher has taken a very hands-off approach and I have no textbook so I was wondering if anyone could help with my assignment? The assignment is to take a user input of however many times they want to roll a dice, print the numbers rol...

@SᴀᴍOnᴇᴌᴀ Why wouldn't it be?
possible answer invalidation by Vuwox on question by Vuwox: codereview.stackexchange.com/posts/214478/revisions
16:43
0
Q: Project Euler problem #3

tazajaMy code works but would take 160 days to run lol. prime factors - ex.3 primes = [] for possibleprime in range (2,100000,1): isPrime = True for num in range(2, possibleprime, 1): if possibleprime % num == 0: isPrime = False if isPrime: primes.append(possibleprime...

0
Q: @interface vs enum with property

Levente OrbánI have to fix some bug in a legacy Java/Spring code, I found a file with lots of static variable declared like this public @interface DataKeys { public static final String DATABASE_URL = "Database.Url"; ... I never seen enum usage like this before, so someone can help to understand wh...

1
Q: Factory that returns multiple implementations of the same interface

kontainedA few developers and I are attempting to refactor a class that has grown too large. Currently 'validations' are implemented as functions of a class. They all have the same method signature. One idea we had is to create a class for each validation, with a factory to give us a list of all validat...

17:02
0
Q: Random String Generation module in Python

Joca PintoThe module is for facilitating random string generation. The example I use to explain it is the following: Instead of writing #vars age = random.randint(18, 20) #categories names = ('Mark', 'Sally') adjs = ('wacky', 'cool') adjs_probability_map = (0.1, 0.99) hellos = ('Hi!', 'Hey!', 'Good morn...

17:20
0
Q: Lambda based matrix

DBJDBJI am calling matrix implemented with a lambda "lambda matrix". The code: namespace dbj::mtx { constexpr unsigned short max_cols = 0xFF; constexpr unsigned short max_rows = 0xFF; template<typename T> auto mtx(unsigned short rows_, unsigned short columns_) { static_ass...

0
Q: Better approach for mass updating all User JSONfield using signals

gllsI currently have a JSONfield on my User model that will ocasionally need to be updated, I setup a signal in which I query all users and then try to perform an update: all_users = User.objects.all() Initially, i thought I could update the field value by appending a new key/value to the JSONfiel...

0
Q: Finding the submatrix with the maximum sum

Inter VeridiumGiven an arbitrary \$N \times N\$ matrix, find the maximum sum submatrix. This particular approach uses the modified Kadane's algorithm. What could be improved both in terms of algorithm and code style? def read_matrix_from_input(): return [[int(s) for s in input().split(" ")] for row in ran...

0
Q: C++ Dataset class

BenC++ newbie trying to build a class to represent a dataset for the purposes of building predictive models of the form y ~ x0, x1,... Since this is version 1, I'm assuming some nice properties about my dataset It has one y column and one or more x columns It has all double values It has no missin...

17:30
possible answer invalidation by Vuwox on question by Vuwox: codereview.stackexchange.com/posts/214478/revisions
Monking
0
Q: Simple bash script creates apache2 virtualhost config for subdomain

LeonidMewSimple bash script to create apache2 virtualhost for localhost. Can be used for public sub domains on developer server with changes - "replace .localhost". Tested on Ubuntu, but should work where dependency met. Not for production, for development purposes only. Use zenity for gui and pkexec f...

0
Q: Using quantum random number generator for lottery draws just for fun

Travis WellsIf anyone can tinker with this sample code to implement direct access to entangled lasers via the Laser module. Did some research into entangling infrared lasers with cheap crystals that I can get from online vendors for about $50 each. I would like to know what type of altercations would you do ...

17:45
@Peilonrayz title sounds a bit sketchy - I will suggest a title that describes what the code does instead of issue, per site convention
18:28
Great odin's raven: the close votes queue ...
18:55
Oh deary me
19:25
-1
Q: Passing optional argument in a function

AndreasLHI have a question regarding passing default/optional arguments to a function. I am trying to read the values from a dictionary that contains both keys and other dicts (nested). I have tried the "arg_A = " but this does not work with the way I am looking up the dict value inside the function/I am ...

19:42
0
Q: Express.js handler to update user fields

CatfishI have an express handler which i thought was pretty simple, but CodeClimate flagged this method as having a Cognitive complexity of 6 (5 is the max by default without flagging something) Curious how I could simplify this method to reduce Cognitive complexity. function updateUser (req, res) { ...

I believe this question is better suitable for codereview.stackexchange.comextempl 17 secs ago
20:32
The fixed keyword must be in an method labelled unsafe, which in turn requires the /unsafe compiler flag. GCHandle.Alloc(…) discreetly circumvents this safeguard, thereby raising fewer eyebrows in a code review. — Paul Williams 51 secs ago
20:45
I believe that questions about how to improve working code are better suited for Code Review. — Shepmaster 51 secs ago
0
Q: Data visualization. How can I make more clear my github repository?

Curiosity7I am trying to start writing professional code and apply to a work. But I wrote programs only in my university. Now I decided to publish my draft code on github. Is there anyone who can review my code? I do not want to publish the direct link on my repo due to the security reasons. the link on ...

21:10
How can I improve this question to draw more response?
1
Q: Fixing Medical Claim Files through Text File Read/Write v2

puzzlepiece87This is another review on a program I've asked about before, with a different target in mind. Program Function As before, this program makes emergency changes to medical claim files, delivers all the corrected files analysts need, and produces a changelog as well for their review. Core Pr...

This question may be a better fit for codereview.stackexchange.com. — jaco0646 34 secs ago
21:47
I'm voting to close this question as off-topic because it belongs on Code ReviewJoakim Danielson 35 secs ago
0
Q: How could I apply enums to this block of code that checks against user input and returns a response based on that input?

rustacean_in_trainingHow could I use enums in the following block of code to simplify it? The block is a program that has a command interpreter that returns different data based on user input. Is there a way I could easily apply enums and a match statement to the logic here? use std::io; fn main() { let version...

That's fine with my requirements for my script(where it come from code review site), however I'll add your comment to answer. — LeonidMew 42 secs ago
22:14
Might be better to ask this in Code Review rather than on StackOverflow itself — Green Cloak Guy 55 secs ago
@GreenCloakGuy I don't agree with you. As I understand in Code Review users are looking for performance and style improvements, rather than finding mistakes. — DY92 23 secs ago
@SᴀᴍOnᴇᴌᴀ @Vogel612 I tried to hit a few of them, but only made it through 3 or 4.
0
Q: The quicksort algorithm in Haskell

LRDPRDXI am learning Haskell programming language mainly from this source. And there I have encouraged with "an elegant" realization of the quicksort sorting algorithm (the Quick, sort! section). Here it is: Book's implementation quicksort :: ( Ord a ) = > [ a ] -> [ a ] quicksort [] = [] quicksort ( ...

@GreenCloakGuy: Code Review is for improvements of working code. See "Code Review or not?" for details. — Prune 38 secs ago
22:40
0
Q: basic queue implementation in C

MoytabaI'm practicing data structures in C and I implemented a queue based on its description like below, please review my code: #include <stdio.h> #include <stdlib.h> struct QueueNode { int data; struct QueueNode* nextNode; }; struct Queue{ struct QueueNode* priorNode; struct QueueNo...

22:56
@CaptainObvious no code included
@DerKommissar thanks- every bit helps
23:21
@SᴀᴍOnᴇᴌᴀ Hello, first time on the 2nd monitor, just wanted to ask. Do we do Documentation Review on Code Review ?
is documentation code?
@BenoîtPilatte do you mean like in the legal sense?
that's a bit of a overly pointy formulation, but... where are you coming from that that would seem appropriate?
possible answer invalidation by DBJDBJ on question by DBJDBJ: codereview.stackexchange.com/posts/214485/revisions
No no no, just, is this question on-topic codereview.stackexchange.com/questions/214497/…
23:27
@BenoîtPilatte I voted it as off-topic
Ok, just to be sure
sometimes I leave a comment - I probably should
I figured it might have been closed sooner, and the on-hold message would have a link to the relevant meta post
now it does :)
@SᴀᴍOnᴇᴌᴀ Thank you for your reply, just by curiosity, where would you go to do a documentation review ? Is it on-topic somewhere ?
@BenoîtPilatte AFAICT nowhere, unfortunately
@BenoîtPilatte do you mean reviewing documentation comments (e.g. docblocks)?
23:34
0
Q: tic tac toe game in DRJAVA

Steven LiuCreate a 2 player Tic Tac Toe Game. Use if statements to determine if X wins, O wins or if there are 9 moves without a winner, declare a draw. Use multidimensional arrays with the if statements. Do not let either player choose an illegal square or a square that is already populated. Output shou...

@BenoîtPilatte Sometimes we refer users to the famous which site? SE Meta post... though I see no results there when doing a find for document
How is this off topic? I posted my question in overstack code review and I was told be users there is was in the wrong place and I should post it here in stack overflow. — phpccc 26 secs ago
No, if tomorrow I ask on CR:
"""
Hi, Does this documentation make sense to you and how should I improve it
"To use my code blah blah blah"
"""
With `readthedocs` style documentation. Will it be off-topic
yeap
@Vogel612 Ok
23:39
reason is that there isn't code, only doccomments and those don't actually do anything
@Duga sigh... you've been told why it's not on-topic. Both in comments and with the close-reason
@Vogel612 Thanks, it makes sense.
3 hours ago, by puzzlepiece87
How can I improve this question to draw more response?
@SᴀᴍOnᴇᴌᴀ @DerKommissar down to 4 review tasks
I did a bit of a John Wick in there
@SᴀᴍOnᴇᴌᴀ most likely a spam seed
23:45
way to nip it in the bud
it's not like anything was invested in that user account. Being a mod does things to how you view accounts, it's quite ... something
seems appropriate
@puzzlepiece87 a quick skim doesn't yield anything obvious
@Vogel612 Thanks for the feedback!

« first day (2126 days earlier)      last day (2187 days later) »