Node.js Tutorial for Beginners (Part 4): Making an App Responsive With Bootstrap

See the original posting on DZone Python

Introduction and Project Refresh

Throughout this series, we’ve been building an application to keep track of the National Parks we’ve visited. In the last article, we looked at how to transfer data between two Express-based web pages using the body-parser middleware. In this post, we’ll look at how to style our pages and make them responsive using the open source Bootstrap framework.

Quick PSA: If you’re smart, you’ll do what I didn’t and wait to make any CSS tweaks until after Bootstrap has been properly integrated and all our elements are responsive. 

Short Walks: 406 Error While Creating a .NET Core API

See the original posting on DZone Python

I’m afraid this is another of those: "What has AddMvc() ever done for us" posts. Today, I was creating a brand new .NET Core 2.1 API and, instead of calling AddMvc in ConfigureServices, I instead used AddMvcCore:

public void ConfigureServices(IServiceCollection services)

When I tried to access the API, I got a 406 error. The fix is very simple (and one that using AddMvc()  does for you:

Refactoring C Code: Starting With an API

See the original posting on DZone Python

In my last post, I introduced a basic error handling mechanism for C API. The code I showed had a small memory leak in it. I love that fact about it, because it is hidden away and probably won’t show up very easily for production code until very late in the game. Here is the fix:

The problem was that I was freeing the error struct, but wasn’t freeing the actual error message. That is something that is very easy to miss, unfortunately. Especially as we assume that errors are rare. With that minor issue out of the way, let’s look at how we actually write the code. Here is the updated version of creating a connection, with proper error handling:

Node.js Tutorial for Beginners (Part 3): Transferring Data Between Pages

See the original posting on DZone Python

In the previous article in this Node.js for beginners series, we went over the three popular templating engines for working with Node/Express-based applications: Pug, Mustache, and EJS. After choosing EJS, we set about creating the basic HTML make-up of the application. It wasn’t anything super fancy, but we created two web pages that rendered basic HTML. In this post, we’ll examine how to connect these two EJS pages and transfer data between them.

Project Recap

I’ll be basing the app I work on in this series of a project from a Udemy course (found here) that I’ve been using on-and-off for a while. I love to travel, and the US National Parks are some of my favorite places to go. To teach myself Node.js, Express.js, templating engines, and Bootrap, I’m going to design an application to keep track of my park travels. In this edition of the series, we’ll learn how to transfer data between to EJS pages, allowing us to add our park pictures and names to our app. 

Building a Website With Gatsby and a Headless CMS

See the original posting on DZone Python

If you’re looking to launch a small, static, and speedy website, micro-site, or landing page, you may be considering a static-site generator like Gatsby.

This article will walk you through the process of using Gatsby alongside dotCMS, a Java-based open-source headless CMS, to build a static website that uses API calls to pull content that’s created, stored, and managed in dotCMS, and presented by Gatsby.

34 Ways to Save Time on Manual Cross Browser Testing, Part 3: Methods 21-34

See the original posting on DZone Python

Welcome back! If you missed Part 2, you can check it out here

21. Study the Browser Landscape for the Target Markets

In our last article, we discussed the importance of testing on browsers that really matter, i.e. browsers that are more prevalent. Hence, before you start designing and coding your website/web app, it is important to have a look at resources like CanIUse which outlines features that are supported on different browsers. For example, you can check whether CSS Grid Layout would work on Safari or not. It is a good starting point to know your target audience and develop features that keep your target audience in mind.

Node.js Tutorial for Beginners (Part 2): Working With Templating Engines

See the original posting on DZone Python

Welcome back to our series on Node.js for beginners! Last time, we went over the advantages of using Node.js and Express, got our environment set up, and coded up some basic web pages. In today’s post, we’ll go over the roles of templating engines in Node.js applications and figure out how to use them to get some basic HTML markup onto our pages. 

Project Recap

I’ll be basing the app I work on in this series of a project from a Udemy course (found here) that I’ve been using on-and-off for a while. I love to travel, and the US National Parks are some of my favorite places to go. To teach myself Node.js, Express.js, templating engines, and Bootrap, I’m going to design an application to keep track of my park travels.

Node.js TCP App Development on ECS

See the original posting on DZone Python

To start with the basics, one of the popular open source JavaScript runtime environments is Node.js. Node is built on Chrome’s V8 JavaScript engine. Node.js is mostly used for building server-side and networking applications. TCP (Transmission Control Protocol) is a networking protocol that enables reliable, ordered, and error-checked delivery of a stream of data between applications. For both sides to exchange data streams, a TCP server must accept a TCP connection request, and the connection is then established.

We can write two types of TCP socket programs: server and client. The server’s function is to listen for connections from the client and then send the processed data back. This communication happens via sockets.

34 Ways to Save Time on Manual Cross Browser Testing, Part 2: Methods 11-20

See the original posting on DZone Python

Welcome back! If you missed Part 1, you can check it out here.

11. Use Web Analytics to Figure Out the Most Preferred Browser

Based on the initial market research and the customer market-segment, your management, as well as the development team, would have information about the expected user-segmentation. They would also have information about the browsers on which more testing should be performed (since the majority user base using your product could be using that browser). You can also use web analytics tools to pinpoint the browsers that are responsible for majority of your traffic.

Node.js Tutorial for Beginners (Part 1): Intro to Node and Express

See the original posting on DZone Python

Over the course of the past year and a half, I’ve been slowly, and a bit sporadically, teaching myself web development technologies. I’ve had some success with HTML, CSS, and basic, vanilla JavaScript (you can see some of my Fiddles here). But now I’m interested in diving into Node.js, and I’m using this series to chronicle my journey. Hopefully, I’m not in over my head, but, even if I am, I hope this will help fellow novices or experienced devs new to Node and JavaScript. 

Node.js is a fascinating technology with a quickly growing user base. Though it’s often referred to as a framework, Node actually functions as a JavaScript runtime, powered by Google’s V8 engine — the same engine used to power the Chrome browser. Thus, Node essentially takes the place of the browser in the execution of JavaScript code. This allows developers to use JavaScript, a language designed to be compiled and run on the client-side, on the server-side, making a full-stack JavaScript application possible. In addition to that, Node is a pretty scalable solution, as proven by its adoption by several large-scale organizations, including Netflix, Uber, PayPal, and NASA. 

34 Ways to Save Time on Manual Cross-Browser Testing, Part 1: Methods 1-10

See the original posting on DZone Python

oOne of the major hurdles that web developers, as well as app developers, face is testing their website/app across different browsers. This is also called ‘Cross-Browser Testing.’ There are so many browsers and browser versions (Google Chrome, Mozilla Firefox, Internet Explorer, Microsoft Edge, Opera, Yandex, etc.), numerous ways in which your website/app can be accessed (via desktop, smartphones, tablets, etc.) and numerous operating systems (Windows, MacOS, Linux, Android, iOS, etc.) which might be used to access your website. Ensuring that your website’s UI/UX and its functionalities work without any flaws on the combination of ‘Browsers + Browser Version + Operating Systems + Device Profiles’ would involve numerous man-hours for development, testing, and maintenance. Though testing might include automated cross-browser testing, you would always prefer to have a round of manual cross-browser testing before the final release.

The major pain-point with manual cross-browser testing is that testers might need to spend a significant amount of time testing different web pages, cross-browser testing web apps across different breakpoints on a growing list of ‘complex’ combinations. Hence, it is recommended that one round of manual cross-browser testing is performed in the staging environment before the changes are pushed to the production environment. Since the development branch would involve changes from multiple developers, you can expect another round of cross-browser testing on these changes before they make their way to the ‘prod/production server.’ Though you might be following a ‘model for software development,’ there are many activities that become unplanned/ad-hoc and manual cross-browser testing is often considered one of them. The Turnaround Time (TAT) for the resolution of bugs could vary based on the synergy between teams. TAT could increase if the teams indulge in blame games and this behavior can result in an overall delay. You cannot change human tendencies, but you can definitely ensure that processes are kept in place to improve the speed at which tests are performed without compromising the Turnaround Time.

Controlling Web Audio With React and Redux Middleware

See the original posting on DZone Python

Let’s Build a TouchTone Keypad!

If you’ve built React/Redux applications before, you know there is a standard pattern of uni-directional data flow. The UI dispatches an action. A reducer handles the action, returning a new application state. The UI reorganizes itself accordingly.

But what if you need a Redux action to trigger interaction with a complex system? Say, a collection of Web Audio components used to create or analyze sound. Those are not serializable objects. They shouldn’t be managed by a reducer. Nor should a UI component manage them because it could be subject to unmounting at runtime, causing a loss of the audio system.

How to Modularize an Angular Application

See the original posting on DZone Python

Starting Point

The starting point is the AngularAndSpring project. It is an Angular 7 application with Material Components and a reactive Spring Boot backend. The initial download was more than 1.6 MB in size. The reason for the size of the initial download is that the app module includes all the code of the dependencies that are needed by the whole application. The goal is to create a smaller app module that starts with just a splash component and the services that are needed by more than one module. Then the application lazy loads the modules for the routes the user navigates to. The application has three parts:

  • The overview table. That shows a table of cryptocurrency quotes and has the login.
  • The details pages. That shows the current details of the quote and a chart.
  • The orderbook page. That shows the current orderbooks and requires to be logged in.

Each of the parts will become a module with one or more components. The modules will have only the required imports and be loaded if the user navigates to their route.

Integrating Java and npm Builds Using Gradle

See the original posting on DZone Python

This article describes how to automate building Java and JavaScript npm-based applications within a single Gradle build.

As examples we are going to use a Java backend application based on Spring Boot and a JavaScript front-end application based on React. Though there are no obstacles to replacing them with any similar technologies like DropWizard or Angular, using TypeScript instead of JavaScript, etc.

Eradicating Memory Leaks in Javascript

See the original posting on DZone Python

If you are wondering why your JavaScript app is suffering from severe slowdowns, poor performance, high latency, or frequent crashes, and all your painstaking attempts to figure out the problem were to no avail, there is a pretty good chance that your code is plagued by ‘Memory Leaks.’ Memory leaks are fairly common as memory management is often neglected by developers due to the misconceptions about automatic memory allocation and release in modern high-level programming languages like JavaScript. Failure to deal with memory leaks can wreak havoc on your app’s performance and can render it unusable. The Internet is flooded with never-ending complex jargon which is often difficult to wrap your head around. So in this article, we will take a comprehensive approach to understand what memory leaks are, their causes, and how to spot and diagnose them easily using Chrome Developer Tools.

What Are Memory Leaks?

A memory leak can be defined as a piece of memory that is no longer being used or required by an application but for some reason is not returned back to the OS and is still being needlessly occupied. Creating objects and variables in your code consumes memory. JavaScript is smart enough to figure out when you won’t need the variable anymore and will clear it out to save memory. A memory leak occurs when you may no longer need an object but the JS runtime still thinks you do. Also, remember that memory leaks are not caused by invalid code but, rather, a logical flaw in your code. It leads to the diminished performance of your application by reducing the amount of memory available for it to perform tasks and could eventually lead to crashes or freezes.

1 2 3 4 143