« first day (2186 days earlier)      last day (1835 days later) » 

12:00 AM
RELOAD! There are 6016 unanswered questions (89.8474% answered)
 
12:54 AM
-1
Q: In Java, NullPointer Errors and Bad Hash Functions for My Phone Book Assignment

JavaNewbieI'm supposed to build and implement a phone book that uses an array-based hash table as the underlying structure and chaining to handle collisions with the following classes : Phonebook Demo, Phonebook, Hash, Linked List, and Node. My teacher is also supposed to be able to change the default size...

0
Q: Convert list/tuple of arguments into just arguments

SaelythI am using a library that specifically needs me to provide arguments as strings one by one. However, different combinations are possible. Right now I am using a bunch of elif: def get_all_users(times=False, groups=False, ips=False): """Get a list of all users online""" if times and group...

 
1:13 AM
0
Q: When is it safe to handle AggregateException with Task.WhenAll?

broadbearI have a question about when its safe to handle an aggregate exception when using WhenAll(). It seems like the natural place would be inside the catch block, because if the catch block never fires, it would imply there are no exceptions to handle. But I see a lot of code that has an empty catch b...

0
Q: Plugin pattern works, but Click CLI version calls on different script already loaded

xtianI have a series of Click CLI Python scripts each built using same/similar code patterns. One important pattern for dynamically handling different kinds of files has a serious flaw. I've modified this Dispatcher Pattern. My version loads Python files in a subdirectory (plugins) which are loaded at...

 
 
2 hours later…
3:09 AM
Please be aware of codereview.stackexchange.com which is part of the Stack Exchange family of sites. Stack Overflow is for code that isn't working, but before posting at codereview make sure your question would be on topic over there by reading their tour. — Jason Aller 30 secs ago
 
 
1 hour later…
4:19 AM
Monking
 
4:38 AM
Apparently, this type of question needs a basic relational database as been pointed out here codereview.stackexchange.com/q/85842/127240 Consider using sqlite module for that — Sergiy Kolodyazhnyy 19 secs ago
 
5:09 AM
0
Q: Is it possible to send multiple line text messages in whatsapp using python?

