Monday, June 29, 2009

Max Width and Max Height for Images in IE

.mainimage {
max-width: 400px;
max-height: 400px;
}
This works great in Firefox, Safari, Opera, and Chrome. But it doesn't work in Microsoft IE6 or IE7 or IE8
I can't believe Microsoft STILL has not made their browsers standards-compliant for simple things like max-width and max-height.

Solution That Works For All Browsers
It turns out there's a way of doing the equivalent of max-width and max-height for IE browsers. If you use the following style, it will work on all browsers:
.mainimage {
max-width: 400px;
max-height: 400px;
width: expression(this.width > 400 ? "400px" : true);
height: expression(this.height > 400 ? "400px" : true);

}
Microsoft web browsers understand the Microsoft-only, non-standard "expression" element inside CSS. The part inside parentheses must be a Javascript expression yielding the string that should be used in place of the expression() portion. No other web browsers understand it, which is good for our situation - we can check and set the width and height elements of our image with it, just for Microsoft browsers.

Vote for Stuff.co.nz



Today is the last chance for you to vote for your favourite kiwi websites.

Please visit http://www.netguide.co.nz/webawards to cast your vote today!! Enter the website address (URL) of the websites you would like to nominate in each category. You do not have to enter a website for each category. Once you have finished nominating please scroll to the bottom of the page and click on the send button.

The winners will be announced in a Webcast ceremony on July 23.

Go go go Stuff.co.nz!!!
Friday, June 26, 2009

The King will never die!

Michael Jackson
6月26日Michael Jackson因心脏停搏去世。据科技博客TechCrunch报道,由于关注人数极多,有关他死讯的新闻导致多家网站瘫痪。

迈克尔杰克逊是这个星球上绝无仅有的天才和巨星。U ARE NOT ALONE,但他却一直是孤独的。这样的谢幕方式,完满了流行音乐史上最伟大的一段故事。地球上,不再有让人战栗的传奇……

他的歌迷,无论肤色种族,男女老少,无论社会制度,意识形态,都拥有的强大的阵营!没有任何歌手能像迈克尔.杰克逊一样,轻易地掳获了上至王官贵族,下至平民百姓,小至3岁幼童,老至70老妪的心。毫无疑问,他是全球拥有最多歌迷的歌手!

他是舞王,他独创的太空舞步,眩目妙幻,轻灵有力,风靡全球,是众多艺人的模仿对象!

他的歌,带着独特的迈风格,或激情,或温柔,或伤感,或深沉,或稚气,或邪气,代表着人类的共同心声:自由自我,梦幻童真,真诚友谊,高尚爱情,和平环保,种族平等,民权民生,悲天悯人......在这个充斥着无病呻吟,色情暴力等等无聊喧泄的流行乐坛里,始终有如一道激荡的清流,洗涤心灵,积极向前!

他不仅是一个百年难遇的艺术家,也是一个善举无数慈善家!但不幸的是,他也是一个被媒体污蔑最多,被世人误解最深的人......

迈克尔.杰克逊的伟大体现在——他的歌舞给全球数以亿计的歌迷带来欢乐,感动与震憾。而最重要的是,他打破了美国白人种族主义一直压制在黑人艺人身上的桎梏!他是第一个出现在MTV电视台上的黑人歌手,他是第一个出现在《滚石》封面的黑人歌手,他为众多遭受打压的黑人歌手走向成功打开了大门,铺平的道路!他开创了乐坛的一个时代!

生命已逝,音乐不朽,老迈一路走好!

Thursday, June 25, 2009

Do you know what a browser is?

什么才是用户心中的浏览器。这个视频是Google 在今年早些时候拍的。他们走上纽约时代广场街头,随机选了50位路人,然后询问他们同一个问题:What is a Browser?

路人回答虽不说是充满想象,但也出乎我意料。本以为大家会直接说出例如IE Firefox Safari Chrome Opera 之类的单词,结果事实却是更多人说出了 Browser is a Search Engine(这么有哲理的话)。有几个人直接说出了Google,当然也个老太太说她用Yahoo :)

