Skip navigation.

USCIS H1B for 2010

, , , ...

On April 20 the USCIS department announced of an update for the FY2010 H1B petition filing.
Up to this date the 65,000 quota was not filled up yet, there were only 44,000 applications so far, which means there are a lot of chances for those who applied this year to get an H1B visa.

This is the link to the news

UPDATE
On May 18, USCIS released an update where they said that approximatively 45,500 applications were filled so far.
Link to the update

UPDATE
On May 5, USCIS released an update where they said that approximatively only 45,000 applications were filled so far.
Link to the update

UPDATE
On April 28, USCIS released an update where they said that approximatively only 45,000 applications were filled so far.
Link to the update

DB2 regexp in select clause

, , , ...

How to use regular expressions in a DB2 select query?
The simple answer is you can't. But if you are very insistent you can acheive that.
A lot of RDBSes have built in support for regular expressions, why doesn't DB2 has one? I have no idea.

In MySQL you do REGEXP, NOT REGEXP or RLIKE. here is another link.

In Microsoft SQL Server 2000 you call xp_pcre. In Microsoft SQL Server 2005 you call integrated .NET Regex classes from .

In PostgreSQL you call the regexp functions, here is another link.

For Oracle here we have a bunch of resources: First, second and also on regular-expressions.info

If you'll do a search on DB2 regexp you will stumbled upon this IBM article:
http://www.ibm.com/developerworks/data/library/techarticle/0301stolze/0301stolze.html
Which I found very interesting.

Immutable String

, ,

I read an article about "how much" immutable the java.lang.String class.
The article says that the String class is a classic example of an immutable class - but is it?

Read the article

Perf4J

I was reading today about a nice library for java for monitoring performance, looks really neat.
Check it out at: http://perf4j.codehaus.org/

Documentation: http://perf4j.codehaus.org/devguide.html

Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session'

, , , ...

The full exception is:


org.springframework.beans.TypeMismatchException: Failed to convert property value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session': no matching editors or conversion strategy found
Caused by:
java.lang.IllegalArgumentException: Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session': no matching editors or conversion strategy found



In my case when I got this exception, what I did is moved the activation.jar and mail.jar file from the web app lib directory to CATALINA_HOME/common/lib.

And it worked just fine.

ADAM setpassword 0x80005008

, , , ...

Today I was fighting with a problem at work.
If I tried and set the password in ADAM in C# it gave the next error:

Message: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80005008): Exception from HRESULT: 0x80005008.



As described in this page:
http://social.technet.microsoft.com/forums/en-US/exchangesvrdevelopment/thread/bb518eb3-02cb-4b3c-9a18-4ce85f245131/

They say there is a fix for that from Microsoft. I didn't try that but I found another solution to my problem.
So, I was:
1. Going against ADAM
2. Through SSL
3. .NET 1.1

The code I had was exactly from the page above:


de.Invoke("SetOption", new object[] {(int)ADS_OPTION_PASSWORD_PORTNUMBER, (object)_portNo });
de.Invoke("SetOption", new object[] { (int)ADS_OPTION_PASSWORD_METHOD, (object)ADS_PASSWORD_ENCODE_CLEAR});
de.Invoke("SetPassword", new object[] {newPassword});



What is sneacky here is the ADS_PASSWORD_ENCODE_CLEAR constant, btw the constants are declared like:


const long ADS_OPTION_PASSWORD_PORTNUMBER = 6;
const long ADS_OPTION_PASSWORD_METHOD = 7;

const int ADS_PASSWORD_ENCODE_REQUIRE_SSL = 0;
const int ADS_PASSWORD_ENCODE_CLEAR = 1;



As you can see the ADS_PASSWORD_ENCODE_REQUIRE_SSL is not used in my case.
So, what I had to change is from this:


de.Invoke("SetOption", new object[] { (int)ADS_OPTION_PASSWORD_METHOD, (object)ADS_PASSWORD_ENCODE_CLEAR});



To this:


de.Invoke("SetOption", new object[] { (int)ADS_OPTION_PASSWORD_METHOD, (object)ADS_PASSWORD_ENCODE_REQUIRE_SSL});



And it worked.
Remeber this is changing the password in ADAM through SSL.
And by the way on your DirectoryEntry object set the AuthenticationType to AuthenticationTypes.SecuredSocketLayer

Related links:

1. http://msdn.microsoft.com/en-us/library/aa772136(VS.85).aspx

