今天一不小心在 /opt 文件夹下执行了 chmod -R 777 *
然后。。/opt下的所有软件都无法执行了
Google得知是权限的问题,文件夹默认权限755,文件默认权限664
于是编写以下脚本
#/bin/bash
#Auth: veryyoung
#Desc: chmod 目录权限为755,默认文件权限为644。
function my_chmod(){
for file2 in `ls -a $1`
do
if [ x"$file2" != x"." -a x"$file2" != x".." ];then
if [ -d "$1/$继续阅读 »
var
a: array [1..100, 1..100] of boolean;
depth: array [1..100] of longint;
father: array [1..100, 0..16] of longint;
n, m, i, x, y: longint;
root: longint;
procedure dfs(x: longint);
var
i: longint;
j: longint;
begin
depth[x] := depth[father[x][0]]+1;
j := 1;
while 1< 0 then
继续阅读 »
写在前面
废话不多说,请看下面3道题,把6个console.log()的答案写下来,然后对照着在Console控制台里敲一遍,校验一下结果。
more
代码片段
```
var A = function() {};
a.prototype = {
num : 1,
text : 'aaa'
};
var x = new A();
// 第一题
console.log(x.num);
console.log(x.text);
// --这里是分割线--
var y = new A();
A.prototype = {
num : 2
};
// 第二题
console.log(y.num);
c继续阅读 »
Installation
Download go
official & Getting Started
golang中国
Go Complier:
offcial: gc
GNU GC: gccgo
Go supports 3 instruction sets
amd64 (a.k.a. x86-64); 6g,6l(Plan9 gc),6c,6a // support x84-64, naming as amd64
is to amd's contribution of inventing 64bit instruction set
386 (a.k.a. x86 or x86-32); 8g,8l,8c(Plan9 gc)继续阅读 »