« first day (1876 days earlier)      last day (2143 days later) » 

12:00 AM
RELOAD! There are 5383 unanswered questions (89.9773% answered)
 
 
1 hour later…
1:13 AM
consider codereview.stackexchange.com for working code you would like feedback on — avigil 54 secs ago
 
2:08 AM
This seems very broad / opinionated. You might do better on codereview.stackexchange.com. — Script47 51 secs ago
Code Review (remember to read help before asking) — user202729 1 min ago
 
2:26 AM
-1
Q: Code design - State pattern or something different?

Michael WadeI am working on a crypto-finance trade manager. The process starts with a Plan, where currency, capital, entry, exit and stop-loss properties are set. Once this is done, the Plan is executed and becomes a Open_Position. At this point, none of the variables can be changed, the object is simply wat...

 
possible answer invalidation by Hooman on question by Hooman: codereview.stackexchange.com/posts/197024/revisions
 
2:42 AM
0
Q: Personal Website Design

Josh CorbettHi there, I just recently gave my personal site a big design overhaul. I had originally made myself large websites for little content, which later began to make no sense for me. After many different designs and mockups, I finally settled on a very straight-forward page that explains who I am and...

 
2:55 AM
possible answer invalidation by Hooman on question by Hooman: codereview.stackexchange.com/posts/197024/revisions
 
0
Q: PHP Application layers

jcruzI'm dealing with design layers of an application. Basically what I've so far are: Business Architecture: Client-Server Techonologies: PHP+MySQL, HTML5, JS, 3rd parties APIs My app Data Sources: MySql databases, 3rd party APIs Data Layer: Interface with CRUD operations, PDO for accessing DB...

0
Q: mysql select between MAX-n1 AND MAX-n2

