teleren/devto huggingface dataset:
Kotlin or Swift
Tags: android, kotlin, swift
Published: 2019-11-22 08:16:48

---
title: Kotlin or Swift
published: true
description: Endless compare this language platform.
tags: android, kotlin, swift
---

When everyone talking about native development or hybrid development, i just wanna talk about the programming language. Yes, for native development there was two platform, android and iOS, each of that develop with different language android for kotlin/Java, iOS with Swift/Objective-C. Okay, now i will compare kotlin and swift because there react similiar. But actually kotlin and swift have different behaviour only have similiar syntax. every of them have different pros and const and absolutely own way of thinking. 

Kotlin is another child of Java language with improvement in some component in rich collection function such as map, filter, reduce, etc. But the most improvement is, when Coroutine come that make more powerfull than Java or Swift. Swift didnt have component that similiar to Kotlin Coroutine. The other hand kotlin have LLVM component that can mimic native component so kotlin can port into native OS example in macos or iOS, but kotlin native still under development because lack of performance than kotlin it self.

Swift language is completely different than kotlin, java, objective-C or maybe popular golang language. Swift has no Virtual Machine (VM). swift have similiar behaviour like C++ and Rust language. Java kotlin have reflection, have VM, Generic specialization, and arent allow to handle memory. So when there an streaming app or image processing better with C/C++ language. So compare swift with kotlin is not fair enough except compare the syntax. maybe its fair if compare swift with C++.

What do you think about that?
Opencart Product Video Extension: Add Product video on your eCommerce store 
Tags: opencartvimeoextension, opencartproductvideoupload, opencartyoutubeextension, productvideoextension
Published: 2019-11-22 06:53:20


If you want to add a video with your online store product to show the detail of the product then Purpletree Product Video extension helpful for you. It is also known as OpenCart product video extension, Opencart youtube extension Opencart product video upload, and Opencart Vimeo extension. OpenCart product video extension provides the facility to show a video on the product page in a nice popup. You can add Youtube and Vimeo videos by using Product Video? Youtube and Vimeo for Opencart extension.

With the help of product video, you can increase your product sell and the customer can watch your product all detail. Opencart product video upload supports youtube and Vimeo videos. To add video with your product first, you can upload product video on Youtube or Vimeo then get the embed code for the video you want to show on the product page. This embed code enters the product detail page and saves the product detail. After that, the product video will be shown on the product detail page.

How to add video
Go to admin and installed OpenCart product video extension with the help of the user guide. After that, go to the navigations menu select catalog and click on it. Thereafter, click product add or edit button.


Get the embed code for the video you want to show on the product page. This can be easily obtained using these steps: http://bit.ly/2s2T4F6. Paste the embed code for youtube or Vimeo and define the height and width of the popup for the chosen language tab.


Now click save button. You should see the video link in frontend in the product detail page.


Click on the video link will show Video in a nice popup.


Opencart product video upload supports Open cart version 3x and 2x You can get Free Technical Support: 6 Months.

Get This Plugin At https://www.purpletreesoftware.com/opencart-add-video-to-product-youtube-and-vimeo.html
Runkod update #1
Tags: runkod, decentralized, web, hosting
Published: 2019-11-22 06:24:14


I would like to share some news about Runkod.

We launched Runkod on Product Hunt at 11 November. It completed launch day as product of the day 🎉 

<center><img src="https://i.imgur.com/9qUzBiO.png" width="300" /></center>


We got lots of positive comment and feedback from Product Hunt community. It was an epic day!

Since launch more than 1000 users joined to Runkod. More than 1500 web projects created so far by our users. That makes Runkod one of the top used Blockstack apps. Having those numbers in just 2 weeks like a dream to me :)

<center><img src="https://i.imgur.com/lVYAQQi.png" width="500" /></center>

Some of them migrated their corporate website, some of them published their personal websites and some of them are using Runkod for code testing purposes etc...


