All Posts by ‘Hassan

Post

TeleMart – A simple ERP System

Leave a reply

I have been following a Diploma in Software Engineering at ESOFT, and for my final project, we were asked to develop a system for an imaginary company called “TeleMart” which basically is a mobile phone retailer. So, I started off with sketching a simple “Entity Relationship Diagram” as seen below.

TeleMart ER Diagram

TeleMart ER Diagram

It is a simple diagram, and of course, my first. Although it looked right at first, at the end, my entities were different from what it were planned to be like in the Entity Relationship Diagram.

TeleMart Use Case Diagram

TeleMart Use Case Diagram

But, the ER diagram was not the only diagram I designed. I also designed a Use-Case diagram as you can see above, which basically outlines the basic functionality of the system.

Talking of the technologies used in this system, the language I used was Java, mainly due to the fact that Java helps to deploy applications to various platforms unlike the other option, C#. Also, for the GUI, I used JavaFX which is quite a powerful tool, and I really like the fact that you no longer have to create objects, etc. to design the view. Instead, you have to write FXML code. FXML is basically XML, which has JavaFX specific tags to define the view. Moving to the database side of things, I used MySQL and I used Hibernate as an Object-Relational Mapper that basically fetches rows, etc. and represents it in the form of Objects to allow for more Object-Oriented-ish code. More over, it makes your application more flexible with regards to what database driver you use. Basically, if you want to change to perhaps MSSQL in the future, all you do is create the tables, etc. on that database, and change the driver. Simple as that! Finally, you could take a stroll at the source code or even contribute at TeleMart’s official GitHub repository found here.

Post

StudentNetwork – A competition project

2 comments

First of all, I am sorry about the fact that I have not written on this blog since a while, since I have been quite busy with this project over the past few weeks. So, what is this about? Well, first take a look at the interface:

StudentNetwork Login Screen

StudentNetwork Login Screen

As you can see, it is a simple system that can be hosted by organisations on their local networks that can be accessible by the people existing in that particular organisation. This system consists of a live chat room, where everyone can chat with each other. This system also consists of a Question and Answers area. This place enables users to ask questions, and provide answers to each others, up vote posts, down vote posts, comment on posts, and also, the person, who asked a question can tick the best answer out of multiple answers obtained. Isn’t that amazing? Moving on, the users are able to change their personal details like their display name, email, password and of course logout of the system when their job is done. Here is what the dashboard looks like:

StudentNetwork Dashboard

StudentNetwork Dashboard

For this particular competition, the theme I chose was “Integrating education into Technology” and therefore, this is what I created. Then, I had to choose the platform, and I choose the web most importantly because the web can be easily accessible through any device which has an internet connection, and therefore, easily to target a large user base. The next decision I had to make was between PHP and Node.js for server-side. I chose PHP simply due to the fact that PHP applications are a bit easier to setup, and considering the fact that PHP7 was on the way, which made PHP look more future-proof. But, with regards to being “future-proof” I would not say Node.js is not future-proof as it is being maintained by Google. Then, I basically used HTML, CSS and Bootstrap from the UI, JavaScript with jQuery for the client side and I used MySQL as a RDBMS (relational database management system) solution.

By creating this piece of software, I placed second overall in the ESOFT Dev Challenge 2015, and was also the second in the web development category. Here are some pictures of me from there:

Me showcasing StudentNetwork

Me showcasing StudentNetwork

Us waiting for the exhibition to commence

Us waiting for the exhibition to commence

Me receiving the prize from Mr. Upul Dassanayake

Me receiving the prize from Mr. Upul Dassanayake

Group photograph of everyone present that day.

Group photograph of everyone present that day.

Me receiving the 2nd place from Mr. Dayan Rajapakshe.

Me receiving the 2nd place from Mr. Dayan Rajapakshe.

Me receiving the prize from Mr. Upul Dassanayake

Me receiving the prize from Mr. Upul Dassanayake

Post

Void return types coming in PHP 7.1!

Leave a reply

As we all know the fact that we will have the ability to declare the return types from PHP 7 onwards, there might also be situations where you may not want to return anything, and therefore, an RFC regarding void return types was initiated, which requested the implementation of the void return type for methods or functions which will indicate that there is nothing to be returned by the function or method.

You could declare the return type as void for a function or method this way:

function returnNothing(): void {
    //perform operations
}

After a vote between some PHP internal members, this idea received 37 positive votes against 7 negative, and therefore, was decided as approved for PHP 7.1 as you can see in this message here.

Post

An Alarm Application, programmed in Java.

Leave a reply

This is a simple and easy to use alarm application programmed by me using Java after once coding it, having it for review and then re-working on it. For the Graphical User Interface, I used JavaFX considering that Swing is now a bit old. This is very simple to see, you enter the hours, minutes and seconds to countdown for the alarm to start ringing. However, a draw back is that it will not work if you close the application. You need to at least keep it minimised for it to work. It is multi-platform, and works on all desktop based operating systems that Java supports. You can generate a jar, or use the one provided in the dist/ directory. I recommend you strongly to use Java 8 to run this application. This application is tested for Java8u60 update.

You can visit the GitHub repository here for the source code and files.

The user interface on Mac OS X

The user interface on Mac OS X

Post

PHP7, are you ready for it?

Leave a reply

You guys may very well be aware of the fact that PHP7 is coming by the end of this year which is something very significant to every person out there who uses PHP. May it be a freelancer, a student or a company, everyone right now is on about PHP7’s release.

1. Scalar type declarations. You guys may be aware that Scalar type declaration is a feature of PHP7, but what really is it? Well, with this feature, you can now type hint data types where-as in previous versions of PHP, it was only possible to type hint classes and arrays.

