teleren/devto huggingface dataset:
Start with AWS CLI and DynamoDB.  
Tags: aws, database, serverless, dynamodb
Published: 2021-04-16 12:53:30


This guide will teach you the steps that you've to follow in order to  start working with DynamoDB.

The main issues that all new users face when working with AWS are:
- Is hard to have a quick and global estimate of your costs.
They've in most of it services a free tier, so don't be afraid to try it.
- Is hard to configure initially, because you don't have a step by step screen that'll guide you.

***
## CONFIGURE YOUR ACCOUNT

1 - Create an account on AWS: https://aws.amazon.com/account/sign-up
2 - Create a user in IAM:
https://console.aws.amazon.com/iam/
       a) Define the username that this user will have (ex. "publishers", "authors"), and then you have to choose the access method ( public and private key is recommended). 
       b) Define the policies or permissions that this user will have. This is important because you've to define all of it for the service that'll use.
       c) Add tags if you want
       d) Copy in a temporarily place the public key and the private key.
 
***
## INSTALL THE AWS CLI ON YOUR SERVER

1 - Follow the AWS guide to install the CLI, according your server: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html)
2 - When you're in the step of "configure", you'll have to add the private and public keys that you've written temporarily in "Configure your account. Step #2d".
Let's suppose you need to add a new service, or a new user. 
Go Back to the step "Configure your account. Step #2" and create it.
Then find in your server the "credentials" file that AWS CLI creates (Ex. ~/.aws/credentials) and add a new "Block" of credentials for this new user, which AWS CLI Calls "profiles" to retrieve the information. I'll recommend you to use the same username that you've choose in "Configure your account. Step #2a" to avoid mistakes.

Ex:
```
~/.aws/credentials

[default] 
aws_access_key_id= 
aws_secret_access_key= 

[authors] 
aws_access_key_id= 
aws_secret_access_key=  

[publishers] 
aws_access_key_id= 
aws_secret_access_key=  
```


***
## WORK WITH DYNAMODB 

1- Go to https://aws.amazon.com/es/dynamodb/ and enable your account 
2 - Create your first table.
You'll have to define:
      a) Table name
      b) Table primary unique key  name 
      c) Table secondary key name, called "order key" which can have duplicate values 
3- Depending on your language, you've here: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.html
examples of the basic actions that you can do: `put`, `delete`, `describe`, `query`
You've to have in mind that this information is required to connect with dynamo:
    a) The profile name that you'll use to manage the permissions, defined in "Install the AWS cli on your server, Step #2"
    b) The region of your DynamoDB. You can find this information in the URL of your AWS DynamoDB account:
Ex:
```
https://{REGION}.console.aws.amazon.com/dynamodb/home?region={REGION}
```

About the actions:
- You can retrieve one record or all.
- PutItem works as well for adding new items an updating them, based on your primary key.

That 's all folks!
Last mile deliveries: Getting it right
Tags: apps, ondemand, deliveries, mapping
Published: 2021-04-16 12:53:02

People get accustomed to the conveniences of buying things from home: Three out of four Americans want their online orders to be brought right to their doorsteps. This places additional pressure on logistics and especially on its final stage — last-mile delivery. Here are some of the important considerations to get it right:

A **route optimization algorithm** identifies the fastest and most cost-effective, multi-stop routes for drivers, considering numerous factors — such as traffic, travel distances, and time windows offered to customers. Advanced solutions may accommodate predefined routes to real-time changes.

An **auto-dispatch engine** matches a delivery task with a specific driver based on pre-defined priorities and business rules. This significantly saves labor cost and service time.

**Real-time driver (fleet) tracking** leverages GPS technology and drivers’ smartphones to ensure fleet visibility. They let dispatchers and customers know where vehicles are without the need for any additional hardware.

