Sunday, December 17, 2017

NBA League pass


1. Install Firefox/Chrome plugin Best Proxy Switcher
2. Select Premium VPN proxy UK
3. Login NBA league pass and select the game to watch.
    Now you can watch but the quality is bad
4. Turn off the proxy and click to watch in popup window
   Enjoy

Verify:
https://www.iplocation.net/find-ip-address

Update:
Premium VPN proxy is only free for a limited time and doesn't work any more unless you buy the package.
Hola doesn't support google.com and NBA.
Touch VPN is perfect. It support google.com and nba.com and the speed is fantastic.

Friday, December 15, 2017

Use iMac as external monitor for Windows Laptop

我也是Thinkpad P50和2013秋的iMac,找了一根HDMI->Thunderbolt的线,发现不能直接用iMac做显示器,按Command+F2不能切换到target monitor mode,从P50上也不能把iMac做显示器。
搜索了一下,发现微软官方有个Microsoft Remote Desktop的程序 (Mac App Store有),装上之后,打开P50的 Allow remote access to your computer. (我的这个刚开始是灰的,去gpedit.msc组策略才能勾选上),然后输入P50局域网IP连接过去,速度超快,跟直接连显示器没差别。

这个解决方案不用连接线,不用付费软件,简单快捷并且适用于任何windows和mac的连接。

Thursday, November 23, 2017

pension note

https://www.tdbenefitsandpension.com/en/modules/pension/epp/planinformation/taxissues.asp

contribute:
The company: ympe*1.4%
The personal (with topup): (x-ympe)*5.5%
Pension adjustment for RRSP room:
ympe*1.4%*9+(x-ympe)*2%*9-600
Pension calculation:
(average_ympe*1.4%+(x-average_ympe)*2%)*service_year

Canada PR Card Renewal 2

http://www.cic.gc.ca/english/information/pr-card/apply-how.asp
http://www.cic.gc.ca/english/helpcentre/results-by-topic.asp?st=4.2
http://www.cic.gc.ca/english/information/applications/guides/5445ETOC.asp#5445E4
UCI Look for this number on PR card

TODO:
1. Input SIN card number
2. A clear and legible photocopy of Paul's birth certificate
3. Write the name of the applicant on the envelope
4. Pay the fee
5. Fill out all sections. If a section does not apply to you, write “Not Applicable” or “NA”.

After you pay, a copy of your receipt will be emailed to you. Print it and include it with your paper application.


1. IMM 5644: Document checklist - Application for a Permanent Resident Card
Write your Unique Client Identifier (UCI) in the box at the top right hand corner. Your UCI
is an 8 or 10 digit reference number that appears on all correspondence you receive from IRCC.
Send the completed checklist with your application.
2. Your PR Card
If you are applying to renew your present card, you should keep it until you get your new card.
3. One (1) main identity document
A photocopy of your valid passport or travel document. First page with the photo
4. Photos
Put the two (2) photos in a small envelope (no staples or paper clips), and
Write the name of the applicant on the envelope.

If you are under the age of 18
A clear and legible photocopy of your birth certificate (showing your name, date of birth, place of birth and the names of
your parents or adoptive parents);

Use another page if you need more space to list this information.

5. IMM5444E.pdf
Fill out all sections. If a section does not apply to you, write “Not Applicable” or “NA”.

Pay the fees
3x $50 = 150$ You must pay your fees online.
http://www.cic.gc.ca/english/information/fees/pay.asp
Do not exit without printing the receipt! The receipt you printed is your proof of payment.
Mail the application

If your application is properly completed and you meet the requirements for a PR Card
If you gave us a valid email address, we will send you an Acknowledgement of Receipt (AoR) of your application;
you will get your card in the mail or a letter from us telling you when and where to pick up your card.

If you are still working or studying, or if you still live at that address, write “TODAY” or the date
you are signing the application. If you do not know the exact dates, provide approximate dates.

If you are an existing permanent resident who has received their PR card in the past, you will most likely also
receive your renewed PR card by mail.

You should destroy your old PR card once you receive the renewed card. If you receive your new PR card in the mail,
you should destroy your old card. If you are asked to pick up your new PR card from a IRCC office, you must bring your
existing PR card with you.

Canada PR Card renewal 1


