樹心幽徑

20191030安裝並使用LINE 視窗版
2019/10/30,17:13

(1)自https://line.me/zh-hant/download下載LineInst.exe,約81MB

20191030用CDBurnerXP製作給定軟體光碟的ISO光碟映像檔
2019/10/30,08:28

(1)下載並安裝 CDBurnerXP 4.5.8.7042

https://cdburnerxp.se/zh-cht/download

下載最新版本 (4.5.8.7042)

(2)選複製光碟/確定

alt

 

(3)選「硬碟」/來源:請置入要拷的光碟/目標:選硬碟並給定檔名如「d:\20191030PhotoImpactX3.iso」

alt

(4)點選拷貝光碟:進行中,會將來源光碟的所有檔案打包成一個iso檔。

alt

(5)20191030PhotoImpactX3.iso光碟映像檔製作完成,約647MB,花了6分28秒。

alt

(6)用壓縮檔程式解開ISO檔。

REF1:簡易利用壓縮檔開啟ISO 映像檔

(7)將ISO光碟映像檔掛載為虛擬光碟機

20191029用rufus-3.8製作win10 USB安裝碟並安裝WINDOWS 10
2019/10/29,07:07

一、下載rufus-3.8.exe:

https://github.com/pbatard/rufus/releases/download/v3.8/rufus-3.8.exe

二、在win7執行下載的程式(rufus-3.8.exe)

三、選取來源為win10-ISO檔(Windows10_X64_1803.iso,約4GB),將iso檔展開到目標隨身碟I:中。

資料分割配置預設為GPT、目標系統預設為UEFI(無CSM):

四、執行畫面過程如下:

alt

五、重開機按DEL鍵進入BIOS設定BOOT-OPTION 1 為「新製的usb安裝碟」並按F10寫入設定並重開機進入安裝畫面:(最好先拔掉既有硬碟的電源線)

(5-1)接受預設「安裝語言:中文(繁体)」、「時間及貨幣格式:中文(繁体台灣)」、「微軟新注音輸入法」。

(5-2)按「立即安裝」鈕  

(5-3)接受「授權條款」

(5-4)選自訂「授權條款」

(5-5)刪除磁碟0的所有分配成一整個未配置空間

(5-6)選取磁碟0的未配置空間

(5-7)檔案拷貝中…完成後,會重啟動多次。

(5-8)區域選「台灣」

(5-9)鍵盤配置用「微軟注音」

(5-10)略過第二鍵盤配置

(5-11)略過網路設定

(5-12)選不網路更新

(5-13)帳密皆給bear

(5-14)三個安全問題竉物、出生城市、綽號也皆給bear

(5-15)同意活動歷程記錄

(5-16)同意裝置隱私設定

(5-17)允許你的網路被查詢

(5-18)設定網路IP: 10.1.1.215 , MASK:255.255.255.0, Gateway :10.1.1.254 , DNS:163.25.20.1

(5-19)啟動EDGE下載firefox 並安裝成功。

REF1:  用CDBurnerXP 4.5.2製作ISO光碟映像檔

REF2 : 下載 Windows 10 光碟映像 (ISO 檔案)

REF3: RUFUS輕鬆製作可開機的 USB 磁碟機 

REF4:https://github.com/EasyIME/PIME/releases/tag/v1.1.0

20191026在Ubuntu LINUX 安裝python 3. 8.0
2019/10/26,12:51

REF 1:https://www.itread01.com/content/1545070623.html

(1)$ sudo apt-get install build-essential checkinstall

(2)$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

(3)$ wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz

(4)$ tar xzf Python-3.8.0.tgz

(5)$ cd Python-3.8.0/

         $ ./configure --enable-optimizations

(6)$ sudo make altinstall

