Links

活着的三个理由

20th October 2011 0 comments Permalink
Articles

苹果常用软件推荐

有个朋友入了MAC,是个新手,虽然行业不同,但有些软件还是通用的:

  • AntiRSI:防止重复性劳损。
  • AppDelete:卸载软件
  • AppFresh:检查更新软件
  • BetterTouchTool:增强触摸板,这个非常不错,可以实现win7的靠边最大化功能。
  • BetterZip:解压软件
  • Burn:刻录软件
  • CleanMyMac:清理软件,注意不要把语言文件也清理了。
  • Evernote:比较红火的笔记软件,如果有道笔记出了MAC版,可以考虑用国内的替换
  • Firefox:我觉得是MAC下最好用的浏览器了,chrome的一些BUG让我有点不能忍受
  • iChat:聊天工具
  • iStat Menus:可以看到系统的监控状态
  • checkup: 可以直观地查看CPU什么的,就像你看到win7下“我的计算机”右键属性的信息一样,还可以当做任务管理器,结束一些进程
  • JustLooking:看图软件
  • LittleSnapper/Skim:截图软件,一般情况下用 cmd +shift +3/4 够了。
  • Monolingual:把一些驱动啊,内核什么的清理掉。
  • Hyperdock: 能够实现像win7一样的任务栏缩略图效果。
  • MPlayerX/ MPlayer OSX Extended:电影播放器,两个都不错,可以都安装。
  • OmmWriter:这个写随笔相当帅气,偶尔写写文字,抒发抒发心情。
  • Alfred : Quicksilver 的替代品,推荐
  • TextMate:编辑器,用来写代码非常好,不支持中文。当然,这个适合软件开发人员。
  • Things/OmniFocus/Wunderlist:GTD 软件
  • TotalFinder:finder 增强,小屏幕笔记本,尤其推荐
  • Transmit:FTP 软件
  • uTorrent:bt 软件
  • folx:  喜欢用迅雷的朋友可以尝试,下载速度不错,支持种子的下载
  • Vmware Fusion:虚拟机

上面列出的软件,有免费软件也有收费软件,版权问题自行解决,部分收费软件可以找到替代品。

以上大部分软件由漫步推荐:http://readful.com/post/575986611 ,我只是做了一些精简和增加,更加大众化而已,以后发现有更好用的软件会更新的

12th October 2011 0 comments Permalink
Articles

sqlite3的日期和时间格式化函数

Date And Time Functions

SQLite supports five date and time functions as follows:

 

  1. date(timestring, modifier, modifier, …)
  2. time(timestring, modifier, modifier, …)
  3. datetime(timestring, modifier, modifier, …)
  4. julianday(timestring, modifier, modifier, …)
  5. strftime(format, timestring, modifier, modifier, …)

All five date and time functions take a time string as an argument. The time string is followed by zero or more modifiers. The strftime() function also takes a format string as its first argument.

The date and time functions use a subset of IS0-8601 date and time formats. The date() function returns the date in this format: YYYY-MM-DD. The time() function returns the time as HH:MM:SS. The datetime() function returns “YYYY-MM-DD HH:MM:SS”. The julianday() function returns the Julian day - the number of days since noon in Greenwich on November 24, 4714 B.C. (Proleptic Gregorian calendar). The strftime() routine returns the date formatted according to the format string specified as the first argument. The format string supports the most common substitutions found in the strftime() function from the standard C library plus two new substitutions, %f and %J. The following is a complete list of valid strftime() substitutions:

%d day of month: 00
%f fractional seconds: SS.SSS
%H hour: 00-24
%j day of year: 001-366
%J Julian day number
%m month: 01-12
%M minute: 00-59
%s seconds since 1970-01-01
%S seconds: 00-59
%w day of week 0-6 with Sunday==0
%W week of year: 00-53
%Y year: 0000-9999
%% %

Notice that all other date and time functions can be expressed in terms of strftime():

Function Equivalent strftime()
date(…) strftime(‘%Y-%m-%d’, …)
time(…) strftime(‘%H:%M:%S’, …)
datetime(…) strftime(‘%Y-%m-%d %H:%M:%S’, …)
julianday(…) strftime(‘%J’, …)

The only reasons for providing functions other than strftime() is for convenience and for efficiency.

Time Strings

A time string can be in any of the following formats:

  1. YYYY-MM-DD
  2. YYYY-MM-DD HH:MM
  3. YYYY-MM-DD HH:MM:SS
  4. YYYY-MM-DD HH:MM:SS.SSS
  5. YYYY-MM-DDTHH:MM
  6. YYYY-MM-DDTHH:MM:SS
  7. YYYY-MM-DDTHH:MM:SS.SSS
  8. HH:MM
  9. HH:MM:SS
  10. HH:MM:SS.SSS
  11. now
  12. DDDDDDDDDD

