All Questions

5
votes
1answer
70 views

Tic-Tac-Toe with changeable board size

I've created a Tic-Tac-Toe program with python which has a option to change a standard 3x3 board to NxN board. I've also created easy, hard and insane AIs. Please help me in improving the code and ...
2
votes
0answers
20 views

Submit random choices on Google form

I've written a Python script that randomly selects radio buttons for each question, and submits the google form. My main questions for improvement are: Algorithm: I collect all the buttons into a 2D ...
-5
votes
0answers
18 views

for 1 string. find the longest string of conditions [on hold]

give 1 character string of 2 characters A and B. Find the number of characters of the longest substring so that the difference between the two characters does not exceed 1. (consecutive substring) <...
-4
votes
0answers
20 views

Multiprocessing slowing script down [on hold]

I am writing a script to help me analyze and get statistics for poker hands. After a lot of research I was able to work with bit manipulation and get my statistics very efficiently for one hand. I ...
3
votes
0answers
31 views

Recursively create a tree in Rust

This code is meant to take a rectangular area, and randomly divide it up into smaller rectangles in a binary tree. I'm somewhat new to Rust. I'm concerned mostly about the ...
-1
votes
0answers
17 views

C++ Monster Roaming Functionality [migrated]

I have a working monster system that follows players around by moving a certain distance towards the players 2D (X, Y) location. However, I now want to make it so these monsters roam around at random ...
3
votes
0answers
26 views

Basic logic problem in Prolog

I thought it would be a good idea to take some easy to solve (by hand) problems and model them in Prolog for practice. Here is a problem I modeled in Prolog: A messy kid wrote a multiplication ...
4
votes
3answers
56 views

Simple BMI Calculator (Python 3)

As my first Python program I have written a simple BMI calculator. I want to know how i can improve this program. Would functions be useful? How can I improve the way that it is presented? ...
1
vote
0answers
30 views

Image processing using multiprocessing in Python

I have an image stack. I am trying to use multiprocessing to do some process on each image in stack to get new image, and then bitwise_or with the old image. Since ...
4
votes
1answer
61 views

Unit testing extension method adding view location expander

Introduction I'm writing unit tests for an extension method I wrote. Its only purpose it is to wrap startup logic which extends ViewLocationExpanders list by an ...
3
votes
2answers
60 views

C++ protocol for sending arrays over TCP

As someone who has programmed in C for a long time, I have just written my first C++ program and feel it would be very valuable to get a review of the code, to see what features of C++ I could make ...
3
votes
1answer
23 views

Pulling images from Windows 10 Lock Screen to a different folder

Windows 10 has an interesting feature where it will display "fun facts" and images on the lock screen. Occasionally, these images are something I would want to use for a background. These images are ...
0
votes
0answers
19 views

C++ merge sort code [on hold]

...
3
votes
1answer
46 views

Project Euler #5 in C++

I'm currently doing the Project Euler challenges to learn C++. The fifth problem is the following. 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any ...
1
vote
1answer
22 views

Unique elements of a list and corresponding indices in Haskell

Given a list vs, I want to get the list vs' of the unique elements of vs, as well as the ...
0
votes
1answer
27 views

Nested loop in lisp to process a 2d array - what's good style (with and/or without loop macro)? [on hold]

Code below is answer to an exercise in Paul Graham's ANSI Common Lisp (ex. 4.1). The challenge is to rotate an array by 90 degrees. I found an example solution which I've commented below. It seems ok'...
2
votes
0answers
23 views

DirectX11 Error Handling

I'm new to C++, been a C programmer most of my life. I wanted to get into graphics and Direct3D is C++ so I figured it was about time. I've been learning about strings, vectors, references, smart ...
1
vote
1answer
37 views

Bubble sort in C (for strings)

What do you think of this bubble sorting function in C, for a string array? I would like to improve the readability, performance, and any good practices. ...
1
vote
0answers
56 views
+50

Persist payload containing multiple items using EF Core Performance Improvements

I have an .NET Core EF application, setup as Database first, that is supposed to take in a payload containing items to be persisted to my database. They payloads can be huge containing multiple "...
-1
votes
0answers
9 views

JWS token inside a message rather than the root of the message?

I'm trying to implement a peer-to-peer system for exchanging 'data'. I'm developing a theoretical model for exchanging this data. For my specification I have some constraints to comply to: Data can ...
0
votes
1answer
32 views

Building complex sentences based on a data structure

I really do not like how bad this looks. It is not readable and I am not sure if I need the stacked map's. There are a lot of iterations going on here (map, join, replace) and performance is really ...
-4
votes
0answers
16 views

how to test input image from pre trained CNN model [on hold]

i have saved my CNN model in .pth file. Using Pytorch. I want to predict input image from my .pth file .I m getting this error. File "C:/Users/MS/PycharmProjects/GUI_last/test.py", line 148, in ...
0
votes
2answers
41 views

Words dictionary out of a text file

Please tell me what the weak spots of this code are (specially in terms of efficiency) and how I can improve it: ...
2
votes
1answer
46 views

Store a hash in a cookie to identify the user's account to keep logged in after close browser

I made a option to user choose to stay logged in even after he closes the browser. It's really simple to implement, but i'm not sure about the hash i used to identify the user that is stored in a ...
0
votes
0answers
17 views

Golang tool to check public repositories list in Github

Didn't post on the Codereview for a while but trying to learn Golang now and wrote my first utility a few days ago and will be glad to see what I did wrong here and what can be done better. This tool ...
3
votes
1answer
56 views

