Example of creating JSON Array in JAVA

To know more about JSON , read “What is JSON and Understanding JSON syntax with simple example” and “Cloud Technologies” In this post, we will show you how to write a simple JSON Array by writing code in JAVA. This post is related to our previous post “Example of creating simple JSON in JAVA” Lets … Read more

Example of creating simple JSON in JAVA

To know more about JSON , read “What is JSON and Understanding JSON syntax with simple example” and “Cloud Technologies” In this post, we will show you how to create a simple JSON by writing code in JAVA, Here, the JSON object is created as, now, the JSON elements can be added to this object … Read more

Using Decision Making Statements, if and if-else in C program

When you are writing C program, sometimes you need to make certain checks on variables and based on which you need to take some decisions.. this is called as Decision making statements in C programming Language. In this post, we will show you how you can use simple conditional statements “if” and “if-else” in your … Read more

How to generate random number between two numbers in Java ?

This post demos how you can get the random number between two numbers in a simple java program. When you are feeding some dummy data to something, you are required to simulate the inputs for your project / product. So mostly this random numbers are used in such scenarios. $ vim RandomNumber.java [java] import java.lang.Math; … Read more

How to use Single Instance Class / Singleton class in Android / Java ?

The single instance classes are mostly used when you don’t know how to create a object of this class from some distant class or instead of allocating memory for the class, just create object once and use it till entire life of the application. The Single Instance class, also called at Singleton class just creates … Read more

Associativity of Operators in C Programming

When some expression in C contains two operators with same/equal priority, the expression gets executed as per the “Associativity of Operators”, Check below program to understand, why it prints the results as “5” and not “1” $ vim associtivity_in_c.c [c] #include <stdio.h> int main(){ int a = 3/2*5; printf("a=%d\n", a); /*Above Statement will print result … Read more

How to execute C code from go – c to golang binding

package main // If a Go source file imports “C”, it is using cgo. The Go file will have access to anything appearing in the comment immediately preceding the line import “C”, and will be linked against all other cgo comments in other Go files, and all C files included in the build process. /* … Read more

How to resolve error : ” no buildable Go source files in “

Sometimes when we try to compile an unknown go package, we can see an error like “no buildable Go source files in”, the possible solution could be, Check if the package which shows error “no buildable Go source files in” is using C code, like import “C” in the source file, in that case, we … Read more

Understanding gcc compilation steps : Linux compilation steps

Copy paste the below shell script and execute on your terminal. $ vim understanding_compilation_with_gcc.sh Copy below highlighted code and run the script as, $ bash understanding_compilation_with_gcc.sh ————- code start ——————— #!/bin/bash echo “ For any given input file, the file name suffix determines what kind of compilation is done: file.c C source code that must … Read more