Nuo Yan

Problem Solved

Recent Posts

Tags

News


  • Follow me on twitter: @nuoyan
    Make a donation to this Blog by PayPal. Thanks!






    Nuo is currently a Software Development Engineer in a Seattle-based software company.




    Locations of visitors to this page

    The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my school or employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.


Community

Email Notifications

Archives

May 2007 - Posts

Book Recommendation

Writing Solid Code: Microsoft's Techniques for Developing Bug-Free C Programs (Microsoft Programming Series)

Yes it's an old book which was published in 1993, but it's really awesome! I first got this book in last Saturday night, then I spent several hours finished reading it. I just couldn't stop until I finished!

I recommend every C programmer to read it, if you haven't done so yet.

Nuo

Posted: Tue, May 29 2007 23:04 by Nuo Yan | with no comments |
Filed under:
Some Thinkings In Software Piracy

Last Friday when I was visiting an internet portal consisting of a chat room of a specific group of people, I saw the following conversation:

A: How can I configure the system to prevent keeping getting the messages which notify me that the software I use is not genuine?

B: Just ignore the messages, as you still can use the software.

It just doesn't make sense why somebody wants to ask such question, and why the other answers like that. The answer should be "go to buy and use a genuine copy."

We all know the fact that in many places in the world there are still a lot of people using pirate software, but we realy need to think further about the reason. Are they really just can't afford to buy genuine software? No, I don't think so. The answer is not that easy. Many of the people can spend hundreds of dollars for dinner, for clothes, etc, but they just don't want to spend the same amount for a genuine copy of software.

I don't know anything about psychology, but I guess such people are using a way of thinking which is in the wrong logic. They may probably think that there's no reason to spend money to buy something which can be found elsewhere for free. But they may not know (hopefully) that doing so is just like somebody steals something and give to them to use. By doing so in a long time, this has become a using habit and people don't want to buy genuine software anymore.

As the result, software piracy is not just a problem of rich or poor. It's true that decreasing software price in specific places of the world may increase the sale; However, proper education and time are also quite necessary. This should be a collaboration of different parties. Schools should provide such kind of education in a very early stage so people know that using priate software is a kind of guilt from their early ages. People has enough money should begin using genuine software, to enjoy better services. Softwre companies should increase the quality of software, and increase the quality of the services provided for genuine users. If the users who are currently using pirate software get same functionality and same level of services or support when they are using genuine software, they would probably continue using pirate software because it's free. Governments also need to provide support on policies for genuine software. Pirate software will not disappear in a minute, so we also need some time. If you know some of your friends may be using pirate software, tell them why using genuine software is important; and tell them how they can benefit from doing so. If they can't afford using genuine copy, there are also a lot of free software and evaluation software available. Pirate one are not their only choice.

All the things above are just some personal ideas, the concepts are not new and most people may already know.  My intend is just to let even more people, especially those who are currently using pirate software but actually can afford genuine software, know the importance and benefits of using genuine software. Using pirate software is not free, but it costs much (guilt, illegal in some places, etc). As the result, let's help everyone around us stop using pirate software; let's help make the software industry better.

Calculating Required Storage In a Direct-Mapped Cache

Suppose a 1-level direct-mapped cache need to have 64 KB's data, each block is 16-byte, and the memory address is 32-bit.

To  calculate the total bits needed for the cache, we could go through  the following steps:

  • We need to have 64 KB's data (2^16 bytes) in the cache, and each block is sized as 16 bytes (2^4), so we totally need 2^12 blocks for the data, let's call the "12" as "a." This means a bits are used for the index.
  • Each word has 4 bytes, then in this case each block has 2^2 words, let's call the exponent 2 as "b." This means b bits are used for word in each block.
  • The size of the tag is determined by the equation "length of address - (a+b+2)," the 2 bits here are the byte offset of the address. So, in this case, it's "32 - (12+2+2) = 16."
  • Each block has 16 bytes, each byte has 8 bits, so the amount of data for each block is 16 * 8 + tag + valid bit = 128 + 16 + 1 = 145 bits.
  • Times the amount of data for each block (145) to the number of blocks (2^12). Then we get 593920 Bits. Convert to KB, it is 72.5 KB.

