获取所安装的Django版本?
1 2 | >>> import django >>> django.VERSION |
Andorid View对象常用方法
- getParent(): Finds the parent widget or container.
- findViewById(): Finds a child widget with a certain ID.
- getRootView(): Gets the root of the tree (e.g., what you provided to the activity via setContentView()).
/res下的子目录说明
- anim: Compiled animation files
- drawable: Bitmaps
- layout: UI/view definitions
- values: Arrays, colors, dimensions, strings, and styles
- xml: Compiled arbitrary XML files, Android-supplied XML readers to read
- raw: Noncompiled raw files (Audio & Video), stream-based APIs to read
Android Resource-Reference Syntax
@[package:]type/name
The type corresponds to one of the resource-type namespaces available in R.java, some of which are:
- R.drawable
- R.id
- R.layout
- R.string
- R.attr
The corresponding types in XML resource-reference syntax are as follows:
- drawable
- id
- layout
- string
- attr
Android ADT 地址
Eclipse 3.5 (Galileo) and 3.6 (Helios)
- Start Eclipse, then select Help > Install New Software….
- Click Add, in the top-right corner.
- 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.
- In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
- In the next window, you’ll see a list of the tools to be downloaded. Click Next.
- Read and accept the license agreements, then click Finish.
- When the installation completes, restart Eclipse.
Eclipse 3.4 (Ganymede)
- Start Eclipse, then select Help > Software Updates…. In the dialog that appears, click the Available Software tab.
- Click Add Site.
- 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.
- 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
- On the subsequent Install window, all of the included tools should be checked. Click Next.
- Read and accept the license agreements, then click Finish.
- When the installation completes, restart Eclipse.
Android SDK r10下载地址
由于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定制主菜单
- 此篇文章讲述了如何定制您的Magento Store的菜单
- 使用CSS隐藏主菜单项
Magento转换URL
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
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
删除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–>