https://www.wenba.ca/article/5522
据加拿大新的入境规定,从2016年3月15日起,免签证入境加拿大的旅客必须持有 eTA 才能乘坐飞机入境加拿大
持有中国护照及有效加拿大签证的人群不需要 eTA。
加拿大永久居民乘飞机进入加拿大无需持有 eTA,但需持有有效枫叶卡入境
Application for a Permanent Resident Card一共有四页,首先大家要在第一张右上角的box里填上自己的UCI Number,也就是我们PR Card上的8位数ID No
算离境日期时,不包括离开加拿大的当日,但需要包括返回加拿大的日期。
9月15日CIC更新了办理手续。好象要求的材料比以前少而简单得多
1. One main identity document: A photocopy of valid passport
2. You will need two (2) identical photos taken within six (6) months of the date of this application:
Put the two (2) photos in a small envelope (no staples or paper clips), and
Write the name of the applicant on the envelope.
If you are under the age of 18
A clear and legible photocopy of birth certificate
3.
Permanent Resident Card x $50
You must pay your fees online. Do not exit without printing the receipt
4.
Mail the application
5.
If you gave us a valid email address, we will send you an Acknowledgement of Receipt (AoR) of your application
You will get your card in the mail or a letter from us telling you when and where to pick up your card.

http://www.cic.gc.ca/english/information/times/index.asp
Renewing or replacing a PR card
47 days
Most permanent residents in Canada replacing or renewing their PR card will receive it by mail.

Question:
1. Need tax?
不要交税单了?现在不用交了
2. Only need passport first page? 理解正确(只需要首页)

Oracle PL/SQL

A nonpartitioned table can have partitioned or nonpartitioned indexes.
A partitioned table can have partitioned or nonpartitioned indexes.
The partitioning key is comprised of one or more columns that determine the partition where each row will be stored.
To reduce disk usage and memory usage (specifically, the buffer cache), you can store tables and partitions of a partitioned
table in a compressed format inside the database. This often leads to a better scaleup for read-only operations. Table compression
can also speed up query execution. There is, however, a slight cost in CPU overhead.

Just like partitioned tables, partitioned indexes improve manageability, availability, performance, and scalability.
They can either be partitioned independently (global indexes) or automatically linked to a table's partitioning method (local indexes).
In general, you should use global indexes for OLTP applications and local indexes for data warehousing or DSS applications.
Also, whenever possible, you should try to use local indexes because they are easier to manage.
1. If the table partitioning column is a subset of the index keys, use a local index.
2. If the index is unique and does not include the partitioning key columns, then use a global index.
3. If your priority is manageability, use a local index.
4. If the application is an OLTP one and users need quick response times, use a global index. If the application is a
DSS one and users are more interested in throughput, use a local index.
(My note: prefer to use local index unless the index is unique and not part of the partitioned column)

unique column can have multiiple null values
The explain plan is what the optimizer thinks will happen when you run, the execution plan is actually happened when you ran the query.
Well, Oracle isn't quite that smart. In this case, Oracle knew (or in most cases it's a good guess) we would process 100 rows because we
generated statistics on the EMP table after we created the table. The optimizer uses these statistics to generate execution plans.

the autotrace statistics reported however are FACTS, after executing the statement, not guesses, not part of optimization.
SQL does not treat NULL values as zeros when calculating SUM, it ignores them.
This makes a difference only in one case - when the sequence being totalled up does not contain numeric items, only NULLs: if at least one number is present, the result is going to be numeric.

From official:
Autotrace report is generated after successful SQL DML (that is, SELECT, DELETE, UPDATE and INSERT) statements.
The execution plan shows the SQL optimizer's query execution path.
The statistics are recorded by the server when your statement executes and indicate the system resources required to execute your statement.

The maximum length string that SQLERRM will return is 512 bytes, call DBMS_UTILITY.FORMAT_ERROR_STACK for full message.
DBMS_UTILITY.FORMAT_ERROR_BACKTRACE to see the line number.
A left outer join returns all the values from an inner join plus all values in the left table that do not match to the right table.
The read committed transaction isolation level is the Oracle default
Indexed TABLE:
DECLARE
TYPE ename_table_type IS TABLE OF emp.ename%TYPE
INDEX BY BINARY_INTEGER;
ename_table ename_table_type;
B*Tree index is used mostly (one key to one row/range) while Bitmap index is used for low cardinality data (Y,N and null).

UNION, INTERSECT and MINUS are ordered by the first column while UNION ALL is not ordered.

Thursday, November 2, 2017

健身计划

健身计划

1. 周三、周六
              篮球
2. 周日
             Meditation
