天生我才必有用

Android ADT 地址

Posted in 技术    作者:Ray    2011年三月13日

Eclipse 3.5 (Galileo) and 3.6 (Helios)

  1. Start Eclipse, then select Help > Install New Software….
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter “ADT Plugin” for the Name and the following URL for the Location:

    https://dl-ssl.google.com/android/eclipse/

    Note: If you have trouble acquiring the plugin, try using “http” in the Location URL, instead of “https” (https is preferred for security reasons).

    Click OK.

  4. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  5. In the next window, you’ll see a list of the tools to be downloaded. Click Next.
  6. Read and accept the license agreements, then click Finish.
  7. When the installation completes, restart Eclipse.

Eclipse 3.4 (Ganymede)

  1. Start Eclipse, then select Help > Software Updates…. In the dialog that appears, click the Available Software tab.
  2. Click Add Site.
  3. In the Add Site dialog that appears, enter this URL in the “Location” field:

    https://dl-ssl.google.com/android/eclipse/

    Note: If you have trouble acquiring the plugin, you can try using “http” in the URL, instead of “https” (https is preferred for security reasons).

    Click OK.

  4. Back in the Available Software view, you should see the plugin listed by the URL, with “Developer Tools” nested within it. Select the checkbox next to Developer Tools, which will automatically select the nested tools. Then click Install
  5. On the subsequent Install window, all of the included tools should be checked. Click Next.
  6. Read and accept the license agreements, then click Finish.
  7. When the installation completes, restart Eclipse.
标签:

Android SDK r10下载地址

Posted in 技术    作者:Ray    2011年三月13日

由于developer.android.com无法连接,但实际的地址其实是可以连接上的,记录一下。

Platform Package Size MD5 Checksum
Windows android-sdk_r10-windows.zip 32832260 bytes 1e42b8f528d9ca6d9b887c58c6f1b9a2
installer_r10-windows.exe (Recommended) 32878481 bytes 8ffa2dd734829d0bbd3ea601b50b36c7
Mac OS X (intel) android-sdk_r10-mac_x86.zip 28847132 bytes e3aa5578a6553b69cc36659c9505be3f
Linux (i386) android-sdk_r10-linux_x86.tgz 26981997 bytes c022dda3a56c8a67698e6a39b0b1a4e0
标签:

Magento定制主菜单

Posted in PHP    作者:Ray    2011年三月10日
标签:

Magento转换URL

Posted in PHP    作者:Ray    2011年三月4日

Get the base url

1
2
3
4
5
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); // default
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

Get the skin url

1
$this->getSkinUrl();
标签:

@font-face support across browsers

Posted in 技术,网站设计    作者:Ray    2011年三月4日

EOT: Internet Explorer

The EOT (Embedded Open Type) format typefaces are supported in all versions of Internet Explorer.

TTF: Safari, Opera, Chrome, and Firefox

Safari version 3.2 onwards, Opera version 10 onwards, Firefox version 3.5 onwards, and all versions of Chrome support the TTF (TrueType Format) for typefaces in @font-face.

OTF: Safari, Opera, Chrome, and Firefox

Similarly to the TrueType Format, OTF (OpenType Format) is supported by Safari version 3.2 onwards, Opera version 10 onwards, Firefox version 3.5  onwards, and all versions of Chrome support the TTF (TrueType Format) for typefaces in @font-face.

SVG: iPhone and Chrome

The SVG (Scalable Vector Graphics format) is supported by the iPhone and Chrome browsers. SVG font files are specially formatted .svg files that contain vector graphics for each glyph and character of the typeface it represents, allowing for easy scalability.

WOFF: Firefox

The WOFF (Web Open Font Format) is currently supported by Firefox, but is in the process of becoming a standard for font formats across all major browsers, including those by Opera, Microsoft, and Mozilla.

标签:

Magento定制Sidebar

Posted in PHP,技术    作者:Ray    2011年三月3日

删除Paypal Partner

<remove name=”paypal.partner.right.logo” />  <!–paypal logo–>

删除Community Poll

<remove name=”right.poll”/>
<remove name=”left.poll”/>

删除Tags

<remove name=”tags_popular”/>

删除Compare Products

<remove name=”catalog.compare.sidebar” />  <!–product compare–>

删除Reorder

<remove name=”sale.reorder.sidebar”/>

删除WishList

<remove name=”wishlist_sidebar”/>

删除Dog

<remove name=”left.permanent.callout” />  <!–the dog–>

删除Back to School

<remove name=”right.permanent.callout” />  <!–back to school–>

删除购物车

<remove name=”cart_sidebar” /> <!–cart sidebar–>

删除recently viewed product

<remove name=”left.reports.product.viewed” /> <!–recently viewed prod–>
<remove name=”right.reports.product.viewed” /> <!–recently viewed prod–>

删除recently compared product

<remove name=”right.reports.product.compared” /> <!–recently compared prod–>

更多信息请参考Turning On and Off Magento’s Default Blocks

标签:

Drupal 测试邮件发送

Posted in PHP    作者:Ray    2011年三月3日

Reroute Email模块可以帮助你进行邮件发送的测试。

This module intercepts all outgoing emails from a Drupal site and reroutes them to a predefined configurable email address.

This is useful in case where you do not want email sent from a Drupal site to reach the users. For example, if you copy a live site to a test site for the purpose of development, and you do not want any email sent to real users of the original site. Or you want to check the emails sent for uniform formatting, footers, …etc.

This is also a good demonstration of what hook_mail_alter(), available in Drupal 5.x and later, can do.

标签:

jQuery fadeIn() & fadeOut(): Problems in Internet Explorer

Posted in Javascript,技术    作者:Ray    2011年三月2日

I’ve noticed that when I use the jQuery .fadeIn() or .fade­Out() method I see ugly pix­e­lated text in Inter­net Explorer after the ani­ma­tion has com­pleted. This seems to be related to an issue with an IE spe­cific style fil­ter called clearType. To solve the prob­lem, you need to remove the clearType fil­ter after your jQuery ele­ment has faded in. There are a few ways to do this:

Pre­view / Sam­ple / Demonstration

3 Ways to Fix The Issue

1. Add a Back­ground Color

Set a back­ground color with CSS on the ele­ment that is fad­ing in or out. This is the most basic way to solve the problem.

2. Remove the clearType Filter

After fad­ing in an ele­ment you can add this sim­ple call­back func­tion to fix the bug.

1
2
3
$('#fadingElement').fadeIn(2000, function(){
    $(this).css('filter','');
});

3. Use a Cus­tom fadeIn/Out Method

