Search Results

Search found 7 results on 1 pages for 'semen semenych'.

Page 1/1 | 1 

  • How can i make Brightness Control work?

    - by Semen
    I have Xubuntu 12.04 with latest updates on Toshiba Satellite A210-15K laptop semen@bloknot:~$ uname -a Linux bloknot 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:22 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux ...and I can't adjust LCD brightness (. I tried to use fnfx tool: semen@bloknot:~$ fnfx-client FnFX Client v0.3 (c) 2003, 2004 Timo Hoenig <[email protected]> fatal error: Could not open "/home/semen/.fnfxrc". Please make sure that the default config is accessible. ...and xbacklight: semen@bloknot:~$ xbacklight No outputs have backlight property ...and I tried to add acpi_osi=Linux and acpi_backlight=vendor parameters in GRUB config, but nothing happens. I soppose .fnfxrc file must be available after installation or first fnfx demon lauch. Isn't it? semen@bloknot:~$ cat /sys/class/backlight/toshiba/brightness -5 semen@bloknot:~$ cat /sys/class/backlight/toshiba/max_brightness 7 semen@bloknot:~$ echo 6 | sudo tee /sys/class/backlight/toshiba/brightness [sudo] password for semen: 6 ... ...but brightness is the same. Help, please. P.S. Execuse me for my poor English. UPD. I have spent 2 days to solve this boring problem, but I can't. So. If I wish linux work correctly, I have to choose another distro.

    Read the article

  • Where is the virtual function call overhead?

    - by Semen Semenych
    Hello everybody, I'm trying to benchmark the difference between a function pointer call and a virtual function call. To do this, I have written two pieces of code, that do the same mathematical computation over an array. One variant uses an array of pointers to functions and calls those in a loop. The other variant uses an array of pointers to a base class and calls its virtual function, which is overloaded in the derived classes to do absolutely the same thing as the functions in the first variant. Then I print the time elapsed and use a simple shell script to run the benchmark many times and compute the average run time. Here is the code: #include <iostream> #include <cstdlib> #include <ctime> #include <cmath> using namespace std; long long timespecDiff(struct timespec *timeA_p, struct timespec *timeB_p) { return ((timeA_p->tv_sec * 1000000000) + timeA_p->tv_nsec) - ((timeB_p->tv_sec * 1000000000) + timeB_p->tv_nsec); } void function_not( double *d ) { *d = sin(*d); } void function_and( double *d ) { *d = cos(*d); } void function_or( double *d ) { *d = tan(*d); } void function_xor( double *d ) { *d = sqrt(*d); } void ( * const function_table[4] )( double* ) = { &function_not, &function_and, &function_or, &function_xor }; int main(void) { srand(time(0)); void ( * index_array[100000] )( double * ); double array[100000]; for ( long int i = 0; i < 100000; ++i ) { index_array[i] = function_table[ rand() % 4 ]; array[i] = ( double )( rand() / 1000 ); } struct timespec start, end; clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start); for ( long int i = 0; i < 100000; ++i ) { index_array[i]( &array[i] ); } clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end); unsigned long long time_elapsed = timespecDiff(&end, &start); cout << time_elapsed / 1000000000.0 << endl; } and here is the virtual function variant: #include <iostream> #include <cstdlib> #include <ctime> #include <cmath> using namespace std; long long timespecDiff(struct timespec *timeA_p, struct timespec *timeB_p) { return ((timeA_p->tv_sec * 1000000000) + timeA_p->tv_nsec) - ((timeB_p->tv_sec * 1000000000) + timeB_p->tv_nsec); } class A { public: virtual void calculate( double *i ) = 0; }; class A1 : public A { public: void calculate( double *i ) { *i = sin(*i); } }; class A2 : public A { public: void calculate( double *i ) { *i = cos(*i); } }; class A3 : public A { public: void calculate( double *i ) { *i = tan(*i); } }; class A4 : public A { public: void calculate( double *i ) { *i = sqrt(*i); } }; int main(void) { srand(time(0)); A *base[100000]; double array[100000]; for ( long int i = 0; i < 100000; ++i ) { array[i] = ( double )( rand() / 1000 ); switch ( rand() % 4 ) { case 0: base[i] = new A1(); break; case 1: base[i] = new A2(); break; case 2: base[i] = new A3(); break; case 3: base[i] = new A4(); break; } } struct timespec start, end; clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &start); for ( int i = 0; i < 100000; ++i ) { base[i]->calculate( &array[i] ); } clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &end); unsigned long long time_elapsed = timespecDiff(&end, &start); cout << time_elapsed / 1000000000.0 << endl; } My system is LInux, Fedora 13, gcc 4.4.2. The code is compiled it with g++ -O3. The first one is test1, the second is test2. Now I see this in console: [Ignat@localhost circuit_testing]$ ./test2 && ./test2 0.0153142 0.0153166 Well, more or less, I think. And then, this: [Ignat@localhost circuit_testing]$ ./test2 && ./test2 0.01531 0.0152476 Where are the 25% which should be visible? How can the first executable be even slower than the second one? I'm asking this because I'm doing a project which involves calling a lot of small functions in a row like this in order to compute the values of an array, and the code I've inherited does a very complex manipulation to avoid the virtual function call overhead. Now where is this famous call overhead?

    Read the article

  • e4x statement conflicts with local variable?

    - by semen
    Hi, griends! Somewhere in code i have decalred variable: [Bindable] var nameWin:String = ""; after this i have an e4x statement podContent.xml_m = xml_m.item.(nameWin=="necessary name"); that should compare item's namewin with "necessary name" and return only items whose nameWin matches with "necessary name". xml_m.item: <item> <nameWin>necessary name</nameWin> <nameCol>??????-?????? ???????????</nameCol> <date>2009 ???</date> <summa>259267.7976</summa> </item> <item> <nameWin>unnecessary name</nameWin> <nameCol>??????-?????? ???????????</nameCol> <date>2010 ??????</date> <summa>104.3254</summa> </item> <item> <nameWin>necessary name</nameWin> <nameCol>??????-?????? ???????????</nameCol> <date>2010 ???</date> <summa>21.5174</summa> </item> if I use in statement xml-child distinct of nameWin (summa, e. g.), it works good. But with nameWin, e4x compares local variable nameWin (which not interested for me at all at this time) with "necessary name" instead of compare item's nameWin with "necessary name". Any ideas? Versions of libraries can be reason?

    Read the article

  • How to get Win32 to use Windows XP style fonts

    - by Semen Semenych
    I'm writing a Win32 application using plain C and WinAPI. No MFC or C++ is allowed. To get the controls to draw using the appropriate style, I use a manifest, as described in the corresponding MSDN article. Everything is fine, and when I change the system style, my application changes style as well. But the font used is just ugly. How do I force the application to use the standard system font?

    Read the article

  • How to encapsulate a WinAPI application into a C++ class

    - by Semen Semenych
    There is a simple WinAPI application. All it does currently is this: register a window class register a tray icon with a menu create a value in the registry in order to autostart and finally, it checks if it's unique using a mutex As I'm used to writing code mainly in C++, and no MFC is allowed, I'm forced to encapsulate this into C++ classes somehow. So far I've come up with such a design: there is a class that represents the application it keeps all the wndclass, hinstance, etc variables, where the hinstance is passed as a constructor parameter as well as the icmdshow and others (see WinMain prototype) it has functions for registering the window class, tray icon, reigstry information it encapsulates the message loop in a function In WinMain, the following is done: Application app(hInstance, szCmdLIne, iCmdShow); return app.exec(); and the constructor does the following: registerClass(); registerTray(); registerAutostart(); So far so good. Now the question is : how do I create the window procedure (must be static, as it's a c-style pointer to a function) AND keep track of what the application object is, that is, keep a pointer to an Application around. The main question is : is this how it's usually done? Am I complicating things too much? Is it fine to pass hInstance as a parameter to the Application constructor? And where's the WndProc? Maybe WndProc should be outside of class and the Application pointer be global? Then WndProc invokes Application methods in response to various events.

    Read the article

  • GetWindowLongPtr fails if called when handling WM_CREATE

    - by Semen Semenych
    Calling the GetWindowLongPtr function for a dialog box with the DWL_USER parameter fails when done from the WM_CREATE handler. It gives no error (checked that, the return value is always zero), which, according to the MSDN documentation, occurs only if SetWindowLongPtr has not been called previously. However, I call it after registering the window class, and properly call the SetWindowPos after that. Finally, calling GetWindowLongPtr in any other event handler, that is, later than WM_CREATE, works fine. Is there something I'm missing in the initialization sequence, or maybe the messages are sent in some not so obvious order?

    Read the article

  • Replace several tags from a text js

    - by Blanca
    Hi! I have this pice of text I would like to change: [¿Cómo se procede cuando la mujer o pareja de un < bfallecido< /b pide la congelación del semen] So I would like to remove ], [ and < b< /b Is there any way to change it everything in the same time?? I tried: function replaceThings(){ jQuery(".summary").each(function(){ var t = jQuery(this).text(); jQuery(this).text(t.replace(/& lt;/g, '')); jQuery(this).text(t.replace('[', '')); jQuery(this).text(t.replace(']', '')); }); But only replaces ]. Thanks in advance

    Read the article

1