teleren/devto huggingface dataset:
Type Erasure in Java

Published: 2021-03-05 12:44:59


Difficulty Level : Easy

Prerequisite : Generics

Generics concept is introduced in Java language to provide tighter type checks at compile time and to support generic programming. The way to implement generics, the Java compiler applies type erasure to:

Replace all type parameters in generic types with their bounds or Object if the type parameters are unbounded. The produced bytecode, therefore, contains only ordinary classes, interfaces, and methods.
Insert type casts if necessary to preserve type safety.
Generate bridge methods to preserve polymorphism in extended generic types.
In general, the compiled generic code actually just uses java.lang.Object wherever you talk about T (or some other type parameter) – and there’s some metadata to tell the compiler that it really is a generic type. When you compile some code against a generic type or method, the compiler works out what you really mean (i.e. what the type argument for T is) and verifies at compile time that you’re doing the right thing, but the emitted code again just talks in terms of java.lang.Object – the compiler generates extra casts where necessary. At execution time, a List and a List are exactly the same; the extra type information has been erased by the compiler.
VMware Online Training
Tags: vmware, onlinetraining
Published: 2021-03-05 12:39:57

<b>About VMware Course:<b/>

Mindmajix VMware Training is designed to grow your skills and ability to leverage all the VMware opportunities in the industry. Our best infield instructors will cover every aspect of VMware virtualization right from installation, configuration, ESXi, networking, etc. to managing and automating a virtual environment. By the end of this online course, you’ll have a better understanding of VMware vSphere6.7 and be more prepared for the VMware certification exam.

<b>What will you learn in this VMware Remote Training?<b/>

VMWare training provided by mindmajix gives you the blueprint for achieving your goals and winning the top spot. By enrolling in our course, you can secure excellent scores in VMWare certification. Training at your favourable timings makes you gain excellent command over VMWare concepts. Due to this training, you will acquire advanced knowledge of virtualization.

You will earn practical knowledge on concepts like VMWare clusters, vSphere Storage, Virtual Machines, vSphere Networking, Managing Virtual Machines by using vcenter server, VMWare Logs and services, Data protection, Site Recovery Management (SRM), etc. Our seamless live support facilitates you clear your doubts instantly. Live projects prefered by our trainers facilitate you gain real-time knowledge.

<b>Why should you learn VMware to grow your career?<b/>

The need for virtualization in the IT industry is increasing rapidly, so many IT companies are recruiting Certified VMWare Professionals. Salary for Certified VMWare Professionals is about $98000 per annum.

Visit here to learn VMware: https://mindmajix.com/vmware-training
Linux from Scratch on WSL2?
Tags: wsl, linux, help, discuss
Published: 2021-03-05 12:16:21

Hi Devs👋🏻, hope so y'all are well, so in this post I just wanna ask that does WSL2 fulfill the requirements for building Linux distro by taking reference from Linux from Scratch book? Cuz am on Windows and running Linux on VMware is slow and sluggish! So, is it possible to build Linux from Scratch on wsl2? Any help would be appreciated!!
PySpider Vs. Proxies API
Published: 2021-03-05 11:26:32

The world of web scraping is varied and complex, and Proxies API sits at one of the most crucial junctions. They are allowing web scrapers/crawlers to bypass IP blocks by using a single API endpoint to access our 20 million-plus high-speed proxies on rotation.
One of the questions we get frequently is how we are different from services like OctoParse or Diffbot. Many times it is like comparing Apples and Oranges. Still, when we send this comparison table to our customer's developer team, their CXO, their marketing, or SEO team, they typically get it quite quickly if we are a convenient service or not.

So here is how we are different from PySpider.

PySpider is useful if you want to crawl and spider at massive scales. It has a web UI to monitor crawling projects, support DB integrations out of the box, uses message queues, and comes ready with support for a distributed architecture. This library is a beast.

You can do complex operations like.

Set priorities.
Set delayed crawls. This one crawls after 30 mins using queues
this one automatically recrawls a page every 5 hours
ReactJS vs AngularJS: Which Web Framework is Best in 2021
Tags: react, angular, mobile, discuss
Published: 2021-03-05 11:13:07

When it comes to developing interactive web pages and user-friendly applications, JavaScript (JS) has remained the preferred programming language for developers worldwide. Today, all thanks to evolving technology, we have many robust and resourceful web development frameworks available based on JavaScript. But then, it makes the selection of the right framework to meet specific project requirements quite difficult.

Here we are going to compare the two most popular JS frameworks- AngularJS and ReactJS. The search engine giant Google has developed AngularJS and Facebook has developed ReactJS. Both these front-end frameworks support mobile and desktop applications with a different approach. This head-to-head comparison between AngularJS vs ReactJS will help you select the right platform for your upcoming web project.

