hardware

Android Hardware Battery temperature, where is the sensor?

淺唱寂寞╮ 提交于 2019-12-04 19:05:06
I have a stupid idea. With android is simple to get battery state (volt, charge, temperature, ecc). BatteryManager.EXTRA_TEMPERATURE I think that the sensor is located inside lithium battery pack, in fact there are 3 pins over it connecting to the phone. Maybe that one of them is the battery sensor temperature. How it works? It's possible, but i know that damage may be relevant , isolate that pin and connect the phone pin to an external sensor? So we can catch outside temperature using battery manager....without using Google IOIO or Arduino just for reading a temperature. THAT'S ONLY FOR STUDY

Simulate Key Press at hardware level - Windows

笑着哭i 提交于 2019-12-04 18:52:47
问题 I'm looking for a language or library to allow me to simulate key strokes at the maximum level possible, without physically pressing the key. (My specific measure of the level of the keystroke is whether or not it will produce the same output as a physical Key Press when my computer is already running key listeners (such as MouseKeys and StickyKeys)). I've tried many methods of keystroke emulation; The java AWT library, Java win32api, python win32com sendKeys, python ctypes Key press, and

Why INC and ADD 1 have different performances? [duplicate]

假装没事ソ 提交于 2019-12-04 18:00:11
问题 This question already has answers here : INC instruction vs ADD 1: Does it matter? (2 answers) Closed 2 years ago . I've read many times over the years that you should do XOR ax, ax because it is faster... or when programming in C use counter++ or counter+=1 because they would INC or ADD... Or that in the Netburst Pentium 4 the INC was slower than ADD 1 so the compiler had to be warned that your target was a Netburst so it would translate all var++ to ADD 1... My question is: Why INC and ADD

Block physical keyboard input in EditText

只谈情不闲聊 提交于 2019-12-04 17:54:23
I have a EditText that should not allow the user to input anything through the keyboard (soft or hard). This EditText should only allow the user to input something through keys(buttons) displayed in the screen by the app. I have disabled the soft keyboard, but I can't find a way to disable the hardware keyboard input. This input via hardware keyboard can be done using a emulator that is configured to allow input through the hardware keyboard. So, my question is, How can I block the input via physical keyboard in a EditText? Thank you! Finally got it! Code: editText.setOnKeyListener(new View

Detect if phone's keyboard is slid out

笑着哭i 提交于 2019-12-04 16:57:38
I'd like to set focus to an EditText and automatically bring up the virtual keyboard in certain situations. However, if a phone's hardware keyboard is slid out, I wouldn't want to. Is there any way to detect whether or not a phone's hardware keyboard (if one exists) is slid out? Or is there some functionality of the EditText that will handle all this for me? Adrian Spinei if (getResources().getConfiguration().hardKeyboardHidden==Configuration.HARDKEYBOARDHIDDEN_NO) { //do stuff } To dive deeper, triggering OnConfigurationChanged on keyboard slide is explained in Activity restart on rotation

Difference between “machine hardware” and “hardware platform”

拜拜、爱过 提交于 2019-12-04 14:29:45
问题 My Linux machine reports "uname -a" outputs as below: [root@tom i386]# uname -a Linux tom 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:34:33 EDT 2009 i686 i686 i386 GNU/Linux [root@tom i386]# As per man page of uname, the entries "i686 i686 i386" denotes: machine hardware name (i686) processor type (i686) hardware platform (i386) Additional information: [root@tom i386]# cat /proc/cpuinfo <snip> vendor_id : GenuineIntel CPU family : 6 model : 15 model name : Intel(R) Xeon(R) CPU 5148 @ 2.33 GHz

How I can receive hardware key events in sleep mode?

一世执手 提交于 2019-12-04 13:12:37
I'm writing an application that allows people in danger to call 911. This is how it should work: He (or she) feels danger. He pushes the volume-down key three times. My app calls 911. But I'm facing the following problem: how can I receive a hardward key event in sleep mode ? I've searched Google and other search engines, but can't find anything related. public class YourBoardcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_CAMERA_BUTTON.equals(intent.getAction())) { Intent main = new Intent();// } } } And in your

Query Hardware-Specific Information on Windows With C++

醉酒当歌 提交于 2019-12-04 12:40:38
Specifically, I want to query a system's GPU for the following: The name of the GPU, the series (e.g. ATI Radion 5800, NVIDIA GeForce 4 MX, etc.), the BIOS version, the driver version, the GPU clock speed, the GPU memory speed, the memory type, the memory size, the bus width, the bandwidth, the type of bus being used, the vendor. Any ideas? The application I'm developing just has to display this information to the user. I suggest querying WMI, using the following WMI objects: Win32_DisplayConfiguration - name of GPU Win32_VideoController - DAC type, speed - video RAM size also try: CIM

Java Hardware Interrupt Handling

守給你的承諾、 提交于 2019-12-04 10:51:24
I would like to know if it is possible to automatically invoke a Java method when a hardware interrupt is raised. There may be an alternative. I'm doing something similar: In an application I monitor 4 mice for clicks. Those clicks generate interrupts but I'm happy enough not to deal with them directly from Java. Under Linux, it turns out there are device files ( /dev/input/mouse# ) that spew a bunch of characters when something happens with the mouse. I have a Thread for each one with a FileReader blocking on a read. Once characters arrive, the appertaining thread unblocks and I can do

Optimal RAID setup for SQL server

我们两清 提交于 2019-12-04 08:07:08
问题 We have an SQL 2005 database backend for our website, currently about 10GB in size. There are a lot more reads than writes, though I don't have the exact statistics. We're upgrading our database server and I was thinking of getting 4 disks and setting them up in two RAID 1 arrays - one for the data files and the other for the OS and log files. Would this be the optimal set-up or would RAID 5 be better for the data files? RAID 10 gets a bit pricey and is probably overkill for us. At this stage