teleren/devto huggingface dataset:
Receive Slack Messages/Emails when your Code Deploys
Tags: tutorial, wayscript, webdev
Published: 2020-07-08 12:05:29

Introduction
------------

Being kept up to date about the progress of your repository is important and creating integrations can make your development cycle easier.  
Today, let’s take a look at how we can trigger a slack notification and receive an email when your code is deployed.

Prerequisites
-------------

*   [Working with Github Trigger](https://docs.wayscript.com/library/triggers/github-trigger)
*   [Working with Slack](https://docs.wayscript.com/library/modules/slack)
*   [Working with Send Email](https://docs.wayscript.com/library/modules/send-email)

Notification upon branch
------------------------

If your branch, once merged is automatically deployed, then, the notification becomes easier to make. If that isn’t the case, you can use Python to create notification through Wayscript.  
The first step for this tutorial is to choose the Trigger which is Github Trigger.  
  

![Adding Github Trigger](https://cdn.wayscript.com/blog_img/115/1.png)

This trigger allows you to perform actions depending on the events on your repo.  
  

![Github Trigger configuration](https://cdn.wayscript.com/blog_img/115/2.png)

We work with Push Events here, and then we choose the branch.

Slack Notification
------------------

Every time a push will occur, this activates everything below that trigger.  
Add the Slack module.  
  

![Adding slack module](https://cdn.wayscript.com/blog_img/115/3.png)

Then, let’s configure it. Connect your account and the desired channel you want to post the notification.  
  

![Slack module configuration](https://cdn.wayscript.com/blog_img/115/4.png)

Email Notification
------------------

Wayscript provides the Send Email module to easily send yourself emails using Wayscript.  
  

![Send Email module](https://cdn.wayscript.com/blog_img/115/5.png)

Let’s write the message and subject.  
  

![Email Message](https://cdn.wayscript.com/blog_img/115/6.png)

Conclusion
----------

Questions about this script or anything else? Join our [discord](https://discord.gg/VWbXSbj). We're always around to help. If you want to work the full script template, just find it [here](https://wayscript.com/user/mangabo_kolawole/XwRnt5EL
        ).
Une classe C++ vide est-elle vraiment vide ?
Tags: cpp
Published: 2020-07-08 12:03:27

Voyez cette classe C++ :

```cpp
class Object {
};
```

Elle est vide.

Vous en êtes certain.e.s ? Allez, je vais voir ce qu'il est en vraiment 😃

{% youtube jVUFf2e6q30 %}
Daily Developer Jokes - Wednesday, Jul 8, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-07-08 12:00:13

---
title: "Daily Developer Jokes - Wednesday, Jul 8, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Wednesday%2C%20Jul%208%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125970d9ec2.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What is a pirate's favorite programming language?

___A:___ You'd think it was R, but a pirate's first love is Objectively C.
 -->
Need Your Help to Build the Twitch for developers, designers and makers
Tags: discuss, showdev, help, startup
Published: 2020-07-08 11:58:11

I dev.to community,

A few weeks ago, I published a landing page for a project called Strow.io: [https://strow.io/](https://strow.io/)

I realized that several developers, designers and makers livestream on Twitch or Youtube Live. 

**The problem is that these platforms are not suitable for them**. 
Youtube is for *entertainment* and Twitch is for *gaming*.

I've had a lot of people sign up on the landing and I've had a lot of encouragement. It's something that a lot of people are looking for and with a lot of potential.

If I come here to talk to you about it, it's because today I have the vision of the project, I know the impact it can have.
However, **I cannot depend on Twitch or Youtube**.

To monetize the platform I need to be independent.

*The streaming infrastructure requires a lot of investment.*

Every time I push back the project, different people come to me to say "Alex, I need that ! It's really good."

Today I'm solo, I always preferred to bootstrap my projects instead of finding investors. However, this kind of project is hardly bootstrapable.

I need to hear the voice of the dev.to community.

Do you think this idea is worth pursuing knowing that streaming is becoming more and more popular ?
Do you have any advice or constructive feedback to offer?

How to start small and with low investment in the livestream industry next to giants VC companies ? 


Thanks for your interest and your feedback 🙂
Basic Programming Terms
Tags: beginners, tutorial, productivity, tips
Published: 2020-07-08 11:57:40

##1. Variable
Variable nothing but a Container. You see the container in your home right. Similarly, in computer memory, we store the data and variables are identifiers for their location. The building blocks of every computer program or software are variables.

##2. Data types
In our home, we have various containers right to store specific things. In programming, we can make a specific type of container, which means variable. If you want this variable for store numbers then make it Integer type, if you want to store name in a variable then make it String type. There are lots of types in various programming but these following are basic for all.

* Integer
* Float
* Char
* Float
* Boolean

##3. Algorithm
In our life, we face different types of problems like my dog not handshake with me, my crush not looking at me, oh these are the big problem for us. But what we do, we find a solution for them. Step by step we follow the steps of the solution and we succeeded in our goal. Similarly, in programming, we solve the problem step by step in a paper (most of in brain) before writing the code. Okay, that’s the algorithm.

##4. Flowchart
Okay, guys, we have the biggest problem in the world you can see above right. But sometimes we can understand the solution by the graphical representation easily rather than step by step (algorithm). So we can draw the steps by shapes and lines and understand the problem and represent the solution. In, computer field we represent the solution of problem or program or logic by different lines and shapes. Lines for flow and different shapes are connected to it to understand the flow of the program. Here, each shape has a specific meaning. 

##5. Pseudocode
Pseudocode (pronounced SOO-doh-kohd okay) simple description of what program or algorithm must do. An expression is to write in a formal natural language rather than in code. Pseudocode is sometimes used to representing the detailed process of the program.

##6. Syntax
I know the syntax is the very very basic term. You can create your own rule for your life, “My Rule My Life”. Similarly, “Programming has their own rules and their own life 😎”. You need to must follow their set of rules for creating an awesome program. And this set of rules known as syntax.

**Read more terms [here](https://www.codesnail.com/programming-terminology-for-beginners/)**
5 Python Tricks And Tips
Tags: python, codenewbie, tutorial, productivity
Published: 2020-07-08 11:35:46

---
title: 5 Python Tricks And Tips
published: true
date: 
tags: python, codenewbies, tutorial, productivity
canonical_url: http://billyokeyo.codes/articles/5-python-tricks-and-tips/
---

Hey there, in this article I'll show you some quick python tips and tricks which will make your life more easier and help you write better code in python.   
Let's get started

#### **1. Swapping Two Numbers**

At times you might find yourself wanting to swap two numbers and you are thinking of a better way to put it 🤔, so here's how I prefer to do it...

```
x , y = 10, 20 #Assigning 10 to x and 20 to y

print (x, y)

#Output will be 10, 20

x, y = y, x #Swapping the values 

print (x, y)

#Output will be 20, 10 
```

And that's how easy it is to swap two numbers 

#### **2. How to Reverse a String **

Reversing a string is taking a string and printing it in the reverse order, let's see how that can be achieved.

The output will be in reverse order 

```
myString = "PythonProgramming"

print (myString)

#Output will be PythonProgramming 

print (myString[::-1])

# Output will be gnimmargorPnohtyP 
```

#### **3. How To Create A Single String from a List**

If you have a list of words and you want to join them to form one sentence you can do that easily by using the code below 

```
myList = [”Python", ”Programming", "Is", ”Fun”]

print (myList)

#Output will be ['Python', 'Programming', 'Is', 'Fun']

print (””.join(myList))

#Output will be PythonProgrammingIsFun
```

#### **4. How To Print the File Path of Imported Module**

If you ever worked with a module and you want to know it's path so that you can see it's structure, you can do that easily by running this code 

```
import os

print (os)

#Output will be the path of your os module 
```

#### **5. How To Find The Most Frequent Value in a List**

If you have a list if numbers and you want to find which number appears in the list most frequent, you can do that easily by using this code 

```
numbers = [2, 5, 6, 3, 2, 7, 5, 2, 8, 2, 3]

print (max(set(numbers), key = numbers.count))

#Output will be 2
```

That's all I had for this article, if you have other tips and tricks feel free to leave them in the comments section and I'll be glad to check them out...  
See you in the next article
Youtube Chapters - How to Add
Published: 2020-07-08 11:23:54

## First of All What is **_Youtube Channels?_**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bowm9t1zxkdsvhwntorq.png)

You see how the TimeStamps is dividing the video in Chapters/
This helps the viewer get exactly what they're looking for, get an idea what all will be discussed in the videos and also save time, if the viewer want to skip to a specific chapter.

## How to Add?
How to Add Chapters to your videos? For that you just need to mention the timestamps in the description. That's it !!

### Let me show an Example
For this video - https://www.youtube.com/watch?time_continue=3&v=66owdRkc8pI
Description I added -
```
0:00 Start
0:18 Web Crawler & Indexing
0:54 Example 
2:13 Dynamic Rendering on React (SSR)
4:22 Next.js
7:56 Summarizing
```
Don't Forget to put 0:00 otherwise chapters will not show as in the image shown above. Click on the video link to see chapters in action.

<hr/>
If you like my content Follow me. And like this post. ❤️
#julyot Devs, Learn the basics of IoT Solutions this month!
Tags: iot, cloud, newbie, julyot
Published: 2020-07-08 11:22:41

---
title: #julyot Devs, Learn the basics of IoT Solutions this month!
published: true
description: 
tags: iot, cloud, newbie, julyot
---

Hey Fellow developers,

Are you interested in IoT but never had time - or hardware - to start? Don't know where to start? **Let's start together this month!**

I'm running a series of Live streaming about IoT solutions, **every Thursday 5pm CET-Paris Time / 8am PST-Seattle Time** at [https://julyot.café.dev](https://julyot.café.dev). You'll be able to follow along within your browser my course with the Microsoft Learn Platform ([https://aka.ms/julyot/learn/](https://aka.ms/julyot/learn/)).

## Watch the first episode

The first episode of the series aired last week. With one of my colleague [Benjamin](https://twitter.com/kartben), we've introduced what is an IoT Gateway and how to host it easily on Azure.

<iframe width="560" height="315" src="https://www.youtube.com/embed/FGOl6oD8HkQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Next episode: Use SaaS solutions to build your own IoT Solution

I'll be streaming live tomorrow (July 9th) about how you can use SaaS IoT product - Azure IoT Central - to create your own IoT Solution with very limited amount of code - or even no code at all sometimes! 

[**Join me Live on YouTube**](https://julyot.café.dev).
在 ESP32/ESP8266 MicroPython 使用 USB 傳輸線與電腦上的程式互動
Tags: esp32, micropython, uart
Published: 2020-07-08 11:07:01

在 ESP32/ESP8266 上撰寫 MicroPython 程式時, 你可能會希望可以讓 控制板透過 USB 傳輸線和電腦上的其他程式互動, 例如可以從 PuTTY 輸入指令控制控制板上內建的 LED 燈。要做到這件事, 最簡單的方式就是使用 Python 內建的 [input](http://docs.micropython.org/en/latest/library/builtins.html#input) 來讀取輸入資料, 不過這個方式必須要在輸入資料後按下 <kbd>Enter</kbd>, 有點麻煩, 我們希望的是可以直接按下例如 <kbd>O</kbd>/<kbd>X</kbd> 就點亮/熄滅 LED 的方式。

對於習慣使用 Arduino 的人可能會想到這不就開啟序列通訊就好了？沒錯, MicroPython 在 machine 模組中也提供了 [UART](http://docs.micropython.org/en/latest/library/machine.UART.html) 類別, 可以使用控制板上的 UART, 可惜的是 UART0 已經被 REPL (互動介面) 佔用了, 無法在程式中使用。難道這樣就沒輒了嗎？

還好, 山不轉路轉, 由於 REPL 的輸入就是 Python 的 sys.stdin 資料流, 所以我們可以直接操作 [sys.stdin](http://docs.micropython.org/en/latest/library/sys.html#sys.stdin) 來獲取輸入的資料, 在 Python 中也提供有標準的 [select](http://docs.micropython.org/en/latest/library/uselect.html) 機制, 可以偵測輸入用的資料流是否已經有資料等待讀取？結合以上, 我們就可以讀取輸入的指令來做出回應了。

以下就是一個簡單的程式, 可以從電腦端透過 USB 傳輸線輸入 <kbd>O</kbd>/<kbd>X</kbd> 指令到控制板**點亮/熄滅**內建的 LED：

```python
import sys
import select
import time
from machine import Pin

p = select.poll()     # 建立偵測物件
p.register(
    sys.stdin,        # 偵測標準輸入 (REPL)
    select.POLLIN     # 偵測是否有資料待讀取
) 

led = Pin(2, Pin.OUT) # 控制內建的 LED
led.value(0)          # 預設熄燈

while 1:
  time.sleep(0.1)
   
  while p.poll(0):   # 測試是否有資料待讀取並等待 0 毫秒
    ch = sys.stdin.read(1) # 讀取資料
    if ch == 'O':    # 輸入指定 O
        print('點亮')
        led.value(1) # 點亮 (esp8266 是熄滅)
    elif ch == 'X':  # 輸入指令 X
        print('熄滅')
        led.value(0) # 熄滅 (esp8266 是點亮)
```
其中 [poll(0)](http://docs.micropython.org/en/latest/library/uselect.html#uselect.poll.poll) 就是偵測是否有資料待讀取？傳入的參數代表要等待多少毫秒？如果超過時間仍然沒有資料可讀取, 就會傳回一個空的串列, 否則就會傳回一個由元素組 (tuple) 組成的串列。因此只要判斷傳回值就可以知道是否有資料待讀取了。這裡傳入 0 表示不等待, 這樣可以在沒有輸入資料時去做別的事情, 不用枯等 (block) 資料進來。

要測試這個程式, 必須將程式儲存成 main.py, 放到控制板上重開機讓它自動執行, 如果直接在 thonny 之類的環境執行, 輸入資料會被 REPL 搶走。接著, 就可以開啟 PuTTY 之類的終端機軟體連接控制板下指令控制 LED 了：

![](https://i.imgur.com/crf5dUx.png)
AWS SDK for Java v2 - so simple they saved on documentation
Tags: aws, java, sdk, 100daystooffload
Published: 2020-07-08 11:04:23

The [version 2 of the AWS Java SDK](https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/welcome.html) is much less documented than the first one. Okay it's newer so there are less blogs and projects, obviously, but finding official code examples with v2 on AWS sites is a real struggle. Luckily, using the SDK has become much simpler and straightforward.

Every service will be accessed in a pretty much similar pattern. Let's say, you want to read some data you keep in the parameter store of AWS's SSM (Systems Manager). After you include in your project the BOM of AWS for versions and the SSM dependency:
```
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>bom</artifactId>
        <version>${aws.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
  ...
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>ssm</artifactId>
    </dependency>
  ...
```
>*Note: the biggest challenge is to figure out what is the artifact name for a certain AWS service, there's like zero references to that. But reading through the (huge) BOM with some common sense will let you find it.*

The following piece of code will let you read your encrypted parameters by path.
```
final AwsCredentialsProviderChain chain = AwsCredentialsProviderChain
    .of(ProfileCredentialsProvider.builder().build(), DefaultCredentialsProvider.create());
final SsmClient ssm = SsmClient.builder().credentialsProvider(chain).build();
final GetParametersByPathResponse secretsResult = ssm.getParametersByPath(
    GetParametersByPathRequest.builder().path("/your/secrets").withDecryption(true).build());
```
The pattern is always the same:
- build a client, the AWS builder pattern will always be in the form of `YourNeededClient.builder().optionaldata().build()`
- build a service request, again in the same pattern `YourNeededOperationRequest.builder().operationdata().build()`
- call the operation `client.operationName(request)`
- it will return a result of type `YourNeededOperationResult` where you can read the requested data.
>*Note: In my example the SsmClient needed also the credentials provider to grab the account key - the parameters were encrypted remember?*

Your homework will be every time to search through the SDK classes: first find the client class name, find out the operation needed, deduce the request class name, and there you go. Sometimes you'll be able to find examples too, but you can try also blindly - most of the time the error messages will be pretty straightforward, like some request needs signing, or you're missing some needed role, or…

(Published as part of the #100DaysToOffload challenge https://100daystooffload.com/)
Subset selection: reducing dimensions 
Tags: machinelearning, algorithms
Published: 2020-07-08 10:58:17

As most data scientists know, dimensionality is a **curse**; although the number of dimensions is not a curse itself but also the quality of each feature in a specific dimension. **Dimensionality reduction** is a set of techniques that try to transform the input space into a space with fewer dimensions while keeping the meaning and value of the features. In this post, we will journey through a **greedy** algorithm (greedy in the sense that it does not guarantee to find the optimal answer) that generates a selection of features that try to minimize the model's error.  

# Feature selection vs Feature extraction

Dimensionality reduction algorithms can be classified as feature selection methods or feature extraction methods. Feature selection methods are interested in reducing the number of initial features to the ones that give us the most information. On the other hand, feature extraction methods are interested in finding a new set of features, different from the initial ones, and with fewer dimensions. 
# Subset selection
**Subset selection** is a feature selection algorithm that can variate between a forward selection and a backward selection. Both methods consist in finding a subset of the initial features that contain the least number of dimensions that most contribute to accuracy. A naive approach would be to try all the 2^n possible subset combinations but if the number of dimensions is too big it would take forever. Instead, based on a **heuristic** function (error function) we add or remove features. The performance of subset selection depends highly on the model we choose and our pruning selection algorithm. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vwty7xzh1ja2k6qdf6zf.png)

### Forward selection

In forward selection we start with an empty set of features, for each feature that is not in the set we train the model with it and test its performance; we then select the feature with the **least amount of error**. We continue adding new features for the model to train until the error is low enough or until we have selected a proportion of the total features. 

### Backward selection

Backward selection works in the same way as forward but instead of starting with an empty set and adding features one by one, we start with a full set and remove features one by one. Thus we remove the features that cause **the most error**.
Slack: You don't have to reply so fast
Tags: tampermonkey, javascript, slack
Published: 2020-07-08 10:26:19

When we see a new message on Slack, some of us have the urge to reply immediately even though we haven't thought of the full answer. That's fine and natural, and why Slack is great for conversations, but sometimes it can become a frustrating habit when things we say are half-baked. Especially when someone challenges you on the comment, at which point I've found myself deleting the comment because it wasn't thought-out or I've misread the question.

It's also fine to tell yourself to slow down and take a break, but for some of us taking the time to stop and reflect is trickier than it sounds. I'd rather if there was some mechanism that told me to slow down.

That's why I developed [this Tampermonkey script](https://gist.github.com/anevins12/4ba12e7ca6b3b04a5d2c2cc36e33331c) named 'Slack cool-down' (requires the Tampermonkey browser extension).

What it does:
1) Adds a button to Slack with the text "Cool-down replies"
2) Pressing the button then disables the comment box inside threads
3) Pressing the button again enables the comment box

A demonstration is also [available on YouTube](https://youtu.be/a_BNoxwXopk).

That's all, it's just a self-regulating tool that helps some of us take a breather when we're getting caught up in the world of Slack.

Disclaimers: 
* [Env] I have only tested this on Chrome
* [Env] This is only usuable on the Slack Web interface (slack.com)
* [Env] This has been developed with the use of 'Tampermonkey' as the browser extension that runs it
* [A11y] The DOM position of the cool-down button is at the bottom, but it should be inside the thread header. The problem is, this thread header doesn't exists when the JS is executed and I couldn't find a decent way of waiting for it to exist.
* [A11y] There's a big problem in the focus experience. If you were to press the cool-down button, you'd then have to trawl back to where you were and then trawl back again when you want to turn the cool-down off
* [A11y] The text "Take a break" is implemented in the CSS 'content' property and won't be supported in all browser screen-reader combination
* [A11y] The way the comment field is disabled is not semantic. The comment field just has an opacity style with the text laid on top to visually-disable the field. This won't work for assistive tech.
SSRS Free Webinar
Published: 2020-07-08 10:24:04

FREE Webinar on career in SQL Server Reporting Services (SSRS):
Hurry up!! Dont miss the chance and grab the content.
Saturday 11 July at 7:00 pm IST
Register Now: " https://hkrtrainings.com/webinars"         
contact : +91 6300085652