en2024

In a world where the internet has become an integral part of our daily lives, there’s a remarkable opportunity to immerse ourselves in foreign languages without ever leaving the comfort of our screens.

we can seamlessly integrate language learning into our web browsing activities. In this article, we’ll explore the top Chrome extensions that can help you learn a new language while you surf the web.

Improve your skills on your own, effectively and enjoyably, by watching films and series in the language you study.

Language Reactor is a powerful toolbox for learning languages. It helps you to discover, understand, and learn from native materials. Studying will become more effective, interesting, and enjoyable! (formerly called ‘Language Learning with Netflix’)


我不是建议大家都去做投资,但从赚钱的可持续性角度来分析,我们应当把「出卖时间」思维方式,转变为「积累资产」的思维方式。

所以,工作的主线,除了存钱,重要的任务还有:

培养通用的能力:心理韧性、沟通表达、情绪管理、商务关系等基础能力;

还要积极发展“工作以外”赚钱的方式,给自己扩大选项,跳出自己狭小的认知锚点,知道这个世界上有谁,在通过什么方式赚钱,赚到了怎样的钱。

如果还有余力,探索一件事自己喜欢且擅长的事情,并持续赚到钱。比如,如果你擅长做内容,是不是可以在业余时间拍一些视频,靠视频赚钱。

I am not suggesting that we all go into investing,
but analyzing from the perspective of sustainability of earning money,
we should change the ‘selling time’ mindset to an ‘accumulating assets’ mindset.

Therefore, the main line of work, in addition to saving money, the important task is also:

Develop generic skills:

  • mental toughness,
  • communication,
  • emotion management,
  • business relations,
  • and other basic skills;

It is also important to actively develop ways to make money “outside of work”,
to expand your options,
to look beyond your narrow cognitive anchors,
and to know who in the world is making money, how,
and what kind of money they are making.

If there’s still room,
discover one thing you love and are good at and earn money consistently.
For example, if you’re good at making content,
isn’t it possible to make some videos in your spare time
and rely on them to make money?


Here are some unfamiliar words.
I can’t express this in English without a translation tool.

I’ve found that for new English words,
remembering how it’s pronounced and trying to pronounce it
will make it easier to remember than just remembering its spelling.


Soon I will have multiple databases to periodically backup.
Is there any tool that you can recommend which I can selfhost
and will have a nice UI for scheduling DB backups?
I can of course create scripts for backups,
but it would be great to have a nice tool with a panel that lists all the backups.


LinkedIn, the social platform used by professionals to connect with others in their field,
hunt for jobs, and develop skills,
is taking the wraps off its latest effort to build artificial intelligence tools for users.

Hiring Assistant is a new product designed to take on a wide array of recruitment tasks,
from ingesting scrappy notes and thoughts to turn into longer job descriptions to sourcing candidates and engaging with them.


While the getting started pages provide an introductory tour of the project and what it offers, this document focuses on why we do the things we do in Bootstrap.

It explains our philosophy to building on the web so that others can learn from us, contribute with us, and help us improve.

Modifier classes should only be used when there are multiple properties or values to be changed across multiple variants.

Modifiers are not always necessary, so be sure you’re actually saving lines of code and preventing unnecessary overrides when creating them.

Good examples of modifiers are our theme color classes and size variants.

The same goes for more complex components.

While we could write our own form validation plugin to add classes to a parent element based on an input’s state,
thereby allowing us to style the text say red,

we prefer using the :valid/:invalid pseudo-elements every browser provides us.

Utility classes—formerly helpers in Bootstrap 3—are a powerful ally in combating CSS bloat and poor page performance.

A utility class is typically a single, immutable property-value pairing expressed as a class (e.g., .d-block represents display: block;).

Their primary appeal is speed of use while writing HTML and limiting the amount of custom CSS you have to write.

While not always possible, we strive to avoid being overly dogmatic in our HTML requirements for components.

Thus, we focus on single classes in our CSS selectors and try to avoid immediate children selectors (>).

This gives you more flexibility in your implementation and helps keep our CSS simpler and less specific.

Bootstrap 5 is increasingly making use of custom properties as local variables for various components.

This way we reduce our compiled CSS, ensure styles aren’t inherited in places like nested tables, and allow some basic restyling and extending of Bootstrap components after Sass compilation.


https://readmake.com/

Idea

  • Get an idea from problems in your own life.
  • If you don’t have problems that are original enough, become a more original person.
  • Don’t build products that are solutions in search of a problem.

Build

  • Build your idea with the tools you already know.
  • Don’t spend a year learning some language you’ll never use.
  • Don’t outsource building to other people, that’s a competitive disadvantage.
  • Build only the core functionality,The rest comes later.

Launch

  • Launch early and multiple times.
  • Launch to
    • famous startups websites (like Product Hunt, Hacker News, The Next Web),
    • mainstream websites (like Reddit)
    • and mainstream press (like Forbes).
  • Find where your specific audience hangs out on the internet and launch there.
  • Launch in a friendly way, that means “here’s something I made that might be useful for you”,
    • instead of acting like you’re some big giant new startup coming to change the world.

Grow

  • A great product that people really need which is better than the rest will pull people in.
  • You don’t need ads for that.
  • Don’t hire people if there’s no revenue yet.
  • Don’t hire many people if there’s revenue either.
  • Stay lean and fast.
  • Do things yourself.

Monetize

  • Monetize by asking users for money.
  • Don’t sell their data.
  • Don’t put ads everywhere.
  • Don’t dilute your product.
  • Be honest that you need money to build the product they love and they’ll be fine paying for it.

Ethics

  • be ethical, and don’t cut corners on ethics.
  • You’ll be rewarded by not doing dodgy stuff like
    • spamming,
    • manipulating your users into doing stuff,
    • growth hacking your search rankings
    • or faking your social media,
    • or abusing your power to compete unfairly if you’re successful.
  • If you make a good product, you don’t need any of this.
  • If you make mistakes, own up to them and say sorry.
  • Be nice as a person and especially as a company.

$65k/month website running on one index.php file (twitter.com/levelsio)
https://news.ycombinator.com/item?id=24548391

  • just because something can be done doesn’t mean it should be done
  • Simplicity is the ultimate sophistication

Software engineers are now experiencing what mechanical engineers experienced in the 1970s and 1980s when FEA and CAD applications began to automate much of the calculation and drafting work that previously defined the profession.

Writing code by hand will be an educational exercise and something that is done in the earliest stages of prototyping and for fine tuning nearly finished designs much like how manual drafting and hand calculations are used in mechanical engineering today.

Obviously, mechanical engineering is still a profession but calculator and draftsman aren’t. People who are exclusively programming will go the way of the draftsman.

https://www.percona.com/blog/mysql-backup-and-recovery-best-practices/

The app aims to address perceived limitations in existing note-taking applications by implementing the core principles outlined in the creator’s book.

Audiala is a mobile application that generates audio guides for historical and touristic locations worldwide.
Conceived during a solo trip to Florence in 2023,
the project aims to transform travel experiences by providing location-based audio storytelling.
The platform currently generates over $500/month through in-app purchases
and focuses on creating immersive, context-aware narratives about landmarks and destinations

The application leverages a Retrieval-Augmented Generation (RAG) pipeline, primarily utilizing content from Wikipedia and other relevant websites. The creator acknowledges that identifying relevant places is the most challenging aspect of the pipeline, currently addressing this through manual user requests. Approximately 99% of the content is AI-generated, with manual corrections applied when necessary.

The project appears to rely on advertising as its primary revenue stream. The creator acknowledges potential user resistance to ads but views them as the most sustainable monetization approach. Interestingly, some users reported challenges detecting advertisements, with discussions around ad-blocking effectiveness highlighting the nuanced approach to generating revenue.

202406

Python One Billion Row Challenge — From 10 Minutes to 4 Seconds
https://archive.is/a644q

Processing One Billion Rows in PHP!
https://dev.to/realflowcontrol/processing-one-billion-rows-in-php-3eg0

mysql 中如下 json 字段

{
   "status": "OK",
   "results": [
      {
         "types": [
            "locality",
            "political"
         ],
         "place_id": "ChIJpdtYF6azhkcRmu5nCgU7BtM",
         "formatted_address": "20874 Busnago, Province of Monza and Brianza, Italy",
         "address_components": [
            {
               "types": [
                  "locality",
                  "political"
               ],
               "long_name": "Busnago",
               "short_name": "Busnago"
            },
            {
               "types": [
                  "administrative_area_level_3",
                  "political"
               ],
               "long_name": "Busnago",
               "short_name": "Busnago"
            },
            {
               "types": [
                  "administrative_area_level_2",
                  "political"
               ],
               "long_name": "Province of Monza and Brianza",
               "short_name": "MB"
            },
            {
               "types": [
                  "administrative_area_level_1",
                  "political"
               ],
               "long_name": "Lombardy",
               "short_name": "Lombardy"
            },
            {
               "types": [
                  "country",
                  "political"
               ],
               "long_name": "Italy",
               "short_name": "IT"
            },
            {
               "types": [
                  "postal_code"
               ],
               "long_name": "20874",
               "short_name": "20874"
            }
         ]
      }
   ]
}

要取 types 里包含 administrative_area_level_3 的上级节点的 long_name 值

select 
    country_code,
    location,response->>'$.results[0].formatted_address' formatted_address,
    json_unquote(
        json_extract(
            response,
            concat(
                '$.results[0]',
                REGEXP_REPLACE(
                    JSON_SEARCH(
                        response->>'$.results[0]',
                        'one', 
                        'administrative_area_level_1'
                    ),
                    '"|\\$|\\.types\\[[0-9]]',''
                ),
                '.long_name')
        )
    ) administrative_area_level_1 
from t limit 10;
  1. 先用 JSON_SEARCH 得到 administrative_area_level_1 的路径,类似 $.address_components[3].types[0]
  2. 用 REGEXP_REPLACE 替换掉前面的 $ 和最后的 .types[0]
  3. 用 concat 拼接所需的 json path,类似 $.results[0].address_components[2].long_name
  4. 用 json_extract 取出所需要的值
  5. 用 json_unquote 去掉结果两侧的引号

乱码替换

>>> re.sub(r'x(\w\d)x(\w\d)',lambda x: bytes.fromhex(x.group(1)+x.group(2)).decode('utf-8'),'Logrosxc3xa1n')
'Logrosán'
>>> re.sub(r'x(\w\d)x(\w\d)',lambda x: bytes.fromhex(x.group(1)+x.group(2)).decode('utf-8'),'Trxc3xa9mentines')
'Trémentines'
>>> re.sub(r'x(\w\d)x(\w\d)',lambda x: bytes.fromhex(x.group(1)+x.group(2)).decode('utf-8'),'Trxc3xa9lazxc3xa9')
'Trélazé'
>>> re.sub(r'x(\w\d)x(\w\d)',lambda x: bytes.fromhex(x.group(1)+x.group(2)).decode('utf-8'),'Jxc3xa4msxc3xa4nkoski')
'Jämsänkoski'
>>> re.sub(r'x(\w\d)x(\w\d)',lambda x: bytes.fromhex(x.group(1)+x.group(2)).decode('utf-8'),'Sxc3xb8llerxc3xb8d')
'Søllerød'
>>> re.sub(r'x([0-9a-fA-F]{1,2})x([0-9a-fA-F]{1,2})',lambda x: bytes.fromhex(x.group(1)+x.group(2)).decode('utf-8'),'Sxc3xb8llerxc3xb8d')

‘Søllerød’

手搓一个最小的 Agent 系统 — Tiny Agent
https://zhuanlan.zhihu.com/p/699732624

  • MetaGPT: 本质类似于公司的组织架构,横向同一层级的工作模式,可能是COT、TOT、GOT,纵向深度有不同的层级,如role、action、action node等
  • React: 就像是个不是特别聪明的孩子,要把想法写出来,然后去综合所有想法和观察,接着再做出相应的动作。
  • Reflexion: 一种“语言”强化的新范式,它将策略参数化为代理的记忆编码,并配对参数选择LLM。
  • Toolformer: 一种学习以新颖方式使用工具的模型,它通过自监督的方式学习如何使用不同的工具,如搜索引擎、计算器和翻译系统。
  • Swiftsage: 用一个小模型直接输出决策,当小模型不行时改用大模型通过复杂planning输出决策。
  • Creator: 通过工具创造实现了大模型抽象与具象思维能力的解耦,面对有难度的问题能够保持更好的鲁棒性。

OpenAI 不可用?使用开源模型一键替换 OpenAI API
https://mp.weixin.qq.com/s?__biz=MzI2MjkxNjA2Mg==&mid=2247487114&idx=1&sn=0c443a88bafa49daec18f8a16d0c6284

docker run --rm -p 8080:8080 --name api-server secondstate/llama-3-8b-nomic-1.5:latest

curl -X POST http://localhost:8080/v1/chat/completions \
    -H 'accept:application/json' \
    -H 'Content-Type: application/json' \
    -d '{"messages":[{"role":"system", "content": "You are a helpful assistant."}, {"role":"user", "content": "What is the capital of France?"}], "model": "Meta-Llama-3-8B-Instruct-Q5_K_M.gguf"}'

curl -X POST http://localhost:8080/v1/embeddings \
    -H 'accept:application/json' \
    -H 'Content-Type: application/json' \
    -d '{"model": "nomic-embed-text-v1.5.f16", "input":["LlamaEdge is the easiest & fastest way to run customized and fine-tuned LLMs locally or on the edge."]}'

https://www.secondstate.io/articles/wasm-runtime-agi/

长时间以来,来自开源生态的朋友们一致支持着Qwen的发展,包括

  • 微调(Axolotl、Llama-Factory、Firefly、Swift、XTuner)、
  • 量化(AutoGPTQ、AutoAWQ、Neural Compressor)、
  • 部署(vLLM、SGL、SkyPilot、TensorRT-LLM、OpenVino、TGI)、
  • 本地运行(MLX、Llama.cpp、Ollama、LM Studio)、
  • Agent及RAG(检索增强生成)框架(LlamaIndex, CrewAI, OpenDevin)、
  • 评测(LMSys, OpenCompass, Open LLM Leaderboard)、
  • 模型二次开发(Dolphin, Openbuddy)。

https://zhuanlan.zhihu.com/p/703883561

https://llamaedge.com/

Q: Why can’t I use Python to run the LLM inference?
A: You can certainly use Python to run LLMs and even start an API server using Python. But keep mind that PyTorch has over 5GB of complex dependencies. These dependencies often conflict with Python toolchains such as LangChain. It is often a nightmare to set up Python dependencies across dev and deployment machines, especially with GPUs and containers.

In contrast, the entire LlamaEdge runtime is less than 30MB. It is has no external dependencies. Just install LlamaEdge and copy over your compiled application file!

Q: Why can’t I just use native (C/C++ compiled) inference engines?
A: The biggest issue with native compiled apps is that they are not portable. You must rebuild and retest for each computer you deploy the application. It is a very tedious and error prone progress. LlamaEdge programs are written in Rust (soon JS) and compiled to Wasm. The Wasm app runs as fast as native apps, and is entirely portable.

wasm 使用案例
https://wasmedge.org/docs/zh/start/usage/use-cases/

阿里千问
https://qwen.readthedocs.io/en/latest/framework/LlamaIndex.html

  1. 本地安装,测试,部署很方便,支持多种方式,满足不同需求
  2. 量化,fine tune(有监督训练), embedding(RAG)都支持本地实现
  3. function call,Agent, LangChain相关功能需要使用阿里的dashscope服务

跨设备运行小小阿里云通义千问大模型 Qwen1.5-0.5B-Chat
https://zhuanlan.zhihu.com/p/684034037

mac如何安装git-lfs,以及modelscope的使用示例
https://zhuanlan.zhihu.com/p/692680970

ModelScope+transformers调用llama模型
https://zhuanlan.zhihu.com/p/698481268

https://zhuanlan.zhihu.com/p/681690385

https://wasmedge.org/docs/develop/rust/wasinn/llm_inference/

-m, --model-alias <ALIAS>
      Model alias [default: default]
-c, --ctx-size <CTX_SIZE>
      Size of the prompt context [default: 4096]
-n, --n-predict <N_PRDICT>
      Number of tokens to predict [default: 1024]
-g, --n-gpu-layers <N_GPU_LAYERS>
      Number of layers to run on the GPU [default: 100]
-b, --batch-size <BATCH_SIZE>
      Batch size for prompt processing [default: 4096]

苹果AppleMacOs系统Sonoma本地部署无内容审查(NSFW)大语言量化模型Causallm
https://zhuanlan.zhihu.com/p/686099177
https://hf-mirror.com/tastypear/CausalLM-7B-DPO-alpha-GGUF

LLaMA-Factory QuickStart
https://zhuanlan.zhihu.com/p/695287607

使用 Python库DEAP的多目标优化示例
https://blog.csdn.net/gongdiwudu/article/details/138033230

Pygmo multi-objective optimization with constraints
https://stackoverflow.com/questions/77411477/pygmo-multi-objective-optimization-with-constraints

命令行听歌

for %%i in (D:\mp3\*.mp3) do D:\haohu\soft\ffmpeg\bin\ffplay "%%i" -autoexit

基于STM32+VS1053B的MP3设计
https://zhuanlan.zhihu.com/p/690699207

这里我们使用的是stm32F103VET6,内部Flash有512K,100pin的外部引脚,属于大容量芯片,足够我们diy。对于本设计,stm32这一块用到的知识点有:SDIO驱动SD卡,SPI驱动VS1053B芯片,IIC驱动OLED;对于程序,用的是stm32标准库

功能范围:

  • CPU 专注于通用计算任务。
  • SoC 集成了多个功能模块,满足复杂的计算和通信需求。
  • MCU 专注于特定的嵌入式应用,如控制系统、传感器等。

应用领域:

  • CPU 广泛用于个人电脑、服务器等通用计算设备。
  • SoC 常见于智能手机、平板电脑等便携设备。
  • MCU 主要应用于嵌入式系统,如家电、汽车电子等。

集成程度:

  • CPU 通常作为计算机系统的核心,但需要其他芯片的支持。
  • SoC 在一个芯片上集成了多个功能模块。
  • MCU 是一种完整的嵌入式系统,集成了所有必要的组件。

