« first day (2487 days earlier)      last day (1531 days later) » 

12:00 AM
RELOAD! There are 6399 unanswered questions (90.1206% answered)
 
12:27 AM
@Mick That is why i used the word likely. My notes are there as fair warning, and also should be noted an explicit implementation is not private and in most situations would fail a code review. Good luck to you both :) — Michael Randall 45 secs ago
 
1:12 AM
Stack Overflow specializes in not-working code. If your code works without problems but you want comments on its style, security, performance and more, ask on Code Review. — usr2564301 6 secs ago
 
0
Q: Algorithm for shifting data

JordanI was bored and sketched out this idea in pseudocode( I will try to turn it into C++ later) for taking a set of numeric data and manipulating it. I ran through it manually and it seems to put the data in a range [0, something] count = data[count] = \{ d_0, d_1, \ldots , d_(count -1) \} sigma = $...

0
Q: My attempt at Pathfinding algorithm

TlomolokoI've been working on making my own pathfinding algorithm without copying anyone's code or following an already existing logic. The algorithm works fine without obstacles but it has trouble finding the most optimal path when there are some obstructions on the way, that is, when it does find a path...

 
"_ opinions are exactly what I'm looking for..._" Maybe you'd want to post this question on softwareengineering.stackexchange.com or codereview.stackexchange.comfelipsmartins 5 secs ago
 
1:37 AM
1
Q: Use of Function Composition in Haskell

NathanPBI've been studying Haskell and I successfully make an algorithm to decompose a given monetary value in the banknotes it would take to sum this value. A better explanation (and the challenge itself) can be found here. import Text.Printf import Data.List import Data.Ord filterNearest :: Int->(Int->...

1
Q: Is there a way to simplify or shorten this chain of conditionals in this version-comparison code?

Govind ParmarI am wondering if there is any way to meaningfully shorten the chain of conditionals used here to compare two versions. struct VERSIONCODE represents a version number of the form major.minor.revision and CompareVersions returns EQUAL if they're equal; LHS_NEWER if vLHS is newer, and RHS_NEWER if ...

0
Q: Subscribing and manipulating data from API in Angular

Vhin GabuatI hope you can help me. What do you think of the code below? I'm trying to display the fetched data on a table. I structured the data based on the columns table in the UI and stored them in an array, then *ngFor on the table rows on the frontend. Good or Bad practice? Or are there other ways to d...

 
I think making boundary=40 a parameter with a default value is better than making it a top-level constant. That said, your answer is more like an open-ended "here's some ways you can improve the code", which is more suited for Code Review. Stack Overflow is less a place for open-ended questions and answers; for side-notes that are somewhat relevant but don't really address the question, you will be able to write comments once your reputation is higher. — kaya3 8 secs ago
 
 
1 hour later…
3:07 AM
I'm not quite sure what you are asking. If you are looking for feedback on an alternative way to design the interactions between bank account instances, it would be helpful if we could see the code you have already written. If you have a complete program that is working as expected, and you are looking for overall feedback and critique on its design, you may wish to consider asking on CodeReview instead. — Brian 26 secs ago
 
3:30 AM
I'm voting to close this question as off-topic because It belongs on codereview. — user207421 just now
 
 
2 hours later…
5:15 AM
possible answer invalidation by greybeard on question by Jordan: codereview.stackexchange.com/posts/237809/revisions
 
Monking
 
@felipsmartins This is a hypothetical example, those are off-topic at Code Review per their help center. — Mast 29 secs ago
 
@Vogel612 Fun.
 
5:35 AM
possible answer invalidation by Brian Ruff on question by Brian Ruff: codereview.stackexchange.com/posts/179782/revisions
 
@Duga sigh
It makes no sense to do that.
It also makes little sense to roll it back.
 
Monking
 
 
1 hour later…
7:01 AM
This kind of questions would be better placed in Code Review. — vicpermir 58 secs ago
 
 
2 hours later…
8:35 AM
You have codereview for that kind of questions. — Guy 41 secs ago
 
9:17 AM
You're right, the default argument is more appropriate and cleaner. I've edited the answer. Also, I signed up for Code Review and will do this kind of activity over there. Thanks for the tips. — Adam Hosman 22 secs ago
 
9:41 AM
I didn't downvote your question, but I understand why someone did, your question isn't about solving coding errors preventing emails being sent on schedule as you expect. You're asking whether or not the technique you used is good or in other words your asking for an opinion. While I agree that code review is very important, this is the wrong forum for that. [codereview.stackexchange.com](codereview.stackexchange.com) is where this sort of question belongs. I think you'll have better luck posting this over there. — Azeame 10 secs ago
 
