Wednesday, September 05, 2012

Useful Hex Code for Colors

If you are developing some applications that are needing hex code, here I find a useful url listing all the necessary color codes.

This one also good

Wednesday, August 22, 2012

An Ubuntu Bash Script to Compile a C++ Program

After I have installed the C++ and WxWidgets 2.8.12 on Ubuntu 12.04 LTS, I was having a lot of problems in compiling the sample codes given in the tutorial.

Finally, I found this command:
g++ `wx-config --cxxflags` -o OutputFileName SourceCodeFileName.cpp `wx-config --libs`

But, if every time to compile your source code file, you need to remember this command may be a bit troublesome.

So, in order to quickly compile the cpp file, I have created a simple bash script file (like a DOS batch file in Windows), which allow you to just type:

$ ./ccpp.sh hw1

* Note, this is assuming your source code file is hw1.cpp and your output file is hw1. You should create an empty directory, and it should just contain hw1.cpp file. So, after you run this script file compilation, you should see two files: hw1.cpp and hw1 (hw1 is the output file which can be run directly by typing ./hw1)


And the output will be a file hw1 which is already executable (this is assuming that there is no bugs in your code).

So, to create the bash script file, create an empty text file, and then copy the following codes into it:

#!/bin/sh
#
# This script will take one argument, the file name. For example, if you have a file called hw1.cpp and this script will compile the hw1.cpp and output # a file called hw1. To execute this script, at the terminal type:
#
# ./ccpp.sh hw1
#
clear

g++ `wx-config --cxxflags` -o $1 $1.cpp `wx-config --libs`

echo ""

echo ""

After you have typed above, save it as "ccpp.sh". Then open a terminal, and type the following at the command prompt:

$ chmod +x ccpp.sh

Then it is done. Enjoy the wxWidgets tutorial :)

Saturday, June 09, 2012

Sample Python Code: Showing Combobox Selected Text

The following code shows how to retrieve the selected text from wx.ComboBox when a mouse click event is triggered.

------------------------------------------------------------------------------------------------------------------------------
import wx

class MyFrame(wx.Frame):
    def __init__(self, parent=None, id=-1, title=''):
        wx.Frame.__init__(self, parent, id, title,size=(200, 240))
        top = wx.Panel(self)
        sizer = wx.BoxSizer(wx.VERTICAL)
        font = wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD)
        lb = wx.StaticText(top, -1,'static text')
        sizer.Add(lb)

        c1 = wx.StaticText(top, -1, 'Number:')
    self.s1 = c1.Label
        c1.SetFont(font)

        ct = wx.SpinCtrl(top, -1, '1', min=1, max=12)
        sizer.Add(c1)
        sizer.Add(ct)

        c2 = wx.StaticText(top, -1, 'Type:')
        c2.SetFont(font)
        self.cb = wx.ComboBox(top, -1, '',choices=('A', 'B', 'C','D', 'E', 'F'))

        sizer.Add(c2)
        sizer.Add(self.cb)

        showbtn = wx.Button(top)
        showbtn.SetLabel('Show Info')
        self.Bind(wx.EVT_BUTTON, self.ShowValue, showbtn)
        sizer.Add(showbtn)

        qb = wx.Button(top, -1, "QUIT")
        self.Bind(wx.EVT_BUTTON,lambda e: self.Close(True), qb)
        sizer.Add(qb)

        top.SetSizer(sizer)
        self.Layout()

    def TestMe(val, self, e):
        print val
   
    def ShowValue(self, e):
        wx.MessageBox('Show Value ...' + self.cb.GetStringSelection())
   
class MyApp(wx.App):
   def OnInit(self):
       frame = MyFrame(title="wxWidgets")
       frame.Show(True)
       self.SetTopWindow(frame)
       return True

app = MyApp()
app.MainLoop()

--------------------------------------------------------------------------------------------------------------------------
Based on code above, the key part is to declare a self.cb variable to hold a reference to the combobox. This is the easiest way to refer to the combobox.

