Oracle database link error: ORA-01017: invalid username/password; logon denied

Today I create a database link in Oracle as follows

CREATE DATABASE LINK DATABASE_LINK1
CONNECT TO SCOTT IDENTIFIED BY TIGER
USING ‘PDTT’;

When I try to use the link I get an error.

select * from dual@DATABASE_LINK1;

SQL Error: ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from DATABASE_LINK1
01017. 00000 –  “invalid username/password; logon denied”

At first I thought there was problem with service name ‘PDTT’, but when I used sqlplus to connect using PDTT it succeeded (i.e. sqlplus scott/tiger@PDTT).

The problem turns out to be that the DB I try to connect to is 11g and it by default sets password case sensitive to true. To solve the problem, I use double quotes to enclose lower case password and user name:

CREATE DATABASE LINK DATABASE_LINK1
CONNECT TO “scott” IDENTIFIED BY “tiger”
USING ‘PDTT’;

Storing encrypted password in Perforce

I want to write a nightly script that does the following

  1. sync to source code to the latest version
  2. build the project
  3. run the built project.

The first problem I run into is that Perforce requires a password to login, but I don’t want to expose my password in the script as plain text. At the beginning, I thought I could something that resembles SSH password-less login. For instance, I would create a public-private key pair and store the public key in the Perforce server, so that I no longer need to provide a password when I log in. After a bit of googling I don’t think such a solution will work, not to mention that I don’t have permission to store anything on the Perforce server.

After reading the Perforce manual more carefully, I find a solution: I use the “p4 passwd” command to change my password and store the MD5 hash of the new password into P4PASSWD environment variable. After that I can run other perforce operations without logging in first. One hiccup of the approach is that you need to change the password in order to set the P4PASSWD variable. If you change the password on the server first, the P4PASSWD on the dev machine will become invalid. If you change on the dev machine first, P4PASSWD will become invalid on the server. What I did was change to password on the server, enter “p4 set P4PASSWD” to get the MD5 hash, and then go to the dev machine and enter “p4 set P4PASSWD=<Md5 hash>”. But that raises another question: if someone else get hold of my MD5 hash will he also be able to login as well?

Updated: Perforce knowledge base has a related article.

2 Weeks and 4 Days

… that’s how long I stayed in the previous company. I started at this IT consulting company, one of the biggest in Canada and has a three-letter acronym, about 3 weeks ago as a Systems Analyst. I didn’t like it at all, and probably have made up my mind to quit within the first week. (For the record, I am not proud of changing jobs so soon. In fact, I enjoyed working at YottaYotta, the first company I joined after grad school. I worked there for 2 years and 4 months, and I could have worked there much longer if not for the company acquisition.) There were lots of reasons why I quit, and I am going to write a separate post to expand on it. In a nutshell, it is too “big” for me: not in the sense of company size or market capital, but there is just too much frameworks, processes, protocols, standards, compliance, templates, time sheets, etc.

The project itself is interesting to me. However, I am afraid I need to fight a lot of battles before I got to do what I love: software design and development, the technical stuff. Some of my friends suggested me to stay for a little longer, because they think some work experience on government projects with a large company can pad up my resume. I sincerely appreciate my friends’ suggestions. They are clearly thinking for my own good. But I already got interviews from Google, Amazon, BioWare, and I aced my interviews with Research In Motion. I am either a very lucky bastard, or my resume is good enough as it stands. I can’t give my best performance if I need to cry every morning before coming to work. The project manager, who is a car enthusiast, mentioned during coffee break that he would be happier if he were a car mechanics. His words resonated with me. I believe I made the right decision.

It is all OK now. I don’t aspire to people wearing suits and working in downtown skyscrapers no more. Been there, seen that. Now back to the basics.

Orientation

