Category: Blog

  • notas-estudos

    Notas de estudo

    moça estudando no pc caderno de notas chapéu graduação


    Autômatos Finitos

    robô

    1. O que é um autômato

    2. Definição formal de um autômato finito

    3. Linguagem regular

    4. Projetando autômatos finitos


    Bases numéricas

    código binário ábaco

    1. Decimal

    2. Binário

    3. Octal

    4. Hexadecimal


    Git e GitHub

    git logo gitHub Logo

    1. Instalando, configurando e inicializando o Git no Linux

    2. Instalando, configurando e inicializando o Git no Windows

    3. git add: Adicionando arquivos no Git

    4. git rm/reset: Removendo arquivos do index

    5. git commit: Enviando arquivos para o repositório Git

    6. git commit –amend: Corrigindo o último commit

    7. Ignorando arquivos no Git

    8. git commit -am: Atualizando um arquivo modificado no Git

    9. git diff: Verificando modificações no repositório

    10. Visualizando o commit no modo gráfico

    11. git rm: Deletando arquivo do repositório

    12. git tag: Etiquetas

    13. git branch: O que são branches (ramos)

    14. git mv: Renomeando ou movendo arquivos

    15. Visualizando grafo de commits

    16. git checkout: Desfazendo commits

    17. git reset: Desfazendo commits

    18. git revert: Desfazendo commits

    19. Usando GitHub

    20. git fetch: Verificando commits remotos

    21. git pull: Puxando commits remotos

    22. Acesso ao Github com SSH

    23. Reconfigurando diretório HTTPS para SSH

    24. git clone: Copiando um repositório existente

    25. fork: Como colaborar com projetos de código aberto

    26. git log: Ver o histórico de commits do git


    Grafos

    grafo

    1. O que é um grafo?

    2. Representação matemática de grafos

    3. Tipos de grafo: grafo simples

    4. Tipos de grafo: pseudografo

    5. Tipos de grafo: multigrafo

    6. Tipos de grafo: grafo reflexivo

    7. Tipos de grafo: grafo vazio

    8. Tipos de grafo: grafo trivial

    9. Tipos de grafo: grafo nulo

    10. Tipos de grafo: grafo rotulado

    11. Grau de vértice (nó)


    Linux

    pc com linux linux mint pinguim

    1. Terminal: Instalando programas

    2. Terminal: Desinstalando programas no Linux

    3. Terminal: Limpando a tela

    4. Terminal: Listando arquivos e diretórios no Linux

    5. Terminal: Navegando nos diretórios Linux

    6. Terminal: Atualizando o sistema

    7. Terminal: Removendo programas obsoletos

    8. Terminal: Limpando ao cache do APT

    9. Terminal: Corrigindo pacotes quebrados

    10. Terminal: Criando diretório no Linux

    11. Terminal: Removendo arquivos e diretórios no Linux

    12. Terminal: O comando cat

    13. Terminal: Comando touch

    14. Terminal: Verificar informações da CPU

    15. Terminal: Verificar uso de espaço em disco

    16. Terminal: Desligando o computador

    17. Terminal: Histórico de comandos

    18. Instalando o Python 3.8 e o IDLE no Linux

    19. Terminal: Buscando arquivo/diretórios no Linux

    20. Instalando o VS Code pelo terminal

    21. Terminal: copiando arquivos e diretórios

    22. Terminal: Informações sobre o usuário

    23. Terminal: movendo/renomeando arquivos e diretórios

    24. Terminal: Verificando informações do sistema

    25. Terminal: Verificando há quanto tempo o sistema está ligado

    26. Terminal: Adicionando usuário

    27. Terminal: Excluindo usuário

    28. Terminal: Mostrando o início ou fim de um arquivo texto

    29. Terminal: Gerenciando grupos

    30. Terminal: Contando palavras em um arquivo

    31. Terminal: Visualizando processos

    32. Terminal: O sistema de permissões no Linux

    33. Terminal: Entendendo o sudo e o root

    34. Instalando o Node.JS e o Node Version Manager (NVM) no Linux (Ubuntu e derivados)

    35. Instalação e configuração LAMP (Linux, Apache, MariaDB e PHP) no Linux (Ubuntu e derivados)

    36. Instalação do Joomla-3.x

    37. Terminal: alterando permissões – Modo numérico

    38. Terminal: alterando permissões – Modo simbólico


    Lógica

    and not or

    1. Operadores lógicos e tabela verdade

    2. Tabela verdade: condicional

    3. Tabela verdade: bicondicional

    4. Tabela verdade: disjunção exclusiva


    VS Code

    1. Erro ao usar a extensão Python Preview do VSCode

    Windows

    laptop windows os

    1. O Windows não pode ser instalado em partições GPT
    Visit original content creator repository https://github.com/danielle8farias-zz/notas-estudos
  • pxmake

    pxmake

    xmake implement on python focuses on reuse python’s library and API compatibility

    Intro

    xmake is a make-like build utility based on Lua. Its low-level API (xmake machine) is implemented in C with library tbox

    This repo, pxmake, is the reimplement of xmake machine on Python. Notice that the main part is still written in Lua and is same as xmake

    pxmake created because to extend API for xmake in C is a little matter. pxmake focuses on reuse python’s library and API compatibility with xmake

    Install

    $ python3 setup.py install

    Common install problems

    Generic build steps could be found at .travis.yml & .appveyor.yml

    Python version

    Not support python2. At least python 3.3 with setuptools (pip) is required but newest version is recommanded especially on Windows

    lupa build fails

    See lupa/INSTALL.rst#building-with-luajit2

    Run fails

    • Do not install from wheel or sdist. Directly install or install from egg. This is because the path of installed data_files is vary in other ways
    • lupa must bind with luajit, not lua. It’s not matter whether JIT is enabled (no big diff on speed) but it must be luajit

    Visit original content creator repository
    https://github.com/xmake-io/pxmake

  • oyna

    Oyna 💃🏻🕺🏻💃🏿🕺🏿💃🕺

    Welcome to the Oyna repository! 🎮

    This repository is dedicated to showcasing a collection of simple and fun computer games, all implemented in Python. The main goal of Oyna is to provide a platform where anyone, can explore Python programming through engaging and interactive games. By studying and interacting with these games, you can learn important programming concepts, algorithms, and the Python language in an enjoyable and hands-on way.

    Whether you’re just starting with Python or looking to improve your coding skills, the Oyna repository is a great resource to help you learn while having fun.

    What You’ll Find Here

    This repository contains various games that highlight different aspects of Python programming. Each game is designed to be simple yet effective, and they are all easy to understand and modify.

    Sudoku
    Sudoku
    2048
    2048
    Matching
    Matching
    Minesweeper
    Minesweeper
    Find Difference
    Find Difference
    Maze
    Maze
    Chimp
    Chimp
    Snake
    Snake
    Chutes and Ladders
    Chutes and Ladders
    Dino or Dinosaur Game
    Dino
    Bubble Shooter
    Bubble Shooter
    Flappy Bird
    Flappy Bird
    Falling Tower
    Falling Tower
    Shoot Colors
    Shoot Colors
    Reversi
    reversi
    SuperMario Pixel
    SuperMario Pixel
    Tetris
    Tetris
    Tik Tok Toe
    Tik Tok Toe
    Reverse Slide Puzzle
    Reverse Slide Puzzle
    Checkers
    Checkers
    UFO Explosion
    UFO Explosion

    Why Oyna?

    • Beginner-Friendly: Whether you’re new to Python or programming in general, these games are designed to be easy to follow.
    • Learn by Doing: The best way to learn programming is through practice, and Oyna offers you an opportunity to get hands-on experience by working with real code.
    • Fun and Engaging: Who said learning can’t be fun? These games are built to keep you engaged and motivated while learning Python.

    How to Use

    1. Clone this repository to your local machine using:
      git clone https://github.com/kamyarmg/oyna.git
      OR Install it using pip
      pip install oyna
    2. Navigate to the game directory you want to explore.
    3. Run the game using Python
    4. Enjoy and start learning!

    To add or refactor a game or any other feature, please read the CONTRIBUTING.md file first. After that, you can create a new game or make changes and submit a pull request.

    Visit original content creator repository https://github.com/kamyarmg/oyna
  • clone-github-repo-action

    Clone Github Repository Action

    Public workflows that use this action. Clone Public Repository Workflow Clone Private Repository Workflow

    Title

    Github Action to clone a public or private Github repository and access its content on others repositories’ workflows.

    What changed with the action v2 ?

    This action v2 is using a composite action to be compatible with all operating systems (the v1 was using a Dockerfile that was only compatible with ubuntu-* runners).

    What changed with the action v2.1 ?

    You now have a new input parameter called depth, which is optional and has an empty default value. If you specify a depth value when using the action, it will be passed as the value for the –depth parameter of the git clone command. Otherwise, the clone will be done with the default depth, which is the full history.

    What changed with the action v2.2 ?

    You now have a new input parameter called branch, which is optional and uses main as default value. If you specify a branch value when using the action, it will be passed as the value for the –branch parameter of the git clone command.

    What changed with the action v2.3 ?

    You now have a new input parameter called submodule, which is optional and uses false as default value. If you specify the submodule value when using the action as true, it will clone the submodule along with the repository.

    How to use this action?

    Create a new .yml file on your .github/workflows directory.

    Field Mandatory Observation
    owner YES Ex: octocat
    repository YES Ex: clone-github-repo-action
    branch NO Ex: main (default)
    depth NO 1 Ex: most recent commit
    submodule NO false or true
    access-token NO How to create a PAT

    You can use one of those as reference:

    For a public repository (with depth)

    - name: Clone GuillaumeFalourd/poc-github-actions PUBLIC repository
      uses: GuillaumeFalourd/clone-github-repo-action@v2.3
      with:
        depth: 1
        branch: 'main'
        owner: 'GuillaumeFalourd'
        repository: 'poc-github-actions'

    For a private repository

    To use this action to clone a PRIVATE repository the Github User/Admin has access to, it’s necessary to create a PERSONAL ACCESS TOKEN with REPOSITORY scopes.

    - name: Clone GuillaumeFalourd/formulas-training PRIVATE repository
      uses: GuillaumeFalourd/clone-github-repo-action@v2.3
      with:
        owner: 'GuillaumeFalourd'
        repository: 'formulas-training'
        access-token: ${{ secrets.ACCESS_TOKEN }}

    Access repository content

    After using this action in your workflow, you can use the following command to access the cloned repository content:

    cd <repository-name>

    Step Example

    - name: Access cloned repository content
      run: |
        cd <repository-name>
        ls -la

    Licensed

    ☞ This repository uses the Apache License 2.0

    Contributing

    Guidelines

    (Made with contributors-img)

    Visit original content creator repository https://github.com/GuillaumeFalourd/clone-github-repo-action
  • rustypipe

    rustypipe

    Write raw queries to your steampipe DB with a HTTP API interface

    USAGE:

    export the required env vars

    export DB_HOST='localhost'
    export DB_USER='steampipe'
    export DB_PORT='9193'
    export DB_PASSWORD='000hSt34my'
    
    cargo run
    

    make plaintext requests in raw SQL

    curl -v -d "select instance_id,monitoring_state,tags from aws_ec2_instance" http://localhost:3000/raw
    

    Features:

    Implemented:

    • Run a raw SQL query through curl and get the output back as JSON including.
    • Deserialize JSONB (postgres) to native JSON output (web-api)

    Serialization:
    /// | Rust type                         | Postgres type(s)                              |
    /// |-----------------------------------|-----------------------------------------------|
    /// | `bool`                            | BOOL                                          | -> Bool
    /// | `i8`                              | "char"                                        | -> Str
    /// | `i16`                             | SMALLINT, SMALLSERIAL                         | -> Int
    /// | `i32`                             | INT, SERIAL                                   | -> Int
    /// | `u32`                             | OID                                           | -> Int
    /// | `i64`                             | BIGINT, BIGSERIAL                             | -> Int
    /// | `f32`                             | REAL                                          | -> Dec
    /// | `f64`                             | DOUBLE PRECISION                              | -> Dec
    /// | `&str`/`String`                   | VARCHAR, CHAR(n), TEXT, CITEXT, NAME, UNKNOWN | -> Str
    /// |                                   | LTREE, LQUERY, LTXTQUERY                      | -> Str
    /// | `&[u8]`/`Vec<u8>`                 | BYTEA                                         | -> Str
    /// | `HashMap<String, Option<String>>` | HSTORE                                        | -> JSON
    /// | `SystemTime`                      | TIMESTAMP, TIMESTAMP WITH TIME ZONE           | -> Str
    /// | `IpAddr`                          | INET                                          | -> str
    
    
    /// | Rust type                       | Postgres type(s)                    |
    /// |---------------------------------|-------------------------------------|
    /// | `chrono::NaiveDateTime`         | TIMESTAMP                           | -> Str?
    /// | `chrono::DateTime<Utc>`         | TIMESTAMP WITH TIME ZONE            | -> Str?
    /// | `chrono::DateTime<Local>`       | TIMESTAMP WITH TIME ZONE            | -> Str?
    /// | `chrono::DateTime<FixedOffset>` | TIMESTAMP WITH TIME ZONE            | -> Str?
    /// | `chrono::NaiveDate`             | DATE                                | -> Str?
    /// | `chrono::NaiveTime`             | TIME                                | -> Str?
    /// | `time::PrimitiveDateTime`       | TIMESTAMP                           | -> Str?
    /// | `time::OffsetDateTime`          | TIMESTAMP WITH TIME ZONE            | -> Str?
    /// | `time::Date`                    | DATE                                | -> Str?
    /// | `time::Time`                    | TIME                                | -> Str?
    /// | `eui48::MacAddress`             | MACADDR                             | -> Str
    /// | `geo_types::Point<f64>`         | POINT                               | -> Supported?
    /// | `geo_types::Rect<f64>`          | BOX                                 | -> Supported?
    /// | `geo_types::LineString<f64>`    | PATH                                | -> Supported?
    /// | `serde_json::Value`             | JSON, JSONB                         | -> Deserialized json
    /// | `uuid::Uuid`                    | UUID                                | -> Str
    /// | `bit_vec::BitVec`               | BIT, VARBIT                         | -> Supported?
    /// | `eui48::MacAddress`             | MACADDR                             | -> Str
    /// | `cidr::InetCidr`                | CIDR                                | -> Str
    /// | `cidr::InetAddr`                | INET                                | -> Str
    /// | `smol_str::SmolStr`             | VARCHAR, CHAR(n), TEXT, CITEXT,     | -> Str
    /// |                                 | NAME, UNKNOWN, LTREE, LQUERY,       | -> Str
    /// |                                 | LTXTQUERY                           |
    

    Todo:

    • Front end query writer and table display
      • using leptos? a girl can dream
    • on disk cache for fast retrieval
      • add params ?cache=[‘save’,’use’]
      • hash the query and save the results to disk
      • if called with “use” , then the steampipe call will be skipped and it will be read from on-disk instead.

    Use case:

    Your devops infrastructure will never be perfectly procured and managed through an IAC tool, though that is always the goal – and even if it was you wouldn’t know until you audited it.
    My main use case for this tool is allowing other pieces of my automation to grab data from my infrastructure live without needing a node, which means sandboxed environments such as active choices will work.
    This is how I am able to get dynamically updating menu choices in jenkins that reflect the live infrastructure without needing to rebuild the job.

    Visit original content creator repository
    https://github.com/GeneMyslinsky/rustypipe

  • ZyXEL-NAS326

    I no longer recommend this guide

    This guide is now several years old, and no further progress has been made for a while. The issue with the stock firmwares for these devices is the manufacturer will eventually give up on the firmware updates, and then the kernel and services running on them will become outdated and potentially vulnerable.

    Judging by the fact OwnCloud installed officially on these boxes is already super old, this does not give confidence in future updates.

    Where do we go from here?

    I would like to see the NAS326 ported to OpenWRT, which a few other ZyXEL NASes are already. This may be something I start to work on in the future myself, and if I do, I will be sure to update this readme to point to it.

    The hardware of the NAS326 is well known and I believe well supported in the mainline kernel, and I think OpenWRT would be a good candidate for this box. This may seem like an odd choice, seeing as this NAS definitely isn’t wireless, let alone a router, but OpenWRT is very capable of running other services and can serve things over Ethernet perfectly fine, and it is also well maintained with automated builds and bugfixes, as well as providing a vast opkg repo for package management.

    Thank you

    Thank you for all the people who have starred and watched this repo! Keep watching, because I will keep you updated when I have more news!


    ZyXEL NAS326 Hacking and Modernisation

    Disclaimer: I am not responsible for any use or interaction with this guide. This guide is provided to be educational and additionally provide a useful end result which is a NAS326 by ZyXEL becoming more capable than ZyXEL currently supports it for.


    How this all started

    So I recently purchased a NAS326 from Amazon for around £100. This is a 2 bay NAS which appears to run an extremely cut down version of Arch Linux ARM, with an unlocked UBoot boot loader. The device seems very capable in itself, with an App Center for installation of new software provided officially by ZyXEL, however this software appears to be largely outdated. This is where I intend to focus – on the installation of modern software.

    Noob Alert: I am a noob. Although A lot of what I do will be correct and work fine, it may not be the best and most efficient way. If you want to correct me or provide a better way of doing something, please kindly open an issue. I have absolutely no problem with constructive criticism!


    The Alternative

    There is a way to put Debian on the ZyXEL NAS326. I have not yet had time to test this but I have seen a lot of activity on this forum and have also posted a little myself.

    Whenever people contact me about this I always back up the latest pages of this forum to the Wayback Machine

    https://forum.doozan.com/read.php?2,27108


    Sources of Information

    So I have had many sources of information during the process of working on this NAS. I will provide links (and sometimes direct page links) to as many sources of information as I can think of below:


    Goals

    All of the guides assume you are using ZyXEL’s V5.21(AAZF.3) firmware. In this firmware a few things are broken but the guides will explain how to fix them. If you need a copy of this firmware, please email me with the email at the bottom, as it is no longer available on the ZyXEL website. This repository has not yet been validated for firmware versions newer than V5.21(AAZF.3). The latest available firmware version at the time of writing this disclaimer is V5.21(AAZF.9) which is untested.

    Here are the goals I intend to achieve. I will mark them as completed as I make my way through them:

    • PHP7
      • Compile and run successfully – DONE
      • Persist across reboots – DONE (ffp install directory)
      • Get working with Apache
    • MySQL Latest
      • Compile and run successfully
      • Persist across reboots
      • Auto start on boot
    • Get a VirtualHost system working on Apache
      • Support HTTP Port 80
      • Support HTTPS Port 443
      • Support multiple subdomains
      • Support other ports
    • Get the latest OwnCloud working

    If all the external sources disappear

    I intend to keep a copy of all of the resources required to carry out the goals. I will write all of my guided information as if the original resources DO exist, and if they suddenly disappear you can either try to grab them on https://archive.org and please open an issue on this repository so I can rewrite parts of the guide so that they work with sources I can provide.

    New repo: http://zyxel.diskstation.eu/Users/Mijzelf/zypkg-repo/

    For web resources such as documentation and guides that already exist and I link to, I will try to make sure they are available on https://archive.org by manually starting a page crawl and save.


    Guides (ordered)

    • metarepo.md – MetaRepository, the App Center third-party repository tweak
    • ffp.md – FFP, the third-party software manager and installer
    • php7.md – PHP7, the latest PHP as of writing used for modern web apps on the NAS’ Apache server

    Additional Resources

    • img – Folder holding all images used in the MD files
    • portscan.md – The result of a port scan run against the NAS326

    Contact me!

    If there is an issue with this repository in ANY way, such as a broken link, broken instruction in the guide, missing resource or ANYTHING else, please open an issue on the repository.

    If you are interested in helping, please contact me via email at ahorner@programmer.net preferrably with some information on what you are capable of doing and I’ll see what I can give you as something I cannot do. Of course I will give credit where credit is due!

    Visit original content creator repository
    https://github.com/alexhorner/ZyXEL-NAS326

  • bezierMaker.js

    bezierMaker.js

    以中文查看

    Native HTML5 canvas can only support bezier curves up to third order.

    bezierMaker.js supports the formation of arbitrary order of bezier curves in theory. And provide a playground on which can add and move control points, and generate draw animation.

    Features

    • There can be arbitrary number of control points in playground.
    • The playground can show the display of the formation of curves.
    • Control points can be moved freely.
    • The playground can show the tangent of the formation of bezier curves.
    • The formations of the less than or equal to third order bezier curves are based on the native API.

    ScreenShots

    2017-12-28 17_21_52 2017-12-28 17_38_06

    playground website

    Usage

    preparation

    <script src="https://github.com/Aaaaaaaty/./bezierMaker.js"></script>
    

    Get Started

    /**
     * canvas canvas's dom object
     * bezierCtrlNodesArr control point's array
     * color curve's color
     */
    var canvas = document.getElementById('canvas')
    //The formations of the less than or equal to third order bezier curves are based on the native API. 
    var arr0 = [{x:70,y:25},{x:24,y:51}]
    var arr1 = [{x:233,y:225},{x:170,y:279},{x:240,y:51}]
    var arr2 = [{x:23,y:225},{x:70,y:79},{x:40,y:51},{x:300, y:44}]
    var arr3 = [{x:333,y:15},{x:70,y:79},{x:40,y:551},{x:170,y:279},{x:17,y:239}]
    var arr4 = [{x:53,y:85},{x:170,y:279},{x:240,y:551},{x:70,y:79},{x:40,y:551},{x:170,y:279}]
    var bezier0 = new BezierMaker(canvas, arr0, 'black')
    var bezier1 = new BezierMaker(canvas, arr1, 'red')
    var bezier2 = new BezierMaker(canvas, arr2, 'blue')
    var bezier3 = new BezierMaker(canvas, arr3, 'yellow')
    var bezier4 = new BezierMaker(canvas, arr4, 'green')
    bezier0.drawBezier()
    bezier1.drawBezier()
    bezier2.drawBezier()
    bezier3.drawBezier()
    bezier4.drawBezier()
    

    Effect

    image

    You can not know the exact position of the control point of the curve you want when drawing a complex higher order Bezier curve. When simulate in playground, we can get the coordinates of the control point in real time. Then we can make the coordinates into an array of objects and pass it into BezierMaker class to get the target curve.

    License

    Copyright (C) 2017 2103887953@qq.com
    
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    
    Visit original content creator repository https://github.com/Aaaaaaaty/bezierMaker.js
  • gcloud

    gcloud


    import “github.com/autom8ter/gcloud”

    Usage

    type GCP

    type GCP struct {
    	Options []option.ClientOption `validate:"required"`
    }

    GCP is the configuration used to return gcp clients and services. Use Init() to
    validate GCP before using it.

    func NewGCP

    func NewGCP(options ...option.ClientOption) *GCP

    func (*GCP) Blogger

    func (g *GCP) Blogger(ctx context.Context) (*blogger.Service, error)

    func (*GCP) Calendar

    func (g *GCP) Calendar(ctx context.Context) (*healthcare.Service, error)

    func (*GCP) ClassRoom

    func (g *GCP) ClassRoom(ctx context.Context) (*class.Service, error)

    func (*GCP) Container

    func (g *GCP) Container(ctx context.Context) (*container.Service, error)

    func (*GCP) Content

    func (g *GCP) Content(ctx context.Context) (*content.APIService, error)

    func (*GCP) CustomSearch

    func (g *GCP) CustomSearch(ctx context.Context) (*customsearch.Service, error)

    func (*GCP) DBAdmin

    func (g *GCP) DBAdmin(ctx context.Context) (*database.DatabaseAdminClient, error)

    func (*GCP) Docs

    func (g *GCP) Docs(ctx context.Context) (*docs.Service, error)

    func (*GCP) Domains

    func (g *GCP) Domains(ctx context.Context) (*plusdomains.Service, error)

    func (*GCP) Firestore

    func (g *GCP) Firestore(ctx context.Context, project string) (*firestore.Client, error)

    func (*GCP) HTTP

    func (g *GCP) HTTP(ctx context.Context, scopes []string) (*http.Client, error)

    func (*GCP) HealthCare

    func (g *GCP) HealthCare(ctx context.Context) (*healthcare.Service, error)

    func (*GCP) IAM

    func (g *GCP) IAM(ctx context.Context) (*iam.Service, error)

    func (*GCP) IOT

    func (g *GCP) IOT(ctx context.Context) (*iot.DeviceManagerClient, error)

    func (*GCP) ImageAnnotator

    func (g *GCP) ImageAnnotator(ctx context.Context) (*vision.ImageAnnotatorClient, error)

    func (*GCP) ImageProductSearch

    func (g *GCP) ImageProductSearch(ctx context.Context) (*vision.ProductSearchClient, error)

    func (*GCP) Init

    func (g *GCP) Init() error

    func (*GCP) Jobs

    func (g *GCP) Jobs(ctx context.Context) (*jobs.Service, error)

    func (*GCP) KMS

    func (g *GCP) KMS(ctx context.Context) (*kms.KeyManagementClient, error)

    func (*GCP) Kube

    func (g *GCP) Kube(inCluster bool) (*kubernetes.Clientset, error)

    func (*GCP) Language

    func (g *GCP) Language(ctx context.Context) (*language.Client, error)

    func (*GCP) OSLogin

    func (g *GCP) OSLogin(ctx context.Context) (*oslogin.Service, error)

    func (*GCP) People

    func (g *GCP) People(ctx context.Context) (*people.Service, error)

    func (*GCP) Photos

    func (g *GCP) Photos(cli *http.Client) (*photos.Service, error)

    func (*GCP) Prediction

    func (g *GCP) Prediction(cli *http.Client) (*prediction.Service, error)

    func (*GCP) PubSub

    func (g *GCP) PubSub(ctx context.Context, project string) (*pubsub.Client, error)

    func (*GCP) Redis

    func (g *GCP) Redis(ctx context.Context) (*redis.Service, error)

    func (*GCP) RuntimeGCP

    func (g *GCP) RuntimeGCP(ctx context.Context) (*run.Service, error)

    func (*GCP) Sheets

    func (g *GCP) Sheets(ctx context.Context) (*sheets.Service, error)

    func (*GCP) Slides

    func (g *GCP) Slides(ctx context.Context) (*slides.Service, error)

    func (*GCP) Spanner

    func (g *GCP) Spanner(ctx context.Context, database string) (*spanner.Client, error)

    func (*GCP) Speech

    func (g *GCP) Speech(ctx context.Context) (*speech.Client, error)

    func (*GCP) Storage

    func (g *GCP) Storage(ctx context.Context) (*storage.Client, error)

    func (*GCP) Tasks

    func (g *GCP) Tasks(ctx context.Context) (*tasks.Service, error)

    func (*GCP) Text2Speech

    func (g *GCP) Text2Speech(ctx context.Context) (*texttospeech.Client, error)

    func (*GCP) Translate

    func (g *GCP) Translate(ctx context.Context) (*translate.Client, error)

    func (*GCP) VideoIntelligence

    func (g *GCP) VideoIntelligence(ctx context.Context) (*videointelligence.Client, error)

    func (*GCP) YoutTube

    func (g *GCP) YoutTube(ctx context.Context) (*youtube.Service, error)

    Visit original content creator repository
    https://github.com/autom8ter/gcloud

  • gcloud

    gcloud


    import “github.com/autom8ter/gcloud”

    Usage

    type GCP

    type GCP struct {
    	Options []option.ClientOption `validate:"required"`
    }

    GCP is the configuration used to return gcp clients and services. Use Init() to
    validate GCP before using it.

    func NewGCP

    func NewGCP(options ...option.ClientOption) *GCP

    func (*GCP) Blogger

    func (g *GCP) Blogger(ctx context.Context) (*blogger.Service, error)

    func (*GCP) Calendar

    func (g *GCP) Calendar(ctx context.Context) (*healthcare.Service, error)

    func (*GCP) ClassRoom

    func (g *GCP) ClassRoom(ctx context.Context) (*class.Service, error)

    func (*GCP) Container

    func (g *GCP) Container(ctx context.Context) (*container.Service, error)

    func (*GCP) Content

    func (g *GCP) Content(ctx context.Context) (*content.APIService, error)

    func (*GCP) CustomSearch

    func (g *GCP) CustomSearch(ctx context.Context) (*customsearch.Service, error)

    func (*GCP) DBAdmin

    func (g *GCP) DBAdmin(ctx context.Context) (*database.DatabaseAdminClient, error)

    func (*GCP) Docs

    func (g *GCP) Docs(ctx context.Context) (*docs.Service, error)

    func (*GCP) Domains

    func (g *GCP) Domains(ctx context.Context) (*plusdomains.Service, error)

    func (*GCP) Firestore

    func (g *GCP) Firestore(ctx context.Context, project string) (*firestore.Client, error)

    func (*GCP) HTTP

    func (g *GCP) HTTP(ctx context.Context, scopes []string) (*http.Client, error)

    func (*GCP) HealthCare

    func (g *GCP) HealthCare(ctx context.Context) (*healthcare.Service, error)

    func (*GCP) IAM

    func (g *GCP) IAM(ctx context.Context) (*iam.Service, error)

    func (*GCP) IOT

    func (g *GCP) IOT(ctx context.Context) (*iot.DeviceManagerClient, error)

    func (*GCP) ImageAnnotator

    func (g *GCP) ImageAnnotator(ctx context.Context) (*vision.ImageAnnotatorClient, error)

    func (*GCP) ImageProductSearch

    func (g *GCP) ImageProductSearch(ctx context.Context) (*vision.ProductSearchClient, error)

    func (*GCP) Init

    func (g *GCP) Init() error

    func (*GCP) Jobs

    func (g *GCP) Jobs(ctx context.Context) (*jobs.Service, error)

    func (*GCP) KMS

    func (g *GCP) KMS(ctx context.Context) (*kms.KeyManagementClient, error)

    func (*GCP) Kube

    func (g *GCP) Kube(inCluster bool) (*kubernetes.Clientset, error)

    func (*GCP) Language

    func (g *GCP) Language(ctx context.Context) (*language.Client, error)

    func (*GCP) OSLogin

    func (g *GCP) OSLogin(ctx context.Context) (*oslogin.Service, error)

    func (*GCP) People

    func (g *GCP) People(ctx context.Context) (*people.Service, error)

    func (*GCP) Photos

    func (g *GCP) Photos(cli *http.Client) (*photos.Service, error)

    func (*GCP) Prediction

    func (g *GCP) Prediction(cli *http.Client) (*prediction.Service, error)

    func (*GCP) PubSub

    func (g *GCP) PubSub(ctx context.Context, project string) (*pubsub.Client, error)

    func (*GCP) Redis

    func (g *GCP) Redis(ctx context.Context) (*redis.Service, error)

    func (*GCP) RuntimeGCP

    func (g *GCP) RuntimeGCP(ctx context.Context) (*run.Service, error)

    func (*GCP) Sheets

    func (g *GCP) Sheets(ctx context.Context) (*sheets.Service, error)

    func (*GCP) Slides

    func (g *GCP) Slides(ctx context.Context) (*slides.Service, error)

    func (*GCP) Spanner

    func (g *GCP) Spanner(ctx context.Context, database string) (*spanner.Client, error)

    func (*GCP) Speech

    func (g *GCP) Speech(ctx context.Context) (*speech.Client, error)

    func (*GCP) Storage

    func (g *GCP) Storage(ctx context.Context) (*storage.Client, error)

    func (*GCP) Tasks

    func (g *GCP) Tasks(ctx context.Context) (*tasks.Service, error)

    func (*GCP) Text2Speech

    func (g *GCP) Text2Speech(ctx context.Context) (*texttospeech.Client, error)

    func (*GCP) Translate

    func (g *GCP) Translate(ctx context.Context) (*translate.Client, error)

    func (*GCP) VideoIntelligence

    func (g *GCP) VideoIntelligence(ctx context.Context) (*videointelligence.Client, error)

    func (*GCP) YoutTube

    func (g *GCP) YoutTube(ctx context.Context) (*youtube.Service, error)

    Visit original content creator repository
    https://github.com/autom8ter/gcloud

  • feminicidio

    Projeto final do Curso de Faxina de dados: Feminícidio

    Esse pacote foi produzido especialmente para o trabalho final do curso de Faxina de dados do curso-r.

    Para instalar

    devtools::install_github("katerine-dev/feminicidio")
    

    O projeto

    As bases brutas foram baixadas diretamente do Portal de Transparência do Governo. Foi escolhido o prazo de março de 2020 a junho de 2021, chegando num total de 16 arquivos em .xls. As informações sobre outros meses posteriores ainda não estavam disponíveis no site.

    Atualmente existem vários estudos que demonstram um aumento relevante de nºs de casos de feminicídio e agressões contra mulheres na pandemia. O objetivo da análise é observar os casos de feminicídio entre o início da pandemia e os dias de hoje.

    O isolamento social acentuou a violência doméstica, as mulheres que já viviam algum tipo de vulnerabilidade foram forçadas a passarem mais tempo com seus agressores, seja por aderirem ao trabalho remoto, desemprego ou pela responsabilidade familiar de ficar com as crianças ou idosos em casa.

    Além da violência, as mulheres convivem com uma sobrecarga do trabalho doméstico e familiares que se concentram desigualmente entre o homem e a mulher que reforçam ainda mais o machismo.

    Esse tipo de convívio direto e forçado expos diretamente as mulheres a agressões psicológicas, físicas e sexuais constantes. Dificultando também o acesso a essas mulheres de suporte adequado para o enfrentamento à violência.

    A análise será diante desse cenário.

    Descrição da Base Untidy

    Como citado anteriormente as bases foram baixadas de um portal de dados públicos, sendo observado diferentes problemas que poderiam prejudicar a análise.

    Lista de problemas:

    • Colunas não necessárias
    • Problemas com enconding
    • Nºs de latitude e longitude fora do padrão
    • Letras maiúsculas nas colunas
    • Colunas separadas que eram da mesma espécie
    • Problemas com as datas datas e horas
    • Informações diferentes numa mesma coluna
    • Duplicidade de informações
    • Linhas com lacunas ou “0”
    • Nomes de colunas sem padrão

    A base continha no total 55 colunas e 491 linhas.

    O planejamento

    Foi decidido dividir os dados entre 4 bases tidys relacionadas pelo o assunto para a arrumação principal.

    • A primeira divisão: infracoes_arrumado e infracoes_arrumado2 (Foi escolhido realizar a limpeza dividindo entre tipicidade e natureza jurídica)
    • A segunda divisão: datas_arrumado
    • A terceira divisão: endereco_arrumado
    • A quarta divisão: partes_arrumado

    Finalizando a arrumação foi realizado um join entre elas produzindo a base_final_tidy. Escolhi separar as informações relacionadas as partes constituindo assim a base específica de partes_tidy.

    feminicidio::base_final_tidy |>  
     dplyr::glimpse()
    #> Rows: 193
    #> Columns: 17
    #> $ num_bo             <int> 28, 33, 51, 57, 59, 71, 75, 82, 85, 99, 137, 191, 1…
    #> $ ano_bo             <int> 2020, 2020, 2021, 2021, 2020, 2021, 2021, 2020, 202…
    #> $ numero_boletim     <chr> "28/2020", "33/2020", "51/2021", "57/2021", "59/202…
    #> $ delegacia          <chr> "09º d.p. campinas, 01ª del. sec. campinas - shpp",…
    #> $ natureza_vinculada <chr> "homicidio qualificado (art. 121, §2o.)", "violenci…
    #> $ infracoes          <chr> "homicidio qualificado (art. 121, §2o.), vi-feminic…
    #> $ bo_iniciado        <dttm> 2020-03-10 08:56:12, 2020-07-23 10:42:29, 2021-05-…
    #> $ bo_emitido         <dttm> 2020-03-10 08:58:33, 2020-07-23 12:17:41, 2021-05-…
    #> $ dhocorrencia       <dttm> 2020-03-07 20:30:00, NA, 2021-05-12 09:20:00, 2021…
    #> $ peridoocorrencia   <chr> "a noite", "em hora incerta", "pela manha", "a tard…
    #> $ datacomunicacao    <date> 2020-03-10, 2020-07-23, 2021-05-12, 2021-02-02, 20…
    #> $ endereco           <chr> "dic, campinas", "centro, dobrada", "pq r barreto, …
    #> $ numero             <dbl> 0, 0, 0, 0, 229, 0, 0, 0, 0, 0, 0, NA, 0, 0, 0, 0, …
    #> $ uf                 <chr> "SP", "SP", "SP", "SP", "SP", "SP", "SP", "SP", "SP…
    #> $ latitude           <dbl> NA, NA, NA, NA, -22.81353, NA, NA, NA, NA, NA, NA, …
    #> $ longitude          <dbl> NA, NA, NA, NA, -50.07174, NA, NA, NA, NA, NA, NA, …
    #> $ descricaolocal     <chr> "residencia", "residencia", "residencia", "residenc…
    

    Nessa observamos as informações mais genéricas sobre os casos, contendo infrações, endereços e delegacias.

    feminicidio::partes_tidy  |>  
     dplyr::glimpse()
    #> Rows: 267
    #> Columns: 20
    #> $ num_bo         <int> 4917, 2452, 2620, 9896, 4254, 3105, 3105, 4245, 4245, 4…
    #> $ ano_bo         <int> 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2020, 2…
    #> $ bo_autoria     <chr> "conhecida", "conhecida", "conhecida", "conhecida", "co…
    #> $ flagrante      <chr> "sim", "nao", "sim", "nao", "sim", "sim", "sim", "nao",…
    #> $ exame          <chr> "ic-iml", "ic-iml", "não informado", "ic-iml", "não inf…
    #> $ solucao        <chr> "bo para flagrante", "bo para inquerito", "bo para flag…
    #> $ status         <chr> "consumado", "consumado", "consumado", "consumado", "co…
    #> $ tipopessoa     <chr> "vitima", "vitima", "vitima", "vitima", "vitima", NA, "…
    #> $ vitimafatal    <chr> "sim", "sim", "sim", "sim", "sim", NA, "sim", "sim", "s…
    #> $ naturalidade   <chr> "s.paulo/sp", "s.paulo -sp", "ibitinga -sp", "aracatuba…
    #> $ nacionalidade  <chr> "brasileira", "brasileira", "brasileira", NA, "brasilei…
    #> $ sexo           <chr> "feminino", "feminino", "masculino", "feminino", "femin…
    #> $ datanascimento <date> 1994-03-27, 1985-03-14, 2002-12-11, 1946-08-26, 1977-1…
    #> $ idade          <dbl> 26, 35, 17, 74, 42, NA, 30, 38, 18, 38, 18, 29, 22, 29,…
    #> $ estadocivil    <chr> "solteiro", "solteiro", "solteiro", "viuvo", "divorciad…
    #> $ profissao      <chr> "atendente", NA, "estudante", "aposentado(a)", "manicur…
    #> $ grauinstrucao  <chr> "2 grau completo", NA, NA, NA, NA, NA, NA, NA, NA, NA, …
    #> $ corcutis       <chr> "branca", "branca", "branca", "amarela", "branca", NA, …
    #> $ tipovinculo    <chr> "vitima", "vitima", "vitima", "vitima", "vitima", NA, "…
    #> $ relacionamento <chr> "envolvimento amoroso", "envolvimento amoroso", NA, NA,…
    

    Essa base é mais específica, contendo informações das partes envonvidas nos crimes. Em alguns casos haviam mais de uma vítima com desfechos diferentes e qualidades diferentes. Para deixar as informações mais individuais foi decidido separar essas variáveis da base principal.

    Resultados

    Incidentes por dia de semana

    Podemos observar que o nº de incidente piora principalmente nos finais de semana e começo da semana, concluindo portanto que nestes dias a concentração da convivência entre o agressor e a vítima dentro de casa eleva o número de registro de ocorrência. Outros fatores de risco que agravam é o consumo excessivo de álcool nos finais de semana e eventos que possam elevar o estresse dentro de casa.

    Período da ocorrência

    O período mais constante é a noite/madrugada entre os anos de 2020 e 2021 os crimes ocorreram pelo menos 34.68% e 24.64% respectivamente no período de descanso.

    Quem comete a violência doméstica e familiar?

    Sabemos que o agressor poderá ser o marido, convivente, namorado, irmãos, cunhado, cunhada, sogro, sogra, e outros, independentemente do sexo ou grau de parentesco com a vítima. Atualmente, também se reconhece a aplicação da lei nas relações homoafetivas entre mulheres.

    Percebemos na figura acima que ao autor do crime e a sua relação com a vítima o nº de incidentes (ocorrências registradas) é muito mais atenuante quando tem qualquer tipo de envolvimento amoroso, concluindo então que o agressor não será apenas o marido ou companheiro.

    Denuncie

    É perceptivel que esse cenário é muito difícil e traumático. Caso você queria ajudar uma vítima de violência doméstica denuncie nos seguintes canais:

    • Disque 180 – Central de Atendimento à Mulher, para denúncias, ou
    • Disque 190 – Polícia Militar, para atuação emergencial.

    “Feminismo é um movimento para acabar com sexismo, exploração sexista e opressão” (BUENO, Winnie. Feminist Theory: From Margin to Center [Teoria feminista: da margem ao centro]. Sounth End Press. 1984.)

    Visit original content creator repository https://github.com/katerine-dev/feminicidio