tag:blogger.com,1999:blog-43996695510669974182024-03-20T02:53:17.409+08:00HILARIOUSAnonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.comBlogger388125tag:blogger.com,1999:blog-4399669551066997418.post-23565717195276488152014-02-04T22:37:00.002+08:002014-02-04T22:37:57.746+08:00[Android.Malware] Android Intent List<pre style="white-space: pre-wrap; word-wrap: break-word;">Ref: <a href="http://developer.android.com/reference/android/content/Intent.html">http://developer.android.com/reference/android/content/Intent.html</a></pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">
</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">Total:184</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">
</pre>
<pre style="white-space: pre-wrap; word-wrap: break-word;">android.intent.action.AIRPLANE_MODE
android.intent.action.ALL_APPS
android.intent.action.ANSWER
android.intent.action.APP_ERROR
android.intent.action.ASSIST
android.intent.action.ATTACH_DATA
android.intent.action.BATTERY_CHANGED
android.intent.action.BATTERY_LOW
android.intent.action.BATTERY_OKAY
android.intent.action.BOOT_COMPLETED
android.intent.action.BUG_REPORT
android.intent.action.CALL
android.intent.action.CALL_BUTTON
android.intent.action.CAMERA_BUTTON
android.intent.action.CHOOSER
android.intent.action.CLOSE_SYSTEM_DIALOGS
android.intent.action.CONFIGURATION_CHANGED
android.intent.action.CREATE_DOCUMENT
android.intent.action.CREATE_SHORTCUT
android.intent.action.DATE_CHANGED
android.intent.action.VIEW
android.intent.action.DELETE
android.intent.action.DEVICE_STORAGE_LOW
android.intent.action.DEVICE_STORAGE_OK
android.intent.action.DIAL
android.intent.action.DOCK_EVENT
android.intent.action.DREAMING_STARTED
android.intent.action.DREAMING_STOPPED
android.intent.action.EDIT
android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE
android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE
android.intent.action.FACTORY_TEST
android.intent.action.GET_CONTENT
android.intent.action.GET_RESTRICTION_ENTRIES
android.intent.action.GTALK_CONNECTED
android.intent.action.GTALK_DISCONNECTED
android.intent.action.HEADSET_PLUG
android.intent.action.INPUT_METHOD_CHANGED
android.intent.action.INSERT
android.intent.action.INSERT_OR_EDIT
android.intent.action.INSTALL_PACKAGE
android.intent.action.LOCALE_CHANGED
android.intent.action.MAIN
android.intent.action.MANAGE_NETWORK_USAGE
android.intent.action.MANAGE_PACKAGE_STORAGE
android.intent.action.MEDIA_BAD_REMOVAL
android.intent.action.MEDIA_BUTTON
android.intent.action.MEDIA_CHECKING
android.intent.action.MEDIA_EJECT
android.intent.action.MEDIA_MOUNTED
android.intent.action.MEDIA_NOFS
android.intent.action.MEDIA_REMOVED
android.intent.action.MEDIA_SCANNER_FINISHED
android.intent.action.MEDIA_SCANNER_SCAN_FILE
android.intent.action.MEDIA_SCANNER_STARTED
android.intent.action.MEDIA_SHARED
android.intent.action.MEDIA_UNMOUNTABLE
android.intent.action.MEDIA_UNMOUNTED
android.intent.action.MY_PACKAGE_REPLACED
android.intent.action.NEW_OUTGOING_CALL
android.intent.action.OPEN_DOCUMENT
android.intent.action.PACKAGE_ADDED
android.intent.action.PACKAGE_CHANGED
android.intent.action.PACKAGE_DATA_CLEARED
android.intent.action.PACKAGE_FIRST_LAUNCH
android.intent.action.PACKAGE_FULLY_REMOVED
android.intent.action.PACKAGE_INSTALL
android.intent.action.PACKAGE_NEEDS_VERIFICATION
android.intent.action.PACKAGE_REMOVED
android.intent.action.PACKAGE_REPLACED
android.intent.action.PACKAGE_RESTARTED
android.intent.action.PACKAGE_VERIFIED
android.intent.action.PASTE
android.intent.action.PICK
android.intent.action.PICK_ACTIVITY
android.intent.action.ACTION_POWER_CONNECTED
android.intent.action.ACTION_POWER_DISCONNECTED
android.intent.action.POWER_USAGE_SUMMARY
android.intent.action.PROVIDER_CHANGED
android.intent.action.QUICK_CLOCK
android.intent.action.REBOOT
android.intent.action.RUN
android.intent.action.SCREEN_OFF
android.intent.action.SCREEN_ON
android.intent.action.SEARCH
android.intent.action.SEARCH_LONG_PRESS
android.intent.action.SEND
android.intent.action.SENDTO
android.intent.action.SEND_MULTIPLE
android.intent.action.SET_WALLPAPER
android.intent.action.ACTION_SHUTDOWN
android.intent.action.SYNC
android.intent.action.SYSTEM_TUTORIAL
android.intent.action.TIMEZONE_CHANGED
android.intent.action.TIME_SET
android.intent.action.TIME_TICK
android.intent.action.UID_REMOVED
android.intent.action.UMS_CONNECTED
android.intent.action.UMS_DISCONNECTED
android.intent.action.UNINSTALL_PACKAGE
android.intent.action.USER_BACKGROUND
android.intent.action.USER_FOREGROUND
android.intent.action.USER_INITIALIZE
android.intent.action.USER_PRESENT
android.intent.action.VIEW
android.intent.action.VOICE_COMMAND
android.intent.action.WALLPAPER_CHANGED
android.intent.action.WEB_SEARCH
android.intent.category.ALTERNATIVE
android.intent.category.APP_BROWSER
android.intent.category.APP_CALCULATOR
android.intent.category.APP_CALENDAR
android.intent.category.APP_CONTACTS
android.intent.category.APP_EMAIL
android.intent.category.APP_GALLERY
android.intent.category.APP_MAPS
android.intent.category.APP_MARKET
android.intent.category.APP_MESSAGING
android.intent.category.APP_MUSIC
android.intent.category.BROWSABLE
android.intent.category.CAR_DOCK
android.intent.category.CAR_MODE
android.intent.category.DEFAULT
android.intent.category.DESK_DOCK
android.intent.category.DEVELOPMENT_PREFERENCE
android.intent.category.EMBED
android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST
android.intent.category.HE_DESK_DOCK
android.intent.category.HOME
android.intent.category.INFO
android.intent.category.LAUNCHER
android.intent.category.LE_DESK_DOCK
android.intent.category.MONKEY
android.intent.category.OPENABLE
android.intent.category.PREFERENCE
android.intent.category.SAMPLE_CODE
android.intent.category.SELECTED_ALTERNATIVE
android.intent.category.TAB
android.intent.category.TEST
android.intent.category.UNIT_TEST
android.intent.extra.ALARM_COUNT
android.intent.extra.ALLOW_MULTIPLE
android.intent.extra.ALLOW_REPLACE
android.intent.extra.ASSIST_CONTEXT
android.intent.extra.ASSIST_PACKAGE
android.intent.extra.BCC
android.intent.extra.BUG_REPORT
android.intent.extra.CC
android.intent.extra.changed_component_name
android.intent.extra.changed_component_name_list
android.intent.extra.changed_package_list
android.intent.extra.changed_uid_list
android.intent.extra.DATA_REMOVED
android.intent.extra.DOCK_STATE
android.intent.extra.DONT_KILL_APP
android.intent.extra.EMAIL
android.intent.extra.HTML_TEXT
android.intent.extra.INITIAL_INTENTS
android.intent.extra.INSTALLER_PACKAGE_NAME
android.intent.extra.INTENT
android.intent.extra.KEY_EVENT
android.intent.extra.LOCAL_ONLY
android.intent.extra.MIME_TYPES
android.intent.extra.NOT_UNKNOWN_SOURCE
android.intent.extra.ORIGINATING_URI
android.intent.extra.PHONE_NUMBER
android.intent.extra.REFERRER
android.intent.extra.remote_intent_token
android.intent.extra.REPLACING
android.intent.extra.restrictions_bundle
android.intent.extra.restrictions_intent
android.intent.extra.restrictions_list
android.intent.extra.RETURN_RESULT
android.intent.extra.shortcut.ICON
android.intent.extra.shortcut.ICON_RESOURCE
android.intent.extra.shortcut.INTENT
android.intent.extra.shortcut.NAME
android.intent.extra.SHUTDOWN_USERSPACE_ONLY
android.intent.extra.STREAM
android.intent.extra.SUBJECT
android.intent.extra.TEMPLATE
android.intent.extra.TEXT
android.intent.extra.TITLE
android.intent.extra.UID</pre>
Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-46732589587026652452014-02-03T22:37:00.002+08:002014-02-03T22:37:36.319+08:00[Android.Malware] Android Permission ListCollected from : <a href="https://developer.android.com/reference/android/Manifest.permission.html">https://developer.android.com/reference/android/Manifest.permission.html</a><br />
<br />
Total : 145<br />
<br />
android.permission.ACCESS_CHECKIN_PROPERTIES<br />
android.permission.ACCESS_COARSE_LOCATION<br />
android.permission.ACCESS_FINE_LOCATION<br />
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS<br />
android.permission.ACCESS_MOCK_LOCATION<br />
android.permission.ACCESS_NETWORK_STATE<br />
android.permission.ACCESS_SURFACE_FLINGER<br />
android.permission.ACCESS_WIFI_STATE<br />
android.permission.ACCOUNT_MANAGER<br />
com.android.voicemail.permission.ADD_VOICEMAIL<br />
android.permission.AUTHENTICATE_ACCOUNTS<br />
android.permission.BATTERY_STATS<br />
android.permission.BIND_ACCESSIBILITY_SERVICE<br />
android.permission.BIND_APPWIDGET<br />
android.permission.BIND_DEVICE_ADMIN<br />
android.permission.BIND_INPUT_METHOD<br />
android.permission.BIND_NFC_SERVICE<br />
android.permission.BIND_NOTIFICATION_LISTENER_SERVICE<br />
android.permission.BIND_PRINT_SERVICE<br />
android.permission.BIND_REMOTEVIEWS<br />
android.permission.BIND_TEXT_SERVICE<br />
android.permission.BIND_VPN_SERVICE<br />
android.permission.BIND_WALLPAPER<br />
android.permission.BLUETOOTH<br />
android.permission.BLUETOOTH_ADMIN<br />
android.permission.BLUETOOTH_PRIVILEGED<br />
android.permission.BRICK<br />
android.permission.BROADCAST_PACKAGE_REMOVED<br />
android.permission.BROADCAST_SMS<br />
android.permission.BROADCAST_STICKY<br />
android.permission.BROADCAST_WAP_PUSH<br />
android.permission.CALL_PHONE<br />
android.permission.CALL_PRIVILEGED<br />
android.permission.CAMERA<br />
android.permission.CAPTURE_AUDIO_OUTPUT<br />
android.permission.CAPTURE_SECURE_VIDEO_OUTPUT<br />
android.permission.CAPTURE_VIDEO_OUTPUT<br />
android.permission.CHANGE_COMPONENT_ENABLED_STATE<br />
android.permission.CHANGE_CONFIGURATION<br />
android.permission.CHANGE_NETWORK_STATE<br />
android.permission.CHANGE_WIFI_MULTICAST_STATE<br />
android.permission.CHANGE_WIFI_STATE<br />
android.permission.CLEAR_APP_CACHE<br />
android.permission.CLEAR_APP_USER_DATA<br />
android.permission.CONTROL_LOCATION_UPDATES<br />
android.permission.DELETE_CACHE_FILES<br />
android.permission.DELETE_PACKAGES<br />
android.permission.DEVICE_POWER<br />
android.permission.DIAGNOSTIC<br />
android.permission.DISABLE_KEYGUARD<br />
android.permission.DUMP<br />
android.permission.EXPAND_STATUS_BAR<br />
android.permission.FACTORY_TEST<br />
android.permission.FLASHLIGHT<br />
android.permission.FORCE_BACK<br />
android.permission.GET_ACCOUNTS<br />
android.permission.GET_PACKAGE_SIZE<br />
android.permission.GET_TASKS<br />
android.permission.GET_TOP_ACTIVITY_INFO<br />
android.permission.GLOBAL_SEARCH<br />
android.permission.HARDWARE_TEST<br />
android.permission.INJECT_EVENTS<br />
android.permission.INSTALL_LOCATION_PROVIDER<br />
android.permission.INSTALL_PACKAGES<br />
com.android.launcher.permission.INSTALL_SHORTCUT<br />
android.permission.INTERNAL_SYSTEM_WINDOW<br />
android.permission.INTERNET<br />
android.permission.KILL_BACKGROUND_PROCESSES<br />
android.permission.LOCATION_HARDWARE<br />
android.permission.MANAGE_ACCOUNTS<br />
android.permission.MANAGE_APP_TOKENS<br />
android.permission.MANAGE_DOCUMENTS<br />
android.permission.MASTER_CLEAR<br />
android.permission.MEDIA_CONTENT_CONTROL<br />
android.permission.MODIFY_AUDIO_SETTINGS<br />
android.permission.MODIFY_PHONE_STATE<br />
android.permission.MOUNT_FORMAT_FILESYSTEMS<br />
android.permission.MOUNT_UNMOUNT_FILESYSTEMS<br />
android.permission.NFC<br />
android.permission.PERSISTENT_ACTIVITY<br />
android.permission.PROCESS_OUTGOING_CALLS<br />
android.permission.READ_CALENDAR<br />
android.permission.READ_CALL_LOG<br />
android.permission.READ_CONTACTS<br />
android.permission.READ_EXTERNAL_STORAGE<br />
android.permission.READ_FRAME_BUFFER<br />
com.android.browser.permission.READ_HISTORY_BOOKMARKS<br />
android.permission.READ_INPUT_STATE<br />
android.permission.READ_LOGS<br />
android.permission.READ_PHONE_STATE<br />
android.permission.READ_PROFILE<br />
android.permission.READ_SMS<br />
android.permission.READ_SOCIAL_STREAM<br />
android.permission.READ_SYNC_SETTINGS<br />
android.permission.READ_SYNC_STATS<br />
android.permission.READ_USER_DICTIONARY<br />
android.permission.REBOOT<br />
android.permission.RECEIVE_BOOT_COMPLETED<br />
android.permission.RECEIVE_MMS<br />
android.permission.RECEIVE_SMS<br />
android.permission.RECEIVE_WAP_PUSH<br />
android.permission.RECORD_AUDIO<br />
android.permission.REORDER_TASKS<br />
android.permission.RESTART_PACKAGES<br />
android.permission.SEND_RESPOND_VIA_MESSAGE<br />
android.permission.SEND_SMS<br />
android.permission.SET_ACTIVITY_WATCHER<br />
com.android.alarm.permission.SET_ALARM<br />
android.permission.SET_ALWAYS_FINISH<br />
android.permission.SET_ANIMATION_SCALE<br />
android.permission.SET_DEBUG_APP<br />
android.permission.SET_ORIENTATION<br />
android.permission.SET_POINTER_SPEED<br />
android.permission.SET_PREFERRED_APPLICATIONS<br />
android.permission.SET_PROCESS_LIMIT<br />
android.permission.SET_TIME<br />
android.permission.SET_TIME_ZONE<br />
android.permission.SET_WALLPAPER<br />
android.permission.SET_WALLPAPER_HINTS<br />
android.permission.SIGNAL_PERSISTENT_PROCESSES<br />
android.permission.STATUS_BAR<br />
android.permission.SUBSCRIBED_FEEDS_READ<br />
android.permission.SUBSCRIBED_FEEDS_WRITE<br />
android.permission.SYSTEM_ALERT_WINDOW<br />
android.permission.TRANSMIT_IR<br />
com.android.launcher.permission.UNINSTALL_SHORTCUT<br />
android.permission.UPDATE_DEVICE_STATS<br />
android.permission.USE_CREDENTIALS<br />
android.permission.USE_SIP<br />
android.permission.VIBRATE<br />
android.permission.WAKE_LOCK<br />
android.permission.WRITE_APN_SETTINGS<br />
android.permission.WRITE_CALENDAR<br />
android.permission.WRITE_CALL_LOG<br />
android.permission.WRITE_CONTACTS<br />
android.permission.WRITE_EXTERNAL_STORAGE<br />
android.permission.WRITE_GSERVICES<br />
com.android.browser.permission.WRITE_HISTORY_BOOKMARKS<br />
android.permission.WRITE_PROFILE<br />
android.permission.WRITE_SECURE_SETTINGS<br />
android.permission.WRITE_SETTINGS<br />
android.permission.WRITE_SMS<br />
android.permission.WRITE_SOCIAL_STREAM<br />
android.permission.WRITE_SYNC_SETTINGS<br />
android.permission.WRITE_USER_DICTIONARY<br />
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-6935676957104067252013-08-27T10:52:00.000+08:002013-08-27T10:52:27.686+08:00軍旅雜記 #FINAL事隔多月,一下子就進入軍旅雜記系列的最後一篇,寫這個系列重點在於想讓自己這十一個月留下些什麼,而不是完完全全空白的一段時間,人生處處是學習的機會,就算在國軍,終究會看到些什麼、體會到什麼,一切端看你自身的心境如何,有人十一個月撐得很辛苦,有人可能就還好,對我來說,感覺上其實是也無風雨也無晴的十一個月,這裡想寫的是針對一些事的體會,希望對於未來從軍的人能有一些幫助。<br />
<br />
<ul>
<li><b>你拗我、我拗你</b><br />從軍後才開始聽到「拗」這個字眼,到底什麼是拗呢?簡單 講就是找你做事但沒有回報的一種行為,一般比較容易發生在上對下的狀況,換言之,就是容易學長拗學弟、士官拗阿兵哥、軍官拗阿兵哥等等,譬如說:<br />學長:「這個你幫我做一下」<br />學弟:「喔好」<br />(於是學弟開始做得半死,而學長開始找人聊天)<br />學長:「啊你這個要這樣做才對啊」<br />學弟:「……」<br />事情過後他只覺得這是應該的,完全沒有要感謝的意思,這個問題很大部分來自於軍中學長學弟制的存在,所以長久下來,「拗」這個字眼變得相當的負面,一天到晚總是會聽到有人在說誰又在拗誰了等等,在我個人的觀點,這種要求他人做事而將之視為理所當然的想法是相當危險,若是這種思維充斥在現今的社會上,則人人都不願意幫助彼此,那這個社會就會向下沉淪而無法自拔,人和人應該互相才能使生活更好。</li>
<li><b>愛情&親情</b><br />人一輩子只有這麼十一個月就當兵,而唯獨在這一段時間感情生變才被稱為兵變,而我就是那些被兵變的人們中的一位,新訓三十天後,一段三年的感情就結束了,在軍中要面對感情的問題很不容易,因為本來兵變就夠煩了,結果又加上軍中一堆鳥事,其實真的很不舒服,但另一方面來說,我覺得在軍中要聯繫一段感情也是相當不容易,記得在軍中有人幾乎是每天打給自己的女朋友,在我的立場這樣每天打是不太可能的事,而在當兵的人放假也是排休,不一定能和女朋友的時間搭上,種種因素使得和女朋友出去約個會只怕都不容易,長久下來,一個沒處理好可能就分手了,這也是為什麼軍中被兵變的比例其實真的是不小,軍中曾有人這麼說:「男人當兵十一個月就和女人懷胎十一個月一般,其中的痛苦只有當事人最知道」,能夠做到不離不棄的人真的很偉大。<br />另一方面,在當兵期間我覺得親人的鼓勵很重要,也可能是因為我現今的朋友群大部分都在台北,所以放假期間找朋友玩的機會相對也就小,但放假時在家,親人能夠給予的幫助很多,而且我又遇到感情的問題,人還是需要別人的關心才能走出生命中的幽谷,<br />因此放假時多和家人聚聚吧。</li>
<li><b>人際</b><br />當兵時人際關係很重要,畢竟是和一群人常常24小時相處,若是一個不好可能就會被人在背後說話,搞得自己的生活變得烏煙瘴氣,整體來說,我會覺得在軍中就是要和人保持一定程度的關係,而在此同時也要能夠保持低調的本質,除非你有什麼目的,不然在軍中能夠保持低調是一件好事,雖然有一些爽差就不會落到你身上,但相對也不容易一天到晚被人抓去做事,換言之,不是大起大落就是毫無變化,哪一種好就看你自己的選擇了。</li>
<li><b>自由</b><br />有人說當兵很爽,薪水高放假多,這時我們當兵的人就會說,不然你來當啊?這時得到的都是一陣沈默,就算條件再好,終究當兵讓人不快樂,再加上現今社會對於軍人的社會地位也頗低,加上洪案之後就更加悽慘了,我個人覺得當兵最大的問題在於沒有自由,老話一句:「愛情誠可貴,健康價更高,若為自由故,兩者皆可拋」,軍人的自由是受限的,不論你再怎麼去擴大,空間終究只有這麼大,所以,當兵時最讓我印象深刻的,是重新認知到擁有完全的自由是多麼重要的事,若是給我100K要我過這樣的生活,我想還是不會想要,這就是為什麼過去有那麼多為了爭取自由而產生的運動。</li>
</ul>
言盡於此,其實也只挑了個人覺得比較重要的幾個點來說,當兵的體會是從負面的事件來提煉出正面的能量,因此不論你的役期有多長,當兵時一定要帶著一個樂觀的心,凡事不要太計較,適時為自己的權益發聲,日子很苦,但還是得撐下去,每天過得是好是壞是由自己決定,最後留下我學長入伍前跟我說的一句:「當兵什麼都是假的,退伍才是真的。」<ul>
</ul>
Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-21433449693876721862013-08-14T11:44:00.002+08:002013-08-24T12:27:38.965+08:00[Archlinux] Wireless connect using commands<div class="separator" style="clear: both; text-align: center;">
<a href="http://blog.hozzamedia.com/wp-content/uploads/2012/07/archlinux-logo-dark-1200dpi.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="http://blog.hozzamedia.com/wp-content/uploads/2012/07/archlinux-logo-dark-1200dpi.png" width="200" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
這篇文章主要是在談如何使用指來達成無線連線的目的,主要支援沒有密碼及WEP加密的無線網路</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>第一步:</b></div>
<div class="separator" style="clear: both; text-align: left;">
先確定網卡的驅動程式是有安裝且在運作的,使用指令:</div>
<blockquote class="tr_bq">
$lspci -k</blockquote>
<div class="separator" style="clear: both; text-align: left;">
大致上會看像這樣的訊息(內容因個人無線網卡不同而不同)</div>
<blockquote class="tr_bq">
<span style="font-size: x-small;">06:00.0 Network controller: Intel Corporation WiFi Link 5100</span><br />
<span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> Subsystem: Intel Corporation WiFi Link 5100 AGN</span><br />
<span style="font-size: x-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span> <span style="color: red;">Kernel driver in use: iwlwifi</span><br /><span class="Apple-tab-span" style="white-space: pre;"> </span> Kernel modules: iwlwifi</span></blockquote>
<div class="separator" style="clear: both;">
確定Kernel driver in use那一行有存在就可以了</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<b>第二步:</b></div>
<div class="separator" style="clear: both;">
使用ip link的指令來確定無線網卡的interface是有被建立起來的</div>
<blockquote class="tr_bq">
$ip link</blockquote>
<div class="separator" style="clear: both;">
如果有的話會看到比如說wlan0, wlp3s0,ath0之類的在最後一項,接著將它up起來</div>
<blockquote class="tr_bq">
$ip link set wlp3s0 up</blockquote>
<div class="separator" style="clear: both;">
<b><br /></b></div>
<div class="separator" style="clear: both;">
<b>第三步:</b></div>
<div class="separator" style="clear: both;">
再來就是重點的連線部分了,主要我們使用iw這個指令來達成,先掃描看看有沒有無線網路</div>
<blockquote class="tr_bq">
$iw dev wlp3s0 scan</blockquote>
<div class="separator" style="clear: both;">
掃描完後把出現的無線網路的essid記下來,接著就可以連線了,對於沒有加密的網路</div>
<blockquote class="tr_bq">
$iw wlp3s0 connect <i>wifi_essid</i></blockquote>
<div class="separator" style="clear: both;">
如果是用WEP加密的話</div>
<blockquote class="tr_bq">
$iw wlp3s0 connect <i>wifi_essid</i> key 0:<i>wifi_key</i></blockquote>
<div class="separator" style="clear: both;">
如果是WPA的話</div>
<blockquote class="tr_bq">
$wpa_supplicant -i wlp3s0 -D nl80211 -c <(wpa_passphrase <i>wifi_essid</i> <i>wifikey</i>)</blockquote>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<b>第四步:</b></div>
<div class="separator" style="clear: both;">
以上都沒問題的話就是最後一步使用dhcpcd了,現在dhcpcd似乎預設會先搜尋IPv6,目前使用率並不高,所以直接使用IPv4的模式會比較省事</div>
<blockquote class="tr_bq">
$dhcpcd -4 wlp3s0</blockquote>
<div class="separator" style="clear: both;">
最後可以用ping測試一下有沒有成功連上</div>
<blockquote class="tr_bq">
$ping 8.8.8.8</blockquote>
<div class="separator" style="clear: both;">
<b>結語:</b></div>
<div class="separator" style="clear: both;">
每一次對archlinux進行重灌或更新,網路是一定不可以少的,結果最近重灌卻常常一開始就卡在網路連不上,也是蠻無言,到最後還是用指令連上網比較可靠<span style="color: #444444; font-family: arial, sans-serif; font-size: x-small;"><span style="line-height: 16px;">。</span></span></div>
<div class="separator" style="clear: both;">
<span style="color: #444444; font-family: arial, sans-serif; font-size: x-small;"><span style="line-height: 16px;"><br /></span></span></div>
<div class="separator" style="clear: both;">
<span style="color: #444444; font-family: arial, sans-serif; font-size: x-small;"><span style="line-height: 16px;">參考資料:</span></span><a href="https://wiki.archlinux.org/index.php/Wireless_Setup">https://wiki.archlinux.org/index.php/Wireless_Setup</a></div>
Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-75293715029651083602013-04-22T19:46:00.003+08:002013-04-22T19:49:50.809+08:00[Archlinux] thunar trash can : "Unable to find or create trash directory"<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDJDKSpKdd3sHHZVuVYKwU5Q_TjSa_2OzeDJtTvbHrrUYIleLTx6Hiyy27jx_E3DJRzPZ8s9ri_4YEiCDkkSYQlXRmXRInveNOJ7UlpNKcw7y1bynOjx6AdxlkcY4Wnw6SpaQvnDgruqQ/s1600/2013-04-22--1366629955_635x247_scrot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="124" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDJDKSpKdd3sHHZVuVYKwU5Q_TjSa_2OzeDJtTvbHrrUYIleLTx6Hiyy27jx_E3DJRzPZ8s9ri_4YEiCDkkSYQlXRmXRInveNOJ7UlpNKcw7y1bynOjx6AdxlkcY4Wnw6SpaQvnDgruqQ/s320/2013-04-22--1366629955_635x247_scrot.png" width="320" /></a></div>
在使用thunar時會發現有時刪檔到Trash Can時會出現這個訊息,原因是ntfs的分割區的權限有問題,編輯fstab就可以了<br />
<pre>$sudo vim /etc/fstab
</pre>
找到自己掛載ntfs分割區的部分,加上umask=077,uid=1000<br />
如: <br />
<pre>/dev/sdb1 /media/Mine ntfs-3g defaults 0 0</pre>
改成<br />
<pre>/dev/sdb1 /media/Mine ntfs-3g defaults,umask=077,uid=1000 0 0</pre>
如此一來問題應該就解決了<br />
參考:<a href="https://bbs.archlinux.org/viewtopic.php?id=114774">https://bbs.archlinux.org/viewtopic.php?id=114774 </a>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-77235183479170121762013-04-22T18:48:00.001+08:002013-04-22T18:48:14.324+08:00軍旅雜記#6對於一個月只放兩次假的我來說,最近總開玩笑:<br />
<br />
「只要再放個七次假左右就退伍了」<br />
<br />
痛苦會過去,美會留下來,就算之前再怎麼不快樂,現在距離退伍總算也只剩下四個月左右的時間了,下次再放完假也就差不多要破百了,回到台北生活的日子不遠矣啊......<br />
<br />
<span style="font-size: large;"><b>#1 學長學弟制</b></span><br />
<br />
其實對於我們單位來說,學長學弟制似乎有被正式地要求去除,不過軍中就是這樣,明講不行的事其實私底下還是偷偷來,只是不會像以前那麼嚴重就是了;記得到部的第一天開始就先被要求要對幹部和學長有禮貌,也變成我們從一開始就存在的上下關係。<br />
<br />
正面的角度來看,這個制度的出現可能來自於早期剛進部隊時,學弟由於什麼都還不會,很多事情都需要學長來教學,也因此學弟會幫學長做事做為回報,就如同古時拜師學藝的模式一般。<br />
<br />
負面的角度來看,事情上這是一種從一開始就確立的不對等關係,在不知不覺間我們的奴性都會被激發,導致不問對錯,只問資歷的問題,這使得資歷夠深的人就顯得像古時的皇帝一般,只因為他夠老,所以說什麼都對,做什麼都可以。<br />
<br />
其實我認為學長學弟制是一種管理上所出現的制度,想像部隊中的管理階層其實是一種金字塔的結構,每一個層級之間的人數差距是相當大的,平均下來一個層級的人所要管理的下一層級的人可能有十個人以上,在這種狀況下,再分層是一種解決方法,因此在各層級中,開始出現由資歷進行再分層的方式,並藉由上層將部分權力分享給下層的方式來達到管理的目的,舉個例子來說吧,一個下士在管理一群兵的時候,是可以接受資歷深的上兵對於二兵的管教,甚至於是早期的不當管教,如此一來作威作福的上兵幫下士省去了很多管教上的麻煩,而上兵則得到了權力,人都是喜歡權力,因此皆大歡喜。<br />
<br />
學長學弟制便如同一種毒一般,在不知不覺我們就會中了這個毒而不自知,我也曾經想變成一個自己所討厭的學長,而忘記了何謂公平,為何要成為自己所討厭的人呢?<br />
<br />
<span style="font-size: large;"><b> #2 黑暗的社會</b></span><br />
<br />
當兵前就有人說,軍中的社會是最黑暗的,是的,軍中的社會真的很黑暗,每個人要的都只是能過得好就好,沒有互助的概念,沒有互相體諒的概念,一切都從自己的利益出發,這就是軍中的社會,也許一小部分是因為那些資歷較深的志願都是高中畢業就進入軍中,所以在思想上就顯得不成熟許多,結果概念由上而下,大家有樣學樣,最後整個"社會"就變得汙濁不堪,若是在其中沒有把持住自我的原則,則會顯得沒有原則,總是只為了讓自己爽就可以犧牲他人,若是夠老,就時常要學弟做東做西的,若是不夠老,就裝死什麼都不做,人人如此,那又怎麼能進步呢?再者軍中是團隊的生活,很多事情就是發生了也找不到凶手,最基本的就是馬桶不沖水這種小事,反正沒有人會承認也就來個"拉"後不理,但實際上這些行為都會成為共業,社會中的free rider的名額是有限的,當佔有的人數過多之時,遲早會使不明顯的問題浮現臺面,到時就會變成全員共同犧牲了,也就是連坐法。<br />
<br />
要感謝那些給予我們考驗的人,因為他使我們變得更好<br />
<br />
當兵這段時日真的多看到了人性的黑暗面,也了解到自己其實也是一樣,在利益前會迷失了自我,學生時期的環境真的很簡單單純,努力渡過剩下的日子,回到學生再度努力! Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-89178436202836329452013-02-08T22:26:00.001+08:002013-02-08T22:26:55.344+08:00軍旅雜記#5這一次是當兵期間最長的一次休假<br />
也是長達九天的年假<br />
有趣的是在年假的一開始就狂玩了兩天半<br />
後面的幾天就幾乎都拿來養病了...<br />
<br />
#1<br />
年假前的其實也只在部隊待了五天,比較不同的是這五天由於之前營部的人想要來督導,搞得我們全連在月底時管休,最後在來的前三天又突然說不來了,搞得全連的人在沒有管休的情況下卻是全員到齊,渡過十分擁擠的五天,當兵嘛,只能說不意外了...<br />
其中一天中午,當我們如同往常吃著中餐時,突然看著四周的袍澤(軍中很喜歡用這個詞),看著看他們的眼神,那種空洞讓人感到害怕,過去的教育總是告訴我們要追求目標,擁有夢想,但在這裡一切希望彷彿不再存在,只剩下行屍走肉的人們,每天總是在混日子中渡過,只有在放假的時候才重新活過來一般,令人害怕的不是他人,而是害怕自己有一天也成為他們的一份子,在軍中開始迷失自我,不再是自己所認為的自己,戒之慎之<br />
<br />
#2<br />
算一算也是快到了自己將升級為一兵的日子,換言之,也是自己將渡過一半軍旅生活的時候,回首時總是說時間過得很快,但實際上卻是在每一分每一秒上感到煎熬,近來和朋友聊天,最常做的我想就是聊起兵變的故事吧,一次又一次的反覆述說,也許因此習慣了,但一次又一次的回想那個時刻,受到傷害還是我自己,而自己和外界的脫節,也總是在每一次的閒聊中不斷出現,終究自己是在當兵,就像在另一個社會中一般,對於這個社會中的事情的了解也就有限了,還要很久,自己才能回到自己所喜愛的生活中重新開始,相信也會因此更加珍惜和努力<br />
<br />
#3<br />
生日剛過去,其實對於這一年的生日不知道該說是變好了還是變差了,很難得的是軍中的弟兄及畢舞行銷部的大家願意為我慶生,不過改變的是在網路上倒是沒什麼人在祝賀了,也許是因為我刻意為之,不過少了以前熟識的朋友的祝福終究是有些失落,同時我也是有生以來第一次在生日時被砸派,軍中的大家總是玩得蠻大的,無論如何,有人願意記得&慶祝自己的生日還是令人相當愉快的,因此還是得謝謝每一個人,同時對於22歲的自己,我想說的是,因為你的勇敢,才能造就更加不同的我,軍旅生活終究會過去,而我會更加勇敢面對以後的人生<br />
<br />
23歲的我,晚了兩天的生日快樂Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com3tag:blogger.com,1999:blog-4399669551066997418.post-63036551767975245112013-01-19T15:52:00.001+08:002013-01-19T15:52:13.002+08:00軍旅雜記#4<center>
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="http://www.youtube.com/embed/Wrbjahfg8RM" width="560"></iframe></center>
<br />
<br />
<br />
今天就是當兵滿四個月的日子了,想到過去總說「痛苦會過去,美會留下來」就是這樣感覺吧,一邊覺得每天都是煎熬,時間還是一邊慢慢走過去,對於大學生來說,一個學期又過去了,對於一個當兵的男孩來說,役期還過不到一半,剩下的路還很長,走下去是唯一的選擇。<br />
<br />
#1<br />
有時會開始回想起過去新訓的日子,其實新訓比起現在來說痛苦很多,做不完的事情,沒有自由時間,每天為了鑑測努力,卻又不知道在努力什麼,但事實上新訓也有令人感動的地方,鑑測的項目有3000公尺、伏地挺身25下/2分鐘、仰臥起坐25下/2分鐘、手榴彈25公尺投遠、打靶、單戰、學科等,就一開始來說,我有一半的項目幾乎是完全不行,但在那一個月的時間裡,不斷練習的結果讓我好不容易可以通過測驗,整個過程就像是過去那些陳腔濫調的勵志電影一般,在鑑測的最後全部順利通過,雖然說句實在話,鑑測的成績對我們新兵來說是毫無用處,最後有可能從中得利的我想還是只有新訓單位的長官吧,但完成一件自己不擅長的事還是令人相當愉悅的。<br />
<br />
#2<br />
回到部隊的事,感覺自己常常做一些奇怪的決定,因此也常常遇到一些奇怪的狀況,有誰當兵可以當到遇到單位要被裁掉呢?我想我是其中一個,我所在的單位在今年解戰了,於是在七月時我就必須換到其他單位去了,這種狀況我想很少人有機會遇到,但就是遇到了,結果是得在快退伍的一個半月前到新的單位去適應,到時的生活想必又是另一種感受。<br />
<br />
#3<br />
這一次收假回來收到了以前實習單位不再續聘的消息,也算是正式從一份工作中結束,個人算是蠻念舊的類型,常常一件事一做就是好長一段時間,像過去在課活組一工讀就是兩三年,時間之長甚至超越一些正式的哥姐,就結果來說,失去了一份可能的收入是令人滿感到遺憾的,不過有失才有得,未來希望能得到更好的機會了。<br />
<br />
#4<br />
對我來說,當兵這一段時間收獲最大的大概就是愛情和親情方面,在愛情方面可以說是經歷很多的波瀾,心情也經過了很多轉折,愛我的我愛的,都有很大的變動,但唯一不變的是我還在當兵的這個現實= =,所以一切也只能等到我退伍之後再說了,只能說緣份真的是很奇妙的東西。<br />
<br />
又很淩亂了打了一堆東西,單純是一種記錄,有一天自己回首這一切時,是會帶著什麼樣的心情呢?Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-90514978381972721422013-01-15T07:58:00.002+08:002013-01-15T08:00:02.087+08:00[轉] 被兵變男孩的心聲<br />
妳曾經在電話中哭訴著說妳現在傷心難過 而我人在哪? (當兵阿)<br />
<br />
那拎北被學長定的時候妳在哪裡啊?<br />
<br />
妳徬徨無助沒辦法的時候 問我人在哪? (當兵阿)<br />
<br />
那拎北跑三千跑得快死掉的時候妳在哪裡啊?<br />
<br />
我知道現在是學長陪妳解決妳的問題 陪伴著妳走過傷心難過的時刻...<br />
<br />
而我<br />
<br />
也是學長在陪我..<br />
<br />
只是妳學長是帶妳去吃飯看電影,我學長整天問候我老爸老媽,笑我身上很臭有菜味,還三不五時就問我會不會立正站好卵蛋夾好手貼緊<br />
<br />
而妳<br />
<br />
心動搖了<br />
<br />
彼此離開於火車站時說的話 妳就忘了吧...<br />
<br />
嗯,妳和學長出去的時候就忘了吧?<br />
<br />
拎北被玩的跟狗一樣的時候可是靠當時的話撐著爬過來的<br />
<br />
我說女生啊...<br />
<br />
男生在當兵的時候不要老是用爛藉口分手好嗎?<br />
<br />
一個大男孩離鄉背景,到了一個陌生的環境和一大堆陌生的人相處,新訓洗澡的時候還要和陌生的人坦誠相見,妳知道男孩心裡的恐慌嗎?<br />
<br />
妳知道月台分別之後,妳和男孩就過著天壤之別的生活嗎?<br />
<br />
妳吃飯可以吃妳喜歡的菜,男孩卻啃著苦的要死的青菜,運氣差一點還得吃菜梗<br />
<br />
妳吃飯手可以撐著頭漫不經心的嚼,男孩卻流著汗板凳坐三分之一、以碗就口<br />
<br />
妳邊唱著歌邊洗澡,男孩卻拼著老命洗著水愈來愈冷的戰鬥澡<br />
<br />
妳在舒服的冷氣房裡睡覺,男孩卻在熱死人的汗水中睡著<br />
<br />
妳開開心心的和朋友逛著街,男孩卻在部隊行進中擔心著自己的腳步沒對好<br />
<br />
妳看著電視狂笑的時候,男孩卻害怕自己軍歌沒背好、東西學不好跟不上同袍<br />
<br />
妳整天喊著男友在當兵好無聊,男孩卻一有機會碰到公共電話就在排隊的催促聲中立刻打給妳傻笑<br />
<br />
下部隊後<br />
<br />
妳可以認識新的朋友,男孩卻被迫認識一個新的陌生環境<br />
<br />
當妳把包包裡的東西倒出來換到另一個新買的包包,男孩卻滿頭大汗的在學長倒數聲中把大背包裡被倒出來的東西拼命撿回背包<br />
<br />
妳看著小說時,男孩看著用槍時機、用槍要領、衛兵守則..等等,背一大堆聽都沒聽過的字眼跟東西<br />
<br />
妳可以哈哈哈的大笑,男孩卻整天「是、是、是」的立正站好<br />
<br />
妳鬧鐘響了可以再偷睡個懶覺,男孩卻要驚醒於起床號<br />
<br />
妳起床可以先看一下電腦,男孩卻在寢室裡小心翼翼的打掃深怕吵到學長睡覺<br />
<br />
妳可以和妳喜歡的朋友出去,男孩卻要被迫和欺負他的學長朝夕相處、同寢睡覺<br />
<br />
妳被討厭的人罵可以轉身走掉,男孩卻要在幹譙聲中夾著卵蛋立正站好<br />
<br />
妳可以舒舒服服的一覺到天亮,男孩卻要在半夜被挖起來站哨<br />
<br />
妳可以在星期四的早晨看著娛樂百分百,男孩卻要他媽的看什麼莒光園地<br />
<br />
妳和朋友去鬼屋探險尖叫,男孩卻要在無人的漆黑角落站哨,可以害怕但不能叫<br />
<br />
妳和朋友去看夜景,男孩卻對著圍牆嘆息,想著何時才能出去<br />
<br />
女孩,別再說什麼妳傷心難過、孤單寂寞時需要人陪了..<br />
<br />
男孩在部隊裡受的罪,絕對不比妳在外面來得少,他也會想哭也會需要有人陪..<br />
<br />
而妳<br />
<br />
還比他多了最重要的「自由」,當妳看著天空時,是雲;當他看著天空時,是妳..<br />
<br />
他忘不了那個在月台流淚揮手的妳,而妳卻忘了在車廂裡紅了眼眶一直比著快回去的他<br />
<br />
別再用不公平的理由來說分手了,那只是妳自私的藉口<br />
<br />
大方的承認妳就是他媽的<br />
不甘寂寞、心性未定、生理需求、犯賤、愛對狼照、水性楊花、說話不算話、背信忘義、沒男人會死<br />
<br />
妳以為當兵中說分手會比當兵前說好過?還是妳以為我人在軍中揍不到妳就可以屁股蹺高高、跩跩說分手?<br />
<br />
那如果妳懷孕中我和妳說我有極大的生理需求,所以我要去偷吃或者和妳分手,妳會爽嗎?會Happy嗎?會不會好心的祝福我放我走?<br />
<br />
幹!做人不要太自私<br />
<br />
妳懂不懂妳的背叛對一個當兵中的男生來說是多痛的打擊!!<br />
<br />
萬一他又剛好很菜,每天除了要學東西,還要被定又要承受失戀的痛苦,重點是還沒自由<br />
<br />
更別說出去找妳好好談清楚了,妳懂那種內心的煎熬嗎?是妳的話妳不會崩潰嗎?<br />
<br />
<br />
原文網址: 【被兵變男孩的心聲】(N) http://appnews.fanswong.com/show.php?id=312695&NANCY#ixzz2Hzu2zoK1Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-492512242282744312012-12-22T10:18:00.004+08:002012-12-22T10:18:38.598+08:00軍旅雜記#3感覺自己就不是一個很會寫作的人<br />
很難得可以將這個系列寫到第三篇(茶)<br />
<br />
由於自己當兵的地方是在一個鳥不生蛋的山上<br />
相對來說風景的可看性就高了一些<br />
目前為止看過美景有:<br />
<br />
1 半夜三點出去站哨時所看到的星空,第一次如此清楚看到北斗七星和數不清的流星<br />
2 下午跑步時所看到的夕陽<br />
3 早上站哨時一堆鳥在四周走動找食物,及有時會碰巧看到的老鷹<br />
<br />
風景之所以美不單是因為那個景象<br />
更重要的是當下的心情<br />
那些畫面不是可以用照相機拍下來的<br />
而是只能留在回憶裡不斷溫存:)<br />
<br />
-----<br />
<br />
軍旅生活至今已過了三個月左右<br />
而選擇先當兵雖然是個無悔的決定<br />
但相對也失去了不少東西<br />
大多數是屬於無形的<br />
比如和朋友相處的時光、一段以為可以一直走下去的感情<br />
雖然不見得都和當兵這個動作有關<br />
但總是在這個時間內所發生的<br />
一年後,我所面對生活是否能夠像過去一樣呢?<br />
又或者是變得更好或更壞呢?<br />
人生中的每一個轉彎後的風景都是無法預期的<br />
只好持續走下去才能知道答案<br />
<br />
每次回來放假都會不斷看著FB<br />
看看朋友們的近況<br />
當然並不是所有的近況都令人如此愉快<br />
有一些真的只是自己調適不過來<br />
以為自己早已超然<br />
但實際上還是個不懂成長的小屁孩<br />
不得不吐嘈如此不成熟的自己<br />
有時會想不如就不看吧<br />
但人就是這樣<br />
還是會不斷想知道別人的八掛<br />
自己選擇也就只好自己承受了(茶)<br />
<br />
回頭談談在軍中的生活吧<br />
說句實在話大家對於台大生這個身份還是會有一些多餘的想像<br />
可能是因為志願役士兵大多數是高中畢業就簽下去吧<br />
包括會問一些「台大生是不是都怪怪的?」「身為台大生會不會很驕傲?」之類的<br />
其實我覺得台大生就是很一般的大學生<br />
至多就是資源享受的比較多、機會比較多<br />
但不懂得去接觸的話其實就是沒什麼差<br />
平常心對待其實就足夠了<br />
反觀有些兵或幹部反而認為因為自己是高中畢業<br />
所以什麼事搞不懂做不好都沒關係<br />
其實這種想法反而會阻礙自己的進步<br />
一點好處都沒有<br />
學歷在軍中一點用都沒有<br />
所有人都是在同一個起點向前跑<br />
先跑的就先贏<br />
<br />
最後得提一下一個很有趣的現象<br />
軍中的人大多數都很愛車子<br />
幾乎所有人都對車字的型號及配備如數家珍<br />
而對我來說<br />
因為家中從小就沒有車子的存在<br />
對於汽車的認知幾近為零<br />
所以對於這種環境也就顯得格格不入<br />
而軍中的薪水是否能夠承載買車的需求呢?<br />
這就見人見智了<br />
<br />
這個系列文也不知道能夠堅持到什麼時候<br />
而且寫得還蠻亂的其實<br />
也許也只有我自己做為一個記錄在看吧<br />
希望能夠堅持寫下去Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-51656245634630121522012-12-08T19:51:00.004+08:002012-12-08T20:38:19.631+08:00軍旅雜記#2總算是又放假了<br />
在部隊的每一天總是讓人覺得漫長<br />
從12/1開始<br />
不論是衛哨、戰待、值班的勤務都正式開始接觸<br />
同時也經歷了第一次自己一人開PAR做每檢等等<br />
要學習的東西還是不少<br />
因此每天還是維持著沒什麼自己時間的狀態<br />
希望之後能多一些時間<br />
<br />
這一段時間裡最有趣莫過於罰寫事件了<br />
<br />
罰寫事件事的起因是因為部隊裡有進行衛哨守則的考試,考試一共考四題,每一題的字數約莫五十字左右,採默寫的方式,而考試過後若是有任何一題錯誤,該題就必須罰寫二十次,若是沒有罰寫完則沒有辦法放假,整體來看沒什麼問題,但是在考試當下,我們才突然發現,四題中的第四題是我們不知道答案的題目(事先有給題庫讓我們背),於是理所當然地有不少人就很無言地空下第四題黯然交卷……<br />
<br />
結果運氣不好的是,衛哨守則的考試正好安排在不少人放假前的兩天,加上改考卷的時間,等同於在放假前一天才會知道自己錯了幾題,而有鑑於至少錯了第四題,也就至少要寫50x20=1000字的罰寫,每個人只好無所不其極地找時間寫,我自己也是犧牲掉了午休及許多零碎的時間來完成罰寫,說句實在話,整個狀況是十分不合理的,但為了自身的假期,還是只能默默地把它寫完。<br />
<br />
再來重點來了,強者我朋友由於放假前兩天大夜值班,直到放假前一天的下午三點起來後才知道事情的嚴重,再加上當天有點忙碌,一直到晚上九點才拿到自己的考卷開始罰寫,部隊就寢的時間是十點,一個小時人要將罰寫完成理論是完全不可能的,而隔天早上的六點就要放假了,本來看樣子他是只能等隔天早上寫完再放假了,結果想不到他竟突出奇招,在半夜一點半起床,一人偷偷走到廁所,以馬桶為桌椅,一路奮戰到淩晨四點,完成了自己的罰寫,再默默躺回床上,一切都是如神不知鬼不覺,只能說放假的魅力真是將人的潛力完全激發出來啊(遠目)。<br />
<br />Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-29830695627696213592012-11-23T16:11:00.000+08:002012-11-23T16:11:00.368+08:00等待男孩一個人在門邊的桌子等著。<br />
<br />
一家咖啡店裡,男孩一個人坐著,明明不應該是坐立難安的環境,四周的人也沒在注意他,但他就是一直無法靜下心來,桌上有著他剛剛點的咖啡,裡面其實也沒剩多少了,依男孩的習慣只要一口就可以喝完,但他留下那一口的咖啡只為了等待,不讓店員覺得他想霸著那個位子,其實只是他自己的自我意識過剩,在現在這個時代,只靠一杯咖啡就坐在店裡待了一個下午的人是大有人在,但無論如何,他還是選擇做他自己,依循著自己那不知所以然的原則而活著。<br />
<br />
等著,時間緩緩地前進。<br />
<br />
男孩發現自己沒有任何偽裝,於是他起身了,走到不遠的書架上,看著書架上的書,大部分是一些過期的雜誌,他並沒有看任何雜誌的習慣,看著書本的名稱卻不知該如何挑起,男孩有些慌張,生怕挑了奇怪雜誌讓人誤會,只得站在書架前不動。<br />
<br />
「你怎麼在這?」<br />
<br />
女孩的聲音從男孩的背後傳出,男孩這時的心裡如萬馬奔走一般,全身都緊繃了起來,有些不知所措,但他還是說了:<br />
<br />
「剛好在這裡喝著咖啡看個書,妳也是嗎?」<br />
<br />
「是啊,剛好要走了,拜拜。」<br />
<br />
「拜拜。」<br />
<br />
女孩離開了。<br />
<br />
男孩原本的緊繃和不安沒了,他走回了自己原本所待的桌子,喝完了最後一口咖啡,都涼了,但他毫不在意,收拾好自己的東西,結完帳,嘴角帶著微微的笑容,心跳不已的離開了咖啡廳,相信這一天都會有著好心情吧。 Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-11316046982758756582012-11-23T15:40:00.002+08:002012-11-23T15:41:23.336+08:00軍旅雜記#1至今當兵已兩個月多了<br />
<br />
經歷了新訓(37天)、營訓(3天)、二階訓(12天)<br />
<br />
現在已經正式下了部隊約四天左右<br />
<br />
認識很多不一樣的人 <br />
<br />
聊天中總是會聊到有關休學當兵的問題<br />
<br />
畢竟比較少會想到在考上研究所後就休學當兵這個選項<br />
<br />
大部分立即的反應都是:「為什麼不先唸完再當兵呢?」<br />
<br />
大致上有幾點是我目前有想到<br />
<br />
1. 暫時脫離學生生活<br />
<br />
首先是因為身體的因素,雖然就感覺上來說我算是病痛不多的類型,但是體力不好是確定的,而且大學又經常性的熬夜,說句實在話都是不小的傷害,利用在當兵這段時間將身體鍛練起來,對自己也比較好;再者就是身份的轉變,說句實在話,我一直覺得學生的身份一直是很好的防護牆,它使我們和社會整體是切割開來的,因為是學生我們似乎就一直被保護著,一直享受著某種程度的特權,有人說,軍中是最黑暗的社會,若是能夠經歷過最黑暗的環境,那就會更珍惜學生的生活,不會只是虛度生活。<br />
<br />
在我入伍一段時間後,真的就非常強烈的感覺到:<br />
<br />
<span style="font-size: x-large;">我想回去讀書啊啊啊!!!!</span><br />
<br />
而很慶幸的是我還有這個機會,反觀軍中大部分的弟兄都是要準備出社會工作,心中徬徨可想而知,有關工作的部分則跟我接下來的下一點有關了。<br />
<br />
2. 找工作可能相對容易<br />
<br />
這一點只是猜測,但試著想像IT界的日新月異,在雲端興起的一年前,你可能心中毫無雲端這個詞的認知,但在你當完兵的一年後,每個人都開始說雲端的好,雖然很多事情是無法在學校學習到是沒錯,但是若是一段時間和自己的專業領域脫離,個人是覺得重新上手還是需要一點時間,所以若是能在研究所結束後立刻進入職場,相對來說也會比較容易適應,同時做為學生會有比較多的機會進去公司實習,若是能在實習的同時建立人脈,如果表現良好的話,在我的觀點中,企業也會比較喜歡即戰力高的員工,就能提早獲得未來的工作機會,比起在和社會脫節一年後,拿著自己僅存的一張畢業證書找工作可能會簡單一些。<br />
<br />
3. 國家政策的不定性<br />
<br />
這個就要看一下新聞連結了<br />
<br />
<a href="http://tw.news.yahoo.com/%E7%A4%BE%E7%BE%A4%E6%96%B0%E8%81%9E-%E5%9B%9E%E5%BE%A9%E5%85%A9%E5%B9%B4%E5%BE%B5%E5%85%B5%E5%88%B6-%E6%81%90%E7%88%86%E5%85%A5%E4%BC%8D%E6%BD%AE.html">回復兩年徵兵制?恐爆入伍潮 </a><br />
<br />
雖然事情發生的可能性不大,但是總是有個不定性,比起在那裡忐忑不安,不如提早入伍把這個負擔給去除了,也比較不用擔心,而且目前來看募兵制真的很難短時間內順利推動,自己的命運還是能自己掌握比較快樂。<br />
<br />
<br />
比較值得提的可能就這三點,至於不選擇預官是因為沒考上,替代役是因為資格不符,研發替代役則是因為不想被公司簽強制性的三年約,其實也許他們會是更好的選擇,但人生就是這樣,沒辦法把每個選擇就走過一次,只能做下決定,然後承受後果。<br />
<br />
這次放假後相信部隊的生活也會漸趨穩定,只希望能夠充飽電並且平平安安退伍,並在未來的人生持續衝刺。Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-78090464942692881652012-08-29T06:15:00.001+08:002013-04-04T11:35:47.132+08:00[Linux] DarkstatDarkstat<br />
Packet Sniffer<br />
除了可以用來看自身的網路流量之外<br />
同時也可以知道和自己所連線的ip的hostname及相關資訊<br />
是一個輕量但功能相當完整的程式<br />
使用方法:<br />
$sudo darkstat -i [interface]<br />
ex:<br />
<blockquote class="tr_bq">
$sudo darkstat -i wlan0</blockquote>
順利啟動之後<br />
預設會在 http://0.0.0.0:667 看到記錄的結果Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-20730967050615742892012-01-28T17:08:00.006+08:002013-04-22T17:19:04.868+08:00[Blogger] SyntaxHighlighter參考來源:<a href="http://blog.lyhdev.com/2010/09/bloggersyntaxhighlighter.html">http://blog.lyhdev.com/2010/09/bloggersyntaxhighlighter.html</a><br />
Syntax Highlighter可以讓你在Blogger中顯示美觀的程式碼~<br />
安裝的方法<br />
<ul>
<li>首先在<b:skin><b:skin>前加入以下內容</b:skin></li>
</ul>
<pre class="brush: xml"><span style="font-size: x-small;"><!-- SyntaxHighlighter 3.0.83-->
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushColdFusion.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDelphi.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushErlang.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushGroovy.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJavaFX.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPowerShell.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushScala.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/></span>
</pre>
<ul>
<li>接著在</body>前加入以下內容</li>
</ul>
<pre class="brush: xml"><!-- SyntaxHighlighter 3.0.83-->
<script type='text/javascript'>
SyntaxHighlighter.all()
</script>
</pre>
<ul>
<li>之後要寫的話記得用 <pre> </pre>包起來,其中brush就是要填入語言的類別,詳請見官網: <a href="http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/">http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/</a></li>
</ul>
<pre class="brush: xml"><pre class="brush: groovy">
println 'Hello World'
println 1 + 2 + 3
</pre>
</pre>
同時由於在blogger上貼程式碼時需要先經過轉換,不然大於小於的符號會不見的~可以用這個網站來達成<br />
HTML Encoder:<a href="http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/Encode.aspx">http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/Encode.aspx</a><br />
Firefox使用者可以參考這一篇:<a href="http://blog.lyhdev.com/2010/08/bloggerhtmlhtml-encode-button-firefox.html">http://blog.lyhdev.com/2010/08/bloggerhtmlhtml-encode-button-firefox.html</a>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-87659733756481504722011-10-19T20:38:00.004+08:002012-01-28T16:34:07.430+08:00[Software] Synergy<br />
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
轉錄From: <a href="http://dj1020.posterous.com/synergy-pcmac" style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">http://dj1020.posterous.com/synergy-pcmac</a></div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<br />
介紹:<a href="http://toget.pchome.com.tw/category/network/tool/12397.html" style="background-color: white;">http://toget.pchome.com.tw/category/network/tool/12397.html</a><br />
<br /></div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="font-size: 12px;">使用前請先注意電腦是在同一個</span><b><span style="font-size: large;">區域網路(aka. IP前三碼相同)</span></b><span style="font-size: 12px;">下且是</span><b><span style="font-size: large;">連接同一個IP分享器</span></b></div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
然後,兩台電腦都要裝 Synergy 軟體才能用,但是 MAC 環境下要裝的軟體名字不太一下,</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
for Windows 叫 Synergy</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
網址:<a href="http://sourceforge.net/projects/synergy2/files/" style="color: #9b0e18; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;" target="_blank">http://sourceforge.net/projects/synergy2/files/</a></div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="background-color: #ffff99; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">for MAC 叫 SynergyKM</span></div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
網址:<a href="http://sourceforge.net/projects/synergykm/" style="color: #9b0e18; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;" target="_blank">http://sourceforge.net/projects/synergykm/</a><br />
<br />
Linux的話也叫synergy,不過command方面會分成synergyc(Client端)和synergys(Server端)</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<br />
確認 OK 以後,</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
我要知道你是要</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
1.用 PC 的鍵盤同時控制 PC、MAC (以PC為 Server 端)</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
還是 </div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
2.用 MAC 的鍵盤同時控制兩台 (以 MAC 為 Server )</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
我自己是用 PC 鍵盤控制兩台電腦啦,一台PC 裝 Windows 7 x64,一台 iMac,OS 是 10.5.8 (Leopard)</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
居然連64位元的Windows都可以用是我最高興的地方!</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
所以先講 狀況 1 的設定方法。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
假設你兩台電腦都已經裝好 Synergy 而且 位於同一個區域網路底下。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
我的 PC 端 IP 是 192.168.1.1 (可以打開 Synergy 後,點左下 info 的按鍵看到)</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
MAC ip 是 192.168.1.3 (系統偏好設定-->網路 再找一下就看到了)。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
打開 PC 上 Synergy,</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
點 Share this computer's keyboard and mouse (server) --> 以 PC 為 server 端。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
按 Screens 下面的 "+"</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Screen Name 可以隨便打,認得出來就可以,我輸入 PC</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Aliases 不能隨便打</span>,打錯就抓不到電腦!</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="background-color: #ffff99; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Aliases 要跟你電腦的"網路名稱"完全一樣!!!!</span><span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"> --> <b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">第一個最容易設錯不能用的地方。</b></span></span><span style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"> </b></span></div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
網路名稱:控制台-->系統-->完整電腦名稱,ex: Twinkle-PC</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
改網路名稱:</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
(XP) 控制台-->系統-->變更 </div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
(Win 7) 控制台-->系統-->進階系統設定-->變更</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
(MAC) 系統偏好設定-->共享-->編輯 </div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
輸入完 Screen Name 和 Aliases 按 OK。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
同樣的動作再做一次,但這次輸入 MAC 的 Aliases,Screen Name 可以隨便打,我輸入 MAC。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
接著,是設定下面 Links (螢幕位置) 的部份:</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">這邊是讓我搞很久,<b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">第二個最容易出問題的地方</b>,不過點破就沒什麼稀奇了。</span></div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
我的螢幕擺的位置是 PC 在左,MAC 在右,同高。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
把下拉選單拉成: 0 to 100 % of the <span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">right </b></span>of <span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">PC </b></span>goes to 0 to 100% of <span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">MAC</b></span></div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
然後按 "+" --> 出現 PC is left of MAC.</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
我原本以為這樣就好了,結果是,我滑鼠往右移到MAC上之後就移不回 PC 了 ^o^"</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
沒想到還要設讓遊標移回來的位置:</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<div style="line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
把下拉選單拉成: 0 to 100 % of the <span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">left </b></span>of <span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">MAC </b></span>goes to 0 to 100% of <span style="font-size: medium; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">PC</b></span></div>
<div style="line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
然後按 "+" --> 出現 MAC is left of PC.</div>
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
兩個 Links 都出現在框框裡之後按 OK. </div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
註:要是螢幕不同高,就調整 0 to 100 的選項,但我沒調過,可以自己試試看。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 15px; margin-top: 15px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
如此 Server端 就設定完成了。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
轉戰到 MAC 吧...</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
打開 系統偏好設定-->最下面 SynergyKM</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
點上面 Location 的選單,選 New Location,打入一個名稱後ok</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
在 General 標籤下,選 Connect to a shared keyboard and mouse,</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
到 Client Configuration 標籤,輸入 Server 端 IP, ex: 192.168.1.1 </div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
回到 General ,按 Turn Synergy On</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Status 出現 Connected 表示連接成功! 可以移動滑鼠過去囉!</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
移過去之後打字也ok。</div>
<div style="background-color: white; color: #444444; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
預設按鍵 Alt (PC) = Command (MAC)</div>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-14731455159227764502011-10-19T20:34:00.005+08:002011-10-19T20:34:51.833+08:00Latex CJK Chinese Font<a href="ftp://cle.linux.org.tw/pub2/tex/cjk/fonts/">ftp://cle.linux.org.tw/pub2/tex/cjk/fonts/</a><br />
<br />
裡面的cwtex字型真的不錯~~<br />
<br />
這個裝法應該算是最方便的了Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com1tag:blogger.com,1999:blog-4399669551066997418.post-72849973653899773342011-10-19T20:26:00.004+08:002012-01-28T16:02:37.974+08:00[轉] 發票十字編<div style="text-align: left;">
</div>
<div style="background-color: white; font-family: Arial, MingLiU, PMingLiU; font-size: 13px; line-height: 1.5em; list-style-image: initial; list-style-position: initial; list-style-type: none; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: -webkit-auto; word-break: break-all;">
轉錄From: <a href="http://tw.myblog.yahoo.com/jw!Nn_7CwmQFRvfXVhA1VX6E.fr/article?mid=3861" style="font-family: 'Times New Roman'; font-size: medium; line-height: normal; text-align: left;">http://tw.myblog.yahoo.com/jw!Nn_7CwmQFRvfXVhA1VX6E.fr/article?mid=3861</a></div>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-37274819592376361022011-10-16T08:30:00.004+08:002011-10-16T08:30:43.548+08:00Latex Code Listing<br />
<h2 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; color: #006600; font-family: serif; text-align: center;">
11. How can I get source code listings nicely printed?</h2>
<hr style="clear: both; font-family: serif;" />
<h3 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; color: #000088; font-family: sans-serif;">
Answer</h3>
<div style="font-family: serif; line-height: 1.3em;">
Sorry, you are on your own, more or less.</div>
<div style="font-family: serif; line-height: 1.3em;">
I know that there are third-party <span class="nowrap" style="white-space: nowrap;"><span class="LaTeX" style="letter-spacing: -0.255em;">L<span class="LaTeX-a" style="font-size: 14px; left: -0.105em; position: relative; text-decoration: none; text-transform: uppercase; top: -0.5ex;">A</span></span><span class="TeX" style="letter-spacing: -0.125em; padding-right: 0.125em;">T<span class="TeX-e" style="left: -0.0417em; position: relative; text-decoration: none; text-transform: uppercase; top: 0.5ex;">E</span>X</span></span> packages that are tailored towards formatting and displaying of source code listings in <span class="nowrap" style="white-space: nowrap;"><span class="LaTeX" style="letter-spacing: -0.255em;">L<span class="LaTeX-a" style="font-size: 14px; left: -0.105em; position: relative; text-decoration: none; text-transform: uppercase; top: -0.5ex;">A</span></span><span class="TeX" style="letter-spacing: -0.125em; padding-right: 0.125em;">T<span class="TeX-e" style="left: -0.0417em; position: relative; text-decoration: none; text-transform: uppercase; top: 0.5ex;">E</span>X</span></span> documents. I did not have the time to investigate these packages for my own purposes, and so I was stuck with something really basic I wrote myself. Just in case that this quick 'n dirty hack might be all you need, too, I include it here.</div>
<hr style="clear: both; font-family: serif;" />
<h3 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; color: #000088; font-family: sans-serif;">
Example usage</h3>
<div style="font-family: serif; line-height: 1.3em;">
In the preamble, or in an appropriate include file:</div>
<pre style="background-attachment: initial; background-clip: initial; background-color: #f4f4f4; background-image: initial; background-origin: initial; border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: black; border-left-style: solid; border-left-width: 1px; border-right-color: black; border-right-style: solid; border-right-width: 1px; border-top-color: black; border-top-style: solid; border-top-width: 1px; color: #006600; font-weight: bold; padding-left: 36px; padding-right: 36px;">\newenvironment{mylisting}
{\begin{list}{}{\setlength{\leftmargin}{1em}}\item\scriptsize\bfseries}
{\end{list}}
\newenvironment{mytinylisting}
{\begin{list}{}{\setlength{\leftmargin}{1em}}\item\tiny\bfseries}
{\end{list}}
</pre>
<div style="font-family: serif; line-height: 1.3em;">
In the manuscript:</div>
<pre style="background-attachment: initial; background-clip: initial; background-color: #f4f4f4; background-image: initial; background-origin: initial; border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: black; border-left-style: solid; border-left-width: 1px; border-right-color: black; border-right-style: solid; border-right-width: 1px; border-top-color: black; border-top-style: solid; border-top-width: 1px; color: #006600; font-weight: bold; padding-left: 36px; padding-right: 36px;">\begin{mylisting}
\begin{verbatim}
double a[n], b[n], c[n];
for (i = 0; i < n; i++)
c[i] = a[i] + b[i];
\end{verbatim}
\end{mylisting}
</pre>
<hr style="clear: both; font-family: serif;" />
<h3 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; color: #000088; font-family: sans-serif;">
Result, before</h3>
<div class="center" style="font-family: serif; text-align: center;">
<img alt="'Before' screenshot" class="texsample" height="185" src="http://www.kronto.org/thesis/tips/listings-before.png" style="border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: black; border-left-style: solid; border-left-width: 1px; border-right-color: black; border-right-style: solid; border-right-width: 1px; border-top-color: black; border-top-style: solid; border-top-width: 1px;" width="620" /></div>
<hr style="clear: both; font-family: serif;" />
<h3 style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; color: #000088; font-family: sans-serif;">
Result, after</h3>
<div class="center" style="font-family: serif; text-align: center;">
<img alt="'After' screenshot" class="texsample" height="150" src="http://www.kronto.org/thesis/tips/listings-after.png" style="border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: black; border-left-style: solid; border-left-width: 1px; border-right-color: black; border-right-style: solid; border-right-width: 1px; border-top-color: black; border-top-style: solid; border-top-width: 1px;" width="620" /></div>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com2tag:blogger.com,1999:blog-4399669551066997418.post-75615364777712346692011-02-07T11:32:00.000+08:002011-02-07T11:32:54.340+08:00時間又是一段時間沒寫網誌了<br />
<br />
反而像把網誌當筆記本來用了 = =<br />
<br />
過年在家閒著<br />
<br />
也好不容易有些時間想想事情<br />
<br />
這一年<br />
<br />
發生了不少事呢<br />
<br />
而開學後還有更多的挑戰<br />
<br />
人生嘛<br />
<br />
只能繼續走下去:)Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-79071575724300717442010-11-12T01:38:00.001+08:002010-11-12T01:38:54.338+08:00Parse Tree in Latex<div style="background-color: white; color: black;"><br />
<center>Latex 真的是什麼都有XD<table></table><table border="0"><tbody>
<tr><td align="CENTER" nowrap="nowrap" valign="MIDDLE"><h0 style="color: teal; font-weight: bold; text-align: center;"><br />
<br />
The <tt>parsetree</tt> Package for Drawing Trees in LaTeX</h0></td></tr>
</tbody></table></center><center>[<a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling" target="_parent"> LaTeX for Linguists</a>, <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/index.dvi">.dvi</a>, <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/index.ps">.ps</a>, <a href="https://docs.google.com/viewer?url=http%3A%2F%2Fwww.essex.ac.uk%2Flinguistics%2Fexternal%2Fclmt%2Flatex4ling%2Ftrees%2Fparsetree%2Findex.pdf">.pdf</a>, <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/TestFile.tex">TestFile</a>]</center><br />
<h2 align="center" style="color: teal; font-size: 19px; font-weight: bold; text-align: center;"></h2><br />
<hr /><br />
<menu><br />
<li><a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/#basic">Basic Use</a></li><br />
<br />
<br />
<li><a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/#interaction">Interaction with other packages</a><menu><br />
<li><a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/#3">Boxes, Subscripts, Unlabelled Nodes</a></li><br />
<br />
<br />
<li><a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/#4">AVMs on Nodes</a></li><br />
<br />
<br />
<li><a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/#5">Special Characters in Node Labels</a></li><br />
<br />
<br />
<li><a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/#6">Non-Local Lines</a></li><br />
<br />
<br />
</menu></li><br />
<br />
<br />
</menu><br />
<hr />This is my favoured and recommended method for drawing standard linguistic trees where the nodes have less than three daughters. It is very simple, and interacts well with other packages. Here is a simple example.<br />
<img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/20.gif" /><br />
<pre>\begin{parsetree}
( .S.
(.NP. `we')
( .VP.
(.V. `gave' )
(.NP. `them')
(.NP. ~ `a toy')
)
)
\end{parsetree}
</pre>Apart from information on <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/#basic">basic usage</a> you will find information about the use of the package for more complex examples, and use in conjunction with <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/avms"><tt>avm.sty</tt></a>, and <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/tree-dvips/"><tt>tree-dvips</tt></a>) for drawing really rather <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/#interaction">complicated things</a>.<br />
The package is available from the usual archive sites, but I have not been able to find documentation other than what is in the source code. So I have made this up myself. My apologies to the author (Eirik Hektoen) for misrepresentations.<br />
This documentation is available in printed form: <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/Parsetree.ps">PostScript</a> and <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/Parsetree.dvi">DVI</a>. The style/package file <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/parsetree.sty">parsetree.sty</a> is also available here.<br />
<h1 style="color: teal; font-size: 21px; font-weight: bold; text-align: center;"><a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=7907157572430071744" name="basic">Basic Use</a></h1>In the preamble, put:<br />
<pre>\usepackage{parsetree}
</pre>In the text put: <img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/60.gif" /><br />
<pre>\begin{parsetree}
( .S.
(.NP. `we')
( .VP.
(.V. `gave' )
(.NP. `them')
(.NP. ~ `a toy')
)
)
\end{parsetree}
</pre>Basic usage is as follows:<br />
<ul><li><code>\begin{parsetree}</code>...<code>\end{parsetree}</code></li>
<li>A (sub-) tree consists of a "(", a node label, some daughters, and a ")".</li>
<li>A terminal node consists of just the node label. Terminal node labels are written in quotes: <code>`baby'</code>, <code>`gave'</code></li>
<li>Non-terminal node labels are surrounded by dots, e.g. <code>.S.</code>,</li>
<li>Putting a <code>~</code> before a node label puts it under a triangle, rather than a vertical line.</li>
<li>Node labels can be arbitrarily complex (see examples below).</li>
<li><em>Warning</em>: no more than tree daughters are allowed per node.</li>
<li><em>Warning</em>: don't use "(", or ")", or "<code>.</code>" or "<code>~</code>" inside node labels (see below on how to avoid this restriction).</li>
<li>The following commands can be used to vary the appearance of trees, see below for examples of their use.<table><tbody>
<tr><td align="LEFT" colspan="1"><code>\pthorgap</code></td><td align="LEFT" colspan="1">horizontal gap between sisters (default 12pt)</td></tr>
<tr><td align="LEFT" colspan="1"><code>\ptvergap</code></td><td align="LEFT" colspan="1">vertical gap between mother/daughter (default 12pt)</td></tr>
<tr><td align="LEFT" colspan="1"><code>\ptnodefont</code></td><td align="LEFT" colspan="1">font and strut height/depth of non-terminal nodes</td></tr>
<tr><td align="LEFT" colspan="1"><code>\ptleaffont</code></td><td align="LEFT" colspan="1">fond and strut height/depth of leaves</td></tr>
<tr><td align="LEFT" colspan="1"></td></tr>
</tbody></table></li>
</ul>Here are some more simple examples: <img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/100.gif" /><br />
<pre>\begin{parsetree}
(.S. .NP. .VP.)
\end{parsetree}
</pre><img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/107.gif" /><br />
<pre>\begin{parsetree}
(.NP. `Sam')
\end{parsetree}
</pre><h1 style="color: teal; font-size: 21px; font-weight: bold; text-align: center;"><a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=7907157572430071744" name="interaction">Interaction with other packages</a></h1>Node labels can be arbitrarily complicated. Just to give you an idea, the following examples show nodes containing arrays, co-indexing subscripts, and frame boxes, and nodes without node lables; nodes labelled with feature structures (made with the <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/avms/"><tt>avm.sty</tt></a> package); node labels containing round brackets and other characters that <code>parsetree</code> treats specially; and nodes with lines linking remote parts of the tree (made with the <a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/tree-dvips"><tt>tree-dvips</tt></a> package).<br />
<h2 style="color: teal; font-size: 19px; font-weight: bold; text-align: center;"><a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=7907157572430071744" name="3">Boxes, Subscripts, Unlabelled Nodes</a></h2>An example with some nodes boxed, and some nodes unlabelled (just put nothing between the `.' and `.'):<img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/133.gif" /><br />
<pre>\begin{parsetree}
( .\begin{tabular}{c}S\\TNS=pres\\asp=simple\end{tabular}.
(.\fbox{NP$_i$}. .the baby.)
( . .
(. . .gave. )
(.\fbox{NP$_{j , {j \neq i}}$}.
.the baby. )
(. . .a toy.)
)
)
\end{parsetree}
</pre><h2 style="color: teal; font-size: 19px; font-weight: bold; text-align: center;"><a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=7907157572430071744" name="4">AVMs on Nodes</a></h2>For making trees labelled with AVMs (Feature Structures), a useful hint is to first use <code>\newcommand</code> to define commands to draw the AVMs (this means you can check they are correct before you try to combine them into a tree), and makes the tree much easier to read.<br />
We define three commands to draw the AVMs: <code>\fsA</code>, <code>\fsB</code>, and <code>\fsC</code>, e.g.<br />
<pre>\newcommand{\fsB}{\begin{avm}
\sort{f}{\[ cat & det \\
agr & \@1 \\
def & \@2 \] }
\end{avm} }
</pre>One can, of course test these just by putting:<br />
<pre>\fsA
\fsB
\fsC
</pre>To draw the tree, we put these commands in the node labels, preceded by some commands to adjust the space between nodes (see below):<br />
<img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/195.gif" /><br />
<pre>\begin{parsetree}
\pthorgap{75pt}
\ptvergap{40pt}
( .\fsA .
.\fsB .
.\fsC .
)
\end{parsetree}
</pre>This example uses the <tt>parsetree</tt> declarations: <code>\pthorgap</code> and <code>\ptvergap</code>:<br />
<ul><li>The gap between sisters is controlled by the <code>\pthorgap</code> declaration (default is 12pt)</li>
<li>The vertical distance between mother and daughters is controlled by the <code>\ptvergap</code> declaration (default is 12pt).</li>
</ul>These can be set globally, or anywhere within individual <code>parsetree</code> environments.You can also alter the font and height/depth allowed for non-terminal node labels and leaves with <code>\ptnodefont</code> and <code>\ptleaffont</code>. The following are the defaults:<br />
<pre>\ptnodefont{\normalsize\rm}{11pt}{3pt} % font and strut height/depth: nodes
\ptleaffont{\normalsize\it}{11pt}{3pt} % font and strut height/depth: leaves
</pre><h2 style="color: teal; font-size: 19px; font-weight: bold; text-align: center;"><a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=7907157572430071744" name="5">Special Characters in Node Labels</a></h2><tt>Parsetree</tt> treats some characters specially (e.g. round brackets, dot, tilde), using them as commands to draw trees. This can be a problem if you want these characters in your trees. However, there is a simple solution.<br />
The <code>parsetree</code> environment is simply a wrapper that: (a) makes these special characters `active' (i.e. special), and (b) calls the commands<code>\ptbegtree</code> <code>\ptendtree</code> at the beginning and end of the environment respectively. If we use these latter commands directly, then these special characters retain their normal meanings, and can appear in node lables. However, we must now use the underlying <code>parsetree</code>commands to draw the tree:<br />
<ul><li>replace "(" with <code>\ptbeg</code>, and ")" with <code>\ptend</code></li>
<li>replace <code>.N.</code> by <code>\ptnode{N}</code>.</li>
<li>replace <code>`N'</code> by <code>\ptleaf{N}</code>.</li>
<li>replace <code>~</code> with <code>\pttritrue</code></li>
</ul>Here is our original example:<br />
<img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/248.gif" /><br />
<pre>\ptbegtree
\ptbeg \ptnode{S}
\ptbeg \ptnode{NP} \ptleaf{we} \ptend
\ptbeg \ptnode{VP}
\ptbeg \ptnode{V} \ptleaf{gave} \ptend
\ptbeg \ptnode{NP} \ptleaf{them} \ptend
\ptbeg \ptnode{NP} \pttritrue \ptleaf{a toy} \ptend
\ptend
\ptend
\ptendtree
</pre>And here is an example, with `special' characters thrown in:<br />
<img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/264.gif" /><br />
<pre>\ptbegtree
\ptbeg \ptnode{(VP)}
\ptbeg \ptnode{(V)} \ptleaf{(`saw)} \ptend
\ptbeg \ptnode{NP} \ptleaf{Sam's~~~toy.} \ptend
\ptend
\ptendtree
</pre>Here is a more complicated and realistic example (to simplify things, I have defined <code>\npile</code> to produce a node label consisting of an array -- of course, with something this complicated, you would probably want to simplify things even further, but this is just for exemplification).<br />
<pre>\newcommand{\npile}[1]{%
\ptnode{ %
\( \begin{array}{c}#1%
\end{array} %
\) }}
</pre><img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/294.gif" /><br />
<pre>\ptbegtree
\ptbeg
\npile{S\\
see' (s, k)\\
\lambda y see' ( y,k ) (s)}
\ptbeg
\npile{NP\\s}
\npile{Sam\\s}
\ptend
\ptbeg
\npile{VP\\ \lambda y see' ( y,k )\\
\lambda x \lambda y see' ( y,x ) (k)}
\ptbeg
\npile{V\\ \lambda x \lambda y see' ( y,x ) }
\npile{saw\\ \lambda x \lambda y see ( y,x )}
\ptend
\ptbeg
\npile{NP\\k}
\npile{Kim\\k}
\ptend
\ptend
\ptend
\ptendtree
</pre><h2 style="color: teal; font-size: 19px; font-weight: bold; text-align: center;"><a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=7907157572430071744" name="6">Non-Local Lines</a></h2>The <tt>tree-dvips</tt> package can be used to draw `non-local' lines, as in the following example, supposed to show something like "Quantifier Raising":<br />
<img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/325.gif" /><br />
<pre>\begin{parsetree}
( .S.
(.NP. ~ .\node{1}{\strut every baby}. )
(.S.
(.NP. .a baby.)
( .{VP}.
(.V. .{gave}. )
(.NP. .every child.)
(.NP. .\node{2}{\strut t}.)
)
)
)
\abarnodeconnect[-10pt]{2}{1}
\end{parsetree}
</pre>Here is a more complicated example: <img align="BOTTOM" src="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling/trees/parsetree/343.gif" /><br />
<pre>\begin{parsetree}
( .\node{1}{S}.
( .\node{2}{NP$_i$}. .the baby.)
( .\node{3}{VP}.
(.\node{4}{V}. .\node{5}{gives}. )
(.NP$_j$. .the baby.)
(.NP. .a toy.)
)
)
\anodecurve[tl]{2}[bl]{1}{20pt}
\anodecurve[r]{1}[t]{3}{20pt}
\anodecurve[bl]{3}[t]{4}{20pt}
\anodecurve[bl]{4}[l]{5}{20pt}
\end{parsetree}
</pre><hr /><address><a href="http://www.essex.ac.uk/linguistics/external/clmt/latex4ling" target="_parent">LaTeX for Linguists</a>,<br />
<a href="http://privatewww.essex.ac.uk/~doug/">Doug Arnold</a>,<br />
<a href="mailto:doug@essex.ac.uk">doug@essex.ac.uk</a>,<br />
November 30, 2009.</address><div><br />
</div></div>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-40620307937383757532010-11-10T18:49:00.002+08:002010-11-10T18:49:18.463+08:00C code in latex<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: seagreen; font-family: Monaco, 'Andale Mono', 'Courier New', Courier, mono; font-size: 12px; line-height: 15px; white-space: nowrap;">\documentclass[a4paper,10pt]{article}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />\usepackage[utf8x]{inputenc}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />\usepackage{listings}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />\begin{document}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />\lstset{language=C,frame=single,numbers=left,tabsize=2}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />\begin{lstlisting}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />#include <stdlib.h><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />#include <stdio.h><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />#include <string.h><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />int<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />max(int a, int b)<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />{<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />if(a>b) return a;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />else return b;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />void<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />reconstruct(char *x, char *y, <br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> int table[strlen(x)+1][strlen(y)+1])<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />{<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />int n=strlen(x),m=strlen(y),i,j,currentChar;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />int maxlcs=table[n][m];<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />char* lcschar=(char*)malloc((maxlcs+1)*sizeof(char));<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />*(lcschar+maxlcs)='\0';<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />currentChar=0;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />i=0;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />j=0;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />while(currentChar<maxlcs)><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />{<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> if( *(x+i) == *(y+j) )<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> {<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> *(lcschar+currentChar)=*(x+i);<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> currentChar++;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> //printf("%c\n",*(x+i));<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> i++;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> j++;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> }<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> else if(table[i+1][j] >= table[i][j+1]) i++;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> else j++;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />printf("%s\n",lcschar);<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />free(lcschar);<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />int<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />lcs(char *x,char *y)<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />{<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />//printf("%zu\n",strlen(x));<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />int n=strlen(x), m=strlen(y), i, j, table[n+1][m+1];<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />for(i=0;i<=n;i++) table[i][0]=0;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />for(j=0;j<=m;j++) table[0][j]=0;<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />for(i=1;i<=n;i++)<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> for(j=1;j<=m;j++)<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> if( *(x+i) == *(y+j) ) table[i][j]=1+table[i-1][j-1];<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /> else table[i][j]=max(table[i-1][j], table[i][j-1]);<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />reconstruct(x,y,table);<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />return table[n][m];<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />void<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />main()<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />{<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />int res=lcs("abdebcbb","adacbcb");<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />//printf("%d\n",res);<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />\end{lstlisting}<br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" /><br style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" />\end{document}</maxlcs)></string.h></stdio.h></stdlib.h></span>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-12717500411006170972010-10-25T12:04:00.002+08:002010-10-25T12:05:11.439+08:00Gas Tex TXT<pre style="white-space: pre-wrap; word-wrap: break-word;">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% GasTeX : Graphs and Automata Simplified in TeX</pre><pre style="white-space: pre-wrap; word-wrap: break-word;"><a name='more'></a>
%%
%% Macros for drawing easily graphs and automata under the picture
%% environment of LaTeX2e.
%% Documentation in gastex.doc
%% See also the comments before the macros throughout the file.
%% Examples in ex_gastex.tex
%%
%% Paul Gastin
%% LIAFA
%% Universite Paris 7
%% 2, place Jussieu
%% F-75251 Paris Cedex 05
%% email : Paul.Gastin@liafa.jussieu.fr
%% www : http://www.liafa.jussieu.fr/~gastin
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% A lot of changes has been made since gastex 1.0 and as a result,
% these new macros are no longer compatible with the previous ones.
% To be able to use old pictures, a compatible mode is provided
% (see \compatiblegastexun at the end of the file). The compatibility
% is almost 100% and should be sufficient in most cases.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% History since version 2.0
%
% 2.01:
% - Fix an error that occured in v2.0 when using Nfill=y without
% defining previously fillgray or fillcolor.
% The following default setting has been added.
% \gasset{fillgray=0,Nfill=n} % Not filled but black if filled
%
% 2.1:
% - New macros to draw directly circles, rectanges, ovals,
% lines and bezier curves.
% \drawcircle, \drawrect, \drawoval,
% \drawline, \drawqbezier, \drawcbezier
% All these macros uses gasset options and in particular:
% Nframe, Nfill, linecolor, fillcolor, dash, AHnb, etc...
% - Compatibility mode for pspictpg up to v0.6
% - Fix the bug which occured sometimes when using Nw=0,Nh=0.
%
% 2.2:
% - added the options slide and paper to the package.
% In order to get the default settings for slides, use
% \usepackage[slide]{gastex}
% The default settings for papers is obtained with
% \usepackage[paper]{gastex}
% or
% \usepackage{gastex}
% - added new option loopCW to define whether loops are in
% clockwise direction or not.
% - Fix a TeX error (Arithmetic overflow) that occurred when using
% \drawedge(A,B){} with two nodes A and B having the same coordinates.
% Now, in this case, an error message is issued in the log
% and the macro \drawedge(A,B){} is ignored.
%
% 2.3:
% - added the parameter ELdistC (y or n) allowing to specify whether
% the distance (ELdist) is between the center (y) of the label and the edge
% or between the side (n) of the label and the edge.
% The behaviour of previous gastex versions corresponds to the setting
% (n) which is therefore the default.
% - added the macro \drawqbpedge allowing to specify the auxiliary
% point of a quadratic Bezier curve with two angles instead of the
% absolute coordinates required by \drawqbedge.
% - added parameters sxo, syo, exo, eyo (offsets in \unitlength).
% They define offsets for the virtual starting and ending points of an
% edge with respect to the centers of the starting and ending nodes.
% - improved drawing for arrowheads (in gastex.pro).
% First, the direction of the arrowhead is better for curved edges.
% Second, when several arrowheads are drawn they follow the curve.
% Previously, they followed the tangent at the ending point of the
% edge which was bad for curved edges.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Known problems and (hopefully) solutions.
%
% 21/10/99: Frank Goertzen (frank.goertzen@unibw-muenchen.de) has
% reported that when using gastex together with german an error may
% occur when running dvips if the german package is loaded first. The
% solution is to load gastex before german:
% \usepackage{gastex}
% \usepackage{german}
% I have no idea concerning the cause of this error.
%
% 07/03/00: A postscript error may occur when using Nw=0,Nh=0.
% Solution: Use a small value instead of 0, e.g. Nw=0.1,Nh=0.1
% Fixed in version 2.1.
%
% 27/10/00: Using gasset inside a tabular or an array produces an error.
% The reason is that I'm using the "&" symbol as a marker in order to
% process gasset options.
% Solution: Include the whole picture inside an mbox.
% \begin{tabular}{c}
% \mbox{\begin{picture}(10,20)(-5,-5)
% \gasset{ELdist=0}
% \node(A)(0,0){1}\drawloop(A){$a$}
% \end{picture}}
% \end{tabular}
%
% pdflatex: gastex does not work with pdflatex since it produces
% postscript code and pdflatex does not know what to do with it.
% Solution: Use latex and then ps2pdf.
% I don't know whether it is possible to translate my postscript code
% into pdf code. The problem is that I'm using postscript to make some
% computations and not only to draw the picture.
% I would appreciate the help of a pdf guru on this.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Settings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-----------------------------------------------------------------------
% Set values for gastex parameters.
%
% \gasset{parameter=value,parameter=value,...}
% optional spaces are only allowed after commas
%
% Nw=number
% widht in \unitlength of oval nodes
% Nh=number
% height in \unitlength of oval nodes
% Nmr=number
% maximal radius in \unitlength of oval nodes
% The actual radius will be min(Nw/2,Nh/2,Nmr)
% Nmr=0 yields a rectangle node
%
% Nadjust=any combination of the letters w,h,n
% w : the node width is adjusted to the node label width + Nadjustdist
% h : the node height is adjusted to the node label height + Nadjustdist
% n : no adjustment
% Nadjustdist=number
% distance in \unitlength between the label box and the node frame
% when using Nadjust
%
% Nframe=y or n
% boolean flag defining whether nodes are framed or not.
% Nfill=y or n
% boolean flag defining whether nodes are filled or not.
% Automatically set to true by the parameters fillgray and fillcolor
%
% ExtNL=y or n
% boolean flag defining whether node labels are external or not.
% NLangle=number
% direction in degree of node labels
% NLdist=number
% The meaning depends on the ExtNL flag.
% If the flag is set to "n" then NLdist defines the distance
% in \unitlength between the node center and the label center.
% If the flag is set to "y" then NLdist defines the distance
% in \unitlength between the node frame and the label box.
%
% Nmarks=any combination of the letters i,f,r,n
% i : initial mark on nodes
% f : final mark on nodes
% r : repeated mark on nodes
% n : no mark on nodes
% ilength=number
% length in \unitlength of arrows marking initial nodes
% iangle=number
% direction in degree of arrows marking initial nodes
% flength=number
% length in \unitlength of arrows marking final nodes
% fangle=number
% direction in degree of arrows marking final nodes
% rdist=number
% distance in \unitlength between the lines of repeated nodes
% a positive value draw the second line inside the normal one
% a negative value draw the second line outside the normal one
% but the edges are still connected to the normal line.
%
% An edge virtually starts from the center of the starting node and
% ends at the center of the ending node (indeed they are only drawn
% outside of the nodes). It is possible to change the virtual starting
% and ending points of an edge using offsets with respect to the center
% of the starting and ending node. This is the purpose of the following
% parameters.
% sxo=number (starting x offset)
% horizontal offset in \unitlength of the starting point of an edge
% with respect to the center of the starting node.
% syo=number (starting y offset)
% vertical offset in \unitlength of the starting point of an edge
% with respect to the center of the starting node.
% exo=number (ending x offset)
% horizontal offset in \unitlength of the ending point of an edge
% with respect to the center of the ending node.
% eyo=number (ending y offset)
% vertical offset in \unitlength of the ending point of an edge
% with respect to the center of the ending node.
%
% curvedepth=number
% depth in \unitlength of curved edges between two nodes
% The absolute value of curvedepth defines the distance between the
% middle of the curved edge and the center of the line joining the two nodes
% With a positive/negative value the curved edge is on the left/right
% of the line joining the two nodes.
%
% loopdiam=number
% diameters in \unitlength of loops
% loopangle=number
% direction in degree of loops
% loopCW=y or n
% boolean flag defining whether loops are in clockwise direction or not.
%
% AHnb=number
% number of arrowhead(s) at the end of edges.
% 0 for no arrowhead.
% AHdist=number
% distance in \unitlength between two arrowheads
% AHangle=angle
% angle in degree between the edge and the arrowhead side
% AHLength=number
% Length in \unitlegth of the arrowhead side
% AHlength=number
% length in \unitlegth defining the shape of the arrowhead
% 0 for an arrowhead formed with just two lines
% Length*cos(angle) for a triangular arrowhead
% See examples.
%
% ELside=l or r
% label on the (l)eft or (r)ight side of the edge
% ELpos=0..100
% position of the label along the edge.
% 0 : starting node
% 50 : middle of the edge
% 100 : ending node
% ELdist=number
% distance in \unitlength between the label and the edge
% ELdistC=y or n
% y : The distance is between the center of the label and the edge.
% With ELdist=0 the center of the label is on the edge.
% n : The distance is between the side of the label and the edge.
% This is the default.
% The distance is actually between the side of the label and
% the tangent of the edge which is usually a good approximation.
% It may not work very well if the label is large and the edge is
% strongly curved because then the tangent is far from the edge at the
% point that achieve the distance between the tangent and the label.
%
% linegray=decimal number between 0 and 1
% gray level used to draw lines. 0=black, 1=white.
% fillgray=decimal number between 0 and 1
% gray level used to fill nodes. 0=black, 1=white.
% linecolor=ColorName
% color used to draw lines.
% The color name should be defined in dvipsnam.def and one should
% include \usepackage[usenames]{color}.
% This is to avoid the trouble of defining our own colors.
% The drawback is that it is not possible to define and use other colors.
% It should not be very restrictive since plenty of colours are
% defined in dvipsnam.def.
% It should not be difficult to add the possibility of using new
% colors if needed.
% fillcolor=ColorName
% color used to fill nodes. See remarks above.
% linewidth=number
% width in \unitlegth of lines
% dash={list of numbers}{offset}
% Set the dash pattern used for drawing postscript paths.
% The numbers in the list indicate alternatively lengths
% in \unitlength of dashes and lengths in \unitlength of spaces.
% The list of lenghts is used circularly.
% offset allows to start the pattern at some distance from its beginning.
% Here are some examples:
% dash={}{0} % continuous path
% dash={1.5}0 % dashs of length 1.5 and empty spaces of length 1.5
% dash={0.2 0.5}0 % looks like a sequence of dots
% dash={4 1 1 1}0 % alternation of long and short dashs
% dash={1.5}{1.5} % we start with the empty space and not the dash
% dash={4}{2} % we start in the middle of the first dash
%-----------------------------------------------------------------------
% Default settings
\unitlength=1mm
\gasset{Nw=8,Nh=8,Nmr=4} % circle
\gasset{Nframe=y}
\gasset{fillgray=0,Nfill=n} % Not filled but black if filled
\gasset{ExtNL=n,NLangle=90,NLdist=0}
\gasset{iangle=180,ilength=5}
\gasset{fangle=0,flength=5}
\gasset{rdist=0.7}
\gasset{Nmarks=n} % no mark
\gasset{Nadjustdist=1,Nadjust=n} % no adjust
\gasset{sxo=0,syo=0,exo=0,eyo=0}
\gasset{curvedepth=0}
\gasset{loopdiam=8,loopangle=90,loopCW=y}
% One triangular small arrowhead
\gasset{AHnb=1,AHdist=1.41,AHangle=20,AHLength=1.5,AHlength=1.41}
\gasset{ELside=l,ELpos=50,ELdist=1}
\gasset{linegray=0} % black lines
\gasset{linewidth=0.14,dash={}0} % continuous path
% Settings for slides
\ifgastexslide
\gasset{Nw=12,Nh=12,Nmr=6,ilength=8,flength=8,rdist=1,loopdiam=12}
\gasset{linewidth=0.21,AHdist=2.1,AHLength=2.25,AHlength=2.1}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Nodes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-----------------------------------------------------------------------
% Define and draw a node.
%
% \node(NodeName)(x,y){NodeLabel}
% \node[parameter=value,...](NodeName)(x,y){NodeLabel}
%
% Required arguments:
% NodeName : name of the node
% (x,y) : coordinates of the node in \unitlengh.
% NodeLabel : label of the node. Empty if no label.
% Optional argument:
% [parameter=value,...]
% One may just define a node without drawing it using an empty label
% and the parameters Nframe=n,Nfill=n
%-----------------------------------------------------------------------
% Add an ingoing arrow to mark an initial node.
% This arrow is usually drawn by \node using Nmarks=i.
% This separate macro can be used to draw several arrows
% or arrows with different colors, thickness, dash, ...
%
% \imark(NodeName)
% \imark[parameter=value,...](NodeName)
%
% Required arguments:
% NodeName : name of the node
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Add an outgoing arrow to mark a final node.
% This arrow is usually drawn by \node using Nmarks=f.
% This separate macro can be used to draw several arrows
% or arrows with different colors, thickness, dash, ...
%
% \fmark(NodeName)
% \fmark[parameter=value,...](NodeName)
%
% Required arguments:
% NodeName : name of the node
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Add a second line to mark a repeated node.
% This line is usually drawn by \node using Nmarks=r.
% This separate macro can be used to draw several lines around the
% node or lines with different colors, thickness, dash, ...
%
% \rmark(NodeName)
% \rmark[parameter=value,...](NodeName)
%
% Required arguments:
% NodeName : name of the node
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Add a label to the node.
% The position of the label is determined by the ExtNL flag
% and the parameters NLangle and NLdist.
% The label is usually drawn by \node.
% This separate macro can be used to add several labels
%
% \nodelabel(NodeName){NodeLabel}
% \nodelabel[parameter=value,...](NodeName){NodeLabel}
%
% Required arguments:
% NodeName : name of the node
% NodeLabel : label of the node.
% Optional argument:
% [parameter=value,...]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Edges
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-----------------------------------------------------------------------
% Edge between two nodes.
%
% \drawedge(startingNode,endingNode){label}
% \drawedge[parameter=value,...](startingNode,endingNode){label}
%
% Required arguments:
% startingNode : name of the starting node,
% endingNode : name of the ending node,
% label : label of the edge. {} for no label.
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Edge between two nodes following a quadratic Bezier curve.
% The first and last control points are the centers of the starting
% and ending nodes resp, modified with the starting and ending offsets.
% The middle control point is given by its absolute cartesian coordinates
%
% \drawqbedge(startingNode,x,y,endingNode){label}
% \drawqbedge[parameter=value,...](startingNode,x,y,endingNode){label}
%
% Required arguments:
% startingNode : name of the starting node,
% x,y : coordinates in \unitlength of the intermediary control point
% endingNode : name of the ending node,
% label : label of the edge. {} for no label.
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Edge between two nodes following a quadratic Bezier curve.
% The first and last control points are the centers of the starting
% and ending nodes resp, modified with the starting and ending offsets.
% The middle control point is defined by two angles.
%
% \drawqbedge(startingNode,sa,endingNode,ea){label}
% \drawqbedge[parameter=value,...](startingNode,sa,endingNode,ea){label}
%
% Required arguments:
% startingNode : name of the starting node,
% endingNode : name of the ending node,
% sa,ea : angles in degree at the starting and ending nodes,
% these angles define intermediary control point
% label : label of the edge. {} for no label.
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Edge between two nodes following a cubic Bezier curve.
% The first and last control points are the centers of the starting
% and ending nodes resp, modified with the starting and ending offsets.
% The second and third control points are given by their polar coordinates
% relative to the first and last control points resp.
%
% \drawbpedge(startingNode,sa,sr,endingNode,ea,er){label}
% \drawbpedge[parameter=value,...](startingNode,sa,sr,endingNode,ea,er){label}
%
% Required arguments:
% startingNode : name of the starting node,
% sa,sr : polar coordinates of the second control point relative to the center
% of the starting node (angle in degree and radius in \unitlength)
% endingNode : name of the ending node,
% ea,er : polar coordinates of the third control point relative to the center
% of the ending node (angle in degree and radius in \unitlength)
% label : label of the edge. {} for no label.
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Edge between two nodes following a cubic Bezier curve.
% The first and last control points are the centers of the starting
% and ending nodes resp, modified with the starting and ending offsets.
% The second and third control points are given by their absolute
% cartesian coordinates.
%
% \drawbcedge(startingNode,xs,ys,endingNode,xe,ye){label}
% \drawbcedge[parameter=value,...](startingNode,xs,ys,endingNode,xe,ye){label}
%
% Required arguments:
% startingNode : name of the starting node,
% xs,ys : coordinates in \unitlength of the control point defining
% the tangent at the starting node
% endingNode : name of the ending node,
% xe,ye : coordinates in \unitlength of the control point defining
% the tangent at the ending node
% label : label of the edge. {} for no label.
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Loop on a node following a cubic Bezier curve.
% Only the starting offsets sxo and syo are used.
%
% \drawloop(Node){label}
% \drawloop[parameter=value,...](Node){label}
%
% Required arguments:
% Node : name of the node,
% label : label of the edge. {} for no label.
% Optional argument:
% [parameter=value,...]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Other macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-----------------------------------------------------------------------
% Draw a circle.
%
% \drawcircle(x,y,r)
% \drawcircle[parameter=value,...](x,y,d)
%
% Required arguments in \unitlengh:
% x,y : coordinates of the circle center.
% d : diameter of the circle.
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Draw a rectangle.
%
% \drawrect(x0,y0,x1,y1)
% \drawrect[parameter=value,...](x0,y0,x1,y1)
%
% Required arguments in \unitlengh:
% x0,y0 : coordinates of the lower left corner of the rectangle.
% x1,y1 : coordinates of the upper right corner of the rectangle.
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Draw an oval.
%
% \drawoval(x,y,w,h,mr)
% \drawoval[parameter=value,...](x,y,w,h,mr)
%
% Required arguments in \unitlengh:
% x,y : coordinates of the oval center.
% w,h : width and height of the oval.
% rm : defines the maximal radius for the corners.
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Draw a straight line.
% The line may have arrowhead(s), ... depending of the current settings
%
% \drawline(x0,y0,x1,y1)
% \drawline[parameter=value,...](x0,y0,x1,y1)
%
% Required arguments:
% x0,y0,x1,y1 : coordinates in \unitlength of the extremities of the line
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Draw a quadratic Bezier curve.
% The line may have arrowhead(s), ... depending of the current settings
%
% \drawqbezier(x0,y0,x1,y1,x2,y2)
% \gasline[parameter=value,...](x0,y0,x1,y1,x2,y2)
%
% \drawqbezier arguments:
% x0,y0,x1,y1,x2,y2 : coordinates in \unitlength of the control points
% Optional argument:
% [parameter=value,...]
%-----------------------------------------------------------------------
% Draw a cubic Bezier curve.
% The line may have arrowhead(s), ... depending of the current settings
%
% \drawcbezier(x0,y0,x1,y1,x2,y2,x3,y3)
% \gasline[parameter=value,...](x0,y0,x1,y1,x2,y2,x3,y3)
%
% \drawcbezier arguments:
% x0,y0,x1,y1,x2,y2,x3,y3 : coordinates in \unitlength of the control points
% Optional argument:
% [parameter=value,...]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Compatibility with gastex v1.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Should be called inside the scope of a group
%
% {\compatiblegastexun ... }
%
% The macros \drawloop and \drawedge are redefined to match the old
% ones (v1.0) hence the new ones (v2.0) cannot be used inside the scope
% of \compatiblegastexun.
%
% The compatibility is almost 100%:
% - the following are ignored
% \setmaxbezier
% The optional argument of letstate defining the repeated state diameter
% - \settransdecal, \setedgedecal give curved edges
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Compatibility with pspictpg v0.6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Should be called inside the scope of a group
%
% {\compatiblepspictpg ... }
%
% The macros \drawline and \drawcircle are redefined to match those of
% pspictpg hence thoses of GasTeX cannot be used inside the scope
% of \compatiblepspictpg.
%
% The following macros are ignored. Use linecolor and fillcolor instead.
% \pcolor, \pictcolor
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</pre>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-28388437515430826932010-10-25T11:29:00.005+08:002010-10-25T11:33:20.656+08:00GasTex Example(For Automata)<a href="http://www.liacs.nl/~hoogeboo/praatjes/gastex/">http://www.liacs.nl/~hoogeboo/praatjes/gastex/</a><br />
<br />
<a href="http://www.lsv.ens-cachan.fr/~gastin/gastex/gastex.html">GasTeX</a> (Graphs and Automata Simplified in TeX, by Paul Gastin) is a package for drawing figures with a LaTeX interface and the help of Postscript. Everyone that needs to draw automata in his LaTeX documents on a regular basis should have a look at this package.<br />
The examples below are mainly to remind me of the possible settings for figures I sometimes need.<br />
<br />
<span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 15px;"></span><br />
<pre class="code" style="background-attachment: initial; background-clip: initial; background-color: #e3e3e3; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-family: monospace; font-size: 12px; font: normal normal normal 115%/normal monospace; line-height: 1.22em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;">\begin{figure}[H]
\begin{center}
\unitlength=4pt
\begin{picture}(15, 28)(0,-10)
\gasset{Nw=5,Nh=5,Nmr=2.5,curvedepth=3}
\thinlines
\node(A0)(7.5,0){$0$}
\node[Nmarks=i,iangle=90](A1)(0,13){$1$}
\node[Nmarks=if,iangle=90,fangle=90](A2)(15,13){$2$}
\drawloop[loopangle=180](A1){$a$}
\drawloop[loopangle=0](A2){$b$}
\drawedge(A1,A2){$a$}
\drawedge(A2,A1){$b$}
\drawedge(A2,A0){$a$}
\gasset{curvedepth=-3}
\drawedge[ELside=r](A1,A0){$b$}
\drawloop[loopangle=270](A0){$a, b$}
\end{picture}
\end{center}
\caption{La complétion de l'automate.}
\end{figure}</pre><div style="line-height: 1.5em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><img alt="Example of GasTeX output" src="http://blog.alieniloquent.com/images/gastex-example.jpg" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.22em;" /></div><br />
<br />
<table><tbody>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/rel_1.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>binary relation</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/boom_1.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>binary tree (post order)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/graaf_1a.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>undirected graph (a)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/graaf_1b.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>undirected graph (b)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/graaf-1c.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>undirected graph (c - linear)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/fsa-1.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>fsa (final 0 or even 1's)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/fsa-2.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>fsa (subword 00 or even 1's)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/fsa-3.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>fsa (ends in a - - , deterministic)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/kubus-1.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>cube (strings Hamilton dist 1)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/euler-1.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>CMB Euler path</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/clones-1.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>CMB probes (A..G) and clones (1..6)</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/pq-tree-1.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>CMB PQ trees</b></td><td></td></tr>
<tr><td align="center"><img src="http://www.liacs.nl/~hoogeboo/praatjes/gastex/tegel-hilbert.gif" /></td><td><br />
<a href="http://www.blogger.com/post-edit.g?blogID=4399669551066997418&postID=2838843751543082693">Code</a></td></tr>
<tr bgcolor="Yellow"><td align="center"><b>Hilbert curve (tiles)</b></td><td></td></tr>
</tbody></table>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0tag:blogger.com,1999:blog-4399669551066997418.post-21623973685688418132010-10-25T11:10:00.001+08:002010-10-25T11:10:41.604+08:00Latex Makefileall:<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>latex *.tex<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>dvips *.dvi<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ps2pdf &.ps<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>epdfview *.pdf<br />
<div><br />
</div>Anonymoushttp://www.blogger.com/profile/13300132647208530909noreply@blogger.com0