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
if True: | |
ver = !python -V | |
print(ver[0]) | |
if ver[0] != 'Python 3.8.9': | |
!wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz | |
!tar xvfz Python-3.8.9.tgz | |
%cd Python-3.8.9 | |
!./configure | |
!make | |
!sudo make install |
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
//https://stackoverflow.com/questions/18490123/destructor-never-gets-called | |
public class Class : IDisposable | |
{ | |
private Task task; | |
private CancellationTokenSource cts = new CancellationTokenSource(); | |
AutoResetEvent arEvtProcRun = new AutoResetEvent(false); | |
Class() | |
{ | |
task = new Task(Run, cts.Token, TaskCreationOptions.LongRunning); |
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 https://csharpindepth.com/articles/singleton | |
public sealed class Singleton | |
{ | |
private static readonly Singleton instance = new Singleton(); | |
// Explicit static constructor to tell C# compiler | |
// not to mark type as beforefieldinit | |
static Singleton() | |
{ | |
} |
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
using System; | |
using System.IO; | |
using System.Windows; | |
using Microsoft.Win32; | |
namespace WpfTutorialSamples.Dialogs | |
{ | |
public partial class OpenFileDialogSample : Window | |
{ | |
public OpenFileDialogSample() |
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
rem Take a screenshot with subtitles of every mkv file in the directory, | |
rem at 10 seconds after the video starts | |
@echo off | |
SET count=1 | |
FOR /f "tokens=*" %%G IN ('dir /b') DO (call :subroutine "%%G") | |
GOTO :eof | |
:subroutine | |
set tmp=%1 |