Thread names--when do you need to know them?
Naming conventions for threads?
How to name a thread in Linux?
2015年5月19日 星期二
2015年5月15日 星期五
滑鼠微動開關:OMROM 歐姆龍、Cherry 櫻桃
OMROM:
型號包含01,金合金接點,耐用度 10M (million)型號不含01,銀合金接點,耐用度 3M (million)
型號包含F,按壓力度為 0.74N,按鍵較輕
型號不含F,按壓力度為 1.47N,按鍵較重
日製:
D2F-01
D2F-01F
大陸製:
D2FC-F-7N
Cherry:
DG1 灰點 按壓力度 1.47N (DG1 T85 手感硬脆):相對DG2灰點,力度更加均勻一些,而且額定電壓更高一些,實際壽命也要更長一些。DG2 黑點 按壓力度 0.6N (偏軟手感):手感略軟一些,聲音相對小一些,但不失回彈緊湊,節奏明快。
DG2 黑點 按壓力度 0.74N (DG2 T85 正常手感): 行程比歐姆龍稍短,回彈緊湊、迅速,脆而不硬。
DG2 灰點 按壓力度 1.47N (手感硬脆):雖然手感較硬,但回彈超快,超緊湊、迅速,段斷感超強,手感極為清脆且有力。
DG6手感很硬,聲音清脆但不及日產歐姆龍7F白點微動,鍵程適中,回彈迅速。在這樣的消耗極大的手感設定上,卻有著相當長的壽命。
Reference:
http://reader.roodo.com/dabinn/archives/27652776.html
http://twkuc.pixnet.net/blog/post/265248248-%E5%B0%8F%E5%B0%8F%E6%8C%89%E9%8D%B5%E8%A3%A1%E7%9A%84%E5%A4%A7%E7%A7%98%E5%AF%86%EF%BC%81%E5%B8%B8%E8%A6%8B%E6%BB%91%E9%BC%A0%E5%BE%AE%E5%8B%95%E9%96%8B%E9%97%9C%E8%A9%B3%E8%A7%A3
2015年4月24日 星期五
繩子長度與重量單位換算表
繩子粗細/分/mm
|
每公斤長度/m
|
每捆重量/kg
|
備註
|
1.2分/(4mm)
|
40
|
15
|
|
1.5分/(5mm)
|
35
|
15
|
|
1.8分/(5.5mm)
|
21
|
16
|
|
2分/(6mm)
|
16
|
22
|
|
3分/(9mm)
|
11
|
23
|
|
3.5分/(10mm)
|
9.5
|
25
|
|
4分/(12mm)
|
8
|
37
|
|
4.5分/(14mm)
|
6
|
50
|
|
5分/(15mm)
|
4.5
|
50
|
|
6分/(18mm)
|
3.5
|
64
|
通常到了零售商繩子會再整理裁切,所以每捆重量不一,此表僅供參考。
Reference:
2015年4月23日 星期四
Ubuntu: Install FirefoxNewVersion/MozillaBuilds
Ubuntuzilla repository
An easy way of installing a Mozilla build is to use the Ubuntuzilla project repository. Ubuntuzilla is for ordinary users that want to use the latest Mozilla build as their default browser.
The Ubuntuzilla project's repository contains .deb repacks of the unmodified official Mozilla builds of Firefox, Thunderbird, and SeaMonkey. Just add the repository to your sources, and you'll be kept up to date on the latest Mozilla releases through the package manager.
Installation
Old ubuntuzilla installer script users note: before installing these packages, run "ubuntuzilla.py -a remove -p packagename". Otherwise installation may fail due to the existence of a local diversion of /usr/bin/ links, placed there by the old ubuntuzilla script.
- It is strongly recommended to make a backup of your Firefox/Thunderbird/Seamonkey user profile, just in case. This is stored in your home directory. Firefox and Seamonkey profiles are stored in the .mozilla directory, Thunderbird profile is stored in .thunderbird or.mozilla-thunderbird directory.
- Add the ubuntuzilla repository to your /etc/apt/sources.list, either using your favorite editor, or by running the provided one-line command (copy and paste the entire line into a terminal, then press enter).
The repository to add, if you're adding it manually to your sources.list, is
deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main
If you wish, verify that the repository has been added, by looking at /etc/apt/sources.list in your favorite text editor, or running "tail /etc/apt/sources.list" in the terminal.
- Then add the package signing key to your keyring, by running the following command:sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C1289A29
- Update your package database:sudo apt-get update
- Install your desired package, with one of the following commands:sudo apt-get install firefox-mozilla-build
sudo apt-get install thunderbird-mozilla-build
sudo apt-get install seamonkey-mozilla-build
All of this can also be done through the GUI with the Synaptic Package Manager, if you so desire. See this step-by-step visual tutorialif you would like to try the GUI approach.
From here on, any updates will be offered to you through the usual channels in the Update Manager.
Localizations
The packages in the repos are 'en-US' (US English) versions. To install any other translations:
- Download the appropriate language pack add-on .xpi file,
- Install it from within Firefox/Thunderbird/Seamonkey (as you would with any other add-on).
- Enable it by setting the config general.useragent.locale to the name of the locale that you want to use. The name of the locale is the same as the name of the language pack that you installed.
- To edit the config, go to Edit -> Preferences -> Advanced -> General -> Config Editor.
- Restart the application for the setting to take effect.
Firefox language packs are at
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/<version>/linux-i686/xpi/
Thunderbird language packs are at
http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/<version>/linux-i686/xpi/
Seamonkey language packs are at
http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/<version>/langpack/
For more info about installing language packs, see this Mozilla knowledgebase article.
Removal
To uninstall the packages, uninstall the *-mozilla-build packages, using your favorite package manager. E.g., using apt-get:
sudo apt-get remove firefox-mozilla-build sudo apt-get remove thunderbird-mozilla-build sudo apt-get remove seamonkey-mozilla-build
If you no longer wish to have the Ubuntuzilla repository in your sources, you can edit it out of your /etc/apt/sources.list.
Reference:
https://support.mozilla.org/en-US/kb/install-firefox-linux
https://help.ubuntu.com/community/FirefoxNewVersion/MozillaBuilds
http://sourceforge.net/p/ubuntuzilla/wiki/Main_Page/
https://help.ubuntu.com/community/FirefoxNewVersion/MozillaBuilds
http://sourceforge.net/p/ubuntuzilla/wiki/Main_Page/
Ubuntu: Modify the Dependency of a package (*CAUTION* THIS MAY BREAK THE SYSTEM UNINTENTIONALLY)
*CAUTION* THIS MAY BREAK THE SYSTEM UNINTENTIONALLY
Search packages on:
http://packages.ubuntu.com/
http://www.ubuntuupdates.org/
http://www.debian.org/distrib/packages
1. Extracts the filesystem tree:
$ dpkg -x original.deb data
2. Extracts the control information (default to DEBIAN/):
$ dpkg -e original.deb
3. Edit the dependency of the packages:
$ vi DEBIAN/control
$ mv DEBIAN data/
4. Create a new debian archive:
$ dpkg -b data new.deb
5. Install the new package:
$ sudo dpkg -i new.deb
If some dependency issues still occurred, dpkg may suggest you to use "--auto-deconfigure" to solve those issue. *CAUTION* THIS MAY ALSO BREAK THE DEPENDENCY OF OTHER INSTALLED PACKAGES.
If the dependency is broken after using the "--auto-deconfigure" option, try the following commands to fix it:
Reinstall the original version of some packages which break the dependency:
$ sudo apt-get install package=x.y.z-m.n
Use "-f / --fix-broken" option in apt-get:
$ sudo apt-get -f install package
OR (if still unable to correct the problem, but may be a LOT of works to do.)
$ sudo apt-get -f install
2015年4月22日 星期三
C++: vector v.s. deque
std::vector
template < class T, class Alloc = allocator<T> > class vector; // generic template
Vector
Just like arrays, vectors use contiguous storage locations for their elements, which means that their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled automatically by the container.
Internally, vectors use a dynamically allocated array to store their elements. This array may need to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new array and moving all elements to it. This is a relatively expensive task in terms of processing time, and thus, vectors do not reallocate each time an element is added to the container.
Instead, vector containers may allocate some extra storage to accommodate for possible growth, and thus the container may have an actual capacity greater than the storage strictly needed to contain its elements (i.e., its size). Libraries can implement different strategies for growth to balance between memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing intervals of size so that the insertion of individual elements at the end of the vector can be provided with amortized constant time complexity (see push_back).
Therefore, compared to arrays, vectors consume more memory in exchange for the ability to manage storage and grow dynamically in an efficient way.
Compared to the other dynamic sequence containers (deques, lists and forward_lists), vectors are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing elements from its end. For operations that involve inserting or removing elements at positions other than the end, they perform worse than the others, and have less consistent iterators and references than lists and forward_lists.
std::deque
template < class T, class Alloc = allocator<T> > class deque;
Double ended queue
deque (usually pronounced like "deck") is an irregular acronym of double-ended queue.
Double-ended queues are sequence containers with dynamic sizes that can
be expanded or contracted on both ends (either its front or its back).Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any case, they allow for the individual elements to be accessed directly through random access iterators, with storage handled automatically by expanding and contracting the container as needed.
Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of elements also at the beginning of the sequence, and not only at its end. But, unlike vectors, deques are not guaranteed to store all its elements in contiguous storage locations: accessing elements in a
deque by offsetting a pointer to another element causes undefined behavior.Both vectors and deques provide a very similar interface and can be used for similar purposes, but internally both work in quite different ways: While vectors use a single array that needs to be occasionally reallocated for growth, the elements of a deque can be scattered in different chunks of storage, with the container keeping the necessary information internally to provide direct access to any of its elements in constant time and with a uniform sequential interface (through iterators). Therefore, deques are a little more complex internally than vectors, but this allows them to grow more efficiently under certain circumstances, especially with very long sequences, where reallocations become more expensive.
For operations that involve frequent insertion or removals of elements at positions other than the beginning or the end, deques perform worse and have less consistent iterators and references than lists and forward lists.
2015年4月21日 星期二
Git Usage
Git Basics
Git Commands
git clone
git pull
--rebase: Instead of a merge, perform a rebase after fetching.
git push
git remote
-v, --verbose
set-url <name> <url>
git log
git diff
git tag
-a <tagname> <commit>
git describe
git status
git-rev-parse
git add
git rm
git mv
git reset
git revert
git commit
--ammend*
Git 版本控制系統(3) 還沒 push 前可以做的事
git branch
branch: create a new branch.
-d branch: Delete a branch. The branch must be fully merged in HEAD.
-D branch: Delete a branch irrespective of its merged status.
git checkout
branch: switch to branch
path: discard changes on working copy
git merge
git rebase
branch: Forward-port local commits base on the branch.
Git 分支 - 分支的新建與合併
Git Branch 的操作與基本工作流程
使用 git rebase 避免無謂的 merge
Pull with rebase
Git Commands
git clone
git pull
--rebase: Instead of a merge, perform a rebase after fetching.
git push
git remote
-v, --verbose
set-url <name> <url>
git log
git diff
git tag
-a <tagname> <commit>
git describe
git status
git-rev-parse
git add
git rm
git mv
git reset
git revert
git commit
--ammend*
Git 版本控制系統(3) 還沒 push 前可以做的事
git branch
branch: create a new branch.
-d branch: Delete a branch. The branch must be fully merged in HEAD.
-D branch: Delete a branch irrespective of its merged status.
git checkout
branch: switch to branch
path: discard changes on working copy
git merge
git rebase
branch: Forward-port local commits base on the branch.
Git 分支 - 分支的新建與合併
Git Branch 的操作與基本工作流程
使用 git rebase 避免無謂的 merge
Pull with rebase
訂閱:
文章 (Atom)