« first day (2669 days earlier)      last day (1646 days later) » 

00:00
RELOAD! There are 6938 unanswered questions (89.7923% answered)
00:12
If you're just asking for a review of your code, try asking it on codereview.stackexchange.com - SO is more for solving problems — Grismar just now
00:31
0
Q: Need help to help to with this probabilistic model

Paulo Sergio SchloglI am trying to develop a simple probabilistic markov model with python. I got this piece at the moment and I would appreciate any help to improve and check if my mind set is in the right place. I am not a expert in the field but I am trying to use this models in my project. I really appreciate an...

01:05
0
Q: I missed that a question was for a subset of the language. Next steps?

CarcigenicateI recently answered a Python review question. Unfortunately, I had missed that the question was for MicroPython; a subset of Python with reduced features. As a result, 1/2 to 2/3 of my suggestions are irrelevant to the OP because they involve features that aren't available to them. I'm wondering ...

01:54
Please read about what's on-topic in the help center. This is far too broad and opinion-based to be on-topic here. We don't do code review on SO. But we do have a sister site that might be appropriate: Code Review. — Chris 5 secs ago
 
2 hours later…
04:12
1
Q: C++20 concepts for container and allocator

PHDI implemented concepts for container and allocator types. I referenced type requirements from here for container and here for allocator. For the sake of simplicity, there are a lot of type aliases declared in the template because concept itself does not allow declaration. I'm also concerned that ...

Monking
04:37
0
Q: Console Snake Game C++

Mohamed MagdyI've tried to make a snake game. I think it works. But I really need your help to improve the code in terms of [readability - maintainability - efficiency, and so on]. Is my code spaghetti? Any criticism is appreciated. Here's what's done: #include <iostream> #include <vector> #include <conio.h> ...

 
1 hour later…
06:03
Monking
 
1 hour later…
07:05
0
Q: SevenZipCompressor code that uses Commons-Compress to compress and uncompress 7zip archives

NzallI wrote a Compressor utility class to generate 7zip files containing everything in a specific directory. The problem is that it's an order of magnitude slower than both archiving the directory using the native Windows 7zip.exe AND archiving to a .zip file using a ZipCompressor that uses the same ...

07:44
Monking
0
Q: Uploading CV file to an e-commerce website and sending the CV to employer's email

