teleren/devto huggingface dataset:
express session cookie not working , react , axios
Published: 2021-06-04 15:06:34

To make it work simply do

```js
import axios from "axios";

const Axios = axios.create({
  baseURL:
    process.env.NODE_ENV === "development"
      ? process.env.REACT_APP_DEV_SERVER_URL
      : process.env.REACT_APP_SERVER_URL,
});
Axios.defaults.withCredentials = true;

export default Axios;
```
or
just
```js
import axios from "axios";

axios.defaults.withCredentials = true;
```

It makes axios store cookies

Thanks for reading, hearts ❤️ if you liked it and unicorns 🦄 if you loved it, follow if you wanna read more awesome blogs
BUG: React Chartjs blinking
Tags: react, chart, javascript
Published: 2021-06-04 15:05:37

We are using react-chartjs in our project and managed to create beautiful charts. Lately we noticed when we hovered on a section of the graph it started showing a dot at some other points as well. Here is a video showing the same.

https://res.cloudinary.com/dycur35xt/video/upload/v1622818945/Recording__123_oukaib.mp4

Just in case someone is facing the same issue, we solved it using a little tweak in the chart options

```
hover:
{
    mode: 'index',
    axis: 'x',
    intersect: false,
    animationDuration: 50
}
```

I am not quite sure what **animationDuration** it does, but I am assuming it is the number of milliseconds for which dot should be shown after losing focus.

Anyways this solved the problem.
Oracle database and Docker
Tags: docker, database, container, oracle
Published: 2021-06-04 14:55:28

## Oracle DBA 12 Container and Docker
For my job I had to install an Oracle database on my Windows. And I thought that perhaps it is much better to get this database in a container. Because I need many databases to handle with.


And this  solution with containers gives me the independence I need for every each of them. And I can play with different versions of Oracle whithout having problems.


I have decided to write this post because it was kind of difficult to find something really helpfull on internet.  


I had Docker already installed on my PC Windows. And then I run this:

```docker run -d -p 8080:8080 -p 1521:1521 --name OracleDB store/oracle/database-enterprise:12.2.0.1-slim```


In my Docker Dashboard i got this:
![Docker Dashboard woth Oracle 12 database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v3dws44ix6hng2obushk.png)
As you can see there is the newest container in my Docker, **OracleDB**. I got the Oracle 12 slim for this project. 
With this command 
`docker ps`
i get this 
![docker container ID](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2h5b1yn8nfjq9lncigx.png)
So, i could see that the container ID is: 5d365b3daa70. Then i run:
`docker exec -it 5d365b3daa70 /bin/bash`
and  then
`sqlplus / as sysdba`
![sqlplus terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b67bkp9ubzsm5azn4v5i.png)

Here I can run this:
```alter session set "_ORACLE_SCRIPT"=true;
create user newDB identified by newDB;
GRANT CONNECT, RESOURCE, DBA TO newDB;```

And then I run this:
```select value from v$parameter where name='service_names';```

I open the sql developer and connect to this schema:
![sql developer connection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a3u2sm3oiisexfw1eduj.png)

Now I can start create tables in this schema, **newDB**.




###What's next
I'll try to get the same thing but with Oracle 19.
Shnippet : minimal shell snippet manager made in Rust
Tags: rust, showdev, bash, productivity
Published: 2021-06-04 14:48:48

Hey!
After searching for a shell command on the net to quickly do something, you probably make a proper script file out of it, then save it on a folder on your path and then remember what you named it so that when you need it again, you can directly execute it, right?
Yeah...me neither :sweat_smile: :smile:

I was recently trying to find a solution for a problem with my usb port, and on stack overflow I found a solution for it which worked! Unfortunately it didn't seem to fix it permanently, and I had to do it again after booting to make it work.

Now feeling a bit lazy, I didn't create a shell script from it, and put it on the path so I can execute it again quickly, but I also didn't want to go to the stackoverflow every time I boot and the copy paste it.

Thus, having a bit of time, and not doing anything in rust for a while, I created **Shnippet** : a commandline shell snippet manager. It gives a quick way to save, edit and even run the snippets right from the commandline, and creates all .sh files for you. It also saves names and descriptions of the snippets, so you can check why did you save what you did save.

The interface is quite simple :
```
USAGE:
    shnippet [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    delete  <name>    Delete an existing shnippet
    edit    <name>    Edit an existing shnippet
    exec    <name>    Run a shnippet in shell
    help              Prints this message or the help of the given subcommand(s)
    list              List all shnippets
    new               Add new shnippet

```

Also it saves all of the snippets in .sh files, so you can easily make a backup, copy same snippets on various machines or port them to something else if needed.

let me know if you found this useful in comments, and star it on github if you did :smile:
{% github YJDoc2/shnippet %}

