« first day (2731 days earlier)      last day (1269 days later) » 

12:00 AM
RELOAD! There are 7069 unanswered questions (89.7417% answered)
 
12:17 AM
I’m voting to close this question because it is not about programming as defined in the help center and it should be posted at Code Review SE instead. — desertnaut 25 secs ago
 
 
2 hours later…
2:15 AM
1
Q: How to speed up this numba based decision tree?

zhenlingcnIn order to improve the performance of this code fragment, I have speeded up some code fragments by using the numba. However, a frustrating thing is that the performance of this decision tree is bad. For example, in the below code fragment, the performance of the decision tree is nearly 70 times ...

 
2:41 AM
The code seems to be working correctly when I test it. If you want suggestions for improvements to working code, codereview.stackexchange.com may be the better site. — Nate Eldredge 44 secs ago
 
 
4 hours later…
6:22 AM
0
Q: Checking if the access token is valid or expired

dcanguloBasically, the server gives me a token object. I am planning to check the token on the client if it is expired/valid before making a request to the server. The function below works as expected. I just want to know if my code catch-all edge cases? I don't want, even 1 second that will request will...

 
 
4 hours later…
10:02 AM
If your code doesn't work well enough (takes too long, too much RAM), then it's a toss up between here (mostly algorithms related), Computer Science (if it's more purely theoretical question) and Code Review (if you have a lot of code and it's nuanced). — Nuclearman 36 secs ago
 
10:28 AM
If you have working code and would like to have it reviewed/optimized, you should probably post on code review. Do read their how to ask! — jibsteroos 56 secs ago
 
-2
Q: Randomly selected values from predetermined arrays must add up to specific input value

FinKIm trying to write a Python code that adds up random integers from specific lists to a specific value. My code picks a random variable from list POP and in that variable it picks an integer. It can only pick every item from list POP once. Thus I need a sequence that adds up to the input variable ...

 
11:19 AM
0
Q: Randomly selected integers from predetermined lists add up to specific input value

FinKHello im trying to write a Python code that selects integers from arrays up to a certain value. I wrote this code however the code uses every list once (as is intended). But sometimes it is still below the input value and has no more options to choose from. For example if i say WantedNumber is 15...

 
11:53 AM
@Heslacher Can you vote to close this question that you answered? The OP themselves voted to close it because the code doesn't work.
 
12:34 PM
0
Q: Event tracking system

Daniel JordanovI am a learning C++ programming and just learned about basic OOP and decided to create a simple project to test my understanding and practice what've learned. The idea I came up is a event tracking system where you add events into a calendar and then you get all of your events displayer. I have 2...

 
12:55 PM
Monking
 
 
1 hour later…
1:58 PM
That sounds ... strange. You should consider posting it to codereview.stackexchange.come — Alexander - Reinstate Monica 40 secs ago
 
2:38 PM
0
Q: SortedList performance

David Michaelii've found in my app that SortedList is very with poor performance, so i try to improve the performance of my app - so i create FastSortedList that i think that is faster than the original one.. public class FastSortedList<TKey, TValue> { IComparer<TKey> _comparer; List<KeyValuePair<TKe...

 
3:02 PM
0
Q: A recursive_transform for std::vector with various return type

JimmyHuThis is the follow-up question for A recursive_transform Function For Various Type Nested Iterable With std::variant Implementation in C++ and A get_from_variant function in C++. Thanks to G. Sliepen and Quuxplusone provide detailed review suggestions. However, the existed version of recursive_tr...

 
For a code review you'll want to post on codereview.stackexchange.comFrank van Puffelen 8 secs ago
 
3:27 PM
0
Q: Django: view to output data into a dashboard

dassoukiI'm a beginner in Django3 and just wrote an overview function to pass on some data to the template in a context variable. I am definitely passing a lot more than I should as I only need only a few fields from each of these variables. Also, it might not be the most Django-esque way of doing things...

 
3:51 PM
If you algorithm can handle k = n = 500, m=1e6, you pass, but you can't use >50GB RAM, and there should be no noticeable memory leaks. This is my goal; it's why I didn't ask on Code Review - the only Python hope is if Numpy did it in C. Or if there's a clever math algorithm. — OverLordGoldDragon 9 secs ago
 
0
Q: Interactive logistic map

Khashayar BaghizadehThe purpose of this project is to generate an interactive logistic map. The user can click on the produced picture to magnify the picture at that point. Here is the logistic map equation: Here is my program: public class LogisticMap { public static double returnLogisticEquation(double x, dou...

0
Q: Most efficient solution for USACO: Cow Gymnastics - Python

12 rhombi in grid w no cornersI was trying to figure out this problem, and I did. However, my code is so abhorrently ugly that I want to tear out my eyeballs when I look at it: with open("gymnastics.in", "r") as fin: rounds, cows = [int(i) for i in fin.readline().split()] nums = [tuple(map(int, line.split())) for line in ...

 
4:12 PM
@Divakar Nope, pick any. If you plan on implementing this, I really doubt you can manage something in Python unless Numpy exposes C tools; I can (and eventually will if nothing is found here) open a Code Review question on this, in C or C++. — OverLordGoldDragon 56 secs ago
 
-2
Q: Colliding with an object

MbretiWhat needs to be corrected or rewritten to block movement (square) only in the direction of the wall? What needs to be corrected or rewritten to block movement (square) only in the direction of the wall? сode function lineLineIntersects(a, b, c, d, p, q, r, s) { var det, gamma, lambda; de...

 
5:12 PM
If you just want comments and advise on your code, you should probably post it here. — Jérôme Richard 52 secs ago
 
5:31 PM
0
Q: Fetching API with requests.Session

political scientistI wrote a script that parses API on schedule (Tuesday-Saturday), downloading everything for the previous day. import requests import pandas as pd from datetime import date, timedelta # # This is what I'd normally use, but since there would be no data today, # # I assign specific date myself #...

0
Q: Finding the number of moves a knight can perform while standing on a given square

NITIN AGARWALThis is a problem from CodeSignal which can be founded over here Here is an image on what we have to do: Code def map(cell): new_cell1 = '' for i in cell: if i == 'a': new_cell1 += '1' if i == 'b': new_cell1 += '2' if i == 'c': ...

 
5:56 PM
0
Q: constexpr local variable causes compile fail

AntThe following code compiles and works as expected unless you swap the line marked ok for the line marked fails. The only difference is that I'm making a local temporary constexpr variable. I don't understand why it fails. #include <array> using TArray = std::array<int, 2>; using TSize = TArray...

 
 
5 hours later…
10:30 PM
1
Q: C - approximate pi (Monte Carlo)

Michael HarveyThis is my first C program that is not "Hello World" level; I would welcome ideas to make it more efficient and readable. #include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #include <stdbool.h> #define FALSE 0 #define TRUE 1 bool incircle(double x, double y); int ...

 
10:45 PM
I’m voting to close this question because it belongs in codereview.stackexchange.comRandy Casburn 29 secs ago
 

« first day (2731 days earlier)      last day (1269 days later) »