Tag Archives: Programming

Input Strings with Blankspaces

In CLI programs getting input from the standard input is very important. Often we need to input strings from the user. Strings are delimited by newline, blankspace character and other characters as per the user interpretation. I am discussing on … Continue reading

Posted in C Language, Computer Science | Tagged , | 1 Comment

Allocating multidimentional array at runtime in C

Arrays in C language are static in nature, and cannot be resized at runtime. The effect of runtime allocation of an array could be achieved by hierarchically allocating blocks of memory at runtime. Below we discuss the mechanism to allocate … Continue reading

Posted in C Language, Coding Discussions, Computer Science | Tagged , | 2 Comments

C Language Constructors and Destructors with GCC

Constructors and Destructors are special functions. These are one of the features provided by an Object Oriented Programming language. Constructors and Destructors are defined inside an object class. When an object is instantiated, ie. defined of or dynamically allocated of … Continue reading

Posted in C Language, Computer Science | Tagged , , | 9 Comments

Bash Script: Counting lines, words, characters

Objective The objective is to write a shell script to mimic the functions of the wc command. This shell script would be made with bash built-ins and standard coreutils commands, and is made as accurate as possible to mimic wc.

Posted in Computer Science, Linux / Unix Shell | Tagged , , | 5 Comments

Bash Script : Bitwise Not Operation in bash

This is a post to present one method to inverse the bit pattern of an input number, the bitwise not operation on a bit pattern. I am presenting one method which i figured out.

Posted in Computer Science, Linux / Unix Shell | Tagged , , | Leave a comment

Simpson’s 1/3rd Rule

A brief introduction to the Simpson’s 1/3rd rule and a uniform interval Composite Simpson’s 1/3rd Rule implementation.

Posted in Coding Discussions, Computer Science | Tagged , , | 1 Comment

Bash Script: Generating Primes within Range

Objective Generating prime numbers within a range using bash script. The technique used in this implementation to generate the prime numbers is still the good old divide and check method, but with some tweaks attempting to make the execution a … Continue reading

Posted in Computer Science, Linux / Unix Shell | Tagged , , | Leave a comment

Trapezoidal Rule

A brief introduction to the Trapezoidal rule and a uniform interval Composite Trapezoidal Rule implementation.

Posted in Coding Discussions, Computer Science | Tagged , , | 2 Comments

Balanced Parenthesis Check

Objective To check if an entered string containing nested parenthesis are balanced and valid. This write-up presents a function with which a string is checked for balanced parenthesis.

Posted in Coding Discussions, Computer Science | Tagged , | 5 Comments

GCD of n integers

Greatest Common Divisor Let a and b be integers, not both zero. The largest integer d such that d exactly divides both a and b is called the greatest common divisor of a and b . The GCD of the … Continue reading

Posted in Coding Discussions, Computer Science | Tagged , | Leave a comment