几天前,我在Google Play商店下载了Bluetooth Smart Scanner软件.在我的三星Galaxy S3手机上安装后,我可以成功扫描我的蓝牙LE设备.
尽管我已经尝试过扫描我的蓝牙LE设备的所有方法,但我的计算机上没有显示任何内容.所以我反编译了这个软件,startLeDiscovery()包中有一个方法android.bluetooth.但令我困惑的是,这个方法在我android.jar的android sdk 15中不存在.
最后,我用Bluetooth Smart Scanner软件替换了它们的BlutoothAdapter.class文件和BluetoothDevice.class文件android.jar,这样我就可以startLeDiscovery()在Eclipse中成功调用该方法.源代码如下图所示.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
IntentFilter intent = new IntentFilter();
intent.addAction(BluetoothDevice.ACTION_FOUND);
intent.addAction(BluetoothDevice.EXTRA_UUID);
intent.addAction(BluetoothDevice.ACTION_GATT_PRIMARY_UUID);
registerReceiver(searchDevices, intent);
//bluetooth.discovery();
bluetooth.startLeDiscovery();
}
private BroadcastReceiver searchDevices = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
BluetoothDevice device = null;
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
String msg = device.getName()+"\n"+device.getAddress();
Log.i("hella",msg);
bluetooth.cancelDiscovery();
connectDevice(device); …Run Code Online (Sandbox Code Playgroud) 执行后systemctl start docker,我得到:
无法启动docker.service:找不到单位.
这是输出systemctl status docker -l:
[root@HP11012078 init.d]# systemctl status docker -l
? docker.service - Docker Application Container Engine
Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: https://docs.docker.com
Feb 09 17:04:35 HP11012078 docker[28152]: time="2017-02-09T17:04:35.104333869+08:00" level=warning msg="container 58a5c6ba6710240bb5b1fd79e4600b547cf4c882eb2ca85e15c59c1404106877 restart canceled"
Feb 09 17:04:35 HP11012078 docker[28152]: time="2017-02-09T17:04:35.113914527+08:00" level=warning msg="container d320ba5f02cdd8567893acfc62b6673a24b6c8a43ccb52342bb3470ff420230d restart canceled"
Feb 09 17:04:35 HP11012078 docker[28152]: time="2017-02-09T17:04:35.122613873+08:00" level=warning msg="container 4030daadb9481a1b96b7a5c614c8910a601f83f2dced8340f4ea4c3583e7e844 restart canceled"
Feb 09 17:04:45 HP11012078 docker[28152]: time="2017-02-09T17:04:45.002120051+08:00" level=info msg="Container c13f11ce792c477d9b663c6fdbcfe9694663f7843a40540c58922893f4b41247 failed …Run Code Online (Sandbox Code Playgroud) 我今天在尝试安装和设置最新版本的apache时遇到此错误消息,每当我输入时httpd,cmd我都会得到:
AH00558:httpd:无法使用fe80 :: bd5f:7651:b4a3:3a1a可靠地确定服务器的完全限定域名.全局设置"ServerName"指令以禁止显示此消息
SpamAssassin 将我的电子邮件标记为 BAYES_99 原因,这意味着该电子邮件是 99% ~ 100% 垃圾邮件。SpamAssassin 检测此规则的机制是什么(通过关键字?),以及如何避免达到此规则?
我有一个Facebook页面选项卡应用程序(使用时间轴).它在桌面版的Facebook中运行良好,但是当在Facebook App中点击它的Wall Post时,它会返回"找不到你请求的页面"并转发到一个无法访问的链接:
https://m.facebook.com/4oh4.php?id=282832318433409&_rdr
Run Code Online (Sandbox Code Playgroud)
怎么会?我不希望移动版本与桌面版本相同,但我不指望它报告页面无法找到.
永远不会调用onRegistered方法,在logcat中我看到最后一行是获取唤醒锁.
- 09-26 14:03:23.285:D/GCMRegistrar(15820):重置退避
- 09-26 14:03:23.285:V/GCMRegistrar(15820):注册app*a发件人735175912799
- 09-26 14:03:23.895:V/GCMBroadcastReceiver(15820):onReceive: - com.google.android.c2dm.intent.REGISTRATION 09-26 14:03:23.895:V/GCMRegistrar(15820):设置名称重试接收器类到*.notifications.MyGCMBroadcastReceiver
- 09-26 14:03:23.895:V/GCMBroadcastReceiver(15820):GCM IntentService类: - *.notifications.GCMIntentService
- 09-26 14:03:23.903:V/GCMBaseIntentService(15820):获取唤醒锁
我有自己的Broadcastreceiver:
import com.google.android.gcm.GCMBroadcastReceiver;
public class MyGCMBroadcastReceiver extends GCMBroadcastReceiver {
@Override
protected String getGCMIntentServiceClassName (Context context) {
return GCMIntentService.class.getCanonicalName();
}
}
Run Code Online (Sandbox Code Playgroud) 我阅读了几个关于JMX和VisualVM的链接,但是仍然有一些关于它们的问题.
据我了解,JMX和VisualVM是两种不同的JVM监控工具.此外,JMX还具有API,Java应用程序可以将其合并,并允许监视工具更好地监视应用程序.
有人可以澄清这种理解是正确还是有缺陷?如果有缺陷,你能否指出更好地解释这种差异/比较的文章?
此外,我何时使用JMX或VisualVM来监控托管在Tomcat 6.1服务器上的基于Java的Web应用程序?
我尝试运行一些
python manage.py shell_plus --notebook --settings=my_app.settings.andi
Run Code Online (Sandbox Code Playgroud)
但它失败了,错误:
Unknown command: 'shell_plus'
Type 'manage.py help' for usage.
Run Code Online (Sandbox Code Playgroud)
我安装了ipython和shell_plus(从我的pip冻结)
django-shell-plus==1.1.5
ipython==1.2.1
Run Code Online (Sandbox Code Playgroud)
怎么处理呢?
对我而言,这是一个新的东西,所以我只是研究这个并试图理解它.正如您在php脚本中看到的那样,有两个函数,我试图用jquery调用一个特定的函数.
现在,如果我有一个功能,那么我可以做到,但是当我有2个或更多时,我开始卡住了.我想,当我有2个函数时,我可以做到这一点,但是只要有更多的变量在运行或更多的函数,我只是在我的php中制作大量的if语句?
问题是,当我附加数据库时,我需要考虑可能发生的所有输入. 使用jquery&ajax时如何指定特定的php函数?
//function.php
<?php
function firstFunction($name)
{
echo "Hello - this is the first function";
}
function secondFunction($name)
{
echo "Now I am calling the second function";
}
?>
<?php
$var = $_POST['name'];
if(isset($var))
{
$getData = firstFunction($var);
}
else if(isset($var))
{
$getData = secondFunction($var);
}
else
{
echo "No Result";
}
?>
//index.html
<div id="calling">This text is going to change></div>
<script>
$(document).ready(function() {
$('#calling').load(function() {
$.ajax({
cache: false,
type: "POST",
url: "function.php",
data: 'name=myname'
success: function(msg)
{ …Run Code Online (Sandbox Code Playgroud) 我需要一个仅在主键存在时才可以删除主键的查询。
ALTER TABLE tablename DROP PRIMARY KEY;
Run Code Online (Sandbox Code Playgroud)
如果不存在,这将返回错误,但我的要求是在不同的数据库中运行查询。
ajax ×1
android ×1
apache ×1
bluetooth ×1
constraints ×1
django ×1
django-shell ×1
docker ×1
facebook ×1
java ×1
jmx ×1
jquery ×1
monitoring ×1
mysql ×1
performance ×1
php ×1
python ×1
spamassassin ×1
visualvm ×1
windows-10 ×1