<?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>Orby</title>
	<atom:link href="http://www.orby.es/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.orby.es</link>
	<description>Developing</description>
	<lastBuildDate>Sat, 19 May 2012 18:22:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to manage alarms in Android</title>
		<link>http://www.orby.es/how-to-manage-alarms-android/</link>
		<comments>http://www.orby.es/how-to-manage-alarms-android/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 16:46:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Android Development]]></category>

		<guid isPermaLink="false">http://www.orby.es/?p=175</guid>
		<description><![CDATA[Again an Android post coming up. I had this really cool feature in my Nexus One few months ago but I did a hard reset and I lost it. It&#8217;s quite simple app but really useful, I&#8217;m talking about a Night Mode. Basically you can set from what time you want your phone in silence [...]]]></description>
			<content:encoded><![CDATA[<p>Again an Android post coming up.</p>
<p>I had this really cool feature in my Nexus One few months ago but I did a hard reset and I lost it. It&#8217;s quite simple app but really useful, I&#8217;m talking about a Night Mode. Basically you can set from what time you want your phone in silence (or just vibrate mode) and when you want to turn on the sound again. As you can see it&#8217;s pretty simple but still we&#8217;ll have to deal with few things that I&#8217;ll explain right now.</p>
<p>First of all&#8230; how this will work? I&#8217;ll use a listview with all my &#8220;alarms&#8221; and some details for each of them:</p>
<ul>
<li>Name of the night mode</li>
<li>Start hour</li>
<li>End hour</li>
<li>Days of the week, which basically means that if you set Monday and Tuesday, this concrete alarm will be fired just those days so you can set different night modes depending on the day or even two or more night modes for the same day.</li>
<li>Vibrate, just if you want to active vibrate mode or you just want everything off.</li>
</ul>
<p>Regarding to the weekdays, if we have set an alarm for Monday from 10am to 15am there&#8217;s no problem, but if we&#8217;ve set the alarm on Monday from 11pm to 8am (end hour &lt; start hour) then the alarm will be fire next day (11pm on Monday and 8am on Tuesday). So far so good.</p>
<p>There are few thing you should know if you are working with alarms in Android, some technical stuff is coming.</p>
<ol>
<li>You need to set the alarms everytime you reboot the phone. All the alarms are deleted (Android thing) when you reboot your phone. I&#8217;ve implemented a receiver that triggers on when it detects a reboot so it can reload all the alarms.</li>
<li>There&#8217;s no such a thing like &#8220;repeating days&#8221; or something similar in the Android alarm&#8217;s, that&#8217;s why you need to update the alarms when they are fired, which means getting the information, knowing when you have to fired the alarm the next time and so on.</li>
</ol>
<p>I&#8217;ll go ahead and show you a bit of my code.</p>
<p>This is part of my receiver when an alarm fires on.</p>
<pre class="brush:java"> public void onReceive(Context context, Intent intent) {
        try {

            // getting the extras from the intent
            Bundle bundle = intent.getExtras();
            // on or off
            Integer on = bundle.getInt("on")
            // id of the alarm
            Integer id = bundle.getInt("id");

            if(id&gt;0){
                Integer difference = 1;
                Calendar currDateTime = new GregorianCalendar();
                NMClass nm = new NMClass(context);    
                // fetching from SQLlite the data related to the id
                nm.fetchNM(id);
                // getting the next day we have to set the alarm        
                int nextday;
                // Day of the week
                int weekDay = currDateTime.get(Calendar.DAY_OF_WEEK);
                // Monday is 0, Tuesday 1...
                int weekDayApp = ((weekDay+5) % 7);

                AudioManager aManager=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
                // setting next alarm time based on hour parameters
                Calendar nextAlarmTime = new GregorianCalendar();                        
                nextAlarmTime.set(Calendar.SECOND, 0);

                // if on we have to set to off and turn off the sounds
                if(on==1){
                    on=0;
                    // we get the next day to turn off the alarm
                    nextDay = nm.closestDay(false);
                    nextAlarmTime.set(Calendar.HOUR_OF_DAY, nm.getHourEnd());
                    nextAlarmTime.set(Calendar.MINUTE, nm.getMinuteEnd());
                    // vibration on or off?
                    if(nm.isVibrate())
                        aManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
                    else
                        aManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
                }
                // else we set to on and turn on the sounds
                else{
                    on=1;
                    // we get the next day to turn on the alarm
                    nextDay = nm.closestDay(true);

                    nextAlarmTime.set(Calendar.HOUR_OF_DAY, nm.getHourIni());
                    nextAlarmTime.set(Calendar.MINUTE, nm.getMinuteIni());
                    aManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
                }

                difference = nextDay - weekDayApp;

                // difference between days, if &lt; 0 is next week
                if(difference &lt; 0)
                    difference = 7+difference;

                // add the difference to get the next day
                nextAlarmTime.add(Calendar.DAY_OF_MONTH,difference);

                Intent intentAlarm = new Intent(context, NMReceiver.class);

                intentAlarm.putExtra("on", on);
                intentAlarm.putExtra("id", id);
                // We use the id of the alarm to set the intent
                PendingIntent sender = PendingIntent.getBroadcast(context, id, intentAlarm, PendingIntent.FLAG_UPDATE_CURRENT);

                // Get the AlarmManager service
                AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

                // Cancel just in case we have updated the alarm
                am.cancel(sender);
                am.set(AlarmManager.RTC_WAKEUP, nextAlarmTime.getTimeInMillis(), sender);
            }
        } catch (Exception e) {
            Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
            e.printStackTrace();
            Log.d("ERROR",e.getMessage());
        }
    }</pre>
<p>For those wondering about the closestDay method, here you have an spoiler. I basically have a boolean array which has 7 positions with true or false depending if the weekday was set or not. v[0] would be monday and so on. The comments and code are explained pretty well by themselves.</p>
<pre class="brush:java">	Calendar currDateTime = new GregorianCalendar();
	Calendar timeIni = new GregorianCalendar();
	timeIni.set(CurrDateTime.get(Calendar.YEAR), CurrDateTime.get(Calendar.MONTH), CurrDateTime.get(Calendar.DAY_OF_MONTH), hourIni, minuteIni);
	Calendar timeEnd = new GregorianCalendar();
	timeEnd.set(CurrDateTime.get(Calendar.YEAR), CurrDateTime.get(Calendar.MONTH), CurrDateTime.get(Calendar.DAY_OF_MONTH), hourEnd, minuteEnd);
        int weekDay = currDateTime.get(Calendar.DAY_OF_WEEK);
        // Monday 0, Tuesday 1...
        int currentday = ((weekDay+5) % 7);
        int dayAux = currentDay;
        for(int i=0; i</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.orby.es/how-to-manage-alarms-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My solo project: 3rd song</title>
		<link>http://www.orby.es/my-solo-project-3rd-song/</link>
		<comments>http://www.orby.es/my-solo-project-3rd-song/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 14:22:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.orby.es/?p=153</guid>
		<description><![CDATA[Welcome back! Finally I&#8217;ve &#8220;finished&#8221; my third song, as usual without lyrics but hopefully that will change soon because I just ordered a new SM58 for the vocals. I&#8217;ve been reading a lot about mics (I already own a ribbon mic but it&#8217;s too sensitive :S) and finally I&#8217;ve chosen the SM58, which I think [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome back!</p>
<p>Finally I&#8217;ve &#8220;finished&#8221; my third song, as usual without lyrics but hopefully that will change soon because I just ordered a new SM58 for the vocals. I&#8217;ve been reading a lot about mics (I already own a ribbon mic but it&#8217;s too sensitive :S) and finally I&#8217;ve chosen the SM58, which I think is the best for my purpose.</p>
<p>Anyway, back to the song&#8230; I had this idea few months ago, I recorded the main idea and well&#8230; everything has changed since then, I&#8217;ve just kept the main riff but that&#8217;s pretty much the only thing that I didn&#8217;t change. I have to say that in my opinion this is the best EQ that I made till now, you can see the differences between this song and the others that I made before, just check it out!.</p>
<p>The most difficult part was the solo, actually I don&#8217;t like too much but I won&#8217;t change anything yet, maybe later when I record the lyrics, who knows.</p>
<p>By the way I&#8217;m already working in my new song which is gonna be a cover from a famous song, can&#8217;t wait to finish it.</p>
<p>Enjoy!</p>
<p>&#8211;</p>
<p>Bienvenidos de nuevo.</p>
<p>Por fin he &#8220;terminado&#8221; mi tercera canción, como siempre sin letra, pero eso cambiará pronto ya que acabo de comprar un nuevo SM58 para las voces. He estado leyendo mucho sobre micros (ya tengo uno micro de cinta pero es demasiado sensible :S) y finalmente he elegido el SM58 el cuál creo que es el mejor para mi propósito.</p>
<p>De vuelta a la canción, tuve esta idea hace unos pocos meses, grabé la idea principal y bueno&#8230; todo ha cambiado desde entonces, sólo he dejado el riff principal pero eso es básicamente lo único que no se ha modificado. Tengo que decir que en mi opinión es la mejor EQ que he hecho hasta ahora, podéis comprobar las diferencias entre esta canción y el resto que hice antes.</p>
<p>La parte más difícil fue el solo, realmente no me gusta mucho pero no voy a cambiar nada todavía, quizás más tarde cuando grabe la letra, quien sabe.</p>
<p>Por cierto, ya estoy trabajando en mi nueva canción, va a ser una versión de una famosa canción, que ganas de terminarla.</p>
<p>Disfrutad!</p>
<p><object width="353" height="132"><embed src="http://www.goear.com/files/external.swf?file=55fed5a" type="application/x-shockwave-flash" wmode="transparent" quality="high" width="353" height="132"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.orby.es/my-solo-project-3rd-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My solo project: &#8220;For Real&#8221;</title>
		<link>http://www.orby.es/my-solo-project-for-real/</link>
		<comments>http://www.orby.es/my-solo-project-for-real/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 00:03:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.orby.es/?p=136</guid>
		<description><![CDATA[Let&#8217;s have a look at the new song. I came up with this idea in October after a few bad months, just same crap as always, nothing to worry about but you know&#8230; sometimes shit happens and you can&#8217;t do nothing about it. So basically I was playing and the main riff was there, it [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s have a look at the new song. </p>
<p>I came up with this idea in October after a few bad months, just same crap as always, nothing to worry about but you know&#8230; sometimes shit happens and you can&#8217;t do nothing about it. So basically I was playing and the main riff was there, it was quite good but it needed one more thing. The piano did the rest.</p>
<p>It was also quite hard to get a good guitar solo, none of them fitted, in fact I played during one day a lot of different combinations but none was good enough, thankfully muses always come back so I was able to play something acceptable. But the most difficult part I&#8217;d say it was the intro&#8230; find a good piano intro wasn&#8217;t to be easy, specially because I don&#8217;t know how to play piano very well&#8230; shame on me! <img src='http://www.orby.es/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  But the result&#8230; I can&#8217;t complain at all, at least I can say It has been the best mix and EQ that I ever did.</p>
<p>I have a new version which is a bit shorter, I removed one of the last strophes&#8230; I think the song was pretty long. Of course without lyrics, but I knew since the first moment the title, &#8220;For Real&#8221; and I do know something about the lyrics, basically that now is the moment, now is for real. Can&#8217;t wait to get the mic <img src='http://www.orby.es/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>By the way, it&#8217;s in Am</p>
<p>&#8211;</p>
<p>Echemos un vistazo a la nueva canción.</p>
<p>Tuve esta idea en Octubre después de unos pocos malos meses, simplemente la misma mierda de siempre, nada sobre lo que preocuparse, pero ya sabéis&#8230; a veces estas cosas pasan y no puedes hacer nada al respecto. Así que básicamente estaba tocando y el riff principal estaba ahí, sonaba bastante bien pero necesitaba algo más. El piano hizo el resto.</p>
<p>Fue también bastante difícil conseguir un buen solo de guitarra, ninguno encajaba bien, de hecho estuve tocando durante un día bastantes combinaciones diferentes pero ninguna era lo suficientemente buena, afortunadamente las musas siempre vuelven así que fui capaz de tocar algo aceptable. Pero la parte más difícil diría que fue la intro&#8230; encontrar una buena intro de piano no iba a ser fácil, especialmente porque no se muy como se toca el piano&#8230; debería darme verguenza! <img src='http://www.orby.es/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Pero el resultado&#8230; No puedo quejarme, al menos puedo decir que ha sido la mejor mezcla y EQ que he hecho nunca.</p>
<p>Tengo una nueva versión que es un poco más corta, quité una de las últimas estrofas&#8230; Creo que era demasiado larga. Por supuesto está sin letra, pero supe desde el primer momento el título, &#8220;For Real&#8221; y sé también algo sobre la letra, básicamente que ahora es el momento, que esta vez va de verdad. Que ganas de tener el micro <img src='http://www.orby.es/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Por cierto, está en Am.</p>
<p><object width="353" height="132"><embed src="http://www.goear.com/files/external.swf?file=2f8d0d3" type="application/x-shockwave-flash" wmode="transparent" quality="high" width="353" height="132"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.orby.es/my-solo-project-for-real/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My solo project: song1</title>
		<link>http://www.orby.es/my-solo-project-song1/</link>
		<comments>http://www.orby.es/my-solo-project-song1/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 12:24:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.orby.es/?p=125</guid>
		<description><![CDATA[Welcome back! Before coming back from Finland I had one thing in my mind, starting a music solo project. As you should know (otherwise read &#8220;Who I Am&#8221;) I love music and I also play the guitar, for the last years I was playing in a band but I had to quite before going to [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome back!</p>
<p>Before coming back from Finland I had one thing in my mind, starting a music solo project. As you should know (otherwise read &#8220;Who I Am&#8221;) I love music and I also play the guitar, for the last years I was playing in a band but I had to quite before going to Finland for obvious reasons. So I just built my own home-studio and I started to learn how to record guitars, how to mix, etc. I spent several months just learning and doing some tests and finally in July I got this. My very first own song, still missing the lyrics (I need a new microphone) and more mix, but it has quite good quality.</p>
<p>I don&#8217;t have a name for the song yet, neither for the project so any feed back about it will be welcome. I did another song but I&#8217;ll post about it later, right now my goal is come up with a 10 songs LP, hopefully I will be able to do it.</p>
<p>&#8211;</p>
<p>Bienvenidos de nuevo!</p>
<p>Antes de volver de Finlandia tenía una cosa en mente, empezar un proyecto musical en solitario. Como deberíais saber (si no leed &#8220;Who I am&#8221;) me encanta la música y también toco la guitarra, durante los últimos años estuve tocando la guitarra en una banda pero obviamente tuve que dejarlo antes de ir a Finlandia. Así que simplemente me construí mi propio home-studio y empecé a aprender como grabar guitarras, como mezclar, etc. Pasé varios meses simplemente aprendiendo y haciendo algunos tests y finalmente, en Julio conseguí esto. Mi primera canción, todavía no tiene letra (necesito un nuevo micrófono) y algo más de mezcla pero tiene bastante buena calidad.</p>
<p>Todavía no tengo un nombre para la canción ni para el proyecto, así que cualquier sugerencia o feedback será bienvenida. Hice otra canción pero postearé sobre ella más tarde, ahora mismo my objetivo es sacar un LP con 10 canciones, ojalá sea capaz de hacerlo.</p>
<p><object width="353" height="132"><embed src="http://www.goear.com/files/external.swf?file=cdf23bf" type="application/x-shockwave-flash" wmode="transparent" quality="high" width="353" height="132"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.orby.es/my-solo-project-song1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Teamwork</title>
		<link>http://www.orby.es/teamwork/</link>
		<comments>http://www.orby.es/teamwork/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 22:34:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.orby.es/?p=65</guid>
		<description><![CDATA[Has been a tough week at work. Most of my workmates were on holiday so we took care about their work, 4 people in the middle of the hell trying to work as 8, a fucking damn hell. I&#8217;m not gonna complain about it (I already did it on facebook) but I would like to [...]]]></description>
			<content:encoded><![CDATA[<p>Has been a tough week at work. Most of my workmates were on holiday so we took care about their work, 4 people in the middle of the hell trying to work as 8, a fucking damn hell. I&#8217;m not gonna complain about it (I already did it on facebook) but I would like to talk about teamwork, about something that happened this afternoon.</p>
<p>I worked in three different places before getting my new job, neither of them I had a situation like this one. One error in our database system quite hard to find, really hard, bloody weird. Three persons working as one, each one thinking to solve one problem. The end is wonderful: &#8220;I think I&#8217;ve got the pattern&#8221; &#8220;Let me see it&#8221; &#8220;Yes, it happens here as well&#8221; &#8220;The problem has to be in this procedure&#8221; &#8220;Let me check it out&#8221; &#8220;Geez!! Is here&#8221;&#8230; after 4 hours we found the problem. What a feeling.</p>
<p>I&#8217;ve never worked in this kind of situation, an urgent problem which has to be solved asap. In my latest jobs I worked alone mostly of the time so today was definitely an awesome experience. What I learnt today? It&#8217;s a pleasure work with competent people in a pally environment.  Afterwards&#8230; a beer to celebrate. I love my work.</p>
<p>&#8212;</p>
<p>Ha sido una dura semana en el trabajo. La mayoría de mis compañeros estaban de vacaciones por lo que tuvimos que hacernos cargo de su trabajo, 4 personas en el medio del infierno intentando trabajar como 8, un puto y jodido infierno. No voy a quejarme sobre ello (ya lo hice en facebook) pero sí que me gustaría hablar acerca del trabajo en equipo, sobre algo que sucedió esta tarde.</p>
<p>Trabajé en tres sitios diferentes antes de conseguir mi nuevo trabajo, en ninguno de ellos tuve una situación como esta. Un error en nuestro sistema de bases de datos bastante difícil de encontrar, muy difícil, jodidamente raro. Tres personas trabajando como una, cada una de ellas pensando para solucionarlo. El final es maravilloso: &#8220;Creo que he encontrado el patrón&#8221; &#8220;Déjame verlo&#8221; &#8220;Sí, ocurre aquí también&#8221; &#8220;El problema debe estar en este procedimiento&#8221; &#8220;Deja que lo compruebe&#8221; &#8220;Dios!! Está aquí&#8221;&#8230; después de 4 horas encontramos el fallo. Menuda sensación.</p>
<p>Nunca he trabajado en este tipo de situación, un problema urgente que debe ser resuelto cuanto antes. En mis últimos trabajados trabajé sólo la mayor parte del tiempo así que hoy fue definitivamente una experiencia increíble. Que aprendí hoy? Es un placer trabajar con gente competente en un entorno amistoso. Después&#8230; una cerveza para celebrar. Me encanta mi trabajo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.orby.es/teamwork/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to Orby 3.0</title>
		<link>http://www.orby.es/welcome-to-orby-3-0/</link>
		<comments>http://www.orby.es/welcome-to-orby-3-0/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 00:20:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Welcome]]></category>

		<guid isPermaLink="false">http://www.orby.es/?p=21</guid>
		<description><![CDATA[Hi everybody! As you can see things have changed a bit since the last time you were here. Let&#8217;s say that I&#8217;m gonna start again, from zero. This will be the third blog, the third start&#8230; last two times I just changed the blog&#8217;s theme but now is time for something new. For starters I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everybody!</p>
<p>As you can see things have changed a bit since the last time you were here. Let&#8217;s say that I&#8217;m gonna start again, from zero. This will be the third blog, the third start&#8230; last two times I just changed the blog&#8217;s theme but now is time for something new. For starters I&#8217;m gonna try to write both english and spanish (sorry for all my mistakes in advance), that will be the most important change. But I also wanted to share all my photos so I decided to install a gallery based theme. Hopefully I&#8217;ll upload new pictures and I&#8217;ll write few things, at least I&#8217;ll try. Now just give me a couple of days to update everything and welcome back <img src='http://www.orby.es/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.orby.es/welcome-to-orby-3-0/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

