teleren/devto huggingface dataset:
[Intro] How to trigger a Lambda function when a file is uploaded to an existing S3 bucket using Amazon EventBridge and AWS CDK
Tags: aws, serverless, awslambda, awscdk
Published: 2020-10-29 10:44:12

**In this series of blog post, what we gonna to do is: **

1. Observe a file is uploaded to an existing S3 bucket using Amazon EventBridge
2. When Amazon EventBridge notice a file is uploaded to S3 bucket, it will trigger a Lambda function. 
3. Provision our Lambda Function, Amazon EventBridge, Policy and all other resources using AWS CDK. 

**Scenario**

You using Aws Amplify for Android app. 

*Now you need storage*
so you can store the images, video or audio your user upload from you app. 

So you do this: 

> amplify add storage

Answer a few question in Amplify CLI like showing [here]('https://docs.amplify.aws/lib/storage/getting-started/q/platform/android#provision-backend-storage')

Amplify provisioned a S3 bucket for you. Nice and easy. Now you can upload your user file into this bucket. 

**Follow with this scenario:**
* Now you have an existing S3 bucket which generated by Aws Amplify
* When user upload the file to this bucket, you want to trigger a Lambda function which you can use other AWS service. 

For example,
* When an image is uploaded to the bucket, you want to use AWS Rekognition to do face recognition
* When an audio file uploaded to the bucket, you want to use AWS Transcribe to transcribe the audio file to words. 

The problem is how? 

Stay Tuned. 

