« first day (1721 days earlier)      last day (2300 days later) » 

12:00 AM
RELOAD! There are 4905 unanswered questions (90.2688% answered)
 
12:18 AM
-1
Q: Getting Top student and Calculating Average Score

Manaal SWe are given the Java class Student, class Randomizer, and class Classroom. We were told to fill in the method for getTopStudent and getAverageScore. Below I have included the classes for Student, Classroom, and ClassroomTester. The problem: when I run it, the compiler returns: Classroo...

 
"i feel like directly access is wrong" -- without knowing, it wouldn't even be possible to know what answer you want. And even if you could explain yourself, your question would be primarily opinion based, and likely still too broad (due to the large number of possible alternatives). Your question might be more on-topic at codereview.stackexchange.com or softwareengineering.stackexchange.com, but if you want to post at either of those sites, take care to read their introductory help, to make sure you fix your question to be well-presented and on-topic on those sites. — Peter Duniho 39 secs ago
 
12:43 AM
@PaimanSamadian: "Isn't once per task enough when the task isn't a complicated feature?" Sure. By the same token, when the task is complicated, one commit isn't enough (I commit every few minutes if things are going well). Why force one commit per task? • "Also bugs from folks can easily make their ways to the main branch" Actually not. Part of the point of a feature branch workflow is that it makes code review and testing possible before the code is merged into the main branch. — Marnen Laibow-Koser 35 secs ago
I hope that clarifies what I'm trying to accomplish. If codereview is the place to go for these kinds of questions I'll repost there immediately. Thanks! — Daniel Levenson 41 secs ago
 
1:47 AM
0
Q: Ruby Sudoku Solver Challenge

amorobertI'm writing a Sudoku solver in Ruby to complete a coding challenge with the following restrictions. Failing to follow the following restrictions will result in an invalid submission: Do not create classes, you will only be creating (many) methods. No instance variables and no glob...

0
Q: Jython using JDBC

miracle173I want to acces databases by Jython by using JDBC drivers. I started with SQLite because this needs no database installation. I found two tutorials that implement similar things in Java and in Python using the same sample database. sqlite python samples sqlite java samples I translated the ...

 
2:02 AM
0
Q: C++ Sudoku Solver

MikeI just finished up a sudoku solver in C++. I originally completed a solver in Python for coursework and I wanted to see how much of a performance gain I could get. Because of this, I ended up using compiler intrinsics for MSVC, and liberal use of arrays. It ended up being a lot faster than I expe...

 
2:45 AM
Yo @SimonForsberg you around?
 
0
Q: jQuery enable and disable button (using .prop())

nuralqamarCan you please point me in the right direction? Basically, this block of code disables the 'signup' button, unless the user has checked the box. I can disable the box easily, but I am having trouble enabling the button. Here is my code: $("#login-button").prop("disabled", true); //if c...

 
3:41 AM
0
Q: Multiple Child FXML screens in one Parent Screen in javafx

JettyCan any one help me to solve the problem with clear examples for the problem discussing in the following link JavaFX FXML/window switcher Thanks

 
4:19 AM
0
Q: Way to handle and validate general input under certain constraints in C++?

Armando H.I have been programming in C++ for less than six months, so please correct anything you can. Now, to the context... I think one of the most annoying things programmers have to deal with is validating user input. For instance, if my program says: Enter a number between 0 and 5 and the user keeps...

 
5:08 AM
Monking
 
0
Q: How do I load a sqlite database to work with in my program in Qt?

Pedro P. Camellón Q.I'm working on an application in the Qt development framework. I try to make a function that allows me to load a SQLite database file. First I check if the database is already opened. if(db.open()) db.close(); Second, I open a dialog box that allows me to select the file and use the selec...

-1
Q: C program using libcURL

ManjunathI want to ping IP addresses and grab the respond to save it if it is received within the time bound.It must be similar to command line ping.

 
5:29 AM
0
Q: Compute Mean, Variance and Standard Deviation of CSV number file

TopinFrassiI've written my first c++ application this week and I wanted to see if there's anything that aren't up to standards or better ways to do what I'm currently doing. For the goal of the exercise, let's assume I can't use any other mathematical function other than the square root. The application r...

0
Q: Delete row that are later than 4 quarters, runs too slow

