Search Results

Search found 9 results on 1 pages for 'kriss'.

Page 1/1 | 1 

  • Keeping Xv Overlay configuration throughout an X session.

    - by kriss
    After upgrading my Linux system from Ubuntu 9.04 to Ubuntu 10.10, I suceeded correcting most problems (all related to Intel 82865G Integrated Graphics Adapter support and compiz is still not working but that's another matter) but for one I only have a partial solution. Whenever I play a video the colors are much too saturated. This is really a problem for tones of skins that appears reddish (everyone seems to be coming back from a ski vacation with deep sun burns). As this effect only occurs with videos, not with pictures, I finally figured out it was related to Video Overlays configuration and I can correct it typing: xvattr -a XV_SATURATION -v 120 This change the default saturation value, which is 500 and much too high in my case, at eye sight the correct value seems to be between 100 and 150. Now my problem is that I have to type the above command each time I run a video. If I type it before running the video it has no effect, if I close the video and open a new one, I have to type it again, etc. I tried to put it in Xsession and (logically) it has no effect either. How could I do to get the correct setting whenever I run a video without typing the above command every time ?

    Read the article

  • Keeping Xv Overlay configuration throughout an X session.

    - by kriss
    After upgrading my Linux system from Ubuntu 9.04 to Ubuntu 10.10, I suceeded correcting most problems (all related to Intel 82865G Integrated Graphics Adapter support and compiz is still not working but that's another matter) but for one I only have a partial solution. Whenever I play a video the colors are much too saturated. This is really a problem for tones of skins that appears reddish (everyone seems to be coming back from a ski vacation with deep sun burns). As this effect only occurs with videos, not with pictures, I finally figured out it was related to Video Overlays configuration and I can correct it typing: xvattr -a XV_SATURATION -v 120 This change the default saturation value, which is 500 and much too high in my case, at eye sight the correct value seems to be between 100 and 150. Now my problem is that I have to type the above command each time I run a video. If I type it before running the video it has no effect, if I close the video and open a new one, I have to type it again, etc. I tried to put it in Xsession and (logically) it has no effect either. How could I do to get the correct setting whenever I run a video without typing the above command every time ?

    Read the article

  • Redirect C++ std::clog to syslog on Unix

    - by kriss
    I work on Unix on a C++ program that send messages to syslog. The current code uses the syslog system call that works like printf. Now I would prefer to use a stream for that purpose instead, typically the built-in std::clog. But clog merely redirect output to stderr, not to syslog and that is useless for me as I also use stderr and stdout for other purposes. I've seen in another answer that it's quite easy to redirect it to a file using rdbuf() but I see no way to apply that method to call syslog as openlog does not return a file handler I could use to tie a stream on it. Is there another method to do that ? (looks pretty basic for unix programming) ? Edit: I'm looking for a solution that does not use external library. What @Chris is proposing could be a good start but is still a bit vague to become the accepted answer. Edit: using Boost.IOStreams is OK as my project already use Boost anyway. Linking with external library is possible but is also a concern as it's GPL code. Dependencies are also a burden as they may conflict with other components, not be available on my Linux distribution, introduce third-party bugs, etc. If this is the only solution I may consider completely avoiding streams... (a pity).

    Read the article

  • Fastest sort of fixed length 6 int array

    - by kriss
    Answering to another StackOverflow question (this one) I stumbled upon an interresting sub-problem. What is the fastest way to sort an array of 6 ints ? As the question is very low level (will be executed by a GPU): we can't assume libraries are available (and the call itself has it's cost), only plain C to avoid emptying instruction pipeline (that has a very high cost) we should probably minimize branches, jumps, and every other kind of control flow breaking (like those hidden behind sequence points in && or ||). room is constrained and minimizing registers and memory use is an issue, ideally in place sort is probably best. Really this question is a kind of Golf where the goal is not to minimize source length but execution speed. I call it 'Zening` code as used in the title of the book Zen of Code optimization by Michael Abrash and it's sequels.

    Read the article

  • Does C99 guarantee that arrays are contiguous ?

    - by kriss
    Following an hot comment thread in another question, I came to debate of what is and what is not defined in C99 standard about C arrays. Basically when I define a 2D array like int a[5][5], does the standard C99 garantee or not that it will be a contiguous block of ints, can I cast it to (int *)a and be sure I will have a valid 1D array of 25 ints. As I understand the standard the above property is implicit in the sizeof definition and in pointer arithmetic, but others seems to disagree and says casting to (int*) the above structure give an undefined behavior (even if they agree that all existing implementations actually allocate contiguous values). More specifically, if we think an implementation that would instrument arrays to check array boundaries for all dimensions and return some kind of error when accessing 1D array, or does not give correct access to elements above 1st row. Could such implementation be standard compilant ? And in this case what parts of the C99 standard are relevant.

    Read the article

  • printf not passing correct Hex Address to stack

    - by kriss
    I have a hickup in using printf . I am on ubuntu 10.04. Basically i have a C program asking for some input and then prints it back. It is OK for printing something after inputing. I tried to insert some Hex Address to Stack by following format:- printf "hello world!\x12\x23\x34" | ./input1 But i don't know what is the problem. If i give only string beyond 12 bytes it overwrites BUT If I give hex address(through printf), it doesn't overwrite on return address. Instead it stores some other thing. Could anyone help??? I can't proceed further becoz of this. Thanks in advance

    Read the article

  • Fastest way to find the rotation of a vector

    - by kriss
    I have two 2D vectors, say u and v, defined by cartesian coordinates. Imagine that vectors are needles of a clock. I'm looking for the fastest way to find out, using python, if v is after or before u (or in other words find out in wich half plane is v, regarding to position of u). For the purpose of the problem if vectors are aligned answer should be before. It seems easy using some trigonometry, but I believe there should be a faster way using coordinates only. My test case: def after(u, v): """code here""" after((4,2), (6, 1)) : True after((4,2), (3, 3)) : False after((4,2), (2, 1)) : False after((4,2), (3, -3)) : True after((4,2), (-2, -5)) : True after((4,2), (-4, -2)) : False

    Read the article

  • What does a b prefix before a python string means ?

    - by kriss
    In a python source code I stumbled upon I've seen a small b before a string like in: b"abcdef" I know of u prefix that means unicode and r prefix that means raw. What does the b stand for and in which kind of source code is it useful as it seems to be exactly like a plain string without any prefix ?

    Read the article

  • multimap erase doesnt work

    - by nikiforzx6r
    following code doensnt work with input: 2 7 add Elly 0888424242 add Elly 0883666666 queryname Elly querynum 0883266642 querynum 0888424242 delnum 0883666666 queryname Elly 3 add Kriss 42 add Elly 42 querynum 42 Why my erase doesnt work? #include<stdio.h> #include<iostream> #include<map> #include <string> using namespace std; void PrintMapName(multimap<string, string> pN, string s) { pair<multimap<string,string>::iterator, multimap<string,string>::iterator> ii; multimap<string, string>::iterator it; ii = pN.equal_range(s); multimap<string, int> tmp; for(it = ii.first; it != ii.second; ++it) { tmp.insert(pair<string,int>(it->second,1)); } multimap<string, int>::iterator i; bool flag = false; for(i = tmp.begin(); i != tmp.end(); i++) { if(flag) { cout<<" "; } cout<<i->first; if(flag) { cout<<" "; } flag = true; } cout<<endl; } void PrintMapNumber(multimap<string, string> pN, string s) { multimap<string, string>::iterator it; multimap<string, int> tmp; for(it = pN.begin(); it != pN.end(); it++ ) { if(it->second == s) { tmp.insert(pair<string,int>(it->first,1)); } } multimap<string, int>::iterator i; bool flag = false; for(i = tmp.begin(); i != tmp.end(); i++) { if(flag) { cout<<" "; } cout<<i->first; if(flag) { cout<<" "; } flag = true; } cout<<endl; } void PrintFull(multimap<string, string> pN) { multimap<string, string>::iterator it; for(it = pN.begin(); it != pN.end(); it++ ) { cout<<"Key = "<<it->first<<" Value = "<<it->second<<endl; } } int main() { multimap<string, string> phoneNums; int N; cin>>N; int tests; string tmp, tmp1,tmp2; while(N > 0) { cin>>tests; while(tests > 0) { cin>>tmp; if(tmp == "add") { cin>>tmp1>>tmp2; phoneNums.insert(pair<string,string>(tmp1,tmp2)); } else { if(tmp == "delnum") { /////////////////////////////////////////HEREEEEEEE multimap<string, string>::iterator it; multimap<string, string>::iterator tmpr; for(it = phoneNums.begin(); it != phoneNums.end();) { tmpr = it; if(it->second == tmp1) { ++tmpr; if(tmpr == phoneNums.end()) { phoneNums.erase(it,tmpr); break; } else { phoneNums.erase(it,tmpr); } } } } else { if(tmp == "delname") { cin>>tmp1; phoneNums.erase(tmp1); } else { if(tmp =="queryname") { cin>>tmp1; PrintMapName(phoneNums, tmp1); } else//querynum { cin>>tmp1; PrintMapNumber(phoneNums, tmp1); } } } } tests--; } N--; } return 0; }

    Read the article

1