the art of unix programming--笔记(chap1)

【信息科学与工程学】【数据中心】第三十五篇 云计算数据中心的学科知识04 编号学科(课程)核心知识点在云计算/云存储/云网络/云安全/云MaaS中的作用代表教材/资料/论文 + 数学方程式列表工业界应用D1421​云原生数据库:TiDB​HTAP(混合事务/分析处理)、分布式SQL、水平扩展、强一致(Raft)、自动故障恢复、与MySQL兼容、TiFlash列式引擎提供弹性扩展的分布式数据库;支撑高并发在线交易与实时分析教材:《TiDB in Action》PingCAP(2020) 论文:《TiDB: A Raft-based HTAP Database》(2017) 阅读详情

大部分做笔记的目的是“取其精华”,以后复习重用的时候依照笔记就可以得到所需全部,原书大可废之。
但是对于《the art of unix programming》这样的书不敢如此,拜读之际,尽量多多思考,以求指导自己编程实践。
chap1 Basics of the Unix Philosophy
first part:----rules----------------------------------------------------------------------------------
这一部分是讲17个rule:
modularity,
clarity,
composition,
seperation,
simplicity,
parsimony,
transparency,
robustness,
presentation,
less surprise,
silence,
repair,
economy,
generation,
optimization,
diversity,
extensibility.

但是我想本章节最经典的一句话应属Kernighan的那句:

"controlling complexity is the essence of computer programming“


以及对应的unix所崇尚的原则:

"kiss:keep it simple and stupid"

结合自己的理解,kiss原则可以和表述问题相类比:精炼的把问题表达清楚,这需要
1st:要对问题认识透彻
2nd:表达的时候使用通俗而精炼的语言,层次清晰的表达
programming亦是如此,
在coding之前自然不能不思考明白,
在coding时候通过模块把问题化繁为简,并以简单通俗的方式实现,从而达到对问题的解决,对复杂度的化解。
当然完全没必要为了简单而简单,对问题的解决是最终审判者,在没有在实践中确切深悟它的时候,应该遵循它,
在实践中体会与发展,而不是拘泥于它,。

这是指导编程的”道“。
而到具体的术,则追求清晰明确的接口与模块划分,让bug显而易见的方式,以及优化的时机火候。
而实现中则是考虑人脑的处理能力,单个代码块的复杂度以人能轻松看透为最佳。

另外一个细节很有指导作用--debug时间一般占用项目的四分之三,所以让debug更加容易是非常有意义的事情。

second part:----Attitude Matters Too------------------------------------------------------------------
这一部分可以说更加精彩,虽然只有一页。
它告诉我们要用心和大脑去编写程序,而不是单纯的努力工作。
Can I work smarter? 这应该是自省的时候要自问的问题。
另一方面,Raymond对于编程的热爱让我非常喜欢,他认为编程是需要你对与追求卓越有着坚定的忠诚,需要你认为是值得你去投入你所有的热情,智慧和创意的事情,这是一项充满快乐的艺术,一种高级的游戏。


确切的讲,这一页的内容是我爱上这本书的原因。

 

 

The Art of Unix Programming Eric Steven Raymond著 立即下载

相关推荐

UNIX编程艺术(The.Art.of.Unix.Programming)中英版

Unix编程艺术(The.Art.of.Unix.Programming)

好书推荐 The Art of Unix Programming

好书推荐 The Art of Unix Programming Eric Steven Raymond       esr@thyrsus.com 全文浏览:     http://www.faqs.org/docs/artu/index.html Preface Unix is not so much an operating system as an oral history.-- Neal

He Hao 的部落格 1227

The Art Of Unix Programming

The Art Of Unix Programming

The Art Of Unix Programming ---part 1

(i) Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features. (ii) Expect the output of every program to become the input to anot

learnboy007的专栏 766

The art of unix programming

从文化, 传统和设计的角度, 讲述unix和黑客的发展和设计思想

Mac mini 24G大模型推理内存瓶颈与优化实战

