Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Announce] Advanced Clock Plugin

    Reply
    Page 12 of 47 | Prev | 2   10     11   12   13     14   22 | Next | Last
    DJRedline | # 111 | 2010-12-30, 08:36 | Report

    Still unsure why i cannot get this to work. every version i install all it seems to do is disable the default clock.

    With latest version i can access the settings menu (within personalisation) but no matter what clock type i change to nothing seems to appear?

    Confusing

    Edit | Forward | Quote | Quick Reply | Thanks

     
    rajil.s | # 112 | 2010-12-30, 08:53 | Report

    My question got lost in the discussion so i will reiterate:

    "Is it possible tohave two clocks at the same time with one showing the local timezone and the second one showing the remote timezone?"

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Mentalist Traceur | # 113 | 2010-12-30, 09:20 | Report

    Originally Posted by
    @Mentalist Traceur: How are you going about getting the cpu/wifi information? I am not sure whether I am doing it efficiently (especially CPU measurement).
    Ummm, I honestly don't know if I'm doing it efficiently. I pulled open cpumem applet's source code and that's where I've been figuring it out from. I just got memory working, using /proc/meminfo, which I may be using a step or two more for than CPUMEM applet does, but it works just fine right now, at least, visibly (though without the update-screen-only-if-value-changed-enough part just yet).

    However, I have not done the same for CPU (doing it right now). The thing is I've been trying to understand the information in /proc/stat, and I am starting to have a creeping suspicion that all this time, all of us using load and cpumem applets have been getting slightly inaccurate CPU stats.

    As I understand it, /proc/stat has an idle time value in the FOURTH number (fifth string because it has 'cpu' at the front, index 4, if you split that line of /proc/stat). Disk I/O is on the FIFTH number... if I'm not wrong. And that's what CPUMEM accesses for calculating processor idle time from moment to moment - the fifth number of that string (index 5, again since "cpu" is on index 0 if you split it).

    So, have CPUMEM and Load applets just been telling us the changes in disk i/o the entire time, instead of idle processes? I can't think of a good test for how to fill up ram without running into an I/O operation, so frak if I can think of how to verify that. Anything that runs that much CPU probably requires some I/O, and anything that needs lots of I/O probably requires a bunch of processing.

    To be clear, the /proc/stat file's first line looks like this:
    "cpu 259246 7001 60190 34250993 137517 772 0 0"
    The problem is the red is the actual idle time, while the green is what the cpumem applet's source code says it's using.

    Furthermore, I'm finding this:
    http://colby.id.au/node/39
    http://www.murga-linux.com/puppy/vie...0161809#272677
    (Both links point to different edits of the same shell script) Which suggests that the proper way of calculating CPU usage is more complicated than that.

    So... how are you getting CPU for your version?

    @rajil.s: Yes, but you'd have to code the clock style yourself, or get one of us to do it for you. I don't think it would be that easy to set the time zone with just the settings, but it could be 'hard'-coded (in so far as uncompiled python is ever hard-coded) into the clock style. So one reports your time zone time, the other reports your time +/- X hours.

    - Edit (again) -

    Oh, and since I am a newb and might just be completely wrong, here's how the code looks for the relevant part in cpumem (it's in C):

    Code:
    #define CPUFILE "/proc/stat"
    	gint curU, curN, curIO, curI;
    	gint deltaU, deltaN, deltaIO, deltaI;
    	int load, idle;
    	GError *error = NULL;
    	gchar *contents;
    	gsize lenght;
    	gchar **splits;
    
    	if (!g_file_get_contents (CPUFILE, &contents, &lenght, &error)) {
    		fprintf (stderr, "ERR: can't read file %s: %s\n", CPUFILE, error->message);
    		g_error_free (error);
    		return 0;
    	}
    	
    	splits = g_strsplit_set (contents, " ",  -1);
    
    	sscanf(splits[2], "%d", &curU);
    	sscanf(splits[3], "%d", &curN);
    	sscanf(splits[4], "%d", &curIO);
    	sscanf(splits[5], "%d", &curI);
    	
    	g_strfreev (splits);
    	g_free (contents);
        
    	idle = (curI - priv->lastI);
    	if (idle == 0) load = 100;
    	else load = 100-idle;
    	if (load>100) load = 0;
    	deltaU = curU - priv->lastU;
    	deltaN = curN - priv->lastN;
    	deltaIO = curIO - priv->lastIO;
    	deltaI = curI - priv->lastI;
    	priv->lastU = curU;
    	priv->lastN = curN;
    	priv->lastIO = curIO;
    	priv->lastI = curI;
    The thing to note is that none of the variables starting with delta, and non of the variables ending with U, N, or IO, are used. It only uses the curl and priv->lastl variables. The others just don't get used in the code, even though they are set each time.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Mentalist Traceur; 2010-12-30 at 10:09. Reason: Looked up name of last poster.

     
    CasTTeLLo | # 114 | 2010-12-30, 10:39 | Report

    Originally Posted by Mentalist Traceur View Post
    Found it!
    Code:
    rm [-f] /home/user/.cache/launch/com.nokia.controlpanel.pvr
    This is for getting rid of that annoying control panel screen-shot that Hildon always fails to refresh at the right time. (The -f is in brackets because I don't need it when I run the command. Qwerty12 - who all proper TMO members should know was a hacking pimp of awesome - posted it with the -f, so it might be necessary for some people *shrug*.)

    CasTTeLLo. In my experience, just running apt-get update, once or at most twice, solves things. I don't really know how, or why - every time I get this problem I really feel like I don't know what the hell to do, but I tend to redo the same stuff reboot, apt-get update, remove and re-add repositories... It tends to fix itself if you do those enough times. I really don't know why though.
    after keep trying and trying, now it's working perfectly....thanks for ur "gut"....as usual, Problem solved!!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to CasTTeLLo For This Useful Post:
    Mentalist Traceur

     
    ayazpak | # 115 | 2010-12-30, 12:10 | Report

    This is nice, good work but after reboot clock setting went to its defaut setting, unable to save my personal settings.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    CasTTeLLo | # 116 | 2010-12-30, 12:21 | Report

    Originally Posted by ayazpak View Post
    This is nice, good work but after reboot clock setting went to its defaut setting, unable to save my personal settings.
    try this via xterminal :

    apt-get update
    apt-get upgrade

    if it's not solved try to reinstall the plugin and make sure u install the correct ver...gud luck!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to CasTTeLLo For This Useful Post:
    ayazpak, theonelaw

     
    ayazpak | # 117 | 2010-12-30, 12:31 | Report

    Originally Posted by CasTTeLLo View Post
    try this via xterminal :

    apt-get update
    apt-get upgrade

    if it's not solved try to reinstall the plugin and make sure u install the correct ver...gud luck!
    Thanks for quick reply, ok I will try and post the result here

    Edit | Forward | Quote | Quick Reply | Thanks

     
    gabby131 | # 118 | 2010-12-30, 12:35 | Report

    awesome plugin! looks like im not going to go back in time using the stock clock?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    rotoflex | # 119 | 2010-12-30, 12:48 | Report

    Latest version working nicely here.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    ayazpak | # 120 | 2010-12-30, 14:17 | Report

    Originally Posted by CasTTeLLo View Post
    try this via xterminal :

    apt-get update
    apt-get upgrade

    if it's not solved try to reinstall the plugin and make sure u install the correct ver...gud luck!
    Thanks again, I got it according to your instructions.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to ayazpak For This Useful Post:
    CasTTeLLo

     
    Page 12 of 47 | Prev | 2   10     11   12   13     14   22 | Next | Last
vBulletin® Version 3.8.8
Normal Logout