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
| public class TimeWatcher { | |
| private long start; | |
| public static TimeWatcher createStarted() { | |
| TimeWatcher timeWatcher = new TimeWatcher(); | |
| timeWatcher.start(); | |
| return timeWatcher; | |
| } | |
| public void start() { |
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
| package org.tcial; | |
| import javax.swing.*; | |
| import javax.swing.event.ChangeEvent; | |
| import javax.swing.event.ChangeListener; | |
| import java.util.LinkedList; | |
| import java.util.List; | |
| public class Heating extends JFrame implements ChangeListener { | |
| public Heating() { |
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
| <?php | |
| /** | |
| * Calculate chances for the birthday problem. | |
| */ | |
| $number_rolls = 100; | |
| // number of birthdays | |
| for ($i = 2; $i <= 100; ++$i) { |
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
| youtube-dl --get-id https://www.youtube.com/playlist?list=<id> | youtube-dl-parallel - |
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
| <?php | |
| $files = glob('*.jpg'); | |
| foreach ($files as $file) { | |
| $brightness = `identify -format "%[EXIF:BrightnessValue]" $file`; | |
| $brightness_value = explode('/', $brightness)[0]; | |
| echo($brightness_value.PHP_EOL); | |
| } |
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
| # 0 - rename all files into sequence | |
| c=0; for i in *.jpg; do mv "$i" "`printf %05d $c`.jpg"; c=$((c+1));done | |
| # 1 | |
| ffmpeg -r 5 -i %05d.jpg output.mp4 | |
| # 2 | |
| ffmpeg -framerate 12 -i %05d.jpg -c:v libx264 -r 12 output2.mp4 | |
| # 3 - works well |
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
| <?php | |
| $filename = $argv[1]; | |
| $dark = explode('/', `identify -format "%[EXIF:BrightnessValue]" $filename`)[0]; | |
| if ($dark < 100) { | |
| echo 'remove ' . $filename . PHP_EOL; | |
| unlink($filename); | |
| } | |
| echo '.'; |
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.function.IntFunction; | |
| public class ConstructorReference { | |
| public static void main(String...args) { | |
| IntFunction<Integer> intMakerSingle = Integer::new; | |
| int intSingle = intMakerSingle.apply(40); // int value | |
| IntFunction<int[]> intMakerArray = int[]::new; | |
| int[] intArray = intMakerArray.apply(100); // array size | |
| } |
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
| class BinaryPrint { | |
| static void print(int number) { | |
| int mask = 1<<31; | |
| while ((number <<= 1) != 0) { | |
| System.out.print(((number & mask) != 0) ? 1 : 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
| cat VIDEO_TS/VTS_01_[1234].VOB | nice ffmpeg -i - ~/dvd_rip.mp4 |
OlderNewer