2006-10-31

PHP Books


PHP Manual




PHP in a Nutshell

2006-10-21

Cool!!!

make -j

-j jobs
Specifies the number of jobs (commands) to run simultaneously. If
there is more than one -j option, the last one is effective. If
the -j option is given without an argument, make will not limit
the number of jobs that can run simultaneously.


XDDD PID 爆量跟記憶體瞬間餵飽!超讚!我愛!

How to Remove Files with Reserved Names in Windows XP

http://support.microsoft.com/kb/315226/en-us
http://support.microsoft.com/?kbid=120716

2006-10-20

[Windows Batch] Getting MAC by ping

$ for /l %i IN (1, 1, 254) DO ping -f -n 1 -w 1 -s 1 -r 1 -i 1 -l 1 zz.xx.cc.%i


$for /l %j IN (1, 1, 220) DO
for /l %i IN (1, 1, 254) DO ping -f -n 1 -w 1 -s 1 -r 1 -i 1 -l 1 zz.xx.cc.%i

2006-10-13

[Windows Batch] for

因為幫辦公室妹妹轉 JPG into PDF,想到 ImageMagick convert。但是 cygwin 無法處理中文檔名,所以就翻 Windows Help 找 "for" 的用法,以下是一行解。


for /R %i IN (*.jpg) DO convert "%i" "%~dpni".pdf

2006-10-08

Memory Management

http://www.memorymanagement.org/bib/f.html
http://www.memorymanagement.org/
http://en.wikipedia.org/wiki/Memory_debugger

好站!繼續衝,今天看到 Ch.8 的 "Pointer & Dynamic memory",遇到 malloc() & free() 就軟掉了,因為我沒有 ANSI C 的手冊可以查,所以 code 看的很暈,其實自己也對 codes 有恐懼跟軟掉感,哈哈,加油啊!

想買 C++ Primer 的衝動,先借來看看吧。

Michael C. Daconta

2006-10-07

C的指標和動態記憶體管理



某個週末和佑安去探訪二手書坊,買了一本〝 C的指標和動態記憶體管理 (C pointers and dynamic memory management)〞,這本書讓我比較了解指標的用法,目前我看到 Ch5.  Array & Pointer。


我只花了 NT$ 70 買,應該是處超超超所值啦,後~~ ^_________^


以下是延伸的資源:

2006-10-06

NAND Flash

NAND memories



NAND flash memories cannot provide execute-in-place due to their different construction principles. These memories are accessed much like block devices such as hard disks or memory cards. The blocks are typically 512 or 2048 bytes in size. Associated with each block are a few bytes (typically 12–16 bytes) that should be used for storage of an error detection and correction block checksum.



NAND devices typically have software-based bad block management. This means that when a logical block is accessed it is mapped to a physical block, and the device has a number of blocks set aside for compensating bad blocks and for storing primary and secondary mapping tables.



The error-correcting and detecting checksum will typically correct an error where one bit in the block is incorrect. When this happens, the block is marked bad in a logical block allocation table, and its (still undamaged) contents are copied to a new block and the logical block allocation table is altered accordingly. If more than one bit in the memory is corrupted, the contents are partly lost, i.e. it is no longer possible to reconstruct the original contents. Some devices may even come with a pre-programmed bad block table from the manufacturer, since it is sometimes impossible to manufacture error-free NAND memories.



The first error-free physical block (block 0) is always guaranteed to be readable and free from errors. Hence, all vital pointers for partitioning and bad block management for the device must be located inside this block (typically a pointer to the bad block tables etc). If the device is used for booting a system, this block must contain the master boot record.



When executing software from NAND memories, virtual memory strategies are used: memory contents must first be paged or copied into memory-mapped RAM and executed there. A memory management unit (MMU) in the system is helpful, but this can also be accomplished with overlays.



For this reason, some systems will use a combination of NOR and NAND memories, where a smaller NOR memory is used as software ROM and a larger NAND memory is partitioned with a file system for use as a random access storage area.

 

NOR Flash

http://en.wikipedia.org/wiki/NOR_flash 


NOR memories

