instruction stringlengths 71 95.1k |
|---|
This is my version of the Snake Game. The project is not done yet, I still want to try to implement some other game mechanics like two player mode, high score leaderboard, etc. Also I would like to implement GUI if it won't be to hard.
At this point the game is already playable, that means that the basic game mechanics... |
I saw this entertaining talk by: Bob Martin on clean code and started refactoring a relatively simple class today. I am, by no means, an expert on coding and still learning a lot every day, so I want to get this right eventually as well :).
The purpose of the code is to retrieve an xml document from a website, which co... |
Below I have enum representing State of a UITableView.
The states are divided into 3 categories as below.
For all the 3 states I have different UITableViewCells which will be shown for respected cases.
So for fetchMovies input, I am actually checking the movies count and emitting the state & once again after the result... |
I finished a sorting algorithm visualizer (for now only uses bubble sort) and this is the code.
I'd like some suggestions to improve the memory usage or time elapsed.
Built with Cmake and Ninja on Windows
Demonstration
main.cpp
#include "Engine.h"
#undef main
int main()
{
try
{
// if the amount is hig... |
I am working with a dataframe of over 21M rows.
df.head()
+---+-----------+-------+--------------+-----------+----------------+------------+
| | id | speed | acceleration | jerk | bearing_change | travelmode |
+---+-----------+-------+--------------+-----------+----------------+------------+
| 0 | 5338150... |
I've implemented an A* with a priority queue. I am not getting any performance issues in this little game that I am making but it would be interesting to know how to improve this.
I am doing a few o(n) searches in getNode & isSuccessorValid. I thought about using an unordered map and pointing to each node location but ... |
I'm trying to build a React Boilerplate Using multiple tools. They are all: React, TypeScript, ESLint, Webpack, Babel, Prettier, VSCode and with Airbnb's code style guide.
Actually, this is my first Boilerplate. I don't know if there's a redundant dependency or unnecessary codes inside. Can you please review it? The de... |
Below is an implementation heavily based on climberig's implementation on Leetcode for LeetCode 706. Design HashMap. Just to preface, I am doing this in preparation for an exam.
The one below is dynamically sized, so it should increase the size of ListNode[] whenever the condition (keyCount > length * 0.90) has been me... |
I have created a working VBA script that allows the user to select a workbook and make a values only copy of it without opening it. This is useful for getting data from a workbook that is very slow to open. From here: https://stackoverflow.com/questions/63398348/how-can-i-copy-the-values-only-from-an-entire-excel-workb... |
I've ported the Analog Clock program written in AEC from Linux to WebAssembly. You can see the live version.
/*
* This is my attempt to port the Analog Clock in AEC, previously available
* for Linux and DOS, to WebAssembly.
*/
//Let's import some functions useful for debugging from JavaScript...
Function logString(... |
I have a constantly growing corpus of currently ~36,000 documents (growing daily) and I want calculate the similarity between each pair of documents. After calculating the similarity scores, I want to filter the results to only include scores above 0.9, and capture the (row label, column label, metric) in a list of tu... |
My angular knowledge is limited, so I don't know much yet about it's garbage collection etc to make sure my component can be used without any strange side effects or memory leaks.
I've created a stackblitz with a working version of the component here: https://stackblitz.com/edit/angular-material-messagebox?file=src/app... |
Could you please give me some direction about how I could refactor my code? As I add functionalities to my Budget App the class is getting bigger and I'm sure I could start looking at separating concerns and maybe using some sort of abstraction.
I've been studying OOP for a few months now but I'm not sure how to apply ... |
Please review my program and give some tips . I am a beginner. IT is for those people who sit on computer all day and get unhealthy . This will remind them to do eye exercise , physical exercise and to drink water
import pygame
import time
t = time.ctime(time.time())
# noinspection SpellCheckingInspection
totalbreaks2... |
So I've been learning about MVVM and I had a problem. I often had to start a thread to download or do some longer task in background and when it is done change some properties so the UI updates. The problem is that the UI will update only if I changed it from the main thread. So I often had to create DispatchTimers to ... |
The Django ModelAdmin offers a filter_horizontal (or filter_vertical) interface for many-to-many relations, which allows the user to filter a list of available related objects.
My goal is to limit the set of choices for this interface, dynamically, based on the value of another form field.
This is somewhat similar to f... |
Intro
If you want to know, then about 10+ years ago, I started a journey on the (best in my country) color picker for WinXP, later Win7. Since now it is hardly compatible with Win10 and HiDPI (work in progress), and in no way compilable in Linux using Lazarus, it would take quite an effort to create a decent desktop co... |
I am starting up a project with some people, because there will be developed for and on multiple platforms we chose to use CMake to build our project. Because the project will get quite large we are trying to have a good setup but we lack the experience needed in CMake to make well thought out decisions.
We are using ... |
Below is a json schema I have in elastic search
{
"fullName": "",
"avatar": "",
"email": "",
"resumeLink": "",
"phone": "",
"role": "",
"noticePeriod": "",
"dateOfBirth": "",
"gender": "",
"maritalStatus": "",
"address": "",
"location": "",
"industryType": "",
"pe... |
I wrote my first benchmark using Google Benchmark to check what is faster between the use of std::string::length and strlen to compute the length of a std::string.
I would like to know what I can improve in my code to use it as a base for future benchmarks. My main concerns are about:
the creation of the std::string a... |
this was my first thing i made on my own without any help. im sure theres a lot of improvement that could be made, i dont feel too confident about this. how can i make it shorter and more efficient? should this entire thing be rewritten in some other way? refactored? keep in mind if i wanted to add more birds to the li... |
Any advice on how to make this code; cleaner, more effective, just overall better!
Program setup object that is coming from the database EF. It then maps the object to a view model and converts datetime to string and different datetime components.
//EF Data
List<MeetingEvent> Meeting = new List<MeetingEvent... |
Here's a simple one for u guys,
The code is called upon workbook_open and BeforeSave, it displays the right sheet in function of date and time (Day vs night shift vs date). The code run trough the sheet and activate it if the date on sheet is the same as the actual date. Since there's 2 sheets with the same date (day a... |
I'm experimenting in Unity with a tile-based game with crisp 32x32 tile textures and pixel perfect camera. I did not like the results coming from Unity's default Tilemap approach mainly because due to the crispiness of the textures, the edges between them (biome boundaries, if you will) were too sharp for my taste. I w... |
I don't really have a problem. But, it's my first time using Kotlin for any project, so I want to know if there is any problem in my code or my code can be made cleaner.
This is an arithmetic parser made in Kotlin. It can evaluate a expression like "(6+4)/(2+3)" to 2.0
This handles operations like
Power(^)
Divison(/)
... |
I know there is a way to simplify these checkbox onClick functions. I'm just not sure how to make it happen.
Upon checking the checkAllProfiles checkbox, all of the profileCheckboxes are checked:
$('#checkAllProfiles').on('click', function()
{
$(".profileCheckbox").prop('checked', $(this).prop('checked'));
});
Then... |
I'm new to Go and have a use-case for periodically executing an async work-function. I want the interval between work-function executions to be constant (not the time between one finishing and the next starting). I also want this work-function to be executed some number of times. This translates to "run work N times... |
To practice the very basics of node back-end, I'm implementing the most basic server possible for static content, using only the core node modules:
http
fs
path
With the following server requirements:
Can serve any http file inside the public directory.
Accepts only GET requests, 404 for anything else.
Accepts only ... |
I need some feedback, please. Goals to practice: templates, std, interfaces, return value, constructors and some idioms.
People often suggest to use a library, but it's not the goal of this exercise, so please don't suggest those.
My worries about this code
correctness of returns by value\reference
correctness of iter... |
Problem
I'm trying to create the most performant code to:
Extract a text file from a zip
parse its content
serialize class
post to Azure Queue Storage
Scenario
4 times per year I receive 20 zip files. All zip files have just one text file inside.
Each text file is a fixed width file.
Each line in the text file is a d... |
The exercise is as follows:
Player A will write list \$ a \$ consisting of \$ n \$ numbers. Player B will take a look at the paper. After that the A player will ask player B \$q\$ questions. Each question will be of the following form:
If I give you two \$ R \$ and \$ L \$ in \$ a \$ such that (\$ 1<=L<=R<=n\$ ), calc... |
Source
I made a project for a class, a MIDI editor written with Java 8 and Swing, and continued working on it on my own. However, I ran into a problem I couldn't solve and gave up.
I'd like feedback on high level design/architecture, things like cohesion, coupling etc between classes. I'm pretty sure the project is wea... |
We are given an array of intervals we need to merge all overlapping intervals and sort the resulting non-overlapping intervals. When they "touch" in a single point, intervals are also considered to be overlapping .
class Span
{
public uint Start { get; }
public uint End { get; }
private Span(uint start, ui... |
I'm working on a text-based tic-tac-toe game, mostly for fun and because I'm learning programming. I would appreciate any comments you could give me to improve it.
Main structure:
Uses a Board class for all the game. It's initialized with an empty tic-tac-toe board implemented using numpy arrays. It has views to handle... |
This is a practice task from Automate the Boring Stuff with Python. I imagine many others have asked for their version of the solution to be checked, so I apologise beforehand for boring you yet again.
In brief, the task entails writing a code that carries out an experiment of checking if there is a streak of 6 'heads... |
I have written a code that triggers my div with another menu. I do not know which one is better and should be used. Can I get some feedback?
First code in one function:
function sidebar() {
var menu = document.querySelector('#sidebar-container');
var menuSmall = document.querySelector('#sidebar-container2');
... |
I'm writing a method that writes the code for a loading routine.
Given an object from the database, I want to put its properties in the right control on a userform.
I have the list of the properties and I have the names of the controls.
For each property, I want my code to search in the controls' name and find the most... |
I've got a working solution to the Rustlings from_into exercise (i.e. the code compiles and all the tests pass). The task required that I implemented the From trait for struct Person. I've highlighted the relevant section inline with comments below.
// The From trait is used for value-to-value conversions.
// If From i... |
Generally, the approach I've taken is to try calling container.decode from a decodable enum with its associated value returning the actual class.
Each time the call to container.decode throws a different class is tried, from the class with the bigger number of member vars to the one with the smaller number of member va... |
I am currently going through this Vulkan tutorial.
An extra excercise was writing a function which checks if the hardware you are running on supports the extensions other libraries require (GLFW in this case).
All the code is here:
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <iostream>
#include <stdex... |
I am writing wrapper classes in Java which override methods of an existing implementation, in order to handle an edge case. The full implementation is a bit more complex than needs to be posted here, so I've written a simplified class containing only the parts I'm requesting assistance on.
Problem Summary
I am extendi... |
BACKGROUND
I have a function where i cache file from aws s3. I provide it the path on s3 and also the local path of where i want the cached file to live. Sometimes if the file does not exist on s3 it will return a 404 error. That makes sense but i want to handle it gracefully. What i want to do is if the file i am tryi... |
Original post: Sorting algorithm visualizer in C++ and SDL2
I followed the advice you gave me and improved my code. I also added two more sorting algorithms.
I'm mainly looking for code readability advice (Built on Windows with cmake and ninja)
Demonstration
props to @Zeta for the demonstration
main.cpp
#include "Eng... |
In c there is the macro assert and while it works I don't picturality like it mainly because it has no good way for printing a string. As a result I attempted to create a better version of assert for c++. However, I over engineered it leaving me with something that slows compile times, and something that I would not us... |
I am trying to transfer my c ++ experience to the Go area. I'm new to Go, so not sure if the implementation is correct. In any case, it looks very ugly compared to C ++ code. Is there a nicer solution? Both solutions are executable in playground and give same result.
c++ playground: https://code.sololearn.com/c67xbW2AE... |
Kotlin 1.3.+
RxJava 3.0.+
Kotest 4.1.+
// SingleValueCache.kt
package com.example
import io.reactivex.rxjava3.core.Single
import java.util.concurrent.Semaphore
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
abstract class SingleValueCache<V> {
protected abstr... |
This is a project that finds a specific anime (show) and checks to see if there is a new episode of it .
this is also the first time that i used def like this and wanted to ask how this project looks and how i could improve it ?
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from... |
Instead of the obvious decision, parsing using given std::io::Lines/std::io::Bytes or crates like nom, I decided to explore writing my own specialized scanner that operates on std::io::BufRead.
I have two (self inflicted) problems.
Firstly, scanner must operate on bytes, utf8 validation given by rust String would reall... |
I wrote a discord bot that listens for links to the d20pfsrd rulebook in discord chat, checks if they are feats or magic, and then scrapes the page, formats it, and spits it back into chat as formatted text. The pages I'm checking are formulaic enough, so even though the cheerio selectors I'm using are probably fairly ... |
A few days back I found an interesting problem which reads the following:
Given two vector spaces generate the resulting set of its cartesian product.
\begin{gather}
\text{Let: } \mathcal{V}, \mathcal{W} \text{ be vector spaces}\\
\mathcal{V} \times \mathcal{W} = \{ (v,w) \mid v \in \mathcal{V} \land w \in \mathcal{W} ... |
I made a tic tac toe bot with the following rules (it's not unbeatable):
If bot is about to win, it will find the winning move.
If bot is about to lose, it will find a move that prevents the other player from winning.
if none of rule 1 or 2 is found, then it will play a random move
I think it's highly inefficient, so... |
I am trying to write a Person class in Ruby which has some methods and properties. The below is how I have implemented it now.
class Person
attr_accessor :name, :gender, :mother, :spouse
def initialize(name, gender, mother = nil)
@name = name
@gender = gender
@mother = mother
@spouse = nil
end
... |
I have a chunk of code here:
public class ParserFactory
{
public static ParserClass getParserClass(InputStream is, CustomMap customMap,
DataHandler recordHandler, DataHandler columnHandler) throws JsonProcessingException
{
ParserClassType ParserClassType = Pars... |
So I answered this question on SO and probably did someone's homework along the way.
In the original question the OP has the answer variable and wants it split to real and imaginary values with the original coefficient (q in the original post) as an array for each q from 1 to 10, so you get an array of arrays looking l... |
This is regarding leetcode Question# 123. I have solved the question (code below) but the solution is showing "Your runtime beats 5.89 % of cpp submissions."? Is there any additional optimization I can do to make it run faster?
class Solution {
int maxProfitUtility(vector<int>& prices, int i, int buyOrSell, int k, ... |
I am a beginner in Python and I have written a program to convert binary numbers to decimal. It works, but are there any ways to improve the code and make it better?
def binary_to_decimal_converter(binary_value):
print(f"Binary: {binary_value}")
decimal_value = 0
# Treating binary input as a string
# po... |
I've created an email sender with providers for the email content, that will be changed based on the email type. I need some help to enhance it.
These two models are used to send
public class EmailAddress
{
public string Name { get; set; }
public string Address { get; set; }
}
public class EmailMessage
{
p... |
My objective is to find out on what other subreddit users from r/(subreddit) are posting on; you can see my code below. It works pretty well, but I am curious to know if I could improve it by:
First, restricting my code so that it only considers users only once (i.e. not collect the posting history twice for the same u... |
How can StringEnumeration be changed in the code below into a generic class, so that ConsensusState wouldn't need the JsonConverter attribute to enable instances of the class to be used as if they were serializable enums with associated string values?
I'm using StringEnumeration to allow checking instances of Consensus... |
I am trying to solve the following Codewars kata.
We are given a list as
seq = [0, 1, 2, 2]
We will have to write a function that will, firstly, add elements in the list using the following logic.
if n = 3 and as seq[n]=2, the new list will be seq = [0, 1, 2, 2, 3, 3]
if n = 4 and as seq[n]=3, the new list will be seq ... |
This is in a node and express API. I'm trying to figure out the best way to handle Promises that resolve, but return a 404 response. I have a method which uses node-fetch to make a POST call to update a row in a database. If an invalid profileId is provided, the Promise will resolve even though the response is a 404. I... |
I'm learning really basic java at school but I learn on my own at home.
I've had some experience with simple swing games, but this one exceeds all.
I want any opinion and advice someone may contribute.
public class Display {
private JFrame frame;
private Canvas canvas;
private String title;
private in... |
I've written some F# code to handle commands in the context of event sourcing which works along the lines below:
Read Events from a specific event store stream
Build the current state in the given business / domain context accordingly to the events that has just been read right above
Decide new events based on the cur... |
Problem statement :
Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of W.
If there is no such window in S that covers all characters in T, return the empty string "". If there are multiple such minimum-length windows, return the one with the left-most starting index.
Ex... |
I made a scraper for Steam that get different info about a Steam game, such as the price, the specs and the supported platforms. The reason I made this was because I have a super slow laptop, so looking at many games would take a long time :)
Some things I would like to improve is have better error handling, as the web... |
While I have never had to swap two files I have always wondered if there was command for swapping two files and recently I decided to see if there was one. Eventually I found out that there wasn't one and as a result I decided to create one.
Here is the code: main.cc
#include <iostream>
#include <filesystem>
#include <... |
I have a working logon for a WinForms Project. I use the program.cs file to launch the login form. I am not so sure there isn't a better way of implementing this.
Here is my program.cs file:
using System;
using System.Windows.Forms;
using WindowsFormsApp.Presenters;
using WindowsFormsApp.Views;
usin... |
I'm new to using python and wanted to know how I could improve my program. I'm using the Luhn algorithm, the beginning numbers of the credit cards, and the number of digits in the credit card.
from cs50 import get_string
import re
import sys
number = get_string("NUMBER: ")
check = []
if (len(number)) not in (13,15,16... |
I'm an experienced python 3 programmer but I've recently started focusing more on JS to make client side applications for my website. So I'm not too familiar with advanced level techniques, best practices, etc in JavaScript. I'll post all the code here (HTML/CSS/JS) so you can run it, although the primary thing I'd lik... |
I have been reading today about the Abstract Factory Pattern, and tried to make the following implementation.
I have seen a lot of implementations in the internet, where they use switch statements, but I must say that I didn't like that much, since the more factories you make, it seems to me that it makes very difficul... |
I wrote a library that implements LZW compression and decompression. A goal of this project was to help me acquaint myself with modern C++ development practices (I primarily come from a Java background and have a smattering of C experience).
I want to use this library to compress data and stream it over TCP sockets to ... |
I'm implementing the logic of a board game in Java to practice my coding skills. I chose Food Chain Magnate because is a fairly complex game that requires different data structures. One of my first tasks is to generate the data structure for the game board. In the game, the board is built using some (of all, depending ... |
This project was highly inspired by the popular drawille project, that lets one draw to the terminal using the braille unicode characters.
The advantage of drawing with braille characters compared to normal ASCII characters is simple: Because every "braille-character" is made up of 2 x 4 = 8 possible spots, we have 256... |
Here is my revised code from my other review question Node JS delete multiple MySQL linked records and delete physical file
Just would like to hear some reviews if I have the right logic.
router.delete('/:id', (req, res)=>{
function deleteCommentRecords(){
db.beginTransaction(function(err) {
if(err) retur... |
I am new to async methods and am kinda confused how async is working so what i want for you to do is review this code and tell me does implementing async like this is meaningless
[Route("/Dev/ForceBufferUpdate")]
public async Task<IActionResult> BufferUpdate()
{
bool isAdministrator = await Task.Run(() => {
... |
I am creating a social network that let's users upload a profile picture. I just want to know if this is a secure way of doing it. Thanks.
<?php
include 'includes/header.php';
include 'includes/form_handlers/settings_handler.php';
//$userPic = '';
$date_time = date('Y-m-d_H-i-s');
if(!empty($userLoggedIn)) {
i... |
I adding some pathfinding to a game I'm working on. It primarily used A* with as suggested in the pathfinding articles at reb blob games.
It works, but isn't very fast.
It is a square grid map that (at the moment) has uniform movement cost, but in the future I will to add weights that make paths avoid enemy units etc.
... |
It's my first time here, so please accept my apologies in advance if something is wrong with my approach to asking.
I've been learning Python for a couple of months and I decided to have a go at a small project that I felt able to complete on my own: a version of the card game UNO, using PyGame for the graphical interf... |
Since I had to almost start all of the code again with first refactor and an eye opening advice on a random Overflow question, here it is again:
This is a code that selects the right sheet according to the day of the week(date) and time(Now).
The code finds the day of the week (in French), determines if we are in night... |
I was hoping to get some input on a class module I'm designing to abstract away the boilerplate of utilizing asynchronous queries in VBA. cQueryable supports both synchronous and asynchronous queries. So you could do something like call a package to populate temp tables. This would be done synchronously because you'd w... |
I have a working code as below. Is there any better way to return nil after the each loop and unless else in the below example?
def find_member(member_name)
unless members.empty?
members.each do |member|
if member.name == member_name
return member
end
end
nil
else
nil
end
end
... |
I tried to do a tic tac toe game, so, to base myself in something, I searched through multiple tic tac toe codes and took some ideas from them to implement on my code. Here's the result and I would like anyone to make an analisys of it and tell me your opinion about it!
It's almost completely funcional, the only thing ... |
I have coded more in Python but I am learning Ruby now. So I am trying to write a solution to create a family_tree and add and get relationships. The code below is of the file that contains the main function which is called from the command line. The below code works and solves the problem but I have written methods wi... |
A similar question was asked here, and I'm trying to do the same thing. But
I'm trying a different approach by deriving from std::array, and
This is a very focused question about constructors only.
Here is my gl_wrap.h:
// header guards snipped
#include <array>
#include <algorithm>
#include <cstring>
#include <GL/gl... |
I have a form on a page to add a Post (parent), before submitting the form, a user should be able to add 1 or more Sections (children) to the Post.
The form:
<form asp-action="AddSection">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
... |
I am having a bit of difficulty in designing my Go code.
I'll try to demonstrate things with a very simple example of adding a new user to the database.
My Handler is only doing one thing: Calling a service.
The service is managing all the business logic and then calling the DAO to interact with the database.
The DAO a... |
I'm working on WPF photo broswer app as a personal project. I realise my current strategy for thumbnail handling is poor as I read in the full image each time -- this shows when browsing a folder with more than a few images. If anybody can suggest changes that might improve this aspect of the code, or anything else, th... |
I'm new in Golang and haven't done concurrency in a bit. I would love to hear your opinion on my Dining problem Go solution. Description here, with a tl;dr below:
Five silent philosophers sit at a round table with bowls of spaghetti. Forks are placed between each pair of adjacent philosophers.
Each philosopher must ... |
I've been teaching myself Python over the last few weeks, I have an interest in cryptography, codes, etc. so I figured starting a Morse code translator would be a good project. I know my variable names could be different, it's not really encrypting, decrypting, etc. I'm mostly looking for advice on how I can make the ... |
I would like some feedback on my code, I'm new to coding with C# but I do have some knowledge on Lua and Python. Is there anything that I need to change/clean up to make it more simplified?
using System;
using System.Linq;
class MainClass {
public static void Main () {
int[] cards = {1, 2, 3, 4, 5, 6, 7, 8, 9, 1... |
I have two table. I want count how many times a value is in other table. So the codice from table "sorgente" is different in table contatore, because I have the suffix 'BRANO-' before the code.
sorgente
| codice | nome |
| 15 | mario |
| 16 | mary |
contatore
| nome_evento | data |
| BRANO-15 | 2020... |
Description
A WinForms application has a function to export objects of the following type, in various formats:
class Item
{
public int id { get; set; }
public string description { get; set; }
}
At the click of a button in a window, a SaveFileDialog is shown, and currently it provides the option to save the dat... |
Basically, I have 20 very similar objects and most importantly I want to do the same thing for all of them.
This is the ImportProcessor class for AutomobileExpense (AutomobileExpenseDataImportProcessor). And in this scenario I would need another 19 ImportProcessor classes for the other similar objects.
I have made comm... |
This is some code written in a course I'm busy taking on Udemy. It serves as a basic toggle switch to flip between light and dark mode. This includes the nav bar, background, images and the icon that changes from a sun to a moon.
The objective after the lesson was to clean up the code and make it DRY. I've done so to s... |
I recently started learning C, though I have some experience in other languages. I recently wrote a TicTacToe AI using the Minimax Algorithm in C. I would like to know how I could write better C.
#include <stdio.h>
#define X -1
#define O -2
#define MAX_SIZE 50 //This is the Max size of the Input Buffer
int turn = O; ... |
recently I wanted to create a morse encoder/decoder with playback ability, the program needs java version >= 11 to run.
the program requires a couple of jars :
com.google.common.collect.BiMap
javazoom.jl.player.Player
I used the BiMap for the following reason:
A bimap (or "bidirectional map") is a map that preserv... |
Given a text I have to find the preceding words to all numbers up to a stop word belonging to a check_words list (kind of stopwords).
My code:
check_words = ['the', 'a', 'with','to']
mystring = 'the code to find the beautiful words 78 that i have to nicely check 45 with the snippet'
list_of_words = mystring.split()
In... |
Problem
I'm writing a simple shell, and I want to have the nice autocomplete feature that bash has when you partially type a word then press tab:
Right now it can work independently from a shell, but it has features that allow it to find commands on the system. Examples:
>>> table = make_lookup_table_from(["hell", "wa... |
Ask user to input 10 integers and then print the largest odd number that was entered. If no odd number was entered, print a message to that effect.
I've been trying to solve this problem with python and I think I've figured out a way that covers all the cases that are possible given the mathematical definition of an od... |
Currently Rubberduck VBA files all the VBProject VBComponents in that do not have a Folder Annotation in a Folder named after the VBProject. It can be time consuming to manually organize the components for the first time and a inconvenient to add annotations to every Worksheet, Userform, Class, ...ect. When ran my co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.