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
| rnd_permu :: [a] -> IO [a] | |
| rnd_permu xs = do | |
| arr <- A.newListArray (1,l) xs | |
| forM [1..l] $ \i -> do | |
| j <- randomRIO (1, i) | |
| vi <- (A.readArray arr i) | |
| vj <- (A.readArray arr j) | |
| A.writeArray arr j vi | |
| A.writeArray arr i vj | |
| pure vj |
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 Language.C | |
| import Language.C.System.GCC | |
| import Language.C.Data.Ident | |
| import Language.C.Syntax.AST | |
| import Control.Monad | |
| import Data.Char | |
| import Data.Void |
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
| use async_std::sync::{Arc, Mutex}; | |
| use serde::{Deserialize, Serialize}; | |
| use tide::{response, Context, EndpointResult}; | |
| #[derive(Serialize, Deserialize, Clone)] | |
| struct Message { | |
| author: Option<String>, | |
| contents: String, | |
| } |
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
| set nocp nobk "nocompatible and nobackup | |
| set bs=2 ts=2 sw=2 et ai si | |
| set ic is "ignore case and incsearch | |
| set nu cuc cul ls=2 ru | |
| syntax on | |
| filetype plugin indent on | |
| colo desert "to see all color schemes type :colo <C-d> |
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
| static const auto io_sync_off = []() | |
| { | |
| std::ios::sync_with_stdio(false); | |
| std::cin.tie(nullptr); | |
| std::cout.tie(nullptr); | |
| return nullptr; | |
| }(); |
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
| #!/bin/bash | |
| # Script for installing tmux on systems where you don't have root access. | |
| # tmux will be installed in $HOME/local/bin. | |
| # It's assumed that wget and a C/C++ compiler are installed. | |
| # exit on error | |
| set -e | |
| TMUX_VERSION=1.8 |
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
| int N = 10000; | |
| double start = System.currentTimeMillis(); | |
| bt = new AvlEmptyBinaryTree(); | |
| for (int i = 0; i < N; i++) bt = bt.insert(i); | |
| System.out.println((System.currentTimeMillis() - start)/1000.0); | |
| start = System.currentTimeMillis(); | |
| TreeSet<Integer> ts = new TreeSet<>(); | |
| for(int i=0;i<N;i++) ts.add(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
| lab workshop | |
| Week9: lab4 activity9 | |
| Week10: lab5 activity10 (quiz5) | |
| Week11: activity7 activity11 | |
| Week12: lab6 activity12 (quiz6) |
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
| #!/bin/bash | |
| for i in $1/*.webm; | |
| do name=`echo $i | cut -d'.' -f1`; | |
| echo $name; | |
| ffmpeg -i $i $name.mp4; | |
| done |
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
| 12330001 Alipu`Wupuer | |
| 12330009 caolei | |
| 12330019 陈家炜 | |
| 12330024 ? | |
| 12330033 chenweifang | |
| 12330035 chenwei | |
| 12330040 陈雄涛 | |
| 12330041 陈秀 | |
| 12330043 陈雅雪 | |
| 12330044 chenyaying |