Thank you!
Help - JAVA
Published: 2021-06-04 14:43:40

I am a student and kind of new to Java. For my homework, I have to create some code that asks the user to input a number that is at least 7 or higher using a do while loop, then with a for loop I am required to ask the user to type that amount(7 or higher) of words. So the number 7 of the input is the number of words the user has to type. Then I will have to check if one of the words fulfills the condition, the condition is that the word has to start with an uppercase letter, end with a number and contain the word "cse". I am asked to create a method inside some code homework that does a specific task, the method should check if the string starts with an uppercase letter, ends with a number and contains the word "cse", the name of the method should be countTest and accepts the String as a parameter. I will show you my code but I dont know how to create this specific method for String. Then I will have to output like this: System.out.println("There as a total number of words " + count+" and the ones that fulfill the condition are: " + condition); Sorry I dont know how to input the code here as text. I hope you guys can understand I am new to this, thank you in advance!
Note: I know the methods that I have to use, but I dont know how to create a specific method that does the 3 condition tasks in one particulat method. For ex. public boolean codeTest(){
the 3 methods inside this one and then connect it to the main method} 





import java.util.Scanner;
public class D6_6 {
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        System.out.println("Type a number that is at least 7");
        int number = sc.nextInt();
        int count = 0;
        int condition = 0;
        do{
            if(number<7){
                System.out.println("You should type a number that is at least 7 or higher");
                number = sc.nextInt();
            }

        }
        while(number<7);
        sc.nextLine();
        String str;
        for(int i =0; i<number; i++){
            System.out.println("Type a word");
            str = sc.nextLine();
            count++;
        }
    }
    public boolean countTest(String str)    {

}
React and Getting Started with it
Tags: react, javascript, frontend, firstpost
Published: 2021-06-04 14:26:05

As a beginner some questions roll in our mind and they are :


##What is React ?
React is an open-source, front end, JavaScript library for building User Interfaces or UI components. It is maintained by Facebook and a community of individual developers and companies.
> JavaScript Library as it is about building JavaScript driven apps. React app runs in Browser so things happen instantly and don't have to wait for server response to get a new page. 
> User Interfaces are basically "What we see". And React is about using components for building things.


##Why to use React ?
+ React is Flexible

> Learn Once , Write Everywhere.

We can use react for Web Applications using React.js, Static sites using  Gatsby, Mobile Applications using React Native, Desktop Applications using Electron and Server rendering using Next.js.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tfjqnn59nuv5aijqgj6t.png)

+ It provides great Developer Experience. It allows rapid development and API in react is simple to learn you would rarely look docs for it. Everything in React is a component which makes our code reusable. 

+ Large number of people use React as compared to Angular and Vue and it is created and maintained by Facebook.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yytaogzhak12alnvg370.png)
 
+ React has good performance as it uses Virtual DOM. Therefore, it allows ReactJS to know when exactly to re-render or when to ignore some specific pieces of DOM because it can detect when the data has changed.

+ React is easy to test and large number of testing frameworks are present.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fmkl6qk6vzw26hg8hd6e.png)

+ React Library allows us to write HTML like syntax in JavaScript.

## How we can create our first react app?

**Step 1 :** 
Download and Install your preferred Text Editor. Some text editors which you can use are Sublime Text, Visual Studio Code, Notepad++, Webstorm.

**Step 2 :**  
Local Development Environment
Install latest version of node.js from [here](https://nodejs.org/en/)

**Step 3 :** 
Create React App
Run these on Command Prompt
+ npx create-react-app my-app
+ cd my-app
+ npm start

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uz1m84twcq1bfscicky2.png)
12 observations from conducting my first user interviews and survey
Tags: ux
Published: 2021-06-04 14:18:53

Recently I conducted 15 user interviews and 1 large user survey on my entrepreneurial quest to start my own software company. Admittedly, I hired a freelancer to help since I felt overwhelmed and unprepared — there is both an art and science to research interviews. Yes, this sounds obvious, but it really hits home when you experience it first hand. Furthermore, my perspective is biased because this is my *ugly baby* after all, so I wanted to avoid confirmation bias as much as possible.

I am sharing below a few observations and lessons learned for others in a similar position because this is exactly the kind of wisdom I wish had been imparted on me before I spent 4 months conducting research. Again, I am no expert so I may be wrong on some/most/everything. I am open to learning if you would like to correct me.

--------

1. Start interviews establishing a common vocabulary to remove the possibility of confusion and/or assumptions. 

2. Terminate interviews that are not going well. E.g. the interviewee does not have the necessary language fluency to comprehend and/or articulate their opinions. 

3. Discuss internally how the interview went immediately after to make small course corrections. E.g. Are some questions commonly tripping people up? Are you even interviewing the right people? 

