teleren/devto huggingface dataset:
Usability
Tags: ux
Published: 2022-09-10 04:18:20

## Usability
Usability is defined by five quality components:

1. Learnability: How easy is it for users to accomplish basic tasks the first time they encounter the design?
2. Efficiency: Once users have learned the design, how quickly can they perform tasks?
3. Memorability: When users return to the design after a period of not using it, how easily can they reestablish proficiency?
4. Errors: How many errors do users make, how severe are these errors, and how easily can they recover from the errors?
5. Satisfaction: How pleasant is it to use the design?

## Difference between usability and functionality

Functionality is a set of operations that an interface supports whereas, usability is ease of use of an interface. Usability checks how easy it is to pilot an aircraft/use an application. On the other hand, functionality checks the operational and safety features of an aircraft/whether an app is doing tasks correctly as it is expected to do. Usability and functionality are often seen as design trade-off. A large number of functions in one user interface can be an annoyance that makes interfaces more difficult to learn and use. Removing functions to burying them in obscure places generally makes interfaces less powerful. Let’s take Daraz and Sastodeal in consideration; both serves the same objective of promoting online shopping but the question is which one is more easy and comfortable to use as a user’s perspective.

## Difference between usability testing and functionality testing
Both usability testing and functionality testin are a vital part of the testing process. Functional testing is carried out to ensure that the product behaves according to the functional requirements without taking design principles into consideration. Usability testing investigates all aspects of the usability of a product, including overall structure, navigational flow, layout of elements on a page, clarity of content, and overall behavior.
Both functional and usability testing require very different mindsets from the person testing and ideally should not be carried out by anyone involved in the development of the product.  Functional testing requires the mindset of “CAN I do what I need to do; does this product work?” Usability testing is more about ‘usability’ than it is about ‘testing’ (given that the latter term inevitably seems to bring about visions of functional testing first and foremost) and needs to have the mindset “HOW can I do what I need to do; does this make sense?”
A simple way to think of the difference between functional testing and usability testing is that functional assesses whether or not the product works the way it should, whereas usability addresses whether or not the end user can access those functions and successfully use the product.
AWS EC2 Cheat Sheet
Tags: 30daysofaws, day02, certifieddeveloperassociate, ec2
Published: 2022-09-10 04:10:59

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


Allows:
- to run different types of cloud instances and pay-per-use models.
- to control computing resources at the operating system level
- working in an Amazon computing environment. 


- EC2 & EBS
- EC2 (Elastic Compute Cloud) Instance
- EBS (Elastic Block Store) - Persistent storage volume
- AMI (Amazon Machine Image) - Packages OS and additional installations in a reusable template
- Instance and Instance Types: General Purpose (t-type and m-type), Compute Optimized(c-type), GPU Graphics, GPU Compute, Memory Optimized(r, × and z-type), and Storage Optimized(d, h and i-type)
- Purchasing Options: On Demand, Reserved, Scheduled, Spot, Dedicated Instance and Dedicated Host
- Spot: Partial hours are not billed if terminated by AWS EC2
- Secure login information for your instances using key pairs
- Placement group: Cluster and Spread

**For root:**

- General purpose SSD (balances price & performance)
- Provisioned OPS SD (Highest performance for mission-critical low-latency or high throughput workloads)
- Magnetic HDD (previous generation)

**For other:**

- Throughput Provisioned HDD (low cost for frequently accessed, throughput intensive workloads)
- Cold HDD (lowest cost for less frequently workloads)
- Instance Store - temporary storage volume in which data is deleted when you STOP or TERMINATE your instance


