Problems

Problems

Progamming

C++

1
1
'a'=="a", "a" == "a"
2
1
2
new,free 
malloc delete
3 内存管理

1MB的字符串,90%的时间只用了60%的空间
如何设计

4 ++++

gcc下无法通过, g++可以通过

1
++++i;

Beyond Compare Crack

Crack Beyond Compare on Linux (≥◇≤)

Download Beyond Compare Version 4 for Linux

Install to /usr/lib/beyondcompare/

Replace binary sequence

Replace

1
keexjEP3t4Mue23hrnuPtY4TdcsqNiJL-5174TsUdLmJSIXKfG2NGPwBL6vnRPddT7tH29qpkneX63DO9ECSPE9rzY1zhThHERg8lHM9IBFT+rVuiY823aQJuqzxCKIE1bcDqM4wgW01FH6oCBP1G4ub01xmb4BGSUG6ZrjxWHJyNLyIlGvOhoY2HAYzEtzYGwxFZn2JZ66o4RONkXjX0DF9EzsdUef3UAS+JQ+fCYReLawdjEe6tXCv88GKaaPKWxCeaUL9PejICQgRQOLGOZtZQkLgAelrOtehxz5ANOOqCaJgy2mJLQVLM5SJ9Dli909c5ybvEhVmIC0dc9dWH+

To

1
N9KmiLVlKMU7RJqnE+WXEEPI1SgglmfmLc1yVH7dqBb9ehOoKG9UE+HAE1YvH1XX2XVGeEqYUY-Tsk7YBTz0WpSpoYyPgx6Iki5KLtQ5G-aKP9eysnkuOAkrvHU8bLbGtZteGwJarev03PhfCioJL4OSqsmQGEvDbHFEbNl1qJtdwEriR+VNZts9vNNLk7UGfeNwIiqpxjk4Mn09nmSd8FhM4ifvcaIbNCRoMPGl6KU12iseSe+w+1kFsLhX+OhQM8WXcWV10cGqBzQE9OqOLUcg9n0krrR3KrohstS9smTwEx9olyLYppvC0p5i7dAx2deWvM1ZxKNs0BvcXGukR+

With Shell command

1
sed -i "s/keexjEP3t4Mue23hrnuPtY4TdcsqNiJL-5174TsUdLmJSIXKfG2NGPwBL6vnRPddT7tH29qpkneX63DO9ECSPE9rzY1zhThHERg8lHM9IBFT+rVuiY823aQJuqzxCKIE1bcDqM4wgW01FH6oCBP1G4ub01xmb4BGSUG6ZrjxWHJyNLyIlGvOhoY2HAYzEtzYGwxFZn2JZ66o4RONkXjX0DF9EzsdUef3UAS+JQ+fCYReLawdjEe6tXCv88GKaaPKWxCeaUL9PejICQgRQOLGOZtZQkLgAelrOtehxz5ANOOqCaJgy2mJLQVLM5SJ9Dli909c5ybvEhVmIC0dc9dWH+/N9KmiLVlKMU7RJqnE+WXEEPI1SgglmfmLc1yVH7dqBb9ehOoKG9UE+HAE1YvH1XX2XVGeEqYUY-Tsk7YBTz0WpSpoYyPgx6Iki5KLtQ5G-aKP9eysnkuOAkrvHU8bLbGtZteGwJarev03PhfCioJL4OSqsmQGEvDbHFEbNl1qJtdwEriR+VNZts9vNNLk7UGfeNwIiqpxjk4Mn09nmSd8FhM4ifvcaIbNCRoMPGl6KU12iseSe+w+1kFsLhX+OhQM8WXcWV10cGqBzQE9OqOLUcg9n0krrR3KrohstS9smTwEx9olyLYppvC0p5i7dAx2deWvM1ZxKNs0BvcXGukR+/g"  BCompare

Enter product key

If got message with “Trial Mode Error!”, it has been successful to crack Beyond Compare. And enter the product key below.

1
2
3
--- BEGIN LICENSE KEY ---
GXN1eh9FbDiX1ACdd7XKMV7hL7x0ClBJLUJ-zFfKofjaj2yxE53xauIfkqZ8FoLpcZ0Ux6McTyNmODDSvSIHLYhg1QkTxjCeSCk6ARz0ABJcnUmd3dZYJNWFyJun14rmGByRnVPL49QH+Rs0kjRGKCB-cb8IT4Gf0Ue9WMQ1A6t31MO9jmjoYUeoUmbeAQSofvuK8GN1rLRv7WXfUJ0uyvYlGLqzq1ZoJAJDyo0Kdr4ThF-IXcv2cxVyWVW1SaMq8GFosDEGThnY7C-SgNXW30jqAOgiRjKKRX9RuNeDMFqgP2cuf0NMvyMrMScnM1ZyiAaJJtzbxqN5hZOMClUTE+++
--- END LICENSE KEY -----

HAHA └(^o^)┘

bc

Use f.lux to protect eyes

f.lux: software to make your life better

Official Website

https://justgetflux.com/

Install with ppa

1
2
3
sudo add-apt-repository ppa:kilian/f.lux
sudo apt-get update
sudo apt-get install fluxgui

Replace core

If your f.lux does not work, please download core from official website.
32 bit
64 bit

1
sudo cp -i ${your-xflux-localtion} /usr/bin/

Choose Latitude and Longitude

You can click Find you latitude annd longitude to select your location, and f.lux will automaticly adjust color temperature.

Picture batch to Pdf

Archive pictures to pdf

Get rid of filename blank

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
function rm-ALL-blank() {
ls "$1"| while read file
do
#echo $newfile
if [ -d "$1/$file" ]; then
newfile=`echo $file | sed 's/ //g'`
mv "$1/$file" "$1/$newfile" 2>/dev/null
rm-ALL-blank "$1/$file"
fi
done
}

rm-ALL-blank $1

Pictures to pdf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
function myconvert() {
ls "$1"| while read file
do
if [ -d "$1/$file" ]
then
find "$1/$file" -maxdepth 1 -name "*.jpg"|sort 1>"$1/$file/_myTmp_"
if [ -s "$1/$file/_myTmp_" ]; then
echo "$1/$file".pdf
convert @"$1/$file/_myTmp_" "$1/$file".pdf
else
myconvert "$1/$file"
fi
fi
rm "$1/$file/_myTmp_" 2>/dev/null
done
}

myconvert $1

Move pdf

1
2
3
4
5
mkdir ../pdf
for pdf in `find . -name "*.pdf"`
do
mv $pdf ../pdf/
done

Pic2Pdf

Shell 疑惑

递归访问,如何给路径标号

使用环境变量来解决(但不优雅)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
count=0
function trimDFS() {
ls "$1"| while read file
do
if [ -d "$1/$file" ]
then
let count+=1
echo "[$count] $1/$file"
trimDFS "$1/$file"
#else
#dos2unix $1"/"$file
#echo "$1""/""$file"
fi
done
}

trimDFS $1