3. 周二、四
             平板支撑、深蹲、倒立
4. 周一、周五
              俯卧撑
每天早上 Meditation

Google Calendar记录

Monday, October 23, 2017

English

Allright I know that I’m going to ruffle some feathers here, but… Why is Hadoop dying?

Monday, October 2, 2017

狂热分子


人们会感到厌烦,主要是他们的自我让他们厌烦。意识到自己生活贫乏和无
意义是人们厌烦感的主要来源。反之,没有孤立感的个人——如一个部落、教会
或政党的成员——不容易为烦闷所感染。
...
对于老姑娘和不能在婚 姻中享受快乐与满足的妇女,她们的厌烦源于生活的单调乏味。通过拥抱一项神 圣伟业,通过把精力和资财奉献于推动这项伟业,她们就获得了一种充满意义的 新生活。
...
哪怕是在合理悲愤的情况下,我们的恨意主要仍然不是来自别人对我们的伤 害,而是来自我们意识到自己的无能和懦弱——换言之是源于自卑。当我们自感 比伤害我们的人优越,我们更可能的反应是鄙夷他们,甚至是可怜他们,而不是 恨他们。

Friday, September 29, 2017

Autosys

Request the access to the URL
How to use the URL (dozens tabs and hundreds of forms)
Install Autosys agent
create the account (name/password)
Need request autosys to reset the password
Need  to add the user to local admin group on the server 
Need to grant scheduler access to be provisioned 

Still get Error: E121104 Permission denied to process required action.
Reason: You don't have the proper naming standards ??
      True, after the name is updated, the job is created successfully


Login failed for user ... 
Need involve DBA to grant the account database access.

SQL Service Account
SQL Agent Account
Application Account
Autosys ID

login to ACCE to raise the request
    to request ACCE access, need ensure you have a PRD AD group created, and send email
      -                  AD group
-                  MAL code
-                  Mapping Values (if available)

Create PAT AD group, add autosys id to this group, ask app resource to add tthe group to local admin group
Create PRD AD group

After login, can not see the expected option from business unit 

stop sudo service cybagent stop
start sudo service cybagent start
status sudo service cybagent status

grep 'scheduler' /etc/salt/grains

ps -ef | grep -i cybagent

Thursday, September 14, 2017

Wednesday, August 23, 2017

Install minecraft mod on Mac (for version 1.8)

https://www.youtube.com/watch?v=7Fz6vVQr4Zk


  1. Download MineCraft 1.8.8 (taobao)
  2. Download HMCL-2.7.6.23.jar
  3. Download and install forge-1.8-11.14.4.1563-installer.jar
  4. Download TooManyItems2015_02_14_1.8_Forge.jar and lom-1.8-1.2.jar
  5. Run HMCL-2.7.6.23.jar, version choose 1.8-forge1.8- …, click Games->Mods->Add and select the mods to install
  6. Test game to verify 5 mods are loaded 

Or after buy minecraft PC & MAC
1. Download and install minecraft, make sure can login and play
2. Download forge forge-1.12.1-14.22.1.2478-installer.jar, not the forge-1.12.1-14.22.1.2478-universal.jar. The universal version will report the below error:
We appear to be missing one or more essential library files.
You will need to add them to your server before FML and Forge will run successfully.java.lang.ClassNotFoundException: net.minecraft.launchwrapper.Launch
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:44)
3. Double click and select client to install forge
4. Done

Friday, August 4, 2017

Beginning ASP.NET 4 in C# 2010 note

1.
To quick check whether IIS is installed, try http://localhost
2.
When IIS is installed, it creates a directory c:\inetput\wwwroot
3.
The "Classic" application pool is only used to keep backward compatibility.
4.
Configure the website through IIS is an easier way than to edit web.config file
5.
Use debugging only while testing the web application: debug="true"
6.
To enable tracing, add Trace="true" to <% Page ...
and add Trace.IsEnabled = true; in Page_Load method
and you can add
 Trace.Write("") to add your own message
7. Application-Level tracing
add the below in web.config <system.web>
<trace enabled="true" ...>
and access through trace.axd

Wednesday, August 2, 2017

SQL server t-sql limitation

1. Cannot use + in the parameter, say when you try to call a procedure with a parameter: @param1+'Test'
It's not supported, you have to define a new variable and set @param1+'Test' to the new variable and then call the procedure with the parameter
2. Cannot call procedure from function, need to use procedure with output parameter

