背景

在win上访问外部的网站网速比较快,但是日常开发又在macbook上,因此需要两台电脑能数据共享,一开始是想通过微信的,但是同一个账号不能同时登陆;用网盘传输之类的,又要额外下载应用或者依赖浏览器。既然是个人使用,可以直接在win上创建共享目录来解决。

操作

设置共享目录

在win上设置个人目录

1.png

阅读更多

前言

4月就要待业家中,经过一两天的踌躇,觉着这其实是一个蛮好的学习与重新调整的机会,后面学习是不会有人提供薪水了,那自然可以更自由些。不过漫无目的的学习的效率比较低,可以根据BOSS上的岗位的关键词去了解相关的技术。

自己喜欢折腾,对Python也蛮有兴趣,先学习下Flask

安装

1
pip3 install Flask

如果遇到网的问题,可以Google搜索pip 换源,现在安装一些工具确实是没有什么门槛

显示下安装后的效果

1
pip3 show Flask

2025-03-27 11.59.35.png

阅读更多

前言

很久没写博客,重新恢复写作后,发现hexo deploy 无法推送了,一直报无权限,检查了~/.gitconfig账号是对的,按参考一在~/.ssh/config中加了公钥

按要求eval "$(ssh-agent -s)"

1
2
3
4
Host *.github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/whz1992gt_github_home

指定github.com使用该公钥,但是还是失败。

阅读更多

仅记录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<dict>
<key>URL</key>
<string>http://dev.skyfox.org/udid/receive.php</string> <!--接收数据的接口地址-->
<key>DeviceAttributes</key>
<array>
<string>UDID</string>
<string>IMEI</string>
<string>ICCID</string>
<string>VERSION</string>
<string>PRODUCT</string>
</array>
</dict>
<key>PayloadOrganization</key>
<string>dev.skyfox.org</string> <!--组织名称-->
<key>PayloadDisplayName</key>
<string>查询设备UDID</string> <!--安装时显示的标题-->
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadUUID</key>
<string>3C4DC7D2-E475-3378-489C-0BB8D737A653</string> <!--自己随机填写的唯一字符串-->
<key>PayloadIdentifier</key>
<string>dev.skyfox.profile-service</string>
<key>PayloadDescription</key>
<string>本文件仅用来获取设备ID</string> <!--描述-->
<key>PayloadType</key>
<string>Profile Service</string>
</dict>
</plist>

Socket

套接字(socket)是一个抽象层,应用程序可以通过它发送或接收数据,可对其进行像对文件一样的打开、读写和关闭等操作。套接字允许应用程序将I/O插入到网络中,并与网络中的其他应用程序进行通信。网络套接字是IP地址与端口的组合。

大部分系统都提供了一组基于TCP或者UDP的应用程序编程接口(API),该接口通常以一组函数的形式出现,也称为套接字(Socket)

阅读更多

前言

  平常用的颜色宏大概如下

1
#define RGBHex(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

  考虑到蓝湖中获得的十六进制颜色值为#FF0000,cv时需要先删除#再添加0x,想省略这部分

实现

  C语言宏中’#’称之为字符串化操作符(Stringizing Operator),它将函数宏的实际参数转换为对应的字符串常量。利用这个特点定义如下的颜色宏

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#define HEXA(COLOR,A) ({ \
char *color = #COLOR;\
NSString *colorString = [NSString stringWithUTF8String:color]; \
colorString = [colorString stringByReplacingOccurrencesOfString:@"#" withString:@""]; \
colorString = [colorString stringByReplacingOccurrencesOfString:@"0x" withString:@""]; \
unsigned int red,green,blue; \
NSRange range; \
range.length = 2; \
range.location = 0; \
[[NSScanner scannerWithString:[colorString substringWithRange:range]] scanHexInt:&red]; \
range.location = 2; \
[[NSScanner scannerWithString:[colorString substringWithRange:range]] scanHexInt:&green]; \
range.location = 4; \
[[NSScanner scannerWithString:[colorString substringWithRange:range]] scanHexInt:&blue]; \
[UIColor colorWithRed:red/255.0f green:green/255.0f blue:blue/255.0f alpha:A]; \
})

#define HEX(COLOR) HEXA(COLOR,1.0)

  支持0xFF0000/#FF0000/FF0000这三种格式

环境

macOS Mojave Version 10.14.3
Xcode 10.1
iPhone 5s 10.0.1
node v11.10.0
npm 6.7.0
React Native 0.58
react 16.6.3

新建ReactNative项目

1
2
brew install node
brew install watchman

安装React Native命令行工具

1
npm install -g react-native-cli

安装Xcode及命令行相关工具


或者

阅读更多

环境

macOS Mojave 10.14.3
Xcode10.1
iPhone6S 10.0.1

获得崩溃日志

方式一:Xcode

菜单 > Window > Devices and Simulators

选择设备并查看设备日志(View Device Logs)

方式二:手机

设置 > 隐私 > 诊断与用量 > 诊断与用量数据

阅读更多

前言

《编译原理》中提到

编译器的第一个步骤是词法分析(Lexical Analysis)或扫描。词法分析器读入组成源程序的字符流,并且将它们组织成为有意义的词素(lexeme)的序列。对于每个词素,词法分析产生如下形式的词法单元(token)作为输出:
<token-name,attribute-value>
token-name 是一个语法分析步骤要使用的抽象符号
attribute-value指向符号表中关于这个词法单元的条目

实验

1
2
3
4
5
6
7
8
9
10
11
int main(){
@autoreleasepool {
int initial = 8;
int six = 6;
NSString* site = [[NSString alloc] initWithUTF8String:"starming"];
int rank = initial + six;
int position = initial + rank * 60;
NSLog(@"%@ rank %d", site, position);
}
return 0;
}

阅读更多

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×