办理旅行证和出生证认证

耐心看完这三个官方说明比什么都管用。。。

http://www.chinaconsulatesf.org/chn/qianzhen/fzlxz/

http://www.chinaconsulatesf.org/chn/qianzhen/gzrz/

http://www.chinaconsulatesf.org/chn/qianzhen/cjwtjd/

还有一个解释国籍法理的:

http://opinion.huanqiu.com/opinion_world/2013-04/3816063.html

一些其他人的经验帖:

http://lam8da.github.io/2016/12/02/baby-us-documents/

https://www.delphij.net/wiki/kb/usa/prc/sfconsulate

https://cn.dealmoon.com/guide/765232

 

只写一些跟官方说明有出入或者遗漏的地方:
1. 旅行证拼音姓名要和美国护照相同
2. 领事认证申请人是小孩,代办人是父母。签名要用“小孩名 父XX代” 格式(最好不填,等工作人员告诉使用什么格式填写)
3. 领事认证可以回邮(至少跟旅行证一起办理的时候是这样的)
4. 一般不提供加急
5. 回邮信封地址from to都写自己家地址

发表在 生活 | 留下评论

SSH Through NAT with help of middle man

With this method, you don’t need to do any modification on the middle man server. GatewayPorts setting is not required.

 

Run this on destination machine:

ssh -o ServerAliveInterval=60 -N -R <port on middleman>:localhost:<port on this machine, usually 22> <user>@<middleman server>

Run this on your local machine:

ssh -o ServerAliveInterval=60 -N -L <port on local machine>:localhost:<port on middleman server> <user>@<middleman server>

 

Then you can connect to localhost <port on local machine> which will take you to the destination server

发表在 Linux使用 | 留下评论

Setup openvpn and use it as a router

General setup:

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04

Static IP:

https://dnaeon.github.io/static-ip-addresses-in-openvpn/

 

Topology:

https://community.openvpn.net/openvpn/wiki/Topology

 

Port forwarding:

http://superuser.com/questions/927060/openvpn-server-to-forward-incoming-connection-to-client

See also: http://unix.stackexchange.com/questions/55791/port-forward-to-vpn-client

发表在 服务器 | 留下评论

Run X11 apps on BQ M10 Ubuntu tablet

Seems like nobody talked about this method. So I’m posting it here.
First of all, install X11 apps using apt-get. You need to first remount your root as read-write:
http://askubuntu.com/questions/399709/install-with-sudo-app-get-install-doesnt-work-not-using-locking-for-read-only

Then, you can first start a builtin X11 app, for example the gedit app from scope. And then run this in terminal:
DISPLAY=:1 codeblocks

If you want to run Qt apps, see this first(export MIR_SOCKET):
http://askubuntu.com/questions/611274/how-do-i-run-a-mir-application-from-a-command-line

发表在 Ubuntu Touch | 留下评论

[leetcode] marked questions

https://leetcode.com/problems/wildcard-matching/

发表在 leetcode | 留下评论

[leetcode] Wildcard Matching

最大的疑惑在于不使用递归, 而又有多个*号出现时的回溯重试问题。

看起来如果第二次遇到*号时覆盖上次遇到*号时记录的重试位置,但是实际上第二个星号之前的匹配已经可以保证成功了,并且更重要的是这时上个星号匹配了多少字符已经无关了, 第二个星号可以吃掉多出来的字符。

比如下面这个例子

aababaababab
a*ab*ab

pattern中第一个*ab是匹配的哪个ab并不重要(只要不是最后一个就行,一般匹配第一个遇见的就好了),因为第二个*会吃掉多余的ab, 并且保证pattern中最后一个ab能够“够”到字符串的结尾。

发表在 leetcode | 留下评论

[quote] Ubuntu Mouse Disappears When Still

http://ubuntuforums.org/showthread.php?t=1931116

Check if the Unclutter Package is installed and remove it.

Code:
sudo apt-get remove unclutter
发表在 Linux使用 | 留下评论

Shutter Stylist Privacy Policy

Privacy Policy of Shutter Stylist

In order to receive information about your Personal Data, the purposes and the parties the Data is shared with, contact the Owner.

Data Controller and Owner

Yu ZHANG,
pswzyu@gmail.com

Types of Data collected

The owner does not provide a list of Personal Data types collected.