Wednesday, July 26, 2017

SQL server 2012 cannot be started after reboot

When install SQL server 2012, the service cannot be started after the computer is rebooted. By checking the event log,
it mentions "this service account does not have the required user right log on as a service...".
The solution should add the "Log on as a service" right to an account on your local computer, but unfortunately, add user or group is greyed out by the domain admin.
So the real feasible solution is to uninstall and reinstall, when reinstall, set "NT AUTHORITY\NETWORKSERVICE" as the logon user for all services except "SQL Server Browser"
as it's already set to log on as "NT AUTHORITY\LOCALSERVICE".
To add "NT AUTHORITY\NETWORKSERVICE", input "Network Service" and then click "Check Names".
Now SQL server 2012 is accessible even after restart. And you can run SSMS as administrator to attach the mdf (database) which were created/used before the uninstllation.

Tuesday, July 25, 2017

SQLServer 2012 T-SQL fundamentals note

1.
Microsoft recommends that when you refer to objects in your code you always use the twopart
object names.
The examples here use a schema named dbo that is created automatically in every database and is
also used as the default schema for users who are not explicitly associated with a different schema.
2. Note that a query that uses OFFSET-FETCH must have an ORDER BY clause.
SELECT TOP (5) WITH TIES ...
SELECT orderid, orderdate, custid, empid
FROM Sales.Orders
ORDER BY orderdate, orderid
OFFSET 50 ROWS FETCH NEXT 25 ROWS ONLY;
3.
SELECT orderid, custid, val,
ROW_NUMBER() OVER(PARTITION BY custid
ORDER BY val) AS rownum
FROM Sales.OrderValues
ORDER BY custid, val;
4.
Notice the use of the letter N to prefix the string ‘D%’; it stands for National and is used to denote
that a character string is of a Unicode data type (NCHAR or NVARCHAR), as opposed to a
regular
character data type (CHAR or VARCHAR).
5.
SQL Server's identity is the counter part for Oracle's sequence
keycol INT NOT NULL IDENTITY(1, 1) CONSTRAINT PK_T1 PRIMARY KEY,
SET @new_key = SCOPE_IDENTITY(); --to get a newly generated identity value
The sequence object is a feature that was added in SQL Server 2012 as an alternative key-generating
mechanism for identity.
6.
SQL Server 2008 and SQL Server 2012 support a statement called MERGE that allows you to modify
data,
7.
BEGIN TRAN;
INSERT INTO dbo.T1(keycol, col1, col2) VALUES(4, 101, 'C');
INSERT INTO dbo.T2(keycol, col1, col2) VALUES(4, 201, 'X');
COMMIT TRAN;
8.
The GO command is not really a T-SQL command; it’s actually a command used by SQL Server’s client
tools, such as SSMS, to denote the end of a batch.
run the following code to suppress the default output produced by DML statements that indicates how
many rows were affected.
SET NOCOUNT ON;
9.
The sp_executesql stored procedure was introduced after the EXEC command. It is more secure and
more flexible in the sense that it has an interface; that is, it supports input and output parameters.
Note
that unlike EXEC, sp_executesql supports only Unicode character strings as the input batch of code.




Each instance of SQL Server can contain multiple databases like System databases master, model, tempdb, msdb and Resource.
model: The model database is used as a template for new databases. Every new database
that you create is initially created as a copy of model
tempdb: this database is destroyed and recreated as a copy of the model database every time
you restart the instance of SQL Server.
You can define a property called collation at the database level that will determine language
support, case sensitivity, and sort order for character data in that database.
In terms of security, to be able to connect to a SQL Server instance, the database administrator
(DBA) must create a logon for you. The DBA needs to map your logon to a database user in each database that you are supposed to
have access to.
Although SQL Server can write to multiple data files in parallel, it can write to only one log file at a
time, in a sequential manner. Therefore, unlike with data files, having multiple log files does not result
in a performance benefit.
a database contains schemas, and schemas contain objects. You can think of a schema as a
container of objects such as tables, views, stored procedures, and others.
Microsoft recommends that when you refer to objects in your code you always use the twopart
object names.


select user_name()
select @@VERSION

Sunday, May 21, 2017

SQL Server DTS to SSIS

