teleren/devto huggingface dataset:
PHP 8 in 8 code blocks
Tags: php, php8
Published: 2020-05-15 09:30:59

---
title: PHP 8 in 8 code blocks
published: true
date: 2020-05-15 00:00:00 UTC
tags: php, php 8
canonical_url: https://stitcher.io/blog/php-8-in-8-code-blocks
---

PHP 8 brings lots of new features, in this list we'll look at the most outstanding ones. If you want a full list and background information, you can read about all things [new in PHP 8](https://stitcher.io/blog/new-in-php-8).

* * *

```php
use \Support\Attributes\ListensTo;

class ProductSubscriber
{
    <<ListensTo(ProductCreated::class)>>
    public function onProductCreated(ProductCreated $event) { /* … */ }

    <<ListensTo(ProductDeleted::class)>>
    public function onProductDeleted(ProductDeleted $event) { /* … */ }
}
```

Attributes — aka annotations — you can about them in depth in [this post](https://stitcher.io/blog/attributes-in-php-8).

* * *

```php
public function foo(Foo|Bar $input): int|float;

public function bar(mixed $input): mixed;
```

Union types allows for type hinting several types. There's also a new `mixed` type which represents [several types](https://stitcher.io/blog/new-in-php-8#new-mixed-type-rfc) at once.

* * *

```php
interface Foo
{
    public function bar(): static;
}
```

The `static` return type is built-in.

* * *

```ini
[JIT]
opcache.jit=5
```

[The just-in-time compiler](https://stitcher.io/blog/php-jit) for PHP.

* * *

```php
$triggerError = fn() => throw new MyError();

$foo = $bar['offset'] ?? throw new OffsetDoesNotExist('offset');
```

`throw` can be used in expressions.

* * *

```php
try {
    // Something goes wrong
} catch (MySpecialException) {
    Log::error("Something went wrong");
}
```

Non-capturing catches: no need to specify an exception variable if you don't need it.

* * *

```php
public function(
    string $parameterA,
    int $parameterB,
    Foo $objectfoo,
) {
    // …
}
```

Trailing commas are allowed in parameter lists

* * *

```php
str_contains('string with lots of words', 'words');

str_starts_with('haystack', 'hay');

str_ends_with('haystack', 'stack');
```

New string functions.

* * *

Let's not fool ourselves: 8 code blocks isn't enough to summarise all great new things in PHP 8. If you want a full list, you can find it [on my blog](https://stitcher.io/blog/new-in-php-8).

What feature are you looking forward to the most? Let me know on [Twitter](https://twitter.com/brendt_gd) or via [email](mailto:brendt@stitcher.io).
Learn supervised machine learning with my free interactive course
Tags: machinelearning, datascience, rstats
Published: 2020-05-18 04:44:34

---
title: Learn supervised machine learning with my free interactive course
published: true
date: 2020-05-15 00:00:00 UTC
tags: machinelearning, datascience, rstats
canonical_url: https://juliasilge.com/blog/tidymodels-ml-course/
---

I am happy to announce that a new [tidymodels](https://www.tidymodels.org/)-centric version of my free, online, interactive course, [**Supervised Machine Learning: Case Studies in R**](https://supervised-ml-course.netlify.app/), has been published! 🎉

![](https://juliasilge.com/figs/2019-09-23-supervised-ml-course/ml-course.png)

This is at least the third version of this course I’ve built at this point 😁 but I believe it to be the best, in terms of how it communicates machine learning concepts and how useful to your real-world problems the demonstrated code will be. Huge thanks to my RStudio teammates such as Alison Hill and Max Kuhn for their feedback during the editing process! Similar to [the last time I launched this course](https://juliasilge.com/blog/supervised-ml-course/), it provides four case studies using data from the real world for you to practice your predictive modeling skills.

## Supervised machine learning in R

One question we sometimes field from R users is about choosing to use tidymodels vs. caret. The original version of my course mostly used caret, and caret is a stable and broadly used framework for modeling and machine learning in R. Although new development for our team is focused on tidymodels and I personally am spending my time only on tidymodels projects, I know that there may be folks out there who want to learn from the original version of the course. The original, caret-centric version of the course [will continue to be available at a different URL](https://caret-ml-course.netlify.app/).

Revamping this course, built on the amazing framework created by [Ines Montani](https://ines.io/), yet again has given me an opportunity to revisit the course development process and reflect on what I’ve learned. I have a post for the [RStudio Education blog](https://education.rstudio.com/blog/) in the works, and will publish that soon.

The back-end code execution uses [Binder](https://mybinder.org). It can take a little while for Binder to spin up a new Docker container the first time you run a code exercise in a new session, so be patient when that happens! ⏳

## Try it out

As the [tidymodels](https://www.tidymodels.org/) ecosystem continues to develop, we are excited to have more resources for folks looking to learn, whether that’s [articles on getting started](https://www.tidymodels.org/start/) or a [course like mine](https://supervised-ml-course.netlify.app/). Contributions and comments on how to improve my course are welcome! Please [file an issue](https://github.com/juliasilge/supervised-ML-case-studies-course/issues) or submit a pull request if you find something that could be fixed or improved.
Made With ML - discover, learn and build ML
Tags: machinelearning, datascience
Published: 2020-05-14 23:29:21

Hey everyone,

I wanted to share a free platform I built about a month ago called Made With ML. It's a one-stop platform to discover, learn and build all things
machine learning.

https://madewithml.com/

There are currently three main pages on the platform:

• 🔖 Collections - meaningful ways to organize ML content: https://madewithml.com/collections/
• 🗂 Projects - stay up-to-date with trending/niche projects by the community: https://madewithml.com/projects/
• 📚 Topics - the best resources by topic (community curated and automatically updated): https://madewithml.com/topics/

We have several thousand active users, nearly 1000 projects and it's growing everyday. We'll always be 100% free and it's becoming the goto place to keep up with ML. Here's how our users are using the platform:

• 📆 Stay up-to-date with trending and niche Projects added by the community.
• 🔍 Discover the blog posts, code, research, videos, demos, etc. that accompany the many projects.
• 🔖 Organize the projects that you find interesting with Collections (like Spotify playlists).
• 🌎 Share your own and others projects for the community to discover forever.
• 📚 Learn from the Topics page - a highly curated and auto updating collection of the best resources.
• 💻 Build your Profile to use as a dynamic resume and for collaboration with others.

So create your free forever account today at https://madewithml.com and if you'd like daily updates, follow us on:
• Twitter: https://twitter.com/madewithml
• LinkedIn: https://www.linkedin.com/company/madewithml/
Day 138 : Encore
Tags: hiphop, code, coding, lifelongdev
Published: 2020-05-14 23:05:15

_liner notes_:
- Professional : What a day! Got up around 3 this morning so I could do a quick test of my slides before our online conference started at 6am. I was able to do a quick test and then made some changes to my slides. Did I mention that my internet went out for some reason? Freaked out, but hoping it would come back, I practiced a couple of more times and got ready for the day. The event starts and I'm watching some great talks while at the same time, I'm nervous about my talk. My talk is pretty early on, so I didn't have to be nervous for long. Did my talk and got really good feedback in the event chat and a bunch of messages on our Slack workspace. One of my goals for my talk was to get people interested in Web Components and that was what the messages were saying. Also got some really great questions afterwards. Once my talk was over, I was able to enjoy all the other amazing talks. In total it was 12 hours of greatness!! haha Even had some folks about an encore and when the next one will be. Also, shouts to my homie Mave who joined the event and left some awesome feedback that got turned into a tweet by the team. You can check it out here:
![Feedback about my talk from my friend Mave - Vonage Developer Day was awesome. Dwane gave great advice to focus on knowing Web Components before learning web frameworks. He also provided some excellent resources!](https://dev-to-uploads.s3.amazonaws.com/i/b58m26vik4b9pj1ojv54.jpeg)

- Personal : Studied some Japanese but mostly spent the night working on my presentation.

![Striped caverns of Antelope Canyon in Arizona with a single ray of light shining through.](https://dev-to-uploads.s3.amazonaws.com/i/ltrxw7eaw1vk0x5tqoc7.png)

Right now, my brain is so fried! haha Going to get something to eat, study some Japanese, maybe go through some tracks for the radio show and go to sleep.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube DLlF2FMv968 %}
Worker Cooperatives in Tech
Tags: cooperative, democracy, ownership, business
Published: 2020-05-14 22:44:39

First off, what's a *worker cooperative?* [Worker co-ops](https://riceo.org/resources/learn-about-co-ops/) are businesses owned and run by the people who work in them. Each member of the co-op owns one share and has one vote and gets a share of the profits by the end of each year.

Simply put, worker cooperatives are defined by shared ownership and workplace democracy.

Now how do they relate to tech? Interestingly, worker co-ops have been around since at least the nineteenth century. But recently, they've been making a comeback. And as it turns out, this business model is perfect for the tech industry, and here's why.

## The 8-hour workday
When the US passed the 8-hour day into law in 1938, this was a radical change for the many employees across the country working 10 hours, 12 hours, 14, or more. Fast forward about eighty years and we find ourselves in a situation that is ripe for change, especially for tech workers.

For many developers, the 8-hour day just isn't practical anymore. We find ourselves mentally fatigued long before the digital clock strikes 5:00. That's why a lot of our offices have video games or other activities to do throughout the day: we have too much time on our hands!

If we worked cooperatively with one another, we could democratically decide how long our workday should be. And if we all had the ability to do this today, I'm certain most of us would not choose an 8-hour day. We might decide 6 hours is sufficient or even 5 hours. (What do you think? Leave a comment below.)

## Mobbing IRL
[Mob programming](https://www.agilealliance.org/glossary/mob-programming/#q=~(infinite~true~filters~(postType~(~'page~'post~'aa_book~'aa_event_session~'aa_experience_report~'aa_glossary~'aa_research_paper~'aa_video)~tags~(~'mob*20programming))~searchTerm~'~sort~false~sortDirection~'asc~page~1)), or mobbing, is a development approach where a team of people works on the same task at the same time, each taking turns with the keyboard and mouse.

Mobbing can be a very effective tool for making high-quality, reliable code in groups. It's this mode of working cooperatively and by consensus which yields that high-quality software. A worker co-op, then, is a lot like a mob, except the mob runs an entire business.

## If Apple were a worker co-op...
In 2014, Forbes published [an article](https://www.forbes.com/sites/cameronkeng/2014/12/18/if-apple-was-a-worker-cooperative-each-employee-would-earn-at-least-403k/#4c3427782dee) that explored a hypothetical scenario in which Apple is a worker-owned cooperative. They found that if it were one, every Apple employee would earn *at least* $400k a year. In today's world, the profits go to the shareholders instead of the people who generated those profits: the employees.

## Still a skeptic?
[Mondragon](https://www.mondragon-corporation.com/en/) is the largest and most successful worker co-op in the world and employs around 75,000 people. Their work spans several industries, including manufacturing, retail, banking, and... software.
Adding a cover image to your dev.to articles
Tags: blogging, coverimages, article
Published: 2020-05-14 22:40:27

---
title: Adding a cover image to your dev.to articles
published: true
description: "Photo by Austin Distel on Unsplash"
tags: #blogging, #coverImages, #article
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/a8c7m9up8jcpa2zuycnk.jpg
---
_Photo by Austin Distel on Unsplash_

I ran into some cover image issues when I started writing on dev.to not until I came across an article about how to add cover picture/image to your article so that prompt me to write this article to help whoever that might need it. 

**Note**: adding a nice cover image to articles is very essential and you can do that on dev.to by adding a cover_image: entry to that block at the top. For example, the block for this post should look like this:

```
---
title: Adding a cover image for your dev.to articles
published: true
description: "Photo by Austin Distel on Unsplash"
tags: #blogging, #coverImages, #article
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/a8c7m9up8jcpa2zuycnk.jpg

---
```
Get a nice picture/images maintaining the ratio of 1000x420 pixels for better resolution.

> Thank you for reading.
Setting up a Python Virtual Environment in Windows
Tags: python, windows, cmd
Published: 2020-05-14 22:32:06



#Introduction
Python, like most other modern programming languages, has its own unique way of downloading, storing, and resolving packages (or modules). While this has its advantages, there were some interesting decisions made about package storage and resolution, which has lead to some problems—particularly with how and where packages are stored.

#What is a virtual environment?
A virtual environment is a tool that helps to keep dependencies required by different projects separate by creating isolated Python virtual environments for them. This is one of the most important tools that most of the Python developers use.

##Prerequisites:
1. Python3 installed

##Let's Get Started

![Minion](https://media1.giphy.com/media/Ln2dAW9oycjgmTpjX9/giphy.gif)


###1.Installing Virtualenv

####Open command prompt and type in the following command:

**`pip install virtualenv`**


###2.Create a Virtualenv
 
####Go to the project directory say path/to/project:

**`cd path/to/project`**


####Once inside the project folder run to create a virtualenv named 'myvenv': 

**`virtualenv myvenv`**


###3.Start the Virtualenv

####In the same directory type the following to activate the virtual environment:

**`myenv\Scripts\activate`**


###Hurray! We are in our virtual environment!
![Hurray](https://media.giphy.com/media/229OX0vSVNys10AZnS/giphy.gif)

####Now you can install packages relevant to a particular project which would be confined to this virtual environment only!

###4.To deactivate the Virtualenv run the following command:

**`deactivate `**

####Note: Whenever you are running any packages make sure the venv is active
Shop VinWonders Phú Quốc
Published: 2020-05-13 15:59:48

SỞ HỮU SHOPHOUSE SIÊU ĐỈNH TẠI VINWONDER PHÚ QUỐC CHỈ TỪ 1,5TỶ KHU VUI CHƠI GIẢI TRÍ LỚN NHẤT ĐNA
<a href=" http://vinarealhomes.com/shophouse-vinwonders-phu-quoc/
" rel="dofollow">SHOP VINWONDERS PHÚ QUỐC</a>
Sở hữu shophouse siêu đỉnh tại Vinwonder Phú Quốc chỉ từ 1,5 tỷ.

Nằm ngay mặt tiền đường khu vui chơi lớn nhất Đông Nam Á Vinwonder Phú Quốc kế thừa tiện ích đầy đủ và lượng khách dồi dào đến với Phú Quốc hằng năm.
Tiếp nối những công trình thành công tại Phú Quốc Vingroup tiếp tục ra mắt dòng sản phẩm shophouse chất lượng từ những toà lâu đài cổ kính - hấp dẫn mọi du khách khi đến với Phú Quốc - với thiết kế nhỏ gọn lạ mắt với giá bán vô cùng hấp dẫn - rất dễ dàng để NĐT lựa chọn cho mình một ngôi nhà thứ 2 và một nơi kinh doanh phù hợp sầm uất nhất Phú Quốc.

Số lượng căn: Hơn 200 căn siêu vip.
Số lượng tầng dự kiến các loại 2,3,4 tầng/căn.
Gồm 3 loại diện tích đất: 5x9m, 5x10m, 5x15m.
Bàn giao: 6/2020 - theo chuẩn bán lâu đài.
Giá dự kiến: 5 tỷ/căn + chính sách hỗ trợ vay 70% miễn lãi suất.
<a href=" http://vinarealhomes.com/" rel="dofollow">SHOP GRAND WORLD PHÚ QUỐC</a>
Quý nhà đầu tư LH  để nhận thêm thông tin mới nhất về dự án, tư vấn chuyên sâu và tham quan thực tế. (kết nối Viber, Zalo, Line... 24/7).
Liên hệ ngay.
Create Perfectly Sized Cover Images for Dev.to
Tags: python, showdev, wordpress, meta
Published: 2020-05-14 21:33:25

As a heads up, I'm making this post as a plug for my Image Titler tool that I've been developing in my spare time for a little over a year now:

{% github TheRenegadeCoder/image-titler %}

Basically, it's a Python tool for generating cover images with titles on them. I originally developed it to speed up the process of creating featured images for my own website, but now I'm trying to get it in front of a larger audience.

To do that, I recently added a feature in v2.3.2 that automatically resizes and crops images for the dev.to platform (1000x420). Here's a demo of the GUI using the image from this article:

![Image Titler 2.3.2 DEV Demo](https://dev-to-uploads.s3.amazonaws.com/i/fka5puk774fv0ebnjgej.png)

If you're interested in using this tool yourself, grab the latest version of Python (3.8+) and run the following commands:

```shell
pip install image-titler
image-titler-gui
```

That'll launch up this tool, so you can begin making your own cover images. When you're done, feel free to let me know what you think!
HTML Tags you should know when learning how to code.
Tags: firstarticle, html, beginners
Published: 2020-05-14 21:31:33

---
title: HTML Tags you should know when learning how to code.
published: true
description: 
tags: first article,HTML,beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/rwzrs8agkdc5xv6r1b9v.png
---

I assume you already know what HTML is. In case you're just learning HTML, you can read more about that here. _[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML)_. 

<title> - The HTML Title element defines the document's title that is shown in a browser's title bar or a page's tab. It only contains text tags within the element are ignored. For Example:

`<title>Grandma's Heavy Metal Festival Journal</title>`

Link - It's used for linking CSS external links to the document. href is the path the file

`<link href="css/main.css" rel="stylesheet">`

header - Defines a header for a document or section, 
_Navigation inside header_

###Lists
ul - The ul tag defines an unordered (bulleted) list. Use the ul tag together with the li tag to create unordered lists. These tags are very important whenever you want to create a list item dynamically in Javascript apps like React apps.

ol - An ordered list—the order of the items is important, Could be alphabetical, numerical. etc. It can only have li elements as direct children.

li - A single list item, it must be inside a ul, ol, or menu. It can have most other elements inside it.
Most commonly used HTML tags other than the ones we've written are as follows:


* body - The page's content.
* h1 - A section heading.
* p - A paragraph.
* a — A link.
* img - An image.
* div — A block-level container for content.
* span — An inline container for content.
* head — The document head.
* HTML — The root element.


Resources Used: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML),[W3schools](https://www.w3schools.com/html/default.asp)




> Thanks 🙌 for reading and good luck with your coding journey!
> Please share this article with your fellow devs if you like it!
A minimal example of JCL
Tags: jcl, mainframe, ibm, legacy
Published: 2020-05-14 20:23:30

During these weird days of pandemic, I have read a lot of fun and interesting affairs about **COBOL** language for a while time I decided to get a bit into the detail of language and discovered that in the actual world of Mainframe not is banal getting productive and make the things work into the fascinating world of "Big Irons".

One of the most important and significative tools that every Mainframe expert should be mastering is **JCL**.

**JCL** is the acronym of **J**ob **C**ontrol **L**anguage a declarative scripting language that allows application developers for literally talking with the z/OS, the operating system for mainframes.

Usually, a single **JCL** row is structured with 5 essential columns filled with fixed order and first three mandatory:

  **1)** Double slashes (//) for start job.
  **2)** A Job name. 
  **3)** An operation instruction.
  **4)** Parameter instructions.
  **5)** Comments, indicated with /* symbol in start line as well.

A simple **JCL** script that prints a Hello World string using the IBM copy program called **IEBGENER** looks like this:

```
  /* Start of JCL Job 
  //JCLPRGR  JOB
  //STEP1 EXEC PGM=IEBGENER COMMENT: EXECUTION COMMAND
  //* Data to be copied
  //SYSUT1   DD *
  Hello, world JCL!
  //* printing Hello, world JCL! string to the system output
  //SYSUT2   DD SYSOUT=A
  //SYSPRINT DD SYSOUT=A
  //SYSIN    DD DUMMY
  //
```

**JOB** identifies the start of the job.
**EXEC** is used to identifying the name of an execution unit program or procedure to be executed (in our case the IEBGENER program).
**Data Definition (DD)** is used to connect program file names used by the program indicated in the EXEC operation.

In our case, we don't handle any file but we using standard output with the **SYSOUT** parameter.
The **DUMMY** parameter means that nobody device or external storage space is to be used to the system Data Set that is a special type file in a Mainframe Environment.

Finally, we have another "//" at the end of the script with null instructions which points to the end of the job execution.

Here we go!

**JCL** is a broad argument and there are plenty of books, manuals, and guides for mastering to build and create very powerful scripts, and also IBM itself provides various resources for learning it.

A few links:
[IBM JCL concepts](https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zjcl/zjclc_basicjclconcepts.htm)
[IBM JCL User Guide]
(https://www-01.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R3SA231386/$file/ieab500_v2r3.pdf)
[IBM JCL Reference Guide]
(https://www-01.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R3SA231385/$file/ieab600_v2r3.pdf)
[JCL tutorial]
(https://www.mainframestechhelp.com/tutorials/jcl)