teleren/devto huggingface dataset:
Slowing Down
Tags: learningtocode, personaldevelopment, perspective
Published: 2021-11-01 15:03:27

---
title: Slowing Down
published: true
date: 2021-10-25 19:09:44 UTC
tags: learningtocode,personaldevelopment,perspective
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/0*eM7FN7JCHOtnryzY)<figcaption>Photo by <a href="https://unsplash.com/@aaronburden?utm_source=medium&amp;utm_medium=referral">Aaron Burden</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption>

Life is full of risks. Sometimes they are risks that are sent our way from someone/something outside of our control. But sometimes we make decisions that require us to take risks.

I think we, as humans, want to get through that ‘risky’ period of time, as soon as we conceivably can. But what happens? From a lot of personal experience, risk comes with anxiety. Anxiety comes with more anxiety. We think the cure to anxiety is to just figure out a cure or why we are anxious. We internally rage, ‘Give me the solution’. We devour books to get through our anxiety. But we don’t every actually move through our anxiety. We don’t actually, ‘calm and quiet our soul’. We don’t take a deep breath and calm our weary mind.

I started reading a devotional a few weeks ago that had the profound insight.

Those of us who are anxious, and it’s probably many more than let on, fly through books we think will help us.

But the profound insight he had for me was to slow down. It was a daily devotional. I was personally struggling with deep anxiety after tragic loss in my family. But I listened.

It has helped me to chose things that cause me to slow down but maybe more profoundly: I am okay with it. Sure anxiety flares. But even in work I can choose to do things that force me to slow down and do a better job.

So slow down today. Choose to do things that help you focus more. Read a chapter in a book. Put it down. And wrestle with and be okay with that you didn’t finish the book or at least another chapter.

#### For Software Developers

This has had very profound and interesting effects for me in software development. One of the most difficult things in tech is that there is always more to learn. Or that you have to learn old things you didn’t want to learn.

But at the same time I started to slow down, I started to learn Functional Programming. Conceptually I have been thinking about Functional Programming(FP) for many months. But I am now ok that I did not finish or touch it for a day or two.

So for those of you who are fellow developers, consider building in rhythms and practices that help you slow down.

- Are you beginning your developer journey? Be ok with just learning html, css, and javascript for a month.
- Are you working a job and wanting to learn other things? Choose one thing. Start small and go deep on it.
- Build big projects that force you to learn many things but focus on one thing at a time.
- Take course that force a slower change of pace.

There are many things you and people you can surround yourself that can help you slow down. It is worth it.
loop throw dynamic key in array javascript
Tags: javascript, html, css
Published: 2021-10-25 19:04:34

## Problem 
```
const example = [
  {
    "2021-10-11": [
      {
        id: 31,
        availableslots: 41,
        bookings_count: 0,
        start_time: "2021-10-11T06:00:00",
        finish_time: "2021-10-11T09:00:00",
        AM_PM: "AM",
        workingslot: 16,
        price: 15,
        postcode: "e18 8,e14 4",
        job_id: "9",
        base_price: 15
      },
      {
        id: 32,
        availableslots: 96,
        bookings_count: 2,
        start_time: "2021-10-11T06:00:00",
        finish_time: "2021-10-11T09:00:00",
        AM_PM: "PM",
        workingslot: 16,
        price: 15,
        postcode: "e18 8,e14 4",
        job_id: "9",
        base_price: 15
      }
    ],
    "2021-10-12": [
      {
        id: 31,
        availableslots: 41,
        bookings_count: 0,
        start_time: "2021-10-11T06:00:00",
        finish_time: "2021-10-11T09:00:00",
        AM_PM: "AM",
        workingslot: 16,
        price: 15,
        postcode: "e18 8,e14 4",
        job_id: "9",
        base_price: 15
      },
      {
        id: 32,
        availableslots: 96,
        bookings_count: 2,
        start_time: "2021-10-11T06:00:00",
        finish_time: "2021-10-11T09:00:00",
        AM_PM: "PM",
        workingslot: 16,
        price: 15,
        postcode: "e18 8,e14 4",
        job_id: "9",
        base_price: 15
      }
    ],
  }
];
```

## solution