So 72.5 KB's of data is required to make a 64KB 1-level direct-mapped cache .

In general, the idea is very simple: total bits required = number of blocks * bits required for each block. Mistakes can usually be made during the process of calculating the size of the tag. Sometimes it's also easy to forget to add the valid bit. But if doing it carefully, we could realize that the way of calculating it is quite simple.

Posted: Thu, May 3 2007 21:58 by Nuo Yan | with 12 comment(s) |
Filed under:
Terminologies of Earned Value Management In Project Management

Earned value management is an important and useful part of performance measurement in the whole project cycle. The terminologies are important to remember (or at least to know) to manage Earned Value of the project. I will list the most basic ones in this blog entry, as a simple source of reference.

Cost - the amount of money for completing the project. Note this is NOT the price which the customer pays. For example, a bottle of soda costs $0.5 for production, but the price in the store of the same soda is $1.00. 

Planned Value - The planned cost of the project. We have this value before project starts.

Earned Value - The planned cost of the project as it is at some point of the progress. We have this value when the project has started and in progress.

Actual Cost - The actual cost of the project as it is at some point of the progress. We have this value when the project has started and in progress.

For example, if we have a project planned for 2 days, the first day has $500 planned budget and the second day has $300 planned budget. But when the project actually starts, it only has done half in the first day and done the originally planned first day's work in the end of the second day. Then at the end of the second day:

1. The Planned Cost for the first day is $500 and for the second day is $300. Total $800.

2. The Earned Value for the first day is $500 (because project members are working full day), and for the second day is $0. Total $500.

3. The Actual Cost for the planned first day's work is $700 (suppose), the planned second day's work hasn't started yet so no Actual Cost for that. Total $700.

So we can calculate some important values:

1. Cost Variance: Earned Value - Actual Cost = $500 - $700 = - $200, which means the actual cost exceeds the planned budget at this point of progress.

2. Cost Performance Index: Earned Value / Actual Cost = $500 / $ 700 = 0.714 = 71.4%, which means we get 71.4% of what we spent (or invested).

3. Schedule Variance: Earned Value - Planned Value = $500 - $800 = - $300, which means we are behind schedule (negative value).

4. Schedule Performance Index: Earned Value / Planned Value = $500 / $800 = 0.625 = 62.5%, which means our productivity is 62.5% of planned.

5. Estimated Costs At Completion: Planned Cost at Completion / Cost Performance Index = $800 / .714 = $1120, which means now we need to estimate $1120 for the total project.

Privacy, Privacy, Privacy...

Not a very long time ago I studied Human Computer Interaction for a quarter. Not saying how much I learned in the class, even after the course I still keep noticing useability issues of everything in my everyday life.

Last week I went to a ticket office to buy a ticket for a show. There was a line with many people waiting. The sales person in the ticket counter asked the same question loudly to every single one: "What's your address and phone number, please?"

First of all, many of us may concern about why they are collecting such personal information. In ohter words, how they will use the information. Some may also concern about the security of the information stored in their systems. For example, whether they will disclose the information to any third party or not. As the result, at least they should explicitly state they would use the information properly and would not disclose to any third party.

Second, they asked everyone for personal information in speaking, which means all others in the line could hear the information. This is actually disclosing their personal information to many third parties. Nobody knows what others in the line do. Any people in the line can simply record the voice containing personal information to a mobile or portable device, then use or distribute/disclose the information illegally in the future.

In such situation, I guess a lot of people would not provide their real address and phone number. Then from the ticket company's point of view, many of the personal information they collected would be invalid. Then they cannot do what they intended to do with such information.

A Better Design

1. Privacy and disclosure statements are necessary.

2. In such privacy and disclosure statements, must explicitly state how the information will be used.

3. Provide a form for everyone to fillout, including their address and phone number, and explicitly print the privacy and disclosure statements on the form.  

By doing so, though there must still be people who don't want to write their true information, at least all people are doing the ticket-buying process with comfort. They don't have to worry about how others in the line will hear their personal information. And similarly, they can at least assume the company will use the information properly, as stated in the explicit privacy and disclosure statements on the form.