DTS is deprecated from SQL server 2008.
To migrate DTS to SSIS
1. Install Windows server 2003
2. Install SQL Server 2000 and SQL Server 2000 SP3
3. Install SQL Server 2008 R2
ed2k://%7Cfile%7Ccn_sql_server_2008_r2_enterprise_x86_x64_ia64_dvd_522233.iso%7C4662884352%7C1DB025218B01B48C6B76D6D88630F541%7C/
4. Install SQLServer2005_BC.msi and SQLServer2005_DTS.msi
https://www.microsoft.com/zh-cn/download/details.aspx?id=24793
        Verify DTS file can be opened from SQL Server 2008 R2
5. Run the migration wizard from SQL Server 2008 R2
6. Use Dts.Events.FireInformation or Dts.Log for the log/output messages, or use MessageBox.show... Console.writeLine wont'work.

For SSIS development, set ProtectionLevel to EncryptSensitiveWithPassword, and provide/remember the password. The default EncryptSensitiveWithUserKey would have problem for the deployment.

https://msdn.microsoft.com/en-us/library/bb500440(v=sql.105).aspx
https://msdn.microsoft.com/en-us/library/ms143496(v=sql.105).aspx

Tuesday, May 2, 2017

todo

Check the latest index date and compare with the latest date in the index data file, clear

Check the reason not executed

Tuesday, March 28, 2017

apache ftp server setup

