teleren/devto huggingface dataset:
Composite design pattern — Java
Tags: tutorial, programming, java, designpattern
Published: 2022-01-28 12:05:23

![design-pattern](https://cdn-images-1.medium.com/max/2000/1*cpmqYomwpJ_fAZ_p_sxGNQ.jpeg)

## Definition of Composite pattern
>  In software engineering, the **composite pattern** is a partitioning design pattern. The composite pattern describes a group of objects that are treated the same way as a single instance of the same type of object. The intent of a composite is to “compose” objects into tree structures to represent part-whole hierarchies. Implementing the composite pattern lets clients treat individual objects and compositions uniformly.

## Where to use the Composite pattern?

When we want to implement the same interface on leaves and composites so that they are handled in the same way.

## UML example

![](https://cdn-images-1.medium.com/max/2868/1*XXdDrXuihMtL4ITZQIPLSA.png)

## Implementation of the Composite pattern

First we need to declare the interface that will describe the behavior of our component.
{% gist https://gist.github.com/ErwanLT/f422179a179157448a3120831f7a1193.js %}
Then the implementation will have the same behavior but with some hierarchy between them.
{% gist https://gist.github.com/ErwanLT/7564cd25611a6353c1dc59a6e815ad1a.js %}{% gist https://gist.github.com/ErwanLT/4a85c36b79987b051f5d31566a7d48a5.js %}{% gist https://gist.github.com/ErwanLT/8aef6e5177aa912ac69d2c4c5f5a41d5.js %}
The only difference in these implementations are the use of the *addParent()* and *addChild()* to create the hierarchy like we can see the following example and the output it will produce.
{% gist https://gist.github.com/ErwanLT/0205c11220587e2b0616f6093004e093.js %}
    ==============================
    Name : Philippe
    Last name : Le Tutour
    Childs :
      - Name : Erwan
    ==============================
    ==============================
    Name : Erwan
    Last name : Le Tutour
    Parents :
      - Name : Philippe
    Childs :
      - Name : Mathys
    ==============================
    ==============================
    Name : Mathys
    Last name : Le Tutour
    Parents :
      - Name : Erwan
      - Name : Amelie
    ==============================
Prototype design pattern — Java
Tags: tutorial, programming, java, designpattern
Published: 2022-01-28 12:02:58



![design-pattern](https://cdn-images-1.medium.com/max/2000/1*cpmqYomwpJ_fAZ_p_sxGNQ.jpeg)

## Definition of Prototype pattern
>  The **prototype pattern** is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects.

## Where to use the Prototype pattern

If the cost for creating a new object is expensive and costs resources.

## UML example of the Prototype pattern

![](https://cdn-images-1.medium.com/max/2000/1*Y1te2CedNbpcnTmUWH-4oQ.png)

## Implementation of the builder pattern

First we need to create our prototype class
{% gist https://gist.github.com/ErwanLT/a5c0b8cdf80513ae550a039377a609ef.js %}
The *getClone() *method will be implemented in the class that will implement the prototype to return a new object of the same class.
In the next example we will create a Human and then implement the method to clone him.
{% gist https://gist.github.com/ErwanLT/ee1dba48bd797228693295fec140fad3.js %}
As you can read, the *getClone()* will return me another **Human** with the same name, last name and age to the one created before.

### Exemple :

The following code will give me the following output
{% gist https://gist.github.com/ErwanLT/e0c43b50022343dc88a4777e2bc2b1e1.js %}
    Human description 
    ---------------------------------
    Name Last Name Age
    Erwan Le Tutour 30
     Human description 
    ---------------------------------
    Name Last Name Age
    Erwan Le Tutour 30

As you can see above, my human2 has the same properties values as my human1, but they will only be equals if I implement the [*equals() *method](https://javarevisited.blogspot.com/2015/01/why-override-equals-hashcode-or-tostring-java.html) to do so.
8 Tips to build a good tech profile
Published: 2022-01-27 11:09:38

## Tips to build a good tech profile from zero to hero

Building a good tech profile is a difficult thing. But it becomes easy when you work hard & smart for it.

Following are some helpful tips to build a good tech profile that may help you :

### 1.Domain
First you need to select a domain that suits for you. Like mobile app development, web development etc. and a suitable programming language for the domain you have chose.

### 2.Fundamentals
Learn the fundamentals of the domain and language you have chose.

### 3.First Project
Do a good project as you learn. When you do a project as your own there could a lot of errors. At this point, you can use stackoverflow.com. If you don't know stack overflow, it a website that you can ask questions about programming and other users answer it.

### 4.Contribute
To contribute in projects you need to learn git. After you learned git you can contribute in other people's project on GitHub. At this point, you can also answer to the questions people ask on stack overflow.

### 5.Networking
Networking or connecting to other people is very important because you will get many opportunities as a developer. You can connect other developers by attending Hackathons, LinkedIn , other social media apps etc.

### 6.Communication
You need a good communication skill as you are attending Hackathons etc.

### 7.Marketing
You need to market yourself as people will know that you are a developer and about the things you can do etc. You can market yourself through YouTube, Social Media etc.

### 8.Mentor
Find yourself a good mentor who is a step ahead of you. You can learn so many things from that mentor as he shares his experiences and he will give you tips about what you need to do etc.


So, that's some tips that may help you.
🤗 Thanks For Reading.
7 Must-Try Ways: Learn App Promotion from Top Players
Tags: javascript, webdev, beginners, programming
Published: 2022-01-28 11:34:26

With access to every want and wish available at the touch of a screen, there isn’t a service that a mobile app cannot bring to you. Right from at-home salon appointments to door-step food delivery—if you can imagine it, there’s probably an app for it. 

The number of apps available across platforms like Google Play, Apple App Store, Windows Store, and Amazon Appstore amount to more than 4.83 million in the first quarter alone and continues to steadily grow. In an array of apps, serving across industries, it then becomes imperative that the app not only caters to every need of the user in a hassle-free manner but also stands out amongst its competitors. 

In India, the average cost of developing an app by factoring in skill, expertise, and the number of hours required to create the app is approximately $100K. When such an investment is put forth to grow your business and make it more accessible across all users, you inevitably expect an exponential ROI. This renders the purpose of the app futile unless you market your app to reach the screens of every mobile user. 

[7 Must-Try Ways: Learn App Promotion from Top Players ](https://www.cronj.com/resources/app-promotion) gives you an edge over your competitors and helps expand your business with a steady user base. By establishing a loyal customer base, you create brand awareness that makes you the first choice among customers, in turn influencing their buying decision.

Check Out These Related Blogs:-
https://www.cronj.com/resources/app-trends
           
https://www.cronj.com/resources/mobile-app-design-tools

https://www.cronj.com/resources/app-statistics

https://www.cronj.com/resources/on-demand-delivery-app

https://www.cronj.com/resources/doctor-appointment-app-development

https://www.cronj.com/resources/doctor-on-demand-app

https://www.cronj.com/on-demand-service-apps

https://www.cronj.com/resources/home-services-app

https://www.cronj.com/resources/how-to-create-an-app-from-scratch

https://www.cronj.com/resources/develop-ios-apps-on-windows

https://www.cronj.com/resources/nft-idea

https://www.cronj.com/resources/educational-app-development

https://www.cronj.com/resources/logo-design-software

https://www.cronj.com/resources/ui-design-toolkit

https://www.cronj.com/resources/ux-design-tools

https://www.cronj.com/resources/prototyping-tool

https://www.cronj.com/resources/graphic-design-software

https://www.cronj.com/resources/startup-ideas

https://www.cronj.com/resources/figma

https://www.cronj.com/resources/apps-built-with-react-native

https://www.cronj.com/resources/designing-an-app

https://www.cronj.com/resources/thop-tv-like-apps

https://www.cronj.com/metaverse

https://www.cronj.com/resources/job-search-sites

https://www.cronj.com/voice-chat-apps
How to deal with data changing and machine learning models doing worse after training
Tags: drift, machinelearning, production
Published: 2022-01-31 04:56:23

---
title: How to deal with data changing and machine learning models doing worse after training
published: true
date: 2022-01-28 11:33:00 UTC
tags: drift,machinelearning,production
canonical_url: https://dramsch.net/posts/how-to-deal-with-data-changing-and-machine-learning-models-doing-worse-after-training/
---

![](https://dramsch.net/images/banner/banner-ml-production-shift.thumbnail.jpg)

 

Machine Learning in Production 101

I just finished some writing for the UN (ITU) about machine learning models in production.

Wonder how to deal with data changing and models doing worse after training? (when deployed)

This is for you.

## 📌 We're talking about Drift

Our training data is static. Contact with the real world is non-stationary.

This drift can happen in three ways:

- The input data changes
- The labels for the data change
- The inherent relationship changes

## ⚗️ Input data changes!

One way to monitor these is by checking the distribution of the new data vs the training data.

We can use these tests:

- Continuous: Kolmogorov-Smirnov test
- Categorical: Chi-squared test

Solution:

Retraining the models regularly.

## 🧩 Target / Label changes

These can be natural changes similar to the input changes.

In that case, you can use the same approach.

But sometimes, our categories change, because we make discoveries or mgmt decisions.

Solution: Updates are best reflected in automated pipelines

## 🔀 Concept shift

This one sucks.

ML models learn the relationship between input and label (ideally).

When that relationship changes our entire historic data set is obsolete.

Essentially what happened in early 2020.

Solution: New data, but setting up auto alerts is essential

## 📖 More info?

I wrote an ebook about machine learning validation.

I give it away to my newsletter subscribers.

I have just made the biggest update to the ebook, including production models and machine learning drift.

Subscribe to receive weekly insights from [Late to the Party](https://dramsch.net/dramsch.net/newsletter) on machine learning, data science, and Python.

<form name="newslettersub" action="https://buttondown.email/api/emails/embed-subscribe/jesper" method="post" target="popupwindow" onsubmit="window.open('https://buttondown.email/jesper', 'popupwindow')">
        <div>
            <input type="email" value="" name="email" id="bd-email" placeholder="Email" aria-describedby="basic-addon1" autocomplete="off">
            <input type="hidden" name="tag" value="blog">
            <input type="submit" value="Subscribe" id="basic-addon1">
        </div>
        <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="hidden" value="1" name="embed"></div>
    </form>
<!--/.content-->
## Conclusion

We hope training data represents real-world data in machine learning, but it doesn't always.

- Set up MLOps automation
- Retrain for input data changes
- Care for label changes
- Hope it's not concept drift, where the relationship of data changes
Terraform Starter Kit
Tags: terraform, devops, cloud, webdev
Published: 2022-01-28 11:31:48

Organizing cloud infrastructure with Terraform (project template).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sckqlh6clz3ei2nps9cw.png)

https://github.com/kriasoft/terraform-starter-kit#readme
Javascript Document Object Methods
Tags: javascript, dom
Published: 2022-01-28 11:27:00

use of **createElement**,**innerHTML**,**appendChild**

```javascript

function book(){

    const newRow=document.createElement('tr');


    const newTitle=document.createElement('td');
    newTitle.innerHTML=title.value;
    newRow.appendChild(newTitle);


    bookList.appendChild(newRow);
    
     
}

```

---

use of **textContent**,**value**

```javascript
//message is a span tag/paragraph tag
//weightCalculate/heightCalculate is a input tag

function calculateBMI(){
    let height,weight,bmi;
    weight=Number(weightCalculate.value);
    height=Number(heightCalculate.value);
    bmi=weight/(height*0.0254*height*0.0254);
    output.textContent=bmi.toFixed(2);
    let report= showMessage(bmi);
    message.textContent=report;
}
```
Host Your Little Website On PheonixFree for Free Forever
Tags: webdev, programming, freehosting, beginners
Published: 2022-01-28 11:15:17

Host your website on [PheonixFree](https://pheonixfree.com) is so simple and Easy, Lets follow me and your website will be Ready in Few Minutes.

## 1.Create A account.
You can Create account in few steps like filling your name , Email Id Etc.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bv15y17uynv0xv4qq79u.png)

## 2.Login via your Crudential Which you filled During Creating Account.
Fill your Email id and Password


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/11b8uav9jga8ionfsl6f.png)
Now Your account is Ready.

## 3.Lets Rock and Move to next Step:
Click on Get Started Button:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmgfduht6mlpn61uf6tu.png)

## 4.Now Lets create a Hosting Account on ClientArea
Just click on 'New Account' to create your Hosting Account.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j49jonoqisugkr362w3o.png)

## 5.Use a Custom Domain or Subdomain Provided by PheonixFree
Here if you have your custom domain, you can enter it and change your nameservers in your domain providers to point to PheonixFree.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yolt0fs8rk3y1o04crpv.png)
For Using Subdomain Click on Subdomain Tab and enter name according to you.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ekmngx22jepamdarljm.png)

## 6.Manage your Acoount


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sz346lrgkz9upuxmr15c.png)

## 7.Login to your Control panel or File Manager


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50em67gbbv8frk711xzh.png)

## 8.Uploading file on file manager
Make sure to always upload your site files in 'htdocs' Folder.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v8xetbyt9oyma6owyodw.png)

## 9.Support and Knowledgebase
Support Email : support@pheonixfree.com
KnowledgeBase : [https://forum.pheonixfree.com](https://support.pheonixfree.com)
Support Forum : [https://forum.pheonixfree.com](https://forum.pheonixfree.com)
over engineered reduce
Published: 2022-01-28 11:15:00

Try to interpret this code:

```js
  const [,startOfPP,,log] = jobList.reduce(
    ([acu, pp, prev, ppPrev], cur) => 
      [
        [...acu, cur]
        , 
        cur.type === EVENT_TYPE.postProcess && prev.type !== EVENT_TYPE.postProcess
          ? cur
          : pp
        , 
        cur
        ,
        [...ppPrev, [pp, prev, cur]]
      ]
    , [[], null , {}, []]);
```
At this moment I sad STOP! That is carzy! The base idea was I wrote a single pure reducer, which is give back startOfPP value and log. So I started 4 variable in local state: ```[[], null , {}, []]```, but after take look back to code, I found this over engineered reducer solution.
Unity Game Dev Resources - that helped me - publish my own games !
Tags: unity3d, gamedev, csharp, beginners
Published: 2022-01-28 11:11:42

## Math/Tools/Shaders/Code

https://www.youtube.com/c/Acegikmo (detailed shader math and programming tuts)
https://gamemath.com/book/intro.html (book)
https://www.youtube.com/c/GameDevGuide (tools/systems)
https://www.catlikecoding.com/unity/tutorials/ (may be old but still most info is relevant)
https://www.youtube.com/c/SebastianLague (some art math heavy)
https://www.youtube.com/c/Roundbeargames (C++ tutorials for unity users - explaining basic concepts of programming)
youtube.com/c/Unity3dCollege/videos (code and game design)
https://gameprogrammingpatterns.com/contents.html (programming patterns book)
https://www.youtube.com/c/SharpAccent/videos (intermediate to advance tutorials 3d)



## 2D/General Understanding of Unity/Basic Game Mechanics:

https://www.youtube.com/c/Blackthornprod/videos
https://www.youtube.com/c/JonasTyroller/videos 
https://www.youtube.com/user/Brackeys
https://www.youtube.com/c/JimmyVegasUnity/videos
https://www.youtube.com/c/Tarodev 
https://www.youtube.com/c/EpitomeGames/videos (new multiplayer courses)

## Computer Graphics/Game Engine :

https://gabrielgambetta.com/computer-graphics-from-scratch/ (book)
https://www.youtube.com/c/TheChernoProject/videos (game engine)
https://www.youtube.com/c/javidx9/videos (engine code)

## Multiplayer :

https://docs.google.com/document/d/1ufcl6_ylbzthfmzzZ7HPiwDLR0sr1N3UAunUG9rnisY/edit#heading=h.ch4goz9wecxs (Unity Networking Frameworks - Feature List (available multiplayer solution comparison))
https://www.youtube.com/c/DapperDinoCodingTutorials/playlists (Mirror and Playfab)
https://www.youtube.com/c/FirstGearGames/videos (mirror with js server)

_I post such resources and unity related tips from time to time.
You can follow me on twitter : https://twitter.com/lifecodegames_
From beer sales to writing code for a living
Tags: webdev, beginners, career
Published: 2022-03-02 16:13:18

---
title: From beer sales to writing code for a living
published: true
date: 2022-01-28 11:08:46 UTC
tags: Webdev, beginners, career
canonical_url: https://www.nocsdegree.com/beer-sales-to-code/
---

 ![From beer sales to writing code for a living](https://www.nocsdegree.com/content/images/2022/01/Caitlyn-youtube-cover.png)

Today's interview is with Caitlyn Greffly. She used to work in sales for a beer company but was burned out and wanted a change of career. So she started exploring programming and signed up to a coding bootcamp. Now she is a developer at the financial website Motley Fool!

I talked to her on the No CS Degree podcast about self-teaching vs bootcamps, her tips for beginners and what being a professional developer is really like.

<!--kg-card-begin: html--><iframe width="100%" height="180" frameborder="no" scrolling="no" seamless src="https://share.transistor.fm/e/b63d360c"></iframe><!--kg-card-end: html-->

If you liked this podcast [check out some more episodes](https://www.nocsdegree.com/tag/podcast/)

If you'd like to sponsor an episode, [go here](https://nocsdegreenewsletter.carrd.co)
GitOps Survival Guide at DevConfCZ 2022
Tags: gitops, k8s
Published: 2022-01-28 10:43:11

---
title: GitOps Survival Guide at DevConfCZ 2022
published: true
description: GitOps Automation for Kubernetes
tags: gitops, k8s
//cover_image: https://direct_url_to_image.jpg
---
As presented on DevConfCZ:
https://devconfcz2022.sched.com/event/siGr/gitops-survival-guide-kubernetes-edition

Slides:
https://speakerdeck.com/faermanj/gitops-survival-guide-kubernetes-edition
Adding Legends to Blazor Maps
Tags: blazor, webdev, csharp, dotnet
Published: 2022-01-28 10:42:37

Learn how easily you can add a legend to Syncfusion [Blazor Maps](https://www.syncfusion.com/blazor-components/blazor-map) and customize it with various built-in options. In this video, you will see how to position and align legends in the Blazor Maps control. You will learn how to change the legend icons and mode and how to omit a legend item from the map. 

Explore our tutorial videos: https://www.syncfusion.com/tutorial-v... 

Download this example from GitHub: https://github.com/SyncfusionExamples... 

{% youtube Bkkmpu65bE8 %}
Best Way to Develop React Native App
Published: 2022-01-28 09:53:12

React Native is a cross-platform development library built on top of React by Facebook, for mobile development platforms. React Native was developed in 2013 and was later released for public use in 2015. It gained huge popularity in the developer community, and multiple tech companies adopted it as a mobile development solution because React Native apps share a single codebase for both iOS and Android and could hardly be distinguished from truly native apps. 

**Getting started with React Native:**
Starting with react-native can be exciting, but at the same can be a bit confusing. Therefore, you must consult an experienced mobile app development company who holds brilliant expertise in building React Native Apps. 

One such company is WebClues Infotech.

WebClues is a globally recognized React Native App Development Company offering one-stop solutions for any kind of mobile app development using React Native. Our dedicated React Native developers are experts with extensive field experience in building high quality React Native apps as mentioned below: 

- Android App Development
- iOS App Development 
- React Native Customization 
- Unique React Native Mobile Apps 
- Support and Maintenance 

You can **[hire a dedicated react native developer](https://www.webcluesinfotech.com/hire-react-native-app-developer/)** on a part-time, full-time, per hour basis depending on your requirements.

**Our process of hiring React Native developer is very simple and follows four step:**

- Share your requirements 
- Resume sharing and screening 
- Shortlist the candidate 
- Conduct personal interviews 
- Get your dedicated developers onboard

At **WebClues Infotech**, we believe in providing the best solutions to your needs by transforming your ideas into reality. We make sure that our work reflects our efficiency and your association with us becomes everlasting.