10:04 AM
0
Q: Replace String with Numbers and operators into String with Numbers, operators, and commas every 3 digits in Swift

H.LCurrently working with calculator app, and almost done except adding commas every three digits such as 1000 >> 1,000 , 12398 >> 12,398 I've got all inputs into one String variable named process so it looks like var process = "" process += "1" process += "2" process += "3" process += "4" proces...

0
Q: React Hooks - Single instance of state

Dave SalomonI was writing a little coding kata, and wanted to have a hook which managed a list of names. The hook should allow adding a name to the list, and also make the list available to the component. I didn't want to bring in a state management library, or complicate the code with having to useDispatch...

 
10:25 AM
0
Q: Using async / await with dynamic import() for ES6 modules

RouninI am experimenting with the best way to standardise my dynamic import() expressions when importing javascript modules. import() returns a promise, so, to handle the asynchronous steps after theimport() expression, I can use either: .then() syntax; or async / await syntax Whilst I am quite fa...

 
10:45 AM
0
Q: Export sql data to xml and csv

QuickSilverI have the below code that takes the sql data and exports it to xml or csv. The xml is processing at good speed but my csv sometimes takes 1 hour depending on how many data rows it exports. My question is my code effective writing the csv or it can be improved for speed? Has around 40 columns and...

 
11:05 AM
0
Q: Improvements to data access layer

