« first day (1560 days earlier)      last day (2752 days later) » 

00:00
RELOAD! There are 4252 unanswered questions (90.8378% answered)
00:13
0
Q: Creating objects by defined name

TravisI'm trying to write universal factory creating objects by name. I've got some working prototype now but there must be a better way than casting construction methods to void pointer. struct aobject {}; // some base class factory { public: template <typename... TArgs> static aobject *crea...

00:42
0
Q: How do I handle paging when searching in the Spring member list?

최성원Member list paging is complete. But there is a problem. If you search for a member and click Next, the keyword value and type value are lost. And even when there are not enough results, the page is generated more than the below, and the keyword value and the type value are lost when the pa...

00:57
0
Q: (Java) Convert Number from One Radix to Another

user146374I am relatively new to coding and could use some help figuring out how I could improve my coding technique and habits. Here's an example of a working Java program I wrote that converts a number of some radix (from 2 to 36) to another radix (from 2 to 36). Tips? Criticism? All help is appreciated...

01:27
0
Q: Correct MVC Implementation

jm85I'm in the process of building a app based on the card game "War" for practice to better understand the MVC model. I would appreciate feedback on if I'm on the right track with my objects interactions so far regarding MVC and if there's any other glaring issues with my code you discover. Here's ...

0
Q: C++ environment variable expansion

Display NameI wrote the following a while ago (using regex code I found on Stackoverflow), and I have the following concern I'd like addressed: should there be an std::move() around the passing of the string into the parameter in the second version of the function, ExpandEnv(std::string const &text), to the ...

0
Q: Simple Deck of Cards Python Program

Throwaway25663579348I have created this program and intend to implement it into basic card games that I create. I would like help cleaning up redundant code and overall, make it more concise. import random class Card(): def __init__(self, value, suit): self.value = value self.suit = suit ...

02:00
0
Q: Explain Problem 158B Taxi Codeforces solution

siddhu619For the codeforces problem 158B Taxi problem. Can someone explain the logic behind the below code: Problem :158B I=raw_input;I() s=map(int, I().split()) a,b,c,d=map(s.count,range(1,5)) print d+c+(2*b+max(a-c,0)+3)/4

02:30
May be a more appropriate question for Code Review. — perigon 42 secs ago
03:19
0
Q: Lessen redundant calls from a class or ID

clestcruzApologies for the bad title or question. But to make it easier understand I have a code here that calls the header multiple times for example. The variable below specifies the element to clone which is #header a[href=$="programs"]. The ID #header is called multiple times in parts of my code. Is t...

0
Q: Recommended Angular Code for Beginners

Joseph I'm starting to learn Angular and I wanted to ask if this application is good? Is it following good standard of coding or code of rules? Is it following good practices? Your response will truly guide me in learning Angular. This is the his github [https://github.com/chenkie/ng2-cribs][1]

03:34
0
Q: Python tool to reduce number of resistors in circuit

Dan LaksI've written a tool in Python to help me with a specific problem I have with electronic circuit design. Here are the motivations: It is common in circuit design to need to choose two resistor values to form a voltage divider. Any number of combinations of resistors can satisfy the divider. And ...

03:52
0
Q: Python code for a basic AI with voice recognition for retrieving news articles

Zakar H.I wrote a program for a basic AI with voice recognition that makes request to News API to retrieve metadata for the headlines currently published on a range of news sources and blogs. For now it does everything I need it to do. What I want to do is improve the quality of the code with best practi...

0
Q: Small module for getting JSON to work with in Python

Walid MujahidI currently have a module with Class / Methods I want to use in other scripts. Recently chess.com released a read-only REST API for beta-testing. The methods in my class build a URL for the API endpoints I am interested in and get the JSON data for me to work with in other scripts. It is worth ...

04:23
Monking
04:43
Please do not flag this and suggest that it be moved to Code Review. In the current form, it is not ready to be asked on Code Review. Please see their How to Ask page for advice. If you want to re-ask over there, following those guidelines, then please do so. However, I will not be migrating this anywhere. — Cody Gray ♦ 7 secs ago
05:32
This issue is fixed in CodereviewRohith 8 secs ago
I'm voting to close this question as off-topic because is requesting discussion and review of working code, it belongs on codereview.stackexchange.com as it is off-topic here. — Jarrod Roberson 54 secs ago
-1
Q: how to reduce credentials of google app api call for server to server authentication

