隨身router 旅遊一流

隨著電話, ipad 之類的電子儀器都可以上網,很多人都需要3G,wifi ,但是一出遊,或是在外去到別人的office裡,沒有wifi,最多能提供一個上網線給你,這時候,你那ipad,iphone 怎麼辦?

這時你需要一部路由器router 來分享無線上網,可是router 那麼大,怎麼可能隨身帶呢? 這裡我介紹兩部微型的隨身router給你

1.Asus WL330N3G

這是華碩出的微型路由器,看上圖就知道,比一張信用卡還小,放他在公事包或旅行袋裡應該沒什麼問題,最重要的是,他支援網線接入

這個微型router 有幾個特點,除了一般router具有wifi 分享, AP,中繼(repeater), 還有幾個特別的是可以當一個無線網卡,那麼你的電子儀器例如xbox360連接USB後,就可以無線上網。但是這個隨身router 的主打是3G,就是可以把網絡通過3G進行分享。

規格還是不錯的,支援11 n, 2.4GHz,DHCP, PPPOE 都有,還有防火牆,加密都有,不過就是另外還要帶一個火牛(電源),相信不會很大。

2.tp-link TL-WN700N

TP-Link 現在已經是比較常見,因為它價格十分便宜,而且速度不差,不宜壞,在4月份,TP-link 也出了隨身迷你路由器,這個路由器的設計和macbook 的電源插很像,而且還比它小20%,router已經包含了電源插,所以不用怕忘記帶! 和上面一樣,都是支援wifi,不過這個就不支援3G分享,速度不慢,可以有150M傳輸,基本已經夠用。

對比兩種,雖然華碩比較小,不過要另外帶電源插不是很方便,而且大牌的價格應該是比較貴的,相對於TP-link,設計上參考了MAC,拿上一個盒子就可以了,不用擔心忘記什麼(網線應該可以借),這個型號TP-LINK賣不到100人民幣,看了我都心動想買。

有空買來測試一下。

參考網頁:

http://www.asus.com/Networks/WiFi_Networking/WL330N3G/

http://www.tp-link.com.cn/pages/promos/wireless/2011-04-26/

Wordprss taxonomy 是什麼

Taxonomy 的意思是一個分類學,wordpress 運用taxonomy 的地方很多,例如category(類別),tag(標籤),link category(連結分類)。到了2.3版本後,custom taxonomies 開始實現,用戶可以自定自己的分類

WordPress 是如何註冊一個taxonomy的?

利用下面的代碼可以建議一個”people”的taxonomy,文章類型是post

[php]
function people_init() {
// create a new taxonomy
register_taxonomy(
‘people’,
‘post’,
array(
‘label’ = __(‘People’),
‘sort’ = true,
‘args’ = array(‘orderby’ = ‘term_order’),
‘rewrite’ =array(‘slug’ = ‘person’)
)
);
}
add_action( ‘init’, ‘people_init’ );
[/php]

通常都會給這些特殊的分類自定風格主題,因此會給他們定義terms

the_terms( $post->ID, ‘people’, ‘People: ‘, ‘, ‘, ‘ ‘ );

如何列出主題呢?

query_posts( array( ‘people’ => ‘bob’, ‘posts_per_page’ => 10 ) );

 

根據風格主題文件查詢表可以知道,taxonomy 是先查詢taxonomy-taxonomy-term.php 再查詢taxonomy-taxonomy.php最後才是taxonomy.php

參考文章:http://codex.wordpress.org/Taxonomies

http://codex.wordpress.org/File:Template_Hierarchy.png

wordpress attachment images

最近做主題時要用到wordpress 附件圖片,在看數據庫時發現,原來每一個附件都是作為一個post插入數據庫,只是post-type不同,而且還有是屬於哪個post。在文章中也可以直接插入gallery。

看到這些功能,心動了,只是這些自帶的功能缺乏的東西就是附件圖片的描述。

