How to use FactoryBoy to create model instances in python for testing

Testing is one of the basic and most important things that are needed to be done. Also, it is one of the most important developmental phases. I have already discussed testing in one of my earlier posts. In that post, I talked about the way in which we can write tests for models. Today I am going to talk about using FactoryBoy for testing Django application.

Read More

How to install nginx in Ubuntu 16.04

Today we are going to talk about the installation process of nginx which is used as a server and is known for the providing better services in the production environment. I have been using apache2 from a long time. Recently, I got the opportunity to use nginx for one of my recent project. Before starting I want to say that I was already using apache2 for any service I was providing and using on my local services. If you already have apache2 installed and you want to run nginx then you have to stop the apache2 two service otherwise you will receive the error like:

Read More

How to remove extra sensitive information from git commits

Many times we out of knowledge give extra sensitive information to files and directories and send them into Git. Git being the version control system saves everything into the system. So if you add a password to a file which you can’t really change in the future, Git will store the password forever. This way the hackers can take down your system. 

Read More

Export Wordpress Blog to Jekyll

This is the first time I am posting on this blog. All the posts before this date have been exported from WordPress so you will find some mistakes in them. But I am sure from now onward, this is the new home for all my blog posts. I am very new to the Jekyll but I will like to learn it as fast as possible.

Read More

Importance of logging in python

Not in the mood of writing much today so will probably leave the link which I found useful and will definitely help us if we want to know more about logging.

Read More

Writing unit tests for the models

You must have heard about the term test-driven-development if you are into the developmental works. It is the development in which you write tests before writing the logic. That means first you write the stuff that can break the code and then you write the real code that doesn’t break which is unbreakable from that point of view.

Read More

Updating the models

Today I was working on another branch to write the code that can fill the database. I scanned some code and saved copied the results to open them in clean JSON format because I wanted to iterate over the results. I used the online the following JSON parser.

Read More

Using requests library to grab code present at an URL

Finally, we were on the stage to build the main module of the project i.e. the module to get the URL’s from the users and return the scan results. As the first part, we are picking whatever is present at the URL, scanning the retrieved thing and showing the results.

Read More

A word about character sets - ASCII, unicode, UTF-8

Let’s talk about everything as it happened in the history. It was the time when UNIX was being built. ASCII came into the existence at that time. More such features were used before that but they are not being used now so talking about them is not valid anymore.

Read More

A word about subprocess module

It has been a few days since I have been working on the GSoC project. Although I haven’t been able to write about all the things going on that side. From now on probably I will talk about it more often. Yesterday I managed to upload the code on our local experimental server and show the results to the mentor. Thank god, it didn’t break( I haven’t written any code to handle the errors) and everything worked as expected. Next thing is to attach celery so that the actions happens in the background. Now both celery thing and the server are for the other day. Today I will be talking about subprocess, a module of python that we are going to use for running bash commands.

Read More

Getting started with C++ boost library

Last few days were well spent with the C++ library boost. It was a great learning experience. I was introduced to the one of best-kept code and some new coding paradigms. Along with that it was the first time I was coding with the new standards of C++11 and C++14.

Read More

Changing the commit messages that are already pushed

So in this post, we will be talking about the process of changing the commit messages that are already pushed into the remote. But, before talking about changing those messages we must know about the basics commands of GitHub. Please refer to this post, if you have less knowledge about the Git.

Read More

converse.js and candy.js Functionalities

I have tried both converse.js and candy for creating a chat application on the browser for some use. Both of them provide very good functionality. Both converse.js and candy are based on XMPP client and pull data from the ejabberd server and render it on the screen on the browser.

Read More

Creating graphs using data form .csv file

Yesterday I was talking to a friend and he told me that he has some work that he needs to complete by the following night. He asked me for the help and I decided to help as my exam was postponed. He said that he had a .csv file( comma separated values) and want to shift the whole data into postgresql database.

Read More

How to create a session variable in Django

Long time ago browser developers recognized that we need to store the data produced during a user session so that we can refer to that data in the future. The user actions can lead to some calculations and after doing this cumbersome calculations we don’t want to do the calculations again and again.

Read More

Simple JavaScript program that handle Keyboard events

In this post I am going to talk about one of important aspect in programming i.e. handling keyboard events. Now being important doesn’t mean that it is difficult but I have to admit that I haven’t tried it from the day I had started programming. Now I was working with one of my friend and she wanted me to do it for her. I found the task interesting as I haven’t done it earlier.

Read More

Adding a tuple to the end of the basic tuple in python

Another problem was encountered while working on the python web framework, Django. But this time the problem was more of the language oriented rather than being framework oriented. As I am not a python programmer so I never knew these basic things. So, first of all I was getting an error, whose statement went like this :

Read More

How to install django using virtual environment

Virtual environment is made when you want to run different version on single system. In this example I am going to setup a virtualenv for installing django 1.9. This is because the default version of python in the ubuntu system is 2.7(approx.) and the django is in the version 1.7. And the python is very important in the case of Ubuntu graphics. (If you want to test this try to remove python from your system and get ready to waste 2-3 hours of your time trying to figure out what happened. You might have to install Ubuntu again).

Read More

Creating documentation using Doxygen in Ubuntu

Doxygen is a tool to create a documentation for your program/project written in the languages like C, C++, Java, python and so on. It reads the well formatted and special doxygen comments to create the required documentation. This documentation is very important for the new developers who want to help in the development of the project. Documentation is one of the main pillar of an open-source project.

Read More

Using my own coded software to study for Exams

Some time ago sir hosted a hackathon to make some progress to enhance the ebook software that he was using on his website. Everyone was given a specific task on that day. My task was to read the script and make some changes in the script. But some reason we had to drop that idea. So I decided to start building something new instead.

Read More

How to simplify command's name in Ubutnu

I love the amount of freedom given to you as a user when you work on a system with Ubuntu installed on it. So, I was not having sudo powers for the installing meteor on the server, So I asked one of the server admin(Mandeep) to do it for me. He told me that I don’t need to be signed as a root admin. I was not sure about it as their was a error when I was running the command to install meteor.

Read More

How to show html on the browser

Sometimes we want to share html code on the browser for example today I wanted to give a presentation. This presentation was made with the help of reveal.js. Now reveal.js uses html to make presentations. There was some html code that I wanted to show on the browser. I searched on the web and found pre and code tag along with blockquote to show html on browser but it wasn’t working as it was taking some of the html tags in the code and executing them.

Read More

Meteor.js : Working with routes

As we all know that meteor can only be used to create a single page web apps. Still there are many instances when one want to work with different URL’s on a web applications.

Read More

Creating a design with media queries

Media queries are used to tell the browser about the various breaking points in the website so that we can give a different css styling for all those breaking points. This type of CSS is used to make the website responsive. Breaking points are the widths at which the design breaks or is damaged.

Read More

Merge Sort Program using JavaScript

So I was trying to create a Merge sort program using JS. Before trying to make the program we first have to understand what is the concept of merge Sort. To get a good example I went to wikipedia where I found very interesting GIF which explained the the basics of Merge sort.

Read More

Learning LaTex

LaTex, I had never heard about this term before doing this project, but when I came to know about it’s features and found it excellent.LaTex is a document markup language and document preparation system for the TEX typesetting program. Within the typesetting system, its name is styled as LaTex.

Read More

Learning Meteor

Meteor is a JavaScript web development framework. Which does most of it’s work using the most used language of the web i.e. JavaScript so if you are an experienced JS developer you will have no difficulty in grabing most of it’s concepts. I have created a sample app for the web using this framework. This app is used to manage your tasks and can be easily setup using. The apps developed in meteor can be easily converted into an android or ios app increasing the user base. Due to this reason this framework is very popular among the developers. That is why it is the top ten most starred repository on the web. The language at the backend of the meteor is also JS. So many times the code for both things turns out to be similar. So you don’t have to write things again and again. File structure is self describable with self explanatory meanings and can be easily understood.Database used is NOSql : MongoDB making it favourable for data analysts to try thier hand on the data provided to them according to the user’s action on the website and create a better user experience and in the end increasing the revenue generated by companies. Meteor also provide free hosting to the small apps with some special domain for it’s users. You just have to sign up on their official website and they will provide it for you. The setup for the production is almost similar to the testing. You can launch your app on the production and check for it’s performance and later buying your own domain, if it works fine. Meteor is built on the top of Node.js. So, you have to install node before using this extensively used framework. After three easy commands you will be able to run the sample program already created for you by the meteor team.

Read More

Learning Bootstrap

BootStrap is javascript framework which is used to develop responsive websites. BootStrap is also known as twitter bootstrap is developed by the developers at Twitter. This library is extensively used by the web developers and designers to create almost irresistable content that looks good on all screen sizes. Bootstrap is a free and open-source front-end web framework for designing websites and web applications. It contains HTML- and CSS-based design templates for typography, forms, buttons, navigation and other interface components, as well as optional JavaScript extensions. Unlike many web frameworks, it concerns itself with front-end development only. Bootstrap is the second most-starred project on GitHub, with more than 100,000 stars and 45,000 forks. The Bootstrap adopted the famous grid system and continue to work with it since the 2.0 release. Starting with version 3.0,Bootstrap adopted a mobile-first design philosophy, emphasizing responsive design by default. With the great documentation and large fan base you can easily find tutorials on this topic making it easier to start writing your bootstrap enabled. And the best part is that you only have to know simple html to get started.

Read More

Basic commands in GitHub

Git is the open source distributed version control system that facilitates GitHub activities on your laptop or desktop. The commonly used Git command line instructions are:-

Read More

Installing SageMath and Biber into the system

The next task which was easy and was done in short interval of time was the installation of SageMath and biber. I followed the instructions given in the readme file and used the commands one by one was able to install them.

Read More

Installing LaTex to your system

Installing LaTex was a fairly easy task to accomplish but was very time consuming because of the slow speed of the internet. It took me more then five hours to install this software into the system. The command used was :

Read More