<?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>Tzikis</title>
	<atom:link href="http://blog.tzikis.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.tzikis.com</link>
	<description>Ramble Ramble Ramble</description>
	<lastBuildDate>Fri, 22 Jun 2012 19:26:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Adding Twitter and Facebook widgets in your site</title>
		<link>http://blog.tzikis.com/?p=446</link>
		<comments>http://blog.tzikis.com/?p=446#comments</comments>
		<pubDate>Fri, 22 Jun 2012 19:26:59 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=446</guid>
		<description><![CDATA[It&#8217;s been some time since I last updated my blog, what with all the exams and me working on a dozen projects simultaneously. However, I&#8217;d like to take the time to make a small blog post on how to add twitter and facebook buttons on your blog/site. Twitter is pretty straightforward. You can add a [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been some time since I last updated my blog, what with all the exams and me working on a dozen projects simultaneously. However, I&#8217;d like to take the time to make a small blog post on how to add twitter and facebook buttons on your blog/site.</p>
<p>Twitter is pretty straightforward. You can add a follow button on your page by just adding this little snippet of code.</p>
<p><code>&lt;iframe style="width: 300px; height: 20px;" src="//platform.twitter.com/widgets/follow_button.html?screen_name=twitterapi" frameborder="0" scrolling="no" width="320" height="240"&gt;&lt;/iframe&gt;</code></p>
<p>Now, just replace twitterapi with your account and you&#8217;re done :)</p>
<p>As far as facebook goes, you will probably want to add a &#8216;Like&#8217; button in your website. Facebook provides a page which allows you to design it to fit your needs, which you can find <a href="https://developers.facebook.com/docs/reference/plugins/like/">here</a>. You can also get some sample code for a plain Like button bellow.</p>
<p><code>&lt;iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fcodebender.cc&amp;amp;send=false&amp;amp;layout=button_count&amp;amp;width=250&amp;amp;show_faces=false&amp;amp;action=like&amp;amp;colorscheme=light&amp;amp;font&amp;amp;height=21&amp;amp;appId=276306429134783" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:21px;" allowTransparency="true"&gt;&lt;/iframe&gt;</code></p>
<p>You can find more info on the Twitter and Facebook APIs in their respective API Documentation, <a href="https://dev.twitter.com/docs">here</a> and <a href="https://developers.facebook.com/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=446</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP web development and Symfony 2</title>
		<link>http://blog.tzikis.com/?p=478</link>
		<comments>http://blog.tzikis.com/?p=478#comments</comments>
		<pubDate>Thu, 07 Jun 2012 12:00:58 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=478</guid>
		<description><![CDATA[Good news everyone! Well, everyone who likes PHP and looks for ways to improve his productivity and decrease his developing time, along with his anxiety, coding errors and security vulnerabilities anyway :) Today I&#8217;d like to talk about Symfony 2. Symfony is a PHP web framework, much like Django (Python) and Rails (Ruby), which aims [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=1D1cap6yETA" target="_blank">Good news everyone</a>! Well, everyone who likes PHP and looks for ways to improve his productivity and decrease his developing time, along with his anxiety, coding errors and security vulnerabilities anyway :)</p>
<p>Today I&#8217;d like to talk about Symfony 2. Symfony is a PHP web framework, much like Django (Python) and Rails (Ruby), which aims to simplify web development and improve productivity. This is probably why Drupal has announce that they are going to use some parts of Symfony for Drupal 8. Symfony comes in a bunch of independent software libraries, or Bundles as they like to call them, which allows developers and organizations like Drupal to use only the parts they need.</p>
<p>So, as I said, symfony consists of a number of Bundles. When you create a new website, you basically add your own custom Bundle in the default symfony installation. After running the usual installer/configuration, you are called to add routes in a YAML file, which basically tell symfony which function to call for which type of url. One example is:</p>
<pre>AceEditorBundle_editor:
    pattern:  /edit/{project_name}
    defaults: { _controller: AceEditorBundle:Default:edit}</pre>
<p>This tells Symfony to create a new route called AceEditorBundle_editor which matches urls with a pattern of you-website.com/edit/something, with something becoming the value of your $project_name variable, which is an input variable for your editAction() (don&#8217;t be scared, Action is appended on all Symfony controller method names) method.</p>
<p>So basically, all you have to do now is go to Ace/EditorBundle/Default/DefaultController.php, and add the following method:</p>
<pre>public function editAction($project_name)
{
  //do some stuff
  //return new Response("hello, this is $project_name");
}</pre>
<p>Of course, you can (and will) do much more advanced stuff than this, but I wouldn&#8217;t like to get too technical. The Symfony documentation, which can be found on <a href="http://www.symfony.com" target="_blank">their homepage</a>, is very useful and extensive. One last thing I&#8217;d like to emphasize is that Symfony uses Doctrine for ORM (Object Relational Mapping). Like the name suggests, ORM maps your Objects to DB data. This basically allows you to write very efficient code for fetching and preserving data on a Database. Let&#8217;s say you want to get the id of  the currently logged in user, based on his unique username. Easily done. All you need is this snippet of code:<br />
<code>$name = $this-&gt;container-&gt;get('security.context')-&gt;getToken()-&gt;getUser()-&gt;getUsername(); //this returns our username<br />
$user = $this-&gt;getDoctrine()-&gt;getRepository('AceExperimentalUserBundle:ExperimentalUser')-&gt;findOneByUsername($name);<br />
$user_id = $user-&gt;getID();</code><br />
 What happened here? Well, Doctrine mapped our User class to DB data, and created lookup methods as well as getter and setter methods for each of the User&#8217;s class variables. After getting the session data from Symfony (in just one line), we just get the DB repository for the User&#8217;s class (set by us in our configuration), and then we search for a User with username == $name. After fetching the object from the DB, we call the getID() method, which was automatically generated by Doctrine, to get the User&#8217;s ID. Easy as pie. Just imagine how many lines of code you would need with plain PHP.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=478</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking fluctuating variables using thresholds, the smart way.</title>
		<link>http://blog.tzikis.com/?p=427</link>
		<comments>http://blog.tzikis.com/?p=427#comments</comments>
		<pubDate>Sat, 02 Jun 2012 21:46:07 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[FOSS]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=427</guid>
		<description><![CDATA[So, here&#8217;s the drill. In CS, we frequently need to check a variable compared to a predefined threshold. Typical uses include checking the light level in a room and controlling the lights when it exceeds or goes below a certain threshold (the same can be done with temperature, essentially like a thermostat), checking the negative [...]]]></description>
				<content:encoded><![CDATA[<p>So, here&#8217;s the drill. In CS, we frequently need to check a variable compared to a predefined threshold.</p>
<p>Typical uses include checking the light level in a room and controlling the lights when it exceeds or goes below a certain threshold (the same can be done with temperature, essentially like a thermostat), checking the negative votes (vote-downs) for a post and removing it if it exceeds a threshold, e.t.c.</p>
<p>That&#8217;s usually easy to do programatically:</p>
<p><code>if(downvotes &amp;gt; VOTES_THRESHOLD)<br />
{<br />
remove_vote();<br />
}</code></p>
<p>However, when you work with fluctuating variables, it&#8217;s harder to do a proper check. This is a common problem with sensor values, because they tend to fluctuate a lot. Consider the following example:</p>
<p>We use a light sensor whose values range from 0 to 255. Due to the nature of the sensor, the light value might fluctuate by +/-10 every time we read its value. We cannot simply use a threshold and check wether our input exceeds the threshold, because our value may fluctuate at that point. For instance, if we set our threshold to 120, and our input is at 115 (therefore below the threshold), due to its fluctuation we could get an input of 115-135. When we read the sensor, sometimes our value may be incorrectly considered by our software as above the threshold. So what do we do? The simple answer is that we can move the threshold higher. However, that has two disadvantages:</p>
<ol>
<li>Moving the threshold is sometimes not possible, because then we could miss some otherwise valid values.</li>
<li>That&#8217;s easily said and done when we have a big window between our thresholds, but what if our we have to divide a range of 0-50 in 3 sections, and our value fluctuates +/- 10 points? Moving the threshold is not as easy.</li>
</ol>
<p>Another thing we can do is gather multiple values and then calculate their average, or the value that occurs most often. This helps minimize or completely remove the effects of spikes in our data, but it results in more delay, since we have to get a number of measurements before making a decision. However, it is an easy and well-know technique when fast response is not critical, and it can be used in addition to the technique i will show bellow, for even more accuracy.</p>
<p>So, what do I do when i have fluctuating variables with threshold that can be too close to each other? Well, i set a number of fixed values instead of thresholds (you can think of them as thresholds, but I&#8217;m not sure that&#8217;s the right term), and i measure the distance of my input in regards to each of my fixed points. The point closer to my value wins. Let&#8217;s take a look at the code:<br />
<code>uint8_t getNumOfRels(void)<br />
{<br />
int value = analogRead(relayCheckPin);<br />
int relNum = 0;<br />
int distance[5];<br />
int thresholds[] = {0, 342, 512, 614, 683, 732   };<br />
for(int i = 0; i&amp;lt; 6; i++)<br />
  thresholds[i] &amp;lt; value? distance[i] = value - thresholds[i] : distance[i] = thresholds[i] - value;</code></p>
<p><code>for(int i = 1; i&amp;lt; 6; i++)<br />
  if(distance[i] &amp;lt; distance[i-1]) relNum = i;<br />
</code></p>
<p><code>return relNum;<br />
}</code></p>
<p>There are better ways to do it, but I&#8217;m picking this way strictly for educational purposes. This is Arduino code (taken from a sketch were I use an analog value to check how many relays are connected to my Arduino), so it&#8217;s really easy to understand. First of all, we use analogRead() to get an analog value, which ranges from 0 to 1023, but it can fluctuate a bit and therein lies our problem. We set 5 points of reference. Those are our theoretical valid points, and we calculate the distance of our analog value to each one of them. Then we compare the distances and we find which is the lowest one. This is our valid point. Our value could be off by a wide margin for a number of reasons, but we will always find the closest point of reference. To be certain of my results, I repeat this process 3-5 times and get the most prominent value. I&#8217;m proud to say this  method has never failed me.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=427</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PMH: State of the überness</title>
		<link>http://blog.tzikis.com/?p=449</link>
		<comments>http://blog.tzikis.com/?p=449#comments</comments>
		<pubDate>Thu, 31 May 2012 18:51:49 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[FOSS]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=449</guid>
		<description><![CDATA[For those of you who know me, you already know I&#8217;m really psyched about the Arduino platform. One of the things I&#8217;m also psyched is home automation. Not the crapy, oldschool home automation we all know and disregard, but the cool, shiny home automation. The kind of thing that you see in Star Trek and [...]]]></description>
				<content:encoded><![CDATA[<p>For those of you who know me, you already know I&#8217;m really psyched about the Arduino platform. One of the things I&#8217;m also psyched is home automation. Not the crapy, oldschool home automation we all know and disregard, but the cool, shiny home automation. The kind of thing that you see in Star Trek and go &#8220;ooooooooooooooooooh!&#8221;. You know, like &#8220;Computer, adjust my temperature to 23.56 degrees, unless it&#8217;s Sunday with a full moon. Oh, and bring me a burger. And a beer.&#8221;, followed by &#8220;*bleep*OK*bleep*&#8221; and a tasty burger-beverage combination.</p>
<p>The main system I&#8217;m working on, mainly as part of my daily job, but also as part of my Thesis, and as a member of <a href="http://www.p-space.gr" target="_blank">P-Space</a>, our local hackerspace, is PMH/Überdust. PMH, as in, Pimp My House, is a home automation system that uses the latest technology in wireless sensor networks to control anything you can think of. Any actuator or sensor can be linked with PMH, but we are specifically using Arduino wireless nodes, equiped XBee modules for wireless communication.  Everything is open source (of course), and I&#8217;ve even presented the system to this year&#8217;s FOSSCOMM, and even FOSDEM!!! Needless to say, presenting at FOSDEM is one of the highlights of my work so far. Everyone was very nice, interested in the system, and I also got a lot of suggestions.</p>
<p>I&#8217;d like to say a few things about the state of the system. Recently, we installed in on P-Space, and it&#8217;s been great so far. In the beginning, everyone would play with the lights and it was a lot of fun, although some cursing did occur :P After Vasilis designed a drupal website to see the status of the space and control the lights, people started using the system from outside the space as well, to check on who is in and what&#8217;s going on. Btw, you <strong>did</strong> see our website, right? Here&#8217;s a screenshot:</p>
<p><a href="http://blog.tzikis.com/wp-content/uploads/2012/05/Screen-Shot-2012-05-27-at-10.12.02-PM.png" rel="lightbox[449]"><img class="alignnone size-medium wp-image-450" title="Screen Shot 2012-05-27 at 10.12.02 PM" src="http://blog.tzikis.com/wp-content/uploads/2012/05/Screen-Shot-2012-05-27-at-10.12.02-PM-300x220.png" alt="" width="300" height="220" /></a></p>
<p>I hope to extend the system even more, and add more sensors in the near future, and you can be sure that I&#8217;ll keep you up to date. If you&#8217;d like to take a look at the code, you can check our <a href="https://github.com/uberdust" target="_blank">GitHub page.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=449</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clang + Arduino = ♥</title>
		<link>http://blog.tzikis.com/?p=454</link>
		<comments>http://blog.tzikis.com/?p=454#comments</comments>
		<pubDate>Sun, 27 May 2012 20:53:05 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[FOSS]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=454</guid>
		<description><![CDATA[So&#8230; Clang. Anyone who codes in C, C++ or Obj-C should know it. If you don&#8217;t, read about it. Seriously, stop reading this post and google it. Check my video to see a quick overview of its features. Now you should know that Clang (+LLVM) is awesome. It&#8217;s steadily shaking the still waters of C [...]]]></description>
				<content:encoded><![CDATA[<p>So&#8230; Clang.</p>
<p>Anyone who codes in C, C++ or Obj-C should know it. If you don&#8217;t, read about it. Seriously, stop reading this post and google it. Check <a href="http://www.youtube.com/watch?v=pM9j1H4hWhw" target="_blank">my video</a> to see a quick overview of its features.</p>
<p>Now you should know that Clang (+LLVM) is awesome. It&#8217;s steadily shaking the still waters of C compilers, and in my opinion, gradually replacing GCC as the de-facto C compiler. I&#8217;d like to talk a bit about Clang&#8217;s syntax analysis. Let&#8217;s assume this sample code:</p>
<pre class="prettyprint">#include&lt;stdio.h&gt;

int main(void)
{
  int myVar = 5
  int myVar2 = myVar;
  int hello1 = 4;
  printf("hello is %d", hello);
  if(myVar = myVar2)
    printf("they are equal");
}</pre>
<p>There are quite a few errors in this code. First of all, there&#8217;s a missing &#8216;;&#8217; in the 3rd line. The variable we are passing in the first printf doesn&#8217;t exist, and we are using an &#8216;=&#8217; operator instead of a &#8216;==&#8217; inside the if statement. The last one is not a syntax error, rather a logical one, but we will see how Clang helps us find those as well.</p>
<p>Now, let&#8217;s see what GCC has to say about the above code. This is the output we get when we try to compile it.</p>
<p><code>test.c: In function ‘main’:<br />
test.c:6: error: expected ‘,’ or ‘;’ before ‘int’<br />
test.c:8: error: ‘hello’ undeclared (first use in this function)<br />
test.c:8: error: (Each undeclared identifier is reported only once<br />
test.c:8: error: for each function it appears in.)<br />
test.c:9: error: ‘myVar2’ undeclared (first use in this function)</code></p>
<p>GCC did find our errors, but it&#8217;s not giving us a lot of info on how to fix them, or even the exact line in the first case. Let&#8217;s see what Clang has to say about it:</p>
<pre>test.c:5:15: error: expected ';' at end of declaration
        int myVar = 5
                     ^
                     ;
test.c:8:24: error: use of undeclared identifier 'hello'; did you mean 'hello1'?
        printf("hello is %d", hello);
                              ^~~~~
                              hello1
test.c:7:6: note: 'hello1' declared here
        int hello1 = 4;
            ^
test.c:9:11: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if(myVar = myVar2)
           ~~~~~~^~~~~~~~
test.c:9:11: note: place parentheses around the assignment to silence this warning
        if(myVar = myVar2)
                 ^
           (             )
test.c:9:11: note: use '==' to turn this assignment into an equality comparison
        if(myVar = myVar2)
                 ^
                 ==
1 warning and 2 errors generated.</pre>
<p>Much more verbose. First of all, it&#8217;s telling us exactly where to add the missing semicolon. It is also showing us exactly which variable is undeclared, and it has recognized that we probably meant &#8216;hello1&#8242; instead of &#8216;hello&#8217;. Last but not least, it&#8217;s warning us that we probably want to do a logical comparison instead of assignment in the if statement, and it suggests fixing it, or add an extra set of parentheses if we really do want an assignment, to let Clang know about it and leave us alone. The real output is also beautifully colored, but I can&#8217;t show that here :)</p>
<p>These are only some of Clang&#8217;s awesome features, but I&#8217;ll focus on this for now and go back to the Arduino. We all know that the Arduino IDE is not the best IDE in the world, actually far from it. I&#8217;ll show you how you can use Clang&#8217;s syntax analyzer to get all this awesome information about your errors. This is only a step in the right direction. I intend to use Clang to compile the Arduino code itself. Hopefully, I will make it, although the state of LLVM&#8217;s AVR backend is unknown to me.</p>
<p>So, first things first. In order to use Clang for your Arduino sketches, you must first convert them to the equivalent .cpp project. There are a lot of ways to do that, but I suggest using my python script (modified from a SCons file i found in <a href="http://&lt;code&gt;www.webweavert&lt;/code&gt;ech.com/ovidiu/weblog/archives/000482.html" target="_blank">this blog post</a>). You can download my script <a href="https://www.dropbox.com/s/8ehm8tmwzrs19ne/preprocess.py" target="_blank">here</a>. You invoke it like this:<br />
<code>./preprocess.py your_filename.ino</code></p>
<p>This generates the intermediate C++ file that the Arduno IDE then normally sends to avr-gcc for compilation. We will run this file in Clang to check for errors.</p>
<p><code>clang -fsyntax-only -Os -I/path/to/your/includes/directory -I/path/to/your/variants/directory -I/path/to/your/arduino/core/files/directory -D__AVR_ATmega328P__ -DARDUINO=100 -DF_CPU=16000000L -Wno-unknown-attributes -Wno-attributes filename.cpp</code></p>
<p>In my case (OS X), this is:<br />
<code>clang -fsyntax-only -Os -I/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/avr/include -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -D__AVR_ATmega328P__ -DARDUINO=100 -DF_CPU=16000000L -Wno-unknown-attributes -Wno-attributes filename.cpp</code></p>
<p>Which results in the following output:</p>
<pre>
tempfiles/OzZnnTkbaY:4:19: error: expected ';' at end of declaration
        int helloWorld= 6
                         ^
                         ;
1 error generated.
</pre>
<p>Ah, There&#8217;s my error! :P</p>
<p>Now this may be a long command, but it&#8217;s well worth it. I&#8217;d like to see Clang being used in the official Arduino IDE, but I&#8217;m also working on other ways to make it easy to use. Just stay tuned ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=454</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>FOSSCOMM 2012</title>
		<link>http://blog.tzikis.com/?p=444</link>
		<comments>http://blog.tzikis.com/?p=444#comments</comments>
		<pubDate>Sun, 27 May 2012 18:51:40 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[FOSS]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=444</guid>
		<description><![CDATA[It&#8217;s been a long time since i last updated my blog, and I hope it won&#8217;t take me so long until the next time. I&#8217;d like to start blogging again by mentioning the last open source conference I attended, FOSSCOMM 2012, which took place at my hometown, Serres, Greece. For those unaware, FOSSCOMM is the [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been a long time since i last updated my blog, and I hope it won&#8217;t take me so long until the next time.</p>
<p>I&#8217;d like to start blogging again by mentioning the last open source conference I attended, FOSSCOMM 2012, which took place at my hometown, Serres, Greece. For those unaware, FOSSCOMM is the biggest open source conference in Greece, where people and communities from all over Greece meet annually to exchange ideas and news.</p>
<p>First of all, the conference was very nice, and i congratulate this year&#8217;s organizing committee. They did a great job, and the few minor issues that came up were of no importance. Having organized last year&#8217;s FOSSCOMM, I know how easy it is to miss the small details, and that, no matter what you do, there will always be problems and minor issues.</p>
<p>I was also pleased to find that my presentations (regarding Symfony, which I&#8217;d like to address in another blog post, PMH, and Growl) were well-received, besides the various technical problems that arose.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=444</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We&#8217;re on Hack a Day!</title>
		<link>http://blog.tzikis.com/?p=437</link>
		<comments>http://blog.tzikis.com/?p=437#comments</comments>
		<pubDate>Fri, 11 Nov 2011 14:21:44 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[FOSS]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=437</guid>
		<description><![CDATA[Where by &#8216;we&#8217;, I mean P-Space, the local hackerspace in Patras. Recently, I designed an (open source, ofc) system to control our door for entry, using RFID tags an a remote controller. Everyone liked it, so we installed it and I set off to document it on GitHub. We aptly named it Jarvis, after Edwin [...]]]></description>
				<content:encoded><![CDATA[<p>Where by &#8216;we&#8217;, I mean <a href="http://p-space.gr">P-Space</a>, the local hackerspace in Patras. Recently, I designed an (open source, ofc) system to control our door for entry, using RFID tags an a remote controller. Everyone liked it, so we installed it and I set off to document it on GitHub. We aptly named it Jarvis, after <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Edwin_Jarvis">Edwin Jarvis</a>.</p>
<p>To put it simply, Jarvis consists of a remote control that tells the computer to open the door when pressed, the door controller that reads the RFID tags and send the information to the computer, and the computer that validates the RFID information, gets the remote&#8217;s messages, and sends a special &#8216;open the door&#8217; message to the door controller when the remote button is pressed, or a valid RFID card is read. We even have the five last events on the <a href="http://p-space.gr">website</a>, so you can tell if any of your friends are in the hackerspace at the moment.</p>
<p>Yesterday, <a href="http://hackaday.com/2011/11/10/jarvis-opens-the-door-at-p-space/">Jarvis was featured on Hack a Day</a>, the most popular site for hardware and software hacks, MAKE/DIY projects. Suffice to say, we were all stunned! We even got some ideas on how to improve the system from the comments.</p>
<p>If you&#8217;d like to know more on how the system works, read the hackaday.com post and check out the <a href="https://github.com/P-Space/Jarvis/wiki/About-Jarvis">project&#8217;s wiki</a>. You can also</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=437</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diffusing LEDs</title>
		<link>http://blog.tzikis.com/?p=400</link>
		<comments>http://blog.tzikis.com/?p=400#comments</comments>
		<pubDate>Thu, 29 Sep 2011 22:31:27 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=400</guid>
		<description><![CDATA[I&#8217;m writing this blog post while sitting at our local hackerspace at 1.15am and working on a new Secret Project™. I&#8217;m using a semi-transparent glass and trying to light it up with LEDs from the sides. Anyone who has used high power LEDs to light a surface could tell you, these things need to be [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m writing this blog post while sitting at our local hackerspace at 1.15am and working on a new Secret Project™. I&#8217;m using a semi-transparent glass and trying to light it up with LEDs from the sides.</p>
<p>Anyone who has used high power LEDs to light a surface could tell you, these things need to be diffused, because the light isn&#8217;t distributed evenly to the surface and it looks like crap.</p>
<p>So I was sitting and trying to find something to diffuse the LEDs with, and then it hit me (ouch)! Rolling paper for cigarettes*! After some quick googling i found out that the thinnest one is the Rizla Silver brand, so I bought some from the 24/7 kiosk** down the corner, and voila! Awesome! You can see the difference below, but the photos really do it no justice. (coming soon, can&#8217;t upload the photos :P)</p>
<p><a href="http://blog.tzikis.com/wp-content/uploads/2011/09/photo-2.jpg" rel="lightbox[400]"><img class="alignnone size-medium wp-image-424" title="photo 2" src="http://blog.tzikis.com/wp-content/uploads/2011/09/photo-2-300x168.jpg" alt="" width="300" height="168" /></a><a href="http://blog.tzikis.com/wp-content/uploads/2011/09/photo-1.jpg" rel="lightbox[400]"><img class="alignnone size-medium wp-image-423" title="photo 1" src="http://blog.tzikis.com/wp-content/uploads/2011/09/photo-1-300x166.jpg" alt="" width="300" height="166" /></a></p>
<blockquote><p>*Yes, you can buy rice paper at bookstores and get a much better price. But can you do that at 1.15am? Didn&#8217;t think so.<br />
**περίπτερο</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=400</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guess who&#8217;s a Growl developer</title>
		<link>http://blog.tzikis.com/?p=403</link>
		<comments>http://blog.tzikis.com/?p=403#comments</comments>
		<pubDate>Sat, 17 Sep 2011 17:53:53 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[FOSS]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=403</guid>
		<description><![CDATA[If you&#8217;re a mac user, you might have heard about Growl, perhaps you&#8217;re even using it. Those of you who know me might have heard me rant about how its greatness. It&#8217;s simply such a well thought-out, designed and developed software. For those of you who have never heard of it, Growl is a notification [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re a mac user, you might have heard about Growl, perhaps you&#8217;re even using it. Those of you who know me might have heard me rant about how its greatness. It&#8217;s simply such a well thought-out, designed and developed software.</p>
<p>For those of you who have never heard of it, Growl is a notification system and framework for OS X. It&#8217;s highly configurable, yet easy to do so. The user can choose the notification style, the position of notification on the screen, set different notification styles and behavior for each program, etc. It&#8217;s even possible to have the notification emailed to you, or spoken out. It&#8217;s also the first notification system AFAIK, started back in 2004, which I believe was a really innovative idea at the time. Oh, and did i mention it&#8217;s open source too? And it&#8217;s no secret I love open source projects</p>
<p>One of the things I love most is how easy it is to use the framework as a developer. When I got accepted for GSoC 2010 to improve Pallet (a<a href="http://www.macports.org/"> MacPorts</a> GUI which is still in beta), adding Growl notification was amongst the first things i did, and it was so easy, even with my worthless Obj-C knowledge at that time, that I couldn&#8217;t believe it. When it came to developing <a href="http://blog.tzikis.com/?page_id=251">Capster</a>, it took me less than half an hour for the notification part.</p>
<p>Those of you who know Growl might have missed its companion app, Hardware Growler. hwGrowler (as we call it for short) is part of the Growl Extras, which include an iTunes Growl plugin, a command-line growl notification tool, a mail plugin (which is awesome and very, very useful*),  and of course, Harware Growler. It&#8217;s designed to run at the background and send you notifications for things like pluging a usb/firewire/bluetooth device, mounting a volume, connecting to a wifi network and networking in general (i.e. IP changes, ethernet cables geting unpluged, etc), power cord changes (on power, charging, on battery, on UPS) and device syncing using iSync.</p>
<p>Here&#8217;s what it looks like when you plug in the charging cable:</p>
<p><a href="http://blog.tzikis.com/wp-content/uploads/2011/09/hwgrowler-demo.png" rel="lightbox[403]"><img class="alignnone size-medium wp-image-407" title="hwgrowler demo" src="http://blog.tzikis.com/wp-content/uploads/2011/09/hwgrowler-demo-300x187.png" alt="" width="300" height="187" /></a></p>
<blockquote><p>A plain Hardware Growler notification.</p></blockquote>
<p>The reason I joined the Growl team was to improve Hardware Growler on a few places that bothered me. First of all, Hardware Growler had no reason for a Dock icon. It&#8217;s supposed to run on the background be forgotten. Therefore, I moved the icon to the status bar. I also removed the preference panel, since there was only one preference anyway (for now ;), and moved that preference to the statusbar icon menu. I&#8217;m also adding a second preference (which is disabled right now).</p>
<p><a href="http://blog.tzikis.com/wp-content/uploads/2011/09/hwgrowler-menu.png" rel="lightbox[403]"><img class="alignnone size-medium wp-image-408" title="hwgrowler menu" src="http://blog.tzikis.com/wp-content/uploads/2011/09/hwgrowler-menu-300x101.png" alt="" width="300" height="101" /></a></p>
<blockquote><p>New Hardware Growler menu on the status bar.</p></blockquote>
<p>Last, but not least, came notification coalescing. What is coalescing you say? The idea is simple enough. If a device disconnects and connects fast, the second notification will replace the first one on the screen. That way, instead of having both notifications shown at the same time, you&#8217;ll see the first notification, and when the second notification  comes up, it replaces the first one. Imaging plugging and unplugging the power cord. Instead of this:</p>
<p><a href="http://blog.tzikis.com/wp-content/uploads/2011/09/hwgrowler-old.png" rel="lightbox[403]"><img class="alignnone size-medium wp-image-410" title="hwgrowler old" src="http://blog.tzikis.com/wp-content/uploads/2011/09/hwgrowler-old-300x187.png" alt="" width="300" height="187" /></a></p>
<blockquote><p>Old Hardware Growler. Notice the icon on the Dock and the two notifications.</p></blockquote>
<p>You get this:</p>
<p><a href="http://blog.tzikis.com/wp-content/uploads/2011/09/hwgrowler-new.png" rel="lightbox[403]"><img class="alignnone size-medium wp-image-409" title="hwgrowler new" src="http://blog.tzikis.com/wp-content/uploads/2011/09/hwgrowler-new-300x187.png" alt="" width="300" height="187" /></a></p>
<blockquote><p>New Hardware Growler. Notice the status bar icon and the one notification.</p></blockquote>
<p>There are also many exciting features we&#8217;re considering. Who knows, we may add so many features we&#8217;ll have to bring back the preference panel ;). I hope you&#8217;re as excited about this as I am (though I doubt it).</p>
<p>*The Growl team has recently stopped developping the GrowlMail plugin for Apple&#8217;s Mail.app, so it doesn&#8217;t come included in the extras anymore, but it&#8217;s been picked up as a personal project from Rudy Richter, who just so happens to be the Growl lead developer. You can download the last version <a href="https://code.google.com/p/growlmail/downloads/list">here</a>.</p>
<p>Update: I was informed by Rudy that the iTunes Plugin has been discontinued as a Growl project and picked up by him as well. You can get the source code on <a href="https://github.com/rudyrichter/growltunesplugin">GitHub</a>. There an iTunes Growl app though, called GrowlTunes, which is part of the Extras and essentially does the same thing. Check it out, t&#8217;s  pretty neat!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=403</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Pro Mini shields!</title>
		<link>http://blog.tzikis.com/?p=388</link>
		<comments>http://blog.tzikis.com/?p=388#comments</comments>
		<pubDate>Fri, 02 Sep 2011 15:01:16 +0000</pubDate>
		<dc:creator>Georgitzikis Vasilis</dc:creator>
				<category><![CDATA[FOSS]]></category>

		<guid isPermaLink="false">http://blog.tzikis.com/?p=388</guid>
		<description><![CDATA[I&#8217;m proud to introduce my latest Arduino-related project. For the past year, I&#8217;ve been using the Arduino Pro Mini from Sparkfun extensively, and I&#8217;ve come to love it for its small size and awesome XBee connectivity. Since I&#8217;m frequently using relays, I&#8217;ve been making lots of relay boards, and every time I needed to add [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m proud to introduce my latest Arduino-related project. For the past year, I&#8217;ve been using the <a href="www.sparkfun.com/products/9218" target="_blank">Arduino Pro Mini</a> from Sparkfun extensively, and I&#8217;ve come to love it for its small size and awesome XBee connectivity. Since I&#8217;m frequently using relays, I&#8217;ve been making lots of relay boards, and every time I needed to add or remov a relay to a project, it&#8217;s been kind of a pain in the ass, so I devised a smart solution.</p>
<p>First of all, I need to make a small  introduction. Using the <a href="https://www.sparkfun.com/products/9280" target="_blank">Stackable Headers</a> from Sparkfun, I made it possible to add and stack shields to an Arduino Pro Mini, just like you would on a normal Arduino Uno. Here is a picture of an Arduino Pro Mini with the stackable headers:</p>
<p><a href="https://farm7.static.flickr.com/6074/6105569505_550c5e3391_z_d.jpg" rel="lightbox[388]"><img class="alignnone" title="Arduino Pro Mini" src="https://farm7.static.flickr.com/6074/6105569505_550c5e3391_z_d.jpg" alt="" width="384" /></a></p>
<blockquote><p>Arduino Pro Mini with stackable headers</p></blockquote>
<p>Using these headers, we can add shields/boards both on the top and below the Arduino Pro Mini board. It&#8217;s also much easier to program the Arduino Pro Mini using an <a href="www.sparkfun.com/products/10008">FTDI Basic Breakout</a> board, and you can easily add an XBee module on the Arduino with an XBee Explorer Regulated board if you want to (I do. all the time). Here&#8217;s another pic:</p>
<p><a href="https://farm7.static.flickr.com/6073/6105589579_c565fc00a0_z_d.jpg" rel="lightbox[388]"><img class="alignnone" title="Arduino Pro Mini with XBee" src="https://farm7.static.flickr.com/6073/6105589579_c565fc00a0_z_d.jpg" alt="" width="384" height="287" /></a></p>
<blockquote><p>Arduino Pro Mini with XBee module</p></blockquote>
<p>And now on to the good part. First of all, I made a relay shield because as I  said, I use relays a lot! The shield includes all the circuitry needed to control a relay from one of the Arduino&#8217;s digital output pins. All the necessary headers to make it stackable are there, as well as the necessary components,  relay and 2 screw terminals. I wanted to be able to select which digital I/O pin the relay would be connected to, so I&#8217;ve added a header to make it easy to connect the relay control (SEL) pin to any of the Arduino digital 2-9 pins using nothing more than a cable. I&#8217;ve also added a <a href="https://www.sparkfun.com/products/8095" target="_blank">0.1&#8243; standard 2-pin Molex connector</a> (you can also use a standard 0.1&#8243; header if you want to make it more breadboard-friendly) to make it easy to power the Arduino with a regulated 5V power supply.</p>
<p><a href="https://farm7.static.flickr.com/6075/6106300144_504f4141e2_z_d.jpg" rel="lightbox[388]"><img class="alignnone" title="Arduino Pro Mini - Relay Shield" src="https://farm7.static.flickr.com/6075/6106300144_504f4141e2_z_d.jpg" alt="" height="500" /></a></p>
<blockquote><p>Relay Board. Notice the header on the left. It&#8217;s easy to set which pin controls the relay, by simply using a cable to short the SEL pin to the digital pin of your choice.</p></blockquote>
<p>The 2 most common stuff someone will need to use an Arduino Pro Mini for are I/O and reading sensor values from the Analog In pins. So I made a digital I/O shield with space for 4 digital I/O slots, using the same header to select which Arduino pin you want to connect to each slot. In addition to the 2-pin connector for power, I&#8217;ve added 2 more 3-pin connectors (since there was unused space) so you can power it with 7-12V in the RAW pin.</p>
<p>I&#8217;ve brought out the GND rail as well, to be used both for Output (i.e. controlling a LED) as well as an input. For buttons and switches, you should use  the internal pull-up resistor in the microprocessor and the GND rail to detect a button press (if the pin state is LOW, it&#8217;s pressed, if HIGH, it&#8217;s not pressed). That way you don&#8217;t even need any external resistors for your buttons. You can either use screw terminals, or the standard 0.1&#8243; header to connect your I/O, and I&#8217;ve also added a 0.1&#8243; 2-pin molex connector for each of the four I/Os. Of course, if you need more I/Os, all you need to do is stack another shield ;)</p>
<p><a href="https://farm7.static.flickr.com/6188/6105755797_881d5ee34a_b_d.jpg" rel="lightbox[388]"><img class="alignnone" title="Digital I/O Shield" src="https://farm7.static.flickr.com/6188/6105755797_881d5ee34a_b_d.jpg" alt="" height="500" /></a></p>
<blockquote><p>Digital I/O Shield. Notice the selection header and the 2-pin connector for each I/O.</p></blockquote>
<p>In regards to Analog Input, the usual way to use them is to connect a sensor in series to a resistor in order to make a <a href="http://www.ladyada.net/images/sensors/cdsanasch.gif" rel="lightbox[388]">voltage divider</a> (image taken from ladyada&#8217;s excellent <a href="http://www.ladyada.net/learn/sensors/cds.html" target="_blank">tutorial</a> on how to use photoresistors). So I made a board that you can use to make up to 4 voltage dividers. There are slots for each resistor, so that you can use any resistor value you want, and there is one connector for each of the sensors. There&#8217;s also a header for breadboard-friendly connectivity. Of course, the usual power connectors are still there :)</p>
<p><a href="https://farm7.static.flickr.com/6078/6105755863_8ccbf62034_b_d.jpg" rel="lightbox[388]"><img class="alignnone" title="Arduino Pro Mini - Analog Shield" src="https://farm7.static.flickr.com/6078/6105755863_8ccbf62034_b_d.jpg" alt="" height="500" /></a></p>
<blockquote><p>Analog Input Shield. Notice the resistor slots, and the 2-pin header for each sensor.</p></blockquote>
<p>Of course, if you know me, you know I love open source stuff, so <a href="http://www.tzikis.com/arduino_pro_mini_boards_eagle.zip" target="_blank">here</a> are all the EAGLE files for all 3 of the boards.</p>
<p>I hope I&#8217;ve wet your appetite. If you&#8217;re hungry for more, here&#8217;s a video of me explaining each circuit, and showing how to stack them and connect them to the Arduino Pro Mini.</p>
<p><iframe width="560" height="345" src="http://www.youtube.com/embed/q97IFYhZpoo" frameborder="0" allowfullscreen></iframe></p>
<p>If you just want to take a look at some action, here&#8217;s a quick demo of the system in action with 2 relay shields and an I/O shield. You can get the code for the demo <a href="http://www.tzikis.com/arduino_pro_mini_shields_demo.zip">here</a>.</p>
<p><iframe width="420" height="345" src="http://www.youtube.com/embed/8heEYA1vODY" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tzikis.com/?feed=rss2&#038;p=388</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
