[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mgp-users-jp 00617] tips and questions



$BA0ED(B@$B%j%3!<$G$9!#(B

$B@h7n!"(Bjus$BJY6/2q$G(Bmagicpoint$B$r;H$C$F9V5A$7$^$7$?!#GrCO$K9u;z$GI=(B
$B<($7$?$H$3$m!"!V(Bmagicpoint$B$C$]$/$J$$$G$9$M(B :)$B!W$H$$$&I>2A$r$$$?(B
$B$@$$$F$^$9!#(B
	http://www.cc.rim.or.jp/~midorin/mad-p/perl/benkyou/199909/
$B$K(Bmgp -D$B$GJQ49$7$?7k2L$r8x3+$7$F$$$^$9!#(B

$B$5$F!"$$$/$D$+5$$E$$$?$3$H$H<ALd$,$"$j$^$9!#(B
  o ccolor$B$N;H$$J}$,(BSYNTAX$B$K$J$$(B($B$5$,$9$N$K6lO+$7$^$7$?(B :)

  o $B9TF,$KJ8;z$H$7$F(B%$B$d(B&$B$rF~$l$k$K$O$I$&$7$?$i$h$$$+(B
    
  o $B%$%s%G%s%HI}$r%-!<%W$7$?$^$^;XDj$N0LCV$G2~9T$9$k$K$O$I$&$7$?(B
    $B$i$h$$$+!#:#$O(B
    ============================================================
    %tab 3 size 4, vgap 20, prefix "         ", icon delta3 "black" 40
    %tab 4 size 4, vgap 20, prefix "         ", icon delta3 "white" 40
    ============================================================
    $B$H$$$&$h$&$K$7$F$$$^$9$,!"0u:~$9$k$H(Bdelta3$B$,=P$F$7$^$$$^$9!#(B

  o $B%$%s%G%s%HI}$r@dBPCM(B($B2hLLI}$KBP$9$k(B%)$B$G;XDj$7$?$$!#(Bprefix$B$G(B
    $B6uGr$rBG$D$H!"(Bfont$B$,(Btypewriter$B$+(Bstandard$B$+$K$h$C$FI}$,JQ$C$F(B
    $B$7$^$&!#(B

  o xfont$B$N%9%1!<%i%V%k%U%)%s%H$N;XDj$G!"(BLFD$B$r(Bsize$B0J30A4It;XDj$7$?$$!#(B
	xfont "-adobe-courier-bold-r-normal--0-0-0-0-m-0-iso8859-1"
    $B$H=q$/$H!"%5%$%:$,8GDj$K$J$C$F$7$^$&!#(B
    draw.c$B$G(B
	case XLFD_HYPHEN:
		sprintf(buf, seed, tmp2);
		break;
    $B$H$7$F$*$$$F(B
	xfont "-adobe-courier-bold-r-normal--%s-*-*-*-m-*-iso8859-1"
    $B$H$7$?$i$&$^$/$$$-$^$9$+$M$(!#(B

  o $B%F%-%9%H$N0lIt$K?'$r$D$1$?$j(Btypewriter$B$K$9$k$?$a!":#$O(B
    ============================================================
    %cont, font "typewriter"
    my %dog = (name 
    %cont, fore "red"
    =>
    %cont, fore "black"
     'marble',
    %font "standard"
    ============================================================
    $B$N$h$&$K=q$$$F$$$k$,!"B>$K$h$$J}K!$O$"$k$+!#:#$O(BPerl$B$G%W%j%W(B
    $B%m%;%C%5$rDL$7$FJQ49$7$F$$$^$9!#(B
    
  o -D HTML$B$G(Bgif$B$r@8@.$9$k$H$-!"(BX$B$,IA2h$r=*$o$i$J$$$&$A$K(B
    xwintoppm$B$,5/F0$5$l$F$7$^$$!";z$,7g$1$k!#(B
	$B@8$N(BX$B$H(Bxtt$BHG$N(Bxfs$B$r;H$C$F$$$^$9!#0J2<$N$h$&$K(Bmgp.c$B$K(B
	sleep$B$rF~$l$F$4$^$+$7$F$$$^$9!#(B
============================================================
--- mgp.c~	Wed Jul 28 12:44:52 1999
+++ mgp.c	Tue Oct  5 11:19:22 1999
@@ -454,7 +454,7 @@
 		fprintf(stderr, "generating page %d... ", page);
 		state_goto(&state, page, 0);
 		draw_page(&state, NULL);
-
+		sleep(2);
 		/*
 		 * dump out gif image
 		 */
============================================================

			$B!~(B  $B!~(B  $B!~(B

$B6/D4ItJ,$r5-=R$7$d$9$/$9$k$?$a!"0J2<$N$h$&$J%W%j%W%m%;%C%5$r:n$j(B
$B$^$7$?!#$3$&$$$&$N$O%f!<%6!<$N$_$J$5$s$=$l$>$l9)IW$7$F$$$k$N$G$7$g(B
$B$&$,!D!D(B
	$BItJ,E*$K6/D4!V(BE<>$B!W!"%?%$%W%i%$%?%U%)%s%H!V(BT<>$B!W(B
	$B0l9T$^$k$4$H%?%$%W%i%$%?(B($B9TF,$K!V(B|$B!W(B)
	$B%?%$%W%i%$%?9T$N7QB3(B($B9TF,$K!V(B|>$B!W(B)
$B$3$l$d$k$H!"(BE<%hash>$B$N$h$&$J5-=R$NJQ497k2L$,!V(B%hash$B!W$H$$$&(B
unknown directive$B$K$J$C$F$7$^$$$^$9(B(;_;)$B!#(BE< %hash>$B$H=q$$$F!"0O(B
$B$j$N9T$b(B1$BJ8;z$:$D$3$C$=$j;z2<$2$7$F$4$^$+$7$F$$$^$9!#(B

$B85$N%F%-%9%H(B
============================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%page

Perl5$B$N$A$g$C$H$7$?$3$H(B

	$B0zMQId(B
|		sE{[}fromE(]{)toE(})g
|			()$B!"(B[]$B!"(B{}$B!"(B<>
|		E{qw}($abc @def %ghi)
			T{('$abc', '@def', '%ghi')}$B$H$$$&%j%9%H(B
			T{split(' ', q($abc @def %ghi))}$B$HF1$8(B
	bareword$B$r=q$1$PJ8;zNs07$$$7$F$/$l$k(B
		T{=>}$B$N:8B&(B
|			my %dog = (name E{=>} 'marble',
|>			           age  E{=>} '10');
|			kill E{HUP =>} $pid;
		$B%O%C%7%eMWAG$N<0$,(Bbareword$B$R$H$D$@$1$N>l9g(B
|			$dog{E<name>}
		$BJ8;zNs$KBP$9$kC19`%^%$%J%9(B
			$B%*%W%7%g%s0z?tMQ$K$h$/;H$o$l$k(B
|			-name == -"name" == "E{-}name"
|			-"-name" == -"-name" == "E{+}name"

============================================================
$BJQ498e$N%F%-%9%H(B
============================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%page

Perl5$B$N$A$g$C$H$7$?$3$H(B

	$B0zMQId(B
		
%cont, font "typewriter"
s
%cont, fore "red"
[
%cont, fore "black"
from
%cont, fore "red"
]{
%cont, fore "black"
to
%cont, fore "red"
}
%cont, fore "black"
g
%font "standard"
			
%cont, font "typewriter"
()$B!"(B[]$B!"(B{}$B!"(B<>
%font "standard"
		
%cont, font "typewriter"

%cont, fore "red"
qw
%cont, fore "black"
($abc @def %ghi)
%font "standard"
			
%cont, font "typewriter"
('$abc', '@def', '%ghi')
%cont, font "standard"
$B$H$$$&%j%9%H(B
			
%cont, font "typewriter"
split(' ', q($abc @def %ghi))
%cont, font "standard"
$B$HF1$8(B
	bareword$B$r=q$1$PJ8;zNs07$$$7$F$/$l$k(B
		
%cont, font "typewriter"
=>
%cont, font "standard"
$B$N:8B&(B
			
%cont, font "typewriter"
my %dog = (name 
%cont, fore "red"
=>
%cont, fore "black"
 'marble',
%font "standard"
				
%cont, font "typewriter"
           age  
%cont, fore "red"
=>
%cont, fore "black"
 '10');
%font "standard"
			
%cont, font "typewriter"
kill 
%cont, fore "red"
HUP =>
%cont, fore "black"
 $pid;
%font "standard"
		$B%O%C%7%eMWAG$N<0$,(Bbareword$B$R$H$D$@$1$N>l9g(B
			
%cont, font "typewriter"
$dog{
%cont, fore "red"
name
%cont, fore "black"
}
%font "standard"
		$BJ8;zNs$KBP$9$kC19`%^%$%J%9(B
			$B%*%W%7%g%s0z?tMQ$K$h$/;H$o$l$k(B
			
%cont, font "typewriter"
-name == -"name" == "
%cont, fore "red"
-
%cont, fore "black"
name"
%font "standard"
			
%cont, font "typewriter"
-"-name" == -"-name" == "
%cont, fore "red"
+
%cont, fore "black"
name"
%font "standard"

============================================================
$B%W%j%W%m%;%C%5%9%/%j%W%H(B
    ack$B$O$*9%$_$G(Bnkf$B$KJQ$($F$/$@$5$$(B :)
============================================================
#!/usr/local/bin/jperl

use Getopt::Long;
my %optval = (em => "red",
	      bg => "white",
	      fg => "black",
	      );
my @optctl = ("em:s",
	      "bg:s",
	      "fg:s",
	      );

GetOptions(\%optval, @optctl) or usage();

sub usage {
    print <<EOL;
Usage: colmg [-em=yellow] [-bg=black] [-fg=white]
    -em		specify emphasizing color
    -bg, -fg	specify foreground/background color
EOL
    exit(1);
}

$em = $optval{em};
$fg = $optval{fg};
$bg = $optval{bg};

open (IN, "ack -e @ARGV|");
open (STDOUT, "|ack -j");

while (<IN>) {
    s[^\Q|>\E(\t+)]["|" . ("\t" x (7-length($1)))]e;
    s[^\|(\t*)(.*)][$1\n%cont, font "typewriter"\n$2\n%font "standard"];
    s[T{(.*?)}][\n%cont, font "typewriter"\n$1\n%cont, font "standard"\n]g;
    s[T<(.*?)>][\n%cont, font "typewriter"\n$1\n%cont, font "standard"\n]g;
    s<E\{(.*?)\}>[\n%cont, fore "$em"\n$1\n%cont, fore "$fg"\n]g;
    s[E\((.*?)\)][\n%cont, fore "$em"\n$1\n%cont, fore "$fg"\n]g;
    s[E\<(.*?)\>][\n%cont, fore "$em"\n$1\n%cont, fore "$fg"\n]g;
} continue {
    print;
}
close (STDOUT);
close (STDIN);
============================================================

-------------------------------  Vulture       LRM20   .$B""(B||$B""(B.   LRM20
 $BA0ED(B $B70(B maeda@src.ricoh.co.jp   75t 175km/h     Md+  o'$B""(B||$B""(B`o  Md+
 ($B3t(B)$B%j%3!<(B $B%=%U%H%&%'%"8&5f=j(B   HeatSink 18  LG Sm+   .=X~~X=.   Sm+ LG
-------------------------------  Armor 2195           _|_    _|_