Tara Prasad GurungI have made an api call to google apps using server to server authentication. These are the credentials it requires. service_account_user= [email protected] p12_fullfilepath = /home/tara/taraproject/myvenv/myp12file.p12 secret_password = secretwhilesetup api_sco...

05:54
0
Q: Command Pattern with Undo , returning response in Invoker and Command class or Callback?

spakaiI have used command pattern with undo support. The terms associated with Command Pattern are as follows Client → Invoker → Command instance execute() → Receiver so the client will need to know whether the operation was successfully so that it can decide whether to undo. In my example, Receive...

0
Q: Make Java code more streamlined, check for redundancy

Michael SwartzBased on the "Adding a Parameterized Method to Vehicle" section on pages 117 and 118 of "Java - A Beginner's Guide, 6th Edition" I took their code and rewrote it order to make it more object oriented. I split it up in to two files Ch04_08_ComputeFuelMain.java and ComputeFuel.java. In their exampl...

06:28
0
Q: A Simple Cluster Generator

MillerThe purpose of this code is to produce a universe of points, randomly generated around predetermined centroids, provided as a vector of vector. The final product is a file of sample points, to be used for fake data analysis in another program. The objective here was brevity and speed - I feel the...

06:42
0
Q: Summing all primes below 2,000,000 - Project Euler #10 in Assembly

StephanFirst of all, I am sorry I posted this first on StackExchange. I didn't know there was this Exchange for exactly this purpose. :( I am currently learning assembly for university, and I'd like to hear some feedback concerning what I've written. Currently I have implemented Problems 1, 2, 3 and 10...

0
Q: Managing python application configuration in a key-value store

ChrisWueFor a project we're working on, we need a central place to store the configurations for various applications (they're all headless services running in docker containers so local configuration files or command line parameters aren't going to cut it in production) We've chosen to use Consul as the...

1
Q: Why alternative solutions are not welcome?

Billal BEGUERADJI skipped reviewing this answer because I am not sure what to do with it after I read the comment posted below it: Welcome to Code Review! You have presented an alternative solution, but haven't reviewed the code. Please explain your reasoning (how your solution works and why it is better...

07:15
0
Q: what is the right code style to return multi values in a function

Vi.CiMy partner argue with me about weather should we add ( and ) when a function want to return a tuple. def gravity(self): lat = sum([o.user_location[0] for o in self.orders]) / len(self.orders) lat = sum([o.user_location[0] for o in self.orders]) / len(self.orders) lng ...

07:26
If your codes is already working, and you just want a review, you will get help better in Code ReviewSwellar 39 secs ago
07:54
posted on August 11, 2017 by CommitStrip

I completed it and posted it for review. Please check it out codereview.stackexchange.com/q/172673/146389daddyodevil 34 secs ago
2
Q: Python program to check substring match locations with a lot of permutations of the substring

daddyodevilthis is my first code here and also my first program of this size. I don't really know what is expected from a programmer who writes "good, readable" code. This is my first program which will be used in a real-world application. Also I'm extremely new to Python. So while reviewing please be kind ...

0
Q: Request Router written in Go

John MurdochI started to learn Go language and I figured to write another request router as I am going to need it for my next Go project. As it is my first thing written in Go I appreciate comments and suggestions. Thanks a lot. Find code base on Github

If the code works with no issues, and you just need an improvement hint(s), I suggest you post the question at Code Review. — Wiktor Stribiżew 39 secs ago
08:18
0
Q: Read file with URLs to connect to them, search for patterns and generate output in multi-threading env

Marcelo TatajeI've been implementing a little application that will read a text file that holds URL addresses (one address per line). Example: http://www.yahoo.com http://www.cnn.com http://news.google.com Based on that file, I am supposed to read the parsed content of the main page for each URL and search...

08:38
0
Q: Finding occurrence of a given character in a String?

