Hexo部署时出现“ERROR Deployer not found: git”的解决办法

网上关于此错误的解决办法已经过时了,因为新安装的 Hexo 出现这种问题并不是因为 _config.yml 文件中deploy项的type被误写为github,正确地写成"type: git"在执行“hexo d”命令时依然出现这个问题。

一开始我也是百思不得其解,后来发现是因为没有安装 hexo-deployer-git。
在命令行中执行“npm install hexo-deployer-git --save”命令,完成后再执行“hexo d”你会发现这个问题已经轻松地解决了。

遇到问题后建议先去翻一翻官方文档,看看是不是自己疏忽了什么,别直接去找答案,因为即便是大牛给出的答案,也有可能是过时的(或牛头不对马嘴的)。

另附 Hexo中文文档 地址:https://hexo.io/zh-cn/docs/index.html

Memory and Pointers

我上一篇文章看起来凑数的嫌疑很大啊,这篇应该好些吧。

这第二章介绍的是储存器和指针,并没有像“C程序设计语言”那样形式化地讲数据类型、运算符与表达式,很对我的口味。

这章以一个笑话开篇

男:...and of course, Mommy never lets me stay out after 6 p.m.
女:Thank heavens my boyfriend variable isn’t in read-only memory.

接着步入正题

If you really want to kick butt with C, you need to understand how C handles memory.
如果你真的想用C语言大杀四方,就需要理解C语言是怎样操控储存器的。
本句中的“kick butt”竟然被百度翻译翻译为“踢屁股”,这样也没什么错,butt确实有“屁股”的含义。上面那句是我翻译的。

The C language gives you a lot more control over how your program uses the computer’s memory. In this chapter, you’ll strip back the covers and see exactly what happens when you read and write variables. You’ll learn how arrays work, how to avoid some nasty memory SNAFUs, and most of all, you’ll see how mastering pointers and memory addressing is key to becoming a kick-ass C programmer.

strip 作动词时意为“除去;拆开”
SNAFU 意为“混乱的局面”
master 作动词意为“掌握;精通;控制”
kick-ass 意为“了不起的”

这几句就不翻译了吧,结合上面那几个单词的含义,都看得懂。

这句话我深以为然:
To best understand pointers, go slowly.

C code includes pointers

Pointers are one of the most fundamental things to understand in the C programming language. So what’s a pointer? A pointer is just the address of a piece of data in memory.

fundamental adj.基础的;基本的;根本的;十分重大的

指针是什么呢?指针就是内存中的数据的地址。

Pointers are used in C for a couple of reasons.
1.Instead of passing around a whole copy of the data, you can just pass a pointer.
(书中配的搞笑的帮助理解的图片和文字大家还是看书比较好)
2.You might want two pieces of code to work on the same piece of data rather than a separate copy.
你或许想要让两段代码处理同一条数据,而不是分别处理这条数据的副本。

Pointers help you do both these things: avoid copies and share data. But if pointers are just addresses, why do some people find them confusing? Because they’re a form of indirection. If you’re not careful, you can quickly get lost chasing pointers through memory. The trick to learning how to use C pointers is to go slowly.

Don’t try to rush this chapter.
Pointers are a simple idea, but you need to take your time and understand everything. Take frequent breaks, drink plenty of water, and if you really get stuck, take a nice long bath.

rush v.
get stuck 上当;卡住;被困住
stuck stick的过去式及过去分词
stick v.粘贴;刺;忍受

Digging into memory

To understand what pointers are, you’ll need to dig into the memory of the computer.

Every time you declare a variable, the computer creates space for it somewhere in memory. If you declare a variable inside a function like main(), the computer will store it in a section of memory called the stack. If a variable is declared outside any function, it will be stored in the globals section of memory.

stack n.堆栈

The computer might allocate, say, memory location 4,100,000 in the stack for the x variable. If you assign the number 4 to the variable, the computer will store 4 at location 4,100,000.

allocate v.拨...(给);划...(归);分配...(给)
assign v.指定;指派;转让;分派

If you want to find out the memory address of the variable, you can use the & operator:
printf("x is stored at %p\n", &x);

The address of the variable tells you where to find the variable in memory. That’s why an address is also called a pointer, because it points to the variable in memory.

Getting Started with C

我是有些浮躁的那种人,为了克制自己,在此次重新学C的过程中,每看完一章的内容就在博客中将所讲内容的梗概写出来。我看的书是"嗨翻C语言"和"Head First C",这两本书其实也是一本书,一本是中文译本,一本是原版。这本书虽浅显易懂,却又不是“啊哈C”那种浅显,后者明显是给小孩子看的。中文版翻译的还可以,书名起的也很大胆,我喜欢。之所以还选择看英文版,一是因为这本书确实是给初学者看的,单词语法都很简单;二来是因为看英文版可以更好的理解那些单词缩写,比如exe后缀就是execute的缩写,我是看了这本书才知道(通过句子中的那个单词看出来的,并不是这本书明显提出来的)。原因还有好几条,就不再列举了。