Krish public class EmployeeDBHandler { public List<Employee> GetEmployees() { List<Employee> empList = new List<Employee>(); string sqlConnstr = Utils.GetDBConnection(); SqlConnection sqlConn = new SqlConnection(sqlConnstr); SqlComman...

 
 
2 hours later…
12:54 PM
It's still unclear what do you want RxJS to do, considering that there's no apparent stream here. Anyway, this looks more appropriate for Code Review than Stack Overflow: codereview.stackexchange.commbojko 43 secs ago
 
1:14 PM
Please post this type of questions to codereview.stackexchange.com Thanks! — palaѕн 13 secs ago
 
1:44 PM
Since this is a working implementation, I suggest you also ask about this code on CodeReview for more feedback. — phipsgabler 15 secs ago
 
0
Q: Better way to use Python Pandas?

alexs973I'm trying to compile stats for college basketball games. I have two inputs: regular_season_boxscore_df: A DataFrame consiststing of regular season boxscores. It looks like this: print(regular_season_boxscore_df.head()) Season DayNum WTeamID WScore LTeamID ... LAst LTO LStl LBlk LPF...

 
2:00 PM
possible answer invalidation by forsvarir on question by mindoverflow: codereview.stackexchange.com/posts/237706/revisions
 
2
Q: python network test application

Allan KarllsonI am working to a python application for some operational test on a Arista brand Network (more info here: https://gitlab.com/networkAutomation/pyateos) I am the only one doing coding in my team so I do not have much chance to compare myself with someone really knowledgeable that can suggest me a...

0
Q: Get a generic exception class

learningUserI have a exception class which should deal with all exception with a particular ScenarioA. public class ScenarioAException extends LegacyException { public ScenarioAException (Exception cause) { super(cause); } } I have many sub classes for this exception to deal. eg: public class Sce...

0
Q: Whats wrong in this?

Sachithra UdayangaIn this program, 2 buttons should be cannot click without giving 10 numbers why it clickable private void btnSubmit_Click(object sender, EventArgs e) { try { if ((listViewResult.Items.Count + 1) <= 10) { if (int.TryPars...

0
Q: Get most similar element in an array of string with another string

Revolucion for MonicaI have a code to get most similar element in an array of categories of jobs to another job. #@title Setup common imports and functions import bokeh import bokeh.models import bokeh.plotting import numpy as np import os import pandas as pd import tensorflow.compat.v2 as tf import tensorflow_hub ...

 
@CaptainObvious broken
 
@P__J__: The canonical interview answer to that starts with a formal proof. But that's expensive. The cheapest solution is code reviews. Designs and design reviews help, chiefly by separating design flaws from implementation flaws. — MSalters 10 secs ago
@MSalters if you believe that code reviews or any formal way of doing it will guarantee a bug free code... But in the practice - very formal organizations generate much worse code than other less formal. How can you explain it? — P__J__ 20 secs ago
@MartynBall if you considered it why not write it yourself and then ask on codereview.stackexchange.com if there's a better way to do it ? — Islam Elshobokshy 55 secs ago
 
2:27 PM
0
Q: Managing exceptions in aiohttp using consumer-producer pattern

ig-melnykI implemented a simple producer-consumer where producer produces links to fetch and several workers consume those URLs and return write data into response queue. Unfortunately, sometimes API can start responding 400-x errors and in that case we need to sleep each for some time. I have implemented...

0
Q: Battleship Python How to make ship size 3 unit long

Allahi The code is pretty simple but I don't know how to make the ship unit size 3x1 instead of 1x1. from random import randint If 1, display the guess of the computer for testing COMPUTER_GUESS=1 Number of guesses allowed numberGuesses=12 board = [] Create a 5x5 2 dimensional list fo...

 
2:55 PM
If this is code you've written, and it works, and you'd like a review of all aspects of your code, this might be better off on Code Review, but I'd check their help center first before asking. — Heretic Monkey 36 secs ago
For questions such as this, you should try code review codereview.stackexchange.comJamesS 46 secs ago
 
3:12 PM
Ryan Donovan on February 24, 2020
I had to onboard myself. Here are some of the things I learned on the path to being a fully contributing developer and a valuable member of the development team.
 
3:43 PM
Try posting this to codereview instead — Chris A just now
 
1
Q: Getting names/values of multiple properties

Eduardas ŠlutasLets say I have one method, which extracts property name and value: public TModel Get (Expression<Func<object>> param) { using (OracleConnection connection = new OracleConnection(GetConnectionString())) { connection.Open(); var propertyName= ((MemberExpre...

0
Q: What's a better way to decrease cardinality when serializing records

craigI need to transfer data from one vendor's system to another. The source vendor has a view that generates data that combines invoice and line-item data into records w/ line-item cardinality: "Invoice","Date","Line","Description","Price" "A","2/1/2020","1","something","100" "A","2/1/2020","2","so...

 
codereview.stackexchange.com is a good place for this question. — palaѕн 43 secs ago
@palaѕн: Not really. Code Review reviews working code asking for tips, it's not a "coding style opinion" site for hypothetical code. — ShadowRanger 28 secs ago
 
4:30 PM
0
Q: Ruby coin toss probability tool

ShuiI haven't been programming for a while, I wanted to do a simple project to warm myself up and get back into the game; I made this simple tool that finds the probabilities of coin toss combinations. Enter a number to get all combinations with that many flips, or enter a string to search for that c...

 
4:50 PM
0
Q: How to save image in base64 format as file in secure way?

12735961238My try: import base64 from django.core.files.base import ContentFile def form_valid(self, form): self.object = form.save(commit=False) if self.request.POST.get('image_as_base64', None): format, imgstr = self.request.POST.get('image_as_base64').split(';base64,') ext = for...

 
Monking
 
5:35 PM
possible answer invalidation by dwirony on question by dwirony: codereview.stackexchange.com/posts/237651/revisions
 
@Duga thats ok. OP just removes password.
 
5:51 PM
0
Q: Find unique characters and count non unique characters

Andy KWe scan the string from left to right finding the unique characters. We also need to find the non unique characters and count them on how many times they appear. If we can’t find any unique characters, then we return an empty list. Here’s the code: def unique_occ(the_str): res1 = list(the_...

 
@Duga yea no that's not gonna get a redaction from mr.
too much effort.
Unrelatedly: Why the hell do I end up at at a netherlandish RIPE node when pinging a private net adress?
 
6:11 PM
-1
Q: Typescript and Angular 6 - Mapping Service Results to Data Transfer Objects

CMRI think I am just look for a bit of code review advice. It might possibly be a methodology question? Essentially when I am pulling data (usually from a REST request), I generate a service, then inject HTTPclient of Angular common so I can use a simple GET to grab the data. Like below: interface...

 
6:51 PM
0
Q: I am confused on how this code functions and how the sub algorithims function

Jim ScofieldI am confused with how this code works and I would appreciate any help. Thank you def max_factor(num): """Find the maximum prime factor.""" factor = 2 while factor * factor <= num: while num % factor == 0: num /= factor factor += 1 if (num > 1): ...

 
7:08 PM
-2
Q: Get a generic exception class

learningUserI have a exception class which should deal with all exception with a particular ScenarioA. public class ScenarioAException extends LegacyException { public ScenarioAException (Exception cause) { super(cause); } } I have many sub classes for this exception to deal. eg: public class Sce...

this ain't going nowhere. Maybe the community needs to step in even more 'cause the user seems argumentative.
 
Monking
@MaartenBodewes coffin nailed
 
Monking :)
And thanks, that probably saved some unnecessary arguments.
 
7:54 PM
@RMunroe I think I still have my missionImpossible ringtone configured
 
8:06 PM
So, Space Exploration has just started the election phase of their, uhm, election. 4 candidates.
@Vogel612 We own the internet.
3
The Workplace have also started theirs.
 
is that the netherworld?
3
 
8:33 PM
Might be a better question for Code ReviewG. Anderson 1 min ago
 
@SᴀᴍOnᴇᴌᴀ Netherland, Netherlands, Nethercontinent, Netherworld.
@Vogel612 As for why it's a Dutch RIPE node, that's probably because RIPE is in Amsterdam.
 
@Mast yea, but I expect a ping to a known private network address (10.x.x.x) to get bounced off at my router or gateway and not end up in the public internet
 
@Vogel612 Smells like you got a routing problem.
And yes, I vaguely remember RFC 1918 saying 10.x.something shouldn't be routed.
3. Private Address Space

   The Internet Assigned Numbers Authority (IANA) has reserved the
   following three blocks of the IP address space for private internets:

     10.0.0.0        -   10.255.255.255  (10/8 prefix)
So the only logical conclusion is that we own the RFC too.
> An enterprise that requests IP addresses for its external connectivity will never be assigned addresses from the blocks defined above. Unless you're Dutch.
Is your network punked?
 
8:53 PM
-1
Q: Im trying to insert data into my database but for some reason its not working

LirianIve been trying to insert text from an form to mysql database but nothing seems to work. I dont see what wrong with my code since im not getting any errors. <!DOCTYPE html> <html lang="en">` <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scal...

 
@CaptainObvious No
Of-course, you can always have a redirect in your own network.
If I tell my router 10.0.0.8 is Google, it is.
 
@Mast probably in more ways than I know...
that ping came from a docker container on my machine and was supposed to go to a machine in a DMZ'd subnet inside my uni that I was VPN'd into
 
And it got out? Ouch.
 
from my machine the routing is going just fine, but the docker container does something weird
because it's a VPN and the traffic is basically external I had reconfigured the FORWARD chain to ALLOW instead of DROP, but that resulted in the issue above
I'll just start commuting to the university to work on that particular project there
 
lol
VPNs and dockers and VMs, you'd say that's enough compartmentalisation going on. But I imagine it's easy to do it the wrong way around with that level of complexity.
 
9:05 PM
the VPN is just to keep students that don't belong to the CS faculty out of the CS servers
 
0
Q: How can I better my Neural Network, namely how can I incorporate a time variable?

big eI am competing in the Numerai tournament as a way to learn python/ML, and I have created a very elementary neural network. I would really appreciate if someone could review my code and let me know how I can improve it. Namely: How can I implement a time variable, called "era" in the tournament d...

 
9:23 PM
@Vogel612 Well, pointing them all towards RIPE nodes instead does get that done, no?
 
0
Q: Ask user to enter 10 integers then an 11th, and compare the 10 and create pairs that equal the 11th

matt snyderThis is the code I came up with. Mind you very much so beginner c++ all previous programming experience is mainly through PLC's in industrial maintenance. The pairs cannot be of the same integer for example if the value we want to equal is 10 we cannot have a pair of 5 + 5. This code basically ...

 
9:47 PM
@CaptainObvious Broken Code.
 
0
Q: Login and create username and password program

Liam CottonI'm trying to make a password program that you can login to or make a new user. I want to make this better, so any help would be appreciated, however I have one main question. Can I make it so that when running, when a new username and password are entered, can it save those new inputs to the fil...

0
Q: find if a gtin is correct

Andy KI was given that assignment recently as part of a coding interview. The idea is to find if a gtin is valid or not valid. The requirements are the following: make sure the input is in a string format the length must be either 8,12,13,14,17 or 18 The algorithm is the following: TL;DR: You ...

 
10:34 PM
0
Q: Trying to plot the unitary sphere of R^2 with different norms

Armando RosasI use this code: import numpy as np import numpy.linalg as nla import matplotlib.pyplot as plt #Definition of p-norm def norma_p(vect, p): vect_abs = [abs(vect[i]) for i in range(len(vect))] vect_to_p = [vect_abs[i]**p for i in range(len(vect_abs))] return sum(vect_to_p)**(1/p) #...

 
 
1 hour later…
11:35 PM
0
Q: Configuring NavigationService and NavigationView in one place

ViewedContext The main goal located a configuration NavigationService and NavigationView in one place. In order to minimalization a consequence in case adding, modifying or removing of NavigationItem. I would like to get some feedback about advantages and disadvantages of the my implementation. We ha...

 

« first day (2487 days earlier)      last day (1531 days later) »