<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:series="http://unfoldingneurons.com/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Programming Ideas, Logics, Tips and Tricks</title>
	
	<link>http://www.sajithmr.me</link>
	<description />
	<lastBuildDate>Thu, 24 Jan 2013 08:04:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/sajithmr" /><feedburner:info uri="sajithmr" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>sajithmr</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>RSA Algorithm</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/VTWvEMdvrH4/rsa-algorithm</link>
		<comments>http://www.sajithmr.me/rsa-algorithm#comments</comments>
		<pubDate>Thu, 24 Jan 2013 08:03:59 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1214</guid>
		<description><![CDATA[Here is RSA algorithm explained in a simple way with example. Algorithm: Find two random distinct prime numbers (usually very big) , call them P and Q Find number N = P x Q   (this N is called modulus, used in both private and public key pair) Find number Z = (P-1) x (Q-1) [...]]]></description>
				<content:encoded><![CDATA[<p>Here is RSA algorithm explained in a simple way with example.</p>
<p>Algorithm:</p>
<ol>
<li>Find two random distinct prime numbers (usually very big) , call them P and Q</li>
<li>Find number N = P x Q   (this N is called modulus, used in both private and public key pair)</li>
<li>Find number Z = (P-1) x (Q-1)        (Z is called Euler&#8217;s totient function)</li>
<li>Chose an integer E, which is co-prime to Z. (Co-prime means GCD of E and Z should be 1, means, E and Z should only be divisible by 1)  [This E will be our encryption key ]</li>
<li>Find integer D, such a way that, ( D x E ) mod N should be 1  (D ≡ E ** -1 (mod Z) )<br />
This D is called multiplicative inverse of E. This D is your decrypt key (** indicates power to or raise to, eg: 2 ** 3 =  2 x 2 x 2 = 8  )</li>
</ol>
<p>&nbsp;</p>
<p>So, here we get E and D can be used as encryption and decryption key</p>
<p>Encryption key pair (E, N)</p>
<p>Decryption key pair ( D, N)</p>
<p>Here N is the modulus common for both keys.</p>
<p>&nbsp;</p>
<h3>Encryption</h3>
<p>To encrypt Data</p>
<p>(Data ** E ) mod N =&gt; C,  the encrypted Cypher (Here ** is power to, or raise to )</p>
<h3>Decryption</h3>
<p>To decrypt the Cypher C</p>
<p>(C ** D) mod N =&gt;  Data</p>
<p>&nbsp;</p>
<p>Real life Example</p>
<ol>
<li><span style="line-height: 13px"><span style="line-height: 13px">Find two distinctive prime number P and Q.</span></span>P = <strong>11</strong> and Q = <strong>13</strong></li>
<li>Find N = P x QN = 11 x 13 = <strong>143</strong></li>
<li>Find Z = (P-1) x (Q-1)Z = 10 X 12  =<strong> 120</strong></li>
<li>Find E as co-prime of ZFind any co-prime of 120, E = <strong>101</strong>   , because GCD(120, 101) = 1</li>
<li>Find D, such that E x D mod N should be 1(D x 101 ) mod 120 =&gt; 1D =  <strong>221</strong></li>
</ol>
<p>We god E, D and N, so the encryption key pair is (101, 143) [E, N] and the decrypting key pair is ( 221,143) [D, N]</p>
<p><strong><span style="text-decoration: underline">Lets try Encryption</span></strong>,</p>
<p>eg: We need to encryption Data = 2</p>
<p>Encrypted Data Cypher C = Data ** E mod N</p>
<p>C = 2 ** 101 mod 143</p>
<p>C = 2535301200456458802993406410752  mod 143  = 123</p>
<p>Encrypted Data C  = <strong>123</strong></p>
<p><span style="text-decoration: underline"><strong>Lets try Decryption</strong></span></p>
<p>Data decrypted = C ** D mod N</p>
<p>Data decrypted = 123 ** 221 mod 143</p>
<p>Data decrypted =  <strong>2  </strong>(try calculating yourself, as 123 ** 221 is too big to print here)</p>
<p>&nbsp;</p>
<p>A sample ruby code finding these numbers is below:</p>
<pre class="crayon-plain-tag"><code>#to find gcd
def gcd(a,b)

if b == 0
return a
else
return gcd(b, a%b)
end
end

#to find co-prime

def find_coprime(a,z)
if gcd(a,z) == 1
return z
end
find_coprime(a, z + 1)
end

#to find decrypt key D

while ((d*e) % z != 1) or (d == e) do
d= d+1
print d.to_s + &quot;\n&quot;
end</code></pre>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/VTWvEMdvrH4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/rsa-algorithm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.sajithmr.me/rsa-algorithm</feedburner:origLink></item>
		<item>
		<title>QPDF – a command line tool for PDF operations</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/KI4VV2HNqLw/qpdf-a-command-line-tool-for-pdf-operations</link>
		<comments>http://www.sajithmr.me/qpdf-a-command-line-tool-for-pdf-operations#comments</comments>
		<pubDate>Wed, 23 Jan 2013 06:18:18 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1208</guid>
		<description><![CDATA[QPDF is a command line tool for creating / editing and managing PDF. This is a powerful tool manages almost all PDF operations. You can convert one format of PDF to other, also possible bulk PDF operations. Detailed documentation for QPDF can be found here. eg, normalize a serialized PDF: qpdf &#160;input.pdf &#160;--normalize-content=y &#160;output.pdf &#160; [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.sajithmr.me/?attachment_id=1209" rel="attachment wp-att-1209"><img class="alignnone  wp-image-1209" alt="pdf-icon" src="http://www.sajithmr.me/wp-content/uploads/2013/01/pdf-icon.png" width="128" height="197" /></a></p>
<p>QPDF is a command line tool for creating / editing and managing PDF. This is a powerful tool manages almost all PDF operations.</p>
<p>You can convert one format of PDF to other, also possible bulk PDF operations.</p>
<p>Detailed documentation for QPDF can be found <a href="http://qpdf.sourceforge.net/files/qpdf-manual.html" target="_blank">here</a>.</p>
<p>eg, normalize a serialized PDF:</p>
<pre class="crayon-plain-tag"><code>qpdf &nbsp;input.pdf &nbsp;--normalize-content=y &nbsp;output.pdf</code></pre>
<p>&nbsp;</p>
<p>eg,remove xref streams from PDF:</p>
<pre class="crayon-plain-tag"><code>qpdf &nbsp;input.pdf --ignore-xref-streams&nbsp; output.pdf</code></pre><p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/KI4VV2HNqLw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/qpdf-a-command-line-tool-for-pdf-operations/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sajithmr.me/qpdf-a-command-line-tool-for-pdf-operations</feedburner:origLink></item>
		<item>
		<title>Origami – PDF library for Ruby</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/YM6depBRzyw/origami-pdf-library-for-ruby</link>
		<comments>http://www.sajithmr.me/origami-pdf-library-for-ruby#comments</comments>
		<pubDate>Tue, 22 Jan 2013 06:02:44 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1204</guid>
		<description><![CDATA[Origami is a ruby library for crating / editing and Managing PDF files. There is only less ruby PDF library which supports digital signature kind of feature in PDF. Recently I have used Origami for signing a PDF document. You can find the details of Origami library here. Gem version of Origami library is also [...]]]></description>
				<content:encoded><![CDATA[<p>Origami is a ruby library for crating / editing and Managing PDF files. There is only less ruby PDF library which supports digital signature kind of feature in PDF.</p>
<p>Recently I have used Origami for signing a PDF document.</p>
<p>You can find the details of Origami library <a href="http://esec-lab.sogeti.com/pages/Origami" target="_blank">here</a>.</p>
<p>Gem version of Origami library is also available in RubyGems</p><pre class="crayon-plain-tag"><code>gem install origami</code></pre>
<p>The full source is <a href="http://code.google.com/p/origami-pdf/" target="_blank">here</a>.</p>
<p>Sample code to sign a PDF using Origami:</p>
<pre class="crayon-plain-tag"><code>require 'origami'

&amp;nbsp;

#method to execute a command using shell
def command?(command)
system(&quot;which #{ command} &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&quot;)
end

#I used qpdf to check a PDF status like whether it is linearized or xref-streamed, because Origami has no support for those kind of PDFs

raise unless command? 'qpdf'

input = &quot;sample.pdf&quot;

&amp;nbsp;

mypdf = Origami::PDF.read input

&amp;nbsp;

#code to convert linearized PDF
if mypdf.is_linearized?

command = &quot;qpdf #{input} --normalize-content=y #{intermediate}&quot;

system(&quot;#{ command} &amp;gt; /dev/null &quot;)

mypdf = Origami::PDF.read intermediate

end

&amp;nbsp;

#code to convert xrefstreamed PDF

if mypdf.revisions.last.xrefstm.nil? == false

command = &quot;qpdf #{input} --ignore-xref-streams #{intermediate}&quot;

system(&quot;#{ command} &amp;gt; /dev/null &quot;)

mypdf = Origami::PDF.read intermediate
end

&amp;nbsp;

#load certificate file

certificate_raw = File.read &quot;server.crt&quot;

certificate = OpenSSL::X509::Certificate.new certificate_raw

#load key file

key_raw = File.read &quot;server.key&quot;

key = OpenSSL::PKey::RSA.new key_raw

#signature image
imageobject = Origami::Graphics::ImageXObject.from_image_file('logo.jpg', 'jpg')
imageobject.Width = 100
imageobject.Height = 100

&amp;nbsp;

myannot = Origami::Annotation::RichMedia.new
myannot.Rect = Origami::Rectangle[:llx =&amp;gt; 120.0, :lly =&amp;gt; 386.0, :urx =&amp;gt; 190.0, :ury =&amp;gt; 353.0]

&amp;nbsp;

sigannot = Origami::Annotation::Widget::Signature.new
sigannot.Rect = Origami::Rectangle[:llx =&amp;gt; 89.0, :lly =&amp;gt; 386.0, :urx =&amp;gt; 190.0, :ury =&amp;gt; 353.0]
sigannot.Contents = &quot;Hello World&quot;
sigannot.Border = [ 1 , 1 , 1 ]

#add the signature page

page = Origami::Page.new
mypdf.append_page(page)
page.add_annot(sigannot)

&amp;nbsp;

mypdf.sign(certificate, key,
:method =&amp;gt; 'adbe.pkcs7.sha1',
:annotation =&amp;gt; sigannot,
:location =&amp;gt; &quot;India&quot;,
:contact =&amp;gt; &quot;fred@security-labs.org&quot;,
:reason =&amp;gt; &quot;Proof of Concept by Sajith&quot;
)

#save the output file

mypdf.save('OUT.pdf')</code></pre><p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/YM6depBRzyw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/origami-pdf-library-for-ruby/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.sajithmr.me/origami-pdf-library-for-ruby</feedburner:origLink></item>
		<item>
		<title>Problem using external images in blog post</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/lTE2feuE4hw/problem-using-external-images-in-blog-post</link>
		<comments>http://www.sajithmr.me/problem-using-external-images-in-blog-post#comments</comments>
		<pubDate>Mon, 21 Jan 2013 06:00:32 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[quicktips]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1202</guid>
		<description><![CDATA[Usually when I write article, to avoid the headache of uploading an image and cropping them to fit for a post, sometime I used external image urls inside the post to make it quicker when writes. Two weeks ago, I noticed my website showing as virus attacked in chrome, though it is loading behind the [...]]]></description>
				<content:encoded><![CDATA[<p>Usually when I write article, to avoid the headache of uploading an image and cropping them to fit for a post, sometime I used external image urls inside the post to make it quicker when writes.</p>
<p>Two weeks ago, I noticed my website showing as virus attacked in chrome, though it is loading behind the warning.</p>
<p>When I close examined it, the virus error was caused due to an image, loaded from an external website, which is affected by some critical virus attack. Chrome backlist those websites and using images from those website will affect your site as well.</p>
<p>So, the lesson 7 is, never use external images while writing blog post, though it helps you using others bandwidth. Better we compromise on that bandwidth part in ours.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/lTE2feuE4hw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/problem-using-external-images-in-blog-post/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sajithmr.me/problem-using-external-images-in-blog-post</feedburner:origLink></item>
		<item>
		<title>How to parse a CSR request using openssl</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/KjVQsvwBCsg/how-to-parse-a-csr-request-using-openssl</link>
		<comments>http://www.sajithmr.me/how-to-parse-a-csr-request-using-openssl#comments</comments>
		<pubDate>Fri, 28 Sep 2012 09:14:34 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1187</guid>
		<description><![CDATA[Use the following command to read what is inside a CSR data eg CSR: (from CSR Decoder) &#8212;&#8211;BEGIN CERTIFICATE REQUEST&#8212;&#8211; MIICzTCCAbUCAQAwgYcxCzAJBgNVBAYTAkdCMRYwFAYDVQQIEw1TdGFmZm9yZHNo aXJlMRcwFQYDVQQHEw5TdG9rZSBvbiBUcmVudDEjMCEGA1UEChMaUmVkIEtlc3Ry ZWwgQ29uc3VsdGluZyBMdGQxIjAgBgNVBAMTGXRlc3RjZXJ0LnJlZGtlc3RyZWwu Y28udWswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWLeW88IeAIa3n 23R99i874fh0jetf+STsGPgkfGXGJ++tclKGk3MJE0ijD4PNaxGXUCNULgn2ROyy bm5sTmGzpEOD+1AAAyV+pLQoFNkHEFuudGqVM6XkPWfqaM2vKvdzUbPPC0X/MfDF GPxc8AY3TUM385c9c9/WOIF6NUcAvAFIQF0zG7evzJZBqDb4enUnatMSLHmxRWMi 1JeHtfLINXhNitHewEQWgIB3j1xmh7CPO5FeTb6HzQDxc+f7uMisY6s9J/Ph3GeO CeIDooqU8jnfV5eGEzIMH5CFMZjajrNKF4DYK3YRyUI0K66+v0KILoUntEs++M20 LhOn+VE9AgMBAAGgADANBgkqhkiG9w0BAQUFAAOCAQEAUWE7oBX3SLjYNM53bsBO lNGnsgAp1P1fiCPpEKaZGEOUJ2xOguIHSu1N1ZigKpWmiAAZxuoagW1R/ANM3jXp vCLVBRv40AHCFsot9udrdCYjI43aDHAaYvLmT4/Pvpntcn0/7+g//elAHhr9UIoo MZwwwo6yom67Jwfw/be/g7Mae7mPHZ2lsQTS02hEeqVynIRk2W9meQULrt+/atog 0mqJSBx0WswtHliTc+nXFpQrwFIEzVuPGCOVw7LmCfNmHNCkZVuRSJB/9MdLmrfw chPI3NeTGSe+BZfsOtpt2/7j+bqeYKFu8B0stLoJBEnihxUoV18uZOmOeuVuX1N6 nA== &#8212;&#8211;END CERTIFICATE REQUEST&#8212;&#8211; Save the csr text inside a file, say mycsr.csr From command prompt type: openssl req -in [...]]]></description>
				<content:encoded><![CDATA[<p>Use the following command to read what is inside a <a href="http://www.redkestrel.co.uk/Articles/CSR.html">CSR</a> data</p>
<p>eg CSR: (from <a href="http://certlogik.com/decoder/">CSR Decoder</a>)</p>
<p>&#8212;&#8211;BEGIN CERTIFICATE REQUEST&#8212;&#8211;<br />
MIICzTCCAbUCAQAwgYcxCzAJBgNVBAYTAkdCMRYwFAYDVQQIEw1TdGFmZm9yZHNo<br />
aXJlMRcwFQYDVQQHEw5TdG9rZSBvbiBUcmVudDEjMCEGA1UEChMaUmVkIEtlc3Ry<br />
ZWwgQ29uc3VsdGluZyBMdGQxIjAgBgNVBAMTGXRlc3RjZXJ0LnJlZGtlc3RyZWwu<br />
Y28udWswggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWLeW88IeAIa3n<br />
23R99i874fh0jetf+STsGPgkfGXGJ++tclKGk3MJE0ijD4PNaxGXUCNULgn2ROyy<br />
bm5sTmGzpEOD+1AAAyV+pLQoFNkHEFuudGqVM6XkPWfqaM2vKvdzUbPPC0X/MfDF<br />
GPxc8AY3TUM385c9c9/WOIF6NUcAvAFIQF0zG7evzJZBqDb4enUnatMSLHmxRWMi<br />
1JeHtfLINXhNitHewEQWgIB3j1xmh7CPO5FeTb6HzQDxc+f7uMisY6s9J/Ph3GeO<br />
CeIDooqU8jnfV5eGEzIMH5CFMZjajrNKF4DYK3YRyUI0K66+v0KILoUntEs++M20<br />
LhOn+VE9AgMBAAGgADANBgkqhkiG9w0BAQUFAAOCAQEAUWE7oBX3SLjYNM53bsBO<br />
lNGnsgAp1P1fiCPpEKaZGEOUJ2xOguIHSu1N1ZigKpWmiAAZxuoagW1R/ANM3jXp<br />
vCLVBRv40AHCFsot9udrdCYjI43aDHAaYvLmT4/Pvpntcn0/7+g//elAHhr9UIoo<br />
MZwwwo6yom67Jwfw/be/g7Mae7mPHZ2lsQTS02hEeqVynIRk2W9meQULrt+/atog<br />
0mqJSBx0WswtHliTc+nXFpQrwFIEzVuPGCOVw7LmCfNmHNCkZVuRSJB/9MdLmrfw<br />
chPI3NeTGSe+BZfsOtpt2/7j+bqeYKFu8B0stLoJBEnihxUoV18uZOmOeuVuX1N6<br />
nA==<br />
&#8212;&#8211;END CERTIFICATE REQUEST&#8212;&#8211;</p>
<p>Save the csr text inside a file, say mycsr.csr<br />
From command prompt type:<br />
<span style="color: #ff6600;"><strong>openssl</strong></span> <span style="color: #0000ff;"><strong>req -in mycsr.csr -noout -text</strong></span><br />
Here is an online tool doing the same: <a href="http://certlogik.com/decoder/">CSR Decoder</a></p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/KjVQsvwBCsg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/how-to-parse-a-csr-request-using-openssl/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sajithmr.me/how-to-parse-a-csr-request-using-openssl</feedburner:origLink></item>
		<item>
		<title>Tooltip using CSS3 – HTML5 iPhone Website Part 3</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/psCEbbxVxXo/tooltip-using-css3-html5-iphone-website-part-3</link>
		<comments>http://www.sajithmr.me/tooltip-using-css3-html5-iphone-website-part-3#comments</comments>
		<pubDate>Sat, 07 Apr 2012 16:30:06 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1133</guid>
		<description><![CDATA[This post is part of series HTML5 iPhone Website How can we make a tool tip bubble using CSS3. A tool tip is a box and an arrow at the edge pointing something. We can create this using two divs or one div and a span, one in normal mode and the other rotate through [...]]]></description>
				<content:encoded><![CDATA[<p>This post is part of series HTML5 iPhone Website</p>
<p>How can we make a tool tip bubble using CSS3.</p>
<p>A tool tip is a box and an arrow at the edge pointing something. We can create this using two divs or one div and a span, one in normal mode and the other rotate through 90 degree or nearer.</p>
<p><a href="http://www.sajithmr.me/wp-content/uploads/2012/04/arch.jpg"><img class="alignnone size-full wp-image-1137" title="arch" src="http://www.sajithmr.me/wp-content/uploads/2012/04/arch.jpg" alt="html5 tool tip idea" width="295" height="206" /></a></p>
<p>Then, we make them rounded corners, borders, and by changing z-index, we move the smaller div behind the main div, then it will look like this:</p>
<p><a href="http://www.sajithmr.me/wp-content/uploads/2012/04/tool-tip.png"><img class="alignnone size-full wp-image-1138" title="tool-tip" src="http://www.sajithmr.me/wp-content/uploads/2012/04/tool-tip.png" alt="HTML5 tooltip" width="358" height="257" /></a></p>
<p>&nbsp;</p>
<p>Here is the CSS for the above tool tip</p>
<pre class="crayon-plain-tag"><code>.menutool {

position:absolute;right:10px; width: 180px;height: 61px; padding-top: 15px; padding-left: 22px; margin-top: 10px;;
background: #f0f0f0;

-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;

-webkit-box-shadow: 2px 2px 3px 1px #8c8c8c;
-moz-box-shadow: 2px 2px 3px 1px #8c8c8c;
box-shadow: 2px 2px 3px 1px #8c8c8c;

border: 1px solid #8a8a8a;

z-index: 1000;

display: none;

}

.menutool span {width: 15px; height: 15px; top: -9px ; position: absolute; right: 13px ;

-moz-transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);
-webkit-transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);
-o-transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);
-ms-transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);
transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);

border-top: 1px solid #8a8a8a;
border-left: 1px solid #8a8a8a;

background: #f0f0f0;

z-index: 999;

}</code></pre>
<p>Another example for tooltip bubble, (this is for bookmark tool tip for iPhone)</p>
<p><a href="http://www.sajithmr.me/wp-content/uploads/2012/04/Bookmark-bubble.png"><img class="alignnone size-full wp-image-1139" title="Bookmark-bubble" src="http://www.sajithmr.me/wp-content/uploads/2012/04/Bookmark-bubble.png" alt="iphone bookmark tool tip " width="344" height="441" /></a></p>
<p>Here is the CSS for the above image</p>
<pre class="crayon-plain-tag"><code>.bmpopup {

background: none repeat scroll 0 0 #F0F0F0;
border: 1px solid #8A8A8A;
border-radius: 8px 8px 8px 8px;
bottom: 13px;
box-shadow: 2px 2px 3px 1px #8C8C8C;
height: 60px;
left: 16%;
margin-top: 10px;
padding: 8px 12px;
position: fixed;
text-align: justify;
width: 180px;
z-index: 1000;
display:none;

}

.bmpopup span {width: 15px; height: 15px;&nbsp; bottom: -9px ; position: absolute; left: 49% ;

-moz-transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);
-webkit-transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);
-o-transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);
-ms-transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);
transform: scale(1) rotate(45deg) translate(0px, 0px) skew(0deg, 0deg);

border-right: 1px solid #8a8a8a;
border-bottom: 1px solid #8a8a8a;

background: #f0f0f0;

z-index: 999;

}</code></pre><p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/psCEbbxVxXo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/tooltip-using-css3-html5-iphone-website-part-3/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<series:name><![CDATA[HTML5 iPhone Site Development]]></series:name>
	<feedburner:origLink>http://www.sajithmr.me/tooltip-using-css3-html5-iphone-website-part-3</feedburner:origLink></item>
		<item>
		<title>CSS 3.0 Tools –  Don’t reinvent the wheel</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/3ZP8hbwn9zU/css-3-0-tools-dont-reinvent-the-wheel</link>
		<comments>http://www.sajithmr.me/css-3-0-tools-dont-reinvent-the-wheel#comments</comments>
		<pubDate>Fri, 06 Apr 2012 16:03:16 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1121</guid>
		<description><![CDATA[This article is part of  series, &#8220;HTML5 iPhone Website Development&#8221; During your CSS creation, whenever  you think you need a gradient or rounder corner or a rotation, we can use the advantage of CSS3. Don&#8217;t need to go to W3Schools or any CSS 3 documentation, that is old style Use online tools, example and the [...]]]></description>
				<content:encoded><![CDATA[<p>This article is part of  series, &#8220;HTML5 iPhone Website Development&#8221;</p>
<p>During your CSS creation, whenever  you think you need a gradient or rounder corner or a rotation, we can use the advantage of CSS3.</p>
<p>Don&#8217;t need to go to W3Schools or any CSS 3 documentation, that is old style <img src='http://www.sajithmr.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
<p>Use online tools, example and the one I mostly used: <a href="http://css3generator.com/">http://css3generator.com/</a></p>
<p>Here you can create css3 for most of the browsers support CSS3. In our case, we just need to take the web-kit part, as we are making this for iPhone. However, during your learning, better to copy full CSS, so that you can see the changes using your Firefox, I  know you will be using Firefox for development and html slicing with Firebug <img src='http://www.sajithmr.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
<p>So copy the full CSS from css3generator.com for the beginning. In the final stages of your development, you can remove unwanted css if you want this site in iPhone only.</p>
<p>Using this tool you can set</p>
<p>Border Radius, Box Shadow, Text Shadow, RGBA, Font-Face for custom fonts, Multiple Column divs, box sizing and resizing, Outlines, transitions, transformations, Selectors, Different Gradients etc.</p>
<p>Some output of these CSS3 looks like this:<br />
<strong><br />
Search box design (rounded corner and shadow) :</strong></p>
<p><a href="http://www.sajithmr.me/wp-content/uploads/2012/04/searchbox.png"><img class="alignnone size-full wp-image-1126" title="searchbox" src="http://www.sajithmr.me/wp-content/uploads/2012/04/searchbox.png" alt="" width="396" height="47" /></a></p>
<pre class="crayon-plain-tag"><code>.searchbox .searchtext{

border: none;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 0px;
-webkit-border-top-right-radius: 0px;
-moz-box-shadow: inset 0 0 5px #999;
-webkit-box-shadow: inset 0 0 5px #999;
box-shadow: inset 0 0 5px #999;
border-right: 1px solid #aeaeac;

color: #7f7f7e;
font-size: 14px;
width: 84%;
float: left;
height: 25px;
padding: 2px 2px 2px 4px;
margin-left: 4px;
margin-top: 4px;

}</code></pre>
<p>Gradient Menu Background:</p>
<p><a href="http://www.sajithmr.me/wp-content/uploads/2012/04/menu-background.png"><img class="alignnone size-full wp-image-1127" title="menu-background" src="http://www.sajithmr.me/wp-content/uploads/2012/04/menu-background.png" alt="" width="369" height="52" /></a></p>
<pre class="crayon-plain-tag"><code>.menu-container ul li {
padding: 10px;
border-bottom: 1px solid #c6c6c6;
background: #e5e5e5; /* Old browsers */
background: -moz-linear-gradient(top, #e5e5e5 0%, #ffffff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e5e5e5), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #e5e5e5 0%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #e5e5e5 0%,#ffffff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #e5e5e5 0%,#ffffff 100%); /* IE10+ */
background: linear-gradient(top, #e5e5e5 0%,#ffffff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5e5e5', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */

}</code></pre><p><p>Rounded shaped button:</p>
<p><a href="http://www.sajithmr.me/wp-content/uploads/2012/04/Round-button.png"><img class="alignnone size-full wp-image-1128" title="Round-button" src="http://www.sajithmr.me/wp-content/uploads/2012/04/Round-button.png" alt="" width="102" height="46" /></a></p>
<pre class="crayon-plain-tag"><code>a.green-button {

background: #00a943; /* Old browsers */
background: -moz-linear-gradient(top, #00a943 0%, #00a341 50%, #008d18 50%, #008d18 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00a943), color-stop(50%,#00a341), color-stop(50%,#008d18), color-stop(100%,#008d18)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #00a943 0%,#00a341 50%,#008d18 50%,#008d18 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #00a943 0%,#00a341 50%,#008d18 50%,#008d18 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #00a943 0%,#00a341 50%,#008d18 50%,#008d18 100%); /* IE10+ */
background: linear-gradient(top, #00a943 0%,#00a341 50%,#008d18 50%,#008d18 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00a943', endColorstr='#008d18',GradientType=0 ); /* IE6-9 */

border: 1px solid #848484;
border-radius: 5px 5px 5px 5px;
color: #FFFFFF;
display: block;
font-size: 16px;
font-weight: bold;
padding: 8px 15px 8px;
text-align: center;
text-decoration: none;
width: 84%;
margin: 20px 0px 20px 4%;
float: left;
}</code></pre><p><p>
<p>In the next post, we can see different designs like Facebook Button, Bubble tool tips, Loading indicators etc in CSS3 in 3-4 lines</p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/3ZP8hbwn9zU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/css-3-0-tools-dont-reinvent-the-wheel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[HTML5 iPhone Site Development]]></series:name>
	<feedburner:origLink>http://www.sajithmr.me/css-3-0-tools-dont-reinvent-the-wheel</feedburner:origLink></item>
		<item>
		<title>HTML5 iPhone site development – Part 1</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/o2nz9q7me3E/html5-iphone-site-development-part-1</link>
		<comments>http://www.sajithmr.me/html5-iphone-site-development-part-1#comments</comments>
		<pubDate>Thu, 05 Apr 2012 15:22:41 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1113</guid>
		<description><![CDATA[Started writing a series post after a long time for HTML5 iPhone Website Development. Read my previous Series here: Gmail Architecture Online Photoshop Basic Structure As usual start designing your website with iPhone layout in mind. Things to remember before you design 1) iPhone support HTML5 and CSS3 2) iPhone has two orientations. 3) iPhone [...]]]></description>
				<content:encoded><![CDATA[<p>Started writing a series post after a long time for HTML5 iPhone Website Development.</p>
<p>Read my previous Series here:</p>
<p><a title="Gmail Architecture" href="http://www.sajithmr.me/series/gmail-architecture">Gmail Architecture </a></p>
<p><a title="Online Photoshop" href="http://www.sajithmr.me/series/online-photoshop">Online Photoshop</a></p>
<h3>Basic Structure</h3>
<p>As usual start designing your website with iPhone layout in mind. Things to remember before you design</p>
<p>1) iPhone support HTML5 and CSS3</p>
<p>2) iPhone has two orientations.</p>
<p>3) iPhone has no built in Menu for browser (mobile safari)</p>
<p>4) iPhone has a footer navigation by default in Safari</p>
<p>Why these things are important before we design something in Photoshop ?</p>
<p>Because, since iPhone has CSS3 support which has a lot of design advantages like rounded corner, gradients, rotation, dual background etc, the design can make a design which is suitable for a HTML developer to slice. In normal website development, we achieve these effects using small or big images in repeated mode. Here in CSS3.0, it all done using 2-3 lines of plain text in CSS file.</p>
<p>Since iPhone has 2 orientation, it is up to the product designer to decide whether we want two layouts of just one. Because iPhone can use two different CSS files for different orientation. I will cover this in coming chapters.</p>
<p>The number of controls or button in mobile safari browser is less, and hence we need to provide custom menus in our designs for each navigation, say go to home page, or my galleries, terms page etc. Also every click is just taps, and there is no scope for hover events, which is used in good consideration in majority of the Desktop websites.</p>
<p>Since safari has a footer navigation already, we can avoid many back buttons in our designs. Also can think about tools like Bookmark is placed at bottom. So, if you want to show a tool tip to bookmark your site, you can locate that tool tip button on the footer. (In coming series I will show you how quickly we can create a tool tip bubble for bookmark just with css3.o)</p>
<h4>Special Tags</h4>
<p>Once the design is done, before we start slicing, need to check some special tags available for iPhone (I would say for many latest handsets)</p>
<p><strong>Doctype and HTML tag:</strong></p><pre class="crayon-plain-tag"><code>&lt;!DOCTYPE html&gt;
&lt;html xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;</code></pre>
<p><strong>Meta tags:</strong></p>
<pre class="crayon-plain-tag"><code>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width = device-width,minimum-scale=1.0,maximum-scale=1.0, user-scalable=no&quot; /&gt;
&lt;meta name=&quot;HandheldFriendly&quot; content=&quot;True&quot; /&gt;
&lt;meta name=&quot;apple-mobile-web-app-capable&quot; content=&quot;yes&quot; /&gt;</code></pre><p><p>For iPhone, it is better to display a website in full width mode, without any zoom options, these meta tags simply does this.</p>
<p>The rest of the slicing, just follow typical div-css float model design (of course no table)</p>
<p>Continue like normal CSS slicing, and think about using CSS3.0 techniques whenever needed. All backgrounds, gradients, shadows, borders, round corners, rotations etc, use CSS3.0. In the next chapter, I will show you which are the tools we can use to create css3.0 for a particular design.  Don&#8217;t reinvent the wheel by learning all css3.0 techniques, Google is there for you <img src='http://www.sajithmr.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
<p>See you in next series post, &#8220;CSS3.0 tools &#8211; don&#8217;t reinvent the wheel&#8221;</p>
<p><strong>Tips:</strong></p>
<p>You can create custom bookmark icon using the following header, this is same like favicon for Desktop browsers:</p>
<pre class="crayon-plain-tag"><code>&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;/images/apple-touch-icon.png&quot;/&gt;</code></pre></p>
<p>Thanks</p>
<p>Sajith</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/o2nz9q7me3E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/html5-iphone-site-development-part-1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[HTML5 iPhone Site Development]]></series:name>
	<feedburner:origLink>http://www.sajithmr.me/html5-iphone-site-development-part-1</feedburner:origLink></item>
		<item>
		<title>HTML5 Audio: Browser Self Test</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/jc0ns4WkBkE/html5-audio-browser-self-test</link>
		<comments>http://www.sajithmr.me/html5-audio-browser-self-test#comments</comments>
		<pubDate>Thu, 22 Mar 2012 21:15:26 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[webworld]]></category>
		<category><![CDATA[andriod]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1101</guid>
		<description><![CDATA[Created a small html5 page today to check which audio format your browser support in HTML5. It is using a Javascript code to detect browsers audio status dynamically and show the result. I also added 5 different audio format sample using html5 audio node, and using this you can test whether any particular format is [...]]]></description>
				<content:encoded><![CDATA[<p>Created a small html5 page today to check which audio format your browser support in HTML5.</p>
<p><a href="http://www.sajithmr.me/html5/audio/" target="_blank"><img class="alignnone size-full wp-image-1105" title="button" src="http://www.sajithmr.me/wp-content/uploads/2012/03/button.png" alt="" width="244" height="39" /></a></p>
<p>It is using a Javascript code to detect browsers audio status dynamically and show the result.</p>
<p>I also added 5 different audio format sample using html5 audio node, and using this you can test whether any particular format is playing or not</p>
<p>It works for both Desktop browsers and mobile browsers.</p>
<p>Here is the URL:</p>
<p><a title="Detech HTML5 audio property of browser" href="http://www.sajithmr.me/html5/audio/" target="_blank">http://www.sajithmr.me/html5/audio/</a></p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/jc0ns4WkBkE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/html5-audio-browser-self-test/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sajithmr.me/html5-audio-browser-self-test</feedburner:origLink></item>
		<item>
		<title>Facebook changes App profile page</title>
		<link>http://feedproxy.google.com/~r/sajithmr/~3/vVBYa2EgjRQ/facebook-changes-app-profile-page</link>
		<comments>http://www.sajithmr.me/facebook-changes-app-profile-page#comments</comments>
		<pubDate>Mon, 23 Jan 2012 15:44:09 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[webworld]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1085</guid>
		<description><![CDATA[From February 2012 onwards, Facebook stops App profile pages. But you can still move all your page likes and users to new page (till Feb). The new Facebook app creation flow is really confusing. For developers, to add a app as a tab to another page, you  need to user the following URL: https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&#38;next=YOUR_URL next [...]]]></description>
				<content:encoded><![CDATA[<p>From February 2012 onwards, Facebook stops App profile pages. But you can still move all your page likes and users to new page (till Feb).</p>
<p>The new Facebook app creation flow is really confusing.</p>
<p>For developers, to add a app as a tab to another page, you  need to user the following URL:</p>
<p><a href="https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&amp;next=YOUR_URL">https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&amp;next=YOUR_URL</a></p>
<p>next parameter should be your canvas page url.</p>
<p>Here you can see an option to add this app to your page.</p>
<img src="http://feeds.feedburner.com/~r/sajithmr/~4/vVBYa2EgjRQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/facebook-changes-app-profile-page/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.sajithmr.me/facebook-changes-app-profile-page</feedburner:origLink></item>
	</channel>
</rss>