[[Part 1]What is Amazon EventBridge and How to provision Logging S3 bucket, and bucket policy using AwsCDK](https://dev.to/upupkenchoong/part-1-what-is-amazon-eventbridge-and-how-to-provision-logging-s3-bucket-and-bucket-policy-using-awscdk-3g6j)

**Before you go,** if you like this series or find this useful consider to buy me a coffee 😊🤞 for 5 USD or more. 
I will prepare a GitHub repo for this whole tutorial series and arrange into separate commit for each part. 
This will only available for my supporter cause I spent a lot of time to prepare this. Anyway, I appreciate you here. Have a good day.

<a href="https://www.buymeacoffee.com/kenchoong" target="_blank">
![bmaco](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ap0mog1ue623vr1zbo36.jpg)
</a>

**Follow me on Twitter:** [@upupkenchoong](https://twitter.com/upupkenchoong) 

**My upcoming product(If you interested):** [@sarah_assistant](https://twitter.com/sarah_assistant)
How to update to the newest release of Fedora
Tags: sysadmin, linux, fedora
Published: 2020-10-29 23:39:30

---
title: How to update to the newest release of Fedora
published: true
date: 2020-10-29 10:41:30 UTC
tags: sysadmin,linux,fedora
canonical_url: https://jjasghar.github.io/blog/2020/10/29/how-to-update-to-the-newest-release-of-fedora/
---

The [Fedora](https://getfedora.org/) community just released Fedora [33](https://fedoramagazine.org/announcing-fedora-33/) the other day. I’ve been running Fedora 32 for a while, on both servers and my laptop, and loved every minute of it. Needless to say as soon as I heard that 33 came out I needed upgrade to it. There’s a handful of pages and howto’s out there, but for my own sanity I’m capturing this here.

> This is also how to fully upgrade your release, so this will work in the future

```
sudo su - # yes you need to be root
dnf upgrade --refresh
dnf install dnf-plugin-system-upgrade
dnf system-upgrade download --releasever=33 # put 'next' version here
dnf system-upgrade reboot # this reboot can take a while
cat /etc/redhat-release # confirm your update!

```

And that’s it! Pretty straight forward, and from some statements from friends, you should go one release at a time, so don’t jump from Fedora 30 to 33, go 30 to 31 to 32 to 33.
How to show a loading bar when changing routes in NextJS
Tags: nextjs, loading, nprogress, route
Published: 2020-10-29 10:38:45

![Nprogress](https://cdn-images-1.medium.com/max/800/1*9E6_50z9VcxAoSdotHaNyw.gif)

## Setting up
I spent days trying to find the right thing to google on how to setup the blue loading bar that shows at the top of your screen when navigating between routes in NextJS. It's important to have this loading indicator to signify that a route change is occuring to avoid users assuming that the application has frozen.
This article assumes that you already have NextJS setup. To get started, we need to install the `nprogress` library.
Run
```
npm install nprogress
```
## In \_app.js
Inside **pages/\_app.js**, add the following piece of code.
```js
import NProgress from "nprogress"
import Head from "next/head"
import Router from "next/router"

Router.onRouteChangeStart = url => {
  NProgress.start()
}

Router.onRouteChangeComplete = () => NProgress.done()

Router.onRouteChangeError = () => NProgress.done()

export default function MyApp() {
    return (
        <>
            <Head>
               <link
                rel="stylesheet"
                href="https://cdnjs.cloudflare.com/ajax/libs    /nprogress/0.2.0/nprogress.min.css"
          />
             </Head>
              <Component {…pageProps} key={route} />
        </>
      )
}
```
Above, we access the Router object available inside **next/router** to ensure. `onRouteChangeStart` i.e when a Route change is in progress, NProgress will run i.e `NProgress.start`. Once the route change is done i.e `onRouteChangeComplete`, we call the done method on `NProgress`. We call the same method if there's an error.
I had issues using the NProgress stylesheet from the `nprogress` package within my application and resorted to using the stylesheet they provide via their CDN. Without the stylesheet, you won't notice anything on the screen.
Now, when you navigate to any page within your application, you should see a blue loading bar at the top of your screen
I'll take one of everything …
Tags: discuss
Published: 2020-10-29 10:38:27

This morning on _Things I Saw in Revenue Generating (Legacy) Code_

Wait, so this modal is displaying an iframe that bootstraps the entire angularjs application, including the microfrontend container written in react, just to show a control for uploading a file? Cool, cool.

Tell me about something interesting you've seen in code recently!
How to effectively build and manage a remote development team
Tags: remote, agile, techtalks, ruby
Published: 2020-10-29 10:38:01

In February of 2020, our COO, Alexey Likhachev, presented a report at the TeamLead Conf 2020 in Moscow. He shared Evrone’s experiences of successfully managing remote teams. We hope that this article will become your guide to 20 best practices that will help you build, grow, and manage a team that is fully remote and spread around the world.

From the day Evrone was founded, it was designed for remote development. Even the two founders of the company work from different cities. Over the past ten years, we have conducted a lot of experiments and built all the necessary processes to work efficiently with a completely remote team.

[Learn more](https://evrone.com/remote-teams-management?utm_source=devto&utm_medium=article&utm_campaign=remote-teams) about how to effectively manage remote developers.
Arraylike Functions in PL/SQL
Tags: plsql, oracle
Published: 2021-01-01 16:30:40

---
title: Arraylike Functions in PL/SQL
published: true
date: 2019-10-29 10:34:30 UTC
tags: PLSQL,Oracle
canonical_url: 
---

 ![](https://micodify.de/media/posts/2/array-like-functions.jpg)

Some time ago, when I had to take care of Oracle Forms, I was annoyed that in Forms you always have to call several procedures for switching on and off. So you have to drop the following lines to show a text field again.

```
set_item_property('MY_ITEM', visible, property_true);
set_item_property('MY_ITEM', enabled, property_true);
set_item_property('MY_ITEM', navigable, property_true);
```

And the whole thing is then repeated per item, of course. It would be cool here if you could operate all items at once. And all this would be the same as in other languages, for example Java or JavaScript. Oracle gives us special types for this:

`odcivarchar2list `und `odcinumberlist`

With these you can directly create a variable list of parameters and pass it to a method. This is what a procedure that simply sets all passed properties with a corresponding value would look like:

```
procedure set_item_properties(p_item in varchar2,
                              p_properties in sys.odcinumberlist,
                              p_property in number) is
begin
  for i in (select m.column_value m_value
              from table(p_properties) m)
  loop
    set_item_property(p_item, i.m_value, p_property);
  end loop;
end;
```

and the call then just like that:

```
set_item_properties('MY_ITEM', sys.odcinumberlist(visible, enabled, navigable), property_true);

```

Cool, right ?
Graph
Tags: hacktoberfest, javascript
Published: 2020-10-29 10:34:21

    class Graph {
        constructor() {
            this.adjacencyList = {};
        }

     // Add Value in Graph
        addVertex(vertex) {
            if(!this.adjacencyList[vertex]) {
              this.adjacencyList[vertex] = [];  
            } 
            console.log(` -> ${vertex} -> Added successfully `)
            return g;
        }
     // Add Edge-Array in Graph   
     // EXAMPLE.. -> g.addEdge("Rajkot", "Ahmedabad")
        addEdge(v1,v2) {
            this.adjacencyList[v1].push(v2);
            this.adjacencyList[v2].push(v1);
            console.log(` -> ${v1} or ${v2} -> Edge-Array Added successfully `)
            return g;
        }

     // Remove Value in Graph
        removeEdge(vertex1,vertex2) {
            this.adjacencyList[vertex1] = this.adjacencyList[vertex1].filter(
                v => v !== vertex2
            );
            this.adjacencyList[vertex2] = this.adjacencyList[vertex2].filter(
                v => v !== vertex1
            );

            console.log(`-> ${vertex1} or ${vertex2} -> Edge-Array Deleted successfully`)
            return g;
        }

     // Remove a Vertex in Graph
        removeVertex(vertex) {
            while (this.adjacencyList[vertex].length) {
                const adjacencyVertex = this.adjacencyList[vertex].pop()
                this.removeEdge(vertex, adjacencyVertex);
            }
            delete this.adjacencyList[vertex]
            console.log(`-> ${vertex} -> Deleted successfully `)
            return g;
        }
    }

    let g =new Graph();
    g.addVertex("Rajkot");  
    g.addVertex("Ahmedabad");
    g.addVertex("Morbi");
    g.addEdge("Morbi", "Ahmedabad")
    g.addEdge("Rajkot", "Morbi")
Which freelancing platforms have you tried?
Tags: watercooler, career, freelancing
Published: 2020-10-29 10:33:49

---
title: Which freelancing platforms have you tried?
published: true
description: 
tags: watercooler, career, freelancing
cover_image: https://cdn0.tnwcdn.com/wp-content/blogs.dir/1/files/2019/11/sale_23502_primary_image_wide-796x398.jpg
---
Online freelance platforms offer a remote space for individuals to get listed, and businesses to post projects or browse for talent. Each site use different listing prices and bidding strategies. 

Some of the most popular ones include: [Upwork](https://upwork.com), [Freelancer](https://freelancer.com), [Toptal](https://toptal.com), [Fiverr](https://fiverr.com), [PeoplePerHour](https://peopleperhour.com), [SimplyHired](https://simplyhired.com), [Envato](https://envato.com) and [Guru](https://www.guru.com/).

What's your experience of using online freelancing platforms and which ones would you recommend?
Bảng So Sánh Giữa Ngôn Ngữ Lập Trình C & Ngôn Ngữ C++
Published: 2020-10-29 10:21:52

Ngôn ngữ lập trình C và C++ là hai ngôn ngữ thông dụng nhất thường được sử dụng để giới thiệu cho các lập trình viên mới vào nghề. Xem chi tiết tại: https://blog.itnavi.com.vn/ngon-ngu-lap-trinh-c-va-c/
Open-sourcing Vessel: a high-level Ruby web crawling framework
Tags: ruby, opensource, coding, webdev
Published: 2020-10-29 10:21:49

Vessel is a fast, open-source, high-level, web crawling and scraping framework for [Ruby](https://evrone.com/ruby?utm_source=devto&utm_medium=article&utm_campaign=vessel), built on top of [Ferrum](https://evrone.com/ferrum-ruby-chrome-driver) — a minimal-dependency pure-Ruby driver for running headless Google Chrome instances.

Why would you need a web crawler? Perhaps you’re building a search engine for an intranet or a group of public-facing websites, or just need to mirror a website with finer-grained control than tools such as wget offer.

Learn how you can use Vessel framework in your project via the link above.
React Native Là Gì- Học Lập Trình App Cơ Bản Với React Native
Published: 2020-10-29 10:15:14

React Native là gì - Đây là câu hỏi không phải ai cũng trả lời được.Hãy cùng chúng tôi giải đáp vấn đề này trong bài viết dưới đây nhé. Xem chi tiết tại: https://blog.itnavi.com.vn/react-native/
Product owner Là Gì- Vai Trò & Công Việc Của Product Owner
Published: 2020-10-29 10:02:05

Product owner là gì- Đây là người có rất nhiều trách nhiệm quan trọng, quyết định đến các tính năng của sản phẩm. Hãy cùng tìm hiểu với ITNavi nhé! . Xem chi tiết tại: https://blog.itnavi.com.vn/product-owner/
Deploying React App On GitHub Pages In 6 Steps.
Tags: react, githubpages, publish, deploy
Published: 2020-10-29 09:54:09

Show your **React** App to the world for FREE Using [GitHub Pages](https://pages.github.com/) in 6 Easy Steps.

## 1. Create a Github Repository.

Create a Public GitHub Repository for your **React** App.

> You need to create a GitHub account if you don't have it yet.

![Creating Repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xkm4u5fv7h4i1qqqy55h.png)

> Make a note of your **"Owner Name"** and **"Repository Name"** in GitHub.

## 2. Adding homepage key.

Go to `package.json` and make a new **key** named `homepage` and put its value something like the following
`http://<owner-name>.github.io/<app-name>/`

In my case it will be:

package.json

```json
{
  "homepage": "http://youssefzidan.github.io/gh-pages-app/",
  "name": "gh-pages-app",
  "version": "0.1.0"
  //...
}
```

## 3. wrap your **Routes** inside `<HashRouter basename="/">`

If your app has routing wrap your **Routes** inside `<HashRouter basename="/">`

> We need this step to prevent GitHub to redirect your app to 404 in case you refresh teh page.

```jsx
import React from "react";
import {
  BrowserRouter,
  Switch,
  Route,
  Link,
  HashRouter,
} from "react-router-dom";

export default function App() {
  return (
    <BrowserRouter>
      <HashRouter basename="/">
        <nav>
          <ul>
            <li>
              <Link to="/">Home</Link>
            </li>
            <li>
              <Link to="/about">About</Link>
            </li>
            <li>
              <Link to="/users">Users</Link>
            </li>
          </ul>
        </nav>

        <Switch>
          <Route path="/about">
            <About />
          </Route>
          <Route path="/users">
            <Users />
          </Route>
          <Route path="/">
            <Home />
          </Route>
        </Switch>
      </HashRouter>
    </BrowserRouter>
  );
}

function Home() {
  return <h2>Home</h2>;
}

function About() {
  return <h2>About</h2>;
}

function Users() {
  return <h2>Users</h2>;
}
```

## 4. Build Your app

Run the build command

```
npm run build
```

You will find a newly created folder named **build**.

![Build Folder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzym3zmjddsa1w0hd4ap.JPG)

## 5. Change the **build** folder name to be **docs**.

Rename the **build** folder to be **docs**

![Docs Folder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fo4eh6annau8utoqsrfw.JPG)

## 6. Change Repo Settings.

- Go to repo settings => Pages section.

- Pick your default branch in my case it's master

- Change the `/(root)` option to be to `/docs`

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l5fh5z22qi52yw2wvmev.JPG)

Now wait a few minutes and you will see your app published in a URL like this

```terminal
https://youssefzidan.github.io/gh-pages-app/
```

<a href="https://www.linkedin.com/in/youssefzidan/" target="_blank">
    <img src="https://img.shields.io/badge/LinkedIn-%230077B5.svg?&style=flat-square&logo=linkedin&logoColor=white" alt="LinkedIn">
How to resolve `kubectrl apply`deployment conflict error
Tags: k8s, kubernetes, devops, deployment
Published: 2020-10-29 09:48:06

## Symton
When you try to apply a deployment yaml file to kubernetes cluster, you get the error:

```
kubectl apply -f tmp.yaml

The Deployment "xxx" is invalid:
* spec.template.spec.containers[0].env[53].valueFrom: Invalid value: "": may not be specified when `value` is not empty
```

## Analysis

The kubernetes api met some issues when diff your `tmp.yaml` with the current running deployment.

For example, your current running deployment file has a hardcoded environment, and your new tmp.yaml has an environment whose value is reading from other sources:

```
# current running deployment
- name: EXPRESS_LOG_LEVEL
  value: debug

# You are trying to update to
- name: EXPRESS_LOG_LEVEL
  valueFrom:
    configMapKeyRef:
      name: xxx-configmap
      key: EXPRESS_LOG_LEVEL
```

## How do I manually diff?

You can export the current deployment yaml by:

```
kubectl get deploy/your-current-deploy -o yaml | pbcopy
```

Then you can diff them via https://www.diffchecker.com/diff .

## Solution

Delete the conflicted environments and then apply again:

```
KUBE_EDITOR="vim" kubectl edit deploy/your-current-deploy

kubectl apply -f tmp.yaml

# Now you get the success message!
deployment.apps/xxx-app configured
```
JHipster security scanning
Tags: java, javascript, security
Published: 2020-10-29 09:00:15

{% youtube ewHl9i7RrDg %}

JHipster is a well known open source platform to quickly generate, develop, and deploy modern web and microservice applications. Using the [JHipster](https://www.jhipster.tech/) CLI, you can pick and choose the frameworks and platforms you want to use for your applications.

Scaffolding an application and using multiple ecosystems simultaneously brings in many dependencies from either of the ecosystems chosen. Keeping an eye on the health of your dependencies is essential. You especially want to be notified if one of these many dependencies you use has a security issue.

## Blogpost
Check out the [blog post](https://snyk.io/blog/jhipster-security-scanning/) and see how you can integrate with all the different CI/CD pipelines that JHipster supports out or the box like: Github Actions, Jenkins, Circle CI, Travis CI and Gitlab CI.
- https://snyk.io/blog/jhipster-security-scanning/
What are the most clicked phishing emails?

Tags: security, codenewbie, news
Published: 2020-10-29 08:49:13

web site url link : https://www.teknobu.net/english/what-are-the-most-clicked-phishing-emails/

Phishing emails are one of the common technique cybercriminals use to hack valuable data through the web. It may be very difficult for common hackers to hack an secure system by following some hacking tricks and decrypting the systems secure servers. But it is easier when they target small individuals and trap them with phishing emails. This is mostly done with the emails asking for emergency attention, offering tempting opportunities or something like that.


The list below includes phishing emails that are time to time effectively at eliciting a click. The two most effective phishing emails in Q1, 2018 were:


 
Subject: A Delivery Attempt Was Made

Subject: Change of Password Required Immediately

21% of end users responded to the first and 20% to the second. Perhaps unsurprisingly since it is tax season, a phishing email subject line related to tax made third place. In the U.S, a W-2 Form is a summary of wages, salary, and tax information for employees, detailing the tax that has been withheld from paychecks. This form is needed in order for a tax return to be filed. The email was opened by 13% of users.

web site url link : https://www.teknobu.net/english/what-are-the-most-clicked-phishing-emails/
How and When to Use SQL Window Functions
Tags: sql, datascience, postgres, database
Published: 2020-10-29 08:45:16

You may think SQL window functions are similar to aggregating but it actually defines a window of rows with a given length around the current row.

You can do,

1. aggregate operations: SUM, COUNT, MAX, MIN
2. ranking: RANK, DENSE_RANK, ROW_NUMBER, NTILE
3. value: LAG, LEAD, FIRST_VALUE, LAST_VALUE

Let's give a concrete example to understand what exactly a window function is doing.

Consider you are a data scientist working on a classification task and you want to predict if an event will occur within the next three hours. In your data, the label is 1 if the event occurred at that exact time and 0 otherwise. Therefore you need a backfill operation to build the target. You can do it by using SQL window functions. Let's create the data frame first,

*We don't need to create a database, we will use the `pandasql` library for executing SQL queries over `pandas` data frames (download via `pip install pandas` and `pip install pandasql`).*

```python
# import libraries 
import pandas as pd

data = [
    ("2020-01-01 06:00:00", 0),
    ("2020-01-01 07:00:00", 0),
    ("2020-01-01 08:00:00", 0),
    ("2020-01-01 09:00:00", 0),
    ("2020-01-01 10:00:00", 0),
    ("2020-01-01 11:00:00", 1),
    ("2020-01-01 12:00:00", 0),
    ("2020-01-01 13:00:00", 0),
    ("2020-01-01 14:00:00", 0),
    ("2020-01-01 15:00:00", 0),
]

# create data frame
df = pd.DataFrame(data, columns=["datetime", "event"]) 

df.head(10)
```

Here is the dataframe:

![dataframe head](https://dev-to-uploads.s3.amazonaws.com/i/anxcv1k15o4jyyfp1lex.png)

Let's solve the problem:

```python
from pandasql import sqldf

pysqldf = lambda q: sqldf(q, globals())

solution = pysqldf(
"""
SELECT datetime, event, MAX(event) OVER
(
    ORDER BY datetime ASC
    ROWS BETWEEN CURRENT ROW AND 3 FOLLOWING
) as target
FROM df
"""
)

solution.head(10)
```

We ordered the rows using `datetime` column in ascending order and filled the window rows with the MAX value. This is the data frame we get with the target column:

![solution](https://dev-to-uploads.s3.amazonaws.com/i/6hl38232yn50j1obk9ns.png)

We labeled the previous 3 rows before 11am in the `target` column.