Other Personal Data collected may be described in other sections of this privacy policy or by dedicated explanation text contextually with the Data collection.
The Personal Data may be freely provided by the User, or collected automatically when using this Application.
Any use of Cookies – or of other tracking tools – by this Application or by the owners of third party services used by this Application, unless stated otherwise, serves to identify Users and remember their preferences, for the sole purpose of providing the service required by the User.
Failure to provide certain Personal Data may make it impossible for this Application to provide its services.

Users are responsible for any Personal Data of third parties obtained, published or shared through this Application and confirm that they have the third party’s consent to provide the Data to the Owner.

Mode and place of processing the Data

Methods of processing

The Data Controller processes the Data of Users in a proper manner and shall take appropriate security measures to prevent unauthorized access, disclosure, modification, or unauthorized destruction of the Data.
The Data processing is carried out using computers and/or IT enabled tools, following organizational procedures and modes strictly related to the purposes indicated. In addition to the Data Controller, in some cases, the Data may be accessible to certain types of persons in charge, involved with the operation of the site (administration, sales, marketing, legal, system administration) or external parties (such as third party technical service providers, mail carriers, hosting providers, IT companies, communications agencies) appointed, if necessary, as Data Processors by the Owner. The updated list of these parties may be requested from the Data Controller at any time.

Place

The Data is processed at the Data Controller’s operating offices and in any other places where the parties involved with the processing are located. For further information, please contact the Data Controller.

Retention time

The Data is kept for the time necessary to provide the service requested by the User, or stated by the purposes outlined in this document, and the User can always request that the Data Controller suspend or remove the data.

Additional information about Data collection and processing

Legal action

The User’s Personal Data may be used for legal purposes by the Data Controller, in Court or in the stages leading to possible legal action arising from improper use of this Application or the related services.
The User declares to be aware that the Data Controller may be required to reveal personal data upon request of public authorities.

Additional information about User’s Personal Data

In addition to the information contained in this privacy policy, this Application may provide the User with additional and contextual information concerning particular services or the collection and processing of Personal Data upon request.

System Logs and Maintenance

For operation and maintenance purposes, this Application and any third party services may collect files that record interaction with this Application (System Logs) or use for this purpose other Personal Data (such as IP Address).

Information not contained in this policy

More details concerning the collection or processing of Personal Data may be requested from the Data Controller at any time. Please see the contact information at the beginning of this document.

The rights of Users

Users have the right, at any time, to know whether their Personal Data has been stored and can consult the Data Controller to learn about their contents and origin, to verify their accuracy or to ask for them to be supplemented, cancelled, updated or corrected, or for their transformation into anonymous format or to block any data held in violation of the law, as well as to oppose their treatment for any and all legitimate reasons. Requests should be sent to the Data Controller at the contact information set out above.

This Application does not support “Do Not Track” requests.
To determine whether any of the third party services it uses honor the “Do Not Track” requests, please read their privacy policies.

Changes to this privacy policy

The Data Controller reserves the right to make changes to this privacy policy at any time by giving notice to its Users on this page. It is strongly recommended to check this page often, referring to the date of the last modification listed at the bottom. If a User objects to any of the changes to the Policy, the User must cease using this Application and can request that the Data Controller removes the Personal Data. Unless stated otherwise, the then-current privacy policy applies to all Personal Data the Data Controller has about Users.

Information about this privacy policy

The Data Controller is responsible for this privacy policy, prepared starting from the modules provided by Iubenda and hosted on Iubenda’s servers.

Definitions and legal references

Personal Data (or Data)

Any information regarding a natural person, a legal person, an institution or an association, which is, or can be, identified, even indirectly, by reference to any other information, including a personal identification number.

Usage Data

Information collected automatically from this Application (or third party services employed in this Application), which can include: the IP addresses or domain names of the computers utilized by the Users who use this Application, the URI addresses (Uniform Resource Identifier), the time of the request, the method utilized to submit the request to the server, the size of the file received in response, the numerical code indicating the status of the server’s answer (successful outcome, error, etc.), the country of origin, the features of the browser and the operating system utilized by the User, the various time details per visit (e.g., the time spent on each page within the Application) and the details about the path followed within the Application with special reference to the sequence of pages visited, and other parameters about the device operating system and/or the User’s IT environment.

User

The individual using this Application, which must coincide with or be authorized by the Data Subject, to whom the Personal Data refers.

Data Subject

The legal or natural person to whom the Personal Data refers.

