teleren/devto huggingface dataset:
ElasticSearch error message 'The [dims] property must be specified for field'
Tags: elasticsearch, es
Published: 2020-07-21 13:56:14

---
title: ElasticSearch error message 'The [dims] property must be specified for field'
published: true
description: 
tags: elasticsearch, ES
//cover_image: https://direct_url_to_image.jpg
---

When I try to insert dense_vector values to ElasticSearch(ES), I got below error. I will explain how I resolved this error.

<img src="https://dev-to-uploads.s3.amazonaws.com/i/v8swq09i6235iewfzjdi.png" alt="ES mappings" width="200"/>

Used PUT method to create a index in ES with mappings as body

`PUT http://localhost:9200/my_index`

Created successfully and got below response.
`{
    "acknowledged": true,
    "shards_acknowledged": true,
    "index": "my_index"
}`

But when I try to insert values, got below error for the POST request.
`POST http://localhost:9200/my_index/_creat`

#### Request Body:
<span>{
"name": "chanduthdev",
"vector" : [ 8.56176019e-02, 6.78501204e-02]
}</span>

#### Response :
<span>{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "The [dims] property must be specified for field [vector]."
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "The [dims] property must be specified for field [vector]."
  },
  "status": 400
}</span>

### Solution:
To resolve this error, replace **_creat** with **_doc** in the url for the POST method.
`POST http://localhost:9200/my_index/_doc`

#### Response:
<span>{
    "_index": "my_index1",
    "_type": "_doc",
    "_id": "3VbDcHMBBskIYHrmDycX",
    "_version": 1,
    "result": "created",
    "_shards": {
        "total": 2,
        "successful": 1,
        "failed": 0
    },
    "_seq_no": 0,
    "_primary_term": 1
}</span>


Happy Learning!!!
Coding Bootcamp or Computer Science Degree?
Tags: career, computerscience, bootcamp, csdegree
Published: 2020-07-21 13:45:41

{% youtube VCfEbgntzP0 %}


If  you can afford either, think about your career goals. CS degrees take you farther up the corporate ladder and they are requirements for some companies. So for career advancement- making VP Engineering likely requires a CS degree. Another thing to think about. CS degrees require years of study, which leads to a deeper understanding and a lot more hours writing code. However, college is not cheap, nor does everyone have the ability to attend one. 

Coding bootcamps, while much cheaper and faster, will help you learn how to code. However, the knowledge gained from a bootcamp will be far less than the knowledge of a computer science graduate. Bootcamps tend to focus on real world applications and modern technology. In order words, bootcamps are designed to help get you a job- computer science degrees are designed to help you learn computer science.

## Coding Bootcamp Pros
* Faster

* Cheaper

* Make real life applications

* Learn interview algorithm

* Learn interviewing techniques and get job search support

* Learn the tech that’s getting used right now

* Better return on investment- make more per hour with how much effort you put in

## Coding Bootcamp Cons
* Not a real degree

* Ridiculous pace

* Stigma attached to bootcamp graduate

* Usually get paid less

* Likely an amateur after graduating

## CS Degree Pros
* Deep knowledge of computer science 

* Years of practice. Literally years of training to code in preparation for a job.

* CS degree is highly valuable in careers and market

* Get paid more

* Networking

## CS Degree Cons
* Expensive

* Difficult

* Learning outdated tech

* Don’t build many ‘real world apps’

* Takes a long time

## Employer Views
All employers want employees to have technical knowledge and soft skills. Many employers will look for a candidate with a degree as well, although it doesn’t have to be a computer science degree. Data heavy positions such as analyst and data scientist may also look for math backgrounds. Bottom line, employers, recruiters, and HR departments like degrees. 

Bootcamp graduates will have experience with practical and modern knowledge. Most importantly, bootcamps are designed to help build practical, personal projects. Some companies will value the ‘self-taught experience’ and drive that comes from coding bootcamps. These companies recognize the valuable soft skills many bootcamp grads have, while knowing that the bootcamp grads have enough technical knowledge to at least be an amateur coder.
Types Of Charts & Graphs for Tableau To Make Your Data Visually more Interactive
Tags: tableau, datavisualization
Published: 2020-07-21 13:37:39

Graphs and charts are the most expressive ways when it comes to showing enormous amounts of raw data in a simple manner. Tableau is known to be one of the most popular and trending data visualizations software among developers. It creates fast visualizations of data in the form of worksheets and dashboards. Having a [Tableau Certification](https://intellipaat.com/tableau-training/) helps you to know more about Data Visualization.

* Bubble Chart
In the bubble chart, the data is displayed with the help of circles. This type of chart helps in depicting the relationship between three or more measures. Bubble charts can visualize large volumes of data at once by varying the colour and size of the circles. 

* Box Plots
Box and Whisker Plots or simply Box Plots are used to display the distribution of data for values such as median, outliers, first quartile, third quartile, among others. Box Plot is mainly useful for comparing the variations in the data. 

* Gantt Charts
Gantt Charts was invented in 1910 by Henry Gantt, and it displays a series of horizontal lines that track completed work overtime. This type of chart is useful in displaying the average delivery time for a range of products.

* Heat Maps
Heat Maps or Density maps can be used to identify locations without greater or fewer numbers of data points as well as reveal the patterns or relative concentrations that might otherwise be hidden due to an overlapping mark on a map. In Tableau, a heatmap can be created by grouping overlaying marks and colour-coding them based on the number of marks in the group.

* Pareto Charts
A Pareto chart is a kind of chart in Tableau that contains bars as well as line graphs. In this chart, individual values are represented in descending order by bars, while the ascending cumulative total is represented by the line. 

* Scatter Plots
In Tableau, a scatter plot can be constituted by putting at least one measure on the Columns shelf as well as one measure on the Rows shelf. Scatter Plots can be used to visualize relationships between numerical variables.

* TreeMaps
Treemaps are simple data visualization graphs that have the ability to provide insight in a visually attractive format. This type of graph can be used to display data in nested rectangles.
HTML has three list types: OL, UL, and...?
Tags: webdev, html, tutorial, beginners
Published: 2020-07-21 13:34:57

#DL
The 'D' stands for `description`.
I prefer to refer to it as `definition`.

##How to use it
```
<dl>
  <dt>Term you seek to describe or define</dt>
  <dd>First of one or more descriptions or definitions</dd>
  <dd>Optional second of many descriptions for the same term</dd>
  <dd>So on and so forth...</dd>
</dl>
```

##Common structure
```
<dl>
  <dt>Term</dt>
  <dd>Description</dd>
  <dt>Term</dt>
  <dd>Description</dd>
</dl>
```

#What I hear you saying
> I'd like to layout each term-description pairing as a group. How might I do that?

##Secret trick: enclose each pair in a `<div>`
```
<dl>
  <div>
    <dt>Term</dt>
    <dd>Description</dd>
  </div>
  <div>
    <dt>Term</dt>
    <dd>Description</dd>
  </div>
</dl>
```

#Your challenge
##Find
- Look through some of your code
- Find examples that fit this structure: term with descriptions
- Re-factor your code...

##And replace

- Using `<div>`s or `<span>`s? Upgrade to a `<dl>`.
- Using a heading or paragraph with `<ul>`s or `<ol>`s? Upgrade to a `<dl>`.

#Learn something today? Keep up the habit with a fun game I made:
[Fix a function! - 5 daily exercises to help you practice HTML, CSS and JavaScript](http://freecodegame.com)
Collections Laravel
Tags: laravel, php
Published: 2020-07-21 13:31:39

Two years ago, i've started to work with Laravel. I've never had some previous experience with collections and neither eloquent, so, it's not a post about deep funcionalities, but some interesting parts that helps me to understant better how the engine works.

#Collections
One of the aspects that most drew my attention in Laravel was the Collection object. One thing that bothers me about [PHP array functions](https://www.php.net/manual/en/ref.array.php) is the lack of patterns. In the example below you can see that both functions iterate the array, although the way that you implement the callback function and the params is different:

```php
array_map($callback, $array);
array_filter($array, $callback);
```

As you are using an object when working with Collections, you don't need to worry about the callback position, since your base array is already defined in Object,

```php
$array = new Collection([1,2,3,4);
$array->map($callback);
$array->filter($callback);
```

It looks better.


But the main reason why i'm in love with Collection, is that the [Query Builder](https://laravel.com/docs/7.x/queries) return a Collection. Let's checkout using the example below.
We're not digging in about database connection or something else, let's focus only on Collections feature.

```php
<?php

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    /**
     * The attributes that should be visible in results.
     *
     * @var array
     */
    protected $visible = [
        'name',
        'email',
    ];
}

$user = User::where('enabled', true)->get();
```

Now *$user* variable is ready to use collections methods, because the **->get()** calling returns a collection.
Java Concept of the Day.
Tags: java, computerscience, beginners, career
Published: 2020-07-21 13:29:09

This is the continuation of the post where i will be discussing one core java concept every alternate day.

[ORIGINAL POST] (https://dev.to/the_unconventional_coder/java-concepts-o8l)


###Today's concept-Java Access Modifiers.

Java ,unlike many other OOP language has 4 access modifiers.
**public**
**protected**
**default**
**private**



*public*: The access level of a public modifier is **everywhere**. It can be accessed from within the class, outside the class, within the package and outside the package.

*protected* : The access level of a protected modifier is within the package and outside the package through child class. If you do not make the child class, it cannot be accessed from outside the package.

*default*: the access level of a default modifier is only within the package. It cannot be accessed from outside the package. If you do not specify any access level, it will be the default.

 *private* : The access level of a private modifier is only within the class. It cannot be accessed from outside the class.


The Access modifiers below are arranged  in decreasing order of visibility:

public>protected>default>private

##Access Modifiers on Classes:

For **outer classes** there is only two choices: public,default
For **inner classes** there is no restriction,all four can be used.

###NOTE:each java file can only contain one public class,and the name of that public class has to be same as of the file name.

##Access Modifiers on Member Variables and Functions:

*Public data members*:they are accessible for any class in any package.(No security)

*Protected data members*:they can be accessed from classes of the same package and also from classes of other packages who inherit them,in other  words, if any class from any other package is a child class then that class can access protected data members  through inheritance.

*Default data members*:the other name for default is **package private**.Thus default  data members  are accessible only from the same package.

*Private data members*:Only accessible from the class in which they are declared(Most Secure).

###NOTE: If we are overriding any method, overridden method (i.e. declared in subclass) must not be more restrictive.

What this means is that while overriding  the accessibility can only be increased (or the same as parent class) ,but cannot be decreased.

Thus:
 *public* cannot be changed to private,default,protected.
*protected* cannot be changed to private,default
*default* cannot be changed to private
Methods declared private are not inherited at all, so there is no rule for them.

[oracle java documentation](https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html) 

Please like this post if it helped you , liking this article will provide motivation for me to deliver even better articles in the future.

**Thank You** for taking out the time to read this article.
Please comment down any suggestions for me .
And let me know what topic i should cover next.
A storage for array of data, that validates, and retains the schema
Tags: database, help, discuss
Published: 2020-07-21 13:27:18

For storage purposes, not for frequent reads.

Is there a standard?

If I use simply CSV, all fields would be forced to be strings. Also, it will not be validated. (I can still validate externally, though.)

An easy way would be to use SQLite, will be notify next users about the schema; but does it really validates? (I think I can put INTEGER in TEXT field. But, NOT NULL can be helpful. UNIQUE is +/- helpful.)

So, how about SQLite with `.meta` table, or are there better options?

Another thought is `*.ndjson` with JSON schema. XML schema is valid too, but I know too little about XML to use it. -- Both of which, file sizes can be bloated...
Become a Data Science Wizard 🧙
Tags: datascience, database, python, javascript
Published: 2020-07-21 13:26:02

![Humble Bundle Data Science Essentials](https://dev-to-uploads.s3.amazonaws.com/i/lu75jx0xivefkmvcf4kd.jpg)

[Humble Book Bundle: Data Science Essentials by Taylor & Francis](https://www.humblebundle.com/books/data-science-essentials-books?partner=repsup)

Learn data science essentials with this bundle of ebooks by Taylor & Francis!

This bundle launched Monday, July 6, 2020, at 11:00 AM PT and lasts until the same time on Monday, July 27, 2020. Get ebooks like Frontiers in Data Science, Testing R Code, The Essentials of Data Science, Implementing Reproducible Research, and more.

Plus, pay what you want and support Code.org and a charity of your choice.
Cannot read property 'setState' of undefined
Published: 2020-07-21 13:23:57

### I facing error like this "Cannot read property 'setState' of undefined"
anyone help me 



````````
class Login extends React.Component {
        constructor(props) {
          super(props);
          this.state = {
            fields: {},
            errors: {},
            logged_in:false
          }
          this.handleChange = this.handleChange.bind(this);
          this.userForm = this.userForm.bind(this);
          this.validateForm=this.validateForm.bind(this);
        };
        handleChange = (e) => {
          let fields = this.state.fields;
          fields[e.target.name] = e.target.value;
          if (this.validateForm()) {
          this.setState({
            fields
          });
        }
        }
        userForm = (e) => {
          e.preventDefault();
          if (this.validateForm()) {
              let fields = {};
              fields["mobileno"] = "";
            
              this.setState({fields:fields});
              
          }
    
        }

       
    validateForm = () => {

      var fields = this.state.fields;
      var errors = {};
      var formIsValid = true;

   
      if (!fields["mobileno"]) {
        formIsValid = false;
        errors["mobileno"] = "*Please Enter Valid Mobile Number.";
      }

      if (typeof fields["mobileno"] !== "undefined") {
        if (!fields["mobileno"].match(/^[0-9]{10}$/)) {
          formIsValid = false;
          errors["mobileno"] = "*Please Enter 10 Digits Mobile Number.";
        }
      }


      if(fields["mobileno"] !='')
      {
          var mobile_no = fields['mobileno'];
          let url = '../classbooking/php/classbook.php';
          axios({
            method: 'POST',
            url: url,
            data: {
              mobile_no1: mobile_no
            }
          }).then(function(res) {

            if(res.data.loggedin == true) {
              this.setState({           ------>  error occur here
                logged_in:res.data.loggedin
              });
              errors["mobileno"] = "*Mobile Number  registered.";
            }
            else
             {
              this.setState({
                logged_in:res.data.loggedin
              });
              errors["mobileno"] = "*Mobile Number Not registered.";
            }
            
          });
      }

      this.setState({
        errors: errors
      });
      return formIsValid;


    }
    }
Program Your Destiny with Raspberry Pi
Tags: codenewbie, javascript, python, computerscience
Published: 2020-07-21 13:15:37

![Humble Bundle Raspberry Pi](https://dev-to-uploads.s3.amazonaws.com/i/i0l6obv5xmurw3ooca28.jpg)

[Bring your programming dreams to life with Raspberry Pi by Raspberry Pi Press!](https://www.humblebundle.com/books/raspberry-pi-raspberry-pi-press-books?partner=repsup)

This inventive bundle of programming books launched on Monday, July 20 at 11:00 AM PT and lasts until the same time on Monday, August 10, 2020. Featuring titles like Build a 4K digital media hub: The MagPi #87, The Official Raspberry Pi Projects Book – Volume 1, Book of Making – Volume 1, The Official Raspberry Pi Beginner’s Guide – 3rd Edition, Build a retro games console: The MagPi #95, and many more. Plus, pay what you want and support charity.

This bundle supports the Raspberry Pi Foundation, a nonprofit that provides free computing education to young makers around the world.
Generating ACM certificates for a Vercel-managed domain.
Tags: aws, vercel, acm, certificate
Published: 2020-07-21 13:08:31

---
title: Generating ACM certificates for a Vercel-managed domain.
published: true
description: Guide on creating ACM certificates on a domain that is managed by vercel.
tags: 
  - aws
  - vercel
  - acm
  - certificate
---

When you use [Vercel](https://vercel.com) to manage your DNS records, they [generate SSL certificates](https://vercel.com/docs/v2/edge-network/encryption?query=certificates#) for you.

I want to manage my DNS with Vercel, but still need an [ACM Certificate](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) in my AWS account. I've done this before with [Route 53](https://aws.amazon.com/route53/), but with Vercel I kept seeing mysterious failures.

After trying [Email Validation](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html), I switched to [DNS Validation](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html). I still got errors, but this time I got more information:

`The status of this certificate request is "Failed". One or more domain names have failed validation due to a Certificate Authority Authentication (CAA) error`.

After googling around, I found [this note](https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting-DNS-validation.html):

`One or more domain names have failed validation due to a Certification Authority Authentication (CAA) error, check your CAA DNS records.`.

After going back to my domain in the Vercel dashboard, I found this record:

`CAA 0 issue "letsencrypt.org"`

Since there is no [CAA Record](https://en.wikipedia.org/wiki/DNS_Certification_Authority_Authorization) allowing amazon to issue certificates, the request fails.

AWS [provides documentation](https://docs.aws.amazon.com/acm/latest/userguide/setup-caa.html) on how to configure a CAA record to allow ACM to generate certs. We need to add an extra record in Vercel:

`CAA 0 issue "amazon.com"`

Request a new ACM cert and this time it succeeds!
Software Technical Debt
Published: 2020-07-21 13:04:42

Somehow when we hear the term "Technical Debt" we tend to think about it in future tense. *Ahhh, we don't need to worry about Technical debt now! We'll get to that later. Just get coding..* So it's off to the gold mine with no canaries on our shoulders.

Technical debt starts at day one.  If we don't follow SOLID principals (yes even for JavaScript), and choose an aging Framework that's antiquated, we are submitting ourselves to prolonged maintenance headaches. 

**Two Steps Out**

- Always Follow [SOLID](https://en.wikipedia.org/wiki/SOLID)
- Stay away from "Dead" software or frameworks and or migrate when needed.

On GitHub or NPM; dead software is something that shows little or no activity for 2 years and has low ratings. Remember, both gitHub and NPM are free which means there's a ton of junk there. 

JWP 2020
Need IOS & Android App Developer Local NJ / NYC — $20 Hr

Published: 2020-07-21 12:58:21

Hire Android app developers from Axton Group on monthly or ongoing basis. We are local in Manhattan, Brooklyn, NJ and NYC and we can meet face to face to discuss about your project.

We are in the industry from past 15 years and we develop secure, advanced and feature rich apps. Our highly qualified android app developers have designed so many enterprise grade mobile apps for small, mid and large scale businesses across various industry.
Transform your business with our full-stack Android app development services & solutions.

<b>Custom Android app development</b>

For android application codes can easily build secure apps that perfectly meets with your business needs.

<b>Wearable applications</b>
Our experts are quick and responsive in developing wearable apps for all type of businesses.

<b>AR/VR mobile apps</b>
We create innovative and interactive AR & VR apps for multiple needs.

<b>Block chain mobile apps</b>
We make use of block chain technology to develop worthy apps as per your requirement.

<b>Kotlin mobile apps</b>
Our expert developers leverage kotlin for the preferred coding category.

<b>AI/machine learning apps</b>
With the help of machine learning algos, our android app coders build intelligent and innovative AI based mobile apps for business.

<b>Android App Integration</b>
Get your android apps seamlessly integrated with your existing back-end applications (CMS, ERP etc.) to optimize operational efficiency.

<b>Why android for</b>

•Open-source
•Uncomplicated customization
•Easy approbation
•Improved user experience
•Highest scalability
•Improved security assurance
•Rapid implementation
•More advanced ROI
•Target numerous platforms

<b>Android technologies we work upon</b>
•Java
•Kotlin
•JavaScript
•XML
•Android studio
•Android SDK
•Android NDK

Looking to <a href="https://www.axtongroup.com/services/android-app-development/">hire android developers</a>? We have the perfect solution for you, let’s have a look
If you wish to experience best of what android platform has to offer, you should definitely contact mobile application Development companies and hire our Android app developers. We are a top-notch Android application development company that possess the capability of building custom android apps as per your business needs.

Want to design an android app that has strong security and wonderful features. Connect with the team at Mobile Application Development Company to convert your dream application into reality!
Get in touch with us on 610–209–3937 or drop us an email on info@axtongroup.com