用matlab求应力Sigma

2011年11月10日 Peter@11:21 Filed under: 数字生活

工字钢沿Z轴向下,
Lz是nx1的Array
Mz是nx2的Vector, Mz(:,1)是x向, Mz(:,2)是y向:

    % Sigma of 9 points
    %     4 ___              ___ 3  
    %       \  \             \  \
    %        \  \8__________7_\  \ 
    %  Y+/____\_________9         \
    %    \     \   ______\_______  \
    %           \  \ 5    \     6\  \
    %            \__\      \      \__\
    %           1          _\/         2
    %                        X
    %
    % 9个点坐标
    Points = [...
             B,    H/2;
             B,   -H/2;
            -B,   -H/2;
            -B,    H/2;
             t/2,  h/2;
             t/2, -h/2;
            -t/2, -h/2;
            -t/2,  h/2;
             0,    0;        
          ]; 
    Sigma = ...
      repmat(Lz / area,1,9) ...
    + repmat(Mz(:,1),1,9) ...
        .* repmat(Points(:,2),1,length(Mz))' / obj.smaIx ...
    - repmat(Mz(:,2),1,9) ...
        .* repmat(Points(:,1),1,length(Mz))' / obj.smaIy;

下面附带是个实验:

         a =repmat([1:20]',1,9);
         b =repmat([1:9]',1,20);
         a .* b'

没有配置用户名的时候git报错信息

2011年10月25日 Peter@13:35 Filed under: 路已成歌
[master 1861d1a] SomeDocuments
 Committer: Neten <neten@HP.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
 
    git config --global user.name "Your Name"
    git config --global user.email you@example.com
 
After doing this, you may fix the identity used for this commit with:
 
    git commit --amend --reset-author
 
 1580 files changed, 205989 insertions(+), 0 deletions(-)

SparkleShare

2011年10月23日 Peter@16:04 Filed under: 路已成歌
lsb_release -sc
lucid
 
git --version
git version 1.7.7

我想安装SparkleShare:

mkdir -p ~/.ssh
sudo add-apt-repository ppa:warp10/sparkleshare
sudo apt-get update
sudo apt-get install sparkleshare libwebkit1.1-cil

杯具了:

正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
git-core 已经是最新的版本了。
有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:
 
下列软件包有未满足的依赖关系:
  sparkleshare: 依赖: git (>= 1.7.1) 但无法安装它
E: 破损的软件包

OK, 升级Git

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git-core

On the server

$ git init --bare /home/neten/MyBackup.git

On the client(s)
1, 再装一次:

sudo apt-get install sparkleshare libwebkit1.1-cil
cd /home/neten

2, Install the SSH client:

$ sudo apt-get install openssh-client

3, Generate an RSA key pair used to authenticate with the server (instead of using a password):

$ ssh-keygen

(accept defaults and leave password blank here)

4, Send your RSA key to your server*(neten is my Username):

$ ssh-copy-id neten@192.168.1.2

5, Now you can

$ sparkleshare start

and a Dialog box should appear.

6, Enter your name and e-mail, click next.

7, Tick “On my own server:” and enter neten@192.168.1.2 in the box there.

8, In the “Folder Name” field, enter the full server side path to the git repo you created on your server (maybe something like /home/neten/MyBackup.git

9, click Sync

问题:

W: GPG 错误:http://ppa.launchpad.net lucid Release: 由于没有公钥,无法验证下列签名: NO_PUBKEY 423A2125D782A00F

解决方案:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 423A2125D782A00F

搜索引擎里面无效的方案:

gpg --keyserver subkeys.pgp.net --recv 423A2125D782A00F

UTF-8特殊符号

2011年10月19日 Peter@11:49 Filed under: 路已成歌

㏠ ㏡ ㏢ ㏣ ㏤ ㏥ ㏦ ㏧ ㏨ ㏩ ㏪ ㏫ ㏬ ㏭ ㏮ ㏯ ㏰ ㏱ ㏲ ㏳ ㏴ ㏵ ㏶ ㏷ ㏸ ㏹ ㏺ ㏻ ㏼ ㏽ ㏾㍘ ㍙ ㍚ ㍛ ㍜ ㍝ ㍞ ㍟ ㍠ ㍡ ㍢ ㍣ ㍤ ㍥ ㍦ ㍧ ㍨ ㍩ ㍪ ㍫ ㍬ ㍭ ㍮ ㍯ ㍰㋀ ㋁ ㋂ ㋃ ㋄ ㋅ ㋆ ㋇ ㋈ ㋉ ㋊ ㋋㉿ ㊀ ㊁ ㊂ ㊃ ㊄ ㊅ ㊆ ㊇ ㊈ ㊉ ㊊ ㊋ ㊌ ㊍ ㊎ ㊏ ㊐ ㊑ ㊒ ㊓ ㊔ ㊕ ㊖ ㊗ ㊘ ㊙ ㊚ ㊛ ㊜ ㊝ ㊞ ㊟ ㊠ ㊡ ㊢ ㊣ ㊤ ㊥ ㊦ ㊧ ㊨ ㊩ ㊪ ㊫ ㊬ ㊭ ㊮ ㊯ ㊰㈠ ㈡ ㈢ ㈣ ㈤ ㈥ ㈦ ㈧ ㈨ ㈩ ㈪ ㈫ ㈬ ㈭ ㈮ ㈯ ㈰ ㈱ ㈲ ㈳ ㈴ ㈵ ㈶ ㈷ ㈸ ㈹ ㈺ ㈻ ㈼ ㈽ ㈾ ㈿ ㉀ ㉁ ㉂ ㉃㆒ ㆓ ㆔ ㆕ ㆖ ㆗ ㆘ ㆙ ㆚ ㆛ ㆜ ㆝ ㆞ ㆟ ✀ ✁ ✂ ✃ ✄ ✅ ✆ ✇ ✈ ✉ ✊ ✋ ✌ ✍ ✎ ✏ ✐ ✑ ✒ ✓ ✔ ✕ ✖ ✗ ✘ ✙ ✚ ✛ ✜ ✝ ✞ ✟ ✠ ✡ ✢ ✣ ✤ ✥ ✦ ✧ ✨ ✩ ✪ ✫ ✬ ✭ ✮ ✯ ✰ ✱ ✲ ✳ ✴ ✵ ✶ ✷ ✸ ✹ ✺ ✻ ✼ ✽ ✾ ✿ ❀ ❁ ❂ ❃ ❄ ❅ ❆ ❇ ❈ ❉ ❊ ❋ ❌ ❍ ❎ ❏ ❐ ❑ ❒ ❓ ❔ ❕ ❖ ❗ ❘ ❙ ❚ ❛ ❜ ❝ ❞ ❟ ❠ ❡ ❢ ❣ ❤ ❥ ❦ ❧ ❨ ❩ ❪ ❫ ❬ ❭ ❮ ❯ ❰ ❱ ❲ ❳ ❴ ❵ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿ ➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉ ➊ ➋ ➌ ➍ ➎ ➏ ➐ ➑ ➒ ➓ ➔ ➕ ➖ ➗ ➘ ➙ ➚ ➛ ➜ ➝ ➞ ➟ ➠ ➡ ➢ ➣ ➤ ➥ ➦ ➧ ➨ ➩ ➪ ➫ ➬ ➭ ➮ ➯ ➰ ➱ ➲ ➳ ➴ ➵ ➶ ➷ ➸ ➹ ➺ ➻ ➼ ➽ ➾ ➿ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳ ⑴ ⑵ ⑶ ⑷ ⑸ ⑹ ⑺ ⑻ ⑼ ⑽ ⑾ ⑿ ⒀ ⒁ ⒂ ⒃ ⒄ ⒅ ⒆ ⒇ ⒈ ⒉ ⒊ ⒋ ⒌ ⒍ ⒎ ⒏ ⒐ ⒑ ⒒ ⒓ ⒔ ⒕ ⒖ ⒗ ⒘ ⒙ ⒚ ⒛ ⒜ ⒝ ⒞ ⒟ ⒠ ⒡ ⒢ ⒣ ⒤ ⒥ ⒦ ⒧ ⒨ ⒩ ⒪ ⒫ ⒬ ⒭ ⒮ ⒯ ⒰ ⒱ ⒲ ⒳ ⒴ ⒵ Ⓐ Ⓑ Ⓒ Ⓓ Ⓔ Ⓕ Ⓖ Ⓗ Ⓘ Ⓙ Ⓚ Ⓛ Ⓜ Ⓝ Ⓞ Ⓟ Ⓠ Ⓡ Ⓢ Ⓣ Ⓤ Ⓥ Ⓦ Ⓧ Ⓨ Ⓩ ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ ⓜ ⓝ ⓞ ⓟ ⓠ ⓡ ⓢ ⓣ ⓤ ⓥ ⓦ ⓧ ⓨ ⓩ ⓪ ⓫ ⓬ ⓭ ⓮ ⓯ ⓰ ⓱ ⓲ ⓳ ⓴ ⓵ ⓶ ⓷ ⓸ ⓹ ⓺ ⓻ ⓼ ⓽ ⓾ ⓿ ─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏ ┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟ ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯ ┰ ┱ ┲ ┳ ┴ ┵ ┶ ┷ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿ ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋ ╌ ╍ ╎ ╏ ═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟ ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯ ╰ ╱ ╲ ╳ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿ ▀ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▉ ▊ ▋ ▌ ▍ ▎ ▏ ▐ ░ ▒ ▓ ▔ ▕ ▖ ▗ ▘ ▙ ▚ ▛ ▜ ▝ ▞ ▟ ■ □ ▢ ▣ ▤ ▥ ▦ ▧ ▨ ▩ ▪ ▫ ▬ ▭ ▮ ▯ ▰ ▱ ▲ △ ▴ ▵ ▶ ▷ ▸ ▹ ► ▻ ▼ ▽ ▾ ▿ ◀ ◁ ◂ ◃ ◄ ◅ ◆ ◇ ◈ ◉ ◊ ○ ◌ ◍ ◎ ● ◐ ◑ ◒ ◓ ◔ ◕ ◖ ◗ ◘ ◙ ◚ ◛ ◜ ◝ ◞ ◟ ◠ ◡ ◢ ◣ ◤ ◥ ◦ ◧ ◨ ◩ ◪ ◫ ◬ ◭ ◮ ◯ ◰ ◱ ◲ ◳ ◴ ◵ ◶ ◷ ◸ ◹ ◺ ◻ ◼ ◽ ◾ ◿ ☀ ☁ ☂ ☃ ☄ ★ ☆ ☇ ☈ ☉ ☊ ☋ ☌ ☍ ☎ ☏ ☐ ☑ ☒ ☓ ☔ ☕ ☖ ☗ ☘ ☙ ☚ ☛ ☜ ☝ ☞ ☟ ☠ ☡ ☢ ☣ ☤ ☥ ☦ ☧ ☨ ☩ ☪ ☫ ☬ ☭ ☮ ☯ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ ☸ ☹ ☺ ☻ ☼ ☽ ☾ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇ ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ ♔ ♕ ♖ ♗ ♘ ♙ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♡ ♢ ♣ ♤ ♥ ♦ ♧ ♨ ♩ ⌠ ⌡ ⌢ ⌣⌆ ⌇ ⌈ ⌉ ⌊ ⌋ ∀ ∁ ∂ ∃ ∄ ∅ ∆ ∇ ∈ ∉ ∊ ∋ ∌ ∍ ∎ ∏ ∐ ∑ − ∓ ∔ ∕ ∖ ∗ ∘ ∙ √ ∛ ∜ ∝ ∞ ∟ ∠ ∡ ∢ ∣ ∤ ∥ ∦ ∧ ∨ ∩ ∪ ∫ ∬ ∭ ∮ ∯ ∰ ∱ ∲ ∳ ∴ ∵ ∶ ∷ ∸ ∹ ∺ ∻ ∼ ∽ ∾ ∿ ≀ ≁ ≂ ≃ ≄ ≅ ≆ ≇ ≈ ≉ ≊ ≋ ≌ ≍ ≎ ≏ ≐ ≑ ≒ ≓ ≔ ≕ ≖ ≗ ≘ ≙ ≚ ≛ ≜ ≝ ≞ ≟ ≠ ≡ ≢ ≣ ≤ ≥ ≦ ≧ ≨ ≩ ≪ ≫ ≬ ≭ ≮ ≯ ≰ ≱ ≲ ≳ ≴ ≵ ≶ ≷ ≸ ≹ ≺ ≻ ≼ ≽ ≾ ≿ ⊀ ⊁ ⊂ ⊃ ⊄ ⊅ ⊆ ⊇ ⊈ ⊉ ⊊ ⊋ ⊌ ⊍ ⊎ ⊏ ⊐ ⊑ ⊒ ⊓ ⊔ ⊕ ⊖ ⊗ ⊘ ⊙ ⊚ ⊛ ⊜ ⊝ ⊞ ⊟ ⊠ ⊡ ⊢ ⊣ ⊤ ⊥ ⊦ ⊧ ⊨ ⊩ ⊪ ⊫ ⊬ ⊭ ⊮ ⊯ ⊰ ⊱ ⊲ ⊳ ⊴ ⊵ ⊶ ⊷ ⊸ ⊹ ⊺ ⊻ ⊼ ⊽ ⊾ ⊿ ⋀ ⋁ ⋂ ⋃ ⋄ ⋅ ⋆ ⋇ ⋈ ⋉ ⋊ ⋋ ⋌ ⋍ ⋎ ⋏ ⋐ ⋑ ⋒ ⋓ ⋔ ⋕ ⋖ ⋗ ⋘ ⋙ ⋚ ⋛ ⋜ ⋝ ⋞ ⋟ ⋠ ⋡ ⋢ ⋣ ⋤ ⋥ ⋦ ⋧ ⋨ ⋩ ⋪ ⋫ ⋬ ⋭ ⋮ ⋯ ⋰ ⋱ ← ↑ → ↓ ↔ ↕ ↖ ↗ ↘ ↙ ↚ ↛ ↜ ↝ ↞ ↟ ↠ ↡ ↢ ↣ ↤ ↥ ↦ ↧ ↨ ↩ ↪ ↫ ↬ ↭ ↮ ↯ ↰ ↱ ↲ ↳ ↴ ↵ ↶ ↷ ↸ ↹ ↺ ↻ ↼ ↽ ↾ ↿ ⇀ ⇁ ⇂ ⇃ ⇄ ⇅ ⇆ ⇇ ⇈ ⇉ ⇊ ⇋ ⇌ ⇍ ⇎ ⇏ ⇐ ⇑ ⇒ ⇓ ⇔ ⇕ ⇖ ⇗ ⇘ ⇙ ⇚ ⇛ ⇜ ⇝ ⇞ ⇟ ⇠ ⇡ ⇢ ⇣ ⇤ ⇥ ⇦ ⇧ ⇨ ⇩ ⇪⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ ⅟ Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ Ⅼ Ⅽ Ⅾ Ⅿ ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ ⅺ ⅻ ⅼ ⅽ ⅾ ⅿ ↀ ↁ ↂ℀ ℁ ℂ ℃ ℄ ℅ ℆ ℇ ℈ ℉ ℊ ℋ ℌ ℍ ℎ ℏ ℐ ℑ ℒ ℓ ℔ ℕ № ℗ ℘ ℙ ℚ ℛ ℜ ℝ ℞ ℟ ℠ ℡ ™ ℣ ℤ ℥ Ω ℧ ℨ ℩ K Å ℬ ℭ ℮ ℯ ℰ ℱ Ⅎ ℳ ℴ ℵ ℶ ℷ ℸ ₠ ₡ ₢ ₣ ₤ ₥ ₦ ₧ ₨ ₩ ₪ ₫ € ₭ ₮ ₯ ⁺ ⁻ ⁼ ⁽ ⁾ ⁿ ₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₊ ₋ ₌ ₍ ₎‐ ‑ ‒ – — ― ‖ ‗ ‘ ’ ‚ ‛ “ ” „ ‟ † ‡ • ‣ ․ ‥ … ‧ 
 
 ‪ ‫ ‬ ‭ ‮   ‰ ‱ ′ ″ ‴ ‵ ‶ ‷ ‸ ‹ › ※ ‼ ‽ ‾ ‿ ⁀ ⁁ ⁂ ⁃ ⁄ ⁅ ⁆                           ! ” # $ % & ‘ ( ) * + , – . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Â Ž Â Â ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿

Matlab & Magic

2011年10月17日 Peter@12:13 Filed under: 数字生活

这次不想说magic(3),

magic(3)
ans =
     8     1     6
     3     5     7
     4     9     2

外国佬是玩倒立, 还是中国的九宫决看着舒服:
二四为肩,六八为足,左三右七,戴九履一,五居中央.

我想说的是Matlab的Matrix就像Magic:

>> a = [1:3]'
a =
     1
     2
     3
>> b = a(:,ones(1,4),ones(1,1,5))
b(:,:,1) =
     1     1     1     1
     2     2     2     2
     3     3     3     3
b(:,:,2) =
     1     1     1     1
     2     2     2     2
     3     3     3     3
b(:,:,3) =
     1     1     1     1
     2     2     2     2
     3     3     3     3
b(:,:,4) =
     1     1     1     1
     2     2     2     2
     3     3     3     3
b(:,:,5) =
     1     1     1     1
     2     2     2     2
     3     3     3     3
>> c = permute(b, [2,3,1])
c(:,:,1) =
     1     1     1     1     1
     1     1     1     1     1
     1     1     1     1     1
     1     1     1     1     1
c(:,:,2) =
     2     2     2     2     2
     2     2     2     2     2
     2     2     2     2     2
     2     2     2     2     2
c(:,:,3) =
     3     3     3     3     3
     3     3     3     3     3
     3     3     3     3     3
     3     3     3     3     3

Ubuntu升级到11.10

Peter@10:09 Filed under: 数字生活

升级有几天了, 我的HP G72有些症状还不对劲, 不折腾了, 等12.04吧. 我的台式机还是10.04, 稳定第一.

刚开始 Nautilus 不稳定, 有时双击打开某个文件夹时, 比如 /usr/share, Nautilus就华丽地消失了. 后来在国外论坛的某个帖子回复中得知, 删除 nautilus-open-terminal 后nautilus就会恢复正常. 看来装 nautilus-open-terminal 的人不是很多, 不然论坛上到处会有报怨声的.

屏幕亮度的问题依然没解决, 每次开机, 屏幕亮度都是最低, 调整后, 系统不能保存. 网上那些改配置文件的方法全部失效, 因为笔记本一般都Suspend, 还好唤醒后亮度不变.

状态栏多了个电池图标的问题比较普遍, 虽然网上没有好的解决方案, 不过不碍事.

其它小事记一下:

1, 安装“受限扩展包”and other tools

sudo apt-get install ubuntu-restricted-extras
sudo apt-get install mplayer mplayer-fonts
sudo apt-get install compizconfig-settings-manager
sudo apt-get install dconf-tools
sudo apt-get install gnome-tweak-tool
sudo apt-get install indicator-weather
sudo apt-get install chromium-browser
sudo apt-get install gnome-do
sudo apt-get install xfonts-wqy
sudo apt-get install poppler-data
sudo apt-get install acroread

2, 因为HP G72的 Touchpad 弱爆了, 装个小东西禁用之:
Touchpad Indicator

sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install touchpad-indicator

是不是担心没Touchpad也没鼠标怎么用电脑? 简单, 用F10就可以激活Panel菜单.

3, 现在大家都宽屏了, 那个overlay-scrollbar实在没省多少地方, 删了吧:

sudo apt-get remove overlay-scrollbar liboverlay-scrollbar3-0.2-0 liboverlay-scrollbar-0.2-0

4, 寿司预览很方便, 点中文件按空格就可以预览, 再按一下就消失了:

sudo apt-get install gnome-sushi

5,

sudo nautilus

是不是不好用了, 换下面的吧:

gksu nautilus

右键安装”以管理员运行”的功能

sudo apt-get install nautilus-in-terminal nautilus-gksu

安装完毕之后执行

sudo cp /usr/lib/nautilus/extensions-2.0/libnautilus-gksu.so /usr/lib/nautilus/extensions-3.0/

注销, 重新登陆.

6, 在GNOME Shell下找不到关机选项? 按住ALT试试.

7, 看不惯全局菜单?

sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt

重启后生效, 后悔了就装上那些包.

8, LibreOffice的全局菜单:

sudo apt-get install lo-menubar

9, Fcitx

sudo apt-get install fcitx
sudo apt-get install fcitx-table-wbpy
 
vi ~/.profile
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
fcitx&

10, Skype

sudo apt-get install libxss1:i386 libqtcore4:i386 libqt4-dbus:i386 libasound2:i386 libxv1:i386 libsm6:i386 libxi6:i386 libXrender1:i386 libxrandr2:i386 libfreetype6:i386 libfontconfig1:i386

然后去软件中心安装

matlab通过index选元素生成新数组

2011年10月7日 Peter@09:38 Filed under: 数字生活

问题: 把A中的第一个和第三个元素选出来生成新数组B
方法一:

A = {'a','b','c'};
B = A([1,3])
B = 
    'a'    'c'

方法二:

A = {'a','b','c'};
C = logical([1,0,1]);
B = A(C)
B = 
    'a'    'c'

AcetoneISO 加载 ISO BIN NRG MDF IMG格式镜像

2011年09月14日 Peter@15:03 Filed under: 数字生活

AcetoneISO, is a feature-rich and complete software application to manage CD/DVD images. Thanks to powerful open source tools such as fuseiso, AcetoneISO will let You mount typical proprietary images formats of the Windows world such as ISO BIN NRG MDF IMG and do plenty of other things.

Ubuntu:

sudo apt-get install acetoneiso

Starting Mail Transport Agent (MTA) sendmail

2011年08月11日 Peter@09:53 Filed under: 网站工程

如果你那台安装了Sendmail的Ubuntu服务器在启动的时候卡在这行提示上很久:

Starting Mail Transport Agent (MTA) sendmail

那大概是因为你的/etc/hosts配置有问题.

1, 查看你的主机名, 发现我的机器叫 neten:
vi /etc/hostname

2, 然后把脉:
vi /var/log/mail.log

Aug 11 18:00:20 neten sm-msp-queue[1075]: My unqualified host name (neten) unknown; sleeping for retry
Aug 11 18:01:25 neten sm-msp-queue[1075]: unable to qualify my own domain name (neten) -- using short name

如果出现上面两句就可以对症下药了

3, 如果你的主机名为neten, 那把下面的代码覆盖写入/etc/hosts

127.0.0.1	localhost.localdomain	localhost
127.0.1.1	neten.localdomain neten
 
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

解决方法就是这么简单, 重启看看是不是快了很多?
参看: zyxware