Data Processor (or Data Supervisor)

The natural person, legal person, public administration or any other body, association or organization authorized by the Data Controller to process the Personal Data in compliance with this privacy policy.

Data Controller (or Owner)

The natural person, legal person, public administration or any other body, association or organization with the right, also jointly with another Data Controller, to make decisions regarding the purposes, and the methods of processing of Personal Data and the means used, including the security measures concerning the operation and use of this Application. The Data Controller, unless otherwise specified, is the Owner of this Application.

This Application

The hardware or software tool by which the Personal Data of the User is collected.


Legal information

Notice to European Users: this privacy statement has been prepared in fulfillment of the obligations under Art. 10 of EC Directive n. 95/46/EC, and under the provisions of Directive 2002/58/EC, as revised by Directive 2009/136/EC, on the subject of Cookies.

This privacy policy relates solely to this Application.

发表在 Shutter Stylist | 留下评论

User OpenCV Java With Tomcat and solve “already loaded in another classloader”

This article is tested on Eclipse Mars Release, tomcat 8.0.24, opencv 2.4.10, Windows 8(shame, but… should be similar on linux)

Nearly all the articles on web point to this: http://wiki.apache.org/tomcat/HowTo#I.27m_encountering_classloader_problems_when_using_JNI_under_Tomcat

This is a good answer and explained what should you do to solve the problem. However, for opencv, the opencv-xxxx.jar does not load the native library from inside the classes in the jar package. OpenCV document asked developers to load the native lib from their code. For example:

public class SomeClassUsesOpenCV {
	static {
		System.loadLibrary("opencv_java2410");
	}
}

To solve this delimma, I created a java project called OpenCVLoader, and created a single class called OpenCVLoader, in this class, use the static field to load the library. And then, pack this java project as a jar package. In Eclipse, you can use the export option of the project to easily export a jar package(for example, opencv-loader.jar). Put this in “apache-tomcat-8.0.24\lib”. Why this dir? Because this dir is under common class loader in catalina.properties, you can also config the shared.loader and put the jar package into that dir. Basicly, we are trying to avoid using app specific class loader to load the opencv lib.

Then, put opencv-xxxx.jar into the same dir with the opencv-loader.jar . Then, make sure your opencv_javaxxxx.dll/so is in the java.library.path. There are a lot of posts about this. However, there is something that I really need to mention. Just like the opencv-xxxx.jar which must be loaded by the tomcat non-webapp-specific class loader, this dll should also be loaded by the same class loads opencv-xxxx.jar. So, if you want to use the -Djava.library.path method, it should be in the command which starts the tomcat server. In eclipse, you can achieve this by going to run > run configuration… > Apache Tomcat > your_server_name_here and in Arguments tab, append -Djava.library.path=”D:\path_to_your_opencvxxx.dll”. If you don’t see any thing under Apache Tomcat tree node, start the server once, then a default configuration will be created.

Then, in the servlet class that you want to use opencv, use this instead the loadLirary thing.

public class SomeClassUsesOpenCV {
	static {
		// trigger the opencv loader static field
		// which leads to loading the opencv jni
		// there are many ways to trigger it, I just used this
		new OpenCVLoader();
	}
}

OK, now try to do some modification and save to trigger the tomcat reload.

发表在 Java, OpenCV | 留下评论

Clothes Matcher Project

use one drawer across different activity. and then use viewpager in the activity to navigate between fragments.

animation

http://stackoverflow.com/questions/19263312/how-to-achieve-smooth-expand-collapse-animation#23932782

crop image: https://github.com/edmodo/cropper

resources: https://guides.codepath.com/android/Must-Have-Libraries#resources

servlet 3 upload file: http://balusc.blogspot.com/2009/12/uploading-files-in-servlet-30.html

tomcat mysql session manager: https://gerrydevstory.com/2013/08/21/tomcat-7-jdbc-session-persistence/

setting cookie name: http://stackoverflow.com/a/20449481/3841059

 

 

Server:

put mysql connection in the project libs dir, put other libs in the WEB-INF/lib

 

 

ios:

get event of camera finished focus adjustment: http://stackoverflow.com/questions/9100357/iphone-camera-autofocus-observer

camera :https://github.com/DriveCurrent/photo-picker

inspect container of an app:http://stackoverflow.com/a/31977276/3841059

using object c code in swift: http://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift

发表在 Android | 留下评论