massive update for Mogan Research 1.2.5

This commit is contained in:
Darcy Shen 2024-02-24 11:38:26 +08:00
parent 64a5d8b40d
commit 73005e7d0a
49 changed files with 3265 additions and 2793 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,11 +1,11 @@
<TeXmacs|2.1.3>
<TeXmacs|2.1.2>
<style|<tuple|article|chinese|old-dots|old-lengths>>
<\body>
<doc-data|<doc-title|Bash脚本基础>|<doc-author|<author-data|<author-name|沈达>>>>
<doc-data|<doc-title|Bash\<#811A\>\<#672C\>\<#57FA\>\<#7840\>>|<doc-author|<author-data|<author-name|\<#6C88\>\<#8FBE\>>>>>
<section|赋值与替换>
<section|\<#8D4B\>\<#503C\>\<#4E0E\>\<#66FF\>\<#6362\>>
<\session|shell|default>
<\input|Shell] >
@ -27,20 +27,20 @@
</input>
</session>
<section|变量>
<section|\<#53D8\>\<#91CF\>>
<\description>
<item*|内置变量>比如<verbatim|$HOME>或者<verbatim|$PWD>,更多例子可以参考
<item*|\<#5185\>\<#7F6E\>\<#53D8\>\<#91CF\>>\<#6BD4\>\<#5982\><verbatim|$HOME>\<#6216\>\<#8005\><verbatim|$PWD>\<#FF0C\>\<#66F4\>\<#591A\>\<#4F8B\>\<#5B50\>\<#53EF\>\<#4EE5\>\<#53C2\>\<#8003\>
<shell|man 7 environ>
<item*|位置参数><verbatim|$0>是basename<verbatim|$@>是basename之后的所有参数
<item*|\<#4F4D\>\<#7F6E\>\<#53C2\>\<#6570\>><verbatim|$0>\<#662F\>basename\<#FF0C\><verbatim|$@>\<#662F\>basename\<#4E4B\>\<#540E\>\<#7684\>\<#6240\>\<#6709\>\<#53C2\>\<#6570\>
<tree|<verbatim|$@>|<verbatim|$1>|<verbatim|$2>|<verbatim|$3>|<verbatim|$4>|<text-dots>>
<item*|特殊参数><verbatim|$?>是命令、函数或者脚本本身的返回状态一般用0表示一切正常
<item*|\<#7279\>\<#6B8A\>\<#53C2\>\<#6570\>><verbatim|$?>\<#662F\>\<#547D\>\<#4EE4\>\<#3001\>\<#51FD\>\<#6570\>\<#6216\>\<#8005\>\<#811A\>\<#672C\>\<#672C\>\<#8EAB\>\<#7684\>\<#8FD4\>\<#56DE\>\<#72B6\>\<#6001\>\<#FF0C\>\<#4E00\>\<#822C\>\<#7528\>0\<#8868\>\<#793A\>\<#4E00\>\<#5207\>\<#6B63\>\<#5E38\>
</description>
<section|分支>
<section|\<#5206\>\<#652F\>>
<\shell-code>
if [ condition1 ];then
@ -58,10 +58,10 @@
fi
</shell-code>
<section|循环>
<section|\<#5FAA\>\<#73AF\>>
<\description>
<item*|循环与Python语法相近>
<item*|\<#5FAA\>\<#73AF\>\<#FF1A\>\<#4E0E\>Python\<#8BED\>\<#6CD5\>\<#76F8\>\<#8FD1\>>
<\shell-code>
for arg in `seq 10`
@ -73,7 +73,7 @@
done
</shell-code>
<item*|循环与C语言for语法相近>
<item*|\<#5FAA\>\<#73AF\>\<#FF1A\>\<#4E0E\>C\<#8BED\>\<#8A00\>for\<#8BED\>\<#6CD5\>\<#76F8\>\<#8FD1\>>
<\shell-code>
for ((a=1; a\<less\>=LIMIT; a++))
@ -85,7 +85,7 @@
done
</shell-code>
<item*|循环: 与C语言while语法相近>
<item*|\<#5FAA\>\<#73AF\>: \<#4E0E\>C\<#8BED\>\<#8A00\>while\<#8BED\>\<#6CD5\>\<#76F8\>\<#8FD1\>>
<\shell-code>
a=1
@ -106,16 +106,16 @@
<\shell-code>
command \<less\> input-file \<gtr\> output-file \ \ \ \ #
读取然后覆盖
\<#8BFB\>\<#53D6\>\<#7136\>\<#540E\>\<#8986\>\<#76D6\>
command \<gtr\>\<gtr\> output-file \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #
追加
\<#8FFD\>\<#52A0\>
</shell-code>
<section|函数>
<section|\<#51FD\>\<#6570\>>
<\shell-code>
# 如何定义函数1
# \<#5982\>\<#4F55\>\<#5B9A\>\<#4E49\>\<#51FD\>\<#6570\>1
function fun_name(){
@ -123,7 +123,7 @@
}
# 如何定义函数2
# \<#5982\>\<#4F55\>\<#5B9A\>\<#4E49\>\<#51FD\>\<#6570\>2
fun_name(){ # arg1 arg2 arg3
@ -133,7 +133,7 @@
\;
# 函数的应用
# \<#51FD\>\<#6570\>\<#7684\>\<#5E94\>\<#7528\>
fun_name $arg1 $arg2 $arg3
@ -141,7 +141,7 @@
\;
# 引用解除
# \<#5F15\>\<#7528\>\<#89E3\>\<#9664\>
fun_name(){ # arg1
@ -153,42 +153,45 @@
\;
# 上述代码片段等价于\
# \<#4E0A\>\<#8FF0\>\<#4EE3\>\<#7801\>\<#7247\>\<#6BB5\>\<#7B49\>\<#4EF7\>\<#4E8E\>\
arg1=hello
</shell-code>
<section|调试>
<section|\<#8C03\>\<#8BD5\>>
<\itemize>
<item>用好sh命令
<item>\<#7528\>\<#597D\>sh\<#547D\>\<#4EE4\>
<\description>
<item*|sh -n script>检查脚本语法
<item*|sh -n script>\<#68C0\>\<#67E5\>\<#811A\>\<#672C\>\<#8BED\>\<#6CD5\>
<item*|sh -v script>在执行前将所有命令打印出来
<item*|sh -v script>\<#5728\>\<#6267\>\<#884C\>\<#524D\>\<#5C06\>\<#6240\>\<#6709\>\<#547D\>\<#4EE4\>\<#6253\>\<#5370\>\<#51FA\>\<#6765\>
<item*|sh -x script>在执行前将所有命令到打印到错误输出,并在命令前面加上<shell|+>前缀
<item*|sh -x script>\<#5728\>\<#6267\>\<#884C\>\<#524D\>\<#5C06\>\<#6240\>\<#6709\>\<#547D\>\<#4EE4\>\<#5230\>\<#6253\>\<#5370\>\<#5230\>\<#9519\>\<#8BEF\>\<#8F93\>\<#51FA\>\<#FF0C\>\<#5E76\>\<#5728\>\<#547D\>\<#4EE4\>\<#524D\>\<#9762\>\<#52A0\>\<#4E0A\><shell|+>\<#524D\>\<#7F00\>
</description>
<item>利用<shell|echo>
<item>\<#5229\>\<#7528\><shell|echo>
<item>利用<shell|trap>
<item>\<#5229\>\<#7528\><shell|trap>
</itemize>
<section|并行>
<section|\<#5E76\>\<#884C\>>
利用GNU Parallel<\footnote>
\<#5229\>\<#7528\>GNU Parallel<\footnote>
<slink|https://www.gnu.org/software/parallel/>
</footnote>
<section|代码风格>
<section|\<#4EE3\>\<#7801\>\<#98CE\>\<#683C\>>
利用ShellCheck<\footnote>
\<#5229\>\<#7528\>ShellCheck<\footnote>
<slink|https://github.com/koalaman/shellcheck>
</footnote>
</body>
<initial|<\collection>
</collection>>
<\references>
<\collection>
<associate|auto-1|<tuple|1|?>>
@ -210,19 +213,19 @@
<\auxiliary>
<\collection>
<\associate|toc>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|1<space|2spc>赋值与替换>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|1<space|2spc>\<#8D4B\>\<#503C\>\<#4E0E\>\<#66FF\>\<#6362\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|2<space|2spc>变量>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|2<space|2spc>\<#53D8\>\<#91CF\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-2><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|3<space|2spc>分支>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|3<space|2spc>\<#5206\>\<#652F\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-3><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|4<space|2spc>循环>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|4<space|2spc>\<#5FAA\>\<#73AF\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-4><vspace|0.5fn>
@ -230,19 +233,19 @@
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-5><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|6<space|2spc>函数>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|6<space|2spc>\<#51FD\>\<#6570\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-6><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|7<space|2spc>调试>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|7<space|2spc>\<#8C03\>\<#8BD5\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-7><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|8<space|2spc>并行>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|8<space|2spc>\<#5E76\>\<#884C\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-8><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|9<space|2spc>代码风格>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|9<space|2spc>\<#4EE3\>\<#7801\>\<#98CE\>\<#683C\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-9><vspace|0.5fn>
</associate>

View file

@ -1,25 +1,25 @@
<TeXmacs|2.1.3>
<TeXmacs|2.1.2>
<style|<tuple|generic|chinese>>
<\body>
<doc-data|<doc-title|Git新用户常用配置>|<doc-author|<author-data|<author-name|沈浪熊猫儿>>>>
\ <doc-data|<doc-title|Git\<#65B0\>\<#7528\>\<#6237\>\<#5E38\>\<#7528\>\<#914D\>\<#7F6E\>>|<doc-author|<author-data|<author-name|\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>>>>>
<\table-of-contents|toc>
<with|par-left|1tab|配置常用别名,可以减少手指的磨损
<with|par-left|1tab|\<#914D\>\<#7F6E\>\<#5E38\>\<#7528\>\<#522B\>\<#540D\>\<#FF0C\>\<#53EF\>\<#4EE5\>\<#51CF\>\<#5C11\>\<#624B\>\<#6307\>\<#7684\>\<#78E8\>\<#635F\>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1>>
<with|par-left|1tab|如何正常显示中文
<with|par-left|1tab|\<#5982\>\<#4F55\>\<#6B63\>\<#5E38\>\<#663E\>\<#793A\>\<#4E2D\>\<#6587\>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-2>>
<with|par-left|1tab|配置用户名和邮箱
<with|par-left|1tab|\<#914D\>\<#7F6E\>\<#7528\>\<#6237\>\<#540D\>\<#548C\>\<#90AE\>\<#7BB1\>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-3>>
</table-of-contents>
本文在macOS 12.2.1中撰写。
\<#672C\>\<#6587\>\<#5728\>macOS 12.2.1\<#4E2D\>\<#64B0\>\<#5199\>\<#3002\>
<\session|shell|default>
<\unfolded-io|Shell] >
@ -33,7 +33,7 @@
</input>
</session>
<subsection*|配置常用别名,可以减少手指的磨损>
<subsection*|\<#914D\>\<#7F6E\>\<#5E38\>\<#7528\>\<#522B\>\<#540D\>\<#FF0C\>\<#53EF\>\<#4EE5\>\<#51CF\>\<#5C11\>\<#624B\>\<#6307\>\<#7684\>\<#78E8\>\<#635F\>>
<\session|shell|default>
<\input|Shell] >
@ -57,13 +57,14 @@
</input>
</session>
<subsection*|如何正常显示中文>
<subsection*|\<#5982\>\<#4F55\>\<#6B63\>\<#5E38\>\<#663E\>\<#793A\>\<#4E2D\>\<#6587\>>
默认情况下,<shell|git status>无法显示中文(以正在撰写中的本文为例):
\<#9ED8\>\<#8BA4\>\<#60C5\>\<#51B5\>\<#4E0B\>\<#FF0C\><shell|git
status>\<#65E0\>\<#6CD5\>\<#663E\>\<#793A\>\<#4E2D\>\<#6587\>\<#FF08\>\<#4EE5\>\<#6B63\>\<#5728\>\<#64B0\>\<#5199\>\<#4E2D\>\<#7684\>\<#672C\>\<#6587\>\<#4E3A\>\<#4F8B\>\<#FF09\>\<#FF1A\>
<\session|shell|default>
<\unfolded-io|Shell] >
cd ~/planet && git status # 仅用于展示效果不影响Git配置
cd ~/planet && git status # \<#4EC5\>\<#7528\>\<#4E8E\>\<#5C55\>\<#793A\>\<#6548\>\<#679C\>\<#FF0C\>\<#4E0D\>\<#5F71\>\<#54CD\>Git\<#914D\>\<#7F6E\>
<|unfolded-io>
On branch da/git_intro
@ -85,7 +86,7 @@
</input>
</session>
通过配置可以解决这个问题:
\<#901A\>\<#8FC7\>\<#914D\>\<#7F6E\>\<#53EF\>\<#4EE5\>\<#89E3\>\<#51B3\>\<#8FD9\>\<#4E2A\>\<#95EE\>\<#9898\>\<#FF1A\>
<\session|shell|default>
<\input|Shell] >
@ -93,7 +94,7 @@
</input>
<\unfolded-io|Shell] >
cd ~/planet && git status # 仅用于展示效果不影响Git配置
cd ~/planet && git status # \<#4EC5\>\<#7528\>\<#4E8E\>\<#5C55\>\<#793A\>\<#6548\>\<#679C\>\<#FF0C\>\<#4E0D\>\<#5F71\>\<#54CD\>Git\<#914D\>\<#7F6E\>
<|unfolded-io>
On branch da/git_intro
@ -102,7 +103,7 @@
\ \ (use "git add \<less\>file\<gtr\>..." to include in what will be
committed)
\ \ \ \ \ \ \ \ 沈浪熊猫儿/Git入门.tm
\ \ \ \ \ \ \ \ \<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>/Git\<#5165\>\<#95E8\>.tm
\;
@ -115,15 +116,15 @@
</input>
</session>
<subsection*|配置用户名和邮箱>
<subsection*|\<#914D\>\<#7F6E\>\<#7528\>\<#6237\>\<#540D\>\<#548C\>\<#90AE\>\<#7BB1\>>
<\warning*>
请使用你自己的用户名和邮箱
\<#8BF7\>\<#4F7F\>\<#7528\>\<#4F60\>\<#81EA\>\<#5DF1\>\<#7684\>\<#7528\>\<#6237\>\<#540D\>\<#548C\>\<#90AE\>\<#7BB1\>
</warning*>
<\session|shell|default>
<\input|Shell] >
git config --global user.name "沈浪熊猫儿"
git config --global user.name "\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>"
</input>
<\input|Shell] >
@ -147,7 +148,7 @@
[user]
\ \ \ \ \ \ \ \ name = 沈浪熊猫儿
\ \ \ \ \ \ \ \ name = \<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>
\ \ \ \ \ \ \ \ email = shenda@ustc.edu
</unfolded-io>
@ -175,15 +176,15 @@
<\auxiliary>
<\collection>
<\associate|toc>
<with|par-left|<quote|1tab>|配置常用别名,可以减少手指的磨损
<with|par-left|<quote|1tab>|\<#914D\>\<#7F6E\>\<#5E38\>\<#7528\>\<#522B\>\<#540D\>\<#FF0C\>\<#53EF\>\<#4EE5\>\<#51CF\>\<#5C11\>\<#624B\>\<#6307\>\<#7684\>\<#78E8\>\<#635F\>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1>>
<with|par-left|<quote|1tab>|如何正常显示中文
<with|par-left|<quote|1tab>|\<#5982\>\<#4F55\>\<#6B63\>\<#5E38\>\<#663E\>\<#793A\>\<#4E2D\>\<#6587\>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-2>>
<with|par-left|<quote|1tab>|配置用户名和邮箱
<with|par-left|<quote|1tab>|\<#914D\>\<#7F6E\>\<#7528\>\<#6237\>\<#540D\>\<#548C\>\<#90AE\>\<#7BB1\>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-3>>
</associate>

