All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

RSS Reader from Multiple sources

I am writing a RSS reader Library which should be able to read the data from different sources. I am very new to writing libraries and not sure if I am going right with it. These are my base ...
1
vote
1answer
6 views

merge list of strings into one sorted string

So I was tasked the following: Given a list of strings, output a sorted string that consists of all lowercase characters (a-z) from each string in the list. Example [aba, xz] -> ...
0
votes
0answers
5 views

Database Table/Column rules

We are making a new database design where we are setting some rules upfront. I dunno how much it makes sense to have these rules in place, 1- Each table and column name should be meaningful. It ...
1
vote
0answers
23 views

Faster way of Floyd-Warshall [on hold]

I've implemented the modified Floyd-Warshall method to determine all shortest paths between all pair of vertices (i.e., if there are multiple shortest paths between a vertex pair, then all of them are ...
3
votes
0answers
20 views

Effective fetching data algorithm

I'm fetching some data by using bs4, and want to know why access speed gets slower as my program progresses. I'm using thread, and I know threading isn't so fast because of GIL. My problem is that ...
3
votes
1answer
27 views

LeetCode: Time Based Key-Value Store C#

https://leetcode.com/problems/time-based-key-value-store/ Create a timebased key-value store class TimeMap, that supports two operations. ...
0
votes
0answers
3 views

Constructing constrained/validated objects

I'm trying to do some rudimentary DDD in validating my objects to ensure they are of a particular type. I.e. an Email object would always look like "my@example.com" ...
-3
votes
0answers
18 views

Calling function in class in hotel reservation system (python) [on hold]

I dont know how to use and call the def function under class. I am not sure how to use the input data for the class. There are two text files which will be used, about the rooms: room id and price of ...
2
votes
0answers
17 views

Convenient way to make an UIImageView ExpressibleByStringLiteral

I want to reduce boiler-plate code and write like this when developing in iOS: let imgView: UIImageView = "share_fareware_text_bg" Here is implementation code: <...
3
votes
1answer
74 views

Extract numbers from the head of a string in BASH script

In my current BASH script project I am processing a string, which cannot have spaces. At one point I get to where it is possible to have a series of digits. The series can be of any length, including ...
2
votes
1answer
18 views

Dropdown menu that opens on click using plain Javascript

I made a simple dropdown menu which opens when clicked, and closes when the user clicks anywhere outside the menu. The following is the codebase: ...
-2
votes
0answers
18 views

Modifying to Get-MyBios [on hold]

Trying to remove the begin and end statements to modify the script to Get-MyBios on PowerShell ISE and I don't know where to remove from this code: ...
1
vote
0answers
13 views

Promise-based AJAX calls base class

I am more than willing to use both a Promise library and an AJAX calls one if the situation calls for it. This base class sits at the very bare bones of my system and it needs to be done right. My ...
6
votes
3answers
422 views

LeetCode: Top K Frequent Elements C#

https://leetcode.com/explore/interview/card/top-interview-questions-medium/110/sorting-and-searching/799 Given a non-empty array of integers, return the k most frequent elements. Example 1: ...
0
votes
1answer
39 views

What should I change in my currency converter?

everyone! I wrote a simple currency converter in Python. I'll appreciate some tips about how I can improve my little script; what new features would be nice to add to my project? Right now, my ...
10
votes
1answer
73 views

Pure python range implementation

I implemented class Range as an equivalent to Python built-in range for practicing purposes. No features were added. Hope it ...
1
vote
0answers
37 views

Script to download Annual Reports (~70,000 in total) from a Website

It's only 38 lines of code and I haven't worked with web scraping that much before. How heavy would my code be on their server? It's for Deep Learning purposes and I haven't ran it yet but ...
3
votes
0answers
29 views

Tokenizer Class for handling .csv files in c++17

I am a hobbyist computer programmer trying to learn modern C++ (in this case C++17). I thought it might be an interesting challenge to write a tokenizer class for ...
5
votes
1answer
111 views

How to make my “custom integer type” perform better?

During a project at my work I needed a convenient way to store values taking up the smallest amount of bits necessary, not in memory but later when they're serialized into an array of unsigned short ...
1
vote
0answers
27 views

MATLAB / vs Python np.linalg.solve, heat diffusion, Why Python is slow?

I am solving a simple 1D steady heat question using spectral method. I am a long time MATLAB and Mathematica user and trying to learn Python. I compare only linear solving times and Python is way ...
4
votes
0answers
30 views

Finding all simple (without internal cycles) paths in a directed graph with total >1.0 weight