统一内存架构(UMA)是Apple Silicon的核心特性,其内存带宽固定、CPU/GPU/神经引擎共享物理池,导致大模型推理时易出现带宽争抢而非容量不足。Q4_K_M量化、KV Cache动态膨胀、Tokenizer缓存失控及Metal Shader编译开销共同构成内存消耗黑洞。技术价值在于将‘OOM Killed: 9’从玄学错误转化为可建模的资源调度问题;典型应用场景包括本地LLM部署、边缘AI推理与轻量RAG验证;本文聚焦M系列芯片下24GB UMA的实际承载边界与不换硬件的确定性优化路径,涵盖G

weixin_33461476的博客 223

【书籍推荐】UNIX编程艺术 The Art of UNIX Programming

[美]Eric S. Raymond 著 姜宏、何源、蔡晓骏 译 2006年1月出版 ISBN 7-121-02116-1 59.00元 560页   01.jpg (7.25 KB, 下载次数: 3) 下载附件 保存到相册 UNIX编程艺术 昨天 23:51 上传   本书主要介绍了UNIX系统Linux入门培训领域中的设计和开发哲学、思想文化体系、

u010926630的专栏 863

OCV/AOCV/SOCV的介绍和应用

library中的cell delay是在某个固定的PVT(operating condition)下仿真得出的。,cell的delay并不是一个固定值,而是一个随机值,遵循高斯分布或门特卡洛分布,在STA中用OCV来模拟这一『特征』。OCV全称on chip variation,用于描述不同管子间由于工艺偏差、电压降、温度变化引起的delay变化。,也用于描述工艺偏差引起的net厚度宽度的变化从而导致net的电容电阻变化。优点:设置起来比较简单粗暴,对于不那么先进的工艺可行!的影响,更贴合实际。

m0_61003348的博客 8995

探索智慧的艺术:TAOUP——一个UNIX编程的灵感源泉

探索智慧的艺术:TAOUP——一个UNIX编程的灵感源泉 项目介绍 TAOUP(The Art of Unix Programming)是一个由Ruby驱动的程序,它将ANSI彩色的文字艺术带入你的终端,为你在登录时提供适时的智慧启示。这个项目不仅是一个个人收藏的智慧宝库,也欢迎社区的贡献和分享。 项目技术分析 该项目基于Ruby语言开发,利用ansi gem来实现终端中的颜色效果。通过简单的命令...

gitblog_00077的博客 567

用FSL的eddy_topup pipeline完整处理DTI数据:从原理到实战,搞定涡流和磁化率畸变

本文详细介绍了如何使用FSL的eddy_topup pipeline完整处理DTI数据,解决涡流和磁化率畸变问题。从原理到实战,涵盖了数据格式转换、脑提取、b0图像处理等关键步骤,并提供了acqparams.txt配置和eddy命令的详细解析,帮助研究人员高效完成DTI数据校正。

weixin_29235525的博客 290

有限元中的对称魔法:用1/6模型算整个涡轮叶片(含MATLAB代码)

本文深入解析了有限元分析中针对循环对称结构的高效求解策略。通过利用涡轮叶片等结构的几何重复性,仅需对1/6基本扇区建模并施加循环对称条件,即可精确推演整体力学行为,大幅降低计算规模。文章从数学原理推导到MATLAB代码实现,提供了完整的实战指南,适用于旋转机械的静力、模态及谐响应分析。

fire9的博客 315

山外看山 —— 评The Art of Unix Programming

山外看山评The Art of Unix Programming作者:涩涩 http://blog.csdn.net/sese 声明:本文发表于程序员杂志今年第9期,略有删节,非经杂志社和作者书面许可,请勿擅自转载部分或全部内容。 上世纪初,英国记者斯文顿天才地将内燃机、履带、武器和装甲这些风马牛不相及的东西结合,发明出了坦克——可以边移动边攻击的钢铁堡垒。在法国战场上,德军士兵被这看似笨

涩涩的专栏 5798

地统计插值学习心得(一)

(创建地统计图层工具用于根据现有的地统计图层或者地统计模型来创建包含新要素数据集的地统计图层,也就是使用构建好的地统计模型用到新的数据集中)这表明,远离极值的区域预测不受极值的影响,并且还表明,包括极值会导致钼元素浓度高的区域周围的预测明显变高。通常,我们使用同一个数据集进行建模和预测,但是在实际插值过程中,这两步的数据可以是不同的,这就是处理极值的诀窍。如果你的数据集有无法忽略的极值时(比如这些钼元素浓度),一种常见的方法是首先显式移除极值进行建模,然后在预测中使用整个数据集(包括极值)。

