The overview of application that we are creating is as follows. The application has two main components 1) REST client in Android 2) REST server in Node.js. We will focus on REST client as this writing is for retrofit which is client library. We will create REST endpoints that creates and list User. User has two properties., username and name. The program (Client) has two methods; one for creating user and other for listing all the users. Final android application has two fragments in pager view, one has interface for creating new user and another for listing the user. In backend, the program uses Mongodb as database.

# Programming Techniques

Tutorials and Mini Projects of C, C++, PHP, OpenGL, and other languages with C/C++ codes of Data Structure, Numerical Methods and Computer Graphics

## Wednesday, September 30, 2015

### Retrofit 2.0 tutorial with sample application

The overview of application that we are creating is as follows. The application has two main components 1) REST client in Android 2) REST server in Node.js. We will focus on REST client as this writing is for retrofit which is client library. We will create REST endpoints that creates and list User. User has two properties., username and name. The program (Client) has two methods; one for creating user and other for listing all the users. Final android application has two fragments in pager view, one has interface for creating new user and another for listing the user. In backend, the program uses Mongodb as database.

## Friday, February 7, 2014

### Discrete Cosine Transform and JPEG compression : Image Processing

JPEG is well known standard for image compression and Discrete Cosine Transform (DCT) is the mathematical tool used by JPEG for achieving the compression. JPEG is lossy compression meaning some information is lost during the compression. Lets dig deeper into the JPEG standard starting from the block diagram.

Above diagram shows the encoder part of JPEG. The decoder is the reverse of encoder except it doesn't contains the reverse part of Quantizer block and this is the main reason why JPEG is lossy compression. We cannot recover data lost during the quantization step. The operations performed by each block is presented below

## Thursday, January 9, 2014

### Google Cloud Messaging (GCM) in Android using PHP Server

GCM for android is a service which is basically used to send the data from server to the android devices. One use of this GCM is a push notification service. In this tutorial, I am going through all the steps needed to setup the GCM and build a simple but complete android application in Eclipse.

## Thursday, December 26, 2013

### Logistic Regression in Machine Learning

Before studying logistic regression, I would recommend you to go through these tutorials.

The first and most important thing about logistic regression is that it is not a "Regression" but a "Classification" algorithm. The name itself is somewhat misleading. Regression gives a continuous numeric output but most of the time we need the output in classes (i.e. categorical, discrete). For example, we want to classify emails into "spam" or "not spam", classify treatment into "success" or "failure", classify statement into "right" or "wrong" , classify transactions into "fraudulent" or "non-fraudulent" and so on. These are the examples of logistic regression having binary output (also called dichotomous). Note that the output may not always be binary but in this article I merely talk about binary output.

The first and most important thing about logistic regression is that it is not a "Regression" but a "Classification" algorithm. The name itself is somewhat misleading. Regression gives a continuous numeric output but most of the time we need the output in classes (i.e. categorical, discrete). For example, we want to classify emails into "spam" or "not spam", classify treatment into "success" or "failure", classify statement into "right" or "wrong" , classify transactions into "fraudulent" or "non-fraudulent" and so on. These are the examples of logistic regression having binary output (also called dichotomous). Note that the output may not always be binary but in this article I merely talk about binary output.

## Saturday, December 21, 2013

### Nepal over last Four Decades with R

The data was downloaded as csv file, which can be read with read.csv() function in R. We can run the R commands from R command line, and its really interactive.

### Gradient descent versus normal equation

Gradient descent and normal equation (also called batch processing) both are methods for finding out the local minimum of a function. I have given some intuition about gradient descent in previous article. Gradient descent is actually an iterative method to find out the parameters. We start with the initial guess of the parameters (usually zeros but not necessarily), and gradually adjust those parameters so that we get the function that best fit the given data points. Here is the mathematical formulation of gradient descent in the case of linear regression.

## Tuesday, December 10, 2013

### Numerical Methods Tutorials

This section consists of various numerical methods problems and their solution in C language. You can click each link to view the source code of corresponding problem in C.

- Solution of Differential Equation using RK4 method
- Solution of Non-linear equation by Bisection Method
- Solution of Non-linear equation by Newton Raphson Method
- Solution of Non-linear equation by Secant Method
- Interpolation with unequal method by Lagrange's Method
- Linear Curve Fitting
- Parabolic Curve Fitting
- Gauss Jordan Method
- Determinant of a NxN Matrix
- Inverse of a NxN Matrix
- Integration using Trapezoidal Rule
- Integration using Simpson's 3/8 Rule
- Integration using Simpson's 1/3 Rule
- Greatest Eigen value and Eigen vector using Power Method
- Condition number and ill condition checking
- Newton's Forward and Backward interpolation
- 2 Dimensional matrix multiplication

**Note**: All the codes are compiled in GCC Mingw compiler in windows. Attempting to compile in other compiler and platform may result errors. These tutorials are targeted for student and for learning purpose, so the code may not be optimized for the actual implementation. Some operations like matrix inversion and determinant are done without pivoting, divide by zero error may result in some cases. Partial and full pivoting are recommended.

## Friday, November 1, 2013

### Business Intelligence (BI) implementation in Nepalese Telecommunications

This article aims at discovering the business intelligence technologies that can be applied to the telecommunication industries to facilitate the business process. I have used the data warehouse approach to build the warehouse of telecom data from which various reporting tolls can be used to visualize these data and perform various types of analysis to support the decision making process. Furthermore, I have pointed out some data mining methods that can be added to make it more intelligent as its name "Business Intelligence'. This article shows all the steps from data collection to report generation through warehouse ETC process with related technological background and tools and technologies wherever necessary.

You can download the full article from here.

You can download the full article from here.

Subscribe to:
Posts (Atom)