```
export default function App() {
  return (
    <div className="App">
      <h1>Hello CodeSandbox</h1>
      <h2>Start editing to see some magic happen!</h2>
      {example.map((d, i) => {
        var keys = Object.keys(d);
        return (
          <div>
              {d[keys[i]].map((i) => (
                <div>
                  <p>{i.id}</p>
                  <p>{i.start_time}</p>
                  <p>{i.finish_time}</p>
                </div>
              ))}
          </div>
        );
      })}
    </div>
  );
}
```
[codesandbox](https://codesandbox.io/s/keys-x4ypo?file=/src/App.js:2008-2534)
<div>
<iframe src="https://codesandbox.io/embed/keys-x4ypo?fontsize=14&hidenavigation=1&theme=dark"
     style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
     title="keys"
     allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
     sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
   ></iframe>
</div>
Next.js with Elasticsearch
Tags: elasticsearch, nextjs
Published: 2021-10-25 18:57:07



I would like to start this post, by saying 'I wish [Elasticsearch Cloud](https://www.elastic.co/cloud/) was free with no time limit, even just with limited features'...
Why am I saying that; because so I could add full text search capability to filter blogs on my blog site that I developed with Next.js... 
[Full Text Search](https://en.wikipedia.org/wiki/Full-text_search) queries make the content of the documents searchable.
This ability can be used to make searchable the content of blogs in your website, and if you provide *search blogs* or *filter blogs* kind of feature in your application, when your user enters words or phrases that appear anywhere in the content of blogs, even if the entered search word is in code blocks, the related blogs can be obtained and shown as search results to your users. 
In order to do that, we need to index our blogs, `.md` or `.mdx` files, to Elasticsearch, and then, by using Elasticsearch's Rest Api, we provide full text search capability in our application.
I wrote an article on this subject explaining how you can provide **full text search capability in your Next.js blog application**, you can read from [here](https://devmuscle.com/blog/nextjs-with-elasticsearch)
Three Kinds of keys
Tags: database
Published: 2021-10-25 18:44:41

Now that we have started building a data model putting our data into multiple linked tables and linking the rows in those tables using keys, we need to look at some terminology around keys.

There are generally three kinds of keys used in a database model.

• A logical key is a key that the “real world” might use to look up a row. In our example data model, the name field is a logical key. It is the screen name for the user and we indeed look up a user’s row several times in the program using the name field. You will often find that it makes sense to add a UNIQUE constraint to a logical key. Since the logical key is how we look up a row from the outside world, it makes little sense to allow multiple rows with the same value in the table.

• A primary key is usually a number that is assigned automatically by the database. It generally has no meaning outside the program and is only used to link rows from different tables together. When we want to look up a row in a table, usually searching for the row using the primary key is the fastest way to find the row. Since primary keys are integer numbers, they take up very little storage and can be compared or sorted very quickly. In our data model, the id field is an example of a primary key.

• A foreign key is usually a number that points to the primary key of an associated row in a different table. An example of a foreign key in our data model is the from_id.

We are using a naming convention of always calling the primary key field name id and appending the suffix _id to any field name that is a foreign key.
DBMS Employee and Department
Tags: dbms, sql, beginners, tutorial
Published: 2021-10-25 18:42:45


## Solution

**Creating department table.**

```sql

CREATE TABLE DEPARTMENT (
    DEPTNO NUMBER(10)
    CONSTRAINT DEPARTMENT_DEPTNO_PK PRIMARY KEY,
    DEPTNAME VARCHAR2(20)
    CONSTRAINT DEPARTMENT_DEPTNAME_UN UNIQUE,
    LOCATION CHAR(15)
    CONSTRAINT DEPARTMENT_LOCATION_NN NOT NULL
);

```

**Creating employee table.**

```sql

CREATE TABLE EMPLOYEE (
    EMPNO NUMBER(10)
    CONSTRAINT EMPLOYEE_EMPNO_PK PRIMARY KEY,
    EMPNAME VARCHAR2(20)
    CONSTRAINT EMPLOYEE_EMPNAME_UN UNIQUE,
    DEPTNO NUMBER(10)
    CONSTRAINT EMPLOYEE_DEPTNO_BR REFERENCES DEPARTMENT(DEPTNO),
    MANAGER NUMBER(10)
    CONSTRAINT EMPLOYEE_MANAGER_SR REFERENCES EMPLOYEE(EMPNO)
);

```

**Inserting values into department table**

```sql

INSERT INTO DEPARTMENT(DEPTNO, DEPTNAME, LOCATION)
VALUES (&DEPTNO, &DEPTNAME, &LOCATION);

```

> press "/" for inserting second record and so on.

**Inserting values into employee table**

```sql

INSERT INTO EMPLOYEE(EMPNO, EMPNAME, DEPTNO, MANAGER)
VALUES (&EMPNO, &EMPNAME, &DEPTNO, &MANAGER);

```

> press "/" for inserting second record and so on.

- Program is completed here, we have created both the tables and relationship between them.
- To show the department table
`sql SELECT * FROM DEPARTMENT`
- To show the employee table `sql SELECT * FROM EMPLOYEE`
- To show both the table 

```sql

SELECT * FROM DEPARTMENT, EMPLOYEE WHERE DEPARTMENT.DEPTNO = EMPLOYEE.DEPTNO

```

First Question
[DBMS Student Table](https://dev.to/shareef/dbms-student-table-5gga)

Closing here 👋👋👋
> This is **Shareef**.
> My recent project [yourounotes](https://yourounotes.vercel.app/)
> My [Portfolio](https://portfolio.shareef.vercel.app/)
> Twitter [ShareefBhai99](https://twitter.com/shareefBhai99)
> [Linkedin](https://www.linkedin.com/in/nadeem-shareef-7a8394182/)
> My [other Blogs](https://dev.to/shareef)
Basic Guide Of tailwindcss
Tags: beginners, webdev, css, design
Published: 2021-10-25 18:33:32

## What is Tailwindcss ?

tailwindcss is a utility-first CSS framework for rapidly building custom user interfaces. 

Basically, all the styles utility are defined in class names. and by combining them you can create beautiful components. just like how you use bootstrap.

 > [tailwindcss docs](https://tailwindcss.com/docs)


## Example

- **make padding top of div 0**
```html
<div class="pt-0">Hey Readers</div>
```

Here as you can see `pt-0` as padding-top should be 0. Like that, we can also do `p-0` for all sides & for margin, we can do `m-0`


- **change button color from blue to red when hover**
```html
<button class="bg-blue-900 hover:bg-red-900">Click Here!</button>
```
In tailwindcss there are different states like `hover` `focus` etc. and you can define property after them like `STATE:CLASS` to work in an intended way. 


-  **for diffrent screen sizes**
```html
<img class="w-16 md:w-32 lg:w-48" src="...">
```
Here we define that for lg and further width will be 48, from md to lg screen the width will be 32 and base width will be 16.

you can read about what exactly screen sizes are  [Here](https://tailwindcss.com/docs/responsive-design)


## where tailwind shines?

In tailwind you are repeating yourself. so it really shines when you are working with component-based framework like react ,angular , vue etc. 



## disclamer
If you want to use tailwind I recommend looking into tailwind docs because there are lots of features that might help you.
DBMS Student table
Tags: dbms, sql, beginners, tutorial
Published: 2021-10-25 18:31:11


**Illustrate an example to create a table student, student table will content the following attributes, stdid, stdname, dob, doj, fee, gender etc.**

**Write the following queries:**

-   Describe the structure of the table.
-   Insert few records into student table.
-   Add column to the student table (that is phone_no).
-   Modify the column name of phone_no to student_no.
-   Rename the table name to student_info
-   Delete any records from the table.

## Solution

**Creating student table.**

```sql

CREATE TABLE STUDENT (
    stdid number(5),
    stdname varchar2(20),
    dob date,
    doj date,
    fee number(5),
    gender char
);


```

**Describe the structure of the table.**

```sql

DESC STUDENT;

```

**Insert few records into student table.**

```sql

INSERT INTO STUDENT (
	stdid, stdname, dob, doj, fee, gender
)
VALUES (1, 'SHAREEF', '20-jan-2001', '25-oct-2001', 10000, 'M');

```

> Inserting second record.

```sql

INSERT INTO STUDENT (
	stdid, stdname, dob, doj, fee, gender
)
VALUES (2, 'NADEEM', '17-nov-2019', '26-oct-2001', 11000, 'M');

```

> Here I am just inserting two records you can insert as many as you want.

**Add column to the student table (that is phone_no).**

```sql
ALTER TABLE STUDENT ADD PHONE_NO NUMBER(10);
```

**Modify the column name of phone_no to student_no.**

```sql

ALTER TABLE STUDENT RENAME COLUMN PHONE_NO TO STUDENT_NO;

```

**Rename the table name to student_info.**

```sql

ALTER TABLE STUDENT RENAME TO STUDENT_INFO;

```

**Delete any records from the table.**

```sql

DELETE FROM STUDENT_INFO WHERE STDID = 2;

```

Note:- DBMS is not a strictly type language, meaning if you write in small letter or capital letter
it doesn't make any difference, It is good practice to write everything in capital letter.

Second Question.
[DBMS Department and Employee Table](https://dev.to/shareef/dbms-employee-and-department-3j8a)

Closing here 👋👋👋
> This is **Shareef**.
> My recent project [yourounotes](https://yourounotes.vercel.app/)
> My [Portfolio](https://portfolio.shareef.vercel.app/)
> Twitter [ShareefBhai99](https://twitter.com/shareefBhai99)
> [Linkedin](https://www.linkedin.com/in/nadeem-shareef-7a8394182/)
> My [other Blogs](https://dev.to/shareef)
My experience in #Hackthisfall2.0 
Published: 2021-10-25 18:13:38


Hackathons offer the chance for people in the same industry to come together and learn from each other's successes and failures. Professionals get to meet and collaborate, solve problems, share skills and help build better products. And many more things 
@hackthisfalldev  learned many new thigs here 
the healthy environment I got and evangelist mentor guidance it's really great.
Por qué programar en Spanglish es una mala idea
Tags: reflexiones
Published: 2021-10-27 01:16:11

---
title: Por qué programar en Spanglish es una mala idea
published: true
date: 2021-10-25 18:01:17 UTC
tags: Reflexiones
canonical_url: https://academy.leewayweb.com/por-que-programar-en-spanglish-es-una-mala-idea/
---

Es muy común, cuando uno está dando los primeros pasos en programación, la adopción de malas prácticas. En este sentido los desarrolladores de habla hispana tenemos una ligera desventaja respecto de nuestros colegas angloparlantes: para ellos palabras como if, for o while tienen sentido por sí mismas. A nostoros en cambio nos requiere un esfuerzo… [Seguir leyendo Por qué programar en Spanglish es una mala idea](https://academy.leewayweb.com/por-que-programar-en-spanglish-es-una-mala-idea/)

La entrada [Por qué programar en Spanglish es una mala idea](https://academy.leewayweb.com/por-que-programar-en-spanglish-es-una-mala-idea/) se publicó primero en [Leeway Academy](https://academy.leewayweb.com).
Prime Numbers
Tags: java, programming, beginners
Published: 2021-10-25 17:56:16

##To find prime numbers in a fast and efficient way in O(sqrt(n)) time complexity.

To check prime numbers efficiently any number is a prime number if it is not divisible by any number less than or equal to the square root of the given number.

First we take an input n to check whether it is prime or not.
then the number is checked whether it is a valid number or not as numbers less than or equal to 1 are not prime in which case our function *prime* return -1 .

Then divisibility by 2 or 3 is checked ,if it is divisible by 2 or 3 then 0 is returned.

Then we check for all numbers below square root of the given number if it is divisible or not.
To check that more efficiently we iterate the variable *i* starting from *5* and increment it by *6* and we check it is divisible by *i* and *i+2* if it is then 0 is returned else the given number is a prime number.

This program checks for prime numbers in o(sqrt(n)) time complexity.


```java
import java.util.*;
public class Prime {
    static int prime(int n){
        if(n<=1){
            return -1;
        }
        if(n==2||n==3){
            return 1;
        }
        if(n%2==0||n%3==0){
            return 0;
        }
        for(int i=5;i*i<=n;i=i+6){
            if(n%i==0||n%(i+2)==0){
                return 0;
            }
        }
        return 1;
    }
    public static void main(String args[]) {
        Scanner sc=new Scanner(System.in);
        int n,r ;
        System.out.println("Enter the number to check");
        n=sc.nextInt();
        r=prime(n);
        System.out.println(r);
        if(r==-1){
        System.out.println("Please enter a valid number");
        }
        else if(r==0){
            System.out.println(""+n+" is not a prime number");
        }
        else{
            System.out.println("It is a prime number");
        }
    }
}
```
100 algos in 100 days (Day 36)
Published: 2021-10-25 17:47:58

23/10

Before anything I have to admit I failed quite badly at coding out the following question. Straight away I recognised it was dynamic programming but putting it into place was a bit more difficult and  I definitely need more recursion practice.

For n steps how many combinations of steps can we use; given we can jump 1, 2 or 3 steps at once.

###My main reflections
*Coding without vs code and prettier I encountered a return null error which stumped me for a while. Which means more checking through as I code
*As above manual formatting practice is important
*I took too long to visualize and sketch out the problem
*In this example my naive solution took quite some time to code out and test.. sometimes need to pivot faster.
*It was good that I could relate to other problems have seen and apply them. Even quickly recognising the type of question.
*However, directly applying a solution was a bad idea. Better to recode and do new variable names as might get lost
100 algos in 100 days (Day 35)
Published: 2021-10-25 17:38:43

[22/10]

Again not an algo but relevant to software development.

I became interested in learning more about the basics of Object Orientated design as I use it every day.

The first learning point being the 4 pillars of OO
1. Encapsulation
2. Abstraction
3. Inheritance
4. Polymorphism
Html
Tags: html
Published: 2021-10-25 17:23:45

HTML is the standard markup language for creating websites and CSS is the language that describes the style of an HTML document. .HyperText Markup Language is the computer language that facilitates website creation. The language, which has code words and syntax just like any other language, is relatively easy to comprehend and, as time goes on, increasingly powerful in what it allows someone to create.  Markup is what HTML tags do to the text inside of them; they mark it as a specific type of text. For example, markup text could come in the form of boldface or italicized type to draw specific attention to a word or phrase.At its core, HTML is a series of short codes typed into a text-file. These are the tags that power HTML’s capabilities. The text is saved as an HTML file and viewed through a web browser. The browser reads the file and translates the text into a visible form, as directed by the codes the author used to write what becomes the visible rendering. Writing HTML requires tags to be used correctly to create the author’s vision.The tags are what separate normal text from HTML code. Tags are the words between what are known as angle-brackets, which allow graphics, images, and tables to appear on the webpage. Different tags perform different functions.  CSS makes web pages more accessible and JavaScript adds power to basic HTML.
Data types in C
Published: 2021-10-25 17:22:25

A data type specifies the type of data that a variable can store such as integer, floating, character,
etc.
C Data Types
There are the following data types in C language.
Types Data Types
Basic Data Type int, char, float, double
Derived Data Type array, pointer, structure, union
Enumeration Data Type enum
Void Data Type void
Basic Data Types
The basic data types are integer-based and floating-point based. C language supports both signed
and unsigned literals.
The memory size of the basic data types may change according to 32 or 64-bit operating system.
Let's see the basic data types. Its size is given according to 32-bit architecture
Data
types
Memory
size
Range
char 1 byte -128 to 127
Signed char 1 byte -128 to 127
Unsigned
char
1 byte 0 to 255
short 2 byte -32,768 to 32,767
Signed short 2 byte -32,768 to 32,767
Unsigned
short
2 byte 0 to 65,535
Int 2 byte -32,768 to 32,767
Signed int 2 byte -32,768 to 32,767
Unsigned int 2 byte 0 to 65,535
Short int 2 byte -32,768 to 32,767
Signed short
Int
2 byte -32,768 to 32,767
Unsigned
short int
2 byte 0 to 65,535
Long int 4 byte -2,147,483,648 to
2,147,483,647Signed long
int
4 byte -2,147,483,648 to
2,147,483,647
Unsigned long
int
4 byte 0 to 4,294,967,295
[HowTo] enable Local Network Privacy Permissions on iOS14+
Tags: flutter, ios
Published: 2021-10-25 17:08:07

##[Problem]
After trying to launch my-flutter-app on iOS14 iPhone, then it displayed an issue about *Failed to register observatory port with mDNS*. This is the full error message in the console
```[VERBOSE-2:FlutterObservatoryPublisher.mm(101)] Failed to register observatory port with mDNS with error -65555.
[VERBOSE-2:FlutterObservatoryPublisher.mm(103)] On iOS 14+, local network broadcast in apps need to be declared in the app's Info.plist. Debug and profile Flutter apps and modules host VM services on the local network to support debugging features such as hot reload and DevTools. To make your Flutter app or module attachable and debuggable, add a '_dartobservatory._tcp' value to the 'NSBonjourServices' key in your Info.plist for the Debug/Profile configurations. For more information, see https://flutter.dev/docs/development/add-to-app/ios/project-setup#local-network-privacy-permissions```

##[Solution]
From the link above, we just follow the instruction and the problem will be solved.
1 Rename Info.plist to Info-Debug.plist and copy this file to create a new file called Info-Release.plist
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbhz6zqb2jdnioxv0oey.png)

2 Open Runner.xcworkspace with Xcode and remove Info.plist then add Info-Debug.plist and Info-Release.plist
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tmkryvk91xs3dmeurax.png)

3 Add key *NSBonjourServices* with value *_dartobservatory._tcp*
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqpsdiimw1yuy72veank.png)

4 Change Info.plist file to *Runner/Info-$(CONFIGURATION).plist* from *Runner/Info.plist*
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vipm0jgmb410vh9viyip.png)

5 Delete Info-Release.plist in Build Phase menu
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jy3bltycy4jy96mfiu4y.png)

6 Run the app again and there is no compliant about local network permission anymore