2021年11月19日

c++ std::move std::forward

摘要: What's the difference between stdmove and stdforward C++ Rvalue References Explained Modern C++ Tutorial: C++11/14/17/20 On the Fly std::move Long sto 阅读全文

posted @ 2021-11-19 23:42 明天有风吹 阅读(50) 评论(0) 推荐(0)

2021年8月11日

leetcode 正则表达式匹配

摘要: 10. 正则表达式匹配 以确定性的字符串为分界,分而治之。 比如 p = "a*.*c*abcd*e*c*."; s = "ijpqabcxyz";,其中 abc 即为确定性字符串,找到目标字符串 s 中的 abc 出现的位置 也就是把 isMatch("ijpqabcxyz", "a*.*c*ab 阅读全文

posted @ 2021-08-11 22:26 明天有风吹 阅读(89) 评论(0) 推荐(0)

2021年8月6日

图解最长回文子串「Manacher 算法」,基础思路感性上的解析

摘要: 问题描述: 给你一个字符串 s,找到 s 中最长的回文子串。 链接:https://leetcode-cn.com/problems/longest-palindromic-substring #「Manacher 算法」的整体思路是:基于回文字符串的对称性,缓存前面字符的「臂长」信息,以便后面复用 阅读全文

posted @ 2021-08-06 16:31 明天有风吹 阅读(258) 评论(0) 推荐(0)

2021年7月15日

DNS重新绑定攻击

摘要: 来自微信外挂的安全风险 DNS重新绑定攻击 DDNS 动态域名设置 阅读全文

posted @ 2021-07-15 14:19 明天有风吹 阅读(56) 评论(0) 推荐(0)

2021年7月12日

Mac OS ssh 禁用密码登陆

摘要: $ sudo vim /etc/ssh/sshd_config PubkeyAuthentication yes PasswordAuthentication no UsePAM no then: $ sudo launchctl stop com.openssh.sshd $ sudo launc 阅读全文

posted @ 2021-07-12 20:26 明天有风吹 阅读(767) 评论(0) 推荐(1)

2021年7月9日

华为路由器端口映射

摘要: 华为路由器默认后台地址 http://192.168.100.1/ root/adminHW 如果设置无效,记得要换一下「外部端口号」,多尝试几次。我一开始给外部端口号配的 8080,是无法访问的。80 也不行 阅读全文

posted @ 2021-07-09 20:46 明天有风吹 阅读(1487) 评论(0) 推荐(0)

2021年6月30日

You have mail in /var/mail/xxx

摘要: 因为配置 DDNS, 我添加了个 crontab 定时任务,每隔 1 分钟执行一段 python 脚本 然后就发现 terminal 经常提示 'You have mail in /var/mail/xxx' 打开一看,里面都是 python 脚本中 print 的东西,只要不再 print 就不会 阅读全文

posted @ 2021-06-30 21:10 明天有风吹 阅读(443) 评论(0) 推荐(0)

2021年6月27日

cloudflare/DNSPod DDNS 动态域名设置

摘要: 所谓动态域名,就是当你的服务器 IP 地址发生变化的时候,自动地修改你在「域名解析服务商」那里的域名记录值 怎么操作?看官方文档 Use dynamic IP address Update DNS Record DNSPod用户API文档 cloudflare #!/usr/bin/env pyth 阅读全文

posted @ 2021-06-27 23:41 明天有风吹 阅读(1559) 评论(0) 推荐(0)

2021年6月21日

Reinforcement Learning 强化学习入门

摘要: https://www.zhihu.com/question/277325426 https://github.com/jinglescode/reinforcement-learning-tic-tac-toe/blob/master/README.md Intuition After a lon 阅读全文

posted @ 2021-06-21 18:00 明天有风吹 阅读(129) 评论(0) 推荐(0)

2021年6月16日

git clone 设置临时的 proxy

摘要: ss.sh #!/bin/env bash BASEDIR=$(dirname "$0") cd $BASEDIR disable_proxy() { git config --global --unset https.proxy } trap disable_proxy INT git confi 阅读全文

posted @ 2021-06-16 15:41 明天有风吹 阅读(1540) 评论(0) 推荐(0)

2021年2月8日

sublime text 的 Ctrl + P「模糊搜索算法」

摘要: Reverse Engineering Sublime Text’s Fuzzy Match 这是我能 google 到的最早的一篇关于 Sublime Text 的模糊搜索的文章。 https://github.com/forrestthewoods/lib_fts/blob/master/doc 阅读全文

posted @ 2021-02-08 15:11 明天有风吹 阅读(1121) 评论(0) 推荐(0)

2020年12月18日

python 逆序按行读取文件

摘要: How to read a file in reverse order? import os def readlines_reverse(filename): with open(filename) as qfile: qfile.seek(0, os.SEEK_END) position = qf 阅读全文

posted @ 2020-12-18 15:07 明天有风吹 阅读(2863) 评论(0) 推荐(0)

2020年12月9日

python 暴力破解压缩文件 zip 密码

摘要: 暴力破解压缩文件 zip 密码 阅读全文

posted @ 2020-12-09 14:14 明天有风吹 阅读(757) 评论(0) 推荐(0)

2020年12月4日

sublime text 3 中文排序插件

摘要: ST3 的排序不支持中文按拼音排序,所以需要搞一个插件来支持这一特性 pypinyin 这个库可以把中文转成拼音,可惜不支持 python3.3,而 ST3 内置的 python 就是 3.3 我系统中的 python 是 3.8,是可以用 pypinyin 这个库的 那么问题可以转化为「pytho 阅读全文

posted @ 2020-12-04 18:23 明天有风吹 阅读(480) 评论(0) 推荐(0)

2020年11月26日

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1122)

