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