https://blog.csdn.net/github_35631540/article/details/139122039

  • ESP8266
    • 应用场景:主要用于 WiFi 联网项目,如智能家居设备、IoT 传感器和无线控制。
    • 优势:低成本、内置 Wi-Fi 功能、低功耗模式,易于接入互联网。
    • 代表产品:NodeMCU 开发板、ESP-01模块。
  • 51单片机
    • 应用场景:广泛应用于教育和基础电子学习、简单的控制系统如家电控制、工业仪器等。
    • 优势:成本极低、指令简单、资源占用小,适合初学者和低成本项目。
    • 代表产品:Intel 的 MCS-51 系列。
  • ESP32
    • 应用场景:IoT设备,智能家居,低功耗传感器网络,音频应用等。
    • 优势:比 ESP8266 更强大的 CPU,支持蓝牙和 Wi-Fi,更多的 I/O 端口,更佳的安全性能。
    • 代表产品:ESP32 开发板。
  • Arduino
    • 应用场景:广泛用于教育、原型开发、艺术作品、简单的机器人。
    • 优势:易于学习的编程环境,丰富的社区和库支持,适合快速原型开发。
    • 代表产品:Arduino Uno, Arduino Mega。
  • STM32系列
    • 应用场景:汽车应用、工业控制、医疗设备、高性能嵌入式应用。
    • 优势:基于 ARM Cortex-M 核心,性能强大,低功耗,丰富的外设,支持多种开发环境。
    • 代表产品:STM32F103 系列、STM32F4 系列。
  • Raspberry Pi
    • 应用场景:作为学习计算机编程的工具、家庭媒体中心、高级DIY项目如自制服务器或游戏机。
    • 优势:具备完整的计算机功能,支持多种操作系统,拥有丰富的I/O接口和社区支持。
    • 代表产品:Raspberry Pi 4 Model B。

[嵌入式系统-72]:ARM芯片选型基础
https://blog.csdn.net/HiWangWenBing/article/details/138421375

  • 经典 ARM 处理器 ARMx
    • ARM7 系列:这是 ARM 处理器家族中较早的一代产品,采用 32 位 RISC 架构。
      • 广泛应用于嵌入式系统、移动设备等领域。
    • ARM9系列处理器是在ARM7基础上发展而来的,性能有明显提升。
      • 无线设备、仪器仪表、安全系统、机顶盒、高端打印机、数字照相机
    • ARM11 系列处理器是 ARM9 的升级
  • 嵌入式 Cortex-Mx系列:微控制器
    • 低成本、低功耗、高性能
    • 物联网(IoT)、工业自动化、智能家居和汽车电子等
    • 智能灯光控制、智能门锁、智能家电等设备中,实现远程控制和自动化管理。
  • 嵌入式 Cortex-R 系列:实时处理器
    • 实时处理器,专为需要高可靠性、高可用性、容错功能、可维护性和实时响应的嵌入式系统而设计。
    • 广泛应用于车载控制系统中,如发动机控制、车身控制、底盘控制等。在工业控制领域。
  • 高性能应用 Corex-A 系列:应用处理器
    • 高性能应用处理器,专为需要强大计算能力和高性能指令集的应用而设计
    • 广泛应用于智能手机、平板电脑、笔记本电脑等移动设备以及网络设备、存储设备等领域。

《龙之家族》血龙狂舞战争,黑党与绿党各有哪些势力?
https://zhuanlan.zhihu.com/p/569141727

ck 中按字符串列平均分成 10份

select count(*) from tbl
where CRC32(name)>= 0*((pow(2, 32) - 1) / 10)
and  CRC32(name) < 1*((pow(2, 32) - 1) / 10);
┌──count()─┐
│ 65588724 │ -- 65.59 million
└──────────┘
select count(*) from tbl
where CRC32(name)>= 1*((pow(2, 32) - 1) / 10)
and  CRC32(name) < 2*((pow(2, 32) - 1) / 10);
┌──count()─┐
│ 65424285 │ -- 65.42 million
└──────────┘

函数平移和伸缩变换的知识汇总
https://mp.weixin.qq.com/s?__biz=MzU0Mjg4ODc2OQ==&mid=2247488669&idx=1&sn=d7eafbfe91f41ed555e81e92ed9643d8

LLM101n: Let’s build a Storyteller
https://github.com/karpathy/LLM101n

thought through though

【tcp】关于tcp状态的Recv-Q 和 Send-Q
https://www.jianshu.com/p/4676ea4d03e1

TCP 半连接队列和全连接队列满了会发生什么?又该如何应对?
https://www.cnblogs.com/xiaolincoding/p/12995358.html

几种防御 SYN 攻击的方法:

  • 增大半连接队列;
    • 增大 tcp_max_syn_backlog 和 somaxconn
    • 增大 backlog
  • 开启 tcp_syncookies 功能
  • 减少 SYN+ACK 重传次数

开启 syncookies 功能就可以在不使用 SYN 半连接队列的情况下成功建立连接,在前面我们源码分析也可以看到这点,当开启了 syncookies 功能就不会丢弃连接。

syncookies 是这么做的:服务器根据当前状态计算出一个值,放在己方发出的 SYN+ACK 报文中发出,当客户端返回 ACK 报文时,取出该值验证,如果合法,就认为连接建立成功

https://www.languagereactor.com/ 这个学英语插件不错,可以每一句反复听,会自动断句。

所谓「不可能三角」,是指一款No Code工具无法同时兼顾「灵活」、「易用」与「效率」。

比如,如果工具:

支持各种场景(灵活),同时能显著提高网页产出效率,那他的配置一定很复杂(需要应对各种场景,不易用)
支持各种场景(灵活),同时很好用,那他的开发效率就不会高(无法无脑生成页面,需要修改产物代码)
配置简单(易用),同时开发效率高,那他的应用场景就窄(不灵活)
framer选择了第三条道路,即 牺牲灵活性,保持易用与效率。

具体来说,framer的应用场景局限在生成落地页、产品介绍页、官网这样的静态页。
https://framer.com/

C++11新特性
https://blog.csdn.net/qq_56044032/article/details/125230984

perl 菜鸟教程
https://www.runoob.com/perl/perl-tutorial.html
Perl 基本语法
https://www.cnblogs.com/cosiray/archive/2012/03/18/2404371.html
Modern Perl, 4e
http://modernperlbooks.com/books/modern_perl_2016/index.html

Google on Monday said the search company is reversing its plan to phase out the use of third-party cookies in its Chrome browser in favor of a new strategy that will allow people to “make an informed choice that applies across their web browsing.”

https://en.wikipedia.org/wiki/Denavit–Hartenberg_parameters

坐标系与矩阵(5): Denavit-Hartenberg算法
https://cloud.tencent.com/developer/article/1849681

在动力学中,比如人的胳膊就有好几个关节,且不同的关节有不同的旋转轴,如果是路飞的话,关节之间的长度还是不固定的。这里,每一个关节都存在一个自身坐标系,其中旋转可以是绕三个轴,平移则是沿着三个轴,每个坐标系存在6个自由度。问题就有点复杂了,每个人对每个关节可能会定义不同的坐标系方向,这会直接决定求解该问题的难度。DH算法则提供了一个一般性理论,且每一个关节只需要4个自由度。

https://cloud.tencent.com/developer/article/1969850
栅格化的对象是网格,网格表面可以通过三角形无限细分,而三角形是最简单的平面。接下来就是栅格化核心内容:如何绘制一个三角形。

栅格化的流水线主要有两个阶段:顶点(vertex)和片元(fragment),前者将三维空间下三角形的每一个点投射到二维平面上,后者则将投影后的三角形填充颜色,最终完成一个三角形的渲染。当多个三角形存在遮盖问题时,则通过深度检测(Z-buffer机制)来判断几何对象间的远近。

Whitted-Style Ray Tracing算法(1979)采用射线模拟相机到光源间的光路传输,并考虑了射线和光源之间的遮盖,射线和物体间的反射,以及和半透明物体间的折射等光学现象。该算法模拟了光线传播中的基本物理规律,比如Fresnel, Beer law,折射率以及传输过程中的衰减等,非常健壮的实现了阴影、折射、反射效果。

通过栅格化和光线追踪的发展来看,人们对真实感的定义随着时间而变化,最初希望有基本的阴影、折射、反射效果,随着技术和硬件能力的提升,人们的标准也不断的提高,正应了那句歌词,得不到的永远在骚动。这也反映了Moore‘s Law和Blinn’s Law之间的相互制约:当计算能力不断提升时,人们也会提高渲染真实感的标准,从而保证渲染时间不变。

在概念上,无论栅格化还是光线追踪,真实感的标准主有三点:照片级别(photo realistic)和物理正确(physically based rendering)以及性能(high performance),只是两者给出了不同的优先级。光线追踪优先前两点,往往需要极大的计算量,因此在离线渲染领域成为主角。而Rasterization技术主要应用于实时渲染领域,为了性能而有条件地牺牲前两点。

https://github.com/rqlite/rqlite

rqlite is a relational database which combines SQLite’s simplicity with the power of a robust, fault-tolerant, distributed system.

You can use rqlite to store your important data reliably, ensuring it’s always available. If you’re interested in understanding how distributed systems actually work, it’s a good example to study. A lot of thought has gone into its design, separating storage, consensus, and API clearly.

The fastest, most reliable, Redis-based distributed queue for Node.
Carefully written for rock solid stability and atomicity.
https://github.com/taskforcesh/bullmq

du -sh 排除挂载点,清理 /tmp

# 创建目录排除文件,排除掉非系统盘挂载点,NFS 挂载点 和 /proc
mount |awk '$1~/^\/dev/&&$3!="/" || $5~/nfs/ {print $3}' >> ~/.du_exclude
echo /proc >> ~/.du_exclude