接着Google 又问出了第二个问题:搜索引擎和浏览器有什么区别?这一回大家更糊涂了 :D 大部分人表示“我TM怎么知道,只要结果是我想要的便OK了”

# 由于这本身是一个给Chrome 推广的视频,所以他们也不得不扯到真正的浏览器。所以,下一个问题就比较无聊:你选用什么浏览器。一些人回答了i use google,也有firefox 的。最后一个问题更是目的明确:你听说过Chrome 浏览器吗?没有,大部分被采访者说,没有。

下面便是这个视频,时长2分23秒:



下面我公布正确答案:

问:什么是浏览器?
答:浏览器是用来浏览网页滴

问:浏览器和搜索引擎有什么区别?
答:你白痴啊!顾名思义,浏览器是用来浏览的,搜索引擎是用来搜索的!
Wednesday, June 24, 2009

Stuff logo -- Matariki Māori New Year

In the Māori language Matariki is the name of the Pleiades star cluster, which was important for agriculture in establishing the correct time to plant crops. There are two explanations of the name Matariki: firstly, mata-riki (small eyes) or mata-ariki (Eyes of God). The constellation is also believed to have been used by navigators.

The first rising of the Pleiades and of Rigel (Puanga in Māori) occurs just prior to sunrise in late May or early June, and this indicates that the old year has ended and the new year has begun. The actual time for celebrating Matariki varies, depending on the iwi (tribe or clan). Some iwi celebrate it immediately. Others wait until the rising of the next full moon, or alternatively the dawn of the next new moon. It has become common practice for various private and public institutions to celebrate Matariki over the period of a week or month anywhere from early June to late July. Other iwi used the rising of Rigel in a similar way.

In traditional times, Matariki was a season to celebrate and to prepare the ground for the coming year. Offerings of the produce of the land were made to the gods, including Rongo, god of potato. This time of the year was also a good time to instruct young people in the lore of the land and the forest. In addition, certain birds and fish were especially easy to harvest at this time.

National holiday proposals

From time to time, there have been proposals to make Matariki an official holiday in New Zealand. In 2001, The Māori Language Commission "began to reclaim Matariki, or Aotearoa Pacific New Year, as an important focus for Māori language regeneration. The commission is spearheading a campaign to elevate Matariki into an iconic national event as part of a nationwide Māori language information programme, "Kōrero Māori", and intends to develop relationships and partnerships in order to co-ordinate and share activities with other stakeholders while complementing existing events".

In June 2009 Maori Party MP Rahui Katene was unsuccessful in having her member's bill 'Te Ra o Matariki Bill/Matariki Day Bill' drawn from the ballot. The draft legislation would have fixed the date of a public holiday using the New Moon in June.

(Description from Wikipedia)
Sunday, June 21, 2009

Google logo -- Father's Day

祝愿我的父亲节日快乐!我有一个伟大的父亲,是我前二十年的舵手,整个人生的导师。

Google logo -- first day of winter

Google logo first day of winter
今天是南半球的冬至,Google新西兰和Google澳大利亚上线了2009年冬至的logo。 虽然日历上今天才到来,但是身处惠灵顿的我早已感觉到了冬季。

新西兰的冬天很长一般从5月就开始了一直要到9月,在这漫长的五个月期间总是连绵的雨水不断,飕飕的大风不停,湿冷湿冷的,是那种渗透在骨头里面的冷。不像是在中国的北方的冬天,户外很冷但是屋子里有暖气还是很暖和的。还有一个相反就是,在新西兰冬天要在屋子里面用抽湿机,洗的衣服要晾差不多一个礼拜才能干。而国内冬天要用加湿器,因为屋里有暖气太干燥了。

掐指一算,这已经是我在新西兰的第八个冬天了,都八年啦.......

南半球是冬天,北半球当然就是夏天了,下面是北半球夏至的logo


Friday, June 19, 2009

谷歌被央视开刀

