Software engineering facts, information, and skills categorized as Software Engineering

Introduction to Angular JS

Varghese Chacko 1 year ago

Angular JS logoAngular JS is a framework in JavaScript. It is distributed as a JavaScript file and could be included in any HTML page with script tag. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.min.js"></script> The angular JS extends the HTMLwith directives. The key directives are ng-app which defines the AngularJS application, the ng-model directive which bids value of HTML controls like input widgets to the app and ng-bind binds application data to the HTML.

Python - Delete item from array by its value

Varghese Chacko 1 year ago

Python logoOften we encounter the situation where we need to remove item from array by value. For example, if we have an array [23, 1, 54, 32, 34, 8, 23]. We don't know or we are not sure about the index of the value 32, but we need to delete it. Python array has the built in function remove. For example

AngularJS Services - The singleton data and code sharing method

Varghese Chacko 1 year ago

Angular JS logoAngular services are used to organize code across the application and are wired together using Dependancy Injection. Angular services are lazily instantiated, i.e, they are instantiated only when an application component depends on it.They are singletons, ie there will be only one instance exists for the app and the components depending on the service gets the reference to the service.

Basics of object orientation and inheritance in perl

Varghese Chacko 1 year ago

Perl is an object oriented language. Perl has packages(class) that could be instanciated and used. At first, we need to decide the file namefor the package ans the perl class name carries the file name. For example, a package Student should be in the file Student.pm. If it shouldbe called Bright::Student, it should be saved asBright/Student.pm, ie Student.pm in a directory named Bright. There is no formal relationship between directory name and modules. That is just grouping for convenience.

Obtaining statistics for Net::FTP transfers

Varghese Chacko 1 year ago

With Net:FTP for uplink and downlink file transfers, we may have problems with obtaining the same statistics that are provided by ftp when you perform a manual transfer, i.e file size, transfer duration and transfer speed in KBs. The easiest solution is to print the $ftp->message;  It contain some message. For example,

The New (computer) Testament

Varghese Chacko 1 year ago

In 2007, I have translated apoetry about computers and posted on perl monks for fun. Just copy pasting it here, just for fun. 

Configure Amazon S3 for Mezzanine - a Django Blog engine

Varghese Chacko 1 year ago

Amazon S3 is an efficient static file storage system for its services and relatively cheap. On the other hand Django is a nice web development framework that doesn't like to handle static files. Mezzanine is a popular blog engine  built in Django. Since Django doesn't like to handle static files on production systems, we always have to configure a web server like nginx or apache webserver to serve static files. On the other hand, its easy to host static files to Amazon S3. The S3 configuration for static files is easy, but saving user uploaded files for Django web app may raise some permission issues. Here is how we have configured the Django-S3-Mezzanine blog.

Python for engineering your Internet of Things (IoT) Application framework

Varghese Chacko 1 year ago

Python logoPython has already gained it's momentum among IoT developers as it offers readability with syntax without compromising on syntax. In today's era, language doesn't really matter any more when it comes to IoT, ease of writing the code efficiently matter. Large number of available open-source libraries and ability to get more things done with fewer lines of code is an added plus. Python's clean syntax and one to one mapping of it's data built-in structure -dict- to JSON are added advantages. If your application works with database or communicates with JSON data, Python is the right choice. Python is the choice of language for Raspberry Pi, one of the most popular micro controllers in the market. The micro Python is another micro controller optimized for using Python. Few of the advantages of using python includes

Python sort array of dictionaries by value in the dictionary

Varghese Chacko 1 year ago

One of the cases we face in programming is sorting an array of dictionaries by value in the dictionary. In Python, it is possible to write a one-liner to achive the same. Suppose we have a list of dictwith name and age of students in a class.