Real time process charter

I tried to find a realtime process chart drawing utility to watch what’s going on with my (specific) process. I would like to how much virtual memory consumed because of threads…

So here is the first step: (just edit the PROCESS_NAME to the filename of yours)

watch -n 1 -p ‘ps -e -O “%cpu,cputime,sgi_p,%mem,rss,sz,vsz,start,nlwp” | grep -e PROCESS_NAME -e “%CPU” -e “###########” | sed “s/[ \t]\{1,\}/\t/g”‘

This was the tabbed version. Here is the version for human eye:

ps -e -O “%cpu,cputime,sgi_p,%mem,rss,sz,vsz,start,nlwp” | grep -e PROCESS_NAME -e “%CPU” -e “###########” | grep -v “###########”

Those # are just a trick not to grep grep itself.

I wanted to use gnuplot-py to sketch the realtime chart to observe CPU and MEM consumption. Nowadays, out of time. Maybe later, maybe someone finishes.


Language selection and the license problem

I get that in the kingdom of the blind, the one-eyed man is the king. So I am going with C++. Hereby I decline below what happened.

(Eclipse + ) Python + GTK+ + ClutterAfter

Eclipse Foundation

Eclipse

2 days non-stop working I couldn’t run even a simple Clutter project. I even couldn’t understand if Clutter will be under development further or not. There mentions on Clutter to be dead soon and deprecated under GObject.Bottomline, if I can’t even install it how the end user will… I give up with this option.

.

.

(Eclipse +) Python + PyDev + PySide  (+ Qt4) | (+ PyQt)

PySide is the Eclipse plugin to edit Python files under Eclipse. PySide and PyQt are two seperate projects for porting Qt into Python.

Qt of Nokia

Qt

Qt has got amazing rendering tools within. I really thought “this is it” when I have seen Puzzle example [1] . Drag drop will be my main concern beneath other things.When I have seen PyQt is not available under LGPL (only GPLv1, GPLv2 and commercial which is not specified on the web site). I will be writing a Python code so it is nearly mandatory to share to codes, but, I don’t know somehow it suddenly looked “not-what-I-want” to me. So I checked PySide…

PySide is okay with carrying out LGPL outcomes.  But what confuses me is that PySide uses some of libqt libraries which are protected under GPL. Doesn’t it make PySide outcomes obligated to GPL? Ugh…

.

C + GTK+

I am really considering still to go with C because I don’t want to use C++ which looks like an unwanted child of C. I can’t say this is a thought I grasp after a deep technical analysis; I just didn’t like it. I would rather use Java if so. But C is not like that. It looks simpler to manage and more mature. It is not OO in nature but after recent modifications on C it is anymore usable as if OO supported. And speed attracts me indeed. And I don’t think porting to Windows or OSX would be problem as there are extremely great examples out there.

.

GPL / LGPL / Commercial?

GNU Logo

GNU

I don’t have to share the codes. Of course I can share (I probably will) but I don’t want it to be mandatory for me — I don’t want to be obligated to share. Because, I don’t know how things will go on after first release. There is no income / donation plan in my mind for now. And obviously I need a business plan (even for non-profit option) to get this further which I don’t have one yet. I want to decide according to quality and need-satisfying of the project soon.

.

[1] http://gitorious.org/pyside-examples
[2]


User experience data on betterdesktop.org

Python snippet to get data in structured form from the betterdesktop.org which delegates information done on user experience tests.

Code highlighted in gedit:

syntax highlighted code

Code itself:

#############################################################
### Protected and shared under GPL v2.0 license
### see: http://www.gnu.org/licenses/gpl-2.0.html
###
###
### Python code to gather structured information about
###   the work done as described on
###                       http://www.betterdesktop.org
###  which is great and promising about user experience
###                                    on free software
###
### edit: Dincer Kavraal
### mail: under "gmail.com" user "dkavraal"
#############################################################

from BeautifulSoup import BeautifulSoup
import urllib2

#------ init
print "Downloading...",
pageContent = urllib2.urlopen('http://www.betterdesktop.org/wiki/index.php?title=Data')
print "Done.\nRevealing...",
pageDom = BeautifulSoup(pageContent)
print "Done."
print "Content charcode:", pageDom.originalEncoding

