This file contains hidden or 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 scipy import interpolate | |
| import numpy as np | |
| array = np.array([[0,20,10], [0,10,5]]) | |
| new_shape = (2, 21) | |
| f = interpolate.interp2d(np.linspace(0, new_shape[1], array.shape[1]), np.linspace(0, new_shape[0], array.shape[0]), array) | |
| new_array = f(np.linspace(0, new_shape[1], new_shape[1]), np.linspace(0, new_shape[0], new_shape[0])) | |
| # array([[ 0. , 2. , 4. , 6. , 8. , 10. , 12. , 14. , 16. , 18. , 20. , |
This file contains hidden or 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 pytest | |
| # ----- general ----- | |
| @pytest.fixture(scope="function", | |
| params=['none', 'setup', 'call', 'teardown', 'setup+call', | |
| 'setup+teardown', 'call+teardown', 'setup+call+teardown']) | |
| def resource(request): | |
| param = request.param | |
| print('setup') | |
| if 'setup' in param: |
This file contains hidden or 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 com.fasterxml.jackson.core.JsonProcessingException; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.fasterxml.jackson.databind.module.SimpleModule; | |
| import com.fasterxml.jackson.datatype.joda.JodaModule; | |
| import com.fasterxml.jackson.datatype.joda.cfg.JacksonJodaDateFormat; | |
| import com.fasterxml.jackson.datatype.joda.ser.LocalDateSerializer; | |
| import org.joda.time.format.DateTimeFormat; | |
| import org.joda.time.LocalDate; |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Pretty print stackoverflow questions and answers | |
| // @namespace gist.github.com/StefRe | |
| // @description Add links to stackprinter for SO questions and answers | |
| // @include https://stackoverflow.com/questions/* | |
| // @include https://serverfault.com/questions/* | |
| // @include https://superuser.com/questions/* | |
| // @include https://stackapps.com/questions/* | |
| // @include https://askubuntu.com/questions/* | |
| // @include https://mathoverflow.net/questions/* |
This file contains hidden or 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
| // ==UserScript== | |
| // @name tumbview enable context menu on big image | |
| // @namespace Violentmonkey Scripts | |
| // @match *://tumbview.com/*/plus/* | |
| // @grant GM_addStyle | |
| // ==/UserScript== | |
| GM_addStyle ( ` | |
| #bigprev { | |
| width: 20%; !important; |
This file contains hidden or 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
| // Russisch auf deutscher Tastatur phonetisch | |
| partial alphanumeric_keys | |
| xkb_symbols "rud" { | |
| include "de(basic)" | |
| name[Group1]= "Russian (Germany, alternative phonetic)"; | |
| key.type[group1]="FOUR_LEVEL_ALPHABETIC"; |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Google books images | |
| // @namespace gist.github.com/StefRe | |
| // @version 1.2 | |
| // @description Insert button to auto updating page with links to read pages for download | |
| // @include https://books.google.*/books* | |
| // @grant none | |
| // ==/UserScript== | |
| var imgsrcL, imgWindow, viewport, link; |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Google Books SLUB Search | |
| // @namespace gist.github.com/StefRe | |
| // @description Search the catalog of SLUB for the title | |
| // @include https://books.google.de/books* | |
| // @version 1.1 | |
| // @grant none | |
| // ==/UserScript== | |
| var link = document.createElement('a'); |
This file contains hidden or 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.*; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Locale; | |
| public class DstAndLeapSecondsTest{ | |
| public static void main(String[] args){ | |
| Calendar start, old, curr; | |
| long diff; |
This file contains hidden or 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.*; | |
| public class DstAndLeapSecondsTest{ | |
| public static void main(String[] args){ | |
| Calendar start, old, curr; | |
| long diff; | |
| start = Calendar.getInstance(); |