Thursday, February 20, 2014

中国大陆人在美国职业移民剖析(Green card Crap for Main Land born Chinese Professionals in United States)

I am a poor guy to complain US green card policy toward Chinese borns in my own blog :)
My profile:

  •    Been in US for 7.5 years;
  •    No Green Card;
  •    Get My Master Degree in US;
  •    Worked hard in US for 5.5 years by using H1B;
  •    Paid a lot of taxes;
  •    My employment sponsored companies paid a lot of money to the US government;


What is H1B, H1B is the visa type that the company has to pay the US government to hire foreigners. Problem with H1B:

  •    Expensive that employer do not want to do unless they really need
  •    Available for three years, but tight to the employer. If you change employer, you got to apply a new one, so government can suck money from you again.
  • If you change the work location, you got to apply another one.
  •    The visa stamp used to enter US only valid for 1 year, while india and other countries get 3 years, and it used to be only 3 months. So basically you can not go back to home country, since the lengthy visa application process, unless your boss grant you a very long vacation.


Since H1B sucks, we are hoping to get green card as soon as possible to get out of the nightmare... Then what is about employment based green card?

  • More expensive and more requirement than H1B
  • File perm, then I-140,  I-485. If we change job before I-485, we have to restart the whole process with the new employer.
  •    EB1 is for extraordinary people, like professors with a lot of publication or athletes with gold medal. EB2 is for experienced or advanced degree professionals. EB3 is for the people with basic skills and bachelor degrees. EB5 is for rich people giving money to US government. So most of us, hard workers fall into EB2 and EB3.
  •    US government tries to keep diversity, only makes certain quota for each nation to be qualified to file I-485. Since China is a big nation,  we are competing with each other that makes a long queue. The waiting period is not about one year or two year, it is about 4,5 years up to 10 years.
  •    There are remained quota left every year from other countries, the left over is spilled over to indian and china EB2 which are the only two counties with the above issue. Now they are not talking about diversity, they gave almost all the quotas to india, since indian has a longer queue. So indian got 10 times green cards in 2013 than China.
  •    The most ridiculous thing is that Chinese people maybe so smart and more qualified, there are not many people applying EB3 which is less qualified. EB2 has much longer queue than EB3. There is no any remedy for EB2 China with that.... US government just let those quota wasted and flew into indian EB3.


I understand life can not be fair most times. But as the most powerful country trying to repute itself with freedom and fairness, the system is so ridiculous and unfair for Chinese hard workers. By the way I have classmates went to Australia or Canada got their green card maybe only in 2 years, also friends cursed the Chinese government to apply and get the refugee type green card in 6 months just because US government wants to hear that, I am questioning myself that I may choose a wrong destination at the first point and warning those Chinese American Dreamer's reality.


中文翻译:
我是一个在自己的博客抱怨美国绿卡政策的可怜家伙中国人。
我的个人资料:
   在美国7.5年;
   没有绿卡;
   在美国获得硕士学位
   在美国用H1B工作5年;
   按期交了很多税;
   我的的公司支付了很多钱给美国政府;


什么是H1B , H1B是在美国给外国人工作的一种签证类型, 需要雇主支持。H1B的问题:

  •    太贵了,雇主不愿意支持,除非他们真正需要
  •    一次申请三年,但紧跟雇主。如果更换雇主,你必须申请一个新的,所以政府可以再次收费。
  • 如果你改变了工作地点,你一定要申请一个。
  •    用来进入美国的签证只有效期为1年,而印度和其他国家有3年,曾经更甚只有3个月。所以基本上你不能回国,因为漫长的签证申请程序,除非你的老板给予你一个很长的假期。



由于H1B很烂,大家都希望能尽快摆脱的噩梦获得绿卡......那么什么是关于EB绿卡?

  •    EB1是有杰出贡献的人,比如教授有很多出版物或运动员获得奥运金牌。 EB2是有经验的或高等学位的专业人士。 EB3是为有基本技能和学士学位。 EB-5是富人给美国政府钱。所以,我们中的大多数,属于EB2和EB3 。
  •    美国政府试图保持多样性,给每个国家一定的配额。因此,中国作为一个大国,我们是互相竞争,有一个长队。等待期是不是一年和两年,大约4,5年,最长10年。
  •    每年有配额从其他国家那里剩下的,会分给印度和中国EB2, 两个仅有以上情况的国家。可是到了剩余配额, 他们再谈论多样性,而是把几乎所有的配额分到印度,因为印度有一个较长的队列。因此,印度比中国多得了10倍的绿卡名额。
  •    最可笑的是,中国人也许太聪明,更合格,最近申EB3的越来越少。 EB2反而比EB3更长 。政府没有为EB2中国给与任何补救....只是让那些配额白白浪费,补给了印度EB3。



