« first day (1521 days earlier)      last day (2792 days later) » 

00:00
RELOAD! There are 4084 unanswered questions (90.9828% answered)
00:13
0
Q: Picking weighed enumerable values at random

SnowFatalI have a number of enumerables, and I want to randomly pick one value from one of the enumerables so that each value has a certain weight in the randomisation process. This is simplification of my current code: private enum ActionPlan //Just an example, there can be many different enums { Do...

00:28
0
Q: Move template tuple code into its own helper class

ZammbiI was able to get some very helpful code to get tuple values on a previous question. I was able to reduce my duplication a lot. But I'm having trouble wrapping this code in its own helper class so it can be reused in other classes. This is the tuple code: // Inserted invoke to use `void` as f...

 
2 hours later…
02:43
0
Q: What is the meaning of __init__ in python 3?

Anson KhoHi professional programmers out there! Can anyone explain what is the simple layman term for this; "init" in Python 3.

 
1 hour later…
04:06
0
Q: Python will not show program exectuion

Aniello ScartozziI am new to python and I am trying to make a lotto game and when I run the project nothing appears in the terminal it just says press any key to continue. Is there a reason the main function will not run? There are no error given in the compiler and I cannot understand why nothing will execute. D...

05:04
If your code is working and you want suggestion on how to improve its performance then Code Review is a more appropriate place for this question. — kaylum 52 secs ago
Monking
05:32
-1
Q: An MVP Financial Literacy App Built with Angular 4+

finesse.pngI have recently built an MVP Financial literacy app for a client. The source code is here. I'm just looking for tips on things i can do to improve the app. Architeture, code quality, etc. My client has also expressed concern that sometimes people are unable to sign up. What could be causing this?

"Also any tips or suggestions for the program would be greatly appreciated." - codereview.stackexchange.com is the site you're looking for. Make sure that your program is complete and works correctly before you post it there. — skrx 8 secs ago
2
Q: Swing "Number Guesser" program

TommyI have made a UI that guesses the number that the user is thinking of(0 - 100), and I am wondering if it can be improved(I guess this is simple AI). I tried to shorten it as best I could, but it still seems a bit "fluffed." I would greatly appreciate anyone willing to help me shorten and/or impro...

06:01
If the code works and you just want to know if there is a better way, you should post it in Code Review instead. — Magnus Eriksson 20 secs ago
06:26
Monking
0
Q: JSON Cache Program

