• python中笛卡尔积的示例

    python中笛卡尔积的示例

    根据一个提问整理的 https://ask.csdn.net/questions/7475427 。 核心需求是,有若干集合(列表),每个集合中的元素数量是相同的: [crayon-66495a9ff04d5593156544/] 期望这些列表元素能如下组合 这个问题的核心是数学中的“笛卡尔积”,如果不知道这个概念解决起来确实挺费脑筋。 根据笛卡尔积的运算,只要将上面的二维数组-excel表格,以"b2"为中心,顺...

  • 使用python下载m3u8在线ts视频并解密合并

    使用python下载m3u8在线ts视频并解密合并

    现在的在线视频都流行使用m3u8格式,加载一个ts网络地址的列表,分段加载视频。 通常,第二个才是ts文件的url列表,并说明是否进行了加密。 m3u8内容的格式比较简单。 这里在macos中使用python结合ffmpeg进行下载: [crayon-66495a9ff0e2c905013563/] 恼人错误就是 ValueError: Data must be padded to 16 byte boundary in CBC mode ,解密时须...

  • macos下pynput.mouse监听鼠标事件无响应

    macos下pynput.mouse监听鼠标事件无响应

    [crayon-66495a9ff11bf989152939/] - end

  • python3使用pybst可视化完全二叉树

    python3使用pybst可视化完全二叉树

    PyBST在Python2中实现了二进制树、AVL树、Splay树和红黑树。此外,PyBST还提供了一个模块,用于使用networkx和matplotlib绘制这些树。 https://pypi.org/project/pybst/ https://github.com/TylerSandman/py-bst 1.pybst的若干准备 在python3中使用,需要做必要的修改。 [crayon-66495a9ff156e163852797/] 首先,修改文件 "/Library/Frameworks/Python.f...

  • uiautomatorviewer抓取Android页面失败的处理

    uiautomatorviewer抓取Android页面失败的处理

    本例场景: 手机:小米2SC,安卓5.0.2/MUI9.2;小米Note3,安卓9/MUI12 ERROR: null root node returned by UiTestAutomationBridge. Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException :Remote object doesn't exits! https://blog.csdn.net/q915730058/article/details/108150792 https://blog.csdn.net/qq_40280920/ar...

  • threejs_r132.使用GPU拾取方法的鼠标射击示例

    threejs_r132.使用GPU拾取方法的鼠标射击示例

    本例参照 https://threejsfundamentals.org/threejs/lessons/zh_cn/threejs-picking.html 原理: 首先,物体有id,并且自身颜色根据id数值计算出的, 然后,获取鼠标点击位置的1像素的颜色值,反推id,将对应物体就移除。 缺陷就是基于颜色,如果场景中颜色很多,及物体的颜色比较相近,在视野比较远时-物体离相机很远,会出现‘隔山打牛’的情况。 let head...

  • threejs_r132.常见材质示例

    threejs_r132.常见材质示例

    let three_script=document.createElement("script");three_script.src="http://www.gaohaiyan.com/dws/walt/three_r132_min.js";let head=document.getElementsByTagName("head")[0];head.appendChild(three_script);three_script.onload=function(){let cinema=new Cinema();cinema.render()};class MeshBasicPlaneActor{constructor(){let mat=new THREE.MeshB...

  • threejs_r132.Points和Line

    threejs_r132.Points和Line

    let three_script=document.createElement("script");three_script.src="http://www.gaohaiyan.com/dws/walt/three_r132_min.js";let head=document.getElementsByTagName("head")[0];head.appendChild(three_script);three_script.onload=function(){let cinema=new Cinema();cinema.render()};class SpherePointsCloudActor{constructor(color,radius,posit...

  • threejs_r132.光源示例

    threejs_r132.光源示例

    threejs里有:环境光 、平行光 、点光 、聚光 、半球光 、面光。 AmbientLight(环境光)颜色会直接作用物体的当前颜色上。 DirectionalLight(平行光源)平行光源,例如太阳光。 PointLight(点光源)一个点射出向所有方向。 SpotLight(聚光灯)聚光灯效果。例如台灯。 HemisphereLight(半球光)创造自然室外光线,模拟反光和光线微弱的天空。 AreaLight...

  • threejs_r132.使用OrbitControls飞行视角示例

    threejs_r132.使用OrbitControls飞行视角示例

    W、S、A、D 或 上、下、左、右 按键。 let new_script=document.createElement("script");new_script.src="http://www.gaohaiyan.com/dws/walt/three_r132_min.js";let head=document.getElementsByTagName("head")[0];head.appendChild(new_script);new_script.onload=function(){let cinema=new Cinema();cinema.animate()};class Cinema{constructor(){this.c...

  • threejs_r132.拆分视窗渲染示例

    threejs_r132.拆分视窗渲染示例

    let three_script=document.createElement("script");three_script.src="http://www.gaohaiyan.com/dws/walt/three_r132_min.js";let head=document.getElementsByTagName("head")[0];head.appendChild(three_script);three_script.onload=function(){main()};class TextLegendSprite{constructor(text="",position=new THREE.Vector3(0,0,0),w=2,h=2,textcolor="...

  • threejs_r132.WebGLRenderer区域渲染示例

    threejs_r132.WebGLRenderer区域渲染示例

    let three_script=document.createElement("script");three_script.src="http://www.gaohaiyan.com/dws/walt/three_r132_min.js";let head=document.getElementsByTagName("head")[0];head.appendChild(three_script);three_script.onload=function(){main()};class Cinema{constructor(){let canvas=document.getElementById("canvas");canvas.width=600;canvas....

  • Android桌面图标长按快捷菜单示例

    Android桌面图标长按快捷菜单示例

    Android 7.1.1 25 Nougat N_MR1 牛轧糖。 示例场景:             --> 功能页E 闪屏A --> 登录B --> 主页C --> 功能页D             --> 功能页F 快捷菜单--------------------------> 功能页D 正常进入C后,A和B都是销毁(finish)的。C保持存活,C退出即程序结束。 从C可以进入D或者E或者F。然后从桌面快捷菜单...

  • 组件化时使用Butterknife出现错误: 元素值必须为常量表达式

    组件化时使用Butterknife出现错误: 元素值必须为常量表达式

    首先在工程的根build.gradle里配置[crayon-66495aa000413082392775/] 然后在基础库组件中引入[crayon-66495aa00041c130505937/] 最后在UI相关组件中引用基础库组件,即自动引入了Butterknife[crayon-66495aa000420182444390/] 最终代码里使用“R2”访问view。[crayon-66495aa000425575936373/] - end

  • 自定义和源图片大小匹配的ImageView及带文字导出bitmap

    自定义和源图片大小匹配的ImageView及带文字导出bitmap

    使用 [crayon-66495aa0007f5716967382/] 自定义View [crayon-66495aa000802243044536/] - end

  • Intent调用其它app时的FileProvider相关

    Intent调用其它app时的FileProvider相关

    本例的SDKversion: [crayon-66495aa000ca8058904727/] AndroidManifest.xml [crayon-66495aa000cb0301885679/] src/main/res/xml/file_paths.xml [crayon-66495aa000cb6017543458/] 文件工具类: [crayon-66495aa000cbc038860937/] 在Intent中使用 [crayon-66495aa000cc1039058875/] - end