07 May 2018

About Apache Cassandra

From Wikipedia - “Apache Cassandra is a free and open-source distributed NoSQL database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure”.

Features of Apache Cassandra

  1. Decentralized. No master node. Multiple nodes in a cluster. Data is distributed across nodes
  2. Replication supported across multiple data centers.
  3. Scalable - Throughput increase linearly with new machines
  4. Fault-tolerant - Failed nodes can be replaced with no downtimes
  5. Flexible consistency

Source code:

Version: cassandra-3.9

11 Mar 2017

Mailbox notification using arduino

Mailbox notification

04 Mar 2015

Cracking an arduino open.

Arduino UNO R2 expained: This arduino has two mcu - Atmega8u2 and Atmega328. Atmega8u2 has the DFU bootloader and the usb-serial firmware loaded to it by default. The usb-serial firmware is what reads the usb in buffer and converts it to serial data for the main chip - Atmega328 to process.

DFU bootloader: The DFU bootloader allows you to update the firmware in Atmega8u2 without an ISP(In system programmer).

Bootloader: This bootloader in Atmega328 is the one that loads the main program stored in flash. When the arduino is plugged in, this bootloader runs and then the main program starts running.

More to follow..

02 Mar 2015

Writing a recursive descent parser.


Recursive descent parsing algorithm.

Backus normal form:

It is a system that describes grammar of natural language. The power of BNF is in its recursive nature.

BNF for a while loop:

<while-loop> ::= "while" "(" <condition> ")" <statement>

Recursive descent parser:

This parser is most suited for written by hand.

An example parser for the BNF below:

<expression>  ::=  <Integer>  |
               "(" <expression> <operator> <expression> ")"
               
<operator>  ::=  "+" | "-" | "*" | "/"

IO class:

methods:

peek, skipBlanks, getChar, getInt()

Parser Class:

Each rule will have a method. corresponds to an IF statement.Skip blank lines at beginning of each rule and whenever required. After every peek there would be a getchar

methods:

getOperator, expressionVal

Writing a parser with operator precedence:

This depends on how the BNF rules are written:

((3*2) + 2 / 4 )

The operation happens with /,* and then it adds the two results.

((3*2) + 2), 4 are two factors.

3*2 is a term which is a combination of two factors. And the final expression is a (+,-) combination of terms.

In BNF:

<expression> := [-] <term> | [+|- <term>].. 
<term> := <factor> | [*|/ <factor>]..
<factor> := <number> | "(" <expression> ")"

[].. is repeated zero to many times. so that constitutes a while loop.

Also added a parser program with expression tree.

Source: parser

Older Posts

Project 1 - Raytracer 01 Mar 2015
Reading and writing to a virtual com port device using libusb. 01 Feb 2015
ported to jekyll 16 Sep 2014
Python rocks - All subsets 07 Apr 2012
Unix Pipe 28 Mar 2012
Intro to LLVM 12 Oct 2011
Powershell 27 Jun 2011
Display Gamma 14 Jun 2011
Advanced C++. 14 Jun 2011
C++ Design 13 Jun 2011
Warcraaaaaaaaft 13 Jun 2011
My first forward to the team. 13 Jun 2011
C++ Tools 13 Jun 2011
Cyclic redundancy check 13 Jun 2011
Floating Point 13 Jun 2011
HDCP 13 Jun 2011
Some cool code snippets 13 Jun 2011
C++: DLL 13 Jun 2011
Visual Studio IDE 13 Jun 2011
C++ file handling 13 Jun 2011
Fish schooling 13 Jun 2011
Awesome tools 13 Jun 2011
Tutorials 13 Jun 2011
Ruby 13 Jun 2011
C++: Using function adaptors 13 Jun 2011
C++ Win32 Threads 12 Jun 2011
Thread Manager pattern 12 Jun 2011
Boost 12 Jun 2011
Video Lectures 12 Jun 2011
Books 12 Jun 2011
VIM 12 Jun 2011
OpenCL 12 Jun 2011
MFC - Most frustrating creation 12 Jun 2011
WPF 12 Jun 2011
C++ Tidbits 12 Jun 2011
Hello World 12 Jun 2011