摘要: 只需执行 /Applications/Python\ 3.9/Install\ Certificates.command 阅读全文

posted @ 2020-11-26 14:52 明天有风吹 阅读(4395) 评论(1) 推荐(0)

2020年11月7日

Excel 快速跳转到工作表

摘要: 新建 vba 模块 Sub GotoSheet() tname = InputBox("input table name") If StrPtr(tname) = 0 Then Exit Sub ElseIf tname = vbNullString Then Exit Sub Else For i 阅读全文

posted @ 2020-11-07 14:31 明天有风吹 阅读(842) 评论(0) 推荐(0)

2020年11月6日

Excel vba call Python script on Mac

摘要: How can I launch an external python process from Excel 365 VBA on OSX? It took me a while, but I figured out how to do it. Excel 2016 has replaced Mac 阅读全文

posted @ 2020-11-06 20:50 明天有风吹 阅读(500) 评论(0) 推荐(0)

2020年11月3日

Android Parsing between JSON and Kotlin Object with Google Gson Library

摘要: Parsing between JSON and Kotlin Object with Google Gson Library dependencies { ... implementation 'com.google.code.gson:gson:2.8.6' ... } class MyClas 阅读全文

posted @ 2020-11-03 18:47 明天有风吹 阅读(94) 评论(0) 推荐(0)

2020年10月30日

Android kotlin http url request