2. Return type declarations. In PHP7, not only can you type hint data types, you can also define the function or method return data type. Which is the type of data your function or method is going to return after it is done executing. For example, if your function or method returns a sum of two integers, then the return type is obviously integer.

3. Null coalesce operator. With this brand new null coalesce operator, you can make your code more shorter when using ternary operators. You may do something like $age = isset($_GET['age']) ? $_GET['age'] : null); before, but you no longer need to write that much any more! All you have to do to achieve that is to write $age = $_GET['age'] ?? null; and that is it! That does the trick for you right away.

4. Spaceship operator. This is another cool operator coming in PHP7. The symbol or the notation for this operator is <=> and it is used to compare two integers, floats or strings. If both of the values are equal, then it returns a 0. If the left value is smaller than the right value, then it returns a -1 and when the left value is greater than the right value, then it returns a positive 1. You might be wondering how the strings are determined to be greater or smaller in value, well, it is determined by the ASCII value they hold.

5. Constant arrays. With this, you can define an array which is a constant using the define() function. Until PHP 5.6, it was only possible to achieve this using the “const” keyword. The syntax is as follows:

define('PEOPLE', [
    'John',
    'Doe',
    'Jack'
]);

Sounds cool, yeah?

6. Anonymous classes. You might have heard of anonymous classes. If you haven’t, then, anonymous classes are classes which are basically not defined as normal classes. They are basically just use and dispose classes. An example would be:

$dog->setSoundAdapter(
    new class {
        public function makeSound()
        {
            echo "Woof!";
        }
    }
);

So, as you see in the above code, a class is just created as well as instantiated at the same time and passed onto a method, and as soon as it serves it purpose, it disappears from the context.

Although these are not the only features going to be implemented in PHP7, I am going to stop here. If you want to know the complete list, then you can go ahead and take a look here at the PHP’s official site.

Credits: PHP Manual for information regarding PHP7.

Post

Daily Task Manager – An android app

Leave a reply

Daily Task Manager is an Android application programmed by me in Java for Android devices running the Android version 4.0 and above. Feel free to download it here on Play Store. In this application, you can schedule your tasks and upon completing them, just click on them and delete them. This will make you remember important tasks you need to do without forgetting them. May it be meeting a friend, or doing your homework, you can schedule any sort of task in this!

Daily Task Manager

The daily task manager banner.

Post

Temperature Converter – An android app

Leave a reply

This is an extremely basic temperature conversion application, which converters Celsius readings to Fahrenheit and Fahrenheit readings to Celsius. I programmed this application using Java, and it is available for download on the Play Store here for devices running Android 4.0 and above. Feel free to suggest any features to this application by replying to this article.

Temperature Converter

The temperature converter banner

Post

Number to Words Converter – A personal project

Leave a reply

Number to Words Converter is a Windows application written in C# (pronounced as C-sharp) a by me which accepts a numerical input such as ’10’ and gives an output in the word form of it. In this case, the output would be ‘Ten.’ It can convert any number ranging from negative one million to positive one million. The main purpose of this project was to practice on writing efficient code. I tried my best, and ended up with this code hosted in my GitHub repository.

Number to Words converter.

A snapshot of the simple yet powerful interface of the application.

Post

BetFriend – Work Experience

2 comments

BetFriend, an upcoming establishment, hired me to program their website which will be served to thousands of users online. In this project, my main job was to design and program a responsive interface and a clean, robust and an efficient backend in PHP for the site. At first, the job looked quite complex to do, but then, after a bit of research, I found out about this thing called top-down design. This really helped me! It was very easy to follow this approach. All I did was, I broke the complex problem into smaller manageable problems in a hierarchical manner, which enabled me to program this website in a modularised manner.

You might wonder how that helped me? It helped me achieve Separation of Concerns very easily! I was able to write very clean and easy to test code which really boosted my productivity, and it actually allowed me to spend more time testing than writing code to ensure no bugs existed in the program. And upon delivery, this is how my client reviewed my service:

“Quick service, professional, neat code with great after service!”

BetFriend

Interface of BetFriend. Also, ignore the dummy text.

Throughout this project, I used various technologies such as Composer, Laravel framework and Bootstrap framework. I used the markup languages Hypertext Markup Language (HTML) and Cascading Style Sheet (CSS) along with the Bootstrap framework to code the visual appearance of the site. To add a bit of liveliness in to the site, I used the language JavaScript with the jQuery framework. For the backend, I made use of Composer to import the Laravel framework, which is what powers the site and the language which runs the backend is obviously PHP. My choice of using the Laravel framework is due to its’ popularity. Since my client requested to mainly focus on maintainability of the code, Laravel looked like the best option to me.

After completing the specified job, I also provided a 3 months after sale service which included fixing any bugs and errors of the system. Although I promised a 3 month only after sale service, I did usually fix bugs for my client when he spotted any in the system. Currently, my client, maintains his site himself, and has added multiple features to his site himself. I hope his site becomes a great success, and I will definitely update this article with the link to his site once he has opened his site to public.

Post

Introduction

Leave a reply

Hello! My name is Hassan Althaf, and I am a programmer from Sri Lanka. Over the past few years, I have been teaching myself various kinds of computer languages from the internet. From basic mark-up languages to complex programming languages, I have worked hard to learn at least one language from every category of computer languages.

Recently in June, I applied for a Diploma in Software Engineering at ESOFT, where I am currently learning some topics related to Software Engineering, and hopefully, will complete the course by late 2015 or early 2016.

So, in this blog, you will see various kinds of posts made by me which are related to programming and IT. Hoping to see you view all my present and future posts!