Today is my first day at the new company. I spent the first half of the day reading employee manuals, which are so boring that I had to exceed my normal dose of caffeine to stay awake. The second half of the day I wrestled with eight login accounts and eleven passwords: one for corporate email, one for work email, one for corporate portal, one for secured remote access, one for intranet site, one for enabling the propulsion rocket under my ejection seat. (Okay, I make up the last one.) There is no table on my floor that people can sit down and eat. In place of a lunch table, there is a ping pong table, probably for the sake of giving a cool image of the company. In my last company, there was a ping pong table too. It was used for a grand total of two times last year: once for the United Way fund raising campaign, and once as something to step on in order to change the dead light bulb.

Interview with Research In Motion

Friends who also read my blog (a.k.a nobody) may already know that I have been without a job for a few weeks due to company acquisition. I have been looking for a job since, and I feel very fortunate that I get interviews with many companies, big and small, even in a time when the economy seems to be spiraling down the toilet.

My interviews with Research In Motion is particularly interesting. In case you don’t know, RIM is the company that brings you BlackBerry, and headquarters in Waterloo Ontario. I have for a long time considered RIM a great company for a software developer. After all, they design and build a gadget that everybody gets crazy about. And after all, Canada doesn’t have a lot of cool tech companies to begin with. So, I applied for a Java Developer position from RIM’s website soon after I became available (i.e. lost my job). I waited. And I waited more. Still no response. “They are not interested in me”, I thought. “Or maybe they are reluctant to hire someone who is 4,000 kilometers and two time zones away.” The latter reason makes me feel better, so I conclude that must be it.

Two weeks ago, and about one month after I submitted my application, I got a call with area code 519 when I was on my way to the grocery store. I answered the call. It was RIM. The recruiter set up a time for the phone screening. The screening went smoothly. Some typical HR questions were asked, followed by some easy Java questions. The interviewer was a recruiter (not a developer), so I am amazed (and glad) that she asked technical questions. Not only did she asked those questions, she understood my answers as well. I think it is a hallmark of good software companies.

The second round of phone interview was with the team manager. He is a very nice guy, so nice that he didn’t bite my head off nor gave up on me, even though I missed his call the first time. (Well, it was not completely my fault. There was confusion about whether the interview time is Waterloo time or Edmonton time. I tried to get clarification, more than once, but there wasn’t any.) The second time he called, a few days later, we had a very good conversation about my background, the position I applied for, how the team fit into the company’s big picture, etc. He asked some technical questions, and I handled them pretty well. (Yeah, I am good.)

They flew me to Waterloo for the final round of interviews three days later. Technically, I flew to Toronto, and the a prearranged limo picked me up at the airport and took me to the Radisson Hotel in Kitchener. When I arrived at the airport, it was already 9PM and very dark, so I didn’t see much on the way. The trip took about 1 hour. The limo was a Lincoln Town Car. The seats are comfy. I am slightly disappointed that it was not a stretch, like the ones seen in gang movies, but since I am not paying for it, I should be more than happy.

Next morning, I woke up at 8, even before the alarm clock had a chance to do its duty. Very unusual, considering my body clock is still 6am Edmonton time. After breakfast, I took a cab to the RIM headquarter, which is in another city, Waterloo. There still was not much to see along the way, probably because Waterloo is a typical college town (i.e. boring, or to put it nicely, good for raising your family).

I arrived at building RIM 1 half an hour early, so I sat down and watched people coming in and out of the office. I noticed a high percentage of people are twenty somethings, and I had for a moment the delusion that I was in a university. And I like being in a university because it’s always energetic. Near 10’o clock there were still some more people coming to work. Flexible time, I said to myself. Good.

The interview took place in the manager’s office. Also present was another senior member of the team. They were very nice, and I felt right at home. The interview was going to be two hours. I was expected to solve some simple programming puzzles, like “writing programs in Java byte code and do arithmetic using hex”.

