teleren/devto huggingface dataset:
Writing vs reading
Tags: devjournal, writing
Published: 2020-05-30 15:04:06

This post was originally published on [my blog](https://dzhavat.github.io/2020/05/30/writing-vs-reading.html).

---

Writing is hard. It also [takes time](https://mobile.twitter.com/John_Papa/status/1265782204422029312) to write something. Let alone something good. It’s hard because it engages us on many different levels. Before writing something, one first needs to think about it. Then, as one begins to write, this thought becomes a conversation. Should I write this or that? Should I say it this way or the other? Does it still sound good if I read it out loud? What about grammar and spelling? Editting? Can visuals help to explain the idea better? There are so many possibilities and directions one can take. Writing is creating something out of nothing.

Reading on the other hand is easy. Reading is consuming someone else’s writing. Reading can also engage us on different levels but not necessarily. Reading is engaging only if the writing is engaging and if the reader wants to be engaged. With reading, we can skip content and focus only on the parts that seem interesting and relevant. Reading can lead to questions. Reading can help us learn and understand things better but we don’t know this beforehand. We have to finish reading a piece of content before we can say if it was worth it. 

Let’s take writing a blog post as an example. It’s not unusual for me to spend an hour writing a post that takes just a few minutes to read. Sure, writing is a skill and one gets better and faster over time but the writing vs reading ratio will never be 1:1. Not even close.

Why am I sharing this?

Sometimes I come across an advice that goes something like “For every post that you read, you should write one as well”. While I agree with the idea of creating content, I think the advice is unrealistic. If I have to follow it literally, I’d be forever in debt. Writing and reading are not equal. Reading also takes time but it’s generally faster to read something that to write it.

So I have a proposal. Instead of putting unrealistic expectations upon ourselves, let’s have a more balanced approach. My advice then becomes ***“For every 10th post that you read, you should write one as well”***. If every 10th is still too much for you, try with every 20th. The point is to not feel pressured or “behind” some artificial schedule.

Take your time and [just write](https://www.sarasoueidan.com/desk/just-write/).
Functional Programming in PHP 
Tags: php, functional
Published: 2020-05-30 14:47:17

Hello there!
I decided to write a little bit about FP which I know.

This time we will talk about Functional Programming 
and one of it's concepts Pure Functions.

So, let's start what is Functional Programming itself?
As you can guess it's based upon functions and not which we are used to,
but math functions and the biggest difference here's the all math functions are pure and have a single argument.

So let me give an example:

```php
function hello(string $name): string {
    return "hello, $name!";
}
```

This function is pure, because it has following:
1. It doesn't have side effects
2. It's referentially transparent

What is a side effect? It's something that's done outside of scope of our function, e. g.: database queries, file writings, changing global variable values, etc. Example (to run in cli): 
```php
function hello(string $name): void {
    echo "Hello, $name!";
}
hello('John'); // John
fclose(STDOUT);
hello('John'); // Nothing
```

So now we know, at least our function must not change state of our app to be pure,

What is RT? It's when our function depends on it's input (arguments) and produce the same output if you have given the same arguments.
And the first introduced function is referentially transparent, because no matter how many times we call it with the same arguments, we will receive the same result.
```php
function hello(string $name): string {
    return "hello, $name!";
}

hello('John') // John
hello('John'); // John
```

What benefits we gain?
1. Easy to test
1. Easy to understand

If somebody is interested in it, I will continue to cover this topic.
May 30th Side Project Check-in
Tags: discuss, watercooler, checkin, sideprojects
Published: 2020-05-30 14:44:20

---
title: May 30th Side Project Check-in
published: true
tags: discuss, watercooler, checkin, sideproject
series: Side-project Checkin
//cover_image: https://direct_url_to_image.jpg
---
# Good morning/afternoon dev.to fam!! 
It's Saturday. It's the weekend. I hope you all are staying safe this past week 🙏. But what are you guys up to? Building anything that might change the world? Or building something that might help a smaller community? Have you made a a contribution to an open source project? 
Let's talk about it in the comments below!
DollarSite, a minimalistic browser extension
Tags: gftwhackathon
Published: 2020-05-30 14:41:15

[Instructions]: # (To submit to the Grant For The Web x DEV Hackathon, please fill out all sections.)


## What I built
I am building a minimalist browser extension that tells a user if the site they have visited is web monetized and which content does it offer for their money. Some what you might say it’s like the coil extension but not really, this will have a few more far turns to it as I’ll be updating along the way.

### Submission Category: 

Creative Catalyst

[Note]: # (Foundational Technology, Creative Catalyst, or Exciting Experiments)


## Demo
demo link coming soon .. 🔜

## Link to Code

https://github.com/SaidiAli/DollarSite

[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)


## How I built it 

I am going to use react and react materials for the UI

[Note]: # (For example, what's the stack? did you run into issues or discover something new along the way? etc!)


## Additional Resources/Info 

I was lagged behind by some errors I couldn’t figure out in time and I was caught up but I’ll continue working on the project even after the hackathon and I’ll update you as I go along. 


[Reminder]: # (We hope you consider expanding your submission into a full-on application for the Grant for the Web CFP, due on June 12.)
Paths to Becoming a Developer
Tags: career, motivation, productivity, beginners
Published: 2020-05-30 14:35:35

What is the best path to become a developer or designer, to start making applications, websites, and more? I have had some experience going through a number of journies myself and hopefully I can provide a small bit of assistance here.

{% youtube 7HvDeltZJoo %}
<center>[Youtube: Paths to starting Development or Design](https://youtu.be/7HvDeltZJoo)</center>

With a background of Computer Science at University, I thought this would be what I needed to get started, but I found I still didn't feel quite ready. Going into the work world was scary, since it felt like nothing I learnt helped. I ended up going back and studying on my own, at home, doing tutorials and courses online and making my own projects. This helped me get ready where I felt like I knew my own skills. 

The end result was that it took me years before I applied for jobs as I never really believed in myself. Thefefore if you are looking at what path to take to start development, here are my tips:

- Learn on your own, doing online tutorials, courses
- Work on projects, ideas, this is the best kind of learning
- University and Colleges are over-rated, don't expect them to make you feel ready
- Apply for jobs even if you don't feel 100% prepared;
- You will learn more on the job than any prior experience can prepare you for
- Believe in yourself.

## Follow and support me: 
Special thanks if you subscribe to my channel :)
* [🎞️ Youtube](https://www.youtube.com/channel/UCvM5YYWwfLwpcQgbRr68JLQ?sub_confirmation=1)
* [🐦 Twitter](https://twitter.com/adrian_twarog)

## Want to see more:
I will try to post new great content every day. Here are the latest items:
* [Adobe XD to Fully Responsive WordPress Site](https://dev.to/adriantwarog/adobe-xd-to-fully-responsive-wordpress-site-16e0)
* [Adobe XD to HTML Full Process](https://dev.to/adriantwarog/adobe-xd-to-html-full-process-ao6)
* [Full Tutorial on how to use SASS to improve your CSS](https://dev.to/adriantwarog/full-tutorial-on-how-to-use-sass-to-improve-your-css-57on)
* [Creating a Mobile Design and Developing it](https://dev.to/adriantwarog/creating-a-mobile-design-and-developing-it-5c4o)
Wrapper Mode Web Development
Published: 2020-05-30 14:33:19

I just found a great way to layout my web projects with Figma and HTML, CSS and JS using react. Yesterday I found a video from Skillthrive and I love the way he design and build the website from Figma to Code. I want to know is there is any way to know this lind of "wrapping" using css Grid. I think that is the very best way to afford a design using columns and rows in our template. 
[Skillthrive Video](https://www.youtube.com/watch?v=44TRjWt47PE&t=131s)
Can anybody help me and try to find more tutorials like this one using the Wrapper and Grid Layout? 
Thank you and HappyCoding!
How setTimeout working?
Tags: javascript, settimeout
Published: 2020-05-30 14:30:22

---
title: How setTimeout working?
published: true
description: preview setTimeout working.
tags: Javascript, setTimeout 
---
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xgc0zfjsl8jp5wa4hvoe.jpg)

If you write code in javascript, you must be used `setTimeout` method.
sometimes it's cool and just execution callback delay. 

Do you know how `setTimeout` working? let's review 

```javascript
const foo = ()=>{
  setTimeout(()=>{
    console.log('foo...')
  }, 1000)
}

const bar = ()=>{
  setTimeout(()=>{
    console.log('bar...')
  },0)
}

foo()
bar()

// 
undefined
bar...
foo..
```

As you can see just output `undefined` first `bar...` and `foo...` last. why `undefined` first? 

Call `foo` and `bar` method haven't return anythings so `undefined` will be finally.

But why `bar...` before `foo...`? i just call method `bar()` after `foo()`? 

Let's see `setTimeout` implement in **V8** engines

```javascript

struct DelayTask{
  int64 id；
  CallBackFunction cbf;
  int start_time;
  int delay_time;
};
DelayTask timerTask;
timerTask.cbf = showName;
timerTask.start_time = getCurrentTime(); // get current time
timerTask.delay_time = 200;//delay time

```
`DelayTask` defined struct includes `id`, `CallBackFunction`, `start_time` and `delay_time`.

`id` can call or stop task.
`CallBackFunction` callback just defined delay times will do actions

So far how `setTimeout` working? we can also found source code 

```javascript

void ProcessTimerTask(){
  // get delayed_incoming_queue task witch time matched 
  // then one by one execution
}

TaskQueue task_queue；
void ProcessTask();
bool keep_running = true;
void MainTherad(){
  for(;;){
    // Do messages queue tasks 
    Task task = task_queue.takeTask();
    ProcessTask(task);
    
    // Do Delay queue tasks 
    ProcessDelayTask()

    if(!keep_running) 
        break; 
  }
}
```

`MainTheread` have loop action will call **message queue** and **delay task queue**. this is why sometime call `setTimeout` you can found some dom element or some http request response. because `setTimeout` just in **delay queue** and execution after **message queue**  

> PS: **message queue** like some http request, dom render, mouse event, keyboard event etc.

Now why demo code output `bar...` before `foo...`? Emmmm **bar** just delay 0 and **foo** delay 1000 so **bar** shorter than **foo** call first **bar** last **foo**.

Hope can help you :)
Facebook to Wordpress via REST API
Tags: python, wordpress
Published: 2020-05-30 14:28:56

For a personal project, I needed a simple tool capable of scraping all posts from a public Facebook page and upload them as post in a personal Wordpress website.

Made in Python and using Wordpress REST API, I wrote this quick and dirty code :smile:. And it works!

Check it out and let me know how I can improve it.

{% github https://github.com/po5i/facebook-to-wp %}
How to configure notification for Human Task in jBPM
Tags: uncategorized
Published: 2020-07-05 04:56:49

---
title: How to configure notification for Human Task in jBPM
published: true
date: 2020-05-30 14:24:14 UTC
tags: Uncategorized
canonical_url: https://karinavarela.me/2020/05/30/how-to-configure-notification-for-human-task-in-jbpm/
---

> Great post from Sudhish Nair, an expert on process and rules automation.

![](https://2.gravatar.com/avatar/b1fac0ee1137de69c5d8164e792d782f?s=32&d=identicon&r=G)[TechBlogs](https://techblogtoprogram.wordpress.com/2020/05/29/how-to-configure-notification-for-human-task-in-jbpm/)

**jBPM** provides options to configure notification emails to be send to any user if the human task is not started or not completed.

We will start with configuring _JavaMail_ sessions via _JNDI_ so that infrastructure for mail is handled.

We would be using “ **jbpm-server-7.37.0.Final-dist** ” version for this example.

## Configure Mail Session in wildfly

In the standalone configuration for _jBPM_ we need add below configurations.

#### Configure Socket binding for smtp-port

```
        <outbound-socket-binding name="mail-notification-smtp">
            <remote-destination host="smtp.gmail.com" port="465"/>
        </outbound-socket-binding>
```

**host** -: host name of SMTP server

**port** -: port no of SMTP server.

#### Configure Mail-Session in Mail subsystem

```
            <mail-session name="notification" jndi-name="java:/notificationMailSession" from="youremailid@gmail.com">
                <smtp-server outbound-socket-binding-ref="mail-notification-smtp" ssl="true" username="youremailid@gmail.com" password="yourPassw0rd"/>
            </mail-session>
```

**from** -: From address for your emails (Valid email account on SMTP server).

**username** -: username for the email account

**password** -: password for the email account.

Add below system property to standalone.xml file.

```
    <system-properties>      
       <property name="org.kie.mail.session" value="java:/notificationMailSession"/>
    </system-properties>
```

#### Configure user info for Human…

[View original post](https://techblogtoprogram.wordpress.com/2020/05/29/how-to-configure-notification-for-human-task-in-jbpm/) 423 more words
Influential AR people I follow on Twitter
Tags: ar, augmentedreality, twitter
Published: 2020-05-30 14:20:46

This is a list of influential people in AR industry who I follow on Twitter. I didn’t add people who just retweet but people who really gives value.
## Matt Miesnieks

[@mattmiesnieks](https://twitter.com/mattmiesnieks)

His recent company [6D.ai](http://6d.ai) was acquired by Niantic. His AR journey started 2009 in Layar according to his [LinkedIn](https://www.linkedin.com/in/mattmiesnieks). After that he started a company called Dekko which tried to develop augmented reality operating system. They made really good AR app (pre ARKit) for iPad 2 which didn't have the computing power or the sensors of the latest iPads. He also worked as an investor at Super Ventures.

Matt has somewhat active Medium profile but the quality is amazing. One of my favorite posts is [this](https://medium.com/6d-ai/introducing-6d-ai-and-our-master-plan-a39b58ce58e8) where he explains the idea behind 6D.ai. I enjoy listening his talks and one recent to start with is this [https://youtu.be/d1VQyVhWixY](https://youtu.be/d1VQyVhWixY) even though there wasn't enough Matt imo.

## Ori Inbar

[@comogard](https://twitter.com/comogard)

Founder of Ogmento that  became FlyBy that's code was used in Tango (later ARCore) and ARKit (source is Matt Miesnieks section from "Creating Augmented and Virtual Realities" book and sorry if I misunderstand it). At the moment he is working at Super Ventures which he founded. He is also working behind AWE XR (as a founder) which is a really big and influential spatial computing event.

He has some interesting articles on Medium [https://medium.com/@oriinbar](https://medium.com/@oriinbar) even though he is not that active.

## Robert Scoble

[@Scobleizer](https://twitter.com/Scobleizer)

Robert is doing spatial computing research and strategy at Infinite Retina which is "full-service agency" [[https://infiniteretina.com/](https://infiniteretina.com/)]. He is probably more popular from tech in general and not so much from AR but I included him here because it's what he is now doing.

Robert's Wikipedia page [https://en.wikipedia.org/wiki/Robert_Scoble](https://en.wikipedia.org/wiki/Robert_Scoble) (which didn't contained anything interesting imo). He also has blog [https://scobleizer.blog/](https://scobleizer.blog/) but I haven't read it to say anything about it. He have posted some good articles on his LinkedIn.

## Charlie Fink

[@CharlieFink](https://twitter.com/CharlieFink)

He is XR consultant, Forbes tech columnist and author. His Forbes articles are really good [https://www.forbes.com/sites/charliefink/#20cc3d074e81](https://www.forbes.com/sites/charliefink/#20cc3d074e81).

## Tom Emrich

[@tomemrich](https://twitter.com/tomemrich)

Current VP of product at 8th Wall which is offering tools to create AR and VR experiences for browser. He is advisor and former partner at Super Ventures.

I like his blog and he is active writer [https://medium.com/@tomemrich](https://medium.com/@tomemrich).

---

Should I add someone? Incorrect information? Please leave a comment to fix my mistakes.
Coding challenge: Generate a Tree on your computer
Tags: javascript, challenge
Published: 2020-05-30 14:15:18

Dear JavaScript programmer,

Imagine yourself being an artist... You have big dreams of drawing all sort of objects. But in order to prove your skills you first take the challenge and attempt to draw a tree.

When about to start you also remember... you’re also a coder! You don’t want to draw a tree with pen and paper but you want to draw it with code.

First you propose to take it easy and draw something symmetrical... but then you plan to tune the code to make the tree more realistic.

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

Your guide in this challenge are the above two images and the following stub HTML page.

The stub HTML page provides you with the canvas where the artist in you will express himself.

The stub code also provides you with a function: `line` – the only function, outside regular JavaScript constructs, you need to use to draw your trees.

```html
<canvas id="canvas" width="800" height="600"></canvas>

<script>
    const canvas = document.getElementById('canvas');
    const ctx = canvas.getContext('2d');

    const line = (x1, y1, x2, y2) => {
        ctx.beginPath(); 
        ctx.moveTo(x1, y1);
        ctx.lineTo(x2, y2);
        ctx.stroke();        
    }

    // write here...

</script>
```

Next level: If you feel adventurous, you can take this challenge to the next level: draw thicker trunk – thinner branches, draw trunk in brown – leaves in green, etc. (require individual research of canvas API).

#Conclusion

I’m hoping that by working on this challenge you’ll have lots of fun. By solving it you’ll also get the chance to explore canvas drawing as well as some very important programming techniques.

Please post your solution as well as trees (images) in the thread.

#Note

You can work on your challenge in any environment your prefer. If you want to quickly prototype the code you can use [codeguppy.com](https://codeguppy.com) canvas based environment. In codeguppy.com, `line` is already a predefined function (so you can skip the above stub).

#Solution

First try to solve this challenge on your own and share the solution (as well as the generated trees) in the comments.

However, if you want to see the solution you can find it [here](https://codeguppy.com/code.html?t=fractal_tree).

Happy coding!
Finding clients as freelancer
Tags: webdev, work
Published: 2020-05-30 14:13:12

Hi!

I have for quite some time now looking for freelance work to have next to my ordinary work. Any tips? How do i get started? I do use facebook  often to find local needs. 

Why is there no job portal on dev.to? I mean there would be a great platform to find peers when you are in need.

If anyone looking for a long-term relationship dont hesitate to send me an mail.
What’s your alternative solution? Challenge #54
Tags: challenge, javascript, codenewbie, learntocode
Published: 2020-05-30 13:42:42

# About this series

This is series of daily JavaScript coding challenges... for both beginners and advanced users.

Each day I’m gone present you a very simple coding challenge, together with the solution. The solution is intentionally written in a didactic way using classic JavaScript syntax in order to be accessible to coders of all levels.

Solutions are designed with increase level of complexity.

## Today’s coding challenge

```
Create a function to return the longest word(s) in a string

```

(scroll down for solution)

## Code newbies

If you are a code newbie, try to work on the solution on your own. After you finish it, or if you need help, please consult the provided solution.

## Advanced developers

Please provide alternative solutions in the comments below. 

You can solve it using functional concepts or solve it using a different algorithm... or just solve it using the latest ES innovations.

By providing a new solution you can show code newbies different ways to solve the same problem.

## Solution

```javascript
// Solution for challenge48

var text = "Create a function to return the longest word(s) in a sentance.";

println(getLongestWords(text));

function getLongestWords(text)
{
    var words = getWords(text);
    
    var maxSize = 0;
    var maxPositions = [];
    
    for(var i = 0; i < words.length; i++)
    {
        var currWordSize = words[i].length;
        
        if (currWordSize > maxSize)
        {
            maxSize = currWordSize;
            maxPositions = [ i ];
        }
        else if (currWordSize === maxSize)
        {
            maxPositions.push(i);
        }
    }

    return getElements(words, maxPositions);
}

// Get only the elements from specified positions from the array
function getElements(ar, arPositions)
{
    var arNew = [];
    
    for(var pos of arPositions)
    {
        arNew.push(ar[pos]);
    }
    
    return arNew;
}

// Returns an array with the words from specified text
function getWords(text)
{
    let startWord = -1;
    let ar = [];
    
    for(let i = 0; i <= text.length; i++)
    {
        let c = i < text.length ? text[i] : " ";

        if (!isSeparator(c) && startWord < 0)
        {
            startWord = i;
        }
        
        if (isSeparator(c) && startWord >= 0)
        {
            let word = text.substring(startWord, i);
            ar.push(word);
            
            startWord = -1;
        }
    }

    return ar;
}

function isSeparator(c)
{
    var separators = [" ", "\t", "\n", "\r", ",", ";", ".", "!", "?", "(", ")"];
    return separators.includes(c);
}

```


To quickly verify this solution, copy the code above in this coding [editor](https://codeguppy.com/code.html) and press "Run".

> Note: The solution was originally designed for [codeguppy.com](https://codeguppy.com) environment, and therefore is making use of `println`. This is the almost equivalent of `console.log` in other environments. Please feel free to use your preferred coding playground / environment when implementing your solution.