BenI have a worksheet which is filled with data from Column A to G. Each row is a unique entity and Column G contains a value that shows how many quarters each data is reported late by from today. If the returned value is more 4 (that means the reported date was more than 4 quarters from today), the...

 
5:46 AM
There is nothing inherently wrong or inelegant with a loop. The only change I'd make is to remove the hard coded 25 and use Columns.Count. but when you have working code you want to improve you should post on Code Review rather than SO — chris neilsen 37 secs ago
If you need someone to review your code, you should use codereview exhchange. More importantly, you HAVE TO post your code. Otherwise, I will consider this post is just an advertisement of your site. — 蕭為元 45 secs ago
 
6:04 AM
0
Q: Stored Procedure to send an SMS

irshad jmI am working on an ASP.net project which use Stored Procedures. I am using SSMS. The project was started years ago, and there are several SP created by other developers. I need to write an SP to send an SMS, and my TL give me this SP and said this one does the same. ALTER PROCEDURE [dbo].[Se...

 
6:19 AM
0
Q: Word search generator in python

Rohit KumarI have made a word-search-generator with python3 and it works perfectly. Can you please tell me if what I have done is done in the right way? Also please hpw the code s performance wise. I have tried my best to write helpful comments. import random from copy import deepcopy def make(row,column):...

0
Q: Merge Sort algorithm using divide and conquer principle

Rahul ShivsharanI have implemented merge sort algorithm on divide and conquer principle. When I pass an array to my program, that array is divided into sub-arrays, I apply bubble sort on each of the sub-array. Now I have sorted sub array, I merge the sorted sub-arrays I do step 2 and 3, till I have an array ...

 
7:07 AM
It seems code review users are as frustrated as I am with respect to understanding what you actually want to achieve. Please, invedt your time into formulating the entire problem in mathematical terms withoutnany code. It will help you and others find an optimal solution. — Eli Korvigo 25 secs ago
 
7:20 AM
0
Q: Webpage Template: html and css

Mark MessaConsider the following html + css template for simple message posting: template.html <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="description" content="This is a webpage t...

 
Monking
 
7:53 AM
0
Q: ObjectManager - Single Instance Object managerment

DeanI have designed an objectservice for a single threaded game rpg server. It's purpose is to store the entire set of objects in a single instance shared by all connected clients. it's purpose it follows a singleton pattern but i would like some reviews on some the class as it does use alot of cpu a...

 
I'm voting to close this question as off-topic because it belongs to code review. — Yuriy 38 secs ago
 
8:31 AM
Monking
@Malachi Got mine from Dutch company. But if anyone wants one, I'll port the design to whatever format they require.
 
8:45 AM
@quartata I am now.
 
9:24 AM
This question is clearly belongs to Code Review Stack ExchangeMickaël B 17 secs ago
 
@Mods (@SimonForsberg @200_success @Jamal ) could we look into re-naming to , I posted a meta, but it never got renamed.
 
@Peilonrayz Pinning that message so that others can vote/comment on it on meta. Will also share it in The 1st Monitor (our moderator room)
 
@SimonForsberg Thanks, :) Yeah I think +4 and +3 isn't really a concensus... :(
 
9:47 AM
@Peilonrayz Indeed.
There, even wrote you an answer.
 
Question like What's the best solution? and Is there a better, faster way? might be just primarily opinion-based questions. You already listed several possible options, choose one and get your code working. If you have issues with the code, post your code and we have a look at it. If you get it working but want to know what is the best or better solution you might have to ask that over at https://codereview.stackexchange.comNope 42 secs ago
 
10:16 AM
0
Q: Project Euler #196: Prime triplets

msaroraI gave a hackerrank challenge Project Euler #196 using python3 platform. My code ran successfully for 6 test cases out of 20. For rest 14, it showed timeout error which is not a functionality bug but because it takes more time in execution than given time constraint. I tried many times but i am n...

 
If you have working code that you want to improve you should consider to post such questions on codereview.stackexchange.com instead. — Mike Scotty 53 secs ago
If you have to ask someone else to figure that out, then it probably isn't. Also, this is way too much code. I'm not sure what you're expecting from an answer, but this would be better suited to codereview.stackexchange.comcᴏʟᴅsᴘᴇᴇᴅ 40 secs ago
 