(7)$ python3.8
Python 3.8.0 (default, Oct 26 2019, 13:01:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

(8)$ python3.8 -V
Python 3.8.0

(9)$ python -V  (系統內建的舊版python)
Python 2.7.12

 

 

20191024用python來設計檔案內容讀取分析程式並分別在windows及linux下編修與執行
2019/10/24,20:41

REF 1: https://www.programiz.com/python-programming/file-operation

REF 2: 下載並使用windows 的hexdump 

(一)在windows下:

(1) code 7a.py

print("write a.txt as big5 encoding\n")
f= open("a.txt",'w',encoding = 'big5')
f.write("貓cat\r\n")
f.write("狗dog\r\n")
f.close()

print("Read a.txt by text mode\n");
f = open("a.txt",'r')
print(f.read())
f.close()

print("Read a.txt by binary mode\n");
f = open("a.txt",'r+b')
print(f.read())
f.close()

 

(2) D:\>python 7a.py
write a.txt as big5 encoding

Read a.txt by text mode

貓cat

狗dog


Read a.txt by binary mode

b'\xbf\xdfcat\r\r\n\xaa\xafdog\r\r\n'

(3) D:\>type a.txt
貓cat
狗dog

(4)以16進位數顯示檔案內容

D:\>hexdump -C a.txt
000000  bf df 63 61 74 0d 0d 0a aa af 64 6f 67 0d 0d 0a  ..cat.....dog...

 

(二)在Linux下:

(1) code : 7b.py

print("write a.txt as utf-8 encoding\n")
f= open("a.txt",'w',encoding = 'utf-8')
f.write("貓cat\r\n")
f.write("狗dog\r\n")
f.close()

print("Read a.txt by text mode\n");
f = open("a.txt",'r')
print(f.read())
f.close()

print("Read a.txt by binary mode\n");
f = open("a.txt",'r+b')
print(f.read())
f.close()

(2)執行結果 

$ /usr/bin/python3.5 7b.py
write a.txt as utf-8 encoding

Read a.txt by text mode

貓cat
狗dog

Read a.txt by binary mode

b'\xe8\xb2\x93cat\r\n\xe7\x8b\x97dog\r\n'

(3) $ cat a.txt
 

貓cat
狗dog

(4)以16進位數顯示檔案內容

$ treehrt ~/python$ hexdump -C a.txt

00000000  e8 b2 93 63 61 74 0d 0a  e7 8b 97 64 6f 67 0d 0a  |...cat.....dog..|
00000010

 

(5) 文字模式與二元模式的讀檔迴路程式碼 : 7b2.py

print("write a.txt as utf8 encoding\n")
f= open("a.txt",'w',encoding = 'utf-8')
f.write("貓cat\r\n狗dog\r\n")
f.close()

print("Read a.txt by text mode");
f = open("a.txt",'r')
while True:
    c=f.read(1)
    if c == "" :
        break

    print(c , end='')

f.close()

print("\nRead a.txt by binary mode");
f = open("a.txt",'rb')
for x in f:
   print(x)
f.close()

 

(6) 7b2.py的執行結果:

$ python3.7 7b2.py
write a.txt as utf8 encoding

Read a.txt by text mode
貓cat
狗dog

Read a.txt by binary mode
b'\xe8\xb2\x93cat\r\n'
b'\xe7\x8b\x97dog\r\n'

 


20191023安裝Dev-C++來設計檔案內容讀取分析程式
2019/10/23,09:41

REF 1、Dev-C++ 5.11 安裝教學(官方中文版)安裝參考:http://selfinquiring.hatenablog.com/entry/2016/03/18/204352

REF 2: DEV-C++自學手冊

REF3:網頁編碼Big5? UTF-8?

1、下載Dev-Cpp 5.11 TDM-GCC 4.9.2 Setup.exe(約49MB)並安裝之

2-1、編寫如下程式碼並存為m1.cpp

#include <stdio.h>
int main(void)
{
    printf("貓cat\n狗dog\n");
    return (0);
}

2-2、按F11編譯並執行m1.cpp,會於新視窗上輸出結果如下:

貓cat
狗dog

2-3、也可在命令提示字元執行m1.exe:

D:\>dir m1.*
:
2019/10/23  上午 11:47                84 m1.cpp
2019/10/23  上午 11:47           131,000 m1.exe
 :

 

D:\>m1
貓cat
狗dog

 

3-1、編寫如下程式碼並存為d:\m2.cpp

#include <stdio.h>
int main(void)
{
    FILE *outfile;
    outfile = fopen("m2.txt", "w");
    fprintf(outfile,"貓cat\n狗dog\n");
    fclose(outfile);
    printf("已將「貓cat\n狗dog\n」輸出為m2.txt");
    return (0);
}

3-2:按F11編譯並執行m2.cpp,會於新視窗上輸出結果如下:

已將「貓cat
狗dog
」輸出為m2.txt
--------------------------------
Process exited after 0.3991 seconds with return value 0
請按任意鍵繼續 . . .

3-3、也可在命令提示字元執行 type d:\m2.txt


D:\>dir m2.txt

2019/10/23  下午 04:02                14 m2.txt
               1 個檔案              14 位元組

:

D:\>type d:\m2.txt
貓cat
狗dog


3-4、在命令提示字元執行 hexdump m2.txt  (詳參 :20190930在windows命令提示字元下用hexdump來觀察文字檔案 )

D:\>hexdump m2.txt
000000  bf df 63 61 74 0d 0a aa af 64 6f 67 0d 0a

發覺以上中文字元採用二個位元組的BIG5內碼 「貓:BFDF、狗:AAAF」

 

4-1、在linux下執行m2.cpp所編出的執行檔來產生m2.txt,並顯示m2.txt如下:

$ g++ m2.cpp -o m2

$ ./m2
已將「貓cat
狗dog
」輸出為m2.txt

$ cat m2.txt
貓cat
狗dog

4-2、在linux下用hexdump指令觀看m2.txt

$hexdump m2.txt -C
00000000  e8 b2 93 63 61 74 0a e7  8b 97 64 6f 67 0a        |...cat....dog.|
0000000e

4-3在linux下編寫如下程式碼並存為m3.c

#include <stdio.h>
int main(void)
{
    FILE *infile;

    infile = fopen("m2.txt", "rb");

    fseek(infile,0, SEEK_SET );
    unsigned char ch;
    int i=0;

    printf("m2.txt的內容分析如下\n");
    while (!feof(infile)){
        fread(&ch, sizeof( char ), 1, infile);
        printf("(%d,%c,%02X,%3d)\n",i,ch,ch,ch);
        i=i+1;
    }
    fclose(infile);
    return (0);
}

 

4-4在windows的執行m3.c所編出的執行檔,結果如下

m2.txt的內容分析如下
(0,?BF,191)
(1,?DF,223)
(2,c,63, 99)
(3,a,61, 97)
(4,t,74,116)
,0D, 13)
(6,
,0A, 10)
(7,?AA,170)
(8,?AF,175)
(9,d,64,100)
(10,o,6F,111)
(11,g,67,103)
,0D, 13)
(13,
,0A, 10)
(14,
,0A, 10)

4-4、在linux下的用g++編譯m3.cpp

$ g++ m3.cpp -o m3

 

4-4、在linux下執行m3結果如下

$ ./m3

m2.txt的內容分析如下
(0,�,E8,232)
(1,�,B2,178)
(2,�,93,147)
(3,c,63, 99)
(4,a,61, 97)
(5,t,74,116)
(6,
,0A, 10)
(7,�,E7,231)
(8,�,8B,139)
(9,�,97,151)
(10,d,64,100)
(11,o,6F,111)
(12,g,67,103)
(13,
,0A, 10)
(14,
,0A, 10)

4-5在全字庫查「貓」與「狗」的各式中文內碼:

註:utf8編碼:中文字元採 3 BYTES編碼、英文字元採1 BYTES編碼。

(1)貓:\u8c93  https://www.cns11643.gov.tw/wordView.jsp?ID=94793

https://www.charbase.com/8C93

(2)狗:\u72d7 https://www.cns11643.gov.tw/wordView.jsp?ID=85616

https://www.charbase.com/72D7

 

5-1 編寫如下程式碼並存為d:\m4.cpp

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
    FILE *infile;

    if(argc!=3) {
        printf("指令語法:執行檔主檔名 輸入資料檔名 查看的位元組數\n 例如: m4 m2.txt 200\n");
        return(-1);    
    }
   
    printf("argc=%d\n",argc);
   
    printf("執行檔名 argv[0]=%s\n",argv[0]);
    printf("輸入資料檔名:argv[1]=%s\n",argv[1]);
    printf("查看的位元組數 argv[2]=%s\n",argv[2]);
   
    infile = fopen(argv[1], "rb");

    fseek(infile,0, SEEK_SET );
    unsigned char ch;
    int i=0;

    printf("%s的內容分析如下\n",argv[1]);
    while (!feof(infile) && i<atoi(argv[2]) ){
        fread(&ch, sizeof( char ), 1, infile);
        printf("(%d,%c,%02X,%3d)\n",i,ch,ch,ch);
        i=i+1;
    }
    fclose(infile);
    return (0);
}

 

