« first day (1998 days earlier)      last day (2005 days later) » 

12:00 AM
RELOAD! There are 5753 unanswered questions (89.7327% answered)
 
 
1 hour later…
1:09 AM
Looks fine to me, except for the duplicate prompt. This probably belongs on Code Review. — shmosel 15 secs ago
 
1:56 AM
0
Q: Mininet topology

JaredGiven this code which takes as input depth and fanout arguments, and produces the forwarding rules (in the dpctl format) which allow communication between all of the hosts in Mininet for a topology with that depth and fanout. Looking for code review, Need help figuring out calculation the path ...

0
Q: Find the longest connect cells region per color

Rami ShareefI have been studying graphs/BFS/DFS. working on wrapping my head around the following problem Given a grid [m,n] where each cell has a value denotes a color, find the longest connected region that shares the same color (color is an int) I was able to come up with the following algorithm tha...

 
2:11 AM
1
Q: Flask-PyMongo code to add data

bhaskarThe functions below are from a class of slave function which interact with my mongo database. I feel that this code is not at all optimized and can be improved greatly. def __init__(self, app): URI = "mongodb://127.0.0.1:27017/source" mongo = PyMongo(app, URI) self.list_c...

 
@PeterA.Schneider OTOH, when the STL version is 20x-30x slower, rolling your own is good thing. See my answer here: codereview.stackexchange.com/questions/191747/… Therein, others also suggested [at least a partial] roll your own. — Craig Estey 1 min ago
 
2:24 AM
@DavidC.Rankin Thanks. Yes, shameless. But, see this SO answer [not mine] stackoverflow.com/a/52442453/5382650 and my comment to Vittorio (i.e. I agreed with what he said, did +1 and told him so). Peter Schneider then chimed in. I [just] linked to an answer I did on codereview because all that I would have said to refute Peter in the comments was contained in the linked answer. Eh, more self promotion, but this one was standing up for principles :-) — Craig Estey 21 secs ago
 
 
3 hours later…
4:58 AM
Seems like this is more for CodeReview, since the code is functioning alright. Regardless, a quick microbenchmark showed me that 3 and 2 were very close, and both were an order of magnitude faster than 5, and really 1,2,5 are all close to the same performance. I'm inferring that you have larger data in mind, though, so your own benchmark could easily bring up other nuances of the code. — r2evans 10 secs ago
 
5:25 AM
I'm voting to close this question as off-topic because it belongs to code reviews — Alessandro Da Rugna 47 secs ago
 
5:40 AM
0
Q: implementation of circular QUEUE in JAVA

