Why Global Variables Shouldn’t Be Very Global

See the original posting on DZone Python

One of the biggest blunders a JS developer can do make while writing code is declaring unnecessary global variables. Global variables are extremely helpful for programmers, but if they are not used carefully, they can rob the speed and efficiency of any browser.

Short Note

There are mainly two types of variables that are used in JS: local and global. Local variables are defined and used within a function, whereas global variables are defined for the function window. In short, until the code doesn’t terminate, global variables will be present, lurking in the background.

How Single Page Web Applications Actually Work

See the original posting on DZone Python

Single Page Web Applications have come a long way since they first appeared around 2003. They have become an integral part of the modern JavaScript landscape.

But during my discussions with quite a few developers, I feel that there is still a lack of clarity about how single-page applications actually work. Hence, I decided to roll up my sleeves (figuratively speaking) and provide my take on this very very interesting subject.

Class Attribute vs. Instance Attribute In Python: What You Might Have Missed

See the original posting on DZone Python

As an object-oriented language, Python provides two scopes for attributes: class attributes and instance attributes.

While the instance attribute in Python has exactly the same characteristics and definition as the other object-oriented languages, the class attribute is always mistakingly considered to be the exact equivalent of the static attribute in Java or C++. To be accurate, class attributes in Python and static attributes in Java or C++ have a lot in common, however, they have behavioral differences that I will highlight in this article.

Interacting With a Leaflet Map in an Ionic Framework PWA

See the original posting on DZone Python

Upon popular request, I had recently written a tutorial that demonstrated using the HERE JavaScript SDK in an Ionic Framework progressive web application (PWA) that used Angular. This previous tutorial demonstrated showing an interactive map in a web application and mobile application using the same set of code and it used the default HERE interactive map renderer.

However, HERE is very flexible when it comes to the tools and libraries that you can use with it. For example, you could use Leaflet, a popular renderer, with your HERE data, something I demonstrated in a tutorial titled, Render and Interact with HERE Location Data using Leaflet and Angular. This time around, we’re going to accomplish the same, but within a PWA using Ionic Framework.

MEAN Stack and Startups: Are they Made for Each Other?

See the original posting on DZone Python

The MEANing of the MEAN Stack

The MEAN stack is an assortment of various technologies — MongoDB, Express.js, Angular, and Node.js — bound together by a single, dynamic programming language, JavaScript, for building a robust web application. From client to server to database, MEAN is used for full-stack JavaScript development.

MEAN Stack Architecture

Netflix switched from Java on the server-side and JavaScript on the client-side side to Node.js because they had to write everything twice for error handling, activity tracking, and debugging. As Node.js acts as a common language for both the server-side and client-side, it brought down the startup time to under a minute from 40+ minutes.

JavaScript Tutorial: Creating a CounterString Tool in Chrome Dev Tools

See the original posting on DZone Python

Tutorial Outline

I often talk about automating tactically and strategically. When we automate tactically, we do what it takes to get the job done for us. When we automate strategically, we build for the long term.

The same is true for programming tools. We can start small and tactical, and scale strategically. In this example, I create a Counterstring tool.

Describe, Then Interpret: HTTP Endpoints Using Tapir

See the original posting on DZone Python

There’s no shortage of great HTTP server libraries in Scala: akka-http, http4s, play, finch, just to name some of the more popular ones. However, a common pain point in all of these is generating documentation (e.g. Swagger/ OpenAPI).

Some solutions have emerged, such as annotating akka-http routes, generating scale code from YAML files or … writing YAML documentation by hand. But let’s be honest. Nobody wants or should be writing YAML files by hand, and annotations have severe drawbacks. What’s left then?

Picking an Interactive Map Theme With Vue.js

See the original posting on DZone Python

A few weeks ago, Jayson Delancey had written an awesome tutorial around switching between visual themes for a map on demand using React. This is useful when it comes to scenarios such as switching between day and night mode on a map depending on the local time or similar. The problem with this is that his tutorial was written with React when there are a bunch of other popular web frameworks available.

In this tutorial, we’re going to see almost the same material that Jayson demonstrated, but this time using the Vue.js JavaScript framework.

SyntaxError: JSON.parse: bad parsing

See the original posting on DZone Python

JSON, or JavaScript Object Notation, is a ubiquitous data format used by all sorts of mobile and web apps for asynchronous browser-server communication. JSON is an extremely popular data format, very easy to work with, compatible with every major programming language, and is supported by every major browser. However, just like any programming language, it throws a lot of errors when it decides that today is not going to be your day.

JSON.Parse Syntax Errors

In most web applications, nearly all data transferred from a web server is transmitted in a string format. To convert that string into JSON, we use the JSON.parse() function, and this is the main function that throws errors. Nearly all JSON.parse errors are a subset of the SyntaxError error type. The debugging console throws around 32 different error messages when you mess up your JSON data. And some of them are very tricky to debug; and yes I am talking about you unexpected non-whitespace character after JSON data.

Display an Interactive HERE Map in an Ionic App

See the original posting on DZone Python

Back when I first started at HERE I had written a tutorial titled, Display HERE Maps within your Angular Web Application. In fact, it was my first official tutorial since starting and since then I’ve received several similar requests around it. One popular request has been around taking the Angular web application and making it compatible with the Ionic Framework.

In this tutorial, we’re going to see how to build a progressive web application (PWA) using the Ionic Framework that can be deployed on the web or on mobile devices running Android or iOS.

Automated Cross-Browser Testing

See the original posting on DZone Python

Testing a website in a single browser using automation script is a clean and simple way to accelerate your testing. With a single click, you can test your website for all possible errors without manually clicking and navigating to web pages. It’s a modern marvel of software ingenuity that saves hours of manual time and accelerates productivity. However, for all this magic to happen, you would need to build your automation script first.

In a previous post, we focused on setting up a complete test suite environment for running selenium scripts. But that script had a major drawback. That setup was focused on testing on only a single browser. Cross-browser compatibility testing is a major pain point for all testers and it’s also a major test case for all functionality testing cycles.

How to Use Higher-Order Components in React

See the original posting on DZone Python

In JavaScript, we have higher-order functions (HOC), which are basically functions that accept functions. In React, higher-order components are basically functions which accept component as parameters, inject or modify their props, and return a modified component.

Real world use case: Suppose you have a button that you want to be rendered with two different styles. Using the main ideas behind HOC we do not need to create two buttons with different styles, but, rather, create a single button component and pass it through a wrapper function that modifies its props or styles and returns a new component.

Create an Angular 7/ASP.NET Core 2.2 Application and Push it to Azure

See the original posting on DZone Python

Implementing the full CI/CD cycle on an Angular/ASP.NET Core application is not easy. Some digging and experimentation is necessary to make everything work. The goal of this article is to pinpoint the different steps and tricks.

The source code is available on GitHub: devpro/aspnetcore-angular-sample. There will also be links to the live demo, as well as the build and deployment pipelines.

A (Hypothetical) Open Letter from Google to Web Developers

See the original posting on DZone Python

Dear Web Developers,

Look, we know a bunch of you were pretty miffed at us when we bought the rights to the .dev gTLD a few years back. We get it; it put more than a few of you in a bind when you went to load your testing sites only to have a frowny face stare back at you. Yes, it was kind of a #$%^ move. And then when you found out we would be keeping it entirely to ourselves for our own branded initiatives, we understand if it made you feel like the bullied kid on the playground who had just had his lunch money stolen. We know we can come off sometimes like that guy – you know, the one who looks years older than everyone else (because he probably is) and takes whatever he wants to because, well, he can.

How to Enable Column Hiding in Ignite UI for Angular Grid

See the original posting on DZone Python

Ignite UI for Angular Grid is the fastest Angular Grid out there. It does not only run fast, it is also very easy to use igxGrid in your application. Ignite UI for the Angular Grid component class is named igxGrid and, on the template, it can be used as <igx-grid></igx-grid>.

In this blog post, let’s learn how Column Hiding can be enabled in IgniteUI for Angular Grid.  

1 2 3 4 5 148