Wednesday, September 25, 2013

Building a Custom Compilier


Overview

A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program.

Code
Check out my compiler on Github. 

Monday, September 9, 2013

Creating a Bootable Ubuntu USB Drive


One of the most useful tools to have on a USB drive can be operating system install files.

Plug in the (larger-than-2GB) USB drive and back up its contents (unless you don't care).

Begin downloading this .iso from the official Ubuntu source.

If in Linux run in terminal:

sudo apt-get install usb-creator-gtk

(In Windows, install a USB OS boot tool from online)

Once all files are ready, run the usb-creator and load the .iso and the USB drive should be ready for use.


Thursday, September 5, 2013

Installing CGMiner on a Linux OS


In terminal, use wget to download a copy of the code:

wget http://ck.kolivas.org/apps/cgminer/2.11/cgminer-2.11.4-x86_64-built.tar.bz2

Decompress the compressed file:

tar jxvf cgminer-2.11.4-x86_64-built.tar.bz2

Thursday, August 15, 2013

Installing IDLE in Linux Mint


Within Terminal enter:

sudo apt-get install idle

Proto-Hack Challenge: August


Let's set up a Github account!

Drop a comment with your Github username so we can link up!


I'm Heshuge!


Thursday, August 8, 2013

Proto-Hack Monthly Challenges


Over the course of every month, I'm going to walk through the process of building a useful piece of hardware or software.

Sometimes this code will be a module for general use, or sometimes it may be the combination of previously made modules to result in a greater product.

Either way, stay tuned and get ready to start populating your own toolkit!

The first challenge for August is coming soon, so get ready to code something cool!

Sunday, August 4, 2013

Using Node.js and Non-Blocking Code


One of the largest strengths of Node.js is its great usage of non-blocking code.

In essence, non-blocking code creates a function to handle events as they come, so the program or application will be able to handle new events even if they arise during the last event's execution.


It's the difference between these two bits of code:

var contents = fs.readFileSync('/etc/hosts');
console.log(contents);
console.log('Doing something else');

...and...

fs.readFile('/etc/hosts', function(err, contents) {
  console.log(contents);
});
console.log('Doing something else');

But what's best, is to define a callback function...

var callback = function(err, contents) {
  console.log(contents);
}

...so it can easily be called with one line of code.

fs.readFile('/etc/hosts', callback);