View file

@ -1,42 +1,42 @@
<TeXmacs|2.1.3>
<TeXmacs|2.1.2>
<style|<tuple|generic|chinese>>
<\body>
<\hide-preamble>
<assign|myspace|http://git.tmml.wiki/XmacsLabs/planet/raw/main/沈浪熊猫儿/>
<assign|myspace|http://git.tmml.wiki/XmacsLabs/planet/raw/main/\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>/>
<assign|gitlink|<macro|name|<hlink|<arg|name>|<merge|<value|myspace>|<arg|name>|.tm>>>>
</hide-preamble>
<doc-data|<doc-title|沈浪熊猫儿的空间>>
<doc-data|<doc-title|\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>\<#7684\>\<#7A7A\>\<#95F4\>>>
大家好我是Up主沈浪熊猫儿<\footnote>
\<#5927\>\<#5BB6\>\<#597D\>\<#FF0C\>\<#6211\>\<#662F\>Up\<#4E3B\>\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\><\footnote>
<slink|https://space.bilibili.com/28058658>
</footnote>,毕业于中国科学技术大学计算机系,是GNU
<TeXmacs>的开发者和墨干编辑器的作者。译有《Scala实用指南》现实生活中是一名数据工程师。
</footnote>\<#FF0C\>\<#6BD5\>\<#4E1A\>\<#4E8E\>\<#4E2D\>\<#56FD\>\<#79D1\>\<#5B66\>\<#6280\>\<#672F\>\<#5927\>\<#5B66\>\<#8BA1\>\<#7B97\>\<#673A\>\<#7CFB\>\<#FF0C\>\<#662F\>GNU
<TeXmacs>\<#7684\>\<#5F00\>\<#53D1\>\<#8005\>\<#548C\>\<#58A8\>\<#5E72\>\<#7F16\>\<#8F91\>\<#5668\>\<#7684\>\<#4F5C\>\<#8005\>\<#3002\>\<#8BD1\>\<#6709\>\<#300A\>Scala\<#5B9E\>\<#7528\>\<#6307\>\<#5357\>\<#300B\>\<#FF0C\>\<#73B0\>\<#5B9E\>\<#751F\>\<#6D3B\>\<#4E2D\>\<#662F\>\<#4E00\>\<#540D\>\<#6570\>\<#636E\>\<#5DE5\>\<#7A0B\>\<#5E08\>\<#3002\>
我的电子邮箱是<verbatim|shenda AT
ustc.edu>,欢迎大家发邮件给我。
\<#6211\>\<#7684\>\<#7535\>\<#5B50\>\<#90AE\>\<#7BB1\>\<#662F\><verbatim|shenda
AT ustc.edu>\<#FF0C\>\<#6B22\>\<#8FCE\>\<#5927\>\<#5BB6\>\<#53D1\>\<#90AE\>\<#4EF6\>\<#7ED9\>\<#6211\>\<#3002\>
<section*|文章列表>
<section*|\<#6587\>\<#7AE0\>\<#5217\>\<#8868\>>
<\itemize>
<item><gitlink|如何在Debian中更改默认的Python版本>
<item><gitlink|\<#5982\>\<#4F55\>\<#5728\>Debian\<#4E2D\>\<#66F4\>\<#6539\>\<#9ED8\>\<#8BA4\>\<#7684\>Python\<#7248\>\<#672C\>>
<item><gitlink|如何安装Fandol字体>
<item><gitlink|\<#5982\>\<#4F55\>\<#5B89\>\<#88C5\>Fandol\<#5B57\>\<#4F53\>>
<item><gitlink|Git新用户常用配置>
<item><gitlink|Git\<#65B0\>\<#7528\>\<#6237\>\<#5E38\>\<#7528\>\<#914D\>\<#7F6E\>>
<item><gitlink|2021年浙江高考数学第七题函数曲线绘制>
<item><gitlink|2021\<#5E74\>\<#6D59\>\<#6C5F\>\<#9AD8\>\<#8003\>\<#6570\>\<#5B66\>\<#7B2C\>\<#4E03\>\<#9898\>\<#51FD\>\<#6570\>\<#66F2\>\<#7EBF\>\<#7ED8\>\<#5236\>>
<item><gitlink|如何输入希腊字母>
<item><gitlink|\<#5982\>\<#4F55\>\<#8F93\>\<#5165\>\<#5E0C\>\<#814A\>\<#5B57\>\<#6BCD\>>
<item><gitlink|Bash脚本基础>
<item><gitlink|Bash\<#811A\>\<#672C\>\<#57FA\>\<#7840\>>
<item><gitlink|定制快捷键快速输入以1为分子的分式>
<item><gitlink|\<#5B9A\>\<#5236\>\<#5FEB\>\<#6377\>\<#952E\>\<#5FEB\>\<#901F\>\<#8F93\>\<#5165\>\<#4EE5\>1\<#4E3A\>\<#5206\>\<#5B50\>\<#7684\>\<#5206\>\<#5F0F\>>
<item><gitlink|<gitlink|>为什么说Scala是JVM上的C++>
<item><gitlink|<gitlink|>\<#4E3A\>\<#4EC0\>\<#4E48\>\<#8BF4\>Scala\<#662F\>JVM\<#4E0A\>\<#7684\>C++\<#FF1F\>>
</itemize>
</body>
@ -57,7 +57,7 @@
<\auxiliary>
<\collection>
<\associate|toc>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|文章列表>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|\<#6587\>\<#7AE0\>\<#5217\>\<#8868\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1><vspace|0.5fn>
</associate>

View file

@ -1,60 +1,62 @@
<TeXmacs|2.1.3>
<TeXmacs|2.1.2>
<style|<tuple|generic|chinese>>
<\body>
<doc-data|<doc-title|为什么说Scala是JVM上的C++?>|<doc-author|<author-data|<author-name|沈浪熊猫儿>>>>
<doc-data|<doc-title|\<#4E3A\>\<#4EC0\>\<#4E48\>\<#8BF4\>Scala\<#662F\>JVM\<#4E0A\>\<#7684\>C++?>|<doc-author|<author-data|<author-name|\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>>>>>
<section*|问题原文>
<section*|\<#95EE\>\<#9898\>\<#539F\>\<#6587\>>
<\quote-env>
如题。以及请大家分析下未来静态语言的主流C++、java、scala三门语言未来的发展方向
\<#5982\>\<#9898\>\<#3002\>\<#4EE5\>\<#53CA\>\<#8BF7\>\<#5927\>\<#5BB6\>\<#5206\>\<#6790\>\<#4E0B\>\<#672A\>\<#6765\>\<#9759\>\<#6001\>\<#8BED\>\<#8A00\>\<#7684\>\<#4E3B\>\<#6D41\>\<#FF0C\>C++\<#3001\>java\<#3001\>scala\<#4E09\>\<#95E8\>\<#8BED\>\<#8A00\>\<#672A\>\<#6765\>\<#7684\>\<#53D1\>\<#5C55\>\<#65B9\>\<#5411\>
</quote-env>
<section*|我的回答>
<section*|\<#6211\>\<#7684\>\<#56DE\>\<#7B54\>>
<subsection*|为什么说Scala是JVM上的C++?>
<subsection*|\<#4E3A\>\<#4EC0\>\<#4E48\>\<#8BF4\>Scala\<#662F\>JVM\<#4E0A\>\<#7684\>C++?>
不知道是谁说Scala是JVM上的C++。这种没有具体展开的话,大概和网上盛传的各种马云语录,比如
\<#4E0D\>\<#77E5\>\<#9053\>\<#662F\>\<#8C01\>\<#8BF4\>Scala\<#662F\>JVM\<#4E0A\>\<#7684\>C++\<#3002\>\<#8FD9\>\<#79CD\>\<#6CA1\>\<#6709\>\<#5177\>\<#4F53\>\<#5C55\>\<#5F00\>\<#7684\>\<#8BDD\>\<#FF0C\>\<#5927\>\<#6982\>\<#548C\>\<#7F51\>\<#4E0A\>\<#76DB\>\<#4F20\>\<#7684\>\<#5404\>\<#79CD\>\<#9A6C\>\<#4E91\>\<#8BED\>\<#5F55\>\<#FF0C\>\<#6BD4\>\<#5982\>
<\quote-env>
刚毕业的年轻人应该在一家公司待满五年
\<#521A\>\<#6BD5\>\<#4E1A\>\<#7684\>\<#5E74\>\<#8F7B\>\<#4EBA\>\<#5E94\>\<#8BE5\>\<#5728\>\<#4E00\>\<#5BB6\>\<#516C\>\<#53F8\>\<#5F85\>\<#6EE1\>\<#4E94\>\<#5E74\>
</quote-env>
一样没有实际的意义。
\<#4E00\>\<#6837\>\<#6CA1\>\<#6709\>\<#5B9E\>\<#9645\>\<#7684\>\<#610F\>\<#4E49\>\<#3002\>
把Scala和C++放在一起对比的朋友大概说的是特性多、杂这个特点。最初学习Scala的时候大致把知乎上关于Scala的问答都浏览了一遍。目前印象最深的还是这个问题中
@阅千人而惜知己 的观点。
\<#628A\>Scala\<#548C\>C++\<#653E\>\<#5728\>\<#4E00\>\<#8D77\>\<#5BF9\>\<#6BD4\>\<#7684\>\<#670B\>\<#53CB\>\<#FF0C\>\<#5927\>\<#6982\>\<#8BF4\>\<#7684\>\<#662F\>\<#7279\>\<#6027\>\<#591A\>\<#3001\>\<#6742\>\<#8FD9\>\<#4E2A\>\<#7279\>\<#70B9\>\<#3002\>\<#6700\>\<#521D\>\<#5B66\>\<#4E60\>Scala\<#7684\>\<#65F6\>\<#5019\>\<#FF0C\>\<#5927\>\<#81F4\>\<#628A\>\<#77E5\>\<#4E4E\>\<#4E0A\>\<#5173\>\<#4E8E\>Scala\<#7684\>\<#95EE\>\<#7B54\>\<#90FD\>\<#6D4F\>\<#89C8\>\<#4E86\>\<#4E00\>\<#904D\>\<#3002\>\<#76EE\>\<#524D\>\<#5370\>\<#8C61\>\<#6700\>\<#6DF1\>\<#7684\>\<#8FD8\>\<#662F\>\<#8FD9\>\<#4E2A\>\<#95EE\>\<#9898\>\<#4E2D\>
@\<#9605\>\<#5343\>\<#4EBA\>\<#800C\>\<#60DC\>\<#77E5\>\<#5DF1\>
\<#7684\>\<#89C2\>\<#70B9\>\<#3002\>
后来翻译完《Scala实用指南》在写序的时候我把千人的观点浓缩成了一句话
\<#540E\>\<#6765\>\<#7FFB\>\<#8BD1\>\<#5B8C\>\<#300A\>Scala\<#5B9E\>\<#7528\>\<#6307\>\<#5357\>\<#300B\>\<#5728\>\<#5199\>\<#5E8F\>\<#7684\>\<#65F6\>\<#5019\>\<#FF0C\>\<#6211\>\<#628A\>\<#5343\>\<#4EBA\>\<#7684\>\<#89C2\>\<#70B9\>\<#6D53\>\<#7F29\>\<#6210\>\<#4E86\>\<#4E00\>\<#53E5\>\<#8BDD\>\<#FF1A\>
<\quote-env>
Scala的美在于精巧的内核Scala的丑陋在于复杂的实现。
Scala\<#7684\>\<#7F8E\>\<#5728\>\<#4E8E\>\<#7CBE\>\<#5DE7\>\<#7684\>\<#5185\>\<#6838\>\<#FF0C\>Scala\<#7684\>\<#4E11\>\<#964B\>\<#5728\>\<#4E8E\>\<#590D\>\<#6742\>\<#7684\>\<#5B9E\>\<#73B0\>\<#3002\>
</quote-env>
至于C++我觉得它的复杂程度更甚于Scala。我目前在维护的C++项目GNU
TeXmacsC++的代码行数在20万这个量级项目的作者是一个法国数学家(Joris
van der Hoeven)从90年代至今至少已经有20年的历史了。这个项目对于C++的态度就是非常审慎的没有用C++的标准库或许90年代的时候C++标准库的口碑很差像hashmap、list、string这些容器都是自己实现的内存管理也是自己实现大家有兴趣可以点击文末的链接看一下GNU
TeXmacs的豆瓣小组组长做的一些源代码分析。个人对这些自己实现的容器是不信任的所以最近在逐行Review添加单元测试并做性能测试。
\<#81F3\>\<#4E8E\>C++\<#FF0C\>\<#6211\>\<#89C9\>\<#5F97\>\<#5B83\>\<#7684\>\<#590D\>\<#6742\>\<#7A0B\>\<#5EA6\>\<#66F4\>\<#751A\>\<#4E8E\>Scala\<#3002\>\<#6211\>\<#76EE\>\<#524D\>\<#5728\>\<#7EF4\>\<#62A4\>\<#7684\>C++\<#9879\>\<#76EE\>GNU
TeXmacs\<#FF0C\>C++\<#7684\>\<#4EE3\>\<#7801\>\<#884C\>\<#6570\>\<#5728\>20\<#4E07\>\<#8FD9\>\<#4E2A\>\<#91CF\>\<#7EA7\>\<#FF0C\>\<#9879\>\<#76EE\>\<#7684\>\<#4F5C\>\<#8005\>\<#662F\>\<#4E00\>\<#4E2A\>\<#6CD5\>\<#56FD\>\<#6570\>\<#5B66\>\<#5BB6\>(Joris
van der Hoeven)\<#FF0C\>\<#4ECE\>90\<#5E74\>\<#4EE3\>\<#81F3\>\<#4ECA\>\<#FF0C\>\<#81F3\>\<#5C11\>\<#5DF2\>\<#7ECF\>\<#6709\>20\<#5E74\>\<#7684\>\<#5386\>\<#53F2\>\<#4E86\>\<#3002\>\<#8FD9\>\<#4E2A\>\<#9879\>\<#76EE\>\<#5BF9\>\<#4E8E\>C++\<#7684\>\<#6001\>\<#5EA6\>\<#5C31\>\<#662F\>\<#975E\>\<#5E38\>\<#5BA1\>\<#614E\>\<#7684\>\<#FF0C\>\<#6CA1\>\<#6709\>\<#7528\>C++\<#7684\>\<#6807\>\<#51C6\>\<#5E93\>\<#FF08\>\<#6216\>\<#8BB8\>90\<#5E74\>\<#4EE3\>\<#7684\>\<#65F6\>\<#5019\>C++\<#6807\>\<#51C6\>\<#5E93\>\<#7684\>\<#53E3\>\<#7891\>\<#5F88\>\<#5DEE\>\<#FF09\>\<#FF0C\>\<#50CF\>hashmap\<#3001\>list\<#3001\>string\<#8FD9\>\<#4E9B\>\<#5BB9\>\<#5668\>\<#90FD\>\<#662F\>\<#81EA\>\<#5DF1\>\<#5B9E\>\<#73B0\>\<#7684\>\<#FF0C\>\<#5185\>\<#5B58\>\<#7BA1\>\<#7406\>\<#4E5F\>\<#662F\>\<#81EA\>\<#5DF1\>\<#5B9E\>\<#73B0\>\<#FF0C\>\<#5927\>\<#5BB6\>\<#6709\>\<#5174\>\<#8DA3\>\<#53EF\>\<#4EE5\>\<#70B9\>\<#51FB\>\<#6587\>\<#672B\>\<#7684\>\<#94FE\>\<#63A5\>\<#FF0C\>\<#770B\>\<#4E00\>\<#4E0B\>GNU
TeXmacs\<#7684\>\<#8C46\>\<#74E3\>\<#5C0F\>\<#7EC4\>\<#7EC4\>\<#957F\>\<#505A\>\<#7684\>\<#4E00\>\<#4E9B\>\<#6E90\>\<#4EE3\>\<#7801\>\<#5206\>\<#6790\>\<#3002\>\<#4E2A\>\<#4EBA\>\<#5BF9\>\<#8FD9\>\<#4E9B\>\<#81EA\>\<#5DF1\>\<#5B9E\>\<#73B0\>\<#7684\>\<#5BB9\>\<#5668\>\<#662F\>\<#4E0D\>\<#4FE1\>\<#4EFB\>\<#7684\>\<#FF0C\>\<#6240\>\<#4EE5\>\<#6700\>\<#8FD1\>\<#5728\>\<#9010\>\<#884C\>Review\<#FF0C\>\<#6DFB\>\<#52A0\>\<#5355\>\<#5143\>\<#6D4B\>\<#8BD5\>\<#FF0C\>\<#5E76\>\<#505A\>\<#6027\>\<#80FD\>\<#6D4B\>\<#8BD5\>\<#3002\>
前段时间咨询Joris主要是想用一些handy的C++新特性已经在单元测试和Benchmark代码中使用比如autoJoris和其他的维护者是反对的。其实我也是反对使用绝大部分C++的新特性比如函数式编程的支持从语法上就比Scala差了很多另外在具体的实现上我也是不信任C++编译器的。对于一个比较大型的代码仓库其实很容易就遇到一些编译器的BUG。为了避免把时间浪费在一些无关紧要的细节上聪明的工程师应该懂得取舍。
\<#524D\>\<#6BB5\>\<#65F6\>\<#95F4\>\<#54A8\>\<#8BE2\>Joris\<#FF0C\>\<#4E3B\>\<#8981\>\<#662F\>\<#60F3\>\<#7528\>\<#4E00\>\<#4E9B\>handy\<#7684\>C++\<#65B0\>\<#7279\>\<#6027\>\<#FF08\>\<#5DF2\>\<#7ECF\>\<#5728\>\<#5355\>\<#5143\>\<#6D4B\>\<#8BD5\>\<#548C\>Benchmark\<#4EE3\>\<#7801\>\<#4E2D\>\<#4F7F\>\<#7528\>\<#FF09\>\<#FF0C\>\<#6BD4\>\<#5982\>auto\<#FF0C\>Joris\<#548C\>\<#5176\>\<#4ED6\>\<#7684\>\<#7EF4\>\<#62A4\>\<#8005\>\<#662F\>\<#53CD\>\<#5BF9\>\<#7684\>\<#3002\>\<#5176\>\<#5B9E\>\<#6211\>\<#4E5F\>\<#662F\>\<#53CD\>\<#5BF9\>\<#4F7F\>\<#7528\>\<#7EDD\>\<#5927\>\<#90E8\>\<#5206\>C++\<#7684\>\<#65B0\>\<#7279\>\<#6027\>\<#FF0C\>\<#6BD4\>\<#5982\>\<#51FD\>\<#6570\>\<#5F0F\>\<#7F16\>\<#7A0B\>\<#7684\>\<#652F\>\<#6301\>\<#FF0C\>\<#4ECE\>\<#8BED\>\<#6CD5\>\<#4E0A\>\<#5C31\>\<#6BD4\>Scala\<#5DEE\>\<#4E86\>\<#5F88\>\<#591A\>\<#FF0C\>\<#53E6\>\<#5916\>\<#FF0C\>\<#5728\>\<#5177\>\<#4F53\>\<#7684\>\<#5B9E\>\<#73B0\>\<#4E0A\>\<#FF0C\>\<#6211\>\<#4E5F\>\<#662F\>\<#4E0D\>\<#4FE1\>\<#4EFB\>C++\<#7F16\>\<#8BD1\>\<#5668\>\<#7684\>\<#3002\>\<#5BF9\>\<#4E8E\>\<#4E00\>\<#4E2A\>\<#6BD4\>\<#8F83\>\<#5927\>\<#578B\>\<#7684\>\<#4EE3\>\<#7801\>\<#4ED3\>\<#5E93\>\<#FF0C\>\<#5176\>\<#5B9E\>\<#5F88\>\<#5BB9\>\<#6613\>\<#5C31\>\<#9047\>\<#5230\>\<#4E00\>\<#4E9B\>\<#7F16\>\<#8BD1\>\<#5668\>\<#7684\>BUG\<#3002\>\<#4E3A\>\<#4E86\>\<#907F\>\<#514D\>\<#628A\>\<#65F6\>\<#95F4\>\<#6D6A\>\<#8D39\>\<#5728\>\<#4E00\>\<#4E9B\>\<#65E0\>\<#5173\>\<#7D27\>\<#8981\>\<#7684\>\<#7EC6\>\<#8282\>\<#4E0A\>\<#FF0C\>\<#806A\>\<#660E\>\<#7684\>\<#5DE5\>\<#7A0B\>\<#5E08\>\<#5E94\>\<#8BE5\>\<#61C2\>\<#5F97\>\<#53D6\>\<#820D\>\<#3002\>
<subsection*|C++、Java、Scala三门语言未来的发展动向>
<subsection*|C++\<#3001\>Java\<#3001\>Scala\<#4E09\>\<#95E8\>\<#8BED\>\<#8A00\>\<#672A\>\<#6765\>\<#7684\>\<#53D1\>\<#5C55\>\<#52A8\>\<#5411\>>
语言也是一个工程。一门语言的未来其实要看这门语言的工程项目的发展,和整体生态的发展。
\<#8BED\>\<#8A00\>\<#4E5F\>\<#662F\>\<#4E00\>\<#4E2A\>\<#5DE5\>\<#7A0B\>\<#3002\>\<#4E00\>\<#95E8\>\<#8BED\>\<#8A00\>\<#7684\>\<#672A\>\<#6765\>\<#5176\>\<#5B9E\>\<#8981\>\<#770B\>\<#8FD9\>\<#95E8\>\<#8BED\>\<#8A00\>\<#7684\>\<#5DE5\>\<#7A0B\>\<#9879\>\<#76EE\>\<#7684\>\<#53D1\>\<#5C55\>\<#FF0C\>\<#548C\>\<#6574\>\<#4F53\>\<#751F\>\<#6001\>\<#7684\>\<#53D1\>\<#5C55\>\<#3002\>
<strong|从项目管理的角度>Scala未来的发展不可限量。Scala项目的一切都已经在Github上了对于开发者来说在Github上给Scala标准库和编译器提交代码实际上变成了一件门槛比较低的事情。
@杨博 很早之前就开始给Scala项目做贡献。我是最近在给Spark做Scala
2.12支持的时候顺手给Scala项目修了一个bug。最近在CSUG微信群里面我鼓吹一个观点给Scala项目做贡献实际上非常简单的。然后
@Uncle Kevin 和 @何品 也开始给Scala提PR。虽然我们目前做的贡献都是非常Trivial的但是不可否认给Scala项目做贡献比给C++和Java做贡献要方便简单很多。这些老派的编程语言在源代码管理和开发者社区建设这点上做得这么差劲其发展自然没有新兴的语言快。我和Uncle
Kevin应该都是2016年之后才正式开始学习Scala的
<strong|\<#4ECE\>\<#9879\>\<#76EE\>\<#7BA1\>\<#7406\>\<#7684\>\<#89D2\>\<#5EA6\>>\<#FF0C\>Scala\<#672A\>\<#6765\>\<#7684\>\<#53D1\>\<#5C55\>\<#4E0D\>\<#53EF\>\<#9650\>\<#91CF\>\<#3002\>Scala\<#9879\>\<#76EE\>\<#7684\>\<#4E00\>\<#5207\>\<#90FD\>\<#5DF2\>\<#7ECF\>\<#5728\>Github\<#4E0A\>\<#4E86\>\<#FF0C\>\<#5BF9\>\<#4E8E\>\<#5F00\>\<#53D1\>\<#8005\>\<#6765\>\<#8BF4\>\<#FF0C\>\<#5728\>Github\<#4E0A\>\<#7ED9\>Scala\<#6807\>\<#51C6\>\<#5E93\>\<#548C\>\<#7F16\>\<#8BD1\>\<#5668\>\<#63D0\>\<#4EA4\>\<#4EE3\>\<#7801\>\<#5B9E\>\<#9645\>\<#4E0A\>\<#53D8\>\<#6210\>\<#4E86\>\<#4E00\>\<#4EF6\>\<#95E8\>\<#69DB\>\<#6BD4\>\<#8F83\>\<#4F4E\>\<#7684\>\<#4E8B\>\<#60C5\>\<#3002\>
@\<#6768\>\<#535A\> \<#5F88\>\<#65E9\>\<#4E4B\>\<#524D\>\<#5C31\>\<#5F00\>\<#59CB\>\<#7ED9\>Scala\<#9879\>\<#76EE\>\<#505A\>\<#8D21\>\<#732E\>\<#3002\>\<#6211\>\<#662F\>\<#6700\>\<#8FD1\>\<#5728\>\<#7ED9\>Spark\<#505A\>Scala
2.12\<#652F\>\<#6301\>\<#7684\>\<#65F6\>\<#5019\>\<#FF0C\>\<#987A\>\<#624B\>\<#7ED9\>Scala\<#9879\>\<#76EE\>\<#4FEE\>\<#4E86\>\<#4E00\>\<#4E2A\>bug\<#3002\>\<#6700\>\<#8FD1\>\<#FF0C\>\<#5728\>CSUG\<#5FAE\>\<#4FE1\>\<#7FA4\>\<#91CC\>\<#9762\>\<#FF0C\>\<#6211\>\<#9F13\>\<#5439\>\<#4E00\>\<#4E2A\>\<#89C2\>\<#70B9\>\<#FF1A\>\<#7ED9\>Scala\<#9879\>\<#76EE\>\<#505A\>\<#8D21\>\<#732E\>\<#5B9E\>\<#9645\>\<#4E0A\>\<#975E\>\<#5E38\>\<#7B80\>\<#5355\>\<#7684\>\<#3002\>\<#7136\>\<#540E\>\<#FF0C\>
@Uncle Kevin \<#548C\> @\<#4F55\>\<#54C1\>
\<#4E5F\>\<#5F00\>\<#59CB\>\<#7ED9\>Scala\<#63D0\>PR\<#3002\>\<#867D\>\<#7136\>\<#6211\>\<#4EEC\>\<#76EE\>\<#524D\>\<#505A\>\<#7684\>\<#8D21\>\<#732E\>\<#90FD\>\<#662F\>\<#975E\>\<#5E38\>Trivial\<#7684\>\<#FF0C\>\<#4F46\>\<#662F\>\<#4E0D\>\<#53EF\>\<#5426\>\<#8BA4\>\<#FF0C\>\<#7ED9\>Scala\<#9879\>\<#76EE\>\<#505A\>\<#8D21\>\<#732E\>\<#FF0C\>\<#6BD4\>\<#7ED9\>C++\<#548C\>Java\<#505A\>\<#8D21\>\<#732E\>\<#8981\>\<#65B9\>\<#4FBF\>\<#7B80\>\<#5355\>\<#5F88\>\<#591A\>\<#3002\>\<#8FD9\>\<#4E9B\>\<#8001\>\<#6D3E\>\<#7684\>\<#7F16\>\<#7A0B\>\<#8BED\>\<#8A00\>\<#FF0C\>\<#5728\>\<#6E90\>\<#4EE3\>\<#7801\>\<#7BA1\>\<#7406\>\<#548C\>\<#5F00\>\<#53D1\>\<#8005\>\<#793E\>\<#533A\>\<#5EFA\>\<#8BBE\>\<#8FD9\>\<#70B9\>\<#4E0A\>\<#505A\>\<#5F97\>\<#8FD9\>\<#4E48\>\<#5DEE\>\<#52B2\>\<#FF0C\>\<#5176\>\<#53D1\>\<#5C55\>\<#81EA\>\<#7136\>\<#6CA1\>\<#6709\>\<#65B0\>\<#5174\>\<#7684\>\<#8BED\>\<#8A00\>\<#5FEB\>\<#3002\>\<#FF08\>\<#6CE8\>\<#FF1A\>\<#6211\>\<#548C\>Uncle
Kevin\<#5E94\>\<#8BE5\>\<#90FD\>\<#662F\>2016\<#5E74\>\<#4E4B\>\<#540E\>\<#624D\>\<#6B63\>\<#5F0F\>\<#5F00\>\<#59CB\>\<#5B66\>\<#4E60\>Scala\<#7684\>\<#FF09\>
<strong|至于生态>Java和Scala是绑定在一块的。C++我就呵呵哒了。在阿里云实习的时候看到工程师们为了追求极限的性能和极少资源消耗日志的收集竟然也是用C++写的兼容Linux和Windows线上的环境比较复杂这个日志收集程序把所有依赖的代码都放到了同一个工程中管理包含Boost和Kafka的C
Binding我直接导入代码KDevelop就崩溃了。可能对于那位骨灰级的C++玩家这很简单而且非常方便看到Boost里面有bug就顺手修了。但是从代码复用的角度JVM生态是完胜的。
<strong|\<#81F3\>\<#4E8E\>\<#751F\>\<#6001\>>\<#FF0C\>Java\<#548C\>Scala\<#662F\>\<#7ED1\>\<#5B9A\>\<#5728\>\<#4E00\>\<#5757\>\<#7684\>\<#3002\>C++\<#6211\>\<#5C31\>\<#5475\>\<#5475\>\<#54D2\>\<#4E86\>\<#3002\>\<#5728\>\<#963F\>\<#91CC\>\<#4E91\>\<#5B9E\>\<#4E60\>\<#7684\>\<#65F6\>\<#5019\>\<#FF0C\>\<#770B\>\<#5230\>\<#5DE5\>\<#7A0B\>\<#5E08\>\<#4EEC\>\<#4E3A\>\<#4E86\>\<#8FFD\>\<#6C42\>\<#6781\>\<#9650\>\<#7684\>\<#6027\>\<#80FD\>\<#548C\>\<#6781\>\<#5C11\>\<#8D44\>\<#6E90\>\<#6D88\>\<#8017\>\<#FF0C\>\<#65E5\>\<#5FD7\>\<#7684\>\<#6536\>\<#96C6\>\<#7ADF\>\<#7136\>\<#4E5F\>\<#662F\>\<#7528\>C++\<#5199\>\<#7684\>\<#FF08\>\<#517C\>\<#5BB9\>Linux\<#548C\>Windows\<#FF09\>\<#FF0C\>\<#7EBF\>\<#4E0A\>\<#7684\>\<#73AF\>\<#5883\>\<#6BD4\>\<#8F83\>\<#590D\>\<#6742\>\<#FF0C\>\<#8FD9\>\<#4E2A\>\<#65E5\>\<#5FD7\>\<#6536\>\<#96C6\>\<#7A0B\>\<#5E8F\>\<#628A\>\<#6240\>\<#6709\>\<#4F9D\>\<#8D56\>\<#7684\>\<#4EE3\>\<#7801\>\<#90FD\>\<#653E\>\<#5230\>\<#4E86\>\<#540C\>\<#4E00\>\<#4E2A\>\<#5DE5\>\<#7A0B\>\<#4E2D\>\<#7BA1\>\<#7406\>\<#FF0C\>\<#5305\>\<#542B\>Boost\<#548C\>Kafka\<#7684\>C
Binding\<#7B49\>\<#FF0C\>\<#6211\>\<#76F4\>\<#63A5\>\<#5BFC\>\<#5165\>\<#4EE3\>\<#7801\>\<#FF0C\>KDevelop\<#5C31\>\<#5D29\>\<#6E83\>\<#4E86\>\<#3002\>\<#53EF\>\<#80FD\>\<#5BF9\>\<#4E8E\>\<#90A3\>\<#4F4D\>\<#9AA8\>\<#7070\>\<#7EA7\>\<#7684\>C++\<#73A9\>\<#5BB6\>\<#FF0C\>\<#8FD9\>\<#5F88\>\<#7B80\>\<#5355\>\<#FF0C\>\<#800C\>\<#4E14\>\<#975E\>\<#5E38\>\<#65B9\>\<#4FBF\>\<#FF0C\>\<#770B\>\<#5230\>Boost\<#91CC\>\<#9762\>\<#6709\>bug\<#5C31\>\<#987A\>\<#624B\>\<#4FEE\>\<#4E86\>\<#3002\>\<#4F46\>\<#662F\>\<#4ECE\>\<#4EE3\>\<#7801\>\<#590D\>\<#7528\>\<#7684\>\<#89D2\>\<#5EA6\>\<#FF0C\>JVM\<#751F\>\<#6001\>\<#662F\>\<#5B8C\>\<#80DC\>\<#7684\>\<#3002\>
最后GraalVM已经横空出世很久了polyglot不再是空中楼阁可以畅想十年之后软件开发可以多么愉悦。而ScalaJS、Scala
Native到那时候想必已经打磨得差不多了。未来Scala程序员完全可以全栈Scala实现的、通用的、抽象的Library完全可以跨平台使用。然而未来的程序员或许仍然无法逃离Java
API、C POSIX API和JavaScript的魔咒。
\<#6700\>\<#540E\>\<#FF0C\>GraalVM\<#5DF2\>\<#7ECF\>\<#6A2A\>\<#7A7A\>\<#51FA\>\<#4E16\>\<#5F88\>\<#4E45\>\<#4E86\>\<#FF0C\>polyglot\<#4E0D\>\<#518D\>\<#662F\>\<#7A7A\>\<#4E2D\>\<#697C\>\<#9601\>\<#FF0C\>\<#53EF\>\<#4EE5\>\<#7545\>\<#60F3\>\<#FF0C\>\<#5341\>\<#5E74\>\<#4E4B\>\<#540E\>\<#8F6F\>\<#4EF6\>\<#5F00\>\<#53D1\>\<#53EF\>\<#4EE5\>\<#591A\>\<#4E48\>\<#6109\>\<#60A6\>\<#3002\>\<#800C\>ScalaJS\<#3001\>Scala
Native\<#5230\>\<#90A3\>\<#65F6\>\<#5019\>\<#60F3\>\<#5FC5\>\<#5DF2\>\<#7ECF\>\<#6253\>\<#78E8\>\<#5F97\>\<#5DEE\>\<#4E0D\>\<#591A\>\<#4E86\>\<#3002\>\<#672A\>\<#6765\>\<#FF0C\>Scala\<#7A0B\>\<#5E8F\>\<#5458\>\<#5B8C\>\<#5168\>\<#53EF\>\<#4EE5\>\<#5168\>\<#6808\>\<#FF0C\>Scala\<#5B9E\>\<#73B0\>\<#7684\>\<#3001\>\<#901A\>\<#7528\>\<#7684\>\<#3001\>\<#62BD\>\<#8C61\>\<#7684\>Library\<#5B8C\>\<#5168\>\<#53EF\>\<#4EE5\>\<#8DE8\>\<#5E73\>\<#53F0\>\<#4F7F\>\<#7528\>\<#3002\>\<#7136\>\<#800C\>\<#FF0C\>\<#672A\>\<#6765\>\<#7684\>\<#7A0B\>\<#5E8F\>\<#5458\>\<#FF0C\>\<#6216\>\<#8BB8\>\<#4ECD\>\<#7136\>\<#65E0\>\<#6CD5\>\<#9003\>\<#79BB\>Java
API\<#3001\>C POSIX API\<#548C\>JavaScript\<#7684\>\<#9B54\>\<#5492\>\<#3002\>
\;
</body>
@ -68,10 +70,31 @@
<\references>
<\collection>
<associate|auto-1|<tuple|?|?|../../../../.Xmacs/texts/scratch/no_name_21.tm>>
<associate|auto-2|<tuple|?|?|../../../../.Xmacs/texts/scratch/no_name_21.tm>>
<associate|auto-3|<tuple|?|?|../../../../.Xmacs/texts/scratch/no_name_21.tm>>
<associate|auto-4|<tuple|?|?|../../../../.Xmacs/texts/scratch/no_name_21.tm>>
<associate|auto-7|<tuple|1|?|../../../../.Xmacs/texts/scratch/no_name_21.tm>>
<associate|auto-1|<tuple|?|?>>
<associate|auto-2|<tuple|?|?>>
<associate|auto-3|<tuple|?|?>>
<associate|auto-4|<tuple|?|?>>
</collection>
</references>
</references>
<\auxiliary>
<\collection>
<\associate|toc>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|\<#95EE\>\<#9898\>\<#539F\>\<#6587\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-1><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|\<#6211\>\<#7684\>\<#56DE\>\<#7B54\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-2><vspace|0.5fn>
<with|par-left|<quote|1tab>|\<#4E3A\>\<#4EC0\>\<#4E48\>\<#8BF4\>Scala\<#662F\>JVM\<#4E0A\>\<#7684\>C++?
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-3>>
<with|par-left|<quote|1tab>|C++\<#3001\>Java\<#3001\>Scala\<#4E09\>\<#95E8\>\<#8BED\>\<#8A00\>\<#672A\>\<#6765\>\<#7684\>\<#53D1\>\<#5C55\>\<#52A8\>\<#5411\>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-4>>
</associate>
</collection>
</auxiliary>

