teleren/devto huggingface dataset:
Which productive activities are typically seen as unproductive?
Tags: discuss, productivity
Published: 2019-08-28 11:44:21

---
title: Which productive activities are typically seen as unproductive?
published: true
description: 
tags: discuss,productivity
---

Inspired by the following post:

{% link https://dev.to/ben/which-unproductive-activities-are-typically-mistaken-for-productivity-2n8j %} 

I sometimes find myself in a situation where I'm being called out for doing something that's 'unproductive' when in reality it's helping me be more productive. Be it reading about some sort of coding related problem I am facing or sorting out my backlog so I can get my priorities straight.

So, what productive activities are typically seen as unproductive?
What is artificial intelligence? (1)
Tags: ai, artificial, software
Published: 2019-08-28 11:33:49


Shortly **artificial intelligence:**
 - can model human intelligence, 
 - can make meaning of events, 
 - can generalize, 
 - can learns from past experiences.

---
 - **(1.1)** What is intelligence?
	 - **(1.1.1)** Intelligence Tests.
	 - **(1.1.2)** Artificial Intelligence.
	 - **(1.1.3)** Comparison of artificial intelligence and natural intelligence.

 - **(1.2)** Scope and fundamentals of artificial intelligence.
	- **(1.2.1)** Expert systems
	- **(1.2.2)** Robotics
	- **(1.2.3)** Natural language processing
	- **(1.2.4)** Speaking and understanding
	- **(1.2.5)** Philosophy
	- **(1.2.6)** Psychology
	- **(1.2.7)** Maths
What is Microservice?
Tags: microservices, architecture, pattern
Published: 2019-09-16 17:42:01

---
title: What is Microservice?
published: true
tags: Microservices,architecture,pattern
canonical_url: https://educosta.dev/blog/what-is-microservice/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/rtdx6c66rbx7ar6zubji.jpg
---

Microservice is an architecture style where you create or deposed a system into components. Despite the name, does not mean that the service has to be small in size. The most important thing is that each service has the following characteristics:

### Single-responsibility

Each microservice should have only one responsibility, also known as bounded domain context.

### Lightweight

Microservices have to be lightweight. This allows for smaller memory consumption and fast startup times.

### Stateless 

Not all microservices are stateless. But this is an important characteristic. As there is no state to be backed up on shutdown or activated on startup, they scale better and start faster.

### Reactive

This is applicable for microservices with concurrent loads or longer response times. Using the Asynchronous communication model allows the optimal use of the resources. This results in better availability.

### Externalized configuration

Externalizes the configurations in a config server. So it can be maintained per environment.

### Resilient

Services should handle exceptions arising and not crash. Runtime errors, technical issues, lost of connectivity, wrong input values can and so on.

### Observability

Microservices should report their usage. Statistics, the number of times they are accessed, their average response time, and so on through the HTTP API.

### Versioned

Microservices may need to support versions for different clients until all clients migrate to higher versions.

### Independent deployment 

Each of the microservices should be deployable, without compromising the integrity of the application. It tested and deployed independently.

### Bounded

A service should access the resources from its bounded context. It should not access the resources of other modules through databases. If a service needs data from others context it should do so through an internal API or service layer.

![Question mark](https://educosta.dev/wp-content/uploads/question32x32.png) In your opinion, what other important characteristic a Microservice <g id="3" data-gr-id="3">must have</g> ?

The post [What is Microservice?](https://educosta.dev/blog/what-is-microservice/) appeared first on [Be Cloud Native](https://educosta.dev). If you have any doubts or questions feel free to drop a comment here or reach me out on Twitter [@educostadev](http://twitter.com/educostadev).
Get Complementary color
Tags: complementary, color, palette, design
Published: 2019-08-28 11:15:39

---
title: Get Complementary color
published: true
description: Get Complementary color from any color online
tags: complementary, color, palette, design
---
1. Visit [generate colors tool](https://colorswall.com/palette/generate)
2. Choose primary color for example #4585ed
![Choose primary color for Complementary color palette](https://colorswall.com/images/colorswall_screenshot_5.png)

2. Open "Customize palette" panel
![Customize palette](https://colorswall.com/images/colorswall_screenshot_7.png)

4. Press "Complementary" button in section "Color scheme".
![Customize palette](https://colorswall.com/images/colorswall_screenshot_6.png)

5. Complementary color is generated
![Complementary color palette](https://colorswall.com/images/complementary_blue_color.jpg)

6. Save palette

Check live palette [complementary blue color](https://colorswall.com/palette/5043)

Video version
{% youtube ynPaA_NUS7g %}
Why you should switch to kotlin as an android developer
Tags: kotlin, android, programming
Published: 2019-08-28 11:12:57

About two years ago, Google announced kotlin as the official language for android development and since then Google have been trying their best to make developers adapt to it.

Today i'll be giving you reasons why you should start to use kotlin for developing android apps, here are some of my reaons.

1. Kotlin is simpler and concise - defining classes and variables in kotlin can be pretty easy and small lines of code.

an example would be this

var variable:Int = 10
var string:String = "Hello World"

2. Kotlin allows nullability - yes to making your variables null in value.

3. Kotlin is very expressive - from methods, control statements and classes.

4. Kotlin is more demanded in android development - most companies specialised in the development of android apps now require kotlin devs when hiring.

There's more to kotlin but these are few points of mine tho. I do hope you find reasons to consider learning kotlin as an android developer.
Thank you.

Let me know in the comment section if you want posts on how to get started with kotlin, i'll be happy to post such topics and hope you'll learn. thank you and have a wonderful day
How to store large JSON in PostgreSQL with Rails Attributes API
Tags: postgres, ruby, rails
Published: 2019-08-28 10:58:43

If you store large objects in the database (such as JSON), for example, data for big reports, then this can take up a lot of space. To reduce the size of data, you can compress and store in binary form. 

PostgreSQL has a [bytea field type](https://www.postgresql.org/docs/9.0/datatype-binary.html) for storing such data. You can add bytea column in Rails using migration

```rb
add_column :reports, :data, :binary
```

For binary field operations, you can use the [Rails Attributes API](https://api.rubyonrails.org/classes/ActiveRecord/Attributes/ClassMethods.html) and add a new `BinaryHash` data type

```rb
# app/types/binary_hash.rb

class BinaryHash < ActiveRecord::Type::Binary
  def serialize(value)
    super value_to_binary(value.to_json)
  end

  def deserialize(value)
    super case value
          when NilClass
            {}
          when ActiveModel::Type::Binary::Data
            value_to_hash(value.to_s)
          else
            value_to_hash(PG::Connection.unescape_bytea(value))
          end
  end

  private

  def value_to_hash(value)
    JSON.parse(
      ActiveSupport::Gzip.decompress(value),
      symbolize_names: true
    ) || {}
  end

  def value_to_binary(value)
    ActiveSupport::Gzip.compress(value)
  end
end
```

Register new type in initializers

```rb
# config/initializers/types.rb

ActiveRecord::Type.register(:binary_hash, BinaryHash)
```

And add to binary type attribute in model

```rb
# app/models/snapshot.rb

class Reports < ApplicationRecord
  attribute :data, :binary_hash
end
```

Tests show that data size is reduced by almost 3 times

```rb
Run time with 100000 width JSON
                           user     system      total        real
Compress JSON          0.008671   0.001535   0.010206 (  0.010885)
Decompress JSON        0.001357   0.000095   0.001452 (  0.001509)

json size       95450 bytes
binary size   33868 bytes
~ 2.82 times compression
```
What is AngularJS Good For?
Tags: angular, webdev
Published: 2019-08-28 10:53:34

<h2>What is AngularJS?</h2>

AngularJS is an Open-source Front-end JavaScript-based framework which is maintained by Google and by a community of individuals and corporations. AngularJS widely used to create Single-Page Applications, a web application or we can say a website that interacts with the user by dynamically rewriting the current page rather than loading the entire website from a server. This is possible by using the Model–View–Controller. It makes use of Model–View–Controller and reduce the amount of JavaScript needed to reduce the loading time and make web applications functional. The power of angular comes from its two-way data binding technique which allows complete separation of the data model and view for user interaction.

<h2>What is AngularJS Good for?</h2>

The nature of the website or application you want to build is the only factor that will play an important role in deciding whether you will use angular or not. Like if the website or application is data-rich and requires instant feedback on interaction, it's maybe a good idea to use angular.

Developers find AngularJS very effective especially in creating dynamic, single-page apps, and supporting MVC (Model View Controller) programming structure.

When you are thinking of creating a user-friendly and interactive web application with cross-browser capability AngularJS is a best-suited framework to build such apps.

<h2>Notable Features of AngularJS:</h2>

<h3>Two-way Data-binding:</h3>

Data binding is one of the most notable AngularJS features which help developers to save time because it doesn't require a lot of coding for an application. This helps to reduce overall work for the developer.

<h3>Ready to Use Templates:</h3> 

The ready to use templates make it easy even for people with little computing skills come-up with great apps.

<h3>Dependency Injection:</h3>

This is an essential feature in AngularJS that helps the developer to develop the application easily and smoothly.

<h3>Testing:</h3>  

The development team of AngularJS has a special focus on testability while creating framework that leads you to easily test your AngularJS apps.

<h3>Enhanced User Experience:</h3>

The use of MVC and REST has made it easy for users to use the application with ease by providing a user-friendly environment.
What is your top productivity apps that you cannot live without?
Tags: productivity, discuss
Published: 2019-08-28 10:24:09

I'm an engineer who is very keen to find different things to try out on daily basis. 

I love big brands, like Google, [Asana](www.asana.com) (if you don't know, it is one of the most well-known project management software), [Slack](wwww.slack.com), etc. But I also love to try out new apps. 

So here's the list of the best productivity apps that help me overcome my overloading task list. 

**1. [Buffer](www.buffer.com)**

If you are very active on social media, you must download Buffer to help you manage all of the content for your social media accounts. You can share content and stay connected with all of the social media apps using one app only.

**2. [Quire](https://quire.io)**

I like Quire because they're a very young team and they're super open to constructive ideas. They're a project management software, quite new to the market, at least they're not as mature as Asana or Trello. But for a small team like mine, Quire has enough features to offer. 

I like their clean interface and the way their task list behaves just like how my mind works. Beside Quire, my team also uses [Notion](www.notion.so) for dashboard view. 

**3. [CamSanner](www.camscanner.com)**

I cannot highlight enough how I like this cool app. If you're an engineer, you know about the OCR technology. CamScanner lets you use your phone to scan documents, and turn the scanned documents into searchable PDF. COOL right? 

Our team uses this app EVERYDAY! 

_Bonus_

**4. [MindMeister](https://mindmeister.com)**

My team deals with a lot of brainstorming and ideas gathering. MindMeister is  such a powerful online mind mapping tool that allows team to visualize the ideas and share with each other in real-time. 

They're NOT new. But we love them so we just want to include them into this list :) 

How about you? Tell me more about which software you think is the best [productivity apps](https://quire.io/compare/best-productivity-apps)?
How to use MIDI for web in short
Tags: midi, music, javascript, react
Published: 2019-08-28 10:12:16


MIDI player

- Use [MIDI parser](https://github.com/nfroidure/midifile) to read notes from MIDI file
- Use [WebAudioFont](https://www.npmjs.com/package/webaudiofont) to play musical instruments in a browser
- See [result](https://surikov.github.io/webaudiofont/examples/midiplayer.html)

MIDI keyboard

- Use [React](https://reactjs.org/) to draw piano keyboard
- Use [Chrome](https://www.google.com/chrome/) to read MIDI events from hardware keyboard
- Use [midi-sounds-react](https://www.npmjs.com/package/midi-sounds-react) to play sound
- See [result](https://surikov.github.io/midi-sounds-react-examples/examples/midi-sounds-example10/build/)

MIDI editor

- Use [three.js](https://threejs.org/) to create catchy UI
- Use [WebAudioFont](https://www.npmjs.com/package/webaudiofont) to play music
- See [result](https://surikov.github.io/riffshare/parse.html?riff=78-0000575a-a2724328-0e0d06080c0e1011020e-001101110211031104110511061107114010411042104310441045104610479080338133823383338433853386338733a044a144a244a344a444a544a644a744-004051840005020040006071b40006110040006100c40006091840006111340007020c40025020040027020c40035020040037020c40045020040047020c40055020040057020c40065020040066031a40067020c40075020040077020c40085020040086031840087020c40095020040097020c400a6031a400b50200400b7020c400c50200400c6031b400c7020c400d50200400d7020c400e40313400e50200400e6031f400e7020c400f50200400f7020c40104051640105020740106110740106111340106072240106011a40107020740125020740127020740135020740137020740145020740147020740155020740157020740165020740166032140167020740175020740177020740185020740186031f401870207401950207401970207401a50207401a60321401a70207401b50207401b70207401c50207401c60322401c70207401d50207401d70207401e4031a401e50207401e60326401e70207401f50207401f7020740204111d40205020a40206201640206200a40206202940206011d40207020a40225020a40227020a40235020a40237020a40245020a40247020a40255020a40257020a40265020a40267020a40275020a40277020a40285020a40287020a40295020a40297020a402a5020a402a7020a402b5020a402b7020a402c5020a402c7020a402d5020a402d7020a402e5020a402e7020a402f5020a402f7020a40305020a40307020a40325020a40327020a40335020a40337020a40345020a40347020a40355020a40357020a40365020a40367020a40375020a40377020a40385020a40387020a40395020a40397020a403a5020a403a7020a403b5020a403b7020a403c5020a403c7020a403d5020a403d7020a403e5020a403e7020a403f5010a403f7010a40)
The Impactful Role Of Blockchain On WordPress Plugin Development

Tags: wordpress, webdev, blockchain
Published: 2019-08-28 09:33:38

Nearly one-third of the websites all over the globe is powered by WordPress CMS. The popularity behind WordPress CMS results from the tremendous scope of customisation, flexibility, and scope of adding features with the help of thousands of plugins. But these plugins are also viewed as potential avenues for security vulnerabilities and threats.

Since you cannot do away with the plugins for WordPress web development, it is upon the developers to use high-security protocols and technologies while building WordPress plugins. Blockchain has emerged as the most secure and advanced technology for WordPress Plugin developers with a lot of value propositions.

**Security Issues With WordPress Plugins**

Since we are going to explain the role of Blockchain in securing WordPress plugins, any [WordPress development company](https://www.cmarix.com/wordpress-web-development-services.html) should have a look at all the security issues of WordPress plugins. Let’s have a look at a few and most prominent issues corresponding to WordPress plugins.

**Authenticated File Delete:**
This is a common security issue that allows the authors to delete files or change the data whenever he can have access.

[Readmore...](https://www.cmarix.com/the-impactful-role-of-blockchain-on-wordpress-plugin-development/)
Don't ignore caught exceptions
Tags: javascript, exceptions, debugging
Published: 2019-08-28 09:32:44

---
title: Don't ignore caught exceptions
published: true
description: I had a really bad day because of a function, that ignored all caught exceptions.
tags: js,exceptions,debugging
---

I had a really bad day because of a function, that ignored all caught exceptions. Code looks something like this and it was part of a third party library, that I was using. I didn't know about implementation details at the time.

```js
function doSomething() {
    try {
        // some code
    } catch (err) {}
}
```

Debugging function like this, that never crashes and never prints any error messages, is a nightmare. I usually trust third party libraries and at first assume that problem has to be with my code. That’s why I spent hours debugging this.

So, what to do with exceptions? I think it's valid to let other programmers (those that use this library) to handle the exception. Especially, if you have no idea what to do with it.

What do you think? Is there a situation where this is acceptable? Maybe production environment? I personally don't think so, because you want to know about errors in production and store them somewhere.
(Video) Introduction to Tmux - a really quick one
Tags: shell, linux, terminal, tmux
Published: 2019-08-28 07:48:00

I'll let the video do the explaining, but this is a really quick overview of what Tmux is, how to use it and a demonstration of some of it's more powerful features!

If you use a Terminal at all, you will love Tmux...

{% youtube MGN5JcpC7e0 %}

For any questions about Tmux or even ideas for future videos please reach out on twitter [@Ben_Kadel - Twitter](https://twitter.com/ben_kadel)
What should be in a front end developer's portfolio site to impress the client or recruiter? 
Tags: career, help, discuss, beginners
Published: 2019-08-28 06:55:47

---
title: What should be in a front end developer's portfolio site to impress the client or recruiter? 
published: true
description: question about front end developer's portfolio
tags: career, help, discuss, beginners
cover_image: https://i.ibb.co/G9nDfWQ/neonbrand-d-Dvr-IJb-SCkg-unsplash.jpg
---
###So, what things must be in a front end developer's portfolio website?###
 * Amazing animations? 
 * My unfinished projects? 
 * Projects of the company I worked for?
 * The small responsive site I made years ago? 
 * **Can you share yours..., please?**


###Background###
Every time I search for Front end Developer's portfolio on google, the results blow my mind and head. The websites are so good. The designs, motions, and animations are so good that I don't know when can I achieve that! And, I got it disappointing every time. 

I tried to make a portfolio site which will be amazing and buy me - Clients or a Remote Job! But, it ended me in a loop. I am not getting enough time to do this amazing site with my full-time job. 

But, I badly in need of a portfolio site for switching to freelance/remote career. 

**Cover image courtesy**: Photo by NeONBRAND on Unsplash
Should I Jump Ship to iOS? 
Tags: healthydebate
Published: 2019-08-28 06:46:34

---
title: Should I Jump Ship to iOS? 
published: true
description: 
tags: healthydebate
cover_image: https://images.unsplash.com/photo-1532356884227-66d7c0e9e4c2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80
---

Before we begin, I want to point out that the [code of conduct](https://dev.to/code-of-conduct) applies to this post and all others on DEV. I don't expect that anyone will be particularly horrible, but I do know that many folks can get quite proud of their [#gear](https://dev.to/t/gear) choices.

On to the topic at hand: Should I jump ship to iOS?

I've been an Android user since Gingerbread was released, so I'm quite deeply entrenched into the ecosystem. But I feel like the lack of immidiate update support for Android, and the lack of care for privacy is really turning me off from the OS.

I'm currently using an Honor device (you care about privacy and bought a Huawei device?) and the hardware is amazing, but the base OS is terrible. 

I know that I could totally buy a device which actually allows me to unlock the bootloader (Huawei have locked all of their devices down), and flash something like LineageOS onto it. In fact, until I bought my current device, this is exactly what I used to to - stock Android (as in the AOSP) is good, LineageOS with root is better, and most vendor specific builds of Android are terrible.

Security updates for Android, as some folks know, can take months (if not years) to be released for devices. And a lot of users are often left running insecure, outdated versions of the OS simply because the hardware vendors want to sell you the latest and greatest rather than support a device which is less then 9 months old - and the less said about companies like WileyFox the better.

I'm also totally aware thst iOS devices tend to become a lot less useful after 2-3 years of use, and that they're not as open as Android devices can be. I do have PC hardware which runs MacOS, Linux distros and Windows, so I'm not averse to running different OSs.

I'm really interested to hear the experiences of folks who have jumped ship (either way), and folks who have tried out both.

So fellow DEV readers, help me out. Should I jump ship? Or what are some of the things that I should be considering with reference to jumping over?
NodeJS: How To Colorize Text
Tags: javascript, node, eli5
Published: 2019-08-28 06:45:46

---
title: NodeJS: How To Colorize Text
published: true
description: NodeJS: How To Colorize Text
tags: javascript, node, eli5
series: Intro to NodeJS
---

## Intro

So we [installed NodeJS](https://dev.to/miku86/what-is-nodejs-how-to-install-it-1900) on our machine.

We also know [How to Get External Packages](https://dev.to/miku86/nodejs-how-to-get-external-packages-npm-56oj).

Now we want to learn how to colorize text using [chalk](https://www.npmjs.com/package/chalk).

## Write a simple script

- Open your terminal
- Create a file named `index.js`:

```sh
touch index.js
```

- Add this JavaScript code into it:

```js
// import chalk
const chalk = require('chalk');

// Example 1: inline styling, blue background and underline
console.log(chalk.bgBlue.underline('Example 1'));

// Example 2: create reusable style  
const success = chalk.bgGreen.black.underline;
console.log(success('Example 2'));

// Example 3: you can do a lot of stuff, e.g. using hex values and template literals
const customize = chalk.hex('#B4DA55').bold;
console.log(`This is ${customize('Example 3')}.`);
```

Note: Chalk has a lot of available styles, read [the docs of chalk](https://www.npmjs.com/package/chalk#styles).

---

## Run it from the terminal

- Run it: 

```sh
node index.js
```

- Result: 

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

---

## Further Reading

- [chalk on npm](https://www.npmjs.com/package/chalk)
- [chalk usage on npm](https://www.npmjs.com/package/chalk#usage)


---

## Questions

- What is your favorite way/package to colorize text in Node? Why do you use it?