Mohsen NewtoaI need to select data between 2 values from a table by using MAX because each SID has different VID, my table has over 6000 rows when i use the below code it works for small quantities. My code: $sql = mysqli_query($con, "SELECT * FROM `tests` WHERE `VID` BETWEEN (SELECT MAX(`VID`) FROM `tests`...

0
Q: Ising Model Tree Interview Assignment

aleksiy123An Ising spin model can be thought of as a graph with nodes and edges, in which each node has a spin which can be positive (+1) or negative (-1). The nodes have weights given by a vector and the edges have weights given by an upper triangular matrix ; weights can be positive, negative, or zero. T...

 
3:17 AM
0
Q: CodeKata 02 in C++

FromTheStackAndBackAs before, I am moving into C++ and would like to learn about its idioms. I have moved from Project Euler to CodeKata as the former is based on algorithms, rather than language constructs. Description (slightly modified): Write a binary search method that takes an integer search target and a...

 
3:29 AM
@CaptainObvious @Jamal I think that the question was improperly closed due to poor wording. I have edited the question.
 
 
1 hour later…
4:36 AM
@200_success A single line of code, and yet so many things wrong -- hope it gets reopened
 
0
Q: C# counting highlighted text

Lhagva Suren{ if (rtb.Text == string.Empty) MessageBox.Show("ta text oruulaagui baina!"); } if (txt_search.Text != "") { for (int i = 0; i < rtb.TextLength; i++) { int s = 1; rtb.Find(txt_search.Text...

 
@200_success, So I am the first name on that close. I have looked at your edit, and I am still puzzled as to why you think that this is on topic. Would love some more explanation.
 
Works on a small case.
 
@StephenRauch This seems like a type of case, it doesn't look like it's broken, it just takes a very long time, or the server times it out
One could possibly make a case for "unclear" since the OP didn't provide much information about the SQL database structure/indexes, but broken/not written I think is an incorrect close reason
Hey @200_success I just noticed you're not RO here, would you like to be added?
 
5:00 AM
Sure, wouldn't hurt. But then again, I'm not a particularly chatty person.
 
Thanks.
 
np
I think that OP would benefit from learning about stored procs, they are also duplicating MAX() calls which are expensive
 
5:19 AM
0
Q: How to efficiently Find the smartest set from an array of number

codaholicIs there any way to make this program run in better time because while running it is taking 1 second for the sample test case to pass and 5-10 seconds for the rest of the test cases. Please find below the explained problem Problem statement A smart-set is a set of distinct numbers in which all...

 
 
1 hour later…
6:20 AM
What is you actual question? Please remember that Code Review is our sibling site for reviewing and optimization of working code. — Klaus D. 1 min ago
 
6:40 AM
The question should have been posted at StackExchange CodeReviews (I did not downvote, but I would have supported it). I know examples where functional programming is less readable than imperative, but this example is just poorly coded. Not only the method validateFileFunctionally but also the call (if it was called with functions in mind, it would not look this way). — CoronA 24 secs ago
 
0
Q: How to substitute variable in python's subprocess call

PanduI need this bash command to be run through variable substitution in python's subprocess call. And also server.txt file has list of server name, this script has to run on multiple servers and execute subprocess call command using for loop and output should be redirected to a file as in the bash co...

 
7:15 AM
0
Q: Classical Single Pivot QuickSort implementation in Java using Generics

NatarajI have coded the following quick sort implementation. There are few things that still makes this code ugly and redundant. 1. Handling Arrays of Primitives I have to write a separate implementation of QuickSort to handle each of the 7 primitive types. Is there a way, this could be done in a much ...

 
Monking
 
7:49 AM
0
Q: Truffle Javascript test in Mocha framework

feritThis is a Truffle test written in Javascript using Mocha test framework. It tests my Solidity smart contract ArbitrableBlacklist. To be able to test an internal function, I inherited ArbitrableBlacklist from ExposedArbitrableBlacklist and used that contract instead. I would like to hear your comm...

 
8:06 AM
0
Q: improvising java functional and imperative code

Rohit JainI have created 2 functions below "validateFileFunctionally" and "validateFileRegularly" which perform same validations. First works in a functional way using predicates(we can assume Suppliers, Consumers also in here) while the second one works in imperative java ways. It will be great if you can...

 
8:38 AM
0
Q: New to C programming. How to get feedback

Eric BelangerI have written some generic code that I have a specific need for. It is for an embedded system and once it is debugged and working no one will likely ever see it. I would like to know if it is any good and if it is something I could present to someone and not be embarrassed. I have created a Git...

 
8:53 AM
I don't even see the real benefit of the refactor. You might want to post this to the Code Review site. — Tim Biegeleisen 51 secs ago
 
9:12 AM
1
Q: Largest Rectangle in Histogram in Rust

Iggy MWhilst learning Rust I am solving different algorithm problems. Below is a solution to largest rectangle in histogram. Algorithm is well described here: https://stackoverflow.com/questions/4311694/maximize-the-rectangular-area-under-histogram Although code below does the job it is very verbose (...

 
 
1 hour later…
10:21 AM
Monking
 
10:34 AM
@202_accepted Caused in part by potential customers not being able to make up their mind. The Netherlands for example. If everyone was as hesitant on that case as the Dutch were it's no surprise it took forever to build and ran way over budget.
 
o/
Monking
 
Monking Kat
 
11:30 AM
@RohitJain: Your design is that you have a service that throws an exception. One way to make it functional would be to have a stream of files, filtering out the invalid ones (or transforming them to error objects and handling them afterwards). One indicator that you are not truely functional is that the methods validateXXX do not return anything. That means they rely on side effects. Post your example on StackExchange Code Reviews if you want to know how to do it better. — CoronA 23 secs ago
 
11:41 AM
0
Q: PHP Design Layers

jcruzI'm dealing with design layers of an application. Basically what I've so far are: Business requirements Architecture: Client-Server Techonologies: PHP+MySQL, HTML5, JS, 3rd parties APIs My app Data Sources: MySql databases, 3rd party APIs Data Layer: Interface with CRUD operations, PDO for ...

 
12:31 PM
-1
Q: Mergesort in Python optimization

Michael DI am currently writing mergesort in Python and have implemented it to work. I have noticed, though, that it is very slow compared to the standard sorted() method. I understand it will always be faster but I am open to suggestions in terms of optimization. def merge(left,right): sortedArray=[] l_...

-1
Q: frequency of repeated word in text file using regex

Rishu Map<String, Integer> wordMap = new HashMap<>(); try (FileInputStream fis = new FileInputStream(fileName); DataInputStream dis = new DataInputStream(fis); BufferedReader br = new BufferedReader(new InputStreamReader(dis))) { // words are separated by whitesp...

 
Hi! Please post review questions to Code Review. Per the Help Centre/FAQ/etc, this is not the place for that. — Lightness Races in Orbit 45 secs ago
 
12:47 PM
0
Q: Stack implementation in C

java-develI have to solve an exercise from ANSI C book: Add the commands to print the top elements of the stack without popping, to duplicate it, and to swap the top two elements. Add a command to clear the stack. Here is my implementation in RPN Calculator: #include <ctype.h> #include <stdio.h>...

 
1:05 PM
Monking
 
Monking
 
1:21 PM
0
Q: New to coding. Testing out a program that calculates the days left in the month:

Thomas MargraffI'm new to coding c++ and I want to get some insight on my progress. Can you guys take a look at my program and give me some feedback on it? #include <iostream> using namespace std; int main(){ int day{}; int monthNum{}; cout << "Calculate how many days are left in the month. \nPlease enter t...

 
1:56 PM
-2
Q: How to change the class of div on click of icon?

Tajuddin<div id="rmenu"> <i class="fas fa-bars"style="font-size:24px"></i> </div> </div> <div class="whole" > <a href="#">a</a> <a href="#">a</a> <a href="#">a</a> <a href="#">a</a> <a href="#">a</a> <a href="#">a</a> <a href="#">a</a> <...

 
@Phrancis That's not bad really, means it got at least foot on the ground on CR.
 
 
3 hours later…
5:06 PM
remonking
 
0
Q: How to print possible moves of Knight in chess board

user172503I need to show possible Knight moves in chess board after Knight coordinate is entered, however cannot figure out how to do so, code I've currently have: import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Welcome to chess boa...

 
5:43 PM
@HansPassant I am surprised that you don't have a [Code Review](codereview.stackexchange.com) profile. — TinMan 7 secs ago
possible answer invalidation by coder on question by coder: codereview.stackexchange.com/posts/197076/revisions
 
6:20 PM
0
Q: How to bind values from DatagridView to Item list in C#?

TatsuI am doing a Knapsack application in C#. I have an excel file where I have a list of products, price, quantity and from which I populate my datagridview2. When it is populated, I have a TextBox where I choose any amount, and then according to this amount the datagridview1 is populated with produ...

 
6:58 PM
On the note of templates, when Class template arguments arrives, writing compile-time parsers will be much easier, thus allowing fmtlib to outperform std::printf and be type safe at the same time! IIRC there is rust and python syntax for it coming too
 
7:09 PM
0
Q: Create a dictionary which saves its data to file

Gregory RutTask: The task requires creating a class (say, ConfigDict) which inherits from the dict class. It is supposed to save its keys and values in a file. If a file does not exist, the instance of ConfigDict should be able to create it. Examples: For instance, the following code: fh=open("config.t...

 
7:27 PM
1
Q: Check whether an integer's leftmost bits are ones in Rust

little-dudeI'm trying to validate if an integer represents a valid IPv6 mask, which boils down to checking if all the left-most bits of an u128 are 1s, and all the right-most bits are 0s. For instance: 0 is valid 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff is valid 0xffff_ffff_ffff_ffff_0000_0000_0000_0000 ...

 
7:43 PM
0
Q: Finding n-distance neighbors in a hexagonal grid

tsornIn a grid of hexagons, we often want to find the neighbors of a cell with distance n. In the image below we have a rhombus-shaped grid of hexagons with an axial coordinate system showing the cell (row, col) = (3,3) (dark gray), its 1-distance neighbors (medium gray) and its 2-distance neighbors (...

 
8:33 PM
0
Q: Displaying JavaScript object's structure on page with HTML

IvanI wanted to reproduce the type of navigation system found in the console of Firefox and Chrome: you can explore an object's properties by unfolding boxes: So I'm searching to: display all of the object's properties (even if they're nested) being able to fold/unfold the properties if themselv...

 
9:06 PM
0
Q: Firebase Plotter for Ionic

WooWapDaBugI've written this plotter for Ionic in typescript to plot data that I push to a firebase list. I'm new to typescript so I'm interested in all kinds of feedback, specially on the style. First I've created a database provider that I use to retrive the data for the charts from firebase: import { I...

 
9:35 PM
possible answer invalidation by Gregory Rut on question by Gregory Rut: codereview.stackexchange.com/posts/197129/revisions
 
-1
Q: Its a scanner pen that connects to a desktop application that writes everything on MS Word as soon as its scanned. Can you help me with the code?

Emilypublic partial class PrintApiService : ServiceBase { private HttpSelfHostServer _server; private readonly HttpSelfHostConfiguration _config; public const string ServiceAddress = "http://localhost:599"; public PrintApiService() { InitializeComponent(); _config = new HttpSelfHostCon...

 
9:59 PM
@CaptainObvious Code dump.
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. At the moment, I don't have the foggiest what your question is. Did you read the help center? — Mast 17 secs ago
 
10:13 PM
0
Q: Generic Double Linked List Follow Up Part 2

SnorrlaxxxI made a post that follows from this one here. I believe I fixed most of the problems that people answered in my previous posts. Here is the revised code. I would like to know if theres anything additionally I am doing wrong or should improve. Here is the header file for the double linked list:...

0
Q: Calendar for any given month/year (C++ Console application)

L_JThis is one of my first C++ training project where I created the console application which displays the calendar of any given month. I observed how offset of days (empty places on the calendar) changed year by year and build the empirical formula on it. For the starting point (the fixed year) I ...

 
10:30 PM
0
Q: Print to console.log in specified script order

MariusI have the following nodejs code: #! /usr/bin/env node const si = require('systeminformation'); function detectAvailableHW() { si.baseboard(function(data) { console.log('Platform: ' + data.manufacturer + ' ' + data.model + ' ' + data.version ); }); console.log('======================...

 
 
1 hour later…
11:58 PM
@Omnifarious I think the right place for your question is: codereview.stackexchange.com :) — eyllanesc 22 secs ago
 

« first day (1876 days earlier)      last day (2143 days later) »