teleren/devto huggingface dataset:
Unearthing Security issues in web apps Part-2
Published: 2020-11-20 09:35:48

Secret way for Unprivileged user to see all Corporate Card transactions through a vulnerable api.
OWASP Category: IDOR (https://portswigger.net/web-security/access-control/idor)
There is a famous Expense reporting app for Corporates and Enterprises. It had an api
https://expense.company.com/api/v1/banks
that gives the list of banks associated to the particular organization. It also had a parameter called entity which was the gateway to the vulnerability that I found.

The typical value of the entity parameter was bank. I checked the same api with the param value card. It worked!! I successfully retried the list of card ids related to the Corporate account. Still one more way to complete the hack. We haven’t seen the list of transactions for the unprivileged the user like me.

I completely scanned the application for the particular api. With tired less analysis and hardwork I finally found the api.
https://expense.company.com/api/v1/transactions?account_id={card_id}
It gives me the list of corporate expenses that I was not supposed to view. That left the Company transactions exposed to simple staff user. Hard work paid off in form of bounty.

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

Thanks for reading. Happy Hacking!!
Xamarin là gì - Những Ưu Nhược Điểm Của Xamarin
Published: 2020-11-20 09:32:57

Xamarin là gì - Đây là một công nghệ nền tảng cross-platorm được Microsoft phát triển nhằm giúp lập trình viên có thể viết một lần mã code Xem chi tiết tại: https://blog.itnavi.com.vn/nhung-uu-diem-va-nhuoc-diem-cua-xamarin/
Release 3.2 - Github action
Tags: opensource
Published: 2020-11-20 03:13:11

For this release, I choose to work with github action as the external one. The issue I found is [https://github.com/infinyon/future-aio/issues/36](https://github.com/infinyon/future-aio/issues/36). The pull request is [https://github.com/infinyon/future-aio/pull/44](https://github.com/infinyon/future-aio/pull/44)

## What is Github action
Github action is a CI/CD tool. We can rent a virtual machine(Linux, Windows,macOS) from GitHub(Azure). For me, it's like a git hook on the cloud. Everytime we change our code (push, PR, tag), we can specify some commands to run, and the results will show on our repo.

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


## How to use it.
All the command for github action is located at `.github/workflows/*.yaml`. yaml is a superset of JSON. The syntax is like this:
```yaml
name: node-js-ci

on:
  pull_request:
    branches:
      - master
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ${{matrix.os}}

    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        node-version: [12.x]
```
We can have different actions for different branches of our repo.


## Work with the `rust` project.

I am new to `rust`, so first install `rust` on my MacBook. 
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
After reading the `rust` document, I know the package tool `cargo` like `npm`. For this issue [https://github.com/infinyon/future-aio/issues/36](https://github.com/infinyon/future-aio/issues/36), I need to create a release when we have a push with a tag `v*`. And this is done by the code below.

```yaml
on:
  push:
    tags:
      - 'v*'

name: Create Release

jobs:
  build:
    name: Create Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref }}
          release_name: Release ${{ github.ref }}
          body_path: ./changelist.md
          draft: false
          prerelease: false
```


I also created a `./changelist.md` file to track the next release notes.  So the release body with replaced by the content of this file.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ekp9v07wxxy1rqn556r2.png)
Rendering table from .map() Need some help!
Tags: react
Published: 2020-11-20 09:09:32

I am trying to render a table by looping over an array. But having trouble placing everything in my html table. .map() returns all array variables and it messes up everything. How should I render it properly? Below reference code and table I am getting 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/w747tgvt0m2nfv5sfuuz.jpg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/iuaglxr4i8fpsdfcxdom.jpg)
How to print exception traceback in Python
Tags: python, debug
Published: 2020-11-20 08:59:31

---
title: How to print exception traceback in Python
published: true
description: 
tags: python, debug
canonical_url: https://timonweb.com/python/how-print-traceback-exception-python/
//cover_image: https://direct_url_to_image.jpg
---

Sometimes you're deep down in the code, and you need to debug an error quickly, send a traceback somewhere or log it into a file.

Here's how you can print the traceback of an error in the Python:

```python
import traceback

try:
    raise Boom('This is where our code blows')
except Exception:
    # here's how you get a traceback output
    traceback_output = traceback.format_exc()
    # Now you can print it, or send it, or save it in a file
    print(traceback_output)
```

It's a quick and dirty solution, and you probably should be using more sophisticated ways of debugging like error logging, but sometimes you don't have a choice.

Hope it helps someone, let me know by tweeting [@timonweb](https://twitter.com/timonweb).

*Source: [https://timonweb.com/python/how-print-traceback-exception-python/](https://timonweb.com/python/how-print-traceback-exception-python/)*
AWS Là Gì? Các Điểm Nổi Bật Của AWS (Amazon Web Services)
Published: 2020-11-20 08:57:04

Trong bài viết này,chúng ta cùng nhau phân tích về AWS (Amazon Web Services), một công nghệ hiện đại của gã khổng lồ Amazon. Xem chi tiết tại: https://blog.itnavi.com.vn/aws-la-gi/
Try react-native with docker in 5 cmd-lines
Tags: reactnative, docker, android, ios
Published: 2020-11-20 08:56:41

**Warning :** the following method is just a way to test quickly react-native. It's not a good practice to every day work.

Requirements:
* docker >= 19 (the following cmd-lines are designed for linux platform).

1. Init the docker

```bash
docker run --rm -ti --net host -v /dev/bus/usb:/dev/bus/usb -v $(pwd):/app reactnativecommunity/react-native-android bash 
```

2. Check device connection 

You need to plug an android smartphone in developer mode. Then check if the device is connected and authorized. If not don't forget to press the authorized button on your smartphone.

```bash
adb devices
```


3. Init a default react-native project

```bash
cd /app && npx react-native init helloworld 
```

4. Run the project

```bash
cd helloworld && npx react-native run-android
```

```bash
npm start
```

On the smartphone, close the app and reopen it.

That's all you should have your newly created app launched!
Php Là Gì? Những Kiến Thức Căn Bản Về Ngôn Ngữ Lập Trình PHP
Published: 2020-11-20 08:48:30

Khi tìm việc về Website các bạn sẽ thấy yêu cầu biết ngôn ngữ lập trình PHP. Vậy ngôn ngữ PHP là gì và được sử dụng trong những công việc nào?Xem chi tiết tại: https://blog.itnavi.com.vn/php-la-gi/
Sass/SCSS identifier starting with a number
Tags: question, scss, sass, mixins
Published: 2020-11-20 08:46:35

I'm writing SCSS mixins for using it for responsive web design.

For example: 
```scss
// Large devices
@mixin lg {
    @media (min-width: #{$screen-lg-min}) {
        @content;
    }
}

// Extra large devices
@mixin xl {
    @media (min-width: #{$screen-xl-min}) {
        @content;
    }
}
```

Now I wanna write a mixin for extra large devices 
```scss 
$screen-2xl-min: 1536px; 
```

But when I try to declare the mixin:
```scss
@mixin 2xl {
    @media (min-width: #{$screen-2xl-min}) {
        @content;
    }
}
```

He gives an error with: 
```bash 
Expected identifier: @mixin 2xl { 
``` 

Can someone help me? Is there an option to let the name start with a number??
C# 9.0 Inheritance in Record Type
Tags: csharp, programming, dotnet
Published: 2020-11-20 08:45:41

A `record` in C# 9.0 can inherit from another `record`. This is one of the strong reasons why you should consider using `record` over `struct`.

```csharp
var student = new Student() { FullName = "Wrishika Ghosh", Grade = "V" };

public record Person
{
    public string FullName { get; set; }
}

public record Student : Person
{
    public string Grade { get; set; }
}
```
You can even simplify it by using the positional approach via auto construct,

```csharp
var student = new Student("Wrishika Ghosh", "V");

public record Person(string FullName);

public record Student(string FullName, string Grade) : Person(FullName);
```
Third party REST API(OAuth) call using Azure Data Factory-Web Activity
Tags: oauth, datafactory, restapi, managedidentity
Published: 2020-11-20 08:44:01

One of the common requirements in Data flow pipelines is to retrieve data from REST endpoint and copy it to a data store.

When I started working on ADF, I found out, there was a confusing list of concepts available to implement scenarios like this: 

1. Linked Service using Anonymous/Basic authentication to connect 
   to REST endpoint.
2. Linked Service using MSI/AAD service principal to connect to 
   REST endpoint.
3. Web Activity to fetch time based OAuth(access) token using 
   credentials in Http POST body. 

First option, helps in cases when you are trying to access Azure or third party REST APIs where no authorization(access token) is required. In this case, you can create a Linked Service using Anonymous or basic authentication to access the data available at the endpoint.

**Second option** lets you access only **Azure APIs/services/endpoints** by providing either the managed service identity or using the Service principal to authenticate and authorize using AAD.

**Third option** is used when you want to access a **third party REST API** which requires authentication as well as authorization(OAuth).In this case the Linked Service approach does not work and a web activity in a pipeline is required to fetch the access token. This access token is then used in subsequent calls to the REST endpoint.

Below are the steps to implement the third option.(Assuming Username and password are stored in Key Vault)
1. Create a Web activity to fetch username from AKV.
2. Create another Web activity to fetch password from AKV.
3. Create another Web activity to do a POST call with JSON in 
   request body consisting of username/password.
   Output of this third activity gives the access token , which 
   can be used in subsequent calls to REST API.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8231ock3aswm57fprwu3.PNG)

Refer the ADF lab 3 below , for a sample of this.
{% github https://github.com/Mmodarre/AzureDataFactoryHOL %}
Where can I find the best course for DRF + React to create BLOG?
Tags: beginners, django, react
Published: 2020-11-20 08:37:10

I want to learn more about DRF + React on Blog Project. But I couldn't find the best course.
I watched some tutorials, but it's not covering all the necessaries that I want.

I want to create my own blog with DJANGO (DRF) + REACT (NEXT.JS) with SEO, and also Personal Shop with Online Payments.

I've checked on Udemy, but no courses exist about this.

Please advise. Thanks
What are the competences for middle React Native developer?
Tags: react, reactnative, mobile, discuss
Published: 2020-11-20 08:33:29

Hey guys! 
I wrote <a href="https://exceed-team.com/hire-react-native-developers">a post in my blog</a> and made a research of techskills a React Native developer should have. Here it is:
* Current JavaScript standards: ECMAScript2015 (aka ES6), ECMAScript2019 (aka ES10)
* An extended set of JavaScript and Typescript
* React Native Libraries: React-Router, Redux, Redux-Thunk, Redux-Saga, GraphQL
* Package managers: NMP, Yarn
* JavaScript extensions: JSX
* Tools to help maintain code style: ESLint, TSLint, Prettier

**Discussion**
Did I miss something? What competences should a React Native developer have in a middle stage? Can you share your experience.
Compile SCSS and JS inside a PHP Project
Tags: php, css, javascript
Published: 2020-11-20 08:19:47

There are still Projects which do not utilize all those fancy JavaScript Frameworks and their environments. No NPM, no YARN, just PHP (and HTML, CSS)

But of course, SCSS might be used and some JavaScript parts you'd like to compile into minified files.

How to compile your SCSS and JS files? Install a grunt workflow, Gulp or Webpack? You could... 

... but you don't need to mix up your well organized PHP project with Node stuff. Its possible to just install {% github unglue-workflow/client no-readme %} and compile right from your console, no need for a package.json file (which is instantly outdated anyhow) inside your PHP Application.

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

## And this is why we cam up with [unglue.io](https://unglue.io) an API based compile service for JS and SCSS.

> *Forget the hassle of installing Node on your local system just to compile some SCSS files and minify/uglify JS code. A composer package which is seamless installed along with other depencies does all the job.*

You can either host your own API (there is a docker server image or just install the node package somewhere) or just use the public API we offer, its completely free and open source.

## Using Unglue

In order to use unglue you just need 3 things:

1) Install the composer package `unglue/client` (`composer require --dev unglue/client`).

2) Create an `.unglue` file in the directory you would like to have your compiled files and let unglue know what to compile:

```
{
    "css": [
          "../scss/main.scss"
    ],
    "js": [
        "../js/main.js"
    ]
}
```

3) And run the `compile` or `watch` command right from your vendor folder: `./vendor/bin/unglue watch`

![Compile with Unglue](https://dev-to-uploads.s3.amazonaws.com/i/ay596bh69jtjc2zon5m5.png)

> If you are running your own server (locally or on a public URL) use `./vendor/bin/unglue watch --server=yourunglueserver.com`

For the full documentation and usage see [unglue.io](https://unglue.io)

---

This is just another option to handle your frontend code workflow, the common workflows are not wrong, its just: *Frontend workflow done different*
Javascript array sort with Reducer
Tags: javascript, react, tutorial, webdev
Published: 2020-11-20 08:17:18

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5c4lpp9kqr0xnzcnp6y9.jpg)

This has been the most tricky/confusing javascript interview question for starters specially 😀

And this was my answer once which made interviewer shy: how the hell candidate will know if interviewer has speech recognition issue..

Btw, instead forloop, you can use "reducer" like this ⤵️

//

```

let reducer = (acm, value) => {
  const nextIndex = acm.findIndex(i => value < i );
  const index = nextIndex > -1 ? nextIndex : acm.length;
  acm.splice(index, 0, value);
  return acm;
}
// execution
Ley arr = [
arr.reduce(reducer, []) will produce [1,2,3,4]

```

Let me know how you answered this kind of interviews 

Thanks!
Features of White Label Travel Portal
Tags: beginners
Published: 2020-11-20 08:16:09

The white label travel portal refers to a web portal service that is created by one organization and offered to another organization that puts its own logo and brand name on the web portal. So white name is only a readymade web portal. 

Characteristics of [white label travel portal solution](https://travelportalsolution.com/white-label-travel-portal/) that a travel agent or travel management company will have from the white label. 

White label's B2C (Business to Customer) travel portal search engine bookings are for both of them Users and Visitor

A travel agent does not require GDS (Global Distribution System) or LCC

With a white label travel portal, you will have live inventory information of flight, bus, and transport.

Simple Payment Gateway 

Add and supervise subagents with the B2B (Business to Business) white label Solution Module 

Easy to use Admin Panel to figure out how to book 

With white label travel portal, you will have both on the web and Offline booking module 

Simple to screen Deposit Management System 

Integrated Commission Management System 

Easy to use Dashboard Management 

Simple Order management with White Label travel portal request Management 

Filtered report checks 

Simple Booking and Cancellation reports 

Check Balance of the flight, bus, and transport inventories 

Exclusively created Control board to fix the bookings or reservations and Customer information in the travel web portal 

With the white label travel portal, you will be able to transfer Tour CMS packages

Accommodation Fee Management 

White Label travel portal solution is an ideal method to change over your travel agency into an online travel booking service providing company. With the assistance of the web portal, you can not just assist your clients to book and hold facilities, flight, transport, and vacation packages.
Link to a Specific Section of Google Doc
Published: 2020-11-20 08:15:53

###Sometimes, you need to divide your document into chapters or section.
###Linking of specific section of document can easily done in google docs.
###1. Set your Bookmark
###First you need to create a bookmark in your google doc.
###**>You can do this by clicking on the point of your text you want to link to.>**

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


###**>Click Insert button in the top menu>Bookmark**

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

###**Now, if you have done correctly. A bookmark icon should appear next to your text.**

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

###**To create a link, go the text which is supposed to link to the bookmark.**
###**>Select the text>**

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

###**Right click>link**

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

###**> a new menu will appear>Click on Bookmarks>**
###**Click on the bookmark which you created earlier.**

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

###**If you have done everything correctly. Your link is set, and clicking on it will take you straight to the bookmark you set!**
Flashing / Blinking Charts using CanvasJS
Tags: canvasjs, charts, datavisualization, javascript
Published: 2020-11-20 07:52:26

While developing a dashboard, developers get requirement to blink a column / bar within the chart to highlight it or to make it different from all other columns / bars or sometimes it could be to blink data-labels to show information like Sell / Buy incase of StockCharts. This can be easily achieved in CanvasJS Charts / StockCharts. Below is a simple tutorial for the same with sample code & live examples.

![CanvasJS StockChart with Blinking / Flashing Annotatin](https://dev-to-uploads.s3.amazonaws.com/i/o2arj3s6pk6prws1p78v.gif)

## Prerequisites
* [CanvasJS](https://canvasjs.com/)

## Creating Column Chart
```
var chart = new CanvasJS.Chart("chartContainer", {
  title:{
    text: "Basic Column Chart"
  },
  data: [{				
    dataPoints: [
      { label: "apple",  y: 10 },
      { label: "orange", y: 15 },
      { label: "banana", y: 25 },
      { label: "mango",  y: 30 },
      { label: "grape",  y: 28 }
    ]
  }]
});

chart.render();

```

## Adding Blinking Effect to Column
```
var chart = new CanvasJS.Chart("chartContainer", {
  title:{
    text: "Blinking Column Chart"
  },
  data: [{				
    dataPoints: [
      { label: "apple",  y: 10 },
      { label: "orange", y: 15 },
      { label: "banana", y: 25, color: "#FFAA02", blinkColors: ["#FFAA02", "#6AFF05"] },
      { label: "mango",  y: 30 },
      { label: "grape",  y: 28 }
    ]
  }]
});

blinkColumns(chart);
chart.render();

function blinkColumns(chart) {
  var k = 0;
  var interval = setInterval(function() {

    for(var i = 0; i < chart.options.data.length; i++) {
      for(var j = 0; j < chart.options.data[i].dataPoints.length; j++) {
        dataPoint = chart.options.data[i].dataPoints[j];
        if(dataPoint.blinkColors) {
          dataPoint.color = dataPoint.blinkColors[k++ % dataPoint.blinkColors.length];
        }
      }
    }   
    chart.render();
  }, 500);
}
```
{% jsfiddle https://jsfiddle.net/canvasjs/ghd6ekrc/ result %}
Below is an example of [StockChart](https://canvasjs.com/javascript-stockchart/) with blinking indexlabels / data-labels.
{% stackblitz canvasjs-stockchart-blink-indexlabels view=preview %}

Checkout [CanvasJS Gallery](https://canvasjs.com/javascript-charts/) for more examples with downloadable samples.
What is Unit Testing? Unit Testing Tools and Types |
Tags: testing
Published: 2020-11-20 07:44:56

Unit Testing
The process of testing the individual units of software is called Unit Testing. It will be done during the development of a software application. According to the programming procedure, a unit may be an individual function of the software.

Unit Testing is one of the levels of software testing and usually done by the developer. It is the first level of testing. Developers or QA Engineers will handle this testing.

Working Process of Unit Testing
With the help of this testing, we can fix bugs or errors during the development cycle
It enables developers to make changes quickly and saves cost
It helps to get a good quality software product
Unit Testing Types
It is of two types namely Manual or Automated.

Most probably performed by manually but developers always prefer to do automation testing. It is a white box testing technique comes under following test coverage techniques

Branch Coverage
Condition Coverage
Decision Coverage
Statement Coverage
Using White box testing methods
Test cases can be derived that all independent paths within a module have been exercised at least once.
Exercise all logical decisions on their true and false sides.
Executes all loops at their boundaries.
Exercise internal data structures to assure their validity.
Unit Testing Tools
JTest
JUnit
NUnit
JMockit
EMMA
PHPUnit
xUnit.net
TestNG
QuiltHTTP
HTMLUnit
EmbUnit
SimpleTest
ABAPUnit
TypeMock
LRDA
Cantata
Karma
Jasmine
Mocha
Parasoft
Advantages
Developers will be able to understand the functionality of the Unit API
It helps the developers to rewrite and modify the code anytime and ensure the unit works as usual
It helps to test each and every unit of the software application so that named as Unit Testing
Disadvantages
It is very complicated to test each and every unit in large scale programs as it takes a lot of time
There may be a chance of missing units or paths of code in trivial programs
It allows testing only certain units or paths of code so that we are unable to grab the integration errors
For more information about this post visit :
https://w3softech.com/blog/unit-testing-tools-and-types/