V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  LLaMA2  ›  全部回复第 42 页 / 共 45 页
回复总数  893
1 ... 34  35  36  37  38  39  40  41  42  43 ... 45  
❮ ❯
2021 年 1 月 23 日
回复了 pkwenda 创建的主题 › 问与答 › 有没有专门进设置 bios 的键盘卖?
来个最便宜的键盘和 2 瓶 502,你懂我意思吧
2020 年 12 月 23 日
回复了 abersheeran 创建的主题 › Android › 求一款机型窄的现代安卓机~
1+ 7T
width:74.5mm
2020 年 11 月 25 日
回复了 twg 创建的主题 › 信息安全 › 求大佬给点思路,web api 接口怎么防止被恶意重复访问?
假定你的接口叫 api,GET 请求, 且传递的参数是 data=abc 。

为了防止恶意重放攻击,可以实现如下:

api?data=abc&time=时间戳&code=1000&hash=xxxx

其中 hash 规则是 md5(abc + 时间戳 + 干扰码)

时间戳和 time 的保持一致,为了后端做超时检测, 干扰码和 code=1000 存在对应关系。

即你有一张表,事先生成了一堆序号和干扰码,干扰码对应的序号只有你和 APP 知晓,保证不能泄漏(实际上坏人需要花时间破解)

你每次收到消息后按照同样的方法计算 hash 比较,发现 hash 比对不上,就说明数据被篡改,时间戳超时可能是重放。服务器就直接丢弃,返回错误给前端
mosquito
Geek 一点,一部手机也可以做到你的需求,手机使用 BLE 蓝牙和 PC 通讯,手机上写个程序检测各种手势。将手势编码后传递给 PC,PC 上写个程序解码后调用系统 API 完成各项功能,纯属无聊,买现成的最好啦!!!
我是陈老师,我在 LA,遇到一些很坏的人,你找个项目需要转账 300 快![dog]
2020 年 11 月 11 日
回复了 rqxiao 创建的主题 › Java › 求教 Java 中 http 长轮询机制怎么实现
()->{
while(true) {
try{
String respone = http.setTimeout(120*1000).AsyncRequest(URI);
// parse response...............
Sleep(1*1000);
} catch(Exception e) {

}
}
}
传输大量也没问题
2020 年 11 月 9 日
回复了 ob 创建的主题 › Java › Java 有没有类似 Python 启用 HttpServer 的服务?
你可能需要熟练使用 screen 或 nohup 命令
可以工作,但不合规,上次有个对接的,由于他的代码和 Android 不兼容,结果没得办法,直接 secretKey.getEncoded()写死
Show me your code!
2020 年 11 月 4 日
回复了 lyuxiuchen 创建的主题 › 程序员 › 0 基础想自己开发个安卓应用
2020 年 10 月 29 日
回复了 laminux29 创建的主题 › 问与答 › USB 协议以及 USB 设备的问题
Windows OTG windows10 LTSC 使用者发出了该条信息,外置设备是 samsung T3 protable SSD
2020 年 10 月 25 日
回复了 youla 创建的主题 › Android › Android 播放视频遇到这种异常可以捕获吗?
把你的视频丢给他,告诉他,你的 SDK 播放不了我的视频
2020 年 10 月 25 日
回复了 youla 创建的主题 › Android › Android 录屏相关,会弹出一个请求屏幕录制权限的对话框。
@youla 负责人 review 代码吗?如果不 review 你就自己实现,这个简单,而且 @thetbw 说的 scrcpy 的方法更好,还不需要 root,画质没问题。可以调节码率的

如果你写出来的比人家的 Jar 好用,又没有 BUG,我想不出人家的 Jar 有什么魔法让你的负责人要用
2020 年 10 月 23 日
回复了 youla 创建的主题 › Android › Android 录屏相关,会弹出一个请求屏幕录制权限的对话框。
2|shell@msm8909:/ $ screenrecord --help
Usage: screenrecord [options] <filename>

Android screenrecord v1.2. Records the device's display to a .mp4 file.

Options:
--size WIDTHxHEIGHT
Set the video size, e.g. "1280x720". Default is the device's main
display resolution (if supported), 1280x720 if not. For best results,
use a size supported by the AVC encoder.
--bit-rate RATE
Set the video bit rate, in bits per second. Value may be specified as
bits or megabits, e.g. '4000000' is equivalent to '4M'. Default 4Mbps.
--bugreport
Add additional information, such as a timestamp overlay, that is helpful
in videos captured to illustrate bugs.
--time-limit TIME
Set the maximum recording time, in seconds. Default / maximum is 180.
--verbose
Display interesting information on stdout.
--help
Show this message.

Recording continues until Ctrl-C is hit or the time limit is reached
2020 年 10 月 23 日
回复了 youla 创建的主题 › Android › Android 录屏相关,会弹出一个请求屏幕录制权限的对话框。
哦, 你是自己的程序是把,那就 screencap 命令啊!
2020 年 10 月 15 日
回复了 philon 创建的主题 › Android › Android 手机是否有像 iPhone 一样的后台蓝牙 BLE 广播
BLE 分为 Peripheral 和 Central 模式
对应起来有点类似 Peripheral(Server) 和 Central ( Client )
大于 4.4 的设备可以开启 Peripheral 外围模式
你需要打开手机的 BlueTooth 并给予 ACCESS_COARSE_LOCATION 和 ACCESS_FINE_LOCATION 权限
否则 Central 中心模式的设备无法扫描到你

Peripheral 开启前你需要准备好 BLE 的 BluetoothGattService,和该 service 下的 BluetoothGattCharacteristic,以及 characteristic 下的 BluetoothGattDescriptor

其次 BluetoothGattCharacteristic 分为可读 可写,BluetoothGattDescriptor 分为可读可写可通知可指示

至于 Central 模式,网络上的 Demo 很多
1 ... 34  35  36  37  38  39  40  41  42  43 ... 45  
❮ ❯
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2070 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 31ms · UTC 14:12 · PVG 22:12 · LAX 06:12 · JFK 09:12
♥ Do have faith in what you're doing.