Python Encapsulation

Introduction

Encapsulation is one of the fundamental aspects of Object Oriented Programming. It allows programmers better control of how data flows in their programs, and it protects that data. Encapsulation also makes objects into more self-sufficient and independently functioning pieces.

The concept of encapsulation builds on what you did in the last two guides with classes and constructors. Constructors usually are usually used in close conjunction with encapsulation and actually aid in making encapsulation work seamlessly.

Read more

Check Java Version

Check Java Version

There are several ways on how to check what version of Java is installed on your system. Most likely the simplest way is to directly use the java binary in combination with the -version option. To do so run java -version on your terminal.

$ java -version

Read more

introduction-to-traits

How to Reuse PHP Code Effectively – Introduction to PHP traits

Originally developed by Rasmus Lerdorf in 1994, PHP is one of the most used general-purpose programming languages. Originally born as a template language, during the years it evolved into a fully-featured language with proper OOP (Object Oriented Programming) support. Its latest incarnation, 7.x, introduced new features like return type declaration for functions and huge performance improvements. PHP is a single inheritance language: this means that a class can inherit only for one parent or base class. To overcome this problem a feature was introduced in the language: traits. In this article we will see how to use it and how it works.

In this tutorial you will learn:

  • How to use traits in Php

Read more

script-context-menu-entry

How to extend the GNOME Nautilus file manager with custom scripts

Although GNOME, in its 3.x iteration has been the object of many debates, due to its non-traditional desktop paradigm, it is probably the most used desktop on Linux. The default file manager included in GNOME is Nautilus (the application new name is “Files”). In this tutorial we will see how we can extend the file manager with functionalities provided by custom scripts.

In this tutorial you will learn:

  • How to use custom scripts to extend Nautilus functionalities

Read more

Python Polymorphism

Introduction

Polymorphism is yet another important aspect of Object Oriented Programming. No Warcraft fans, it doesn’t have anything to do with turning people into sheep. That’d be much cooler. Instead, Polymorphism allows methods and functions to use classes with similar functionality in the same way.

Polymorphism cuts down on the amount of code that you need to write by eliminating redundancy in a logical and meaningful way. It relies on you, the programmer, to be clever in your design and harness similarities in objects.

Read more

Perl script to retrieve an external IP address

This simple perl script will print your external IP address assigned by you internet provider ( great for someone with dynamic IP address ).

First, we download a html file from ipchicken.com and then phrase this file to match for IP address in format X.X.X.X using regular expression.

Next, the script removes all unnecessary characters and prints your external IP address on the terminal. Lastly, the script removes previously downloaded index.html file.

Read more

zenity-logo

How to use graphical widgets in bash scripts with zenity

Zenity is a very useful utility which let us create graphical user interfaces for our shell scripts. Several widgets exists, and can be used by invoking the program with the respective options. The widgets are based on the GTK toolkit, and return the result of the user interaction either on the standard output or as a return code.

In this tutorial you will learn:

  • What are the general zenity options
  • What are the some of the most useful available widgets and how to use them

Read more

javascript-logo

How to use arrow functions in Javascript

The arrow functions syntax was introduced with ECMAScript6: by using this new syntax, in some (but not all) cases, we can produce more concise and readable code, especially when our function contains only one expression. In this tutorial we will see how we can define an arrow function, what are the differences with standard functions and what are the cases in which the use of arrow functions is not appropriate.

In this tutorial you will learn:

  • What is an arrow function.
  • How an arrow function is defined.
  • The differences between arrow functions and standard functions.
  • The cases in which arrow functions cannot be used.

Read more

php-curl

How to perform web requests with PHP using the cURL extension

The open source libcurl is client-side URL transfer library which supports a lot of protocols like FTP, HTTP, HTTPS  and works on a multitude of platforms. The PHP cURL module let us access the functionalities provided by the library from the PHP programming language. In this tutorial we will see how to install the module and how to use it to perform simple requests.

In this tutorial you will learn:

  • How to install the cURL module
  • The basic steps to follow to initialiaze a cURL session and perform a request
  • How to perform a GET request with PHP cURL
  • How to perform a POST request with PHP cURL

Read more

How to check Bash version

Objective

This article will provide you with the information on how to check bash version on your operating system.

Operating System and Software Versions

  • Operating System: – Distribution Agnostic

Requirements

No special prerequisites are required is required.

Read more

Introduction to Ebay API with python: Obtaining keys and accessing the sandbox - Part 1

Introduction to Ebay API with Python: Obtaining keys and accessing the sandbox – Part 1

Ebay is one of the biggest ecommerce sites. Many people use it to search and buy products, and many stores use it to enlarge their audience and expand their business range.

If we want to operate programmatically on Ebay, for example to mass create or modify a set of items, or quickly confront prices, we must use the dedicated application programming interfaces. In this tutorial we will see how to prepare our working environment in order to use python to interact with the Ebay APIs.

In this tutorial you will learn:

  • How to create an Ebay developer account and generate APIs keys
  • What is the Ebay sandbox and how create a sandbox user.
  • How to obtain the Ebay python SDK.

Read more