Recently, little fat in the dormitory encountered a worry about things, other dormitory students always come to his bedroom to use his computer, some students are playing games, and some are landing QQ, his computer is always a heap of his use of software piled up, he felt very annoyed, in order to effectively improve this vicious circle, Small fat decided to use a Win7 with a monitor to manage his computer, so that others dare not touch his computer.
is released. And these two are different for the same buttons that you want to implement.
Solid here adds a private Boolean locklongpresskey = false; variables, which are processed in the Onkeylongpress function, are not processed in the onkeyup.
2, Button
The custom button length event is done by implementing the Onlongclicklistener interface.
Import android.app.Activity;
Import Android.os.Bundle;
Import Android.view.View;
Import Android.view.View.OnLongClickListener;
Import Android
In our development process, we often encounter the need to judge the app to enter the background, or switch to the foreground of the situation. For example, we want to judge the app to switch to the foreground, display an unlock interface, require the user to enter the unlock password to continue operation, we want to judge the app to switch to the background, log the log, or when the user switches back to the foreground, we want to refresh the page d
1. Need to add related JVM parameters in Start command-dcom.sun.management.jmxremote-djava.rmi.server.hostname-dcom.sun.management.jmxremote.port- Dcom.sun.management.jmxremote.authenticate-dcom.sun.management.jmxremote.sslSpecific examples:Java-dcom.sun.management.jmxremote-djava.rmi.server. hostname=127.0. 0.1 -dcom.sun.management.jmxremote.port=9004 -dcom.sun.management.jmxremote.authenticate=false -dcom.sun.management.jmxremote.ssl=false -jar ems-service-user-2.0. 0. Jar2. Add the Web p
Monitor the execution state of the. Py script with a Python script and implement an interrupt restart. #!/usr/bin/python#-*-coding:utf-8-*-importsubprocess,time,systime=10 #程序状态检测间隔 (units: minutes) cmd= "get_bjipku.py" #需要执行程序的绝对路径, support jar such as: D:\\calc.exe or D:\\test.jarclassauto_run (): def__init__ (self,sleep_time,cmd): self.sleep_time=sleep_time self.cmd=cmdself.ext = (cmd[-3:]). Lower () #判断文件的后缀名, change all to lowercase self.p
crtrl.py python script to monitor the Apache server process
Copy Code code as follows:
!/usr/bin/env Python
Import OS, sys, time
While True:Time.sleep (4)Tryret = Os.popen (' ps-c apache-o pid,cmd '). ReadLines ()If Len (ret) Print "Apache process quits unexpectedly, reboot after 4 seconds"Time.sleep (3)Os.system ("Service apache2 restart")ExceptP
The example of this article is about the implementation of the Android monitor caller and power off. Share to everyone for your reference, specific as follows:
To monitor the Android phone and answer the phone, just the following 2 steps
The first step is to write a receiver inherited from Broadcastreceiver
Impo
Code inside the monitoring 1 processes, the code is very simple, I do not explain, there is not understand, you can ask in reply.I saw it and gave it a lecture.Of course, the script to execute, you need to turn on the system's timer process Crond, and edit the configuration file.Executive Crontab-eEnter */1 * * * */home/automonitor.sh to execute the script once a minute.[C-sharp]View PlainCopy
#!/bin/sh
Cdnclient_pid= ' ps-aux|grep-v ' grep '
the class does not know whether there is the meaning of the layout of the head-mounted device)
"Compass" subsystem of reading and writing compass under Event2 node
and MX3 (can not be said that Android ha here for MX3) is from these system nodes read and write device event information, the above information I was in the mx3 screen when the power button is pressed to turn off the screen, if we press power again to light the screen, the kernel
#!/bin/sh#crontabusage:*/2****/home/http_restart.sh> >/backup/restart_apache.logmin_ram=3200free_ram= ' free-m|grepmem|awk ' {print $4} ' echo$ (date+ "%y-%m-%d") ' uptime ' if[ ' echo ' $FREE _ramThis article is from the "my operation and maintenance of the road" blog, declined reprint!Monitor HTTP process for high memory restart HTTPD
Reprinted please indicate the source: http://www.openext.org/2014/06/virt-install-erro1
An error occurred while installing the vm using virt-install. The solution is as follows:
$ Sudo./create-vm-demo.sh
Starting install...
ERROR internal error process exited while connecting to monitor: char device redirected to/dev/pts/2
Kvm:-drive file =/home/muge0913/workstation/kvm/test. img, if = none, id = drive-ide0
Copy the Code code as follows:
#!/usr/bin/env pythonImport OS, sys, time While True:Time.sleep (3)Tryret = Os.popen (' ps-c nginx-o pid,cmd '). ReadLines ()If Len (ret) Print "Nginx process killed, restarting service in 3 seconds."Time.sleep (3)Os.system ("Service nginx restart")ExceptPrint "Error", Sys.exc_info () [1]
Set the file executable properties, added to the/etc/rc.local, finally relieved.This method can also
(I) downloadNethogs-0.8.0.tar.gzBefore installation, you may need to install yum install ncurses *(Ii) RoleDifferent from other statistics and monitoring of network card Traffic, NetHogs is a bit special and can monitor the network bandwidth usage of each process(Iii) UseThis program requires the root permission. By default, the eth0 Nic is monitored. If multiple NICs exist, you must specifyNethogsNethogs e
process of virtual machine continuous GC, These objects are recycled, and the memory footprint will fall to a steady level;c) Conversely, if there is a case in the code that does not release the object reference, the total size value of the data object will not come down significantly after each GC, and as the number of operations is increased, the value of total size will become larger.Until an upper limit is reached, the
Using process_monitor.sh to monitor the crontab configuration of the Hadoop process
You can find process_monitor.sh from the following links:
https://github.com/eyjian/mooon/blob/master/common_library/shell/process_monitor.sh
---------------------------------------------------------Script Content--------------------------------------------------------
#!/bin/sh
# https://github.com/eyjian/mooon/blob/ma
One: The difference between the home key monitor and the back key monitor in Android:
(1). In Android, when the home key is pressed, by default the activity of the stop foreground, that is, the activity is set to stop State "onStop ()" Instead of destroying the State "ondestory ()". If you start the activity again, in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.