vSpace


  • Home

  • Archives

  • Search

Week Two Assignment

Posted on 2018-03-12 | In Assignment

第三章习题

3-1

将朋友姓名存储在列表中,依次将其打印

names = ['Yan Bin' 'Wang Yongfeng', 'Wu Ziyang']
for name in names:
    print(name)
Read more »

Week One Assignment

Posted on 2018-03-07 | In Assignment

浏览Python官网

Python官网整合了与Python有关的许多资源。其中包括源码、教程、文档、社区等,甚至还包括了成功案例和新闻时事。

Read more »

Latex Snippet

Posted on 2017-12-18 | In Latex

Math

Align

\begin{align}
  f(x) &= x^2\\
  g(x) &= \frac{1}{x}\\
  F(x) &= \int^a_b \frac{1}{3}x^3
\end{align}

Matrix

\left[
\begin{matrix}
1 & 0\\
0 & 1
\end{matrix}
\right]

Picture

Add Picture

``` latex \usepackage{graphicx}

Read more »

Prototype Chain in Javascript

Posted on 2017-12-03 | In language , detail ,

This article gives a thorough explanation on prototype chain. I assume the reader has a grasp of basic grammar in javascript and knowledge of object and function.
It’s good if you are familiar with an object-oriented language, but don’t be afraid if you don’t, as their techniques behind object are quite different.
Javascipt uses a techniques called prototype chainto implement inheritance. Before going into details, let’s review some basic points.

Read more »

Shell Basic

Posted on 2017-12-01 | In Linux

Define a Variable

To define a variable, simply use variable-name=value without and space.

$ a=5 # set a to 5
$ b = 5 # Opps, error
$ c=3+2 # Opps, does not work, 
        # which will be explained soon.

If you are interesting in the value stored in c in the third case above, you can try echo

$ echo $c
3+2

Strangely enough, it would output 3+2 instead of 5, far from our ideal behaviour.
The correct command to assign 5 to c would be discussed soon. As shown above, $ is uesd to refer to a variable.

$ echo a
a
$ echo $a
5
$ vim ${a}.cpp # equivelant to vim 5.cpp
               # {} can be ignored

Tree Kinds of Quote

Single Quote

A single quote will make anything inside it a plain text.

$ echo 'I am $USER, and today is `date`'
I am $USER, and today is `date`

Nothing will be translated.

Double Quote

Similar to single quote, double quote makes it a string. However, double quote allow $ to access to the variable and back quote to execute a command.

$ echo "I am $USER, and today is `date`"
I am yb, and today is 2017年 12月 01日 星期五 18:30:17 CST

Back Quote

Whatever inside the back quote(not a single quote!) would be treated as a command to run.

$ expr 4 + 2
6
$ a=`expr 4 + 2`
$ echo $a
6

run a shell

put your bar.sh to the path below
~/.local/bin and your script can be executed globally by current user.

Read more »

Hello Blog

Posted on 2017-11-30 | In other

Hello Blog

Hello blog.
Thanks to jekyll and github Page, as well as NexT which offers such an elegant template, I could build my blog in such a handy way.
vSpace means virtual space.

About Blog

I will be writing the blog in both Chinese or English, depending on my convenience. My notes, ideas, questions, or whatever I am currently doing would be post if it is worth a share.
Regular update is never guaranteed.

Blogs Organization

Blogs will be grouped by tags and category.
Tagindicates the language(s) the blog involvs, such as C, C++. A blog without tags is possible.
Categoryindicates the field it is mainly about, such as Operating System, Algorithm. Category is also optional.
Hopefully, it will save you (and I of course) a lot of time. Don’t forget to use the search function on the main menu (supported by NexT, thanks again). It is a poweful, quick and real-time search.

Read more »
1 2
Benson Yan

Benson Yan

Student in Sun Yat-sen University, China. Major in computer science.

16 posts
6 categories
3 tags
GitHub School She
© 2017 - 2020 Benson Yan
Powered by Jekyll
Theme - NexT.Muse