#------ get all table:video-table
resultSet=[]
taskId=0
tables=pageDom.findAll("table", {"class": "video-table"})
for table in tables:
        pId=0
        resultSet.append([])
        resultSet[taskId].append(table.findPrevious('h3').string)
        for lineTag in table.findAll('tr'):
                arrayForPeopleCrted=False
                for columnTag in lineTag.findAll('td'):
                        if not(arrayForPeopleCrted):
                                pId+=1
                                resultSet[taskId].append([])
                                resultSet[taskId][pId] = []
                                arrayForPeopleCrted=True
                        if columnTag.find('a'):
                                resultSet[taskId][pId].append(columnTag.find('a').get('href'))
                        else:
                                resultSet[taskId][pId].append(columnTag.string.rstrip(' \n\r').lstrip(' \r\n'))
        taskId+=1
print "Total tasks processed: ", taskId
print

#------  print out summary table
taskId=0
for task in resultSet:
        taskId+=1
        print "---------------------------------------"
        print "".join(["[", str(taskId), "] ", task[0]])
        for pId in range(1, len(task)-1):
                print "".join(["\t\t", task[pId][3][0], task[pId][1], "(", task[pId][2], ")"])

#------ done.


Sample output:

---------------------------------------
[66] Task: Accept the offer to share an iFolder
		M18-30(9/10)
		M30-40(9/10)
		F18-30(5/10)
		M18-30(9/10)
		M18-30(9/10)
		M18-30(4/10)
		M18-30(9/10)
		M18-30(9/10)



Flex VerifyError: Error #1107 solved (mine)

I am getting this error “VerifyError: Error #1107″ when I try to instantiate a new object I have implemented as a ActionScript class file .as in other file.

Problem seems to be so redicolous when I observe that I can not even create a new object that does nothing operational, say:

package {
public class DenemeClass extends Class {
public function DenemeClass() {

}
}
}

That’s it… And I even was not able to create a new instance of this. And getting this error trace:

[SWF] C:\Documents and Settings\user\My Documents\Flex Builder 3\Denemeler\bin-debug\Denemeler.swf – 555,437 bytes after decompression
Trace: Inside #1
verify global$init()
stack:
scope:
locals: global
0:getlocal0
stack: global
scope:
locals: global
1:pushscope
stack:
scope: global
locals: global
2:debugfile “C:\Documents and Settings\user\My Documents\Flex Builder 3\Denemeler\src;RBIs;RBITree.as”
stack:
scope: global
locals: global
5:debugline 3
stack:
scope: global
locals: global
7:findpropstrict {RBIs}::RBITree
stack: global
scope: global
locals: global
10:getlex 13
stack: global Object$?
scope: global
locals: global
12:pushscope
stack: global
scope: global Object$
locals: global
13:getlex 50
stack: global Class$?
scope: global Object$
locals: global
15:pushscope
stack: global
scope: global Object$ Class$
locals: global
16:getlex 50
stack: global Class$?
scope: global Object$ Class$
locals: global
18:newclass RBIs::RBITree$cinit()
VerifyError: Error #1107: ABC verileri bozuk, s?n?r d??? okuma giri?imi.

at global$init()
at RBIs::DenemeClass()[C:\Documents and Settings\user\My Documents\Flex Builder 3\Denemeler\src\RBIs\DenemeClass.as:7]
at Denemeler$/runDeneme()[C:\Documents and Settings\user\My Documents\Flex Builder 3\Denemeler\src\Denemeler.mxml:8]
at Denemeler/___Denemeler_Button1_click()[C:\Documents and Settings\user\My Documents\Flex Builder 3\Denemeler\src\Denemeler.mxml:12]

I have just recognized that expression “extends Class” which was automatically added to my class definition by Flex was causing this. I think there is something wrong with Class constructor itself or I am unsufficient to satisfy Class constructor needs, since I am newbie.

Anyway, solved…

About this issue; same error with different circumstances described at:
[1] http://bugs.adobe.com/jira/browse/SDK-14054


Follow

Get every new post delivered to your Inbox.