<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4640521299986777604</id><updated>2026-09-07T23:51:40.234+08:00</updated><category term="Django"/><category term="Computer technic"/><category term="Python"/><category term="Academic"/><category term="Others"/><category term="asp.net"/><category term="CentOS 7"/><category term="Kali Linux"/><category term="PostgreSQL"/><category term="RESTful"/><category term="SQL"/><category term="WCF"/><category term="WSL"/><category term="Windows Universal App"/><category term="Ajax"/><category term="Andriod"/><category term="Authentication"/><category term="Baseball"/><category term="Flex3"/><category term="Headless"/><category term="Heroku"/><category term="JSON"/><category term="Java"/><category term="JavaMail"/><category term="Kotlin"/><category term="Microsoft Azure"/><category term="Music"/><category term="OAuth"/><category term="OpenVAS"/><category term="Perl"/><category term="RWD"/><category term="Raspberry pi 2"/><category term="Softether VPN"/><category term="Spinner"/><category term="Ubuntu LTS 20.04"/><category term="VPN"/><category term="Visual studio"/><category term="WUP"/><category term="Web Service"/><category term="Windows 10 IoT Core"/><category term="gmail"/><category term="google map"/><category term="jQuery"/><category term="list of objects"/><category term="opendata"/><category term="phpPgAdmin"/><category term="w3af"/><title type='text'>Keep going, keep learning</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-1791792550180610900</id><published>2026-01-10T22:33:00.009+08:00</published><updated>2026-03-08T19:43:26.867+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WSL"/><title type='text'>Fix vs code MCP configuration error of WSL - npx command not found</title><summary type="text">For vscode/vscode-insiders copilot chat MCP configuration

https://github.com/microsoft/vscode/issues/255220

## Solution I

### Install Node.js on Windows
  - vs code created a mcp.json in default location:

  ```
  C:/Users/spencer/AppData/Roaming/Code/User/mcp.json
  ```



## Solution II
### Create a new mcp.json in your workspace
  - {path\_to\_project}/.vscode/mcp.json



## Solution III
##</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/1791792550180610900/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/1791792550180610900' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/1791792550180610900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/1791792550180610900'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2026/01/fix-vs-code-mcp-configuration-error.html' title='Fix vs code MCP configuration error of WSL - npx command not found'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-7786880032653561451</id><published>2025-07-20T17:01:00.016+08:00</published><updated>2026-03-08T20:56:16.758+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WSL"/><title type='text'>Install your development environment with WSL in windows 11</title><summary type="text">### Read it before install WSL
- Install your windows terminal &amp; recommended system Fonts
    - https://github.com/doggy8088/best-wsl-ubuntu-setup
    - https://github.com/doggy8088/best-wsl-ubuntu-setup/blob/main/README-Ubuntu-24.md

### Install from PowerShell

- List all the distros of WSL
  ```
  wsl --list --online
  ```

- support distros (2025/07/20)
  ``` 
  NAME</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/7786880032653561451/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/7786880032653561451' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7786880032653561451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7786880032653561451'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2025/07/install-your-development-environment.html' title='Install your development environment with WSL in windows 11'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-6511505309995733668</id><published>2025-06-15T11:14:00.002+08:00</published><updated>2025-06-15T11:27:50.387+08:00</updated><title type='text'>Setting Up Your Environment for Vibetest-Use</title><summary type="text">This guide will walk you through the process of setting up your environment to use `vibetest-use`, a tool that appears to be designed for website testing using AI agents. We&#39;ll cover everything from cloning the repository to configuring the necessary components.

### Step 1: Get the Code

First, you need to get the source code. You can do this by cloning the repository directly, or by forking it </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/6511505309995733668/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/6511505309995733668' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/6511505309995733668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/6511505309995733668'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2025/06/setting-up-your-environment-for.html' title='Setting Up Your Environment for Vibetest-Use'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-8664112748694225952</id><published>2020-09-30T10:10:00.002+08:00</published><updated>2020-10-01T12:13:00.433+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Softether VPN"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu LTS 20.04"/><category scheme="http://www.blogger.com/atom/ns#" term="VPN"/><title type='text'>Install &amp; Setup SoftEther VPN Server on ubuntu LTS 20.04</title><summary type="text">markdown

# SoftEther VPN

## Installation

### install on ubuntu

- install openssl(1.1.1g)

```
~$ wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
~$ tar xzvf openssl-1.1.1g.tar.gz
~$ cd openssl-1.1.1g
~$ ./config
~$ make
~$ sudo make install