View file

@ -1,11 +1,11 @@
<TeXmacs|2.1.3>
<TeXmacs|2.1.2>
<style|<tuple|generic|chinese>>
<\body>
<doc-data|<doc-title|如何在Debian中切换默认Python版本>>
<doc-data|<doc-title|\<#5982\>\<#4F55\>\<#5728\>Debian\<#4E2D\>\<#5207\>\<#6362\>\<#9ED8\>\<#8BA4\>Python\<#7248\>\<#672C\>>>
首先查看当前系统中默认的Python版本
\<#9996\>\<#5148\>\<#67E5\>\<#770B\>\<#5F53\>\<#524D\>\<#7CFB\>\<#7EDF\>\<#4E2D\>\<#9ED8\>\<#8BA4\>\<#7684\>Python\<#7248\>\<#672C\>\<#FF1A\>
<\session|shell|default>
<\output>
@ -23,7 +23,7 @@
</input>
</session>
然后查看当前系统可用的Python有哪些
\<#7136\>\<#540E\>\<#67E5\>\<#770B\>\<#5F53\>\<#524D\>\<#7CFB\>\<#7EDF\>\<#53EF\>\<#7528\>\<#7684\>Python\<#6709\>\<#54EA\>\<#4E9B\>\<#FF1A\>
<\session|shell|default>
<\unfolded-io|Shell] >
@ -38,7 +38,7 @@
</input>
</session>
我们可以把以上的python版本都放入python命令的候补列表
\<#6211\>\<#4EEC\>\<#53EF\>\<#4EE5\>\<#628A\>\<#4EE5\>\<#4E0A\>\<#7684\>python\<#7248\>\<#672C\>\<#90FD\>\<#653E\>\<#5165\>python\<#547D\>\<#4EE4\>\<#7684\>\<#5019\>\<#8865\>\<#5217\>\<#8868\>\<#FF1A\>
<\shell-code>
sudo update-alternatives --install /usr/bin/python python
@ -51,7 +51,7 @@
/usr/bin/python3.10 4
</shell-code>
现在我们可以列出这个候补列表
\<#73B0\>\<#5728\>\<#6211\>\<#4EEC\>\<#53EF\>\<#4EE5\>\<#5217\>\<#51FA\>\<#8FD9\>\<#4E2A\>\<#5019\>\<#8865\>\<#5217\>\<#8868\>
<\session|shell|default>
<\unfolded-io|Shell] >
@ -77,16 +77,16 @@
</input>
</session>
现在默认的Python版本已经切换到Python
3.10.5,说明上面最后的数字越大,优先级越高。
\<#73B0\>\<#5728\>\<#9ED8\>\<#8BA4\>\<#7684\>Python\<#7248\>\<#672C\>\<#5DF2\>\<#7ECF\>\<#5207\>\<#6362\>\<#5230\>Python
3.10.5\<#FF0C\>\<#8BF4\>\<#660E\>\<#4E0A\>\<#9762\>\<#6700\>\<#540E\>\<#7684\>\<#6570\>\<#5B57\>\<#8D8A\>\<#5927\>\<#FF0C\>\<#4F18\>\<#5148\>\<#7EA7\>\<#8D8A\>\<#9AD8\>\<#3002\>
我们也可以使用
\<#6211\>\<#4EEC\>\<#4E5F\>\<#53EF\>\<#4EE5\>\<#4F7F\>\<#7528\>
<\shell-code>
<code|update-alternatives --config python>
</shell-code>
在终端中以交互模式选择我们的默认Python版本。
\<#5728\>\<#7EC8\>\<#7AEF\>\<#4E2D\>\<#4EE5\>\<#4EA4\>\<#4E92\>\<#6A21\>\<#5F0F\>\<#9009\>\<#62E9\>\<#6211\>\<#4EEC\>\<#7684\>\<#9ED8\>\<#8BA4\>Python\<#7248\>\<#672C\>\<#3002\>
</body>
<\initial>

