« first day (1817 days earlier)      last day (2207 days later) » 

12:00 AM
RELOAD! There are 5253 unanswered questions (90.0004% answered)
 
@Phrancis yeah I wasn't immediately familiar with the task by number but a quick search led me to it...
 
Hey
 
12:16 AM
\o
 
Monking @bruglesco
 
@Phrancis Monking
 
TTQWFTD
 
G'night
 
 
1 hour later…
1:26 AM
Never heard of codereview. I'll definitely be checking it out. Thank you though! — Josh Garza 45 secs ago
 
1:36 AM
0
Q: Macao, a General Game Playing AI library - Game state goes in, best move comes out

neoflashI'm working on a simple General Game Playing AI library. The idea is that it should work with almost any kind of game, with a minimum of configuration. At the moment, I have it working on 2 player turn based games like Tic-Tac-Toe, Connect 4 and chess. And it works quite well. It uses the Monte C...

 
2:15 AM
My suggestion would be to create a Minimal, Complete, and Verifiable example and take it to codereview.stackexchange.com . — Jive Dadson 48 secs ago
@JiveDadson, is there no answer to why CPU usage is clamped to zero, despite the loop is still running? Also, thanks for the pointer to "codereview", I didn't know that exists. Cool. — Ryuu 5 secs ago
 
 
3:19 AM
0
Q: htop showing 0% cpu usage for threads with sleep

