teleren/devto huggingface dataset:
Experience on React project with hooks 
Tags: react, reacthooks, beginners
Published: 2020-03-31 17:25:41

I was building a small project with my friends on shopping cart scenarios.

Initially it was quite simple. Using create-react-app command the app got created. Later on, components design happened. Components were created using class syntax.

And for styling we used bootstrap4, but one of the collaborator wanted to try out material-UI and hence we included material UI and re-wrote all four components. Using material-UI was just copy paste in the beginning. Later on we made changes in material-UI APIs to adjust it to our requirements.


Now, the project has all components with class syntax and all the API calls are happening in App component. The props are getting passed to child components and actions from child components are moving back to App component and handling those actions inside App and changing the state and passing the updated props to children again.

As we added more components, handling action became more complex and components code were getting bigger and bigger. 

This is the time that we decided to go with redux. But this time, we thought of including hooks also to save further refactoring. Using hooks was fun.

We created reducers, actions and used useState, useSelector, useEffect, useDispatch hooks.
The class components got converted to functional components.

After hooks, Component code looks smaller than before and it was declarative literally. 
We had to use redux thunk as actions were synchronous and we had to make an API call as one of the action. Surprised to see 14 lines of redux thunk code though.

Now the project uses redux thunk and the concept of redux thunk was simple. It was dispatching promisified action. 

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


The future goal is to include all react features in the project and understand the core concepts of react.
Better Coding: JavaScript Conditionals
Tags: codenewbie, javascript
Published: 2020-03-30 08:49:32

For my latest coding side project, [Dice Game](https://alexlsalt.github.io/dice-game/) (adapted from my Jonas S. JS course on Udemy), one piece of the program's logic requires that rolling the die results in a variable holding a random number between 1 and 6. Depending on which number the variable logs, one of six images of the face of a die then shows up on the screen with a bit of nifty DOM manipulation.

When I was first writing out the code, my initial thought was to write out an if/else statement with all of the conditions of the random variable corresponding with each image of the face of the die, as follows:


        
    let dice = Math.floor(Math.random() * 6) + 1;
    
    let diceImage = document.querySelector('.dice');
    diceImage.style.display = 'block';
     
    if (dice === 1) {
      diceImage.src = 'dice-1.png';
    } else if (dice === 2) {
      diceImage.src = 'dice-2.png';
    } else if (dice === 3) {
      diceImage.src = 'dice-3.png';
    } else if (dice === 4) {
      diceImage.src = 'dice-4.png';
    } else if (dice === 5) {
      diceImage.src = 'dice-5.png';
    } else if (dice === 6) {
      diceImage.src = 'dice-6.png';
    }
      

But then I learned that I could update the diceImage.src using type coercion by adding parts of the image name as a string with the corresponding image number sandwiched in between:
        
    var diceImage = document.querySelector('.dice');
    diceImage.style.display = 'block';
    diceImage.src = 'dice-' + dice + '.png';
      

Voilà! Three lines of code instead of sixteen!

It's things like this that make me really excited about JavaScript and its (and my!) capabilities. Not only are there a lot of cool programming concepts to keep learning, but there are also endless ways to make coding those programs more and more readable, clear, and effective.

_This post was originally published on February 11, 2020 on [my blog](https://alexlsalt.github.io/blog)._
Always remember that you have more time.
Tags: productivity, relax
Published: 2020-03-30 11:52:41

---
title: Always remember that you have more time.
published: true
description: 
tags: productivity, relax
cover_image: https://thecsrjournal.in/wp-content/uploads/2019/02/Time-zone.jpg
---

The world is in a situation that no one ever predicted. The majority of countries are on some form of lockdown, job security is non-existent, and the economy is taking a massive hit! I, like many others, am trying to make the most out of a bad situation by improving on my skills and knowledge while isolating, but you can also take this time to reset.

I have a constant battle with myself whenever I decide to take some time to relax as I feel like I could be doing something so much more productive with my time. I love to play video games, watch movies, exercise and socialise, but all of these take up time which I feel like I should either be improving my skills or just generally being more productive. I feel like this because I constantly see other developers on social media creating amazing applications, fantastic front-end designs and well thought out code snippets, and I feel like I should be doing the same. This isn't true though! 

This is why my thoughts come back to the pandemic that is happening across the world right now and the fact that with time, we will all get through this! We all need to remember that we still have so much time to do things in life and that each and every person will be at different points of the journey. It's okay if you want to spend a day relaxing and playing video games. It's okay if you want to binge Netflix. It's okay if you want to spend the day outside with friends (when we are out of isolation). If that makes you happy then just do it, you'll always have other time to work on yourself. We are people, not machines, and people do burnout.

Take the time that you've been given to reflect on where your life is going, what makes you happy and what you can do to be even happier, and focus on that! 

I hope you enjoyed reading the thought process that I turned into a blog post, I'm off to play video games so if you want to hear more from me make sure to hit me up on Twitter @callam_woolgar.

Stay safe, happy coding!
Daily Developer Jokes - Monday, Mar 30, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-03-30 12:00:22

---
title: "Daily Developer Jokes - Monday, Mar 30, 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=Monday%2C%20Mar%2030%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/5e1259a186412.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___: Why do developers use mechanical keyboards?

___A___: To strongly type their code.
 -->
How to use SpringFox 2.9.2 with Spring HATEOAS 2+ on a Gradle Project
Tags: springfox, springhateoas, java, gradle
Published: 2020-03-30 15:07:55

---
title: How to use SpringFox 2.9.2 with Spring HATEOAS 2+ on a Gradle Project
published: true
description: Simple guide to use both Spring projects
tags: SpringFox, SpringHATEOAS, Java, Gradle
---

A few weeks ago, I started a new project where I was challenged to use Spring HATEOAS. Well, I thought that would be really simple to implement. In fact it is, since Spring projects are well documented. What I wasn't expecting was that Spring Fox 2.9.2 and Spring HATEOAS 2+ were not compatible. This is due to the fact that Spring Fox uses the Spring Plugin Core (1.2.0.RELEASE) while Spring HATEOAS uses a newer one. 

Searching for a solution, I could find the following issue on Spring Fox github repository: {% github https://github.com/springfox/springfox/issues/3052 %} One of the solutions from this page says that we should include Spring Plugin Core 1.2.0.RELEASE as dependency.

 However I'm using gradle which has its own dependency management rules. Due to this fact, we must force the dependency download as bellow:

compile("org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE") { force = true }

After adding the dependency, the project wasn't unable to run yet, not even starting. I had to do more search in order to fix that. At the end, I had to override the "discovers" bean from Spring HATEOAS with my own implementation on my project. 

{% gist https://gist.github.com/otaviotarelho/7135c0e14e6c74f6b30096824f77505e %}

Only after that I could successfully use Spring Fox and Spring HATEOAS together. I created this post to simplify to other devs that are searching for a solution for the same problem. Hopefully It will be useful for someone.
Checking for mobile in your template files
Tags: wordpress, php
Published: 2020-03-30 19:20:06

I am currently working on a site that makes heavy use of ACF Flexible COntent fields and it's great. We load a lot of things conditionally though and one of the sections is a hero section with a video background that auto-plays. This is great except for on mobile, which I received a request to have it use a background image instead of the video.

After a quick little search, I came across this function `wp_is_mobile()
` (https://developer.wordpress.org/reference/functions/wp_is_mobile/)

I had never heard of it before, but I figured it will work better than nothing and be quick to implement if it does work. Well, after my initial test it does work! Upon closer inspection the function is filterable too so as a developer we can add our own specific checks as well if we need it.

I thought this was pretty neat and so I wanted to share. What are some WP functions you have come across that aren't so well-known?
My name is Storage, Local Storage 😎
Tags: html, javascript, beginners, basics
Published: 2020-03-30 20:20:09

All kidding aside 😅, sometimes you need a place to save your website's data. A place where user choices, website configurations can sit, even if you refresh your page, or reopen your browser. `.localStorage` is a good place for this use-case.

`.localStorage` is a storage of key-value pairs linked to a site through its URL. Its API is pretty straightforward. 

```javascript
window.localStorage.setItem("myData", "2");
// ^ Its .setItem() accepts two parameters: key, value. We can drop the window. prefix.
localStorage.getItem("myData");
// ^ returns "2"
```

You can inspect the storage in Chrome's Application tab under the Local Storage item.

![Local Storage Inspection](https://dev-to-uploads.s3.amazonaws.com/i/vcwysmbruh2rohxc9myg.png)

We can store non-primitive data types in `.localStorage` as well. Let's say we would put an object there.

```javascript
localStorage
  .setItem("userData", { name: "David", surName: "Programmer"});
localStorage.getItem("userData");
// it's returning "[object Object]"
```

Why is the previous code snippet returning our object upon calling `.getItem("userData")`? Because the `.localStorage` stringifies the value given to it before saving it. The default conversion from an object to string is `"[object Object]"`. That means that in order to preserve the true content of our data, we need to convert it before saving to the storage.

The preferred way is to use `JSON.stringify()` and `JSON.parse()` which functions stringify and de-stringify their inputs.

```javascript
const data = { name: "David", surName: "Programmer" };
const stringifiedData = JSON.stringify(data);
localStorage.setItem("userData", stringifiedData);
JSON.parse(localStorage.getItem("userData"));
// it's returning now our original object
// {name: "David", surName: "Programmer"}
```

`localStorage` can store up from 5 MB up to 10MB of data depending on your browser for a given domain. It is not accessible on the server, only the client's browser. It can come in handy for saving persisting data on your website.
3 Strange Exceptions: HTTPRequestException, IOException, SocketException
Tags: csharp, aspnetcore
Published: 2020-03-31 00:25:50

Hi guys,

Hope you're all well during these times. I'm currently working from home and have run into an issue that I've been pulling my hair out over. Not sure how to solve this one, any help is appreciated. Please see my post on StackOverflow if you could, thanks in advance!

https://stackoverflow.com/questions/60922289/3-strange-exceptions-httprequestexception-ioexception-socketexception
A free dummy data generator and API mocking tool — mockaroo
Tags: dummydata, mocking, database, testing
Published: 2021-05-24 12:56:25

---
title: A free dummy data generator and API mocking tool — mockaroo
published: true
date: 2019-11-06 08:13:11 UTC
tags: dummydata,mocking,database,testing
canonical_url: https://medium.com/tech-epic/a-free-dummy-data-generator-and-api-mocking-tool-mockaroo-aab842805613
---

### **A** free dummy **data** generator and API mocking tool — mockaroo

#### Get dummy data for your testing DB

![](https://cdn-images-1.medium.com/max/400/0*WcsrBM7nExqdslYr.png)<figcaption><a href="https://mockaroo.com"><strong>Mockaroo</strong></a></figcaption>

[**Mockaroo**](https://mockaroo.com) is website where you can generate the dummy data randomly. [**Mockaroo**](https://mockaroo.com) lets you generate up to 1,000 rows of realistic test data in CSV, JSON, SQL, and Excel formats per time. Mockaroo also have pricing plan for the ability of generate more rows per time.

Because [**Mockaroo**](https://mockaroo.com) generate random data, so if you want 10 000 rows of data you just click Download button ten times and it will generate ten files of 10 000 data randomly for you.

* * *
UX design company in Mohali, India
Tags: ux, uxdesign, uiweekly, design
Published: 2020-03-31 10:21:53

When it comes to professional affairs, reliability is one of the major contributors to a healthy and prosperous relationship. To create that healthy space, it is your absolute right to be aware of all the solid reasons why you should approach us. UIUX Studio has years of experience in the field of designing that we keep extending the capability of our potential as a design team. So, UIUX Studio is the best UX design company in Mohali, India (https://bit.ly/3av8oRc). Hire our designers for making your business as a brand.
An Open Source Toolchain For Natural Language Processing From Explosion AI
Published: 2020-03-31 11:56:19

<p>The state of the art in natural language processing is a constantly moving target. With the rise of deep learning, previously cutting edge techniques have given way to robust language models. Through it all the team at Explosion AI have built a strong presence with the trifecta of SpaCy, Thinc, and Prodigy to support fast and flexible data labeling to feed deep learning models and performant and scalable text processing. In this episode founder and open source author Matthew Honnibal shares his experience growing a business around cutting edge open source libraries for the machine learning developent process.</p><p><a href='https://www.pythonpodcast.com/explosion-ai-natural-language-processing-episode-256/'>Listen Now!</a></p>
Cuprite: headless Chrome Ruby driver for Capybara
Tags: ruby, rails
Published: 2020-03-31 12:12:32

Ferrum + Capybara = Cuprite
Cuprite is a driver for Capybara that uses Ferrum — a minimal-dependency pure-Ruby driver for running headless Google Chrome instances.

If you’re already using Capybara, Cuprite gives you all the benefits of Ferrum, but without the overheads of having to switch APIs. Because Ferrum employs Chrome's native DevTools Protocol (CDP), it doesn't need anything special in order to operate Chrome or Chromium in headless mode, unlike some alternative solutions.

https://evrone.com/cuprite
The 1st program and the magnificent print statement (Python programming language)
Tags: python, tutorial
Published: 2020-03-31 12:54:22

   In most of the programming languages, the 1st program a student learns to write is the so-called “Hello World!” program.

**print(“Hello World!”)**

   This one-line program will give an output (print on the screen) the message **Hello World!**.
   The things that this simple program is showing us, are the following:

*– to print something on the screen, the print statement should be used. 
– the message that we want to be printed is written between quotation marks “”.
– what is with round brackets? The brackets are part of the print statement: print(). The message that needs to be printed must be inserted between the brackets.*

*Can ‘ be used instead of “?*
**Answer:** Yes, Try it yourself.

*Are there any benefits when using one or another?*
**Answer:** Yes, and I will let you figure it out by writing the following examples.

**print(‘Dog’s bone’)**
             ^
SyntaxError: invalid character in identifier

**print(“Using this ” mark here will give an error!”)**
               ^
SyntaxError: invalid character in identifier

**print(‘Here the sign ” will not give any error’)**

**print(‘Here the sign ” will not give any error’)**

   If our message contains **‘** we must enclose it between **” “**. The same situation is also for the **”** sign, it must be enclosed between **‘ ‘**.

   *But what can we do if we really want to write a message that contains ‘ and it is enclosed between’ ‘?*
**Answer:** Python will let us do this with the help of an escape character.

The escape character is a backslash (\) plus the character/sign that we want to be included in the message (character/sign that normally would give a syntax error or with the help of backslash, can have a different meaning ).

Now, let’s try again to write in the console the examples from above where Phyton complained about a syntax error, but this time using backslash.

**print(“Using this \” mark here will give an error!”)**
**print(‘Dog\’s bone’)**

See you next time.
Whack-a-Mole meets Coronavirus
Tags: beginners, javascript, codenewbie, gamedev
Published: 2020-03-31 20:28:33

#Whack-a-Corona

This is a stressful time. Coronavirus is everywhere, and a very serious threat, but if you're looking for a fun semi-distraction, check out this cool game my partner and I made for a coding bootcamp JavaScript project! 

![Alt text](https://media.giphy.com/media/YRiEbNTEEXKPBPo4ly/giphy.gif)

It is basically whack-a-mole with viruses. Click [here](https://sylviapap.github.io/whack-a-virus/) to play.

We are full-stack web development students with Flatiron School in San Francisco. For our vanilla JavaScript project, my partner and I made this simple game. Our full version includes a backend and user save functionality, but the following version is just a simple frontend demo until we host backend. We are also hoping to expand this to include things like, for example, helpful facts about Coronavirus/COVID-19/social distancing/health tips that appear throughout the game.

We hope you enjoy! Let us know your thoughts in the comments.

##Links to code:
* [Frontend](https://github.com/brookebachman00/kill_a_corona_frontend_js)
* [Backend](https://github.com/brookebachman00/kill_a_corona_backend_rails)
* [Slightly modified frontend only code](https://github.com/sylviapap/whack-a-virus)
* My partner Brooke's [LinkedIn](https://www.linkedin.com/in/brooke-bachman/) and [GitHub](https://github.com/brookebachman00)
Linked Lists - Data Structures in JavaScript: Part #1
Tags: javascript
Published: 2020-04-01 18:37:45

Today I’ll be covering Linked List data structure in JavaScript. Even though it’s not native to JS, knowing it is essential to being a good engineer.

A linked list is a sequential collection of elements. Each element is called a node. Every node has a pointer to the following node and/or the previous node. The first element is called the head node and the last element is called the tail node.

The 3 most common types of Linked List are  Singly Linked List, Doubly Linked List and Circular Linked List.

![Alt text of image](https://raw.githubusercontent.com/Urfan196/MyFIles/master/types.png?token=AMQWY7AHMQJO7ELMBSI2NES6QOZF4)

As you can see in the image above, in the Singly LL, the tail points to null. In the Doubly LL, both the head and tail point to null. In the Circular LL, the head and tail point to each other rather than null.

So, why should we use linked lists to store data instead of arrays? The main difference between them is how they are stored in memory. 

Arrays store all elements in a contiguous block of memory, which means each element of an array is located right next to each other. Because of this, an array provides direct (aka random) access to any element. For example, to get element 10 we can just jump directly to that position and grab it without having to step through the first 9 elements.

In linked lists, on the other hand, elements can be stored anywhere in memory. Because of this, a linked list only provides sequential access such that we can’t just directly jump to a certain position. To get the 10th node, you need to first step through the other 9 elements. 

This is one of the drawbacks of using linked lists. Nevertheless, they are still extremely useful in that they add and remove elements much faster than arrays. 

When adding an element in an array, if a block of memory is occupied by something else, then the entire array might have to be relocated in order to keep the contiguous block of memory. In a linked list, all you need to add an element is to make a new node anywhere in the memory and make the previous element point to it. That way, you never have to move your elements. To delete an element, just change what the preceding element points to.

Another difference between linked lists and arrays is the time complexity, as demonstrated in the table below.

![Alt text of image](https://raw.githubusercontent.com/Urfan196/MyFIles/master/timecomp.png?token=AMQWY7HGZ4OL6PEI6WCWSVS6QOZEA)
Feed of posts for tags I'm following
Tags: help
Published: 2020-03-31 19:32:33

---
title: Feed of posts for tags I'm following
published: true
description: How can I see a feed of posts that include the tags Im following?
tags: help
---

Hi DEV. I haven't been able to figure this out yet. How can I see a feed of posts that include the tags Im following?
Sometimes I wan't to see posts that have at least one tag I'm following, but not so interested in posts that don't have any tags I'm following.
Declaratie proprie raspundere COVID 19 Romania Oficiala
Tags: romania, covid19, declaratie
Published: 2020-04-01 02:53:55

# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/






































# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/
# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/
# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/
# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/
# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/
# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/
# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/
# Declaratie proprie raspundere coronavirus romania
https://www.declaratie-covid19.net/