They began by asking questions about my last job, like what did the product do, what was my role, and the important projects I worked on. I used the whiteboard to draw some pictures to illustrate the concepts. (I like drawing the back end storage symbol BTW. But someone has told me I drew it like a crude oil bucket.) questions tend to be very detailed. I found myself using real examples several times in order to explain how things worked. After time spent on past experience, we switched topic to fundamental programming knowledge: the kind of things that you went through at school, but haven’t really used much in the job. The highlight of the interview was writing some code to solve a programming puzzle. It took me 0.57 second to figure out a naive solution. The naive solution has O(n) run time complexity, which is as good as it can get. However, it requires two pass of data structure, so there is room for improvement. I came up with a better solution in about a minute, which only needs one pass on the data structure. Although the solution is very simple logically, writing its code correctly on a whiteboard while standing up is more tricky. It took me about 10 minutes (Real time could differ from my estimate, since my mind went into a meditative state momentarily and must have lost track of time.) and many uses of the eraser to finish the task. The interviewer did not challenge my doodling, either because my whiteboard writing was so terrible that he couldn’t understand a word, or it was a good solution he was happy about. I tend to think it is the latter.

The rest of the interview seemed easier after the whiteboard programming part was over. There were more questions on advanced Java topics, like multi-threading and design patterns. I think I did well on those questions too. By the end of the interview, I knew my chance of getting an offer was better than 95%.

After finishing the interview, I had a short walk nearby. 20-odd buildings of similar size make up the RIM campus. Buildings are numbered: RIM 1, RIM 2, RIM 109, etc. Again, it really looked a university campus. It was lunch time and I felt a mix of excitement, exhaustion, and hunger. And hunger is getting its increasingly dominant share. I tried to find a place where I can sit down and eat. I walked up and down the street, but all I can find is an On-The-Run Tim Hortons, and an overly crowded cafe whose lineup could be seen from miles away. As I later found out, the location has a “car dependent” rating based on the Walk Score website.

Two days after the interview, I got a call from RIM’s HR and confirmed my guess. My interviews went well and they would like to move forward with reference checks and stuff. The recruiter tried hard to convince me to work at the Waterloo office, instead of the Ottawa branch I originally preferred. I agreed with most of his arguments, like Waterloo being the headquarter and has more actions taking place, having more opportunities to rub shoulders with managers, etc. But I somehow still feel Waterloo is too rural for me. On second thought, it should not matter much because I don’t have a life anyways.

Unfortunately, due to a family circumstance I am not able to relocate at this point, so I have to pass up their offer. I think RIM is a great company to work for. Lots of smart people work there, tons of things to learn, and many fasinating projects are available. The work environment may not be as sexy as Google’s, but still better than most. I am very happy I interviewed with them.

How Real Estate Ads Correlate to Final Sales Price

80 pages into the book Freakonomics, I find it informational and fun to read. It will certainly change my views on some day-to-day activities. The part on real estate agents is so interesting that I decide to write it down. Data show that some common terms used in real estate ads are correlated or negatively correlated to the final sales prices.

5 terms correlated to a higher sales price:

  • granite
  • state-of-art
  • corian
  • maple
  • gourmet

5 terms correlated to a lower sales price:

  • fantastic (ambiguous adjective, the house doesn’t have many specific attributes worth describing)
  • spacious (decrepit or impractical)
  • ! (false enthusiasm)
  • charming (same as “fantastic”)
  • great neighborhood (“this house isn’t very nice but others nearby maybe”)

加拿大旧中文报纸收藏,1910s年起

前天在一本宗亲会刊上看到一个叫“舞士阻”的地方在加拿大,完全没有头绪究竟其英文名是什么。于是google了一下,无意中发现下面这个网站,里面居然收藏了多份加拿大中文报纸的扫描图像,最早的有1910年代的!

Multicultural Canada Newspaper Collection

后来发现“舞士阻”就是Moose Jaw,在Saskatchewan,当年也有很多华人聚居。

Large Sensor Compact Camera?

In the coming 2008 Photokina, I am hoping to see a compact camera with APS size sensor. My dream camera should look like a range finder type, such as the Richo R8 or Leica D-LUX. A fast 28mm lens would be great. I don’t want to see a long zoom lens because it’s very difficult to engineer a long zoom without sacrificing picture quality. The camera should be small enough to fit into a shirt pocket. The cost of a APS sensor must have come down dramatically over the years. Given that the Canon XSi with kit lens is listed for just under $700, I think it is reasonable to expect my dream compact camera can be had for about $600 soon.