Hooman BahreiniI am working on an e-commerce website. In this specific scenario, people can upload their CV to apply for a job. The job application is sent to ApplyForJob action method: [HttpPost] [ValidateAntiForgeryToken] public async Task<JsonResult> ApplyForJob(JobApplicationViewModel jobApplicationViewMode...

-1
Q: C# .Net 4.0 Async Method

Aleksa Risticpublic static Task<List<ARSms>> GetSentAsync() { Task<List<ARSms>> t = new Task<List<ARSms>>(() => { if (!Directory.Exists("arDebug")) Directory.CreateDirectory("arDebug"); if (!File.Exists(Path.Combine("arDebug", "sentSms.ar"))) File.Create(Path.Combine(

08:19
0
Q: My fisrt game - Arkanoid

iteckoI'm new to java and I have just finished my very first game - Arakanoid. I would appreciate, if anyone could look at this and tell me some advice and tips how can I optimize my code. Thank you. :) I have 5 classes - Breaker, BlockBreakerPanel, Ball, Paddle, Block. Look: This is the main classs: p...

09:05
Monking
0
Q: How to open multiple images from a Python for loop on Ubuntu

JoshI have a Python for loop running through a camera stream from an IP cam. It is an image recognition loop with a conditional statement for when a specific pattern is recognized. I would like to open up images in the same folder, let's say 1.png, 2.png, 3.png on an external monitor depending on whi...

0
Q: Analysing flow; 274k entries

achI am using SQLAlchemy to interact with PostgresSQL using Python. I have to write data from FlowTable into a new table, AnalysedFlow. I have to check with a database usage of 274k entries and it takes time. I was wondering if there is a method that makes this task faster or more efficient? flows =...

09:33
0
Q: Improving response time of flask endpoint

Reez0The flask endpoint is supposed to take a table name as a parameter, and then return the entire contents of the table as JSON. The table has 200,000 rows and I was wondering if there is any way to improve the response time which is currently about 7 seconds. @app.route('/tableToJson') def retrieve...

0
Q: Poker Game: Building a console menu

Asel SI'm working on a menu for my poker game console app. I've conceptualized the menu(s) as a class with menu items that have their own position. I would like to get pointers on how I could improve on what I have done as I would like to add a settings menu in the future. Here's a gif of how the menu ...

09:52
Why should there be something wrong? If you just want a review you should post on codereview.stackexchange.com. — churill 21 secs ago
0
Q: Concatenate several CSV files in a single dataframe

TmSmthI have currently 600 CSV files (and this number will grow) of 50K lines each i would like to put in one single dataframe. I did this, it works well and it takes 3 minutes : # Dictionnary of type for each column of the csv which is not string dictTypes = {'COLUMN_A' : bool,'COLUMN_B' :int, ......

We can not answer this. This example is beyond advisable - it is too abstract from naming and anything. This may or may not be an abuse of local variables, depending on many factors all of whom are not here. Also, this is a site for programming issues - code review has a separate site (codereview.stackexchange.com) — TomTom 11 secs ago
I’m voting to close this question because it belongs to codereview.stackexchange.comTomTom 56 secs ago
10:35
This might be better suited for SoftwareEngineering for general principles, or (with actual code) for CodeReview. — tobias_k 57 secs ago
10:47
0
Q: clean code with templates

newbieI am fairly new to c++, trying to write good clean code. I have the following template function, with MyIterator being a map iterator. I want to split the function, write another template, to handle a few cases separately - all cases having z.add() and the rest separately, so that it can be calle...

11:36
0
Q: Cookie authorization Golang

Honor 373I'm writing login system in Go(Golang) using cookies.I think it's isn't safe enough. Can you provide some suggestions on how to improve the security. Main file: package main import ( "fmt" "golang.org/x/crypto/bcrypt" "html/template" "math/rand" "net/http" "strings" "...

Monking
@CaptainObvious Your choice on the close reason, Missing Context or Code not written.
12:26
0
Q: Cosine Similarity Matrix Loss Function

Oliver HollandI am currently implementing this paper on generalised end to end loss: https://arxiv.org/pdf/1710.10467.pdf A batch of N speakers and M utterances are fed to the model which outputs an embedding vector of size P for each utterance. The first step for calculating loss is constructing a cosine simi...

0
Q: Alpha Beta Pruning (C#) bears results different from classic MinMax

Robert TausigI have written this code for a chess engine: double AlphaBetaPruning(int currentDepth, bool maximizingPlayer, double alpha, double beta) { try { // Terminating condition. i.e leaf node is reached if (currentDepth == maxDepth) { ...

12:43
@CaptainObvious 1 more VTC.
13:15
0
Q: javascript fillter objects

Jitendra SinghI want to filter products array and want a new array or product. how can i filter product using javascript.. ?? let products = [ { "the_ID": 12, "the_title": "ABCD", "acf": { "type": "RG6", "core": "Copper", "length": "90m", } }, { "the_ID": 13, "the...

@CaptainObvious No code.
Note: Duplicate of deleted question, cross-posted to Code Review (closed for being off-topic). — Zeta 6 secs ago
@Zeta There is code, just no filtering code, still off topic.
13:39
The person who told you to go onto codereview.se has done ýou a disservice. They are not a regular there and their advice was very poor. However, deleting and reposting a closed question is not to be done. It's as off-topic now as it was 4 hours ago. You should edit your post and bring it to shape. — StoryTeller - Unslander Monica 34 secs ago
13:56
@CaptainObvious CNI
1 more VTC
Why do people keep upvoting off-topic questions...
@Mast This the chess one? It's pretty hidden, I easily could have missed it
@Peilonrayz That one, yes.
Mast, how did you learn ML? Is there a book / tutorial you'd recommend?
@CaptainObvious 2 more VTC
@Peilonrayz First thing you got to realize is ML is like sorting. There's 20 ways you can do it and you don't want to learn all 20 at the same time.
Technically it's more like filtering, but metaphors...
I started out with a raspberry and a camera, OpenCV on C++.
It should work fairly well with Python these days and a modern raspberry can take a beating.
Had a component-detection project we used it for.
Ryan Donovan on August 24, 2020
To offer a seamless developer experience, we also felt it was important to create a specialized programming language, called Motoko, that is designed to directly support the programming model of the Internet Computer, making it easier to efficiently build applications and take advantage of some of the more unusual features of this platform.
14:10
Recognizing one 4mm2 part from another.
SMD electronics.
I jerry-rigged a construction in K'nex, hung the raspberry under it and butchered a program that was originally written for face-recognition to work on coins (for demo purposes) and SMD components instead.
Screw-up the lens from the board-camera just enough and it's a macrolens.
I think that was 7 years ago.
Damn, that's one way to learn ML XD I've not seen K'nex in years either I was thinking it was some more jargon I didn't know at first.
Hehe, nope, I've often abused it for prototyping purposes.
Just because it's sold as a toy doesn't mean it can't be used for real projects.
Mast professional K'nexer? ;) That's pretty cool
Yeah, I've seen some similar stuff with Lego too (not being used as a toy)
I've done a number of projects which were held together with breadboards, duct tape and K'nex.
@Mast Using duct tape can get you labelled as a Red Neck. :)
Redneck is a derogatory term chiefly, but not exclusively, applied to white Americans perceived to be crass and unsophisticated, closely associated with rural whites of the Southern United States. Its usage is similar in meaning to cracker (especially regarding Texas, Georgia, and Florida), hillbilly (especially regarding Appalachia and the Ozarks), and white trash (but without the last term's suggestions of immorality). In Britain the Cambridge Dictionary definition states: "a poor, white person without education, esp. one living in the countryside in the southern US, who is believed to ha...
14:23
@pacmaninbw IDK duck tape's a staple over here.
If something's broke it's cause you've not used enough duck tape.
4
@pacmaninbw Yea? Never heard of that before.
@Peilonrayz Exactly. There's diagrams for that.
Kaz
Kaz
Beat me to it ^^
@Peilonrayz Duct tape is a staple everywhere for the same reason, some people just tend to over use it.
@pacmaninbw I'll send you a picture of my wallet one of these days.
Pure duct tape.
6 years old, still holding after some minor (duct tape) repairs.
@Mast No need, the wallet I have now is fairly new, only 5 years old, but I had one I used for 22 years.
14:27
I was bored in the train, one thing led to another...
@Mast Ok, I've never heard of Corona being used before.
I was still biking from the station to my work back in those days, so I kept a roll of duct tape in my bag in case the folding bike fell apart.
@Peilonrayz You don't use it, you drink it. When there's no problem :-)
4
@Peilonrayz What beer do you prefer?
Ah that'll explain it - my parents are non-drinkers :)
14:29
0
Q: Programatically close optical drive tray

user10191234I really liked the close tray program that CD-ROM drivers programs used to include in MS-DOS days. Since I live in a place where even getting an internship is impossible, I've decided to learn by myself. I implemented this "Hello World" C# script to do that with a twist. It will check the optical...

@pacmaninbw They're all yuck imo. Much prefer some mixers or ciders
Not a big fan myself, prefer ale over beer and scotch over both.
Good Single malts from Scotland.
Nothing beats a Highlander malt.
Back to debugging a parser and lexical analyzer that are failing some unit tests (not catching all errors). TTYL
@Kaz How's it going?
Kaz
Kaz
14:39
@Mast I'm alright. Company's still standing. I've dropped 42 lb since Lockdown started. All in all, not much to complain about.
Sounds like you're doing more than fine.
Kaz
Kaz
@Mast I'm adaptable ^^
15:15
Monking
15:53
mOnking
16:04
moNking
monKing
1
Q: Showing values from different fields in an array with ternary

PankwoodThis small piece of code shows the value of different fields of an array. I'm looking for a way to improve this nested ternary function. An if statement solution would be obvious, so I'm wondering if there is something more elegant to solve it. <button type="button" onclick="myFunction()">Check</...

1
Q: get my code faster at getting data from ajax

davidsi02I want to get my code cleanner and more efficient. This code gets variables form a PHP file and filters it to show the selected user name, all available usergroups on a list box and the groups he is currently into another. Currently it's working grate but it has a lot of delay between the modal s...

@CaptainObvious FGIW'd... but may not be on-topic...
@SᴀᴍOnᴇᴌᴀ Forgive my blindness, what's off-topic about it?
possible answer invalidation by Pankwood on question by Pankwood: codereview.stackexchange.com/posts/248371/revisions
16:20
@Duga No AI
@John, you inspired me to approach the question from an empirical perspective, which in turn led to this Code Review question: codereview.stackexchange.com/q/248340/131879. The takeaway is that on arrays, with commodity hardware and operating systems, I find that a solid Insertion Sort beats the pants off an equally solid Selection sort. — John Bollinger 44 secs ago
16:39
@Peilonrayz at first glance, names like myFunction, value, etc. made it look like hypothetical code but it has sample input and output....
plus the title made it look specific to the ternary operators...
@SᴀᴍOnᴇᴌᴀ That makes sense. Ah yeah, merging example IO and the code normally looks suspicious
Are you asking for a code review? Or do you have a specific bug? — ADyson 14 secs ago
@John, you inspired me to approach the question from an empirical perspective, which in turn led to this CodeReview question: codereview.stackexchange.com/q/248340/131879. The bottom line is that operating on randomly-ordered arrays, using commodity hardware and operating systems, my pretty-good Insertion Sort beats the pants off my equally-good Selection sort. I find that Insertion beats Selection even in the former's worst case, even without applying a known optimization to the Insertion sort that greatly improves its performance in such cases. — John Bollinger 43 secs ago
Actually code review would be awesome. Or a hint how to make it better and less hard to MySQL saving. — Vlad Zaev 22 secs ago
17:22
1
Q: Performance and abstraction questions re: scraper for carfolio.com

hahuang65I'm a new Rust programmer, primarily coming from Ruby experience. I started working on a small project to scrape vehicle specifications from https://carfolio.com I chose to write it in Rust and actually got the code working, but I had some questions regarding async, performance, as well as code o...

0
Q: Extreme use of pointers in adjacency list graph construction?

gustPlaying around with pointers in C++, implemented an adjacency list graph. Am I going too far/extreme trying to place data onto the heap? graph.h #include <memory> #include <unordered_map> #include <forward_list> #include <utility> template <typename TKey, typename TWeight> class Graph{ stru...

Greetings, Programs.
17:47
We don't do code reviews here actually. That's why I asked. There is a separate Code Review Stack Exchange site which might accept your question though — ADyson 1 min ago
I’m voting to close this question because it's asking for a code review and there is no specific problem to fix — ADyson 36 secs ago
 
1 hour later…
18:52
0
Q: Is this wrong Strategy Pattern Implementation?

GiviI've read a lot about Strategy Pattern, and came with a little bit different(simple) implementation. Well, I'm wondering - current implementation is wrong and should be avoided, or is it ok? public interface ICartStrategy { ICartService GetService(UserStatus userStatus); } public class CartS...

19:14
If you are looking for code improvement please post this question here: codereview.stackexchange.comMarios 25 secs ago
19:35
There is a cool site where you can get code reviews: codereview.stackexchange.comAndy 34 secs ago
You should probably ask this over at the code review stack exchange — Nathan 21 secs ago
I’m voting to close this question because it should be on the Code Review stack exchange — Nathan 5 secs ago
19:51
Once you have the code fixed and working get it reviewed. codereview.stackexchange.comMartin York 41 secs ago
0
Q: Doubly linked-list implementation

Dynamic SquidI come from a C++ background, and I recently got into C, and one of the first things I made was a double linked list since I though it would be good practice for me with pointers and memory allocation. It isn't too complex though, it's just with some basic functions. Here's the overview of my lis...

@CaptainObvious sigh
20:17
0
Q: Writing a program that produces the sum of all white space separated integers in a given file

CluelesshintHow's my code? Works perfect for what i'm trying to do :) #include<iostream> #include<string> #include<vector> #include<algorithm> #include<cmath> #include<fstream> #include<assert.h> using namespace std; inline void keep_window_open() { char ch; cin >> ch; } int main() { int sum{ 0 }, nu...

If you are going to be doing this with large datasets or a large number of external files then you will eventually want to move to working with ADO connections instead of opening workbooks. See here: codereview.stackexchange.com/questions/247866/…HackSlash 6 secs ago
20:42
-1
Q: How to sort scores from file( SFML, VisualStudio , C++)

p2wizzySo basically I've got a working game so far, and I'm on the game over state. I've written the code for displaying. Although I don't know how I would write the code to sort the scores in numerical order std::ifstream readFile("Highscore.txt"); if (readFile.is_open()) { std::...

@CaptainObvious I can't help but see and think it is something like So FML...
21:35
@SᴀᴍOnᴇᴌᴀ See the new comment.
Added a nail to the coffine.
21:57
1
Q: chess game Class

Aryan ParekhHere is the chess class for my very own chess game. Everything is in this class. Generating moves, getting a move from the computer, printing the board etc etc. #include<iostream> #include<vector> #include<string> typedef std::vector<std::string> buff; typedef std::string str; // Pawn - 1, Knig...


« first day (2669 days earlier)      last day (1646 days later) »