Skip to main content

All Questions

1 vote
1 answer
284 views

Rules-engine to be improved/simplified for Efficiency (performance), Extensibility and Maintenance?

This is a simple implementation of a rules engine. I am really hating the very long MATCH/CASE function. I am wondering what kind of Design Patterns could be used there to make this code more ...
user avatar
5 votes
1 answer
1k views

Matchsticks game in Python

I made the following game in Python applying object oriented programming and I would like to know if there is something to improve. PS: My native language is Spanish, if you see something wrong ...
Lucio Mazzini's user avatar
5 votes
1 answer
664 views

Bank account balance program

Would my code be considered fairly optimal and efficient? If not, where can I look to improve the code? The program works just fine. Would this method scale well if the dictionary containing the ...
Samuel Lee's user avatar
1 vote
1 answer
385 views

Python program to find the substring with concatenation of all words

This is a Leetcode problem: You are given a string, S, and a list of words, L that are all of the same lengths. Find all starting indices of substring(s) in S that is a concatenation of each word in ...
Justin's user avatar
  • 2,575
11 votes
4 answers
8k views

A program that prints the longest substring of s in which the letters occur in alphabetical order

Assume s is a string of lower case characters. Write a program that prints the longest substring of s in which the letters occur ...
Durian Jaykin's user avatar
4 votes
0 answers
95 views

Artificial perceptron in python3 [closed]

I have designed a very basic perceptron (single layer neural network) that has been mostly successful in learning basic linearly separable problems. The perceptron in defined as a class with ...
Joe Allen's user avatar
  • 149
3 votes
1 answer
1k views

Tracking orders efficiently using a Python class

I've written a Ledger class for a daemon process, which is supposed to keep track of an exchange's orderbook. My main concern is the way I keep track of the orders -...
deepbrook's user avatar
  • 227
10 votes
1 answer
719 views

Python-based Git pre-commit hook to manage multiple users/Git identities

A couple of months ago I posted a bash script to manage multiple Git identities as a solution on Stack Overflow but soon found the hook isn't flexible enough. Thus I decided to rewrite the hook in ...
Saucier's user avatar
  • 203