« first day (1922 days earlier)      last day (2086 days later) » 

12:00 AM
RELOAD! There are 5471 unanswered questions (89.9679% answered)
 
12:40 AM
0
Q: Iterate over 2D array and return an array of Objects with all the possible combinations

CraquesWanted to know if my code can be improved to create an array of objects from a 2d array. There is a similar solution here but I could not understand how to implement it for returning an array of objects. Here is my code function permuteHelper(myArray, combinedArray, keys){ const currentA...

-1
Q: HTTP Response Model Approach

x80486I'm trying to come up with something that would let me model an HTTP response in Kotlin. So far, this is what I have: object Http { object Message { // HTTP 2xx const val OK = "OK" // HTTP 4xx const val BAD_REQUEST = "Bad Request" // HTTP 5xx const val INTERNAL_SERVER...

 
Edit your question with a code fragment, e.g. Minimal, Complete, and Verifiable example, expected behavior and actual behavior. If you code works and you are looking for optimization, then Code Review would be a better site to post to. — Thomas Matthews 23 secs ago
 
12:55 AM
0
Q: Generic Vector Class using smart_pointers

SnorrlaxxxI have decided to rewrite what I did here, following the suggestions to use smart pointers. I will rewrite the other data structures as well using smart pointers where appropriate. I just want to see how my code stands now, I am sure there are still areas I need to improve or fix. I again want t...

 
 
1 hour later…
2:01 AM
What don't you like about your code? It seems pretty reasonable to me (except maybe for the method named function(), and the unused event). You might post on codereview if you don't have a specific question — CertainPerformance 6 secs ago
 
2:30 AM
0
Q: Recursive function to validate tree graph needs a return condition

xtianI have a tree graph. Each node has attribute 'amount'. The rule governing the attribute value of root is this, The root 'amount' value is the sum of the 'amount' attribute of each of it's children. This continues to the last node with children. In other words this tree's attributes are unl...

 
3:18 AM
0
Q: Buying army unit

Prajwal VenugopalI am learning python and came across a task wherein to design a combat game. Each player has 10 credits and can buy army with the funds. I wrote a long code to buy one army unit for each player but I'm not sure how make that code short and also how to add army to their respective army list for th...

 
 
1 hour later…
4:20 AM
Monking
 
4:31 AM
Monking
 
Monking
 
4:45 AM
Please note that this site does not accept "code review"-type questions. We have a sister site that does, Code Review, where you may be able to get a better answer. This site, Stack Overflow, is for help solving specific problems with code. — gparyani 36 secs ago
 
5:40 AM
0
Q: Adding Display Name in Identity Claim after login successful in ASP.NET Core

SirajLogin Action [HttpPost, ValidateAntiForgeryToken] public async Task<IActionResult> Login(LoginViewModel vm, string ReturnUrl) { if (ModelState.IsValid) { var loginResult = await _signInManager.PasswordSignInAsync(vm.UserName, vm.Password, vm.RemembarMe, fa...

 
5:58 AM
Monking
 
@gparyani The following: "Any suggestions and corrections are appreciated to make the code work." indicates the question is not ready for Code Review yet. If it doesn't work or the OP does not know whether it works, it's not on-topic there. — Mast 40 secs ago
 
6:27 AM
Turns out one of the links in the Code of Conduct links to an easily defacable Google Docs document...
0
Q: Code of Conduct links to text of dubious quality and relevance

MastAt the bottom of the Code of Conduct: This text incorporates ideas and language from the Coral Project, Buffer, and Tech Solidarity codes of conduct. First of all, have some imaginary points for including where you got your inspiration. Credit where credit is due, etc. However... Has anyo...

 
6:43 AM
0
Q: pytorch tuple change according to batch size

codeforceI have a tuple ((1X1X100),(1X1X100)) . I need to use batch size of 2, so make it ((1X2X100),(1X2X100)). After that later, i want to get the similar form of ((1X1X100),(1X1X100)) back from it. How can i do that in pytorch?

0
Q: remove the first value for a doubly linked list

Giladyou need to remove the first element which contains a given value from a doubly linked list. I created two solutions since I find the edge case of removing the first element to be problematic. so I solved it using 2 approaches. using System; using System.Diagnostics; using Microsoft.VisualStudi...

 
6:58 AM
@Magisch You around? Might want to use the chat instead of the comment thread getting too long.
 
@Mast am
 
0
Q: Scrape data from website into dataframe(s) using Split function

QHarrOutline: This code uses the Split function to extract specific information from the following website: https://www.webscraper.io/test-sites/tables. The required information are the four tables visible on the page with headers "#", "First Name","Last Name","Username". I am extracting the inform...

 
@Magisch I'm familiar with the political stance of SE, that's not the issue. The issue is them linking to a document which is a minefield where nobody knows what the content will be next week.
As you said, too easy to make assumptions based on that document.
 
I think this is out of proportion
More of a cross that bridge when we come to it kind of deal
I don't think the document will be defaced
 
I don't know how revision history works in those documents so I'm not sure it hasn't already happened.
 
7:03 AM
Do you object to anything particular in the document? It's just an inspiration not a template
It could easily mean they liked some of the wording and wanted to credit it as you do with things you've taken inspiration from
 
The wording of that document is worse than the one I linked to as alternative and worded worse than SE's CoC.
It's almost offensive to look at.
It's a poor document.
 
Maybe you should focus on that in your criticism then and not the fact that it could be altered further
 
Based on the revision history that document definitely has been busy in the last 24h.
But yea, I'll add a note.
Done.
 
7:46 AM
It might be better to also check if the dictionary is not null as here! — S.Serp just now
 
8:03 AM
0
Q: What's the elegant and most reusable coding way to write very same successive logic overlaping blocks of code

Curcuma_Intro: I encountered this situation many times, through my coding life, although I just wrote bad code in my eyes, and I believe there is no established pattern, but good code way might exist. Case: The algorithm work on two categorical inputs like: params = [A={type:A, {params_:_}}, B={type:...

0
Q: Simple React component to view cached data and test result from API

Danny GoodallThis is only the front end side of things which I have at the moment, as the back end is still being worked on. But as this is my first attempt at a react component, I'd like to know if there is anything I can improve on it. The component has a text area for viewing the current data stored in t...

 
@CaptainObvious Hypothetical
Monking
 
8:27 AM
Monking
 
@CaptainObvious Closed as UWYA, turns out to be broken. Now we know.
 
I'm voting to close this question as off-topic because it's a code review question — Jean-François Fabre 32 secs ago
Hmm. If I drop all the if/else how will it know how to tally according to what the roll amounts to? Also, I did not know code review was a thing. Thanks for the info — Ghost Ark 50 secs ago
 
9:06 AM
0
Q: Finding the longest word in a String

NeerI am solving this basic algorithm problem from freecodeCamp. I am using for loop as I am a beginner and have not gone too far using higher order function. I am also trying to understand how this for loop works. Suggestions are welcome :)My code looks like this: function findLongestWordLength(s...

 
I assume that this code won't get the correct result for e.g "What is". — Heslacher 30 secs ago
Am I wrong?
 
Monking
 
Monking
 
@Heslacher yea that looks like it will break
 
thanks. VTVC + comment
 
9:29 AM
@Heslacher It's also broken for the example provided by OP.
 
9:58 AM
Although the specification might be broken too, now I think about it...
 
10:09 AM
1
Q: Accesing View from ViewModel

JanDotNetHaving a view (grid control) that provides some functionallity via methods (primary SerializeView / DeserializeView) that should be called from the view model which is bound to the view. One point to consinder is, that the view model may not be bound to the view during the deserialization proces...

 
10:40 AM
0
Q: Undocumented method in electrons webFrame object?

Akshay AnuragI was going through the code of "WaveBox". It uses electron's WebFrame. The problem is that WebFrame doesn't have this method (WebFrame.createContextId), but the code uses it. I am unable to understand how is it possible and how is it working ? The link to the file which is using the aforementio...

0
Q: Manager that collects and handles multiple tasks that run on events like window.scroll, window.resize etc

lampshadeI'm working on a website where different things can occur on resize and scroll events. I only want one event handler that comes into play, whenever something in the DOM must be changed. So I created a TaskManager where you can register objects and callbacks, that are run, when the specific event...

 
11:00 AM
Monking
 
If you want a code review, then post it as a question on Code Review, not as an answer on Stackoverflow. — Quentin 1 min ago
 
@CaptainObvious No code, neither OP's code, not even code understood by OP.
 
11:28 AM
0
Q: Multi Type view item to firebase store

NepsterI am adding multi type question to firestore.. public class AddQuestionActivity extends AppCompatActivity implements View.OnClickListener { private Context mContext; private EditText titleOfQuestionEt, answerOfQuestionEt; private Button optionBtn, optionIndexBtn; private Spinner...

 
11:39 AM
Should this not be at Code Review and not here? It's functioning code and the only request seems to be optimization. — Roope 42 secs ago
 
11:56 AM
I think your question as it stands might be better suited for Code ReviewThe White Wolf 38 secs ago
 
0
Q: Calculating Primes

KajkrowI am new at c#-programming. I wrote a little program in c# to calculate all primes until a user-given value. Ignoring the lack of computing power I wrote this programm to handle theoretically very huge numbers. The code works properly. I have no errorhandling simply because it is a little progra...

 
12:10 PM
Answered this 8 month old zombie. If anyone can either put in a vote or tell me what I should improve on the answer, we got another zombie down.
 
Hi and welcome! Maybe, as far as your code works, this should be better place for your question: codereview.stackexchange.com. — BenRoob 43 secs ago
 
0
Q: Is it bad pratice to create a custom observer and trigger the view update outside the presenter, MVP?

DanielI would like to have some input here if possible, about the way I'm dealing with network request with Rx in an MVP structure. I did the following structure so I can mock and unit test more friendly. I'm implementing it using Single, and when it is subscribed, I create a new instance of a custom...

0
Q: Resolve dependencies of constructor having parameters

user176787I have a constructor class with injecting dependencies in it: public class Facade : IFacade { private readonly IService _Service; private readonly IServices _Services; public Facade(IService Service,IServices Services) { _Service = Service; ...

 
@Mast Since this is mostly PEP8, you can check if pygame.locals is meant to be imported using a wildcard, otherwise mention that also.
 
@MathiasEttinger Turns out that entire line is unnecessary.
The import can be dropped.
Thanks!
 
My cat puked and my dog tried to eat it's vomit. I assume that means they're friends now.
2
 
12:26 PM
Symbiotic relationship.
 
GF got all mad about it and said "that's gross" and my response was "He's cleaning."
I'm a terrible person but dang am I funny sometimes.
 
-3
Q: Please help me with the code

NathWrite a program that prompts the user to enter five integer numbers and store them in an array. The program should then add 5 to those elements divisible by 5. Display the modified array

 
12:46 PM
0
Q: need help creating a start button, quit button and try again button

Jackrecently made a snake game but i have no idea how to make a start button which takes me to the game and a quit button which terminates the game. Also need a try again button after the game is finished. Plz help if u can from tkinter import* import random #Globals WIDTH = 800 HEIGHT = 600 SEG_SI...

0
Q: Code duplication, how to prevent it

skmI have a function that checks some conditions and based on those conditions other functions will be invoked. In this function both else part will call the same function and the returned data will be the same as well. Is it possible to optimize this function. function myFunction(id) { if (c...

 
1:02 PM
This question seems more suited for Code Review. — mkrieger1 18 secs ago
 
0
Q: Better and shorter solution of PHP code (wordpress, woocommerce)

Dima VizelkaI wrote PHP code(I am trying to display woocommerce notice - free shipping for $40 & under only once on shop page and once on cart page, but also in cart should not be more than 40$), the code works, but i am not sure that it is the best way to do it: $actual_link = (isset($_SERVER['HTTPS']) && ...

 
1:21 PM
Even better post your code to codereview.stackexchange.com and let someone code review it — JGNI 23 secs ago
 
1:34 PM
0
Q: Filter template meta function

FlamefireI wrote a simple C++ template meta function for filtering out types from a list not matching a predicate. This is similar to Filtering variadic template arguments but does pattern matching instead of std::conditional with the aim of being faster. To that end no empty typelists are concatenated wh...

 
2:06 PM
0
Q: Updated Minesweeper library for any GUI

JamA Minesweeper library meant to work with any GUI. It is an update to Minesweeper library for any GUI. I followed the answer, and have moved many methods from Game to Board. Three sections: Game, Board, Tile. One unit test class: GameTest. Game public enum GameState { NotStarted, Start...

 
argh... eclipse..
 
2:21 PM
Monking
 
0
Q: Injecting different services with the same interface in CQRS?

HeathcliffI have the following problem. I have a search functionality that has different options. Depending on which options you select, you have to use a webservice or another. I have two webservices, let's call them WSOne and WSTwo, that have the same interface. Say, it looks something like this: public...

 
@CaptainObvious RBA
 
3:02 PM
This would probably be best to post on Code Review codereview.stackexchange.com - Since it is opinion-based and too broad for this area of Stack. — Funk Forty Niner 21 secs ago
better to ask this in code review stack exchange forum — InAFlash 16 secs ago
 
0
Q: Python having trouble converting string to float, but only sometimes

Ryan LarsonI'm writing code that interfaces a load cell to an Arduino Uno, which then communicates the measured load to a Python program over serial. The trouble I'm having is that in order to do further operations on the data, I need to turn the data into floats. I've arrived at a solution that works most ...

 
I'm voting to close this question as off-topic because it is asking for a code review (and this thus too broad / opinion based). It could probably be adjusted to be on topic for the code review stackexchange. — Quentin just now
I'm voting to close this question as off-topic because questions asking us to review "real" working code belong to codereview.stackexchange.comGhostCat 54 secs ago
You could try here as well: codereview.stackexchange.com Seems more appropriate — Kevin Amiranoff 39 secs ago
@SteveSmith: No, the OP definitely does not need Code Review. This is fairly incomplete code as is. — Makoto 26 secs ago
@GhostCat Feel free to recommend the OP post on CR but in the future, please don't use Code Review as a reason to close a question. Evaluate the request and 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. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 23 secs ago
I'm voting to close this question as off-topic because it is asking for a code review (and this thus too broad / opinion based). It could probably be adjusted to be on topic for the code review stackexchange. — Quentin 34 secs ago
@Quentin I respectfully disagree — despite the title, this isn't really asking for a code review — they have said the code is not working and are trying to figure out why. The main problem isn't that this is opinion based, but rather that they have not said specifically what is not working. — Mark Meyer 36 secs ago
 
3:30 PM
@Duga code of Conduct taking an effect? or maybe that users words are always as elegant and respectful...
 
@202_accepted I've never thought of implants as an apocalypse scenario. Some of my favorite stories use the tech.
 
@Donald.McLean I watched all the "Black Mirror" episodes so maybe my view is tainted...lol
 
0
Q: PHP/MySQL login

Imię NazwiskoI just wanted to ask if this is a secure code (doesn't really matter if it's optimal or not) The code if(!$_SESSION['logged']){ if(!$_POST['inputlogin']||!$_POST['inputpassword']){ require 'cpanellogin.php'; die(); } else{ $con=mysqli_connect("localhost","root","","librarydb"...

 
argh ...
 
3:46 PM
posted on August 08, 2018 by CommitStrip

 
> ME: changes one dependency, rebuilds local repository
Eclipse: NO CHANGES IN REPOSITORY
ME: restart eclipse
Eclipse: EVERYTHING BORK OMG!!
ME: ya, the versions changed. just keep using everything
Eclipse: I found stuff. I still can't build anything
ME: restart
Eclipse: hmmm .... seems legit
oh for crying out loud!
 
@Vogel612 ::sends internet commiserations::
 
I've literally been dealing with that nonsense for the last four hours
at least I'm fixing stuff piece by piece, but...
ugh!
 
Man I deal with crap like that daily with Visual Studio, I've found the best fix is to burn it to the ground and start over.
 
i'm currently cursing my verilog ISE
 
3:55 PM
Well the problem is you chose Verilog.
 
why, is VHDL better?
 
@202_accepted 300kLoC in one of the projects I'm working on says no
note that I already dropped that linecount by ~10%
 
[i mean, really, part of the problem is i know nothing about hardware and very little about software, so it's expected i'd have some trouble]
 
@Vogel612 I have half that many LoC in one file.
@heather I always liked VHDL better
 
2 mins ago, by heather
@Vogel612 ::sends internet commiserations::
 
3:56 PM
But I'm also contrarian and a terrible person
@Vogel612 They make alcohol for that.
 
@202_accepted i haven't tried VHDL, but at this point i'm kinda committed.
 
Bummer.
 
requiring internal packages is just so wrong ....
 
i mean, not really, because i'm not dealing with a 150k LoC file or anything near that, but I've banged my head against the wall enough.
 
You'll do that with hardware.
It could be worse.
 
4:02 PM
i'm not going to ask ;)
 
I'm currently going through the 3,000 emails I have in my inbox from the past 3 months to categorize them.
Subjects like "Sent from Snipping Tool"
And "Can you get rid of the '*'?"
 
3,000? I'm not sure i have 3,000 in my entire email.
yeah, i have ~2500...tbf i've switched emails a few times, but still.
 
I get like 500 a day lol
Many I delete many I move without thinking
 
4:27 PM
I typically achieve inbox zero (or close to it) with my work email; I don't usually move emails in my personal inbox to separate folders, though do sometimes apply labels (or have them applied automatically)...
 
Since you're learning and probably don't want to use a library, I'd start with one of the answers to How can I read and parse CSV files in C++?, and discard or not record the row data you do not want. Once you haver that up and running, you'll probably spot a couple things you can do to improve on it. If not, Code Review may be right for you. 1/2 — user4581301 43 secs ago
More to the point, ask here if you have problems writing your solution. If your code works, but you would like feedback on it, don't ask here. Ask here instead. — WhozCraig 49 secs ago
 
@202_accepted Ahh, I haven't seen any of that series. Implants are used to great effect in at least three of my favorite SF book series.
 
4:59 PM
Efficiently is off topic at SO. You should go to code review with this question — Andreas 12 secs ago
 
0
Q: Is this code compiled properly. A Revenue tracker that modifies purchases amount to cents to track

coreyIm working on adding a revenue tracker to a site. I start a javascript courses in September so i'm still unfamiliar on the ins and outs of javascript. Currently the tracking is not working This code should only take purchases from under 600$ and push it to our tracker, while multiplying our pric...

 
@SamOnela Showoff
 
5:19 PM
There are lots of very smart people doing fascinating work on cryptographic voting protocols. We should be funding and encouraging them, and doing all our elections with paper ballots until everyone currently working in that field has retired.
8
 
5:51 PM
> "I have neither Twitter nor Instagram. Therefore, I walk around the streets and proclaim to randomly selected people, what I eat, what I drink, how I have it at home etc. After all, it is important to build networks. So far I have three followers. One is apparently a doctor, the others are police officers."
 
6:16 PM
@RMunroe safety and security are two very different aspects...
3
I'd surely agree that airplanes and elevators are safe, but not so much on their security
 
Another idea, maybe post to codereview to see if there are any tips or optimisations they have. — Alex 24 secs ago
 
@Duga yah... like as if we have tips... /s
 
6:37 PM
> we do what we must because we can
 
portal reference?
 
@hoffmale yes; I honestly only really know about the song because I played Rock Band 2 ... didn't really play Portal
 
lol
now that song is stuck in my head
 
what would you rather have stuck in your head?
 
7:06 PM
0
Q: creating a "stack" and then clearing it

sourlemonaidI have a prompt that says"in c#": Design a class called Stack with three methods. void Push(object obj) object Pop() void Clear() The Push() method stores the given object on top of the stack. Make sure to take into account the scenario that null is passed to this object. We s...

0
Q: Generic Repository and Unit of Work with Dapper

neldridgI am attempting to update some legacy code that I work with, but my knowledge of data access is limited to a basic use of Entity Framework and simple Dapper. After some research, I have a loose attempt at implementing the repository and unit of work patterns in C# using Dapper. In the actual imp...

 
7:21 PM
0
Q: Travelling salesman problem using genetic algorithm in C++

NewbieI have implemented travelling salesman problem using genetic algorithm. Since project is not so small I will give short introduction. GeneticAlgorithmParameters - Struct responsible for general algorithm parameters. Point - Super small struct, you can think about it as a city or whatever. Path...

 
@SamOnela Aperture science.
 
Seems like this might be a better fit on codereview.stackexchange.com - as it currently sits, this question might fall under being opinionated. — Adam 7 secs ago
Please do read the help center for Code Review before posting there; they have specific rules, just like Stack Overflow. — Heretic Monkey 51 secs ago
 
7:51 PM
@202_accepted Ahh the memories
 
8:09 PM
0
Q: Shunting-yard algorithm

VincentCI implemented the Shunting-yard algorithm in Python, I have experience in C# but I'm looking for comments making this more pythonic. I'm also be interested if these methods would be better as classmethods instead of staticmethods. from collections import deque import re class ShuntingYardParse...

0
Q: Restarts specific services across 8 servers

Bill GreerI created this script to stop and then start specific services across an environment of 8 servers. The server names are Apollo-1 thru Apollo-8. I'm looking for suggested changes to make sure my script is acceptable for production. #Create a credential to be used on remote machines $User = "M...

 
8:24 PM
0
Q: Is this a known design pattern?

user3366592While exploring some source, I noticed something like this piece of code: class Entity; class EntityManager { std::vector<Entity*> m_Entities; public: void AddEntity(Entity* ent) { // some additional checks before adding... m_Entities.push_back(ent); }; void ...

 
8:44 PM
@CaptainObvious VTC stubb code
 
Jamal-closed
I was going to type Jamalized but I think that would just entail it was edited rapidly, right?
 
@SamOnela Just that it was edited at all.
 
@202_accepted maybe black mesa
that song is extremely simple to play on the guitar
 
8:59 PM
oh yeah I think I tried it once
I often don't think of that when trying to remember songs to play
 
@202_accepted Aperture science sounds like some of the work I've done on the Hubble.
 
9:43 PM
0
Q: React Container to fetch list of hikes from API and display, looking for feedback

dkirby28I've done a number of smaller courses/video series on React/Redux, just looking for feedback on how clean this code is. Container calls a fetch hikes action which pull a list of hikes based on the user's current location, and returns them as a list. Don't worry about styling, mostly just looking...

0
Q: Is this form of create an instance of an unit of work (NHibernate) valid in .Net Core DI?

KillbunnyI'm trying to figure out how to create a NHibernate UnitOfWork using .Net Core Dependency Injection, I was just hard-codding the connection string before moving it to appsettings.json configuration file, the thing is, is this form of creating a UOW in the service.scope valid? It works.. but i'm...

 
 
1 hour later…
10:46 PM
0
Q: K’th SmallestElement in Unsorted Array in python

NinjaGI was solving this sorting problem, and I was wondering if I can get any code review and feedback. You can find this problem online. # Find Kth Smallest Element in a Range # # Prompt: Given an unsorted array of whole integers in the range # 1000 to 9000, find the Kth smallest e...

 
11:32 PM
You might have some luck posting this on the code review stack exchange site. As I see it, there are some potential problems with the way that commands are parsed, very similar problems to the ones with shell=True… this code is not much better. Second, if you create a pipe using stdout=PIPE you can then pass stdin=proc.stdout to use the same pipe, which is a better way to connect programs. But it requires a bit of thinking. — Dietrich Epp 51 secs ago
 
@Vogel612 That was a joke, haha, fat chance.
@Donald.McLean Man the stuff you work on sounds so fun
 

« first day (1922 days earlier)      last day (2086 days later) »