helloworld programmerHI i have implemented a circular Queue in java the below is the code of it public class CircularQueue { private int head = -1; private int tail = -1; private int[] queue ; private static final int CAPACITY = 6; public CircularQueue() { queue = new int[CAPACITY]; } public void enqueue(in...

 
Monking
 
6:03 AM
@CaptainObvious Rev 7 makes the question off-topic. Stupid rules won't let me vote to close after having retracted my vote to close.
 
If you have no issues with your code because it works, great! Unfortunately, this isn't the forum for that type of question. Maybe check out Code Review.. — ChiefTwoPencils 54 secs ago
 
But did you try it?
 
Monking
@200_success It's at 2 close votes again, so it will probably be taken care of. The comment you left should help a bit.
Besides, Vogel will wake up in an hour or two.
@CaptainObvious Duplicate of another off-topic question by same author...
Why would you read the rules if you can just try again, huh?
 
6:44 AM
0
Q: MAXSPPROD linear algorithm

UmNyobeI am working on the MAXSPPROD problem on interviewBit You are given an array A containing N integers. The special product of each ith integer in this array is defined as the product of the following: LeftSpecialValue: For an index i, it is defined as the index j such that A[j]>A[i]...

 
7:09 AM
If you are looking to get your code reviewed, go to codereview.stackexchange.com — CinCout 18 secs ago
 
7:32 AM
If this code isn't broken but you just want ask how to clean this code up, I guess that codereview SE would be more suitable for that kind of question. — KhorneHoly 22 secs ago
it's called functions - but Khorne is right - codereview SE is the place to pose this question — ThisGuyHasTwoThumbs 18 secs ago
 
8:19 AM
0
Q: I'm using the same code twice, how can I make it easier to use it only once?

PhoenixyI have a notification system. If someone posts a new comment to the topic you commented, then you get a notification. The problem is, that the code is looking awful. First I count how many notifications you have, so I can write it into the "notification bell", then I write the same code again, bu...

 
Monking
ugh
wow that was a mess...
not a single mod-flag though...
with that amount of comments I'm happy for a custom flag that tells me the discussion is getting somewhat out of hand
 
8:39 AM
BTW, this kind of question is more on topic on the CodeReview SEAaron just now
 
0
Q: Can Random String Generation be faster in Java?

user1870400Can Random String Generation be faster in Java? Here is my current code import java.util.ArrayList; import java.util.List; public class FastestStringGeneration { private static final String ALPHA_NUMERIC_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; private static final char[] ch =...

 
9:22 AM
1
Q: Array Interlacing

GelionAfter I couldn't find any matching algorythm that would Interlace arrays I wrote this generic static function to combine arrays with variable segment sizes with n number of arrays. The theory of this algorythm is that one would specify the indices in order of the params arrays with a number to i...

 
9:44 AM
My phrasing was wrong. Someone could throw in a destructor, but that should make any code reviewer throw up as well :p — Matthieu Brucher 24 secs ago
 
0
Q: Adding possible filler characters to the end of `std::wstring`

SluggerI have a function that adds to a std::wstring some filler characters. The user gives a single filler character. They can also optionally given an initial filler sequence (std::wstring) and an optional final filler sequence (std::wstring) that start and end the padding. static std::wstring fillW...

 
 
1 hour later…
10:57 AM
as code is working (as suggested) - may be off-topic here and better for code review SE? :) — ThisGuyHasTwoThumbs 34 secs ago
The idea of SO isn't actually to answer your question, it's to have a pool of generic questions with answers that are useful to anyone that has a similar question. Therefore you want to split the question & abstract it as much as possible from your actual codebase into a mcve. Regarding your 4) that's kind of off topic here, but you can have a look at codereview.stackexchange.com/help/on-topic maybe. Wrt 3) I'd not move code into the activity without good reason, maybe into some utility class that can be used from both activity and adapter? — zapl 32 secs ago
 
 
1 hour later…
12:06 PM
0
Q: Speed up weighted average for Leela Chess Zero

Oscar SmithProblem: Given a vector of about 40 values m with normal error sd compute the weighted average of the values weighted by the chance that they are the maximum. I have come up with 2 different approaches to solve this. The first is numerical integration, the second is monte-carlo sampling. import...

 
12:40 PM
If the code works but too slow, you could ask for it to be reviewed on codereview.stackexchange.comGeorgy 29 secs ago
as for code review, in this example it's a perfect idea, I swear — d-d 10 secs ago
 
1:41 PM
0
Q: Python worker pattern for multithreading

CodingoI'm building a script where I pass in a text file of hostnames, and a text file of commands and each command will then be run against each host. To prevent this getting out of hand I'm also passing in a maximum thread count and trying to manage a maximum number of workers at any one time. The c...

 
1:57 PM
0
Q: Segmented sieve in C

suyashsingh234I am trying to write a code for the segmented sieve. I have been trying to find a segmented sieve code but all that I find are so complicated that it becomes impossible to understand what they are doing. So I am writing a human understandable version. Input is of the form, Number of test cases ...

0
Q: Why does matplotlib draws this graph?

Andrey Romanovfrom sympy import * import numpy as np import matplotlib.pyplot as plt x = symbols('x') def f(x): return (x**2 + 8) / (1-x) x = np.linspace(-100, 100, 1000) y = f(x) plt.plot(x, y, color = 'blue', linestyle = 'solid',label = 'f(x)') plt.show() 1 is a critical point and there should no...

 
2:30 PM
Hey Nithiin! It looks like this is an assignment for a school or university course? Maybe it would be better to post the question over at codereview.stackexchange.com. In any case you should provide the code of the solution you have written so far, so people can point out improvements in your code rather than solving the complete task for you ;) — Daniel W. 46 secs ago
If you wish to post on Code Review, please review their help center to ensure that any question you ask on that site is on-topic there. — Joe C 19 secs ago
 
3:12 PM
Greetings, Programs.
 
0
Q: Optimize branch conditions?

markzzzHere's the code I have, which I'd like to optimize: // mControlRate would be 8 // blockSize would be 256 void MyControl::ProcessBlock(int voiceIndex, int blockSize) { unsigned int controlRate = mControlRate; unsigned int controlRateIndex = 0; double *pModValues = &pModulatorConnector->

 
Monking @Donald.McLean.
 
