« first day (2082 days earlier)      last day (1938 days later) » 

12:00 AM
RELOAD! There are 5822 unanswered questions (89.8540% answered)
 
12:32 AM
0
Q: Making stringbuilder code more efficient and short

BongJae JeongWith the page_type and currentpage param I made this code that prints out the web page through aspx behind code. Is there a better and a shorter way of code that works just like the code below? (The difference is the else if(page_type == sales) script.append part) protected string MakeBottomMenu...

 
1:03 AM
0
Q: cannot access public method in main. (JFrame)

llamaCaraDaraI have 2 classes: Main UI UI has a button and text area. Goal is to have Main print out text in text area when button was pressed. HOW I'M TRYING TO DO IT(Sudo code): UI extends JFrame{ boolean tf = false TextArea ta = new TextArea(); JButton b(event e){ tf=true } public b...

0
Q: HackerRank - Left Rotation in JavaScript

Justin BessI'm looking to learn more about data structures, time complexity, and efficient algorithms. I have solved the Left Rotation Problem on HackerRank using JavaScript. I am looking to see ways to optimize the time complexity. I feel like I have a lot to learn, as don't grok Big O. My solution: func...

 
 
1 hour later…
2:14 AM
I'm voting to close this question as off-topic because it is asking for code review and so belongs on codereview.stackexchange.comMatthew Herbst 19 secs ago
 
2:45 AM
possible answer invalidation by Minial on question by Minial: codereview.stackexchange.com/posts/211458/revisions
 
3:08 AM
0
Q: Plugin generator in Go

Niklas RosencrantzThis is my first go program. It is a plugin generator and works only with Linux. It basically creates some Go code in some temporary file defining a function taken from command-line arguments, compiles that code into a plugin, loads that plugin, gets the function in it, and invokes that with par...

 
possible answer invalidation by Minial on question by Minial: codereview.stackexchange.com/posts/211458/revisions
 
3:24 AM
0
Q: C++ implementation of basic_string

Krystian SThis is a basic_string implementation that has SSO. It's not done, but the fundamental operations are all there (append, erase, resize, reserve, push_back/pop_back). Proper iterators and my own char_traits impl will be added eventually. #include <string> template<typename CharType, typename Tra...

 
3:55 AM
0
Q: Use a context manager to save an object on exit

Pro QThe following code uses a context manager to store and load variables into files. However, it's very annoying to have to set the value property of what is yielded by the context manager (loaded.value). I would like to Not have to define a new class like LoadedValue Set the yielded value of the ...

 
 
1 hour later…
5:11 AM
Monking
 
6:03 AM
0
Q: String manipulation over 2 tables in database to application