This method serve’s as a replace­ment for the built-in fadeIn() & fade­Out() meth­ods for jQuery.
After you add this method to your JavaScript, change your ‘fade­Out’ to ‘cus­tom­Fade­Out’ and your ‘fadeIn’ to ‘cus­tom­FadeIn’. See a sam­ple of this method on the demo page. Thanks to Ben­jamin Novakovic for writ­ing this jQuery plugin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(function($) {
	$.fn.customFadeIn = function(speed, callback) {
		$(this).fadeIn(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeOut = function(speed, callback) {
		$(this).fadeOut(speed, function() {
			if(jQuery.browser.msie)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
})(jQuery);

Ugly Tran­si­tions on Ani­mated Elements

When you ani­mate any­thing in IE there is an ugly tran­si­tion effect that occurs before the fix is applied. There’s no way to pre­vent or fix clearType while the fade occurs. A work-around is to fade some­thing else, like a <div> on top that fades in, rather than your text content.

Advanced Sce­nar­ios

There are more IE related issues that peo­ple have men­tioned see­ing in advanced setups as well.

I found that the answer was to set the z-index. I have a stack of absolutely posi­tioned divs and wanted to fade between them. The only way I could get IE8 to han­dle the fades nicely was to set the z-index of the ele­ment to be faded in higher than the ele­ment to be faded out i.e.:

A demon­stra­tion for Al’s fix has been added to the demo page

原文出处:http://www.kevinleary.net/jquery-fadein-fadeout-problems-in-internet-explorer/

标签:

专家指出IT人士十大不良饮食习惯及改进建议

Posted in 闲暇人生    作者:Ray    2011年三月1日

忙碌的IT一族大部分不太注重自己的饮食习惯,等到胃病、糖尿病、肥胖这些疾病找上门时,方知是平时饮食坏习惯导致……

不吃早餐

指控:严重伤胃,使你无法精力充沛地工作,而且还容易“显老”。德国埃朗根大学研究人员在对7000个男女的长期跟踪后发现,习惯不吃早餐的人占到了 40%,而他们的寿命比其余60%的人平均缩短了2.5岁。而另一所大学在一次对 80-90岁老年人的研究中发现,他们长寿的共同点之一是:每天吃一顿丰盛的早餐。
处罚决定:早餐食物尽量做到可口、开胃有足够的数量和较好的质量体积小,热能高制备省时省力在食物的选择上要注意干稀搭配,荤素兼备。

晚餐太丰盛

指控:傍晚时血液中胰岛素的含量为一天中的高峰,胰岛素可使血糖转化成脂肪凝结在血管壁上和腹壁上,晚餐吃得太丰盛,久而久之,人便肥胖起来。同时,持续时间通常较长的丰盛晚餐,还会破坏人体正常的生物钟,容易使人患上失眠。
处罚决定:第一,晚餐要早吃,可大大降低尿路结石病的发病率。第二,晚餐要素吃。晚餐一定要偏素,尤其应多摄入一些新鲜蔬菜,尽量减少过多的蛋白质、脂肪类食物的摄入。第三,晚餐要少吃。一般要求晚餐所供给的热量不超过全日膳食总热量的30%。

嗜饮咖啡

指控:1.降低受孕率。每天每人喝一杯咖啡,受孕率就有可能下降50%。2.容易患心脏病。咖啡中含有高浓度的咖啡因,可使心脏功能发生改变并使血管中的胆固醇增高。3.降低工作效率。
处罚决定:少喝。

宴席不离生食

指控:导致各种寄生虫病。
处罚决定:1.每天饮用新鲜蔬菜汁和果汁。2.将新鲜蔬菜凉拌,可酌量加醋,少放盐。3.先吃水果等生食,然后再吃熟食,不会出现白血球增高的现象。

水果当主食

指控:造成人体缺乏蛋白质等物质,营养失衡,甚至引发疾病。
处罚决定:先上网看看你的体质适合吃什么不能吃什么。

进食速度过快

指控:加重肠胃负担,导致肥胖。进食速度过快,食物未得到充分咀嚼,不利于口中食物和唾液淀粉酶的初步消化,加重肠胃负担咀嚼时间过短,迷走神经仍在过度兴奋之中,长此以往,容易因食欲亢进而肥胖。
处罚决定:尽可能让牙齿和舌头动得慢一点。

饮水不足

指控:导致脑老化;诱发脑血管及心血管疾病;影响肾脏代谢功能。
处罚决定:多喝水,勤上洗手间。

食用酒精过量摄入

指控:大量或经常饮酒,会使肝脏发生酒精中毒而致发炎、肿大,影响生殖、泌尿系统。
处罚决定:要喝就得先学会怎么喝。从健康角度看,以饮红葡萄酒为优。每天下午两时以后饮酒较安全。因为上午胃中分解酒精的酶——酒精脱氢酶浓度低,饮用等 量的酒,较下午更易吸收,对肝、脑等器官造成较大伤害。此外,空腹、睡前、感冒或情绪激动时也不宜饮酒。一个体重60公斤的人每天允许摄入的酒精量应限制 在60克以下。从酒精的代谢规律看,最佳佐菜当推高蛋白和含维生素多的食物,切忌用咸鱼、香肠、腊肉下酒,因为此类熏腊食品含有大量色素与亚硝胺,与酒精 发生反应,不仅伤肝,而且损害口腔与食道黏膜,甚至诱发癌症。

餐后吸烟

指控:饭后吸一支烟,中毒量大于平时吸十支烟的总和。因为人在吃饭以后,胃肠蠕动加强,血液循环加快,这时人体吸收烟雾的能力进入“最佳状态”,烟中的有毒物质比平时更容易进入人体。
处罚决定:全面禁烟。

保温杯泡茶

指控:茶叶用80℃左右的水冲泡比较适宜,如果用保温杯长时间把茶叶浸泡在高温的水中,就如同用微火煎煮一样,会破坏茶叶中的维生素,使茶香油大量挥发,鞣酸、茶碱大量渗出。
处罚决定:换杯子。

标签: ,

Drupal 7常用theme hooks

Posted in PHP    作者:Ray    2011年三月1日

file_link
Returns HTML for a link to a file.

html_tag
Returns HTML for a generic HTML tag with attributes. This can often be too generic a theme hook to use, but is really useful for adding a tag to the of a document or for theming a tag inside a render element.

image
Returns HTML for an image. image_style Returns HTML for an image using a specific image style.

item_list
Returns HTML for a list of items which can optionally be nested.

links
Returns HTML for a list of links (cannot be nested).

more_link
Returns HTML for a more link, often used on blocks.

pager
Returns HTML for a pager query element, a list of pages for result sets too long for one page.

progress_bar
Returns HTML for an indicator showing a task’s progress.

table
Returns HTML for a table.

username
Returns HTML for a username.

user_list
Returns HTML for a list of users.

user_picture
Returns HTML for a picture configured for the user’s account.

标签: ,