昨天晚上,中央电视台新闻联播报道了“互联网违法和不良信息举报中心”谴责谷歌搜索含有大量低俗、色情内容。接着,新闻联播之后的《焦点访谈》更是详细地介绍了如何在谷歌搜索黄色低俗内容以及“代表们”如何谴责Google中国,并建议相关部门严肃处理Google中国。

这一幕对于一直关注搜索引擎动态的人来说应该是十分熟悉的,因为之前百度也被央视曝光过,百度被央视拿来当靶子是因为百度竞价排名里有大量的医药虚假信息,而这次Google被曝光却是因为自然搜索结果里含有“大量低俗内容”。




很多网友可能会好奇,为什么谷歌被央视谴责,市场份额远大于谷歌的百度却安然无恙?可能很多人会联想到百度在今年春晚给央视赞助了四千万。不过,我认为百度之所以安然无恙,主要是由于以下几点:

1,在《焦点访谈》视频中输入的关键词,大家可以在百度里面尝试一下,确实没有误导的。

2,大家可以看看视频里面,提到了境外淫秽色情内容、自动翻译等功能,百度确实没有这些功能。

3,在去年央视曝光后,百度处事非常谨慎,以百度贴吧为例,很多敏感题材的贴吧都被关闭。


搜索引擎不应为索引内容负责

搜索引擎只作为一个信息的搜集和查找工具,它本身不会产生内容,因此将存在“低俗色情”内容归咎于搜索引擎是一种懒惰的表现,如果要打击色情内容,那就应该从根源上将其消灭,没有搜索引擎我们依然可以登陆色情网站。搜索引擎并非信息传播的唯一渠道。

而对于图片搜索里出现的相关关键词,搜索引擎更不应该负上责任,这些相关关键词是由网民“投票”产生的,所谓“投票”是指网民搜索次数越多,这个关键词就会被投得最多“票”,从而出现在相关关键词里面。因此,并不是Google提供了这些“联想词”,而是Google告诉你网民最经常搜索什么,这是一种事实的反映。这是搜索引擎公正性的一种表现。

百度在去年被央视曝光,主要还是因为商业模式,在其他方面,百度确实比谷歌“更听党的话”。
Thursday, June 18, 2009

Use IE8 to find ten grand online


金钱刺激是一种很常见的市场推广策略,不过在浏览器领域里可以从未有过先例。如今微软澳大利亚开了先河,发起了一项利用IE8的寻宝行动,悬赏额达一万澳元。这项活动名为 Ten Grand is buried Here
如果你能在今年9月17日之前率先找到一个有着“领奖”特别按钮的澳大利亚网站,就能拿到这一万澳元。从6月19日开始,微软会在Twitter上随机提供一些线索。 全球各地用户都可以参与其中,但活动声明只有澳大利亚本地居民才能领奖,所以如果你来自其它国家、又想一试身手,不妨找个澳大利亚兄弟合作,最后分成。
当然了,该活动只能通过IE8浏览器参加,而且需要关掉兼容浏览模式(否则会被识别成IE7)。别说“古老的”Firefox、“破烂的”Chrome、“无聊的”Safari、“不入流的”Opera,就连自家前辈IE7都会被拒之门外。
IE8独享寻宝行动
微软澳大利亚发起IE8寻宝行动:找网站得一万澳元

IE7也别想
微软澳大利亚发起IE8寻宝行动:找网站得一万澳元

Firefox
微软澳大利亚发起IE8寻宝行动:找网站得一万澳元

The New WEB Project???

进入The New WEB Project的网站,可以看到一张图,落款处有Mozilla,AOL,Microsoft,W3C,Google等公司的logo,上面写着"starting the internet all over..soon”,那么这是一个什么新的网络计划呢?是真是假呢?让我们拭目以待吧。

Wednesday, June 17, 2009

New domain name for iWang

I have been thinking about buying a custom domain for a while. I am comfortable with Blogger and I can afford to host any number of posts per day without worrying about the storage, bandwidth and stuff etc. So after 2.5 years, I chose to go with Blogger + Custom Domain option.

