Sunday, November 29, 2015

在温哥华办理美国签证攻略

在温哥华办理美国签证攻略

非移民签证常见类型

  • CNMI-only(仅限于美国北玛利安纳群岛) transitional worker(CW-1).
  • business visitor商务访问(B-1)
  • Exchange visitor交换访问(J)
  • Intra-company transferee公司内部穿梭(L)
  • Tourism, vacation, pleasure visitor旅游(B-2)

照片场景要求

  • Sized such that the head is between 1 inch and 1 3/8 inches (22 mm and 35 mm) or 50% and 69% of the image's total height from the bottom of the chin to the top of the head.
  • Taken in front of a plain white or off-white background

照片拍摄和处理要求


Dimensions The image dimensions must be in a square aspect ratio (the height must be equal to the width). Minimum acceptable dimensions are 600 x 600 pixels. Maximum acceptable dimensions are 1200 x 1200 pixels.
Color The image must be in color (24 bits per pixel) in sRGB color space which is the common output for most digital cameras.
File Format The image must be in JPEG file format
File Size The image must be less than or equal to 240 kB (kilobytes).
Compression The image may need to be compressed in order for it to be under the maximum file size. The compression ratio should be less than or equal to 20:1.

详细流程

  1. 浏览 领事电子申请中心 以申请非移民签证。
  2. ...

Saturday, November 21, 2015

FOREX Trader(FOREXTrader) insturctions

FOREX Trader(FOREXTrader) insturctions

list of vocabularies

Trading Handbook

bollinger_bands

Fees

FOREX.com charges no trading commissions or transaction fees. FOREX.com charges a data fee of $15 per month if there is no trading activity or no open positions for a period of 90 days or more. Contact us if you wish to disable your account temporarily and avoid this fee.

Order Basis/Mode

Market orders:Market orders are executed at the best available price at the time the order is received. always check the market price before you make orders.

Limit Orders: Limit orders are executed at the order rate or better. Sell limit orders are filled when the bid(买家出价) reaches the requested rate; buy limit orders are filled on the offer(zxxu:to say, immidiately making the order).

Stop Orders: Stop orders become market orders when a predefined order rate is reached. Stop orders are executed at the best available price, depending on available liquidity. Buy Stop orders are filled on the offer price and Sell Stop orders are filled at the bid price.

Orders can be set to open a new position or close an existing position. To set a limit order to open a new position, you are trying to get a “better” price to buy or sell. Let’s say USDCAD is currently at 1.3000, a “better” price to buy is a price lower than 1.3000 or a “better” price to sell is a price higher than 1.3000. Stop is basically the opposite of limit, so you would set a buy order higher than the current price or a sell order lower than the current price.If you set an order to close a position, then limit means take profit and stop means stop loss.

Order Expiry

