teleren/devto huggingface dataset:
Java Number One in 2019?
Tags: java, javaee, spring, java8
Published: 2019-12-23 10:24:26

---
title: Java Number One in 2019?
published: true
description: End of the year! Some facts about Java in 2019! Is it good? Is it bad? Your thoughts?
tags: Java, Java EE, Spring, Java 8
---


**End of the year! Some facts about Java in 2019! Is it good? Is it bad? Your thoughts?**

In 2019 Java is still number one on Tiobe index - [https://www.tiobe.com/tiobe-index](https://www.tiobe.com/tiobe-index/)

Oracle Java One conference is now renamed to Code One

Android is Kotlin first announced by Google. Google will deliver the Android APIs first in Kotlin and after this in Java

Refactoring 2 by Martin Fowler has the samples in JavaScript and not Java, like in the first version of the book

Pivotal (Spring) was acquired by VMware

RedHat (JBoss) was acquired by IBM

Java EE is JAKARTA EE now out of Oracle garden and in the Eclipse Foundation - [https://jakarta.ee](https://jakarta.ee/)

Oracle refuses to let the *javax* package to be used by Jakarta

September 2019 → Java 13 in many distributions: [https://sdkman.io/jdks](https://sdkman.io/jdks) (but everyone I know is still blocked at Java 8)

---

For 2020 

[Oracle Code One](https://www.oracle.com/code-one/) Is Moving to Las Vegas -> September 21–24, 2020!
[Pivortal Spring One](https://springoneplatform.io/) Will be in Seattle -> September 21–24, 2020!
Having fun with Kubernetes - Chapter 1
Tags: kubernetes, docker, deployment
Published: 2019-12-23 10:05:45

Kubernetes (aka k8s – well, because there are 8 characters between K and S) was always on my Checklist for a long time. Since I wanted to learn more about DevOps to improve our delivery process at work.

But before throwing ourselves into Kubernetes (alright, let’s call it k8s from now on), there are something we need to understand. And the first basic thing is Container. WT* is a Container?

Remember thousand of years ago… When your project’s development is finished, you’d go to a Server hosting provider and ask for a new server, or just a space on their server. After paying your hosting, you’d upload your code, your database,… into it and voilà, your website is online!

Time was passing by… paying for a dedicated server is very high, plus the management, maintenance,… Or if you hosted your website together with others for saving money, but sometime your neighbour’s website crashes the entire server 😅. Well, a new option came: Virtual Private Server (aka VPS) – your dedicated server with lower cost, less management pain. Seems you can sleep well now, without worrying about your neighbour’s application!

Again, after hundred of years using VPS, you and your crew were facing many new problems with the VPS dream:

- Virtual Machine (VM) contains full OS, it’s very heavy for backup, snapshot, …
- Spin up a new VM could take minutes, it’s unacceptable for our era.
- For every VM, beside resources (CPU, RAM, Disk,..) for your application, you also waste those resources for the OS, and they are not cheap when your applications require many VMs.
- Wait, listen, also your development teams are complaining about the differences between their development environment vs production environment!

So, welcome to 21st century, with Container – A new way to create a virtual isolated environment for your application:

- Container provides an isolated environment which runs your application, independent from the host OS.
- Container stays on top of a Container Runtime, shares the resources, libraries,.. with the host OS. So you aren’t running an entire isolated OS on the host OS, but you’re running an isolated application on the host OS.
- Spin up a new Container in milliseconds: Imagine if your server is under high-load, you can just put more 10 minions under your load balancer in just some milliseconds!
- And it’s cool!

Container is for running your application, and there is Kubernetes – k8s for managing your Containers easily and lovely!

*(To be continued)*

Chapter 2 is [here](https://www.martinpham.com/2019/12/07/having-fun-with-kubernetes-2/)
webpack-dev-serverでdisableHostCheckを使うのはもうやめろ
Tags: javascript, webdev, webpack
Published: 2019-12-23 09:41:34

# TL;DR
DO NOT USE `disableHostCheck`. because its potentially vulnerable.
USE `host: "0.0.0.0` and `useLocalIp`. its safe, for now.


ハローこんにちは。`disableHostCheck: true`を使うのをやめろ。

`disableHostCheck`を使うのにはだいたい理由があって、たとえばiPhoneからPC上のlocalhostで動いているサイトを見たいという理由で`disableHostCheck`を`true`にしたりしてアクセスしたりします。

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/6bg9lxvyh6ua2vstr2f7.png)

`[マシン名].local:[ポート番号]`でアクセスするのはiPhoneを使った開発ではよく見る光景ですね。このとき`disableHostCheck`はだいたいInvalid Host headerを回避するために使います。

しかし、`disableHostCheck`を有効にするとDNS rebinding attack脆弱性を抱えてしまいますし、実際に **webpack-dev-serverのdocumentationでも非推奨** の方法となっています。
代わりに今の所、`useLocalIP: true`を使えば解決することができます。

```js
config.devServer = {
    host: "0.0.0.0",
    useLocalIp: true,
}

```

`host: "0.0.0.0"`はないと動かないので注意。
この方法を使えばdisableHostCheckを回避できます。自分のローカルIPアドレスを使ってやればアクセスできるので、ネットワークによってURLは変更されますが。

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/tyvnlesm5s4oh3vm3w7j.png)
How to add internationalization 📙 to your React App ⚛️ in a SUPER-simple way
Tags: react, webdev, javascript, i18n
Published: 2019-12-23 09:22:01

###If you want to translate your Single Page Application to other languages without much hassle - this short guide might be for you.


**Internationalization (i18n for short)** is not a trivial topic and it is perfectly fine to avoid it unless you need it 😎

At [SwissDev Jobs](https://swissdevjobs.ch) we came to the point where we would like to not only have an **English** version of our website but also **German, French and perhaps Italian** (Switzerland has 4 languages to support).

I18n is a new topic for us, so we started researching how to do it in a React application with 2 criteria in mind:
1. **Easy learning curve** - we do NOT want to spend next 4 weeks learning a new framework or library but want a solution that works NOW
2. **Minimal impact on performance** - adding i18n should not blow our bundle size or make the app slower

During the research, we quickly noticed that the existing popular frameworks do not met those requirements. 

For example:
[react-intl](https://github.com/formatjs/react-intl) (probably the most popular i18n library for React with over 11k stars on Github) has a [minified bundle size of 46.6 kB](https://bundlephobia.com/result?p=react-intl@3.9.2) and a lot of features that we don't need.

As we continued our research, we asked ourselves - what is really needed for supporting multiple languages and then it struck us:
###**We only need a 2 level dictionary.**

How do you implement a 2 level dictionary?
![Translation Service](https://thepracticaldev.s3.amazonaws.com/i/b3hrns1gvq6mpe141sdk.png)

How do you use it?
![Use the Translator](https://thepracticaldev.s3.amazonaws.com/i/1r01mkhtk9t7o2z3e3z1.png)

Of course, you can put the actual translations in separate files but you get the idea. 

This way you have created your own, super-simple i18n service 🌍
What Do You Do If You Disagree With Your Boss?
Tags: career, beginners, webdev, interview
Published: 2019-12-23 08:19:30

Boss or not, there's always that inevitable question on how to resolve conflicts at work during behavioral interviews.. 

I never knew how to answer this question 😂, so **I asked one engineering manager (Dios) at Facebook** who is heavily involved in the hiring process on how to better answer this question. He gave some great pointers, which I'd like to share here even though it's short:

**1. Use data to win arguments**
Can you tell a story about using product data to bring objective data to a subjective debate?


**2. Express empathy**
Good answers will sound more like "I think doing it this way is more in-line with our goals, and here's why", and less like "I think you're wrong and that's a bad idea."


**3. Highlight that debate and disagreement is healthy and improve teams**
Of course there is a healthy debate and unhealthy debate. Make it really clear that you use disagreements as an opportunity to learn OR influence others, not to win arguments.


**4. Step back and understand everyone's point of view**
Perhaps there's a good reason for the disagreement that you can learn from. Maybe there are other factors worth considering. This will help take some of the emotion out of the conversation and bring you back to a rational place.

👻 **Curious how everyone else would answer this question!**

ps. If anyone's interested, Dios also wrote about how to write a better resume [here](https://www.rooftopslushie.com/request/Self-taught%20Web%20Dev%20looking%20for%20first%20entry-level%20job%20non%20FAANG-1196#XXsBkTzNbjqR) (completely free to read upon sign-up). I'm currently working at a startup where we help job seekers to get [interview/career advice](https://www.rooftopslushie.com/request/Facebook%20EMEngineering%20Manager%20Onsite%20Interview-109) from tech employees.

More to come!
Web Scraping with Mechanize
Tags: ruby, mechanize
Published: 2019-12-23 07:41:06

If you've ever been in the situation where you can't find the correct data from an API, perhaps you've thought about building your own web scraper. Ruby's Mechanize gem makes building a web scraper a quick and simple task.

Firstly, you'll want to install the Mechanize gem by running 'gem install Mechanize' with your console. Once this is done, simple create a new .rb file and start building that scraper!

You'll want to start by requiring the gems that you're using. In this case, we require 'mechanize' and 'pry' for debugging.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/aek2yj1zi452lymzt752.JPG)

Next we will declare our function and set a variable to a new instance of Mechanize, '@test' in this case.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/8hwp4kz3tfma3uhtcu15.JPG)

Now we want to choose the website that we're scraping. We can set the entirety of a web page to a variable so that we can pick and choose what elements to pluck off and use.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/xv4mbs438bxd7r62d155.JPG)

Using the page below as an example, let's target the address for this particular medical clinic in India. You can see the element containing the address selected in the developer tools on the right.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/85fqpvu5cnvgyytyoveu.JPG)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/n467gdc4wn91gusv9irr.JPG)

To pluck off the address that we want, first we have to target the div containing the address. We then target the p tag nested within that div, as that is where the text address actually lives. When we have the correct element targeted, we can simply strip the text off for later use.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/6v3pstld4nl73dneo9l2.JPG)

Once you have all of the data that you're looking for, you can output it to your console, send it back to your front end, or save it to your database.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/hrj6wb2grl6nzrqwtbme.JPG)

Web scrapers are powerful tools to collect data from any source that you might fancy. Once I learned how to do so, I've used them in the majority of applications that I have created.
Day 23 of the Visual Studio Tips Advent Calendar is now live
Tags: visualstudio
Published: 2019-12-23 08:01:29

Day 23 of the Visual Studio Tips Advent Calendar is now live. Enjoy! 

Only 2 days until Christmas! What could it be today?

https://visualstudiotips.co.uk/calendar/

#VisualStudio #DevDecember #VsTipsAdvent #Advent
06 Tips to Make Your Website Attractive in 2020!!
Tags: vectorillustration, webdev, design, devops
Published: 2019-12-23 07:51:10

What is the best way to make your website attractive? Everyone searches for this query on Google and tries to find their answer. Yes, Google in this 21st century has become a great mean to solve any problem but it has one major drawback and that is the answer you get is quite generalized.

The reason is simple, there are too many websites or links trying to answer this query and finding a right one which satisfies your needs is quite complex task.

Another reason is, old articles, with old research.

Its no new thing to know that tech is updating every year, and, as each year passes on its getting more and more incredible and amazing. And that’s not a different thing with the web development technology.

As amazing and incredible each websites and apps look, people tend to think, “Hey, how can i make website or app look like that?” and then they ultimately end up researching on Google with the queries like “How to make your website attractive” or “How to make your website or app look elegant and cool” and in return they find the old articles which are not keeping up with the updated era of technology.

So, with that being said, here is our fresh take on this particular query.

Top 06 tips to make your website attractive
Now before we begin, please keep in mind that this is not an in-depth article on “UI Development“, this article is more like a palette cleanser to help you develop a more clear aesthetic vision for the design of your website or any other product.

#Tip No. 01 – Get Inspired from the visionary
When you think of a great visionary that shaped the era of personal computing for the people of 21st century then “Steve Jobs” is the one that comes to your mind. Now some people will comment that he was not the greatest but the point is, its not whether he is great or not.

The point lies in the simplicity of the designs of his products, the way he made them look and feel premium. Though almost every Apple product was designed by Jony Ive and his team, it was Steve jobs who inspired them and gave the approval on the final look and that’s the part of the reason why Apple products were considered as the greatest.
 To Contiue Reading Visit- Krayoncraft.com/blog
Top interview question on Angular
Tags: angular
Published: 2019-12-23 07:42:20

Whether you’re an entrepreneur, a project manager in a large enterprise, or a CTO, you are well aware that the success of your project rests on your ability to find top developers.

In this guide, you‘ll find example interview questions and answers you can refer to when seeking a new Angular developer to build your web applications. You‘ll also get some practical advice on how to use these Angular interview questions to reliably identify the best people for the job.

These interview questions are for Angular versions 2, 4, 5, 6 (simply referred to as ’Angular‘). If you are looking for developers for the original AngularJS JavaScript framework, click here for the <a href="https://codersera.com/blog/angularjs-interview-questions-asked-in-2019/">AngularJS interview questions.</a>

These are some <a href="https://codersera.com/blog/top-50-interview-questions-on-angular/">Angular basic interview questions</a> are for screening Angular developers. It‘s important to know before hiring an Angular developer that they will need guidance from more experienced developers. Therefore, a great dev will be able to execute tasks given by senior developers. Skip to the Senior Developer section if you need someone who can lead your Angular project.
Walk In Family Clinic
Tags: walkinclinicwalmart
Published: 2019-12-06 04:59:12

Walk-in clinics are becoming more and more popular these days when compared to traditional doctor offices or visits to the hospital. They're cheaper, more convenient, and more accessible than your regular doctor. If you haven't yet tried your local walk-in clinic, have a look at just some of the benefits these clinics have over a traditional doctor's office or hospital. It's possible to discover any walk-in clinic in your local area so, you do not have to travel miles to get the best doctor for your needs. They offer the exact services especially if you're just looking for quick solutions to your existing health problems. You may be experiencing a powerful headache or allergies suddenly started appearing. 

Visiting doctors, hospitals and a <a href="https://jacknathanhealth.com">Walk In Clinic Saskatoon</a> is par for the course for folks who have migraines. Once we have a medical issue that needs immediate attention, finding a health professional isn't always as easy as it looks because many times physicians have too many patients and their appointments are booked solid. Therefore, for emergencies you need to hire the services of the professional walk-in clinics. The longer the time it takes you to get help, the worse it can get. as an example, you're on your way to work and you become a minor injury while riding a bike. Many do not realize the merits of visiting a 24 hour emergency rather than their regular physician, but there are a number of reasons why visiting an emergency clinic is much more beneficial than waiting for a normal doctor's appointment. Instead of calling and waiting, patients can go to a 24 hour urgent care and be seen as soon as a doctor is available. 

Your condition may worsen if somebody who doesn't know anything about first aid handles your situation so, start looking for professionals. Before you enter any walk-in clinic, it is vital to know which sort of services they offer. Many walk in clinics do not offer consultations with physicians, but rely on a staff of nurse practitioners to see their patients so search for a qualified walk-in clinic, be sure you'll be in the care of a naturopathic physician. Also, look for clinics that are located on your nearby area so, you do not have to travel miles to see them. This comes in extremely handy when you're on holiday or away for business and suddenly realize you need a fast refill. 

Employers will get these kinds of clinics to be a huge advantage to their occupational medicine needs. Find a walk in clinic that takes a wide variety of insurances so you can save you a lot of cash and also in case if you have no insurance policy then the doctors at your average walk-in clinic will go an extra to do what they can in order to make your trip as easy as possible.
Demo Firebase Project
Tags: javascript
Published: 2019-12-23 07:40:02

I created an app called "Better Crumbs" to demo firebase auth and firebase firestore. This app is a vanilla JS app which uses parcel as a bundler. This ensures that it works on old browsers and the code is optimized.

The app is open source under the MIT license. So you can check it out and learn about firebase auth and firestore. [Click here](https://github.com/Vicradon/hng-task-login-form) to check out the repo on GitHub.

I also hosted it on Netlify. Check out [the demo here](https://hng-task1.netlify.com/).

I am open to constructive criticism on how I can improve the code quality and architecture.
PHP Code Syntax highlighting (pretty printing) for CLI.
Tags: php, showdev, syntaxhighlighter, codehighlight
Published: 2019-12-23 07:36:09

---
title: PHP Code Syntax highlighting (pretty printing) for CLI.
published: true
description: 
tags: PHP, showdev, syntax-highlighter, code-highlight
---

Introducing a small library I wrote over the weekend which prints syntax highlighted (colored) PHP code into the terminal.

You can use it in any PHP CLI applications to pretty print PHP code OR to take screenshot of code and use somewhere.

Right now screenshot is manual process but it will soon be automated into this library so you can save a PNG image of your code.

### Installation
`$ composer require adhocore/cli-syntax`

### Usage
```php
use Ahc\CliSyntax\Highlighter;

// PHP code
echo new Highlighter('<?php echo "Hello world!";');
// OR
echo (new Highlighter)->highlight('<?php echo "Hello world!";');

// PHP file
echo Highlighter::for('/path/to/file.php');
```

{% github adhocore/php-cli-syntax %}

Feedbacks and contributions are welcome. Thank you.
Create a Stack Data Structure in Python..
Tags: python, career, algorithms, showdev
Published: 2019-12-23 07:27:09

**Stacks in python**

A stack is a data structure that is implemented using the First In Last Out Approach. A typical implementation of a stack would be trying to arrange three books all on the floor vertically(Book a, Book B and Book C respectively). We first pick book A and place it on the floor, then book B on top of Book A and finally Book C on top of A and B. 

![Stack Data Structure ](https://thepracticaldev.s3.amazonaws.com/i/ne9kc5zo8kqmvh34c3zu.jpg)


**Popping**
Now in order to get book A we need to take **Book B and Book C** off one by one before we can get to Book A again. This approach is called popping.

** Pushing **
To push an element on top of the stack simply means placing an element on top of the stack just like how we did when we were arranging our books vertically.

Enough theory let's write some code😎

{% gist https://gist.github.com/Nyamador/d6102917467f03f9ddc83e87be805b8d.js %}


###Implementing this:

`myStack = Stack()`
Initialize the stack class

`myStack.push("A")`
`myStack.push("B")`
`myStack.push("C")`
Push three items onto the stack

**Displaying the stack**
`['A', 'B', 'C']`

**Pop an item off the stack**
`print(myStack.pop())`


**Taking a peek at our stack**
`'B'`


Let's break this down:
1. We first created a class for our data structure and named it `Stack`
2. In our constructor function ( ` def __init__ `), we created an empty list called items which will be called immediately we initialize an instance of the `Stack` class
3. `Push` - Since our values are held by a list, we can easily use the builtin `append` method on our `items` list to add an element.
4. `Pop` - This uses the builtin `pop`  method to remove the first element on top of the stack.
5. `get_stack` - Returns a list of all items in the stack
6. `is_empty` - Compares the `items` list to an empty list and returns false or true if the list is empty or filled respectively.
7. `Peek` - Because a stack uses the First In Last Out approach, a peek at out stack should only show us the item on top of the stack.Hence we reverse the items list to reflect that...



You've successfully  implemented a stack data structure in python🚀.
Grab a cup of coffee now becuase you're a genius🧠..
How to add third party scripts & inline scripts in your Nuxt.js app?
Tags: vue, javascript
Published: 2019-12-23 07:21:23

### Problem statement

Let's say you have created a Nuxt app and one day your client or your boss asks you to add some snippet of code to every page of the site for analytics purposes. For example:


```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111111111-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-111111111-1');
</script>
```


### Solution

Open your **nuxt.config.js** file and update the **head** section as follows:

```
  head: {
    __dangerouslyDisableSanitizers: ['script'],
    script: [
      {
        hid: 'gtm-script1',
        src: 'https://www.googletagmanager.com/gtag/js?id=UA-111111111-1',
        defer: true
      },
      {
        hid: 'gtm-script2',
        innerHTML: `
          window.dataLayer = window.dataLayer || [];
          function gtag(){dataLayer.push(arguments);}
          gtag('js', new Date());

          gtag('config', 'UA-111111111-1');
        `,
        type: 'text/javascript',
        charset: 'utf-8'
      }
    ]
  },
```

As you can see the **script** array contains two objects. First one is to include the external script from `googletagmanager.com`. The second object shows how to include inline Javascript. For that to work however, you need to add the setting ` __dangerouslyDisableSanitizers: ['script'],`. I am not sure if this is the best or even the recommended approach but it worked for me. If you happen to know a better alternative, I would definitely love to know. You can mention in the comments section below or tag me on twitter. 

Thanks and happy coding :-)