<?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>The Geek Brewery &#187; Programming</title>
	<atom:link href="http://conradmiguel.com/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://conradmiguel.com</link>
	<description>Adventures of a Self-Proclaimed Pinoy Geek</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:55:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>The art of scaling</title>
		<link>http://conradmiguel.com/art-scaling</link>
		<comments>http://conradmiguel.com/art-scaling#comments</comments>
		<pubDate>Tue, 31 Jan 2012 20:31:18 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[BiliBid]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1752</guid>
		<description><![CDATA[When we started BiliBid, it ran on an Apache web server. Our server&#8217;s system load played from 0.50 to 2.00 depending on the number of users online. On the first few days, everything ran well but eventually it came to a point when it was hogging too much RAM. Just to give you an idea, [...]]]></description>
			<content:encoded><![CDATA[<p>When we started BiliBid, it ran on an Apache web server. Our server&#8217;s system load played from 0.50 to 2.00 depending on the number of users online. On the first few days, everything ran well but eventually it came to a point when it was hogging too much RAM.</p>
<p>Just to give you an idea, I&#8217;ll enumerate the HTTP requests the BiliBid server is constantly receiving:</p>
<ul>
<li><strong>The pages.</strong> They are the requests for the front page, winners page, single bid page, redeem PIN page, etc. It is <strong>requested once per pageview</strong>.</li>
<li><strong>The static files.</strong> The pages contain static files (Javascript and <a href="http://lesscss.org/">LESS</a> files). <strong>Multiple requests per pageview, only requested when the page is loaded.</strong></li>
<li><strong>Balance requests. </strong>When a user is logged in, the user&#8217;s browser requests for the bid balance <strong>once every two seconds</strong>.</li>
<li><strong>Timer requests.</strong> When a user is in the front page or a single bid page, the user&#8217;s browser requests for the timers of the items in the page <strong>once every second</strong>.</li>
<li><strong>Bid requests.</strong> <strong>Everytime a user places a bid</strong>, a request is sent to the server.</li>
</ul>
<p>Multiply that to the number of users online! <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<h3>Switch from Apache to nginx + php-fpm</h3>
<p>One day around early September, I tried researching on nginx (engine-x) since I&#8217;ve heard that it has a smaller and more predictable memory (RAM) footprint. I also read stuff on php-fpm. I tried to weigh things since I&#8217;ll have to lose some Apache functionality if I switch to this one. This means no more .htaccess for me, but obviously I can <em>convert</em> my .htaccess file to something that nginx would understand. Fortunately, I found out that it wasn&#8217;t that hard to do it.</p>
<p>The same day, I installed nginx on the server. Before killing Apache and starting nginx, I fixed all my configuration files first. Then came the moment of truth, I killed Apache and started nginx. I was surprised that everything went so well that I couldn&#8217;t believe that BiliBid was already running in nginx.</p>
<h3>Routing problems</h3>
<p>Then came late October, people started reporting having high latencies with BiliBid. I think it was also the same period when I decided to put the <strong>Connection Quality </strong>indicator (before I did it, I know no other penny auction site with that feature &#8211; until I received a tip from a bidder that a penny auction site in the Philippines [starts with B and ends with A] implemented it, too). Before the problem occurred, I made no major change on BiliBid therefore I concluded that there might have been routing problems from some of our bidders&#8217; end to our server.</p>
<p>This time, I decided to move our server to a nearer location to reduce latency and hopefully solve the routing problem. The move had trade-offs. It was more cost-efficient but to the expense of number of usable processor threads. On our previous server, I had 16 processor threads compared to four (4) on the new server.</p>
<p>I decided to review most of the SQL queries I was making and optimize it. I was able to reduce the execution time of my complex queries, some went down to up to 50%.</p>
<p>Everything went well until we started our Facebook campaigns. We received double the amount of concurrent online users. Our server load went crazy to up to 20.00, then one time it went as high as 70.00 during the auction of a big item. We had to postpone one of the big items to distribute the load over time. I tried experimenting different configurations on nginx, php-fpm and MySQL but to no avail.</p>
<h3>Going back to our old server</h3>
<p>This time, I decided to go back to our old server (16 usable processor threads). The problem with the server load disappeared. Everything was okay until recently, we received an overwhelming number of reports that translate to latency problems. I checked them one by one, around 1/2 were valid while the other third I consider invalid &#8211; just riding with the flow (and I hate it).</p>
<h3>The most recent server switch, adding another server, MariaDB, etc</h3>
<p>So I decided to go back to nearer server with four (4) processor threads. Before switching, I tried reading stuff to optimize the server to prevent high loads. I decided to change SQL server from MySQL to MariaDB. I think I first heard of MariaDB during a DevCon in UP. I experimented on the different storage engines offered by MariaDB until I settled with Aria.</p>
<p>Then came the switch. The latency was significantly lowered down (reduced by more than 50% on most users). The only problem was the higher-than-usual server load (as compared to our old server with 16 processor threads) which I fear would slow down the SQL queries (which is bad for a realtime app like a penny auction site) on peak hours.</p>
<p>Fearful of <em>the slowdown</em>, I decided to get another server on the same location. I configured the second server as the SQL server while the other one will be used solely as a web server. Since they are on the same location, I set up a private network for the two machines so that they exist in one logical network and one LAN.</p>
<p>With the new set-up (dedicated machine for SQL and another one for web serving), I was able to reduce the server load on the web server. The SQL server was also running very fine, in fact based on my tests the execution time for my most complex query was reduced to as much as 40%.</p>
<h3>Other stuff I did</h3>
<p>Since BiliBid is a time-sensitive web application, there is no room for slowdown. I had to:</p>
<ul>
<li>Optimize my cron job that runs every minute. I had to tweak it to only update information that needs to be updated, ignore others. Previously, it processes all my entities. Since the number of entities grow over time (new signups daily, new auctions, etc), I found it inefficient.</li>
<li>Remove all system cron jobs. On a fresh install of most Linux distros, it automatically adds cron jobs for maintenance tasks. I had to remove them since a maintenance task could possibly slow down BiliBid. This equates to disaster if it runs on a peak hour or if there&#8217;s an active auction. I decided to manually run this maintenance tasks during off-peak hours.</li>
<li>Made RRDTool graphs on the latency to make monitoring easier.</li>
</ul>
<p>I really hope the stuff I did recently will work well. Until now, I continue to experiment different configurations to check the most efficient one.</p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/art-scaling/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trying to solve an upcoming problem</title>
		<link>http://conradmiguel.com/solve-upcoming-problem</link>
		<comments>http://conradmiguel.com/solve-upcoming-problem#comments</comments>
		<pubDate>Fri, 23 Sep 2011 11:48:14 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[BiliBid]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bilibid]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1740</guid>
		<description><![CDATA[Since BiliBid started, I’ve encountered and foreseen problems that may affect the experience of the bidders. I’ve done preventive measures to counter the problems I’ve identified. As BiliBid continues to grow, I foresee new problems that may arise. Most of them are due to concurrency (users accessing the same resource at the same moment). I [...]]]></description>
			<content:encoded><![CDATA[<p>Since BiliBid started, I’ve encountered and foreseen problems that may affect the experience of the bidders. I’ve done preventive measures to counter the problems I’ve identified.</p>
<p>As BiliBid continues to grow, I foresee new problems that may arise. Most of them are due to concurrency (users accessing the same resource at the same moment). I have to tweak and optimize my code and queries from time to time to make it as efficient as possible, while maintaining correctness.</p>
<p>Testing the changes is even harder. It’s hard to replicate a potential problem, since first and foremost it does not entail a single request only. It’s a combination of continuous requests (for the timer, messages, and bid history) and user-triggered requests (placing a bid) from multiple clients. At times, there’s no assurance that the changes I’ve made will prevent those problems from happening. What I do is just convince myself that the changes I’ve made were for the better. Once convinced, I deploy it to the production server and hope for the best.</p>
<p>Maintaining BiliBid is not as easy as it may seem. It requires attention especially during the first bidding night after changes were committed. I have to trust on my gut feeling to decide whether to rollback the changes or not.</p>
<p>On the lighter note, I see this strenuous task of maintaining BiliBid as a learning experience. I learned a lot from BiliBid alone. For the love of BiliBid, I’ve read a lot of articles on server hardening, tweaking database and web servers and other related stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/solve-upcoming-problem/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Coins, ADHD, etc</title>
		<link>http://conradmiguel.com/coins-adhd-etc</link>
		<comments>http://conradmiguel.com/coins-adhd-etc#comments</comments>
		<pubDate>Tue, 14 Dec 2010 21:35:43 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[adhd]]></category>
		<category><![CDATA[coins]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1671</guid>
		<description><![CDATA[I am the kind of person who really hates sticking into a routine. Everyday, I try to inject something new in my life. I do a lot of different stuff. I also read a lot of random stuff, excluding fiction. As I was skimming the Top 500 Non-individual Taxpayers of 2009 earlier tonight, I happened [...]]]></description>
			<content:encoded><![CDATA[<p>I am the kind of person who really hates sticking into a routine. Everyday, I try to inject something new in my life. I do a lot of different stuff. I also read a lot of random stuff, excluding fiction.</p>
<p>As I was skimming the <a href="ftp://ftp.bir.gov.ph/webadmin1/pdf/topcorp_500_2009_rank_nov30_updated.pdf">Top 500 Non-individual Taxpayers of 2009</a> earlier tonight, I happened to notice Golden Arches Development Corporation at Rank 95. Golden Arches is the corporation behind McDonald&#8217;s Philippines. Because of that, my stomach began growling but as far as I knew then I only had 20 pesos in my pocket.</p>
<p>As time passed, my hunger intensified. Hungry, I searched for the room for coins. I found coins on the floor, my bag, the cabinet, among others. I was able to collect 11 <em>5-peso coins</em>, 146 <em>1-peso coins</em> and 8 <em>25-centavo coins</em> (which one of them I later discovered to be a 1964 <em>5-centavo coin</em>).</p>
<p>Crazy as it may sound, even though I can already afford to eat at McDonald&#8217;s already I decided to sort the coins according to year before eating. First thing I did was to create a MySQL database for it. Then I wrote the PHP app where I&#8217;ll encode the coins. After which I started encoding data for my 1-peso coins. I made sure that the data in the database are correct by checking it on my physical count every ten coins. I failed to encode the year of one <em>1-peso coin</em> since it was already mutilated to the point the year is not recognizable already.</p>
<p>Here&#8217;s the result in coin-graph:<br />
<a href="http://conradmiguel.com/wp-content/uploads/2010/12/graph.jpg"><img class="aligncenter size-medium wp-image-1672" title="Coin Graph" src="http://conradmiguel.com/wp-content/uploads/2010/12/graph-500x107.jpg" alt="" width="500" height="107" /></a></p>
<p>And here&#8217;s the dump from MySQL sorted by year and by frequency:<br />
<a href="http://conradmiguel.com/wp-content/uploads/2010/12/data.png"><img class="aligncenter size-full wp-image-1674" title="Year frequency data" src="http://conradmiguel.com/wp-content/uploads/2010/12/data.png" alt="" width="355" height="266" /></a></p>
<p>As you may notice, among the 145 <em>1-peso coins</em> I had no 2005 1-peso coin. Oldest coins minted back in 1995 whilst my latest coins in 2010. As expected, 2010 coins took the lead. I can&#8217;t seem to understand why I got a lot of 2004 coins. I speculate that the Central Bank over-minted coins in 2004 to the point that they halted production for 2005. Another observation was that all of my coins minted from 2004 onwards were magnetic. I also got 3 magnetic 2003 <em>1-peso coins </em>out of the 10 I have in possession.</p>
<p>Enough of those coin stuff. Way back in high school, some of my classmates and even teachers suspect that I have ADHD (<a href="http://en.wikipedia.org/wiki/Attention_deficit_hyperactivity_disorder">Attention Deficit Hyperactivity Disorder</a>). I tried running through the <a href="http://en.wikipedia.org/wiki/Attention_deficit_hyperactivity_disorder#Signs_and_symptoms">symptoms of ADHD</a> in Wikipedia and now I&#8217;m diagnosing myself with ADHD. Hahaha.</p>
<p>Here&#8217;s the list of symptoms (those highlighted in blue are the things that apply to me [I think]):</p>
<ul>
<li><span style="color: #0000ff;">Be easily distracted, miss details, forget things, and frequently switch from one activity to another</span></li>
<li><span style="color: #0000ff;">Have difficulty maintaining focus on one task</span></li>
<li><span style="color: #0000ff;">Become bored with a task after only a few minutes, unless doing something enjoyable <span style="color: #000000;">[sorting coins is enjoyable!!]</span></span></li>
<li><span style="color: #0000ff;">Have difficulty focusing attention on organizing and completing a task or learning something new or trouble completing or turning in homework assignments, often losing things (e.g., pencils, toys, assignments) needed to complete tasks or activities</span></li>
<li><span style="color: #0000ff;">Not seem to listen when spoken to</span> [rarely]</li>
<li>Daydream, become easily confused, and move slowly</li>
<li>Have difficulty processing information as quickly and accurately as others</li>
<li>Struggle to follow instructions</li>
<li><span style="color: #0000ff;">Fidget and squirm in their seats</span></li>
<li><span style="color: #0000ff;">Talk nonstop </span>[do I need to elaborate on this???]</li>
<li><span style="color: #0000ff;">Dash around, touching or playing with anything and everything in sight</span> [and everyone, LOL]</li>
<li><span style="color: #0000ff;">Have trouble sitting still during dinner, school, and story time</span></li>
<li><span style="color: #0000ff;">Be constantly in motion</span></li>
<li><span style="color: #0000ff;">Have difficulty doing quiet tasks or activities</span></li>
<li><span style="color: #0000ff;">Be very impatient</span></li>
<li><span style="color: #0000ff;">Blurt out inappropriate comments, show their emotions without restraint, and act without regard for consequences</span></li>
<li><span style="color: #0000ff;">Have difficulty waiting for thingI think my friends would agree on me s they want or waiting their turns in games </span></li>
</ul>
<p>There you go. If you know me well I think you&#8217;ll have to agree with me. On the Wikipedia article, it also says &#8220;Untreated adults with ADHD often have chaotic lifestyles, may appear to be disorganized and may rely on non-prescribed drugs and alcohol to get by.&#8221; LOL.</p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/coins-adhd-etc/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Graphing my sleep</title>
		<link>http://conradmiguel.com/graphing-my-sleep</link>
		<comments>http://conradmiguel.com/graphing-my-sleep#comments</comments>
		<pubDate>Mon, 25 Oct 2010 22:53:10 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[sleep]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1666</guid>
		<description><![CDATA[Hello guys. I&#8217;m finally in General Santos City (GenSan) now for semestral break. Since it&#8217;s one of the few moments of the year when I can do pretty much anything I want to do, I did not waste this opportunity to bring back the geek in me. Sleep Cycle iPhone app. I also have my [...]]]></description>
			<content:encoded><![CDATA[<p>Hello guys. I&#8217;m finally in General Santos City (GenSan) now for semestral break. Since it&#8217;s one of the few moments of the year when I can do pretty much anything I want to do, I did not waste this opportunity to bring back the geek in me.</p>
<p><center><img src="http://conradmiguel.com/wp-content/uploads/2010/10/500x_sfdt0984w5i.jpg" alt="" title="Sleep Cycle" width="500" height="360" class="aligncenter size-full wp-image-1667" /><br /><small>Sleep Cycle iPhone app. I also have my own sleep graph, as seen way below this one</small></center></p>
<p>Before I left Manila for GenSan, I read this article from Lifehacker about the <a href="http://lifehacker.com/5671930/five-best-mobile-alarm-apps">Five Best Mobile Alarm Apps</a>. One alarm caught my attention, the <a href="http://mdlabs.se/sleepcycle/">Sleep Cycle</a>. Sadly, there wasn&#8217;t an Sleep Cycle for Android; only for iPhone. Being obsessed with data, the only thing I wanted was the raw data in order to make a graph. And so I decided to make a prototype application for it.</p>
<p>Developing it was pretty easy. I just googled for a sample code in detecting movements using an Android phone&#8217;s accelerometer. <a href="http://www.clingmarks.com/?p=25">The one I found</a> was pretty much straightforward but I had to modify some equations most especially the ones described as the <code>speed</code>.</p>
<p>I had to experiment with different movement threshold values for the sensitivity until I found the one I think would suit my needs. I also had to experiment on the time intervals between recording of raw data. In storing the raw data, I had to decide whether to store only the timestamp of the start time then the raw values after each interval OR store the timestamp and the raw value in each time interval. I decided to implement the first one for my first dry-run.</p>
<p>Once I thought everything was alright (I started at 2am and ended by around 7am leaving me with no night sleep), I decided to give it a shot by actually sleeping with the app. When I woke up, I excitedly tried to analyze the data but sadly the phone measured way more data than expected. I decided to just discard the data and debug the app. This was the time I decided to use the latter in storing the data. Store the timestamp plus raw data for each time interval.</p>
<p><center><img src="http://conradmiguel.com/wp-content/uploads/2010/10/speed-500x200.png" alt="" title="speed" width="500" height="200" /></center></p>
<p>So that night (actually last night), I decided to sleep with the app again. Upon waking up earlier today, I tried to check the data and it seemed that it recorded the data the way I expected it to. I immediately tried to learn how to use the RRDtool (Round Robin Database tool) so that I can feed it with the data and finally come up with a graph. In no time, I got a visualization of my sleep, as seen above.</p>
<p>You can see from the graph that I entered sleep at around 12:20am and woke up at 4:50am. Also evident are the parts where my movements were higher than usual, probably the times I was dreaming. For the next few sleeps, I&#8217;m planning to feed them the data directly on my laptop instead of having it stored on the phone then later transferred to my laptop. I will make a portal where my sleeping activity is readily available on the Internet in realtime using PHP, a cron job and Dynamic DNS for domain resolution to my network.</p>
<p>I haven&#8217;t felt this geek for a while and I&#8217;m happy to be one again even just for this project. I am looking forward to making more geek stuff, preferably with Android.</p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/graphing-my-sleep/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Summer of Code</title>
		<link>http://conradmiguel.com/my-geek-summer</link>
		<comments>http://conradmiguel.com/my-geek-summer#comments</comments>
		<pubDate>Sat, 29 May 2010 12:35:48 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1643</guid>
		<description><![CDATA[Summer isn&#8217;t over yet but I&#8217;m afraid that this summer season will be my first summer without experiencing saltwater. I spent most of my summer taking summer classes (Physics 72 and PE 2 Weight Training). Aside from that, I spent a some chunk of my time in DilNet Help Desk answering phone techs, fixing networking [...]]]></description>
			<content:encoded><![CDATA[<p>Summer isn&#8217;t over yet but I&#8217;m afraid that this summer season will be my first summer without experiencing saltwater.</p>
<p>I spent most of my summer taking summer classes (Physics 72 and PE 2 Weight Training). Aside from that, I spent a some chunk of my time in DilNet Help Desk answering phone techs, fixing networking problems on-site and fooling around with my co-applicants and student assistants. I also attended some interest-related events such as the <a href="http://conradmiguel.com/unplug-precinct-mapping-party">UnPLUG Precinct Mapping Party</a> and <a href="http://ubuntu.com">Ubuntu 10.04</a> Release Party.</p>
<p>The final leg of my summer, for me, was the most exciting. I accidentally got involved in a project while eating with my DilNet friends at a food stall near the Main Library. We had to develop an application to be used by a unit in UP.</p>
<p>Developing the app was exciting. Although I had previous experience with <a href="http://codeigniter.com/">CodeIgniter</a> (a PHP web-app framework that uses the <a href="http://en.wikipedia.org/wiki/Model–view–controller">MVC architectural pattern</a>), it was my first time to use it for an actual project. It was my first time to use  <a href="http://jquery.com">jQuery</a> since the project required some realtime checking of constraints.</p>
<p>I also experienced roadblocks in making my part of the project. Three days before the deadline everything I coded for around a week got lost. After doing some research, I can attribute the loss of my folder to the way <a href="http://en.wikipedia.org/wiki/Ext4">ext4</a> writes a file. I also found some solutions on how to recover my folder but I decided to do it again from scratch since recovering it will entail more work than actually rewriting the code. Here&#8217;s a more <a href="http://www.h-online.com/open/news/item/Ext4-data-loss-explanations-and-workarounds-740671.html">detailed explanation on what might have happened to me</a>.</p>
<p>To catch up, I had to do some sort of coding marathon. I was awake for some 57 hours minus some short naps. During that time, I learned a lot from my co-developer.</p>
<p>It was a very fun experience and I am looking forward to working on more projects in the future.</p>
<p>And up to now, I am still looking forward for a beach outing. XD</p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/my-geek-summer/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Searchable UPCAT 2010 Results, Student Number Database, etc</title>
		<link>http://conradmiguel.com/searchable-upcat-2010-results-student-number-database-etc</link>
		<comments>http://conradmiguel.com/searchable-upcat-2010-results-student-number-database-etc#comments</comments>
		<pubDate>Mon, 18 Jan 2010 11:38:23 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[upcat]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1575</guid>
		<description><![CDATA[UPCAT 2010 Results (University of the Philippines College Admission Test) were released earlier today, January 18, 2010 both online and offline. The new official results page is now non-searchable, I wonder why. But that&#8217;s not a problem because I made a searchable version of the one&#8217;s in the UP website. I also made a super [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPCAT </strong><strong>2010</strong><strong> Results</strong> (University of the Philippines College Admission Test) were released earlier today, January 18, 2010 both online and offline.</p>
<p><a href="http://mikko.podzone.net/upcat10"><img class="alignnone size-full wp-image-1576" title="UPCAT 2010 Results" src="http://conradmiguel.com/wp-content/uploads/2010/01/Screenshot-1.jpg" alt="" width="500" height="235" /></a></p>
<p>The new official results page is now non-searchable, I wonder why. But that&#8217;s not a problem because I made a <a href="http://mikko.podzone.net/upcat10">searchable version</a> of the one&#8217;s in the UP website.</p>
<p><a href="http://mikko.podzone.net/pasadohindi"><img class="alignnone size-full wp-image-1577" title="Pumasa ba?" src="http://conradmiguel.com/wp-content/uploads/2010/01/Screenshot-5.jpg" alt="" width="500" height="381" /></a></p>
<p>I also made a super <a href="http://mikko.podzone.net/pasadohindi">lightweight web app that checks if your 2010 counterpart passed UPCAT or not</a>. In my case, 201041437 either didn&#8217;t pass, still has deficiences or a pending case. His or her name was not on the list. <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Aside from this, I also made another one last night which is not related to UPCAT. It&#8217;s a <a href="http://mikko.podzone.net/studnum">searchable database of UP student numbers</a>. I got those student numbers from various sources from the Internet, including past UPCAT results. Hahaha.</p>
<p>I really missed scripting. <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  All those stuff above are hosted on my laptop therefore they&#8217;ll be down whenever my laptop is sleeping. LOL.</p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/searchable-upcat-2010-results-student-number-database-etc/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The 2009 ACM-ICPC Asia Regionals Experience</title>
		<link>http://conradmiguel.com/the-2009-acm-icpc-asia-regionals-experience</link>
		<comments>http://conradmiguel.com/the-2009-acm-icpc-asia-regionals-experience#comments</comments>
		<pubDate>Fri, 23 Oct 2009 17:05:19 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[acm-icpc]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1531</guid>
		<description><![CDATA[Several hours ago was the 2009 ACM-ICPC Asia Regionals Manila Site hosted by the Ateneo de Manila University. ACM-ICPC is a programming contest in which college students are to solve a certain number of problems in a limited number of time, in yesterday&#8217;s contest ten problems in five hours. UP Diliman had ten teams in [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://conradmiguel.com/wp-content/uploads/2009/10/top.JPG"><img class="size-medium wp-image-1537 aligncenter" title="ACM ICPC" src="http://conradmiguel.com/wp-content/uploads/2009/10/top-500x231.jpg" alt="ACM ICPC" width="500" height="231" /></a></p>
<p>Several hours ago was the <strong>2009 <acronym title="Association for Computing Machinery International Collegiate Programming Contest">ACM-ICPC</acronym> Asia Regionals Manila Site</strong> hosted by the Ateneo de Manila University. ACM-ICPC is a programming contest in which college students are to solve a certain number of problems in a limited number of time, in yesterday&#8217;s contest <strong>ten problems</strong> in <strong>five hours</strong>. </p>
<p><strong>UP Diliman</strong> had ten teams in total, seven <strong>SOGO teams</strong> from the University of the Philippines Programming Guild and three teams from the UPD Department of Computer Science. I was a member of one of the SOGO teams, the <strong>SOGO Virgins</strong>.</p>
<h3>Results, results and results!!</h3>
<p style="text-align: center;"><a href="http://conradmiguel.com/wp-content/uploads/2009/10/cert.JPG"><img class="alignnone size-medium wp-image-1536" title="ACM-ICPC" src="http://conradmiguel.com/wp-content/uploads/2009/10/cert-500x375.jpg" alt="ACM-ICPC" width="500" height="375" /></a></p>
<p>Our team only ranked <strong>26th out of the 55 teams</strong>, which was quite disappointing. Among the 10 problems given, we only had three accepted solutions out of the five problems we attempted.</p>
<p><strong>The champion was from our guild (UPPG), the <em>Mga SOGO ni E.T.</em>.</strong> They solved all 10 problems in 1 hour and 59 minutes. They will be competing for the World Finals this February 1 to 6, 2009 at Harbin University in China. Other teams who solved all 10 problems sorted by time were teams from Ho Chi Minh City University of Science, National University of Singapore, Hong Kong University of Science and Technology and another team from UP Programming Guild, <em>SOGOng Long Ong Moy Poso</em>. The freshie team (<em>2 Young 2 SOGO</em>) from our guild beat us as they solved 5 problems in all. Woot! <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  For detailed results, you may check out the <a href="http://raffysaldana.blogspot.com/2009/10/2009-acm-icpc-asia-manila-regional.html">contest director&#8217;s blog</a>.</p>
<h3>Problems encountered!</h3>
<p><strong>Experience is the best teacher.</strong> We encountered problems on some problems. <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Problem A.</strong> Given three points on a parabola, <strong>get the maximum height of the parabola</strong>. Since we don&#8217;t have a mathematician in the team, we had a hard time finding an equation with degree one for all variables. We had to force one of our teammate (out of 3) to squeeze all his knowledge on parabolas. When he found one, I immediately coded <strong>Gaussian Elimination Method</strong> for two variables and two equations. Gladly, our solution was correct thus <strong>accepted</strong> by the judges.</p>
<p><strong>On the summation problem,</strong> we got correct answers for the sample inputs but it was too slow that testing it on borderline cases (worst case scenarios) won&#8217;t yield a result in a reasonable amount of time. Since no one in our team was a mathematician, we had trouble limiting our search space. <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Our program was so inefficient but right that we were not able to have our solution accepted.</p>
<p>The other problem we attempted was the <strong>A(H1N1) problem</strong>. Given a set of N people in a community with their locations and radius of contact and a person infected by A(H1N1), we had to compute the number of levels of transmission until the virus is contained. We recognized that it was a graph problem; people as nodes then connect an edge to nodes within the radius of contact of an infected person. We just have to perform a <strong>BFS (Breadth-First Search)</strong> on the graph and find the  level distance from the root to find the maximum level of transmission.</p>
<p>The algorithm above was correct but I made a mistake in coding BFS. I colored the node after dequeuing it from the queue instead of coloring it while putting it on the queue as seen in my code below.</p>
<p style="text-align: center;"><img class="size-full wp-image-1532 aligncenter" title="Breadth-First Search" src="http://conradmiguel.com/wp-content/uploads/2009/10/bfs.JPG" alt="Breadth-First Search" width="498" height="333" /></p>
<p>Damn. I admit that it was my fault, not anyone else&#8217;s. Hmmmmf. <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Waaaaaa. What a shame. On the other side, it still yielded the correct answer for the sample input.</p>
<h3>Lessons Learned</h3>
<ul>
<li><strong>Never spend too much time on a single problem.</strong> We spent too much time debugging the A(H1N1) problem.</li>
<li><strong>A team needs a mathematician. </strong>There were quite a number of Math problems. We were only able to solve one out of all the Math problems.</li>
</ul>
<h3>Random Stuff</h3>
<p>Even though we did not rank well, I was still happy of the outcome. Because of this contest, I will never forget BFS anymore! Hahahaha.</p>
<p>I am looking forward to joining the same contest for the next years if fate will permit. <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/the-2009-acm-icpc-asia-regionals-experience/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Calling all geeks out there!</title>
		<link>http://conradmiguel.com/calling-all-geeks-out-there</link>
		<comments>http://conradmiguel.com/calling-all-geeks-out-there#comments</comments>
		<pubDate>Wed, 04 Mar 2009 12:33:34 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[acm-icpc]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1300</guid>
		<description><![CDATA[I admit that I am bitter with the results of the Mensa IQ Challenge I took sometime last month. It was a BIG slap on my face, after self-proclaiming myself as a geek. I don&#8217;t believe you have to pass Mensa to be a full-pledged full-fledged (as corrected by Aldrin, point well taken) geek. Hahaha. [...]]]></description>
			<content:encoded><![CDATA[<p>I admit that I am bitter with the results of <a href="http://conradmiguel.com/i-took-mensa-waaaaa">the Mensa IQ Challenge I took</a> sometime last month. It was a BIG slap on my face, after self-proclaiming myself as a geek. I don&#8217;t believe you have to pass Mensa to be a <span style="text-decoration: line-through;">full-pledged</span> full-fledged (as corrected by <a href="http://www.gawbler.com/">Aldrin</a>, point well taken) geek. Hahaha. Here&#8217;s something geekier than Mensa.</p>
<p>After two sessions of training on our new &#8220;programming guild&#8221;, I&#8217;ve encountered tons of intellectually challenging programming problems. The spectrum of problems were very wide; from counting descendants of a person in a family tree, to beating a greedy opponent on a game, to getting the height of a rocket model using three ground observers using a theodolite, and the list goes on and on.</p>
<p>I admit those problems were new to me and I think it was the best answer for my hunger for knowledge. Those problems squeezed my neurons to the highest level, thus greasing up my brain. Those were the problems that made me realize I still have a lot lot lot more to learn. I mean, A LOT!</p>
<p><a href="http://cm2prod.baylor.edu/"><img class="size-full wp-image-24 aligncenter" title="ACM-ICPC logo" src="http://conradmiguel.com/wp-content/uploads/2009/03/cm2-logo-panel_joel_medium.png" alt="ACM-ICPC logo" width="241" height="112" /></a></p>
<p>To all other geeks out there who have a background on any programming language (preferably C or Java), I dare you to solve the <a href="http://cm2prod.baylor.edu/public/worldmap/index.jsf?_afPfm=63453fab">problems on real ACM International Collegiate Programming Competition</a> (ACM-ICPC). There are a lot of problems available there from ACM-ICPC contests around the globe.</p>
<p>So far, I have only solved four ACM-ICPC problems. My goal is to solve at least one per night. Good luck to me and have fun with those problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/calling-all-geeks-out-there/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I&#8217;m part of the world&#8217;s Top 3% + New Knowledge</title>
		<link>http://conradmiguel.com/im-part-of-the-worlds-top-3-new-knowledge</link>
		<comments>http://conradmiguel.com/im-part-of-the-worlds-top-3-new-knowledge#comments</comments>
		<pubDate>Fri, 27 Feb 2009 16:32:05 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[DilNet]]></category>
		<category><![CDATA[mensa]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1169</guid>
		<description><![CDATA[Last Sunday, I took the Mensa IQ Challenge at Fully Booked in Bonifacio High Street, Taguig City. The first 30 items of the exam were super easy that missing out a point for a problem was a big deal. The next items (I won&#8217;t say how many) were moderate. The only enemy I had was [...]]]></description>
			<content:encoded><![CDATA[<p>Last Sunday, <a href="http://conradmiguel.com/i-took-mensa-waaaaa">I took the Mensa IQ Challenge</a> at Fully Booked in Bonifacio High Street, Taguig City. The first 30 items of the exam were super easy that missing out a point for a problem was a big deal. The next items (I won&#8217;t say how many) were moderate. The only enemy I had was the SUPER limited time.</p>
<blockquote><p>The only criterion for membership in Mensa, is to score within the top 2 percent (98th percentile and up) on an accepted and properly supervised qualifying test. -<a href="http://www.mensaphilippines.org/">Mensa Philippines website</a></p></blockquote>
<p>Earlier today, the unofficial result of the 2.22 exam was released via web. Mensa posted the <a href="http://www.mensaphilippines.org/2008/10/031.html">good</a> and <a href="http://www.mensaphilippines.org/2008/10/032.html">bad</a> news. To maintain a level of privacy, they posted the codenames we picked from a fishbowl before the exam. My lucky word was MAGELLAN. Waaaaaaaa.</p>
<p>After checking the super cool good and bad news, I found out that <strong>I belong to the world&#8217;s top 3% IQ-wise</strong>. Hahahaha. Yes, I am a genius.</p>
<p>Yes I am a genius.</p>
<p>I am a genius.</p>
<p>Yeah, right!</p>
<p style="text-align: center;"><a href="http://xkcd.com/424/"><img class="size-full wp-image-1172 aligncenter" title="Security Holes" src="http://conradmiguel.com/wp-content/uploads/2009/02/security_holes.png" alt="Security Holes" width="493" height="527" /></a></p>
<p>Anyway, proceeding to the next item I&#8217;ll be sharing. I&#8217;ve recently shared to you that I have a <a href="http://conradmiguel.com/in-need-of-expanding-my-knowledge">hunger for knowledge</a> and today, I was fortunate enough to learn something new. I love learning new things! It was a file transfer thru SSH crash course. <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>My orgmates asked me to generate reports of the recently concluded <a href="http://usc2009.uplug.org/">Computerized University Elections</a> here in UP Diliman. All they gave me were the login credentials of the server where the database was stored and the I.P. address.</p>
<p>The account they gave me did not have any write access to the www folder so uploading the script thru FTP and dumping the results thru HTTP was not an option. I asked for more options and one of them suggested that I use SSH. What the heck?! I&#8217;ve never used SSH for uploading and downloading files, seriously. I never thought it was possible.</p>
<p>Since the only thing I knew was to login to the server thru <a href="http://en.wikipedia.org/wiki/Ssh">SSH</a>, I had to ask for help. Gladly, kuya Prem extended his help despite his busy schedule. I was also able to apply my newly acquired (last year) Linux shell skills like dumping something to a file. It was so much fun.</p>
<p><strong>Yey, I am a genius. Yes I am a genius! I AM A GENIUS!! Mikko is a GENIUS!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/im-part-of-the-worlds-top-3-new-knowledge/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>In need of expanding my knowledge</title>
		<link>http://conradmiguel.com/in-need-of-expanding-my-knowledge</link>
		<comments>http://conradmiguel.com/in-need-of-expanding-my-knowledge#comments</comments>
		<pubDate>Tue, 17 Feb 2009 17:32:11 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[geek stuff]]></category>

		<guid isPermaLink="false">http://conradmiguel.com/?p=1159</guid>
		<description><![CDATA[(from XKCD) Offtopic: In line with the comics above, I always find my self in the same situation. I love to do this with plate numbers. These past few months were the most dormant periods of my geekiness. I badly need to expand my knowledge. I have hunger for knowledge. Some people may find it [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://xkcd.com/247/"><img class="size-full wp-image-1160 aligncenter" title="Geek" src="http://conradmiguel.com/wp-content/uploads/2009/02/factoring_the_time.gif" alt="Geek" width="500" height="437" /><br />
(from XKCD)</a></p>
<p><em>Offtopic: In line with the comics above, I always find my self in the same situation. I love to do this with plate numbers. <img src='http://conradmiguel.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </em></p>
<p>These past few months were the most dormant periods of my geekiness. I badly need to expand my knowledge.</p>
<p><strong>I have hunger for knowledge</strong>. Some people may find it weird but it&#8217;s actually true. It&#8217;s fun to have passion for learning stuff you&#8217;re interested to. Don&#8217;t think of me as a college nerd reading all those Bio, Chem and Physics books. I&#8217;m not interested on those stuff  except those rare moments when I felt geek enough to make simulation of scientific concepts (so far, I&#8217;ve made a simulation for freefall and projectile, road traffic and matrix multiplication).</p>
<p>The latest bit of geekiness I got was from my Computer Science class. It&#8217;s only this semester when I got a pretty good picture of real Object Oriented Programming. I knew about it before but I only had the chance to get a clearer picture of it on our class.</p>
<p>Currently, I&#8217;m interested on studying Python, Ruby on Rails and JSP. I&#8217;m tired of PHP, seriously. I&#8217;ve been obsessed with the language since I learned it three or four years ago. I&#8217;m also interested on making an application using any API. I&#8217;m thinking of making a web application that has something to do with geographical information (so that I can use Google Maps) like generating a map, like a Map of Misfortune [I'll discuss this later].</p>
<p>The BIG problem now is where to start. Do I start with Ruby on Rails or what? That I still do not know. I need help.</p>
<p>To the other geeks, feeling geeks (like me), aspiring geeks, retired geeks and non-geeks out there, I need your suggestions. It could be a programming language or an API to explore. <strong>Please respond</strong> thru the comments section. I am THIS pathetic to expand my knowledge. Waaaaaaaaaaaaa.</p>
]]></content:encoded>
			<wfw:commentRss>http://conradmiguel.com/in-need-of-expanding-my-knowledge/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

