首页 文章 精选 留言 我的

精选列表

搜索[AI测试],共10000篇文章
优秀的个人博客,低调大师

android 监听SDCard安装和卸载的代码片段(测试通过)

// 监听类private final BroadcastReceiver sdcardListener = new BroadcastReceiver() { @Overridepublic void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.d("TAG", "sdcard action:::::" + action);if(Intent.ACTION_MEDIA_MOUNTED.equals(action)|| Intent.ACTION_MEDIA_SCANNER_STARTED.equals(action)|| Intent.ACTION_MEDIA_SCANNER_FINISHED.equals(action) ){// SD卡成功挂载 } else if(Intent.ACTION_MEDIA_REMOVED.equals(action)|| Intent.ACTION_MEDIA_UNMOUNTED.equals(action)|| Intent.ACTION_MEDIA_BAD_REMOVAL.equals(action) ){// SD卡挂载失败 } } };// 注册监听 private void registerSDCardListener(){ IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED); intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED); intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED); intentFilter.addAction(Intent.ACTION_MEDIA_REMOVED); intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED); intentFilter.addAction(Intent.ACTION_MEDIA_BAD_REMOVAL); intentFilter.addDataScheme("file"); registerReceiver(sdcardListener, intentFilter); } 使用完成后注销监听: unregisterReceiver(sdcardListener);

优秀的个人博客,低调大师

随机生成50个字段的elasticsearch的测试程序输入

词典位置:https://raw.githubusercontent.com/jonbcard/scrabble-bot/master/src/dictionary.txt import json from random import sample, randint from uuid import uuid4 def gen_random_words(): with open("D:\\exp\\test_data\\dictionary.txt") as f: words = [word.strip() for word in f] f.close() # print "OK. words length:", len(words) return sample(words, 3000) return [] total_words = 0 def sample_words(search_words, random_words): global total_words sample_cnt = 1000 for word in random_words: total_words += 1 if len(search_words) < sample_cnt: search_words.append(word) else: if randint(1, total_words) <= sample_cnt: kick_off = randint(0, sample_cnt-1) search_words[kick_off] = word def gen_an_event(words, search_words): event_data = {} for i in range(50): query_words = sample(words, randint(1, 10)) sample_words(search_words,query_words) event_data["field-"+str(i)] = " ".join(query_words) return {"event": event_data, "sourcetype": "hec_test2"} if __name__ == "__main__": search_words = [] for i in range(500): words = gen_random_words() index_head = json.dumps({"index" : { "_index" : "hec_test2", "_type" : "hec_type2" } }) es_out_put = "" splunk_out_put = "" for i in range(500): if i == 0: es_out_put += index_head + "\n" else: es_out_put += "\n" + index_head + "\n" event = gen_an_event(words, search_words) splunk_out_put += json.dumps(event) es_out_put += json.dumps(event["event"]) # print es_out_put # print splunk_out_put out_puts = [es_out_put, splunk_out_put] file_name = str(uuid4()) + ".json" for i,dir_name in enumerate(["ES", "Splunk"]): outfile = "D:\\test_data\\%s\\%s" % (dir_name, file_name) f = open(outfile, "w") f.write(out_puts[i]) f.close() print outfile outfile = "D:\\test_data\\search_words.txt" f = open(outfile, "w") f.write(json.dumps(search_words)) f.close() ' 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6599974.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

如何让iOS模拟器也能测试蓝牙4.0程序?

买一个CSR蓝牙4.0 USB适配器,插在Mac上 在终端输入sudo nvram bluetoothHostControllerSwitchBehavior="never" 重启Mac 用Xcode 4.6调试代码,将程序跑在iOS 6.1的模拟器上(苹果把iOS 7.0模拟器对BLE的支持移除掉了) 示例代码:https://github.com/dongbobo1992/iOSExamples 标签: ios模拟器 本文转自 netcorner 博客园博客,原文链接:http://www.cnblogs.com/netcorner/p/4606917.html ,如需转载请自行联系原作者

优秀的个人博客,低调大师

Prometheus exporter的Node exporter是可以独立安装,用来测试的

现在慢慢在把prometheus operator的一些概念组织完整。 https://github.com/coreos/prometheus-operator/tree/master/contrib/kube-prometheus 这个全家桶是值得关注的,里面的概念和步骤要领会。 Node exporter的github地址: https://github.com/prometheus/node_exporter 这里面也提到了用于win的WMI exporter。 窗口级安装命令: docker run -d -p 9100:9100 \ -v "/proc:/host/proc:ro" \ -v "/sys:/host/sys:ro" \ -v "/:/rootfs:ro" \ --net="host" \ quay.io/prometheus/node-exporter \ -collector.procfs /host/proc \ -collector.sysfs /host/sys \ -collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)" 然后,就出来了。

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码