text:
# Contributing

Contributions are welcome, and this document details how changes can be made and submitted,
and eventually included in a release. We use monorepo tooling, and a git setup for automatically releasing
new versions based on commit messages.

Please note we have a [code of conduct](./CODE_OF_CONDUCT.md).

## Making changes

Make the changes to the package(s) you want to change, and commit them to a fork or branch. Commits
need to follow [proper commit
messages](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).
The commit messages are used to automatically bump the versions of changed packages, and write
automatic changelogs. See the [Releases & Versioning](#releases--versioning) section below about
releasing changes.

We use semantic versioning, with versions `MAJOR.MINOR.PATCH`.

- For fixes, start the commit with `fix: msg` or `fix(topic): msg`. This will bump PATCH.
- For features, start the commit with `feat: msg` or `feat(topic): msg`. This will bump MINOR.
- For changes that break backwards compatibility, add `BREAKING CHANGE: description` to the footer.
  This will bump MAJOR version.

Note that using `<type>!: msg` **is not supported**, it will actually break the semantics of some
types. `feat!: msg` will result in a _patch_ release, not major. `<type>!: msg` [is a
thing](https://www.conventionalcommits.org/en/v1.0.0/) but that is _not_ supported by the
implementation used in this repo.

Also note that a major version upgrades are _not_ propagated up the dependency tree. If you do a
breaking change in `@cognite/sdk-core` it will get a major version bump, if you use the `BREAKING CHANGE: desc` footer. However, packages that depends on `@cognite/sdk-core` will only get a patch
upgrade. So if you do a breaking change to a non-top level package and also want to get major
version bump of the upstream packages you have to ensure that manually. This can be done in two
ways, run `lerna version major` or do a inconsequential change to the top level packages. If you do
_any_ change to the top packages (including the smallest white space cleanup), it will all be
covered by the `BREAKING CHANGE: msg` commit, leading them to all get a major version bump.

- For extra details in the changelog, you can specify a scope like so: `feat(assets): `.
- For other changes there are types without version bumping semantics:
  - `docs: ` changes to documentation
  - `build: ` changes to build scripts and config
  - `ci: ` changes to ci scripts and pipeline
  - `refactor: ` code moving and renaming
  - `style: ` fixes to code style
  - `test: ` changes to tests
  - `perf: ` changes to improve performance
  - `revert: ` changing things back
  - `chore: ` miscelanious changes

#### Example

```
docs(contributing-readme): add example of commit with subject line
```

A commit hook makes sure the syntax is followed.

## Code generation

This SDK support generating TypeScript types from the Cognite OpenAPI document.
The idea is to use the OpenAPI document as a source of truth and to automate
part of the process. Any incorrect or missing types should be fixed/added
in the OpenAPI document instead of manually adjusting the generated types.
This also helps to keep documentation up to date.

Use the command `yarn codegen` for available commands.

More details are documented in the [codegen README](packages/codegen/README.md).

## Pull request

Make a pull request from your branch to the main branch. When merging the pull request,
only use squashing if the resulting squash commit can accurately describe the change as a single conventional commit.
Once the change is pushed to the main branch, it is time for a release.

## Releases & Versioning

Releases are done from the main branch, so when a pull request is merged,
CI/CD will run tests, and if successful, do deploys.
Documentation is built and deployed, and code snippets
are exported to the service contract repo as a pull request.

Updating and uploading npm packages only happens if the HEAD commit of the main branch
contains `[release]` in its description or the PR title starts with `feat` or `fix`.
When CI/CD sees this, it will use lerna to update
package versions of changed packages based on commit messages, and add the
changes to the changelogs. The changes are comitted to the main branch
with the new versions as git tags, and the new package versions are uploaded to npm.

We restrict new npm releases to `[release]`-tagged commits because lerna is
quite aggressive in its versioning. Changes to any file not ignored by lerna will
cause a PATCH bump. Markdown files and tests are ignored, but changing anything else,
like a comment in a source file, will trigger a new version,
irrespective of conventional commits.

This does _not_ mean you should store unfinished work on the main branch.
Another package may be ready for release, and once a `[release]`
commit is pushed, all changed packages are updated.
Repository administrators should be in control of `[release]` commits.

To add a release commit to a clean working tree, use the command

```bash
git checkout master
git pull
git commit --allow-empty -m "chore: trigger [release]"
git push
```

If you want to push the empty commit to master via a pull request,
use a squash merge (not rebase+ff). Otherwise GitHub will ignore the empty PR.

Also, keep in mind that the `[release]` commit has to be the HEAD of
main, and Github Action only runs on the HEAD. If HEAD has changed by the time
the versioning happens, Github Action will fail.

## Patching older major versions

If you need to backport a fix to a previous MAJOR version of a package,
you have to do it manually.

Let's say you want to make a fix to `@cognite/sdk-core@2`,
after `<EMAIL_ADDRESS>is already published.

First check if there already is a backporting branch called `<EMAIL_ADDRESS>
```bash
git fetch
git checkout<EMAIL_ADDRESS>```

If there isn't, make it based on the latest release of MAJOR version 2.
You can look at git tags to find the last release.

```bash
git fetch --all --tags
git tag | grep @cognite/sdk-core@2.
```

Let's say `2.38.1` was the last release before `3.0.0`.
We make a branch based on it for all backporting needs.

```bash
git checkout tags/<EMAIL_ADDRESS>-b<EMAIL_ADDRESS>```

Now we have a branch for our changes, in case we later need to backport more things.
In this branch, make your changes, and push them to GitHub.
We are not using CI/CD for publishing, but by pushing changes we can at least
see automated tests run on the branch. Make sure they pass!

Once you are ready to make the new version, and have pushed everything to git,
open a terminal in the root of the project and run:

```bash
yarn
yarn build
```

Then go to `packages/core` (or whatever package you are backporting to), and run:

```bash
npm version patch -m "backport fix to %s for reasons"
npm publish
git push && git push --tags
```

This will make a commit with the updated `package.json`, create a new git tag, and publish to npm.
Make sure you are logged in to npm, talk to a maintainer.

repository: cognitedata/cognite-sdk-js

gha_language: TypeScript

repo_name: cognitedata/cognite-sdk-js


text:
# CGPraktikum
Repositories for the course **Computer Graphics I** at the Eberhard Karls University Tübingen.

## Setup

(Does not fully work yet)

```bash
ssh<EMAIL_ADDRESS># (or cgcontact first if not in wsi network)

pip install virtualenv --user
pip install virtualenvwrapper --user

nano ~/.profile
```

Add the following lines to the file:

```
export PATH="/graphics/projects/cuda/toolkit_deeplearning/cuda/bin:$HOME/.local/bin:$PATH"
export LD_LIBRARY_PATH="/graphics/projects/cuda/toolkit_deeplearning/cuda/lib64:$LD_LIBRARY_PATH"
export PYTHONPATH="$HOME/.local/lib/python2.7/site-packages:$PYTHONPATH"
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/PCG
source $HOME/.local/bin/virtualenvwrapper.sh
export CUDA_VISIBLE_DEVICES='0'
```

(note the addition of PYTHONPATH compared to the tutorial in ILIAS)
Press `Ctrl+O`, `Enter` and `Ctrl+X` to save/exit the profile

Then (everytime you log on), type:

```bash
source ~/.profile
mkvirtualenv env
```

to start the environment.
The first time in the environment, install tensorflow:

```
easy_install -U pip        #ensure pip version
pip install --user --upgrade tensorflow-gpu
pip install --user -U git+https://github.com/ppwwyyxx/tensorpack.git
```

This should install tensorflow aswell as tensorpack (tensorpack didn't work for me without adding site-packages directory to $PYTHONPATH).

Test if it is correctly installed using

```python
import tensorflow as tf
from tensorpack import *
```

If this doesn't fail, the packages should be installed correctly

- tensorflow getting started: https://www.tensorflow.org/get_started/get_started

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# matestack core component: Transition

Show [specs](/spec/usage/components/transition_spec.rb)

## Parameters

Except for `id` and `class`, the transition component can handle additional parameters:

### Path

As the name suggests, the `options[:path]` expects a path within our application. If you want to rout to a link outside our application, use the [link component](/docs/components/link.md)

```ruby
transition path: :page1_path do
  button text: 'Page 1'
end
```

### Text

If the transition component receives a text via its `options`, it gets rendered as shown here:

```ruby
transition path: :page1_path, text: 'Click me for a transition'
```

```HTML
<a href='my_example_app/page1'>Click me for a transition</a>
```

If no text is present, the transition component expects a block that it then *yields* the usual way.

## Examples

The transition core component renders the HTML `<a>` tag and performs a page transition

### Example 1: Perform transition from one page to another without full page reload

First, we define our routes (`config/routes.rb`) and the corresponding endpoints in our example controller:

```ruby
get 'my_example_app/page1', to: 'example_app_pages#page1', as: 'page1'
get 'my_example_app/page2', to: 'example_app_pages#page2', as: 'page2'
```

```ruby
class ExampleAppPagesController < ExampleController
  include Matestack::Ui::Core::ApplicationHelper

  def page1
    responder_for(Pages::ExampleApp::ExamplePage)
  end

  def page2
    responder_for(Pages::ExampleApp::SecondExamplePage)
  end

end
```

Then, we define our example app layout with a navigation that consists of two transition components!

```ruby
class Apps::ExampleApp < Matestack::Ui::App

  def response
    components {
      heading size: 1, text: 'My Example App Layout'
      nav do
        transition path: :page1_path do
          button text: 'Page 1'
        end
        transition path: :page2_path do
          button text: 'Page 2'
        end
      end
      main do
        page_content
      end
    }
  end

end
```

Lastly, we define two example pages for our example application:

```ruby
class Pages::ExampleApp::ExamplePage < Matestack::Ui::Page

  def response
    components {
      div id: 'my-div-on-page-1' do
        heading size: 2, text: 'This is Page 1'
        plain "#{DateTime.now.strftime('%Q')}"
      end
    }
  end

end
```

and

```ruby
class Pages::ExampleApp::SecondExamplePage < Matestack::Ui::Page

  def response
    components {
      div id: 'my-div-on-page-2' do
        heading size: 2, text: 'This is Page 2'
        plain "#{DateTime.now.strftime('%Q')}"
      end
      transition path: :page1_path do
        button text: 'Back to Page 1'
      end
    }
  end

end
```

Now, we can visit our first example page via `localhost:3000/my_example_app/page1` and see our two buttons (`Page 1` and `Page 2`) and the content of page 1 (`My Example App Layout` and `This is Page 1`).

After clicking on the `Page 2`-button, we get transferred to our second page (`This is Page 2`) without re-loading the whole page.

If we then click the other button available (`Back to Page 1`), we get transferred back to the first page, again without re-loading the whole page. This behavior can save quite some request payload (and therefore loading time) as only the relevant content on a page gets replaced!

license: MIT

gha_license_id: MIT


text:
---
title: 'Setup Wordpress Behind Reverse Proxy'
date: '2021-05-24T15:47:44Z'
draft: false
category: 'Tech'
tags:
  - 'Nginx'
  - 'Wordpress'
  - 'Web'
summary: 'How you can setup WordPress in your blog path and integrate it with your app'
---

I had this (I think) common problem where we have this web app on `example.com` but we want to have our WordPress blog on `example.com/blog`. Since this is outside the main app we should handle this on the web server, in this case, nginx.

So let's get started! 🚗

### 1. Install Wordpress

Since this is too long to explain here, you can follow this [guide](https://ubuntu.com/tutorials/install-and-configure-wordpress#1-overview) if you use ubuntu like me

### 2. Setup nginx

Add nginx location for path `/blog` that redirect to our WordPress instance.

```nginx
server {
  # Omitted
  ...

  location / {
    # This is where our main app belongs
    ...
  }

  location /blog {
    # Reverse proxy for wordpress
    # Change this to your WordPress location
    proxy_pass http://<IP_ADDRESS>/blog;
    proxy_redirect off;

    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-For $remote_addr;
  }
}
```

### 3. Setup WordPress

After that, you must change the site and home URL to the target address, in this case, `example.com/blog`

Open WordPress config file

```
$ vim /usr/share/wordpress/wp-config.php
```

Add this to the top of the file

```php
// Also a ceremony to get WP working behind reverse proxy https
// HTTPS is also works
$target_url='http://example.com/blog';
define('WP_HOME', $target_url);
define('WP_SITEURL',$target_url);

// Setup for reverse proxy
// Needed if you use HTTPS
define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
    $_SERVER['HTTPS']='on';
}

if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
  $_SERVER['REMOTE_ADDR'] = $ips[0];
}
```

Note: you can also change this by logging into your WordPress and change the home and site URL in the setting menu.

---

That's it, restart nginx and now `example.com/blog` should be routed to your WordPress instance.

branch_name: refs/heads/main

gha_language: JavaScript


text:
# Pipelines for data processing and indexing

_Status: early development_

Vision: Consistent data processing pipelines (parsing, interpretation and quality flagging) for use in GBIF, the Living Atlases project and beyond.
Built to scale from laptop to GBIF volumes.  Deployable on JVM, Spark, Google Cloud, <insert your favourite cloud provider here>.

# Architecture

The project provides vanilla JVM-based parsing and interpretation libraries, and pipelines for indexing into SOLR and ElasticSearch, built using Apache Beam.

> Apache Beam provides a high level abstraction framework ideal for this purpose with the ability to deploy across target environments (e.g. Spark, local JVM) and with many built in connectors for e.g. HBase, SOLR, ElasticSearch etc.

## Ingress

Ingress is from Darwin Core Archive (zip files of one or more "CSV"s) or  ABCD Archives (compressed XML) only[1].
During ingress data is converted from it's native format and stored as Avro files containing Darwin Core compliant data.

This is depicted below:

![Ingress](./docs/images/ingress.svg)

> Avro is chosen as a storage and interchange format exclusively in this project because a) it is splittable with each split compressed independently, b) it holds the data schema with the data, c) is well supported in the Hadoop ecosystem (e.g. Hive, Spark) and many other tools (e.g. Google cloud) d) is very robust in serialization and e) reduces boiler plate code thanks to schema to code generators. Darwin Core Archives and JSON for example do not exhibit all these traits.

