This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A very simple naive bayes classifier for english text. | |
# | |
# Author: Carlos Agarie <[email protected]> | |
# Some assumptions: | |
# - The stop words, dataset and test data are hardcoded. | |
# - Binary classification (so each phrase has a corresponding boolean value). | |
# - If there's a missing feature, it's ignored. | |
# | |
# Of course this isn't a finished "product". I'm studying classifiers, so this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Homebrew and be happy. | |
brew update | |
brew install opencv | |
# Give the correct pathnames. Of course, `2.4.3` is the current version at this time, change it accordingly. | |
gem install ruby-opencv -- --with-opencv-lib=/usr/local/Cellar/opencv/2.4.3/lib \ | |
--with-opencv-include=/usr/local/Cellar/opencv/2.4.3/include/opencv \ | |
--with-opencv-include=/usr/local/Cellar/opencv/2.4.3/include/opencv2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This comment WON'T be processed. | |
*/ | |
static VALUE undocumented_method(VALUE self) { | |
return Qnil; | |
} | |
/* | |
* This comment WILL be processed. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** queue-threadsafe.c | |
** | |
** A thread-safe (for 2 threads) implementation of a queue. Based on the | |
** implementation from the book Embedded Systems, by Jonathan W. Valvano, | |
** chapter 3, page 130. | |
*/ | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake compile | |
rake/gempackagetask is deprecated. Use rubygems/package_task instead | |
mkdir -p tmp/x86_64-darwin11.4.0/nmatrix/1.9.3 | |
cd tmp/x86_64-darwin11.4.0/nmatrix/1.9.3 | |
/Users/carlosagarie/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb | |
checking for clapack_dgetrf() in -llapack... no | |
checking for clapack.h... no | |
checking for cblas_dgemm() in -lcblas... yes | |
checking for ATL_dgemmNN() in -latlas... yes | |
checking for cblas.h... no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# This script creates checkerboard inputs for CS325 Program #4. | |
# | |
# Carlos Agarie | |
# | |
prng = Random.new | |
# Arbitrarily decided that 80% are checkers and 20% are kings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------ | |
# QuotesGenerator | |
# A Jekyll plugin to generate a quotes/index.html page based on a Tumblr's | |
# account. | |
# | |
# You need a quotes.json file inside a SITE_ROOT/_data/ directory to use this | |
# plugin. It must use the same format as Tumblr's API v2. | |
# | |
# Available _config.yml settings: | |
# - text_size_limit: Maximum size of a used quote. Default to 1000. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pokemon | |
def battle | |
yield self | |
end | |
end | |
mewtwo = Pokemon.new | |
mewtwo.battle do |m2| | |
puts m2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Text_IO; | |
with Ada.Float_Text_IO; | |
with Ada.Numerics.Float_Random; | |
use Ada.Text_IO; | |
use Ada.Float_Text_IO; | |
use Ada.Numerics.Float_Random; | |
procedure Pi is | |
N: constant Integer := 500000; -- Number of iterations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="post-list unstyled"> | |
{% for post in site.posts %} | |
{% capture post_year %} | |
{{ post.date | date: "%Y" }} | |
{% endcapture %} | |
{% unless year == post_year %} | |
{% assign year = post_year %} | |
<h1>{{ year }}</h1> |