teleren/devto huggingface dataset:
Synonym Of Oracle - Get Access To DB From Another Schema Easily
Tags: oracle, plsql, database, synonym
Published: 2022-07-13 01:37:25

A great example of a use case of synonym in Oracle PLSQL.

## Introduction

Suppose you have dedicated DB at one schema for example _stores_ and on the other hand, you have a different schema of _employees_ and some procedures are made which insert into a table from the _employees_ schema but with some reference of _store_ schema. Then we can use synonyms for accessing tables, packages, procedures, functions and more from another schema with some grants to perform specific actions like execute, insert, delete, and more.

> Note: You cannot directly access a procedure or function inside a package. Also, you have different grants for packages/procedures/functions and tables.

As I said, we have one schema _Store_ , we created a procedure _add_job_history_ to insert some records in table _job_history_ like below:

```
create or replace NONEDITIONABLE PROCEDURE add_job_history  
  (  p_emp_id          job_history.employee_id%type  
   , p_start_date      job_history.start_date%type  
   , p_end_date        job_history.end_date%type  
   , p_job_id          job_history.job_id%type  
   , p_department_id   job_history.department_id%type   
   )  
IS  
BEGIN  
  INSERT INTO job_history (employee_id, start_date, end_date,   
                           job_id, department_id)  
    VALUES(p_emp_id, p_start_date, p_end_date, p_job_id, p_department_id);  
END add_job_history;
```
Now we have to create another schema _employees_ (if you don’t have one)

```
create user employees identified by employees;
```

Grant to create synonym to schema _employees_ :

```
grant create synonym to employees;
```

> Note: We can grant different grants to the schema as we wish according to the protocol. Please see Oracle documentation.

Verify if we created a different schema using the below command:

```
select username, account_status from dba_users;
```

Giving another grant to execute the procedure to schema _employees_ :

```
grant execute on add_job_history to employees;
```


If you still face any issues with privileges, then login to **SQLPLUS** with any user then:

```
Connect sys/password as sysdba
grant execute on add_job_history to employees;
```

In the _Employees_ schema, run the below commands:

How to create a _synonym_ to access the _store_ procedure _add_job_history_

```
create synonym ajh_syn
for store.add_job_history;
```

Now you can create a _PLSQL_ program to execute the procedure with ease.

What I learned from multiple websites, I am putting everything here to make it easier for others to work. Please let me know if you have any doubts, I will try my best to give some resolution steps.
Metis Linux ~ A turbo fast artix based linux
Tags: linux, programming, productivity, opensource
Published: 2022-07-13 00:59:24

Hey Linux Folks,

After a year of incubation and struggle, the first version of Metis Linux 0.1 has been launched with less bloatware and just the things you need.

