teleren/devto huggingface dataset:
AWS Re:Invent 2021 #Reaction
Tags: aws, discuss, news
Published: 2021-11-29 04:12:22

![Register at AWS re:Invent](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anp08xpmdgwb7meser44.png)

Hello everybody! 👋

AWS re: Invent 10th Anniversary is about to begin. And it will be a much more than special event due to the mixed feelings for those who are already in Las Vegas, Nevada.

Do you not believe me?
Well.. look at Corey 👻
Absolutely everyone has that smile now 😁
{% twitter 1464731548574384128 %}



Adam Selipsky is here, again! 🙌
The return of Adam, who with his message will usher in AWS re: Invent through the midnight madness, is one of the reasons this year's re: Invent is special.
When the news of his return as CEO of AWS went around the world, many of us wondered how business intelligence-oriented products such as AWS QuickSight or Big Data-oriented products such as AWS Glue could evolve due to Adam's successful footprint. in Tableau. It remains to wait for the keynote
{% twitter 1465057084173479941 %}



Jeff Barr has landed in re:Invent 🛬
He barely set foot on AWS re:Invent was approached by many of the attendees who got selfies, greetings, and stickers. This is another reason why this AWS re: Invent 2021 is very special, it will be recorded in the memory of many people 🍻
{% twitter 1465116762828017667 %}

My name is Gerardo Castro from Peru and I'll keep writing the news throughout this week.

If you are at the event, I hope you enjoy every second, it is a unique experience!

And you couldn't go to the event like me, I encourage you to be part of the virtual mode and enjoy together what re: Invent brings us!
Disable Sorting On Specific Columns In Datatable
Tags: laravel, javascript, datatable, sorting
Published: 2021-11-29 03:05:23

In this example I will show you how to disable sorting on specific columns in datatable. If you want to remove sorting arrow or disabled sorting on specific column or all column in datatable then you need to use columnDefs in jquery. Datatable provide many features like sorting, pagination, search, and ordering for specific column but many time some feature are not useful as per client's project requirments.

Using datatable columnDefs function you can disable sorting on all columns, datatable sorting on specific column, datatables disable sorting on multiple columns, datatables remove sorting arrows for one column.

lets's see datatable disable sorting on particular column example.

---

