instruction
stringlengths
71
95.1k
"Word Search II" is a hard problem on LeetCode (problem #212): Given an m x n board of characters and a list of strings words, return all words on the board. Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell ...
Trying to mimic a scenario where multiple threads are creating the traffic to fill the buckets & a thread which leaks the bucket at a specified rate. Could you review this code? #include <iostream> #include <mutex> #include <condition_variable> #include <thread> #include <atomic> #include <chrono> using namespace std;...
The following function is an attempt to generate powers of two below the input number max. So powers_of_two_below(15u8, u8::BITS) generates 1, 2, 4, 8. It does calculate 16, but does not include it. This function avoids calculating powers that cause overflow by taking bits as input (since there doesn't appear to be a s...
I want to check if I'm correctly disposing of resources using Ado.NET. I'm not sure when the 'using' statement makes .Dispose() irrelevant. Please bear in mind I'm aware I shouldn't hardcode my SQL commands, this is just for training purposes. internal void CreateTable(string connectionString) { u...
I made this function to recursively delete a directory and its contents, because using VLAs to concatenate paths is more susceptible to Stack Overflow and is probably slower. #include <unistd.h> #include <dirent.h> #include <fcntl.h> #include <string.h> int SavesFD; static int Recursive(const int File, const char *cons...
Please review the code to categorize some uncategorized objects: const categorizeSimilarTransactions = (transactions) => { if (!(Array.isArray(transactions) && transactions.length)) return []; const uncategorized = []; const categorized = []; const orderIds = transactions.map(transaction => transacti...
I'm studying Dasgupta's "Algorithms". I solved this problem in C++: The garage sale problem. On a given Sunday morning, there are \$n\$ garage sales going on, \$g_{1}, \cdots, g_{n}\$. For each garage sale \$g_{j}\$ , you have an estimate of its value to you, \$v_{j}\$ . For any two garage sales you have an estimate o...
As part of an online programming challenge, I wrote a program that implements a stack of integers, supporting adding and removing elements, finding the last inserted element, and the minimum element. The premise is that all methods must be implemented in constant O(1) time. In my code, I opted to use LinkedLists for th...
My intention is to create an API as generic and DRY as possible using Go. To achieve this, I have made some more or less common decisions: To use AJAX call to avoid reloading page when updating the web page. Instead of using Go. To exclude hard coded queries from the API to reduce the endpoints (routes). As a bonus th...
Details: Based on the input parameter to return corresponding output which is needed for setting & accessing Internet over interface [ppp0]. If the SIM is registered[ status = 1]. This script will be called in another based on cli. Code: #!/usr/bin/env python3 import os import datetime import sys, time, logging, codecs...
I have the following code which builds up a dictionary of endpoints that I iterate through later on. Is this the cleanest, most scalable and performant way? I was thinking of adding a list as a key to the library file with keywords but I didn't think that was maintainable. The code works in both scenarios, and as menti...
I would appreciate to have your opinion on this code and whether I can refactor it and make it cleaner. I don't like the fact that I have 3 nested for loops, which makes the complexity of this code O(n³). categories = {} for k1, v1 in res["relationship_types"].items(): for k2, v2 in res["remote_types"]...
I have this code for endpoint in endpoints: if key in endpoints[endpoint]['keys']: yield endpoint pylint suggests iterating it with .items() for parent,child in endpoints.items(): if key in child['keys']: yield child Now when I do, I get a warning about an unused variable called parent Which i...
Is it right to put this code, inside this class, like this? playlist = QMediaPlaylist() url = QUrl.fromLocalFile("music.mp3") playlist.addMedia(QMediaContent(url)) playlist.setPlaybackMode(QMediaPlaylist.Loop) player = QMediaPlayer() player.setPlaylist(playlist) player.play() from PyQt5 im...
I have a dictionary that I am writing to a csv file, however I am only writing the values. I want to know if there is a faster way than using a for loop. I am using python 2.7 here is my code. empty = "" with open("parse_data.csv", "w") as f: for key, value in order_dic_keys.items(): if value is None or va...
I have made this code to copy a folder to another disk, and it works, but I think there is a better way. If don't use the replace(), it says the folder exists and it is correct. The 'T': is real. Can someone point me to the right path? The folder_path is the path for the torrent folder. it is a normal path, like: 'D:/...
I use four bools, if true a wall is in that direction: bool top = true; bool bottom = true; bool left = true; bool right = true; Then I work through the four and create a wall for each: //Create Walls if (top) { GameObject myWallSelection = WallSectionTop[Random.Range(0, WallSectionTop.Co...
I have the files as below. What I'm looking for is some feedback with regards to security, reliability, maintenance, scaling and performance. What is going on? Make a request to get a token to access some APIs. Use SQL to get a list of users. For each user, need to call 3/4 APIs and store the information in a MSSQL DB...
I have an Android viewmodel for a Fragment that requires the user to perform multiple tasks. In addition to a LiveData object to track the status of each task, I also need a LiveData that tracks a summary of the status of all the tasks. I wrote the following MediatorLiveData class that takes a list of LiveData objects ...
I'm a newbie getting into web scrapers. I've made something that works, it takes 3.2 hours to complete job and randomly have 10 lines blank each time I run this job. Help is much appreciated! import sys import pandas as pd from selenium import webdriver import time from datetime import datetime from bs4 import Beautif...
Background I wanted to write an event loop that supports scheduling, but found that no implementation of priority queue that I know of supports waiting on a condition variable (the idea is that the looping thread will wait on the condition variable and if the wait timed out, it means that it can pop the top of the queu...
These commands do what I want, but I'm trying to find out the best approach for this. My main areas of concern are: error handling and disposal of resources. In regards to error handling, I'm catching the errors by wrapping the caller in a try catch. In what concerns to disposal of resources, is it enough to wrap my co...
I am making a website where you can search through all the countries in the world. Once you have found a country you want more detail about you should be able to click and view a detailed page with more info. I am having trouble updating the countries that are currently shown with the user's restrictions. I want to add...
I made a code that simplifies the job of sending anything to print with the Windows API. The module has a Document object which stores a reference to the actual device context within it. You can access some of the real DC functions, like Document.dc.Polygon to draw polygons. Any recommendation or improvement that occur...
I am implementing a program to interact with hash table, the data to be hashed is just number. It works but I want to know if there is any error like: memory leak,... in my code and how to improve my code. Any help would be appreciated. #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #inclu...
Here is my attempt at Advent of Code Day 4 using Haskell. A file contains list of number in first line. And subsequent lines have the bingo Cards 7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1 22 13 17 11 0 8 2 23 4 24 21 9 14 16 7 6 10 3 18 5 1 12 20 15 19 3 15 0 2 22 9 18 13 1...
I have a solution for a question I asked on SO: I am trying to create a database where I also need to find the time difference inside a record. However, timediff() does not give the result I need. What I mean is that there are 3 fixed time intervals in every day and each record stores time_1 & time_2 datetime entries....
I have the following file that is included in others. I realise I need to put in try/except but for the purposes of this question, the below should suffice We're using MS SQL Function Already done in the example below. Except for try/except am I missing anything obvious? Class I was looking at https://stackoverflow.com...
I wrote a program that implements the Round Robin planning algorithm. The total number of processes is read directly from the input standard, and for each process the arrival time and execution time are specified. The time interval of each process (quantum) is read from the standard input. I calculated the average resp...
I am using WP with the Avada theme and the built in Star Rating element as well as ACF Pro. Unfortunately I found out that the Star-Rating element adds a rating scheme to the footer of the website without asking. There is also no way to disable this. This is annoying So I created my own shortcode based on the CSS code ...
I wrote a program that implements the same function as the mv command. I know this is not the best implementation, so I would like some suggestions for improvement, possible problems. What you should change? code: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include...
I wrote a program that implements the Shortest Job First (SJF) scheduling algorithm. The total number of processes is read directly from the standard input, following that for each process to specify the execution time. The average waiting time is also calculated and the order of execution of the processes is displayed...
Given an Image I with dimensions as {rows, columns}, for every pixel in the image, the following needs to be computed - calc1 = image[i][j - 1] - image[i][j]; calc2 = image[i-1][j] - image[i][j]; calc3 = image[i][j-1] - 2 * image[i][j] + image[i][j + 1] calc4 = image[i-1][j] - 2 * image[i][j] + image[i+1][j]; calc5 ...
I have developed a program that implements a Priority Scheduling algorithm (Priority Scheduling). The total number of processes is read directly from the standard input, each process specifying the arrival time and the execution time, respectively its priority. I calculated the average response time, respectively the a...
I wrote a program that implements a minimal shell and reads from standard input commands and executes them. Is my implementation ok? I admit that I helped myself a lot with google. Could I have written a better implementation? Also, I tried to check the program with the dash command, because they are similar. I tried t...
To collect the values of an api, I use three loopings, I would like to know if it is possible to improve this method that I use. a = 9625897 def graph(a): url = f'https://api.sofascore.com/api/v1/event/{a}/graph' response = requests.get(url, headers=headers, timeout=1).json() if 'graphPoints' in response: ...
AABB: Axis Aligned Bounding Box ALGORITHM: Compare m number of AABB to n number of AABB to find if there is a collision between m and n sets. PROBLEM: Slow implementation for large number of rectangles (m>1000)(n>100000) POSSIBLE SOLUTION/QUESTION Is there any algorithm such that bounding boxes are joined together? / A...
The code below is my solution to the following problem (problem #5 on LeetCode): Given a string s, return the longest palindromic substring in s. I wonder whether my use of iterators is an overkill. They seem to be convenient for calculating the length of the ranges and for constructing the string in the answer. They...
This is an implementation of a Sieve of Eratosthenes as [Symbol.iterator] in JavaScript. Comments welcome, my JS is a bit rusty. Making a class of this is mainly the reason to have fun with the iterator. I will build a generator of it next. UPDATE: inverting the sieve flags removes the need to initialize the array wit...
The full code (works on x86_64) is available on GitHub At first I used just original floating-point version, but it turned out to be too slow, because used DSP (32 bit, 120 MHz max, 112kB program and 448kB data RAM) does not have FPU. Rewriting the code to be fixed-point made the program run faster by a factor of about...
In my game there are space ships and each of these space ships tracks which other ships are in range of it. I need to perform certain logic when a target ship comes in range of another ship, and certain logic when the target ship leaves the range of the ship. I am looking for advice on the most performant way to manage...
https://github.com/bbachi/nextjs-nginx-docker https://github.com/bbachi/nextjs-nginx-docker/blob/main/Dockerfile # stage1 as builder FROM node:10-alpine as builder # copy the package.json to install dependencies COPY package.json package-lock.json ./ # Install the dependencies and make the folder RUN npm install && m...
Background I'm creating a (probably bad) map-generation utility in C# to generate fractal terrain and similar. Nothing I do probably needs special treatment, but I thought it best to start with a good source of random values. My understanding is that C# only has two built-in sources of random numbers: System.Security....
This code gets a random word from a word list for a category chosen by the player. The categories are the names of text file containing a list of words. "Words" can contain spaces and hyphens (e.g. "Charles Darwin" counts as a word). Eventually to be incorporated into a Hangman game. The current post is a revision in r...
Here, I have made an attempt to find out whether a prefix tree is any more efficient than a simple java.util.HashSet<String>. See what I have: com.github.coderodde.text.autocomplete.PrefixTree.java: package com.github.coderodde.text.autocomplete; import java.util.ArrayDeque; import java.util.ArrayList; import java.uti...
I have a string which contains JSON-like object flattened (stringify()ed). I need to JSON-ify it back. It's a custom format, so I wrote function to JSON-ify the string: #include <string> #include <unordered_set> #include <iostream> const std::unordered_set<std::string> reservedWords{ "coords", "comment" }; std::strin...
After completing an introduction to Python tutorial, I wanted to put my basic knowledge of control flow and data structures to use, and felt this was a great choice for my first program. I created the below to run in Jupyter Notebook / Visual Studio Code terminal. It behaves like an over-the-board version, based on col...
So Python's base random class uses the Mersenne Twister as its base for seeded random number generation. If available, it can use /urandom/, but that is beside the point. There have been several claims that this generator is not ideal, and that other generators should be used instead. Source Extending the base class o...
I made a kivy app to find the rhyming words for a word entered by the user. It displays all the rhyming words as OneLineListItems in a kivy RecycleView. On clicking on one of these OneLineListItems it uses PyDictionary to display a few definitions of the word on the right-hand side of the screen, within an MDBoxLayout....
I wrote a program that uses a pipe to send messages from a parent to a child. Question: Is this the correct way I sent the messages? Could I have done otherwise? What can I improve? my code: //Parent/child processes communicating via a pipe #include <stdio.h> #include <unistd.h> #include <string.h> int main(int argc, c...
I want to know if that code is correct and readable. In class avatar the method getAvatar() validates the data. It checks if the field is not empty and if the photo extension is correct. If not, an appropriate exception is thrown. Class AvatarUpdating is responsible for updating the avatar in the database. Avatar valid...
I wrote a function to convert, without loss of precision, a mpfr - class value to a gmp bigq value. (This particular operation is not available in the R libraries Rmpfr and gmp, tho' there are functions to convert in the other direction). My code works but feels clumsy to me. Any suggestions to optimize? mpfr2bigq <- ...
I'm a strtok_r() hater. I don't want to make a copy of my input string that it can destroy. After decades of struggle and strife I drafted a modern replacement that optimizes for the clarity of the caller. I call it tokstr, and it is written in C for callers in C. Example: tokstr_t ts = tokstr_string("this:is+-test...
I'm teaching myself Python. I wrote this code for work to help me troubleshoot end users PCs. It opens a GUI with a selection of buttons. It's written in python using pyinstaller to convert it to an executable. It's super slow - taking 10-15+ seconds to run on a PC. Why is it so slow and how can I improve it overall? T...
From numbers from 1 to 100, count the numbers where the following equation is satisfied with 1 <= a <= 100, 1 <= b <= 100, and 1 <= c <= 100: $$a³ + b³ + c³$$ I have this: def has_power3(n): for i in range(1, n+1): for j in range(1, n+1): for k in range(1, n+1): if i**3 + j**3 ...
How can i make this work with fewer lines? The goal here is to get the third biggest integer of an array. I would also appreciate if someone polished this code. let array = [442, 93, 3, 5, 30, 10]; const f = (arr) => { let secureArr = [...arr]; let big0 = Math.max.apply(null, secureArr); const index0 = s...
This code transforms a normal map into a 2D gradient field and then iteratively integrates it to a likely solution. I don't have a lot of experience with C++/CUDA yet and would appreciate some advice mainly on the code style specific to C++ (I come from a C# background). Any advice on increasing performance would also ...
I'm making a text-based RPG in JavaScript. I made a skill leveling system that works, but I feel like the function arguments get passed around a lot and, the code is not very scalable. Do you have any suggestions on how I can improve this code? Ideally, I want to call only one function like: addExperience(25, charisma)...
I have implemented Knuth up-arrow notation in Python: from functools import lru_cache @lru_cache def kuan(a, b, arrows): if arrows == 1: return a ** b res = a for i in range(b): res = kuan(a, res, arrows - 1) return res This can calculate kuan(3, 3, 1) pretty quickly. But it slows do...
I tried my best to replicate, in style and functionality, the Windows standard calculator: I would like to get some feedback on the efficiency and readability of my code as well as the approach i chose (for example the one of using the evaluate function on the expression textbox): Form1.cs using System; using System.C...
I currently have a worksheet with approximately 40K rows and 108 columns that I am working with. What I am doing is creating a list that when user selects a particular text in that list then certain columns and/or rows are hidden. The issue I am encountering is that when 'Unsecured Streamline' is selected, the code to ...
So I need to update my nested dictionary where the key is "compensationsDeltaEmployee". I created a string cost_perhour to hold the value of my conditional statements. Now that I am done with the string. What is the best or pythonic way to update my nested dictionary with a new key "costPerHour" with the value of my st...
I have written a module that allows the developer to generate a CLI and parse given arguments. I am fairly new to C and would love to hear feedback on my code to improve it. All feedback is welcome however I am mainly concerned about best practises and optimisation. Included is the header file and the C file. // cli.h ...
I want to transform a list of lists of lists that I have in a MongoDB document into a map of maps of maps in my java Domain class. The problem I have is that the fields are mixed between the levels. For instance, the value of the deepest list in the document is the key of the first level map in the domain class. Here i...
This is a modern C++ implementation of a thread-safe memory pool -- I want to make sure I am solving the critical section problem correctly (no deadlocks, starvation, bounded waiting) and I am getting details like the rule of five correct (copy not allowed, move doesn't trigger double release). Design criteria: Small ...
I'm making this control toggle between hide and show base on the value in this hidden value. I wanted to use a Boolean because I can just do something like == true. Is this the best way to do this? Working sample https://jsfiddle.net/tjmcdevitt/4bdrfgcu/12/ $("#hdMeetingDateId").val(500); //"#hdMeetingDateId"...
I have written the following function: #include <iostream> #include <utility> #include <string> #include <string_view> #include <limits> #include <optional> #include <stdexcept> // header file std::optional<int> isInteger( const std::string_view token, const std::pair<int, int> acceptableRange = ...
#include<iostream> #include<iomanip> using namespace std; int main() { // Prompt for and get the number of dolls. int numberOfDolls = 0; cout << "Number of dolls -> "; cin >> numberOfDolls; // outer loop for printing the dolls according to the number entered for (int i = 0; i < numberOfDolls; i...
I am trying to find a more efficient way to print the number of descents in a permutation using R as my programming language. This code does it for the numbers 3 to 10: # this function finds the number of descents in a permutation numberOfDescents <- function(prm) { descents <- 0 for(i in seq_len(nrow(prm))) { ...
The Problem I am developing a Visual Studio extension for importing code from a server. Because of the way Visual Studio works, multiple threads could try to perform the same operation at the same time. Thus, I wanted a class that would ensure that a) each Task would only be performed when needed and b) each Task would...
Anyone please review my code and give some improvement suggestions. I wrote code but not to the best standards. I think this site give some valuable suggestions this code is for extracting xlsx or csv files int list of dicts and change the values of the dict objects after that concert that to json file excelparser.py ...
I had a scenario where I needed to sort a list of EmailTemplate, but didn't have anything to sort the list by (other than a common number in the Name property). The email templates looked something like this: Some email template - 1 Some other email template - 2 Another email template - 3 (with end text) Xylophone emai...
I'm looking for best practices for writing secure session managers. I'm making a table for the authorization token (UUID OR GUIDv4) with autoincrement, user_id, token, status (enum) then update status onPause() onResume() so when I update a token I get a new autoincrement to store with the token in shared preference. T...
Here's the cool number problem given to me by my senpai in competitive programming: A cool number is a number that can be at the same time written as the square of a whole number and the cubic of another whole number. Write a program in Python that returns the number of cool numbers for every given [m, M] with 1 <= m ...
I am learning how to write generic code in C++ and I decided to write a hash table. Its key needs to be a primitive type and value can be any type. The hash function needs to be provided by the user. Type of the function is enforced to the user. I am looking for tips on efficiency of the code and whether forwarding of ...
I have been creating a scoring program for a game of hearts. If there is a an even number of players then players will pass across. And an odd number there is no pass across. I created these 2 functions that work fine. But I keep scratching my head trying to simplify them into only 1 function. I know its possible but I...
I'm working on a project where the file name consists of actual dates but the data for the dates are split into multiple files. Developed the following program to count the number of files for each date (part of the filename) and also the total size. Wondering, if the same can be written in a better way. import os impo...
I'm parsing a Pandas DataFrame table for an API post request (using requests, of course). I'm working on building my script in Jupyter Notebooks. result = df.to_json(orient="records") parsed_json = json.loads(result) I've seen a lot of JSON manipulations with format(), so my first impulse was to use f-strings: je_json...
I have written a rudimentary code in Python: That reads the API collection from Swagger/Postman and extracts the payload, link, and method It creates the response with the token(Generated from the token link) It records the response in a CSV. Need help in further formatting the code in terms of creating functions. ...
I'm trying to generate a strong(er) type wrapper for C++. I've seen the NamedType by Jonathan Boccara, but I want a slightly different behavior. Ideally I would be able to use something like using StrongInt = Named<int, "description here">; But due to limitations of C++ a const char* cannot be used directly as a templ...
Right now, I'm working on an interpreter for a subset of the Scheme programming language. It supports lambdas, let/let*/letrec, procedures, combinations, definitions, conditionals, do-iteration, and closures. I'm going for a "everything that can be simplified, should be simplified" paradigm to make interpreting the lan...
Beginner here, my code is here: https://github.com/infinitless/MatrixEncryption Reproducing all of it here: import random import re import math import string # Define Reference Grid values = [ ["a", "b", "c", "d", "e", "f"], ["g", "h", "i", "j", "k", "l"], ["m", "n", "o", "p", "q", "r"], ["s", "t", "u...
I made a calculator for a class I am taking. It works like this: Tells user the input range is between two numbers, and asks if want to change the range. If yes, asks the user input new numbers (if they input anything that isn't a number, we catch it with exception handling). If no, proceeds and ask the user for two n...
Here is a code I have recently written in the compiler for my programming language, written in C++. It rewrites code such as: array_name[random_generator()] += 1; to a code such as: Integer32 temporary_subscriptXXXX; temporary_subscriptXXXX := random_generator(); array_name[temporary_subscriptXXXX] := array_name...
This function str_join() is an updated version of my earlier function str_join() [Found here: https://codereview.stackexchange.com/questions/270759/str-join-function-not-present-in-standard-c-library]. This version has all bugs fixed and has incorporated some review comments. Syntax: char *str_join(unsigned int skip_nu...
I have done Tictactoe game in Ruby. It is my first Object Oriented project in Ruby. I would like to separate all program into a few classes such as Player Board and Game. I want to use more OOP best practices. Also, my move method is looking so big. I would like to refactor my move method because the code is repeating....
I need to fetch some data from a mysql database. For that I created get_data.php on the server and a js function to retrieve that data on the client. Is this the proper way to do it? What would you change? get_data.php <?php require_once('database.php'); header("Access-Control-Allow-Origin: *"); if ($_SERV...
I have created the following mobile only, all textual (no image files and also no non-UTF8-characters), all JavaScript call now button which I have tested and works. let viewportWidth = window.innerWidth || document.documentElement.clientWidth; if (viewportWidth < 480) { document.body.insertAdjacentHTML('beforeend'...
I have reworked the code from my previous (linked) post. For reference: I have a string which contains JSON-like object flattened (stringify()ed). I need to JSON-ify it back. It's a custom format, so I wrote function to JSON-ify the string. Please review it. Also one particular thing that I don't like is previousIsClos...
I'm writing a scraper that downloads images from a given subreddit. I'm new to Rust, and in the majority of my previous projects I was using C++ or Java, where it's easy to do Dependency Injection. I wanted to use DI in this project, so I could inject a mock service for tests, and because I think that's how it's suppos...
"Regular Expression Matching" is a hard problem on LeetCode (problem #10): Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input...
In scientific programming I often come into the position of needing to implement a rather obscure and complicated formula. Clebsch-Gordan coefficients are such a thing. I'm mainly seeking advice on how to implement such complicated formulas in a more comprehensive way but please let that not stop you from giving me any...
So this one was quite rough to implement. I needed to pass an FnOnce to a foreign function through a c_void which requires double boxing. Another fun detail is that the callback is not called until someone actually calls SwitchFiber which isn't required to happen. So simply passing the ownership to the callback was not...
I am trying to remove files in my directory if they are over 30 days. However I don't know what other checks I need to do. The examples I found online wasn't very thorough besides just subtracting the datetime of when the file was created against X amount of days. import datetime import os def remove_old_files(): ...
I have the following code to simulate a firework (of course a very bad and rough one) let width = window.innerWidth; let height = window.innerHeight; let [fire, parts] = [[],[]]; let updateinterval; (function(){ let canvas = document.querySelector('canvas') canvas.width = width canvas.height = ...
I have a Python module that will accept many arguments. Rather than having to have a big long list, I've decided to use classes to represent argument groups and arguments When initialised, the Parser class creates an instance of the argparse.ArgumentParser class and then adds the argument groups and arguments. The argu...
I have 2 DGV's one containing bills info & another containing credit notes info. When at least one item from both the DGV's are selected then it should generate a pdf (result1) taking data from both the DGV's & some standard header, footer & letter format text using some info. And when only billsDGV data is selected ...
I have recently finished a mimi project of mine to create a encryptor, right now it only works for text, I was just wondering how i could make it read more simply and to condense the amount of code as right now it takes 208 lines. Code: import os import os.path import time import ctypes import hashlib as h import tkint...
This class gets a word to be used in a game of Hangman. The player can select a topic from which a random word is selected. The topic is the name of a text file. For example the text file scientists contains words/names such as Charles Darwin and Archimedes. If for any reason a list of candidate words can't be loaded i...
This program loads a video, detects and tracks faces in the video and detects the estimated age and gender of each person. The objective is to collect data on the number of unique people in a video and their attributes. Overall code structure The video is processed frame by frame. The main data structure is people_inf...