teleren/devto huggingface dataset:
MySQL tutorial - 5 Updating the data
Tags: mysql, beginners, tutorial
Published: 2021-03-07 23:52:33

In MySQL, data inside the table can be updated using `UPDATE` query. When updating the data, the data type must match with the data type that already specified in the column.

This is the basic query structure of `UPDATE` query. Notice that the `WHERE` clause is used to identify which data needs to be updated. If `WHERE` clause is not used, all of the data inside the table will be updated.

```
UPDATE table_name SET column_name(s) = value WHERE condition
```

This is the example of updating a data inside shop table with `id` equals 1.

```sql
UPDATE shop SET price = 12.5 WHERE id = 1;
```

If the update operation is completed, there is a number of rows affected inside the table.

The data update operation can be done for many columns. this is the example of updating a quantity and product's name in a data that has an `id` equals 2;

```sql
UPDATE shop SET quantity = 15, product_name = "Low Fat Milk" WHERE id = 2;
```

I hope this article is helpful for learning SQL, If you have any thoughts or comments you can write in the discussion section below.
College vs Self Taught vs Boot camps | Which one should you choose?
Tags: beginners, webdev, career, discuss
Published: 2021-03-07 23:44:07

---
title: College vs Self Taught vs Boot camps | Which one should you choose?
published: true
description: My thoughts on choosing between going to college to learn to program. Or if you should choose the self taught route or maybe even a bootcamp.
tags: beginners, webdev, careers, discuss
//cover_image: https://direct_url_to_image.jpg
---

 {% youtube N7Iqg1XWX7U %}

Hello, everyone! 

Today I wanted to discuss the good old debate of college vs being self taught or choosing to go to a boot camp. More specifically discuss my thoughts on which to choose and the routes that I have taken. 

So give the video a watch and let me know what you all think. As well as what decisions you all made I'm really curious to hear your thoughts.
Right Now, Precious Metals are Hot, Lets Create a Bot
Tags: node, javascript
Published: 2021-03-07 23:31:31

So I have always been curious of metal prices and how they fluctuate with the market. 

A couple weeks ago I came across a cool API that can provide metal prices called [Metals-Api](https://metals-api.com/). This service has a free plan for up to 50 calls per month, which was perfect for my personal use case of sending myself the prices every morning (looks like it could be a great tool for a paid platform as well). I also use telegram and recently also discovered they have a bot API That you can setup to send yourself messages in a Channel.

So I put the two together and combined it with a small node.js program and a cron job on a Digital Ocean Droplet that runs every morning. Low and Behold, metal prices daily! 

See my github repo for more information! 

{% github tryonlinux/telegram-metal-bot %}
Questions make you a better developer (Snack Pack #2)
Tags: webdev, discuss
Published: 2021-03-07 23:29:51

*Photo is of Phipps in Pittsburgh, PA*

# Ask better questions
---

**What makes a good question?**

Questions are complex and strange. A bad question won't get you much, a short incomplete answer maybe. A great question can get you a lot further.


Great questions will have **at least one of three things.**
- Specificity, but not too much.
- Phrasing, go in with a better mentality.
- Curiosity, ask questions that can be hard.

---

### Specificity
It's easy to see how vague questions have issues. Breaking down larger questions is part of being a developer.

EX: Googling something
```
How do I code a giant project? // It's too vague, break it down
How do I add to an array in JavaScript? // Much better, actionable
```

---

### Phrasing
The phrasing might be the most important of this list, you should always look to communicate clearly.

EX: When looking at a project's old code
```
Why would you code it like this? // Negative phrasing 
How can this code be improved? // Better phrasing
```

---
### Curiosity 
Finally, curiosity will bring it all together. These will be questions mostly for yourself. It's hard to have bad questions here, you will still learn. 

EX: When asking questions to yourself
```
How do I become a developer? // Good
How do I become a better developer? // Good
How do I make an existing project a PWA? // Also good
``` 


--- 
--- 
Good luck with whatever you're working on and ask better questions!

*My snack pack reads are intended for a quick read without any fluff or BS.*

Feedback is always welcome.
100 Bytes Of Wisdom: Day 22
Tags: career, learning, advice, sideprojects
Published: 2021-03-07 21:48:15

---
title: 100 Bytes Of Wisdom: Day 22
published: true
description: Bytes of Wisdom is a new project by Sam Jarman that brings together snippets of advice for software engineers
tags: career, learning, advice, sideprojects
//cover_image: https://direct_url_to_image.jpg
---

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

I think a trap a lot of developers get into when trying to upskill with a side project is they try to make a start-up or a company or something new or exciting. There's really no need. This is a practice. Sports stars don't try to invent some sort of new move when running drills, so why should developers?

When trying a learning something, just do something new to *you*, not necessarily new to everyone. The attempt will be more rewarding than the novelty of it. It doesn't have to be fast, new, shiny or epic or even finished. Just start and you'll learn more than you did if you didn't try. 

Heads up: As with any terse bit of advice, there will be exceptions of course, and subtleties and nuance that can't possibly be captured in a Byte of Wisdom. This has been what I've experienced, I'd love to hear yours in the comments too!

You can catch up with all the other bytes at http://bytesofwisdom.com
Using ReactFire & Redux To Build A CRUD App with Firebase Emulator
Tags: react, redux, firebase, tutorial
Published: 2021-03-07 21:46:49


## Overview
This video series covers [Create React App](https://create-react-app.dev/), [ReactFire](https://firebaseopensource.com/projects/firebaseextended/reactfire/), [Redux Toolkit](https://redux-toolkit.js.org/) and [Firebase Emulator](https://firebase.google.com/docs/rules/emulator-setup) to build a simple CRUD application. 

When I am developing solutions I like to find tools that make it easier for me to focus on adding value through the application and spend less time on the technical implementation. I believe this combination can be beneficial to you also, so please take a look.

### Setup, Login, Logout, And Testing With Firebase Emulator
{% youtube xOVqoVuY-5M %}
In part one, We set up the firebase project and connected it all to the firebase emulator for authentication and account creation all using reactfire. We will build the login screen and the home screen in this example. The starting point will be using a blank app generated with create-react-app


### Query, Add & Delete Docs Testing With Firebase Emulator
{% youtube FoMbciaDMzY %}
In part two we are querying documents from firestore and setting up the created crud actions using the reactfire firebase hooks


### State Management With Redux-Toolkit
{% youtube YmHEzjglRMk %}
Part Three we integrate redux-toolkit as a method for state management in the application


#### Links
ReactFire - [GitHub Project](https://github.com/FirebaseExtended/reactfire)
ReactFire Overview - [Documentation](https://firebaseopensource.com/projects/firebaseextended/reactfire/)
Firebase Emulator - [Overview](https://firebase.google.com/docs/rules/emulator-setup)
Ionic ReactJS: React Hook Form Multi-Step Form/ Form Wizard with IonSlides
Tags: ionic, react, tutorial, javascript
Published: 2021-03-07 21:12:17

# Overview
Create a multi-step form using React Hook Form and Ionic Framework React JS Components. I am using react hook form because I think it is a great library for managing forms and form validation. Ionic Framework IonSlides are a great container and user interface element for presenting the content to the user.

{% youtube cLiN50CzVWE %}
### 💥 Links

- Ionic Slides - [Documentation](https://ionicframework.com/docs/api/slides)
- React Hook Form - [Documentation](https://react-hook-form.com/)
- Ionic React Hook Form Playlist - [Video Series](https://www.youtube.com/playlist?list=PL2PY2-9rsgl1Bws-2bKZzymFC7phsJ5fw)
- Source Code - [Github Project](https://github.com/aaronksaunders/react-hook-form-wizard-example)
"How to install gcc in Windows 10" is broken
Published: 2021-03-07 20:44:13

I tried to load a C compiler, and chose to follow Sudev Suresh Sreedevi's instructions in his article "GCC for Windows, How to install gcc in Windows 10 (the easier way).
The first step says to click on the link named "MinGW Official website" and it would take me to 'Downloads'.
Well it didn't, so I gave up!
My first blog post
Tags: firstpost
Published: 2021-03-07 20:43:12

So as you can tell, this is my first (ever) blog post, hopefully not the last, I'll most probably write about Web-Development, HTML, CSS and javascript in a fun way (will try to use a lot of memes) but as I learn new stuff, I'll try to write about them too.

So, will probably see you in the next post.

Cheers😉
Some links from Ignite 2021
Published: 2021-03-07 20:39:14

<span>Photo by <a href="https://unsplash.com/@garyellisphoto">Gary Ellis</a> on <a href="https://unsplash.com/s/photos/ignite">Unsplash</a></span>

I had no time to watch Ignite 2021, so i have looked at the various announcement made :

- [Book of news](https://news.microsoft.com/ignite-march-2021-book-of-news/)
- [1 hour video focusing on Infrastructure update](https://www.youtube.com/watch?v=QiT1vS83fpo)


Hope this helps !
Removing N oldest entries from a Redis stream
Tags: redis, streams
Published: 2021-03-07 20:25:39

---
title: Removing N oldest entries from a Redis stream
published: true
description: 
tags: redis, streams
cover_image: https://user-images.githubusercontent.com/5732023/110253573-5c42de80-7f8b-11eb-853e-8f1949f8638c.png
---

[Streams](https://redis.io/topics/streams-intro) are a relatively new feature in Redis. If you've already used them it's possible that your use case is similar to the following one:
1. Events are flowing into your system and you store them in a Redis stream.
2. Your application loads oldest N events and processes them.
3. Once your application finishes processing the events you want to delete the N oldest events you've just processed.

The problem arises in the last step - what's the best way to delete the processed records? 

One option is to use the [XDEL](https://redis.io/commands/xdel) command with ids of the events as the argument. This might be quite a heavy task for Redis, especially when removing many entries at once.

An alternative here is the [XTRIM](https://redis.io/commands/xtrim). It can work in two modes:
1. `MINID` - "Evicts entries with IDs lower than threshold, where threshold is a stream ID.". This may work for you if you're using Redis >= 6.2 - you'd just use the ID of the newest processed record as an argument and you're done. However, if you're using Redis 5 (like myself) you're unlucky...
2. `MAXLEN` - "Evicts entries as long as the stream's length exceeds the specified threshold". It doesn't really fit our use case, because we want to do the complete opposite. We want to evict only `N` entries and we don't care how many items will be left after this operation. 

Now, even though we can't use the `XTRIM` command in `MAXLEN` mode we can still make use of it indirectly...

Notice that if we subtract `N` from the total number of items in the stream we'll know how many items should remain in the stream after our desired operation. If we could feed `XTRIM` in `MAXLEN` mode with that value we're done.

The problem is how to do it atomically to make sure that the number of items in the stream doesn't change between `XLEN` and `XTRIM` commands are executed?

## LUA scripts to the rescue!
Redis provides the [EVAL](https://redis.io/commands/eval) command that allows executing any program atomicaly.

Quoting Redis' docs: "Redis guarantees that a script is executed in an atomic way: no other script or Redis command will be executed while a script is being executed."

By running a following script we can achieve the desired effect:
`eval 'return redis.call("XTRIM", "mystream", "MAXLEN", redis.call("XLEN", "mystream") - KEYS[1])' 1 N`.
The only argument is number of stream entries to delete.

Here's the demo of how it works in action:
![image](https://user-images.githubusercontent.com/5732023/110253355-2f41fc00-7f8a-11eb-9483-509ff0859e17.png)
imjoseangel, and I support women devs in 2021 and beyond!
Tags: wecoded
Published: 2021-03-07 20:18:58

As an ally, I will call out gender bias and inequity by inspiring innovation, creativity, acknowledgment and support from women AND men.

We need to make our DEV community more inclusive supporting women leaders.

Let's strive, together to explain that the standard environments are those where we **RESPECT**, **CODE**, **ACCEPT**, **CREATE**, **HAVE FUN** and **WORK**, **TOGETHER**.
I'm Hillary Mutai, and I support women devs in 2021!
Tags: wecoded
Published: 2021-03-07 20:12:11

<!-- ✨This template is only meant to get your ideas going, so please change/add/remove these prompts as you wish! We also encourage you to create your own title if you’d like! ✨ -->

## As an ally, I will call out gender bias and inequity by…

## I will help forge a gender-equal world by…

## I will nominate women for…

## I will commit to learning more about…

## My advice for fellow allies to support underrepresented folks who code is...

<!-- Once your post is published, it will not appear on the /t/shecodedally page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
Differences between ES5 and ES6
Tags: javascript, webdev, beginners
Published: 2021-03-07 19:59:00


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8d97gc4znpvmfgz9me2g.png)

### Intro

JavaScript remains the [most popular programming language](https://insights.stackoverflow.com/survey/2020) in the world due to various reasons, and it is a general-purpose programming language that is standardized by ECMA-262 - ECMA International language specification. ECMAScript is the official name for JavaScript but JavaScript is the most recognized name around the world.

There are multiple editions introduced by [ECMA-262 language specification](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/) throughout the time but ES5 (ECMAScript 2009) and ES6 (ECMAScript 2015) editions were significant.

Let’s explore ES5, ES6 differences together.


### Differences

| ES5      | ES6 |
| :---        |    :----:   |
| 5th edition of the ECMA-262 language specification.     | 6th edition of the ECMA-262 language specification.       |
| Introduced in the year 2009.  | Introduced in the year 2015.       |
| There can be seen five primitive data types. string, number, boolean, null, undefined | Introduced a new primitive data type along with the data types that were there in ES5.  string, number, boolean, null, undefined and symbol (Every symbol value returned from Symbol() is unique.) |
| ‘var’ keyword is the only keyword that was there to define the variables. | Introduced let and const keywords other than the ‘var’ keyword to define variables. |
| When comparing to ES6 performance is slightly low. | When comparing to ES5 performance is better.|
| Since var is used to define variables; there were slight disadvantages, type safety issues. There is a loose nature when comparing to ES6. Variable declared by var, have their scope globally. | Variable declared by let, have their scope in the block which they are declared, as well as in any contained sub-blocks. |
| Developers could not easily declare a constant variable which can not be redeclared when compared to ES6. | Constants(const) are block-scoped, much like variables declared using the let keyword. The value of a constant can't be changed through reassignment, and it can't be redeclared. Constants can be declared easily when compared to ES5. |
| function and return keywords are used to define a function. | ES6 introduces us to many great features like arrow functions, template strings, class destruction, Modules |
| Provide larger range of community support for ES5 when compared with ES6 | It provides a less range of community supports than that of ES5. |
PayU Hub & iyzico PSP Integration / Part2 / Postman Configuration
Tags: fintech, iyzico, payu, payuhub
Published: 2021-03-07 19:49:59

---
title: PayU Hub & iyzico PSP Integration / Part2 / Postman Configuration
published: true
description: 
tags: Fintech, iyzico, PayU, PayUHub
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oc8hqlhh2yqc4k2lvjc3.jpg
series: PayU Hub & iyzico PSP Integration
---

I think Postman is such a reliable platform in terms of any web service 101. 
There are always a library, documentation, project or video, yet none of them feels like a `SUCCESS` responded group of HTTP calls.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyd6hpvcmuaxeccsxuco.jpg)

Sounds like, PayU Hub developers think the same, therefore they have created a page called [Give our APIs a Try](https://developers.paymentsos.com/docs/give-it-a-try.html ). 

Open the page and just click on 'Run in Postman' button.
Afterwards, it's time to clear up those 3(three);
- [Provider Integration Guide] (https://developers.paymentsos.com/docs/providers.html)
- Setting your Environment Variables
- Running the Requests in the Correct Order


__Provider Integration Guide__
The provider integration page, namely [PayU Hub & iyzico](https://developers.paymentsos.com/docs/providers/payu-iyzico.html), consists of general integration specifications. It's written on the page that the minimum API version is `1.3.0`. So put that info in our pocket and move on our way.:mountain_bicyclist:

__Setting your Environment Variables__
There are 6+1 different variables / header parameters / credentials that need to be set up for a full cycle transaction; `app_id`, `public_key`, `private_key`, `x-payments-os-env`, `api-version`, `Content-Type` and the +1 [idempotency key] (https://developers.paymentsos.com/docs/apis/payments/1.3.0/#section/Overview/Idempotency).
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qgzfe4ix08q6g5vmx9s3.png) To begin with, `app_id`, `public_key` and `private_key` parameters comes along soon after we generate _'Create Business Unit'_ for the very first time. 
It is just under `Account > Business Units` at [PaymentsOS control panel] (https://control.paymentsos.com/test/account/bu). :muscle:	
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wkr431wfcffp1bnql5cp.PNG) And the rest;
- `api-version` we already know
- `Content-Type` is `application/json`
- `idempotency_key` is optional
- Lastly, `x-payments-os-env` is `test` for [your test purposes](https://developers.paymentsos.com/docs/apis/payments/1.3.0/#section/Overview/Live-vs.-Test). 

__Running the Requests in the Correct Order__ 
Now, we are ready for _Step2_ and _Step3_ as mentioned on the [previous article](https://dev.to/shopskasalad/payu-hub-iyzico-psp-integration-part1-create-test-envs-4g3c).
First, we will store customer cards as a token. Then, we will accept payments.
Here we go! See you on the Part3:checkered_flag:
Best .NET Posts This Week: 7th March 2021
Tags: dotnet, csharp, dotnetcore, newsletter
Published: 2021-03-07 19:41:29

---
title: Best .NET Posts This Week: 7th March 2021
published: true
description: Here are some of the best .NET, C# and ASP NET posts from this week.
tags: dotnet,csharp,dotnetcore,newsletter
cover_image: https://cdn.hashnode.com/res/hashnode/image/upload/v1615146045642/defws0baC.png
canonical_url: https://samwalpole.com/best-net-posts-this-week-7th-march-2021
---

Here are some of the best .NET, C# and ASP NET posts from this week.

# This Weeks Articles
## [Five levels of performance tuning for an EF Core query](https://www.thereformedprogrammer.net/five-levels-of-performance-tuning-for-an-ef-core-query/)
By Jon Smith
> This is a companion article to the EF Core Community Standup called “Performance tuning an EF Core app” where I apply a series of performance enhancements to a demo ASP.NET Core e-commerce book selling site called the Book App. I start with 700 books, then 100,000 books and finally ½ million books.

## [Flurl - The elegant way to build URLs & set query params in .Net](https://kumarashwinhubert.com/flurl-the-elegant-way-to-build-urls-and-set-query-params-in-net)
By Kumar Ashwin Hubert
> A common task when calling web apis or resources from code is building a URL and adding the necessary query string and parameters. Flurl adds extension methods to strings which helps us easily add path segment, set query params, set fragment, etc. in a clean and elegant manner.

## [Canceling HTTP Requests in ASP.NET Core with CancellationToken](https://code-maze.com/canceling-http-requests-in-asp-net-core-with-cancellationtoken/)
By Marinko Spasojevic  
> It is quite a possible situation to have a user navigating to the client application’s page that sends an HTTP request to the server. While our app processing the request, a user can navigate away from that page. In such a case, we want to cancel the HTTP request since the response is no longer important to that user. Of course, this is just one of many situations that could happen in a real-world application where we would want to cancel our request. So, in this article, we are going to learn how to use CancellationToken to cancel HTTP requests in our client application.

# You Might Also Like
- [A Brief Introduction to F# for Object Oriented Developers](https://samwalpole.com/a-brief-introduction-to-f-for-object-oriented-developers)
- [Build an interactive kanban board with Vue Draggable](https://samwalpole.com/build-an-interactive-kanban-board-with-vue-draggable)

["Ten++ Ways to Make Money as a Developer" eBook](https://gumroad.com/a/633205875)

I post mostly about full stack .NET and Vue web development. To make sure that you don't miss out on any posts, please follow this blog and [subscribe to my newsletter](https://samwalpole.com). If you found this post helpful, please like it and share it. You can also find me on [Twitter](https://twitter.com/dr_sam_walpole).