<?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>Rommel Rico</title>
	<atom:link href="http://rommelrico.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rommelrico.com</link>
	<description>Random ramblings</description>
	<lastBuildDate>Mon, 13 Feb 2012 04:52:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Changes to Toppy, new domain: sc2topstreams.com</title>
		<link>http://rommelrico.com/changes-to-toppy-new-domain-sc2topstreams-com/</link>
		<comments>http://rommelrico.com/changes-to-toppy-new-domain-sc2topstreams-com/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 16:24:51 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[StarCraft II]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=406</guid>
		<description><![CDATA[&#160; I finally got around to giving Toppy its own domain. Go check it out at: sc2topstreams.com. I also changed the background image to make it smaller and reduce my bandwidth usage (hey, it&#8217;s a free service!). Toppy is still a work in progress. I plan to add some cool jquery to show you the [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_408" class="wp-caption aligncenter" style="width: 410px"><a href="http://rommelrico.com/wp-content/uploads/2011/03/Capture.jpg"><img class="size-medium wp-image-408  " title="Toppy!" src="http://rommelrico.com/wp-content/uploads/2011/03/Capture-300x187.jpg" alt="" width="400" height="250" /></a><p class="wp-caption-text">Toppy!</p></div>
<p style="text-align: center;">&nbsp;</p>
<p>I finally got around to giving <a title="Toppy" href="http://rommelrico.com/about-toppy/">Toppy</a> its own domain. Go check it out at: <a title="Toppy" href="http://sc2topstreams.com">sc2topstreams.com</a>. I also changed the background image to make it smaller and reduce my bandwidth usage (hey, it&#8217;s a free service!).</p>
<p>Toppy is still a work in progress. I plan to add some cool jquery to show you the top 3 streams for each category, rather than just one like it is now.</p>
<p>ETA: 2-3 weeks.</p>
<p>Why so long? Well, other than my responsibilities at my other job, I am going to <a href="http://pro.majorleaguegaming.com/competitions/16#event_33_event_information" target="_blank">MLG Dallas this weekend to go watch SC2 live</a>! Hopefully I get to meet some of the players, but I don&#8217;t have my hopes up. Expect shitty cellphone pictures =D.</p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/changes-to-toppy-new-domain-sc2topstreams-com/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript for showing live StarCraft 2 streams, part 2.</title>
		<link>http://rommelrico.com/javascript-for-showing-live-starcraft-2-streams-part-2/</link>
		<comments>http://rommelrico.com/javascript-for-showing-live-starcraft-2-streams-part-2/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 21:38:04 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[StarCraft II]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[justin.tv]]></category>
		<category><![CDATA[livestream]]></category>
		<category><![CDATA[sc2mx]]></category>
		<category><![CDATA[Ustream]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=379</guid>
		<description><![CDATA[In my last post, I posted some explanation about how to go about writing Javascript to dynamically add a StarCraft 2 stream and chat to my StarCraft 2 Mexican community forums, sc2mx.com. Well, it was a horrible mess of repeated code and the like, so I decided to clean it up a bit. Furthermore, older [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post, I posted some explanation about how to go about writing Javascript to dynamically add a StarCraft 2 stream and chat to my StarCraft 2 Mexican community forums, <a title="SC2MX" href="http://www.sc2mx.com/">sc2mx.com</a>. Well, it was a horrible mess of repeated code and the like, so I decided to clean it up a bit. Furthermore, older versions of Internet Explorer did not seem to want to display the streams. They just showed a white box where the stream was supposed to be. No code explanation this time, but here it is:</p>
<p>[CODE REMOVED DUE TO PROBLEMS WITH BROWSERS MISINTERPRETING THE CODE. SORRY.]</p>
<p>Note: I left the comments and script tags out because they were screwing up my blog post. Tips welcome in the comments below.</p>
<p>And this is how I called the script:<br />
[CODE REMOVED DUE TO PROBLEMS WITH BROWSERS MISINTERPRETING THE CODE. SORRY.]</p>
<p>Again, this script will work with <a href="http://www.ustream.tv/">ustream</a>, <a href="http://www.livestream.com/">livestream</a>, and <a href="http://www.justin.tv/home">justin.tv</a>. Unfortunately, this STILL doesn&#8217;t work with old versions of Internet Explorer. I am stumped as to why this is the case, but I have a pretty good guess that it is a security issue. It does work with IE9 though, so if you are having troubles just update your browser. I also would like to advise people that this is a bad way of doing things. As your site grows, you will be making tons more API calls and you may run out resulting in an uneven experience.</p>
<p>Anyway, hope this is of use to someone. Let me know your thoughts and constructive criticism in the comments. I am always looking for ways to improve.</p>
<p>UPDATE: I had to remove the code because I was having browser issues with posting the javascript. Let me know if you know any workarounds.</p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/javascript-for-showing-live-starcraft-2-streams-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript para mostrar cuando ciertos streams están en vivo.</title>
		<link>http://rommelrico.com/javascript-para-mostrar-cuando-ciertos-streams-estan-en-vivo/</link>
		<comments>http://rommelrico.com/javascript-para-mostrar-cuando-ciertos-streams-estan-en-vivo/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 13:08:51 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[HowTos]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[justintv]]></category>
		<category><![CDATA[livestream]]></category>
		<category><![CDATA[own3d]]></category>
		<category><![CDATA[sc2mx]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[StarCraft II]]></category>
		<category><![CDATA[Ustream]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=372</guid>
		<description><![CDATA[Como ustedes podrán saber, hice una pequeña comunidad de SC2 en Mexico, http://www.sc2mx.com/ Dentro de la misma, hay muchos jugadores que tienen sus propios streams o shows en vivo donde discuten el juego en vivo en las siguientes páginas: ustream, livestream, y justin.tv. También hay streams en own3d, pero desafortunadamente no tienen un API público. Para [...]]]></description>
			<content:encoded><![CDATA[<p>Como ustedes podrán saber, hice una pequeña comunidad de SC2 en Mexico, <a href="http://www.sc2mx.com/">http://www.sc2mx.com/</a> Dentro de la misma, hay muchos jugadores que tienen sus propios streams o shows en vivo donde discuten el juego en vivo en las siguientes páginas: <a href="http://www.ustream.tv/">ustream</a>,<a href="http://www.livestream.com/"> livestream</a>, y <a href="http://www.justin.tv/home">justin.tv</a>. También hay streams en<a href="http://www.own3d.tv/"> own3d</a>, pero desafortunadamente no tienen un API público.</p>
<p>Para darle más audiencia y atención a esos streams, decidí escribir un script sencillito que detecta cuando streams están en vivo y los pone en el foro principal junto con un chat. La idea surgió con mi abuela cuando una vez entre a su casa y tenía el futbol prendido en la televisión. Como ya estaba puesto, me quede a verlo. De igual manera, la idea es forzar a los visitantes a ver los streams para que se queden un rato a verlos y a chatear.</p>
<p>Para no hacer el cuento más largo, aquí está el código. El API de livestream se encuentra aquí: <a href="http://www.livestream.com/userguide/index.php?title=Channel_API_2.0">http://www.livestream.com/userguide/index.php?title=Channel_API_2.0</a><br />
Para saber si un stream de livestream está en vivo, simplemente haces la siguiente llamada:<br />
<a href="http://xsc2mxx.api.channel.livestream.com/2.0/livestatus.json?callback=livestatus">http://xsc2mxx.api.channel.livestream.com/2.0/livestatus.json?callback=livestatus</a><br />
Lo cual retorna algo como esto:</p>
<pre><code>livestatus({"channel":{"isLive":false,"currentViewerCount":0,"isPremium":false}});</code></pre>
<p>Con ustream, la llamada al API (que se encuentra en <a href="http://developer.ustream.tv/docs">http://developer.ustream.tv/docs</a>) es:<br />
http://api.ustream.tv/json/channel/castforfood/getValueOf/status?key=TuClaveSecreta &amp;callback=set_status<br />
Donde TuClaveSecreta es tu API key. Esto retorna algo como esto:</p>
<pre><code>set_status("offline");</code></pre>
<p>Por último, el API de Justin.tv está aquí: <a href="http://www.justin.tv/p/api">http://www.justin.tv/p/api</a>. La llamada al API es: <a href="http://api.justin.tv/api/stream/list.json?channel=day9tv&amp;jsonp=justinlive">http://api.justin.tv/api/stream/list.json?channel=day9tv&amp;jsonp=justinlive</a><br />
Lo cual regresa algo como:</p>
<pre><code>[]</code></pre>
<p>(Una lista vacía indica que el stream no está en vivo)</p>
<p>Una vez aprendido los APIs, lo que sigue es ponerlo en Javascript para colocar el video en la página. Esto lo hice así en el fondo de la página:<br />
[CODE REMOVED DUE TO PROBLEMS WITH BROWSERS MISINTERPRETING THE CODE. SORRY.]<br />
Nótese que cada uno de esos scripts está llamando a las funciones “livestatus”, “set_status”, y “justinlive” respectivamente. También nótese que se están ejecutando en orden y que al final se ejecuta la llamada a print(). No incluyo otro script que coloca el chat en la parte inferior de la página. Simplemente checa que si todos los streams retornan “false”, entonces insertar el chat en la parte inferior de la pagina.</p>
<p>El Javascript que hace toda la magia esta a continuación. Ya sé que puede ser más eficiente (hay mucho codigo repetido), pero me da flojera cambiarlo y así se me hace más claro para mí:<br />
[CODE REMOVED DUE TO PROBLEMS WITH BROWSERS MISINTERPRETING THE CODE. SORRY.]<br />
En realidad el código es muy simple, así que no lo voy a explicar en detalle. Hay boolean flags que se ponen “true” si un stream esta en vivo. Al llegar a la función de print(), empotramos el stream junto con el chat, remplazando el Elemento vacio de “status.”</p>
<p>El problema con este método es que se hace 1 llamada de API a cada servicio cada vez que alguien entra a la página principal. Los servicios de ustream, livestream, y justin.tv te limitan las llamadas de API, así que este truco o hack no va a funcionar muy bien si la pagina crece mucho. Sin embargo, siempre se puede pedir incrementar la cantidad de llamadas de API.</p>
<p>Una manera más elegante de hacer esto sería con un chron job que se ejecutara cada 10 minutos. Esto minimizaría las llamadas de API cuando el foro crezca de tamaño. Pero mi filosofía es, “No hagas más de lo que tienes que hacer para que funcione bien.” Esta técnica me funciona y mientras no se descomponga no la voy a cambiar, ya que server-side scripting es mucho mas difícil que client-side.</p>
<p>Update: Tuve que quitar el javascript porque los browsers estaban tratando de ejecutarlo y esto resultaba en un error. Si saben como arreglar esto, haganmelo saber. Gracias.</p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/javascript-para-mostrar-cuando-ciertos-streams-estan-en-vivo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I created Toppy!</title>
		<link>http://rommelrico.com/i-created-toppy/</link>
		<comments>http://rommelrico.com/i-created-toppy/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 00:26:48 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[StarCraft II]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=362</guid>
		<description><![CDATA[I&#8217;m so excited about finally polishing my Python app. I made Toppy a few weeks ago for my personal use, but since some people at sc2mx.com liked it, I went ahead and polished it, added some more features, and overall improved it. I also documented the source code, in case I want to make it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m so excited about finally polishing my Python app. I made Toppy a few weeks ago for my personal use, but since some people at <a href="http://www.sc2mx.com/" target="_blank">sc2mx.com</a> liked it, I went ahead and polished it, added some more features, and overall improved it. I also documented the source code, in case I want to make it open source, but everyone is telling me not to. <img src='http://rommelrico.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  For now I&#8217;ll listen to the Open source haters, but stay tuned in case I change my mind.</p>
<p>To learn more about toppy, go here: <a href="http://rommelrico.com/about-toppy/">http://rommelrico.com/about-toppy/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/i-created-toppy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time to catch up!</title>
		<link>http://rommelrico.com/time-to-catch-up/</link>
		<comments>http://rommelrico.com/time-to-catch-up/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 20:44:13 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[Personal Projects]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=352</guid>
		<description><![CDATA[Wow, it&#8217;s been a long time since I last blogged. This is what I&#8217;ve been up to since my last post: Graduated from USD! Completed an internship at Pfizer! Created a Mexican SC2 Community with 200+ members! Bought a 15 lbs. of candy! Bought a train ticket to Austin, Texas! So that&#8217;s where I&#8217;m currently [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, it&#8217;s been a long time since I last blogged. This is what I&#8217;ve been up to since my last post:</p>
<ul>
<li>Graduated from <a href="http://sandiego.edu" target="_blank">USD</a>!</li>
<li>Completed an internship at <a href="http://pfizer.com" target="_blank">Pfizer</a>!</li>
<li>Created a <a href="http://sc2mx.com">Mexican SC2 Community</a> with 200+ members!</li>
<li>Bought a <a href="http://www.reddit.com/r/pics/comments/f9mhg/i_dont_know_where_these_come_from_but_i_love_them/c1ectp6" target="_blank">15 lbs. of candy</a>!</li>
<li>Bought a train ticket to <a href="http://en.wikipedia.org/wiki/Austin,_Texas">Austin, Texas</a>!</li>
</ul>
<p>So that&#8217;s where I&#8217;m currently at. I&#8217;m trying to wrap things up here in San Diego/Tijuana and I&#8217;ll be moving to Austin to look for a job as a software engineer. I wish I could talk more about my work at Pfizer (because I did some really cool web-apps), but my non-disclosure agreement prevents me from doing so.</p>
<p>Other than that, I&#8217;m going to try an experiment in this blog. I&#8217;ve noticed that my Spanish grammar is failing, so <span style="color: #800000;">I&#8217;m going to blog in Spanish every other post</span>. I know this is possibly alienating readers, but at the end of the day it is my blog and I want to practice my Spanish writing.</p>
<p>That&#8217;s it! &lt;3</p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/time-to-catch-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The size of the Java JVM thread stack &#8211; an accident in recursion ;)</title>
		<link>http://rommelrico.com/the-size-of-the-java-jvm-thread-stack-an-accident-in-recursion/</link>
		<comments>http://rommelrico.com/the-size-of-the-java-jvm-thread-stack-an-accident-in-recursion/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 18:59:31 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[School]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[SC2]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[Teamliquid.net]]></category>
		<category><![CDATA[University of San Diego]]></category>
		<category><![CDATA[USD]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=333</guid>
		<description><![CDATA[Sup guys. So I was sitting there in the Linux Lab at the University of San Diego watching SC2 streams at teamliquid.net and doing homework, just doing the usual. All of a sudden, my friend Cameron asks me if it&#8217;s possible to recursively called the main method in Java, to which I answer, &#8220;I think [...]]]></description>
			<content:encoded><![CDATA[<p>Sup guys.</p>
<p>So I was sitting there in the Linux Lab at the <a href="http://www.sandiego.edu/cas/math-cs/" target="_blank">University of San Diego</a> watching <a href="http://www.teamliquid.net/video/userstream.php" target="_blank">SC2 streams at teamliquid.net</a> and doing homework, just doing the usual. All of a sudden, my friend Cameron asks me if it&#8217;s possible to recursively called the <strong>main</strong> method in Java, to which I answer, &#8220;I think so, but I don&#8217;t know why you would want to do that.&#8221; The conversation got silly and the following code was written for the lulz:</p>
<pre><code>public class Test {
    public static void main(String[] args){
	try{
		main(args);
	}
	catch(Throwable e){
	    System.err.println(e.getMessage());
	    e.printStackTrace(System.err);
	}
    }
}
</code></pre>
<p>As you can see, this is an obvious infinite loop just to prove that you could recursively called the main method in a Java class. What I didn&#8217;t know, however, was the error or exception I was about to get!</p>
<pre><code>        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
        at Test.main(Test.java:13)
</code></pre>
<p><img class="alignnone" title="lol face" src="http://philosophistry.com/scans/2010/lol-face.jpg" alt="lol face" width="274" height="280" /></p>
<p>As you can see, the error was so large it was impossible to see the Exception name (at least on emacs, I later tried it on NetBeans and I saw that it was a <span style="color: #ff0000;">java.lang.StackOverflowError</span>). In any case, I just guessed that it was some kind of stack overflow. This, in turn, led me to ask the question: <strong>What is the default size of the JVM thread stack?</strong></p>
<p>At first I tried figuring this out by trial and error, by imposing limitations on the number of recursions. I found that the main method I wrote above could be called recursively ~7,000 times without throwing an Exception. I then realized that figuring out the size of the stack by hand was going to be an exercise in futility, so I turned to documentation in Google. I found the following in some <a href="http://docs.hp.com/en/JAVAPROGUIDE/java1/tools.html" target="_blank">docs from HP</a>:</p>
<blockquote><p>If you used versions of the HP-UX Developer&#8217;s Kit for Java™ prior to 1.1.3.4, you may have had problems due to the large stack sizes that were reserved in those earlier JVMs. As of 1.1.3.4 (and later releases), the default native thread stack size is 128 KB (prior to that it had been 1 MB). <span style="text-decoration: underline;"><strong>The default Java™ thread stack is 400 KB.</strong></span> The defaults can be controlled by the -ss and -oss flags (for the native thread stack and the Java™ thread stack respectively).</p></blockquote>
<p>So there you have it folks. The default size of the JVM thread stack is 400 KB. Those are a lot of recursive calls! I suppose that the next step in this experimentation would be messing with the stack sizes and recursion. I think I&#8217;ll leave it at that for now.</p>
<p>Cheers! <img src='http://rommelrico.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Disclaimer: This post is for fun. I don&#8217;t code like this. Hire me! <img src='http://rommelrico.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/the-size-of-the-java-jvm-thread-stack-an-accident-in-recursion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Military Time Form with Simple Validation using JavaScript and HTML</title>
		<link>http://rommelrico.com/military-time-form-with-simple-validation-using-javascript-and-html/</link>
		<comments>http://rommelrico.com/military-time-form-with-simple-validation-using-javascript-and-html/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 00:01:39 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Andrew]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Military Time]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=324</guid>
		<description><![CDATA[Hi again. My friend Andrew wanted to know how to create a web form that would take Military Time as an input and checked if it was correct. I&#8217;m not an expert at web stuff, but this was simple enough for me to make after reading for a few minutes. Check it out: &#60;!DOCTYPE html [...]]]></description>
			<content:encoded><![CDATA[<p>Hi again. My friend Andrew wanted to know how to create a web form that would take Military Time as an input and checked if it was correct. I&#8217;m not an expert at web stuff, but this was simple enough for me to make after reading for a few minutes. Check it out:</p>
<pre><code>
</code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-trans\
itional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

&lt;head&gt;
<span style="color: #3366ff;">&lt;script language="JavaScript"&gt;
function showData() {
 var InpOne = document.formone.inputone.value;
 var InpTwo = document.formone.inputtwo.value;
 var newreg =  /^(([01][0-9])|(2[0-3])):[0-5][0-9]$/;
 if (newreg.exec(InpTwo)) {
 alert("Hi, "+InpOne+". Valid Military time entered");
 }
 else {
 alert("Sorry, "+InpOne+". Not a valid Military time.");
 }
}
&lt;/script&gt;</span>
&lt;/head&gt;

&lt;body&gt;
&lt;div id="masthead"&gt;
 &lt;h1 id="siteName"&gt;Rommel's Home&lt;/h1&gt;
&lt;/div&gt;
&lt;!-- end masthead --&gt;
&lt;div id="content"&gt;
 &lt;h2 id="pageName"&gt;Examples for learning. Hi Andrew.&lt;/h2&gt;
 <span style="color: #3366ff;">&lt;form name="formone" onsubmit="showData()" action method="get"&gt;
 Enter a Name:  &lt;input name="inputone" type="text" /&gt;
 Enter a Military Time: &lt;input name="inputtwo" type="text" /&gt;
 &lt;input type="submit" value="Show"&gt;
 &lt;/form&gt;</span>
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Alright, so the blue parts are the only things we need to worry about. The bottom is just the form, so I won&#8217;t really discuss it.</p>
<p>On the top, we have our JavaScript code. InpOne contains the name (which comes from the form), and InpTwo contains the Military Time input. The variable newreg is the key regular expression that will allow us to validate the Military Time.The regular expression will look for times that start with the number 0 or 1 followed by any digit between 0 and 9, <strong>or</strong> a 2 followed by any digit between 0 and 3. This is because in military time, we have 24 hours, but we start at hour 00 and end at hour 23. Notice that this regular expression would be invalid for hours 24 or higher.Then the regular expression checks that there is a semicolon between the two sets of numbers, and we check that the last two digits are between 00 and 59.</p>
<p>So our script would match the regular expression with InpTwo, the Military Time input. If it&#8217;s a valid time, the browser will launch an alert telling the user that they&#8217;ve inputted the correct time. Otherwise, the browser launches an alert telling them they messed up.</p>
<p>Hope that was useful to anyone. You can see a working example at: http://home.sandiego.edu/~rico.r-10/ However, that link will likely not be permanent. If the link has changed, or if you have any questions, let me know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/military-time-form-with-simple-validation-using-javascript-and-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Small Compilation of Science Jokes</title>
		<link>http://rommelrico.com/small-compilation-of-science-jokes/</link>
		<comments>http://rommelrico.com/small-compilation-of-science-jokes/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 16:47:57 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[Jokes]]></category>
		<category><![CDATA[Reddit]]></category>
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=321</guid>
		<description><![CDATA[I found these on Reddit on this thread: http://www.reddit.com/r/funny/comments/d72mt/so_helium_walks_into_a_bar_and_orders_a_beer/, but I thought it would be nice to save them in my blog. Credit to their respective authors. So Helium walks into a bar and orders a beer, the bartender says, &#8220;Sorry, we don&#8217;t serve noble gases here.&#8221; Helium doesn&#8217;t react.   A superconductor walks into [...]]]></description>
			<content:encoded><![CDATA[<p>I found these on Reddit on this thread: <a href="http://www.reddit.com/r/funny/comments/d72mt/so_helium_walks_into_a_bar_and_orders_a_beer/">http://www.reddit.com/r/funny/comments/d72mt/so_helium_walks_into_a_bar_and_orders_a_beer/</a>, but I thought it would be nice to save them in my blog. Credit to their respective authors.</p>
<blockquote><p>So Helium walks into a bar and orders a beer, the bartender says, &#8220;Sorry, we don&#8217;t serve noble gases here.&#8221;</p>
<p>Helium doesn&#8217;t react.</p>
</blockquote>
<p> </p>
<blockquote><p>A superconductor walks into a bar. The bartender says &#8220;we don&#8217;t serve superconductors here.&#8221; The superconductor leaves without putting up any resistance.</p>
<p>A higgs-boson walks into a church. The priest says &#8220;higgs-bosons aren&#8217;t allowed in here.&#8221; The higgs-boson says &#8220;but without me, how can you have mass?&#8221;</p>
<p>To get to the other side.</p>
<p>Why did the tachyon cross the road?</p>
<p>Schrodinger&#8217;s cat walks into a bar and doesn&#8217;t.</p>
<p>A parasite walks into a bar. The bartender says &#8220;we don&#8217;t serve your kind in here.&#8221; The parasite says &#8220;well you&#8217;re not a very good host.&#8221;</p>
<p>A neutrino walks into a bar. The bartender says &#8220;we don&#8217;t serve neutrinos in here.&#8221; The neutrino says &#8220;I was just passing through.&#8221;</p>
</blockquote>
<p> </p>
<blockquote><p>Heisenberg is stopped by a traffic cop who askes: &#8220;Do you know how fast you were going?&#8221; Heisenberg replies: &#8220;No, but I know exactly where I am&#8221;</p>
</blockquote>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/small-compilation-of-science-jokes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where to invest my money?</title>
		<link>http://rommelrico.com/where-to-invest-my-money/</link>
		<comments>http://rommelrico.com/where-to-invest-my-money/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 16:31:59 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[Economy]]></category>
		<category><![CDATA[Fool.com]]></category>
		<category><![CDATA[Funds]]></category>
		<category><![CDATA[Index]]></category>
		<category><![CDATA[Invest]]></category>
		<category><![CDATA[Investment]]></category>
		<category><![CDATA[Mutual]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=318</guid>
		<description><![CDATA[A few months ago I was having a conversation by IM with a friend of mine from High School. The topic of investing came up and he mentioned that he wanted to know what a Mutual Fund was. I didn&#8217;t know either, so I figured it would be a great exercise to learn and then [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I was having a conversation by IM with a friend of mine from High School. The topic of investing came up and he mentioned that he wanted to know what a Mutual Fund was. I didn&#8217;t know either, so I figured it would be a great exercise to learn and then blog about them.</p>
<p>Basically, a Mutual Fund is a type of investment in which one (or more) fund manager(s) collect money from investors (aka you) and purchase a set of stocks that they think will be performing very well. So, for example, a Mutual Fund from Joe&#8217;s firm could have Coca-Cola, Microsoft, and Apple stock, and when you purchase into that Mutual Fund, your earnings are based on all of those stocks. This is good because your earnings are leveraged by all of the firms, so if one does really bad, you should be safe assuming that the others will perform good. <strong>That&#8217;s a big assumption!</strong> In fact, according to Fool.com, <a href="http://www.fool.com/MutualFunds/MutualFunds.htm">over 80% of Mutual Funds underperform the stock market&#8217;s returns</a>. That&#8217;s not to say that they will lose you money. A lot of people (read: Harvard Grads) monitor the performance of their mutual funds VERY frequently, so when something starts to go wrong, they make changes and the investors are pretty safe. Still, those Harvard people are not cheap, so you are charged fees, commissions, etc.</p>
<p>In my search of Mutual Funds I found an even better way to invest my money: Index Funds! An Index Fund is similar to a Mutual Fund in that you purchase a collection of stocks so that not all of your eggs are in a single basket, except that with Index Funds your &#8220;basket&#8221; is an entire market!</p>
<p>Index Funds are  usually computer-controlled collections of stocks that track financial markets (like the Dow Jones, S&amp;P 500, MCSI Japan, etc) and try to perform equally (not better, not worse) than the market. When you purchase an Index Fund, you first start by looking at the Financial Markets you want to invest. Once you do that, you go to your broker and see if they offer an Index Fund for that market. Then, you invest on the Index Fund and voila!, the computers do the rest of the work for you. With an Index Fund, your money is virtually guaranteed to perform as well as the Market.</p>
<p>In fear of being redundant, I&#8217;ll explain it one more time. An Index Fund&#8217;s value changes proportionally to the value of the stocks in the market it performs. Computers automatically pick stock that performs like the market it is in, so your investments are protected against human drama and emotion.</p>
<p>Of course, Index Funds are not the best place to invest your money if you want to get rich quick. Index Fund are for investors who would be satisfied with average market returns. For most people, this is the way to go. For me, this is the best option because I can just go on with my daily life without having to pay the fees of Mutual Funds.  I can do all my investment from the Internet too.</p>
<p> </p>
<p>So, summary time:</p>
<p><span style="color: #ff0000;">Mutual Funds &#8211; BAD</span></p>
<p><span style="color: #00ff00;">Index Funds &#8211; GOOD</span></p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/where-to-invest-my-money/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StarCraft II &#8211; Cheese Rushing the wrong base</title>
		<link>http://rommelrico.com/starcraft-ii-cheese-rushing-the-wrong-base/</link>
		<comments>http://rommelrico.com/starcraft-ii-cheese-rushing-the-wrong-base/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 23:31:34 +0000</pubDate>
		<dc:creator>Rommel</dc:creator>
				<category><![CDATA[StarCraft II]]></category>

		<guid isPermaLink="false">http://rommelrico.com/?p=315</guid>
		<description><![CDATA[SPOILER ALERT It doesn&#8217;t work.]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/V_I73d1f3eA" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/V_I73d1f3eA"></embed></object></p>
<p><strong>SPOILER ALERT</strong></p>
<p><em>It doesn&#8217;t work. <img src='http://rommelrico.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://rommelrico.com/starcraft-ii-cheese-rushing-the-wrong-base/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

