teleren/devto huggingface dataset:
A Good Dose of Perspective
Tags: devjournal, womenintech, codenewbie
Published: 2020-08-18 07:37:20

_This post was originally published on February 13, 2020 on [my blog] (https://alexlsalt.github.io/blog)._

Since the first time I saw the passage below, I haven't been able to get it out of my head:


>Striving is fine, as long as it's tempered by the realization that, in an entropic universe, the final outcome is out of your control. If you don't waste your energy on variables you cannot influence, you can focus much more effectively on those you can. When you are wisely ambitious, you do everything you can to succeed, but you are not attached to the outcome-- so that if you fail, you will be maximally resilient, able to get up, dust yourself off, and get back in the fray. That, to use a loaded term, is enlightened self-interest.

Dan Harris, 10% Happier


If this isn't something that inspires consistent action day after day after day, then I don't know what is.

Each time I come up against something that's really tough right at the beginning, I think of this quote just as my motivation starts to slip. And each time I do something a bit out of my comfort zone (apply to a job that's way out of my league, start in on a complicated side-project, or get rejected in any way), I think of this and of how important not being overly attached to the end result is.

It's a bit like a 'what's the worst that could happen' reminder paired with the idea that everything always works out in the end - and it definitely gives me a healthy dose of perspective to keep on keepin' on.

----------


