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
| const DELAY = 2000 | |
| const videos = [] | |
| const hide = el => el.style.display = 'none' | |
| const show = el => el.style.display = 'block' | |
| const showAndHideOthers = ({ target }) => { | |
| window.requestAnimationFrame(() => { | |
| videos.forEach(hide) | |
| show(target) |
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
| echo off | |
| echo ; set +v # > NUL | |
| echo ; function GOTO { true; } # > NUL | |
| GOTO WIN | |
| # bash part, replace it to suit your needs | |
| exit 0 | |
| :WIN | |
| REM win part, replace it to suit your needs |
Encoding high-quality HEVC content in a two-pass manner with FFmpeg - based NVENC encoder on supported hardware:
If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.
Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:
ffmpeg -i <inputfile> -pass 1 \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload,format=nv12 \
-c:v hevc_nvenc -profile main -preset slow -rc vbr_2pass \
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
| // Shannon entropy | |
| const entropy = str => { | |
| return [...new Set(str)] | |
| .map(chr => { | |
| return str.match(new RegExp(chr, 'g')).length; | |
| }) | |
| .reduce((sum, frequency) => { | |
| let p = frequency / str.length; | |
| return sum + p * Math.log2(1 / p); | |
| }, 0); |
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
| :: USAGE | |
| :: cmdize name [...] | |
| :: | |
| :: This tool converts a supported code into a batch file that can be | |
| :: executed without explicit invoking the executable engine. The script | |
| :: creates new file and places it under the same directory as the original | |
| :: one with the same name, replacing the original extension with ".bat". | |
| :: The content of the new file consists of the original file and the | |
| :: special header that being the "polyglot" and having some tricks to be a | |
| :: valid code in batch file and the wrapped code at the same time. |
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
| find FOLDER -type f \( -iname \*.php -o -iname \*.twig \) |
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
| <# | |
| .SYNOPSIS | |
| Logs out inactive users. | |
| .DESCRIPTION | |
| Logs out inactive users, except for specific users that | |
| have been manually approved and are allowed to stay logged | |
| in for indefinite periods of time. | |
| You can run this script directly on Powershell: |
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
| # number of different words with the same pronunciation (kana) | |
| # entry_number kana averaged_number_of_different_words frequency_of_all_words number_of_different_words list-of-words | |
| 0 ショウネン 1.0000850412450037 11760 2 少年(11759) 正念(1) | |
| 1 ショウジョ 1.0001412030499859 21249 3 少女(21246) 陞叙(2) 昇叙(1) | |
| 2 キョウフ 1.0001717032967032 5825 2 恐怖(5824) 教父(1) | |
| 3 ヒツヨウ 1.000184026499816 16305 2 必要(16302) 必用(3) | |
| 4 シュウレイ 1.000230520977409 4339 2 秀麗(4338) 秋冷(1) | |
| 5 ホンキ 1.000278164116829 3596 2 本気(3595) 本木(1) | |
| 6 ソクド 1.0002824858757062 3541 2 速度(3540) 測度(1) | |
| 7 ツウシン 1.000337723741979 2962 2 通信(2961) 痛心(1) |
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.io.FileDescriptor; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.io.PrintStream; | |
| public class HelloWorld{ | |
| private static HelloWorld instance; | |
| public static void main(String[] args){ | |
| instantiateHelloWorldMainClassAndRun(); |