« first day (2110 days earlier)      last day (1908 days later) » 

12:00 AM
RELOAD! There are 5886 unanswered questions (89.8268% answered)
 
12:18 AM
Also I found this link that shows generic null/empty checks for properties in a class. This might be helpful too: codereview.stackexchange.com/questions/147856/…Andrew 14 secs ago
 
12:48 AM
@user2864740 "Make sure to post valid, representative code."? How isin valid code relevant to asking a question at SO? If the code was without any errors the code would be off-topic for SO and on-topic for Code Review. — guest271314 55 secs ago
 
Does the comment added to this answer in revision 2 add sufficient justification?
 
1:10 AM
TTQW; ciao
 
 
1 hour later…
2:24 AM
Please post this on code review, NOT here. — Ravindra Ranwala 17 secs ago
 
2:36 AM
0
Q: design of Tic Tac Toe program in Python

okcappBelow is a program I wrote to reproduce the known win proportions for random Tic Tac Toe games (X always moving first). It takes about a minute to play the one million random games that will be played if you run main.py after putting all the below .py files in the same directory. (The program doe...

 
3:08 AM
0
Q: Reach to the last index starting at index 0

thadeuszlayThe task: Given an integer list where each number represents the number of hops you can make, determine whether you can reach to the last index starting at index 0. For example, [2, 0, 1, 0] returns true while [1, 1, 0, 1] returns false. My solutions: // functional: const reachL...

 
3:22 AM
@Jonathan: This should not be under SO, it might go to Code Review. But Since you are new to PS, just a suggestion would be to read thoroughly about PS in get-help section for all the cmdlets followed by the documents available on internet. SO is a forum where people post Codes on which they struggle to fix. In your case, it is just an opinion based. Also, to answer your question, that is not get-children; it is get-childitem which basically pulls the list of files and folders similar to dir command in Windows. — Ranadip Dutta 51 secs ago
 
0
Q: Shopping List Creation

Liam EricksonFor my coding class I have to build a shopping list by having the user enter the number of items they need and then each item (one at a time). I then have to output the final shopping list in a multi-line dialogue box (one item per line). I have the first two parts done where users enter the numb...

 
4:14 AM
0
Q: Stack layered lookup

BanMeThis is code I wrote to check a product structure from 1 table in a database. It's based on a type which can have area(s) and area(s) can have group(s). I have: type and code area: blank group: blank type and area and code group:blank type and area and group and code As you can see, it i...

 
5:04 AM
Monking
 
 
1 hour later…
6:06 AM
0
Q: JavaScript DOM Implementation

David WhiteI'm supposed to create a website that adds multiple forms to the page, is responsive and checks if the inputs are valid (validation is not important, just needs to show some attempt at regex). Below is what I've written so far. What I'm looking for is any advice on making it more efficient and co...

 
 
1 hour later…
7:21 AM
Since you're asking for help improving working code, this may be a better fit over at codereview.stackexchange.com, but be sure to take their tour and read their help first, particularly What topics can I ask about here?Şivā SankĂr 15 secs ago
 
0
Q: BinaryTree<T> homemade OOP code written in C#

TheRealViraI have been working on a homemade binary-tree and want to optimize my coding style. Is there anything I could improve? Working in .NET Core 3.0. using System; namespace BinaryTree { [Serializable] public class BinaryTree<T> where T:IComparable, new() { private Node<T> _paren...

-2
Q: Losing the penny on the output

tisaconundrumI'm writing a Python script that will prompt the user for monetary value (such as 11.26). Then, calculate the number of dollars, quarters, dimes, nickels, and pennies. It should use the maximum possible number of dollars, then quarters and so on. For an amount like 11.56, I do get the right bre...

 
Yes, you can probably shorten the code. Not certain what "cleaner" means. If the code does not have issues consider asking the question at Code Review. Though still, the expected output should be included in the body of the question itself. See stackoverflow.com/help/how-to-ask, stackoverflow.com/help/mcve. — guest271314 58 secs ago
 
7:42 AM
0
Q: Python update SQLite DB Values

K-DoeAt the moment I try to get used to SQLite and Python. I started with insert, select and so on. But now i want to get a bit further. Now I have a DB with 200 rows for testing and in want to update two values of each row in this case called "Test2" and "Test3". My problem is that those two values ...

 
 
1 hour later…
9:10 AM
0
Q: Found a serious bug after posting question

Richard NeumannWhat is the correct way to go after I found a bug in a question that I posted? Shall I delete the question, vote to close it or flag it as off-topic?

 
9:40 AM
Might be a better fit on code review (but check their help pages on topicality first). Not sure it's a good fit for SO. — Damien_The_Unbeliever 14 secs ago
 
 
1 hour later…
10:53 AM
0
Q: Java: Note for monitoring buy/sell item list

SharkmenI'm making note where you can add items that you buy or sell, any suggestions? public class Main { private static Scanner in = new Scanner(System.in); private static String commands = "[-1]Quit, [0]Commands, [1]Available items, [2] Sold items, [3]Add, [4]Delete," + " [5]Edit, [6]Sell. ...

 
11:09 AM
0
Q: A simple Java class for implementing code stop watches - follow-up

coderoddeI have received a nice answer for this post. Now, it is my attempt for some improvement: package net.coderodde.time; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; /** * This class provides easy-to-use means for measuring elapsed time. *...

 
 
1 hour later…
12:13 PM
0
Q: Chained Sort Python Implementation

Tobi AlafinSo I've run into a few occasions where I'd want to sort a list according to a criteria, then for all loosely sorted sublists (a sequence of equal elements), I'd want to sort those sublists according to another criteria. I previously did something like this (assuming there are m criteria. sorted(...

 
12:39 PM
thank you for the effort. It seems that the 99% percent of the elements swaps position indeed. Thank you for the code review and also the syntax improvement — George George 10 secs ago
 
12:55 PM
possible answer invalidation by TheRealVira on question by TheRealVira: codereview.stackexchange.com/posts/213286/revisions
 
0
Q: Word Chain Implementation

Martin FrankThe idea originaes from the CodeKata19, find a word chain for two words of a wordlist example 1 turning lead into gold: lead load goad gold example 2 turning code into ruby: code rode robe rube ruby Note it would be also valid if you had found this chain even though it is not an optimal s...

 
1:15 PM
@GeorgeGeorge For code review you could send your code to codereview.stackexchange.com. Here on SO we don't do code reviews — Fabjan 21 secs ago
 
1:33 PM
0
Q: Find out whether string A can be shifted to get string B

thadeuszlayThe task: Given two strings A and B, return whether or not A can be shifted some number of times to get B. For example, if A is abcde and B is cdeab, return true. If A is abc and B is acb, return false. Solution 1: const haveSameLength = (a, b) => a.length === b.length; const isSa...

 
You're not using cells as far as I can see (those are indexed with curly braces {}). Otherwise, please profile your code, and then try to address the bottlenecks. As it stands, this is not a good fit for Stack Overflow. Given a better explanation, in text, of what this code does and the only requirement is time-wise improvement, you could try to ask this on Code Review. — Adriaan 14 secs ago
 
1:49 PM
0
Q: K&R C book , Exercise 1-21

Rick SanchezI'm new to C, just started reading K&R C book, and am working through exercises. This is my solution to 1-21, and as far as I tested it works. Anything that I'm doing wrong, or that it's not idiomatic C? What can be improved ? Exercise 1-21. Write a program entab that replaces strings of blan...

 
2:27 PM
Monking
 
@Vogel612 Monking. You're just in time for my Round 2 question. ;)
 
yay, something to procrastinate with 😀
 
Indeed. :) I also changed a lot of stuff in it, seems to be much cleaner.
 
0
Q: Codable Failure Response Handler

Prashant TukadiyaSuppose You have two kind of response like one for success and one for failure Success response model will looks like struct UserLogin: Codable { let status: Bool? let accessToken: String? let data: [UserLoginData]? .... } Failure Model will looks like struct FailedResponse...

0
Q: Analyzing spoke overlaps during rotation: Round 2

202_acceptedRound 1: Analyzing spoke overlaps during rotation I previously posted this question, but I've changed a lot of the code since then. There was a mention of the previous being a bit mixed up, and things being too integrated, so I've abstracted away a lot of that functionality. The purpose of thi...

 
2:43 PM
wow skimming the question now gives me the impression I understood what you're doing from the code alone
which is awesome :)
 
Greetings, Programs.
 
3:00 PM
Greetings, User
 
@Vogel612 That's the goal. :)
 
@CaptainObvious @202_accepted I think phase angle delta is the technically accepted term for difference between angles on phases.
Offset is from a certain point, like 0 or 90 degrees.
 
3:19 PM
Do you perceive inheritance as impacting performance in a positive or negative manner? What type of performance are you referring to, memory?, execution time?, lines of code?, personal productivity?, group productivity?, code reviewer's productivity? — wwii 16 secs ago
 
3:55 PM
Hello! You might want to consider the code review site for this. Stackoverflow is limite to specific questions. — Woody Pride 38 secs ago
 
0
Q: WPF Async Filter

Fredrik LingerI'm using a SearchWaterMArkTextBox and a Gridview, where I've bind this line to my gridview. local:CustomFilterBehavior.TextBox="{Binding ElementName=SearchWatermarkTextBox}" What it does is that upon writing text in the search textbox, it adds a filter to the collection and show the result o...

 
This would probably be a better fit for Code Review, if you included the whole code (not just the loop body, and not just placeholders). — Mathieu Guindon 55 secs ago
 
4:29 PM
0
Q: Python Making Brute Froce Crack Faster

Akın Oktay ATALAYI made an Brute Force Cracker with python, but its extremely slow. How can i make it faster? import itertools import string import time def guess_password(real): chars = string.ascii_uppercase + string.digits password_length = 23 start = time.perf_counter() for guess in itertool...

 
4:40 PM
You could try refactoring your code using what Austin suggested and then try posting on Code ReviewAlex 45 secs ago
 
0
Q: Calling Live Agent API in Java

BenWould anyone like to code-review this for me? That would be pretty helpful. I haven't used the objects in the java.net.* library before, actually. This is all taking place in the run() method of a subclass of Thread. I haven't gotten a chance to run this yet, I'm still working out other issues i...

0
Q: Calling token API

DeveloperI'm calling an API to request token, and making sure i'm not leaving any corners for errors and handle the result appropriately. function Authentication() { } Authentication.prototype.requestToken = function(credentials) { var self = this; return new Promise(function(resolve, reject){ ...

 
Today I learned about AWS Snowmobile. Which has nothing to do with snow or snowmobiles.
 
It seems that this could work well on CodeReview, where you could also get help and suggestions for improvements on your code. — Victor K 41 secs ago
If you want help improving work code you should post this on CodeReview.SE. If you do decide to do so please delete the question here. — NathanOliver 39 secs ago
@VictorK: I am not aksing for a code review. I guess you are not aware of THIS? :) — Siddharth Rout 38 secs ago
 
5:01 PM
0
Q: When scraping webpage XPATH variable returns Unfinished Literal

smbridgesI am trying to scrape Amazon for ASIN Best Seller Rank and when I run the script in python it returns an unfinished literal error Everything works except for the Best Sellers Rank. I would really like to have just the for that specific row if that is possible All help is appreciated. Here is...

 
@Mast Hmmm...I'll look at changing it.
 
6:06 PM
@202_accepted I think @Vogel mentioned something along those lines already in his answer on the first question.
 
Sharing your expected results and actual results will help us narrow down what problems you are having. If you are looking for general code review and fixing, forums like gamedev.net may be more useful. — Cory B 1 min ago
 
> A phase difference is really only meaningful when comparing waveforms with the same frequency. For all other waveforms the phase difference is a function of time. I do prefer "phase difference" over "rotation", though.
 
Yes, that. And he's absolutely right. If waveforms don't have the same frequency, there's no such thing as phase difference, for it differs over time.
 
6:37 PM
0
Q: how to get char ascii value in python without using builtin functions

srikanth vattikutihow to get char ASCII value in ' python without using built-in functions ord("char") byearray("some char") byearray("some char")

 
You can attach middleware to the express application at any time, you don't have to attach it before the server starts. If the endpoint fails, maybe you should gracefully kill the application? It's not clear what your use-case calls for, but this feels more like a code review than a stack overflow question. — Jake Holzinger 56 secs ago
 
6:53 PM
0
Q: How to predict stock returns with a multivariate regression in R

KarlI’m replicating a study which was published in the journal of finance. My findings are the opposite of the paper and since I’m very new to R, I’m not sure if, I’m running the regression correctly. What I want to do: I’m trying to investigate how the soccer world championship 2018 has influenced ...

 
7:09 PM
0
Q: Simple Console Snake game C++

KaynnI recently started learning C++ and have made a very simple Console-based Snake Game, I would like to have some feedback on improvements. You might notice the obvious delay in clearing and printing of the screen, as I did not use system("cls") since it was stated as 'evil' and 'bad'. I printed a...

0
Q: Null Pointer Exception based on HashMap

user6952090I am getting a Null pointer exception despite instantiating a general HashMap with constant values. I intend to track inventory of various car types in a car rental service; with car type serving as key and num available for rent as the value. I attempted using a method createAvailable cars which...

0
Q: Practice using classes/ structs in C++; would appreciate reviews and tips to revise it

Eddie C./* 1. Write a grading program for a class with the following grading policies: a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the m...

 
7:46 PM
Consider posting in Code Review. — Jeppe 23 secs ago
 
8:28 PM
This sounds like it might be more appropriate for codereview.stackexchange.comBrandon G 46 secs ago
 
0
Q: Leetcode 3Sum problem using hashmap in python

slnFor practice, I solved Leetcode 15. 3Sum question Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. my code pass all testcase from my location but get Time Limit Exceeded from lee...

 
If all you're looking for is alternative implementations, feel free to look around on that linked site using proper tags, like this. — Mast 48 secs ago
 
8:52 PM
@Vogel612 I fixed the "exhaustive search" in getRotations.
let rec getOverlaps smallCount largeCount =
    if smallCount > largeCount then getOverlaps largeCount smallCount
    else
        let totalOverlaps = (smallCount |> float) * (largeCount |> float)
        // If the small divides into large evenly, then there are `small` coincident spokes, and we'll divide our total
        // overlap count by that number.
        if largeCount % smallCount <> 0 then totalOverlaps
        else totalOverlaps / (smallCount |> float)
So I calculate how many "overlaps" there are and use that, instead of trying to get the angle directly.
Even better version:
let inline getOverlaps count1 count2 =
    let inline calculation smallCount largeCount =
        let totalOverlaps = (smallCount |> float) * (largeCount |> float)
        // If the small divides into large evenly, then there are `small` coincident spokes, and we'll divide our total
        // overlap count by that number.
        if largeCount % smallCount <> 0 then totalOverlaps
        else totalOverlaps / (smallCount |> float)

    if count1 > count2 then calculation count2 count1
    else calculation count1 count2
That one doesn't use recursion at all.
That brings this project down to one, single rec function.
 
0
Q: Restful API echo server using python bottles

LouisI just wrote an echo server that responds to a curl requests with the method used and the data sent. sticking to GET and POST for now but i would like to know if theres something i can do to improve my RESTFUL API Im supposed to: 1. Only be able to call the /data endpoint 2. Only allow JSON p...

 
9:15 PM
If your code works and you seek constructive criticism or improvements, you should ask on Code Review. — Amy 26 secs ago
 
0
Q: Refactor multiple if statements while creating object

degathI've got a class with few fields: public class Helper { String first; String second; String third; String fourth; String fifth; String sixth; } And helper service with method which I try to refactor. public class HelperService { public Helper toRefactor(String[] a...

0
Q: Simple Mastermind in c++

COGNERi created this console application ( it's actually a Mastermind) and i would like to know what can i improve as a beginner. Thanks ! #include <iostream> #include <cstdlib> #include <time.h> std::string colorsRandomizer(); int verif(char couleur); std::string transform(char couleur); int main()...

 
boo
 
possible answer invalidation by MX372 on question by MX372: codereview.stackexchange.com/posts/213099/revisions
 
9:49 PM
@Malachi Radley?
@Duga rolled back
 
10:04 PM
sounds familiar
 
what (specifically) sounds familiar?
 
10:21 PM
0
Q: Multiple database connections class

gomdThis is my database connection class in order to handle multiple connections with the use of context managers. Brief explanation: The __init__ method reads database configurations from an INI file in order to call the connection and set two dictionaries, one for connections and one for cursors....

0
Q: Return a sorted ordering of courses such that we can finish all courses

thadeuszlayThe task: We're given a hashmap associating each courseId key with a list of courseIds values, which represents that the prerequisites of courseId are courseIds. Return a sorted ordering of courses such that we can finish all courses. Return null if there is no such ordering. ...

 
10:32 PM
We don't do well with theoretical questions here. Especially ones this vague. If your code works, then it might be better to post to Code Review instead. You will have to document it better than this. — LarsTech 38 secs ago
 
@SᴀᴍOnᴇᴌᴀ Boo Radley
I think it is a character from a book....???
 
@Malachi its from the book To Kill a Mockingbird
 
0
Q: Python Pygame treasure hunt game

J.PeggyThis is a python game that I am working on. It is a grid based treasure hunt game in which you collect coins from specific tiles (some tiles ask you questions in which you need to answer correctly in order to get coins), and after a number of moves the coins that you end up with are recorded and ...

 
I was going to say that book too. I don't think I actually read it (the whole thing)
 
10:38 PM
I believe I read it in 9th grade
 
11:14 PM
SO isn't really a great fit for questions that don't revolve around a specific/narrow problem. Code review is a job for different sites in the network (f/e Code Review, but even then, only code you wrote yourself isp ermitted there). — Charles Duffy 20 secs ago
 
11:25 PM
-1
Q: PHP database constructor

LouisIm getting started with PHP and trying to write a constructor for a DB using this piece of sample code class ComponentModel { private $database; public function __construct() { $this->database = new Database(); } } What are some improvements i could do to make this constru...

 
11:41 PM
0
Q: How to reduce a given series expression to an algebraic expression?

M. CowI need to reduce the given series expression to an algebraic expression, without summation. Then I have to express the performance of the algebraic expression in Big O Notation. I am mainly confused about the first part. I am not too sure how to interpret the series expression to an algebraic e...

0
Q: Token generator for Valve Data Format parser in Java

Nick BroderickI'm looking to parse a reduced subset of the Valve Data Format (VDF). It is similar to JSON, allowing representation of key-value collections (maps) with arbitrary recursion. As a small example: "root" { "key1" "value1" "key2" "value2" "key3" { ... } } I'm...

 
11:57 PM
0
Q: AVL height-balanced binary search Tree and Dictionary in C#

George BarwoodMostly as a learning exercise, and partly as I thought it might be useful, I have written an implementation of AVL trees ( https://en.wikipedia.org/wiki/AVL_tree ). An AVL tree is a height-balanced binary search tree, where if the height difference of the left and right sub-trees becomes more tha...

 

« first day (2110 days earlier)      last day (1908 days later) »