teleren/devto huggingface dataset:
Day 6: This multi-blog post, processing
Tags: processing, adafruit, arduino, maker
Published: 2020-07-16 16:10:22

Ok, before I dropped off to sleep, I found the following article which is pretty much what I need to connect arduino to processing and have them sending data between them.

##### ℹ️ https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/all

* board -> processing : data from accelerometer
* processing -> board : bitmap image generated from accelerometer data

So that's today's goal, at least get processing picking up data from accelerator.

## Before that happens, a little side-track
I wanted to see if I can get the accelerometer data in m/s instead of the raw data, and print it to the TFT.

Here's the bit of code that retrieves the data in m/s^2

```
lis.getEvent(&event);

```
I set the background of TFT to be black (`ST77XX_BLACK`).

Now when I write to the TFT, the text just writes on top of each other makine a mess after awhile. Did a little search on refreshing text on TFT, and all I needed to do was print the text with its text colour plus the background colour (in this case is black).

```
tft.setTextColor(color, ST77XX_BLACK);
```

Saved, compiled and uploaded the code and that did the trick.

Also played around setting the text size, if you are curious, this is what I used:

```
tft.setTextSize(3);

```

* Clearing existing text - https://github.com/adafruit/Adafruit-GFX-Library/issues/16
* https://github.com/adafruit/Adafruit-GFX-Library/blob/master/Adafruit_GFX.h

## Now I have my data in m/s, let's get processing talking to it
I'm going to initially send over the X value.

Created my processing code and got this exception

```
RuntimeException: Error opening serial port /dev/cu.usbmodem14101: Port busy
```

# 🥪 BREAK 🥪

Over lunch I asked Mick that I couldn't connect to the serial port via Processing. He mentioned if I closed my Arduino IDE. 😳

Yep, very DOH! moment there.

So after lunch I closed Arduino IDE, modified the code on Processing a little and lo and behold... it worked!

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

Ok, I can read text, I want to read values now.

---

Before I do that, I'm ditching my PyProcessing code from before and changing to pure Processing now.

So do the same thing (easily replicated from the official tutorial docs drawing the grayscale image), and I wanted to `save()` the image as bitmap and `exit()` the programme, which was all fine.

Now I was looking at drawing simple shapes and lines, and have it randomised (colours between 0 and 255) and the X/Y co-ordinates in-between 240x240.

After a bit of reading through shapes and PShapes, I stuck with primative shapes, I wanted lines and various sized ellipses in various colours generated before the time lapses and gets saved to a bitmap file.

Here's a sample of the generated bitmap from Processing:

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

* Coordinate System and Shapes: https://processing.org/tutorials/drawing/
* PShapes: https://processing.org/tutorials/pshape/
You decide: ➡️  About what topic of web performance should my next blog post be ❓✍️
Tags: discuss, webdev, webperf, beginners
Published: 2020-07-16 15:43:14

Hey dev.to folks,

Web Performance can be a tricky beast.

You can define one of my next blog posts. About what should I write?

- What are your problems with Web Performance?
- Is there anything you like to have explained in detail?
- What would be interesting for you?

If you don't know if your topic fits the area of web performance, don't care about, write it down anyway.

I am curious about what you make up!

Cheers
Marc

---

If you like this article, smile for a moment, please share it, follow me and [subscribe to my newsletter](https://marcradziwill.com/newsletter/).

---


<span>Photo by <a href="https://unsplash.com/@patrickian4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Patrick Fore</a> on <a href="https://unsplash.com/s/photos/blog?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>
Set Your Sights
Tags: impact, webdev, productivity, change
Published: 2020-07-16 15:40:37

The direction of our gaze is such a powerful tool. The power to create our future is dictated far more on where our eyes are set than on just about anything else.

Think about it. When driving a car, it is effectively impossible to go anywhere but where you are looking. If you try, your progress will quickly come to a very abrupt halt. Life is the same. In both a literal and metaphorical sense, we cannot move anywhere we aren't looking. If we simply spend our time looking at a specific goal, we can't help but make progress towards it.

Ask yourself this question: where are your sights set? Are they TRULY set on what you tell others - or even yourself? Or are they set on something else, regardless of what you may say or pretend?

Here are 4 indicators of what your sights are **actually** set on.

1. **Focus.** If we are constantly glancing about, then our sights are not set upon anything. What do you actually focus on, giving it exclusive attention?
2. **Time.** Time looking at just that thing. What do you spend your time gazing at?
3. **Being present.** If we are daydreaming or distracted by things (phones, social media, etc) we are no longer seeing what we are looking at. Are you halting your progress with distractions?
4. **Study.** The object of our gaze must obviously intrigue us otherwise we wouldn't spend so much time and energy focused upon it. Setting your sights upon something means study, thought, and investigation. What are you intellectually engaged in?

After taking this assessment, ask yourself again, what are your sights set upon? Is it time to make a change and set your sights upon something else? Something of more value?

Happy coding!

Signup for my newsletter [here](https://thinkster.io/?previewmodal=signup?utm_source=devto&utm_medium=blog&utm_term=setyoursights&utm_content=&utm_campaign=blog).

Visit Us: [thinkster.io](https://thinkster.io?utm_source=devto&utm_medium=blog&utm_term=setyoursights&utm_content=&utm_campaign=blog) | Facebook: @gothinkster | Twitter: @GoThinkster
Simple React DataTable
Tags: react, datatable, javascript, ui
Published: 2020-07-16 15:36:05

Hi everyone, this time I want to show you a simple component that I made in React JS to visualize and manage your data in a table.

It's inspired in the popular JQuery library [DataTables](https://datatables.net/)

## Features

The next are the features that I added so far.

- Set title of columns.
- Set rows per page.
- Filter the data.
- Pagination control.
- On row click callback.

Now I have a developer blog, continue reading this post here: https://hhsm95.dev/blog/simple-react-datatable/

Thank you!
All my heroes start early
Tags: developer, productivity, career
Published: 2020-07-16 15:20:59

---
title: All my heroes start early
published: true
description: High performing developers prioritize learning, teaching, and sharing.
tags: #developer #productivity #career
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/12phs3d88v9obizlhtsa.jpg
---
Its 5am and I noticed through social media that my heroes were already up and active. They were creating content, sharing resources, and learning. This got me thinking if this was a common theme among high performers.

1. [James Quick](https://www.jamesqquick.com/) was answering questions to strangers on his Learn Build Teach Discord. In the few years I have followed Mr. Quick I've watched him teach students at a tech boot-camp, teach coders on his Twitch channel, and actively help developers on Twitter. This consistent action of teaching has led to such jobs like a developer advocate for Auth0 (3rd party tool providing Authentication & Authorization as a service) and lead developer at FedEx (multinational delivery services).

2. [Danny Thompson](https://www.linkedin.com/in/dannythompson901/) famously wakes up at 4am each day to study and learn. In the past year he went from boot camp student to public speaker, conference founder, and meetup organizer. He consistently focused on using social media and his opportunities to speak to help developers find learning resources.

3. [Lawrence Lockhart](https://www.linkedin.com/in/lawrencelockhart/) was posting content and sharing resources on the Code Connector Slack channel. Every day, he has been consistently posting free tech conferences, webinars, and virtual events so that everyone will have the chance to learn. I'm positive this system of searching for structure quality learning was instrumental in him going becoming an accomplished developer and a respected leader in the local tech community.

The one thing I found in common with all three is that they prioritize these goals: **learning, teaching, and sharing**. Their success isn't left to chance but to hard work, passion, and consistency.

This is what I do:

* I'm a front end developer learning React for web apps, React Native for mobile apps, and building API services using server-less web services like Netlify.
* In the past few months I have developed [Level Up Dev](https://play.google.com/store/apps/details?id=com.levelup.mobile) (mobile app publish to Google Play store), [Code Connector Meetup Calendar](https://chrome.google.com/webstore/detail/code-connector-meetups-ca/nonnkmloihklfojffnmkedkdeccdnhhf/related?hl=en) (publish Google Chrome extension), and helped build [VEVA.AI](http://veva.network/) (web application to help user learn more efficiently).
* I am sharing my journey into tech on [Dev.to](https://dev.to/jcsmileyjr), [LinkedIn](https://www.linkedin.com/in/jcsmileyjr/), [Twitter](https://twitter.com/JCSmiley4), and [Code Connector Slack](code-connector.slack.com) channel .
How do you keep up with writing?
Tags: discuss, writing, motivation
Published: 2020-07-16 15:18:25

I wonder if it's me or not, but I often find myself having a lack of motivation to write. Whether it be writing code or writing a blog post, I struggle with it regularly.

Do you feel the same? Which solution(s) work for you? Or do you have any other thoughts on this? I'm curious to read what you think of it.
GitHub Actions SSH Deploy Setup
Tags: github, devops
Published: 2020-07-16 15:10:28

Lately I’ve been deploying a bunch of static webpages to my server.
Even though there are several offers out there which seamlessly integrate with GitHub and others, I still like this machine and I’m not going to get rid of it anytime soon.

The one thing I dislike, though, are manual deployments. 
So, after I manually deployed the first page, I began to automate this task.
And since I’m hosting most of my code on GitHub, I started looking for solutions using [GitHub Actions](https://github.com/features/actions "GitHub Actions").

## Preparations — Generate SSH Key

Before we take a look at the actual GitHub action we’re going to generate an SSH key:

`ssh-keygen -m PEM -t rsa -b 4096 -C "you@your_mail.tld"`

Our SSH key is required to be in `PEM` format, hence the `-m PEM` flag.

## Preparations — Copy SSH Key

To log into our machine using our SSH private key we need to add our public key to the machine’s `authorized_keys`. 
We’ll do so using `ssh-copy-id`:

`ssh-copy-id -i /path/to/your/key youruser@yourhost`

This will copy the **public key** of your key pair to the remote host and add it to its list of `authorized_keys`.

## Action — Configure Secrets

We definitely don’t want to expose our private key required for login to our GitHub repository, so let’s configure some [secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets "GitHub secrets") for our deployment:

- **DEPLOY\_KEY**: Our SSH **private** key
- **DEPLOY\_HOST**: The host we’re going to connect to
- **DEPLOY\_USER**: Our user on the remote host
- **DEPLOY\_PORT**: The port we’re using. (Not necessarily required, port 22 will be used by default)
- **DEPLOY\_TARGET**: The target folder on the remote host we’re copying our assets to

## Action — Add a Workflow File

With our secrets all set up, we’re ready to configure our workflow.
The following workflow is using [easingthemes/ssh-deploy](https://github.com/easingthemes/ssh-deploy):

```yaml
name: SSH Deploy

on:
  push:
    branches: [ master ]

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
   	  - uses: actions/checkout@v2
      - name: ssh deploy
        uses: easingthemes/ssh-deploy@v2.1.4
        env:
          SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
          REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
          REMOTE_USER: ${{ secrets.DEPLOY_USER }}
          REMOTE_PORT: ${{ secrets.DEPLOY_PORT }}
          SOURCE: "dist/"
          TARGET: ${{ secrets.DEPLOY_TARGET }}
```

It will copy the content of our `SOURCE` folder to the target folder on our remote host. Our `SOURCE` is freely configurable, so we’re able to deploy just about anything via SSH.

Commit this workflow file in your repository under `.github/workflows/deploy.yaml` to get things started.
GitHub API With Python & PowerShell Scripting
Tags: python, github
Published: 2020-07-16 15:06:22

To know how to use GitHub API with Python and PowerShell Scripting do read the below article. 

https://medium.com/towards-artificial-intelligence/github-api-with-python-powershell-scripting-47d39b5d32d1?source=friends_link&sk=a864ae5d4ae2f96f3ed8cd41f3792170
Google AutoML Vision for Image Classification
Tags: machinelearning, python, googlecloud, datascience
Published: 2020-07-16 15:02:38

What if I said Google AutoML Vision will solve our problems? Yes, AutoML Vision enables us to train custom Machine Learning models to classify our images according to our own defined labels. It will train the model from labeled images and evaluate the performance. It doesn’t require the user to have any knowledge of deep learning or AI.

To know how to use it and deploy models on cloud or edge, check out the below article.

https://medium.com/towards-artificial-intelligence/google-automl-vision-for-image-classification-503267be6ccd?source=friends_link&sk=03714136de1c85b6714bdcb4c31fd4b1
The number of elements in a power set of size <= 1 is the size of the original set + 1 more element: the empty set .
Tags: math, sets
Published: 2020-07-16 14:59:55

Suppose {% katex inline %}|A|=m{% endkatex %}. What is the size of this set:

{% katex %}
| \\{X \in \mathscr{P}(A) \in : |X| \leq 1 \\} |
{% endkatex %}

Let's start with a specific example: 

{% katex %}
| \\{X \in \mathscr{P}(\\{1,2,3\\}) \in : |X| \leq 1 \\} |
{% endkatex %}

First, let's create the power set, stopping once we hit an element whose size is greater than 1:

{% katex %}
{\mathscr{P}(\\{1,2,3\\})} = \\{\emptyset, \\{1\\}, \\{2\\}, \\{3\\} \\}
{% endkatex %}

Notice that the number of elements of size {% katex inline %}\leq 1{% endkatex %} is the size of the original set + 1 more element: the empty set.

Thus:
{% katex %}
| \\{X \in \mathscr{P}(A) \in : |X| \leq 1 \\} | = m+1
{% endkatex %}
Linux Commits to Inclusive Language
Tags: news, linux
Published: 2020-07-16 14:55:35

---
title: Linux Commits to Inclusive Language 
published: true
description: Linux has adopted inclusive language and is no longer referring to masters, slaves, or blacklists.
tags: news, linux
//cover_image: https://direct_url_to_image.jpg
---

A friend just shared [this article on The Register](https://www.theregister.com/2020/07/13/linux_adopts_inclusive_language/) that states Linux is committing to inclusive language. 

From the article:

> A Git commit adopted changes recommended by kernel developer Dan Williams, with the result that Linux will no longer refer to masters, slaves or blacklists.

> In their place coders will be expected to use alternatives such as “primary” and “secondary” relationships, or refer to “leaders” and “followers”, or even “directors” and “performers”.

> Blacklists are to become either “denylists” or “blocklists” and whitelists will become “allowlists” or “passlists”.

> Torvalds’ commit was made on July 10th and said he thinks there’s no need for the change to wait for the next merge window for a new cut of the Linux kernel.
Current Date and Time in JavaScript
Tags: javascript
Published: 2020-07-16 14:55:15

The current date and time in your web application can be a nice touch and convenient for the user to view. JavaScript has built in methods to help you display that information easily. Additionally, there are various ways to customize the date and time and display it to your liking. We'll begin with the basic methods and expand upon those. 

<h1>Date object</h1>

You can get the date using the Date Object. Here's an example below which I will type in to the console.
```
let currentDate = new Date();

currentDate;

//Output is:  Sun Jul 12 2020 20:00:37 GMT-0400 (Eastern Daylight Time)
```

If you test this out in the console, it will look similar to this:

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

As a reminder, even though the date looks like a string, it is actually a date object that is returned to us. 

From the date object, we can select specific information we want, such as the day. 

We call the `getDay()` method on the date object which will return a number assigned to the day of the week. 0 for Sunday through 6 for Saturday. 

```
currentDate.getDay();

//Output is: 0
0 stands in for Sunday.

```

There are various methods similar to `getDay()` to pull different info from the date object.

Methods:

- getMonth() for the month (range is 0-11)
- getDate() for which day of the month (range is 1-31)
- getFullYear() for the year
- getHours() for the hour (range is 0-23. 0 is midnight and 23 is 11pm)
- getMinutes() for the minute (range is 0-59)
- getMilliseconds() for the millisecond (range is 0-999)
- getTime() for the number of milliseconds since Jan 1, 1970.

Try these methods out to get the date and time information you want to display.
Announcing another set of GraphQL Fireside Chats: a Special Series of Online Events
Published: 2020-07-20 06:13:03

---
title: Announcing another set of GraphQL Fireside Chats: a Special Series of Online Events
published: true
date: 2020-07-16 14:52:35 UTC
tags: 
canonical_url: https://hasura.io/blog/graphql-fireside-chats-frontend-edition/
---

![](https://hasura.io/blog/content/images/2020/07/joris-voeten-gL84ogFsV6s-unsplash.jpg)<figcaption>Photo by <a href="https://unsplash.com/@jorisoi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Joris Voeten</a> on <a href="https://unsplash.com/s/photos/camp-fire?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption>

We are thrilled to be partnering with [This Dot Media](http://thisdot.co) for another special series of GraphQL online events focused on various front-end frameworks!

Starting on July 28th, 2020, we will be co-hosting weekly “GraphQL Fireside Chats”, where each week we’ll focus on GraphQL + Flutter, Vue, Angular, and Relay! Join the panel of special guests for a roundtable discussion and lively Q&A.

The purpose of these events is for the GraphQL community to come together and discuss some key topics in the GraphQL ecosystem and facilitate cross collaboration amongst the community. We are thrilled to be able to connect with fellow GraphQL enthusiasts while also practicing safe social distancing!

Check out the schedule below:

- [July 28th, 2020](https://www.graphql-meetup.com/#/graphql-fireside-chat-flutter): GraphQL + Flutter with special guests [Chris Sells](https://twitter.com/csells),  [Tanmai Gopal](https://twitter.com/tanmaigo) & more!
- [August 4th, 2020](https://www.graphql-meetup.com/#/graphql-fireside-chat-vue): GraphQL + Vue with special guests [Debbie O'Brien](https://twitter.com/debs_obrien), [Natalia Tepluhina](https://twitter.com/n_tepluhina), [Tanmai Gopal](https://twitter.com/tanmaigo), & more!
- [August 11th, 2020](https://www.graphql-meetup.com/#/graphql-fireside-chat-angular): GraphQL + Angular with special guests [Bonnie Brennan](https://twitter.com/bonnster75), [Chris Whited](https://twitter.com/cmwhited), [Tanmai Gopal](https://twitter.com/tanmaigo), [Uri Goldshtein](https://twitter.com/urigoldshtein), & more!
- [August 18th, 2020](https://www.graphql-meetup.com/#/graphql-fireside-chat-relay): GraphQL + Relay with special guests [Joe Savona](https://twitter.com/en_js), [Tanmai Gopal](https://twitter.com/tanmaigo) & more!

**Don’t forget to sign up to receive the live link the day of!**
Working with Date and Time Functions in PHP5 and PHP7
Tags: programmingstuff, php
Published: 2020-07-16 19:49:15

---
title: Working with Date and Time Functions in PHP5 and PHP7
published: true
date: 2020-07-16 14:45:11 UTC
tags: ProgrammingStuff,PHP
canonical_url: https://gauravtiwari.org/date-and-time-functions-in-php/
---

![](https://i1.wp.com/gauravtiwari.org/wp-content/uploads/2020/07/date-and-time-functions-in-php-1.png?fit=1600%2C800&ssl=1)

Working with date and time functions is very common in PHP. Date and time functions help you to get the current date and time from the server and also enables you to format

- "Working with Date and Time Functions in PHP5 and PHP7](https://gauravtiwari.org/date-and-time-functions-in-php/) was originally published at [Gaurav Tiwari -](https://gauravtiwari.org)
Whoza! GUYS I AM BACK AGAIN WITH AN ANOTHER BLOG. SO TODAY I AM GOING TO TELL YOU HOW TO LINK YOU FLUTTER PROJECT TO GITHUB
Tags: github, flutterweb
Published: 2020-07-16 14:42:18

### Requirements:
* git bash (can download from https://git-scm.com/)
* vs code
* flutter web (link of the blog to install flutterweb https://dev.to/neev123/hey-guys-today-i-am-going-to-tell-you-how-to-setup-flutter-and-flutter-web-on-windows-10-38jp)
* https://github.com/

#### Lets get started 
Open github on you browser
sign in or create an account. After creating an account create a new repo.

#### connecting your flutter code with github
After creating a repo open your vs code and if you remember in my last blog we set up flutterweb working so open that project if you have did changes that's completely okay in this blog we are just going to focus how to link the project. Open your the provided terminal by vs code and type the following:


      git init
      git add .
      git commit -m "first commit"
      
### After doing this open your repo scroll down and you will se an option on the bottom to copy the code 

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

paste that code in your terminal as shown in the example

      git remote add origin https://github.com/neev123/ewh.git
      git push -u origin master
please don't copy the code given up because you can get a different url like 

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

after doing this go to your github repo page and reload it you will se you files and folders on the page
example:

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

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

https://github.com/neev123dev/
https://dev.to/neev123dev