A Journal Through My Activities, Thoughts, and Notes
#网友语录

'It is easier to port a shell than a shell script.' -- Larry Wall
#Dot is impressive! 我仿佛又交到了一个新朋友。不知不觉间和它聊了40分钟,要不是天色已晚,我们还会聊更久。
#flutter #markdown
行内代码inline code不能选中复制的问题终于解决了,要怪自己当初抄作业的时候没有抄全。几个要点:
1. 行内code也要包在一个Container
2. 行内code的样式不能有backgroundColor
3. 行内code的样式不可以直接用 style: preferredStyle

鸣谢Master Markdown and Multi-line Selection in Flutter: A Step-by-Step Tutorial Flutter markdown: Using Markdown with Cross-Line Selection in Flutter
#jenkins How to write comments in a Jenkins pipeline

/*
for block comments
*/

// for single line comment

sh '''
    npm tst
    # this is a comment in sh
'''
#oracle: how to find a table's name if you only know part of its name?

SELECT owner, table_name 
FROM all_tables 
WHERE table_name LIKE '%KYC%';
The following c# code splits the clientIds into smaller lists, each containing up to 100 elements.

var listOfClientIdLists = clientIds
    .Select((v, i) => new { Value = v, Index = i })
    .GroupBy(g => g.Index / 100, gi => gi.Value)
    .Select(chunk => chunk.ToList())
    .ToList();


### Explanation

1. Select((v, i) => new { Value = v, Index = i }):

- This uses the Select method with an overload that provides both the element (v) and its index (i).
- It transforms the clientIds collection into a new collection of anonymous objects, each containing:
- Value: the original element (v).
- Index: the position of the element in the original list (i).

2. GroupBy(g => g.Index / 100, gi => gi.Value):

- The GroupBy method organizes the elements into groups.
- g => g.Index / 100: This lambda expression determines the group key by dividing the index by 100. This effectively groups the elements into chunks of 100.
- gi => gi.Value: This specifies that only the Value part of the anonymous object should be included in the groups.

3. Select(chunk => chunk.ToList()):

- This converts each group (or chunk) into a list.

4. ToList():

- This final ToList converts the collection of lists into a list of lists.

### Alternative
Claude.AI suggests a better way to achieve the same goal, which has better simplicity and readability.
var listOfClientIdLists = clientIds
    .Chunk(100)
    .Select(chunk => chunk.ToList())
    .ToList();

#csharp #tips
30 歲仍未長大的人大有人在,可見成為一個獨立的人有多難,教育的重要性有多高。
#flutter
如果只有 AppBar 需要根据状态变化更新,那么你可以只在 AppBar 上使用 Consumer。这样做的好处是,仅当状态变化时,AppBar 会重新构建,而不会影响其他部分的 UI,从而提升性能。
#happynotes' new domain, happynotes.today is online. 🎉

下面是Web前端在CloudFlare上的自动部署代码。感谢CloudFlare免费提供部署空间。
set -x && if cd flutter; then git pull && cd .. ; else git clone https://github.com/flutter/flutter.git; (cd flutter && git fetch --tags && git checkout 3.27.3); fi && ls && flutter/bin/flutter doctor && flutter/bin/flutter clean && flutter/bin/flutter config --enable-web && cp .env.production .env && sed -i "s/VERSION_PLACEHOLDER/`git rev-parse --short HEAD`/" .env && flutter/bin/flutter build web --base-href="/" --release


#code #cloudflare
#网摘
要是不加说明的话,谁人能够想到,这首《中途送春》竟是出自日本人之手:“春送客行客送春,伤怀四十二年人。思家泪落书斋旧,在路愁生野草新。花为随时余色尽,鸟如知意晚啼频。风光今日东归去,一两心情且附陈”。

菅原道真
#happynotes
今天买了一个新域名 happynotes.today。
这下没有理由再拖延 happynotes app的上架了。
“他过来诋毁我,其实是对我的一种仰视”

周海媚 #观点
#书摘
例如邱婧评论过的彝族诗人俄狄小丰的诗歌《汉字进山》:

汉字鱼贯而入/冲破寨子古老的篱笆墙/淹没寨子/载自异域的水生物和陌生的垃圾/漂浮在上面/汉字纷纷爬上岸/首先占领我们的舌头/再顺势进入我们的体内/争噬五脏/等到饭饱酒足/便涂脂抹粉/从我们的口齿间转世/成为山寨的声音

诚如邱婧所说,这首诗会令汉语研究者震撼。

我只是个汉语母语者,但我也感到很震撼。普通话的普及,不但杀死一些少数民族语言,也在逐渐杀死汉族人的家乡话。这是一种进步还是一种退步?难以言说。
#书摘 #亲历晚清四十五年
记得母亲总是这样评论别人对她的伤害和诋毁:他们对自己的伤害比对我的伤害更大。
想来想去,还是应该多输出(分享),输出利人利已。更何况我们现在有自由的平台mastodon,没有人捂住我们的嘴。
#网摘
什么样的人才是合格的父亲呢?鲁迅认为,合格的父亲,他们“要做解放子女的父母,也应预备一种能力,便是自己虽然已经带着过去的色彩,却不失独立的本领和精神,有广博的趣味,高尚的娱乐”。这就是鲁迅所说的“‘人’之父”“觉醒的人”。

—— 张向东《“救救孩子”还是“救救父亲”》
#bug #fixed
flutter最近升级到3.24版,我也第一时间跟进升级了。结果发现有坑,本来文本框复制黏贴就困难,升级后这功能干脆彻底失效了。赶紧回退到3.22。好了!
#网友语录 如月中天
不记得啥时候从不懂就问变成了不懂就学呗🤦肯吃苦就有吃不完的苦,肯学习就有学不完的知识……
#regex #tips
JavaScript does not have a single-line modifier. Use \S\s instead of a dot if you want to match any character including newlines.
#flutter #initState #tips
The error you're encountering is caused by trying to update the UI (noteModel.content = '#${noteModel.initialTag}\n';) within the initState method, which triggers a rebuild of the widget while it is still in the build phase. This is not allowed in Flutter, as it can lead to inconsistent states.

To resolve this issue, you should delay the update until after the build phase. You can achieve this by using WidgetsBinding.instance.addPostFrameCallback, which schedules the code to run after the current frame has been rendered.
Back to Top