Of course, this is something I found after I have searched around and tried a few ways ... this is something I figure out when I don't find any specific example after googling :)

Wednesday, May 30, 2012

Useful Ubuntu 10.04 LTS Commands

converting VOB video files into avi files

ffmpeg -i VTS_02_2.VOB -ab 128kb -qscale 3 new.avi

converting python source codes to executable

chmod +x

Monday, March 12, 2012

Stakeholder Analysis?

Recently, in one of the brainstorm session with my colleagues from PMO, we were discussing about the design of the template for Stakeholder Analysis, which will be used by all project managers later in their project.

Ultimately, these templates are driving us to draw a few useful charts:




Note: above charts are derived from the following links:
http://www.mindtools.com/pages/article/newPPM_07.htm
http://www.stakeholdermap.com/stakeholder-analysis.html

Then, I was thinking it a few times, when is the time the Stakeholder Analysis document will be useful to me?

I believe if I am taking over a running project from someone else, this info will be useful. So, if I do it at the start of project, and I should keep on updating this document until someone takes over my project? :)

Honestly, a few things that I think the PM or PMO should consider when designing the template:

  1. How to identity your stakeholders
  2. Where is the source of information
  3. Reliability of the source of information
  4. Frequency of update to the status of stakeholder (last week he was our friend, this week he has become our enemy?)
  5. Who will be responsible to handle individual stakeholders
But, to keep a good log of the stakeholders' status is not an easy task, but it will be a useful tool if your project is big and involving many executors.


Saturday, March 10, 2012

Project Dashboard: Managing Project KPIs

Project Dashboard, if designed correctly, it will become very powerful tool for the organisation to act pro-actively and appropriately.


To design it correctly, the dashboard should have the following elements:

  1. Objectives of the KPIs
  2. Tolerance range (eg. Red, Yellow or Green; High, Medium or Low; Excellent, Good, or Bad, etc)
  3. Target Audience in mind
  4. Relevant measurement (measurement value that should be shown together in one chart or dashboard item)
Basically, the dashboard should tell you: I should be happy or I should be upset. What should I do if I am upset with the measurement result.

Example of possible questions to be asked when designing the Project Dashboard:

Note: Project Dashboard is usually focussing on individual projects
  1. Are we on time?
  2. Is our budget sufficient for us to complete the project?
  3. Are our requirements stable?
  4. Is the quality of our deliverables good?
  5. How fast we resolve issues?
  6. Who are the contributors to delay?
  7. How much more budget do we need to complete the project?
 When individual dashboards are functioning stably, the executives (senior management) may want to have Corporate wide Project Portfolio Dashboard. Then when designing the Corporate wide Project Portfolio Dashboard, the possible questions will be coming from Corporate perspective, for example:

  1. Which customers that are affected by project delay?
  2. Which project that is not having sufficient budget to complete the project as of now?
  3. Which project manager that is responsible for those projects that are in trouble (schedule delay, cost overrun, having issues not resolved, etc)
  4. Resources from which department or solution team that are involved in those issues (delay, additional cost involved, unresolved issues, etc)

When designing the corporate or project dashboard, the designer should consider the perspective of the target audience, for example:

  1. What are their concerns?
  2. Based on what they need to react?
  3. How can they trace down the culprit or source of cause (root cause)?
All the information provider for these KPIs should come from an integrated or online Information System. You can't achieve this if all those information is saved inside the PC of each project manager. There are many project management IS (Information System) out there in the market, some even open source. Of course, you have to consider the cost of implementation and the challenges in implementing it. It will be a separate topic when we talk about implementing it. But, first things first: Do you care about your project or the projects in your organisation?

Converting a Physical Linux to Virtual

Hmm ... I have done a lot of work on my Linux Lubuntu 15.10 with PHP and PostgreSQL and a few other things ... it is quite time-consuming to...