Please accept my apologies for being unclear in my question. I'm only concerned with the integrity of my local repository, since the Gerrit code review process prevents any modifications to the remote repo. Does that simplify matters here, or make them worse? — Tim Randall 46 secs ago
 
3:32 PM
If your code works, a better place to ask is Code Review (a.k.a. "why should we keep all the fun for ourselves"). — usr2564301 1 min ago
 
0
Q: Top k closest pairs in a set of million 128-dimensional points

jayadeepkI have a set of 1 million points in 128-dimensional space. Among all trillion pairs of the points in the set, I need to get a subset of 100 million pairs whose cosine distances are less than that of every pair outside the subset. I tried measuring cosine distances of all trillion pairs, sort the...

0
Q: Principal Component Analysis in Tensorflow

kazemakaseTo learn the low-level API of Tensorflow I am trying to implement some traditional machine learning algorithms. The following Python script implements Principal Component Analysis using gradient descent. It finds component weights that maximize the variance of each component. The weights are cons...

 
3:48 PM
0
Q: Reverse C++11 range-based for loop

Tedy S.I wrote this snippet: template <typename ContainerT> class ReverseIterator { public: ReverseIterator(ContainerT& iContainer) : m_container{iContainer} { } typename ContainerT::reverse_iterator begin() { return m_container.rbegin(); } typename ContainerT::re...

 
0
Q: Why do some users have HTTP response codes in their display names?

Sᴀᴍ OnᴇᴌᴀI know I could ask this in the 2nd monitor but figure this might be better here for posterity... and this site is for questions... I noticed a while back that there are a couple users who have HTTP Response codes as their display names - namely 200_success and 202_accepted. Bearing in mind that ...

 
Yep, that's the syntax we're given. I don't know how our code review system works exactly, but that command hooks into it, sending the commit(s) to Gerrit for review and later merging with the remote master. — Tim Randall 22 secs ago
 
@CaptainObvious Second half of the question looks off-topic. Don't know whether to let it slide.
 
@Feeds @200_success and @202_accepted this is about you two
 
@202_accepted Maybe my only tool is tinfoil... I always thought this was related.
 
It was for a moment, I didn't want people to immediately find me, but it's no longer the case.
 
This belongs on codereview.stackexchange.com. — Alexander 10 secs ago
 
0
Q: Convert binary tree to 2d matrix

loremIpsum1771I found a solution to the leetcode problem 655 "Print Binary Tree" in which the question asks to essentially store a binary tree in a 2D matrix. From debugging the solution, I understand the logic flow of the program; however, I haven't been able to figure out how the person derived the width for...

 
4:29 PM
Monking
 
5:08 PM
-1
Q: Todo list in Vanilla JS

cafekazeI'm kind of struggling with how to approach structuring code. At first, the MVC framework seemed good in keeping logic separated. But with more features, the lines seemed less clear. Maybe I'm not doing it correctly, would really appreciate some feedback. Also, I now wonder if MVC is worth for ...

 
5:31 PM
@Peilonrayz LOL my answer was downvoted.
 
@202_accepted someone disagrees with you? ಠ_ಠ
 
They must know the story of my name better than me.
 
mayhaps...
 
5:59 PM
lol
 
possible answer invalidation by markzzz on question by markzzz: codereview.stackexchange.com/posts/206116/revisions
 
@Duga decisions, decisions...
I'll give it the benefit of the doubt, but feel free to give a 2nd opinion.
 
6:13 PM
Unrelated:
+1 for the excellent advice of not inhaling mail order parcels! — Janus Bahs Jacquet 4 hours ago
Things you learn on SE...
 
6:25 PM
Everyone, I still have the ONLY SNOBOL4 answer: codereview.stackexchange.com/a/126604/73844
 
0
Q: Rails thin controller via service object

ErebusI'm a beginner with Rails and am trying to figure out how to keep my controllers clean and thin, and how to work with service objects. I am building an internal tool to manage our SaaS customers, and the specific feature I'm building is to allow admins to change a customer's plan. In accounts_co...

 
@202_accepted If you like uncommon tags, I got a shiny zombie for you.
 
Oh man I know what I'm doing this weekend.
 
:-)
Have fun. I'm still working on the overhead crane in the same language.
 