In formats 5 through 7, the “T” is a literal character separating the date and the time, as required by ISO-8601. Formats 8 through 10 that specify only a time assume a date of 2000-01-01. Format 11, the string ‘now’, is converted into the current date and time as obtained from the xCurrentTime method of the sqlite3_vfs object in use. Universal Coordinated Time (UTC) is used. Format 12 is the Julian day numberexpressed as a floating point value.

Modifiers

The time string can be followed by zero or more modifiers that alter date and/or time. Each modifier is a transformation that is applied to the time value to its left. Modifiers are applied from left to right; order is important. The available modifiers are as follows.

  1. NNN days
  2. NNN hours
  3. NNN minutes
  4. NNN.NNNN seconds
  5. NNN months
  6. NNN years
  7. start of month
  8. start of year
  9. start of day
  10. weekday N
  11. unixepoch
  12. localtime
  13. utc

The first six modifiers (1 through 6) simply add the specified amount of time to the date and time specified by the preceding timestring and modifiers. Note that “±NNN months” works by rendering the original date into the YYYY-MM-DD format, adding the ±NNN to the MM month value, then normalizing the result. Thus, for example, the data 2001-03-31 modified by ‘+1 month’ initially yields 2001-04-31, but April only has 30 days so the date is normalized to 2001-05-01. A similar effect occurs when the original date is February 29 of a leapyear and the modifier is ±N years where N is not a multiple of four.

The “start of” modifiers (7 through 9) shift the date backwards to the beginning of the current month, year or day.

The “weekday” modifier advances the date forward to the next date where the weekday number is N. Sunday is 0, Monday is 1, and so forth.

The “unixepoch” modifier (11) only works if it immediately follows a timestring in the DDDDDDDDDD format. This modifier causes the DDDDDDDDDD to be interpreted not as a Julian day number as it normally would be, but as Unix Time - the number of seconds since 1970. If the “unixepoch” modifier does not follow a timestring of the form DDDDDDDDDD which expresses the number of seconds since 1970 or if other modifiers separate the “unixepoch” modifier from prior DDDDDDDDDD then the behavior is undefined. Due to precision limitations imposed by the implementations use of 64-bit integers, the “unixepoch” modifier only works for dates between 0000-01-01 00:00:00 and 5352-11-01 10:52:47 (unix times of -62167219200 through 10675199167).

The “localtime” modifier (12) assumes the time string to its left is in Universal Coordinated Time (UTC) and adjusts the time string so that it displays localtime. If “localtime” follows a time that is not UTC, then the behavior is undefined. The “utc” is the opposite of “localtime”. “utc” assumes that the string to its left is in the local timezone and adjusts that string to be in UTC. If the prior string is not in localtime, then the result of “utc” is undefined.

Examples

Compute the current date.

 

SELECT date(‘now’);

Compute the last day of the current month.

SELECT date(‘now’,'start of month’,'+1 month’,'-1 day’);

Compute the date and time given a unix timestamp 1092941466.

SELECT datetime(1092941466, ‘unixepoch’);

Compute the date and time given a unix timestamp 1092941466, and compensate for your local timezone.

SELECT datetime(1092941466, ‘unixepoch’, ‘localtime’);

Compute the current unix timestamp.

SELECT strftime(‘%s’,'now’);

Compute the number of days since the signing of the US Declaration of Independence.

SELECT julianday(‘now’) – julianday(’1776-07-04′);

Compute the number of seconds since a particular moment in 2004:

SELECT strftime(‘%s’,'now’) – strftime(‘%s’,’2004-01-01 02:34:56′);

Compute the date of the first Tuesday in October for the current year.

SELECT date(‘now’,'start of year’,'+9 months’,'weekday 2′);

Compute the time since the unix epoch in seconds (like strftime(‘%s’,'now’) except includes fractional part):

SELECT (julianday(‘now’) – 2440587.5)*86400.0;

12th October 2011 0 comments Permalink

美国科学家Bruce Beutler、法国科学家Jules Hoffmann和加拿大科学家Ralph Steinman因在免疫系统上的重要发现而分享了2011年诺贝尔医学或生理学奖。

美国科学家Bruce Beutler、法国科学家Jules Hoffmann和加拿大科学家Ralph Steinman因在免疫系统上的重要发现而分享了2011年诺贝尔医学或生理学奖。

Beutler和Hoffmann的贡献是发现如何激活先天免疫,而Steinman的贡献是发现树突状细胞及其在后天免疫系统中的作用。Beutler和Hoffmann将共同分享150万美元奖金中的一半,Steinman则分享另一半。

(Source: nobelprize.org)

3rd October 2011 0 comments Permalink
Articles

Windows Phone 7芒果即将发布

We are mostly expecting Mango to start rolling out tomorrow, and Microsoft is egging us on on Facebook with enigmatic postings about the “best surprise” lately.

我们都在期待芒果明天(美国27号)开始推送,此时微软在facebook上发了一条“最好的惊喜”给我们无限猜测。

image250.jpg

All I can say is I would be pretty surprised if Mango does not start showing up tomorrow

, ,
27th September 2011 0 comments Permalink
Statistical data collected by Statpress SEOlution (blogcraft).