Categories
iPhone app Software development

Objective-C: first impression

Reading Time: < 1 minute

I like Apple products: I had iPod Nano (2nd gen) since 2007, and I owned MacBook (white plastic), and bought iPhone for my wife this Jan. All bring us very good user experience. That is not to say, Apple products are flawless. IPod and iPhone will die once a while, but nothing catastrophic as it does not erase music etc. MacBook has minor problems too such as “could not come back to life after hibernate”, and the heat generated by battery. But I like both my old iPod nano and my fairly new MacBook (the user interface is just beautiful 😀

Ok, now back to the hard part. One reason I bought MacBook is I want to learn Objective C (the programming language on Mac OS X) and Cocoa (UI framework). My first impression (after almost a year, on and off) on Objective C and Cocoa (using XCode) is: very unforgiving, like Steve Jobs 🙁

Two little stories from my own study, both on Chapter 9 NSUndoManager

Categories
Software development

The eBay Skype deal

Reading Time: < 1 minute

eBay agreed to sell a majority stake of Skype to a consortium of private investors lead by Silver Lake Partners. (WSJ: EBay CEO: Skype Investors “Confident” of Work-Around Software, get it from Google if necessary).

Silver lake is not new to me. Because they bought Seagate, and my former employer (hint: a major CAD/PLM software company) and made money from both (WSJ: Silver Lake’s Skype Deal Resembles Its Seagate Investment). See more of their investments here.

Categories
Software development

This Green dam thing

Reading Time: 2 minutes

(Update June 11) Here is a review of the software, by experts at Univ. of Michigan.

(Original) Yesterday I read from WSJ that Chinese government is asking the PC makers to install anti-porn software “Green dam” from July 1. I can understand western media’s interest here: the intension of government is more than protecting the Chinese kids, it’s more about controlling access to the world wide web, blah blah blah. I think this kind of analysis overly simplied (and obscured) many things happening in China. The real situation in China is more complicated. Since I grow up in China and read Chinese, I visit Chinese web sites from time to time. One thing I found over the years, is there are much more sex related content in Chinese web sites, even for sites like Sina, Netease (163.com) or Sohu.

green dam anti-porn software
(User Interface of Green Dam software, source: WSJ)

Categories
Software development

Compuware: first look

Reading Time: < 1 minute

(Update 06-11-09) Upon second look, sold the stock.

Compuware Logo pic by Wikipedia

Got some Compuware (Nasdaq: CPWR) shares last week in my SogoTrade account (for speculation purpose). I used their DevPartner products (integrated with Visual Studio, sold to MicroFocus lately, see news below) for memory debugging and performance tuning. Very impressed by their products from my experience. It can catch some unexpected memory error (sometimes introduced inadvertently due to time constraints in development).

Categories
Software development

Increamental Development

Reading Time: < 1 minute

Friday afternoon, 4 PM, finanlly I made things working: I mean the program compiled and ran at the first time. So what did I do? I found there are some minor problems here and there, and I decided to correct them. Off I went to make those “important” changes. By 5 PM I completed the changes and now the code stopped compiling and to make things worse, I promised to my boss to give him/her a demo on Monday morning! Why would I put myself into this kind of situtation? Or don’t we all have those kinds of situation in our development life?

Categories
Fun Software development

Write Software not Novel

Reading Time: 2 minutes

When I was taking my first C++ class at graduate school, the professor has a favorite word “you guys should write a program that works, because if it does not work, you are writing a novel not a program”. Although I did wrote “novels” in one of his program assignments, I remembered his words since then, certainly this include my professional life. Writing software that works is not easy, but it’s a goal every developer should strive for.

Assume we are just writing a very simple C++ program (remember the “hello world”), bacially there are two kinds of obstacles or errors we will face. The first is the compile error. Today I fought all day for this kind of error. Most of times compile errors are easy to solve, because the compiler will give you some hints: such as forgetting the semicolumn; variable name does not match (typos); other simple things etc. But sometimes things can get really tricky. I remember one day my coworker came over for help. I went to his cube and we tried to figure out why things do not compile. I looked at the error message from compiler, which is pretty much useless.  So we had to guess and tried different approaches without success. About one hour later, I suddenly found out there is an extra “^H” at the beginning of a header file. Binggo. That solved the problem.

This afternoon I had similar problem, I had to compile some code written by my coworker, which has not been compiled before. This is kind of thing we programmers don’t like to do: deal with other people’s devil. I was puzzled by the compile error for about 3 hours: it was  complaining the std::vector not defined properly. Finally I found out my coworker put some header file inside the class (and another namespace), which is a bit unusal and it caused the conflict of vector. I will talk about the other type of error later on. Hint: compile error is relatively straightforward compared to the other error 🙁

Categories
Software development

Dumb C++ Mistakes

Reading Time: < 1 minute

It seems like I don’t have anything to do with C++ because I have not touched C++ much in this blog. I am a software engineer by trade; programming and debugging is a large part of what I do during the day. I was a little frustrated last two days by a memory problem shown only on UNIX. The program ran fine on Windows, except one or two instances slightly weird results which I tend to ignore. But I could not pass the UNIX test and obviously something is wrong. By looking at the trace back I can tell it’s a memory problem. Memory problem is kind of problem everyone hates. Because it’s usually hard to find the root cause. Dev Partner made the process a little easier because it will show all potential memory overrun and leaks. To my surprise, I made a mistake like the following (very basic C++ mistakes):

char *temp_str = new char[length]; 

for(int ii = 0; ii < length*2; ii++){     // do something with temp_str[ii] } It is a typical memory overrun problem because I only allocate "length" number of char, but I was trying to use "length*2" number of char. It's like use twice the credit limit? But I am still very puzzlled that my program ran on Windows (without Dev Parter) before the fix. No wonder we see "Windows crash" from time to time :-) Seriously, in software development we want the problems being uncovered the earlier, the better. Because we don't want our customer run our program and crash.

Categories
Career Software development

Working with gurus

Reading Time: 2 minutes

From time to time I had the oppertunity to work with gurus, I mean, the expert, or the genius in the field. I think I enjoyed my time spent with them from time to time. Although I had to admit those days were not easy 🙁

In the second year of my graduate school, I took a course from a very well known professor (known for his toughness). He will assign homework as he lectures. Because at that time my English and course knowledge were not very good, I had to pay close attention to his lecture so that I won’t misunderstand the homework. His homework is not easy, to say the least. First I had to spend time to figure out the questions being asked. I think I went to his office almost every time. Besides understanding his problem, the solution is not straightforward either. I remembered sometime I had to work on the solutions until his class begins (which is the deadline for the homework). The most scary part is his test: stuffed with questions with long answers, lots of math. I remember I got a 30s score in the first test, partly due to my misunderstanding of the question: I started working on it before fully understand the question because of time constraint. To my surprise, one of my classmate, who got my help for almost every assignment, got a better score. But I worked hard. At the end of semester I did got “A” for that class. I think my attitude (not my score) impressed the professor.

In the same semester I also had an oppertunity to work with another guru for research. This was the beginning of my graduate research. We had a few short deadlines to meet. I worked hard during that time, sometimes sleep in the office, to make the computation results available before each group meeting, during which the guru will take a quick look, determines what makes sense, what does not, and giving a few encouraging words. I admired both his technical and business skills.

Nowadays in my work place I also meet gurus from time to time, sometimes even work with them. It is always a pleasure to work with gurus, because they know the stuff and can explain difficult things in simple terms. They are also inspirational most times.

Categories
China Software development

English problem

Reading Time: < 1 minute

I saw the following from Joel on Software . I had some hard time trying to understand it. Is he looking to be a distributor of foreign software company? Or he is interested in doing outsourcing work for foreign companies?

I am thinking, this English problem (if typical among Chinese software industry), does present oppertunities.

===========================
Title “anyone can give me dealership?”

I have an own software inc. in Beijing, China.

but my fire is small and not have self-software.

my friends tell me that I can find a foreign software fire and dealership.

who can tell me how to do it?

my email is blah blah blah

note: in my information’s homepage is not my fire’s. it’s only a sharesoft of mine.
=========================

Categories
Software development Windows

Left hand mouse and UNIX

Reading Time: < 1 minute

I started to use left hand for mouse last week because my right hand did not feel well: being a programmer, I had too many mouse clicks for my job. One of my coworker hurt his right hand permanently so I decided to be more careful. Initially I felt it a bit awkward but I am doing OK now (this is the second week).

The real job is much tough. I had to do lots of work on UNIX. Don’t get me wrong. I am a fan of UNIX and I think I have decent skills on UNIX. It’s just in the past few years I almost used Windows exclusively. Now I felt a bit wield coming back. As I read “Joel on Software” recently I agree with Joel said: Windows is designed for everyday user; UNIX is for the programmer. The mind set of two systems are so different and I need to adjust. Different compilers on different UNIX systems, different debuggers, and different problems: compile error, run time error(bad results or crash). I think that may be one of the reasons that UNIX is losing market share in applications (in addition to higher hardware cost compared to Intel). I don’t know how the new generation programmers are taught in school. Are they using MS Visual Studio IDE for C++ class or gcc/gdb on Linux? The latter is much harder to use and debug; it’s all command line. Years ago I heard there is this thing called “KDevelop” Linux C++ IDE but I have not used it. Personally I do believe it’s important for programmers to know both IDE and command line, because IDE is not always available.