The read-only mode of NOR memories is similar to reading from a common memory, provided address and data bus is mapped correctly, so NOR flash memory is much like any address-mapped memory. NOR flash memories can be used as execute-in-place memory (XIP), meaning it behaves as a ROM memory mapped to a certain address. NOR flash memories have no intrinsic bad block management, so when a flash block is worn out, either the software using it has to handle this, or the device breaks.

When unlocking, erasing or writing NOR memories, special commands are written to the first page of the mapped memory. These commands are defined as the Common Flash memory Interface (defined by Intel) and the flash circuit will provide a list of all available commands to the physical driver.

Apart from being used as a ROM, the NOR memories can, of course, also be partitioned with a file system and used as any storage device.

2006-10-04

How do I uninstall all of Cygwin?


http://www.cygwin.com/faq/faq_2.html#SEC20


Setup has no automatic uninstall facility. The recommended method to
remove all of Cygwin is as follows:

Remove all Cygwin services. If a service is currently running, it must first be stopped with `cygrunsrv -E name', where `name' is the name of the service. Then use `cygrunsrv -R name' to uninstall the service from the registry. Repeat this for all services that you installed. Common services that might have been installed are sshd, cron, cygserver, inetd, apache, and so on.


Stop the X11 server if it is running, and terminate any Cygwin programs that might be running in the background. Remove all mount information by typing `umount -A' and then exit the command prompt and ensure that no Cygwin processes remain. Note: If you want to save your mount points for a later reinstall, first save the output of `mount -m' as described at http://cygwin.com/cygwin-ug-net/using-utils.html#mount.


Delete the Cygwin root folder and all subfolders. If you get an error that an object is in use, then ensure that you've stopped all services and closed all Cygwin programs. If you get a 'Permission Denied' error then you will need to modify the permissions and/or ownership of the files or folders that are causing the error. For example, sometimes files used by system services end up owned by the SYSTEM account and not writable by regular users. The quickest way to delete the entire tree if you run into this problem is to change the ownership of all files and folders to your account. To do this in Windows Explorer, right click on the root Cygwin folder, choose Properties, then the Security tab. Select Advanced, then go to the Owner tab and make sure your account is listed as the owner. Select the 'Replace owner on subcontainers and objects' checkbox and press Ok. After Explorer applies the changes you should be able to delete the entire tree in one operation. Note that you can also achieve this in Cygwin by typing `chown -R user /' or by using other tools such as CACLS.EXE.


Delete the Cygwin shortcuts on the Desktop and Start Menu, and anything left by setup.exe in the download directory. However, if you plan to reinstall Cygwin it's a good idea to keep your setup.exe download directory since you can reinstall the packages left in its cache without redownloading them.


If you added Cygwin to your system path, you should remove it unless you plan to reinstall Cygwin to the same location. Similarly, if you set your CYGWIN environment variable system-wide and don't plan to reinstall, you should remove it.


Finally, if you want to be thorough you can delete the registry tree `Software\Cygnus Solutions' under HKEY_LOCAL_MACHINE and/or HKEY_CURRENT_USER. However, if you followed the directions above you will have already removed all the mount information which is typically
the only thing stored in the registry.

--
Alan Lu, a man, enjoy programming & UNIX.
My website: http://alan0098.googlepages.com/

搞笑漫畫日和1 No.4

 

落下女-追辣妹的方法

 

2006-10-02

骯髒

因為 ARM9 Linux 做不好,所以就覺得大陸寫的教材很骯髒,其實是自己沒有能力去 hacking 那些東西,幹幹幹,幹麻做在 cygwin 呢? :'(


要怎麼拆解?或是怎麼做才會順利呢?煩心 ~~~~~~ :( 

[Bash] .

Generating a script named "start.sh" file like below,

#!/bin/sh
export PATH=/foo/foo:$PATH

Then, we need excute ". start.sh".

$ man 1 bash

BASH_ARGC
An array variable whose values are the number of parameters in each
frame of the current bash execution call stack. The number of
parameters to the current subroutine (shell function or script
executed with . or source) is at the top of the stack. When a
subroutine is executed, the number of parameters passed is pushed onto
BASH_ARGC. The shell sets BASH_ARGC only when in extended debugging
mode (see the description of the extdebug option to the shopt builtin
below)


--
Alan Lu, a man, enjoy programming & UNIX.
My website: http://alan0098.googlepages.com/