RyuuCompiler: GCC Platform: Linux, RHEL7 I have a simple program with a background thread that simply draws a spinning "busy circle", at a rate of 200ms per update: while (true) { this_thread::sleep_for(/*200ms*/); // Draw spinning circle with 6 images, rotating. } htop and top always ...

 
3:38 AM
0
Q: What is the time complexity of this priorityQueue destructor?

Josh GarzaI'm not sure if the time complexity is O(n) or O(n^2). Can someone please clarify? I want to say its O(n^2) because of the traversal in the destructor and the traversal in findMin(). findMin basically just traverses the doubly linked list and finds and returns the minimum value. ~priorityQueue(...

 
@Jamal Why did you edit the title instead of closing the question?
-1
Q: Jumps of a pawn - Java interview

WesternGunI have just attended a code test of some code testing site, and I think one question seems easy but I didn't get a high correctness (57%), so if anyone can review this code snippet, I would appreciate it. In summary: Given an array A, with dimension N, 1<=N<=100000, A[N] within range of [-10000...

 
3:55 AM
hey
 
4:19 AM
Monking
 
4:41 AM
Monking
 
 
2 hours later…
6:59 AM
0
Q: Custom task timer

AJDThis code (Windows Forms) shows a series of timers so that the user can manually time a series of tasks. I decided to put this together today because next weekend I want to go through an activity (about 4-5 distinct tasks) and see how long it takes. The main window is where all the action takes...

 
Monking
 
7:10 AM
 
@Duga handled
 
@Klaus the question would be closed as off-topic on codereview because the code isn't working like intended. — Heslacher 28 secs ago
 
7:34 AM
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comSteve 40 secs ago
 
7:54 AM
Stack overflow is for broken code you can ask this question in code review or else paste some code! — Raaj Nadar 55 secs ago
 
8:20 AM
0
Q: Enhance the DFS for shortest path to capture all possible answer

Smith LoThis code were copied from Graph-theoretic model chapter from MIT OpenCourseWare. It is about finding the shortest path by using depth-first search (DFS). The node model has been changed to diagram below (the direction is only top to bottom e.g. A->B, A->C, A->D and so on): A / | \ B C D ...

0
Q: Stack implementation using a linked list in C++

codewriterI've implemented a stack using a singly linked list and would like to know if there are any things I could improve on. Thank you! StackList.h: #ifndef STACKLIST_H #define STACKLIST_H #include <iostream> class Node { public: Node() : data(0), next(nullptr) {} Node(int theData, Node *ne...

 
@CaptainObvious Hmmm... "This code were copied from Graph-theoretic model chapter from MIT OpenCourseWare" and "Well, I do not sure my logic is correct or not? Could anyone help me please?" seem conflicting... :/
 
8:38 AM
0
Q: Seat reservations task - Is there a more elegant way than my use of includes - beginner

fatspannerI'm looking for a bit of advice on improving my solution I submitted for a codility test. Overall I'm pretty happy with it but i think I can improve especially with my use of includes. Here's the task *"You are processing plane seat reservations. The plane has N rows of seats, numbered from 1 t...

 
@Malachi I'm interested, you voted to keep this question open, howcome?
 
9:19 AM
"Syntactic sugar"? It doesn't matter. Sorry for being judgmental, but two things matter most - (a) compiled code size, and (b) readability of said code. If 5 lines can be whittled down to 3 - or blown up to 50 while taking the same amount of memory space, then - again - code readability is all you should care about, white space and line count included. (BTW, this type of question belongs in code review (codereview.stackexchange.com( not here. — dfd 1 min ago
@dfd: It depends on what you ask. “Can I assign a closure to the property observer* is not a code review question. “How can I write this shorter/better/...” might be, but would probably at the borderline of "stub code", code review requires concrete working projects. — Martin R just now
 
0
Q: Bubble sort code in Python not working as expected

AmarjaI need some help. I have written the below bubble sort code in Python. Its pretty simple. But it does not work for all cases as expected. I am trying to understand why but cannot. Please help. I am trying to sort a list with the below values. I tried both these lists as input but none worked. num...

 
9:43 AM
0
Q: Compute a 2D array with Cython

BrenllaI am trying to compute a 2D array with Cython. The pure numpy solution that I got is fairly fast, but I still would like better performance. My current Cython code is only 15% faster. This is the *.pyx file I wrote. I am using Microsoft Visual C++ Compiler for Python 2.7 #cython: boundscheck=Fal...

2
Q: Reducing re-reading of Sass files for tracking dependencies

Oliver ScholzThis is a revision of the code posted here. It's a Makefile that I want to use for compiling Sass files to CSS in web projects. For this, I typically have two folders css and scss in a theme's top level directory. The full Makefile has other duties, too, like optimizing images and needs to be ru...

 
@RaajNadar Questions without code are off-topic on Code Review. — Zeta 53 secs ago
You might drop the file chooser and use the tree to browse for files. See the File Browser GUI for a start. — Andrew Thompson 44 secs ago
 
9:59 AM
Monking
 
1
Q: Python: Which I/O strategy suits better on lower-spec device for uploading tasks?

Rex LowMy program intends to capture video streams (in mjpeg) with OpenCV and upload the captured frames into Google Cloud Storage for later processing. I am expecting to capture ~15-20 frames per second and expected to upload nearly all frames within a second. The trick is, the script is running on Ra...

0
Q: Creating a styled component inside a component function

James TudsburyIn one of my React components, I want to use props when creating a styled-component to determine which tag to use. Specifically I am looking for what's in props.headingLevel to decide which heading level to create. E.g. h1 or h2. All of the styled-components examples show components being create...

 
0
Q: String pattern for checking the first 8 characters are same in luci

Muhammed AslamI am using Luci-Lua in openWRT. I need a function to validate the password field that only accepts alphanumeric and the first 8 characters are not same. Please check my code and help me. function pw1.validate(self, value) if #value <= 6 and not value:find('^[%-%.%w]+$') then ...

 
 
1 hour later…
11:40 AM
0
Q: String to double without std::stod

Pella86I encountered a pesky error in Code::Blocks, the conversions functions (stod, stof, stoi, ...) are not linked correctly. I wanted to learn how to convert double or floats starting from a string. I started writing down a version of it, but I couldn't get it right even if I had understood the conc...

 
11:55 AM
0
Q: Selection and Bubble sorts

itsnotmyrealnameJust to enjoy, I want to implement selection and bubble sorts algorithms without looking any implementation by my own efforts 💪💪. Is there any redundant/lack part(s)? After improved their implementations, I think to try to write them down as recursive, can I ?, any hint? class Sorts { pub...

 
12:21 PM
Requests for improvements for already working code are a better fit for codereviewOH GOD SPIDERS 23 secs ago
possible answer invalidation by Sekkmer on question by Sekkmer: codereview.stackexchange.com/posts/192832/revisions
 
0
Q: angular service vs component with provider

3gwebtrainhere is my component code : import { Component, OnInit } from '@angular/core'; import { ServerService } from './shared/service/server.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent impleme...

 
Please edit the question to include the following: 1)actual code, not a link to it 2) a proper description of what's not working. If you just want a code review then you should post to codereview not Stack Overflow (codereview.stackexchange.com) — hardillb 1 min ago
 