[1] Other protocols (e.g. DiGIR, TAPIR) are supported by GBIF but are converted by crawling code upstream of this project.

## Interpretation

During interpretation the verbatim data is parsed, normalised and tested against quality control procedures.

To enable extensibility data is interpreted into separate `avro` files where a separate file per category of information is used.  Many interpretations such as `date / time` formating is common to all deployments, but not all.
For example, in the [GBIF.org](https://www.gbif.org) deployment the scientific identification is normalised to the GBIF backbone taxonomy and stored in `gbif-taxonomy.avro` which might not be applicable to everyone.
Separating categories allows for extensibility for custom deployments in a reasonably modular fashion.

Interpretation is depicted below:

![Ingress](./docs/images/interpret.svg)

> Note that all pipelines are designed and tested to run with the `DirectRunner` and the `SparkRunner` at a minimum.  This allows the decision to be taken at runtime to e.g. opt to interpret a small dataset in the local JVM without needing to use cluster resources for small tasks.

> It is a design decision to ensure that all the underlying parsers are as reusable as possible for other projects with careful consideration to not bring in dependencies such as Beam or Hadoop.

## Indexing

Initial implementations will be available for both SOLR and for ElasticSearch to allow for evaluation of both at GBIF.
During indexing the categories of interpreted information of use are merged and loaded into the search indexes:

![Ingress](./docs/images/index.svg)

> Note that GBIF target 10,000 records/sec per node indexing speed (i.e. 100,000 records/sec on current production cluster).  This will allow simplified disaster recovery and rapid deployment and of new features.

# Structure

The project is structured as:

- _core_: The schemas, messages and functions to interpret data
- _hadoop_: Hadoop specific utilities (e.g. FileInputFormats)
- _demo_: The quick start project (currently a demo showing a DwC-A to Avro file creation)
- _gbif_: The GBIF specific indexing pipelines (currently a demo showing an ES sink using Spark deployment)
- _living_atlases_: The Living Atlas specific indexing pipelines (currently a demo showing a SOLR sink)

repository: santiagomrv/pipelines

repo_name: santiagomrv/pipelines


text:
## Optimization Approach

### Original Approach

At first we looked at some profiling results of gprof, LIKWID and the Vtune Amplifier.
The results didn't seem very useful because the original code of course is just single threaded.
It became clear that almost all the computation time is spend in different calls of GEMM.
GEMM is also called from different parts of the code. From the Kernel.cpp called by Simulator.cpp, the WaveFieldWriter.cpp and the Model.cpp.

![alt text](https://i.imgur.com/CCVmIee.png "Vtune on original code")

GEMM also appeared to be one of the few functions that actually do calculations instead of calling other functions.
We decided that the GEMM.cpp is a very important file.
Therefore we decided that we would start with optimizing the single core execution time of GEMM similarly to what we did in exercise 1.
That means using 512 bit AVX512 intrinsic functions.
We also considered eliminating divisions in function calls by saving often used values as constants.

For example:
```c
    DGEMM(  NUMBER_OF_BASIS_FUNCTIONS, NUMBER_OF_QUANTITIES, NUMBER_OF_QUANTITIES,
            -1.0 / globals.hx, tmp, NUMBER_OF_BASIS_FUNCTIONS,
            A, NUMBER_OF_QUANTITIES,
            1.0, derivatives[der], NUMBER_OF_BASIS_FUNCTIONS );
```
The `-1.0 / globals.hx` does not during execution, so we saved it as a constant. We later aborted this idea because we didn't see any improvements in execution time.
The code for it can still be found in the `single_core_opti` branch.

We decided that we would do MPI next. We were planning on doing domain decomposition with a ghost layer as suggested in the presentation in order to distribute the grid among multiple MPI tasks. The original plan was to divide the grid in rows but during the implementing process we switched to 'rectangles' for the sub-grids.

We decided to add OpenMPI last, because no big code changes are need to make it work and because we wanted to make sure everything was working correctly before we add it.

For the parallel wavefield output we considered doing it using HDF5.

### Single-core optimization

The original approach of kind of reusing the implementation from assignment1 does not really work, as it requires the matrix sizes to be a multiple of 8 in each direction.
This is due to the AVX512 isntructions loading and writing 8 values at once.
Because the matrices are quite small and N being always fixed to 3 alot of padding would be necessary in order to pack A, B and C into larger matrices.
This requires the creation of new buffers, filling than with zeros and copying the values from A, B and C every time the DGEMM function is executed.
This ended up being slower than our final approach.

In assignment2 we used LIBXSMM to generate optimized DGEMM microkernels. These kernels also run faster than our original implementation from assignment1.
Because the size of the matrices only depends on the order we were able to generate optimized kernels for almost every call of DGEMM.
The only DGEMM kernels we weren't able to generate were 3 calls in `Kernels.cpp` using an alpha value different from 1 or -1.

```c
  DGEMM(  NUMBER_OF_BASIS_FUNCTIONS, NUMBER_OF_QUANTITIES, NUMBER_OF_QUANTITIES,
          1.0 / globals.hy, tmp, NUMBER_OF_BASIS_FUNCTIONS,
          B, NUMBER_OF_QUANTITIES,
          1.0, degreesOfFreedom, NUMBER_OF_BASIS_FUNCTIONS );
```

For these calls we used our own implentation with padding.
The generated DGEMM kernels are located in `GeneratedGemm.h`.

### MPI

The MPI optimization consists in splitting the grid data computation equally
among the MPI processes. Initially, all processes form their own copy of
`materialGrid` and `degreesOfFreedomGrid`.

The user is able to configure
how many columns and rows from the grids each process has to compute by
passing the `-a` and `-b` command line parameters. The sub-grids have to
divide the whole grid perfectly, therefore `-x` and `-y` should be divided
by `-a` and `-b` respectively.

Example run command:
```
mpirun -np 2 build/lina -s 0 -x 10 -y 10 -a 10 -b 5
```

According to its rank, each process will compute its processing limits
as follows:

```c
m_Xfrom = mpiRank * m_pX % m_X;
m_Xto = m_Xfrom + m_pX;
m_Yfrom = mpiRank * m_pX / m_X * m_pY % m_Y;
m_Yto = m_Yfrom + m_pY;
```

where `m_pX` and `m_pY` are the values specified by `-a` and `-b` parameters.

During the first part of the main loop in `Simulator.cpp` all oprations are
local to an element. However, the second part interacts with neighbouring
elements. Thus, to compute the next iteration borders of the sub-grids,
each process needs to get the rows and column of the neighbouring ranks
encompassing its own sub-grid before the second processing part.

This acquisition is realized in 2 steps. First, each even ranked process
sends its last row to the underneath neighbouring process. At the same time,
the odd ranked processes hand their first row to the process above. Then,
the same procedure happens in reverse order, odd processes handing their last
row and even ones their first row.

```c
for (int i = m_Yfrom / m_pY; i < m_Yfrom / m_pY + 2; i++)
  if (i % 2 == 0) {
    int under = coordsToRank(periodicIndex(m_Yto, m_Y), m_Xfrom);
    MPI_Sendrecv(&m_data[(m_Yto - 1) * m_X + m_Xfrom], m_pX * sizeof(T), MPI_BYTE, under, 0,
                 &m_data[periodicIndex(m_Yto, m_Y) * m_X + m_Xfrom], m_pX * sizeof(T), MPI_BYTE, under, 0,
                 MPI_COMM_WORLD, MPI_STATUS_IGNORE);
  } else {
    int above = coordsToRank(periodicIndex(m_Yfrom - 1, m_Y), m_Xfrom);
    MPI_Sendrecv(&m_data[m_Yfrom * m_X + m_Xfrom], m_pX * sizeof(T), MPI_BYTE, above, 0,
                 &m_data[periodicIndex(m_Yfrom - 1, m_Y) * m_X + m_Xfrom], m_pX * sizeof(T), MPI_BYTE, above, 0,
                 MPI_COMM_WORLD, MPI_STATUS_IGNORE);
  }
```

The same approach is applied for bordering left and right columns. However,
as the columns are not contiguous in memory, we have created an MPI type
to specify how many elements are in the column and the memory gap between them.

```c
MPI_Type_vector(m_pY, sizeof(T), m_X * sizeof(T), MPI_BYTE, &MPI_YGHOST);
MPI_Type_commit(&MPI_YGHOST);
```

The final column sharing is as follows:
```c
for (int i = m_Xfrom / m_pX; i < m_Xfrom / m_pX + 2; i++)
  if (i % 2 == 0) {
    int right = coordsToRank(m_Yfrom, periodicIndex(m_Xto, m_X));
    MPI_Sendrecv(&m_data[m_Yfrom * m_X + m_Xto - 1], 1, MPI_YGHOST, right, 0,
                 &m_data[m_Yfrom * m_X + periodicIndex(m_Xto, m_X)], 1, MPI_YGHOST, right, 0,
                 MPI_COMM_WORLD, MPI_STATUS_IGNORE);
  } else {
    int left = coordsToRank(m_Yfrom, periodicIndex(m_Xfrom - 1, m_X));
    MPI_Sendrecv(&m_data[m_Yfrom * m_X + m_Xfrom], 1, MPI_YGHOST, left, 0,
                 &m_data[m_Yfrom * m_X + periodicIndex(m_Xfrom - 1, m_X)], 1, MPI_YGHOST, left, 0,
                 MPI_COMM_WORLD, MPI_STATUS_IGNORE);
  }
```

If the wavefield output is not done in parallel, then it shall remain the
rank 0 process' job to output it. To do this, it needs to gather the
`degreesOfFreedomGrid` from all other processes at the beginning of each
time step. The `Grid.h` now provides and implementation for that with the
`gather` method.

```c++
void Grid<T>::gather(int root) {
  if (mpiRank == root) {
    for (int i = 0; i < mpiSize; i++)
      if (i != root) {
        std::pair<int, int> coords = rankToCoords(i);
        MPI_Recv(&m_data[coords.first * m_X + coords.second], 1, MPI_SUBGRID, i, 0,
                MPI_COMM_WORLD, MPI_STATUS_IGNORE);
      }
  } else {
    MPI_Send(&m_data[m_Yfrom * m_X + m_Xfrom], 1, MPI_SUBGRID, root, 0,
             MPI_COMM_WORLD);
  }
}
```

As with the columns, the sub-grids are not stored completely in a
contiguous memory area and thus we have create the `MPI_SUBGRID` type, defining
the length of each subgrid row and the memory gap between each consecutive rows.

```c
MPI_Type_vector(m_pY, m_pX * sizeof(T), m_X * sizeof(T), MPI_BYTE, &MPI_SUBGRID);
MPI_Type_commit(&MPI_SUBGRID);
```

The same gather procedure is applied at the end of the `simulate` function
so that the error output in the main function may have the final computed
`degreesOfFreedomGrid`.

Testing revealed a speedup proportional to the number of MPI processes.

### OpenMP

As processing each element in the grid is independent from the rest,
we can parallelize the two for loops iteration over the grid in the
`Simulation.cpp`.

```c
#pragma omp parallel for collapse(2)
for (int y = ylimits.first; y < ylimits.second; ++y) {
  for (int x = xlimits.first; x < xlimits.second; ++x) {
```

As the for loops remain unchanged, this approach can be applied on both
the original and the MPI version.

### Parallel Wavefield Output

When we enable output only the master process can write to the file. This means
that all information needs to be gathered at the master process leading to
overhead. In order to strive for a better time we tried to allow for parallel
writes to a file. For this purpose we use the hdf5 file format which allows
for writing multiple scientific datasets to the same file. The format functions
as follows:

* Each dataset is written to a specific path in the file. For example: Pressure
  goes to filename:/pressure, uvvel goes to filename:/u and so on.
* Each process writes to a hyperslab governed by the starting and ending indexes
  (of the Grid) that it is working on.

This process is illustrated in the following figure:

![Hyperslabs per process](https://support.hdfgroup.org/HDF5/Tutor/image/pimg034.gif)

The XDMF format that paraview uses has readers for HDF5 files built in. Hence,
we only need to point to the correct path for the dataset as illustrated above
and change the format from 'Binary' to 'HDF'.

After these changes no gather step needs to be done at the master and each
process is responsible for writing its own wavefield output.

## Compile and run

To run the implementation, one must:
- clone the repository on *CooLMUC3*
- load the hdf5 module: `module load hdf5/mpi/1.8.15`
- compile: `export ORDER=2;bash -x compilescript`
- create a script to run the code with mpi (e.g. it should contain an
mpirun command as `mpirun -np 2 build/lina -s 0 -x 10 -y 10 -a 10 -b 5 -o output/test`)
.


text:
# Envelope By Sketch

Creates building Envelope elements derived from a polygon sketch and setback settings.

|Input Name|Type|Description|
|---|---|---|
|Perimeter|https://schemas.hypar.io/Polygon.json|Perimeter of the building envelope.|
|Setback Interval|number|Vertical distance between envelope setbacks.|
|Use Setbacks|boolean||
|Setback Depth|number|Offset depth from previous setback.|
|Minimum Tier Area|number|Minimum area allowed for a setback tier.|
|Building Height|number|Overall height of the building from grade.|
|Foundation Depth|number|Depth of the building envelope below grade.|

|Output Name|Type|Description|
|---|---|---|
|Height|Number|Height of the building.|
|Subgrade|Number|Depth of the subgrade section.|

## Additional Information

repository: hypar-io/BuildingBlocks

gha_language: C#

repo_name: hypar-io/BuildingBlocks


text:
---
layout: single
title: 'Nix: Streaming gsutil transfers'
excerpt: Avoid landing data unnecessarily
date: 2021-06-14
last_modified_at: 2023-04-26 13:22:37
categories:
    - til
tags:
    - gsutil
    - nix
    - til
---

> Cloud Storage supports streaming transfers, which allow you to stream data to and from your Cloud Storage account
> without requiring that the data first be saved to a file.

```shell
# Stream uploads.
sort data_measurements.json | gsutil cp - gs://my_app_bucket/data_measurements.json

# Stream downloads.
gsutil -m cp gs://my_app_bucket/data_measurements.json.gz - | gunzip | jq '.'
```

Via [Google Cloud docs](https://cloud.google.com/storage/docs/streaming).


text:
# nodemcu-mode

NodeMCU helper minor mode for Emacs.

This mode allows to communicate with [NodeMCU-firmware][nodemcu] in order to help Lua-scripts development.

[nodemcu]: https://github.com/nodemcu/nodemcu-firmware "NodeMCU-firmware"

## Features

* Communicating using serial device or telnet connection.
* Executing Lua code and evaluate Lua expressions on device.
* Listing uploading and removing files on/to/from device.
* Compiling Lua scripts after uploading to device.
* Some other useful commands.

## Bindings

| Key     | Command                   | Description                                      |
| ------- | ------------------------- | ------------------------------------------------ |
| C-x C-e | nodemcu-evaluate-at-point | Evaluate current line or marked region on device |
| C-c C-b | nodemcu-send-buffer       | Execute current buffer on device                 |
| C-c C-d | nodemcu-remove-file       | Remove file from device (with completion)        |
| C-c C-e | nodemcu-evaluate          | Evaluate some Lua-code on device                 |
| C-c C-h | nodemcu-get-heap          | Get heap size (node.heap())                      |
| C-c C-r | nodemcu-restart-node      | Restart node (node.restart())                    |
| C-c C-s | nodemcu-list-files        | List files on device file-system (file . size)   |
| C-c C-t | nodemcu-execute           | Execute some Lua-code on device                  |
| C-c C-u | nodemcu-upload-file       | Upload some local file local to device           |

## Hacking

You can activate Debugging IO using `nodemcu-debug-io` variable.

repository: katyo/nodemcu-mode

gha_language: Emacs Lisp

repo_name: katyo/nodemcu-mode


text:
---
id: version-2.3.0-development
title: Development
sidebar_label: Development Guide
original_id: development
---

Boda-Lite is developed with :
* [Electron](https://electronjs.org)
* [PostgreSQL](https://postgresql.org)
* [ReactJs](https://reactjs.org/)

## Setting up development environment
1. Download and install [nodejs](https://nodejs.org/)
2. Clone your fork of Bota-Lite Github code repository
```bash
git clone https://github.com/GIT_USER_NAME/bts-ce-lite.git
```
3.  Install **yarn**
```bash
npm install --global yarn
```
4. Install dependent packages by running command below
```
yarn install
```
5. Launch development version
```
yarn run electron:dev
```

repository: erssebaggala/bts-ce-lite

repo_name: erssebaggala/bts-ce-lite


text:
{
  "date" : "2021-02-10",
  "keywords" : [ "jpx file", "jpx file format", "what is a jpx file", "file", "jpx example", "jpx file extension","extension", "format" ],
  "author" : {
    "display_name" : "Kashif Iqbal"
  },
  "draft" : "false",
  "toc" : true,
  "title" : "JPX - Image File Format",
  "description":"Learn about JPX file format and APIs that can create and open JPX files.",
  "linktitle" : "JPX",
  "menu" : {
    "docs" : {
      "parent" : "image"
    }
  },
  "lastmod" : "2021-02-10"
}

## What is a JPX file? ##

A file with .jpx extension is an extension to the JPEG 2000 file format. It uses the JPEG 2000 compression primarily and also provides advanced features such as multiple layers for an image, various colour spaces, opacity, and fragmented code streams. JPX also allows other compressions such as JBIG, CCITT Group3, CCITT Group4, etc. in addition to the JPEG 2000 compression. The JPX file format was approved as [ISO/IEC 15444-2](https://www.iso.org/standard/33160.html) standard, but couldn't receive a warm reception due to the extensive usage of [JPEG](/image/jpeg/) file format. Applications that can open JPX files include Corel PaintShop Pro, Adobe Photoshop 2020, Adobe Illustrator 2020, and CorelDraw Graphics Suite 2020.

## Brief History

In 2000, the Joint Photographic Experts Group committee designed JP2 with the objective to improve their own discrete cosine transform-based JPEG standard with this new wavelet-based method. The JPEG committee aimed to provide their baseline methods free of license fees.in the JP2 license gaining competition among 20 companies, they won by a whisker. JPEG 2000 has been declared as an ISO standard, though most web browser are not ready to give a hand to JPEG 2000 since 2017. In 2004, the ISO/IEC 15444-2 format was publicly accepted as extension to the JP2 file format.

## JPX File Format

The JPX file format was formulated to meet the requirements of applications that were in need of data structures beyond the functionality defined by the [JP2](/image/jp2/) file format. A JP2 file with non-compatible extensions could lead to confusion in the marketplace where some readers can interpret some JP2 files but not others. JPX is the answer to avoiding such issues in applications.

### File Identification

JPX files are stored as [JPF](/image/jpf/) when stored in traditional computer file system. That is why JPX term is least commonly used as compared to the JPF. A JPX file begins with the following bytes:

`00 00 00 0c 6a 50 20 20 0d 0a 87 0a ?? ?? ?? ?? 66 74 79 70 6a 70 78 20`

### File Organization

Similar to JP2, a JPX file is a collection of boxes having a binary structure with the boxes arranged in a contiguous order. The first box gives the start to the file with its first byte and the last byte of the last box represents the last byte of the file.
The binary structure of a box in a JPX file is identical to that defined in the [JP2](/image/jp2/) file format.

### Storage of CodeStream in JPX

The JPX file format allows the image codestream to be divided into fragments. This makes it possible to modify a single tile of the image and write the modified tile to the end of the file without rewriting the entire file. The original [JP2](/image/jp2/) file format restricts the entire codestream to be stored in a contiguous portion of the file, that can be problematic for image editing applications that may desire to modify a single tile of the image and achieve the above supportability by JPX file format. The fragmentation of image codestream makes the JPX file format superior over the JP2 file format. In addition, JPX file format allows multiple codestream to be combined and produce rendered result. Codestreams can be combined as compositing and animation.

## References ##

* [Overview of JPEG 2000](https://jpeg.org/jpeg2000)
* [JPEG 2000 Extensions - ISO/IEC 15444-2:2004](https://library.conholdate.app/view/QYjS9WNWawfV47mvb/iso-15444-2-annex-m.pdf?preview=true.pdf)

gha_language: Mathematica


text:
pubsub.js
=========

JavaScript event publishing/subscription fun

Purpose
=======

Create a well-tested single-instance event publishing & subscription class that works in AMD environments (require.js, curl.js) and also in non-AMD environments.  I've used the amdWeb template from https://github.com/umdjs/umd to help accomplish this.

Testing
=======

Open SpecRunner-require.html or SpecRunner-basic.html to run the Jasmine tests.

License
=======

Licensed under the MIT license.  See the LICENSE file in the project root.

Usage
=====

Include src/pubsub.js in your project, either by using an AMD loader or a `<script>` tag.

Subscription
------------
To subscribe to an event, call:
    pubsub.sub('event-name', callback)

- `'event-name'` should be a string
- `callback` should be a function.  When called, it will be passed one argument.

Publishing
----------
To publish an event, call:
    pubsub.pub('event-name', data)
- `'event-name'` should be a string
- `data` should be an object to pass to all subscribers, e.g. {foo: 'bar'}

Unsubscription
--------------
To unsubscribe from an event, call:
    pubsub.unsub('event-name', callback)
- `'event-name'` should be a string
- `callback` should be a function.


text:
# Create the Landing Zone Network

The following will be created:
* Resource Group for Landing Zone Neworking (lz-networking.tf)
* Route Table (lz-networking.tf)
* Peering of Hub and Spoke Networks (hub-spoke-peering.tf)
* Private DNS Zones (dns-zones.tf)
* Application Gateway (app-gateway.tf)
* Subnet for AKS (aks-networking.tf)

Navigate to "/Scenarios/AKS-Secure-Baseline-PrivateCluster/Terraform/05-Network-LZ" folder
```
cd ../05-Network-LZ
```

In the "variables.tf" file, update the defaults to reflect the tags you'd like to use.
This deployment will need to reference data objects from the Hub deployment and will need access to the pre-existing state file, update the variables as needed.

This deployment will also need to use a storage access key (from Azure) to read the storage account data.  This is a sensitive variable and should not be committed to the code repo.

Once again, A sample terraform.tfvars.sample file is included. Update the required variables, save it and rename it to **terraform.tfvars**.

To get the access key:

1. Go to Azure portal and find the storage account that was created for Terraform
2. Under **Security + networking** section in the left blade, click on **Access keys**
3. Click on **Show keys** at the top of the resulting page
4. Copy the string under **Key** from one of the two keys provided
5. Update your the terraform.tfvsars.sample file with this as the value for access_key
6. Rename the file to terraform.tfvars

Update the rest of the variables in the new terraform.tfvars file as well.

Once the files are updated, deploy using Terraform Init, Plan and Apply.

```bash
terraform init -backend-config="resource_group_name=$TFSTATE_RG" -backend-config="storage_account_name=$STORAGEACCOUNTNAME" -backend-config="container_name=$CONTAINERNAME"
```

```bash
terraform plan
```

```bash
terraform apply
```

If you get an error about changes to the configuration, go with the `-reconfigure` flag option.

:arrow_forward: [Creation of Supporting Components for AKS](./06-aks-supporting.md)

repository: sukasha/Enterprise-Scale-for-AKS

repo_name: sukasha/Enterprise-Scale-for-AKS


text:
# Smart Fridge
This is a student project. We deliver a concept and frame for developing your own smart fridge using a Raspberry Pi.
All information regarding the architecture and functionality is given.

## What is it?
-placeholder-

## Project status
As of now, no source code has been written, the project is in its conceptual stage.

## Contributing
Feel free to get involved in any aspect you wish!
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License
[MIT](https://choosealicense.com/licenses/mit/)


text:
# Build Errors

This document is for common build errors and how to resolve them.

## Warning BUILD001

> warning BUILD001: Reference to '…' was removed since the last stable release of this package. …

This warning indicates a breaking change might have been made to a package or assembly due to the removal of a reference which was used
in a previous release of this assembly. See [ReferenceResolution](./ReferenceResolution.md) for how to suppress.

## Error BUILD002

> error BUILD002: Package references changed since the last release…

Similar to BUILD001, but this error is not suppressible. This error only appears in servicing builds, which should not change references between assemblies or packages.

## Error BUILD003

> error BUILD003: Multiple project files named 'Banana.csproj' exist. Project files should have a unique name to avoid conflicts in build output.

This repo uses a common output directory (artifacts/bin/$(ProjectName) and artifacts/obj/$(ProjectName)). To avoid conflicts in build output, each
project file should have a unique name.

## Error CS0006

Opening solution filters and building may produce an error code CS0006 with a message such as

> Error CS0006 Metadata file '…\AspNetCore\artifacts\bin\Microsoft.AspNetCore.Metadata\Debug\netstandard2.0\Microsoft.AspNetCore.Metadata.dll' could not be found

The cause of this problem is that the solution filter you are using does not include the project that produces this .dll. This most often occurs after we have added new projects to the repo, but failed to update our .sln/slnf files to include the new project. In some cases, it is sometimes the intended behavior of the .slnf which has been crafted to only include a subset of projects.

### You can fix this in one of three ways

1. Build the project on command line. In most cases, running `build.cmd` on command line solves this problem.
2. If the project is missing from the .sln file entirely, you can use `dotnet sln add` to add it, or else right click on the solution/folder in Visual Studio and choose Add->Existing Project, and adding it.
3. If it is present in the .sln, but not the .slnf, you can update the solution filter to include the missing project. You can either do this one by right-clicking on project in Visual Studio and choosing to load it's direct dependencies, and then saving.  Alternatively, you can hand edit the .slnf file - it's a fairly simple json format.

## Error MSB4019: The imported project "…\artifacts\bin\GenerateFiles\Directory.Build.props" was not found

You have likely attempted to use `dotnet` to build a project in the repo without first generating the required files.
Prior to building without `.\build.cmd` or `./build.sh` at least the following **must** be executed:

```powershell
.\build.cmd -noBuildNative -noBuildManaged
```

or

```bash
./build.sh --no-build-managed
```

## Error MSB4236: Unable to locate the .NET Core SDK

Executing `.\restore.cmd` or `.\build.cmd` may produce these errors:

> error : Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
> error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

In most cases, this is because the option _Use previews of the .NET Core SDK_ in VS2019 is not checked. Start Visual Studio, go to _Tools > Options_ and check _Use previews of the .NET Core SDK_ under _Environment > Preview Features_.

## Error MSB4019: The imported project Microsoft.Cpp.Default.props was not found.

Executing `.\restore.cmd` or `.\build.cmd` may produce these errors when your development environment is not configured with the correct C++ installation:

```text
C:\git\aspnetcore\src\Servers\IIS\build\Build.Common.Settings(12,3): error MSB4019: The imported project "C:\git\aspnet
core\.tools\msbuild\17.1.0\tools\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.Default.props" was not found. Confirm that the
 expression in the Import declaration "C:\git\aspnetcore\.tools\msbuild\17.1.0\tools\MSBuild\Microsoft\VC\v170\\Microso
ft.Cpp.Default.props" is correct, and that the file exists on disk. [C:\git\aspnetcore\src\Servers\IIS\AspNetCoreModule
V2\AspNetCore\AspNetCore.vcxproj]
C:\git\aspnetcore\src\Servers\IIS\build\Build.Common.Settings(12,3): error MSB4019: The imported project "C:\git\aspnet
core\.tools\msbuild\17.1.0\tools\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.Default.props" was not found. Confirm that the
 expression in the Import declaration "C:\git\aspnetcore\.tools\msbuild\17.1.0\tools\MSBuild\Microsoft\VC\v170\\Microso
ft.Cpp.Default.props" is correct, and that the file exists on disk. [C:\git\aspnetcore\src\Servers\IIS\AspNetCoreModule
V2\IISLib\IISLib.vcxproj]
```

To resolve this issue, confirm that you've installed the required C++ components in Visual Studio by following the instructions in the [BuildFromSource](./BuildFromSource.md) document (namely, the section about running `InstallVisualStudio.ps1`).

## Error MSB4018: The "InstallDotNetCore" task failed unexpectedly.

Executing `.\restore.cmd` or `.\build.cmd` may produce these errors when your development environment is not configured with the correct C++ installation:

```text
C:\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23364.2\tools\InstallDotNetCore.targets(15,5):
error MSB4018: The "InstallDotNetCore" task failed unexpectedly. [C:\.nuget\packages\microsoft.dotnet.a
rcade.sdk\8.0.0-beta.23364.2\tools\Tools.proj]
C:\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23364.2\tools\InstallDotNetCore.targets(15,5):
error MSB4018: System.MissingMethodException: Method not found: 'System.Text.Json.JsonDocument System.Text.Json.JsonDo
cument.Parse(System.ReadOnlyMemory`1<Byte>, System.Text.Json.JsonDocumentOptions)'.
```

To resolve this issue, confirm that you've installed the required C++ components in Visual Studio by following the instructions in the [BuildFromSource](./BuildFromSource.md) document (namely, the section about running `InstallVisualStudio.ps1`).

## Error: HTTP Error 500.33 - ANCM Request Handler Load Failure

The [ASP.NET Core Module](https://learn.microsoft.com/aspnet/core/host-and-deploy/aspnet-core-module) (ANCM) for IIS is not supported when running projects in this repository.

After using `startvs.cmd` to open a solution in Visual Studio, the Kestrel web host option must be used (name of the project) and not IIS Express.

Example of running the `MvcSandbox` project:

`.\startvs.cmd .\src\Mvc\Mvc.sln`

![Web host options in Visual Studio](./vs-iis-express-aspnet-core-mvc-sandbox.jpg)

## Error: Unable to load the service index for …

When attempting to restore servicing tags e.g. `v3.1.7`,  the NuGet.config file may contain internal feeds that are not accessible. This will result in errors such as

> …\aspnetcore\.dotnet\sdk\3.1.103\NuGet.targets(123,5): error : Unable to load the service index for source https://pkgs.dev.azure.com/dnceng/_packaging/darc-int-dotnet-extensions-784b0ffa/nuget/v3/index.json. […\Temp\1gsd3rdo.srb\restore.csproj] […\.nuget\packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.20213.4\tools\Tools.proj]

The `darc-int-...` feeds in NuGet.config are used only when building internally and are not needed after the tags are created. Delete all such entries in the file and retry.

## Error: Generated code is not up to date in eng/ProjectReferences.props.

After some project additions or moves, you may need to update the two `DotNetProjects Include` lists in `eng/Build.props`

## Warning: Requested Microsoft.AspNetCore.App v… does not exist

You have likely attempted to build projects or execute tests which require the just-build Microsoft.AspNetCore.App
shared framework. Execute the following to ensure that exists within the `$(DOTNET_ROOT)` folder:

```powershell
.\build.cmd -projects src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj
```

or

```bash
./build.sh --projects "$PWD/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj"
```

## Errors when restoring older clones

If you have build errors trying to run `restore.cmd` and you cloned the repository some time ago,
try deleting the `.dotnet` and `.tools` directories in your local repo directory. It may resolve
the problem if older versions of the .NET SDK are causing an incompatibility with the latest version.

repository: dotnet/aspnetcore

repo_name: dotnet/aspnetcore


text:
# bowling-game

Bowling Game exercise in Javascript

[![Dependency Status](https://david-dm.org/msurekci/bowling-game.svg)](https://david-dm.org/msurekci/bowling-game)
[![devDependency Status](https://david-dm.org/msurekci/bowling-game/dev-status.svg)](https://david-dm.org/msurekci/bowling-game#info=devDependencies)

[generate-babel-boilerplate](https://github.com/babel/generator-babel-boilerplate) was used to create the initial structure.

A more functional approach was taken rather than a OO approach as the complexity is far less.

Built using ES2015/ES6 features such as arrow functions.

Both `scoreCalculator` and `getValueOfRolls` functions are [idempotent](https://github.com/hemanth/functional-programming-jargon#idempotent). However, the functions within those have [side effects](https://github.com/hemanth/functional-programming-jargon#side-effects). It would be nice to remove those to make them easily available in the future without being concerned about the implications.

repository: msurekci/bowling-game

repo_name: msurekci/bowling-game


text:
---
title: Lesson 2
lesson: CSS Units
author: Dan Hahn
date: 09/25/2017 18:00
template: article.jade
nav:
  Font Properites: index.html
  Text Properties: text.html
  Include File: include.html
  Define a color: color.html
  CSS Units: sizes.html
  Borders: borders.html
  Padding: padding.html
  Margin: margin.html
  Pseudo: pseudo.html
  overflow: overflow.html
  Homework: homework.html
lessonId: 2
order: 5
---

There are several different ways you can declare the size of a font in CSS. Broadly speaking, the units fall into one of two categories - absolute and relative.

Absolute units are fixed and (mostly) relate to some physical measurement. Once they are declared, their size cannot be altered by changing the font size of some other element.

Relative units do not have an objective measurement. Instead, their actual size is determined by the size of a parent element. This means that their size can be altered by changing the sizing of that dependent element.

Here is a brief overview of some of the units -

Unit    | Type     | Description
--------|----------|--------------------------------------------------------------
px      | Absolute | 1 “viewport pixel”
pt      | Absolute | 1 point is 1/72 of an inch
pc      | Absolute | 1 pica is equal to 12 points
%       | Relative | Relative to the parent element’s font size
em      | Relative | Relative to the parent element’s font size
rem     | Relative | (root em) Relative to the html font size
keyword | Relative | xx-small, x-small, small, medium, large, x-large, xx-large
vw      | Relative | 1/100th of the width of the viewport
vh      | Relative | 1/100th of the height of the viewport
vmin    | Relative | 1/100th of the viewport’s smaller dimension (height or width)
vmax    | Relative | 1/100th of the viewport’s larger dimension (height or width)

You can see an exhaustive list of units here, but I will focus on what I think are the most relevant units - px, pt, %, em, rem, and vw.

## what’s the difference?

The difference between these units can be difficult to understand conceptually, so it is best to demonstrate their differences with practical examples.

### example 1 - default settings

In a blank HTML document, without you declaring any font sizing, there are default settings used. In most browsers, the default font size for the html and body tags is 100%. This equates to the following -

```css
100% = 1em = 1rem = 16px = 12pt
```

This means that if you set the font size of one p to 100% and another p to 16px, they will render as the same size on screen. You can see this demonstrated here -

## Default Font Settings

### example 2 - absolute vs relative units

The difference between absolute and relative units can be highlighted by altering the html font size. If we set html { font-size: 200% }, this will affects only the ps with relative font size units.

## Absolute vs relative Units

This is a key advantage of using relative units.  Max Luster has a great example of this here.

### example 3 - rem vs em (and %)

The Em (and %) unit works by calculating the current font size based on the parent element’s font size. For example -

```css
html {
  font-size: 100% /* =16px \*/
}
body {
  font-size: 2em; /* =32px \*/
}
p {
  font-size: 1em; /* =32px \*/
  /* font-size: 0.5em; =16px \*/
}
```

Because p inherits from body, which inherits from html, the paragraphs set in em and % units turn out twice the size we may have intended.

## Rem vs Em

When you use em units for an element, you have to take into account the font size of all the parent elements. As you can see, this can get complicated and messy pretty quickly.

The solution to this problem is rem. rem is calculated based on the html font size only, not the parent element. For example -

```css
html {
  font-size: 100% /* =16px \*/
}
body {
  font-size: 2rem; /* =32px \*/
}
p {
  font-size: 1rem; /* =16px \*/
}
```

Using rem allows you to have the scaling abilities of em and %, but without having to deal with nesting issues.

### example 4 - viewport width sizing

The vw unit, a new CSS3 unit uses the viewport width to calculate the font size. This allows for a more fluid responsive font sizing.

Although this seems like a great unit for responsive design, I personally am not a fan of it. It doesn’t give me enough control over the size of the font, which almost always works out to be too big or too small.

## my method

Until I did this research, I was just using pixels to set my font sizes. This is because, nowadays, most browsers allow the user to zoom in if the text is too small for them, and so there is no accessibility issue.

However, I have found this method quite limiting in terms of ability to scale. Although my font sizing looks good on medium and small screens, it could be better optimised for larger ones. Even if users have the option to zoom in, that isn’t something we want them to need to do.

My solution is therefore to work with rem (using pixels as a fallback).

```css
html {
  font-size: 62.5%; /* sets the base font to 10px for easier math \*/
}

body {
  font-size: 16px;
  font-size: 1.6rem;
  /* sets the default sizing to make sure nothing is actually 10px \*/
}

h1 {
  font-size: 32px;
  font-size: 3.2rem;
}
```

This allows me to scale up my font sizes simply by writing -

```css
@media screen and (min-width: 1280px) {
  html {
    font-size: 100%;
  }
}
```

This method uses pixels as a fallback unit because rem isn’t supported on IE8 and below. One issue this creates is when I change the base font size for scalability like above, this doesn’t apply for the fallback font size. However, I don’t consider this a huge issue because the ability to scale for larger devices is more of an extra feature than it is a core one.

If you have any ideas of how I can improve on this, let me know in the comments. I might also write a SCSS mixin so I don’t have to input both the fallback and the rem units.

**Note:** source http://bitsofco.de/2015/css-font-sizing/

repository: danhahn/css-site

repo_name: danhahn/css-site


text:
# Compound Calc

It’s a simple tool to calculate the liquidation price for assets serving as collateral on Compound.

## License

[MIT](https://opensource.org/licenses/MIT)


text:
# FF6

## Installation

Copy `project-base.ini` to `project.ini`

Configure the settings in `project.ini` appropriately.

You will also need [FF3usME](http://www.angelfire.com/pq/jumparound/)

## Usage

Double-click `main.py` to start off.  This will bring up the ROM Builder.

`Rebuild From Patch List` rebuilds the ROM starting from the base FF6 rom, and
using all listed patches.  You probably want to start here.

`Edit ROM` brings up FF3usME with your current changes.  Edit away in here.

`Launch Game` brings up your emulator running your ROM with your current
changes.

`Save Patch` uses the fields `File name` and `Description` to build a new patch
from your current changes, and then rebuilds a new ROM from the new patch list.

Think of it like version control:

- `git checkout` / `git reset --hard`: `Rebuild From Patch List`
- `git commit`: `Save Patch`

## Caveats

Patches usually depend on every patch that comes before; you generally can't
pull a patch out of the history unless you pull all patches after that patch
too.  This isn't always the case, but it's caused problems before.

In general, don't worry about editing the patch history.  Just make a new patch with the changes you want and forget about the past.


text:
# File upload
-------

## Example:

    // Most of Ruby on Rails developers use specific gem to handle file upload. The most popular gem is to do this is Paperclip.

    // To install Paperclip follow instructions at https://github.com/thoughtbot/paperclip
    // Configuring gem is typical - creating proper model, views and controller.

    // Now something about security - create strong validation rules in model. For example:

    // File: APP_DIR/app/models/photo.rb
    validates_attachment :image,
                        presence: true, # validates if file is proper image
                        content_type: {content_type: %w(image/jpeg image/gif image/png)}, # whitelist content type
                        size: {in: 0..10.kilobytes} # set maximum size of uploading
    validates_attachment_file_name :image, matches: [/^[a-zA-Z0-9]$/] # allow only alphanumerical file names
    // Always upload files outside the website root directory

    // Paperclip logs every upload action by default. If you want to turn logging on explicite add following line of code
    // to your APP_DIR/config/environments/production.rb
    Paperclip.options[:log] = true

gha_language: HTML


text:
# GILPS

## What is GILPS

GILPS is the general Inductive Logic Programming System which implements the main contributions
of my PhD work at Imperial College's Computer Science department from 2007 to 2010.

During the research phase of my dissertation many ideas sprang up to test different aspects
of ILP systems. It soon became evident that we would need to develop a generic and modular
ILP system rather than a set of distinct systems each with its own identity but having many
similarities as well, e.g. hypothesis coverage computation, final theory construction, background
knowledge and example handling, and so on.

The main guiding principle in GILPS development has been to ease the addition of new ILP
engines in the framework. The features that are specific to a given ILP engine (e.g. TopLog,
ProGolem) are isolated in a Prolog module with delimited interfaces to the rest of the GILPS
framework. The functionality an existing (or new) ILP engine exports to the GILPS framework
is only how, in this engine, an hypothesis is generated from an example. The GILPS framework
does the rest.

The ideas and algorithms specific to the ILP engines TopLog and ProGolem and the subsumption
engine Subsumer were described in Chapters 3, 4 and 5 of [my thesis](./PhD_Thesis_Jose_Santos.pdf), respectively.

For further details on GILPS, please see [Chapter 6](./PhD_Thesis_Jose_Santos.pdf) where GILPS is described in more detail.

## How to run

You'll need [YAP Prolog](https://www.dcc.fc.up.pt/~vsc/yap/). Then, in the command line, execute the demo train and test files provided. E.g.

For building models on datasets training data:
yap -l demo_train_model.pl

For testing models on test data:
yap -l demo_test_model.pl

These demos use the default GILPS settings on a few datasets. There are many settings and many datasets to try. Feel free to explore!

repository: JoseCSantos/GILPS

repo_name: JoseCSantos/GILPS


text:
# snakegame

This is the source code for Snake game developed in C++ language and on Turbo CPP platform. There is a food('$') which is randomly generated by the system, as soon as the snake eats the food, it gets bigger.The main idea of the programme is based on creating a 2D character array named snake_array of larger size and then store different characters like '*', '$' etc at appropriate indexes.

These are the following rules for the game:

  **1:PRESS W-> to go up**

  **2:PRESS S-> to go down**

  **3:PRESS A-> to go left**

  **4:PRESS D-> to go right**

  **5:PRESS X-> to exit**

  **PRESS 0 TO START GAME**

  There are following functions used in program:

  _1: growth() it adds tail to the snake as soon as it eats the food and also manages the movement of the snake_

  _2: snake() it displays the snake at the bottom left corner and score at the bottom right corner_

  _3: eat() it tells whether the snake has eaten the food i.e. it returns 1 if the snake eats food and 0 if not_

  _4: score_cal() it calculates the score_

  _5: food() it generates food at random place within the boundary_

  _6: display() it displays the final elements of the snake_array_

  _7: wall() it creates wall, assigns food and the head of the snake i.e. it stores the character '*', '$', 'O' in the snake_array to create the wall, food and head of the snake respectively_

  _8: collision() it checks whether the snake has collided with itself or not_

  _9: move() it moves the snake in different directions according to the user input_

  _10: call() it calls all the above function in a particular sequence for the proper execution of the snake game_

  Language used : C++

  Plateform: Turbo CPP

 Header files used : **stdlib**, **dos**, **stdio**, **conio**, **iostream**

 The screenshot of the game is uploaded below:

 ![Screenshot (269)](https://user-images.githubusercontent.com/68001066/133921209-87838006-5979-4ff0-ba3b-f70b7def4225.png)

![Screenshot (270)](https://user-images.githubusercontent.com/68001066/133921213-ecf5a7f1-310e-4a1a-b143-83608fbdc6ee.png)


text:
# Sentiment Analysis for User Reviews
In this introductory sample, you'll see how to use [ML.NET](https://www.microsoft.com/net/learn/apps/machine-learning-and-ai/ml-dotnet) to predict a sentiment (positive or negative) for customer reviews. In the world of machine learning, this type of prediction is known as **binary classification**.

## API version: Static and Estimators-based API
It is important to note that this sample uses the **static API with Estimators**, available since ML.NET v0.6.

## Problem
This problem is centered around predicting if a customer's review has positive or negative sentiment. We will use small wikipedia-detox-datasets (one dataset for training and a second dataset for model's accuracy evaluation) that were processed by humans and each comment has been assigned a sentiment label:
* 0 - negative
* 1 - positive

Using those datasets we will build a model that when predicting it will analyze a string and predict a sentiment value of 0 or 1.

## ML task - Binary classification
The generalized problem of **binary classification** is to classify items into one of two classes (classifying items into more than two classes is called **multiclass classification**).

* predict if an insurance claim is valid or not.
* predict if a plane will be delayed or will arrive on time.
* predict if a face ID (photo) belongs to the owner of a device.

The common feature for all those examples is that the parameter we want to predict can take only one of two values. In other words, this value is represented by `boolean` type.

## Solution
To solve this problem, first we will build an ML model. Then we will train the model on existing data, evaluate how good it is, and lastly we'll consume the model to predict a sentiment for new reviews.

![Build -> Train -> Evaluate -> Consume](../../../../../samples-new-api/samples/csharp/getting-started/shared_content/modelpipeline.png)

### 1. Build model

Building a model includes:

* Define the data's schema maped to the datasets to read (`wikipedia-detox-250-line-data.tsv` and `wikipedia-detox-250-line-test.tsv`) with a DataReader

* Create an Estimator and transform the data to numeric vectors so it can be used effectively by an ML algorithm (with `FeaturizeText()`)

* Choosing a trainer/learning algorithm (`SDCA or Stochastic Dual Coordinate Ascent`) to train the model with.

The initial code is similar to the following:

```CSharp
//1. Create ML.NET context/environment
var env = new LocalEnvironment();

//2. Create DataReader with data schema mapped to file's columns
var reader = TextLoader.CreateReader(env, ctx => (label: ctx.LoadBool(0),
                                                    text: ctx.LoadText(1)));

//3. Create an estimator to use afterwards for creating/traing the model.

var bctx = new BinaryClassificationContext(env);

var est = reader.MakeNewEstimator().Append(row =>
{
    var featurizedText = row.text.FeaturizeText();  //Convert text to numeric vectors
    var prediction = bctx.Trainers.Sdca(row.label, featurizedText);  //Specify SDCA trainer based on the label and featurized text columns
    return (row.label, prediction);  //Return label and prediction columns. "prediction" holds predictedLabel, score and probability
});
```

### 2. Train model
Training the model is a process of running the chosen algorithm on a training data (with known sentiment values) to tune the parameters of the model. It is implemented in the `Fit()` method from the Estimator object.

To perform training you need to call the `Fit()` method while providing the training dataset (`wikipedia-detox-250-line-data.tsv` file) in a DataView object.

```CSharp
var traindata = reader.Read(new MultiFileSource(TrainDataPath));
var model = est.Fit(traindata);
```

### 3. Evaluate model
We need this step to conclude how accurate our model operates on new data. To do so, the model from the previous step is run against another dataset that was not used in training (`wikipedia-detox-250-line-test.tsv`). This dataset also contains known sentiments.

`Evaluate()` compares the predicted values for the test dataset and produces various metrics you can explore.

```CSharp
var testdata = reader.Read(new MultiFileSource(TestDataPath));
var predictions = model.Transform(testdata);
var metrics = bctx.Evaluate(predictions, row => row.label, row => row.prediction);
```

If you are not satisfied with the quality of the model, you can try to improve it by providing larger training datasets and by choosing different training algorithms with different hyper-parameters for each algorithm.

>*Keep in mind that for this sample the quality is lower than it could be because the datasets were reduced in size so the training is quick. You should use bigger labeled sentiment datasets to significantly improve the quality of your models.*

### 4. Consume model
After the model is trained, you can use the `Predict()` API to predict the sentiment for new sample text.

```CSharp
var predictionFunct = model.AsDynamic.MakePredictionFunction<SentimentIssue, SentimentPrediction>(env);

SentimentIssue sampleStatement = new SentimentIssue
                            {
                                text = "This is a very rude movie"
                            };

var resultprediction = predictionFunct.Predict(sampleStatement);
```

Where in `resultprediction.Predictedlabel` will be either 1 or 0 depending if it is positive or negative predicted sentiment.


text:
# Survey Analysis

This directory contains the analysis of surveys given to the contributor community.
Each individual survey's data and corresponding analysis are found in the directory
named after the corresponding year. The README.md in those directories contains the
full analysis done. For space reasons, the notebooks from which the README.md files
are derived have been cleared of output.

In addition to the individual year analysis, multi-year comparisons can be found
in `multi_year_comparisons`.

To run the notebooks on your own, the following packages are required:

* pandas
* plotnine
* numpy

repository: kubernetes/community

gha_language: Jupyter Notebook

repo_name: kubernetes/community


text:
# personal-contacts-manager
This Web Client is going to allow the user to login or create a new account, search for contacts, update contacts, add new contacts, and remove contacts. This could be our master branch.

### Login Page
![](login-page.png)

This page contains the login and create new contact form.

### Main Menu Page
![](main-menu.png)

Once the user is logged in, he/she can search, update, add, and delete contacts. There will be a search box and buttons that link to different pages.

### Add New Contact Page
![](add-new-contact.png)

A form for the user fill out a new contact's credentials(first and last name, company the new contact is affiliated with, phone number, email, and address).

### Edit Contact Page
![](edit-contact.png)

A form that allows a user to make changes to a current contact.

### Remove Contact Page
![](remove-contact.png)

This page is still a work in progress, but it should display list of all the contacts the user has. This information on this list will be from the database server.


text:
# Day 98: _Project 19: PadFinder_ (Part Three)

_Follow along at https://www.hackingwithswift.com/100/swiftui/98_.

<br/>

# 📒 Field Notes

This day covers Part Three of _`Project 19`_ in the [100 Days of SwiftUI Challenge](https://www.hackingwithswift.com/100/swiftui/98). (Project 19 files can be found in the [directory for Part One](../day-096/).)

It focuses on several specific topics:

- Changing a view’s layout in response to size classes
- Binding an alert to an optional string
- Letting the user mark favorites

Commits for the changes related to this day can be found in the vicinity of [this one](https://github.com/CypherPoet/100-days-of-swiftui-and-combine/commit/0d37238c500572a2df6ae320ac4dfc5464dc4e9e).

license: Unlicense


text:
Ansible is an agentless configuration management tool for provisioning, configuring, and deploying applications. Ansible is great for configuration management, but it’s not designed to manage secrets across multiple tools and cloud environments.

With this fully interactive hosted tutorial you will learn how to secure Ansible automation by keeping unsecured secrets out of Playbooks with Conjur open source secrets management.

# How it works?

1. Install Ansible Conjur Role and Lookup Plug-in
2. Load a Conjur policy that grants the Ansible control machine privileges on secrets
3. Run a playbook containing references to secrets stored in Conjur
4. Authenticate the control machine to Conjur
5. Issue the secrets
6. Playbook fetches secrets from Conjur and executes

All you need is a web browser and a few minutes to get started; no need to install anything!
Let's get started!

repository: cyberark/katacoda-scenarios

gha_language: Shell

repo_name: cyberark/katacoda-scenarios


text:
### [CVE-2012-1909](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1909)
![](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

The Bitcoin protocol, as used in bitcoind before 0.4.4, wxBitcoin, Bitcoin-Qt, and other programs, does not properly handle multiple transactions with the same identifier, which allows remote attackers to cause a denial of service (unspendable transaction) by leveraging the ability to create a duplicate coinbase transaction.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/akircanski/coinbugs
- https://github.com/uvhw/conchimgiangnang
- https://github.com/uvhw/wallet.cpp

repository: trickest/cve

repo_name: trickest/cve


text:
#Route Director Middleware

This class gives the Slim\Middleware class the ability to include or exclude certain routes.

Just extend the `RouteDirectorMiddleware` and override the `routeCall()` method.

The routes that are included/excluded MUST BE named routes.

You can exclude or include routes, but not both. It will test if there are any excluded routes first,
and stop if it finds some. Then it tests for included routes.

Here is an example of excluding some routes.

```php

class SomeMiddlewareName extends \VJS\Middleware\RouteDirectorMiddleware
{

	//Add some routes to exclude from the Middleware
	protected $excludedRoutes = [
		"MyNamedRoute",
		"Dashboard"
	];

	public function routeCall(){
		//Do stuff normal middleware stuff here
		$app = \Slim::getInstance();

		...

		//Remember 'MyNamedRoute' and 'Dashboard' WILL NOT execute the middleware

	}

}

```

Here is an example of including routes.

```php

class SomeMiddlewareName extends \VJS\Middleware\RouteDirectorMiddleware
{

	//Add some routes to include for Middleware
	protected $includedRoutes = [
		"MyNamedRoute",
		"Dashboard"
	];

	public function routeCall(){
		//Do stuff normal middleware stuff here
		$app = \Slim::getInstance();

		...

		//Remember 'MyNamedRoute' and 'Dashboard' WILL execute the middleware

	}

}

```

repository: jfrisella/RouteDirectorMiddleware

repo_name: jfrisella/RouteDirectorMiddleware


text:
# zetta-automate-app

A minimal [Zetta](https://github.com/zettajs/zetta) application for automating devices based on simple if-than-that rules described by a [YAML](https://github.com/timonreinhard/zetta-automate-app/blob/master/example/rules.yml) file.

## Install

Install it into your existing Zetta project by running:

```bash
$ npm install timonreinhard/zetta-automate-app --save
```

## Usage

Add the module to your existing `server.js`, e.g.:

```js
var zetta = require('zetta');
var Automate = require('zetta-automate-app');

zetta()
  .use(Automate)
  .listen(1337);
```

Then create a custom `rules.yml` in the root of your project directory. See the following section on how to write rules.

## Rule Syntax

```yaml
# rules.yml
my_rule:
  trigger:
    Water Sensor: wet
    Button: pressed
  action:
    Pump: turn-on
```

### my_rule

An unique identifier for the subsequent rule. Used for logging purposes and for triggering rules via Webhooks (see below).

### trigger

The optional `trigger` contains a list of device names and their corresponding state that should trigger the rule. In the example above the rule *my_rule* would be triggered if the device with `name` *Water Sensor* changes its `state` property to *wet*. Or if the device named _Button_ changes to _pressed_.

### action

The `action` holds one or more device transitions that should be run whenever the rule gets triggered. In the given example the transition `turn-on` would be called for the device named _Pump_.

## Webhooks

Rules can be triggered externally by sending `POST` requests to `http://localhost:1337/rule_name/trigger`.

## Limitations

* Only state changes are considered for triggering rule actions, other streams (_monitors_) are not supported.
* Devices are identified by their human-friendly `name` property, which is however not necessarily unique.

## Alternatives

I quickly hacked together this module, because I love the simplicity behind Zetta.js and wanted to do some [basic home automation](https://gist.github.com/timonreinhard/b6182a293867041bd4b667bbc339d807) with it. If you're looking for something way more sophisticated, you might like one of these fine FOSS projects:

* [openHAB](http://www.openhab.org) (Java)
* [Home Assistent](https://home-assistant.io) (Python)
* [pimatic](https://pimatic.org) (Coffee Script)

## License

Published under the [MIT License](https://github.com/timonreinhard/zetta-automate-app/blob/master/LICENSE).

repository: timonreinhard/zetta-automate-app

repo_name: timonreinhard/zetta-automate-app


text:
---
layout: page
title: Project Chime
description: An Audio Data Transfer System Over Commodity Embedded Devices
img: assets/img/wave2.png
importance: 3
category: work
---

            {% include figure.html path="assets/img/wave2.png" title="waves" class="img-fluid rounded z-depth-1" %}

### :bulb: Important Links

GitHub Repository

Full Report

---

### :speaker: Project Context

Members: Cole Feely, Aidan Murray, Owen Lheron and Sashank Rao

Start Date: Sept. 27, 2022

Due Date: December 8, 2022

## :postbox: Poster

---

            {% include figure.html path="assets/img/chime-poster.jpeg" title="poster" class="img-fluid rounded z-depth-1" %}

        Our Poster for the Project

---

## :mag_right: Background

There are some communication methods of data transfer using sensing signals with low-cost sensors but these systems produce low sampling rates which are not as efficient than high cost solutions with high sampling rates. We will investigate how we can improve sensing signal data transfer with low-cost sensors with low sampling rates by minimizing the error and noise rates commonly encountered.

---

## :dart: Goal

Encode data into an audio sensing signal and send it to a receiver where decoding algorithms will be performed to interpret the data.

---

## :mailbox: Deliverables

Demonstrate our goal with a modulation that best circumvents noise from audio channels, human speech or other background interference. Demonstrate better a reduction in the error rate from these interferences than off the shelf solutions Minimize decoding errors in the absence of symbol frame synchronization between the sender and receiver.

---

## :satellite: Hardware

- **Receiver/ Sender:** Arduino Uno
- **Speaker:** Personal Computer Speaker or a Piezo Buzzer
- **Microphone:** SparkFun Electret Microphone Breakout
- **Other:** Power Supply, Capacitors, Resistors, Jumpers etc.

---

## :vertical_traffic_light: Team Roles

- **Logistics:** Cole Feely
- **SBC:** Cole Feely
- **Hardware Filter:** Aidan Murray
- **FFT:** Owen Lheron
- **Signal Deconstruction:** Sash Rao

---

## :memo: Block Diagram

            {% include figure.html path="assets/img/chime-block-diagram.jpeg" title="chime block diagram" class="img-fluid rounded z-depth-1" %}

---

## :bar_chart: Results

Check out our results in our Final Academic Paper

---


text:
# Rnw Basic

This is a minimal example for getting started with Rnw files and knitr.

```bash
# generate pdf document
make

# clean files
make clean
```

branch_name: refs/heads/gh-pages


text:
# pico
Raspberry Pi Pico experiments

https://www.raspberrypi.com/products/raspberry-pi-pico/

## Micropython

[See README in folder micropython](./micropython)

## How to build the C++ examples

Install the pico-sdk and set the environment variable PICO_SDK_PATH pointing there.

On Windows with "Developer Command Prompt for VS 2017" execute:
```
mkdir build
cd build
cmake -G "NMake Makefiles" ..
nmake
```

Alternatively, launch VisualStudio Code from this shell with the CMake Tools configured for "cmake.generator": "NMake Makefiles".

## Pin-Out

<img src="./pico-gpios.png" />

repository: hrgraf/pico

repo_name: hrgraf/pico


text:
The AMEE category /transport/ship/generic/freight contains data on the
greenhouse gas emissions associated with ship transported freight
sourced from the UK government agency
[DEFRA](http://www.defra.gov.uk/environment/business/reporting/pdf/ghg-cf-guidelines2008.pdf).
The following [Ship freighting GHGP](Ship_freighting_GHGP) subcategories
provide ship-based freighting methodologies representing other
geographic contexts sourced from the World Resources Institute
[Greenhouse Gas Protocol
(GHGP)](http://www.ghgprotocol.org/calculation-tools/all-tools):

To use this category, select the type of ship using the *type* drill
down option.

Next, specify the distance and mass of the freight transported by
setting the ***distance*** and ***mass*** profile item values. The
returned value represents the mass of CO2 emitted in association
with the specified freighting.

repository: thegreenwebfoundation/datasets

repo_name: thegreenwebfoundation/datasets


text:
# LT-AdminLTE

[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-template/lt-adminlte.svg?style=flat-square)](https://packagist.org/packages/laravel-template/lt-adminlte)
[![Build Status](https://img.shields.io/travis/laravel-template/lt-adminlte/master.svg?style=flat-square)](https://travis-ci.org/laravel-template/lt-adminlte)
[![Quality Score](https://img.shields.io/scrutinizer/g/laravel-template/lt-adminlte.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-template/lt-adminlte)
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-template/lt-adminlte.svg?style=flat-square)](https://packagist.org/packages/laravel-template/lt-adminlte)

Welcome to the lt-adminlte!

This package provide an easy way to implement AdminLTE template on your Laravel Application.

![Main Layout](https://raw.githubusercontent.com/laravel-template/lt-adminlte/dev/demo/main-layout.gif)

More templates integrations will be added later in  [laravel-template](https://github.com/laravel-template).

## Installation

You can install the package via composer:

```bash
composer require laravel-template/lt-adminlte
```

Config file can be published using the command bellow
``` php
php artisan vendor:publish --tag lt-adminlte:config
```

In order to customize **views**, publish the first using,
``` php
php artisan vendor:publish --tag lt-adminlte:views
```

The same for **lang** files,
``` php
php artisan vendor:publish --tag lt-adminlte:views
```

## Usage

### Basic
This package use [Blade Component](https://laravel.com/docs/7.x/blade#components) to simplify the implementation of the feature in your application.

Just add the tag below depending on your desired layouts **_main_**:
``` php
<x-lte-main title="Your App Name" pageTitle="the active page title">Page Content</x-lte-main>
```
and more attribute may be added like:
* **logo**: your logo link

* **indexUrl**: your home page link triggered when clicking on your logo

* **navbarLinks**: displays list of menus on the top left of the navbar the links must be in this format
```php
[
    [
        'name' => 'Home',
        'link' => '/home'
    ],
    ...
]
```

* **breadcrumb**: breadcrumb also has the same format
```php
[
    [
        'name' => 'Home',
        'link' => '/home'
    ],
    ...
]
```
### Sidebar Navigation

To update the sidebar menu, make you sure you already published the views, then go to _**resources/views/vendor/lt-adminlte/components/layouts/sidebar.blade.php**_

then add navigation links under `<!-- Add navigation links here-->` comment
```php
<x-lte-sidebar-link title="Title" :route="['routeName']"/>

<x-lte-sidebar-link title="Parent" :route="['parentRoute']">
    <x-lte-sidebar-link title="Child" :route="['parentRoute.childRoute']" />
</x-lte-sidebar-link>
```
Other attributes are disponible:
* **badges**: displayed on the left of menu to that contain a value and a type like
```php
[
    [
        'type' => 'success', //types are: success, info, primary, warning, secondary, danger
        'value' => '10'
    ],
    ...
]
```
* **icon**: use [FontAwesome v5.13](https://fontawesome.com) library, displayed in the left of the menu **if the menu is not parent**, default value is ```far fa-circle```

* **rightIcon**: same a the normal icon the difference is this one is displayed on the right of the menu before the badges and **if the menu is not parent**

* **url**: for external links to use it make sure that **the route attribute is not provided**

### Testing

``` bash
composer test
```

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

If you discover any security related issues, please email<EMAIL_ADDRESS>instead of using the issue tracker.

## Credits

- [Amine TIYAL](https://github.com/laravel-template)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## Laravel Package Boilerplate

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

repository: Aliexer/lt-adminlte

repo_name: Aliexer/lt-adminlte


text:
# Introduction
 This is a simple GUI using PyQt for YOLO darknet mass detection NeuralSIGHT from final bachelor capstone project.
![results](GUI.png)
## Requirements
   - **PyQt5**
   - **YOLO darknet installed**
   - **OpenCV >= 4.4.0**

## How To Use

#### Step 0: Compile YOLO darknet

Follow AlexeyAB's instruction of [How to compile YOLO darknet on Linux or Windows](https://github.com/AlexeyAB/darknet#how-to-compile-on-linuxmacos-using-cmake)

#### Step 1: Install PyQt5 and OpenCV

Simple installation from PyPI
```bash
pip install PyQt5
pip install opencv-python
```
From Conda
```bash
conda install -c anaconda pyqt
```

#### Step 2: Setup Folder

- Move `main.py`,`main_window.py`, and `splashscreen.py` to your darknet folder.
- Put your `your-weight.weights` to weights folder.

**if you're going to use GUI with OpenCV skip to Step 3, otherwise follow these instructions for YOLO version inference**
- Edit `main_window.py` on line 190 to your darknet data folder directory path.
- If your OS is Windows or you have different name for your own cfg or weights files then edit `main_window.py` on line 200 to `darknet.exe detector test cfg/[your configuration].data cfg/[your configuration].cfg weights/[your weights].weights data/data.jpg -dont_show`

#### Step 3: Run Program
Run `main.py` for YOLO version inference

Run `mainCV.py` for OpenCV version inference

## NeuralSIGHT Team
* [fahriwps](https://github.com/fahriwps)
* [mariojy10](https://github.com/mariojy10)

repository: wenchenhui/Object-Detection-GUI

repo_name: wenchenhui/Object-Detection-GUI


text:
# Google App Engine Full Text Search (PHPNE14 Uncon Talk) #

Code for my PHPNE14 20 minute talk.

I wrote this on a train at 05:39, so I apologise in advance for the coding standards.

Also, I'm a novice Python developer.  Flame me @tom_walder

## Running Code ##

Check it out at

http://phpne14.appspot.com/

## Structure ##

This uses App Engine modules to run (primarily) PHP and Python in the same application "space".

We do this because (at the time of writing) Google don't provide access to Text Search via PHP.

## Wanna try it out yourself? ##

Don't forget to change the "application" in your .yaml files


text:
# epub
A pure go implementation of epub file format.

 [ ![Codeship Status for n3integration/epub](https://app.codeship.com/projects/1a12d410-d139-0135-6c51-26e28af241d2/status?branch=master)](https://app.codeship.com/projects/262382)
 [![codecov](https://codecov.io/gh/n3integration/epub/branch/master/graph/badge.svg)](https://codecov.io/gh/n3integration/epub)
 [![Go Report Card](https://goreportcard.com/badge/github.com/n3integration/epub)](https://goreportcard.com/report/github.com/n3integration/epub)
 [![Documentation](https://godoc.org/github.com/n3integration/epub?status.svg)](http://godoc.org/github.com/n3integration/epub)

## Usage

```diff
import (
  "bytes"
  "fmt"
  "io"

  "github.com/n3integration/epub"
)

func main() {
+ // 1. Open the epub by passing its file path
  f := "some.epub"
  book, err := epub.Open(f)
  defer book.Close()

+ // 2. Iterate over book sections
  book.Each(func(title string, xhtml io.ReadCloser) {
+   // 3. Read and process section contents
    buf := new(bytes.Buffer)
    buf.ReadFrom(xhtml)

    fmt.Println("==========================================================")
    fmt.Println(title)
    fmt.Println("==========================================================")
    fmt.Println(buf.String())
  })
}
```

## Reference
- [Specification](http://idpf.org/epub)

repository: austin-robertazza/epub

repo_name: austin-robertazza/epub


text:
# LISTPEQS

<PageHeader />

## Description

Displays print job status. It takes the general form:

```
LISTPEQS {options}
```

where **options** may take the form:

- “accountname” : specifies that only the print jobs owned by accountname be to be displayed. Use single or double quotes.
- A:  displays only those print jobs, which are owned by the currently logged on account. Default action is to display all print jobs.
- F: displays print jobs grouped by formqueue/printer. Default action is to display all printjobs in sequential order.
- n: display print job number n.
- n-m: displays print jobs in number range n to m inclusive
- P: sends output to the printer. Default action is to display in paged format to terminal.

```
PRINTER LIST ELEMENTS                14:28:24  01 APR 2018

# STAT LK LN STATUSES          CP FO PAGES   DATE     TIME   ACCT

4 xxxx  x  x QUEUED            1   1     1 01/04/18 14:28:09 jbase_user
1 QUEUE ELEMENTS LISTED.                 1 PAGES IN USE.
```

The STATUS column displays the status as per SP-JOBS and the specified assignment options.
The FO column displays the formqueue Number.
The PAGES column is equivalent to SP-JOBS SIZE field.
JobNumber, Copies, Date, Time, Acct are as per [SP-JOBS](./../sp-jobs).

Back to [Spooler.](./../jbase-spooler)

<PageFooter />

repository: patpog/docs

repo_name: patpog/docs


text:
## Simple Server Virtualization
Simple virtualizer implementation for TCP/UDP based on Netty

### Config
Change in pom.xml the port where virtualizer will be listening.

### Run
```
mvn exec:exec
```

### WORK IN PROGRESS
1.- Simplify how to get the patterns
2.- Add examples of patterns request/answer
3.- Add script processing to control answer flow

repository: lfcanals/simple-virtual

repo_name: lfcanals/simple-virtual


text:
Azure Site Replicator
===================

Azure Site Extension to replicate the content of one site to other sites using `msdeploy`. The replication happens automatically when it detects changes within the `site/wwwroot` folder of the source site.

**Note**: when running on a local machine, it may be necessary to delete the reg key `HKLM\Software\Wow6432Node\Microsoft\IIS Extensions\msdeploy\3\extensibility`, to avoid
running into the issue described [here](http://serverfault.com/questions/524848/msbuild-failing-on-build-looking-for-older-version-of-microsoft-data-tools-schem).

## Setting up in an Azure Web Site

1. The website should be in **Standard Plan Mode**.
2. **Always On** needs to be enabled in the configuration page in the Azure portal. Please do this **before** installing Site Replicator (to get around a bug).
3. Open the **scm** site: [http://yourWebsite.scm.azurewebsites.net](http://<yourWebsite>.scm.azurewebsites.net)
4. Go to the **Site Extension Gallery**.
5. Install **Site Replicator**.
6. Restart the website.

repository: projectkudu/AzureSiteReplicator

repo_name: projectkudu/AzureSiteReplicator


text:
# Mask GAN: Better Text Generation via Filling In The ___

[paper](pdf/maskGAN.pdf)

### Contribution

> **sample quality**
>
> 		(a cost functin on the output of RNN, which could encourage high sample quality)
>
> **actir-critic conditional GAN**
>
>

---
### Some insppiration

> non-differentiable sampling operations with effecient gradient approximators (Jang 2016, Maddison 2016)
>
> unbiased and low variance gradient estimate techniques such as (Tucker 2017)

---
### Model

##### Target
> infill the missing portions of text so that it is indistinguishable from the original data.

##### Error per time step
> discriminator will evaluate each token and thus provide a **fine-grained supervision signal to the generator**.

---

##### Architecture
**seq2seq**

##### Generator
Output distribution over the vocabulary size.

![generator equation](./img/generator_equation.png)

```m(x) is a mask function for x. ```
```for instance x = [happy new year],```
```m(x) = [1,0,1], then m(x) = [happy <m> year]```
```model should fill in the <m>```
![generator architecture](img/generator_architecture.png)
--

##### Discriminator

**Identical to generator**, except the **output is a scalar probability at each time point**, rather than a distribution over the vocabulary size.

```input data:```

	filled-in sequence from the generator,
	the original true context if the masked sequence m(x).

discriminator:
![discriminator](img/discriminator.png)

reward:
```the logarithm of the discriminator estimates are regarded as the reward```
![reward](img/reward_at_t.png)

--

##### Critic Network

estimates the value function, which is the discounted total return of the filled-in sequence
![reward_critic](img/reward_critic.png)
where γ is the discount factor.

--

##### Sampling Operation

---
### Related Work
> **Professor Forcing(Lamb, 2016)** and **Scheduled Sampling(Bengio, 2015)**
>
> 		try to solve unpredicable dynamics in the hidden state of RNN (because teacher forcing, ground-truth words are fed back into the model),
>
> 		**BUT**, they do not specify a cost function on the output of the RNN encouraging high sample quality
>
>  **Professor Forcing**
>
> 	using a discriminator to discriminate the **hidden states of a generator RNN** that is conditioned on real and synthetic samples.
> 	gradients can be passed through to the generator so that hiddfen state dynamics at inference time follow those at training time.

> **vanilly GAN**
>
> 		trainig instability
> 		mode dropping
> 			when certain modalities in the training set are rarely generated by the generator.
>
> **SeqGAN(Yu, 2017)**
>
> 		train a language model by using policy gradients to train the generator to fool a CNN-based discriminator that discriminates between real and synthetic text.
>
> 		Both generator and discriminator are pretrained on real and fake data before the phase of training with policy gradients.
>
> 		During training they then do Monte Carlo rollouts in order to get a useful loss signalper word.
>
> **Duscrete GANs(Yang, 2017)**
>
> 	improvement in **BLEU score for  Chinese-English translation**.
>
> ** Dialogue generation(Li, 2017)
> 	Reinforce with Monte Crlo sampling on the generator.
>
> **WGAN-GP (Gulrajani 2017)
>
> 		avoids the issue of dealing with BP through discrete nodes by generating text in a one-shot manner using a 1D CNN.
>
> 还有好几个，不想写了

---

repository: Bayesian-Razor/papernotes

repo_name: Bayesian-Razor/papernotes


text:
figleaf
=======

Privacy tools for robotics.

**Dependencies**

* ROS Groovy
* ROS workspaces located at `${HOME}/catkin_ws` and `${HOME}/rosbuild_ws`
* [rviz_camera_publisher](https://github.com/jstnhuang/rviz_camera_publisher) (depends on catkin version of view_controller_msgs)
  * [view_controller_msgs](https://github.com/ros-visualization/view_controller_msgs) (use hydro-devel to get the catkin version)
* [rviz_objdetect_caller](https://github.com/jstnhuang/rviz_objdetect_caller)
  * geometry_msgs
  * object_manipulation_msgs
  * pr2_interactive_object_detection
  * sensor_msgs
  * [scikit-image](http://scikit-image.org/download.html)
* [Modified version of rviz](https://github.com/jstnhuang/rviz_publish_shadow)

**For UW CSE users**

For help setting up ROS, see https://sites.google.com/site/humancenteredrobotics/internal/set-up-to-work-on-pbd-in-014 .

**Install**

1. Install view_controller_msgs and rviz_camera_publisher to the catkin workspace and compile.
  ```
  cd ~/catkin_ws/src
  git clone git@github.com:ros-visualization/view_controller_msgs.git -b hydro-devel
  git clone git@github.com:jstnhuang/rviz_camera_publisher.git
  cd ~/catkin_ws
  catkin_make
  ```

2. Install rviz_objdetect_caller to the rosbuild workspace on the workstation.
  ```
  cd ~/rosbuild_ws
  git clone git@github.com:jstnhuang/rviz_objdetect_caller.git
  rosmake
  ```

3. Install scikit-image:
   ```sudo pip install -U scikit-image```

4. Clone this repo to your home folder, ~/figleaf. Run scripts/install.py to create symbolic links in your catkin and rosbuild workspaces. Run `catkin_make` in your catkin workspace.

5. Download the modified version of rviz to your catkin workspace:
   ```
   cd ~/catkin_ws/src
   git clone git@github.com:jstnhuang/rviz_publish_shadow.git
   cd ~/catkin_ws
   catkin_make
   ```
   The modified version of rviz disables the "Kinect Stream" display. Instead, it uses the code in the Kinect Stream display that computes the point cloud shadow, and publishes the point cloud and shadow point cloud to a topic called /kinect_mld (multi-layer display).
   When the experiment is launched, it launches a node which sends /kinect_mld through a self-filtering nodes, which eliminates points that just represent the robot. The filtered point cloud is published to /kinect_mld_filtered.

5. Make the tabletop segmenter work on self-filtered point clouds. Solution for now: on the robot, run
   ```sudo vim /opt/ros/groovy/stacks/pr2_object_manipulation/applications/pr2_interactive_object_detection/launch/pr2_interactive_object_detection_robot.launch```

   Change tabletop_segmentation_points_inputs from `$(arg kinect_camera_name)/depth_registered/points` to `/kinect_mld_filtered`.

   Before:
   ```
   <!-- Launch default tabletop detector -->
    <include unless="$(arg cvfh)" file="$(find tabletop_object_detector)/launch/tabletop_complete.launch">
      <arg name="tabletop_segmentation_points_input" value="$(arg kinect_camera_name)/depth_registered/points"/>
      <arg name="flatten_table" value="$(arg flatten_table)"/>
      <arg name="model_set" value="$(arg model_set)"/>
    </include>

    <!--

On the robot, run interactive manipulation: `roslaunch pr2_interactive_manipulation pr2_interactive_manipulation_robot.launch`

On the workstation, go to the scripts directory and run `python all.py 123`, where 123 is the user ID (an integer). It will automatically pick a permutation of the filters to run through. To proceed through the tutorial and experiments, press 'y'. To skip something, press 'n'.

The filters are:
* *clean*: No filters at all
* *mid*: A superpixel and hue-inverted image + point cloud of only segmented objects
* *box*: A filter where segmented objects are shown as boxes.

The experiment script will save rosbag recordings to ~/experiment_data. Modify the script if you want to change where the data goes.

To change what topics get logged or what nodes get run, run `rosed figleaf_2d experiment.launch` to change the launch file.

After, you can get the time taken for each condition using `python scripts/process_bag.py ~/experiment_data/123_clean.bag`.

repository: imclab/figleaf

repo_name: imclab/figleaf