<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>apleben.com</title>
	<atom:link href="http://www.apleben.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.apleben.com</link>
	<description>Volatile and Decentralized</description>
	<lastBuildDate>Sun, 12 Feb 2012 16:15:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Partial Formalizations and the Lemmings Game</title>
		<link>http://www.apleben.com/2011/12/partial-formalizations-and-the-lemmings-game/</link>
		<comments>http://www.apleben.com/2011/12/partial-formalizations-and-the-lemmings-game/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 10:29:42 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[Delusion]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[absolutism]]></category>
		<category><![CDATA[objectivism]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=346</guid>
		<description><![CDATA[Yesterday Oh man, this is so hard each time to found out a way of the paragraph or topic start. Nonetheless, I am not a novel writer and doing this how I only can. An intentions of this post is my attempt to express some nifty tricks, that I learned from other languages by reading [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2011/12/1000lemming.png" width="240" />
		</p><p><s>Yesterday</s> Oh man, this is so hard each time to found out a way of the paragraph or topic start. Nonetheless, I am not a novel writer and doing this how I only can.</p>
<p>An intentions of this post is my attempt to express some nifty tricks, that I learned from other languages by reading a source code of many glorious Open Source projects, that were written on those languages, as well as writing on such languages. Among these languages are Scala, Python, C++, Emacs Lisp and I barely looked at Clojure. So, will try to apply something to Java as a non Phantom equation.</p>
<p>Oops, must to mention what picture to this post was proudly stolen from the <a href="http://coderwall.com/achievements" target="_blank">CoderWall&#8217;s achievements badges</a>. I am so sorry (And this is not a promotion, if you cares about it).</p>
<p><span style="text-decoration: underline;"><strong>What Needs to be Formalized?</strong></span></p>
<p>This is a point for a daringly cantankerous and short digress.</p>
<p>In the era of the growth popularity of many &#8220;modern&#8221; Programming languages people still (and always will) complain about them, by rupturing between these friends forward and backward. Personally, I will try to not fall to this curve and will try to express my objective position without any fanaticism.</p>
<p>First of all, should mention, that I still think and believe, what many people trying to apply their knowledge in one sole language into another languages as well, even scarcely ever looking on the second. Previously, most people never use C++ in the right way, how it could be used. Instead, they&#8217;re always tried to use C++ as a glorified C or slightly mutated Java. And this is not the right way to use it. Without any doubt, nobody should call himself a professional, if he only knows one language. Many of these words were expressed by <a href="http://www2.research.att.com/~bs/" target="_blank">Bjarne Stroustrup</a> in his <a href="http://bigthink.com/search?email=&amp;q=Bjarne+Stroustrup" target="_blank">interview to bigthink</a>.</p>
<p>Meanwhile, a total annihilation between two armies of <s>zombies</s> Javists and mutated Javists (actually, absolutely immutable) are proceeding in the full-length. A first army stands with a flag emblem framed like &#8220;Senior Java Geeks&#8221; and &#8220;Java NOT dead&#8230; yet (author&#8217;s note)&#8221;, the second army holds a flag with emblem framed &#8220;Scala type spelunker&#8221; and &#8220;Clear your mind &#8211; this is Clojure&#8221;. For some unsubstantial reasons, the second army also periodically suffer from civil wars in their seemingly slim ranks. Also, we could find a third not numerous army of slightly mutated Javists, which not hold any flags, but if they will&#8230; their flag would be embraced with a frame &#8220;This is Groovy Baby&#8221;. In addition, sometimes we even could notice a <a href="http://macstrac.blogspot.com/2009/04/scala-as-long-term-replacement-for.html" target="_blank">migration from the third army to the second</a> with a fast-forward merge strategy.</p>
<p>As for me personally, I am not prefer one of these intrinsic locks and prefer to stay apart from it on the hill and observe how they will smash each other. Because I think, that it is much better to hold a finger on the proverbial &#8221;Red button&#8221;, instead of fighting with a naked sword in your hands. However, I like Scala as a language and as a good step forward, but without deep fanaticism and contempt to others.</p>
<p><span style="text-decoration: underline;"><strong>Objects in Space in the Lemming World</strong></span></p>
<p>Most people seriously complain about Scala and his over-complexity, about lack of many features in IDEs, that they prefer to use for their Java coding, etc. Geometric position of these objects and their relations comes from the Java world, where people has and most importantly wish to have an IDE, that will solve many problems in the code for you. This is a such evil kind of automation tools, although many people will never admit this &#8211; it is a bitter truth of reality, when you are willing to press an &#8220;apply button&#8221;, instead of just think about a problem and learn from it, when you solved it. You will just pass it away. This is are persistent behaviors of people, who comes to Scala and / or Clojure world with an attachment from the Java world, especially without any background with another languages.</p>
<p>Not everybody knows that the most influential language in this world is C++ (surprise~!). Probably, the most famous utility, which everybody use every day are &#8211; Google search engine (or your search engine of choice). Yes, it is C++. Recently (don&#8217;t remember when, though) Facebook turns into C++, because they need performance for their backend. Your entire desktop is C/C++ (Cocoa, CoreAudio, CoreData, CoreLibs, KDE&#8230; many of them) as well, etc., etc.</p>
<p>Even by living a such long life, C++ developers still do not have a good qualified IDE and many commercial companies aren&#8217;t interested to spent their time and resources into development in this area. Not because of the &#8220;language popularity&#8221;, contrariwise, because of benign of such developers and most of them don&#8217;t need a &#8220;by one button apply&#8221; solutions, as well as a complexity of the language themself. Many people always complain about it too. It&#8217;s just too hard to build such IDE that would be as good as for Java right now. Java is a much simpler language themself.</p>
<blockquote><p><a href="http://www2.research.att.com/~bs/bs_faq.html#Java" target="_blank">Much of the relative simplicity of Java is &#8211; like for most new languages &#8211; partly an illusion and partly a function of its incompleteness.</a></p></blockquote>
<p>Apparently, Scala is a such type of complex language, where you have a lot of constructions and language rules, and I guess, not just to create an encumbrance around it or to stir up envy from the Java fans. I think, it were made to gain an immediate efficacy and to destroy excruciating pain in the back port of your body. Such type of language just cannot be simple and tools creation for it are even harder. Seems like, it&#8217;s such kind of fervency, when people complain about it, albeit don&#8217;t understand the entire problem completely.</p>
<p><span style="text-decoration: underline;"><strong>Physics of the Common Sense Lemming World</strong></span></p>
<p>Moreover, most people complain, that they just cannot read a source code of <a href="http://scalaz.org" target="_blank">Scalaz project</a>, source code of <a href="https://github.com/harrah/xsbt/wiki" target="_blank">xsbt project</a> and another projects, after just a three or even six months of writing some Scala code, straight-forward and right away. Likely, with a total absence of any experience in the pure functional programming languages, among them <a href="http://haskell.org/" target="_blank">Haskell</a>, <a href="http://caml.inria.fr/" target="_blank">OCaml</a>, <a href="http://www.erlang.org/" target="_blank">Erlang</a> and others. Is it a so new kind of hypocrites?</p>
<p>Aforementioned libraries have been made definitely by a cunning and biting wit, by a guys those have a lot of experience in Haskell, and most of theoretical background came into Scalaz and xsbt from Haskell and math theory. If you are not familiar with it, how you can even try to read this code? It is initially wrong decision.</p>
<p>Sure, such libraries not without their own crankiness, but it is not just an attempt to make a lesion for your brain, conversely this is an attempt to solve a problem in another way. Don&#8217;t understand &#8211; don&#8217;t read the code, but use it. It could help.</p>
<p>It turns out, what patient simply can&#8217;t realize how to use that cure properly, beacuse he didn&#8217;t read instruction for this drug till the end. Thus, instead of alleviate pains he just hamble themself and now want they money back! So, who is to blame?</p>
<p>Maybe projection isn&#8217;t all Logic.</p>
<p><span style="text-decoration: underline;"><strong>Remarks</strong></span></p>
<p>Looks like, I stripe this line and completely forgot what was intention for this post. Well, any code snippets and what I learned from Scala, partially from Clojure, Lisp and so one, will left for the next time (when I&#8217;ll have this time). I should split this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2011/12/partial-formalizations-and-the-lemmings-game/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Thoughts on Scala Type Inference</title>
		<link>http://www.apleben.com/2011/08/thoughts-on-scala-type-inference/</link>
		<comments>http://www.apleben.com/2011/08/thoughts-on-scala-type-inference/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 19:25:34 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[manipulations]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[type_inference]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=341</guid>
		<description><![CDATA[There is no any images today, except maybe one. I particularly have a little brainstorming and maybe somebody would be interested too. Let&#8217;s try to scarcely touch the Scala type inference on small practical example. In the Scala code snippets below I will provide a three methods with a short explanation in terms of the [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2011/08/scale_type8.png" width="240" />
		</p><p><img class="alignleft size-medium wp-image-340" title="Because of this inference we begin to talk about things like..." src="http://www.apleben.com/wp-content/uploads/2011/08/DSC00358-300x266.jpg" alt="" width="300" height="266" />There is no any images today, except maybe one. I particularly have a little brainstorming and maybe somebody would be interested too. Let&#8217;s try to scarcely touch the Scala type inference on small practical example.</p>
<p>In the Scala code snippets below I will provide a three methods with a short explanation in terms of the Scala type inference.</p>
<p>The first one is pretty straightforward, we&#8217;re defining some trivial logic and eventually Scala compiler (and interpreter, of course) will infer our return method type as <em>Int</em>, thus, there is no need to declare it explicitly. Here we go:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_Qdpja5  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_Qdpja5 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_Qdpja5table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_Qdpja5table td, .pygmentize_Qdpja5table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_Qdpja5 pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_Qdpja5 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_Qdpja5 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_Qdpja5 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_Qdpja5 .hll { background-color: #ffffcc }
.pygmentize_Qdpja5  { background: #f0f0f0; }
.pygmentize_Qdpja5 .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_Qdpja5 .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_Qdpja5 .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_Qdpja5 .o { color: #666666 } /* Operator */
.pygmentize_Qdpja5 .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_Qdpja5 .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_Qdpja5 .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_Qdpja5 .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_Qdpja5 .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_Qdpja5 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_Qdpja5 .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_Qdpja5 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_Qdpja5 .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_Qdpja5 .go { color: #808080 } /* Generic.Output */
.pygmentize_Qdpja5 .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_Qdpja5 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_Qdpja5 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_Qdpja5 .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_Qdpja5 .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_Qdpja5 .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_Qdpja5 .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_Qdpja5 .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_Qdpja5 .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_Qdpja5 .kt { color: #902000 } /* Keyword.Type */
.pygmentize_Qdpja5 .m { color: #40a070 } /* Literal.Number */
.pygmentize_Qdpja5 .s { color: #4070a0 } /* Literal.String */
.pygmentize_Qdpja5 .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_Qdpja5 .nb { color: #007020 } /* Name.Builtin */
.pygmentize_Qdpja5 .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_Qdpja5 .no { color: #60add5 } /* Name.Constant */
.pygmentize_Qdpja5 .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_Qdpja5 .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_Qdpja5 .ne { color: #007020 } /* Name.Exception */
.pygmentize_Qdpja5 .nf { color: #06287e } /* Name.Function */
.pygmentize_Qdpja5 .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_Qdpja5 .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_Qdpja5 .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_Qdpja5 .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_Qdpja5 .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_Qdpja5 .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_Qdpja5 .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_Qdpja5 .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_Qdpja5 .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_Qdpja5 .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_Qdpja5 .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_Qdpja5 .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_Qdpja5 .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_Qdpja5 .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_Qdpja5 .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_Qdpja5 .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_Qdpja5 .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_Qdpja5 .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_Qdpja5 .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_Qdpja5 .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_Qdpja5 .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_Qdpja5 .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_Qdpja5 .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_Qdpja5 .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_Qdpja5 .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_Qdpja5 .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_Qdpja5"><pre><span class="c1">//-------------------------------------------------------------------------------------------</span>
<span class="c1">// 1. A simple one</span>
<span class="c1">//-------------------------------------------------------------------------------------------</span>

<span class="k">def</span> <span class="n">max2</span><span class="o">(</span><span class="n">x</span><span class="k">:</span> <span class="kt">Int</span><span class="o">,</span> <span class="n">y</span><span class="k">:</span> <span class="kt">Int</span><span class="o">)</span> <span class="k">=</span> <span class="k">if</span> <span class="o">(</span><span class="n">x</span> <span class="o">&gt;</span> <span class="n">y</span><span class="o">)</span> <span class="n">x</span> <span class="k">else</span> <span class="n">y</span>
</pre></div>


<p>If we&#8217;ll define this method in the Scala interpreter and will make a call of the method by passing an Integer parameters, we&#8217;ll get something like this:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_tzkqMj  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_tzkqMj .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_tzkqMjtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_tzkqMjtable td, .pygmentize_tzkqMjtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_tzkqMj pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_tzkqMj {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_tzkqMj {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_tzkqMj td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_tzkqMj .hll { background-color: #49483e }
.pygmentize_tzkqMj  { background: #272822; color: #f8f8f2 }
.pygmentize_tzkqMj .c { color: #75715e } /* Comment */
.pygmentize_tzkqMj .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_tzkqMj .k { color: #66d9ef } /* Keyword */
.pygmentize_tzkqMj .l { color: #ae81ff } /* Literal */
.pygmentize_tzkqMj .n { color: #f8f8f2 } /* Name */
.pygmentize_tzkqMj .o { color: #f92672 } /* Operator */
.pygmentize_tzkqMj .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_tzkqMj .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_tzkqMj .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_tzkqMj .c1 { color: #75715e } /* Comment.Single */
.pygmentize_tzkqMj .cs { color: #75715e } /* Comment.Special */
.pygmentize_tzkqMj .ge { font-style: italic } /* Generic.Emph */
.pygmentize_tzkqMj .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_tzkqMj .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_tzkqMj .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_tzkqMj .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_tzkqMj .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_tzkqMj .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_tzkqMj .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_tzkqMj .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_tzkqMj .m { color: #ae81ff } /* Literal.Number */
.pygmentize_tzkqMj .s { color: #e6db74 } /* Literal.String */
.pygmentize_tzkqMj .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_tzkqMj .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_tzkqMj .nc { color: #a6e22e } /* Name.Class */
.pygmentize_tzkqMj .no { color: #66d9ef } /* Name.Constant */
.pygmentize_tzkqMj .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_tzkqMj .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_tzkqMj .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_tzkqMj .nf { color: #a6e22e } /* Name.Function */
.pygmentize_tzkqMj .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_tzkqMj .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_tzkqMj .nx { color: #a6e22e } /* Name.Other */
.pygmentize_tzkqMj .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_tzkqMj .nt { color: #f92672 } /* Name.Tag */
.pygmentize_tzkqMj .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_tzkqMj .ow { color: #f92672 } /* Operator.Word */
.pygmentize_tzkqMj .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_tzkqMj .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_tzkqMj .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_tzkqMj .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_tzkqMj .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_tzkqMj .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_tzkqMj .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_tzkqMj .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_tzkqMj .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_tzkqMj .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_tzkqMj .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_tzkqMj .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_tzkqMj .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_tzkqMj .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_tzkqMj .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_tzkqMj .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_tzkqMj .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_tzkqMj .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_tzkqMj .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_tzkqMj .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_tzkqMj .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_tzkqMj"><pre> <span class="n">scala</span><span class="o">&gt;</span> <span class="k">def</span> <span class="n">max2</span><span class="o">(</span><span class="n">x</span><span class="k">:</span> <span class="kt">Int</span><span class="o">,</span> <span class="n">y</span><span class="k">:</span> <span class="kt">Int</span><span class="o">)</span> <span class="k">=</span> <span class="k">if</span> <span class="o">(</span><span class="n">x</span> <span class="o">&gt;</span> <span class="n">y</span><span class="o">)</span> <span class="n">x</span> <span class="k">else</span> <span class="n">y</span>
 <span class="n">max2</span><span class="k">:</span> <span class="o">(</span><span class="kt">x:</span> <span class="kt">Int</span><span class="o">,</span> <span class="kt">y:</span> <span class="kt">Int</span><span class="o">)</span><span class="nc">Int</span>

 <span class="n">scala</span><span class="o">&gt;</span> <span class="n">max2</span><span class="o">(</span><span class="mi">23</span><span class="o">,</span><span class="mi">145</span><span class="o">)</span>
 <span class="n">res0</span><span class="k">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">145</span>
</pre></div>


<p>Pretty easy. Our return type is Int, as mentioned above. By going further, the second method is simply a side effect of the method call and return type of the method always would be a Unit (a void in Java):</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_GbqqdC  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_GbqqdC .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_GbqqdCtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_GbqqdCtable td, .pygmentize_GbqqdCtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_GbqqdC pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_GbqqdC {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_GbqqdC {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_GbqqdC td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_GbqqdC .hll { background-color: #ffffcc }
.pygmentize_GbqqdC  { background: #f0f0f0; }
.pygmentize_GbqqdC .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_GbqqdC .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_GbqqdC .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_GbqqdC .o { color: #666666 } /* Operator */
.pygmentize_GbqqdC .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_GbqqdC .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_GbqqdC .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_GbqqdC .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_GbqqdC .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_GbqqdC .ge { font-style: italic } /* Generic.Emph */
.pygmentize_GbqqdC .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_GbqqdC .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_GbqqdC .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_GbqqdC .go { color: #808080 } /* Generic.Output */
.pygmentize_GbqqdC .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_GbqqdC .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_GbqqdC .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_GbqqdC .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_GbqqdC .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_GbqqdC .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_GbqqdC .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_GbqqdC .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_GbqqdC .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_GbqqdC .kt { color: #902000 } /* Keyword.Type */
.pygmentize_GbqqdC .m { color: #40a070 } /* Literal.Number */
.pygmentize_GbqqdC .s { color: #4070a0 } /* Literal.String */
.pygmentize_GbqqdC .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_GbqqdC .nb { color: #007020 } /* Name.Builtin */
.pygmentize_GbqqdC .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_GbqqdC .no { color: #60add5 } /* Name.Constant */
.pygmentize_GbqqdC .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_GbqqdC .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_GbqqdC .ne { color: #007020 } /* Name.Exception */
.pygmentize_GbqqdC .nf { color: #06287e } /* Name.Function */
.pygmentize_GbqqdC .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_GbqqdC .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_GbqqdC .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_GbqqdC .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_GbqqdC .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_GbqqdC .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_GbqqdC .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_GbqqdC .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_GbqqdC .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_GbqqdC .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_GbqqdC .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_GbqqdC .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_GbqqdC .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_GbqqdC .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_GbqqdC .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_GbqqdC .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_GbqqdC .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_GbqqdC .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_GbqqdC .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_GbqqdC .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_GbqqdC .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_GbqqdC .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_GbqqdC .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_GbqqdC .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_GbqqdC .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_GbqqdC .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_GbqqdC"><pre><span class="c1">//-------------------------------------------------------------------------------------------</span>
<span class="c1">// 2. Side effect of the useless method call</span>
<span class="c1">//-------------------------------------------------------------------------------------------</span>

<span class="k">def</span> <span class="n">greet</span><span class="o">()</span> <span class="k">=</span> <span class="n">println</span><span class="o">(</span><span class="s">&quot;Hello, world!&quot;</span><span class="o">)</span>
</pre></div>


<p>Declaring and running in the Scala interpreter:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_XTyPFZ  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_XTyPFZ .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_XTyPFZtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_XTyPFZtable td, .pygmentize_XTyPFZtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_XTyPFZ pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_XTyPFZ {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_XTyPFZ {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_XTyPFZ td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_XTyPFZ .hll { background-color: #49483e }
.pygmentize_XTyPFZ  { background: #272822; color: #f8f8f2 }
.pygmentize_XTyPFZ .c { color: #75715e } /* Comment */
.pygmentize_XTyPFZ .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_XTyPFZ .k { color: #66d9ef } /* Keyword */
.pygmentize_XTyPFZ .l { color: #ae81ff } /* Literal */
.pygmentize_XTyPFZ .n { color: #f8f8f2 } /* Name */
.pygmentize_XTyPFZ .o { color: #f92672 } /* Operator */
.pygmentize_XTyPFZ .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_XTyPFZ .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_XTyPFZ .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_XTyPFZ .c1 { color: #75715e } /* Comment.Single */
.pygmentize_XTyPFZ .cs { color: #75715e } /* Comment.Special */
.pygmentize_XTyPFZ .ge { font-style: italic } /* Generic.Emph */
.pygmentize_XTyPFZ .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_XTyPFZ .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_XTyPFZ .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_XTyPFZ .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_XTyPFZ .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_XTyPFZ .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_XTyPFZ .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_XTyPFZ .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_XTyPFZ .m { color: #ae81ff } /* Literal.Number */
.pygmentize_XTyPFZ .s { color: #e6db74 } /* Literal.String */
.pygmentize_XTyPFZ .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_XTyPFZ .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_XTyPFZ .nc { color: #a6e22e } /* Name.Class */
.pygmentize_XTyPFZ .no { color: #66d9ef } /* Name.Constant */
.pygmentize_XTyPFZ .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_XTyPFZ .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_XTyPFZ .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_XTyPFZ .nf { color: #a6e22e } /* Name.Function */
.pygmentize_XTyPFZ .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_XTyPFZ .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_XTyPFZ .nx { color: #a6e22e } /* Name.Other */
.pygmentize_XTyPFZ .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_XTyPFZ .nt { color: #f92672 } /* Name.Tag */
.pygmentize_XTyPFZ .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_XTyPFZ .ow { color: #f92672 } /* Operator.Word */
.pygmentize_XTyPFZ .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_XTyPFZ .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_XTyPFZ .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_XTyPFZ .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_XTyPFZ .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_XTyPFZ .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_XTyPFZ .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_XTyPFZ .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_XTyPFZ .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_XTyPFZ .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_XTyPFZ .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_XTyPFZ .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_XTyPFZ .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_XTyPFZ .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_XTyPFZ .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_XTyPFZ .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_XTyPFZ .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_XTyPFZ .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_XTyPFZ .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_XTyPFZ .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_XTyPFZ .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_XTyPFZ"><pre> <span class="n">scala</span><span class="o">&gt;</span> <span class="k">def</span> <span class="n">greet</span><span class="o">()</span> <span class="k">=</span> <span class="n">println</span><span class="o">(</span><span class="s">&quot;Hello, world!&quot;</span><span class="o">)</span>
 <span class="n">greet</span><span class="k">:</span> <span class="o">()</span><span class="kt">Unit</span>

 <span class="n">scala</span><span class="o">&gt;</span> <span class="n">greet</span><span class="o">()</span>
 <span class="nc">Hello</span><span class="o">,</span> <span class="n">world</span><span class="o">!</span>
</pre></div>


<p>Hence, this method is pretty useless for us, but it shows how Scala compiler infers return types.</p>
<p>And the last one is an interesting thing&#8230; A type annotation must follow every function parameter, preceded by a colon, because the Scala compiler (and interpreter) does not infer function parameter types. A one interesting example initially was mentioned by <a href="http://twitter.com/#!/abreslav/status/99474204302385152" target="_blank">Andrey Breslav</a> (and maybe by somebody else, I don&#8217;t know), that makes a surprising revelation about Scala type inference. To not digress from a context and to be abridged, here is the example that deserve to think about:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_4IjFVp  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_4IjFVp .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_4IjFVptable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_4IjFVptable td, .pygmentize_4IjFVptable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_4IjFVp pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_4IjFVp {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_4IjFVp {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_4IjFVp td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_4IjFVp .hll { background-color: #ffffcc }
.pygmentize_4IjFVp  { background: #f0f0f0; }
.pygmentize_4IjFVp .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_4IjFVp .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_4IjFVp .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_4IjFVp .o { color: #666666 } /* Operator */
.pygmentize_4IjFVp .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_4IjFVp .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_4IjFVp .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_4IjFVp .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_4IjFVp .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_4IjFVp .ge { font-style: italic } /* Generic.Emph */
.pygmentize_4IjFVp .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_4IjFVp .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_4IjFVp .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_4IjFVp .go { color: #808080 } /* Generic.Output */
.pygmentize_4IjFVp .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_4IjFVp .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_4IjFVp .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_4IjFVp .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_4IjFVp .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_4IjFVp .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_4IjFVp .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_4IjFVp .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_4IjFVp .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_4IjFVp .kt { color: #902000 } /* Keyword.Type */
.pygmentize_4IjFVp .m { color: #40a070 } /* Literal.Number */
.pygmentize_4IjFVp .s { color: #4070a0 } /* Literal.String */
.pygmentize_4IjFVp .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_4IjFVp .nb { color: #007020 } /* Name.Builtin */
.pygmentize_4IjFVp .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_4IjFVp .no { color: #60add5 } /* Name.Constant */
.pygmentize_4IjFVp .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_4IjFVp .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_4IjFVp .ne { color: #007020 } /* Name.Exception */
.pygmentize_4IjFVp .nf { color: #06287e } /* Name.Function */
.pygmentize_4IjFVp .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_4IjFVp .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_4IjFVp .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_4IjFVp .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_4IjFVp .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_4IjFVp .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_4IjFVp .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_4IjFVp .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_4IjFVp .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_4IjFVp .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_4IjFVp .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_4IjFVp .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_4IjFVp .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_4IjFVp .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_4IjFVp .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_4IjFVp .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_4IjFVp .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_4IjFVp .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_4IjFVp .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_4IjFVp .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_4IjFVp .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_4IjFVp .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_4IjFVp .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_4IjFVp .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_4IjFVp .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_4IjFVp .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_4IjFVp"><pre><span class="c1">//-------------------------------------------------------------------------------------------</span>
<span class="c1">// 3. Interesting</span>
<span class="c1">//-------------------------------------------------------------------------------------------</span>

<span class="k">class</span> <span class="nc">InferTest</span> <span class="o">{</span>
    <span class="k">def</span> <span class="n">foo_bar</span><span class="o">[</span><span class="kt">T</span><span class="o">](</span><span class="n">x</span><span class="k">:</span> <span class="kt">T</span><span class="o">)</span><span class="k">:</span> <span class="kt">T</span> <span class="o">=</span> <span class="n">x</span>
    <span class="k">val</span> <span class="n">b</span> <span class="k">=</span> <span class="n">foo_bar</span><span class="o">()</span>
<span class="o">}</span>
</pre></div>


<p>Just stopping by and try to think at this point. As already mentioned, Scala does not infer a function parameter types. Therefore, we&#8217;re trying to make a call without a parameter declaration and the question is: <em>is this code will compile and if yes, then what is the type of &#8216;b&#8217; ? </em>Is it will be a Unit type, since we&#8217;re making a call of the method without a parameter (probably a Unit type) ? What do you think?</p>
<p>Your mind would be hamble fast as you&#8217;ll see a result. I&#8217;ll try to make it step by step. Firstly, let&#8217;s define a function in the Scala interpreter and make a method call with a String type:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_XwJg3R  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_XwJg3R .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_XwJg3Rtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_XwJg3Rtable td, .pygmentize_XwJg3Rtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_XwJg3R pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_XwJg3R {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_XwJg3R {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_XwJg3R td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_XwJg3R .hll { background-color: #49483e }
.pygmentize_XwJg3R  { background: #272822; color: #f8f8f2 }
.pygmentize_XwJg3R .c { color: #75715e } /* Comment */
.pygmentize_XwJg3R .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_XwJg3R .k { color: #66d9ef } /* Keyword */
.pygmentize_XwJg3R .l { color: #ae81ff } /* Literal */
.pygmentize_XwJg3R .n { color: #f8f8f2 } /* Name */
.pygmentize_XwJg3R .o { color: #f92672 } /* Operator */
.pygmentize_XwJg3R .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_XwJg3R .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_XwJg3R .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_XwJg3R .c1 { color: #75715e } /* Comment.Single */
.pygmentize_XwJg3R .cs { color: #75715e } /* Comment.Special */
.pygmentize_XwJg3R .ge { font-style: italic } /* Generic.Emph */
.pygmentize_XwJg3R .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_XwJg3R .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_XwJg3R .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_XwJg3R .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_XwJg3R .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_XwJg3R .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_XwJg3R .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_XwJg3R .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_XwJg3R .m { color: #ae81ff } /* Literal.Number */
.pygmentize_XwJg3R .s { color: #e6db74 } /* Literal.String */
.pygmentize_XwJg3R .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_XwJg3R .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_XwJg3R .nc { color: #a6e22e } /* Name.Class */
.pygmentize_XwJg3R .no { color: #66d9ef } /* Name.Constant */
.pygmentize_XwJg3R .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_XwJg3R .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_XwJg3R .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_XwJg3R .nf { color: #a6e22e } /* Name.Function */
.pygmentize_XwJg3R .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_XwJg3R .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_XwJg3R .nx { color: #a6e22e } /* Name.Other */
.pygmentize_XwJg3R .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_XwJg3R .nt { color: #f92672 } /* Name.Tag */
.pygmentize_XwJg3R .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_XwJg3R .ow { color: #f92672 } /* Operator.Word */
.pygmentize_XwJg3R .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_XwJg3R .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_XwJg3R .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_XwJg3R .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_XwJg3R .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_XwJg3R .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_XwJg3R .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_XwJg3R .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_XwJg3R .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_XwJg3R .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_XwJg3R .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_XwJg3R .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_XwJg3R .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_XwJg3R .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_XwJg3R .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_XwJg3R .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_XwJg3R .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_XwJg3R .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_XwJg3R .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_XwJg3R .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_XwJg3R .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_XwJg3R"><pre> <span class="n">scala</span><span class="o">&gt;</span> <span class="k">def</span> <span class="n">foo_bar</span><span class="o">[</span><span class="kt">T</span><span class="o">](</span><span class="n">x</span><span class="k">:</span> <span class="kt">T</span><span class="o">)</span><span class="k">:</span> <span class="kt">T</span> <span class="o">=</span> <span class="n">x</span>
 <span class="n">foo_bar</span><span class="k">:</span> <span class="err">[</span><span class="kt">T</span><span class="err">]</span><span class="o">(</span><span class="kt">x:</span> <span class="kt">T</span><span class="o">)</span><span class="kt">T</span>

 <span class="n">scala</span><span class="o">&gt;</span> <span class="n">foo_bar</span><span class="o">(</span><span class="s">&quot;Wow cool!&quot;</span><span class="o">)</span>
 <span class="n">res2</span><span class="k">:</span> <span class="kt">java.lang.String</span> <span class="o">=</span> <span class="nc">Wow</span> <span class="n">cool</span><span class="o">!</span>
</pre></div>


<p>Secondly, let&#8217;s make the same, but by passing Integer type instead:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_ex2Kvm  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_ex2Kvm .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_ex2Kvmtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_ex2Kvmtable td, .pygmentize_ex2Kvmtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_ex2Kvm pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_ex2Kvm {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_ex2Kvm {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_ex2Kvm td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_ex2Kvm .hll { background-color: #49483e }
.pygmentize_ex2Kvm  { background: #272822; color: #f8f8f2 }
.pygmentize_ex2Kvm .c { color: #75715e } /* Comment */
.pygmentize_ex2Kvm .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_ex2Kvm .k { color: #66d9ef } /* Keyword */
.pygmentize_ex2Kvm .l { color: #ae81ff } /* Literal */
.pygmentize_ex2Kvm .n { color: #f8f8f2 } /* Name */
.pygmentize_ex2Kvm .o { color: #f92672 } /* Operator */
.pygmentize_ex2Kvm .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_ex2Kvm .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_ex2Kvm .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_ex2Kvm .c1 { color: #75715e } /* Comment.Single */
.pygmentize_ex2Kvm .cs { color: #75715e } /* Comment.Special */
.pygmentize_ex2Kvm .ge { font-style: italic } /* Generic.Emph */
.pygmentize_ex2Kvm .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_ex2Kvm .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_ex2Kvm .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_ex2Kvm .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_ex2Kvm .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_ex2Kvm .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_ex2Kvm .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_ex2Kvm .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_ex2Kvm .m { color: #ae81ff } /* Literal.Number */
.pygmentize_ex2Kvm .s { color: #e6db74 } /* Literal.String */
.pygmentize_ex2Kvm .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_ex2Kvm .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_ex2Kvm .nc { color: #a6e22e } /* Name.Class */
.pygmentize_ex2Kvm .no { color: #66d9ef } /* Name.Constant */
.pygmentize_ex2Kvm .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_ex2Kvm .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_ex2Kvm .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_ex2Kvm .nf { color: #a6e22e } /* Name.Function */
.pygmentize_ex2Kvm .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_ex2Kvm .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_ex2Kvm .nx { color: #a6e22e } /* Name.Other */
.pygmentize_ex2Kvm .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_ex2Kvm .nt { color: #f92672 } /* Name.Tag */
.pygmentize_ex2Kvm .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_ex2Kvm .ow { color: #f92672 } /* Operator.Word */
.pygmentize_ex2Kvm .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_ex2Kvm .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_ex2Kvm .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_ex2Kvm .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_ex2Kvm .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_ex2Kvm .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_ex2Kvm .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_ex2Kvm .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_ex2Kvm .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_ex2Kvm .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_ex2Kvm .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_ex2Kvm .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_ex2Kvm .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_ex2Kvm .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_ex2Kvm .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_ex2Kvm .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_ex2Kvm .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_ex2Kvm .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_ex2Kvm .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_ex2Kvm .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_ex2Kvm .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_ex2Kvm"><pre><span class="n">scala</span><span class="o">&gt;</span> <span class="n">foo_bar</span><span class="o">(</span><span class="mi">9955</span><span class="o">)</span>
<span class="n">res3</span><span class="k">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">9955</span>
</pre></div>


<p>Surprisingly very simple. A tension on both cortex hemispheres will grow up dramatically, when we&#8217;ll try to make a compulsive method call without a passing through any parameters. Ready?:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_hfyxXV  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_hfyxXV .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_hfyxXVtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_hfyxXVtable td, .pygmentize_hfyxXVtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_hfyxXV pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_hfyxXV {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_hfyxXV {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_hfyxXV td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_hfyxXV .hll { background-color: #49483e }
.pygmentize_hfyxXV  { background: #272822; color: #f8f8f2 }
.pygmentize_hfyxXV .c { color: #75715e } /* Comment */
.pygmentize_hfyxXV .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_hfyxXV .k { color: #66d9ef } /* Keyword */
.pygmentize_hfyxXV .l { color: #ae81ff } /* Literal */
.pygmentize_hfyxXV .n { color: #f8f8f2 } /* Name */
.pygmentize_hfyxXV .o { color: #f92672 } /* Operator */
.pygmentize_hfyxXV .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_hfyxXV .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_hfyxXV .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_hfyxXV .c1 { color: #75715e } /* Comment.Single */
.pygmentize_hfyxXV .cs { color: #75715e } /* Comment.Special */
.pygmentize_hfyxXV .ge { font-style: italic } /* Generic.Emph */
.pygmentize_hfyxXV .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_hfyxXV .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_hfyxXV .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_hfyxXV .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_hfyxXV .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_hfyxXV .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_hfyxXV .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_hfyxXV .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_hfyxXV .m { color: #ae81ff } /* Literal.Number */
.pygmentize_hfyxXV .s { color: #e6db74 } /* Literal.String */
.pygmentize_hfyxXV .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_hfyxXV .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_hfyxXV .nc { color: #a6e22e } /* Name.Class */
.pygmentize_hfyxXV .no { color: #66d9ef } /* Name.Constant */
.pygmentize_hfyxXV .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_hfyxXV .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_hfyxXV .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_hfyxXV .nf { color: #a6e22e } /* Name.Function */
.pygmentize_hfyxXV .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_hfyxXV .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_hfyxXV .nx { color: #a6e22e } /* Name.Other */
.pygmentize_hfyxXV .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_hfyxXV .nt { color: #f92672 } /* Name.Tag */
.pygmentize_hfyxXV .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_hfyxXV .ow { color: #f92672 } /* Operator.Word */
.pygmentize_hfyxXV .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_hfyxXV .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_hfyxXV .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_hfyxXV .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_hfyxXV .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_hfyxXV .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_hfyxXV .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_hfyxXV .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_hfyxXV .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_hfyxXV .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_hfyxXV .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_hfyxXV .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_hfyxXV .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_hfyxXV .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_hfyxXV .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_hfyxXV .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_hfyxXV .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_hfyxXV .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_hfyxXV .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_hfyxXV .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_hfyxXV .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_hfyxXV"><pre> <span class="n">scala</span><span class="o">&gt;</span> <span class="n">foo_bar</span><span class="o">()</span>

 <span class="n">scala</span><span class="o">&gt;</span>
</pre></div>


<p>I was very astonished by seeing this result! It is even not a Unit type, it&#8217;s a type of nothing, a black hole. But, we can make a call.</p>
<p><strong><span style="text-decoration: underline;">Conclusion</span></strong></p>
<p>As a corollary, you might see, that a confine of type safeness is slightly blurred for now and could even cause a sleep deprivation in some cases. Scala type safeness and complexity are still becoming to be a point of contention ever since. However, it does not mean, that you should expunge this wonderful language from your toolbox, instead you must to be aware of. I am wholeheartedly wish you not be trapped in such situations, but who knows&#8230;</p>
<p>Don&#8217;t know how are you, but me slightly suffering from a finger and mental fatigue at the end of this post. So, that&#8217;s enough for today!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2011/08/thoughts-on-scala-type-inference/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>IntelliJ IDEA on JRockit</title>
		<link>http://www.apleben.com/2011/05/intellij-idea-on-jrockit/</link>
		<comments>http://www.apleben.com/2011/05/intellij-idea-on-jrockit/#comments</comments>
		<pubDate>Thu, 26 May 2011 10:19:27 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[IntelliJ]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JRockit]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=331</guid>
		<description><![CDATA[Not so long ago by following Henrik Stahl&#8217;s blog, I read this great news: JRockit is Now Free (and Other Java License Updates). Whoa! This is actually a great news! &#8220;But why?&#8221; you could possible ask me. Well, this is very good question and the answer is very simple &#8211; JRockit is a part of [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2011/05/run.png" width="240" />
		</p><p>Not so long ago by following <a href="http://blogs.oracle.com/henrik/" target="_blank">Henrik Stahl&#8217;s</a> blog, I read this great news: <a title="JRockit is free for mass" href="http://blogs.oracle.com/henrik/entry/jrockit_is_now_free_and" target="_blank">JRockit is Now Free (and Other Java License Updates).</a> Whoa! This is actually a great news! <em>&#8220;But why?&#8221;</em> you could possible ask me. Well, this is very good question and the answer is very simple &#8211; <a title="JRockit" href="http://www.oracle.com/us/products/middleware/application-server/jrockit/index.html" target="_blank">JRockit</a> is a part of the Oracle Middleware, this is <em><span style="text-decoration: underline;">the most advanced, fast and powerful JVM on the planet Earth</span></em>. Seriously, he is.</p>
<p>My personal experience by running <a href="http://www.jetbrains.com/idea/" target="_blank">IntelliJ IDEA</a> with <a href="http://www.oracle.com/us/products/middleware/application-server/jrockit/index.html" target="_blank">JRockit</a> on Linux, I will try to cover here. However, JRockit also might be runnable on Windows systems and on <del datetime="2011-05-26T14:32:59+00:00">Sun</del> <a title="Solaris" href="http://www.oracle.com/technetwork/server-storage/solaris11/overview/index.html" target="_blank">Oracle Solaris</a> too. Nonetheless, I will not explain how to do that, because to get <a href="http://www.jetbrains.com/idea/" target="_blank">IntelliJ</a> running on Solaris is a little bit tricky, involves some hacking (but possible) and time consuming. To get running this configuration on Windows is almost the same, just take a look at appropriate <em>&#8220;bat&#8221;</em> files and get rid unnecessary stuff. Everything is possible.</p>
<p>By the way, even on my old computer with <a title="Kubuntu" href="http://www.kubuntu.org/" target="_blank">Linux Kubuntu</a>, IntelliJ is running on JRockit much faster and smoother, than on HotSpot based JVM. On my latest Toshiba laptop he is flying now, like a native application written on C/C++. Amazing experience.</p>
<p>Unfortunately, there is not possible currently to run JRockit on Mac OS X, albeit these two JVMs will be merged somehow in future and would be available through Oracle JDK and Open JDK. At least client version would be available on Mac OS X, or I so believe. Eventually, just await a little bit.</p>
<p>The official Oracle press release about JDK Roadmap for Advancing JavaSE you may <a href="http://www.oracle.com/us/corporate/press/173782" target="_blank">find here</a> and <a href="http://blogs.oracle.com/henrik/entry/oracles_jvm_strategy" target="_blank">Oracle&#8217;s JVM Strategy</a>.</p>
<p><strong><span style="text-decoration: underline;">Getting Started.</span></strong></p>
<p><img class="alignleft size-medium wp-image-332" title="IDEA_JRockit" src="http://www.apleben.com/wp-content/uploads/2011/05/IDEA_JRockit-300x202.png" alt="" width="300" height="202" />First of all, we should download the <a href="http://www.oracle.com/technetwork/middleware/jrockit/downloads/index.html" target="_blank">Oracle JRockit JDK 28.1.3</a> and install it somewhere in our system (Home or System directory. It doesn&#8217;t make any sense). Next what we should to do &#8211; is configure IntelliJ IDEA startup script, because IntelliJ will not automatically found and use JRockit. We need directly makes it possible. So, navigating to our IntelliJ installation directory and opening file with name <em><span style="text-decoration: underline;">idea.sh</span></em> in <em><span style="text-decoration: underline;">&#8216;IntelliJ IDEA install dir&#8217;/bin/</span></em>. Then, specifying the location of the JDK installation directly:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_uarNmx  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_uarNmx .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_uarNmxtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_uarNmxtable td, .pygmentize_uarNmxtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_uarNmx pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_uarNmx {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_uarNmx {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_uarNmx td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_uarNmx .hll { background-color: #ffffcc }
.pygmentize_uarNmx  { background: #f0f0f0; }
.pygmentize_uarNmx .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_uarNmx .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_uarNmx .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_uarNmx .o { color: #666666 } /* Operator */
.pygmentize_uarNmx .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_uarNmx .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_uarNmx .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_uarNmx .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_uarNmx .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_uarNmx .ge { font-style: italic } /* Generic.Emph */
.pygmentize_uarNmx .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_uarNmx .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_uarNmx .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_uarNmx .go { color: #808080 } /* Generic.Output */
.pygmentize_uarNmx .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_uarNmx .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_uarNmx .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_uarNmx .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_uarNmx .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_uarNmx .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_uarNmx .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_uarNmx .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_uarNmx .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_uarNmx .kt { color: #902000 } /* Keyword.Type */
.pygmentize_uarNmx .m { color: #40a070 } /* Literal.Number */
.pygmentize_uarNmx .s { color: #4070a0 } /* Literal.String */
.pygmentize_uarNmx .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_uarNmx .nb { color: #007020 } /* Name.Builtin */
.pygmentize_uarNmx .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_uarNmx .no { color: #60add5 } /* Name.Constant */
.pygmentize_uarNmx .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_uarNmx .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_uarNmx .ne { color: #007020 } /* Name.Exception */
.pygmentize_uarNmx .nf { color: #06287e } /* Name.Function */
.pygmentize_uarNmx .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_uarNmx .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_uarNmx .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_uarNmx .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_uarNmx .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_uarNmx .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_uarNmx .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_uarNmx .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_uarNmx .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_uarNmx .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_uarNmx .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_uarNmx .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_uarNmx .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_uarNmx .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_uarNmx .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_uarNmx .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_uarNmx .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_uarNmx .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_uarNmx .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_uarNmx .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_uarNmx .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_uarNmx .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_uarNmx .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_uarNmx .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_uarNmx .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_uarNmx .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_uarNmx"><pre><span class="c"># For clarity reason we providing a full path here.</span>
<span class="c"># You can make a simlink to the JRockit JDK like: IDEA_JDK=&quot;/usr/java/&quot;</span>
<span class="nv">IDEA_JDK</span><span class="o">=</span><span class="s2">&quot;/home/apupeikis/bin/jrockit-jdk1.6.0_24-R28.1.3-4.0.1/&quot;</span>

<span class="c"># Clarify JDK location before this line</span>
<span class="k">if</span> <span class="o">[</span> -z <span class="s2">&quot;$IDEA_JDK&quot;</span> <span class="o">]</span>; <span class="k">then</span>
<span class="k">    </span><span class="nv">IDEA_JDK</span><span class="o">=</span><span class="nv">$JDK_HOME</span>

...
<span class="c"># For brevity reason</span>
</pre></div>


<p>After we made our changes starting IntelliJ, waiting a little and getting that friendly message:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_9CCasa  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_9CCasa .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_9CCasatable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_9CCasatable td, .pygmentize_9CCasatable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_9CCasa pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_9CCasa {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_9CCasa {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_9CCasa td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_9CCasa .hll { background-color: #49483e }
.pygmentize_9CCasa  { background: #272822; color: #f8f8f2 }
.pygmentize_9CCasa .c { color: #75715e } /* Comment */
.pygmentize_9CCasa .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_9CCasa .k { color: #66d9ef } /* Keyword */
.pygmentize_9CCasa .l { color: #ae81ff } /* Literal */
.pygmentize_9CCasa .n { color: #f8f8f2 } /* Name */
.pygmentize_9CCasa .o { color: #f92672 } /* Operator */
.pygmentize_9CCasa .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_9CCasa .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_9CCasa .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_9CCasa .c1 { color: #75715e } /* Comment.Single */
.pygmentize_9CCasa .cs { color: #75715e } /* Comment.Special */
.pygmentize_9CCasa .ge { font-style: italic } /* Generic.Emph */
.pygmentize_9CCasa .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_9CCasa .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_9CCasa .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_9CCasa .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_9CCasa .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_9CCasa .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_9CCasa .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_9CCasa .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_9CCasa .m { color: #ae81ff } /* Literal.Number */
.pygmentize_9CCasa .s { color: #e6db74 } /* Literal.String */
.pygmentize_9CCasa .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_9CCasa .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_9CCasa .nc { color: #a6e22e } /* Name.Class */
.pygmentize_9CCasa .no { color: #66d9ef } /* Name.Constant */
.pygmentize_9CCasa .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_9CCasa .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_9CCasa .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_9CCasa .nf { color: #a6e22e } /* Name.Function */
.pygmentize_9CCasa .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_9CCasa .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_9CCasa .nx { color: #a6e22e } /* Name.Other */
.pygmentize_9CCasa .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_9CCasa .nt { color: #f92672 } /* Name.Tag */
.pygmentize_9CCasa .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_9CCasa .ow { color: #f92672 } /* Operator.Word */
.pygmentize_9CCasa .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_9CCasa .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_9CCasa .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_9CCasa .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_9CCasa .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_9CCasa .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_9CCasa .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_9CCasa .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_9CCasa .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_9CCasa .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_9CCasa .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_9CCasa .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_9CCasa .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_9CCasa .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_9CCasa .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_9CCasa .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_9CCasa .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_9CCasa .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_9CCasa .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_9CCasa .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_9CCasa .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_9CCasa"><pre><span class="go"> apupeikis@Wunderwaffen:~$ /home/apupeikis/bin/JetBrains/IntelliJ\ IDEA/bin/idea.sh</span>

<span class="go"> [WARN ][jrockit] MaxPermSize=250m ignored: Not a valid option for JRockit</span>
<span class="go"> Unknown option or illegal argument: -XX:ReservedCodeCacheSize=64m.</span>
<span class="go"> Please check for incorrect spelling or review documentation of startup options.</span>

<span class="go"> Could not create the Java virtual machine.</span>
</pre></div>


<p>Well, what&#8217;s next and <del datetime="2011-05-26T14:32:59+00:00">what are hell is going on here?!</del> what is going wrong here exactly?!</p>
<p>Previous message in console are self explanatory. JVM flags &#8211; <span style="text-decoration: underline;"><em>-XX:MaxPermSize</em></span> and <span style="text-decoration: underline;"><em>-XX:ReservedCodeCacheSize</em></span> is are HotSpot JVM flags and they do not supported in JRockit JVM. In HotSpot JVM this is are PermGen handling flags, that is necessary, otherwise you will suffer from PermGen exceptions every time:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_Eq8aZN  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_Eq8aZN .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_Eq8aZNtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_Eq8aZNtable td, .pygmentize_Eq8aZNtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_Eq8aZN pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_Eq8aZN {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_Eq8aZN {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_Eq8aZN td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_Eq8aZN .hll { background-color: #49483e }
.pygmentize_Eq8aZN  { background: #272822; color: #f8f8f2 }
.pygmentize_Eq8aZN .c { color: #75715e } /* Comment */
.pygmentize_Eq8aZN .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_Eq8aZN .k { color: #66d9ef } /* Keyword */
.pygmentize_Eq8aZN .l { color: #ae81ff } /* Literal */
.pygmentize_Eq8aZN .n { color: #f8f8f2 } /* Name */
.pygmentize_Eq8aZN .o { color: #f92672 } /* Operator */
.pygmentize_Eq8aZN .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_Eq8aZN .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_Eq8aZN .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_Eq8aZN .c1 { color: #75715e } /* Comment.Single */
.pygmentize_Eq8aZN .cs { color: #75715e } /* Comment.Special */
.pygmentize_Eq8aZN .ge { font-style: italic } /* Generic.Emph */
.pygmentize_Eq8aZN .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_Eq8aZN .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_Eq8aZN .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_Eq8aZN .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_Eq8aZN .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_Eq8aZN .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_Eq8aZN .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_Eq8aZN .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_Eq8aZN .m { color: #ae81ff } /* Literal.Number */
.pygmentize_Eq8aZN .s { color: #e6db74 } /* Literal.String */
.pygmentize_Eq8aZN .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_Eq8aZN .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_Eq8aZN .nc { color: #a6e22e } /* Name.Class */
.pygmentize_Eq8aZN .no { color: #66d9ef } /* Name.Constant */
.pygmentize_Eq8aZN .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_Eq8aZN .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_Eq8aZN .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_Eq8aZN .nf { color: #a6e22e } /* Name.Function */
.pygmentize_Eq8aZN .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_Eq8aZN .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_Eq8aZN .nx { color: #a6e22e } /* Name.Other */
.pygmentize_Eq8aZN .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_Eq8aZN .nt { color: #f92672 } /* Name.Tag */
.pygmentize_Eq8aZN .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_Eq8aZN .ow { color: #f92672 } /* Operator.Word */
.pygmentize_Eq8aZN .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_Eq8aZN .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_Eq8aZN .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_Eq8aZN .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_Eq8aZN .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_Eq8aZN .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_Eq8aZN .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_Eq8aZN .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_Eq8aZN .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_Eq8aZN .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_Eq8aZN .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_Eq8aZN .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_Eq8aZN .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_Eq8aZN .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_Eq8aZN .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_Eq8aZN .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_Eq8aZN .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_Eq8aZN .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_Eq8aZN .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_Eq8aZN .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_Eq8aZN .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_Eq8aZN"><pre><span class="go"> [info] Error occurred during initialization of VM</span>
<span class="go"> [info] Could not reserve enough space for object heap</span>
<span class="go"> [395 javajni.c] [error] CreateJavaVM Failed</span>
</pre></div>


<p>At the same time Oracle&#8217;s JRockit JVM not suffering from such troubles and its PermGen allocation can be Gigs in size. You can increase the PermGen size with HotSpot, but that it&#8217;s not a problem primarily due to memory leaks. PermGen space gets eaten up aggressively by applications which implement heavy use of Reflection like IDEs. As an another typical example, if you have a Spring/Hibernate application running in Tomcat, be prepared to bump that PermGen space up a lot. Alternatively, you can switch to JRockit which handling PermGen differently than <del datetime="2011-05-26T14:32:59+00:00">Sun&#8217;s</del> HotSpot based JVM. It generally has better performance as well. This is exactly that we&#8217;re trying to do!</p>
<p>To solve the problem, open the file <em><span style="text-decoration: underline;">idea.vmoptions</span></em> in <em><span style="text-decoration: underline;">&#8216;IntelliJ IDEA install dir&#8217;/bin/</span></em> and delete or comment these two flags:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_zXGlvs  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_zXGlvs .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_zXGlvstable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_zXGlvstable td, .pygmentize_zXGlvstable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_zXGlvs pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_zXGlvs {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_zXGlvs {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_zXGlvs td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_zXGlvs .hll { background-color: #ffffcc }
.pygmentize_zXGlvs  { background: #f0f0f0; }
.pygmentize_zXGlvs .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_zXGlvs .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_zXGlvs .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_zXGlvs .o { color: #666666 } /* Operator */
.pygmentize_zXGlvs .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_zXGlvs .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_zXGlvs .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_zXGlvs .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_zXGlvs .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_zXGlvs .ge { font-style: italic } /* Generic.Emph */
.pygmentize_zXGlvs .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_zXGlvs .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_zXGlvs .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_zXGlvs .go { color: #808080 } /* Generic.Output */
.pygmentize_zXGlvs .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_zXGlvs .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_zXGlvs .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_zXGlvs .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_zXGlvs .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_zXGlvs .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_zXGlvs .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_zXGlvs .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_zXGlvs .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_zXGlvs .kt { color: #902000 } /* Keyword.Type */
.pygmentize_zXGlvs .m { color: #40a070 } /* Literal.Number */
.pygmentize_zXGlvs .s { color: #4070a0 } /* Literal.String */
.pygmentize_zXGlvs .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_zXGlvs .nb { color: #007020 } /* Name.Builtin */
.pygmentize_zXGlvs .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_zXGlvs .no { color: #60add5 } /* Name.Constant */
.pygmentize_zXGlvs .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_zXGlvs .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_zXGlvs .ne { color: #007020 } /* Name.Exception */
.pygmentize_zXGlvs .nf { color: #06287e } /* Name.Function */
.pygmentize_zXGlvs .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_zXGlvs .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_zXGlvs .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_zXGlvs .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_zXGlvs .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_zXGlvs .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_zXGlvs .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_zXGlvs .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_zXGlvs .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_zXGlvs .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_zXGlvs .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_zXGlvs .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_zXGlvs .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_zXGlvs .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_zXGlvs .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_zXGlvs .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_zXGlvs .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_zXGlvs .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_zXGlvs .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_zXGlvs .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_zXGlvs .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_zXGlvs .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_zXGlvs .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_zXGlvs .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_zXGlvs .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_zXGlvs .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_zXGlvs"><pre>-XX:MaxPermSize<span class="o">=</span>250m
-XX:ReservedCodeCacheSize<span class="o">=</span>64m
</pre></div>


<p>That&#8217;s it! Run IntelliJ IDEA again and notice &#8211; he will bring faster and run much smoother. Eventually, we&#8217;ve got <span style="color: #666699;"><em>the most intelligent Java IDE</em></span> running on <span style="color: #666699;"><em>the most advanced JVM</em></span> &#8211; beautiful tandem, isn&#8217;t it? Enjoy.</p>
<p><strong><span style="text-decoration: underline;">More Information</span></strong></p>
<p><a href="http://www.apleben.com/wp-content/uploads/2011/05/cover.jpg"><img class="alignleft size-medium wp-image-333" title="cover" src="http://www.apleben.com/wp-content/uploads/2011/05/cover-231x300.jpg" alt="" width="231" height="300" /></a>To get rid any blind luck by running new JVM, that you&#8217;re not familiar with, check out the <a title="comand-line reference" href="http://download.oracle.com/docs/cd/E15289_01/doc.40/e15062/toc.htm" target="_blank">JRockit Command-Line Reference</a>.</p>
<p>And of course, to know more about Oracle&#8217;s JRockit JVM, Mission Control (that is packed with JVM), other features and how most of the JVMs actually works, I suggest you to check out the book &#8211; <em><span style="text-decoration: underline;">Oracle JRockit: The Definitive Guide</span></em> by <a href="http://twitter.com/#!/marcuslagergren" target="_blank">Marcus Lagergren</a> and <a href="http://twitter.com/#!/marcushirt" target="_blank">Marcus Hirt</a> (on <a title="Definitive Guide" href="http://www.amazon.com/Oracle-JRockit-Definitive-Marcus-Hirt/dp/1847198066" target="_blank">Amazon</a> and on <a title="Definitive Guide" href="http://www.packtpub.com/oracle-jrockit-definitive-guide/book" target="_blank">Packt</a>). So, enjoy these new features, capabilities and upcoming JDK 7 release this summer!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2011/05/intellij-idea-on-jrockit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multi-threaded painting on the Canvas?</title>
		<link>http://www.apleben.com/2011/05/multi-threaded-painting-on-the-canvas/</link>
		<comments>http://www.apleben.com/2011/05/multi-threaded-painting-on-the-canvas/#comments</comments>
		<pubDate>Tue, 10 May 2011 08:37:22 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[multi-threading]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=325</guid>
		<description><![CDATA[Like in Java Swing applications, in Android apps everything is happening, when the system creates a thread of execution for the application, named genuinely &#8220;main thread&#8221;. Also, this thread is very important, because it&#8217;s in charge of dispatching events to the appropriate user interface widgets (like clicks and touches), including drawing events (exactly what we [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2011/05/pencil_2561.png" width="240" />
		</p><p>Like in Java Swing applications, in Android apps everything is happening, when the system creates a thread of execution for the application, named genuinely &#8220;main thread&#8221;. Also, this thread is very important, because it&#8217;s in charge of dispatching events to the appropriate user interface widgets (like clicks and touches), including drawing events (exactly what we are looking for). It is also a thread in which your application interacts with components from the Android UI toolkit. When your application performing some intensive work, this single thread can yield poor performance (and be sure, it will happen), if you&#8217;re not properly handling such tasks. From the user&#8217;s perspective, the application appears to hang. Even worse, if the UI thread is blocked for more than a few seconds (about 5 seconds currently) a user is presented with the infamous &#8220;application not responding&#8221; (ANR) message dialog. So sad&#8230;</p>
<p>Apparently, user will uninstall your application and fill out the comment field in Android Market with something like this &#8211;&gt; <del>this app is a Bullshit I ever seen! What a crock!</del> the application just hung when I pressed a download button! Will not recommend to anybody to install it.</p>
<p>The clue is one &#8211; the Andoid UI toolkit is <strong><em>not</em></strong> thread-safe. To be honest, you must not manipulate your UI from a non UI (main) thread &#8211; instead, you must do all manipulations with user interfaces from the UI thread only! Therefore, there are simply two rules for Android single thread model:</p>
<ul>
<li>Do not block the UI thread;</li>
<li>Do not access the Android UI toolkit from outside the UI thread;</li>
<li><del>Do not drink a beer when you developing your apps and do not believe in miracles.</del></li>
</ul>
<p>So, to abandon these slightly uncomfortable situations we will do somethings like&#8230;</p>
<p><strong><span style="text-decoration: underline;">Worker Threads. What about Canvas, I asking you?!</span></strong></p>
<p>Nothing about shiny and glossy Canvas here due to big boring of the section.</p>
<p>Every of your intensive and long running operations should to be performed outside of the UI thread, not pausing user interfaces, not blocking it and let users just to be happy. Thus, if you have any operations that are not instantaneous, every such operations must be performed on a &#8220;background&#8221; or &#8220;worker&#8221; threads. This is a vital to success.</p>
<p>As an example, below is a sample code to perform some of such operations. We downloading an image from external resource and displaying it in <a title="ImageView Droid docs" href="http://d.android.com/reference/android/widget/ImageView.html" target="_blank">ImageView</a>:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_iaphC8  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_iaphC8 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_iaphC8table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_iaphC8table td, .pygmentize_iaphC8table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_iaphC8 pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_iaphC8 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_iaphC8 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_iaphC8 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_iaphC8 .hll { background-color: #ffffcc }
.pygmentize_iaphC8  { background: #f0f0f0; }
.pygmentize_iaphC8 .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_iaphC8 .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_iaphC8 .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_iaphC8 .o { color: #666666 } /* Operator */
.pygmentize_iaphC8 .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_iaphC8 .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_iaphC8 .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_iaphC8 .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_iaphC8 .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_iaphC8 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_iaphC8 .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_iaphC8 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_iaphC8 .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_iaphC8 .go { color: #808080 } /* Generic.Output */
.pygmentize_iaphC8 .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_iaphC8 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_iaphC8 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_iaphC8 .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_iaphC8 .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_iaphC8 .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_iaphC8 .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_iaphC8 .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_iaphC8 .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_iaphC8 .kt { color: #902000 } /* Keyword.Type */
.pygmentize_iaphC8 .m { color: #40a070 } /* Literal.Number */
.pygmentize_iaphC8 .s { color: #4070a0 } /* Literal.String */
.pygmentize_iaphC8 .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_iaphC8 .nb { color: #007020 } /* Name.Builtin */
.pygmentize_iaphC8 .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_iaphC8 .no { color: #60add5 } /* Name.Constant */
.pygmentize_iaphC8 .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_iaphC8 .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_iaphC8 .ne { color: #007020 } /* Name.Exception */
.pygmentize_iaphC8 .nf { color: #06287e } /* Name.Function */
.pygmentize_iaphC8 .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_iaphC8 .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_iaphC8 .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_iaphC8 .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_iaphC8 .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_iaphC8 .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_iaphC8 .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_iaphC8 .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_iaphC8 .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_iaphC8 .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_iaphC8 .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_iaphC8 .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_iaphC8 .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_iaphC8 .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_iaphC8 .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_iaphC8 .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_iaphC8 .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_iaphC8 .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_iaphC8 .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_iaphC8 .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_iaphC8 .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_iaphC8 .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_iaphC8 .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_iaphC8 .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_iaphC8 .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_iaphC8 .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_iaphC8"><pre><span class="kd">private</span> <span class="n">ImageView</span> <span class="n">imageView</span><span class="o">;</span>
<span class="c1">// ...</span>

<span class="kd">public</span> <span class="kt">void</span> <span class="nf">onDoingSomething</span><span class="o">()</span> <span class="o">{</span>
    <span class="k">new</span> <span class="nf">Thread</span><span class="o">(</span><span class="k">new</span> <span class="n">Runnable</span><span class="o">()</span> <span class="o">{</span>
        <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span>
            <span class="kd">final</span> <span class="n">Bitmap</span> <span class="n">b</span> <span class="o">=</span> <span class="n">loadImageFromOutside</span><span class="o">(</span><span class="s">&quot;http://mycloud.com/image.png&quot;</span><span class="o">);</span>
            <span class="n">imageView</span><span class="o">.</span><span class="na">setImageBitmap</span><span class="o">(</span><span class="n">b</span><span class="o">);</span>
        <span class="o">}</span>
    <span class="o">}).</span><span class="na">start</span><span class="o">();</span>
<span class="o">}</span>
</pre></div>


<p>Well, something went wrong here&#8230; This code possible will block your application&#8217;s UI thread someday. But, what exactly is wrong here?</p>
<p>Everything seems to be fine and looks like so. However, this code violates the second rule of the single-threaded model: <em>do not access the Android UI toolkit from outside the UI thread</em> — this sample modifies the <em>ImageView</em> from the worker thread, instead of the UI thread. This is not only breaks the rules, although we think it&#8217;s just a bug, but it makes users very unhappy and generates absolutely free and disruptive ads for our application. Anybody will regret about spent time and this is only the last part of a trouble. As a worst things, what possibly might happen &#8211; you will cripple user&#8217;s data in a various ways and then user will hate you! I guarantee it to you!</p>
<p>The short fix is to deal with UI thread properly. Next methods would be unbelievably helpful:</p>
<ul>
<li><a title="On UI thread" href="http://d.android.com/reference/android/app/Activity.html#runOnUiThread(java.lang.Runnable)" target="_blank">Activity.runOnUiThread(Runnable)</a></li>
<li><a title="Post it on UI thread" href="http://d.android.com/reference/android/view/View.html#post(java.lang.Runnable)" target="_blank">View.post(Runnable)</a></li>
<li><a title="Post, but Delayed" href="http://d.android.com/reference/android/view/View.html#postDelayed(java.lang.Runnable,%20long)" target="_blank">View.postDelayed(Runnable, long)</a></li>
</ul>
<p>Knowledge of these methods will help you a lot and possibly save some time. How to fix the code above? Simple:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_PukQnP  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_PukQnP .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_PukQnPtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_PukQnPtable td, .pygmentize_PukQnPtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_PukQnP pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_PukQnP {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_PukQnP {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_PukQnP td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_PukQnP .hll { background-color: #ffffcc }
.pygmentize_PukQnP  { background: #f0f0f0; }
.pygmentize_PukQnP .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_PukQnP .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_PukQnP .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_PukQnP .o { color: #666666 } /* Operator */
.pygmentize_PukQnP .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_PukQnP .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_PukQnP .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_PukQnP .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_PukQnP .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_PukQnP .ge { font-style: italic } /* Generic.Emph */
.pygmentize_PukQnP .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_PukQnP .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_PukQnP .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_PukQnP .go { color: #808080 } /* Generic.Output */
.pygmentize_PukQnP .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_PukQnP .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_PukQnP .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_PukQnP .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_PukQnP .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_PukQnP .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_PukQnP .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_PukQnP .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_PukQnP .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_PukQnP .kt { color: #902000 } /* Keyword.Type */
.pygmentize_PukQnP .m { color: #40a070 } /* Literal.Number */
.pygmentize_PukQnP .s { color: #4070a0 } /* Literal.String */
.pygmentize_PukQnP .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_PukQnP .nb { color: #007020 } /* Name.Builtin */
.pygmentize_PukQnP .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_PukQnP .no { color: #60add5 } /* Name.Constant */
.pygmentize_PukQnP .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_PukQnP .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_PukQnP .ne { color: #007020 } /* Name.Exception */
.pygmentize_PukQnP .nf { color: #06287e } /* Name.Function */
.pygmentize_PukQnP .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_PukQnP .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_PukQnP .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_PukQnP .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_PukQnP .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_PukQnP .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_PukQnP .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_PukQnP .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_PukQnP .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_PukQnP .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_PukQnP .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_PukQnP .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_PukQnP .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_PukQnP .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_PukQnP .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_PukQnP .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_PukQnP .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_PukQnP .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_PukQnP .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_PukQnP .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_PukQnP .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_PukQnP .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_PukQnP .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_PukQnP .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_PukQnP .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_PukQnP .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_PukQnP"><pre><span class="kd">private</span> <span class="n">ImageView</span> <span class="n">imageView</span><span class="o">;</span>
<span class="c1">// ...</span>

<span class="kd">public</span> <span class="kt">void</span> <span class="nf">onDoingSomethingGood</span><span class="o">()</span> <span class="o">{</span>
    <span class="k">new</span> <span class="nf">Thread</span><span class="o">(</span><span class="k">new</span> <span class="n">Runnable</span><span class="o">()</span> <span class="o">{</span>
        <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span>
            <span class="kd">final</span> <span class="n">Bitmap</span> <span class="n">bitmap</span> <span class="o">=</span> <span class="n">loadImageFromOutside</span><span class="o">(</span><span class="s">&quot;http://mycloud.com/image.png&quot;</span><span class="o">);</span>
            <span class="n">imageView</span><span class="o">.</span><span class="na">post</span><span class="o">(</span><span class="k">new</span> <span class="n">Runnable</span><span class="o">()</span> <span class="o">{</span>
                <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span>
                    <span class="n">imageView</span><span class="o">.</span><span class="na">setImageBitmap</span><span class="o">(</span><span class="n">bitmap</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">});</span>
        <span class="o">}</span>
    <span class="o">}).</span><span class="na">start</span><span class="o">();</span>
<span class="o">}</span>
</pre></div>


<p>Now it implemented how it should be and everybody happy.</p>
<p><strong><span style="text-decoration: underline;">Slightly funny usage of AsyncTask. Still no Canvas here?</span></strong></p>
<p><img class="alignleft size-full wp-image-329" title="slightly funny" src="http://www.apleben.com/wp-content/uploads/2011/05/slightly_funny.jpg" alt="" width="219" height="225" />Unfortunately, no Canvas and here. I told you!</p>
<p>Perhaps, the best solution is to extend <a title="AsyncTask" href="http://d.android.com/reference/android/os/AsyncTask.html" target="_blank">AsyncTask</a> class, which allows you to perform asynchronous tasks on your beautifully designed user interface. It performs the blocking operations in a worker thread and then publishes the results on the UI thread, without requiring you to handle threads and/or handlers yourself. By the way, if you familiar with <a title="Java SE Desktop" href="http://java.sun.com/javase/technologies/desktop/" target="_blank">Java Swing</a> you may notice, that <a title="AsyncTask" href="http://d.android.com/reference/android/os/AsyncTask.html" target="_blank">AsyncTask</a> class are very similar to <a title="Shiny SwingWorker in vacuum" href="http://download.oracle.com/javase/6/docs/api/javax/swing/SwingWorker.html" target="_blank">SwingWorker</a> class with a small modifications. There is another class, that should to be consider to use in your worker thread, to process messages delivered form the UI thread. And here it is &#8211; a <a title="Handler" href="http://d.android.com/reference/android/os/Handler.html" target="_blank">Handler</a>! Nonetheless, please, read these boring materials by yourself. We are going to the funny sections&#8230;</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Painting on the Canvas. Trying to make this Multi-threaded.</span></strong></p>
<p><em>What is a Canvas?</em> Canvas is a layer or abstraction layer, that is used to draw an Android View and possibly to draw your own custom graphics.</p>
<p><em>Why I should use Canvas?</em> Well, here is possible answers on this very good question:</p>
<ul>
<li>To <a title="Everything is Custom!" href="http://www.apleben.com/2011/01/custom-android-view-the-definition/" target="_blank">build custom components</a> or your own implementation of the existing Views by extending one. Some <a title="Building Custom Components" href="http://d.android.com/guide/topics/ui/custom-components.html" target="_blank">info on DevGuide</a> too. Satisfaction not guaranteed, though;</li>
<li>To paint some custom graphics on the existing components, through state changes of this component (possibly an overlay);</li>
<li>To paint an Overlay on the <a title="MapView" href="http://code.google.com/android/add-ons/google-apis/reference/com/google/android/maps/MapView.html" target="_blank">MapView</a>;</li>
<li>Direct pixels painting like in Game development;</li>
<li>To do something incredibly interesting, that I still don&#8217;t know about. So, let me know about these very exciting ideas, that I didn&#8217;t heard of, yet!</li>
</ul>
<p><em>Are you concerned now?</em> In most cases you just should overwrite the <a title="Draw here" href="http://d.android.com/reference/android/view/View.html#onDraw(android.graphics.Canvas)" target="_blank">onDraw()</a> method and implement any drawing code here. Besides the basic approach, take a look at &#8220;build custom components&#8221; manuals and other documentation or books, that you will find interesting to yourself. I don&#8217;t know any of them in Android way&#8230;</p>
<p>As a possible option to draw on Canvas in Multi-Threaded way is &#8211; to extend <a title="SurfaceView" href="http://developer.android.com/reference/android/view/SurfaceView.html" target="_blank">SurfaceView</a> class, implement <a title="Callback" href="http://developer.android.com/reference/android/view/SurfaceHolder.Callback.html" target="_blank">SurfaceHolder.Callback</a> class&#8217; callback methods and create your custom thread to deal with glossy Canvas. Simple, isn&#8217;t it?</p>
<p><em>I am so tired from your stupid ramblings! Just show me the code!!!</em></p>
<p>You right, no more ramblings&#8230; here is the code:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_wue00w  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_wue00w .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_wue00wtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_wue00wtable td, .pygmentize_wue00wtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_wue00w pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_wue00w {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_wue00w {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_wue00w td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_wue00w .hll { background-color: #ffffcc }
.pygmentize_wue00w  { background: #f0f0f0; }
.pygmentize_wue00w .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_wue00w .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_wue00w .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_wue00w .o { color: #666666 } /* Operator */
.pygmentize_wue00w .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_wue00w .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_wue00w .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_wue00w .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_wue00w .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_wue00w .ge { font-style: italic } /* Generic.Emph */
.pygmentize_wue00w .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_wue00w .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_wue00w .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_wue00w .go { color: #808080 } /* Generic.Output */
.pygmentize_wue00w .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_wue00w .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_wue00w .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_wue00w .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_wue00w .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_wue00w .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_wue00w .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_wue00w .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_wue00w .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_wue00w .kt { color: #902000 } /* Keyword.Type */
.pygmentize_wue00w .m { color: #40a070 } /* Literal.Number */
.pygmentize_wue00w .s { color: #4070a0 } /* Literal.String */
.pygmentize_wue00w .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_wue00w .nb { color: #007020 } /* Name.Builtin */
.pygmentize_wue00w .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_wue00w .no { color: #60add5 } /* Name.Constant */
.pygmentize_wue00w .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_wue00w .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_wue00w .ne { color: #007020 } /* Name.Exception */
.pygmentize_wue00w .nf { color: #06287e } /* Name.Function */
.pygmentize_wue00w .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_wue00w .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_wue00w .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_wue00w .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_wue00w .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_wue00w .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_wue00w .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_wue00w .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_wue00w .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_wue00w .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_wue00w .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_wue00w .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_wue00w .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_wue00w .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_wue00w .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_wue00w .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_wue00w .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_wue00w .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_wue00w .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_wue00w .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_wue00w .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_wue00w .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_wue00w .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_wue00w .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_wue00w .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_wue00w .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_wue00wtable"><tr><td class="linenos pygmentize_wue00w"><div class="linenodiv pygmentize_wue00w"><pre> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95</pre></div></td><td class="code"><div class="pygmentize_wue00w"><pre><span class="kn">import</span> <span class="nn">android.content.Context</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.graphics.Canvas</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.view.SurfaceHolder</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.view.SurfaceView</span><span class="o">;</span>

<span class="kd">public</span> <span class="kd">class</span> <span class="nc">SurfaceViewCanvas</span> <span class="kd">extends</span> <span class="n">SurfaceView</span>
                     <span class="kd">implements</span> <span class="n">SurfaceHolder</span><span class="o">.</span><span class="na">Callback</span> <span class="o">{</span>
    <span class="kd">private</span> <span class="n">SurfaceHolder</span> <span class="n">holder</span><span class="o">;</span>
    <span class="kd">private</span> <span class="n">SurfaceViewThread</span> <span class="n">surfaceViewThread</span><span class="o">;</span>
    <span class="kd">private</span> <span class="kt">boolean</span> <span class="n">hasSurface</span><span class="o">;</span>

    <span class="n">SurfaceViewCanvas</span><span class="o">(</span><span class="n">Context</span> <span class="n">context</span><span class="o">)</span> <span class="o">{</span>
        <span class="kd">super</span><span class="o">(</span><span class="n">context</span><span class="o">);</span>
        <span class="n">init</span><span class="o">();</span>
    <span class="o">}</span>

    <span class="c1">// Implementing all callback methods below</span>
    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">resume</span><span class="o">()</span> <span class="o">{</span>
        <span class="c1">// Create and start the graphics update thread</span>
        <span class="k">if</span> <span class="o">(</span><span class="n">surfaceViewThread</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
            <span class="n">surfaceViewThread</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SurfaceViewThread</span><span class="o">();</span>
            <span class="k">if</span> <span class="o">(</span><span class="n">hasSurface</span><span class="o">)</span>
                <span class="n">surfaceViewThread</span><span class="o">.</span><span class="na">start</span><span class="o">();</span>
        <span class="o">}</span>
    <span class="o">}</span>

    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">pause</span><span class="o">()</span> <span class="o">{</span>
        <span class="c1">// Stop the graphics update thread</span>
        <span class="k">if</span> <span class="o">(</span><span class="n">surfaceViewThread</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
            <span class="n">surfaceViewThread</span><span class="o">.</span><span class="na">requestExitAndWait</span><span class="o">();</span>
            <span class="n">surfaceViewThread</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">}</span>

    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">surfaceCreated</span><span class="o">(</span><span class="n">SurfaceHolder</span> <span class="n">holder</span><span class="o">)</span> <span class="o">{</span>
        <span class="n">hasSurface</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="n">surfaceViewThread</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span>
            <span class="n">surfaceViewThread</span><span class="o">.</span><span class="na">start</span><span class="o">();</span>
    <span class="o">}</span>

    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">surfaceDestroyed</span><span class="o">(</span><span class="n">SurfaceHolder</span> <span class="n">holder</span><span class="o">)</span> <span class="o">{</span>
        <span class="n">hasSurface</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
        <span class="n">pause</span><span class="o">();</span>
    <span class="o">}</span>

    <span class="kd">public</span> <span class="kt">void</span> <span class="nf">surfaceChanged</span><span class="o">(</span><span class="n">SurfaceHolder</span> <span class="n">holder</span><span class="o">,</span> <span class="kt">int</span> <span class="n">format</span><span class="o">,</span> <span class="kt">int</span> <span class="n">w</span><span class="o">,</span> <span class="kt">int</span> <span class="n">h</span><span class="o">)</span> <span class="o">{</span>
        <span class="k">if</span> <span class="o">(</span><span class="n">surfaceViewThread</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span>
            <span class="n">surfaceViewThread</span><span class="o">.</span><span class="na">onWindowResize</span><span class="o">(</span><span class="n">w</span><span class="o">,</span> <span class="n">h</span><span class="o">);</span>
    <span class="o">}</span>

    <span class="kd">private</span> <span class="kt">void</span> <span class="nf">init</span><span class="o">()</span> <span class="o">{</span>
        <span class="c1">// Create a new SurfaceHolder and assign this class as its callback</span>
        <span class="n">holder</span> <span class="o">=</span> <span class="n">getHolder</span><span class="o">();</span>
        <span class="n">holder</span><span class="o">.</span><span class="na">addCallback</span><span class="o">(</span><span class="k">this</span><span class="o">);</span>
        <span class="n">hasSurface</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
    <span class="o">}</span>

    <span class="kd">private</span> <span class="kd">final</span> <span class="kd">class</span> <span class="nc">SurfaceViewThread</span> <span class="kd">extends</span> <span class="n">Thread</span> <span class="o">{</span>
        <span class="kd">private</span> <span class="kt">boolean</span> <span class="n">done</span><span class="o">;</span>

        <span class="n">SurfaceViewThread</span><span class="o">()</span> <span class="o">{</span>
            <span class="kd">super</span><span class="o">();</span>
            <span class="n">done</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="nd">@Override</span>
        <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span>
            <span class="n">SurfaceHolder</span> <span class="n">surfaceHolder</span> <span class="o">=</span> <span class="n">holder</span><span class="o">;</span>

            <span class="c1">// Repeat the drawing loop until the thread is stopped</span>
            <span class="k">while</span> <span class="o">(!</span><span class="n">done</span><span class="o">)</span> <span class="o">{</span>
                <span class="c1">// Lock the surface and return the canvas to draw onto</span>
                <span class="n">Canvas</span> <span class="n">canvas</span> <span class="o">=</span> <span class="n">surfaceHolder</span><span class="o">.</span><span class="na">lockCanvas</span><span class="o">();</span>

                <span class="c1">// TODO: Perform some Draws on the Canvas. Whatever you want!</span>
                <span class="c1">// Unlock the canvas and render the result</span>
                <span class="n">surfaceHolder</span><span class="o">.</span><span class="na">unlockCanvasAndPost</span><span class="o">(</span><span class="n">canvas</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">}</span>

        <span class="kd">public</span> <span class="kt">void</span> <span class="nf">requestExitAndWait</span><span class="o">()</span> <span class="o">{</span>
            <span class="c1">// Mark this thread as complete and wait it to finish himself</span>
            <span class="n">done</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="k">try</span> <span class="o">{</span>
                <span class="n">join</span><span class="o">();</span>
            <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">InterruptedException</span> <span class="n">ignored</span><span class="o">)</span> <span class="o">{</span>
            <span class="o">}</span>
        <span class="o">}</span>

        <span class="kd">public</span> <span class="kt">void</span> <span class="nf">onWindowResize</span><span class="o">(</span><span class="kt">int</span> <span class="n">w</span><span class="o">,</span> <span class="kt">int</span> <span class="n">h</span><span class="o">)</span> <span class="o">{</span>
            <span class="c1">// Deal with a change in the new surface size</span>
        <span class="o">}</span>
    <span class="o">}</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2011/05/multi-threaded-painting-on-the-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Own Git repository with modern Web View</title>
		<link>http://www.apleben.com/2011/03/own-private-git-repository-with-modern-web-view/</link>
		<comments>http://www.apleben.com/2011/03/own-private-git-repository-with-modern-web-view/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 15:24:43 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[DVCS]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[warehouse]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=313</guid>
		<description><![CDATA[Let us suppose: we need our own private Git repository running on our remote server. It might be our own hardware in our own office, servers room or it can be a Virtual Private Server(s) running on side of our hosting provider, Cloud Servers or whatever you want. That even could be a dedicated or [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2011/03/final.jpg" width="240" />
		</p><p>Let us suppose: we need our own private Git repository running on our remote server. It might be our own hardware in our own office, servers room or it can be a <a title="Linux VServer" href="http://linux-vserver.org/Welcome_to_Linux-VServer.org" target="_blank">Virtual Private Server(s)</a> running on side of our hosting provider, <a title="rackspace cloud" href="http://www.rackspace.com/cloud/" target="_blank">Cloud Servers</a> or whatever you want. That even could be a <a title="rackspace" href="http://www.rackspace.com/index.php" target="_blank">dedicated</a> or <a title="dreamhost" href="http://www.dreamhost.com/hosting.html" target="_blank">shared hosting</a>, it doesn&#8217;t sucks! No matter, what Server(s) (except one simple and intuitive rule: <em><span style="text-decoration: underline;">NO Windows inside! It sucks!</span></em>) or hosting provider we use, a task is still the same: our own private Git repository. As an additional feature, we want to run with some modern Git Web View. The first question here &#8211; why just not use <a title="GitHub" href="https://github.com/" target="_blank">GitHub</a> as a service for our private and public repositories?! Possible answer here &#8211; I&#8217;m particularly using GitHub for public repositories, however, what if we want to have an unlimited number of collaborators and repositories??!! From this point look at the GitHub pricing now. Maybe we just do NOT want to pay for our private repositories and also, want to keep it in top secret. Yes, I&#8217;m a paranoid.</p>
<p><strong><span style="text-decoration: underline;">Technology Stack</span></strong></p>
<p>A brief overview of what we&#8217;ll use in this installation:</p>
<ul>
<li>Obviously a <a title="Git" href="http://git-scm.com/" target="_blank">Git</a>;</li>
<li><a title="Gitosis" href="https://wiki.archlinux.org/index.php/Gitosis" target="_blank">Gitosis</a> &#8211; for access control to our repositories;</li>
<li>Connection through SSH. In many cases <a title="OpenSSH" href="http://www.openssh.com/" target="_blank">OpenSSH</a> software on the server end. It should to be installed already. If not, do it yourself (if, for some mysterious reasons, you don&#8217;t know how to do that &#8211; do NOT ask me how and stop reading this). I&#8217;ll not explain how to configure authentication with WebDav here &#8211; Google it!;</li>
<li>For the Git Web View we will use <a title="Warehouse for Git" href="https://github.com/drcapulet/warehouse" target="_blank">Warehouse 2</a>, that is actually a complete rewrite of <a title="Warehouse for svn" href="http://github.com/entp/warehouse" target="_blank">original Warehouse for SVN</a> that is build for Git;</li>
<li><a title="Ruby SDK" href="http://www.ruby-lang.org/en/" target="_blank">Ruby</a> and <a title="RoR" href="http://rubyonrails.org/" target="_blank">Ruby on Rails</a>. If you&#8217;re running under shared hosting and of course, have not root access, check out if your provider supports Ruby and Rails installed on your server. If not, this is sad, because in such case you can install Ruby into user&#8217;s home directory, however, Rails installation will be very difficult or even impossible, because you&#8217;ll need at least Passenger installed and configured. Whatsoever, in many cases you will notice availability of Ruby on your server. But, if you&#8217;re using sharing hosting plan and hosting provider do NOT providing Rails support, I cannot help you. Pick another provider instead or switch to the <a title="Linux VServer" href="http://linux-vserver.org/Welcome_to_Linux-VServer.org" target="_blank">Virtual Private Server(s)</a>, <a title="rackspace cloud" href="http://www.rackspace.com/cloud/" target="_blank">Cloud Sever(s)</a>, whatever;</li>
<li>The Python 2.5 and Python setuptools package.</li>
</ul>
<p>That&#8217;s all what we need. Although, none of these steps are difficult, the number of steps themself, can be intimidating. Don&#8217;t let it get to you. If you make a mistake, wipe it clean and start over. Okay, lets go!</p>
<p><strong><span style="text-decoration: underline;">Git with Gitosis</span></strong></p>
<p>Git by itself, out of the box, provides no method of access control. If you know URL for a git repository, you can clone it. Without some mechanism of access control, you can commit to it as well. Gitosis is a wrapper that provides fine grained access control to your publicly visible git repositories.</p>
<p>You can configure Gitosis such that each user has different authentication and authorization levels for each repository in the set of repositories contained in the directories of a user account.</p>
<p>As first step, create a user account, in this example <em>githuber</em>, with shell access. This account will be used for the git repositories and nothing else. <em>Note, that after successfully installing Gitosis, you will </em><strong><em>NOT</em></strong><em> be able to login to this account.</em> You can login to a different user account and <em><span style="text-decoration: underline;">su</span></em> to this account if you need shell access.</p>
<p>If you are not already using SSH generated public and private keys, you will need to have SSH on your desktop computer. After installing SSH, you will need to generate the public/private key pair. Well, you need to get your desktop user public ssh key onto the remote server:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_z9stjf  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_z9stjf .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_z9stjftable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_z9stjftable td, .pygmentize_z9stjftable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_z9stjf pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_z9stjf {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_z9stjf {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_z9stjf td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_z9stjf .hll { background-color: #49483e }
.pygmentize_z9stjf  { background: #272822; color: #f8f8f2 }
.pygmentize_z9stjf .c { color: #75715e } /* Comment */
.pygmentize_z9stjf .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_z9stjf .k { color: #66d9ef } /* Keyword */
.pygmentize_z9stjf .l { color: #ae81ff } /* Literal */
.pygmentize_z9stjf .n { color: #f8f8f2 } /* Name */
.pygmentize_z9stjf .o { color: #f92672 } /* Operator */
.pygmentize_z9stjf .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_z9stjf .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_z9stjf .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_z9stjf .c1 { color: #75715e } /* Comment.Single */
.pygmentize_z9stjf .cs { color: #75715e } /* Comment.Special */
.pygmentize_z9stjf .ge { font-style: italic } /* Generic.Emph */
.pygmentize_z9stjf .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_z9stjf .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_z9stjf .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_z9stjf .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_z9stjf .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_z9stjf .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_z9stjf .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_z9stjf .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_z9stjf .m { color: #ae81ff } /* Literal.Number */
.pygmentize_z9stjf .s { color: #e6db74 } /* Literal.String */
.pygmentize_z9stjf .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_z9stjf .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_z9stjf .nc { color: #a6e22e } /* Name.Class */
.pygmentize_z9stjf .no { color: #66d9ef } /* Name.Constant */
.pygmentize_z9stjf .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_z9stjf .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_z9stjf .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_z9stjf .nf { color: #a6e22e } /* Name.Function */
.pygmentize_z9stjf .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_z9stjf .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_z9stjf .nx { color: #a6e22e } /* Name.Other */
.pygmentize_z9stjf .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_z9stjf .nt { color: #f92672 } /* Name.Tag */
.pygmentize_z9stjf .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_z9stjf .ow { color: #f92672 } /* Operator.Word */
.pygmentize_z9stjf .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_z9stjf .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_z9stjf .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_z9stjf .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_z9stjf .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_z9stjf .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_z9stjf .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_z9stjf .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_z9stjf .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_z9stjf .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_z9stjf .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_z9stjf .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_z9stjf .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_z9stjf .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_z9stjf .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_z9stjf .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_z9stjf .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_z9stjf .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_z9stjf .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_z9stjf .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_z9stjf .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_z9stjftable"><tr><td class="linenos pygmentize_z9stjf"><div class="linenodiv pygmentize_z9stjf"><pre>1
2</pre></div></td><td class="code"><div class="pygmentize_z9stjf"><pre><span class="go"> [local]$ ssh-keygen -t rsa</span>
<span class="go"> [local]$ scp ~/.ssh/id_rsa.pub githuber@example.com:~</span>
</pre></div>
</td></tr></table>

<p>If you already have a public/private key pair, then the first command will let you know and don&#8217;t bother over-writing it. <strong>NOTE:</strong> do <strong>NOT</strong> add your RSA public key to the Gitosis user&#8217;s <em>.ssh/authorized_keys</em>. If you do this, you can still access this new account after installation, but Gitosis will not able to let you push new repository, and you need to type full path when cloning <em>gitosis-admin.conf</em> later. Instead, use password to login this new account.</p>
<p><em><span style="text-decoration: underline;">Installing Git</span></em></p>
<p>Many hosting providers have Git already installed. Of course, a more recent release is suggested. However, if your server indicates its running 1.7, so just skip this step. Check out your Git version like this:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_KA9YrY  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_KA9YrY .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_KA9YrYtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_KA9YrYtable td, .pygmentize_KA9YrYtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_KA9YrY pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_KA9YrY {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_KA9YrY {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_KA9YrY td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_KA9YrY .hll { background-color: #49483e }
.pygmentize_KA9YrY  { background: #272822; color: #f8f8f2 }
.pygmentize_KA9YrY .c { color: #75715e } /* Comment */
.pygmentize_KA9YrY .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_KA9YrY .k { color: #66d9ef } /* Keyword */
.pygmentize_KA9YrY .l { color: #ae81ff } /* Literal */
.pygmentize_KA9YrY .n { color: #f8f8f2 } /* Name */
.pygmentize_KA9YrY .o { color: #f92672 } /* Operator */
.pygmentize_KA9YrY .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_KA9YrY .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_KA9YrY .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_KA9YrY .c1 { color: #75715e } /* Comment.Single */
.pygmentize_KA9YrY .cs { color: #75715e } /* Comment.Special */
.pygmentize_KA9YrY .ge { font-style: italic } /* Generic.Emph */
.pygmentize_KA9YrY .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_KA9YrY .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_KA9YrY .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_KA9YrY .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_KA9YrY .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_KA9YrY .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_KA9YrY .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_KA9YrY .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_KA9YrY .m { color: #ae81ff } /* Literal.Number */
.pygmentize_KA9YrY .s { color: #e6db74 } /* Literal.String */
.pygmentize_KA9YrY .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_KA9YrY .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_KA9YrY .nc { color: #a6e22e } /* Name.Class */
.pygmentize_KA9YrY .no { color: #66d9ef } /* Name.Constant */
.pygmentize_KA9YrY .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_KA9YrY .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_KA9YrY .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_KA9YrY .nf { color: #a6e22e } /* Name.Function */
.pygmentize_KA9YrY .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_KA9YrY .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_KA9YrY .nx { color: #a6e22e } /* Name.Other */
.pygmentize_KA9YrY .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_KA9YrY .nt { color: #f92672 } /* Name.Tag */
.pygmentize_KA9YrY .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_KA9YrY .ow { color: #f92672 } /* Operator.Word */
.pygmentize_KA9YrY .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_KA9YrY .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_KA9YrY .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_KA9YrY .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_KA9YrY .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_KA9YrY .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_KA9YrY .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_KA9YrY .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_KA9YrY .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_KA9YrY .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_KA9YrY .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_KA9YrY .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_KA9YrY .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_KA9YrY .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_KA9YrY .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_KA9YrY .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_KA9YrY .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_KA9YrY .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_KA9YrY .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_KA9YrY .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_KA9YrY .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_KA9YrYtable"><tr><td class="linenos pygmentize_KA9YrY"><div class="linenodiv pygmentize_KA9YrY"><pre>1
2
3
4</pre></div></td><td class="code"><div class="pygmentize_KA9YrY"><pre><span class="go"> [server]$ which git</span>
<span class="go"> /usr/bin/git</span>
<span class="go"> [server]$ git --version</span>
<span class="go"> git version 1.7.1</span>
</pre></div>
</td></tr></table>

<p>If there is no Git installed or version on your server 1.6 (or even less), then install Git following by these steps:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_7BVtmI  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_7BVtmI .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_7BVtmItable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_7BVtmItable td, .pygmentize_7BVtmItable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_7BVtmI pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_7BVtmI {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_7BVtmI {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_7BVtmI td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_7BVtmI .hll { background-color: #49483e }
.pygmentize_7BVtmI  { background: #272822; color: #f8f8f2 }
.pygmentize_7BVtmI .c { color: #75715e } /* Comment */
.pygmentize_7BVtmI .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_7BVtmI .k { color: #66d9ef } /* Keyword */
.pygmentize_7BVtmI .l { color: #ae81ff } /* Literal */
.pygmentize_7BVtmI .n { color: #f8f8f2 } /* Name */
.pygmentize_7BVtmI .o { color: #f92672 } /* Operator */
.pygmentize_7BVtmI .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_7BVtmI .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_7BVtmI .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_7BVtmI .c1 { color: #75715e } /* Comment.Single */
.pygmentize_7BVtmI .cs { color: #75715e } /* Comment.Special */
.pygmentize_7BVtmI .ge { font-style: italic } /* Generic.Emph */
.pygmentize_7BVtmI .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_7BVtmI .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_7BVtmI .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_7BVtmI .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_7BVtmI .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_7BVtmI .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_7BVtmI .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_7BVtmI .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_7BVtmI .m { color: #ae81ff } /* Literal.Number */
.pygmentize_7BVtmI .s { color: #e6db74 } /* Literal.String */
.pygmentize_7BVtmI .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_7BVtmI .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_7BVtmI .nc { color: #a6e22e } /* Name.Class */
.pygmentize_7BVtmI .no { color: #66d9ef } /* Name.Constant */
.pygmentize_7BVtmI .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_7BVtmI .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_7BVtmI .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_7BVtmI .nf { color: #a6e22e } /* Name.Function */
.pygmentize_7BVtmI .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_7BVtmI .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_7BVtmI .nx { color: #a6e22e } /* Name.Other */
.pygmentize_7BVtmI .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_7BVtmI .nt { color: #f92672 } /* Name.Tag */
.pygmentize_7BVtmI .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_7BVtmI .ow { color: #f92672 } /* Operator.Word */
.pygmentize_7BVtmI .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_7BVtmI .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_7BVtmI .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_7BVtmI .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_7BVtmI .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_7BVtmI .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_7BVtmI .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_7BVtmI .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_7BVtmI .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_7BVtmI .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_7BVtmI .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_7BVtmI .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_7BVtmI .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_7BVtmI .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_7BVtmI .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_7BVtmI .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_7BVtmI .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_7BVtmI .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_7BVtmI .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_7BVtmI .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_7BVtmI .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_7BVtmItable"><tr><td class="linenos pygmentize_7BVtmI"><div class="linenodiv pygmentize_7BVtmI"><pre>1
2
3
4
5
6
7</pre></div></td><td class="code"><div class="pygmentize_7BVtmI"><pre><span class="go"> [server]$ cd</span>
<span class="go"> [server]$ mkdir src; cd src</span>
<span class="go"> [server]$ wget http://kernel.org/pub/software/scm/git/git-1.7.4.tar.gz</span>
<span class="go"> [server]$ tar xzf git-1.7.4.tar.gz</span>
<span class="go"> [server]$ cd git-1.7.4</span>
<span class="go"> [server]$ ./configure -prefix=$HOME NO_MMAP=1</span>
<span class="go"> [server]$ make &amp;&amp; make install</span>
</pre></div>
</td></tr></table>

<p>These steps will install Git into your home directory. Hence, if you have root access, install Git into the system instead, with appropriate changes to the commands above (use <em>sudo</em> or type almost the same being a super user). <em><span style="text-decoration: underline;">Also note:</span></em> we&#8217;re using compilation flag <em><span style="text-decoration: underline;">NO_MMAP=1</span></em> only from installation into user&#8217;s home directory to prevent <em>procwatch</em> service to kill your Git daemon. Since Git while pushing process unpacking an objects and accommodating a lot of space, <em>procwatch</em> service may kill Git daemon without an error and you will not understand why. It&#8217;s very hard to catch. Just use this flag with installation as a non-privileged user.</p>
<p>For more information about Git configuration <a title="Git config" href="https://wincent.com/wiki/Git_quickstart" target="_blank">look at this</a>.</p>
<p><em><span style="text-decoration: underline;">Installing Python</span></em></p>
<p>Gitosis requires Python at version 2.4 or higher. If your server reports an appropriate version of Python, so again skip this step. If you&#8217;re unlucky in this way just follow steps below to install Python into user&#8217;s home directory (for super user just change commands as appropriate):</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_MU94vt  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_MU94vt .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_MU94vttable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_MU94vttable td, .pygmentize_MU94vttable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_MU94vt pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_MU94vt {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_MU94vt {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_MU94vt td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_MU94vt .hll { background-color: #49483e }
.pygmentize_MU94vt  { background: #272822; color: #f8f8f2 }
.pygmentize_MU94vt .c { color: #75715e } /* Comment */
.pygmentize_MU94vt .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_MU94vt .k { color: #66d9ef } /* Keyword */
.pygmentize_MU94vt .l { color: #ae81ff } /* Literal */
.pygmentize_MU94vt .n { color: #f8f8f2 } /* Name */
.pygmentize_MU94vt .o { color: #f92672 } /* Operator */
.pygmentize_MU94vt .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_MU94vt .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_MU94vt .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_MU94vt .c1 { color: #75715e } /* Comment.Single */
.pygmentize_MU94vt .cs { color: #75715e } /* Comment.Special */
.pygmentize_MU94vt .ge { font-style: italic } /* Generic.Emph */
.pygmentize_MU94vt .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_MU94vt .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_MU94vt .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_MU94vt .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_MU94vt .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_MU94vt .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_MU94vt .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_MU94vt .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_MU94vt .m { color: #ae81ff } /* Literal.Number */
.pygmentize_MU94vt .s { color: #e6db74 } /* Literal.String */
.pygmentize_MU94vt .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_MU94vt .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_MU94vt .nc { color: #a6e22e } /* Name.Class */
.pygmentize_MU94vt .no { color: #66d9ef } /* Name.Constant */
.pygmentize_MU94vt .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_MU94vt .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_MU94vt .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_MU94vt .nf { color: #a6e22e } /* Name.Function */
.pygmentize_MU94vt .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_MU94vt .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_MU94vt .nx { color: #a6e22e } /* Name.Other */
.pygmentize_MU94vt .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_MU94vt .nt { color: #f92672 } /* Name.Tag */
.pygmentize_MU94vt .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_MU94vt .ow { color: #f92672 } /* Operator.Word */
.pygmentize_MU94vt .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_MU94vt .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_MU94vt .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_MU94vt .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_MU94vt .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_MU94vt .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_MU94vt .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_MU94vt .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_MU94vt .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_MU94vt .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_MU94vt .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_MU94vt .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_MU94vt .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_MU94vt .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_MU94vt .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_MU94vt .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_MU94vt .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_MU94vt .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_MU94vt .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_MU94vt .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_MU94vt .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_MU94vttable"><tr><td class="linenos pygmentize_MU94vt"><div class="linenodiv pygmentize_MU94vt"><pre>1
2
3
4
5
6</pre></div></td><td class="code"><div class="pygmentize_MU94vt"><pre><span class="go"> [server]$ cd ~/src</span>
<span class="go"> [server]$ wget http://www.python.org/ftp/python/2.5.5/Python-2.5.5.tgz</span>
<span class="go"> [server]$ tar xzf Python-2.5.5.tgz</span>
<span class="go"> [server]$ cd Python-2.5.5</span>
<span class="go"> [server]$ ./configure --prefix=$HOME</span>
<span class="go"> [server]$ make &amp;&amp; make install</span>
</pre></div>
</td></tr></table>

<p><em><span style="text-decoration: underline;">Installing Python Install Tools</span></em></p>
<p>Gitosis is implemented in python and is packaged as a python package. The python install tools are required to install Gitosis. You need the install tools matching the release of python you are using.</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_jqnQMf  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_jqnQMf .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_jqnQMftable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_jqnQMftable td, .pygmentize_jqnQMftable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_jqnQMf pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_jqnQMf {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_jqnQMf {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_jqnQMf td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_jqnQMf .hll { background-color: #49483e }
.pygmentize_jqnQMf  { background: #272822; color: #f8f8f2 }
.pygmentize_jqnQMf .c { color: #75715e } /* Comment */
.pygmentize_jqnQMf .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_jqnQMf .k { color: #66d9ef } /* Keyword */
.pygmentize_jqnQMf .l { color: #ae81ff } /* Literal */
.pygmentize_jqnQMf .n { color: #f8f8f2 } /* Name */
.pygmentize_jqnQMf .o { color: #f92672 } /* Operator */
.pygmentize_jqnQMf .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_jqnQMf .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_jqnQMf .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_jqnQMf .c1 { color: #75715e } /* Comment.Single */
.pygmentize_jqnQMf .cs { color: #75715e } /* Comment.Special */
.pygmentize_jqnQMf .ge { font-style: italic } /* Generic.Emph */
.pygmentize_jqnQMf .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_jqnQMf .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_jqnQMf .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_jqnQMf .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_jqnQMf .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_jqnQMf .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_jqnQMf .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_jqnQMf .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_jqnQMf .m { color: #ae81ff } /* Literal.Number */
.pygmentize_jqnQMf .s { color: #e6db74 } /* Literal.String */
.pygmentize_jqnQMf .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_jqnQMf .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_jqnQMf .nc { color: #a6e22e } /* Name.Class */
.pygmentize_jqnQMf .no { color: #66d9ef } /* Name.Constant */
.pygmentize_jqnQMf .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_jqnQMf .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_jqnQMf .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_jqnQMf .nf { color: #a6e22e } /* Name.Function */
.pygmentize_jqnQMf .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_jqnQMf .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_jqnQMf .nx { color: #a6e22e } /* Name.Other */
.pygmentize_jqnQMf .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_jqnQMf .nt { color: #f92672 } /* Name.Tag */
.pygmentize_jqnQMf .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_jqnQMf .ow { color: #f92672 } /* Operator.Word */
.pygmentize_jqnQMf .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_jqnQMf .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_jqnQMf .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_jqnQMf .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_jqnQMf .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_jqnQMf .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_jqnQMf .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_jqnQMf .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_jqnQMf .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_jqnQMf .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_jqnQMf .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_jqnQMf .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_jqnQMf .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_jqnQMf .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_jqnQMf .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_jqnQMf .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_jqnQMf .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_jqnQMf .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_jqnQMf .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_jqnQMf .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_jqnQMf .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_jqnQMftable"><tr><td class="linenos pygmentize_jqnQMf"><div class="linenodiv pygmentize_jqnQMf"><pre>1
2
3
4
5</pre></div></td><td class="code"><div class="pygmentize_jqnQMf"><pre><span class="go"> [server]$ mkdir -p $HOME/lib/python2.5/site-packages</span>
<span class="go"> [server]$ export PYTHONPATH=$HOME/lib/python2.5/site-packages</span>
<span class="go"> [server]$ cd ~/src</span>
<span class="go"> [server]$ wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg</span>
<span class="go"> [server]$ sh setuptools-0.6c11-py2.5.egg --prefix=$HOME</span>
</pre></div>
</td></tr></table>

<p><em><span style="text-decoration: underline;">Installing Gitosis</span></em></p>
<p>You will clone the Gitosis repository and install from that repository. Also, you will set some persistent environment variables on your user account, that will cause the correct instances of git and python to be invoked.</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_AHswW2  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_AHswW2 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_AHswW2table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_AHswW2table td, .pygmentize_AHswW2table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_AHswW2 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_AHswW2 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_AHswW2 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_AHswW2 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_AHswW2 .hll { background-color: #49483e }
.pygmentize_AHswW2  { background: #272822; color: #f8f8f2 }
.pygmentize_AHswW2 .c { color: #75715e } /* Comment */
.pygmentize_AHswW2 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_AHswW2 .k { color: #66d9ef } /* Keyword */
.pygmentize_AHswW2 .l { color: #ae81ff } /* Literal */
.pygmentize_AHswW2 .n { color: #f8f8f2 } /* Name */
.pygmentize_AHswW2 .o { color: #f92672 } /* Operator */
.pygmentize_AHswW2 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_AHswW2 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_AHswW2 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_AHswW2 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_AHswW2 .cs { color: #75715e } /* Comment.Special */
.pygmentize_AHswW2 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_AHswW2 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_AHswW2 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_AHswW2 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_AHswW2 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_AHswW2 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_AHswW2 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_AHswW2 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_AHswW2 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_AHswW2 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_AHswW2 .s { color: #e6db74 } /* Literal.String */
.pygmentize_AHswW2 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_AHswW2 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_AHswW2 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_AHswW2 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_AHswW2 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_AHswW2 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_AHswW2 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_AHswW2 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_AHswW2 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_AHswW2 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_AHswW2 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_AHswW2 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_AHswW2 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_AHswW2 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_AHswW2 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_AHswW2 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_AHswW2 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_AHswW2 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_AHswW2 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_AHswW2 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_AHswW2 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_AHswW2 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_AHswW2 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_AHswW2 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_AHswW2 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_AHswW2 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_AHswW2 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_AHswW2 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_AHswW2 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_AHswW2 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_AHswW2 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_AHswW2 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_AHswW2 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_AHswW2 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_AHswW2 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_AHswW2 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_AHswW2table"><tr><td class="linenos pygmentize_AHswW2"><div class="linenodiv pygmentize_AHswW2"><pre>1
2
3
4
5
6
7
8
9</pre></div></td><td class="code"><div class="pygmentize_AHswW2"><pre><span class="go"> [server]$ git clone git://eagain.net/gitosis.git</span>
<span class="go"> [server]$ cd ~/src/gitosis/; export PATH=$HOME/bin:$PATH</span>
<span class="go"> [server]$ python setup.py install --prefix=$HOME; cd</span>
<span class="go"> [server]$ echo &quot;export PYTHONPATH=$HOME/lib/python2.5/site-packages/&quot; &gt;&gt; .bashrc</span>
<span class="go"> [server]$ echo &quot;export PYTHONPATH=$HOME/lib/python2.5/site-packages/&quot; &gt;&gt; .bash_profile</span>
<span class="go"> [server]$ echo &quot;export PATH=$HOME/bin:$PATH&quot; &gt;&gt; .bashrc</span>
<span class="go"> [server]$ echo &quot;export PATH=$HOME/bin:$PATH&quot; &gt;&gt; .bash_profile</span>
<span class="go"> [server]$ . ~/.bash_profile; gitosis-init &lt; id_rsa.pub</span>
<span class="go"> [server]$ chmod 750 $HOME/repositories/gitosis-admin.git/hooks/post-update</span>
</pre></div>
</td></tr></table>

<p>Don&#8217;t ask. It&#8217;s magic.</p>
<p><em><span style="text-decoration: underline;">Using Gitosis</span></em></p>
<p>Administering Gitosis uses Gitosis itself. Your public key gives you access to a repository called <em>gitosis-admin.git</em>. The gitosis-admin.git repository was created when you initialized Gitosis in the previous step. To get access to this repository and its files, you will clone that repository from your server user account to your desktop computer.</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_Nywc8R  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_Nywc8R .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_Nywc8Rtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_Nywc8Rtable td, .pygmentize_Nywc8Rtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_Nywc8R pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_Nywc8R {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_Nywc8R {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_Nywc8R td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_Nywc8R .hll { background-color: #49483e }
.pygmentize_Nywc8R  { background: #272822; color: #f8f8f2 }
.pygmentize_Nywc8R .c { color: #75715e } /* Comment */
.pygmentize_Nywc8R .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_Nywc8R .k { color: #66d9ef } /* Keyword */
.pygmentize_Nywc8R .l { color: #ae81ff } /* Literal */
.pygmentize_Nywc8R .n { color: #f8f8f2 } /* Name */
.pygmentize_Nywc8R .o { color: #f92672 } /* Operator */
.pygmentize_Nywc8R .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_Nywc8R .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_Nywc8R .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_Nywc8R .c1 { color: #75715e } /* Comment.Single */
.pygmentize_Nywc8R .cs { color: #75715e } /* Comment.Special */
.pygmentize_Nywc8R .ge { font-style: italic } /* Generic.Emph */
.pygmentize_Nywc8R .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_Nywc8R .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_Nywc8R .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_Nywc8R .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_Nywc8R .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_Nywc8R .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_Nywc8R .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_Nywc8R .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_Nywc8R .m { color: #ae81ff } /* Literal.Number */
.pygmentize_Nywc8R .s { color: #e6db74 } /* Literal.String */
.pygmentize_Nywc8R .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_Nywc8R .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_Nywc8R .nc { color: #a6e22e } /* Name.Class */
.pygmentize_Nywc8R .no { color: #66d9ef } /* Name.Constant */
.pygmentize_Nywc8R .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_Nywc8R .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_Nywc8R .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_Nywc8R .nf { color: #a6e22e } /* Name.Function */
.pygmentize_Nywc8R .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_Nywc8R .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_Nywc8R .nx { color: #a6e22e } /* Name.Other */
.pygmentize_Nywc8R .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_Nywc8R .nt { color: #f92672 } /* Name.Tag */
.pygmentize_Nywc8R .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_Nywc8R .ow { color: #f92672 } /* Operator.Word */
.pygmentize_Nywc8R .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_Nywc8R .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_Nywc8R .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_Nywc8R .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_Nywc8R .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_Nywc8R .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_Nywc8R .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_Nywc8R .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_Nywc8R .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_Nywc8R .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_Nywc8R .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_Nywc8R .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_Nywc8R .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_Nywc8R .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_Nywc8R .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_Nywc8R .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_Nywc8R .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_Nywc8R .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_Nywc8R .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_Nywc8R .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_Nywc8R .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_Nywc8Rtable"><tr><td class="linenos pygmentize_Nywc8R"><div class="linenodiv pygmentize_Nywc8R"><pre>1
2
3</pre></div></td><td class="code"><div class="pygmentize_Nywc8R"><pre><span class="go"> [local]$ mkdir ~/projects; cd ~/projects</span>
<span class="go"> [local]$ git clone githuber@example.com:gitosis-admin.git</span>
<span class="go"> [local]$ cd gitosis-admin</span>
</pre></div>
</td></tr></table>

<p><em>NOTE</em>: IF the above didn&#8217;t work for you, you have to change the &#8216;<em>git clone &#8230;</em>&#8216; line to:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_Y9nWPH  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_Y9nWPH .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_Y9nWPHtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_Y9nWPHtable td, .pygmentize_Y9nWPHtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_Y9nWPH pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_Y9nWPH {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_Y9nWPH {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_Y9nWPH td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_Y9nWPH .hll { background-color: #49483e }
.pygmentize_Y9nWPH  { background: #272822; color: #f8f8f2 }
.pygmentize_Y9nWPH .c { color: #75715e } /* Comment */
.pygmentize_Y9nWPH .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_Y9nWPH .k { color: #66d9ef } /* Keyword */
.pygmentize_Y9nWPH .l { color: #ae81ff } /* Literal */
.pygmentize_Y9nWPH .n { color: #f8f8f2 } /* Name */
.pygmentize_Y9nWPH .o { color: #f92672 } /* Operator */
.pygmentize_Y9nWPH .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_Y9nWPH .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_Y9nWPH .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_Y9nWPH .c1 { color: #75715e } /* Comment.Single */
.pygmentize_Y9nWPH .cs { color: #75715e } /* Comment.Special */
.pygmentize_Y9nWPH .ge { font-style: italic } /* Generic.Emph */
.pygmentize_Y9nWPH .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_Y9nWPH .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_Y9nWPH .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_Y9nWPH .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_Y9nWPH .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_Y9nWPH .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_Y9nWPH .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_Y9nWPH .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_Y9nWPH .m { color: #ae81ff } /* Literal.Number */
.pygmentize_Y9nWPH .s { color: #e6db74 } /* Literal.String */
.pygmentize_Y9nWPH .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_Y9nWPH .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_Y9nWPH .nc { color: #a6e22e } /* Name.Class */
.pygmentize_Y9nWPH .no { color: #66d9ef } /* Name.Constant */
.pygmentize_Y9nWPH .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_Y9nWPH .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_Y9nWPH .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_Y9nWPH .nf { color: #a6e22e } /* Name.Function */
.pygmentize_Y9nWPH .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_Y9nWPH .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_Y9nWPH .nx { color: #a6e22e } /* Name.Other */
.pygmentize_Y9nWPH .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_Y9nWPH .nt { color: #f92672 } /* Name.Tag */
.pygmentize_Y9nWPH .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_Y9nWPH .ow { color: #f92672 } /* Operator.Word */
.pygmentize_Y9nWPH .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_Y9nWPH .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_Y9nWPH .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_Y9nWPH .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_Y9nWPH .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_Y9nWPH .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_Y9nWPH .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_Y9nWPH .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_Y9nWPH .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_Y9nWPH .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_Y9nWPH .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_Y9nWPH .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_Y9nWPH .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_Y9nWPH .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_Y9nWPH .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_Y9nWPH .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_Y9nWPH .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_Y9nWPH .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_Y9nWPH .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_Y9nWPH .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_Y9nWPH .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_Y9nWPHtable"><tr><td class="linenos pygmentize_Y9nWPH"><div class="linenodiv pygmentize_Y9nWPH"><pre>1</pre></div></td><td class="code"><div class="pygmentize_Y9nWPH"><pre><span class="go"> [local]$ git clone githuber@example.com:~/repositories/gitosis-admin.git</span>
</pre></div>
</td></tr></table>

<p>You now have the Gitosis configuration files on your desktop computer. Using these files you will add users and repositories to your remote host repositories.</p>
<p><em><span style="text-decoration: underline;">Adding a Repository and (optional) User</span></em></p>
<p>To add a repository to your remote host, edit the <em>gitosis.conf</em> file in the gitosis-admin repository. After adding the repository to the Gitosis controls, you will create the repository and push it to the remote host.</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_3HQxdy  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_3HQxdy .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_3HQxdytable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_3HQxdytable td, .pygmentize_3HQxdytable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_3HQxdy pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_3HQxdy {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_3HQxdy {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_3HQxdy td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_3HQxdy .hll { background-color: #49483e }
.pygmentize_3HQxdy  { background: #272822; color: #f8f8f2 }
.pygmentize_3HQxdy .c { color: #75715e } /* Comment */
.pygmentize_3HQxdy .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_3HQxdy .k { color: #66d9ef } /* Keyword */
.pygmentize_3HQxdy .l { color: #ae81ff } /* Literal */
.pygmentize_3HQxdy .n { color: #f8f8f2 } /* Name */
.pygmentize_3HQxdy .o { color: #f92672 } /* Operator */
.pygmentize_3HQxdy .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_3HQxdy .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_3HQxdy .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_3HQxdy .c1 { color: #75715e } /* Comment.Single */
.pygmentize_3HQxdy .cs { color: #75715e } /* Comment.Special */
.pygmentize_3HQxdy .ge { font-style: italic } /* Generic.Emph */
.pygmentize_3HQxdy .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_3HQxdy .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_3HQxdy .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_3HQxdy .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_3HQxdy .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_3HQxdy .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_3HQxdy .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_3HQxdy .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_3HQxdy .m { color: #ae81ff } /* Literal.Number */
.pygmentize_3HQxdy .s { color: #e6db74 } /* Literal.String */
.pygmentize_3HQxdy .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_3HQxdy .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_3HQxdy .nc { color: #a6e22e } /* Name.Class */
.pygmentize_3HQxdy .no { color: #66d9ef } /* Name.Constant */
.pygmentize_3HQxdy .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_3HQxdy .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_3HQxdy .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_3HQxdy .nf { color: #a6e22e } /* Name.Function */
.pygmentize_3HQxdy .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_3HQxdy .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_3HQxdy .nx { color: #a6e22e } /* Name.Other */
.pygmentize_3HQxdy .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_3HQxdy .nt { color: #f92672 } /* Name.Tag */
.pygmentize_3HQxdy .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_3HQxdy .ow { color: #f92672 } /* Operator.Word */
.pygmentize_3HQxdy .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_3HQxdy .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_3HQxdy .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_3HQxdy .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_3HQxdy .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_3HQxdy .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_3HQxdy .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_3HQxdy .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_3HQxdy .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_3HQxdy .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_3HQxdy .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_3HQxdy .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_3HQxdy .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_3HQxdy .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_3HQxdy .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_3HQxdy .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_3HQxdy .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_3HQxdy .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_3HQxdy .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_3HQxdy .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_3HQxdy .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_3HQxdytable"><tr><td class="linenos pygmentize_3HQxdy"><div class="linenodiv pygmentize_3HQxdy"><pre> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20</pre></div></td><td class="code"><div class="pygmentize_3HQxdy"><pre><span class="go"> [local]$ cat ~/projects/gitosis-admin/gitosis.conf</span>
<span class="go"> [gitosis]</span>

<span class="go"> [repo JavaPixelazier]</span>
<span class="go"> description = The stub of sample applications with primary goal on Java Desktop</span>
<span class="go"> owner = alex@apleben.com</span>

<span class="go"> [group devs]</span>
<span class="go"> members = alex@apleben.com</span>

<span class="go"> [group admins]</span>
<span class="go"> members = alex@apleben.com</span>

<span class="go"> [group gitosis-admin]</span>
<span class="go"> writable = gitosis-admin</span>
<span class="go"> members = @admins</span>

<span class="go"> [group myteam]</span>
<span class="go"> writable = JavaPixelazier</span>
<span class="go"> members = @devs</span>
</pre></div>
</td></tr></table>

<p>Where:</p>
<ul>
<li><em>myteam</em>: is the name of a group (not the repository);</li>
<li><em>JavaPixelazier</em>: is the name of the new repository;</li>
<li><em>members</em> : is a space delimited list of users who can commit to this project (SSH public key identification).</li>
</ul>
<p>When you are adding new users, you will have to copy their public key into the directory <em>~/projects/gitosis-admin/keydir</em>. Follow the admonitions about spurious newline characters in SSH public keys. Push the gitosis-admin repository back to the remote host:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_QulHWq  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_QulHWq .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_QulHWqtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_QulHWqtable td, .pygmentize_QulHWqtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_QulHWq pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_QulHWq {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_QulHWq {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_QulHWq td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_QulHWq .hll { background-color: #49483e }
.pygmentize_QulHWq  { background: #272822; color: #f8f8f2 }
.pygmentize_QulHWq .c { color: #75715e } /* Comment */
.pygmentize_QulHWq .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_QulHWq .k { color: #66d9ef } /* Keyword */
.pygmentize_QulHWq .l { color: #ae81ff } /* Literal */
.pygmentize_QulHWq .n { color: #f8f8f2 } /* Name */
.pygmentize_QulHWq .o { color: #f92672 } /* Operator */
.pygmentize_QulHWq .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_QulHWq .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_QulHWq .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_QulHWq .c1 { color: #75715e } /* Comment.Single */
.pygmentize_QulHWq .cs { color: #75715e } /* Comment.Special */
.pygmentize_QulHWq .ge { font-style: italic } /* Generic.Emph */
.pygmentize_QulHWq .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_QulHWq .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_QulHWq .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_QulHWq .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_QulHWq .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_QulHWq .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_QulHWq .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_QulHWq .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_QulHWq .m { color: #ae81ff } /* Literal.Number */
.pygmentize_QulHWq .s { color: #e6db74 } /* Literal.String */
.pygmentize_QulHWq .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_QulHWq .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_QulHWq .nc { color: #a6e22e } /* Name.Class */
.pygmentize_QulHWq .no { color: #66d9ef } /* Name.Constant */
.pygmentize_QulHWq .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_QulHWq .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_QulHWq .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_QulHWq .nf { color: #a6e22e } /* Name.Function */
.pygmentize_QulHWq .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_QulHWq .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_QulHWq .nx { color: #a6e22e } /* Name.Other */
.pygmentize_QulHWq .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_QulHWq .nt { color: #f92672 } /* Name.Tag */
.pygmentize_QulHWq .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_QulHWq .ow { color: #f92672 } /* Operator.Word */
.pygmentize_QulHWq .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_QulHWq .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_QulHWq .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_QulHWq .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_QulHWq .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_QulHWq .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_QulHWq .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_QulHWq .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_QulHWq .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_QulHWq .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_QulHWq .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_QulHWq .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_QulHWq .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_QulHWq .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_QulHWq .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_QulHWq .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_QulHWq .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_QulHWq .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_QulHWq .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_QulHWq .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_QulHWq .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_QulHWqtable"><tr><td class="linenos pygmentize_QulHWq"><div class="linenodiv pygmentize_QulHWq"><pre>1
2</pre></div></td><td class="code"><div class="pygmentize_QulHWq"><pre><span class="go"> [local]$ git commit -a -m&quot;Add repository: JavaPixelazier, writable by Alex&quot;</span>
<span class="go"> [local]$ git push</span>
</pre></div>
</td></tr></table>

<p>Now create the project on your local desktop&#8230;</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_l5CJSk  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_l5CJSk .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_l5CJSktable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_l5CJSktable td, .pygmentize_l5CJSktable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_l5CJSk pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_l5CJSk {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_l5CJSk {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_l5CJSk td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_l5CJSk .hll { background-color: #49483e }
.pygmentize_l5CJSk  { background: #272822; color: #f8f8f2 }
.pygmentize_l5CJSk .c { color: #75715e } /* Comment */
.pygmentize_l5CJSk .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_l5CJSk .k { color: #66d9ef } /* Keyword */
.pygmentize_l5CJSk .l { color: #ae81ff } /* Literal */
.pygmentize_l5CJSk .n { color: #f8f8f2 } /* Name */
.pygmentize_l5CJSk .o { color: #f92672 } /* Operator */
.pygmentize_l5CJSk .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_l5CJSk .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_l5CJSk .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_l5CJSk .c1 { color: #75715e } /* Comment.Single */
.pygmentize_l5CJSk .cs { color: #75715e } /* Comment.Special */
.pygmentize_l5CJSk .ge { font-style: italic } /* Generic.Emph */
.pygmentize_l5CJSk .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_l5CJSk .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_l5CJSk .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_l5CJSk .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_l5CJSk .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_l5CJSk .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_l5CJSk .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_l5CJSk .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_l5CJSk .m { color: #ae81ff } /* Literal.Number */
.pygmentize_l5CJSk .s { color: #e6db74 } /* Literal.String */
.pygmentize_l5CJSk .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_l5CJSk .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_l5CJSk .nc { color: #a6e22e } /* Name.Class */
.pygmentize_l5CJSk .no { color: #66d9ef } /* Name.Constant */
.pygmentize_l5CJSk .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_l5CJSk .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_l5CJSk .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_l5CJSk .nf { color: #a6e22e } /* Name.Function */
.pygmentize_l5CJSk .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_l5CJSk .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_l5CJSk .nx { color: #a6e22e } /* Name.Other */
.pygmentize_l5CJSk .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_l5CJSk .nt { color: #f92672 } /* Name.Tag */
.pygmentize_l5CJSk .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_l5CJSk .ow { color: #f92672 } /* Operator.Word */
.pygmentize_l5CJSk .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_l5CJSk .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_l5CJSk .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_l5CJSk .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_l5CJSk .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_l5CJSk .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_l5CJSk .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_l5CJSk .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_l5CJSk .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_l5CJSk .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_l5CJSk .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_l5CJSk .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_l5CJSk .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_l5CJSk .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_l5CJSk .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_l5CJSk .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_l5CJSk .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_l5CJSk .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_l5CJSk .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_l5CJSk .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_l5CJSk .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_l5CJSktable"><tr><td class="linenos pygmentize_l5CJSk"><div class="linenodiv pygmentize_l5CJSk"><pre>1
2
3
4
5
6</pre></div></td><td class="code"><div class="pygmentize_l5CJSk"><pre><span class="go"> [local]$ cd ~/projects # or where ever you keep stuff</span>
<span class="go"> [local]$ mkdir JavaPixelazier; cd JavaPixelazier</span>
<span class="go"> [local]$ git init</span>
<span class="go"> [local]$ git remote add origin githuber@example.com:JavaPixelazier.git</span>
<span class="go"> # do some work, git add and commit files</span>
<span class="go"> [local]$ git push origin master:refs/heads/master</span>
</pre></div>
</td></tr></table>

<p>Subsequent push to the remote repository does NOT require anything more than just &#8220;push&#8221;. Your repository is now on your account at remote server!</p>
<p>We left all hard work behind. The last step is easy and not so challenged.</p>
<p><strong><span style="text-decoration: underline;">Git with Warehouse</span></strong></p>
<p><img class="alignleft size-full wp-image-315" title="warehouse" src="http://www.apleben.com/wp-content/uploads/2011/03/warehouse.jpg" alt="" width="238" height="142" />The last step is &#8211; Warehouse installation, configuration (that doesn&#8217;t hurts) and synchronization with your Git repositories. As mentioned previously, Warehouse requires Ruby and Ruby on Rails installed on our Server. If and only if, you&#8217;re sharing hosting customer, whose very unlucky to do not have Rails or even Ruby installed on your particular server, thats it &#8211; end of the game for you. It is very hard or even not possible to install Rails in such situation, because you need at least <a title="Passenger" href="http://www.modrails.com/" target="_blank">Passenger</a> installed and configured on the server. The answer here could be only one &#8211; re-think your Hosting Provider. If you&#8217;re the lucky one with Rails already installed, I&#8217;ll explain only one thing here: how to properly configure locally installed Gems for usage. This is usable in situation there you have not root access, otherwise install Gems into the system instead. Nonetheless, if you have root access and don&#8217;t know how to install Ruby and Rails &#8211; the Search Engine is your best friend ever.</p>
<p><em><span style="text-decoration: underline;">Using Gems Installed in Your Home Directory</span></em></p>
<p>You may install gems which is not pre-installed on the servers in your home directory. Assuming you use bash, do the following:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_6Y2bCf  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_6Y2bCf .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_6Y2bCftable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_6Y2bCftable td, .pygmentize_6Y2bCftable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_6Y2bCf pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_6Y2bCf {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_6Y2bCf {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_6Y2bCf td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_6Y2bCf .hll { background-color: #49483e }
.pygmentize_6Y2bCf  { background: #272822; color: #f8f8f2 }
.pygmentize_6Y2bCf .c { color: #75715e } /* Comment */
.pygmentize_6Y2bCf .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_6Y2bCf .k { color: #66d9ef } /* Keyword */
.pygmentize_6Y2bCf .l { color: #ae81ff } /* Literal */
.pygmentize_6Y2bCf .n { color: #f8f8f2 } /* Name */
.pygmentize_6Y2bCf .o { color: #f92672 } /* Operator */
.pygmentize_6Y2bCf .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_6Y2bCf .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_6Y2bCf .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_6Y2bCf .c1 { color: #75715e } /* Comment.Single */
.pygmentize_6Y2bCf .cs { color: #75715e } /* Comment.Special */
.pygmentize_6Y2bCf .ge { font-style: italic } /* Generic.Emph */
.pygmentize_6Y2bCf .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_6Y2bCf .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_6Y2bCf .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_6Y2bCf .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_6Y2bCf .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_6Y2bCf .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_6Y2bCf .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_6Y2bCf .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_6Y2bCf .m { color: #ae81ff } /* Literal.Number */
.pygmentize_6Y2bCf .s { color: #e6db74 } /* Literal.String */
.pygmentize_6Y2bCf .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_6Y2bCf .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_6Y2bCf .nc { color: #a6e22e } /* Name.Class */
.pygmentize_6Y2bCf .no { color: #66d9ef } /* Name.Constant */
.pygmentize_6Y2bCf .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_6Y2bCf .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_6Y2bCf .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_6Y2bCf .nf { color: #a6e22e } /* Name.Function */
.pygmentize_6Y2bCf .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_6Y2bCf .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_6Y2bCf .nx { color: #a6e22e } /* Name.Other */
.pygmentize_6Y2bCf .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_6Y2bCf .nt { color: #f92672 } /* Name.Tag */
.pygmentize_6Y2bCf .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_6Y2bCf .ow { color: #f92672 } /* Operator.Word */
.pygmentize_6Y2bCf .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_6Y2bCf .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_6Y2bCf .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_6Y2bCf .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_6Y2bCf .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_6Y2bCf .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_6Y2bCf .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_6Y2bCf .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_6Y2bCf .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_6Y2bCf .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_6Y2bCf .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_6Y2bCf .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_6Y2bCf .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_6Y2bCf .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_6Y2bCf .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_6Y2bCf .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_6Y2bCf .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_6Y2bCf .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_6Y2bCf .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_6Y2bCf .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_6Y2bCf .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_6Y2bCftable"><tr><td class="linenos pygmentize_6Y2bCf"><div class="linenodiv pygmentize_6Y2bCf"><pre>1
2
3
4</pre></div></td><td class="code"><div class="pygmentize_6Y2bCf"><pre><span class="go"> [server]$ mkdir ~/.gems</span>
<span class="go"> [server]$ cat &gt;&gt; ~/.bash_profile</span>
<span class="go"> export GEM_HOME=$HOME/.gems</span>
<span class="go"> export GEM_PATH=$GEM_HOME:/usr/lib/ruby/gems/1.8</span>
</pre></div>
</td></tr></table>

<p>Then press CTRL+D to exit <em>cat</em> and return to the command prompt. You may then install gems in the usual way (e.g. <em>gem install gem_name</em>). The <em>.bash_profile</em> method above resulted in the following error: <em><span style="text-decoration: underline;">Could not find RubyGem sources (&gt; 0.0.0)</span></em> when I tried installing a gem, but the instructions on altering your <em>.gemrc file</em> below worked perfectly. <span style="text-decoration: underline;">HOWEVER</span>, without altering the <em>.bash_profile</em> rake kept complaining about not seeing my locally installed gems even when I passed it <em>GEM_HOME</em> and <em>GEM_PATH</em> manually. So, you may need both.</p>
<p>An alternative to setting the GEM_PATH environment is to create a <em>~/.gemrc</em> file with the following contents:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_bpsVGa  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_bpsVGa .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_bpsVGatable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_bpsVGatable td, .pygmentize_bpsVGatable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_bpsVGa pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_bpsVGa {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_bpsVGa {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_bpsVGa td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_bpsVGa .hll { background-color: #49483e }
.pygmentize_bpsVGa  { background: #272822; color: #f8f8f2 }
.pygmentize_bpsVGa .c { color: #75715e } /* Comment */
.pygmentize_bpsVGa .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_bpsVGa .k { color: #66d9ef } /* Keyword */
.pygmentize_bpsVGa .l { color: #ae81ff } /* Literal */
.pygmentize_bpsVGa .n { color: #f8f8f2 } /* Name */
.pygmentize_bpsVGa .o { color: #f92672 } /* Operator */
.pygmentize_bpsVGa .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_bpsVGa .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_bpsVGa .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_bpsVGa .c1 { color: #75715e } /* Comment.Single */
.pygmentize_bpsVGa .cs { color: #75715e } /* Comment.Special */
.pygmentize_bpsVGa .ge { font-style: italic } /* Generic.Emph */
.pygmentize_bpsVGa .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_bpsVGa .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_bpsVGa .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_bpsVGa .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_bpsVGa .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_bpsVGa .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_bpsVGa .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_bpsVGa .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_bpsVGa .m { color: #ae81ff } /* Literal.Number */
.pygmentize_bpsVGa .s { color: #e6db74 } /* Literal.String */
.pygmentize_bpsVGa .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_bpsVGa .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_bpsVGa .nc { color: #a6e22e } /* Name.Class */
.pygmentize_bpsVGa .no { color: #66d9ef } /* Name.Constant */
.pygmentize_bpsVGa .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_bpsVGa .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_bpsVGa .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_bpsVGa .nf { color: #a6e22e } /* Name.Function */
.pygmentize_bpsVGa .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_bpsVGa .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_bpsVGa .nx { color: #a6e22e } /* Name.Other */
.pygmentize_bpsVGa .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_bpsVGa .nt { color: #f92672 } /* Name.Tag */
.pygmentize_bpsVGa .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_bpsVGa .ow { color: #f92672 } /* Operator.Word */
.pygmentize_bpsVGa .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_bpsVGa .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_bpsVGa .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_bpsVGa .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_bpsVGa .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_bpsVGa .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_bpsVGa .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_bpsVGa .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_bpsVGa .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_bpsVGa .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_bpsVGa .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_bpsVGa .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_bpsVGa .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_bpsVGa .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_bpsVGa .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_bpsVGa .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_bpsVGa .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_bpsVGa .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_bpsVGa .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_bpsVGa .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_bpsVGa .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_bpsVGatable"><tr><td class="linenos pygmentize_bpsVGa"><div class="linenodiv pygmentize_bpsVGa"><pre>1
2
3
4</pre></div></td><td class="code"><div class="pygmentize_bpsVGa"><pre><span class="go"> gemhome: /home/&lt;YOUR USER NAME HERE&gt;/.gems</span>
<span class="go"> gempath:</span>
<span class="go"> - /home/&lt;YOUR USER NAME HERE&gt;/.gems</span>
<span class="go"> - /usr/lib/ruby/gems/1.8</span>
</pre></div>
</td></tr></table>

<p><em><span style="text-decoration: underline;">Installing Warehouse in Production</span></em></p>
<p>Installation for production use is almost the same like for the development environment. Be aware, that domain has been configured with <a title="Passenger" href="http://www.modrails.com/" target="_blank">Passenger</a> or <a title="Mongrell" href="http://rubygems.org/gems/mongrel" target="_blank">Mongrell</a> support (FastCGI is <strong>strongly NOT recommended</strong>).</p>
<p>If you&#8217;re running Warehouse on your server under some domain, first go inside the directory, where application will be installed. In most cases directory will have the name of the domain:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_mMFJQ6  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_mMFJQ6 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_mMFJQ6table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_mMFJQ6table td, .pygmentize_mMFJQ6table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_mMFJQ6 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_mMFJQ6 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_mMFJQ6 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_mMFJQ6 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_mMFJQ6 .hll { background-color: #49483e }
.pygmentize_mMFJQ6  { background: #272822; color: #f8f8f2 }
.pygmentize_mMFJQ6 .c { color: #75715e } /* Comment */
.pygmentize_mMFJQ6 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_mMFJQ6 .k { color: #66d9ef } /* Keyword */
.pygmentize_mMFJQ6 .l { color: #ae81ff } /* Literal */
.pygmentize_mMFJQ6 .n { color: #f8f8f2 } /* Name */
.pygmentize_mMFJQ6 .o { color: #f92672 } /* Operator */
.pygmentize_mMFJQ6 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_mMFJQ6 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_mMFJQ6 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_mMFJQ6 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_mMFJQ6 .cs { color: #75715e } /* Comment.Special */
.pygmentize_mMFJQ6 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_mMFJQ6 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_mMFJQ6 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_mMFJQ6 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_mMFJQ6 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_mMFJQ6 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_mMFJQ6 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_mMFJQ6 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_mMFJQ6 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_mMFJQ6 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_mMFJQ6 .s { color: #e6db74 } /* Literal.String */
.pygmentize_mMFJQ6 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_mMFJQ6 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_mMFJQ6 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_mMFJQ6 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_mMFJQ6 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_mMFJQ6 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_mMFJQ6 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_mMFJQ6 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_mMFJQ6 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_mMFJQ6 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_mMFJQ6 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_mMFJQ6 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_mMFJQ6 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_mMFJQ6 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_mMFJQ6 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_mMFJQ6 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_mMFJQ6 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_mMFJQ6 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_mMFJQ6 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_mMFJQ6 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_mMFJQ6 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_mMFJQ6 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_mMFJQ6 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_mMFJQ6 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_mMFJQ6 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_mMFJQ6 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_mMFJQ6 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_mMFJQ6 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_mMFJQ6 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_mMFJQ6 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_mMFJQ6 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_mMFJQ6 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_mMFJQ6 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_mMFJQ6 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_mMFJQ6 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_mMFJQ6 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_mMFJQ6table"><tr><td class="linenos pygmentize_mMFJQ6"><div class="linenodiv pygmentize_mMFJQ6"><pre>1</pre></div></td><td class="code"><div class="pygmentize_mMFJQ6"><pre><span class="go"> [server]$ cd ~/subdomain.yourdomain.com/</span>
</pre></div>
</td></tr></table>

<p>Then, clone the project:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_FTBmh4  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_FTBmh4 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_FTBmh4table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_FTBmh4table td, .pygmentize_FTBmh4table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_FTBmh4 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_FTBmh4 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_FTBmh4 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_FTBmh4 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_FTBmh4 .hll { background-color: #49483e }
.pygmentize_FTBmh4  { background: #272822; color: #f8f8f2 }
.pygmentize_FTBmh4 .c { color: #75715e } /* Comment */
.pygmentize_FTBmh4 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_FTBmh4 .k { color: #66d9ef } /* Keyword */
.pygmentize_FTBmh4 .l { color: #ae81ff } /* Literal */
.pygmentize_FTBmh4 .n { color: #f8f8f2 } /* Name */
.pygmentize_FTBmh4 .o { color: #f92672 } /* Operator */
.pygmentize_FTBmh4 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_FTBmh4 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_FTBmh4 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_FTBmh4 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_FTBmh4 .cs { color: #75715e } /* Comment.Special */
.pygmentize_FTBmh4 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_FTBmh4 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_FTBmh4 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_FTBmh4 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_FTBmh4 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_FTBmh4 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_FTBmh4 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_FTBmh4 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_FTBmh4 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_FTBmh4 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_FTBmh4 .s { color: #e6db74 } /* Literal.String */
.pygmentize_FTBmh4 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_FTBmh4 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_FTBmh4 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_FTBmh4 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_FTBmh4 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_FTBmh4 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_FTBmh4 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_FTBmh4 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_FTBmh4 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_FTBmh4 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_FTBmh4 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_FTBmh4 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_FTBmh4 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_FTBmh4 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_FTBmh4 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_FTBmh4 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_FTBmh4 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_FTBmh4 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_FTBmh4 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_FTBmh4 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_FTBmh4 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_FTBmh4 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_FTBmh4 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_FTBmh4 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_FTBmh4 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_FTBmh4 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_FTBmh4 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_FTBmh4 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_FTBmh4 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_FTBmh4 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_FTBmh4 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_FTBmh4 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_FTBmh4 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_FTBmh4 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_FTBmh4 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_FTBmh4 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_FTBmh4table"><tr><td class="linenos pygmentize_FTBmh4"><div class="linenodiv pygmentize_FTBmh4"><pre>1
2
3</pre></div></td><td class="code"><div class="pygmentize_FTBmh4"><pre><span class="go"> [server]$ git clone git://github.com/drcapulet/warehouse.git</span>
<span class="go"> [server]$ mv warehouse/* ~/subdomain.yourdomain.com/</span>
<span class="go"> [server]$ rm -rf warehouse</span>
</pre></div>
</td></tr></table>

<p>Install dependencies:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_GLSHK2  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_GLSHK2 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_GLSHK2table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_GLSHK2table td, .pygmentize_GLSHK2table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_GLSHK2 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_GLSHK2 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_GLSHK2 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_GLSHK2 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_GLSHK2 .hll { background-color: #49483e }
.pygmentize_GLSHK2  { background: #272822; color: #f8f8f2 }
.pygmentize_GLSHK2 .c { color: #75715e } /* Comment */
.pygmentize_GLSHK2 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_GLSHK2 .k { color: #66d9ef } /* Keyword */
.pygmentize_GLSHK2 .l { color: #ae81ff } /* Literal */
.pygmentize_GLSHK2 .n { color: #f8f8f2 } /* Name */
.pygmentize_GLSHK2 .o { color: #f92672 } /* Operator */
.pygmentize_GLSHK2 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_GLSHK2 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_GLSHK2 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_GLSHK2 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_GLSHK2 .cs { color: #75715e } /* Comment.Special */
.pygmentize_GLSHK2 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_GLSHK2 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_GLSHK2 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_GLSHK2 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_GLSHK2 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_GLSHK2 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_GLSHK2 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_GLSHK2 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_GLSHK2 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_GLSHK2 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_GLSHK2 .s { color: #e6db74 } /* Literal.String */
.pygmentize_GLSHK2 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_GLSHK2 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_GLSHK2 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_GLSHK2 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_GLSHK2 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_GLSHK2 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_GLSHK2 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_GLSHK2 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_GLSHK2 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_GLSHK2 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_GLSHK2 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_GLSHK2 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_GLSHK2 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_GLSHK2 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_GLSHK2 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_GLSHK2 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_GLSHK2 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_GLSHK2 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_GLSHK2 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_GLSHK2 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_GLSHK2 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_GLSHK2 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_GLSHK2 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_GLSHK2 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_GLSHK2 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_GLSHK2 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_GLSHK2 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_GLSHK2 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_GLSHK2 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_GLSHK2 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_GLSHK2 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_GLSHK2 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_GLSHK2 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_GLSHK2 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_GLSHK2 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_GLSHK2 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_GLSHK2table"><tr><td class="linenos pygmentize_GLSHK2"><div class="linenodiv pygmentize_GLSHK2"><pre>1</pre></div></td><td class="code"><div class="pygmentize_GLSHK2"><pre><span class="go"> [server]$ gem install bundler &amp;&amp; bundle install</span>
</pre></div>
</td></tr></table>

<p>Check out if you have the <a title="Pygments" href="http://pygments.org/" target="_blank">Pygments library</a> installed. This library are necessary for source code highlighting.<br />
In production you probably do not want to use sqlite, instead MySQL is preferable. To use MySQL type this inside the RAILS_ROOT directory:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_1RSBQ1  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_1RSBQ1 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_1RSBQ1table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_1RSBQ1table td, .pygmentize_1RSBQ1table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_1RSBQ1 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_1RSBQ1 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_1RSBQ1 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_1RSBQ1 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_1RSBQ1 .hll { background-color: #49483e }
.pygmentize_1RSBQ1  { background: #272822; color: #f8f8f2 }
.pygmentize_1RSBQ1 .c { color: #75715e } /* Comment */
.pygmentize_1RSBQ1 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_1RSBQ1 .k { color: #66d9ef } /* Keyword */
.pygmentize_1RSBQ1 .l { color: #ae81ff } /* Literal */
.pygmentize_1RSBQ1 .n { color: #f8f8f2 } /* Name */
.pygmentize_1RSBQ1 .o { color: #f92672 } /* Operator */
.pygmentize_1RSBQ1 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_1RSBQ1 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_1RSBQ1 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_1RSBQ1 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_1RSBQ1 .cs { color: #75715e } /* Comment.Special */
.pygmentize_1RSBQ1 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_1RSBQ1 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_1RSBQ1 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_1RSBQ1 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_1RSBQ1 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_1RSBQ1 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_1RSBQ1 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_1RSBQ1 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_1RSBQ1 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_1RSBQ1 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_1RSBQ1 .s { color: #e6db74 } /* Literal.String */
.pygmentize_1RSBQ1 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_1RSBQ1 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_1RSBQ1 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_1RSBQ1 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_1RSBQ1 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_1RSBQ1 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_1RSBQ1 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_1RSBQ1 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_1RSBQ1 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_1RSBQ1 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_1RSBQ1 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_1RSBQ1 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_1RSBQ1 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_1RSBQ1 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_1RSBQ1 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_1RSBQ1 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_1RSBQ1 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_1RSBQ1 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_1RSBQ1 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_1RSBQ1 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_1RSBQ1 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_1RSBQ1 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_1RSBQ1 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_1RSBQ1 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_1RSBQ1 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_1RSBQ1 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_1RSBQ1 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_1RSBQ1 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_1RSBQ1 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_1RSBQ1 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_1RSBQ1 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_1RSBQ1 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_1RSBQ1 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_1RSBQ1 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_1RSBQ1 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_1RSBQ1 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_1RSBQ1table"><tr><td class="linenos pygmentize_1RSBQ1"><div class="linenodiv pygmentize_1RSBQ1"><pre>1
2</pre></div></td><td class="code"><div class="pygmentize_1RSBQ1"><pre><span class="go"> [server]$ rm config/database.yml</span>
<span class="go"> [server]$ cp config/database.mysql_sample.yml config/database.yml</span>
</pre></div>
</td></tr></table>

<p>Then, make sure you have the database created and loaded in the schema. Again, from the RAILS_ROOT directory:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_QzNYD2  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_QzNYD2 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_QzNYD2table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_QzNYD2table td, .pygmentize_QzNYD2table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_QzNYD2 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_QzNYD2 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_QzNYD2 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_QzNYD2 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_QzNYD2 .hll { background-color: #49483e }
.pygmentize_QzNYD2  { background: #272822; color: #f8f8f2 }
.pygmentize_QzNYD2 .c { color: #75715e } /* Comment */
.pygmentize_QzNYD2 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_QzNYD2 .k { color: #66d9ef } /* Keyword */
.pygmentize_QzNYD2 .l { color: #ae81ff } /* Literal */
.pygmentize_QzNYD2 .n { color: #f8f8f2 } /* Name */
.pygmentize_QzNYD2 .o { color: #f92672 } /* Operator */
.pygmentize_QzNYD2 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_QzNYD2 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_QzNYD2 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_QzNYD2 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_QzNYD2 .cs { color: #75715e } /* Comment.Special */
.pygmentize_QzNYD2 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_QzNYD2 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_QzNYD2 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_QzNYD2 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_QzNYD2 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_QzNYD2 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_QzNYD2 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_QzNYD2 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_QzNYD2 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_QzNYD2 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_QzNYD2 .s { color: #e6db74 } /* Literal.String */
.pygmentize_QzNYD2 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_QzNYD2 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_QzNYD2 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_QzNYD2 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_QzNYD2 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_QzNYD2 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_QzNYD2 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_QzNYD2 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_QzNYD2 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_QzNYD2 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_QzNYD2 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_QzNYD2 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_QzNYD2 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_QzNYD2 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_QzNYD2 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_QzNYD2 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_QzNYD2 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_QzNYD2 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_QzNYD2 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_QzNYD2 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_QzNYD2 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_QzNYD2 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_QzNYD2 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_QzNYD2 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_QzNYD2 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_QzNYD2 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_QzNYD2 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_QzNYD2 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_QzNYD2 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_QzNYD2 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_QzNYD2 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_QzNYD2 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_QzNYD2 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_QzNYD2 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_QzNYD2 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_QzNYD2 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_QzNYD2table"><tr><td class="linenos pygmentize_QzNYD2"><div class="linenodiv pygmentize_QzNYD2"><pre>1</pre></div></td><td class="code"><div class="pygmentize_QzNYD2"><pre><span class="go"> [server]$ RAILS_ENV=production rake db:schema:load</span>
</pre></div>
</td></tr></table>

<p>Before starting the server make sure you properly configured your domain name in the <em>RAILS_ROOT/config/warehouse.yml</em>, otherwise application just will not start.<br />
Find the section and configure it properly:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_nmATg4  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_nmATg4 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_nmATg4table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_nmATg4table td, .pygmentize_nmATg4table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_nmATg4 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_nmATg4 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_nmATg4 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_nmATg4 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_nmATg4 .hll { background-color: #49483e }
.pygmentize_nmATg4  { background: #272822; color: #f8f8f2 }
.pygmentize_nmATg4 .c { color: #75715e } /* Comment */
.pygmentize_nmATg4 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_nmATg4 .k { color: #66d9ef } /* Keyword */
.pygmentize_nmATg4 .l { color: #ae81ff } /* Literal */
.pygmentize_nmATg4 .n { color: #f8f8f2 } /* Name */
.pygmentize_nmATg4 .o { color: #f92672 } /* Operator */
.pygmentize_nmATg4 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_nmATg4 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_nmATg4 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_nmATg4 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_nmATg4 .cs { color: #75715e } /* Comment.Special */
.pygmentize_nmATg4 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_nmATg4 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_nmATg4 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_nmATg4 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_nmATg4 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_nmATg4 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_nmATg4 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_nmATg4 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_nmATg4 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_nmATg4 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_nmATg4 .s { color: #e6db74 } /* Literal.String */
.pygmentize_nmATg4 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_nmATg4 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_nmATg4 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_nmATg4 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_nmATg4 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_nmATg4 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_nmATg4 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_nmATg4 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_nmATg4 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_nmATg4 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_nmATg4 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_nmATg4 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_nmATg4 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_nmATg4 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_nmATg4 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_nmATg4 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_nmATg4 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_nmATg4 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_nmATg4 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_nmATg4 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_nmATg4 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_nmATg4 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_nmATg4 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_nmATg4 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_nmATg4 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_nmATg4 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_nmATg4 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_nmATg4 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_nmATg4 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_nmATg4 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_nmATg4 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_nmATg4 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_nmATg4 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_nmATg4 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_nmATg4 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_nmATg4 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_nmATg4table"><tr><td class="linenos pygmentize_nmATg4"><div class="linenodiv pygmentize_nmATg4"><pre>1
2</pre></div></td><td class="code"><div class="pygmentize_nmATg4"><pre> <span class="l-Scalar-Plain">production</span><span class="p-Indicator">:</span>
 <span class="l-Scalar-Plain">host</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">http://subdomain.yourdomain.com/</span>
</pre></div>
</td></tr></table>

<p>Add in a new repository, and run:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_CL6cH6  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_CL6cH6 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_CL6cH6table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_CL6cH6table td, .pygmentize_CL6cH6table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_CL6cH6 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_CL6cH6 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_CL6cH6 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_CL6cH6 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_CL6cH6 .hll { background-color: #49483e }
.pygmentize_CL6cH6  { background: #272822; color: #f8f8f2 }
.pygmentize_CL6cH6 .c { color: #75715e } /* Comment */
.pygmentize_CL6cH6 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_CL6cH6 .k { color: #66d9ef } /* Keyword */
.pygmentize_CL6cH6 .l { color: #ae81ff } /* Literal */
.pygmentize_CL6cH6 .n { color: #f8f8f2 } /* Name */
.pygmentize_CL6cH6 .o { color: #f92672 } /* Operator */
.pygmentize_CL6cH6 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_CL6cH6 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_CL6cH6 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_CL6cH6 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_CL6cH6 .cs { color: #75715e } /* Comment.Special */
.pygmentize_CL6cH6 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_CL6cH6 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_CL6cH6 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_CL6cH6 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_CL6cH6 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_CL6cH6 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_CL6cH6 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_CL6cH6 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_CL6cH6 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_CL6cH6 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_CL6cH6 .s { color: #e6db74 } /* Literal.String */
.pygmentize_CL6cH6 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_CL6cH6 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_CL6cH6 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_CL6cH6 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_CL6cH6 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_CL6cH6 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_CL6cH6 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_CL6cH6 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_CL6cH6 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_CL6cH6 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_CL6cH6 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_CL6cH6 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_CL6cH6 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_CL6cH6 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_CL6cH6 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_CL6cH6 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_CL6cH6 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_CL6cH6 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_CL6cH6 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_CL6cH6 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_CL6cH6 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_CL6cH6 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_CL6cH6 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_CL6cH6 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_CL6cH6 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_CL6cH6 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_CL6cH6 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_CL6cH6 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_CL6cH6 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_CL6cH6 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_CL6cH6 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_CL6cH6 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_CL6cH6 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_CL6cH6 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_CL6cH6 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_CL6cH6 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_CL6cH6table"><tr><td class="linenos pygmentize_CL6cH6"><div class="linenodiv pygmentize_CL6cH6"><pre>1</pre></div></td><td class="code"><div class="pygmentize_CL6cH6"><pre><span class="go"> [server]$ RAILS_ENV=production rake warehouse:sync</span>
</pre></div>
</td></tr></table>

<p>Apparently, you&#8217;ll cause an exception with the repository sync error. Don&#8217;t worry, start the server and go to your domain in the browser window. Register new user, login and add new repository, where path to the repository will be something like this: <em>/home/USERNAME/repositories/super_secret_project</em>. After that, go back to the console prompt and type:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_ttxxZ9  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_ttxxZ9 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_ttxxZ9table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_ttxxZ9table td, .pygmentize_ttxxZ9table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_ttxxZ9 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_ttxxZ9 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_ttxxZ9 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_ttxxZ9 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_ttxxZ9 .hll { background-color: #49483e }
.pygmentize_ttxxZ9  { background: #272822; color: #f8f8f2 }
.pygmentize_ttxxZ9 .c { color: #75715e } /* Comment */
.pygmentize_ttxxZ9 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_ttxxZ9 .k { color: #66d9ef } /* Keyword */
.pygmentize_ttxxZ9 .l { color: #ae81ff } /* Literal */
.pygmentize_ttxxZ9 .n { color: #f8f8f2 } /* Name */
.pygmentize_ttxxZ9 .o { color: #f92672 } /* Operator */
.pygmentize_ttxxZ9 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_ttxxZ9 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_ttxxZ9 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_ttxxZ9 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_ttxxZ9 .cs { color: #75715e } /* Comment.Special */
.pygmentize_ttxxZ9 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_ttxxZ9 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_ttxxZ9 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_ttxxZ9 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_ttxxZ9 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_ttxxZ9 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_ttxxZ9 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_ttxxZ9 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_ttxxZ9 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_ttxxZ9 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_ttxxZ9 .s { color: #e6db74 } /* Literal.String */
.pygmentize_ttxxZ9 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_ttxxZ9 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_ttxxZ9 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_ttxxZ9 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_ttxxZ9 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_ttxxZ9 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_ttxxZ9 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_ttxxZ9 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_ttxxZ9 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_ttxxZ9 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_ttxxZ9 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_ttxxZ9 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_ttxxZ9 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_ttxxZ9 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_ttxxZ9 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_ttxxZ9 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_ttxxZ9 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_ttxxZ9 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_ttxxZ9 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_ttxxZ9 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_ttxxZ9 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_ttxxZ9 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_ttxxZ9 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_ttxxZ9 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_ttxxZ9 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_ttxxZ9 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_ttxxZ9 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_ttxxZ9 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_ttxxZ9 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_ttxxZ9 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_ttxxZ9 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_ttxxZ9 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_ttxxZ9 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_ttxxZ9 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_ttxxZ9 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_ttxxZ9 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_ttxxZ9table"><tr><td class="linenos pygmentize_ttxxZ9"><div class="linenodiv pygmentize_ttxxZ9"><pre>1</pre></div></td><td class="code"><div class="pygmentize_ttxxZ9"><pre><span class="go"> [server]$ RAILS_ENV=production rake warehouse:sync[/home/USERNAME/repositories/super_secret_project]</span>
</pre></div>
</td></tr></table>

<p>Your initial repository should to be synchronized properly now. Login to warehouse and enjoy!</p>
<p><strong><span style="text-decoration: underline;">Conclusion</span></strong></p>
<p>After all these steps you will have an ability to create your own private Git repositories with authorization controlled by Gitosis and modern Git Web View provided by Warehouse for Git to us. Maybe this short article will be helpful for somebody else, build by my own experience on it. Also, take a look at some screenshots below</p>
<p style="text-align: center;"><img class="aligncenter size-large wp-image-316" title="snapshot1" src="http://www.apleben.com/wp-content/uploads/2011/03/snapshot1-1024x567.png" alt="" width="819" height="454" /><img class="aligncenter size-large wp-image-317" title="snapshot2" src="http://www.apleben.com/wp-content/uploads/2011/03/snapshot2-1024x567.png" alt="" width="819" height="454" /><img class="aligncenter size-large wp-image-318" title="snapshot3" src="http://www.apleben.com/wp-content/uploads/2011/03/snapshot3-1024x570.png" alt="" width="819" height="456" /><img class="aligncenter size-large wp-image-319" title="snapshot4" src="http://www.apleben.com/wp-content/uploads/2011/03/snapshot4-1024x568.png" alt="" width="819" height="454" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2011/03/own-private-git-repository-with-modern-web-view/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Machine Learning Notes</title>
		<link>http://www.apleben.com/2011/02/machine-learning-notes/</link>
		<comments>http://www.apleben.com/2011/02/machine-learning-notes/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 10:03:48 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[MIT]]></category>
		<category><![CDATA[Neural Informatics]]></category>
		<category><![CDATA[Neural Networks]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[Stanford]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=310</guid>
		<description><![CDATA[Since I&#8217;ve found a couple (actually not a couple) of interesting resources, completely related to the Machine Learning courses and books, I need to remember a lot of these points. It is very helpful for myself, because when I was studied in the University, there is either not been something related to this theme, nor [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2011/02/iron_man.png" width="240" />
		</p><p><img class="alignleft size-full wp-image-311" title="Stanford ML" src="http://www.apleben.com/wp-content/uploads/2011/02/Stanford-ML.jpg" alt="" width="170" height="170" />Since I&#8217;ve found a couple (actually not a couple) of interesting resources, completely related to the Machine Learning courses and books, I need to remember a lot of these points. It is very helpful for myself, because when I was studied in the University, there is either not been something related to this theme, nor our professors covered these thing with us. So sad to spend many times by studying &#8220;new technology&#8221;, those in nowadays has no particular sense at all. Prematurely, this is pointed for me, however, if it will be helpful to some one else &#8211; well, you&#8217;ll gotcha <img src='http://www.apleben.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The Machine Learning materials are related to Artificial Intelligence, Neural Networks, Neural Informatics as a kind of stuff. I have no idea how to sort these materials, but prematurely to me, I&#8217;ll just put it into three category: courses, books and related open source libraries. Whatsoever, what is preferable to another folks, I don&#8217;t care, because it couldn&#8217;t possible to imagine. If for one man visual contact is much preferable than others &#8211; books is your&#8217;s. If for another man audio contact is preferable, then obviously, the audio course would help such human a lot, than any of the books. However, nonetheless what kind of contact is preferable for two absolutely distinct peoples, the video course is much and much preferable for everybody. There is no reason to explain it and since this is my note &#8211; think I am right.</p>
<p>Well, will try to put all of these link together here. Again, I have no idea how to sort it, just pick a volatility manner in every category. First, the Machine Learning courses:</p>
<ul>
<li><a title="Stanford Machine Learning" href="http://itunes.apple.com/itunes-u/machine-learning/id384233048" target="_blank">Stanford Machine Learning course in iTunes</a></li>
<li><a title="Introduction to Robotics" href="http://itunes.apple.com/us/itunes-u/introduction-to-robotics/id384233063" target="_blank">Stanford Introduction to Robotics course in iTunes</a></li>
<li><a title="Introduction to Algorithms" href="http://itunes.apple.com/us/itunes-u/introduction-to-algorithms/id341597754" target="_blank">MIT Open CourseWare: Introduction to Algorithms in iTunes</a></li>
<li><a title="MIT Machine Learning" href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-867-machine-learning-fall-2006/" target="_blank">MIT Open CourseWare: Machine Learning</a></li>
<li><a title="Berkeley Machine Learning" href="http://www.stat.berkeley.edu/~statlearning/index.html" target="_blank">University of California, Berkeley: Statistical Machine Learning</a></li>
<li><a title="Carnegie Mellon ML" href="http://www.ml.cmu.edu/" target="_blank">Carnegie Mellon: Machine Learning Department</a></li>
</ul>
<p>Finished with courses, going further to the books side. All of the books on English, obviously. The sequence doesn&#8217;t matter here, only things matter:</p>
<ul>
<li><a title="Intro to ML" href="http://www.amazon.com/gp/product/026201243X?ie=UTF8&amp;tag=pensiveponder-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=026201243X" target="_blank">Introduction to Machine Learning, Second Edition (Adaptive Computation and Machine Learning)</a>. The MIT Press; 2 edition (February 26, 2010);</li>
<li><a title="Data Mining. Practical ML" href="http://www.amazon.com/gp/product/0123748569?ie=UTF8&amp;tag=pensiveponder-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0123748569" target="_blank">Data Mining: Practical Machine Learning Tools and Techniques, Third Edition.</a> Morgan Kaufmann; 3 edition (January 20, 2011);</li>
<li><a title="Clever Algorithms" href="http://www.cleveralgorithms.com/" target="_blank">Clever Algorithms: Nature-Inspired Programming Recipes.</a> LuLu; 1st edition (January 31, 2011);</li>
<li><a title="Information Theory" href="http://www.amazon.com/gp/product/0521642981?ie=UTF8&amp;tag=pensiveponder-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0521642981" target="_blank">Information Theory, Inference &amp; Learning Algorithms.</a> Cambridge University Press; 1st edition (June 15, 2002);</li>
<li><a title="ML" href="http://www.amazon.com/gp/product/0071154671?ie=UTF8&amp;tag=pensiveponder-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0071154671" target="_blank">Machine Learning.</a> McGraw Hill Higher Education; 1st edition (October 1, 1997);</li>
<li><a title="Pattern Classification" href="http://www.amazon.com/gp/product/0471056693?ie=UTF8&amp;tag=pensiveponder-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0471056693" target="_blank">Pattern Classification (2nd Edition).</a> Wiley-Interscience; 2 edition (October 2000);</li>
<li><a title="NN Pattern Recognition" href="http://www.amazon.com/gp/product/0198538642?ie=UTF8&amp;tag=pensiveponder-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0198538642" target="_blank">Neural Networks for Pattern Recognition.</a> Oxford University Press, USA; 1 edition (January 18, 1996);</li>
<li><a title="PR and ML" href="http://www.amazon.com/gp/product/0387310738?ie=UTF8&amp;tag=pensiveponder-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0387310738" target="_blank">Pattern Recognition and Machine Learning (Information Science and Statistics).</a> Springer; 1st ed. 2006. Corr. 2nd printing edition (October 1, 2007).</li>
</ul>
<p>And the last point to cover is the AI related libraries and software. Didn&#8217;t found a lot of entries here, but&#8230;.. here they are:</p>
<ul>
<li><a title="WEKA" href="http://wekaclassalgos.sourceforge.net/" target="_blank">WEKA Classification Algorithms</a>;</li>
<li><a title="AI Ruby" href="http://web.media.mit.edu/~dustin/papers/ai_ruby_plugins/" target="_blank">AI Related Extensions on the Ruby Programming Language</a>;</li>
<li><a title="Clever Algorithms code" href="https://github.com/jbrownlee/CleverAlgorithms" target="_blank">Clever Algorithms book and source code</a> on the GitHub.</li>
</ul>
<p>People do not tinkering enough, sometimes copying, sometimes just stealing as a good or great actors, developing stupid and totally useless software, toys like new mobile OS or new beautiful UI, called Look and Feel. We&#8217;re not concerned about tomorrow, only looking at yesterday, thought about profitable deal and what we&#8217;re loosed, what reached. People actually, only cares about his own ass and not about somebody else, elsewhere or else-how. Almost everybody wish to be a successful famous person with a billion dollars on his bank account. But why?! Is all these money will help you to prevent your death? Of course not. But, why are we still collecting these stupid papers and our stupid deals? Because we all a monkeys, just a monkeys in the big circus called <em>Planet Earth.</em> We are not so smart as it may look at the first observation. Everything is distinguished in the comparison.</p>
<p>Theoretically, more and more money could be invested into a science, AI, Neural Networks/Informatics investigation, health insurance and investigation, rather than buy a new stupid sports car, lands on the moon and so forth. Currently, only a six, a SIX peoples are working on the <a title="Expedition 26" href="http://en.wikipedia.org/wiki/Expedition_26" target="_blank">Expedition 26</a> space program. <a title="Shuttle Program" href="http://www.nasa.gov/mission_pages/shuttle/main/index.html" target="_blank">NASA&#8217;s Space Shuttle Program Concluded.</a> The successful and very expensive <a title="Buran" href="http://en.wikipedia.org/wiki/Buran_program" target="_blank">Russian Buran Space Program</a> has been concluded. What a hell are we doing?! Yeah, I forget&#8230;. we just a monkeys in the big circus. We still cannot reach another planets to investigate his atmosphere, build a colony, find an evidence of new forms of live&#8230;. we can&#8217;t for many reasons. One of the reasons &#8211; we&#8217;re very addictive to our atmosphere and environment and cannot leave our place cheaply. However, Artificial form of live can do this for us.</p>
<p>From my personal point of view: to be a successful human means to do something tremendous not only for yourself, doesn&#8217;t matter how are you doing these, only matter to be successful in your deal. I am reached end of the note.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2011/02/machine-learning-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Android View: the definition</title>
		<link>http://www.apleben.com/2011/01/custom-android-view-the-definition/</link>
		<comments>http://www.apleben.com/2011/01/custom-android-view-the-definition/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 09:44:42 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[controls]]></category>
		<category><![CDATA[customization]]></category>
		<category><![CDATA[graphics]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=307</guid>
		<description><![CDATA[The first question, that is rotating in my head is: why I should implement my own custom View and just not to use one of the standard View&#8217;s? Actually, there is not a problem. Most of the Android applications using standard View&#8217;s, LayoutGroup&#8217;s, only customizing its color schemes, Layout and another general based stuff, applied [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2011/01/preferences-system.png" width="240" />
		</p><p>The first question, that is rotating in my head is: why I should implement my own custom View and just not to use one of the standard View&#8217;s? Actually, there is not a problem. Most of the Android applications using standard View&#8217;s, LayoutGroup&#8217;s, only customizing its color schemes, Layout and another general based stuff, applied to every day Android development. So, how I can explain my or maybe your interest on customization? I&#8217;m very meticulous in choices, laboriously deciding what to do, what not and what to choose from. Here is my short opinion on these question:</p>
<ul>
<li>Intension on user experience: component (or View) are not presented in standard Android outlet;</li>
<li>Polish application with your own idea of view;</li>
<li>Enrich the standard View&#8217;s: improve quality, enhance with new capabilities;</li>
<li>You want your application looks the same on any mobile platforms;</li>
<li>What ever you want, just put here, in place of your own wishes.</li>
</ul>
<p>Do not want either to compare Android user experience and View&#8217;s with iPhone, nor discriminate one of these wonderful devices, although must slightly touch a difference between them. Really, should.</p>
<p><strong><u>Android Standard UI Elements Are&#8230; Not Sexy</u></strong></p>
<p>Attention please: <em>I have to admit, I&#8217;ve been trying to write this post without enjoying a beer!</em></p>
<p>As a developers and designers we are trying to create the best quality application, for best user experience. Sometimes, our attempts are fail by lacking features in the language, <del datetime="2012-01-25T15:22:10+00:00">in the frameworks,</del> in the platform. Hence, to fill these missing we are spending more time to do something, to fill the lack through the magic incantations. In many cases, it just works fine for everyone. Well, loosely speaking, visual comparison is the best way to realize the difference among them. Two applications &#8211; two platforms (and two absolutely different languages, different patterns). I&#8217;ve been selected the <a href="http://dailybooth.com/" title="DailyBooth" target="_blank">DailyBooth</a> application for these purposes. You could choose your own. iPhone version comes first:</p>
<p align="center"><img src="http://www.apleben.com/wp-content/uploads/2011/01/dailybootha.png" title="dailybooth" width="320" height="480" /><img src="http://www.apleben.com/wp-content/uploads/2011/01/dailybooth2.jpg" title="dailybooth" /></p>
<p>Android goes next:</p>
<p align="center"><img src="http://www.apleben.com/wp-content/uploads/2011/01/boothDroid1.png" title="BoothDroid" /><img src="http://www.apleben.com/wp-content/uploads/2011/01/boothDroid2.png" title="BoothDroid" /></p>
<p>Can somebody spot the differentiation?</p>
<p><strong><u>Implementation</u></strong></p>
<p>To implement our own View, first we need create a new class, those will extend the Android View class. As the next step, we need to implement the constructors of our newly created View:</p>
<ul>
<li align="left">One constructor required for in-code creation of our View;</li>
<li align="left">The second one is required for inflation from resource file.</li>
</ul>
<p>Also, we should override</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_SEXYWe  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_SEXYWe .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_SEXYWetable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_SEXYWetable td, .pygmentize_SEXYWetable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_SEXYWe pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_SEXYWe {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_SEXYWe {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_SEXYWe td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_SEXYWe .hll { background-color: #ffffcc }
.pygmentize_SEXYWe  { background: #f0f0f0; }
.pygmentize_SEXYWe .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_SEXYWe .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_SEXYWe .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_SEXYWe .o { color: #666666 } /* Operator */
.pygmentize_SEXYWe .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_SEXYWe .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_SEXYWe .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_SEXYWe .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_SEXYWe .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_SEXYWe .ge { font-style: italic } /* Generic.Emph */
.pygmentize_SEXYWe .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_SEXYWe .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_SEXYWe .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_SEXYWe .go { color: #808080 } /* Generic.Output */
.pygmentize_SEXYWe .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_SEXYWe .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_SEXYWe .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_SEXYWe .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_SEXYWe .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_SEXYWe .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_SEXYWe .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_SEXYWe .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_SEXYWe .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_SEXYWe .kt { color: #902000 } /* Keyword.Type */
.pygmentize_SEXYWe .m { color: #40a070 } /* Literal.Number */
.pygmentize_SEXYWe .s { color: #4070a0 } /* Literal.String */
.pygmentize_SEXYWe .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_SEXYWe .nb { color: #007020 } /* Name.Builtin */
.pygmentize_SEXYWe .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_SEXYWe .no { color: #60add5 } /* Name.Constant */
.pygmentize_SEXYWe .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_SEXYWe .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_SEXYWe .ne { color: #007020 } /* Name.Exception */
.pygmentize_SEXYWe .nf { color: #06287e } /* Name.Function */
.pygmentize_SEXYWe .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_SEXYWe .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_SEXYWe .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_SEXYWe .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_SEXYWe .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_SEXYWe .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_SEXYWe .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_SEXYWe .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_SEXYWe .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_SEXYWe .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_SEXYWe .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_SEXYWe .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_SEXYWe .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_SEXYWe .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_SEXYWe .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_SEXYWe .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_SEXYWe .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_SEXYWe .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_SEXYWe .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_SEXYWe .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_SEXYWe .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_SEXYWe .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_SEXYWe .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_SEXYWe .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_SEXYWe .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_SEXYWe .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_SEXYWetable"><tr><td class="linenos pygmentize_SEXYWe"><div class="linenodiv pygmentize_SEXYWe"><pre>1</pre></div></td><td class="code"><div class="pygmentize_SEXYWe"><pre><span class="kd">protected</span> <span class="kt">void</span> <span class="nf">onMeasure</span><span class="o">(</span><span class="kt">int</span> <span class="n">wMeasureSpec</span><span class="o">,</span> <span class="kt">int</span> <span class="n">hMeasureSpec</span><span class="o">)</span> <span class="o">{</span> <span class="o">}</span>
</pre></div>
</td></tr></table>

<p>to properly inflate the View and make a call for</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_d3Dmtk  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_d3Dmtk .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_d3Dmtktable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_d3Dmtktable td, .pygmentize_d3Dmtktable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_d3Dmtk pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_d3Dmtk {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_d3Dmtk {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_d3Dmtk td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_d3Dmtk .hll { background-color: #ffffcc }
.pygmentize_d3Dmtk  { background: #f0f0f0; }
.pygmentize_d3Dmtk .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_d3Dmtk .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_d3Dmtk .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_d3Dmtk .o { color: #666666 } /* Operator */
.pygmentize_d3Dmtk .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_d3Dmtk .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_d3Dmtk .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_d3Dmtk .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_d3Dmtk .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_d3Dmtk .ge { font-style: italic } /* Generic.Emph */
.pygmentize_d3Dmtk .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_d3Dmtk .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_d3Dmtk .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_d3Dmtk .go { color: #808080 } /* Generic.Output */
.pygmentize_d3Dmtk .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_d3Dmtk .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_d3Dmtk .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_d3Dmtk .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_d3Dmtk .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_d3Dmtk .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_d3Dmtk .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_d3Dmtk .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_d3Dmtk .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_d3Dmtk .kt { color: #902000 } /* Keyword.Type */
.pygmentize_d3Dmtk .m { color: #40a070 } /* Literal.Number */
.pygmentize_d3Dmtk .s { color: #4070a0 } /* Literal.String */
.pygmentize_d3Dmtk .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_d3Dmtk .nb { color: #007020 } /* Name.Builtin */
.pygmentize_d3Dmtk .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_d3Dmtk .no { color: #60add5 } /* Name.Constant */
.pygmentize_d3Dmtk .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_d3Dmtk .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_d3Dmtk .ne { color: #007020 } /* Name.Exception */
.pygmentize_d3Dmtk .nf { color: #06287e } /* Name.Function */
.pygmentize_d3Dmtk .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_d3Dmtk .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_d3Dmtk .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_d3Dmtk .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_d3Dmtk .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_d3Dmtk .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_d3Dmtk .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_d3Dmtk .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_d3Dmtk .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_d3Dmtk .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_d3Dmtk .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_d3Dmtk .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_d3Dmtk .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_d3Dmtk .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_d3Dmtk .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_d3Dmtk .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_d3Dmtk .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_d3Dmtk .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_d3Dmtk .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_d3Dmtk .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_d3Dmtk .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_d3Dmtk .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_d3Dmtk .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_d3Dmtk .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_d3Dmtk .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_d3Dmtk .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_d3Dmtktable"><tr><td class="linenos pygmentize_d3Dmtk"><div class="linenodiv pygmentize_d3Dmtk"><pre>1</pre></div></td><td class="code"><div class="pygmentize_d3Dmtk"><pre><span class="n">setMeasuredDimension</span><span class="o">(</span><span class="n">measuredHeight</span><span class="o">,</span> <span class="n">measuredWidth</span><span class="o">);</span>
</pre></div>
</td></tr></table>

<p>to set the dimension of our View. Otherwise, we will issue a runtime exception when the controls is laid out. To get a <em>measured height</em> and <em>width</em> we also should implement two additional methods, those will calculate the ideal size of the control:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_6Qx3hq  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_6Qx3hq .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_6Qx3hqtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_6Qx3hqtable td, .pygmentize_6Qx3hqtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_6Qx3hq pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_6Qx3hq {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_6Qx3hq {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_6Qx3hq td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_6Qx3hq .hll { background-color: #ffffcc }
.pygmentize_6Qx3hq  { background: #f0f0f0; }
.pygmentize_6Qx3hq .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_6Qx3hq .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_6Qx3hq .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_6Qx3hq .o { color: #666666 } /* Operator */
.pygmentize_6Qx3hq .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_6Qx3hq .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_6Qx3hq .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_6Qx3hq .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_6Qx3hq .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_6Qx3hq .ge { font-style: italic } /* Generic.Emph */
.pygmentize_6Qx3hq .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_6Qx3hq .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_6Qx3hq .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_6Qx3hq .go { color: #808080 } /* Generic.Output */
.pygmentize_6Qx3hq .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_6Qx3hq .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_6Qx3hq .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_6Qx3hq .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_6Qx3hq .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_6Qx3hq .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_6Qx3hq .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_6Qx3hq .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_6Qx3hq .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_6Qx3hq .kt { color: #902000 } /* Keyword.Type */
.pygmentize_6Qx3hq .m { color: #40a070 } /* Literal.Number */
.pygmentize_6Qx3hq .s { color: #4070a0 } /* Literal.String */
.pygmentize_6Qx3hq .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_6Qx3hq .nb { color: #007020 } /* Name.Builtin */
.pygmentize_6Qx3hq .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_6Qx3hq .no { color: #60add5 } /* Name.Constant */
.pygmentize_6Qx3hq .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_6Qx3hq .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_6Qx3hq .ne { color: #007020 } /* Name.Exception */
.pygmentize_6Qx3hq .nf { color: #06287e } /* Name.Function */
.pygmentize_6Qx3hq .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_6Qx3hq .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_6Qx3hq .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_6Qx3hq .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_6Qx3hq .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_6Qx3hq .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_6Qx3hq .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_6Qx3hq .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_6Qx3hq .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_6Qx3hq .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_6Qx3hq .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_6Qx3hq .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_6Qx3hq .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_6Qx3hq .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_6Qx3hq .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_6Qx3hq .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_6Qx3hq .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_6Qx3hq .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_6Qx3hq .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_6Qx3hq .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_6Qx3hq .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_6Qx3hq .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_6Qx3hq .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_6Qx3hq .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_6Qx3hq .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_6Qx3hq .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_6Qx3hqtable"><tr><td class="linenos pygmentize_6Qx3hq"><div class="linenodiv pygmentize_6Qx3hq"><pre>1
2</pre></div></td><td class="code"><div class="pygmentize_6Qx3hq"><pre><span class="kd">private</span> <span class="kt">int</span> <span class="nf">measureHeight</span><span class="o">(</span><span class="kt">int</span> <span class="n">measureSpec</span><span class="o">)</span> <span class="o">{</span> <span class="o">}</span>
<span class="kd">private</span> <span class="kt">int</span> <span class="nf">measureWidth</span><span class="o">(</span><span class="kt">int</span> <span class="n">measureSpec</span><span class="o">)</span> <span class="o">{</span> <span class="o">}</span>
</pre></div>
</td></tr></table>

<p>These two methods will operate with parameters pushed into <em><u>onMeasure</u></em><em>()</em> to calculate size of the control. Inflation of the control is only a part of the job. We wish that our View will be sexy, polish and amazing! To do that, we should override</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_3ADjsw  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_3ADjsw .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_3ADjswtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_3ADjswtable td, .pygmentize_3ADjswtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_3ADjsw pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_3ADjsw {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_3ADjsw {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_3ADjsw td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_3ADjsw .hll { background-color: #ffffcc }
.pygmentize_3ADjsw  { background: #f0f0f0; }
.pygmentize_3ADjsw .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_3ADjsw .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_3ADjsw .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_3ADjsw .o { color: #666666 } /* Operator */
.pygmentize_3ADjsw .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_3ADjsw .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_3ADjsw .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_3ADjsw .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_3ADjsw .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_3ADjsw .ge { font-style: italic } /* Generic.Emph */
.pygmentize_3ADjsw .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_3ADjsw .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_3ADjsw .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_3ADjsw .go { color: #808080 } /* Generic.Output */
.pygmentize_3ADjsw .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_3ADjsw .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_3ADjsw .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_3ADjsw .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_3ADjsw .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_3ADjsw .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_3ADjsw .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_3ADjsw .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_3ADjsw .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_3ADjsw .kt { color: #902000 } /* Keyword.Type */
.pygmentize_3ADjsw .m { color: #40a070 } /* Literal.Number */
.pygmentize_3ADjsw .s { color: #4070a0 } /* Literal.String */
.pygmentize_3ADjsw .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_3ADjsw .nb { color: #007020 } /* Name.Builtin */
.pygmentize_3ADjsw .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_3ADjsw .no { color: #60add5 } /* Name.Constant */
.pygmentize_3ADjsw .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_3ADjsw .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_3ADjsw .ne { color: #007020 } /* Name.Exception */
.pygmentize_3ADjsw .nf { color: #06287e } /* Name.Function */
.pygmentize_3ADjsw .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_3ADjsw .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_3ADjsw .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_3ADjsw .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_3ADjsw .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_3ADjsw .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_3ADjsw .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_3ADjsw .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_3ADjsw .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_3ADjsw .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_3ADjsw .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_3ADjsw .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_3ADjsw .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_3ADjsw .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_3ADjsw .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_3ADjsw .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_3ADjsw .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_3ADjsw .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_3ADjsw .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_3ADjsw .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_3ADjsw .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_3ADjsw .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_3ADjsw .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_3ADjsw .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_3ADjsw .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_3ADjsw .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_3ADjswtable"><tr><td class="linenos pygmentize_3ADjsw"><div class="linenodiv pygmentize_3ADjsw"><pre>1</pre></div></td><td class="code"><div class="pygmentize_3ADjsw"><pre><span class="kd">protected</span> <span class="kt">void</span> <span class="nf">onDraw</span><span class="o">(</span><span class="n">Canvas</span> <span class="n">canvas</span><span class="o">)</span> <span class="o">{</span> <span class="o">}</span>
</pre></div>
</td></tr></table>

<p>and perform anything we want here through the canvas.</p>
<p align="center"><img src="http://www.apleben.com/wp-content/uploads/2011/01/achtung.jpg" /></p>
<p>And ones more&#8230; <span style=" color:#ff0000;"><strong>Achtung!!!</strong></span> For efficiency reasons NEVER create your Paint instances in the <em>onDraw(Canvas canvas) { } </em>, this should to be done in the constructor! The same is applicable to any other reusable objects: <em><u>creation should be done in the constructor!</u></em></p>
<p>The skeleton code of the custom View is presented below:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_UqX88C  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_UqX88C .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_UqX88Ctable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_UqX88Ctable td, .pygmentize_UqX88Ctable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_UqX88C pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_UqX88C {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_UqX88C {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_UqX88C td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_UqX88C .hll { background-color: #ffffcc }
.pygmentize_UqX88C  { background: #f0f0f0; }
.pygmentize_UqX88C .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_UqX88C .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_UqX88C .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_UqX88C .o { color: #666666 } /* Operator */
.pygmentize_UqX88C .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_UqX88C .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_UqX88C .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_UqX88C .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_UqX88C .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_UqX88C .ge { font-style: italic } /* Generic.Emph */
.pygmentize_UqX88C .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_UqX88C .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_UqX88C .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_UqX88C .go { color: #808080 } /* Generic.Output */
.pygmentize_UqX88C .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_UqX88C .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_UqX88C .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_UqX88C .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_UqX88C .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_UqX88C .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_UqX88C .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_UqX88C .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_UqX88C .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_UqX88C .kt { color: #902000 } /* Keyword.Type */
.pygmentize_UqX88C .m { color: #40a070 } /* Literal.Number */
.pygmentize_UqX88C .s { color: #4070a0 } /* Literal.String */
.pygmentize_UqX88C .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_UqX88C .nb { color: #007020 } /* Name.Builtin */
.pygmentize_UqX88C .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_UqX88C .no { color: #60add5 } /* Name.Constant */
.pygmentize_UqX88C .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_UqX88C .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_UqX88C .ne { color: #007020 } /* Name.Exception */
.pygmentize_UqX88C .nf { color: #06287e } /* Name.Function */
.pygmentize_UqX88C .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_UqX88C .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_UqX88C .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_UqX88C .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_UqX88C .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_UqX88C .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_UqX88C .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_UqX88C .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_UqX88C .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_UqX88C .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_UqX88C .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_UqX88C .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_UqX88C .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_UqX88C .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_UqX88C .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_UqX88C .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_UqX88C .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_UqX88C .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_UqX88C .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_UqX88C .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_UqX88C .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_UqX88C .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_UqX88C .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_UqX88C .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_UqX88C .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_UqX88C .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_UqX88Ctable"><tr><td class="linenos pygmentize_UqX88C"><div class="linenodiv pygmentize_UqX88C"><pre>  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133</pre></div></td><td class="code"><div class="pygmentize_UqX88C"><pre><span class="kn">import</span> <span class="nn">android.content.Context</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.graphics.Canvas</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.graphics.Color</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.graphics.Paint</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.util.AttributeSet</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.view.KeyEvent</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.view.MotionEvent</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">android.view.View</span><span class="o">;</span>

<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyView</span> <span class="kd">extends</span> <span class="n">View</span> <span class="o">{</span>
    <span class="kd">private</span> <span class="n">Paint</span> <span class="n">mTextPaint</span><span class="o">;</span>

    <span class="c1">// Constructor required for in-code creation</span>
    <span class="kd">public</span> <span class="nf">MyView</span><span class="o">(</span><span class="n">Context</span> <span class="n">context</span><span class="o">)</span> <span class="o">{</span>
        <span class="kd">super</span><span class="o">(</span><span class="n">context</span><span class="o">);</span>
        <span class="n">initBrushes</span><span class="o">();</span>
    <span class="o">}</span>

    <span class="c1">//Constructor required for inflation from resource file</span>
    <span class="kd">public</span> <span class="nf">MyView</span><span class="o">(</span><span class="n">Context</span> <span class="n">context</span><span class="o">,</span> <span class="n">AttributeSet</span> <span class="n">attrs</span><span class="o">)</span> <span class="o">{</span>
        <span class="kd">super</span><span class="o">(</span><span class="n">context</span><span class="o">,</span> <span class="n">attrs</span><span class="o">);</span>
        <span class="n">initBrushes</span><span class="o">();</span>
    <span class="o">}</span>

    <span class="c1">// Constructor required for inflation from resource file</span>
    <span class="kd">public</span> <span class="nf">MyView</span><span class="o">(</span><span class="n">Context</span> <span class="n">context</span><span class="o">,</span> <span class="n">AttributeSet</span> <span class="n">attrs</span><span class="o">,</span> <span class="kt">int</span> <span class="n">defStyle</span><span class="o">)</span> <span class="o">{</span>
        <span class="kd">super</span><span class="o">(</span><span class="n">context</span><span class="o">,</span> <span class="n">attrs</span><span class="o">,</span> <span class="n">defStyle</span><span class="o">);</span>
        <span class="n">initBrushes</span><span class="o">();</span>
    <span class="o">}</span>

    <span class="nd">@Override</span>
    <span class="kd">public</span> <span class="kt">boolean</span> <span class="nf">onKeyDown</span><span class="o">(</span><span class="kt">int</span> <span class="n">keyCode</span><span class="o">,</span> <span class="n">KeyEvent</span> <span class="n">keyEvent</span><span class="o">)</span> <span class="o">{</span>
        <span class="c1">// Return true if the event was handled.</span>
        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">}</span>

    <span class="nd">@Override</span>
    <span class="kd">public</span> <span class="kt">boolean</span> <span class="nf">onKeyUp</span><span class="o">(</span><span class="kt">int</span> <span class="n">keyCode</span><span class="o">,</span> <span class="n">KeyEvent</span> <span class="n">keyEvent</span><span class="o">)</span> <span class="o">{</span>
        <span class="c1">// Return true if the event was handled.</span>
        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">}</span>

    <span class="nd">@Override</span>
    <span class="kd">public</span> <span class="kt">boolean</span> <span class="nf">onTrackballEvent</span><span class="o">(</span><span class="n">MotionEvent</span> <span class="n">event</span><span class="o">)</span> <span class="o">{</span>
        <span class="c1">// Get the type of action this event represents</span>
        <span class="kt">int</span> <span class="n">actionPerformed</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="na">getAction</span><span class="o">();</span>
        <span class="c1">// Return true if the event was handled.</span>
        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">}</span>

    <span class="nd">@Override</span>
    <span class="kd">public</span> <span class="kt">boolean</span> <span class="nf">onTouchEvent</span><span class="o">(</span><span class="n">MotionEvent</span> <span class="n">event</span><span class="o">)</span> <span class="o">{</span>
        <span class="c1">// Get the type of action this event represents</span>
        <span class="kt">int</span> <span class="n">actionPerformed</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="na">getAction</span><span class="o">();</span>
        <span class="c1">// Return true if the event was handled.</span>
        <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
    <span class="o">}</span>

    <span class="nd">@Override</span>
    <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">onMeasure</span><span class="o">(</span><span class="kt">int</span> <span class="n">wMeasureSpec</span><span class="o">,</span> <span class="kt">int</span> <span class="n">hMeasureSpec</span><span class="o">)</span> <span class="o">{</span>
        <span class="kt">int</span> <span class="n">measuredHeight</span> <span class="o">=</span> <span class="n">measureHeight</span><span class="o">(</span><span class="n">hMeasureSpec</span><span class="o">);</span>
        <span class="kt">int</span> <span class="n">measuredWidth</span> <span class="o">=</span> <span class="n">measureWidth</span><span class="o">(</span><span class="n">wMeasureSpec</span><span class="o">);</span>
        <span class="c1">// MUST make this call to setMeasuredDimension</span>
        <span class="c1">// or you will cause a runtime exception when</span>
        <span class="c1">// the control is laid out.</span>
        <span class="n">setMeasuredDimension</span><span class="o">(</span><span class="n">measuredHeight</span><span class="o">,</span> <span class="n">measuredWidth</span><span class="o">);</span>
    <span class="o">}</span>

    <span class="nd">@Override</span>
    <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">onDraw</span><span class="o">(</span><span class="n">Canvas</span> <span class="n">canvas</span><span class="o">)</span> <span class="o">{</span>
        <span class="c1">// Get the size of the control based on the last call to onMeasure.</span>
        <span class="kt">int</span> <span class="n">height</span> <span class="o">=</span> <span class="n">getMeasuredHeight</span><span class="o">();</span>
        <span class="kt">int</span> <span class="n">width</span> <span class="o">=</span> <span class="n">getMeasuredWidth</span><span class="o">();</span>
        <span class="c1">// Find the center</span>
        <span class="kt">int</span> <span class="n">px</span> <span class="o">=</span> <span class="n">width</span> <span class="o">/</span> <span class="mi">2</span><span class="o">;</span>
        <span class="kt">int</span> <span class="n">py</span> <span class="o">=</span> <span class="n">height</span> <span class="o">/</span> <span class="mi">2</span><span class="o">;</span>

        <span class="n">mTextPaint</span><span class="o">.</span><span class="na">setColor</span><span class="o">(</span><span class="n">Color</span><span class="o">.</span><span class="na">WHITE</span><span class="o">);</span>
        <span class="c1">// Define the string.</span>
        <span class="n">String</span> <span class="n">displayText</span> <span class="o">=</span> <span class="s">&quot;My custom View!&quot;</span><span class="o">;</span>
        <span class="c1">// Measure the width of the text string.</span>
        <span class="kt">float</span> <span class="n">textWidth</span> <span class="o">=</span> <span class="n">mTextPaint</span><span class="o">.</span><span class="na">measureText</span><span class="o">(</span><span class="n">displayText</span><span class="o">);</span>
        <span class="c1">// Draw the text string in the center of the control.</span>
        <span class="n">canvas</span><span class="o">.</span><span class="na">drawText</span><span class="o">(</span><span class="n">displayText</span><span class="o">,</span> <span class="n">px</span> <span class="o">-</span> <span class="n">textWidth</span> <span class="o">/</span> <span class="mi">2</span><span class="o">,</span> <span class="n">py</span><span class="o">,</span> <span class="n">mTextPaint</span><span class="o">);</span>
    <span class="o">}</span>

    <span class="kd">private</span> <span class="kt">void</span> <span class="nf">initBrushes</span><span class="o">()</span> <span class="o">{</span>
        <span class="c1">// Create the new paint brushes.</span>
        <span class="c1">// NOTE: For efficiency this should be done in</span>
        <span class="c1">// the views&#39; constructor</span>
        <span class="n">mTextPaint</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Paint</span><span class="o">(</span><span class="n">Paint</span><span class="o">.</span><span class="na">ANTI_ALIAS_FLAG</span><span class="o">);</span>

        <span class="c1">// Create any other reusable objects here</span>
    <span class="o">}</span>

    <span class="kd">private</span> <span class="kt">int</span> <span class="nf">measureHeight</span><span class="o">(</span><span class="kt">int</span> <span class="n">measureSpec</span><span class="o">)</span> <span class="o">{</span>
        <span class="kt">int</span> <span class="n">specMode</span> <span class="o">=</span> <span class="n">MeasureSpec</span><span class="o">.</span><span class="na">getMode</span><span class="o">(</span><span class="n">measureSpec</span><span class="o">);</span>
        <span class="kt">int</span> <span class="n">specSize</span> <span class="o">=</span> <span class="n">MeasureSpec</span><span class="o">.</span><span class="na">getSize</span><span class="o">(</span><span class="n">measureSpec</span><span class="o">);</span>
        <span class="c1">// Default size if no limits are specified.</span>
        <span class="kt">int</span> <span class="n">result</span> <span class="o">=</span> <span class="mi">500</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="n">specMode</span> <span class="o">==</span> <span class="n">MeasureSpec</span><span class="o">.</span><span class="na">AT_MOST</span><span class="o">)</span> <span class="o">{</span>
            <span class="c1">// Calculate the ideal size of your</span>
            <span class="c1">// control within this maximum size.</span>
            <span class="c1">// If your control fills the available</span>
            <span class="c1">// space return the outer bound.</span>
            <span class="n">result</span> <span class="o">=</span> <span class="n">specSize</span><span class="o">;</span>
        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">specMode</span> <span class="o">==</span> <span class="n">MeasureSpec</span><span class="o">.</span><span class="na">EXACTLY</span><span class="o">)</span> <span class="o">{</span>
            <span class="c1">// If your control can fit within these bounds return that value.</span>
            <span class="n">result</span> <span class="o">=</span> <span class="n">specSize</span><span class="o">;</span>
        <span class="o">}</span>
        <span class="k">return</span> <span class="n">result</span><span class="o">;</span>
    <span class="o">}</span>

    <span class="kd">private</span> <span class="kt">int</span> <span class="nf">measureWidth</span><span class="o">(</span><span class="kt">int</span> <span class="n">measureSpec</span><span class="o">)</span> <span class="o">{</span>
        <span class="kt">int</span> <span class="n">specMode</span> <span class="o">=</span> <span class="n">MeasureSpec</span><span class="o">.</span><span class="na">getMode</span><span class="o">(</span><span class="n">measureSpec</span><span class="o">);</span>
        <span class="kt">int</span> <span class="n">specSize</span> <span class="o">=</span> <span class="n">MeasureSpec</span><span class="o">.</span><span class="na">getSize</span><span class="o">(</span><span class="n">measureSpec</span><span class="o">);</span>
        <span class="c1">// Default size if no limits are specified.</span>
        <span class="kt">int</span> <span class="n">result</span> <span class="o">=</span> <span class="mi">500</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="n">specMode</span> <span class="o">==</span> <span class="n">MeasureSpec</span><span class="o">.</span><span class="na">AT_MOST</span><span class="o">)</span> <span class="o">{</span>
            <span class="c1">// Calculate the ideal size of your control</span>
            <span class="c1">// within this maximum size.</span>
            <span class="c1">// If your control fills the available space</span>
            <span class="c1">// return the outer bound.</span>
            <span class="n">result</span> <span class="o">=</span> <span class="n">specSize</span><span class="o">;</span>
        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">specMode</span> <span class="o">==</span> <span class="n">MeasureSpec</span><span class="o">.</span><span class="na">EXACTLY</span><span class="o">)</span> <span class="o">{</span>
            <span class="c1">// If your control can fit within these bounds return that value.</span>
            <span class="n">result</span> <span class="o">=</span> <span class="n">specSize</span><span class="o">;</span>
        <span class="o">}</span>
        <span class="k">return</span> <span class="n">result</span><span class="o">;</span>
    <span class="o">}</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p>Nonetheless, we could extend not only the View class, also we can do the same by extending an existing controls, like Button, TextView and so one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2011/01/custom-android-view-the-definition/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Encrypting your class files</title>
		<link>http://www.apleben.com/2010/12/encrypting-your-class-files/</link>
		<comments>http://www.apleben.com/2010/12/encrypting-your-class-files/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 20:46:54 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ClassLoader]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=295</guid>
		<description><![CDATA[A couple of months ago I was thought about one feature: how to cipher my class files? And this post I will put into this way. In any case, why you should worry about that? Why you need to encrypt and then decrypt your class files back? Of course, you should not worry about that [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2010/12/encrypted.png" width="240" />
		</p><p>A couple of months ago I was thought about one feature: how to cipher my class files? And this post I will put into this way. In any case, why you should worry about that? Why you need to encrypt and then decrypt your class files back? Of course, you should not worry about that if your project is completely Open Source, therefore your code is open to everyone. But you should worry about protection of the code if your project, obviously, a proprietary software and you want to keep it closed against any attempts to crack it. Whenever you are inventor of the revolutionary idea or just want to promote a paid version of the software, you should worry about protection of your code against to be stolen.</p>
<p>The first to keep in mind is: your algorithm should to be unique! I will try to show you how to implement a simplest version of it. Any sophistications need to be your own.</p>
<p><strong><span style="text-decoration: underline;"> The math approach and the model</span></strong></p>
<p><img class="alignleft size-medium wp-image-297" title="math" src="http://www.apleben.com/wp-content/uploads/2010/12/math2-300x199.jpg" alt="" width="300" height="199" />I never talking about that (because it is mean to be a programmer), but here I come&#8230;. you should not scary the mathematics, this is your friend. And don&#8217;t give up, never! If the mathematics terminology is associated only with your grumpy teacher and that&#8217;s it, I cannot help you. Reconstruct yourself and your mind too.</p>
<p>Okay, lets go into the math model and what to start from. First, behind the all math model we will use a pair of the keys: public key and private key. The private key you should keep safely. In our demo we will hard code the private key into the tool and let to user choose his own public key. Also, I think the private key need to be long enough. The private key for our demo is:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_XgswMK  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_XgswMK .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_XgswMKtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_XgswMKtable td, .pygmentize_XgswMKtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_XgswMK pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_XgswMK {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_XgswMK {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_XgswMK td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_XgswMK .hll { background-color: #ffffcc }
.pygmentize_XgswMK  { background: #f0f0f0; }
.pygmentize_XgswMK .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_XgswMK .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_XgswMK .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_XgswMK .o { color: #666666 } /* Operator */
.pygmentize_XgswMK .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_XgswMK .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_XgswMK .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_XgswMK .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_XgswMK .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_XgswMK .ge { font-style: italic } /* Generic.Emph */
.pygmentize_XgswMK .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_XgswMK .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_XgswMK .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_XgswMK .go { color: #808080 } /* Generic.Output */
.pygmentize_XgswMK .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_XgswMK .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_XgswMK .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_XgswMK .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_XgswMK .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_XgswMK .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_XgswMK .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_XgswMK .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_XgswMK .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_XgswMK .kt { color: #902000 } /* Keyword.Type */
.pygmentize_XgswMK .m { color: #40a070 } /* Literal.Number */
.pygmentize_XgswMK .s { color: #4070a0 } /* Literal.String */
.pygmentize_XgswMK .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_XgswMK .nb { color: #007020 } /* Name.Builtin */
.pygmentize_XgswMK .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_XgswMK .no { color: #60add5 } /* Name.Constant */
.pygmentize_XgswMK .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_XgswMK .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_XgswMK .ne { color: #007020 } /* Name.Exception */
.pygmentize_XgswMK .nf { color: #06287e } /* Name.Function */
.pygmentize_XgswMK .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_XgswMK .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_XgswMK .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_XgswMK .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_XgswMK .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_XgswMK .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_XgswMK .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_XgswMK .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_XgswMK .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_XgswMK .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_XgswMK .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_XgswMK .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_XgswMK .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_XgswMK .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_XgswMK .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_XgswMK .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_XgswMK .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_XgswMK .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_XgswMK .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_XgswMK .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_XgswMK .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_XgswMK .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_XgswMK .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_XgswMK .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_XgswMK .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_XgswMK .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_XgswMKtable"><tr><td class="linenos pygmentize_XgswMK"><div class="linenodiv pygmentize_XgswMK"><pre>1
2
3</pre></div></td><td class="code"><div class="pygmentize_XgswMK"><pre><span class="c1">// the private key.</span>

<span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">String</span> <span class="n">privateKey</span> <span class="o">=</span> <span class="s">&quot;Rechtsschutzversicherungsgesellschaften&quot;</span><span class="o">;</span>
</pre></div>
</td></tr></table>

<p>For the encryption process purposes we will use custom algorithm to cipher the class files. You may choose your own or just use one of the standard algorithm like RSA, AES and so fourth. In the <em>encryptProcessing()</em> method we are instantiating the <em>EasyCipher</em> class instance with our hard coded private key (do you remember it?):</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_Yt6MFS  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_Yt6MFS .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_Yt6MFStable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_Yt6MFStable td, .pygmentize_Yt6MFStable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_Yt6MFS pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_Yt6MFS {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_Yt6MFS {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_Yt6MFS td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_Yt6MFS .hll { background-color: #ffffcc }
.pygmentize_Yt6MFS  { background: #f0f0f0; }
.pygmentize_Yt6MFS .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_Yt6MFS .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_Yt6MFS .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_Yt6MFS .o { color: #666666 } /* Operator */
.pygmentize_Yt6MFS .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_Yt6MFS .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_Yt6MFS .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_Yt6MFS .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_Yt6MFS .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_Yt6MFS .ge { font-style: italic } /* Generic.Emph */
.pygmentize_Yt6MFS .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_Yt6MFS .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_Yt6MFS .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_Yt6MFS .go { color: #808080 } /* Generic.Output */
.pygmentize_Yt6MFS .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_Yt6MFS .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_Yt6MFS .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_Yt6MFS .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_Yt6MFS .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_Yt6MFS .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_Yt6MFS .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_Yt6MFS .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_Yt6MFS .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_Yt6MFS .kt { color: #902000 } /* Keyword.Type */
.pygmentize_Yt6MFS .m { color: #40a070 } /* Literal.Number */
.pygmentize_Yt6MFS .s { color: #4070a0 } /* Literal.String */
.pygmentize_Yt6MFS .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_Yt6MFS .nb { color: #007020 } /* Name.Builtin */
.pygmentize_Yt6MFS .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_Yt6MFS .no { color: #60add5 } /* Name.Constant */
.pygmentize_Yt6MFS .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_Yt6MFS .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_Yt6MFS .ne { color: #007020 } /* Name.Exception */
.pygmentize_Yt6MFS .nf { color: #06287e } /* Name.Function */
.pygmentize_Yt6MFS .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_Yt6MFS .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_Yt6MFS .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_Yt6MFS .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_Yt6MFS .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_Yt6MFS .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_Yt6MFS .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_Yt6MFS .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_Yt6MFS .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_Yt6MFS .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_Yt6MFS .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_Yt6MFS .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_Yt6MFS .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_Yt6MFS .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_Yt6MFS .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_Yt6MFS .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_Yt6MFS .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_Yt6MFS .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_Yt6MFS .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_Yt6MFS .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_Yt6MFS .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_Yt6MFS .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_Yt6MFS .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_Yt6MFS .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_Yt6MFS .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_Yt6MFS .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_Yt6MFStable"><tr><td class="linenos pygmentize_Yt6MFS"><div class="linenodiv pygmentize_Yt6MFS"><pre>1
2
3
4
5
6
7</pre></div></td><td class="code"><div class="pygmentize_Yt6MFS"><pre><span class="kd">private</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">encryptProcessing</span><span class="o">()</span> <span class="o">{</span>

<span class="c1">// creating easy cipher with the private key</span>
<span class="n">EasyCipher</span> <span class="n">cipher</span> <span class="o">=</span> <span class="k">new</span> <span class="n">EasyCipher</span><span class="o">(</span><span class="n">privateKey</span><span class="o">);</span>

<span class="c1">//...</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p>As the next step, we are generating the secret and unique pass phrase with a public key provided by the user. Also, we are parsing our string pass phrase to the integer key, those will be used in the actual byte shifting:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_7L6kn1  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_7L6kn1 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_7L6kn1table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_7L6kn1table td, .pygmentize_7L6kn1table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_7L6kn1 pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_7L6kn1 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_7L6kn1 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_7L6kn1 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_7L6kn1 .hll { background-color: #ffffcc }
.pygmentize_7L6kn1  { background: #f0f0f0; }
.pygmentize_7L6kn1 .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_7L6kn1 .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_7L6kn1 .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_7L6kn1 .o { color: #666666 } /* Operator */
.pygmentize_7L6kn1 .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_7L6kn1 .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_7L6kn1 .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_7L6kn1 .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_7L6kn1 .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_7L6kn1 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_7L6kn1 .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_7L6kn1 .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_7L6kn1 .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_7L6kn1 .go { color: #808080 } /* Generic.Output */
.pygmentize_7L6kn1 .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_7L6kn1 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_7L6kn1 .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_7L6kn1 .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_7L6kn1 .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_7L6kn1 .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_7L6kn1 .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_7L6kn1 .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_7L6kn1 .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_7L6kn1 .kt { color: #902000 } /* Keyword.Type */
.pygmentize_7L6kn1 .m { color: #40a070 } /* Literal.Number */
.pygmentize_7L6kn1 .s { color: #4070a0 } /* Literal.String */
.pygmentize_7L6kn1 .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_7L6kn1 .nb { color: #007020 } /* Name.Builtin */
.pygmentize_7L6kn1 .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_7L6kn1 .no { color: #60add5 } /* Name.Constant */
.pygmentize_7L6kn1 .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_7L6kn1 .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_7L6kn1 .ne { color: #007020 } /* Name.Exception */
.pygmentize_7L6kn1 .nf { color: #06287e } /* Name.Function */
.pygmentize_7L6kn1 .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_7L6kn1 .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_7L6kn1 .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_7L6kn1 .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_7L6kn1 .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_7L6kn1 .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_7L6kn1 .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_7L6kn1 .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_7L6kn1 .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_7L6kn1 .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_7L6kn1 .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_7L6kn1 .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_7L6kn1 .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_7L6kn1 .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_7L6kn1 .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_7L6kn1 .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_7L6kn1 .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_7L6kn1 .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_7L6kn1 .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_7L6kn1 .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_7L6kn1 .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_7L6kn1 .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_7L6kn1 .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_7L6kn1 .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_7L6kn1 .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_7L6kn1 .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_7L6kn1table"><tr><td class="linenos pygmentize_7L6kn1"><div class="linenodiv pygmentize_7L6kn1"><pre>1
2
3
4
5
6
7
8</pre></div></td><td class="code"><div class="pygmentize_7L6kn1"><pre><span class="kd">private</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">encryptProcessing</span><span class="o">()</span> <span class="o">{</span>
<span class="c1">//...</span>
<span class="c1">// generating the secret pass phrase with a public key</span>
<span class="kd">final</span> <span class="n">String</span> <span class="n">passPhrase</span> <span class="o">=</span> <span class="n">cipher</span><span class="o">.</span><span class="na">encrypt</span><span class="o">(</span><span class="n">publicKey</span><span class="o">);</span>
<span class="kd">final</span> <span class="kt">int</span> <span class="n">key</span> <span class="o">=</span> <span class="n">parseString</span><span class="o">(</span><span class="n">passPhrase</span><span class="o">);</span>

<span class="c1">//...</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p>After we are obtained our unique key, we can now go throughout the directory with class files, that need to be ciphered! What we will gone do with this obtained key? Okay, this is where magic comes true&#8230;. We will fetch the directory with class files, construct out file with &#8220;.pinpuk&#8221; suffixes instead of &#8220;.class&#8221; (pretty funny, eah?), will read the bytes of each class file <em>and add to each byte our unique key obtained previously,</em> write each byte to the output file with &#8220;.pinpuk&#8221; suffix. Here is the code outline:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_IA677a  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_IA677a .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_IA677atable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_IA677atable td, .pygmentize_IA677atable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_IA677a pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_IA677a {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_IA677a {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_IA677a td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_IA677a .hll { background-color: #ffffcc }
.pygmentize_IA677a  { background: #f0f0f0; }
.pygmentize_IA677a .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_IA677a .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_IA677a .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_IA677a .o { color: #666666 } /* Operator */
.pygmentize_IA677a .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_IA677a .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_IA677a .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_IA677a .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_IA677a .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_IA677a .ge { font-style: italic } /* Generic.Emph */
.pygmentize_IA677a .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_IA677a .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_IA677a .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_IA677a .go { color: #808080 } /* Generic.Output */
.pygmentize_IA677a .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_IA677a .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_IA677a .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_IA677a .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_IA677a .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_IA677a .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_IA677a .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_IA677a .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_IA677a .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_IA677a .kt { color: #902000 } /* Keyword.Type */
.pygmentize_IA677a .m { color: #40a070 } /* Literal.Number */
.pygmentize_IA677a .s { color: #4070a0 } /* Literal.String */
.pygmentize_IA677a .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_IA677a .nb { color: #007020 } /* Name.Builtin */
.pygmentize_IA677a .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_IA677a .no { color: #60add5 } /* Name.Constant */
.pygmentize_IA677a .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_IA677a .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_IA677a .ne { color: #007020 } /* Name.Exception */
.pygmentize_IA677a .nf { color: #06287e } /* Name.Function */
.pygmentize_IA677a .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_IA677a .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_IA677a .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_IA677a .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_IA677a .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_IA677a .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_IA677a .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_IA677a .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_IA677a .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_IA677a .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_IA677a .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_IA677a .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_IA677a .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_IA677a .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_IA677a .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_IA677a .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_IA677a .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_IA677a .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_IA677a .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_IA677a .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_IA677a .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_IA677a .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_IA677a .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_IA677a .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_IA677a .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_IA677a .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_IA677atable"><tr><td class="linenos pygmentize_IA677a"><div class="linenodiv pygmentize_IA677a"><pre> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52</pre></div></td><td class="code"><div class="pygmentize_IA677a"><pre><span class="k">try</span> <span class="o">{</span>
            <span class="c1">// Loads all class files found in the directory &quot;inputDir&quot;</span>
            <span class="n">File</span> <span class="n">classDir</span> <span class="o">=</span> <span class="k">new</span> <span class="n">File</span><span class="o">(</span><span class="n">inputDir</span><span class="o">);</span>
            <span class="n">FileTreeWalker</span> <span class="n">walker</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FileTreeWalker</span><span class="o">(</span><span class="n">classDir</span><span class="o">,</span>
                    <span class="k">new</span> <span class="nf">UnixGlobFileFilter</span><span class="o">(</span><span class="s">&quot;*.class&quot;</span><span class="o">));</span>
            <span class="n">walker</span><span class="o">.</span><span class="na">walk</span><span class="o">(</span><span class="k">new</span> <span class="n">FileTreeWalk</span><span class="o">()</span> <span class="o">{</span>
                <span class="nd">@Override</span>
                <span class="kd">public</span> <span class="kt">void</span> <span class="nf">walk</span><span class="o">(</span><span class="n">File</span> <span class="n">path</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">IOException</span> <span class="o">{</span>
                    <span class="n">FileInputStream</span> <span class="n">in</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="n">FileOutputStream</span> <span class="n">out</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="n">FileChannel</span> <span class="n">channel</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="k">try</span> <span class="o">{</span>
                        <span class="c1">// constructing an out file with &quot;.pinpuk&quot; suffixes instead of &quot;.class&quot;</span>
                        <span class="n">String</span> <span class="n">outFileName</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="na">getName</span><span class="o">().</span><span class="na">substring</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span>
                                         <span class="n">path</span><span class="o">.</span><span class="na">getName</span><span class="o">().</span><span class="na">lastIndexOf</span><span class="o">(</span><span class="sc">&#39;.&#39;</span><span class="o">))</span> <span class="o">+</span> <span class="s">&quot;.pinpuk&quot;</span><span class="o">;</span>
                        <span class="n">String</span> <span class="n">outFile</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="na">getParent</span><span class="o">()</span> <span class="o">+</span> <span class="s">&quot;/&quot;</span> <span class="o">+</span> <span class="n">outFileName</span><span class="o">;</span>

                        <span class="n">in</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FileInputStream</span><span class="o">(</span><span class="n">path</span><span class="o">);</span>
                        <span class="n">out</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FileOutputStream</span><span class="o">(</span><span class="n">outFile</span><span class="o">);</span>
                        <span class="n">channel</span> <span class="o">=</span> <span class="n">in</span><span class="o">.</span><span class="na">getChannel</span><span class="o">();</span>

                        <span class="kt">int</span> <span class="n">length</span> <span class="o">=</span> <span class="o">(</span><span class="kt">int</span><span class="o">)</span> <span class="n">channel</span><span class="o">.</span><span class="na">size</span><span class="o">();</span>
                        <span class="n">MappedByteBuffer</span> <span class="n">buffer</span> <span class="o">=</span> <span class="n">channel</span><span class="o">.</span><span class="na">map</span><span class="o">(</span>
                                         <span class="n">FileChannel</span><span class="o">.</span><span class="na">MapMode</span><span class="o">.</span><span class="na">READ_ONLY</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="n">length</span><span class="o">);</span>

                        <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">p</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">p</span> <span class="o">&lt;</span> <span class="n">length</span><span class="o">;</span> <span class="n">p</span><span class="o">++)</span> <span class="o">{</span>
                            <span class="kt">int</span> <span class="n">ch</span> <span class="o">=</span> <span class="n">buffer</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="n">p</span><span class="o">);</span>
                            <span class="kt">byte</span> <span class="n">c</span> <span class="o">=</span> <span class="o">(</span><span class="kt">byte</span><span class="o">)</span> <span class="o">(</span><span class="n">ch</span> <span class="o">+</span> <span class="n">key</span><span class="o">);</span>
                            <span class="n">out</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="n">c</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">FileNotFoundException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
                        <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
                    <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
                        <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
                    <span class="o">}</span> <span class="k">finally</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="n">channel</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                            <span class="n">channel</span><span class="o">.</span><span class="na">close</span><span class="o">();</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="n">in</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                            <span class="n">in</span><span class="o">.</span><span class="na">close</span><span class="o">();</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="n">out</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                            <span class="n">out</span><span class="o">.</span><span class="na">close</span><span class="o">();</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

        <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">exception</span><span class="o">)</span> <span class="o">{</span>
            <span class="n">exception</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
        <span class="o">}</span>
    <span class="o">}</span>
</pre></div>
</td></tr></table>

<p>However, I forgot to mention and explain the <em>EasyCipher</em>. He takes only two methods:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_BIDMHl  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_BIDMHl .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_BIDMHltable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_BIDMHltable td, .pygmentize_BIDMHltable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_BIDMHl pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_BIDMHl {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_BIDMHl {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_BIDMHl td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_BIDMHl .hll { background-color: #ffffcc }
.pygmentize_BIDMHl  { background: #f0f0f0; }
.pygmentize_BIDMHl .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_BIDMHl .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_BIDMHl .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_BIDMHl .o { color: #666666 } /* Operator */
.pygmentize_BIDMHl .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_BIDMHl .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_BIDMHl .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_BIDMHl .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_BIDMHl .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_BIDMHl .ge { font-style: italic } /* Generic.Emph */
.pygmentize_BIDMHl .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_BIDMHl .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_BIDMHl .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_BIDMHl .go { color: #808080 } /* Generic.Output */
.pygmentize_BIDMHl .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_BIDMHl .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_BIDMHl .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_BIDMHl .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_BIDMHl .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_BIDMHl .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_BIDMHl .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_BIDMHl .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_BIDMHl .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_BIDMHl .kt { color: #902000 } /* Keyword.Type */
.pygmentize_BIDMHl .m { color: #40a070 } /* Literal.Number */
.pygmentize_BIDMHl .s { color: #4070a0 } /* Literal.String */
.pygmentize_BIDMHl .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_BIDMHl .nb { color: #007020 } /* Name.Builtin */
.pygmentize_BIDMHl .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_BIDMHl .no { color: #60add5 } /* Name.Constant */
.pygmentize_BIDMHl .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_BIDMHl .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_BIDMHl .ne { color: #007020 } /* Name.Exception */
.pygmentize_BIDMHl .nf { color: #06287e } /* Name.Function */
.pygmentize_BIDMHl .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_BIDMHl .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_BIDMHl .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_BIDMHl .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_BIDMHl .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_BIDMHl .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_BIDMHl .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_BIDMHl .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_BIDMHl .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_BIDMHl .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_BIDMHl .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_BIDMHl .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_BIDMHl .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_BIDMHl .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_BIDMHl .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_BIDMHl .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_BIDMHl .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_BIDMHl .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_BIDMHl .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_BIDMHl .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_BIDMHl .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_BIDMHl .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_BIDMHl .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_BIDMHl .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_BIDMHl .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_BIDMHl .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_BIDMHl"><pre><span class="kd">public</span> <span class="n">String</span> <span class="nf">encrypt</span><span class="o">(</span><span class="kd">final</span> <span class="n">String</span> <span class="n">text</span><span class="o">)</span> <span class="o">{};</span>

<span class="kd">public</span> <span class="n">String</span> <span class="nf">decrypt</span><span class="o">(</span><span class="kd">final</span> <span class="n">String</span> <span class="n">text</span><span class="o">)</span> <span class="o">{};</span>
</pre></div>


<p>One of the methods encrypt and another one decrypt provided string with our <em>custom algorithm (there your implementation go).</em> I will show here only one implementation &#8211; of the encryption method. The whole source code you could find in the end of this post (do not want to read it? Drop it and fetch the code):</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_AZ4Mjx  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_AZ4Mjx .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_AZ4Mjxtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_AZ4Mjxtable td, .pygmentize_AZ4Mjxtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_AZ4Mjx pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_AZ4Mjx {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_AZ4Mjx {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_AZ4Mjx td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_AZ4Mjx .hll { background-color: #ffffcc }
.pygmentize_AZ4Mjx  { background: #f0f0f0; }
.pygmentize_AZ4Mjx .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_AZ4Mjx .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_AZ4Mjx .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_AZ4Mjx .o { color: #666666 } /* Operator */
.pygmentize_AZ4Mjx .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_AZ4Mjx .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_AZ4Mjx .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_AZ4Mjx .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_AZ4Mjx .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_AZ4Mjx .ge { font-style: italic } /* Generic.Emph */
.pygmentize_AZ4Mjx .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_AZ4Mjx .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_AZ4Mjx .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_AZ4Mjx .go { color: #808080 } /* Generic.Output */
.pygmentize_AZ4Mjx .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_AZ4Mjx .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_AZ4Mjx .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_AZ4Mjx .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_AZ4Mjx .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_AZ4Mjx .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_AZ4Mjx .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_AZ4Mjx .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_AZ4Mjx .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_AZ4Mjx .kt { color: #902000 } /* Keyword.Type */
.pygmentize_AZ4Mjx .m { color: #40a070 } /* Literal.Number */
.pygmentize_AZ4Mjx .s { color: #4070a0 } /* Literal.String */
.pygmentize_AZ4Mjx .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_AZ4Mjx .nb { color: #007020 } /* Name.Builtin */
.pygmentize_AZ4Mjx .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_AZ4Mjx .no { color: #60add5 } /* Name.Constant */
.pygmentize_AZ4Mjx .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_AZ4Mjx .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_AZ4Mjx .ne { color: #007020 } /* Name.Exception */
.pygmentize_AZ4Mjx .nf { color: #06287e } /* Name.Function */
.pygmentize_AZ4Mjx .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_AZ4Mjx .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_AZ4Mjx .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_AZ4Mjx .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_AZ4Mjx .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_AZ4Mjx .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_AZ4Mjx .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_AZ4Mjx .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_AZ4Mjx .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_AZ4Mjx .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_AZ4Mjx .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_AZ4Mjx .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_AZ4Mjx .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_AZ4Mjx .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_AZ4Mjx .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_AZ4Mjx .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_AZ4Mjx .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_AZ4Mjx .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_AZ4Mjx .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_AZ4Mjx .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_AZ4Mjx .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_AZ4Mjx .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_AZ4Mjx .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_AZ4Mjx .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_AZ4Mjx .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_AZ4Mjx .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_AZ4Mjxtable"><tr><td class="linenos pygmentize_AZ4Mjx"><div class="linenodiv pygmentize_AZ4Mjx"><pre> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20</pre></div></td><td class="code"><div class="pygmentize_AZ4Mjx"><pre><span class="kd">public</span> <span class="n">String</span> <span class="nf">encrypt</span><span class="o">(</span><span class="kd">final</span> <span class="n">String</span> <span class="n">text</span><span class="o">)</span> <span class="o">{</span>
<span class="kt">long</span> <span class="n">finalKey</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span>

<span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">key</span><span class="o">.</span><span class="na">length</span><span class="o">();</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span>
      <span class="kt">long</span> <span class="n">tmpKey</span> <span class="o">=</span> <span class="n">key</span><span class="o">.</span><span class="na">charAt</span><span class="o">(</span><span class="n">i</span><span class="o">);</span>
      <span class="n">tmpKey</span> <span class="o">*=</span> <span class="mi">128</span><span class="o">;</span>
      <span class="n">finalKey</span> <span class="o">+=</span> <span class="n">tmpKey</span><span class="o">;</span>
<span class="o">}</span>

<span class="n">Random</span> <span class="n">generator</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Random</span><span class="o">(</span><span class="n">finalKey</span><span class="o">);</span>
<span class="n">String</span> <span class="n">result</span> <span class="o">=</span> <span class="s">&quot;&quot;</span><span class="o">;</span>

<span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">text</span><span class="o">.</span><span class="na">length</span><span class="o">();</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span>
      <span class="kt">int</span> <span class="n">temp</span> <span class="o">=</span> <span class="o">(</span><span class="kt">int</span><span class="o">)</span> <span class="n">text</span><span class="o">.</span><span class="na">charAt</span><span class="o">(</span><span class="n">i</span><span class="o">);</span>
      <span class="n">temp</span> <span class="o">+=</span> <span class="n">generator</span><span class="o">.</span><span class="na">nextInt</span><span class="o">(</span><span class="mi">95</span><span class="o">);</span>
      <span class="k">if</span> <span class="o">(</span><span class="n">temp</span> <span class="o">&gt;</span> <span class="mi">126</span><span class="o">)</span> <span class="n">temp</span> <span class="o">-=</span> <span class="mi">95</span><span class="o">;</span>
      <span class="n">result</span> <span class="o">+=</span> <span class="o">(</span><span class="kt">char</span><span class="o">)</span> <span class="n">temp</span><span class="o">;</span>
<span class="o">}</span>
<span class="k">return</span> <span class="n">result</span><span class="o">;</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p>Pretty easy, right? This is there the mathematic is our best friend ever.</p>
<p>As the last words here, I need to explain how to use the tool to encrypt your own class files:</p>
<ul>
<li>Run the CryptoClassTool. This is the gui based utility;</li>
<li>Chose the directory with your class files (probably, select one of the files) or provide it directly;</li>
<li>Enter your public key;</li>
<li>Push an appropriate button to start;</li>
<li>Get the Success message.</li>
</ul>
<p><strong><span style="text-decoration: underline;">Loading encrypted class files</span></strong></p>
<p><img class="alignleft size-full wp-image-298" title="decryption" src="http://www.apleben.com/wp-content/uploads/2010/12/encryption.relaxed.jpg" alt="" width="250" height="237" />An encrypted class loading process is the back stage of the ciphering. Although, a loading an encrypted classes directly is a trivial task (we only need to use our own class loader and decrypt every byte from a file with the same unique key, that we used in the ciphering process), when we trying to do the same by putting class files into the jar file the easiest is gone away. I was stuck in this problem for a couple of days or so by searching for solution. The problem is that the class files are located now in the jar archive, loading process is completely different and much harder. To implement our custom class loader we need to extend the <em>URLClassLoader</em> for our current situation and implement some of his methods to do a proper class decryption and loading, of course. I&#8217;ve implemented all of these tasks in <em>CryptoClassLoader</em> class, those extended <em>URLClassLoader</em> mentioned above. Therefore, if you have a particular interest in the code of the <em>CryptoClassLoader</em> class, you could find it in the archive provided below. He is too big to be explained right here. Our custom <em>CryptoClassLoader</em> is backward compatible with the preceding process of the class encryption. He just decrypts the ciphered classes and loads it in the appropriate manner from the jar archive.</p>
<p>Now we have a lot of work behind, but the one question is still staying annoyingly: how to use this custom ClassLoader to load the ciphered files?</p>
<p>This is much easier than you can imagine. Let me explain it through the code. Firstly, we need to find a location of our jar file:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_LkLouJ  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_LkLouJ .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_LkLouJtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_LkLouJtable td, .pygmentize_LkLouJtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_LkLouJ pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_LkLouJ {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_LkLouJ {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_LkLouJ td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_LkLouJ .hll { background-color: #ffffcc }
.pygmentize_LkLouJ  { background: #f0f0f0; }
.pygmentize_LkLouJ .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_LkLouJ .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_LkLouJ .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_LkLouJ .o { color: #666666 } /* Operator */
.pygmentize_LkLouJ .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_LkLouJ .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_LkLouJ .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_LkLouJ .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_LkLouJ .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_LkLouJ .ge { font-style: italic } /* Generic.Emph */
.pygmentize_LkLouJ .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_LkLouJ .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_LkLouJ .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_LkLouJ .go { color: #808080 } /* Generic.Output */
.pygmentize_LkLouJ .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_LkLouJ .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_LkLouJ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_LkLouJ .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_LkLouJ .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_LkLouJ .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_LkLouJ .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_LkLouJ .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_LkLouJ .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_LkLouJ .kt { color: #902000 } /* Keyword.Type */
.pygmentize_LkLouJ .m { color: #40a070 } /* Literal.Number */
.pygmentize_LkLouJ .s { color: #4070a0 } /* Literal.String */
.pygmentize_LkLouJ .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_LkLouJ .nb { color: #007020 } /* Name.Builtin */
.pygmentize_LkLouJ .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_LkLouJ .no { color: #60add5 } /* Name.Constant */
.pygmentize_LkLouJ .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_LkLouJ .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_LkLouJ .ne { color: #007020 } /* Name.Exception */
.pygmentize_LkLouJ .nf { color: #06287e } /* Name.Function */
.pygmentize_LkLouJ .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_LkLouJ .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_LkLouJ .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_LkLouJ .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_LkLouJ .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_LkLouJ .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_LkLouJ .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_LkLouJ .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_LkLouJ .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_LkLouJ .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_LkLouJ .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_LkLouJ .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_LkLouJ .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_LkLouJ .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_LkLouJ .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_LkLouJ .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_LkLouJ .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_LkLouJ .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_LkLouJ .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_LkLouJ .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_LkLouJ .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_LkLouJ .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_LkLouJ .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_LkLouJ .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_LkLouJ .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_LkLouJ .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<div class="pygmentize_LkLouJ"><pre><span class="n">CodeSource</span> <span class="n">src</span> <span class="o">=</span> <span class="n">CryptoClassDemo</span><span class="o">.</span><span class="na">class</span><span class="o">.</span><span class="na">getProtectionDomain</span><span class="o">().</span><span class="na">getCodeSource</span><span class="o">();</span>
<span class="n">URL</span> <span class="n">jar</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>

<span class="k">if</span> <span class="o">(</span><span class="n">src</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
      <span class="n">jar</span> <span class="o">=</span> <span class="n">src</span><span class="o">.</span><span class="na">getLocation</span><span class="o">();</span>
<span class="o">}</span>
</pre></div>


<p>Secondly, load the class files from this jar file. Doing so by passing two parameters: class file to load and the location of our jar archive:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_atg2nX  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_atg2nX .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_atg2nXtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_atg2nXtable td, .pygmentize_atg2nXtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_atg2nX pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_atg2nX {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_atg2nX {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_atg2nX td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_atg2nX .hll { background-color: #ffffcc }
.pygmentize_atg2nX  { background: #f0f0f0; }
.pygmentize_atg2nX .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_atg2nX .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_atg2nX .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_atg2nX .o { color: #666666 } /* Operator */
.pygmentize_atg2nX .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_atg2nX .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_atg2nX .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_atg2nX .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_atg2nX .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_atg2nX .ge { font-style: italic } /* Generic.Emph */
.pygmentize_atg2nX .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_atg2nX .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_atg2nX .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_atg2nX .go { color: #808080 } /* Generic.Output */
.pygmentize_atg2nX .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_atg2nX .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_atg2nX .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_atg2nX .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_atg2nX .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_atg2nX .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_atg2nX .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_atg2nX .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_atg2nX .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_atg2nX .kt { color: #902000 } /* Keyword.Type */
.pygmentize_atg2nX .m { color: #40a070 } /* Literal.Number */
.pygmentize_atg2nX .s { color: #4070a0 } /* Literal.String */
.pygmentize_atg2nX .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_atg2nX .nb { color: #007020 } /* Name.Builtin */
.pygmentize_atg2nX .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_atg2nX .no { color: #60add5 } /* Name.Constant */
.pygmentize_atg2nX .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_atg2nX .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_atg2nX .ne { color: #007020 } /* Name.Exception */
.pygmentize_atg2nX .nf { color: #06287e } /* Name.Function */
.pygmentize_atg2nX .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_atg2nX .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_atg2nX .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_atg2nX .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_atg2nX .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_atg2nX .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_atg2nX .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_atg2nX .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_atg2nX .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_atg2nX .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_atg2nX .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_atg2nX .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_atg2nX .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_atg2nX .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_atg2nX .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_atg2nX .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_atg2nX .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_atg2nX .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_atg2nX .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_atg2nX .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_atg2nX .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_atg2nX .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_atg2nX .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_atg2nX .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_atg2nX .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_atg2nX .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_atg2nXtable"><tr><td class="linenos pygmentize_atg2nX"><div class="linenodiv pygmentize_atg2nX"><pre> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42</pre></div></td><td class="code"><div class="pygmentize_atg2nX"><pre><span class="kd">private</span> <span class="kd">static</span> <span class="n">String</span> <span class="n">classFileToLoad</span> <span class="o">=</span> <span class="s">&quot;com.apleben.animation.AnimatedCurves.AnimatedCurvesDemo&quot;</span><span class="o">;</span>

<span class="k">try</span> <span class="o">{</span>
      <span class="n">loadClass</span><span class="o">(</span><span class="n">classFileToLoad</span><span class="o">,</span> <span class="n">jar</span><span class="o">);</span>
<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">ClassNotFoundException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
      <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">NoSuchMethodException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
      <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">InvocationTargetException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
      <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
<span class="o">}</span>

<span class="cm">/*</span>
<span class="cm"> * Runs the main method of a given encrypted class.</span>
<span class="cm"> *</span>
<span class="cm"> * @param name the class name</span>
<span class="cm"> * @param jar the url of the jar file</span>
<span class="cm"> */</span>
<span class="kd">private</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">loadClass</span><span class="o">(</span><span class="kd">final</span> <span class="n">String</span> <span class="n">name</span><span class="o">,</span> <span class="n">URL</span> <span class="n">jar</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">ClassNotFoundException</span><span class="o">,</span>
      <span class="n">NoSuchMethodException</span><span class="o">,</span> <span class="n">InvocationTargetException</span> <span class="o">{</span>
<span class="k">try</span> <span class="o">{</span>
      <span class="n">URLClassLoader</span> <span class="n">loader</span> <span class="o">=</span> <span class="k">new</span> <span class="n">CryptoClassLoader</span><span class="o">(</span><span class="n">publicKey</span><span class="o">,</span> <span class="n">jar</span><span class="o">);</span>
      <span class="n">Class</span><span class="o">&lt;&gt;</span> <span class="n">c</span> <span class="o">=</span> <span class="n">loader</span><span class="o">.</span><span class="na">loadClass</span><span class="o">(</span><span class="n">name</span><span class="o">);</span>

      <span class="n">Method</span> <span class="n">m</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="na">getMethod</span><span class="o">(</span><span class="s">&quot;main&quot;</span><span class="o">,</span> <span class="n">String</span><span class="o">[].</span><span class="na">class</span><span class="o">);</span>
      <span class="n">m</span><span class="o">.</span><span class="na">setAccessible</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
      <span class="kt">int</span> <span class="n">mods</span> <span class="o">=</span> <span class="n">m</span><span class="o">.</span><span class="na">getModifiers</span><span class="o">();</span>

      <span class="k">if</span> <span class="o">(</span><span class="n">m</span><span class="o">.</span><span class="na">getReturnType</span><span class="o">()</span> <span class="o">!=</span> <span class="kt">void</span><span class="o">.</span><span class="na">class</span> <span class="o">||</span> <span class="o">!</span><span class="n">Modifier</span><span class="o">.</span><span class="na">isStatic</span><span class="o">(</span><span class="n">mods</span><span class="o">)</span> <span class="o">||</span>
            <span class="o">!</span><span class="n">Modifier</span><span class="o">.</span><span class="na">isPublic</span><span class="o">(</span><span class="n">mods</span><span class="o">))</span> <span class="o">{</span>
            <span class="k">throw</span> <span class="k">new</span> <span class="nf">NoSuchMethodException</span><span class="o">(</span><span class="s">&quot;main&quot;</span><span class="o">);</span>
      <span class="o">}</span>

      <span class="k">try</span> <span class="o">{</span>
            <span class="n">m</span><span class="o">.</span><span class="na">invoke</span><span class="o">(</span><span class="kc">null</span><span class="o">,</span> <span class="o">(</span><span class="n">Object</span><span class="o">)</span> <span class="k">new</span> <span class="n">String</span><span class="o">[]{});</span>
      <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IllegalAccessException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
            <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span> <span class="c1">// should not happen</span>
      <span class="o">}</span>
<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">Throwable</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
      <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
<span class="o">}</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p>Thats it! We completed our work and left any questions behind. But if you have one, do not hesitate to ask your questions right here or type me a message. The source code you may find in the archive below. In the archive you will find two jar&#8217;s:</p>
<ul>
<li>The CryptoClassTool – that you could use to encrypt your own class files;</li>
<li>CryptoClassDemo – the demo that using CryptoClassLoader and previously encrypted classes.</li>
</ul>
<p><em> Thank you for attention!</em></p>
<p><a title="Download" href="http://www.apleben.com/content/apps/CryptoClassDemo/CryptoClassDemo.tar.gz" target="_self"><br />
<img title="Take It!" src="http://www.apleben.com/wp-content/uploads/2010/12/cardboard-box.png" alt="" width="100" height="100" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2010/12/encrypting-your-class-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Animated Curves Swing Demo</title>
		<link>http://www.apleben.com/2010/11/animated-curves-swing-demo/</link>
		<comments>http://www.apleben.com/2010/11/animated-curves-swing-demo/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 03:47:56 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=287</guid>
		<description><![CDATA[I thought, this is a time for a new demo application in the way of the Java Desktop. This is not a top secret for everybody, that the Java programming language is the most popular language around our world. Especially, he is very popular in the Enterprise world. Unfortunately, Java Swing desktop applications appearing in [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2010/11/logo6.png" width="240" />
		</p><p>I thought, this is a time for a new demo application in the way of the Java Desktop. This is not a top secret for everybody, that the <a title="Java" href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" target="_blank">Java programming language</a> is the most popular language around our world. Especially, he is very popular in the Enterprise world. Unfortunately,  <a title="Java Desktop" href="http://community.java.net/javadesktop" target="_blank">Java Swing desktop</a> applications appearing in our desktop environment much rarely. The evil tongues always told about &#8220;Java was dead for desktops&#8221;. I think, that is not a truth. The activity in this way is low and slow, not just because the Java Swing is are very bad and frustrating environment to develop with, but because Swing is very hard to study and to start to develop with it. Therefore, in many cases folks just cannot realize how to deal with that in a short move. I am even not talking about the customization of the components and some of the magic incantations to create the stunning, great looking desktop applications. Well, lets do something to reduce that barrier. Probably, we need more Swing based Open Source projects to grow up this way, which could be very exciting and useful for others.</p>
<p><strong><span style="text-decoration: underline;">Going further</span></strong></p>
<p>My attempt in this demo is very lightweight and simple (maybe for someone, that might look not so simple. This is just my things):</p>
<ul>
<li><em>Construction of the introduction panel with custom gradient panel;</em></li>
<li><em>Also, the introduction panel have a custom JComponent which doing his job as a blurred and pulsing logo;</em></li>
<li><em>The resulting panel with the same custom gradient panel, a non-opaque curves panel and again non-opaque panel with two custom round buttons;</em></li>
<li><em>Two &#8220;Start&#8221; and &#8220;Stop&#8221; buttons will start or stop the animation of the curves accordingly;</em></li>
<li><em>The slight transition effect between two panels is playing around by the Animated Transitions library help.</em></li>
</ul>
<p><strong><span style="text-decoration: underline;">Introduction Panel</span></strong></p>
<p><img class="alignleft size-medium wp-image-289" title="introduction panel" src="http://www.apleben.com/wp-content/uploads/2010/11/intro_panel-300x187.png" alt="" width="300" height="187" />That panel was build, as I obviously mentioned above, with custom gradient panel and with our not lesser customized logo. A steps after the panel&#8217;s construction are:</p>
<ul>
<li><em>The panel will appear with the alpha change from 0.0f to 1.0f of the JXpanel;</em></li>
<li><em>The custom logo will appear from highly blurred image to the original image;</em></li>
<li><em>The logo will pulsing three times;</em></li>
<li><em>As the next step, the introduction panel will transition from current panel to the result panel, where we can play with simple curves animation.</em></li>
</ul>
<p>The code of the gradient panel is simple:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_jznKRc  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_jznKRc .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_jznKRctable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_jznKRctable td, .pygmentize_jznKRctable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_jznKRc pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_jznKRc {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_jznKRc {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_jznKRc td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_jznKRc .hll { background-color: #ffffcc }
.pygmentize_jznKRc  { background: #f0f0f0; }
.pygmentize_jznKRc .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_jznKRc .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_jznKRc .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_jznKRc .o { color: #666666 } /* Operator */
.pygmentize_jznKRc .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_jznKRc .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_jznKRc .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_jznKRc .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_jznKRc .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_jznKRc .ge { font-style: italic } /* Generic.Emph */
.pygmentize_jznKRc .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_jznKRc .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_jznKRc .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_jznKRc .go { color: #808080 } /* Generic.Output */
.pygmentize_jznKRc .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_jznKRc .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_jznKRc .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_jznKRc .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_jznKRc .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_jznKRc .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_jznKRc .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_jznKRc .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_jznKRc .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_jznKRc .kt { color: #902000 } /* Keyword.Type */
.pygmentize_jznKRc .m { color: #40a070 } /* Literal.Number */
.pygmentize_jznKRc .s { color: #4070a0 } /* Literal.String */
.pygmentize_jznKRc .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_jznKRc .nb { color: #007020 } /* Name.Builtin */
.pygmentize_jznKRc .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_jznKRc .no { color: #60add5 } /* Name.Constant */
.pygmentize_jznKRc .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_jznKRc .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_jznKRc .ne { color: #007020 } /* Name.Exception */
.pygmentize_jznKRc .nf { color: #06287e } /* Name.Function */
.pygmentize_jznKRc .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_jznKRc .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_jznKRc .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_jznKRc .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_jznKRc .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_jznKRc .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_jznKRc .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_jznKRc .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_jznKRc .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_jznKRc .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_jznKRc .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_jznKRc .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_jznKRc .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_jznKRc .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_jznKRc .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_jznKRc .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_jznKRc .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_jznKRc .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_jznKRc .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_jznKRc .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_jznKRc .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_jznKRc .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_jznKRc .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_jznKRc .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_jznKRc .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_jznKRc .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_jznKRctable"><tr><td class="linenos pygmentize_jznKRc"><div class="linenodiv pygmentize_jznKRc"><pre> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62</pre></div></td><td class="code"><div class="pygmentize_jznKRc"><pre><span class="kd">public</span> <span class="kd">class</span> <span class="nc">GradientPanel</span> <span class="kd">extends</span> <span class="n">JPanel</span> <span class="o">{</span>
    <span class="kd">private</span> <span class="n">BufferedImage</span> <span class="n">gradientImage</span><span class="o">;</span>        <span class="c1">// gradient image cache</span>
    <span class="kd">private</span> <span class="n">Color</span> <span class="n">gradients</span> <span class="o">[]</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Color</span><span class="o">[]</span> <span class="o">{</span>  <span class="c1">// color gradients</span>
            <span class="k">new</span> <span class="nf">Color</span><span class="o">(</span><span class="mi">174</span><span class="o">,</span> <span class="mi">222</span><span class="o">,</span> <span class="mi">94</span><span class="o">),</span>
            <span class="k">new</span> <span class="nf">Color</span><span class="o">(</span><span class="mi">204</span><span class="o">,</span> <span class="mi">249</span><span class="o">,</span> <span class="mi">124</span><span class="o">),</span>
            <span class="k">new</span> <span class="nf">Color</span><span class="o">(</span><span class="mi">174</span><span class="o">,</span> <span class="mi">222</span><span class="o">,</span> <span class="mi">94</span><span class="o">)</span>
    <span class="o">};</span>
    <span class="c1">// ...</span>
    <span class="c1">// some of the code were omitted for brevity</span>
    <span class="c1">// ...</span>

    <span class="cm">/**</span>
<span class="cm">     * Painting the gradient image as a background</span>
<span class="cm">     * {@inheritDoc}</span>
<span class="cm">     */</span>
    <span class="nd">@Override</span>
    <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">paintComponent</span><span class="o">(</span><span class="n">Graphics</span> <span class="n">g</span><span class="o">)</span> <span class="o">{</span>
        <span class="n">createImageCache</span><span class="o">();</span>

        <span class="k">if</span> <span class="o">(</span><span class="n">gradientImage</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
            <span class="n">g</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">gradientImage</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="n">getWidth</span><span class="o">(),</span> <span class="n">getHeight</span><span class="o">(),</span> <span class="kc">null</span><span class="o">);</span>
        <span class="o">}</span>
    <span class="o">}</span>

    <span class="cm">/*</span>
<span class="cm">     * creating the gradient image cache</span>
<span class="cm">     */</span>
    <span class="kd">private</span> <span class="kt">void</span> <span class="nf">createImageCache</span><span class="o">()</span> <span class="o">{</span>
        <span class="c1">// it should not be widely, otherwise, enough for stretching the image</span>
        <span class="kt">int</span> <span class="n">width</span> <span class="o">=</span> <span class="mi">2</span><span class="o">;</span>
        <span class="kt">int</span> <span class="n">height</span> <span class="o">=</span> <span class="n">getHeight</span><span class="o">();</span>

        <span class="k">if</span> <span class="o">(</span><span class="n">height</span> <span class="o">==</span> <span class="mi">0</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">return</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="c1">// image caching paradigm.</span>
        <span class="c1">// It should be as a rule for the big images, like a backgrounds</span>
        <span class="k">if</span> <span class="o">(</span><span class="n">gradientImage</span> <span class="o">==</span> <span class="kc">null</span> <span class="o">||</span>
                <span class="n">width</span> <span class="o">!=</span> <span class="n">gradientImage</span><span class="o">.</span><span class="na">getWidth</span><span class="o">()</span> <span class="o">||</span>
                <span class="n">height</span> <span class="o">!=</span> <span class="n">gradientImage</span><span class="o">.</span><span class="na">getHeight</span><span class="o">())</span> <span class="o">{</span>

            <span class="n">gradientImage</span> <span class="o">=</span> <span class="n">GraphicsUtilities</span><span class="o">.</span>
                                  <span class="n">createCompatibleImage</span><span class="o">(</span><span class="n">width</span><span class="o">,</span> <span class="n">height</span><span class="o">);</span>
            <span class="n">Graphics2D</span> <span class="n">g2</span> <span class="o">=</span> <span class="n">gradientImage</span><span class="o">.</span><span class="na">createGraphics</span><span class="o">();</span>

            <span class="n">Point2D</span> <span class="n">start</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Point2D</span><span class="o">.</span><span class="na">Float</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">);</span>
            <span class="n">Point2D</span> <span class="n">end</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Point2D</span><span class="o">.</span><span class="na">Float</span><span class="o">(</span><span class="n">width</span><span class="o">,</span> <span class="n">height</span><span class="o">);</span>
            <span class="kt">float</span> <span class="n">dist</span> <span class="o">[]</span> <span class="o">=</span> <span class="o">{</span><span class="mf">0.0f</span><span class="o">,</span> <span class="mf">0.5f</span><span class="o">,</span> <span class="mf">1.0f</span><span class="o">};</span>
            <span class="n">LinearGradientPaint</span> <span class="n">gradient</span> <span class="o">=</span>
                  <span class="k">new</span> <span class="nf">LinearGradientPaint</span><span class="o">(</span><span class="n">start</span><span class="o">,</span> <span class="n">end</span><span class="o">,</span> <span class="n">dist</span><span class="o">,</span> <span class="n">gradients</span><span class="o">);</span>
            <span class="n">g2</span><span class="o">.</span><span class="na">setPaint</span><span class="o">(</span><span class="n">gradient</span><span class="o">);</span>

            <span class="n">g2</span><span class="o">.</span><span class="na">fillRect</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="n">width</span><span class="o">,</span> <span class="n">height</span><span class="o">);</span>

            <span class="n">g2</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
        <span class="o">}</span>
    <span class="o">}</span>
    <span class="c1">// ...</span>
    <span class="c1">// some of the code were omitted for brevity</span>
    <span class="c1">// ...</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p>There is not so interesting as our custom logo&#8217;s code. Well, lets looks at this point! The logo has two effects, those transitioning one from another, then one effect was done another will appear. Two effects is → disappearing blur effect (in these cases I mean a reduced radius of the blur filter) as first and pulsing effect as the next one.</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_WumS2t  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_WumS2t .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_WumS2ttable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_WumS2ttable td, .pygmentize_WumS2ttable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_WumS2t pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_WumS2t {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_WumS2t {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_WumS2t td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_WumS2t .hll { background-color: #ffffcc }
.pygmentize_WumS2t  { background: #f0f0f0; }
.pygmentize_WumS2t .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_WumS2t .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_WumS2t .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_WumS2t .o { color: #666666 } /* Operator */
.pygmentize_WumS2t .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_WumS2t .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_WumS2t .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_WumS2t .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_WumS2t .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_WumS2t .ge { font-style: italic } /* Generic.Emph */
.pygmentize_WumS2t .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_WumS2t .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_WumS2t .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_WumS2t .go { color: #808080 } /* Generic.Output */
.pygmentize_WumS2t .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_WumS2t .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_WumS2t .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_WumS2t .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_WumS2t .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_WumS2t .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_WumS2t .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_WumS2t .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_WumS2t .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_WumS2t .kt { color: #902000 } /* Keyword.Type */
.pygmentize_WumS2t .m { color: #40a070 } /* Literal.Number */
.pygmentize_WumS2t .s { color: #4070a0 } /* Literal.String */
.pygmentize_WumS2t .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_WumS2t .nb { color: #007020 } /* Name.Builtin */
.pygmentize_WumS2t .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_WumS2t .no { color: #60add5 } /* Name.Constant */
.pygmentize_WumS2t .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_WumS2t .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_WumS2t .ne { color: #007020 } /* Name.Exception */
.pygmentize_WumS2t .nf { color: #06287e } /* Name.Function */
.pygmentize_WumS2t .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_WumS2t .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_WumS2t .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_WumS2t .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_WumS2t .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_WumS2t .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_WumS2t .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_WumS2t .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_WumS2t .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_WumS2t .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_WumS2t .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_WumS2t .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_WumS2t .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_WumS2t .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_WumS2t .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_WumS2t .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_WumS2t .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_WumS2t .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_WumS2t .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_WumS2t .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_WumS2t .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_WumS2t .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_WumS2t .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_WumS2t .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_WumS2t .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_WumS2t .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_WumS2ttable"><tr><td class="linenos pygmentize_WumS2t"><div class="linenodiv pygmentize_WumS2t"><pre>  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141</pre></div></td><td class="code"><div class="pygmentize_WumS2t"><pre>    <span class="cm">/**</span>
<span class="cm">     * Custom blurred and finally pulsed logo.</span>
<span class="cm">     * After instantiation performed the two sequence of animation steps.</span>
<span class="cm">     */</span>
    <span class="kd">public</span> <span class="kd">static</span> <span class="kd">class</span> <span class="nc">BlurPulseLogo</span> <span class="kd">extends</span> <span class="n">JComponent</span> <span class="o">{</span>
        <span class="kd">private</span> <span class="n">Animator</span> <span class="n">glowAnimator</span><span class="o">;</span>              <span class="c1">// the final pulse Animator</span>
        <span class="kd">private</span> <span class="n">BufferedImage</span> <span class="n">image</span><span class="o">,</span> <span class="n">glow</span><span class="o">,</span> <span class="n">blurred</span><span class="o">;</span> <span class="c1">// just an image cache</span>
        <span class="kd">private</span> <span class="kt">int</span> <span class="n">radius</span> <span class="o">=</span> <span class="mi">30</span><span class="o">;</span>                    <span class="c1">// Blur Filter radius</span>
        <span class="kd">private</span> <span class="n">GaussianBlurFilter</span> <span class="n">blurFilter</span><span class="o">;</span>      <span class="c1">// obviously, the Gaussian Blur Filter</span>
        <span class="kd">private</span> <span class="kt">boolean</span> <span class="n">blurPaint</span><span class="o">,</span> <span class="n">glowPaint</span><span class="o">;</span>       <span class="c1">// flags to paint the blur and pulse effects</span>
        <span class="kd">private</span> <span class="kt">float</span> <span class="n">alpha</span> <span class="o">=</span> <span class="mf">0.0f</span><span class="o">;</span>                 <span class="c1">// alpha for the pulse effect painting</span>

        <span class="kd">public</span> <span class="nf">BlurPulseLogo</span><span class="o">(</span><span class="kd">final</span> <span class="n">String</span> <span class="n">imageName</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">try</span> <span class="o">{</span>
                <span class="n">image</span> <span class="o">=</span> <span class="n">GraphicsUtilities</span><span class="o">.</span><span class="na">loadCompatibleImage</span><span class="o">(</span>
                                      <span class="n">getClass</span><span class="o">().</span><span class="na">getResource</span><span class="o">(</span><span class="n">imageName</span><span class="o">));</span>
            <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
            <span class="o">}</span>
            <span class="n">blurFilter</span> <span class="o">=</span> <span class="k">new</span> <span class="n">GaussianBlurFilter</span><span class="o">(</span><span class="n">radius</span><span class="o">);</span>
            <span class="n">PropertySetter</span> <span class="n">setter</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PropertySetter</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="s">&quot;alpha&quot;</span><span class="o">,</span> <span class="mf">0.0f</span><span class="o">,</span> <span class="mf">1.0f</span><span class="o">);</span>
            <span class="n">glowAnimator</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Animator</span><span class="o">(</span><span class="mi">800</span><span class="o">,</span> <span class="mf">6.0</span><span class="o">,</span> <span class="n">Animator</span><span class="o">.</span><span class="na">RepeatBehavior</span><span class="o">.</span><span class="na">REVERSE</span><span class="o">,</span> <span class="n">setter</span><span class="o">);</span>
        <span class="o">}</span>
        <span class="c1">// ...</span>
        <span class="c1">// some of the code were omitted for brevity</span>
        <span class="c1">// ...</span>

        <span class="kd">public</span> <span class="kt">float</span> <span class="nf">getAlpha</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="n">alpha</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="kd">public</span> <span class="kt">void</span> <span class="nf">setAlpha</span><span class="o">(</span><span class="kt">float</span> <span class="n">alpha</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="na">alpha</span> <span class="o">=</span> <span class="n">alpha</span><span class="o">;</span>
            <span class="n">repaint</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="kd">public</span> <span class="kt">int</span> <span class="nf">getRadius</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="n">radius</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="kd">public</span> <span class="kt">void</span> <span class="nf">setRadius</span><span class="o">(</span><span class="kt">int</span> <span class="n">radius</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="na">radius</span> <span class="o">=</span> <span class="n">radius</span><span class="o">;</span>
            <span class="n">blurFilter</span> <span class="o">=</span> <span class="k">new</span> <span class="n">GaussianBlurFilter</span><span class="o">(</span><span class="n">radius</span><span class="o">);</span>
            <span class="n">repaint</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="nd">@Override</span>
        <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">paintComponent</span><span class="o">(</span><span class="n">Graphics</span> <span class="n">g</span><span class="o">)</span> <span class="o">{</span>
            <span class="n">createImageCache</span><span class="o">();</span>

            <span class="n">Graphics2D</span> <span class="n">g2</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(</span><span class="n">blurPaint</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">g2</span> <span class="o">=</span> <span class="n">blurred</span><span class="o">.</span><span class="na">createGraphics</span><span class="o">();</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">setComposite</span><span class="o">(</span><span class="n">AlphaComposite</span><span class="o">.</span><span class="na">Clear</span><span class="o">);</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">fillRect</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="n">blurred</span><span class="o">.</span><span class="na">getWidth</span><span class="o">(),</span> <span class="n">blurred</span><span class="o">.</span><span class="na">getHeight</span><span class="o">());</span>

                <span class="n">g2</span><span class="o">.</span><span class="na">setComposite</span><span class="o">(</span><span class="n">AlphaComposite</span><span class="o">.</span><span class="na">SrcOver</span><span class="o">);</span>

                <span class="k">if</span> <span class="o">(</span><span class="n">radius</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="o">)</span> <span class="o">{</span>
                    <span class="n">g2</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">image</span><span class="o">,</span> <span class="n">blurFilter</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="n">g2</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">image</span><span class="o">,</span> <span class="kc">null</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">);</span>
                <span class="o">}</span>

                <span class="n">g2</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
            <span class="o">}</span>

            <span class="kt">int</span> <span class="n">x</span> <span class="o">=</span> <span class="o">(</span><span class="n">getWidth</span><span class="o">()</span> <span class="o">-</span> <span class="n">image</span><span class="o">.</span><span class="na">getWidth</span><span class="o">())</span> <span class="o">/</span> <span class="mi">2</span><span class="o">;</span>
            <span class="kt">int</span> <span class="n">y</span> <span class="o">=</span> <span class="o">(</span><span class="n">getHeight</span><span class="o">()</span> <span class="o">-</span> <span class="n">image</span><span class="o">.</span><span class="na">getHeight</span><span class="o">())</span> <span class="o">/</span> <span class="mi">2</span><span class="o">;</span>

            <span class="n">g2</span> <span class="o">=</span> <span class="o">(</span><span class="n">Graphics2D</span><span class="o">)</span> <span class="n">g</span><span class="o">.</span><span class="na">create</span><span class="o">();</span>

            <span class="k">if</span> <span class="o">(</span><span class="n">blurPaint</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">blurred</span><span class="o">,</span> <span class="n">x</span><span class="o">,</span> <span class="n">y</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">glowPaint</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">setComposite</span><span class="o">(</span><span class="n">AlphaComposite</span><span class="o">.</span><span class="na">SrcOver</span><span class="o">.</span><span class="na">derive</span><span class="o">(</span><span class="n">getAlpha</span><span class="o">()));</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">glow</span><span class="o">,</span> <span class="n">x</span><span class="o">,</span> <span class="n">y</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">setComposite</span><span class="o">(</span><span class="n">AlphaComposite</span><span class="o">.</span><span class="na">SrcOver</span><span class="o">);</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">image</span><span class="o">,</span> <span class="n">x</span><span class="o">,</span> <span class="n">y</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="n">g2</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="kd">private</span> <span class="kt">void</span> <span class="nf">createImageCache</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="n">blurred</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">blurred</span> <span class="o">=</span> <span class="n">GraphicsUtilities</span><span class="o">.</span><span class="na">createCompatibleTranslucentImage</span><span class="o">(</span>
                                 <span class="n">image</span><span class="o">.</span><span class="na">getWidth</span><span class="o">(),</span> <span class="n">image</span><span class="o">.</span><span class="na">getHeight</span><span class="o">());</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="n">glow</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">glow</span> <span class="o">=</span> <span class="n">GraphicsUtilities</span><span class="o">.</span><span class="na">createCompatibleImage</span><span class="o">(</span><span class="n">image</span><span class="o">);</span>

                <span class="n">Graphics2D</span> <span class="n">g2</span> <span class="o">=</span> <span class="n">glow</span><span class="o">.</span><span class="na">createGraphics</span><span class="o">();</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">image</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>

                <span class="n">BufferedImageOp</span> <span class="n">filter</span> <span class="o">=</span> <span class="k">new</span> <span class="n">GaussianBlurFilter</span><span class="o">(</span><span class="mi">24</span><span class="o">);</span>
                <span class="n">glow</span> <span class="o">=</span> <span class="n">filter</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">glow</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>
                <span class="n">filter</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ColorTintFilter</span><span class="o">(</span><span class="n">Color</span><span class="o">.</span><span class="na">WHITE</span><span class="o">,</span> <span class="mf">1.0f</span><span class="o">);</span>
                <span class="n">glow</span> <span class="o">=</span> <span class="n">filter</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">glow</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">}</span>

         <span class="kd">public</span> <span class="kt">void</span> <span class="nf">startAnimator</span><span class="o">()</span> <span class="o">{</span>
            <span class="n">startBlurAnimator</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="kd">private</span> <span class="kt">void</span> <span class="nf">startBlurAnimator</span><span class="o">()</span> <span class="o">{</span>
            <span class="n">blurPaint</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>               <span class="c1">// we should paint blur effect</span>
            <span class="n">glowPaint</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>              <span class="c1">// but not pulse right now</span>
            <span class="kd">final</span> <span class="kt">int</span> <span class="n">oldValue</span> <span class="o">=</span> <span class="n">getRadius</span><span class="o">();</span>

            <span class="n">Animator</span> <span class="n">animator</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Animator</span><span class="o">(</span><span class="mi">2800</span><span class="o">,</span> <span class="k">new</span> <span class="n">TimingTargetAdapter</span><span class="o">()</span> <span class="o">{</span>
                <span class="nd">@Override</span>
                <span class="kd">public</span> <span class="kt">void</span> <span class="nf">end</span><span class="o">()</span> <span class="o">{</span>
                    <span class="c1">// after blur was done, just switch it off in painting code</span>
                    <span class="n">blurPaint</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="n">radius</span> <span class="o">=</span> <span class="n">oldValue</span><span class="o">;</span>
                    <span class="n">startGlowAnimator</span><span class="o">();</span>    <span class="c1">// starting pulse animation</span>
                <span class="o">}</span>

                <span class="nd">@Override</span>
                <span class="kd">public</span> <span class="kt">void</span> <span class="nf">timingEvent</span><span class="o">(</span><span class="kt">float</span> <span class="n">fraction</span><span class="o">)</span> <span class="o">{</span>
                    <span class="c1">// is it are linear interpolation?! probably, the part of</span>
                    <span class="kt">int</span> <span class="n">value</span> <span class="o">=</span> <span class="o">(</span><span class="kt">int</span><span class="o">)</span> <span class="o">(</span><span class="n">oldValue</span> <span class="o">+</span> <span class="n">fraction</span> <span class="o">*</span> <span class="o">(-</span><span class="n">oldValue</span><span class="o">));</span>

                    <span class="k">if</span> <span class="o">(</span><span class="n">value</span> <span class="o">&gt;</span> <span class="n">oldValue</span><span class="o">)</span> <span class="n">value</span> <span class="o">=</span> <span class="n">oldValue</span><span class="o">;</span>
                    <span class="k">else</span> <span class="nf">if</span> <span class="o">(</span><span class="n">value</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="o">)</span> <span class="n">value</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span>

                    <span class="n">setRadius</span><span class="o">(</span><span class="n">value</span><span class="o">);</span>   <span class="c1">// setting the new radius and repaint</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="n">animator</span><span class="o">.</span><span class="na">start</span><span class="o">();</span>
        <span class="o">}</span>

        <span class="kd">private</span> <span class="kt">void</span> <span class="nf">startGlowAnimator</span><span class="o">()</span> <span class="o">{</span>
            <span class="n">glowPaint</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            <span class="n">glowAnimator</span><span class="o">.</span><span class="na">start</span><span class="o">();</span>
        <span class="o">}</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p><strong><span style="text-decoration: underline;">Result Panel as a result</span></strong></p>
<p><img class="alignleft size-medium wp-image-290" title="result panel" src="http://www.apleben.com/wp-content/uploads/2010/11/result_panel-300x187.png" alt="" width="300" height="187" />The resulting panel contains three panels inside:</p>
<ul>
<li><em>The gradient panel again;</em></li>
<li><em>The curves panel for animation purposes;</em></li>
<li><em>The buttons panel to start and stop our animation.</em></li>
</ul>
<p>The code of the gradient panel were presented above and he is very boring for us. The curves panel is not sophisticated and anybody of you, who is interesting in all source code, might find it at the end of this post. Looks from another position, the source of the custom round button could be interesting. And here we go:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_JHcOFM  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_JHcOFM .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_JHcOFMtable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_JHcOFMtable td, .pygmentize_JHcOFMtable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_JHcOFM pre {
  padding: .6ch;
  
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_JHcOFM {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_JHcOFM {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_JHcOFM td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_JHcOFM .hll { background-color: #ffffcc }
.pygmentize_JHcOFM  { background: #f0f0f0; }
.pygmentize_JHcOFM .c { color: #60a0b0; font-style: italic } /* Comment */
.pygmentize_JHcOFM .err { border: 1px solid #FF0000 } /* Error */
.pygmentize_JHcOFM .k { color: #007020; font-weight: bold } /* Keyword */
.pygmentize_JHcOFM .o { color: #666666 } /* Operator */
.pygmentize_JHcOFM .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.pygmentize_JHcOFM .cp { color: #007020 } /* Comment.Preproc */
.pygmentize_JHcOFM .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.pygmentize_JHcOFM .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.pygmentize_JHcOFM .gd { color: #A00000 } /* Generic.Deleted */
.pygmentize_JHcOFM .ge { font-style: italic } /* Generic.Emph */
.pygmentize_JHcOFM .gr { color: #FF0000 } /* Generic.Error */
.pygmentize_JHcOFM .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.pygmentize_JHcOFM .gi { color: #00A000 } /* Generic.Inserted */
.pygmentize_JHcOFM .go { color: #808080 } /* Generic.Output */
.pygmentize_JHcOFM .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.pygmentize_JHcOFM .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_JHcOFM .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.pygmentize_JHcOFM .gt { color: #0040D0 } /* Generic.Traceback */
.pygmentize_JHcOFM .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.pygmentize_JHcOFM .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.pygmentize_JHcOFM .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.pygmentize_JHcOFM .kp { color: #007020 } /* Keyword.Pseudo */
.pygmentize_JHcOFM .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.pygmentize_JHcOFM .kt { color: #902000 } /* Keyword.Type */
.pygmentize_JHcOFM .m { color: #40a070 } /* Literal.Number */
.pygmentize_JHcOFM .s { color: #4070a0 } /* Literal.String */
.pygmentize_JHcOFM .na { color: #4070a0 } /* Name.Attribute */
.pygmentize_JHcOFM .nb { color: #007020 } /* Name.Builtin */
.pygmentize_JHcOFM .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.pygmentize_JHcOFM .no { color: #60add5 } /* Name.Constant */
.pygmentize_JHcOFM .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.pygmentize_JHcOFM .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.pygmentize_JHcOFM .ne { color: #007020 } /* Name.Exception */
.pygmentize_JHcOFM .nf { color: #06287e } /* Name.Function */
.pygmentize_JHcOFM .nl { color: #002070; font-weight: bold } /* Name.Label */
.pygmentize_JHcOFM .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.pygmentize_JHcOFM .nt { color: #062873; font-weight: bold } /* Name.Tag */
.pygmentize_JHcOFM .nv { color: #bb60d5 } /* Name.Variable */
.pygmentize_JHcOFM .ow { color: #007020; font-weight: bold } /* Operator.Word */
.pygmentize_JHcOFM .w { color: #bbbbbb } /* Text.Whitespace */
.pygmentize_JHcOFM .mf { color: #40a070 } /* Literal.Number.Float */
.pygmentize_JHcOFM .mh { color: #40a070 } /* Literal.Number.Hex */
.pygmentize_JHcOFM .mi { color: #40a070 } /* Literal.Number.Integer */
.pygmentize_JHcOFM .mo { color: #40a070 } /* Literal.Number.Oct */
.pygmentize_JHcOFM .sb { color: #4070a0 } /* Literal.String.Backtick */
.pygmentize_JHcOFM .sc { color: #4070a0 } /* Literal.String.Char */
.pygmentize_JHcOFM .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.pygmentize_JHcOFM .s2 { color: #4070a0 } /* Literal.String.Double */
.pygmentize_JHcOFM .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.pygmentize_JHcOFM .sh { color: #4070a0 } /* Literal.String.Heredoc */
.pygmentize_JHcOFM .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.pygmentize_JHcOFM .sx { color: #c65d09 } /* Literal.String.Other */
.pygmentize_JHcOFM .sr { color: #235388 } /* Literal.String.Regex */
.pygmentize_JHcOFM .s1 { color: #4070a0 } /* Literal.String.Single */
.pygmentize_JHcOFM .ss { color: #517918 } /* Literal.String.Symbol */
.pygmentize_JHcOFM .bp { color: #007020 } /* Name.Builtin.Pseudo */
.pygmentize_JHcOFM .vc { color: #bb60d5 } /* Name.Variable.Class */
.pygmentize_JHcOFM .vg { color: #bb60d5 } /* Name.Variable.Global */
.pygmentize_JHcOFM .vi { color: #bb60d5 } /* Name.Variable.Instance */
.pygmentize_JHcOFM .il { color: #40a070 } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_JHcOFMtable"><tr><td class="linenos pygmentize_JHcOFM"><div class="linenodiv pygmentize_JHcOFM"><pre>  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133</pre></div></td><td class="code"><div class="pygmentize_JHcOFM"><pre><span class="kd">public</span> <span class="kd">class</span> <span class="nc">RoundButton</span> <span class="kd">extends</span> <span class="n">JButton</span> <span class="o">{</span>

    <span class="c1">// ...</span>
    <span class="c1">// some of the code were omitted for brevity</span>
    <span class="c1">// ...</span>
    <span class="nd">@Override</span>
    <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">paintComponent</span><span class="o">(</span><span class="n">Graphics</span> <span class="n">g</span><span class="o">)</span> <span class="o">{</span>
        <span class="n">Graphics2D</span> <span class="n">g2</span> <span class="o">=</span> <span class="o">(</span><span class="n">Graphics2D</span><span class="o">)</span> <span class="n">g</span><span class="o">;</span>
        <span class="n">g2</span><span class="o">.</span><span class="na">setRenderingHint</span><span class="o">(</span><span class="n">RenderingHints</span><span class="o">.</span><span class="na">KEY_ANTIALIASING</span><span class="o">,</span>
                    <span class="n">RenderingHints</span><span class="o">.</span><span class="na">VALUE_ANTIALIAS_ON</span><span class="o">);</span>
        <span class="n">g2</span><span class="o">.</span><span class="na">setRenderingHint</span><span class="o">(</span><span class="n">RenderingHints</span><span class="o">.</span><span class="na">KEY_INTERPOLATION</span><span class="o">,</span>
                    <span class="n">RenderingHints</span><span class="o">.</span><span class="na">VALUE_INTERPOLATION_BILINEAR</span><span class="o">);</span>

        <span class="n">Insets</span> <span class="n">insets</span> <span class="o">=</span> <span class="n">getInsets</span><span class="o">();</span>

        <span class="n">drawButtonImage</span><span class="o">(</span><span class="n">g2</span><span class="o">,</span> <span class="n">insets</span><span class="o">);</span>
        <span class="n">drawButtonText</span><span class="o">(</span><span class="n">g2</span><span class="o">,</span> <span class="n">insets</span><span class="o">);</span>
    <span class="o">}</span>

    <span class="kd">private</span> <span class="kt">void</span> <span class="nf">drawButtonImage</span><span class="o">(</span><span class="n">Graphics2D</span> <span class="n">g2</span><span class="o">,</span> <span class="n">Insets</span> <span class="n">insets</span><span class="o">)</span> <span class="o">{</span>
        <span class="kt">int</span> <span class="n">width</span> <span class="o">=</span> <span class="n">getWidth</span><span class="o">()</span> <span class="o">-</span> <span class="n">insets</span><span class="o">.</span><span class="na">left</span> <span class="o">-</span> <span class="n">insets</span><span class="o">.</span><span class="na">right</span><span class="o">;</span>
        <span class="kt">int</span> <span class="n">height</span> <span class="o">=</span> <span class="n">getHeight</span><span class="o">()</span> <span class="o">-</span> <span class="n">insets</span><span class="o">.</span><span class="na">top</span> <span class="o">-</span> <span class="n">insets</span><span class="o">.</span><span class="na">bottom</span><span class="o">;</span>

        <span class="k">if</span><span class="o">(</span><span class="n">normalButton</span> <span class="o">==</span> <span class="kc">null</span> <span class="o">||</span> <span class="n">normalButton</span><span class="o">.</span><span class="na">getWidth</span><span class="o">()</span> <span class="o">!=</span> <span class="n">width</span> <span class="o">||</span>
                <span class="n">normalButton</span><span class="o">.</span><span class="na">getHeight</span><span class="o">()</span> <span class="o">!=</span> <span class="n">height</span><span class="o">)</span> <span class="o">{</span>
            <span class="n">normalButton</span> <span class="o">=</span> <span class="n">GraphicsUtilities</span><span class="o">.</span>
                    <span class="n">createCompatibleTranslucentImage</span><span class="o">(</span><span class="n">width</span><span class="o">,</span> <span class="n">height</span><span class="o">);</span>
            <span class="n">Graphics2D</span> <span class="n">g</span> <span class="o">=</span> <span class="n">normalButton</span><span class="o">.</span><span class="na">createGraphics</span><span class="o">();</span>

            <span class="n">RoundRectangle2D</span> <span class="n">bullet</span> <span class="o">=</span> <span class="k">new</span> <span class="n">RoundRectangle2D</span><span class="o">.</span>
                    <span class="n">Double</span><span class="o">(</span><span class="mf">0.0</span><span class="o">,</span> <span class="mf">0.0</span><span class="o">,</span> <span class="n">width</span><span class="o">,</span> <span class="n">height</span><span class="o">,</span> <span class="n">height</span><span class="o">,</span> <span class="n">height</span><span class="o">);</span>
            <span class="n">Ellipse2D</span> <span class="n">curve</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Ellipse2D</span><span class="o">.</span>
                    <span class="n">Double</span><span class="o">(-</span><span class="mf">20.0</span><span class="o">,</span> <span class="n">height</span> <span class="o">/</span> <span class="mf">2.0</span><span class="o">,</span> <span class="n">width</span> <span class="o">+</span> <span class="mf">40.0</span><span class="o">,</span> <span class="n">height</span><span class="o">);</span>

            <span class="n">g</span><span class="o">.</span><span class="na">translate</span><span class="o">(-</span><span class="mi">1</span><span class="o">,</span> <span class="o">-</span><span class="mi">2</span><span class="o">);</span>
            <span class="n">g</span><span class="o">.</span><span class="na">setColor</span><span class="o">(</span><span class="k">new</span> <span class="n">Color</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">150</span><span class="o">));</span>
            <span class="n">g</span><span class="o">.</span><span class="na">fill</span><span class="o">(</span><span class="k">new</span> <span class="n">RoundRectangle2D</span><span class="o">.</span><span class="na">Double</span><span class="o">(</span><span class="mf">0.0</span><span class="o">,</span> <span class="mf">0.0</span><span class="o">,</span>
                    <span class="n">width</span> <span class="o">+</span> <span class="mi">2</span><span class="o">,</span> <span class="n">height</span> <span class="o">+</span> <span class="mi">4</span><span class="o">,</span> <span class="n">height</span> <span class="o">+</span> <span class="mi">4</span><span class="o">,</span> <span class="n">height</span> <span class="o">+</span> <span class="mi">4</span><span class="o">));</span>
            <span class="n">g</span><span class="o">.</span><span class="na">translate</span><span class="o">(</span><span class="mi">1</span><span class="o">,</span> <span class="mi">2</span><span class="o">);</span>

            <span class="n">Color</span> <span class="n">startColor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Color</span><span class="o">(</span><span class="mi">10</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">40</span><span class="o">);</span>
            <span class="n">Color</span> <span class="n">endColor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Color</span><span class="o">(</span><span class="mi">175</span><span class="o">,</span> <span class="mi">165</span><span class="o">,</span> <span class="mi">225</span><span class="o">);</span>

            <span class="n">Paint</span> <span class="n">paint</span> <span class="o">=</span> <span class="n">g</span><span class="o">.</span><span class="na">getPaint</span><span class="o">();</span>
            <span class="n">g2</span><span class="o">.</span><span class="na">setPaint</span><span class="o">(</span><span class="k">new</span> <span class="n">GradientPaint</span><span class="o">(</span><span class="mf">0.0f</span><span class="o">,</span> <span class="mf">0.0f</span><span class="o">,</span> <span class="n">startColor</span><span class="o">,</span>
                    <span class="mf">0.0f</span><span class="o">,</span> <span class="o">(</span><span class="kt">float</span><span class="o">)</span> <span class="n">height</span><span class="o">,</span> <span class="n">endColor</span><span class="o">));</span>
            <span class="n">g</span><span class="o">.</span><span class="na">fill</span><span class="o">(</span><span class="n">bullet</span><span class="o">);</span>
            <span class="n">g</span><span class="o">.</span><span class="na">draw</span><span class="o">(</span><span class="n">bullet</span><span class="o">);</span>

            <span class="n">startColor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Color</span><span class="o">(</span><span class="mi">5</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">50</span><span class="o">);</span>
            <span class="n">endColor</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Color</span><span class="o">(</span><span class="mi">105</span><span class="o">,</span> <span class="mi">100</span><span class="o">,</span> <span class="mi">155</span><span class="o">);</span>
            <span class="n">g2</span><span class="o">.</span><span class="na">setPaint</span><span class="o">(</span><span class="k">new</span> <span class="n">GradientPaint</span><span class="o">(</span><span class="mf">0.0f</span><span class="o">,</span> <span class="mf">0.0f</span><span class="o">,</span> <span class="n">startColor</span><span class="o">,</span>
                    <span class="mf">0.0f</span><span class="o">,</span> <span class="o">(</span><span class="kt">float</span> <span class="o">)</span> <span class="n">height</span><span class="o">,</span> <span class="n">endColor</span><span class="o">));</span>

            <span class="n">Area</span> <span class="n">area</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Area</span><span class="o">(</span><span class="n">bullet</span><span class="o">);</span>
            <span class="n">area</span><span class="o">.</span><span class="na">intersect</span><span class="o">(</span><span class="k">new</span> <span class="n">Area</span><span class="o">(</span><span class="n">curve</span><span class="o">));</span>
            <span class="n">g</span><span class="o">.</span><span class="na">fill</span><span class="o">(</span><span class="n">area</span><span class="o">);</span>
            <span class="n">g</span><span class="o">.</span><span class="na">setPaint</span><span class="o">(</span><span class="n">paint</span><span class="o">);</span>
            <span class="n">g</span><span class="o">.</span><span class="na">dispose</span><span class="o">();</span>

            <span class="k">if</span><span class="o">(</span><span class="n">normalButtonPressed</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">normalButtonPressed</span><span class="o">.</span><span class="na">flush</span><span class="o">();</span>
                <span class="n">normalButtonPressed</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
            <span class="o">}</span>

            <span class="n">normalButtonPressed</span> <span class="o">=</span> <span class="n">GraphicsUtilities</span><span class="o">.</span>
                    <span class="n">createCompatibleTranslucentImage</span><span class="o">(</span><span class="n">width</span><span class="o">,</span> <span class="n">height</span><span class="o">);</span>

            <span class="n">tintFilter</span><span class="o">.</span><span class="na">filter</span><span class="o">(</span><span class="n">normalButton</span><span class="o">,</span> <span class="n">normalButtonPressed</span><span class="o">);</span>
        <span class="o">}</span>

        <span class="n">g2</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">model</span><span class="o">.</span><span class="na">isArmed</span><span class="o">()</span> <span class="o">?</span>
                    <span class="n">normalButtonPressed</span> <span class="o">:</span> <span class="n">normalButton</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>


        <span class="k">if</span><span class="o">(</span><span class="n">buttonHighlight</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">try</span> <span class="o">{</span>
                <span class="n">String</span> <span class="n">fileName</span> <span class="o">=</span> <span class="s">&quot;/com/apleben/swing/buttons/resources/halo.png&quot;</span><span class="o">;</span>
                <span class="n">buttonHighlight</span> <span class="o">=</span> <span class="n">ImageIO</span><span class="o">.</span><span class="na">read</span><span class="o">(</span>
                         <span class="n">RoundButton</span><span class="o">.</span><span class="na">class</span><span class="o">.</span><span class="na">getResource</span><span class="o">(</span><span class="n">fileName</span><span class="o">));</span>
                <span class="n">buttonHighlight</span> <span class="o">=</span> <span class="n">GraphicsUtilities</span><span class="o">.</span>
                         <span class="n">toCompatibleImage</span><span class="o">(</span><span class="n">buttonHighlight</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">IOException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
            <span class="o">}</span>
        <span class="o">}</span>

        <span class="k">if</span> <span class="o">(</span><span class="n">ghostValue</span> <span class="o">&gt;</span> <span class="mf">0.0f</span><span class="o">)</span> <span class="o">{</span>
            <span class="kt">float</span> <span class="n">alphaValue</span> <span class="o">=</span> <span class="n">ghostValue</span><span class="o">;</span>
            <span class="n">Composite</span> <span class="n">composite</span> <span class="o">=</span> <span class="n">g2</span><span class="o">.</span><span class="na">getComposite</span><span class="o">();</span>
            <span class="k">if</span> <span class="o">(</span><span class="n">composite</span> <span class="k">instanceof</span> <span class="n">AlphaComposite</span><span class="o">)</span> <span class="o">{</span>
                <span class="n">alphaValue</span> <span class="o">*=</span> <span class="o">((</span><span class="n">AlphaComposite</span><span class="o">)</span> <span class="n">composite</span><span class="o">).</span><span class="na">getAlpha</span><span class="o">();</span>
            <span class="o">}</span>

            <span class="n">g2</span><span class="o">.</span><span class="na">setComposite</span><span class="o">(</span><span class="n">AlphaComposite</span><span class="o">.</span>
                    <span class="n">getInstance</span><span class="o">(</span><span class="n">AlphaComposite</span><span class="o">.</span><span class="na">SRC_OVER</span><span class="o">,</span>
                              <span class="n">alphaValue</span><span class="o">));</span>

            <span class="n">g2</span><span class="o">.</span><span class="na">drawImage</span><span class="o">(</span><span class="n">buttonHighlight</span><span class="o">,</span>
                    <span class="n">insets</span><span class="o">.</span><span class="na">left</span> <span class="o">+</span> <span class="mi">2</span><span class="o">,</span> <span class="n">insets</span><span class="o">.</span><span class="na">top</span> <span class="o">+</span> <span class="mi">2</span><span class="o">,</span>
                    <span class="n">width</span> <span class="o">-</span> <span class="mi">4</span><span class="o">,</span> <span class="n">height</span> <span class="o">-</span> <span class="mi">4</span><span class="o">,</span> <span class="kc">null</span><span class="o">);</span>
            <span class="n">g2</span><span class="o">.</span><span class="na">setComposite</span><span class="o">(</span><span class="n">composite</span><span class="o">);</span>
        <span class="o">}</span>
    <span class="o">}</span>

    <span class="kd">private</span> <span class="kt">void</span> <span class="nf">drawButtonText</span><span class="o">(</span><span class="n">Graphics2D</span> <span class="n">g2</span><span class="o">,</span> <span class="n">Insets</span> <span class="n">insets</span><span class="o">)</span> <span class="o">{</span>
        <span class="n">FontMetrics</span> <span class="n">fm</span> <span class="o">=</span> <span class="n">getFontMetrics</span><span class="o">(</span><span class="n">getFont</span><span class="o">());</span>
        <span class="n">TextLayout</span> <span class="n">layout</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TextLayout</span><span class="o">(</span><span class="n">getText</span><span class="o">(),</span>
                <span class="n">getFont</span><span class="o">(),</span>
                <span class="n">g2</span><span class="o">.</span><span class="na">getFontRenderContext</span><span class="o">());</span>
        <span class="n">Rectangle2D</span> <span class="n">bounds</span> <span class="o">=</span> <span class="n">layout</span><span class="o">.</span><span class="na">getBounds</span><span class="o">();</span>

        <span class="kt">float</span> <span class="n">x</span> <span class="o">=</span> <span class="o">(</span><span class="kt">float</span><span class="o">)</span> <span class="o">(</span><span class="n">getWidth</span><span class="o">()</span> <span class="o">-</span> <span class="n">insets</span><span class="o">.</span><span class="na">left</span> <span class="o">-</span> <span class="n">insets</span><span class="o">.</span><span class="na">right</span> <span class="o">-</span>
                <span class="n">bounds</span><span class="o">.</span><span class="na">getWidth</span><span class="o">())</span> <span class="o">/</span> <span class="mi">2</span><span class="o">;</span>
        <span class="kt">float</span> <span class="n">y</span> <span class="o">=</span> <span class="o">(</span><span class="kt">float</span><span class="o">)</span> <span class="o">((</span><span class="n">getHeight</span><span class="o">()</span> <span class="o">-</span> <span class="n">insets</span><span class="o">.</span><span class="na">top</span> <span class="o">-</span> <span class="n">insets</span><span class="o">.</span><span class="na">bottom</span> <span class="o">-</span>
                <span class="n">fm</span><span class="o">.</span><span class="na">getMaxAscent</span><span class="o">()</span> <span class="o">-</span> <span class="n">fm</span><span class="o">.</span><span class="na">getMaxDescent</span><span class="o">())</span> <span class="o">/</span> <span class="mi">2</span><span class="o">)</span> <span class="o">+</span> <span class="n">fm</span><span class="o">.</span><span class="na">getAscent</span><span class="o">()</span> <span class="o">-</span> <span class="mi">1</span><span class="o">;</span>

        <span class="k">if</span> <span class="o">(</span><span class="n">model</span><span class="o">.</span><span class="na">isArmed</span><span class="o">())</span> <span class="o">{</span>
            <span class="n">x</span> <span class="o">+=</span> <span class="mi">1</span><span class="o">;</span>
            <span class="n">y</span> <span class="o">+=</span> <span class="mi">1</span><span class="o">;</span>
        <span class="o">}</span>

        <span class="n">g2</span><span class="o">.</span><span class="na">setColor</span><span class="o">(</span><span class="n">Color</span><span class="o">.</span><span class="na">BLACK</span><span class="o">);</span>
        <span class="n">layout</span><span class="o">.</span><span class="na">draw</span><span class="o">(</span><span class="n">g2</span><span class="o">,</span>
                <span class="n">x</span> <span class="o">+</span> <span class="o">(</span><span class="kt">float</span><span class="o">)</span> <span class="n">Math</span><span class="o">.</span><span class="na">ceil</span><span class="o">(</span><span class="n">shadowOffsetX</span><span class="o">),</span>
                <span class="n">y</span> <span class="o">+</span> <span class="o">(</span><span class="kt">float</span><span class="o">)</span> <span class="n">Math</span><span class="o">.</span><span class="na">ceil</span><span class="o">(</span><span class="n">shadowOffsetY</span><span class="o">));</span>
        <span class="n">g2</span><span class="o">.</span><span class="na">setColor</span><span class="o">(</span><span class="n">getForeground</span><span class="o">());</span>
        <span class="n">layout</span><span class="o">.</span><span class="na">draw</span><span class="o">(</span><span class="n">g2</span><span class="o">,</span> <span class="n">x</span><span class="o">,</span> <span class="n">y</span><span class="o">);</span>
    <span class="o">}</span>
    <span class="c1">// ...</span>
    <span class="c1">// some of the code were omitted for brevity</span>
    <span class="c1">// ...</span>
<span class="o">}</span>
</pre></div>
</td></tr></table>

<p>This round button will look similar to this &#8211;&gt;  <img class="alignright size-full wp-image-291" title="round button" src="http://www.apleben.com/wp-content/uploads/2010/11/round_button.png" alt="" width="120" height="37" /></p>
<p><strong><span style="text-decoration: underline;">Conclusion</span></strong></p>
<p>So, the conclusion is simple: I don&#8217;t want to explain the boilerplate used in code, you could find the material and ideas behind the demo in a various number of graphics and Swing oriented programming books. The Swing programming may be both: a very exciting and awesome. Swing applications could be more awesome and not so boring like with standard look and feel or without any even simple effects.</p>
<p>The source code may be found in zip archive below or in my <a title="github repo" href="https://github.com/apupeikis/JavaPixelazier" target="_blank">GitHub</a> repository, if you like. To run this demo you should use jdk 6.10+ build, provided by Oracle, but not an OpenJDK for graphics reasons. <a title="github repo" href="https://github.com/apupeikis/JavaPixelazier" target="_blank"><img class="alignright size-full wp-image-292" title="github powered by Octocat!" src="http://www.apleben.com/wp-content/uploads/2010/11/skr_github.png" alt="" width="78" height="78" /></a></p>
<p><a title="Download" href="http://www.apleben.com/content/apps/AnimatedCurves/AnimatedCurves.zip" target="_self"><br />
<img title="zip" src="http://www.apleben.com/wp-content/uploads/2010/08/zip3.png" alt="" width="100" height="100" /></a></p>
<p>-<em>Have are nice and enjoyable Swing Programming! </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2010/11/animated-curves-swing-demo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VMware Workstation 7.1 patch for linux kernel 2.6.35</title>
		<link>http://www.apleben.com/2010/10/vmware-workstation-7-1-patch-for-linux-kernel-2-6-35/</link>
		<comments>http://www.apleben.com/2010/10/vmware-workstation-7-1-patch-for-linux-kernel-2-6-35/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 20:50:39 +0000</pubDate>
		<dc:creator>Alexander Pupeikis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.apleben.com/?p=283</guid>
		<description><![CDATA[Yesterday, I arrived into a problem with Vmware modules compilation on my X64 machine running Kubuntu 10.10 aka Maverick Meerkat. The Linux kernel I am running on is 2.6.35. The exact problem occurred when I tried to compile the modules, as mentioned above and here is the log created after compilation process: Oh, obviously the [...]]]></description>
			<content:encoded><![CDATA[<p style="float:right; margin:0 0 10px 15px; width:240px;">
		<img src="http://www.apleben.com/wp-content/uploads/2010/10/vmware_computer.png" width="240" />
		</p><p>Yesterday,  I arrived into a problem with <a title="VMware" href="http://www.vmware.com/support/product-support/workstation/" target="_blank">Vmware</a> modules compilation on my X64 machine running <a title="Kubuntu" href="http://www.kubuntu.org/" target="_blank">Kubuntu 10.10</a> aka <a title="Maverick" href="http://www.kubuntu.org/news/kubuntu-10.10-rc" target="_blank">Maverick Meerkat.</a> The Linux kernel I am running on is 2.6.35. The exact problem occurred when I tried to compile the modules, as mentioned above and here is the log created after compilation process:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_IIbrP6  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_IIbrP6 .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_IIbrP6table {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_IIbrP6table td, .pygmentize_IIbrP6table th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_IIbrP6 pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_IIbrP6 {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_IIbrP6 {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_IIbrP6 td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_IIbrP6 .hll { background-color: #49483e }
.pygmentize_IIbrP6  { background: #272822; color: #f8f8f2 }
.pygmentize_IIbrP6 .c { color: #75715e } /* Comment */
.pygmentize_IIbrP6 .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_IIbrP6 .k { color: #66d9ef } /* Keyword */
.pygmentize_IIbrP6 .l { color: #ae81ff } /* Literal */
.pygmentize_IIbrP6 .n { color: #f8f8f2 } /* Name */
.pygmentize_IIbrP6 .o { color: #f92672 } /* Operator */
.pygmentize_IIbrP6 .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_IIbrP6 .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_IIbrP6 .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_IIbrP6 .c1 { color: #75715e } /* Comment.Single */
.pygmentize_IIbrP6 .cs { color: #75715e } /* Comment.Special */
.pygmentize_IIbrP6 .ge { font-style: italic } /* Generic.Emph */
.pygmentize_IIbrP6 .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_IIbrP6 .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_IIbrP6 .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_IIbrP6 .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_IIbrP6 .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_IIbrP6 .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_IIbrP6 .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_IIbrP6 .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_IIbrP6 .m { color: #ae81ff } /* Literal.Number */
.pygmentize_IIbrP6 .s { color: #e6db74 } /* Literal.String */
.pygmentize_IIbrP6 .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_IIbrP6 .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_IIbrP6 .nc { color: #a6e22e } /* Name.Class */
.pygmentize_IIbrP6 .no { color: #66d9ef } /* Name.Constant */
.pygmentize_IIbrP6 .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_IIbrP6 .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_IIbrP6 .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_IIbrP6 .nf { color: #a6e22e } /* Name.Function */
.pygmentize_IIbrP6 .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_IIbrP6 .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_IIbrP6 .nx { color: #a6e22e } /* Name.Other */
.pygmentize_IIbrP6 .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_IIbrP6 .nt { color: #f92672 } /* Name.Tag */
.pygmentize_IIbrP6 .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_IIbrP6 .ow { color: #f92672 } /* Operator.Word */
.pygmentize_IIbrP6 .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_IIbrP6 .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_IIbrP6 .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_IIbrP6 .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_IIbrP6 .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_IIbrP6 .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_IIbrP6 .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_IIbrP6 .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_IIbrP6 .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_IIbrP6 .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_IIbrP6 .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_IIbrP6 .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_IIbrP6 .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_IIbrP6 .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_IIbrP6 .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_IIbrP6 .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_IIbrP6 .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_IIbrP6 .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_IIbrP6 .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_IIbrP6 .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_IIbrP6 .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_IIbrP6table"><tr><td class="linenos pygmentize_IIbrP6"><div class="linenodiv pygmentize_IIbrP6"><pre> 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16</pre></div></td><td class="code"><div class="pygmentize_IIbrP6"><pre><span class="go">tmp/vmware-root/modules/vmmon-only/linux/hostif.c: In function ‘HostIFReadUptimeWork’:</span>
<span class="go">/tmp/vmware-root/modules/vmmon-only/linux/hostif.c:2004: warning:</span>
<span class="go">     ‘newUpBase’ may be used uninitialized in this function</span>
<span class="go">CC [M] /tmp/vmware-root/modules/vmmon-only/linux/iommu.o</span>
<span class="go">/tmp/vmware-root/modules/vmmon-only/linux/iommu.c: In function ‘IOMMU_SetupMMU’:</span>
<span class="go">/tmp/vmware-root/modules/vmmon-only/linux/iommu.c:156: error:</span>
<span class="go">     implicit declaration of function ‘iommu_map_range’</span>
<span class="go">/tmp/vmware-root/modules/vmmon-only/linux/iommu.c: In function ‘IOMMU_VMCleanup’:</span>
<span class="go">/tmp/vmware-root/modules/vmmon-only/linux/iommu.c:403: error:</span>
<span class="go">     implicit declaration of function ‘iommu_unmap_range’</span>
<span class="go">make[2]: *** [/tmp/vmware-root/modules/vmmon-only/linux/iommu.o] Error 1</span>
<span class="go">make[1]: *** _module_/tmp/vmware-root/modules/vmmon-only Error 2</span>
<span class="go">make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-2-generic&#39;</span>
<span class="go">make: *** vmmon.so Error 2</span>
<span class="go">make: Leaving directory `/tmp/vmware-root/modules/vmmon-only&#39;</span>
<span class="go">Unable to install vmmon</span>
</pre></div>
</td></tr></table>

<p>Oh, obviously the problem arrived with vmmon module compilation process. It just fails to compile!</p>
<p>How we can see from the compilation log, the exact problem that we arrive is the &#8220;not correct&#8221; declaration of function <em>&#8216;iommu_map_range&#8217;</em> and <em>&#8216;iommu_unmap_range&#8217;</em>. Looks like something has been changed from the previous version of the kernel and in the current version the method signature or method declaration are not the same. Exactly, two changes gone happened:</p>
<ul>
<li>iommu_{un}map_range → iommu_{un}map, q.v.  <a href="http://kerneltrap.org/mailarchive/git-commits-head/2010/5/18/33306">git-commits on kerneltrap.org</a></li>
<li>fix sk_sleep references, similar to  <a href="http://bugs.gentoo.org/show_bug.cgi?id=322245">bugs.gentoo.org</a></li>
</ul>
<p>After installation of VMware, the following commands patches the <em>vmmon module</em> sources:</p>
<style type="text/css">


/* *************************************************** */
/* WordPress default theme "twenty-ten" compatibility: */
/* FIXME: Is there a way to limit these changes to pygmentize_FmPEes  */
/*        without editing the WordPress theme directly? */
/* *************************************************** */

#content pre {
  /* The background: transparent is needed to work with WordPress:*/
  background: transparent;
  /* Default WordPress style has a big fat <pre> margin-bottom: */
  margin-bottom: 0px;

  /*color: #333333;*/
  font-size: .9em; 
  line-height: 1.25em;
}

#content table {
}

#content table {
	border: 1px solid #e7e7e7;
    margin: 0 0 0 0;
	text-align: left;
	width: 100%;
}
#content tr th,
#content thead th {
	color: #888;
	font-size: 12px;
	font-weight: bold;
	line-height: 18px;
	padding: 0px;
}
#content tr td {
	border: 0px;
	padding: 0px;
	margin: 0px;
    margin-bottom: 0px;
    padding-bottom: 0px;

}

/* *************************************************** */
/* *************************************************** */

/* Standard fixes to the default output: */

/* Set the tab width in "ch" character units: */
.pygmentize_FmPEes .tabspan {
  display: inline-block;
  width: 4ch;
}

/* When using line numbers, use 100% table width and no cellpadding: */
.pygmentize_FmPEestable {
  width: 100%;
  border-spacing: 0px;
  border-collapse: collapse;
}


/*
#content table {
    border: 1px solid #E7E7E7;
    margin: 0 -1px 24px 0;
    text-align: left;
    width: 100%;
}
*/

.pygmentize_FmPEestable td, .pygmentize_FmPEestable th {
  padding: 0px;
  margin: 0px;
}

/* Add a little buffer so the monotype font doesn't bump directly against the edge: */
.pygmentize_FmPEes pre {
  padding: .6ch;
  color: #F8F8F2;
}

/* This is more consistent with <p> tags... I didn't like it for my use: */
/*
div .pygmentize_FmPEes {
    margin-bottom: 24px; 
}
*/

td.linenos.pygmentize_FmPEes {
  width: 1ch;
  padding: .6ch;
  line-height: 1.25em;
}

.pygmentize_FmPEes td {
  padding-right: 1px;
}


td.linenos { background-color: #f0f0f0; padding-right: 1px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 125%; }
.pygmentize_FmPEes .hll { background-color: #49483e }
.pygmentize_FmPEes  { background: #272822; color: #f8f8f2 }
.pygmentize_FmPEes .c { color: #75715e } /* Comment */
.pygmentize_FmPEes .err { color: #960050; background-color: #1e0010 } /* Error */
.pygmentize_FmPEes .k { color: #66d9ef } /* Keyword */
.pygmentize_FmPEes .l { color: #ae81ff } /* Literal */
.pygmentize_FmPEes .n { color: #f8f8f2 } /* Name */
.pygmentize_FmPEes .o { color: #f92672 } /* Operator */
.pygmentize_FmPEes .p { color: #f8f8f2 } /* Punctuation */
.pygmentize_FmPEes .cm { color: #75715e } /* Comment.Multiline */
.pygmentize_FmPEes .cp { color: #75715e } /* Comment.Preproc */
.pygmentize_FmPEes .c1 { color: #75715e } /* Comment.Single */
.pygmentize_FmPEes .cs { color: #75715e } /* Comment.Special */
.pygmentize_FmPEes .ge { font-style: italic } /* Generic.Emph */
.pygmentize_FmPEes .gs { font-weight: bold } /* Generic.Strong */
.pygmentize_FmPEes .kc { color: #66d9ef } /* Keyword.Constant */
.pygmentize_FmPEes .kd { color: #66d9ef } /* Keyword.Declaration */
.pygmentize_FmPEes .kn { color: #f92672 } /* Keyword.Namespace */
.pygmentize_FmPEes .kp { color: #66d9ef } /* Keyword.Pseudo */
.pygmentize_FmPEes .kr { color: #66d9ef } /* Keyword.Reserved */
.pygmentize_FmPEes .kt { color: #66d9ef } /* Keyword.Type */
.pygmentize_FmPEes .ld { color: #e6db74 } /* Literal.Date */
.pygmentize_FmPEes .m { color: #ae81ff } /* Literal.Number */
.pygmentize_FmPEes .s { color: #e6db74 } /* Literal.String */
.pygmentize_FmPEes .na { color: #a6e22e } /* Name.Attribute */
.pygmentize_FmPEes .nb { color: #f8f8f2 } /* Name.Builtin */
.pygmentize_FmPEes .nc { color: #a6e22e } /* Name.Class */
.pygmentize_FmPEes .no { color: #66d9ef } /* Name.Constant */
.pygmentize_FmPEes .nd { color: #a6e22e } /* Name.Decorator */
.pygmentize_FmPEes .ni { color: #f8f8f2 } /* Name.Entity */
.pygmentize_FmPEes .ne { color: #a6e22e } /* Name.Exception */
.pygmentize_FmPEes .nf { color: #a6e22e } /* Name.Function */
.pygmentize_FmPEes .nl { color: #f8f8f2 } /* Name.Label */
.pygmentize_FmPEes .nn { color: #f8f8f2 } /* Name.Namespace */
.pygmentize_FmPEes .nx { color: #a6e22e } /* Name.Other */
.pygmentize_FmPEes .py { color: #f8f8f2 } /* Name.Property */
.pygmentize_FmPEes .nt { color: #f92672 } /* Name.Tag */
.pygmentize_FmPEes .nv { color: #f8f8f2 } /* Name.Variable */
.pygmentize_FmPEes .ow { color: #f92672 } /* Operator.Word */
.pygmentize_FmPEes .w { color: #f8f8f2 } /* Text.Whitespace */
.pygmentize_FmPEes .mf { color: #ae81ff } /* Literal.Number.Float */
.pygmentize_FmPEes .mh { color: #ae81ff } /* Literal.Number.Hex */
.pygmentize_FmPEes .mi { color: #ae81ff } /* Literal.Number.Integer */
.pygmentize_FmPEes .mo { color: #ae81ff } /* Literal.Number.Oct */
.pygmentize_FmPEes .sb { color: #e6db74 } /* Literal.String.Backtick */
.pygmentize_FmPEes .sc { color: #e6db74 } /* Literal.String.Char */
.pygmentize_FmPEes .sd { color: #e6db74 } /* Literal.String.Doc */
.pygmentize_FmPEes .s2 { color: #e6db74 } /* Literal.String.Double */
.pygmentize_FmPEes .se { color: #ae81ff } /* Literal.String.Escape */
.pygmentize_FmPEes .sh { color: #e6db74 } /* Literal.String.Heredoc */
.pygmentize_FmPEes .si { color: #e6db74 } /* Literal.String.Interpol */
.pygmentize_FmPEes .sx { color: #e6db74 } /* Literal.String.Other */
.pygmentize_FmPEes .sr { color: #e6db74 } /* Literal.String.Regex */
.pygmentize_FmPEes .s1 { color: #e6db74 } /* Literal.String.Single */
.pygmentize_FmPEes .ss { color: #e6db74 } /* Literal.String.Symbol */
.pygmentize_FmPEes .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.pygmentize_FmPEes .vc { color: #f8f8f2 } /* Name.Variable.Class */
.pygmentize_FmPEes .vg { color: #f8f8f2 } /* Name.Variable.Global */
.pygmentize_FmPEes .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.pygmentize_FmPEes .il { color: #ae81ff } /* Literal.Number.Integer.Long */

  </style>




<table class="pygmentize_FmPEestable"><tr><td class="linenos pygmentize_FmPEes"><div class="linenodiv pygmentize_FmPEes"><pre>1
2
3
4</pre></div></td><td class="code"><div class="pygmentize_FmPEes"><pre><span class="go">cd /tmp</span>
<span class="go">tar xvf /usr/lib/vmware/modules/source/vmmon.tar -C /tmp</span>
<span class="go">perl -pi -e &#39;s,_range,,&#39; vmmon-only/linux/iommu.c</span>
<span class="go">tar cvf /usr/lib/vmware/modules/source/vmmon.tar vmmon-only</span>
</pre></div>
</td></tr></table>

<p>But, these magic incantations does not resolve all of the problems. <em>vmmon module</em> was compiled successfully, although one of modules still didn&#8217;t build for me.</p>
<p>The solution attached below is the patch for VMware Workstation 7.1.0 build-261024 to run on the 2.6.35 linux kernel.</p>
<p><strong><span style="text-decoration: underline;">USE AT YOUR OWN RISK!</span></strong><br />
If it reformats your drive, steals your identity, corrupts your children, or eats your homework, that&#8217;s your problem.</p>
<p>In any cases, this works fine for me and I hope will work for any others too. An attachment contains the patch for linux kernel 2.6.35 and for the main line of kernel 2.6.36. Also, you&#8217;ll find the shell script for convenient way to patch the source.</p>
<p><strong><span style="text-decoration: underline;">Attachments:</span></strong></p>
<p><a title="patch" href="http://www.apleben.com/content/patches/vmware-7.1-2.6.35_36-3-generic-patch.tar.gz" target="_blank"><img class="alignleft size-full wp-image-285" title="tgz" src="http://www.apleben.com/wp-content/uploads/2010/10/tgz.png" alt="" width="128" height="128" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.apleben.com/2010/10/vmware-workstation-7-1-patch-for-linux-kernel-2-6-35/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>