4. There is always at least 1 takeaway or golden nugget per interviewee. It is your job to find it; it does not always come easy.

5. Having an observer helps. This individual can see/hear things that the interviewer might miss.

6. Cultural differences will influence responses, therefore you need to understand these to better understand what you are being told.

7. Always dive into the **why** with interviewee responses. E.g. what does this person care so much or so little about X? 

8. Be willing to abandon certain planned questions if you are presented with an opportunity too good to pass up to dive deep into something an interviewee says that "hits all the right notes" on one of your assumptions. This happens on rare occasions so take advantage!

9. There is a real struggle between "reeling" in interviewees and letting them go off the deep end because you never know what unexpected ideas you may uncover in your early stages of research.

10. Clear, simple, non-biased, open-ended questions are very hard to craft but critical to maximizing your research. 

11. I am going to make a bold claim: user surveys are a waste of time and $$$ in the discovery phase of the UX design process. They are best suited for *narrowing* your research which is counter productive to your efforts early on.

12. Surface-only responses are not very helpful. A "cool cucumber" does not give very insightful answers. I discovered after re-watching all the recorded interviews that stoic individuals needed to be nudged somehow to break rank so to speak to give emotional responses. Only then were we able to really dive into our research.
Ein Vergleich der 8 besten Plattformen, um Online-Kurse zu verkaufen
Published: 2021-06-04 14:00:57

Vergleich der Online-Kursplattformen: Wo Sie Ihr Wissen verkaufen können.

Der Markt für Online-Kurse boomt. Global Market Insights prognostiziert eine durchschnittliche jährliche Wachstumsrate (CAGR) von 5%, was einem E-Learning-Markt entspricht, der bis 2024 200 Milliarden US-Dollar übersteigen wird.

Unabhängig davon, ob Sie ein etabliertes Schulungsunternehmen oder ein einzelner Unternehmer mit Wissen sind, das Sie teilen möchten, benötigen Sie eine Online-Kursplattform, die Ihren Anforderungen und Ihrem Geschäftsmodell entspricht. Die Optionen können überwältigend sein und es kann schwierig sein, zu entscheiden, welche Plattform für Sie geeignet ist.

Einige möchten beispielsweise nur einen einfachen Kurs mit Text, Bildern und PDF-Dateien erstellen und dann den größten Teil ihrer Bemühungen auf die Vermarktung des Kurses konzentrieren. Andere müssen möglicherweise komplexe Kurse mit mehreren Modulen erstellen, die SCORM-Inhalte und unterschiedliche Lernpfade enthalten.

In diesem Artikel werden 7 der besten Online-Kursplattformen für die Erstellung und Durchführung Ihrer Kurse im Jahr 2020 eingehend verglichen.

Vergleichstabelle für Online-Kursplattformen
Die folgende Tabelle zeigt eine kurze nebeneinander angezeigte Ansicht aller von uns überprüften Plattformen. Lesen Sie weiter, um eine detaillierte Analyse der einzelnen Plattformen zu erhalten.

Mehr lesen > https://www.ispringlearn.de/blog/besten-plattformen-fur-online-kurse-verkaufen
CS Series 👩‍🚀 #6 : Performance Analysis Part 2: Theoretical Analysis

Tags: computerscience, programming
Published: 2021-06-04 14:00:50

- High-level description of the algorithm instead of an implementation (benchmarking/running-time)
- Characterize running time as function of the input size, n
- takes into account all possible inputs (int, string, float...)
- Allows us to evaluate the speed of an algorithm independently of the hardware/software environment


### Scenarios
- So an algorithm depends on the inputs of size n, so the time complexity or running time will vary from input to input. for example sorting an array of 10 numbers is much less time consuming then sorting an array of 100000 numbers! maybe your algorithm in the best vase scenario will take 100 array elements to be sorted. BUT you always count the worst case scenario. which is maybe 10000000 elements. remember, when your input grow your algorithm time and space complexity will increase. and may increase in a huge way
    - There is 3 types of possible scenarios
        - best case : you count it maybe through some sort of statistics
        - average case :  you count it maybe through some sort of statistics
        - worst case  : you defiantly to imagine the worst case scenario (what if the inputs scaled)
    - **We focus on the worst case running time**
        - easier to analyze
        - critical to games, finance and robotics
        
### Let's see how we calculate the time-complexity using Big oh notation