5-2執行結果如下:

D:\c>m4.exe
指令語法:執行檔主檔名 輸入資料檔名 查看的位元組數
 例如: m4 m2.txt 200

D:\c>m4.exe m2.txt 8
argc=3
執行檔名 argv[0]=m4.exe
輸入資料檔名:argv[1]=m2.txt
查看的位元組數 argv[2]=8
m2.txt的內容分析如下
(0,?BF,191)
(1,?DF,223)
(2,c,63, 99)
(3,a,61, 97)
(4,t,74,116)
,0D, 13)
(6,
,0A, 10)
(7,?AA,170)

 

20191021製作純文字格式的影像檔並安裝GIMP來顯示
2019/10/21,13:14

(一)參考文章:

REF1:20190605PBM圖檔製作.doc下載 (161 KB) | created 05 六月, 2019

REF2:20190606製作純文字格式的彩色圖檔PPM.doc下載 (117 KB) | created 06 六月, 2019

(二)下載並安裝GNU Image Manipulation Program (GIMP 2.10.12版).

(三a)請用記事本編寫如下內容並存在桌面為bw01.pbm(黑白影像檔)

bw01.PBM 下載 (2 KB) | created 21 十月, 2019

P1
32 32
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 0 0 0 0 0 0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9 9 9 9 9 9 9 9
1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9
1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9
1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9
1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9
1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1
9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1
9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1
9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1
9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1
9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1
9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1
9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 1 1 1 1 1 1 1 1

(四b)用gimp開啟桌面的gray01.pgm 成功

alt

(五a)請用記事本編寫如下內容並存在桌面為color01.ppm (彩色影像檔)

color01.PPM 下載 (932 bytes) | created 21 十月, 2019

P3
10 10
256
222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9
222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9
9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222
9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222
9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222
222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9
222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9
9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222
9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222
9 9 9 9 9 9 9 9 222 222 222 222 222 222 222 222 9 9 9 9 9 9 9 9 222 222 222 222 222 222

(六b)用gimp開啟桌面的color01.ppm 成功

alt

20191021用python執行k近鄰分類、k-平均聚類、標註傳播
2019/10/21,09:09

REF : NTU ccCLUB Python 入門

(1)安裝pip

python -m pip install --upgrade pip

(2) 用pip 裝numpy 陣列模組

C:\Users\USER\AppData\Local\Programs\Python\Python37\Scripts\pip3.7.exe  install numpy
:

Successfully installed numpy-1.17.3

(3)用pip裝matplotlib

C:\Users\USER\AppData\Local\Programs\Python\Python37\Scripts\pip3.7.exe  install matplotlib

:

Installing collected packages: six, cycler, kiwisolver, python-dateutil, pyparsing, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.1.0 matplotlib-3.1.1 pyparsing-2.4.2 python-dateutil-2.8.0 six-1.12.0

(4)用pip裝sklearn

C:\Users\USER\AppData\Local\Programs\Python\Python37\Scripts\pip3.7.exe  install sklearn

:

Successfully installed joblib-0.14.0 scikit-learn-0.21.3 scipy-1.3.1 sklearn-0.0

(5-0)自https://scikit-learn.org下載k近鄰分類模擬程式

(5-1)將上方程式碼拷入記事本並存為d:\knbc.py

(6-1)執行 python knbc.py結果如下:

alt

 

 

(7-1)編寫如下程式碼並存為D:\kmean.py
下載 (448 bytes) | created 28 十月, 2019
(7-2)執行 python kmean.py結果如下:
k=2
alt


k=3
alt

(8-1)標註傳播 https://scikit-learn.org/stable/modules/label_propagation.html#label-propagation

(8-2) 程式碼 knn.py
下載 (2 KB) | created 28 十月, 2019


(8-3)執行 python knn.py結果如下:
alt
20191018用python的pip模組裝pyinstaller用以製作windows系統下的可執行檔(EXE)
2019/10/18,08:57

(1)請參考連結文章:將Python打包成exe檔

(2) 在命令列輸入 pip install pyinstaller

(3-1)在記事本編寫 6.py

# -*- coding: UTF-8 -*-
import numpy as np
maxno=30
ds=input("請輸1~29間的數字序列(以空白隔開)=")
bs=(' '.join(ds.split())).split(' ')

cs = []
for i in range(len(bs)):
   cs.append(int(bs[i]))

print(sorted(cs),"項目數=",len(cs))

na=np.arange(maxno)
for i in range(maxno):
   na[i]=0
 
for i in cs:
    if i < maxno :
        na[i]=i;


for i in range(1,maxno):
   print(na[i],end=',')

print()

(3-2)在命令列輸入 pyinstaller -F .\6.py
:

20358 INFO: Appending archive to EXE D:\dist\6.exe
20373 INFO: Building EXE from EXE-00.toc completed successfully.

(4)dir d:\dist
:

2019/10/17  下午 02:28        19,439,208 6.exe
:

(5) 執行 D:\dist\6.exe
請輸1~29間的數字序列(以空白隔開)=67 88 99 12   3 4
[3, 4, 12, 67, 88, 99] 項目數= 6
0,0,3,4,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,


20191014在windows7安裝並使用python3.7.4來剖析數字序列字串
2019/10/14,09:04

(1)自python官網下載Windows x86-64 executable installer(python-3.7.4-amd64.exe 約25.4MB)並執行之

(2)安裝時請選取要將python執行檔所在(C:\Users\USER\AppData\Local\Programs\Python\Python37\)加入WINDOWS路徑變數中Path中。

python主程式裝在C:\Users\USER\AppData\Local\Programs\Python\Python37\python.exe

(3)由windows開始功能表執行 IDLE(python 3.7 64bit)

(4)按CTRL+N在PYTHON文字編輯器編寫如下程式碼,並存為 d:\1.py 

n1 = input('請輸入第1個數: ')
n2 = input('請輸入第2個數: ')
s = float(n1) + float(n2)
print(' {0} + {1} 等於 {2}'.format(n1, n2, s))

(5)在PYTHON文字編輯器按F5可儲存編寫的程式碼並執行之:

