instruction
stringlengths
71
95.1k
SQLiteDB VBA Library is a set of VBA helper functions for the SQLite engine. The primary motivation behind this project is to provide convenient access to extended introspection features. Because of its generality, ADODB/ADOX libraries provide only limited metadata information. The Introspection subpackage of this libr...
I'm attempting to integrate with a rather dated API (for work so I can't disclose actual naming, endpoints, etc), and their data models for POST endpoints, very clearly implement an interface that looks similar to: public interface IExternalData { int CallerId { get; set; } string CallerName { get; set; } } Wh...
What I'm trying to do is quite simple: my table has pagination. So if I have 12 items to show and my max items per page is 10, I will have 2 pages, one with 10 records and another with just 2. I created a code that works just fine, but it seems rather dirty. What is the best way to have the same outcome as the code bel...
ContactEditor uses Excel VBA as a prototyping platform for a personal information manager combining the "Model, View, Presenter" (MVP) pattern and a persistent storage manager. Fig. 1. Data manager application The design of the MVP part follows the ideas/tutorials/code from the RubberDuck VBA blog and demos. The datab...
I've created simple sorting visualizer in c++ using SFML. I'd love some feedback on how can I improve the code and OOP design. Whole project: GitHub main.cpp #include "controller.hpp" int main() { Controller app; while (app.isAppRunning()) { app.update(); } } controller.hpp #pragma once #include "model.hpp...
In the previous post, I presented my Storage Library. Here, I would like to focus on the integration of the library with the MVP component. Functional class mapping First of all, the figure shows a new member of the Storage Library, the DataCompositeManager data manager, not discussed in the previous post. Since the ...
I wanted to make a blackjack game to use while bored, but it turned out to be far more complicated than I thought. from random import choice, randint MASTER_DECK = ["A", "A", "A", "A", "2", "2", "2", "2", "3", "3", "3", "3", "4", "4", "4", "4", "5", "5", "5",...
So I have done a little program where the goal is trying to teach some cars (red and blue rectangles) to "drive" through genetic algorithm. It works well and I haven't seen any bugs, but the program is painfully slow. As I am pretty much a begginner, I am sure there are tons of things that could be improved. The cars c...
I am currently creating a Java console program for a text-based Monopoly game as a personal project. Since this is my first project that I have worked on, I would like to know what kind of object oriented programming principles and designs that I am not following. Specifically, I am wondering if I am not creating enoug...
I wrote a Logistic Regression for Fashion MNIST to classify T-shirt vs. Shirt. here is the class import numpy as np import time class LogisticRegression: def __init__(self, learning_rate=.05, n_epoch=10, model_w=[], model_b=.0): self.learning_rate = learning_rate self.n_epoch = n_epoch self...
I am writing library code to help other developers send messages to a pub-sub event broker. In many cases, the message source will not be "stream-like". Specifically, most messages are coming from SQL Server change data capture, and are therefore much more efficiently read in sets (batches). Additionally, in most cases...
I was given the problem (called "car plate problem") to write all the values that go from AAA0001 to ZZZ9999 with the following premises: Create all the possibilities from AAA0001 to ZZZ9999; Skip all the 0000, ie: AAB0000, AAC0000... ZZZ0000. No repetitions. Once a value is "created" or "found", whatever, the value c...
The question was on Leetcode 1584. Min Cost to Connect All Points. My answer to this question is: class Solution { public int minCostConnectPoints(int[][] points) { List<int[]> list = new ArrayList<>(); for(int i = 0; i < points.length; i++){ for(int j = 0; j < points.length; j++){ ...
I want to check client's browser version, and if it's too old, display a message that the user should update their browser in order to use the website. The website is built using ASP.NET MVC. I have implemented 2 different solutions: Solution 1 - Server side checking: I have created an ActionFilter which checks if the ...
I created a watchdog/notifier in C++ and wanted to make it better so it could be used by multiple people. The idea is that there is a timer class and event. client create events and pass a lambda function, timeout in seconds and repeat mode i.e. whether to keep the event active after a timeout or deactivate once the ti...
This is my very first time here, I am coming from stackoverflow.com thanks to @r2evans. So I apologize in advance if I don't follow all the rules. I wrote a code in data.table, doing what I am expected of it. It is not so complicated : mainly sum, group by, or some basic calculations. But my real challenge here is call...
A newbie here. I have done this assignment that my university gave. Requirements Participants may enter the tournament as individuals or as part of a team** It is expected that will be 4 teams each with 5 members and there will be 20 spaces for individual competitors Each team or individual will complete 5 events E...
I am using below code which is comparing three columns values and copy pasting the 4th column data into other column. My code is working fine but it is slow to perform the processing and takes much time and sometimes Not Responding window appears. Any help to fix the problem will be appreciated Sub rowMatch() ...
I am currently using a ThreadedConnectionPool from psycopg2 to lease transactions to a PostgreSQL database and would like a review of my current implementation. Code from __future__ import annotations import logging import threading import traceback from contextlib import contextmanager from dataclasses import datacla...
I am trying to solve a challenge in which I have to write a function that takes in two numbers as arguments and returns an array containing numbers between them which are prime and their reverse is also prime in JavaScript. This doesn't return numbers which are palindrome such as 101. function backwardsPrime(start, sto...
There are 2 persons and their already booked meeting schedule is given and also time bound for both the person is given. Now, we want to schedule a meeting between them in an available time that suits both of them. And at the end we want to return the available time slots for the new meeting. Given input: vector<pair<s...
I created a function that returns the next prime number greater or equal to the number given as an argument. My code works well, but I find it is very slow. The test suite take almost 60s and I want less than 10s. Can the code be optimised to achieve this? Code #include <stdio.h> int ft_is_prime(int nb) { int ...
I have this code to go from an array of bytes (arbitrarily long) to a "bigint" string (really, an arbitrarily long string composed of integers 0-9), and go from that long integer string into an array of bytes. console.log(bigintStringToBytes('12321232123213213292948428924184')) console.log(bytesToBigintString([ 155, ...
I have a Python script that runs as a service, like this: import time import traceback while True: time.sleep(60) try: main() except Exception: # Print the traceback, but keep running traceback.print_exc() This runs every 60 seconds, and works great. What I want to do is have my c...
I wrote a program that syncs the lyric of an MP3 song and displays the text as a subtitle when playing the song, but my code for this is too Unprofessional and weak. Is there a way to display it more professionally? I tried this: Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click ...
The two list have different structure. The list originalPgs is a list of PGRatingConfig and has this structure: class PGRatingConfig { .... Rating rating; } class Rating { String pgId; String value; } pgLookupTable returns List which is of the form: id and name of the product private List<PGRatingConfig> add...
This is my code: from database_function import * from kiteconnect import KiteTicker import pandas as pd from datetime import datetime, timedelta import schedule import time from multiprocessing import Process def tick_A(): #credentials code here tokens = [x[0] for x in db_fetchquery("SELECT zerodha FROM sc...
Here is my attempt to output webscraping results to a bibtex file. I would like to use this format as input to the Zotero database. As BetterBibtex already has a function to generate customized citation keys, I don't want to reinvent the wheel over here. Therefore, citation keys are generated using the uuid hex string ...
I'm really new to code optimization and JS. I would like to ask for help on optimizing my code. Thank you in advance. Here is my code: if(entity_param_connections_products == "PL") {       if(pl_flex_l1_label === ""){         document.getElementById("credit_app-flex_l1").style.display = 'none';       } else {          ...
While working on my demo database manager app, I have coded a previously presented Storage Library. The structure of the library's code and employed design patterns partially follow that of the Secure ADODB project, which was a great help. For instance, I liked its approach to parametrized class instantiation involving...
UPDATEIT on SPOJ: UPDATEIT - Update the array ! #bitmasks You have an array containing n elements initially all 0. You need to do a number of update operations on it. In each update you specify l, r and val which are the starting index, ending index and value to be added. After each update, you add the 'val' to all el...
I am formatting my TV series archive and can not do one by one. I wrote this code and it's working like what I want. I am a beginner and want to improve my knowledge of algorithm. What can you recommend me? Have a nice day to everyone. Variables inputStr is contains file name. whichOne is contains which character will...
I have written a python script that generates random rows with a provided array. To better explain input : [1,2,3,4,5] output : [1,2,3,4,5] [5,3,4,2,1] [1,2,4,5,3] [1,2,5,3,4] [5,4,3,2,1] [4,3,2,1,5] I am sharing the function which generates the unique random placement of item in array for now def myscore(self): #...
I recently wrote code to parse lambda expressions written in a lisp like format, using a small hand-rolled parsing library. The goal This code was written as a part of this code-golf challenge not as code-golf, but as a demo for the concept. My goals for this were It should be simple enough that by looking over it on...
I want to see if I can find a way to have the system work the same way when it runs, but condense it, as if I don't I will be constantly writing a lot of code that I believe I could just write in a more simple and condensed way. Is there a way to simplify and condense this code? import random aList = ["1", "2", "3"] bL...
I finally got this lexer working, full implementation here. How can the lex function be simplified? The goal is to take a tree of indentation-based text, and convert it into parentheses-based opening/closing text, for easier parsing down the road. But the logic is pretty messy and I'm not sure how to make it elegant. ...
I am looking for feedback on the function below to load a png image stored as bytes from a MongoDB into numpy arrays. from PIL import Image import numpy as np def bytes_to_matricies(image_bytes): """image bytes into Pillow image object image_bytes: image bytes accessed from Mongodb """ raw_image = Im...
I am searching for a more efficient way to calculate the so called vec-trick used in Tensor algebra, see Wikipedia. Introduction: Suppose you have a matrix vector multiplication, where a matrix C with size (np x mq) is constructed by a Kronecker product of matrices A with size (n x m) and B with size (p x q). The vect...
Hi there I was hoping to get a better grasp of greddy algorithms while trying to solve this problem: Hackerrank: Gridland Metro and I was trying to apply an algorithm where each grid could be considered a point, and each track as an interval which cover these points. Would appreciate any feedback in regards to my appro...
This program reads raw pixels from the pipe/stdin in a loop and set the root window background. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <X11/Xatom.h> #include <X11/Xlib.h> #include <X11/Xutil.h> int main(int argc, char **argv) { Display *dpy; Window root; XImage *ximg; Pixma...
I though of defining the following module that I could use to govern the dark mode on/off on a website. Probably I would use it only for that in the whole page, but in the case I don't (i.e. I end up wanting to use it in other places), I'd like to be sure it's reusable enough. I tried to make it geometrically consisten...
I made a simple password generator (once again). import random import string import pyperclip class Password: def __init__(self, length, contains_lowercase, contains_uppercase, contains_digits, contains_symbols): self.length = length self.contains_lowercase = contains_lowercase self.contain...
I wanted to share actions through different places in the component tree like: // in one component, listen an action useListener("DELETE", (payload) => { console.log("DELETE EVENT 1", payload); }); // in another component, dispatch action const dispatch = useDispatch(); dispatch("DELETE", payload); This is my imp...
I have been working on a very simple code where I am I open a given file file which has a format of: proxies.txt hello:12345 hello:12345:apple:orange test:4125 test:53953:hello:world myserver:1337:usertest:passwordtest what I want to do with these lines is that I want to return a format of e.g. {'https': 'http://hello...
If the log file is not available, then output the log message to the console. Any improvement or suggestion for this implementation for the logger by the template? Any potiencial problem that I should be aware of? #ifndef _LOGGER_HEADER__ #define _LOGGER_HEADER__ #include <iostream> #include <string> #include <sstream>...
Here's my C++ solution for PE 43: #include <algorithm> #include <iostream> #include <string> int main() { const int PRIMES[] {2, 3, 5, 7, 11, 13, 17}; std::string digits = "0123456789"; unsigned long long sum = 0; do { bool has_property = true; for (int i = 1; i <= 7; i++) { ...
I want to scrape 25000 addresses using Column A cell values as search strings. I'm using the following code, it is working fine but it's too slow to extract 25000 results. Is there any way to speed up the process, like opening multiple addresses at once or something else? I'm pretty new to VBA coding. Any help would be...
I'm new in Ada and made the following Tic Tac Toe implementation. It works as intended. tictactoe.gpr project TicTacToe is for Source_Dirs use ("src/**"); for Object_Dir use "obj"; for Exec_Dir use "."; for Main use ("main.adb"); for Create_Missing_Dirs use "True"; package Compiler is ...
I am asked to implement the following part of code into kernel code. Actually, I have tried but not sure about the std::array. This is the original code for the function. int KNN_classifier(array<array<int, 20>, 4344>& array_X_train, array<int, 4344>& array_Y_train, int k, array<int, 20>& data_point) { // Cal...
This is an implementation of a "string to int" hash table with Robin Hood hashing. I have tested it as thoroughly as I could. It appears to have no bugs/leaks. I would appreciate any comments on correctness/performance/clarity. I have kept it ANSI C for simplicity. /* robin_map.h */ #ifndef ROBIN_MAP_H #define ROBIN_MA...
Problem statement: Write a function which checks if two triangles intersect or not. Complete containment or tangential contact is not considered intersection. Approach: I have considered each triangle as collection of three line segments. And then checked if any of the line segment from first triangle intersects segmen...
Problem statement: Assume a high resolution (> 3000 x 3000) image is given as input. The image pixels can be classified into one of the three categories namely text, background and drawing. There is library function which takes a pixel and returns its category. Write a function which takes high resolution image as inpu...
I made tic-tac-toe (a common practice). board_and_player.py class Board: def __init__(self): self.cells = {"top_l": ' ', "top_m": ' ', "top_r": ' ', "mid_l": ' ', "mid_m": ' ', "mid_r": ' ', "down_l": ' ', "down_m": ' ', "down_r": ' '} def generate(self): ...
I'm looking for critiques or different ways I could approach writing a deck builder script. I wrote script to shuffle a deck of cards, then draw cards from the top of deck, drawn cards are then removed from deck and placed into discard. const cardGame = { values: [ 'Ace', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'Joker', 'Queen', '...
Desired output: Animate the wave forms, but use less resources. Any bugs: There are no bugs that I know of. I tied searching google for "use less setIntervals in my project" and found this code function interval(func, wait, times){ var interv = function(w, t){ return function(){ if(typeof t === ...
I have previously got a review of something similar (but not the same but its related to proxies) which can be found via: proxy-manager-to-return-proxy-format What I am now trying to do is that I want to lock the proxies when they are in use. When they are in use we block them and whenever they are finished with they s...
this is similar to another project I did here: JavaScript Deck Builder: Shuffle, Draw Cards Except this script does not shuffle or draw cards from the top of the deck. Instead the script builds a deck, then will randomly choose a card from the deck. The card that is chosen is then removed from the deck and placed into ...
I am trying to implement a priority-based timer where certain events are fired out based on their expiry and the priority. So if there are 3 timers with the following expiry time and priorities Timers Expiry Time (s) Priorities T1 5 1 T2 5 10 T3 10 1 The order of timers triggering should be T2, T1, T3. ...
The following script derives schemas from varied file formats. Can I get this reviewed? What would the improvements look like: def _null_allowed_in_cols(self): for field in self.fields: field["type"] = self._field_type_converter(field["type"]) if type(field["type"]) == list: ...
This is an implementation of zoxide in C, it uses a shell alias to cd between directories it stores(as csv in form of <count,path>) or when the directory is invalid it searches for closest matching directories #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #if defined(__linux__) #includ...
I have below code which is going to copy records from one container in cosmos db to another container in cosmos db. I am just worried on not following the best practices and below code might time out when querying the whole database to get only result with "ClassID". I would appreciate any suggestion as what should I i...
description: I'm using thrift to save and get data by filter. The data have many types, and the types may increase in the future. So I use switch-case to handle it in save, but it leads to a lot of duplicated code. Then when I wrote getByFilter code (basically the reverse of input-output in save), I tried to use refle...
I am a student who wrote a theme switcher, but I don't know if everything is ok. I want professionals to review my code and point out mistakes. I accept all recommendations and criticism. gitHub: https://github.com/Alexander-Korniichuk/React_Theme_Switcher/commit/f70f3cceb81c484d4dab0bd7799cd234ee39d4fe src/components/...
I am working on a Data-based application. I wrote a code to filter the table. The table has String and Numbers. I some filter for string, like min word count, max word count, string includes and excludes For Numbers, I also have filters like min, max. This is my code, var props = { rows: [ { keywordIdeaMetr...
I wrote this method which I think is not effective as it doesn't respond to the missing method when I use the PORO Class. BalanceService class BalanceService INITIAL_MULTIPLIER = 1 HUMUS_EFFECT = 1.3 instance_methods.each do |m| undef_method m unless m.to_s =~ /^__|method_missing|respond_to?/ end def in...
I have this implementation of Grep where I use re.search: #!/bin/python """ A grep implementation on Python """ from re import search from sys import argv def grep(word, file): for line in file: if search(word, line): print(line.strip()) if __name__ == "__main__": try: grep(arg...
I have this blog lurking around in the web. It's just static HTML, but I was interested to keep track of all the views on that blog. Finally, I end up with the following web application: (The Java backend resides entirely here.) com.github.coderodde.weblog.viewcounter.CountViewServlet.java package com.github.coderodde....
PROBLEM: I need to merge the columns by identifying the headernames and they work as desired by using the below code. The code is very inefficient as I am using an eval to accomplish the job and I believe it makes unnecessay multiple passes which is not recommended. Is there a way I can optimize my code to merge the co...
I recently started programming and chose C# as my first language. After a couple of weeks/month now I tried to make my own Sudoku solver in a console application. I'm happy with the result, and tried to clean up my code. But I'm not sure what I can do better at this point. I was uncertain if I created too many function...
I have this code that generates a random line and a random circle. import numpy as np import matplotlib.pyplot as plt def random_2D_position(c_bx, c_by, r, region_side): while True: v_pt = region_side * np.random.random((2, )) if np.linalg.norm(v_pt - np.array([c_bx, c_by])) > r: return ...
I have been looking at the Fisher Yates randomizing suggestions on StackOverflow after ruling out arr.sort(v => Math.random() - 0.5) due to lack of randomness in the latter. The Fisher Yates functions look OK, but used while loops etc. Alternately, the javascript array functions (map, reduce, etc) have the obvious prob...
The code below creates an animated, four-cornered gradient with vertex and fragment shaders in WebGl. When I run it in the browser, the fans on my MacBookPro (2.2 GHz Quad-Core Intel Core i7 with Intel Iris Pro 1536 MB) sound like the laptop is preparing for takeoff. I've included screenshots from the Activity Monitor ...
The Problem I'm updating a system to use OOP where a major process of the system is to translate data between many providers. The translations happen in a many to many fashion. So provider A, B and C all have their own definitions of what a Corgi object is. For example; public struct CorgiA { public int FluffLevel { ge...
I am attempting to create a table for placing images in LaTeX. The first column is the (image) index, the second and third columns are images from different folder. For example, in the row with index = 1, the two images from the path Images/1/1.png and Images/2/1.png are placed in the second and third column locations....
I found abandoned project on GitHub and curious is it possible to implement part of it on just Python? Here is most close example of processing I would like to implement: from durable.lang import * with ruleset('test'): @when_all(m.subject.matches('3[47][0-9]{13}')) def amex(c): print ('Amex detected {...
(See the initial and previous version.) This time, I have incorporated all the good points made by mtj. See what I have: com.github.coderodde.weblog.viewcounter.CountViewServlet.java: package com.github.coderodde.weblog.viewcounter; import static com.github.coderodde.weblog.viewcounter.Util.objects; import com.google....
is there a better way to optimize this piece of code?? I am checking if each item in the collection has property classID , then do my logic. Any better way where I do an enumerate only for documents having the property if( source != null && source.Count > 0 ) { foreach( var item in source ) ...
I made a simple password-generating app with a GUI written in Python and the tkinter library. Here's how the GUI looks like: The passwords are strings composed of random characters. The user can choose the length of the password, and the characters that are allowed to be in it. Here's the source code: import string im...
example: exports.products = (req, res) => { // var1 const ITEM_LIMIT = 4; // var2 const page = +req.query.p || 1; // unimportant part productModel.getProdCount().then(([count]) => { const totalItems = count[0]['COUNT(id)']; productModel.fetchAllProd((page - 1) * ITEM_LIMIT, ITEM_LIMIT).then(([rows...
I am learning Java, so I am beginner. I know I can do this with split function but I want to improve my algorithm knowledge. I will be glad if you help me. Thanks. inputStr variable is contains the string entered by the user. stopPos variable is contains the order of wanted the word. parseWith variable is contains whi...
I have a short bit of TypeScript code that looks like the following: world.rooms = world.rooms.map((room) => { room = { ...defaultRoom, ...room }; room.contents = room.contents!.map((thing) => ({ ...defaultThing, ...thing, })); return room; }); Basically, I have a world object, which h...
I decided using a C++ map or unordered_map is the most appropriate option to store 'Regions' where which can be loaded in arbitrary patterns The rest of the project is written in C, so I made a C interface: #include <unordered_map> #include "Region.hpp" static std::unordered_map<uint64_t, void *> Regions; extern "C" { ...
I am trying to print out the squares of n numbers, n which is a value retrieved from the user. I want to know if there is a better way to do this: #include <stdio.h> int main(void){ int i, n; printf("This program prints a table of squares.\n"); printf("Enter a number of entries in table: "); scanf("%d"...
def collatz(n, counter): if n == 1: return counter elif n % 2 == 0: return collatz(n/2, counter + 1) else: return collatz(3*n + 1, counter + 1) print(int(collatz(15, 0))) Is there any way to improve this code? The two arguments passed on the collatz() function rubs me the wrong way...
Wrote this for getting the content of image from the given URL. It accepts a URL and returns an array of shape number_of_channels image_height image_width. Each "row" represents a pixel, and each element is within the range of 0 to 1. What are some issues with my implementation? Is there a better way to turn the data ...
With this data I am returning one object per keyword prioritising preferedDomain string on domain and then its higher rank value, it is already ordered by rank so returning one object per keyword will take care of that. This does work and I have done some performance checks and found out that doing a for loop will take...
In order to add basic translation capabilities in an old c++98 program I've come up to a basic and shameless code summarized by this snippet: #include <string> #include <iostream> // Translation ids enum { TR_RELOAD =0, TR_SAVE, TR_MSGWARNRESET, TR_MSGAPPLYCHANGES }; // (Returning an array refe...
I'm using this function to read a certain set of data in a hidden Sheet1 to do encryption based on the selection by the user. It's all working fine, but its kinda slow, I need to apply this to 160.000 rows. ATM it goes through every letter of every word of every selected range. (Function below is used to encrypt letter...
Here's a proposal implementation of websocket using boost::asio::beast that is thread-safe to parallel writes. In this example below, the async_write can be triggered in response to server notification (I) or from periodic keepalive calls implemented on a dedicated thread (II). I'd like to here your comments regarding ...
void largest_row(void) { int largest_row, temp = 0, sum = 0; for (int i = 0; i < row_count; i++) { for (int j = 0; j < row_count; j++) { sum += array[i][j]; //Array referenced here is globally defined if (sum > temp) { largest_row = i; ...
I'm working on keyboard testing web application. As a mechanical keyboard enthusiast, I need to test that all the keys on my keyboard work whenever I build one, or change the firmware for one. Eventually, I'd also like to implement some typing tests that are similar to MonkeyType. This isn't a particularly new problem ...
I'm writing this as an exercise. I would probably use a vector as a buffer internally (the extra capacity pointer overhead is not important enough). Primarily it's an exercise in writing copy/move constructors and assignment operators. What are some of the pitfalls of defining these operators explicitly? What could go ...
I need to manipulate data found in multiple data files (~100,000 files). One single data file has ~60,000 rows and looks something like this: ITEM: TIMESTEP 300 ITEM: NUMBER OF ATOMS 64000 ITEM: BOX BOUNDS xy xz yz pp pp pp 7.1651861306114756e+02 7.6548138693885244e+02 0.0000000000000000e+00 7.1701550555416179e+02 7.6...
I tried speeding up my Graph class, so I removed the Node class and Edge class, and decided to use arrays and ArrayLists. My 2 implementations seem very similar, but for some reason have a 10x performance speed difference that I cannot figure out. For both of these, the constructor takes N = # nodes, M = # edges, and 2...
Disclaimer I've created this post not only for the code review, but rather because I think it would be helpful for the users of the CAEN V2718 module. Problem description I have a VME board (V2718) which may be used as a square form generator. To set the frequency and duty cycle user must specify three parameters : Th...
Like the title suggests, I wrote a script in Python that uses the python3-lxc library to automate the creation of Linux LXC containers. I realised that containers can be great when I'm writing (and even installing other) apps and setting up FreeBSD-ish* jail environments to organise my workspaces for whatever project t...
I want to reduce time complexity of my code that solves the following problem. The program receives a positive distance d followed by a sequence of n events: An event can be either that a person appeared at some position, or that a person disappeared from some position. After each event, your program should output "re...
I'm starting to create data models and one of the models I need should represent a mailing/billing address. While I reside in the United States, I recognize that there are different terms utilized in different parts of the world. As such, I wanted to define the properties of my model to be more generic in the sense tha...
A little program I wrote because I had nothing better to do: a README reader. Run readme to print the first lines of the README file (or README.md or README.org...) either in the current directory or on a directory up in the directory hierarchy. Run readme -e to edit that file. Manual: README(1) Gener...
It's a dice game between 2 people using tricky dice. For example,three dice [[1, 1, 4, 6, 7, 8], [2, 2, 2, 6, 7, 7], [3, 3, 3, 5, 5, 8]]. The code will decide, in order to win, who chooses the dice first and which die to play. Say if you choose a die first, return the index of the die. Say if you decide to be the secon...