Jun 7, 2016

懺悔發願文﹣節錄與“黃柏霖警官新編《玉歷寶鈔的故事》”

懺悔發願文
    無始劫來,被我傷害過的一切眾生,請接受我的懺悔:
對不起,我錯了,請原諒我,我由於迷惑顛倒,造作種種身口意惡業,有意無意之間得罪、傷害甚至殺害你們,令你們遭受種種折磨與苦惱,真誠的請求你們原諒我,給予我改過自新的機會從今天起,我會謹慎防護自己的起心動念、言語行為,努力斷惡修善、改邪歸正,勤修一切善業,愛護一切眾生,並將所作的一切功德回向給你們。願大家都能離苦得樂、破迷開悟、聞經念佛、往生淨土、圓成佛果。
    我懺悔無始劫以來盜僧伽物、訕謗正法、毀壞三寶、起諸邪見、五逆十惡、破齋犯戒、不孝父母、不敬尊長、不忠不信、無義無禮、寡廉鮮恥、殘忍冷漠、衝突偏私、慳吝嫉妒、貪欲嗔恚、愚痴傲慢、多疑不信、放逸散亂,如是等一切身口意惡業,足以令我墮入地獄,千刀萬剮,煎熬苦毒;墮入餓鬼,飢渴難耐,幽暗恐怖;墮入畜生,鞭撻勞役,屠宰血污。

    今日萬幸,得聞佛法,明瞭因果不爽,怖畏三途苦報,誠信懺悔,發願改過。願從今起,熏修倫理教育、道德教育、因果教育、聖賢教育。從自身做起,成為大眾榜樣,護持弘揚,不遺余力。祈求三寶加持,祖宗保佑,令我煩惱日減,業障日消,福德日增,智慧日明。普與法界眾生,信願持名,一向專念南無阿彌佗佛,同生極樂,共證菩提。

Feb 7, 2014

Create customized Google Maps

1. Grab JSON code using:
http://gmaps-samples-
v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html

2. Then create a XX.html which has source:
--------------------Source-Head------------------
<!DOCTYPE html>
<html>
  <head>
    <title>Customized Google Maps</title>
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>

<!--change language=XX for specific lang-->

    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=en"></script>
    <script>
var map;
var mylocation = new google.maps.LatLng(34.686722,135.526974);

<!--change LatLng for coordinates-->

var MY_MAPTYPE_ID = 'custom_style';

function initialize() {

<!--the copy&paste of JSON code won't work here so remove the extra "", 
refer the code below to get your map styles -->

  var featureOpts = [
    {
      stylers: [
        { visibility: 'simplified' },
        { weight: 0.1 }
      ]
    },
    {
      elementType: 'labels',
      stylers: [
        { visibility: 'off' }
      ]
    },
    {
      featureType: 'administrative.province',
      stylers: [
        { visibility: 'on' },
        { weight: 8 },
        { color: '#000000' }
      ]
    },
    {
      featureType: 'administrative.province',
      elementType: 'labels.text',
      stylers: [
        { visibility: 'off' }
      ]
    },
    {
      featureType: 'administrative.locality',
      stylers: [
        { visibility: 'simplified' },
        { weight: 5 },
        { color: '#a62747' }
      ]
    },
    {
      featureType: 'administrative.locality',
      elementType: 'labels.text',
      stylers: [
        { visibility: 'off' }
      ]
    }
  ];

  var mapOptions = {
    zoom: 10,
    center: mylocation,
    mapTypeControlOptions: {
      mapTypeIds: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID]
    },
    mapTypeId: MY_MAPTYPE_ID
  };

  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);

  var styledMapOptions = {
    name: 'myStyle'
  };

  var customMapType = new google.maps.StyledMapType(featureOpts, styledMapOptions);

  map.mapTypes.set(MY_MAPTYPE_ID, customMapType);
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>
</html>

Aug 14, 2013

Exposure Rules from Manual of Leica M6

Three golden rules are:

1). Expose color slide films for the highlights, and let the shadows fall where they may.

2). Expose color negative films for important middle-tone areas, and never fear overexposure.

3). Expose b&w films for the shadows, and develop for the highlights.

Jul 3, 2013

Remove cells with zero in Excel using VBA