~$ sudo ldconfig

~$ openssl version -a
```

- install build essential(gcc)

```
~$ sudo apt-get update 
~$ sudo apt-get install </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/8664112748694225952/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/8664112748694225952' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8664112748694225952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8664112748694225952'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2020/09/softether-vpn-server-install-on-ubuntu.html' title='Install &amp; Setup SoftEther VPN Server on ubuntu LTS 20.04'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-9046242828603007406</id><published>2020-04-03T22:34:00.000+08:00</published><updated>2020-04-15T19:36:21.227+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Authentication"/><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="OAuth"/><title type='text'>Customize your own Django authentication decouple with the models.py</title><summary type="text">For many systems, authentication mechanisms may already exist, especially for systems that are authenticated by an OAuth server. 
In this article, I want to customize Django authentication without creating any user model...



Step 1.
Customize your own authentication middleware.

auth.middleware.py



from django.conf import settings
from auth.backend import CamelotBackend
from auth.user import </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/9046242828603007406/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/9046242828603007406' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/9046242828603007406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/9046242828603007406'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2020/04/customize-your-django-authentication.html' title='Customize your own Django authentication decouple with the models.py'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-2039043861980089075</id><published>2018-09-16T23:35:00.000+08:00</published><updated>2018-09-17T10:38:36.178+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Andriod"/><category scheme="http://www.blogger.com/atom/ns#" term="Kotlin"/><category scheme="http://www.blogger.com/atom/ns#" term="list of objects"/><category scheme="http://www.blogger.com/atom/ns#" term="RESTful"/><category scheme="http://www.blogger.com/atom/ns#" term="Spinner"/><title type='text'>[Android] Stored your customized data object in Spinner with Kotlin</title><summary type="text">If you want to make the list of your customized data objects be stored in Spinner.
Try this...

Step:

1. write your own data class
2. override the toString() method of your data class
3. add it to mutable list
4. write on onItemSelected listener
5. get selected item, and retrieval the object of your data class



Your data class