werdna3232I have some code that is intended to be a package (so that it can be accessed via import cachejson) Here is the code for the package: The update variable is whether the user wants to update the file or retrieve the older file? (True means use the file should be overwritten, false means it should...

0
Q: Bouncy castle using AES128/CBC/PKCS7

aknI was trying to implement bouncycastle with aes/cbc/pkcs7 but i am getting null pointer exception in the first line of cipherData function. Not sure what is going wrong.Could anybody help regarding this?. Also i wanted to know, if my key is in hex format, how do i incorporate it into this program...

06:49
-1
Q: How can I make this code faster in vba

user3713336How can I make my code faster than it is? Right now it's running between 1mins to 1:40secs but I want to run less than 10secs. I am working on around 1million rows. What I am trying to do, finding some name then go to the corresponding column and then searching and going back to corresponding and...

07:03
0
Q: Improving Unit Test with Moq

SimsonsI have two methods , OpenCertificateStore and FindCertificateBySubjectName and implemented them as following: public void OpenCertificateStore() { if (_certificateStore == default(X509Store)) _certificateStore = new X509Store(StoreLocation.CurrentUser); ...

08:03
0
Q: JavaScript Website-Content Grabber

mizechI my firm a few people have following problem: A Content Management System is hosted externally. The treaty doesn't include database-access. In September the treaty will expire. So they have to get the content copied. I have tried to figure out something. So this programming is a first-try. A ...

Kaz
Kaz
Monking @all
Monking
08:40
what's not working? If all you are concerned about is the style, this is not a code review website, there are actual code review communities on stackexchange. We can help you if something is not working properly and needs fixing. — toskv 5 secs ago
I learned a little bit about programming in C allready. This is the type of applications aI can allready create, I finished this yesterday: codereview.stackexchange.com/questions/167181/… I can write simple text based programs and gams like this game. I also know something about using pointers. is this not enough for learning graphical programming? Be honest, not polite! — Henry Weinert 51 secs ago
08:58
If the code works and you just want to know if there is a better way, you should post it in Code Review instead. — Magnus Eriksson 20 secs ago
possible answer invalidation by globalturist on question by globalturist: codereview.stackexchange.com/posts/166792/revisions
0
Q: Method that compares the scores of two players

TheLearnerI tackled this problem today and was wondering how I could possibly improve this code. The objective of the method is to return an array with the respective scores of each player. The method takes three values from 2 users. a0,a1,a2 are all scores from player a. b0,b1,b2 are all scores of player ...

09:24
Is there any issue with your code? If there isn't, this question might be more suitable for Code Review SE. — E_net4 56 secs ago
0
Q: VBA code that compares values and chooses the lowest

Nicola GalluccioI'm new to VBA and I tried to learn it in about a week or so, In these few lines of code I have to compare more prices, choose the lowest and write it to a defined cell, predefined, above the others. Sub prezzo_sulla_quantita() 'Variables declaration Dim nRiga As Integer Dim nRiga1 As Int...

Stackoverflow is not for this type of questions, you can ask for a code review on: codereview.stackexchange.comTroyer 54 secs ago
I'm voting to close this question as off-topic it might well belong in codereview.stackexchange.com — RiggsFolly 5 secs ago
10:04
0
Q: PHP MySQL make insert and update large amount of users faster

user142551I'am using php on server side to manage data with MySQL. I have to request a API that gives me an list of users. I need to check for each user if he is in the database. If yes, I update his information. If not, I insert him in the data base. The issue is that there is more than 2000+ users each ...

10:27
0
Q: Creating ICS calendar events from JSON-like file

taskerthe purpose of this code is to take a Taskwarrior (it's a todo list application) server file that is mostly JSON and create unique ICS calendar events. The logic mostly works: I still see some duplicates that I can weed out, but doing that isn't what I'm looking for in this review. The purpose of...

This is not a site for code reviews, go to: codereview.stackexchange.com for that — EpicKip 12 secs ago
10:40
0
Q: Dynamic Allocation and Reallocation of Memory

SamuelHere I present you a code snippet of a larger program. I tried to simplify it as much as possible. The job of this code is to identify certain particles and store them in a list which corresponds to a certain processor. Besides that I count the number of particles for every processor who are alre...

11:02
0
Q: Split a row into multiple cells and keep the maximum value of second value for each gene

Manolis SemidalasI am new to Python and I prepared a script that will modify the following csv file https://drive.google.com/open?id=0B2ynoLlCACXzSElFZ2poNllmVjg accordingly: 1) Each row that contains multiple Gene entries separated by the /// such as: C16orf52 /// LOC102725138 1.00551 should be transform...

11:16
My mistake. I had not seen the bottom line. Up until then, OP was asking for a code review, hence my confusion. — Flater 7 secs ago
1
Q: REST API for user access using ASP.NET Core

dataEnthusiastI have been coding in java for more than 3 years. Recently we had to develop REST Web Services for our customers in ASP.NET Core. I am a newbie to both C# and ASP.NET Core stack. The expectation behind asking this question here is to get suggestions and best practices which needs to be followed ...

11:50
0
Q: More Efficient Way to Migrate Data than How I Do It?

GrumpyNewHowI wrote a very simple quick and easy script to migrate a bunch of data to another table in my database. My questions are: Can I accomplish this task without using so many foreach loops as it takes? I realize I'm imputing 'similar' data in each of my loops and it just seems redundant and wrong. I ...

0
Q: Method that produces a staircase

TheLearnerI was tasked with writing a method that would produce a staircase like so: I managed to do this using a 2D array but was thinking of ways I could improve the runtime of my code and or other approaches such as using a string and removing spaces and adding a '#' in its place. Thank you for your h...

12:10
-1
Q: Is the tree a binary search tree?

user142560I am trying to solve a HackerRank binary search tree problem, but I can't pass all of the test cases. I need to return true if the tree is a binary search tree, otherwise, I need to return false. Can anyone tell me what I am doing wrong? ''' class node: def __init__(self, data): sel...

12:27
This is a site dedicated to reviewing code and this is not it. Please try Code Review instead! — Compo 24 secs ago
Start by writing inefficient code. Then, post a question on CodeReview, where you'll receive a lot of useful tips and tricks. You'll learn with time. — cᴏʟᴅsᴘᴇᴇᴅ 25 secs ago
12:43
0
Q: How to make the twiddle table reading better?

A.nechiI was trying to find a better way to read from the twiddle table created in the init_twiddle(N) function: void init_twiddle(int N) { int i; for(i=0; i<TWIDDLE_LIMIT; i++) { twiddle_real[i] = (float) cos((float)i * 2.0 * PI / (float)N); twiddle_imag[i] = (float) - sin((fl...

13:08
Monday mood: ¯\(°_o)/¯
13:19
0
Q: Ideas to this download/audio/video manager batch script?

Johnny RogersI am building a complete-as-possible media manager in batch. It watches your qbittorrent downloads, processes them and sorts the media to your collection. This is the main part of the script which calls for seven other scripts for additional tasks like renaming, adding subtitles and sorting vide...

13:53
0
Q: Dictionary of dictionary - Get 2nd keys

NuageuxI have a dictionary of dictionary such as d below, and I would like to get the list of all keys but not on the first level (i.e. ABC, DEF) but the one at the second level (i.e 0 and 1 for ABC ; 1 and 2 for DEF...) I got this small code that does the job by reading all the dictionaries and by sav...

0
Q: Spring MVC service, am I unit testing correctly?

mornanerI have a @Service to send verification emails. Here is the code of the service: package my.package.service.impl; //imports @Service public class EmailSenderServiceImpl implements EmailSenderService { private final static Logger LOGGER = LoggerFactory.getLogger( EmailSenderServiceImpl.clas...

14:22
the program is running properly but I need to know if I have to correct the sizes.... If the program is running correctly, then you are asking for ideas on optimization, or a code review. You might get better results for this kind of question here. — ryyker 16 secs ago
14:35
1
Q: C++ Object Pool - Pointer re-utilization, is this good practice?

Raúl SanpedroI'm programming a game server for an MMO, on which constantly creatures and items are being created and deleted, so I've thought of saving the system the time it takes to allocate and de-allocate new memory by creating an object pool to reuse previously freed objects like follows: ItemPool::~Ite...

14:47
possible answer invalidation by Brent on question by Brent: codereview.stackexchange.com/posts/77840/revisions
15:06
@Duga rolled back
15:23
0
Q: impact of incorrect message size in old unix message queues routines

AminosI'm reverse engineering a program that uses Unix Message queues (the old ones, not Posix) and I saw that the size provided to msgsnd or msgrcv is not correct, it is bigger than what it should be. Example : struct requestmir { long type; char name[128]; int timeout; long test; }; int...

This is a task about "buffer exploits" and it is a practice for "code review" so it states that you should be able to easily find 5-6 ways to exploit it just by reviewing it. I did lot of debugging to figure something out but i'm just unable to find anything. Honestly i'm not just copy pasting my homework here to get other people do it for me, i have really tried on my own and just need some directions about how to go about it. — BSileNTz 58 secs ago
possible answer invalidation by Loki Astari on question by Loki Astari: codereview.stackexchange.com/posts/166368/revisions
15:47
1
Q: C++11 lock free collection similar to std::forward_list - follow-up 2

BrentThread safe and lock free collections are very hard to write, so I'd appreciate any feedback, especially regarding bugs. The code below is a self contained hpp, followed by some tests. This question is a new iteration of this question: C++11 lock free collection similar to std::forward_list - f...

0
Q: Ternary operator usage

LaoujinWhenever I use the ternary operator, it is always in the following context: const someResult = someVar ? "opt1" : "opt2"; A colleague of mine is a bit more "flexible" with the ternary operator: for (let key in someColl) { arr[key] ? arr[key]++ : arr[key] = 1; } Aswell as: someCondition ?...

16:40
possible answer invalidation by SnowFatal on question by SnowFatal: codereview.stackexchange.com/posts/167195/revisions
I just made some code review. And there is no way to do it in the current version of Magento 2. There is a way to do it only for your Resource collection as described in this article. — grinkorrr just now
 
1 hour later…
17:45
0
Q: Vulkan and Opengl swapable rendering backend

Bl4ckb0neI'm working on a multi render library. The point of it is to have a swapable backend at runtime to render the same item. The renderer is given to the window (which is a wrapper over SDL2). Then the window is in charge of drawing a IDrawable, which is a virtual class implemented in a namespace fo...

18:02
Once this pull request is accepted it will work for general requests and metric expressions. So if your are interested in speeding it along feel free to add any code review comments. — Matt 6 secs ago
If this project kills me I would like the dev team to act as pallbearers at my funeral. That way, they can let me down one final time.
2
18:27
A friend asked me to make a minor modification to his WP site but he no longer has the database password. Resetting it isn't going to be fun, since re-entering the password inside WP is going to be problematic now the front-end has been ripped off. #joy
0
Q: Simple calculator about keybinding

user7639356import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import javax.swing.AbstractAction; import javax.swing.ActionMap; import javax.swing.InputMap; import javax...

18:47
@rykker But the question is exactly this, is the code running correctly (as in not potentially formatting his hard drive). That makes it off-topic on Code Review (and it will soon be closed there as off-topic because of this). For reference, the question is here. — Graipher 45 secs ago
19:04
0
Q: GTIN Check Digit Validation in Elixir

DogEatDogSimilar to other GTIN validations, the function should take the entire string of the read in barcode, calculate the check digit, and compare it to the check digit on the code. For example, the code 6291041500213 would take the first 12 digits (629104150021) and calculate the answer of 3. this c...

possible answer invalidation by Jamal on question by Shift_Left: codereview.stackexchange.com/posts/166842/revisions
possible answer invalidation by kourbou on question by kourbou: codereview.stackexchange.com/posts/167169/revisions
@Mast You should be able to edit wp-config.php.
 
2 hours later…
21:00
0
Q: Addressing "System.NullReference" Resharper warning in function

RandomHandleTLDR: How can I check "DeclaringType" for null without causing a further cascade of problems in the function? I have a C# LINQ query that uses reflection to list all Areas, Controllers, and Actions in my MVC Project. It appears to work correctly. I have not encountered any actual errors in the o...

jrh
jrh
21:13
I considered making a rather major edit to a post that got the tumbleweed badge
0
Q: Upload Service In ASP.NET MVC

work questionI've wrote a service for Upload Files . My codes are : I use a Propert For set path but I am not sure is it Ok Or It's better to get path in Upload() Method as a param ? another Question is Is it better to chage UploadService to static public class UploadService { #region Fields pr...

It's a near complete rewrite of all non-code text but I think this is what the OP was trying to say. Any thoughts?
Also I'd answer that question but I'm a near complete noob to ASP.NET MVC, I'm more of a desktop C# guy. I could only give generic advice from an OOP and language perspective on this one. I'm probably not his code's target audience.
21:32
@jrh On mobile - how old is it?
@Aminos - You are welcome. Although I appreciate the sentiment, and support shown by the other comments, I still suggest the best direction for this type of question, as it is now, would be the StackExchange Code review site as I linked in my previous comment, or maybe the algorithms site. However, If this post was edited to conform to the the How to create a Minimal, Complete, and Verifiable example for this site, I am pretty sure you would see more positive activity here. It already has the beginnings of a good question. Consider editing. — ryyker 16 secs ago
jrh
jrh
@EBrown 15 days
That means it's not a zombie yet.
jrh
jrh
when does the roomba clean up again?
a month?
or is that just a SO thing?
0
Q: Get 10-day forecast script

ArminMethI coded a script to print a 10-day forecast for any location to my terminal. As I am just learning Python (coming from the PHP world - yes, I know...) and have no buddies coding in Python, I would really appreciate it if anyone could review my code and provide comments and suggestions for impro...

21:40
I don't know if our roomba will deal with it.
I don't even know if we have a roomba.
I'm voting to close this question as off-topic because the code is working, this question should be on codereview.stackexchange.com. — Stargateur 55 secs ago
0
Q: Sum array values based on conditions in other arrays

CodingNewbI have the following code that sums the values in wgt_dif (a numpy array) if certain conditions in two other numpy arrays are met. It is basically the equivalent of a SUMIFS function in Excel. sum_4s = 0 for i in range(len(pntl)): if pntl[i] == 4 and adj_wgt[i] != max_wgt: sum_4s +...

22:42
0
Q: Codingame: Great Escape bot in Ruby

MangaraI started working on some code challenges at CodinGame to learn Ruby, and this is my first big Ruby project. It's a bot for their Great Escape contest (here is a sample gameplay video). Each player starts at one side of the board and must reach the opposite side. Each turn, a player can either...

> DbSortClause expressions must have a type that is order comparable.
Whoops
23:01
If you don't call DbContext.SaveChanges() in Entity Framework I guess it doesn't save your changes...who knew?

« first day (1521 days earlier)      last day (2792 days later) »