电脑控制android设备
运行
scrcpy -Sw -b 20M
- -S 关闭手机屏幕
- -w 在程序运行时,保持屏幕常亮
- -b 码率20Mbps
快捷键
返回: 鼠标右键
全屏: alt+f
旋转设备: alt+r
旋转窗口: alt+left
控制台输出fps: alt+i
关闭屏幕:alt+o
打开屏幕:alt+shift+o
参考 scrcpy
adb设置android代理
1 | adb connect 127.0.0.1:58526 |
scrcpy -Sw -b 20M
返回: 鼠标右键
全屏: alt+f
旋转设备: alt+r
旋转窗口: alt+left
控制台输出fps: alt+i
关闭屏幕:alt+o
打开屏幕:alt+shift+o
参考 scrcpy
1 | adb connect 127.0.0.1:58526 |
将元素高宽设置为0,然后设置三个方向的border,每个border不是正方形,而是三角形。查看这三个border的形状
.triangle {
width: 0;
height: 0;
border-width: 0 40px 40px;
border-style: solid;
border-color: black red green yellow;
}
所以不设置上方向的border,左右border设置为透明,下border设置为需要的颜色即可绘制方向朝上的三角形。要绘制其他方向的箭头同理。
给上面这个三角形元素添加::after
伪元素,按照上面的方法设置同样的三角形。但是伪元素位置是相对于父元素的contentbox的,所以要添加absolute定位调整伪元素的位置。
div{
width: 0;
height: 0;
border-width: 0 100px 100px;
border-style: solid;
border-color: black transparent green transparent;
position: relative;
}
div::after{
content: '';
border-width: 0 100px 100px;
border-style: solid;
border-color: black transparent white transparent;
position: absolute;
top: 2px;
left: -100px;
}
左右方向带border的三角形就可以作为对话框上的箭头了
<div class="flex">
<div class="triangle"></div>
<section>hello</section>
</div>
<style>
.flex{
display: flex;
align-items: center;
}
.triangle{
width: 0;
height: 0;
border-width: 5px 5px 5px 0;
border-style: solid;
border-color: transparent green transparent black ;
position: relative;
}
.triangle::after{
content: '';
border-width: 5px 5px 5px 0;
border-style: solid;
border-color: transparent white transparent black ;
position: absolute;
top: -5px;
left: 2px;
}
section{
height: 20px;
width: 500px;
border: 1px green solid;
}
</style>
一键安装脚本 curl -O https://raw.githubusercontent.com/atrandys/trojan/master/trojan_mult.sh && chmod +x trojan_mult.sh && ./trojan_mult.sh
1 | chrome.exe --show-app-list --proxy-server="SOCKS5://<address>:<port>" |
1 | mkdir /etc/trojan/ssl |
客户端中remote_addr
为远程的ip地址。
不论主要内容section高度有多高,底栏footer始终保持在最下方
<style>
header {
height:100px;
background-color: green;
}
section {
height: 500px; // 可以任意改变
background-color: red;
}
footer {
height: 100px;
position: -webkit-sticky;
position: sticky;
bottom: 0;
background-color: green;
}
</style>
<body>
<header>HEADER</header>
<section>MAIN</section >
<footer>FOOTER</footer>
</body>
#include <iostream>
#include <string>
using namespace std;
int main(){
string str1, str2, res="";
int count=0;
cin >> str1;
cin >> str2;
for(int i=0; i<str1.size(); i++){
for(int j=0;j<str2.size();j++){
for(int k=0; i+k<str1.size()&&j+k<str2.size()&&
str1[i+k]==str2[j+k];k++){
if(k>count){
count = k;
res = str1.substr(i, k+1);
}
}
}
}
if(res== "") cout<< -1;
cout<< res;
return 0;
}
1 | adb shell #进入shell模式 |
先关闭上滑手势和桌面搜索框再卸载,否则只能重装再卸载了:(
1 | $ pm uninstall --user 0 com.miui.hybrid #首页上滑信息流 |
卸载小米支付相关
1 | $ pm uninstall --user 0 com.unionpay.tsmservice.mi |
1 | $ cmd package install-existing com.vivo.browser |
1 | $ pm list packages [options] <FILTER> |
卸载vivo内置应用
1 | $ pm uninstall --user 0 com.vivo.browser |
market://details?id=com.mipay.in.wallet
使用媒体查询判断是横屏还是竖屏
竖屏页面宽度为全屏
横屏页面宽度收窄
@media screen and (orientation: landscape) {
/* 横屏 */
body {
width: 61.8vh;
margin: auto;
}
}
@media screen and (orientation: portrait) {
/* 竖屏 */
body {
width: 100vw;
}
}
手机只用400px左右的宽度
可以使用@media screen and (min-width: 600px)
和@media screen and (max-width: 600px)
来设置不同样式
最近在VS上开发C++程序时遇到了这个错误:
Debug Assertion Failed! Expression:_pFirstBlock == pHead
①混淆了 Debug和Release情况,有时Debug和Release所需要的库是不一样的,如果你只导入了Release的链接库,而没有导入Debug的链接库,而编译运行时又选择了Debug模式,就可能出现这种问题,这时要把Debug的链接库添加进去可能就会解决。
②可能是在一个多线程模块了运行了一个单线程库,内存在dll一侧被分配,在使用一侧被释放,可能导致一个内存管理器在分配内存,另一个内存管理器在释放同一片内存区域,导致错误。
C++的STL是单线程的,我在函数内部使用了vector,这个函数在一个多线程的环境里,大概就是这个错误产生的原因。
一个解决方式就是设置运行库为/MDd
工程上右键-》属性-》C/C++-》所有选项
关于运行库几个参数
多线程(/MT)
多线程调试(/MTd)
多线程 DLL (/MD)
多线程调试 DLL (/MDd)
名字后带d的是debug库,名字含D是动态链接,含T是静态链接
##获取元素的data-*属性
<p id="app" data-aa="1">如果你点我,我就会消失。</p>
<script>
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
alert($("#app").attr("data-aa"));
$("p").attr("data-aa", 2);
alert($("#app").attr("data-aa"));
});
</script>