View file

@ -1,17 +1,17 @@
<TeXmacs|2.1.3>
<TeXmacs|2.1.2>
<style|<tuple|generic|chinese|doc>>
<\body>
<doc-data|<doc-title|如何安装Fandol字体>>
<doc-data|<doc-title|\<#5982\>\<#4F55\>\<#5B89\>\<#88C5\>Fandol\<#5B57\>\<#4F53\>>>
墨干用户可通过<menu|Help|Planet>中沈浪熊猫儿的空间找到本文档。通过本文档中可执行的Shell会话用户可以完成Fandol字体的安装。
\<#58A8\>\<#5E72\>\<#7528\>\<#6237\>\<#53EF\>\<#901A\>\<#8FC7\><menu|Help|Planet>\<#4E2D\>\<#6C88\>\<#6D6A\>\<#718A\>\<#732B\>\<#513F\>\<#7684\>\<#7A7A\>\<#95F4\>\<#627E\>\<#5230\>\<#672C\>\<#6587\>\<#6863\>\<#3002\>\<#901A\>\<#8FC7\>\<#672C\>\<#6587\>\<#6863\>\<#4E2D\>\<#53EF\>\<#6267\>\<#884C\>\<#7684\>Shell\<#4F1A\>\<#8BDD\>\<#FF0C\>\<#7528\>\<#6237\>\<#53EF\>\<#4EE5\>\<#5B8C\>\<#6210\>Fandol\<#5B57\>\<#4F53\>\<#7684\>\<#5B89\>\<#88C5\>\<#3002\>
目前我们已经针对macOS和Windows做了中文字体的适配本文的目标读者是GNU/Linux用户我会尽可能保证在GNU/Linux上本文的Shell会话可以正常执行。
\<#76EE\>\<#524D\>\<#6211\>\<#4EEC\>\<#5DF2\>\<#7ECF\>\<#9488\>\<#5BF9\>macOS\<#548C\>Windows\<#505A\>\<#4E86\>\<#4E2D\>\<#6587\>\<#5B57\>\<#4F53\>\<#7684\>\<#9002\>\<#914D\>\<#FF0C\>\<#672C\>\<#6587\>\<#7684\>\<#76EE\>\<#6807\>\<#8BFB\>\<#8005\>\<#662F\>GNU/Linux\<#7528\>\<#6237\>\<#FF0C\>\<#6211\>\<#4F1A\>\<#5C3D\>\<#53EF\>\<#80FD\>\<#4FDD\>\<#8BC1\>\<#5728\>GNU/Linux\<#4E0A\>\<#FF0C\>\<#672C\>\<#6587\>\<#7684\>Shell\<#4F1A\>\<#8BDD\>\<#53EF\>\<#4EE5\>\<#6B63\>\<#5E38\>\<#6267\>\<#884C\>\<#3002\>
<section*|安装依赖软件>
<section*|\<#5B89\>\<#88C5\>\<#4F9D\>\<#8D56\>\<#8F6F\>\<#4EF6\>>
本文依赖如下软件,请自行安装:
\<#672C\>\<#6587\>\<#4F9D\>\<#8D56\>\<#5982\>\<#4E0B\>\<#8F6F\>\<#4EF6\>\<#FF0C\>\<#8BF7\>\<#81EA\>\<#884C\>\<#5B89\>\<#88C5\>\<#FF1A\>
<\session|shell|default>
<\output>
@ -21,7 +21,8 @@
<\unfolded-io|Shell] >
wget --version \| head -n 1
<|unfolded-io>
GNU Wget 1.21.3 在 linux-gnu 上编译。
GNU Wget 1.21.3 \<#5728\> linux-gnu
\<#4E0A\>\<#7F16\>\<#8BD1\>\<#3002\>
</unfolded-io>
<\input|Shell] >
@ -29,7 +30,7 @@
</input>
</session>
<section*|下载Fandol字体到指定目录>
<section*|\<#4E0B\>\<#8F7D\>Fandol\<#5B57\>\<#4F53\>\<#5230\>\<#6307\>\<#5B9A\>\<#76EE\>\<#5F55\>>
<\session|shell|default>
<\input|Shell] >
@ -82,11 +83,15 @@
</input>
</session>
<section*|清除字体缓存并重启墨干>
<section*|\<#6E05\>\<#9664\>\<#5B57\>\<#4F53\>\<#7F13\>\<#5B58\>\<#5E76\>\<#91CD\>\<#542F\>\<#58A8\>\<#5E72\>>
点击<menu|Tools|Font|Clear font cache>之后,重启墨干,就可以点击<menu|Document|Font>找到Fandol字体。GNU/Linux下的默认中文字体就是Fandol就墨干V1.0.4而言在重启之后文档中标点符号的展示能得到比较大的改善比如句号如果不安装Fandol字体默认是居中的安装之后就能正确展示。
\<#70B9\>\<#51FB\><menu|Tools|Font|Clear font
cache>\<#4E4B\>\<#540E\>\<#FF0C\>\<#91CD\>\<#542F\>\<#58A8\>\<#5E72\>\<#FF0C\>\<#5C31\>\<#53EF\>\<#4EE5\>\<#70B9\>\<#51FB\><menu|Document|Font>\<#FF0C\>\<#627E\>\<#5230\>Fandol\<#5B57\>\<#4F53\>\<#3002\>GNU/Linux\<#4E0B\>\<#7684\>\<#9ED8\>\<#8BA4\>\<#4E2D\>\<#6587\>\<#5B57\>\<#4F53\>\<#5C31\>\<#662F\>Fandol\<#FF0C\>\<#5C31\>\<#58A8\>\<#5E72\>V1.0.4\<#800C\>\<#8A00\>\<#FF0C\>\<#5728\>\<#91CD\>\<#542F\>\<#4E4B\>\<#540E\>\<#FF0C\>\<#6587\>\<#6863\>\<#4E2D\>\<#6807\>\<#70B9\>\<#7B26\>\<#53F7\>\<#7684\>\<#5C55\>\<#793A\>\<#80FD\>\<#5F97\>\<#5230\>\<#6BD4\>\<#8F83\>\<#5927\>\<#7684\>\<#6539\>\<#5584\>\<#FF0C\>\<#6BD4\>\<#5982\>\<#53E5\>\<#53F7\>\<#FF0C\>\<#5982\>\<#679C\>\<#4E0D\>\<#5B89\>\<#88C5\>Fandol\<#5B57\>\<#4F53\>\<#FF0C\>\<#9ED8\>\<#8BA4\>\<#662F\>\<#5C45\>\<#4E2D\>\<#7684\>\<#FF0C\>\<#5B89\>\<#88C5\>\<#4E4B\>\<#540E\>\<#5C31\>\<#80FD\>\<#6B63\>\<#786E\>\<#5C55\>\<#793A\>\<#3002\>
</body>
<initial|<\collection>
</collection>>
<\references>
<\collection>
<associate|auto-1|<tuple|?|?>>
@ -96,4 +101,29 @@
<associate|auto-5|<tuple|?|?>>
<associate|auto-6|<tuple|?|?>>
</collection>
</references>
</references>
<\auxiliary>
<\collection>
<\associate|idx>
<tuple|<tuple|<with|font-family|<quote|ss>|\<#5E2E\>\<#52A9\>>|<with|font-family|<quote|ss>|\<#58A8\>\<#5BA2\>\<#661F\>\<#7403\>>>|<pageref|auto-1>>
<tuple|<tuple|<with|font-family|<quote|ss>|\<#5DE5\>\<#5177\>>|<with|font-family|<quote|ss>|\<#5B57\>\<#4F53\>>|<with|font-family|<quote|ss>|\<#6E05\>\<#9664\>\<#5B57\>\<#4F53\>\<#7F13\>\<#5B58\>>>|<pageref|auto-5>>
<tuple|<tuple|<with|font-family|<quote|ss>|\<#6587\>\<#6863\>>|<with|font-family|<quote|ss>|\<#5B57\>\<#4F53\>>>|<pageref|auto-6>>
</associate>
<\associate|toc>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|\<#5B89\>\<#88C5\>\<#4F9D\>\<#8D56\>\<#8F6F\>\<#4EF6\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-2><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|\<#4E0B\>\<#8F7D\>Fandol\<#5B57\>\<#4F53\>\<#5230\>\<#6307\>\<#5B9A\>\<#76EE\>\<#5F55\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-3><vspace|0.5fn>
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|\<#6E05\>\<#9664\>\<#5B57\>\<#4F53\>\<#7F13\>\<#5B58\>\<#5E76\>\<#91CD\>\<#542F\>\<#58A8\>\<#5E72\>>
<datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
<no-break><pageref|auto-4><vspace|0.5fn>
</associate>
</collection>
</auxiliary>

