Skip to content

Instantly share code, notes, and snippets.

View Zepcon's full-sized avatar

Zepcon Zepcon

  • Germany
View GitHub Profile
@Zepcon
Zepcon / trans.py
Created April 19, 2020 10:52
Translator
import requests
import bs4
from bs4 import BeautifulSoup
import ctypes
""""
Goal:
To have a single window, where I just type in a word I want to translate (english and german),
then hit enter and directly see the most common translations for this word.
User-Process:
@Zepcon
Zepcon / Account.java
Last active October 31, 2019 23:12
Einmal die Version mit der Semaphore (Account), das mit synchronized (AccountSync) und eine Testk(lasse) (test)
import java.util.concurrent.Semaphore;
// Das ist die Version mit der Semaphore
public class Account {
//TODO: Benutzung der Sempahore ist noch unsafe, also in erster Linie getBalance()
private double balance;
private final Semaphore available = new Semaphore(1,true);
public Account(double initialDeposit) {