Skip to main content

Posts

How to deploy an Angular ( Angular 4) Application

You can use http-server to run your Angular App.  First of all generate a build using the command 1)  ng build This will create a dist folder in your directory structure. When you run the  ng build  command, it creates a  /dist  folder. Here are the files and their associated sizes after running the above command. Note : Your file sizes will vary based on your project. As you can see, we have a massive vendor.bundle.js file, because when you run  ng build  without specifying the production environment, it doesn't make use of uglifying and tree-shaking. 2)  ng build --prod So, adding the production flag reduced the bundle from around 3.6 MB to 423 KB, which is nearly an  83% reduction . After this, run  http-server ./dist , which will start serving your project from dist folder. Make sure you have installed http-server globally using npm install http-server -g
Recent posts

Customize your phone to Android 8.0 look

Google launched its latest version of Android OS, 8.0 Oreo in the end of 2017. Many manufacturer's have already started using it out to their devices. While different manufacturer's have their own user interface layered on the Android OS, Pixel and Nexus smartphones carry pure Android UI, which is simple to use Motorola and Nokia too use stock Android but that is not as vanilla as the ones found in Pixel and Nexus devices. If you are using one of the smartphones above smartphones and you want to experience how Android Oreo feels like in your device, follow these steps. It's really easy. Step 1 - Go to 'Settings' Step 2 - Search for 'Unknown Sources' and allow the device to download apps from unknown sources. Step 3 - Go to GitHub page - Click here Step 4 - Tap on 'Rootless Pixel Launcher 2.1' and tap on 'Launcher3-aosp-debug.apk' Step 5 - Download the apk file and install it. Step 6 - Once you installed, tap on the home bu...

Downloading Cassandra in Ubuntu 16.04

Installation from Debian packages For the <release series> specify the major version number, without dot, and with an appended x . The latest <release series> is 311x . For older releases, the <release series> can be one of 30x , 22x , or 21x . Add the Apache repository of Cassandra to /etc/apt/sources.list.d/cassandra.sources.list , for example for the latest 3.11 version: echo "deb http://www.apache.org/dist/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list Add the Apache Cassandra repository keys: curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - Update the repositories: sudo apt-get update If you encounter this error: GPG error: http://www.apache.org 311x InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A278B781FE4B2BDA Then add the public key A278B781FE4B2BDA as follows: sudo apt-key adv --keyser...

How to Install and Configure MongoDB on Ubuntu 16.04

What we will do in this tutorial: Install MongoDB Configure MongoDB Conclusion What we will do in this tutorial: Install MongoDB Configure MongoDB Conclusion Install MongoDB on Ubuntu 16.04 Step 1 - Importing the Public Key GPG keys of the software distributor are required by the Ubuntu package manager apt (Advanced Package Tool) to ensure package consistency and authenticity. Run this command to import MongoDB keys to your server. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 Step 2 - Create source list file MongoDB Create a MongoDB list file in /etc/apt/sources.list.d/  with this command: echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list Step 3 - Update the repository update the repository with the apt command: sudo apt-get update Step 4 - Install MongoDB Now you can install MongoDB by typing this com...

Why do we need Unicode?

In the early days, all that existed was ASCII. This was okay, as all that would ever be needed were a few control characters, punctuation, numbers and letters like the ones in this sentence. Unfortunately, today's strange world of global intercommunication and social media was not foreseen, and it is not too unusual to see English in the same document  But for argument's sake, lets say Joe Average is a software developer. He insists that he will only ever need English, and as such only wants to use ASCII. This might be fine for Joe the user , but this is not fine for Joe the software developer . Approximately half the world uses non-Latin characters and using ASCII is arguably inconsiderate to these people, and on top of that, he is closing off his software to a large and growing economy. Therefore, an encompassing character set including all languages is needed. Thus came Unicode. It assigns every character a unique number called a code point . One advantag...

Node.js - Introduction to Node.js

Introduction to Node.js The modern web application has really come a long way over the years with the introduction of many popular frameworks such as bootstrap, Angular JS, etc. All of these frameworks are based on the popular JavaScript framework. But when it came to developing server based applications there was just kind of a void, and this is where Node.js came into the picture. Node.js is also based on the JavaScript framework, but it is used for developing server-based applications. While going through the entire tutorial, we will look into Node.js in detail and how we can use it to develop server based applications. What is Node.js? Node.js is an open-source, cross-platform runtime environment used for development of server-side web applications. Node.js applications are written in JavaScript and can be run on a wide variety of operating systems. Node.js is based on an event-driven architecture and a non-blocking Input/Output API that is designed to optimize an appli...

Normalization in DBMS: 1NF, 2NF, 3NF and BCNF in Database

Normalization is a process of organizing the data in database to avoid data redundancy, insertion anomaly, update anomaly & deletion anomaly. Let’s discuss about anomalies first then we will discuss normal forms with examples. Anomalies in DBMS There are three types of anomalies that occur when the database is not normalized. These are – Insertion, update and deletion anomaly. Let’s take an example to understand this. Example : Suppose a manufacturing company stores the employee details in a table named employee that has four attributes: emp_id for storing employee’s id, emp_name for storing employee’s name, emp_address for storing employee’s address and emp_dept for storing the department details in which the employee works. At some point of time the table looks like this: emp_id emp_name emp_address emp_dept 101 Rick Delhi D001 101 Rick Delhi D002 123 Maggie Agra D890 166 Glenn Chennai D900 166 Glenn Chennai D004 The above table ...