根據說明,取得附件的function 是wp_get_attachment_image($id,size),這樣加一個foreach就能取得到post裡面的所有附件圖片,不過就是缺少介紹。

用google找到了一篇不錯的文件,寫了一個hack,可以取得附件圖片的title, description

[php]
/**
* Retrieves the attachment data such as Title, Caption, Alt Text, Description
* @param int $post_id the ID of the Post, Page, or Custom Post Type
* @param String $size The desired image size, e.g. thumbnail, medium, large, full, or a custom size
* @return stdClass If there is only one result, this method returns a generic
* stdClass object representing each of the image’s properties, and an array if otherwise.
*/
function getImageAttachmentData( $post_id, $size = ‘thumbnail’, $count = 1 )
{
$objMeta = array();
$meta;// (stdClass)
$args = array(
‘numberposts’ =$count,
‘post_parent’ =$post_id,
‘post_type’ = ‘attachment’,
‘nopaging’ =false,
‘post_mime_type’ =’image’,
‘order’ = ‘ASC’, // change this to reverse the order
‘orderby’ = ‘menu_order ID’, // select which type of sorting
‘post_status’ = ‘any’
);

$attachments = get_children($args);

if( $attachments )
{
foreach( $attachments as $attachment )
{
$meta = new stdClass();
$meta-ID = $attachment-ID;
$meta-title = $attachment-post_title;
$meta-caption = $attachment-post_excerpt;
$meta-description = $attachment-post_content;
$meta-alt = get_post_meta($attachment-ID, ‘_wp_attachment_image_alt’, true);

// Image properties
$props = wp_get_attachment_image_src( $attachment-ID, $size, false );

$meta-properties[‘url’] = $props[0];
$meta-properties[‘width’] = $props[1];
$meta-properties[‘height’] = $props[2];

$objMeta[] = $meta;
}

return ( count( $attachments ) == 1 ) ? $meta : $objMeta;
}
}

[/php]

如何使用:

[php]
getImageAttachmentData( $_posts-ID, ‘full’ );
[/php]

參考來源:http://www.farfromfearless.com/

http://www.newvibes.com/blog/wordpress-get-attachment-title-and-description/

白色iphone 4 ipad 2值得炒嗎?

假如你打算買來炒白色iphone 4,那麼請你先去先達問一下最新的收機價。今早5點也有朋友打來問我值不值得買來炒,不過我的答案還是否定的。

由昨晚凌晨開始,白色iphone4 16G收機價由7k 下跌到今早5.6k,跌價那麼快原因簡單,市場貨源十分充足,請看看SMV的計劃有何變動:

http://www.smartone-vodafone.com/jsp/iPhone4/tchinese/home.jsp

smv iphone4 white

看到上面的圖,有什麼特別?沒錯!!就是『儲值卡』計劃!只需要$5188就可以出一部白色iphone4 ,假如你是收機的人,買機的人成本那麼低,你會出高價收購嗎?最多給你賺幾百。不過你要冒上賣不出去的風險,也就是蟹貨(買入價高於現市價)。

另外,中國大陸很快也會推出白色iphone 4和ipad 2,基本上貨源充裕到內地都不想收,基本上賺也是賺匯率的差距。

假如要炒白色iphone 4 或ipad 2,請先做好功課,或者搶在全港人的隊前,不然,費了心思沒錢賺,所以要三思哦。

白色iphone 4 ipad2 香港正式發售

香港iphone 4 27號正式發售,個大電話供應商包括three, smart tone ,csl 都推出,smart tone 凌晨開始在中環戲院裡發售。

個人感覺只是換了個殼,OS版本為4.3.1,iphone 4 黑色貨源充足,不值得入貨炒。

蘋果新聞稿http://www.apple.com/pr/library/2011/04/27iphone.html

 

另外,ipad 2也29號開始發售,蘋果新聞稿:http://www.apple.com/pr/library/2011/04/27ipad.html