Posts Tagged “programming”:

braincheck() perl script

During the weekend I was getting bored, so I looked for something creative to spend time on. Since two weeks I’m using elementary OS, an Ubuntu based distribution. It was a fresh install and my notebook is currently bare. For the creative fun I installed Padre, a Perl IDE. I... [Read More]

Sunday afternoon with Ruby

I usually say Sunday is the creative day! I looked around to see what creative thing I could be doing today. Ok, let’s learn another programming language. During the week I got hands on Computer Science Programming Basics with Ruby. The book consists of 188 pages perfect for some weekend... [Read More]

Geany – a lightweight IDE

Geany is a lightweight text-editor that incorporates IDE features. I came across Geany some time back when I had to edit scripts and test them quickly. I wanted something that could offer syntaxing, indentation, etc. My search lead to Geany. ![](/img/2017/02/geany-resize2.png) Geany supports auto-indentation, auto-complete, syntax highlighting among other features.... [Read More]

Bash – for loop

Say you have some PHP files and you need to replace the .php extension with .html. The “for” loop in bash comes handy to do this task. However, prior to renaming we need to strip the .php extension from the file name and here awk does a great job. See... [Read More]

Python ‘function’ explained

A function is a block of reusable code that performs a single action. Functions enable applications to be modular. Python provides many built-in functions like print(). You can also create your own functions. These are called user-defined functions. To create a function in Python start with the keyword def followed... [Read More]

Python lists

Spent some time scribbling about Python lists today. Python lists can hold values of mixed data type. They can be fully manipulated and any element can be called from the list at will. Creating a list is as simple as putting comma-separated values between square brackets. ``` mylist = [1,2,3,4,5]... [Read More]

C++ says hello world

Previously, I posted a couple of C examples. While C does not support OOP, I had to turn towards C++ for exam needs. ``` #include int main() { using namespace std; cout << "Hello world!" << endl; return 0; } ``` [Read More]
Tags: programming c

One dimensional array – C

Use of array to store a ‘string’ of characters. In the code below you’ll notice I’ve specified the array size as ’12’ which corresponds to the number of characters in ‘Hello World!’ including the white space. Not specifying the array size, i.e using arr[] = “Hello World!” would have automatically... [Read More]

Playing with the C language

Points to remember while coding in C : – put newline (\n) in your printf so as the output does not overlap with the terminal prompt. – keep clean tab spaces to make code reading easier. – put a getchar() to prevent the program from vanishing after execution (unlikely to... [Read More]

Bash script for remote command execution

I’ve come across this a couple of times. As a system admin’s day to day tasks, your boss must have at some time given you a long list (let’s say 50+) of servers and all you got to do is getting some system information. Yeah, I know the feeling. It... [Read More]