1. Download apache-ftpserver-1.1.0 and unzip
2. Update file ftpd-typical.xml, add encrypt-passwords="clear"
<file-user-manager file="./res/conf/users.properties" encrypt-passwords="clear"/>
3. Edit file users.properties, add new user:
ftpserver.user.peter.userpassword=416308
ftpserver.user.peter.homedirectory=./res/home
ftpserver.user.peter.enableflag=true
ftpserver.user.peter.writepermission=true
ftpserver.user.peter.maxloginnumber=20
ftpserver.user.peter.maxloginperip=2
ftpserver.user.peter.idletime=0
ftpserver.user.peter.uploadrate=0
ftpserver.user.peter.downloadrate=0
4. add "set JAVA_HOME=C:\Java\jdk1.7.0_21" to service.bat and ftpd.bat if there's java version related error
service install (It's OK to get Failed installing 'ftpd' service)
ftpd.bat res/conf/ftpd-typical.xml
5. access ftp://127.0.0.1:2121/

Sunday, March 12, 2017

Desperate housewives


1. Wisteria
2. hectic
3. quietly polishing my the routine of my life until it gleamed with perfection
4. greef-stricken
5. are you willing to risk that?
6. paella
7. convertible
8. upholster

Saturday, March 11, 2017

健身计划

健身计划:
1. 沙发深蹲->拉力深蹲->面壁深蹲
2. 平板支撑
3. 俯卧撑 (上斜、下斜、击掌)
4. 爬楼梯
5. 倒立

第一阶段:
周一、周三、周五下午爬楼梯(练臀),20*5, 之后吃坚果和香蕉
      晚上俯卧撑(练胸)和平板支撑
周一/周日、周三打篮球
周六下午乒乓球、晚上俯卧撑(练胸)和平板支撑

第二阶段:
周一、周三、周五晚上沙发深蹲、俯卧撑和平板支撑
周二、周四Runtastic练腹肌

爬楼梯方法:
1. 每次两级,背部挺直,提脚的时候,膝盖不能超过脚尖,心中默念:臀部发力
一层快、二层中、三层慢,交替进行
2楼爬到18楼,坐电梯下,3-6次,半小时

热身:标准俯卧撑 10个*3组
正式:击掌俯卧撑 每组力竭*3组
击掌上下斜俯卧撑 15个*4组(上下斜各两组)
若不能做起击掌俯卧撑,可以做标准俯卧撑。话说可以尝试下半击掌俯卧撑或上斜击掌俯卧撑。这两样比较容易。
塑胸形:下斜窄距俯卧撑 15个*3组
上斜宽据俯卧撑 15个*3组
拉伸:手抵住墙,缓缓转体,让胸部被拉伸


做平板支撑时候,一定要肌肉绷紧、发力。比如如果你的腰部塌下去,下背部又不出力绷紧,就可能有机会受伤或劳损。
简单讲,每次平板支撑都要做到力竭。也就是撑不住了为止。但是每次都可以按我说的,快撑不住时,前后左右瞎晃一阵(我要是瞎晃能撑个十几分钟,晚上一局塔防……)一般做3-5组都可以。

俯卧撑和平板支撑:
1. 标准俯卧撑
注意发力是夹紧胸部,而不是伸直肘部,这样能更好的训练到胸,而不是手臂
除了上升阶段要发力,下落的阶段也要缓缓发力下降
训练上胸最好采用下斜窄距俯卧撑,训练下胸最好采用上斜宽距俯卧撑
如果你有俯卧撑架或者有哑铃(能稳定的做啊,别受伤),你可以采用下斜反手俯卧撑,这样训练上胸效果更好。
2. 平板支撑
3. 上斜俯卧撑
4. 平板支撑
5. 下斜俯卧撑
6. 平板支撑

沙发深蹲:
持续1分钟,休息10秒
1. 从站立姿势慢慢坐到沙发上,双手置于脑后
2. 背部挺直微反弓,往深处坐
3. 臀部发力至脚后跟,用爆发力让自己跳起来。落地时柔和



Sunday, March 5, 2017

Mange iPhone photos (Sync only selected Photos)

Object:
Delete all photos  from iPhone and only sync selected Album or favourite photos from Mac's photo application

Steps:
1. Open the pre installed "Image Capture" in Mac and press Command+A to select all photos and then delete.
2. Open iTunes and select "Sync only selected songs and videos"
3. Mark favourite photos in Photos app from Mac
4. Sync with iTunes as below




Saturday, March 4, 2017

北京社保

如果户口是北京:户口所在区人才市场,有专门的窗口负责办理”自由职业者“的社保,可以以个人身份参保;
http://bbs.tianya.cn/post-worldlook-1769132-1.shtml

养老金有两部分构成,一是你退休前一年社平工资的20%,二是你账户里面的银子总额/120(复杂的公式,大约这个数上下),这是你每月的退休金。

  假定我在北京,我账户里面的钱是12万,去年退休的(今年说不清了)

  那么,我的每月退休金是12万/120=1000+6k*20%=2200(约,前年的社平工资大致是6k)
办理手续:
  本人带着户口本、身份证和复印件等材料到户籍所在地劳动保障服务中心办理。
在同一城市,累计缴纳基本养老保险满15年,基本医疗保险20年,退休时,即按缴纳所在城市标准发放最低基本养老金,执行缴纳所在城市医疗保险标准。
  3、在所有城市,基本养老保险与基本医疗保险缴纳均不够年限,则在退休时,按当年度所在地社保缴纳基数,一次性补足规定年限的基本养老与基本医疗。
  4、根据最新的改革放案,从2015年开始,每3年延长一年退休时间,至2030年止,将我国的男性劳动者退休年龄延长至65岁,女性退休年龄延长至60岁。


问题:
1. 是否要补缴社保
2. 如果补缴,补缴多少钱,每月交多少钱

Thursday, February 23, 2017

多伦多更新护照

  • +1 上星期去的总领馆,有投币照相的。 
    • ○  That will be great! Thanks. I also find one close by as backup(537 Bloor St W, Toronto). 
 240 St George St, Toronto, ON M5R 2N5
所需材料 
  2、近期正面免冠、白色背景彩色半身证件照片3(请务必点击查看照片具体要求)。 
  3、护照原件及复印件(包括带照片资料页、曾办理过加注或延期页、来加签证相关页); 
  4、在加拿大的有效居留证件原件和复印件,如枫叶卡、学习许可或工作许可; 

办证时间 
  由于驻加拿大使馆及各领馆受理的护照需由制证中心统一制作,从各馆自受理申请之日开始计算,需15个工作日。


证件组语音电话: 416-964-8861;人工接听:周一至周五下午3:00-5:00(负责护照、签证、公证、认证等有关证件问题咨询和服务。因咨询来电过多,请优先发电邮或传真咨询

\










Wednesday, February 22, 2017

Pragramming ASP.NET web pages

1. Use WebMatrix3
Easy to use, can only access from localhost, not my laptop hostname, replaced by Visual Studio Code (hard to use)
2. Use Visual Studio 2010
Need install ASP.NET MVC 4 as this article (Programming ASP.NET Web Pages (Razor) Using Visual Studio) shows
https://docs.microsoft.com/en-us/aspnet/web-pages/overview/getting-started/program-asp-net-web-pages-in-visual-studio
Accessisble from the laptop hostname


ASP.NET Web Forms (.aspx pages)
The Web Forms framework targets developers who prefer declarative and control-based programming, such as Microsoft Windows Forms (WinForms) and WPF/XAML/Silverlight.
you can quickly build a web application without having expertise in HTML and JavaScript.

ASP.NET MVC
By dividing the application into the model (M), views (V), and controllers (C), ASP.NET MVC can make it easier to manage complexity in larger applications.

ASP.NET Web Pages (.cshtml and .vbhtml files)
ASP.NET Web Pages targets developers who want a simple web development story, along the lines of PHP. In the Web Pages model, you create HTML pages and then add server-based code to the page in order to dynamically control how that markup is rendered.
Like Web Forms, Web Pages is oriented toward rapid development.

the three frameworks are not entirely independent, and choosing one does not preclude also using another.
ASP.NET Core was released in 2016.
ASP.NET Core merges ASP.NET MVC, ASP.NET Web API, and ASP.NET Web Pages into one application framework.

@RenderPage("header.cshtml")
@RenderBody()
@RenderPage("footer.cshtml")
With ASP.NET, files with a name that starts with an underscore cannot be browsed from the web:
_header.cshtml, _footer.cshtml, _Layout.cshtml
With ASP.NET, the common way to hide sensitive information (database passwords, email passwords, etc.) is to keep the information in a separate file named "_AppStart"
To specify the virtual root in programming code, use the ~ operator.
The Server.MapPath method converts a virtual path (/default.cshtml) to a physical path that the server can understand
The Href method converts a path used in the code to a path that the browser can understand

Note for Microsoft SQL Server T-SQL

Book: SQL Server 2012 T-SQL Fundamentals
Each instance of SQL Server can contain multiple databases like System databases master, model, tempdb, msdb and Resource.
model: The model database is used as a template for new databases. Every new database
that you create is initially created as a copy of model
tempdb: this database is destroyed and recreated as a copy of the model database every time
you restart the instance of SQL Server.
You can define a property called collation at the database level that will determine language
support, case sensitivity, and sort order for character data in that database.
In terms of security, to be able to connect to a SQL Server instance, the database administrator
(DBA) must create a logon for you. The DBA needs to map your logon to a database user in each database that you are supposed to
have access to.
Although SQL Server can write to multiple data files in parallel, it can write to only one log file at a
time, in a sequential manner. Therefore, unlike with data files, having multiple log files does not result
in a performance benefit.
a database contains schemas, and schemas contain objects. You can think of a schema as a
container of objects such as tables, views, stored procedures, and others.
Microsoft recommends that when you refer to objects in your code you always use the twopart
object names.


DECLARE @empname AS NVARCHAR(31);--or DECLARE @empname AS NVARCHAR(31); SET @empname = 'Peter';
SET @empname='Peter';
select @empname as empname;



select user_name()
select @@VERSION
select * FROM sys.tables;
select * FROM sys.columns
select * FROM INFORMATION_SCHEMA.TABLES
select * FROM INFORMATION_SCHEMA.COLUMNS
select *
  from information_schema.routines
 where routine_type = 'PROCEDURE'
The sp_tables stored procedure returns a list of objects (such as tables and views) that can be queried in the current database:
EXEC sys.sp_tables;
The sp_help procedure accepts an object name as input and returns multiple result sets with
general information about the object, and also information about columns, indexes, constraints, and more:
EXEC sys.sp_help
@objname = 'Queue.WorkItemSessions';
EXEC sys.sp_columns
@table_name = N'Orders',
@table_owner = N'Sales';
EXEC sys.sp_helpconstraint
@objname = N'Sales.Orders';
SELECT TOP (5) WITH TIES orderid, orderdate, custid, empid
FROM Sales.Orders
ORDER BY orderdate DESC;

From SQL server 2012 (For Oracle 12c):
SELECT orderid, orderdate, custid, empid
FROM Sales.Orders
ORDER BY orderdate, orderid
OFFSET 50 ROWS FETCH NEXT 25 ROWS ONLY;

Tuesday, February 21, 2017

DUAL table for Oracle, DB2 and SQL server

For SQL server:
select 3*2
For DB2:
SELECT 3*2 FROM SYSIBM.SYSDUMMY1
For Oracle:
select 3*2 from dual;

Saturday, February 18, 2017

iPhone7 Slow motion

1. The test is to take a 60 seconds slow motion for the clock in the computer
From 10 seconds, it enters into slow motion. And it takes about 6 minutes to play the whole video. So when it takes the video, it uses the normal velocity like takes 24 photos every seconds, but when it's played, it only play like 4 photos ever seconds.

Thursday, February 16, 2017

Pragramming ASP.NET web pages

1. Use WebMatrix3
Easy to use, can only access from localhost, not my laptop hostname, replaced by Visual Studio Code (hard to use)
2. Use Visual Studio 2010
Need install ASP.NET MVC 4 as this article (Programming ASP.NET Web Pages (Razor) Using Visual Studio) shows
https://docs.microsoft.com/en-us/aspnet/web-pages/overview/getting-started/program-asp-net-web-pages-in-visual-studio
Accessisble from the laptop hostname

Tuesday, February 14, 2017

Telephone

-Hello, is this Mr. Smith?
-Yes, who is this?
-This is John Willson

Sunday, January 22, 2017

回国任务


1. 安装并测试dell voice/fango
2. 乒乓球拍
3. 一平米健身
俯卧撑器
护膝
4. 室内引体向上 ?
5. 手机(套)

Wednesday, January 18, 2017

web service wsdl location

when you create your service, the service class uses the default 'wsdlLocation', which was inserted into it when the class was built from the wsdl. So if you have a service class called SomeService, and you create an instance like this:

SomeService someService = new SomeService();
If you look inside SomeService, you will see that the constructor looks like this:

public SomeService() {
        super(__getWsdlLocation(), SOMESERVICE_QNAME);
}

So if you want it to point to another URL, you just use the constructor that takes a URL argument,
set public SomeService(new URL(wsdlLocation),SOMESERVICE_QNAME)
You are not supposed to change the wsdl file and recompile

Sometimes its ports still attempt to bind to the location set at compile/generation time, setting property for BindingProvider is the last chance.
BindingProvider bp = (BindingProvider)port;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);

Tuesday, January 17, 2017

get web service soap request and response from Java

Method 1:
Implement SOAPHandler<SOAPMessageContext> and HandlerResolver, and setHandlerResolver for the service
public boolean handleMessage(final SOAPMessageContext smc)
Boolean outboundProperty = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)
if(outboundProperty)
System.out.println("SOAP Request:");
smc.getMessage().writeTo(System.out);
else
System.out.println("Soap Response:");
smc.getMessage()message.writeTo(System.out);