P.S. Did you know I have a podcast with new episodes each Wednesday? Go listen [right over here >>] (https://www.ladiescodecollective.com/podcast)

P.P.S. I'm hosting a webinar on Friday, August 21 at 12pm (noon) EST: 5 Steps to Starting and Following All the Way Through on Your Side Projects! 

[Sign up here >>] (https://ladies-code-collective.ck.page/120a48ebc7)
Secure code review: Bonus - Who reviews the code?
Tags: security, codequality, codenewbie
Published: 2020-08-18 07:33:10

Code reviews are hard to do well. Particularly when you’re not entirely sure about the errors you should be looking for! The DevSecOps approach pushes security testing left so that vulnerabilities can be found and fixed earlier, in the design, development, or CI/CD stages of the workflow. It’s always a good idea to check for security issues in code that you review. In case you don’t know what to look for, check out this series to give you pointers for your next code reviews!

## Who reviews your code?

After you have written your code who is actually reviewing it. Do you ask the new Junior in your team because that person has is available? The goal of a review, in general, is to help spot any mistakes made during the development process. And in this case, prevent security issues.

Be aware, when reviewing code to understand that all code isn’t written equal! Think also about what lies behind the code that you’re reviewing and thus the data and assets you are trying to protect. This working knowledge is something that isn’t easy to add to a checklist. Using your domain knowledge will assist you in deciding where you should spend more of your time and where you should expect higher risk and different types of attacks. 

In addition, when appointing a reviewer make sure that this person has the appropriate knowledge to review the code. When code that has a higher security risk needs to be reviewed, ensure that someone with security knowledge (also) looked at it. Appointing this task to the new junior in your team alone does not by default make your code more secure.

A great way of determining where the highest risk areas exist is by creating attack trees that will show you where to focus your efforts first/most.

## Review time

Creating the code takes a certain amount of time. The same should apply for a thorough review. However, in many cases, the time for reviewing code is just a very small percentage compared to the creation. Understanding code someone else wrote and trying to spot security issues is hard and is definitely time-consuming. Rushing through this does not help to spot potential security issues.

## Want to know more
Check the complete [Secure code review cheat sheet](https://snyk.io/blog/secure-code-review/)
The ocidtab !!!
Tags: oracle, database, cloud, api
Published: 2020-08-18 07:09:01



[](
      <style>
        .libutton {
          display: flex;
          flex-direction: column;
          justify-content: center;
          padding: 7px;
          text-align: center;
          outline: none;
          text-decoration: none !important;
          color: #ffffff !important;
          width: 200px;
          height: 32px;
          border-radius: 16px;
          background-color: #0A66C2;
          font-family: "SF Pro Text", Helvetica, sans-serif;
        { Abhilash Kumar Bhattaram : </style> <a class="libutton" href="https://www.linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&followMember=abhilash-kumar-85b92918" target="_blank">Follow on LinkedIn</a>) }

ocidtab is a utility I had created to ensure OCI scripting is 
made easier , I have a complete description of the usage and the need of OCIDTAB for OCI CLI in this article below

https://blog.pythian.com/the-ocidtab-a-solution-to-make-oci-cli-scripting-easier/


Made some improvements and the complete source code is available here
https://github.com/abhilash-8/ocidenv

Below is a brief readme section of the ocidtab 



#ocidenv
ocidenv is a script that will generate a ocidtab file , the generated ocidtab file can be used to source the required OCID Environment Variables

#ocidenv prerequisites
The following prerequisites are needed to use the ocidenv

OCI Config Path
OCI Profile
OCI Compartment
OCI VCN Name
jq to be installed in Linux 

```
$ sudo yum install jq
```

The OCI User in the profile will need to have the required IAM Policies for OCI Services to generate the OCID

#ocidenv syntax to generate ocidtab

```
$ . ./ocidenv.sh <config_file_path> <oci_profile> <compartment_name> <vcn_name> && env | grep OCID
```

#ocidtab usage
The ocidenv.sh output will generate ocidtab files

for e.g. $ . ./ocidenv.sh ~/.oci/config DEV-PROFLE1 DEV-COMP1 DEV-VCN1 && env | grep OCID

This command will generate a ocidtab file ~/.DEV-PROFLE1-ocidtab which can be sourced as Environment Variable files or shell scripts

```
$ . .DEV-PROFLE1-ocidtab

$ oci iam region-subscription list --all --output table --profile $CONFIG_PROFILE

$ oci iam availability-domain list -c $TENANCY_OCID --output table --profile $CONFIG_PROFILE

```

In the above ehe $CONFIG_PROFILE and $TENANCY_OCID variable will be sourced from the ocidtab file .DEV-PROFLE1-ocidtab

#NOTE
The ocidenv script comes with absolutely no gurantee , due diligence is needed for setting up the required ocidtab environment files.
Python: removeprefix() and removesuffix()
Tags: python, news, computerscience, tutorial
Published: 2020-08-18 07:08:00

In Python 3.9 which is scheduled to be released in October 2020
has introduced two new string methods `str.removeprefix()` and `str.removesuffix()` respectively. 

## Why

There were a lot of confusion as people thought `str.lstrip()` and `str.rstrip()` that can be used to trim prefix and suffix but the parameter accepts a **set of characters** not the substring. 

These methods are useful for trimming prefix/suffix and also make code short and readable.

## Purpose

- `str.removeprefix(substring: string)` is a method which returns a new string with the trimmed prefix if the `str` starts with it else it will return the original string.

- `str.removesuffix(substring: string)` is a method which returns a new string with the trimmed suffix if the `str` ends with it else it will return the original string.

## Implementation

These functions were implemented in [python/cpython#18939](https://github.com/python/cpython/pull/18939).

- `removepreifx()`


```python
def removeprefix(self: str, prefix: str, /) -> str:
    if self.startswith(prefix):
        return self[len(prefix):]
    else:
        return self[:]
```

- `removesuffix()`


```python
def removesuffix(self: str, suffix: str, /) -> str:
    if self.endswith(suffix):
        return self[:-len(suffix)]
    else:
        return self[:]
```

## Usage

This shows the usage of the functions and the output of all the cases.

```python
s = 'Hello World from Python 3.9!'
print(s.removeprefix('Hello World')) // from Python 3.9!
print(s.removeprefix('')) // Hello World from Python 3.9!

print(s.removesuffix('3.9!')) // Hello World from Python
print(s.removesuffix('Python')) // Hello World from Python 3.9! 
```

## Conclusion

Python is always evolving with the community's needs and it will be the most used language in the future.
How to Make an App Like Uber Eats: Features, Cost and Tools
Tags: technology
Published: 2020-08-18 06:53:47

Recent study finds that around 44 percent of consumers in the US use food delivery services at least once per month. Great time for online food startups to flourish, isn’t it? And that’s exactly what Uber Eats, Foodpanda, GrubHub, and similar platforms do.

But it's not easy to build an app like Uber Eats. The development takes time, finances, and you won’t fit all the features in a single app. You need one application for users, another for couriers, and an admin panel for restaurants. Each having its own development complexities.

In our article, we’re discussing all the ropes of building a food service like Uber Eats and promoting it.
Food Marketplace Models
There are two food startup models that take a big share of the current market. Let’s take a more detailed look at both.

Order-Only Platform
Order-only apps act as an aggregator showing nearby eateries to app users. They connect customers with a wide network of food venues. The system gathers information about restaurants, and users get access to menus, look through restaurants’ rates and reviews, and so on.

This model helps restaurants to expand their market—while customers simply look for a good place to order food from. These platforms do not offer delivery services, though (restaurants have to use their own couriers), they gain profit by charging up to 15% commission to restaurants.

Here’s how it works:

Users choose food and place an order.
The payment is authorized within the system.
A restaurant receives the order and starts preparations.
The food is handed to the restaurant's courier.
The courier brings food to the customer, payment is deducted.
The biggest challenge for such startups is building a wide network of nearby food venues. App owners should look for all possible partners, including small eateries.

Examples of order-only apps:

Otlob
Delivery Hero
Supp.li
Zomato
All these platforms are well-designed and have different filters (by dish, location, price) to help users find the best eatery. Still, they remain limited in options and income sources. More information you can find <a href="https://www.cleveroad.com/blog/it-outsourcing-ukraine">here</a>.
Why do more and more companies choose enterprise low code platform?
Tags: enterpriselowcodeplatform
Published: 2020-08-18 06:46:48

As the demand for enterprise applications continues to grow, improving the efficiency of enterprise development has become the goal of many industries. Traditional development methods are obviously not applicable, and the enterprise low code platform can help companies solve this problem.
What is enterprise low code platform?
The low-code platform reduces the difficulty of coding, and the low-code development platform can help developers customize mobile applications in a simpler way. These platforms are creative, agile, easy to understand, and require very little coding skills. Even business people can easily control it.

Elements of enterprise low code platform
aPaaS (application platform as a service) can realize rapid application development and delivery throughout the application life cycle, simplify application compilation and deployment, and ensure availability, reliability and scalability, as well as application operation control and monitoring.
MADP (mobile application development platform) can better respond to the digital business and innovative needs of enterprises, and is an important supplement to low-code development capabilities; at the same time, many foreign low-code development platforms are gradually strengthening their support for mobile application development.
The BPM platform focuses on process-based development, and the purpose is to improve organizational efficiency by systematically improving the internal business processes of the enterprise. The current BPM platform front-end is mainly based on forms to achieve rapid development, with a relatively fixed style, and the back-end analyzes the BPMN flowchart ( Business process modeling and annotation) to complete the step-by-step process development
https://www.yeeflow.com/enterprise
What’s the basic idea of rapid application development (RAD)?
Tags: enterpriselowcodeplatform
Published: 2020-08-18 06:21:33

Yeeflow is a enterprise low code platform, and you can use it to manage your business
The basic idea of RAD is shown in:
1. Let users participate more actively in project analysis, design and construction activities.
2. Organize project development into a series of focused seminars. The seminars should involve project investors, users, analysts, designers, and constructors.
3. Accelerate the stage of requirements analysis and design through an iterative construction method.
4. Let users see a working system in advance.
The RAD model accelerates the development speed through the extensive use of reusable components, and is particularly effective for the development of information systems. But RAD also has its shortcomings:
1. Not all applications are suitable for RAD. The RAD model requires high modularity. If some functions cannot be modularized, the components required to build RAD will be problematic.
2. For large-scale, scalable projects, RAD requires sufficient manpower to create enough RAD teams, and requires developers and customers to complete a series of needs analysis within a short period of time. All may lead to the failure of the RAD project, so the communication skills and demand analysis capabilities of developers are high, and there are certain requirements for customer cooperation.
3. RAD is only suitable for information system development, not for projects with high technical risk.

https://www.yeeflow.com/enterprise
208 Downloads in a day for my First NPM Package
Tags: react, npm, showdev, webdev
Published: 2020-08-18 06:07:57

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

I'm very happy and excited to share this with you all folks. I have published my first NPM Package for ReactJS to create forms with only a JSON array you pass and rest everything will be handled by the Form Component itself.

Its been only a day I published this package and it has 208 downloads which is a very big thing for me. 

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

Github repository also have got 5 stars till now. I request you guys to checkout this library and give your valuable feedback which will help me to enhance this library which can help lot of developers in their form handling.

[GitHub Repo](https://github.com/gkhan205/formify-react)
Create an autocomplete textbox using vanilla JavaScript
Tags: tutorial, javascript
Published: 2020-08-18 04:32:53

[[Codepen Demo]](https://codepen.io/michaelburrows/pen/gOrMeod)

This article will cover the process of adding autocomplete functionality to a textbox with JavaScript.

Let’s start with the HTML markup:

```html
<input type="text" id="autocomplete" placeholder="Select a color..."></input>
<ul id="results"></ul>
```

Now for the JavaScript, starting with a data array that’ll be used to populate the autocomplete results:

```javascript
const data = ["red", "blue", "green", "yellow", "purple", "orange", "black", "white", "brown"];
```
Next declare some variables for the autocomplete input text and the results unordered list:

```javascript
const autocomplete = document.getElementById("autocomplete");
const resultsHTML = document.getElementById("results");
```

We’ll then create a function that outputs any data matching the users search query into the results list:

```javascript
autocomplete.oninput = function () {
  let results = [];
  const userInput = this.value;
  resultsHTML.innerHTML = "";
  if (userInput.length > 0) {
    results = getResults(userInput);
    resultsHTML.style.display = "block";
    for (i = 0; i < results.length; i++) {
      resultsHTML.innerHTML += "<li>" + results[i] + "</li>";
    }
  }
};
```

If you have a large data set you may want to change `userInput.length` to `> 3` to limit the length of the results.

In the previous step we called getResults(userInput) which doesn’t exist yet so let’s create it:

```javascript
function getResults(input) {
  const results = [];
  for (i = 0; i < data.length; i++) {
    if (input === data[i].slice(0, input.length)) {
      results.push(data[i]);
    }
  }
  return results;
}
```

What this function does is return a new array containing only the data matching the users search query.

Finally functionality for when a user clicks the results it’s text is set as the autocompletes value:

```javascript
resultsHTML.onclick = function (event) {
  const setValue = event.target.innerText;
  autocomplete.value = setValue;
  this.innerHTML = "";
};
```

Add some CSS and you’ve got yourself a fully functioning autocomplete textbox.
Remap keys in the keyboard in Ubuntu
Tags: linux, ubuntu
Published: 2020-08-18 04:25:10

We could use `xmodmap` to remap keys in ubuntu.

First, generate the current keycode map:
```
xmodmap -pke > .Xmodmap
```

Then open the `.Xmodmap` file, find the key you want to remap. In my case, the PageUp key is too close to the left arrow key and the PageDown key is too close to the right arrow key. Many times when I want to press the left arrow key, I pressed the PageUp key by accident. And I barely use the PageUp and PageDown key, so I want to remap the PageUp to LeftArrow and PageDown to RightArrow.

Once you open the .Xmodmap file, you will see a list of keycode and their functions, for example:
```
keycode  38 = a A a A
```

And it is easy to find the keycode for the LeftArrow and RightArrow keys:
```
keycode  83 = KP_Left KP_4 KP_Left KP_4
keycode  85 = KP_Right KP_6 KP_Right KP_6
```

But I don't know the keycode for the PageUp and PageDown key, so I need to find that first.

To detect what the keycode is for specific key, use command:
```
$ xev -event keyboard
```

In my system, when I press PageUp, it shows 112:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cfi86mddx5c2y015rfqv.png)

So we can find that in the .Xmodmap file:
```
keycode 112 = Prior NoSymbol Prior
keycode 117 = Next NoSymbol Next
```

Now to remap those keys, we just need to change them to the Left and Right arrow:
```
keycode 112 = KP_Left KP_4 KP_Left KP_4
keycode 117 = KP_Right KP_6 KP_Right KP_6
```

Now save the file, and activate the key map:
```
$ xmodmap .Xmodmap
```

Now if you press the "PageUp" key, it will work like the LeftArrow key.

But this change will only work in this login session. After you reboot the system, the keyboard will be reset to the default keys. To make it work on every reboot, we need to set an command to the "Startup Application":

```
$ xmodmap .Xmodmap
$ xkbcomp $DISPLAY $HOME/.xkbmap
```

Now open "Startup Application":
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ly9lm49s76yzokdou5p4.png)

Click Add, set name to "Remap Keys", and the command to:
```
xkbcomp /home/user/.xkbmap ":0"
```

Make sure you replace the `user` above to your username. Then reboot your system, the remap should work on next boot.

### Reference
* https://medium.com/@saplos123456/persistent-keyboard-mapping-on-ubuntu-using-xmodmap-cd01ad828fcd
* https://unix.stackexchange.com/questions/49650/how-to-get-keycodes-for-xmodmap
MaterialUI snackbar doesn't get popup at first render.
Tags: react, nextjs
Published: 2020-08-18 04:21:16

Let suppose there is a landing page and on landing page there are 2 options one is for Login and another is for SignUp.
On Login page I am just checking whether cookies are enable or not, so if cookies are blocked then I want to show the snackbar, same goes with SignUp page.
Now what happens is when I clicked on the Login button, the Login page opens up but if the cookies are blocked then snackbar dosen't pops up, but if I refresh the Login page then snackbar pops up.
I want to popup snackbar at the first render itself.
If I use 'a' tag then it works fine but using Link tag it dosen't work.
Can someone please guide me on this.
Testing an angular build with base-href locally
Tags: angular, build, production, serve
Published: 2020-08-18 04:15:19

---
title: Testing an angular build with base-href locally
published: true
description: A simple one line to solve your problems
tags: angular, build, production, serve
//cover_image: https://direct_url_to_image.jpg
---
We ran into a deployment issues with my team, Angular wasn't able to fetch the translations files. 

Being good developers (read lazy 😊) we tried to reproduce (and fix) the issue by running the production build locally rather than deploying again and again. 

Well this turned out to be a bit of a hassle 😵.

Thankfully, the amazing [angular-http-server](https://www.npmjs.com/package/angular-http-server) package solves all this hassle with a single one liner. 

So, let's do this.

## First build (obviously)
Note that we specified a base href, this is where most suggested serve methods will fail.

```bash
ng build --prod --base-href /pancakesAreTheBest/
```

## Run the production build

```bash
npx angular-http-server --path dist/{yourAngularAppName} --baseHref pancakesAreTheBest --open
```
Let's unpack
- `path` simply tells where the build files are
- `baseHref` matches the --base-href you used during the build process. *(Note, no trailing/starting "/" in the baseHref)*
- `open` will nicely open the browser for you once ready

## More
You can find the docs [here](https://www.npmjs.com/package/angular-http-server), but as a quick overview, `angular-http-server` also provides a ways to deal with cors, https and custom certificates.

Hope this helps 😇