6/12补充:还是不写梗概了吧,贴原文多好呢。

Diving in

Don’t you just love the deep blue C? Come on in — the water’s lovely!

Want to get inside the computer’s head?

Need to write high-performance code for a new game? Program an Arduino? Or use that advanced third-party library in your iPhone app? If so, then C’s here to help. C works at a much lower level than most other languages, so understanding C gives you a much better idea of what’s really going on. C can even help you better understand other languages as well. So dive in and grab your compiler, and you’ll soon get started in no time.

C is a language for small, fast programs

The C language is designed to create small, fast programs. It’s lower-level than most other languages; that means it creates code that’s a lot closer to what machines really understand.

###The way C works

Computers really only understand one language: machine code, a binary stream of 1s and 0s. You convert your C code into machine code with the aid of a compiler.

C is used where speed, space, and portability are important. Most operating systems are written in C. Most other computer languages are also written in C. And most game software is written in C.

There are three C standards that you may stumble across. ANSI C is from the late 1980s and is used for the oldest code. A lot of things were fixed up in the C99 standard from 1999. And some cool new language features were added in the current standard, C11, released in 2011. The differences between the different versions aren’t huge, and we’ll point them out along the way.

Try to guess what each of these code fragments does.(重复的我就省略了)

int card_count = 11;//Create an integer variable and set it to 11.(An integer is a whole number.)
if (card_count > 10)
    puts("The deck is hot. Increase bet.");
//Is the count more than 10?If so, display a message on the command prompt.

while (c > 0) {
puts("I must not write code in class");
c = c - 1;
}//As long as the value is positive……display a message……and decrease the count.

char ex[20];//Create an array of 20 characters.
puts("Enter boyfriend's name: ");//Display a message on the screen.
scanf("%19s", ex);//Store what the user enters into the array.
printf("Dear %s.\n\n\tYou're history.\n", ex);//Display a message including the text entered.

char suit = 'H';//Create a character variable; store the letter H.
switch(suit) {
//A switch statement checks a single variable for different values.
case 'C':
puts("Clubs");
break;
case 'D':
puts("Diamonds");
break;
case 'H':
puts("Hearts");
break;
default:
puts("Spades");
}

But what does a complete C program look like?

To create a full program, you need to enter your code into a C source file. C source files can be created by any text editor, and their filenames usually end with .c.

贴到这里我连原文也不想贴了,主要是此书句子通俗易懂,图片也多,真的难以取舍。反正我的初衷是强制自己认真一点,倒也是不违背初心。我就把这一章的目录贴上来吧:

C is a language for small, fast programs
But what does a complete C program look like?
But how do you run the program?
Two types of command
Here’s the code so far
Card counting? In C?
There’s more to booleans than equals…
What’s the code like now?
Pulling the ol’ switcheroo
Sometimes once is not enough…
Loops often follow the same structure…
You use break to break out…
Your C Toolbox

新的开始

侠客在几个月前因空间到期且因Aoyu懒得将备份上传到新服务器而被迫关闭。期间 Aoyu 经历了高考。高考毕竟算是我人生中一个重要的节点,在这个时候选择重新来过也是我很早就考虑好的,原因无他,只是因为我一直对我写过的文章不满意。

写博客是一个好习惯,可是我感受到了浓浓的苦涩。我从八年级开始写博客,在过去的一段时间里写博客已经成为了一个习惯,也许是我习惯了我这种随意的表达方式,当我老老实实写内容严谨结构清晰且限定了字数的文章时便感到手掌发软或者说是力不从心。从马伯庸的某本书里我看到了“意识流”这个名词,或许就是指我原来写博客的方式吧,在写文章时积极思考,不在乎文章结构,脑海中想到什么就即刻通过文字表现出来,随性而为。当我将其用于学校作文时被老师批评为“内容空洞”,我深以为然。当我终于下定决心给那个我颇有好感的女孩儿写些什么,我写出的东西却让我后悔了三年。回顾我写过的文章,我也挑不出什么毛病,毕竟技术类的文章占了相当一部分,只要把问题给解决了就好,没人会在乎文章结构是否严谨或者作者文采怎么样,不过当我回顾那些文章的时候,总是觉得缺少一种感觉,一种引以为傲的感觉。有许多次,遇到什么问题去求助搜索引擎,进入一个很陌生的网站却发现文章很熟悉,也想不起来是谁写的,仿佛在哪里见过一般,可是我明明没来过这个网站呀,看到文章内附的图片上的水印,竟表明这是我写的文章!可是我怎么一点印象都没有呢,再去仔细翻一翻自己的博客才敢确认这文章确实是我写的。大概这也说明我缺少一份归属感吧。我写博客的态度确实得改一改,写博客是一个好习惯,可是曾经,我在拿着笔写文章时,很急躁,有时候恨不得把笔摔一边,现在经过练习和克制,好多了,经过我的分析,这是敲键盘太快加上过分使用拼音输入法造成的恶果,千万引以为戒。这导致了我,不仅文章一塌糊涂(用笔写的作文,和用键盘写的区分开),而且虽说我深刻认识到了这个问题并且在以后写作文的时候努力克服“胡思乱想”的“坏习惯”,结果却并不让我满意,我的高考作文也受到了不小影响,毕竟,文章写得烂的话作者也是感觉的到的。