![07](https://user-images.githubusercontent.com/50620277/120809007-52ad2080-c552-11eb-9eef-9f8cd3e8d624.png)

- An algorithm is said in-place if it does not require more than O(log n) space in addition to the
input.
- An algorithm is said in-place if it does not require more than O(log n) space in addition to the
input.
CS Series 👩‍🚀 #5 : Performance Analysis Part 1: Intro 🔍

Tags: computerscience, programming
Published: 2021-06-04 13:58:30

- Generally, the performance factors of a program
    - Code Algorithims
    - Languages + compilers
    - Processer (CPU) speed + Memory ⇒ how fast instruction will be executed
    - I/O and number of CPU cores
- How we can determine the performance of an algorithm.
- Or compare algorithms and determine which one is better ?
- first, we need to determine what we mean of "better"

### Experimental analysis

### Algorithms performance

- time complexity ⇒ the time it takes to execute
- space complexity ⇒ the memory it needs to execute
- We will focus on time complexity right now

### There are 2 ways to compare the complexity of algorithims

- Experimental analysis ⇒ compare the running time (benchmarking)
    - inputs ⇒ array or objects or any data
- Theoretical analysis ⇒ analyze the algorithms independently  of the implementation (software or hardware)
What Are The Uses Of Python When It Comes To Developing Apps?
Tags: python, programming, blockchain, gamedev
Published: 2021-06-04 13:58:22

Python happens to be amongst the most extensively used programming languages right now. It has become quite popular ever since it had been released and is used to create highly scalable and effective apps and websites.

According to Statista, Python had been the most in-demand programming language amongst software developers across the globe. This language was created to focus on code readability. Python app development services have become extremely popular since it allows the developers to build complicated web solutions by using fewer lines of code.

 
Advantages and Disadvantages

Similar to any other programming language, Python likewise comes with its features as well as limitations. There are various areas where Python is going to shine. Nevertheless, Python is extremely useful in terms of creating applications having complex algorithms. Python likewise excels in creating anything linked with Machine Learning and Artificial Intelligence.

Nevertheless, while talking about its drawbacks, it can be said that Python lags somewhat in terms of execution speed. Code will be executed line by line in Python, which will slow down the execution procedure. Moreover, Python is not appropriate for creating memory-optimized applications. That is not all, and there are also other advantages and drawbacks of using Python, which will help you to decide whether it is appropriate for your project or not.

Application types that can be created using Python

 In the subsequent paragraphs, we will focus on the different types of applications that can be created by making use of Python.

 
1. Blockchain Applications
2. Command-line apps
3. Video and Audio applications
4. Game applications
5. Apps for system administration
6. Business applications
7. Machine Learning apps

Learn here in the details: https://www.rlogical.com/blog/what-are-the-uses-of-python-when-it-comes-to-developing-apps/
CS Series 👩‍🚀 #4 : Intro to Data Structures and Algorithms
Tags: computerscience, programming
Published: 2021-06-04 13:56:30

# 04 - Intro to Data Structure and Algorithms


![image](https://user-images.githubusercontent.com/50620277/120703577-23e56a80-c4be-11eb-9284-0fdad3658f37.png)

- An **algorithm** is every function you created in Golang or any other programming language you programmed in. Any steps (programming statements) you wrote to solve a problem. And all programming problems is about processing data.  So, in Computer Science there is field of Algorithms. which focuses on dealing with processing data at scale, and analyzing the performance of an algorithm to solve programming problems such as sorting, searching, removing and so on. 

![05](https://user-images.githubusercontent.com/50620277/120702938-5a6eb580-c4bd-11eb-8156-bf5c6aa4ab0c.png)

- So before we talk about Algorithms, let's talk about a data that a program might have
- First of all any data in a program has a type. A data type help us define 2 things
    - a domain of allowed values
    - a set of operations on these values
- And a program compiler will through a compilation error if we misuse a data type, for example performing multiplication on chars
    - z = x*y is not allowed
    - true/false is not allowed

![06](https://user-images.githubusercontent.com/50620277/120702996-69edfe80-c4bd-11eb-866d-a405de0e5342.png)

### Atomic / Simple  Data

- Have no component parts. E.g int, char , float, etc

### Data Structur

- types that can be broken into parts. for example a Person object consist of two properties : name and an age, both of them are atomic data types (string, int respectively )
    - object ⇒ broken into properties
    - array ⇒ broken into indeces
- So a data structure is a data type whose values
    - can be decomposed into a set of atomic data or another data structure (2D Array)
    - include a structure involving the component parts (a fixed technique on how to search, store, remove and so on)
    - Possible Structures: Set, Linear, Tree, Graph

### Abstract Data Types (ADTs)

- Provide a level of Abstraction : I want to use a data structure  but I don't want to know how it's implemented, for example in Golang you can append to a slice but you don't care of the implementation at the time of using the slice data structure

## How to create your own data structure

While designing ADTs, a designer has to deal with two types of questions:

- **What** values are in the domain? **What** operations can be performed on the values of a particular data type?
- **How** is the data type represented?
- **How** are the operations implemented?