This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.jupiter.api.Test; | |
import java.util.Random; | |
import static org.junit.jupiter.api.Assertions.assertEquals; | |
class MaciRandom1 { | |
private int mezSzeretete; | |
private final Random r = new Random(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple example of building your own context manager. | |
Resources: | |
- http://preshing.com/20110920/the-python-with-statement-by-example/ | |
- https://docs.python.org/3/library/contextlib.html | |
- PEP 343 -- the "with" statement: https://www.python.org/dev/peps/pep-0343/ | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import threading | |
import pyperclip | |
def is_url(url): | |
if (url.startswith("https://") or url.startswith("http://") or url.startswith("www.")) and not url.startswith("https://www.google"): | |
return True | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.function.BiFunction; | |
class ClassCannotBeModified { | |
public int a; | |
public int b; | |
public ClassCannotBeModified(int a, int b) { | |
this.a = a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import shutil | |
def remove_python_cache(directory, verbose=False): | |
for root, dir_names, file_names in os.walk(directory, topdown=False): | |
for dir_name in dir_names: | |
if dir_name == '__pycache__': |