这两天本来准备是用 Github Pages 加上 Jekyll 或 Hexo 搭建新博客的,只是,这样做的话就没办法好好的写博客了(个人觉得),我依然认为 WordPress 是最好用的博客系统,但是这次我选择了 Typecho,使用时遇到什么不顺心的地方自己慢慢改就是了,我这样想着。WordPress 透出一股精致的美,Typecho 则表现出一种简洁之美,确实,两者都有缺点,可是为什么要把缺点提出来呢。

从初中就开始学C语言,一直不敢拿出去丢人现眼,喜欢的那个女孩儿说她自己做事三分钟热度,我又何尝不是。学好C语言可以做什么呢?简直太多了!我以前怎么没感觉到呢,直到我真的决定用C语言做些什么东西才感觉到。无论学什么技术,英语都是基础,我自信无论是考试分数还是发音都比同学强一些,可是这种比较带来的优越感毫无用处,我依然不能流畅地读完某程序的文档,依然有许多的单词不认识,更不用说流畅地用英语对话了。

我一直在反思,反思自己的过失,反思自己的懒惰,可是满腔的悔恨又怎能让逝去的时光倒流呢。高二的时候我给自己定了一个目标,如果英语分数能上130+的话就和上文提到的那个女孩表白(千万别让我爸妈看到啊),不得不提的是我高二时英语只有六七十分,作出这一目标也不容易的了,诚然到了后来英语一直保持在一百二十多分,可是一百二十多分和六十多分对我来说有什么区别呢,没有(好想流泪)。一直停在那,到后来就慢慢松懈了,我安慰自己说这是诅咒(We were cursed),高考前夕我把《神雕侠侣》(书)看了一遍,里面恰有我苦苦寻找的答案:缘是果,而非因(当然原文不是这样的),这个时候,深深的悔恨充斥心间,纵然有心学好英语,却已无力回天。我苦于不能给自己一个交代,虽然定下的目标并不常在脑海中闪现,却深深影响了我们两个的关系。我不知道我对她的感觉出了什么问题,总感觉在现实中看到她的话就有一种莫名的排斥感(没敢告诉她,相信她也感觉到了),可是这是为什么呢,我并没有把这一感觉和我给自己定的目标联想起来,直到高考前不久。我猛然醒悟,原来我潜意识中还依然对英语不能考到130耿耿于怀,恰好这时候我也正在反思“表白”本身:我为什么要表白呢?定下“学好英语去表白”这一目标,就和我当初学C语言一样,完全是没由来的决定。假如,我英语考到了130,我也去表白了,然后她也听到我对她表白了,然后呢,怎样,接下来怎么办?好像事情发展到这里就没办法继续发展下去了吧?“表白”和“让她做我女朋友”并不等价,站在她的角度想想她应该也不想做我女朋友的吧?其实这并不是“假如”,虽然我的英语分数从来没考到过130+,但是我却深深地体验了一把英语考到一百三十多分的感觉。那还是高二的时候,2015年高考刚刚落下帷幕,某个晚自习我和同学一起做当年的高考英语卷,放学回家后我从网上搜答案对照。那份试卷不算听力总分是150分,而我却当成了平常的120分,然后还和平时一样乘了一个1.25换算为150分,本来我只考了105分,被我错误的当成了130多分。当时我把分数算出来的时候自己很吃惊,怕我计算错还用电脑算了一遍(不用乘1.25就是实际分数),果然是一百三十多分,我可真高兴啊,高兴着高兴着就不高兴了,甚至还有一些恐惧和不安:我当真要表白吗?我自认为不是那种胆小怕事的人,但是,表白的后果是什么呢?按我上面的分析,表白是没后果的吧(这里是表白即结束的意思,别搞错了)...当时的我弄得自己半夜都没睡着,然后半夜突然惊醒,拿起试卷又算了一遍分,果然我只考了105分,这时虽然有点小小的失望,但比失望更多的是兴奋,而且是特别兴奋:因为我不用去表白了呀!我不知道看到这篇文章的你们是否真正体会我的心情,我是真的真的很喜欢她,但是就如我前面说的:表白有什么用呢。高考后翻QQ空间,看到一个人发的表白照片,夜里围了一圈蜡烛,买了一束花,那个女生也和那个男生拥抱了。我没感觉到浪漫,只觉得他们好蠢。等等,蠢的人是我吧?貌似,我还在这里理清各种概念的逻辑关系时,人家都抱得美人归了啊。

这篇文章写着写着又跑题了。三个月的假期,我决定把C语言认真学一遍,然后鼓捣一个飞行器玩玩儿(材料还没买)。我也会努力让我的文章更令人满意,特别是让我满意。或许我和她是真的被诅咒了,还是不要强求的好。