10:33 AM
0
Q: Proper way to use Parallel.For inside callback function in C#

Ravi JoshiI am getting the huge amount of data from a sensor. In order to speed up data processing, I thought of using Parallel.For. Below is the sample code: object sync = new object(); private List<byte> container = new List<byte>(); private void OnDataArrived(object sendor, DataArrivedEventArgs e) { ...

 
I think the suggestion by @skrx to post your code on codereview is quite a good one. Apart from that, just keep programming. The skills come with the experience. Every now and then, have a look at the code you have written and spend some time thinking how to improve it. Oh, and reading questions and answers on StackOverflow helps a lot -- that's why I'm around :) — Thomas Kühn 55 secs ago
 
10:58 AM
0
Q: OK to ask same question using a different account

Mark FitzgeraldIs it OK for a user to post a question, receive an answer and then repost the question using a different account? Delete row that are later than 4 quarters, runs too slow was asked yesterday by user 158322. Code deletes unique entity that reports data later than 4 quarters, runs too slow was po...

 
11:18 AM
stackexchange has a code review forum. You should have posted there... — Leonardo Alves Machado 1 min ago
 
12:05 PM
0
Q: Difficulty with my registration form which doesn't display my message

HasanEi have tried to make a register form like the one used in this video https://www.youtube.com/watch?v=iSLm4NlMkvo&t . i am up to the part where he echoed "hi from php" about 9:29 in the video. but when i try to do that the message doesnt show like his. where am i going wrong? $(document).read...

 
@CaptainObvious broken
 
12:20 PM
0
Q: A C++ program that copies a specific content from a file

Cally BtlnThis is a small parser that prompts user for a file to work with and then asks them to enter a key word to look for. If the line in the file contains the key, it copies the line to the new file and removes it from the old one: 1 #include <iostream> 2 #include <fstream> 3 #include <sstream>...

 
12:40 PM
0
Q: Detect loop exist in Linked List(Floyd cycle finding algorithm)

coderI have written this code Floyd Cycle finding algorithm. The methods I have used are createLoop() , doesLoopExist(), lengthOfLoop() and insert(). I want to optimise this code and improve using advanced C++. #include <iostream> template <class T> class LinkedList { struct Node { T data; ...

0
Q: String conversion and stream insertion of std::ratio and std::chrono::duration

NullI've developed a set of functions to convert a std::ratio or std::chrono::duration to a std::string or insert it into a std::ostream using operator<<. They are intended to be part of a larger library of conversion functions so I've included a few additional functions in the library for demonstrat...

0
Q: Prime Generator - SPOJ

Charan Kumar I have written the code for prime generator using the Sieve of Eratosthenes. It works perfectly when I run it on Ideone with small ranges. While running it on SPOJ I get SEGSEV error. I know that the algorithm works for numbers upto a million. So I declared an array of million elements. Is that t...

 
possible answer invalidation by Ljdhameliya on question by Ljdhameliya: codereview.stackexchange.com/posts/185303/revisions
 
1
Q: Common Implementation for Sending mail based on time

