天生我才必有用

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/

标签:

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.

标签: ,

MySQL 修改密码

Posted in 技术,数据库    作者:Ray    2011年二月23日

1.Set the new root password

1
 $ mysqladmin -u root password NEWPASSWORD

2.Change the root password

2
$ mysqladmin -u root -p'oldpassword' password newpass

3.Change MySQL password for other user

3
$ mysqladmin -u vivek -p oldpassword password newpass
标签:

Drupal t函数

Posted in PHP,技术    作者:Ray    2011年二月23日

Drupal supports translation is largely through the t() function.

The function takes an optional second argument。

1
2
$values = array('@user' => $username);
print t('Welcome, @user', $values);

If the placeholder begins with at sign @, then before it inserts the value, Drupal sanitizes the value using its internal check_plain() function.

1
2
$values = array('!url' => 'http://example.com');
print t('The website can be found at !url', $values);

If the placeholder begins with exclamation mark !,  then it will be entered with no escaping. We can do this safely only because we already know the value of URL.

1
2
$values = array('%color' => 'blue');
print t('My favorite color is %color.', $values);

If the placeholder begins with the percent sign %, it tells Drupal  to escape the code and to mark it as emphasized. (The content will be embedded in the em tag)

标签: