Python Script To Check Vaccine Availability | Source Code

In this Python tutorial, you’ll write a script to query an API and show desktop notification. Through the course of this tutorial you’ll learn a couple of things, How to make an API call How to parse the response JSON How to play a song How to show desktop notification Source code from this tutorial is available on GitHub. Indian government is conducting the Covid-19 vaccination drive via Co-WIN. Due to high booking for vaccination slots, the slots are getting filled within minutes before you know that they were even available. [Read More]

Run Angular Unit Test Cases Without Browser | Karma | Jasmine

There are two way to configure the Angular unit test cases to run without the browser. From command line While running the unit test cases you can specify the browsers as ChromeHeadless, ng test --browsers ChromeHeadless From karma.conf.json Open you karma.conf.json and add the following: browsers: ['ChromeHeadless'] Here is the how the modified karma.conf.json file looks: // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html module.exports = function (config) { config. [Read More]

A Guide to Preventing SQL Injection Vulnerabilities

SQL injection is one of the oldest and most prevalent threats that has been responsible for thousands of data breaches. It’s no surprise, therefore, that it is listed as the number one web application security risk on the OWASP Top 10 document. In this post, we take a deeper dive into the threat exploring what it is, its implications, and what you can do to protect applications against it. What is an SQL Injection Vulnerability Definition: It’s a security flaw on a web application that allows hackers to alter how an SQL query is executed and consequently gain unauthorized access into the application’s database. [Read More]

Create Brick Wall Using HTML & CSS

We are running an HTML CSS Tutorial series for complete beginners. As a part of the Learn HTML CSS series, we’ll be posting a couple project based tutorials. In this video you’ll learn how to create a brick wall using HTML & CSS. This is perfect for beginners to get started with learning CSS and building things using it. Resources: Source Code How to create a Brick Wall Using CSS Thanks for watching and don’t forget to show some love by liking and sharing the video. [Read More]

Creating Reusable Components | @Input | @Output | Source Code

In this tutorial, let’s learn how to create reusable components in Angular. I’ll be making use of Angular’s @Input and @Output directives. Source code from this tutorial is available at GitHub. You can also follow the video tutorial on YouTube. Creating an Angular App Assuming that you already have Angular CLI installed, create an Angular app using the CLI. ng new reusable-comp Once you have the boilerplate project created, you need to install Bootstrap in your application. [Read More]

Learn Angular : Testing Component With Material Dialog | MatDialog | Karma | Jasmine

You already saw how to use Material MatDialog in Angular. In this tutorial, you’ll learn how to unit test components having Material MatDialog. Source code from this tutorial is available at GitHub. You can also follow the video tutorial on YouTube. Running Angular Unit Tests For the sake of this tutorial , you’ll clone the source code from the Angular Material MatDialog tutorial. git clone https://github.com/jay3dec/upgraded-winner cd upgraded-winner npm install npm start You’ll have the Angular application running. [Read More]

Quick Guide to Lazy Loading in Angular

Lazy loading is a popular technique for improving page performance and page load times in web applications. In Angular, lazy loading can be achieved using the routing mechanism built into the framework. In this article, I’ll explain the basics of lazy loading and show how to wire Angular modules to load only when the user follows a certain route in the application structure. What is Lazy Loading Lazy loading is a web development practice in which a resource or object is not loaded or initialized until it is actually needed. [Read More]

JavaScript, JSON Parse Method

How to parse JSON using JavaScript? JSON is used to transfer data between web applications via REST APIs. To convert JSON string to object using JavaScript you can use a method called JSON.parse. Let take a look at an example : let jsonStr = "{\"firstName\":\"jake\",\"lastName\":\"thomson\",\"age\":10,\"state\":\"Kerala\",\"district\":\"Kochi\"}";let jsonObj = JSON.parse(jsonStr);console.log('JSON obj ', jsonObj);// Output{"firstName": "jake","lastName": "thomson","age": 10,"state": "Kerala","district": "Kochi"}It has an optional callback method using which you can transform or delete an existing property in a JSON object. [Read More]

Angular, Download PDF From BASE64 String

How to download PDF from base64 string using Angular? In this tutorial, you’ll learn how to convert base64 string to PDF. Let’s start by creating an Angular project. ng new angular-download-pdfOnce you have the Angular project created, add a button to the app.component.html file. Download PDFOn click of the button let’s define a method to download PDF. Logic: You can make use of an anchor tag to download the PDF. [Read More]

Python, Sorting Object Array

How to Sort Object Array In Python? Python provides a built-in method called sort to sort an array. It provides an option to specify the order of the sort. # Python3.8# Sorting Array in Ascending Orderlst = [-1,200,1,100,50]lst.sort()print(lst)# Output# [-1, 1, 50, 100, 200]Note: Sort method doesn’t return a new Array, instead it modifies the same. To sort array in descending order you can specify reverse parameter to True. [Read More]