End of Day (EOD) orders automatically expire at 5pm ET on the same day the order was entered(Note:opening prices may differ significantly from the previous day's close.). Good till Cancelled (GTC) orders automatically expire on the Saturday following the 90th calendar day from the date the order was entered.

Orders Left Over the Weekend or Holidays

FOREX.com's trading hours are from Sunday at 5pm ET through Friday at 5pm ET. Orders left pending over a weekend or holiday period will not be executed until FOREX.com resumes regular trading hours.

Order Types

One Cancels Other (OCO's):A contingent(有条件的) order providing that one part of the order is cancelled if the other part is executed. If one part of the order is filled, the other is automatically cancelled.

An If/Then order provides that if the first order ("If" order) is executed, the second order ("Then" order) becomes an active unassociated single order. Unassociated orders are not attached to a trade and act independently of any position updates. In cases where the “If” order does not execute, the “Then” single order will remain dormant and will not be executed when the market reaches the specified rate. When either part of an If / Then order is cancelled, all parts of the order are cancelled as well.

An If/Then OCO provides that if the first order ("If" order) is executed, the second order ("Then" order) becomes an active unassociated OCO order. The execution of either one of the two "Then" orders automatically cancels the other. When any part of an If / Then OCO order is cancelled, including either leg of the OCO order, all parts of the order are cancelled as well.

A trailing stop allows a trade to continue to gain in value when the market price moves in a favorable direction, but automatically closes the trade if the market price suddenly moves in an unfavorable direction by a specified distance.

When the market price moves in a favorable direction, the trigger price follows the market price by the specified stop distance. If the market price moves in an unfavorable direction, the trigger price stays stationary and the distance between this price and the market price becomes smaller. If the market price continues to move in an unfavorable direction until it reaches the trigger price, an order is triggered to close the trade.

Rollovers

rollovers

什么是rollovers

当你买入一种货币对的时候,你要么支付利息,要么获得利息(charges or credits)。以下是专家的解释:" You can think of rollovers as putting money into one bank and borrowing money from another bank. For example: Let's say you want to earn on the rollover (interest differential between two countries/banks). The Bank of England (GBP)'s interest rate is 5.5%. The Bank of Japan (JPY)'s interest rate is 0.5%. If you wanted to in this circumstance you would borrow money from the Bank of Japan (0.5%) and deposit it into the Bank of England (+5.5%), thus earning 5.0% on the money you borrowed. However, the rates are compounded daily, thus causing a much smaller interest rate differential. The same principles apply when you buy (go long), on the currency pair GBP/JPY. Essentially you are buying the GBP (the base currency) and selling JPY (the counter currency) at the same time. Because the interest rate is currently higher on the GBP (Bank of England) than the JPY (Bank of Japan), you will earn interest on the position when rolled over.... The exception is a position opened and held overnight on Wednesday. The normal value date would be Saturday(not next day); because banks are closed on Saturday the value date is actually the following Monday. Due to the weekend, positions held overnight on Wednesday incur or earn an extra two days of interest. Trades with a value date that falls on a holiday will also incur or earn additional interest.... "

rollover总是在16:59进行,也就是加拿大14:59(冬令时), 所以在这个时间点之前平仓就可以避免rollovers问题。

如何确定rollovers

加拿大人最好在http://www.forex.com/ca/trading-platforms/forextrader/pricing/rollovers.html查看每天的rollovers(Rollovers are calculated based on 10,000 position, and amounts are in USD), 或者在forex客户端查看。

影响rollovers的条件

  • The interest rate differentials between the country's associated with the pair you're trading. Have a glance to http://www.global-rates.com/interest-rates/central-banks/central-banks.aspx as a quick reference.
  • the day of the week(一般来说在周三最有利)

以下几点要注意:

  • FOREX.com 会对各国银行interest rate进行修正,这也是他们的赚点之一。
  • 对于当前利息差别很大的两个国家,每天的rollover值变化不大。
  • 即使是高级客户也不享受rollovers的优惠。

Thursday, November 19, 2015

Exponential moving average

Exponential moving average

Exponential moving averages reduce the lag by applying more weight to recent prices. The weighting applied to the most recent price depends on the number of periods in the moving average. There are three steps to calculating an exponential moving average. First, calculate the simple moving average. An exponential moving average (EMA) has to start somewhere so a simple moving average is used as the previous period's EMA in the first calculation. Second, calculate the weighting multiplier. Third, calculate the exponential moving average. The formula below is for a 10-day EMA.


SMA: 10 period sum / 10 

Multiplier: (2 / (Time periods + 1) ) = (2 / (10 + 1) ) = 0.1818 (18.18%)

EMA: {Close - EMA(previous day)} x multiplier + EMA(previous day). 

Monday, November 16, 2015

BC省购买Townhouse指南

BC省购买Townhouse指南

前期准备

术语扫盲

  • 分契物业: 分契物业(strata)和共管物业(condominium)这两个词的含义相同。卑诗省是北美唯一使用“strata”而非“condominium”的地区。
  • 分契单位/单元(strata lot): 购买房子的时候最好记住这个号码,比如strata lot 04.
  • owner of strata lot: 业主
  • strata corporation: 物业公司,即(帮助)管理业主的物业的公司.
  • MSL(Multiple Listing Service): 我们经常说MSL号(MSL Number/MSL #)是由MSL Department统一编制的,很多地产网可以通过这个编号来直接搜索房源

选房指标

  • 价格:一般来说首付都是20%,那么以12万的首付来算,能买的房子是12*5=60万,也就是应该贷48万;而以13万的首付来算,能买的房子是13*5=65万,也就是应该贷52万;
  • 周边环境
  • 卧室数量:一般来说,3口之家再加父母需要3间房,所以加上书房一共需要4间房。
  • 主卧一定要有浴缸
  • 一定要有煤气
  • 小院休闲待客区不能过小
  • 离高压线、变压器等过近?
  • 离危险源(比如湖、森林)过近?
  • 地势过低?
  • 不考虑治安不好的地区
  • 临近常态噪声源(比如铁轨)?
  • 周边有墓地或者屋内死过人?
  • 各种家用设施比如冰箱、空调是否完好。
  • 价面比(面积要取单层面积,不要算总面积!)
  • 成交价格对比
  • 最好不要中间的Townhouse(Townhouse一般都是好几个相连)
  • 小孩上学问题

推荐的房源网

http://www.century21.ca/

http://www.realtor.ca 目前的特色如下:

  • 搜索房源的时候有Open Houses Only 选项
  • ...

推荐的中介

Sutton Group Westcoast(West Coast) Realty

重要文件需要在相中房子以后向中介索取

Form-B

要特别注意物业公司是否陷入法律和经纪纠纷。

要注意前业主是否还有未交完的钱。

要注意物业当年的超支预算。

要注意物业是否允许出租

Land title(土地所有权) search

这个文件中如下重要内容:

  • 搜索(search)的具体时间(当然越近约好)
  • 房子属于的城市,比如Surrey, Burnaby(注意这跟注册没有关系,温哥华的房子一般都注册在new westminster)
  • MSL号
  • 房主名(如果有多个房主一般会用地址符间隔开)
  • 房主邮寄地址(如果房主住在里面一般也是他的住址,但既然是在售房源,此地址一般来说不是房源地址)

Property disclosure statement (PDS)

这个文件中卖家会回答房子有关的一切问题,也是成交之前需要获取的重要文件。

Rules of the strata corporation(其中也包括出租规定)

Strata Minutes(物业会议,所有业主参与)



买完房以后要做的事情

  • 提前2个星期到物业登记
  • 找物业要门禁卡
  • 找物业要活动室的钥匙

Saturday, October 31, 2015

Raise Google Ranking

Raise Google Ranking

Google's search engine uses a variety of methods to determine which pages are displayed first in the results. Their exact formula is a secret, but there are always a few things you can do to improve your positioning. The term for this is Search Engine Optimization (SEO).

Keyword Phrases

A keyword phrase is, generally speaking, the words you think someone is most likely to put into a search engine to find your content. They should appear in your content. Don't overdo it( If it looks spammy, it probably is ) or hide your keyword such as making text "invisible."( It doesn't work. In fact, some of that behavior even get your website banned).

Name Your Pages

Give your pages a descriptive name with the title attribute. This is vital. Google often displays search results as a link using the Web page's title.When appropriate, use the page's keyword phrase in the title.

Links

One of the biggest factors Google looks at is the hyperlink. Google looks at both links to and from your website.Google looks at the words you use in links to help determine the content of your page. Rather than saying, "click here to learn more about SEO" you should say: Read more about SEO (Search Engine Optimization).

Links from other websites to your website are used to determine PageRank.You can improve your PageRank by exchanging text links with other relevant websites(Note:pages that want to charge you for this service are often known spammers that can hurt your rank).

Links are another area where you shouldn't overdo it. A page that is nothing but a list of links is spam.

Social Networking

Social networking sites can be a good way to promote a site, Google+ promotion may have the most impact. That said, you may find that a great deal of your traffic comes from social networks, so be sure to make your content social friendly.

Make Your Graphics Search Friendly

Give your images alt attributes. Not only does it make your website more accessible to the visually impaired, it also gives you another chance to place your keywords where Google can see them.

use robots.txt

User-agent: *
Allow: /

Use Serps.com to check your site’s keyword rank:
Ranking queried from Serps.com

To find out how many visitors reach your site, log into your Google Analytics account and check out the acquisition channels report. This helpful Google Analytics video tutorial will guide you.

As well as analyzing your search traffic, it’s worth paying attention to the keywords that generate traffic for your site. One way to find these is with a tool called Serp Fruit. It's still in beta, but I’ve been using it. One reason I recommend it is because it's simple to use.

Following links may help:
http://google.about.com/od/searchengineoptimization/qt/improverank.htm
http://neilpatel.com/2014/12/02/improve-google-rankings-without-getting-penalized/
www.thesitewizard.com/archive/google.shtml

Wednesday, October 28, 2015

install_Vc6_on_Win7

精简版安装(不适合编译大工程):

  1. Prepare VC 6.0精简版:
    • VC6.0精简版下载地址:http://pan.baidu.com/s/1sj6VF6t 密码:jnfg
    • http://www.downcc.com/soft/24456.html
  2. //Let installation to skip Java update check: create zero byte file C:\Windows\MSJAVA.DLL
  3. 安装完成后,“右键 -> 属性 -> 兼容方式”进行设置WINXP SP2以及以管理员方式运行

完整版安装:

  1. VC6.0完整版(集成SP6,支持WIN764/32)下载地址:http://pan.baidu.com/s/1c0zneDU 密码:ebon
  2. 选择自定义安装,如果有“OLE/COM Object Viewer”,选项去掉(不兼容);去掉其他用不上的功能
  3. 在询问是否注册环境变量是,选择是
  4. 安装XP Platform SDK(本人的处理器为intel AMD64,所以下载XP_2003_SDK-amd64.exe,此sdk支持win2003和XP):
    • OPEN MSDEV,From the Tools menu, click Options....,select the Directories tab, Add a new directory entrY AS FIRST:C:\Program Files\XP_2003_SDK\Include
    • select Library files,Add a new directory:C:\Program Files\XP_2003_SDK\Lib
  5. 编译IDE快捷方式设置以管理员方式运行,但是不要设置兼容模式(打开FortiAvEngine会Crash)
  6. 下面是安装完成后常见问题的解决方案:http://c.biancheng.net/cpp/html/2241.html

linux cmds

  • decompress tar.bz2: tar jxf FILENAME
    j - deal with bzipped file
    x - extract
    f - read from a file, rather than a tape device
    v - verbose output (lists all files as they are extracted)
    -C existing_dir: extract files into this dir
    

list of env vars in windows

%cd% : current dir
%ProgramFiles%
%ProgramFiles(x86)%

view and set env var in bat

echo %ProgramFiles%

set ProgFiles=%ProgramFiles%
if exist "%ProgramFiles(x86)%" set ProgFiles=%ProgramFiles(x86)%

Sources文件

环境变量
$BASEDIR: DDK安装路径,如D:\ProgramFiles\WinDDK7600.16385.0
$_NTDRIVE !!DDK安装路径的驱动器目录,如D:\ProgramFiles\WinDDK7600.16385.0,则$NTDRIVE=D:
$_NTROOT $BASEDIR-$NTDRIVE,如$BASEDIR=D:\ProgramFiles\WinDDK7600.16385.0,则\ProgramFiles\WinDDK7600.16385.0
例1:
TARGETNAME=HelloDDK
TARGETTYPE=DRIVER
TARGETPATH=d:\t  //生成的sys文件放在TARGETPATH下
INCLUDES=$(BASEDIR)\inc;\
         $(BASEDIR)\inc\ddk;\
SOURCES=Driver.cpp\
例2:
TARGETNAME=HelloWDM
TARGETTYPE=DRIVER
DRIVERTYPE=WDM
TARGETPATH=d:\t
INCLUDES=$(BASEDIR)\inc;\
         $(BASEDIR)\inc\ddk;\
SOURCES=HelloWDM.cpp\

Tuesday, October 27, 2015

吐槽大温2015新交规

2015新交规应该是异常严厉了,照这个罚法我裤衩都穿不起了 以下列几条猛的,平时总犯。
0 改住址超过10天通知DMV(Driver Licensing Office): CA$214
1 在双闪的校车后面不停要罚: CA$675
2 右转弯红灯不停: CA$533
3 非法U形转(U-Turn):CA$284
4. 超速:低于16迈(CA$224), 高于16迈(CA$338)
5. 开慢了: CA$328
6. 停牌越线:CA$284
7. 占公交站:CA$976
8. 开汽车大灯不关:CA$382
...

Sunday, October 25, 2015

NT式驱动和WDM

设备管理器中打开显示隐藏设备开关,就能在非即插即用中列出所有NT式驱程,显示的名称并非设备名称,也非设备的符号链接名称,而是CreateService函数中的参数lpServName。 AddDevice是WDM独有的,由PNP函数回调;而NT式驱动只能在DrvEntry调用IoCreateDev(即驱动加载以后设备也创建好了)

句柄之于Windows

内核对象都有安全属性,所有CreateXXX(lpSecurityAttr)函数都不会直接返回指针给用户,这就是句柄存在的意义。进程内的句柄值是唯一的,所以CloseHandle(hid)会准确地关闭相应的内核对象。内核对象都对应一个数据结构(比如KEVENT),通过句柄可以获得对象的指针(比如PKEVENT),方法是使用ObReferenceObByHandle(当然也可以通过内核对象的名称获取对象指针)。

Thursday, October 22, 2015

系统线程

系统线程隶属于系统进程(例如进程号为0的SystmIdleProc,csrss.exe,System等等),使用PsCreateSystemThread可以创建系统线程(这个函数也可以创建系统进程).

自旋锁

在单CPU系统中,获取自旋锁的原理是将IRQL提升至DISPATCH_LEVEL,这样线程是无法被调度的,因此资源就必定被该线程所占有;这种同步方法与其他同步方法有本质区别,比如等待事件发生的线程可以被调度。

Wednesday, October 21, 2015

红辉跑腿公司

公司(主要)通过微信公众号来运营,公众号的名字和你注册的公司名字最好相同,且名字要唯一(至少百度和谷歌将来都能精确地搜索出来)。

公众号提供的服务模式为: 买家和卖家在系统内都有帐号。买家提需求,卖家由公司联系。

公众号提供的服务流程为: 买家在公众号内发布任务(每一个任务在系统里有一个唯一的标志号),公司员工联系卖家,卖家接受任务以后,这一任务对卖家可见,且卖家负责跟这一任务直到任务关闭和评分.

需要注意: 公司、买家和卖家建立在诚信的基础上, 对于信誉不好的卖家和买家,公司将其列入黑名单。

西三一大学

西三一大学是加拿大一所私立基督教文科大学(西应该指的大温地区的西部,三一是指三一神,即耶稣基督),提供本科和硕士课程,在教会学校中名列前茅(排名请参考http://www.360chuguo.com/liuxue/ca/00167208.htm).

学校位于加拿大哥伦比亚省兰里地区(Langley,BC,Canada),兰里地区靠近美国、白石(富人区、旅游区)和列治文(华人区)。

请参考学校主页( twu.ca, Trinity Western University at Canada )

请参考课程介绍

请参考入学要求和联系方式

Tuesday, October 20, 2015

MakeEarningsByYoutube上传挣钱YouTube

上传自制视频或者没有版权的视频(并入微信里的个人创作)并一劳永逸地获利是个不错的网赚手段。

为了通过视频赚钱并获得付款,您需要将 AdSense 帐户与自己的 YouTube 帐户关联起来。

在youtube中打开自己账户的频道设置->高级,设置国家为加拿大(中国不是youtube的广告合作伙伴)。

在频道设置中,按获利按钮,并为我的帐户启用获利:系统会将您重定向到 AdSense 以关联您现有的 AdSense 帐户,在您完成此过程后,系统会将您重定向到 YouTube.

Friday, October 16, 2015

炒外汇通俗扫盲

炒外汇通俗扫盲

什么是货币对

货币对是指炒汇时可以相互兑换的两个货币,比如USD/CAD表示美元 VS 加币(炒外汇时人民币不对任何货币),这里美元是基础货币(base currency),加币是引用货币(quote currency,或者terms currency)。

什么是点(pip/PIP)

点即是汇率中的万分位(即0.0001),另外,汇率精确到十万分之一,所以十万分位称为分点(fractional pip)。

什么是手(lot)

一个标准手是10万,一个迷你手是1万;外汇买卖中,手和合约是同义词,1手就是一个合约(后者比较费解)。

不考虑杠杆,如何计算盈亏?

例(1):熊熊以1.28654的汇率买USD/CAD, 以1.28713的汇率卖,交易量都是1个迷你手,请问本次买卖的盈亏如何?

答: 熊熊先把12865.4加币换成1万美金,然后将1万美金以1.28713的汇率换回,他的盈亏=(1.28713-1.28654)*10000=5.9 加币


例(2):熊熊以0.743的汇率卖CAD/CHF, 以0.74197的汇率买,交易量为2000,请问本次买卖的盈亏如何?

答: 盈亏=(0.743-0.74197)*2000 = 2.06 瑞士法郎 = 2.06/0.74197=2.776=2.78 加币。

从以上两例不难看出,因为法郎目前比加币值钱,所以加拿大人目前炒法郎很刺激。

考虑杠杆,如何计算盈亏?

外汇买卖几乎都要带杠杆玩,带不带杠杆盈亏都是一样的。那么杠杆有什么意义呢?比如例(1)中,你不能用1万多块来炒外汇,因为口袋里只有2千多块,那就需要借钱玩,这时候就用到杠杆了。现在假设杠杆是10倍的(加拿大人能玩的杠杆是IIROC决定的,每一种外汇对的杠杠值参见Trading Handbook),那么帐号中至少要有12865.4/10=1286.54的加币(其余的钱都是借的),但是最好多放点,因为汇率又涨也有跌。

什么是未实现的盈亏(unrealized p/l,即 unrealized Profit and Loss)

假设以0.74196卖出2迷你手的CAD/CHF,现在要将其买回,实时买入价为0.74251,那么你的盈利为(0.74196-0.74251)*2000..., 算出来的数字就是未实现的盈亏。

如何计算保证金消耗

...

Saturday, October 10, 2015

中国联通在线业务办理

前些天手机2G转4G,竟然把国际漫游业务(联通的国际漫游和国际长途是绑定的)给转没了,这时想到了在线办理业务。

使用联通微信这个公众号和预设指令,我查到天津市和平区的联通客服qq,把身份证放在白纸上并写明"仅用于开通国际漫游"然后拍照传给在线客服,几分钟之后就办好了,避免了去营业厅,真的很棒。

以后还是尽量使用联通微信和客服qq吧,很不错的哦!

Friday, August 28, 2015

blogspot_zxxu

Thank you for visit my blog;At the right of the page plz link to all of my posts.

Friday, July 24, 2015

Locale

The value LC_ALL(0x0) for category names the program’s entire locale
LC_CTYPE(char type) affects the behavior of
the character handling functions and the multibyte and wide character functions.
LC_NUMERIC affects the decimal-point character for the formatted input/output functions and the string conversion functions, as well as the
nonmonetary formatting information returned by the localeconv function

char *setlocale(int category, const char *locale_to_be_set):
A value of "C" for locale_to_be_set specifies the minimal environment for C translation(At program startup, the equivalent of setlocale(LC_ALL, "C"); is executed.).A value of "" specifies the locale-specific native environment.
If a pointer to a string is given for locale and the selection can be honored, the
setlocale function returns a pointer to the string associated with the specified
category for the new locale.

Floating-point environment(fenv)

The type fenv_t represents the entire floating-point environment.
The type fexcept_t represents the floating-point status flags collectively, including any status the implementation associates with the flags.

a function call is assumed to require default floating-point control modes, unless its
documentation promises otherwise(The macro FE_DFL_ENV
represents the default floating-point environment — the one installed at program startup
— and has type ‘‘pointer to const-qualified fenv_t’’).

The FENV_ACCESS pragma provides a means to inform the implementation when a
program might access the floating-point environment to test floating-point status flags or
run under non-default floating-point control modes.The FENV_ACCESS macro is scopable(zxxu),for eaxmple,When inside a compound statement, the pragma takes effect from its occurrence until another FENV_ACCESS pragma is encountered (including within a
nested compound statement), or until the end of the compound statement).

EXAMPLE:
#include <fenv.h>
void f(double x)
{
#pragma STDC FENV_ACCESS ON
void g(double);
void h(double);
/* ... */
g(x + 1);
h(x + 1);
/* ... */
}

the function g might depend on status flags set as a side effect of the first x + 1, or the second
x + 1 might depend on control modes set as a side effect of the call to function g, and so on.

EXAMPLE:Call f if ‘‘invalid’’ is set, then g if ‘‘overflow’’ is set:
#include <fenv.h>
/* ... */
{
#pragma STDC FENV_ACCESS ON
int set_excepts;
feclearexcept(FE_INVALID | FE_OVERFLOW);
// maybe raise exceptions
set_excepts = fetestexcept(FE_INVALID | FE_OVERFLOW);
if (set_excepts & FE_INVALID) f();
if (set_excepts & FE_OVERFLOW) g();
/* ... */
}

7.4 Character handling(ctype)

The header <ctype.h> declares several functions useful for classifying and mapping
characters.166) In all cases the argument is an int, the value of which shall be
representable as an unsigned char or shall equal the value of the macro EOF(0xffFFffFF). If the
argument has any other value, the behavior is undefined.

The term printing character refers to a member of a locale-specific set of characters, each
of which occupies one printing position on a display device; the term control character
refers to a member of a locale-specific set of characters that are not printing
characters.

The isalpha function tests for any character for which isupper or islower is true,
or any character that is one of a locale-specific...

The isblank function tests for any character that is a standard blank character or is one
of a locale-specific set of characters for which isspace is true and that is used to
separate words within a line of text. The standard blank characters are the following:
space (' '), and horizontal tab ('\t').

The isspace function tests for any character that is a standard white-space character or
is one of a locale-specific set of characters. The standard white-space characters are the following: space (' '), form feed ('\f'), new-line
('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').(blank<space,LF,VT,FF,CR属于space但不属于blank)

isxdigit: 0~9 a~f A~F

Standard headers

Standard headers may be included in any order; each may be included more than once in
a given scope, with no effect different from being included only once, except that the
effect of including <assert.h> depends on the definition of NDEBUG:The assert macro is redefined according to the current state of NDEBUG each time that
<assert.h> is included.

Provided that a library function can be declared without reference to any type defined in a
header, it is also permissible to declare the function and use it without including its
associated header.

There is a sequence point immediately before a library function returns(一般来说,sequence point是分号).

函数签名和宏签名可以相同,以下是例子:
— by use of its associated header (possibly generating a macro expansion)
#include <stdlib.h>
const char *str;
/* ... */
i = atoi(str);
— by use of its associated header (assuredly generating a true function reference)
#include <stdlib.h>
#undef atoi    //明确取消宏定义,只保留函数定义
const char *str;
/* ... */
i = atoi(str);
or
#include <stdlib.h>
const char *str;
/* ... */
i = (atoi)(str);//采用括号来避免宏展开,否则possibly generating a macro expansion
— by explicit declaration
extern int atoi(const char *);
const char *str;
/* ... */
i = atoi(str);
168

6.3.2.1 Lvalues, arrays, and function designators

Anlvalue is an expression with an object type or an incomplete type other than void.A modifiable lvalue is an lvalue that does not have array type, does
not have an incomplete type, does not have a const-qualified type, and if it is a structure
or union, does not have any member (including, recursively, any member or element of
all contained aggregates or unions) with a const-qualified type.

Linkages of identifiers

An identifier declared in different scopes or in the same scope more than once can be made to refer to the same object or function by a process called linkage. There are three kinds of linkage: external, internal, and none.

For an identifier declared with the storage-class specifier extern, if the prior declaration specifies internal or
external linkage, the linkage of the identifier at the later declaration is the same as the
linkage specified at the prior declaration. If no prior declaration is visible, or if the prior
declaration specifies no linkage, then the identifier has external linkage

If the declaration of a file scope identifier for an object or a function contains the storageclass
specifier static, the identifier has internal linkage

Each declaration of an identifier with no linkage denotes a unique entity such as an identifier declared to be a function parameter or a block scope
identifier for an object declared without the storage-class specifier extern.

Tuesday, July 21, 2015

GST,PST,HST

gst就是GOV税,pst就是省税,hst就是改一个名字来强制收省税

GST,PST是之前的旧税制 HST是合并以后的税制 不过马上要回去了~~~~~

把汽车卖给二手车行 trade in trade-in

 trade in就是把二手车卖给车行,单独把车卖给dealer也行,以旧换新也可以。

trade in一般以旧换新,旧的折算成一定金额。你买50000的车,trade-in值35000,那只付差价的15000就可以了,税也只付差价的税而不是全部的税。

Saturday, July 18, 2015

温哥华钓鱼/捕蟹注意事项

在特定水域
捕到下列
几种鱼要在licence上记录下来:

*steelhead硬头鳟(Kootenay库特奈湖 或者 Shuswap 舒斯韦普湖)
*成年Chinook salmon切努克鲑鱼(Kootenay湖 或者 Shuswap湖)
*超过半米的rainbow trout虹鳟鱼(Kootenay湖 或者 Shuswap湖)
*超过60cm的Char红点鲑鱼(Shuswap湖)


英语学习 学习英语 exclusive of

The ship has a crew of 57 exclusive of officers不包括,把…排除在外

Monday, July 13, 2015

_vbaRedim vbaRedim

__cdecl SAFEARRAY*
    __vbaRedim(arg0__Flags_HAVEVARTYPE,arg4__SizeOfVbLong_4,arg8__ppSAFEARRAY_40D060,argC__VARTYPE_vbLong,arg10__cDims_1,
    arg14__Dim0High,arg18__Dim0Low,...DimNHigh,DimNLow,...)
{
    sub_660DAEFA(
        arg0__Flags_HAVEVARTYPE,
        arg4__SizeOfVbLong_4,
        argC__VARTYPE_vbLong,
        arg10__cDims_1,
        &LowHighBounds,
        arg8__ppSAFEARRAY_40D060);
   
    return *arg8__ppSAFEARRAY_40D060;
}

void __stdcall
sub_660DAEFA(arg0__Flags_HAVEVARTYPE, arg4__SizeOfVbLong_4, arg8__VARTYPE_vbLong, argC__cDims_1, arg10__LowHighBounds, arg14_ppSAFEARRAY)
{
    //loc_660DAFEA
    SafeArrayAllocDescriptorEx(arg8__VARTYPE_vbLong,argC__cDims_1,arg14_ppSAFEARRAY);
    pSAFEARRAY->fFeatures = arg0__Flags_HAVEVARTYPE;
    pSAFEARRAY->cbElement = arg4__SizeOfVbLong_4;
   
    arg4__SizeOfVbLong_4=0;
    arg8__VARTYPE_vbLong  = &pSAFEARRAY->lLbound;//The lower bound of the dimension.
   
    for(iDim=0;iDim<cDims;++iDim)
    {
        pSAFEARRAY->rgsabound[iDim].cElements = arg10__LowHighBounds[iDim].High - arg10__LowHighBounds[iDim].Low + 1;
        pSAFEARRAY->rgsabound[iDim].lLbound = arg10__LowHighBounds[iDim].Low;
    }
   
    pSAFEARRAY->pvData = SafeArrayAllocData(pSAFEARRAY);
}

HRESULT SafeArrayAllocDescriptorEx(arg0__VARTYPE_vbLong,arg4__cDims_1,arg8_ppSAFEARRAY)
{
    val = (VAL*)new BYTE[0x10+sizeof(SAFEARRAY)+sizeof(SAFEARRAYBOUND)*arg4__cDims_1];
    SAFEARRAY* pSAFEARRAY = val + 1;
   
    memset(val,0);
   
    val->Type = arg0__VARTYPE_vbLong;//
   
    pSAFEARRAY->cDims = arg4__cDims_1;
    pSAFEARRAY->fFeatures = FADF_HAVEVARTYPE;
    
     
    *arg8_ppSAFEARRAY = pSAFEARRAY;
    return 0;
}

Friday, July 10, 2015

open VS fopen VS fdopen

open will return a filedes(int), while fopen and fdopen return a FILE*.

 #include <fcntl.h>
#include <stdio.h>

int main(void)
{
    char      pathname[] = "/tmp/myfile";
    int       filedes;
    FILE      *fp;

    if ((filedes = open(pathname, O_RDONLY)) == -1) {
        printf("open error for %s\n", pathname);
        return 1;
    }

    if ((fp=fdopen(filedes, "r")) == NULL) {
        printf("fdopen error for %s\n", pathname);
    } else {
        printf("fdopen seccess for %s\n", pathname);
        fclose(fp);
    }

    return 0;
}

Sunday, July 5, 2015

加拿大高速公路注意事项

如果从紧急停车带出来,一定检查轮胎内外侧和附近路面,因为这种地方可能会有废弃的长螺丝和较大的石头; 尽量在行车道行驶,左右都有回旋余地。

Thursday, June 25, 2015