An [estimated time of arrival (ETA) calculation](https://nextbillion.ai/blogs/Effective-ETAs-102%E2%80%94Measuring-Impact-of-Inaccurate-ETAs) predicts when a driver or courier will place the parcel on a customer’s doorstep. Predictive analytics and machine learning technologies increase the accuracy of such estimations, taking into account different factors — like GPS coordinates, distance to the next stop, the average length of breaks, and historical data.

Status updates are sent to customers on a regular basis to keep them informed about their orders. Some solutions may come with live chats or the ability to make a direct call to a dispatcher or driver.

An electronic proof of delivery (ePOD) allows customers to sign their names electronically right on drivers’ tablets or smartphones. E-signatures are uploaded into the system’s backend to confirm deliveries.

A data dashboard displays all key performance indicators (KPIs) and metrics to monitor operations and optimize services.
With all basic modules in place, there is still no universal solution fitting any existing last mile scenario. Functionality for prepared meal deliveries will somewhat differ from alcohol deliveries coming with confirmation requirements, or white glove shipping that deals with expensive, fragile, and climate-sensitive purchases.

Did I miss anything? Feel free to add it in the comments!
Kotlin Delegated Property – Observable Property
Tags: kotlin
Published: 2021-04-16 12:52:17

https://grokonez.com/kotlin/kotlin-delegated-property-observable-property

Kotlin Delegated Property – Observable Property

In this Kotlin tutorial, we're gonna look at how to make an observable property by using Kotlin delegated property.

<!--more-->
<h2>I. Technology</h2>
- Java 1.8
- Kotlin 1.1.2
<h2>II. Overview</h2>
We will create an example that can notify listener when a property of an object changes.

Java has a mechanism for this notification: <code>PropertyChangeSupport</code> class manages a list of listeners and dispatches <code>PropertyChangeEvent</code> events to them.

To use it, we will create a helper class that will store a <code>PropertyChangeSupport</code> instance and keep track of <code>PropertyChangeListener</code>.
<pre><code class="language-java">
open class PropertyChangeAware {

	protected val propertyChangeSupport = PropertyChangeSupport(this)
	fun add/remove PropertyChangeListener(listener)
}</code></pre>
Then the class that has property to be notified will extend this helper class:

https://grokonez.com/kotlin/kotlin-delegated-property-observable-property

Kotlin Delegated Property – Observable Property
Best cra-template to start a react project
Tags: react, showdev, webdev, javascript
Published: 2021-04-16 12:48:14

Hi All,

I'm glad to share this information with you all that I have created a template for create-react-app CLI. 

Which anyone can use and start a project with a pre-configured react starter package that has 126 stars on Github and liked by many developers. 

`npx create-react-app <app-name> --template cwg-react`

You just have to run this command replacing <app-name> with your app name and it will create a new react project with the latest version of react and the cwg-react-starter package template.

The idea behind converting this package to a cra template is that many people are liking this template and to start a new project either they have to clone the repository or download the zip from GitHub which has an older version of react. Instead of cloning or downloading zip now, it will be more efficient to use it as a template and that too without worrying about react updates.

[Detailed Blog about the structure](https://codewithghazi.com/best-scalable-react-app-structure-2021/)

{% github https://github.com/gkhan205/cwg-react-starter %}
Kotlin – Java Static Method equivalent in Kotlin
Tags: kotlin, javastatic
Published: 2021-04-16 12:42:41

https://grokonez.com/kotlin/kotlin-java-static-method-equivalent-kotlin

Kotlin – Java Static Method equivalent in Kotlin

This tutorial shows you a way to represent Java static method in Kotlin using Object Expression.

<!--more-->
<h2>I. Technology</h2>
- Java 1.8
- Kotlin 1.1.2
<h2>II. Practice</h2>
<h3>1. Java static Classes and Methods</h3>
<pre><code class="language-java">
public class Foo {

	public static String exe() {
		return "grokonez.com";
	}

	public static String upperCase(String s) {
		return s.toUpperCase();
	}

	public static class Bar {

		public static String bar() {
			return "Bar";
		}
	}

	public static class Num {

		public static Integer doubleInt(Integer i) {
			return new Integer(i.intValue() * 2);
		}
	}
}</code></pre>
<h3>2. Equivalent in Kotlin</h3>
Using Kotlin Object Expression, we can make "static" Equivalent:

More at:

https://grokonez.com/kotlin/kotlin-java-static-method-equivalent-kotlin
Kotlin Lazy Initialization Example
Tags: kotlin, initialization
Published: 2021-04-16 12:37:42

https://grokonez.com/kotlin/kotlin-lazy-initialization-example

Kotlin Lazy Initialization Example

Lazy Initialization is a common pattern for delaying creation of an object, calculation of a value, or an expensive process until it’s accessed for the first time. It is helpful when the initialization process consumes significant resources and the data isn’t always required when the object is used. Kotlin provides a good solution for that with <code>lazy</code> function. In this tutorial, we're gonna look at a Kotlin Lazy Initialization example.

<!--more-->
<h2>I. Technology</h2>
- Java 1.8
- Kotlin 1.1.2
<h2>II. Overview</h2>
Assume that we have a <code>Person(name,books)</code> class that lets us access a list of the books own by a person. Books list is stored in a database that we need time to access.

We want to load books on first access to the <code>books</code> property and do it only once.
It can be done with a delegated property:
<pre><code class="language-java">
data class Person(val name: String) {

	val books by lazy { loadBooks(this) }
}
</code></pre>
- <code>lazy</code> function (thread-safe by default) returns an object that has <code>getValue</code>method called.
- parameter of <code>lazy</code> is a lambda to initialize the value.
<h2>III. Practice</h2>
<h3>1. Helper Class</h3>
<code>BookManager</code> class handles processing data:


More at:

https://grokonez.com/kotlin/kotlin-lazy-initialization-example
BigCommerce SEO Tips that Work
Published: 2021-04-16 12:24:16

The SEO tool is the most powerful feature of BigCommerce. So my team and I prepared SEO tips for your BigCommerce store:

1.Prioritize keyword research

BigCommerce has a built-in SEO module that sets it apart from other platforms. Since SEO helps promote an online store to its target audience, this module plays a huge role in sales. Here's a complete list of SEO tools: Spyfu, WordStream, SEMRush, Ubersuggest, Ahrefs, and Moz Keyword Explorer.

2.Optimize your site for mobile

Our world is going digital, so your online store must be very well optimized for mobile browsing. Optimizing your online store for mobile is critical to a business because many people shop online from mobile devices.

To optimize your online store for mobile devices, you need to add this clause to the specifications that you write about your project. You need to think about how your store and your content will be visible on mobile devices. In addition, mobile-optimized online stores must have very clear navigation and optimize all resources to ensure fast rendering and easy browsing.

3.Optimize site speed

People are not ready to wait more than two seconds for the online store page to open. Therefore, online retailers need to speed up their online stores as much as they can, to get sales.

Thanks to the high-speed page loading, you will have a higher impression rate, which will increase your page rank on Google. Consequently, more buyers will see your product and more likely will buy it.

These tips will help you get traffic if you decide to use them for your store. Find more tips and more detailed information in our new article https://soft-loft.com/bigcommerce-seo-tips/
How to Speed Up a Shopify Site
Published: 2021-04-16 12:22:07

People are not ready to wait more than two seconds for the online store page to open. Therefore, online retailers need to speed up their online stores as much as they can, to get sales.

There are a lot of services that might test the speed and performance of the website and its pages for free or almost for free. For example, the most frequently used tool to assess the performance of the website is Google PageSpeed Insights.

For example, when the online store brings a profit of $100,000 daily, the increase of conversion by only 5% is going to increase the revenue by $5,000 daily. The conclusion is the investment of time and effort to make the pages load fast is going to bring additional revenue to the store. So customers are not going to become patient with slow websites, therefore the website, especially the online store, should be as fast as possible.

1. Choose a lightweight theme

Shopify offers a wide range of themes. Altogether, the components of the theme impact the loading speed. Therefore, by controlling the components of the theme, it is possible to impact the loading speed.

To make the theme work faster, consider the next steps:

- Disable the features that you do not use

- Use a system font (using system fonts is a good idea to reduce the loading time for the page).

- If nothing works well, try to consult the support of Shopify for guidance, if you use a free theme. If you use a third-party theme, there is a need to contact a theme developer or hire a Shopify expert or a dedicated team of Shopify developers.

2. Reduce large image size

When the images are too large in size, they will reduce the loading speed of the page. You can try these image optimization services: Optimizilla or Crush.


3. Complex liquid code

The most inefficient way to write the Liquid Code is complex operations repeats and thus increase the rendering time of the web page. This impacts the overall speed of the webpage and the speed of the store in general. If you are an expert in coding, you might use Shopify Theme Inspector for Chrome, thus getting a chance to improve the code. If you do not possess enough knowledge of coding, it is better to find a person who does.

4. Limit third-party JavaScript & Shopify apps

If you doubt in at least one of the apps that you use, better stop using it as soon as refusing from one of the apps. It will boost the loading speed of the webpage.

As soon as the loading speed of the online store is improving, the store is going to get more visitors and get more successful purchases. You can do it by yourself or you can hire a professional, more specifically, a Shopify professional.

Find out more tips in our article: https://bit.ly/39J8WEK
If you have any questions, please comment below.
How to Hire Shopify Developer
Tags: hiring
Published: 2021-04-16 12:18:35

In our newest article, we are reviewing how to hire Shopify developer quickly and easily. We will share our tips on finding a great Shopify expert. Today, more than a million merchants use Shopify to run their businesses online. What’s more, merchants running on Shopify are of all sizes, from tiny retailers to giant wholesale corporations. The main reason why they all chose Shopify is Shopify having many solutions that work right after installation.

So if you are looking to hire a Shopify developer check this article to get our tips https://soft-loft.com/how-to-hire-shopify-developer/
How Much Does It Cost to Hire a Shopify Expert?
Tags: webdev, startup, hiring
Published: 2021-04-16 12:16:59

It's very important to know the cost of building an eCommerce website because it helps you calculate the investment you will need to start your new online business.

The factors that determine the rate of Shopify experts:

1. The qualification of a developer. 
The higher the qualification, the quicker is going to be setup time. However, highly qualified professionals are used to have a higher rate. While the hourly rate of professionals is bigger, the speed of figuring out the problems during the project is much higher too. 

2. The difference between costs for the Shopify developers according to location. 
On average, American, Canadian, and West European Shopify developers charge $100-150/per hour while outsource locations might charge as low as $30-60 hourly 

For more information about the costs to hire a Shopify #developer, check out our article: https://bit.ly/3fl3Nq0
E-COMMERCE WEBSITE DEVELOPMENT PROCESS
Published: 2021-04-16 12:13:05

Have you ever had a desire to create an #ecommerce website? 
This requires a variety of skills and knowledge. 
First of all, you should know, there are 3 different types of online stores: B2B, B2C, and C2C. These are also the types of businesses that are held by the business owners. There is no doubt, different business types require different online store types and approaches. 
We've broken creating eCommerce website process down into steps that will simplify your E-commerce development process and help you achieve your business goals.
Learn the process how to develop an e-commerce website in my new article: https://bit.ly/31iT7Qq
BigCommerce Website Examples
Tags: bigcommerce, ecommerce, website, webdev
Published: 2021-04-16 12:09:53

If you are not online - you do not exist. The website should have a customized user-friendly design, easy-to-use interface, quick and easy checkout, simple registration, demonstrate enough perks to engage customers in the long-term relationship. 
I suggest using BigCommerce to build an online store. Here are some successful BigCommerce examples.
https://bit.ly/3c6Ciyu
JavaScript Interview Question #33: Add two empty arrays and check the type
Tags: javascript, beginners, webdev, codenewbie
Published: 2021-04-16 12:09:00

![js-test-33](https://learn.coderslang.com/js-test-33.png)

Array? Object? Undefined? What’s the output?

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

In JavaScript, the `+` operator doesn’t do the concatenation of arrays.

Instead, it transforms them into strings and then does the string concatenation.

Two empty arrays become two empty strings, and their sum unsurprisingly is still an empty string.

What matters to us is the `typeof` that will return `string` in our case.

---

**ANSWER**: the output will be `string`.

[Learn Full-Stack JavaScript](https://js.coderslang.com/sign-in)
THE MOST COMMON MAGENTO ISSUES WITH SIMPLE BUT EFFECTIVE SOLUTIONS
Published: 2021-04-16 12:08:24

Magento 2 is one of the most popular eCommerce platforms. And often users face some issues.
But if you know where to look for answers, it will be easier to solve common problems. 
Here is the shortlist of common problems with Magento 2:
Set up a website on a new domain
Configure Magento 2 with a new domain
Solve the oho extension issue
Speed Magento up

If you have one of this issue or faced with another one, read our new article and get effective solutions 👉🏻 https://bit.ly/3rLr7R4
Daily Developer Jokes - Friday, Apr 16, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-04-16 12:00:08

---
title: "Daily Developer Jokes - Friday, Apr 16, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Apr%2016%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259ae4191d.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q___: Why did the developer cancel their dinner plans?

___A___: They were unable to fulfil peer dependencies
 -->
Handling 404 errors in SPA
Tags: web, spa, preact
Published: 2021-04-16 11:57:58

When writing SPA applications, we face the problem of 404 error when refreshing a page, aside of course for the root page 'index.html', which really exists.

Let's see how we can solve this problem.

Here a piece of code which handles routes in a SPA (here I use Preact)

```js
function Routage() {
  return (
    <Router onChange={handleRoute}>
      <Home path="/" />
      <ScanPage path="/scanpage" />
      <Query path="/queryall" />
      <About path="/about" />
    </Router>
  );
}
export default Routage;
```
The path '/' redirect automatically to an actual html page which is 'index.html'.

The other paths have no corresponding 'html' pages. That's why we get a 404 error when we access them directly.

So what can we do ?
Well, if those pages does not exist, let us create each of them !

Here we will then create the folowing pages:

  - scanpage.html
  - queryall.html
  - about.html

In each page we will insert the following html code :
for example in the about.html)

```js
 <!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="refresh" content="0;URL='/?page=about'"> 
  </head>
</html>
```
Do the same for the other pages.

In the index.html page put the following code :

```html
  <script>
   const queryString = window.location.search;
   const urlParams = new URLSearchParams(queryString);
   window.page = urlParams.get('page');
  </script>
```

And in you Router page put the following :

```js
const handleRoute =  async e => {
  if(window.page) {
    route(`/${window.page}`);
    window.page = null;
  }
};

function Routage() {
  return (
    <Router  onChange={handleRoute}>
      <Home path="/" />
      <ScanPage path="/scanpage" />
      <Query path="/queryall" />
      <About path="/about" />
    </Router>
  );
}

```
That's it .

Now every time, you refresh a page, or access it directly, you will be redirected to the correct 'page' without any 404 error :-).

Of course, you will have to adapt according the framework (or no) you use, but the idea is still valid.

If you have any advices, I will appreciate..
Chameleon – Customizable honeypots for monitoring network traffic
Tags: monitoring, docker, http, security
Published: 2021-04-16 11:57:21

Customizable honeypots for monitoring network traffic, bots activities and username\password credentials (DNS, HTTP Proxy, HTTP, HTTPS, SSH, POP3, IMAP, STMP, RDP, VNC, SMB, SOCKS5, Redis, TELNET and Postgres and MySQL)

[Chameleon](https://kali-linuxtr.net/chameleon-customizable-honeypots-for-monitoring-network-traffic)
Deploy Microservices to Kubernetes
Tags: microservices, kubernetes, devops, docker
Published: 2021-04-16 11:33:51

Delivering containerized applications to Kubernetes
Kubernetes allows businesses to deploy and manage cloud-native apps by making them portable across different environments. This makes it a great solution for development, testing and production use. It enables users to ramp up app instances quickly when demand spikes up using a system that’s highly efficient and more lightweight than virtual machines.