6:43 PM
0
Q: Efficiently Swapping the First and Last Five Bits in an Unsigned 16-bit Integer in C

比尔盖子I'm programming on an embedded system, and encountered a problem. The program needs to render some pixels to the screen. The color is stored as RGB565 format as a 16-bit unsigned integer, but the system color is encoded as BGR565, so I've devised the following code to swap the first and last 5 bi...

 
7:31 PM
0
Q: c# multiple socket programming with ssl

Navid khalilianI used this sample code to make a multiple server-client socket application. Now i want to change this code to use ssl. Can anybody help me?

 
8:05 PM
possible answer invalidation by thisGuyCodes on question by thisGuyCodes: codereview.stackexchange.com/posts/205993/revisions
 
@Duga rolled back by AJNeufeld
 
0
Q: Rectangle program, how would you go about this?

SimonDesign a program (name it MyRectangle) that defines the following 3 methods: Method isValid() returns true if the sum of the width and height is greater than 30 Method Area() returns the area of the rectangle if it is a valid rectangle Method Perimeter() returns the perimeter of the rectangle if...

 
8:28 PM
@CaptainObvious Go away.
 
~whistles
 
@CaptainObvious No code.
@Vogel612 Honestly, when there are mods in The 2nd Monitor, it feels like playing with the nuclear launch codes every time I strike against a bad question.
It's like a review queue on steroids.
This room works.
 
for the egregious cases I don't see a point in letting them walk the 24-hour review queue process
a waste of everyone's time and mental capacity
that makes me think of soemthing else as well ...
 
@Vogel612 I fully agree with that.
 
Heya @Green welcome to the 2nd monitor
 
8:45 PM
thanks @Vogel612 , first time in SO chat rooms. remind me a bit of the IRC rooms(:
 
ohh... take care. these rooms have a public record
 
I meant the ones you discuss about OS professional issues like mozzilla's developer rooms. It was mentioned in a good way
 
9:01 PM
oh. I was kinda on the mechanical level here :)
thanks for the compliment, I guess?
 
0
Q: Counting number of every different word

KennithI got a word count assignment and the requirements are shown below: INPUT The input contains words in several lines and in each line there could be more than one word. The input only contains English words, separated by space or line breaks. Words are case-sensitive. OUTPUT Print the words in a...

 
9:24 PM
0
Q: Runner 1-bit game in Python like the offline chrome dino

P. KtinosI made this little game to test if my Nokia 5110 screen can handle games. As in handle many frames per second/game loops. I am using a library made for this screen called Adafruit_Nokia_LCD These are the imports for some context, if needed: import Adafruit_Nokia_LCD as LCD import Adafruit_GPIO...

0
Q: Do not include the number in the calculations if it is below 0

OletolgaStep 1 Using a loop, ask the user to enter 6 numbers, then find their average. Step 2 Also count and display the number of even numbers. Step 3 If a value is below zero, print "Invalid Entry" and do not include the number in the calculations. last part is the where I failed to happen any advic...

 
9:40 PM
0
Q: Finding maximum element in stack in c

lauraHere is my problem statement ,few of the test cases are failing and the reason given is that terminated due to timeout.I am unable to minimize its time complexity .I have used O(n) for finding the maximum element in a stack of size n.can i reduce it more? #include <stdio.h> #include <string.h> #...

 
@CaptainObvious not working per requirements
 
10:00 PM
possible answer invalidation by Deduplicator on question by Kennith: codereview.stackexchange.com/posts/206134/revisions
 
10:36 PM
@Duga its okay - just formatted input and output samples as pre-formatted text
 
0
Q: How can this swift, firebase image fetching, function be made more concise?

Alexander Ramirez BlonskiI am trying to fetch a group of images within a place in Firebase database ref. I then loop through each image adding it to an array which is then supposed to be added to a tableview cell. I was wondering if it could be more concise? am i doing anything unnecessary? func fetchAllUserFristIma...

 
11:17 PM
This is not a question type we handle here, you can try it at codereview.stackexchange.comUsed_By_Already 51 secs ago
 
11:31 PM
0
Q: Rust Task Queue

the_endianThe purpose of this program is to have one thread (main thread) working on I/O reading lines from a file and feeding it to a pool of worker threads whose job is to perform some processing on each line provided. In this case, the processing is running the String.contains() method. Please note tha...

 

« first day (1998 days earlier)      last day (2005 days later) »