GokvaHere is a sample code i wrote. This results only the first line and then quits the browser. `import selenium from selenium import webdriver from selenium.webdriver.common.keys import Keys import time url = "https://web.whatsapp.com/" driver = webdriver.Chrome('c:/users/user/desktop/tcs/c...

 
6:06 AM
Monking
 
6:45 AM
I'm voting to close this question as off-topic because it belongs at Code reviewJoakim Danielson 5 secs ago
 
7:02 AM
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comceving 44 secs ago
 
7:45 AM
0
Q: Custom Error Classes in OOP

AdamI have a class which parses a .csv file and converts it into successful rows and errors. Currently I have 12 different kind of errors (mail is not valid, missing column x, row is duplicate etc.). Each error has a custom message. I also need to know in other classes what kind of error a row was, ...

 
8:08 AM
"I don't see the point" well, this isn't Code Review. From what they've told us, we have no reason to assume that their main method does not work correctly. Their problem that they don't understand how to call it. — Michael 9 secs ago
I think you should ask this question in codereview.stackexchange.com or somewhere similar, as there is no 'right' answer to this. On top of that, I think since javascript errors doesn't have a good structure and there is no general way of expecting errors, it's better to not throw — Doğancan Arabacı 44 secs ago
 
8:44 AM
0
Q: Spliting PDF and get thumbnail while adding it to a ListView

Sofia RodriguesI'm doing a application to work with PDF and TIFF files. To divide them, the user opens the file or folder (if it is a folder, it gets all the files inside) and the app splits the file, getting a tiny image (thumbnail) in JPG format. Then it creates a ListViewItem adding the thumbnail, the name a...

 
9:03 AM
-1
Q: User account state names

user67137I would like to double check with native English speakers whether the following code is clear. I can't find good names for user account states. public class User { public enum State { /* How to express in English that the registration is ongoing? */ REGISTRATION_ONGOING, /* How ...

0
Q: Deleting each list item and re-adding when saving to database

MyDaftQuestionsI have a structure which looks like Person ID int Name nvarchar Phone ID int PersonId int Number nvarchar Make nvarchar Model nvarchar DualSim bit One person can have many Phones At the moment, the logic I have is when ever the user clicks the save button...

 
This would make programming and code reviews much more annoying because the if block could be very large and I don't like reading code first to only find out that the code was not executed right at the end. If I can read the condition first then I know I can skip reading the code that gets executed next. Also, having the condition first is respecting the sequence of execution which makes more logical sense to me when reading the code. I don't see any benefit in reversing this. — Mayron 24 secs ago
Perhaps this is better suited for codereview.stackexchange.com? — Simon Shine 1 min ago
@ceving Broken code doesn't belong on Code Review. — Mark Rotteveel 38 secs ago
Thanks for your comments. I agree, it is better suited for codereview. Moved it there: stackoverflow.com/questions/55899839/…Piotr Justyna 9 secs ago
 
9:42 AM
0
Q: Why is my haskell program so slow? Programming in Haskell, game of life

Piotr JustynaI'm going through the "Programming in Haskell" book (second edition) and noticed that the "game of life" example is getting extremely slow after some iterations (it looks like it's getting exponentially slower with every iteration). I profiled it, but can't see anything suspicious in the prof fil...

 
10:06 AM
Thanks for your comments. I agree, it is better suited for codereview. Moved it there: codereview.stackexchange.com/questions/219355/… (the close vote is mine) — Piotr Justyna 20 secs ago
 
 
2 hours later…
12:19 PM
0
Q: Implementing Async ExecuteNonQuery() for IDBCommand vs SqlCommand.ExecuteNonQueryAsync

Muhammad QasimI'm using IDBCommand for my database layer in order to switch to other database providers than SqlDataProvider. SqlCommand has all Async methods like ExecuteNonQueryAsync but IDBCommand does not contains async method. In future we might need to switch to another data provider other than Sql, I...

 
12:45 PM
Where is your isolated issue? What are we to fix? Do you need a Code Review? — mickmackusa 59 secs ago
 
1:05 PM
possible answer invalidation by darkmattercoder on question by darkmattercoder: codereview.stackexchange.com/posts/219177/revisions
 
1:17 PM
0
Q: interval map implementation

MehrzadI sent an application on a C++ position in one of IT companies. They sent me a test assignment. The task is to implement an interval map assignment operation. I sent them my solution, but it did not pass the second requirement (correct behavior). They did not give a feedback more than stating th...

 
1:31 PM
Hi! Can someone help me and review my code? I would like to improve the time that the code takes to doing the operation.
1
Q: Spliting PDF and get thumbnail while adding it to a ListView

Sofia RodriguesI'm doing a application to work with PDF and TIFF files. To divide them, the user opens the file or folder (if it is a folder, it gets all the files inside) and the app splits the file, getting a tiny image (thumbnail) in JPG format. Then it creates a ListViewItem adding the thumbnail, the name a...

 
1:47 PM
I'm assuming the close voter was expecting you to put your code in the question itself (and you should). One day you may delete that repo or change it completely, then this question has no context. A Minimal, Complete, and Verifiable example should be in the question. A second point could be made that question is off topic on SO since you have working code. You are really asking for a code review which belongs on codereview.stackexchange.com. — JeffC 59 secs ago
 
2:00 PM
@CaptainObvious Needs one VTC.
 
Also for questions like that use: codereview.stackexchange.comDimitrios Desyllas 54 secs ago
I think it's better to ask here: codereview.stackexchange.comOram 45 secs ago
 
0
Q: How can I write a method that does not expose its logic in the name, yet accommodates various algorithms in Java?

Jonathan KomarI am designing an interface between JVM and a device that accepts command sequences (a series of bytes) over a secure shell channel. For the purpose of simplicity, there are fields fieldAlpha fieldBeta ... fieldn that I can get and set on this device. My initial design to get the ball ro...

0
Q: Lexical analysis: split chain of method calls into parts in Python

The Unfun CatIf I have a chain of method calls in Python, how do I extract the top level calls in a neat way? I have working code below. Tldr; the function should behave thusly: _parse_commands("df.hi()['fi'](__call__).NI(ni='NI!')") ['df', '.hi()', "['fi']", '(__call__)', ".NI(ni='NI!')"] I have this mon...

 
2:23 PM
It's unclear what you're asking. Maybe this is better suited to CodeReview? — Mahogany 19 secs ago
possible answer invalidation by Mehrzad on question by Mehrzad: codereview.stackexchange.com/posts/219359/revisions
 
2:39 PM
@CaptainObvious Not sure if this is off-topic or not. It is a how to question and I would generally point them to a different site. The OP has already provided his own review in mentioning DRY code.
 
3:00 PM
This question may be better suited to codereview.stackexchange.comcybernetic.nomad 27 secs ago
 
3:23 PM
Monking
 
0
Q: Advent of Code 2018 Day 1 Part 2

TestEngineer11This is the problem: You notice that the device repeats the same frequency change list over and over. To calibrate the device, you need to find the first frequency it reaches twice. For example, using the same list of changes above, the device would loop as follows: - Current f...

 
3:53 PM
1
Q: Modify the code to reduce time to write to EXCEL from SQL DB using VBA script

Kaustubh UrsekarI have a vba code which takes data from SQL database and dumps it into excel. I see that my query should extract approximately total of 120k records. I monitored this activity and learnt that even after 8 hours of my office time, the query is successful in extracting barely 70k records. This is ...

 
posted on April 29, 2019 by CommitStrip

 
4:23 PM
Monking
 
4:36 PM
@pacmaninbw Well, it's RBA now.
 
Refactoring questions are fairly off topic for StackOverflow, and are more suited for CodeReview, if the logic currently works and you can make an example of it working. — Taplar 25 secs ago
 
@Mast yes, I hope I didn't chase them away for good.
 
It's a risk.
 
interesting... that user has been a member on CR for 1 year and 2 months
flagged one post
cast 9 votes... hopefully won't be chased away
 
4:51 PM
0
Q: N-Queens problem using other pieces using Go

Ignacio MoscaI wrote a solution to a problem based on the N-Queens problem which should use more pieces than just queens. Problem is it's very slow, it probably has to do with how I modeled data and my lack of knowledge on how to compare boards without the possibility of extending from an interface compareTo ...

-1
Q: Who's performance is high Double or BigDecimal to calculate percentage?

SwapnilI've to calculate 50% of value. So I approach it using two ways. 1) public static void main(String[] args) { new Double(500) / 100 * 50); } 2) public static void main(String[] args) { new BigDecimal(500).divide(new BigDecimal(100).multiply(new BigDecimal(50))); } So whi...

0
Q: native implementation of call() method in javascript

KallisI was try to do the native implementation of call method in javascript. Here we need to handle the object which we pass in the call function and additional params. i handle the additional params using eval() method. is there any efficient way to do the native call() function implementation. here ...

 
5:49 PM
0
Q: Is assignment in a if condition in C/C++ a good practice?

yasouserI'm doing a code review and I see a few places where the author has done this: if (SUCCESS(a = foo())) { // do something... } else { // do something else... } where foo() and SUCCESS(x) are defined as shown below: bool bar(x) {} #define SUCCESS(x) bar(x) uint32_t foo() {} While th...

 
@CaptainObvious very hypothetical.
 
@pacmaninbw and Vogel already put it on-hold
 
@SᴀᴍOnᴇᴌᴀ thanks, I just saw that.
 
~whistles
 
@Vogel612 good whistling!
 
6:01 PM
Sigh.... code for the current exercise in imaging science written in C with an 80-char width limit and use of gets, which generates a compiler warning...
also apparently braces are for weak people...
and vast amounts of vertical whitespace are a thing...
 
@Vogel612 I haven't seen an 80 character width limit in at least 20 years, what kind of system is it on?
 
not any system AFAICT
it's just code from literally a decade ago...
 
"I'm not a part of yer system"
 
Since this clearly isn't a minimal example, I think it would be a better fit for codereview.stackexchange.com. — Greg Schmit 7 secs ago
 
@SᴀᴍOnᴇᴌᴀ that brings to mind Tron and certain users that say Morning Programs.
 
6:09 PM
@pacmaninbw I was referencing the Lonely Island song "Threw It On The Ground"
 
I hadn't heard it in a while, so I just listened to it for good measure
 
Link to a Windows specific 4 thread bottom up merge sort . This was run on a 4 core processor, and 8 threads was slightly faster. The code is similar to what is being suggested in the answers below. — rcgldr 43 secs ago
 
7:04 PM
 
@RMunroe I think I did see phone backups from ~2+ years ago that were taking up a large amount of space...
 
7:26 PM
0
Q: Field class as a basis for a role playing game

Dexter ThornMy programs that I have written so far included only a few lines of source code. When I tried to write larger programs, it usually failed because I'm not a master of software engineering. This time, I want to play it safe and publish now from time to time parts of the program, which should be my ...

 
7:39 PM
It will be hard to say without knowing what its trying to achieve, I'd imagine most of the time is stuck in while loops. Code Review might be more appropriate but not sure if this is a good fit there — Sayse 49 secs ago
 
-2
Q: Compressing Strings (and other unfinished options)

Vortex Gimport time import itertools def displayMenu(): userOption = input(''' {a}* Enter RLE {b}* Convert to ASCII art {c}* Read from ASCII art text file {d}* Calculate difference between 2 lines {e}* Quit Please type 1 2 3 4 or 5 for your option '''.format(a = 1, b = 2, c = 3, d = 4, e = 5 )...

 
8:15 PM
@RMunroe 2015? I still have project backups from before 2010...
 
@Mast E:\Oude PC\D\Oude PC\Schijf D\Toshiba External HDD 18-05-2013\Backups\backup 11-09-2011
Too many levels of nesting
 
@skiwi I have that in zips and rars. Sometimes both.
 
0
Q: c++ lock free, single producer, single consumer queue

PhiAssumptions for use: push() will only ever be called by a single thread. pop() will only ever be called by a single thread. Requirements: push() needs to be as fast as possible. Requirements are stringent enough that I've determined that I can't use std::mutex (at least not in any way I've a...

 
@Mast Nice
 
8:32 PM
@Mast I have all the emails I've received or sent since 1996.
4
 
@pacmaninbw Wow. I lost a couple of e-mail accounts over the years, so I'll have to do with 2005 and up.
 
I only have my emails on Outlook.com... minus a few mails when I was really young and my parents pretty much managed them anyway
 
0
Q: Complex Conditionally Driven Django View

DodgeI'm a crop scientist and am currently building a web app that collects weather data then generates and displays modeled agriculturally relevant output. My question centers around an increasingly complex Django view and a desire to learn about a potentially superior implementation if one exists. ...

 
8:54 PM
@pacmaninbw I was barely starting to walk then, you know??
 
I was starting to learn to solve mathematical equations with letters involved...
 
0
Q: Total steps of of long process, track completed steps, reuse query

EkaterinaI have some long-time method (PrintInfo). I need to know total steps of that method and track completed parts. How to reuse same filtered query in: TotalSteps (ex, Program: progressMonitor.TotalSteps = /* ... */) method PrintInfo? Description of example: . I have BookLibrary with some hie...

 
Does this code work? If so, and it's on topic there, this question might be better off on Code Review. — Heretic Monkey 1 min ago
@GregSchmit: That is not so clear to me. Also this isn't asking for a code review. — Mehrdad 15 secs ago
 
9:14 PM
What can I tell you, I'm an old fart. In 1968 when I was 12 I wrote my first program in assembly. I got my BS in computer science in 1985.
I bought my first PC in 1996.
 
Seeing how you are adding several variables to $, you might want to keep in mind that some names are already taken by jQuery's own methods - and to not overwrite them. Doing a console.log($) will show the whole object tree. As to the code review you referred to in your question (Stack is not really the platform but I'm not on Github), here is a paste that uses a single object for the variables. I also altered a few other things (chaining and returning the object) and removed some lines that seemed superfluous. Do with it what you will. Cheers. — Shikkediel 58 secs ago
 
0
Q: Simplified Smart Rockets using Genetic Algorithm

AlexThis is a very bare bones program where a population of blocks learn to reach a target on a 2d screen (My attempt at making a smart rockets program) I've only used python for 2 weeks so i'm positive certain aspects of the program have extraneous lines of code and unnecessary junk, so what are so...

 
REGISTRATION_PENDING i.o. ONGOING, but somehow ONGOING is almost nicer. Not a native too, so let's await the aboriginals. — Joop Eggen 8 hours ago
wat
Joop means he/she isn't a native english speaker, so they should wait for somebody who is?
 
Seeing how you are adding several variables to $, you might want to keep in mind that some names are already taken by jQuery's own methods - and to not overwrite them. Doing a console.log($) will show the whole object tree and what not to name your extension. As to the code review you referred to (Stack isn't really the platform but I'm not on Github), here is a paste that uses a single object for the variables. I also altered a few other things (chaining and returning this) and removed some lines that seemed superfluous. — Shikkediel 31 secs ago
 
9:30 PM
@SᴀᴍOnᴇᴌᴀ apparently that is the case; it is interesting that there is a connotation of aboriginals specifically for native persons in Australia...
@CaptainObvious while it has more context now, the code doesn't look implemented enough... still a bit sketchy
 
0
Q: Understanding class, OOP, Python3.7

Güray SurI have started to learn Python 3.7 one month ago Now I am trying to learn class and OOP, I am trying different ways to solve problems. The first code below can be solved without class. My point is understanding class.( sorry for my nad English) Please critique and correct the code. I appriciate ...

 
10:01 PM
1
Q: Cubic spline interpolation in Python

Ivan ZARI implemented cubic spline interpolation as a Python class. Following the best practices, I protected my code with tests (I preferred doctest for this example). In this way, we are good to refactor now. Could you please help my to improve the quality of the code? You may just share your overall...

 
@BPL I read it as optimizing this particular code (which is absolutely asking for code review), not a general algorithm question. If that is what the real question is, then the code should be significantly minimized. The fact that it's not is why it looks to some people that you're just asking them to write teh codez for you. The best answer you called "hacky" but that's only because you want too much from a single Q/A on SO. That's why it should be minimized and the question constrained in scope, or it should be on codereview. — Greg Schmit 27 secs ago
 
 
1 hour later…
11:25 PM
does this self-answer provide enough explanation to count as a review?
> I found my shortcuts and performance enhancements via list comprehension.
it seems a bit brief...
 
11:38 PM
0
Q: jQuery datatables data rendering from mongodb

Arootin AghazaryanI am using jQuery data Tables server processing to show some data to user. The documentation instructs that the response that the server sends must have this data: recordsTotal recordsFiltered data when I am trying to provide this data, I have to query the database 3 times! One for total docu...

 
11:58 PM
0
Q: 100% Secure implementation of Private Route with Auth using react-router and Context API

VencovskyI'm trying to implement safe routes and checking if the user is authorized using only Context API. Considering the safety only in the front end, is this safe? What would be unsafe is the user being able to see a PrivateRoute (doing anything that is possible in the browser). I made a gist but al...

 

« first day (2186 days earlier)      last day (1835 days later) »