2007-06-22

SunFire 15K


Overview

White Papers

OpenMP

HPC Research
HPCxTR0411 "OpenMP Microbenchmarks Version 2.0", Fiona Reid, Mark Bull
OpenMP Microbenchmarks page
Zahir, IBM eServer p690, p690+ et p655 (Regatta Power4)

Sparc 64 cross compiler

SunFire dmesg
Jun 20 13:59:59 stutb genunix: [ID 540533 kern.notice] ^MSunOS Release 5.9 Version Generic_112233-08 64-bit
Jun 20 13:59:59 stutb genunix: [ID 943905 kern.notice] Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved.

Crosstool build results

So that all failed!

2007-06-21

人家只是轉圖檔而已...

竟然造成 kernel panic!! 因為 Out of memory!

for i in `ls -1 *.jpg`;do (convert -quality 48 -crop +0-1000 "$i" tmp/"$i" &); done

如此而已就 :(
寫信來去論壇問看看

2007-06-20

Perldoc, Day 1

perlintro.html

Using my in combination with a use strict; at the top of your Perl scripts means that the interpreter will pick up certain common programming errors. For instance, in the example above, the final print $b would cause a compile-time error and prevent you from running the program. Using strict is highly recommended.

類似 gcc -Wall


unless ( condition )
if (!condition)


Note that the braces are required in Perl, even if you've only got one line in the block.

Too bad


print "LA LA LA\n" while 1;          # loops forever


Cool!!


A list of them is given at the start of perlfunc and you can easily read about any given function by using perldoc -f functionname .



You can read from an open filehandle using the <> operator. In scalar context it reads a single line from the filehandle, and in list context it reads the whole file in, assigning each line to an element of the list:



Reading in the whole file at one time is called slurping. It can be useful but it may be a memory hog.

寫的真傳神! hog *grin* :P


When you're done with your filehandles, you should close() them (though to be honest, Perl will clean up after you if you forget):

哈! 好笑! though to e honest. :P


if ($a =~ /foo/) { ... }  # true if $a contains "foo"

The // matching operator is documented in perlop. It operates on $_ by default, or can be bound to another variable using the =~ binding operator (also documented in perlop).

In [perlop.html],
Binary "=~" binds a scalar expression to a pattern match. Certain operations search or modify the string $_ by default. This operator makes that kind of operation work on some other string. The right argument is a search pattern, substitution, or transliteration. The left argument is what is supposed to be searched, substituted, or transliterated instead of the default $_. When used in scalar context, the return value generally indicates the success of the operation. Behavior in list context depends on the particular operator. See "Regexp Quote-Like Operators" for details and perlretut for examples using these operators.

If the right argument is an expression rather than a search pattern, substitution, or transliteration, it is interpreted as a search pattern at run time.

Binary "!~" is just like "=~" except the return value is negated in the logical sense.



These are documented at great length in perlre, but for the meantime, here's a quick cheat sheet:
XDDD 快速騙人小抄 (quick cheat sheet)



while (<>) {
next if /^$/;
print;
}

我覺得寫的很美!

while ((c = get()) != NULL) {
printf ("%s\n", c);
}



http://cpan.stu.edu.tw/

第一次嘗試 CPAN install Bundle::CPAN 跑出一大堆鬼東西,看起來這個系統寫的很完整,也很大!

2007-06-19

‘Bad fd number’ error in Ubuntu 6.10 (Edgy Eft)

PCMan, Day 1

Demystifying Subclassing
Advice from the creator of C++

A Tour of C++
Procedural Programming
Decide which procedures you want; use the best algorithms you can find.

Modular Programming
Decide which modules you want; partition the program so that data is hidden within modules.

IBM Blade Center
Bjarne Stroustrup's homepage

Separate compilation is an issue in all real programs. It is not simply a concern in programs that present facilities, such as a Stack, as modules. Strictly speaking, using separate compilation isn't a language issue; it is an issue of how best to take advantage of a particular language implementation. However, it is of great practical importance. The best approach is to maximize modularity, represent that modularity logically through language features, and then exploit the modularity physically through files for effective separate compilation.