View file

@ -1,9 +1,9 @@
<TeXmacs|2.1.3>
<TeXmacs|2.1.2>
<style|<tuple|generic|chinese|doc>>
<\body>
<doc-data|<doc-title|如何输入希腊字母>>
<doc-data|<doc-title|\<#5982\>\<#4F55\>\<#8F93\>\<#5165\>\<#5E0C\>\<#814A\>\<#5B57\>\<#6BCD\>>>
<\big-table|<tabular|<tformat|<cwith|1|1|1|1|cell-rborder|0ln>|<cwith|1|1|1|-1|cell-tborder|1ln>|<cwith|1|1|1|-1|cell-bborder|0ln>|<cwith|5|5|1|-1|cell-tborder|0ln>|<cwith|1|1|1|1|cell-lborder|0ln>|<cwith|15|15|1|-1|cell-tborder|0ln>|<cwith|14|14|1|-1|cell-bborder|0ln>|<cwith|15|15|1|-1|cell-bborder|1ln>|<cwith|15|15|1|1|cell-lborder|0ln>|<cwith|15|15|8|8|cell-rborder|0ln>|<table|<row|<cell|<math|\<alpha\>>>|<cell|<math|\<beta\>>>|<cell|<math|\<gamma\>>>|<cell|<math|\<delta\>>>|<cell|<math|\<varepsilon\>>>|<cell|<math|\<epsilon\>>>|<cell|<math|\<zeta\>>>|<cell|<math|\<eta\>>>>|<row|<cell|<markup|alpha>>|<cell|<markup|beta>>|<cell|<markup|gamma>>|<cell|<markup|delta>>|<cell|<markup|varepsilon>>|<cell|<markup|epsilon>>|<cell|<markup|zeta>>|<cell|<markup|eta>>>|<row|<cell|<key*|a
var>>|<cell|<key*|b var>>|<cell|<key*|g var>>|<cell|<key*|d
@ -17,7 +17,7 @@
var>>|<cell|<key*|t var>>>|<row|<cell|>|<cell|>|<cell|>|<cell|>|<cell|>|<cell|>|<cell|>|<cell|>>|<row|<cell|<math|\<upsilon\>>>|<cell|<math|\<phi\>>>|<cell|<math|\<varphi\>>>|<cell|<math|\<chi\>>>|<cell|<math|\<psi\>>>|<cell|<math|\<omega\>>>|<cell|>|<cell|>>|<row|<cell|<markup|upsilon>>|<cell|<markup|phi>>|<cell|<markup|varphi>>|<cell|<markup|chi>>|<cell|<markup|psi>>|<cell|<markup|omega>>|<cell|>|<cell|>>|<row|<cell|<key*|u
var>>|<cell|<key*|v var>>|<cell|<key*|v var var>>|<cell|<key*|q
var>>|<cell|<key*|y var>>|<cell|<key*|w var>>|<cell|>|<cell|>>>>>>
小写希腊字母一览
\<#5C0F\>\<#5199\>\<#5E0C\>\<#814A\>\<#5B57\>\<#6BCD\>\<#4E00\>\<#89C8\>
</big-table>
<\big-table|<tabular|<tformat|<table|<row|<cell|<math|\<Alpha\>>>|<cell|<math|\<Beta\>>>|<cell|<math|\<Gamma\>>>|<cell|<math|\<Delta\>>>|<cell|\<Epsilon\>>|<cell|\<Zeta\>>|<cell|\<Eta\>>>|<row|<cell|<markup|Alpha>>|<cell|<markup|Beta>>|<cell|<markup|Gamma>>|<cell|<markup|Delta>>|<cell|<markup|Epsilon>>|<cell|<markup|Zeta>>|<cell|<markup|Eta>>>|<row|<cell|<key*|A
@ -26,14 +26,17 @@
tab>>>|<row|<cell|>|<cell|>|<cell|>|<cell|>|<cell|>|<cell|>|<cell|>>|<row|<cell|\<Psi\>>|<cell|\<Chi\>>|<cell|\<Omega\>>|<cell|\<Backepsilon\>>|<cell|\<Backsigma\>>|<cell|\<Mho\>>|<cell|>>|<row|<cell|<markup|Psi>>|<cell|<markup|Chi>>|<cell|<markup|Omega>>|<cell|<markup|Backepsilon>>|<cell|<markup|Backsigma>>|<cell|<markup|Mho>>|<cell|>>|<row|<cell|<key|Y
tab>>|<cell|<key|Q tab>>|<cell|<key|W tab>>|<cell|<key|E><key|4*Tab>>|<cell|<key|S><key|2*Tab>>|<cell|<key|W
2*Tab>>|<cell|>>>>>>
大写希腊字母一览
\<#5927\>\<#5199\>\<#5E0C\>\<#814A\>\<#5B57\>\<#6BCD\>\<#4E00\>\<#89C8\>
</big-table>
</body>
<initial|<\collection>
</collection>>
<\references>
<\collection>
<associate|auto-1|<tuple|1|?|../../../.Xmacs/texts/scratch/no_name_1.tm>>
<associate|auto-2|<tuple|2|?|../../../.Xmacs/texts/scratch/no_name_1.tm>>
<associate|auto-1|<tuple|1|?>>
<associate|auto-2|<tuple|2|?>>
</collection>
</references>
@ -41,11 +44,11 @@
<\collection>
<\associate|table>
<tuple|normal|<\surround|<hidden-binding|<tuple>|1>|>
小写希腊字母一览
\<#5C0F\>\<#5199\>\<#5E0C\>\<#814A\>\<#5B57\>\<#6BCD\>\<#4E00\>\<#89C8\>
</surround>|<pageref|auto-1>>
<tuple|normal|<\surround|<hidden-binding|<tuple>|2>|>
大写希腊字母一览
\<#5927\>\<#5199\>\<#5E0C\>\<#814A\>\<#5B57\>\<#6BCD\>\<#4E00\>\<#89C8\>
</surround>|<pageref|auto-2>>
</associate>
</collection>