[Metis Linux](https://webmatrices.com/d/1299-metis-linux-a-turbo-fast-artix-based-linux) is an artix-based super fast, lightweight,simple and flexible distribution that uses runs it as an init system [ simply no systemD ] & super tiny scripts to install & manage the whole operating system. We always focus on user freedom and if anything can be simple, let's simplify it.


![Image description](https://webmatrices.com/assets/files/2022-07-12/1657644337-606284-image.png)

Our implementations are written from shell and C/C++. Metis Linux is POSIX compatible, which means our project can be easily portable to any other operating system.

Metis Linux aims at providing a stunning experience to new Tiling Window Manager users, it provides an easy gateway to the tiling window manager world with sane configs and keybinds that are easy and memorable.

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rsazfefdckcirxr2bgzq.png)](https://blog.webmatrices.com/web-stories/linux-distro-is-out-matis-linux/)
 

The Metis Linux team wishes to make tiling window managers less intimidating by providing a polished experience out of the box.

More information can be found on the website "[https://metislinux.org](https://metislinux.org)", feel free to give it a go, and **ask** your **queries [here](https://webmatrices.com/d/1299-metis-linux-a-turbo-fast-artix-based-linux)**.
Const, Let or Var which should you use??
Tags: beginners, javascript, webdev
Published: 2022-07-13 00:57:40

When starting to learn JavaScript, one of the first things we learn is the how to declare variables. Choosing between `var`, `let` and `const` can be the start of frustration when you are beginning to learn JavaScript for the first time. 
The first thing you learn is that `var` can be redeclare and undated and you will not get any errors.

```
var name = "Remy";
var name = "Danny";
```
Now the problem with using `var` is after writing hundreds of lines of code, you reuse the same variable name you will not get an error but it will lead to bugs in your code. 

This is where `let` comes in it fixes the problems with using  `var`. Variables declared with `let` can be updated just like `var` but they can not be re-declared.

```
let name = "Remy";
let name = "Kathy"; // Identifier 'name' has already been declared
```
It is also good to remember that you can declare the same variable if they are in different scopes. This means you can re-declare the variable inside a function or anywhere that is surrounded by `{}`.

The other option we have to declare variables is `const` they maintain their constant value. `const` unlike `var` and `let` can not be re-declared or updated with in its scope, and we are unable to have this problem.

```
const name = "Kathy";
const name = "Danny"; // Identifier 'name' has already been declared
```
In the small amount of time I have been writing and learning JavaScripts, this was one of the things I always had to keep in mind when declaring variables. Always keeping in mind which one will be the right one for the job.
Code Smell 148 - ToDos
Tags: javascript, webdev, beginners, programming
Published: 2022-07-13 00:45:25

*We buy debt for our future selves. It is payback time*

> TL;DR: Don't leave TODOs in your code. Fix them!

# Problems

- Technical Debt

- Readability

- Lack of Confidence

# Solutions

1. Fix your TODOs

# Context

We encounter TODOs in our code. We count them.

We seldom address it.

We started owing the technical debt.

Then we pay the debt + the interest.

A few months after, we pay more interest than the original debt.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/76fb2f5fada656e6dd5be6989351e91c)
```java
public class Door
{ 
    private Boolean isOpened;
    
    public Door(boolean isOpened)
    {       
        this.isOpened = isOpened;
    }      
    
    public void openDoor()
    {
        this.isOpened = true;
    }
    
    public void closeDoor()
    {
        // TODO: Implement close door and cover it
    }      
    
}
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/2d1fcb683f9c9c0391c7c369baf54bff)
```java
public class Door
{
 
    private Boolean isOpened;
    
    public Door(boolean isOpened)
    {       
        this.isOpened = isOpened;
    }      
    
    public void openDoor()
    {
        this.isOpened = true;
    }
    
    public void closeDoor()
    {
        this.isOpened = false;
    }      
    
}
```

# Detection

[X] Automatic 

We can count TODOs.

# Tags

- Technical Debt

# Conclusion

We can count TODOs.

Most linters do it.

We need the policy to reduce it.

If we are using TDD, we write the missing code right away.

In this context, TODOs are only valid when doing Depth First development to remember open paths to visit.

# More Info

- [Should you put ToDos?](https://www.osedea.com/en/blog/should-you-put-todos-in-the-source-code)

- [Broken Windows Theory](https://en.wikipedia.org/wiki/Broken_windows_theory)

# Credits

Photo by [Eden Constantino](https://unsplash.com/@edenconstantin0) on [Unsplash](https://unsplash.com/s/photos/todo)
  
* * *

> After you finish the first 90% of a project, you have to finish the other 90%.

_Michael Abrash_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
Data Structures: Stacks and Queues
Tags: javascript, webdev, programming, beginners
Published: 2022-07-13 00:33:00

Stacks and Queues are common data structures you may be questioned on during a job interview. Let's take a look at what Stack and Queues are from a high level.

## Stack
A stack is a linear data structure that operates in a LIFO (Last In First Out) order. Think of a stack of plates. Each plate is stacked on top of an existing one, and the last plate stacked is the first one removed. Stack data structures operate the same way. Data is added to the end of the structure, and when acted upon is removed from the end of that same structure.

## Queue
A queue is a linear data structure that operates in a FIFO (First In First Out) order. A common metaphor for a queue is a check out line at the store. Whoever is at the front of the line gets to check out first. A queue data structure operates in a similar fashion, data is added to the end of the stack and removed and acted upon from the front.

## Implementations
Let's create some simple implementations of these data structures using JavaScript arrays and array methods.

### Stack
We can create a simple stack class using a JavaScript array and the built in array methods push and pop. Push adds a new value to the end of the array. Pop removes and returns the last value in the array. This allows our data structure to operate in LIFO order.

```javascript
class Stack {
    constructor() {
        this.stack = []
    }

    push(value) {
        this.stack.push(value)
    }

    pop() {
        return this.stack.pop()
    }
}

const stack = new Stack()

stack.push('a') // -> stack: [ 'a' ] 
stack.push('b') // -> stack: [ 'a', 'b' ]
stack.push('c') // -> stack: [ 'a', 'b', 'c' ]

stack.pop() // -> returns 'c', stack: [ 'a', 'b' ]
```

### Queue
We can create a simple queue class using a JavaScript array and the built in array methods push and shift. Push adds a new value to the end of the array. Shift removes and returns the first value in the array. This allows our data structure to operate in FIFO order.

```javascript
class Queue {
    constructor() {
        this.stack = []
    }

    push(value) {
        this.stack.push(value)
    }

    shift() {
        return this.stack.shift()
    }
}

const queue = new Queue()

queue.push('a') // -> queue: [ 'a' ] 
queue.push('b') // -> queue: [ 'a', 'b' ]
queue.push('c') // -> queue: [ 'a', 'b', 'c' ]

queue.shift() // -> returns 'a', queue: [ 'b', 'c' ]
```

## Summary
Stacks and Queues are both linear data structures, stacks however operate in LIFO order while Queues operate in FIFO order. The different removal order of these structures allows them to be useful in different ways.
React router having an issue with correctly routing to component
Tags: react, javascript, webdev
Published: 2022-07-13 00:29:29

My program is supposed to route to a component when going to the local path `/experience/:id` but it is only working on `localhost` when ran with `npm start`. 

I currently have my site uploaded to `/test` subdirectory ([willfeldman.com/test](https://willfeldman.com/test)). I set `basename="test"` on the Router. When I go to the route `/test/experience/1` after uploading the code to my site, I see a blank page and there is a console error saying `Uncaught SyntaxError: Unexpected token '<' (at main.694b5be9.js:1:1)`.

![How it looks on localhost](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5gcmrk6fx234ur6gm3uc.png)

![How it looks on site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eq3fxr1b4hot8l0ah4pv.png)

A couple of things (not sure what will be relevant to fixing the blank page ): 
- I converted my `App.jsx` file to a Typescript file named `App.tsx`

- I’m using Hostgator to host my site

- I am using `useParams` from react router in my `<ExperienceView />` component that I route to from `/test/experience/1`

- I have an .htaccess in the `public` folder that contains the following code as suggested on the [Create React App documentation](https://create-react-app.dev/docs/deployment/#serving-apps-with-client-side-routing). It works for rerouting invalid URLs to my React error component `<Error />` as specified in my Router, but it does not work for the route `/test/experience/1`
```
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
```

- I had the same issue when running the static files from `build` with `npx lite-server` and the way I fixed it was by uploading a folder called `build/test/experience` that contained `index.html`, `manifest.json`, and the `static` folder. This makes me think it may be something with a setting on the router that needs to be configured, but I am not sure. 

- Source code: [https://github.com/willfeldman/Portfolio](https://github.com/willfeldman/Portfolio) -> uploaded to [https://willfeldman.com/test](https://willfeldman.com/test)
DALL-E nedir? DALL-E: Metinden görüntü oluşturma
Tags: computerscience, programming, python, tutorial
Published: 2022-07-13 00:02:40

Dilde ifade edilebilen çeşitli kavramlar için başlıklarından görüntüler oluşturan DALL·E adlı bir sinir ağı. Yani Yapay zekâ alanının içerisinde bir derin öğrenme ürünüdür.

DALL·E, metin-görüntü çiftlerinden oluşan bir veri kümesi kullanarak metin açıklamalarından görüntüler oluşturmak üzere eğitilmiş, GPT-3'ün 12 milyar parametreli bir sürümüdür. [GPT-3, insanların yazdığı metinlere benzer içerik üretmek için derin öğrenmeyi kullanan özbağlanımlı dil modelidir.]

Teknik bilgiyi bir kenarı bırakırsak milyarlarca veri üzerinde eğitilmiş bir yapay zekadır. Bu yapay zekanın görevi girdiğimiz kelimelere göre bize görsel oluşturmasıdır. Aklınıza gelebilecek her şeyin görüntülerini üretebilir.

Daha fazla nesne tanıtıldıkça, DALL·E nesneler ve renkleri arasındaki ilişkileri karıştırmaya eğilimlidir ve başarı oranı keskin bir şekilde düşer. Yani her eklediğiniz kelime yapay zekanın dahada zorlanmasına yol açacaktır.

Dall-E sayesinde daha önce hiç oluşturulmamış tasarımlar oluşturmanız mümkün. Hayal gücünü aşan görseller ortaya çıkarabilir.

Bir örnek verirsek;

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zf40ez0g4lwv5mr2cczv.png)
#JulyOT 13: Ask Me Anything at Reactor: Azure IoT!
Tags: julyot, iot, ama, beginners
Published: 2022-07-13 00:07:17

---
title: #JulyOT 13: Ask Me Anything at Reactor: Azure IoT!
published: true
date: 2022-07-13 00:00:00 UTC
tags: julyot,iot,ama,beginner
canonical_url: https://JulyOT.dev/blog/13-iot-ama
series: JulyOT 2022
cover_image: https://JulyOT.dev/assets/images/JulyOT-banner-13-ama-reactor-a0542a7b25f306b90a4d181d324c0d55.png
---

_Get your IoT questions answered by experts._

## Ask Me Anything at Reactor: Azure IoT[​](#ask-me-anything-at-reactor-azure-iot "Direct link to heading")

This session is part of a series of Ask Me Anything at Reactor sessions that are giving us a platform to share stories, listen, ask respectful questions, and continue on our journey to improve and collaborate with User Groups and Online Communities.

Join us as we welcome our speakers Bruno Capuano and Maria-Anastasia Moustaka to the Ask Me Anything stage. They will be sharing their knowledge on Azure IoT and a variety of other topics.

This event was live at 9am on Thursday July 14th, so catch the recording here!

{% youtube __Ky0TmZfak %}
Lista de Exercícios 07 - Funções #17
Tags: beginners, programming, python, tutorial
Published: 2022-07-12 23:19:53

Q1. Implemente a função **_collatz( )_**:
* se o número for par, ela retorna a divisão inteira deste número por 2.
* se o número for ímpar, ela retorna (3 * número + 1).

Faça um programa que leia do teclado um número e imprima o retorno da função **_collatz()_**

Q2. Modifique o programa anterior, e recursivamente execute a função **_collatz( )_** até o valor de retorno da função seja igual a 1. 

Por exemplo, se o usuário digita 3, teremos que imprimir na tela os valores: **_3 → 10 → 5 → 16 → 8 → 4 → 2 → 1_**.

Fique livre de imprimir os valores da forma que achar mais fácil.

Q3. Escreva uma função que receba como parâmetro uma lista e retorne uma **_string_** com os elementos da lista separados por vírgula, com exceção do último que deve conter a palavra “e”.

Por exemplo, se a lista for [“banana”, “uva”, “abacaxi”], o método deve retornar a **_string_** “banana, uva e abacaxi”.

Q4. Implemente uma função que simule o lançamento de uma moeda, usando o módulo **_random_**. Este método receberá como parâmetro a quantidade de lançamentos.

A função imprimirá a quantidade de “caras” e “coroas” gerados.

Por exemplo, se o parâmetro for 5, o programa poderá imprimir: “5 coroas 0 caras” ou “3 coroas 2 caras” ou “1 coroas 4 caras”, entre outras possibilidades.

Q5. Escreva uma função chamada **_cidade_pais()_** que recebe como parâmetro o nome de uma cidade e de seu país. A função deve retornar uma **_string_** formatada como “Santiago, Chile”.

Q6. Implemente uma lista contendo um conjunto de mensagens de texto. Passe esta lista como parâmetro para uma função responsável por imprimir as mensagens em linhas diferentes.

Q7. Um número é **_capicua_** quando lido da esquerda para a direita ou da direita para a esquerda. O ano 2002 é um ano capicua. Elabore uma função que verifique essa característica.

Q8. Criar uma função que receba uma mensagem e dois caracteres e substitua todas as ocorrências do 1o. caractere pelo 2o. caractere.

Exemplo:
```
digite mensagem:
SE NAO APRENDI TODOS OS EXERCICIOS DE UM CAPITULO, NAO DEVO PASSAR PARA O OUTRO
digite 1a. letra E
digite 2a. letra K
SK NAO APRKNDI TODOS OS KXKRCICIOS DK UM CAPITULO, NAO DKVO PASSAR PARA O OUTRO
```

Q9. Criar uma função que receba um vetor de inteiros e retorne True se o vetor estiver ordenado ou False se não estiver.
Lista de Exercícios 05 - Dicionários #13
Tags: beginners, programming, python, tutorial
Published: 2022-07-12 23:03:43

Q1. Solicite os seguintes campos de um usuário: **_nome, idade, sexo, altura_**. Armazene em um mapa e depois imprima as informações fornecidas na tela.

Q2. Crie um dicionário com os 3 maiores rios do mundo e seus países. Por exemplo _“nile”: “egito”_.
* imprima cada chave, valor como: “O Nilo corta o Egito”;
* imprima cada rio em um laço **_for_**;
* imprima cada país do dicionário em um laço **_for_**.

Q3. Utilizando dicionários e listas, modele um programa que armazena o nome de uma pessoa e para cada pessoa as 3 comidas preferidas. Armazene pelo menos a informação de 3 pessoas com suas comidas preferidas e ao final imprima uma mensagem com o nome da pessoa e suas comidas preferidas.

Q4. Crie um dicionario de dicionarios representando um conjunto de cidades. A chave do dicionario principal será o nome da cidade, e o valor de cada chave será um dicionário com pelo menos 3 informações sobre a cidade, como país, população, nome. Imprima as informações de cada cidade na tela, pense na forma como você vai apresentar a informação para o usuário.

Q5. Criar um algoritmo que informe a quantidade total de calorias de uma refeição a partir da escolha do usuário 'que deverá informar o prato, a sobremesa e bebida (veja a tabela a seguir).
<table> 
  <tr>
   <td>Prato</td>
   <td>Sobremesa</td>
   <td>Bebida</td>
  </tr>
  <tr>
   <td>Vegetariano 180 cal</td>
   <td>Abacaxi 75 cal</td>
   <td>Chá 20 cal</td>
  </tr>
  <tr>
   <td>Peixe 230 cal</td>
   <td>Sorvete diet 110 cal</td>
   <td>Suco de laranja 70 cal</td>
  </tr>
  <tr>
   <td>Frango 250 cal</td>
   <td>Mousse diet 170 cal</td>
   <td>Suco de melão 100 cal</td>
  </tr>
  <tr>
   <td>Carne 350 cal</td>
   <td>Mousse de chocolate 200 cal</td>
   <td>Refrigerante diet 65 cal</td>
  </tr>
</table>
Day 591 : Let It Grow
Tags: hiphop, code, coding, lifelongdev
Published: 2022-07-12 22:45:26

_liner notes_:
- Professional : Got a few tickets done. Got some others in review. Knocking them out one by one. Pretty productive day. I did re-record some audio for a couple of videos.

- Personal : Worked a little on my side project and did some research and bought a new Helium miner. This is my third one. Figured I will set them up, gain some money and let it grow from there. Then ended the night by watching the final episode of "The Boys" for this season.

![A stone hut on top of a mountain in Tungnath, India with mountains extending in the distance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fu7xd1re9bohu1i446cp.jpg)

I'll probably start going through tracks for this week's radio show. Probably mess with my side project some more as well. There's some stuff I'm still trying to figure out with the layout before I start building out the project. I'm out!

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube J430p0NDcgw %}
Tuplas em Python - #11
Tags: beginners, tutorial, python, programming
Published: 2022-07-12 22:25:51

{% youtube https://youtu.be/HDaLd9RVJio %}

## Introdução

Tuplas são listas que não podem ser modificadas, ao invés de utilizarem colchetes, elas utilizam parênteses em sua sintaxe. Uma estrutura que não pode ser modificada é denominada como **_imutável_**.

Neste capítulo iremos aprender as principais operações que podemos usar com **_tuplas_**.

## Sintaxe

Uma tupla é criada de forma semelhante a uma lista, mas com o uso de parênteses.

```python
#Sintaxe - criando tuplas
>>> tupla_cores = ("verde", "preto", "branco")
>>> print(tupla_cores)
('verde', 'preto', 'branco')

>>> tupla_frutas = ["coco", "banana", "uva", "morango"]
>>> print(tupla_frutas)
('coco', 'banana', 'uva', 'morango')
```

## Convertendo tuplas e listas

Semelhante às funções **_int(), float(), str()_**, se quisermos converter uma tupla em uma lista ou uma lista em uma tupla, usamos as funções **_list()_** e **_tuple()_**.
```python
#Convertendo uma tupla em lista e vice versa
>>> tupla_cores = ("verde", "preto", "branco")

>>> lista_cores = list(tupla_cores)
>>> lista_cores
['verde', 'preto', 'branco']

>>> lista_cores.append("amarelo")

>>> tupla_cores = tuple(lista_cores)
>>> tupla_cores
('verde', 'preto', 'branco', 'amarelo')
```

## Método **_partition( )_**

O método **_partition( )_** é aplicado à uma _string_ e retorna uma **_tupla_** com três valores: **_prefixo, separador, sufixo_**. A tupla de retorno sempre possui o tamanho fixo de três posições, mesmo que existam múltiplas ocorrências do separador. 

Se o separador não for encontrado na **_string_**, o valor **_prefixo_** da tupla será a própria **_string_** e os campos **_separador_** e **_sufixo_** estarão vazios.

Experimente os exemplos no seu **_shell_**.
```python
#Experimente os exemplos no seu shell.
Método partition()
>>> "banana, melao, uva".partition(",")
('banana', ',', ' melao, uva')

>>> prefixo, separador, sufixo = "banana, melao, uva".partition(",")
>>> prefixo
'banana'
>>> separador
','
>>> sufixo
' melao, uva'

>>> "Estou aprendendo Python".partition(",")
('Estou aprendendo Python', '', '')
```

Observe que no exemplo anterior aplicamos a atribuição múltipla na leitura dos elementos da tupla: `prefixo, separador, sufixo = "banana, melao, uva".partition(",").`

## Erros comuns

Tuplas são somente leitura, você não pode alterar seus valores e nem adicionar elementos depois que são criadas.

```python
#Tuplas não podem ser modificadas
>>> tupla_cores = ("verde", "preto", "branco")
>>> tupla_cores[0] = "azul"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
```