rcsI have the following function in the database to do string manipulation: create or replace FUNCTION convert_string ( input_string IN VARCHAR2 ) RETURN VARCHAR2 AS output_string VARCHAR(8); BEGIN IF (input_string IS NULL) THEN output_string := ''; ELSIF (NOT (SUBSTR(input_...

 
6:18 AM
0
Q: Project Euler #60 Prime pair sets

Matt CaoThe problem is as below: The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four primes, 792, represents the lowest sum...

 
Monking
 
6:34 AM
-1
Q: read java text having field name and scores for different subject as array making objct for eah calculate average

Avinash Ranaby using arraylist to store each object with name and scores of subject Class Student{ private String name; private int marks[]=new int[5]; } now we have to read the text and fetch from the text like Eddie 54 56 78 98 29 Avi 98 76 56 98 23

 
7:02 AM
I'm glad I helped. Let me help with another misunderstanding: "I just thought I could get away with continuing the discussion with anyone willing to give me further input for a day or so" StackOverflow is for solving specific problems, not being a discussion forum. The questions should contain the boiled-down scenario for one question as an MCVE, and the answers are answers. The intent is that the questions and answers serve the community for the future. If you widen the scope of the question, It can be voted to be closed. Use codereview.stackexchange.com to get feedback. Edit rolled back. — Richardissimo 36 secs ago
 
thanks everybody for combatting the queues- especially the close votes queue
TTGTB
 
7:46 AM
This question seems to better fit on to the CodeReview site. As your code is working but you have performance issues — MindSwipe 37 secs ago
 
8:08 AM
0
Q: Better way to solve multi variable polynomial?

user3857802a + b^2 + c^3 + d^4 <= S For above equation ,I need to count possible solutions. I tried following approach. Integer inp=Integer.parseInt(br.readLine()); // get maximum possible value of b,c,d which satisfy equation int b=(int) Math.sqrt(inp); int d=(int) Math.sqrt(b); ...

 
8:35 AM
possible answer invalidation by Mathias Ettinger on question by user3857802: codereview.stackexchange.com/posts/211526/revisions
 
0
Q: Python List method for save duplicate element

Rajni Yadavlst = ['1','2' ,'3' ,'4' ,'3' ,'4','3'] dup=[] uni=[] def countX(lst , x): return lst.count(x) def dups(lst): for i in lst: y=countX(lst,lst[i]) if y>1: dup.append(lst[i]) return dup dups(lst) but its not working in my requirement i want to print all du...

 
@CaptainObvious Broken
 
9:00 AM
Monking
 
9:25 AM
Monking
 
9:57 AM
 
0
Q: Testing class which returns big dictionary

Dmitry ChernyshovI have simple class with the public build method I want to test. Currently I assert all values it returns in every test. Is it a good practice or I should write one test for static values and in other tests only check values which change depending on input? Implementation class FiltersAttachmen...

 
10:16 AM
"Is there any other solution?" so your code works? If so, this should be posted on the codereview StackExchange forum — MindSwipe 33 secs ago
 
10:34 AM
It's a bit broad for Stack Overflow to ask how this code could be improved (on what front? Readability, memory, CPU cycles, size, ..?). You might want to check our sister site CodeReview SE, make sure to check their rules first to tailor your question to their site. — Paul Stenne 41 secs ago
 
10:45 AM
0
Q: Design pattern example (Simple Window Explorer )

iman mohadesiI want to know my code about Abstract Factory Pattern is near the principle? My exm is about Windows Explorer that when user run it , new form and other materials in form created . Please look my code and know me about that. Output :: Hello, world! Form Created Close button ...

 
11:21 AM
Seems like a question for codereview.stackexchange.comestus 13 secs ago
 
Monking
 
I'm voting to close this question as off-topic because this question is related to the CodeReview community — CROSP 44 secs ago
 
0
Q: How to properly split the code of a component into sub-components?

ScalaBoyI have a component MyComp with a long code that I want to split into 3 components. My goal is to get the following setup of MyComp. I appreciate general guidelines and a small example in an answer: import React, { Component, Fragment } from 'react' import { TopControls, Main, BottomBar } from '...

 
11:47 AM
0
Q: Displaying the first letter of each word in a single variable

Ali RakhadaI have a variable with two words, and I am confused on how to display the first letter of each word. import random var1 = "Donkey Kong" var2 = "King Bowser" var3 = random.choice(var1, var2) print(var3[0]) So how would I display the first letter of either variable, seeing as both words have dif...

 
It would be better if you post this in code review with your existing code sample — huMpty duMpty 55 secs ago
 
12:03 PM
0
Q: Counting number of pairs in an integer array

Akash SinghSo, I wanted to have the count for number of pairs of same integer there are in an array for which I used a HashMap Input contains two lines: Integer n: Signifies the size of input Input numbers separated by white space character: E.g 4 6 6 7 7 8 7 6 4 For the same input, ...

0
Q: Given a word, how do I find other words in an array with same length and same characters

AdityaI tried solving the problem in the following manner; I am just a beginner and wanted to know my mistakes and a more efficient way with better time complexity (if any). public class Exercise { public static void main(String[] args){ String Search="loop"; String[] letters = Search....

 
12:18 PM
0
Q: Find combinations of values in different arrays close to a sum

hedmahcould someone help me with this case Imagine i have 3 arrays (A,B,C) with three values in each of them, where A=[1, 2, 3] B=[4, 5, 2] C=[3, 4, 7] Now I would like to find the combination of elements from each array which result in a sum of 10, the combination must contain a value (only one) f...

 
12:55 PM
I'm voting to close this question as off-topic because question belongs to codereview.stackexchange.comSlam 56 secs ago
 
1:15 PM
possible answer invalidation by coderodde on question by coderodde: codereview.stackexchange.com/posts/211455/revisions
 
1:28 PM
Welcome, @user190377. You don't have the necessary reputation to talk in chat at the moment. You can participate as soon as you gained 20 reputation, that's two upvotes on answers, or four upvotes on questions.
 
1:39 PM
You guys ever had problems with a lot of wcf test running in parallel? Some of my connections seem to be forcibly closed.
 
1:52 PM
0
Q: Queue implementation in ES6

Melissa StewartHere's my Queue implementation in ES6, class Queue{ constructor(){ this.head = null; this.tail = null; } offer(item){ const p = new Node(item); if(!this.head){ this.head = p; this.tail = p; return; } ...

0
Q: Reporting new USB storage devices on Linux and macOS with Python

tjt263Synopsis: I wanted something for macOS (and Linux; maybe eventually Windows) that would simply wait for the user to connect a storage device and automatically select, or otherwise output the information to be used, read, manipulated, etc. In its current form, it just prints to the shell, but...

 
2:08 PM
0
Q: Is this display module and its testing written in a pythonic manner?

Robert CalceanuThe code is here: https://gitlab.com/pypy/is-the-display-module-and-its-testing-written-in-a-python-manner I wasn't able to enable the web console on GitLab; I'm guessing that might have made it easier for you guys to run the code in browser (no idea, I never used it before). Also, the last test...

 
Greetings, Programs.
 
2:25 PM
What are you asking, specifically? Are you asking us to check the quality of your code? If so, you should probably ask for that here: codereview.stackexchange.comJordan Singer 39 secs ago
 
For working code, codereview.stackexchange.com seems more appropriate. — Jarod42 29 secs ago
assuming your code is compiles and is correct this question should move to codereview.stackexchange.comuser463035818 32 secs ago
I'm voting to close this question as off-topic because it should be on code review — Alan Birtles 54 secs ago
@pmg: Side-effects in a printf statement are evil. In code review, I'd definitely raise an issue over that. — MSalters 29 secs ago
 
@Ludisposed question protected now
 
2:41 PM
@Heslacher good mod :+1:
 
;-)
 
@AlanBirtles - it's off-topic on code review. That is only for working code; this is not working code. It is supposed to multiply two rectangular matrices to produce a square one. It doesn't. — Martin Bonner 29 secs ago
 
0
Q: Swap previous non-whitespace character in emacs buffer with some known analogue

Srv19Emacs command for quick substitution of previously-typed character. This is supposed to help input umlauts quicker by switching letters to their analogues and so on. (defun krv/last-char-check (&optional pos) "Find previous non-whitespace character in current string. Return in form of (positi...

 
3:01 PM
Hey, mods, someone's spamming the site. @SimonForsberg @Jamal @rolfl @Malachi @Vogel.
7
Q: Snake game made in Python

Vicente BermúdezI made a snake game with /some/ code from thenewboston's tutorials when I had just started Python. I think it wasn't a good idea to start game development right away since I didn't even know if what I did was correctly coded. I didn't use classes and objects since I didn't know how to use them....

 
Sorry guys, didn't know that codereview.stackexchange.com existed, I will delete this here and repost it there. — Patrik Šoukal 59 secs ago
 
A bunch on that question.
 
@Hosch250 Free spam flags. Enough spam flags should take care of it and the users.
 
I recommended deletion in the LQ review.
 
Isn't it rude or abusive?
 
3:04 PM
They're gone.
 
oh gee... thanks for the heads up....
 
Thanks.
 
@skiwi Yes, but for some reason I can't remember you're supposed to spam flag them.
 
~sigh
 
@Mast Then maybe they shouldn't say "it's promoting a service without disclosing affiliation".
 
3:07 PM
@Mast abusive covers this
spam and abusive are both "red-flags"
 
I'll go and scour meta for a bit, starting to doubt my sanity.
 
0
Q: User class: getting user data, logging in, secure CSRF session handling, logging out

potatoguyI reference to my previous code: User class: getting user data, logging in, secure CSRF session handling I re-wrote my SystemUser class, without the DI container (for now), I'm still trying to figure out how to structure my code to work with dependency injections container rather than a singlet...

 
Ugh.
Yes, they shouldn't be flagged as spam but as rude/abusive.
219
A: What are the “spam” and “rude or abusive” (offensive) flags, and how do they work?

KipNote for moderators: Some sites, including Stack Overflow, have more permissive, overriding guidance on the handling of these flags. What makes something spam and when should I flag it? A post should be marked as spam only if it advertises a product, service, or similar and is unsolicited or la...

It's all there.
That's the nth brainfart today, I'm out.
 
And "red flags", like red shirts, die.
2
 
@Vogel612 Okay, nice, so in this case it doesn't matter?
 
3:24 PM
@Donald.McLean Is that a communist joke, or am I missing something?
 
@Hosch250 Star Trek
 
Oh.
 
In Star Trek, the later series anyway, red shirts are the commanding officers.
They tend to get hurt.
 
something something tvtropes
 
0
Q: C++ Maybe<T> implementation

Andrew P.In order to improve my understanding of C++ template meta-programming, SFINAE, references, and overall class design, I've tried to implement a Maybe<T> class in C++. Of course, the class is heavily based off of Haskell's Maybe Monad, and has the same functionality. I am aware that std::optional<T>...

 
3:26 PM
Let's hope they don't have to go into combat. They'll get sniped.
@Vogel612 Not at work, k?
 
Wiki has a relatively SFW version of the story here.
 
Talking about combat, I need to get Sledgehammer's (nickname, forgot his real name) book about WWII.
He survived Pelau (or something like that) and Okinawa.
 
@Hosch250 I know of an operation Sledgehammer, but I presume that's not the same?
 
No, this is a private (he got sent to officer training, but deliberately flunked so he'd go into combat sooner) with the last name Sledge in WWII.
His nickname was Sledgehammer. His first name may have been Eugene.
 
Yes, Eugene Sledge.
With the Old Breed: At Peleliu and Okinawa, that's the book I presume.
 
3:30 PM
Talking about which, apparently the US Seventh Army captured part of France never before taken by pure force of arms.
@Mast Yeah.
We had some good generals and tough soldiers in that war.
 
looks like Heslacher did the right thing there to prevent more posts
 
It was actually linked in chat before I did, but they didn't call the mods directly.
Hi, @Malachi.
 
possible answer invalidation by Razvan Zamfir on question by Razvan Zamfir: codereview.stackexchange.com/posts/210483/revisions
possible answer invalidation by Ayxan on question by Ayxan: codereview.stackexchange.com/posts/211366/revisions
 
@Duga Rolled back.
@Duga Interesting. They left the old code, but added updated code. Do we have a policy on that?
 
3:47 PM
@Donald.McLean just the same...rolling back
done
 
I haven't bothered to digest your script, but your question is worded like it is "working code" and you wish for it to be reviewed for the sake of optimization. While Stackoverflow is an okay place to post this type of question, CodeReview is a dedicated Stack Exchange site that is full of extremely knowledgeable coders who are willing to scrutinize every line and deliver comprehensive reviews. I strongly urge you to post your question there. Please read how to ask before posting. — mickmackusa 7 secs ago
 
0
Q: Python Firewall-Connection-Event Filter too slow

peacemakerI've written a little piece of code to filter Firewall-Connection-Events by a certain group of IPs. But the code can't keep up since the input is fairly huge. I am looking for ways to make this code more efficient in order to handle the Firewall-Connection-Events. [READ_CLIENTS] The code starts ...

 
4:28 PM
0
Q: Finding the longest word without these characters follow-up

AyxanHere I asked this question: My goal is to go through the list of all English words (separated by '\n' characters) and find the longest word which doesn't have any of these characters: "gkmqvwxz". And I want to optimize it as much as possible I updated the code with the help of sugges...

 
This is more of a code review question. Saying that, is the sheet where you are trying to apply these filters in the same workbook as your code? — Zac 34 secs ago
 
@Duga funny when I imagine how that punctuation would make it sound
Monkin BTW
 
4:44 PM
0
Q: Is there a more elegant way to put this series of filters?

Nick LantaI have a ton of code blocks for autofiltering a report and applying a value to the SpecialCells(xlCellTypeVisible) range. It does the job, also quickly, but I just would like to truncate it wherever possible so I could lessen the strain during any debugging period. With P_Template.Worksheets("S...

 
@Duga another zombie got taken out :)
 
@SᴀᴍOnᴇᴌᴀ If you really want to take out a zombie, I have a couple.
 
@Hosch250 okay I will check
 
TBH, I'm pretty sure the review would be "it looks good" ;)
At least, until C# 8 comes out.
 
@Hosch250 that's about all I might say about this code
 
5:04 PM
If anyone wants to, here's a tip for this question: codereview.stackexchange.com/questions/194333/playing-checkers
Don't use == null, use is null.
 
5:15 PM
0
Q: Created Insert Update Delete Application on single page MVC

mitesh jainHi I have created the on Application on MVC which make Select, Insert, Update and Delete in single page and I need to make it optimise. Please help me out. I have created 2 partial page one for grid and another to submit data and I had called that partial pages into single View Index.cshtml pag...

 
@Hosch250 Hey. Looks like another mod or the system handled it already
#LateToTheParty
 
5:31 PM
Monking.BTW
 
Welcome @JoshVanderHook - have you been here before?
I didn't mean to scare him away :/
 
6:02 PM
0
Q: Xamarin.Forms and Prism NavigationParameters implementation

AphelionI am developing a Xamarin Forms project and use Prism Library as tool to implement the MvvM pattern. I have two views: PersonViewModel: Summary and has Edit button PersonEditViewModel: Details, and Cancel Save and Delete buttons The proposed concept: Handle the result of the PersonEditViewMo...

 
6:16 PM
I'm voting to close this question as off-topic because it belongs on Code Review instead. — dfeuer 42 secs ago
@dfeuer In the future, please don't use the existence of the Code Review site as a reason to close questions. Evaluate the request & use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic and Flag it for Mod intervention. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSᴀᴍ Onᴇᴌᴀ 11 secs ago
 
0
Q: unique_ptr basic implementation for single objects

kapilThis is an implementation to simulate the basic functionality of unique_ptr. This doesn't provide features like custom deleter and make_unique(). I would really appreciate any feedback to improve the below code, any other api's that I should be providing etc. my_unique_ptr.h #ifndef MY_UNIQUE_...

 
@SᴀᴍOnᴇᴌᴀ Yeah, you gotta be careful about showing your tentacles. I've yet to meet a human who can see us and not go insane.
 
@Hosch250 okay
 
6:49 PM
0
Q: Simple hangman game - first python project

AMJI created a basic hangman game that uses text file to select secret word. import random secret_word = [''] user_list = [] number_of_tries = 5 guessed_letters = [] user_tries = 0 user_guess = '' def select_word(): global secret_word, user_list with open('secret_words.txt', 'r') as f: ...

 
Thanks, Santa!
 
7:06 PM
in Coding Projects and Factorio Heaven, 9 secs ago, by skiwi
I'm not sure if my code is doing the wrong thing, or if I'm telling it to do the wrong thing right now
 
Sounds like a question for codereview, not stack overflow. — Rufus L 41 secs ago
 
@skiwi Either the code doesn't work as intended or you don't work as intended. Something's broken.
 
@Mast "Something's broken" is definitely a truth
Because I just made that...
 
@skiwi Oh, that might just be Unity being an ass again.
Have you tried walking through the scene with a camera?
 
@Mast It's Blender :P
My bet is on zero width faces
 
7:15 PM
Something along those lines, probably.
Does your code eliminate a field by chance by reducing width to zero? Because that doesn't always work.
 
7:52 PM
0
Q: Python - Treasure hunt game

J.PeggyThe code below is for a board game program, which works by placing the user on a grid which then tasks the user with finding all the treasure chests. Each chest landed on gives 10 gold however landing on a bandit means all your gold is taken, there are also different difficulties. The end score i...

 
8:07 PM
0
Q: TCP Socket High CPU/Memory usage after 5mins

SwiftyI'm building a server app that accepts incoming TCP connections. (roughly 300 unique clients). It's important to note that I do not have control over the clients. I have found that some of the connecting clients remain idle for quite some time after making the initial connection and sending the ...

 
8:23 PM
0
Q: Sorting algorithms in Kotlin - Bubble, Insertion, Selection, Merge and Quick sort

Hungry Blue DevIntroduction I decided to try Kotlin because of its forgiving nature to long-time Java users. I implemented a few introductory sorting algorithms and would like to have them reviewed, not just to ensure that I'm applying Kotlin correctly, but also to improve my style and get rid of any potential...

 
8:54 PM
0
Q: Optimize Langdon's Ant simulation

GreggzI created a simple program to simulate the Ant's path. It works great until 10^6 (Takes 5 minutes to run). After that it takes more than 14 hours to get to the 10^7 mark. I don't get why it takes so much more time, shouldn't it just take 10 * time it took to get to 10^6 iterations assuming my a...

 
9:10 PM
0
Q: Breaking a 32-bit value into bytes for an ArrayList

BeskaI am very new to Java and its collections and I'm trying to figure out "best" way to populate an ArrayList in Java. In particular, I'm trying to take a 32 bit number, divide it into bytes, and put it into big-endian order into the list. I'm not particularly interested in hyper-optimizing in thi...

 
9:39 PM
This kind of question is more suited for Code Reviewglennsl 25 secs ago
@CROSP In the future, please don't use the existence of the Code Review site as a reason to close questions. Evaluate the request & use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic and Flag it for Mod intervention. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSᴀᴍ Onᴇᴌᴀ 10 secs ago
 
10:12 PM
0
Q: More elegant way to express nested cats EitherT/OptionT code

kag0We've got some rather unattractive code below that asynchronously looks to see if a value already exists, and if not performs a side effect. Ultimately resulting in a possible error. it seems to me there must be a better way to do this than wrapping and unwrapping OptionTs. Any suggestions? def ...

 
10:35 PM
possible answer invalidation by Paulo on question by Paulo: codereview.stackexchange.com/posts/211504/revisions
 
@Duga Thanks @Zeta for rolling it back
 
You're welcome, was just going to tell @Duga about the rollback
@CaptainObvious That's example code.
@skiwi The plane isn't double sided.
You need to add "Double sided" in "Normals" (part of object data).
 
10:59 PM
0
Q: Implementation of generic Graph class and Dijkstras

vikarjramunI participate in competitive programming contests, and I found myself implementing and re-implementing graphs constantly. So I decided to create a reusable implementation of a Graph class, and implement some common methods for it, including DFS, BFS, and Dijkstras. Are there any edge cases that ...

 
11:15 PM
0
Q: Encapsulating Permissions Logic, but looking to Avoid Circular Dependency

KyleMitI'm trying to encapsulate permissions logic for a particular view model in a way that the permission logic has access to the view model object, but is also exposed inside of it Trivial Implementation: public class ClientViewModel { public Client Client { get; set; } /* permissions sect...

 
@Zeta Not sure if that was the idea, my intention was not to make a zero width plane though, I fixed that and now it's fixed
 
11:47 PM
@Hosch250 Hi
I kind of feel like I am playing Chat Marco Polo
2
 

« first day (2082 days earlier)      last day (1938 days later) »