The data is like:

- - - - -
0 0 0 0 0
0 0 0 0 0
0 0 1 0 0
0 0 1 0 0
1 1 2 1 1
1 1 2 1 1
2 2 1 2 2
2 2 1 2 2
1 1 0 1 1
1 1 0 0 0
0 0 0 0 0
0 0 0 0 0

'Remove the cell with zero

Private Sub delzero()
Dim i, j As Integer
For j = 1 To 5
For i = 1 To 1000
    If Cells(2, j) = 0 Then
     Cells(2, j).delete Shift:=xlUp
    Else
    End If
Next i
Next j
End Sub

Feb 20, 2013

Get DNS working in Ubuntu 12.10

After installing Ubuntu 12.10 x64 (actually, it is salome-meca live-usb from http://www.alneos.com/en/download/salome-meca-live-usb), the networking seems working normally but I could open web pages from firefox.

Problem:
The network interface showed connection established, the ifconfig worked.
Ping on direct ip address was functionally, but the web pages could not be accessed.

Solution:
dpkg-reconfigure resolvconf

Install Chrome in Ubuntu 12.10 x64

While installing 64-bit chrome deb under Ubuntu 12.10, error occurred:

"The package is of bad quality
E: google-chrome-stable: file-in-etc-not-marked-as-conffile etc/cron.daily/google-chrome"

Then I used dpkg until I got another error:

sudo dpkg -i deb_package_name.deb

Selecting previously unselected package google-chrome-stable.
(Reading database ... 269204 files and directories currently installed.)
Unpacking google-chrome-stable (from chrome.deb) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
 google-chrome-stable depends on libgconf2-4 (>= 2.27.0); however:
  Package libgconf2-4 is not installed.
dpkg: error processing google-chrome-stable (--install):
 dependency problems - leaving unconfigured

Solution:
sudo apt-get install libgconf2-4
sudo dpkg -i chrome.deb

Dec 8, 2012

iTunes wifi sync

Source:
http://support.apple.com/kb/TS4062

Make sure these ports open in route settings:
 TCP: 123 and 3689
 UDP: 123 and 5353

Sep 23, 2012

Removal of background in GIMP (single color background)

To remove background of single color in GIMP:

1. Select region by color
2. Click the background
3. Select "Free select tool" and "subtract from the current selection" if there is any wrong region being selected
4. Layer - Transparency - Add alpha channel
5. Edit - Clear
6. Save image using .png or other formats supports transparency.

Rescale Z value in Gwyddion

For comparing roughness of different surfaces, I used Gwyddion for post processed of data files retrieved from AFM. To make the Z scale the same:

*For example, default maximum height of data is 300nm and I want to scale to 600nm.

2D images:
Icon: Tools - Stretch color range to part of data - Explicitly set fixed color range
Changing the Maximum to 600 nm


3D images:
Open data files (in 2D view default)
Icon: View - Display a 3D view of data - Show full controls
Change the "Value scale" to 0.5 (300/600)

Sep 21, 2012

Correct number of graphic when refering in the text

Wrong

\section{A}
text text

\begin{figure}
\caption{1}
\end{figure}

\begin{figure}
......
\label{fig2}
\caption{2}
......
\end{figure}
 (This will label the contents such as section or the figure before so that the wrong number will keep showing up)



Correct:
\caption{2}
\label{fig2}

Aug 20, 2012

Get MX Revolution work on Ubuntu 12.04

To get MX Revolution work on Ubuntu 12.04, first install xbindkeys, xbindkeys-config, revoco


Revoco(auto switch from Click to Free Spin of Wheel)
Download http://sourceforge.net/projects/revoco/files/
Extract the file and

make
sudo cp revoco /usr/local/bin
sudo revoco auto=30 (the speed you like)


Aug 18, 2012

Convert text file encode in Ubuntu

In terminal

find . -type f -exec iconv -f codename -t utf-8 {} -o ./{} \;

-type f : all the files

-f : input files' encode name
use this command to find out the encode name: iconv -l

-t : output files' encode name

\; is necessary

Aug 6, 2012

Join several files in Ubuntu

Joining all files under some folder:
cat *.csv  > full.csv

or

Joining specified files like:
cat *02.csv > 02.csv

201203-01.csv  201203-02.csv  201203-03.csv  201203-04.csv
201204-01.csv  201204-02.csv  201204-03.csv  201204-04.csv

May 30, 2012

Get usb work in WinGuest on UbuntuHost through VirtualBox

Host: Ubuntu 12.04
Guest: Windows 7
Command: sudo usermod -aG vboxusers
Then log out and log in.

May 28, 2012

Finding Shutdown in Gnome3

Hold down ALT the Suspend option becomes "Power Off"

Installing Ubuntu 12.04 on SSD@X220

I encountered booting problems on X220 when replaced the original hdd to ssd.
So this is how to solve it:

Hardware:
X220i: i3-2350M, 8G Patriot 1333MHz, Seagate 320G 7200rpm(Original)
SSD: Intel 520 120G (Replace)

BIOS setting
Boot: Choose Only UEFI

Ubuntu from usb boot (Universal USB Installer+ISO file)
Partitions: 50Mb ufi partition (35Mb minimum), 20G root, etc..

Apr 20, 2012

Install EAC under Ubuntu 12.04


I encountered a problem like this:0207XXXX -> Access Violation
Then after some googling, I solved it and memo it down.

Install Wine 1.3
Download EAC from its site
Install EAC through wine
Enter the terminal and find the directory, run the command:
 
~/.wine/dosdevices/c:/Program Files/ExactAudioCopy$wine regsvr32 sql*
(I removed the spaces in default name from EAC wizard
because I don't know how to enter a dir such as "E A C")

It will say like this:

Successfully registered DLL sqlceca35.dll
fixme:msvcr90:__clean_type_info_names_internal (0x7d69ab08) stub
DllRegisterServer not implemented in DLL sqlcecompact35.dll
fixme:msvcr90:__clean_type_info_names_internal (0x7d315cb0) stub
Successfully registered DLL sqlceoledb35.dll
fixme:msvcr90:__clean_type_info_names_internal (0x7d426398) stub
DllRegisterServer not implemented in DLL sqlceqp35.dll
fixme:msvcr90:__clean_type_info_names_internal (0x7d7e5ad8) stub
DllRegisterServer not implemented in DLL sqlcese35.dll
fixme:msvcr90:__clean_type_info_names_internal (0x7d5a312c) stub 
 
In the wine configure set path:
Drives -> Z: -> Path: /dev/sr1 (In my case)
 
Launch the EAC change the interface:
EAC Options -> Interface ->
1.Installed external ASPI interface  3.Native Win32 interface for XP/..
(No.1 works for me in my computer and relaunch the EAC after changing)


Mar 28, 2012

Install and Remove TEXLIVE2011 on Ubuntu

Install Texlive2011 on Ubuntu with gui window:
e
1. Furius ISO: mount texlive iso file with loop
2. sudo apt-get install perl-tk
3. sudo -s
4. perl install-tl -gui (under the mounted texlive directory)

Remove Texlive2011
rm -fr /usr/local/texlive         (or /texlive/2011)

Dec 10, 2011

meep program in CAELINUX2011

meep program in CAElinux2011
official support can be found @ Installation, Tutorial, Reference 

(set! geometry-lattice (make lattice (size 1 1 no-size
x, y, z
)))

(set! geometry (list
       (make block (center -0.2 -0.2) (size 0.2 0.2)
all format is 3d: (x,y z) or 2d: (x,y) and must be in lattice
             (material (make dielectric (epsilon 12)
or (material metal)
))
)))

(set! sources (list
       (make source
             (src (make continuous-src (wavelength 0.1224
frequency 8.167 (2.45GHz when lattice=1m, frequency in meep=lattice size/real lambda) or wavelength lambda
)))
             (component Ez
can be
)
             (center -0.4 0
must be in lattice
))))

(set! pml-layers (list (make pml (thickness 0.1
size should be smaller than lattice and better have pml
))))

(set! resolution 100
final resolution of file is resolution*lattice_size
)

(run-until 200
simulation time
      (at-every 0.6
output step
            (output-png Ez "-Zc bluered")))

Oct 25, 2011

Cheating table in Win when typing special symbols

*Using numeric keypad

Alt+0176      °     (for °C)
Alt+0177      ±