我知道生活不总是很公平。但作为最强大的总是宣扬自由和公平的国家,该系统是如此的荒谬和对中国人不公。顺便说一句我有同学去澳大利亚或加拿大拿到绿卡大多2年拿到绿卡,也有在美国骂中国政府就6个月拿到绿卡的,只是因为美国政府希望听到的这些。 我质问自己,我可能选择错误的目的地, 也警告那些有美国梦的中国人可怕的现实。

By the way, google translate sucks.

Tuesday, February 18, 2014

Use maven aspectj plugin to look inside of Spring

Along with spring development with more and more features, the code is more complex. Sometimes, developer wants to have some customized tracing information that spring debug logging does not provide. Aspectj, as an instrumental tool could help in this field, while maven aspectj plugin is able to quickly setup the project and get the instrumentation done. In this article, I will demo how to use maven aspectj plugin to instrument spring code.

The parent pom has two modules, aspectj and spring, while aspectj is the one to instrument the spring project.

 
 ---aspectj-spring
    --aspectj
      --src
        --main
          --aspect
            --packageName
              --AspectL.java
      pom.xml
    --spring
      --src
        --main
          --java
            --..clases
      pom.xml
    pom.xml 
The spring project is to use a Main class to bootstrap an application context. The pom.xml underneath spring enables a maven exec plugin to execute Main class
                        <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
     <execution>
      <goals>
       <goal>java</goal>
      </goals>
     </execution>
    </executions>
    <configuration>
     <mainClass>org.shaozhen.sample.Main</mainClass>
    </configuration>
   </plugin>
The aspectj project has only one Aspect (AspectJ.java) that intercept all the DefaultListableBeanFactory.registerBeanDefinition method execution and print out the bean names and class names.
@Aspect
public class AspectL {

    @Pointcut("execution(* org.springframework.beans.factory.support.DefaultListableBeanFactory.registerBeanDefinition(..))")
    public void defineEntryPoint() {
     
    }
        

    @Before("defineEntryPoint()")
    public void aaa(JoinPoint joinPoint) {
     String beanName = (String) joinPoint.getArgs()[0];
     BeanDefinition beanDefinition = (BeanDefinition) joinPoint.getArgs()[1];
        System.out.println("Register BeanName" + beanName + " with: " + beanDefinition.getBeanClassName());
    }
The apsectj pom.xml enable the aspectj plugin to do the load time weaving, since the spring class is already compiled into the jar. In order to do the load time weaving, the plugin has to include the binary jar as a dependency under <weaveDependency>
                       <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    <version>1.6</version>
    <executions>
     <execution>
      <goals>
       <goal>compile</goal>  
       <goal>test-compile</goal>
      </goals>
      <configuration>
       <complianceLevel>1.6</complianceLevel>
       <source>1.6</source>
       <target>1.6</target>
       <weaveDependencies>
        <weaveDependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-beans</artifactId>
        </weaveDependency>        
       </weaveDependencies>
                      <showWeaveInfo>true</showWeaveInfo>       
      </configuration>
     </execution>
    </executions>
   </plugin>
To Run the example:
In parent module: mvn clean install
In aspect module: mvn exec:java would print all the tracing information.....

Register BeanNamepropertyBean with: org.shaozhen.sample.PropertyFactoryBean
Register BeanNametest with: org.shaozhen.sample.TestFactoryBean
Register BeanNamecomponents with: org.shaozhen.sample.component.Components
Register BeanNameorg.springframework.context.annotation.internalConfigurationAnnotationProcessor with: org.springframework.context.annotation.ConfigurationClassPostProcessor
Register BeanNameorg.springframework.context.annotation.internalAutowiredAnnotationProcessor with: org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
Register BeanNameorg.springframework.context.annotation.internalRequiredAnnotationProcessor with: org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor
Register BeanNameorg.springframework.context.annotation.internalCommonAnnotationProcessor with: org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
Register BeanNameorg.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor with: org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor

The code can be accessed from here: https://github.com/datianshi/aspectj-spring