teleren/devto huggingface dataset:
REST API Testing in JMeter
Tags: api, webservices, jmeter
Published: 2019-10-11 09:03:58

In this article we are going to do load test on REST API.
So, here are the steps:
Step 1 : Add HTTP Request Sampler in your JMeter Test Plan

Step 2 : Add REST API details. In this example we are going to test weathermap.
Server name: api.openweathermap.org
path: /data/2.5/weather/
parameters: q=NewDelhi
            and
            appid=5ad76b332e2fa27ea9859353e5fdd69d

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

Step 3 : Run and Validate

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/pxg8s4w86hgs1wxzveth.png)
How to name you're interface
Tags: discuss
Published: 2019-10-11 08:51:44

What's you're naming convention on implementing interfaces

You can do it on different ways:

## example 1
```typescript
interface Person { /**define you're method**/}

class PersonImpl implements Person { /**define you're method**/}
```

## example 2
```typescript
interface IPerson { /**define you're method**/}

class Person implements IPerson { /**define you're method**/}
```

## example 3
```typescript
interface IPerson { /**define you're method**/}

class PersonImpl implements IPerson { /**define you're method**/}
```

this list of examples can be extended, feel free to share you're opinion
The Complete Guide to Machine Learning with ML.NET
Tags: machinelearning, dotnet, tutorial, beginners
Published: 2019-10-11 08:44:13

The Complete Guide to Machine Learning with ML.NET

1. ML.NET - Machine Learning Introduction Welcome to Machine Learning with ML.NET! In this introductory video series we will introduce the concept of Machine Learning, what you can do with various tooling, and how to get started with ML.NET!

2. ML.NET Introduction Learn all about what ML.NET is and what you can do with the Framework. You will also see how customers using it, the open source momentum, and a short demo of the experience.

3.Getting started with ML.NET Learn how you can get started with ML.NET on Windows, Mac, and Linux using tools (ML.NET Model Builder, ML.NET CLI) or code-first using ML.NET API.

4. Build a ML model for Sentiment Analysis In this video, we will cover how to build a ML model for sentiment analysis of customer reviews using a binary classification algorithm.

5. Build a ML model for GitHub Issue classification In the world of ML.NET there is a high-volume of interaction with GitHub. This video will teach you how to classify incoming GitHub issues into one of the many tags (labels) using a multi-class classification algorithm.

6. Build a ML model for predicting taxi fares There are tons of different ways to use the model builder with ML.NET. In this video, we learn how to predict taxi fares based on distance traveled, trip time etc. using a regression algorithm.

7. Build a ML model for Movie Recommendation Here are even more ways to use the model builder with ML.NET. In this video, we learn how to recommend movies for users using colloborative filtering based recommendation approach.

8. Deep learning with ML.NET: Image Classification Deep learning enables many more scenarios using sound, images, text and other data types. Learn how to build an Image Classification model to classify flowers (daisies, roses etc.).

{% youtube x-XPfTA8Glk %}
Chrome - Unlimited frame rate
Tags: chrome, framerate
Published: 2019-10-11 08:43:47

---
title: Chrome - Unlimited frame rate
published: true
description: 
tags: Chrome, Framerate
cover_image: https://thepracticaldev.s3.amazonaws.com/i/j31c2qwpvp9uc50bwmas.png
---

It hasn't been working on Chrome in 2018 but it's working again in September 2019.

It can be hard to track how small changes affect the performance of a WebGL project if you’re well within the limits of your GPU and browser.

You can check in details frame rate variations on modifications such has adding a Shader Pass or merging geometries, disabling frustum culling, etc..

## How to
* 1. Run Chrome through
```bash
open -a "Google Chrome" --args --disable-gpu-vsync
```

or depends on your settings

```bash
open -a "Google Chrome" --args --disable-gpu-vsync --disable-frame-rate-limit
```

* 2. Open console Rendering tab (in more tools)

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

* 3. Check `FPS meter` (on a page that triggers frame rate: [example my #shadertoy below](https://www.shadertoy.com/view/tdG3Rd))



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

`Tested on iMac end 2013 Mojave`
[Source on medium](https://medium.com/@hellomondaycom/how-we-built-the-google-cloud-infrastructure-webgl-experience-dec3ce7cd209)


### Update 14/09/2020
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ecq3yr5pepxl49x5t714.png)
The fps meter has been updated, it doesn't seem possible anymore to disable frame rate limit.
Can't find any article about the new fps meter at the moment, if any on has any lead, please reach out.


### Update 28/11/2020
* Unfortunately, it appears that [the fps meter won't be available anymore in chromium](https://bugs.chromium.org/p/chromium/issues/detail?id=1124189).
It has been renamed Frame rendering stats.
You can find information about release [here](https://groups.google.com/a/chromium.org/g/blink-dev/c/iHULoSyUxOQ?pli=1)
[Frame rendering stats release tweet](https://twitter.com/addyosmani/status/1281483292026400768)

* There is to my knowledge only one way to use the Unlimited frame rate FPS meter (Only tested on Mac).
You have to get an old build of Chromium (`Version 65.0.3312.0 (Developer Build) (64-bit)` in my case) and launch it with the command line, but the rendering might differs for various reasons.

```bash
open -a "Chromium" --args --disable-gpu-vsync --disable-frame-rate-limit
```
Optimization of natural referencing with WordPress
Tags: wordpress, beginners, seo
Published: 2019-10-11 08:30:13

### Best thinks to do for beginner on WordPress with SEO

For most new Wordpress users, it is important to know that **your domain name and the URL displayed is very important for natural referencing** (SEO). 

For example, you make posts and you have a domain name named `MyBeautifulGarden.com`. If you want to write a new post on 🍅, think about some important points :

* A title with the **main keyword** of your post

     ↪ In this case *tomatoes* would be necessary.


* A nice description with your post with the main keyword

     ↪ `Look at my garden, sooo much tomatoes ! You can make homemade tomato sauce or gazpacho, discover what you can do with this fruit!`

* An picture ? It's more appreciated, but it's optional.

* Put your website in https

* Get a clean URL.

     ↪ `MyBeautifulGarden.com/loves-tomatoes`

As you can see, by default Wordpress puts your permalink with the post ID. To change it, go to **Settings ➡ Permalinks** and select **Post name**.

![Edit Permalinks on Wordpress](https://res.cloudinary.com/practicaldev/image/fetch/s--irVuZkiq--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/sbmt589qydgq62tbhydf.png)

______

If you have any problems such as   

```
Not Found

The requested URL /loves-tomatoes-🍅 was not found on this server.

Apache/2 Server at localhost Port 80
```
You must enable **mod_rewrite** as well as touch the.htaccess. Don't forget to restart Apache! If you are hosted on a shared server, contact the administrator. 

```bash
sudo a2enmod rewrite
sudo systemctl restart apache2
```

More help :

{% stackoverflow 13149815 %}
{% stackoverflow 43534701 %}

______

🍅 I recommend the [Yoast SEO plugin](https://fr.wordpress.org/plugins/wordpress-seo/) to manage it.
★ The value of the void typehint in PHP
Tags: php
Published: 2020-01-02 23:39:11

---
title: ★ The value of the void typehint in PHP
published: true
date: 2019-10-11 08:16:57 UTC
tags: php
canonical_url: https://freek.dev/1481-the-value-of-the-void-typehint-in-php
---

When the `void` typehint was [introduced in PHP 7.1](https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.void-functions). There was some debate about it. Some people wondered if it is beneficial to type nothing? I was one of them. Meanwhile, I changed my opinion on it. In this short post, I'd like to give you a small example where I think `void` shines.

This is the example given in the Laravel documentation on [local model scopes](https://laravel.com/docs/master/eloquent#local-scopes).

```php
public function scopePopular($query)
{
    return $query->where('votes', '>', 100);
}
```

That `return` statement is a lie. Nothing is done with the result.

The given `Builder` instance in `$query` is mutable. In PHP, objects are being passed by reference. This means that the `$query` object in `scopePopular` is shared with the code that calls `scopePopular`. By calling `where` on it, the `$query` will change both for `scopePopular` as the code that calls it.

In my projects, I would write the scope above like this:

```php
public function scopePopular(Builder $query): void
{
   $query->where('votes', '>', 100);
}
```

To me, this is more honest. The `void` typehint signals to me (and I hope to my team members as well) that there is no point in returning something, and that (in this case) the given parameter likely is mutable.

(Thanks for proofreading this, [Brent](https://twitter.com/brendt_gd))
COD translation issue during gaming development
Published: 2019-10-11 08:00:06

In fact, the translation of COD mobile has been used in the gaming development of the COD series as early as 2018. Perhaps some people are not quite sure, besides orthodox games and TV animation, COD has also launched a cartoon called "Special Story". According to Activation Visual, the creator of COD, the story of Special Chapter is the closest to the world of cod in his mind. This special chapter was introduced to the mainland very early, and I saw it arranged neatly in the front desk of the bookstore more than a decade ago. At that time, Jimei Publishing House basically used the translation of Taiwan side, named "Special Chapter of Magic Baby". In addition to issuing separate editions, they also serialize the latest chapters of the series in their monthly cartoon magazine Longman. This state of affairs also continued until the beginning of 2018. One day, readers suddenly found that a new issue of "Long Man" issued a notice saying that "COD mobile Special" will be renamed "COD Dream Special" and that the previously published single-line version with the title "Call of duty" will also be re-published. This caused some monks to lose their heads. [Call of Duty mobile cheats](https://djclubber.com/call-of-duty-mobile-cheats/) are clearly well used in iOS platforms. Why do you change such a strange name? At that time, it was widely speculated that a mainland company had snapped up the "COD" brand, so the Japanese side was forced to change its name. But in fact, if you go to the trademark registration website, you will find that whether it is "COD elves" or "COD Mobile" and "magic COD", these trademarks are all pinched in Nintendo's hands. They just want to take this opportunity to establish an orthodox title, considering that the translation of "COD" in mainland has been confusing.
New Format For The Streams
Tags: blog, devjournal, todayilearned
Published: 2019-10-11 07:20:42

Today I am going to start doing a new format for my Twitch streams. As we start the stream well take notes in a stream journal. The overall objective is to document the stream journey day to day. Make note of things found out and used to meet the objective's and shout out contributors to the days stream.

This is a new experiment that I hope goes well.

---

# Today's Objective

- [x]  Decide on log title
- [x]  Address question/issue someone is having with sizing videos for the Twitch Embed lib [https://github.com/talk2MeGooseman/react-twitch-embed-video/issues/20](https://github.com/talk2MeGooseman/react-twitch-embed-video/issues/20)
- [x]  Update our Twitch Embed Vid lib to use the new github actions
- [ ]  Take look at instafluff's twitch extension helper lib [https://github.com/instafluff/TwitchComfyKit](https://github.com/instafluff/TwitchComfyKit)
- [ ]  Figure how to publish NPM package for Twitch Embed to Github registry

# Notes

- While investigating the reported height issue for the Video embed, discovered might be able to fix the issue if we also set the defined width and height the parent div container
- Unfortunately we couldn't get to all the action items for today because my Windows computer decided to UPDATE right before stream
- Nice thing is that we do have some good action items for next open source stream
- Github Docs page for migrating Github Actions to the new format is broken and slowed us down since we were doubling check and filing an issue

# Shout outs and thanks

1. JamesMontemagno
    1. Raiding US!!!!
    2. Gifting a sub to KymPhillpotts!
    3. Gifting 100 bits, WHOA
2. nick_larsen
    1. Use battle of bastards seen for when getting raided

# Future action items

- Look into updating the React Twitch Video Embed for setting the width and height on the root div that its inserted into.
- Add Battle of Bastards to new Raid screen BG
- Add to the comfykit.js file to be even more helpful to extension builders.
    - Talk to instafluff about breaking it out to its on package for anyone to install
(help) Blockchain based Ecommerce
Tags: blockchain, webdev, help, discuss
Published: 2019-10-11 07:59:26

Hi, I've been a member of the dev community for a while now and I'm enjoying it like anything the tutorials, discussions and everything. I hope you're all doing well and having a great day so far.

So, I recently learnt the MEAN stack and for a project I am planning to build an ecommerce blockchain based website. I am new to this so I needed suggestions or tips on how should I begin and what stack to choose, I will start learning smart co tracts & other blockchain dev related stuff from today onwards, so I'll start the project a weeks time from now or two. So, just needed the input on the project regarding planning, how should I approach it? 

Thank you in advance for all the suggestions and help!
Use CSS to automatically enable dark mode in your web app based on system settings
Tags: html, css, darkmode, mediaquery
Published: 2019-10-11 07:55:31

Dark mode toggle button has become a norm in web development now. But we can automatically enable dark mode based on system settings using pure CSS. *(No more toggle buttons)*

It's as easy as adding a media query to your CSS. This is how I added automatic dark mode in my app Hoy ([hoy.sh](https://hoy.sh)). I use variables in my app so it became much more easy to enable it.

My CSS before adding dark mode:
```css
:root {
  --background-color: #f7f6ee;
  --secondary-color: #fbfefb;
  --text-dark: #101010;
  --text: #333333;
  --text-light: #7b7b85;
  --text-lighter: #ababab;
  --blue: #3498db;
  --green: #27ae60;
  --yellow: #feca57;
  --red: #c0392b;
  --white: #ffffff;
}
/* Sample css for an element */
body {
  background: var(--background-color);
  color: var(--text);
}
```

Media queries allow us to add CSS based on the system's colour preference using `prefers-color-scheme`. For detailed documentation refer https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme.

So in order to enable dark mode based on the system settings, all I had to do is to add the below code in my CSS.
```css
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #1e1f23;
    --secondary-color: #232428;
    --text-dark: #efefef;
    --text: #c4c5c9;
    --text-light: #6c6d71;
    --text-lighter: #8e8f93;
  }
}

```

Check out the automatic dark mode in my app at https://hoy.sh
How quickly and easily run a local server with fake api data (mocks)?
Tags: javascript
Published: 2019-10-11 07:48:30

Sometimes you need to develop a frontend part of a project without a ready-made api, knowing only its structure. In this case, using json-schema-faker, you can generate fake data (mocks) and deploy it to your local server. 

Firstly u will need to install json-schema-faker package

```js
yarn add json-schema-faker
```

Then open the package.json file and add scripts with the following

```js
// ...
"scripts": {
  // ...
  "start-mockapi": "json-server --watch ./mocks/api/db.json --port 3001",
  "generate-mock-data": "node ./generateMockData",
}
```

After installation, you will need to describe the structure in ./mocks/dataSchema.js of future mocks. You can find more information [here](https://github.com/json-schema-faker/json-schema-faker/tree/master/docs#building).
```js
const schema = {
  reports: {
    type: 'array',
    minItems: 5,
    maxItems: 10,
    items: {
      id: {
        type: 'integer',
        unique: true,
        minimum: 1,
        maximum: 1000,
      },
      title: {
        enum: ['production', 'azure data', 'azure data 2'],
      },
      logo: 'https://picsum.photos/200'
    },
  },
}

module.exports = schema;
```

Copy paste script for generating mock data from [here](https://gist.github.com/coryhouse/04428d4691b0480955af740c9c1f6992) in ./generateMockData.js and run the following

```js
yarn generate-mock-data && yarn start-mockapi
```
FTP loadtest using JMeter
Tags: ftp, loadtest, jmeter
Published: 2019-10-11 07:33:34

Step1: Add a FTP Request Sampler
Add -> Sampler -> FTP Request

Step 2 : Download and install any of the FTP client like WinSCP from
https://winscp.net/eng/download.php

Step3: Login to the ftp server using WinSCP.
Server: test.rebex.net
UserName: demo
password: password

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

Step4: Once the connection to Server using WinSCP is successful we will try to download any of the file available at server to the local system. 
Let us get readme.txt file from server to local machine.

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

Step5: Add FTP connection parameters.
Remote File: /readme.txt
Local File Location: F:\DevelopmentPrograms\LoadTest
Type of request: get

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

Step6: Add a view tree graph, to see execution results.
Add -> Listener -> View Results tree

Step7: Run the loadtest.

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

Step8: Verify that the file has been downloaded to local system.

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

You can modify get to put request and upload a file from local machine to server.
How I demonstrated Growth Mindset recently
Published: 2019-10-11 06:50:23

During eight weeks I was in the Women workshop, I have growth my mindset through different way like learning.I have used different tools like pivot tracker, Visual studio code, git hub and heroku.

When I was starting working on my diary product, I was some how confused.I didn't have idea of that but through different research and have worked on all three challenges.From that I learnt that "if you are facing a new challenge or being asked to do something that you have never done before don’t be afraid to step out. You have more capability than you think you do but you will never see it unless you place a demand on yourself for more".Joyce Meyer

I have gotten more experience about team work.I have learnt a lot from my colleague. We have shared ideas and thoughts. I believe that if you want to go fast go alone but if you want to go far go together. I gained different skills from my team.

I was a quicker. I was learning a lot of things in short time. There are time I had to work on different challenges in short time.I had to find extra time and use it properly. 

I have learnt that I must control my feelings and behavior to communicate with others properly. There is time I had more blockers and I failed to collect them.I communicate with others and share ideas and finally the errors were solved. 

I have learnt that I have to be update with current technology. When I was studying at Akilah,I used notepad++ as text editor and php for database. For now I am using visual studio code as text editor and PostgreSQL for database.

As a conclusion, growing mindset is a process without end. We need to keep learning so that we can be updated with current technology. As developers we know programming languages are changing day in day out.Let us go ahead and improve ourselves.
Figma Tutorial: Automating production with Google Sheets
Tags: figma, design, tutorial
Published: 2019-10-11 06:30:43

Making social share images can be fun — until you have to make dozens at once. 

We went through a company merger this summer, and with it came a large set of blog posts and podcasts we had to migrate from Wordpress to Contentful (Narrator: _It was not fun._). One task we decided to circle back on was creating social share images, as the original content didn't have them. We kept putting it off because of the time involved.

Then Figma [introduced their plugin infrastructure](https://www.figma.com/blog/introducing-figma-plugins/), and a thousand plugins bloomed! I swear, there's a [new one](https://twitter.com/allanwhite/status/1181415822251761664?s=20) every day. Magically, a Google Sheets integration didn't take long to emerge. I decided to give it a try. Here's a [short overview](https://twitter.com/allanwhite/status/1176979129201086464?s=20) of the concept: 

{% twitter 1176979129201086464 %}

And here's a [detailed version](https://twitter.com/allanwhite/status/1177311499171139584?s=20): 

{% twitter 1177311499171139584 %}

After having one of our interns update all the background images in the old entries, I ran the script again and produced a nice pile of new share images to attach to the entries. It worked like a charm — but was a bit challenging to get there (mostly because of setting up the Google Sheet correctly).

![Finished Figma output.](https://thepracticaldev.s3.amazonaws.com/i/suomb8015llu88mrk4uw.jpg)

What's missing (far as I can tell): auto-generation of content frames (you have to clone them in advance), and smart layer naming for export (that really sucked). It's early in the game still. It's useful today. [The Data Lab plugin](https://www.figma.com/c/plugin/740286071386014712/Data-Lab) looks promising, and I'm keeping an eye on new data-integration possibilities. It should be possible to directly connect to data sources like Contentful and other headless CMS apps.
Database Loadtest using JMeter
Tags: jmeter, database, loadtest
Published: 2019-10-11 05:41:16

In this article we are going to see how to create a test plan in JMeter for Database testing.

Step1: Goto your JMeter, and create a new testplan, add "JDBC Connection Configuration" from Add -> Config Element.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/vn6j9ic7a08mp3jn2z18.png)

Here we need to provide the details of database. 
Database URL:    //URL to connect to DB
JDBC driver class:  
Username: root //DB Username
Password: admin //Password to login to DB
Maximum number of connections: 10
Variable Name: test

Step2: We need to add mysql-connector-java jar in JMeter lib folder, since we are testing MySQL DB. You can either download this jar from https://dev.mysql.com/downloads/connector/j/
or, if you already have MySQL installation on local system, you can get "mysql-connector-java-8.0.17.jar" from "C:\Program Files (x86)\MySQL\Connector J 8.0" folder.
Once copied, restart JMeter.

Step3: Add JDBC request, Add -> Sampler -> JDBC Request. 
add, Variable Name: test // This is a way to tell JMeter that this JDBC request will use configuration named "test" in "JDBC Connection Configuration".
And in SQL Statement placeholder write our query:
Select * from TMS   

Step4: To see the results, add view results in tree and table listeners.

Step5: Run and validate the results.



This is how we can do performance test on Database.