ReactJS vs AngularJS- Comparing Two Powerful JavaScript-based Platforms

Both Angular and React are highly popular among the developers’ community. However, looking at stars, ReactJS has got the double number of stars as compared to Angular. Angular has 56k stars, whereas ReactJS has over 142k stars. Before digging deep into the comparison between these two frameworks, here we give their history and brief introduction.

ReactJS

It is basically a JavaScript library released back in 2013. It is ideal for developing large web applications with frequently variable data. It offers one-way data binding in a virtual DOM. It is an open-source library developed and maintained by Facebook and a thriving developers’ community. It can be used as a base for making single-page or mobile apps. You can hire a [ReactJS development company](https://www.suriainternational.com/reactjs-development-company/) to get reliable and dynamic web app solutions.

AngularJS

It is an open-source framework to build dynamic web applications. Google and a developers’ community maintain this framework. It enables developers to utilize HTML as a template language. Developers can spread the syntax of HTML for exposing the app’s components clearly. You can consult a custom software development company to make the most from this enterprise-friendly framework.

Visit us: https://www.suriainternational.com/reactjs-vs-angularjs/
Creating a Temperature Converter without a single line of JS
Tags: html, htmx, hyperscript, javascript
Published: 2021-03-05 11:03:54

This is the second in the series of posts about using [hyperscript](https://hyperscript.org/) a scripting language designed for the web, inspired by HyperTalk, for building components in HTML. If you want to take a look at the first introductory post, you can check it here.

{% link https://dev.to/rajasegar/creating-a-counter-component-without-a-single-line-of-js-42d5 %}

In this post, we are going to build a Temperature Converter component which converts Celcius values to Fahrenheit and vice versa. This component is inspired from the [7GUIs]() project where we build simple user interfaces in various languages and frameworks to benchmark the complexity and code involved.

So let's just get into the HTML code first and will see what each line of code is doing.

## The code
```html
<script src="https://unpkg.com/hyperscript.org@0.0.4"></script>
<p>
  <input id="txtCel" type="number" _="on change set #txtFah.value to  ( 32 + (me.value * (9/5))).toFixed(1) "  value="0"> Celcius = 
  <input id="txtFah" type="number"  _="on change set #txtCel.value to ((5/9) * (me.value - 32)).toFixed(1)" value="32"> Fahrenheit
</p>
```

As I promised in my first post, all the code examples are terse, having just a few lines to implement simple UI components.

Our first line of code is to import the `hyperscript` library from the unpkg CDN. The we are creating two input elements with type as `number`, one for the Celcius values and the other for Fahrenheit.

And then we define the `onChange` event of each these inputs to update the Celcius and Fahrenheit values deriving from one another based on a simple formula. So when you update the Celcius values, the Fahrenheit values are automatically calculated based on it.

```html
<input id="txtCel" type="number" _="on change set #txtFah.value to  ( 32 + (me.value * (9/5))).toFixed(1) "  value="0">
```

The script above says 
```
On the 'change' event for this input, set the value of the element with id `txtFah` to the calculated value based on the current element's (me) value and round it off to one decimal point
```

The `on` feature allows you to embed event handlers directly in HTML and respond to events with hyperscript:

```html
<button _="on click add .clicked">
  Add The "clicked" Class To Me
</button>
```

The underscore (_) attribute is where the hyperscript runtime looks for hyperscript on an element by default.

We can access the current element in the event handler using the built-in `me` object using hyperscript and the other input element using its element identifier. The assignments can be performed using the `set` command in hyperscript and finally we are rounding off the values to one decimal place using the `toFixed` function in Javascript.

You can take a look at the component in action in this Codepen.

{% codepen https://codepen.io/rajasegar/pen/LYbroBB %}
You can now get voice and video calls with Whatsapp Desktop
Tags: news, whastapp, productivity
Published: 2021-03-05 10:47:17

## Summary

![Image](https://cdn.vox-cdn.com/thumbor/nHCysm4ma-NiB32LhdClCqj0PD0=/0x0:3360x2100/1820x1213/filters:focal(1412x782:1948x1318):format(webp)/cdn.vox-cdn.com/uploads/chorus_image/image/68909385/whatsapp.0.png)

WhatsApp’s desktop app for Mac and PC is getting voice and video calling today, the company announced, offering end-to-end encrypted calls to other WhatsApp users on both computers and mobile devices.

To use the new video calling feature, you’ll have to set up the WhatsApp desktop app on either Mac or PC, which requires that you already be a WhatsApp user on mobile. Once you’ve installed the app on your computer, users will then scan a QR code to log in on the desktop app, after which they’ll be able to use the desktop version of WhatsApp with their usual account.

## Links

* [https://www.theverge.com/2021/3/4/22312152/whatsapp-desktop-app-mac-pc-video-voice-calls-available-now](https://www.theverge.com/2021/3/4/22312152/whatsapp-desktop-app-mac-pc-video-voice-calls-available-now)
🎉 My daughter built her first website 🦄
Tags: showdev, html, watercooler, wecoded
Published: 2021-03-05 10:42:39

Just over a week ago, I asked my daughter if she'd be interested in writing some code and building a simple web page. We've played around with a few games on [Code.org](https://code.org) a few times as part of her homework during lockdown but never really built something from scratch.

{% twitter 1361657465427927041 %}

I wasn't sure how it would work between us, I like mentoring as a side affect of what I do at work, but teaching isn't really my calling. But we gave it a shot and actually came up with something fun over in a little over an hour overall.

## Starting with the basics

We kicked off with some HTML. I explained very loosely how tags worked and where certain tags sat.

Once we'd got through that, she was eager to get into building something and she was amazed that she could write out a few things and then see them in the browser. We literally started with a button that had no display value. She was unimpressed... until we added a display value. In our second session, we came back and structured the page a little better, but this was a great start although a button that does nothing will only impress someone for so long!

So we moved on to some basic JavaScript, and introduced her to the `alert()` function. That was a great step as she got it pretty quickly: "I can make a button do something when you click it".

Again, how long is that actually impressive for? The answer is a few minutes at best for a 7 year old...

So we brought in prompts. Now she could ask a question and remember the answer... but why would we do this? Oh wait, we can add the value in to our alert!

This was a bit that really impressed her and helped to keep her attention. We probably entered a value into the prompt 10 times, or more, as we tested.

In our second session, as well as a more structured page, we introduced some CSS, utf-8 characters (unicorns, of course) and introduced a second prompt that would influence how the page looks.

It was a really fun exercise and something I've thought about for years. I much prefer building [dumb websites](https://twitter.com/cchana/status/1365747578357362688) and I think that helps to make it easier to introduce some of these concepts. Everything else can wait until there's some real interest in the topic.

## The code

I've uploaded what we've done to GitHub, you can find it at [cchana/diya2021](https://github.com/cchana/diya2021), feel free to browse through the code and share it with your young ones. We'd love to see what others do and maybe even some pull requests.

![Screenshot of diya2021.1thingaweek.com that starts with a pink background and a purple button.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qel1ny46e300q9wewwwd.jpg)

Above is a screenshot of the page after the initial load in all of its purple glory. If you want to see it in action and give it a go, head over to [diya2021.1thingaweek.com](https://diya2021.1thingaweek.com).
Basic Bash
Tags: bash, shellscript, linux
Published: 2021-03-05 10:36:33

Bash script or Shell script it's not that important but it keeps popping up while you work on container. For example, you might need to run a command which will keep your container running for 3600 seconds. If you know bash script, then you know there is command called sleep followed by the number of specified well keep your interactive terminal wedding for the specified seconds. These are not very in-depth automation kind of script you have to understand but good to know some basic Shell scripts construct which will help you during the exam as well as while working with Kubectl.

{% youtube CdY5gb1wqLs %}
Week one at Task-force
Tags: taskforce, awesomitylab
Published: 2021-03-05 10:30:30

Greetings,

It's been a week at the task-force with Awesomity Lab and Code Of Africa. I learned a lot of valuable things with them and in this blog post I will be sharing the lessons I gained. I believe some days will remind me there were some days I didn't know things and it will motivate my eagerness towards things even bigger.

For the first day I was excited and curious about meeting new people and the team I was selected with, it was a really good experience to meet the guys. Later in that morning  I learned a lot about my personal values, team values and code of Africa values together with Axel Kuhlmann. I understood for a team to be successful it needs to be having common values. In the afternoon I had an interesting session with Yannick and Sam working us through the git workflow We will be using at awesomity lab.

Day two was more technical. I did a number of algorithms and data structures, the exercise actually boosted my thinking capability towards solving a challenge. As a developer I understood I have to be looking at all perspectives that may crash the app I am developing and think about the efficient and effective solution.

Day three was about communication in general. It was really interesting because I believe communication is crucial in our day to day life. In the morning we got a chance to be reminded what communication is and how we can improve our communication skills with Hans Stoisser. In the afternoon Anja Schlösser gave us an interesting session about preparation and presentation. Later on we got a chance to present, I believe my presentation skills will improve as I do a lot of practices.

Day four and day five were educational, because I learnt about writing understandable clean codes with code-wars challenges and how I can containerize my app. I also understood that teamwork is key to success.

First week was both interesting and educational, I believe the boot-camp will boost both my skills and experience in software engineering career and day to day life.
Nevertheless, I changed my goals
Tags: wecoded, choosetochallenge, career
Published: 2021-03-05 10:23:28

Reading my submission from [last year](https://dev.to/bb_loft/this-community-is-unlike-any-other-and-i-am-proud-to-be-a-part-of-it-529i), published on the 5th of March 2020, unaware of what was to come, it included the lines “looking forward, I hope to see the standards of inclusivity and accessibility at events continue to rise” and “I hope the rest of your year includes a strong community”. 

And in some ways, it absolutely did. With the moving of events online, this year more people than ever were able to access talks from amazing speakers from across the world on a whole range of topics. This year’s International Women’s Day theme is Choose to Challenge, but this past year has already been challenging us all. We know that women have been disproportionately impacted by COVID and we can all lend our support to the community around us in helping those impacted however we are able. As folks are starting to plan physical events, I hope we can keep the increase in accessibility and inclusivity practices that virtual events have enabled.

On a personal note, my 2020 plans were as follows:

*As for me, I am spending the rest of this year with the challenge of coding my own book blog from scratch to share the numerous books I read in my spare time and with the hope of connecting with a new community.* 

Did I complete this? Absolutely not! Whilst it’s true that I have been reading a lot and talking about books with my friends, I realised I had no interest in starting a blog post and adding any pressure to experience books in a way which had to be shared with others afterwards after all! I’m okay with having changed my goals, in the space of the last year I have gained skills in coding, got accepted into a Digital Anthropology masters course starting in September and applied to join a mentoring programme for community managers. We need to normalise goals changing and not being achieved for whatever reason.

My message for others is to take time to rest amongst challenging situations, protect your energy and if you have some to lend, spread it around your community to those who could benefit. I think of the women in my company and the folks who support us, ally themselves with us and spend their time challenging to make for better futures and I feel grateful for my community. To reiterate from last year, utilise your sphere of influence, spot where you can make a difference and start there, take on an intersectional approach and be proactive about recognising and using your privilege and resources to include others.
Golang Unit Testing 
Tags: go, webdev, testing
Published: 2021-03-05 10:14:51

Okay so in the first write i gonna to show you how to implementation Unit Testing in Go, absolutely this is very ez to learn. So lets do it.

# Create Package

so i created package name is __helper__, but if you wanna to create another package name it`s not a problem.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5n72jclstpcjo3csiolv.JPG)

Like the examples above, i made function simple named __Hello World__. if we`re trying to test it, then it should be done with __Test.go__. 

Next, Go has a method _(t *testing.T)_ and then follow the code below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2mfohmsrgqyg1emsz01.JPG)

__Result__

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d301ehexxqyml30veqze.JPG)

if we wanna to run this code, we got to the helper folder first.

In above, we create a logic which only contains an error by using the _panic_ function.

In Go, we can perform an error other than panic, we can use __t.Fail()__ and __t.FailNow()__ .

It`s the difference when using t.Fail() and t.FailNow()

First, we change in Hello_World.go 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e8fe2tdkhvjcmm8th5by.JPG)

Next, we create other function in Hello_World_test.go

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hc24n934ckp32crxklkt.JPG)

Result :

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ilodhzxjd6405yq6jgoz.JPG)

So we got this, thx for read and sorry for the mistakes, Enjoy.
Task Force 2.0 First Week Sessions
Published: 2021-03-05 10:06:57

During _this first week task force boot camp_, I have learned a lot of things including; _Knowing my values_, _communication skills_, _presentation skills_, and technical skills such as pipelines and workflows used in __AwesomityLab__.

My first day was as confusing as _playing chess_. This was because I was not used to working with many people at the same task. The very beginning session taught me how to figure out what my values are and respecting other people based on their values. I learned to create team's values techniques which are as simple as these:
> 
 1. Write very big list of values
 2. Ask everyone to choose his/her five best values
 3. Choose the common values from each one.
 4. Write them down.
 5. Ask if everyone agrees with them
  
The second day I worked on __codewars__ challenges, but the most important part is that I never worked alone, like I mentioned earlier, we worked as a team. So, the challenges become much more easier as I never worried about missing someone to help me.
Working as team, or solving problems together, helps everyone become open both for receiving and giving.  

Third and fourth day, I had already become used to working with others. 
I started sharing my problems in coding with them, and started receiving their experience which I think I need to experience too. We have become open team though we still have more time to know a lot about each and everyone, but we are at the good stage.  

___Lack of Contents list___ and ___less resources___ are the most _challenges_ I met during my first week sessions.  
As we learned something new, I expected getting more resources especially in technical sessions.

I would ask the team to be providing them in _future sessions_. 

Thank you __Awesomity Lab__ and __Code Of Africa__.