power

What settings can my app control to conserve battery life?

I was wondering what settings an application can control to improve battery life in the Android environment. On most laptops, you can control screen brightness, wireless adapter settings, etc, as a means to conserve battery life. Are there any such controls in Android? Thanks! ...

Modifying PROCTHROTTLEMAX with powercfg has no effect in 2008 R2

I am trying to make the CPU transition to a lower P-state. I used pwrtest to determine the tests, and now I want to set the processor frequency to 50%. I executed the following command: powercfg -setacvalueindex SCHEME_BALANCED SUB_PROCESSOR PROCTHROTTLEMAX 50 When i query the scheme, the value is set to the desired value. However, t...

How to turn on monitor after wake-up from suspend mode?

Hi all, I need wake up PC from sleep to perform some actions - from C#. I've used CreateWaitableTimer functions, everything goes fine, at given time PC wakes up - but monitor stays in power save mode (turned off). So i want to know - how possible to turn on monitor after wake up? PS I've tried "Complete Guide on How To Turn A Monitor On...

Previous power of 2

There is a lot of information on how to find the next power of 2 of a given value (see refs) but I cannot find any to get the previous power of two. The only way I find so far is to keep a table with all power of two up to 2^64 and make a simple lookup. Acius' Snippets gamedev Bit Twiddling Hacks Stack Overflow ...

Power Analysis in [R] for Two-Way Anova

I am trying to calculate the necessary sample size for a 2x2 factorial design. I have two questions. 1) I am using the package pwr and the one way anova function to calculate the necessary sample size using the following code pwr.anova.test(k = , n = , f = , sig.level = , power = ) However, I would like to look at two way anova, si...

How do you make this Haskell power function tail recursive?

turboPower a 0 = 1 turboPower a b | even b = turboPower (a*a) (b `div` 2) | otherwise = a * turboPower a (b-1) THANKS! ...

How can I register a call-back on suspend in a linux driver?

I'm writing a linux driver and I would like to register a callback function to be invoked when the system goes to sleep. What is the api to do this? Thanks. ...

power and modulo on the fly for big numbers

I raise some basis b to the power p and take the modulo m of that. Let's assume b=55170 or 55172 and m=3043839241 (which happens to be the square of 55171). The linux-calculator bc gives the results (we need this for control): echo "p=5606;b=55171;m=b*b;((b-1)^p)%m;((b+1)^p)%m" | bc 2734550616 309288627 Now calculating 55170^5606 gi...

How can I write a power function myself?

Since I was 12, I was always wondering how I can make a function which calculates the power (e.g. 23) myself. In most languages these are included in the standard library, mostly as pow(double x, double y), but how can I write it myself? I was thinking about for loops, but it think my brain got in a loop (when I wanted to do a power wit...

Opposite method of math power adding numbers

I have method for converting array of Booleans to integer. It looks like this class Program { public static int GivMeInt(bool[] outputs) { int data = 0; for (int i = 0; i < 8; i++) { data += ((outputs[i] == true) ? Convert.ToInt32(Math.Pow(2, i)) : 0); }...

how get real time voltage

Is there a way to retrieve the voltage being supplied to a computer in real time? ...

java.math.BigInteger pow(exponent) question

Hi, I did some tests on pow(exponent) method. Unfortunately, my math skills are not strong enough to handle the following problem. I'm using this code: BigInteger.valueOf(2).pow(var); Results: var | time in ms 2000000 | 11450 2500000 | 12471 3000000 | 22379 3500000 | 32147 4000000 | 46270 4500000 | 31459 5000000 | 49922 See? 2,5...

Problem with Copy-Item -force

Hi, This is part of my image-copy-script: Get-Childitem | where {$.Extension -eq ".png" -or $.Extension -eq ".gif" -or $_.Extension -eq ".jpg"} | Copy-Item -destination $dest -force It works fine, and it can overwrite files. Well, it can overwrite if the existing file have attribute R or A. Not when its blanked. Error in red text: "Co...

To set a Background image in .Net form

i want to set an image to my .net form background using BackgroundImage propery but its not working so plz help me with it as soon...thnx in advance ...

Programmatically power off the windows machine immediately

Can I create a simple program to power off the windows machine immediately? I would like the behavior to be like pressing PWR OFF/RESET button. So the power is cut off immediately. Is there any way to send a software interrupt to motherboard to make this happen? ...

Using IPMI inside a python script (OpenIPMI)

Hi, I'd like to use IPMI to set a machine to PXE boot (i.e. ipmitool -I lan -U username -P password -H ipaddress chassis bootdev pxe) and then power cycle it (i.e. ipmitool -I lan -U username -P password -H ipaddress chassis power cycle). However, I'd like to do this in a python script so I'm trying to use OpenIPMI and its python bindin...

Ruby - What's the reverse of Math Power (**)

Hi there, I was wondering how can I get the inverse of power in ruby? 2 ** 4 => 16 and then I would like to get the inverse of it, and I'm not sure which operator to use :( 16 ?? 2 => 4 Thanks a lot ...

Shutting down computer with nasm.

Is it possible to shut down or kill the power (is there a difference?) to a computer from nasm. I know you can use this to reboot: mov al, 0xFE out 0x64, al Is there an equivalent for shutting down? ...

Android wifi power question

I have observed that by default the wifi adaptor goes into (power saving mode) PSM mode. When Certain applications such as youtube appear to buffer video, the adaptor leaves PSM mode into CAM state or full power mode. Once the buffering is done, the wifi adaptor goes back into PSM mode. I have observed this behavior with other appl...

How to do a fractional power on BigDecimal in Java?

In my little project I need to do something like Math.pow(7777.66, 5555.44) only with VERY big numbers. I came across a few solutions: - Use double - but the numbers are too big - Use BigDecimal.pow but no support for fractional - Use the X^(A+B)=X^A*X^B formula (B is the remainder of the second num), but again no support for big X or bi...