Skip to content

Instantly share code, notes, and snippets.

View afeser's full-sized avatar

Fatih Eser afeser

  • METU EEE 20 - CENG 21
  • Ankara / Türkiye
View GitHub Profile
@afeser
afeser / full_screen_slide_show.py
Last active November 23, 2023 22:06
Python Full Screen Slide Show
'''
Display full screen slide show using all images from the specified directory.
'''
import pygame
import os
import time
EACH_FRAME_TIME = 10 # each frame 10 seconds
IMAGES_DIR = '/home/backend/images'
@afeser
afeser / Interest.py
Last active September 9, 2023 18:10
Interest calculator
def late_interest_to_yearly_net_interest(total_money, monthly_payment, number_installement, lr=1e-3, max_error=0.01, cc=True):
"""
I am going to buy a product. They offer 3 installements with delay interest of 8 USD.
If I buy without any installements, I will pay 235 USD.
Considering the first installement always the same as singel installement, how much interest do I pay monthly and yearly (compound corrected)?
Algorithm: Simple gradient descent
Args:
total_money: total money to be paid when there is a single installement