2. http://msdn.microsoft.com/en-us/library/system.directoryservices.authenticationtypes.aspx

3. http://social.technet.microsoft.com/forums/en-US/exchangesvrdevelopment/thread/bb518eb3-02cb-4b3c-9a18-4ce85f245131/

4. http://www.techreplies.com/windows-2003-77/setting-user-passwords-adam-vb-net-466581/

5. http://directoryprogramming.net/forums/9/ShowForum.aspx

No userAccountControl for ADAM!

, , , ...

If you worked with Active Directory and want/will switch to ADAM (Active Directory Application Mode), you should note one important fact:
ADAM does not support the userAccountControl property. Instead use one of the next individual properties to simulate it:


ms-DS-UserAccountAutoLocked
msDS-UserAccountDisabled
msDS-UserDontExpirePassword
ms-DS-UserEncryptedTextPasswordAllowed
msDS-UserPasswordExpired
ms-DS-UserPasswordNotRequired



Link to Microsoft documentation about this: http://msdn.microsoft.com/en-us/library/aa772124.aspx

The element type "property" must be terminated by the matching end-tag ""

, ,

The exception you might get is:

Caused by: org.dom4j.DocumentException: Error on line 55 of document : The element type "property" must be terminated by the matching end-tag "". Nested exception: The element type "property" must be terminated by the matching end-tag "".



This means one thing: YOUR HIBERNATE MAPPING FILES HAVE A WRONG SYNTAX. Recheck them!

Good luck!

Pronounce my name correctly, you ˈæŋgləˌfoʊn!

My full name is Alexandru Luchian.

The spelled pronunciation is: ah-le-ksahn-droo loo-kyahn

The International Phonetic Alphabet pronunciation is: /ɑlɛˈksʌndru/ /ˈlukɪʌn/

Amazon Interview Questions (part1 - phone screen)

, , ,

June 2007 was the month when I started my MSCS at Maharishi University Of Management (MUM) in Fairfield, Iowa.
The program consists of 7-8 months of studying on campus and 2 years of Practical Training.

At the end of December 2007 I started my job search. I never applied for a position at Amazon, I didn't think they would even consider interviewing me, but at the beginning of January I got an email from a HR lady at Amazon asking if I am interested in a Java developer position (SDE) at Amazon (sure as hell I was!). She sent me the description of the job, it was a position at Amazon Fresh team, which would involve Java/RoR/MySQL/Linux knowledge.
We set up the first phone interview for a Tuesday morning.

My interviewer was a lady, she was very nice and had a pleasant voice. First, she introduced herself, where she works, what are her duties and what should expect from this interview.
The interview started with a couple of basic questions:
1. Where do I study
2. What major
3. What courses I took
4. Why did I take those courses
And a couple more.

Then she started asking basic Java questions:
1. What is the difference between an object and a class
2. What is the difference between an interface and a virtual class
3. What is the Java collection framework
4. What is a List, what is an ArrayList
A lot of typical questions about collection framework

Then the algorithms round of questions started.
The first "trick question" was how would you reverse a String. I took a couple of seconds to think, sketched a pseudo-java code and started to dictate to her. She was listening and writing down everything I was saying. Then I remembered of the reverse() method of StringUtils class. I told her that and she said that is what she was looking for, nice!
The second algorithm question was: You have a list of random numbers, what is the quickest way to calculate what is the frequency of each number? From what I remember I used a hashtable to memorize the numbers as the key and the value as the frequency rate:
[3] -> 1
[1] -> 4
[6] -> 12

And so on. Then she asked me what is the complexity of this solution.
The parsing of the list is O(n), where n is the size of the list. Placing the number in the hashtable is ideally in a good written hashtable O(1). Then, traversing the hashtable with results is O(n) and the access of each key/value is O(1) again (considering it's a well written hashtable), so the complexity is O(n) + O(1) + O(n) + O(1) = O(n).

Then she asked me a software design question: describe me the UML diagram of a software that manages restaurant reservations.

The interview lasted about 40 minutes. We got interrupted twice because of bad AT&T signal in Fairfield, Iowa :smile:
At the end I asked her why is RoR used at Amazon Fresh, I also asked her if they have any performance issues with RoR. She told me that the traffic load on the Amazon Fresh website is small and RoR is a "quick" solution to some of the taks. For the same reason they use MySQL - not a high load web site.

I had am impression that I did quite well, although the questions seemed very easy. So, I waited for their answer.
July 2009
S M T W T F S
June 2009August 2009
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31