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 python3 | |
# -*- coding: UTF-8 -*- | |
""" | |
This git hooks makes sure a tag is created each time the version is increased. | |
This version only works with version from `setup.py` and `settings.gradle`, but can be adapted. | |
To enable it on git 2.9+, use:: | |
chmod u+x dev/hooks/* | |
git config core.hooksPath dev/hooks | |
On older versions, copy or symlink the hooks to `.git/hooks` |
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
""" | |
Loads a movie, analyzes the frames in a number of worker threads, and uses the average frame colors to create a rainbow image. | |
""" | |
import cv2 | |
import threading | |
import queue | |
from os.path import basename | |
from multiprocessing import cpu_count | |
from PIL import Image |
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
Index: tests/test_tz.py | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- tests/test_tz.py (revision 55132d48ee28d59420d153088fad9a0db5648ae3) | |
+++ tests/test_tz.py (revision ) | |
@@ -7,6 +7,7 @@ | |
""" | |
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
use std::fmt::{Display, Formatter, Result}; | |
use std::ops::{Add, Sub, Mul, Div}; | |
pub trait PNr : Copy + Clone + Sized + Mul + Add + Sub + Div + Display {} | |
impl PNr for f32 {} | |
impl PNr for f64 {} | |
impl PNr for i32 {} | |
impl PNr for i64 {} |
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
from random import shuffle, seed | |
seed(12345) | |
x = list(range(10)) | |
shuffle(x) | |
print(x) | |
def bubble_sort(z): |
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
// What is the output / error? | |
// From http://www.angelikalanger.com/GenericsFAQ/FAQSections/ParameterizedTypes.html | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
public class Main { | |
public static void main(String[] args) { |
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
/* | |
For the question, see | |
https://gist.github.com/mverleg/1088fbb5f21590da6691a6e84547bada | |
OUTPUT: | |
super constructor | |
super b | |
x = 1, y = 3 | |
sub b | |
x = null, y = 3 |
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
/* | |
The question is simply: what is the output? | |
Extra: what is `instance.z` after line 8? | |
*/ | |
public class TestQuestion1 { | |
public static void main(String[] args) { | |
SuperCls instance = new SubCls(); | |
} | |
} |
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
""" | |
Get stacktrace from the clipboard, and open the relevant file/line in the | |
current PyCharm project (useful when using terminal instead of PyCharm run). | |
Arguments: | |
1. The path to the PyCharm launcher script (e.g. "~/pycharm/bin/pycharm.sh") | |
2. [Optional] A json dictionary of path substitutions (e.g '{"/remote/userA": "/home/userA"}') | |
https://www.jetbrains.com/help/pycharm/2016.3/opening-files-from-command-line.html |
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
""" | |
Reads a Clementine playlist, and copies all the song files to a directory. | |
arg 1: path to the playlist | |
arg 2: optionally, the output directory | |
You can ignore the BeautifulSoup parser warning (or fi you insist, follow it's directions) | |
""" | |
from bs4 import BeautifulSoup, Tag # pip install beautifulsoup4 | |
from shutil import copy2 |