09 2020 档案

摘要:在Unity中任何Shader都可以通过下方的这个模板进行扩展。 Shader "Custom/BasicShader"{ Properties{ //_Color: 内部需要注册的参数 //Base Color: 给外部提供的接口名称 //Color: 类型 //等号右边表示该类型下的改参数默认值 阅读全文 »
posted @ 2020-09-30 16:58 艾孜尔江 阅读(139) 评论(0) 推荐(0) 编辑
摘要:#include<stdio.h> typedef void (*intFunc)(int i); // Function pointer void test1(int age) { printf("test1:%d\n\n",age); } void foreachNums(int *nums,i 阅读全文 »
posted @ 2020-09-29 08:27 艾孜尔江 阅读(91) 评论(0) 推荐(0) 编辑
摘要:#include<stdio.h> void mymemset(void *data,int num,int byteSize) { // char就是一个字节,而计算机中是以字节为单位存储的 char *ptr = (char*)data; int i; for(i=0;i<byteSize;i+ 阅读全文 »
posted @ 2020-09-28 22:25 艾孜尔江 阅读(274) 评论(0) 推荐(0) 编辑
摘要:一、冒泡排序 BubbleSort 介绍: 冒泡排序的原理非常简单,它重复地走访过要排序的数列,一次比较两个元素,如果他们的顺序错误就把他们交换过来。 步骤: 比较相邻的元素。如果第一个比第二个大,就交换他们两个。 对第0个到第n-1个数据做同样的工作。这时,最大的数就“浮”到了数组最后的位置上。 阅读全文 »
posted @ 2020-09-28 22:12 艾孜尔江 阅读(93) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(int argc, char *argv[]) { // // Uncleaned // // 下面申请的20个字节的内存有可能被别人用过 // char chs[20]; // // 这个代码打印出来的可能就是乱码,因为printf的%s是“ 阅读全文 »
posted @ 2020-09-28 22:09 艾孜尔江 阅读(480) 评论(0) 推荐(0) 编辑
摘要:#include<stdio.h> #include<string.h> struct _Person { char *name; int age; double height; }; int main(int argc, char *argv[]) { struct _Person p1; // 阅读全文 »
posted @ 2020-09-28 22:08 艾孜尔江 阅读(288) 评论(0) 推荐(0) 编辑
摘要:#include<stdio.h> // 分解一个三位数,传递个位、十位和百位数字 int parseNumber(int num,int* g,int* s,int* b) { if(num < 100 || num > 999) { // 只允许100~999的数字 return -1; } * 阅读全文 »
posted @ 2020-09-28 17:14 艾孜尔江 阅读(111) 评论(0) 推荐(0) 编辑
摘要:C中的内存分配 1.栈 由编译器自动分配释放; 2.堆 一般由程序员分配释放,若程序员不释放,程序结束时可能由OS回收; 3.全局区(静态区),全局变量和静态变量的存储是放在一块的,初始化的全局变量和静态变量在一块区域,未初始化的全局变量和未初始化的静态变量在相邻的另一块区域。 程序结束时被释放; 阅读全文 »
posted @ 2020-09-28 16:45 艾孜尔江 阅读(85) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; void run(); int main() { run(); } void run() { //int i2 = 555, i1 = 666; //if opened, the result will be 1, wh 阅读全文 »
posted @ 2020-09-28 16:23 艾孜尔江 阅读(116) 评论(0) 推荐(0) 编辑
摘要:在Angular项目中,我们在初次运行别人的项目时有可能会出现You have to be inside an Angular CLI project in order to use the serve command. 这样的报错提示,这时首先需要明确自己是否装好了所有的npm包,如果没有装好就得 阅读全文 »
posted @ 2020-09-25 20:37 艾孜尔江 阅读(1379) 评论(0) 推荐(0) 编辑
摘要:平时在Linux机子上安装好一些工具之后我们就需要跑到那个源码安装的程序包里面执行启动命令,这样做比较麻烦,有没有直接在全局都通用的方法呢?也就是启动那些应用或者程序就像使用Linux自带的命令一样简单轻松而不必每次都跑到指定的源码目录中去执行。 查看需要放置在全局的应用在其源码包目录下的启动指令, 阅读全文 »
posted @ 2020-09-20 11:13 艾孜尔江 阅读(5550) 评论(0) 推荐(0) 编辑
摘要:手动显示 在vim命令行模式下输入: set nu ###取消显示 在vim命令行模式下输入: set nonu ###永久显示 修改一个配置文件,输入命令: vim ~/.vimrc 打开后是一个空文件,添加 set nu,保存退出,再次进入vim编辑器,就会自动显示出行号了。 作者:艾孜尔江 阅读全文 »
posted @ 2020-09-17 08:02 艾孜尔江 阅读(1218) 评论(0) 推荐(0) 编辑
摘要:首先需要在机子上安装nginx服务器,可以参照在Linux中安装nginx这篇文章来进行安装和初步地配置; 找到在主服务器上设置的静态资源文件夹的路径,比如,在swoole中就是在document_root这里定义的: 'document_root' => "/home/alexander/Docu 阅读全文 »
posted @ 2020-09-16 21:13 艾孜尔江 阅读(155) 评论(0) 推荐(0) 编辑
摘要:在一次前端开发过程中本人发现一个函数死活就是没有执行,我在里面打点、输出,都呈现未执行的结果。本人在确定这个函数内部代码以及外部调用的方式完全正确(排除this的问题)之后,自己直接拷贝了一份并改了一下这个代码的名称再区调用,这时候它总算是执行了。这就很令人纳闷——之前的不能被执行,该了个函数名就能 阅读全文 »
posted @ 2020-09-16 20:30 艾孜尔江 阅读(170) 评论(0) 推荐(0) 编辑
摘要:平滑重启的上层指令在Linux中需要使用nohup进行,并指定输出log的文件及其位置,在指令末尾记得把“&”符号加上,如下: alexander@alexander-desktop:~/Documents/Refers/SwooleLive/server/thinkphp/script/bin/s 阅读全文 »
posted @ 2020-09-16 09:30 艾孜尔江 阅读(492) 评论(0) 推荐(0) 编辑
摘要:根据自己的需求从官网中下载带有“*.tar.gz”后缀的压缩包,点击官网链接并下载即可; 解压; 进入解压后的目录; 用./configure查看配置指令; 配置nginx,比如按照如下方式配置(路径根据自己的存放路径来): ./configure --prefix=/home/alexander/ 阅读全文 »
posted @ 2020-09-15 21:41 艾孜尔江 阅读(274) 评论(0) 推荐(0) 编辑
摘要:早睡早起占人體健康的百分之七十,心態、飲食、及時調理各占百分之十,我們就可以知道早睡早起的重要性。我們白天是放電,晚上睡覺是充電,晚上只沖了50%的電,白天還要釋放100%,那50%哪來的,就是從五臟借。五臟在古書中為五藏,是藏的意思,藏的就是人體的精華,你總是借,總是借,一般人借15年身體就垮了。 阅读全文 »
posted @ 2020-09-15 15:41 艾孜尔江 阅读(132) 评论(0) 推荐(0) 编辑
摘要:1. 启动 XAMPP /opt/lampp/./lampp start 2. 停止 XAMPP /opt/lampp/./lampp stop 3. 重启 XAMPP /opt/lampp/./lampp restart 4. 安全设置 /opt/lampp/./lampp security 5. 阅读全文 »
posted @ 2020-09-13 09:55 艾孜尔江 阅读(249) 评论(0) 推荐(0) 编辑
摘要:private Texture2D RenderTextureToTexture2D(RenderTexture texture) { RenderTexture RT = RenderTexture.active; RenderTexture.active = texture; Texture2D 阅读全文 »
posted @ 2020-09-11 13:51 艾孜尔江 阅读(852) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// color 转换hex /// </summary> /// <param name="color"></param> /// <returns></returns> public static string ColorToHex(Color color) { i 阅读全文 »
posted @ 2020-09-11 13:49 艾孜尔江 阅读(3169) 评论(0) 推荐(0) 编辑
摘要:public static Texture2D BytesToTexture2D(byte[] bytes, int w = 1920, int h = 1080) { Texture2D texture2D = new Texture2D(w, h); texture2D.LoadImage(by 阅读全文 »
posted @ 2020-09-11 13:48 艾孜尔江 阅读(1124) 评论(0) 推荐(0) 编辑
摘要://压缩字节 //1.创建压缩的数据流 //2.设定compressStream为存放被压缩的文件流,并设定为压缩模式 //3.将需要压缩的字节写到被压缩的文件流 public static byte[] CompressBytes(byte[] bytes) { using (MemoryStre 阅读全文 »
posted @ 2020-09-11 13:47 艾孜尔江 阅读(2001) 评论(0) 推荐(0) 编辑
摘要:private Texture2D TextureToTexture2D(Texture texture) { Texture2D texture2D = new Texture2D(texture.width, texture.height, TextureFormat.RGBA32, false 阅读全文 »
posted @ 2020-09-11 13:46 艾孜尔江 阅读(703) 评论(0) 推荐(0) 编辑
摘要:public static byte[] Color32ArrayToByteArray(Color32[] colors) { if (colors == null || colors.Length == 0) return null; int lengthOfColor32 = Marshal. 阅读全文 »
posted @ 2020-09-11 13:43 艾孜尔江 阅读(1400) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; public class MyClass { struct Name{ public string FirstName; public string LastName; public string Get 阅读全文 »
posted @ 2020-09-10 18:55 艾孜尔江 阅读(270) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Diagnostics; namespace TestListArrayPerformance { class Program { static void Main(string 阅读全文 »
posted @ 2020-09-09 11:01 艾孜尔江 阅读(3323) 评论(0) 推荐(0) 编辑
摘要:![](https://img2020.cnblogs.com/blog/1991547/202009/1991547-20200909103222348-1530715603.png) 阅读全文 »
posted @ 2020-09-09 10:32 艾孜尔江 阅读(811) 评论(0) 推荐(0) 编辑
摘要:![](https://img2020.cnblogs.com/blog/1991547/202009/1991547-20200909101705925-723897119.png) 阅读全文 »
posted @ 2020-09-09 10:17 艾孜尔江 阅读(3024) 评论(0) 推荐(0) 编辑
摘要:当我连着手机充电的时候,启动模拟器调试,执行ADB指令时,报错。 C:\Users\Alexander>adb shell error: more than one device and emulator C:\Users\Alexander>adb install e:\good.apk erro 阅读全文 »
posted @ 2020-09-08 08:33 艾孜尔江 阅读(2587) 评论(0) 推荐(0) 编辑
摘要:class http_server { const HOST = "127.0.0.1"; const PORT = 8811; protected $server = null; public function __construct() { $this->server = new swoole_ 阅读全文 »
posted @ 2020-09-07 10:17 艾孜尔江 阅读(512) 评论(0) 推荐(0) 编辑
摘要:using System.Collections; using System.Collections.Generic; using UnityEngine; /*by Alexander*/ public class PositionChangerManager : MonoBehaviour { 阅读全文 »
posted @ 2020-09-01 09:49 艾孜尔江 阅读(1941) 评论(0) 推荐(0) 编辑
摘要:bool ScaleObject(GameObject myObject, int type = 1, float offset = 0.1f) { switch (type) { case -1: myObject.transform.localScale = new Vector3(myObje 阅读全文 »
posted @ 2020-09-01 08:52 艾孜尔江 阅读(6081) 评论(0) 推荐(0) 编辑

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