<?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>dpmWare</title>
	<atom:link href="http://blog.danielpecos.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.danielpecos.com</link>
	<description>Just my stuff, nothing else</description>
	<lastBuildDate>Fri, 13 Jan 2012 19:35:06 +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>Recipe: From SVN to Git without pain</title>
		<link>http://blog.danielpecos.com/2012/01/recipe-from-svn-to-git-without-pain/</link>
		<comments>http://blog.danielpecos.com/2012/01/recipe-from-svn-to-git-without-pain/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 19:33:49 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[recipe]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=481</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2012/01/recipe-from-svn-to-git-without-pain/&amp;text=Recipe: From SVN to Git without pain&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Recipe that explain which steps to follow to migrate a SVN repository into a Git one and how to set it up to push content into GitHub]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2012/01/recipe-from-svn-to-git-without-pain/&amp;text=Recipe: From SVN to Git without pain&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Are you already in love with Git? I'm pretty sure of that, that's the reason why you are reading this, huh?</p>
<p>These are the steps you should follow to migrate an existing SVN repository to a Git one:</p>
<p><span style="text-decoration: underline;">1 - Create a file where you will map SVN users to Git users, following this pattern:</span></p>
<p><code>svn_user = git_user </code></p>
<p>This is the one I created to migrate some SVN repositories from Google Code:</p>
<p><code>$ cat authors_mapping_googlecode<br />
dpecos = Daniel Pecos Martinez<br />
(no author) = Daniel Pecos Martinez </code></p>
<p>The author <em>(no author)</em> is required to match some commits made by Google in the SVN repository creation process.</p>
<p><span id="more-481"></span></p>
<p><span style="text-decoration: underline;">2 - Now let's import code from SVN:</span></p>
<p><code>git svn clone --username svn_user --authors-file=authors_mapping --no-metadata -s svn_url git_repo_path_tmp</code></p>
<p>The one I used to import my np-lib project was:</p>
<p><code>git svn clone --username dpecos --authors-file=authors_mapping_googlecode --no-metadata -s https://np-lib.googlecode.com/svn/ np-lib_tmp</code></p>
<p>We can go into the just created Git repository and display its log in a pretty tree format:</p>
<p><code>$ git log --graph --decorate --pretty=oneline --abbrev-commit</code></p>
<p><span style="text-decoration: underline;">3 - Next step is to clone this repository into a new one, just get ride of all SVN junk created by git-svn:</span></p>
<p><code>$ git clone git_repo_path_tmp git_repo_path<br />
$ rm -rf git_repo_path_tmp<br />
$ cd git_repo_path<br />
$ git remote rm origin</code></p>
<p><span style="text-decoration: underline;">4 - We are ready, but maybe you want to push your repository to GitHub (or any other one), so what you'll need to do as follows:</span></p>
<p>(At this point I suppose that you have created a Git repository in GitHub and that you have already setup your environment to push content to it, if not, you will have troubles from now on)</p>
<p><code>$ git remote add remote_name git_url</code></p>
<p>In my case it was:</p>
<p><code>$ git remote add github git@github.com:dpecos/NP-Lib.git</code></p>
<p>Some clarifications about this last command: many people use as default remote Git repository name "<em>origin</em>", me too, but in this case, GitHub wasn't my default remote Git repository, but I private one so I decided to create a "<em>github</em>" remote.</p>
<p>Now we only have to push local content to the remote repository:</p>
<p><code>$ git push remote_name master</code></p>
<p>Which in my case was:</p>
<p><code>$ git push github master</code></p>
<p>And that's all, we got a Git repository set up and ready to work with GitHub starting from a SVN one.</p>
<p>Hope this recipe will help you. Time to enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2012/01/recipe-from-svn-to-git-without-pain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog rollback</title>
		<link>http://blog.danielpecos.com/2011/12/blog-rollback/</link>
		<comments>http://blog.danielpecos.com/2011/12/blog-rollback/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 16:27:03 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=431</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2011/12/blog-rollback/&amp;text=Blog rollback&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
