Concise Implementation of Minimax through Higher-Order Functions

The Minimax algorithm is the core of several game-playing AI for making decisions on the best move. This algorithm finds the best move for an AI on a two-player, combinatorial game state on games such as Checkers, Chess or Othello.

In this post, I assume that the reader is familiar with the algorithm and its inherent code size due to its frequent implementation with three distinct functions. I will begin by briefly describing a standard implementation of Minimax and then I will introduce a concise implementation using higher-order functions. Note that we will use Python and Haskell as pseudo-code.

Read More

Posted in Ingenuity | Tagged , , , , , , | Leave a comment

Designing a Linux Resource Manager in C++

By the fervor of Linus Torvalds, there does not exist any immediate C++ or OOP interfaces to operating system services. Consequently, it is sometimes necessary to wrap a logical set of Linux system calls in a C++ wrapper. In this post, I will demonstrate a standard process of wrapping the resource limitation and usage system calls in a ResourceManager singleton service while utilizing some nifty C++ tricks such as CRTP.

Read More

Posted in Inspiration | Tagged , , , , , , | 1 Response

MinDispatch: Event-Driven Framework In Java Part 2

From the last post in this series, we developed a fixed, event-driven chat simulation. In this post, we will extend this example by refactoring. The objective of this tutorial is to teach effective design patterns in an event-driven model. First we will begin by designing the structure and behavior of the user and chat to describe our application. Second, we will bind the aforementioned chat state to the event handlers to fix constant parameters. Finally, we will use an event queue for separation of concerns.

Read More

Posted in Ingenuity | Tagged , , , , , , | Leave a comment

Partioning Discussion Sections for Lecture-Hall Sized Classes

Eric Hennigan had recently pitched a new partitioning problem to ACM: partitioning his discussion sections among two TAs such that students are equally distributed to each TA. Although the problem may be trivial to do by hand, it’s easy to decompose into discrete mathematics, and therefore, easy to analyze.

Read More

Posted in Ingenuity | Tagged , , , , | Leave a comment

Projects Matching Problem of ICS Clubs and Small Organizations

On the domain of all people seeking to get involved with projects and all people seeking talent for projects, there exists what I prefer to describe as the Projects Problem. This problem can be seen as a variation of the Stable Marriage Problem or Assignment Problem. The Projects Problem is specific to effectively matchmaking among idea people and feasible developers for resource-limited organizations such as small school organizations.

Read More

Posted in Innovation | Tagged , , , , , , | Leave a comment

Historical Problems with Closures in JavaScript and Python

Closures are necessary features for supporting the functional programming paradigm. A closure is an inner function has access to the variables defined in the environment of its outer function. They can be found in almost all modern dynamic programming includes including JavaScript, Python and Ruby; however, Python and JavaScript have both made their own mistakes in the initial implementation of the feature.

Read More

Posted in Inspiration | Tagged , , , , , | Leave a comment

Writing a Lexer in Java 1.7 using Regex Named Capturing Groups

One of my favorite features in the new Java 1.7 aside from the try-with-resources statement are named capturing groups in the regular expression API. Although, captured groups can be referenced numerically in the order of which they are declared from left to right, named capturing makes this more intuitive as I will demonstrate in the construction of a lexer.

Read More

Posted in Ingenuity | Tagged , , , , , | 3 Responses

Underscorejs: Text Processing on the Document Object Model (DOM)

Last time, we dove into higher-order functions that Underscorejs provides. This time, we’ll be utilizing those higher-order functions to process text on the DOM of a page.

Read More

Posted in Inspiration | Tagged , , , , | Leave a comment

Prelude into Underscorejs: Higher-Order Functions

DocumentCloud’s project, Underscorejs, interested me for a while now since I’ve seen its beautiful documentation produced through Docco.

Additionally, while playing with higher-order functions on Haskell, I wanted to see how they may simplify a standard set of computational tasks that I would normall write in C. Fortunately, JavaScript allows me to do this in a multi-paradigm fashion.

Read More

Posted in Inspiration | Tagged , , , , , | Leave a comment

MinDispatch: Event-Driven Framework in Java Part 1

We’ve gotten our feet wet with event-driven programming by developing a framework which controls the flow of data through our system. Effectively, I’ve made my framework available on Github for use by anyone: MinDispatch framework on GitHub.

Read More

Posted in Innovation | Tagged , , , , , | 1 Response
  • About Gio

    I am a torrent of ingenuity (or insanity) with a myriad of innovations (sometimes fallacies) and a wealth of inspiration (possibly naiveté). My name is Gio Carlo Cielo Borje and I like puffer fish because they're just cooltalkin', highwalkin' and fastlivin'.

    I'm also nineteen and a current student at UC Irvine for Computer Science.