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
This blog captures some of the thoughts, ideas and things that am learning, researching and exploring on areas such as: Project Management, Software Development, Open Source, etc. Feel free to feedback or comment :)
Wednesday, September 05, 2012
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 :)
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 :)
------------------------------------------------------------------------------------------------------------------------------
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 :)
Thursday, May 31, 2012
Useful wxPython Guides
Full reference: http://wxpython.org/docs/api/frames.html
Useful tutorials/guides with examples:
http://www.fredshack.com/docs/wxwidgets.html
http://www.java2s.com/Tutorial/Python/0380__wxPython/MDIframe.htm
http://www.blog.pythonlibrary.org/2008/05/18/a-wxpython-sizers-tutorial/
Useful tutorials/guides with examples:
http://www.fredshack.com/docs/wxwidgets.html
http://www.java2s.com/Tutorial/Python/0380__wxPython/MDIframe.htm
http://www.blog.pythonlibrary.org/2008/05/18/a-wxpython-sizers-tutorial/
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
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:
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:
- How to identity your stakeholders
- Where is the source of information
- Reliability of the source of information
- Frequency of update to the status of stakeholder (last week he was our friend, this week he has become our enemy?)
- Who will be responsible to handle individual stakeholders
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:
Example of possible questions to be asked when designing the Project Dashboard:
Note: Project Dashboard is usually focussing on individual projects
When designing the corporate or project dashboard, the designer should consider the perspective of the target audience, for example:
To design it correctly, the dashboard should have the following elements:
- Objectives of the KPIs
- Tolerance range (eg. Red, Yellow or Green; High, Medium or Low; Excellent, Good, or Bad, etc)
- Target Audience in mind
- Relevant measurement (measurement value that should be shown together in one chart or dashboard item)
Example of possible questions to be asked when designing the Project Dashboard:
Note: Project Dashboard is usually focussing on individual projects
- Are we on time?
- Is our budget sufficient for us to complete the project?
- Are our requirements stable?
- Is the quality of our deliverables good?
- How fast we resolve issues?
- Who are the contributors to delay?
- How much more budget do we need to complete the project?
- Which customers that are affected by project delay?
- Which project that is not having sufficient budget to complete the project as of now?
- Which project manager that is responsible for those projects that are in trouble (schedule delay, cost overrun, having issues not resolved, etc)
- 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:
- What are their concerns?
- Based on what they need to react?
- How can they trace down the culprit or source of cause (root cause)?
Subscribe to:
Posts (Atom)
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...
-
I have got the book: Crucial Confrontation ! It is really a great book. After reading it, I learned a very valuable lesson on how to deal wi...
-
A requirement study stage should not be left "open-ended". There should be key review milestones specified for checking the accura...
-
Here are something to read about PM KPI: KPI explained When we want to create KPIs for PM, we need to use the CSC (Critical Success Criter...