> - [Practice notes](https://romankurnovskii.com/en/docs/aws-certified-developer-associate/ec2/)
> - [Questions](https://dev.to/romankurnovskii/aws-ec2-top-questions-certified-developer-exam-27oo)
Simulasi Packet ICMP di Cisco Packet Tracer
Tags: tugas, pakferry, cisco, networking
Published: 2022-09-10 04:02:34

Sebelum melakukakn Simulasi packet dari PC0 ke PC1 saya cek di **PC0**, apakah ada tersimpan Destination MAC Adreess dalam hal ini MAC dari PC1, dengan menggunakan perintah:

```
> arp -a
```

![Cek arp cache](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbhr50c6mzi9qz6j2rf4.png)

Kemudian lakukan ping ke alamat IP dari PC1.


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

Dari situ maka terlihat di animasi packet tracer maka akan ada surat hijau. 

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

Surat hijau itu merupakan packet broadcast (bukan ICMP sendiri) karena pada proses enkapsulasi icmp masih belum mendapat MAC Address destanation nya. 


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

Jika selesai mendapatkan MAC address maka akan dikembalikan ke pc0 atau yang membroadcast tadi,

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

Jika di lihat PDU Information nya maka akan terlihat pada layer 2 (DataLink) akan terlihat physical address dari pc yang dituju, karena sebelumnya sudah melakukan broadcat ke jaringan yang se subnet.


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

Kemudian data sudah bisa didistribusikan ke IP tujuan.

## Bagaimana kalau physical address tujuan sudah tersimpan di ARP cache ?

Ini sedikit spekulatif, di beberapa laptop teman saya, walaupun sudah tersimpan. Di laptop saya sendiri tidak perlu broadcast ulang jika sudah tersimpan.


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

Saya mencoba ping lagi ke alamat IP dari PC1, PC0 langsung melakukakan sending data


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

Berikut data detail status packet pada proses ping diatas


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

## Coba kirim data dari PC2 ke PC0

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

Saya mencoba untuk mengirim data dari PC2 ke PC0. Yang terjadi adalah PC2 melakukan broadcast seperti yang terjadi pada proses pertama.

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

Jika sudah mendapatkan physical address destination maka data dari ICMP bisa dikirim ke tujuan


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cp63ms7govk9hjbe8n00.png)
How to Destructure Class Methods
Tags: javascript, typescript
Published: 2022-09-10 03:28:57

## The Problem
Suppose you had the following class:

```JavaScript
class Dog {
    numOfLegs = 4;

    getLegCount = function() {
        console.log(this.numOfLegs);
    }
}
```

Now let's say you had an instance of a Dog:

```JavaScript
const dog = new Dog();
```

We can call the `getLegCount` method like so:

```JavaScript
dog.getLegCount();
```

The output would be "4", as expected. But what if we destructured our Dog object:

```JavaScript
const { getLegCount } = new Dog();
```

Let's update the call to the method accordingly:

```JavaScript
getLegCount();
```

And while we might expect the output to be the same, we instead get

```Bash
Uncaught TypeError: this is undefined
```

Why would this be the case? When destructuring a method on a class, the method's `this` context is no longer bound, leading to the error.

## The Solution
How do we keep the `this` context? There are two ways of doing so. The first option is to explicitly set the binding of the `this` context to the method in the class constructor:

```JavaScript
class Dog {
    constructor() {
        this.getLegCount = this.getLegCount.bind(this);
    }

    numOfLegs = 4;

    getLegCount = function() {
        console.log(this.numOfLegs);
    }
}
```

This will resolve the issue and output `4`, as expected.

The second option is to use an arrow function to define the `getLegCount` method:

```JavaScript
class Dog {
    numOfLegs = 4;

    getLegCount = () => {
        console.log(this.numOfLegs);
    }
}
```

This too resolves the issue of the `this` context and does so without having to explicitly bind the context to the method. Though often times misunderstood to be completely interchangeable, the arrow function differs from the traditional function expression in that it does not have it's own binding to `this` and therefore will close over the class's `this` context.

Note that this only works correctly over classes and not traditional objects due the fact of the class having its own `this` context whereas an object's `this` context would be the global `this`.

For example, having the following object:

```JavaScript
const dog = {
    numOfLegs: 4,
    getLegCount: () => {
        console.log(this.numOfLegs);
    }
};
```

In calling the destructured method:

```JavaScript
const { getLegCount } = dog;
```

You would see the output as:

```Bash
undefined
```

## Conclusion
Arrow functions were introduced in ES6 or ECMAScript 2015 so as long as you don't need to support older legacy systems or are using a tool to ensure backwards compatibility (such as Babel or TypeScript), arrow functions are a fine approach. Whichever approach you take, you now have a deeper insight into the differences between `() => {}` and `function() {}`.
Javascript: Get days & starting day in month
Tags: javascript, webdev, beginners, programming
Published: 2022-09-10 02:31:00

Each month in calendar will have max 28, 29, 30 and 31 days. 

We can get using native JS date.

```javascript

let days = new Date(2022, 8, 0).getDate();
console.log(days);
> 31 // days in August
```

First day in each month can start from  any day. 

```javascript
let startingDay = new Date(2022, 8).getDay();
console.log(startingDay);
> 4 // represents Thursday
```

For more date utils, you can refer: [DateUtils](https://dev.to/urstrulyvishwak/most-used-dateutils-in-javascript-b7i)

Also, follow for updates: https://twitter.com/urstrulyvishwak
Rails: Active Record Validation Helpers
Published: 2022-09-10 02:03:51

## Why do we use validations? 
Validations are used to ensure that data you want is saved correctly into your database. For example, you wouldn't want someone to put a phone number in a email form. 

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

## Validation Helpers
I'll be going over some validation helpers along with some examples provided. 

**1. presence** 

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

In line 3, this is how you would use presence. This is saying 
that a name **has** to be there. If a user were to try and 
create a mission without a name, it wouldn't work.

**2. uniqueness**

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

This is saying that a email **has** to be unique.
 
**3. length**

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

With each of these, it can have a minimum, maximum, in, and is. Minimum and maximum is pretty self explanatory. For in, it's saying that the password has to be a length within 6 to 20 characters. As for is, it has to be 6 characters exactly.

**4. inclusion**

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

In line 2, this is saying that strength can only be strong, weak, or average. In rails console, if you enter %w(Strong Weak Average), it will give you an array.

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

In line 3, it's saying the age has to be between 8 and 18.


These are just a few active record validations, but if you are interested in looking at more, I would visit [here](https://guides.rubyonrails.org/active_record_validations.html). Thanks for reading and good luck coding!

sources: https://guides.rubyonrails.org/active_record_validations.html
Spreadsheets?! No - TABLES y'all.
Tags: html, beginners
Published: 2022-09-10 01:58:57

I'm a lover of spreadsheets. They're the first real tool I learned how to use, and kind of my natural segway into programming, so I have a bit of an appreciation for them. What we're going over isn't a spreadsheet, and doesn't have the functionality of one, but I imagine it is the closest to a spreadsheet that I can get at this level (I mean, if google can do it with Sheets, I'm sure I can get there, right?)

Like all things html, there are tags for this:

`<table></table>` - these are the table tags, and they surround the table's inner elements along their content, defining the start and end of the table.
`<th></th>` - these are used to create the table headers, or, the name each column. 
`<tr></tr>` - these are used to create the table rows
`<td></td>` - these are used to put data into each row.

The way this works is you start with the table tags, put in table rows, and enter the table headers as the first row's data. The table header tags are kind of interchangeable with the table data tags, in that you can use either to fill in a table row for example:
```
<table>
<tr>
     <th>product</th>
     <th>cost</th>
</tr>
<tr>
     <td>Milk</td>
     <td>$6.16</td>
</tr>
</table>
```

This will look like:
<table>
<tr>
     <th>product</th>
     <th>cost</th>
</tr>
<tr>
     <td>Milk</td>
     <td>$6.16</td>
</tr>
<tr>
     <td>Keebler Sandies Pecan Shortbread Cookies</td>
     <td>$3.28</td>
</tr>
</table>

I can switch the table data and table header tags too, making the table a little weird...
<table>
<tr>
     <td>product</th>
     <td>cost</th>
</tr>
<tr>
     <th>Milk</td>
     <th>$6.16</td>
</tr>
<tr>
     <td>Keebler Sandies Pecan Shortbread Cookies</td>
     <td>$3.28</td>
</tr>
</table>

And If I want to add borders, I can! I just have to put an attribute `<border>` into the opening table element, equaling a pixel amount like so:
```<table border="1">
<tr>
     <th>product</th>
     <th>cost</th>
</tr>
<tr>
     <td>Milk</td>
     <td>$6.16</td>
</tr>
<tr>
     <td>Keebler Sandies Pecan Shortbread Cookies</td>
     <td>$3.28</td>
</tr>
</table>```

Here is what this looks like:

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

ONWARD!!!
OSD600 - W1 - First Post!
Tags: opensource
Published: 2022-09-10 01:49:15


**Introduce yourself. Why are you taking this course? What is it about Open Source that attracted you?**
Hello! My name is Angelique. New to programming and extremely new to Open Source Development. 
I am taking this course to open my perspective and learn more about Open Source. I'm interested on how the community helps each other gather ideas and troubleshoot. 

**What are you hoping to accomplish this term? What kinds of projects do you want to work on?**
I'm hoping to understand how to utilize community forums when debugging code and how I can be a part of the community.
From a brief look at possible topics, I would like to be involved with Microsoft product developments. In previous work experiences I've worked with a lot of Microsoft products, such as PowerApps and PowerBI, and so I would like to continue learning more about these technologies.

**What was the the GitHub trending repo you researched above? Provide a link and tell us about it. Why did you pick it?**
Link: https://github.com/microsoft/PowerToys
The Github repo I researched was Microsoft PowerToys. It is a repo used to develop programs to empower more productivity and efficiencies to users. There are several utilities being produced and a roadmap is also included, showing the focus of the team. 

I chose this because the ReadMe was well done. I particularly liked the breakdown of the project, known issues, and how they thank the contributors.
5 VSCode Extensions Every Web3 Developer should Install 🛠
Tags: beginners, productivity, web3
Published: 2022-09-10 01:24:17

Vscode Extensions saves you time and energy while coding. Beyond that, as web3 developers you need all the help you can get to write secure and error free smart contracts.

That's why in this quick post I will share with you the VScode extensions I have installed on my machine to help me with web3 development.

Here are 5 VScode extensions you got to have as a web3 developer:

1. **Solidity** by juanblanco

This has got to be one of the most installed extensions for solidity development. It provides code syntax highlighting, snippets and even code completion. It's got many other goodies packed in. So you should absolutely install and explore this one.

   [Download](https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity)

2.**Solidity + Hardhat** by nomic foundation
   
Hardhat is an Ethereum development environment. It makes it easy to write and compile smart contracts. Aside being one of the most popular Ethereum dev tools aside Truffle, Hardhat has got one of the most [beginner friendly documentation](https://hardhat.org/tutorial/) out there. This extension pairs up with Hardhat tools to offer enhanced development workflow. You get amongst other things, code completion, quick code navigation and code formatting.

   [Download](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity)

3.**Truffle for Vscode** by truffle
   
Truffle is another great Ethereum development tool. Just like Hardhat, It makes it super easy to write code for the blockchain. I do not use this plugin personally but if you use the truffle environment, you should definitely get this installed.

   [Download](https://marketplace.visualstudio.com%2Fitems%3FitemName%3Dtrufflesuite-csi.truffle-vscode&usg=AOvVaw0b3ZtWMu5w4WTykrzOrSSN)

4.**Solidity Debugger** by meadow
   
Solidity Debugger is built to help you debug your smart contracts. It supports breakpoints, code stepping and local/state variable inspection. Want to grow as a web3 developer? You can start by knowing how to wield this extension.

   [Download](https://marketplace.visualstudio.com/items?itemName=hosho.solidity-debugger)

5.**ETHover** by tintinweb
   
I recently discovered this one. ETHover would show you details of any address that you use in your code. All you need do is hover on the address and you would see its account balance. You would need to create an Etherscan account to make this work.

   [Download](https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-ethover)

## Wrapping up

Alrighty then! There you have it, the 5 VScode extensions I would recommend you install as you begin your web3 journey. Do you use any of these already? Do you have an extension you feel should be up there with these 5? I would absolutely love to hear your thoughts. Thank you for reading this and see you in my next one.

#### **More readings**
[The 31 Reserved keywords in Solidity](https://koha.hashnode.dev/the-31-reserved-keywords-in-solidity)

koha
🙏Please, specify your units! 📏
Tags: javascript, programming, codequality
Published: 2022-09-10 01:20:26

What sucks about this code?

```js
const success = myCache.mset([
    {key: "myKey", val: obj, ttl: 10000},
    {key: "myKey2", val: obj2},
]);
```

It's not clear at all clear if the `ttl` is 10,000 *milliseconds*, *seconds*, or something else. Just glancing at this code (and knowing that JavaScript `setTimeout()` uses milliseconds), you might be tempted to think it's in milliseconds. Wrong! It's in seconds!

This snippet is example code from the README of [node-cache](https://www.npmjs.com/package/node-cache). This type of unclear code is really prevalent, so I'm not trying to pick on them in particular. Fortunately, the README does say that it's in seconds, but you have to [RTFM](https://www.dictionary.com/browse/rtfm) to be sure, and who's got time for that?

Wouldn't it be nice if the `ttl` property were named `ttlSeconds`? Then it's instantly clear what it means to whoever is reading the code.

Or maybe there's an even better solution.

## Datetimes

It's also pretty common for datetimes to be represented as an integer number of milliseconds (or seconds) since the Unix epoch ( 00:00:00 UTC on 1 January 1970). For example:

```js
const myBirthday = 700876800000;
```

This sucks too. You might recognize this as very likely being a number of milliseconds since the Unix epoch, but you have no idea what date this represents.

How about this instead:

```js
const myBirthday = new Date('1992-03-18T00:00:00.000Z');
```

Now whoever's reading this code knows exactly what date it represents, and code that accesses `myBirthday` does too. Surrounding code doesn't need tribal knowledge about whether this `number` is a number of seconds or milliseconds. It's a `Date`, and has a very specific meaning.

## TimeSpans

Jumping back to `TTL` (time to live) again. A TTL is not a specific date and time, but a length of time (one second, one year, etc), so we can't use `Date` to represent it.

Naming your TTL property `ttlSeconds` for clarity is a fine solution in a lot of cases, but what if there were a datatype similar to `Date` for this?

[Some languages](https://docs.microsoft.com/en-us/dotnet/api/system.timespan?view=net-6.0) actually have such features built in. JavaScript doesn't, but we can use a package like [timespan](https://npm.runkit.com/timespan).

```js
import timespan from 'timespan';

const ttl = timespan.fromSeconds(50);

console.log(ttl.totalMilliseconds()); // 50000
console.log(ttl.totalSeconds()); // 50
console.log(ttl.totalMinutes()); // 0.8333333333333334
```

You can specify your TTL in whatever units you want, and the code you pass your TTL to can read it in whatever units it wants. You don't have to agree on units at all.

[If only NASA used constructs like this](https://www.simscale.com/blog/nasa-mars-climate-orbiter-metric/), they may have been able to save a few bucks.

## Conclusion

Just a short one I wanted to get off my chest here. Many bugs have their roots in mix-ups about what units are being used. Fortunately we have some tools at our disposal to mitigate these sort of risks. I wish I saw them used more often!
Quantum AI
Published: 2022-09-10 01:20:12

Quantum AI around the corner trend highlights:
The recent Google announcement of achieving quantum supremacy points to a time when quantum AI would take its rightful place among business and personal spheres.
Quantum AI will usher in tremendous possibilities hardly possible with current computing systems.
We are not even into full qubit computing yet, and another computing system based on so-called qudits is already in the works.