Assume directed graph with each edge being weighted by some positive float. Problem: find all simple paths (in other words, ...
5
votes
0answers
25 views

Draw a spark line with SwiftUI

I am using a set of data points (currently randomly generated), and drawing a line graph inside a box: ...
4
votes
2answers
59 views

Edit file name method - run time complexity

I wrote a function in Java that edit file name, and replace each space char into dash char. Currently I iterate all the files in a specific directory, iterate in each file name, creating a new file ...
3
votes
1answer
28 views

Batch rename files recursively, and number the directory index

When dealing with iOS app bundle, It is not convenient to get the file by its path, but loading it by its name. Need to batch rename images recursively, with Mac Bash. And to make the name unique, ...
1
vote
0answers
46 views

Recursion to dynamic programming [on hold]

I was trying to solve a problem on de-arrangements (Number of partial derangement such that exactly prime number discs are found away from their natural positions? (Any number of non-prime K disks ...
-2
votes
0answers
52 views

Night out with friends. Calculating the costs per person with Kotlin and Android [on hold]

The following app basically sums up the costs for an evening and calculates the costs per person. The user can input the description of the costs [String] (for example, round one = Spare Ribs Place, ...
-3
votes
0answers
18 views

Processing language to draw scatter plot [on hold]

I am trying to plot the following data using the columns, ID, ACT_m and GPA into the scatter plot, but I don't see any data in my plot. Thank you so much for your time. ...
1
vote
0answers
33 views

Modelling a Call Center in Java (multithreading approach)

I wanted to give a shot to Modelling a Call Center from Cracking the Coding Interview. The problem statement is as follows: You have a call center with three levels of employees: Respondent, ...
0
votes
0answers
25 views

Function to determine state of Christmas tree lights? [on hold]

My friend and I are trying to automate some Christmas tree lights that I got on sale last year. I will be able to measure the output of the voltage, and there are 4 functions: steady on, blinky on, ...
2
votes
0answers
18 views

Django Dashboard View

What does my code do? I use Django and in the following snippet, I use a class together with a TemplateView to render an HTML page. I already tried to simplify it with methods, but my code still looks ...
3
votes
1answer
37 views

Python script for parsing links

I wrote a test that parses links from a web page, and in a loop, clicks on each of them, and then returns to the main page. But, each iteration is accompanied by parsing the entire web page again and ...
4
votes
2answers
88 views

An ES6 array of numbers - Double last number, delete the first number

I'm writing a JavaScript function for an array, based on a geographic sequence. \$[1, 2, 4, 8, 16]\$, etc. This function needs to populate the next number in the sequence $$item_n = item_{n-1} * ...
3
votes
0answers
41 views

Convert text file to html?

I have a script that converts a text file to html. The text file is an output of a program (needle). The function takes the text file as an input. I am aware the script is awful. I use this function ...
-5
votes
0answers
17 views

delete a file using by another process in c# [on hold]

I want to delete a jpg file from my C# program but I can't do that because these files are in use by another process. I tried different things but none worked. Does anyone have a solution? This is my ...
2
votes
1answer
25 views

Remove duplicates from an unsorted Linked List in Ruby

Currently I'm going over the cracking the coding interview. I'm in the Linked List 2.1 question which is as follow: Remove Duplicates, write code to remove duplicates from an unsorted Linked List....
1
vote
1answer
56 views

Use math to project price rather than a loop [on hold]

I have to project the price for a publicly traded contract when the price should be approximately matching the targeted profit or loss. I have written the following code, runs under 0.02ms.. could be ...
2
votes
1answer
35 views

Kotlin shared preferences

So I've written a class for storing user/device specific settings, but I've written the Kotlin pretty much like I would in Java: ...
3
votes
1answer
18 views

Using a thread to update a table automatically in Django

For my portfolio app using Django I made a thread that pulls out the usd exchange rates for various currencies every 6 hours and updates the database. The program kicks in as soon as the module ...
0
votes
0answers
25 views

How can I refactor my code for this coding challenge [on hold]

I have finally complete the cash register challenge found on freecodecamp.org and I was wondering how I can further clean my code. I need help refactoring my code. Link to challenge here: https://...
2
votes
1answer
42 views

Query a product from a list of brands

I am quite new to F# and just wrote my first program. It checks if the query exists in the brand list and returns the matching brand. Query is the string you are searching for in the brand list. So ...
1
vote
0answers
18 views

Setting a request header with or without Context in Golang

I have two ways (middleware) of setting a specific header (if not set) to request but want to know if one is better/beneficial than the other and the reasons why. Note: At some point I will need to ...
7
votes
1answer
38 views

Find neighboring PINs on a numeric keypad

I am new to coding and to apply for an internship I need to solve several tasks. This is one of them. I wrote working code, but the program says it takes too long to complete. Help me speed up my code ...
-3
votes
0answers
13 views

Defining notations after equation in Latex [on hold]

How can define notations in the equation containing text, so they are well aligned . for example ...
7
votes
3answers
52 views

Very basic Integer queue in C

I've never written a queue before and literally just took the concepts and tried to code something up. I decided to write a basic integer queue and as an example/driver I use a queue of size 5 which ...
1
vote
1answer
82 views

Check if is it possible to get to a point that is presented by a number

Problem description from an Iranian online course, translated with the help of Google Translate: Tired of coding, Mehdi has gone on to his childhood games. But because he doesn't know who to play ...
2
votes
0answers
18 views

Converting a binary string to hexadecimal using Rust

Once again, I am reinventing the wheel here to understand the fundamentals of rust. In a previous question I requested feedback on my function that performed a hexadecimal to binary conversion. In ...
0
votes
2answers
73 views

Python code to continue if a certain type is seen, otherwise try again to get valid input

I am very very new to programming, and this is my first day using Python. I want to check to see if an input is of type 'int' and to proceed with my program if the user has entered an 'int', ...
6
votes
1answer
29 views

This perl script renames all files in a directory to have an equal amount of digits

I took a lot of pictures with my camera and I wanted to make a time-lapse out of them. The camera saved the pictures as picture1, ...
1
vote
0answers
12 views

List files and folders in current dir with special handling for tty

I want to write a custom ls command to learn rust. This is what I've done as for the version 1.0. This display files and folders in a cyan or white if it's on a ...
2
votes
0answers
15 views

Fulfillment webhook with Dialogflow to operate on a Firestore database

I'm currently calling a fulfillment webhook with dialogflow in my node backend, performing crud operations on a firestore db. Is there a better, cleaner way to ...

15 30 50 per page