02 2021 档案

摘要:webman 关于数据库性能 webman链接数据库用的是单例模式 就是用户链接一次 第二次就不需要链接 多个用户就是多个链接1次 public function __construct($pdo, $database = '', $tablePrefix = '', array $config = 阅读全文
posted @ 2021-02-27 20:19 newmiracle宇宙 阅读(503) 评论(0) 推荐(0) 编辑
摘要:虚拟机centos安装方法 http://mirrors.nju.edu.cn/centos/7.9.2009/isos/x86_64/ 要装dvd版本 64bit就行了 阅读全文
posted @ 2021-02-26 12:40 newmiracle宇宙 阅读(58) 评论(0) 推荐(0) 编辑
摘要:<?php function test1(){ echo 'test1'; } function test2(){ echo 'test2'; } spl_autoload_register('test1',true,true); spl_autoload_register('test2',true 阅读全文
posted @ 2021-02-24 16:22 newmiracle宇宙 阅读(70) 评论(0) 推荐(0) 编辑
摘要:php 根据ip获取地区的方法 <?php $ip=$_GET['ip']; header("Content-type:text/html;charset=utf-8"); require('phpQuery/phpQuery.php'); $info=file_get_contents("http 阅读全文
posted @ 2021-02-23 21:41 newmiracle宇宙 阅读(732) 评论(0) 推荐(0) 编辑
摘要:基准测试中 tp 是1200 webman是 1W5 webman在基准测试中优势还是很大的 但是加了数据库操作 就优势不明显了 webman 只有200多了 tp也是200多 相差不多 总结 如果在接口里要高并发 那就不要用数据库操作 全部用缓存 并发能力才能达到几千 阅读全文
posted @ 2021-02-23 09:47 newmiracle宇宙 阅读(2233) 评论(2) 推荐(1) 编辑
摘要:webman快速入门1 1 数据库操作 安装直接看文档 我比较喜欢原生的写法 这里没用连接池 因为他用单利模式 也反复用 性能不比用了连接池差 //返回值:方法总会返回结果的数组数据。数组中的每个结果都是一个 PHP StdClass 对象,这使你能够访问到结果的 $results = DB::se 阅读全文
posted @ 2021-02-21 15:21 newmiracle宇宙 阅读(2685) 评论(0) 推荐(1) 编辑
摘要:PHP实现依赖注入 依赖注入 主要是为了解耦 A类调用B类的方法 如果B类方法改了A类也要改 这样耦合度非常高 维护起来也麻烦 主要是因为还要关注A类的逻辑 依赖注入的出现就是B类方法改了 不用关注A类的实现 去改个配置文件就行 简单的说就是A类调用B类的方法是基于配置文件实现(获取其他方法 也是L 阅读全文
posted @ 2021-02-20 12:32 newmiracle宇宙 阅读(307) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <title></title> <meta charset="utf-8"> <meta name="generator" content="Three.js Editor"> <meta name="viewport" 阅读全文
posted @ 2021-02-18 21:37 newmiracle宇宙 阅读(212) 评论(0) 推荐(0) 编辑
摘要:publish生成的代码没办法把自己写的事件嵌入进去 所以我想自己写事件代码可以运用上去 这样UI和事件耦合度更低 <!DOCTYPE html> <html lang="en"> <head> <title></title> <meta charset="utf-8"> <meta name="g 阅读全文
posted @ 2021-02-18 18:22 newmiracle宇宙 阅读(229) 评论(0) 推荐(0) 编辑
摘要:pixijs webgl模式实现刮刮卡的方法 const app = new PIXI.Application({ width: 750, height: 1206, antialias: true}); var guanbi = PIXI.Sprite.from('/moban/images/cl 阅读全文
posted @ 2021-02-11 10:10 newmiracle宇宙 阅读(501) 评论(0) 推荐(0) 编辑
摘要:canvas完美实现刮刮卡的方法 var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.fillStyle="red"; ctx.fillRect(20,20,75,50); ctx.globalComp 阅读全文
posted @ 2021-02-10 22:06 newmiracle宇宙 阅读(161) 评论(0) 推荐(0) 编辑
摘要:识别canvas和webgl的方法 var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); console.log(ctx); 返回的是CanvasRenderingContext2D 这类 var c=docum 阅读全文
posted @ 2021-02-10 22:05 newmiracle宇宙 阅读(289) 评论(0) 推荐(0) 编辑
摘要:javascript 放大缩小精灵升级版 function xuanzhuanactnew(dianthat, dianjix, dianjiy, zhongxinx, zhongxiny){ var newangle = getjiaodu(dianjix, dianjiy, zhongxinx, 阅读全文
posted @ 2021-02-10 14:01 newmiracle宇宙 阅读(52) 评论(0) 推荐(0) 编辑
摘要:threejs 自适应需要注意的问题 renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight,false); renderer = new THREE.WebGLRend 阅读全文
posted @ 2021-02-08 18:42 newmiracle宇宙 阅读(555) 评论(0) 推荐(0) 编辑
摘要:PHP实现SSO单点登陆 必须都是同个顶级域名下 直接用cookie setcookie("ticket", md5(time().$user_id), time() + 1000, "/", "newmiracle.cn"); //*.newmiracle.cn都设置了 $redis->set(m 阅读全文
posted @ 2021-02-07 20:58 newmiracle宇宙 阅读(180) 评论(0) 推荐(0) 编辑
摘要:threejs editor源码解析1 今天先看看 这个功能的实现 这个实现就是用了 javascript signals 框架 异步通信 这么做就是为了解耦 渲染和逻辑 分离 这个跟vuejs一样 找到editor\js\commands\SetPositionCommand.js 这个文件 发布 阅读全文
posted @ 2021-02-07 15:38 newmiracle宇宙 阅读(1739) 评论(0) 推荐(0) 编辑
摘要:$('.scpicinput').change(function() { $('.jiazaicontainer').css('display', 'block'); var file = this.files[0]; if (file) { var rFilter = /^(image\/jpeg 阅读全文
posted @ 2021-02-03 18:04 newmiracle宇宙 阅读(297) 评论(0) 推荐(0) 编辑
摘要:shader glsl 函数图举例 转载https://juejin.cn/post/6844903671705108487 Shader 函数可视化 一、正弦余弦 正弦运动:y = sin(x) 余弦运动:y = cos(x) 动画演示: 通过给sin()和cos()添加一些处理,可以制作出更多有 阅读全文
posted @ 2021-02-03 13:10 newmiracle宇宙 阅读(1098) 评论(0) 推荐(0) 编辑
摘要:pixijs释放纹理的方法 有些时候 图片纹理不再需要应该要及时释放掉 const perlin1 = PIXI.Texture.from(bgkuang.sppic); var filter = new PIXI.Filter(null, fragment, { customUniform: 0. 阅读全文
posted @ 2021-02-01 20:55 newmiracle宇宙 阅读(233) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示