請輸入第1個數: 34
請輸入第2個數: 45
 34 + 45 等於 79.0

 (6)執行notepad 2.py,用記事本輸入如下內容至2.py (並採utf8編碼存檔)

n1 = input("請輸入數字1: ")
n2 = input("請輸入數字2: ")
prod = float(n1) * float(n2)
print('The product of {0} and {1} is {2}'.format(n1, n2, prod))

(7) 用python執行 2.py

C:\>python d:\2.py
請輸入數字1: 35
請輸入數字2: 2
The product of 35 and 2 is 70.0

(8-1)執行notepad 3.py,用記事本輸入如下內容至3.py (並採utf8編碼存檔) //請參考連結文章:詳解Python中的join()函數的用法
mys = "天  道   地理   中有     心!"
print(mys)
print(mys.split(" "))
print(mys.split())
#以空白字元作為分隔符,將mys.split()所有的元素合併成一個新的字符串cmys
cmys = ' '.join(mys.split())  
print(cmys)
print(cmys.split(' '))

(8-2) 用python執行 3.py
天  道   地理   中有     心!
['天', '', '道', '', '', '地理', '', '', '中有', '', '', '', '', '心!']
['天', '道', '地理', '中有', '心!']
天 道 地理 中有 心!
['天', '道', '地理', '中有', '心!']

(9-0)REF如何在Python排序: http://swaywang.blogspot.com/2012/05/pythonpythonpython-sorting.html

(9-1)執行notepad 4.py,用記事本輸入如下內容至4.py (並採utf8編碼存檔)

ds=input("請輸入ds: ")
print(ds.split(' '))
print(' '.join(ds.split()))
bs=(' '.join(ds.split())).split(' ')
print(bs)
print(sorted(bs))

(9-2) 用python執行 4.py

C:\>python d:\4.py
請輸入ds: 4  2   3
['4', '', '2', '', '', '3']
4 2 3
['4', '2', '3']
['2', '3', '4']


C:\Users\USER>C:\Users\USER\AppData\Local\Programs\Python\Python37\python.exe  d:\4.py
ds=34 55 6 1 2 4 6 9 5 66
['34', '55', '6', '1', '2', '4', '6', '9', '5', '66', '']
34 55 6 1 2 4 6 9 5 66
['34', '55', '6', '1', '2', '4', '6', '9', '5', '66']
['1', '2', '34', '4', '5', '55', '6', '6', '66', '9']

(10-1)用記事本輸入如下內容並存為5.py (並採utf8編碼存檔)

# -*- coding: UTF-8 -*-
ds=input("ds=")
bs=(' '.join(ds.split())).split(' ')
print(bs)
print(sorted(bs))

cs = []
for i in range(len(bs)):
   cs.append(int(bs[i]))

print(sorted(cs))

(10-2) 用python執行 5.py

D:\>python 5.py
ds=3 5 6 7 9999  1  22 14   13 12
['3', '5', '6', '7', '9999', '1', '22', '14', '13', '12']
['1', '12', '13', '14', '22', '3', '5', '6', '7', '9999']
[1, 3, 5, 6, 7, 12, 13, 14, 22, 9999]

(11)安裝pip,並用pip來裝numpy 陣列模組

(11-1) python -m pip install --upgrade pip

(11-2) pip install numpy

(12-1) $ 在LinuxOS下用vi編寫 6.py,程式碼如下:

# -*- coding: UTF-8 -*-
import numpy as np
maxno=30
ds=input("請輸1~29間的數字序列(以空白隔開)=")
bs=(' '.join(ds.split())).split(' ')

cs = []
for i in range(len(bs)):
   cs.append(int(bs[i]))

print(sorted(cs),"項目數=",len(cs))

na=np.arange(maxno)
for i in range(maxno):
   na[i]=0
 
for i in cs:
    if i < maxno :
        na[i]=i;


for i in range(1,maxno):
   print(na[i],end=',')

print()

(12)在LinuxOS下用python執行6.py 

