-
安裝 Msys2:https://www.msys2.org/
-
安裝後啟動
msys2.exe
執行以下命令安裝 GNU toolchain。(如官方說明所示)pacman -S --needed base-devel mingw-w64-x86_64-toolchain
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 itertools import product | |
def Max(NL, NJ): | |
"""Find max number of joint on each link. | |
+ NL <= NJ and NJ <= (2 * NL - 3) | |
+ (2 * NL - 3) <= NJ and NJ <= (NL * (NL - 1) / 2) | |
+ other exceptions (return -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
--- /usr/share/texmf/tex/latex/tools/longtable.sty 2001-09-27 06:50:51.000000000 -0400 | |
+++ longtable.sty 2003-03-09 15:34:04.000000000 -0500 | |
@@ -160,7 +160,7 @@ | |
\ifdim \dimen@>\z@\vfil\break\fi | |
\global\@colroom\@colht | |
\ifvoid\LT@foot\else | |
- \advance\vsize-\ht\LT@foot | |
+ \global\advance\vsize-\ht\LT@foot | |
\global\advance\@colroom-\ht\LT@foot | |
\dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@ |
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
#!/usr/bin/env bash | |
# Directs audio input (e.g. mic) to audio output (e.g. speakers), | |
# then sleeps forever. Stops audio redirection when it is killed. | |
# So, for example, plug your phone into the PC's mic, run 'listen', | |
# and listen to phone audio through your computer's speakers. | |
set -e | |
module=$(pactl load-module module-loopback latency_msec=50) |
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
BasedOnStyle: Google | |
Language: Cpp | |
ColumnLimit: 80 | |
IndentWidth: 4 | |
PointerAlignment: Right | |
UseTab: Never | |
SpaceBeforeParens: ControlStatements | |
SpacesInParentheses: false | |
SpaceBeforeRangeBasedForLoopColon: true | |
SpaceAfterTemplateKeyword: false |
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
@echo off | |
REM Usage: | |
REM addsrt "video_name" | |
REM (video_name.mp4 + video_name.srt) => video_name_new.mp4 | |
ffmpeg -y -i "%1.mp4" -vf subtitles="%2.srt" -c:s mov_text "%1_new.mp4" |
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
# -*- coding: utf-8 -*- | |
"""Newton method to solve three equations. | |
x^2 + y^2 = 800 | |
y^2 + z^2 = 1300 | |
x^2 + z^2 = 1300 | |
[x = 20, y = 20, z = 30] | |
""" | |
from typing import Sequence, Callable |
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
#include <cstdio> | |
#include <fstream> | |
#include <iostream> | |
#include <tuple> | |
#include <vector> | |
using namespace std; | |
using array1d = vector<double>; | |
using array2d = vector<array1d>; | |
using array3d = vector<array2d>; |
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
#include <iostream> | |
#include <set> | |
#include <map> | |
template<typename T> | |
struct SwappablePair { | |
T field1, field2; | |
inline auto operator==(const SwappablePair &rhs) const -> bool { | |
return (field1 == rhs.field1 && field2 == rhs.field2) || |
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/bash | |
# Wait for the GUI to be ready | |
while [[ ! $(pgrep plasmashell) ]]; do sleep 1; done | |
xsetwacom set "HID 256c:006d Pad pad" button 1 key 2 | |
xsetwacom set "HID 256c:006d Pad pad" button 2 key Ctrl S | |
xsetwacom set "HID 256c:006d Pad pad" button 3 key - | |
xsetwacom set "HID 256c:006d Pad pad" button 8 key + | |
xsetwacom set "HID 256c:006d Pad pad" button 9 key Ctrl Shift Z |
OlderNewer