« first day (1927 days earlier)      last day (2088 days later) » 

12:00 AM
RELOAD! There are 5490 unanswered questions (89.9563% answered)
 
0
Q: Merge Sort implemented using iterators

Brady Dean#include <iterator> #include <memory> #include <algorithm> template<typename RandomIt> void sub_merge(RandomIt begin, RandomIt mid, RandomIt end) { // create copy of input array; const auto left_size = std::distance(begin, mid); const auto right_size = std::distance(mid, end); auto left...

 
12:20 AM
0
Q: Different Words, Same Letter

SamuelContext Check if a sentence contains different word of same letter Task Write a program which will accept a line of text and checks you if any of the words are made up of the same letters, not if they are the same word, but different words with same letter. If yes print “A and B contain the same ...

 
12:40 AM
possible answer invalidation by Koray Tugay on question by Koray Tugay: codereview.stackexchange.com/posts/201345/revisions
why close votes? Can I improve my question? or perhaps post it on code review? Or perhaps delete it? — Lynob 23 secs ago
 
 
3 hours later…
3:51 AM
0
Q: C++2a comparison-based topological sort algorithm

QuuxplusoneHere's my attempt at a C++2a Standard Library–friendly "topological sort" algorithm. There are several areas of interest here: The algorithm is comparison-based and in-place, just like std::sort. This makes it something like $O(n^3)$, which is certainly worse than it ought to be. Can we speed i...

 
4:19 AM
Monking
@Duga rolled back
 
4:36 AM
0
Q: Personal School Course Scheduler

adapapA good friend of mine had the challenge of trying to build a schedule using all available times and classes through a spreadsheet... by hand. He asked me if I could build a program to generate valid schedules, and with search algorithms being one of my favorite things to do, I accepted the task. ...

 
For a code review, go to codereview.stackexchange.com, assuming your code works. — Mat 33 secs ago
 
4:57 AM
Monking
 
5:17 AM
Yes your question should more relevant in codereview.stackexchange.comFranck Gamess 18 secs ago
 
Monking
 
5:51 AM
0
Q: Continuously update position of div with click event

Joshua GarciaI am trying to continuously get the position of a div on screen and update the new position each time a "click" event listener is clicked. At the moment my code works but feels redundant and could be simplified into a single function to move the div around the screen. Any suggestions on how to ...

0
Q: java application with Basic employee details

RixlerAdd basic pay as the member of all the inherit classes with 97% of BP as DA 10% of BP as HRA, 12% of BP, 0.1% of BP for staff club fund. and generate pay slips for the employees with their gross and net salary

0
Q: Rest operator with "use strict" in JavaScript

Pradeep KsI'm a Javascript learner. I found the below "code1" in freeCodeCamp, I found it complicated and I wrote the "code2". Both are returning the same results. Why is code 1 is this complicated? I did some research and found that "use strict" can't have functions. Could someone help me to understand th...

 
@CaptainObvious No code, no glory (also, asks about explanation of foreign code)
@CaptainObvious No code, no question, no glory.
 
6:07 AM
0
Q: Cumulative all in plain C using R's C interface

hoelkI want to implement a cumulative all through R's C interface. I was able to hack something together that produces the correct results, but I have little idea what idiomatic C should look like. The code should be easy to understand, even if you don't know about R. Description: The cumulative all...

 
6:27 AM
10
Q: What does constructive criticism of a design change look like?

Jon EricsonLast week we rolled out the new network theme to several sites. Some of these sites had beautiful designs previously and now have a less striking look. Unsurprisingly, the response to these changes has been somewhat very negative. Even before Joe posted our master plan back in March, this has bee...

 
I'm voting to close this question as off-topic because it is more suited to codereview.stackexchange.comPaulw11 42 secs ago
 
7:07 AM
0
Q: Styling and animating simple Ui

OguntoyeThe following code snippet is a simple UI I,m trying to develop in learning css. how can i improve on the design and animation. The fields should have a nice proportion with the rest of the page (centered like a modal). const form = document.querySelector('.form'); const btnHide = document...

 
Monking
 
7:22 AM
0
Q: How to insertItemAfter in linkedlist java

rihroso I wanted to insert an item after and this is my code for insertitembefore: public boolean insertItemBefore(Object item,Object newitem){ boolean ok=isItem(item); if(ok){ Node newnode=new Node(newitem); if(temp==head){ newnode.setNext(head); head=...

 
7:33 AM
@CaptainObvious broken
 
0
Q: Simple rwlock implementation in c++11

Rishi AgrawalFor answering this question of stackoverflow I have written the code https://stackoverflow.com/questions/12033188/how-would-you-implement-your-own-reader-writer-lock-in-c11 Can someone review it - so that I can understand the possible problems in the code. #include <condition_variable> #include <

0
Q: PHP Chess Part 1 - ASCII Board & Import Position

AdmiralAdamaI have been really into chess lately so I decided to program the game in PHP for practice. I want to get more comfortable with classes. Part 1 of the project is complete. I have a working ASCII board that displays the pieces, and I have an import tool that can import a board. (In chess, they use...

 
@CaptainObvious that one needs a fixed-width font and the user should learn about the character codes 176 and 178
or 254, that works similarly well
 
Monking
 
7:53 AM
■□ ftw
 
8:23 AM
0
Q: What does this 2nd line mean in JS?

akisonlyforuI saw this line in Jon Duckett's book of JS and JQuery. var width = 600 ; var shape = {width:300}; Is shape a structure? Or is it a local/global variable thing?

 
8:42 AM
Monking
 
Monking
 
0
Q: Table update in a loop- How can I optimize this function? postgresql 10.4

WoberCREATE TABLE tempxx (sid numeric(10,0)); CREATE TABLE temptab( r1 numeric(10,0),r2 numeric(10,0),r3 numeric(10,0),v1 varchar(40),v2 varchar(40)); INSERT INTO tempxx VALUES (1); CREATE FUNCTION stresstest1 () RETURNS VOID LANGUAGE plpgsql AS $$ DECLARE xm1 int; BEGIN UPDATE tempxx SET sid=sid+1...

 
9:04 AM
Also: codereview.stackexchange.com/a/193734/36018 You need at least some tiling to make matrix multiplication not slow, then you can go further at the micro level to make it actually fast. — harold 34 secs ago
 
9:20 AM
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comceving 50 secs ago
 
9:36 AM
I'm voting to close this question as off-topic because it belongs at codereview — mplungjan 47 secs ago
@mplungjan Absolutely not. Hypothetical code is off-topic on Code Review. — Mathias Ettinger 42 secs ago
@ceving If the code was already written in C++, then yes. If OP wanted optimizations on their bash script, then yes. This question is not asking for either one so no, it is not on-topic at Code Review. — Mathias Ettinger 43 secs ago
 
10:01 AM
Grrr… Why did I put a "poweroff" shortcut next to my "lock screen" one?
5
 
10:16 AM
Welp ... latests candidate for most enterprisey name I've seen in the wild: AbstractComponentInstanceResourceWithNameDerivedFromAbstractFinal
that literally overflows the chat content-area when I only give half a screen to chat...
 
Yay... and what does it do? ^^
 
I haven't the foggiest. Luckily I work on a completely separatepart of the codebase for now
I'll cross that bridge when I need to
 
I'd rather burn that bridge, but I guess that's not an option...
 
ya. I'm burning a few others as well, soo ...
 
10:54 AM
This question might be better asked on CodeReviewRiggsFolly 45 secs ago
 
11:09 AM
0
Q: Recursive function to find the number of ways a number can be generated out of a set of numbers

Babak BandpeyI had a job interview test and the question I got was about making a function which would return the number of ways a number could be generated by using numbers from a certain set and any number in the set can be used N times. It is like if I have the number 10 and I want to find out how many wa...

 
Monking
 
@skiwi Monking
 
11:43 AM
please dont add the fix to the question. Imho you should rather post it as answer. As it stands now your edit makes the question rather unclear. I mean your question now reads as "i had this not working code, i fixed to to this working code, please check if it is ok", but thats not the question the answers are adressing (anyhow review request should go to codereview.stackexchange.com ). I wont reroll your edit but suggest you to do so — user463035818 29 secs ago
Those questions are subject to closure for several reasons (too broad, opinion-based, unclear what you're asking ...), plus SOF isn't the site for that. From what I have been told, you should go to codereview.stackexchange.comtrichetriche 14 secs ago
 
11:54 AM
0
Q: News reading application version 2

Giladfollowing the answer I got from t3chb0t last time News-reading application using the Observer pattern and also following the example here https://msdn.microsoft.com/en-us/library/dd990377(v=vs.110).aspx I implemented a the answer to the following question Design a kind of kindle fire applica...

 
12:24 PM
0
Q: How to balance quotes and parentheses

codeepicI have been unsuccessfully trying to adapt this solution enter link description hereto be able to check if the quotes and parentheses are balanced. For example this should be unbalanced ("back-to-school)" Original code: function parenthesesAreBalanced(string) { var parentheses = "[]{}()", ...

 
@CaptainObvious This one looks suspicious. Not sure if the user owns the code he has posted.
 
12:55 PM
0
Q: Fall Trough switch case

Chaitanya GuntupalliWrite a program in java to accept a month number(1-12) and print the number of days in given month in the given month along with the month name by using Fall through switch case.

0
Q: Small "Add Contact" HTML & Vainilla JS form

Javier García ManzanoSo basically I developed this form with HTML, JS and Bootstrap to add contacts to a backend. It simply shows a form so a user can input some data and it's submitted to an API. The thing is it doesn't look very neat to me... but then at the same time, I don't really know how to start tackling the...

 
I'm voting to close this question as off-topic because requests to review "real" working code should go to codereview.stackexchange.comGhostCat 55 secs ago
I happen to be the one that commented on the cleaness of this code, and I stand by my suggestions. Although, this kind of post might fit better on Code Review SE, another Stack Exchange website. — NonameSL 47 secs ago
I was going to post it in the code review stack exchange but the FAQ said it was only for working examples. I don't know if this is working, because I am questioning the loop with the categories. That is what my question involves: is this loop the correct way to determine the equality of a set of objects inside a comparator. — mrClean 19 secs ago
 
1:40 PM
0
Q: Greatest prime factor

oypusCode: (edits are appreciated) import math num = 600851475143 root_num = math.ceil(600851475143**(1/2)) divisors =[] for c in range(root_num): if num%(c+1)==0: divisors.append(c+1) for x in divisors: for z in divisors: if z<x: if x%z==0: di...

 
Post what you have (as a complete program) to codereview.stackexchange.com. Improvements to working code isn't really the purpose of SO. — Broots Waymb 30 secs ago
 
1:55 PM
@CaptainObvious Code not written yet.
Also first post.
@CaptainObvious also flag. Seems like an SO question.
 
@RMunroe Specifically, leather gloves with foil inserts that are inside another set of latex gloves because otherwise you will most likely die.
 
@CaptainObvious @sineemore no, he doesn't. The first code snippet is taken verbatim from this answer.
 
@Zeta, so does he violate the rules?
He posts the code he doesn't own.
IIUC
 
They violate the attribution rule on SO's CC-BY-SA. Question would be fine if they removed the first snippet or provided proper attribution and tell that it's only for motivation. IIUC, the other snippet doesn't work correctly yet, though, so the whole thing might be off-topic either way.
 
2:12 PM
0
Q: Two similar React Components with 90% similar code

FranCarstensI have a number of these components, but will show just two as an example. They're very similar, but the differences are enough to where splitting them out felt needed. What I really need is some help. Is this the right approach, or would I be better served somehow combining them to reduce duplic...

 
Thank you for the suggestions! I included your changes and am moving the question to Code Review, since that is the place where it belongs. About the toClear, I am using it when the while-loop restarts — Dehnungsmessstreifen 23 secs ago
 
@Zeta, Nice explanation, thanks!
I'm learning to do site business as you guys use to do. It's not always obvious (to me) what action should be applied so I'm posting it here as well.
https://codereview.stackexchange.com/questions/201577/parallel-computing
Flagged, no code here. Also new user.
 
2:27 PM
-1
Q: Parallel computing

Ermias HailuMeasuring the effect of Parallelization Using one of the suggested methods in class ( p-threads, OpenMP, C-Sharp or Java Threads) implement an application that adds two integer vectors (A,B) and store the result on vector C. The size of these vectors is to be set at 67108864. Measure the time it ...

 
This question has been moved to Codereview.stackexchange.com. Please comment there about the subject. — Dehnungsmessstreifen 35 secs ago
 
1
Q: C# Console autocomplete / suggest input, Code Improvement

DehnungsmessstreifenI am currently writing a C# console application. Part of it is, that the user needs to enter a fairly complex system name. To make it easier I wrote a function that uses a string[] keywords and auto completes the string the user is typing in - on the run (which makes it different to this post in ...

 
3:12 PM
1
Q: Same query nested 3 times for different groupings

Shelby115I've written a view to retrieve each product's sold quantity and four week sales average by Branch/Route/Customer. Introduction to Dataset It might be easiest to start with the inner-most query (commented as B: SalesByWeek grouped by Branch.) since it's the base and the outer queries are the s...

 
What exactly is the issue in your code? If you just want to get your code reviewed, you should use codereview.stackexchange.comPankaj Jaju 14 secs ago
 
Monking
 
Monking
 
3:29 PM
Monking
 
Monking
 
@sineemore You'll get the hang of it.
Free flags:
-1
A: jQuery Accordion + Sub Accordion + Search Filter

user177174hello how to filter table rows

 
3:44 PM
Every once in a while, a NAA flag is declined. That's life. As long as the answer goes, I don't mind...
I should make haste with getting those 10k privileges though, so I can review my own flags...
 
posted on August 13, 2018 by CommitStrip

 
@CommitStrip sigh
 
4:02 PM
 
4:12 PM
Greetings, Programs.
 
 
1 hour later…
5:13 PM
0
Q: Multiple client TCP stream reader C#

jay.tailorMy server code is currently reading String data over a TCP connection form 2 different client computers. To do this I am duplicating the StreamReader functions for the two separate clients. How can I simplify my code into just one method without having to duplicate for every client? (I want to do...

 
0
Q: Climbing the Leaderboard: HackerranK, Terminated due to timeout

Ugur YilmazI have implemented my solution and I thought it was pretty efficient and passes most of the cases but seems like it fails some of the test cases when the input size is very large. I basically push every item from the Alice's array to our array and sort it.I'd appreciate if somebody tell me how I ...

0
Q: Dim Hero & Add Background to Nav on scroll

MorganI have followed a tutorial that initially was for adding a 'sticky' nav. I adapted this slightly so it adds a background to the Nav when the page scroll reaches the top-third point of the hero area. I then added a similar function that dims the hero area once the scroll gets to the midway point ...

 
5:58 PM
@mplungjan I think my question is not just a code review but rather a universal question about dealing with Javascript immutability. I really need to know whether I should apply this pattern to all my React code since I really dislike dependencies like Immutable.js. But thank's for the suggestion! — Phi Hong 55 secs ago
This probably belongs on Code Review SE. — jdv 12 secs ago
 
6:14 PM
0
Q: BST implementation for insert and search in javascript

NinjaGI am doing this implementation in javascript. I was asked to solve this question in javascript. I would like to get some code review. /** * Binary Search Tree * * TreeNode class * * Create a TreeNode class * The TreeNode class should contain the following propert...

0
Q: Modify last element in container

ferygelI look for solution with smaller code smell to remove divider (basically view with 1dp height). I got scrollView which is populated by few customViews with divider. I want remove divider from last customView in scrollView. I dont really feel to do "if last". I would like to create seperate metho...

0
Q: Numerical evaluation of line integral

TimoI have written a function that evaluates a contour integral in Python (Poincaré - Hopf index for 2D vector fields). It works, however is really slow if the arg res=N is chosen higher than 50. Input are two arrays of dimension N x N. As the integrals should lead to an integer, (usually -1, 0, or 1...

 
@jdv No, this is example code. Code without context is not reviewable per the Code Review on-topic help centre. — Mast 42 secs ago
 
@CaptainObvious Flag. No code provided.
https://codereview.stackexchange.com/questions/201595/kernel-died-problem-in-the-spyder
Looks like non working python code. Not sure.
Great title btw.
 
6:29 PM
0
Q: Kernel died problem in the spyder

An studentCode below works fine with small number of files. But kernel died when I increase the number of files, kernel died. Is there a way to optimize the code below? # -*- coding: utf-8 -*- from math import sqrt import csv def mread(): MYFILE = open('MATRIX.csv', 'r') with MYFILE: READ...

 
@CaptainObvious This one with great title :)
 
So dramatic!
 
no problem... :) as an aside if you want help with your algorith (which it sounds like you do,) then codereview.stackexchange.com is probably a better bet... but they want algorithms or pseudo code typically — Joran Beasley 36 secs ago
 
6:45 PM
0
Q: I made a simple program in Python that checks for credit card validity. Is there any way I can optimize this or make it more 'Pythonic'?

M. BoseThis is the code. I want to go more in depth. but this is the 'boilerplate'. Any way to make it 'better' like I mentioned in the title? #Luhn algorithm - distinguish valid numbers from mistyped or incorrect numbers. def checkNumber(cc_number=''): sum_ = 0 parity = len(cc_number) % 2 ...

0
Q: Retrive relation on a polymorphic model

AdamI have a Game model that is "static". Containing game information and such, and users can comment on all games. Games model public function comments() { return $this->morphMany(Comment::class, 'commentable'); } And then I have a Comment model. This has a User relation and a Comments relat...

 
1
Q: If porting code, should I also post the original?

Robert LongIs it on-topic (or acceptable practice) here to post code written in one language, and ported code in another for review ? I am learning scala and in doing so I am translating some code I wrote (in C++, Python or R) in an imperative style, to scala, written in a functional style. Would it be bett...

 
7:35 PM
I mostly quite like to use qualified qualifiers a lot.
Just reread my post on the meta discussion...
 
8:26 PM
@hoffmale 0/10 needs more qualifiers ;)
 
@Phrancis: I mostly really quite like using overabundantly qualified (but not too overqualified but still sufficiently so) qualifiers quite a lot but not too much ;)
And don't get me started on nested parentheses
 
You should start to use the debugger, and see what is happening in this code (how variables are changed). Other than that, if this code works, as you say, it is more appropriate to ask this question in the Code Reviewzlakad 39 secs ago
 
@hoffmale 10/10 adequately qualified
@hoffmale Ever try Lisp? ;)
 
Nah, too few braces ;)
 
@hoffmale what on Earth has more braces then Lisp?
 
8:35 PM
parens: (), braces: {}
there's a difference
 
my damn English won't let me do the jokes. nah.
 
and for completeness: brackets []
you'll learn eventually, young padawan :)
 
Sometimes I write right instead of write, soo wrong.
Mostly cause of simular pronunciation.
 
8:49 PM
two wrongs don't make a right but three rights make a left
5
 
9:00 PM
0
Q: Utility Class for location functionality on Android using Google Play Services FusedLocationProviderClient API

DoTheDonkeyKongaI'm new to Android development and this is my first request for a code review. Constructive criticism is very welcome! I've written a class to wrap interaction with Google's FusedLocationProviderClient. I'm not sure it's a very good idea though as it's not an Activity class and yet there are par...

 
9:10 PM
possible answer invalidation by Snowhawk on question by WooWapDaBug: codereview.stackexchange.com/posts/185378/revisions
 
@Duga just added problem statement and sample input/output
 
@SamOnela I see what you did there
 
9:46 PM
-1
Q: computer guessing game

NarutoThe while loop in my code doesn't work! Does anyone get this? I am referring to the first loop, and any other errors. Here is the code: from random import randint def lottery(lower_limit,upper_limit): number = None attempts = 0 guess = None (int(input(f'Pick a...

 
10:02 PM
1
Q: Using Python to create a JSON file of recipes from MySQL

Joseph PalominoI needed to create a JSON file from a couple of MySQL tables to migrate some recipes from wordpress. This was my first time writing a script in python and would like to get some feedback on what I could have done better. I come from a Javascript background. import mysql.connector import json cn...

0
Q: Unit of measure class for mass in java

snbI was looking at this answer on SO to handle units in java. The concept was interesting to me, except I didn't like that it had to be per object that had mass, instead of encapsulating a Mass class on its own so the pattern need not be repeated. This is what I came up with. public class Main ...

0
Q: Change variable location to a class outside of the GUI button

Raymond GinningsI currently collect all of the variables from my GUI in the Enter button action. Is there a way for me to get all of this out of my enter button and into another class to clean up the look of it? private void enterActionPerformed(java.awt.event.ActionEvent evt) { ...

 
This would be a better fit for Code Review rather than here. However, why are you running a foreach when you only return the last value? — Camilo Terevinto 20 secs ago
 
10:16 PM
1
Q: What To Do App Advice

Mamadou CoulibalyHello I am starting to build up my portfolio, so I am starting to build projects whenever an idea pops up in my head. So, I decided to build an app that helps you decide what to do. Basically how it works is that you put some different tasks to do in a textbook and it places each task in an array...

 
10:28 PM
Why don't you use the app to figure out what to do to the app so that you can find more things to do to the app so that it can suggest more things to do? — FreezePhoenix 14 mins ago
nice
 
10:40 PM
possible answer invalidation by Sam Onela, Mason Bose on question by M. Bose: codereview.stackexchange.com/posts/201597/revisions
 
Z25pa25vTQ==, guys
 
@Duga removing possible credit card number from sample code
@sineemore wat?
 
10:56 PM
gee ...
 
11:08 PM
@Vogel612 is that in response to the credit card number that was removed by Mason Bose?
 
welll .... in a way, yes
 
Simply put, there's no need to edit out such information as mods can now redact edits. Unfortunately, as a result, it makes it look like you added sensitive information to the post. We'll try to fix that now.
 
okay
BTW long time no see!
 
Okay, it looks like it worked.
Same here! I just haven't been poking in around here much lately.
 
darn stuff keeping us from being here
 
11:23 PM
I'm on break now, though.
 
from the IRS?
 
Yeah
 
how long is the break?
 
The whole month of August.
 
nice
well, TTQW; KTHXBYE
 
11:36 PM
TTGTB
 

« first day (1927 days earlier)      last day (2088 days later) »