# 查看文件大小分布
ncdu -X ~/.du_exclude /
du -sh -X ~/.du_exclude /*

# 清理 10 天未改动的临时文件
find /tmp -ctime +10 | xargs rm -rf

202405

关于投资建议
https://retire50blog.wang/wp-content/uploads/7038138252_博客图片/关于投资建_files_9bbe285294f3059a76a55f60ed91b249ea8a1d0b/1.png

https://retire50blog.wang/invest/imp/关于我-2.html

多少钱可以财务自由?
https://xueqiu.com/5819606767/60786196

举一个例子,如果你历史上的投资复利是15%,GDP是7%,CPI是3%,每年计划开销25万,则
1、实现基本的财务自由,可投资资产>25万/(15%-3%)=208万,未来的花销每年可以按照CPI=3%的速度增加
2、实现高级的财务自由,可投资资产>25万/(15%-3%-7%)=500万,未来的花销每年可以按照GDP+CPI=10%的速度增加

《微信公开课》读后感&做期权的思考
https://retire50blog.wang/invest/读《2018微信公开课》后感.html

投资体系演变和最新规划
https://retire50blog.wang/invest/投资体系演变历史和最新规划.html

https://retire50blog.wang/invest/关于赚钱.html
https://retire50blog.wang/invest/价投投资思路变化.html
https://retire50blog.wang/invest/躺.html

  • 我这里每年的开销不多,一般20万以下。
  • 10%,300万的现金,获取3-4%的存款理财收益,可以提供10万。另外我还有一些增收手段,一年能有个50万。
  • 长江电力,有个转债132018,在2024年4月9日转债到期之前,可以做到一些增收。今年下半年开始做,到目前增收约15万。
  • 沪深300,我用期货代替510310,每年可以增收3%左右,大约27万。今年7月底开始实施,到现在10月基本满了一个季度,增收7.5万。如果全年四个季度,会有25-30万。
  • 贵州茅台,分仓4个号,打新股有些额外收益。今年前十个月打新收益7万。长电由于经常和转债切换,且大量集中在了一个低佣金的账号里,所以没法稳定提供打新市值。
  • 一年合计有60万收益,足够覆盖不到20万的开销。如果有其他重要开支,可以从10%的现金里出。

https://retire50blog.wang/invest/这么想.html

mysql 修改认证插件
# 查看日志
tail -f /var/log/mysql/error.log
2024-05-09T00:57:25.534340Z 206919 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ‘‘mysql_native_password’ is deprecated and will be removed in a future release. Please use caching_sha2_password instead’

# 修改默认插件并重启
vi  vi /etc/mysql/mysql.conf.d/mysqld.cnf
    default_authentication_plugin=mysql_native_password
systemctl restart mysql
systemctl status mysql

# 确认插件修改成功
show plugins;
show variables like '%auth%';

# 以指定认证插件创建账号并分配权限
create user 'user'@'6.6.6.6' identified with mysql_native_password by '****';
select host, user, plugin from mysql.user;
grant all privileges on testdb.*  TO 'user'@'6.6.6.6';

视频音频比特率(码率)与采样率之间的联系
https://zhuanlan.zhihu.com/p/486101944

qbasic Beginner Tutorials
http://www.petesqbsite.com/sections/tutorials/beginners.shtml
http://www.petesqbsite.com/sections/tutorials/zines/qboa/4-beginner.txt

Is there a resource that teaches math through programming?
https://www.reddit.com/r/compsci/comments/y79zd/is_there_a_resource_that_teaches_math_through/

How and where can I learn programming and mathematics simultaneously?
https://www.quora.com/How-and-where-can-I-learn-programming-and-mathematics-simultaneously

How can someone combine programming and mathematics while learning both?

I will preface this by saying that it really depends on what area of mathematics you’re learning. For instance, when I was in set theory, fundamental logic and some of those strains of classes, I wasn’t really programming up a lot of the course materials. There are options but they are limited for these type of classes.

But lets assume first that you’re in an area like one of the Algebra classes before Modern / Abstract Algebra.

Here you will learn many ways to solve equations, about polynomials, trigonometry, and the likes.

One of the reasons that the law of sines stuck with me so much was because it was one of the first programs I wrote on my TI calculator.

The programming concepts were pretty simple: I/O (user input, display results), modes of calculations (degrees vs radians), and possibly loops (for doing multiple exercises).

excel 根据 email 获取域名

=RIGHT(A1, LEN(A1) - SEARCH("@", A1))

https://www.nytimes.com/2019/11/13/books/review/the-man-who-solved-the-market-gregory-zuckerman.html

https://makemoneyonlinetutorials.quora.com/
https://blogsked.com/make-money-online-2024/

How much time does it realistically take to start seeing results from online money-making methods like blogging or YouTube?

DOS game “F-15 Strike Eagle II” reverse engineering/reconstruction war stories
https://news.ycombinator.com/item?id=40347662

具备反脆弱特性的期权波动率多头,如何控制Theta消耗?
https://mp.weixin.qq.com/s?__biz=MzU5NDc0MTkyNw==&mid=2247492445&idx=1&sn=933c24a9555eeeffbe3a4412331615d5&chksm=fe7e3c95c909b583a9ceef9d7ade0e6f9d122dbae5e711e097b38806441c1f6a550173373287&scene=21#wechat_redirect

Write 8-bit code in your browser.
https://8bitworkshop.com/

mysql 查看回滚进度

mysql> select now(),trx_state,trx_rows_modified from INNODB_TRX where trx_id=5795845153 limit 10;
+---------------------+--------------+-------------------+
| now()               | trx_state    | trx_rows_modified |
+---------------------+--------------+-------------------+
| 2024-05-16 07:12:21 | ROLLING BACK |           7525492 |
+---------------------+--------------+-------------------+
1 row in set (0.00 sec)

https://aws.amazon.com/cn/tutorials/create-manage-nonrelational-database-dynamodb/
https://aws.amazon.com/cn/solutions/case-studies/dropbox-dynamodb-case-study/?pg=dynamodb&sec=cs#dropbox
https://docs.aws.amazon.com/zh_cn/amazondynamodb/latest/developerguide/SQLtoNoSQL.WhyDynamoDB.html

查询多个数据源
https://docs.aws.amazon.com/zh_cn/athena/latest/ug/running-federated-queries.html

The main purpose of this project is to power sco and neco, which are more general purpose coroutine libraries.
https://github.com/tidwall/llco

https://github.com/tidwall/hashmap.c
Hash map implementation in C.

用 python 写一个函数,把函数调用表达式 a(1, b(2, c(0))) 解析成 json 格式的抽象语法树,如下

{
  "type": "CallExpression",
  "callee": {
    "type": "Identifier",
    "name": "a"
  },
  "arguments": [
    {
      "type": "NumberLiteral",
      "value": 1
    },
    {
      "type": "CallExpression",
      "callee": {
        "type": "Identifier",
        "name": "b"
      },
      "arguments": [
        {
          "type": "NumberLiteral",
          "value": 2
        },
        {
          "type": "CallExpression",
          "callee": {
            "type": "Identifier",
            "name": "c"
          },
          "arguments": [
            {
              "type": "NumberLiteral",
              "value": 0
            }
          ]
        }
      ]
    }
  ]
}

一探究竟:深挖网关性能异常背后的秘密
https://mp.weixin.qq.com/s/zN9m4r-frwpkFN3tzsVXjQ

手撕红黑树!使用C语言带你实现一个平衡搜索树【正文】
https://mp.weixin.qq.com/s?__biz=Mzg3ODg3Mzg3Nw==&mid=2247483882&idx=2&sn=f1f8ed6baa834cf767bac33cf26765f4&chksm=cea3dbcdcfba1239a3b6c591675904b2af5b6e5669015aa4779e688198f3cc867930bf1dc628&scene=132&exptype=timeline_recommend_article_extendread_extendread_for_notrec&show_related_article=1&subscene=0&scene=132#wechat_redirect

红黑树可以称得上几乎平衡的二叉搜索树,能够在最坏的情况下把插入、检索和删除的时间复杂度都控制在$O(\lg(n))$,如果把一系列数据结构都当成是学生的话,把插入、随机检索和删除作为考核科目,那么红黑树可以比喻成每科都能拿90分的学霸,而二叉平衡树(AVL)在“检索”拿到95分,哈希表更是在“检索”科目拿到97分,不过后面两位学生在插入和删除方面拿到的分数就比90分低多了。

https://time.geekbang.org/column/article/312589
大力水手Jerry
一课一思:service mesh是软硬一体化,基础设施软件化,系统的模块被分割为业务代码和基础设施代码,团队既要负责业务的开发,也要负责基础设施代码的开发,实现开发和运维的一体化,这对团队提出了很高的要求。换句话说,云原生和网格统一了软件业务开发和生产运维,它将基础设施软件化,并为生产运维提供了工具和手段。类似于monolithic发展到micro-services,复杂性并不会消失,而是转换到另外一个维度,云原生的目的并不是消除复杂性,而是更加专业和灵活的管理软件的复杂性和基础设施的复杂性。云原生的主要矛盾可能就是面向业务的代码开发管理和面向基础设施的运维管理,后者会消耗资源,从某种角度说相当于侵占了前者的资源,因此下一次的软件架构,可能会屏蔽掉所有面向基础设施的管理内容,整体软件架构只呈现出业务的关联依赖。

不管是做单体应用还是微服务,在系统设计之初就要做好领域分析建模,在开发阶段要严格按照领域设计分层开发,将来即使要拆分也会很容易。

SpringFU、Spring Graal Native

awk 里用 FPAT 解析 csv

$ echo -e "1,2\n\"3\\\"a\",\"4,5\"" | awk  'BEGIN{FPAT="[^,]+|\"[^\"]+\""}{print NF,$1"|"$2}'
2 1|2
2 "3\"a"|"4,5"

pv data.csv |awk  'BEGIN{FPAT="[^,]+|\"[^\"]+\""}NF==13{print $0' | clickhouse-client --query 'insert into data FORMAT CSV'

为什么现在没人读Linux源码了?
https://www.sohu.com/a/731268212_121124376

https://mp.weixin.qq.com/s?__biz=MzIzOTU0NTQ0MA==&mid=2247538751&idx=1&sn=9382ab61af6648c2e4c099f70e1078cf&chksm=e8e519b4508b139afbfd4b75cf0c5189b807f31e87e235f6fd821804ee14e2b70c220e63c5ac&scene=132&exptype=timeline_recommend_article_extendread_samebiz&show_related_article=1&subscene=0&scene=132#wechat_redirect

  • 确认使用的对象(ToC:高并发,ToB:高可用)
  • 系统的服务场景(即时通信:低延迟,游戏:高性能,购物:秒杀-一致性)
  • 用户量级(万级:双机、百万:集群、亿级:弹性分布式、容器化编排架构)
  • 百万读:3主6从,每个节点的读写高峰QPS可能可以达到每秒5万,可以实现15万,30万读性能
  • 亿级读,通过CDN、静态缓存、JVM缓存等多级缓存来提高读并发
  • 百万写,通过消息队列削峰填谷,通过hash分拆,水平扩展分布式缓存
  • 亿级写,redis可以定制数据结构、SSD+内存LRU、冷数据异步多线程复制
  • 持久化,(Mysql)承受量约为 1K的QPS,读写分离提升读并发,分库分表提升写并发

https://mp.weixin.qq.com/s?__biz=MzIzOTU0NTQ0MA==&mid=2247538395&idx=1&sn=de3fd76a18d3d08806ff09a5ab59142f&chksm=e8e11d6334dac1a75aed9e4fc597b523eb96859350ffcb744ec30e21312d543643c0a4f2f67b&scene=132&exptype=timeline_recommend_article_extendread_samebiz&show_related_article=1&subscene=132&scene=132#wechat_redirect

https://blog.csdn.net/wuhuayangs/article/details/121830094

布隆过滤器中一个元素如果判断结果为存在的时候元素不一定存在,但是判断结果为不存在的时候则一定不存在。

布隆过滤器适合的场景

  • 区块链中使用布隆过滤器来加快钱包同步;以太坊使用布隆过滤器用于快速查询以太坊区块链的日志
  • 数据库防止穿库,Google Bigtable,HBase 和 Cassandra 以及 Postgresql 使用BloomFilter来减少不存在的行或列的磁盘查找。避免代价高昂的磁盘查找会大大提高数据库查询操作的性能
  • 判断用户是否阅读过某一个视频或者文章,类似抖音,刷过的视频往下滑动不再刷到,可能会导致一定的误判,但不会让用户看到重复的内容
  • 网页爬虫对URL去重,采用布隆过滤器来对已经爬取过的URL进行存储,这样在进行下一次爬取的时候就可以判断出这个URL是否爬取过了
  • 使用布隆过滤器来做黑名单过滤,针对不同的用户是否存入白名单或者黑名单,虽然有一定的误判,但是在一定程度上还是很好的解决问题
  • 缓存击穿场景,一般判断用户是否在缓存中,如果存在则直接返回结果,不存在则查询数据库,
    • 如果来一波冷数据,会导致缓存大量击穿,造成雪崩效应,
    • 这时候可以用布隆过滤器当缓存的索引,只有在布隆过滤器中,才去查询缓存,如果没查询到则穿透到数据库查询。
    • 如果不在布隆过滤器中,则直接返回,会造成一定程度的误判
  • WEB拦截器,如果相同请求则拦截,防止重复被攻击。用户第一次请求,将请求参数放入布隆过滤器中,当第二次请求时,先判断请求参数是否被布隆过滤器命中。
  • 可以提高缓存命中率。
  • Squid 网页代理缓存服务器在 cache digests 中就使用了布隆过滤器。
  • Google Chrome 浏览器使用了布隆过滤器加速安全浏览服务
  • Google 著名的分布式数据库 Bigtable 使用了布隆过滤器来查找不存在的行或列,以减少磁盘查找的IO次数
  • Squid 网页代理缓存服务器在 cache digests 中使用了也布隆过滤器
  • Venti 文档存储系统也采用布隆过滤器来检测先前存储的数据
  • SPIN 模型检测器也使用布隆过滤器在大规模验证问题时跟踪可达状态空间
  • Google Chrome浏览器使用了布隆过滤器加速安全浏览服务

如果允许误判率的话,可以使用布隆过滤器,只有你想不到的,没有你做不到的。

判断用户是否阅读过某一个视频或者文章,类似抖音,刷过的视频往下滑动不再刷到,可能会导致一定的误判,但不会让用户看到重复的内容

布隆过滤器在这个场景用的对吗?

  • 如果布隆过滤器说这个视频不存在,那肯定不存在,用户就会刷到它,他肯定没看过这个视频,符合预期
  • 如果布隆过滤器说这个视频存在,但不一定存在,用户就刷不到了这个视频了,那这不就错过一个视频了吗,类似用户丢消息了,这能接受吗?

SpringBoot+Docker:高效容器化的最佳实践
https://mp.weixin.qq.com/s/AkX53sMwx3wiCGufAAFN9w

https://mp.weixin.qq.com/s/BbV43_T6UzHvG8GnqESEUg

Best Microsoft Office alternative of 2024
https://www.techradar.com/news/best-microsoft-office-alternative

office2003蜻蜓特派员3in1 官方版
https://pan.baidu.com/s/1cCNaCu?at=1717033722095

编译原理(七)——自顶向下语法分析概述
https://blog.csdn.net/weixin_43633784/article/details/108620459

First集、Follow集、Predict集的简单求法 三个重要集合
https://blog.csdn.net/qnsEmma/article/details/107943236

https://blog.csdn.net/m0_61819793/article/details/134274982

202404

Embeddings
https://platform.openai.com/docs/guides/embeddings

OpenAI’s text embeddings measure the relatedness of text strings.

An embedding is a vector (list) of floating point numbers. The distance between two vectors measures their relatedness. Small distances suggest high relatedness and large distances suggest low relatedness.

OpenResty 开发速览
https://www.ogura.io/posts/2019/01/openresty_quickview/

eBPF专题一 | 手把手教你用eBPF诊断MySQL(含源码)
https://mp.weixin.qq.com/s/3S2t-Nfip-2--aOgov4qtw

蚂蚁专家介绍RDMA技术砖题(一):技术概述
https://mp.weixin.qq.com/s/WlQlN3qR9DxXvvI_PQnr3A

http://news.sohu.com/a/716725440_411876

AI Agent的深度思考 | 附十一个行业的应用场景
https://mp.weixin.qq.com/s/5hh-HLUmgI_ODzbqA0d_ag

Lor 是什么#
Lor是一个运行在OpenResty上的使用Lua编写的Web框架。 它兼顾开发效率和运行时性能, 可用于快速开发API Server和传统Web页面应用。
http://lor.sumory.com/docs/getting-started-cn

被cloudflare 代理后 nginx 如何获取客户真实ip
https://zhuanlan.zhihu.com/p/668005446
https://nocache.org/p/restore-real-ip-address-from-cloudflare-cdn-in-nginx

Configuring Your Nginx Server for Mutual TLS mtls
https://smallstep.com/hello-mtls/doc/server/nginx
https://developers.cloudflare.com/ssl/client-certificates/

Everything You Need To Know About IRON CONDORS
https://optionstradingiq.com/wp-content/uploads/Iron-Condor.pdf

https://github.com/DeliberateEngineer

「十一充电」腾讯魔方技术总监:作为游戏程序员是如何自我提升的?
https://baijiahao.baidu.com/s?id=1646675636195344957&wfr=spider&for=pc

Yes, taking a contrarian view can be profitable when markets panic,
but we also need to be aware that some of the worst market declines in history have come AFTER the VIX Futures market moved into Backwardation.

SHRINK an Amazon AWS EBS root volume (2020 Update)
https://medium.com/@ztobscieng/shrink-an-amazon-aws-ebs-root-volume-2020-update-8db834265c3e

Cilium:基于eBPF的高效云原生网络和ServiceMesh方案
https://www.51cto.com/article/759002.html

【网络】eBPF、Cilium、Calico
https://zhuanlan.zhihu.com/p/500174411

司徒捷
http://finance.sina.com.cn/zl/usstock/20141028/173120665258.shtml
https://baijiahao.baidu.com/s?id=1738975229150699274&wfr=spider&for=pc

OpenResty使用Lua大全(十)实战: Lua + Redis 实现动态封禁 IP
https://feixiang.blog.csdn.net/article/details/136658128

OpenResty使用Lua大全(十二)实战: 动手实现一个网关框架
https://blog.csdn.net/A_art_xiang/article/details/136658438

计算机中我们常常会混淆指令周期、CPU周期和时钟周期,要区分这些并不难,但要想彻底弄懂这些,就得要求我们对CPU底层有一定了解。
https://zhuanlan.zhihu.com/p/90829922

  • 指令周期(Instruction Cycle):取出并执行一条指令的时间。
  • CPU 周期:一条指令执行过程被划分为若干阶段,每一阶段完成所需时间。
  • 时钟周期(Clock Cycle):又称震荡周期,是处理操作的最基本单位。

所以,我们说一个指令周期,包含多个 CPU 周期,而一个 CPU 周期包含多个时钟周期。

【浅析】x86模式变迁下Linux的启动过程
https://zhuanlan.zhihu.com/p/86058611

Linux启动具体过程:

  • 电脑刚加电时,会把 CS 重置为0xFFFF,IP重置为0x0000 ,所以第一条指令就会指向0xFFFF0,属于ROM范围。
  • 进入BIOS时期;BIOS首先会检查硬件,如果硬件没问题,会开始建立中断向量表和中断服务(BIOS中基本输入输出要基于中断服务),最后BIOS会将启动盘的第一个扇区MBR 512字节加载到内存中的 0x7c00 来运行。(MBR存放的为boot.img,由 boot.S 编译而成,再由grub2安装至启动盘)
  • 进入BootLoader时期;bot.img做的唯一事情就是加载core.img(core.img由一系列的模块组成)。boot.img将控制权交给disk.img,disk.img的任务就是加载core.img其他部分,先是lzma_decompress.img,再是kenel.img,最后是各个模块对应的映像。
  • lzma_decompress.img调用real_to_prot切换到保护模;切换过程主要做两部分工作:
    • 一是启用分段,在内存中建立段描述符表,将段寄存器变成选择子,指向某个段描述符
    • 二是启用分页
  • 解压缩kernel.img;kenel.img会调用grub_main函数,在这个函数里边,grub_load_config()会开始解析grub.conf文件里的配置信息,然后grub_show_menu()会显示让你选择的操作系统列表,然后grub_menu_execute_entry()开始加载操作系统。
  • 启动内核

Go中的组合
https://zhuanlan.zhihu.com/p/619881005

eBPF实用技巧 | 函数参数超过5个怎么办?
https://mp.weixin.qq.com/s/tZR4YW2cD4Goe9lUPSuOhA

起 eBPF 大家都不陌生,就内核而言,hook 会尽可能选在 tracepoint,如果没有 tracepoint,会考虑使用 kprobe。

tracepoint 的范围有限,而内核函数又太多,基于各种需求场景,kprobe 的出场机会较多;但需要注意的,并不是所有的内核函数都可以选作 hook 点,inline 函数无法被 hook,static 函数也有可能被优化掉;如果想知道究竟有哪些函数可以选做 hook 点,在 Linux 机器上,可以通过less /proc/kallsyms查看。

windows 内存溢出

printf '\xcc%.0s' {1..1000}|iconv -f gbk -t utf-8 - -o -
烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫

关于“烫烫烫烫烫烫烫”的程序员笑话
https://blog.csdn.net/duke_ding2/article/details/130907027

https://www.futunn.com/learn/detail-how-to-trade-options-on-a-computer-86188-230557322?global_content={"promote_id"%3A13766%2C"sub_promote_id"%3A38}

【期权分析工具】波动率分析:如何判断期权的估值水平?
https://www.futunn.com/learn/detail-options-analysis-tool-volatility-analysis-how-to-determine-the-valuation-level-of-options-86188-230550334
【期权分析工具】价格计算器:如何计算期权的未来价格?
https://www.futunn.com/learn/detail-option-analysis-tool-price-calculator-how-to-calculate-the-future-price-of-options-86188-230569331
【期权分析工具】异动分析:如何跟踪大资金的动向?
https://www.futunn.com/learn/detail-options-analysis-tool-transaction-analysis-how-to-track-the-movement-of-large-funds-86188-230551335

https://www.investingdaily.com/45022/option-delta-calculation-explained/

Know Your Greek Letters for Better Trading Results
https://www.investingdaily.com/71403/know-your-greek-letters-for-better-trading-results/

【可转债知识】04可转债四大要素-回售条款
https://xueqiu.com/8132666925/257544240

Practical Linux tracing ( Part 1/5) : symbols, debug symbols and stack unwinding
https://tungdam.medium.com/things-you-should-know-to-begin-playing-with-linux-tracing-tools-part-i-x-225aae1aaf13

投資美股最核心的20張圖表
https://x.com/TheInvestorLEI/status/1781064276658282788

AI Agent的深度思考 | 附十一个行业的应用场景
https://mp.weixin.qq.com/s/5hh-HLUmgI_ODzbqA0d_ag

好用投資工具網站App分享:選股、基本面、估值、回測(2024.2)
https://vocus.cc/article/65d83f7ffd89780001d4f385

https://www.gurufocus.com/pricing

As the founder of GuruFocus.com, many people naturally assume that I have a degree in finance or some other closely related field. However, I actually possess a Ph.D. in physics.

https://www.cnn.com/markets/fear-and-greed

A few big stocks can skew returns for the market.
It’s important to also know how many stocks are doing well versus those that are struggling.
This shows the number of stocks on the NYSE at 52-week highs compared to those at 52-week lows.
When there are many more highs than lows, that’s a bullish sign and signals Greed.

The market is made up of thousands of stocks.
And on any given day, investors are actively buying and selling them.
This measure looks at the amount, or volume, of shares on the NYSE that are rising compared to the number of shares that are falling.
A low (or even negative) number is a bearish sign.
The Fear & Greed Index uses decreasing trading volume as a signal for Fear.

可转债知识】06快速看懂一只可转债!
链接:https://xueqiu.com/8132666925/259443693
要看懂一只可转债,应该先在募集说明说里找到转股价、下修条款、强赎条款、回售条款四大要素,募集说明书在各家券商APP可转债页面下的公告里都能找到

Miller is like awk, sed, cut, join, and sort for data formats such as CSV, TSV, JSON, JSON Lines, and positionally-indexed.
https://github.com/johnkerl/miller?tab=readme-ov-file

Is there a robust command line tool for processing csv files?
https://unix.stackexchange.com/questions/7425/is-there-a-robust-command-line-tool-for-processing-csv-files

I’m sure there are more criticisms, but the impetus for this project was a 40GB CSV file that was handed to me. I was tasked with figuring out the shape of the data inside of it and coming up with a way to integrate it into our existing system. It was then that I realized that every single CSV tool I knew about was woefully inadequate. They were just too slow or didn’t provide enough flexibility. (Another project I had comprised of a few dozen CSV files. They were smaller than 40GB, but they were each supposed to represent the same kind of data. But they all had different column and unintuitive column names. Useful CSV inspection tools were critical here—and they had to be reasonably fast.)

A fast CSV command line toolkit written in Rust.
https://github.com/BurntSushi/xsv?tab=readme-ov-file

$ pv test.csv|csvcut -c 9 | grep -Ev '^""$' | wc -l
13.0GiB 0:05:55 [37.5MiB/s] [==============================================================================================>] 100%
9316774
$ pv test.csv| xsv fixlengths -l 10 |xsv search  -s 9 -v '^$'| wc -l
13.0GiB 0:02:00 [ 110MiB/s] [==============================================================================================>] 100%
9316799

Open Source realtime backend in 1 file
pocketbase.io

https://twitter.com/WealthCoachMak/status/1784255938427240786
If you had $250,000 cash and sold options with it…
It might be enough to retire early
You can generate $3k to $10k per month and if that covers your monthly expenses…
You never have to work again
Option Selling is very powerful

words

  • instruments
  • security
  • stock
  • equities
  • share
  • holders
  • portfolio
  • positions
  • net worth

WHAT IS IV RANK AND HOW TO USE IT. 2023 GUIDE
https://optionstradingiq.com/what-is-iv-rank-and-how-to-use-it/

https://caifuhao.eastmoney.com/news/20231109093356353014470
“历史总是惊人的相似。”股市的行情总会在绝望中产生,在犹豫中上涨,在疯狂中灭亡。这是一个不断循环的过程,也是市场的一种规律。投资者们需要学会在绝望中寻找希望,抓住犹豫中的机会,避免在疯狂中迷失自我。只有这样,他们才能够在股市的大潮中游刃有余,成为真正的赢家。

电子取证之PC版微信数据库解密
https://cn-sec.com/archives/440791.html

Function graph tracer for C/C++/Rust/Python
https://github.com/namhyung/uftrace

202402

Clickhouse 纯手工迁移表
https://www.cnblogs.com/hdpdriver/p/16088755.html

ClickHouse 建表create table时primary by与order by
https://blog.csdn.net/qq_36951116/article/details/106260189

  • ORDER BY的作用, 负责分区内数据排序;
  • PRIMARY KEY的作用, 负责一级索引生成;
  • Merge 的逻辑, 分区内数据排序后,找到相邻的数据,做特殊处理。
    • 只有在触发合并之后,才能触发特殊逻辑。以去重为例,在没有合并的时候,还是会出现重复数据。
    • 只对同一分区内的数据有效。以去重为例,只有属于相同分区的数据才能去重,跨越不同分区的重复数据不能去重。
  • 通常只有在使用 SummingMergeTree 或 AggregatingMergeTree 的时候,才需要同时设置ORDER BY与PRIMARY KEY。
    • 显式的设置 PRIMARY KEY,是为了将主键和排序键设置成不同的值,是进一步优化的体现。
    • 如果 ORDER BY 与 PRIMARY KEY 不同,PRIMARY KEY 必须是 ORDER BY 的前缀(为了保证分区内数据和主键的有序性)。

ClickHouse 查询优化详细介绍
https://mp.weixin.qq.com/s/38RMVbw25P3iuE4IIuxdog

https://clickhouse.com/docs/zh/engines/table-engines/mergetree-family/mergetree

日志分析下ES/ClickHouse/Loki比较与思考
https://mp.weixin.qq.com/s/n2I94X6tz2jOABzl1djxYg

  • 方案A:Local Storage + Pssh扫描派(代表作:跳板机上各种脚本)
  • 方案B:Central Storage + Inverted Index派(代表作:ES)
  • 方案C:Central Storage + Column Storage + MR派(代表作:Hive)
  • 方案D:Central Storage + Column Storage + MPP派(代表作:ClickHouse)
  • 方案E:Central Storage + 扫描类(代表作:Grafana-Loki)

可观测性数据收集集大成者 Vector 介绍
https://blog.csdn.net/n9ecommunity/article/details/133810461

核心就是 pipeline 的处理,有 Source 端做采集,有中间的 Transform 环节做数据加工处理,有 Sink 端做数据转发。

  • 超级快速可靠:Vector采用Rust构建,速度极快,内存效率高,旨在处理最苛刻的工作负载
  • 端到端:Vector 致力于成为从 A 到 B 获取可观测性数据所需的唯一工具,并作为守护程序、边车或聚合器进行部署
  • 统一:Vector 支持日志和指标,使您可以轻松收集和处理所有可观测性数据
  • 供应商中立:Vector 不偏向任何特定的供应商平台,并以您的最佳利益为出发点,培育公平、开放的生态系统。免锁定且面向未来
  • 可编程转换:Vector 的高度可配置转换为您提供可编程运行时的全部功能。无限制地处理复杂的用例

快手、携程等公司转战到 ClickHouse,ES 难道不行了?
https://mp.weixin.qq.com/s/hP0ocT-cBCeIl9n1wL_HBg

https://zhuanlan.zhihu.com/p/547100507
ClickHouse现在是云原生的,支持分层存储。如果你关注它,会看到它的一条演进轨迹。最开始是单机的,单机即可实现很多高性能查询;然后演进到分布式,利用了比如复制表、分布式表,巧妙地变成了一个分布式架构;再往后,大家在讲云原生,也是可以分层存储、存算分离,有一些存储可以放到S3上,也可以放到HDFS上面去;后来也支持了OSS,目前也是通过原生的分层存储方式向云原生再迈进了一步。在此之前,虽然ClickHouse支持把一些冷数据,或者是部分的数据放到像S3这样的对象存储上面去,但是它的实现比较粗暴。

mysql 加密

mysql> select hex('给我狗子');
+--------------------------+
| hex('给我狗子')          |
+--------------------------+
| E7BB99E68891E78B97E5AD90 |
+--------------------------+
1 row in set (0.00 sec)

mysql> select unhex(hex('给我狗子'));
+----------------------------+
| unhex(hex('给我狗子'))     |
+----------------------------+
| 给我狗子                   |
+----------------------------+
1 row in set (0.00 sec)


mysql> select hex(AES_ENCRYPT('13884331246','abc123')) encrypt_text;
+----------------------------------+
| encrypt_text                     |
+----------------------------------+
| 61F56849292176EAD44B26FCDB52C791 |
+----------------------------------+
1 row in set (0.00 sec)

mysql> select AES_DECRYPT(unhex('7EDEB1877EE7AD6BD30BE668ECF924A4'),'password') plain_text;
+-------------+
| plain_text  |
+-------------+
| 13884331246 |
+-------------+
1 row in set (0.00 sec)

ClickHouse自定义函数实例教程
https://blog.csdn.net/neweastsun/article/details/130235194

ck 随机取 30% 的数据

where rand32()<pow(2,32)*0.3

ClickHouse性能调优之排序和数据类型
https://www.yii666.com/blog/499218.html

  • 通过排序键可以让内存使用大幅减少,尤其是select查询中按排序键排序。
  • 对于已存在的表,排序表达式仅可以使用新增列
  • 正确使用排序键可以提升压缩因子20多倍,重复值相较于随机值更有利于压缩。
  • 在处理大型表并寻找最佳性能查询时,需要仔细选择数据类型。
    • 不要把整形设置为float型
    • 对数值设置合适的精度,精度越低越好
    • 对于文本类型尽可能使用LowCardinality(String) 或FixedString

clickhouse里的数组数据类型与相关使用介绍
https://blog.csdn.net/u010882234/article/details/130464938

从 ClickHouse 到 Apache Doris,腾讯音乐内容库数据平台架构演进实践
https://www.infoq.cn/article/nybtjqs07zcrqqnc0xwt

浅谈ClickHouse聚合和窗口函数
https://blog.csdn.net/weixin_59801183/article/details/134186433

Uber 如何使用MySQL + Redis提供4000 万/秒的读取请求
https://mp.weixin.qq.com/s/cneQcz_uEwChMFuWtoVolw

ClickHouse 到底有多神? - leiysky的回答 - 知乎
https://www.zhihu.com/question/505958148/answer/3341039818

mysql 提高写入性能,写入完毕后要注释掉

skip-log-bin
innodb_doublewrite = 0
innodb_log_buffer_size = 32M

SPL 实践:单节点实现每日百亿时序数据实时写入和秒级统计
https://c.raqsoft.com.cn/article/1705410891469

doris-10亿数据和100万表join高并发测试
https://www.cnblogs.com/lilei2blog/p/15524029.html

How to merge large tables in ClickHouse using join
https://datachild.net/data/clickhouse-join-large-tables-on-column

Optimizing ClickHouse Joins for Performance: A Deep Dive into Nested-Loop and Merge-Scan Joins with Practical Examples
https://chistadata.com/optimizing-clickhouse-joins-for-performance-a-deep-dive-into-nested-loop-and-merge-scan-joins-with-practical-examples/

MergeJoin是一种基于排序的连接算法,它要求参与连接的表在连接字段上进行排序。Merge Join 的原理如下:

  • 对参与连接的表按照连接字段进行排序,确保两个表的连接字段是有序的。
  • 使用两个指针分别指向两个表的第一个记录。
  • 比较两个指针所指向的记录的连接字段的值,如果相等,则将这两条记录合并为一条,并输出。
  • 如果两个指针所指向的记录的连接字段的值不相等,则将连接字段较小的记录的指针向后移动一位,然后继续比较。
  • 重复步骤 3 和步骤 4,直到其中一个表的记录全部被处理完

Merge Join 的优势在于它只需要对参与连接的表进行一次排序,并且可以并行处理多个连接操作,从而提高查询的效率

  • 数据排序 为了使用 Merge Join,参与连接的表必须在连接字段上进行排序。如果表没有按照连接字段排序,可以使用ClickHouse 提供的ORDER BY 语句对表进行排序。
  • 数据类型 Merge Join 要求连接字段的数据类型必须相同,否则无法进行连接。在进行连接操作之前,需要确保连接字段的数据类型一致。
  • 内存限制 Merge Join 使用了一定的内存来存储连接字段的值,如果连接字段的值较大或者连接的表的数据量很大,可能会导致内存不足。在使用 Merge Join 时,需要根据实际情况调整 ClickHouse 的内存配置,确保有足够的内存来执行连接操作。
  • 多表连接 Merge Join 可以连接两个或多个表。当连接多个表时,需要保证每个表的连接字段都进行了排序,并且连接字段的数据类型相同。

原文链接:https://blog.csdn.net/weixin_42754420/article/details/132794340

ClickHouse Joins Under the Hood - Full Sorting Merge Join, Partial Merge Join - MergingSortedTransform
https://clickhouse.com/blog/clickhouse-fully-supports-joins-full-sort-partial-merge-part3

查看 raid 信息

$ sudo mdadm --detail /dev/md5
/dev/md5:
           Version : 1.2
     Creation Time : Thu Dec 22 23:42:37 2022
        Raid Level : raid10
        Array Size : 7394613248 (6.89 TiB 7.57 TB)
     Used Dev Size : 3697306624 (3.44 TiB 3.79 TB)
      Raid Devices : 4
     Total Devices : 4
       Persistence : Superblock is persistent

Redis数据结构:Stream类型全面解析
https://blog.csdn.net/weixin_45187434/article/details/132593271

group_concat 和 over partition

mysql> select * from a;
+------+-------+
| a_id | a_age |
+------+-------+
|    1 |     2 |
|    2 |     3 |
|    3 |     4 |
+------+-------+
3 rows in set (0.00 sec)

mysql> select * from b;
+------+-------+
| b_id | b_age |
+------+-------+
|    1 |     5 |
|    1 |     6 |
|    3 |     6 |
+------+-------+
3 rows in set (0.00 sec)

mysql> select a_id,a_age,group_concat(b_age,',') from a left join b on a_id = b_id group by a_id,a_age;
+------+-------+-------------------------+
| a_id | a_age | group_concat(b_age,',') |
+------+-------+-------------------------+
|    1 |     2 | 6,,5,                   |
|    2 |     3 | NULL                    |
|    3 |     4 | 6,                      |
+------+-------+-------------------------+
3 rows in set (0.04 sec)

mysql> select b_age,a.*, count(*) over(partition by b_age) match_count,row_number() over(partition by b_age) match_number from b left join a on b_id = a_id;
+-------+------+-------+-------------+--------------+
| b_age | a_id | a_age | match_count | match_number |
+-------+------+-------+-------------+--------------+
|     5 |    1 |     2 |           1 |            1 |
|     6 |    1 |     2 |           2 |            1 |
|     6 |    3 |     4 |           2 |            2 |
+-------+------+-------+-------------+--------------+
3 rows in set (0.00 sec)

Appending to a File from Multiple Processes
https://nullprogram.com/blog/2016/08/03/

MONGODB 内存使用分析与判断内存是否缺少
https://cloud.tencent.com/developer/article/2047328

ilickhouse has everything to be one of the most used databases in the future. But today it is not yet possible to be used, only for data already processed and only use simple select and simple queries.

It really is an incredibly fast database, but it lacks features much used in other banks, such as subselect. With subselect we can use almost everything without relying on its own functions (UDF). Without both functions its use is complicated.

I will try to work Clickhouse together as MonetDB and post here if the result was good.

csv文件中每隔 100 行取一行,保留第一行的 headers

awk '(NR%100==0 || NR==1){print $0}' result.csv

How to Do IP Address Geolocation Lookups on Linux
https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/

sudo apt-get install geoip-bin
geoiplookup 8.8.4.4
https://dev.maxmind.com/geoip/geolite2-free-geolocation-data
sudo apt install mmdb-bin

企业运维实践-Nginx使用geoip2模块并利用MaxMind的GeoIP2数据库实现处理不同国家或城市的访问最佳实践指南
https://www.zhihu.com/tardis/bd/art/547045377

JAVASCRIPT & CSS WORLD MAP
https://www.cssscript.com/tag/world-map/

https://www.cssscript.com/interactive-vector-map/

只需提供一个视频 主题 或 关键词 ,就可以全自动生成视频文案、视频素材、视频字幕、视频背景音乐,然后合成一个高清的短视频
https://github.com/harry0703/MoneyPrinterTurbo

nginx-geoip2

nginx 集成 IP 地理位置

$ nginx -v
nginx version: nginx/1.24.0
$ cd ~/download/
$ wget http://nginx.org/download/nginx-1.24.0.tar.gz
$ tar xf nginx-1.24.0.tar.gz
$ wget -c https://github.com/leev/ngx_http_geoip2_module/archive/refs/tags/3.4.tar.gz -O ngx_http_geoip2_module-3.4.tar.gz
$ tar xf ngx_http_geoip2_module-3.4.tar.gz
$ cd nginx-1.24.0/
$ which nginx
/usr/sbin/nginx
$ nginx -V
nginx version: nginx/1.24.0
built by gcc 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
built with OpenSSL 1.1.1f  31 Mar 2020
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.24.0/debian/debuild-base/nginx-1.24.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
$ ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.24.0/debian/debuild-base/nginx-1.24.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --add-dynamic-module=../ngx_http_geoip2_module-3.4
$ ls objs/*.so
objs/ngx_http_geoip2_module.so  objs/ngx_stream_geoip2_module.so
$ sudo cp -a objs/*.so /etc/nginx/modules
$ ls /etc/nginx/modules
ngx_http_geoip2_module.so  ngx_http_js_module-debug.so  ngx_http_js_module.so  ngx_stream_geoip2_module.so  ngx_stream_js_module-debug.so  ngx_stream_js_module.so
$ sudo nginx -s stop
$ sudo cp -a objs/nginx /usr/sbin/nginx
$ sudo nginx
$ sudo vi /etc/nginx/nginx.conf

    load_module modules/ngx_http_geoip2_module.so;
    http {
        log_format  main  '$remote_addr $geoip2_data_country_code [$time_local] $request_time $request '
            '$status $host $http_accept_encoding $body_bytes_sent "$http_referer" '
            '"$http_user_agent" "$http_x_forwarded_for" ';

        geoip2 /usr/local/GeoIP2/GeoLite2-City.mmdb {
            $geoip2_data_country_name country names en;
            $geoip2_data_country_code default=CN source=$remote_addr country iso_code;
        }

        map $geoip2_data_country_code $lang_ch {
            CN yes;
            TW yes;
            HK yes;
            MO yes;
            default no;
        }

        access_log  /var/log/nginx/access.log main;

        server {
            location /geotest {
                default_type text/html;
                if ($lang_ch = no) {
                    return 403 "Access denied!IP [ $remote_addr ] $geoip2_data_country_code";
                }
                return 200 "Welcome to you! IP [ $remote_addr ] $geoip2_data_country_code";
            }
        }
    }

$ tail -f /var/log/nginx/access.log

202401

How to install and use ZSTD compression tool on Linux
https://linuxconfig.org/how-to-install-and-use-zstd-compression-tool-on-linux

zstd example1.txt
zstd -d example1.txt.zst
tar --zstd -cf example.tar.zst example/

mysql: slow import
https://dba.stackexchange.com/questions/271097/mysql-slow-import

SET GLOBAL innodb_flush_log_at_trx_commit = 2;

[mysqld]
skip-log-bin
innodb_doublewrite = 0
innodb_log_buffer_size = 32M

SHOW VARIABLES LIKE 'log_bin';

InnoDB关键特性之double write
https://www.cnblogs.com/wangqianqiannb/p/9754450.html

关于IO的最小单位:

  • 数据库 IO 的最小单位是 16K(MySQL默认,oracle是8K)

  • 文件系统 IO 的最小单位是 4K(也有 1K 的)

  • 磁盘 IO 的最小单位是 512B

    show variables like ‘%double%’;
    show global status like ‘%dblwr%’;

python 数据类型 复数
https://zhuanlan.zhihu.com/p/617689935?utm_id=0

  • 在电路分析中,复数可以用来表示电路中的电压、电流等物理量,例如电压可以表示为实部加上虚部的复数,而阻抗可以表示为复数形式的电阻和电抗。
  • 在信号处理中,复数可以用来表示信号的幅度和相位,例如正弦信号可以表示为实部为幅度,虚部为相位的复数形式。
  • 在图像处理中,复数可以用来表示图像的频域信息,例如图像可以通过傅里叶变换转换为频域信息,而频域信息可以表示为实部和虚部的复数形式。
  • 除此之外,复数还可以用于解决一些数学问题,例如求解方程、计算积分等。

从 CoT 到 Agent,最全综述来了!上交出品
https://baijiahao.baidu.com/s?id=1783669439007774940&wfr=spider&for=pc

tmate 的意思是 teammates,它是 tmux 的一个分支,并且使用相同的配置信息(例如快捷键配置,配色方案等)。它是一个终端多路复用器,同时具有即时分享终端的能力。它允许在单个屏幕中创建并操控多个终端,同时这些终端还能与其他同事分享。

你可以分离会话,让作业在后台运行,然后在想要查看状态时重新连接会话。tmate 提供了一个即时配对的方案,让你可以与一个或多个队友共享一个终端。
https://www.linuxprobe.com/quickly-share-tmate.html

  • 运行 tmate 时,会通过 libssh 在后台创建一个连接到 tmate.io (由 tmate 开发者维护的后台服务器)的 ssh 连接。
    tmate.io 服务器的 ssh 密钥通过 DH 交换进行校验。
  • 客户端通过本地 ssh 密钥进行认证。
  • 连接创建后,本地 tmux 服务器会生成一个 150 位(不可猜测的随机字符)会话令牌。
  • 队友能通过用户提供的 SSH 会话 ID 连接到 tmate.io

How to close terminal without killing running processes on Linux
https://tecadmin.net/close-terminal-without-killing-running-processes-on-linux/

CTRL + Z 
bg
disown -h %1

jobs -l
sudo tail -f /proc/609120/fd/1

eBPF 实践教程:使用 uprobe 捕获多种库的 SSL/TLS 明文数据
https://eunomia.dev/zh/tutorials/30-sslsniff/

查看进程重定向
https://unix.stackexchange.com/questions/15693/see-the-stdout-redirect-of-a-running-process

$ cat test.sh
while true;do date;sleep 1;done
$ bash test.sh >> test.log
^Z
[1]+  Stopped                 bash test.sh >> test.log
$ bg
[1]+ bash test.sh >> test.log &
$ jobs -l
[1]+ 2168892 Running                 bash test.sh >> test.log &
[02:01:07 ubuntu@scripts-server ~/haohu]$ disown -h %1
$ readlink -f /proc/2168892/fd/1
test.log
$ lsof test.log
COMMAND     PID   USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
bash    2168892 ubuntu    1w   REG  259,1     7250 768788 test.log

终端迁移

$ ps -ef | grep test.sh
ubuntu   2185765 2185718  0 02:35 pts/16   00:00:00 bash test.sh
$ screen -S test
$ sudo reptry -t 2185718
  • 分享一个实用的小工具 https://github.com/nelhage/reptyr Reparent a running program to a new terminal。

  • 比如你在远程终端下运行一个需要执行很久的脚本,没有在 screen 或 tmux 下,也没有用nohup 执行,一旦终端关掉,所有子进程就会自动被关闭,脚本还要重新运行。

  • 以前需要 ctrl+z, bg, disown 一梭子,虽然能保住进程不挂掉,但 stdout 和 stderr 都无法查看了,除非之前做了重定向可以用readlink -f /proc/$pid/fd/1 继续查看脚本输出。

  • 现在这个小工具可以直接把当前终端会话连带子进程一锅端迁移到另一个screen会话里,输入输出都会自动迁移。

Redis module功能介绍
https://blog.51cto.com/u_15127532/2659222

  • 布隆过滤器 RedisBloom
    • 当尝试通过网络或磁盘搜索查询时,可以先查询BloomFilter,它肯定地告诉我们要查找的元素是否可能存在(然后可以继续进行查找)还是不存在(此时可以放弃查询直接回复不存在,节省查询资源)。
    • 布隆过滤器在网页去重,数据查询和广告投放中经常被使用;新业务上线前,增加布隆过滤器也是一个很有效解决缓存击穿的有效手段。
    • 实际上是一个很长的二进制向量和一系列随机映射函数,可以用于检索一个元素是否在一个集合中。它的优点是空间效率和查询时间都比一般的算法要好的多,但是有一定的误识别率且无法删除元素。
    • 只要有一次哈希计算的结果对应为 0,则该元素一定不存在;反之则可能存在。
  • 布谷鸟过滤器 CuckooFilter
    • 布谷鸟过滤器在做防缓存击穿时具有很好的表现,与布隆过滤器不同的是,它可以删除元素
  • 支持json的模块 Redisjson
    • 它允许从 Redis 存储、更新和获取 JSON 值。
    • redisjson 可以通过在 redis 服务器本地直接操作部分数据
  • 咆哮位图 Redis-roaring
    • 咆哮位图(RoaringBitmap)将整个大位图进行了分块,如果整个块都是零,那么这整个块就不用存了。
    • 但是如果位图中的元素比较少且分散,每个块里面都有 1,只存储所有位 1 的块内偏移量(整数),这就是单个块位图的稀疏存储形式 —— 存储偏移量整数列表。
  • 可用于检索的模块 RediSearch
    • 它使用户能够以极快的方式对其 Redis 数据集执行复杂的搜索查询,例如精确的词组匹配和文本查询的数字过滤,
    • 还有使用 Reids 自带的 GEO 命令进行地理过滤
  • 支持机器学习的redis RedisML/RedisAI
  • 支持事物处理的模块 RedisGears

物联网边缘计算中的全能数据库RedisEdge:实时数据、时间序列、AI、消息流、MapReduce
https://zhuanlan.zhihu.com/p/81505287

在物联网边缘计算的复杂环境中,应用程序不可避免地需要多个数据模型:

  • 内存数据库存储采集的实时设备数据。
  • 现场会断网,所以需要把待发送到云端的数据存储到时间序列数据库中。同时边缘侧需要对历史数据进行聚合分析,例如计算温度一段时间内平均值。
  • 现场采集的数据需要转发给一个或多个消费者进行处理。
  • 边缘侧需要人工智能学习能力,来支持视频流分析,图像识别,故障诊断等低延迟响应业务。
  • 边缘侧进行类似 MapReduce 的计算。
  • 运行占用空间小,以能在性能受限的边缘计算计算节点上运行。

RedisEdge将开源版本Redis(带有Redis Streams的5.0版本)与RedisAI和RedisTimeSeries、RedisGears这三个模块一起打包,就可以提供边缘计算所需的数据模型了:

  • Redis 5.0版本,内置的Set、List、Hash等数据结构可用作实时内存数据库,用来存储边缘网关采集到的设备实时数据。
  • Redis 5.0版本的Redis Streams数据结构,可用做消息中间件,把采集到的设备实时数据转发给其他边缘计算软件组件。
  • RedisTimeSeries是Redis的一个模块,可用作时间序列数据库,在边缘计算网关断网的情况下,能够离线保存需要上传到云端的设备历史数据。同时也有历史数据降采样、压缩、聚合的功能。
  • RedisGears也是Redis的一个模块,类似MapReduce的分布式动态执行框架,可以用来在分布式的边缘计算节点或者雾计算节点上运行Serverless无服务程序代码。
  • RedisAI也是Redis的一个模块,用于执行深度学习模型,在边缘侧调用PyTorch、Tensorflow和ONNXRuntime等深度学习工具。

一个方案是用开源多模型数据库Postgresql + 扩展插件(连接第三方数据库postgres-fdw + PG时间序列数据库扩展timescale + REST接口暴露PostgREST + 实时流分析pipelinedb) + PL/Python函数或SPI接口。

eBPF 实践教程:使用 uprobe 捕获多种库的 SSL/TLS 明文数据
https://eunomia.dev/zh/tutorials/30-sslsniff/

wget 使用代理
https://zhuanlan.zhihu.com/p/528378176

wget -e use_proxy=yes -e https_proxy=127.0.0.1:8080 https://aka.pw/bpf-ecli -O ecli && chmod +x ./ecli

nettrace - 网络诊断工具
https://github.com/OpenCloudOS/nettrace

  • 在一些场景下(特别是云原生场景),Linux系统中的网络部署变得越来越复杂。
  • 一个TCP连接,从客户端到服务端,中间可能要经过复杂的NAT、GRE、IPVS等过程,网络报文在节点(主机)上的处理路径也变得越来越长。
  • 在发生网络故障(比如网络丢包)时,如何快速、有效地定位出网络问题成为了一个难题。
  • 目前常规的网络故障定位手段,如tcpdump、dropwatch、ftrace、kprobe等存在一定的短板:
  • tcpdump:只能在链路层抓包,无法定位内核协议栈中的问题,比如常规的内核丢包问题
  • ftrace:只能跟踪内核函数,无法进行报文过滤,且入手较难,需要对内核协议栈有一定了解
  • kprobe:临时编写内核模块,效率和安全性低
  • BCC:功能单一,临时编写BCC程序跟踪效率低,需要对内核有一定了解,入手难
  • dropwatch:功能单一,只能查看网络丢包问题,且无法得到丢包原因和解决方案

BTF
# grep BTF /boot/config-$(uname -r)
CONFIG_VIDEO_SONY_BTF_MPX=m
# CONFIG_DEBUG_INFO_BTF is not set

eBPF Hello, World!
https://bowers.github.io/eBPF-Hello-World/

How To Add eBPF Observability To Your Product
https://www.brendangregg.com/blog/2021-07-03/how-to-add-bpf-observability.html

Meet Gain— the New Fastest Go TCP Framework
https://betterprogramming.pub/gain-the-new-fastest-go-tcp-framework-40ec111d40e6

Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 Instance
https://talawah.io/blog/extreme-http-performance-tuning-one-point-two-million/

周刊(第9期):Mozilla rr使用简介
https://www.codedump.info/post/20220313-weekly-9/

rr是由Mozilla出品的一款调试工具,用官网的话来说:

  • rr这个名字里的两个r,意指record and replay,即“记录及回放”,它的使用也很简单,就是这两步:
  • record:rr record /your/application --args 记录下来程序的执行环境。
  • replay:rr replay,默认将使用最近保存的记录文件进行回放,回放时可以进入类似gdb那样的调试环境。

Awk CSV parser
https://github.com/geoffroy-aubry/awk-csv-parser

csv 导入 mysql

假如 csv 有 a,b,c 三列,我们只需要 a,c 列,并且要加入 id 自增列

# 重命名 csv 文件
mv data.csv origin_data.csv
# 创建管道队列文件,文件名要和后面在 db 里创建的表名严格一致
mkfifo data.csv

# 在 db 里建表,用压缩格式以节省空间,增加自增列方便后续按范围分块并发处理
CREATE TABLE `data` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `a` varchar(128),
  `c` varchar(128),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;

# 开一个 screen 准备用 mysqlimport 导入,分隔符用 |,用 --columns 指定列
mysqlimport --fields-terminated-by='|' --fields-optionally-enclosed-by='"' --local \
    --columns='a,c' -uuser -p mydb data.csv

# 再开一个 screen 往队列文件中动态输入只包含 a,c 列的数据
# awk-csv-parser 是基于 awk 的 csv 解析器,性能非常高,默认输出字段以 | 分割
# pv 是一个处理大文件的进度查看器,tail -n+2 用来跳过首行
# cut 命令用来只输出 1,3 列,就是 a,c 列
pv origin_data.csv | awk-csv-parser|tail -n+2 | cut -d'|' -f1,3 > data.csv

# 查看 io
sudo iotop -oPa 
  Total DISK READ:   38.13 M   ⣿⣿⣷⣶⣶⣶⣦⣤⣤⣄⣀⣀⣀⣀⠀⠀⠀⠀⠀ |   Total DISK WRITE:  361.06 M   ⣿⣿⣿⣿⣶⣶⣶⣤⣤⣤⣄⣀⣀⣀⠀⠀⠀⠀⠀
Current DISK READ: 2201.20 K/s ⣿⣇⣧⣼⣀⣰⣶⣆⣴⣦⡀⣦⣠⣤⠀⠀⠀⠀⠀ | Current DISK WRITE:   13.30 M/s ⣿⣀⣄⣤⣤⣼⣧⣶⣾⣄⣸⣿⣄⣰⠀⠀⠀⠀⠀
TID      PRIO USER      DISK READ   DISK WRITE  GRAPH[R+W]▽         COMMAND
373072   be/4 mysql     1044.48 K    180.39 M   ⣿⠀⣤⣰⣰⣸⣷⣆⣿⣀⣼⣶⣀⣰⠀⠀⠀⠀⠀ ►mysqld
601812   be/4 ubuntu      35.52 M      0.00 B   ⣀⣀⣀⣀⡀⣀⣀⣀⣀⣀⠀⣀⣀⣀⠀⠀⠀⠀⠀  pv

iostat -m -x 1 sda
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          11.56    0.00    0.38   26.13    0.00   61.93

Device            r/s     rMB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wMB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dMB/s   drqm/s  %drqm d_await dareq-sz     f/s f_await  aqu-sz  %util
sda             12.00      1.16     2.00  14.29  108.25    98.67  126.00      2.38    20.00  13.70  132.95    19.37    0.00      0.00     0.00   0.00    0.00     0.00    7.00  111.71   18.83  80.80

优点

  • 不需要真正在磁盘上生成原始 csv 的副本,节省磁盘空间,降低 io
  • 解析转换 csv 和导入数据可以同时进行,降低数据处理时间
  • 最终只导入需要的列,不需要导入后再删除列,使用 ROW_FORMAT=COMPRESSED 后改表会非常慢

Using AWK with CSV Files
https://earthly.dev/blog/awk-csv/

echo one,two,three | awk -F "," '{ print $2}'
echo one,\"two\",three | awk -F "," '{ print $2}'
echo 1,\"2a,2b\", 3 | awk -F "," '{ print $3}'

> git clone https://github.com/adamgordonbell/csvquote
> cd csvquote
> go build -o csvquote cmd/cvsquote/main.go
> cp ./csvquote /usr/local/bin

echo 1,\"2a,\"\"2b\", 3 | csvquote
echo 1,\"2a,\"\"2b\", 3 | csvquote | csvquote -u
echo 1,\"2a,2b\", 3 | csvquote | awk -F "," '{ print $2 }' | csvquote -u
  • The gawk version 4 manual says to use FPAT = “([^,]*)|(”[^“]+”)"
  • When FPAT is defined, it disables FS and specifies fields by content instead of by separator.
  • The short answer is “I wouldn’t use gawk to parse CSV if the CSV contains awkward data”, where ‘awkward’ means things like commas in the CSV field data.
  • I’d probably use Perl and the Text::CSV or Text::CSV_XS modules to read and process the data.
  • Remember, Perl was originally written in part as an awk and sed killer - hence the a2p and s2p programs still distributed with Perl which convert awk and sed scripts (respectively) into Perl.

jsonl 处理
https://github.com/jqlang/jq
jq is a lightweight and flexible command-line JSON processor akin to sed,awk,grep, and friends for JSON data. It’s written in portable C and has zero runtime dependencies, allowing you to easily slice, filter, map, and transform structured data.

https://www.baeldung.com/linux/jq-command-json

Capturing the Network Traffic of a Process
https://www.baeldung.com/linux/capture-process-network-traffic

Capturing the network traffic of a process is an important task for system administrators and developers who need to monitor and analyze the information to identify security vulnerabilities or diagnose performance issues.

Airflow概览
https://zhuanlan.zhihu.com/p/352989254

irflow是将多个任务按照其依赖关系组织起来进行管理调度的工具。Airflow基于python编写,通过python脚本可以配置和使用其作为data pipeline。除了命令行之外,Airflow提供了web可视化界面,用来管理和监控任务的执行,并且可以查看任务依赖关系图。Airflow可以方便同Hive、Presto、MySQL、HDFS、Postgres 等数据库交互,另外,提供了hook便于扩展。

DAG(有向无环图)是Airflow工作流的基本概念。DAG的每个节点表示一个任务,有向边是任务之间的依赖。每个任务具有原子性,保证在任务失败的时候可以自动或手动重试该任务,而不必重启整个DAG。这些任务和依赖构成的DAG就是一个工作流。

仿百度网盘的一款轻量级微服务架构网盘系统,云盘系统,文件管理系统
https://gitee.com/college996/zwz-netdisk/tree/master

How do I find out which process is eating up my bandwidth?
https://askubuntu.com/questions/2411/how-do-i-find-out-which-process-is-eating-up-my-bandwidth

  • Use iftop to locate the TCP port on your machine that is receiving the most traffic. Then use sudo netstat -tup to locate the process “owning” that port.
  • sudo apt-get install nethogs
    • sudo nethogs -v 3
  • dstat --net --top-io-adv

Practical Linux tracing ( Part 1/5) : symbols, debug symbols and stack unwinding
https://tungdam.medium.com/things-you-should-know-to-begin-playing-with-linux-tracing-tools-part-i-x-225aae1aaf13

使用strip, eu-strip, objcopy等剥离与导回符号表及调试信息
https://blog.csdn.net/nirendao/article/details/104107608

gcc -g -o test test.c

# test.debug 将包含调试信息和符号表; 而test将只包含调试信息
objcopy --only-keep-debug test test.debug

# 从test文件里剥离debug段
objcopy --strip-debug test

# 更彻底地,上面这句可以换成下面这句以移除所有的debug信息和符号表
strip -s test

# 在二进制文件 test 中添加 .gnu_debuglink 段以指向符号表和调试信息文件
objcopy --add-gnu-debuglink=test.debug test

# objdump 命令可以查看指定的section
objdump -s -j .gnu_debuglink test

https://openanolis.cn/sig/ebpfresearch/doc/633529753894377555

BPF是一个新的动态跟踪技术,目前这项技术正在深刻的影响着我们的生产和生活。

BPF在四大应用场景发挥着巨大作用:系统故障诊断,它可以动态插桩透视内核;网络性能优化,它可以对接收和发送的网络包做修改和转发;系统安全,它可以监控文件打开和关闭从而做出安全决策等;性能监控,它可以查看函数耗费时间从而知道性能瓶颈点。

BPF技术也是随着Linux内核的发展而发展的,Linux内核版本经历了3.x向4.x到5.x演进,eBPF技术的支持也是从4.x开始更加完善起来,特别是5.x内核也增加了非常多的高级特性。但是云上服务器有大量的3.10内核版本是不支持eBPF的,为了让我们现有的eBPF工具在这些存量机器得以运行,我们移植了BPF到低版本内核,同时基于libbpf的CO-RE能力,保证一个工具可运行在3.x/4.x/5.x的低、中、高内核版本。

另外,当前比较热门的BPF开发方式有:

1)纯libbpf应用开发:借助libbpf库加载BPF程序到内核的方式:这种开发方式不仅效率低,没有基础库封装,所有必备步骤和基础函数都需要自己摸索;
2)借助BCC:开发效率高、可移植性好,并且支持动态修改内核部分代码,非常灵活。但存在部署依赖Clang/LLVM等库;每次运行都要执行Clang/LLVM编译,严重消耗CPU、内存等资源,容易与其它服务争抢。

学会Pointer指针事件 ,一套拖拽事件两端(PC端、移动端)跑
https://segmentfault.com/a/1190000043955743

C语言深度理解结构体(内存对齐、位段、偏移量、柔性数组)
https://blog.csdn.net/SPMAX/article/details/122774979

escapture
抓包
./ecapture tls -m pcap -i eth0 --pcapfile=ecapture.pcapng --port=443
sudo ./ecapture mysqld -m /usr/sbin/mysqld

浏览器指纹检测

DWARF
https://www.wenmi.com/article/px5ev6038m8o.html

OhMyZsh,简直是我用来伪装资深程序员的神器!
https://zhuanlan.zhihu.com/p/505591537

brew install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 查看当前在使用的shell
echo $SHELL
# 也可以使用下面命令自行修改默认shell
chsh -s $(which zsh)

macos 安装 Docker

brew install docker docker-compose colima

Docker部署clickhouse(超详细图文教程)
https://blog.csdn.net/fy512/article/details/123482700

docker pull yandex/clickhouse-server
docker pull yandex/clickhouse-client

docker run -d -p 8123:8123 -p 9000:9000 --name clickhouse yandex/clickhouse-server
docker run -it --rm --link clickhouse:clickhouse-server yandex/clickhouse-client --host clickhouse

# 如果想指定目录启动,这里以clickhouse-test-server命令为例,可以随意写
mkdir /work/clickhouse/clickhouse-test-db       ## 创建数据文件目录
# 使用以下路径启动,在外只能访问clickhouse提供的默认9000端口,只能通过clickhouse-client连接server
docker run -d --name clickhouse-test-server --ulimit nofile=262144:262144 --volume=/work/clickhouse/clickhouse_test_db:/var/lib/clickhouse yandex/clickhouse-server


CREATE TABLE t_stock
(
    `id` UInt32,
    `sku_id` String,
    `total_amount` Decimal(16, 2),
    `create_time` Datetime
)
ENGINE = MergeTree()
PARTITION BY toYYYYMMDD(create_time)
PRIMARY KEY id
ORDER BY (id, sku_id)

insert into t_stock values
(101,'sku_002',2000.00,'2020-06-01 11:00:00'),
(102,'sku_004',2500.00,'2020-06-01 11:00:00'),
(103,'sku_002',2000.00,'2020-06-02 11:00:00'),
(104,'sku_002',12000.00,'2020-06-03 11:00:00'),
(105,'sku_002',600.00,'2020-06-04 11:00:00');
select * from t_stock;

docker exec -it clickhouse bash
cd /var/lib/clickhouse/data/

insert into t_stock values
(101,'sku_002',2000.00,'2020-06-01 14:00:00'),
(102,'sku_004',2500.00,'2020-06-01 15:00:00'),
(103,'sku_002',2000.00,'2020-06-01 16:00:00'),
(104,'sku_002',12000.00,'2020-06-01 17:00:00');

OPTIMIZE TABLE t_stock FINAL;

CREATE TABLE t_stock_2
(
    `id` UInt32,
    `sku_id` String,
    `total_amount` Decimal(16, 2),
    `create_time` Datetime,
    INDEX secondIndex total_amount TYPE minmax GRANULARITY 5
)
ENGINE = MergeTree
PARTITION BY toYYYYMMDD(create_time)
PRIMARY KEY id
ORDER BY (id, sku_id)

深入浅出 ClickHouse 物化视图
https://mp.weixin.qq.com/s/7RxBg1mxdpffcpWp02TJ7w

clickHouse-MergeTree家族引擎
https://blog.csdn.net/bwf317/article/details/110785858

  • AggregatingMergeTree 也是预先聚合引擎的一种,用于提升聚合计算的性能
  • 与 SummingMergeTree 的区别在于:
    • SummingMergeTree 对非主键列进行 sum 聚合
    • 而 AggregatingMergeTree 则可以指定各种聚合函数。
  • AggregatingMergeTree 的语法比较复杂,需要结合物化视图或 ClickHouse 的特殊数据类型 AggregateFunction 一起使用
    • AggregateFunction(arg1 , arg2) ;参数一 聚合函数 参数二 数据类型
  • 在 insert 和 select 时,也有独特的写法和要求:写入时需要使用 -State 语法,查询时使用 -Merge 语法。

Working with CSV and TSV data in ClickHouse
https://clickhouse.com/docs/en/integrations/data-formats/csv-tsv

mysql 锁

show status like 'table%';
show status like 'InnoDB_row_lock%';
show engine innodb status\G
show OPEN TABLES where In_use > 0;
select * from performance_schema.data_locks\G
select * from performance_schema.data_lock_waits\G

随着数字技术的发展,数据呈爆炸式增长,数据类型越来越丰富,对数据价值挖掘的实时性要求不断提升,业务场景也越来越复杂度。在过去几年里,数据分析的需求通常采用多套系统组合的方式来完成,比如采用 Kylin 在支持 BI 报表场景,采用 Trino、Impala 支撑交互式分析场景,采用 ClickHouse、Druid 来支撑实时分析场景,StarRocks 希望通过技术创新简化数据技术栈,用户可以借助 StarRocks 一个引擎实现全场景的数据分析。

链接:https://www.zhihu.com/question/415561162/answer/3364773974

当前业界构建数据分析的技术栈,有两条典型的路线,一个是数仓路线,一个是数据湖的路线。数据仓库的路线,数据先通过 ETL 统一写入到数仓进行管理,然后构建数据集市来满足 BI 分析的各种需求,优势是数据质量高、查询性能高、具备实时分析的能力、数据治理功能完善等;而数据湖的路线,通常是未经加工的数据先统一存储在数据湖,作为企业数据的 Single source of truth,然后按需的使用数据,构建数据应用,优势是通开放生态、扩展性强,性价比高。

现在什么数据库或大数据技术比较适合做数据仓库? - StarRocks的回答 - 知乎
https://www.zhihu.com/question/415561162/answer/3364773974

202312

在visudo时更改默认编辑器
https://blog.csdn.net/ethnicitybeta/article/details/122554415

export VISUAL=vim
sudo -E visudo

VISUAL="vim" ; export VISUAL
EDITOR="$VISUAL" ; export EDITOR

sudo usermod -aG root ubuntu
%root   ALL=(ALL:ALL) NOPASSWD:ALL

P就是能在多项式时间内解决的问题,NP就是能在多项式时间验证答案正确与否的问题。用大白话讲大概就是这样。所以P是否等于NP实质上就是在问,如果对于一个问题我能在多项式时间内验证其答案的正确性,那么我是否能在多项式时间内解决它?

SET time_zone = ‘UTC’;
ERROR 1298 (HY000): Unknown or incorrect time zone: ‘UTC’

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p -Dmysql

hysteria2
https://v2.hysteria.network/zh/docs/getting-started/Client/

Retrieve response headers from PHP cURL
https://blog.cpming.top/p/get-response-header-from-php-curl

$headers = [];
$url = "https://www.google.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADERFUNCTION,
    function ($curl, $header) use (&$headers) {
        $len = strlen($header);
        $header = explode(':', $header, 2);
        if (count($header) < 2) // ignore invalid headers
            return $len;

        $headers[strtolower(trim($header[0]))][] = trim($header[1]);

        return $len;
    }
);
$response = curl_exec($ch);
print_r($headers);

https://aws.amazon.com/codewhisperer/

speex是近年来开发出的一套功能强大的语音引擎,能够实现高质量和低比特率的编码。它不仅提供了基于码激励线性预测(CELP)算法的编/解码模块,而且在其最新发布的版本中还提供了声音预处理和声学回声消除模块,为保障IP网络中的语音通信质量提供了技术手段。此外,Speex还具有压缩后的比特率低(2.15~44.2kbps)的特点,并支持多种比特率。这些特点使得Speex特别适合VoIP, 音视频系统
https://blog.csdn.net/liuxunfei15/article/details/120353056

如何使用 Server-Sent Events 和 Flask 构建实时 Web 应用程序
http://www.javascriptcn.com/post/651ccd0795b1f8cacd44d0c6

Split Python Flask app into multiple files in File-Organization
https://pyquestions.com/split-python-flask-app-into-multiple-files

Python 解方程的三种方法
https://zhuanlan.zhihu.com/p/24893371

x + 2y = 3
4x + 5y = 6

In [1]: import numpy as np
   ...: A = np.mat('1,2; 4,5')    # 构造系数矩阵 A
   ...: b = np.mat('3,6').T       # 构造转置矩阵 b (这里必须为列向量)
   ...: r = np.linalg.solve(A,b)  # 调用 solve 函数求解
   ...: print r
   ...:
Out[1]: [[-1.]
         [ 2.]]

202311

整会promise这8个高级用法
https://blog.51cto.com/u_14627797/6989643

promise数组串行执行

const requestAry = [() => api.request1(), () => api.request2(), () => api.request3()];
for (const requestItem of requestAry) {
  await promiseItem();
}

const requestAry = [() => api.request1(), () => api.request2(), () => api.request3()];
const finallyPromise = requestAry.reduce(
    (currentPromise, nextRequest) => currentPromise.then(() => nextRequest()),
    Promise.resolve(); // 创建一个初始promise,用于链接数组内的promise
);

sleep

function sleep(time) {
    return new Promise((resolve) => setTimeout(resolve, time));
}

await sleep(100) // 防止请求发送太快

https://blog.csdn.net/qq_57057576/article/details/125856993

  • 微信小程序中,图片的完全居中显示,line-height并不能发挥效果, line-height可以时内部文字垂直居中显示,但是对于图片并未发挥效果

  • 水平居中显示,可以使用 text-align:center

  • 解决方法:使用flew布局

    display: flex;
    align-items: center;
    justify-content: center;

微信小程序高度height设置百分比无效,只需一步搞定

page{height:100%}

使用 Certbot 为 Nginx 自动配置 SSL 证书
https://blog.csdn.net/qq_34010538/article/details/133825978

sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx

sudo certbot --nginx -d your_domain
sudo certbot renew --dry-run

清理临时文件
https://askubuntu.com/questions/380238/how-to-clean-tmp

sudo find /tmp -type f -atime +10 -delete

https://platform.openai.com/docs/assistants/overview

期货交易生涯中,您遇到哪些契机让你的交易水平发生质的蜕变? - 藏巧守拙的回答 - 知乎
https://www.zhihu.com/question/445059936/answer/2661994653

https://github.com/microsoft/inshellisense
inshellisense provides IDE style autocomplete for shells. It’s a terminal native runtime for autocomplete which has support for 600+ command line tools. inshellisense supports Windows, Linux, & MacOS.

EventSource / Server-Sent Events through Nginx
https://stackoverflow.com/questions/13672743/eventsource-server-sent-events-through-nginx

proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;

How to handle streaming in OpenAI GPT chat completions
https://blog.georgeck.me/how-to-handle-streaming-in-openai-gpt-chat-completions

Here are the main differences:

  • Standard SSE expects GET resources. As you can see, OpenAI expects POST with custom payload.
  • The same API endpoint will respond with content-type: application/json if there are any errors in the API request itself. So, the client will have to handle both types of responses.

english

  • Not only can you make your own GPT for fun or productivity, but you’ll soon be able to publish it on a marketplace they call the GPT Store — and maybe even make a little cash in the process.
  • The new features, announced with many others today at OpenAI’s first developer day in San Francisco, indicate a more hands-off approach to the AI marketplace, which has hitherto been defined by a handful of dedicated general-purpose systems.
  • Indeed, said systems are becoming even more general-purpose with new capabilities, but the AI giant has clearly taken a page from Apple’s book in seeing that being the go-to platform for the ingenuity of others is at least as valuable as having ingenuity oneself.
  • Use Assistant API once it’s released for automatic context retrieval. The Assistant API will create a thread that we can add messages too, to keep the history of actions, but it doesn’t support the Vision API yet.

curl请求IPv6服务(地址)
https://blog.csdn.net/a145127/article/details/127408971

-6 表示使用IPv6的地址
-g 或 --globoff 表示url中允许使用[]
 
curl -6 -g "http://[726c:4666:637f:f130:c92f:5330:6b10:7165]:8080"    

MySQL REGEXP word boundaries [[:<:]] [[:>:]] and double quotes
https://stackoverflow.com/questions/18901704/mysql-regexp-word-boundaries-and-double-quotes

In MySQL up from 8.0.4 use: \\bword\\b

How to declare a variable in MySQL?
https://stackoverflow.com/questions/11754781/how-to-declare-a-variable-in-mysql

MySQL: Selecting multiple fields into multiple variables in a stored procedure
https://stackoverflow.com/questions/2450529/mysql-selecting-multiple-fields-into-multiple-variables-in-a-stored-procedure

SELECT Id, dateCreated
INTO iId, dCreate
FROM products
WHERE pName = iName

Flink的DAG可视化开发实践
链接:https://www.jianshu.com/p/9662f6a65cd8

离线分析之所以适合用DAG进行开发,是因为它的主要逻辑表达语言工具是SQL,再辅以循环、分支、归并等结构,更复杂的情况可以用MR和Python节点解决,这样几乎能完全适应所有离线分析的场景。而Flink虽然支持FlinkQL,但是它在实际工作场景下的适用性太弱了,关键的原因就在于离线分析是属于统计,而流式计算式是计算。SQL擅长统计,但并不适合计算(离线分析中复杂点的计算也基本用UDF来做)。

Flink之所以难以用DAG可视化开发,关键的问题就是它的算子只定义了基本特性,内部的逻辑完全自由。这种自由定义,对纯代码开发来说是可以的且强大的,但却对可视化开发不友好。如果可视化仅仅是拖出一个节点来,然后在里面用Java/Scala实现特定的方法,那这就不是可视化开发了,而是另一种Flink专用IDE了。

https://www.yuque.com/boyan-avfmj/aviatorscript/guhmrc
Aviator 起源于 2010 年左右,当时我还在淘宝中间件,读了龙书,了解了 ASM ,开始读 clojure 编译器的源码。刚好同时在做 Notify 这个内部消息中间件的一个重要版本实现,其中有一个需求是实现 AMQP 规范里的 header 订阅,允许用户指定一个布尔表达式来决定是否订阅某种类型的消息,需要对布尔表达式字符串进行求值。当时正处于造轮子的兴奋期,因此就写了第一个版本出来,第一个版本花了一两天的功夫,整个代码结构其实到现在也没有特别大的改变,还是那么乱 :)

数据仓库 ,由数据仓库之父比尔·恩门(Bill Inmon)于1990年提出的。 1991年,他写了一本书,叫《Building the Data Warehouse》(建立数据仓库),书中提出的:
数据仓库(Data Warehouse)是一个

  • 面向主题的(Subject Oriented)、
  • 集成的(Integrated)、
  • 不可修改的(Non-Volatile)、
  • 与时间相关的(Time Variant)的数据集合,
  • 专门用于支持管理决策(Decision Making Support)。

ClickHouse is a column-oriented database management system (DBMS) for online analytical processing of queries (OLAP).

场景特征:

大多数是读请求
数据总是以相当大的批(> 1000 rows)进行写入
不修改已添加的数据
每次查询都从数据库中读取大量的行,但是同时又仅需要少量的列
宽表,即每个表包含着大量的列
较少的查询(通常每台服务器每秒数百个查询或更少)
对于简单查询,允许延迟大约50毫秒
列中的数据相对较小:数字和短字符串(例如,每个URL 60个字节)
处理单个查询时需要高吞吐量(每个服务器每秒高达数十亿行)
事务不是必须的
对数据一致性要求低
每一个查询除了一个大表外都很小
查询结果明显小于源数据,换句话说,数据被过滤或聚合后能够被盛放在单台服务器的内存中
clickhouse自身限制:

不支持真正的删除/更新支持 不支持事务
不支持二级索引
有限的SQL支持,join实现与众不同
不支持窗口功能
元数据管理需要人工干预维护

链接:https://www.jianshu.com/p/7ec2cc9a4069

实时数仓方案如何选型和构建
原文链接:https://blog.csdn.net/weixin_43597208/article/details/126355132

这种方案的好处有二,方案简单;数据实时。不过有两个缺点:

一个是用户每产生一个新的报表需求,都需要开发一个Flink流式计算任务,数据开发的人力成本和时间成本都较高。

第二个是对于每天需要接入近百亿的数据平台,如果要分析近一个月的数据,则需要的Flink集群规模要求很大,且需要将很多计算的中间数据存储在内存中以便多流Join。

大数据分析使用哪些工具? - Smartbi的回答 - 知乎
https://www.zhihu.com/question/415610563/answer/3255681655

28、实时用户画像之任务调度DS之Flink任务实战讲解
https://edu.51cto.com/lesson/781871.html

markmap 这个名字是 Markdown 和 Mindmap 的组合
https://markmap.js.org/repl

python3网络编程
https://0xbharath.github.io/python-network-programming/protocols/dns/index.html

Setting Up V2Ray with NGINX + WebSocket + TLS
https://tofu.icu/archives/13

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
apt update
apt install nginx certbot python3-certbot-nginx
vi /usr/local/etc/v2ray/config.json

{
  "inbounds": [
    {
      "port": 10000,
      "listen":"127.0.0.1",
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "your-uuid",
            "alterId": 0
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "wsSettings": {
        "path": "/yourpath/"
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

certbot certonly --nginx -d example.com

server {
  listen 443 ssl;
  listen [::]:443 ssl;

  ssl_certificate       /path/to/your/certificate;
  ssl_certificate_key   /path/to/your/certificate_key;
  ssl_session_timeout 1d;
  ssl_session_cache shared:MozSSL:10m;
  ssl_session_tickets off;

  ssl_protocols         TLSv1.2 TLSv1.3;
  ssl_ciphers           ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
  ssl_prefer_server_ciphers off;

  server_name           example.com;
  location /yourpath/ {
    if ($http_upgrade != "websocket") {
        return 404;
    }
    proxy_redirect off;
    proxy_pass http://127.0.0.1:10000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    # Show real IP in v2ray access.log
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

service nginx restart

Disable Python’s output buffering with sys.stdout.flush() or -u command line option.
https://python-code.dev/articles/3750

import os
import sys

if not os.environ.get("PYTHONUNBUFFERED"):
    os.environ["PYTHONUNBUFFERED"] = "1"
    os.execv(sys.executable, [sys.executable] + sys.argv)

print("This message will be printed without buffering")

What Is Python Output Buffering and How to Disable It?
https://blog.finxter.com/what-is-python-output-buffering-and-how-to-disable-it/

import io
import os
import sys
import time

try:
    # open stdout in binary mode, then wrap it in a TextIOWrapper and enable write_through
    sys.stdout = io.TextIOWrapper(open(sys.stdout.fileno(), 'wb', 0), write_through=True)
    # for flushing on newlines only use :
    # sys.stdout.reconfigure(line_buffering=True)
except TypeError:
    # In case you are on Python 2
    sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)

How to Check if Python’s Output Buffering Is Enabled
https://adamj.eu/tech/2020/06/26/how-to-check-if-pythons-output-buffering-is-enabled/

import io
import sys

def output_buffering_enabled():
    return isinstance(sys.__stdout__.buffer, io.BufferedWriter)

Resume Matcher is an open source, free tool to improve your resume. It works by using language models to compare and rank resumes with job descriptions.

www.resumematcher.fyi/

有哪些命令行的软件堪称神器? - HelloGitHub的回答 - 知乎
https://www.zhihu.com/question/59227720/answer/2644274078

滴滴弹性云基于 K8S 的调度实践
https://mp.weixin.qq.com/s/nMSIsS72fSXGqJO9Vy_Pfw

https://sendgrid.com/en-us/marketing/sendgrid-vs-amazon-ses

Nginx 中运行 JavaScript
https://zhuanlan.zhihu.com/p/393788937

https://github.com/nginx/njs/issues/179

While OpenResty is mature and a great tool to use, we decided to implement our own scripting for nginx for several reason.

njs is tailored to be executed inside nginx (fast VM creation/destroying), lua may have GC issues under heavy load.
lua adds a lot of ad-hoc features (directives, lua methods), njs strives for simplicity using powerful native nginx primitives (variables, subrequests).
njs is a pure nginx module, OpenResty is a set of patches which sometime abuses original nginx design.
we need our own scripting for nginx-plus (paid version) features.
While we already use njs for production it is still in early phase and lacks many features which OpenResty has. BTW we do not plan to implement everything lua/openresty has because the design philosophy is different.

Modern C++ Programming Course (C++11/14/17/20)
https://github.com/federico-busato/Modern-CPP-Programming

12 Lessons, Get Started Building with Generative AI
https://microsoft.github.io/generative-ai-for-beginners/

Longhorn is a distributed block storage system for Kubernetes. Longhorn is cloud-native storage built using Kubernetes and container primitives.
https://github.com/longhorn/longhorn

Go 语言 | 1.16 新增的embed在各流行Web框架中的应用
https://zhuanlan.zhihu.com/p/372800639

解决:

go get -u "github.com/gin-gonic/gin"

报错:

go: module github.com/gin-gonic/gin: Get "https://proxy.golang.org/github.com/gin-gonic/gin/@v/list": dial tcp 142.251.43.17:443: i/o timeout

解决:可以使用国内代理

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

go get -u "github.com/gin-gonic/gin"

Golang gin框架
https://blog.csdn.net/book_longker/article/details/123760632

golang微框架Gin
https://blog.csdn.net/qq_46079238/article/details/130780276

gin 打包静态文件·
https://www.jianshu.com/p/448c6ef02bc8

Golang微服务框架居然可以开发单体应用?—— Kratos单体架构实践
https://www.jianshu.com/p/c541e7b73c3d

从微信后端仓库发展史谈谈单仓和多仓
https://mp.weixin.qq.com/s/S2vcMTpLJpMREC6UoAGJmQ

Java快速创建http/https服务器
https://blog.csdn.net/qq_18497293/article/details/128019269

PyQt5-无边框窗体的移动实现
https://www.sumver.cn/archives/955/

Python搭建悬浮窗口
https://www.python100.com/html/EKRD86544Y9L.html

https://zhuanlan.zhihu.com/p/659744471?utm_id=0

20个堪比 Everything 的 Windows 实用小工具推荐

  • 文档名搜索神器:Everything
  • 文件管理和快速启动器:Listary
  • 全文搜索利器:AnyTXT Searcher
  • 格式最全的阅读器:SumatraPDF
  • 剪贴板历史:Ditto
  • 快速看图:Honeyview
  • 系统优化利器:Dism++
  • 软件卸载:GeekUninstaller
  • 窗口置顶显示:Window TopMost Control
  • 网络下载神器:IDM
  • 新一代效率利器:Quicker
  • 批量重命名:Advanced Renamer
  • 截图贴图神器:Snipaste
  • 速度最快的文本编辑器:EmEditor
  • 电脑上的瑞士军刀:DesktopOK
  • 电脑分区&数据恢复:DiskGenius
  • 护眼神器:f.lux
  • 镜像制作:Rufus
  • 快速预览文件:QuickLook
  • Windows 官方外挂:PowerToys

AI绘画软件Fooocus教程
https://zhuanlan.zhihu.com/p/656708919https://zhuanlan.zhihu.com/p/656708919

202310

invalid magic number: latest release of llama.cpp cannot import 13B GGML q4.0 model
https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/discussions/14

rolling back llama.cpp to commit hash a113689 works.

Yeah, latest llama.cpp is no longer compatible with GGML models. The new model format, GGUF, was merged recently. As far as llama.cpp is concerned, GGML is now dead - though of course many third-party clients/libraries are likely to continue to support it for a lot longer. I need to update my GGML READMEs to mention this and will be doing this shortly.

https://www.zhihu.com/tardis/bd/art/647329639?source_id=1001

参数高效的模型微调

  • 这一类方法的代表是LORA(https://arxiv.org/pdf/2106.09685.pdf)、LLaMA Adapter、Prefix-tuning,微调时对整个模型进行冻结,在模型上加入少量可学习的参数或者网络层,训练时只对这部分进行微调。
  • 这种方法其实就是将大模型作为提取特征的工具,因为模型本身巨大的参数量无需调整所以计算代价不高,甚至可以在单个消费级显卡上进行微调。
  • 如果你对大模型的使用场景距离已经训练的大模型的已有能力不远,应该首先尝试这种方法。

英语老师必备10条超好用的ChatGPT提示词
https://zhuanlan.zhihu.com/p/642571375

  • 请解释"touch base"的意思
  • 请提供关于"环保"的英语作文范例
  • 请提供一个关于"现在进行时"的练习题
  • 请纠正以下句子的语法错误: “She don’t like to swim in the pool.”
  • 请提供一个关于"在餐厅点餐"的英语口语对话练习
  • 如何向学生解释"虚拟语气"?
  • 请提供一个关于"动物"的英语课堂活动
  • 请提供一个关于"时间"的英语谚语
  • 如何提高学生的听力能力?
  • 请提供一个关于"友谊"的英语小故事

帮我写一篇“英语老师必备10条超好用的ChatGPT提示词”文章,要求2000字左右

https://huggingface.co/Unbabel/gec-t5_small

This model is an implementation of the paper A Simple Recipe for Multilingual Grammatical Error Correction from Google where they report the State of the art score in the task of Grammatical Error Correction (GEC). We implement the version with the T5-small with the reported F_0.5 score in the paper (60.70).

链接:https://www.zhihu.com/question/24113539/answer/2565029397

表示程度的优雅形容词,你认识哪几个?

  1. marvellous 好的非凡的
  2. splendid 极佳的;非常好的
  3. sensational 轰动的;引起渲然的;哗众取宠的;耸人听闻的;极好的;绝妙的
  4. spiffing 极好的;很棒的
  5. stupendous 极大的;令人惊叹的;了不起的
  6. ravishing 极其的;迷人的
  7. dashing 风度翩翩的;自信的;潇洒的
  8. joyous 高兴的;快乐的;令人愉快的
  9. glorious 值得称道的;光荣的;荣耀的
  10. eclectic 不拘一格的;兼收并蓄的
  11. chuffed 很愉快;很高兴;很满意
  12. thrilled 非常兴奋;极为激动

你有什么相见恨晚的英语学习方法? - 李献计的回答 - 知乎
https://www.zhihu.com/question/26677313/answer/2611743445

炒单赚的是几跳的钱,一天要做上百次,但是有很严格的止损止盈的标准,很多时候都是进去之后马上止损出来了。

这种赚钱模式,赚的其实是频率的钱,不会有太高的胜率。正常来说胜率一般也就是在60%到70%之间,不会有更高的胜率了。如果胜率再高一些,那么盈亏比就是连1比1都做不到了,可能盈利两次才会抵消一次亏损,这样来说就没有意义了。

以螺纹为例子,三跳止盈止损,胜率70%,一天操作100次的话(操作一手)。盈利2100,亏损900,手续费700,这样来算盈利就是500元。再加上手续费返还的话可能盈利是800或者更多。

链接:https://www.zhihu.com/question/522538926/answer/2589354781

【llm大语言模型】一文看懂llama2(原理,模型,训练) - yeyan的文章 - 知乎
https://zhuanlan.zhihu.com/p/651248009

炒期货的人最后都变成什么样了? - 藏巧守拙的回答 - 知乎
https://www.zhihu.com/question/279198518/answer/2316292946

How have top CDOs used their data to drive customer acquisition, revenue and profit goals? How can analytics create consensus across functional silos and competing c-suite priorities? In this event, top CDOs explore these questions and share the strategies they are using to keep dispersed employees informed, agile and productive.

https://www.forbes.com/sites/insights-teradata/2020/10/01/forbes-virtual-series-the-data-leaders-building-the-future-of-innovation/?sh=df7e0593e1d8
Watch the full event below for actionable insights from dynamic CDOs who have prioritized data and analytics to drive digital transformation and navigate our new reality.

PostgreSQL怎么查看数据库用户系统权限、对象权限
https://blog.csdn.net/weixin_41287260/article/details/127438227

SELECT * FROM  pg_roles WHERE rolname='postgres';
select * from information_schema.table_privileges where grantee='postgres';
select * from information_schema.usage_privileges where grantee='postgres';
select * from information_schema.routine_privileges where grantee='postgres';
select * from information_schema.column_privileges where grantee='postgres';
select * from information_schema.data_type_privileges ;
select * from information_schema.udt_privileges where grantee='postgres';

Postgres : 创建schema、创建表空间与指定用户权限
https://blog.csdn.net/weixin_42405670/article/details/130569729

CREATE SCHEMA my_schema;
CREATE USER my_user WITH PASSWORD 'password';
GRANT ALL ON SCHEMA my_schema TO my_user;
\dn
\du
grant USAGE on SCHEMA public to test ;
REVOKE ALL ON COMPANY FROM test;
REVOKE ALL ON SCHEMA public FROM test;

https://github.com/grafana/loki

Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. It is designed to be very cost effective and easy to operate. It does not index the contents of the logs, but rather a set of labels for each log stream.

Compared to other log aggregation systems, Loki:

  • does not do full text indexing on logs. By storing compressed, unstructured logs and only indexing metadata, Loki is simpler to operate and cheaper to run.
  • indexes and groups log streams using the same labels you’re already using with Prometheus, enabling you to seamlessly switch between metrics and logs using the same labels that you’re already using with Prometheus.
  • is an especially good fit for storing Kubernetes Pod logs. Metadata such as Pod labels is automatically scraped and indexed.
  • has native support in Grafana (needs Grafana v6.0).

jquery + PHP 上传图片

php

public function upload_photo() {
    $fileInfo = $_FILES['file'];

    $uploadPath = 'assets/uploads/files/' . date('Y') . '/' . date('m') . '/' . date('d');
    if (!file_exists($uploadPath)) {
        mkdir($uploadPath, 0777, true);
        chmod($uploadPath, 0777);
    }
    $ext = pathinfo($fileInfo['name'], PATHINFO_EXTENSION);
    $ext = strtolower($ext);
    $allowExt = array('jpeg', 'jpg', 'png');
    if (!in_array($ext, $allowExt)) {
        echo 'error';
        return;
    }

    $maxSize = 2097152;
    if ($fileInfo['size'] > $maxSize) {
        echo 'error';
        return;
    }
    if (!getimagesize($fileInfo['tmp_name'])) {
        echo 'error';
        return;
    }

    $uniName = md5(uniqid(microtime(true), true)) . '.' . $ext;
    $destination = $uploadPath . '/' . $uniName;
    if (!move_uploaded_file($fileInfo['tmp_name'], $destination)) {
        echo 'error';
        return;
    }
    echo $destination;
}

js

<input class="imgInput" id="img-upload" type="file" name="photo_img" accept="image/jpeg,image/jpg,image/png">

var file = $("#img-upload")[0].files[0];
if (file){
   var formData = new FormData();
   formData.append('file', file);
   $.ajax({
       url: "upload_photo",
       type: "post",
       data: formData,
       contentType: false,
       processData: false,
       success: function (res) {
           console.log(JSON.stringify(res));
       }
   })
}

精选英文作文21篇
https://www.ruiwen.com/yingyuzuowen/5118720.html

独立开发者靠什么赚钱? - 李牧云的回答 - 知乎
https://www.zhihu.com/question/591944056/answer/3247553182

高中语文将《国风·卫风·氓》编入教材有什么意义? - 沧浪停云的回答 - 知乎
https://www.zhihu.com/question/52756329/answer/963323829

Apache Calcite系列
https://zhuanlan.zhihu.com/p/614668529

Apache Calcite 是一种提供了标准的 SQL 语言、多种查询优化和连接各种数据源基础框架,可以让用户轻松的接入各种数据,并实现使用SQL查询。此外,Calcite 还提供了 OLAP 和流处理的查询引擎。

大家对Apache Calcite可能不熟悉,但是大家肯定对Hive、Flink、Kylin以及Durid这些框架很熟悉吧,他们内部其实就是用的Apache Calcite。

pydash https://pydash.readthedocs.io/en/latest/devguide.html

Tool Description Configuration

  • black Code formatter pyproject.toml
  • isort Import statement formatter setup.cfg
  • docformatter Docstring formatter setup.cfg
  • flake8 Code linter setup.cfg
  • pylint Code linter pylintrc
  • mypy Type checker setup.cfg
  • pytest Test framework setup.cfg
  • tox Test environment manager tox.ini
  • invoke CLI task execution library tasks.py

json 判断为空

mysql> select JSON_EXTRACT('{"a":1,"b":null,"c":[]}','$.a');
+-----------------------------------------------+
| JSON_EXTRACT('{"a":1,"b":null,"c":[]}','$.a') |
+-----------------------------------------------+
| 1                                             |
+-----------------------------------------------+
1 row in set (0.00 sec)

mysql> select JSON_EXTRACT('{"a":1,"b":null,"c":[]}','$.b');
+-----------------------------------------------+
| JSON_EXTRACT('{"a":1,"b":null,"c":[]}','$.b') |
+-----------------------------------------------+
| null                                          |
+-----------------------------------------------+
1 row in set (0.00 sec)

mysql> select JSON_EXTRACT('{"a":1,"b":null,"c":[]}','$.c');
+-----------------------------------------------+
| JSON_EXTRACT('{"a":1,"b":null,"c":[]}','$.c') |
+-----------------------------------------------+
| []                                            |
+-----------------------------------------------+
1 row in set (0.00 sec)

mysql> select JSON_EXTRACT('{"a":1,"b":null,"c":[]}','$.d');
+-----------------------------------------------+
| JSON_EXTRACT('{"a":1,"b":null,"c":[]}','$.d') |
+-----------------------------------------------+
| NULL                                          |
+-----------------------------------------------+
1 row in set (0.00 sec)

实现一个四则运算语法解析器 - Gloria的文章 - 知乎
https://zhuanlan.zhihu.com/p/112460676

python 解析时间加时区

>>> datetime.strptime('2023-10-26T16:19:44+08:00','%Y-%m-%dT%H:%M:%S%z')
datetime.datetime(2023, 10, 26, 16, 19, 44, tzinfo=datetime.timezone(datetime.timedelta(seconds=28800)))
>>> print(datetime.strptime('2023-10-26T16:19:44+08:00','%Y-%m-%dT%H:%M:%S%z'))
2023-10-26 16:19:44+08:00

拆分字符串: 写代码或正则把字符串 ‘a(1,2,3),b(1),c,e(f(3,4))’ 拆分成 a(1,2,3), b(1), c, e(f(3,4))4个子串。

循序渐进掌握递归正则表达式
https://www.cnblogs.com/f-ck-need-u/p/11344531.html

Pyparsing实战
https://zhuanlan.zhihu.com/p/259638397

如何看待 Rust 这门语言? - lencil的回答 - 知乎
https://www.zhihu.com/question/432640008/answer/2322776585

如何使用原生 vim 覆盖90%的插件功能 - 鹅厂架构师的文章 - 知乎
https://zhuanlan.zhihu.com/p/599417117

HubSpot picks up B2B data provider Clearbit to enhance its AI platform
https://techcrunch.com/2023/11/01/hubspot-picks-up-b2b-data-provider-clearbit-to-enhance-its-ai-platform/?guccounter=1

使用Antlr4实现计算器[Python]
http://www.opstool.com/article/336

2.19 实现一个简单的递归下降分析器
https://python3-cookbook.readthedocs.io/zh-cn/latest/c02/p19_writing_recursive_descent_parser.html

小试牛刀-递归下降算法(3)
https://zhuanlan.zhihu.com/p/30314216

消除左递归和回溯
https://www.bilibili.com/video/BV1BS4y1M7a9

消除左递归
A -> Aα|β

A -> βA'
A' -> αA'|ε

消除回溯
A -> δβ1 | δβ2 | ... | δβi | βi+1| ... | βj

A  -> δA'|βi+1|βj
A' -> β1|...|βj

公式解析

expr        -> expr + term
             | expr - term 
             | term

term        -> term * factor
             | term / factor
             | factor

factor      -> ( expr )
             | var
             | func
             | NUM
var         -> ALPHA
func_call   -> ALPHA ( args )
args        -> expr , expr
             | expr

去掉左递归

expr        -> term expr_tail 
expr_tail   -> + term expr_tail
             | - term expr_tail
             | e

term        -> factor term_tail
term_tail   -> * factor term_tail
             | / factor term_tail
             | e

factor      -> ( expr )
             | NUM
             | ALPHA alpha_tail
alpha_tail  -> ( args ) # func call
             | e        # var
args        -> expr args_tail 
args_tail   -> , expr
             | e

使用Micronuat + RxJava + KotlinTest
https://zhuanlan.zhihu.com/p/113983792

整会promise这8个高级用法,
https://blog.51cto.com/u_14627797/6989643

202309

高手是怎样做日内交易的?(货有点干) - 近我者富的文章 - 知乎
https://zhuanlan.zhihu.com/p/137631599

交易周期的确定:

  • 1 分钟交易周期:以小博大,快进快出。
  • 3 分钟交易周期:小波段交易。
  • 15 分钟交易周期:日内趋势交易。
  • 补充:日内短线交易不等于频繁交易。

什么是交易系统?

最通俗的理解:进场、出场、止损以及仓位管理的规则或规矩就是交易系统。

进场

  • 开盘价高于昨日收盘价,15 分钟不破,我择机进场做多,反之做空
  • 进场周期为1分钟,价格站在所有均线之上做多,反之做空。
  • 价格跳空高开不做多,价格跳空低开不做空;
  • 价格跳空高开跌破昨日最高价放空;价格低开突破昨日最低价做多

出场

  • 重要压力位置或者阻力位置
  • 或者盈利目标实现(盈亏比不低于 2:1)
  • 感觉行情不流畅或者有潜在风险,也会离场
  • 利必须达到止损的2倍,这是一个离场原则,其次趋势一有停顿的苗头就平仓。

止损

  • 每日亏损不允许超过总资金的 1.5%,如果一日我交易 3 次,则每次亏损就是 0.5%。
  • 每次下单必须立即止损跟上,如果你没有想好,就不要交易。
  • 止损点位的严格要求,

仓位

  • 以损定量。允许亏损的钱除以点数,就是开仓的手数。
  • 这次开仓我允许亏损500元,亏损点数是20点,每个点是10元钱,则开仓手数=500/200=2.5手。

研判

  • 研判今天的市场是单边还是震荡,以此制定交易计划;
  • 价格在30分钟最高价和最低价之间的区域内上下波动为震荡,突破有可能出现趋势。
  • 震荡行情——高空,低多。
  • 趋势行情——追随趋势。

期货日内交易如何做到一年3-10倍? - 傲娇元宝的回答 - 知乎
https://www.zhihu.com/question/304573577/answer/2511392700

  • 开盘几分钟内、尾盘2、3分钟内不要开仓
  • 以目标为终点线而不是时间:实现目标后坚决走人(每天的目标是多少,预先设定好,而不是做到交易所休盘时间)
  • 如果那天处于亏损状态,在亏损到设定的警戒线后也一定要坚决走他人。这里的目标既有盈利也有亏损警戒线。
  • 在正式开盘后,不要预测走势,要善于发现价格趋势,跟随价格趋势,然后根据自己的技术指标进场,这一点很难。
  • 上个交易时段尾盘最后趋势,上午10点15分休盘和11点30分休盘前的最后趋势,这个规律几乎百分之95都是可靠的。
  • 所有的技术指标和参数都是后发的,只有市场心理是唯一的先发指标。这一点对日内交易非常重要。
    • 还有整数点尤其是50和100多次上攻或下破都失败,预示着什么;
    • 开盘20分钟左右开盘价即最高价或最低价意味着什么。
  • 单边趋势明显,就尽可能做单边,这个时候做双向交易极容易陷入陷井里。
  • 每个品种一旦行情启动,正常都不会低于多少个点,基本有规律的
  • 最后,做日内交易,尽量做一个品种,不要分散。
  • 至于多少资金合适,60万之内都可以随便做,一次下单30%到50%资金没有问题的,不要尝试什么金字塔形加仓。一次性到位。
  • 什么品种合适呢,按照交易量大、波动幅度大、交易活跃度高来选。资金在10万以上,尽量选金属和贵金属,10万以下选农产品。
  • 最后建议,每天坚持锻炼身体,保持良好的精神状态和身体状态是成功的外在条件,它们直接影响你的专注力、判断力和行动力。

Elasticsearch自定义评分的N种方法
https://cloud.tencent.com/developer/article/1600163

布尔查询中的每个must,should和must_not元素称为查询子句。

  • 文档满足must或 should条款的标准的程度有助于文档的相关性得分。分数越高,文档就越符合您的搜索条件。
  • must_not子句中的条件被视为过滤器。它会影响文档是否包含在结果中,但不会影响文档的评分方式。在must_not里还可以显式指定任意过滤器,以基于结构化数据包括或排除文档。
  • filter:必须 匹配,但它以不评分、过滤模式来进行。filter内部语句对评分没有贡献,只是根据过滤标准来排除或包含文档。
  • 一句话概括:filter、must_not不影响评分,其他影响评分。

独立开发者犯法吗? - 第五面壁者的回答 - 知乎
https://www.zhihu.com/question/617917921/answer/3173907554

89年,手里1269万现金,怎么稳健理财? - CPA CFA 盐究所的回答 - 知乎
https://www.zhihu.com/question/596318158/answer/3083468070

装上了4个兆瓦户用光伏电站,花掉1000多万,每年可以从国家电网收到200万以上的电费,除去各种费用,实际净收入不低于170万。

然后,如果还能剩下点钱再按照文中方式做做理财

mapreduce为什么被淘汰了? - 雷鹏的回答 - 知乎
https://www.zhihu.com/question/303101438/answer/2925341473

十多年前在人人网(当时还叫校内网)第一次接触 MapReduce。当时刚入职,团队用 Cascading 做广告数据的分析,整个分析 Pipeline 牵涉到好多个 job,在数十个结点的 hadoop 集群上跑一遍要好几个小时,还经常就把整个集群跑挂了,一直没法上线。

当时我花了大概一周时间理清了广告分析的业务逻辑,然后写了一个等效的多线程 C++ 单机程序,一共也就 300 多行代码,单机跑一遍数据只要十几分钟。

职场最重要的能力是什么? - 策北的回答 - 知乎
https://www.zhihu.com/question/508168208/answer/2936070092

仔细观察你的老板在做什么事,尤其是在季末、年末这种关键时间节点,你就知道职场中什么能力最重要了。

作为一个在互联网行业打滚摸爬5年的职场人,我可以负责任地说:职场中最重要的一定是向上汇报的能力,其次是链接资源的能力,最后才是执行力。

How to remove all event listeners from a DOM element in Javascript
https://techoverflow.net/2019/12/26/how-to-remove-all-event-listeners-from-a-dom-element-in-javascript/

var elem = document.getElementById(‘root’);elem.replaceWith(elem.cloneNode(true));

唐奇安通道–日内策略的鼻祖 - 币圈牛哥的文章 - 知乎
https://zhuanlan.zhihu.com/p/551573373

1970年,唐奇安通道规则在一个对当时最流行的机械交易系统进行模拟测试和比较研究中取得了最优结果,随后声名远扬。唐奇安通道的理论基础是人类最起码需要21日来使得新事物代替旧事物。当绝大多数交易者都在认为趋势可能已经变化时,也就是经过了“21”日的适应期时,主要趋势却已做好了继续运行的准备。

交易系统可以有多简单? - 股玄明的回答 - 知乎
https://www.zhihu.com/question/418378495/answer/3134141491

这就是交易致胜的核心原则,只要符合这些原则,可以用的方法和指标多的是,没有最好,只要最适合自己。需要在实践中去寻找。

只要掌握并能在实践中遵循这些原则,哪怕用一个很简单的指标,能用纪律保持一致性,你会发现赚钱是一件很简单很无聊的事

炒股就是要简单的事情重复做,长时间坚持使用一个方法,把它用得炉火纯青,炒股也能像其他行业和一样,熟能生巧,手起刀落,不假思索做出每一个决定。

那些编程水平很高的程序员是怎么训练出来的? - 郭忠明的回答 - 知乎
https://www.zhihu.com/question/351504112/answer/2128951951

为什么国内的独立开发者做不起来? - The Alpha的回答 - 知乎
https://www.zhihu.com/question/598811656/answer/3157920350

国内所谓独立开发者基本就那几样: 记账, 天气, todo list, 背单词, 笔记(基本已经被notion干没了), 现在还有各种gpt套壳.

什么备案, gitee代码审查根本算不上障碍. 一个人是独立开发者, 首先他是个程序员. 除了 Apple store 要交钱(这个全世界统一), 其他问题有一堆绕过的方法.

请问真正的交易高手,能否把你们最舍不得分享的交易秘诀,用简单的一两句话暗示一下?谢谢!? - 老李闯江湖的回答 - 知乎
https://www.zhihu.com/question/425638863/answer/2957795098

期货品种详解之玉米期货 - 投资银河汇的文章 - 知乎
https://zhuanlan.zhihu.com/p/221958261

作为中国的高产粮食作物,玉米是畜牧业、养殖业、水产养殖业等的重要饲料来源,也是食品、医疗卫生、轻工业、化工业等的不可或缺的原料之一。

1 玉米供应

在国际玉米市场上,美国产量占40%以上,中国产量占近20%,南美产量约占10%。可见美国是世界玉米的主产区,其生产和供应对国际市场的影响很大。特别是美国的玉米生产已成为影响国际供应的最重要因素,其他国家和地区的产量比例较低,对国际市场的影响较小。

2 对玉米的需求

美国和中国都是玉米的主要生产国和消费国,玉米消费量较大的国家包括欧盟,日本,巴西,墨西哥等。这些国家的消费需求变化对玉米价格的影响更大。特别是近年来,主要消费国的玉米加工业发展迅速,极大地推动了玉米消费需求。

铁秃鹰:一个适合散户稳赢的期权策略 - 期权酱的文章 - 知乎
https://zhuanlan.zhihu.com/p/647737099

How to fetch an email body using imaplib in python?
https://stackoverflow.com/questions/2230037/how-to-fetch-an-email-body-using-imaplib-in-python

一位期货日内短线交易高手的交易技法(附详细方法) - 于渊的文章 - 知乎
https://zhuanlan.zhihu.com/p/438891011

举例,哪怕先浮盈30点没平,但是行情掉头,哪怕赚2个点都得平!或者先赚了十来个点就平了等下一单机会,不追单,就等符合信号的机会。

分时图15分钟以后均线向下,只做空,kd超80,直接空,止损线为楼梯上一个N字顶部,就是上一个压力位,止盈跟随止盈就好,距离一个N保本。因为是跟随止盈,所以符合利润奔跑起来,因为反向压力位止损,所以,止损小。符合盈亏比,并且顺势

链接:https://zhuanlan.zhihu.com/p/607446554

  • 第一、知道什么时候不交易,才是交易的绝招。
  • 第二、只交易成交量排名前20的品种。
  • 第三、利用趋势、形态、成交量抓住行情的爆发点。还要判断行情是否走完,及时止盈。
  • 第四、顺大势,逆小势;
  • 第五、日内看分时,不研究基本面。中长线看k线,需要关注基本面;
  • 第六、趋势反转,快到慢,慢到快。成交量极度缩小,可能也是行情反转的时候。
  • 第七、看图的时候,重点关注分时图的角度和幅度。

期货日内交易中,还是有很多大神的 - 2927913627的文章 - 知乎
https://zhuanlan.zhihu.com/p/141439996

  • 日内只是一个容纳资金相对较小需要素质更高的一条路,你可以走,可以不走,但它从来都不是死胡同。
  • 日内交易就是重仓,半仓全仓是常态,而且日内只观察市场情绪,不看重什么趋势。
  • 这个特性排除了大部分强调价值,轻仓,顺势及看指标的这部分人。
  • 日内做的好的人,中长线也不会差到哪去,但是能做中长线的未必能做日内。
  • 大部分人做日内死的很快,如果不合适很快就能看出来,长线如果反向波动了还能说是回撤,就算不合适也不是短期能看出来的。
  • 日内做三个月,你的技术、心态都要比没训练过的人强大很多!
  • 很多时候日内容易落入频繁交易,盈亏比做不大的怪圈,
    • 盈亏比的问题好解决无非拿久一些,
    • 频繁交易更好解决,以前每天做10单现在我就做2单加严格止损,
    • 但核心的问题来了,怎么让每天的两单能捕捉到大行情?也就是日内系统其实特别依赖开仓。

期货日内交易的4个方法 - 我要慢慢的变富的文章 - 知乎
https://zhuanlan.zhihu.com/p/445493285

一、开仓的两个基本策略。一是做量价齐升的健康行情,这是程序化喜欢的行情,这种小的单边行情量价同步,只要多巡逻发现,每天有3至5次机会。但是比的是速度,对反应能力要求高。二是做多空行情的转折点、分界点,这种临界点的操作,属于回马枪,抢反弹,顺应小周期的v型,但要符合主趋势方向,不然很容易被秒杀。

日内交易的时间和空间有限,不专注盯盘是不行的。现在,程序化交易或者称量化交易盛行,不专注盯盘,更干不赢计算机。

严格止损,树立微利观,降低盈利预期。期货日内交易时,我们有些单子进场后发现不是流畅的行情,没有入场见红,应当迅速的止损。如果出现浮盈后,量价不同步了,要果断止盈。

现在,许多交易高手都是重仓吃小波动,吃一小段。这也导致日内走势一波三折,盘面不稳定。

事实上,期货行情震荡的时间远比单边上涨趋势的时间要长得多,日内不要奢求大的单边行情。日内交易坚持小止赢,慢慢变富才是硬道理。

降低交易频率,控制日内交易的次数。我们需要选择那些连续小阳线或连续小阴线的强势行情,这种流畅的行情稳定性强,才会入场见红。当然这种期货行情不会很多,当没有出现连续流畅的行情,市场方向不明确,持仓量不配合,量行不同步,就应当放弃大部分的垃圾时间和垃圾行。

日内交易:1.选择大于等待,要找强势品种,联动共振品种。2.固定3分钟周期。3.做多选底部增仓向上,做空选顶部增仓向下。4.主动止损和止盈。5.不要隔夜。

https://memo.ac/releases.html

logrotate

#logrotate -d /etc/logrotate.d/testlog
#logrotate -f /etc/logrotate.d/testlog

compress                     通过gzip压缩转储以后的日志
nocompress                   不做gzip压缩处理
copytruncate                 用于还在打开中的日志文件,把当前日志备份并截断;是先拷贝再清空的方式,拷贝和清空之间有一个时间差,可能会丢失部分日志数据。
nocopytruncate               备份日志文件不过不截断
create mode owner group      轮转时指定创建新文件的属性,如create 0777 nobody nobody
nocreate                     不建立新的日志文件
delaycompress                和compress 一起使用时,转储的日志文件到下一次转储时才压缩
nodelaycompress              覆盖 delaycompress 选项,转储同时压缩。
missingok                    如果日志丢失,不报错继续滚动下一个日志
errors address               专储时的错误信息发送到指定的Email 地址
ifempty                      即使日志文件为空文件也做轮转,这个是logrotate的缺省选项。
notifempty                   当日志文件为空时,不进行轮转
mail address                 把转储的日志文件发送到指定的E-mail 地址
nomail                       转储时不发送日志文件
olddir directory             转储后的日志文件放入指定的目录,必须和当前日志文件在同一个文件系统
noolddir                     转储后的日志文件和当前日志文件放在同一个目录下
sharedscripts                运行postrotate脚本,作用是在所有日志都轮转后统一执行一次脚本。如果没有配置这个,那么每个日志轮转后都会执行一次脚本
prerotate                    在logrotate转储之前需要执行的指令,例如修改文件的属性等动作;必须独立成行
postrotate                   在logrotate转储之后需要执行的指令,例如重新启动 (kill -HUP) 某个服务!必须独立成行
daily                        指定转储周期为每天
weekly                       指定转储周期为每周
monthly                      指定转储周期为每月
rotate count                 指定日志文件删除之前转储的次数,0 指没有备份,5 指保留5 个备份
dateext                      使用当期日期作为命名格式
dateformat .%s               配合dateext使用,紧跟在下一行出现,定义文件切割后的文件名,必须配合dateext使用,只支持 %Y %m %d %s 这四个参数
size(或minsize) log-size     当日志文件到达指定的大小时才转储,log-size能指定bytes(缺省)及KB (sizek)或MB(sizem).当日志文件 >= log-size 的时候就转储。 

Where is the cron / crontab log?
https://askubuntu.com/questions/56683/where-is-the-cron-crontab-log

tail -f /var/log/syslog | grep CRON
journalctl -u cron.service

Open the file
/etc/rsyslog.d/50-default.conf
Find the line that starts with:
#cron.* 
uncomment that line, save the file, and restart rsyslog:

sudo service rsyslog restart
You should now see a cron log file here:

/var/log/cron.log

However, you will not see more information about what scripts were actually ran inside /etc/cron.daily or /etc/cron.hourly, unless those scripts direct output to the cron.log (or perhaps to some other log file).

Scripteable GPT partitions using parted
https://unix.stackexchange.com/questions/200582/scripteable-gpt-partitions-using-parted

parted --script /device \
    mklabel gpt \
    mkpart primary 1MiB 100MiB \
    mkpart primary 100MiB 200MiB \
    ...

sudo 出现unable to resolve host 解决方法 Ubuntu环境, 假设这台机器名字叫abc(机器的hostname), 每次执行sudo 就出现这个警告讯息: sudo: unable to resolve host abc 虽然sudo 还是可以正常执行, 但是警告讯息每次都出来,而这只是机器在反解上的问题, 所以就直接从/etc/hosts 设定, 让abc(hostname) 可以解回127.0.0.1 的IP 即可

我认为做期货必须对均价线极为重视,均价线就是盘中分时图上一根黄色线,别小看这根线,在期货短线操作中,我大部分时间是以这根黄线进行短线操作。简单的方法是如果当日期价跳空高开,期价回落至均价下方,等到第二低点不低于第一低点时,买入!等到拉升至均价上方,特别是当天出现较大的涨幅时,短线抛出!这样,可以轻松获取至少500元以上的收益。反之也是这样,当期价跳空低开,期价在多方逢低买盘介入下,会出现反弹,第一波反弹不必着急沽空,等第二波反弹时,发现不能突破盘中的最高点,沽空!等下跌至均价下方,可当日平仓。

链接:https://zhuanlan.zhihu.com/p/343907175

链接:https://www.zhihu.com/question/304573577/answer/2511392700

  • 日内短线交易入市之后如果不能马上获利,就准备迅速离场,不加仓,不补仓,不逆势死扛,不持仓过夜。
  • 开盘几分钟内、尾盘 2、3 分钟内不要开仓
    • 当然这个期间开仓也是输赢效率最大的时候,很多时候一笔交易可以快速在 1,2 分钟实现 5-10% 的盈利,没有5年以上的的经验不要尝试,
    • 因为这个时段的行情基本上和技术指标、价格趋势没有多大关系,更多的交易心理导致的价格走势
  • 以目标为终点线而不是时间:实现目标后坚决走人
    • 每天的目标是多少,预先设定好,而不是做到交易所休盘时间
    • 因为一个人在多次操作后,判断力控制力专注力都会下降,很难一直保持高水平。
    • 这里强调一下,如果那天处于亏损状态,在亏损到设定的警戒线后也一定要坚决走他人。这里的目标既有盈利也有亏损警戒线。
  • 在正式开盘后,不要预测走势,要善于发现价格趋势,跟随价格趋势,然后根据自己的技术指标进场,这一点很难。
  • 上个交易时段尾盘最后趋势,上午 10 点 15 分休盘和 11 点 30 分休盘前的最后趋势,这个规律几乎百分之 95 都是可靠的。
  • 所有的技术指标和参数都是后发的,只有市场心理是唯一的先发指标。
  • 整数点尤其是 50 和 100 多次上攻或下破都失败,预示着什么;开盘20分钟左右开盘价即最高价或最低价意味着什么。
  • 单边趋势明显,就尽可能做单边,这个时候做双向交易极容易陷入陷井里。
    • 开盘就是最高或次高、最低或次低价,基本上就是单边强趋势。
    • 震荡行情就做双向交易。
  • 最后,做日内交易,尽量做一个品种,不要分散。
  • 至于多少资金合适,60 万之内都可以随便做
    • 一次下单 30% 到 50% 资金没有问题的,不要尝试什么金字塔形加仓。
    • 一次性到位。
  • 什么品种合适呢,按照交易量大、波动幅度大、交易活跃度高来选。
    • 资金在10万以上,尽量选金属和贵金属
    • 10万以下选农产品。
    • 不建议选白糖、镍这类“妖”风盛行的品种。

做短线你必须认识到,从你介入行情的那一秒开始,行情在未来的走势就必须符合你的心理预期。如果行情出现不确定,或者波动加剧,此时市场虽然还未证明你错了,但是如果你还不进行减仓或平仓来抑制风险,那么真正等市场证明你错了的时候,你已经无力承担这种止损规模了。

  • Scala主要解决 Java 在灵活性和可扩展性方面的缺陷,它提供了更加强大的函数式编程和面向对象编程模式,以及更高效的内存管理机制。
  • Groovy主要解决 Java 在语法简洁性和可读性方面的缺陷,它提供了更加灵活的语法,使得 Java 的代码变得更加简洁易读。
  • Clojure主要解决 Java 在函数式编程方面的缺陷,它提供了更加灵活的函数式编程模型,使得代码更加简洁、可读性更高、测试更容易。
  • Kotlin是想干掉Java。众所周知Scala用户里有Better Java派和Pure-FP派。Kotlin在很多地方就是学习了Scala的语法,比如说data class和类构造器的设计,在Scala中都可以找到类似的东西。

编程三大信息学赛事CSP、NOIP、NOI,一文搞清!
这三个比赛都是由中国计算机学会(CCF)举办的。从报名资格上看,参加CSP-S复赛非零分者,将自动入围NOIP。所以大致同学们的竞赛之路如下:

1、CSP-J/S初赛
2、CSP-J/S复赛
3、NOIP
4、省内选拔(省选)
5、NOI(国赛)

信奥赛CSP、NOIP、NOI 一文搞清关系
https://baijiahao.baidu.com/s?id=1744364952219454792&wfr=spider&for=pc

Llama 2 本地运行全攻略
https://mp.weixin.qq.com/s/vMNGwf5F_nJ-Q0h6LA0cyw