**_[Read More : Autotab To Next Input Field JQuery](https://techsolutionstuff.com/post/autotab-to-next-input-field-jquery-example)_**

--- 

ColumnDefs provide to set parameter allows you to assign specific options to columns in data tables.


```
"columnDefs": [ {
      "targets": 0,
      "searchable": false
    } ]
```


```
$(document).ready(function()
{
   $('#details').DataTable({
     'processing': true,
     'serverSide': true,
     'serverMethod': 'POST',
     'ajax': {
       'url':'/demo/details.php'
     },
     'columns': [
        { data: 'id' }, /* index - 0 */
        { data: 'name' }, /* index - 1 */
        { data: 'email' }, /* index - 2 */
        { data: 'phone_no' }, /* index - 3 */
        { data: 'country' } /* index - 4 */
     ],
     'columnDefs': [ {
        'targets': [3,4], /* column index */
        'orderable': false, /* true or false */
     }]
   });
});
```
 
---

You might also like :

- **_[Read Also : How To Validate Upload File Type Using Javascript](https://techsolutionstuff.com/post/how-to-validate-upload-file-type-using-javascript)_**

- **_[Read Also : How To Check Occupied Disk Space In Laravel](https://techsolutionstuff.com/post/how-to-check-occupied-disk-space-in-laravel)_**

- **_[Read Also : How To Create Dynamic Line Chart In Laravel](https://techsolutionstuff.com/post/how-to-create-dynamic-line-chart-in-laravel)_**
Parallel Testing vs. Traditional Testing | All You Need To Know
Tags: testing, paralleltesting, traditionaltesting
Published: 2021-11-29 02:10:16

It is no surprise that the integration of digital technology into all areas of business operations is creating a high demand for software. To increase the effectiveness of their operations, enterprises rely more heavily on software, which means that software is now more complex, and there is little tolerance for failure. 
[Continue reading](https://www.katalon.com/resources-center/blog/parallel-vs-traditional-testing-devops/)
YAGNI - You Aren't Gonna Need It
Published: 2021-11-29 01:44:32

 Esse artigo, deve trazer a visão de que KISS só pode ser ferido quando realmente precisamos, exceto isso não.

 In software development we have some fundamentals principles to help us during the difficult choices that we will be making during our lives as developers, I already talked about [KISS(Keep It Simple, Stupid)](https://dev.to/figur8/kiss-keep-it-simple-stupid-56ef) and i wanna talk about DRY on the future, and today I'll talk about the most important principle for me today we will talk about YAGNI(You Aren't Gonna Need It).
 This principle 
# Referências
https://martinfowler.com/bliki/Yagni.html
Happy Holidays!
Tags: codenewbie, beginners, webdev
Published: 2021-11-29 01:06:01

## Learning through the holidays 
Start learning to code they said, it'll be fun they said. They also said if you're doing this on your own, self-taught that is, you have to be disciplined enough to study when your friends want to do other things. So this week, I studied, even on Thanksgiving day. I find that if I wake up and go straight from my coffee pot to my office. I can get a good amount of study time in. No I'm not out here doing 4,8,12 hour YouTube study with me ha ha but I feel the time I am putting in is valid and useful. Well that's it for today.

I hope you all had a great Thanksgiving and an even better rest of your Holiday Season. 

Now, let's get this bread together :)
How to convert a Set to an Array in JavaScript?
Tags: javascript
Published: 2021-11-29 00:00:00

---
  title: How to convert a Set to an Array in JavaScript?
  published: true
  tags: JavaScript
  date: Mon Nov 29 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/convert-set-to-array-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-818cb2a7c0c50b208e0ab2d59140cc52.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/convert-set-to-array-javascript)
  
To convert a `Set` to an array, you can use the `from()` method from the global `Array` object in JavaScript.

### TL;DR

```js
// initialize a set
const uniqueNumbers = new Set();

// add values to the `uniqueNumbers` set
uniqueNumbers.add(1);
uniqueNumbers.add(2);
uniqueNumbers.add(3);

// convert `uniqueNumbers` set to an array
// using the Array.from() method
const uniqueNumbersArr = Array.from(uniqueNumbers);

// log the output of `uniqueNumbersArr` array
console.log(uniqueNumbersArr);

/*

OUTPUT:
-------

[1, 2, 3]

*/
```

For example, let's say we have a set called `uniqueNumbers` and add some values of `1, 2, and 3` to the set using the `add()` method like this,

```js
// initialize a set
const uniqueNumbers = new Set();

// add values to the uniqueNumbers set
uniqueNumbers.add(1);
uniqueNumbers.add(2);
uniqueNumbers.add(3);
```

Now we have a valid set of unique numbers.

To convert the above `uniqueNumbers` set to an array, we can use the `Array.from()` method and:

- pass the `uniqueNumbers` set as an argument to the method.
- The method returns a new array with all the values of the `uniqueNumbers` set as the array elements.

It can be done like this,

```js
// initialize a set
const uniqueNumbers = new Set();

// add values to the `uniqueNumbers` set
uniqueNumbers.add(1);
uniqueNumbers.add(2);
uniqueNumbers.add(3);

// convert `uniqueNumbers` set to an array
// using the Array.from() method
const uniqueNumbersArr = Array.from(uniqueNumbers);
```

Now we have converted the `uniqueNumbers` set to an array. Yay 🎉!

Let's also log the output of the `uniqueNumbersArr` to the console.

It can be done like this,

```js
// initialize a set
const uniqueNumbers = new Set();

// add values to the `uniqueNumbers` set
uniqueNumbers.add(1);
uniqueNumbers.add(2);
uniqueNumbers.add(3);

// convert `uniqueNumbers` set to an array
// using the Array.from() method
const uniqueNumbersArr = Array.from(uniqueNumbers);

// log the output of `uniqueNumbersArr` array
console.log(uniqueNumbersArr);

/*

OUTPUT:
-------

[1, 2, 3]

*/
```

As you see from the above output that the `uniqueNumbers` set is successfully converted into an array in JavaScript.

See the above code live in [JSBin](https://jsbin.com/judoworomi/2/edit?js,console).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
Hiring, Fast and Slow
Tags: hiring, cognition, itjobs
Published: 2021-12-03 11:59:32

---
title: Hiring, Fast and Slow
published: true
date: 2021-11-29 00:00:00 UTC
tags: hiring,cognition,itjobs
canonical_url: https://jhall.io/archive/2021/11/29/hiring-fast-and-slow/
---

In his book, [_Thinking, Fast and Slow_](https://amzn.to/3lah3A1), author Daniel Kahneman explains that humans have [two systems of thinking](https://en.wikipedia.org/wiki/Thinking,_Fast_and_Slow), which he creatively calls “System 1” and “System 2”.

System 1 is fast, insinctive and emotional.

When you hear a fire alarm go off, and you rush out of the office building, this is system 1 at play.

System 2 is slower, more deliberate and more logical.

When you’re trying to decide where to go on vacation, you’re using system 2.

What does this have to do with hiring?

A lot of hiring screening is focused on system 1.

[“Trivia” quizzes](https://jhall.io/archive/2021/08/23/the-craziest-interview-ever/), timed coding challenges, even timeboxed conversations. These all favor fast, on-your-feet types of thinking. System 1.

**But here’s the thing…**

In IT, success on the job hinges a lot more on System 2 thinking.

Deciding on the optimal architecture for your project, debugging complex code, and even writing documentation are all System 2 processes.

What can we do to overcome this disconnect? Please share your thoughts with me!

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Behavioural Patterns: Strategy Pattern
Tags: programming, productivity, codequality, beginners
Published: 2021-11-28 23:46:39

Strategy pattern defines a family of algorithms Defines each one of them and makes them interchangeable. Strategy lets the algorithm vary independently from the clients that use it.

Inheritance is a pretty basic object-oriented technique that allows subclasses created from already existing classes to use functions and variables from their parent class. This easily allows behaviors to be similar and means code can be reused. There are however circumstances where an inheritance will in fact create more duplicate code than can easily be managed to bring with it all the folly of having copy-paste code from one section to another. This can occur because when inherited functions can be inherited down easily but they cannot be inherited across. Here is an example of when code would be duplicated under inheritance.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2l4uh5z5mkuy4xszl2j.png)

In the above UML 2 subclasses are using the same Fight function and two are also utilizing the same Eat function. Despite that, on implementation, those repeat functions will have to be written out in full twice or even more if another class shares that functionality. There is no way for the one function to be used by one of its sister classes,  but strategy patterns can circumnavigate this dilemma.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/berju1uimjw8qpq8xpgt.png)

A strategy pattern takes functionality away from the function within the class instead of requiring an interface class for that function to be created which can then act as a directory to select a class for them. Now that the interface class exists it can assign completely different classes even ones unrelated to the base class with the exact same functionality if required. This is the logic applied to the first UML diagram

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zxntucw3xddw5gxa6ui.png)

It is possible to take this one step further completely foregoing inheritance itself and instead establishing all parts of the base class as interfaces. This would then mean the subclass would instead be a collection of the correct interfaces instead of one that inherited the correct functionality and had overridden other parts. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0e2h4yl7au8fzpbt5lkb.png)

This complete lack of inheritance means no class in this model 'is a' form of another class and instead it is a group of classes that 'has a' bunch of other classes creating a spider web of links as opposed to a tree of inheritance. This method probably shouldn't be the default with simple projects or small use cases but it definitely has earned the right o be as prolific as inheritance in my opinion. Sandi Metz argues the benefits of composition over inheritance in her Nothing is something talk on the null object pattern.
Astronaut.Library.js
Tags: javascript, opensource, libraryjs, extensionbrowser
Published: 2021-11-28 23:33:14

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hfdcwrbyftcapgxypudc.png)

Astronaut Library.js is a small Library Javascript with useful resources for Developers.

https://astlibjs.ga
Moving Objects in Unity The Right Way
Tags: beginners, unity3d, physics
Published: 2021-11-28 23:05:40

## Physics based ##

### Rigidbody SetVelocity ###
rb.velocity = transform.forward;
Once velocity is set provided there is no drag object will maintain pace until collision.
Great for launching an object with a speed independent of its mass

### Rigidbody MovePosition ###
rb.MovePosition(transform.position + (transform.forward * Time.deltaTime));
Only physics based way to move a kinematic object
Stable Way to move a rigidbody object without manipulating the physics of the object just the position.

### Rigidbody AddForce ###
rb.AddForce(transform.foward * Time.deltaTime );
Every frame force will be added leading to acceleration up to infinity provided drag is 0.
Allows for specific force modes to be inserted such as Start, Impulse, Acceleration, Force, and Velocity Change. These can all change the behavior of how that particular force is applied to the object.

## Position Based ##

### Transform Translate ###
transform.Translate(Vector3.foward * Time.deltaTime);
Gives an amount of space to move each frame
Great for animating 
Can move kinematic objects

### Transform Set Position ###
transform.position += transform.forward * Time.deltaTime;
Giving new position to move every frame
Great for animating 
Can move kinematic objects

Because movement operations through transform happen asynchronously when moving through or next to an object with a collider on the object may bounce or stutter as it tries to continue in the desired direction. This is because it successfully moves before being rejected back out by the physics of the collider. Because of this using these functions on an object that is meant to touch another object in some way is not recommended.
Host WordPress on Alibaba Cloud for Free
Tags: cloudskills, cloudnative, beginners, webdev
Published: 2021-11-28 22:54:26

Alibaba Cloud is offering a few campaigns that allow you to host your websites on the cloud &mdash; accessible to your customers in China as well &mdash; for very low rates. 

The campaign is offering a lot of services in the web development and ecommerce domain; https://www.alibabacloud.com/campaign/website-building. One of the most interesting offerings include the hosting of a WordPress website on a LAMP server for as little as 0 USD (_just pay for the cloud resources_). Don't believe me, try it out [here](https://marketplace.alibabacloud.com/products/201072001/Wordpress_on_LAMP_Ubuntu_14_04_64bits_powered_by_IGS-cmjj011730.html).

### WordPress on Alibaba Cloud

WordPress can be deployed almost on every cloud; if Google Cloud or Microsoft Azure helps, you can deploy it there. Especially, if your resources are already deployed on those clouds. Alibaba Cloud excels in providing efficient services within Mainland China and is the leading cloud platform provider for Asia region. 

If you wanted to try out Alibaba Cloud, this would be a good time for you to explore the services of the cloud giant and see if this can help your business. 

WordPress on Alibaba Cloud is a full scale offering by Alibaba Cloud, with all the underlying resources provisioned under the subscription. This service is offered by [IGS](https://marketplace.alibabacloud.com/store/1697396.html?spm=a3c0i.730006-56682004-201072001-cmjj011730.0.0.1bc0739asmJnPF) a partner of Alibaba Cloud. The benefit of using this solution &mdash; as compared to a custom deployment &mdash; is that you do not have to worry about the customization of the product. The image is perfectly tailored and configured to run WordPress on Alibaba Cloud compute.

IGS also provides services in Drupal, Joomla, Magento, etc.
Understanding classes in javascript
Tags: beginners, javascript
Published: 2021-11-28 22:50:24

ES6 introduced classes, it's often used by front-end libraries such as react, in simple term classes are special kind of functions.

```js
function Car(type,brand){
    this.type= type;
    this.brand = brand;
}
Car.prototype.getDescription = function(){
    console.log(`This car is ${this.type} from brand ${this.brand}`)
}

let newCar = new Car('Jazz','Honda')
newCar.getDescription()

```

Before classes introduce in ES6, the best way to create an object template was using functions, but now we can create an object template using classes.


As above example can be rewritten with class in following way

```js
class Car{
    constructor(type,brand){
        this.type= type;
        this.brand = brand;
    }
    getDescription=()=>{
        console.log(`This car is ${this.type} from brand ${this.brand}`)
    }
}
let newCar = new Car('Jazz','Honda')
newCar.getDescription()
```

Now we have more better approach for creating object template in the form of classes. 

The difference between functions and classes in simple are:

- classes are blueprint for javascript object
- function are the way to package reusable code

Therefore, when we need to make reusabled block of code that used multiple time, we can package those block inside function, However
when we need to create an object that needs to generated mulitple times then use classes
Accessing Elements in 2D Arrays in Java
Tags: java, codenewbie, tutorial, 100daysofcode
Published: 2021-11-28 20:45:05

---
title: Accessing Elements in 2D Arrays in Java
published: true
description: Accessing Elements in 2D Arrays in Java
tags: Java, codenewbie, tutorial, 100daysofcode
//cover_image: https://direct_url_to_image.jpg
---
The two-dimensional (2D) array is a useful data structure. Like one-dimensional arrays, 2D arrays work well with `for` loops.

Here is a 2D array in Java:

```java
int[][] arr = {
  {0, 1, 2, 3, 4},
  {5, 6, 7, 8, 9},
  {10, 11, 12, 13, 14}
};
```

The `int[][]` declaration means that `arr` is a 2D array of `int` values. Since there are two pairs of `[]`, the array has two dimensions.

Look at this 2D array. It is actually an *array of arrays*. The array `arr` has a length of `3`. It has three elements, or *rows*.  Each row is an array of length `5`:

```java
{0, 1, 2, 3, 4}

{5, 6, 7, 8, 9}

{10, 11, 12, 13, 14}
```
The first array is `arr[0]`. The second and third arrays are `arr[1]` and `arr[2]` respectively. A `for` loop can access each of these arrays using an index:

```java
for (int i=0; i < arr.length; i++) {
  int[] row = arr[i];
  System.out.println( Arrays.toString(row) );
}
```

Here is the output:

```bash
[0, 1, 2, 3, 4]
[5, 6, 7, 8, 9]
[10, 11, 12, 13, 14]
```

The `for` loop accesses each row. Since the row is also an array, an inner `for` loop can access each of its elements:

```java
for (int i=0; i < arr.length; i++) {
  int[] row = arr[i];
  for (int j=0; j < row.length; j++) {
    System.out.println(i + "," + j + ": " + arr[i][j]);
  }
}
```
Here is the output:

```bash
0,0: 0
0,1: 1
0,2: 2
0,3: 3
0,4: 4
1,0: 5
1,1: 6
1,2: 7
1,3: 8
1,4: 9
2,0: 10
2,1: 11
2,2: 12
2,3: 13
2,4: 14
```

In the output, the first number is the row index. The second number is the column index. The third number is the element at that position of the 2D array.

Note how two indexes are required when accessing a single element of the 2D array. For example, `arr[1][3]` contains the `int` value `8`. The `for` loop accesses each row in order. Once it has a row, then it uses an inner `for` loop to access its `int` values in order.

Here is a complete example:

```java
public class Example {
  public static void main(String[] args) {

    int[][] arr = {
      {0, 1, 2, 3, 4},
      {5, 6, 7, 8, 9},
      {10, 11, 12, 13, 14}
    };

    for (int i=0; i < arr.length; i++) {
      int[] row = arr[i];
      for (int j=0; j < row.length; j++) {
        System.out.println(i + "," + j + ": " + arr[i][j]);
      }
    }

  }
}
```

When using 2D arrays, use two indexes. The first index is for the row. The second index is for the column. In other words, each element of a 2D array is an array. The first index accesses an array element. Then use a second index to access the elements in that array. To facilitate this, use a `for` loop with an inner `for` loop to provide the row and column indexes.

Thanks for reading.

Follow me on Twitter [`@realEdwinTorres`](https://twitter.com/realEdwinTorres) for more programming tips. 😀
Array inputs validation and the N+1 query problem in Laravel
Tags: laravel
Published: 2021-11-28 22:24:33

The N+1 query problem can crop up in a variety of circumstances, one area that could be surprising to find this problem is when validating a form submission.

Below is a validation rule to ensure an id exists in a corresponding table.

```php
$request->validate([
    'comments.*.status_id' => ['required', 'exists:statuses,id'],
]);
```

If this was a single `status_id` input that would be fine, no N+1 problem would exist, but looking closely we can see `status_id` belongs to an array of inputs as shown by the dot notation. As `status_id` is an input in the `comments` array Laravel will perform the same exists query for each element, which could mean an excessive amount of queries.

As always the solution is to do some eager loading and in this case it can be achieve by making use of `Rule::in()`.

```php
use Illuminate\Validation\Rule;

$statuses = Status::pluck('id')->toArray();

$request->validate([
    'comments.*.status_id' => ['required', Rule::in($statuses)],
]);
```

Laravel will still perform the same validation on each of the `comments` array inputs but now the `statuses` table is only queried once, no matter how many elements there are in comments.
The Inspector 🔎: A better way to test your code
Tags: actionshackathon21, javascript, opensource, productivity
Published: 2021-11-28 21:42:19

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n1o376zs1yik6dq9lrqn.png)

Use this Github Action to surface test errors sooner and develop faster! This action currently only supports JavaScript projects but we look forward to expanding in the future.

What the action does:

Creates PR comment with failing test, which includes:
- Link failing test 
- Direct link to source code where the error is coming from
- Stacktrace 


### My Workflow
This project is using the Sticky Pull Request Comments github action repo: 
https://github.com/marocchino/sticky-pull-request-comment


### Submission Category: 
DIY Deployments



### Yaml File or Link to Code
https://github.com/nspired-tech/hackathon-the-inspector/blob/main/.github/workflows/test.yml 



### Additional Resources / Info