Benx Shen's Library tagged → View Popular
Linux basics - Linux file system structure overview | Linux basic configurations
-

-
- / - root of all directories in Linux file system structure.
- /home - Keeps Linux user account's home directory.
- /etc - keeps Linux server's configuration files and directories.
- /usr - keeps Linux system files.
- /var - keeps system log files.
- /bin - keeps binary files for user applications.
- /sbin - keeps static binary files for system programs.

Some file system structure and directories in one Linux distribution maybe different from other Linux distributions as you can see from Slackware and Ubuntu example above. Right now you don't have to remember all of these directories and what they do. Just remember a few important directories first such as:
Ubuntu中文论坛 • 查看主题 - Ubuntu里尝试KDE4
-
处理混乱的菜单
一个系统内同时安装GNOME2和KDE4出现最大的问题就是菜单里程序的混乱。
安装Gnome Menu Extended <!-- m -->http://gtk-apps.org/content/show.php?ac ... tent=73515<!-- m -->
<!-- m -->http://www.kde-apps.org/content/show.ph ... c37faf0c91<!-- m -->
在gnome2下,把所有kde程序单独放到kde分类,在kde4下,把所有gnome程序放到gnome分类。
Richard Stallman和自由软件运动_互动百科
-
上帝说:“创造Richard Stallman吧!”
-
对称版权(copyleft)就是要赋予每个人平等的版权权力,但这不意味着大家的知识也会对称。即:对称版权不能推导出对称知识。这不是谁刻意造成的,这是自然规律。知识必须是公开的,自由的,不能有专利的,但这并不意味着会消除知识壁垒。道理是显然的,要攻克知识壁垒,需要付出稀缺的时间成本,有的时候,付出再多的时间成本也解决不了问题。比如,爱因斯坦的相对论都是公开的,可是地球上没有几个人能够理解,这就是知识壁垒,但是我们每个人都有权力去阅读相对论、去理解相对论。这就是对称版权(copyleft)主张的理念。
- 4 more annotations...
Ruby Programming/Classes and objects - Wikibooks, collection of open-content textbooks
-
class Strawberry
def Strawberry.color
return "red"
enddef self.size
return "kinda small"
endclass << self
def shape
return "strawberry-ish"
end
end
end
Strawberry.color # -> "red"
Strawberry.size # -> "kinda small"
Strawberry.shape # -> "strawberry-ish"Note the three different constructions: ClassName.method_name and self.method_name are essentially the same - outside of a method definition in a class block, self refers to the class itself. The latter is preferred, as it makes changing the name of the class much easier. The last construction, class << self, puts us in the context of the class's "meta-class" (sometimes called the "eigenclass")
Ruby Programming/Data types - Wikibooks, collection of open-content textbooks
-
h = {"hash?" => "yep, it's a hash!", "the answer to everything" => 42, :linux => "fun for coders."}
puts "Stringy string McString!".class
puts 1.class
puts nil.class
puts h.class
puts :symbol.classSee? Everything is an object.
-
If I kept doing this, array2 wouldn't hold any elements. I can check for this condition by calling the empty? method. For example, the following bit of code moves all the elements from one array to another:
array1 << array2.pop until array2.empty?
- 1 more annotations...
Ruby Programming/Ruby basics - Wikibooks, collection of open-content textbooks
-
The function also returns a single value with the return keyword. Technically this isn't necessary -- the value of the last line executed in the function is used as the return value -- but more often than not using return explicitly makes things clearer.
-
Functions interact with blocks through the yield. Every time the function invokes yield control passes to the block. It only comes back to the function when the block finishes. Here's a simple example:
# Script block2.rb
def simpleFunction
yield
yield
end
simpleFunction { puts "Hello!" }$ block2.rb
Hello!
Hello! - 1 more annotations...
Ruby Programming/Introduction to objects - Wikibooks, collection of open-content textbooks
-
In Ruby, methods that end with an exclamation mark (also called a "bang") modify the object. For example, the method
upcase!changes the letters of a String to uppercase.>> comedian.upcase!
=> "STEPHEN COLBERT"Since both of the variables
comedianandfavorite_comedianpoint to the same String object, we can see the new, uppercase text using either variable.>> comedian
=> "STEPHEN COLBERT"
>> favorite_comedian
=> "STEPHEN COLBERT"
Ruby Programming/Alternate quotes - Wikibooks, collection of open-content textbooks
-
in Ruby, there's a better way. You can use the
%qoperator to apply single-quoting rules, but choose your own delimiter to mark the beginning and end of the string literal.puts %q!c:\napolean's documents\tomorrow's bus schedule.txt!
puts %q/c:\napolean's documents\tomorrow's bus schedule.txt/
puts %q^c:\napolean's documents\tomorrow's bus schedule.txt^
puts %q(c:\napolean's documents\tomorrow's bus schedule.txt)
puts %q{c:\napolean's documents\tomorrow's bus schedule.txt}
puts %q<c:\napolean's documents\tomorrow's bus schedule.txt> -
puts %Q!Say "Hello," #{name}.!
puts %Q/What is "4 plus 5"? Answer: #{4+5}/
Ruby Programming/Hello world - Wikibooks, collection of open-content textbooks
-
The shebang line is read by the shell to determine what program to use to run the script. This line cannot be preceded by any blank lines or any leading spaces. The new
hello-world.rbprogram – with the shebang line – looks like this:#!/usr/bin/ruby
puts 'Hello world'
.NET Code Camp 2006 - 10 Things - #5: Don't Worry About Interfaces
-
- If it walks like a duck,
- And talks like a duck,
- Then we can treat it like a duck.
- (who cares what it really is)
- Then we can treat it like a duck.
Ruby Uses Duck Typing
- If it walks like a duck,
Functional Programming HOWTO — Python v3.1.1 documentation
-
Generators are a special class of functions that simplify the task of writing
iterators. Regular functions compute a value and return it, but generators
return an iterator that returns a stream of values. -
When you call a generator function, it doesn’t return a single value; instead it
returns a generator object that supports the iterator protocol. On executing
the yield expression, the generator outputs the value of i, similar to a
return statement. The big difference between yield and a return
statement is that on reaching a yield the generator’s state of execution is
suspended and local variables are preserved. On the next call to the
generator’s .__next__() method, the function will resume executing. - 4 more annotations...
8.3. collections — Container datatypes
-
8.3. collections — Container datatypes
-
8.3.4. defaultdict objects
- 2 more annotations...
5. Built-in Types
-
5.6.2. Old String Formatting Operations
-
The objects returned by dict.keys(), dict.values() and
dict.items() are view objects. They provide a dynamic view on the
dictionary’s entries, which means that when the dictionary changes, the view
reflects these changes.
1. The way of the program — How to Think Like a Computer Scientist: Learning with Python v2nd Edition documentation
-
A program is a sequence of instructions that specifies how to perform a
computation.
Selected Tags
Sponsored Links
Top Contributors
Groups interested in no_tag
-
Web 2.0 Tools
Items: 10 | Visits: 886
Created by: Claire Miller
-
Erotica
Items: 40 | Visits: 3362
Created by: Ainis
-
Digital Citizenship/Cyberbullying Video Clips
Items: 27 | Visits: 2033
Created by: Anne Bubnic
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo
