<?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>Rafadamar!! &#187; Technology</title>
	<atom:link href="http://rafadamar.com/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://rafadamar.com</link>
	<description>Hate me for who I am not who you think I am.</description>
	<lastBuildDate>Sat, 28 Jan 2012 02:12:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>HowTo: Integrate Privatemsg with the Flag and jQuery_Impromptu modules</title>
		<link>http://rafadamar.com/2010/05/howto-integrate-privatemsg-with-the-flag-and-jquery_impromptu-modules/</link>
		<comments>http://rafadamar.com/2010/05/howto-integrate-privatemsg-with-the-flag-and-jquery_impromptu-modules/#comments</comments>
		<pubDate>Thu, 13 May 2010 01:36:19 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[drupal 6]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://rafadamar.com/?p=97</guid>
		<description><![CDATA[I needed a way for a user to be prompted to send a message to the author of a node after it was flagged. This was my solution. jQuery Impromptu provides a nice way of implementing a pop-up feature. Flag of course flags a node. &#60;?php // Load necessary to avoid error module_load_include('pages.inc','privatemsg'); // Adds [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a way for a user to be prompted to send a message to the author of a node after it was flagged. This was my solution.</p>
<p><a href="http://drupal.org/project/jquery_impromptu">jQuery</a> Impromptu provides a nice way of implementing a pop-up feature.<br />
<a href="http://drupal.org/project/flag">Flag</a> of course flags a node.</p>
<pre class="brush: php">&lt;?php
  // Load necessary to avoid error
  module_load_include('pages.inc','privatemsg');

  // Adds javascript to header
  jquery_impromptu_add();

  // Gets rid of whitespaces that break javascript code
  // drupal_get_form retrieves the privatemsg form
  // $uid is the author of the node
  // $title is the title of the node
  $form = str_replace("\r", '', str_replace("\n", '', drupal_get_form('privatemsg_new', $uid, $title)));

  // javascript that runs jquery_impromptu on flag event
  print '&lt;script language="javascript"&gt;';
  print "
  $(document).bind('flagGlobalAfterLinkUpdate', function(event, data) {
    if(data.flagStatus == 'flagged'){
      $.prompt('$form');
    }
  });
  ";
  print '&lt;/script&gt;';

  // Necessary because previous module_load_include changes title
  drupal_set_title(check_plain($node-&gt;title));
?&gt;
</pre>
<p>For more information on how you can customize the privatemsg form, look here <a href="http://drupal.org/node/624528">http://drupal.org/node/624528</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2010/05/howto-integrate-privatemsg-with-the-flag-and-jquery_impromptu-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Game I&#8217;ve Been Dying to Make</title>
		<link>http://rafadamar.com/2009/11/the-game-ive-been-dying-to-make/</link>
		<comments>http://rafadamar.com/2009/11/the-game-ive-been-dying-to-make/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 01:08:46 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[game development]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The reason I started to learn web development stuff like HTML &#38; CSS when I was a kid was so that I could one day make a massive multiplayer online role playing game(MMORPG). I still have that goal in mind! For a couple of years now, I&#8217;ve been developing a game in my head. I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>The reason I started to learn web development stuff like HTML &amp; CSS when I was a kid was so that I could one day make a massive multiplayer online role playing game(MMORPG). I still have that goal in mind!</p>
<p>For a couple of years now, I&#8217;ve been developing a game in my head. I&#8217;ve created some goals that I want that game accomplish:</p>
<ul>
<li>It has to be open-ended</li>
<li>It should be realistic</li>
<li>The interface should be text-based with natural language</li>
<li>It should have different types of gameplay</li>
<li>It should be free</li>
</ul>
<p><!--break-->The open-ended feel, realism, and natural language interface goals are there to make the game immersive. I don&#8217;t want the player to feel like they&#8217;re playing a game. I want them to invest more time, thought, and emotion in this game than the usual game. The game should almost feel like an extension of life. A sort of alternate universe where the player gets to live out different life scenarios. It&#8217;s not just a game. It&#8217;s a way of living a different life.</p>
<p>That means the point of this game isn&#8217;t pretty graphics. You&#8217;re going to be able to shoot somebody&#8211;and maybe even headshot somebody&#8211;but you&#8217;re not going to see it on the screen. You&#8217;re going to read it. The imagination has a much better visualization engine than anything I could write or any open source alternative out there. And, that is why I want the game to be text-based. I&#8217;m hoping the immersiveness of it aids the player in imagining everything while reading how the game is playing out.</p>
<p>The game should have different types of gameplay so that its hard to be bored by the game and so that it can broaden its audience. That does mean that two players should be able to get a similar experience from the game even if the part of the game each player takes part in has different gameplay. For example, some players can have a purely business/logisitcs/tycoon kinda game, others can have a stock market kinda game, others can have a kingdom/mafia kinda game, and others can have a third-person(in the literary sense) shooter.</p>
<p>It has to be free because I remember being bored as fuck as a kid. I remember wishing a game like this existed and that it was free so I could play it. So, yea its gonna be free.</p>
<p>I&#8217;ve of course thought about how all of this will be coded. Creating a realistic feel and a an open-ended feel will be complicated. I need to make walking, driving, bus routes, non-player characters(NPCs), and a whole lotta other complicated crap work smoothly. We&#8217;re not even talking about natural language yet. If a PHP library, jQuery plugin, or Drupal module don&#8217;t already exist for natural language interpretation, it&#8217;s probably gonna be a bitch to code. Maybe some crazy Python programmer out there made something I could use. We&#8217;ll see. Since it&#8217;s text based, I&#8217;m going to need to output everything properly. Everything includes: location description, actions taking place by neighboring players &amp; NPCs, actions you&#8217;ve done, possible error messages. Creating functionality for different types of gameplay and making sure each interacts with the other gameplays in a realistic and meaningufl way will also be difficult. The stock market player&#8217;s decisions should affect the kingdom players decions. To make it free, the coding has to be done well as to not waste calls to the server.</p>
<p>This is going to be a very complex game. The decision tree will be huge. The possibilities will be hopefully endless.</p>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/11/the-game-ive-been-dying-to-make/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Script to Check If a Site is Up</title>
		<link>http://rafadamar.com/2009/11/php-script-to-check-if-a-site-is-up/</link>
		<comments>http://rafadamar.com/2009/11/php-script-to-check-if-a-site-is-up/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 22:10:12 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[drupal 6]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I needed to develop this script in order to check whether or not my streaming media server was up. At first, I tried to use PHP&#8217;s system function with BASH&#8217;s wget, but that wasn&#8217;t working. I ended up using PHP&#8217;s file_get_contents. &#60;?php function chkuri($link){ //$link is the website which i am checking // If file_get_contents [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to develop this script in order to check whether or not my streaming media server was up. At first, I tried to use PHP&#8217;s system function with BASH&#8217;s wget, but that wasn&#8217;t working. I ended up using PHP&#8217;s file_get_contents.</p>
<pre class="brush:php">
&lt;?php
function chkuri($link){
//$link is the website which i am checking
// If file_get_contents failed to retrieve
// the page, it's not up
  if(!file_get_contents($link)){
    return 'I\'m sorry, but the Ampache server is down. :(';
// It is up
  }else{
    return 'It\'s up! &lt;a href="'.$link.'"&gt;Click here to go!&lt;/a&gt;';
  }
}
print '&lt;h2&gt;'.chkuri('http://martinez.homelinux.org/ampache').'&lt;/h2&gt;';
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/11/php-script-to-check-if-a-site-is-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Essential Drupal 6 Modules</title>
		<link>http://rafadamar.com/2009/11/essential-drupal-6-modules/</link>
		<comments>http://rafadamar.com/2009/11/essential-drupal-6-modules/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 22:03:43 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[drupal 6]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[These are the modules I find myself installing on almost every Drupal instance I have created. If you want, you can just run the code within the appropriate &#8216;modules&#8217; folder of your Drupal instance. The links will change as time goes on so please take that into account. Content Construction Kit The Content Construction Kit [...]]]></description>
			<content:encoded><![CDATA[<p>These are the modules I find myself installing on almost every Drupal instance I have created. If you want, you can just run the code within the appropriate &#8216;modules&#8217; folder of your Drupal instance. The links will change as time goes on so please take that into account.</p>
<h3><a href="http://drupal.org/project/cck">Content Construction Kit</a></h3>
<p>The Content Construction Kit (CCK) allows you to add custom fields to nodes. CCK is basically what lets you create great custom content-types for your Drupal instance.</p>
<pre class="brush: bash">
wget http://ftp.drupal.org/files/projects/cck-6.x-2.6.tar.gz
tar xfvz cck-6.x-2.6.tar.gz
</pre>
<h3><a href="http://drupal.org/project/date">Date</a></h3>
<p>The Date module comes with an API that allows other modules to use newer PHP date functions. It also adds a nice Date field for use with CCK. The Date module also comes with a pop-up date picker.</p>
<pre class="brush: bash">
wget http://ftp.drupal.org/files/projects/date-6.x-2.4.tar.gz
tar xfvz date-6.x-2.4.tar.gz
</pre>
<h3><a href="http://drupal.org/project/views">Views</a></h3>
<p>Views is an amazing module. A view can be a collection of nodes of a certain type. The view can be displayed as a table, grid, teaser list, full node list, and a RSS feed. There are a number of arguments and variables you an change to make dynamic views.</p>
<pre class="brush:bash">
wget http://ftp.drupal.org/files/projects/views-6.x-2.7.tar.gz
tar xfvz views-6.x-2.7.tar.gz
</pre>
<h3><a href="http://drupal.org/project/wysiwyg">WYSIWYG</a>, <a href="http://drupal.org/project/imce">IMCE</a>, &amp; <a href="http://drupal.org/project/imce_wysiwyg">The Bridge</a></h3>
<p>These three modules combine to form a near perfect WYSIWYG editor. The WYSIWYG module is an API that enables multiple editors to work with Drupal. IMCE is an image/file uploader. The IMCE WYSIWYG Bridge module brings the two together. The Bridge is only compatible with the FCKeditor and TinyMCE WYSIWYG editors, but those two are probably the best ones out there.</p>
<pre class="brush: bash">
wget http://ftp.drupal.org/files/projects/wysiwyg-6.x-2.0.tar.gz; wget http://ftp.drupal.org/files/projects/imce_wysiwyg-6.x-1.0.tar.gz; wget http://ftp.drupal.org/files/projects/imce-6.x-1.3.tar.gz
tar xfvz wysiwyg-6.x-2.0.tar.gz; tar xfvz imce_wysiwyg-6.x-1.0.tar.gz; tar xfvz imce-6.x-1.3.tar.gz
</pre>
<h3><a href="http://drupal.org/project/captcha">CAPTCHA</a> &amp; <a href="http://drupal.org/project/recaptcha">reCAPTCHA</a></h3>
<p>These two modules enable a simple anti-spam measure. You could use CAPTCHA on its own, but I prefer reCAPTCHA simply because it helps digitize books while also preventing spam. You could also use the <a href="http://drupal.org/project/mollom">Mollom module</a> or the <a href="http://drupal.org/project/spam">Spam module</a>.</p>
<pre class="brush: bash">
wget http://ftp.drupal.org/files/projects/captcha-6.x-2.0.tar.gz; wget http://ftp.drupal.org/files/projects/recaptcha-6.x-1.3.tar.gz
tar xfvz captcha-6.x-2.0.tar.gz; tar xfvz recaptcha-6.x-1.3.tar.gz
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/11/essential-drupal-6-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display Taxonomy Block on blog page, blog entries, and blog terms</title>
		<link>http://rafadamar.com/2009/11/display-taxonomy-block-on-blog-page-blog-entries-and-blog-terms/</link>
		<comments>http://rafadamar.com/2009/11/display-taxonomy-block-on-blog-page-blog-entries-and-blog-terms/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 03:03:38 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[drupal 6]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[You will need to download and install one module and its dependencies for this to work. Download the Advanced Taxonomy Blocks module &#38; install it. In your terminal enter: wget http://ftp.drupal.org/files/projects/taxonomyblocks-6.x-1.8.tar.gz tar xfvz taxonomyblocks-6.x-1.8.tar.gz Repeat for its dependencies. Configure your block Once installed, you can configure Taxonomy blocks. You can do so by going to [...]]]></description>
			<content:encoded><![CDATA[<p>You will need to download and install one module and its dependencies for this to work.</p>
<h3>Download the <a href="http://drupal.org/project/taxonomyblocks">Advanced Taxonomy Blocks module</a> &amp; install it.</h3>
<p>In your terminal enter:</p>
<pre class="brush: bash">
wget http://ftp.drupal.org/files/projects/taxonomyblocks-6.x-1.8.tar.gz
tar xfvz taxonomyblocks-6.x-1.8.tar.gz
</pre>
<p>Repeat for its dependencies.</p>
<h3>Configure your block</h3>
<p>Once installed, you can configure Taxonomy blocks. You can do so by going to your administration page and selecting &#8216;Advanced Taxonomy Blocks configuration&#8217; under the &#8216;Site Configuration&#8217; section.</p>
<h3>Set visibilty settings with PHP</h3>
<p>Now, enable the block you just configured in the Blocks page. For the &#8216;Page specific visibility settings&#8217;, select the PHP-mode. Remember to substitute the vocabulary IDs for the <a href="http://api.drupal.org/api/function/taxonomy_get_tree/6">taxonomy_get_tree function</a>.</p>
<p>Enter the following PHP code:</p>
<pre class="brush: bash">&lt;?php
// If node-&gt;type == blog
if(arg(0) == 'node' &amp;&amp; is_numeric(arg(1))){
  $node = node_load((1))</span>;
    if($node-&gt;type == 'blog'){
      return TRUE;
    }
    // Main blog page
    }else if(arg(0) == 'blog'){
      return TRUE;
    // On tag page that is a blog tag
    }else if(arg(0) == 'taxonomy' &amp;&amp; is_numeric(arg(2))){
      $tid = arg(2);
      $tree1 = taxonomy_get_tree(1);
      $tree2 = taxonomy_get_tree(2);
      foreach($tree1 as $term){
        if($term-&gt;tid == $tid){
          return TRUE;
        }
      }
      foreach($tree2 as $term){
        if($term-&gt;tid == $tid){
         return TRUE;
        }
      }
    }else{
      return FALSE;
    }
  return FALSE;
}
?&gt;
</pre>
<p>If everything&#8217;s working, you should be able to see the taxonomy of the blog page, term pages associated with the blog, and on every blog entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/11/display-taxonomy-block-on-blog-page-blog-entries-and-blog-terms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spell Checker</title>
		<link>http://rafadamar.com/2009/11/spell-checker/</link>
		<comments>http://rafadamar.com/2009/11/spell-checker/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 01:53:50 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[#include &#60;iostream&#62; #include &#60;fstream&#62; #include &#60;string&#62; #include &#60;map&#62; #include &#60;vector&#62; using namespace std; // Make know words map map&#60;string,int&#62; get_words(istream &#38;input){ map&#60;string,int&#62; words; string word; // Go through big file collecting words while(!input.eof()){ input &#62;&#62; word; // Make sure string is a word int len = word.length(); bool isWord = true; for( int x = [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: cpp">
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;map&gt;
#include &lt;vector&gt;
using namespace std;

// Make know words map
map&lt;string,int&gt; get_words(istream &amp;input){
  map&lt;string,int&gt; words;
  string word;
  // Go through big file collecting words
  while(!input.eof()){
    input &gt;&gt; word;
    // Make sure string is a word
    int len = word.length();
    bool isWord = true;
    for( int x = 0; x &lt; len; x++){
      word[x]=tolower(word[x]);
      if(!isalpha(word[x]))
        isWord = false;
    }
    // Put words into map that keeps track
    // of count
    if(isWord)
      words[word]++;
  }
  return words;
}

// Make words of distance one
vector&lt;string&gt; edits1(string word){
  vector&lt;string&gt; words;
  int n = word.length();
  // Deletions
  for(int x = 0;x &lt; n;x++){
    string temp = word;
    temp.erase(temp.begin() + x);
    words.push_back(temp);
  }

  // Transpositions
  for(int x = 0; x &lt; n-1; x++){
    string temp = word;
    char c;
    c = temp[x];
    temp[x] = temp[x+1];
    temp[x+1] = c;
    words.push_back(temp);
  }  

  // Alterations
  string alphabet = &quot;abcdefghijklmnopqrstuvwxyz&quot;;
  for(int x = 0; x &lt; n; x++){
    for(int y = 0; y &lt; 26; y++){
      string temp = word;
      temp[x] = alphabet[y];
      words.push_back(temp);
    }
  }

  // Insertions
  for(int x=0;x&lt;=n;x++&#41;&#123;
		for&#40;int y=0;y&lt;26;y++&#41;&#123;
			string temp = word;
			temp.insert&#40;x,1,alphabet&#91;y&#93;&#41;;
			words.push_back&#40;temp&#41;;
		&#125;
	&#125;
&nbsp;
	return words;
&nbsp;
&#125;
&nbsp;
// Make known words of distance 2
vector&lt;string&gt; known_edits2&#40;string word, map&lt;string,int&gt; known_words&#41;&#123;
	vector&lt;string&gt; words,words2,temp;
&nbsp;
	// Get words of distance 1
	words = edits1&#40;word&#41;;
&nbsp;
	int count = words.size&#40;&#41;;
&nbsp;
	// Get words of distance 2
	for&#40;int x=0;x&lt;count;x++&#41;&#123;
		temp = edits1&#40;words&#91;x&#93;&#41;;
&nbsp;
		int count = temp.size&#40;&#41;;
&nbsp;
		// Insert known words
		for&#40;int x=0;x&lt;count;x++&#41;
			if&#40;known_words&#91;&#40;temp&#91;x&#93;&#41;&#93;&#41;
				words2.push_back&#40;temp&#91;x&#93;&#41;;
&nbsp;
	&#125;
&nbsp;
	return words2;
&#125;
&nbsp;
// Find known words with input as vector
vector&lt;string&gt; known&#40;vector&lt;string&gt; temp,map&lt;string,int&gt; known_words&#41;&#123;
	vector&lt;string&gt; words;
&nbsp;
	int count = temp.size&#40;&#41;;
&nbsp;
	// Push back known words
	for&#40;int x=0;x&lt;count;x++&#41;&#123;
		if&#40;known_words&#91;&#40;temp&#91;x&#93;&#41;&#93;&#41;
			words.push_back&#40;temp&#91;x&#93;&#41;;
	&#125;
&nbsp;
	return words;
&#125;
&nbsp;
// Find know words with input as string
vector&lt;string&gt; known&#40;string temp,map&lt;string,int&gt; known_words&#41;&#123;
	vector&lt;string&gt; words;
&nbsp;
	// is the word known?
	if&#40;known_words&#91;temp&#93;&#41;
		words.push_back&#40;temp&#41;;
&nbsp;
	return words;
&#125;
&nbsp;
// Find the correct word
string correct&#40;string word, map&lt;string,int&gt; known_words&#41;&#123;
	vector&lt;string&gt; candidates;
&nbsp;
	// Is the word known?
	candidates = known&#40;word,known_words&#41;;
&nbsp;
	// If not, get words from distance 1
	if&#40;candidates.size&#40;&#41; == 0&#41;
		candidates = known&#40;edits1&#40;word&#41;,known_words&#41;;
&nbsp;
	// If nothing from distance 1 is a word,
	// get words from distance 2
	if&#40;candidates.size&#40;&#41; == 0&#41;
		candidates = known_edits2&#40;word,known_words&#41;;
&nbsp;
	// If nothing return word
	if&#40;candidates.size&#40;&#41; == 0&#41;
		return word;
&nbsp;
	int count = candidates.size&#40;&#41;;
	int max=0,temp=0;
	string candidate;
&nbsp;
	// Get word with the highest usage from candidates
	for&#40;int x=0;x&lt;count;x++&#41;&#123;
		temp = known_words&#91;&#40;candidates&#91;x&#93;&#41;&#93;;
		if&#40;temp &gt; max&#41;&#123;
			max = temp;
			candidate = candidates&#91;x&#93;;
		&#125;
	&#125;
&nbsp;
	return candidate;
&nbsp;
&#125;
&nbsp;
int main&#40;int argc, char* argv&#91;&#93;&#41;&#123;
&nbsp;
	if&#40;argc != 2&#41;&#123;
		cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; argv&#91;0&#93; &lt;&lt; &quot;string&quot; &lt;&lt; endl;
		return -1;
	&#125;
&nbsp;
	// Get word from user input
	string word = argv&#91;1&#93;;
&nbsp;
	// File that has huge collection of words
	ifstream file&#40;&quot;big.txt&quot;&#41;;
&nbsp;
	// Create map of words
	map&lt;string,int&gt; known_words = get_words&#40;file&#41;;
&nbsp;
	// Get correct word
	string correction = correct&#40;word, known_words&#41;;
&nbsp;
	cout &lt;&lt; &quot;correct( &quot; &lt;&lt; word &lt;&lt; &quot; ) == &quot; &lt;&lt; correction &lt;&lt; endl;
&nbsp;
	return 0;
&#125;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/11/spell-checker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is Prime</title>
		<link>http://rafadamar.com/2009/11/is-prime/</link>
		<comments>http://rafadamar.com/2009/11/is-prime/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 01:50:50 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[#include &#60;iostream&#62; #include &#60;vector&#62; #include &#60;cmath&#62; &#160; using namespace std; &#160; // Tests whether a function is prime bool test_prime&#40;int num&#41;&#123; int count = 0,x=2; double numx = &#40;double&#41; num; // Go through all primes for&#40;x=0;x&#60;sqrt&#40;numx&#41;;x++&#41;&#123; if&#40;num % x == 0&#41;&#123; return false; &#125; &#125; &#160; return true; &#125; &#160; int main&#40;int argc, char *argv&#91;&#93;&#41;&#123; [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: cpp">
#include &lt;iostream&gt;

#include &lt;vector&gt;

#include &lt;cmath&gt;

&nbsp;

using namespace std;

&nbsp;

// Tests whether a function is prime

bool test_prime&#40;int num&#41;&#123;

	int count = 0,x=2;

	double numx = &#40;double&#41; num;

	// Go through all primes

	for&#40;x=0;x&lt;sqrt&#40;numx&#41;;x++&#41;&#123;

		if&#40;num % x == 0&#41;&#123;

			return false;

		&#125;

	&#125;

&nbsp;

	return true;	

&#125;

&nbsp;

int main&#40;int argc, char *argv&#91;&#93;&#41;&#123;

	int num;

&nbsp;

	if&#40;argc != 2&#41;&#123;

		cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; argv&#91;0&#93; &lt;&lt; &quot; positive-integer&quot; &lt;&lt; endl;

		return -1;

	&#125;else&#123;

		num = atoi&#40;argv&#91;1&#93;&#41;;

	&#125;

&nbsp;

	bool is_prime = test_prime&#40;num&#41;;

	if&#40;is_prime&#41;&#123;

		cout &lt;&lt; num &lt;&lt; &quot; is prime&quot; &lt;&lt; endl;

	&#125;else&#123;

		cout &lt;&lt; num &lt;&lt; &quot; isn&#039;t prime&quot; &lt;&lt; endl;

	&#125;

&nbsp;

&#125;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/11/is-prime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intel 82801DB AC&#8217;97 audio controller issue</title>
		<link>http://rafadamar.com/2009/09/intel-82801db-ac97-audio-controller-issue/</link>
		<comments>http://rafadamar.com/2009/09/intel-82801db-ac97-audio-controller-issue/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 12:23:00 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[So Nietzsche and Camus both use this Intel audio driver. Alsa messes up the audio for some reason and there is no sound. I found a fix though: https://www.redhat.com/archives/fedora-list/2005-January/msg05487.html Basically, all you have to do is open up a terminal and run this: alsamixer You can switch between the things using the left and right [...]]]></description>
			<content:encoded><![CDATA[<p>So Nietzsche and Camus both use this Intel audio driver. Alsa messes up the audio for some reason and there is no sound.</p>
<p>I found a fix though: <a href="https://www.redhat.com/archives/fedora-list/2005-January/msg05487.html">https://www.redhat.com/archives/fedora-list/2005-January/msg05487.html</a></p>
<p>Basically, all you have to do is open up a terminal and run this:</p>
<pre class="brush: bash">alsamixer</pre>
<p>You can switch between the things using the left and right arrows. Press m to mute or unmute it.</p>
<p>In addition to muting the headphone jack and line jack, I muted the external. If that doesn&#8217;t work for you, just mess around muting and unmuting stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/09/intel-82801db-ac97-audio-controller-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nietzsche: VPN Server</title>
		<link>http://rafadamar.com/2009/09/nietzsche-vpn-server/</link>
		<comments>http://rafadamar.com/2009/09/nietzsche-vpn-server/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 02:39:00 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Nietzsche is up and running as a VPN server! I used pptpd. Nietzsche is running Xubuntu Hardy Heron. Install sudo apt-get install pptpd Add Users sudo vim /etc/ppp/chap-secrets The format is: username pptpd password Edit pptpd.conf sudo vim /etc/pptpd.conf Add lines similar to these localip 192.168.1.72 remoteip 192.168.1.200-253 localip is the IP for the VPN [...]]]></description>
			<content:encoded><![CDATA[<p>Nietzsche is up and running as a VPN server!</p>
<p>I used pptpd. Nietzsche is running Xubuntu Hardy Heron.</p>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="http://2.bp.blogspot.com/_qbVemWvXrxk/Sq6hDIxdXTI/AAAAAAAAAmw/PFMBn3uw1WI/s1600/P9140092.JPG"><img class="mceItem" src="http://2.bp.blogspot.com/_qbVemWvXrxk/Sq6hDIxdXTI/AAAAAAAAAmw/PFMBn3uw1WI/s320/P9140092.JPG" border="0" alt="" /></a></div>
<h2>Install</h2>
<pre class="brush: bash">
sudo apt-get install pptpd
</pre>
<h2>Add Users</h2>
<pre class="brush: bash">
sudo vim /etc/ppp/chap-secrets
</pre>
<p>The format is:</p>
<pre class="brush: bash">username pptpd password</pre>
<h2>Edit pptpd.conf</h2>
<pre class="brush: bash">
sudo vim /etc/pptpd.conf
</pre>
<p>Add lines similar to these</p>
<pre class="brush: bash">
localip 192.168.1.72</pre>
<p>remoteip 192.168.1.200-253
</pre>
<p>localip is the IP for the VPN server. remoteip are the IPs that will be given to the VPN clients. I'm using unused IPs.</p>
<h2>Edit pptpd-options</h2>
<pre class="brush: bash">
sudo vim /etc/ppp/pptpd-options
</pre>
<p>Uncomment #ms-dns 10.0.0.1. Change 10.0.0.1 to your DNS server or router</p>
<h2>Edit sysctl</h2>
<pre class="brush: bash">
sudo vim /etc/sysctl.conf
</pre>
<p>Add the following lines</p>
<pre class="brush: bash">
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1
</pre>
<h2>Restart</h2>
<pre class="brush: bash">
sudo /etc/init.d/pptpd restart
</pre>
<p>Your server should be up and running.</p>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/09/nietzsche-vpn-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hostname Issues</title>
		<link>http://rafadamar.com/2009/09/hostname-issues/</link>
		<comments>http://rafadamar.com/2009/09/hostname-issues/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 12:46:00 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As you know, I&#8217;ve been making a home network. The task itself isn&#8217;t too complicated, but there have been little annoying things here and there. For some reason, the hostnames of about every computer were being forgotten by my 2wire router. This is bad because I named my computers for a reason! I didn&#8217;t want [...]]]></description>
			<content:encoded><![CDATA[<p>As you know, I&#8217;ve been making a home network. The task itself isn&#8217;t too complicated, but there have been little annoying things here and there.</p>
<p>For some reason, the hostnames of about every computer were being forgotten by my 2wire router. This is bad because I named my computers for a reason! I didn&#8217;t want to memorize IP addresses. The IPs weren&#8217;t hard to remember. Its just that memorizing an arbitrary number to a computer that does specific things is hard.</p>
<p>I couldn&#8217;t ssh into the servers easily, because I&#8217;d have to look up the IP each time rather than just typing in the hostname.</p>
<p>It was a simple fix!</p>
<p>You just have to edit dhclient.conf</p>
<pre class="brush: bash">
sudo vim /etc/dhcp3/dhclient.conf
</pre>
<p>Insert this line</p>
<pre class="brush: bash">
send host-name "yourhostname";
</pre>
<p>Restart the DHCP daemon<br />
I used this command for Hardy Heron</p>
<pre class="brush: bash">
sudo /etc/init.d/dhcdbd restart
</pre>
<p>I used this command for Jaunty Jackalope</p>
<pre class="brush: bash">
sudo /etc/init.d/dbus restart
</pre>
<p>Your computer should now tell your router its hostname!</p>
]]></content:encoded>
			<wfw:commentRss>http://rafadamar.com/2009/09/hostname-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

