Monday, July 13, 2020
Python List and Dictionary
Lists are what they seem - a list of values. Each one of them is numbered, starting from zero - the first one is numbered zero, the second 1, the third 2, etc. You can remove values from the list, and add new values to the end. Example: Your many cats' names.
Tuples are just like lists, but you can't change their values. The values that you give it first up, are the values that you are stuck with for the rest of the program. Again, each value is numbered starting from zero, for easy reference. Example: the names of the months of the year.
Dictionaries are similar to what their name suggests - a dictionary. In a dictionary, you have an 'index' of words, and for each of them a definition. In python, the word is called a 'key', and the definition a 'value'. The values in a dictionary aren't numbered - they are similar to what their name suggests - a dictionary. In a dictionary, you have an 'index' of words, and for each of them a definition. In python, the word is called a 'key', and the definition a 'value'. The values in a dictionary aren't numbered - they aren't in any specific order, either - the key does the same thing. You can add, remove, and modify the values in dictionaries. Example: telephone book.
Monday, June 29, 2020
Linux File System
In a UNIX/Linux type OS, "Everything is a file", which means that everything in the computer system from processes, files, directories, sockets, pipes, ... is represented by a file descriptor abstracted over the virtual file-system layer in the kernel. The virtual file system is an interface provided by the kernel. Hence the more accurate phrase is "Everything is a file descriptor", or to make it even more accurate, Linus Torvalds himself corrected it again as :"Everything is a stream of bytes".
Linux main directories list:
/(root file system)
The root file system is the top level directory of the file system. It must contain all of the files required to boot the Linux system before other file systems are mounted. It must include all of the required executables and libraries required to boot the remaining file systems. After the system is booted, all other file system are mounted on standard, well-defined mount points as sub-directories of the root file system.
/bin
Contains User executable files.
/boot
Contains the static boot loader and kernel executable and configuration files required to boot a Linux computer.
/dev
This abstract directory contains the device files for every hardware device attached to the system. These are not device drivers, rather they are files that represent each device on the computer and facilitate access to those devices.
/proc
Another abstracted directory which is created when the system boots. Contains information about the processed on your system.
/etc
Contains the local system configuration files for the host computer.
/home
Home directory storage for user files. Each user has a sub-directory in /home.
/lib
Contains shared library files that are required to boot the system.
/media
A place to mount external removable media devices such as USB thumb drives that may be connected to the host.
/mnt
A temporary mount point for regular file systems (as in not removable media) that can be used while the administrator is repairing or working on a file system.
/opt
Optional files such as vendor supplied application programs should be located here.
/root
This is not the root (/) file system. It is the home directory for the root user.
/sbin
System binary files. These are executables used for system administration.
/tmp
Temporary directory. Used by the operating system and many programs to store temporary files., Users may also store files here temporarily. Not that files stored here may be deleted at any time without prior notice.
/usr
These are shareable, read-only files, including executable binaries and libraries, man files, and other types of documentation.
/var
Variable data files are stored here. This can include things like log files, MySQL, and other database files, web server data files, email inboxes, and much more.
Sunday, June 28, 2020
C++ concepts
Vector
Example:
Just like arrays, vectors use contiguous storage locations for their elements, which means that their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled automatically by the container.
Internally, vectors use a dynamically allocated array to store their elements. This array may need to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new array and moving all elements to it. This is a relatively expensive task in terms of processing time, and thus, vectors do not reallocate each time an element is added to the container.
Instead, vector containers may allocate some extra storage to accommodate for possible growth, and thus the container may have an actual capacity greater than the storage strictly needed to contain its elements (i.e., its size). Libraries can implement different strategies for growth to balance between memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing intervals of size so that the insertion of individual elements at the end of the vector can be provided with amortized constant time complexity (see push_back).
Therefore, compared to arrays, vectors consume more memory in exchange for the ability to manage storage and grow dynamically in an efficient way.
Compared to the other dynamic sequence containers (deques, lists and forward_lists), vectors are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing elements from its end. For operations that involve inserting or removing elements at positions other than the end, they perform worse than the others, and have less consistent iterators and references than lists and forward_lists.
Sunday, June 21, 2020
Why Real Time Embedded Linux ?
Why Real Time Embedded Linux ?
You might hear of embedded Linux for real time very often. It sounds the entire embedded world depends on this. The question really contains 3 important concepts, we can break this question into 3 sub-questions based on these 3 concepts.
Why Linux ?
This is a generic question, easy for public to understand. Linux is Open source, less legal issues, popular, easier to get support, APIs and expertise. etc.
Why Embedded (vs Desktop Linux) ?
A bit more technical.
1. Embedded Linux system usually requires great reliability. Desktop Linux may have >100M code installed, with a lot of un-necessary features. Embedded Linux typically have 1M foot print, with only required feature installed.
2. Resource constraint. Embedded Linux has no HDD, and its non-volatile storage is life constraint. This coupled with the reliability and power safe requirement, a large portion of embedded linux system is actually read only.
Why Real Time ?
A common mis-understanding about Real Time is that Real Time means Fast, actually Real Time means deterministic. In other words, to complete a task within a specified time, otherwise will lead to an error condition. For example, a dish washer need to stop water filling in Read Time fashion, but screen display update may not be real time.
We classify a task either deterministic or in-deterministic, so the concept of soft Real Time should be obsolete.
Linux is not intrinsically deterministic, there are processed can run to completion. Hence, we need some other modification to make Embedded Linux real-time, mainly two ways, use a RealTime kernal and make regular Linux as a process. or use Preempt_RT, break down Linux locked processes, and put main ISR routine to a task, only left signaling inside ISR, like FreeRTOS. In practical, we can control the worst case latency to be less than 100 micro-seconds, good enough for Real-Time applications.
ARM in a nutshell.
Tuesday, December 1, 2009
The most important factor to make a software project success
We often talk about resource, budget, timing, quality when talking about project management. I treat project scope management as the most important factor among all the project management factors, more important than factors like schedule, cost, budget, …Since I saw too many times what project team delivered is not what customer wants.
Project scope management is essentially acting as the bridge between the project team and outside world, especially customer. The project manager has the responsibility to make sure the project team is doing something expected by business team, or customer. No budget, resource wasted on activities not align with customer request. There are maybe some project sponsored by internal authorities, but still there should be scope statement from the internal authority.
The project manager has the responsibility to communicate/control the sub-module scope among the project team. There are 3 good practices for doing this:
- Document the scope in structured, better itemized statement list;
- Organize all stake holders to present the scope in understandable chart;
- Publish the scope statements and charts to a place easily accessible and editable by relevant stakeholders.
In summary, project manager should ensure project team members are working towards the correct scope at any project stage. I think anyone has experience on software development team with more than 3 software Engineers knows the difficulty to actually achieve this goal.
Sunday, November 15, 2009
Project Charter Example
I always wonder how to specify project charter clearly and efficiently (no excessive document), until I see the example below.
1. Project Title and Description
What is the project?
Customer Satisfaction Fix-It Project: Over the last few months the quality assurance department has discovered many of our customers' orders for our ABC equipment have taken the customer ten times longer to place through our computer network than our competitors' networks. The purpose of this project is to investigate the reasons for the problem and propose a solution. The solution will be authorized as a subsequent project. Quality Control has detailed records of their findings that can be used to speed up this project.
2. Project Manager Assigned and Authority Level
Who is given authority to lead the project, and can he/she determine, manage and approve changes to budget, schedule, staffing, etc.?
Alexis Sherman shall be the project manager for this project and have authority to select team members and determine the final project budget.
3. Business Need
Why is the project being done?
This project is being completed in order to prevent a further breakdown of customer satisfaction.
4. Project Justification
Business case-On what financial or other basis can we justify doing this project?
We expect that improved customer satisfaction will increase revenue to the company in the first year by at least $200,000 due to a decrease in service calls. As a side benefit, we hope that the project will generate ideas on improving customer
satisfaction while fixing this problem.
5. Resource Pre-assigned
How many or what resources will be provided?
Morgan and Danny are already dedicated to the project because of their expertise in computer networks of this type. Other resources will be determined by the project manager.
6. Stake-Holders
Who will affect, or be affected by the project (influence the project), as known to date?
Stakeholders include Connor representing Quality Control, Ruth in Customer Service and Mary in Marketing. These resources are available to assist the project as needed by the project manager.
7. Stake-holder Requirements as Known
Requirements related to both project and product scope.
Attached to this document are the detailed specifications for the existing system, the requirements that the existing system was designed to meet. It is expected that this project will not change how the system affects the existing requirements. The project must include utilizing the data available from quality control.
5. Product Description/Deliverables
What specific product deliverables are wanted and what will be the end result of the project.
- A report that outlines what can be changed, how much each change will cost and expected decrease in the time it takes to place and order resulting from each change. Few words are necessary in the report, but it must be created electronically and be agreed to by the heads of quality control, customer service and marketing in addition to the project team.
- A list of the interactions with our customers necessary to complete the changes. A work breakdown structure, due within two weeks, that outlines the plan for accomplishing the project, followed one week later by a list of risks in completing the project.
6. Constraints and Assumptions
A constraint is any limiting factor and an assumption is something taken to be true, but which may not be true.
Complete the project no later than <date>. Spend no more than <certain amount money>. We have assumed that Kerry will be available to assist the project and that testing can be done on the seller’s computer.
Project Sponsor Approval:
<Signature>
Monday, November 2, 2009
Find and sort acronyms for Microsoft Word document automatically.
We guys work on Information Technology. I always have too many acronyms to deal with when I create a document. There are many solutions of adding acronym to a word document, such as add as a Bookmark or Hyperlink. But most of them require the author to go through the document and mark all the acronyms manually, which I don’t like.
This script searches through your word document and find all Words >= 3 (configurable) alphabets in Uppercase, then remove duplicate entries and sort by alphabetical order. This is exactly what I need. If you want to try, click Tools->macros->Visual Basic Editor, copy-paste the code below and execute it. There you go!
Sub ExtractAcronymsToANewDocument()
Dim oDoc_Source As Document
Dim oDoc_Target As Document
Dim strListSep As String
Dim strAcronym As String
Dim oTable As Table
Dim oRange As Range
Dim n As Long
Dim strAllFound As String
'use to keep track of founded. Find the list separator from international settings
'In some countries it is comma, in other semicolon
strListSep = Application.International(wdListSeparator)
strAllFound = "#"
Set oDoc_Source = ActiveDocument
'Create new document for acronyms
Set oDoc_Target = Documents.Add
With oDoc_Target
'Make sure document is empty
.Range = ""
'Insert a table with room for acronym and definition
Set oTable = .Tables.Add(Range:=.Range, NumRows:=2, NumColumns:=3)
With oTable
'Format the table a bit
'Insert headings
.Cell(1, 1).Range.Text = "Acronym"
.Cell(1, 2).Range.Text = "Definition"
.Cell(1, 3).Range.Text = "Page"
'Set row as heading row
.Rows(1).HeadingFormat = True
.Rows(1).Range.Font.Bold = True
.PreferredWidthType = wdPreferredWidthPercent
.Columns(1).PreferredWidth = 20
.Columns(2).PreferredWidth = 70
.Columns(3).PreferredWidth = 10
End With
End With
With oDoc_Source
Set oRange = .Range
n = 1 'used to count below
With oRange.Find
.Text = "<[A-Z]{3" & strListSep & "}>"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWildcards = True
Do While .Execute
'Continue while found
strAcronym = oRange
'Insert in target doc
'If strAcronym is already in strAllFound, do not add again
If InStr(1, strAllFound, "#" & strAcronym & "#") = 0 Then
'Add new row in table from second acronym
If n > 1 Then oTable.Rows.Add
'Was not found before
strAllFound = strAllFound & strAcronym & "#"
'Insert in column 1 in oTable
'Compensate for heading row
With oTable
.Cell(n + 1, 1).Range.Text = strAcronym
'Insert page number in column 3
.Cell(n + 1, 3).Range.Text = oRange.Information(wdActiveEndPageNumber)
End With
n = n + 1
End If
'If acronym
Loop
End With
End With
'Sort the acronyms alphabetically
With Selection
.Sort ExcludeHeader:=True, FieldNumber:="Column 1", SortFieldType _
:=wdSortFieldAlphanumeric, SortOrder:=wdSortOrderAscending
.HomeKey (wdStory)
End With
'Clean up
Set oDoc_Source = Nothing
Set oDoc_Target = Nothing
Set oTable = Nothing
MsgBox "Finished extracting " & n - 1 & " acronymn(s) to a new document."
End Sub
Thursday, October 29, 2009
Breakdown of Initiating-Planning-Executing-Controlling-Closing process
I got this list of possible project tasks. personally I think it is a good practice to go through this list, and create marks on the project current status along the way.
Initiating
- Select Project Manager.
- Determine company culture and existing systems.
- Collect processes, procedures and historical information.
- Divide large projects into phases.
- Identify stake-holders.
- Document business need.
- Determine project objectives.
- Document assumptions and constraints.
- Develop project charter.
- Develop preliminary project scope statement.
Planning
- Determine how you will do planning – part of management plans.
- Create project scope statement.
- Determine team.
- Create WBS and WBS dictionary.
- Create activity list.
- Create network diagram.
- Estimate resource requirements.
- Estimate time and cost.
- Determine critical path.
- Develop Schedule.
- Developer budget.
- Determine quality standards, processes and metrics.
- Determine roles and responsibilities.
- Determine communications requirements.
- Risk identification, qualitative and quantitative risk analysis and response planning.
- (items above this lime will need Iterations ).
- Determine what to purchase.
- Prepare procurement documents.
- Finalize the “how to execute and control” aspects of all management plans.
- Create process improvement plan.
- Develop final PM plan and performance measurement baselines.
- Gain formal approval.
- Hold kick-off meeting.
Executing
- Acquire final team.
- Execute the PM plan.
- Complete product scope.
- Recommend changes and corrective actions.
- Send and receive information.
- Implement approved changes, defect repair, preventive and corrective actions.
- Continuous improvement.
- Follow processes.
- Team building.
- Give recognition and rewards.
- Hold progress meetings.
- Use work authorization system.
- Request seller responses.
- Select Sellers.
Monitoring & Controlling
- Measure against the performance measurement baselines.
- Measure according to the management plans.
- Determine variances and if they warrant corrective action or a change.
- Scope verification.
- Configuration management.
- Recommend changes, defect repair, preventive and corrective actions.
- Integrated change control.
- Approve changes, defect repair, preventive and corrective actions.
- Risk audits.
- Manage reserve.
- Use issue logs.
- Facilitate conflict resolution.
- Measure team member performance.
- Report on performance.
- Create forecasts.
- Administer contracts.
Closing
- Develop closure procedures.
- Complete contract closure.
- Confirm work is done to requirement.
- Gain formal acceptance of the product.
- Final performance reporting.
- Index and archive records.
- Update, lessons learned and knowledge base.
- Hand off completed product.
- Release resources.
Tuesday, October 27, 2009
Projectized versus functional organization
An organization can be either functional oriented or project oriented.
| Organization Structure | Projectized | Matrix | Functional |
| Domain Expertise | Poor | Medium | Good |
| Project Coordination | Good | Medium | Poor |
In practical, most of organizations are matrix based, i.e, team is organized by functional area, and team members work for projects most of the time under project manager.
The pros and cons of a project organization is listed below, although the truth is matrix organization can be a nightmare for Engineers.
| Pros | Cons |
| Highly visible project objectives | Extra administration required |
| Improved project manager control over resources | More than one boss for project teams |
| More support from functional organizations | More complex to monitor and control |
| Better horizontal and vertical dissemination of information than functional | Functional managers may have different priorities than project managers |
| Team members maintain a “home” | Higher potential for conflict |
| Better coordination | Need extensive policies and procedures |
| Maximum utilization of scarce resources | Tougher problems with resource allocation |
Monday, October 26, 2009
The life cycle of Process, Project, Program, Product
Process: a series of actions bringing about a result. Process is repeatable within an organization.
Project: a project is a temporary endeavor undertaken to create a unique product or service. The project life cycle refers to a logical sequence of activities to accomplish the projects goals or objectives.
Program: a program is a group of projects managed in a coordinated way to obtain benefits not available from managing them individually. Sometimes a program management and a project management can be treated as synonyms. A program management can also be treated as superset of subset of project management depend on situations.
Product: The life cycle lasts from the conception of a new product to its withdrawal.
Sunday, October 25, 2009
Light-weight CMMi deployment
I was talking to one of my ex-supervisor in Motorola on his experience of deploying CMMi to another organization out of Motorola. There are some interesting findings about customizing CMMi for different organization cultures. As Motorola has officially announced closing down of its Singapore Software Center, now we can comment a bit on their CMMi process, and what other organizations can learn from it.
Motorola is famous for the CMMI level-5 deployment to its various software centers across the world. These software centers are such process oriented organizations that low to mid management level take it for granted that the software requirement, design, implementation and testing document must be in place, and process audit must be in place. There are plenty of diagrams, analysis reports generated that becomes over-complicated, for good and bad.
In early 1990s, Software was such a special technical skill that only a small group of elite people can do it well, so Motorola setup various software centers around the world, with software process deployment initiative. Both the organization model and the process proved to be quite effective initially. Later as the software complexity grows, software process also grows to ensure the quality and efficiency of the code, which is excellent. However, these centers are far away from the end customers. The marketing team cannot transfer their pressure to software developers effectively in this organization structure. The mid-level management turns to process focus, instead of customer focus, because that is the instruction implied by the evaluation process (for sure top management still emphasize they are marketing oriented). All software projects are internal, which are quite easy going. When the profit margin of software business goes down and the company eco-environment got worse, eventually the company cannot afford this over-complicated business model and close down the center.
This does not mean it is not possible to marry the good merit of process-oriented approach to innovation-oriented approach. One compromise way we found is to simply the CMMi process and deploy it implicitly. More specifically, requirement and software configuration management are the two most important KPAs a software organization needs to pay attention to, next comes implementation and test define. i.e, to implement what you are required to implement, and test what you are required to test. By telling your customer about implement customer requirement, and control your software team so that the entire team works towards the same goal, instead of working against each other (not personally, but because either Architect or process has flaw, I have seen a lot examples that people work against each other.), you have the CMMI corner stone lay out.
The process effort should not exceed 5% of the total project effort. If there is no full time process team, then do 2 things:
1. have one internet-savvy young engineer to update and maintain an intranet to publish requirements (it is important to put requirements, designs, … into a common repository).
2. List the key process flow in one Page (A4), make sure the font size is readable, let the team has free access to it, and have an experienced Engineer to audit regularly (biweekly or monthly). A white paper (such as Software Development Manual) more than 2 pages is only useful for process team, nobody in the project team will read it. So DON’T waste your time.
In summary, the ultimate goal for an organization is not to reach certain CMMi level (though it is a side output, necessary for many human performance evaluation), but to make the final output predictable and quantifiable. Process is like lubricating oil, you won’t feel it if your machine running smoothly, and it is actually performing its duty implicitly. The most important thing: Software Process must come from real-life experience. There are endless documents out there, people won’t convinced if you are only repeating a book story.
Saturday, October 24, 2009
Common Errors for a project manager
If you have ever done be a part of a project team, do you experience any kind of scenarios below? If so, I am with you. However, I do not think these are all project manager’s fault.
- Focusing on asking for percent complete
- Holding "go around the room" type status meetings
- Spending host of your time babysitting team members by constantly checking on them
- Asking to cut lo percent off the estimate
- Not attempting to obtain finalized requirements
- Not getting real resource commitments
- Not having a reward system
- Not focusing on quality
- Not having a control system
- Not having management plans
- Not measuring against the project management plan, or even creating metrics
- Not spending time finding and eliminating root causes of problems or deviations
- Not implementing corrective action to keep the project in line with the project management plan
- Not reevaluating the effectiveness of the project management plan
- Not reevaluating the accuracy or completeness of schedule, cost, scope
Ignoring resource managers' need to have their people do their own departments' work - Not realizing the project can affect the reputation of team members
- Not realizing the project manager has some human resource responsibilities to the project team, such as project job descriptions and adding letters of recommendation to team members' human resource files
- Blaming unrealistic schedules on management instead of realizing they are the project manager's responsibility
Friday, October 23, 2009
My understanding of Project Management -ism
- Historical records are exceedingly valuable (like gold) to the project manager, the team, the performing organization and even the customer.
- Project cost and schedule cannot be finalized without completing risk management.
- A project manager must work within the existing systems and
culture of a company, which is referred as enterprise environmental factors and they are inputs to many processes. - A project manager spends all his time dealing with problems is not a great project manager. A good project manager plans the project to address the problems and to prevent the problems coming.
- Percent complete is an almost meaningless number. [JS] Unfortunately there are many cases that upper management only wants a number.
- A great project manager does not hold meetings where you go around the room asking all attendees to report. Such meetings are generally, but not always, a waste of time. [JS] It is a channel for team members to clarify their concerns of the project.
- The project management plan is approved by all parties, is realistic and everyone believes it can be achieved. [JS] I think it is a good practice to make the project management plan, or at least store it at a shared place.
- If at all possible, all the work/assignment and all the stakeholders are identified before the project begins. Stakeholders are involved in the project and may help identify and manage risks. [JS] A project success is all project team member’s responsibility, not only the project manager.
- The project manager has some human resource responsibilities of which you might not be aware. [JS] Whether you have the right person and they are keen to the project, and how team members are rewarded for their work. However, a project management is always limited by the organization.
Thursday, October 22, 2009
Comments on “Things every project manager should do”
I read through a statement that “you do not understand project management if you do not understand five or more of the following items”. The list makes great sense to me, so I list here and add my own comments in italic.
- A step-by-step process for managing projects and why each step is necessary. I will only be confident in iterative model.
- Project manager, sponsor and team roles.
- Historical information from previous projects.
- Lessons learned from previous projects.
- Creation of lessons learned on your projects.
- Project charter. Everyone must understand the same charter and work towards the same goal. This is not so strait forward during the project execution.
- What is a work breakdown structure, how to create it, and that it is not a list in a bar chart. My understanding is this means the breakdown is not a list on paper, the team member should understand the meaning. A good practice is to break down into 5 to 8 sub tasks in terms of time and size. For example, a quarter duration should be break down into biweekly tasks.
- How to manually create a network diagram Don’t understand this. How it is related to project management. Does it talking about human network.
- Critical path-how to find it and what benefits it provides the project manager. Key points
- Three-point estimating: To estimate a value (cost, duration, etc.), assume a=the best-case estimate m=the most likely estimate b=the worst case estimate, then the weighted average E=(a+4m+b)/6, and standard deviation=(b-a)/6
- Monte Carlo analysis: refers specifically to a technique in which the project team leader or project team computes and/or quantifies the complete and total project cost and/or project schedule a number of times through the use of input values that have been selected at random through the careful utilization of probability distributions or potential costs and/or potential durations. I think it is an iterative way to define project cost or schedule.
- Earned value. refers to the actual methodology of management in which the project management team embarks in the process of integrating the scope, the schedule, and the resources that are determined to be needed in the process of making an objective measurement of the progress that has taken place to date on a project, and also on how successful the performance has been to date. Performance is measured by assessing the budgeted cost of all work that has been performed to date (also known as earned value, or EV) and comparing it to the actual cost of work that had been performed to date (which is also known as the actual cost). Progress is determined by comparing the earned value to date and measuring it against the planned or expected value. Earned value management is essential to maintaining a proper budget.
- Schedule compression, crashing and fast tracking
- An unrealistic schedule is the project manager's fault. Mostly because the project scope, dependency, team capability not well understood.
- Creating a realistic and approved project management plan that you would be willing to be held accountable to achieving. At least for firmware project, a realistic plan is only possible if the domain and scope are understood. I don’t dare to say fully here, as in many cases, it is poorly understood.
- Measuring and implementing corrective action.
- Risk management process and that risk management is not just using a checklist.
- Expected monetary value. Agree
- Calculating budget reserves and their relationship to risk management.
- Controlling the project to the project management plan.
Wednesday, October 21, 2009
Do you know enough about project management?
I am reading PMP Preparation book recently. It has one statement: You do not know enough if you experience two or more of the following problems on projects: .
- Large cost or schedule overruns ;
- Unrealistic schedules;
- Excessive changes to the scope or schedule;
- Poor communications and increased conflict;
- Running out of time near the end of the project;
- Unsatisfactory quality;
- Low morale;
- People on the team are unsure of what needs to be done;
- Excessive rework and overtime;
- Too many project meetings;
I totally agree that these are problems for project management. However, I do not think the project team can totally eliminate these problems even the project manager and team members have excellent technical and process knowledge of the project.
A project team is not isolated in vacuum environment. The project execution is restricted by many other factors. For example:
- A giant MNC may have corporate wide pay-cut and promotion freeze, which might cause low morale of the project team, and the project manager can do nothing.
- Excessive changes to the scope and schedule maybe because sales team boast some excessive functionality, which cannot be handled by Engineering team in time.
- Too many project meetings maybe because the organization has a complex matrix structure, which is beyond the control of this team.
Actually for each items listed by PMP book above, there could be some reason beyond the project manager’s control. Anyway, I think what a project manager can do is to try his best to mitigate these problems, although it is really hard to eliminate them all.
Thursday, October 15, 2009
Differences between Java and C++ in terms of OOP
Most people start learning Object Oriented Programming from either Java and/or C++. Although the concept of Object Oriented Programming is the same (in fact, you can even do Object oriented programming without use any OO language), there are subtle difference between Java and C++ from OOP perspective. I try to list some of the key differences for reference, you are welcome to comment. Please note the grammar differences are not the interest point of this blog.
All stand-alone C++ programs require a function named main and can have numerous other functions. Java does not have stand alone functions, all functions (called methods) are members of a class. All classes in Java ultimately inherit from the Object class, while it is possible to create inheritance trees that are completely unrelated to one another in C++. In summary, Java is a pure Object oriented language, while C++ is a mixture of Object oriented and structure language.
The interface keyword in Java is used to create the equivalence of an abstract base class containing only method declarations and constants. No variable data members or method definitions are allowed. C++ does not support interface concept. Java does not support multiple inheritance. To some extent, the interface feature provides the desirable features of multiple inheritance to a Java program without some of the underlying problems.
Java is running on a Virtual Machine, which can recollect unused memory to the operating system, so Java does not destructor. Unlike C++, Java cannot access pointers to do memory operation directly. This leads to a whole host of subtle and extremely important differences between Java and C++.
Furthermore, the C++ compiler does not check whether all local variables are initialized before they are read. It is quite easy to forget initializing a variable in C++. The value of the variable is then the random bit pattern that happened to be in the memory location that the local variable occupies.
Java does not have global functions and global data. Static in Java is just like global in C++, can be accessed through class name directly, and shared by all instances of the class. For C++, static data members must be defined out side of class definition, because they don't belong to any specific instance of the class.
Generally Java is more robust than C++ because:
- Object handles (references) are automatically initialized to null.
- Handles are checked before accessing, and exceptions are thrown in the event of problems.
- You cannot access an array out of bounds.
- Memory leaks are prevented by automatic garbage collection.
While C++ programmer clearly has more flexibility to create high efficient program, also more chance to encounter error.
Monday, October 12, 2009
Difference between Stack memory and Heap Memory.
Recently I came across the difference between stack/heap topic. In simple, Both are dynamic memory allocated for program execution, but not the only 2 memory regions allocated for program execution.
Please Google “stack, heap” for the definition, summary for the difference:
Heap
- free-list - list of free space
- on allocation - memory manager finds space and marks it as used changing free-list
- on de-allocation - memory manager marks space as free changing free-list
- memory fragmentation - memory fragments into small blocks over lifetime of program
- garbage collection - coalesce fragments, possibly moving objects (must be careful of pointers when moving!)
- Concept at Operating system Memory management layer.
Stack
- clean and efficient support for nested functions and recursion
- central concept is stack frame (also called activation record)
- Concept at Micro Processor hardware registers layer.
Simple Example:
void foo()
{
int x; <<< x is on the stack
char *ptr = new char[255]; <<< 255 characters are allocated in the heap, but ptr object is on the stack
int array[255]; <<< 255 ints are all on the stack
}
Saturday, October 10, 2009
Travel
Please refer to my Chinese blog in China. This topic is safe to be put inside China.