LjdhameliyaI have created one Background service that execute after every 5 minutes and this service used for sending email after 6 hour,24 hour and 48 hour for user booking order is not confirmed. for that i have created below method and enums. public enum Enum_AbandonedCartEmailNotifyHour { ...

 
This question doesn't really seem to have a specific programming problem here (save for code improvements). So, I think this question could be a better fit over at Code Review. — Sean Francis N. Ballais 32 secs ago
 
12:55 PM
0
Q: Passing Array from Function to Main

user158430I'm troubleshooting this program that does some calculus functions on a range of values. The error I'm getting is in the function call in main that "array subscript is not an integer" so I'm not sure how to properly correct the syntax. #define NMAX 1000 void program_intro(void); double base_pol...

 
@CaptainObvious broken
 
1:11 PM
0
Q: Merge sort a given list in python

Latika Agarwal Problem : Implement merge sort in python. Don’t use Python’s built in sort or sorted. Assume your inputs will be sufficient for the memory you have. Below is the code : def merge_sort(list_sort): """splits the list in two parts until each part is left with one member""" if...

 
Better fit for Code Review. — user8371915 just now
 
1:40 PM
possible answer invalidation by Sxntk on question by Sxntk: codereview.stackexchange.com/posts/185428/revisions
 
@Duga its ok
 
2:29 PM
Monking
First of all, I would like to thank you for the time reading my post and the detailed answer. Actually, your answer is really helpful, but what I did not clearly mention is that the Data class is not a simple Pojo, but a quite more complicated class with dependencies, etc. from which String, Integer are extracted (and I can't change this class as it's a third party) — Rouliboy 6 hours ago
^^ guess that's what I get for answering a stub-code question ...
 
0
Q: Laravel: How to short code of my function?

OtabekI have Helper class in my project. I have different two tables and I wrote sample function for get all needed details user by id. Code of function: public static function user($id){ $data = ['id' => null, 'role' => null, 'name' => null, 'email' => null, 'photo' => null, 'user_id' => null]; ...

 
3:14 PM
@SimonForsberg Well you weren't pingable in Duga's room so I thought I'd mention it here instead. We (Charcoal) are beginning work on something you might find useful for Duga: github.com/Charcoal-SE/inferno/blob/master/README.md
You could split up Duga into two AWS lambdas -- one for the GitHub webhook, and one for processing comments
 
@Peilonrayz How's this?
5
Q: Can we constrict the [python-2.*] tags?

PeilonrayzI would like to suggest the following: Rename python-2.7 -> python-2.x Synonymize python-2.6 -> python-2.x This is as we don't have individual Python 3 tags, such as python-3.6. But we do however have version tags for Python 2, such as python-2.7. These version tags however don't incorporate ...

 
I have now voted to close because of example code. Two comments from you that this isn't your real actual code is reason enough. — Heslacher 13 secs ago
 
@quartata Duga does quite a bit more than just that...
Duga also has scheduled jobs (like RELOAD) which accesses a database of the github hook data
and she also classifies referral comments for multiple sites differently...
 
All of that is possible
And the answer invalidation checker -- you'd subscribe to both edits and comments
 
3:36 PM
1
Q: Custom ostream for a println-like function

IllidanS4I am writing a plugin in C++ that uses C API that gives me a single logging function with this signature: typedef void(*println_t)(const char* text); I want to wrap this type of a function in a nice ostream to use all C++ formatting features. Having read it is best to use streambuf for this, I...

 
3:57 PM
0
Q: Generic fixed-size Stack implementation in C

galah92Coming mostly from C#/Java background, I'm trying to implement a simple fixed-size stack data structure in C. The main concern about the "fixed-size" part is that pushing new elements to a full stack will make the stack remove the bottom-most element in it, keeping it with a maximum capacity. I ...

 
possible answer invalidation by Ravi Joshi on question by Ravi Joshi: codereview.stackexchange.com/posts/185466/revisions
 
4:14 PM
0
Q: Python 3 PriorityDeque with absolute priorities

catPython 3 has queue.PriorityQueue, but that wasn't good enough (methods and not double-ended) for me and my purposes. Therefore, I have made a new one based on a dictionary of collection.deques. I am well aware that this is a naive implementation, because it uses 5 times as many collections.deque...

 
Da,mmi.t My mind literally hallucinated the with. Good code review, bro! — Theodore R. Smith 40 secs ago
 
4:30 PM
0
Q: It is good practice to return references to an array or modify the array itself

Miguel-DavidI have an array of products and I want to lower those that are more expensive than 200 €. If I make a method that gets a new array with references to the original I can modify it, also modifying the original. Would it be the correct way to proceed? This is Product class: public class Product { ...

 
4:46 PM
@Liam I'm doing a code review of essentially the above code. I want to make sure it's "safe" in the absence of the "return false." — awgtek 33 secs ago
 
Monking
 
5:01 PM
0
Q: How to use IServiceScopeFactory without implementing the Service Locator Pattern?

Christian GollhardtI want to use IServiceScopeProvider in a way, which is not the Service Locator anti-pattern. Therefore I thought about making a generic one, which supports explictily only the given service. I have made this interfaces: public interface IServiceScopeFactory<T> where T : class { IServiceScope<

0
Q: how to make program more efficient with python3/flask?

davidjbeilerCode works great, but takes 1-2 minutes to load, hence creating the database file everytime someone visits the page, anyway i can make it so that this doesn't occur? import sqlite3, os, warnings, pandas as pd, os.path, time from flask import Flask, g, render_template from contextlib import closi...

0
Q: Handling CRUD in Repository/ServiceLayer pattern

Ish ThomasI'm a little bit confused about separation between Repository Layer (Data) and Service Layer (Business). Specially if when I'm thinking about the simple CRUD functions. In my WCF Service's service method (so basically the "end client") I should call only Business layer, but then I would have to g...

 
@Hosch250 Looks good, thanks, :)
 
5:20 PM
0
Q: iterate a list from last to first and print out current and next element

jacobcan118I have seems simple question but I do not see a better way to not calcuating the index I have a list like a and I would like to iternat from last element to first element and print out next element of current iterated element.like a = ['a', 'b', 'c', 'd'] for i, d in enumerate(a[::-1]): prin...

 
5:32 PM
Ask (maybe; check their guidelines) on codereview.stackexchange.com. — chepner 25 secs ago
 
LOL.
 
@CommitStrip If you fail all those, you're stuck in 2002.
 
5:51 PM
0
Q: Simple Tic-Tac-Toe with Minimax Algorithm - follow up

MORTALBased on previous question i implemented most of suggestions. also, i have added Alpha-Beta pruning to minimize the calls. and making the game more generic to accept the board to be any value like 4x4 or 5x5 etc, every thing looks working fine for 3x3 board but it becomes so slow if i choose the ...

 
@CaptainObvious Tic-tac-toe slow on 4x4 board with pruning?
Hmm, how deep are you looking?
 
6:07 PM
Working code should be posted on: codereview.stackexchange.comRichard Critten 50 secs ago
 
6:40 PM
possible answer invalidation by TopinFrassi on question by TopinFrassi: codereview.stackexchange.com/posts/185450/revisions
 
7:01 PM
0
Q: Python LED Memory Game

Omar RI am new in python, and for my final, I have decided to create a LED based memory game. The problem is, my mechanism for detecting to see if you've messed up isn't working and faulty. Below is my code. G,R,Y stand for different color LEDs. Buzz and alert stand for the components that activate wh...

 
Decided to bite the bullet and reinstalled Windows, now hoping it survives to the updates
 
7:28 PM
I'm voting to close this question as off-topic because this kind of question belongs on codereview.stackexchange.comlurker 35 secs ago
@lurker I am pretty sure codereview would disagree. — Antti Haapala 36 secs ago
@AnttiHaapala this is a request for optimization for (ostensibly) working code. Isn't that a code review concern? — lurker 39 secs ago
 
0
Q: Input an amount of money and get the change

Jallous55I am trying to get as an output the number of 10 dollar bills, 5 dollar bills, dollars, quarters, dimes, nickels, and pennies. This is what i wrote, maybe i made it too complicated when it's easy, but this is the only way i could get this done. i have a problem with the pennies part and i explain...

 
"the program is exceeding the time limit" smells of a CodeChef or HackerRank etc problem. Please understand that the real question isn't how to solve it - that can be easy - but how to find a smart way to solve it efficiently. Step 1, write the brute force solution that solves the sample input. This gives you a feel for the problem. Step 2, find a cute way. That is the problem which is posed for you to solve. I too disagree that this a problem for CodeReview: it is a challenge for you to solve. — Weather Vane 15 secs ago
 
7:50 PM
0
Q: JAVA: changing object attribute without knowing the attribute nor the method (Reflection)

user2962142We have a class with 10 attributes (longs, Strings) the following method should change any attribute to any value of an object specified by the client, it mimics the SQL update statement "Update Users Set username = 'newValue' where id = 5" the user will provide the 4 variables "id =5" to find ...

 
I'm voting to close this question as off-topic because code that works, but you want a code review on, should go to code review stackexchange. Stackoverflow is for specific programming questions. — scrappedcola 1 min ago
possible answer invalidation by 200_success on question by Latika Agarwal: codereview.stackexchange.com/posts/185481/revisions
 
8:09 PM
0
Q: Sublime Text plugin to modify text before its pasted

MattIt's my first plugin and it's super simple but there could easily be somethings worth knowing from this e.g. python coding practices, potential bugs import sublime import sublime_plugin class EscapeAndPasteCommand(sublime_plugin.TextCommand): def run(self, edit, **kwargs): # Get the...

 
I created but its really about the plugins so I am not sure what the tag should be if not
 
seems okay, tbh.
just make clear in the tag-wiki that the tag isn't about sublime-text as the program you use, but as the platform you're on
 
Almost got caught again by that stupid 30 min sleep thing Windows has by default
 
8:30 PM
Close this question as pseudocode?
1
Q: Syntax for a simple scripting language

JamesMacI'm creating a small simple scripting language for fun and as a learning exercise. For the first iteration I want it to be very simple: C-style syntax Functions are defined globally as in C, no passing functions around (yet) The interpreter calls the "main" function (if it finds one) String an...

 
@200_success no.
 
You want to consider BNF to be a valid language for Code Review?
 
8:44 PM
sure. Why not? It's just a better regex with a narrowly defined feature set
 
0
Q: Is a BNF grammar for a language acceptable for review as concrete code?

200_successSyntax for a simple scripting language is a question asking for a review of a grammar of a C-like language. The grammar specification isn't an input for any specific parser generator tool: I wrote this grammar myself just as a reference while working on the interpreter, as I wrote the parser...

Note that we require regex and database-schema questions to be concrete, not conceptual.
 
0
Q: Is a BNF grammar for a language acceptable for review as concrete code?

200_successSyntax for a simple scripting language is a question asking for a review of a grammar of a C-like language. The grammar specification isn't an input for any specific parser generator tool: I wrote this grammar myself just as a reference while working on the interpreter, as I wrote the parser...

 
@200_success Exactly, and I'm not sure this is concrete enough. Hard to test though. Open to suggestions specifically about whether this is concrete enough or too deep into the grey area.
 
I agree with @SeanFrancisN.Ballais but when I tried to vote to close and migrate it, Code Review was not among the options given. Not sure how to proceed so I'm skipping. — Elise van Looij 14 secs ago
 
8:59 PM
@Mast I'm willing to concede that this particular question is peculiar and we might want to require it to adhere to standard EBNF
 
0
Q: Trying to create a jquery version of create-react-app

jtlindseyI'm not a front end developer so I'm probably the wrong person to by trying to solve this problem. I frequently need to do front-end work to start client apps for api projects and lose so much time fighting with different template engines and trying to rebuild large dependencies like jquery data-...

 
9:19 PM
+1 for mentioning that the Comparator contract is broken down into three parts, each of which is independently testable by unit test. After a couple of complex failures, my team has has good luck with requiring such tests for every new Comparator as part of code review. (We've let simple Java 8 Comparators slide, but I've still written tests to make sure I'm really comparing what I want to.) — Matt Leidholm 39 secs ago
 
9:48 PM
I believe this question would be better asked at codereview. — zett42 8 secs ago
 
0
Q: Simple Number Game with AI

internet_userI have created a simple game and AI in Python. Rules of the game: There are 11 spaces for digits, 9 that are used and 2 that are discarded On each turn, a digit (0 - 9) is chosen and placed in a space. When all spaces are filled, the number formed by the concatenation of all used spaces is the...

 
10:26 PM
@Peilonrayz I don't think that there is enough feedback / consensus to merge the Python-2.x tags.
 
11:09 PM
Upvoting this as I admire it's ingenuity and taught me something I didn't consider or think was possible. But from a maintainability standpoint if you asked me to code review this, it's no way I would approve it. — ColdSolstice 47 secs ago
@Soner Just a note: If you make a short Python program to solve this problem, and ask on Code Review whether it is Pythonic, that might meet with their guidelines. (You can check their FAQ). But give up on finding any most Pythonic way to do things. Past a certain point, it's simply up to personal taste, or design requirements. — jpaugh 23 secs ago
 
0
Q: Python newbie making a continuous Queue with Delay support

Bryan DavisI'm new to programming in python, and I have a task to try and create continuous Queue but with Delay support. I haven't added the threading or sharing the data q across threads yet but I still need the functionality for managing the delay. With the examples I've seen using the queue class direc...

 

« first day (1721 days earlier)      last day (2300 days later) »