Articles

You can find all .Net core posts here.

Yesterday, I was going through different articles as usual and one site attracted my attention.


Source de l’article sur DZONE (AI)

Here I am with another useful design pattern for you — the adapter design pattern. I will also highlight the differences between the decorator design pattern (see my previous article, Decorator Design Pattern in Java, here) and the adapter design pattern.

Adapter Design Pattern

  • The adapter design pattern is a structural design pattern that allows two unrelated/uncommon interfaces to work together. In other words, the adapter pattern makes two incompatible interfaces compatible without changing their existing code.
  • Interfaces may be incompatible, but the inner functionality should match the requirement.
  • The adapter pattern is often used to make existing classes work with others without modifying their source code.
  • Adapter patterns use a single class (the adapter class) to join functionalities of independent or incompatible interfaces/classes.
  • The adapter pattern also is known as the wrapper, an alternative naming shared with the decorator design pattern.
  • This pattern converts the (incompatible) interface of a class (the adaptee) into another interface (the target) that clients require.
  • The adapter pattern also lets classes work together, which, otherwise, couldn’t have worked, because of the incompatible interfaces.
  • For example, let’s take a look at a person traveling in different countries with their laptop and mobile devices. We have a different electric socket, volt, and frequency measured in different countries and that makes the use of any appliance of one country to be freely used in a different country. In the United Kingdom, we use Type G socket with 230 volts and 50 Hz frequency. In the United States, we use Type A and Type B sockets with 120 volts and 60 Hz frequency. In India, we use Type C, Type D. and Type M sockets with 230 volts and 50 Hz. lastly, in Japan, we use Type A and Type B sockets with 110 volts and 50 Hz frequency. This makes the appliances we carry incompatible with the electric specifications we have at different places.
  • This makes the adapter tool essential because it can make/convert incompatible code into compatible code. Please notice here that we have not achieved anything additional here — there is no additional functionality, only compatibility.

To better understand this, let’s look at an example of geometric shapes. I am keeping the example relatively simple to keep the focus on the pattern. Suppose we have a project of drawing, in which we are required to develop different kinds of geometric shapes that will be used in the Drawing via a common interface called  Shape.

Source de l’article sur DZONE

Previously, we saw some of the very basic image analysis operations in Python. In this last part of basic image analysis, we’ll go through some of the following contents.

The following contents are the reflection of my completed academic image processing course in the previous term. So, I am not planning on putting anything into the production sphere. Instead, the aim of this article is to try and realize the fundamentals of a few basic image processing techniques. For this reason, I am going to stick to using SciKit-Image – numpy mainly to perform most of the manipulations, although I will use other libraries now and then rather than using most wanted tools like OpenCV


Source de l’article sur DZONE (AI)

After my article, “Role of Project Manager in Data Science”, a couple of program managers suggested me to elaborate the use case on meeting release commitments. We are going to explore simulation, one of the amazing concepts in Artificial Intelligence. Quantitative analytic techniques, such as the Monte Carlo simulation, helps program managers in decision making through probabilistic distributions of potential outcomes.

Monte Carlo relies heavily on the randomness of key variables in solving the problem. Along with key parameters, we also need to understand the relationship between them and sufficient data to analyze further. The five steps listed in “Forecasting the future: Let’s rewind to the basics” are essential to building an accurate model.


Source de l’article sur DZONE (AI)

In continuation of my previous articles on design patterns, here I am with another very useful pattern — the bridge design pattern.

Bridge Design Pattern

  • The bridge design pattern is a structural pattern used to decouple an abstraction from its implementation so that the two can vary independently.

    Source de l’article sur DZONE

Every year, come fall, Americans can enroll in health insurance programs for the upcoming year. As this is no decision to take lightly, people take time in advance to research plans, gather information and study the topic. This is also an opportunity for health insurance companies to draw crowds to their websites, to read about their offerings. Therefore, health insurance companies and government websites should expect traffic spikes way before Nov. 1st, the day open enrollment begins, and up until the sign-up period ends.

To ensure people seeking insurance can access the different plans and services, health insurance companies and agencies should test their websites, apps, and APIs. These tests should check the performance of the systems under different loads, to make sure they don’t crash, there are no memory leaks, response time stays low, etc. Otherwise, customers will choose different plans, and express their anger at the companies and the government across social media (you can learn more and view a demo from our free webinar about preparing your website for peak traffic on Open Enrollment).

Source de l’article sur DZONE

In this post, we will see how to read configuration data in .NET Core test projects.

We’ll need some configurable data which we can change once the application is deployed. Things have changed a bit in .NET Core when it comes to reading configuration data.

Source de l’article sur DZONE

In this article, I will explain how to implement a logic in Mule ESB that will avoid parallel processing or simultaneously running of the same mule application. 

This Mule Application is triggered via HTTP GET Request. Once there’s a new request, it will create a variable #[flowVars.correlationId], which the value came from #[message.rootId]. This ID is a unique identifier of a particular Mule process and in this application, it will be stored inside the Cache Scope as a payload using the Transform Message { correlationId: flowVars.correlation } (Map Object Data Type). Then after that scope, we have a Choice Router that will determine if there’s an existing running process or not by checking if the #[payload.correlationId == flowVars.correlationId] (TRUE means there’s no cached data yet) response an HTTP status 200, if FALSE return HTTP status 409 Conflict.

Source de l’article sur DZONE

There is a simple principle for naming methods in OOP. I’m trying to demonstrate this in the following code — it’s a verb if it manipulates; it’s a noun if it builds. That’s it. Nothing in between. Methods like saveFile() or getTitle() don’t fit and must be renamed and refactored. Moreover, methods that "manipulate" must always return void, for example, print() or save(). Let’s take a closer look!

The Night Of (2016) by Richard Price et al.

Source de l’article sur DZONE

I have been using the Trello board over the last few months for project management. During this period, I needed to generate reports via Word or DOCX, and among the constraints, I found that there are cards written in different languages.

In this article, I will provide a detailed Java program that can generate a DOCX report of a Trello board and translate content into a single output language, basing it on Google Translation and Cloud API Translation.

Source de l’article sur DZONE