Program to check if in line are doubled words

I made program to open a text file and count the number of lines without doubled words. This number is printed in the end. This is an example text file: ...
-4
votes
0answers
41 views

Why is return nothing?What is mean? [on hold]

public void tableMousePress(MouseEvent e) { if (tablePositions.size() == 0) return; }
4
votes
1answer
29 views

Processing file inclusion directives using mutual recursion

I am preprocessing a set of files where one file is included in another file with an include tag like shown below: file A ...
-1
votes
0answers
27 views

Pygame Flappy Bird Clone Black Screen [on hold]

I am new to coding python, and I followed everything in a 4hr video tutorial but however, I get a black screen when I run my game. I am trying to finish this game for my long-term-project in high-...
5
votes
1answer
46 views

Finding duplicated entries

Since the Esteemed Academia wants me to learn Haskell, and Haskell seems just weird for me, I thought that to train some basic Haskell skills I'd write a simple script I now need in Haskell. This is ...
1
vote
1answer
24 views

Converting words/numbers to Discord “letter/number emojis”

I am a beginner to Python (and programming overall) and I decided that it would be funny if I wrote a program that could convert Letters/Numbers to these "Letter Emojis" in Discord. It works but I am ...
5
votes
1answer
51 views

JavaFX Connect Four AI

I made a Connect Four AI with minimax algorithm. It's my first bigger JavaFX project. Any help for improvements would be really appreciated. Board: ...
-1
votes
0answers
17 views

I just created a Store System using Electron, React, Material-UI, Redux, Redux-Saga, MySQL and Sequelize, and here is the result [on hold]

This project is part of my personal portfolio, so, I'll be happy if you could provide me any feedback about the project, code, structure or anything that you can report that could make me a better ...
1
vote
0answers
39 views

Find non-duplicated integer in a list where every integer occurs three times except for one integer

The task Given an array of integers where every integer occurs three times except for one integer, which only occurs once, find and return the non-duplicated integer. For example, given [6,...
1
vote
0answers
30 views

Sliding marker on link hover and click with jQuery

The code I'm bringing forward is for a vertical menu, where I needed a marker to do the following: When hovering over a link the marker should slide down next to it. When not hovering over a link the ...
3
votes
1answer
77 views

Division without using division, multiplication, or modulus operators

The task Implement division of two positive integers without using the division, multiplication, or modulus operators. Return the quotient as an integer, ignoring the remainder. My solution <...
2
votes
2answers
41 views

Remove and Add items from array in nested javascript object

I have the following object at React state: ...
-4
votes
0answers
22 views

Not able to print correct confusion matrix and also in heatmap values are printing in example 2e+2, e+4 etc etc [closed]

import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd from keras.models import Sequential from keras.layers import Convolution2D from ...
4
votes
1answer
49 views

Shell script to calculate the total space consumed by a user by file-size

I'm working with a small bash code which is working fine but i'm just looking if there is better way to formulate this, In this code i'm looking for the Files between year 2002 and 2018 on the 7th ...
2
votes
2answers
63 views

Simple Web Crawler for Small Sites

This script is my web crawlerfor small sites. Can you possibly review it for best coding practices? Code ...
14
votes
3answers
2k views

Hangman Game with C++

After finishing my C++ course, I decided to make a hangman game. (without the drawing part) I was wondering how the code could be improved. Header File: ...
1
vote
4answers
102 views

Find the thousandth integer without the digits 3, 4, and 7

I have to find the thousandth number (excluding numbers 3, 4, 7) but it's taking a long time, about 9 seconds. I'd like to find out how to improve performance. ...
5
votes
2answers
71 views

Simulation of spring-loaded inverted pendulum

I've finally committed to moving to Python 3 from MATLAB. I'm currently porting my MATLAB code, and I'm sure I'm missing a lot of common best-practices. For reference, I'm simulating a spring-loaded ...
0
votes
1answer
27 views

Time limit exceeded in K-th symbol in Grammar (LeetCode)

I am taking efforts to solve problem K-th Symbol in Grammar - LeetCode K-th Symbol in Grammar On the first row, we write a 0. Now in every subsequent ...
19
votes
4answers
4k views

Project Euler #1 in C++

I'm learning C++ and currently doing Project Euler challenges. The first challenge is the following. If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. ...
1
vote
2answers
47 views

Secure a class for an hydratation from ma form POST

I use PHP classes for managing users accounts and I wonder if what I'm doing is correct. I directly use the $_POST['form'] for hydrate ...
1
vote
1answer
52 views

Simple MySql or MySqli Class

Which one of these methods is better/safer to use? And what benefits could I get using one or other? Simple mysqli: connection.php ...
0
votes
0answers
37 views

Looping through table rows and replacing key terms in a word template

Here is my code for a sub which does the following: read header of a table into an array reads first row of said table into a 2nd array loops through the first array and replaces the marked ...
-3
votes
0answers
17 views

chart.js not rendering api data [closed]

Using Vue.js, Vue-chart.js and API fetch that returns an object with 2 arrays of chartData and chartLabels to pass to a line-chart. The chart does not render but in the image below chartData and ...
5
votes
3answers
416 views

Finds a Character based on distance and health

I need to improve the efficiency of my program and, using the profiler, have narrowed the problem down to 2 key areas, but I am having trouble coming up with ways to make the program run better. ...

15 30 50 per page