tag:blogger.com,1999:blog-84830735538707128662024-03-28T08:01:18.762-07:00BinhMinh - Computer ProgrammingUnknownnoreply@blogger.comBlogger11125tag:blogger.com,1999:blog-8483073553870712866.post-78053145720820584412013-09-15T03:27:00.001-07:002013-09-15T03:33:49.473-07:00I'm Coming Back! Yay me!Hey hey hey!<br />
Long time no see, my dear blog!<br />
Well, I definitely had a hard time working. But now, I'm backkkkk.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.mtholyoke.edu/~blerner/images/wordle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="191" src="http://www.mtholyoke.edu/~blerner/images/wordle.png" width="320" /></a></div>
<br />
<br />
Here is my story. 2 days ago, I had a weird conversation with a bro.<br />
- (him) Congratulation, Minh!<br />
- (me) (Say what?! I have no idea why he congratulates to me) ????<br />
- (him) Have a look at this, girl:<br />
<blockquote class="tr_bq">
<i><a href="http://en.m.wikipedia.org/wiki/Programmer%27s_day">http://en.m.wikipedia.org/wiki/Programmer%27s_day</a></i></blockquote>
Wow, what can I say? Programmer day? An interesting one.<br />
Thanks to my bro, I've known that there is a day for people like me, like u, like us.<br />
<br />
With more than 4 years learning computer science, 3 years researching in a lab, I can see that people around me - programmers, computer scientists - are very smart, nice and they all build wonderful things. (Well... I dont say this just because my major is computer science :-D It's a true story)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.brightschool.com/images/photos/Wagner/stock-illustration-11386084-children-birthday-party-cartoon.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="253" src="http://www.brightschool.com/images/photos/Wagner/stock-illustration-11386084-children-birthday-party-cartoon.jpg" width="320" /></a></div>
<br />
<br />
So it's great to have an official day to remind people of us. Unfortunately, the "Programmer day" is not yet popular. I hope that one day, when I come back to see this entry, I can smile reading this and enjoy a day for programmers - computer scientists with my dear colleagues.<br />
<br />
See ya in the next entry!<br />
The next one is for Google fans, guys!<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-8483073553870712866.post-23889692037007906172012-01-06T01:04:00.000-08:002013-09-15T04:06:20.812-07:00[Android] Digital Certificate For Android ApplicationsHi guys,<br />
It's been a while since my last entry cause I'm on my way fighting exams at school :((<br />
<br />
Well ... This entry is about Android. But it's not about source code or coding an app (application). Actually it's besides Android apps ^^ One of my friends made an application, and now he wants to distribute this app to Android public - community.<br />
<br />
He asked me how to "sign" on his app. Hope this entry help him and - of course - anyone.<br />
----------------------------------------------------------------------------------------------------------------------------------------------- <br />
<br />
There are ways of making a digital certificate for your apps<br />
<br />
<ul>
<li><b>Using cmd (Keytool & Jarsigner) </b>(this entry is just about this way)</li>
<li><b>Through Eclipse</b></li>
<li><b>Using some softwares (eg.: Key Store Explorer)</b></li>
<li><b>......</b></li>
</ul>
<ol>
<li><i><b>Keytool & Jarsigner</b></i></li>
</ol>
<blockquote class="tr_bq">
<i>Keytool</i> helps us manage public/private key pairs and associated certificates</blockquote>
<blockquote class="tr_bq">
<i>Jarsigner </i>generates signatures for Java Archive (JAR) files, and verifies the signatures of signed JAR files.</blockquote>
<br />
<blockquote class="tr_bq">
<span style="font-family: Verdana, sans-serif; font-size: x-small;"><i>The info below is the summary I've got after browsing page: <a href="http://developer.android.com/guide/publishing/app-signing.html">http://developer.android.com/guide/publishing/app-signing.html</a>. You can browse this page for further information </i></span></blockquote>
<blockquote class="tr_bq">
<span style="background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;">Before you begin, make sure that the Keytool utility and Jarsigner utility are available to the SDK build tools. Both of these tools are available in the JDK. </span><span style="background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;">To generate a self-signed key with Keytool, use the </span><code style="background-color: white; color: #007000; font-size: 13px; line-height: 1em;">keytool</code><span style="background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 16px;"> command and pass any of the options listed below.</span></blockquote>
<table style="background-color: white; border-bottom-width: 0px; border-collapse: collapse; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; empty-cells: show; font-family: arial, sans-serif; font-size: 13px; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><tbody style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><th style="background-color: #dee8f1; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">Keytool Option</th><th style="background-color: #dee8f1; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">Description</th></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-genkey</code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">Generate a key pair (public and private keys)</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-v</code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">Enable verbose output.</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-alias <alias_name></alias_name></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">An alias for the key. Only the first 8 characters of the alias are used.</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-keyalg <alg></alg></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">The encryption algorithm to use when generating the key. Both DSA and RSA are supported.</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-keysize <size></size></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">The size of each generated key (bits). If not supplied, Keytool uses a default key size of 1024 bits. In general, we recommend using a key size of 2048 bits or higher.</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-dname <name></name></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
A Distinguished Name that describes who created the key. The value is used as the issuer and subject fields in the self-signed certificate.</div>
<div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Note that you do not need to specify this option in the command line. If not supplied, Jarsigner prompts you to enter each of the Distinguished Name fields (CN, OU, and so on).</div>
</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-keypass <password></password></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
The password for the key.</div>
<div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
As a security precaution, do not include this option in your command line. If not supplied, Keytool prompts you to enter the password. In this way, your password is not stored in your shell history.</div>
</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-validity <valdays></valdays></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
The validity period for the key, in days.</div>
<div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<strong>Note:</strong> A value of 10000 or greater is recommended.</div>
</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-keystore <keystore-name>.keystore</keystore-name></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">A name for the keystore containing the private key.</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-storepass <password></password></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
A password for the keystore.</div>
<div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
As a security precaution, do not include this option in your command line. If not supplied, Keytool prompts you to enter the password. In this way, your password is not stored in your shell history.</div>
</td></tr>
</tbody></table>
<blockquote class="tr_bq">
<span style="background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em;">Here's an example of a Keytool command that generates a private key:</span></blockquote>
<pre class="prettyprint" style="background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; font-size: 13px; margin-bottom: 1em; margin-left: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"><span class="pln" style="color: black;">$ keytool </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">genkey </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">v </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keystore </span><span class="kwd" style="color: #000088;">my</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">release</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">key</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">keystore</span><span class="pun" style="color: #666600;">-</span><span class="kwd" style="color: #000088;">alias</span><span class="pln" style="color: black;"> alias_name </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keyalg RSA </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keysize </span><span class="lit" style="color: #006666;">2048</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">validity </span><span class="lit" style="color: #006666;">10000</span></pre>
----------------------------------------------------------------------------------------------------------------------------------------------<br />
<blockquote class="tr_bq">
<span style="background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em;">When you have an application package that is ready to be signed, you can do sign it using the Jarsigner tool. M</span><span style="background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em;">ake sure that the keystore containing your private key is available.</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Times, 'Times New Roman', serif;">To sign your application, you run Jarsigner, referencing both the application's .apk and the keystore containing the private key with which to sign the .apk. The table below shows the options you could use.</span></blockquote>
<table style="background-color: white; border-bottom-width: 0px; border-collapse: collapse; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; empty-cells: show; font-family: arial, sans-serif; font-size: 13px; margin-bottom: 1em; margin-left: 1em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><tbody style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><th style="background-color: #dee8f1; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">Jarsigner Option</th><th style="background-color: #dee8f1; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">Description</th></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-keystore <keystore-name>.keystore</keystore-name></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">The name of the keystore containing your private key.</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-verbose</code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;">Enable verbose output.</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-storepass <password></password></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
The password for the keystore.</div>
<div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
As a security precaution, do not include this option in your command line unless you are working at a secure computer. If not supplied, Jarsigner prompts you to enter the password. In this way, your password is not stored in your shell history.</div>
</td></tr>
<tr style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><code style="color: #007000; line-height: 1em;">-keypass <password></password></code></td><td style="background-color: inherit; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-style: initial; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 6px; padding-left: 12px; padding-right: 12px; padding-top: 6px; text-align: left; vertical-align: top;"><div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
The password for the private key.</div>
<div style="border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.3em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
As a security precaution, do not include this option in your command line unless you are working at a secure computer. If not supplied, Jarsigner prompts you to enter the password. In this way, your password is not stored in your shell history.</div>
</td></tr>
</tbody></table>
<div style="background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">
Here's how you would use Jarsigner to sign an application package called <code style="color: #007000; line-height: 1em;">my_application.apk</code>, using the example keystore created above.</div>
<pre class="prettyprint" style="background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; border-image: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; color: #007000; font-size: 13px; margin-bottom: 1em; margin-left: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;"><span class="pln" style="color: black;">$ jarsigner </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">verbose </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keystore </span><span class="kwd" style="color: #000088;">my</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">release</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">key</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">keystore
my_application</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">apk alias_name</span></pre>
<blockquote class="tr_bq">
<span style="background-color: white; color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: 1.3em;">Running the example command above, Jarsigner prompts you to provide passwords for the keystore and key. It then modifies the .apk in-place, meaning the .apk is now signed. Note that you can sign an .apk multiple times with different keys.</span> </blockquote>
<blockquote class="tr_bq">
</blockquote>
<i> </i>2<i>. <b>Through Eclipse</b></i><br />
<blockquote class="tr_bq">
Go to this link for more information: <a href="http://developer.android.com/guide/publishing/app-signing.html#setup">http://developer.android.com/guide/publishing/app-signing.html#setup</a></blockquote>
<br />
3. <i><b>Using Key Store Explorer</b></i><br />
<i> </i>Go to this link for more information:<i> </i><a href="http://www.lazgosoftware.com/kse/index.html">http://www.lazgosoftware.com/kse/index.html</a><br />
<br />
<br />
-----------------------------------------------------------------------------------------------------------------------------------------------<br />
<span style="font-family: Verdana, sans-serif;">Hope you guys find this entry useful ! Have fun, guys !</span><br />
<blockquote class="tr_bq">
</blockquote>
Unknownnoreply@blogger.com12tag:blogger.com,1999:blog-8483073553870712866.post-6849349741952402232011-12-04T08:16:00.000-08:002011-12-04T08:16:33.504-08:00[Google] Have some fun in searching information !Well, the first website that I've browsed in the very very first time I surfed the Internet is GOOGLE.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgobu8KD4TMG3nwoznqNriF912-8Ymy8zvBD99oP7VJHwDizK3RWR6NPgMF3IrYae29m0UuABYWfxG_dhBCXhj_u0qsA55KyUiBD0_w6EiSfmMzNoKg2JxNeBJaESNSuThwc3Kss1DSR1M/s1600/8.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="189" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgobu8KD4TMG3nwoznqNriF912-8Ymy8zvBD99oP7VJHwDizK3RWR6NPgMF3IrYae29m0UuABYWfxG_dhBCXhj_u0qsA55KyUiBD0_w6EiSfmMzNoKg2JxNeBJaESNSuThwc3Kss1DSR1M/s320/8.PNG" width="320" /></a></div><br />
<br />
We all know Google is a "big name" ! The truth is - in the past - I'm not a huge fan of Google, cause I thought Google was just a machine for searching information. But now, I must say that Google's got my heart. Those guys in Google know how to satisfy customers. They bring to us more services, more stuffs which are really "friendly" to users (I mean user can use these stuffs easily) :))<br />
<br />
But I'm not gonna give you an entry talking about the way Google's developed (You guys can use google to search this info ( lol ))<br />
<br />
I just want to share some fun when I use google. Just click the link below and have fun in some seconds :)<br />
<br />
<br />
<ul><li>Gravity: <a href="http://mrdoob.com/projects/chromeexperiments/google_gravity/">http://mrdoob.com/projects/chromeexperiments/google_gravity/</a></li>
<li>Go to Google search, type: "do a barrel roll" ....enter and wait :))</li>
<li>Searching "recursion" and you will find out that google will ask you for more about recursion recursively </li>
<li>Searching "ascii art" and see the logo of Google in ascii art</li>
<li>You can have a flight in your own plane around the world, with Flight Simulator in Google Earth ! Trust me, this is really fun.</li>
<li>More stuffs....</li>
</ul>These are some fun I've got. Nice weekend, everyone !Unknownnoreply@blogger.com16tag:blogger.com,1999:blog-8483073553870712866.post-50356699807515412232011-12-03T00:57:00.000-08:002011-12-03T08:54:15.645-08:00[Python] Pythonic, Pythoneer, Pythonist, Pythonista ?!<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyU6IoJR45V-BHSSLVxlKQgtU_ozW2vOPXwZ80cFnFAOk2aC1mnr-TUSUOTeyXSmwnVe4QgLhF-vscSIerIWyvBF4d8FJHUtlnW_DdB-S9b03OxdaTpujSJVC_NSxFBFuO57ME3pKEvAI/s1600/python-logo-master-v3-trans.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="108" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyU6IoJR45V-BHSSLVxlKQgtU_ozW2vOPXwZ80cFnFAOk2aC1mnr-TUSUOTeyXSmwnVe4QgLhF-vscSIerIWyvBF4d8FJHUtlnW_DdB-S9b03OxdaTpujSJVC_NSxFBFuO57ME3pKEvAI/s320/python-logo-master-v3-trans.png" width="320" /></a></div><br />
First of all,<br />
<br />
If you have coded in Python, you must know these terms: PYTHONIC, PYTHONIST, PYTHONEER and PYTHONISTA... So what is the meaning of those terms ?!<br />
Pythonic simply means <span class="Apple-style-span" style="background-color: white;">something like "idiomatic Python".</span><br />
Pythoneer and Pythonista - of course - are people who love Python. For me, Pythonista are programmers who are real loyal fans of Python-the-language. Pythoneer - in my view - are the ones that always think and create new things using Python, they seems to be the ones who are likely the leaders talking about Python programming and stuffs... Well, that's just my own opinion.<br />
<br />
But that's not the main content of this blog entry. If this is the first time you've coded in Python and you want to learn more about this language, I think you should read those 2 articles below. Those articles are about the style of coding of PYTHONISTAs and the meaning of PYTHONIC. When I first learnt Python, I was so glad that I had read those articles:<br />
<br />
Know more about the meaning of Pythonic:<br />
<a href="http://faassen.n--tree.net/blog/view/weblog/2005/08/06/0">http://faassen.n--tree.net/blog/view/weblog/2005/08/06/0</a><br />
<br />
English version for "Code like a Pythonista: Idiomatic Python": <a href="http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html">http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html</a><br />
<br />
(For my dear Vietnamese friends, there is a VNese version too)<br />
<a href="http://www.vithon.org/2007/07/28/l%E1%BA%ADp-trinh-nh%C6%B0-m%E1%BB%99t-pythonista:-thanh-ng%E1%BB%AF-python">http://www.vithon.org/2007/07/28/l%E1%BA%ADp-trinh-nh%C6%B0-m%E1%BB%99t-pythonista:-thanh-ng%E1%BB%AF-python</a><br />
<br />
Give thanks to those articles' author/blogger. I love those articles !<br />
Enjoy your time reading, everyone !Unknownnoreply@blogger.com21tag:blogger.com,1999:blog-8483073553870712866.post-69854099350084978112011-12-02T00:46:00.000-08:002013-09-15T03:32:46.681-07:00[Coding] How to code ?!For me, source codes are just something really small. I usually share all my codes. Therefore, I like open-source. People can use codes and if there are bugs, they contact the programmer who codes.<br />
As a result, in my view, source code is just a means of studying programming.<br />
<br />
This blog entry is not about coding any specific language or source code. This one, I'll share some tips to have a "clean" code.<br />
<br />
<br />
<ul>
<li>The first one is about the header of your code. Try to add a header for your file. That header will give other people about your information:</li>
</ul>
<br />
Example:<br />
<blockquote class="tr_bq">
/* author: BinhMinh</blockquote>
<blockquote class="tr_bq">
* DateModified:</blockquote>
<blockquote class="tr_bq">
* Content:</blockquote>
<blockquote class="tr_bq">
* License (optional) :</blockquote>
<blockquote class="tr_bq">
* Reference:</blockquote>
<blockquote class="tr_bq">
* Language:</blockquote>
<blockquote class="tr_bq">
*/</blockquote>
<br />
<ul>
<li>Second rule: Always remember "TAB" in coding. A code with tab in newline is always prefered.</li>
</ul>
<br />
Ex1: int func1 (int param1, int param2) {<br />
return 0;<br />
}<br />
Ex2: int fun1 (int param1, int param2) {<br />
return 0;<br />
}<br />
I prefer the Ex1 code.<br />
<br />
<br />
<ul>
<li>Third rule: Try making the name of variable easy to understand. Some people will code with variable like: _1, _2, a, b, c... Of course you will have difficulty in understand your own code later, cause you don't even know those variables do what ?! So make sure you have variables like: count, testingId,...</li>
<li>Fourth: Try commenting as possible as you can. Those comments will be really useful for reusing codes.</li>
<li>Fifth: Add documents for your function. If you have seen my Python blog entries, you will see that I always add document for all my functions. Or you can see example in the entry [Java] Math Parser. Not all programmers do this one. But it will help you a lot when you do big projects.</li>
<li>Sixth: For Java, C,.. use blockscope in conditional expressions no matter what.</li>
</ul>
Ex: if (A) {<br />
B<br />
}<br />
else {<br />
C<br />
}<br />
<br />
<ul>
<li>Seventh: Try to seperate your codes into independent objects. You can use these objects for other projects.</li>
<li>Last one: If tired of coding, relax about 15 minutes and then back. Maybe in relaxing time, you will have more ideas for your code.</li>
</ul>
<div>
I just try to have a blog entry about ways of coding cause I've seen so many of my friends' code not clean, not reusable or not just understandable. </div>
<div>
Have fun in reading everyone !</div>
<br />
<br />
<blockquote class="tr_bq">
</blockquote>
<blockquote class="tr_bq">
</blockquote>
<blockquote class="tr_bq">
</blockquote>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-8483073553870712866.post-10948835447986412362011-12-02T00:07:00.000-08:002011-12-02T05:56:42.339-08:00[Algorithm] Prim !I have recieved emails about bugs of my codes in other blog about Python<br />
This page actually is just the page that I save all my codes. If anyone interesting, you can use codes here.<br />
For tutorials, just browse my other blog. This one is about Prim algorithm:<br />
<br />
<br />
#include <iostream><br />
#include <queue><br />
#include <vector><br />
#define MAXN 100005 // num of vertexs<br />
#define INFTY 1000000000<br />
<br />
using namespace std;<br />
// minimum spanning tree<br />
<br />
vector< pair<int,int> > adj[MAXN];//if having many testcases, you should declara adj in procedure main()<br />
priority_queue< pair<int,int> > pq;<br />
int key[MAXN];<br />
int parent[MAXN];<br />
int vis[MAXN];<br />
<br />
int main () {<br />
int N, M, sumTree=0; // N is num of vertexs, M is num of edges<br />
// vertex is indexed from 0 to N-1<br />
cin >> N >> M ;<br />
for (int i = 0; i<M; i++) {<br />
int a, b, l;<br />
cin >> a >> b >> l;<br />
adj[a].push_back (make_pair (b,l));<br />
adj[b].push_back (make_pair (a,l));<br />
}<br />
<br />
for (int i = 0; i<N; i++) {<br />
key[i] = INFTY;<br />
vis[i] = 0;<br />
}<br />
<br />
key[0] = 0;<br />
parent[0] = -1;<br />
pq.push (make_pair (-0,0)); // minus sign to convert largest num to smallest num<br />
while (!pq.empty ()) {<br />
int v = pq.top ().second;<br />
pq.pop ();<br />
if (vis[v]) continue;<br />
sumTree += key[v];<br />
vis[v] = 1;<br />
for (int i = 0; i<adj[v].size (); i++) {<br />
if (adj[v][i].second < key[adj[v][i].first] && !vis[adj[v][i].first]) {<br />
key[adj[v][i].first] = adj[v][i].second;<br />
parent[adj[v][i].first] = v;<br />
pq.push (make_pair (-key[adj[v][i].first], adj[v][i].first));<br />
}<br />
}<br />
}<br />
//print<br />
cout << sumTree << endl;<br />
return 0;<br />
}<br />
<div><br />
</div>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-8483073553870712866.post-62205840418007976842011-12-01T23:45:00.000-08:002011-12-02T05:57:15.820-08:00[Geometry] Simple code for geometryYou guys can use all this codes in this blog. If you have questions, just comment or send emails to nnbminh@gmail.com (I suggest sending emails).I will help you with my best.<br />
<br />
Coding - somehow - makes things simple. I'm doing a project which is the same with Paint in Windows OS. The first step, I must realize the type of geometry. This codes below will do that:<br />
I code in C++<br />
<br />
// author: BinhMinh<br />
<br />
<br />
#include <iostream><br />
#include <math.h><br />
#define e 1e-6<br />
using namespace std;<br />
<br />
struct Point{<br />
double x;<br />
double y;<br />
};<br />
<br />
struct Vector{<br />
double x;<br />
double y;<br />
};<br />
<br />
struct Line{<br />
double a;<br />
double b;<br />
double c;<br />
};<br />
<br />
double abs(double x){<br />
if(x<0) return -x;<br />
return x;<br />
}<br />
<br />
//Area of triangle ABC, Newton<br />
double Area(Point A, Point B, Point C){<br />
double t1 = A.x*B.y + B.x*C.y + C.x*A.y;<br />
double t2 = A.y*B.x + B.y*C.x + C.y*A.x;<br />
if(t1>t2) return (t1-t2)/2.0;<br />
return (t2-t1)/2.0;<br />
}<br />
<br />
//Distance between 2 Points<br />
double Dist(Point A, Point B){<br />
return sqrt((A.x-B.x)*(A.x-B.x)+(A.y-B.y)*(A.y-B.y));<br />
}<br />
<br />
//Distance between Point X and line d(AB)<br />
double DistPointLine(Point C, Point A, Point B){<br />
double s = Area(C, A, B);<br />
double a = Dist(A, B);<br />
return 2.0*s/a;<br />
}<br />
<br />
//Make Vector AB<br />
void MakeVector(Point A, Point B, Vector &AB){<br />
AB.x = B.x-A.x;<br />
AB.y = B.y - A.y;<br />
}<br />
<br />
//dot vector a and vector b<br />
double Dot(Vector a, Vector b){<br />
return a.x*b.x + a.y*b.y;<br />
}<br />
<br />
//dot vector AB and vector CD<br />
double Dot(Point A, Point B, Point C, Point D){<br />
Vector AB, CD;<br />
MakeVector(A, B, AB);<br />
MakeVector(C, D, CD);<br />
return Dot(AB, CD);<br />
}<br />
<br />
//Minimum distance between Point C and segment AB<br />
double DistPointSegment(Point C, Point A, Point B){<br />
double m; <br />
if(Dot(A,B,A,C)<=0 || Dot(B,C,B,A)<=0){<br />
return min(Dist(A,C), Dist(B,C));<br />
}<br />
else return DistPointLine(C, A, B);<br />
}<br />
<br />
//Area of Polygon, N>=3<br />
double AreaOfPolygon(int N, Point P[]){<br />
double s = 0.0;<br />
for(int i = 2; i<N ; i++) s+=Area(P[0], P[i-1], P[i]);<br />
return s;<br />
}<br />
<br />
//Make Line a*x+b*y=c<br />
void MakeLine(Point A, Point B, Line &d){<br />
d.a = B.y - A.y;<br />
d.b = A.x - B.x;<br />
d.c = A.x*d.a + A.y*d.b;<br />
}<br />
<br />
//doubleersection of 2 lines<br />
int Intersection2Line(Line d1, Line d2, Point &P){<br />
double delta = d1.a*d2.b - d2.a*d1.b;<br />
if(abs(delta)<e) return 0; // No doubleersection<br />
P.x = (d1.c*d2.b - d2.c*d1.b)/delta;<br />
P.y = (d1.a*d2.c - d2.a*d1.c)/delta;<br />
return 1; <br />
}<br />
<br />
//doubleersection of 2 Segments AB and CD<br />
//AB = A + (B-A)t = A + ut<br />
//CD = C + (D-C)t' = C + vt'<br />
//t = (C-A).vT / u.vT<br />
int Intersection2Segment(Point A, Point B, Point C, Point D, Point &P){<br />
Vector u, v, vT, AC;<br />
MakeVector(A, B, u);<br />
MakeVector(C, D, v);<br />
MakeVector(A, C, AC);<br />
vT.x = -v.y;<br />
vT.y = v.x;<br />
if (abs(Dot(u, vT))<e) return 0;<br />
double t = Dot(AC, vT) / Dot(u, vT);<br />
if (t<0 || t>1) return 0;<br />
P.x = A.x + u.x*t;<br />
P.y = A.y + u.y*t;<br />
}<br />
<br />
//Circle from 3 Points<br />
void Bisector(Point A, Point B, Line &d){<br />
double x, y;<br />
x = (A.x + B.x)/2.0;<br />
y = (A.y + B.y)/2.0;<br />
d.a = B.x - A.x;<br />
d.b = B.y - A.y;<br />
d.c = d.a*x + d.b*y;<br />
}<br />
int Circle(Point A, Point B, Point C, Point &I, double R){<br />
Line d1, d2;<br />
Bisector(A, B, d1);<br />
Bisector(A, C, d2);<br />
if( Intersection2Line(d1, d2, I) == 0 ) return 0;<br />
R = Dist(I, A);<br />
return 1;<br />
}<br />
<div><br />
</div>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-8483073553870712866.post-81240060887374211562011-12-01T23:34:00.000-08:002011-12-01T23:34:55.721-08:00[Algorithm] Dijkstra !Today, one of my friends asks me about Dijkstra ! Computer Science students are familiar with this algorithm. But maybe, beginners will have difficulty in coding and using datastructure.<div><br />
</div><div>Below is my code. Hope it will help my friend and beginners. I use C++ in the code: </div><div><br />
</div><div><div>#include <iostream></div><div>#include <queue></div><div>#include <vector></div><div> </div><div>#define MAXN 50005 // num of vertexs</div><div>#define INFTY 1000000000</div><div><br />
</div><div>using namespace std;</div><div><br />
</div><div>// minimum distance from vertex u to the others</div><div><br />
</div><div>vector< pair<int,int> > adj[MAXN];//if having many testcases, you should declara adj in procedure main()</div><div>priority_queue< pair<int,int> > pq;</div><div>int dist[MAXN];</div><div>int vis[MAXN];</div><div>int parent[MAXN];</div><div><br />
</div><div>int main () {</div><div> int N, M, u; // N is num of vertexs, M is num of edges, u is first vertex, dist[u]=0; </div><div> // vertex is indexed from 0 to N-1</div><div> cin >> N >> M >> u;</div><div> for (int i = 0; i<M; i++) {</div><div> int a, b, l;</div><div> cin >> a >> b >> l;</div><div> adj[a].push_back (make_pair (b,l));</div><div> adj[b].push_back (make_pair (a,l));</div><div> }</div><div><br />
</div><div> for (int i = 0; i<N; i++) {</div><div> dist[i] = INFTY;</div><div> vis[i] = 0;</div><div> }</div><div> </div><div> dist[u] = 0;</div><div> parent[u] = -1;</div><div> pq.push (make_pair (-0,u)); // minus sign to convert largest num to smallest num</div><div> while (!pq.empty ()) {</div><div> int v = pq.top ().second;</div><div> pq.pop ();</div><div> if (vis[v]) continue;</div><div> vis[v] = 1;</div><div> for (int i = 0; i<adj[v].size (); i++) {</div><div> if (dist[v] + adj[v][i].second < dist[adj[v][i].first] && !vis[adj[v][i].first]) {</div><div> dist[adj[v][i].first] = dist[v] + adj[v][i].second;</div><div> parent[adj[v][i].first] = v;</div><div> pq.push (make_pair (-dist[adj[v][i].first],adj[v][i].first));</div><div> }</div><div> }</div><div> } </div><div> //print dist[]</div><div> for(int i=0 ; i<N ; i++) cout << dist[i] << endl; </div><div> return 0;</div><div>}</div></div><div><br />
</div>Unknownnoreply@blogger.com11tag:blogger.com,1999:blog-8483073553870712866.post-3139852314336702392011-12-01T22:45:00.000-08:002011-12-03T03:46:50.294-08:00[Python] Taking a tour ...I have one another blog writing about Python and stuffs, but I've deleted for some reasons.<br />
To have an overview of Python, let me give you a checklist about Python basic term in coding.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRw5D-dw8L2RyUmQgfrRL_YDU_8qH9nY6QGVyfOe6UViB4sTpB5za911OT6Yl7ODy3LNgMyqFTtvHCNHJmvX2dUuukZVOXgGsWZVqn2P1KgjkQnlPMA5dGCRw5jCJmVilcmiNBvsFVjcQ/s1600/python-logo-glassy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRw5D-dw8L2RyUmQgfrRL_YDU_8qH9nY6QGVyfOe6UViB4sTpB5za911OT6Yl7ODy3LNgMyqFTtvHCNHJmvX2dUuukZVOXgGsWZVqn2P1KgjkQnlPMA5dGCRw5jCJmVilcmiNBvsFVjcQ/s320/python-logo-glassy.png" width="251" /></a></div><br />
<div class="cms_table" style="background-color: white; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: hidden; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px;"><table class="cms_table" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: collapse; font-size: inherit; margin-bottom: 1em;"><tbody>
<tr class="cms_table_tr" valign="top"><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;"> 1</td><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">Introduction to Python and basis<br />
<ul style="margin-bottom: 1em; margin-left: 2em; margin-right: 1em; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Dynamic-typing, interpreted language</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Basic data type (built-in types)</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Conditional expression (if….else, while, do….while)</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Operator</li>
</ul></td></tr>
<tr class="cms_table_tr" valign="top"><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">2</td><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">Advance data type<br />
<ul style="margin-bottom: 1em; margin-left: 2em; margin-right: 1em; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">List, Dictionary, Tuple</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">File</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Comprehesions and Iterators</li>
</ul></td></tr>
<tr class="cms_table_tr" valign="top"><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">3</td><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">Function and module<br />
<ul style="margin-bottom: 1em; margin-left: 2em; margin-right: 1em; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Function</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Argument</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Module</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Advanced Function</li>
</ul></td></tr>
<tr class="cms_table_tr" valign="top"><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">4</td><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">Class and OOP<br />
<ul style="margin-bottom: 1em; margin-left: 2em; margin-right: 1em; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Class</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Constructor</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Attributes</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Method</li>
</ul></td></tr>
<tr class="cms_table_tr" valign="top"><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">5</td><td class="cms_table_td" style="border-bottom-color: rgb(0, 0, 0); border-bottom-style: none; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 1px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-top-style: none; border-top-width: 1px; border-width: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;">Class and OOP(cont.)<br />
<ul style="margin-bottom: 1em; margin-left: 2em; margin-right: 1em; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Operator Overloading</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Polymorphism</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Encapsulation</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Inheritance</li>
<li style="list-style-image: initial; list-style-position: outside; list-style-type: disc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Exception</li>
</ul></td></tr>
</tbody></table></div><span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Tutorial of Python: </span><a href="http://docs.python.org/py3k/tutorial/" style="background-color: white; color: #0066cc; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-decoration: none;" target="_blank">http://docs.python.org/py3k/tutorial/</a><br />
<span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Some documents: </span><a href="http://www.mediafire.com/?t45pdil6aq0cmva" style="background-color: white; color: #0066cc; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-decoration: none;" target="_blank">http://www.mediafire.com/?t45pdil6aq0cmva</a><span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"> </span><br />
<span class="Apple-style-span" style="background-color: white; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Some slides introduction: </span><a href="http://www.mediafire.com/?21iialis8277w" style="background-color: white; color: #0066cc; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; text-decoration: none;" target="_blank">http://www.mediafire.com/?21iialis8277w</a><br />
<br />
Hope this can help you guys to get an overview when starting coding Python !Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8483073553870712866.post-41091899123508598812011-12-01T20:57:00.000-08:002011-12-02T06:00:06.930-08:00[Android] First feeling ...First of all,<br />
I must say that I'm a fan of iOS development.<br />
The first time I've worked with Android, I was so disappointed. The Android Emulator runs tooooo slowww, and sometimes I have trouble with the Heap and Stack running processes.<br />
<br />
Some people will think Android is an OS. That's totally wrong !<br />
Android is an open-platform with Apache2.0 license. Because it's "open", now, you can see, there is Android everywhere, from mobile to household stuffs (like washing machine, InternetTV,...). So I'm curious about Android. That's the reason why I came to Android. :))<br />
<br />
There are 4 things that I experienced in coding Android:<br />
<br />
<ul><li>You should code GUI with the XML file if you want a clean and well-structured GUI for your apps.</li>
<li>Once running the emulator, do not try to close it if you want to test your code later. The emulator takes so much time initializing.</li>
<li>Learning JavaSE soon, if you want to make an Android app.</li>
<li>Should not use Android 4.0. I realize it's a mistake using Android 4.0 cause it has the least documents and there are some components in Android4 which are not "open-source".</li>
</ul>So that is just my feeling when I first "met" the big-guy-called-Android.<br />
I will have an Android tutorial for coding in the next blog entry. Hope everyone likes it !Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8483073553870712866.post-59373334558361006062011-12-01T20:35:00.000-08:002013-09-15T02:58:48.605-07:00[Java] Math Parser<blockquote class="tr_bq">
Hi all,<br />This is my first try in Parser. Hope this can help you guys !<br />The parser_main will take the input expression and parse this one, and finally, return the value of the expression.<br />This is the first time I tried to code a parser. If there are bugs, please comment. I always appreciate that. ^^</blockquote>
I have edited this post. As I received some personal comments, I temporarily hide this code. If you have any difficulties in implementing a java parser for mathematics expression, please email me, I will help you!Unknownnoreply@blogger.com5