teleren/devto huggingface dataset:
The one model to truly develop your ideas
Tags: uml, classdiagram, sequencediagram, designpattern
Published: 2019-10-29 11:49:08

---
title: The one model to truly develop your ideas
published: true
description: Write proper code and avoid error by using UML diagrams, a standard that will let you design you application properly from the ground-up
tags: uml, classDiagram, sequenceDiagram, designPattern
cover_image: http://anastasionico.uk/img/blog/how-to-design-your-software-using-uml-diagrams-with-case-study.jpg
---

Hi there,

Did you know that each of us will have at least 33 successful ideas over our lifetime?.

Ideas that can change our life definitely and for the better.

That's how Google and Facebook were born!

## How to design your ideas into software


I know that as a passionate developer, you work constantly on **improving your web applications** and **sharpening your skills**.

Learning the concept behind a new function in your favourite programming language can be truly satisfying at a time.

It is also true that all **the code your write was born from an idea**, the success of the application depends on how well designed is the process to develop that idea to reality.

This is true for startups and for multi-billion-dollar businesses in Wall Street.



## Develop your ideas

How can you be sure that you are developing your ideas in the best way possible?

You see, we all get excited when it is time to act.

The reality is that we must block some of that time to plan, and plan effectively is not an easy task.

We can spend months on a certain part of our application to find out that it is not going to be scalable and it creates errors in another part of our code.



## How diagrams are saving our world

The good news is that there are standards, developed by very smart people that are allowing us to write better applications and is an easy way.

We do this by **leveraging UML**.

A set of rules that let us transform our ideas in clear diagrams easy to design and most importantly easy to understand,

UML diagrams are used to describe how applications work but also describe design patterns and actors' flow.



If you want to skill up your understanding of how to create reliable applications and how to use design patterns you MUST learn how to read and write UML diagrams.


You can do it now with a simple case study as a tutorial.

[READ CASE STUDY NOW](http://anastasionico.uk/blog/design-software-with-uml-class-diagram-sequence-diagram)
Weekly Cloud-Native Digest #18
Tags: weeklydigest, cloud, news
Published: 2019-10-29 11:31:11

---
title: Weekly Cloud-Native Digest #18
published: true
date: 2019-10-29 11:13:30 UTC
tags: Weekly Digest,cloud,news
canonical_url: https://educosta.dev/blog/weekly-cloud-native-digest-18/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/0ov6xhnzgga51ad9pkz7.jpg
---

Save  time and stay up-to-date with what’s going on in the Cloud-Native  ecosystem. Every week a collection of useful links with videos, articles  and more. 

- [Why  Microservices Should Be Event Driven: Autonomy vs Authority - Going  from authority to autonomy and embracing eventual consistency By  @christianposta](https://blog.christianposta.com/microservices/why-microservices-should-be-event-driven-autonomy-vs-authority/)
- [Event-Driven Architecture and the Outbox Pattern](https://medium.com/engineering-varo/event-driven-architecture-and-the-outbox-pattern-569e6fba7216)
- [Weekly Cloud-Native Digest #17](https://educosta.dev/blog/weekly-cloud-native-digest-17/)
- [CQRS and Event Sourcing - In this talk, @gregyoung gives a good overview of how ES and CQRS work and what problems it solves.](https://youtu.be/JHGkaShoyNs)
- [How  to build a Serverless Twitter bot - Build a bot that will retweet at  regular intervals the most relevant tweets. By @LorenzoTenti](https://dev.to/lorenzotenti/how-to-build-a-serverless-twitter-bot-lph)
- [Installing Google Cloud SDK on Windows - See the steps to install the Google Cloud Sofware Development Kit on Windows.](https://educosta.dev/blog/installing-google-cloud-sdk-on-windows/)
- [Building Event-driven Microservices Using CQRS and Serverless. By @kennybastani](https://www.kennybastani.com/2017/01/building-event-driven-microservices.html)
- [Cloud Naming Convention - Consistent and descriptive naming of resources has many benefits.](https://stepan.wtf/cloud-naming-convention/)
- [25 Experts Share Their Tips for building Scalable Web Application](https://www.simform.com/tips-building-scalable-web-applications/)
- [Cloud Naming Convention](https://stepan.wtf/cloud-naming-convention/)
- [Tips  for Scaling Web Apps. A short list of things you can do, on basically  any web project, to improve performance, scalability, and cost.](https://alexgaynor.net/2015/may/27/tips-for-scaling-web-apps/)
- [An Illustrated Guide to OAuth and OpenID Connect](https://developer.okta.com/blog/2019/10/21/illustrated-guide-to-oauth-and-oidc) 									


The post [Weekly Cloud-Native Digest #18](https://educosta.dev/blog/weekly-cloud-native-digest-18/) appeared first on [Be Cloud Native](https://educosta.dev).
JavaScript Destructuring ES6: The Complete Guide
Tags: javascript, webdev
Published: 2019-10-29 11:04:56

In this article, we are gonna learn about [javascript](https://buginit.com/category/javascript/) destructuring that is introduced in ES6. You can learn all the features of javascript destructuring step by step with approx 17 types of examples.

The [JavaScript](https://buginit.com/category/javascript/) destructuring assignment syntax is expressive, compact and more readable that makes it possible to “destructured” (upwarp) values from arrays or properties from objects, into different variables.


# JavaScript Destructuring Expression (demo)

```
[a, b] = [50, 100];

console.log(a);
// expected output: 50

console.log(b);
// expected output: 100

[a, b, ...rest] = [10, 20, 30, 40, 50];

console.log(rest);
// expected output: [30,40,50]
```

### We can use JavaScript Destructuring in so many different ways.
## TLDR;
## #1 Array destructuring

[Array](https://buginit.com/tag/arrays/) destructuring is very much similar and straight forward, you can use an array literal on the left-hand-side of an assignment expression. Each variable name on the array literal maps to the corresponding item at the same index on the destructured array.

## #1.1 Basic variable assignment.

```
let foo = ['one', 'two', 'three'];

let [red, yellow, green] = foo;
console.log(red); // "one"
console.log(yellow); // "two"
console.log(green); // "three"
```


To read the full guide of 17 examples [click here](https://buginit.com/javascript/javascript-destructuring-es6-the-complete-guide/)
Lessons from Google's engineering teams, tricky bugs & Ruby refactoring
Tags: todayilearned, ruby, testing, career
Published: 2019-10-29 11:00:23

*TL;DR style notes from articles I read today.*

### [What Google taught me about scaling engineering teams](http://bit.ly/2WlQ1I9)

- Focus on building shared tools & abstractions across engineering teams. Dedicate people to it. 
- Create reusable training material & use it to onboard new engineers. 
- Agree on a set of standard coding conventions as early as possible. 
- Take code reviews seriously and use them to increase code quality. 
- Having lots of right data will solve many problems.
- Automate testing to scale your code. Rigorously focus on tests during code reviews too. 

*[Full post here](http://bit.ly/2WlQ1I9), 5 mins read*

---

### [Lessons from 13 years of tricky bugs](http://bit.ly/2qOcDVT)

- Some of the hardest bugs to track are those caused by code failing silently. 
- Event order matters. Imagine all event orders possible while writing code. 
- Complicated if statements & missing else statements cause more bugs than you think.
- Add enough logging so you can tell why the program does what it does. 
- Always test with zero & null conditions. 
- Reveal bugs by using random input. 
- Always check that an action that shouldn’t happen doesn’t happen. 
- Commit different changes in different commits and use clear descriptions of the changes.

*[Full post here](http://bit.ly/2qOcDVT), 9 mins read*

---

### [Lessons learned from the Ruby refactoring kata](http://bit.ly/2Ngp44w)

> “There is a certain amount of Zen to refactoring. It is hard at first because you must be able to let go of that perfect design you have envisioned and accept the design that was serendipitously discovered for you by refactoring. You must realize that the design you envisioned was a good guidepost, but is now obsolete.”

- Refactoring mercilessly is a great learning technique to learn about what different parts of the code do. 
- Don’t trust the initial tests completely. There are great chances they may not give you complete coverage.
- Extract method is a no-brainer refactoring with a good IDE support.
- Simplify if conditions with Guards.
- Preserve the public API if you have no control over client calls.
- “Code as data” sounds exciting in theory. It isn’t too great in practice. 

*[Full post here](http://bit.ly/2Ngp44w), 12 mins read*

---

*[Get these notes directly to your inbox every weekday by signing up for my newsletter, in.snippets(), here.](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
Please keep Silent,Pythonist! - Php is Still driving The Web
Tags: php, python, phpandpython, webdev
Published: 2019-10-29 10:59:02

Nowadays, Everywhere I go I hear the name "python" to where some people call it the the king on this web but they should keep in mind who the boss is. In my point of view I think we should treat the language as powerful according to the projects we are working on or The our development areas instead of considering things in general.

In programming itself, When it comes to compare Python and Php, I think Python can do more such as making real-life apps, scientific apps, and such. But When It comes to web I think Php can do more on the server than Python's powerful frameworks like Django. 

Consider this->

Old school Developers: Most of them, Their first choice is Php even though They can shift to Python.

New School Developers: Most of Them, They are coming with Python, as an easy and powerful programming language nowadays.

NB: This is my personal opinions, About These two programming languages (P & P)
But I recommend both to everyone who consider going deeply in Web development.

How Do you feel, Devs?
Basics of Docker
Tags: docker, devops
Published: 2019-10-28 12:41:18

Docker is a set of platform-as-a-service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.

Zap zap, the above definition might explain the technical details of docker but let's be honest, it's a little bit difficult to understand! right?

Suppose you need to supply the wine crates shipment for an offshore company and the company ordered the crates from 4 different vendors. So what do you do? You pack the bottles with the same vendor in crates and stack those crates onto a ship. You can also label the crates with the wine company logo sticker to identify which crate has which type of wine. Or you can also attach a bottle cap at one end of a crate connected to a wine bottle inside through which you get a sip of the type of wine the crate contains. We could have also sent the bottles without packaging but that would result in an unorganized pile of bottles that are prone to breakage.

Now, let's imagine that the wine bottles are the processes or services and the crate is the final app we built for our use case. It can be a web app, mobile app analogous to the vendor tags on crates. So docker provides us with that shipment on which we can package our apps to easily deliver to the client for the use. Furthermore, you can also expose the inner ports like the bottle cap above to interact with a process running inside docker container. Now we could have sent the project files or zip files to the client to run, which is prone to changing or dependency errors as client does not know neither does he need to know how to assemble the code to make it work. He can just start the container like opening the cap of wine bottle to consume the app.

Hope this helps out a bit in understanding the docker.
Delete one or more pages from a document in C#
Tags: dotnet, csharp, deletepage, removepage
Published: 2019-10-29 10:34:56

We’ll see how to remove a single page or a collection of specific page numbers from the source document using GroupDocs.Merger for .NET. This is a back-end API that can be integrated in any new or existing .NET application without any dependency.
__Does it require any software installation?__
Absolutely not. It doesn’t matter if MS Office or any PDF reader is installed on your computer. Using a single GroupDocs.Merger for .NET DLL you can develop a web, console or desktop application to delete the pages.
__How simple is it?__
Below are the steps to remove document page(s):
<!-- wp:list -->
<ul><li>
Initialise RemoveOptions class with page numbers to remove</li><li>
Instantiate Merger object with source document path or stream</li><li>
Call RemovePages method and pass RemoveOptions object to it</li><li>
Call Save method and pass desired file path to save resultant document</li></ul>
<!-- /wp:list -->
<!-- wp:paragraph --> 
{% gist https://gist.github.com/GroupDocsGists/f1bb9b5f075b0ffa76183b96a7799c91 %}
Get updates on new features and releases on <a href="https://blog.groupdocs.com/category/merger/">blog</a>.
<!-- /wp:paragraph -->
Day 21 : Harmony
Tags: hiphop, code, coding, lifelongdev
Published: 2019-10-29 03:12:37

_liner notes_:
- Saturday : Went to the radio station to do the show. I got an email on Friday letting the weekend hosts know that some other people will be using the second floor for a meeting. Thing is that I use the second floor to do my show. That's because I have my own equipment and don't want to get in the way of the other hosts. So, with that, I figured out how to fit everything on a table in the broadcast room. I forgot how hot that room could get will all the equipment in there! haha So yeah, you can check out the show at https://kNOwBETTERHIPHOP.com 

![Tickets for the movie Dolemite is My Name showing at the Enzian](https://thepracticaldev.s3.amazonaws.com/i/ldn4vyehmatg1ay4ya9f.jpg)

- Sunday : Since I wasn't able to finish uploading the show at the station, I did most of the post show work on Sunday. It's a good thing that I mowed the lawn on Friday. Worked a little on the layout for my new side project. Almost got caught up on my anime. Just tried to rest up as much as possible. Oh, I created a new t-shirt design I've had in my head for little while, laid it out in Photoshop, uploaded to Spreadshirt and ordered one. It should be here in a couple of day. It's amazing what technology can accomplish!

- Professional : Today, I answered a question on our community Slack channel. At least, I think I did, I haven't heard back. Other than that, I did some research on the next application I want to make. I was looking at the capabilities of the SDK and APIs and seeing what I can create. I think I may have found harmony with something I've been looking to build so I created a quick Glitch Express/Node app.

- Personal : So yeah, after work, I took a nap. haha Forgot that I hadn't written my blog for the day. Got up and have just been watching YouTube videos on GoPro Max. Mine should be coming in on Wednesday (same time as my shirt! Oh and that's also my birthday! Some cool gifts coming in!).

![Picture of the Golden Gate Bridge and bay in San Fransisco, California](https://thepracticaldev.s3.amazonaws.com/i/ihlijyrz3owpakeh67kj.jpg)

For the rest of the night, going to study up on Svelte because I want to use it on a project and some other database stuff on how I want my data to be stored.

Cool. Have a great day!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube TGfs9y0Im7E %}
I build a Website Screenshot API, curious what you guys think!
Tags: saas, node, webdev, javascript
Published: 2019-10-29 10:32:28

It started with me trying to figure out how to control a headless browser in Javascript. A few weeks later I had crafted a full [SaaS application](https://screenshotapi.net)

I created a writeup on [how I did it here](https://medium.com/swlh/building-a-website-screenshot-api-3aeb3f21b465?source=friends_link&sk=b686e528cc63841de887de1ff33ea698)

![ScreenshotAPI.net Homepage](https://thepracticaldev.s3.amazonaws.com/i/bdpbd2y2t9mxuep8fokh.png)

I'm curious what you guys think about it, would love some feedback!
How to useEffect vs componentDid/Will-unmount
Tags: react, javascript, books, lifecycle
Published: 2019-10-29 10:16:14

I was working on a project and I had to close out some modals, and realized there were both Class component modals and Functional component modals that were involved... so I decided for the class component I would use the life cycle methods and use useEffect for the functional components heres what they look like

##Lifecycle method

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


##useEffect Method

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

### The Similarities

Let's get the easy stuff out of the way how are they similar..?

thats right!

the **handleClick** function is the same barring the minor difference of using "const" in the functional component the logic of the actual function is pretty simple, if you click on the modal background or hit the _esc_ key it should call the function that closes the modal.

### The Differences

Now whats the difference? its how you handle the **event-listeners**,
you might notice that in class components if you have an *event-listener*
in it, and it _console.log("hello")_ and go to you google-developer tools 
and checked console, you might notice it console logs it 3 times, this is because you haven't done what I call a clean up listener aka the **removeEventListener** function call so it doesn't know when to stop listening to the click, once the modal is closed there is no need for the event listener to be active! other wise it would open and close immediately when you tried to open it!


in the useEffect you do this using a "clean-up function" which you can see in the return function, this removes the event listener when the component is no longer rendered,

the equivalent to this in the class component is **componentWillUnmount**
inside this you can add the clean up function and now the event listener is only active while the modal is open!


pretty fun and simple function that uses some cool features!
onChange trigger example with React
Tags: react
Published: 2019-10-29 09:52:36

Recently, I faced the issue. There is a form with some fields. Each field has several functions; functions do something. For example, one function writes the field name and its value into the object. Then the customer asks to add the buttons with specified values. When the button is clicked, the relevant field should update its value.
Here is the trigger hack that calls the onChange function of that field.

```js
function triggerInput(enteredName, enteredValue) {
  const input = document.getElementById(enteredName);

  const lastValue = input.value;
  input.value = enteredValue;
  const event = new Event("input", { bubbles: true });
  const tracker = input._valueTracker;
  if (tracker) {
    tracker.setValue(lastValue);
  }
  input.dispatchEvent(event);
}
```

[Live example link](https://codesandbox.io/embed/trigger-example-s68im?fontsize=14)
Libraries for functional webcomponents?
Tags: webcomponents, javascript, react, functional
Published: 2019-10-29 08:52:08

---
title: Libraries for functional webcomponents?
published: true
description: is it possible to write webcomponents like react hooks?
tags: webcomponents, javascript, react, functional
---

Hello people, I would like to open a discussion over functional webcomponents, do you know any? I really like the idea of React Hooks, and I enjoy them a lot. The documentation of webcomponents uses mostly classes. For external reasons I have to use webcomponents, I was wondering if people know of any good functional webcomponent package. 
So far I've found [hybrids](https://github.com/hybridsjs/hybrids) but I have no references about it.

Some questions I'm thinking:

1. What do you think of webcomponents? 
2. Would you like functional webcomponents?
3. Do you know any functional wc package?
3. Have you used any of them?

Regards and happy coding!
The cognitive complexity of learning.
Tags: devjournal
Published: 2019-10-29 08:47:36

I started writing a project in rust, and while I absolutely loved the experience of developing in rust due to the outstanding and strict comiper, it is very hard to write bad (do please try them out). But it's also really hard to learn and solve a problem of creating a programming language (what I'm doing) in my eyes, it's a bit to much.

I share a similar respect for Typescript for its ability to help you write maintainable code. However there is something to be said for writing prototypes in less strict bounds. Its not to say that the aforementioned languages are bad and I'm sure when I get the prototype nailed I will rewrite 2.0 in a stricter language, in my case cognitive complexity is what's been getting in my way, so I say to you, write version 1 in something a little easier first.

I switched to zig lang, and my god is it easy to work with Wasm and has the same sort of goals as rust. Its a happy middle ground that I am starting to explore. I'm sure there will be pitfalls but so far so good.
New PHP vulnerability - CVE-2019-11043
Tags: security, php, nginx
Published: 2019-10-29 08:28:42

"If you're running any PHP based website on NGINX server and have PHP-FPM feature enabled for better performance, then beware of a newly disclosed vulnerability that could allow unauthorized attackers to hack your website server remotely.
The vulnerability, tracked as CVE-2019-11043, affects websites with certain configurations of PHP-FPM that is reportedly not uncommon in the wild and could be exploited easily as a proof-of-concept (PoC) exploit for the flaw has already been released publicly..."
https://thehackernews.com/2019/10/nginx-php-fpm-hacking.html
Thoughts after I rm my home directory
Tags: discuss
Published: 2019-10-29 08:09:57

---
title: Thoughts after I rm my home directory
published: true
description: 
tags: discussion
---

Recently I have committed a big mistake: I `rm` my home directory. One good aspect of this bad situation is that I have backed up the code directory with `borg`. However, my `hexo` personal blog is not in the list. To make matters worse, most posts of this blog were stored locally. 

The mess is attributed to a simple command: `rm`. Although `rm` are usually treated as a source of memes  at which even newbies would smile knowingly, this worst case happened to me. Here is the command which cause a disaster: `rm -rf * '/home/<user_name>/.local/share/Trash/files'`. 

Well, I thought I specified a folder to delete everything(`*`) in the absolute path(path in the single quote) and expected so. But my home directory was empty after that. 

There is an another joke when we talk about `rm`: You should install `adobe` series in your filesystem because it would hold its own against `rm` for a while when you delete your `/` root stupidly. 

So the conclusion is that you need to `rm` files in the current working directory. If not, be aware of `* `, like the path you specify in the single quote, is part of argument to tell `rm` to delete files. So the command should be `rm -rf '/home/<user_name>/.local/share/Trash/files/*'`. I learned this lesson the hard way, and hope you never encounter this kind of issue.

With hindsight, I think I ought to back up files on a regular basis.