text:
# Git Commands
## 1. Commit
A commit is a snapshot of a project history. It is used to save changes to a local Git repository. Commits act as a project directory and should be used after each step is complete or a change is made. This is the only way the repository can reflect the changes made to a project.

For example: after adding a new branch to a project in WebStorm, in order for the changes to be reflected in the local repository, the next step would be to use the commit command.

**Git Commit**
![Git Commit](/Images/Git-Commit.png)

## 2. Merge
A merge git command will bring together any changes made to a commit from multiple branches into one, i.e. two local branches can be merged into the master to bring together both commits. The merge command is especially useful to maintain the context of both branches while preserving the history and order.

For example: In the image below, the bugfix commit was created, commits C2 and C3 were merged to come together in the main.

**Git Merge**
![Git Merge](/Images/Git-Merge.png)

## 3. Checkout
The checkout command is used to switch a current branch and is most commonly used to switch to a different branch making it the new HEAD. The git merge and git checkout commands are often used simultaneously with each other and are both important for git workflows.

For example: In the image below, the git checkout command is used to create a new branch. The command [git checkout -b bugfix] allows us to create a new branch (bugfix) and check it out in one step.

**Git Checkout**
![Git Checkout](/Images/Git-Checkout.png)

## 4. Push
The git push command is used to upload a local repository to a remote (central) repository, syncing all new commits in a new branch to the master. This allows all team members to have access to the changes you have made in your local repository. This can be compared to the act of uploading new information to an existing repo.

For example: in the image below, the repo was cloned before commits were made. After adding commits, the changes were pushed to the cloned repo.

**Git Push**
![Git Push](/Images/Git-Push.png)

Collaborating with others in a remote repository, following a push command, a pull and merge command must be applied in the github repository to update with the most recent changes within the local repository.

## 5. Pull
The git pull command is used to pull content from a remote repository to a local repository. This ensures that a user is working on the most recent version of the repo. Merging any updates by collaborators is part of the general git workflow. Git pull is a simpler command that combines the git fetch and git merge commands; combining both steps into one.

For example: In the images below, the git pull command works as the shorthand for git fetch followed by a git merge of the branch that was fetched from the new work done in the remote repo. Results of the [ $ git pull ] can be seen in the second image.

**Before [$ Git Pull] Command**
![Git Pull](/Images/Git-Pull-1.png)

**Results**
![Git Pull](/Images/Git-Pull-2.png)

Another important thing to note; GitHub allows multiple collaborators to work on the same repository at the same time. However, after adding commits to a local repo, the changes must then be pushed out to the remote. The conflict may occur if multiple collaborators are working on the same repository. Git will protect the changes made by other collaborators by flagging as a conflict once pull and merge function is applied. Users will then be able to correct the conflicts before completing a push, pull, merge into the share GitHub repo.

## 6. Remote
The git remote command allows you to create, view, and delete links with other repositories. This is very useful when collaborating with other creators. It is done using a repository’s direct URL or the individual’s shortname.

For example, for this mini project, GitHub was used for collaborating with classmates by sharing one common repository. The remote command can be used in this case to connect both collaborators to a single repository.

In the image below, three repositories are presented, your personal repository and two remote repositories. The git remote command acts as an interface for you to access the remote entries in the linked repositories.

**Git Remote Visual Display**
![Git Remote](/Images/Git-remote-visual.PNG)

The remote command is used along with the git push and pull commands (described in previous sections) for complete syncing capabilities.

### a) Adding a Remote
The git remote add command creates a connection to a new remote repository. As briefly referenced above, you can add a remote repo using a short name rather than a complete URL for convenience. The short name can then be used to clone to your local repo.

For example: $ git remote add <name> <url> can be used to add a new remote repository to an existing one.

### b) Removing a remote
The git remote remove command cuts all connections from a remote repository; disconnecting it from the local repository. The remote repo is unaffected by this command, but the local repo will no longer be able to access the remote.

For example: $ git remove <name> can be used to detach a remote repository from an existing local one.

### c) Showing a Remote
The git remote show command can be used to view the servers that are connected to the remote. The following command can be used to view all remote repositories connected to your local repository:  $ git remote -v

This will give us a list of all bookmarked remote repositories connected to the local.

## 7. Status
The git status command is used to show what files were staged or not staged and what files are not being tracked by Git. The git status should not be confused with the git log. If you have any doubts in your current repository, you can run the git status to understand if:
* a branch is checked out
* there are changed that were not committed
* your current branch is linked to a remote branch

Git status is only an output command, so it will not make any changes to your repository but will simply provide you with important information.


text:
# HTTP Client Code Samples

An `HTTP Client` is the default implementation of a `Client` in Safe Browsing.NET that allows you to communicate with
the Google Safe Browsing API.

If you're using a `Service`, whether a `Managed Service` or an `Unmanaged Service`, you'll typically never use an
`HTTP Client` directly because the `Managed Service` will communicate with the Google Safe Browsing API for you
internally. If you wish, however, to communicate with the Google Safe Browsing API manually, you should consider using
an `HTTP Client` as opposed to building your own.

> [!TIP]
> To follow along with these examples, please see the
> [Gee.External.Browsing.Clients](xref:Gee.External.Browsing.Clients) and the
> [Gee.External.Browsing.Clients.Http](xref:Gee.External.Browsing.Clients.Http) namespaces and in particular
> [HttpBrowsingClient](xref:Gee.External.Browsing.Clients.Http.HttpBrowsingClient) in the
> [Safe Browsing.NET API reference](xref:Gee.External.Browsing).

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: C#

gha_license_id: MIT

license_type: permissive


text:
# Example Dual Moving Average Algo

This is the example dual moving average algorithm from
[quantopian/zipline](https://github.com/quantopian/zipline/blob/master/zipline/examples/dual_moving_average.py),
to demonstrate mostly the same API interfaces with zipline.

repository: mjgpinheiro/pylivetrader

repo_name: mjgpinheiro/pylivetrader


text:
# blinder_script
A simple script for blinded analysis. Assumes structure where data to be analyzed has already been
split into separate files, each of which is subject to varying experimental treatment. The script
copies the files to a new location, replacing the original filenames with a randomly-assigned
number, saving a plaintext key that can be used to automatically rename the files with their
original value. An analyst processing this data will not have any indication of each files status
and thus can provided blinded, unbiased analysis of the results.

 This script is intended to be non-destructive, but I have not given it much
attention since writing it years ago - back up your data just in case.

## Usage

*Tested on python 3.8, probably works on any python 3.x version though.*

Run the script as `/path/to/blinder /path/to/target_directory`.

The contents of `/path/to/target_directory` will be copied to a new directory
`/path/to/target_directory_blinded` (meaning, a new directory is made in the same parent directory
of your target directory, and the suffix "_blinded" is added). Each of the input files will be
copied to this new directory, but renamed with a random choice between 0 and n - 1 (where n is the
number of files in the target directory). That means this script is *non-destructive* (though I
recommend backing up your data prior to running this script anyways). File extensions are
maintained, so if that can reveal something you'd like blinded you'll need to find some workaround.
When you're done with your analysis, repeat the same call on the **original target directory**, and
you'll be asked whether you want to unblind. Typing "yes" will rename the files in the "_blinded"
directory to their original name but with the suffix "_processed" added before the extension. The
intention here is that if your analysis requires changes to the files, you can merge these back in
with the originals. **If you delete the key file, you will not be able to unblind the results (and
unless you recorded this information elsewhere, you may not be able to map the blinded filenames
back to their originals).**

Illustrating the above with an example:

Let's say your original directory looks like this:

```
./test_data/
├── control_001.png
├── control_002.png
├── control_003.png
├── control_004.png
├── experiment_001.png
├── experiment_002.png
├── experiment_003.png
└── experiment_004.png
```

After running the script, there is now a new directory called `test\_data\_blinded`, which looks
like:

```
./test_data_blinded/
├── 0.png
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
├── 7.png
└── key_test_data.txt
```

Next, after you complete your analysis and run the blind script again (on the **original
directory**), the blinded directory will look like:

```
./test_data_blinded/
├── control_001_processed.png
├── control_002_processed.png
├── control_003_processed.png
├── control_004_processed.png
├── experiment_001_processed.png
├── experiment_002_processed.png
├── experiment_003_processed.png
├── experiment_004_processed.png
└── key_test_data.txt
```

If you don't need the file copies (as in, you haven't made any edits but just recorded analysis
elsewhere) you can just use the keyfile directly to map the blinded filenames to their original.
The file in this example is:

```
1.png   experiment_002.png
6.png   experiment_001.png
0.png   control_003.png
2.png   experiment_003.png
4.png   control_002.png
7.png   control_001.png
5.png   experiment_004.png
3.png   control_004.png
```

The left column provides the blinded filename and the right column provides the original name.

## Todos

This script was made years ago, before I had learned the value of CLIs and logging.
*Realistically, I will never work on any of this - but PR's are welcome!*

- CLI interface, using `argparse`. The unblind command can then be more explicit.
- key data in conventional format, e.g. csv or json if plaintext is still required, or pickle
  otherwise
- hide keyfile by (optionally) add `.` prefix to filename, and / or optionally save as binary /
  encoded file
- provide option for destination of blinded directory (can keep current behavior as default).


text:
# NumbersToWordsKata

A code kata that converts numbers to words using TDD implemented during a coding dojo.

http://codingdojo.org/kata/NumbersInWords/

