- 博客(22)
- 资源 (1)
- 收藏
- 关注
原创 W≡(X-μ)/σ使得E[W]=0且 V[W]=1
我们需要证明 𝐸[𝑊] = 0 且 𝑉 [ 𝑊 ] = 1,其中。由于E[w]为0,则u为0,则V[w] = E[W^2]𝐸 [ 𝑊 ] 根据期望的线性性质。所以 𝐸 [ 𝑊 ] = 0。计算 𝑉 [ 𝑊 ]
2025-03-04 15:50:59
108
原创 openpyxl 复制某些带图片的Excel时出现 KeyError: ‘.mpo‘
解决方案在操作图片的py的头部加入如下代码:from PIL import JpegImagePluginJpegImagePlugin._getmp = lambda x:Nonemime = mimetypes.types_map[True][ext]KeyError: '.mpo’使用Openpyxl 操作Excel里的图片时出现以上错误,百度了也没有,去google逛了一圈,发现是有一种image的mime类型为.mpo,而我的Excel里的图片明明为.png格式的。样例如下:&
2021-10-04 09:50:13
2282
1
原创 openpyxl复制图片问题
openpyxl使用单元格的values复制时,发现只能复制文字和文字的格式,但是图片丢失解决办法:处理文字之后,再单独处理一遍图片openpyxl非常强大,可以直接获取图片列表for image in ws._images: ws2.add_image(image) #print(image.anchor._from.row ) 可以获取图片的行 #print(image.anchor._from.col ) 图片的列ws是需要复制图片的源sheet,ws2是目标she
2021-10-03 10:18:54
5108
6
原创 python numpy获取int/float最大最小值
np.iinfo(np.int32).minnp.iinfo(np.int32).max#获取Int的最大值最小值np.finfo(np.float32).maxnp.finfo(np.float32).max#获取float的最大值最小值
2021-08-30 13:33:36
6902
原创 Android10修改图标/字体大小
先上结论修改packages/apps/Launcher3/res/xml/device_profiles.xml里launcher:iconImageSize="24"launcher:iconTextSize="24"这样的地方即可追源码过程网上大部分都说改dimens.xml里的iconsize,改了编译之后发现不管用,于是自己找现在packages/apps/找到Launcher3这个相关内容是控制桌面显示的进入src/com/android/launcher3找icon相关
2021-01-18 10:26:15
1785
原创 $(word n,text)的含义
最近看android源码的时候遇到了这个$(word 1,$(product_names))不知道是什么意思百度也百度不到Google了一下,有如下解释$(word n,text)Returns the nth word of text. The legitimate values of n start from 1. If n is bigger than the number of words in text, the value is empty.大概意思是text是一大堆字符串组成的句子
2021-01-06 15:11:32
2599
转载 android记步传感器获取不到数据
我的问题是没有申请运动数据权限首先静态申请,AndroidManifest.xml里填写 <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>6.0以上版本动态申请权限还有就是,这个数据的获取是在onSensorChanged()里获取的这就要求你动一动手机我盯了手机半天没反应,以为没获取到,后来晃一下就有了…参考链接:android自带步数传感器获取不到数据问题...
2020-12-26 15:54:34
1288
原创 Intent安装apk时出现解析包出错,无法安装,解决
查看好fileprovider的路径没有问题的话再在xml中申请权限,并且动态申请以下权限: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name=
2020-12-18 15:53:32
1122
8
原创 编译错误error: incompatible types: Preference cannot be converted to ListPreference
error: incompatible types: Preference cannot be converted to ListPreference遇到这种沙雕错误,我找了好久也没找到答案后来知道了看一看其他的应用里怎么用preference的,看到自己的包依赖不是androidximport android.preference.Preference;import android.preference.xxxx;改成 androidx的依赖, 啪的一下,很快啊,就不报错了import
2020-12-07 18:18:29
3825
原创 编译错误 error New address family defined, please update secclass_map.解决
In file included from scripts/selinux/genheaders/genheaders.c:19:./security/selinux/include/classmap.h:245:2: error: #error New address family defined, please update secclass_map.#error New address family defined, please update secclass_map.-git a/scr
2020-11-13 12:41:08
9286
原创 Android编译解决System.img过大问题 build_image.py - ERROR
build_image.py - ERROROut of space? Out of inodes? The tree size of ******** is 1798254592 bytes (1714 MB), with reserved space of 0 bytes (0 MB).The max image size for filesystem files is 1677721600 bytes (1600 MB), out of a total partition size of 1572
2020-10-23 14:15:11
6430
5
原创 RecyclerView实现下拉刷新添加条目
首先自己写一个简单的RecyclerView,这里不再赘述,不会写的请参考我的上篇文章RecyclerView的简单使用 超级详细接下来实现刷新效果首先,在RecyclerView控件的外侧添加控件SwipeRefreshLayout如果找不到该控件,请在build.gradle中添加 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'如果报错,请在File—>Project Structure
2020-10-19 11:12:44
484
2
原创 RecyclerView的简单使用 超级详细
RecyclerView控件可以实现和ListView相同的效果,但是效果更好,能实现的效果更多,且性能更高能够实现1. 竖向(横向)单列条目滚动,类似ListView2. 竖向(横向)多列滚动3. 瀑布流下面开始介绍实现RecyclerView的流程下面是具体实现1.首先添加RecyclerView控件在activity_main.xml中添加RecyclerView控件,并设置id,注意是widget下的RecyclerView,如果不自动提示,请手动在build.gradl
2020-10-15 15:51:58
665
3
android轮播图实现(ViewPager)
2020-12-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人