<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4244220722295936823</id><updated>2024-12-18T20:05:26.635-08:00</updated><category term="SimpleXML php xml"/><category term="php shopping card session"/><category term="AWS IAM MFA"/><category term="BCNF"/><category term="Ielts"/><category term="NF"/><category term="datebase design"/><category term="excel mysql"/><category term="java printf"/><category term="javascript"/><category term="javascript table"/><category term="php  apache 无法编译 解决方法"/><category term="table"/><category term="unix"/><category term="手表 机芯 品牌"/><category term="电池 型号 国际标准"/><category term="聚合物锂离子电池"/><category term="锂离子电池-锂电池-锂聚合物电池"/><title type='text'>WEST BLUE SKY</title><subtitle type='html'>程序 数据库 网络 市场分析 行业研究</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-5555759819966020097</id><published>2017-11-03T17:47:00.000-07:00</published><updated>2017-11-03T17:47:03.341-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWS IAM MFA"/><title type='text'>How to Delegate Management of Multi-Factor Authentication to AWS IAM Users</title><content type='html'>https://aws.amazon.com/blogs/security/how-to-delegate-management-of-multi-factor-authentication-to-aws-iam-users/</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/5555759819966020097/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/5555759819966020097' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5555759819966020097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5555759819966020097'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2017/11/how-to-delegate-management-of-multi.html' title='How to Delegate Management of Multi-Factor Authentication to AWS IAM Users'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-7337854180808318951</id><published>2014-07-20T18:56:00.001-07:00</published><updated>2014-07-20T18:58:04.851-07:00</updated><title type='text'>Life of a programmer</title><content type='html'>As you can see what my life looks like. Being a programmer like me, you have to well plan your time, update yourself as all ways. But I really enjoy it, quite out of your mind, isn&#39;t &amp;nbsp;it?&lt;div&gt;Well, shit happens, yesterday I sprained my ankle when playing basketball, it wasn&#39;t really hurt at that moment, but it did bump up later on, then I&#39;m very happy that I can find a soundable and official excuse for not hanging out with Brain on Monday. So I can really focus on my recap of .net. Some say life is like a circle, sometimes you just keep doing what you had done before. Well, hopefully I won&#39;t have to start my miserable life again. Pray God I could pass all the exams.&amp;nbsp;&lt;br&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSElvGY3xmUkfnUGeP-_9NeG6zLQ_z2UY5zIWxHt7hMbMz_m8kcYKg-yFE3_6i6X8aanYUhn1cO0gx0yQ0iNJkmCTWwryew3crBP3qc9GMnbrcK9Zk_aHlxcb3nCSydM5f53Ebx1H0wq2u/s640/blogger-image--2007178884.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSElvGY3xmUkfnUGeP-_9NeG6zLQ_z2UY5zIWxHt7hMbMz_m8kcYKg-yFE3_6i6X8aanYUhn1cO0gx0yQ0iNJkmCTWwryew3crBP3qc9GMnbrcK9Zk_aHlxcb3nCSydM5f53Ebx1H0wq2u/s640/blogger-image--2007178884.jpg&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/7337854180808318951/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/7337854180808318951' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7337854180808318951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7337854180808318951'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2014/07/life-of-programmer.html' title='Life of a programmer'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSElvGY3xmUkfnUGeP-_9NeG6zLQ_z2UY5zIWxHt7hMbMz_m8kcYKg-yFE3_6i6X8aanYUhn1cO0gx0yQ0iNJkmCTWwryew3crBP3qc9GMnbrcK9Zk_aHlxcb3nCSydM5f53Ebx1H0wq2u/s72-c/blogger-image--2007178884.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-9032977587675399153</id><published>2013-12-29T03:19:00.000-08:00</published><updated>2013-12-29T03:19:13.908-08:00</updated><title type='text'>Choosing a Verb Tense When Summarizing Speech</title><content type='html'>&lt;h1 style=&quot;background-color: white; border: 0px; font-family: arial, verdana, sans-serif; font-size: 1.67em; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span class=&quot;product-authors&quot; style=&quot;color: #333333; font-size: 12px;&quot;&gt;By&amp;nbsp;&lt;a href=&quot;http://www.dummies.com/search.html?query=Geraldine+Woods&quot; style=&quot;color: #0d56a2;&quot;&gt;Geraldine Woods&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-size: 12px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;product-title&quot; style=&quot;color: #333333; font-size: 12px;&quot;&gt;from&amp;nbsp;&lt;span class=&quot;product-title&quot;&gt;&lt;a href=&quot;http://www.dummies.com/store/product/English-Grammar-For-Dummies-2nd-Edition.productCd-0470546646.html&quot; style=&quot;color: #0d56a2;&quot; target=&quot;_blank&quot; title=&quot;Information about this product: English Grammar For Dummies, 2nd Edition&quot;&gt;English Grammar For Dummies, 2nd Edition&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 8px; margin-top: 8px; padding: 0px;&quot;&gt;
When you are telling a story, you may what to summarize someone else’s speech. Although you can use just about any verb tense to do so, in English different tenses create a different experience for your readers and listeners. Here is an example that uses past tense:&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px;&quot;&gt;
Flipping his hair over each of his three shoulders, the alien&amp;nbsp;&lt;i&gt;told&lt;/i&gt;&amp;nbsp;us about the explosion on his planet. The gas of three rocket tanks&amp;nbsp;&lt;i&gt;caught&lt;/i&gt;&amp;nbsp;fire and&amp;nbsp;&lt;i&gt;destroyed&lt;/i&gt;&amp;nbsp;the spaceport terminal, he&amp;nbsp;&lt;i&gt;said.&lt;/i&gt;&amp;nbsp;He&amp;nbsp;&lt;i&gt;went&lt;/i&gt;&amp;nbsp;on to explain that almost everyone on the planet&amp;nbsp;&lt;i&gt;was affected,&lt;/i&gt;&amp;nbsp;including the volleyball team, which&amp;nbsp;&lt;i&gt;sustained&lt;/i&gt;&amp;nbsp;significant losses. All their courts, he&amp;nbsp;&lt;i&gt;said, were covered&lt;/i&gt;&amp;nbsp;with rubble, and they&amp;nbsp;&lt;i&gt;forfeited&lt;/i&gt;&amp;nbsp;the intergalactic tournament.&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 8px; margin-top: 8px; padding: 0px;&quot;&gt;
The alien’s story is summarized speech. He is not being quoted directly. If he were, the writer would have inserted some of his exact words:&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px;&quot;&gt;
“Oh, the humanity!” he cried.&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 8px; margin-top: 8px; padding: 0px;&quot;&gt;
In the previous summarized speech, the verbs are all in past tense. Although rare, it’s possible to summarize speech in present tense also. Present tense adds an extra dose of drama:&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px;&quot;&gt;
Flipping his hair over each of his three shoulders, the alien&amp;nbsp;&lt;i&gt;tells&lt;/i&gt;&amp;nbsp;us about the explosion on his planet. The gas of three rocket tanks&amp;nbsp;&lt;i&gt;catches&lt;/i&gt;&amp;nbsp;fire and&amp;nbsp;&lt;i&gt;destroys&lt;/i&gt;&amp;nbsp;the spaceport terminal, he&amp;nbsp;&lt;i&gt;says.&lt;/i&gt;&amp;nbsp;He&amp;nbsp;&lt;i&gt;goes&lt;/i&gt;&amp;nbsp;on to explain that almost everyone on the planet&amp;nbsp;&lt;i&gt;is affected,&lt;/i&gt;including the volleyball team, which&amp;nbsp;&lt;i&gt;sustains&lt;/i&gt;&amp;nbsp;significant losses. All their courts, he&amp;nbsp;&lt;i&gt;says, are covered&lt;/i&gt;&amp;nbsp;with rubble, and they&amp;nbsp;&lt;i&gt;forfeit&lt;/i&gt;&amp;nbsp;the intergalactic tournament.&lt;/blockquote&gt;
&lt;div class=&quot;Warning&quot; style=&quot;background-color: white; background-image: url(http://media.wiley.com/spa_assets/R16B060/site/dummies2/include/images/icons/article-warning.gif); background-position: 0px 5px; background-repeat: no-repeat no-repeat; border: 0px; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; height: auto !important; line-height: 20px; margin-bottom: 8px; margin-top: 8px; min-height: 55px; padding: 0px 0px 0px 70px;&quot;&gt;
When reporting information, either present or past tense is acceptable. However, mixing tenses is&amp;nbsp;&lt;i&gt;not&lt;/i&gt;&amp;nbsp;acceptable.&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px;&quot;&gt;
&lt;b&gt;Wrong:&lt;/b&gt;&amp;nbsp;Shakey&amp;nbsp;&lt;i&gt;said&amp;nbsp;&lt;/i&gt;that he&amp;nbsp;&lt;i&gt;had tossed&lt;/i&gt;&amp;nbsp;the salad out the window. It&amp;nbsp;&lt;i&gt;hits&lt;/i&gt;&amp;nbsp;a pedestrian, who&amp;nbsp;&lt;i&gt;sues&amp;nbsp;&lt;/i&gt;for lettuce-related damages. (The first two verbs are in past tense, and the next two are in present tense.)&lt;/blockquote&gt;
&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px;&quot;&gt;
&lt;b&gt;Right:&lt;/b&gt;&amp;nbsp;Shakey&amp;nbsp;&lt;i&gt;said&amp;nbsp;&lt;/i&gt;that he&amp;nbsp;&lt;i&gt;had tossed&lt;/i&gt;&amp;nbsp;the salad out the window. It&amp;nbsp;&lt;i&gt;hit&lt;/i&gt;&amp;nbsp;a pedestrian, who&lt;i&gt;sued&amp;nbsp;&lt;/i&gt;for lettuce-related damages. (All verbs are in a form of the past tense.)&lt;/blockquote&gt;
&lt;div class=&quot;Tip&quot; style=&quot;background-color: white; background-image: url(http://media.wiley.com/spa_assets/R16B060/site/dummies2/include/images/icons/article-tip.gif); background-position: 0px 5px; background-repeat: no-repeat no-repeat; border: 0px; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; height: auto !important; line-height: 20px; margin-bottom: 8px; margin-top: 8px; min-height: 55px; padding: 0px 0px 0px 70px;&quot;&gt;
One special note: When you’re not reporting what someone says, you can make a general statement about something that always happens (someone’s custom or habit) using present tense. You can easily combine such a statement with a story that focuses on one particular incident in the past tense. Therefore, the preceding story may begin in present tense and move to past tense in this way:&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px;&quot;&gt;
Lola&amp;nbsp;&lt;i&gt;excavates&lt;/i&gt;&amp;nbsp;at the town dump every Tuesday afternoon before she&amp;nbsp;&lt;i&gt;attends&lt;/i&gt;&amp;nbsp;choir practice. She often&amp;nbsp;&lt;i&gt;finds&lt;/i&gt;&amp;nbsp;arrowheads, broken pottery, discarded automobile tires, and other items of interest.&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px; margin-bottom: 8px; margin-top: 8px; padding: 0px;&quot;&gt;
Up to here in the story, all the verbs are in present tense because the story tells of Lola’s habits. The story isn’t reporting what someone said. In the next sentence, the story switches to past tense because it examines one particular day in the past.&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; line-height: 20px;&quot;&gt;
One day she&amp;nbsp;&lt;i&gt;discovered&lt;/i&gt;&amp;nbsp;a metal coil about two feet long. On one end of the coil&amp;nbsp;&lt;i&gt;was&lt;/i&gt;&amp;nbsp;a piece of gum. As she thoughtfully&amp;nbsp;&lt;i&gt;removed&lt;/i&gt;&amp;nbsp;the gum and&amp;nbsp;&lt;i&gt;started&amp;nbsp;&lt;/i&gt;to chew, a whistle&lt;i&gt;blew.&lt;/i&gt;&amp;nbsp;Roger&amp;nbsp;&lt;i&gt;sprinted&lt;/i&gt;&amp;nbsp;into the dump at top speed. “Get your hands off my gum,” he&lt;i&gt;exclaimed.&lt;/i&gt;&amp;nbsp;Roger&amp;nbsp;&lt;i&gt;smiled.&lt;/i&gt;&amp;nbsp;His anti-gum-theft alarm&amp;nbsp;&lt;i&gt;had worked&lt;/i&gt;&amp;nbsp;perfectly.&lt;/blockquote&gt;
&lt;div class=&quot;Warning&quot; style=&quot;background-color: white; background-image: url(http://media.wiley.com/spa_assets/R16B060/site/dummies2/include/images/icons/article-warning.gif); background-position: 0px 5px; background-repeat: no-repeat no-repeat; border: 0px; color: #333333; font-family: arial, verdana, sans-serif; font-size: 12px; height: auto !important; line-height: 20px; margin-bottom: 8px; margin-top: 8px; min-height: 55px; padding: 0px 0px 0px 70px;&quot;&gt;
When you’re revising a paragraph on the writing section of the SAT I or the English portion of the ACT, keep your eye out for verb-tense errors.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/9032977587675399153/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/9032977587675399153' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/9032977587675399153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/9032977587675399153'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2013/12/choosing-verb-tense-when-summarizing.html' title='Choosing a Verb Tense When Summarizing Speech'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-5733335907986148400</id><published>2013-10-30T18:06:00.002-07:00</published><updated>2013-10-30T18:06:17.841-07:00</updated><title type='text'>Good practice in Magento theming</title><content type='html'>&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;There are a number of points that a good Magento theme will typically abide by:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif; font-size: large;&quot;&gt;&amp;nbsp;The use of only one layout file called local.xml, where any layout updates specific to the custom Magento theme are declared. Additionally, it is considered bad practice to create any layout files with the same name as any layout file in Magento&#39;s base theme.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif; font-size: large;&quot;&gt;&amp;nbsp;Similarly, there should be no CSS files within your theme&#39;s skin that use the same name as any CSS file in the default skin.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif; font-size: large;&quot;&gt;Restricting any .phtml (Magento template files) to just those which have been changed for use with the custom theme. Adhering to these guidelines of Magento theming make it easier to upgrade your Magento installation without making changes to your theme files.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/5733335907986148400/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/5733335907986148400' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5733335907986148400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5733335907986148400'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2013/10/good-practice-in-magento-theming.html' title='Good practice in Magento theming'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-3435257890718318130</id><published>2013-03-11T21:00:00.000-07:00</published><updated>2013-03-11T21:00:36.142-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript table"/><title type='text'>jquery-table management2</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$(&#39;td&#39;).click(function(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var colIndex = $(this).parent().children().index($(this));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var rowIndex = $(this).parent().parent().children().index($(this).parent());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&#39;Row: &#39; + rowIndex + &#39;, Column: &#39; + colIndex);&lt;br /&gt;});</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/3435257890718318130/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/3435257890718318130' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/3435257890718318130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/3435257890718318130'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2013/03/jquery-table-management2.html' title='jquery-table management2'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-7843019405753288891</id><published>2013-03-11T20:59:00.001-07:00</published><updated>2013-03-11T20:59:12.452-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="table"/><title type='text'>Javascript-table management1</title><content type='html'>&lt;div&gt;
to alert the text value of each td&lt;/div&gt;
&lt;div class=&quot;__zd_findAndReplace&quot; style=&quot;background-color: #efefef; float: right; margin-right: 30px; padding: 0px 3px; text-align: right;&quot;&gt;
&lt;span style=&quot;color: blue; cursor: pointer; font: normal 10px trebuchet ms,arial; text-decoration: underline;&quot;&gt;Copy code&lt;/span&gt;&lt;/div&gt;
&lt;ol class=&quot;code&quot;&gt;
&lt;li&gt;$(&#39;table tr td&#39;).each(function(){&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;var texto = $(this).text();&lt;/li&gt;
&lt;li&gt;});&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
if you want the value of the first row second column, otherwise known as row 1 cell 2 or position(1,2),&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;__zd_findAndReplace&quot; style=&quot;background-color: #efefef; float: right; margin-right: 30px; padding: 0px 3px; text-align: right;&quot;&gt;
&lt;span style=&quot;color: blue; cursor: pointer; font: normal 10px trebuchet ms,arial; text-decoration: underline;&quot;&gt;Copy code&lt;/span&gt;&lt;/div&gt;
&lt;ol class=&quot;code&quot;&gt;
&lt;li&gt;var texto = $(&#39;table tr:nth-child(1) td:nth-child(2)&#39;).text()&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/7843019405753288891/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/7843019405753288891' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7843019405753288891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7843019405753288891'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2013/03/javascript-table-management1.html' title='Javascript-table management1'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-6447418755228954504</id><published>2012-10-19T05:17:00.003-07:00</published><updated>2012-10-19T05:17:51.325-07:00</updated><title type='text'>Random</title><content type='html'>Maybe its just a&amp;nbsp;coincident, yesterday&#39;s English Conversation Club, Kai and I both expressed the same weird interest, we like storm, Olivi even remind me that, there are two different kinds, okay, it must be the one came this morning, huge&amp;nbsp;down-pow in very short time range.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
That&#39;s also became my ideal good excuse, I can&#39;t go to Uni. Today supposed be a very easy day for me, however, it ends like a long day for me. Spending too much time in from of the computer.&lt;/div&gt;
&lt;div&gt;
There are two thing is happening, one is Chinese new&amp;nbsp;portals seem don&#39;t update news that often, another thing come into my mind is that, &quot;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;Do you not know that you are&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;background-color: white; font-family: arial, sans-serif; font-size: small; font-style: normal; font-weight: bold; line-height: 16px;&quot;&gt;God&#39;s Sanctuary&lt;/em&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;, and that the&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;background-color: white; font-family: arial, sans-serif; font-size: small; font-style: normal; font-weight: bold; line-height: 16px;&quot;&gt;Spirit&lt;/em&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;&amp;nbsp;of&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;background-color: white; font-family: arial, sans-serif; font-size: small; font-style: normal; font-weight: bold; line-height: 16px;&quot;&gt;God&lt;/em&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;&amp;nbsp;has His home within you&lt;/span&gt;&quot;. How could I take care of His Sanctuary, how could I get rid of sin?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Recently, I was reading a novel borrowed from library, finding that it is very hard to keep reading it for me, it&#39;s very Aussie style, but can&#39;t read into it.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/6447418755228954504/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/6447418755228954504' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/6447418755228954504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/6447418755228954504'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2012/10/random.html' title='Random'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-1957938859780850262</id><published>2012-09-02T05:07:00.000-07:00</published><updated>2012-09-02T05:07:22.906-07:00</updated><title type='text'>2012 father&#39;s day reflection</title><content type='html'>After had a great Sunday services at Mitcham&amp;nbsp;Baptiste church, I played a little bit basketball with some little boys at church. Then some body suggest to have lunch in the city, so a exhausting and&amp;nbsp;frustrated&amp;nbsp;journey started. 6 ppl I guess we spent about 1 hour trying to find a restaurant which could celebrate Father day together. Like most American TV programs tries to tell, when things start going unsuccessfully, people start to have their opinions. Thanks God we conquered that angers from us, still had a&amp;nbsp;pretty good lunch even though its place was not&amp;nbsp;terrific, you know what kind of food you could get from food court. I mean food court. Chatting was great.&lt;br /&gt;
The down point of today is the moment I called my dad tried to said “Happy father&#39;s day.&quot; However, he interrupt my by question about my English Friend. Even though I did little be upset by his argument, I still wish he could have a good Father&#39;s day.&lt;br /&gt;
I think it&#39;s time to back to the track now.</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/1957938859780850262/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/1957938859780850262' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/1957938859780850262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/1957938859780850262'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2012/09/2012-fathers-day-reflection.html' title='2012 father&#39;s day reflection'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-9078944206140625441</id><published>2012-08-17T04:54:00.000-07:00</published><updated>2012-08-17T04:54:05.449-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ielts"/><title type='text'>Phrasal Verbs</title><content type='html'>&lt;i&gt;English speaking countries like Australia, people uses a lot of phrasal Verbs, at the beginning you may feel very strange about it, thought all the words are very simple and familiar, your mind just couldn&#39;t catch up with them.
Don&#39;t worry about it, because they are using phrasal verbs.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
sourcing from:http://www.englishclub.com/vocabulary/phrasal-verbs-list.htm&lt;br /&gt;&lt;h1&gt;
Phrasal Verbs List&lt;/h1&gt;
Phrasal verbs are usually two-word phrases consisting of &lt;b&gt;verb + adverb&lt;/b&gt; or &lt;b&gt;verb + preposition&lt;/b&gt;.
 Think of them as you would any other English vocabulary. Study them as 
you come across them, rather than trying to memorize many at once. Use 
the list below as a reference guide when you find an expression that you
 don&#39;t recognize. The examples will help you understand the meanings. If
 you think of each phrasal verb as a separate verb with a specific 
meaning, you will be able to remember it more easily. Like many other 
verbs, phrasal verbs often have more than one meaning.&lt;br /&gt;

&lt;div class=&quot;ECtip&quot;&gt;
This list shows about 200 common phrasal verbs, with 
meanings and examples. Only the most usual meanings are given. Some 
phrasal verbs may have additional meanings.&lt;/div&gt;
As well as learning their meanings, you need to learn how to use 
phrasal verbs properly. Some phrasal verbs require a direct object (&lt;i&gt;someone/something&lt;/i&gt;), while others do not. Some phrasal verbs can be separated by the object, while others cannot. Review this &lt;a href=&quot;http://www.englishclub.com/grammar/verbs-phrasal-verbs.htm&quot;&gt;phrasal verbs grammar&lt;/a&gt; from time to time so that you don&#39;t forget the rules!&lt;br /&gt;

&lt;table border=&quot;1&quot; cellpadding=&quot;7&quot; cellspacing=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;Verb&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;ask&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;invite on a date&lt;/td&gt;
&lt;td&gt;Brian &lt;b&gt;asked&lt;/b&gt; Judy &lt;b&gt;out&lt;/b&gt; to dinner and a movie.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;ask around&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;ask many people the same question&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;asked around&lt;/b&gt; but nobody has seen my wallet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;add up to&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;equal&lt;/td&gt;
&lt;td&gt;Your purchases &lt;b&gt;add up to&lt;/b&gt; $205.32.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;back&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;reverse&lt;/td&gt;
&lt;td&gt;You&#39;ll have to &lt;b&gt;back up&lt;/b&gt; your car so that I can get out.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;back&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;support&lt;/td&gt;
&lt;td&gt;My wife &lt;b&gt;backed&lt;/b&gt; me &lt;b&gt;up&lt;/b&gt; over my decision to quit my job.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;blow up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;explode&lt;/td&gt;
&lt;td&gt;The racing car &lt;b&gt;blew up&lt;/b&gt; after it crashed into the fence.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;blow&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;add air&lt;/td&gt;
&lt;td&gt;We have to &lt;b&gt;blow&lt;/b&gt; 50 balloons &lt;b&gt;up&lt;/b&gt; for the party.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stop functioning (vehicle, machine)&lt;/td&gt;
&lt;td&gt;Our car &lt;b&gt;broke down&lt;/b&gt; at the side of the highway in the snowstorm.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;get upset&lt;/td&gt;
&lt;td&gt;The woman &lt;b&gt;broke down&lt;/b&gt; when the police told her that her son had died.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;divide into smaller parts&lt;/td&gt;
&lt;td&gt;Our teacher &lt;b&gt;broke&lt;/b&gt; the final project &lt;b&gt;down&lt;/b&gt; into three separate parts.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;force entry to a building&lt;/td&gt;
&lt;td&gt;Somebody &lt;b&gt;broke in&lt;/b&gt; last night and stole our stereo.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break into&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;enter forcibly&lt;/td&gt;
&lt;td&gt;The firemen had to &lt;b&gt;break into&lt;/b&gt; the room to rescue the children.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;wear something a few times so that it doesn&#39;t look/feel new&lt;/td&gt;
&lt;td&gt;I need to &lt;b&gt;break&lt;/b&gt; these shoes &lt;b&gt;in&lt;/b&gt; before we run next week.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;interrupt&lt;/td&gt;
&lt;td&gt;The TV station &lt;b&gt;broke in&lt;/b&gt; to report the news of the president&#39;s death.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;end a relationship&lt;/td&gt;
&lt;td&gt;My boyfriend and I &lt;b&gt;broke up&lt;/b&gt; before I moved to America.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;start laughing (informal)&lt;/td&gt;
&lt;td&gt;The kids just &lt;b&gt;broke up&lt;/b&gt; as soon as the clown started talking.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;escape&lt;/td&gt;
&lt;td&gt;The prisoners &lt;b&gt;broke out&lt;/b&gt; of jail when the guards weren&#39;t looking.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;break out in&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;develop a skin condition&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;broke out in&lt;/b&gt; a rash after our camping trip.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;bring&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;make unhappy&lt;/td&gt;
&lt;td&gt;This sad music is &lt;b&gt;bringing&lt;/b&gt; me &lt;b&gt;down&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;bring&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;raise a child&lt;/td&gt;
&lt;td&gt;My grandparents &lt;b&gt;brought&lt;/b&gt; me &lt;b&gt;up&lt;/b&gt; after my parents died.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;bring&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;start talking about a subject&lt;/td&gt;
&lt;td&gt;My mother walks out of the room when my father &lt;b&gt;brings up&lt;/b&gt; sports.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;bring&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;vomit&lt;/td&gt;
&lt;td&gt;He drank so much that he &lt;b&gt;brought&lt;/b&gt; his dinner &lt;b&gt;up&lt;/b&gt; in the toilet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;call around&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;phone many different places/people&lt;/td&gt;
&lt;td&gt;We &lt;b&gt;called around&lt;/b&gt; but we weren&#39;t able to find the car part we needed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;call&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;return a phone call&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;called&lt;/b&gt; the company &lt;b&gt;back&lt;/b&gt; but the offices were closed for the weekend.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;call&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;cancel&lt;/td&gt;
&lt;td&gt;Jason &lt;b&gt;called&lt;/b&gt; the wedding &lt;b&gt;off&lt;/b&gt; because he wasn&#39;t in love with his fiancé.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;call on&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;ask for an answer or opinion&lt;/td&gt;
&lt;td&gt;The professor &lt;b&gt;called on&lt;/b&gt; me for question 1.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;call on&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;visit someone&lt;/td&gt;
&lt;td&gt;We &lt;b&gt;called on&lt;/b&gt; you last night but you weren&#39;t home.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;call&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;phone&lt;/td&gt;
&lt;td&gt;Give me your phone number and I will &lt;b&gt;call&lt;/b&gt; you &lt;b&gt;up&lt;/b&gt; when we are in town.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;calm down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;relax after being angry&lt;/td&gt;
&lt;td&gt;You are still mad. You need to &lt;b&gt;calm down&lt;/b&gt; before you drive the car.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;not &lt;b&gt;care for&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;not like (formal)&lt;/td&gt;
&lt;td&gt;I don&#39;t &lt;b&gt;care for&lt;/b&gt; his behaviour.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;catch up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;get to the same point as someone else&lt;/td&gt;
&lt;td&gt;You&#39;ll have to run faster than that if you want to &lt;b&gt;catch up&lt;/b&gt; with Marty.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;check in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;arrive and register at a hotel or airport&lt;/td&gt;
&lt;td&gt;We will get the hotel keys when we &lt;b&gt;check in&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;check out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;leave a hotel&lt;/td&gt;
&lt;td&gt;You have to &lt;b&gt;check out&lt;/b&gt; of the hotel before 11:00 AM.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;check&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;look at carefully, investigate&lt;/td&gt;
&lt;td&gt;The company &lt;b&gt;checks out&lt;/b&gt; all new employees.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;check out&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;look at (informal)&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Check out&lt;/b&gt; the crazy hair on that guy!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cheer up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;become happier&lt;/td&gt;
&lt;td&gt;She &lt;b&gt;cheered up&lt;/b&gt; when she heard the good news.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cheer&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;make happier&lt;/td&gt;
&lt;td&gt;I brought you some flowers to &lt;b&gt;cheer&lt;/b&gt; you &lt;b&gt;up&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;chip in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;help&lt;/td&gt;
&lt;td&gt;If everyone &lt;b&gt;chips in&lt;/b&gt; we can get the kitchen painted by noon.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;clean&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;tidy, clean&lt;/td&gt;
&lt;td&gt;Please &lt;b&gt;clean up&lt;/b&gt; your bedroom before you go outside.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;come across&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;find unexpectedly&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;came across&lt;/b&gt; these old photos when I was tidying the closet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;come apart&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;separate&lt;/td&gt;
&lt;td&gt;The top and bottom &lt;b&gt;come apart&lt;/b&gt; if you pull hard enough.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;come down with&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;become sick&lt;/td&gt;
&lt;td&gt;My nephew &lt;b&gt;came down with&lt;/b&gt; chicken pox this weekend.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;come forward&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;volunteer for a task or to give evidence&lt;/td&gt;
&lt;td&gt;The woman &lt;b&gt;came forward&lt;/b&gt; with her husband&#39;s finger prints.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;come from&lt;/b&gt; somewhere&lt;/td&gt;
&lt;td&gt;originate in&lt;/td&gt;
&lt;td&gt;The art of origami &lt;b&gt;comes from&lt;/b&gt; Asia.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;count on&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;rely on&lt;/td&gt;
&lt;td&gt;I am &lt;b&gt;counting on&lt;/b&gt; you to make dinner while I am out.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cross&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;draw a line through&lt;/td&gt;
&lt;td&gt;Please &lt;b&gt;cross out&lt;/b&gt; your old address and write your new one.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut back on&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;consume less&lt;/td&gt;
&lt;td&gt;My doctor wants me to &lt;b&gt;cut back on&lt;/b&gt; sweets and fatty foods.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;make something fall to the ground&lt;/td&gt;
&lt;td&gt;We had to &lt;b&gt;cut&lt;/b&gt; the old tree in our yard &lt;b&gt;down&lt;/b&gt; after the storm.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;interrupt&lt;/td&gt;
&lt;td&gt;Your father &lt;b&gt;cut in&lt;/b&gt; while I was dancing with your uncle.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;pull in too closely in front of another vehicle&lt;/td&gt;
&lt;td&gt;The bus driver got angry when that car &lt;b&gt;cut in&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;start operating (of an engine or electrical device)&lt;/td&gt;
&lt;td&gt;The air conditioner &lt;b&gt;cuts in&lt;/b&gt; when the temperature gets to 22°C.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;remove with something sharp&lt;/td&gt;
&lt;td&gt;The doctors &lt;b&gt;cut off&lt;/b&gt; his leg because it was severely injured.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stop providing&lt;/td&gt;
&lt;td&gt;The phone company &lt;b&gt;cut off&lt;/b&gt; our phone because we didn&#39;t pay the bill.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;take out of a will&lt;/td&gt;
&lt;td&gt;My grandparents &lt;b&gt;cut&lt;/b&gt; my father &lt;b&gt;off&lt;/b&gt; when he remarried.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;cut&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;remove part of something (usually with scissors and paper)&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;cut&lt;/b&gt; this ad &lt;b&gt;out&lt;/b&gt; of the newspaper.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;do&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt; &lt;b&gt;over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;beat up, ransack (Br.E., informal)&lt;/td&gt;
&lt;td&gt;He&#39;s lucky to be alive. His shop was &lt;b&gt;done over&lt;/b&gt; by a street gang.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;do&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;do again (N.Amer.)&lt;/td&gt;
&lt;td&gt;My teacher wants me to &lt;b&gt;do&lt;/b&gt; my essay &lt;b&gt;over&lt;/b&gt; because she doesn&#39;t like my topic.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;do away with&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;discard&lt;/td&gt;
&lt;td&gt;It&#39;s time to &lt;b&gt;do away with&lt;/b&gt; all of these old tax records.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;do&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;fasten, close&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Do&lt;/b&gt; your coat &lt;b&gt;up&lt;/b&gt; before you go outside. It&#39;s snowing!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;dress up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;wear nice clothing&lt;/td&gt;
&lt;td&gt;It&#39;s a fancy restaurant so we have to &lt;b&gt;dress up&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;drop back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;move back in a position/group&lt;/td&gt;
&lt;td&gt;Andrea &lt;b&gt;dropped back&lt;/b&gt; to third place when she fell off her bike.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;drop in/by/over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;come without an appointment&lt;/td&gt;
&lt;td&gt;I might &lt;b&gt;drop in/by/over&lt;/b&gt; for tea sometime this week.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;drop&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;take someone/something somewhere and leave them/it there&lt;/td&gt;
&lt;td&gt;I have to &lt;b&gt;drop&lt;/b&gt; my sister &lt;b&gt;off&lt;/b&gt; at work before I come over.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;drop out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;quit a class, school etc&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;dropped out&lt;/b&gt; of Science because it was too difficult.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;eat out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;eat at a restaurant&lt;/td&gt;
&lt;td&gt;I don&#39;t feel like cooking tonight. Let&#39;s &lt;b&gt;eat out&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;end up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;eventually reach/do/decide&lt;/td&gt;
&lt;td&gt;We &lt;b&gt;ended up&lt;/b&gt; renting a movie instead of going to the theatre.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;fall apart&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;break into pieces&lt;/td&gt;
&lt;td&gt;My new dress &lt;b&gt;fell apart&lt;/b&gt; in the washing machine.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;fall down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;fall to the ground&lt;/td&gt;
&lt;td&gt;The picture that you hung up last night &lt;b&gt;fell down&lt;/b&gt; this morning.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;fall out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;separate from an interior&lt;/td&gt;
&lt;td&gt;The money must have &lt;b&gt;fallen out&lt;/b&gt; of my pocket.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;fall out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;(of hair, teeth) become loose and unattached&lt;/td&gt;
&lt;td&gt;His hair started to &lt;b&gt;fall out&lt;/b&gt; when he was only 35.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;figure&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;understand, find the answer&lt;/td&gt;
&lt;td&gt;I need to &lt;b&gt;figure out&lt;/b&gt; how to fit the piano and the bookshelf in this room.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;fill&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;to write information in blanks (Br.E.)&lt;/td&gt;
&lt;td&gt;Please &lt;b&gt;fill in&lt;/b&gt; the form with your name, address, and phone number.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;fill&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;to write information in blanks (N.Amer.)&lt;/td&gt;
&lt;td&gt;The form must be &lt;b&gt;filled out&lt;/b&gt; in capital letters.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;fill&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;fill to the top&lt;/td&gt;
&lt;td&gt;I always &lt;b&gt;fill&lt;/b&gt; the water jug &lt;b&gt;up&lt;/b&gt; when it is empty.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;find out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;discover&lt;/td&gt;
&lt;td&gt;We don&#39;t know where he lives. How can we &lt;b&gt;find out&lt;/b&gt;?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;find&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;discover&lt;/td&gt;
&lt;td&gt;We tried to keep the time of the party a secret, but Samantha &lt;b&gt;found&lt;/b&gt; it &lt;b&gt;out&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;across/over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;communicate, make understandable&lt;/td&gt;
&lt;td&gt;I tried to &lt;b&gt;get&lt;/b&gt; my point &lt;b&gt;across/over&lt;/b&gt; to the judge but she wouldn&#39;t listen.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get along/on&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;like each other&lt;/td&gt;
&lt;td&gt;I was surprised how well my new girlfriend and my sister &lt;b&gt;got along/on&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get around&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;have mobility&lt;/td&gt;
&lt;td&gt;My grandfather can &lt;b&gt;get around&lt;/b&gt; fine in his new wheelchair.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get away&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;go on a vacation&lt;/td&gt;
&lt;td&gt;We worked so hard this year that we had to &lt;b&gt;get away&lt;/b&gt; for a week.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get away with&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;do without being noticed or punished&lt;/td&gt;
&lt;td&gt;Jason always &lt;b&gt;gets away with&lt;/b&gt; cheating in his maths tests.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;return&lt;/td&gt;
&lt;td&gt;We &lt;b&gt;got back&lt;/b&gt; from our vacation last week.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;receive something you had before&lt;/td&gt;
&lt;td&gt;Liz finally &lt;b&gt;got&lt;/b&gt; her Science notes &lt;b&gt;back&lt;/b&gt; from my room-mate.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get back at&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;retaliate, take revenge&lt;/td&gt;
&lt;td&gt;My sister &lt;b&gt;got back at&lt;/b&gt; me for stealing her shoes. She stole my favourite hat.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get back into&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;become interested in something again&lt;/td&gt;
&lt;td&gt;I finally &lt;b&gt;got back into&lt;/b&gt; my novel and finished it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get on&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;step onto a vehicle&lt;/td&gt;
&lt;td&gt;We&#39;re going to freeze out here if you don&#39;t let us &lt;b&gt;get on&lt;/b&gt; the bus.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get over&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;recover from an illness, loss, difficulty&lt;/td&gt;
&lt;td&gt;I just &lt;b&gt;got over&lt;/b&gt; the flu and now my sister has it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get over&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;overcome a problem&lt;/td&gt;
&lt;td&gt;The company will have to close if it can&#39;t &lt;b&gt;get over&lt;/b&gt; the new regulations.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get round to&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;finally find time to do (N.Amer.: &lt;b&gt;get around to&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;)&lt;/td&gt;
&lt;td&gt;I don&#39;t know when I am going to &lt;b&gt;get round to&lt;/b&gt; writing the thank you cards.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get together&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;meet (usually for social reasons)&lt;/td&gt;
&lt;td&gt;Let&#39;s &lt;b&gt;get together&lt;/b&gt; for a BBQ this weekend.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;get out of bed&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;got up&lt;/b&gt; early today to study for my exam.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;get up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stand&lt;/td&gt;
&lt;td&gt;You should &lt;b&gt;get up&lt;/b&gt; and give the elderly man your seat.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;away&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;reveal hidden information about someone&lt;/td&gt;
&lt;td&gt;His wife &lt;b&gt;gave&lt;/b&gt; him &lt;b&gt;away&lt;/b&gt; to the police.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;away&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;take the bride to the altar&lt;/td&gt;
&lt;td&gt;My father &lt;b&gt;gave&lt;/b&gt; me &lt;b&gt;away&lt;/b&gt; at my wedding.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;away&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;ruin a secret&lt;/td&gt;
&lt;td&gt;My little sister &lt;b&gt;gave&lt;/b&gt; the surprise party &lt;b&gt;away&lt;/b&gt; by accident.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;away&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;give something to someone for free&lt;/td&gt;
&lt;td&gt;The library was &lt;b&gt;giving away&lt;/b&gt; old books on Friday.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;return a borrowed item&lt;/td&gt;
&lt;td&gt;I have to &lt;b&gt;give&lt;/b&gt; these skates &lt;b&gt;back&lt;/b&gt; to Franz before his hockey game.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;reluctantly stop fighting or arguing&lt;/td&gt;
&lt;td&gt;My boyfriend didn&#39;t want to go to the ballet, but he finally &lt;b&gt;gave in&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;give to many people (usually at no cost)&lt;/td&gt;
&lt;td&gt;They were &lt;b&gt;giving out&lt;/b&gt; free perfume samples at the department store.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;quit a habit&lt;/td&gt;
&lt;td&gt;I am &lt;b&gt;giving up&lt;/b&gt; smoking as of January 1st.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;give up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stop trying&lt;/td&gt;
&lt;td&gt;My maths homework was too difficult so I &lt;b&gt;gave up&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go after&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;follow someone&lt;/td&gt;
&lt;td&gt;My brother tried to &lt;b&gt;go after&lt;/b&gt; the thief in his car.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go after&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;try to achieve something&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;went after&lt;/b&gt; my dream and now I am a published writer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go against&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;compete, oppose&lt;/td&gt;
&lt;td&gt;We are &lt;b&gt;going against&lt;/b&gt; the best soccer team in the city tonight.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go ahead&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;start, proceed&lt;/td&gt;
&lt;td&gt;Please &lt;b&gt;go ahead&lt;/b&gt; and eat before the food gets cold.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;return to a place&lt;/td&gt;
&lt;td&gt;I have to &lt;b&gt;go back&lt;/b&gt; home and get my lunch.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;leave home to go on a social event&lt;/td&gt;
&lt;td&gt;We&#39;re &lt;b&gt;going out&lt;/b&gt; for dinner tonight.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go out with&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;date&lt;/td&gt;
&lt;td&gt;Jesse has been &lt;b&gt;going out with&lt;/b&gt; Luke since they met last winter.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go over&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;review&lt;/td&gt;
&lt;td&gt;Please &lt;b&gt;go over&lt;/b&gt; your answers before you submit your test.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;visit someone nearby&lt;/td&gt;
&lt;td&gt;I haven&#39;t seen Tina for a long time. I think I&#39;ll &lt;b&gt;go over&lt;/b&gt; for an hour or two.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;go without&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;suffer lack or deprivation&lt;/td&gt;
&lt;td&gt;When I was young, we &lt;b&gt;went without&lt;/b&gt; winter boots.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;grow apart&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stop being friends over time&lt;/td&gt;
&lt;td&gt;My best friend and I &lt;b&gt;grew apart&lt;/b&gt; after she changed schools.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;grow back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;regrow&lt;/td&gt;
&lt;td&gt;My roses &lt;b&gt;grew back&lt;/b&gt; this summer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;grow up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;become an adult&lt;/td&gt;
&lt;td&gt;When Jack &lt;b&gt;grows up&lt;/b&gt; he wants to be a fireman.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;grow out of&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;get too big for&lt;/td&gt;
&lt;td&gt;Elizabeth needs a new pair of shoes because she has &lt;b&gt;grown out of&lt;/b&gt; her old ones.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;grow into&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;grow big enough to fit&lt;/td&gt;
&lt;td&gt;This bike is too big for him now, but he should &lt;b&gt;grow into&lt;/b&gt; it by next year.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hand&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;give something used to someone else&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;handed&lt;/b&gt; my old comic books &lt;b&gt;down&lt;/b&gt; to my little cousin.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hand&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;submit&lt;/td&gt;
&lt;td&gt;I have to &lt;b&gt;hand in&lt;/b&gt; my essay by Friday.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hand&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;to distribute to a group of people&lt;/td&gt;
&lt;td&gt;We will &lt;b&gt;hand out&lt;/b&gt; the invitations at the door.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hand&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;give (usually unwillingly)&lt;/td&gt;
&lt;td&gt;The police asked the man to &lt;b&gt;hand over&lt;/b&gt; his wallet and his weapons.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hang in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stay positive (N.Amer., informal)&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Hang in&lt;/b&gt; there. I&#39;m sure you&#39;ll find a job very soon.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hang on&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;wait a short time (informal)&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Hang on&lt;/b&gt; while I grab my coat and shoes!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hang out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;spend time relaxing (informal)&lt;/td&gt;
&lt;td&gt;Instead of going to the party we are just going to &lt;b&gt;hang out&lt;/b&gt; at my place.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hang up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;end a phone call&lt;/td&gt;
&lt;td&gt;He didn&#39;t say goodbye before he &lt;b&gt;hung up&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hold&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt; &lt;b&gt;back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;prevent from doing/going&lt;/td&gt;
&lt;td&gt;I had to &lt;b&gt;hold&lt;/b&gt; my dog &lt;b&gt;back&lt;/b&gt; because there was a cat in the park.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hold&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;hide an emotion&lt;/td&gt;
&lt;td&gt;Jamie &lt;b&gt;held back&lt;/b&gt; his tears at his grandfather&#39;s funeral.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hold on&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;wait a short time&lt;/td&gt;
&lt;td&gt;Please &lt;b&gt;hold on&lt;/b&gt; while I transfer you to the Sales Department.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hold onto&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;hold firmly using your hands or arms&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Hold onto&lt;/b&gt; your hat because it&#39;s very windy outside.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;hold&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;rob&lt;/td&gt;
&lt;td&gt;A man in a black mask &lt;b&gt;held&lt;/b&gt; the bank &lt;b&gt;up&lt;/b&gt; this morning.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;keep on doing&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;continue doing&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Keep on&lt;/b&gt; stirring until the liquid comes to a boil.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;keep&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;from&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;not tell&lt;/td&gt;
&lt;td&gt;We &lt;b&gt;kept&lt;/b&gt; our relationship &lt;b&gt;from&lt;/b&gt; our parents for two years.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;keep&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stop from entering&lt;/td&gt;
&lt;td&gt;Try to &lt;b&gt;keep&lt;/b&gt; the wet dog &lt;b&gt;out&lt;/b&gt; of the living room.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;keep&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;continue at the same rate&lt;/td&gt;
&lt;td&gt;If you &lt;b&gt;keep&lt;/b&gt; those results &lt;b&gt;up&lt;/b&gt; you will get into a great college.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;let&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;fail to support or help, disappoint&lt;/td&gt;
&lt;td&gt;I need you to be on time. Don&#39;t &lt;b&gt;let&lt;/b&gt; me &lt;b&gt;down&lt;/b&gt; this time.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;let&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;in&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;allow to enter&lt;/td&gt;
&lt;td&gt;Can you &lt;b&gt;let&lt;/b&gt; the cat &lt;b&gt;in&lt;/b&gt; before you go to school?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look after&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;take care of&lt;/td&gt;
&lt;td&gt;I have to &lt;b&gt;look after&lt;/b&gt; my sick grandmother.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look down on&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;think less of, consider inferior&lt;/td&gt;
&lt;td&gt;Ever since we stole that chocolate bar your dad has &lt;b&gt;looked down on&lt;/b&gt; me.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look for&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;try to find&lt;/td&gt;
&lt;td&gt;I&#39;m &lt;b&gt;looking for&lt;/b&gt; a red dress for the wedding.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look forward to&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;be excited about the future&lt;/td&gt;
&lt;td&gt;I&#39;m &lt;b&gt;looking forward to&lt;/b&gt; the Christmas break.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look into&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;investigate&lt;/td&gt;
&lt;td&gt;We are going to &lt;b&gt;look into&lt;/b&gt; the price of snowboards today.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;be careful, vigilant, and take notice&lt;/td&gt;
&lt;td&gt;Look out! That car&#39;s going to hit you!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look out for&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;be especially vigilant for&lt;/td&gt;
&lt;td&gt;Don&#39;t forget to &lt;b&gt;look out for&lt;/b&gt; snakes on the hiking trail.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;check, examine&lt;/td&gt;
&lt;td&gt;Can you &lt;b&gt;look over&lt;/b&gt; my essay for spelling mistakes?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;search and find information in a reference book or database&lt;/td&gt;
&lt;td&gt;We can &lt;b&gt;look&lt;/b&gt; her phone number &lt;b&gt;up&lt;/b&gt; on the Internet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;look up to&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;have a lot of respect for&lt;/td&gt;
&lt;td&gt;My little sister has always &lt;b&gt;looked up&lt;/b&gt; to me.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;make&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;invent, lie about something&lt;/td&gt;
&lt;td&gt;Josie &lt;b&gt;made up&lt;/b&gt; a story about why we were late.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;make up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;forgive each other&lt;/td&gt;
&lt;td&gt;We were angry last night, but we &lt;b&gt;made up&lt;/b&gt; at breakfast.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;make&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;apply cosmetics to&lt;/td&gt;
&lt;td&gt;My sisters &lt;b&gt;made&lt;/b&gt; me &lt;b&gt;up&lt;/b&gt; for my graduation party.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;mix&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;confuse two or more things&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;mixed up&lt;/b&gt; the twins&#39; names again!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;pass away&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;die&lt;/td&gt;
&lt;td&gt;His uncle &lt;b&gt;passed away&lt;/b&gt; last night after a long illness.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;pass out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;faint&lt;/td&gt;
&lt;td&gt;It was so hot in the church that an elderly lady &lt;b&gt;passed out&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;pass&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;give the same thing to many people&lt;/td&gt;
&lt;td&gt;The professor &lt;b&gt;passed&lt;/b&gt; the textbooks &lt;b&gt;out&lt;/b&gt; before class.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;pass&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;decline (usually something good)&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;passed up&lt;/b&gt; the job because I am afraid of change.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;pay&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;return owed money&lt;/td&gt;
&lt;td&gt;Thanks for buying my ticket. I&#39;ll &lt;b&gt;pay&lt;/b&gt; you &lt;b&gt;back&lt;/b&gt; on Friday.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;pay for&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;be punished for doing something bad&lt;/td&gt;
&lt;td&gt;That bully will &lt;b&gt;pay for&lt;/b&gt; being mean to my little brother.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;pick&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;choose&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;picked out&lt;/b&gt; three sweaters for you to try on.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;point&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;indicate with your finger&lt;/td&gt;
&lt;td&gt;I&#39;ll &lt;b&gt;point&lt;/b&gt; my boyfriend &lt;b&gt;out&lt;/b&gt; when he runs by.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;put&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;put what you are holding on a surface or floor&lt;/td&gt;
&lt;td&gt;You can &lt;b&gt;put&lt;/b&gt; the groceries &lt;b&gt;down&lt;/b&gt; on the kitchen counter.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;put&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;insult, make someone feel stupid&lt;/td&gt;
&lt;td&gt;The students &lt;b&gt;put&lt;/b&gt; the substitute teacher &lt;b&gt;down&lt;/b&gt; because his pants were too short.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;put&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;postpone&lt;/td&gt;
&lt;td&gt;We are &lt;b&gt;putting off&lt;/b&gt; our trip until January because of the hurricane.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;put&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;extinguish&lt;/td&gt;
&lt;td&gt;The neighbours &lt;b&gt;put&lt;/b&gt; the fire &lt;b&gt;out&lt;/b&gt; before the firemen arrived.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;put&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;together&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;assemble&lt;/td&gt;
&lt;td&gt;I have to &lt;b&gt;put&lt;/b&gt; the crib &lt;b&gt;together&lt;/b&gt; before the baby arrives.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;put up with&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;tolerate&lt;/td&gt;
&lt;td&gt;I don&#39;t think I can &lt;b&gt;put up with&lt;/b&gt; three small children in the car.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;put&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;on&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;put clothing/accessories on your body&lt;/td&gt;
&lt;td&gt;Don&#39;t forget to &lt;b&gt;put on&lt;/b&gt; your new earrings for the party.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;run into&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;meet unexpectedly&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;ran into&lt;/b&gt; an old school-friend at the mall.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;run over&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;drive a vehicle over a person or thing&lt;/td&gt;
&lt;td&gt;I accidentally &lt;b&gt;ran over&lt;/b&gt; your bicycle in the driveway.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;run over/through&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;rehearse, review&lt;/td&gt;
&lt;td&gt;Let&#39;s &lt;b&gt;run over/through&lt;/b&gt; these lines one more time before the show.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;run away&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;leave unexpectedly, escape&lt;/td&gt;
&lt;td&gt;The child &lt;b&gt;ran away&lt;/b&gt; from home and has been missing for three days.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;run out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;have none left&lt;/td&gt;
&lt;td&gt;We &lt;b&gt;ran out&lt;/b&gt; of shampoo so I had to wash my hair with soap.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;send&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;return (usually by mail)&lt;/td&gt;
&lt;td&gt;My letter got &lt;b&gt;sent back&lt;/b&gt; to me because I used the wrong stamp.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;set&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;arrange, organize&lt;/td&gt;
&lt;td&gt;Our boss &lt;b&gt;set&lt;/b&gt; a meeting &lt;b&gt;up&lt;/b&gt; with the president of the company.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;set&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;trick, trap&lt;/td&gt;
&lt;td&gt;The police &lt;b&gt;set up&lt;/b&gt; the car thief by using a hidden camera.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;shop around&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;compare prices&lt;/td&gt;
&lt;td&gt;I want to &lt;b&gt;shop around&lt;/b&gt; a little before I decide on these boots.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;show off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;act extra special for people watching (usually boastfully)&lt;/td&gt;
&lt;td&gt;He always &lt;b&gt;shows off&lt;/b&gt; on his skateboard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;sleep over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stay somewhere for the night (informal)&lt;/td&gt;
&lt;td&gt;You should &lt;b&gt;sleep over&lt;/b&gt; tonight if the weather is too bad to drive home.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;sort&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;organize, resolve a problem&lt;/td&gt;
&lt;td&gt;We need to &lt;b&gt;sort&lt;/b&gt; the bills &lt;b&gt;out&lt;/b&gt; before the first of the month.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;stick to&lt;/b&gt; &lt;i&gt;something&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;continue doing something, limit yourself to one particular thing&lt;/td&gt;
&lt;td&gt;You will lose weight if you &lt;b&gt;stick to&lt;/b&gt; the diet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;switch&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stop the energy flow, turn off&lt;/td&gt;
&lt;td&gt;The light&#39;s too bright. Could you &lt;b&gt;switch&lt;/b&gt; it &lt;b&gt;off&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;switch&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;on&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;start the energy flow, turn on&lt;/td&gt;
&lt;td&gt;We heard the news as soon as we &lt;b&gt;switched on&lt;/b&gt; the car radio.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;take after&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;resemble a family member&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;take after&lt;/b&gt; my mother. We are both impatient.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;take&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;apart&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;purposely break into pieces&lt;/td&gt;
&lt;td&gt;He &lt;b&gt;took&lt;/b&gt; the car brakes &lt;b&gt;apart&lt;/b&gt; and found the problem.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;take&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;return an item&lt;/td&gt;
&lt;td&gt;I have to &lt;b&gt;take&lt;/b&gt; our new TV &lt;b&gt;back&lt;/b&gt; because it doesn&#39;t work.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;take off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;start to fly&lt;/td&gt;
&lt;td&gt;My plane &lt;b&gt;takes off&lt;/b&gt; in five minutes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;take&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;remove something (usually clothing)&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Take off&lt;/b&gt; your socks and shoes and come in the lake!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;take&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;remove from a place or thing&lt;/td&gt;
&lt;td&gt;Can you &lt;b&gt;take&lt;/b&gt; the garbage &lt;b&gt;out&lt;/b&gt; to the street for me?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;take&lt;/b&gt; &lt;i&gt;someone&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;pay for someone to go somewhere with you&lt;/td&gt;
&lt;td&gt;My grandparents &lt;b&gt;took&lt;/b&gt; us &lt;b&gt;out&lt;/b&gt; for dinner and a movie.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;tear&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;rip into pieces&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;tore up&lt;/b&gt; my ex-boyfriend&#39;s letters and gave them back to him.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;think back&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;remember (often + to, sometimes + on)&lt;/td&gt;
&lt;td&gt;When I &lt;b&gt;think back&lt;/b&gt; on my youth, I wish I had studied harder.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;think&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;over&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;consider&lt;/td&gt;
&lt;td&gt;I&#39;ll have to &lt;b&gt;think&lt;/b&gt; this job offer &lt;b&gt;over&lt;/b&gt; before I make my final decision.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;throw&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;away&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;dispose of&lt;/td&gt;
&lt;td&gt;We &lt;b&gt;threw&lt;/b&gt; our old furniture &lt;b&gt;away&lt;/b&gt; when we won the lottery.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;turn&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;decrease the volume or strength (heat, light etc)&lt;/td&gt;
&lt;td&gt;Please &lt;b&gt;turn&lt;/b&gt; the TV &lt;b&gt;down&lt;/b&gt; while the guests are here.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;turn&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;down&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;refuse&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;turned&lt;/b&gt; the job &lt;b&gt;down&lt;/b&gt; because I don&#39;t want to move.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;turn&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stop the energy flow, switch off&lt;/td&gt;
&lt;td&gt;Your mother wants you to &lt;b&gt;turn&lt;/b&gt; the TV &lt;b&gt;off&lt;/b&gt; and come for dinner.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;turn&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;on&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;start the energy, switch on&lt;/td&gt;
&lt;td&gt;It&#39;s too dark in here. Let&#39;s &lt;b&gt;turn&lt;/b&gt; some lights &lt;b&gt;on&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;turn&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;increase the volume or strength (heat, light etc)&lt;/td&gt;
&lt;td&gt;Can you &lt;b&gt;turn&lt;/b&gt; the music &lt;b&gt;up&lt;/b&gt;? This is my favourite song.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;turn up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;appear suddenly&lt;/td&gt;
&lt;td&gt;Our cat &lt;b&gt;turned up&lt;/b&gt; after we put posters up all over the neighbourhood.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;try&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;on&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;sample clothing&lt;/td&gt;
&lt;td&gt;I&#39;m going to &lt;b&gt;try&lt;/b&gt; these jeans &lt;b&gt;on&lt;/b&gt;, but I don&#39;t think they will fit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;try&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;test&lt;/td&gt;
&lt;td&gt;I am going to &lt;b&gt;try&lt;/b&gt; this new brand of detergent &lt;b&gt;out&lt;/b&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;use&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;finish the supply&lt;/td&gt;
&lt;td&gt;The kids &lt;b&gt;used&lt;/b&gt; all of the toothpaste &lt;b&gt;up&lt;/b&gt; so we need to buy some more.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;wake up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;stop sleeping&lt;/td&gt;
&lt;td&gt;We have to &lt;b&gt;wake up&lt;/b&gt; early for work on Monday.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;warm&lt;/b&gt; &lt;i&gt;someone/something&lt;/i&gt; &lt;b&gt;up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;increase the temperature&lt;/td&gt;
&lt;td&gt;You can &lt;b&gt;warm&lt;/b&gt; your feet &lt;b&gt;up&lt;/b&gt; in front of the fireplace.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;warm up&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;prepare body for exercise&lt;/td&gt;
&lt;td&gt;I always &lt;b&gt;warm up&lt;/b&gt; by doing sit-ups before I go for a run.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;wear off&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;fade away&lt;/td&gt;
&lt;td&gt;Most of my make-up &lt;b&gt;wore off&lt;/b&gt; before I got to the party.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;work out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;exercise&lt;/td&gt;
&lt;td&gt;I &lt;b&gt;work out&lt;/b&gt; at the gym three times a week.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;work out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;be successful&lt;/td&gt;
&lt;td&gt;Our plan &lt;b&gt;worked out&lt;/b&gt; fine.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;work&lt;/b&gt; &lt;i&gt;something&lt;/i&gt; &lt;b&gt;out&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;make a calculation&lt;/td&gt;
&lt;td&gt;We have to &lt;b&gt;work out&lt;/b&gt; the total cost before we buy the house.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Br.E.: British English; N.Amer.: North American&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/9078944206140625441/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/9078944206140625441' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/9078944206140625441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/9078944206140625441'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2012/08/phrasal-verbs.html' title='Phrasal Verbs'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-9178372752061514377</id><published>2010-10-11T07:54:00.000-07:00</published><updated>2010-10-11T07:55:41.056-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php shopping card session"/><title type='text'>php tutor shopping cart session</title><content type='html'>http://www.phpwebcommerce.com/shopping-cart-source-code.php&lt;br /&gt;&lt;br /&gt;实例/example web:http://www.phpwebcommerce.com/plaincart/index.php?c=14&lt;br /&gt;&lt;br /&gt;http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/9178372752061514377/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/9178372752061514377' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/9178372752061514377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/9178372752061514377'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/10/php-tutor-shopping-cart-session.html' title='php tutor shopping cart session'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-2211442694353479337</id><published>2010-10-11T07:53:00.000-07:00</published><updated>2010-10-11T07:54:00.601-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php shopping card session"/><title type='text'>php shopping cart code</title><content type='html'>Building a simple PHP shopping cart&lt;br /&gt;Nov 21 2005&lt;br /&gt;&lt;br /&gt;Update 21/11: I’ve added a demo and downloadable .zip file at the end of the article.&lt;br /&gt;&lt;br /&gt;Update 07/12: Thanks to Greg and Rob Shan Lone for spotting a bug in the cart update code – I’ve now fixed this and updated the demo and .zip file; thanks guys!&lt;br /&gt;&lt;br /&gt;One of the most common requirements any web designer/developer will come across is likely to be that of the small business taking its first steps online; a client with an established widget-selling company now wants to move into the national market and sell their widgets to the world.&lt;br /&gt;&lt;br /&gt;What they need to do this (apart from a great-looking, functional, usable and accessible website!) is some sort of shopping-cart system to allow their customers to add, remove and update the products they wish to buy.&lt;br /&gt;&lt;br /&gt;This article will walk through the simple steps to achieve this, using the server-side language PHP and a MySQL database.&lt;br /&gt;Setting up the database&lt;br /&gt;&lt;br /&gt;Let’s take as our example a bookseller. They are not the best-stocked bookseller in the world, having as they do only three titles in stock, but it is enough for our example. Let’s create the database and add some stock:&lt;br /&gt;&lt;br /&gt;   1. CREATE TABLE books (&lt;br /&gt;   2. id int(6) unsigned NOT NULL auto_increment,&lt;br /&gt;   3. title varchar(100) NOT NULL default &#39;&#39;,&lt;br /&gt;   4. author varchar(100) NOT NULL default &#39;&#39;,&lt;br /&gt;   5. price decimal(3,2) NOT NULL default &#39;0.00&#39;,&lt;br /&gt;   6. PRIMARY KEY (id)&lt;br /&gt;   7. ) TYPE=MyISAM;&lt;br /&gt;   8.  &lt;br /&gt;   9. INSERT INTO books VALUES (1, &#39;Where God Went Wrong&#39;, &#39;Oolon Colluphid&#39;, &#39;24.99&#39;);&lt;br /&gt;  10. INSERT INTO books VALUES (2, &#39;Some More of God\&#39;s Greatest Mistakes&#39;, &#39;Oolon Colluphid&#39;, &#39;17.99&#39;);&lt;br /&gt;  11. INSERT INTO books VALUES (3, &#39;Who Is This God Person Anyway?&#39;, &#39;Oolon Colluphid&#39;, &#39;14.99&#39;);&lt;br /&gt;  12. Download this code: /code/php-cart-1.txt &lt;br /&gt;&lt;br /&gt;Now that step is out of the way, let’s create our shopping cart.&lt;br /&gt;Identify our requirements&lt;br /&gt;&lt;br /&gt;The cart we are going to build should be pretty familiar to most internet users. It will provide a means of displaying a message on every page of the site (along the lines of “You have 5 items in your shopping cart”), which when clicked will take the customer to a list of the items in the cart; each item may be removed or have its quantity updated.&lt;br /&gt;&lt;br /&gt;As all of our stock details are stored in the database, the only piece of information that we need to store about each customer is the id of each product they have added to their cart. To do this, we are going to use PHP’s built-in session handling capabilities.&lt;br /&gt;Using sessions in PHP&lt;br /&gt;&lt;br /&gt;PHP’s session handling is very easy to understand.&lt;br /&gt;&lt;br /&gt;To ‘switch it on’, simply add session_start(); at the top of your code; you can then store values (or arrays) in session variables:&lt;br /&gt;$_SESSION[&#39;name&#39;] = &#39;Matthew&#39;; $_SESSION[&#39;age&#39;] = 31;&lt;br /&gt;&lt;br /&gt;These $_SESSION variables will now be available to any PHP scripts on other pages (as long as you’ve included the session_start(); call first).&lt;br /&gt;A short note on cookies&lt;br /&gt;&lt;br /&gt;The default behaviour of PHP sessions is to store the session ID (a long string of numbers and letters that identifies you to the server) as a cookie on your computer; however, even if you have cookies disabled this functionality will still work – PHP will instead append the session ID to each link on the site (in the form ‘mypage.php?PHPSESSID=’) so that it can continue to accurately track visitors from page to page.&lt;br /&gt;Creating the cart&lt;br /&gt;&lt;br /&gt;We will store the contents of the shopping cart as a comma-separated list of product ids in a session named (unsurprisingly) ‘cart’ – for example, a cart containing “1,1,3,1,2” has four items; three of product #1, and one each of products #2 and #3.&lt;br /&gt;&lt;br /&gt;Firstly, let’s create the code to display the “You have X items…” message on every page:&lt;br /&gt;&lt;br /&gt;   1. function writeShoppingCart() {&lt;br /&gt;   2. $cart = $_SESSION[&#39;cart&#39;];&lt;br /&gt;   3. if (!$cart) {&lt;br /&gt;   4. return &#39;&lt;p&gt;You have no items in your shopping cart&lt;/p&gt;&#39;;&lt;br /&gt;   5. } else {&lt;br /&gt;   6. // Parse the cart session variable&lt;br /&gt;   7. $items = explode(&#39;,&#39;,$cart);&lt;br /&gt;   8. $s = (count($items) &gt; 1) ? &#39;s&#39;:&#39;&#39;;&lt;br /&gt;   9. return &#39;&lt;p&gt;You have &lt;a href=&quot;cart.php&quot;&gt;&#39;.count($items).&#39; item&#39;.$s.&#39; in your shopping cart&lt;/a&gt;&lt;/p&gt;&#39;;&lt;br /&gt;  10. }&lt;br /&gt;  11. }&lt;br /&gt;  12.  &lt;br /&gt;  13. Download this code: /code/php-cart-2.txt &lt;br /&gt;&lt;br /&gt;This function first gets the value of the ‘cart’ session variable into a local variable, mainly to save on typing. If the cart is empty, we return an appropriate message; if not, we use the explode() function to create an array of all the products in the cart, and then count() them and display the result (the $s variable is there to make plurals display correctly).&lt;br /&gt;&lt;br /&gt;Now we can display the correct message anywhere on the site:&lt;br /&gt;echo writeShoppingCart();&lt;br /&gt;&lt;br /&gt;I hope that made sense; let’s move on to displaying the contents of the cart itself.&lt;br /&gt;Show me the money&lt;br /&gt;&lt;br /&gt;The shopping cart page itself (cart.php) can be arrived at in a couple of ways. The user may have clicked on the link created by the writeShoppingCart() function above; or, they may have clicked an ‘Add to cart’ link on a product page.&lt;br /&gt;&lt;br /&gt;If it was the latter, we need to intercept that click and update our cart contents before displaying the new list of products – simple enough, as all we need to do is append the id of the clicked product to the ‘cart’ session variable. Our product links are going to look like this:&lt;br /&gt;&lt;a href=&quot;cart.php?action=add&amp;id=1&quot;&gt;Add to cart&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Don’t worry about the ‘action=add’ bit, we’ll get to that later. The id can now be extracted from $_GET[‘id’] and added to our cart:&lt;br /&gt;&lt;br /&gt;   1. $cart = $_SESSION[&#39;cart&#39;];&lt;br /&gt;   2. if ($cart) {&lt;br /&gt;   3. $cart .= &#39;,&#39;.$_GET[&#39;id&#39;];&lt;br /&gt;   4. } else {&lt;br /&gt;   5. $cart = $_GET[&#39;id&#39;];&lt;br /&gt;   6. }&lt;br /&gt;   7. $_SESSION[&#39;cart&#39;] = $cart;&lt;br /&gt;   8. Download this code: /code/php-cart-3.txt &lt;br /&gt;&lt;br /&gt;Now, on to the contents of our cart!&lt;br /&gt;Multiple items, one product&lt;br /&gt;&lt;br /&gt;As in our example above, it is entirely possible that a customer might have more than one of a certain product in their cart. As we don’t want to list duplicate items when we display the contents, we need to figure out a way to combine any of the same product into one entry (with a corresponding quantity attached).&lt;br /&gt;&lt;br /&gt;   1. $cart = $_SESSION[&#39;cart&#39;];&lt;br /&gt;   2. if ($cart) {&lt;br /&gt;   3. $items = explode(&#39;,&#39;,$cart);&lt;br /&gt;   4. $contents = array();&lt;br /&gt;   5. foreach ($items as $item) {&lt;br /&gt;   6. $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1;&lt;br /&gt;   7. }&lt;br /&gt;   8. Download this code: /code/php-cart-4.txt &lt;br /&gt;&lt;br /&gt;This time, after exploding the list of product ids, we have iterated through them to create a new array named $contents, which consists of key=&gt;value pairs where the key is the product id and the value is the quantity of that product in the shopping cart. So to take our example above, a cart containing “1,1,3,1,2” would become an array where ‘1’=&gt;3, ‘2’=&gt;1, ‘3’=&gt;1.&lt;br /&gt;&lt;br /&gt;Now that we have an accurate count of unique products, let’s query the product database for each one and output its details into a table:&lt;br /&gt;&lt;br /&gt;   1. $total = 0;&lt;br /&gt;   2. $output[] = &#39;&lt;table&gt;&#39;;&lt;br /&gt;   3. foreach ($contents as $id=&gt;$qty) {&lt;br /&gt;   4. $sql = &#39;SELECT * FROM books WHERE id = &#39;.$id;&lt;br /&gt;   5. $result = $db-&gt;query($sql);&lt;br /&gt;   6. $row = $result-&gt;fetch();&lt;br /&gt;   7. extract($row);&lt;br /&gt;   8. $output[] = &#39;&lt;tr&gt;&#39;;&lt;br /&gt;   9. $output[] = &#39;&lt;td&gt;&lt;a href=&quot;cart.php?action=delete&amp;id=&#39;.$id.&#39;&quot; class=&quot;r&quot;&gt;Remove&lt;/a&gt;&lt;/td&gt;&#39;;&lt;br /&gt;  10. $output[] = &#39;&lt;td&gt;&#39;.$title.&#39; by &#39;.$author.&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  11. $output[] = &#39;&lt;td&gt;&amp;pound;&#39;.$price.&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  12. $output[] = &#39;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;qty&#39;.$id.&#39;&quot; value=&quot;&#39;.$qty.&#39;&quot; size=&quot;3&quot; maxlength=&quot;3&quot; /&gt;&lt;/td&gt;&#39;;&lt;br /&gt;  13. $output[] = &#39;&lt;td&gt;&amp;pound;&#39;.($price * $qty).&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  14. $total += $price * $qty;&lt;br /&gt;  15. $output[] = &#39;&lt;/tr&gt;&#39;;&lt;br /&gt;  16. }&lt;br /&gt;  17. $output[] = &#39;&lt;/table&gt;&#39;;&lt;br /&gt;  18. $output[] = &#39;&lt;p&gt;Grand total: &amp;pound;&#39;.$total.&#39;&lt;/p&gt;&#39;;&lt;br /&gt;  19.  &lt;br /&gt;  20. Download this code: /code/php-cart-5.txt &lt;br /&gt;&lt;br /&gt;(*Note*: I’m using a PHP class to handle my database connections, so your code may need to be slightly different).&lt;br /&gt;&lt;br /&gt;Pretty simple stuff – we iterate through the new $contents array and query the database for each product id. Then we output the relevant details for each product; title, author and price, and at the bottom we show the grand total for the order. For each item, we’ve also included a link to remove the item from the cart, a textbox containing the current quantity of that item, and a total price (obviously this will only differ from the base price if the quantity is not 1).&lt;br /&gt;&lt;br /&gt;The reason I’m using $output[] = ... is that I am buffering the output into an array to print to the screen later.&lt;br /&gt;&lt;br /&gt;So far so good – now how about removing products from the cart?&lt;br /&gt;Deleting a product&lt;br /&gt;&lt;br /&gt;As shown above, the link to delete a product from the cart follows the same format as the ‘add a product’ link:&lt;br /&gt;&lt;a href=&quot;cart.php?action=delete&amp;id=1&quot;&gt;Remove&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Let’s expand on the code from earlier by adding a switch() statement to handle the different things that might happen to our cart:&lt;br /&gt;&lt;br /&gt;   1. $cart = $_SESSION[&#39;cart&#39;];&lt;br /&gt;   2. $action = $_GET[&#39;action&#39;];&lt;br /&gt;   3. switch ($action) {&lt;br /&gt;   4. case &#39;add&#39;:&lt;br /&gt;   5. if ($cart) {&lt;br /&gt;   6. $cart .= &#39;,&#39;.$_GET[&#39;id&#39;];&lt;br /&gt;   7. } else {&lt;br /&gt;   8. $cart = $_GET[&#39;id&#39;];&lt;br /&gt;   9. }&lt;br /&gt;  10. break;&lt;br /&gt;  11. case &#39;delete&#39;:&lt;br /&gt;  12. if ($cart) {&lt;br /&gt;  13. $items = explode(&#39;,&#39;,$cart);&lt;br /&gt;  14. $newcart = &#39;&#39;;&lt;br /&gt;  15. foreach ($items as $item) {&lt;br /&gt;  16. if ($_GET[&#39;id&#39;] != $item) {&lt;br /&gt;  17. if ($newcart != &#39;&#39;) {&lt;br /&gt;  18. $newcart .= &#39;,&#39;.$item;&lt;br /&gt;  19. } else {&lt;br /&gt;  20. $newcart = $item;&lt;br /&gt;  21. }&lt;br /&gt;  22. }&lt;br /&gt;  23. }&lt;br /&gt;  24. $cart = $newcart;&lt;br /&gt;  25. }&lt;br /&gt;  26. break;&lt;br /&gt;  27. }&lt;br /&gt;  28. $_SESSION[&#39;cart&#39;] = $cart;&lt;br /&gt;  29. Download this code: /code/php-cart-6.txt &lt;br /&gt;&lt;br /&gt;The new ‘delete’ case iterates through the ‘cart’ session, looking for any product ids that AREN’T the one we’re deleting, and adding them to a temporary variable called $newcart. When it’s finished, it puts the revised cart contents back into $cart.&lt;br /&gt;Updating a product&lt;br /&gt;&lt;br /&gt;Lastly, we are going to allow customers to update the contents of their shopping cart by manually changing the value in the quantity box for each product.&lt;br /&gt;&lt;br /&gt;To make this work, we’ll wrap the shopping cart table in a &lt;form&gt; so that the ‘update cart’ button will submit the form:&lt;br /&gt;&lt;br /&gt;   1. $output[] = &#39;&lt;form action=&quot;cart.php?action=update&quot; method=&quot;post&quot; id=&quot;cart&quot;&gt;&#39;;&lt;br /&gt;   2. $output[] = &#39;&lt;table&gt;&#39;;&lt;br /&gt;   3. foreach ($contents as $id=&gt;$qty) {&lt;br /&gt;   4. $sql = &#39;SELECT * FROM books WHERE id = &#39;.$id;&lt;br /&gt;   5. $result = $db-&gt;query($sql);&lt;br /&gt;   6. $row = $result-&gt;fetch();&lt;br /&gt;   7. extract($row);&lt;br /&gt;   8. $output[] = &#39;&lt;tr&gt;&#39;;&lt;br /&gt;   9. $output[] = &#39;&lt;td&gt;&lt;a href=&quot;cart.php?action=delete&amp;id=&#39;.$id.&#39;&quot; class=&quot;r&quot;&gt;Remove&lt;/a&gt;&lt;/td&gt;&#39;;&lt;br /&gt;  10. $output[] = &#39;&lt;td&gt;&#39;.$title.&#39; by &#39;.$author.&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  11. $output[] = &#39;&lt;td&gt;&amp;pound;&#39;.$price.&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  12. $output[] = &#39;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;qty&#39;.$id.&#39;&quot; value=&quot;&#39;.$qty.&#39;&quot; size=&quot;3&quot; maxlength=&quot;3&quot; /&gt;&lt;/td&gt;&#39;;&lt;br /&gt;  13. $output[] = &#39;&lt;td&gt;&amp;pound;&#39;.($price * $qty).&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  14. $total += $price * $qty;&lt;br /&gt;  15. $output[] = &#39;&lt;/tr&gt;&#39;;&lt;br /&gt;  16. }&lt;br /&gt;  17. $output[] = &#39;&lt;/table&gt;&#39;;&lt;br /&gt;  18. $output[] = &#39;&lt;p&gt;Grand total: &amp;pound;&#39;.$total.&#39;&lt;/p&gt;&#39;;&lt;br /&gt;  19. $output[] = &#39;&lt;div&gt;&lt;button type=&quot;submit&quot;&gt;Update cart&lt;/button&gt;&lt;/div&gt;&#39;;&lt;br /&gt;  20. $output[] = &#39;&lt;/form&gt;&#39;;&lt;br /&gt;  21. Download this code: /code/php-cart-7.txt &lt;br /&gt;&lt;br /&gt;Note that, even though the form uses the POST method, its action includes a GET variable, “action=update”. Again, we can expand our previous code to process any quantity updates:&lt;br /&gt;&lt;br /&gt;   1. case &#39;update&#39;:&lt;br /&gt;   2. if ($cart) {&lt;br /&gt;   3. $newcart = &#39;&#39;;&lt;br /&gt;   4. foreach ($_POST as $key=&gt;$value) {&lt;br /&gt;   5. if (stristr($key,&#39;qty&#39;)) {&lt;br /&gt;   6. $id = str_replace(&#39;qty&#39;,&#39;&#39;,$key);&lt;br /&gt;   7. $items = ($newcart != &#39;&#39;) ? explode(&#39;,&#39;,$newcart) : explode(&#39;,&#39;,$cart);&lt;br /&gt;   8. $newcart = &#39;&#39;;&lt;br /&gt;   9. foreach ($items as $item) {&lt;br /&gt;  10. if ($id != $item) {&lt;br /&gt;  11. if ($newcart != &#39;&#39;) {&lt;br /&gt;  12. $newcart .= &#39;,&#39;.$item;&lt;br /&gt;  13. } else {&lt;br /&gt;  14. $newcart = $item;&lt;br /&gt;  15. }&lt;br /&gt;  16. }&lt;br /&gt;  17. }&lt;br /&gt;  18. for ($i=1;$i&lt;=$value;$i++) {&lt;br /&gt;  19. if ($newcart != &#39;&#39;) {&lt;br /&gt;  20. $newcart .= &#39;,&#39;.$id;&lt;br /&gt;  21. } else {&lt;br /&gt;  22. $newcart = $id;&lt;br /&gt;  23. }&lt;br /&gt;  24. }&lt;br /&gt;  25. }&lt;br /&gt;  26. }&lt;br /&gt;  27. }&lt;br /&gt;  28. $cart = $newcart;&lt;br /&gt;  29. break;&lt;br /&gt;  30.  &lt;br /&gt;  31. Download this code: /code/php-cart-8.txt &lt;br /&gt;&lt;br /&gt;This looks quite complicated, but it’s fairly straightforward; we interrogate the contents of the $_POST array (which holds all our quantity values) and extract the relevant id and value pairs. For each product, we then delete all the existing instances of it, and re-insert the new quantity.&lt;br /&gt;&lt;br /&gt;There are a number of ways this could have been done – for example, by counting the existing number of each product present in the cart and figuring out whether we needed to add or remove items – but this seemed the easiest way to process the quantity updates.&lt;br /&gt;Summary&lt;br /&gt;&lt;br /&gt;And that’s about it! A functional and easy shopping cart script – here’s the final function to display the contents of the cart:&lt;br /&gt;&lt;br /&gt;   1. function showCart() {&lt;br /&gt;   2. $cart = $_SESSION[&#39;cart&#39;];&lt;br /&gt;   3. if ($cart) {&lt;br /&gt;   4. $items = explode(&#39;,&#39;,$cart);&lt;br /&gt;   5. $contents = array();&lt;br /&gt;   6. foreach ($items as $item) {&lt;br /&gt;   7. $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1;&lt;br /&gt;   8. }&lt;br /&gt;   9. $output[] = &#39;&lt;form action=&quot;cart.php?action=update&quot; method=&quot;post&quot; id=&quot;cart&quot;&gt;&#39;;&lt;br /&gt;  10. $output[] = &#39;&lt;table&gt;&#39;;&lt;br /&gt;  11. foreach ($contents as $id=&gt;$qty) {&lt;br /&gt;  12. $sql = &#39;SELECT * FROM books WHERE id = &#39;.$id;&lt;br /&gt;  13. $result = $db-&gt;query($sql);&lt;br /&gt;  14. $row = $result-&gt;fetch();&lt;br /&gt;  15. extract($row);&lt;br /&gt;  16. $output[] = &#39;&lt;tr&gt;&#39;;&lt;br /&gt;  17. $output[] = &#39;&lt;td&gt;&lt;a href=&quot;cart.php?action=delete&amp;id=&#39;.$id.&#39;&quot; class=&quot;r&quot;&gt;Remove&lt;/a&gt;&lt;/td&gt;&#39;;&lt;br /&gt;  18. $output[] = &#39;&lt;td&gt;&#39;.$title.&#39; by &#39;.$author.&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  19. $output[] = &#39;&lt;td&gt;&amp;pound;&#39;.$price.&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  20. $output[] = &#39;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;qty&#39;.$id.&#39;&quot; value=&quot;&#39;.$qty.&#39;&quot; size=&quot;3&quot; maxlength=&quot;3&quot; /&gt;&lt;/td&gt;&#39;;&lt;br /&gt;  21. $output[] = &#39;&lt;td&gt;&amp;pound;&#39;.($price * $qty).&#39;&lt;/td&gt;&#39;;&lt;br /&gt;  22. $total += $price * $qty;&lt;br /&gt;  23. $output[] = &#39;&lt;/tr&gt;&#39;;&lt;br /&gt;  24. }&lt;br /&gt;  25. $output[] = &#39;&lt;/table&gt;&#39;;&lt;br /&gt;  26. $output[] = &#39;&lt;p&gt;Grand total: &amp;pound;&#39;.$total.&#39;&lt;/p&gt;&#39;;&lt;br /&gt;  27. $output[] = &#39;&lt;div&gt;&lt;button type=&quot;submit&quot;&gt;Update cart&lt;/button&gt;&lt;/div&gt;&#39;;&lt;br /&gt;  28. $output[] = &#39;&lt;/form&gt;&#39;;&lt;br /&gt;  29. } else {&lt;br /&gt;  30. $output[] = &#39;&lt;p&gt;You shopping cart is empty.&lt;/p&gt;&#39;;&lt;br /&gt;  31. }&lt;br /&gt;  32. return join(&#39;&#39;,$output);&lt;br /&gt;  33. }&lt;br /&gt;  34. Download this code: /code/php-cart-9.txt &lt;br /&gt;&lt;br /&gt;Note that if the cart is empty, a suitable message is displayed.&lt;br /&gt;&lt;br /&gt;A working demo can be seen (excuse the lack of design!), or please feel free to download a .zip of all the files  – any questions, comments or suggestions on how the code could be improved gratefully received.&lt;br /&gt;&lt;br /&gt;Filed under: PHP, MySQL.&lt;br /&gt;&lt;br /&gt;Technorati tags: php mysql php shopping cart&lt;br /&gt;&lt;br /&gt;Digg this article&lt;br /&gt;&lt;br /&gt;Bookmark this article with del.icio.us&lt;br /&gt;&lt;br /&gt;Previously: Today I have mostly been learnin&#39;...&lt;br /&gt;&lt;br /&gt;Next: Random song lyrics: Update&lt;br /&gt;&lt;br /&gt;Comments&lt;br /&gt;&lt;br /&gt;Matthijs&lt;br /&gt;    1782 days ago&lt;br /&gt;    Nice article! A good explanation for how the basics of a shopping cart work. That’ll help us on our way. Thanks.&lt;br /&gt;    #1&lt;br /&gt;&lt;br /&gt;Christian Montoya&lt;br /&gt;    1779 days ago&lt;br /&gt;    Awesome. I bookmarked this for later.&lt;br /&gt;    #2&lt;br /&gt;&lt;br /&gt;Hamish Keith&lt;br /&gt;    1774 days ago&lt;br /&gt;    Very very good – prob the best i have seen on the web&lt;br /&gt;    #3&lt;br /&gt;&lt;br /&gt;Andrew&lt;br /&gt;    1769 days ago&lt;br /&gt;    Thank you so much for this tutorial. It was exactly what I’d been looking for for some time. Great design as well. Beautifully done.&lt;br /&gt;    #4&lt;br /&gt;&lt;br /&gt;Greg Hamilton&lt;br /&gt;    1769 days ago&lt;br /&gt;    First of all wicked article, very helpful. Whats the best way to attempt the checkout ? Thanks&lt;br /&gt;    #5&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1769 days ago&lt;br /&gt;    Greg: Funny you should ask that, as I wrote an article that kind of touches on the subject – it is specific to Textpattern, but there is a section on ‘Shopping Integration’ that covers using PayPal to handle payment.&lt;br /&gt;&lt;br /&gt;    As we’re doing the shoppng cart bit ourselves, we could use PayPal’s new API to simply send the payment details and receive back the response (or whatever other payment processor we’re using).&lt;br /&gt;    #6&lt;br /&gt;&lt;br /&gt;Greg Hamilton&lt;br /&gt;    1769 days ago&lt;br /&gt;    Hey Matt thanks for the with the checkout help, quick question about the update function..when you try to update an id that isn’t qty1 it doesnt update…not sure if I messed up the demo file or not :( thanks&lt;br /&gt;    #7&lt;br /&gt;&lt;br /&gt;Greg Hamilton&lt;br /&gt;    1769 days ago&lt;br /&gt;    Sorry Matt I mean if you have, lets say two products in yer cart and you try to update the top one it doesnt, but the bottom one will. I think it does it in the demo as well….thanks bud&lt;br /&gt;    #8&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1768 days ago&lt;br /&gt;    Thanks, Greg – I’ve fixed the problem and updated the demo and .zip.&lt;br /&gt;    #9&lt;br /&gt;&lt;br /&gt;Greg Hamilton&lt;br /&gt;    1766 days ago&lt;br /&gt;    Hey again Matt&lt;br /&gt;    Quick question about quantities, is ti possible to add a function that also allows the user to add quantities inside the product view before adding to cart. Thanks bud&lt;br /&gt;    #10&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1766 days ago&lt;br /&gt;    It would be very easy, Greg, although I don’t have time to do it right now – perhaps a later expansion, unless you want to add it in and publish your changes?&lt;br /&gt;    #11&lt;br /&gt;&lt;br /&gt;Greg Hamilton&lt;br /&gt;    1766 days ago&lt;br /&gt;    Ya I’m gonna give it a go. I’ll publish when I get it all set to go.&lt;br /&gt;    #12&lt;br /&gt;&lt;br /&gt;Andrew&lt;br /&gt;    1764 days ago&lt;br /&gt;    Hi,&lt;br /&gt;&lt;br /&gt;    Thanks for the tutorial!&lt;br /&gt;&lt;br /&gt;    i have changed the cart.php page a little. on the cart.php page, if the user clicks re-fresh, an item is added to the the cart as the ID ifor the product is stored in the querystring. its easily fixed.&lt;br /&gt;&lt;br /&gt;    Just a heads up for some.&lt;br /&gt;&lt;br /&gt;    Once again thanks for the demo!&lt;br /&gt;    #13&lt;br /&gt;&lt;br /&gt;Viktor&lt;br /&gt;    1761 days ago&lt;br /&gt;    Great tutorial. Most tutorials takes too many steps at the same time so you only end up comfused, but this is vert easy to follow and understand.&lt;br /&gt;    #14&lt;br /&gt;&lt;br /&gt;hidayat&lt;br /&gt;    1744 days ago&lt;br /&gt;    Good job boss&lt;br /&gt;    it’s nice tutorial ,too nice&lt;br /&gt;    #15&lt;br /&gt;&lt;br /&gt;Franco&lt;br /&gt;    1743 days ago&lt;br /&gt;    Hi Matthew,&lt;br /&gt;    I test your script&lt;br /&gt;    but when i add to cart&lt;br /&gt;    this is message page:&lt;br /&gt;    Please check quantities…&lt;br /&gt;    You shopping cart is empty&lt;br /&gt;    I don’t see any product choice.&lt;br /&gt;    Can you help me?&lt;br /&gt;&lt;br /&gt;    Regards and happy New year&lt;br /&gt;    Franco&lt;br /&gt;    #16&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1742 days ago&lt;br /&gt;    Hi Franco – I’d need a bit more information to work out what might be wrong; the first thing to try though would be to echo the $id and $cart variables as the code progresses through the ‘add’ routine to see what is happening.&lt;br /&gt;    #17&lt;br /&gt;&lt;br /&gt;The Illumidigerati&lt;br /&gt;    1735 days ago&lt;br /&gt;    Matt, does this cart form allow enough security for actual business transactions in the form of moneyorder/personal check? I’ll be webmastering my girlfriends home business and starting out neither of us are really keen on dealing with credit or any online payment ventures, i.e. paypal. Is there a reason for anything more secure when moneyorders/personal checks are the only payment methods since only user information will be logged, not CC info or bank account info?&lt;br /&gt;    #18&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1735 days ago&lt;br /&gt;    This cart script doesn’t handle any kind of payment; it is only for keeping track of what is in the shopping cart.&lt;br /&gt;    #19&lt;br /&gt;&lt;br /&gt;dreamer85&lt;br /&gt;    1734 days ago&lt;br /&gt;    good tutorial well done&lt;br /&gt;    if it explaines how to display image with the products will be greate tutorial&lt;br /&gt;    take care&lt;br /&gt;    #20&lt;br /&gt;&lt;br /&gt;Momotaro&lt;br /&gt;    1725 days ago&lt;br /&gt;    Excellent tutorial.&lt;br /&gt;    I’d like to know how to display the result in a Form that could then be saved to .csv file server-side? Ultimately, even send me an email when order Form was submited. The tutorials I’ve come across in past were too full of tech-speak that I couldn’t understand.&lt;br /&gt;    #21&lt;br /&gt;&lt;br /&gt;Aneurin&lt;br /&gt;    1720 days ago&lt;br /&gt;    Thank You for the tutorial…&lt;br /&gt;    i was wondering if i could add product option to this shopping cart..eg. same item(same product id) but different options (size,colour)...i would appreciate some ideas…thanks in advance…&lt;br /&gt;    #22&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1720 days ago&lt;br /&gt;    Aneurin: Yes, that’s certainly an option; the project that I developed this cart code for does just that.&lt;br /&gt;&lt;br /&gt;    I used certain characters to split the product that was added to the cart, so to take your example of something with a certain size and colour, I would store the sizes and colours in their own tables in the database, then add products in the format “123c6s3”, which would translate as “Product #123, colour #6, size #3”.&lt;br /&gt;&lt;br /&gt;    The show-cart page would then lookup that colour and size from the table as part of the SQL statement and display the correct description of the product.&lt;br /&gt;    #23&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1720 days ago&lt;br /&gt;    Momotaro: Sending an email when the order is submitted would be pretty simple � the PHP mail() function covers that in detail.&lt;br /&gt;    #24&lt;br /&gt;&lt;br /&gt;Aneurin&lt;br /&gt;    1719 days ago&lt;br /&gt;    Thank You very much…...&lt;br /&gt;    #25&lt;br /&gt;&lt;br /&gt;momotaro&lt;br /&gt;    1717 days ago&lt;br /&gt;    Thanks for the link&lt;br /&gt;    #26&lt;br /&gt;&lt;br /&gt;junwei&lt;br /&gt;    1709 days ago&lt;br /&gt;    nice! It help me alot, u mind adding add to cart and login function . thank&lt;br /&gt;    #27&lt;br /&gt;&lt;br /&gt;Cormac&lt;br /&gt;    1708 days ago&lt;br /&gt;    are there anyother api’s that could be intergrated fairly easily with this shopping cart other than PayPal’s ?&lt;br /&gt;    #28&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1708 days ago&lt;br /&gt;    Cormac: There are quite a few online payment mechanisms that are as easy to integrate with as PayPal. WorldPay is probably the next best known one, but there are plenty around.&lt;br /&gt;    #29&lt;br /&gt;&lt;br /&gt;Matt Cooper&lt;br /&gt;    1702 days ago&lt;br /&gt;    Nice code, and I very much like your website too, very fresh design. One disappointment (only a small one!) is that you haven’t provided further code for a checkout…is this on the cards? Good luck…&lt;br /&gt;    #30&lt;br /&gt;&lt;br /&gt;Tan&lt;br /&gt;    1700 days ago&lt;br /&gt;    Great Demo, the best on the web!&lt;br /&gt;    I have one problem, same as franco above, I select add item and it displays check quantities on the cart page, with no items passed through. I have had a look over every page to no avail, would it be a function issue? It passes the id through the url but does not display it.&lt;br /&gt;    #31&lt;br /&gt;&lt;br /&gt;James&lt;br /&gt;    1695 days ago&lt;br /&gt;    Hi Matt,&lt;br /&gt;&lt;br /&gt;    I’m new to all this and am pulling my hair out! – it just won’t work for me – getting messages such as:&lt;br /&gt;&lt;br /&gt;    Query failed: Unknown column ‘Array’ in ‘where clause’ SQL: SELECT * FROM book WHERE id = Array&lt;br /&gt;&lt;br /&gt;    or…&lt;br /&gt;&lt;br /&gt;    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result&lt;br /&gt;&lt;br /&gt;    or…&lt;br /&gt;&lt;br /&gt;    Warning: mysql_num_rows(): supplied argument is not a valid MySQL&lt;br /&gt;&lt;br /&gt;    Where am I going wrong – from the other comments it seems to be pretty easy so it must be something I’m doing wrong!&lt;br /&gt;&lt;br /&gt;    Thanks for any help – very frstrated at the moment!&lt;br /&gt;&lt;br /&gt;    James&lt;br /&gt;    #32&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1695 days ago&lt;br /&gt;    James: That sounds as if the id is not being passed through in the querystring correctly. Check that you have populated the database correctly and have configured your database connection information properly.&lt;br /&gt;    #33&lt;br /&gt;&lt;br /&gt;tan&lt;br /&gt;    1694 days ago&lt;br /&gt;    Just me again, why would it not display in the cart. Please note above note.&lt;br /&gt;    #34&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1694 days ago&lt;br /&gt;    Tan: It sounds as if the id variable in the querystring is not being picked up by the code (php-cart-3 in the code above) and added to the cart.&lt;br /&gt;&lt;br /&gt;    You could try adding a loop through all the items in the GET collection:&lt;br /&gt;&lt;br /&gt;    foreach ($_GET as $key =&gt; $value) {&lt;br /&gt;      echo $key . � contains � . $value . &#39;&lt;br /&gt;&#39;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    That will list everything all the variables in the querystring; if nothing is there, it may be that you�ve changed the form method to �post� instead of �get�? Or possibly you&#39;re using a very old version of PHP that doesn&#39;t support $_GET - you could try the above code with $HTTP_GET_VARS instead; if that works you&#39;ll have to change all instances of $_GET to $HTTP_GET_VARS (or upgrade to a host supporting a more modern version of PHP!)&lt;br /&gt;    #35&lt;br /&gt;&lt;br /&gt;CHiNo4ReaL&lt;br /&gt;    1692 days ago&lt;br /&gt;    Nice tutorial, I’m gonna use it, but I have a question, is it possible to create catogory’s,&lt;br /&gt;    #36&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1692 days ago&lt;br /&gt;    Chino: Do you mean in the products listings, or in the cart session variable?&lt;br /&gt;&lt;br /&gt;    It depends how your database is set up whether you’d need any additional work to cope with categories.&lt;br /&gt;    #37&lt;br /&gt;&lt;br /&gt;G&lt;br /&gt;    1692 days ago&lt;br /&gt;    Hello,&lt;br /&gt;&lt;br /&gt;    I have installed your cart on my website, but I have a problem. When I navigate between cart.php and index.php it appears this error message:&lt;br /&gt;    “Warning: session_start(): Cannot send session cache limiter – headers already sent (output started at ….global.inc.php:9) in cart.php on line 9”&lt;br /&gt;    “Warning: session_start(): Cannot send session cache limiter – headers already sent ”...&lt;br /&gt;    Can you please help me to solve it out?&lt;br /&gt;    Regards,&lt;br /&gt;    G.&lt;br /&gt;    #38&lt;br /&gt;&lt;br /&gt;CHiNo4ReaL&lt;br /&gt;    1691 days ago&lt;br /&gt;    @Matthew&lt;br /&gt;&lt;br /&gt;    Yes, because i’m creating a webshop, with carparts, so there are a few catorgies, like exterior, frontbumpers, rims etc.&lt;br /&gt;    #39&lt;br /&gt;&lt;br /&gt;CHiNo4ReaL&lt;br /&gt;    1691 days ago&lt;br /&gt;    Oh and another question, How can I finish the order?&lt;br /&gt;    #40&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1691 days ago&lt;br /&gt;    G: The session_start() command has to appear in the code before any output has been sent to the browser. As your error says, there is output being sent at line 9 of global.inc.php – you must have changed the source files, as my originals only have database connection variables in that file.&lt;br /&gt;    #41&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1691 days ago&lt;br /&gt;    Chino: Bear in mind that the id of the product that is held in the cart doesn’t have to include any reference to the category it is in.&lt;br /&gt;&lt;br /&gt;    You just have to alter the products database to include a category field; you can then use that when listing products, but just use the product id to hold it in the cart.&lt;br /&gt;&lt;br /&gt;    To finish the order, you’re going to have to decide what you want to do with it – either have it saved to a database, emailed to you, or processed by an online payment processor like PayPal. That’s beyond the scope of this tutorial, though.&lt;br /&gt;    #42&lt;br /&gt;&lt;br /&gt;CHiNo4ReaL&lt;br /&gt;    1690 days ago&lt;br /&gt;    Ok, Do you have an example for the catorgyfield in the database?&lt;br /&gt;    #43&lt;br /&gt;&lt;br /&gt;jatty5&lt;br /&gt;    1690 days ago&lt;br /&gt;    Hi all, I am new to this php and am trying to buid a shopping cart for my business myself. I have installed easyphp which has given me apache mysql and php, and am trying to work through this tutorial which I think is excellent for somebody like me a total novice! I have managed to create the database succesfully by copy the complete script and putting it through phpmyadmin. I tried to download the complete zip files, but where do i put them and how on earth do i set the database connection files up. Please help as I am getting alittle lost. I have also downloaded each script but agian where does it go, i know it would be in the WWW directory of my easyphp folder. Please help&lt;br /&gt;    #44&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1689 days ago&lt;br /&gt;    Chino: Just add a category field into your database using whatever MySQL admin tool you’re using.&lt;br /&gt;    #45&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1689 days ago&lt;br /&gt;    jatty5: If you have downloaded the zip you don’t need the individual scripts; just unpack the zip file to a folder under your www directory (e.g. “cart”). The database connection settings are in inc/global.inc.php if you need to change them, but if you’re running it locally the settings should be fine.&lt;br /&gt;&lt;br /&gt;    Then visit http://localhost/cart/ and it should all be working (you may have to start the PHP and MySQL services, depending on the package you are using).&lt;br /&gt;    #46&lt;br /&gt;&lt;br /&gt;jatty5&lt;br /&gt;    1689 days ago&lt;br /&gt;    Hi Mathew, thanks for your swift reply, i have done what you said but still get the following reply:&lt;br /&gt;&lt;br /&gt;    I take it it has something to do with the database i created the database under phpmyadmin and called the database wtchproject and then run your script under that which created your tables under this database.&lt;br /&gt;&lt;br /&gt;    What do i change in the gobal file and is it possible for you to show where i can make those changes if possible.&lt;br /&gt;&lt;br /&gt;    Notice: Could not select database in c:\program files\easyphp1-8\www\cart-demo\inc\mysql.class.php on line 80&lt;br /&gt;&lt;br /&gt;    Warning: session_start(): Cannot send session cookie – headers already sent by (output started at c:\program files\easyphp1-8\www\cart-demo\inc\mysql.class.php:80) in c:\program files\easyphp1-8\www\cart-demo\index.php on line 9&lt;br /&gt;&lt;br /&gt;    Warning: session_start(): Cannot send session cache limiter – headers already sent (output started at c:\program files\easyphp1-8\www\cart-demo\inc\mysql.class.php:80) in c:\program files\easyphp1-8\www\cart-demo\index.php on line 9&lt;br /&gt;    Your Shopping Cart&lt;br /&gt;&lt;br /&gt;    Notice: Undefined index: cart in c:\program files\easyphp1-8\www\cart-demo\inc\functions.inc.php on line 3&lt;br /&gt;&lt;br /&gt;    You have no items in your shopping cart&lt;br /&gt;    Books In Our Store&lt;br /&gt;&lt;br /&gt;    Notice: Query failed: No database selected SQL: SELECT * FROM books ORDER BY id in c:\program files\easyphp1-8\www\cart-demo\inc\mysql.class.php on line 109&lt;br /&gt;&lt;br /&gt;    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\www\cart-demo\inc\mysql.class.php on line 151&lt;br /&gt;&lt;br /&gt;    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\www\cart-demo\inc\mysql.class.php on line 167&lt;br /&gt;    #47&lt;br /&gt;&lt;br /&gt;ScopAL&lt;br /&gt;    1689 days ago&lt;br /&gt;    Notice: Undefined index: cart in z:\home\cart\www\inc\functions.inc.php on line 3&lt;br /&gt;&lt;br /&gt;    You have no items in your shopping cart&lt;br /&gt;&lt;br /&gt;    :((((&lt;br /&gt;    #48&lt;br /&gt;&lt;br /&gt;CHiNo4ReaL&lt;br /&gt;    1689 days ago&lt;br /&gt;    Jatty5&lt;br /&gt;    I think that you have selected the wrong database, your database is called wtchprojec, but in the script its selecting books&lt;br /&gt;    #49&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1689 days ago&lt;br /&gt;    jatty5: I would suggest that if you’re trying to learn to use PHP/MySQL, it would be a good idea to learn all about creating database connections, but here is how to fix your problem:&lt;br /&gt;&lt;br /&gt;    In global.inc.php, you have four variables that are used to create the database connection:&lt;br /&gt;&lt;br /&gt;    $host = ‘localhost’;&lt;br /&gt;    $user = ‘root’;&lt;br /&gt;    $pass = ‘’;&lt;br /&gt;    $name = ‘’;&lt;br /&gt;&lt;br /&gt;    These correspond to your host name (usually ‘localhost’), the username and password you are using, and the name of your database.&lt;br /&gt;&lt;br /&gt;    So in your case, just change the last line to $name=’wtchproject’; and the database connection class object will then be pointing at your database.&lt;br /&gt;    #50&lt;br /&gt;&lt;br /&gt;CHiNo4ReaL&lt;br /&gt;    1687 days ago&lt;br /&gt;    If I want the order mailed to me, how can I do that?&lt;br /&gt;    I have tried to do that, but i cant find any good ones, can u help me?&lt;br /&gt;    #51&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1687 days ago&lt;br /&gt;    I suppose you’d have to build in some data capture for the customer’s details, and then use mail() to send everything.&lt;br /&gt;&lt;br /&gt;    I’m not building the whole site for you, though..! ;)&lt;br /&gt;    #52&lt;br /&gt;&lt;br /&gt;CHiNo4ReaL&lt;br /&gt;    1686 days ago&lt;br /&gt;    ok, thanks anyway&lt;br /&gt;    #53&lt;br /&gt;&lt;br /&gt;Greg Hamilton&lt;br /&gt;    1684 days ago&lt;br /&gt;    Hey again Matt, what are your feelings on using cookies instead of sessions to remember the items that are in the shopping cart, do you think its necessary at all ?&lt;br /&gt;    #54&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1684 days ago&lt;br /&gt;    Greg: The benefit would obviously be that you would be able to leave the site and come back to the same basket; an approach using both sessions and cookies would probably be a good idea (with a fairly short expiration period).&lt;br /&gt;    #55&lt;br /&gt;&lt;br /&gt;Juilius&lt;br /&gt;    1683 days ago&lt;br /&gt;    Hi I am having problems with the cart.php, whenever I hit the refresh button it adds another quantity to the cart? Any ideas?&lt;br /&gt;    Oh by the way, great, great example!&lt;br /&gt;    #56&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1682 days ago&lt;br /&gt;    Juilius: Yes, refreshing the page will add another item to the cart due to its use of the querystring ($_GET collection) to handle addition.&lt;br /&gt;&lt;br /&gt;    You can get around it by adding an extra session variable and storing the last item added and the time it was added, then checking against that to see if it is a repeated entry within a certain timeframe.&lt;br /&gt;    #57&lt;br /&gt;&lt;br /&gt;Steven&lt;br /&gt;    1657 days ago&lt;br /&gt;    I’ll be messing around with this on XAMPP soon! I’m a bit of a PHP beginner but I thinks it’s important to dive in at the deep end!&lt;br /&gt;    #58&lt;br /&gt;&lt;br /&gt;Steven&lt;br /&gt;    1657 days ago&lt;br /&gt;    I’ll be messing around with this on XAMPP soon! I’m a bit of a PHP beginner but I thinks it’s important to dive in at the deep end!&lt;br /&gt;&lt;br /&gt;    PS. Edited to ask, does a shopping cart system like this have to be bolted onto a dynamic website or can I add it to static product pages?&lt;br /&gt;    #59&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1657 days ago&lt;br /&gt;    Steven: I’m not sure how you’d use it with static pages, as it relies on a database of product details – I suppose you could copy your static data into the database, but if you’re doing that you may as well be using the database to output your product info as well!&lt;br /&gt;    #60&lt;br /&gt;&lt;br /&gt;Fred&lt;br /&gt;    1641 days ago&lt;br /&gt;    I’m just curious, since this code connect to the db and all. Is this vulnerable to sql injection at all?&lt;br /&gt;&lt;br /&gt;    Can users modify the input variables or the session cookie to inject special characters that could cause buffer overflow in the SQL sequence?&lt;br /&gt;&lt;br /&gt;    I don’ recall seeing anywhere that inputs are scrubbed, but I could be wrong or the way the code is written, input scrubbing might be a non-issue.&lt;br /&gt;&lt;br /&gt;    Any confirmation on this?&lt;br /&gt;    #61&lt;br /&gt;&lt;br /&gt;Matthew Pennell&lt;br /&gt;    1640 days ago&lt;br /&gt;    Fred: You are correct that if you wanted to use this in a commercial setting it would be a good idea to add some validation of the session data when it is read to output the contents of the cart. This could be as simple as using preg_match to check that the ID of the product is numeric.&lt;br /&gt;    #62&lt;br /&gt;&lt;br /&gt;Fred&lt;br /&gt;    1640 days ago&lt;br /&gt;    This was some amazingly great cart code which gave me a good jump on what I wanted to create. Thanks Matt.&lt;br /&gt;&lt;br /&gt;    I did add some basic sanitization code to keep the db safe from SQL injects. You can take from the following.&lt;br /&gt;&lt;br /&gt;    I added a sanitization function and then called it on certain variable inputs used in the cart program:&lt;br /&gt;&lt;br /&gt;    function sanitize_system_string($string, $min=’’, $max=’’) {&lt;br /&gt;    $pattern = ’/(;|\||`|&gt;| $max)))&lt;br /&gt;    return FALSE;&lt;br /&gt;    return $string;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // these occur in various places&lt;br /&gt;    sanitize_system_string($_GET[‘id’],1,50)&lt;br /&gt;    $cart = sanitize_system_string($_SESSION[‘cart’]);&lt;br /&gt;    $action = sanitize_system_string($_GET[‘action’],1,50);&lt;br /&gt;&lt;br /&gt;    // assigned right underneath the update switch foreach loop&lt;br /&gt;    $key = sanitize_system_string($key,1,50);&lt;br /&gt;    #63&lt;br /&gt;&lt;br /&gt;Alex&lt;br /&gt;    1640 days ago&lt;br /&gt;    Thanx for the code Fred very helpful…&lt;br /&gt;    #64&lt;br /&gt;&lt;br /&gt;Fred&lt;br /&gt;    1639 days ago&lt;br /&gt;    Sorry the sanitize_system_string function got partially truncated by the comment submit form. The other examples of variable sanitization remained in tact though.&lt;br /&gt;&lt;br /&gt;    Anyway, folks can get the point. Find a sanitization function, insert it in the functions php document and then employ it throughout the cart code as needed.&lt;br /&gt;&lt;br /&gt;    I identified several good places in the last post :)&lt;br /&gt;&lt;br /&gt;    I love this cart code matt provided! It has provided me the basis to do some wonders with it!&lt;br /&gt;    #65&lt;br /&gt;&lt;br /&gt;Ella&lt;br /&gt;    1638 days ago&lt;br /&gt;    Hi There,&lt;br /&gt;    I am fairly new to php etc and am trying to do a shopping cart as part of my final project for my degree. I am getting an error when I click the add to cart link it goes through to the cart page but has the following error:&lt;br /&gt;    Parse error: parse error in c:\LocalUser\fashuti\public_html\cart.php on line 174&lt;br /&gt;    it is erroring on the last line of code on the page which is obciously not the problem. I have adapted the code on your size so that i can distinguish by id, size and colour. My id’s are both letter and charactger based. I can understand all of the code apart from one line which confuses me and I wonder if it could relate to that?&lt;br /&gt;    It seems you are comparing qty which is created here to the id?&lt;br /&gt;&lt;br /&gt;    foreach ($contents as $id=&gt;$qty) {&lt;br /&gt;&lt;br /&gt;    I wondered if this could be my problem?&lt;br /&gt;    I will post my cart code below:&lt;br /&gt;&lt;br /&gt;    Hi There,&lt;br /&gt;    I am fairly new to php etc and am trying to do a shopping cart as part of my final project for my degree. I am getting an error when I click the add to cart link it goes through to the cart page but has the following error:&lt;br /&gt;    Parse error: parse error in c:\LocalUser\fashuti\public_html\cart.php on line 174&lt;br /&gt;    it is erroring on the last line of code on the page which is obciously not the problem. I have adapted the code on your size so that i can distinguish by id, size and colour. My id’s are both letter and charactger based. I can understand all of the code apart from one line which confuses me and I wonder if it could relate to that?&lt;br /&gt;    It seems you are comparing qty which is created here to the id?&lt;br /&gt;&lt;br /&gt;    foreach ($contents as $id=&gt;$qty) {&lt;br /&gt;&lt;br /&gt;    I wondered if this could be my problem?&lt;br /&gt;    I will post my cart code below:&lt;br /&gt;&lt;br /&gt;    $total = 0;&lt;br /&gt;    $output[] = ‘’;&lt;br /&gt;&lt;br /&gt;    $conn=odbc_connect(‘danum_fashu’,’’,’’);&lt;br /&gt;    foreach ($contents as $id=&gt;$qty) {&lt;br /&gt;    $sql = ‘SELECT * FROM products, product_line WHERE products.product_id = ’.$id.’ AND products.product_id = product_line.product_id AND product_line.product_size= ’.$sz.’ AND product_line.product_colour = ’.$col;&lt;br /&gt;    $rs=odbc_exec($conn,$sql);&lt;br /&gt;&lt;br /&gt;    $pid=odbc_result($rs,”product_line.product_id”);&lt;br /&gt;    $size=odbc_result($rs,”product_line.product_size”);&lt;br /&gt;    $name=odbc_result($rs,”products.product_name”);&lt;br /&gt;    $colour=odbc_result($rs,”product_line.product_colour”);&lt;br /&gt;    $cost=odbc_result($rs,”products.product_costprice”);&lt;br /&gt;    $endcost = number_format($cost * 2.6, 2, ’.’, ’,’);&lt;br /&gt;&lt;br /&gt;    $output[] = ‘’;&lt;br /&gt;    $output[] = ‘’.$pid.’ by ’.$name.’’;&lt;br /&gt;    $output[] = ‘’.$size.’ ’.$colour.’’;&lt;br /&gt;    $output[] = ’£’.$endcost.’’;&lt;br /&gt;    $output[] = ‘’;&lt;br /&gt;    $output[] = ’£’.($endcost * $qty).’’;&lt;br /&gt;    $output[] = ‘Remove’;&lt;br /&gt;    $total += $endcost * $qty;&lt;br /&gt;    $output[] = ‘’;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    $output[] = ‘’;&lt;br /&gt;    $output[] = ‘Grand total: £’.$total.’’;&lt;br /&gt;    odbc_close($conn);&lt;br /&gt;&lt;br /&gt;    Any help would be gratefully recieved</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/2211442694353479337/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/2211442694353479337' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/2211442694353479337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/2211442694353479337'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/10/php-shopping-cart-code.html' title='php shopping cart code'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-7294501033906668423</id><published>2010-10-09T08:27:00.000-07:00</published><updated>2010-10-09T08:29:19.037-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SimpleXML php xml"/><title type='text'>SimpleXML介绍</title><content type='html'>SimpleXML提供了一种简单，直观的方法来处理XML。它只有一个单一类型的类，三个函数和六个方法。&lt;br /&gt;&lt;br /&gt;使用SimpleXML&lt;br /&gt;&lt;br /&gt;SimpleXMLElement 类是这个扩展中所有操作的核心类。可以用new关键字直接创建这种类，或是使用simplexml_load_file()或 simplexml_load_string()函数返回这种类。本文将使用清单7-1的XML文档来说明如何使用SimpleXML，将此文档命名为 sml.xml。&lt;br /&gt;&lt;br /&gt;清单7-1 sml.xml&lt;br /&gt;&lt;br /&gt;1. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;br /&gt;2. &lt;!DOCTYPE book PUBLIC &quot;-//OASIS//DTD DocBook XML V4.1.2//EN&quot;&lt;br /&gt;3. &quot;http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd&quot;&gt;&lt;br /&gt;4. &lt;book lang=&quot;en&quot;&gt;&lt;br /&gt;5.     &lt;bookinfo&gt;&lt;br /&gt;6.         &lt;title&gt;SimpleXML in PHP 5&lt;/title&gt;&lt;br /&gt;7.         &lt;author&gt;&lt;br /&gt;8.             &lt;firstname&gt;Rob&lt;/firstname&gt;&lt;br /&gt;9.             &lt;surname&gt;Richards&lt;/surname&gt;&lt;br /&gt;10.         &lt;/author&gt;&lt;br /&gt;11.         &lt;copyright&gt;&lt;br /&gt;12.             &lt;year&gt;2005&lt;/year&gt;&lt;br /&gt;13.             &lt;holder&gt;Rob Richards&lt;/holder&gt;&lt;br /&gt;14.         &lt;/copyright&gt;&lt;br /&gt;15.     &lt;/bookinfo&gt;&lt;br /&gt;16.     &lt;preface&gt;&lt;br /&gt;17.         &lt;title&gt;Using SimpleXML&lt;/title&gt;&lt;br /&gt;18.         &lt;para&gt;An example DOM Tree using DocBook.&lt;/para&gt;&lt;br /&gt;19.     &lt;/preface&gt;&lt;br /&gt;20.     &lt;chapter id=&quot;navigation&quot;&gt;&lt;br /&gt;21.         &lt;title&gt;Accessing Elements&lt;/title&gt;&lt;br /&gt;22.         &lt;para&gt;Elements are accessed as properties&lt;/para&gt;&lt;br /&gt;23.         &lt;para&gt;&lt;br /&gt;24.         &lt;![CDATA[&lt;br /&gt;25.         &lt;?php&lt;br /&gt;26.         $data = &#39;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;27.         &lt;root&gt;content&lt;/root&gt;&#39;;&lt;br /&gt;28.         $sxe = simplexml_load_string($data);&lt;br /&gt;29.         var_dump($sxe);&lt;br /&gt;30.         ?&gt;&lt;br /&gt;31.         ]]&gt;&lt;br /&gt;32.         &lt;/para&gt;&lt;br /&gt;33.     &lt;/chapter&gt;&lt;br /&gt;34. &lt;/book&gt;&lt;br /&gt;&lt;br /&gt;创建一个SimpleXMLElement对象&lt;br /&gt;&lt;br /&gt;使用new关键字创建&lt;br /&gt;&lt;br /&gt;1. $xml = &quot;&lt;root&gt;&lt;node1&gt;Content&lt;/node1&gt;&lt;/root&gt;&quot;;&lt;br /&gt;2. $sxe = new SimpleXMLElement($xml);//SimpleXMLElement Object ( [node1] =&gt; Content ) &lt;br /&gt;&lt;br /&gt;使用simplexml_load_string()创建&lt;br /&gt;&lt;br /&gt;1. $xml = &quot;&lt;root&gt;&lt;node1&gt;Content&lt;/node1&gt;&lt;/root&gt;&quot;;&lt;br /&gt;2. $sxe = simplexml_load_string($xml);//SimpleXMLElement Object ( [node1] =&gt; Content ) &lt;br /&gt;&lt;br /&gt;如何选择这两种创建SimpleXMLElement的方法呢？simplexml_load_string()提供了更多的函数，比如控制解析选项的能力。如果不需要这些额外的函数的话就可以凭个人爱好选择一种方法。&lt;br /&gt;&lt;br /&gt;使用simplexml_load_file()从一个URI创建&lt;br /&gt;&lt;br /&gt;1. $sxe = simplexml_load_file(&quot;filename.xml&quot;); &lt;br /&gt;&lt;br /&gt;simplexml_load_string()和simplexml_load_file()都有一个必需的参数和可选的参数。从PHP5.1开始simplexml_load_file()多了一个用来控制解析行为的第三个参数。&lt;br /&gt;&lt;br /&gt;1. /* Prototype for PHP 5.0 */&lt;br /&gt;2. simplexml_load_file(string data [, string class_name])&lt;br /&gt;3. /* Prototype for PHP 5.1 */&lt;br /&gt;4. simplexml_load_file(string data [, string class_name [, int options]]) &lt;br /&gt;&lt;br /&gt;保存XML数据&lt;br /&gt;&lt;br /&gt;与DOM扩展一样，SimpleXML也提供了一个用来输出XML内容的方法asXML()。可以用这个方法以字符串或文件形式输出这个文档或文档中的某个节点。&lt;br /&gt;&lt;br /&gt;1. $xml = &quot;&lt;root&gt;&lt;node1&gt;content&lt;/node1&gt;&lt;/root&gt;&quot;;&lt;br /&gt;2. $sxe = new SimpleXMLElement($xml);&lt;br /&gt;3. print $sxe-&gt;asXML();&lt;br /&gt;4. $sxe-&gt;asXML(&#39;test.xml&#39;); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;2. &lt;root&gt;&lt;node1&gt;content&lt;/node1&gt;&lt;/root&gt;&lt;br /&gt;&lt;br /&gt;访问元素节点&lt;br /&gt;&lt;br /&gt;在SimpleXML中，可以直接通过元素的名称来访问特定的元素。&lt;br /&gt;&lt;br /&gt;访问元素&lt;br /&gt;&lt;br /&gt;当一个文档被载入SimpleXML时，文档被看成是一个SimpleXML对象，文档中的所有元素都被看成是该对象的属性。&lt;br /&gt;&lt;br /&gt;1. &lt;?php&lt;br /&gt;2. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;3. /* Access the bookinfo child element of the book element */&lt;br /&gt;4. $bookinfo = $book-&gt;bookinfo;&lt;br /&gt;5. /* Access the title child element from the bookinfo element */&lt;br /&gt;6. $title = $bookinfo-&gt;title;&lt;br /&gt;7. ?&gt;&lt;br /&gt;&lt;br /&gt;如果使用DOM来访问title，代码如下&lt;br /&gt;&lt;br /&gt;1. $dom = new DOMDocument();&lt;br /&gt;2. $dom-&gt;load(&#39;sxml.xml&#39;);&lt;br /&gt;3. $book = $dom-&gt;documentElement;&lt;br /&gt;4. foreach($book-&gt;childNodes as $node) {&lt;br /&gt;5.     if ($node-&gt;nodeName == &quot;bookinfo&quot;) {&lt;br /&gt;6.         foreach($node-&gt;childNodes as $child) {&lt;br /&gt;7.             if ($child-&gt;nodeName == &quot;title&quot;) {&lt;br /&gt;8.                 $node = $child;&lt;br /&gt;9.                 break 2;&lt;br /&gt;10.             }&lt;br /&gt;11.         }&lt;br /&gt;12.     }&lt;br /&gt;13. }&lt;br /&gt;14. if ($node) {&lt;br /&gt;15.     $title = $node;&lt;br /&gt;16. } &lt;br /&gt;&lt;br /&gt;显然SimpleXML对的起它的名字。&lt;br /&gt;&lt;br /&gt;访问内容&lt;br /&gt;&lt;br /&gt;1. &lt;?php&lt;br /&gt;2. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;3. $bookinfo = $book-&gt;bookinfo;&lt;br /&gt;4. $title = $bookinfo-&gt;title;&lt;br /&gt;5. /* Object examined with var_dump */&lt;br /&gt;6. var_dump($title);&lt;br /&gt;7. /* Using print with element containing text-only content */&lt;br /&gt;8. print &quot;Title: &quot;.$title.&quot;\n&quot;;&lt;br /&gt;9. $author = $bookinfo-&gt;author;&lt;br /&gt;10. /* Object examined with var_dump */&lt;br /&gt;11. var_dump($author);&lt;br /&gt;12. /* Using print with element containing child elements */&lt;br /&gt;13. print &quot;Author: &quot;.$author.&quot;\n&quot;;&lt;br /&gt;14. ?&gt;&lt;br /&gt;&lt;br /&gt;这段代码检查了两个SimpleXMLElement对象，$author和$title。两者的区别是$author元素有包含子元素而$title元素只包含一个文本节点。&lt;br /&gt;输出如下：&lt;br /&gt;object(SimpleXMLElement)#4 (1) {&lt;br /&gt;[0]=&gt;&lt;br /&gt;string(18) “SimpleXML in PHP 5″&lt;br /&gt;}&lt;br /&gt;Title: SimpleXML in PHP 5&lt;br /&gt;object(SimpleXMLElement)#6 (2) {&lt;br /&gt;[”firstname”]=&gt;&lt;br /&gt;string(3) “Rob”&lt;br /&gt;[”surname”]=&gt;&lt;br /&gt;string(8) “Richards”&lt;br /&gt;}&lt;br /&gt;Author:&lt;br /&gt;&lt;br /&gt;检查输出结果可以发现，$title是一个包含有文本内容的SimpleXMLElement对象，索引0表示元素的文本内容，当打印$title时，文本内容将以字符串形式返回。&lt;br /&gt;&lt;br /&gt;$author元素有两个子元素，从输出结果可以看出，这些子元素被看成SimpleXMLElement对象的属性，这些属性的值是它们对应的节点包含的内容。用print输出$author时，输出结果是空格和换行符。&lt;br /&gt;&lt;br /&gt;如果一个元素无子元素，只包含文本内容，那么可以将此元素所对应的SimpleXMLElement对象视为一个字符串来使用，有些情况下，为了获得以字符串形式返回文本内容，必须执行类型转换操作：&lt;br /&gt;&lt;br /&gt;1. $titlecontent = (string) $title; &lt;br /&gt;&lt;br /&gt;有子元素的元素所对应的SimpleXMLElement对象将返回该对象直属的文本节点，而不是任一子元素的内容。如果用print输出$author，将得到一个27字符长度，包含空格和换行符的字符。 Neither of the child elements,firstname or surname, nor their content is returned in the string.&lt;br /&gt;&lt;br /&gt;为了理解最后一点，可以运行一些下面这段代码：&lt;br /&gt;&lt;br /&gt;1. $doc = new SimpleXMLElement(&#39;&lt;root&gt;some&lt;child1&gt;subtext&lt;/child1&gt;thing&lt;/root&gt;&#39;);&lt;br /&gt;2. print $doc; &lt;br /&gt;&lt;br /&gt;使用迭代对象&lt;br /&gt;&lt;br /&gt;SimpleXMLElement 对象在大多数情况下是可迭代的，可以用这个特性来访问文档中多个元素名一样的节点，如清单7-1中的para元素。在使用元素名作为属性来访问一个元素时，SimpleXMLElement对象不是一个单一节点的存取器，它实际上是作为属性访问的元素名节点的集合。直接利用元素名作为属性访问实际上访问访问这个集合中的第一个元素。&lt;br /&gt;&lt;br /&gt;看下这段代码&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $para = $book-&gt;chapter-&gt;para;&lt;br /&gt;3. print $para.&quot;\n&quot;;&lt;br /&gt;4. foreach($para AS $node) {&lt;br /&gt;5.     print $node.&quot;\n&quot;;&lt;br /&gt;6. } &lt;br /&gt;&lt;br /&gt;这段代码中，$para变量就是para元素的集合，实际上包含了两个元素。如果直接访问$para的话实际上是访问第一个para元素，利用迭代可以看出 $para所包含的内容是两个元素。其中CDATA节点被看做是纯文本的内容，其中包含的空格和换行符都会被如实输出。&lt;br /&gt;&lt;br /&gt;用迭代的方式来访问所有的元素显然不太实际，有时候我们希望访问结果集中的某个特定的元素，这时可以使用从0开始的索引来访问这个结果集，例如：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $para = $book-&gt;chapter-&gt;para[1];&lt;br /&gt;3. print &quot;Content: &quot;.$para.&quot;\n&quot;;&lt;br /&gt;4. foreach($para AS $node) {&lt;br /&gt;5.     print &quot;Iter Content: &quot;.$node.&quot;\n&quot;;&lt;br /&gt;6. } &lt;br /&gt;&lt;br /&gt;运行这段代码会发现foreach循环失效了，这是因为SimpleXML知道你只是在寻找结果集中某个特定的元素，这种情况下对象是不可迭代的。&lt;br /&gt;&lt;br /&gt;Caution:使用索引方式访问一个SimpleXMLElement对象会返回一个不可以迭代的对象，因为它是一个单一的元素而不是一个元素集。&lt;br /&gt;&lt;br /&gt;访问未知元素&lt;br /&gt;&lt;br /&gt;在不知道XML文档的结构的情况下可以利用SimpleXML中的children()方法来返回一个可以迭代方式访问的某个元素的所有子元素的SimpleXML对象。如：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $author = $book-&gt;bookinfo-&gt;author;&lt;br /&gt;3. $children = $author-&gt;children();&lt;br /&gt;4. foreach($children AS $child) {&lt;br /&gt;5.     print $child.&quot;\n&quot;;&lt;br /&gt;6. } &lt;br /&gt;&lt;br /&gt;上述代码用children()方法返回了author节点下的所有子元素，然后用foreach循环输出。也可以使用索引方式访问返回的子元素，如echo $children[1];。&lt;br /&gt;&lt;br /&gt;理解PHP对象函数&lt;br /&gt;&lt;br /&gt;SimpleXMLElement对象的属性是动态的，因为这些属性是由对象实例决定的，而不是由类本身决定的。在PHP中，可以利用get_object_vars()函数来返回某个对象的所有属性，返回的结果是一个包含属性和值的数组，如：&lt;br /&gt;&lt;br /&gt;1. $props = get_object_vars($author);&lt;br /&gt;2. foreach ($props AS $name=&gt;$value) {&lt;br /&gt;3.     print $name.&quot;: &quot;.$value.&quot;\n&quot;;&lt;br /&gt;4. } &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;firstname: Rob&lt;br /&gt;surname: Richards&lt;br /&gt;这段代码访问的子元素都只包含文本内容，所以返回的数组只包含属性名和值，对于一个包含许多子节点的元素，返回的结果稍微复杂点：&lt;br /&gt;&lt;br /&gt;1. $props = get_object_vars($book-&gt;bookinfo);&lt;br /&gt;2. var_dump($props); &lt;br /&gt;&lt;br /&gt;输出:&lt;br /&gt;&lt;br /&gt;array(3) {&lt;br /&gt;[”title”]=&gt;&lt;br /&gt;string(18) “SimpleXML in PHP 5″&lt;br /&gt;[”author”]=&gt;&lt;br /&gt;object(SimpleXMLElement)#4 (2) {&lt;br /&gt;[”firstname”]=&gt;&lt;br /&gt;string(3) “Rob”&lt;br /&gt;[”surname”]=&gt;&lt;br /&gt;string(8) “Richards”&lt;br /&gt;}&lt;br /&gt;[”copyright”]=&gt;&lt;br /&gt;object(SimpleXMLElement)#5 (2) {&lt;br /&gt;[”year”]=&gt;&lt;br /&gt;string(4) “2005″&lt;br /&gt;[”holder”]=&gt;&lt;br /&gt;string(12) “Rob Richards”&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;使用DOM互操作&lt;br /&gt;&lt;br /&gt;另一种访问未知元素的方法是使用DOM，可以将一个节点导入DOM扩展，然后使用DOM的属性和方法来处理。&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $author = $book-&gt;bookinfo-&gt;author;&lt;br /&gt;3. $children = $author-&gt;children();&lt;br /&gt;4. foreach($children AS $child) {&lt;br /&gt;5.     /* Import node into DOM, and get nodeName */&lt;br /&gt;6.     $element = dom_import_simplexml($child);&lt;br /&gt;7.     $name = $element-&gt;nodeName;&lt;br /&gt;8.     print $name.&quot;: &quot;.$child.&quot;\n&quot;;&lt;br /&gt;9. } &lt;br /&gt;&lt;br /&gt;将节点导入DOM扩展时并没有创建一个节点的副本(copy)，而是直接访问导入的节点（JIMMY注：这个概念很重要）。&lt;br /&gt;&lt;br /&gt;修改内容&lt;br /&gt;&lt;br /&gt;利用SimpleXML修改元素内容非常方便，你可以改变或移除树中的某个元素，但是不能直接在树中添加一个元素。要添加一个元素，可以使用DOM的互操作性：&lt;br /&gt;&lt;br /&gt;1. $xml = &quot;&lt;root&gt;&lt;node1&gt;content&lt;/node1&gt;&lt;/root&gt;&quot;;&lt;br /&gt;2. $sxe = new SimpleXMLElement($xml);&lt;br /&gt;3. $dom = dom_import_simplexml($sxe);&lt;br /&gt;4. $dom-&gt;appendChild(new DOMElement(&quot;node2&quot;, &quot;content2&quot;));&lt;br /&gt;5. print $sxe-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;2. &lt;root&gt;&lt;node1&gt;content&lt;/node1&gt;&lt;node2&gt;content2&lt;/node2&gt;&lt;/root&gt;&lt;br /&gt;&lt;br /&gt;编辑文本内容&lt;br /&gt;&lt;br /&gt;可以利用SimpleXML的属性赋值方法来直接编辑一个元素的内容，要主意的是如果文档中有多个元素名一样的元素，如果没有使用索引来指定要编辑哪个元素时PHP将发出一个警告。如：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. /* Modify an unspecified para element where multiple para elements exist */&lt;br /&gt;3. $book-&gt;chapter-&gt;para = &quot;Removed CDATA&quot;; &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;Warning: main() [/phpmanual/function.main.html]: Cannot assign to an array of nodes&lt;br /&gt;(duplicate subnodes or attr detected)&lt;br /&gt;&lt;br /&gt;必须给para指定索引告诉程序你要编辑哪个元素：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book-&gt;chapter-&gt;para[1] = &quot;Removed CDATA&quot;;&lt;br /&gt;3. print $book-&gt;chapter-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;chapter id=&quot;navigation&quot;&gt;&lt;br /&gt;2.     &lt;title&gt;Acessing Elements&lt;/title&gt;&lt;br /&gt;3.     &lt;para&gt;Elements are accessed as properties&lt;/para&gt;&lt;br /&gt;4.     &lt;para&gt;Removed CDATA&lt;/para&gt;&lt;br /&gt;5. &lt;/chapter&gt;&lt;br /&gt;&lt;br /&gt;这样，第二个para元素的内容被改为Removed CDATA。如果要编辑一个在文档中唯一存在的元素可不必指定索引，直接修改。如修改title：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book-&gt;chapter-&gt;title = &quot;New Title&quot;;&lt;br /&gt;3. $book-&gt;chapter-&gt;para[1] = &quot;Removed CDATA&quot;;&lt;br /&gt;4. print $book-&gt;chapter-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;chapter id=&quot;navigation&quot;&gt;&lt;br /&gt;2.     &lt;title&gt;New Title&lt;/title&gt;&lt;br /&gt;3.     &lt;para&gt;Elements are accessed as properties&lt;/para&gt;&lt;br /&gt;4.     &lt;para&gt;Removed CDATA&lt;/para&gt;&lt;br /&gt;5. &lt;/chapter&gt;&lt;br /&gt;&lt;br /&gt;强烈建议使用索引来编辑元素，除非你对文档的结果非常确定。使用索引来编辑title元素会比较安全，如$book-&gt;chapter-&gt;title[0] = “New Title”;这行代码用索引[0]指定要编辑第一个title。&lt;br /&gt;&lt;br /&gt;编辑有子树的元素&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $cholder = $book-&gt;bookinfo-&gt;copyright-&gt;holder;&lt;br /&gt;3. print $cholder-&gt;asXML().&quot;\n&quot;;&lt;br /&gt;4. $book-&gt;bookinfo = &quot;No Book Info&quot;;&lt;br /&gt;5. print $book-&gt;bookinfo-&gt;asXML().&quot;\n&quot;;&lt;br /&gt;6. print $cholder-&gt;asXML().&quot;\n&quot;; &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;holder&gt;Rob Richards&lt;/holder&gt;&lt;br /&gt;2. &lt;bookinfo&gt;No Book Info&lt;/bookinfo&gt;&lt;br /&gt;3. Warning: SimpleXMLElement::asXML() [/phpmanual/function.asXML.html]: Node no&lt;br /&gt;4. longer exists in N:\CVS Projects\php5\Debug_TS\booksxe.php on line 7&lt;br /&gt;&lt;br /&gt;这段代码中，首先将文档中的holder元素赋值给$cholder变量，然后打印该变量。bookinfo元素包含有title，author和 copyright子树，它的内容被字符串No Book Info代替，从bookinfo的输出结果可以看出，它的子树被清空并且被字符串代替了。接着试图再次打印$cholder变量的XML内容，程序输出一个警告，这个变量依然是一个SimpleXMLElement对象，但它所属的节点在bookinfo元素改变时已经被破坏了。&lt;br /&gt;&lt;br /&gt;另一种情况。将bookinfo元素中的子元素用字符串 代替。&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book-&gt;bookinfo = &quot;&lt;title&gt;SimpleXML in PHP 5&lt;/title&gt;&quot;;&lt;br /&gt;3. print $book-&gt;bookinfo-&gt;asXML().&quot;\n&quot;; &lt;br /&gt;&lt;br /&gt;如果你认为上述代码将bookinfo中的内容清空后再给bookinfo创建了一个子节点title，那么你错了。输出结果是&lt;br /&gt;&lt;title&gt;SimpleXML in PHP 5&lt;/title&gt;&lt;br /&gt;实际上bookinfo元素的子元素都被移除了，但是新赋值的XML数据被转义成文本内容，而不是一个新的子元素。&lt;br /&gt;&lt;br /&gt;如果想用一个子树代替另一个子树，可以利用DOM扩展：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $bookinfo = dom_import_simplexml($book-&gt;bookinfo);&lt;br /&gt;3. /* 移除bookinfo元素下的所有子元素*/&lt;br /&gt;4. while ($bookinfo-&gt;firstChild) {&lt;br /&gt;5. $bookinfo-&gt;removeChild($bookinfo-&gt;firstChild);&lt;br /&gt;6. }&lt;br /&gt;7. $bookinfo-&gt;appendChild(new DOMElement(&quot;title&quot;, &quot;SimpleXML in PHP 5&quot;));&lt;br /&gt;8. print $book-&gt;bookinfo-&gt;asXML().&quot;\n&quot;; &lt;br /&gt;&lt;br /&gt;输出结果：&lt;br /&gt;&lt;br /&gt;1. &lt;bookinfo&gt;&lt;br /&gt;2. &lt;title&gt;SimpleXML in PHP 5&lt;/title&gt;&lt;br /&gt;3. &lt;/bookinfo&gt;&lt;br /&gt;&lt;br /&gt;移除元素&lt;br /&gt;&lt;br /&gt;可以用PHP内置函数unset()来将一个元素从树中移除。unset()的参数必须是一个SimpleXMLElement，用属性方法来访问要移除的元素。例如，从chapter节点移除title元素：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book-&gt;chapter-&gt;para[1] = &quot;Removed CDATA&quot;;&lt;br /&gt;3. unset($book-&gt;chapter-&gt;title);&lt;br /&gt;4. print $book-&gt;chapter-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;上述代码执行后，chapter的结构为：&lt;br /&gt;&lt;br /&gt;1. &lt;chapter id=&quot;navigation&quot;&gt;&lt;br /&gt;2.  &lt;br /&gt;3.     &lt;para&gt;Elements are accessed as properties&lt;/para&gt;&lt;br /&gt;4.     &lt;para&gt;Removed CDATA&lt;/para&gt;&lt;br /&gt;5. &lt;/chapter&gt;&lt;br /&gt;&lt;br /&gt;将这个结果与下面代码执行的结果想比较：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book-&gt;chapter-&gt;para[1] = &quot;Removed CDATA&quot;;&lt;br /&gt;3. $title = $book-&gt;chapter-&gt;title;&lt;br /&gt;4. unset($title);&lt;br /&gt;5. print $book-&gt;chapter-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出结果&lt;br /&gt;&lt;br /&gt;1. &lt;chapter id=&quot;navigation&quot;&gt;&lt;br /&gt;2.     &lt;title&gt;Acessing Elements&lt;/title&gt;&lt;br /&gt;3.     &lt;para&gt;Elements are accessed as properties&lt;/para&gt;&lt;br /&gt;4.     &lt;para&gt;Removed CDATA&lt;/para&gt;&lt;br /&gt;5. &lt;/chapter&gt;&lt;br /&gt;&lt;br /&gt;title元素没有被移除，unset函数只对$title变量作用并没有将title元素从树中移除。&lt;br /&gt;&lt;br /&gt;在移除一个元素时必须注意，用索引来指定的特定元素不会被移除：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book-&gt;chapter-&gt;para[1] = &quot;Removed CDATA&quot;;&lt;br /&gt;3. unset($book-&gt;chapter-&gt;title[0]);&lt;br /&gt;4. print $book-&gt;chapter-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;chapter id=&quot;navigation&quot;&gt;&lt;br /&gt;2.     &lt;title&gt;Acessing Elements&lt;/title&gt;&lt;br /&gt;3.     &lt;para&gt;Elements are accessed as properties&lt;/para&gt;&lt;br /&gt;4.     &lt;para&gt;Removed CDATA&lt;/para&gt;&lt;br /&gt;5. &lt;/chapter&gt;&lt;br /&gt;&lt;br /&gt;如果要移除所有的para元素时可以利用下面代码：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. unset($book-&gt;chapter-&gt;para);&lt;br /&gt;3. print $book-&gt;chapter-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;chapter id=&quot;navigation&quot;&gt;&lt;br /&gt;2.     &lt;title&gt;Acessing Elements&lt;/title&gt;&lt;br /&gt;3.  &lt;br /&gt;4.  &lt;br /&gt;5. &lt;/chapter&gt;&lt;br /&gt;&lt;br /&gt;问题是如果你只想移除其中的一个para元素时要怎么办。这时可以再次用到DOM扩展：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $chapter = dom_import_simplexml($book-&gt;chapter);&lt;br /&gt;3. $node = $chapter-&gt;lastChild;&lt;br /&gt;4. while($node) {&lt;br /&gt;5.     if ($node-&gt;nodeName == &quot;para&quot;) {&lt;br /&gt;6.         $chapter-&gt;removeChild($node);&lt;br /&gt;7.         $node = NULL;&lt;br /&gt;8.         break;&lt;br /&gt;9.     }&lt;br /&gt;10.     $node = $node-&gt;previousSibling;&lt;br /&gt;11. }&lt;br /&gt;12. print $book-&gt;chapter-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;chapter id=&quot;navigation&quot;&gt;&lt;br /&gt;2.     &lt;title&gt;Acessing Elements&lt;/title&gt;&lt;br /&gt;3.     &lt;para&gt;Elements are accessed as properties&lt;/para&gt;&lt;br /&gt;4.  &lt;br /&gt;5. &lt;/chapter&gt;&lt;br /&gt;&lt;br /&gt;所幸的是PHP5.2开始已经支持删除用索引指定的元素了：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. unset($book-&gt;chapter-&gt;para[1]);&lt;br /&gt;3. print $book-&gt;chapter-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;访问属性&lt;br /&gt;&lt;br /&gt;读取属性&lt;br /&gt;&lt;br /&gt;下面的代码输出了book元素中的lang属性&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. print $book[&#39;lang&#39;]; &lt;br /&gt;&lt;br /&gt;访问用索引指定的元素的属性：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. print $book-&gt;chapter[0][&#39;id&#39;]; &lt;br /&gt;&lt;br /&gt;在不知道属性名的情况下可以用attributes()方法来输出属性：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. foreach($book-&gt;chapter-&gt;attributes() AS $attribute) {&lt;br /&gt;3.     print $attribute.&quot;\n&quot;;&lt;br /&gt;4. } &lt;br /&gt;&lt;br /&gt;如果要获得位置的属性名，可以使用DOM扩展：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. foreach($book-&gt;chapter-&gt;attributes() AS $attribute) {&lt;br /&gt;3.     $att = dom_import_simplexml($attribute);&lt;br /&gt;4.     print $att-&gt;nodeName.&quot;\n&quot;;&lt;br /&gt;5.     print $attribute.&quot;\n&quot;;&lt;br /&gt;6. } &lt;br /&gt;&lt;br /&gt;修改属性&lt;br /&gt;修改属性的值跟修改元素的值一样，直接对其赋值就可以了：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book[&#39;lang&#39;] = &quot;es&quot;;&lt;br /&gt;3. print $book[&#39;lang&#39;]; &lt;br /&gt;&lt;br /&gt;添加一个属性也很简单，如果对一个不存在的属性名进行赋值就给元素创建一个新属性&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book-&gt;bookinfo-&gt;author-&gt;firstname[&quot;prefix&quot;] = &quot;Mr.&quot;;&lt;br /&gt;3. print $book-&gt;bookinfo-&gt;author-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;author&gt;&lt;br /&gt;2.     &lt;firstname prefix=&quot;Mr.&quot;&gt;Rob&lt;/firstname&gt;&lt;br /&gt;3.     &lt;surname&gt;Richards&lt;/surname&gt;&lt;br /&gt;4. &lt;/author&gt;&lt;br /&gt;&lt;br /&gt;移除属性&lt;br /&gt;&lt;br /&gt;移除属性也用到unset()函数:&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxml.xml&#39;);&lt;br /&gt;2. $book-&gt;bookinfo-&gt;author-&gt;firstname[&quot;prefix&quot;] = &quot;Mr.&quot;;&lt;br /&gt;3. print $book-&gt;bookinfo-&gt;author-&gt;firstname-&gt;asXML().&quot;\n\n&quot;;&lt;br /&gt;4. unset($book-&gt;bookinfo-&gt;author-&gt;firstname[&quot;prefix&quot;]);&lt;br /&gt;5. print $book-&gt;bookinfo-&gt;author-&gt;firstname-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;firstname prefix=&quot;Mr.&quot;&gt;Rob&lt;/firstname&gt;&lt;br /&gt;2.  &lt;br /&gt;3. &lt;firstname&gt;Rob&lt;/firstname&gt;&lt;br /&gt;&lt;br /&gt;扩展SimpleXMLElement类&lt;br /&gt;&lt;br /&gt;1. class mySXE extends SimpleXMLElement {&lt;br /&gt;2.     function appendChild($name, $content) {&lt;br /&gt;3.         $dom = dom_import_simplexml($this);&lt;br /&gt;4.         $dom-&gt;appendChild($dom-&gt;ownerDocument-&gt;createElement($name, $content));&lt;br /&gt;5.     }&lt;br /&gt;6. } &lt;br /&gt;&lt;br /&gt;当实例化扩展的类时，文档的每个节点对象的类型都是扩展类的类型。&lt;br /&gt;&lt;br /&gt;1. $sxe = new mySXE(&quot;&lt;root&gt;&lt;node1&gt;&lt;/node1&gt;&lt;/root&gt;&quot;);&lt;br /&gt;2. $sxe-&gt;node1-&gt;appendChild(&quot;node2&quot;, &quot;content&quot;);&lt;br /&gt;3. print $sxe-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出：&lt;br /&gt;&lt;br /&gt;1. &lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;2. &lt;root&gt;&lt;node1&gt;&lt;node2&gt;content&lt;/node2&gt;&lt;/node1&gt;&lt;/root&gt;&lt;br /&gt;&lt;br /&gt;使用new方法可以用来处理字符串类型的XML，如果XML保存在一个文件中，那么可以将扩展的类名作为第二个参数传给simplexml_load_string或simplexml_load_file&lt;br /&gt;&lt;br /&gt;1. $sxe = simplexml_load_string(&quot;&lt;root&gt;&lt;node1&gt;&lt;/node1&gt;&lt;/root&gt;&quot;, &quot;mySXE&quot;);&lt;br /&gt;2. $sxe-&gt;node1-&gt;appendChild(&quot;node2&quot;, &quot;content&quot;);&lt;br /&gt;3. print $sxe-&gt;asXML(); &lt;br /&gt;&lt;br /&gt;输出结果与用new关键字输出的结果一样。&lt;br /&gt;&lt;br /&gt;在SimpleXML中使用命名空间&lt;br /&gt;&lt;br /&gt;将清单7-1的内容改为&lt;br /&gt;&lt;br /&gt;1. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;br /&gt;2. &lt;book lang=&quot;en&quot;&gt;&lt;br /&gt;3. &lt;bookinfo xmlns=&quot;http://www.example.com/ns1&quot;&gt;&lt;br /&gt;4.     &lt;title&gt;SimpleXML in PHP 5&lt;/title&gt;&lt;br /&gt;5.     &lt;author&gt;&lt;br /&gt;6.         &lt;firstname&gt;Rob&lt;/firstname&gt;&lt;br /&gt;7.         &lt;surname&gt;Richards&lt;/surname&gt;&lt;br /&gt;8.     &lt;/author&gt;&lt;br /&gt;9.     &lt;copyright&gt;&lt;br /&gt;10.         &lt;year&gt;2005&lt;/year&gt;&lt;br /&gt;11.         &lt;holder&gt;Rob Richards&lt;/holder&gt;&lt;br /&gt;12.     &lt;/copyright&gt;&lt;br /&gt;13.     &lt;/bookinfo&gt;&lt;br /&gt;14. &lt;/book&gt;&lt;br /&gt;&lt;br /&gt;如果试图用普通的方法来访问元素或属性，你会分析这并不可行，例如：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxmlns.xml&#39;);&lt;br /&gt;2. print $book[&quot;lang&quot;].&quot;\n&quot;;&lt;br /&gt;3. print $book-&gt;bookinfo-&gt;title.&quot;\n&quot;; &lt;br /&gt;&lt;br /&gt;输出的结果是两行空白。&lt;br /&gt;&lt;br /&gt;在访问命名空间节点前，必须使用children()和attributes()方法。这两个方法不仅可以在没有指定参数的时候使用，也可以在指定一个 URI命名空间作为参数使用。如果一个SimleXMLElement对象是从这两个方法返回的，那么你就可以像普通的元素和属性一样访问命名空间下的元素和属性：&lt;br /&gt;&lt;br /&gt;1. $book = simplexml_load_file(&#39;sxmlns.xml&#39;);&lt;br /&gt;2. /* 返回 http://www.example.com/ns2 命名空间下的所有属性 */&lt;br /&gt;3. $bookatts = $book-&gt;attributes(&quot;http://www.example.com/ns2&quot;);&lt;br /&gt;4. print $bookatts[&quot;lang&quot;].&quot;\n&quot;;&lt;br /&gt;5. /* 返回 http://www.example.com/ns1 命名空间下的所有元素*/&lt;br /&gt;6. $bookns = $book-&gt;children(&quot;http://www.example.com/ns1&quot;);&lt;br /&gt;7. $bookinfo = $bookns-&gt;bookinfo;&lt;br /&gt;8. /* 重置命名空间来访问非命名空间的元素 */&lt;br /&gt;9. $nonsbkinfo = $bookinfo-&gt;children();&lt;br /&gt;10. print $nonsbkinfo-&gt;title.&quot;\n&quot;; &lt;br /&gt;&lt;br /&gt;children ()和attributes()方法可以被看做是过滤器，如果没有参数或者传递一个NULL作为参数，这两个方法将返回非命名空间下的元素或属性；否则将返回特定命名空间下的元素或属性。在重置之前，命名空间仍然起作用并且被子节点继承。例如，使用$bookinfo被设置为命名空间 http://www.example.com/ns1的对象，可以使用 print $bookinfo-&gt;author-&gt;firstname来但因author中的firstname元素。所有的元素都在命名空间下，因此你在创建$bookinfo对象时不必一直使用children()设置命名空间。&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/7294501033906668423/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/7294501033906668423' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7294501033906668423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7294501033906668423'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/10/simplexml.html' title='SimpleXML介绍'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-3175722453848099514</id><published>2010-10-09T08:25:00.000-07:00</published><updated>2010-10-09T08:26:12.264-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SimpleXML php xml"/><title type='text'>SimpleXML php操作xml的简单入门</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;table style=&quot;table-layout: fixed; width: 885px; &quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;font-family: Arial; word-wrap: break-word; word-break: break-all; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; &quot;&gt;&lt;div id=&quot;blog_text&quot; class=&quot;cnt&quot; style=&quot;font-family: Arial; word-wrap: break-word; word-break: normal; visibility: visible !important; zoom: 1 !important; filter: none; font-size: 12px; line-height: 18px; color: rgb(51, 51, 51); overflow-x: hidden; overflow-y: hidden; position: static; &quot;&gt;&lt;em style=&quot;line-height: normal; &quot;&gt;DOM是Document Object Model文档对象模型的缩写。根据W3C DOM规范（http://www.w3.org/DOM/），DOM是一种与浏览器，平台，语言无关的接口，使得你可以访问页面其他的标准组件。&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;说到对xml文件的操作，简单的入门的话无非是: 读取文件，写文件，修改文件&lt;br /&gt;&lt;br /&gt;&lt;strong style=&quot;line-height: normal; &quot;&gt;首先说读取文件&lt;/strong&gt;，我们可以使用两种方法，一种是dom方式，一种是php提供的SimpleXMLElement对象。&lt;br /&gt;&lt;br /&gt;我的xml文件中的内容如下：&lt;br /&gt;&lt;?xml version=&quot;1.0&quot;?&gt;&lt;br /&gt;&lt;books&gt;&lt;br /&gt;&lt;book&gt;&lt;br /&gt;&lt;title&gt;Great American Novel&lt;/title&gt;&lt;br /&gt;&lt;plot&gt;This is a science fiction!&lt;/plot&gt;&lt;br /&gt;&lt;define&gt;Science Novel&lt;/define&gt;&lt;br /&gt;&lt;/book&gt;&lt;br /&gt;&lt;/books&gt;&lt;br /&gt;名字叫做test1.xml&lt;br /&gt;&lt;br /&gt;$xmlstr = &#39;test1.xml&#39;;&lt;br /&gt;//加载xml文件(load a xml file)&lt;br /&gt;//$xml = simplexml_load_file($xmlstr); //这也是一种简单可行的方法&lt;br /&gt;&lt;br /&gt;//the third parameter means the first parameter is url or not&lt;br /&gt;$xml = new SimpleXMLElement($xmlstr,NULL,TRUE);&lt;br /&gt;//以属性的方式读取&lt;br /&gt;//echo $xml-&gt;book[0]-&gt;title;&lt;br /&gt;//循环度读取元素&lt;br /&gt;foreach ($xml-&gt;book as $book ){&lt;br /&gt;//echo $book-&gt;plot.&quot;&lt;br/&gt;&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//修改文本节点信息&lt;br /&gt;$xml-&gt;book[0]-&gt;define = &quot;self define!&quot;;&lt;br /&gt;//插入节点&lt;br /&gt;$mybook = $xml-&gt;addChild(&#39;book&#39;);&lt;br /&gt;$mybook-&gt;addChild(&#39;title&#39;,&#39;Anna&#39;);&lt;br /&gt;$mybook-&gt;addChild(&#39;plot&#39;,&#39;About Anna&#39;);&lt;br /&gt;$mybook-&gt;addChild(&#39;define&#39;,&#39;added by me!&#39;);&lt;br /&gt;&lt;br /&gt;echo $xml-&gt;asXML(); //输出xml文件内容&lt;br /&gt;代码很清晰，不用更多解释了。下面的是使用dom对象读取的方法:&lt;br /&gt;&lt;br /&gt;$dom = new DOMDocument(&#39;1.0&#39;);&lt;br /&gt;$books = $dom-&gt;getElementsByTagName(&#39;book&#39;); //注意这里获取的类型是DOMNodelist&lt;br /&gt;$book = $books-&gt;item(0);  //这里获取的类型是DOMNode&lt;br /&gt;$title = $book-&gt;getElementsByTagName(&#39;title&#39;);&lt;br /&gt;echo $title-&gt;item（0）-&gt;nodeValue; //输出节点信息&lt;br /&gt;&lt;br /&gt;这里有点难理解，关键是DOMNodelist和DOMNode这两种类型。 nodelist就像一个数组，是我们用getElementsByTagName获取到的，它具有item方法，item后面可以跟上index来指明是访问那个node，有点类似与数组但是用法完全不一样。node的话，具有nodeValue这个属性，可是使用它来访问node的具体内容。 对于nodelist，一般都倾向与使用迭代来便利，用法如下:&lt;br /&gt;foreach($books as $book){ //$books是nodelist类型的，$book是node类型的&lt;br /&gt;//具体操作&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong style=&quot;line-height: normal; &quot;&gt;读文件完成了，下面是写文件:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;//创建一个dom对象&lt;br /&gt;$dom  = new DOMDocument(&#39;1.0&#39;);&lt;br /&gt;//创建根节点&lt;br /&gt;$books = $dom-&gt;appendChild($dom-&gt;createElement(&#39;books&#39;));&lt;br /&gt;//创建子节点&lt;br /&gt;$book = $books-&gt;appendChild($dom-&gt;createElement(&#39;book&#39;));&lt;br /&gt;//创建子节点&lt;br /&gt;$title = $book-&gt;appendChild($dom-&gt;createElement(&#39;title&#39;));&lt;br /&gt;//写入文本内容&lt;br /&gt;$title-&gt;appendChild($dom-&gt;createTextNode(&#39;Great American Novel&#39;));&lt;br /&gt;//格式化输出&lt;br /&gt;$dom-&gt;formatOutput = true;&lt;br /&gt;//保存xml到文件&lt;br /&gt;$dom -&gt; save(&#39;test1.xml&#39;); // save as file&lt;br /&gt;&lt;br /&gt;最后是&lt;strong style=&quot;line-height: normal; &quot;&gt;修改文件,其实也很简单，打开以后读取node的值，修改，然后保存就可以了。&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;//读取根节点&lt;br /&gt;$root = $dom-&gt;getElementsByTagName(&#39;books&#39;);&lt;br /&gt;//创建一个book节点&lt;br /&gt;$mybook = $dom-&gt;createElement(&#39;book&#39;);&lt;br /&gt;//添加到根节点&lt;br /&gt;$root-&gt;item(0)-&gt;appendChild($mybook);&lt;br /&gt;//创建title节点&lt;br /&gt;$title = $dom-&gt;createElement(&#39;title&#39;);&lt;br /&gt;//向title节点写入文本内容&lt;br /&gt;$title-&gt;appendChild($dom-&gt;createTextNode(&#39;The deviche code&#39;));&lt;br /&gt;//修改文本内容&lt;br /&gt;$title-&gt;nodeValue=&#39;my novel&#39;;&lt;br /&gt;//添加到book节点&lt;br /&gt;$mybook-&gt;appendChild($title);&lt;br /&gt;//保存xml文件&lt;br /&gt;$dom-&gt;save($xml_path);&lt;br /&gt;&lt;br /&gt;修改文本的时候有两种方法，个人感觉第二种直接写nodeValue更好一些。 掌握了这三种操作，简单的xml操作基本就没有问题了。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;这里有所有你想要的：&lt;br /&gt;DOMNodelist讲解:  &lt;a target=&quot;_blank&quot; href=&quot;http://www.phpchina.com/manual/php/function.dom-domnodelist-item.html&quot; style=&quot;color: rgb(20, 141, 214); line-height: normal; text-decoration: none; &quot;&gt;http://www.phpchina.com/manual/php/function.dom-domnodelist-item.html&lt;/a&gt;&lt;br /&gt;phpsimplexml官方帮助文档: &lt;a target=&quot;_blank&quot; href=&quot;http://us3.php.net/manual/en/book.simplexml.php&quot; style=&quot;color: rgb(20, 141, 214); line-height: normal; text-decoration: none; &quot;&gt; http://us3.php.net/manual/en/book.simplexml.php&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/3175722453848099514/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/3175722453848099514' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/3175722453848099514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/3175722453848099514'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/10/simplexml-phpxml.html' title='SimpleXML php操作xml的简单入门'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-4118403729111346132</id><published>2010-10-02T06:40:00.000-07:00</published><updated>2010-10-02T06:41:07.981-07:00</updated><title type='text'>举例说明数据库一、二、三及BCNF范式</title><content type='html'>&lt;a target=&quot;_self&quot;&gt;&lt;u&gt;&lt;strong&gt;数据库&lt;/strong&gt;&lt;/u&gt;&lt;/a&gt;的设计范式是数据库设计所需要满足的规范，满足这些规范的数据库是简洁的、结构明晰的，同时，不会发生插入（insert）、删除（delete）和更新（update）操作异常。反之则是乱七八糟，不仅给数据库的&lt;a target=&quot;_self&quot;&gt;&lt;u&gt;&lt;strong&gt;编程&lt;/strong&gt;&lt;/u&gt;&lt;/a&gt;人员制造麻烦，而且面目可憎，可能存储了大量不需要的冗余信息。&lt;br /&gt;&lt;br /&gt;设计范式是不是很难懂呢？非也，大学教材上给我们一堆数学公式我们当然看不懂，也记不住。所以我们很多人就根本不按照范式来设计数据库。&lt;br /&gt;&lt;br /&gt;实质上，设计范式用很形象、很简洁的话语就能说清楚，道明白。本文将对范式进行通俗地说明，并以笔者曾经设计的一个简单论坛的数据库为例来讲解怎样将这些范式应用于实际工程。&lt;br /&gt;&lt;br /&gt;范式说明&lt;br /&gt;&lt;br /&gt;第一范式（1NF）：数据库表中的字段都是单一属性的，不可再分。这个单一属性由基本类型构成，包括整型、实数、字符型、逻辑型、日期型等。&lt;br /&gt;&lt;br /&gt;例如，如下的数据库表是符合第一范式的：&lt;br /&gt;&lt;br /&gt;字段1 字段2 字段3 字段4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;而这样的数据库表是不符合第一范式的：&lt;br /&gt;&lt;br /&gt;字段1 字段2 字段3 字段4&lt;br /&gt;字段3.1 字段3.2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;很显然，在当前的任何关系数据库&lt;a target=&quot;_self&quot;&gt;&lt;u&gt;&lt;strong&gt;管理&lt;/strong&gt;&lt;/u&gt;&lt;/a&gt;系统（DBMS）中，傻瓜也不可能做出不符合第一范式的数据库，因为这些DBMS不允许你把数据库表的一列再分成二列或多列。因此，你想在现有的DBMS中设计出不符合第一范式的数据库都是不可能的。&lt;br /&gt;&lt;br /&gt;第二范式（2NF）：数据库表中不存在非关键字段对任一候选关键字段的部分函数依赖（部分函数依赖指的是存在组合关键字中的某些字段决定非关键字段的情况），也即所有非关键字段都完全依赖于任意一组候选关键字。&lt;br /&gt;&lt;br /&gt;假定选课关系表为SelectCourse(学号, 姓名, 年龄, 课程名称, 成绩, 学分)，关键字为组合关键字(学号, 课程名称)，因为存在如下决定关系：&lt;br /&gt;&lt;br /&gt;(学号, 课程名称) → (姓名, 年龄, 成绩, 学分)&lt;br /&gt;&lt;br /&gt;这个数据库表不满足第二范式，因为存在如下决定关系：&lt;br /&gt;&lt;br /&gt;(课程名称) → (学分)&lt;br /&gt;&lt;br /&gt;(学号) → (姓名, 年龄)&lt;br /&gt;&lt;br /&gt;即存在组合关键字中的字段决定非关键字的情况。&lt;br /&gt;&lt;br /&gt;由于不符合2NF，这个选课关系表会存在如下问题：&lt;br /&gt;&lt;br /&gt;(1) 数据冗余：&lt;br /&gt;&lt;br /&gt;同一门课程由n个学生选修，&quot;学分&quot;就重复n-1次；同一个学生选修了m门课程，姓名和年龄就重复了m-1次。&lt;br /&gt;&lt;br /&gt;(2) 更新异常：&lt;br /&gt;&lt;br /&gt;若调整了某门课程的学分，数据表中所有行的&quot;学分&quot;值都要更新，否则会出现同一门课程学分不同的情况。&lt;br /&gt;&lt;br /&gt;(3) 插入异常：&lt;br /&gt;&lt;br /&gt;假设要开设一门新的课程，暂时还没有人选修。这样，由于还没有&quot;学号&quot;关键字，课程名称和学分也无法记录入数据库。&lt;br /&gt;&lt;br /&gt;(4) 删除异常：&lt;br /&gt;&lt;br /&gt;假设一批学生已经完成课程的选修，这些选修记录就应该从数据库表中删除。但是，与此同时，课程名称和学分信息也被删除了。很显然，这也会导致插入异常。&lt;br /&gt;&lt;br /&gt;把选课关系表SelectCourse改为如下三个表：&lt;br /&gt;&lt;br /&gt;学生：Student(学号, 姓名, 年龄)；&lt;br /&gt;&lt;br /&gt;课程：Course(课程名称, 学分)；&lt;br /&gt;&lt;br /&gt;选课关系：SelectCourse(学号, 课程名称, 成绩)。&lt;br /&gt;&lt;br /&gt;这样的数据库表是符合第二范式的， 消除了数据冗余、更新异常、插入异常和删除异常。&lt;br /&gt;&lt;br /&gt;另外，所有单关键字的数据库表都符合第二范式，因为不可能存在组合关键字。&lt;br /&gt;&lt;br /&gt;第三范式（3NF）：在第二范式的基础上，数据表中如果不存在非关键字段对任一候选关键字段的传递函数依赖则符合第三范式。所谓传递函数依赖，指的是如果存在&quot;A → B → C&quot;的决定关系，则C传递函数依赖于A。因此，满足第三范式的数据库表应该不存在如下依赖关系：&lt;br /&gt;&lt;br /&gt;关键字段 → 非关键字段x → 非关键字段y&lt;br /&gt;&lt;br /&gt;假定学生关系表为Student(学号, 姓名, 年龄, 所在学院, 学院地点, 学院电话)，关键字为单一关键字&quot;学号&quot;，因为存在如下决定关系：&lt;br /&gt;&lt;br /&gt;(学号) → (姓名, 年龄, 所在学院, 学院地点, 学院电话)&lt;br /&gt;&lt;br /&gt;这个数据库是符合2NF的，但是不符合3NF，因为存在如下决定关系：&lt;br /&gt;&lt;br /&gt;(学号) → (所在学院) → (学院地点, 学院电话)&lt;br /&gt;&lt;br /&gt;即存在非关键字段&quot;学院地点&quot;、&quot;学院电话&quot;对关键字段&quot;学号&quot;的传递函数依赖。&lt;br /&gt;&lt;br /&gt;它也会存在数据冗余、更新异常、插入异常和删除异常的情况，读者可自行分析得知。&lt;br /&gt;&lt;br /&gt;把学生关系表分为如下两个表：&lt;br /&gt;&lt;br /&gt;学生：(学号, 姓名, 年龄, 所在学院)；&lt;br /&gt;&lt;br /&gt;学院：(学院, 地点, 电话)。&lt;br /&gt;&lt;br /&gt;这样的数据库表是符合第三范式的，消除了数据冗余、更新异常、插入异常和删除异常。&lt;br /&gt;&lt;br /&gt;鲍依斯-科得范式（BCNF）：在第三范式的基础上，数据库表中如果不存在任何字段对任一候选关键字段的传递函数依赖则符合第三范式。&lt;br /&gt;&lt;br /&gt;假设仓库管理关系表为StorehouseManage(仓库ID, 存储物品ID, 管理员ID, 数量)，且有一个管理员只在一个仓库工作；一个仓库可以存储多种物品。这个数据库表中存在如下决定关系：&lt;br /&gt;&lt;br /&gt;(仓库ID, 存储物品ID) →(管理员ID, 数量)&lt;br /&gt;&lt;br /&gt;(管理员ID, 存储物品ID) → (仓库ID, 数量)&lt;br /&gt;&lt;br /&gt;所以，(仓库ID, 存储物品ID)和(管理员ID, 存储物品ID)都是StorehouseManage的候选关键字，表中的唯一非关键字段为数量，它是符合第三范式的。但是，由于存在如下决定关系：&lt;br /&gt;&lt;br /&gt;(仓库ID) → (管理员ID)&lt;br /&gt;&lt;br /&gt;(管理员ID) → (仓库ID)&lt;br /&gt;&lt;br /&gt;即存在关键字段决定关键字段的情况，所以其不符合BCNF范式。它会出现如下异常情况：&lt;br /&gt;&lt;br /&gt;(1) 删除异常：&lt;br /&gt;&lt;br /&gt;当仓库被清空后，所有&quot;存储物品ID&quot;和&quot;数量&quot;信息被删除的同时，&quot;仓库ID&quot;和&quot;管理员ID&quot;信息也被删除了。&lt;br /&gt;&lt;br /&gt;(2) 插入异常：&lt;br /&gt;&lt;br /&gt;当仓库没有存储任何物品时，无法给仓库分配管理员。&lt;br /&gt;&lt;br /&gt;(3) 更新异常：&lt;br /&gt;&lt;br /&gt;如果仓库换了管理员，则表中所有行的管理员ID都要修改。&lt;br /&gt;&lt;br /&gt;把仓库管理关系表分解为二个关系表：&lt;br /&gt;&lt;br /&gt;仓库管理：StorehouseManage(仓库ID, 管理员ID)；&lt;br /&gt;&lt;br /&gt;仓库：Storehouse(仓库ID, 存储物品ID, 数量)。&lt;br /&gt;&lt;br /&gt;这样的数据库表是符合BCNF范式的，消除了删除异常、插入异常和更新异常。&lt;br /&gt;&lt;br /&gt;范式应用&lt;br /&gt;&lt;br /&gt;我们来逐步搞定一个论坛的数据库，有如下信息：&lt;br /&gt;&lt;br /&gt;（1） 用户：用户名，email，主页，电话，联系地址&lt;br /&gt;&lt;br /&gt;（2） 帖子：发帖标题，发帖内容，回复标题，回复内容&lt;br /&gt;&lt;br /&gt;第一次我们将数据库设计为仅仅存在表：&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;用户名 email 主页 电话 联系地址 发帖标题 发帖内容 回复标题 回复内容&lt;br /&gt;&lt;br /&gt;这个数据库表符合第一范式，但是没有任何一组候选关键字能决定数据库表的整行，唯一的关键字段用户名也不能完全决定整个元组。我们需要增加&quot;发帖ID&quot;、&quot;回复ID&quot;字段，即将表修改为：&lt;br /&gt;&lt;br /&gt;用户名 email 主页 电话 联系地址 发帖ID 发帖标题 发帖内容 回复ID 回复标题 回复内容&lt;br /&gt;&lt;br /&gt;这样数据表中的关键字(用户名，发帖ID，回复ID)能决定整行：&lt;br /&gt;&lt;br /&gt;(用户名,发帖ID,回复ID) → (email,主页,电话,联系地址,发帖标题,发帖内容,回复标题,回复内容)&lt;br /&gt;&lt;br /&gt;但是，这样的设计不符合第二范式，因为存在如下决定关系：&lt;br /&gt;&lt;br /&gt;(用户名) → (email,主页,电话,联系地址)&lt;br /&gt;&lt;br /&gt;(发帖ID) → (发帖标题,发帖内容)&lt;br /&gt;&lt;br /&gt;(回复ID) → (回复标题,回复内容)&lt;br /&gt;&lt;br /&gt;即非关键字段部分函数依赖于候选关键字段，很明显，这个设计会导致大量的数据冗余和操作异常。&lt;br /&gt;&lt;br /&gt;我们将数据库表分解为（带下划线的为关键字）：&lt;br /&gt;&lt;br /&gt;（1） 用户信息：&lt;u&gt;用户名&lt;/u&gt;，email，主页，电话，联系地址&lt;br /&gt;&lt;br /&gt;（2） 帖子信息：&lt;u&gt;发帖ID&lt;/u&gt;，标题，内容&lt;br /&gt;&lt;br /&gt;（3） 回复信息：&lt;u&gt;回复ID&lt;/u&gt;，标题，内容&lt;br /&gt;&lt;br /&gt;（4） 发贴：&lt;u&gt;用户名，发帖ID&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;（5） 回复：&lt;u&gt;发帖ID，回复ID&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;这样的设计是满足第1、2、3范式和BCNF范式要求的，但是这样的设计是不是最好的呢？&lt;br /&gt;&lt;br /&gt;不一定。&lt;br /&gt;&lt;br /&gt;观 察可知，第4项&quot;发帖&quot;中的&quot;用户名&quot;和&quot;发帖ID&quot;之间是1：N的关系，因此我们可以把&quot;发帖&quot;合并到第2项的&quot;帖子信息&quot;中；第5项&quot;回复&quot;中的&quot;发 帖ID&quot;和&quot;回复ID&quot;之间也是1：N的关系，因此我们可以把&quot;回复&quot;合并到第3项的&quot;回复信息&quot;中。这样可以一定量地减少数据冗余，新的设计为：&lt;br /&gt;&lt;br /&gt;（1） 用户信息：&lt;u&gt;用户名&lt;/u&gt;，email，主页，电话，联系地址&lt;br /&gt;&lt;br /&gt;（2） 帖子信息：&lt;u&gt;用户名，发帖ID&lt;/u&gt;，标题，内容&lt;br /&gt;&lt;br /&gt;（3） 回复信息：&lt;u&gt;发帖ID，回复ID&lt;/u&gt;，标题，内容&lt;br /&gt;&lt;br /&gt;数据库表1显然满足所有范式的要求；&lt;br /&gt;&lt;br /&gt;数据库表2中存在非关键字段&quot;标题&quot;、&quot;内容&quot;对关键字段&quot;发帖ID&quot;的部分函数依赖，即不满足第二范式的要求，但是这一设计并不会导致数据冗余和操作异常；&lt;br /&gt;&lt;br /&gt;数据库表3中也存在非关键字段&quot;标题&quot;、&quot;内容&quot;对关键字段&quot;回复ID&quot;的部分函数依赖，也不满足第二范式的要求，但是与数据库表2相似，这一设计也不会导致数据冗余和操作异常。&lt;br /&gt;&lt;br /&gt;由此可以看出，并不一定要强行满足范式的要求，对于1：N关系，当1的一边合并到N的那边后，N的那边就不再满足第二范式了，但是这种设计反而比较好！&lt;br /&gt;&lt;br /&gt;对于M：N的关系，不能将M一边或N一边合并到另一边去，这样会导致不符合范式要求，同时导致操作异常和数据冗余。&lt;br /&gt;对于1：1的关系，我们可以将左边的1或者右边的1合并到另一边去，设计导致不符合范式要求，但是并不会导致操作异常和数据冗余。&lt;br /&gt;&lt;br /&gt;结论&lt;br /&gt;&lt;br /&gt;满足范式要求的数据库设计是结构清晰的，同时可避免数据冗余和操作异常。这并意味着不符合范式要求的设计一定是错误的，在数据库表中存在1：1或1：N关系这种较特殊的情况下，合并导致的不符合范式要求反而是合理的。&lt;br /&gt;&lt;br /&gt;在我们设计数据库的时候，一定要时刻考虑范式的要求。</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/4118403729111346132/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/4118403729111346132' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/4118403729111346132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/4118403729111346132'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/10/bcnf_02.html' title='举例说明数据库一、二、三及BCNF范式'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-5237040992160895607</id><published>2010-10-02T06:10:00.000-07:00</published><updated>2010-10-02T06:11:43.985-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BCNF"/><category scheme="http://www.blogger.com/atom/ns#" term="datebase design"/><category scheme="http://www.blogger.com/atom/ns#" term="NF"/><title type='text'>第一范式，第二范式，第三范式，BCNF</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;第一范式 1NF&lt;/span&gt;&lt;/strong&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;属性不可再分割，符合原子性。&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;没什么好解释的，地球人都明白&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; &lt;strong&gt;第二范式 2NF&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;在1NF的基础上：&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;不允许出现有field部分依赖于主键（或者说依赖于主键的一部分）&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;官方说法：数据库表中不存在非关键字段对任一候选关键字段的部分函数依赖（部分函数依赖指的是存在组合关键字中的某些字段决定非关键字段的情况），也即所有非关键字段都完全依赖于整组候选关键字。 &lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;Allen解释一下：比如一张表是(A, B, C, D)，其中(A, B)是主键，如果存在B-&gt;C就违反了2NF，因为C只需要主键的一部分就可以被决定了&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; 第三范式 3NF&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;在2NF的基础上：&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;不允许出现可传递的依赖关系(transitive dependencies)&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;官方说法：在第二范式的基础上，数据表中如果不存在非关键字段对关键字段的传递函数依赖则符合第三范式。所谓传递函数依赖，指的是如果存在&quot;A → B → C&quot;的决定关系，则C传递函数依赖于A&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;很容易理解，Kiza同学说这是人类的常识。&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt; &lt;strong&gt;Boyce-Codd范式 BCNF&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;在3NF的基础上：&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;不允许出现有主键的一部分被主键另一部分或者其他部分决定&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;另一种说法：Left side of every non-trivial FD must contains a key&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;每个非平凡FD的左边必须有一个主键&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;BCNF，表中的每个决定因子是候选键。如果只有一个候选键，则3NF和BCNF相同&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;网友们通常喜欢用的一个例子：&lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt; 假设仓库管理关系表为StorehouseManage(仓库ID, 存储物品ID, 管理员ID, 数量)，且有一个管理员只在一个仓库工作；一个仓库可以存储多种物品。这个数据库表中存在如下决定关系： &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt;　　 (仓库ID, 存储物品ID) →(管理员ID, 数量) &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt;　　 (管理员ID, 存储物品ID) → (仓库ID, 数量) &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt;所以，(仓库ID, 存储物品ID)和(管理员ID, 存储物品ID)都是StorehouseManage的候选关键字，表中的唯一非关键字段为数量，它是符合第三范式的。但是，由于存在如下决定关系： &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt;　　 (仓库ID) → (管理员ID) &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt;　　 (管理员ID) → (仓库ID) &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 60px;&quot;&gt;也就是说，（仓库ID, 存储物品ID）这个主键中的仓库ID可以被管理员ID决定，同样（管理员ID, 存储物品ID）中管理员ID也可以被仓库ID决定，所以此表应该拆分。&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;3NF-&gt;BCNF的步骤：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;1. 一个表，从所给的FD中，找出一个FD左边没有key的&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;2. 给这个FD的右边补全属性（field）。&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;3. 此时得到两个表，一个是第2步中得到的FD中的表，另一个是第2步中FD的所有左边 及 其他所有没有在这个FD中出现的属性组成的表&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;4. 投影总的FD分别到两个表&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;如果仍然有表violation，继续分解&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;例如：&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;表（Name, Location, Application, Provider, FavAppl）&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;FD: Name-&gt;Location, Name-&gt;FavAppl, Application-&gt;Provider&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;Key: Name, Application&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;1. Name-&gt;Location的左边没有key。&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;2. 将其补充。Name-&gt;Location, Name-&gt;FavAppl，因此得到表（Name, Location, FavAppl）&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;3. 一个表是（Name, Location, FavAppl）。另一个表，”第2步中FD的所有左边“是指Name，“其他所有没有在这个FD中出现的属性”是指Application和&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;Provider。因此第二个表是（Name, Application, Provider）&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;4. 第二个表中，Application-&gt;Provider的左边没有key，继续分解第二个表&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;最终结果，原表分为了（Name, Location, Provider），（Application, Provider），（Application, Name）&lt;/p&gt;   &lt;p&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;总结：&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;1NF&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;| 消除非主属性对码的部分依赖&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;2NF&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;| 消除非主属性对码的传递依赖&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;3NF&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;| 消除主属性对码的部分和传递依赖&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt;BCNF&lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;p style=&quot;padding-left: 30px;&quot;&gt; &lt;/p&gt; &lt;h3&gt;参考资料：&lt;/h3&gt; &lt;p&gt;http://blog.csdn.net/kkdelta/archive/2009/04/11/4064986.aspx&lt;/p&gt; &lt;p&gt;《Beginning Database Design》 By Wrox&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/5237040992160895607/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/5237040992160895607' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5237040992160895607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5237040992160895607'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/10/bcnf.html' title='第一范式，第二范式，第三范式，BCNF'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-7339022810208420822</id><published>2010-09-19T08:21:00.001-07:00</published><updated>2010-09-19T08:23:20.459-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java printf"/><title type='text'>java/OutputTest</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-AU&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;ZH-CN&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val=&quot;Cambria Math&quot;&gt;    &lt;m:brkbin val=&quot;before&quot;&gt;    &lt;m:brkbinsub val=&quot;&amp;#45;-&quot;&gt;    &lt;m:smallfrac val=&quot;off&quot;&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val=&quot;0&quot;&gt;    &lt;m:rmargin val=&quot;0&quot;&gt;    &lt;m:defjc val=&quot;centerGroup&quot;&gt;    &lt;m:wrapindent val=&quot;1440&quot;&gt;    &lt;m:intlim val=&quot;subSup&quot;&gt;    &lt;m:narylim val=&quot;undOvr&quot;&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate=&quot;false&quot; defunhidewhenused=&quot;true&quot; defsemihidden=&quot;true&quot; defqformat=&quot;false&quot; defpriority=&quot;99&quot; latentstylecount=&quot;267&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;0&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Normal&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;heading 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 7&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 8&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;9&quot; qformat=&quot;true&quot; name=&quot;heading 9&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 7&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 8&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; name=&quot;toc 9&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;35&quot; qformat=&quot;true&quot; name=&quot;caption&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;10&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Title&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;1&quot; name=&quot;Default Paragraph Font&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;11&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Subtitle&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;22&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Strong&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;20&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Emphasis&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;59&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Table Grid&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Placeholder Text&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;1&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;No Spacing&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Revision&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;34&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;List Paragraph&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;29&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Quote&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;30&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Intense Quote&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 1&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 2&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 3&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 4&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 5&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;60&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Shading Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;61&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light List Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;62&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Light Grid Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;63&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 1 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;64&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Shading 2 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;65&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 1 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;66&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium List 2 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;67&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 1 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;68&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 2 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;69&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Medium Grid 3 Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;70&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Dark List Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;71&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Shading Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;72&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful List Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;73&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; name=&quot;Colorful Grid Accent 6&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;19&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Subtle Emphasis&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;21&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Intense Emphasis&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;31&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Subtle Reference&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;32&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Intense Reference&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;33&quot; semihidden=&quot;false&quot; unhidewhenused=&quot;false&quot; qformat=&quot;true&quot; name=&quot;Book Title&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;37&quot; name=&quot;Bibliography&quot;&gt;   &lt;w:lsdexception locked=&quot;false&quot; priority=&quot;39&quot; qformat=&quot;true&quot; name=&quot;TOC Heading&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:表格內文;  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:&quot;&quot;;  mso-padding-alt:0cm 5.4pt 0cm 5.4pt;  mso-para-margin-top:0cm;  mso-para-margin-right:0cm;  mso-para-margin-bottom:10.0pt;  mso-para-margin-left:0cm;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:&quot;Times New Roman&quot;;  mso-bidi-theme-font:minor-bidi;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;/*&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;* OutputTest.java&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;*&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;* Created on June 1, 2004, 12:31 PM&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;//comment the package line out to run in the default package.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;import java.math.BigInteger;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;import java.util.Calendar;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;import java.util.Date;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;/**&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;*&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;* @author&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;cpresser&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;public class OutputTest {&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;/**&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;* @param args the command line arguments&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;public static void main(String[] args) {&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;// Set up some variables with different types of data.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;String word = &quot;Information&quot;;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;int integer = 24;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;double real = 12*Math.PI;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;BigInteger bigInt = new BigInteger(&quot;123456789012345678901234567890123456789012345678901234567890&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;Date today = Calendar.getInstance().getTime();&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;//a series of output statements to show some of the functionality of the printf method.&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;//The comments below indicate the output from each section:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;String output tests:\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A string-------------------------------|%s|\n&quot;, word);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;An upper-case string-------------------|%^s|\n&quot;, word);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A string in 15 spaces------------------|%15s|\n&quot;, word);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A string left justified in 15 spaces---|%-15s|\n&quot;, word);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A string within 5 characters-----------|%.5s|\n&quot;, word);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A string in a space of 5 to 7 chars----|%5.7s|\n&quot;, word);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;&quot;&gt;      &lt;/span&gt;/* OUTPUT:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;String output tests:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A string-------------------------------|Information|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;An upper-case string-------------------|INFORMATION|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A string in 15 spaces------------------|&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;Information|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A string left justified in 15 spaces---|Information&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A string within 5 characters-----------|Infor|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A string in a space of 5 to 7 chars----|Informa|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Integer output tests:\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;An integer-----------------------------|%d|\n&quot;, integer);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;An integer as an octal-----------------|%o|\n&quot;, integer);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;An integer as hex----------------------|%x|\n&quot;, integer);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;/* OUTPUT:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Integer output tests:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;An integer-----------------------------|24|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;An integer as an octal-----------------|30|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;An integer as hex----------------------|18|&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Double output tests:\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;&quot;&gt; &lt;/span&gt;System.out.printf(&quot;A double-------------------------------|%f|\n&quot;, real);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A double in scientific notation--------|%e|\n&quot;, real);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A double with precision of 2-----------|%.2f|\n&quot;, real);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A double with precision of 10----------|%.10f|\n&quot;, real);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A double as a hex number---------------|%a|\n&quot;, real);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;/* OUTPUT:&lt;span style=&quot;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Double output tests:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A double-------------------------------|37.699112|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A double in scientific notation--------|3.769911e+01|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A double with precision of 2-----------|37.70|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A double with precision of 10----------|37.6991118431|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A double as a hex number---------------|0x1.2d97c7f3321d2p5|&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;BigInteger output test:\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A BigInteger---------------------------|%d|\n&quot;, bigInt);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;/* OUTPUT:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;BigInteger output test:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A BigInteger---------------------------|123456789012345678901234567890123456789012345678901234567890|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;* &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Date output tests:\n&quot;); //see multiple arguments section for others&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A Date object as a string--------------|%s|\n&quot;, today);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;A formatted Date object----------------|%tc|\n&quot;, today);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;An ISO8602 format Date object----------|%tF|\n&quot;, today);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Time in 12 hour format ----------------|%tr|\n&quot;, today);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Time in 24 hour format-----------------|%tR|\n&quot;, today);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Time in 24 hour format w/ seconds -----|%tT|\n&quot;, today);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Date-----------------------------------|%tD|\n&quot;, today);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;/* OUTPUT:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Date output tests:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A Date object as a string--------------|Tue Jun 01 15:25:41 EDT 2004|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;A formatted Date object----------------|Tue Jun 01 15:25:41 EDT 2004|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;An ISO8602 format Date object----------|2004-06-01|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Time in 12 hour format ----------------|03:25:41 PM|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Time in 24 hour format-----------------|15:25|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Time in 24 hour format w/ seconds -----|15:25:41|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Date-----------------------------------|06/01/04|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;* &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Multiple Argument tests:\n&quot;);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;%1$s %2$d, %1$s %3$d, %1$s %4$d\n&quot;, &quot;label&quot;, 1, 2, 3);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;System.out.printf(&quot;Date mmddyyyy--------------------------|%1$tm%1$td%1$tY|\n&quot;, today);&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;/* OUTPUT:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Multiple Argument tests:&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;label 1, label 2, label 3&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;&quot;&gt;   &lt;/span&gt;Date mmddyyyy--------------------------|06012004|&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;* &lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;         &lt;/span&gt;*/&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;        &lt;/span&gt;//There are many other formats/conversions see java.util.Formatter for details&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class=&quot;MsoNormal&quot;&gt; &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/7339022810208420822/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/7339022810208420822' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7339022810208420822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7339022810208420822'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/09/javaoutputtest.html' title='java/OutputTest'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-7015060168090296841</id><published>2010-07-29T11:01:00.000-07:00</published><updated>2010-07-29T11:04:57.897-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php  apache 无法编译 解决方法"/><title type='text'>Apache无法解析PHP代码的问题-转载</title><content type='html'>&lt;div bgcolor=&quot;red&quot;&gt;   一天安装Apache 和PHP, Apache的版本是httpd-2.0.55.tar.gz，PHP的版本是php-5.2.6.tar.gz，&lt;br /&gt; 首先安装APACHE,&lt;br /&gt;./configure --prefix=/usr/local/apache2 --enable-so --enable-module=so&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;安装PHP&lt;br /&gt;./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/lib --with-sybase=/opt/sybase/OCS-15_0/ --with-mysql --enable-dbase --enable-zip&lt;br /&gt;make&lt;br /&gt;install&lt;br /&gt;安装完PHP后将安装源文件中的 cp php.ini-dist /usr/local/lib/php.ini&lt;br /&gt;&lt;br /&gt;写个测试文件test.php ,文件的内容为 ,在IE中运行提示下载test.php,出现这种情况说明APACHE无法解析PHP， 在APACHE中的配置文件httpd.conf中添加AddType application/x-httpd-php .php，重启APACHE，还是出现同样的错误。而且APACHE的配置文件已经加载了PHP的模块LoadModule php5_module        modules/libphp5.so。最后发现是由于APACHE的配置文件缺少如下的配置：&lt;br /&gt;&lt;ifmodule c=&quot;&quot;&gt;&lt;br /&gt; AddType application/x-httpd-php .php&lt;br /&gt; AddType application/x-httpd-php .php .phtml .php3&lt;br /&gt; AddType application/x-httpd-php-source .phps&lt;br /&gt; &lt;/ifmodule&gt;&lt;br /&gt;&lt;br /&gt;因为我之前的 AddType application/x-httpd-php .php 在加在&lt;ifmodule mime_module=&quot;&quot;&gt;  &lt;/ifmodule&gt;中间，有问题，必须加在 &lt;ifmodule c=&quot;&quot;&gt; &lt;/ifmodule&gt; 中间，重启APACHE后可以正常解析PHP&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(102, 0, 204);&quot;&gt;原帖发表在：http://blog.chinaunix.net/u/24215/showart_2000512.html&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/7015060168090296841/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/7015060168090296841' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7015060168090296841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/7015060168090296841'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/07/apachephp.html' title='Apache无法解析PHP代码的问题-转载'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-8149032987714238710</id><published>2010-07-19T19:48:00.001-07:00</published><updated>2010-07-19T19:48:45.808-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="unix"/><title type='text'>Putty</title><content type='html'>&lt;div id=&quot;BlogArticleDetail&quot; style=&quot;font-size: 14px;&quot;&gt;&lt;p&gt;Putty&lt;br /&gt;&lt;br /&gt;随着Linux在服务器端应用的普及，Linux系统管理越来越依 赖于远程。在各种远程登录工具中，Putty是&lt;br /&gt;&lt;br /&gt;出色的工具之一。&lt;br /&gt;&lt;br /&gt;Putty是一个免费的、Windows  32平台下的telnet、rlogin和ssh客户端，但是功能丝毫不逊色于商业的&lt;br /&gt;&lt;br /&gt;telnet类工具。用它来远程管理Linux十分 好用，其主要优点如下：&lt;br /&gt;&lt;br /&gt;◆ 完全免费;&lt;br /&gt;&lt;br /&gt;◆ 在Windows 9x/NT/2000下运行的都非常好;&lt;br /&gt;&lt;br /&gt;◆  全面支持ssh1和ssh2；&lt;br /&gt;&lt;br /&gt;◆ 绿色软件，无需安装，下载后在桌面建个快捷方式即可使用；&lt;br /&gt;&lt;br /&gt;◆  体积很小，仅364KB (0.54 beta版本)；&lt;br /&gt;&lt;br /&gt;◆ 操作简单，所有的操作都在一个控制面板中实现。&lt;br /&gt;&lt;br /&gt;使用简介：&lt;br /&gt;&lt;br /&gt;把 Putty下载到机器上，双击putty.exe，就出现如图1的配置界面。选择“Session”，在“Host Name&lt;br /&gt;&lt;br /&gt;(or  IP address)”输入框中输入欲访问的主机名或IP，比如server1或192.168.9.4。端口号（Port）根&lt;br /&gt;&lt;br /&gt;据使用 的协议有所区别，ssh默认使用22，telnet默认使用23，rlogin默认使用513。在“Protocol”单&lt;br /&gt;&lt;br /&gt;选栏中选择使用 的协议，一般是telnet或ssh，这取决于服务器提供的服务。在“Saved Session”输入&lt;br /&gt;&lt;br /&gt;栏中输入任务的名字，单击 “Save”按钮，就可以把任务配置保存起来了。&lt;br /&gt;&lt;br /&gt;配置完成后单击“Open”按钮，出现如图2的登录界面，就可以使用Putty连接 Linux主机了。&lt;br /&gt;&lt;br /&gt;关于putty的一些使用中常见的问题&lt;br /&gt;&lt;br /&gt;一、在Windows中使用putty登录FreeBsd系统 时，能够输入用户名，但是输入密码后按回车键半天无反应&lt;br /&gt;。&lt;br /&gt;&lt;br /&gt;答：设置过程如下：&lt;br /&gt;&lt;br /&gt;1.  在/etc/ssh/sshd_config中添加如下内容，使普通用户可以通过SSH登录：&lt;br /&gt;&lt;br /&gt;AllowUsers 普通用户帐号&lt;br /&gt;&lt;br /&gt;UseDNS  no&lt;br /&gt;&lt;br /&gt;2. 将希望使用su命令的用户加入到wheel组中，在/etc/group中作如下修改&lt;br /&gt;&lt;br /&gt;wheel:*:0:root, 普通用户帐号&lt;br /&gt;&lt;br /&gt;二、在login as: 后输入用户名，J04222035@cs8.xmu.edu.cn&#39;s password:  光标不动。即使输入正确的&lt;br /&gt;&lt;br /&gt;密码也是没有反应？&lt;br /&gt;&lt;br /&gt;答：这是因为putty不像telent那样会直接显示密码，而是不显示密 码，只要你输入的密码是正确的，&lt;br /&gt;&lt;br /&gt;即使不显示只要输完密码后直接回车即可进入，不用在乎光标不动。&lt;/p&gt; &lt;p&gt;终于轮到 Pagent 出场了，双击一下 Pagent.exe，嗯，没反应？再双击一下，咦？出来个提示，说已经运行了。&lt;br /&gt;&lt;img onload=&quot;&quot; image=&quot;new&quot; src=&quot;this.src;if(image.width&quot; /&gt;0  &amp;amp;&amp;amp;  image.height&gt;0){if(image.width&gt;=700){this.width=700;this.height=image.height*700/image.width;}}&quot; title=&quot;Pagent is already running&quot; style=&quot;width: 246px; height: 150px;&quot; src=&quot;http://docs.google.com/File?id=ajbgz6fp3pjh_62f2tqn3&quot;&gt;&lt;br /&gt;看看右下角吧，在这 里呢&lt;br /&gt;&lt;img onload=&quot;&quot; image=&quot;new&quot; src=&quot;this.src;if(image.width&quot; /&gt;0 &amp;amp;&amp;amp;  image.height&gt;0){if(image.width&gt;=700){this.width=700;this.height=image.height*700/image.width;}}&quot; title=&quot;Pagent&quot; style=&quot;width: 212px; height: 54px;&quot; src=&quot;http://docs.google.com/File?id=ajbgz6fp3pjh_63fgtwg5&quot;&gt;&lt;br /&gt;双击一下  Pagent 的图标，出来这样一个界面。很简洁的，Add Key 是添加私钥，Remove Key 是把选中的私钥从 Pagent 中卸载了。&lt;br /&gt;&lt;img onload=&quot;&quot; image=&quot;new&quot; src=&quot;this.src;if(image.width&quot; /&gt;0  &amp;amp;&amp;amp;  image.height&gt;0){if(image.width&gt;=700){this.width=700;this.height=image.height*700/image.width;}}&quot; title=&quot;Pagent GUI&quot; style=&quot;width: 524px; height: 375px;&quot; src=&quot;http://docs.google.com/File?id=ajbgz6fp3pjh_64f8qrq8&quot;&gt;&lt;br /&gt;好，现在单击  Add Key 按钮添加私钥，我把这个演示用的私钥保存到 C:\ 了&lt;br /&gt;&lt;img onload=&quot;&quot; image=&quot;new&quot; src=&quot;this.src;if(image.width&quot; /&gt;0 &amp;amp;&amp;amp;  image.height&gt;0){if(image.width&gt;=700){this.width=700;this.height=image.height*700/image.width;}}&quot; title=&quot;选择私钥&quot; style=&quot;width: 586px; height: 434px;&quot; src=&quot;http://docs.google.com/File?id=ajbgz6fp3pjh_65dc39fw&quot;&gt;&lt;br /&gt;然后会出现输入密钥 口令的对话框，输入正确的密钥后，单击 OK&lt;br /&gt;&lt;img onload=&quot;&quot; image=&quot;new&quot; src=&quot;this.src;if(image.width&quot; /&gt;0 &amp;amp;&amp;amp;  image.height&gt;0){if(image.width&gt;=700){this.width=700;this.height=image.height*700/image.width;}}&quot; title=&quot;输入私钥的口令&quot; style=&quot;width: 239px; height: 148px;&quot; src=&quot;http://docs.google.com/File?id=ajbgz6fp3pjh_66cwj3cc&quot;&gt;&lt;br /&gt;这时，在  Pagent 的窗口中就能看到我们的私钥已经装载上去了。&lt;br /&gt;&lt;img onload=&quot;&quot; image=&quot;new&quot; src=&quot;this.src;if(image.width&quot; /&gt;0 &amp;amp;&amp;amp;  image.height&gt;0){if(image.width&gt;=700){this.width=700;this.height=image.height*700/image.width;}}&quot; title=&quot;察看已经装载的私钥&quot; style=&quot;width: 524px; height: 375px;&quot; src=&quot;http://docs.google.com/File?id=ajbgz6fp3pjh_67hf58c5&quot;&gt;&lt;br /&gt;现在打开  PuTTY，选择先前保存的 Session，双击一下。只要自动登录用户名设置上，主机上改帐户的 authorized_keys  文件里也有匹配的公钥。哈哈，发现没有？完全不需要口令，我们已经登录到系统了。&lt;br /&gt;在 Pagent  的图标上点右键，也可以快捷的选择已经保存的会话。&lt;br /&gt;&lt;img onload=&quot;&quot; image=&quot;new&quot; src=&quot;this.src;if(image.width&quot; /&gt;0 &amp;amp;&amp;amp;  image.height&gt;0){if(image.width&gt;=700){this.width=700;this.height=image.height*700/image.width;}}&quot; title=&quot;Pagent 的快捷菜单&quot; style=&quot;width: 318px; height: 506px;&quot; src=&quot;http://docs.google.com/File?id=ajbgz6fp3pjh_68g5fstk&quot;&gt;&lt;br /&gt;建议大家把  Pagent 放到启动组里面，这样每次一开机，Pagent  自动运行，然后我们只需要把私钥装载一下，然后我们就可以一直享受自动登录系统的乐趣了。再配合上以后会讲到的 Plink、PSCP  这些，我们可以实现很多工作的自动化进行。完全不需要每次输入用户名、口令、输入又长又多的命令，再做一些烦躁的文件备份，最后还得记得注销系统，难道不 觉得麻烦么？这一切烦恼很快就会远离我们了，继续往下看吧。&lt;/p&gt; &lt;h2&gt;用 SSH 来传输文件&lt;/h2&gt; &lt;p&gt;PuTTY 提供了两个文件传输工具&lt;/p&gt; &lt;ul&gt;&lt;li&gt;PSCP (PuTTY Secure Copy client)  &lt;/li&gt;&lt;li&gt;PSFTP (PuTTY SFTP client) &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;PSCP 通过 SSH 连接，在两台机器之间安全的传输文件，可以用于任何 SSH（包括 SSH v1、SSH v2） 服务器。&lt;br /&gt;PSFTP  则是 SSH-2 中新增的特性，使用的是新的 SFTP 协议，使用上与传统的 FTP 类似。事实上 PSCP 如果发现 SFTP  可用，PSCP就会使用 SFTP 协议来传输文件，否则还是 SCP 协议。PSFTP 与 PSCP 相比，PSFTP  的优点是可以与服务器进行交互，遍历服务器上的文件系统，在一个会话中上传或下载多个文件。而 PSCP  只能一次传输一个文件，传输完毕后立刻终止会话。&lt;/p&gt; &lt;h3&gt;PSCP 的使用&lt;/h3&gt; &lt;p&gt;在控制台直接执行 pscp 可以看到帮助&lt;/p&gt; &lt;blockquote&gt;C:\&gt;pscp&lt;br /&gt;PuTTY Secure Copy client&lt;br /&gt;Release 0.58&lt;br /&gt;Usage:  pscp [options] [user@]host:source target&lt;br /&gt;          pscp [options]  source [source...] [user@]host:target&lt;br /&gt;          pscp [options] -ls  [user@]host:filespec&lt;br /&gt;Options:&lt;br /&gt;     -V           print version  information and exit&lt;br /&gt;     -pgpfp       print PGP key fingerprints and  exit&lt;br /&gt;     -p           preserve file attributes&lt;br /&gt;     -q            quiet, don&#39;t show statistics&lt;br /&gt;     -r           copy directories  recursively&lt;br /&gt;     -v           show verbose messages&lt;br /&gt;     -load  sessname     Load settings from saved session&lt;br /&gt;     -P port       connect to specified port&lt;br /&gt;     -l user      connect with specified  username&lt;br /&gt;     -pw passw login with specified password&lt;br /&gt;     -1  -2        force use of particular SSH protocol version&lt;br /&gt;     -4  -6        force use of IPv4 or IPv6&lt;br /&gt;     -C           enable  compression&lt;br /&gt;     -i key       private key file for authentication&lt;br /&gt;      -batch       disable all interactive prompts&lt;br /&gt;     -unsafe      allow  server-side wildcards (DANGEROUS)&lt;br /&gt;     -sftp        force use of  SFTP protocol&lt;br /&gt;     -scp         force use of SCP protocol&lt;br /&gt;&lt;br /&gt;C:\&gt;&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;可以看出 PSCP 的使用是很简单的，把常用的几个选项说一下：&lt;/p&gt; &lt;ul&gt;&lt;li&gt;-q 安静模式，传输文件时什么也不显示，否则会显示出文件的传输进度，默认是关闭的  &lt;/li&gt;&lt;li&gt;-P port 指定服务器的 SSH 端口，注意这个是大写字母 P，默认是 -P 22，如果主机的 SSH 端口就是  22，就不用指定了  &lt;/li&gt;&lt;li&gt;-l user 指定以哪个用户的身份登录主机，如果没有指定，则 PSCP 会在 PuTTY 保存的同名 Session  中获得默认的用户名称。用户名称也可以和主机名称写在一起，用 @ 分割开，比如：username@server  &lt;/li&gt;&lt;li&gt;-pw passwd 指定登录时所用的口令为 passwd  &lt;/li&gt;&lt;li&gt;-i keyfile 就是指定登录时所用的密钥文件  &lt;/li&gt;&lt;li&gt;最后面指定的主机名也可以是 PuTTY 中保存的 Session 名称。比如我们在 PuTTY 中保存了一个名为  foobarserver 的会话，而我们所在的网络又的确没有名为 foobarserver 的主机名称。而在这个 foobarserver  会话中保存的主机名称是 demo-server，保存的自动登录的用户是 taylor。那么用命令&lt;br /&gt;&lt;blockquote&gt;pscp c:\autoexec.bat foobarserver:backup/&lt;br /&gt;&lt;/blockquote&gt;就把 本地的 c:\autoexec.bat 复制到了主机 demo-server 上的用户 taylor 所在的主目录下的 backup  子目录中（这个路径可能是 /home/taylor/backup &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;br /&gt;所以 PSCP 大致用法的例子就是：&lt;br /&gt;pscp -P 22 -i c:\path\your-private-key.ppk  -C username@server:/remote/path/&lt;br /&gt;下面还是用一些实例来说明会比较简单一些：&lt;br /&gt;把本地的  C:\path\foo.txt 复制到远程主机 192.168.6.200 的 /tmp 目录下&lt;/p&gt; &lt;blockquote&gt;pscp c:\path\foo.txt 192.168.6.200:/tmp&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;把本地的 C:\path\foo.txt 复制到主机 192.168.6.200 的 /tmp 目录下，但是以主机上的用户 taylor  的权限执行&lt;/p&gt; &lt;blockquote&gt;pscp c:\path\foo.txt &lt;span style=&quot;font-weight: bold;&quot;&gt;taylor@&lt;/span&gt;192.168.6.200:/tmp&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;或者是&lt;/p&gt; &lt;blockquote&gt;pscp &lt;span style=&quot;font-weight: bold;&quot;&gt;-l taylor&lt;/span&gt;  c:\path\foo.txt 192.168.6.200:/tmp&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;把本地的 C:\path\foo.txt 传送到主机 192.168.6.200 的 /tmp 目录下，但是主机的 SSH 端口是  3122&lt;/p&gt; &lt;blockquote&gt;pscp &lt;span style=&quot;font-weight: bold;&quot;&gt;-P 3122&lt;/span&gt;  c:\path\foo.txt 192.168.6.200:/tmp&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;把本地的 C:\path\foo.txt 复制到主机 192.168.6.200 的用户 taylor 的主目录下&lt;/p&gt; &lt;blockquote&gt;pscp c:\path\foo.txt taylor@192.168.6.200:.&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;把主机 192.168.6.200 上的用户 taylor 主目录下的所有 *.tgz 文件拷贝到本地的 c:\backup 目录中，如果  SSH 版本是 SSH v1，那这个命令就会出错。&lt;/p&gt; &lt;blockquote&gt;pscp taylor@192.168.6.200:*.tgz c:\backup&lt;br /&gt;&lt;/blockquote&gt; &lt;h3&gt;再来看看 PSFTP&lt;/h3&gt; &lt;p&gt;在控制台执行命令 psftp -h，可以得到 psftp 的帮助&lt;/p&gt; &lt;blockquote&gt;C:\&gt;psftp -h&lt;br /&gt;PuTTY Secure File Transfer (SFTP) client&lt;br /&gt;Release  0.58&lt;br /&gt;Usage: psftp [options] [user@]host&lt;br /&gt;Options:&lt;br /&gt;      -V           print version information and exit&lt;br /&gt;     -pgpfp        print PGP key fingerprints and exit&lt;br /&gt;     -b file      use specified  batchfile&lt;br /&gt;     -bc          output batchfile commands&lt;br /&gt;      -be          don&#39;t stop batchfile processing if errors&lt;br /&gt;      -v           show verbose messages&lt;br /&gt;     -load sessname     Load  settings from saved session&lt;br /&gt;     -l user      connect with specified  username&lt;br /&gt;     -P port      connect to specified port&lt;br /&gt;     -pw  passw login with specified password&lt;br /&gt;     -1 -2        force use of  particular SSH protocol version&lt;br /&gt;     -4 -6        force use of IPv4  or IPv6&lt;br /&gt;     -C           enable compression&lt;br /&gt;     -i key        private key file for authentication&lt;br /&gt;     -batch       disable all  interactive prompts&lt;br /&gt;&lt;br /&gt;C:\&gt;&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;用法与 PSCP 大同小异，虽然有个 -load 选项，其实这个没啥用，后面用主机名的时候，与 PSCP 一样直接用上会话名称就可以了。&lt;br /&gt;用  PSFTP 登录到服务器上以后，操作与 FTP 差不多，这里简单的说一下吧：&lt;/p&gt; &lt;div&gt; &lt;ul&gt;&lt;li&gt;open 登录主机&lt;br /&gt;open [username@]&lt;sessname|hostname|ip&gt; [port]&lt;br /&gt;比 如：  &lt;ul&gt;&lt;li&gt;open taylor@demo-server 3022&lt;br /&gt;就是以用户 taylor 的身份，登陆到主机 demo-server  上，SSH 端口是 3022  &lt;/li&gt;&lt;li&gt;open demo-server&lt;br /&gt;登陆 demo-server，这里的 demo-server 可以是PuTTY  中已经保存的会话名称，也可以是主机的名称，如果主机名称与会话名称相同，以会话名称为准。 &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;close 关闭 SFTP 连接&lt;br /&gt;这个没啥说的，close 就关闭了 SFTP 连接  &lt;/li&gt;&lt;li&gt;quit 结束本次的 SFTP 会话&lt;br /&gt;也没啥用法，就是关闭了 PSFTP 这个程序  &lt;/li&gt;&lt;li&gt;help [command] 帮助&lt;br /&gt;直接打 help 就可以看到帮助指令，后面指定上  一个命令就可以查看该命令的帮助，比如： help open  &lt;/li&gt;&lt;li&gt;cd [directory] 改变当前目录  &lt;/li&gt;&lt;li&gt;pwd 察看当前目录  &lt;/li&gt;&lt;li&gt;lcd [directory] 改变本地目录  &lt;/li&gt;&lt;li&gt;lpwd 察看本地当前目录  &lt;/li&gt;&lt;li&gt;get [-r] &lt;filename|directory&gt; 从服务器下载一个文件/目录，这个命令不能用通配符，参数  -r 可以递归下载整个目录  &lt;/li&gt;&lt;li&gt;put [-r] &lt;filename|directory&gt; [dest]  把文件/目录上传到服务器，这个命令不能用通配符，参数 -r 可以递归上传整个目录  &lt;/li&gt;&lt;li&gt;mget [-r] &lt;filename|directory&gt; 从服务器下载一批文件/目录，可以用通配符，-r  的含义与 get 一样  &lt;/li&gt;&lt;li&gt;mget [-r] &lt;filename|directory&gt; [dest]  把一批文件/目录上传到服务器，可以用通配符，-r 的含义与 put 一样  &lt;/li&gt;&lt;li&gt;reget [-r] &lt;filename|directory&gt;  从服务器续传下载一个文件/目录，这个命令不能用通配符，-r 的含义与 get 一样  &lt;/li&gt;&lt;li&gt;reput [-r] &lt;filename|directory&gt; [dest]  把一批文件/目录续传上传到服务器，这个命令不能用通配符，-r 的含义与 put 一样  &lt;/li&gt;&lt;li&gt;dir [directory] 列目录  &lt;/li&gt;&lt;li&gt;ls 和 dir 一样  &lt;/li&gt;&lt;li&gt;chmod [file|directory] 改变文件的权限，与 Unix 的 chmod 命令类似  &lt;/li&gt;&lt;li&gt;del &lt;filename&gt; 删除文件，要注意的是 del 只能删除文件  &lt;/li&gt;&lt;li&gt;rm 与 del 一样  &lt;/li&gt;&lt;li&gt;mkdir &lt;new-directory-name&gt; 创建一个目录  &lt;/li&gt;&lt;li&gt;rmdir &lt;directory&gt; 删除一个空目录，只有空目录才可以被删除  &lt;/li&gt;&lt;li&gt;mv &lt;source-file|source-directory&gt;  &lt;dest-file|dest-directory&gt;  改名/移动。如果源和目的都是文件或目录，则是改名。如果目的是目录的话，则是移动。  &lt;/li&gt;&lt;li&gt;! 在本地命令前加一个感叹号，就可以直接执行 &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;  &lt;h3&gt;其他可选的 SFTP 客户端&lt;/h3&gt; &lt;p&gt;FileZilla : http://filezilla.sf.net&lt;br /&gt;WinSCP : http://www.winscp.net&lt;/p&gt; &lt;h2&gt;用 Plink 更方便快捷的执行远程主机上的命令&lt;/h2&gt; &lt;p&gt;Plink 是 PuTTY 的命令行连接工具，主要用于自动化工作的处理。&lt;br /&gt;直接在控制台执行 plink，可以看到 Plink 的帮助&lt;/p&gt; &lt;blockquote&gt;C:\&gt;plink&lt;br /&gt;PuTTY Link: command-line connection utility&lt;br /&gt;Release  0.58&lt;br /&gt;Usage: plink [options] [user@]host [command]&lt;br /&gt;           (&quot;host&quot; can also be a PuTTY saved session name)&lt;br /&gt;Options:&lt;br /&gt;      -V           print version information and exit&lt;br /&gt;     -pgpfp        print PGP key fingerprints and exit&lt;br /&gt;     -v           show verbose  messages&lt;br /&gt;     -load sessname     Load settings from saved session&lt;br /&gt;      -ssh -telnet -rlogin -raw&lt;br /&gt;               force use of a particular  protocol&lt;br /&gt;     -P port      connect to specified port&lt;br /&gt;     -l  user      connect with specified username&lt;br /&gt;     -batch       disable  all interactive prompts&lt;br /&gt;The following options only apply to SSH  connections:&lt;br /&gt;     -pw passw login with specified password&lt;br /&gt;     -D  [listen-IP:]listen-port&lt;br /&gt;               Dynamic SOCKS-based port  forwarding&lt;br /&gt;     -L [listen-IP:]listen-port:host:port&lt;br /&gt;                Forward local port to remote address&lt;br /&gt;     -R  [listen-IP:]listen-port:host:port&lt;br /&gt;               Forward remote port  to local address&lt;br /&gt;     -X -x        enable / disable X11 forwarding&lt;br /&gt;      -A -a        enable / disable agent forwarding&lt;br /&gt;     -t -T         enable / disable pty allocation&lt;br /&gt;     -1 -2        force use of  particular protocol version&lt;br /&gt;     -4 -6        force use of IPv4 or  IPv6&lt;br /&gt;     -C           enable compression&lt;br /&gt;     -i key        private key file for authentication&lt;br /&gt;     -m file      read remote  command(s) from file&lt;br /&gt;     -s           remote command is an SSH  subsystem (SSH-2 only)&lt;br /&gt;     -N           don&#39;t start a shell/command  (SSH-2 only)&lt;br /&gt;&lt;br /&gt;C:\&gt;&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;看上去 Plink 的使用方法、参数与PSCP、PSFTP都很类似。&lt;/p&gt; &lt;ul&gt;&lt;li&gt;-P port 指定服务器的 SSH 端口，注意这个是大写字母 P，默认是 -P 22，如果主机的 SSH 端口就是 22，就不用指定了   &lt;/li&gt;&lt;li&gt;-l user 指定以哪个用户的身份登录主机，如果没有指定，则 PSCP 会在 PuTTY 保存的同名 Session  中获得默认的用户名称。用户名称也可以和主机名称写在一起，用 @ 分割开，比如：username@server  &lt;/li&gt;&lt;li&gt;-pw passwd 指定登录时所用的口令为 passwd  &lt;/li&gt;&lt;li&gt;-i keyfile 就是指定登录时所用的密钥文件  &lt;/li&gt;&lt;li&gt;-m file 如果执行的命令很多的话，可以把命令写到文件中，然后用这个参数来指定 &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;还是用一些实际的例子来说明一下 Plink 吧&lt;br /&gt;还记得前面说到 PuTTY  的自动执行命令那个配置么？在说到那个配置的时候，我们演示了一个简单的 Tomcat 重新启动的命令，这个命令是要写在 PuTTY 的  Remote command 里面去。现在我们用 Plink 来实现同样的功能：&lt;br /&gt;假设连接的主机是 192.168.6.200，SSH  的端口是 3022，用户是 taylor：&lt;/p&gt; &lt;blockquote&gt;plink -P 3022 taylor@192.168.6.200 export  CATALINA_HOME=&quot;~/apache-tomcat-5.5.17&quot;;export  JAVA_HOME=&quot;~/jdk1.5.0_07&quot;;export PATH=$JAVA_HOME/bin;$PATH ; cd  $CATALINA_HOME/bin;./shutdown.sh;./startup.sh;tail -f  $CATALINA_HOME/logs/catalina.out&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;如果在 PuTTY 中保存了一个名为 192.168.6.200 的会话，注意，这个会话的名称与主机 IP  一样，在会话中已经正确保存了端口 3022，指定了默认的用户是 taylor，现在这个命令就可以简化为：&lt;/p&gt; &lt;blockquote&gt;plink 192.168.6.200 export  CATALINA_HOME=&quot;~/apache-tomcat-5.5.17&quot;;export  JAVA_HOME=&quot;~/jdk1.5.0_07&quot;;export PATH=$JAVA_HOME/bin;$PATH ; cd  $CATALINA_HOME/bin;./shutdown.sh;./startup.sh;tail -f  $CATALINA_HOME/logs/catalina.out&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;用 date 命令查看一下主机上的时间，并且格式化输出：&lt;/p&gt; &lt;blockquote&gt;plink 192.168.6.200 date &quot;+%F %T&quot;&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;大家实际执行一下命令看看，会发现，这个命令并没有返回我们期望的结果，而是返回了一个错误：&lt;/p&gt; &lt;blockquote&gt;C:\&gt;plink 192.168.6.200 date &quot;+%F %T&quot;&lt;br /&gt;date: too many  non-option arguments: %T&lt;br /&gt;Try `date --help&#39; for more information.&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;可是在服务器上直接执行命令 date &quot;+%F  %T&quot;，的确是正确无误的，哪里出了问题呢？这是因为Windows的控制台会把两个双引号之间的字符串作为一个参数传递给被执行的程序，而不会把双引号 也传递给程序。我们做这样一个小小的实验来说明一下这个问题：&lt;br /&gt;比如在 c:\tmp  文件夹里建立三个文件夹，名称分别为：&quot;foo&quot;、&quot;bar&quot;、&quot;foo bar&quot;。然后在 foo  这个文件夹里面建立一个名为“foo.log”的空文件，在“bar”这个文件夹里建立一个名为“bar.log”的空文件，在“foo  bar”这个文件夹里建立一个名为“foo-bar.log”的空文件。&lt;br /&gt;然后在控制台下进入 c:\tmp 这个文件夹，执行如下命令：&lt;/p&gt; &lt;blockquote&gt;dir foo bar&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;结果是列出“foo bar”这个文件夹里的内容，还是分别列出“foo”和“bar”文件夹里的东西呢？正确答案是后者。&lt;br /&gt;要想正确列出 “foo bar”文件夹里的东西，就需要用双引号把&quot;foo bar&quot;引起来&lt;/p&gt; &lt;blockquote&gt;C:\tmp&gt;dir foo bar&lt;br /&gt;Volume in drive C is System&lt;br /&gt;Volume  Serial Number is 9C51-A51C&lt;br /&gt;&lt;br /&gt;Directory of C:\tmp\foo&lt;br /&gt;&lt;br /&gt;2006-11-22      09:48       &lt;dir&gt;             .&lt;br /&gt;2006-11-22     09:48        &lt;dir&gt;             ..&lt;br /&gt;2006-11-16     11:58                    0  foo.log&lt;br /&gt;                  1 File(s)                 0 bytes&lt;br /&gt;&lt;br /&gt;Directory  of C:\tmp\bar&lt;br /&gt;&lt;br /&gt;2006-11-22     09:48       &lt;dir&gt;              .&lt;br /&gt;2006-11-22     09:48       &lt;dir&gt;             ..&lt;br /&gt;2006-11-16      11:58                    0 bar.log&lt;br /&gt;                  1  File(s)                 0 bytes&lt;br /&gt;                  2 Dir(s)       1,107,345,408 bytes free&lt;br /&gt;&lt;br /&gt;C:\tmp&gt;dir &quot;foo bar&quot;&lt;br /&gt;Volume in  drive C is System&lt;br /&gt;Volume Serial Number is 9C51-A51C&lt;br /&gt;&lt;br /&gt;Directory  of C:\tmp\foo bar&lt;br /&gt;&lt;br /&gt;2006-11-22     09:48        &lt;dir&gt;             .&lt;br /&gt;2006-11-22     09:48        &lt;dir&gt;             ..&lt;br /&gt;2006-11-16     11:58                    0  foo-bar.log&lt;br /&gt;                  1 File(s)                 0 bytes&lt;br /&gt;                   2 Dir(s)      1,107,345,408 bytes free&lt;br /&gt;&lt;br /&gt;C:\tmp&gt;&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;说到这里，就会明白上面的那个命令 plink 192.168.6.200 date &quot;+%F %T&quot; 其实在主机上执行的真实命令是  date +%F %T，而不是命令行中指定的 date &quot;+%F %T&quot;。不过还好，Windows  的控制台可不认得单引号，所以上面那个命令的正确用法应该是：&lt;/p&gt; &lt;blockquote&gt;c:\&gt;plink 192.168.6.200 date &#39;+%F %T&#39;&lt;br /&gt;2006-11-22  09:39:57&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;我经常需要登录到服务器上把 ADSL 重新拨号，可以把下面的命令写到一个文本文件中，比如保存到了  C:\adsl-restart.command.txt&lt;/p&gt; &lt;blockquote&gt;echo &quot;stoping...&quot;&lt;br /&gt;/sbin/adsl-stop&lt;br /&gt;echo &quot;starting...&quot;&lt;br /&gt;/sbin/adsl-start&lt;br /&gt;echo  &quot;done.&quot;&lt;br /&gt;/sbin/adsl-status&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;然后执行如下命令：&lt;/p&gt; &lt;blockquote&gt;plink -m c:\adsl-restart.command.txt root@192.168.6.251&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;我经常要查看 Tomcat 的运行日志&lt;/p&gt; &lt;blockquote&gt;plink taylor@192.168.6.200 tail -f  ~/apache-tomcat-5.5.17/logs/catalina.out&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;每天都要看服务器上的剩余空间，就用这个命令：&lt;/p&gt; &lt;blockquote&gt;plink taylor@192.168.6.200 df -k&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;假设 www.chaifeng.com 连接着另外一个网段 10.204.26.0，有台内网IP 为 10.204.26.21 的  Solaris 8主机只能用 telnet 登录，为了防止被监听，我们可以用 Plink 建立一个隧道，隧道开放 120  秒钟，如果隧道没有被使用，就自动断开连接，然后我们在本地就可以用命令 telnet localhost 2623 的安全登录那台 Solaris  8 主机了。&lt;/p&gt; &lt;blockquote&gt;plink -L 2623:10.204.26.21:23 www.chaifeng.com sleep 120&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;在主机 www.chaifeng.com 上正在运行着 tor，默认的监听地址是 127.0.0.1:9050，用 Plink  建立一个隧道，然后浏览器上配置代理服务器为 127.0.0.1，端口是 9050，这样就能够安全的使用 tor  代理了，不用担心从我们的机器到主机 www.chaifeng.com 有被监听的可能了。&lt;/p&gt; &lt;blockquote&gt;plink -C -N -L 9050:127.0.0.1:9050 taylor@www.chaifeng.com&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;结合上 PSCP 我们还可以完成文件的每天备份&lt;/p&gt; &lt;blockquote&gt;plink taylor@192.168.6.200 tar jcf $(date  &#39;+documents.%F.tar.bz2&#39;) ~/documents&lt;br /&gt;pscp taylor@192.168.6.200:$(date  &#39;+documents.%F.tar.bz2&#39;) c:\backup\&lt;br /&gt;plink taylor@192.168.6.200 rm -f  $(date &#39;+documents.%F.tar.bz2&#39;)&lt;br /&gt;&lt;/blockquote&gt; &lt;p&gt;如果把这些常用的操作写成批处理文件，到时候要重启一下 Tomcat，或者马上察看一下 Tomcat 日志，再或者只是要把 ADLS  重新拨号以下，只需要用鼠标一双击这个批处理文件，稍等一下就自动完成了。不比你打开  PuTTY，登录到服务器上，然后再一个一个的执行命令，最后还得注销来的方便快捷么？再&lt;/p&gt;&lt;/div&gt; 			 			 			&lt;div class=&quot;ArticleTag&quot;&gt; 			    标签: &lt;a href=&quot;http://blog.hexun.com/group/commontag.aspx?searchTag=Unix%cf%b5%cd%b3&quot; target=&quot;_blank&quot;&gt;Unix系统&lt;/a&gt; &lt;a href=&quot;http://t.hexun.com/k/Unix%cf%b5%cd%b3&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://blog.hexun.com/img/weibo.gif&quot; alt=&quot;查看和 Unix系统 相关的微博&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;  . 			&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/8149032987714238710/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/8149032987714238710' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/8149032987714238710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/8149032987714238710'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2010/07/putty.html' title='Putty'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-5285622418469405232</id><published>2009-05-11T18:47:00.000-07:00</published><updated>2009-05-11T18:48:17.811-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="聚合物锂离子电池"/><title type='text'>聚合物锂离子电池</title><content type='html'>聚合物锂离子电池的特点概述&lt;br /&gt;　　根据锂离子电池所用电解质材料不同，锂离子电池可以分为液态锂离子电池(lithium ion battery, 简称为LIB)和聚合物锂离子电池(polymer lithium ion battery, 简称为LIP)两大类。聚合物锂离子电池所用的正负极材料与液态锂离子都是相同的，电池的工作原理也基本一致。它们的主要区别在于电解质的不同, 锂离子电池使用的是液体电解质, 而聚合物锂离子电池则以固体聚合物电解质来代替, 这种聚合物可以是“干态”的,也可以是“胶态”的,目前大部分采用聚合物胶体电解质。聚合物锂离子电池可分为三类：&lt;br /&gt;　　（1）固体聚合物电解质锂离子电池。电解质为聚合物与盐的混合物，这种电池在常温下的离子电导率低，适于高温使用。&lt;br /&gt;　　（2）凝胶聚合物电解质锂离子电池。即在固体聚合物电解质中加入增塑剂等添加剂，从而提高离子电导率，使电池可在常温下使用。&lt;br /&gt;　　（3）聚合物正极材料的锂离子电池。采用导电聚合物作为正极材料，其比能量是现有锂离子电池的3倍，是最新一代的锂离子电池。由于用固体电解质代替了液体电解质,与液态锂离子电池相比，聚合物锂离子电池具有可薄形化、任意面积化与任意形状化等优点，也不会产生漏液与燃烧爆炸等安全上的问题，因此可以用铝塑复合薄膜制造电池外壳，从而可以提高整个电池的比容量；聚合物锂离子电池还可以采用高分子作正极材料，其质量比能量将会比目前的液态锂离子电池提高50％以上。此外,聚合物锂离子电池在工作电压、充放电循环寿命等方面都比锂离子电池有所提高。基于以上优点，聚合物锂离子电池被誉为下一代锂离子电池。 聚合物锂离子(Lithium ion polymer)电池，具有更高能量密度、小型化、薄型化、轻量化、高安全性、长循环寿命与低成本的新型电池。因此，在未来2～3年内，聚合物锂电池取代锂离子电池市场的份额将达50％。&lt;br /&gt;　　第一 原理篇&lt;br /&gt;　　锂离子电池目前有液态锂离子电池(LIB)和聚合物锂离子电池(PLIB)两类。其中，液态锂离子电池是指Li+嵌入化合物为正、负极的二次电池。正极采用锂化合物LiCoO2，LiNiO2或LiMn2O4，负极采用锂—碳层间化合物LixC6，典型的电池体系为：&lt;br /&gt;　　(-) C  LiPF6—EC+DEC  LiCoO2 (+)&lt;br /&gt;　　正极反应：LiCoO2=Li1-xCoO2+xLi++xe- ----------- （2．1）&lt;br /&gt;　　负极反应：6C+xLi++xe-=LixC6 ----------- （2．2）&lt;br /&gt;　　电池总反应：LiCoO2+6C=Li1-xCoO2+LixC6 ----------- （2．3）&lt;br /&gt;　　聚合物锂离子电池的原理与液态锂相同，主要区别是电解液与液态锂不同。电池主要的构造包括有正极、负极与电解质三项要素。所谓的聚合物锂离子电池是说在这三种主要构造中至少有一项或一项以上使用高分子材料做为主要的电池系统。而在目前所开发的聚合物锂离子电池系统中，高分子材料主要是被应用于正极及电解质。正极材料包括导电高分子聚合物或一般锂离子电池所采用的无机化合物，电解质则可以使用固态或胶态高分子电解质，或是有机电解液，一般锂离子技术使用液体或胶体电解液，因此需要坚固的二次包装来容纳可燃的活性成分，这就增加了重量，另外也限制了尺寸的灵活性。而聚合物锂离子工艺中没有多余的电解液，因此它更稳定，也不易因电池的过量充电、碰撞或其他损害、以及过量使用而造成危险情况。&lt;br /&gt;　　新一代的聚合物锂离子电池在形状上可做到薄形化（ATL电池最薄可达0.5毫米,相于一张卡片的厚度）、任意面积化和任意形状化，大大提高了电池造型设计的灵活性，从而可以配合产品需求，做成任何形状与容量的电池，为应用设备开发商在电源解决方案上提供了高度的设计灵活性和适应性，以最大化地优化其产品性能。同时，聚合物锂离子电池的单位能量比目前的一般锂离子电池提高了50%，其容量、充放电特性、安全性、工作温度范围、循环寿命（超过500 次）与环保性能等方面都较锂离子电池有大幅度的提高。&lt;br /&gt;　　聚合物锂离子的发展趋势展望&lt;br /&gt;　　聚合物锂离子电池在全球技术成熟并商业化已经2年多时间了，虽然销量在快速增长，但其市场份额尚低于10%，与液态锂电90%的市场份额无法相比，大大低于人们的预期。由于各种原因，目前市场上聚合物的价格普遍要高于液态锂电，但是，由于移动电器的竞争模式正在悄悄地发生变化，特别是聚合物电池给移动电器带来的设计价值创新（如4mm厚度以下的优越性能、大型规格电池），聚合物电池正被越来越多的手机、移动DVD等设计人员所认识，因而聚合物厂商还是信心十足，坚信聚合物的时代一定会到来。可以从手机的发展看聚合物锂离子电池的发展趋势。目前手机有以下几个发展趋势：&lt;br /&gt;　　(1) 手机本身向小型化、超薄化方向发展，以方便消费者的携带；&lt;br /&gt;　　(2) 手机设计的个性化，表现在设计理念已经不再是原来方方正正的形状，不规则形状、曲线、弧面设计造型成为手机设计美学化的主流；&lt;br /&gt;　　(3) 使用彩屏、手机功能的不断增加。为了使手机小型化，电池减小、减薄是一个最有效的途径。4mm以下厚度电池有成为薄型手机配置的主流趋势，从性价比来讲，这是聚合物的特长。不规则形状、曲线、弧面设计造型的手机给电池留下的有效空间变成了不规则形状。液态的长方型不能有效利用空间，容量较低，而叠片式聚合物可以将这种不规则空间最有效地利用起来，使容量放大。最近TCL金能公司推出的圆弧型电池、梯形电池、背包电池能使手机比使用相应规格的液态电池容量增加50%以上。手机功能越来越多，导致耗电越来越多。要求电池容量相应地增加。在不增加电池厚度的情况下，聚合电池是有明显优势的。与此相似，笔记本电脑、蓝牙耳机、小灵通手机、移动DVD等电器都在向移动、便携化方向发展，都配上了液晶显示，而且功能在不断增多，液晶屏幕在不断增大。这些都给聚合物锂离子电池提供了无限的商机。</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/5285622418469405232/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/5285622418469405232' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5285622418469405232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5285622418469405232'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2009/05/blog-post_11.html' title='聚合物锂离子电池'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-101710569101196444</id><published>2009-05-11T18:45:00.000-07:00</published><updated>2009-05-11T18:46:16.875-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="锂离子电池-锂电池-锂聚合物电池"/><title type='text'>锂离子电池-锂电池-锂聚合物电池</title><content type='html'>锂是一种金属元素，其化学符号为Li(其英文名为lithium)，是一种银白色、十分柔软、化学性能活泼的金属，在金属中是最轻的。它除了应用于原子能工业外，可制造特种合金、特种玻璃(电视机上用的荧光屏玻璃)及锂电池。在锂电池中它用作电池的阳极。&lt;br /&gt;锂电池也分成两大类：不可充电的及可充电的两类。不可充电的电池称为一次性电池，它只能将化学能一次性地转化为电能，不能将电能还原回化学能(或者还原性能极差)。而可充电的电池称为二次性电池(也称为蓄电池)。它能将电能转变成化学能储存起来，在使用时，再将化学能转换成电能，它是可逆的，如电能化学能锂电池的主要特点。&lt;br /&gt;灵巧型便携式电子产品要求尺寸孝重量轻，但电池的尺寸及重量与其它电子元器件相比往往是最大的及最重的。例如，想当年的“大哥大”是相当“粗大、笨重”，而今天的手机是如此的轻巧。其中电池的改进是起了重要作用的：过去是镍镉电池，现在是锂离子电池。&lt;br /&gt;锂电池的最大特点是比能量高。什么是比能量呢?比能量指的是单位重量或单位体积的能量。比能量用Wh/kg或Wh/L来表示。Wh是能量的单位，W是瓦、h 是小时；kg是千克(重量单位)，L是升(体积单位)。这里举一个例来说明：5号镍镉电池的额定电压为1.2V，其容量为800mAh，则其能量为 0.96Wh(1.2V×0.8Ah)。同样尺寸的5号锂－二氧化锰电池的额定电压为3V，其容量为1200mAh，则其能量为3.6Wh。这两种电池的体积是相同的，则锂－二氧化锰电池的比能量是镍镉电池的375倍!&lt;br /&gt;一节5号镍镉电池约重23g，而一节5号锂－二氧化锰电池约重18g。一节锂－二氧化锰电池为3V，而两节镍镉电池才2.4V。所以采用锂电池时电池数量少(使便携式电子产品体积减孝重量减轻)，并且电池的工作寿命长。&lt;br /&gt;另外，锂电池具有放电电压稳定、工作温度范围宽、自放电率低、储存寿命长、无记忆效应及无公害等优点。&lt;br /&gt;锂电池的缺点是价格昂贵，所以目前尚不能普遍应用，主要应用于掌上计算机、PDA、通信设备、照相机、卫星、导弹、鱼雷、仪器等。随着技术的发展、工艺的改进及生产量的增加，锂电池的价格将会不断地下降，应用上也会更普遍。&lt;br /&gt;不可充电的锂电池&lt;br /&gt;不可充电的锂电池有多种，目前常用的有锂－二氧化锰电池、锂—亚硫酰氯电池及锂和其它化合物电池。本文仅介绍前两种最常用的。 1、锂－二氧化锰电池(LiMnO2) 锂－二氧化锰电池是一种以锂为阳极、以二氧化锰为阴极，并采用有机电解液的一次性电池。该电池的主要特点是电池电压高，额定电压为3V(是一般碱性电池的2 倍)；终止放电电压为2V；比能量大(见上面举的例子)；放电电压稳定可靠；有较好的储存性能(储存时间3年以上)、自放电率低(年自放电率≤2％)；工作温度范围－20℃～＋60℃。&lt;br /&gt;该电池可以做成不同的外形以满足不同要求，它有长方形、圆柱形及纽扣形(扣式)。圆柱形的也有不同的直径及高度尺寸。这里列举大家较熟悉的1＃(尺寸代码D)、2＃(尺寸代码C)及5＃(尺寸代码AA)电池的主要参数。&lt;br /&gt;CR表示为圆柱形锂－二氧化锰电池；五位数字中，前两位表示电池的直径,后三位表示带一位小数的高度。例如，CR14505，其直径为14mm，高度为505mm(这种型号是通用的)。&lt;br /&gt;这里要指出的是不同工厂生产的同型号的电池其参数可能有些差别。另外，标准放电电流值是较小的，实际放电电流可以大于标准放电电流，并且连续放电及脉冲放电的允许放电电流也不同，由电池厂提供有关数据。例如，力兴电源公司生产的CR14505给出最大连续放电电流为1000mA，最大脉冲放电电流可达 2500mA。&lt;br /&gt;照相机中用的锂电池多半是锂－二氧化锰电池。这里将照相机中常用的锂－二氧化锰电池列入表2，供参考。&lt;br /&gt;纽扣式(扣式)电池尺寸较小，其直径为12.5～24.5mm，高度为1.6～5.0mm。几种较常用的扣式电池如表3所示。&lt;br /&gt;CR为圆柱形锂－二氧化锰电池，后四位数字中前两位为电池的直径尺寸，后两位为带小数点的高度尺寸。例如，CR1220的直径为12.5mm(不包括小数点后的数)，其高度为2.0mm。这种型号表示方法是国际通用的。&lt;br /&gt;这种扣式电池常用于时钟、计算器、电子记事本、照相机、助听器、电子游戏机、IC卡、备用电源等。&lt;br /&gt;2、锂－亚硫酰氯电池(LiSOCl2)&lt;br /&gt;锂－亚硫酰氯电池是比能量最高的一种，目前可达到500Wh/kg或1000Wh/L的水平。它的额定电压是3.6V，以中等电流放电时具有极其平坦的 3.4V放电特性(可在90％容量范围内平坦地放电，保持不大的变化)。电池可以在－40℃～＋85℃范围内工作，但在－40℃时的容量约为常温容量的 50％。自放电率低(年自放电率≤1％)、储存寿命长达10年以上。&lt;br /&gt;以1＃(尺寸代码D)镍镉电池与1＃锂－亚硫酰氯电池的比能量作一个比较：1＃镍镉电池的额定电压为1.2V，容量为5000mAh；1＃锂－亚硫酰氯的额定电压为3.6V，容量为10000mAh，则后者的比能量比前者大6倍!&lt;br /&gt;应用注意事项&lt;br /&gt;上述两种锂电池是一次性电池，不可充电(充电时有危险!)；电池正负极之间不可短路；不可以过大电流放电(超过最大放电电流放电)；电池使用至终止放电电压时，应从电子产品中及时取出；用完的电池不可挤压、焚烧及拆卸；不可超过规定温度范围使用。&lt;br /&gt;由于锂电池的电压高于普通电池或镍镉电池，使用时不要搞错以免损坏电路。通过熟悉型号中的CR、ER就可以知道它的种类及额定电压。在购买新电池时，一定要按原来的型号来买，否则会影响电子产品性能。&lt;br /&gt;二次锂电池的优势是什幺? 1. 高的能量密度 2. 高的工作电压 3. 无记忆效应 4. 循环寿命长 5. 无污染 6. 重量轻 7. 自放电小&lt;br /&gt;锂聚合物电池具有哪些优点? 1. 无电池漏液问题,其电池内部不含液态电解液,使用胶态的固体。 2. 可制成薄型电池：以3.6V400mAh的容量，其厚度可薄至0.5mm。 3. 电池可设计成多种形状 4. 电池可弯曲变形：高分子电池最大可弯曲900左右 5. 可制成单颗高电压：液态电解质的电池仅能以数颗电池串联得到高电压，高分子电池由于本身无液体，可在单颗内做成多层组合来达到高电压。 7. 容量将比同样大小的锂离子电池高出一倍&lt;br /&gt;什么是二次电池的自放电不同类型电池的自放电率是多少？ 自放电又称荷电保持能力，它是指在开路状态下，电池储存的电量在一定环境条件下的保持能力。一般而言，自放电主要受制造工艺，材料，储存条件的影响自放电是衡量电池性能的主要参数之一。一般而言，电池储存温度越低，自放电率也越低，但也应注意温度过低或过高均有可能造成电池损坏无法使用，BYD常规电池要求储存温度范围为-20~45。电池充满电开路搁置一段时间后，一定程度的自放电属于正常现象。IEC标准规定镍镉及镍氢电池充满电后，在温度为20度湿度为65%条件下，开路搁置28天，0.2C放电时间分别大于3小时和3小时15分即为达标。 与其它充电电池系统相比，含液体电解液太阳能电池的自放电率明显要低，在25下大约为10%/月。&lt;br /&gt;什么是电池的内阻怎样测量? 电池的内阻是指电池在工作时,电流流过电池内部所受到的阻力,一般分为交流内阻和直流内阻,由于充电电池内阻很小,测直流内阻时由于电极容量极化,产生极化内阻,故无法测出其真实值,而测其交流内阻可免除极化内阻的影响,得出真实的内值. 交流内阻测试方法为:利用电池等效于一个有源电阻的特点,给电池一个1000HZ,50mA的恒定电流,对其电压采样整流滤波等一系列处理从而精确地测量其阻值.&lt;br /&gt;什么是电池的内压电池正常内压一般为多少? 电池的内压是由于充放电过程中产生的气体所形成的压力.主要受电池材料制造工艺,结构等使用过程因素影响.一般电池内压均维持在正常水平,在过充或过放情况下,电池内压有可能会升高: 如果复合反应的速度低于分解反应的速度,产生的气体来不及被消耗掉,就会造成电池内压升高.&lt;br /&gt;什么是内压测试? 锂电池内压测试为:(UL标准) 模拟电池在海拔高度为15240m的高空(低气压11.6kPa)下,检验电池是否漏液或发鼓. 具体步骤:将电池1C充电恒流恒压充电到4.2V,截止电流10mA ,然后将其放在气压为11.6Kpa,温度为(20+_3)的低压箱中储存6小时,电池不会爆炸,起火,裂口,漏液.&lt;br /&gt;环境温度对电池性能有何影响？ 在所有的环境因素中，温度对电池的充放电性能影响最大，在电极/电解液界面上的电化学反应与环境温度有关，电极/电解液界面被视为电池的心脏。如果温度下降，电极的反应率也下降，假设电池电压保持恒定，放电电流降低，电池的功率输出也会下降。如果温度上升则相反，即电池输出功率会上升，温度也影响电解液的传送速度温度上升则加快，传送温度下降，传送减慢，电池充放电性能也会受到影响。但温度太高，超过45，会破坏电池内的化学平衡，导致副反应&lt;br /&gt;过充电的控制方法有哪些？ 为了防止电池过充，需要对充电终点进行控制，当电池充满时，会有一些特别的信息可利用来判断充电是否达到终点。一般有以下六种方法来防止电池被过充： 1. 峰值电压控制:通过检测电池的峰值电压来判断充电的终点; 2. dT/dt控制:通过检测电池峰值温度变化率来判断充电的终点; 3. T控制:电池充满电时温度与环境温度之差会达到最大; 4. -V控制:当电池充满电达到一峰值电压后,电压会下降一定的值 5. 计时控制:通过设置一定的充电时间来控制充电终点,一般设定要充进130%标称容量所需的时间来控制; 6. TCO控制:考虑电池的安全和特性应当避免高温(高温电池除外)充电,因此当电池温度升高60时应当停止充电。&lt;br /&gt;什么是过充电对电池性能有何影响？ 过充电是指电池经一定充电过程充满电后，再继续充电的行为。 由于在设计时，负极容量比正极容量要高，因此，正极产生的气体透过隔膜纸与负极产生的镉复合。故一般情况下，电池的内压不会有明显升高，但如果充电电流过大，或充电时间过长，产生的氧气来不及被消耗，就可能造成内压升高，电池变形，漏液，等不良现象。同时，其电性能也会显着降低。&lt;br /&gt;什么是过放电对电池性能有何影响？ 电池放完内部储存的电量，电压达到一定值后，继续放电就会造成过放电，通常根据放电电流来确定放电截止电压。0.2C-2C放电一般设定1.0V/支,3C 以上如5C或10C放电设定为0.8V/支,电池过放可能会给电池带来灾难性的后果,特别是大电流过放，或反复过放对电池影响更大。一般而言，过放电会使电池内压升高，正负极活性物质可逆性受到破坏，即使充电也只能部分恢复，容量也会有明显衰减。&lt;br /&gt;不同容量的电池组合在一起使用会出现什幺问题? 如果将不同容量或新旧电池混在一起使用,有可能出现漏液,零电压等现象。这是由于充电过程中，容量差异导致充电时有些电池被过充，有些电池未充满电，放电时有容量高的电池未放完电，而容量低的则被过放。如此恶性循环，电池受到损害而漏液或低（零）电压。&lt;br /&gt;什么是电池的爆炸怎样预防电池爆炸? 电池内的任何部分的固态物质瞬间排出，被推至离电池25cm以上的距离，称为爆炸。判别电池爆炸与否，采用下述条件实验。将一网罩住实验电池，电池居于正中，距网罩任何一边为25cm。网的密度为6-7根/cm，网线采用直径为0.25mm的软铝线，如果实验无固体部分通过网罩，证明该电池未发生爆炸。 锂电池串联问题&lt;br /&gt;由于电池在生产过程中，从涂膜开始到成为成品要经过很多道工序。即使经过严格的检测程序，使每组电源的电压、电阻、容量一致，但使用一段时间，也会产生这样或那样的差异。如同一位母亲生的双胞胎，刚生下时可能长得一模一样，做为母亲都很难分辨。然而，在两个孩子不断成长时，就会产生这样或那样的差异锂动力电池也是这样。使用一段时间产生差异后，采用整体电压控制的方式是难以适用于锂动力电池的，如一个36V的电池堆，必须用10只电池串联。整体的充电控制电压是42V，而放电控制电压是26V。用整体电压控制方式，初始使用阶段由于电池一致性特别好，也许不会出现什么问题。在使用一段时间以后电池内阻和电压产生波动，形成不一致的状态，（不一致是绝对的，一致性是相对的）这种时候仍然使用整体电压控制是不能达到其目的的。例如10只电池放电时其中两只电池的电压在2.8V，四只电池的电压是3.2V，四只是3.4V，现在的整体电压是32V，我们让它继续放电一直工作到26V。这样，那两只2.8V的电池就低于2.6V 处于了过放状态。锂电池几次过放就等于报废。反之，用整体电压控制充电的方式进行充电，也会出现过充的状况。比如用上述10只电池当时的电压状态进行充电。整体电压达到42V时，那两只2.8V的电池处于\&quot;饥饿\&quot;的状态，而迅速吸收电量，就会超过4.2V，而过充的超过4.2V的电池，不仅由于电压过高产生报废，甚至还会发生危险，这就是锂动力电池的特性。&lt;br /&gt;锂离子电池的额定电压为3.6V(有的产品为3.7V)。充满电时的终止充电电压与电池阳极材料有关：阳极材料为石墨的4.2V；阳极材料为焦炭的4.1V。不同阳极材料的内阻也不同，焦炭阳极的内阻略大，其放电曲线也略有差别，如图1所示。一般称为4.1V锂离子电池及4.2V锂离子电池。现在使用的大部分是4.2V的，锂离子电池的终止放电电压为 2.5V～2.75V(电池厂给出工作电压范围或给出终止放电电压，各参数略有不同)。低于终止放电电压继续放电称为过放，过放对电池会有损害。&lt;br /&gt;便携式电子产品以电池作为电源。随着便携式产品的迅猛发展，各种电池的用量大增，并且开发出许多新型电池。除大家较熟悉的高性能碱性电池、可充电的镍镉电池、镍氢电池外，还有近年来开发的锂电池。本文主要介绍有关锂电池的基本知识。这包括它的特性、主要参数、型号的意义、应用范围及使用注意事项等。</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/101710569101196444/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/101710569101196444' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/101710569101196444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/101710569101196444'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2009/05/blog-post.html' title='锂离子电池-锂电池-锂聚合物电池'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-6291830109133179487</id><published>2009-04-22T23:43:00.000-07:00</published><updated>2009-04-22T23:59:55.305-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel mysql"/><title type='text'>使用Excel分析MySQL数据</title><content type='html'>&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;即使当今时代我们拥有了类似微软水晶报表之类的强大报表工具和其他一些灵活的客户管理应用工具，众多企业在分析诸如销售统计和收入信息的时候，微软的Excel依然是最常用的工具。这当然不是没有理由的：Excel以其强大丰富的各种功能，已经成为办公环境中不可或缺的工具。　　然而，现在公司正在逐渐地将数据开始存储在远程数据库中，这样可以供企业员工从不同的地方来阅读和修改数据。但是，以前固有的工作流程习惯是很难打破的。当你的老板需要从远端使用Excel以饼图的形势来看一下最近的销售数据的时候，你该怎么办？　　或许你没有想到，你可以将Excel连接到一个数据库，而且不仅仅限于微软的SQL Server。实际上Excel可以连接到所有的主流数据库，诸如MySQL、PostgreSQL和Oracle等等，只要该数据库提供ODBC驱动就可以。在本文中，我们将以MySQL为例，来了解如何将Excel连接到MySQL。　　安装MyODBC　　ODBC提供了一种执行几乎所有常规任务的标准方式，诸如数据恢复、删除和选择，这意味着针对不同的数据库，要编写不同的驱动程序来将用户的命令解释成标准的ODBC标准。MySQL早就有一个特定的ODBC驱动可用，也就是我们所熟知的MyODBC。在每一台你想使用Excel连接到MySQL的计算机上，你都需要安装MyODBC驱动。　　那么，现在首先来下载MyODBC安装程序（&lt;a href=&quot;http://dev.mysql.com/downloads/connector/odbc&quot;&gt;http://dev.mysql.com/downloads/connector/odbc&lt;/a&gt;）。该安装包只有2.3M，如果你是宽带连接的话，下载应该很快就完成。　　一旦你完成下载MyODBC后，点击图标开始安装。如果你没有特殊的安装要求，选择典型安装即可。点击安装按钮开始安装，安装完成后点击完成按钮推出安装程序。　配置MyODBC 　　如果你的操作系统是Windows XP的话，你可以按照如下方式打开ODBC终端：开始菜单-设置-控制面板-管理工具-数据源（ODBC）。QL/200805/10020.htmcn/data/MySQL/200805/10020.htm 图1、ODBC数据源管理器&lt;/div&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2PQixNv4R0EJUyAo0BGC9X81DGaqrk-pD-_-u4iwmRGYk7ru3_oJmWQZ2kb2K61iKnSpq9-EqjDXAGmi5h9h_Ta6-QmmpfVBUBa3ucm1HNk4cPdgkm8zRK1eEPn06h9YCfUZZEYXZ1-qK/s1600-h/1805130.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5327775458223010642&quot; style=&quot;WIDTH: 400px; CURSOR: hand; HEIGHT: 327px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2PQixNv4R0EJUyAo0BGC9X81DGaqrk-pD-_-u4iwmRGYk7ru3_oJmWQZ2kb2K61iKnSpq9-EqjDXAGmi5h9h_Ta6-QmmpfVBUBa3ucm1HNk4cPdgkm8zRK1eEPn06h9YCfUZZEYXZ1-qK/s400/1805130.jpg&quot; border=&quot;0&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/a&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;　　点击“Add（增加）”按钮来增加一个新的数据源，并滚动滑动条直到你发现MySQL ODBC驱动项为止。双击该项，开始配置过程。配置窗口如下图所示&lt;/div&gt;&lt;/span&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVaFdNlry6H9uM9NRXZ8AecdSPPx2hopnau-gFgkb0sTffTgsjiosymiQHvJTvsXQv-R5zCuQKErXTMYvmkMv19SN8sMG2ahyphenhyphenVJnckvQAL9yXDRMG8RdGl_y4OYUMh8by3MnLnTnRmn9b/s1600-h/1805131.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5327775398309379874&quot; style=&quot;WIDTH: 400px; CURSOR: hand; HEIGHT: 339px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVaFdNlry6H9uM9NRXZ8AecdSPPx2hopnau-gFgkb0sTffTgsjiosymiQHvJTvsXQv-R5zCuQKErXTMYvmkMv19SN8sMG2ahyphenhyphenVJnckvQAL9yXDRMG8RdGl_y4OYUMh8by3MnLnTnRmn9b/s400/1805131.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;图2、增加MySQL数据源&lt;br /&gt;&lt;br /&gt;填上各个选项后，点击“Test（测试）”按钮，确认该驱动是否能够与MySQL进行连接。如果你的数据库服务器与Excel在同一台机器的话，使用“localhost”或“127.0.0.1”作为服务器地址的话，有可能不会生效。那么，你可以使用一个点作为服务器地址，这样该驱动使用命名通道而不是TCP/IP来连接数据库。如果你要连接到远端的数据库，那么别忘了确保防火墙是否阻挡了你与MySQL连接的端口（通常是3306）。最后，不要忘了使用一个现有的合法登录帐号。如果你需要做的不仅仅是读取数据，还需要插入和更新数据，那么要注意登录的帐号要具有相应的权限。　　一旦测试连接成功后，点击“OK（确认）”按钮，就将在已存在的数据源列表中多一条。接下来，我们将连接Excel到MySQL。　　连接Excel到MySQL　　为了做这个练习，我们将连接Excel到一个名为contacts的MySQL表，其中包含全国范围内的不同合作伙伴和相关个人的联系信息。该MySQL表结构如下：&lt;br /&gt;create table contacts (rowid smallint unsigned not null auto_increment,&lt;br /&gt;firstname varchar(20) not null,&lt;br /&gt;lastname varchar(30) not null,&lt;br /&gt;email varchar(55) not null,&lt;br /&gt;title varchar(20) not null,&lt;br /&gt;company varchar(30) not null,phone char(10) not null,&lt;br /&gt;revenue decimal(5,2) not null,&lt;br /&gt;primary key(rowid)); 　　&lt;br /&gt;我已经在这些表中填充了一些示例数据，你将不久在Excel中看到它们。为了从Excel中管理这些数据，按如下操作：　　&lt;br /&gt;1、打开Excel，转到菜单上的“数据”，然后选择导入外部数据，导入数据。　　&lt;br /&gt;2、从出现的窗口中，选择“连接到新数据源.odc”。　　&lt;br /&gt;3、一个标题为“欢迎使用数据连接向导”的窗口出现，从这个窗口中选择“ODBC DSN”。　　4、从标题为“连接到ODBC数据源”的窗口中，选择你刚才创建的MySQL ODBC数据源。　　5、从标题为“选择数据库和表”的窗口中，选择相应的你要连接的数据库和表，如图3所示，选择好表后，点击下一步。　　&lt;br /&gt;6、在标题为“保存数据连接文件并结束”的最后一个窗口中，选择结束按钮。　　&lt;br /&gt;7、你将被询问在什么地方存储这个数据，你可以选择一个已有的工作表或者指定创建一个新的工作表中。选择后点击确认（OK）按钮。&lt;br /&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsUOfV5eF3jnoDDlrAK133PhGwoan1f3GI90v148oBii0LWDT0a9wrlDGMy61DezO2UayuriNWdwxY54ViYvrPLZcNfEYTQK6GjmFBPZ3pqIDtRANFKb_tQCf_2JTbkI2URKTZ8azvhr1v/s1600-h/1805132.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5327775337351858114&quot; style=&quot;WIDTH: 400px; CURSOR: hand; HEIGHT: 291px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsUOfV5eF3jnoDDlrAK133PhGwoan1f3GI90v148oBii0LWDT0a9wrlDGMy61DezO2UayuriNWdwxY54ViYvrPLZcNfEYTQK6GjmFBPZ3pqIDtRANFKb_tQCf_2JTbkI2URKTZ8azvhr1v/s400/1805132.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;图3、连接到一个指定的数据库和表如果一切顺利的话，你所需要的信息将会显示在Excel中，如图4所示。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRRCu9_gIE4heBOwzmubLRePXQ8tSxsymnjdMXbQregWM8EaZB80eCoN4NNIwAEtwRXqd4xuH1wiywaiwR2_Ig4bIOmrzJmMncqrkJ2uSb3nBEHg611_yrsIuUIk_RxY2rxf5BsSvxfqK/s1600-h/1805133.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5327775289035736162&quot; style=&quot;WIDTH: 400px; CURSOR: hand; HEIGHT: 129px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRRCu9_gIE4heBOwzmubLRePXQ8tSxsymnjdMXbQregWM8EaZB80eCoN4NNIwAEtwRXqd4xuH1wiywaiwR2_Ig4bIOmrzJmMncqrkJ2uSb3nBEHg611_yrsIuUIk_RxY2rxf5BsSvxfqK/s400/1805133.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;图4、在Excel中查看contacts数据库这样，用户就可以开始自由的创建各种图表了。例如，创建一个饼图是小菜一碟的事情，如图5所示。&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwB9_7M7K7BzPgbgRTSHgOx6Nfp_W8B29H7zrtPtqv-L8iL6dCTZMlR4Vnl5RujBZJNv1taHHxohNrVBhf9oWqsp3_ALJyYOWIOGYvoVAsr5gyrOlMphRnQgeHF-cuvSK7HEUt6FgGnARW/s1600-h/1805134.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5327775229349718850&quot; style=&quot;WIDTH: 400px; CURSOR: hand; HEIGHT: 292px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwB9_7M7K7BzPgbgRTSHgOx6Nfp_W8B29H7zrtPtqv-L8iL6dCTZMlR4Vnl5RujBZJNv1taHHxohNrVBhf9oWqsp3_ALJyYOWIOGYvoVAsr5gyrOlMphRnQgeHF-cuvSK7HEUt6FgGnARW/s400/1805134.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;图5、每一个联系人的收入饼图如果你需要的数据跨表的话，你可以尝试在数据库建立一个视图，然后使用Excel连接该视图。MySQL的MyODBC驱动为客户将数据库连接到不同的客户端应用程序敞开了一扇大门。我希望这篇短文能让你举一反三，实现类似的操作。&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/6291830109133179487/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/6291830109133179487' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/6291830109133179487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/6291830109133179487'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2009/04/excelmysql.html' title='使用Excel分析MySQL数据'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2PQixNv4R0EJUyAo0BGC9X81DGaqrk-pD-_-u4iwmRGYk7ru3_oJmWQZ2kb2K61iKnSpq9-EqjDXAGmi5h9h_Ta6-QmmpfVBUBa3ucm1HNk4cPdgkm8zRK1eEPn06h9YCfUZZEYXZ1-qK/s72-c/1805130.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-1743331140376400266</id><published>2009-04-20T00:31:00.000-07:00</published><updated>2009-04-20T00:33:49.226-07:00</updated><title type='text'>锌锰电池型号命名与标识-结构与特点</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaj4iCci4By-RUDdu_MtPnebANMHlS-JmE0jlo0OjAZ2Z-o1wJO7xBPu1XZB-PneT5SjiTB6hIyjdNOcg_Lp4EvrUHl_aaadsEOC83PAD1mkh_HTafI5xEX0rHycdRbl2o0cK1rqQEgjzI/s1600-h/å½å-çµæ± -åå·.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5326673456547321714&quot; style=&quot;WIDTH: 400px; CURSOR: hand; HEIGHT: 195px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaj4iCci4By-RUDdu_MtPnebANMHlS-JmE0jlo0OjAZ2Z-o1wJO7xBPu1XZB-PneT5SjiTB6hIyjdNOcg_Lp4EvrUHl_aaadsEOC83PAD1mkh_HTafI5xEX0rHycdRbl2o0cK1rqQEgjzI/s400/%E5%91%BD%E5%90%8D-%E7%94%B5%E6%B1%A0-%E5%9E%8B%E5%8F%B7.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;1号碱性电池&lt;br /&gt;结构与特点&lt;br /&gt;1.圆柱型锌锰电池 圆柱型锌锰电池就隔离物的不同可分为糊式电池和纸板电池。糊式电池即普通型锌锰电池，纸板电池因其配方组成的差异引起电性能的不同，又分为C型（或称铵型）纸板电池（又称高容量电池）和P型（或称锌型）纸板电池（又称高功率电池）。 糊式电池即传统的锌锰干电池，其正极材料采用活性较低的天然二氧化锰，隔离物是淀粉和面粉的浆糊隔离层，电解液是以H4CL为主的氯化铵、氯化锌水溶液，负极是锌筒，其放电性能一般较差，容量较低，电池使用末期易漏液，但价格便宜，多适用于小电流和间歇放电的场合，如用于收音机、手电筒等。 C型纸板电池是在糊式电池的基础上用浆层纸代替了浆糊纸，不但正极填充量提高30%左右，而且用30-70%的高活性锰代替了天然锰，所以容量得以提高，使用范围得以扩大，多用于小电流放电场合，如用于钟表、遥控器、收音机、手电筒等场合。 P型纸板电池采用氯化锌为主的电解液，正极材料全部采用高活性的锰粉，如电解锰、活性锰等，其防漏性能远高于糊式和C型电池，多用于大电流连续放电场合，如用于照相机、闪光订、收录机、剃须刀、电动玩具等。&lt;br /&gt;2.圆柱型碱性锌锰干电池 圆柱型碱性锌锰电池，又称碱锰电池，俗称碱性电池，是锌锰电池系列中性能最优的品种。其外壳一般由08F镀镍钢带经冷轧冲压制成，同时兼作正极集流体，电解二氧化锰正极材料压成圆环紧贴在柱体内壁，以保证良好的接触，其负极采用粉状锌粒并制成膏剂，处于电池的中间，其间插入负极集流体（负极一般为铜钉），集流体与负极底部相连，在电池内部，正极间用隔膜（隔离层）隔开，其外部用尼龙或聚丙烯密封圈隔开，同时实现电池的密封，电池外部与一般电池几乎相同。 虽然圆柱型碱性锌锰电池的公称电压与普通电池的相同，均为1.5伏，但由于碱性电池在结构上采用于普通电池相反的电极结构，增大了正负极间的相对面积，而且用高导电性的氢氧化钾溶液替代了氯化铵、氯化锌溶液，负极锌也由片状改变成粒状，增大了负极的反应面积，加之采用了高性能的电解锰粉，所以电性能得以很大提高，一般的，同等型号的碱锰电池是普通电池的容量和放电时间的3-7倍，低温性能两者差距更大，碱锰电池更适用于大电流连续放电和要求高的工作电压的用电场合，特别适用于照相机、闪光订、剃须刀、导电玩具、CD机、大功率遥控器等。&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/1743331140376400266/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/1743331140376400266' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/1743331140376400266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/1743331140376400266'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2009/04/blog-post_20.html' title='锌锰电池型号命名与标识-结构与特点'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaj4iCci4By-RUDdu_MtPnebANMHlS-JmE0jlo0OjAZ2Z-o1wJO7xBPu1XZB-PneT5SjiTB6hIyjdNOcg_Lp4EvrUHl_aaadsEOC83PAD1mkh_HTafI5xEX0rHycdRbl2o0cK1rqQEgjzI/s72-c/%E5%91%BD%E5%90%8D-%E7%94%B5%E6%B1%A0-%E5%9E%8B%E5%8F%B7.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-358064000417199402</id><published>2009-04-13T19:09:00.000-07:00</published><updated>2009-04-13T19:15:53.146-07:00</updated><title type='text'>蓄电池 型号字母 国标</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrML-bOFzZm-jfiTrF28yUvs365ZLCJas74fhvTD7BM_auWPFmYpGbJRfs9RC0Dyz5U_pj5lvLLZ88wgyy07mV6nUW1NC13rnLey_FXq25irb09QuiTeTQlBe_BNxktqF0mdTMSpJI2Ial/s1600-h/èçµæ± åå·å½æ .JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5324364878695263938&quot; style=&quot;FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 400px; CURSOR: hand; HEIGHT: 195px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrML-bOFzZm-jfiTrF28yUvs365ZLCJas74fhvTD7BM_auWPFmYpGbJRfs9RC0Dyz5U_pj5lvLLZ88wgyy07mV6nUW1NC13rnLey_FXq25irb09QuiTeTQlBe_BNxktqF0mdTMSpJI2Ial/s400/%E8%93%84%E7%94%B5%E6%B1%A0%E5%9E%8B%E5%8F%B7%E5%9B%BD%E6%A0%87.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;产品型号含义：&lt;br /&gt;根据JB2599-85部颁标准，我国铅酸电池型号分为三段，其安排和含义如下：&lt;br /&gt;串联的单体电池数—电池的类型和特征—额定容量&lt;br /&gt;当电池数为1时，称为单体电池，第一段可以省略。&lt;br /&gt;电池的类型是根据主要用途划分，代号用汉语拼音第一个字母，如下&lt;/div&gt;&lt;div&gt;例：6QA-120&lt;br /&gt;表示有6个单体电池（12伏），启动用电池，装有干荷电极板，20小时率额定容量为120安时。&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/358064000417199402/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/358064000417199402' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/358064000417199402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/358064000417199402'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2009/04/blog-post_13.html' title='蓄电池 型号字母 国标'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrML-bOFzZm-jfiTrF28yUvs365ZLCJas74fhvTD7BM_auWPFmYpGbJRfs9RC0Dyz5U_pj5lvLLZ88wgyy07mV6nUW1NC13rnLey_FXq25irb09QuiTeTQlBe_BNxktqF0mdTMSpJI2Ial/s72-c/%E8%93%84%E7%94%B5%E6%B1%A0%E5%9E%8B%E5%8F%B7%E5%9B%BD%E6%A0%87.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-2274141054517279880</id><published>2009-04-12T21:52:00.000-07:00</published><updated>2009-04-12T21:53:23.695-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="电池 型号 国际标准"/><title type='text'>电池型号国际标准</title><content type='html'>国际标准型号 中国型号 日常适用范围&lt;br /&gt;标准 俗称&lt;br /&gt;R03 R03 7号锌锰干电池 电子钟、手电筒、遥控器&lt;br /&gt;R6 R6 5号锌锰干电池 电子钟、手电筒，R6P也可用于遥控器&lt;br /&gt;R14 R14 2号锌锰干电池 手电筒、收音机&lt;br /&gt;R20 R20 1号锌锰干电池 手电筒、收音机&lt;br /&gt;LR03 LR03 7号碱性锌锰干电池 电动玩具、随身听、录音机、电动剃须刀、遥控器、BP机&lt;br /&gt;LR6 LR6 5号碱性锌锰干电池 电动玩具、随身听、录音机、电动剃须刀、遥控器、BP机。（市场上新近推出的数码王碱性电池可适用于数码相机）&lt;br /&gt;LR14 LR14 2号碱性锌锰干电池 电动玩具、电动剃须刀、燃气热水器&lt;br /&gt;LR20 LR20 1号碱性锌锰干电池 电动玩具、电动剃须刀、燃气热水器&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;注: 1、R表示圆柱型电池,L表示电池中电解质是碱性液体。&lt;br /&gt;&lt;br /&gt;2、R6、R14、R20三种型号后加上S、C、P后均有三种类型。如R6有R6S、R6C、R6P三种。S表示为糊式电池、C表示为高容量纸板电池、P表示为高功率纸板电池。&lt;br /&gt;&lt;br /&gt;3、S型糊式电池容量低，在电池使用末期，极易漏液，但价格便宜。&lt;br /&gt;&lt;br /&gt;4、C型（高容量）电池适用于小电流放电方式。&lt;br /&gt;&lt;br /&gt;5、P型（高功率）电池放电容量较前两种均有较大的提高，该类电池耐漏液性能好，且适合大电流连续放电。&lt;br /&gt;&lt;br /&gt;6、碱性电池的容量是前面提到的同尺寸电池的3～7倍，且可以大电流连续放电，具有耐漏液性能极好的特点</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/2274141054517279880/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/2274141054517279880' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/2274141054517279880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/2274141054517279880'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2009/04/blog-post.html' title='电池型号国际标准'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4244220722295936823.post-5258214590180272359</id><published>2009-03-24T20:00:00.000-07:00</published><updated>2009-03-24T20:01:12.292-07:00</updated><title type='text'>弃硅片取薄膜：机构光伏电池新思维</title><content type='html'>“在全球金融危机的背景下，几乎所有的传统行业都处于下行周期，最好的也就是见底回升，乏善可陈。”记者与一位参会的公募基金经理交流。该基金经理管理的基金在百亿以上，一般投资品种为蓝筹股。而眼下的新能源的研讨会也吸引了他的目光。&lt;br /&gt;    新能源近几年广受关注的大背景是传统能源的紧张与全球气候的恶化。在风能、太阳能、核能领域，各种机构竞相追逐，梦想超额收益，国金证券徐炜称之为“追逐低碳经济的浪潮”。&lt;br /&gt;    就在会议当日，新能源板块个股普遍活跃，风帆股份尾盘直冲而上，收盘接近涨停。3月23日(周一)，薄膜太阳能电池类上市公司风帆股份(600482.SH)再次保持强势，收盘涨幅9.99%，同时表现抢眼的还有天威保变(600550.SH)及南玻A(000012.SZ)，二者周一分别上升5.29%及7.74%。&lt;br /&gt;    薄膜电池类上市公司受追捧&lt;br /&gt;    太阳能电池分为晶硅片太阳能电池和薄膜太阳能电池两大类。“之所以叫薄膜电池，是因为上下两层都是几毫米厚的玻璃，而中间的涂层也很薄。” 国金证券光伏行业研究员张帅告诉记者。&lt;br /&gt;    两者相比薄膜太阳能电池在成本方面具有极大的优势。&lt;br /&gt;    “多晶硅的价格较以前已经有大幅下降，企业的利润率已经被大大压缩。”张帅表示，“薄膜是一种相对较新的技术，发展比多晶硅晚，但具有很大的成本优势。一般来说，以每发一度电来衡量，使用多晶硅电池比薄膜电池的成本要高好几倍。”&lt;br /&gt;    近两年，全国各地上马多晶硅项目的企业多如牛毛，“如今做得较好的，毛利润能够在20%-30%之间，大不如前。”张帅告诉记者。&lt;br /&gt;    与企业盈利前景相对应，涉及多晶硅的上市公司股价表现平平，川投能源(600674.SH)等上市公司股价波澜不兴。&lt;br /&gt;    而具有薄膜电池项目建设的上市公司则表现抢眼，除风帆股份外，孚日股份(002083.SZ)、天威保变表现抢眼，而为薄膜电池提供超白玻璃的金晶科技(600586.SH)、南玻A两公司，也受到市场追捧。&lt;br /&gt;    First Solar作为薄膜电池标志性厂商，是美国市场上享受最高估值水平的光伏股，即便在金融危机横行的2008年8月，股价仍对应 2008年盈利 87 倍、2009年盈利45倍的市盈率。其薄膜电池产品供不应求，订单已排至2010年后，市值换算成人民币超过千亿元，成为投资者热烈追逐的对象。&lt;br /&gt;    据了解，相比晶体硅电池，薄膜电池并不依赖多晶硅原料，因此发电成本要便宜很多。多晶硅电池的电价一度达到传统火电的10倍，但薄膜电池的价格可以媲美传统火电价格，因此薄膜电池被认为是晶体硅电池的替代产品，发展前景看好。包括无锡尚德、江西赛维和国内的多家上市公司，都已进入该领域，尚德更是把薄膜电池基地建在了上海，而联想投资、IFC也有薄膜电池项目的投资。&lt;br /&gt;    “用薄膜电池发电的成本在1元每千瓦左右。”张帅告诉记者。而薄膜的兴起要晚于多晶硅，可以预见，随着技术的进一步成熟，这个价格仍有很大下降空间。&lt;br /&gt;    与多晶硅电池板，薄膜电池的不足之初在于，单位面积内多晶硅的电转换率较高，现在在15%左右，而薄膜目前的技术仅仅只能够做到6%。也就是说，相同面积的电池板，铺设同样的面积，薄膜电池的功率仅有多晶硅电池板的40%。&lt;br /&gt;    “这并不是问题，如果要建一个沙漠电厂，那么空间就不成为重要因素，如果建设在空间资源相对有限的城市，那么采用多晶硅更好一点。”张帅表示。&lt;br /&gt;    而从技术角度上来说，电转换率可以通过技术进步实现提高，薄膜提升的空间为100%，即达到12%左右，多晶硅也有20-30%的提升空间，达到18%。两者电转换率之间的差距有望缩小。&lt;br /&gt;    业内专家认为，薄膜电池的电转换率一旦能够达到9%，其建设成本的优势将会充分发挥，这个产业将十分有投资价值。&lt;br /&gt;    寻找中国的First Solar&lt;br /&gt;    据兴业证券王雪峰调研，目前薄膜电池行业处于发展初期，但未来市场空间巨大，在BIPV(建筑与光伏器件一体化)等应用需求推动下将迅猛发展，2015年产值有望达到1000亿欧元，成本快速下降，有望先于多晶硅电池实现平价上网。&lt;br /&gt;    “这是一个新兴的产业，在很多环节都有很大的不确定性，比如，在10年之前，你绝不会想到目前的手机会是什么样子。”张帅表示。&lt;br /&gt;    “相对于新能源汽车来讲，光伏更容易看清楚。”一位公募基金经理则认为。&lt;br /&gt;    在薄膜电池中，也存在三种技术路径：非晶硅(也叫硅薄膜)、碲化铬、铜铟硒。&lt;br /&gt;    而三种技术路径各有优缺点，非晶硅存在转换效率低、衰减严重的问题；碲化铬的污染问题较为严重；铜铟硒存在污染、优良率较低、铟资源有限等问题。&lt;br /&gt;    “上述三种技术目前都有人在做，说明从目前看，这三个技术都是可行的。但发展下去谁更有优势，那是很不确定的事情。”张帅说。&lt;br /&gt;    三种技术并行发展，但最终或许只有某一种技术更有成本优势，其发展空间更大，这样会导致使用其他技术的企业处于被动地位并最终丧失市场。在新技术领域，这是很大的风险。兴业证券认为，非晶硅技术路线有望超越其他种类的薄膜电池。而有的券商则有不同看法。&lt;br /&gt;    工艺能否有保障是另外一个重要风险点。&lt;br /&gt;    张帅在研讨会现场发言时表示，薄膜领域更接近半导体行业，技术更新速度快，一旦落后竞争对手，将会给自己造成不利。兴业证券王雪峰认为，企业能否保持强大研发能力至关重要，拥有稳定的核心技术团队是决胜未来的关键。&lt;br /&gt;    薄膜电池项目的另外一个特点是，初始投资比多晶硅高几倍，非资金实力雄厚者难以撬动。而一旦项目失败，损失也会非常大。&lt;br /&gt;    但国内上马薄膜电池的企业情况是，我们的设备采购自国外，自身的研发力量都相对有限。&lt;br /&gt;    “希望不要再重复多晶硅争相上马、重复建设、恶性竞争的格局，那样对谁都不利。”一位基金经理担心，“在较高的利润率面前，冲动的投资将导致整个行业的无序。”&lt;br /&gt;    但由于有美国First Solar的神话存在，A股投资者正急于寻找谁是中国的First Solar。&lt;br /&gt;    目前，国内有多家 A 股上市公司投资薄膜电池行业，包括天威保变、孚日股份、风帆股份等。不过，国内上马的薄膜项目都尚未实现量产，最早的天威保变也要到2009年6月才能实现，产能约为45.6MW。孚日股份持股50%的孚日光伏在2009年底会有60MW的产能实现投产。风帆股份也计划在2009年实现投产</content><link rel='replies' type='application/atom+xml' href='http://markbluesky.blogspot.com/feeds/5258214590180272359/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4244220722295936823/5258214590180272359' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5258214590180272359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4244220722295936823/posts/default/5258214590180272359'/><link rel='alternate' type='text/html' href='http://markbluesky.blogspot.com/2009/03/blog-post.html' title='弃硅片取薄膜：机构光伏电池新思维'/><author><name>MX</name><uri>http://www.blogger.com/profile/12244809812335945034</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>