I would love to get feedback from you guys. Visit [runkod.com](https://runkod.com) and let us know what do you think.

Cheers.
PHP Interview Questions
Tags: interviewquestionsanswers
Published: 2019-11-22 06:13:46

PHP stands for Hypertext Preprocessor is a server-side scripting language. PHP is among one of the most popular programming languages in the World Wide Web. This server-side programming language is highly flexible and loaded with many innovative features to create Dynamic websites. With PHP, you can simply build a website that is interactive for visitors to your site. There are many people that are programmers that can create PHP forms for their website without a generator, but not everyone can do. Some of the best examples of websites that are actually written in PHP are Facebook, Wikipedia, Quora, Google etc.
Hackathons, anyone?
Tags: todayilearned, todayisearched
Published: 2019-11-22 06:05:31

After wanting to be part of [Hacktoberfest](https://hacktoberfest.digitalocean.com/) and being too busy, I thought I'd check out Hackathons, first of all reading all about them on [Wikipedia](https://en.wikipedia.org/wiki/Hackathon), and then searching for local ones.

I found two lists of upcoming events in Australia: [Hackathon.com](https://www.hackathon.com/city/australia/perth) and [Disruptors.co](https://www.disruptorsco.com/big-list-hackathons/). The former list looks like it covers other locations.

Maybe ...
Poll:  Please answer a few HPE questions.
Tags: contributorswanted, help
Published: 2019-11-22 05:54:39

I am curious to hear what others know and think about HPE. I do not work for HPE.  I am simply trying to get an understanding of the company software/DevOps wise. Not knowing or having heard of HPE is important to know too. 

Thanks to all. 

1. Do you associate HPE with DevOps?

2. When you hear *Hewlett Packard*, what things come to mine?

3. Have you used an HPE product in the normal course of building a software app? Was that product hardware or software and which one(s).

4. Would you consider using the HPE container platform in place of your current container platform?
Refactoring a Legacy Project
Tags: discuss, refactorit
Published: 2019-11-22 05:49:39

Hi, I'm starting a new project at work. We have a legacy project which has really bad codes. This is one of our big projects which still in use.

So, I can recode it or refactor it. My manager thought refactoring is more sense.

The worst thing is that the project coded by someone. I changed some parts. I know there are really bad codes. I'll refactor it but I don't have any idea about where to start.

What should I do?

What are your suggestions and thoughts?

Thanks :)
Day #1 of #30DaysOfWebPerf
Tags: imagelazyloading, sitespeed, userexperience, performance
Published: 2019-11-22 05:49:19

---
title: Day #1 of #30DaysOfWebPerf
published: true
description: Dealing with images
tags: image lazy loading, site speed, user experience, performance
---

{% twitter 1197750297310793729 %}{% twitter 1197750298170679296 %}{% twitter 1197750298896285696 %}{% twitter 1197750302864072704 %}{% twitter 1197750310355132417 %}{% twitter 1197750311542067200 %}{% twitter 1197750315740565504 %}{% twitter 1197750317032411136 %}{% twitter 1197750656532017152 %}{% twitter 1197750657643532288 %}{% twitter 1197750658482360321 %}{% twitter 1197750659518304256 %}{% twitter 1197750660734697472 %}{% twitter 1197750661808418816 %}{% twitter 1197750662617939968 %}{% twitter 1197750666128572417 %}{% twitter 1197750668552859648 %}
Get unique values in an array
Tags: javascript
Published: 2019-11-22 05:43:02

const numbers = [1,1,3,2,5,3,4,7,7,7,8];

//Ex1
const unieqNumbers = numbers.filter((v,i,a) => a.indexOf(v )=== i )
console.log(unieqNumbers) //[1,3,2,5,4,7,8]

//Ex2
const unieqNumbers2 = Array.from(new Set(numbers))
console.log(unieqNumbers2) //[1,3,2,5,4,7,8]

//Ex3
const unieqNumbers3 = [...new Set(numbers)]
console.log(unieqNumbers3) //[1,3,2,5,4,7,8]

//EX4 lodash
const unieqNumbers4 = _.uniq(numbers)
console.log(unieqNumbers4) //[1,3,2,5,4,7,8]

Visit : http://programmerchallenge.in/
#30DaysOfWebPerf
Tags: webperf, sitespeed, lighthouse, ux
Published: 2019-11-22 05:40:27

---
title: #30DaysOfWebPerf
published: true
description: 30 days of web performance series
tags: web performance, site speed, lighthouse, UX
cover_image: https://thepracticaldev.s3.amazonaws.com/i/grtokj8tip0mfxfm1jhm.png
---

I have been working on improving the performance of some large e-commerce sites lately and that is when I came across #30DaysOfWebPerf on Twitter. This made me think, if I could learn more by embarking on this 30 day long journey and in the process also share some of the knowledge I have. Some topics, I think, I will cover as part of this will include.
1. Let's tackle the Images (obviously)
2. Cleaning up the critical render path
3. Cleaning up unused CSS
4. Cleaning up unused Javascript
5. Cleaning up the DOM
6. Dealing with third party scripts
7. Measuring performance
8. Resources you can learn from

Follow me on Twitter [@shreerangp](https://mobile.twitter.com/shreerangp) for the #30DaysOfWebPerf series, or on #DEVcommunity where I'll post the thread for each day in the series at [https://dev.to/shreerangp/30daysofwebperf-4kh9](https://dev.to/shreerangp/30daysofwebperf-4kh9)

## #30DaysOfWebPerf Series
{% link https://dev.to/shreerangp/day-1-of-30daysofwebperf-59ep %}{% link https://dev.to/shreerangp/day-2-of-30daysofwebperf-13ig %}{%link https://dev.to/shreerangp/day-3-of-30daysofwebperf-300d %}{%link https://dev.to/shreerangp/day-4-of-30daysofwebperf-2hfg %}
Liskov Substitution Principle in 3 Minutes
Tags: java, oop
Published: 2019-11-22 05:40:13

The Liskov Substitution Principle is the *L* in *SOLID* object oriented design, and despite having one of the more intimidating sounding names of the 5 principles, it's actually pretty easy to wrap your head around.

It's so simple, in fact, that you're going to understand it in about 3 minutes.

# What Is It?
The LSP, in simple terms, states that objects of the same superclass should be able to be swapped with each other without breaking anything.

If we have a `Cat` and a `Dog` class derived from an `Animal` class, any functions using the `Animal` class should be able to use `Cat` or `Dog` and behave normally.

# Let's do an example!
Even that definition doesn't quite explain it very well, so let's put it into practice. All will become clear with the code.

In true OOP fashion, let's make an `Animal` superclass, and a `Dog` and `Cat` subclass and capture their favorite kinds of food.

```java
public static class Animal {
  public String favoriteFood;
  public Animal(String favoriteFood) {
    this.favoriteFood = favoriteFood;
  }
}

public static class Dog extends Animal {
  public Dog(String favoriteFood) {
    super(favoriteFood);
  }
}

public static class Cat extends Animal {
  public Cat(String favoriteFood) {
    super(favoriteFood);
  }
}
```

Now we want to make a method that will let us give these cuties some treats. I don't want to put this method in the `Animal` classes though, because it's *me* feeding the animals, not a behavior intrinsic to the animals. Something like `Dog.feed` might get the point across, but I think `feed(Dog)` is better, don't you?

Let's make this method and call it `GiveTreatTo`:

```java
public static void GiveTreatTo(Animal animal) {
  String msg = "You fed the " + animal.getClass().getSimpleName() + " some "  + animal.favoriteFood;
  System.out.println(msg);
}
```
See here that `GiveTreatTo` takes any `Animal` as a parameter. Since our `Animal` constructors assign the animal's favorite food, we can pretty much count on that data always being there.

This means we don't have to make a method for each animal, i.e., `GiveTreatToDog` and `GiveTreatToCat`. Because we implemented LSP, we have one method. Let's see it in action:

```java
public static void main(String[] args) {
  Dog rover = new Dog("bacon");
  Cat bingo = new Cat("fish");
  
  GiveTreatTo(rover);
  GiveTreatTo(bingo);
}
```

Now, if we properly implemented the LSP, this program should run just fine. Let's check the output:

```
You gave the Dog some bacon
You gave the Cat some fish
```

Amazing. Another benefit of this principal is we can add more and more subclasses of `Animal` and the `GiveTreatTo` method won't need any tinkering.

# Wrap Up

Pretty non-intimidating right? As with many things in programming and computer science, the name belies its simplicity. Now, go out there and make your subclasses swappable, and thank Dr. Barbara Liskov for such a useful principle.
Nuxt Automated Testing: The Tricky Parts
Tags: nuxt, vue, continuousintegrati, javascript
Published: 2019-11-22 06:31:45

---
title: Nuxt Automated Testing: The Tricky Parts
published: true
date: 2019-11-22 05:17:39 UTC
tags: nuxtjs,vuejs,continuous-integrati,javascript
---
[![](https://cdn-images-1.medium.com/max/600/1*EjYhwelWvci5YDVnacTa-Q.jpeg)](https://medium.com/@richard.e.schloss/nuxt-automated-testing-the-tricky-parts-773f04481dd0?source=rss-40d325a4ce73------2)

TL; DR — If you clicked on this article, most likely you have become a bit overwhelmed trying to automate tests for certain parts of your…

[Continue reading on Medium »](https://medium.com/@richard.e.schloss/nuxt-automated-testing-the-tricky-parts-773f04481dd0?source=rss-40d325a4ce73------2)
Key Takeaways For A Successful Startup
Tags: softwarestartup, motivation, productivity
Published: 2019-11-22 03:51:15

---
title: Key Takeaways For A Successful Startup
published: true
description: Takeaways for building a successful startup
tags: #softwarestartup, #motivation #productivity #discuss
---

I've spent the last two years working for a software startup company and have learned a great deal about what goes into such a venture. It's allowed me the opportunity to study and appreciate great leaders in the Tech industry - people such as Steve Jobs, Elon Musk and so on. In this short essay, I want to dive into my three takeaways from this journey thus far. 

1. Culture means everything and should be thoughtfully crafted every day. Sure sounds like a cliche but let me expand on that a bit. A startup takes a lot of work and dedication from the entire team to get off the ground. If your CTO has the vision but developers are not fully engaged, chances are this will likely fail. Nothing of significant value and size will get accomplished from a bunch of folks working 9 to 5. It takes a certain culture and leadership to give this mindset established. Morale has to stream down and throughout the entire company daily. 
 
2. Get rid of titles. They create egos more than anything. Startups tend to be full of meaningless titles that no one can explain. From vice presidents to chiefs and so on. Just confusion. Keep it simple and have people work together on what they are best at. Eventually, people will find where they fit best without forcing a title on them. What they can contribute to or perhaps what they want to stay informed about. Each individual should feel a sense of ownership for the entire process. Titles and departments just add barriers within the company and prevent the creativity and collaborative spirit needed to succeed in this environment. It sounds chaos, but its an organized type of chaos.
 
3. You need leaders, not managers. Most managers out there are mostly concerned with keeping the boss happy so they can earn their next badge. These are not the individuals you need around. Managers create workers and workers ought to be your worst enemies. How do I define a worker? Folks who sit around waiting for their next assignment. 9-5 folks with zero motivation besides the paycheck and the weekend. You get the idea. Leaders empower others through a sense of ownership and responsibility while fostering the next batch of leaders.
Template Driven Forms with Validation Angular 8 
Published: 2019-11-22 12:50:37

---
title: Template Driven Forms with Validation Angular 8 
published: true
date: 2019-11-22 05:02:30 UTC
tags: 
canonical_url: https://www.itsolutionstuff.com/post/template-driven-forms-validation-in-angular-8-exampleexample.html
---

Here is a angular 8 template driven form validation example i would like to give you example of how to create template driven form in angular 8 i will give you simple example of template driven form validation in angular 8Angular 8 provide forms and they provide way to handle user input using n
Inheritance in JavaScript and understanding the prototype chain
Tags: javascript, tutorial
Published: 2019-11-22 04:42:53


Javascript has an interesting inheritance model, which happens to be completely different from most OOP languages. While it is object-oriented, an object doesn't have a class that it gets its methods from. Instead, it has a prototype.
​
This is called **prototype-based inheritance** (as contrasted with **class-based inheritance**)
​
It is important to understand the differences between these two as they are not equivalent, and lead to much confusion down the line.
​
Even though JavaScript has since introduced `class` keyword for supporting OOP, this is simply syntactic sugar for its prototype-based inheritance model - nothing has fundamentally changed.
​
## Defining a class with the `function` keyword
​
Let's have a look at a "class", defined using the `function` keyword:
​
```js
function Animal(name, energy) {
  // _secret is a private property, which cannot be accessed with a dot-notation
  const _secret = 100;
  // name and energy are public properties, can be accessed with a dot-notation
  this.name = name;
  this.energy = energy;
  // this function is public, and returns the value of the private _secret property (but prevents it from being modified)
  this.getSecret = () => _secret;
}
​
// all properties under prototype are shared methods across all instances of a function.
Animal.prototype.sleep = function(energyReplenished) {
  console.log(`${this.name} is sleeping.`);
  this.energy += energyReplenished;
};
Animal.prototype.play = function(energyLost) {
  console.log(`${this.name} is playing.`);
  this.energy -= energyLost;
};
```
​
**Note:** `_secret` is a private property not because of the `_` prefix on its variable name, but because we did not define it specifically as a property on `this`.
​
## Prototype-based Inheritance
​
Now let's have a look at inheritance:
​
```js
function Dog(name, energy, breed) {
  // every instance of Dog will now have a name and energy property.
  Animal.call(this, name, energy); // look at the Animal function above - notice how it takes in `name` and `energy` as the two parameters
  // in addition to the properties created by the Animal function, Dog also has its own properties now as well
  this.breed = breed;
}
​
// Dog has the same prototypes that are definded in Animal,
Dog.prototype = Object.create(Animal.prototype);
​
// but also some of its own as well:
Dog.prototype.bark = function () {
  console.log('Woof Woof!');
  this.energy -= 0.1;
}
​
// Let Dog's constructor point to itself, not Animal
Dog.prototype.constructor = Dog;

```
Thanks for reading, and I hope you've enjoyed!
Collapse
angular
Tags: angular, tomcat, help
Published: 2019-11-22 04:28:28

i changed one old web application into angular and spring boot microservices. i learn basic angular form youtube tutorials and other sources, but i have big confusion on deployment. when we run command

ng build --prod
it compress all files and create dist folder. i copy all file from dist folder and paste inside tomcat webapps folder and application run fine.

is it necessary to build whole project every time? and repeat same process again and again when we make any changes on our local development machine.

i try to find the solution a lot search on google but did not get any solution . what is the proper way for deployment from local machine to production server?
Wait, but what exactly is React?
Tags: beginners, react, javascript, webdev
Published: 2019-11-22 03:37:57

---
title: Wait, but what exactly is React?
published: true
description: A brief overview of React for beginners.
tags: beginners, react, javascript, webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/7lfp1q7mnsvuoulsp7ge.jpg
---

​Coworkers and colleagues have been asking me about React since 2014. Instead of explaining it time and time again, I will give my 5-minute summary here in this article.
​
**What is React?**
​
React is a JavaScript library developed by Jordan Walke, a software engineer at Facebook back in 2011. Since then, React has become a widely popular open-source library that is used by Facebook, Instagram, Netflix, PayPal (just to name a few) and maintained by Facebook, Instagram and an amazing community of developers that have taken an interest in the library.
​
**How does React work?**
​
React uses a component based architecture (i.e. it involves you writing "components"), defined using a special JSX syntax which compiles down into regular JavaScript. Here we have a `Button` component that renders a different class name to the `<button>` based on the props.
​
```js
const Button = props => {
  const className = `button ${props.type}`;
​
  return (
    <button className={className} onClick={props.handleClick}>
      {props.label}
    </button>
  );
};
```
​
This level of flexibility makes creating interactive UIs fun as you are able to reuse components in different parts of your webpage.
​
**Note:** Although the code within the `return` looks like valid HTML, it JSX - a syntax extension to JavaScript to make defining React elements easier.
​
When you want to render a particular kind of button, you just pass the `<Button>` component a list of props (similar to attributes in HTML):
​
```jsx
<div className="app">
  <Button handleClick={handleAPICall} label="Submit" type="primary" />
</div>
```
​
**Why should I learn React?**

1. **It's incredibly popular, and as such is very employable.** A survey conducted by Stack Overflow showed that React was the most loved and wanted web framework.
​
   ![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/4ehin4bwp40c5pktf7rf.png)
​
2. **It's incredibly fun.** IMHO what makes React so great and so popular is the fact that it is not restrictive. It does so much yet has so few constraints, that using it feels just like magic.
3. Do you have another reason? Let's discuss it below in the comments!
​
Thanks for reading!
On code::dive 2019
Tags: cpp, techtalks
Published: 2019-11-22 00:40:10

Amazing crowd. I haven't seen so many geeks at one place for a very long time. I was actually surprised with the quality of questions. Many of them were very deep.

Amazing speakers. I must admit, that watching videos of cool conference talks and actually being there is not the same at all. I almost forgot how it really feels.

Amazing city. Wroclaw is very cozy. I know nothing about the feelings of the people who lives there, but from my touristic point of view it is very close to perfect. (And looking fir little dwarves, scattered everywhere is really fun.)

I'm very happy, that my return to conference life started there. Even though I've been merely an attendee this time. I would certainly recommend this conference to everyone who's interested in C++ and everything related.

If you have no idea what I'm writing about, go there: http://codedive.pl, read and find some videos.