Egek92I came up with this simple solution: public class Main { /** * How to count occurrence of a given character in a String? */ public static void main(String[] args) { Scanner in = new Scanner(System.in); if (!in.hasNextLine()) { System.out.println("You must enter a stri...

09:11
0
Q: Read information from Outlook emails

NewbieUserThis class is read specific information(body, subject...) form Outlook emails. I want some suggestions(Naming, avoid code smells, OOP designs.. and more..) to improve this code... Thanks. public class MailMessageInfoHandler { private const string ExchangeAddressType = "EX", ...

Maybe the question is better suited for code review? — xander 19 secs ago
In case your code is working and you are only looking for optimisation hints you are at the wrong place. StackOverflow is for solving specific problems with code. "Too slow" is too broad. Please check codereview.stackexchange.comYunnosch 59 secs ago
09:25
0
Q: A tool to extract all links from a web-page in Python

Tom LevyI'm starting writing in Python and is tasked with writing a simple tool that opens a web-page, collects all the URLs (both complete like http://mail.com and relative ones like /mail/inbox) and returns a list of them prefixed with the domain name. The code is below. Could someone take a look and ...

09:43
0
Q: Any code optimizations for my HackerRank problem solution?

Dream_CapI have been trying to learn javascript for a year now, and have just embarked on HackerRank's 30 days of code. After a couple of days I finally solved this problem. Here is the task (if you click the link, press x to the signup page): Task Given a string S of length N that is indexed from 0 to...

10:31
0
Q: Equal Problem - Algorithm Design

SindicoI am trying to solve this problem from HackerRank https://www.hackerrank.com/challenges/equal/problem here is my Java attempt import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static List<Integer> memo = new Arr...

Monking
11:15
possible answer invalidation by Carl Fujinami on question by Carl Fujinami: codereview.stackexchange.com/posts/172587/revisions
0
Q: Filter a list based on some ComboBoxes

user7998549So I have a grid with data and above that grid 2 comboboxes, the grid will be filled with data based on the selected values from the comboboxes. This works but can you do it way easier like I did? if (_InitialDataGridPersonList != null) { if (GetSelectedComboBoxPersonStateText() == "-" && ...

0
Q: C++ choose between runtime and compile time implementation functions

StefanI wrote a small wrapper function to choose between runtime (std) sqrt and a constexpr version, as a continuation of the vector class I published here earlier: C++ mathematical n-dimensional vector template using fold expressions It seems to work fine and Compiler Explorer shows that the sqrt fu...

Greetings, Programs.
Greetings, @Donald.McLean.
11:42
I have no idea. SO is not a code review site, you can ask questions on the certain programming problems, not just "why my code doesn't work". For the "MySQLi input escaping not working" question you've got a perfect answer, whereas to help you with your code there is debugging. — Your Common Sense 46 secs ago
11:53
It's not a code review it's a code support i have something that does not work and was asking for help as to why it does not work you picked on something that does work and said it did not you also said i had to escape then mark as duplicate of a question that says i should not have to escape. — Martin Barker 5 secs ago
possible answer invalidation by Carl Fujinami on question by Carl Fujinami: codereview.stackexchange.com/posts/172587/revisions
0
Q: Multiple types of contacts

SipoI have a list of contacts, classified into categories. Each category is represented with a different class. So, base class: class Contact { public ushort Id { get; private set; } public Phone Phone { get; private set; } public Contact(ushort id, Phone phone) { Id = id; ...

12:38
0
Q: Runtime function in Swift

AlexsanderI have the following case, I need to delete a specific observer for the firebase database reference, so I made a code that looks something like it looks to the NotificationCenter. In various managers I used NSMapTable in order to keep the weak references on UIViewControllers and that contorller s...

12:57
0
Q: RegEx , match first character condition, then another condition after that?

KyloRenI have been struggling with a RegEx pattern for a while now. I am trying to match a single Text character at the start of a string and then anything after that character that is an integer with a length of 5 characters. Ie, A12345 = Match B34464 = Match 2B3456 = No Match, first digit is not ...

Monking-ish
@Duga rolled back
hngh... I should open a JCP to officially mark all Swing and AWT public API as @Deprecated
Gr8 ... three votes left, and I haven't even gotten to go through all the questions from yesterday...
aaaand DVLR...
I need more votes
13:35
1
Q: How should I ask this question?

Jarko DubbeldamI am currently working on one of my first projects with Python and my first project with PyQT. I would like to post this as a question, to see if there are any improvements I can make. The project is quite big however (not sure if big enough to score for the three zombie heads), consisting of tw...

@SimonForsberg I think Duga's choking on some incorrect regex patterns right now...
in Duga's Neighborhood, 1 min ago, by Duga
2017-08-11T13:43:00.003Z Exception in comment task java.util.regex.PatternSyntaxException: Unclosed group near index 24
27N*1umFXvH7XvDuCILUbw((
^
-1
Q: RunTime error in python when submitting the code. What maybe the issue?

Kiran SaxenaI am getting runtime error when submitting my code to a challenge though it runs fine on my machine. Tried writing code in different way but no success. What are maybe the issues for this error. what maybe the solutions to try out? import math c=0 d=[] e=[] g=[] l,r=input().split(" ") l=i...

She just needs the Heimlich maneuver.
3
14:16
another day, another Check mark, this time in Java, or is it JAVA?
230 more votes on my C# answers....will need to post more answers...
I had more flags... lol jk
14:56
0
Q: SQL query generator

Jarko DubbeldamThis is a project I have been working on. This is one of my first experiences with Python and OOP as a whole. I have written a GUI that handles the inputs for these classes, but I will ask for a separate review for that, since the question would be rather bulky when including both. The goal of t...

0
Q: Update existing or Insert new in db

Drag and DropIn the process of updating a Table: Table_Id, Table_Column1, .. , Table_ColumnN. I want to split my current result List<Table> into: List<Table> toInsert, For a bluck insert. <Table> Dbitem, To SubmitChanges to update the row. For now, for each Table of my result I'm looking for a matching...

15:12
@Vogel612 She does that every once in a while. Tends to fix itself after a while. If you can figure out why, please let me know
But not the next two couple of weeks because I'll be AFK
15:26
0
Q: API request object with Handle() method

Scott HannenThis is actual production code, and I think what I have stripped out is truly irrelevant to the question. (If I'm wrong I'm sure I'll be corrected.) This is a request object received by a .NET Web API application. Our application has dozens of them, and they each have a Handle() method. I'm not...

15:40
It's hard to train deep learning algorithms when most of the positive feedback they get is sarcastic.
7
@RMunroe lol
0
Q: Comparison of 2 values based on custom operator

JanDotNetI am working on a library that parses query strings and evaluates the result for a given context. The query has the format FIELD OPERATOR VALUE (AND|OR) .... The list of operators is constant, but the field's type can be customized (default primary types are supported right now - other types can ...

15:53
The question would be how to make this code more efficient. I will post on code review if this is the wrong place for this kind of question. — Saad Ibrahim 1 min ago
It seems that your code currently works, and you are looking to improve it. Generally these questions are too opinionated for this site, but you might find better luck at CodeReview.SE. Remember to read their requirements as they are a bit more strict than this site. — Yvette Colomb 7 secs ago
possible answer invalidation by JanDotNet on question by JanDotNet: codereview.stackexchange.com/posts/172718/revisions
16:13
@Duga seems ok
1
Q: ES6 Javascript (React) code that maps and filters JSON data

Saad IbrahimI have the following code in my React app that creates tags out of JSON data: const files = Object.values(gist.files); const tags = files.map((file) => { let tag = file.language ? file.language : 'Plain Text'; return tag; }); let unique = [...new Set(tags)]; const unique_tags = unique.m...

1
Q: WV lottery tool in Python

DannyI am self taught in python. I love to play the lottery and play with numbers. I put this program together as a hobby to learn python and build something that people can use. I used and reused code throughout the program, so some variables in different methods are the same, but still accomplish t...

16:30
0
Q: When to provide custom swap function?

Daniel LangrConsider a custom class X holding some resource (for simplicity represented here by an integer member variable) with move constructor (MC), move assignment operator (MAO), and a custom swap function: class X { int i_; public: X(int i) : i_(i) { } X(X&& rhs) = default; // move constructor X

17:02
This would've helped me a lot in statistics...
user image
3
17:34
13
Q: Does it matter if I replace germanium transistors with silicon?

OrangeCalx01I found computer gold today with this amazing article - it details construction of a 400 germanium transistor-based digital bit-serial computer, circa 1967. Before I get my hopes up of spending about $120 to construct it, I noticed it specifies germanium transistors for construction. I was consid...

@Mast ^^
0
Q: Program to add two fractions in C

Soha Farhin Pine You’re given A/B and C/D. You will have to calculate A/B + C/D and answer it as E/F. Input specification On the first line you’re given the test case number N. Then there will be N line following. Each line consist of 4 integers with two “/” in the middle. For example: the each line wil...

17:51
0
Q: Simple counting fair semaphore implementation

sachin2182Here is my attempt to implement a simple counting semaphore in Java. Please share your comments. /* * A simple counting semaphore implementation. * Acquire calls block until a resource is available. * Supports fairness option which serves Acquire calls * in FIFO order. */ import java.util...

It seems like your question would be better suited for Code ReviewMibac 6 secs ago
18:25
possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
18:38
1
Q: Zork-style text-based game engine Python3

Schrodinger'sStatOver the last couple of months I've been working on a zork-style text based adventure game to kind of crash-course teach myself Python. I've gotten to the point in it where I'm fairly proud of what I've made so far, although it's not complete I think that it's ready enough to post on here. w...

possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
18:52
If this is a working Code. You need to move this question to Code Review. — dirty_feri 59 secs ago
Assuming the code works, post this question here. — Lukasz Salitra 14 secs ago
0
Q: Python WebSocket Server + SQLite + Multiprocessing

fire_waterI have been wanting to learn more about developing web applications using WebSockets so, with the help of various online tutorials, I built a little Python WebSocket server using Tornado and SQLite. Basically, whatever string the client sends the server will be written to the database. The detai...

If you want someone to review your working code, try posting on CodeReview. — csm_dev 51 secs ago
19:09
0
Q: UEFA Champions League Draw Simulator

MuckinAround145I'm new to Python and have written a UEFA Champions League draw simulator. It receives input for 32 teams from 14 countries, and then randomly distributes them into groups of 4, never putting two teams from the same country into the same group. I am looking for more efficient ways to write this ...

Hard for me to understand what is going on without data samples, BUT instead of declaring an oversized array, you could collect each element in a Collection or Dictionary object; then you would know, in advance, how large an array to create. And if your code is working, this might be better suited to Code ReviewRon Rosenfeld just now
0
Q: Is it considered good JavaScript practice with const?

Olivier PonsI've been asked to review code. And here's the code: const eachText = []; $('td') .each((i, td) => { if (td.textContent.startsWith('H')) { eachText.push(td.textContent); } }); Here's what I adviced: should be named uppercase like all other languages (like a de-facto standa...

19:45
Your question might do better here: codereview.stackexchange.comJim Simson 12 secs ago
19:57
What is the question? This might be better suited for the Code Review stackexchange site — Rob M. 37 secs ago
@200_success could you please weigh in regarding this comment?
@Vogel612 I did read it, I just thought that common since would tell me that it would be silly to create the exact same question, specially since no answer actually related to my question at all. So Should I just copy the entire post and title and re-ask it? Also those answers do not really answer any questions I asked, thats why I didn't accept them. And 22_success basically edited the question after the first answer to steer the answers in the direction of what I am actually asking. — Jake 5 mins ago
1
Q: Regex in Hive QL (RLIKE) - performance?

hummingBirdI'm wondering how/if can I improve the regex I'm using in a query. I have a set of identifiers for certain user groups. They can be in two main format: X123 or XY12, and any two letter combo User can belong to multiple groups, in which case different groups are separated by pund symbol (#). ...

0
Q: Idiomatic way to work with connection pool

rpeshkovI have a PageStore interface defined as: type Pagestore interface { NewPage(url string, finished bool) (*PageData, error) GetPage(id string) (*PageData, error) SavePage(p *PageData) error FinishPage(p *PageData) error } And a struct RedisPagestore, that implements this interfac...

20:19
Our site policy generally prohibits modifying the code in the question after an answer has been posted, because in our experience, it leads to very messy Q&A when there are multiple versions of the code. That said, your changes are largely independent of the recommendations in the two existing answers, so we could probably arrive at a compromise. Please edit the question so that there is one version of the code to be reviewed — choose either your old code or the new code. Until then, I'm putting this question on hold as "Unclear what you are asking". — 200_success ♦ 21 secs ago
thanks :)
1
Q: Card Game- Data structure Effeciency

seshendraCan some one review the code, not sure with the space complexity A has invented a new card game to play with B. A made a deck of cards with random values between 1 and 60. B picks 5 cards. Find operations such that ((((val1 op1 val2) op2 val3) op3 val4) op4 val5) = 42. Operations allowed are +, ...

I think this question might be more appropriate to Code ReviewIsac 10 secs ago
20:55
possible answer invalidation by Jake on question by Jake: codereview.stackexchange.com/posts/172507/revisions
21:13
0
Q: A Simple Cluster Generator v0.2

MillerThis is a code revision of a previous post and works well. Code has been reworked to be far more clear and concise, thanks to reviewer suggestions. Redundant and unnecessary data structures have been removed, and code has been made more consistent with C++11. The purpose of this code is to prod...

0
Q: Convert fahrenheit to celsius and kelvin, celsius to fahrenheit and kelvin, etc

Distant Graphics The task is to convert a temperature in a list of fahrenheit, celsius, or kelvin to the two other temperatures in the list. Here is my code: /* * #define LANG C */ #include <stdio.h> /** standard io **/ #include <stdlib.h> /** exit(), atof and the lot **/ #include <unistd.h> /** needed f...

21:24
codereview.stackexchange.com/a/60913/146446 explains this code in more detail, and also has great unit tests. — Tot Zam 51 secs ago
Also note that if your code is complete and works, it should be posted on Code Review, where this is ontopic. — Carcigenicate just now
If your code is complete, works and you want it reviewed, post it on Code Review instead. — Carcigenicate 40 secs ago
21:47
Perhaps look at codereview.stackexchange.com for comments on your code. I would also say that rolling your own cryptographic primitives as a first project is guaranteed to be unsafe. For example you are using Random, while there seems to be a cryptographically strong random number generator in docs.oracle.com/javase/7/docs/api/java/security/…. Creating a new Random object for each loop is probably not advisable either! You also print the seed to stdout, which may not be advisable. (This is without looking at your code.) — O.O. 10 secs ago
21:57
0
Q: PHP and MVC model - Session Control

Daniel OliveiraI am implementing my first app using MVC. I would like to know if the approach I thought for the session system is a good and scalable one. Well, basically a session is stored in my MySQL database and it is represented as a Session Model object. I also created a SessionDataMapper that makes the...

22:14
Soo ... I wonder who had the ingenious idea to set the default vm.swappiness on linux kernels to 60...
makes for a really nice 40% RAM usage... which is too little for anything useful for development
This would be a good question for codereview.stackexchange.comKai 21 secs ago
22:40
possible answer invalidation by sachin2182 on question by sachin2182: codereview.stackexchange.com/posts/172733/revisions
23:01
I'm more familiar with SO itself, but is it normal for someone to answer the same question 3 separate times (with different 'parts' to an answer, if you will)?
@TemporalWolf I'd not say normal.
but it has been done before ...
9
Q: Should we merge multiple answers from the same person?

DanielToday, I ran across this question which had already been answered by Malachi 3 times before I looked at it. I decided that since he answered in multiple answers, I might as well do the same thing. I also checked out this question, where it seems the concensus is that we can have multiple answers...

Alright, that's what I suspected. It's telling he has the same typo in two of his three answers to the same question.
see ^^ this meta and it's duplicate target :)
In this case I think you should flag one of the answers for moderator attention.
I don't consider that a good use of multiple answers, but don't have votes left to voice it
Yeah, I've been looking through the above and it's certainly more tolerated on CR, but I'm not convinced he has met the bar.
oh jeebus... 11 review items?
and I can act on the surprisingly large number of ... 2
23:10
I'm voting to close this question as off-topic because questions about improving the style or design of working programs belong on CodeReview.stackexchange.com. — Barmar 1 min ago
note to self: write a feature request to show review stats like in suggested edit queue for VLQQ
also: go to bed...
Night :)
night and thanks

« first day (1560 days earlier)      last day (2752 days later) »