2017年8月21日 星期一

[editor] VSCode sync-setting

VSCode 跟 Atom 一樣都有sync-setting 外掛,但設定方式不太一樣。
VSCode 環境中使用sync-setting
1. 先在 gist上 Generate new tokens
2. 在 VSCode sync_setting 使用 Update/Upload settings,若為第一次使用時會要求輸入token,系統會自動取得gistid,並於gist上自動產生一個新gist。
3. 記下所產生的gistid以用於另一台機器的VSCode (第一次使用時在 VSCode sync-setting 下使用Download settings,系統會要求輸入gistid)

PS. Atom中使用sync-settings 除了要 Generate new token,還要自己新增gist並取得gistid。
(參考:https://garfieldduck.me/atom-sync-settings/)




2017年8月16日 星期三

[server] WordPress

WordPress 

[server] MediaWiki

[blogger] Tutorial

  • Blogger建立網誌 link

[server]

WAMP

XAMPP

AppServ

[python][scraping] apple news

  1. URL: http://www.appledaily.com.tw/realtimenews/section/new
  2. Chrome
  • Nework
  • Doc
  • new/
  • Header (method is GET)

[editor] atom

sync-settings

Unistall

  • Remove following folders after applying system removal file.
    • C:\Users\<user name>\.atom folder (settings, packages...).
    • C:\Users\<user name>\AppData\Local\atom (application itself)
    • C:\Users\<user name>\AppData\Roaming\Atom folder (for cache?)

2017年8月15日 星期二

[python] tensorflow and keras

## Install ```py pip install tensorflow pip install keras ```

[gis] Shape檔案圖資編碼的轉換

markdown test 4

Header

```py print("Howdy!") ```

[blogger] use markdown syntax


markdown test 3

markdown # Header1 ## Header2 ```py print("hello world") ```

Deep Learning 筆記

[資料來源:卡卡米的記憶體]

Deep Learning 筆記


markdown test 2

markdown hello world2 ``` hello world2 ```

markdown test

hello world ```py print("hello world") ```

GIS Info (From QGIS小學堂)

[資料來源:facebook QGIS小學堂 粉絲團]

********置頂文,QGIS資源,更新日期:2017/7/25********

QGIS最新版本: 2.18.11

Web Design References

General

2017年8月13日 星期日

[html] clearfix

Use clearfix in CSS

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
    <meta charset="UTF-8">
     <link rel="stylesheet" href="css/reset.css"> 
    <link href="css/style2_1.css" rel="stylesheet">
    
  </head>
  <body>
  <header class="header"></header>
  <div class="wrapper clearfix">
    <main class="main">aaa</main>
    <div class="sidemenu">bbb</div>
  </div>
  <footer class="footer">
    
  </footer>
  </body>
</html>  

CSS

.clearfix::after{
  content: '';
  display: block;
  clear: both;
}   

Results

[python] sqlite3 module

Connect

import sqlite3
con = sqlite3.connect('db.sqlite3')
con.close()

# equivlent to
with sqlite3.connect('db.sqlite3') as con:

Cursor

import sqlite3
con = sqlite3.connect('db.sqlite3')
cur = con.cursor()
cur.execute(``` CREATE TABLE messages ( ) ```)
con.commit()
con.close()

# equivlent to
with sqlite3.connect('db.sqlite3') as con:
  cur = con.cursor()
  cur.execute(``` CREATE TABLE messages ( ) ```)
  con.commit()  

References

  1. Python3.5技術手冊 林信良 碁峰

[python] inheritance

Inheritance

class animalBaseClass:
    animallegs = 4
 
    def walk(self):
        print('走動')

    def cry(self):
        print('吼叫')

    def getLegsNum(self):
        print(self.animallegs)

class dogClass(animalBaseClass): 
    def __init__(self):
        print('我是小狗')

wanko = dogClass()
wanko.walk()
wanko.cry()
wanko.getLegsNum()

Override

class animalBaseClass:
  animallegs = 2
  def walk(self):
    print('走動')
  def cry(self):
    print('吼叫')

class birdClass(animalBaseClass):
  def __init__(self):
    print('我是小鳥')
  def cry(self):
    print('啾啾')

piyo_suke = birdClass()
piyo_suke.walk()
piyo_suke.cry()

2017年8月12日 星期六

[python] requests module

Install

``` pip install requests ```

[python] Pillow module

Install

pip install Pillow

Import

from PIL import Image

Usage

from PIL import Image
image = Image.open('Ch06/6-2節/sample_image/flower.jpg')

image.show()
from PIL import Image
image = Image.open('Ch06/6-2節/sample_image/flower.jpg')

r, g, b = image.split()
convert_image = Image.merge("RGB", (b, g, r))
convert_image.show()

convert_image.save('Ch06/6-2節/sample_image/rgb_to_bgr.jpg')
image.show()

[GIS] raster clean up

Problem description

Many models require the grids of input rasters to be overlapped exacted at the same locations, with the same extent.


To deal with

Use GCD tool, [Data Preparation]>[Clean Raster].




References

  1. GCD Software http://gcd.joewheaton.org/.

[python] class example

Example 1

class fruit():
    color = 'red'
    def taste(self):
        return 'delicious'

apple = fruit()      
apple.color
apple.taste()   

Example 2

class staff():
    def salary(self):
        return '10000元'

yamamoto = staff()
yamamoto.salary()

Example 3

class staff():
    bonus = 30000
    def salary(self):
        salary = 10000 + self.bonus
        return salary

yamamoto = staff()
yamamoto.salary()

Example 4

class staff():
    def __init__(self, bonus):
        self.bonus = bonus
    def salary(self):
        salary =  10000 + self.bonus
        return salary

yamamoto = staff()
yamamoto.salary()

2017年8月11日 星期五

[blogger] Ebbed google map

[blogger] Ebbed YouTube video testing

[html] 顯示插入或刪除 - "ins" "del" 標籤

天數剩下2 1

Code
天數剩下<del datetime="2012-02-14t00:00:00">2</del>
<ins datetime="2012-02-14t00:00:00">1</ins>天  
Reference
  • 網頁程式設計 陳惠貞 碁峰

[html]定義清單 -"dl" "dt" "dd" 元素的使用

黑面琵鷺
黑面琵鷺最早的棲息地是韓國及中國的北方沿海,但近年來它們覓著了 一個新的棲息地,那就是寶島台灣的曾文溪口沼澤地。
赤腹鷹
赤腹鷹的棲息地在墾丁、恆春一帶,只要一到每年的八、九月,赤腹鷹 就會成群結隊的到台灣過冬,愛鷹的人士可千萬不能錯過。
Code
    <dl>
      <dt>黑面琵鷺</dt>
        <dd>黑面琵鷺最早的棲息地是韓國及中國的北方沿海,但近年來它們覓著了
        一個新的棲息地,那就是寶島台灣的曾文溪口沼澤地。</dd>
      <dt>赤腹鷹</dt>
        <dd>赤腹鷹的棲息地在墾丁、恆春一帶,只要一到每年的八、九月,赤腹鷹
        就會成群結隊的到台灣過冬,愛鷹的人士可千萬不能錯過。</dd>
    </dl>
Reference
  • 網頁程式設計 陳惠貞 碁峰

[note] Blog 筆記事項

  • Data analysis
  • Web development
  • Coding
    • Python
    • C#
    • JavaScript
    • etc.
  • GIS
  • Research
  • Water
  • Trouble shooting

Multiple grd files to one raster (tif) file

Problem description

The *.grd files are obtained from different sources, and of time only contain a rectangle area which is smaller than the area of interest.
Moreover, the *.grd format is not commonly used under QGIS/ArcGIS environment.

To deal with

Steps
  1. Convert grd(s) to tif(s), set projection - use gdalwarp
  2. Merge tif(s) - use arcpy or arcgis toolbox "Mosaic To New Raster (Data Management)"
  3. Set nodata value on new tif - use gdalwarp
  for %%i in (*.grd) do ( 
  gdalwarp -overwrite -s_srs EPSG:3826 -t_srs EPSG:3826 
  -tr 1 -1 -ot float32 %%i ../bsn1010tif2/%%~ni.tif )  
  
  arcpy.MosaicToNewRaster_management(
  input_rasters= "94194055dem.tif; 94191009dem.tif; 94191025dem.tif",
  output_location="E:/E_DATAEXP/D20170308020100500_PP3/_TEST_merge/bsn1010tif2",
  raster_dataset_name_with_extension="merge.tif",
  coordinate_system_for_the_raster="#",
  pixel_type="32_BIT_FLOAT",
  cellsize="#",
  number_of_bands="1",
  mosaic_method="LAST",
  mosaic_colormap_mode="FIRST")
  
  gdalwarp -overwrite -s_srs EPSG:3826 -t_srs EPSG:3826 -tr 1 1 -ot float32
  -srcnodata XXX -dstnodata -9999 E:/E_DATAEXP/D20170308020100500_PP3/_TEST_merge/bsn1010tif/bsn1010arc.tif
  

DATA

衛星

Brackets setting

Line height

1. path:
C:\Users\AaronHsu\AppData\Roaming\Brackets\extensions\user\80s-baby
2. setting:
    
  .CodeMirror {
    line-height: 1.2em;
  }
  

Themes

  • 80's Baby
  • 808


Reference

Brackets edit

change tag

Hot key: Ctrl + Shift + i

balance (select all contents between tag)

Hot key: Ctrl + Shift + Alt + b

2017年8月10日 星期四

SyntaxHighlighter

use SyntaxHighlighter

class DemoApp {
    public static void main(String[] args) {
        Demo d = new Demo();
        d.printMessage();
    }
}
 
class Demo {
    String message = "^_^ 哈囉";
     
    public void printMessage() {
        System.out.println(message);
    }
}
 
/* 《程式語言:教學誌》的範例程式
    http://pydoing.blogspot.com/
    檔名:DemoApp.java
    功能:簡單的 Java 範例
    作者:張凱慶
    時間:西元 2010 年 10 月 */

use codeblock pretty print

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  
</body>
</html>

2017年8月4日 星期五

[blogger] Customize

1.Font

1.1.All content

http://licoriceguava.blogspot.tw/2014/02/blogger.html
search: .font
<Variable name="body.font" description="Font" type="font"
         default="normal normal 12px 微軟正黑體, Arial, Tahoma, Helvetica, FreeSans, sans-serif" value="normal normal 16px 微軟正黑體, Arial, Tahoma, Helvetica, FreeSans, sans-serif"/>

VSCode 秘訣

[來源:卡斯伯]
VSCode 秘訣
只要在設定檔加入以下片段
就能在 js, Vue 的檔案內直接使用 Emmet

"emmet.syntaxProfiles": {
"javascript": "html",
"vue": "html",
"vue-html": "html"
}

MS Windows command line 語法

[茶包] 於 Windows command line 使用 gdal_merge

Issue:
將QGIS路經
C:\Program Files\QGIS 2.14;
C:\Program Files\QGIS 2.14\bin
加入system path仍無法呼叫。

Work around:
於command line中執行 OSGeo4W,再執行gdal_merge

[blogger] Tips