View file

@ -1,26 +1,27 @@
<TeXmacs|2.1.3>
<TeXmacs|2.1.2>
<style|<tuple|generic|chinese|doc>>
<\body>
<doc-data|<doc-title|快速输入以1为分子的分式>>
<doc-data|<doc-title|\<#5FEB\>\<#901F\>\<#8F93\>\<#5165\>\<#4EE5\>1\<#4E3A\>\<#5206\>\<#5B50\>\<#7684\>\<#5206\>\<#5F0F\>>>
在数学模式中,我们希望通过按键序列<code*|1/>获得一个以1为分子的分式并把光标移动到分母中以方便后续输入。
\<#5728\>\<#6570\>\<#5B66\>\<#6A21\>\<#5F0F\>\<#4E2D\>\<#FF0C\>\<#6211\>\<#4EEC\>\<#5E0C\>\<#671B\>\<#901A\>\<#8FC7\>\<#6309\>\<#952E\>\<#5E8F\>\<#5217\><code*|1/>\<#83B7\>\<#5F97\>\<#4E00\>\<#4E2A\>\<#4EE5\>1\<#4E3A\>\<#5206\>\<#5B50\>\<#7684\>\<#5206\>\<#5F0F\>\<#FF0C\>\<#5E76\>\<#628A\>\<#5149\>\<#6807\>\<#79FB\>\<#52A8\>\<#5230\>\<#5206\>\<#6BCD\>\<#4E2D\>\<#FF0C\>\<#4EE5\>\<#65B9\>\<#4FBF\>\<#540E\>\<#7EED\>\<#8F93\>\<#5165\>\<#3002\>
<\equation*>
<frac|1|1+<frac|1|1+<frac|1|1+<frac|1|1+<frac|1|1+<frac|1|1+<frac|1|1+<frac|1|1+<frac|1|>>>>>>>>>
</equation*>
可以通过如下方式实现这样的功能:
\<#53EF\>\<#4EE5\>\<#901A\>\<#8FC7\>\<#5982\>\<#4E0B\>\<#65B9\>\<#5F0F\>\<#5B9E\>\<#73B0\>\<#8FD9\>\<#6837\>\<#7684\>\<#529F\>\<#80FD\>\<#FF1A\>
<\enumerate>
<item>点击<menu|Tools|Developer tool>,激活<menu|Developer>菜单
<item>\<#70B9\>\<#51FB\><menu|Tools|Developer
tool>\<#FF0C\>\<#6FC0\>\<#6D3B\><menu|Developer>\<#83DC\>\<#5355\>
<item>点击<menu|Developer|Open my-init-texmacs.scm>
<item>\<#70B9\>\<#51FB\><menu|Developer|Open my-init-texmacs.scm>
<item>在该文件的末尾添加如下代码
<item>\<#5728\>\<#8BE5\>\<#6587\>\<#4EF6\>\<#7684\>\<#672B\>\<#5C3E\>\<#6DFB\>\<#52A0\>\<#5982\>\<#4E0B\>\<#4EE3\>\<#7801\>
<item>重启<TeXmacs>
<item>\<#91CD\>\<#542F\><TeXmacs>
</enumerate>
<\scm-code>
@ -31,11 +32,11 @@
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (go-to-previous-word))))
</scm-code>
然后,你就可以愉快地在数学模式中,用<key|1><key|/>快速输入分子为1的分式了。
\<#7136\>\<#540E\>\<#FF0C\>\<#4F60\>\<#5C31\>\<#53EF\>\<#4EE5\>\<#6109\>\<#5FEB\>\<#5730\>\<#5728\>\<#6570\>\<#5B66\>\<#6A21\>\<#5F0F\>\<#4E2D\>\<#FF0C\>\<#7528\><key|1><key|/>\<#5FEB\>\<#901F\>\<#8F93\>\<#5165\>\<#5206\>\<#5B50\>\<#4E3A\>1\<#7684\>\<#5206\>\<#5F0F\>\<#4E86\>\<#3002\>
\;
原文在2019年9月13号在<slink|http://tmml.wiki>的WordPress博客上发布。2022年4月30日在<hlink|墨客星球|https://gitee.com/XmacsLabs/planet>作为第一篇文章发布。
\<#539F\>\<#6587\>\<#5728\>2019\<#5E74\>9\<#6708\>13\<#53F7\>\<#FF0C\>\<#5728\><slink|http://tmml.wiki>\<#7684\>WordPress\<#535A\>\<#5BA2\>\<#4E0A\>\<#53D1\>\<#5E03\>\<#3002\>2022\<#5E74\>4\<#6708\>30\<#65E5\>\<#FF0C\>\<#5728\><hlink|\<#58A8\>\<#5BA2\>\<#661F\>\<#7403\>|https://gitee.com/XmacsLabs/planet>\<#4F5C\>\<#4E3A\>\<#7B2C\>\<#4E00\>\<#7BC7\>\<#6587\>\<#7AE0\>\<#53D1\>\<#5E03\>\<#3002\>
</body>
<\initial>
@ -55,11 +56,11 @@
<\auxiliary>
<\collection>
<\associate|idx>
<tuple|<tuple|<with|font-family|<quote|ss>|工具>|<with|font-family|<quote|ss>|开发工具>>|<pageref|auto-1>>
<tuple|<tuple|<with|font-family|<quote|ss>|\<#5DE5\>\<#5177\>>|<with|font-family|<quote|ss>|\<#5F00\>\<#53D1\>\<#5DE5\>\<#5177\>>>|<pageref|auto-1>>
<tuple|<tuple|<with|font-family|<quote|ss>|开发者>>|<pageref|auto-2>>
<tuple|<tuple|<with|font-family|<quote|ss>|\<#5F00\>\<#53D1\>\<#8005\>>>|<pageref|auto-2>>
<tuple|<tuple|<with|font-family|<quote|ss>|开发者>|<with|font-family|<quote|ss>|打开my-init-texmacs.scm文件>>|<pageref|auto-3>>
<tuple|<tuple|<with|font-family|<quote|ss>|\<#5F00\>\<#53D1\>\<#8005\>>|<with|font-family|<quote|ss>|\<#6253\>\<#5F00\>my-init-texmacs.scm\<#6587\>\<#4EF6\>>>|<pageref|auto-3>>
</associate>
</collection>
</auxiliary>