Recent posts

Install MySQL on Mac OS X

Here is my note of installing MySQL on Mac OS X, it's pretty easy.

Environment:

  • Mac OS X Yosemite 10.10.5
  • MySQL Community Server 5.6.26

Steps

1. Download MySQL DMG file

Open this link:

Download this file (no version for 10.10, and the one for 10.9 works on 10.10):

  • Mac OS X 10.9 (x86, 64-bit), DMG Archive

Notes: you may need to create an Oracle account to download the file.

2. Installation

Open the DMF file and continue the installation.

3. Start MySQL service

You can start or stop the MySQL service on this panel:

  • System Menu -> System Preferences -> MySQL

4. Configure the command alias

In order to run the two useful commands, add the following two lines to file "~/.bash_profile":

alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin

You need to open a new console to let me take effect, or do it in your own way.

  • Posted: 2015-09-11 22:27
  • Author: konca
  • Categories: (none)
  • Comments (0)

我嘅“的地得”区分方法

本人读小学时,就觉得“的地得”考题就是送分的,后来才理解不易区分的原因是三者在普通话中均读de。

前一阵发现同台吃饭的几个人也弄错了(下面有说明),所以将自己的间接总结如下,希望有助于区分三者。

对于知乎网站帖子: 现在还区分「的」「地」「得」的用法吗?

个人认为,应该区分。因为,汉语的语法本来就较为随意的(相比英语而言),是“接收者负责解释并理解”的,所以最好是说话方表达清楚。虽然不少场景下“接收方”可以根据上下文理解使用的是哪个de,但在一些简短、随意的句子中,就容易误解。

举个例子,假如有篇文章的题目是《Gao Xing De Xiao》(拼音),光凭读音,是无法确定作者想表达的是哪一个:

  1. 高兴的笑
  2. 高兴地笑
  3. 高兴得笑

应区分的例子

地/得

  1. 他高兴地哭了。 -- 他留下眼泪,是因为高兴而非悲伤。(姑且翻译成英语:He happily cries.)
  2. 他高兴得哭了。 -- 他太高兴了,以至于流下眼泪。 (姑且翻译成英语:He is so happy that he cries.)(前文提到的就是这个,朋友认为是用“地”)

的/得 - 1

  1. 要说蛋挞,这家店做的很好。 -- 这家店所出的蛋挞很好。(强调对象是“蛋挞”)
  2. 要说蛋挞,这家店做得很好。 -- 这家店做蛋挞的手艺很好。(强调对象是“店”)

的/得 - 2

  1. 《玩的就是心跳》 - 王朔所作
  2. 《玩得就是心跳》 - 语法上正确,非王朔所作,但有人误以为此乃王朔所著,见  http://www.bwsk.com/XD/w/wangsuo/wdjs/index.html

粤语中对三者的区分

会讲粤语的人基本上不会混淆这三个字,原因有二。

一是粤语口语中三个de是用不同的“代替字”的,此三字不同音,如:(三者以“粤拼”标音):

  • 的:嘅 ge3 (粤语中用“嘅”代替“的de”)
  • 地:噉 gam2 (粤语中用“噉"代替“地de”,表达“以..状态”,实质上将词副词化了;但“地方”一类词中仍然用“地”字)
  • 得:到 dou3 (粤语中用“到”代替“高兴得”一类词中的“得de";但“得到”的“得”的发音与“德”相同)

二是,即是在读书面语时,三者的发音亦是不同的,如(三者以“粤拼”标音):

  • 的:dik1
  • 地:dei6 (口语中有时会发deng6的音)
  • 得:dak1

推荐的区分方法

下面的方法只是基于粤语中区分三者的经验,非基于严格的语法。但正因如此,即使在不懂语法的情况下亦可使用。

  • 的 - 表示从属故而能用“之”(嘅)字代替,或放在句尾表结束的。例如,“处事的方法"(处事之方法/处事之道),“他会高兴的”。(注:“唱吧,激昂de地”一类语法不适用于此建议)
  • 地 - 表示状态故而能用“那样/以..状态”(噉)代替。例如,“他高兴地笑了” - “他高兴-那样子-笑了”,“他-以-高兴-的状态-笑了”。
  • 得 - 表示程度故而能用“到(以至于)”代替。例如,“他高兴得笑了” - 他高兴-到-笑了/他高兴-到那个程度以至于-笑了。

Integrates Beyond Compare to Gitbox

Beyond Compare eventually can runs as a native application on Mac OS X since version 4.0 of it.

I like using Gitbox to access Git repositories. Gitbox doesn't support integrating Beyond Compare as a diff tool since Gitbox has been not updated for more than 3 years.

Here is a tricky way to integrate Beyond Compare to Gitbox as a diff tool. Briefly, fake Beyond Compare as one of the tools which Gitbox supports. The follows are the steps.

Steps

1. Install Command Line Tools

You may also need to use Beyond Compare's command line tools, so, just click on the menu of Beyond Compare, and choose "Install Command Line Tools".

It will create two soft links for you:

  1. /usr/local/bin/bcomp:
    • Launches comparison and waits for it to complete.
  2. /usr/local/bin/bcompare:
    • Launches comparison and returns immediately.

2. Create the bridge

I choose BBEdit as a "bridge", it can be done by running:

sudo ln -s "/Applications/Beyond Compare.app/Contents/MacOS/bcomp" /usr/local/bin/bbdiff

3. Perform integration in Gitbox

In Gitbox, open "Preferences" and go to "Integration" tab, and choose "BBEdit" - it's enable since "bbdiff" was created.

Alternatives

Gitbox supports integrating with one of several diff tools, here is the map Gitbox uses to detect is a diff tool is installed or not:

  • FileMerge : opendiff
  • Kaleidoscope : ksdiff
  • Changes : chdiff
  • Araxis Merge : compare
  • BBEdit : bbdiff
  • TextWrangler : twdiff
  • DiffMerge : diffmerge

About

Please refer to Konca.

  • Posted: 2014-12-05 14:15
  • Author: konca
  • Categories: (none)
  • Comments (0)