Search Results

Search found 4 results on 1 pages for 'powerbar'.

Page 1/1 | 1 

  • Making a visual bar timer for iPhone

    - by Ohmnastrum
    I've looked up all results for progress bars and changing the width of an image but it only refers to scaling, and the progress bars aren't customizable so that they fit other functions or design schemes... unless I missed that part. I'm trying to make a bar timer that crops off of the right over a period of time. I tried using an NStimer so that it would subtract from a value each time its function is called. the Timerbar function gets called as a result of another timer invalidating and it works. What doesn't work is that the width isn't changing just the position. further more I keep getting values like Inf and 0 for power and pwrBarWidth I was sure that the changes would occur when Mult was plugged into the equation. it seems like casting mult as an int is causing problems but i'm not sure exactly how. int pwrBarMaxWidth = 137; int pwrBarWidth 0; int limit = 1; float mult; float power = 0; -(void) Timerbar:(NSTimer *)barTimer { if(!waitForPlayer) { [barTimer invalidate]; } if(mult > 0.0) { mult -= 0.001 * [colorChoices count]; if(mult < 0.0) { mult = 0.0; } } power = (mult * 10) / pwrBarMaxWidth; pwrBarWidth = (int)power % limit; // causes the bar to repeat after it reaches a certain point //At this point however the variable Power is always "inf" and PwrBarWidth is always 0. [powerBar setBounds:CGRectMake(powerBar.frame.origin.x, powerBar.frame.origin.y,pwrBarWidth,20)]; //supposed to change the crop of the bar } Any reason why I'm getting inf as a value for power, 0 as a value for pwrBarWidth, and the bar itself isn't cropping? if this question is a bit vague i'll provide more information as needed.

    Read the article

  • "sed" regex help: Replacing characters

    - by powerbar
    I want to change characters in a XML file by using sed. The input looks like this: <!-- Input --> <root> <tree foo="abcd" bar="abccdcd" /> <dontTouch foo="asd" bar="abc" /> </root> Now I want to change all c to X in the bar tag of the tree element. <!-- Output --> <root> <tree foo="abcd" bar="abXXdXd" /> <dontTouch foo="asd" bar="abc" /> </root> How is the correct sed command? Please consider, there can be more than one occurence of c (next to each other or not) in one tag... I tried this myself, but it won't change multiple c, and it does append a X :( sed -i 's/\(<tree.*bar=\".*\)c\(.*\"\/>\)/\1X\2/g' Input.xml

    Read the article

  • "SELECT DISTINCT" ignores different cases

    - by powerbar
    Hello, I have the problem, that MSSQL Server 2000 should select some distinct values from a table (the specific column is of the nvarchar type). There are the sometimes the same values, but with different cases, for example (pseudocode): SELECT DISTINCT * FROM ("A", "a", "b", "B") would return A,b But I do want (and do expect) A,a,b,B because they actually are different values. Any idea how to solve this problem? Thanks a lot in advance!

    Read the article

  • Audio card with built-in ground isolator?

    - by Dave Jarvis
    What audio cards would you recommend that eliminate hum, and hard-drive & mouse movement signal interference? Hardware components: Motherboard. Asus P5Q SE Audio. Realtek ALC 1200, 8-Channel High-Definition Audio CODEC (on board) Harddrive. WD Caviar 320 GB Mouse. Logitech Marbleman USB Mixer. Mackie d.4 Pro Amplifier. Sonance Sonamp 260 All components are plugged into the same Monster Power HDP 910 powerbar (does not help eliminate noise). I have no other components plugged in. The computer uses a Monster iCable 1000 to go from mini (on board audio) to RCA (mixer). I have moved the cable as far from other cables as possible. A ground loop isolator between the mixer and on board audio eliminates all noise. I would rather not use a ground loop isolator; an internal audio card that is Linux-compatible (Kubuntu) would be ideal. Suggestions?

    Read the article

1