[![Build Status](https://travis-ci.org/AdvancedProgrammingWithJavaSummer2017/NumbersToWordsKata.svg?branch=master)](https://travis-ci.org/AdvancedProgrammingWithJavaSummer2017/NumbersToWordsKata)

## When we start the coding dojo

Find a partner to pair program with.  Make sure that at least one of you has a GitHub account.  @DavidWhitlock will tell you how to join the organization.

Make a clone (not a fork) of this repository

```
$ git clone git@github.com:AdvancedProgrammingWithJavaSummer2017/NumbersToWordsKata.git
```

Make sure that you can build the project:

```
$ cd NumbersToWordsKata/number2words
$ mvn clean verify
```

As other pairs commit and push to the repository, make sure that you can pull their changes.

```
$ git pull
```

(You can also pull through IntelliJ.)

## When you're "on deck" for the coding dojo

Join the Google Hangout so that we can all see your screen.

Get one of the USB keyboards, if you'd like.

Pull from GitHub to get the latest changes.

Add your name to the list of "developers" in the [pom.xml](https://github.com/AdvancedProgrammingWithJavaSummer2017/NumbersToWordsKata/blob/master/number2words/pom.xml).

```
    <developer>
      <id>YOU</id>
      <name>Your name here</name>
<EMAIL_ADDRESS>      <url>http://www.cs.pdx.edu/~YOU</url>
      <organization>PSU Department of Computer Science</organization>
      <organizationUrl>http://www.cs.pdx.edu</organizationUrl>
      <roles>
        <role>Student</role>
      </roles>
      <timezone>-7</timezone>
    </developer>
```

Commit and push this change to pom.xml to the repository.  You will need to be a member of the group to do this.

## When its your turn to be in front of the dojo

Pull from GitHub to get the latest changes and make sure all of the code builds.

```
$ git pull  # Or pull through IntelliJ
$ mvn clean verify
```

With your partner, talk about the next test case that you'll implement.  Feel free to engage the rest of the class in a discussion of the appropriateness of the test case.

Do Test-Driven Development do implement a small step in the kata.

(Meanwhile, we will identify the next pair and put them "on deck".)


text:
# homefiles
Files from my home directory that I'm likely to reuse across machines.

## Compatibility

* Linux Mint 19
* Ubuntu 18.04

## Usage

### First time setup on a fresh machine

* Download https://raw.githubusercontent.com/fernandoacorreia/homefiles/master/init
* run `bash ./init`

### Post-setup

* Restart or log off for user profile changes to take full effect.
* Set Chrome as the default browser.
* Ignore (revert) redundant PATH settings for cargo and n that were added during setup.
* Set Hack Regular as default monospace font.
* Disable transparency in terminal.
* Assign Ctrl+Space keybinding as a shortcut for maximize window.
* Assign Alt-1 to Alt-4 keybindings as direct navigation shortcuts for workspaces.
* Disable sounds: Starting, Leaving, Switching workspaces.

### Update after pulling a new version or making changes

```
~/homefiles/setup
```

## Testing

To run in a disposable Docker container:

```
docker run --rm -it -v $(pwd):/root/homefiles ubuntu:16.04 bash
/root/homefiles/setup
```

## Inspiration

* http://dotfiles.github.io/
* https://github.com/alrra/dotfiles
* https://github.com/jacobwgillespie/dotfiles
* https://github.com/mathiasbynens/dotfiles
* https://github.com/michaeljsmalley/dotfiles
* https://github.com/necolas/dotfiles
* https://github.com/nicksp/dotfiles
* https://github.com/paulirish/dotfiles
* https://github.com/thoughtbot/dotfiles
* https://github.com/webpro/awesome-dotfiles

repository: fernandoacorreia/homefiles

repo_name: fernandoacorreia/homefiles


text:
# Team Names

## Methods

- [loadTeamNames](#loadTeamNames)

---

## `loadTeamNames(params, callback)`
Loads items from the `teamNames` collection based on given params.

### Params
* `params`: [int, object] - can be either a `teamId` or an object with query parameters.
* `callback`: [function] - callback to be executed when the operation completes.

To see a list of all available search params you can run:
`teamsnap.collections.teamNames.queries.search.params`

### Examples
```javascript
// ~~~~~
// Loads a teamName for `id: 1`.
teamsnap.loadTeamNames(1);

// ~~~~~
// Loads all teamNames for `divisionId: 1`.
teamsnap.loadTeamNames({divisionId: 1});
```

repository: teamsnap/teamsnap-javascript-sdk

branch_name: refs/heads/main

gha_language: JavaScript

repo_name: teamsnap/teamsnap-javascript-sdk


text:
# END OF LIFE
This project is not being maintained anymore.

# GPU Support for DC/OS on CoreOS

This project aims to provide GPU support for [DC/OS](https://dcos.io) clusters running with [CoreOS](https://coreos.com/).

Of the operating systems supported by DC/OS the official [nvidia installer](https://www.nvidia.de/Download/index.aspx) only supports RedHat/CentOS. But many people use CoreOS in their DC/OS clusters to have a lighter and smaller OS and still want to use GPUs. For this use case we devised a way to get GPU support running on CoreOS in DC/OS.

## Getting started

1. Locally checkout this repository
2. Compile nvidia drivers for your CoreOS version (Can be run on any linux machine with docker installed, needs neither CoreOS nor an Nvidia GPU)
   1. Edit `common.sh` and set your CoreOS and Nvidia driver versions
   2. Run `build_driver.sh`
3. Upload the resulting `nvidia.tar.gz` to a place from where your cluster nodes can download it (e.g. an S3 bucket).
4. Extend your cluster provisioning (e.g. terraform, ansible) to
   1. Download and extract the `nvidia.tar.gz`
   2. Run `install_nvidia.sh` (with sudo)
   3. Optional: To make sure the drivers also get loaded after a restart add the `nvidia.service` file to your systemctl units and enable it. You need to do this after DC/OS has been installed as the unit contains a `Before` directive to start before the `dcos-mesos-slave`.

You do not need a special CoreOS image, instead you can continue to use your normal image (for AWS this will probably be the official AMIs provided by CoreOS).

Example snippet for cluster provisioning with terraform:

```terraform
  provisioner "remote-exec" {
    inline = [
      "wget -O /tmp/nvidia.tar.gz https://s3.eu-central-1.amazonaws.com/my-bucket/nvidia.tar.gz",
      "sudo tar xfz /tmp/nvidia.tar.gz -C /tmp",
      "cd /tmp && sudo chmod +x /tmp/install_nvidia.sh && sudo /tmp/install_nvidia.sh",
      "sudo /opt/nvidia/startup.sh"
    ]
  }

  provisioner "remote-exec" {
    inline = [
        # ... install DC/OS
    ]
  }

  provisioner "remote-exec" {
    inline = [
      "sudo cp /tmp/nvidia.service /etc/systemd/system/nvidia.service",
      "sudo systemctl enable /etc/systemd/system/nvidia.service"
    ]
  }
```

This has only been tested with CoreOS 1855.4.0 running on Amazon EC2 GPU instances.

After you have completed the setup refer to the [DC/OS documentation](https://docs.mesosphere.com/1.13/deploying-services/gpu/#using-gpus-in-your-apps) on how to run GPU-enabled apps in your cluster.

If you find a bug or have a feature request please open an issue in Github.

## Behind the curtain

The first challenge is that nvidia has no official support for CoreOS. So to make this work we need to trick the nvidia installer into compiling the drivers anyway.
To do this we create a CoreOS docker container and prepare the kernel sources corresponding to the CoreOS version. Then we download and run the nvidia installer and tell it to use the CoreOS kernel sources. Installation of the compiled modules will fail as we are inside a docker container and the running kernel of the host system is most likely not the same as the CoreOS kernel. But we can ignore that failure as we only need the module files.

The second challenge is to get the driver installed. To make it easy to integrate we do not use a custom-built OS image, instead the build process assembles an archive file that just needs to be made available to the running CoreOS instances (.e.g. via http download) and contains everything needed to install the driver.

## Disclaimer

This project is in no way affiliated with CoreOS or Nvidia. This project is not officially supported by Mesosphere. Use it at your own risk.

## Acknowledgements

* Driver build is running using https://github.com/BugRoger/coreos-developer-docker
* Heavily inspired by https://github.com/src-d/coreos-nvidia and https://github.com/Clarifai/coreos-nvidia

repository: MaibornWolff/dcos-coreos-gpu-support

repo_name: MaibornWolff/dcos-coreos-gpu-support


text:
---
layout: "unit"
title: "Guide Entry 97.02.07"
path: "/curriculum/guides/1997/2/97.02.07.x.html"
unitTitle: "Blue Monday and Friends: Traditional Jewish Holidays Come Alive through the Art of Story-Telling"
unitAuthor: "Geraldine M. Martin"
keywords: ""
recommendedFor: "Recommended for Reading and Language Arts, grade 1"
---

Guide Entry to 97.02.07:

In my paper, I have explored ways in which puppetry and the art of story-telling, via children’s literature, can be integrated into a unit for helping young children gather information for appreciating and approaching literature in a more critical manner.

Books such as Isaac Bashevis Singer’s

Zlateh The Goat and Other Stories

, Malka Drucker’s

Grandma’s Latkes

and Janice Cohn’s

The Christmas Menorahs: How a Town Fought Hate

have been used for developing strategies and classroom activities for assimilating and analyzing children’s literature.

Blue Monday is a puppet who assists in bringing information and activities pertaining to the historical significance of Jewish holidays to the classroom. Our books and activities will integrate with the seasons, somewhat following the Jewish calendar; for example, the children will learn about Hanukkah during the month of December and Passover during the spring. Since January does not have celebrations that we will be actively involved with, Isaac Bashevis Singer’s stories will be used during story time in the classroom.

My unit is part of a team effort including teachers from L. W. Beecher school, whereby we will help students and the community at large to better understand cultural diversity on a more global level through the use of literature.

(Recommended for Reading and Language Arts, grade 1)

gha_language: HTML


text:
# buffer_overflow
A didatic repository for buffer overflow vulnerabilities
Solyd Treinamentos
https://solyd.com.br

# Archives
SLmail55.rar - PASS: vuln - SLMAIL 5.5 SERVER with buffer overflow vulnerabily in POP3 service
buffer.c - A simple C source for demonstrating buffer overflow
slmail.py - A crefted exploit to POP3 server of SLMAIL 5.5 in Windows XP


text:
# SknWebApp
An exploration into [Dry-RB](http://dry-rb.org), [Rom-DB](http://Rom-DB.org), and [Roda](https://github.com/jeremyevans/roda) tooling for Ruby Business Applications.

In concept, I plan to create a `runtime` for the [SknServices](https://skoona.github.io/SknServices/) content security application.  SknServices provides Admin features which enables this application to be a runtime consumer, and access content from SknServices using the API it provides for that purpose.

I'm looking for an alternative way to build enterprise ruby web applications.  I've tried Rails and salute it for it's Web Interface and Web framework.  However, I've never been comfortable with it's MVC development model for enterprise applications.

I'm finding that most ruby web tools are as opinionated as Rails.  The difference being tools like Roda, as web interface, allow you to override its conventions through configuration; the reversal is not lost on me!

For now I will keep notes and comments here, until I get to a workable baseline.  *Baseline is now Complete*

### Online Demo
* [SknBase Live!](http://vserv.skoona.net:4000)
* [SknServices Live!](http://vserv.skoona.net:8080)

    *Demo Credentials*
    username: `emtester`,
    password: `demos`

## Progress
#### Current Status -- Complete
* I decided on the File System Layout and implemented the configuration changes needed to redirect affected component paths for `Rake`, and `Roda`.
* Implemented the full database model using `ROM-RB`.  It contains 12 tables in 5 groupings.
* Switched from SknRegistry to Dry-Container, SknConfigurable to Dry-Configurable. Also, using Dry-Types and Dry-Structs.  The remaining Dry-Rb gems had issues or side-effects I did not want to deal with at this time; an example being Dry-AutoInject not support the Class.call() model, only Class.new and some aspects of AutoLoad scattered around in several gems IMHO are just wrong headed.
* The package is composed of two main application elements; `SknApp`, the console baseline and business logic; and `SknWeb` the web interface code.  The bridge between the two is handled by Dry-Container and a custom class `ServiceRegistry`.
* `SknBase` was the first implementation of this `SknServices Client`.  `SknWebApp` is a refactoring of `SknBase`, using the things I learned from writing tools to address this new frontier; i.e. Ruby Applications with a Web Interface.

## In Summary
It appears that I've written my own version of NestedStruct(Dry-Struct), Configurable(Dry-Configurable), Configuration(SknSettings), Container(Dry-Container lite), Success, and Failure(Dry-Monads lite) in SknUtils.  Writing my own version of a Dry-Types, to bring type safety to the app, is impractical.  So Dry-Types and Rom-rb will be permanent additions to my development toolkit.

#### Common Tools for Ruby Application Development of all kinds
* Value Container with/without Validation
    * NestedResult, DottedHash, Dry-Struct/Types/Validation
    * Used to create Command Classes and hold intermediate values bundles
* Dependency Management Container
    * SknRegistry, SknSettings, Dry-Container
    * Can also serve as a humanized list of service modules
* Application Settings
    * SknSetting, SknUtils::Configuration, SknUtils::Configurable, Dry-Configurable
    * `./config/settings.yml` externalized settings AND MyApp.root like capabilities.
* Standard Success/Failure classes
    * Skn's contain :success, :message, :value, and :payload
    * SknSuccess, SknFailure, Dry-Monads Success/Failure(nil side-effects)
* Time Calcs: TimeMath2
* Design Methodology
    * Domain Driven Design
    * Test Driven Design
* Best Practices: SOLID
    * MyClass.call() structure
    * Where:
    ```ruby
      class SomeService
        def self.call(structured_input_command_or_vetted_hash, dependencies={})
          new(dependencies).call(structured_input_command_or_vetted_hash)
        end
        def initialize(options={})
          @_service_helper = options.fetch(:some_service, DI.resolve('some_service'))
        end
        def call(input)
          ... # do work by calling private methods
        end
        ...
      end
    ```

#### Branch: JRuby-Master, JRuby-<IP_ADDRESS> with Warble configuration to produce Tomcat Warfile
#### Branch: master, Ruby-2.5.1

Before engaging the advanced `Dry-RB` gems and other `Gems of Interest`.  I thought to code the basic app with minimal assistance from add-ins.  The overall structure of Roda is very flexible, so other than the normal scss/js struggle there were no surprises in the web-component portion; and more importantly, no imposition on business logic structure.

User information is the only database requirement I have right now.  `Rom-DB` handled the immediate task well enough, and the additional effort needed to add database migration with associated rakes tasks was not too bad.  `Sequel` offered a `dump current schema` command which made defining migration easier.  I was using a PGSQL Dump backup of the Users table and Database from the existing demo application: `SknServices`.  As a result, `Rom-DB` is overkill for this task, `Sequel` would be the correct level technology, if I have no further needs for Database services.  But I have an interest large database models, for which a sample is included, that would require Rom-DB so it stays.

`SknService` also offers a ContentAPI which I am using on the `Resources` page.

Instead of using an advanced container and DI gem, I've started out using my [SknUtils](https://skoona.github.io/skn_utils/) gem; since I was already using it for application settings.  This gem is a thread-safe wrapper over Ruby's Hash, with dot-notation, presence(?) testing, and nested deep-merge capabilities.  Since a hash can use any object/value as it's Key or Value variables, it works well as a global container for environment based application settings, caching, central/critical application-class instances.  Whoever, I did write a `SknRegistry` to more directly handle `DI` requirements and included it in the `SknUtils` gem.

I have adopted the Command and CommandHandler pattern to service all requests for data/info from web pages. Commands encapsulate the request params, in a validate-able command class, as input to the command handler which will invoke the related service.

To link the the Roda Routes to the appropriate services, I've created a `ServicesRegistry` and HTTP/SendFile wrappers/helpers to make the link between the Application Classes and the Web Interface.  The basically moves the lines of code that would have been in the Routes into the ServicesRegistry; which I can mock out as needed for testing later.

Aside from DB migrations and increasing RSPec test coverage, I'm done with this example and very impressed with its structure.

### Gems of Interest
* [SknServices](https://skoona.github.io/SknServices/)
* [SknUtils](https://skoona.github.io/skn_utils/)
* [Roda-i18n](https://github.com/kematzy/roda-i18n)
* [Dry-Types](https://dry-rb.org/gems/dry-types/)
* [Dry-Container](https://dry-rb.org/gems/dry-container/)
* [Dry-Configurable](https://dry-rb.org/gems/dry-configurable/)
* [Dry-Struct](https://dry-rb.org/gems/dry-struct/)
* [Dry-Validation](https://dry-rb.org/gems/dry-validation/)
* [TimeMath2](https://github.com/zverok/time_math2)
* [Roda-Tags](https://github.com/kematzy/roda-tags)
* [FriendlyNumbers](https://github.com/adam12/friendly_numbers)
* [Roda-Parse-Request](https://github.com/3scale/roda-parse-request)
* [Roda-Action](https://github.com/AMHOL/roda-action)
* [Roda-Container](https://github.com/AMHOL/roda-container)
* [Roda-Flow](https://github.com/AMHOL/roda-flow)
* [Ruby-Event-Store](https://github.com/RailsEventStore/rails_event_store)
* [Piperator](https://github.com/lautis/piperator)

### Under Consideration
1. What directory structure is required, and what options are there to override those requirements?
    * Seems Roda and Dry-RB both impose a filesystem structure.
    * Would a Ruby Gem filesystem model be suitable?
    * `Answer` is: See File Tree section.
2. How does activities per-request factor into things like singletons, or Object lifecycle?
    * No Impact
3. Ruby $LoadPath vs Bundler vs Application Source AutoLoad seem to be at odds, in some ways.
    * Autoload is of little interest at this scale. Each Dir has a same-named rbfile that requires all its components
    * Bundler.setup and Bundler.require handle loading all gem for now.
4. While the notion of (Roda) Sub-Apps is valid for large applications, it also serves to segment application source into domains.
    * A sub-app filesystem structure is relevant for the web interface, it becomes clumsy for Domains.
    * For now, I will use one single web app with multiple routes to handle the web interface segmentation.
5. Several plugin automatically require and instantiate other plugins on their own.  Each plugin has to be reviewed to understand its side effects or dependencies.
    * This is a pain to be experienced one time.  Middleware and Plugin order DOES MATTER.
6. Require vs AutoLoad? `Autoload` would prevent loading the whole app when it's not needed during test or CLI operations.  However, `Require` does allow me to control what's loaded and any dependencies with greater clarity.
    * Don't really care yet!  Using the Ruby Require and Require_Relative methods.
7. Not sure about the lifecycle of critical objects in Roda yet.  How to create something that will survive the request/response cycle; like the database component.
    * Again, DI Container maybe helpful.  I'm current using `SknUtils::Configurable` class as the container, and `SknRegistry` as the DI component.  `ROM-RB` is dragging some type of container, likely based on `Dry-Container` might switch to it after some review; `switched`

### File Tree: Done
```bash
[SknWebApp]
    .
    ├── config.ru               - Rack Initializer
    ├── Gemfile                 - Gem Requirements
    ├── assets
    │   ├── stylesheets/        - Sass based CSS
    │   └── javascript/         - JQuery, BootStrap, and general Javascript
    ├── bin
    │   ├── console             - Command line console [app|web] defaults web
    │   └── setup               - One-time installer script
    ├── config
    │   ├── initializers/       - SknApp, SknSettings, and Logging are initialized here
    │   ├── settings/           - SknSettings Environment-biased Application Settings
    │   ├── puma.rb             - Puma local webserver
    │   ├── settings.yml        - Default Application Settings
    │   ├── version.rb          - Application Version Object
    │   ├── environment.rb      - Loads Gems and Initializers Only
    │   ├── boot_web.rb         - Load Main and Web Application components
    │   └── boot.rb             - Load Main Application Only
    ├── db
    │   └── migrate/            - Database migrate scripts
    ├── i18n/                   - Message Translation files
    ├── main                    - Business UseCases and Integrations
    │   ├── authentication/     - User Management
    │   │   ├── user_profile.rb - Main UserProfile Authentication Provider
    │   │   ├── ...             - Warden based security modules
    │   │   └── authentication.rb  - Require management
    │   ├── persistence/        - ROM-DB DataSource management
    │   │   ├── entity/         - Data collections
    │   │   ├── relations/      - ROM Stuff
    │   │   ├── repositories/   - ROM Stuff
    │   │   └── persistence.rb  - Require management and ROM/Types registrations
    │   ├── services/           - API services and ServicesRegistry
    │   │   ├── commands/       - Handler commands for API content requests
    │   │   ├── handlers/       - IO Handler
    │   │   ├── providers/      - Business Requests
    │   │   ├── services_registry.rb  - Web Interface to Primary Application
    │   │   └── services.rb     - Require management and Service registrations
    │   ├── utils/              - Application Utilities
    │   └── main.rb             - LoadPath Management
    ├── public
    │   ├── images/             - View Images
    │   └── fonts/              - View Fonts
    ├── rakelib/                - Rake Tasks, Database Setup and Migrations
    ├── spec/                   - RSpec Tests
    └── web                     - Primary Web Integration
        ├── security/           - Wardens helper interface modules
        ├── helpers/            - View HTML Helpers
        ├── routes
        │   ├── profiles.rb     - Profile Routes
        │   └── users.rb        - User Routes
        └── views
            ├── layouts/        - Site Layout
            ├── profiles/       - Profile Pages
            ├── sessions/       - Signin Pages
            └── about.html...   - Root Pages

```

## Installation
SknWebApp needs a database of users, which should be a shared copy of the table used by SknServices.  This may not be practical, so a pgsql dump file has been includes in the config directory and the following script will install it.

Setup Application and Create Database Tables:

$ bin/setup

Start Server with Puma, Port 8585:

$ bundle exec puma config.ru -v

Start Server with RackUp, Port 9292:

$ rackup

Start Console with Pry:

$ bin/console

Start Console with RackSh:

$ bundle exec racksh

#### Use Sequel to dump current database in migration format
    $ sequel -d postgres://localhost/SknWebApp_development > 001_start.rb

#### Database Model:  Authorization (Profiles) and Authentication (Roles)
![Full Data Model](https://github.com/skoona/skn_web_app/blob/master/spec/factories/notes/data_model.png)

### Problems Sovled
ActiveRecord Serialization for Arrays with YAML format was handled nicely by Dry-Types, since I can't easily change the data model.

```ruby
##
# added to Types:
##
module Types
  include Dry::Types.module

  Email = String.constrained(format: /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i)
  SerializedArrayRead = Types.Constructor(Types.Array(Types::Strict::String)) { |yaml_str| Psych.load(yaml_str) }
  SerializedArrayWrite = Types.Constructor(Types::Strict::String) { |ary_of_str| Psych.dump(ary_of_str) }
end

##
# Entities
##

  class User < ROM::Struct

    def pak
      person_authenticated_key
    end
  end

##
# ROM
##

  class Users < ROM::Relation[:sql]
    schema(:users, infer: false) do

      attribute :id, Types::Serial
      attribute :username, Types::Strict::String
      attribute :name, Types::Strict::String
      attribute :email, ::Types::Email
      attribute :password_digest, Types::Strict::String
      attribute :remember_token, Types::Strict::String.optional
      attribute :password_reset_token, Types::Strict::String.optional
      attribute :password_reset_date, Types::Strict::Time.optional
      attribute :assigned_groups, ::Types::SerializedArrayWrite.meta(desc: :yaml_array), read: ::Types::SerializedArrayRead.meta(desc: :yaml_array)
      attribute :roles, ::Types::SerializedArrayWrite.meta(desc: :yaml_array), read: ::Types::SerializedArrayRead.meta(desc: :yaml_array)
      attribute :active, Types::Strict::Bool
      attribute :file_access_token, Types::Strict::String.optional
      attribute :created_at, Types::Strict::Time
      attribute :updated_at, Types::Strict::Time
      attribute :person_authenticated_key, Types::Strict::String
      attribute :assigned_roles, ::Types::SerializedArrayWrite.meta(desc: :yaml_array), read: ::Types::SerializedArrayRead.meta(desc: :yaml_array)
      attribute :remember_token_digest , Types::Strict::String.optional
      attribute :user_options, ::Types::SerializedArrayWrite.meta(desc: :yaml_array), read: ::Types::SerializedArrayRead.meta(desc: :yaml_array)

      primary_key :id

    end

    auto_struct true

    # Define some composable, reusable query methods to return filtered
    # results from our database table. We'll use them in a moment.
    def by_pk(id)
      where(id: id)
    end
    def by_pak(pak)
      where(person_authenticated_key: pak)
    end
  end

```

## Naming
* Relation Table Names should be plural form
* SQL Table names should be plural
* Relations themselves should be plural and match the real-sql table name
* Entities representing a relation should be singular
* Entities composed of other entities must use relation-name (plural) as the attribute keyname
* Repositories can be named anything since they specify the relation name in their constructor

```ruby
  class Users < ROM::Repository[:users]
    struct_namespace Entity

    def all
      root.to_a
    end

    def query(conditions)
      root.where(conditions).to_a
    end

    def by_pak(pak)
      root.by_pak(pak).one!
    end

    def [](id)
      root.by_id(id).one
    end

    def by_id(id)
      root.by_pk(id).one
    end

    def find_by(col_val_hash)
      root.where(col_val_hash).one
    end
  end
```

### Notes
`puma` or `rackup` commands alone will start the server. But wont read puma's config which means the default port maybe 9292 vs 3000.
`Roda's` RodaApp.freeze.app uses RackBuilder to create an Rack App, which confuses the more deliberate `Rack::Handler::Puma.reun(app)` method.

`racksh` is a console for Rack based applications, see docs at [Gem RackSh](https://github.com/sickill/racksh)
In racksh console: `$ $rack.get "/", {}, { 'REMOTE_ADDR' => '<IP_ADDRESS>' }`

`plugin: multi_route` has a very strange structure for associated route files.
```Ruby
# File: ./routes/prefix.rb

class SknWeb
    route('prefix') do
      ...
    end
end
```
It opens and extends the existing app name class.  `SknWeb` is also the name of this apps Web main.  Helper files have the same behavior.

The assets plugin initially failed (HTTP-404) to send bootstrap.css at Roda V3.3.0.  Switched to 2.29.0 and it worked, tried 3.3.0 again and everything seems to work now!  Making this note in case the trouble shows again.
Asset Plugin Failure: Sending bottstrap.css with a 'Content-Type' eq 'text/html' 'Content-Length' eq '3045'; verus 'text/css' and 146K.

The PostgreSQL gem gave me trouble when brew updated to Version 10 of PostgreSQL, this solve the install problem.

```bash
$ bundle config build.pg --with-pg-config=/usr/local/Cellar/postgresql/10.1/bin/pg_config
```

### Code Cache

```html
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
```

```ruby
  # TODO: Experiment with direct file and/or minimized sources
  # plugin :assets, {
  #     css: "bootstrap.css",
  #     js: ["jquery-3.2.1.min.js", "bootstrap.js"]
  # }

  # TODO: Experiment with Gem-Based files
  # plugin :assets, {
  #       css: 'bootstrap.scss.indirect' ,
  #        js: 'bootstrap.js.indirectraw',
  #        dependencies: {
  #            Bootstrap.stylesheets_path + '_bootstrap.scss' => Dir[Bootstrap.stylesheets_path + '/**/*.scss'],
  #        }
  # }

```

```ruby
    File.join(Dir.pwd, "views")
```

#### Discover Warden inside app under Test
```ruby
     manager = app -- = Skn::SknWebApp.app
     manager = manager.instance_variable_get(:@app) while manager.class.name != 'Warden::Manager'

```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
---
layout: post
title: '[env] macOS에 Flutter 개발환경구축'
subtitle:
categories: til
tags: env flutter
comments: true
date: 2021-01-10 23:12:17 +0900
lastmod: 2021-01-11 13:00:17 +0900
sitemap:
  changefreq: daily
  priority: 1
published: true
---

macOS에 Flutter 개발환경구축<br />

# macOS에 Flutter 설치

강의 번호: flutter
비고: https://youtu.be/3JMjR_ahT44
완료여부: Yes
유형: 스터디
작성일시: 2021년 1월 3일 오후 11:47
최종 편집일시: 2021년 1월 11일 오전 1:03

## 1. Flutter 설치

Flutter 다운로드

```basic
https://flutter.dev/docs/get-started/install/macos
```

다운로드 파일 압축 해제 후 해당 위치에 옮기기

```basic
/Users/kang/Developer
```

환경변수 설정(macOS 카탈리나의 경우입니다.)
터미널에서 환경 변수 추가 후 시스템 적용

```basic
$ vim .zshrc
```

```basic
i

export PATH="$PATH:/Users/kang/Developer/flutter/bin"

:wq!
```

```basic
$ source .zshrc
```

flutter 버전 확인

```basic
$ flutter -version
Downloading Dart SDK from Flutter engine ae90085a8437c0ae94d6b5ad2741739ebc742cb4...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  172M  100  172M    0     0  1170k      0  0:02:30  0:02:30 --:--:-- 1675k
Building flutter tool...
Could not find an option with short name "-e".

Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
$ flutter --version
Flutter 1.22.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision<PHONE_NUMBER> (4 weeks ago) • 2020-12-10 11:54:40 -0800
Engine • revision ae90085a84
Tools • Dart 2.10.4

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║                 Welcome to Flutter! - https://flutter.dev                  ║
  ║                                                                            ║
  ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
  ║ statistics and basic crash reports. This data is used to help improve      ║
  ║ Flutter tools over time.                                                   ║
  ║                                                                            ║
  ║ Flutter tool analytics are not sent on the very first run. To disable      ║
  ║ reporting, type 'flutter config --no-analytics'. To display the current    ║
  ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out    ║
  ║ event will be sent, and then no further information will be sent by the    ║
  ║ Flutter tool.                                                              ║
  ║                                                                            ║
  ║ By downloading the Flutter SDK, you agree to the Google Terms of Service.  ║
  ║ Note: The Google Privacy Policy describes how data is handled in this      ║
  ║ service.                                                                   ║
  ║                                                                            ║
  ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and  ║
  ║ crash reports to Google.                                                   ║
  ║                                                                            ║
  ║ Read about data we send with crash reports:                                ║
  ║ https://flutter.dev/docs/reference/crash-reporting                         ║
  ║                                                                            ║
  ║ See Google's privacy policy:                                               ║
  ║ https://policies.google.com/privacy                                        ║
  ╚════════════════════════════════════════════════════════════════════════════╝
```

flutter 설치 체크

```basic
$ flutter doctor

Downloading Material fonts...                                       1.0s
Downloading Gradle Wrapper...                                       0.1s
Downloading package sky_engine...                                   0.4s
Downloading flutter_patched_sdk tools...                            4.0s
Downloading flutter_patched_sdk_product tools...                    4.0s
Downloading darwin-x64 tools...                                    11.2s
Downloading libimobiledevice...                                     0.2s
Downloading usbmuxd...                                              0.2s
Downloading libplist...                                             0.2s
Downloading openssl...                                              0.5s
Downloading ios-deploy...                                           0.2s
Downloading darwin-x64/font-subset tools...                         0.8s
Downloading android-arm-profile/darwin-x64 tools...                 1.0s
Downloading android-arm-release/darwin-x64 tools...                 0.9s
Downloading android-arm64-profile/darwin-x64 tools...               1.1s
Downloading android-arm64-release/darwin-x64 tools...               0.9s
Downloading android-x64-profile/darwin-x64 tools...                 1.2s
Downloading android-x64-release/darwin-x64 tools...                 0.9s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-KR)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for
      detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to
      that location.
      You may also want to add it to your PATH environment variable.

[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with is
        different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods. For more info, see
        https://github.com/flutter/flutter/issues/14293.
      To re-install CocoaPods, run:
        sudo gem install cocoapods
[!] Android Studio (not installed)
[!] IntelliJ IDEA Ultimate Edition (version 2019.3.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.52.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
    ! No devices available

! Doctor found issues in 6 categories.
➜  ~
```

## 2. Android 개발환경 구축

안드로이드 다운로드 후 설치

```basic
https://flutter.dev/docs/get-started/install/macos#android-setup
```

안드로이드 스튜디오 실행

```basic
- Do not import settings > OK
- Next
- Standard > Next
- Darcula > Next
- 자동으로 컴포넌트 다운로드 및 설치
- Finish

추가 관련 파일 다운로드 됨
```

```basic
Preparing "Install SDK Patch Applier v4 (revision: 1)".
Downloading https://dl.google.com/android/repository/3534162-studio.sdk-patcher.zip
"Install SDK Patch Applier v4 (revision: 1)" ready.
Installing SDK Patch Applier v4 in /Users/kang/Library/Android/sdk/patcher/v4
"Install SDK Patch Applier v4 (revision: 1)" complete.
"Install SDK Patch Applier v4 (revision: 1)" finished.
Preparing "Install Android SDK Platform-Tools (revision: 30.0.5)".
Downloading https://dl.google.com/android/repository/eabcd8b4b7ab518c6af9c941af8494072f17ec4b.platform-tools_r30.0.5-darwin.zip
"Install Android SDK Platform-Tools (revision: 30.0.5)" ready.
Installing Android SDK Platform-Tools in /Users/kang/Library/Android/sdk/platform-tools
"Install Android SDK Platform-Tools (revision: 30.0.5)" complete.
"Install Android SDK Platform-Tools (revision: 30.0.5)" finished.
Preparing "Install Android Emulator (revision: 30.3.5)".
Downloading https://dl.google.com/android/repository/emulator-darwin-7033400.zip
"Install Android Emulator (revision: 30.3.5)" ready.
Installing Android Emulator in /Users/kang/Library/Android/sdk/emulator
"Install Android Emulator (revision: 30.3.5)" complete.
"Install Android Emulator (revision: 30.3.5)" finished.
Preparing "Install Android SDK Tools (revision: 26.1.1)".
Downloading https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip
"Install Android SDK Tools (revision: 26.1.1)" ready.
Installing Android SDK Tools in /Users/kang/Library/Android/sdk/tools
"Install Android SDK Tools (revision: 26.1.1)" complete.
"Install Android SDK Tools (revision: 26.1.1)" finished.
Preparing "Install Sources for Android 30 (revision: 1)".
Downloading https://dl.google.com/android/repository/sources-30_r01.zip
"Install Sources for Android 30 (revision: 1)" ready.
Installing Sources for Android 30 in /Users/kang/Library/Android/sdk/sources/android-30
"Install Sources for Android 30 (revision: 1)" complete.
"Install Sources for Android 30 (revision: 1)" finished.
Preparing "Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)".
Downloading https://dl.google.com/android/repository/f6d24b187cc6bd534c6c37604205171784ac5621.build-tools_r30.0.3-macosx.zip
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" ready.
Installing Android SDK Build-Tools 30.0.3 in /Users/kang/Library/Android/sdk/build-tools/30.0.3
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" complete.
"Install Android SDK Build-Tools 30.0.3 (revision: 30.0.3)" finished.
Preparing "Install Intel x86 Emulator Accelerator (HAXM installer) (revision: 7.5.1)".
Downloading https://dl.google.com/android/repository/extras/intel/haxm-macosx_v7_5_1.zip
"Install Intel x86 Emulator Accelerator (HAXM installer) (revision: 7.5.1)" ready.
Installing Intel x86 Emulator Accelerator (HAXM installer) in /Users/kang/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager
"Install Intel x86 Emulator Accelerator (HAXM installer) (revision: 7.5.1)" complete.
"Install Intel x86 Emulator Accelerator (HAXM installer) (revision: 7.5.1)" finished.
Preparing "Install Google APIs Intel x86 Atom System Image (revision: 9)".
Downloading https://dl.google.com/android/repository/sys-img/google_apis/x86-30_r09.zip
"Install Google APIs Intel x86 Atom System Image (revision: 9)" ready.
Installing Google APIs Intel x86 Atom System Image in /Users/kang/Library/Android/sdk/system-images/android-30/google_apis/x86
"Install Google APIs Intel x86 Atom System Image (revision: 9)" complete.
"Install Google APIs Intel x86 Atom System Image (revision: 9)" finished.
Preparing "Install Android SDK Platform 30 (revision: 3)".
Downloading https://dl.google.com/android/repository/platform-30_r03.zip
"Install Android SDK Platform 30 (revision: 3)" ready.
Installing Android SDK Platform 30 in /Users/kang/Library/Android/sdk/platforms/android-30
"Install Android SDK Platform 30 (revision: 3)" complete.
"Install Android SDK Platform 30 (revision: 3)" finished.
Parsing /Users/kang/Library/Android/sdk/build-tools/30.0.3/package.xml
Parsing /Users/kang/Library/Android/sdk/emulator/package.xml
Parsing /Users/kang/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/package.xml
Parsing /Users/kang/Library/Android/sdk/patcher/v4/package.xml
Parsing /Users/kang/Library/Android/sdk/platform-tools/package.xml
Parsing /Users/kang/Library/Android/sdk/platforms/android-30/package.xml
Parsing /Users/kang/Library/Android/sdk/sources/android-30/package.xml
Parsing /Users/kang/Library/Android/sdk/system-images/android-30/google_apis/x86/package.xml
Parsing /Users/kang/Library/Android/sdk/tools/package.xml
Android SDK is up to date.
Running Intel® HAXM installer
Silent installation Pass!
Creating Android virtual device
Android virtual device Pixel_3a_API_30_x86 was successfully created
```

안드로이드 스튜디오 앱 웰컴 첫 화면에서

```basic
Configure > Preferences > Plugins
Flutter 검색 후 Install > Accept > Install > Restart IDE > Restart
```

(추가) 버전 문제 관련 버그 픽스

```basic
$ ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1

(참고)
https://stackoverflow.com/questions/51860845/flutter-plugin-not-installed-error-when-running-flutter-doctor
```

안드로이드 툴체인 해결 관련

```basic
$  ~ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-KR)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses
```

```basic
$ flutter doctor --android-licenses

Warning: File /Users/kang/.android/repositories.cfg could not be loaded.
7 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)?  y

1/7: License android-googletv-license:
---------------------------------------

Accept? (y/N): y

2/7: License android-sdk-arm-dbt-license:
---------------------------------------
Accept? (y/N): y

3/7: License android-sdk-license:
---------------------------------------
Accept? (y/N): y

4/7: License android-sdk-preview-license:
---------------------------------------
Accept? (y/N): y

5/7: License google-gdk-license:
---------------------------------------
Accept? (y/N): y

6/7: License intel-android-extra-license:
---------------------------------------
Accept? (y/N): y

7/7: License mips-android-sysimage-license:
---------------------------------------
Accept? (y/N): y
All SDK package licenses accepted
```

## 3. iOS 개발환경 구축

### Xcode 설치

xcode가 설치 안되어 있는거 확인

```basic
$ flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-KR)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with is
        different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods. For more info, see
        https://github.com/flutter/flutter/issues/14293.
      To re-install CocoaPods, run:
        sudo gem install cocoapods
[✓] Android Studio (version 4.1)
[!] IntelliJ IDEA Ultimate Edition (version 2019.3.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.52.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
    ! No devices available

! Doctor found issues in 4 categories.
➜  ~
```

xcode iTunse에서 다운로드

```basic
https://itunes.apple.com/us/app/xcode/id497799835
```

xcode 앱 한번 실행 후 터미널에서 아래 코드 실행

```basic
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Password: {시스템 비밀번호}
$ sudo xcodebuild -runFirstLaunch
```

flutter doctor에서 다시 확인

```basic
$ flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with is
        different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods. For more info, see
        https://github.com/flutter/flutter/issues/14293.
      To re-install CocoaPods, run:
        sudo gem install cocoapods
[✓] Android Studio (version 4.1)
[!] IntelliJ IDEA Ultimate Edition (version 2019.3.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.52.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
    ! No devices available

! Doctor found issues in 4 categories.
➜  ~
```

CocoaPods installed but not working. 관련

```basic
$ sudo gem install cocoapods

Password:{시스템 비밀번호}
Fetching thread_safe-0.3.6.gem
Fetching tzinfo-1.2.9.gem
Fetching activesupport-<IP_ADDRESS>.gem
Fetching nap-1.1.0.gem
Fetching concurrent-ruby-1.1.7.gem
Fetching i18n-1.8.7.gem
Fetching fuzzy_match-2.0.4.gem
Fetching httpclient-2.8.3.gem
Fetching addressable-2.7.0.gem
Fetching algoliasearch-1.27.5.gem
Fetching ffi-1.14.2.gem
Fetching ethon-0.12.0.gem
Fetching typhoeus-1.4.0.gem
Fetching netrc-0.11.0.gem
Fetching public_suffix-4.0.6.gem
Fetching cocoapods-core-1.10.1.gem
Fetching claide-1.0.3.gem
Fetching cocoapods-deintegrate-1.0.4.gem
Fetching cocoapods-downloader-1.4.0.gem
Fetching cocoapods-plugins-1.0.0.gem
Fetching cocoapods-search-1.0.0.gem
Fetching cocoapods-trunk-1.5.0.gem
Fetching cocoapods-try-1.2.0.gem
Fetching molinillo-0.6.6.gem
Fetching atomos-0.1.3.gem
Fetching CFPropertyList-3.0.3.gem
Fetching colored2-3.1.2.gem
Fetching nanaimo-0.3.0.gem
Fetching xcodeproj-1.19.0.gem
Fetching escape-0.0.4.gem
Fetching fourflusher-2.3.1.gem
Fetching gh_inspector-1.1.3.gem
Fetching ruby-macho-1.4.0.gem
Fetching cocoapods-1.10.1.gem
Successfully installed concurrent-ruby-1.1.7

HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

If you are upgrading your Rails application from an older version of Rails:

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

If you are starting a NEW Rails application, you can ignore this notice.

For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0

Successfully installed i18n-1.8.7
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.9
Successfully installed activesupport-<IP_ADDRESS>
Successfully installed nap-1.1.0
Successfully installed fuzzy_match-2.0.4
Successfully installed httpclient-2.8.3
A new major version is available for Algolia! Please now use the https://rubygems.org/gems/algolia gem to get the latest features.
Successfully installed algoliasearch-1.27.5
Building native extensions. This could take a while...
Successfully installed ffi-1.14.2
Successfully installed ethon-0.12.0
Successfully installed typhoeus-1.4.0
Successfully installed netrc-0.11.0
Successfully installed public_suffix-4.0.6
Successfully installed addressable-2.7.0
Successfully installed cocoapods-core-1.10.1
Successfully installed claide-1.0.3
Successfully installed cocoapods-deintegrate-1.0.4
Successfully installed cocoapods-downloader-1.4.0
Successfully installed cocoapods-plugins-1.0.0
Successfully installed cocoapods-search-1.0.0
Successfully installed cocoapods-trunk-1.5.0
Successfully installed cocoapods-try-1.2.0
Successfully installed molinillo-0.6.6
Successfully installed atomos-0.1.3
Successfully installed CFPropertyList-3.0.3
Successfully installed colored2-3.1.2
Successfully installed nanaimo-0.3.0
Successfully installed xcodeproj-1.19.0
Successfully installed escape-0.0.4
Successfully installed fourflusher-2.3.1
Successfully installed gh_inspector-1.1.3
Successfully installed ruby-macho-1.4.0
Successfully installed cocoapods-1.10.1
Parsing documentation for concurrent-ruby-1.1.7
Installing ri documentation for concurrent-ruby-1.1.7
Parsing documentation for i18n-1.8.7
Installing ri documentation for i18n-1.8.7
Parsing documentation for thread_safe-0.3.6
Installing ri documentation for thread_safe-0.3.6
Parsing documentation for tzinfo-1.2.9
Installing ri documentation for tzinfo-1.2.9
Parsing documentation for activesupport-<IP_ADDRESS>
Installing ri documentation for activesupport-<IP_ADDRESS>
Parsing documentation for nap-1.1.0
Installing ri documentation for nap-1.1.0
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for httpclient-2.8.3
Installing ri documentation for httpclient-2.8.3
Parsing documentation for algoliasearch-1.27.5
Installing ri documentation for algoliasearch-1.27.5
Parsing documentation for ffi-1.14.2
Installing ri documentation for ffi-1.14.2
Parsing documentation for ethon-0.12.0
Installing ri documentation for ethon-0.12.0
Parsing documentation for typhoeus-1.4.0
Installing ri documentation for typhoeus-1.4.0
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for public_suffix-4.0.6
Installing ri documentation for public_suffix-4.0.6
Parsing documentation for addressable-2.7.0
Installing ri documentation for addressable-2.7.0
Parsing documentation for cocoapods-core-1.10.1
Installing ri documentation for cocoapods-core-1.10.1
Parsing documentation for claide-1.0.3
Installing ri documentation for claide-1.0.3
Parsing documentation for cocoapods-deintegrate-1.0.4
Installing ri documentation for cocoapods-deintegrate-1.0.4
Parsing documentation for cocoapods-downloader-1.4.0
Installing ri documentation for cocoapods-downloader-1.4.0
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-search-1.0.0
Installing ri documentation for cocoapods-search-1.0.0
Parsing documentation for cocoapods-trunk-1.5.0
Installing ri documentation for cocoapods-trunk-1.5.0
Parsing documentation for cocoapods-try-1.2.0
Installing ri documentation for cocoapods-try-1.2.0
Parsing documentation for molinillo-0.6.6
Installing ri documentation for molinillo-0.6.6
Parsing documentation for atomos-0.1.3
Installing ri documentation for atomos-0.1.3
Parsing documentation for CFPropertyList-3.0.3
Installing ri documentation for CFPropertyList-3.0.3
Parsing documentation for colored2-3.1.2
Installing ri documentation for colored2-3.1.2
Parsing documentation for nanaimo-0.3.0
Installing ri documentation for nanaimo-0.3.0
Parsing documentation for xcodeproj-1.19.0
Installing ri documentation for xcodeproj-1.19.0
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for fourflusher-2.3.1
Installing ri documentation for fourflusher-2.3.1
Parsing documentation for gh_inspector-1.1.3
Installing ri documentation for gh_inspector-1.1.3
Parsing documentation for ruby-macho-1.4.0
Installing ri documentation for ruby-macho-1.4.0
Parsing documentation for cocoapods-1.10.1
Installing ri documentation for cocoapods-1.10.1
Done installing documentation for concurrent-ruby, i18n, thread_safe, tzinfo, activesupport, nap, fuzzy_match, httpclient, algoliasearch, ffi, ethon, typhoeus, netrc, public_suffix, addressable, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-trunk, cocoapods-try, molinillo, atomos, CFPropertyList, colored2, nanaimo, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods after 35 seconds
34 gems installed
➜  ~
```

flutter doctor 다시 확인

```basic
$ flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Android Studio (version 4.1)
[!] IntelliJ IDEA Ultimate Edition (version 2019.3.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.52.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.
➜  ~
```

Xcode 라이센스 관련

```basic
$ sudo xcodebuild -license

~~~~
스페이스 쭈욱 누르다가 agree 누르면 됨
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]   {agree}

You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf
```

시뮬레이터 실행 테스트

```basic
$ open -a Simulator
```

### iOS 기기 배포 관련 추가사항

CocoaPods 설치

```basic
$ sudo gem install cocoapods

Password: {시스템 비밀번호}
Successfully installed cocoapods-1.10.1
Parsing documentation for cocoapods-1.10.1
Done installing documentation for cocoapods after 1 seconds
1 gem installed
➜  ~
```

안드로이드 스튜디오에서 만들었던 프로젝트 내 폴더에 pod 설치

```basic
$ cd Documents/AndroidStudioProjects/testing_flutter/ios
$ pod init
$ ios pod install

Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.

[!] The Podfile does not contain any dependencies.

[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig` in your build configuration (`Flutter/Debug.xcconfig`).

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
➜  ios
```

## InterlliJ IDE에 Flutter 설치

인텔리제이 앱 웰컴 첫 화면에서

```basic
Configure > Preferences > Plugins
Flutter 검색 후 Install > Restart IDE > Restart
```

flutter doctor에서 확인

```basic
$ flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.6 19G73 darwin-x64, locale en-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.5)
[!] VS Code (version 1.52.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.
➜  ~
```

## Visual Studio Code에 Flutter 설치

- View > Extensions 누르면 비쥬얼 스튜디오 마켓 플레이스가 나온다.
- 검색창에 Flutter 설치 하기(+@ Dart 언어도 자동으로 함께 설치된다.)

## Visual Studio Code에서 Flutter 시작하기

- View > Command Palette > 검색창 > Flutter: New Application Project
- 플러터 앱 프로젝트를 생성할 폴더 지정 > 프로젝트 명 지정(시작은 알파벳 소문자로 시작해야함)
- 기본 환경 구성이 세팅된다. 개발시작!

## 개발환경 구축 완료 :)
<img width="1680" alt="Screen Shot 2021-01-11 at 0 13 33" src="https://user-images.githubusercontent.com/59175609/106360765-c13c6080-635d-11eb-9a2e-da950bb09ac6.png">
<img width="1680" alt="Screen Shot 2021-01-11 at 0 32 50" src="https://user-images.githubusercontent.com/59175609/106360769-c7cad800-635d-11eb-9421-2bc07f378cb1.png">

## 참고
- 유튜브 강의 : [https://youtu.be/3JMjR_ahT44](https://youtu.be/3JMjR_ahT44])
- 개발자님들 덕분에 많이 배울 수 있었습니다. 감사의 말씀드립니다.<br/>

extension: markdown


text:
# Contributing to tobac

__Welcome! We are very happy that you are interested in our project and thanks for taking time to contribute! :)__

We are currently reorganizing our project. So, please check our modifications later.

## Getting Started
### Installation & Environment details
You will find them in the [README.md](https://github.com/climate-processes/tobac/blob/master/README.md).

### Tutorials
Tutorials have been prepared to provide you further inside to `tobac`s functionality. Please visit the separate [tobac-tutorials](https://github.com/climate-processes/tobac-tutorials) repository here on Github.

### Documentation
You will find our documentation at [https://tobac.readthedocs.io](https://tobac.readthedocs.io).

### Testing
The tests are located in the [tests folder](https://github.com/climate-processes/tobac/tree/master/tobac/tests).

## Reporting Bugs
Please create a new issue on [GitHub](https://github.com/climate-processes/tobac/issues) if it is not listed there, yet.

### How to write a good Bug Report?
* Give it a clear descriptive title.
* Copy and paste the error message.
* Describe the steps for reproducing the problem and give an specific example.
* Optional: Make a suggestion to fix it.

## How to Submit Changes
* Please read the [README.md](https://github.com/climate-processes/tobac/blob/master/README.md) first, to learn about our project goals and check the [changelog.md]().
* Before you start a pull request, please make sure that you added [numpydoc docstrings](#docstringExample) to your functions. This way the api documentation will be parsed properly.
* If it is a larger change or an newly added feature or workflow, please place an example of use in the [tobac-tutorials](https://github.com/climate-processes/tobac-tutorials) repository or adapt the existing examples there.
* If necessary add a folder or modify a file.
* The code should be PEP 8 compliant, as this facilitates our collaboration. Please use the first stable version (22.6.0) of [black](https://black.readthedocs.io/en/stable/) to format your code. When you submit a pull request, all files are checked for formatting.
* The tobac repository is set up with pre-commit hooks to automatically format your code when commiting changes. Please run the command "pre-commit install" in the root directory of tobac to set up pre-commit formatting.

We aim to respond to all new issues/pull requests as soon as possible, however at times this is not possible due to work commitments.

### Numpydoc Example <a name='docstringExample'>
```python

   '''
   calculate centre of gravity and mass forech individual tracked cell in the simulation

    Parameters
    ----------
    tracks : pandas.DataFram
        DataFrame containing trajectories of cell centres

    param mass : iris.cube.Cube
        cube of quantity (need coordinates 'time', 'geopotential_height','projection_x_coordinate' and
        'projection_y_coordinate')

    param mask : iris.cube.Cube
        cube containing mask (int > where belonging to cloud volume, 0 everywhere else )

    Returns
    -------
    track_out : pandas.DataFrame
        Dataframe containing t,x,y,z positions of centre of gravity and total cloud mass each tracked cells
        at each timestep

    '''

```

## Slack
In addition to the workflow here on Github, there's a tobac workspace on Slack [tobac-dev.slack.com](tobac-dev.slack.com) that we use for some additional communication around the project. Please join us there to stay updated about all things tobac that go beyond the detailed work on the code.

repository: tobac-project/tobac

gha_language: Python

repo_name: tobac-project/tobac


text:
## latomtyper.py

* Source:

 	[click here](https://github.com/leucinw/ComputTools/tree/master/src/latomTyper.py)

* Usage:

	```shell
	python latomtyper.py -xyz XYZ -prm PRM -idx IDX [-fun {AMOEBA,AMOEBAPLUS}]
	```

* Intro:

	This program is used to change the atom index of tinker `xyz` and `key`/`prm` files to the one specified by users.

repository: leucinw/ComputTools

repo_name: leucinw/ComputTools


text:
---
title: 'A-NITI AAYOG: A retrospective series - Part 1'
subtitle: 'Should I write this series at all?'
summary: Too much to tell. Too little courage?
authors:
- admin
tags:
- Work
- NITI Aayog
categories:
- NITI Aayog
date: "2020-09-02T00:00:00Z"
lastmod: "2020-09-02T00:00:00Z"
featured: true
draft: false

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Placement options: 1 = Full column width, 2 = Out-set, 3 = Screen-width
# Focal point options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
image:
  placement: 3
  # caption: 'Image credit: [**Unsplash**](https://unsplash.com/photos/CpkOjOcXdUY)'
  focal_point: ""
  preview_only: true

# Projects (optional).
#   Associate this post with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `projects = ["internal-project"]` references `content/project/deep-learning/index.md`.
#   Otherwise, set `projects = []`.
projects: []
---

### 3 questions to answer before I begin

It's very difficult to write about a previous employer, especially if that employer happens to be the Government. Over the duration of the employment, one is likely to hear or witness actions that are questionable. The questions that I ponder over -

1. Should I write about my experiences?
2. Can I write my experiences without "solid proof"? (The proof is in my head!)
3. Will anything happen to me if I proceed with this?

#### Should I write?

To be honest, these are difficult questions. Am I thinking too high of myself to assume that anything I have to say is of any importance? After all, I was only a _Young Professional_ at NITI Aayog, and only for an year. There are people with more experience, higher in the pecking order at that institution who I'm sure will have even better stories than mine. However, as these are *my* experiences, it's important to *me*.

1. Should I write about my experiences? - Yes. I can, and I will. Whether it'll end up being important to others is not in my hands. I want to document my experiences somewhere, and this blog is a place I've identified for the purpose.

#### What about proof?

The second question takes us to uncertain territory. Can I write about certain experiences without "solid proof"? And by solid proof, I mean any material, the veracity of which can be ascertained by a third-party - independent individuals or organisations. This may not be always possible. I didn't carry around a secret recorder to capture everything I ever witnessed or heard. As readers, you may have to take a leap of faith and assume that what I report is true. However, I'll try to give evidence backing the claims made wherever available.

2. Can I write my experiences without "solid proof?" - Yes, because my experiences are real to me and true to the best of my knowledge. I don't practice in the art of fake news. Nevertheless, I'll try to provide evidence wherever possible.

#### Will I be alright?

Final question is truly unpredictable. Again, the doubt in my mind is this - am I thinking too high of myself? Will the government even care about what some guy with only 1 year of work-ex with that organisation has to say? I mean, there are secrets or actions that are a zillion times more problematic, unethical, immoral, and plain wrong that goes on in this country. Why should the government care? May be they won't. However, if I do end up proceeding with this, I may end up burning bridges with a few good people I worked with at NITI Aayog. Is it worth it?

3. Will anything happen to me if I proceed with this? - TBH I don't know. Life is unpredictable. Governments are unpredictable. Of one thing, I'm certain. I'll definitely lose my friendship with minimum 1 individual, even without naming that individual in any of my posts. Let's see.

### Final thoughts

So yes, I'm going to write about my time at NITI Aayog. Some of the posts in this series are gonna be about the friends I made, the work I did, and in general positive things. Even now, I think I have that naivety in me to believe that the positives in life outweighs the negatives. Some of the posts are about the questionable things I saw or heard at work. Strap in!

repository: raisasherif/arunblog

repo_name: raisasherif/arunblog


text:
---
layout: post
title: August 28, 2007 - Jesus Every Day
categories: [Verse of the Day]
alias: [/VerseOfTheDay/2007/08/28/]
---

_I Thessalonians 4:12
That ye may walk honestly toward them that are without, and that ye
may have lack of nothing._

This idea includes honest financial transactions, but a good deal
more. People outside of Christ have a right to watch the conduct of
professing Christians in business life, domestic life, social life,
political life, etc., and expect to see the evidence of the presence,
person, and power of Jesus Christ at work. Then, in living for Christ,
we have the promise of His provision as well.

 --

Jesus Every Day is a ministry of Rodgers Baptist Church in Garland, Texas.


text:
# NixDOS
A tiny OS boots from a X86 (we tested on Intel 386 - Pentium II/III ) we wrote this in 2002
 It’s a small disk based operating system developed for the research purpose.
 It consists of
           “bootstrap loader”,
           “its own loader”,
           “Kernel” and “Shell”.
Languages used are “Assembly” and “C”,
development environment was windows98SE with Turbo C compiler.

Black hat libraries were written in Assembly language and embedded with the Clanguage.
File formats used are “.EXE” and “.COM”
Hardware  supports and  Drivers:   1.44MB floppy  disk,  PIC,  Keyboard controller,Graphics driver and printer driver.
Memory access capacity of 1MB, with the paging size of 16KB and takes 5-6 sec toboot.

repository: harshagowda/NixDOS

repo_name: harshagowda/NixDOS


text:
# Tfjs google/spice/2/default/1

TFJS deployment of SPICE model.

<!-- asset-path: legacy -->
<!-- parent-model: google/spice/2 -->

## Description

A mobile-compatible pitch extraction model to recognize the dominant pitch in
sung audio. Trained (in a self-supervised way) on the
[MIR-1k](https://sites.google.com/site/unvoicedsoundseparation/mir-1k) dataset.
Compared to v1 of the same model, v2 was trained on mixed tracks (including both
singer and background music), which makes it more robust to background music and
noise.

Note that the v2 model is also significantly larger (2.3M parameters compared to
180k for v1).

## Inputs

Audio sample data: A javascript array of floats representing mono audio at 16
kHz sampling rate. The array length should be a multiple of 512 (32ms at 16kHz
sampling rate). The model normalizes the range of the input (it computes a
[CQT](https://en.wikipedia.org/wiki/Constant-Q_transform) and takes the
normalized result as input).

## Outputs

Two float arrays containing pitch and uncertainty. For array sizes and more
details on how to interpret the output values see the
[main SPICE model page](https://tfhub.dev/google/spice/2) for details.

## Usage
JS code for a minimal demo:

```js
<script src="https://cdn.jsdelivr.net/npm/<EMAIL_ADDRESS><script>
const NUM_INPUT_SAMPLES = 1024;
const MODEL_SAMPLE_RATE = 16000;
const PT_OFFSET = 25.58
const PT_SLOPE = 63.07
const CONF_THRESHOLD = 0.9;
const MODEL_URL = 'https://tfhub.dev/google/tfjs-model/spice/2/default/1'
let model;

async function startDemo() {
  model = await tf.loadGraphModel(MODEL_URL, { fromTFHub: true });
  navigator.mediaDevices.getUserMedia({ audio: true, video: false })
    .then(handleSuccess).catch(handleError);
}

function handleError(err) {
  console.log(err);
}

function getPitchHz(modelPitch) {
  const fmin = 10.0;
  const bins_per_octave = 12.0;
  const cqt_bin = modelPitch * PT_SLOPE + PT_OFFSET;
  return fmin * Math.pow(2.0, (1.0 * cqt_bin / bins_per_octave))
}

function handleSuccess(stream) {
  let context = new AudioContext({
    latencyHint: "playback",
    sampleRate: MODEL_SAMPLE_RATE,
  });

  let source = context.createMediaStreamSource(stream);
  let processor = context.createScriptProcessor(
        NUM_INPUT_SAMPLES,
        /*num_inp_channels=*/ 1,
        /*num_out_channels=*/ 1);

  // Converts audio to mono.
  processor.channelInterpretation = 'speakers';
  processor.channelCount = 1

  // Runs processor on audio source.
  source.connect(processor);
  processor.connect(context.destination);

  processor.onaudioprocess = function(e) {
    const inputData = e.inputBuffer.getChannelData(0);
    const input = tf.reshape(tf.tensor(inputData), [NUM_INPUT_SAMPLES])
    output = model.execute({"input_audio_samples": input });
    const uncertainties = output[0].dataSync();
    const pitches = output[1].dataSync();

    for (let i = 0; i < pitches.length; ++i) {
      let confidence = 1.0 - uncertainties[i];
      if (confidence < CONF_THRESHOLD) {
        continue;
      }
      console.log(getPitchHz(pitches[i]));
    }
  }
}

// This needs a microphone to work, check for exceptions.
startDemo();
</script>
```

## Benchmarks

Benchmarks for the TFJS deployment of google/spice/2/default/1.

**Model Size (on disk):** 8.4 MB


text:
# Example JSON VSCode extension with example Pygls Language Server

This is a slightly more detailed example Language Server than the Hello World one. Like Hello World, it uses LSP Completions as its central feature, but adds some long-running background work to demonstrate methods to handle asynchronicity and progress notifications.

Although we include a complete VSCode client here, you may also be interested in Microsoft's [client template for Python tools](https://github.com/microsoft/vscode-python-tools-extension-template). It is focussed on Python-related Language Server tooling, but it is specifically tailored to Pygls, so may have some unique insights.

## Install Server Dependencies

1. `python -m venv env`
1. `python -m pip install -e .` from root directory
1. Create `.vscode/settings.json` file and set `python.interpreterPath` to point to your python environment where `pygls` is installed

## Install Client Dependencies

Open terminal and execute following commands:

1. `npm install`
1. `cd client/ && npm install`

## Run Example

1. Open this directory in VS Code
1. Open debug view (`ctrl + shift + D`)
1. Select `Server + Client` and press `F5`

repository: openlawlibrary/pygls

repo_name: openlawlibrary/pygls


text:
# springboot-jersey-swagger

[![Build Status](https://travis-ci.org/brightzheng100/springboot-jersey-swagger.svg?branch=master)](https://travis-ci.org/brightzheng100/springboot-jersey-swagger)

This is a proof-of-concept project to build RESTful web services by integrating below components:
 - [Spring Boot](http://projects.spring.io/spring-boot/) - The foundation of our web app which uses below sub projects
   - org.springframework.boot:spring-boot-starter
   - org.springframework.boot:spring-boot-starter-web
   - org.springframework.boot:spring-boot-starter-actuator
   - org.springframework.boot:spring-boot-starter-jersey
   - org.springframework.boot:spring-boot-starter-jdbc
   - org.springframework.boot:spring-boot-starter-log4j2
 - [Spring Session](https://projects.spring.io/spring-session/) - The abstraction layer for session + distributed cache (e.g. Redis)
 - [Spring Cloud Connector](https://cloud.spring.io/spring-cloud-connectors/) - connecting to services and gaining operating environment awareness in cloud environments
   - org.springframework.cloud:spring-cloud-spring-service-connector
   - org.springframework.cloud:spring-cloud-cloudfoundry-connector
 - [Jersey](https://jersey.java.net/) - The JAX-RS reference implementation for building RESTful web services
 - [Swagger](https://github.com/swagger-api/swagger-ui) - The de-facto API documentation framework
 - [Flyway](https://flywaydb.org/) - Database migrate/upgrade automation

For testing, we use below components:
 - Spring Boot Test Framework (spring-boot-starter-test) with Junit, Hamcrest
 - [Rest Assured](https://github.com/rest-assured/rest-assured)

# Takeaways
 - How To Integrate Spring Boot, Jersey, Swagger, Spring Session, Spring Cloud Connector, and Flyway to build real world JSON-based RESTful web services
 - Unit Test practices for RESTful API testing

# Before You Start It Up

There is a dependency on Redis, as the cache by default, and I don't want to make it an embedded service, so before you start it up, do this:

```
$ curl -OL http://download.redis.io/releases/redis-4.0.8.tar.gz
$ tar xzf redis-4.0.8.tar.gz
$ cd redis-4.0.8
$ make
$ src/redis-server
```

> Note: to clean up previsouly cached data, try `src/redis-cli -h localhost -p 6379 flushall`

# Start It UP

Check out the code and execute below commands:

```
$ mvn package
$ java -Dspring.profiles.active=dev -jar target/springboot-jersey-swagger-1.0.0-SNAPSHOT.jar
```

> Note: activate `dev` profile while running locally.

# Play With the Web Services by CLI

## Hello World APIs

```
$ curl -X GET http://localhost:8080/api/v1/hello/Bright
{"msg":"Hello Bright - application/json"}
```

## Cache APIs: showcase how to build APIs around distributed cache

```
$ curl -X POST "http://localhost:8080/api/v1/cache" -H "Content-Type: application/json" -d "{ \"id\": 123, \"name\": \"Bright\", \"passportNumber\": \"G123456\"}"

$ curl -X GET "http://localhost:8080/api/v1/cache/123"
{"id":123,"name":"Bright","passportNumber":"G123456"}
```

To view Redis cache:

```
$ src/redis-cli -h localhost -p 6379
$ localhost:6379> keys *
1) "bright.zheng.poc.api.model.Student:123"
2) "bright.zheng.poc.api.model.Student"
3) "bright.zheng.poc.api.model.Student:123:phantom"
...
```

## Session APIs: showcase how to build session-based conversations on top of distributed cache

This one is easy to play with Swagger UI as session id is reused automatically in browser.
For cli, we need to prepare the cookie file (refer to [cookies.txt](https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg) in Chrome) before playing with the APIs.

```
$ curl --cookie ~/temp/cookies.txt -X PUT "http://localhost:8080/api/v1/sessions/user1?value=ABC" -H "accept: application/json"

$ curl --cookie ~/temp/cookies.txt -X GET "http://localhost:8080/api/v1/sessions/user1"
{"user1":"ABC"}

$ curl --cookie ~/temp/cookies.txt -X GET "http://localhost:8080/api/v1/sessions"
{"user1":"ABC"}
```

## Student APIs: showcase JDBC-backed APIs

```
$ curl -X GET "http://springboot-jersey-swagger.cfapps.io/api/v1/students/" -H "accept: application/json"
[{"id":10001,"name":"Ranga","passportNumber":"E1234567"},{"id":10002,"name":"Ravi","passportNumber":"A1234568"},{"id":10003,"name":"Bright","passportNumber":"C1234568"}]

$ curl -X GET "http://springboot-jersey-swagger.cfapps.io/api/v1/students/10003"
{"id":10003,"name":"Bright","passportNumber":"C1234568"}
```

# Check Out the Swagger UI

Open a browser and key in URL:

```
$ open http://localhost:8080/swagger/index.html
```

![swagger-ui](swagger-ui.png "Swagger UI")

> Note:
> - All the APIs can be playing through the UI
> - Do switch the Schemes to "https" if you're using https protocol like in [Pivotal Web Services](https://run.pivotal.io)

# Cloud Ready?

Yes, it's totally ready to be deployed to cloud.
For example, deploying to [Pivotal Web Services](https://run.pivotal.io) is just some commands away:
```
$ cf create-service rediscloud 30mb redis-for-springboot-jersey-swagger
$ cf create-service cleardb spark mysql-for-springboot-jersey-swagger
$ cf services
...
name                                  service      plan    bound apps                  last operation
mysql-for-springboot-jersey-swagger   cleardb      spark   springboot-jersey-swagger   create succeeded
redis-for-springboot-jersey-swagger   rediscloud   30mb    springboot-jersey-swagger   create succeeded

$ cf push -f manifest-qa-with-services.yml
$ cf apps
...
name                        requested state   instances   memory   disk   urls
springboot-jersey-swagger   started           1/1         1G       1G     springboot-jersey-swagger.cfapps.io
# open https://springboot-jersey-swagger.cfapps.io/swagger/index.html
```

> Note:
> - For Redis, the `30mb` plan of `rediscloud` is **free**
> - For MySQL, the `spark` plan of `cleardb` is **free**

# Blog

[From Code To Online Services: My experiments of DevOps - Development of RESTful Web Services by Spring Boot, Jersey, Swagger](http://bright-zheng.blogspot.com/2016/06/Development-of-RESTful-WebServices-by-SpringBoot-Jersey-Swagger.html)

repository: daoleili/springboot-jersey-swagger

repo_name: daoleili/springboot-jersey-swagger


text:
# The Vue File Template

* template, script and style
* only one tag at the root (like `<div`)

Single file components split your markup from your business logic and from your styles. This means you don't have to mix your CSS into your HTML or have plain JavaScript in your templates.

With this separation, you'll have them split apart which is especially useful when you want to keep your components siloed and isolated or when you want to do code splitting for components, so a component only loads additional resources when it is needed.

Another advantage is that you can specify languages per component and code type. You can use Typescript for the `<script>` tag and another templating engine like `jade/pug` and `sass` for css, but you don't have to define that globally if your components have different needs.


text:
### [CVE-2019-18978](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-18978)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

An issue was discovered in the rack-cors (aka Rack CORS Middleware) gem before 1.0.4 for Ruby. It allows ../ directory traversal to access private resources because resource matching does not ensure that pathnames are in a canonical format.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon

repository: trickest/cve

repo_name: trickest/cve


text:
---
layout: post
title: 3m
---

Businessmodel of 3M
--------------------

### Customer Segments

3M has a diversified market business model, with customers that have very different needs. The company targets its offerings at consumers, businesses, and government agencies.

### Value Proposition

3M offers three primary value propositions: accessibility, innovation, and brand/status.

The company creates accessibility by offering a wide range of options. It markets over 60,000 products that are used in homes, schools, businesses, hospitals, governments, and more. These items are divided into 12 areas of expertise: automotive, commercial solutions, communications, consumer, design and construction, electronics, energy, health care, manufacturing, mining, oil & gas, safety and transportation. In short, 3M sells something for everyone.

The company has embraced innovation throughout its history and continues to do so. It invests 5.8% of its revenues in research and development. This funding helps produce over 3,000 patents annually and a constant stream of new, cutting-edge products. In fact, one-third of its sales derive from products that were invented within the past five years. Examples of its innovations are as follows:

 * The first waterproof sandpaper, which reduced airborne dust during auto manufacturing
* The first masking tape, which eventually led to Scotch Pressure-Sensitive Tapes
* The first disposable toilet scrubber with built-in bleach
* Post-it notes, which introduced an entire new category in the marketplace
 In 2016 3M opened a state-of-the-art, $150-million R&D laboratory on its Minnesota campus.

The company has established a powerful brand due to its success. It maintains operations in 70 countries and sales in 200. It has 46 technology platforms, and introduced a number of brands that have become household names, including Scotch tape, Post-it notes, Filtrete, and Command. Lastly, it has won many honors, including placing on the “Best Companies for Leaders” list by *Chief Executive* (2015), ranking 12th on *Forbes’ *“World’s Most Respected Companies” list (2015), placing on Interbrand’s “Best Global Brands” list (2014), and being named a “Great Place to Work” (2014).

### Channels

3M’s main channels are its website and retailers, wholesalers, distributors, dealers, and jobbers. The company promotes its offering through its social media pages, advertising, and conferences.

### Customer Relationships

3M’s customer relationship is primarily of a self-service nature.

Customers use its products while having limited interaction with employees. The company’s website provides answers to frequently asked questions. That said, there is a personal assistance component in the form of phone, e-mail, and live chat support.

### Key Activities

3M’s business model entails designing, developing, and manufacturing its products for consumers. The company relies on third-party manufacturers for some of its products, but does not specify their identities.

### Key Partners

3M’s main partners are the retailers, wholesalers, distributors, dealers, and jobbers that sell its products.

Partners also include suppliers for its parts and third-party manufacturers. Suppliers have access to Supplier Direct, a portal that provides helpful references, documents, forms, and links.

### Key Resources

3M’s main resources are its research and development staff members, who include over 8,500 scientists and researchers worldwide.  Important physical resources include its labs in 36 countries and manufacturing facilities in 29 countries.

Lastly, the company places a high priority on intellectual property, with 46 technology platforms, 106,151 total patents, and 3,000 new patents each year.

### Cost Structure

3M has a cost-driven structure, aiming to minimize expenses through low-price value propositions.

Its biggest cost driver is cost of sales, a variable expense that includes engineering, manufacturing, and freight costs. Other major drivers are in the areas of sales/administration and research and development, both fixed costs.

### Revenue Streams

3M has one revenue stream: revenues generated from the sales of its products to customers.


text:
### NAME

The _gridmapdir_ component manages the gridmapdir directory.

### DESCRIPTION

The _gridmapdir_ component manages the gridmapdir directory used for the
mapping of pool accounts.

### RESOURCES

#### gridmapdir (required)

The location of the configuration file.  Normally this should not be
changed.

#### poolaccounts (required)

An nlist with the pool account prefix as the name and a long as the
size of the pool.

#### sharedGridmapdir : string (optional)

If defined must indicate the path of a shared gridmapdir. In this case, gridmapdir as defined in 'gridmapdir' property
is made a symlink of this directory.

### DEPENDENCIES

None.

### BUGS

None known.

Charles Loomis <>

Michel Jouvin <>

### VERSION

2.0.1

### SEE ALSO

ncm-ncd(1)

repository: wdpypere/documentation

repo_name: wdpypere/documentation