Understanding ARP (Address Resolution Protocol) basics

The MAC address is how machines on a subnet communicate. When machine A sends packets to another machine on its subnet, it sends it using the MAC address. When sending a packet to a machine on the public Internet, the packet is sent to the MAC address of the router interface that is the default … Read more

Solved: compilation error for ARM toolchain “undefined reference to `_exit'”

Our ARM toolchain was extracted at “/home/devlab/Desktop/helloworld/assembly/gcc-arm-none-eabi-10-2020-q4-major/” hence lets first try to add this toolchain to terminal path as, Now, we had written simple helloworld.c program, which we tried to compile as, But we got the compilation error as, Solution This error can be solved by adding “–specs=nosys.specs” at the end of the command as, … Read more

Using GDB to debug functions defined in another file in C

In our previous post “How to use gdb for debugging application programs ( On Ubuntu Linux using C program )” we seen how we can debug the C program where all of the code is written in single C file. In this post, we will show you how you can debug the C function written … Read more

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