text:
---
layout: post
title: "GAD3"
description: ""
category: genes
tags:
---

* **Information**
    + Symbol: GAD3
    + MSU: [LOC_Os03g13300](http://rice.uga.edu/cgi-bin/ORF_infopage.cgi?orf=LOC_Os03g13300)
    + RAPdb: [Os03g0236200](https://rapdb.dna.affrc.go.jp/locus/?name=Os03g0236200)

* **Publication**
    + [The rice R2R3-MYB transcription factor OsMYB55 is involved in the tolerance to high temperature and modulates amino acid metabolism](http://www.ncbi.nlm.nih.gov/pubmed?term=The rice R2R3-MYB transcription factor OsMYB55 is involved in the tolerance to high temperature and modulates amino acid metabolism%5BTitle%5D), 2012, PLoS One.
    + [An In Vivo Targeted Deletion of the Calmodulin-Binding Domain from Rice Glutamate Decarboxylase 3 OsGAD3 Increases <a6><c3>-Aminobutyric Acid Content in Grains.](http://www.ncbi.nlm.nih.gov/pubmed?term=An In Vivo Targeted Deletion of the Calmodulin-Binding Domain from Rice Glutamate Decarboxylase 3 OsGAD3 Increases <a6><c3>-Aminobutyric Acid Content in Grains.%5BTitle%5D), 2020, Rice (N Y).

* **Genbank accession number**
    + [AY187941](http://www.ncbi.nlm.nih.gov/nuccore/AY187941)

* **Key message**

* **Connection**
    + __GAD3__, __OsMYB55~OsPL__, [The rice R2R3-MYB transcription factor OsMYB55 is involved in the tolerance to high temperature and modulates amino acid metabolism](http://www.ncbi.nlm.nih.gov/pubmed?term=The rice R2R3-MYB transcription factor OsMYB55 is involved in the tolerance to high temperature and modulates amino acid metabolism%5BTitle%5D), We demonstrate that OsMYB55 binds to the promoter regions of target genes and directly activates expression of some of those genes including glutamine synthetase (OsGS1;2) glutamine amidotransferase (GAT1) and glutamate decarboxylase 3 (GAD3)
    + __GAD3__, __GLN1;2~GS1;2~OsGS1;2__, [The rice R2R3-MYB transcription factor OsMYB55 is involved in the tolerance to high temperature and modulates amino acid metabolism](http://www.ncbi.nlm.nih.gov/pubmed?term=The rice R2R3-MYB transcription factor OsMYB55 is involved in the tolerance to high temperature and modulates amino acid metabolism%5BTitle%5D), We demonstrate that OsMYB55 binds to the promoter regions of target genes and directly activates expression of some of those genes including glutamine synthetase (OsGS1;2) glutamine amidotransferase (GAT1) and glutamate decarboxylase 3 (GAD3)
    + __GAD3__, __GAT1__, [The rice R2R3-MYB transcription factor OsMYB55 is involved in the tolerance to high temperature and modulates amino acid metabolism](http://www.ncbi.nlm.nih.gov/pubmed?term=The rice R2R3-MYB transcription factor OsMYB55 is involved in the tolerance to high temperature and modulates amino acid metabolism%5BTitle%5D), We demonstrate that OsMYB55 binds to the promoter regions of target genes and directly activates expression of some of those genes including glutamine synthetase (OsGS1;2) glutamine amidotransferase (GAT1) and glutamate decarboxylase 3 (GAD3)

[//]: # * **Key figures**


text:
# @k4connect/browserslist-config

## Purpose

The configuration for [browserslist](https://www.npmjs.com/package/browserslist) that we use here at K4Connect.  This provides autoconfiguration for a variety
of projects, including:
  * [`@babel/preset-env`](https://babeljs.io/docs/en/next/babel-preset-env.html) -- lets you write ESNext despite your target environment.
  * [Autoprefixer](https://github.com/postcss/autoprefixer) -- lets you forget about vendor prefixes in CSS entirely, freeing you up to use modern CSS without duplicating implementation details in multiple vendor-specific properties
  * [`postcss-normalize`](https://github.com/csstools/postcss-normalize/blob/master/README.md) -- ensures you have the minimal patches necessary to get consistent CSS behavior between target browsers
  * [`postcss-preset-env`](https://preset-env.cssdb.org/features) -- allows you to use modern CSS features (eg: ["custom properties", otherwise known as "CSS variables"](https://preset-env.cssdb.org/features#custom-properties)) while maintaining compatibility with all desired targets

## Usage

Two steps:

  1.  `npm install --save-dev @k4connect/browserslist-config`
  2.  Add this to your `package.json`:
    * If you are targetting Node: `"browerserslist": [ "extends @k4connect/browserslist-config/node.js" ]`
    * If you are targetting browsers: `"browerserslist": [ "extends @k4connect/browserslist-config/browser.js" ]`
    * If you are targetting React Native, you'll have to research how to configure `browserslist` properly and then update this repo.  Or you could just try the Node one: it'll probably work.

license: Unlicense

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: Unlicense

license_type: permissive


text:
# react-redux-course-2017
React with Redux course. Including ESLint and Prettier integration.

## AJAX Requests with React

```
> git clone https://github.com/stanimirtt/react-redux-course-2017.git
> cd react-redux-course-2017/02 AJAX Requests with React
> npm install
> npm start
```

license: MIT

url: https://raw.githubusercontent.com/stanimirtt/react-redux-course-2017/084d6bc838a51b3c069ae2813b3401beca0c9757/02 AJAX Requests With React/README.md

path: /02 AJAX Requests With React/README.md

gha_license_id: MIT


text:
(Jun 1, 2020)
----------------------
### Add
- Struct `MessageThreadResponse` as the return type of `PSNInner::send_message` and `PSNInner::send_message_with_buf`

(May 8, 2020)
----------------------
### Break
- `refresh_token` would be updated when `PSNRequest::gen_access_and_refresh`, `PSNRequest::gen_access_from_refresh` are called and render the old `refresh_token` invalid.
- `PSN::get_inner` has been added to give access to `Pool<PSNInnerMananger>` and it can be used to retrieve latest `refresh_token`. Examples have been updated accordingly

(April 26, 2020)
----------------------
### Break
- refactor `PSNRequest` trait and it now requires a `Client` type to pass to most of methods.
### Add
- `PSN::new()` now accept multiple `PSNInner` to achieve a high concurrency(With multiple refresh_tokens/npsso codes).

(April 26, 2020)
----------------------
### Break
- refactor some of the APIs to take agrs instead of mutate the state of `PSNInner`.
- Most API calls take `&Self`.

### Add
- experimental connection pool for http proxies.

gha_language: Rust


text:
Specifications for the Rails with jQuery Assessment

Specs:

X   Use jQuery for implementing new requirements
X   Include a show resource rendered using jQuery and an Active Model       Serialization JSON backend.

X  Include an index resource rendered using jQuery and an Active Model      Serialization JSON backend.

X   Include at least one has_many relationship in information rendered via      JSON and appended to the DOM.
X   Use your Rails API and a form to create a resource and render the response without a page refresh.
X    Translate JSON responses into js model objects.
X    At least one of the js model objects must have at least one method     X   added by your code to the prototype.

repository: illusioninlost/farming

repo_name: illusioninlost/farming


text:
# resolve-promise-object

[![Greenkeeper badge](https://badges.greenkeeper.io/Qard/resolve-promise-object.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/Qard/resolve-promise-object.png)](https://travis-ci.org/Qard/resolve-promise-object)

Easily resolve an object full of promises, or even recursively construct an object made of promises.

## Install

    npm install resolve-promise-object

## Usage

    var p1 = Q.defer()
    var p2 = Q.defer()

    resolvePromises({
      foo: p.promise
    }, function (err, res) {
      console.log(res.foo.bar) // baz
    })

    p1.resolve({
      bar: p2.promise
    })

    p2.resolve('baz')

---

### Copyright (c) 2013 Stephen Belanger
#### Licensed under MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: Qard/resolve-promise-object

repo_name: Qard/resolve-promise-object


text:
---
layout: page
title: Dots of War
include_in_header: true
---

# Dots of War - Connect the dots

## The new way to play connect the dots with a fantastic medieval twist

Dots of War is an addictive and competitive puzzle game (based on dots and boxes / Timbiriche) in which you have to connect points with lines to gain ground against your opponent.
Choose one of the three clans available to compete online.

The objective is simple: Forming a square with four lines will capture the terrain, once you do it you will have an extra turn. You can use your ability to prevent your opponent from using combos!

# Trailer
[![Dots of War trailer](https://raw.githubusercontent.com/Ucamo/LunarCrown/master/assets/Presskit_Dots_of_War/Captura_video.PNG)](https://www.youtube.com/watch?v=dkBLGVO7Sc4)

# Screenshots

Download all screenshots and Photos as a .zip (17.7MB)

Dots of War allows you to compete against players from all over the world and appear in the world ranking with the best players.

- It is FREE to play forever
- CONNECT four points with lines to form a square.
- WIN in classic mode by competing against an online opponent, whoever has the most points when all terrain is conquered will win.
- LOVELY fun, and a very careful game design in this excellent connect game
- ENJOY the beautiful design of the 3D map, the various 2D aspects that bring the characters to life, and the beautiful music.
- CHALLENGE your friends to Dots of War games online and reach the top of the leaderboards.
- Make a line, not a circle, to connect all the points of a color, or connect four points to make a square
- PLAY a game and then let a friend play for a final one-on-one match

-------------------------------

# Contact

## LET'S BE FRIENDS ON FACEBOOK

## FOLLOW US ON TWITTER

## OFFICIAL SITE

## Inquiries<EMAIL_ADDRESS>
# LunarCrown

LunarCrown is an independent video game studio based on Hermosillo Sonora México, founded on 2019 as the merge effort of various solo indie studio projects to publish polished and profesional games. Dots of War it's their first game and one of the first online multiplayer games in Mexico.

### Game Design, 2D art
- Arvin Valenzuela

### UX-UI, Quality Assurance
- José Miguel Agulo

### Art Director, 2D art
- Roberto Carlos Nuñez López

### 3D art
- Mariel Rojas Pérez
- Sergio Mireles

### Programming
- Antonio Martinez
- Uriel Carrillo

repository: Ucamo/LunarCrown

repo_name: Ucamo/LunarCrown


text:
# Semantic Conventions for Feature Flag Evaluations

**NOTICE** Semantic Conventions are moving to a
[new location](http://github.com/open-telemetry/semantic-conventions).

No changes to this document are allowed.

**Status**: [Experimental](../../document-status.md)

This document defines semantic conventions for recording feature flag evaluations as
a [log record](../data-model.md#log-and-event-record-definition) emitted through the
[Logger API](../bridge-api.md#emit-a-logrecord).
This is useful when a flag is evaluated outside of a transaction context
such as when the application loads or on a timer.
To record a flag evaluation as a part of a transaction context,
consider [recording it as a span event](../../trace/semantic_conventions/feature-flags.md).

For more information about why it is useful to capture feature flag evaluations,
refer to the [motivation](../../trace/semantic_conventions/feature-flags.md#motivation)
section of the trace semantic convention for feature flag evaluations.

<!-- toc -->

- [Recording an Evaluation](#recording-an-evaluation)
- [Attributes](#attributes)

<!-- tocstop -->

## Recording an Evaluation

Feature flag evaluations SHOULD be recorded as attributes on the
[LogRecord](../data-model.md#log-and-event-record-definition) passed to the [Logger](../bridge-api.md#logger) emit
operations. Evaluations MAY be recorded on "logs" or "events" depending on the
context.

## Attributes

The table below indicates which attributes should be added to the
[LogRecord](../data-model.md#log-and-event-record-definition) and their types.

<!-- semconv log-feature_flag -->
The event name MUST be `feature_flag`.

| Attribute  | Type | Description  | Examples  | Requirement Level |
|---|---|---|---|---|
| [`feature_flag.key`](../../trace/semantic_conventions/feature-flags.md) | string | The unique identifier of the feature flag. | `logo-color` | Required |
| [`feature_flag.provider_name`](../../trace/semantic_conventions/feature-flags.md) | string | The name of the service provider that performs the flag evaluation. | `Flag Manager` | Recommended |
| [`feature_flag.variant`](../../trace/semantic_conventions/feature-flags.md) | string | SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. [1] | `red`; `true`; `on` | Recommended |

**[1]:** A semantic identifier, commonly referred to as a variant, provides a means
for referring to a value without including the value itself. This can
provide additional context for understanding the meaning behind a value.
For example, the variant `red` maybe be used for the value `#c05543`.

A stringified version of the value can be used in situations where a
semantic identifier is unavailable. String representation of the value
should be determined by the implementer.
<!-- endsemconv -->

branch_name: refs/heads/main

gha_language: Makefile


text:
# Changelog

## 4.0.0 - 2021-01-08

- Upgraded to Laravel 8.

## 3.0.0 - 2019-07-28

- Upgraded to Laravel 5.7.
- Upgraded to [webpush@4.0.0](https://github.com/laravel-notification-channels/webpush/releases/tag/4.0.0).

## 2.0.0 - 2017-11-15

- Upgraded to Laravel 5.5.
- Upgraded to [webpush@3.0.0](https://github.com/laravel-notification-channels/webpush/releases/tag/3.0.0).
- Updated Service Worker.

## 1.0.0 - 2017-03-25

- Added support for VAPID. See [webpush@1.0.0](https://github.com/laravel-notification-channels/webpush/releases/tag/1.0.0)

## 0.3.0 - 2017-01-26

- Upgraded to Laravel 5.4.

## 0.2.0 - 2017-01-15

- Upgraded to Vue 2.
- Replaced [vue-resource](https://github.com/pagekit/vue-resource) with [axios](https://github.com/mzabriskie/axios).


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Versioning loosely follows Semantic Versioning. Patch numbers are used for corrections of the DTD where we feel
that this is more in line with NAF.

## v3.3.1
* Date: June 30, 2022
* Author: Sophie Arnoult<EMAIL_ADDRESS>
### Changed
* `chunk` elements have one and only one `span` child

## v3.3
* Date: June 7, 2022
* Authors: Sophie Arnoult<EMAIL_ADDRESS>### Added

* `lpDependency` element
* `id` attribute to `lp` element

### Changed

* `lp` element accepts `lpDependency` children and `id` attribute
* restrict element declaration of: `causalRelations`, `component`, `coref`, `entity`, `externalRef`, `mark`, `mw`, `opinion`,
`opinion_expression`, `opinion_holder`, `opinion_target`, `predicate`, `role`, `statement`, `term`, `wf`

### Removed

* `factualityLayer` element

## v3.2
* Date: January 19, 2021
* Author: Sophie Arnoult<EMAIL_ADDRESS>
#### Added

* `tunits` layer and `tunit` element

## v3.1
* Date: June 26nd, 2020
* Authors: Piek Vossen (piek.vossen@vu.nl), Antske Fokkens<EMAIL_ADDRESS>and Marten Postma<EMAIL_ADDRESS>
#### Added

* `subtoken` element
* `multiwords` layer and `mw` elements

#### Changed

* `wf` element accepts `subtoken` children
* `entity` element directly accepts `span` child; attribute `type` becomes optional
* `predicate` element loses `uri` attribute
* `role` element loses `uri` attribute
* `span` element accepts `status` attribute
* `term` element accepts `component_of` and `compound_type` attributes
* `externalRef` element accepts `timestamp` attribute

gha_language: Python


text:
---
title: 'No Solder Battery Interrupter'
authors: 'Gavin Philips'
datemod: '2017-10-22T10:52:41Z'
download_url: 'http://www.instructables.com/id/No-Solder-Battery-Interrupter/'
project_url: 'http://www.instructables.com/id/No-Solder-Battery-Interrupter'
description: "\nA battery interrupter is a tool that adds a switch jack to (aka \"switch adapts\") an electrical device. "
tags:
    - alternative-access
    - switches
categories:
    - hardware
original_url: 'http://www.instructables.com/id/No-Solder-Battery-Interrupter'
short_title: NoSolderBatteryInterrupter-8bq
license: 'Creative Commons BY-NC-SA)'
date: '2017-10-22T10:54:51Z'
relayed_by_ip: <IP_ADDRESS>
moderated: true
moderated_short_title: NoSolderBatteryInterrupter
thumb: items/NoSolderBatteryInterrupter-thumb.jpg
image: items/NoSolderBatteryInterrupter.jpg

---
This is usually done for the purpose of allowing a person with disabilities to use that device, by using an "ability switch," which can be anything from a plastic button to a muscle twitch sensor.  These switches are almost always wired to a 3.5mm (1/8") mono plug, and can be connected to anything with a matching jack.  They are used with power wheelchairs, computers, speech devices, toys, remote controls, and so on.

A battery interrupter allows us to add a switch jack to a device that:

1) Is powered by AA, AAA, C, or D batteries.
2) Simply turns on or off with a single switch (like the infamous cymbal-crashing monkey).

A battery interrupter is simply a 3.5mm jack, with each of the two wires connected to small metal plates, which are separated by an insulator (like tape or thick paper).  These plates are placed between the batteries of a device, effectively redirecting the electrical circuit through the 3.5mm jack, so that it can be opened and closed with a switch.

AbleNet sells battery interrupters for $13 (USD) each here (and the manual is here).  You can also make your own battery interrupters by soldering a pair of wires (or a speaker wire) to a 3.5mm jack and to two small metal plates separated by double-sided tape or some other thin insulator.  However, if you are not comfortable soldering, this guide will teach you how to make a battery interrupter with only a few dollars worth of parts (or the scraps left from making a CD Switch).

repository: openassistive/OpenATFrontEnd

repo_name: openassistive/OpenATFrontEnd


text:
# برنامه هواشناسی

**نیازمندی‌ها**
- Android Studio 3.5 beta 2
- JDK 8
- Android SDK 28
- Supports API Level +17
- Material Components 1.1.0-alpha05

**ویژگی‌ها**
- Use [OpenWeatherMap] API
- Use Material Design 2
- Support two language. English & Persian
- Use locale Database

**عکس برنامه**

**کتابخانه‌ها**
- [Support libraries]: appcompat / recyclerview / constraintlayout
- [Material Design 2]: MaterialCardView / MaterialButton / Bottom App Bars / ExtendedFloatingActionButton
- [FastAdapter]: The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction
- [Calligraphy3]: Custom fonts in Android the easy way
- Square [Retrofit] / [Okhttp] / [Logging-Interceptor]
- [ObjextBox]: ObjectBox is a superfast lightweight database for objects
- [RxAndroid] Reactive Extensions for Android
- [Glide]: An image loading and caching library for Android focused on smooth scrolling
- [Lottie-Android]: Render After Effects animations natively on Android
- [MaterialSearchView]: Cute library to implement SearchView in a Material Design Approach
- [MPAndroidChart]: A powerful & easy to use chart library for Android
- [Firebase Core] / Crashlytics
- [ButterKnife]: Bind Android views and callbacks to fields and methods.

**Credit**

### This app inspired from [Weather App Freebie] concept Designed by [Raman Yv]

# License

    Copyright 2019 Behrouz Khezry

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

[Weather App Freebie]: https://www.uplabs.com/posts/weather-app-freebie
[Raman Yv]: https://www.uplabs.com/ramandesigns9
[OpenWeatherMap]: https://openweathermap.org/
[Support libraries]: https://developer.android.com/jetpack/androidx/
[Material Design 2]: https://material.io/develop/android/
[FastAdapter]: https://github.com/mikepenz/FastAdapter
[Calligraphy3]: https://github.com/InflationX/Calligraphy
[Retrofit]: https://github.com/square/retrofit
[Okhttp]: https://github.com/square/okhttp
[Logging-Interceptor]: https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor
[ObjextBox]: https://github.com/objectbox/objectbox-java
[RxAndroid]: https://github.com/ReactiveX/RxAndroid
[Glide]: https://github.com/bumptech/glide
[Lottie-Android]: https://github.com/airbnb/lottie-android
[MaterialSearchView]: https://github.com/MiguelCatalan/MaterialSearchView
[MPAndroidChart]: https://github.com/PhilJay/MPAndroidChart
[Firebase Core]: https://firebase.google.com/
[ButterKnife]: https://github.com/JakeWharton/butterknife


text:
# SparkML-DAG

Implementation of a DAG Pipeline for SparkML.

# Motivation

This library extends SparkML to allow for Pipelines that are DAG based.
That is multiple input datasets can be manipulated to create complex models.
One such example can be seen in the [test](src/test/scala/org/apache/spark/ml/feature/dag/DAGPipelineTest.scala).

# Development

Clone this repository and run `mvn clean test`

To build for a custom version of Spark/Scala, run
`mvn clean package \
-Dscala.major.version=<SCALA_MAJOR> \
-Dscala.minor.version=<SCALA_MINOR>\
-Dspark.version=<SPARK_VERSION>`

e.g.
```bash
mvn clean package \
-Dscala.major.version=2.11 \
-Dscala.minor.version=2.11.8 \
-Dspark.version=2.3.0
```

## build profiles

Alternatively one can build against a limited number of pre-defined profiles.
See the [pom](pom.xml) for a list of the profiles.

Example build with profiles:

`mvn clean package -Pspark_2.3,scala_2.11`

`mvn clean package -Pspark_2.0,scala_2.10`

# Support

Here is a handy table of supported build version combinations:

| Apache Spark | Scala |
|:------------:|:-----:|
| 2.0.x        | 2.10  |
| 2.0.x        | 2.11  |
| 2.1.x        | 2.10  |
| 2.1.x        | 2.11  |
| 2.2.x        | 2.10  |
| 2.2.x        | 2.11  |
| 2.3.x        | 2.11  |

# License

see the [license](LICENSE) for license information.

repository: belbis/SparkML-DAG

repo_name: belbis/SparkML-DAG


text:
## SOLID principles

- S = Single Responsibility - Each class/instance should have only 1 responsibility
- O = Open Closed - Objects should be open for extension closed for modification
- L = Liskov substitution - Instance objects can be replaced with subtypes without altering correctness
- I = Interface Segregation - Multiple specific interfaces are better than big general one
- D = Dependency Injection - High level and Low level modules should both depend on abstraction

## Other design principles

- Code to interface not implementation
- Favor composition over inheritance
- Encapsulate what changes
- Strive for loose coupling between objects
- Principle of least knowledge = Talk only to immediate friends

gha_language: PHP


text:
# Memento pattern

## Definition
  Memento pattern provides temporary storage and restoration of an object.

## Implementation
1) The example displays Person class with username and userid attributes.
2) DataStore class is used for storing the state of the user.
3) JSON Stringify method is used to store the object data and restoration.
4) In implementation user is created. User data is stored using saveData() method which is Memento representation.
5) Userid is modified to another string.
6) for restoring the data, revealData() is called which takes the userId saved earlier and reveals the userId which states that
Memento pattern is established.
7) The interface shown in UML is not used in this example due to Javascript restrictions.

## Links
[Person.js](./Person.js)
[DataStore.js](./DataStore.js)
[app.js](./app.js)

## UML Diagram:
![Memento Design Pattern](memento.png)

## Advantages
1) To preserve the object state so that any minor changes could be done to the data object id necessary.

repository: ChicoState/DesignAndMaintenance

gha_language: Java

repo_name: ChicoState/DesignAndMaintenance


text:
# Configurator

This is system that will allow a user to interactively
configure the WiFi on their ESP32.

## Usage
The user (client) starts the device and connects to the
Configurator WiFi network. His/her device will receive
an IP address via DHCP.

From there, the client connects to port 8080 on the default
gateway. They can issue a series of commands:

1. `list!`: List all the nearby APs
1. `scan!`: Rescan for nearby APs
1. `connect:x:y!`: Connect as a client to the `x` network
using password `y`.

After the client issues a connect command, their device
is disconnected from the network and the Configurator WiFi
network will disappear. Should the client specify incorrect
parameters for the connection, the Configurator network will
reappear and the client can try again.

## TODOs

Too many to list.


text:
[OS.js](https://os.js.org/) is an [open-source](https://raw.githubusercontent.com/os-js/OS.js/master/LICENSE) desktop implementation for your browser with a fully-fledged window manager, Application APIs, GUI toolkits and filesystem abstraction.

[![bitHound Score](https://www.bithound.io/github/os-js/OS.js/badges/score.svg)](https://www.bithound.io/github/os-js/OS.js)
[![Travis CI Build Status](https://travis-ci.org/os-js/OS.js.svg?branch=master)](https://travis-ci.org/os-js/OS.js)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bcb06aa267d5433db95a581237c23453)](https://www.codacy.com/app/andersevenrud/OS-js?utm_source=github.com&utm_medium=referral&utm_content=os-js/OS.js&utm_campaign=Badge_Grade)
[![Community](https://img.shields.io/badge/join-community-green.svg)](http://community.os.js.org/)
[![JS.ORG](https://img.shields.io/badge/js.org-os-ffb400.svg)](http://js.org)
[![Tips](https://img.shields.io/gratipay/os-js.svg)](https://gratipay.com/os-js/)
[![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=andersevenrud%40gmail%2ecom&lc=NO&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)
[![Support](https://img.shields.io/badge/patreon-support-orange.svg)](https://www.patreon.com/user?u=2978551&ty=h&u=2978551)

## Try it yourself

Visit the [official demo](https://osjsv2.0o.no) for a preview version. Please note that some features are disabled and might be outdated or unavailable at times.

![ScreenShot](https://raw.githubusercontent.com/os-js/OS.js/master/src/gfx/screenshot.png)

## Installation

You can find the quick setup guide in the [INSTALL.md file](https://github.com/os-js/OS.js/blob/master/INSTALL.md).

Head over to the [installation manual page](https://os.js.org/manual/installation) for more detailed instructions.

## Documentation

* [Manuals](https://os.js.org/manual/)
* [API Documentation](https://os.js.org/doc/)
* [Contribution Guide](https://github.com/os-js/OS.js/blob/master/CONTRIBUTING.md)

## Links

* [Official Chat](https://gitter.im/os-js/OS.js)
* [Community Forums and Announcements](http://community.os.js.org/)
* [Homepage](https://os.js.org/)
* [Google+](https://plus.google.com/b/113399210633478618934/113399210633478618934)
* [Facebook](https://www.facebook.com/os.js.org)


text:
# How to receive and send Waves

# How to receive Waves

Waves receiving is very straightforward. Just share your Waves address and hand it to the person who wants to send you Waves.

Open your Waves app and log in to your Account.
At the top right corner click on the QR-code icon.

![](/waves-client/mobile-apps/_assets/waves_address_01.png)

The following pop-up will appear.

There you will find Waves address of your account. Copy it by clicking on the **Copy** or **Share** with the sender. Also, there you will find **QR code** that contains your address.

![](/waves-client/mobile-apps/_assets/waves_address_02.png)

# How to send Waves

Open your Waves app and log in to your Account.
At the bottom of the interface, click on the ![](/waves-client/mobile-apps/_assets/waves_transfers_ios_01.png) and click on the **Send**.

The following window will appear.

![](/waves-client/mobile-apps/_assets/waves_transfers_ios_02.png)

Fill in the sending form.

* **Asset**: Choose **Waves** from the drop-down menu.
* **Recipient**: Put the recipient address or scan QR-code or choose from Address book.
* **Amount**: Define a number of Waves you want to send or choose **Use total balance** **50%** **10%** **5%**

After you have entered all necessary information click on the **Continue**.

Re-check entered data and click on the **Confirm** to complete the process.

![](/waves-client/mobile-apps/_assets/waves_transfers_ios_03.png)

## How to use sponsored fee

Waves users can also use a sponsored fee to pay for outgoing transfers. Check your portfolio, if you see a token with **%** icon. So it means you can change the default Waves fee to another sponsored token.

So how to do it? Just create an outgoing transfer described above and click on the **WAVES** under **Continue** button.
Choose an available sponsored token and click on the **Continue** button.

![](/waves-client/mobile-apps/_assets/transaction_fee.png)

___

See more articles in the [Transfers and gateways](/waves-client/mobile-apps/iOS/wallet-management.md) chapter.

If you have troubles with our platform, please create a [support](https://support.wavesplatform.com/) ticket or write a [question](https://forum.wavesplatform.com/) on our forum.


text:
# Lab Plan

Week 1 - Install Python (Jupiter Notebook) and Hello World Programs.
Week 2 - Install git and create your own personal repository - Command Line.
Week 3 - Use Jupiter to create a calculation, extract and run at command line.  Demo an Automated Test.
Week 4 - Read, sort, search, Write file. (uses module)
Week 5 - Simple Web Scrapper. (Hack-A-Thon Week) (uses object/module)
Week 6 - Simple Web Server (bottle+file+api) - Server with no persistence.
Week 7 - Add in a Database to week (6) Sqlite - Create Visitor, Show Table of Visitors
Week 8 - Install and Run Tensor Flow
Week 9 - Tensor Flow Image Classification (example using existing data)
data analysis  (graphs, numpy, pandas etc)
Week 10 - Training to find "cats" v.s. "dogs"
Week 11 - Hand Written Text Recognition
Week 12 - Predicting House Prices
Week 13 - Sentiment Analysis (uses web-scraper from week 5 lab)
Week 14 - Suduko Player
Week 15 - No Lab.

[ Tools, Code, Setup, Environment ]

1. Basic Code
2. Testing
3. Conversion of specification to code
4. Objects
5. Files
6. Debugging Code
7. Testing Code
8. Editing
9. Documentation of Code
10. Web Technologies
11. AI/Machine Learning

Suduko Player -
Hand Written Text Recognizer -
https://www.coursera.org/collections/tensorflow-keras-projects-beginners
	- Predicting House Prices
	- Sentiment Analysis

<!--
    August 2021
Su Mo Tu We Th Fr Sa
22 23 24 25 26 27 28
       ^=================== (( Week 1 ))
       ^=================== 1st day of class
29 30 31
       ^=================== (( Week 2 ))

   September 2021
Su Mo Tu We Th Fr Sa
          1  2  3  4
 5  6  7  8  9 10 11
       ^=================== (( Week 3 ))
12 13 14 15 16 17 18
       ^=================== (( Week 4 ))
19 20 21 22 23 24 25
       ^=================== (( Week 5 ))
		  ^^^^^^^=========== Hack-A-Thon
26 27 28 29 30

       ^=================== (( Week 6 ))

    October 2021
Su Mo Tu We Th Fr Sa
                1  2
 3  4  5  6  7  8  9
       ^=================== (( Week 7 ))
10 11 12 13 14 15 16
       ^=================== (( Week 8 ))
       ^=================== Midterm Exam
17 18 19 20 21 22 23
       ^=================== (( Week 9 ))
24 25 26 27 28 29 30
       ^=================== (( Week 10 ))
31

   November 2021
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
       ^=================== (( Week 11 ))
 7  8  9 10 11 12 13
       ^=================== (( Week 12 ))
14 15 16 17 18 19 20
       ^=================== (( Week 13 ))
21 22 23 24 25 26 27
	!!!!!!!!!!!!============= No Class / No Lab - week off
28 29 30
       ^=================== (( Week 14 ))

   December 2021
Su Mo Tu We Th Fr Sa
          1  2  3  4
 5  6  7  8  9 10 11
       ^=================== (( Week 15 ))
12 13 14 15 16 17 18
       ^=================== (( Finals Week ))
19 20 21 22 23 24 25
26 27 28 29 30 31

-->


text:
---
layout: page
title: Projects
permalink: /projects/
---

Here are some of the projects I have undertaken/worked on over the course of my undergraduate degree.

### 1. Remote Intelligent Assistant (REIA)	[link](https://github.com/aseem96/Remote-Intelligent-Assistant-REIA)

A desktop assistant for Linux based systems that enable the user to communicate with his/her machine in English/Natural Language , which is translated to the corresponding Linux command by our system. The project is based on Machine Learning and Natural Language processing and was undertaken as our final year project.

Tags: Machine Learning, Natural Language Processing, Python, Chatbot

### 2. Traffic Analysis Application using Social Media feed

A machine learning model to analyze and predict traffic conditions in Pune based on feeds from social media like tweets, RSS feeds, FB status updates. The application extracts info such as location, reason for traffic congestion and displays the data on an interactive dashboard.

**Tags**: Machine Learning, Natural Language Processing, Python, Sentiment Analysis, Traffic Updates

### 3. Movie Recommendation System using Sentiment Analysis of Movie Reviews

A simple application using a Machine Learning model that works on a set of training data, using Random Forest Classifier to classify real time movie reviews, and design a movie recommendation system for the user based on that.

**Tags**: Machine Learning, Sentiment Analysis, Random Forest Classifier, Movies

### 4. Shuttlecock Tracking and Trajectory Estimation using Microsoft Kinect

The project was undertaken in line with the theme for  ABU Robocon 2015  theme ‘Robominton’, which was essentially a doubles badminton game between the robots of the contesting teams. The trajectory equation was transferred to the robot via Bluetooth. Regression algorithms were used for trajectory estimation. Project was completed under the valuable guidance of Castalia Research Labs, Pune. Published our work in an international journal [link](http://www.ijaiem.org/Volume4Issue10/IJAIEM-2015-10-31-45.pdf).

**Tags**: Robotics, Regression, Kinect, OpenCV, Image Processing, Embedded Systems

### 4. Desktop Application: Hangman Game using Java and MongoDB

Implementation of Hangman (guess the movie) game using Java and MongoDB. The game uses a Java front end (Java Swing). The backend was designed using NoSQL MongoDB framework. User and Admin (database modification) privileges. Interactive graphics was incorporated for a better user experience.

**Tags**: Java, Hangman, MongoDB

### 5. Clean Energy Recharging the World - Theme for ABU Robocon 2014

The project was undertaken by our team as a part of ABU Robocon 2016 which is an international level Robotics contest held every year. The theme for this year was 'Clean Energy Recharging the World'. The object to develop two robots, one manual/autonomous and the other autonomous to accomplish certain tasks under a time limit, which included navigating a series of obstacles, with the larger bot(manual/autonomous) driving the smaller bot using a source of clean energy such as wind/magnetism etc, in a way that there is no contact or communication between the two.

**Tags**: Robotics, Embedded Systems

### 6. A Salute to Parenthood - Theme for ABU Robocon 2014

The project was undertaken by our team as a part of ABU Robocon 2014 which is an international level Robotics contest held every year. The theme for this year was 'A Salute to Parenthood'. We had to develop two robots, one manual and the other autonomous to accomplish certain tasks under a time limit. Our team stood 4th all over India in the final event.

**Tags**: Robotics, Embedded Systems

### 7. Automatic Speech Recognition using Machine Learning

Presented a group seminar on ‘Automatic Speech Recognition Systems using Machine Learning’, focusing primarily on Support Vector Machines and proposed an architecture for the same.

**Tags**: Support Vector Machines, Machine Learning, Speech Recognition

### 8. Restaurant Billing application using Core Java and applets

Designed and implemented an ordering and billing software for a chain of restaurants using OOP tools such as interfaces, classes etc. Functionality included seating, menu selection, ordering and billing. OOP concepts such as inheritance, abstraction and polymorphism were showcased, along with software design concepts like Use Case modelling, activity diagram, state diagram.

**Tags**: Java, Object Oriented Programming, Software Design

### 9.  Development of a dynamic website – Startup Hunter

A basic website created using templates (HTML, CSS, and PHP) with database linking. The website gives the user functionality to register his/her business venture, so as to increase the online presence. The user can access the website and search for his/her requirement. As per the field of request, the relevant startup details are forwarded to the user. The project uses a SQL database in the backend.

**Tags**: HTML/CSS, SQL, Web Development


text:
Getting Started With The ListBundle
============================================

## Prerequisites

This version of the bundle requires Symfony 2.2+.

## Installation

Installation is a quick process:

1. Download ListBundle using composer
2. Enable the Bundle
3. Create your list's configuration
4. Initialize your configuration
5. Render the list

### Step 1: Download ListBundle using composer

Add KristofvcListBundle in your composer.json:

```js
{
    "require": {
        "kristofvc/list-bundle": "dev-master"
    }
}
```

Now tell composer to download the bundle by running the command:

``` bash
$ php composer.phar update kristofvc/list-bundle
```

Composer will install the bundle to your project's `vendor/kristofvc` directory.

### Step 2: Enable the bundle

Enable the bundle in the kernel:

``` php
<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Kristofvc\ListBundle\KristofvcListBundle(),
    );
}
```

### Step 3: Create your list's configuration

To render a list of certain objects you need to make a simple service to tell this bundle how to render your list. To start this configuration, you need to extend the 'Kristofvc\ListBundle\Configuration\AbstractListORMConfiguration'-class.
The following example is for a list of users.

```php
    <?php

    namespace UserBundle\Helper;

    use Kristofvc\ListBundle\Model\Column;
    use Kristofvc\ListBundle\Model\Action;
    use Kristofvc\ListBundle\Configuration\AbstractListConfiguration;
    use Kristofvc\ListBundle\Model\Filters\StringFilter;
    use Kristofvc\ListBundle\Model\Filters\DateFilter;

    class UserListConfiguration extends AbstractListORMConfiguration
    {
        public function buildColumns(){
            $this->addColumn(new Column('Email', 'E-mail', array('sortable' => true)));
            $this->addColumn(new Column('Name', 'Name', array('sortable' => true, 'sortField' => 'lastname, i.firstname', 'route' => 'admin_user_edit', 'routeParams' => array('Id'))));
            $this->addColumn(new Column('Groups', 'Groups'));
            $this->addColumn(new Column('LastLogin', 'Last logged in at', array('sortable' => true)));
        }

        public function buildActions(){
            $this->addAction(new Action('edit', 'admin_user_edit', array('Id'), array('icon' => 'icon-edit')));
            $this->addAction(new Action('delete', 'admin_user_deleteuser', array('Id'), array('icon' => 'icon-trash', 'iconWhite'=> true, 'btnColour' => 'danger', 'modal' => true)));
        }

        public function buildFilters(){
            $this->addFilter(new StringORMFilter('E-mail', 'email'));
            $this->addFilter(new StringORMFilter('Firstname', 'firstname'));
            $this->addFilter(new StringORMFilter('Lastname', 'lastname'));
            $this->addFilter(new DateORMFilter('Last login', 'lastLogin'));
        }

        public function getRepository(){
            return "AcmeDemoBundle:User";
        }

        public function buildQuery(QueryBuilder &$qb){
            $qb->andWhere('i.deletedAt is null');
        }
    }
```

As you can see, when you extend the AbstractListORMConfiguration, you need to implement some methods.

```buildColumns()``` allows you to build the columns of your list. You need to specify a name for each column as a first parameter. This name is also used for rendering the value for each object, so every column-name you define needs a get-, has- or is-method in your object's class.
Next parameter is the header for the column. Optionally you can use the third parameter to add whether the column needs sorting functionality or not and which fields you want to sort on (if no fields are defined, it takes the column-name). You can then also add a route en route-parameters to link values in the column to (see column 'name').

```buildActions()``` adds actions to your list. In the example we have two actions, an edit action, and a delete action. An action takes a name, a route and routeparameters. Optionally you can define an icon, whether the action needs a dialog confirmation or not, and which colour the button should be ('delete'-action in example above).

```buildFilters()``` defines which fields you want to filter on. For each field you can choose different types of filters.

- StringORMFilter
- DateORMFilter
- ...
- [You can also define your own filters. Look here for more information.] (https://github.com/kristofvc/ListBundle/blob/master/Resources/doc/custom_filters.md)

 When adding filters, make sure to include the ```Partials\scripts.html.twig``` file in your views. (```
    {% include "KristofvcListBundle:Partials:scripts.html.twig" %}```) and include a copy of jQuery.

```getRepository()``` tells you which entity you want to build your list with.

 ```buildQuery()``` can be used optionally and defines some extra parameters for your query.

### Step 4: Initialize your configuration

To render the list you need to initialize the list in your controller or add it as a service and fetch it in the controller.

```php
  return array(..., 'listConfiguration' => new , ...)
```

### Step 5: Render the list

Next render the list in you twig-file.

```twig
    {{ renderList(listConfiguration) }}
```

## Read more
- [configuration](https://github.com/kristofvc/ListBundle/blob/master/Resources/doc/configuration.md)
- [custom filters](https://github.com/kristofvc/ListBundle/blob/master/Resources/doc/custom_filters.md)
- [custom templates](https://github.com/kristofvc/ListBundle/blob/master/Resources/doc/custom_templates.md)

repository: kristofvc/ListBundle

repo_name: kristofvc/ListBundle


text:
Migrating from version 2 to version 3
=======================================

Version 3 of the SRG Analytics library introduces TagCommander support, as well as breaking changes requiring you to migrate your existing code base.

## Dependencies

TagCommander `TCCore.framework` and `TCSDK.framework` now need to be linked with your project.

## Tracker initialization

Tracker setup is now performed via a configuration object. A container identifier is required for TagCommander measurements. Contact your measurement team for more information about which one your application must use.

## Labels

You need to migrate custom data you previously sent to comScore so that it is now sent to TagCommander.

Since TagCommander requires variables to be explicitly defined on its portal to collect the associated data, you might need to discuss custom labels you previously used with your measurement team.

In particular, hidden events are therefore now provided with three predefined variables (type, value and source) which you should now use most of the time to convey custom data. There is still possibility to send arbitrary values to TagCommander, but those need to be discussed with your measurement team first.

## comScore to TagCommander transition

During the initial comScore to TagCommander transition, both services will coexist. Labels you currently send to comScore must therefore still be transmitted during the transition phase, so that analysts can check the consistency of the reports they produce.

New label classes `SRGAnalyticsHiddenEventLabels` and `SRGAnalyticsPageViewLabels` have been introduced to send this information to both services with a single unified formalism. All tracking methods and protocols have been updated and now work with such objects instead of the raw dictionaries used in version 2.

When the transition is complete, a minor version of the SRG Analytics library will be released, at which point you will be able to remove all comScore-related logic from your project.

Migrating from version 1 to version 2
=======================================

Version 2 of the SRG Analytics library introduces several changes which require you to migrate your existing code base.

## Carthage

Support for CocoaPods has been removed. Since the framework requires at least iOS 8, using CocoaPods does not make sense anymore. Carthage is both simple and elegant, and will therefore be used in the future for integration into your project. Refer to the [official documentation](https://github.com/Carthage/Carthage) for more information about how to use the tool (don't be afraid, this is very simple).

## Prefix changes

For historical reasons, all classes were prefixed with `RTS`, which was misleading. This prefix has now been replaced with `SRG`. Be sure to update existing references in your code (a simple text search suffices).

## Reduced complexity

Several data sources were previously available to customize measurement data (labels). These mechanisms have been completely eliminated in favor of simple dictionaries. Instead of having a data source indirectly supplying labels when required, you now:

* Supply labels associated with the content being played when actually playing it (see `SRGMediaPlayerController+SRGAnalytics.h`).
* Attach segment labels to segments themselves (see `SRGAnalyticsSegment` protocol).

## Tracker initialization

In versions 1.x of the library, tracker configuration was made in two different places:

* When calling the tracker start method.
* In the `Info.plist` file.

Having configuration in two places was not atomic. This is why configuration is now entirely specified when starting the tracker.

The debug mode boolean was also removed. A dedicated test business unit `SRGAnalyticsBusinessUnitIdentifierTEST` has been introduced instead.

## Media player tracker initialization

Media tracker initialization is now entirely automatic (it uses the settings of the main tracker), no start method call is required anymore. Just add the dedicated framework to your project and you are ready to go.

repository: crymscom/srganalytics-ios

repo_name: crymscom/srganalytics-ios


text:
# JCS_ColorTweener

Color tweener.

## Variables

| Name           | Description                             |
|:---------------|:----------------------------------------|
| mDeltaTimeType | Type of the delta time.                 |
| mEaseTypeR     | Tween type for red channel.             |
| mEaseTypeG     | Tween type for green channel.           |
| mEaseTypeB     | Tween type for blue channel.            |
| mEaseTypeA     | Tween type for alpha channel.           |
| mDurationRed   | How fast it changes the red channel."   |
| mDurationGreen | How fast it changes the green channel." |
| mDurationBlue  | How fast it changes the blue channel."  |
| mDurationAlpha | How fast it changes the alpha channel." |
| mIgnoreR       | Do not do anything with red channel.    |
| mIgnoreG       | Do not do anything with green channel.  |
| mIgnoreB       | Do not do anything with blue channel.   |
| mIgnoreA       | Do not do anything with alpha channel.  |
| mUnityCallback | Callback after easing.                  |

## Functions

| Name         | Description                 |
|:-------------|:----------------------------|
| ResetTweener | Reset the tweener progress. |
| DoTween      | Tween to the color.         |

gha_language: C#


text:
# NBG Currency

[![Build Status](https://travis-ci.org/Stichoza/nbg-currency.svg?branch=master)](https://travis-ci.org/Stichoza/nbg-currency) [![Latest Stable Version](https://img.shields.io/packagist/v/Stichoza/nbg-currency.svg)](https://packagist.org/packages/stichoza/nbg-currency) [![Total Downloads](https://img.shields.io/packagist/dt/Stichoza/nbg-currency.svg)](https://packagist.org/packages/stichoza/nbg-currency)

National Bank of Georgia (NBG) currency service API wrapper in PHP

## Installation

Install this package via [Composer](https://getcomposer.org/).

```
composer require stichoza/nbg-currency
```

## Usage

The class is namespaced as `Stichoza\NbgCurrency\NbgCurrency`, so use it like

```php
use Stichoza\NbgCurrency\NbgCurrency;
```

This package is very easy to use and has a few methods. **Keep in mind that method names are not same as NBG's SOAP service.** This package has more intuitive method names.

In addition, currencies are **not** case-sensitive here.

### Methods

##### `rate($currency)`

Get the currency rate.

```php
NbgCurrency::rate('usd'); // 2.3966
```

##### `diff($currency)`

Get the rate difference.

```php
NbgCurrency::diff('usd'); // 0.0017
```

##### `change($currency)`

Currency rate change. `-1` if decreased, `0` if unchanged and `1` if increased.

```php
NbgCurrency::change('usd'); // 1
```

##### `description($currency)`

Get the description of currency rate.

```php
NbgCurrency::description('eek'); // 10 ესტონური კრონი
```

##### `date()`

Get the date of currency rates. Returns [Carbon](http://carbon.nesbot.com) object representing the date. [All carbon methods](http://carbon.nesbot.com/docs/#api-difference) are available on this object.

```php
NbgCurrency::date();                  // 2016-01-01 00:00:00
NbgCurrency::date()->format('j F Y'); // 1 January 2016
NbgCurrency::date()->diffForHumans(); // 2 days ago
NbgCurrency::date()->isPast();        // true
// etc.
```

##### `get($currency)`

This method returns an object containing all data described above.

```php
$currency = NbgCurrency::get('usd');

$currency->date->format('j F Y'); // 1 January 2016
$currency->rate; // 2.3966
$currency->diff; // 0.0017
// etc.
```

##### `isSupported($currency)`

Check if the currency is supported.

```php
NbgCurrency::isSupported('usd'); // true
NbgCurrency::isSupported('lol'); // false
```

### Fluent Methods

Some methods (`get`, `rate`, `description`, `change`, `diff`) are available to call fluently like so:

```php
NbgCurrency::rateUsd(); // same as NbgCurrency::rate('usd');
NbgCurrency::ratePln(); // same as NbgCurrency::rate('pln');
NbgCurrency::diffEur(); // same as NbgCurrency::diff('eur');
NbgCurrency::getUah();  // same as NbgCurrency::get('uah');
// etc.
```

### General Recommendations

Each method call maps to a SOAP web service method. So it's better to remember a rate in a variable or even store a result in a cache if possible.

##### DO:
```php
$dollars = [199, 340.5, 230.25, 30, 78.99];
$usdRate = NbgCurrency::rateUsd();

foreach ($dollars as $d) {
	echo $d * $usdRate;
}
```

##### DO NOT:

```php
$dollars = [199, 340.5, 230.25, 30, 78.99];

foreach ($dollars as $d) {
	echo $d * NbgCurrency::rateUsd();
}
```

repository: zgabievi/nbg-currency

repo_name: zgabievi/nbg-currency


text:
# The Simpsons Characters Model

As already mentioned, the trained model has been a custom CNN model with the following architecture:

TODO: architecture image
TODO: log model.fit() history & save plots?

TODO: explain briefly that the model is saved in SavedModel format etc

So on, the trained model can be downloaded from the following Dropbox URL: https://www.dropbox.com/s/4l0efitsuvfoxhj/simpsonsnet.zip

repository: lucaslzl/serving-tensorflow-models

repo_name: lucaslzl/serving-tensorflow-models


text:
# Variational Autoencoder Network
Variational Autoencoder Network (**VAEN**) implementation on IMTD17 datasets to realize traffic identification.

## Introduction
3 files are available in this repository:

| File Name  | Description                     |
| :--------- | :------------------------------ |
| model.py   | Variational Autoencoder Network |
| figure.py  | Figure drawing helper functions |
| main.py    | Main process in TensorFlow      |

***Note:*** `.py` files are written for Python 3.x.

## Application

### Sample Reconstruction
Sample reconstruction of (a)Alipay, (b)Kugou, (c)Weibo traffic image.

![image](figures/1.png)

### Latent Representation
2-D Latent representation distribution.

![image](figures/2.png)
***Note:*** **Labels** are corresponding to **IMTD17** datasets

Sample reconstruction from 2-D latent representation.
![image](figures/3.png)

### Traffic Identification
Classification result under different threshold.
![image](figures/4.png)
Classification Result of App Traffic.

|   App    | _Pre_ | _Rec_ |   App    | _Pre_ | _Rec_ |
| -------- | :---: | :---: | -------- | :---: | :---: |
| Alipay   | 100   | 100   | QQ       | 100   | 100   |
| Baidu    | 100   | 100   | QQ Mail  | 100   | 93.2  |
| Bilibili | 100   | 100   | QQ Music | 100   | 100   |
| CNTV     | 100   | 100   | Taobao   | 100   | 100   |
| JD       | 100   | 89.1  | WeChat   | 100   | 86.6  |
| Kugou    | 100   | 94.6  | Weibo    | 100   | 100   |

***Note:*** ___Pre___ for Precision, ___Rec___ for Recall

repository: Jhonzhang/VAEN

repo_name: Jhonzhang/VAEN


text:
(C) 2012, Marius Posta<EMAIL_ADDRESS>Check LICENSE.txt for the legal blah-blah.

Uncapacitated Facility Location Problem solver
==============================================

I. Building

In order to build the code (by invoking 'make all'), you'll need to get the
source for BTT from Antonio Frangioni<EMAIL_ADDRESS>and replace the
appropriate files in the BTT subdirectory.

- Why not include BTT?
- Because it's freely available only under a weird academic license.

- Why not use another non-differentiable optimizer instead of BTT?
- Because it's the best one out there and I don't have the expertise or the
  motivation to write a better one myself (seriously looked into it, though).

- What's this other stuff in the subdirectory?
- It's a C99 wrapper for BTT written by Paul-Virak Khuong, a friend and
  colleague who had to kindness to share it with me (thanks Paul!). To put it
  mildly, BTT is not easily amenable to integration with other programs.

Execution performance has been found to be slightly sensitive to the
compiler used, and as of now we recommend Clang over GCC. This recommendation
may already be out of date as both compilers are now being constantly improved.

II. Running

Basically, the executable runs the following main loop:

0. read instance size from stdin
1. (optional) read resolution parameters from stdin
2. read instance prices from stdin
3. solve the UFLP, printing progress information in stderr
4. print best known solution in stdout
5. read 'quit' from stdin or go back to 1.

This loop structure exists because the UFLP often occurs as a subproblem within
a larger optimization algorithm, in which the prices differ often only slightly
from one iteration to the next.

Resolution parameters may also be provided as command-line arguments.
A detailed description can be obtained by invoking 'solver --help'.

Example: to solve an instance 'cap_a' stored as './instances/beasley/cap74.bz2'
with a time limit of 10 seconds, invoke the following command at a bash prompt:
  echo `bzcat ./instances/beasley/cap74.bz2` quit | ./solver -n cap_74 -t 10


text:
# ComfyPHP Multiple Languages Extension

This is an extension for ComfyPHP framework to enable the function using multiple languages.

## Default & Recommended Directory Structure

-   `src` directory (default)

    Where the source files for editing reside.

    -   `langs` directory (default)

        Store all the languages related source code.

        -   `en` directory (optional)

            English translation folder.

            -   `index.json` language file

                English translation files.

        -   `zh-Hant` directory (optional)

            Traditional Chinese translation folder.

            -   `index.json` language file

                Traditional Chinese translation files.

## Before Using it

As this is an extension for ComfyPHP, All dependencies required in ComfyPHP and ComfyPHP itself is needed to use this extension.

## Download / Install

To use this extension, you can install it with Composer.

```bash
composer require comfyphp/lang
```

## Usage

### Initialize

ComfyPHP will search for all the languages base on the `CONFIG_LANG_PATH` settings in `comfy.lang.config.php`.

You can add the following line into somewhere and import it into every files later, here we take `src/pages/_init.php` for example:

```php
$lang = new ComfyPHP\Lang();
```

### Create JSON

Create separate JSON files for each language you want to support. And Place these files into the languages folder. For example, create the following files:

`src/langs/en/index.json`:

```json
{
    "hello": "Hello!"
}
```

`src/langs/en/special.json`:

```json
{
    "setting": {
        "title": "Settings",
        "info": "This is the Settings page."
    }
}
```

### Usage

In the files where you want to use the multiple languages extension, add the following code to require the file which you initialized the lang extension and enable the function to use those languages:

```php
$root = $GLOBALS["ROOT"];
$pagePath = $GLOBALS["CONFIG_PAGE_PATH"];
require_once "$root/$pagePath/_init.php";
$l = $lang->useLanguage();
```

You can now use language strings in your code. When you write `$l("hello")`, the extension will look for the key `hello` in the `index.json` file. If you write `$l("special:setting.info")`, the extension will search for the key `info` under the `setting` key in the `special.json` file.

```php
echo $l("hello");
echo $l("special:setting.info");
```

## Reserved Variables of the Extension

```php
$GLOBALS["CONFIG_LANG_PATH"];
$GLOBALS["CONFIG_LANG_PROVIDER"];
$GLOBALS["CONFIG_LANG_FALLBACK"];
$GLOBALS["CONFIG_LANG_PARAM"];
$GLOBALS["CONFIG_LANG_PARAM_NAME"];
$GLOBALS["CONFIG_LANG_COOKIE"];
$GLOBALS["CONFIG_LANG_COOKIE_NAME"];
$GLOBALS["CONFIG_LANG_COOKIE_DOMAIN"];
$GLOBALS["CONFIG_LANG_COOKIE_TIME"];
```

## License

This project is MIT licensed, you can find the license file [here](./LICENSE).

repository: comfyphp/lang

repo_name: comfyphp/lang


text:
# astcast

[![build-img]][build-url]
[![pkg-img]][pkg-url]
[![reportcard-img]][reportcard-url]
[![version-img]][version-url]

Package `astcast` wraps type assertion operations in such way that you don't have
to worry about nil pointer results anymore.

## Installation

Go version 1.16+

```bash
go get github.com/go-toolsmith/astcast
```

## Example

```go
package main

import (
	"fmt"

	"github.com/go-toolsmith/astcast"
	"github.com/go-toolsmith/strparse"
)

func main() {
	x := strparse.Expr(`(foo * bar) + 1`)

	// x type is ast.Expr, we want to access bar operand
	// that is a RHS of the LHS of the addition.
	// Note that addition LHS (X field) is has parenthesis,
	// so we have to remove them too.

	add := astcast.ToBinaryExpr(x)
	mul := astcast.ToBinaryExpr(astcast.ToParenExpr(add.X).X)
	bar := astcast.ToIdent(mul.Y)
	fmt.Printf("%T %s\n", bar, bar.Name) // => *ast.Ident bar

	// If argument has different dynamic type,
	// non-nil sentinel object of requested type is returned.
	// Those sentinel objects are exported so if you need
	// to know whether it was a nil interface value of
	// failed type assertion, you can compare returned
	// object with such a sentinel.

	y := astcast.ToCallExpr(strparse.Expr(`x`))
	if y == astcast.NilCallExpr {
		fmt.Println("it is a sentinel, type assertion failed")
	}
}
```

Without `astcast`, you would have to do a lots of type assertions:

```go
package main

import (
	"fmt"

	"github.com/go-toolsmith/strparse"
)

func main() {
	x := strparse.Expr(`(foo * bar) + 1`)

	add, ok := x.(*ast.BinaryExpr)
	if !ok || add == nil {
		return
	}
	additionLHS, ok := add.X.(*ast.ParenExpr)
	if !ok || additionLHS == nil {
		return
	}
	mul, ok := additionLHS.X.(*ast.BinaryExpr)
	if !ok || mul == nil {
		return
	}
	bar, ok := mul.Y.(*ast.Ident)
	if !ok || bar == nil {
		return
	}
	fmt.Printf("%T %s\n", bar, bar.Name)
}
```

## License

[MIT License](LICENSE).

[build-img]: https://github.com/go-toolsmith/astcast/workflows/build/badge.svg
[build-url]: https://github.com/go-toolsmith/astcast/actions
[pkg-img]: https://pkg.go.dev/badge/go-toolsmith/astcast
[pkg-url]: https://pkg.go.dev/github.com/go-toolsmith/astcast
[reportcard-img]: https://goreportcard.com/badge/go-toolsmith/astcast
[reportcard-url]: https://goreportcard.com/report/go-toolsmith/astcast
[version-img]: https://img.shields.io/github/v/release/go-toolsmith/astcast
[version-url]: https://github.com/go-toolsmith/astcast/releases

repository: containers/buildah

gha_language: Go

repo_name: containers/buildah


text:
# librws -  Tiny, cross platform websocket client C library.

[![Platform](https://img.shields.io/cocoapods/p/librws.svg?style=flat)](http://cocoapods.org/pods/librws)
[![Version](https://img.shields.io/cocoapods/v/librws.svg?style=flat)](http://cocoapods.org/pods/librws)
[![License](https://img.shields.io/cocoapods/l/librws.svg?style=flat)](http://cocoapods.org/pods/librws)
[![Build Status](https://travis-ci.org/OlehKulykov/librws.svg?branch=master)](https://travis-ci.org/OlehKulykov/librws)
[![Build status](https://ci.appveyor.com/api/projects/status/9f8032rmlbrtaa9o?svg=true)](https://ci.appveyor.com/project/OlehKulykov/librws)

### Features
* No additional dependecies
* Single header library interface ```librws.h``` with public methods
* Thread safe
* Send/receive logic in background thread

### Installation with CocoaPods
#### Podfile
```ruby
pod 'librws'
```

### Example
##### Create and store websocket object handle
```c
  // Define variable or field for socket handle
  rws_socket _socket = NULL;
  ............
  // Create socket object
  _socket = rws_socket_create();
```
##### Set websocket connection url
```c
// Combined url: "ws://echo.websocket.org:80/"
rws_socket_set_scheme(_socket, "ws");
rws_socket_set_host(_socket, "echo.websocket.org");
rws_socket_set_port(_socket, 80);
rws_socket_set_path(_socket, "/");
```
##### Set websocket responce callbacks
Warning: ```rws_socket_set_on_disconnected``` is required
```c
// Main callbacks functions
// callback trigered on socket disconnected with/without error
static void on_socket_disconnected(rws_socket socket) {
  // process error
  rws_error error = rws_socket_get_error(socket);
  if (error) {
    printf("\nSocket disconnect with code, error: %i, %s", rws_error_get_code(error), rws_error_get_description(error));
  }
  // forget about this socket object, due to next disconnection sequence
  _socket = NULL;
}
// callback trigered on socket connected and handshake done
static void on_socket_connected(rws_socket socket) {
  printf("\nSocket connected");
}
// callback trigered on socket received text
static void on_socket_received_text(rws_socket socket, const char * text, const unsigned int length) {
  printf("\nSocket text: %s", text);
}
..................
// Set socket callbacks
rws_socket_set_on_disconnected(_socket, &on_socket_disconnected); // required
rws_socket_set_on_connected(_socket, &on_socket_connected);
rws_socket_set_on_received_text(_socket, &on_socket_received_text);
```
##### Connect
```c
rws_socket_connect(_socket);
```
##### Send message to websocket
```c
const char * example_text =
  "{\"version\":\"1.0\",\"supportedConnectionTypes\":[\"websocket\"],\"minimumVersion\":\"1.0\",\"channel\":\"/meta/handshake\"}";
rws_socket_send_text(_socket, example_text);
```
##### Disconnect or delete websocket object
Since socket can be connected and we need to send disconnect mesage, not just lazy close, need to wait and than delete object.
Thats why just call ```rws_socket_disconnect_and_release```, its thread safe, and forget about this socket object.
```c
rws_socket_disconnect_and_release(_socket);
_socket = NULL;
```

### License
---------

The MIT License (MIT)

Copyright (c) 2014 - 2019 Oleh Kulykov<EMAIL_ADDRESS>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

gha_language: C


text:
# Commands

Crafttweaker adds commands that will help you with the creation of scripts, they are provided to  help reduce the development time of writing scripts.

The prefix for commands are:
`/crafttweaker`
or
`/ct`

All the commands can be found ingame by doing:

`/crafttweaker help`

or

`/ct help`

# List of commands

## Biomes

Usage:

`/craftweaker biomes`

`/ct biomes`

Description:

Lists all of the biomes that are in the game.

## BlockInfo

Usage:

`/craftweaker blockinfo`

`/ct blockinfo`

Description:

Activates or deactivates the block reader. In block info mode, right-clicking a block will tell you it's name, metadata and Tile Entity data if applicable.

## Blocks

Usage:

`/craftweaker blocks`

`/ct blocks`

Description:

Outputs a list of all the blocks in the game to the crafttweaker.log file.

## Bugs

Usage:

`/craftweaker bugs`

`/ct bugs`

Description:

Opens your browser with the GitHub bug tracker.

## Entities

Usage:

`/craftweaker entities`

`/ct entities`

Description:

Outputs a list of all the entities in the game to the crafttweaker.log file.

## Discord

Usage:

`/craftweaker discord`

`/ct discord`

Description:

Opens your browser with a link to the Discord server.

## Hand

Usage:

`/craftweaker hand`

`/ct hand`

Description:

Prints the name of the item in your hand to the chat.

Also copies the name to clipboard and prints oredict entries.

## Inventory

Usage:

`/craftweaker inventory`

`/ct inventory`

Description:

Outputs a list of all the items in your inventory to the crafttweaker.log file.

## Liquids

Usage:

`/craftweaker liquids`

`/ct liquids`

Description:

Outputs a list of all the liquids in the game to the crafttweaker.log file.

## Mods

Usage:

`/craftweaker mods`

`/ct mods`

Description:

Outputs a list of all the mods and their versions in the game to the crafttweaker.log file and prints it in chat.

## Names

Usage:

`/craftweaker names`

`/ct names`

Description:

Outputs a list of all the items in the game to the crafttweaker.log file.

## OreDict

Usage:

`/craftweaker oredict <name>`

`/ct oredict <name>`

Description:

Outputs a list of all the OreDict entries in the game to the crafttweaker.log file.

If a name is supplied, the names of all the items registered to the oredict will be outputted to the crafttweaker.log file.

## Recipes

Usage:

`/craftweaker recipes`

`/ct recipes`

Description:

Outputs a list of all the crafting recipes in the game to the crafttweaker.log file.

## Recipes (Hand)

Usage:

`/craftweaker recipes hand`

`/ct recipes hand`

Description:

Outputs a list of all the crafting recipes for the item in the player's hand in the game to the crafttweaker.log file.

## Recipes (Furnace)

Usage:

`/craftweaker recipes furnace`

`/ct recipes furnace`

Description:

Outputs a list of all the furnace recipes in the game to the crafttweaker.log file.

## Seeds

Usage:

`/craftweaker seeds`

`/ct seeds`

Description:

Outputs a list of all the items in the seed registry to the crafttweaker.log file.

## Wiki

Usage:

`/craftweaker wiki`

`/ct wiki`

Description:

Opens your browser to this wiki page.

repository: jdenen/CraftTweaker-Documentation

repo_name: jdenen/CraftTweaker-Documentation


text:
# Git Module

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/g-node/git-module/run-tests?logo=github&style=for-the-badge)](https://github.com/g-node/git-module/actions?query=workflow%3Arun-tests)
 [![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/gogs/git-module)

Package git-module is a Go module for Git access through shell commands.

## Limitations

- Go version must be at least **1.4**.
- Git version must be no less than **1.8.3**.
- For Windows users, try use as new a version as possible.

## License

This project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.

repository: G-Node/git-module

repo_name: G-Node/git-module


text:
# OCR4all

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

As suggested by the name one of the main goals of OCR4all is to allow basically any given user to independently perform OCR on a wide variety of historical printings and obtain high quality results with reasonable time expenditure. Therefore, **OCR4all is explicitly geared towards users with no technical background. If you are one of those users (or if you just want to use the tool and are not interested in the code), please go to the** [getting started project where you will find guides and test data](https://github.com/OCR4all/getting_started).

Please note that OCR4all current main focus is a **semi-automatic workflow** allowing users to perform OCR even on the earliest printed books, which is a very challenging task that often requires a significant amount of **manual interaction**, especially when almost perfect quality is desired.
Nevertheless, we are working towards increasing robustness and the degree of automation of the tool.
An important cornerstone for this is the recently agreed cooperation with the [OCR-D project](https://github.com/ocr-d) which focuses on the mass full-text recognition of historical materials.

This repository contains the code for the main interface and server of the OCR4all project,
while the repositories [OCR4all/docker_image](https://github.com/OCR4all/docker_image) and [OCR4all/docker_base_image](https://github.com/OCR4all/docker_base_image) are about the creation of a preconfigurated docker image.

For installing the complete project with a docker image, please follow the instructions [here](https://github.com/OCR4all/docker_image).

## Mailing List

OCR4all is under active development and consequently, frequent releases containing bug fixes and further functionality can be expected. In order to always be up to date, we highly recommend subscribing to our [mailing list](https://lists.uni-wuerzburg.de/mailman/listinfo/ocr4all) where we will always announce notable enhancements.

## Built With

* [Docker](https://www.docker.com) - Platform and Software Deployment
* [Maven](https://maven.apache.org/) - Dependency Management
* [Spring](https://spring.io/) - Java Framework
* [Materialize](http://materializecss.com/) - Front-end Framework
* [jQuery](https://jquery.com/) - JavaScript Library

## Included Projects

* [OCRopus](https://github.com/tmbdev/ocropy) - Collection of document analysis programs
* [Calamari](https://github.com/ChWick/calamari) - OCR Engine based on OCRopy and Kraken
* [LAREX](https://github.com/chreul/LAREX) - Layout analysis on early printed books

### Formerly included / inspired by

* [Kraken](https://github.com/mittagessen/kraken) - OCR engine for all the languages
* [nashi](https://github.com/andbue/nashi) - Some bits of javascript to transcribe scanned pages using PageXML

## Contact, Authors, and Helping Hands

* **Dr. Christian Reul** (*project lead*) - mail<EMAIL_ADDRESS>* **Florian Langhanki** (*user support and guides*) - mail<EMAIL_ADDRESS>
### Developers

* **Dr. Herbert Baier Saip** (*lead*)
* **Maximilian Nöth** (*OCR4all, LAREX, and Calamari*)
* **Dr. Christoph Wick** (*Calamari*)
* **Andreas Büttner** (*Calamari and nashi*)
* **Kevin Chadbourne** (*LAREX*)
* **Yannik Herbst** (*distribution via VirtualBox*)
* **Björn Eyselein** (*Artifactory and distribution via Docker*)

### Miscellaneous

* **Raphaëlle Jung** (*guides and artwork*)
* **Dr. Uwe Springmann** (*ideas and feedback*)
* **Prof. Dr. Frank Puppe** (*ideas and feedback*)

### Former Project Members

* **Dennis Christ** (*OCR4all*)
* **Alexander Hartelt** (*OCR4all*)
* **Nico Balbach** (*OCR4all and LAREX*)
* **Christine Grundig** (*ideas and feedback*)
* **Maximilan Wehner** (*user support and guides*)
* ...

## Funding
* [DFG-funded Initiative "OCR-D" (Phase 2 and 3)](https://ocr-d.de/en/)
* [BMBF Project “Kallimachos“](http://www.kallimachos.de/)
* [Centre for Philology and Digitality (University of Würzburg)](https://www.uni-wuerzburg.de/zpd)
* [Chair of Artificial Intelligence (University of Würzburg)](https://www.informatik.uni-wuerzburg.de/en/is)

## Citing OCR4all

If you are using OCR4all please cite:

> Reul, C., Christ, D., Hartelt, A., Balbach, N., Wehner, M., Springmann, U., Wick, C., Grundig, Büttner, A., C., Puppe, F.: *OCR4all — An open-source tool providing a (semi-) automatic OCR workflow for historical printings* Applied Sciences **9**(22) (2019)

```
@article{reul2019ocr4all,
  title={OCR4all—An open-source tool providing a (semi-) automatic OCR workflow for historical printings},
  author={Reul, Christian and Christ, Dennis and Hartelt, Alexander and Balbach, Nico and Wehner, Maximilian and Springmann, Uwe and Wick, Christoph and Grundig, Christine and B{\"u}ttner, Andreas and Puppe, Frank},
  journal={Applied Sciences},
  volume={9},
  number={22},
  pages={4853},
  year={2019},
  publisher={Multidisciplinary Digital Publishing Institute}
}
```


text:
Title: WebGL 3D Perspective Correct Texturemapping
Description: What's special about W

This post is a continuation of a series of posts about WebGL.  The first
[started with fundamentals](webgl-fundamentals.html). This article
covers perspective correct texture mapping. To understand it you
probably need to read up on [perspective projection](webgl-3d-perspective.html) and maybe [texturing](webgl-3d-textures.html)
as well. You also need to know about [varyings and what they do](webgl-how-it-works.html) but I'll cover them briefly here.

So in the "[how it works](webgl-how-it-works.html)" article
we covered how varyings work. A vertex shader can declare a
varying and set it to some value. Once the vertex shader has been called
3 times WebGL will draw a triangle. While it's drawing that triangle
for every pixel it will call our fragment shader and ask it what
color to make that pixel. Between the 3 vertices of the triangle
it will pass us our varyings interpolated between the 3 values.

{{{diagram url="resources/fragment-shader-anim.html" caption="v_color is interpolated between v0, v1 and v2" }}}

Going back to our [first article](webgl-fundamentals.html) we drew a triangle in
clipspace, no math. We just passed in some clipspace coordinates
to a simple vertex shader that looked like this

      // an attribute will receive data from a buffer
      attribute vec4 a_position;

      // all shaders have a main function
      void main() {

        // gl_Position is a special variable a vertex shader
        // is responsible for setting
        gl_Position = a_position;
      }

We had a simple fragment shader that draws a constant color

      // fragment shaders don't have a default precision so we need
      // to pick one. mediump is a good default
      precision mediump float;

      void main() {
        // gl_FragColor is a special variable a fragment shader
        // is responsible for setting
        gl_FragColor = vec4(1, 0, 0.5, 1); // return redish-purple
      }

So let's make that draw 2 rectangles in clipspace. We'll pass it this
data with `X`, `Y`, `Z`, and `W` for each vertex.

    var positions = [
      -.8, -.8, 0, 1,  // 1st rect 1st triangle
       .8, -.8, 0, 1,
      -.8, -.2, 0, 1,
      -.8, -.2, 0, 1,  // 1st rect 2nd triangle
       .8, -.8, 0, 1,
       .8, -.2, 0, 1,

      -.8,  .2, 0, 1,  // 2nd rect 1st triangle
       .8,  .2, 0, 1,
      -.8,  .8, 0, 1,
      -.8,  .8, 0, 1,  // 2nd rect 2nd triangle
       .8,  .2, 0, 1,
       .8,  .8, 0, 1,
    ];

Here's that

{{{example url="../webgl-clipspace-rectangles.html" }}}

Let's add a single varying float. We'll pass that directly
from the vertex shader to the fragment shader.

      attribute vec4 a_position;
    +  attribute float a_brightness;

    +  varying float v_brightness;

      void main() {
        gl_Position = a_position;

    +    // just pass the brightness on to the fragment shader
    +    v_brightness = a_brightness;
      }

In the fragment shader we'll use that varying to set the color

      precision mediump float;

    +  // passed in from the vertex shader and interpolated
    +  varying float v_brightness;

      void main() {
    *    gl_FragColor = vec4(v_brightness, 0, 0, 1);  // reds
      }

We need to supply data for that varying so we'll make a buffer and
put in some data. One value per vertex. We'll set all the brightness
values for vertices on the left to 0 and those on the right to 1.

```
  // Create a buffer and put 12 brightness values in it
  var brightnessBuffer = gl.createBuffer();

  // Bind it to ARRAY_BUFFER (think of it as ARRAY_BUFFER = brightnessBuffer)
  gl.bindBuffer(gl.ARRAY_BUFFER, brightnessBuffer);

  var brightness = [
    0,  // 1st rect 1st triangle
    1,
    0,
    0,  // 1st rect 2nd triangle
    1,
    1,

    0,  // 2nd rect 1st triangle
    1,
    0,
    0,  // 2nd rect 2nd triangle
    1,
    1,
  ];

  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(brightness), gl.STATIC_DRAW);
```

We also need to look up the location of the `a_brightness` attribute
at init time

```
  // look up where the vertex data needs to go.
  var positionAttributeLocation = gl.getAttribLocation(program, "a_position");
+  var brightnessAttributeLocation = gl.getAttribLocation(program, "a_brightness");
```

and setup that attribute at render time

```
  // Turn on the attribute
  gl.enableVertexAttribArray(brightnessAttributeLocation);

  // Bind the position buffer.
  gl.bindBuffer(gl.ARRAY_BUFFER, brightnessBuffer);

  // Tell the attribute how to get data out of brightnessBuffer (ARRAY_BUFFER)
  var size = 1;          // 1 component per iteration
  var type = gl.FLOAT;   // the data is 32bit floats
  var normalize = false; // don't normalize the data
  var stride = 0;        // 0 = move forward size * sizeof(type) each iteration to get the next position
  var offset = 0;        // start at the beginning of the buffer
  gl.vertexAttribPointer(
      brightnessAttributeLocation, size, type, normalize, stride, offset);
```

And now when we render we get two rectangles that are black on the left
when `brightness` is 0 and red on the right when `brightness` is 1 and
for the area inbetween `brightness` is interpolated or (varied) as it
goes across the triangles.

{{{example url="../webgl-clipspace-rectangles-with-varying.html" }}}

So then, from the [perspective article](webgl-3d-perspective) we know that WebGL takes whatever value we put in `gl_Position` and it divides it by
`gl_Position.w`.

In the vertices above we supplied `1` for `W` but since we know WebGL
will divide by `W` then we should be able do something like this
and get the same result.

```
  var mult = 20;
  var positions = [
      -.8,  .8, 0, 1,  // 1st rect 1st triangle
       .8,  .8, 0, 1,
      -.8,  .2, 0, 1,
      -.8,  .2, 0, 1,  // 1st rect 2nd triangle
       .8,  .8, 0, 1,
       .8,  .2, 0, 1,

      -.8       , -.2       , 0,    1,  // 2nd rect 1st triangle
       .8 * mult, -.2 * mult, 0, mult,
      -.8       , -.8       , 0,    1,
      -.8       , -.8       , 0,    1,  // 2nd rect 2nd triangle
       .8 * mult, -.2 * mult, 0, mult,
       .8 * mult, -.8 * mult, 0, mult,
  ];
```

Above you can see that for every point on the right in the second
rectangle we are multipliying `X` and `Y` by `mult` but, we are also
settting `W` to `mult`. Since WebGL will divide by `W` we should get
the exact same result right?

Well here's that

{{{example url="../webgl-clipspace-rectangles-with-varying-non-1-w.html" }}}

Note the 2 rectangles are drawn in the same place they were before. This
proves `X * MULT / MULT(W)` is still just `X` and same for `Y`. But, the
colors are different. What's going on?

It turns out WebGL uses `W` to implement perspective correct
texturemapping or rather to do perspective correct interpolation
of varyings.

In fact to make it easier to see let's hack the fragment shader to this

    gl_FragColor = vec4(fract(v_brightness * 10.), 0, 0, 1);  // reds

multplying `v_brightness` by 10 will make the value go from 0 to 10. `fract` will
just keep the fractional part so it will go 0 to 1, 0 to 1, 0 to 1, 10 times

{{{example url="../webgl-clipspace-rectangles-with-varying-non-1-w-repeat.html" }}}

Now it should be easy to see the perspective.

A linear interpolation from one value to another would be this
formula

     result = (1 - t) * a + t * b

Where `t` is a value from 0 to 1 representing some position between `a` and `b`. 0 at `a` and 1 at `b`.

For varyings though WebGL uses this formula

     result = (1 - t) * a / aW + t * b / bW
              -----------------------------
                 (1 - t) / aW + t / bW

Where `aW` is the `W` that was set on `gl_Position.w` when the varying was
as set to `a` and `bW` is the `W` that was set on `gl_Position.w` when the
varying was set to `b`.

Why is that important? Well here's a simple textured cube like we ended up with in the [article on textures](webgl-3d-textures.html). I've adjusted
the UV coordinates to go from 0 to 1 on each side and it's using a 4x4 pixel texture.

{{{example url="../webgl-perspective-correct-cube.html" }}}

Now let's take that example and change the vertex shader so that
we divide by `W` ourselves. We just need to add 1 line.

```
attribute vec4 a_position;
attribute vec2 a_texcoord;

uniform mat4 u_matrix;

varying vec2 v_texcoord;

void main() {
  // Multiply the position by the matrix.
  gl_Position = u_matrix * a_position;

+  // Manually divide by W.
+  gl_Position /= gl_Position.w;

  // Pass the texcoord to the fragment shader.
  v_texcoord = a_texcoord;
}
```

Dividing by `W` means `gl_Position.w` will end up being 1.
`X`, `Y`, and `Z` will come out just like they would if we let
WebGL do the division for us. Well here are the results.

{{{example url="../webgl-non-perspective-correct-cube.html" }}}

We still get a 3D cube but the textures are getting warped. This
is because by not passing `W` as it was before WebGL is not able to do
perspective correct texture mapping. Or more correctly, WebGL is not
able to do perspective correct interpolation of varyings.

If you recall `W` was our `Z` value from our [perspective matrix](webgl-3d-perspective.html)).
With `W` just being `1` WebGL just ends up doing a linear interpolation.
In fact if you take the equation above

     result = (1 - t) * a / aW + t * b / bW
              -----------------------------
                 (1 - t) / aW + t / bW

And change all the `W`s to 1s we get

     result = (1 - t) * a / 1 + t * b / 1
              ---------------------------
                 (1 - t) / 1 + t / 1

Dividing by 1 does nothing so we can simplify to this

     result = (1 - t) * a + t * b
              -------------------
                 (1 - t) + t

`(1 - t) + t` when `t` goes from 0 to 1 is the same as `1`. For example
if `t` was `.7` we'd get `(1 - .7) + .7` which is `.3 + .7` which is `1`. In other words we can remove the bottom so we're left with

     result = (1 - t) * a + t * b

Which the same as the linear interpolation equation above.

Hopefully it's now clear why WebGL uses a 4x4 matrix and
4 value vectors with `X`, `Y`, `Z`, and `W`. `X` and `Y` divided by `W` get a clipsapce coordinate. `Z` divided by `W` also get a clipspace coordinate in Z and `W` is still used during interopation of varyings and
provides the ability to do perspective correct texture mapping.

Mid 1990s Game Consoles

As a little piece of trivia the Playstation 1 and some of the other
game consoles from the same era didn't do perspective correct texturemapping. Looking at the results above you can now see why
they looked the way they did.

repository: sticm/webgl-fundamentals

repo_name: sticm/webgl-fundamentals