摘要: kotlin.concurrent.thread{ val url = "https://hangj.cnblogs.com/" val res = try { java.net.URL(url).readText() } catch (ex: Exception) { return@thread 阅读全文

posted @ 2020-10-30 15:42 明天有风吹 阅读(601) 评论(0) 推荐(0)

2020年10月16日

python variable scope 变量作用域

摘要: python 中变量的作用域经常让我感到很迷 In Python, on the other hand, variables declared in if-statements, for-loop blocks, and while-loop blocks are not local variabl 阅读全文

posted @ 2020-10-16 10:51 明天有风吹 阅读(234) 评论(0) 推荐(0)

2020年10月7日

android kotlin determine file type from bytes 根据文件内容识别文件类型,类似python的filetype

摘要: 尝试了 URLConnection.guessContentTypeFromStream(ByteArrayInputStream(bytes)) 和 Tika().detect(bytes) 一个识别不了视频,另一个直接报一堆错 google 很久也没找到可用代码,只好自己动手 fun byteA 阅读全文

posted @ 2020-10-07 21:25 明天有风吹 阅读(142) 评论(0) 推荐(0)

2020年10月5日

android kotlin 子线程中调用界面UI组件崩溃

摘要: UI 只能在主线程内更新,子线程需要更新UI组件时可以这样: fun fuck(){ Executors.newSingleThreadExecutor().execute{ // url request ... val visibility = View.VISIBLE Handler(mainL 阅读全文

posted @ 2020-10-05 22:24 明天有风吹 阅读(1452) 评论(0) 推荐(0)

2020年9月28日

android http get

摘要: Executors.newSingleThreadExecutor().execute{ val uri = "https://www.cnblogs.com/hangj" val url = URL(uri) val con = url.openConnection() as HttpsURLCo 阅读全文

posted @ 2020-09-28 15:07 明天有风吹 阅读(159) 评论(1) 推荐(0)

android activity pass data to accessibilityservice 数据传递

摘要: 不同类型的 service 传递数据的方式不同,accessibilityservice 运行在独立进程,且被系统接管,比较特别 在 AccessibilityService 的 onCreate 内加一个 BroadcastReceiver val broadcast = object:Broad 阅读全文

posted @ 2020-09-28 13:04 明天有风吹 阅读(677) 评论(0) 推荐(0)

2020年9月2日

python 文件批量改名重命名 rename

摘要: path = '/Volumes/Seagate/dev/imgs/' os.chdir(path) print('cwd: ', os.getcwd()) for f in os.listdir('.'): if not f.endswith('.jpg'): os.rename(f, f + ' 阅读全文

posted @ 2020-09-02 11:01 明天有风吹 阅读(670) 评论(0) 推荐(0)

2020年8月31日

AN INTEGER FORMULA FOR FIBONACCI NUMBERS

摘要: https://blog.paulhankin.net/fibonacci/ This code, somewhat surprisingly, generates Fibonacci numbers. def fib(n): return (4 << n*(3+n)) // ((4 << 2*n) 阅读全文

posted @ 2020-08-31 14:10 明天有风吹 阅读(231) 评论(0) 推荐(0)

2020年8月28日

python opencv cv2 imshow threading 多线程

摘要: 除了线程同步,还需要注意的是「窗口处理」要放在主线程 #!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import threading from time import sleep from queue import Queue i 阅读全文

posted @ 2020-08-28 14:06 明天有风吹 阅读(3726) 评论(0) 推荐(0)

2020年8月24日

adb shell 查看当前与用户交互的 activity

摘要: adb shell dumpsys activity activities | grep mActivityComponent 阅读全文

posted @ 2020-08-24 17:18 明天有风吹 阅读(242) 评论(0) 推荐(0)

2020年8月23日

sublime text build system automatic ctrl/cmd+B自动选择 python2 或 python3

摘要: #背景 我同时安装了 python2 和 python3 时,python 指向 python2,python3 才是 python3 默认情况下,在 Sublime 内 Ctrl/Cmd + B 运行 python 文件时,调用的是环境变量 PATH 中的 python 所以当我想用 python 阅读全文

posted @ 2020-08-23 23:34 明天有风吹 阅读(371) 评论(0) 推荐(0)

2020年8月21日

pip 源的问题

摘要: pip install -i https://pypi.doubanio.com/simple/ --trusted-host pypi.douban.com some-package 阅读全文

posted @ 2020-08-21 14:31 明天有风吹 阅读(89) 评论(0) 推荐(0)

2020年8月20日

Mac 安装 Android commandlinetools 各种报错的问题

摘要: https://developer.android.com/studio/releases/platform-tools commandlinetools-mac 下载地址 解压后直接运行 sdkmanager 各种报错: $ ./sdkmanager --update Warning: Could 阅读全文

posted @ 2020-08-20 12:04 明天有风吹 阅读(2232) 评论(0) 推荐(0)

2020年7月19日

GIMP 一键均匀添加多条参考线 一键均匀切分图片

摘要: 添加参考线 #!/usr/bin/env python2 # -*- coding: utf-8 -*- from gimpfu import * # orientation: ORIENTATION_HORIZONTAL(0), ORIENTATION_VERTICAL(1) # diff: 参考 阅读全文

posted @ 2020-07-19 04:12 明天有风吹 阅读(1242) 评论(0) 推荐(0)

2020年7月17日

Shell 脚本如何输出帮助信息?

摘要: 作者展示了一个技巧,将帮助信息写在 Bash 脚本脚本的头部,然后只要执行"脚本名 + help",就能输出这段帮助信息 https://samizdat.dev/help-message-for-shell-scripts/ #!/bin/bash ### ### my-script — does 阅读全文

posted @ 2020-07-17 17:45 明天有风吹 阅读(2421) 评论(0) 推荐(0)

2020年7月14日

raspberry pi 配置

摘要: 从官网下载 Raspberry Pi Imager 用第 1 步下载的 Imager 抹去 SD 卡,然后选择一个系统写入 SD卡 等待第 2 步完成。然后拔出 SD 卡,重新插入 $ touch /Volumes/boot/ssh $ touch /Volumes/boot/wpa_supplic 阅读全文

posted @ 2020-07-14 02:27 明天有风吹 阅读(442) 评论(0) 推荐(0)

2020年6月16日

Sublime Text 快速分别独立选中多行

摘要: 效果图 直接上代码 import sublime, sublime_plugin # 独立选择每一行(在当前选中范围内) class SelectEverySingleLine(sublime_plugin.TextCommand): def run(self, edit): # self.view 阅读全文

posted @ 2020-06-16 14:19 明天有风吹 阅读(2392) 评论(0) 推荐(0)

2020年6月15日

How to check type of files without extensions in python? 不通过文件扩展名,怎样知道文件类型?

摘要: 有一个命令 file 可以用 $ file fuck fuck.png: PNG image data, 1122 x 750, 8-bit colormap, non-interlaced python 中可以用 magic 或 filetype rust 可以用 infer 参考链接 https 阅读全文

posted @ 2020-06-15 14:05 明天有风吹 阅读(176) 评论(0) 推荐(0)

pip install 报错 TypeError: 'module' object is not callable

摘要: $ pip install filetype Traceback (most recent call last): File "/usr/local/bin/pip2", line 11, in <module> sys.exit(main()) TypeError: 'module' object 阅读全文

posted @ 2020-06-15 13:24 明天有风吹 阅读(862) 评论(0) 推荐(0)

2020年5月28日

python 动图gif合成与分解

摘要: 合成 #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import imageio def main(imgs_dir, gif_name): # imgs_dir 里的图片要排好序 frames = [] fo 阅读全文

posted @ 2020-05-28 15:53 明天有风吹 阅读(681) 评论(0) 推荐(0)

2020年5月13日

直通车新手起步操作流程

摘要: 选词 选 5 7 个词 出价策略 先通过「直通车 工具 流量解析 查询 竞争流量透视」拿到每个词的市场均价 给每个词初始出价为市场均价的 1.5 倍 每过 30 分钟观察排名情况,若「平均展现排名」进入前 10 就 OK,否则出价翻倍 宝贝出现的位置越靠前,被点击的概率越高。所以要确保平均排名在前 阅读全文

posted @ 2020-05-13 13:01 明天有风吹 阅读(677) 评论(0) 推荐(0)

2020年4月30日

Photoshop 批量修改图像大小

摘要: ![](https://img2020.cnblogs.com/blog/342816/202004/342816-20200430173314005-1046795940.png) ![](https://img2020.cnblogs.com/blog/342816/202004/342816-20200430173318318-1549783125.png) 阅读全文

posted @ 2020-04-30 17:34 明天有风吹 阅读(327) 评论(0) 推荐(0)

导航

+V atob('d2h5X251bGw=')

请备注:from博客园