大人買ã
ä»æ¥ã¯æ¥ä¸ã¯ã»ã¨ãã©å¯ã¦ããã
æ¥ãå¾ãã¦ãããã¤ã¯ã§ããã æ¸åºã¸ã
ããããæ¬ãè²·ã£ã¦ãã¾ããã
ç©èªã«ãªããªãããã«ããã°ã
ããã¦ã³ã³ãã¥ã¼ã¿é¢ä¿ã®æ¸ç±ã«ã¤ãã¦ã¯ãå¿
ãã¢ã¦ãããããããã¨ããèªãã«èª²ãã
ããããããã¾ããã¨Perl! Vol.1ããç¡ãã£ã・・・ããå士ã®ç°å¸¸ãªå¥åº·ãã・・・ã
- ä½è : WEB+DB PRESSç·¨éé¨
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2006/08/24
- ã¡ãã£ã¢: 大åæ¬
id:kopugããã¯æ¢ã«èªç ´ã¨ã®ãã¨ã
èªãã§ã¿ã¦è§£ããªããã¨ã¯ã©ãã©ãè¨ããã¨ã«ãããããããããã
Perlãã¹ããã©ã¯ãã£ã¹
- ä½è : Damian Conway, ã¯ã¤ã¼ã
- åºç社/ã¡ã¼ã«ã¼: ãªã©ã¤ãªã¼ã»ã¸ã£ãã³
- çºå£²æ¥: 2006/08/24
- ã¡ãã£ã¢: 大åæ¬
Perl::Criticをちょっとだけ - ほぼ30歳からはじめるWEBプログラム
ã§ã触ãããã®ã®é¦è¨³çã
ãã£ã±ãè±èªçãããé ã«å
¥ã£ã¦ãã¾ãããå½ããåã ãã
ã¡ãã£ã¨ããè¨è¿°æ³ãããã¸ãã¹ãã¸ãã¯ä»¥å¤ã®ãã¨ã«æéã¨è³ã浪費ããããªã¤ãã¤é°å²æ°ã«ãªã£ãã¨ãã«ã¯å©ç¨ãããããããããã
æ¥çµã½ããã¦ã¨ã¢ 2006å¹´ 10æå· [éèª]
- åºç社/ã¡ã¼ã«ã¼: æ¥çµBPåºçã»ã³ã¿ã¼
- çºå£²æ¥: 2006/08/24
- ã¡ãã£ã¢: éèª
ãJavaã®10åã®çç£æ§ãä½æãããã¨ããRubyç¹éã®è§¦ãè¾¼ã¿ã«æããæã«ãã¦ãã¾ã£ãã
Rubyãå°ãè¦ãããããããããã
Software Design (ã½ããã¦ã¨ã¢ ãã¶ã¤ã³) 2006å¹´ 09æå· [éèª]
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2006/08/18
- ã¡ãã£ã¢: éèª
ãLAMPã·ã¹ãã åå¼·åè¨ç»ããCentOSå¾¹åºæ´»ç¨ããªã©ã
å¼±ãã¨ãããå¼·åãããã
ç ã£ã¡ãã£ã¦ãFedoraå
¥ãã®ãµã¼ããã·ã³ãCentOSã§å¾©æ´»ããããããããããã
- ä½è : Software Designç·¨éé¨
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2006/07/07
- ã¡ãã£ã¢: 大åæ¬
ä¹
ãã¶ãã«ã©ã£ã·ãæ¬å±ã«é·å±
ãã¦ã
ã¤ãã¥ãæããã®ã¯ããããã©ã¤ãã¦ã§ã¤ãè¨èªãç¹éããéèªã®å¤ãã
æ¨ä»ã¯Ruby On Railsã®ç»å ´ã«ããRubyãåãã¨ããã©ã¤ãã¦ã§ã¤ãè¨èªãéçãã¦ãã¦ããã®ã ãªãã¨ã
ãã£ããæ¥åã§Perlãå©ç¨ãã¦ãã身ã¨ãã¦ã¯ããã®æãéãããå¸åã§ãããã®ã¯ã©ãã©ãå¸åãããããããããã
以ä¸ã¯è¶£å³æ¬ã
ã¯ã¯ã¤ã¨ããã«ã¼ã ã«ãããã
- ä½è : æ¾å°¾ã¹ãºã
- åºç社/ã¡ã¼ã«ã¼: æèæ¥ç§
- çºå£²æ¥: 2005/12
- ã¡ãã£ã¢: åè¡æ¬
è¥å·è³åè£ã«ããªã£ãæ¬ä½ã
æ¾å°¾ã¹ãºãã®å°èª¬ã¯ãå®æãå¾ãã以æ¥ãã
ç²¾ç¥ç
é¢ã®ééç
æ£ã¨ããæ¾å°¾ã¹ãºãã®å¾æãããªãã£ã¼ã«ããèå°ã
楽ãã¿ã§ãã
ã¯ã¤ãã¯ã¸ã£ãã³ (Vol.67)
- åºç社/ã¡ã¼ã«ã¼: 太ç°åºç
- çºå£²æ¥: 2006/08/10
- ã¡ãã£ã¢: åè¡æ¬
ã¯ã¤ãã¯ã¸ã£ãã³è²·ããªãã¦ä½å¹´ã¶ãã ã・・・ã
森éä¹ã責任編éããæ¿æ²»ç¹éã«èå³ãæã£ã¦ã
森éä¹ã®ãAãããA2ããæ±ã£ã¦ãã¬ã³ã¿ã«å±ããããã£ããæãã¦ãã ããï¼
ã¯ã¤ãã¯ã¸ã£ãã³ (Vol.66)
- åºç社/ã¡ã¼ã«ã¼: 太ç°åºç
- çºå£²æ¥: 2006/06/10
- ã¡ãã£ã¢: åè¡æ¬
大好ããªããã¿ã´ã©ã¹ã¤ããããåãã¨ããNHKæè²ã®ç¹éãçäºåº·éã¨èå°æåã®å¯¾è«ãèªã¿ããã¦ã
çäºä½åãã¾ãèªã¿ãããªããLAã¸ã®é£è¡æ©ã®ä¸ã§èªããããªï½¥ï½¥ï½¥ã
èå°æåãåå¤å±ãã«ã¼ãã¼ãã§DUBã!!
è¡ããã!
æ¼æ´©ã«ã¯æ°ãã¤ããï¼
Subversion ããã¡ã¤ã«ã®ããã¹ãããã¤ããªããå¤æããéã®ãã°(?)ã«ééã
æ¼æ´©ã«ã¯æ°ãã¤ããï¼
以ä¸ãè¨è¿°ããã ãã®ãã¡ã¤ã«ã仮㫠leak.txt ã¨ãã¦ä»»æãªãã¸ããªã®ã¯ã¼ãã³ã°ã³ãã¼é
ä¸ã«ä¿åã
該å½ãªãã¸ããªã«è¿½å ããã
$ svn add leak.txt A (bin) leak.txt
ã¡ãï½ï½ï½ãã¾ï½ï½ï½ï½
ãªãã§ãã¤ããªãªã®ï¼
æèãã¼ã¸ãå¯è½ãã©ããã決ããã®ã«ãSubversion 㯠svn:mime-typeå±æ§ã調ã¹ã¾ãããããã¡ã¤ã«ã svn:mime-typeå±æ§ãæããªãããããã¹ãã示ããããªå 容ã§ããã°(ãã¨ãã°ãtext/*)ãSubversion ã¯ãããããã¹ãã§ããã¨å¤æãã¾ãããã以å¤ã®å ´åããã¡ã¤ã«ã¯ãã¤ããªã§ããã¨ã¿ãªããã¾ããSubversion ã¯svn import ã¨svn add å®è¡æã«ããã¤ããªæ¤åºã¢ã«ã´ãªãºã ãå®è¡ãããã¨ã§ã¦ã¼ã¶ãå©ãã¾ãããããã®ã³ãã³ãã¯ãè¯ãæ¨æ¸¬ãè¡ãã(å¯è½ãªã)ãã¤ããªã®svn:mime-type å±æ§ã追å ããããã¡ã¤ã«ã«è¨å®ãã¾ãã(ãã Subversion ã®æ¨æ¸¬ãééã£ã¦ããå ´åã¯ãã¦ã¼ã¶ã¯ãã¤ã§ãæã§ãã®å±æ§ãåé¤ãããã¨ãã§ãã¾ã)
ä¸è¿°ã®å
容ããã
leak.txt ã®svn:mime-typeå±æ§ã調ã¹ã¦ã¿ãã
$ svn propget svn:mime-type leak.txt application/octet-stream
・・・ã¨ã«ãã Subversion ã leak.txt ããã¤ããªãã¼ã¿ã¨ãã¦ã¿ãªãã¦ãããã¨ã¯æç½ã
çç±ã¯ãããããããã®ã¾ã¾ã§ã¯æ°æã¡æªãã
ããã
ãªããã
ãã¤ãä¸ãå°å¦çã«
ããã®ãã髪åå¤ï¼ï¼ã
ã¨å¤§å£°ã§è¨ããã¦ããªãã
ç¬é¡ã§ãããã®é ã®èªåãããæ°æã¡æªãã
svn diffãåããªããã
ã§ã
ã²ã¨ã¾ã対å¦çæ³ã
ãSubversion ã«ãããã¼ã¸ã§ã³ç®¡ç::ãã¤ããªãã¡ã¤ã«ã¨å¤æãã®å
容ã«ããã¨ãã
ãã® svn:mime-type å±æ§ãæã§å¤ãã¦ããã¾ãããã
$ svn propset svn:mime-type text/plain leak.txt property 'svn:mime-type' set on 'leak.txt' $ svn propget svn:mime-type leak.txt text/plain
ããã§æ²åã® leak.txt ã®ããã¹ãåãé«ããã«å®£è¨ããã¾ããã
ãããã¯ã
$ svn propdel svn:mime-type leak.txt $ svn propget svn:mime-type leak.txt $
ãã㧠svn:mime-type å±æ§ãæ¶ãã¡ãã£ã¦ã svn diff ãåããã¨ãã§ããããã«ãªãã¾ãã
ã¡ãªã¿ã«ã
æ´©ã«
ã ã㧠Subversionããã¤ããªã¨å¤æãããã¨ãå¤æã
ãªããï¼
ãã®çç±ã¯ããªãã解ãæããã¦ãã ããï¼
htmlãã¡ã¤ã«ã«ãããã¤ã³ãã³ã
æ¥åã§ã¯å°ãLinuxä¸ã§vimã使ã£ã¦æ
£ãã¦ããããã
Windowsã§ãgvimãè½ã¨ãã¦ãã¦ä½¿ã£ã¦ãã¾ãã
ãã¾ã«ã
ã§ãWindowsä¸ã§ã³ã¼ãã£ã³ã°ã£ã¦ãã¾ãããªããã ãã©ã
gvimã¯htmlãã¡ã¤ã«ããã«ããã«ãããã¨ãã«ä½¿ããã¨ãä¸çªå¤ãã
ã§ããããªã¨ãã«ã
^^^^function hoge() {alert()}ãEnterã
ã¨ããã¨ï¼ã^^^^ãé¨åã¯åè§4æååã®ã¤ã³ãã³ãããEnterãã¯ããã§Enterãã¼ãæ¼ãããã¨ãæå³ãã¾ããï¼ã
function hoge() {alert()}
ã£ã¦ãåæã«ã¤ã³ãã³ããæ¶ãã¡ãã£ããã
^^^^^^^^function hoge() {alert()}
ã£ã¦ãåæã«ã¤ã³ãã³ããå¢ãã¡ãã£ããããã
èªåã§æå³çã«ã¤ã³ãã³ããã¦æ¸ãçµãã£ãè¡ããæ¹è¡ãããã¨ãããã³ã«ã³ã¼ããåãããã¦ã¹ãã¬ã¹ããã¾ã£ã¡ããã¾ãã
ã©ã¼ãã¦ããªã¼ãã¨ããããã¤ã³ãã³ãã®è¨å®å¤ãã¦ã¿ã¦ããåä½ã«å¤åãªãã
ã©ãããå¢æ¸ã¯åå¾ã®æèã«ãã£ã¦å¤ãã£ã¦ãã£ã½ãã
試ãã«Perlã®ã³ã¼ãæ¸ãã¦ã¿ãã¨ãã¹ãã¬ã¹ãªãï¼ã¤ã¾ãä¸è¨ã®åä½ã¯èµ·ããªãã
ã§ã
ãã©ãçããã®ãããã
C:\Program Files\vim\runtime\indent\html.vim
ã©ãããã.htmlãæ¡å¼µåã®ã¤ãã¦ããã¡ã¤ã«ã®ã¤ã³ãã³ãã®åä½ãè¨å®ãã¦ãããã¡ã¤ã«ãããã
ä¸ããã©ãã¨è¦ãã¨ããåå¾ã®htmlã®ã¿ã°ã®ãã¹ãã®é¢ä¿ãå²ãåºãã¦èªåçã«ã¤ã³ãã³ããã¦ãããããªããã¨çµè«ã
ãããªãã¡ã¤ã«ãåã®æã§ã¯ã¨ã¦ã触ããªãããä½ãæ¡å¼µåã«ãã£ã¦ã¤ã³ãã³ãå
·åãå¤ãã¦æ¬²ããã¨ãæããªãã£ãã®ã§ã
ã«ãªãã¼ã ã
ããããã¹ãã¬ã¹ãªãã®htmlããã³JavaScriptã³ã¼ãã£ã³ã°ãã§ããããã«ãªãããã§ãã
ã¾ãhtmlãã¡ã¤ã«ã®è©±ãªã®ã«ã³ã¼ããJavaScriptãªã®ã¯ãæå¬â
WEB+DB PRESS Vol.31
ã§Ajax&prototype.jsã®ç¹éè¨äºã¨ã®ãã¨ï¼
è²·ããªããã
ããããid:naoyaãããPerlã®é£è¼ããããã¨ãããã¨ãä¸çªç±ããã¥ã¼ã¹ã ï¼
å¾
ã¡é ããã
ã«ãã¦ãã
ãWEB+DB PRESSãã®è¡¨ç´ã¯ããµããªã£ãã¨æããã©ãã§ãããï¼
ã追è¨ã
è²·ã£ã¦æ¥ã¾ããã
id:naoyaããã®æç« ã¯ãã£ã±è§£ãããããªã¼ã
ãã ãtypoãå¤ãã£ãã
perlã ã¨ãé åãããã·ã¥ã®è¦ç´ ã®å¾ãã«ã«ã³ããä»ãã¦ãåé¡ãªãã®ã§ãããJavaScriptã ã¨ãããã§ã³ã±ãããã§ãã
ã¨ãªãJavaScriptã³ã¼ããå¤æ°ã
Perl::Criticãã¡ãã£ã¨ã ã
ã¾ã ã¾ã åå¿è
ãªåã¯ã³ã¼ãã£ã³ã°è¦ç´çãªãã¨ããã£ãããããã
ã®ã§ãã¯ã¦ãªæè¡çºè¡¨ä¼æ¥è¨ã§æè¦ãã¾ãããPerl::CriticãCPANããè½ã¨ãã¦ãã¦æ©é試ãã
ã¡ãã£ã¨ã ãã
ã¾ãã以ä¸ã®ã³ã¼ããtest.plã¨ãã¦ä½æã
#!/usr/bin/perl -w use strict; use lib qw(../myperl/lib); use Readonly; Readonly my $BIRTH_YEAR => 1975; Readonly my $BIRTH_MONTH => 10; MAIN : { &main; exit; } sub main { print $BIRTH_YEAR. "\n"; print $BIRTH_MONTH. "\n"; } __END__
å¼ãç¶ãã
以ä¸ã®ã³ã¼ããcritique.plã¨ãã¦ä½æ
#!/usr/bin/perl -w use strict; use lib qw(../myperl/lib); use Perl::Critic; MAIN : { &main; exit; } sub main { my $critic = Perl::Critic->new; my $source = './test.pl'; print $critic->critique($source); } __END__
ã§ãcritique.plãå®è¡ããã¨ã»ã»ã»
Code before warnings are enabled at line 7, column 1. See page 431 of PBP. Code not contained in explicit package at line 3, column 1. Violates encapsulation. No 'VERSION' variable found at line 0, column 0. See page 404 of PBP. Hard tabs used at line 7, column 24. See page 20 of PBP. Hard tabs used at line 8, column 25. See page 20 of PBP.
ã£ã¦ã
Perl::Criticã«ããã¨
ã£ã¦ãã¨ãªãã§ã
Most Policies are based on Damian Conway's book Perl Best Practices.
Perl Best Practices: Standards and Styles for Developing Maintainable Code
- ä½è : Damian Conway
- åºç社/ã¡ã¼ã«ã¼: O'Reilly Media
- çºå£²æ¥: 2005/07/22
- ã¡ãã£ã¢: ãã¼ãã¼ããã¯
- ã¯ãªãã¯: 65å
- ãã®ååãå«ãããã° (27件) ãè¦ã
ã¯ã©ã¹ã¡ã½ããã¨ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãã
- ã¯ã©ã¹ã¡ã½ããã¨ã¯ç¬¬ä¸å¼æ°ã«ã¯ã©ã¹åãã¨ãé¢æ°ã§ããã
- ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ããã¨ã¯ç¬¬ä¸å¼æ°ã«ã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ãã¨ãé¢æ°ã§ããã
ã£ã¡ã ããã¨ã§ã
ã¦ãªã¨ãã«ã¯ã
package Hoge;sub new {
my $class = shift;
my $self = {};
return bless $self,$class;
}sub name {
my $self = shift;
my $name = shift;
if(defined($name)){
$self->{"name"} = $name;
} else {
return $self->{"name"};
}
}sub say_hello {
print "Hello!!";
}1;
ã§ããã®ã§ããããï¼
use Hoge;# new()ã¯ã¯ã©ã¹ã¡ã½ãã
my $obj = Hoge->new();# name()ã¯ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ãã
my $name = $obj->name('summersoldier');# say_hello()ã¯ã¯ã©ã¹ã¡ã½ããç
Hoge->say_hello();
.cshrcã®ç·¨é
ããã³ãã表示ã
%ã ãã§å¯ããã
ã¿ã¼ããã«ã®å ¨ç»é¢è¡¨ç¤ºããã¨ããå ¥åãã¥ããã
ã¾ããlsããã¨ãã«ãã£ã¬ã¯ããªã¨ãã¡ã¤ã«ã®éãããããã¥ããã®ã§è²ã¥ãããããã
ãã£ã¦$HOME/.cshrcã以ä¸ã®ããã«ç·¨éã
# lsã®è²ä»ã表示
alias ls ls -G# ããã³ããã®è¡¨ç¤º
set prompt = '%n@%m:%~$ '
ç·¨éå 容ãé©ç¨ããã«ã¯
%source .cshrc
ããã§ããã³ããã¯
username@hostname:~$
ã¦ãªæãã«ãªãã¾ãããhttp://iris.homeunix.net/yayoi/freebsd.asp
ãã®è¾ºåèã«ãã¾ããã