Multiple Inheritance in Java

Ever since Java 8 introduced default interface methods, I felt there had to be a way to use it for multiple inheritance. I have never needed it, but I was bored for a bit today, so decided to try the following idea:

  • Create a non-public class XData to hold the fields the interface needs to work with, and a public interface X in the same X.java source file
  • The interface has one virtual method getXData() that returns the XData instance
  • The remaining interface methods are default methods that call getXData() to read and write the fields as necessary to perform some useful operations.
  • Create another interface Y and class YDatain the same pattern
  • Create a class XY that implements both interfaces X and Y
  • The class XY has XData and YData fields, which are returned by getXData() and getYData(). These are the only two interface methods XY is required to implement.
  • I didn't bother in my example, but XY would have to decide how to implement the Object methods hashCode, equals, and toString. These methods cannot be implemented by interfaces (but they could be implemented in XData and YData classes if desired)

The end result is the XY class is an instance of both X and Y interfaces, and inherits the encapsulated behaviors of both X and Y default methods - multiple inheritance by any reasonable measure.

Everything You Need to Know About Time Series Analysis

In business, you need to know how your business is doing day-to-day. In order to understand the health of your company, many turns to data analytics. Time series analysis can give valuable insight into what has happened over the course of days, weeks, months, or even years. With this form of analytics, you can learn if your company is making more money during the summer months or at the beginning of the fiscal year. You can also analyze weather data to see if winter storms caused any loss in revenue. 

Some questions that time series analysis can answer are: How many customers come into the store every day? How much revenue has the business generated over the last few weeks? What is the probability of rain tomorrow? It could be helpful in planning future actions, saving money, and ensuring quality.

Identifying, Exploiting, and Preventing Host Header Attacks on Web Servers

Summary

A typical web application uses HyperText Transfer Protocol (HTTP) for communication purposes. There are various attributes in HTTP, termed as Headers (for both Request and Response), that have their significance, and all the attributes in HTTP Headers should be configured securely for communication purposes. Often most of the attributes in HTTP Headers are misconfigured in web servers which makes the entire HTTP communication vulnerable to various cyber-attacks. 

HTTP Host headers are among one of the HTTP Header attributes that are misconfigured often and it can cause potential threat which is termed as Host Header Injection. In this literature, the author has shown how to exploit HTTP Host Header, where web servers are misconfigured in such a way that web servers respond to malicious HTTP requests without identifying the origin from which HTTP(S) Request(s) (Host Header) is made. In this literature, the author has also shown how to check incoming traffic on web servers w.r.t the origin or HTTP Host Headers and rejecting the same in case request is not coming from whitelisted origin.

Internet of Things or Machine-To-Machine Connectivity?

The terms IoT and M2M are often talked about synonymously, however, they are far from identical, and when you’re looking to implement a solution, it’s important to know the differences between the two -- or rather, when you should use one over the other. 

M2M stands for "machine to machine," a technology that is similar to IoT, or the "Internet of Things," but which also has some key differences. It’s these differences that make it important to know whether your project is better suited to an M2M or an IoT solution – and, ideally, this is something you’ll define in the early stages. 

A Guide to the Next JS Framework

Next.js is a framework extensively used by TikTok, Twitch mobile, Nike, IGN, PlayStation, Marvel, and many others. It offers all the functionality we need to deploy our application in production, with a hybrid system with static pages and server-side rendered (SSR) pages. It has support for Typescript and can be deployed without having to configure anything.

SSR Benefits (Next.js)

  • Performance
  • Isomorphic: Works on both server and client (browser)
  • Build: Next.js in the build retrieves the necessary data and ejects HTML with React components.
  • Static export: Compile static files to be able to upload to the server
  • 0 config (No need to configure anything to deploy Next, however it has a very extensible config)
  • Api routes
  • Deploy with Vercel
  • Next head: To modify the head part of the page to improve the SEO
  • Typescript support
  • Environment variables are used in the browser code, not just server code.
  • Fast Refresh: New experience of hot reloading in React components
  • Code splitting: loads chunk corresponding to the page path

Comparison With Gatsby

Gatsby is primarily used for building websites that generate static HTML content and web pages that have a fixed or predictable number of pages and stable content. An example might be an e-commerce site that has only 50 products available for sale.

Protocol Testing?

What Is Protocol Testing?

Protocol Testing is a method of checking communication protocols in the domains of Switching, Wireless, VoIP, Routing, etc. The primary goal of protocol testing is to check the structure of packets that are sent over a network using protocol testing tools. Routers and switches are used during the test to form parts of devices and products under testing.

Types of Protocols

Protocols are classified into two categories routed protocols and routing protocols:

From Aspiration to Action: Begin Implementing the Serverless Cloud

Moving to the serverless cloud is a process. In our previous post, From Aspiration to Action: Where to Begin Your Serverless Cloud Adoption, we covered planning your serverless cloud adoption from both a mindset perspective and the initial phases of moving to serverless.

The next step is turning those plans into action. We are now at the stage where you’ll mobilize your team, including your architects and developers, to quickly launch your move to the serverless cloud.

A Primer on the History and Evolution of Incident Management to Today

What’s the history of incident management?

If you’re an SRE, you may be so caught up in the day-to-day work of managing reliability and responding to incidents that you never take time to step back and ask that question. And that’s a shame because SREs didn’t invent incident management concepts and strategies on their own.

Data Integrity: A Data-Driven Organization’s Biggest Concern

In the InsideView Alignment Report 2020, more than 70 percent of revenue leaders rank data management as the highest priority. Although many organizations have implemented a system for data collection and analysis, their biggest concern is now maintaining the integrity of their data.

The term "data integrity" is sometimes used as a process or a state of data. Either way, it refers to data being accurate, valid, and consistent across all data sources.

Top 5 Reasons to Use Artificial Intelligence in Email Marketing in 2022

If you are using email marketing for your business and looking to skyrocket your sales with advancements in your marketing campaigns, then this article is for you. Learn how you can benefit by implementing artificial intelligence (AI) in email marketing in 2022 and leverage the sales through it.

In the age of cutting-edge technologies such as voice search, instant SMS, etc., email marketing still is one of the most common and profitable ways of online marketing. A major chunk of marketers considers email marketing as the major part of their marketing success. 

A Real-World Framework for Calculating Database Latency

Almost all modern applications require storing and accessing data, but choosing the right database to power an application is a difficult task that involves reasoning about a complex set of tradeoffs. Developers typically need to think about the following:

  • The geographic regions where the database will store data and whether the resulting real-world latency profile will allow them to create an application that is quick and responsive.
  • The operational model for the database and the implied total cost of ownership and availability characteristics.
  • The consistency model for the database and whether it meets requirements without pushing complex transaction support to the application.
  • The developer experience for the database and whether it will empower fast and efficient innovation in the future.
  • The scalability of the database and the ability to quickly dial capacity up or down as workloads change over time.

These dimensions are all important, but latency stands apart from the rest because it is the most difficult to reason about and it is often impossible to engineer around. Low latency is also growing in importance as business logic moves to the edge, making the difference between a local and remote API call more jarring and disruptive to users.

NullPointerException in Java: Causes and Ways to Avoid It

NullPointerException: the Most Common Exception

NullPointerException (NPE) is the most common exception in Java. The cause of this exception is known but looks like that in most cases developers prefer to ignore it and don't take any action. I personally expect that reasons for such behavior are the following: 

  • Most of the developers don't see any problem here and recognize all NPE exceptions as the developer's fault. 
  • Developers who are aware of this design problem don't know how to fix it. 

In this article, I'll explain what is the root of this problem and provide ways to fix that problem.

What Is Test Scenario?

What Is a Test Scenario?

A Test Scenario is any user that can be tested. Test Scenario is also known as Test Possibility or Test Condition. As an analyst, you should put yourself in the shoes of the end client and sort out the current actual situation while using examples of the Application under Test.

What Is Scenario Testing?

In programming testing, situation testing refers to an approach that uses real-world scenarios rather than experiments to test a product's applicability. Situation testing is used to test a product's complicated issues from beginning to end. Situations make it easier to test and evaluate complicated problems from beginning to end.

Cloud Disaster Recovery: A Solution to Your Cloud-Related Concerns

In the wake of changing market trends and the emergence of newer technologies, having a decent market presence is a challenge for businesses of every size.

The need to be more competitive and agile in the current age makes them look for resources or processes that make work turnovers simpler and faster. Fast-growing technology developments have increased the pace at which companies execute processes. As a process, recovery from failures has also started emerging in parallel.  This is where companies feel the need for solutions like Disaster Recovery.

Technology Bridging the Gap Between CNC Machines & Robots

Having different software languages can create a communication barrier between robots and the CNC machines they assist. Digital factories can be transformed once the two are synced, and technology is bridging the gap to make it happen. 

As Industry 4.0 revolutionizes the manufacturing world, robots can be increasingly seen working alongside CNC machines - but only so well. The controllers used by robotics manufacturers rarely coincide with the software that makes CNC machines run, so a fully synchronized operation can be very difficult to achieve. The result is untapped potential in automated manufacturing, as robot-CNC machine interfaces work with less productivity than they could otherwise obtain. 

API Security Beginner’s Guide

Historial API Evolution

As per the documented history, the occurrence of web APIs transpired towards the end of 1990 with the launch of Salesforce's sales automation solution. At that point in time, it was an open resource, awarded to everyone.

Salesforce's automation tool was XML-driven and the format used for interchanging the data for this tool later got acknowledged as standard SOAP API. It featured message format specifications and encoding-specific rules related to allowing or disallowing requests.

How Technical Operations Can Build on the Success of Data Science Notebooks

Data science notebooks, a popular document format used for publishing code, results, and explanations in readable and executable form, broke new ground by combining an ongoing narrative with interactive elements and displays. The result was a new way to capture and transfer knowledge about the process of discovering insights. By studying why data science notebooks have worked so well, we can understand more about related areas with similar characteristics, such as Technology Operations (TechOps). 

At first glance, many of the attributes of data science notebooks also apply to TechOps. However, the data scientist and TechOps cohort have different objectives. A data scientist is interested in variable results based on changing elements within queries. A TechOps team responsible for complex operational systems looks for variables and patterns, seeks to understand the root cause, and takes corrective action. Data science notebooks are conducive to instruction and are easy to change. However, in a production operations setting, things need to be repeatable rather than variable. To align with the different user needs in TechOps, the notebook concept evolved into runbooks.