This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
@version: 0.3 | |
@author: endoffiht | |
@file: yunfile_downloader.py | |
@time: 15/6/29 18:06 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <PubSubClient.h> | |
#include <ESP8266WiFi.h> | |
const char* ssid = "................."; | |
const char* password = "................"; | |
char* topic = "esp8266_arduino_out"; | |
char* server = "iot.eclipse.org"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 api.ad.xiaomi.com | |
127.0.0.1 sdkconfig.ad.xiaomi.com | |
127.0.0.1 ad.mi.com | |
127.0.0.1 ad.xiaomi.com | |
127.0.0.1 ad1.xiaomi.com | |
127.0.0.1 adv.sec.miui.com | |
127.0.0.1 test.ad.xiaomi.com | |
127.0.0.1 new.api.ad.xiaomi.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define __DEBUG__ | |
#ifdef __DEBUG__ | |
#define DEBUG(format,...) printf("File: "__FILE__", Line: %05d: "format"/n", __LINE__, ##__VA_ARGS__) | |
#else | |
#define DEBUG(format,...) | |
#endif | |
以上在STM32 System Workbench 编译通过,但是在Xcode 9.3 (Apple LLVM version 9.1.0 (clang-902.0.39.1))编译会提示错误: | |
Invalid suffix on literal; C++11 requires a space between literal and identifier | |
Fix insert" " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "math.h" | |
int getDigits(float d, int digits) | |
{ | |
int tempint = (int)(d / pow(10.0, digits - 1)); | |
return (tempint % 10); | |
} | |
PM25Data[0] = (PM25data/10000)%10 + 0x30; | |
PM25Data[1] = (PM25data/1000)%10 + 0x30; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @Author: Norton-Linux内核研究 | |
* @Date: 2018-04-25 19:41:08 | |
* @Last Modified by: simonliu | |
* @Last Modified time: 2018-04-25 19:41:27 | |
* Source: https://blog.csdn.net/xzongyuan/article/details/29562371 | |
*/ | |
#include <stdio.h> | |
#include "string.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//设置某位为1 | |
number |= 1 << x; // 设置第x位为1 | |
//清除某位 | |
number &= ~(1 << x); // 置第x位为0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @Author: simonliu | |
* @Date: 2018-04-25 21:48:58 | |
* @Last Modified by: simonliu | |
* @Last Modified time: 2018-04-25 22:24:15 | |
*/ | |
#define __Mylog__ | |
#ifdef __Mylog__ | |
#define Mylog(format,...) printf("File: " __FILE__ ", Line: %05d: " format "/n", __LINE__, ##__VA_ARGS__) | |
#else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
多光标编辑 Multi cursor selection | |
基本: Alt+Click 即,按住 Alt 键,依次单击(或者选择)需要编辑的位置,可以依次添加光标。 Alt 键可以在设置中更改。 | |
一列多光标: Shift+Alt+Down 或者 Shift+Alt+Up 可以在上下位置添加光标。 | |
依次选中相同单词: 选中一个单词,按 Ctrl+D ,可以依次选中下一个相同单词。 | |
选中所有相同单词: 选中一个单词,按 Shift+Ctrl+L (shift+cmd+L),可以一次性选中文本中 所有相同单词 。 | |
矩形选择: 按住 Shift+Alt ,再进行选择,则选择区域是一个矩形。 | |
括号选择: Shift+Alt+Right ,会选中匹配括号中的内容,并可以扩大选中区域。 | |
选择相同实例: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Use sublime text to open this file | |
2. Use vi to open the file,then input the following command to switch to hex mode: | |
:%!xxd ——将当前文本转换为16进制格式。 | |
:%!od ——将当前文本转换为16进制格式。 | |
:%!xxd -c 12——将当前文本转换为16进制格式,并每行显示12个字节。 | |
:%!xxd -r ——将当前文件转换回文本格式。 | |
3. emacs | |
emacs filename |
OlderNewer