I registered www.danielwang.cn from Godaddy.com with Chinese top-level domain, then successfully switched from http://danielwang130.blogspot.com to www.danielwang.cn, and now, this blog is hosted on Blogger with a custom domain name.
  1. It’s more professional. A blog which uses a custom URL seems more professional than one which is hosted on a sub-domain. For a web developer, I do need my own domain name.
  2. People will find you easier. Friends and others can easily remember your website address, just my name.
  3. .CN top-level domain. Tells my readers that I am a Chinese guy, although most of my posts are in English and I am living and working overseas.
  4. NOT that expensive: Is that too much? no, US$25/year.
  5. Blogger hosts everything: Yes, how much ever you write - they host. Texts, images and videos (Youtube or Google Videos) - you can host anything and smoothly integrate with Blogger. No need to worry about storage limits.
  6. No limit on Bandwidths: No need to fear for the Digg effects. You need not pay for bandwidth usages.
  7. URL redirects and forwards: When you point your custom domain to Blogger, it automatically redirects.
Don't wait! Switch your one now.
Friday, June 12, 2009

Web 2.0 crowned 1 millionth English word


来自美国德州的全球语言监测机构证明:Web 2.0 成为了第一百万个英文单词。连接

全球语言监测机构/Global Language Monitor 认为某个新单词在媒体和网站上使用超过2.5w次之后便被承认是一个新词进入词典(例如twitter facebook 等),所以按照这个频率,每98分钟就有一个新单词诞生。而类似这样累计所产生的第一百万个单词正好就是:Web 2.0

What happened to Leaning Tower of Pisa?

What a hell! "Who wrapped Leaning Tower with <i></i>" This was the first impression for me when I saw the famous Leaning Tower of Pisa in Italy last month. I tried my best to push it back from the other side.

Hahaha enjoy it!


Thursday, June 11, 2009

iGoogle gadget for Stuff.co.nz

I have been working on building an iGoogle gadget for Stuff.co.nz.


Wednesday, June 3, 2009

SEO Tips: Effective HEADING tags H1 H2 H3

Similar to how newspapers and magazines use headings and sub-headings to help readers, websites can use special tags in their HTML. These tags not only help human readers read the content, they also help search engine spiders better understand the content on a page and what is most important. It is generally a good idea to use heading tags to help signal to the search engines, what the web page is about. If you are concerned about SEO, then you will want your headings to be as descriptive… within reason.

Search engines such as Google pay special attention to your page’s tag and how much it relates to your content - remember SEO rule number one: if you don’t write it, Google can’t find it! <h1> <h2> <h3> they're held in high regard for SE.

I run through www.stuff.co.nz with website.grader.com, the report tells me all the second level headers H2 and third level headers H3 found by search engines. Obviously, some of the titles within H2 H3 are not the related content which we want to provide to readers, some of the headlines we want to provide to readers are not found by search engine. see the example below:




From the examples we can see, the content in red boxes should be stripped from heading tags, the titles in yellow boxes should be wrapped by heading tags.

I did the same task to www.nytimes.com/, they are doing extremely well.

Stuff.co.nz won three Qantas awards

And lots of things happened in the company when I was away.

An exciting news is Stuff.co.nz won several prestigious Qantas Media Awards including best coverage of breaking news and New Zealand's best blogger for Blog Idol winner Moata Tamaira. At the awards ceremony, held in Wellington on 15th may, the Fairfax Media-owned website also won best website design for the new-look site launched in March.




I am very happy that I had participated in both design and development work of both awarded projects. best coverage of breaking news and best website design.
Tuesday, June 2, 2009

Back from holiday

I was on holiday for 6 weeks, now came back windy cold and rainy Wellington. It's feeling so good to keep away from computers for a while.

I created map that shows where I have been to in my honey moon trip.


View Europe Trip in a larger map

Here are the 17 countries and territories I have been to so far: