teleren/devto huggingface dataset:
SQL INSERT Command
Tags: database, sql, programming, beginners
Published: 2022-03-22 09:31:11

---
canonical_url: https://baransel.dev/post/sql-insert-command/
---

> [Sign up to my newsletter!](https://baransel.dev/newsletter/).

## What is SQL INSERT Command?

The SQL Insert command is a SQL DML (Data Manipulation Language) command used to **insert** data into any table in the database. If you wish, you can add data to the tables in a very simple way via phpMyAdmin. But you cannot always use this method, for example in a web project you cannot manually add the information in the user registration form to the database.

## Using SQL INSERT Command

SQL Insert command has a simple usage like other SQL commands. There are basically two uses.

### First Usage

> ```sql 
> INSERT INTO table_name VALUES (value1,value2,value3, …)
> ```

With this usage method, data is added to the tables we created before, in the same way as the order of the columns in the table.

Now let's write our codes, for this, let's look at the structure of our table named `students` that we created in the previous lessons. If you wish, you can reach the lesson that we created our table named `students` from [here](https://baransel.dev/post/sql-ddl-commands/).

Let's take a look at the general structure of our table.

<img alt="Table Structure" src="https://baransel.dev/post/sql-insert-command/table-structure.png" style="height:75%;width:75%;"/>

Now we add the data in the same way as the order of the columns in our table named `students`.


```sql
INSERT INTO students VALUES ('Baransel', 'Arslan', 88.9, 3, '15.03.2022')
```

As you can see, we are adding the data in the same way as the column order in the table. Otherwise, we will get error. The point we need to pay attention to here is that we write the characteristic values in single quotes. Another point to note is; We did not add the `student_id` column because we previously stated that we want to add the `student_id` column automatically when creating the table, with the `IDENTITY` statement. You can access that article [here](https://baransel.dev/post/sql-ddl-commands/) if you wish.

We saw the first use of the SQL insert command. Now let's look at the second use case. The second use is more used than the first use, and it is safer to use.

### Second Usage

> ```sql 
> INSERT INTO table_name (column1,column2,column3, …) VALUES(value1,value2,value3, …)
> ```

There is another point that we should pay attention to here. Column values and the order of the values we want to add must be the same. We will not add any data to the date column here.

```sql
INSERT INTO students (student_name, student_surname, student_average_grade, class_no) VALUES ('Baransel', 'Arslan', 88.9, 3)
```

Thus, we left the `date` column blank. However, **you cannot leave the primary key columns blank**, for example, since the `class_no` column is the primary key, you will get an error when you leave it blank.

> [Sign up to my newsletter!](https://baransel.dev/newsletter/).
Refinements in ruby
Tags: ruby, webdev, programming
Published: 2022-03-22 09:07:39

---
title: Refinements in ruby
published: true
description: 
tags: ruby, webdev, programming
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vf9w8wvmeptj8b3ol4b.png
---

Today I had the opportunity to use https://docs.ruby-lang.org/en/2.4.0/syntax/refinements_rdoc.html for the first time in my almost 8 years of Ruby programming. So in general it works in the way that you can override some classes in Ruby but the change is not globally. It creates the module, applies monkey patching, and  `using ModuleName`. That makes things overridden only in the context of the runtime of that `using`.

Let's describe it with my use case example. In application, we had an evaluator for formulas. Implementation details are not important, what we should focus on is that after parsing data we had a simple eval like that:
``` max( nil * 10, 20 ) ```

Normally any operation like * on a nil object raises an error and that was ok. But in this case, we have a proper value of 20 which should be the result of that code since it is the maximum value from passed values.

So my solution  is to expand  basic arithmetic methods in NilClass, and thanks to using refinement i did it only in the context of our evaluator without causing any changes in the rest of application.

```ruby
  class Evaluator
    Refinement = Module.new do
      refine NilClass do
        %i[- + / *].each do |operator|
          define_method(operator) { |_| nil }
        end
      end
    end

    using Refinement

    def initialize
      (...)
     end
  end
```
My Front-End Development Roadmap
Published: 2022-03-22 09:07:19

## Learn

1. [FreeCodeCamp](https://freecodecamp.org/)
2. [Scrimba](https://scrimba.com/)
3. Youtube
  1. [The Net Ninja](https://www.youtube.com/c/TheNetNinja)
  2. [Traversy Media](https://www.youtube.com/c/TraversyMedia)
  3. [Kevin Powell](https://www.youtube.com/kepowob)
  4. [James Q Quick](https://www.youtube.com/c/JamesQQuick)
  5. [Codedamn](https://www.youtube.com/c/codedamn)
  6. [Coding in Public](https://www.youtube.com/c/CodinginPublic)
  7. [DesignCourse](https://www.youtube.com/c/DesignCourse)

## Practice

1. [Front-end Mentor](https://www.frontendmentor.io/)
2. [Codewell](https://www.codewell.cc/)
3. [Devchallenges](https://devchallenges.io/)
4. [CSS Battle](https://cssbattle.dev/)
5. [Code Dribbble Shots](https://dribbble.com/)
6. [HackerRank](https://www.hackerrank.com/)

## Jamstack

Before Learning React

1. [11ty](https://11ty.dev/)
2. [Astro(vanilla js)](https://astro.build/)

After Learning React

1. [NextJS](https://nextjs.org/)
2. [Gatsby](https://www.gatsbyjs.com/)
3. [Remix](https://remix.run/)
4. [Astro + React](https://astro.build/)

> I am learning React because I want to learn App Dev
[ASK] Use useMemo for conditional render
Tags: react, javascript, ask, beginners
Published: 2022-03-22 09:00:04

Hi, I quite often use this syntax to render my components conditionally and I've got a lot of review about this to not use `useMemo` to render markups. Is it wrong doing it this way?

The reason I'm doing this is because of the markups I want to render conditionally is wrapped, I don't want to use the same wrapper in three different places. Any suggestion?

```jsx
function CardContainer({ data, isLoading }) {
  const renderCards = useMemo(() => {
    if (isLoading) {
      return <Loading />
    }

    if (!data.length) {
      return <EmptyState />
    }

    return <Cards data={data} />
  }, [data, isLoading])

  return <Container>
    {renderCards}
  </Container>
}
```
How do you define 'Impactful work'?
Tags: career, discuss, productivity, focus
Published: 2022-03-22 08:58:03

---
title: How do you define 'Impactful work'?
published: true
description: doing impactful work is not easy, if you have no clear picture of what is right and important. How can we figure it out? How can we teach this skill to others?
tags: #career, #discussion, #productivity, #focus
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr872nhm70dt3ru55rpx.png
---


How do you measure the impact of your work?
How do you determine what changes in the codebase have more impact / **bring more value**?

---

Recently, [this post](https://dev.to/ben/what-is-your-best-skill-as-a-developer-ia7) and some discussions with colleagues about **performance review** made me think about the nature of **impactful work**. 

In many blog posts and feedbacks you can read and hear about 
**Efficiency and Effectiveness** _Doing [things right vs [doing the right things](https://dev.to/dvddpl/what-makes-a-10x-developer--1k0f)_), about **prioritisation** and **focus**.
And many experienced developer have a _natural sense_ of all this.
But... how can we describe it properly?

Amidst lots of ticket in the backlog, or lots of todos in a repository, or simply by looking at a piece of code, how do you determine what work / changes or refactoring bring more value and have more impact? (I am not talking about what has more visibility, neither the importance of the product itself -  does a MedTech app have more _value_ or impact than a FinTech app or a game?)

How can we tell / teach someone to understand what is the right thing to do? 

> Doing the right thing, choosing to work on something that has more value and impact work is not easy, if you have no clear picture of what is right and important or you don't share the same values.

How can we figure it out? 
How can we describe to others something that is so clear for us, yet so vague?
How can we teach this skill to others? 

What guidelines can be given to enable developers to discern important stuff that has priority from important stuff that has less priority, or less important stuff that has high priority? 
 

---
Photo by <a href="https://unsplash.com/@dreamsoftheoceans?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Linus Nylund</a> on <a href="https://unsplash.com/s/photos/impact?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Perl Download and Installation 2022
Tags: perl
Published: 2022-03-22 08:57:27


Explains how to download and install Perl on Windows, Mac, and [Linux](https://en.linux.perlzemi.com/)/[UNIX](https://en.wikipedia.org/wiki/Unix).

This article is originally <a href="https://en.perlzemi.com/blog/20180820153471.html">Perl Download and Installation | Perl ABC</a>

<div id="windows"></div>

## Installation of Perl on Windows

Let's install Perl on **Windows**. I explain the way to use Strawberry Perl, ActivePerl, and msys2.

### Installation of Strawberry Perl

Strawberry Perl is one of the Perl distributions on Windows. Strawberry Perl is easy to install and has the C language compiler [MinGW](https://en.wikipedia.org/wiki/MinGW) and a CPAN module installer [cpanm](https://en.perlzemi.com/blog/20101027127859.html) and often used C libraries.

[Install Strawberry Perl on Windows](https://en.perlzemi.com/blog/20180808153368.html)

### Installation of ActivePerl

ActivePerl is also a Perl distributions on Windows.

[Install ActivePerl on Windows](https://en.perlzemi.com/blog/20080602121231.html)

### Installation of msys2 and Perl

msys2 is a software to build a pseudo [Linux](https://en.linux.perlzemi.com/) environment on Windows.

Some of [IPC](https://en.perlzemi.com/blog/20161103147817.html) don't work well on Windows Perl distributions, but all IPC work well on msys2.

For example, the development server of [Mojolicious](https://en.mojolicious.perlzemi.com/) works well on msys2.

[Installation of msys2 and Perl](https://en.perlzemi.com/blog/20180806153350.html)

<div id="mac"></div>

## Installation Perl on Mac

Perl is installed by default on Mac. you can start using Perl right away.

You can also install the latest Perl on your Mac.

[Installation of Perl on Mac](https://en.perlzemi.com/blog/20180814153419.html)

<div id="linux"></div>

## Installation of Perl on Linux/UNIX

Perl is widely installed on Linux/UNIX by default. 

If not, You can install the latest Perl on your [Linux](https://en.linux.perlzemi.com/)/[UNIX](https://en.wikipedia.org/wiki/Unix).

[Installation of Perl on Linux/UNIX](https://en.perlzemi.com/blog/20180813153411.html)
What Are the Advantages of Using the Phone Verification API on a National and International Level?
Published: 2022-03-22 08:57:07

The phone verification API has numerous advantages, whether they are national or international. The Phone Verification API is very useful for saving time and money for businesses. It also aids in the improvement of and increase in customer satisfaction. It increases delivery and also plays an important part in marketing. You may also use the search term "[verify API](www.numverify.com)" to get the best phone verification API for generating legitimate leads and validating phone numbers as they enter your system, helping to maintain your user database clean and fraud-free.
Best Fintech Software Development Firm
Published: 2022-03-22 08:38:46

Fintech businesses are challenging traditional financial service providers. With the bloom of fintech, the focus is on user experience, best-practice interface design, and battle-tested technologies.

Many startups are actively bringing in software developers in their teams. Developers with strong coding skills can empower your mobile banking applications and system. Experienced developers lower the risks of developing a new product and help you to improve your financial service.

While planning, look for different services provided by software developing firms. Glance at solutions you can use in your fintech company.

**What Types of Fintech Software Solutions A Software Development Firm Can Offer You?**
1. Commercial Lending Software
2. Core Banking Software
3. Insurance Software
4. Pension and Benefits
5. Regtech
6. Mobile Payments and Wallets
7. Blockchain and Cryptocurrency
8. Trade Tech
9. Risk Management & Fraud Prevention
10. Investment Personal Finance
11. Business Plan
12. Wealth Tech

How Do You Ensure Fintech Developer Makes A Highly Secure Financial Platform?

To give you an example of our [fintech project](https://www.clariontech.com/case-studies/enhanced-scalability-of-fintech-apps-with-the-azure-cloud) - **Flexipath Capital**, a fintech company facing troubles due to lack of scalability in an on-premise technical infrastructure. Our fintech developers at Clarion solved the problem by migrating the on-premise application to the Azure cloud. We also help fintech firms to build Blockchain-based applications with Blockchain as a service or BaaS.

Financial software development involves improving and automating financial processes with AI, ML, and big data. Our software experts work together with other departments to find out about the needs and specifics of the company so that the platform or software will be a perfect fit. They help with new updates for the financing and banking industry. They work on feedback and make changes if needed, both in the interface and internal operations. Know more: [Best Fintech Software Development Firm](https://www.clariontech.com/blog/how-to-choose-the-best-fintech-software-development-firm)
Create Random team names for projects
Tags: javascript, programming, typescript, opensource
Published: 2022-03-22 08:26:55

## Introduction

Here at **Pixium Digital** we often need to create sets of random usernames or team names.

This is either due to bench-marking with a need to simulate individuals groups or users.

Or for a need to **anonymize leader-boards** in various applications. This can be due to the fact that some applications have big firms as client that they want to keep anonymous hence we generate a random team or group name that can be displayed publicly without risking information leakage.

![leaderboard](https://media.giphy.com/media/xT4uQBmMGEoGWSCCVG/giphy.gif)

For this we have decided to build a small library that we can re-use to help us generate this content easily.

## Basics

We first started to create a list of various information we would need. This includes adjectives, nouns, gamertags, colors, extended colors.

You find the more detailed list here:

https://github.com/pixiumdigital/random-namer/tree/master/src/data

---

We then wanted to create the possibility to add an ID at the end of the random generated content (discord like) so we could have a result like this:

- myC00lUsername#3948
- thundering-memory#8682

For this we used a little trick of `Math.random()`

```ts
/**
 * Generates a random ID (discord style)
 * @returns string
 */
export const randomId = () => {
    return Math.random().toString().substring(2, 6)
}
```

## Formats

Most of the random lists will be in the following format `string[]` however there will be specifications. For example teams will be composed in this format:

```ts
adjective-noun
```

For example:

```ts
[
    'icy-dinosaurs',
    'mighty-scarecrow',
    'aquatic-squirrels',
    'defiant-camp',
    'natural-memory'
]
```

Then we have the Extended Colors which are of the following format:

```ts
interface ExtendedColor {
    id: string
    name: string
    hex: string
    r: number
    g: number
    b: number
}
```

## Usage

To use the library you simply need to do the following:


```ts
yarn install @pixium-digital/random-namer
```

Then you can use it like this:

```ts
import { RandomNamer, RandomType } from "@pixium-digital/random-namer"

const list = RandomNamer(RandomType.TEAM, { toGenerate: 3, allUnique: true, addId: true })
// ['voiceless-sea#4457', 'delicate-star#6563', 'even-nest#9988']

const list = RandomNamer(RandomType.GAMERTAG, { toGenerate: 2 })
// ['The Best Yoda', 'I_Cant_Play']
```

## Link

{% github https://github.com/pixiumdigital/random-namer %}

---

**Pixium Digital** - Shaping your project with technology and innovation
https://pixiumdigital.com
https://github.com/pixiumdigital
Terminal Proxy Point
Tags: terminal, proxy
Published: 2022-03-22 08:26:44


1、If you want to use HTTP by proxy on terminal, you should turn on the "http proxy" on SSR setting:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ztbhit5hzvcffuczfw5e.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hvgfvfj92z0yc692t3gw.png)

the port here is where your terminal would go through:

- export http_proxy=http://127.0.0.1:6666  
- export https_proxy=https://127.0.0.1:6666  

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xys60rfpcbv980ggwkoj.png)

and if you don't set properly, you would get this:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9um5bmsy0bd6h65wo6me.png)
 
**Curl goes with https(http proxy)**

————————

2、Don't ping google to verify your proxy setting. ping goes with ICMP protocol, ICMP is a network layer protocol, and https is an application layer protocol, that's why your proxy setting won't work.
Don't like long, verbose Docker-compose command?
Tags: docker, dockercompose
Published: 2022-03-22 08:08:56

Nowadays many developers and companies use Docker and Docker-compose in everyday live. I don't want to repeat what Docker is and why you might want to use it. But what I don't like when I work with Docker (if be more precisely with Docker-compose) - verbosity of commands.

It is hard to argue that Docker-compose provide good alternative compare with pure Docker interface but commands are still long and verbose. "It is not a problem" - you could reply, - "just add appropriate alias for the command and save time and effort". Yes, right, it can help in terminal but you are as a developer probably use IDE or at least text editor and often you have mechanisms for interact with your application somehow: run test, initialise building process etc. And not all IDEs and text-editors know how work with Docker.

From my point of view, the ideal setup is when you don't need to think about if you use Docker or not. For example, I need to run my tests with `rspec` (I'm a Rails-developers and all examples below are from Rails world), it would be great not to think about what should I do in order to run them - my habit is `rspec path/to/specs` but when my app is in Docker I should do something like this:

`docker-compose run -rm container-name command`

And in this case this [utility](https://github.com/bibendi/dip) can safe us.
DIP has two possible modes:

1. `dip your_command` - in this mode you just need to type `dip` before your command, something like this: `dip rails c`
2. `your_command` - DIP can be injected into the current shell and it analyses current directory if there is an dip.yml file, if the file is exist it runs a command in docker if not in a shell.
But before this sunny live you need to create `dip.yml` - a configuration file when you should make mapping specific commands to appropriate container.

Possible pitfalls:
I use `vim` for development and by default `vim` didn't use `dip` when I tried to run command from `vim`. The problem was in an approach which `vim` uses when run external command - it doesn't load your shell's profile by default. In order to force it I've added next to my `.vimrc`

`set shell=bash\ -l
`
How does cypress change the game in Test automation?
Tags: softwaretestingcompany
Published: 2022-03-22 08:05:15


In today’s [software testing phase,](https://www.fleekitsolutions.com/) the demand for automation tools is increasing day by day, so bearing this in mind many enterprises are using automation tools like Cypress. Cypress is a modern javaScript based framework that provides a complete end-to-end testing experience. In cypress, anything that runs in a browser is a very fast and reliable testing automation tool. It makes setting up, running, and debugging tests possible and easy in software testing. To get your test suite setup, there is no longer a need to install 10 separate tools and libraries. It works differently, as it is executed in the same run loop as your application and runs as quickly as the browser can render content. Operating outside of the browser, most end-to-end testing tools are selenium-based and they run remote commands across the network. 

Many organizations have been looking for a long time for every automated tool, and cypress has come up with awesome features which help in software testing. 


Snapshot at the time of tests run
There is no other automation tool except cypress that has this feature at present. While taking a snapshot of the application, it allows the users to time travel back to the state when commands run. Users can spot the changes by just hovering over the command.


Stop guessing
Users do not have to guess why the tests are failing with cypress, debugging the script is always challenging. It is a time-saving automation tool for debugging. To debug the script quickly, readable error messages help to do so. The pinned snapshot manifests the state of the element before and after. Users also have the access to the all-suite of browser’s developer tools. 


No asynchronization issues
The retry-ability that assists with testing dynamic web applications is the core feature of the cypress. It permits the tests to run in each and every command as soon as the assertion passes with no hard-coding delays. If the application acquires extra seconds or milliseconds to render a Document Object Model (DOM) element then the tests do not have to change. Before proceeding, cypress automatically remains for asserts and commands. Cy.stub(), Cy.clocks, Cy.Spies are the commands of cypress that help and manage the performance of the functions, responses, servers, and timers. 


Manage network traffic
With the help of Cypress, the whole lifecycle of XHR tests within an application can be tested. The tool Cypress gives access directly to the XHR objects and that enables the users to learn about its properties. Users have the ability to opt whether the response stubbed or permit them to reach the server among cypress. Users can also mix and match in the same tests by alternating the certain request they opt to a stub. 


Take shortcuts
It means testers no need to use the user interface or visit the login page to build up the state or testers do not have to wait for the page to load. Cypress provides the ability to log in and to take shortcuts without entering the login page.