A couple of months ago I took the decision to reset my blog and start it again from the beginning, creating a more professional computer technology oriented content. I wrote some technical articles and I feel really proud of them, but there was something left, some place where I could write about my thoughts or [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2011/12/blog-rollback/&amp;text=Blog rollback&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>A couple of months ago I took the decision to reset my blog and start it again from the beginning, creating a more professional computer technology oriented content. I wrote some technical articles and I feel really proud of them, but there was something left, some place where I could write about my thoughts or anything I would think it would deserve it.</p>
<p>Some days ago I make a quick revision of a backed up previous blog where I found some articles I liked very much, some of them with several comments, containing really interesting stuff, and some others that were really crap articles. I started thinking that maybe the restart of the blog was not a good decision, that what my blog really needed was a good clean up and not a complete reset. And that's what I've been doing for a couple of days, recovering articles that I feel are interesting or that made me feel in some special way when I wrote them.</p>
<p>Now I am proud to present this refurbished version of my previous blog and the more recent one. It contains technical content, personal stuff, opinion articles and more written in Spanish and English. To make this change more noticeable, I have decided to give it a new name: <a href="http://blog.danielpecos.com"><strong>dpmWare, <em>just my stuff, nothing else</em></strong></a> (just to show the influence of my recent blog <em>Debug yourself! Simply code, just that</em>). I'm also planning to apply a new style to the site so maybe you'll see some changes in a few days.</p>
<p>Of course I will continue writing technical articles and finish some series of articles still pending. I hope you will enjoy these articles at least as much as I enjoyed writing them.</p>
<p style="text-align: right;"><em><strong>Daniel Pecos Martinez</strong></em></p>
<p>PS: Happy new year 2012!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2011/12/blog-rollback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git-SCM (Part 2)</title>
		<link>http://blog.danielpecos.com/2011/08/git-scm-part2/</link>
		<comments>http://blog.danielpecos.com/2011/08/git-scm-part2/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 21:34:04 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=128</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2011/08/git-scm-part2/&amp;text=Git-SCM (Part 2)&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
In a previous post, we have seen what Git is and its main characteristics. Now, we'll go more into detail about its functionality and we'll see what a usual day working with Git looks like. But before, some initial concepts: Repository: A working tree of files and directories which can be versioned, keeping track of [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2011/08/git-scm-part2/&amp;text=Git-SCM (Part 2)&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>In a <a href="http://blog.danielpecos.com/2010/11/git-scm-part1">previous post</a>, we have seen what Git is and its main characteristics. Now, we'll go more into detail about its functionality and we'll see what a usual day working with Git looks like.</p>
<p>But before, some initial concepts:</p>
<ul>
<li><strong>Repository</strong>: A <em>working tree</em> of files and directories which can be versioned, keeping track of every single modification made over the working tree, been able to move forward and backward in its <em>history</em>.</li>
<li><strong>Branch</strong>: it is an alternative image of the repository, keeping track of its own history of modifications. A repository has a main branch called <em>master</em>, and it can have an undefined number of branches, some of them may be copies of<em> remote branches</em> and the default name for the upstream repository is <em>origin</em>. The current branch of the working copy can be always referenced as <em>HEAD</em>.</li>
<li><strong>Commit</strong>: it is a concrete state of a branch, containing the modifications made to the entire working tree since the previous commit in the history, as well as author information and timestamps. It can be identified by its SHA hash, but a name or <em>tag</em> can be associated to it in order to make thing easier.</li>
<li><strong>Merge</strong>: it is the process of integrating changes or commits of two different branches. This integration is automatically carried by Git, if there are no <em>conflicts</em> between commits.</li>
<li><strong>Push</strong>: the changes committed in a local branch into a remote branch.</li>
</ul>
<p>These are the basic concepts we are going to use in the rest of this post. Now let’s start with the fun!</p>
<p><span id="more-128"></span></p>
<h5>Setting up the repository: initialize and importing</h5>
<p>First step is to create or to obtain a repository. In order to create a fresh new repository, this is the instructions we need to execute:</p>
<pre class="brush:shell">mkdir hello_world
cd hello_world
git init</pre>
<p>Alternatively, we can grab an already initialized remote repository with these instructions:</p>
<pre class="brush:shell">git clone git://url.to/hello_world
cd hello_world</pre>
<p>A Git repository is a normal directory that contains a .git directory inside, where all the necessary information to track changes will be stored.</p>
<h5>Modifications: status, adding, committing and reverting</h5>
<p>Once we have our repository ready to work (we can check that its clean by using the command status):</p>
<pre class="brush:shell">$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)</pre>
<p>we can start to work in the current directory, creating, modifying and deleting files and directories as we need to. For example, I will create a Hello World! in java (but a more complex one than the usual, to prove how to work with several files). First of all, I’m going to create two separate folders: one for sources and other for classes. Then I will create an empty Greetings.java and a HelloWorld.java and then I will make a commit with the initial structure:</p>
<pre class="brush:shell">mkdir src bin
touch src/Greetings.java
touch src/HelloWorld.java
git add –A</pre>
<p>Now we can check the status of the current working tree and see that there are changes pending to be committed:</p>
<pre class="brush:shell">$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#&nbsp;&nbsp; (use "git rm --cached ..." to unstage)
#
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new file:&nbsp;&nbsp; src/Greetings.java
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new file:&nbsp;&nbsp; src/HelloWorld.java
#</pre>
<p>So let’s commit these modifications. Every commit needs a commit message that identifies the contents of this commit:</p>
<pre class="brush:shell">$ git commit –m "Initial commit: project structure and source files created"
[master (root-commit) 8738922] Initial commit: project structure and source files created
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 src/Greetings.java
create mode 100644 src/HelloWorld.java</pre>
<p>Ok, we have our prune project ready to be coded. Now it is time to type the necessary code to get the result expected, so open Greetings.java and HelloWorld.java with your preferred editor and paste the following code:</p>
<p><strong>Greetings.java</strong></p>
<pre class="brush:java">
public class Greetings {

	public int sayHello() {
		System.out.println("Hello World!");
	}
}
</pre>
<p><strong>HelloWorld.java</strong></p>
<pre class="brush:java">
public class HelloWorld {

	public static void main(String[] args) {
		Greetings g = new Greetings();
		g.sayHello();
	}
}
</pre>
<p>Now if we check the status of the working tree, we can see that these two files have modifications pending to be committed:</p>
<pre class="brush:shell">$ git status
# On branch master
# Changes not staged for commit:
#&nbsp;&nbsp; (use "git add ..." to update what will be committed)
#&nbsp;&nbsp; (use "git checkout -- ..." to discard changes in working directory)
#
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modified:&nbsp;&nbsp; src/Greetings.java
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; modified:&nbsp;&nbsp; src/HelloWorld.java
#
no changes added to commit (use "git add" and/or "git commit -a")</pre>
<p>Let’s commit it, it is a Hello World, what could it be wrong, huh?</p>
<pre class="brush:shell">$ git commit –a –m "Java code for Greetings and HelloWorld classes"
[master 18e6ec5] Java code for Greetings and HelloWorld classes
 2 files changed, 13 insertions(+), 0 deletions(-)</pre>
<p>Now we can see that our repository history has two commits:</p>
<pre class="brush:shell">$ git log
commit 18e6ec54628a5f01f6beda8b30c64f61ab23585a
Author: Daniel Pecos Martinez
Date:   Sun Aug 28 22:42:45 2011 +0200

    Java code for Greetings and HelloWorld classes

commit 8738922a6193fbbeb4bcb67e663b0403a8fbdace
Author: Daniel Pecos Martinez
Date:   Sun Aug 28 19:33:36 2011 +0200

    Initial commit: project structure and source files created</pre>
<p>And if we want to see a diff output of the current HEAD revision with its previous commit we can do like this:</p>
<pre class="brush:shell">$ git diff HEAD^1
diff --git a/src/Greetings.java b/src/Greetings.java
index e69de29..aeff26c 100644
--- a/src/Greetings.java
+++ b/src/Greetings.java
@@ -0,0 +1,6 @@
+public class Greetings {
+
+       public void sayHello() {
+               System.out.println("Hello World!");
+       }
+}
\ No newline at end of file
diff --git a/src/HelloWorld.java b/src/HelloWorld.java
index e69de29..cbc10da 100644
--- a/src/HelloWorld.java
+++ b/src/HelloWorld.java
@@ -0,0 +1,7 @@
+public class HelloWorld {
+
+       public static int main(String[] args) {
+               Greetings g = new Greetings();
+               g.sayHello();
+       }
+}
\ No newline at end of file</pre>
<p>Time to test it! Compilation is the first step (as you know for sure <img src='http://blog.danielpecos.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ):</p>
<pre class="brush:shell">$ javac src/Greetings.java -d bin/

$ javac src/HelloWorld.java -d bin/ -cp bin/
src\HelloWorld.java:6: missing return statement
        }
        ^
1 error</pre>
<p>Ups! There was an error :-S Well, that one is easy to fix: let's change return type of main method to void:</p>
<pre class="brush:shell">$ javac src/HelloWorld.java -d bin/ -cp bin/
$ java -cp bin/ HelloWorld
Hello World!</pre>
<p>So now everything seems fine, but our working tree is not clean, we have our last modifications pending to commit. But, if I commit them and I publish the repository, everyone could see what a fool I am because of that silly mistake, what should I do? Well, I 'll try to hide my failure so I will amend last commit and include modifications made later:</p>
<pre class="brush:shell">$ git commit -a --amend
[master a612cb0] Java code for Greetings and HelloWorld classes
 2 files changed, 13 insertions(+), 0 deletions(-)

$ git log
commit a612cb025664304586609700b9874eab19aab8b1
Author: Daniel Pecos Martinez
Date:   Sun Aug 28 22:42:45 2011 +0200

    Java code for Greetings and HelloWorld classes

commit 8738922a6193fbbeb4bcb67e663b0403a8fbdace
Author: Daniel Pecos Martinez
Date:   Sun Aug 28 19:33:36 2011 +0200

    Initial commit: project structure and source files created</pre>
<p>Perfect! I have included the necessary fix for my bug and nobody will notice it, great! But wait... my current working tree is not clean:</p>
<pre class="brush:shell">$ git status
# On branch master
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#       bin/
nothing added to commit but untracked files present (use "git add" to track)</pre>
<p>Well, these are the files resulting from compilation, so they can be deleted (in fact, is not correct to commit them), but this will happen again and again, any time I compile my project and don't delete the resulting classes. The way to avoid this is to tell Git to ignore certain files that match a defined pattern, defined in a special file .gitignore:</p>
<pre class="brush:shell">$ cat &gt; .gitignore
bin/*

$ git status
# On branch master
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#       .gitignore
nothing added to commit but untracked files present (use "git add" to track)</pre>
<p>Done! now the only thing left is to commit the just created file (I let this to you, so you can practice a little bit with git)</p>
<p>That's all folks! (for now <img src='http://blog.danielpecos.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ). In following posts I will try to explain how to work with branches (remote and local) and how to resolve conflicts, as well as some nice tools provided by git.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2011/08/git-scm-part2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>amCharts Javascript Tutorial: Parsing dates and styling up the chart</title>
		<link>http://blog.danielpecos.com/2011/03/amcharts-javascript-tutorial-parsing-dates-and-styling-up-the-chart/</link>
		<comments>http://blog.danielpecos.com/2011/03/amcharts-javascript-tutorial-parsing-dates-and-styling-up-the-chart/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 09:44:00 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[amcharts]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=209</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2011/03/amcharts-javascript-tutorial-parsing-dates-and-styling-up-the-chart/&amp;text=amCharts Javascript Tutorial: Parsing dates and styling up the chart&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Recently I began a collaboration with amCharts, writing some tutorials for their blog. This is my first contribution, and you can find the original post in amCharts blog. http://blog.amcharts.com/2011/03/amcharts-javascript-tutorials-part-3.html I hope you'll enjoy my first tutorial about this great graphs library! And, of course, feedback is wellcomed! In this tutorial we will enhance our previous [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2011/03/amcharts-javascript-tutorial-parsing-dates-and-styling-up-the-chart/&amp;text=amCharts Javascript Tutorial: Parsing dates and styling up the chart&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Recently I began a collaboration with <a href="http://amcharts.com" target="_blank">amCharts</a>, writing some tutorials for their blog. This is my first contribution, and you can find the <a href="http://blog.amcharts.com/2011/03/amcharts-javascript-tutorials-part-3.html" target="_blank">original post</a> in <a href="http://blog.amcharts.com" target="_blank">amCharts blog</a>.</p>
<p><a href="http://blog.amcharts.com/2011/03/amcharts-javascript-tutorials-part-3.html" target="_blank">http://blog.amcharts.com/2011/03/amcharts-javascript-tutorials-part-3.html</a></p>
<p>I hope you'll enjoy my first tutorial about this great graphs library! And, of course, feedback is wellcomed!</p>
<p><span id="more-209"></span></p>
<p>In this tutorial we will enhance our previous example in order to parse dates. This will allow us to obtain date-based graphs displaying their data points using relative distance to each other and not placing them at regular spaces.</p>
<p>We will apply some modifications to our previous example from <a href="http://blog.amcharts.com/2011/03/amcharts-javascript-tutorials-part-2.html">Part 2</a>, so if you haven’t read that part, you should at least get the example source code that you can find at the end of the tutorial. Furthermore, you will need amCharts package. Once you’ll have it unzipped, you have to copy amcharts/javascript folder to your working directory (the rest of directories are not needed for this example).</p>
<p>Now we are ready. Let’s start!</p>
<p><strong>HANDLING DATES IN OUR DATA SOURCE</strong></p>
<p>The very first step we need to accomplish in this tutorial is to create a function that converts date strings into Date objects. This could be achieved with the following code, where we define a function which requires a string with YYYY-MM-DD date format as first parameter, and returns a Date object created from that date string:</p>
<pre class="brush:js">// method which parses a date string in the format YYYY-MM-DD and creates a Date object
function parseDate(dateString) {
     // split the string get each field
     var dateArray = dateString.split("-");
     // now lets create a new Date instance, using year, month and day as parameters
     // month count starts with 0, so we have to convert the month number
     var date = new Date(Number(dateArray[0]), Number(dateArray[1]) - 1, Number(dateArray[2]));
     return date;
}</pre>
<p>Next we have to locate the exact point in our previous example where this conversion should be done. If you remember, in Part 2 we set up a handler called <em>parseCSV</em> to manage data loaded via an XMLHttpRequest. This is the perfect place to convert the date strings into javascript Date objects (I have removed some lines of code in order to focus on the changes):</p>
<pre class="brush:js">// method which parses csv data
function parseCSV(data){
     // ...
     // loop through all rows
     for (var i = 0; i &lt; rows.length; i++){
          // this line helps to skip empty rows
          if (rows[i]) {
               // our columns are separated by comma
               var column = rows[i].split(",");
               // column is array now
               // first item is date
               var date = parseDate(column[0]);

     // ...</pre>
<p>Now the data provider contains Date objects instead of strings. Next step is to configure the category axis of the chart to properly manage Date objects: this is achieved setting the property <em>parseDates </em>of the axis to <em>true</em>:</p>
<pre class="brush:js">var catAxis = chart.categoryAxis;
catAxis.parseDates = true;</pre>
<p>These lines have to be added to the createChart function, just like this:</p>
<pre class="brush:js">// method which creates chart
function createChart(){
     // chart variable is declared in the top
     chart = new AmCharts.AmSerialChart();
     // here we tell the chart name of category
     // field in our data provider.
     // we called it "date" (look at parseCSV method)
     chart.categoryField = "date";
     // now we have to set up the category axis to parse dates
     var catAxis = chart.categoryAxis;
     catAxis.parseDates = true;

     // chart must have a graph
     var graph = new AmCharts.AmGraph();
     // graph should know at what field from data
     // provider it should get values.
     // let's assign value1 field for this graph
     graph.valueField = "value1";
     // and add graph to the chart
     chart.addGraph(graph);
     // 'chartdiv' is id of a container
     // where our chart will be
     chart.write('chartdiv');
}</pre>
<p>If we launch our HTML file in the browser, we should get the following result:</p>
<p><a href="http://danielpecos.com/docs/amcharts/20110315_javascript_tutorial_3/part3_1.html"><img class="aligncenter size-full wp-image-232" title="chart3_1" src="http://blog.danielpecos.com/wp-content/uploads/2011/03/chart3_1.png" alt="" width="584" height="392" /></a></p>
<p>Hey, wait a moment! Our graph has changed! That's because our data has different size time gaps between data points, and now amCharts is able to understand dates in our data, rendering them in their relative position.</p>
<p>If we want to draw a graph like the previous one (using regular intervals between data points), we have to set to true the property <em>equalSpacing</em> of the category Axis:</p>
<pre class="brush:js">// now we have to set up the category axis to parse dates
var catAxis = chart.categoryAxis;
catAxis.parseDates = true;
catAxis.equalSpacing = true;</pre>
<p>And now the resulting graph looks more like the one we got in Part 2 of this tutorial series, but now the labels on the category axis are displayed using a date format, instead of using directly the string from our data:</p>
<p style="text-align: center;"><a href="http://danielpecos.com/docs/amcharts/20110315_javascript_tutorial_3/part3_2.html"><img class="aligncenter size-full wp-image-233" title="chart3_2" src="http://blog.danielpecos.com/wp-content/uploads/2011/03/chart3_2.png" alt="" width="587" height="397" /></a></p>
<p><strong>MAKING-UP OUR CHART</strong></p>
<p>To finish this Part 3 of our amChart Javascript turorials, we will style-up our chart to get a fancier one. All the following code has to be added to the already defined <em>createChart</em> function.</p>
<p>First of all we will apply some general styles to the chart so we can set up margins, set a general color and add an initial animation:</p>
<pre class="brush:js">// styles applied to the chart
// default general color used in the chart
chart.color = "#AAAAAA";
// length of the animation
chart.startDuration = 2;
// margins between graph and canvas border
chart.marginLeft = 15;
chart.marginRight = 80;
chart.marginBottom = 40;</pre>
<p>Then we will style both axes. We will set our category axis to use bluish colors for the axis and grid lines:</p>
<pre class="brush:js">// styles applied to the category axis
// color of the axis line
catAxis.axisColor = "#2d66bb";
// color of the grid lines
catAxis.gridColor = "#2d66bb";</pre>
<p>To set up the value axis, we need an instance of ValueAxis, but we haven't created one until now, so our first step is to get a fresh instance. Then, in a similar way as before, we will set our value axis using also bluish colors but this time we don't want to show the grid lines, just the background colors. Finally, we add our new styled value axis to the chart:</p>
<pre class="brush:js">// styles applied to value axis
// we haven't set up a value axis until now,
// so we create one and apply styles to it
var valAxis = new AmCharts.ValueAxis();
// we want to display the value axis on the right side
valAxis.position = "right";
// color of the axis line
valAxis.axisColor = "#2d66bb";
// as we set fillAlpha, and fillColor we don't want grid to be visible
valAxis.gridAlpha = 0;
// each second gap between grid lines will be filled with this color
valAxis.fillColor = "#2d66bb";
// fill alpha
valAxis.fillAlpha = 0.1;
// length of each dash
valAxis.dashLength = 3;
// and finally we add the value axis to the chart
chart.addValueAxis(valAxis);</pre>
<p>Last step is to apply some styles to our graph line:</p>
<pre class="brush:js">// styles applied to the graph line
// color of the graph line
graph.lineColor = "#3a81ec";
// thicknes of the graph line
graph.lineThickness = 2;
// show round bullets for each point
graph.bullet = "round";
// length of each dash
graph.dashLength = 1;</pre>
<p>And the resulting chart should look like this one:</p>
<p><a href="http://danielpecos.com/docs/amcharts/20110315_javascript_tutorial_3/part3_3.html"><img class="aligncenter size-full wp-image-231" title="chart3_3" src="http://blog.danielpecos.com/wp-content/uploads/2011/03/chart3_3.png" alt="" width="584" height="388" /></a></p>
<p>Here you have full source code as it should look like once all changes we have talked about in this tutorial have been applied:</p>
<pre class="brush:js">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
        &lt;title&gt;amCharts Example&lt;/title&gt;
        &lt;link rel="stylesheet" href="style.css" type="text/css"&gt;
        &lt;script src="javascript/amcharts.js" type="text/javascript"&gt;&lt;/script&gt;
        &lt;script src="javascript/raphael.js" type="text/javascript"&gt;&lt;/script&gt;
        &lt;script type="text/javascript"&gt;
        // declaring variables
        var chart;
        var dataProvider;
        // this method called after all page contents are loaded
        window.onload = function() {
            createChart();
            loadCSV("data.txt");
        }
        // method which loads external data
        function loadCSV(file) {
            if (window.XMLHttpRequest) {
                // IE7+, Firefox, Chrome, Opera, Safari
                var request = new XMLHttpRequest();
            }
            else {
                // code for IE6, IE5
                var request = new ActiveXObject('Microsoft.XMLHTTP');
            }
            // load
            request.open('GET', file, false);
            request.send();
            parseCSV(request.responseText);
        }
          // method which parses a date string in the format YYYY-MM-DD and creates a Date object
          function parseDate(dateString) {
               // split the string get each field
               var dateArray = dateString.split("-");
               // now lets create a new Date instance, using year, month and day as parameters
               // month count starts with 0, so we have to convert the month number
               var date = new Date(Number(dateArray[0]), Number(dateArray[1]) - 1, Number(dateArray[2]));
               return date;
          }
        // method which parses csv data
        function parseCSV(data){
            //replace UNIX new line
            data = data.replace (/\r\n/g, "\n");
            //replace MAC new lines
            data = data.replace (/\r/g, "\n");
            //split into rows
            var rows = data.split("\n");
            // create array which will hold our data:
            dataProvider = [];
            // loop through all rows
            for (var i = 0; i &lt; rows.length; i++){
                // this line helps to skip empty rows
                if (rows[i]) {
                    // our columns are separated by comma
                    var column = rows[i].split(",");
                    // column is array now
                    // first item is date
                    var date = parseDate(column[0]);
                    // second item is value of the second column
                    var value1 = column[1];
                    // third item is value of the fird column
                    var value2 = column[2];
                    // create object which contains all these items:
                    var dataObject = {date:date, value1:value1, value2:value2};
                    // add object to dataProvider array
                    dataProvider.push(dataObject);
                }
            }
            // set data provider to the chart
            chart.dataProvider = dataProvider;
            // this will force chart to rebuild using new data
            chart.invalidateData();
        }
        // method which creates chart
        function createChart(){
            // chart variable is declared in the top
            chart = new AmCharts.AmSerialChart();
            // here we tell the chart name of category
            // field in our data provider.
            // we called it "date" (look at parseCSV method)
            chart.categoryField = "date";
            // styles applied to the chart
            // default general color used in the chart
            chart.color = "#AAAAAA";
            // length of the animation
            chart.startDuration = 2;
            // margins between graph and canvas border
            chart.marginLeft = 15;
            chart.marginRight = 80;
            chart.marginBottom = 40;
            // now we have to set up the category axis to parse dates
            var catAxis = chart.categoryAxis;
            catAxis.parseDates = true;
            //catAxis.equalSpacing = true;
            // styles applied to the category axis
            // color of the axis line
            catAxis.axisColor = "#2d66bb";
            // color of the grid lines
            catAxis.gridColor = "#2d66bb";
            // styles applied to value axis
            // we haven't set up a value axis until now,
            // so we create one and apply styles to it
            var valAxis = new AmCharts.ValueAxis();
            // we want to display the value axis on the right side
            valAxis.position = "right";
            // color of the axis line
            valAxis.axisColor = "#2d66bb";
            // as we set fillAlpha, and fillColor we don't want grid to be visible
            valAxis.gridAlpha = 0;
            // each second gap between grid lines will be filled with this color
            valAxis.fillColor = "#2d66bb";
            // fill alpha
            valAxis.fillAlpha = 0.1;
            // length of each dash
            valAxis.dashLength = 3;
            // and finally we add the value axis to the chart
            chart.addValueAxis(valAxis);
            // chart must have a graph
            var graph = new AmCharts.AmGraph();
            // graph should know at what field from data
            // provider it should get values.
            // let's assign value1 field for this graph
            graph.valueField = "value1";
            // and add graph to the chart
            // styles applied to the graph line
            // color of the graph line
            graph.lineColor = "#3a81ec";
            // thicknes of the graph line
            graph.lineThickness = 2;
            // show round bullets for each point
            graph.bullet = "round";
            // length of each dash
            graph.dashLength = 1;
            chart.addGraph(graph);
            // 'chartdiv' is id of a container
            // where our chart will be
            chart.write('chartdiv');
        }
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body style="background-color:#EEEEEE"&gt;
        &lt;div id="chartdiv" style="width:600px; height:400px; background-color:#FFFFFF"&gt;&lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2011/03/amcharts-javascript-tutorial-parsing-dates-and-styling-up-the-chart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTP connection + HTTP Authenticacion + Proxy + SSL</title>
		<link>http://blog.danielpecos.com/2010/12/http-connection-http-authenticacion-proxy-ssl/</link>
		<comments>http://blog.danielpecos.com/2010/12/http-connection-http-authenticacion-proxy-ssl/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 18:20:19 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[commons-httpclient]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=45</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2010/12/http-connection-http-authenticacion-proxy-ssl/&amp;text=HTTP connection + HTTP Authenticacion + Proxy + SSL&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Many times during your life as a java developer, you will face the situation of retrieving some resources using an HTTP connection. At first, it will seem easy, but probably some problems will arise such as: Needing to use an HTTP Proxy (maybe authentication would be required) Establishing an HTTP authenticated connection Connecting to a [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2010/12/http-connection-http-authenticacion-proxy-ssl/&amp;text=HTTP connection + HTTP Authenticacion + Proxy + SSL&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Many times during your life as a java developer, you will face the situation of retrieving some resources using an HTTP connection. At first, it will seem easy, but probably some problems will arise such as:</p>
<ol>
<li>Needing to use an HTTP Proxy (maybe authentication would be required)</li>
<li>Establishing an HTTP authenticated connection</li>
<li>Connecting to a server that uses SSL self-signed certificates</li>
</ol>
<p>I'm sure you will quickly find the Apache Commons solution:<em> commons-httpclient</em>. In this article I will show you some code that, I hope, will ease you the &nbsp;resolution of the previous obstacles using this great API from Apache.</p>
<p><span id="more-45"></span></p>
<p>First of all I will show you the basic code needed to establish an HTTP GET connection using <em>commons-httpclient</em> and then we will add continuous enhancements step by step:</p>
<pre class="brush:java">GetMethod httpget = null;
String result = null;
try {
    httpget = new GetMethod(url);

    HttpClient client = new HttpClient();
    int status = client.executeMethod(httpget);
    if (status == 200) {
        result = httpget.getResponseBodyAsString();
    } else {
        System.err.println("Error accessing to URL " + status + ": " + &nbsp;httpget.getStatusLine());
    }

} catch (MalformedURLException e) {
    System.err.println("Malformed URL: " + e.getMessage());
} catch (IOException e) {
    System.err.println("I/O problems: " + e.getMessage());
} catch (Exception e) {
    System.err.println("URL not found: " + e.getMessage());
} finally {
    if (httpget != null) {
        httpget.releaseConnection();
    }
}</pre>
<p><span style="text-decoration: underline;"><strong>1. Use an HTTP Proxy (maybe authentication would be required)</strong></span></p>
<p>Now lets add the necessary code to establish the HTTP connection using a Proxy. I will use a static method to configure proxy settings in our <em>HttpClient </em>instance:</p>
<pre class="brush:java">private static void configureProxy(HttpClient client, HttpMethodBase method, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, String proxyNTDomain) {

    client.getHostConfiguration().setProxy(proxyHost, proxyPort);

    if (proxyUsername != null &amp;&amp; proxyUsername.length() &gt; 0) {

        if (proxyNTDomain != null &amp;&amp; proxyNTDomain.length() &gt; 0)  {
            // use NT Domain authentication
            NTCredentials credentials = new NTCredentials(proxyUsername, proxyPassword, proxyHost, proxyNTDomain);
            HttpState state = client.getState();
            state.setProxyCredentials(new AuthScope(proxyHost, proxyPort, AuthScope.ANY_REALM), credentials);
        } else {
            // use plain user/password authentication
            Credentials defaultcreds = new UsernamePasswordCredentials(proxyUsername, proxyPassword);
            client.getState().setProxyCredentials(new AuthScope(proxyHost, proxyPort, AuthScope.ANY_REALM), defaultcreds);
        }
        method.setDoAuthentication(true);
    }

}</pre>
<p>and then we will have to insert this line of code in our previous example (I have inserted it between lines 6-7):</p>
<pre class="brush:java">configureProxy(client, httpget, proxyHost, proxyPort, proxyUsername, proxyPassword, proxyNTDomain);</pre>
<p>At this moment, we have point 1 solved, so let's go for point 2: Basic HTTP Authentication.</p>
<p><strong><span style="text-decoration: underline;">2. Establish an HTTP authenticated connection</span></strong></p>
<p>In order to keep code as clean as possible, I will create another static method to set HTTP authentication:</p>
<pre class="brush:java">private static void configureHTTPAuthentication(HttpClient client, String host, int port, String httpUsername, String httpPassword) {
    client.getState().setCredentials(new AuthScope(host, port), new UsernamePasswordCredentials(httpUsername, httpPassword));
}</pre>
<p>and the required call to this method, just after the previous one:</p>
<pre class="brush:java">configureHTTPAuthentication(client, httpget.getURI().getHost(), httpget.getURI().getPort(), httpUsername, httpPassword);</pre>
<p>This one was easy <img src='http://blog.danielpecos.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><span style="text-decoration: underline;"><strong>3. Connect to a server that uses SSL self-signed certificates</strong></span></p>
<p>Now lets solve the last point, probably the more difficult of all of them. We will need two implementations of <em>ProtocolSocketFactory</em> and <em>X509TrustManager</em> that accept self-signed certificates: <em>EasySSLProtocolSocketFactory </em>and <em>EasyX509TrustManager</em>, which you can find in httpclient-contrib (I have grabbed them from <a href="mailto:adrian.sutton@ephox.com">Adrian Sutton</a> and&nbsp;<a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a> and you can also find them attached at the end of this article). Once in our <em>classpath</em>, we have to insert the following code in our first example, just below the call to <em>configureHTTPAuthentication</em>:</p>
<pre class="brush:java">if (url.startsWith("https")) {
    Protocol protocol = new Protocol("https", new EasySSLProtocolSocketFactory(), 443);
    client.getHostConfiguration().setHost(httpget.getURI().getHost(), 443, protocol);
    // we also can set this socketfactory as global for all the connections
    //Protocol.registerProtocol("https", protocol);
}</pre>
<p>Finally, we should be able to connect to a HTTP-Authenticaded SSL URL, using an http (authenticated-?)proxy. Isn't it cool? This is how our final code looks like:</p>
<pre class="brush:java">private static void configureProxy(HttpClient client, HttpMethodBase method, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, String proxyNTDomain) {

    client.getHostConfiguration().setProxy(proxyHost, proxyPort);

    if (proxyUsername != null &amp;&amp; proxyUsername.length() &gt; 0) {

        if (proxyNTDomain != null &amp;&amp; proxyNTDomain.length() &gt; 0)  {
            // use NT Domain authentication
            NTCredentials credentials = new NTCredentials(proxyUsername, proxyPassword, proxyHost, proxyNTDomain);
            HttpState state = client.getState();
            state.setProxyCredentials(new AuthScope(proxyHost, proxyPort, AuthScope.ANY_REALM), credentials);
        } else {
            // use plain user/password authentication
            Credentials defaultcreds = new UsernamePasswordCredentials(proxyUsername, proxyPassword);
            client.getState().setProxyCredentials(new AuthScope(proxyHost, proxyPort, AuthScope.ANY_REALM), defaultcreds);
        }
        method.setDoAuthentication(true);
    }

}

private static void configureHTTPAuthentication(HttpClient client, String host, int port, String httpUsername, String httpPassword) {
    client.getState().setCredentials(new AuthScope(host, port), new UsernamePasswordCredentials(httpUsername, httpPassword));
}

public static String doGETConnection(String url, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, String proxyNTDomain, String httpUsername, String httpPassword) {

    GetMethod httpget = null;
    String result = null;
    try {
        httpget = new GetMethod(url);

        HttpClient client = new HttpClient();
        configureProxy(client, httpget, proxyHost, proxyPort, proxyUsername, proxyPassword, proxyNTDomain);
        configureHTTPAuthentication(client, httpget.getURI().getHost(), httpget.getURI().getPort(), httpUsername, httpPassword);

        if (url.startsWith("https")) {
            Protocol protocol = new Protocol("https", new EasySSLProtocolSocketFactory(), 443);
            client.getHostConfiguration().setHost(httpget.getURI().getHost(), 443, protocol);
            // we also can set this socketfactory as global for all the connections
            //Protocol.registerProtocol("https", protocol);
        }

        int status = client.executeMethod(httpget);
        if (status == 200) {
            result = httpget.getResponseBodyAsString();
        } else {
            System.err.println("Error accessing to URL " + status + ": " +  httpget.getStatusLine());
        }

    } catch (MalformedURLException e) {
        System.err.println("Malformed URL: " + e.getMessage());
    } catch (IOException e) {
        System.err.println("I/O problems: " + e.getMessage());
    } catch (Exception e) {
        System.err.println("URL not found: " + e.getMessage());
    } finally {
        if (httpget != null) {
            httpget.releaseConnection();
        }
    } 

    return result;

}</pre>
<p><span style="text-decoration: underline;"><strong>Possible exceptions</strong></span></p>
<p>But, if we haven't been lucky, we can find one of this two exceptions (if not both) when trying to establish connection:</p>
<pre>javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target</pre>
<p>This one is due to the JDK can not verify the self-signed certificate. We have to add it to a trusted keystore and make it available to the JDK, using <a href="http://blog.danielpecos.com/wp-content/uploads/2010/12/InstallCert.zip">InstallCert</a> java standalone application.</p>
<p>Another different problem that I got while developing this code, was the next one:</p>
<pre>javax.net.ssl.SSLKeyException: RSA premaster secret error</pre>
<p>It's related to this size of the certificate and the JDK cryptographic capabilities. To resolve this issue, download and install the <a href="http://java.sun.com/j2se/1.5.0/download.jsp">Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files version 5.0.</a> Extracted from its README file:</p>
<blockquote>
<div id="_mcePaste">
<div id="_mcePaste">Due to import control restrictions, the version of JCE policy files that are bundled in the JDK(TM) 5.0 environment allow "strong" but limited cryptography to be used. This download bundle (the one including this README file) provides "unlimited strength" policy files which contain no restrictions on cryptographic strengths.</div>
<div id="_mcePaste">Please note that this download file does NOT contain any encryption functionality since such functionality is supported in Sun's JDK 5.0.Thus, this installation applies only to Sun's JDK 5.0, and assumes that the JDK 5.0 is already installed.</div>
</div>
</blockquote>
<p><strong><span style="text-decoration: underline;">And finally...</span></strong></p>
<p>I hope this article would help you to resolve your HTTP connection issues. If not, please post a comment and I will try to reply you ASAP. You can also find me at twitter @danielpecos</p>
<p style="text-align: center;"><strong><span style="color: #339966;"><em>Feedback is welcomed!</em></span></strong></p>
<p><em>Files used for this demo: </em></p>
<ul>
<li><em>Full sources of the example developed here:&nbsp;<a href="http://blog.danielpecos.com/wp-content/uploads/2010/12/httpclient-example.zip">httpclient-example</a>. </em></li>
<li><em>Standalone java application to create a keystor</em><em>e:&nbsp;<a href="http://blog.danielpecos.com/wp-content/uploads/2010/12/InstallCert.zip">InstallCert</a></em></li>
<li><em>I also provide a mirror for the&nbsp;needed&nbsp;<a href="http://blog.danielpecos.com/wp-content/uploads/2010/12/jce_policy-1_5_0.zip">policy files</a> in case of RSA premaster secret error.</em></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2010/12/http-connection-http-authenticacion-proxy-ssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Git-SCM (Part 1)</title>
		<link>http://blog.danielpecos.com/2010/11/git-scm-part1/</link>
		<comments>http://blog.danielpecos.com/2010/11/git-scm-part1/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 22:03:11 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=80</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2010/11/git-scm-part1/&amp;text=Git-SCM (Part 1)&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
One of the key tools of a software project development is the repository where it's hosted. During my experience as software developer I have been working with several flavors, such as Visual SourceSafe, CVS, Mercurial, and of course, SVN. But latetly I have found this little jewel called Git. Git was initially developed by Linus [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2010/11/git-scm-part1/&amp;text=Git-SCM (Part 1)&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>One of the key tools of a software project development is the repository where it's hosted. During my experience as software developer I have been working with several flavors, such as <a href="http://msdn.microsoft.com/en-us/vstudio/aa718670.aspx">Visual SourceSafe</a>, <a href="http://www.nongnu.org/cvs/">CVS</a>, <a href="http://mercurial.selenic.com/">Mercurial</a>, and of course, <a href="http://subversion.tigris.org/">SVN</a>. But latetly I have found this little jewel called <a href="http://git-scm.com/">Git</a>.</p>
<p>Git was initially developed by Linus Torvalds as a result of an unsuccessful research to replace the propietary <a href="http://en.wikipedia.org/wiki/Software_Configuration_Management">SCM</a> BitKeeper, used back in 2005 in the Linux Kernel project (kinda strange that the opensource star project was hosted with a propietary software, huh?). Back then, the ability to freely use BitKeeper was withdrawn by its copyright holder, so Linus was forced to find a replacement for it. He was looking for a <a href="http://en.wikipedia.org/wiki/Revision_control">VCS</a> with a high performance in the process of applying patches and keeping track of the changes, but he didn't find any opensource solutions that fitted his requirements, so he started the developement of Git (as he says on <a href="http://en.wikipedia.org/wiki/Git_(software)">Git's Wikipedia entry</a>, Git was named after himself, because he considers himself an "egoistical bastard, and I name all my projects after myself"; <em>git </em>is the British English slang word for an stupid or unpleasant person).</p>
<p>That's why its main characteristics are oriented to help the development and management of a huge, distributed and collaborative project like the Linux Kernel. These are the most noticeable of them:</p>
<ul>
<li>Strong support for non-linear development</li>
<li>Distributed development</li>
<li>Efficient handling of large projects</li>
<li>Cryptographic authentication of history</li>
<li>...</li>
</ul>
<p>But for me, the most shocking one is its decentralized structure in distributed development: there is no need for a central repository where all commits are sent by the people working in the project (but still, it is recommended to use a <em>main </em>branch for that purpose).</p>
<p>In following posts I will explain how to use Git in the lifecycle of a software project and how can it improve our performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2010/11/git-scm-part1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nuevo foro de fotografía: enfocas.es</title>
		<link>http://blog.danielpecos.com/2009/10/nuevo-foro-de-fotografia-enfocas-es/</link>
		<comments>http://blog.danielpecos.com/2009/10/nuevo-foro-de-fotografia-enfocas-es/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 11:26:50 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[Fotografía]]></category>
		<category><![CDATA[divagaciones]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=169</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2009/10/nuevo-foro-de-fotografia-enfocas-es/&amp;text=Nuevo foro de fotografía: enfocas.es&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
http://enfocas.es En origen, ENFOCAS, está formado por un grupo de amig@s de Castellón, unidos por su pasión hacia la fotografía. El foro en sí, nace como punto de encuentro de quienes como nosotros, sientan la necesidad de compartir esta afición, a través de las imágenes que podamos aportar, junto con los comentarios, dudas, informaciones de [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2009/10/nuevo-foro-de-fotografia-enfocas-es/&amp;text=Nuevo foro de fotografía: enfocas.es&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<blockquote><p><a title="Enfocas" href="http://enfocas.es" target="_blank"><img class="aligncenter size-full wp-image-168" title="Enfocas" src="http://blog.danielpecos.com/wp-content/uploads/2009/10/logo_100.png" alt="Enfocas" width="330" height="100" /></a></p>
<p style="text-align: center;"><a title="Enfocas" href="http://enfocas.es" target="_blank"><strong>http://enfocas.es</strong></a></p>
<p><em>En origen, ENFOCAS, está formado por un grupo de amig@s de Castellón, unidos por su pasión hacia la fotografía. El foro en sí, nace como punto de encuentro de quienes como nosotros, sientan la necesidad de compartir esta afición, a través de las imágenes que podamos aportar, junto con los comentarios, dudas, informaciones de interés o cualquier otro aspecto que pueda surgir a lo largo de su vida.</em></p>
<p><em>No pretendemos ser ningún referente, tan solo queremos disponer de una parcela de la red para poder compartir nuestra pasión por la fotografía, con quienes quieran acercarse a él, y lo hagan de forma respetuosa hacia las obras, aportaciones y opiniones de los demás.</em></p>
<p><em>Precisamente en este talante de respeto hacia las aportaciones, grandes o pequeñas, y de las opiniones de sus componentes, esperamos que surja un foro vivo y participativo, donde  el propio foro, su estructura, su estilo  sea fruto de la participación de quienes lo componemos.</em></p>
<p><em>Por último, no podemos evitar tener presente en nuestro pensamiento, que la comunicación a través de Internet, aún siendo deseable y de gran importancia, no puede ni debe suplir, en la medida de lo posible, un contacto directo y personal. Tratamos, pues, de conseguir una participación más cercana, buscando fomentar la presencia activa a través de puntos de encuentro, ya sean mediante KDD´s en nuestra comunidad o fuera de ella, si fuera posible, y a través de todos aquellos birrings que nos permitan compartir unos momentos de amigable camaradería y conversación.</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2009/10/nuevo-foro-de-fotografia-enfocas-es/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GNU HttpTunnel: Como saltarse un proxy HTTP</title>
		<link>http://blog.danielpecos.com/2009/09/gnu-httptunnel-como-saltarse-un-proxy-http/</link>
		<comments>http://blog.danielpecos.com/2009/09/gnu-httptunnel-como-saltarse-un-proxy-http/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 15:41:25 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[Computer Technology]]></category>
		<category><![CDATA[divagaciones]]></category>
		<category><![CDATA[redes]]></category>
		<category><![CDATA[seguridad]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=159</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2009/09/gnu-httptunnel-como-saltarse-un-proxy-http/&amp;text=GNU HttpTunnel: Como saltarse un proxy HTTP&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Creo que es la primera vez que posteo sobre una aplicación, pero creo que en este caso merece la pena hacerlo. Se trata de GNU HttpTunnel, una pequeña aplicación que crea un túnel HTTP sobre el que podemos meter cualquier servicio. ¿Ventajas? Pues que al ser HTTP, si nos encontramos en una red que solo [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2009/09/gnu-httptunnel-como-saltarse-un-proxy-http/&amp;text=GNU HttpTunnel: Como saltarse un proxy HTTP&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Creo que es la primera vez que posteo sobre una aplicación, pero creo que en este caso merece la pena hacerlo. Se trata de GNU HttpTunnel, una pequeña aplicación que crea un túnel HTTP sobre el que podemos meter cualquier servicio. ¿Ventajas? Pues que al ser HTTP, si nos encontramos en una red que solo tiene salida a Internet mediante un proxy HTTP, con esta aplicación (y un PC fuera de la red), podemos salir de la red con el servicio que más nos interese.</p>
<p><img class="aligncenter size-full wp-image-161" title="HTTP Tunnel" src="http://blog.danielpecos.com/wp-content/uploads/2009/09/httptunnel.gif" alt="HTTP Tunnel" width="300" height="116" /></p>
<p>Aquí va el chuletario:</p>
<p>En el PC al otro lado del proxy (fuera de la red) ejecutamos:</p>
<pre>$ hts -w -F host_remoto:puerto_remoto puerto_local_servidor</pre>
<p>y en el cliente (detrás del proxy) ejecutamos:</p>
<pre>$ htc -P ip_proxy:puerto_proxy -F puerto_local_cliente ip_servidor:puerto_local_servidor</pre>
<p>Por ejemplo, si quisiera crear un tunel HTTP para el SSH que tengo en mi servidor de casa (cosa muy útil, por si tuviera que abrir nuevos túneles <img src='http://blog.danielpecos.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ), tendría que ejecutar el siguiente comando en dicha máquina:</p>
<pre>$ hts -w -F localhost:22 7022</pre>
<p>lo cual crearía un tunel a la expera de conexión en el puerto 8022 del servidor (este puerto tendría que hacerlo accesible desde internet, en caso de que nos encontremos detras de un router sin NAT), y en la máquina desde la que me quiero conectar ejecuto:</p>
<pre>$ htc -P ip_proyx:80 -F 22 ip_servidor:7022</pre>
<p>de forma que ahora al conectarme al puerto 22 de la máquina local, realmente me estoy conectando al puerto 22 del servidor de mi casa.</p>
<p>Pues espero que os sea útil!</p>
<p>Un saludo!</p>
<p style="padding-left: 30px;">Más info:</p>
<ul style="padding-left: 30px;">
<li style="padding-left: 30px;"><a href=" http://www.nocrew.org/software/httptunnel.html">http://www.nocrew.org/software/httptunnel.html</a></li>
<li style="padding-left: 30px;"><a href="http://www.gnu.org/software/httptunnel/httptunnel.html">http://www.gnu.org/software/httptunnel/httptunnel.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2009/09/gnu-httptunnel-como-saltarse-un-proxy-http/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adiós Gloria</title>
		<link>http://blog.danielpecos.com/2009/04/adios-gloria/</link>
		<comments>http://blog.danielpecos.com/2009/04/adios-gloria/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 21:48:48 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[divagaciones]]></category>
		<category><![CDATA[homenaje]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=134</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2009/04/adios-gloria/&amp;text=Adiós Gloria&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Me ha costado bastante escribir este post, pero finalmente creo que el recuerdo lo merece. Como homenaje, se están recogiendo firmas para dar su nombre a una de las aulas del ESTCE: http://homenajeagloria.uji.es/ El pasado 14 de abril de 2009 falleció nuestra compañera y amiga Gloria Martínez. Gloria fue una de las profesoras encargadas de [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2009/04/adios-gloria/&amp;text=Adiós Gloria&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Me ha costado bastante escribir este post, pero finalmente creo que el recuerdo lo merece.</p>
<div id="attachment_135" class="wp-caption aligncenter" style="width: 204px"><img class="size-full wp-image-135" title="Gloria Martínez" src="http://blog.danielpecos.com/wp-content/uploads/2009/04/gloria.jpg" alt="Gloria Martínez" width="194" height="243" /><p class="wp-caption-text">Gloria Martínez</p></div>
<p>Como homenaje, se están recogiendo firmas para dar su nombre a una de las aulas del ESTCE: <a href="http://homenajeagloria.uji.es/">http://homenajeagloria.uji.es/</a></p>
<blockquote><p><em>El pasado 14 de abril de 2009 falleció nuestra compañera y amiga Gloria Martínez. Gloria fue una de las profesoras encargadas de poner en marcha en 1991, fecha de su creación, los estudios de informática en la Universidad Jaume I. Desde entonces ha estado involucrada, muy activamente, en todos los aspectos tanto organizativos como docentes de dichos estudios. También fue una de las personas más destacadas en muchas de las actividades extraacadémicas de esta Universidad como son, por ejemplo, las jornadas iParty, o el grupo de Amnistía Internacional de la UJI. Además, también destacó a nivel nacional como impulsora de la Asociación de Enseñantes Universitarios de Informática (AENUI) de la cual era Coordinadora en el momento de su fallecimiento. </em></p>
<p><em>Muchas de las personas que tuvimos relación directa con Gloria, tanto estudiantes como profesores y amigos, consideramos que ha dejado una gran huella allí por donde ha pasado y desearíamos que su memoria no se olvidase fácilmente en el lugar al que dedicó gran parte de su energía. Para ello, todas las personas abajo firmantes, solicitamos que se dé su nombre a una de las aulas de la ESTCE donde ella desarrolló su actividad docente.</em></p></blockquote>
<p>Gloria, gracias por enseñarme como lo hiciste y ser como fuiste. Tus clases son de de los mejores recuerdos que mantengo de la universidad. Gracias.</p>
<p>(Si alguien quiere saber más sobre cómo era ella, aquí dejo la dirección de su blog donde posteaba con frecuencia: <a href="http://servidora.blogspot.com/">http://servidora.blogspot.com/</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2009/04/adios-gloria/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009: Odisea con el funcionariado</title>
		<link>http://blog.danielpecos.com/2009/01/2009-odisea-con-el-funcionariado/</link>
		<comments>http://blog.danielpecos.com/2009/01/2009-odisea-con-el-funcionariado/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 20:46:31 +0000</pubDate>
		<dc:creator>Daniel Pecos Martínez</dc:creator>
				<category><![CDATA[Opinión]]></category>
		<category><![CDATA[Trabajo]]></category>
		<category><![CDATA[divagaciones]]></category>
		<category><![CDATA[funcionarios]]></category>
		<category><![CDATA[odisea]]></category>

		<guid isPermaLink="false">http://blog.danielpecos.com/?p=108</guid>
		<description><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2009/01/2009-odisea-con-el-funcionariado/&amp;text=2009: Odisea con el funcionariado&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
Tiemblo cada vez que tengo que tratar con un funcionario, es como si te echaran una maldición: De entrada tienes pocas esperanzas de poder hacer el trámite a la primera, sin que te toque volver n-mil veces a tratar con el/la individu@ en cuestión. Una vez te decides a intentarlo, siempre te queda la duda [...]]]></description>
			<content:encoded><![CDATA[
<div class="twitterbutton" style="float: right; padding-left: 5px;"><a href="http://twitter.com/share?url=http://blog.danielpecos.com/2009/01/2009-odisea-con-el-funcionariado/&amp;text=2009: Odisea con el funcionariado&amp;via=danielpecos&amp;related=DolcePixel"><img align="right" src="http://blog.danielpecos.com/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>Tiemblo cada vez que tengo que tratar con un funcionario, es como si te echaran una maldición:</p>
<ul>
<li>De entrada tienes pocas esperanzas de poder hacer el trámite a la primera, sin que te toque volver n-mil veces a tratar con el/la individu@ en cuestión.</li>
<li>Una vez te decides a intentarlo, siempre te queda la duda de si ir al edificio público en el que ejerce su profesión o si acudir directamente a la cafetería de al lado (lo cual me hace reflexionar si su profesión es aquella por la que recibe un sueldo, o la que ejerce donde pasa la mayor parte de su jornada laboral... puede ser un tema de reflexión bastante interesante).</li>
<li>Por último, si has tenido suerte, los astros se encuentran en la conjunción adecuada y encuentras al funcionario en su sitio, tienes que poner la sonrisa más agradable para que el/la personaje, con su cara de estreñido (o de "deja de joderme, que yo a ti no te voy a buscar a tu trabajo y me pongo a darte por el culo"), se digne a darte un trato poco despreciable y a conseguir un mínimo de información, que con suerte, puede llegar a ser hasta útil (porque hay veces que se contradicen, o mejor aún, se dedican a pasarse la pelota, osea tú, de unos a otros).</li>
</ul>
<p>Posibles motivos de que esta gente se comporte de este modo:</p>
<ul>
<li>Porque no les gusta lo que hacen: pues tuvieron que estudiar bastante tiempo y disputárselo entre muchos para conseguir lo que tienen, por lo que estoy más que seguro que conocían lo que se iban a encontrar (tal vez, con toda la idea, de tocarse las pelotas durante los restos).</li>
<li>Porque el sentimiento de seguridad y de ser intocables en el trabajo les hace descuidarlo: poco más que decir, si no rindes cuentas a nadie y tampoco te motiva lo que haces, es obvio que cada vez lo vas a hacer peor y con menos ganas (siempre existe la posibilidad de que se dejen el trabajo, pero también existe la posibilidad de que llueva hacia arriba).</li>
</ul>
<p>Concretando, todo esto se solucionaría <strong>eliminando la permanencia asegurada de un funcionario en su puesto de trabajo</strong> e implantando unos controles y seguimientos de los rendimientos de su trabajo. ¿Por qué no se hace? Pues porque seguramente lo tendría que tramitar un funcionario y es probable que se le fundieran los sesos al intentar averiguar qué impresos son necesarios.</p>
<p>Como bien dice mi padre, un funcionario es alguien que hace un esfuerzo en un momento de su vida y se pasa el resto de ella descansando. O como dice un amigo funcionario, que entran a las 8 al puesto de trabajo, pero trabajar nunca se sabe a qué hora se comienza (igualito que en mi empresa <img src='http://blog.danielpecos.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  )</p>
<p>Y es que francamente, ¿quién no ha pensado que la tarea que realizan 5 funcionarios administrativos la podrían hacer perfectamente 1, como mucho 2, personas trabajadoras como cualquiera? Da la sensación que cuando entran les hacen un test de aptitud y a los que lo superan les rechazan para el puesto (de hecho, el amigo que he comentado justo antes, fue acusado de trepa por sus compañeros funcionarios porque rendía demasiado <img src='http://blog.danielpecos.com/wp-includes/images/smilies/icon_surprised.gif' alt=':-o' class='wp-smiley' />  !?!?!?!?! <img src='http://blog.danielpecos.com/wp-includes/images/smilies/icon_surprised.gif' alt=':-o' class='wp-smiley' />  ).</p>
<p>Nota: he intentado referirme concretamente a funcionarios de caracter administrativo, de los que te atienden tras un mostrador o mesa, aunque, por sorprendente que parezca, estoy convencido que hay funcionarios de gran calidad tanto personal como profesional, por lo que tampoco es correcto generalizar.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.danielpecos.com/2009/01/2009-odisea-con-el-funcionariado/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

