Sunday, December 25, 2011

My Christmas

I did not schedule anything for this Christmas, not even trying to. Just wanna be alone.
There was only one tomato left in the fridge and several eggs, so that made my 24th,I didn't go out to buy any food which I really regretted because when I tried to today, there is no store open! Two boxes of frozen food from CVS are my meal today, they are gross and I can feel my stomach complaining so hard now, it is yelling: I need vegetable! I need real food!
The most interesting and incredible thing happened during the Christmas is the 47 years old guy I emailed back and forth. Based on his email address, I googled his name and it turned out he is or was a professor at UC. Unbelievable and shocking! I found some family picture he shared on his page, there is a little Asian girl whom I guess is adopted by him. No wonder he claims that he wants to meet Asian lady. That is the reason! He is one of those Asian fevor guy! Omg!
Why is life so dramatic to me! So unpredictable to me?

Wednesday, December 21, 2011

Comparison of JAVA and C++

I was quickly going through this book "JAVA for everyone" (only two last chapters left), when I started to have a question: seems that JAVA is much easier than C++, then what is the difference between these two programming languages? and why did college teach us C++ instead of JAVA?
I guess Wikipedia is the most convenient source to find the answer for the first question, here is some summation I made. So far, I still cannot understand everything they explained, but anyway, let me write down what I can understand first:
Design aims: C++ was designed for systems and application programming, extending C language which means it added support for statically-typed object-oriented programming, exception handling, scoped resource management and generic programming. JAVA was created initially as an interpreter for printing systems but grew to support network computing. It is a statically-typed object-oriented language too that used syntax similar with C++, but is not compatible with it.
Compilation: C++ source code is written to be platform independent, and then is compiled into native machine code while JAVA code is first compiled into byte-code for the JVM(Java virtual machine), so JAVA code is dependent on the JAVA platform and not dependent on OS.
Struct and Union: JAVA only supports class, does not support struct or union.
"." operator: In C++, it takes an object as the left operand and access a member of the object. In JAVA, it takes a reference to an object as the left operand and access a member of that object (the equivalent operator in C++ is "->", which takes a pointer as the left operand).
Pointer v.s. reference: In C++, pointers can point directly to memory address. In java, similar thing is called references, but references can only refer to objects and arrays. Java references do not allow direct access to memory address or allow memory addresses to be manipulated with pointer arithmetic. In C++, on can construct pointers to pointers, pointers to ints and doubles and pointers to arbitrary memory locations. Java references can only access objects and arrays, never primitives, other references, or memory locations.
So far, this is what I can understand best for the first question, maybe I will add something more as I know more about the comparison.
As for the second one, I turned to Baidu.com since I first learned C++ in college in China. The answer is C++ is a foundation of learning other programming languages, it is much easier to learn JAVA after you have already known something about C++ (I agree).

Monday, December 19, 2011

It all starts from that big alarm!

    T started his PhD program as the same year as I did, and we are the only two Chinese students in system track in EE. In fact, there are only three system students total. Recently, he got an internship job from Intel at CA. The moment I heard it, a big bomb was dropped in my head, caused millions of thoughts and left a big alarm keep going on and on.
    It is true that T is five years older than me, one more Master degree than me, more experience than me, and more creative than me...but still, that alarm forced me to think what is the best for me, for my future career.
    What I learned and what I am studying is still too far away from the real life application. Of course no one can guarantee that it's a perfect match between school study and job requirement, and I am assuming I'm not the only one who is struggling about it. But I guess what I need is some confidence to ease the problem, the confidence that I can gain from full preparation.
    It's good to have sense of crisis, it pushes me to move forward instead of staying at the same place forever. But I am also aware what my shortage is: passionate but not long lasting. That's why I started this blog and use it as a journal/notebook/poster to record my life, to remind myself the reason I started it.

Thursday, December 15, 2011

OpenCV and Eclipse installed

1. For OpenCV, it turned out that there is another more efficient way to install it: http://opencv.willowgarage.com/wiki/VisualC%2B%2B_VS2008, I call it "direct installation". Now the demos work, and opencv helloworld works. I will text my "photo capture" program sometime later today.
2. Eclipse IDE, installed java SDK first. A full instruction from UC berkeley helped me a lot: http://ist.berkeley.edu/as-ag/tools/howto/install-eclipse-win.html.

Good news, the rain is gone. It's time to go out to try my new tripod and get some fresh air. Good afternoon! :D

Visual studio 2010 v.s. Visual Studio 2008

I have been using my HP laptop for two years, and never re-installed the system once, so lots of junk under C:\ and sometimes its process speed just drives my crazy. I figured since everything in my life is re-start freshly, why not re-install Win7?
1. MSDN offers free series key to students, so it's easy to get Win7 professional. (check)
2. C:\ is formatted while other disks are still the same. (check)
3. A bunch of software and applications I need to download and install again after re-installing the system.(check)
4. I used Visual Studio 2008 under my old system, and this time I updated to Visual Studio 2010 ultimate. (check)
5. Configure OpenCV with VS2010 (troubles start from here)
6. First of all, I followed an instruction of how to configure OpenCV with VS2008(http://www.opencv.org.cn/index.php/VC_2008_Express%E4%B8%8B%E5%AE%89%E8%A3%85OpenCV2.3.1), however, VS2010 does not have C++ directories under tool/options/C++ which means for every project i build in the future, I will need to manually set up the directories again and again. I searched online, this is one of the few changes VS  2010 made compared with VS2008. There are some instructions out there about how to fix it, but i guess i'm very low patient, and just couldn't care.
7. Then I switched to another instruction for VS2010(http://www.opencv.org.cn/forum/viewtopic.php?f=1&t=11157). After following all the steps in the instruction, luckily, i was able to build my project under VS2010. But! But! but error bumped out when I ran the project, "cxcore210d.dll is missing from the computer,..."!!! I googled this error and tried all the methods to fix it, but nothing works. Someone had this problem before mentioned that OpenCV still works better with VS2008.
8. So, after all these troubles, I removed VS2010 from my computer, and right now, I'm installing VS2008. Hope I can get this done this morning, good luck to me!

Tuesday, December 13, 2011

Deleted the old blog

I'm two months late to delete the old blog I shared with my ex. It was amazing how time pass so fast and it has been two months.
Winter is here again, chill wind and frosted car...
Recently, I have lots of things going on in my mind. Today I just want to start this new blog, and from tomorrow I will write down every thought in my mind no matter it's about my research or about social relation.