JData_Engineer的博客 287

the art of unix programming--笔记(chap12)

chap 12 optimizationpremature optimization is the root of all evel--C.A.R.Hoare这一章我是认为正本书第二好的一章,最好的当然是黄金第一章,某种程度上来讲,有一定编程经验的话读完第一章,已经把整本书的%80拿到手了。这一章就是精简而且道理明晰。12.1 除非不得已,不要去优化12.2 先测试后优化直觉常常证明为错误的,理工

安柏霖的专栏 1461

DCDC电路断电时放电波形发生震荡和电压跳变问题,如何解决?

DCDC电路断电时放电波形发生震荡和电压跳变问题: 做的一个项目需要用单片机ADC采集电压,要让单片机感应到电压降到3.1V开始往FLASH里存数据,单片机2.4V基本上就工作不了,(根据单片机手册的,擦写的时间在40mS在左右)所以3.1V降到2.4V的时间必须要大于40mS岁以上,在单片机VCC处加了一个100nF的电容,理论仿真下来150mS左右发现存不进去,用示波器抓了一下波形,发现放电时震荡很严重,实际3.1V到2.4V时间只有10ms左右,这个肯定存不进去; 请教师傅说是应该时前级DCDC开关电

**My Coding Family** 1995

★教程3:Simulink学习教程入门60例目录

1.订阅本教程用户可以免费获得本博任意1个(包括所有免费专栏和付费专栏)博文对应代码;2.本Simulink课程的所有案例(部分理论知识点除外)均由博主编写而成,供有兴趣的朋友们自己订阅学习使用。未经本人允许,禁止任何形式的商业用途;3.本课程除了介绍常见的Simulink模块介绍之外,我们更侧重于各种实例的完整设计介绍。从通信,控制器,图像处理,语音处理,电力系统等诸多常用领域介绍了相关案例,如果对于某个较为复杂的案例,初学者无法正确复现,也可以私信博主获得完整Simulink模型文件。

FPGA/MATLAB学习教程/源码/项目合作开发 1万+

the art of unix programming--笔记(chap4)

chap4 modularity:keeping it clean,keep it simple这一章我理解就是对于“人通过电脑编程来解决问题”这一编程实质的扩展。如何通过有限的脑力来一步步的创建出可以解决问题的程序?而且这种解决要求过程要比较快,这一章我的理解如下:编程的实质可以描述为:人通过电脑编程来解决问题。而其中一个天然限制就是人脑的处理能力有限。那么在设计以及实现的速度质量方面,

安柏霖的专栏 1582

结构函数详解

C3M系列覆盖从1 kW到60 kW功率范围,器件Rdson低、开关速度快(Eon/Eoff低),支持高温工作(结温高达175–225°C)。型号电压 (V)Rdson (mΩ, 典型@25°C)电流 (A, 连续@25°C)封装类型典型应用功率 (kW)65012022TO-247-41–106506035TO-247-35–2065060355–2012002180TO-247-310–40120016100TO-247-420–601200。

专注于前沿技术的探索与实践,热衷于从代码逻辑、架构设计到行业应用等多维度深挖技术本质。期待在技术之路上与你共同成长~ 166

The Art of Unix Programming之文化

本书在第一章第一段讲述了什么是文化 Those who do not understand Unix are condemned to reinvent it,poorly --Henry Spencer 不懂Unix的人注定最终还要重复发明一个蹩脚的Unix 开篇的名言告诫我们,请先了解Unix,理解器背后的文化后,再来谈重新发明。这句话的当代解释为...

iCloudEnd的博客 500

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Reading 'The Art of UNIX Programming'.

‘The Art of UNIX Programming原版,人民邮电出版社 2006年8月第1版,本篇页码对照此版书籍以下为阅读笔记,转载请注明出处颜色说明:黑色 -- Summary of the book红色 -- Crobs comment蓝色 -- Important summary Chapter 1   Philosophy MattersP13

CROB's Blog 1419

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 在游戏中思考
下一篇: the art of unix programming--笔记(chap4)
安柏霖
安柏霖 领域专家: 学术研究与理论基础技术领域 领域专家: 学术研究与理论基础技术领域
博客等级 码龄20年 1789粉丝 891原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值