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
#!/bin/env bash | |
# My Video Converter | |
# Convert unplayable mp4 to playable mp4 | |
# File with spaces. Ref: https://unix.stackexchange.com/a/9499 | |
find . -maxdepth 1 -type f \( -iname "*.mp4" ! -iname "*.new.mp4" \) -print0 | while IFS= read -r -d '' file; do | |
ext="${file##*.}" | |
filename="${file%.*}" | |
new_file="${filename}.new.${ext}" |
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
/* | |
Copyright (c) 2017 Chris Patuzzo | |
https://twitter.com/chrispatuzzo | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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 typing import Union | |
def cal(L: Union[str, int], i: int, N: int) -> float: | |
global cnt | |
cnt += 1 | |
assert L == "A" or L == "B" or L == "C" or isinstance(L, int) | |
# T: A6;B4;C2 | |
T = 6 - 2 * (ord(L) - ord("A")) if isinstance(L, str) else L | |
d = sum([2 ** (-j) for j in range(1, N + 1)]) |
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
/******************************************************************************** | |
Report:hw1 | |
Author: F74046284 黃柏瑄 | |
Class: 乙班 | |
Description:指令列後直接接上二個參數,可將參數一檔案裡的內容複製至參數二的檔案裡。 | |
*********************************************************************************/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ |