Blog is moved!

Please visit http://rathahin.com

p1

SWFObject 2.0 set wmode to transparent

I develop the Flash Application on facebook. when the application put on page tab, the flash content is over the facebook content in IE and Chrome. I know the issue is just setting the wmode = transparent. I spend full of morning to do, Seem setting wmode is not effect. Then I check the object after page is rendered, the wmode is not set too object tag. The correct should be .

After 30 minutes, I found that I am on the wrong way to set wmode to flash embed object. The wrong way is that I set it in params, but instead, the correct way is set it in attributes.

Here is the correct way:

p1

MacBook Pro 's Battery Trick

After I spend few days on Battery Saving, I found the answer. I decided to note this on my personal blog. This post will write about How to setting to maximize battery life, When you need to plug or disconnect charger, and How to Calibrating your computer's battery for best performance.

 1- How to setting to maximize batter life.

  • Setting light to confortable level, e.g.: 3 or 4 bars
  • Turn off the keyboard back light, It is not important to turn on when you work on day light.
  • Close all applications that you don't use it. Look on the dock bar, Secondary (Right) click , then choose Quit to unused application
  • Turn off, Bluetooth, Disconnect or Reject DVD, Flash Drive.
2- When you need to plug or disconnect charger


Here is the table that show the maximum Cycle of battery of each model (Apple.com)

MacBook (13-inch, Mid 2010)
MacBook (13-inch, Late 2009)
1000
MacBook (13-inch Aluminum, Late 2008)500
MacBook (Mid 2009)
MacBook (Early 2009)
MacBook (Late 2008)
MacBook (Early 2008)
MacBook (Late 2007)
MacBook (Mid 2007)
MacBook (Late 2006)
MacBook (13-inch)
300
MacBook Pro (13-inch, Early 2011)
MacBook Pro (13-inch, Mid 2010)
MacBook Pro (13-inch, Mid 2009)
MacBook Pro (15-inch, Early 2011)
MacBook Pro (15-inch, Mid 2010)
MacBook Pro (15-inch, 2.53 GHz, Mid 2009)
MacBook Pro (15-inch Mid 2009)
MacBook Pro (17-inch, Early 2011)
MacBook Pro (17-inch, Mid 2010)
MacBook Pro (17-inch, Mid 2009)
MacBook Pro (17-inch, Early 2009)
1000
MacBook Pro (15-inch Late 2008)500
MacBook Pro (15-inch, Early 2008)
MacBook Pro (15-inch, 2.4/2.2GHz)
MacBook Pro (15-inch, Core 2 Duo)
MacBook Pro (15-inch Glossy)
15-inch MacBook Pro
MacBook Pro (17-inch, Late 2008)
MacBook Pro (17-inch, Early 2008)
MacBook Pro (17-inch, 2.4GHz)
MacBook Pro (17-inch Core 2 Duo)
MacBook Pro (17-inch)
300
MacBook Air (11-inch, Late 2010)
MacBook Air (13-inch, Late 2010)
1000
MacBook Air (Mid 2009)500
MacBook Air (Late 2008)
MacBook Air (Early 2008)
300
All PowerBook G4 12" 15" and 17" computers300
All iBook G4 12" and 14" computers300
 A charge cycle means using all of the battery’s power, but that doesn’t necessarily mean a single charge. For instance, you could use your notebook for an hour or more one day, using half its power, and then recharge it fully. If you did the same thing the next day, it would count as one charge cycle, not two, so it may take several days to complete a cycle.


By this information, I understand that, if we charge the battery to full (100%) we need to disconnect charger, because some people said that, they replace their battery in a year by the this reason (continue charge).


When the battery drop to below 85%, if I am at home or available place (Cafe, or meeting room) I need to connect charger again till it charge to full (100%), This will be prevent from load cycle increase 1 or 2. 


But few time per month, I need to use my Mac for alone time, so I cannot plug charger or connect charger. But that is not a problem. Because we have 1000 load cycle = more than 3years. So that is not a unusual case. 


3- How to Calibrating your computer's battery for best performance


This will help keep system calculate the battery correctly.

  1. Plug in the power adapter and fully charge your PowerBook's battery until the light ring or LED on the power adapter plug changes to green and the onscreen meter in the menu bar indicates that the battery is fully charged.
  2. Allow the battery to rest in the fully charged state for at least two hours. You may use your computer during this time as long as the adapter is plugged in.
  3. Disconnect the power adapter while the computer still on and start running the computer off battery power. You may use your computer during this time. When your battery gets low, the low battery warning dialog appears on the screen.
  4. At this point, save your work.  Continue to use your computer; when the battery gets very low, the computer will automatically go to sleep.
  5. Turn off the computer or allow it to sleep for five hours or more.
  6. Connect the power adapter and leave it connected until the battery is fully charged again.

[UPDATE]
It is OK to leave your battery hooked to the charger most of the time. The only time I unhook mine from the charger is when I calibrate. You shouldcalibrate your battery once a month.

The following links have good information about the MacBook and the care of it's battery.

MacBook reduces processor speed when battery is removed while operating from an A/C adaptor

Apple portable computer's battery does not show a full charge in Mac OS X

Apple Notebook Batteries

Lithium-ion Batteries

MacBook: How to remove or install the battery

Determining Battery Cycle Count

Use and cleaning of MagSafe power connector

Look here for some good tips about battery care.

p1

HTML Cut up for Mail Template or Newsletter

In this article, I am writing by summary from the article that posted on this URL http://www.sitepoint.com/code-html-email-newsletters/

There are important to note is that Mail Template is not going to show on web browser, but Email Client. Mail clients are light years behind the eight-ball in terms of CSS support, which means that we must resort to using tables for layout if we really want our newsletters to display consistently for every reader

Whether you choose to code your HTML email by hand (my personal preference) or to use an existing template, there are two fundamental concepts to keep in mind when creating HTML email:
  •     Use HTML tables to control the design layout and some presentation. You may be used to using pure CSS layouts for your web pages, but that approach just won’t hold up in an email environment.
  •     Use inline CSS to control other presentation elements within your email, such as background colors and fonts.
1: Use HTML Tables for Layout
Recommended to use one column or two column layout.
  • For a two-column layout, create one table each for the header, the two center content columns, and the footer — that’s three tables in all. Wrap these tables into another container table. Use the same approach for single-column layouts, but give the content table one column. This approach is especially suitable if the design of your email contains images that are broken up over multiple table cells. Otherwise, a single table with td rows for its header (with colspan="2" if the design uses two columns), content, and footer should display fine in all but Lotus Notes email software.
  • Use the attributes within the table and td tags to control the table’s display. For example, setting border="0", valign="top", align="left" (or center, if that suits the design), cellpadding="0", cellspacing="0", and so on. This primarily helps older email clients to display the email in a (barely) acceptable way.
  • Even if the design of your email doesn’t include a border around your table, you might find it helpful during development to set border="1" to help with the debugging of any problems that arise with the internal alignment of tr and td tags. Change it back to border="0" for testing and production.
 
2: Use Inline CSS
  • CSS style declarations appear below the body tag, not between the head tags.
  • No CSS shorthand is used: instead of using the abbreviated style rule font: 12px/16px Arial, Helvetica, you should instead break this shorthand into its individual properties: font-family, font-size, and line-height.
  • spans and divs are used sparingly to achieve specific effects, while HTML tables do the bulk of the layout work.
  • CSS style declarations are very basic, and do not make use of any CSS.
 Important Note:
  • Sometimes, a switch from percentage widths to fixed widths is needed. While this is not ideal — because readers can and do resize their email windows while reading — sometimes, using a fixed width is the only way to have a layout to display properly in multiple email clients.
  • If there’s a spacing issue with the columns in the email design, first tweak the cellpadding and cellspacing attributes of the HTML tables. If that doesn’t work, apply CSS margin and padding attributes. HTML spacing works better with older email software.
  • Image displacement can occur when a td cell is closed right below an img tag. This is an ancient HTML problem. Putting the tag right after (on the same line as) the img tag eliminates the annoying and mystifying 1-pixel gap.
  • Avoid using JavaScript. Most email software will disable it anyway.
  • If an image is sliced up and spread across several HTML table cells, test the email using many test accounts. Sometimes, it might look great in Outlook but be shifted by one or more pixels in Hotmail and other services. Also consider making the image a background image on a new HTML table that encases all of the table rows and columns that would display parts of your background image; this often achieves the same effect as slicing an image up, but uses less code and can provide better results (see below). Note that Outlook 2007 does not display background images; be sure to test your email code with your target email software.
  • For background images, use the table’s background attribute instead of using CSS. This works more consistently across email software than other potential solutions.
  • Store the email images on a web server — preferably in a folder that’s separate from your web site’s images (for example, in a folder called /images/email), and don’t delete them. Some people open emails weeks or months later, the same way people use bookmarks to return to web sites.
  • Be sure all your images use the alt, height, and width attributes. Setting values for these attributes improves results in Google Mail, as well as maintaining your layout when a reader has their images turned off. Note, however, that Outlook 2007 does not recognize the alt attribute.
  • Use the target="_blank" attribute for the a tags, so that people who read with webmail services don’t have the requested page appear within their webmail interface.
  • While a 1×1-pixel image can be used to force spacing to create a precise email layout, spammers often use 1×1-pixel images to determine if their email has been opened. As such, using this practice will increase the likelihood that your email is classified as spam.
  • Similarly, avoid using a large image "above the fold" in the email. This is another classic spammer practice and may cause your email to be interpreted as spam.
(Note for old email client)
  • Define the background color in a td cell with the bgcolor attribute, not the CSS style.
  • As noted above, use the background attribute in the td cell for background images instead of using CSS. One side-effect of this approach is that the background image can be made as tall as needed — if the content used in your email template is likely to vary in size, using an extra-tall background image in this way allows the height of the email shrink or expand, depending on the height of the copy, from one email to the next. Remember, though, that Outlook 2007 ignores background images completely.
  • If it works better, use the padding declaration to control margins within a td cell. The margin style does not work in these cells, but padding does.
  • If you need a border around a td cell, keep in mind that Google Mail displays a border around a td cell when it’s defined in a div, but not when it’s defined as a border style in a td tag.
  • If you need a light-colored link against a dark background color, put the font definition in the td cell (so it applies to p and a tags equally) then add a color: style to the a tag.
  • If the p and a fonts appear to be different sizes, wrap the a tag in a p tag.
  • Google Mail aggressively uses the right-hand column of the Google Mail user interface, which squeezes the HTML email into the center panel. Be sure the padding style in the content tds is set to 10 pixels all round, so that text does not hit against the left and right edges.
  • When testing an HTML email with a Google Mail account, it’s likely that you’ll find that one or more font styles are missing in the td, h1, h2, p, a, and other tags. Inspect every font carefully to make sure Google Mail displays the fonts correctly.


p1

Adobe release display3D classes fro Actionscript 3

Display3D ... Add latest flash player package to Project Library Goto http://www.adobe.com/support/flashplayer/downloads.html Find: PlayerGlobal (.swc) , the click on link below to download swc Copy swc to project folder, then open project with FlashDevelop , then right click Add to library. And now you can use Display3D class in your Flash Application. [notice]: refining

p1