<?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>Programming Archives &#8211; Beer &amp; Skittles</title>
	<atom:link href="https://nelson.ph/archives/programming/feed/" rel="self" type="application/rss+xml" />
	<link>https://nelson.ph/archives/programming/</link>
	<description>Life is not all beer and skittles</description>
	<lastBuildDate>Fri, 01 May 2020 03:56:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
<site xmlns="com-wordpress:feed-additions:1">177521838</site>	<item>
		<title>Downloading Files using PHP</title>
		<link>https://nelson.ph/2020/04/downloading-files-using-php/</link>
					<comments>https://nelson.ph/2020/04/downloading-files-using-php/#respond</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Sat, 18 Apr 2020 02:28:36 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://nelson.ph/?p=1859</guid>

					<description><![CDATA[<p>Last week I revamped my anime collective and among the changes was the removal of the lightbox when downloading an avatar. Naturally came across countless solutions on the Innernet but nothing compared to how PHP Tutorial Point handled it. The fewest lines but the most readable! $file = "vaccines/covid19.pdf"; header("Content-Type: " . filetype($file)); header("Content-Length: " [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2020/04/downloading-files-using-php/">Downloading Files using PHP</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Last week I revamped my <a href="https://akiba.flirt-wind.net/39-self-isolation-stats/">anime collective</a> and among the changes was the removal of the lightbox when downloading an avatar. Naturally came across countless solutions on the Innernet but nothing compared to how <a href="https://www.phptpoint.com/how-to-download-file-in-php/">PHP Tutorial Point</a> handled it. The fewest lines but the most readable!</p>
<pre class="EnlighterJSRAW" data-enlighter-language="php">$file = "vaccines/covid19.pdf";
header("Content-Type: " . filetype($file));
header("Content-Length: " . filesize($file));
header("Content-Disposition: attachment; filename=" . basename($file));
readfile($file);
</pre>
<p>Make sure that the path to the file is relative to the file where the code is.</p>
<p>The post <a href="https://nelson.ph/2020/04/downloading-files-using-php/">Downloading Files using PHP</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2020/04/downloading-files-using-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1859</post-id>	</item>
		<item>
		<title>Renaming Photos by Timestamp</title>
		<link>https://nelson.ph/2016/10/renaming-photos-by-timestamp/</link>
					<comments>https://nelson.ph/2016/10/renaming-photos-by-timestamp/#respond</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Tue, 18 Oct 2016 08:15:55 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://nelson.ph/?p=1649</guid>

					<description><![CDATA[<p>Including my cellphone, I used to have three cameras (used because my waterproof one died on me right after my recent trip to Palawan). Most smartphones already save photos with timestamps as the filenames but as for digital cameras, as far as I know, it&#8217;s not really the case. In general, the file naming convention [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2016/10/renaming-photos-by-timestamp/">Renaming Photos by Timestamp</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Including my cellphone, I used to have three cameras (<em>used</em> because my waterproof one died on me right after my recent trip to Palawan). Most smartphones already save photos with timestamps as the filenames but as for digital cameras, as far as I know, it&#8217;s not really the case. In general, the file naming convention varies from one device to another. The lines in Java that follow are not really anything special; it just reads the <strong>Last Modified</strong> metadata and uses it as the filename. I&#8217;ve been using this for quite some time now just because I want to be able to view photos chronologically once I consolidate them from multiple devices. That simple. Okay, and a bit of an OCD, too.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">String dirName = "C:/Photos/Maldives"; //in my dreams
String fileNameExt = ".jpg"; //JPEG format
String fileNamePref = "RIMG"; //just blank to rename all photos
String fileNameFmt = "yyyyMMdd_HHmmss"; //e.g. 20161018_161534 for October 18, 2016 4:15:34 PM (should be unique enough!)

File directory = new File(dirName);
File[] photos = directory.listFiles();

for(File photo : photos) {
   String filename = photo.getName();

   if(filename.toLowerCase().endsWith(fileNameExt) &amp;&amp; filename.startsWith(fileNamePref)) {
      SimpleDateFormat sdf = new SimpleDateFormat(fileNameFmt);
      String newFilename = sdf.format(photo.lastModified()) + fileNameExt;
      File renamedPhoto = new File(photo.getParent() + "/" + newFilename);

      if(!photo.renameTo(renamedPhoto)) {
         System.out.println("Failed to rename: " + photo.getAbsolutePath());
      }
   } else {
      System.out.println("Not a " + fileNamePref + "*" + fileNameExt + ": " + photo.getAbsolutePath());
   }
}
</pre>
<p>This is under the assumption that the date and time in your devices have been set correctly. Different time zones are no longer within the scope of this post but is accommodated in—apparently someone already thought of the same—<a href="http://www.angelfire.com/id/robpurvis/devnotes/renaming-jpeg-files-with-date-time-stamp.html" target="_blank" rel="noopener noreferrer nofollow" class="broken_link">Renaming jpeg files with date+time stamp</a>. Ideally, all photos should be renamed successfully since no two photos can be taken at exactly the same time (burst shots are another story). But with multiple cameras, there can simply be conflict sometimes. Lastly, you should be careful when copying or moving photos because sometimes the <strong>Last Modified</strong> data are changed to the date you copied or moved them. Should that be the case, the given source code no longer holds any value.</p>
<p>The post <a href="https://nelson.ph/2016/10/renaming-photos-by-timestamp/">Renaming Photos by Timestamp</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2016/10/renaming-photos-by-timestamp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1649</post-id>	</item>
		<item>
		<title>Printing XYZ in Java using Asterisks</title>
		<link>https://nelson.ph/2014/03/printing-xyz-in-java-using-asterisks/</link>
					<comments>https://nelson.ph/2014/03/printing-xyz-in-java-using-asterisks/#respond</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Tue, 25 Mar 2014 15:23:12 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://log.flirt-wind.net/?p=1527</guid>

					<description><![CDATA[<p>Assumption is that dimension should always be an odd number (you have to be able to have immediately understood why, else please stop reading this this instant). It&#8217;s accomplished using brute force, because I just wanted to see it working and prove to myself that I haven&#8217;t gone totally rusty yet. package letter; public class [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2014/03/printing-xyz-in-java-using-asterisks/">Printing XYZ in Java using Asterisks</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Assumption is that dimension should always be an odd number (you have to be able to have immediately understood why, else please stop reading this this instant). It&#8217;s accomplished using brute force, because I just wanted to see it working and prove to myself that I haven&#8217;t gone totally rusty yet.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">package letter;

public class LetterGenerator {
   public static void main(String[] args) {
      int dim = 7;

      for(int i = 0; i &lt; dim; i++) {
         for(int j = 0; j &lt; dim; j++) {
            if(i == j || i + j == dim - 1) {
               System.out.print("*");
            } else {
               System.out.print(" ");
            }
         }

         System.out.println();
      }

      System.out.println();

      for(int i = 0; i &lt; dim; i++) {
         for(int j = 0; j &lt; dim; j++) {
            if(((i == j || i + j == dim - 1) &amp;&amp; i &lt; dim / 2 + 1) || (i &gt; dim / 2 &amp;&amp; j == dim / 2)) {
               System.out.print("*");
            } else {
               System.out.print(" ");
            }
         }

         System.out.println();
      }

      System.out.println();

      for(int i = 0; i &lt; dim; i++) {
         for(int j = 0; j &lt; dim; j++) {
            if(i == 0 || i + j == dim - 1 || i == dim - 1) {
               System.out.print("*");
            } else {
               System.out.print(" ");
            }
         }

         System.out.println();
      }
   }
}
</pre>
<p>The post <a href="https://nelson.ph/2014/03/printing-xyz-in-java-using-asterisks/">Printing XYZ in Java using Asterisks</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2014/03/printing-xyz-in-java-using-asterisks/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1527</post-id>	</item>
		<item>
		<title>Generating Dates Between Start and End in Java</title>
		<link>https://nelson.ph/2012/08/generating-dates-between-start-and-end-in-java/</link>
					<comments>https://nelson.ph/2012/08/generating-dates-between-start-and-end-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Sat, 11 Aug 2012 05:14:42 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://log.flirt-wind.net/?p=1421</guid>

					<description><![CDATA[<p>Yesterday I had to generate a list of dates given two inputs. Having no Internet connection yet, I eagerly searched for help through my Android phone. Stack Overflow would&#8217;ve instantly helped me if I didn&#8217;t leave immediately after reading &#8220;Joda Time&#8221;. The thought of not needing some library for such an ideally simple task was [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2012/08/generating-dates-between-start-and-end-in-java/">Generating Dates Between Start and End in Java</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Yesterday I had to generate a list of dates given two inputs. Having no Internet connection yet, I eagerly searched for help through my Android phone. <a href="http://stackoverflow.com/questions/4534924/how-to-iterate-through-range-of-dates-in-java" target="_blank" rel="noopener noreferrer">Stack Overflow</a> would&#8217;ve instantly helped me if I didn&#8217;t leave immediately after reading &#8220;Joda Time&#8221;. The thought of not needing some library for such an ideally simple task was simply there. Then there was <a href="http://helpdesk.objects.com.au/java/how-can-i-iterate-through-all-dates-in-a-range" target="_blank" rel="noopener noreferrer">this</a>, which compiled but never ran. :faint:</p>
<p>In my case, the checking that the end date should be greater than the start date was already handled somewhere else so I already skipped it. Also, instead of actual Dates, I only needed Strings (but I do intend to convert this into a generic utility class). So, yeah, here you go:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd");
Calendar startDate = Calendar.getInstance();
Calendar endDate = Calendar.getInstance();

try {
   startDate.setTime(DATE_FORMAT.parse("2012/08/01"));
   endDate.setTime(DATE_FORMAT.parse("2012/08/10"));

   ArrayList&lt;String&gt; includedDates = new ArrayList&lt;String&gt;();

   while(!startDate.equals(endDate)) {
      String date = DATE_FORMAT.format(startDate.getTime());
      includedDates.add(date);
      startDate.add(Calendar.DATE, 1);
   } includedDates.add(DATE_FORMAT.format(endDate.getTime()));

   for(String date : includedDates) {
      System.out.println(date);
   }
} catch(Exception e) {}
</pre>
<p>Today I checked back on the supposedly second working solution I cited above, copy-pasted the code, and successfully ran it. :wtf:</p>
<p>The post <a href="https://nelson.ph/2012/08/generating-dates-between-start-and-end-in-java/">Generating Dates Between Start and End in Java</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2012/08/generating-dates-between-start-and-end-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1421</post-id>	</item>
		<item>
		<title>Open and Closed Hashing in C</title>
		<link>https://nelson.ph/2011/03/open-and-closed-hashing-in-c/</link>
					<comments>https://nelson.ph/2011/03/open-and-closed-hashing-in-c/#respond</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Thu, 17 Mar 2011 01:12:35 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<guid isPermaLink="false">http://log.flirt-wind.net/?p=951</guid>

					<description><![CDATA[<p>Again, I&#8217;m under the impression that you&#8217;ve done your assignment before coming here. I had this during my postgrad certification. Those were the bloody days that proved that my undergraduate years were nothing but a prelude to hell. Open: cells contain pointers to linked lists; collisions and a handful of inputs can be efficiently handled [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2011/03/open-and-closed-hashing-in-c/">Open and Closed Hashing in C</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Again, I&#8217;m under the impression that you&#8217;ve done your <a href="http://en.wikipedia.org/wiki/Hash_table" target="_blank" rel="noopener noreferrer">assignment</a> before coming here. I had this during my postgrad certification. Those were the bloody days that proved that my undergraduate years were nothing but a prelude to hell.</p>
<ul>
<li><strong>Open:</strong> cells contain pointers to linked lists; collisions and a handful of inputs can be efficiently handled
<pre class="EnlighterJSRAW" data-enlighter-language="c">/* point each cell to its respective (empty) Stack */
for(i = 0; i &lt; MAX_VALUE; i++) {
   Stack *s = malloc(sizeof(Stack));
   initStack(s);
   oh-&gt;cell[i] = s;
}
</pre>
</li>
<li><strong>Closed:</strong> cells can contain two elements; makes use of a rehashing function to constantly search for an available cell when a collision occurs
<pre class="EnlighterJSRAW" data-enlighter-language="c">for(i = 0; i &lt; MAX_VALUE; i++) {
   for(j = 0; j &lt; 2; j++) {
      ch-&gt;cell[i][j] = 0;
   }
}
</pre>
</li>
</ul>
<p>Input validation was kinda neglected (and I&#8217;m obviously not into adding them right now) so, children, refrain from inputting non-numeric keys, okay?</p>
<blockquote><p>
<strong><a href="https://nelsoft.org/files/code/Hush.zip">Hush.zip</a></strong></p></blockquote>
<p>The post <a href="https://nelson.ph/2011/03/open-and-closed-hashing-in-c/">Open and Closed Hashing in C</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2011/03/open-and-closed-hashing-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">951</post-id>	</item>
		<item>
		<title>Vigenere Cipher in Java</title>
		<link>https://nelson.ph/2010/08/vigenere-cipher-in-java/</link>
					<comments>https://nelson.ph/2010/08/vigenere-cipher-in-java/#comments</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Fri, 27 Aug 2010 10:31:38 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://log.flirt-wind.net/?p=660</guid>

					<description><![CDATA[<p>By stumbling upon this page, I presume knowledge on the encryption is already at hand. Otherwise, take a walk first. The program is under the following assumptions: User only inputs characters (and spaces!) included in the given alphanumeric set. Numeric characters result in uppercase plain/cipher characters. Encryption/decryption key cannot have a space. VigenereCipher.java private static [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2010/08/vigenere-cipher-in-java/">Vigenere Cipher in Java</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>By stumbling upon this page, I presume knowledge on the encryption is already at hand. Otherwise, <a href="http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher" target="_blank" rel="noopener noreferrer">take a walk</a> first. The program is under the following assumptions:</p>
<ul>
<li>User only inputs characters (and spaces!) included in the given alphanumeric set.</li>
<li>Numeric characters result in uppercase plain/cipher characters.</li>
<li>Encryption/decryption key cannot have a space.</li>
</ul>
<blockquote><p>
<strong><a href="https://nelsoft.org/files/code/VigenereCipher.java">VigenereCipher.java</a></strong></p></blockquote>
<pre class="EnlighterJSRAW" data-enlighter-language="java">private static final char[] alphnum = {
   'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
   'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
   'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
};
</pre>
<p>The post <a href="https://nelson.ph/2010/08/vigenere-cipher-in-java/">Vigenere Cipher in Java</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2010/08/vigenere-cipher-in-java/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">660</post-id>	</item>
		<item>
		<title>Java Implementation of &#8220;Inception&#8221;</title>
		<link>https://nelson.ph/2010/08/java-implementation-of-inception/</link>
					<comments>https://nelson.ph/2010/08/java-implementation-of-inception/#comments</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Sat, 14 Aug 2010 13:14:52 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://log.flirt-wind.net/?p=496</guid>

					<description><![CDATA[<p>Feedback from friends, positively spoken and written (statuses), kept me wondering what the movie really was all about. I never set my eyes on it because the trailer didn&#8217;t intrigue nor enlighten me as a layman. But as it turns out, it&#8217;s way more nerve-wracking than you can think of. After seeing a pseudocode post [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2010/08/java-implementation-of-inception/">Java Implementation of &#8220;Inception&#8221;</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://i0.wp.com/nelsoft.org/files/flirt-wind/return-to-innocence/inception_ver4.jpg?ssl=1"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/nelsoft.org/files/flirt-wind/return-to-innocence/inception_ver4-1.png?resize=100%2C148&#038;ssl=1" alt="Inception" class="floatright" width="100" height="148"/></a></p>
<p>Feedback from friends, positively spoken and written (statuses), kept me wondering what the movie really was all about. I never set my eyes on it because the trailer didn&#8217;t intrigue nor enlighten me as a layman. But as it turns out, it&#8217;s way more nerve-wracking than you can think of.</p>
<p>After seeing a pseudocode post from my adviser and visiting the big screen, I knew I just had to make my own — a  recursive one. To experience euphoria, I dug an implementation. What the program does is very simple. It asks for the levels of dream <em>you</em> wish to experience, and then prints out the time spent on each level. You&#8217;ll see&#8230;</p>
<blockquote><p>
<strong><a href="https://nelsoft.org/files/code/Inception.java">Inception.java</a></strong></p></blockquote>
<pre class="EnlighterJSRAW" data-enlighter-language="java">void dream(int level) {
   if(level &lt;= 0) {
      return;
   }

   try {
      System.out.print("Level " + level + ": ");
      long startTime = System.currentTimeMillis();
      Thread.sleep(1000*level);
      long endTime = System.currentTimeMillis();
      System.out.println((endTime-startTime) + " ms");
   } catch(InterruptedException ie) {}

   dream(level-1);
}
</pre>
<p>The post <a href="https://nelson.ph/2010/08/java-implementation-of-inception/">Java Implementation of &#8220;Inception&#8221;</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2010/08/java-implementation-of-inception/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">496</post-id>	</item>
		<item>
		<title>Running C and gcc in Windows (XP)</title>
		<link>https://nelson.ph/2009/07/running-c-and-gcc-in-windows-xp/</link>
					<comments>https://nelson.ph/2009/07/running-c-and-gcc-in-windows-xp/#respond</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Tue, 21 Jul 2009 15:25:03 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<guid isPermaLink="false">http://log.flirt-wind.net/?p=485</guid>

					<description><![CDATA[<p>If you&#8217;ve been conditioned that coding and running C codes in Windows is nearly impossible, think again. It&#8217;s actually as easy as X-Y-Z (c&#8217;mon people, A-B-C is so yesterday). Download Dev-C++ Install the software Go to File &#62; New and do your thing Execute &#62; Compile (Ctrl+F9) Execute &#62; Run (Ctrl+F10) If you&#8217;re familiar with [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2009/07/running-c-and-gcc-in-windows-xp/">Running C and gcc in Windows (XP)</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;ve been conditioned that coding and running C codes in Windows is nearly impossible, think again. It&#8217;s actually as easy as X-Y-Z (c&#8217;mon people, A-B-C is so yesterday).</p>
<p><span id="more-485"></span></p>
<ol>
<li>Download <a href="http://www.bloodshed.net/devcpp.html" target="_blank">Dev-C++</a></li>
<li>Install the software</li>
<li>Go to <em>File &gt; New</em> and do your thing</li>
<li><em>Execute &gt; Compile</em> (Ctrl+F9)</li>
<li><em>Execute &gt; Run</em> (Ctrl+F10)</li>
</ol>
<p>If you&#8217;re familiar with gcc and is more comfortable using it, then follow the steps below:</p>
<ol>
<li>Locate your Dev-C++ installation directory</li>
<li>Go to <strong>System Properties</strong> (via Control Panel or by right-clicking My Computer) and jump to the <strong>Advanced</strong> tab</li>
<li>Click on Environment Variables</li>
<li>Locate the <strong>Path</strong> variable and click <em>Edit</em></li>
<li>Put a semicolon (separator) at the end of the <strong>Variable value</strong></li>
<li>Add <em>[Dev-C++ directory]/bin</em></li>
<li>Finish with an OK</li>
</ol>
<p>You can now go to the Command Prompt to execute your C codes. In order to do so, you must be in the directory (folder) where your file is saved.</p>
<blockquote><p>
&gt;gcc -o executable.o filename.c<br />
&gt;./executable.o
</p></blockquote>
<p><strong>AN:</strong> Although Dev-C++ offers convenience in compiling and running, it apparently immediately closes the Command Prompt window after running the code without you getting the chance to see the output. In such case, you&#8217;ll have to add a <em>system(&#8220;pause&#8221;);</em> at the end of your code.</p>
<p>The post <a href="https://nelson.ph/2009/07/running-c-and-gcc-in-windows-xp/">Running C and gcc in Windows (XP)</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2009/07/running-c-and-gcc-in-windows-xp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">485</post-id>	</item>
		<item>
		<title>Removing iframe Horizontal Scrollbar</title>
		<link>https://nelson.ph/2008/02/removing-iframe-horizontal-scrollbar/</link>
					<comments>https://nelson.ph/2008/02/removing-iframe-horizontal-scrollbar/#comments</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Wed, 06 Feb 2008 08:14:50 +0000</pubDate>
				<category><![CDATA[XHTML]]></category>
		<guid isPermaLink="false">http://www.flirt-wind.net/2008/02/removing-iframe-horizontal-scrollbar/</guid>

					<description><![CDATA[<p>Oh c&#8217;mon! A few days ago, I was already about to die trying to remove a freakin&#8217; horizontal scrollbar of the iframe in this fanlisting. The problem is only associated with Internet Explorer. :devil: The last resort I could do was to compare it line after line with another code that does not show the [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2008/02/removing-iframe-horizontal-scrollbar/">Removing iframe Horizontal Scrollbar</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Oh c&#8217;mon! A few days ago, I was already about to die trying to remove a freakin&#8217; horizontal scrollbar of the iframe in <a href="http://akiba.chanlu.org/gals/" target="_blank" rel="noopener noreferrer">this</a> fanlisting. The problem is only associated with Internet Explorer. :devil: The last resort I could do was to compare it line after line with another code that does not show the said scrollbar. So how did it turn out? Well, the only thing that was missing was a line before the document type declaration (DTD). I then remembered that the same thing holds true for the scrollbar colors that are not supported in Firefox (I used to do it before). So anyway, for instance, the first line of the code should not be:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
</pre>
<p>Instead,</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;!--anything goes here (perhaps even a blank line)--&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
</pre>
<p>Whew, glad I did it. And oh, please bear with the title of this post. :sweat:</p>
<p>On other whatnots&#8230;</p>
<ul>
<li>I find the new Voice biscuit ad really awesome. Its concept is mutants (or the &#8220;Heroes&#8221; TV series every entity on earth is talking about).</li>
<li>Last Saturday was the last day of the <em>Salakayan</em> Festival here in Miag-ao. I went to the plaza for dinner together with my dormmates Julius, McDeansem, Michael, and Rodrigo. We walked our way back to the dorm and happily chatted about animes, <em>Koreanovelas</em>, X-Men and Power Rangers every Friday night then, and <em>Mexicanovelas</em> like Rosalinda and Ruby (<em>Ang Bidang Kontrabida</em>). 😆</li>
<li>I knew that Spring Waltz in ABS-CBN is the fourth and last installment of the Endless Love series after three years. The first three all aired in GMA — Autumn In My Heart, Winter Sonata, and Summer Scent.</li>
<li>Watched Bicentennial Man in ABS last Sunday and shed. :no: 😯</li>
<li>First long exam in Operating Systems tomorrow. I must do good!</li>
<li>Today is Ash Wednesday, but I&#8217;m not going to the church. 🙁 I&#8217;m becoming the devil.</li>
</ul>
<p>The post <a href="https://nelson.ph/2008/02/removing-iframe-horizontal-scrollbar/">Removing iframe Horizontal Scrollbar</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2008/02/removing-iframe-horizontal-scrollbar/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">125</post-id>	</item>
		<item>
		<title>JavaScript: Displaying Date and Time</title>
		<link>https://nelson.ph/2007/09/javascript-displaying-date-and-time/</link>
					<comments>https://nelson.ph/2007/09/javascript-displaying-date-and-time/#comments</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Sun, 23 Sep 2007 08:19:34 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">http://www.flirt-wind.net/2007/09/23/javascript-displaying-date-and-time/</guid>

					<description><![CDATA[<p>Our first exercise in CMSC 140. I was, by any luck, able to do it without any help from my classmates and, as a matter of fact, even enjoyed doing it! 😉 P.S. Also prints out &#8220;Hello World!&#8221; n times, where n is the date. date_time.html &#60;script type="text/javascript"&#62; var nelson = new Date(); var date [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2007/09/javascript-displaying-date-and-time/">JavaScript: Displaying Date and Time</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Our first exercise in CMSC 140. I was, by any luck, able to do it without any help from my classmates and, as a matter of fact, even enjoyed doing it! 😉</p>
<p><strong>P.S.</strong> Also prints out &#8220;Hello World!&#8221; n times, where n is the date.</p>
<blockquote><p>
<strong><a href="https://nelsoft.org/files/code/date_time.html">date_time.html</a></strong></p></blockquote>
<pre class="EnlighterJSRAW" data-enlighter-language="javascript">&lt;script type="text/javascript"&gt;
   var nelson = new Date();
   var date = nelson.getDate();
   var day = nelson.getDay();
   var month = nelson.getMonth();
   var fullYear = nelson.getFullYear();
   var hours = nelson.getHours();
   var minutes = nelson.getMinutes();
&lt;/script&gt;
</pre>
<p>The post <a href="https://nelson.ph/2007/09/javascript-displaying-date-and-time/">JavaScript: Displaying Date and Time</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2007/09/javascript-displaying-date-and-time/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">38</post-id>	</item>
	</channel>
</rss>