class MenuData(var menuName: String
               , var </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/2039043861980089075/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/2039043861980089075' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/2039043861980089075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/2039043861980089075'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2018/09/android-stored-your-customized-data.html' title='[Android] Stored your customized data object in Spinner with Kotlin'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total><georss:featurename>台灣新竹市東區新竹</georss:featurename><georss:point>24.8138287 120.96747979999998</georss:point><georss:box>24.698499199999997 120.80611829999998 24.9291582 121.12884129999998</georss:box></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-7286500276727426507</id><published>2018-07-14T22:19:00.005+08:00</published><updated>2018-09-17T10:31:11.420+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="Heroku"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Django 2.0.7 deploy to Heroku</title><summary type="text">I create a Django 2.0.7 app to deploy to Heroku.

https://devcenter.heroku.com/articles/django-app-configuration

settings.py

import django_heroku
....
....
# Activate Django-Heroku
django_heroku.settings(locals())


And when I run it with debug mode in local web app, it&#39;s running well.

But it always shows error when I deploy it to Heroku.



&quot;relation &quot;auth_user&quot; does not exist&quot;



Heroku </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/7286500276727426507/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/7286500276727426507' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7286500276727426507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7286500276727426507'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2018/07/python-django-207-deploy-to-heroku.html' title='Django 2.0.7 deploy to Heroku'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-7162637519218623111</id><published>2017-06-01T18:55:00.001+08:00</published><updated>2017-06-01T19:03:00.629+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kali Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="w3af"/><title type='text'>install w3af in kali linux (rolling)</title><summary type="text">for Kali Linux latest version 20170601Kali Linux has been installed some packages for fill the requirements of w3af.

openssl ==&amp;gt; 16.2.0&amp;nbsp;
lxml ==&amp;gt; 3.7.1&amp;nbsp;


Preparing install:sudo apt install -y python-pybloomfiltermmap

pybloomfiltermmap ==&amp;gt; 0.3.15




Install w3af: 
git clone https://github.com/andresriancho/w3af.git 

update the version in requiremenets.py 
vim ~/w3af/w3af/</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/7162637519218623111/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/7162637519218623111' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7162637519218623111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7162637519218623111'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2017/06/install-w3af-in-kali-linux.html' title='install w3af in kali linux (rolling)'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-7228157810211175921</id><published>2017-06-01T10:52:00.003+08:00</published><updated>2017-06-01T11:37:55.923+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kali Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenVAS"/><title type='text'>install openvas9 in kali linux (rolling) </title><summary type="text">最近需要利用open source software做網站主機的滲透測試，
一開始是自行安裝ubuntu 16.04 LTS，然後安裝openvas和w3af，
然後針對已經開發中的web site測試，後來又找了一些其它的工具，
最後就找到了 Kali Linux (一個以Debian Linux為基礎開發的滲透測試系統)

原本Kali linux上是已經安裝了OpenVAS和w3af...等工具，但我安裝的是最新版的kali linux(rolling)，也就是以後kali linux不會有版本的概念，會不斷的更新。
OpenVAS由於佔用空間太大，預設情況下不會安裝，而w3af則是因為相關的package只支援python2，所以被移除了，等w3af完全支援python3才會再被重新加入Kali Linux
官方也建議每次使用時都取得最新的版本，透過apt update和apt </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/7228157810211175921/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/7228157810211175921' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7228157810211175921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7228157810211175921'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2017/06/install-openvas9-in-kali-linux-rolling.html' title='install openvas9 in kali linux (rolling) '/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-8985813101589679967</id><published>2016-05-28T15:34:00.002+08:00</published><updated>2016-05-28T15:35:31.978+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>刪除終端機存取中斷的python debug web server</title><summary type="text">適用情況：
遠端登入建立virtual environment，並啟動web server後，終端機斷線
在這種狀況下，web server還是在running state，所以port被佔住，無法debug

解決方法：
pkill -f &quot;python manage.py runserver&quot;</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/8985813101589679967/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/8985813101589679967' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8985813101589679967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8985813101589679967'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2016/05/python-debug-web-server.html' title='刪除終端機存取中斷的python debug web server'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-1155319083632881095</id><published>2016-05-21T13:28:00.002+08:00</published><updated>2016-06-25T10:04:01.928+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="RESTful"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Universal App"/><title type='text'>RESTful services for windows iot core</title><summary type="text">要在Visual Studio 2015上開發Respberry Pi 2 App有一個很重要的必要條件

就是OS必需要是Windows 10

先從RESTful service講起，

目前的windows iot core最新版本是10.0.10586

App的版本和windows iot core的版本要配合，如果要安裝新版的app，

記得要更新windows iot core版本至最新的版本

一直到目前為止，也還沒有釋出官方的RESTful service，

只有在一些文件中，有提到未來會在WCF中加入

然而，目前還沒有，所以找了一個github上的專案來替代，叫restup

https://github.com/tomkuijsten/restup

文件也很完整，還有提供範例程式，唯一的缺點就是還在beta階段
https://github.com/</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/1155319083632881095/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/1155319083632881095' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/1155319083632881095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/1155319083632881095'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2016/05/restful-services-for-windows-iot-core.html' title='RESTful services for windows iot core'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1OdLgYdPk2GFwGKGjNRNXFXdRLoeM0bWsos1Nl7adx4z354t1SAxfLuX4MR87-NVBL9aqYb1zvQlP66KgaJ2jXSG97qT8O9zNjUCbRXd69R2HzbpJHaOR4UY0V8StsZj9LzCLr1VIjpc/s72-c/install-package.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-8057640071024684318</id><published>2016-05-21T13:09:00.002+08:00</published><updated>2016-05-21T13:55:18.784+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Headless"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Universal App"/><category scheme="http://www.blogger.com/atom/ns#" term="WUP"/><title type='text'>Headless app with Windows Universal App</title><summary type="text">在windows iot core中，app可部署為背景執行的Headless與前景執行的Headed 兩種模式

在這次的專案中，我需要的是背景執行的web services

於是開始了一段○○××的找文件之旅

因為在官方文件中，並沒有看到要如何設定一個Headless類型的專案類型

完整的專案建置過程如下：

首先，在visual studio上建立一個空白的Windows Universal App專案







接著，裝預設為前景的專案變更為背景執行的Headless模式

step 1.
刪除兩個預先產生的.xmal檔案

step 2.
以檢視原始碼的方式打開專案的Package.appxmanifest
修改內容，增加 iot 的namespace宣告
xmlns:iot=&quot;http://schemas.microsoft.com/appx/manifest/</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/8057640071024684318/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/8057640071024684318' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8057640071024684318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8057640071024684318'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2016/05/headless-app-with-windows-universal-app.html' title='Headless app with Windows Universal App'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYbODHGYkoeEn3PopaoY5pncCr2g-rLRDgArfMzD7XRIlMvzKK_3P4Z2hfJ4kCKzKG-ASvpTjvq1H1OVFH0LDNAwuR937DID74QhNhBZluLWbhrlvJ8uPCE32eQsJohLdKv-2zm50-DGE/s72-c/create.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-8063123110812299364</id><published>2016-02-14T12:35:00.001+08:00</published><updated>2016-02-14T17:46:53.807+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Raspberry pi 2"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 10 IoT Core"/><title type='text'>Raspberry pi 2 安裝 windows 10 IoT Core</title><summary type="text">試試新玩具....Raspberry pi 2



首先安裝windows 10 IoT Core來測試，安裝步驟如下：
I、下載 windows 10 IoT Core image檔案，下載連結
II、解開iso檔，會有一個msi安裝檔 (Windows_10_IoT_Core_RPi2)
III、安裝msi檔，安裝後為一個燒錄工具：Windows IoT Core Image Helper
IV、放入SD card，利用此工具將image檔燒錄至SD card



解開iso檔





&amp;nbsp;Windows IoT Core Image Helper



&amp;nbsp;將image檔燒錄至SD card



image檔燒錄




完成image檔燒錄





□ 啟動Raspberry pi 2
將燒錄好的SD card安裝至 Raspberry pi 2
接上網</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/8063123110812299364/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/8063123110812299364' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8063123110812299364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8063123110812299364'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2016/02/raspberry-pi-2-windows-10-iot-core.html' title='Raspberry pi 2 安裝 windows 10 IoT Core'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXzmoELwLB2ltoQrgBv5t3FOhuOGDusnS7gnGkkl4nF6drnmRx68ScTie4RfBIBRZpox1ocYGPnZjPeU7zZdEfg-rVyU7otrFk2MoT7o5fVvQopmyAs6O5-CBZGPrcHANGNrEp16QarUk/s72-c/P1280170.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-1315794165515133920</id><published>2016-02-11T10:11:00.000+08:00</published><updated>2016-02-26T14:19:23.750+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Django REST framework</title><summary type="text">最近想開發RESTful service, 想說看看Python的solution，就找到了Django REST fraemwork…


Authentication type:

Basic authentication

Token authentication

JWT authentication

json web token authentication
一種較Oauth輕量化的方式，利用json的格式，儲存token，
使用者登入後，利用帳號、密碼，取得一個全新的token，預設在5分鐘後即會過期，
過期後，可利用已過期的token，取得新的token，
如此便解決不用重複傳送username與password的風險，且token會一直更新。
OAuth2 authentication

django-oauth-toolkit
Session </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/1315794165515133920/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/1315794165515133920' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/1315794165515133920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/1315794165515133920'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2016/02/django-rest-framework.html' title='Django REST framework'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-3237599532140201034</id><published>2016-01-24T14:13:00.000+08:00</published><updated>2016-02-14T10:08:40.937+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CentOS 7"/><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>CentOS 7.2 安裝Python 3.4 + Django 1.9</title><summary type="text">安裝完成PostgreSQL後，接下來的重點，
就是要安裝Python 3.4 + Django + Django REST framework…


●安裝Python 3.4
sudo yum install Python34

sudo加在yum命令前，是用來讓安裝這個套件的動作，
取得super user的安裝套件權限，這樣一來就不用切換到root帳戶，可降低系統風險



●安裝完後，可用命令 python3.4 -V來檢查安裝是否有成功，與顯示安裝的python3.4版本號

●接下來安裝python模組最需要的ez_install與pip
先下載 ez_setup
#wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
將檔案下載下來後，需下su命令切換到root帳戶，安裝ez_setup
</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/3237599532140201034/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/3237599532140201034' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/3237599532140201034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/3237599532140201034'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2016/01/centos-72-python-34-django-19.html' title='CentOS 7.2 安裝Python 3.4 + Django 1.9'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlS9F6Bz3_DCsp-MyPvDsGdEwQvxgRL_kMc5f9CQ0sdUyf-OfGM8S096pvD7pKQMa7m6Yr-lY_IzMkRG-aT95e-ALHmbqfUYov54iD16ImSRREjqmbzWWdQZZBJEEcYsZLS3kaxkiXkW8/s72-c/2016-01-24_133904.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-464936926188413410</id><published>2016-01-23T21:04:00.004+08:00</published><updated>2016-02-14T10:09:29.974+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CentOS 7"/><category scheme="http://www.blogger.com/atom/ns#" term="phpPgAdmin"/><category scheme="http://www.blogger.com/atom/ns#" term="PostgreSQL"/><title type='text'>CentOS 7.2 安裝 PostgreSQL 9.4</title><summary type="text">最近在使用CentOS 7.2 build 1511, 之後會用到django rest framework + postgreSQL 
於是今天就嘗試安裝相關的環境，這篇就只記錄安裝 postgreSQL 9.4的部份…


首先，使用yum 安裝 postgreSQL 套件
postgreSQL 目前支援的linux作業系統與版本可以到官網上查詢，提供查詢網址如下：
http://yum.postgresql.org/repopackages.php
裡面有不同版本對應作業系統的Repository


●安裝
1. yum install http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-2.noarch.rpm 
2. yum install postgresql94-server </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/464936926188413410/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/464936926188413410' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/464936926188413410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/464936926188413410'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2016/01/centos-72-postgresql-94.html' title='CentOS 7.2 安裝 PostgreSQL 9.4'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHNU1msDLrrsqNce9aUN12lMFoa0Mnl9fcWsd9-AljqzRYlnzqe5DML0vpvAn1xMywZw3UtNd0XpyOCn1sTtt_pHHmjcksn2v6RxGcVK-oIo47G4jCQQbWyYV8wH6MaZ-vzltrSr1nB_c/s72-c/postgreSQLphpPgAdmin.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-8226279430386493401</id><published>2015-11-26T01:22:00.000+08:00</published><updated>2016-02-14T10:09:51.094+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google map"/><category scheme="http://www.blogger.com/atom/ns#" term="RWD"/><title type='text'>[RWD] Google maps</title><summary type="text">RWD with Google maps…



reference:
http://webomnizz.com/how-to-make-responsive-google-map-with-google-map-api/

方法一：css
HTML內容:


&amp;lt;div class=&quot;map-canvas&quot; id=&quot;map-canvas&quot;&amp;gt;

&amp;lt;iframe frameborder=&quot;0&quot; height=&quot;350&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;https://www.google.com.tw/maps/@24.7655142,121.0162967,15z?hl=zh-TW&quot; width=&quot;425&quot;&amp;gt;&amp;lt;/iframe&amp;gt;

&amp;lt;/div&amp;gt;





css內容

.</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/8226279430386493401/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/8226279430386493401' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8226279430386493401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/8226279430386493401'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2015/11/rwd-google-maps.html' title='[RWD] Google maps'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-2122466986812967899</id><published>2015-11-23T01:38:00.000+08:00</published><updated>2016-02-14T10:10:08.687+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Python學習筆記(四) - Advanced Django models management</title><summary type="text">Django裡，model的資料操作與查詢，可進階寫成Manager，整個詳細過程記錄如下…


一、定義Manager class：

class TempleManager(models.Manager):
&amp;nbsp; &amp;nbsp; def create_temple(self,name,locateRegion,religiousBelief,masterGod,address,latitude,longitude,phone1,phone2):
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; temple = self.create(name = name, locateRegion = locateRegion, religiousBelief = religiousBelief, masterGod = masterGod, address = address, </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/2122466986812967899/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/2122466986812967899' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/2122466986812967899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/2122466986812967899'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2015/11/python-advanced-django-models-management.html' title='Python學習筆記(四) - Advanced Django models management'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-4617402377473419910</id><published>2015-11-13T01:20:00.004+08:00</published><updated>2016-02-14T10:10:40.100+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Azure"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Python學習筆記(三) - 部署到Microsoft Azure</title><summary type="text">今天上了Microsoft Azure課程後，一直想做一件事，就是把已經寫好的demo &amp;nbsp;site部署到azure上，在多次嘗試後，終於成功。當然必要條件是要先有一個Microsoft Azure的帳戶…

今天再為demo專案加入一個新的功能，就是輸入地址，轉換為經緯度的功能；透過google map api提供的功能，讓我們很輕鬆的完成這個功能。


程式碼如下：
def address_to_location(request):
&amp;nbsp; &amp;nbsp; assert isinstance(request, HttpRequest)

&amp;nbsp; &amp;nbsp; address = request.GET[&#39;address&#39;]
&amp;nbsp; &amp;nbsp; encodeAddress = urllib.parse.urlencode({&#39;address&#39;: address</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/4617402377473419910/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/4617402377473419910' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/4617402377473419910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/4617402377473419910'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2015/11/python-microsoft-azure.html' title='Python學習筆記(三) - 部署到Microsoft Azure'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA2pGK7nk-DMXL5JV_l8LU5Tn3NTbpk-mb2PXCmaP2FTRBm5DLPRCFkKXv6q8sW9e47z9bWfwnwu8BHy79GiztIrhKELBwMzEPypXbEUW9K9gUUiBrWTLNpEsQN0gJTj9aik5Zz7e2FmU/s72-c/2015-11-13_004003.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-7419448107170505057</id><published>2015-11-12T01:37:00.000+08:00</published><updated>2016-02-14T10:11:10.550+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="JSON"/><category scheme="http://www.blogger.com/atom/ns#" term="opendata"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Python學習筆記(二)....感動的JSON處理</title><summary type="text">雖然只是測試功能，但對 Python處理JSON字串留下深刻的印象，再度對Django框架有了更濃厚的興趣

建立django虛擬環境(virtualvenv)：
ref - https://djangogirlstaipei.gitbooks.io/django-girls-taipei-tutorial/content/django/installation.html

我們可以直接開始安裝 Django，但實務上，大多數人都會搭配使用虛擬環境。使用虛擬環境有許多優點：

你的專案會擁有一個專屬的獨立 Python 環境。


不需要 root 權限，就可以安裝新套件。


方便控管不同版本的套件，不用擔心升級套件會影響到其他專案。


如果需要多人協作或在不同機器上跑同一個專案時，使用虛擬環境也可以確保環境一致性。



相關命令：
建立環境：python -m venv </summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/7419448107170505057/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/7419448107170505057' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7419448107170505057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7419448107170505057'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2015/11/pythonjson.html' title='Python學習筆記(二)....感動的JSON處理'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEk_klgUY12LCmpKivb8hdcdm__zt4VnxP_kPstEMul6I-isqGiYtTBFENTVhn7yiGTPExTt8sc8IhM4PghsaEokuCT-838ua2KYFubtGZElvxKNRJhIZldvHtxoeExsxknryj1wsAERs/s72-c/2015-11-12_013223.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-3203206137806370191</id><published>2015-11-10T02:37:00.003+08:00</published><updated>2016-02-14T10:11:26.187+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Django"/><category scheme="http://www.blogger.com/atom/ns#" term="PostgreSQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Python學習筆記(一)</title><summary type="text">這幾天，終於把Python的線上課程(https://www.codecademy.com)上完了，基本的語法和函數都不難，比較難的反而是class的語法有點難懂，不過這部份應該多寫就能習慣…

接下來，進入Django的世界，首先就是很多種plugin要安裝(目前用到的有pip, easy_install, setuptools,&amp;nbsp;Django, psycopg2)。
easy_install, setuptools和pip通常已經內建於Python安裝程式。

安裝開發環境：
OS: Windows 7 64bits
1. Visual Studio 2015 Community
2. Git Hub
3. Python 3.4.3
4. PostgreSQL 9.4


Model-View-Template的觀念，等同於一般常聽到的MVC design pattern，</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/3203206137806370191/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/3203206137806370191' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/3203206137806370191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/3203206137806370191'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2015/11/python.html' title='Python學習筆記(一)'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-3721258334207252216</id><published>2012-03-13T11:35:00.001+08:00</published><updated>2016-02-14T10:11:50.355+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Service"/><title type='text'>Java call WCF service over SSL with UserName Credentials using NetBeans</title><summary type="text">過程中，主要有幾個問題：
一、WCF bindings設定的影響

二、SSL資料傳輸在Java環境中的設定
三、JDK版本的影響
四、Java&amp;nbsp;FQDN造成的問題
五、NetBeans使用Web Service的方法和修改部份程式碼


一、WCF Binding設定
WCF服務繫結(binding)

BasicHttpBinding：一種 HTTP 通訊協定繫結，可用於連線至 Web 服務，並符合 WS-I Basic Profile 規格 (例如，以 ASP.NET Web 服務為基礎的服務)。
WSHttpBinding：一種互通的繫結，可用於連線至符合 WS-* 通訊協定的端點。
NetNamedPipeBinding：使用 .NET Framework 以連線至同一部電腦上的其他 WCF 端點。
NetMsmqBinding：使用 .NET Framework 以</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/3721258334207252216/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/3721258334207252216' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/3721258334207252216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/3721258334207252216'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2012/03/java-call-wcf-service-over-ssl-with.html' title='Java call WCF service over SSL with UserName Credentials using NetBeans'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuwulslqRqtsDF4BqkrDPbZtzpkYburinuBxuFBbBy-qfWPKaKLNzLyE-uLSuuOP24Yjyg85NtTAI77agU4DFG2OAZWuQUJxeJ7EnsPT7_-900awoTHqROjl2prvhVTt7VYu4-LZKjMY4/s72-c/2012-03-08_182832.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-7640231576770561369</id><published>2011-10-28T14:31:00.004+08:00</published><updated>2016-02-14T10:12:11.139+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>改善WCF效能</title><summary type="text">最近用到WCF Host in IIS，出現了效能瓶頸，原本以為是IIS所導致的，後來看了相關的文章後，才發現，其實透過WCF設定，就可以解決


在WCF中，可以設定連線數的部分，
在WCF的Behavior裡設定，主要有三個參數：
(1)MaxConcurrentSessions (WCF 3.0中，預設值10)
(2)MaxConcurrentCalls (WCF 3.0中，預設值16)
(3)MaxConcurrentInstances (WCF 3.0中，預設值26)

在WCF 3.0中，預設值並沒有針對這三個值做最佳化的計算，
而在WCF 4.0的設計中，改善了這個部份，預設值分別為：
(1)MaxConcurrentSessions： 100 * ProcessorCount
(2)MaxConcurrentCalls： 16 * ProcessorCount
(3)</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/7640231576770561369/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/7640231576770561369' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7640231576770561369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/7640231576770561369'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2011/10/wcf.html' title='改善WCF效能'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-135855158532262073</id><published>2011-05-07T22:25:00.001+08:00</published><updated>2011-11-16T10:29:19.181+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Others"/><title type='text'>2011【自然人憑證】網路報稅真方便</title><summary type="text">用【自然人憑證】網路報稅真方便，分享好康訊息可以抽多功能讀卡機、自然人憑證悠遊紀念卡，還有「iPad2平板電腦」可連抽四次！想省時省事賺好康的朋友們，記得快去申辦自然人憑證喔！https://idcard.moica.hinet.net/code/2011/index.html

&lt;!-- Place this tag where you want the +1 button to render --&gt;

&lt;!-- Place this render call where appropriate --&gt;

  (function() {
    var po = document.createElement(&#39;script&#39;); po.type = &#39;text/javascript&#39;; po.async = true;
    po.src = &#39;https://</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/135855158532262073/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/135855158532262073' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/135855158532262073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/135855158532262073'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2011/05/2011.html' title='2011【自然人憑證】網路報稅真方便'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4640521299986777604.post-953123163657837999</id><published>2010-04-23T10:47:00.027+08:00</published><updated>2012-03-13T15:43:23.390+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="Visual studio"/><title type='text'>jQuery IntelliSense for Visual Studio 2008</title><summary type="text">今天在試新版的jQuery，發現有支援visual studio autocompelete功能的版本，用起來方便多了，在VS 2008的環境下可以有提示方法的功能…一、下載時記得選Visual Studio版本的jQuery二、使用時直接引用&amp;lt;script src=&amp;quot;js/jquery-1.3.2-vsdoc.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;三、如果你習慣使用google ajax library的 jQuery，又怕重複使用，可以用以下方式：   &amp;lt;%if (false){%&amp;gt;       &amp;lt;script src=&amp;quot;js/jquery-1.3.2-vsdoc.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt</summary><link rel='replies' type='application/atom+xml' href='http://kaochiuan.blogspot.com/feeds/953123163657837999/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4640521299986777604/953123163657837999' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/953123163657837999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4640521299986777604/posts/default/953123163657837999'/><link rel='alternate' type='text/html' href='http://kaochiuan.blogspot.com/2010/04/jquery-intellisense-for-visual-studio.html' title='jQuery IntelliSense for Visual Studio 2008'/><author><name>kaochiuan</name><uri>http://www.blogger.com/profile/14154782804647239879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivyPUkaX-ttnwlwGpc6DNKJqB38yoGYXzZ20sQ6-V3g61GE2TdzdBDZIu83AtZqe5MzfJMw5k02CkDY6pahhGTVfi3lR91Tq3V4Fsp2H1LRqoM1cun-qfrDi6mb62cWNo/s113-r/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9qH_B_0nb_PBdMH1r8aBd9ncy_HbIrz2fxUDNCwkvy9o_TmuTomtvb0eNQNvK6qcYQJz7h9oHFENeT9-8bonLFobuY-IViSLiBDTcumSYFQaM1vkX6_Al5qLf22jq8CFVYO0-x8XxCZI/s72-c/jquery-vsdoc.PNG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>