Method 2:
System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true");

Saturday, January 14, 2017

You are your own gym note

1. Why getting fat when you are over 30's
Muscle decreases/shrinks and getting a decreasing metabolic, while you are still eating like you ate when you are young.
2. Interval training is more efficient than steady state training. Get greater gain in aerobic capacity, more strength and spent much less time.
3. Fat is your body's way of storing energy so you don't starve later. If your body gets used to eating several meals a day, it quickly learns there isn't any reason to store fat, because it knows there's no starvation period coming up. This means five or six small meals a day, every three hours or so.
4. Everything from cookies, yogurts, sports bars, fruit juices, cereals, and sodas contain large amounts of table sugar that should be avoided.
As much as possible, get your carbs from whole pieces of fruit and raw or steamed vegetables, because they have the lowest glycemic index and contain valuable nutrients. The next best source is diary and whole grain products.
5. Your real home is not your apartment or your house or your city or even your country, but your body. It is the only thing you, your soul and mind, will always live inside of so long as you walk the earth.

Friday, January 6, 2017

JKS file

JKS file:
The browser cannon accept p12 file. After got the JKS file, use ikeyman to import, and export to .p12 file, double click .p12 file to install the certification. Then from the browser, can access the end point (secure web service)

Sunday, January 1, 2017

Chess

1. Rook
2. Knight
3. Bishop
4. King
5. Queen
6. Pawn
stale mate

2017 Resolution

1. Fitness
2. English (Listening and Oral)

Plan for Fitness:
1.
Monday        Play basketball, 8:15PM - 09:45PM, banana
Tuesday        Pushup and 6 pack, 8:15PM - 9:00PM, banana
Wednesday   Play basketball, 8:15PM - 09:45PM, banana
Thursday      Pushup and 6 pack, 8:15PM - 9:00PM, banana
Friday           None
Saturday       Pingpong, afternoon
                     Pushup and 6 pack, 8:15PM - 9:00PM, banana
Sunday         Swimming

Plan for English:
1. Do not browser Chinese news website like sohu, sina, forum.iask.ca except the weekend
2. Disable Wechat, moment, only enable at the weekend
3. Install Facebook, tweet, Reuters app and only read English news
4. Watch TV, listen 680 and CBC
5. Write/record diary in English
6. Practise Jerry English

Do not change job or prepare for changing job
Do not trade or prepare for the trade
Do not read Chinese news