12:36 PM
Greetings, Programs.
 
What code review system are you using? That makes a big difference here, and honestly the best thing to do is make a small project and test it yourself. — Stephen Newell 26 secs ago
 
> The code works fine and am getting the desired result. But its taking a lot of time. more that 24 hours
 
@Malachi note that I edited that formulation a bit...
 
@Vogel612 The last comment also talks about the title not being a good title, but it does mention that the code handles I/O
@Vogel612 I see what you mean, I removed the part that you added.
 
possible answer invalidation by Sekkmer on question by Sekkmer: codereview.stackexchange.com/posts/192832/revisions
 
12:55 PM
@Peilonrayz you commented about a missing variable declaration, but then you posted an answer. I do not code in Python, I can, I just don't. so I am curious to your thought process on that situation.
 
0
Q: Implement Insertion sort in Python

Latika AgarwalTask : Implement Insertion Sort in Python. def insert_sort(a): """ Fuction to sort a given list a """ if len(a)==0: print "Please give valid input" for i in range(1, len(a)): current = 0 while current < i: if a[i] < a[current]: a[curren...

0
Q: How to unit test VBA code? - Two different pointers

Alfa BravoI am working on this excellent tutorial, but in the end my first test is not passing, due to the fact that I can clearly see I am creating two different arrays (and pointers), and trying to compare them with one another. Now the tutorial from what I can see leaves out a few lines of code that I...

 
1:28 PM
@CaptainObvious Needs to research AreSame and SequenceEquals here.
Ohh, CR is down!
The default IIS screen.
And, it's back up
 
1
Q: Most of the SE sites are down

ArulkumarMost of the SE sites are down for few mins, but MSE is working fine.

 
@Malachi It's missing code here. Maybe a C&P error. However it's hard to tell what pos or dup_pos are. I assumed they were just standard lists and dictionaries, but it's hard to know for sure. It could also be a custom list/dictionary that has side effects and so the code doesn't work.
@Malachi I saw that there was one additional close after a couple of hours, and it's unlikely anyone else agrees with me, that missing decelerations are 'grey enough'. So if we want crap, why shouldn't I get upvotes for answering it...
 
1:46 PM
there isn't enough code here to review, and you may consider trying codereview.stackexchange.comTed 21 secs ago
 
1:56 PM
@Peilonrayz but we don't want crap.
 
0
Q: find median of two sorted array with complexity of min(log(m),log(n))

ezraI wrote a program which gets two sorted arrays a and b (with sizes m and n respcetively), and calcuates the median node of these arrays without merging them. Here is my code: #include <iostream> using namespace std; int findMedian(int a[], int b[], int m, int n); int max(int a, int b); int min...

 
2:13 PM
-2
Q: Can't adjust table <td> width with inline styles

MadGabI can't seem to set adjust the width properties of the elements in the table below, and I'm not sure why. I've tried using both literal width="100" and inline styles width: 100px & max-width: 100px, but for some reason the elements are much wider than the image elements inside them. Inline styl...

 
2:30 PM
0
Q: A simple program with trains and inheritance

GitanaHere it is my program. I'm especially worried about the main because I know that one must be careful while instancing vectors of "inherited" objects. The code I have works fine (as far as I can see) but I saw the original program made by my teacher and his implementation of the vector in the main...

 
Hm. There's a Rust meeting in Cologne next week.
Either way, TTQW, gniknoM!
 
Monking
@Malachi More than 24h to run a piece of code? That's not 'works fine'. That's barely running.
It better be caching the internet in that time.
 
2:46 PM
0
Q: Redirecting mobile devices to another page best practise

csandreas1I am redirecting mobile devices from the root index.php to mobile.php file. I only allow access to mobile.php file only when that if statement is true. This is how i do it: Detect Devices and store them into variables If a device (see variables) access the web application start session and red...

 
2:57 PM
@Mast 24 hours for deduplicating 60 GB of plaintext data seems oddly appropriate
That's basically handling 2 Gigs of data in an hour, which is definitely quicker than some file-copy operations I have seen
Deduping is n log n if you do it right and n^2 if you mustn't sort the data...
 
@Vogel612 Or build a set, and read twice...
 
Which is generally n log n as well unless you hash stuff but that's really expensive, memorywise
 
0
Q: Creating a menu for a quiz

AndyI've built a menu for a quiz, where everything is hard-coded apart from the categories, which I'm pulling from an API using Axios. Api.js import axios from "axios"; class Api { static async getCategories() { const url = "https://opentdb.com/api_category.php"; const res = await axios...

 
How would you keep memory down, and not use a set? (They're only deduping 2 of 2512 columns)
 
3:17 PM
1
Q: C# method to remove outliers from a set of values

ValuatorI'm removing outliers from a set of data using the method described here. The method removes the outliers and returns the quartile values of the set after all outliers have been removed. (Quartiles is a class I wrote with properties for Q1, Q2, Q3, and the Inter-quartile range, IQR. The .Quarti...

0
Q: Finding the size of the largest connected component in a graph

MooncraterGiven this question, which simply can be explained as follows: Given the number of nodes and the number of edges in a graph, find the size of the largest connected component of the graph. If this number is K, then return the Kth prime number. I used two approaches here: BFS: I did a BFS o...

 
Your question is not really asking about a problem, but for a codereview, as your logic works. I would suggest you take the question to codereview.stackexchange.com which is more on topic for this sort of question. — Taplar 32 secs ago
I'm voting to close this question as off-topic because the user is asking for a codereview around refactoring of working code. As such it is more on topic for codereview.stackexchange.comTaplar 25 secs ago
ok, can someone move this question to codereview or should I close and create a new one? — Trinity76 54 secs ago
do i understand correctly that you already have two working solutions and you want some input on which one would be better? In that case your question may be better at codereview.stackexchange.com. While here you may get "too broad" or otherwise motivated downvotes/close reasons — user463035818 17 secs ago
 
@Duga Doesn't look like the code works as the OP wants, can someone double check?
 
If your code is working and you are looking for optimization codereview.stackexchange.com might get you better answers as those type of questions are usually off topic on Stackoverflow. — Nope 19 secs ago
@Taplar Please don't vote a question as off-topic just because it might be on-topic on another site. If I got Trinity76 right, there are too many input fields at the moment, therefore the question is off-topic on Code Review as the code does not work as intended. See A guide to Code Review for Stack Overflow users for more information. — Zeta 20 secs ago
The user states they want a codereview. They state that they could refactor their selector and it would continue to work fine with less code. They then ask if there is a more DRY way to do this. This is reflective of a non-existant logical error, but asking for refactoring. This question does not state a problem in the terms that Stack Overflow asks for, imo. @Zeta — Taplar 11 secs ago
Although codereview is possibly a better area for this, my main question is there a better way to accomplish this. I'm cool if this is closed though, and I'll move it to codereview. — backscattered 12 secs ago
 
4:07 PM
-2
Q: I started working on a simple c++ serialization design. Help extending to vector?

PittfallI don't need a lot and I don't need for my code to handle everything. Even now, I'm just looking at handling serialization. I'm pretty much building on it as needed. I am trying to support vectors right now and am looking for an idea on how to extend what I have a little to support this. Basi...

 
"As most C# developers use Visual Studio, you can check the real type by hovering your mouse over the variable in case you need it." And then all hell breaks out, when you do code reviews, either in TFS web-based tools or even in the studio comparison tools when hovering is not always produces the hint. — T.S. 49 secs ago
 
Hi, I'm your new meteorologist and a former software developer. Hey, when we say 12pm, does that mean the hour from 12pm to 1pm, or the hour centered on 12pm? Or is it a snapshot at 12:00 exactly? Because our 24-hour forecast has midnight at both ends, and I'm worried we have an off-by-one error.
6
 
posted on April 25, 2018 by CommitStrip

 
4:33 PM
@Damien_The_Unbeliever I know what you're saying. This is gray area. But man, how helpful int i = myObject.Getsomething() during code reviews. — T.S. 49 secs ago
 
-1
Q: JAVA Short scenario game, issues with Intro Method returning to console

MoooooI have a code that is a short scenario game. I have the first set of choices that allow the user to pick between A-D to determine the outcome. I wanted to make the code more readable by creating a method for the introduction called Intro(); I ran into issues with my code as it struggled to return...

0
Q: Node Express Application - VS Template - Error Middleware

GoClimbColoradoDoes this modification overlook any fundamental behavior of Node Express application 500 or other errors? Admittedly I only tested 404s. When creating a new project from the Visual Studio 2017 'Basic Node.js Express 4 Application' the error handling code is in app.js like so. // catch 404 and f...

 
5:11 PM
-1
Q: Given two binary trees, determine whether second is a subtree of the first

kal212Given two binary trees T1 and T2, with T1 much larger than T2, create an algorithm to determine if T2 is a subtree of T1. First, brute-force attempt. Please give feedback for more efficient code. public class IsSubtree { public boolean isSubTree(Node root1, Node root2) { Queue<Node>...

 
5:27 PM
0
Q: CPU's Control Unit in VHDL

a_sidI have designed the Control Unit of the CPU in VHDL. It works properly and produces the expected simulation waveforms. Nevertheless, I feel that my existing code can be improved considerably. My control unit essentially consists of three processes: operation decoder (this is the lengthiest pro...

 
5:43 PM
0
Q: File manipulation with Haskell

JsevillamolI am trying to pick up Haskell! But I feel like my code is a bit painful to write and read. Do you have any pointers on how to improve its readability / style? main = do contents <- fmap tail . fmap lines . readFile $ "testInput" let input = map pair_to_tuple .(map (map read)) . map wo...

 
5:55 PM
possible answer invalidation by Valuator on question by Valuator: codereview.stackexchange.com/posts/192922/revisions
This is off-topic for Stackoverflow. Check out codereview.stackexchange.comAlexander 34 secs ago
If you have working code that you'd like reviewed, your question should be asked on Code Review instead. If you have a problem with the code you've posted, it does not work, and you're looking for help solving that problem, then you need to clearly and specifically explain the problem, include the minimum code necessary to demonstrate it, and ask a specific question related to the code you posted. See How to Ask and Minimal, Complete, and Verifiable example. — Ken White 21 secs ago
 
@Duga It's fine
Monking!
 
6:15 PM
0
Q: Rails db query to pull joined and included data

anonn023432I have a conversations controller which is used to pull all the conversations for a user of type seller. Sellers can have products which can be purchased by buyers and the product may be free. For the list of conversations every buyer is tagged as a client or a lead depending on the following f...

 
6:31 PM
0
Q: Find two distinct subsets of a list that add up to the same value

redfast00This code should partition a list into two subsets of the given list that add up to the same number: for example [15, 5, 20, 10, 35, 25, 10] -> [15, 5, 10, 15, 10], [20, 35] would be a valid solution. I'm looking for any tips to improve code style (be more Pythonic) or performance (mainly improve...

 
possible answer invalidation by Gitana on question by Gitana: codereview.stackexchange.com/posts/192917/revisions
 
7:04 PM
0
Q: Bernoulli Sequence Lab

Post169I'm writing some Python 2 code with which to analyze the compressibility of random bitstrings. It's working pretty well right now, and now I'd like to request some help making sure it follows PEP 8 and is in other ways pythonic. # -*- coding: utf-8 -*- """ Created on Wed Feb 21 14:34:38 2018 Tak...

 
@CaptainObvious unregistered user posted Q, then registered a different account with the same name and posted a reply as an answer - any mods want to start the merge process with SE CMs?
 
7:20 PM
-1
Q: Modification of the novice programmer's code on pro

Łukasz BettaI am currently learning swift 4 and would like to ask you to correct my code. (I would like to have a pattern for learning the "beautiful code"). Can I ask for corrections? I'm trying to write an MVC compliant code. My user login code: login.swift import UIKit class LoginViewController: UIVi...

 
7:30 PM
@SamOnela both accounts are unregistered to my knowledge
let's see if they find the register button, then we can talk :)
 
-1
Q: object oriented programming

sabrinHow to temporarily save elements or data of a number of students in Java in object programming and then call a particular student from the student number, for example.

0
Q: Let us schedule a meeting

CodeYogiDescription: Write a method mergeMeetings() that takes a list of multiple meeting time ranges and returns a list of condensed ranges. The integers represent the number of 30-minute blocks past 9:00am. Do not assume the meetings are in order. The meeting times are coming from multiple teams....

 
@CaptainObvious You don't say...
 
8:15 PM
You would call them Manager classes when they do nothing ;) [pun intended] - I have seen same pattern in case of *Util *Helper - when in doubt people will call it helper and live happily ever after. It is hard to think about right names and most developer would give low importance to it therefore they just pick the easiest route. These are common issues that I try to point out during code reviews. — software.wikipedia 16 secs ago
 
@Vogel612 well, nuts... some people these days...
 
Hey I had some questions related to event sourcing pattern impl. Is this the right place for it?
 
depends...
do you have a working implementation of it?
one that actually solves a problem?
 
Well I am laying the ground work before I jump into it
I have a stack overflow question related to it
https://stackoverflow.com/questions/50025857/optimistic-lock-mechanism-in-event-sourcing-undo-flow/50028843#50028843
in case you want to take a look
Let me know if you have some suggestions that on it that could help me . I can jump into more details if you like.
 
8:52 PM
@Vogel612 If it's raw file-copy, that's only 0.5MB/s...that's really slow. You're talking file-transfer speeds of 4-5Mbps, which is even a slow internet connection.
 
9:31 PM
You say you're going to "cast" to TempObjectBeforeUpdate and TempObjectAfterUpdate, meaning those are different classes, but really it sounds like they're two instances of the same class representing different points in time. Also, this seems like more of a CodeReview question except for the fact that it doesn't sound like you've written the code yet. — BACON 21 secs ago
 
10:12 PM
The Code Review site may be a better place to ask a question like this. — Bradley Uffner 44 secs ago
possible answer invalidation by Valuator on question by Valuator: codereview.stackexchange.com/posts/192922/revisions
 
10:35 PM
@beBoss the community isn't dying because you cannot read the rules of the site. Stack Overflow is not a code writing/conversion service. Stack Overflow is not even a code review service (that is Code Review as Bradley suggested). Your question is off topic for this site and that's why it was put on hold. — maccettura 33 secs ago
 
10:51 PM
0
Q: NetMQ Based, inproc, dynamic messaging service

Matthew GoulartI am working on a messaging service to use in a modular server scheme. Long story short: The server has modules, each module can "subscribe" to a "topic" (message Type). The MessageService is responsible for sending, receiving and parsing messages. So this is sort of a question/code review. The...

 
Welcome to Stack Overflow. When you created your account here, it was suggested you take the tour and read the help center pages in order to familiarize yourself with the site. Please do so before posting your next question here, especially How to Ask. We do not go to another site to see the code, and we do not do code reviews of working code (there's a site for that called Code Review, but they require source code in the question and not in an off-site link as well). — Ken White 12 secs ago
 
11:17 PM
So as written, it is a local variable and gone so you cannot access it. You could promote it to an instance or a class variable and then you can access it. (Google it.) However, while Python allows this, it isn't very good OOD . . . allowed by the language, but I would complain about it if we did a code review together . . . I would expect you to have a good justification for it and probably you promote it to the interface with full get/set support. — Frank 58 secs ago
 
11:49 PM
Thanks for your code review and suggestions, now my problem is resolved greatly! — zhihuifan 1 min ago
 
-1
Q: Vectors, Averages and TxtFiles (help)

jeepfanOkay, I finished this code with my goal of making a vector that pulls data from a text file and displays it. Now I've begun adding to it, and would appreciate some help. My next goal was to add up the votes and display the percent of votes EACH candidate received and then display the winner at ...

 

« first day (1817 days earlier)      last day (2207 days later) »