« first day (1992 days earlier)      last day (2017 days later) » 

12:00 AM
RELOAD! There are 5735 unanswered questions (89.7476% answered)
 
0
Q: How can I make this function run asynchronously?

The Bic PenThis function runs thousands of times on different files, causing the UI thread to lock up. It gets called in several different places in the program. How can I make it run asynchronously? The issue is that it returns a string and also takes arguments public string CopyFile(string sourceFile, st...

 
12:16 AM
This seems like a question for [codereview.stackexchange.com](Code review) — rassar just now
 
1:06 AM
0
Q: Control the input of the user according to a sample string and get some info from it

John. C03I made this Python code that prints a sample string and ensures that the input of the user agrees with the sample, and then do an action with this inputted string, in this case a multiplication table. I've made this code to practice some Python concepts, and I do not know if I did everything cor...

 
 
1 hour later…
2:08 AM
0
Q: Optimal way to use GLFW callbacks inside classes

CortexIm creating a window class in C++ to provide a bit of abstraction for a GLFW window. To me it makes sense to add a key_callback as a method in my class. The issue is ofcourse that GLFW is written in C, and so it requires callbacks to be static. I found that GLFW has a glfwSetWindowUserPointer fu...

 
2:24 AM
0
Q: Logical flow for user verification process

AnonProgrammerI've provided methods to determine what stage user is at in verification process. This will determine the appearance of the view or what progress user has made. Its pretty straightforward, but I think there is a more elegant and thoughtful way to process this logic. Any thoughts on readability, l...

 
3:11 AM
0
Q: c# EF core 2 Generic Reposoitory implementation

Ortho Home DefenseI'm implementing a Generic Repo for EF core 2. It's my first time with EF core 2. I'm hoping for some feedback on the implementation details. Here is my Interface public interface IGenericRepository<TEntity> where TEntity : class { AbstractValidator<TEntity> Validator { get; set; } IQue...

0
Q: Updating/edit a single row of CSV file with python

LamboKangI have existing csv file with records in them: header1, header2, header3, header4 1, a, b, c 2, a, d, b 3, b, b, c How do i edit only 1 of the rows of csv file and save it? presuming that everything in column header1 is unqiue and is reques...

 
3:27 AM
0
Q: Querying DB inside SQLAlchemy Model

Luke LaFountaineI have a SQLAlchemy model that looks something like this: class Guest(db.Model): name = db.Column(db.String) current_status_id = db.Column(db.Integer, db.ForeignKey('approval_status.id')) current_status = db.relationship('ApprovalStatus') I would like to have a method like this: ...

 
 
1 hour later…
4:30 AM
0
Q: Error-Handling Class and Logging for C#

aduguidI am relatively new to C# and would like to see if what I have been using for my exception handling, message and logging is along industry standards. I have created a simple class for the Error Handler and for the logging I use Log4Net. After reading Clean Code, I was thinking about separating Di...

 
5:01 AM
0
Q: duplicated operator(or attribute) on the same input control - v-model and @change

Juneyoung OhI wrote a code like below - It is nuxt.js, which is one of the Vue frameworks. This code will be expected to When change event triggered, update data value. There would be some logic to alter passed data At the same time, it connected with data value to apply input box changing <template>

 
Monking
 
5:43 AM
@Vogel612 It's a growing problem the last couple of days.
There's no immediate concern, but it shouldn't get worse.
 
6:04 AM
0
Q: Flip coin Game in an Object oriented way

thebenmanI started out creating a simple game in an Object Oriented way to practice. The rules are pretty simple There are two players You let one player choose if they want Heads or Tails. You assign the leftover option to the other player. You simulate a coin flip and say who won that game. More ...

 
6:17 AM
I'm voting to close this question as off-topic because This belongs at codereview.stackexchange.com — LuFFy 54 secs ago
 
7:07 AM
0
Q: doubly linked list using c++ and templates

lucarligWorking doubly linked list using c++ and templates, i tried to make it by myself i tried to use head and tail as buffers and make a simple implementation. Please help me understand what i have done wrong and what i have done good and could have done worse. #pragma once #include <iostream> templ...

0
Q: Correctness of iterative DFS for cycle detection

Pranjal VermaI'm attempting the Graph Algorithms section in CLRS right now. Here's an iterative DFS using a stack called nodes. T is a vector of pair(s) of ints which store timestamps for each node. T[node].first = discovery time T[node].second = finishing time P is a vector recording Parents for each nod...

 
Before posting on Code Review, make sure you've read their help center so you know what's expected of a question there. — Mast 39 secs ago
 
7:19 AM
'the best way', this question is better suited for code review SElovelace just now
 
8:00 AM
It is not code review or code improvement service. If you have an error that you don't know how to fix, point the row and add error message. Otherwise I suggest you to look into some subject related tutorials. — maximelian1986 49 secs ago
 
8:18 AM
And if you want code review, suggestions and critics, you better try some facebook game development groups. People there will rip your code into bites and add modifications or at least give some ideas. — maximelian1986 43 secs ago
 
8:41 AM
0
Q: Search in a nested list of a dictionary

XbelI have a dictionary structured as {a_1: [((b_11,c_11),d_11), ((b_12, c_12), d_12), ...], a_2: [...], ...}. I want to extract the maximum abs(c) among all the possible c values. Currently I'm doing this throught two for loops. One for each a, and other for each of set {b,c,d}. elements = { ...

 
9:00 AM
Since you code works, this is more appropriate on Code ReviewStephen Muecke 25 secs ago
 
9:12 AM
0
Q: How load randomized background image

clementOne ASP.NET MVC application has a login page. In this login page (and only for this page) I'm using a background image. This background image is changing every week. All the pictures path are known in advance and should'nt change too mutch but by practical reason, I wouldn't hardcode them. I woul...

 
If your solution works, then asking for improvements is off-topic on Stack Overflow. You can post it on Code Review, instead. — StoryTeller 44 secs ago
 
9:44 AM
0
Q: Comparing similar types that don't share any interface

t3chb0tI have two types that don't share any interface but have similar properties and that I need to compare for equality. One of them is comming from a 3rd party library and one of them is mine. I obviously cannot add any interface to the foreign type and honestly I don't want to create any wrapper f...

 
10:15 AM
0
Q: How to call paint method with a canvas in Swing?

TeodoroI've searched everywhere about how to use awt's canvas, but there's one thing that I just don't get: how do you actually call the paint method? Yes, you have to override it to draw whatever, but when, where and how is it called in the program? Where does that graphic parameter come from? What I...

 
 
11:00 AM
possible answer invalidation by Thaoden on question by Thaoden: codereview.stackexchange.com/posts/205683/revisions
 
11:23 AM
pos off-topic here and better for codereview SE — ThisGuyHasTwoThumbs 11 secs ago
note to flag reviewer - should be on code review - but option "should be on another SE" doesn't include it - tried me best to opt for best flag — ThisGuyHasTwoThumbs 14 secs ago
 
0
Q: using try except in python

FramaActually, this is not my own code but because I wanna use it and this problem bothers me frequently, I wanted to check it out here: def _map_key(k): try: return TAGS[k] except KeyError: return GPSTAGS.get(k, k) def get_exif(image_path): metadata = {} with Image.o...

 
@CaptainObvious Accumulating close votes like a speedracer.
 
11:51 AM
0
Q: Planning HTML structure & attributes for Javascript value collection

ghoshI'm planning a feature which would have a dynamically created number of input text fields(by a button click) which I will later be collecting. As of today I have been assigning ids by a running index to each input element and looping through them for collection like so: function CreateInputFiel...

 
12:23 PM
Thanks for the info. I kind of figured what I wanted to do wasn't possible. However, the code review would at least force someone else to look at the code before it can be checked in. This will at least alleviate the issue a little bit. Thank you! — Seth 15 secs ago
 
0
Q: beautify code using kotlin idioms

lapotsI had Java class that looked like this @Override public void configure(Env env, Config conf, Binder binder) { var configuration = new Configuration.Builder() .uri(conf.getString("db.url")) .credentials(conf.getString("db.user"), conf.getString("db.password")) .build()...

 
12:35 PM
possible answer invalidation by Oscar Guillamon on question by Oscar Guillamon: codereview.stackexchange.com/posts/205659/revisions
 
12:54 PM
0
Q: Is there a cleaner way to write this linq group by?

Stephen RichardsonI have some "Event" data and I want to group it differently based on "groupBy" user selection. In the following code, only the GroupID and GroupName changes each time. Is there a better way to write the code that avoids duplicating the following code in each case statement: EventDurationSeconds ...

 
1:25 PM
0
Q: How to enforce parameter is a CONSTANT in python

Ahmet TokerI am writing a data preparation class that should work differently on different database types. I would like to assert that the class is instantiated with allowed database types. So far best solution I came up with was: class DataPrepper: SUPPORTED_TYPES = ['SQL'] def __init__(self, pa...

 
1:37 PM
If you're asking about improving working code, then you have come to the wrong place, and perhaps the code-review stackexchange is a better fit, but before asking there, do check their help links to find out about their question requirements. I believe that you would need to provide metrics to quantify what you mean by "improved", but I could be wrong. — Hovercraft Full Of Eels 24 secs ago
 
2:58 PM
0
Q: Mapping to I/O method results

Christian NeverdalConsider the following Java code: Stream.of(1, 2, 3).map(i -> i*i).mapToInt(Integer::intValue).sum() This is pure and will result in the same answer every time. No problem there. However, let's say that we now want to utilize cloud computing and want to map each value to the result of a networ...

 
3:17 PM
 
@CaptainObvious Hypothetical
 
0
Q: O(n) Object Pool

FreezePhoenixI recently rewrote my object pool design to O(n) complexity. I did this using a linked list, which is not native in javascript. It does not, unfortunately, automatically assign null to a value when you free it :) const Pool = function() { const Free = new WeakMap, Next = new WeakMap, ...

 
4:01 PM
@Batters - Help improving code is probably better found at codereview.stackexchange.com, but be sure to read their help first, they have specific requirements for questions. Happy coding! — T.J. Crowder 36 secs ago
This definitely not the right forum for such questions, codereview is a better fit — Zohir Salak 31 secs ago
 
4:29 PM
Monking
 
 
1 hour later…
5:44 PM
Please go to codereview.stackexchange.com. Code Review questions are off topic on Stack Overflow. — C Perkins 47 secs ago
 
6:04 PM
If you want to ask about improvement for already working code, you probably better post that over SE Code Review. That's the site dedicated for it, here it might be off-topic as going too broad. — πάντα ῥεῖ 51 secs ago
 
6:21 PM
-1
Q: Simple website table reader and write to Excel file program

Gifhary Syidhqa Hamimi have write a simple program that can read a table from Wikipedia which is in Malaysian language and write the captured data to Excel file (.xlsx format). I think the table in the website will not changed for couple of years, so i consider the table has static data. I want you to review my code...

 
6:52 PM
0
Q: LISP. Recursive Processes

Yevheni OstrovskiyI've just started to learn Lisp. Need help with this task. Implement the pseudorandom sequence generator {Vi} based on the recurrence ratio Vi = (aVi-1 + bVi-2 + c) mod m, where a, b, c, m are arbitrary natural parameters. The first two values, V1 and V2, are given by chance. Select a signifi...

 
7:14 PM
If the code is error-free, it might be a better fit for code review. — timgeb 55 secs ago
 
-1
Q: HttpErrorMiddleware and .Failure twisted.internet.error

learn2learnFor some reasons my scrapy spider is not extracting all of the data, instead it's only extracting 45 items(or data column). The error messages i am getting are. First Error I got: 'scrapy.spidermiddlewares.httperror.HttpErrorMiddleware', 'scrapy.spidermiddlewares.offsite.OffsiteMiddleware', '...

 
7:36 PM
It 's a request for code review codereview.stackexchange.comChris F Carroll 51 secs ago
it's a request for code review codereview.stackexchange.comChris F Carroll 21 secs ago
 
7:59 PM
-1
Q: This code is a index for the elements of the periodic table

Dedeman CompanyTMcan anyone help me with this code I have. It is very long, and I would like to reduce it. This is code Also someone please give me a instructional video on how to work on this website. Its so frustrating.

0
Q: C# - Json serialization object with huge IEnumerable

Below the RadarThis code is looping over polygons geometries vertices in order to create a list of deltas (distance) between vertices coordinates to compact the geometry before sending it into the web. geometry output is expected to be on this format: [[x0, y0, (x0-x1), (y0-y1), (x1-x2), (y1-y2)]] The output...

 
8:19 PM
try codereview.stackexchange.com — div0man 7 secs ago
@FrancoFusaro I'll also add that according to the links in this answer on Code Review a single HttpClient must be used for the whole application, and that then leads to other problems (such as stale DNS). — ispiro 16 secs ago
Since this page is a Code Review, I'll add my 2 cents too. I see lots of early programmers getting caught out with typo issues while bouncing in and out of php to display their data -- for this reason I don't bang on too hard about multiple echos. The last table row doesn't have enough columns in it. Calling date(strtotime()) is a bit cumbersome to look at while printing to screen; instead consider modifying the query to format the date column so that the result set is completely prepared. — mickmackusa 44 secs ago
 
8:39 PM
0
Q: Basic Connect four game

dgr27below is a simple text-based version of connect four I made. I have been building this in an attempt to improve my Java skills(and possibly mention on my resume), and any feedback and suggested improvements would be very helpful! My goals with this project are as follows: 1.) clean, optimize, an...

0
Q: Is there a better way to do this, trying to create a directory if it doesn't exists

pavikirthiI am trying to create a directory, but I have to check whether /usr is present initially, later /usr/local is present and so on, is this an elegant way of writing it? #include <stdio.h> #include <string.h> int main () { char str[] ="/usr/local/mnt/"; char path[40] = {0}; char temp[40] = {...

 
8:53 PM
0
Q: Temperature Converter in Rust with Input Error Handling

Arnav BorborahSo I started learning Rust a few hours ago with the Rust Book (2018 edition) and as part of one of the exercises decided to make a temperature converter. I wanted to make sure it handled all inputs properly in an idiomatic fashion. The code is as follows: use std::io; use std::io::Write; use std...

 
 
2 hours later…
11:11 PM
0
Q: PHP custom contact form on Magento

Erik BBelow is the working controller class for a custom contact form on Magento 2 that handles form submissions. All of the fields are input arrays like [general-info][city]. Magento uses the Zend Framework for handling mail. transportBuilder->setTemplateVars is what gets passed into the email (as w...

 
0
Q: Command line matrix effect in swift

lf_araujoI have modified a small swift package to reproduce the matrix effect on the command line, however I have been getting some weird characters. How do I limit the characters to be used in the effect? import Foundation import CNCURSES import Glibc typealias Stream = (base: Int, offset: Int, lengt...

0
Q: Java Breadth-first search

Ilya GazmanPlease review my Breadth-first search algorithm implementation in Java for finding the shortest path on a 2D grid map with obstacles. The findPath() method receives a map array of integers where 0 is an empty cell, and 1 is an obstacle, the function returns a list of coordinates which is the opt...

 
11:51 PM
This would be better for the Code Review community. However, in my personal opinion, it could fit here as well but I guess some people on this site disagree. — Bilal Saleem 46 secs ago
@bilalsaleem thanks ill move this to Code Review — mjl007 16 secs ago
 
0
Q: Determining if a string can be permuted to a palindrome

mjl007I am going through Elements of Programming Interview by Aziz, Lee and Prakash one of the questions is how to determine if a string can be permuted to a palindrome. For example edified can be permuted to deified and now its a palindrome. So my first implementation is this: bool CanFormPalindrome...

 

« first day (1992 days earlier)      last day (2017 days later) »