Archive for the ‘JOB’ Category.
[URL] iPhone programming bookmarks / reference
★ Your First iOS Application
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/Articles/00_Introduction.html
中文 : http://icodeblog.com/category/iphone-programming-tutorials/
★★ iOS Reference Library : http://developer.apple.com/iphone/library/navigation/index.html
iPhone Dev Center : http://developer.apple.com/iphone/index.action
iPhone Human Interface Guidelines : http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/Introduction/Introduction.html
objective-c 的基本認識 , 參考 URL : http://www.otierney.net/objective-c.html.zh-tw.big5
有趣的 iPad iPhone development video 教學 : http://www.rorylewis.com/docs/02_iPad_iPhone/05_iPhoneTutorials.htm
給初接觸 objective-c 的介紹 : http://maciku.blogspot.com/2009/12/iphone-objective-c.html
包裝好給 iPhone 用的 http 元件/framework – ASIHTTPRequest
http://allseeing-i.com/ASIHTTPRequest/
—-
7/31 iPhone dev 課程 outline :
iPhone spec. / Objective-c intro.
intro. xcode / iPhone 開發限制 / 應用軟體架構 / 記憶體管理
first App. – HelloWorld
程式語法 – simple
Interface Builder基本操作
字串與資料結構 / UI Catalog
second App. – Location base App.
upload to real iPhone – use Apple
★ init , copy , retain 要記得 release memory
★ didReceiveMemoryWarning , viewDidUnload 暫時釋放 memmory
★ IBOutlet 引用到的 InterfaceBuilder 元件建議作 release , 但要注意到不要重覆 release
★ InterfaceBuilder : 事件與程式碼配合 – IBAction , 物件關聯 – IBOutlet , Delegate 指定.
INTEL vs Transcend SSD little PK (LAB )
J神對於 SSD 的讀取速度特別著迷, 於是重金採購了兩款 performance 都不錯的 SSD 來 lab 一下, 以下就這次的 Result :
Jason Chen: 早上再做一次二顆 SSD 的 Xbench Disk Test , 這次是 Intel 勝出 Transcend 2.5" 32G SSD SLC Disk Test 73.82 Sequential 84.27 Uncached Write 104.16 63.95 MB/sec [4K blocks] Uncached Write 83.54 47.26 MB/sec [256K blocks] Uncached Read 48.92 14.32 MB/sec [4K blocks] Uncached Read 183.43 92.19 MB/sec [256K blocks] Random 65.67 Uncached Write 20.31 2.15 MB/sec [4K blocks] Uncached Write 107.89 34.54 MB/sec [256K blocks] Uncached Read 1982.02 14.05 MB/sec [4K blocks] Uncached Read 523.91 97.21 MB/sec [256K blocks] Intel X25-V 40G SSD MLC Disk Test 150.38 Sequential 97.48 Uncached Write 72.91 44.76 MB/sec [4K blocks] Uncached Write 72.35 40.94 MB/sec [256K blocks] Uncached Read 105.10 30.76 MB/sec [4K blocks] Uncached Read 251.19 126.25 MB/sec [256K blocks] Random 328.80 Uncached Write 389.34 41.22 MB/sec [4K blocks] Uncached Write 132.67 42.47 MB/sec [256K blocks] Uncached Read 2099.11 14.88 MB/sec [4K blocks] Uncached Read 631.72 117.22 MB/sec [256K blocks]
Maximum Availability Architecture – Oracle Streams Configuration Best Practices
Oracle doc PDF URL : http://dn.monster.tw/my/docs/oracle/MAA_10gR2_Streams_Configuration.pdf
Oracle® Streams Advanced Queuing User’s Guide and Reference
10g Release 2 (10.2) – http://download.oracle.com/docs/cd/B19306_01/server.102/b14257/toc.htm
sample memo: http://www.monster.com.tw/archives/2565
Oracle Maximum Availability Architecture – Overview – http://www.oracle.com/technology/deploy/availability/htdocs/maaoverview.html
PChome 超越 雅虎奇摩 , 成為臺灣第一大入口網站 – Google公布全球網站Top1000,台灣9站入榜
賀 ! 網家晉身百元俱樂部
2010/06/01 11:57 中央社
(中央社記者邱國強台北2010年6月1日電)網家 (8044) 在商店街業務獨立為子公司,擁有上櫃前釋股挹注題材,以及商店街、線上購物業績表現不俗下,今天攻上漲停板100元,榮登百元俱樂部,且創歷史新高。
網家營收在商店街及24小時線上購物帶動下,3月間曾達8.22億元,創下歷史次高,小輸去年12月創歷史新高的8.23億元;4月營收則下滑至7.55億元,減幅約8%,法人評估5月應與4月相彷。
網家今年最大題材為商店街業務獨立為子公司的釋股案。其「PCHOME商店街」4月30日正式獨立為「商店街市集國際資訊」,並將申請上櫃,今年底至明年上半年可望掛牌,而上櫃前釋股所產生的利益,即受到市場關注。
法人認為,網家商店街子公司上櫃,釋股價格約在50元左右,以此計算,網家釋股利益將逾2億元,每股可望挹注3.5元,使網家去年以來一路呈大波段上漲走勢。
—–
網路家庭(8044):買進,目標價118元
2010/06/02 08:25 康和證券投顧
《經濟日報:雲端加持 網家擠進百元股網家》
網路家庭 8044(TW) 旗下「商店街」將分割上市,潛在釋股利益可期,配合與ebay合資的「露天拍賣」開始獲利,昨(1日股價強攻站上百元大關,宣告晉身為「百元俱樂部」成員。
網家09年營收83.07億元,yoy+11.68%,eps 2.26元。1q10營收24.06億元,qoq+8.68%、yoy+22.81%,eps 0.95元。網家目前主要的業務為電子商務,營運分為b2c線上購物、skype 等業務、入口網站廣告等三部份,09年營收比重分別為91%、7%、2%。「露天拍賣」從去年底開始收取1.5%的成交金額手續費(單筆交易最高收費上限 150元,過去主要收入僅有線上廣告,3月已開始獲利。
商店街部份,提供中小企業開設網路商店的套裝功能,目前位居台灣的龍頭,遠大於 yahoo與樂天市佔率,24hr線上購物亦呈現穩定獲利狀態。預估2q營收23.19億元,qoq+3.64%、yoy+16.75%,eps 0.92元。10年營收99.66億元,yoy+19.99%,eps 3.96元。投資建議買進,目標價118元。

使用 mysql partition table sample
Mysql server version:
mysql> show variables like '%version%'; +--------------------------+------------------------------+ | Variable_name | Value | +--------------------------+------------------------------+ | protocol_version | 10 | | version | 5.1.46-community | | version_comment | MySQL Community Server (GPL) | | version_compile_machine | x86_64 | | version_compile_os | unknown-linux-gnu | +--------------------------+------------------------------+ 9 rows in set (0.01 sec)
Check things…
mysql> show variables like '%inno%'; +-----------------------------------------+------------------------+ | Variable_name | Value | +-----------------------------------------+------------------------+ | have_innodb | YES | mysql> show variables like '%part%'; +-------------------+-------+ | Variable_name | Value | +-------------------+-------+ | have_partitioning | YES |
my schema:
-- CREATE TABLE `tbl_ts_ip` ( `xdate` int(8) NOT NULL default 0, `xhour` varchar(2) NOT NULL default '00', `tag1` varchar(100) NOT NULL default '', `tag2` varchar(300) NOT NULL default '', `val` int(10) unsigned NOT NULL default '0', KEY `ndx_xdate` (`xdate`), KEY `ndx_xhour` (`xhour`), KEY `ndx_tag1` (`tag1`), KEY `ndx_tag2` (`tag2`) ) ENGINE=InnoDB partition by range(xdate) ( partition p201003 values less than (20100400), partition p201004 values less than (20100500), partition p201005 values less than (20100600), partition p201006 values less than (20100700) );
testing
-- insert into tbl_ts_ip values (20100301,'01','tag1','tag2',1); insert into tbl_ts_ip values (20100401,'01','tag1','tag2',1); insert into tbl_ts_ip values (20100501,'01','tag1','tag2',1); insert into tbl_ts_ip values (20100601,'01','tag1','tag2',1); insert into tbl_ts_ip values (20100701,'01','tag1','tag2',1); --
result:
-- mysql> insert into tbl_ts_ip values (20100301,1,'tag1','tag2',1); Query OK, 1 row affected (0.00 sec) mysql> insert into tbl_ts_ip values (20100401,1,'tag1','tag2',1); Query OK, 1 row affected (0.00 sec) mysql> insert into tbl_ts_ip values (20100501,1,'tag1','tag2',1); Query OK, 1 row affected (0.00 sec) mysql> insert into tbl_ts_ip values (20100601,1,'tag1','tag2',1); Query OK, 1 row affected (0.00 sec) mysql> insert into tbl_ts_ip values (20100701,1,'tag1','tag2',1); ERROR 1526 (HY000): Table has no partition for value 20100701 mysql> select * from tbl_ts_ip; +----------+-------+------+------+-----+ | xdate | xhour | tag1 | tag2 | val | +----------+-------+------+------+-----+ | 20100301 | 1 | tag1 | tag2 | 1 | | 20100401 | 1 | tag1 | tag2 | 1 | | 20100501 | 1 | tag1 | tag2 | 1 | | 20100601 | 1 | tag1 | tag2 | 1 | +----------+-------+------+------+-----+ 4 rows in set (0.00 sec) --
data files :
[root@ stat]# ls -l total 676 -rw-rw---- 1 mysql mysql 65 May 18 17:02 db.opt -rw-rw---- 1 mysql mysql 8682 May 18 17:07 tbl_ts_ip.frm -rw-rw---- 1 mysql mysql 52 May 18 17:07 tbl_ts_ip.par -rw-rw---- 1 mysql mysql 163840 May 18 17:09 tbl_ts_ip#P#p201003.ibd -rw-rw---- 1 mysql mysql 163840 May 18 17:09 tbl_ts_ip#P#p201004.ibd -rw-rw---- 1 mysql mysql 163840 May 18 17:09 tbl_ts_ip#P#p201005.ibd -rw-rw---- 1 mysql mysql 163840 May 18 17:09 tbl_ts_ip#P#p201006.ibd
add partitions:
-- alter table tbl_ts_ip add partition ( partition p201007 values less than (20100800), partition p201008 values less than (20100900), partition p201009 values less than (20101000), partition p201010 values less than (20101100), partition p201011 values less than (20101200), partition p201012 values less than (20110100) ); --
explain partitions:
-- mysql> explain partitions select * from tbl_ts_ip where xdate=20100501; +----+-------------+-----------+------------+------+---------------+-----------+---------+-------+------+-------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-----------+------------+------+---------------+-----------+---------+-------+------+-------+ | 1 | SIMPLE | tbl_ts_ip | p201005 | ref | ndx_xdate | ndx_xdate | 4 | const | 1 | | +----+-------------+-----------+------------+------+---------------+-----------+---------+-------+------+-------+ -- -- -- mysql> explain partitions select * from tbl_ts_ip where xdate>20100101 and xdate<20100501 and xhour=1 and tag1='x1' and tag2='x2'; +----+-------------+-----------+-------------------------+------+---------------------------------------+-----------+---------+-------+------+-------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-----------+-------------------------+------+---------------------------------------+-----------+---------+-------+------+-------------+ | 1 | SIMPLE | tbl_ts_ip | p201003,p201004,p201005 | ref | ndx_xdate,ndx_xhour,ndx_tag1,ndx_tag2 | ndx_xhour | 4 | const | 3 | Using where | +----+-------------+-----------+-------------------------+------+---------------------------------------+-----------+---------+-------+------+-------------+ --
######################
sample schema:
create table t1 (
d date
) engine=innodb partition by range ( to_days(d) ) (
partition p1 values less than (to_days(’1999-01-01′)),
partition p2 values less than (to_days(’2000-01-01′))
);
– drop old partition
alter table tablename
drop partition p1;
######
-- CREATE TABLE `tbl_ts_ip` ( `xdate` int(8) NOT NULL default 0, `xhour` int(2) NOT NULL default 0, `tag1` varchar(100) NOT NULL default '', `tag2` varchar(300) NOT NULL default '', `val` int(10) unsigned NOT NULL default '0', KEY `ndx_xdate` (`xdate`), KEY `ndx_xhour` (`xhour`), KEY `ndx_tag1` (`tag1`), KEY `ndx_tag2` (`tag2`) ) ENGINE=InnoDB partition by range(xdate) ( partition p200901 values less than (20090200), partition p200902 values less than (20090300), partition p200903 values less than (20090400), partition p200904 values less than (20090500), partition p200905 values less than (20090600), partition p200906 values less than (20090700), partition p200907 values less than (20090800), partition p200908 values less than (20090900), partition p200909 values less than (20091000), partition p200910 values less than (20091100), partition p200911 values less than (20091200), partition p200912 values less than (20100100), partition p201001 values less than (20100200), partition p201002 values less than (20100300), partition p201003 values less than (20100400), partition p201004 values less than (20100500), partition p201005 values less than (20100600), partition p201006 values less than (20100700), partition p201007 values less than (20100800), partition p201008 values less than (20100900), partition p201009 values less than (20101000), partition p201010 values less than (20101100), partition p201011 values less than (20101200), partition p201012 values less than (20110100), partition p201101 values less than (20110200), partition p201102 values less than (20110300), partition p201103 values less than (20110400), partition p201104 values less than (20110500), partition p201105 values less than (20110600), partition p201106 values less than (20110700), partition p201107 values less than (20110800), partition p201108 values less than (20110900), partition p201109 values less than (20111000), partition p201110 values less than (20111100), partition p201111 values less than (20111200), partition p201112 values less than (20120100) ); --
###
一天一個 partition …
--
CREATE TABLE `tbl_ts_ip` (
`xdate` date NOT NULL DEFAULT '0000-00-00',
`xhour` int(2) NOT NULL DEFAULT '0',
`tag1` varchar(100) NOT NULL DEFAULT '',
`tag2` varchar(300) NOT NULL DEFAULT '',
`val` int(10) unsigned NOT NULL DEFAULT '0',
KEY `ndx_xdate` (`xdate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY RANGE ( to_days(xdate) )
(PARTITION p0 VALUES LESS THAN ( to_days('2005-1-1') ) );
--
--
alter table tbl_ts_ip
add partition (
partition p20100401 values less than ( to_days('20100401')+1 )
);
--
###
產生 alter table … add partition 的 code
$start_date = mktime( 0,0,0,4,1,2010);
$day_count = 365;
for ( $i=0; $i < $day_count; $i++ ) {
echo "
alter table tbl_ts_ip
add partition (
partition p".date("Ymd",$start_date)." values less than ( to_days('".date("Ymd",$start_date)."')+1 )
);
";
echo "
alter table tbl_ts_member
add partition (
partition p".date("Ymd",$start_date)." values less than ( to_days('".date("Ymd",$start_date)."')+1 )
);
";
$start_date += 86400;
}
###
--
mysql> explain partitions select * from tbl_ts_ip where xdate>20100510 and xdate<20100517 and tag2='114.39.237.77'\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: tbl_ts_ip
partitions: p0,p20100511,p20100512,p20100513,p20100514,p20100515,p20100516
type: ALL
possible_keys: ndx_xdate
key: NULL
key_len: NULL
ref: NULL
rows: 37706064
Extra: Using where
1 row in set (0.01 sec)
mysql> select * from tbl_ts_ip where xdate>20100510 and xdate<20100517 and tag2='114.39.237.77';
+------------+-------+--------------------+---------------+-----+
| xdate | xhour | tag1 | tag2 | val |
+------------+-------+--------------------+---------------+-----+
| 2010-05-16 | 23 | 37043600380A380C3E | 114.39.237.77 | 2 |
+------------+-------+--------------------+---------------+-----+
1 row in set (24.26 sec)
--
###
| Oracle partition table | MySQL partition table |
|
Oracle 說 partition 的好處是…
Partitioning is transparent to existing applications and standard DML statements run against partitioned tables. However, an application can be programmed to take advantage of partitioning by using partition-extended table or index names in DML. You can use SQL*Loader and the import and export utilities to load or unload data stored in partitioned tables. These utilities are all partition and subpartition aware. |
two main advantages are: Increased performance – during scan operations, the MySQL optimizer knows what partitions contain the data that will satisfy a particular query and will access only those necessary partitions during query execution. For example, a million row table may be broken up into ten different partitions in range style so that each partition contains 100,000 rows. If a query is issued that only needs data from one of the partitions, and a table scan operation is necessary, only 100,000 rows will be accessed instead of a million. Obviously, it is much quicker for MySQL to sample 100,000 rows than one million so the query will complete much sooner. The same benefit is derived should index access be possible as local partitioned indexes are created for partitioned tables. Finally, it is possible to stripe a partitioned table across different physical drives by specifying different file system/directory paths for specific partitions. This allows physical I/O contention to be reduced when multiple partitions are accessed at the same time.
|
| ref: MySQL partitions tutorial , http://www.slideshare.net/datacharmer/mysql-partitions-tutorial download: http://dn.monster.tw/my/docs/mysql/partitionstutorial-090426130303-phpapp02.pdf |
—
用 mysql partition table 要注意的事:
Check resources!
- InnoDB
check disk space (uses more than MyISAM)check CPU usage
- MyISAM
use 2 file handles per partitionIf you use more than one partitioned table, count total file handles
- Archive
check CPU usagecheck memory usage




