<?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>Sebastian Oliva</title>
	<atom:link href="http://www.sebastianoliva.com/en/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sebastianoliva.com/en/</link>
	<description>mi Blag Personal</description>
	<lastBuildDate>Sun, 04 Sep 2011 04:02:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>GSoC, soft pencil down</title>
		<link>http://www.sebastianoliva.com/en/2011/08/gsoc-soft-pencil-down/</link>
		<comments>http://www.sebastianoliva.com/en/2011/08/gsoc-soft-pencil-down/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 21:06:20 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[GSOC-2011]]></category>
		<category><![CDATA[openSUSE @en]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=196</guid>
		<description><![CDATA[Hello, This week I finished most of the issues pending on the server. Multiple profiles for the same device are working, however it will require to rebuild the testing environment. The admin area is almost finished, with the authentication working but still has some issues pending. I expect to have at least a reference client [...]]]></description>
			<content:encoded><![CDATA[<p>Hello,<br />
This week I finished most of the issues pending on the server. Multiple profiles for the same device are working, however it will require to rebuild the testing environment. The admin area is almost finished, with the authentication working but still has some issues pending.</p>
<p>I expect to have at least a reference client implementation done for the pencil down date. But I expect to keep working afterwards.</p>
<p>Also I&#8217;ll be assisting <a href="http://conference.opensuse.org/">openSUSE Conference 2011</a> in Nuremberg. And I expect to present the service working fully.</p>
<p>Please leave your comments or feedback below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2011/08/gsoc-soft-pencil-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GSoC, Week 5</title>
		<link>http://www.sebastianoliva.com/en/2011/07/gsoc-week-6/</link>
		<comments>http://www.sebastianoliva.com/en/2011/07/gsoc-week-6/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 05:47:00 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[GSOC-2011]]></category>
		<category><![CDATA[openSUSE @en]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[opensuse project]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=191</guid>
		<description><![CDATA[Apart from what already was reported for the midterm, this weeks report includes the basics of the admin interface. It will use basic HTTP authentication, based on the documentation&#8217;s recommendation to implement. OpenID was shelved, due to the complexity, the need to add an extra data storage, and because advanced and granular authentication controls are [...]]]></description>
			<content:encoded><![CDATA[<p>Apart from what already was reported for the midterm, this weeks report includes the basics of the admin interface. It will use basic HTTP authentication, based on the documentation&#8217;s recommendation to implement. OpenID was shelved, due to the complexity, the need to add an extra data storage, and because advanced and granular authentication controls are not required at the moment. The other major change was adding support for different profiles, attached to the same device_id. This was implementing by changing the storage of the profiles collection from a binary data field to an array with the binaries. This was done to keep the same database design layout, and not affect performance.</p>
<p>Feel free to contact me for your comments or questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2011/07/gsoc-week-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GSOC, midterm report</title>
		<link>http://www.sebastianoliva.com/en/2011/07/gsoc-midterm-report/</link>
		<comments>http://www.sebastianoliva.com/en/2011/07/gsoc-midterm-report/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 06:19:09 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[GSOC-2011]]></category>
		<category><![CDATA[openSUSE @en]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=184</guid>
		<description><![CDATA[Hello, This is my mid-term report for my GSoC project for the openSUSE project. As for now, I have a basic working web service, using Python and MongoDB. I have implemented the JSON device properties specification by the OpenICC group. The web service still needs improvements on look, and to improve error handling. The code [...]]]></description>
			<content:encoded><![CDATA[<p>Hello,<br />
This is my mid-term report for my GSoC project for the openSUSE project. As for now, I have a basic working web service, using Python and MongoDB. I have implemented the JSON device properties specification by the OpenICC group. The web service still needs improvements on look, and to improve error handling.</p>
<p>The code is available on <a href="https://gitorious.org/gsoc-2011/gsoc-2011">gitorious.org/gsoc-2011/gsoc-2011</a></p>
<p>The objectives are now:</p>
<ul>
<li>Creating a Gnome/GTK, and a KDE client to submit and retrieve profiles automatically</li>
<li>Performance profiling</li>
<li>Improving look and feel</li>
<li>Improving the search algorithm</li>
<li>100% test coverage and more testing</li>
<li>Clearing up requirements to apply for infrastructure support on the openSUSE project (including creating an snazzy project name <img src='http://www.sebastianoliva.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</li>
</ul>
<p>That&#8217;s it for the midterms, feel free to comment or contacting me,<br />
Regards,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2011/07/gsoc-midterm-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GSOC, Week 5</title>
		<link>http://www.sebastianoliva.com/en/2011/06/gsoc-week-5/</link>
		<comments>http://www.sebastianoliva.com/en/2011/06/gsoc-week-5/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 00:41:42 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=177</guid>
		<description><![CDATA[Hello, The last week I outlined several important decisions on the project. I decided to use MongoDB which is a non-relational document based database. MongoDB is free software under the AGPL, and uses BSON, a binary serialization of JSON, which is convenient for storing and retrieving info. I am using PyMongo, the official driver to [...]]]></description>
			<content:encoded><![CDATA[<p>Hello,<br />
The last week I outlined several important decisions on the project. I decided to use <a href="http://www.mongodb.org/">MongoDB</a> which is a non-relational document based database. MongoDB is free software under the AGPL, and uses BSON, a binary serialization of JSON, which is convenient for storing and retrieving info. I am using PyMongo, the official driver to the DB. I started writing the <a href="https://gitorious.org/gsoc-2011/gsoc-2011/commit/b978f3c3a092bf14c4b6640f36313ce5b08d94e3">unit tests, and outlined the storage API</a>. I also wrote the base of the <a href="https://gitorious.org/gsoc-2011/gsoc-2011/commit/20549a3d5eeaafef91d88f5e0b7aeea1f0d50689">Storage API</a> itself. </p>
<p>For the web part of the project, I will use <a href="http://flask.pocoo.org">Flask </a>. A free framework, compatible with FastCGI.</p>
<p>Feel free to leave your comments.</p>
<p>Regards.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2011/06/gsoc-week-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GSOC, Week 4</title>
		<link>http://www.sebastianoliva.com/en/2011/06/gsoc-week-4/</link>
		<comments>http://www.sebastianoliva.com/en/2011/06/gsoc-week-4/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 18:03:05 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[GSOC-2011]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[opensuse]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=168</guid>
		<description><![CDATA[Hi, This week, I worked mostly on getting my paper mockups digitalized. Uploaded a design for the front page on gitorious.org/gsoc-2011/gsoc-2011. I also uploaded a basic API doc blueprint to be implemented. I still have some drafts to be mocked up on HTML but I&#8217;ll be working on them this week. You can check up [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>This week, I worked mostly on getting my paper mockups digitalized. Uploaded a design for the front page on  gitorious.org/gsoc-2011/gsoc-2011. I also uploaded a basic <a href="https://gitorious.org/gsoc-2011/gsoc-2011/blobs/master/docs/api_doc.txt">API doc blueprint</a> to be implemented.</p>
<p>I still have some drafts to be mocked up on HTML but I&#8217;ll be working on them this week.</p>
<p>You can check up on my <a href="https://www.google.com/calendar/ical/cojlaeats5jfj655p9squ2oedg%40group.calendar.google.com/public/basic.ics">public Google Calendar</a> for some events.</p>
<p>On a mildly unrelated issue, on my University&#8217;s local usergroup <a href="http://lugusac.org">lugUSAC</a>, presented a workshop on free CMSs. We gifted some custom CDs made with SUSE Studio and raffled</p>
<p>some openSUSE discs.</p>
<p><a href="http://labs.sebastianoliva.com/gallery/main.php/v/SSL19/DSC_1026.JPG.html"><br />
<img alt="openSUSE discs waiting to be raffled" src="http://labs.sebastianoliva.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=1501&amp;g2_serialNumber=2&quot;" /></a></p>
<p>Greetings, and please leave your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2011/06/gsoc-week-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GSOC, Week 1</title>
		<link>http://www.sebastianoliva.com/en/2011/05/gsoc-week-1/</link>
		<comments>http://www.sebastianoliva.com/en/2011/05/gsoc-week-1/#comments</comments>
		<pubDate>Sun, 29 May 2011 03:25:45 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[GSOC-2011]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[icc]]></category>
		<category><![CDATA[opensuse]]></category>
		<category><![CDATA[opensuse project]]></category>
		<category><![CDATA[profiles]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=152</guid>
		<description><![CDATA[Hi, This week, GSOC&#8216;s coding period officially started. This week I created my repositories on gitorious.org/gsoc-2011/gsoc-2011 and on a personal testing server. Contacted my mentor (Kai-Uwe Behrmann) and we discussed on the ICC JSON serialization format proposed during LibreGraphics 2011. I suggested a change on the Date format, to an ISO 8601 compliant, proposed also [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
This week, <a href="http://code.google.com/soc/">GSOC</a>&#8216;s coding period officially started. This week I created my repositories on <a href="https://gitorious.org/gsoc-2011/gsoc-2011">gitorious.org/gsoc-2011/gsoc-2011</a> and on a personal testing server. Contacted my mentor (Kai-Uwe Behrmann) and we discussed on the ICC JSON serialization format proposed during LibreGraphics 2011. I suggested a change on the Date format, to an ISO 8601 compliant, <a href="http://lists.freedesktop.org/archives/openicc/2010q4/002293.html">proposed also by Lars Borg</a></p>
<p>I have some drafts on the UX and design of the web interface for the repository, though I&#8217;ve been unable to upload them to the repository.<br />
I have also a public calendar on <a href="https://www.google.com/calendar/ical/cojlaeats5jfj655p9squ2oedg%40group.calendar.google.com/public/basic.ics">Google Calendar</a></p>
<p>I will travel next week to El Salvador for EMALCA (Escuela Matematica de America Latina y el Caribe), so my updates might be unreliable. I have informed my mentor already.</p>
<p>Greetings, and please leave your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2011/05/gsoc-week-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Revamped shoebot.net</title>
		<link>http://www.sebastianoliva.com/en/2011/02/revamped-shoebot-net/</link>
		<comments>http://www.sebastianoliva.com/en/2011/02/revamped-shoebot-net/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 13:27:57 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[nodebox]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[shoebot]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=131</guid>
		<description><![CDATA[The redesign of shoebot&#8217;s website is now live, go visit it now! It&#8217;s still missing some content and cleansing up, so feel free to leave your Critiques and Comments.]]></description>
			<content:encoded><![CDATA[<p>The redesign of <a href="http://shoebot.net/">shoebot&#8217;s website</a> is now live, go visit it now! It&#8217;s still missing some content and cleansing up, so feel free to leave your Critiques and Comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2011/02/revamped-shoebot-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>365, too much?</title>
		<link>http://www.sebastianoliva.com/en/2011/02/365-too-much/</link>
		<comments>http://www.sebastianoliva.com/en/2011/02/365-too-much/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 03:29:37 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[365]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/2011/02/365-too-much/</guid>
		<description><![CDATA[2011, originally uploaded by tian2992. 2011-01-01, ready to start a new year, bought a new camera, and eager to try out all the theoretical stuff I kept reading about. So why not do a 365 photo project, It would surely be fun!. Let&#8217;s skip a month, February, 2011. &#8220;OK, a month already went by, and [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: left; padding: 3px;">
<a href="http://www.flickr.com/photos/tian2992/5314090522/" title="photo sharing"><img src="http://farm6.static.flickr.com/5006/5314090522_dbc84e58a7.jpg" style="border: solid 2px #000000;" alt="" /></a><br />
<br />
<span style="font-size: 0.8em; margin-top: 0px;"><a href="http://www.flickr.com/photos/tian2992/5314090522/">2011</a>, originally uploaded by <a href="http://www.flickr.com/people/tian2992/">tian2992</a>.</span>
</div>
<p>
2011-01-01, ready to start a new year, bought a new camera, and eager to try out all the theoretical stuff I kept reading about. So why not do a 365 photo project, It would surely be fun!. </p>
<p>Let&#8217;s skip a month, February, 2011. &#8220;OK, a month already went by, and I took lots of pictures&#8221;, but something feels different, I&#8217;ve taken more than 200 pics, the thing is most of them are just plain rubbish. Turns out my life is more boring than what I originally thought. Taking this into account, it was not a hard decision to make, going on would be forcing myself to do something I would no longer enjoy, depriving myself of the actual experience that is looking at something, examining it, and deciding it&#8217;s actually picture worthy. I understand the whole purpose of a 365 is to shoot like a madman, but going on would mean for me to lose the sense of shooting for the kick of it.<br />
I&#8217;m not saying the spontaneity of a 365 is bad per-se, but dragging along the gear everyday, and then returning home disappointed of being unable to take a decent picture is too tolling on me, It&#8217;s a foolproof way to start hating things.</p>
<p>Nevertheless, I think there is a reasonable middle ground, a 52 week project seems, not only more accessible, but it allows me to choose what to shoot; while keeping the pressure of constantly finding things to look at.</p>
<p>So that&#8217;s it, how I weaseled my way out the 365, and now welcome my 52-week overlords.</p>
<p>Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2011/02/365-too-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Processing Sketch as a Java Component</title>
		<link>http://www.sebastianoliva.com/en/2010/05/using-a-processing-sketch-as-a-java-component/</link>
		<comments>http://www.sebastianoliva.com/en/2010/05/using-a-processing-sketch-as-a-java-component/#comments</comments>
		<pubDate>Sat, 01 May 2010 07:02:33 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=71</guid>
		<description><![CDATA[I really like Processing. Processing is a Visual Programming language, and it is based on Java. It is designed to run either as an Applet, a Standalone App, or as a Java Component; running a Processing Sketch as a Component is the one with less documentation, but probably one of the most interesting and powerful [...]]]></description>
			<content:encoded><![CDATA[<p>I really like <a href="http://processing.org"><em>Processing</em></a>. Processing is a Visual Programming language, and it is based on Java. It is designed to run either as an Applet, a Standalone App, or as a Java Component; running a Processing Sketch as a Component is the one with less documentation, but probably one of the most interesting and powerful applications of it.<br />
This is a small guide on setting up a Processing Sketch as a Java component, ready to use on your Swing or AWT desktop applications.<br />
<a href="http://www.sebastianoliva.com/wp-content/uploads/2010/03/JavaPro.png"><img src="http://www.sebastianoliva.com/wp-content/uploads/2010/03/JavaPro.png" alt="Processing Sketch Running on JFrame " title="JavaPro" width="376" height="357" class="aligncenter size-full wp-image-54" /></a><br />
<span id="more-71"></span><br />
I am assuming you have a basic notion of Object Oriented Programming, and preferably a base on Java, as it is obvious, you will need basic Processing skills.<br />
The first Step is to download Processing, I will not go too deep onto this, but just make sure you get the latest version for your OS.<br />
You will also need the Java Development Kit (JDK) and preferably an IDE (Integrated Development Environment) to help you along the way, two popular ones are <a href="http://www.netbeans.org/">NetBeans</a> and <a href="http://www.eclipse.org">Eclipse</a>.</p>
<p>After your environment is all set up, you will need a to create a new Project, just follow the instructions for your IDE.</p>
<p>The second step is to add to your project the library <code>core.jar</code>, which contains the basic Processing functionality. This library is found on the lib/ folder of the main Processing folder. For Linux this is located wherever you installed Processing, on Windows it is on Program Files/Processing, and in Mac it is located inside Processing.app, just Select the app, select File Menu > Show Package Contents and then open Resources folder.</p>
<p>Once you&#8217;ve added the library to your project, it&#8217;s real easy to start using it. PApplet is the class which Processing Applets extend, and it holds 2 very important methods, which you must implement to make a working Processing Sketch, this ones are <code>void setup()</code> and <code>void draw()</code>.<br />
You might note that this ones are quite similar to the ones on an average interactive Processing sketch, and you are totally right, in fact this ones are the exact equivalent as Processing converts your code to pure Java.</p>
<p>A basic and important thing to keep in mind is that PApplet extends from <code>java.awt.Component</code> so to your AWT of Swing based app, it will be no different from any other component, and it will be as easy to add to your JFrame or JPanel.</p>
<p>Let&#8217;s begin with a simple example</p>
<h3>Simple Processing</h3>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span>, <span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    fill<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipseMode<span style="color: #009900;">&#40;</span>CENTER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipse<span style="color: #009900;">&#40;</span>mouseX,mouseY,<span style="color: #cc66cc;">40</span>,<span style="color: #cc66cc;">40</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now to add it to our application, we must create a class that extends PApplet, a JFrame to contain it and a Main class to launch it, your app then should look similar to this:</p>
<h3>Java Source Code</h3>
<h4>Main.java</h4>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">processJava</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">new</span> DisplayFrame<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setVisible</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>DisplayFrame.java</h4>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">processJava</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DisplayFrame <span style="color: #000000; font-weight: bold;">extends</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JFrame</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> DisplayFrame<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">setSize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">600</span>, <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The window Dimensions</span>
        setDefaultCloseOperation<span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">WindowConstants</span>.<span style="color: #006633;">EXIT_ON_CLOSE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JPanel</span> panel <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        panel.<span style="color: #006633;">setBounds</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span>, <span style="color: #cc66cc;">20</span>, <span style="color: #cc66cc;">600</span>, <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        processing.<span style="color: #006633;">core</span>.<span style="color: #006633;">PApplet</span> sketch <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CircleSketch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        panel.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>sketch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>panel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        sketch.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//this is the function used to start the execution of the sketch</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">setVisible</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>CircleSketch.java</h4>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">processJava</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">processing.core.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CircleSketch <span style="color: #000000; font-weight: bold;">extends</span> PApplet <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span>, <span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    fill<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipseMode<span style="color: #009900;">&#40;</span>CENTER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipse<span style="color: #009900;">&#40;</span>mouseX,mouseY,<span style="color: #cc66cc;">40</span>,<span style="color: #cc66cc;">40</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It&#8217;s done, now just press run and enjoy.<br />
You now have no excuse to keep your processing sketches apart from your desktop applications.</p>
<p><strong>EDIT:</strong> Fixed a small typo on a class&#8217; name </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2010/05/using-a-processing-sketch-as-a-java-component/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Last.fm API visualizations</title>
		<link>http://www.sebastianoliva.com/en/2010/04/last-fm-api-visualizations/</link>
		<comments>http://www.sebastianoliva.com/en/2010/04/last-fm-api-visualizations/#comments</comments>
		<pubDate>Sat, 01 May 2010 06:35:30 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[nodebox]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[shoebot]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=62</guid>
		<description><![CDATA[A small experiment with Nodebox/Shoebot, and as an excuse to use the Last.fm API, beat.py is a visualisation of related artists, provided by data from Last.fm It features a simple use of several simple commands for Nodebox and as a small demo for pylast The code is available on github at http://github.com/tian2992/botboxvis]]></description>
			<content:encoded><![CDATA[<p>A small experiment with <a href="http://nodebox.net/">Nodebox</a>/<a href="http://shoebot.net/">Shoebot</a>, and as an excuse to use the <a href="http://www.last.fm/api">Last.fm API</a>, beat.py is a visualisation of related artists, provided by data from Last.fm </p>
<p><a href="http://www.sebastianoliva.com/wp-content/uploads/2010/04/beat2.png"><img src="http://www.sebastianoliva.com/wp-content/uploads/2010/04/beat2.png" alt="" title="BeatlesRainbow" width="50%" class="aligncenter size-medium wp-image-63" /></a></p>
<p>It features a simple use of several simple commands for Nodebox and as a small demo for <a href="http://code.google.com/p/pylast/">pylast</a><br />
The code is available on github at <a href="http://github.com/tian2992/botboxvis">http://github.com/tian2992/botboxvis</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2010/04/last-fm-api-visualizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