(12-1) $ /usr/src/Python-3.7.0/python 6.py  (用10/14早上操場外掃座號資料
請輸1~29間的數字序列(以空白隔開)=7 6 24 22 8 29 27 26 20 15 17 19 9 14 23 11 2 22 13
[2, 6, 7, 8, 9, 11, 13, 14, 15, 17, 19, 20, 22, 22, 23, 24, 26, 27, 29]
0,2,0,0,0,6,7,8,9,0,11,0,13,14,15,0,17,0,19,20,0,22,23,24,0,26,27,0,29,

(12-2) $ /usr/src/Python-3.7.0/python 6.py (用10/14下午操場外掃座號資料)
請輸1~29間的數字序列(以空白隔開)=9 14 10 1 18 12 6 24 7 2 16 17 18 19 20 23 11 22 13 8  27 26 29
[1, 2, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 18, 19, 20, 22, 23, 24, 26, 27, 29]
1,2,0,0,0,6,7,8,9,10,11,12,13,14,0,16,17,18,19,20,0,22,23,24,0,26,27,0,29,

(12-3) $ /usr/src/Python-3.7.0/python 6.py  (用10/16下午班會外掃座號資料
請輸1~29間的數字序列(以空白隔開)=6 4 7 10 1 23 11 18 13 22 15 19 9 17 20 29 26 27 8
[1, 4, 6, 7, 8, 9, 10, 11, 13, 15, 17, 18, 19, 20, 22, 23, 26, 27, 29]
1,0,0,4,0,6,7,8,9,10,11,0,13,0,15,0,17,18,19,20,0,22,23,0,0,26,27,0,29,

(12-4) $ /usr/src/Python-3.7.0/python 6.py  (用10/9上午操場外掃座號資料
 

請輸1~29間的數字序列(以空白隔開)=25 28 23 11 8 6 24 7 2 16 20 19 9 15 13 22 26 27 29
[2, 6, 7, 8, 9, 11, 13, 15, 16, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29] 項目數= 19
0,2,0,0,0,6,7,8,9,0,11,0,13,0,15,16,0,0,19,20,0,22,23,24,25,26,27,28,29,

(12-5) $ /usr/src/Python-3.7.0/python 6.py  (用10/9班會女廁外掃座號資料
請輸1~29間的數字序列(以空白隔開)=3 11 8 12 14 15 16 17 18 20
[3, 8, 11, 12, 14, 15, 16, 17, 18, 20] 項目數= 10
0,0,3,0,0,0,0,8,0,0,11,12,0,14,15,16,17,18,0,20,0,0,0,0,0,0,0,0,0,

(12-6) $ /usr/src/Python-3.7.0/python 6.py  (用10/8外掃座號資料
請輸1~29間的數字序列(以空白隔開)=9 19 14 20 15 16 17 27 29 8 28 25 4 24 1 10 12 18 2 6 7 5 26 22 13
[1, 2, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 25, 26, 27, 28, 29] 項目數= 25
1,2,0,4,5,6,7,8,9,10,0,12,13,14,15,16,17,18,19,20,0,22,0,24,25,26,27,28,29,


(12-7)在win7下執行 D:\>python 6.py (用10/17早上外掃座號)
請輸1~29間的數字序列(以空白隔開)=22 13 18 20 17 15 23 11 19 4 7 3 8 14 9
[3, 4, 7, 8, 9, 11, 13, 14, 15, 17, 18, 19, 20, 22, 23] 項目數= 15
0,0,3,4,0,0,7,8,9,0,11,0,13,14,15,0,17,18,19,20,0,22,23,0,0,0,0,0,0,

(12-8) python 6.py (用10/21早上外掃座號)
請輸1~29間的數字序列(以空白隔開)=12 18
[12, 18] 項目數= 2
0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,

(12-9) python 6.py (用10/21下午外掃座號)

請輸1~29間的數字序列(以空白隔開)=15 17 27 21 16 19 1 18 4 5 7 6 24 3 2
[1, 2, 3, 4, 5, 6, 7, 15, 16, 17, 18, 19, 21, 24, 27] 項目數= 15
1,2,3,4,5,6,7,0,0,0,0,0,0,0,15,16,17,18,19,0,21,0,0,24,0,0,27,0,0,

(12-10) python 6.py (用10/21下午回收處理座號)

請輸1~29間的數字序列(以空白隔開)=18 2 9 22 25 28 6 11 13 24 3 19 26 5 4 17 27 16 20 15
[2, 3, 4, 5, 6, 9, 11, 13, 15, 16, 17, 18, 19, 20, 22, 24, 25, 26, 27, 28] 項目
數= 20
0,2,3,4,5,6,0,0,9,0,11,0,13,0,15,16,17,18,19,20,0,22,0,24,25,26,27,28,0,

(12-11) python 6.py (用10/5 外掃)
請輸1~29間的數字序列(以空白隔開)=2 20 16 17 19 12 18 15
[2, 12, 15, 16, 17, 18, 19, 20] 項目數= 8
0,2,0,0,0,0,0,0,0,0,0,12,0,0,15,16,17,18,19,20,0,0,0,0,0,0,0,0,0,

(12-12) python 6.py(用10/5 外掃)
請輸1~29間的數字序列(以空白隔開)=8 9 11 12 13 14 2 3 4 5 6 7 22 23 24 25 26 27 28 29 15 16 17 18 19 20 21
[2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] 項目數= 27
0,2,3,4,5,6,7,8,9,0,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,

(12-13) python 6.py(用10/3 外掃)
請輸1~29間的數字序列(以空白隔開)=8 9 10 11 12 13 14 22 23 24 26 29 21
[8, 9, 10, 11, 12, 13, 14, 21, 22, 23, 24, 26, 29] 項目數= 13
0,0,0,0,0,0,0,8,9,10,11,12,13,14,0,0,0,0,0,0,21,22,23,24,0,26,0,0,29,

(12-14) python 6.py(用10/2 外掃) 

請輸1~29間的數字序列(以空白隔開)=9 11 13 14 1 3 4 5 6 7 22 23 24 25 26 27 29 15 17 19 20 21
[1, 3, 4, 5, 6, 7, 9, 11, 13, 14, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29] 項目數= 22
1,0,3,4,5,6,7,0,9,0,11,0,13,14,15,0,17,0,19,20,21,22,23,24,25,26,27,0,29,

(12-15) python 6.py(用10/1 外掃)
請輸1~29間的數字序列(以空白隔開)=9 10 12 13 22 27
[9, 10, 12, 13, 22, 27] 項目數= 6
0,0,0,0,0,0,0,0,9,10,0,12,13,0,0,0,0,0,0,0,0,22,0,0,0,0,27,0,0,

(12-16) python 6.py(用9/30 外掃)
請輸1~29間的數字序列(以空白隔開)=8 10 11 12 13 22 23 24 26 27 29 18 21 2 4
[2, 4, 8, 10, 11, 12, 13, 18, 21, 22, 23, 24, 26, 27, 29] 項目數= 15
0,2,0,4,0,0,0,8,0,10,11,12,13,0,0,0,0,18,0,0,21,22,23,24,0,26,27,0,29,

(12-17) python 6.py(用10月初外掃)
請輸1~29間的數字序列(以空白隔開)=5 29 8 21 15 20 16 19 17 25 28 14 9
[5, 8, 9, 14, 15, 16, 17, 19, 20, 21, 25, 28, 29] 項目數= 13
0,0,0,0,5,0,0,8,9,0,0,0,0,14,15,16,17,0,19,20,21,0,0,0,25,0,0,28,29,

(12-18) python 6.py(用9/26外掃)

請輸1~29間的數字序列(以空白隔開)=2 4 6 7 15 17 20
[2, 4, 6, 7, 15, 17, 20] 項目數= 7
0,2,0,4,0,6,7,0,0,0,0,0,0,0,15,0,17,0,0,20,0,0,0,0,0,0,0,0,0,

(12-19) python 6.py(用9/25外掃)

請輸1~29間的數字序列(以空白隔開)=2 4 5 6 7 15 16 17 20
[2, 4, 5, 6, 7, 15, 16, 17, 20] 項目數= 9
0,2,0,4,5,6,7,0,0,0,0,0,0,0,15,16,17,0,0,20,0,0,0,0,0,0,0,0,0,

(12-20) python 6.py(用9/24外掃)

請輸1~29間的數字序列(以空白隔開)=1 2 3 4 6 7 15 17 18 20 29
[1, 2, 3, 4, 6, 7, 15, 17, 18, 20, 29] 項目數= 11
1,2,3,4,0,6,7,0,0,0,0,0,0,0,15,0,17,18,0,20,0,0,0,0,0,0,0,0,29,

(12-21) python 6.py(用9/23外掃)

請輸1~29間的數字序列(以空白隔開)=2 3 4 6 7 8 11 15 16 18 19 20 21
[2, 3, 4, 6, 7, 8, 11, 15, 16, 18, 19, 20, 21] 項目數= 13
0,2,3,4,0,6,7,8,0,0,11,0,0,0,15,16,0,18,19,20,21,0,0,0,0,0,0,0,0,

 

(12-22) python 6.py(用10/28外掃)
請輸1~29間的數字序列(以空白隔開)=13 22 23 11 9 14 28 25 21  
[9, 11, 13, 14, 21, 22, 23, 25, 28] 項目數= 9
0,0,0,0,0,0,0,0,9,0,11,0,13,14,0,0,0,0,0,0,21,22,23,0,25,0,0,28,0,

 

(12-23) python 6.py(用10/29外掃)
請輸1~29間的數字序列(以空白隔開)=13 22 23 11 24 26 29
[11, 13, 22, 23, 24, 26, 29] 項目數= 7
0,0,0,0,0,0,0,0,0,0,11,0,13,0,0,0,0,0,0,0,0,22,23,24,0,26,0,0,29,

(12-24) python 6.py(用10/30班會後大掃)

請輸1~29間的數字序列(以空白隔開)=6 11 2 24 23 5 29 22 3 15 20 1 8 10 12 18 13 27 14 9 17 4 25 7 21 16 19 15
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29] 項目數= 28
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,27,0,29,

(12-25) python 6.py(用10/31外掃)
請輸1~29間的數字序列(以空白隔開)=16 19 4 7 22 13 15 17 2 20 1 10 12
[1, 2, 4, 7, 10, 12, 13, 15, 16, 17, 19, 20, 22] 項目數= 13
1,2,0,4,0,0,7,0,0,10,0,12,13,0,15,16,17,0,19,20,0,22,0,0,0,0,0,0,0,

(12-26) python 6.py(用10/25外掃)
請輸1~29間的數字序列(以空白隔開)=1 2 6 7 9 11 12 13 14 15 16 17 18 19 20 21 22 24 26 27 28 29
[1, 2, 6, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 27, 28, 29] 項目數= 22
1,2,0,0,0,6,7,0,9,0,11,12,13,14,15,16,17,18,19,20,21,22,0,24,0,26,27,28,29,

(12-27) python 6.py(用10/24外掃)

請輸1~29間的數字序列(以空白隔開)=12 18 2 3 21 27 5 6 4 7 15 20 16 19
[2, 3, 4, 5, 6, 7, 12, 15, 16, 18, 19, 20, 21, 27] 項目數= 14
0,2,3,4,5,6,7,0,0,0,0,12,0,0,15,16,0,18,19,20,21,0,0,0,0,0,27,0,0,

(12-28) python 6.py(用10/23女廁外掃)
請輸1~29間的數字序列(以空白隔開)=5 2 1
[1, 2, 5] 項目數= 3
1,2,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

(12-29) python 6.py (11/4上午外掃)
請輸1~29間的數字序列(以空白隔開)=2 9 18 20 4 6 7 16 19 15 17
[2, 4, 6, 7, 9, 15, 16, 17, 18, 19, 20] 項目數= 11
0,2,0,4,0,6,7,0,9,0,0,0,0,0,15,16,17,18,19,20,0,0,0,0,0,0,0,0,0,

(12-30) python 6.py (11/4下午清洗回收)

請輸1~29間的數字序列(以空白隔開)=2 9 18 19 20 16 22 13 14 25 28 12 1 10 26 8
[1, 2, 8, 9, 10, 12, 13, 14, 16, 18, 19, 20, 22, 25, 26, 28] 項目數= 16
1,2,0,0,0,0,0,8,9,10,0,12,13,14,0,16,0,18,19,20,0,22,0,0,25,26,0,28,0,

(12-31) python 6.py (11/5下午清洗回收)
請輸1~29間的數字序列(以空白隔開)=2 16 19 20 9 15 26 17 27 13  14 3 5 7 28 6 24 7 22 25
[2, 3, 5, 6, 7, 7, 9, 13, 14, 15, 16, 17, 19, 20, 22, 24, 25, 26, 27, 28] 項目數= 20
0,2,3,0,5,6,7,0,9,0,0,0,13,14,15,16,17,0,19,20,0,22,0,24,25,26,27,28,0,

(12-32) python 6.py (11/6下午外掃)

請輸1~29間的數字序列(以空白隔開)=25 27 5 23 11 12 1 10 3 8
[1, 3, 5, 8, 10, 11, 12, 23, 25, 27] 項目數= 10
1,0,3,0,5,0,0,8,0,10,11,12,0,0,0,0,0,0,0,0,0,0,23,0,25,0,27,0,0,

(12-33) python 6.py (11/7上午外掃)
請輸1~29間的數字序列(以空白隔開)=16 19 6 7 2 18 15 9 17 20 14
[2, 6, 7, 9, 14, 15, 16, 17, 18, 19, 20] 項目數= 11
0,2,0,0,0,6,7,0,9,0,0,0,0,14,15,16,17,18,19,20,0,0,0,0,0,0,0,0,0,

(12-34) python 6.py (11/7下午教室)
請輸1~29間的數字序列(以空白隔開)=11 9 2 15 20 27 28 29 23 12 1 10 13 26
[1, 2, 9, 10, 11, 12, 13, 15, 20, 23, 26, 27, 28, 29] 項目數= 14
1,2,0,0,0,0,0,0,9,10,11,12,13,0,15,0,0,0,0,20,0,0,23,0,0,26,27,28,29,

(12-35) python 6.py (11/11上午外掃)
 

請輸1~29間的數字序列(以空白隔開)=25 28 14 9 22 2 23 11 13 24 8 26 10 12
[2, 8, 9, 10, 11, 12, 13, 14, 22, 23, 24, 25, 26, 28] 項目數= 14
0,2,0,0,0,0,0,8,9,10,11,12,13,14,0,0,0,0,0,0,0,22,23,24,25,26,0,28,0,

(12-36) python 6.py (11/11下午教室)
請輸1~29間的數字序列(以空白隔開)=17 16 19 2 20 25 3 28 14 9 21 4 7 22 11 13
[2, 3, 4, 7, 9, 11, 13, 14, 16, 17, 19, 20, 21, 22, 25, 28] 項目數= 16
0,2,3,4,0,0,7,0,9,0,11,0,13,14,0,16,17,0,19,20,21,22,0,0,25,0,0,28,0,

(12-37) python 6.py (11/12下午外掃)
請輸1~29間的數字序列(以空白隔開)=24
[24] 項目數= 1
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,


 

20191007在WINDOWS下使用政府資料開放平台並用excel分析各縣市汽車竊盜點位
2019/10/07,09:28

20191007在WINDOWS下使用政府資料開放平台並用excel分析各縣市汽車竊盜點位2019.doc

1、連上「政府資料開放平台」http://data.gov.tw

2、搜尋「桃園市市汽車竊盜點位」

3-1、下載「桃園市汽車竊盜點位」

資料檔名為「10806_2.csv」,此為用逗點分隔的文字檔,可用記事本打開,也可用試算表軟体(如excel)打開

3-2:用試算表軟体(如excel)打開10806_2.csv,發覺一堆亂碼,此為utf8中文內碼被誤為big5中文內碼所產生的錯誤顯示結果。

4、將下載資料拷到d磁碟機的根目錄下(d:\)

5、輸入cmd啟動命令提示字元(command prompt)

6-1、輸入:notepad d:\10806_2.csv,以記事本打開d:\10806_2.csv,檔案內容摘述如下:

"type","time","year","month","date","breau","station","lat","lon"
"汽車竊盜",1080628,108,6,28,"八德分局","四維所",24.9718971,121.2968853
"汽車竊盜",1080622,108,6,22,"中壢分局","龍興所",24.9397963,121.2253887
"汽車竊盜",1080615,108,6,15,"楊梅分局","楊梅所",24.9205195,121.129601
"汽車竊盜",1080609,108,6,9,"楊梅分局","幼獅所",24.9588841,121.1750266
 

:

"汽車竊盜",1080331,108,3,31,"八德分局","四維所",24.9551185,121.2961016
"汽車竊盜",1080330,108,3,30,"平鎮分局","宋屋所",24.9589034,121.1809913
"汽車竊盜",1080329,108,3,29,"大溪分局","圳頂所",24.8971033,121.280434

:

6-2:選另存新檔/編碼改為ansi/將本檔另存為採big5中文內碼的文字檔/檔名給 d:\10806_2ansi.csv

7、雙按 d:\10806_2ansi.csv會以excel開啟,選取H1:I36/插入/散佈圖

alt

 

8、於J2輸入如下公式產生KML檔所需的航點,並將J2的公式複製給第J欄的其他儲存格:

="<Placemark><name>" & B2 &"</name><Point><coordinates>" & I2 & "," & H2 & "</coordinates></Point></Placemark>"

 

9、下載並用記事本開啟如下kml檔(20191009.kml下載 (1 KB) | created 09 十月, 2019)

10、將excel第J欄的J2~J30之間的kml點位資訊拷入記事本上述kml檔的如下..文字之間,並存為「你名你號.kml」

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">

<Document>

<name>GPS device</name>

<Style id="lineStyle">
<LineStyle>
<color>FF0000EF</color>
<width>3</width>
</LineStyle>
</Style>

<Folder>

<name>Waypoints</name>


:

<Placemark><name>1080628</name><Point><coordinates>121.2968853,24.9718971</coordinates></Point></Placemark>

:


</Folder>

</Document>
</kml>

11、用GOOGLE Earth 開啟「你名你號.kml」來看案子發生地點的衛星地表。

alt

20191006可將gpx航跡檔轉為kml檔的c語言程式 gpx2kml.c
2019/10/06,21:26

Ref1:gpx檔案格式:https://www.topografix.com/GPX/1/1/

Ref2:kml檔案格式  http://docs.opengeospatial.org/is/12-007r2/12-007r2.html#249

<Placemark><name>311乾溝</name><Point><coordinates>121.268303,24.531385</coordinates></Point></Placemark>

1.輸入來源gpx檔:2019071718d6d7.gpx下載 (1.1 MB) | created 21 九月, 2019

2.程式碼:gpx2kml.c下載 (7 KB) | created 06 十月, 2019

3.編譯:$ g++ `xml2-config --cflags` gpx2kml.c `xml2-config --libs` -o gpx2kml

4.執行:$ ./gpx2kml 2019071718d6d7.gpx

5.輸出結果kml檔:output.kml下載 (182 KB) | created 06 十月, 2019

6.用Google Earth 開啟output.kml成功,畫面如下:

alt

7、用手機的oruxmap APP開啟kml檔如下:

alt

參考文章:

 

20191004在windows裝audacity來錄製一首自己唱的歌當作手機鈴聲及來電答鈴
2019/10/04,08:51

(1)自audacity官方網站或如下連結下載最新版安裝程式audacity-win-2.3.2.exe(約26MB)並執行安裝。  

Audacity 檔案下載 (多國語言繁體中文2.3.2 版):安裝版 (26.6MB)

(2)win7會遇到的問題:缺少 動態連結程式庫 api-ms-win-crt-runtime-l1-1-0.dll

(2-1)解決方法:
在ms官網:https://support.microsoft.com/zh-tw/help/2999226/update-for-universal-c-runtime-in-windows 下載更新套件Windows6.1-KB2999226-x86.msu(32位元版OS用)

Windows6.1-KB2999226-x64.msu(62位元版OS用),執行更新後即可安裝最新版audacity。

(3-0)下載如下三個野獸叫聲檔到桌面:台灣騷蟬.mp3下載 (379 KB)   山羌.mp3下載 (362 KB)  大冠鷲.mp3下載 (309 KB)

(3-1)執行Audacity(點選桌面上的audacity捷徑)並開啟「山羌.mp3」檔(計有23秒音訊),按CTRL+A選取全部音訊,並將之複製貼上在第25秒以後,按播放鈕試聽一下(教室機器沒裝喇叭,請自備耳機聽)。

alt

(4)在Audacity,操作「檔案/匯入/音訊/「騷蟬.mp3」,會匯入成另一有24秒的音軌,選取本音軌的前十秒,將之複製貼上在第35秒以後。

再按播放鈕試聽一下(每一音軌最前端有靜音或獨奏的切換鈕)。

(5)將以上二音軌的編輯存為「野叫.aup」專案檔,並結束audacity

(6)雙按「野叫.aup」專案檔,會用 audacity打開,同(4)請再「大冠鷲.mp3」(約有20秒音訊),請儲存本專案並結束audacity。

(7)請打開「野叫_data」查看野叫.aup專案的相關資料(有28個au檔,可一一打開來聽聽)。

alt

(8)雙按開啟「野叫.aup」專案檔,再選取「檔案/export/匯出為mp3」,將本專案匯出為「野叫.mp3」

(9)再選取「檔案/export/匯出為wav」,將本專案匯出為「野叫.wav」

(10)再選取「檔案/export/匯出為ogg」,將本專案匯出為「野叫.ogg」

(11)請參考如下文章,了解並完成第12點操作。

REF1: 剪輯mp3片段作為手機鈴聲

REF2:錄製電腦播放的聲音

REF3: Android手機如何設定你自己的鈴聲、簡訊提示音、鬧鐘鈴聲

(12-1)請重啟audacity,錄一首你唱的歌並匯入以上三種野獸任一種叫聲為背景聲,最後將之匯出為「你名.mp3」當作你的手機鈴聲 ,如  treehrt5.mp3下載 (1.7 MB,歌名「我」;歌詞內容 「我生在水之鄉,長在沙之邦,我心像太陽,生命像電光,過去也曾流過淚,也曾受過創,在沙漠中曾流浪,在風雨中曾飄盪,但是我沒有呼過降,也沒有停過唱,但是我沒有呼過降,也沒有停過唱。」)

(12-2)在你的android手機SD卡根目錄下新增一個media資料夾,接著在media之下再新增一個audio資料夾, 接著在audio之下新增三個資料夾alarms、notifications、ringtones(大小寫要一致)
接著在ringtones中放自訂的來電鈴聲,如treehrt5.mp3(註:alarms放自訂鬧鐘鈴聲、notifications放自訂簡訊鈴聲)

(13)你可在申請中華電信來電答鈴服務(30元/月),錄製你自己的歌,讓朋友等候通話也能欣賞好音樂!請思考中華電信如何在此服務快速的賺到客戶的錢。

20191003在Ubuntu1604裝audacity並使用
2019/10/03,20:52

(1)

$ sudo add-apt-repository ppa:ubuntuhandbook1/audacity
[sudo] password for treehrt:
 The PPA contains the most recent release of Audacity since Audacity Team only provides an daily build PPA.

Removed Audacity 2.3.0 package, since it is considered ‘experimental’ for Linux.

For help, please use Audacity forum: http://forum.audacityteam.org/
 更多資訊:https://launchpad.net/~ubuntuhandbook1/+archive/ubuntu/audacity
請輸入 [ENTER] 繼續,或 Ctrl-C 來取消加入動作

gpg: `/tmp/tmpsfgn72np/secring.gpg' 鑰匙圈已建立
gpg: `/tmp/tmpsfgn72np/pubring.gpg' 鑰匙圈已建立
gpg: 正在請求金鑰 852541CB 自 hkp 伺服器 keyserver.ubuntu.com
gpg: /tmp/tmpsfgn72np/trustdb.gpg: 建立了信任資料庫
gpg: 金鑰 852541CB: 公鑰 "Launchpad PPA for Panda Jim" 已匯入
gpg: 處理總量: 1
gpg:               已匯入: 1  (RSA: 1)
OK

 

(2)$ sudo apt update


W: GPG 錯誤: http://dl.google.com/linux/earth/deb stable Release: 由於無法取得它們的公鑰,以下簽章無法進行驗證: NO_PUBKEY 6494C6D6997C215E
:t ~$

 

(3)$ sudo apt install audacity

下列【新】套件將會被安裝:
  audacity audacity-data libflac++6v5 libid3tag0 liblilv-0-0 libportsmf0v5 libserd-0-0 libsord-0-0 libsratom-0-0 libsuil-0-0 libvamp-hostsdk3v5 libwxbase3.0-0v5 libwxgtk3.0-0v5

設定 libserd-0-0:i386 (0.22.0~dfsg0-2) ...
設定 libsord-0-0:i386 (0.14.0~dfsg0-1) ...
設定 libsratom-0-0:i386 (0.4.6~dfsg0-1) ...
設定 libsuil-0-0:i386 (0.8.2~dfsg0-1) ...
設定 audacity-data (2.3.2-0build1~ubuntu16.04) ...
設定 libflac++6v5:i386 (1.3.1-4) ...
設定 libid3tag0 (0.15.1b-11) ...
設定 liblilv-0-0 (0.22.0~dfsg0-1) ...
設定 libportsmf0v5:i386 (0.1~svn20101010-4ubuntu1) ...
設定 libvamp-hostsdk3v5:i386 (2.6~repack0-2) ...
設定 libwxbase3.0-0v5:i386 (3.0.2+dfsg-1.3ubuntu0.1) ...
設定 libwxgtk3.0-0v5:i386 (3.0.2+dfsg-1.3ubuntu0.1) ...
設定 audacity (2.3.2-0build1~ubuntu16.04) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
treehrt ~$

(4)剪輯mp3片段作為手機鈴聲REF : https://blog.xuite.net/yh96301/blog/51283520-Audacity+2.0.3%E5%89%AA%E8%BC%AF%E9%9F%B3%E6%A8%82

 

(5)錄製電腦播放的聲音REF : https://blog.xuite.net/yh96301/blog/206156179-Audacity+2.2.2%E9%8C%84%E8%A3%BD%E9%9B%BB%E8%85%A6%E6%92%AD%E6%94%BE%E7%9A%84%E8%81%B2%E9%9F%B3

(5)安裝REF:http://ubuntuhandbook.org/index.php/2017/03/audacity-2-1-3-released/

20191001在安卓手機裝LIME-HD V5.2.4 萊姆中文輸入程式與嘸蝦米輸入法
2019/10/01,20:30

1、在play商店輸入LIME,選取LIME-HD APP下載並安裝之。

2、自「LIME 輸入法可用的嘸蝦米輸入法字根檔」處下載

boshiamy.lime約560KB

3、啟動桌面的LIME設定程式/新增輸入法/選取剛下載的boshiamy.lime字根表

4、安卓/設定/系統/語言與輸入設定/鍵盤與輸入法:虛擬鍵盤/挑LIME為第1優先。

 

 


 

 
Accessible and Valid XHTML 1.0 Strict and CSS Powered by LifeType