text:
# wt-pdf-viewer

Pdf viewer for Vaadin based on [pdf.js](https://github.com/mozilla/pdf.js/) v1.8.188 web viewer.

**Features:**
* Sidebar with thumbnails, document outline and attachments
* Text search in PDF text
* Previous page, next page and jump to arbitrary page
* Zooming out up to 10%, automatic zoom, zoom to actual size, fit page, full width
* Full-screen presentation Mode
* Document print
* Document download
* Rotation clockwise and counterclockwise
* Hand tool for comfortable scrolling
* Document properties
* Can show multiple pdf files on the same screen (e.g. javascripts wont fight)

## Screenshot
![PDF Viewer with open side menu](/branding/screenshots/01-viewer-with-menu.png?raw=true "PDF Viewer with open side menu")

## Dependency
WT PDF Viewer is distributed via Vaadin addons maven repository (named directory). Add both dependency and Vaadin addons repository into pom.xml:
````xml
<dependency>
   <groupId>com.whitestein.vaadin.widgets</groupId>
   <artifactId>wt-pdf-viewer</artifactId>
   <version>1.0</version>
</dependency>

<repositories>
   <!-- Vaadin addons repository -->
   <repository>
      <id>vaadin-addons</id>
      <url>http://maven.vaadin.com/vaadin-addons</url>
   </repository>
</repositories>
````

## Enable Printing
Call the `wtPdfViewerPrintSupport` mixin from top level of your [styles.scss](https://github.com/WhitesteinTechnologies/wt-pdf-viewer-demo/blob/fe80d00e784443f4e975d8fd1dad64b4ff736a40/src/main/webapp/VAADIN/themes/pdfdemotheme/styles.scss) file. It _must_ be called from top level; otherwise printing won't work correctly.

````scss
@import "pdfdemotheme.scss";
@import "addons.scss";
// add import of pdf viewer styles
@import "../../../VAADIN/themes/wtpdfviewer/wtpdfviewer.scss";

.pdfdemotheme {
  @include addons;
  @include pdfdemotheme;
}
// add printing styles
@include wtPdfViewerPrintSupport
````

## Java API
Create component and show a PDF file in it:
````java
WTPdfViewer pdfViewer = new WTPdfViewer();

// get file stream
String filename = "some-pdf-file.pdf";
InputStream dataStream = getClass().getClassLoader().getResourceAsStream(filename);

// show file in pdf viewer
pdfViewer.setResource(new StreamResource(new InputStreamSource(dataStream), filename));

// boilerplate StreamSource implementation
class InputStreamSource implements StreamSource {

	private final InputStream data;

	public InputStreamSource(InputStream data) {
		super();
		this.data = data;
	}

	@Override
	public InputStream getStream() {
		return data;
	}

}
````

Change visible page from Java code:
````java
WTPdfViewer pdfViewer = new WTPdfViewer();

// basic paging
pdfViewer.firstPage();
pdfViewer.lastPage();
pdfViewer.previousPage();
pdfViewer.nextPage();

// jump to fifth page
pdfViewer.setPage(5);
````

## Demo Project
Demo project is in the [wt-pdf-viewer-demo](https://github.com/WhitesteinTechnologies/wt-pdf-viewer-demo/) repository.

## Development Instructions
The JavaScript viewer is in `pdf.viewer.js` file. The viewer uses `pdf.js` and `pdf.worker.js` files as pdf parsing engine. They are all generated from [wt-vaadin-pdf.js](https://github.com/WhitesteinTechnologies/wt-vaadin-pdf.js). All three files are copied as is, do not make changes into then. If you need them to work differently, change [wt-vaadin-pdf.js](https://github.com/WhitesteinTechnologies/wt-vaadin-pdf.js) so that it generates whatever is necessary.

The wt-vaadin-pdf.js project is able to generate both minimized and non-minized version of javascript files. The minimized version is recommended, because the files are huge.
* 'gulp minified-pre' command generates minimized files in `build/minified` directory.
* 'gulp generic' command  generates non-minimized files in `build/generic` directory.

Minimized files locations:
* viewer: `build/minified/web/viewer.js`,
* pdf perser: `build/minified/build/pdf.js`,
* worker: `build/minified/build/pdf.worker.js`.

Non-minimized files locations:
* viewer: `build/generic/web/viewer.js`,
* pdf perser: `build/generic/build/pdf.js`,
* worker: `build/generic/build/pdf.worker.js`.

Stylesheet `wtpdfviewer.scss` has minor changes against generated `build/web/viewer.css` - styles are packed into mixins.

## GWT-Related Stuff

* To recompile the test widget set, run *mvn vaadin:compile*; if you think the widget-set changes were not picked up by the Vaadin plugin, run *mvn clean package* or try compiling with *mvn vaadin:compile -Dgwt.compiler.force=true*
* To use superdevmode, run "mvn vaadin:run-codeserver" and open superdevmode like any other project

## Creating Releases

1. Push all changes to Github.
2. Prepare release: `mvn clean release:prepare -Dusername=<Github Username> -Dpassword=<Github Password>`
3. Perform release: `mvn clean release:perform -Dusername=<Github Username> -Dpassword=<Github Password>`
4. Upload the generated ZIP file from the `target/checkout/target` directory to https://vaadin.com/directory service.

repository: WhitesteinTechnologies/wt-pdf-viewer

gha_language: Java

repo_name: WhitesteinTechnologies/wt-pdf-viewer


text:
---
title:  THE BIBLE TEACHES THAT WE MUST CLAIM GOD’S PROMISES
date:   08/03/2017
---

### THE BIBLE TEACHES THAT WE MUST CLAIM GOD’S PROMISES

(1 John 5:14, 15)

We must claim the things that God promises us when we pray. If we do not, then what we believe or how much we believe will make no difference.

`Read 1 John 5:14, 15. These verses say that we can be sure that God hears us. And we can be sure that we have what we ask for from Him. What does John say is the reason we have for trusting these promises?`

We must ask God for what we need in keeping with what He wants. And we must believe His promises. Then we need to claim what He has promised. We can claim God’s promise by giving thanks to God. But we must thank Him even before we receive what we ask for from Him. In this way, the promises become part of our hearts. They live within us. Ellen G. White said, “We may ask for any gift God promises. Then we are to believe that we receive the promise. And we are to give thanks to God that we have received it.”—Adapted from Education, page 258.

In Luke 8:1–11, Jesus shows how the Word of God is like seed. A whole apple tree, for example, is contained in an apple seed. In the same way, the gift of God is contained in His promise. We must claim the promise.

John 11 shows that Jesus prayed in this way. In John 11:39–41, we read that Jesus thanked the Father for bringing Lazarus back to life. But Lazarus was still in the grave. Jesus received the answer to His prayer when He thanked God. We must remember, then, that we are God’s children. We also are to live on God’s promises.

“The Lord says, ‘Call upon Me in the day of trouble; I will deliver you.’ Psalm 50:15 [NKJV]. He invites us to bring to Him the things that puzzle us. We are to tell Him our needs. We are to tell Him of our need for divine help. He asks us always to be ready to pray. We are to ask Him for what we need when trouble comes. Our urgent prayers show our strong trust in God. The sense of our need leads us to pray earnestly. Our heavenly Father is moved by our asking.”—Adapted from Ellen G. White, Christ’s Object Lessons, page 172.

`Why is it so important to always bring everything to God in prayer?`

license: MIT

repository: Adventech/sabbath-school-lessons

branch_name: refs/heads/stage

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: Adventech/sabbath-school-lessons


text:
##License - Table Heatmap

Power BI Custom Visualization

table Heatmap

Copyright (c) Galiya Warrier
All rights reserved.
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.

#Acknowledgements:
Inspired by Nathan Yau, Flowingdata.com (http://flowingdata.com/2010/01/21/how-to-make-a-heatmap-a-quick-and-easy-solution/) and by Day/Hour Heatmap sample (http://bl.ocks.org/tjdecke/5558084)

Provided colorbrewer schemes generated by M.Bostock (http://bl.ocks.org/mbostock/5577023):
["Purples", "Blues", "Greens", "Oranges", "Reds", "Greys", "YlGn", "GnBu", "BuGn",  "PuBu", "BuPu", "RdPu", "PuRd", "OrRd", "PuOr", "BrBG", "PRGn", "PiYG", "RdBu", "RdGy", "RdYlBu", "Spectral", "RdYlGn", "Paired", "Pastel1", "Pastel2"]

repository: fredguinog/PowerBI-visuals

branch_name: refs/heads/master

repo_name: fredguinog/PowerBI-visuals


text:
![Blockbuster](./logo.png)

[Downloads](https://github.com/mchorse/blockbuster/releases) – [PMC post](http://www.planetminecraft.com/mod/blockbuster-machinima-mod/) – [Minecraft Forum post](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2700216-blockbuster-create-simple-machinimas-and-adventure) – [McME](https://github.com/mchorse/mcme) (model editor)
[EchebKeso](https://twitter.com/EchebKeso) – [Mocap mod](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1445402-minecraft-motion-capture-mod-mocap-16-000) – [Mocap's source code](https://github.com/EchebKeso/Mocap)

Blockbuster (**pun intended**) is a Minecraft mod which lets you create simple
Minecraft machinimas in single player, without having to recruit and organize a
crowd of body actors and cameras.

Blockbuster mod is built on top of Forge <IP_ADDRESS>3 for Minecraft 1.10.2. Blockbuster mod is also provides build for 1.9.4, if it's possible, without changing the code.

Recording is based and rewritten from scratch on recording code from Mocap mod by [EchebKeso](https://twitter.com/EchebKeso).

## Features

Blockbuster mod provides you with lots of features to make cool machinimas:

* **Actors and player recording** – the most important feature, as you won't be able to create a machinimas without it. With Blockbuster mod you can record yourself doing things and then playback it using an actor. *Recording code has some limitations on which actions it can record*.
* **Director blocks** – one actor is good, a crowd of them is better. Blockbuster mod provides you with a mechanism called *director block* which manages playback of registered actors. It has also outlets for redstone contraptions, making it easy attaching some custom commands or redstone logic on start or the end of the scene playback.
* **Camera support** – camera is how you present your machinima. Blockbuster mod has a support for different camera features starting from simple idle camera to complex camera moves like paths (with FOV animation), following and looking at the actor.
* **Custom models** – recording only player-like entities isn't very fun. Blockbuster mod has support for custom models created in McME model editor (link above). Unleash your creativity with custom models!
* **[Minema](https://github.com/daipenger/minema) compatability** – thanks to frame-based player recording and cameras, you can convert your in-game machinimas to high-quality video output.

## Install

Install [Minecraft Forge](http://files.minecraftforge.net/), then go to
[releases](https://github.com/mchorse/blockbuster/releases) and download the
latest stable version (not a pre-release) of jar file. Put it in minecraft's `mods` folder, and launch the game.

After that, Blockbuster mod should be installed and will appear in Minecraft's
mods menu. If Blockbuster didn't appear in the mods menu, then something went
wrong.

## Videos

### Tutorial videos

Feature videos for 1.4. This playlist shows how to use the mod features. Every update comes with a change log video which show out new features.

There's also a video that shows how to create a simple machinima with Blockbuster mod. This video shows basics of director block, how to attach actors to director block, and how to setup cameras:

### Machinima Examples

This playlist consists out of videos that I've created during Blockbuster mod testings. Those videos are my lab experiments. Don't judge the quality of these machinimas yet, I'm still learning.

## License and Manual

Blockbuster mod's code is licensed under MIT, see file [LICENSE.md](./LICENSE.md) for more information about the license. Manual is located in repository's [wiki](https://github.com/mchorse/blockbuster/wiki).

## For Devs

Language files have to be compiled from YML to INI format using PHP. You need to have PHP 5 and [composer installed](https://getcomposer.org/download/). Once when you have PHP and composer, run:

```sh
# Go to "php" folder
cd php

# Install PHP dependencies (I assumed you installed composer in the root of repository)
../composer.phar install

# Go back
cd ..

# Or "make check"
make build_lang
```

This should compile YML files into language files. Also, you'll have to refresh Eclipse or your IDE to get the changed file get into the app. Simply open `en_US.lang` in IDE and build the project again.

repository: tomsoel/blockbuster

repo_name: tomsoel/blockbuster


text:
[![Build Status](https://travis-ci.org/mesosphere/hdfs.svg?branch=master)](https://travis-ci.org/mesosphere/hdfs)
HA HDFS on Apache Mesos
======================
Starts 1 active NameNode (with JournalNode and ZKFC), 1 standby NN (+JN,ZKFC), 1 JN, and everything else is DataNodes.

Prerequisites
--------------------------
1. Install `tar`, `unzip`, `wget` in your build host. Set proxy for maven / gradle and wget if needed
2. Install `curl` for all hosts in cluster
3. `$JAVA_HOME` needs to be set on the host running your HDFS scheduler. This can be set through setting the environment variable on the host, `export JAVA_HOME=/path/to/jre`, or specifying the environment variable in Marathon.

**NOTE:** The build process current supports maven and gradle.   The gradle wrapper meta-data is included in the project and is self boot-straping (meaning it isn't a prerequisite install).  Maven as the build system is being deprecated.

Building HDFS-Mesos
--------------------------
1. `./bin/build-hdfs`
2. Run `./bin/build-hdfs nocompile` to skip the `gradlew clean package` step and just re-bundle the binaries.
3. To remove the project build output and downloaded binaries, run `./bin/build-hdfs clean`

**NOTE:** The build process builds the artifacts under the `$PROJ_DIR/build` directory.  A number of zip and tar files are cached under the `cache` directory for faster subsequent builds.   The tarball used for installation is hdfs-mesos-x.x.x.tgz which contains the scheduler and the executor to be distributed.

Installing HDFS-Mesos on your Cluster
--------------------------
1. Upload `hdfs-mesos-*.tgz` to a node in your Mesos cluster (which is built to `$PROJ_DIR/build/hdfs-mesos-x.x.x.tgz`).
2. Extract it with `tar zxvf hdfs-mesos-*.tgz`
3. Customize configuration in `hdfs-mesos-*/etc/hadoop/*-site.xml`
4. Check that `hostname` on that node resolves to a non-localhost IP; update /etc/hosts if necessary

### If you have Hadoop pre-installed in your cluster
If you have Hadoop installed across your cluster, you don't need the Mesos scheduler application to distribute the binaries. You can set the `mesos.hdfs.native-hadoop-binaries` configuration parameter in `mesos-site.xml` if don't want the binaries distributed.

### Mesos-DNS custom configuration
You can see the example configuration in the `example-conf/dcos` directory. Since Mesos-DNS provides native bindings for master detection, we can simply use those names in our mesos and hdfs configurations. The example configuration assumes your Mesos masters and your zookeeper nodes are colocated. If they aren't you'll need to specify your zookeeper nodes separately. Also, note that you are using the example in `example-conf/dcos`, the `mesos.hdfs.native-hadoop-binaries` property needs to be set to `false` if your HDFS binaries are not predistributed.

Starting HDFS-Mesos
--------------------------
1. `cd hdfs-mesos-*`
2. `./bin/hdfs-mesos`
3. Check the Mesos web console to wait until all tasks are RUNNING (monitor status in JN sandboxes)

Using HDFS
--------------------------
See some of the many HDFS tutorials out there for more details and explore the web UI at
`http://<ActiveNameNode>:50070`.

Note that you can access commands through `hdfs://<mesos.hdfs.framework.name>/` (default: `hdfs://hdfs/`).
Also here is a quick sanity check:

1. `hadoop fs -ls hdfs://hdfs/` should show nothing for starters
2. `hadoop fs -put /path/to/src_file hdfs://hdfs/`
3. `hadoop fs -ls hdfs://hdfs/` should now list src_file

Resource Reservation Instructions (Optional)
--------------------------

1. In mesos-site.xml, change mesos.hdfs.role to hdfs.
2. On master, add the role for HDFS, by running `echo hdfs > /etc/mesos-master/role` or by setting the `—-role=hdfs`.
3. Then restart the master by running `sudo service mesos-master restart`.
4. On each slave where you want to reserve resources, add specific resource reservations for the HDFS role. Here is one example:

`cpus(*):8;cpus(hdfs):4;mem(*):16384;mem(hdfs):8192 > /etc/mesos-slave/resources`
 or by setting `—-resources=cpus(*):8;cpus(hdfs):4;mem(*):16384;mem(hdfs):8192`.
5. On each slave with the new settings, stop the mesos slave by running

`sudo service mesos-slave stop`.

6. On each slave with the new settings, remove the old slave state by running

`rm -f /tmp/mesos/meta/slaves/latest`.

Note: This will also remove task state, so you will want to manually kill any running tasks as a precaution.
7. On each slave with the new settings, start the mesos slave by running

`sudo service mesos-slave start`.

Shutdown Instructions (Optional)
--------------------------

1. In Marathon (or your other long-running process monitor) stop the hdfs scheduler application
2. Shutdown the hdfs framework in Mesos: `curl -d "frameworkId=YOUR_FRAMEWORK_ID" -X POST http://YOUR_MESOS_URL:5050/master/shutdown`
3. Access your zookeeper instance: `/PATH/TO/zookeeper/bin/zkCli.sh`
4. Remove hdfs-mesos framework state from zookeeper: `rmr /hdfs-mesos`
5. (Optional) Clear your data directories as specified in your `mesos-site.xml`. This is necessary to relaunch HDFS in the same directory.

repository: stealthly/hdfs

repo_name: stealthly/hdfs


text:
# hs92-historic-series

<!-- badges: start -->
<!-- badges: end -->

The goal of hs92-historic-series is to create curated international trade data since 1962. This uses the HS92 trade classification with 4 digits depth level.

Before 1988, this data uses SITC2 (>= 1976) and SITC1 (1962-1975) data. The source for this data is UN COMTRADE.

Instead of using CSV or RDS, the chosen format here is Apache Arrow, to force cross language and systems compatibility.

The data is obtained with the next procedure:

1. Take SITC 1, SITC 2 and  HS2 data for the period 1962-2020 (SITC 2 since 1976, HS 92 since 1988)
2. Convert each of the series to HS 92 by using the official conversion tables from UN COMTRADE
3. For each year, paste the three series, group by reporter, partner and commodity and take the maximum export/import value (i.e. if for 1990 a country hasn't implemented HS 92, then converted SITC 1/2 data will be used instead of showing no data for that country)

branch_name: refs/heads/main

gha_license_id: NOASSERTION


text:
---
layout: post
title: "Domain Adaptation for Neural Networks by Parameter Augmentation"
date: 2016-07-01 21:24:21
categories: arXiv_CV
tags: arXiv_CV Caption RNN
author: Yusuke Watanabe, Kazuma Hashimoto, Yoshimasa Tsuruoka
mathjax: true
---

* content
{:toc}

##### Abstract
We propose a simple domain adaptation method for neural networks in a supervised setting. Supervised domain adaptation is a way of improving the generalization performance on the target domain by using the source domain dataset, assuming that both of the datasets are labeled. Recently, recurrent neural networks have been shown to be successful on a variety of NLP tasks such as caption generation; however, the existing domain adaptation techniques are limited to (1) tune the model parameters by the target dataset after the training by the source dataset, or (2) design the network to have dual output, one for the source domain and the other for the target domain. Reformulating the idea of the domain adaptation technique proposed by Daume (2007), we propose a simple domain adaptation method, which can be applied to neural networks trained with a cross-entropy loss. On captioning datasets, we show performance improvements over other domain adaptation methods.

##### Abstract (translated by Google)
我们提出了一个简单的领域适应方法神经网络在一个监督的设置。监督域自适应是一种通过使用源域数据集来提高目标域上的泛化性能的方法，假定两个数据集都被标记。最近，循环神经网络已被证明是成功的各种NLP任务，如字幕生成;然而，现有的领域适应技术限于：（1）在源数据集的训练之后，通过目标数据集调整模型参数;或（2）将网络设计为具有双输出，一个用于源域，另一个用于源域目标域。重新形成Daume（2007）提出的领域自适应技术的思想，我们提出了一个简单的领域自适应方法，可以应用于交叉熵损失训练的神经网络。在字幕数据集上，我们展示了其他领域适应方法的性能改进。

##### URL
[https://arxiv.org/abs/1607.00410](https://arxiv.org/abs/1607.00410)

##### PDF
[https://arxiv.org/pdf/1607.00410](https://arxiv.org/pdf/1607.00410)


text:
Relaxdiego CI/CD auto-provisions and auto-configures a GitLab cluster for you.

## Quick Start

Try it with the cluster configuration directory (configdir for short) at
`examples/manual`. Read `examples/manual/README.md` for instructions on how
to get started.

## Development Guide

### Development Requirements

I have been developing this project using the following tools but you
should be able to swap out some of them (VMware Fusion) with a few
modifications.

* [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
* [Vagrant](https://www.vagrantup.com/downloads.html)
* [VMware Fusion](https://www.vmware.com/asean/products/fusion.html)
* [sshpass](https://gist.github.com/relaxdiego/f2e09f72e9a54b2262c6acfcd40f7b55)

#### Special Considerations for macOS

Make sure you install the GNU versions of sed and grep since the BSD versions
that come with macOS have different interfaces:

```
brew install gnu-sed grep
echo "export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" >> ~/.bash_profile
echo "export PATH=/usr/local/opt/grep/libexec/gnubin:$PATH"" >> ~/.bash_profile
```

Also make sure that your python environment has the right certificates by
installing the [certifi](https://pypi.org/project/certifi/) package:

```
pip install certifi
```

### Instantiate a Local Cluster

To facilitate a faster development workflow, we can instantiate a
dev cluster locally using Vagrant.

```
make gitlab configdir=examples/vagrant-vmware
```

Once provisioning has completed, you should now be able to ssh to your
dev cluster's machines:

```
ssh gitlab
ssh runner
```

You should also be able to browse to your dev GitLab instance:

```
curl -L http://gitlab.localdev
```

### Clean Up the Local Cluster

When you're done and want to remove the local cluster, run:

```
make cluster-implode configdir=examples/vagrant-vmware
```

### More Make Goals

To see more Make goals, run:

```
make help
```

repository: relaxdiego/cicd

repo_name: relaxdiego/cicd


text:
# Universal Interpreter
A solution to help the differently-abled people, i.e. deaf, dumb, blind or combination of any, by using Image
Recognition and AI/ML.

## **Inspiration**

The present world we live in, a world dominated by visual and audio peripherals, can prove to be
a tough place to live in for differently abled people. Hence, our aim was inspired by the need to
use the very same dominating technologies to help the differently abled overcome their challenges.

## **Requirements**
* Python
* Keras
* Tensorflow
* OpenCV
* Web development/Android tools for UI/Testing

## **Project Flow**

### **Phase 1 - Input Phase**
Collect Data such as Gestures (Sign language), taps (for Morse Code) or direct speech (Voice)
from any client device.

### **Phase 2 - Conversation and Transmission Phase**
Convert the input data into some fundamental form (such as Morse/Digital), transmit and process
the data.

### **Phase 3 - Output Phase**
Take the output data and represent it either visually, via vibrations or via speech, depending on the following:
1. Voice/Morse for the Blind
2. Sign-language/Text for the Deaf
3. Sign-language/Voice for the Dumb
4. Morse codes wherever these are not possible

## **Project Flow - Flowchart**
![Project Flow - Flowchart](./Abstract_Flowchart.jpg)

## **Android App Implementation**
[Universal Interpreter Android App GitHub Link](https://github.com/allanakshay12/Universal-Interpreter-Android-App.git)

repository: Saicasm/Universal-Interpreter

repo_name: Saicasm/Universal-Interpreter


text:
Duck Duck - Snooze
==============

This project adds a basic chrome extension for duck duck search engine

## Getting started

Install extension, use duck duck search as normal. You will see a snooze icon
to the right of search results title.
Clicking this will visually reduce the importance of the result and hide the
result summary

## License

The MIT License (MIT)


text:
---
title: WordPress, GitHub Gists, and RSS Feeds
author: Aaron
layout: post
permalink: /wordpress-github-gists-rss-feeds/
dsq_thread_id:
  -<PHONE_NUMBER>
categories:
  - Tech
tags:
  - css
  - gist
  - github
  - html
  - javascript
  - rss
  - wordpress
---
The other day, I was looking at one of my posts in an RSS reader and noticed something interesting: it was missing all of its code snippets. Given that the post in question was code-related, missing snippets was a bad thing.

For several reasons, I save my larger snippets as GitHub gists:

  1. The code is externalized from my blog, which makes sharing individual snippets easier.
  2. Code formatting and presentation is taken care of GitHub (a small thing, but one less for me to manage).
  3. Because gists are GitHub repositories, others can suggest modifications and contribute as needed.
  4. WordPress has nice, easy support for displaying gists.

Upon closer review, however, I recognized the problem: WordPress uses Javascript to add the gist to its posts. RSS doesn’t support Javascript. Ugh.

## TL;DR

With one line of Javascript and a few lines of CSS, it is possible to augment gists in a self-hosted WordPress blog such that links to those gists appear in an RSS reader.

## The Preamble

To achieve a succinct solution, it is necessary to modify some of the core files of your WordPress installation; that’s a pretty large topic, so I’m not going to go into it at any length. Googling around should lead you in the right direction.

## The Process

### Step #1: Add the Javascript one-liner.

In `header.php`, add the following to the `<head>` section of the template:

{% highlight HTML %}

{% endhighlight %}

This adds a CSS class of `js` to the `html` element. Note that, as you would expect, this line only executes if Javascript is available; the end result is that Javascript-friendly environments get the `js` class added to `html` and non-Javascript-friendly environments don’t.

### Step #2: Add the CSS.

Two lines of CSS come next:

{% highlight CSS %}
html.js .no_js, html .js { display: none }
html.js .js { display: block; }
{% endhighlight %}

The first line introduces a new class – `no_js` – that effectively hides any element it’s attached to. We’ll use that momentarily.

### Step #3: Replace existing gist URLs with some new HTML.

Now, simply replace every gist URL:

{% highlight HTML %}
https://gist.github.com/bachya/0d0051b3946ae5cdd6db
{% endhighlight %}

…with some new HTML:

{% highlight HTML %}
[gist 0d0051b3946ae5cdd6db /]

  Click here to see the Gist.

{% endhighlight %}

There are several things occurring in this HTML:

  1. I’m using the WordPress shortcode for embedding a gist (instead of pasting the gist URL). The benefit here is that the shortcode eschews the extra “padding” paragraphs that get wrapped around a gist created from a bare URL.
  2. Included next to the shorcode is a div that links back to this particular spot in the post (the idea being that touching this link in an RSS reader will lead the reader to a spot where they can actually view the snippet.

Thankfully, it works as expected:

[][1]

You might be wondering why I’m not using the `<noscript>` tag. The reasons are long, tedious, and well-summarized elsewhere12 – I’ll leave that to your bedtime reading.

## An Added Goody: Text Expansion

As you might expect, typing this HTML out every time is no good. Therefore, I created a simple aText snippet to get the job done: it takes either the ID or the URL of a gist and creates the necessary HTML.

{% gist 9b48ce3151ebf06e7955 %}

Enjoy!

----

  http://www.paulirish.com/2009/avoiding-the-fouc-v3/ ↩

https://stackoverflow.com/questions/2170484/shouldnt-we-use-noscript-tag ↩

[1]: {{ site.baseurl }}/assets/2014/09/2014-09-08-12.33.24.png


text:
---
layout: post
title: "Daily Digest #292"
type: digest
tags:
    - daily
    - development

description: ""
publish: true
---

- [Apollo Client with REST APIs](https://codeburst.io/apollo-client-with-rest-apis-7f3b15a291a4)
- [Tag-based Navigation of a Fashion Catalog ](https://jobs.zalando.com/tech/blog/exploring-fashion-catalog/index.html)
- [Shard Splits with Consistent Snapshots](https://medium.com/square-corner-blog/shard-splits-with-consistent-snapshots-adcf622842dd)
- [The State of AI Marketing](https://www.infoq.com/presentations/state-ai-marketing)
- [TF-Ranking: A Scalable TensorFlow Library for Learning-to-Rank](https://ai.googleblog.com/2018/12/tf-ranking-scalable-tensorflow-library.html)
- [What We Got Wrong: Lessons from the Birth of Microservices](https://www.infoq.com/presentations/google-microservices)

gha_language: HTML


text:
## Written Responses

1. Describe the general process of how blocks are added to a blockchain.

A block first needs proof of work. This is created by solving a complex mathematical problem that is unique to each block of transactions. since each block has a different mathematical problem, every miner will work on a different problem unique to the block they built. for a block to be accepted by the network it needs to contain only valid transactions: inputs that are not yet spent, inputs that have the valid amount, proof of work,etc.

2. How can blockchain users mine coins?

The transaction is bundled into a block, then verify whether the transaction is valid.
Select the header of the most recent block and insert it into the new block as a “hash.", solve the mathematical problem and the solution is found,the new block is added to the block chain and then propagated throughout the network.

3. Explain how simulations like Conway's Game of Life can be

It can be used for population modeling or traffic simulations.


text:
---
title: Twind Guide
editLink: true
navbar: true
sidebar: true
head:
  - - meta
    - name: description
      content: The official Twind guide
  - - meta
    - name: keywords
      content: twind tailwind css-in-js
---

# {{ $frontmatter.title }}

> The smallest, fastest, most feature complete Tailwind-in-JS solution in existence

[![MIT License](https://flat.badgen.net/github/license/tw-in-js/twind)](https://github.com/tw-in-js/twind/blob/main/LICENSE)
[![Latest Release](https://flat.badgen.net/npm/v/twind?icon=npm&label&cache=10800&color=blue)](https://www.npmjs.com/package/twind)
[![Bundle Size](https://flat.badgen.net/bundlephobia/minzip/twind?icon=packagephobia&label&color=blue&cache=10800)](https://bundlephobia.com/result?p=twind 'gzip bundle size (including dependencies)')
[![Package Size](https://flat.badgen.net/badgesize/brotli/https://cdn.jsdelivr.net/npm/twind/twind.min.js?icon=jsdelivr&label&color=blue&cache=10800)](https://unpkg.com/twind/twind.js 'brotli package size (without dependencies)')
[![Documentation](https://flat.badgen.net/badge/icon/Documentation?icon=awesome&label)](https://twind.dev)
[![Github](https://flat.badgen.net/badge/icon/tw-in-js%2Ftwind?icon=github&label)](https://github.com/tw-in-js/twind)
[![Discord](https://flat.badgen.net/badge/icon/discord?icon=discord&label)](https://discord.com/invite/2aP5NkszvD)
[![CI](https://github.com/tw-in-js/twind/workflows/CI/badge.svg)](https://github.com/tw-in-js/twind/actions?query=workflow%3Aci)
[![Coverage Status](https://flat.badgen.net/coveralls/c/github/tw-in-js/twind/main?icon=codecov&label&cache=10800)](https://coveralls.io/github/tw-in-js/twind?branch=main)

Twind is a small compiler (~13kB) that converts Tailwind utility classes into CSS at runtime. The goal of this project is to unify the flexibility of CSS-in-JS with the carefully considered constraints of the Tailwind API.

## Features

**<Emoji symbol="⚡"/> No build step**

Get all the benefits of Tailwind without the need for PostCSS, configuration, purging, or autoprefixing.

**<Emoji symbol="🚀"/> Framework agnostic**

If your app uses HTML and JavaScript, it should work with Twind. This goes for server-rendered apps too.

**<Emoji symbol="😎"/> One low fixed cost**

Twind ships the compiler, not the CSS. This means unlimited styles and variants for one low fixed cost of ~13kB.

![Example showing how Twind injects styles at runtime](/assets/how-twind-works.gif 'How Twind works')

**Other features include:**

:::tip
Click on each summary to show additional details.
:::

<Emoji symbol="🚅" /> Faster than most CSS-in-JS libraries

Twind's advanced caching and specialized optimizations enable it to compile and inject CSS faster than most other CSS-in-JS solutions. [Check out the benchmarks](/handbook/benchmarks) to learn more.

<Emoji symbol="🎨" /> Seamless integration with Tailwind

If it works in Tailwind, it should work in Twind.

Class names that are provided by Tailwind will always work with Twind. Further, Twind configuration and theming follow [Tailwind conventions](https://tailwindcss.com/docs/theme), meaning you can copy/paste your Tailwind config to the Twind `setup` function. The only difference here is that there is no need to rebuild after changing your theme. Just refresh the page! For more information, check out the [configuration guide](/handbook/configuration).

Twind also provides [a shim](/handbook/the-shim), which allows for seamless integration with your existing Tailwind styles with no configuration. The shim can improve the development experience and is useful for incremental migration.

<Emoji symbol="🎯" /> Extended variants, directives, and syntax

Twind provides additional variants, directives, and syntaxes to give you even more ways to express your styles:

- [Grouping syntax](/handbook/grouping-syntax.md) `class="text(black uppercase md:blue-400)"`
- [Extended variants](/handbook/extended-functionality#variants) like `siblings`, `sibling`, `children`, and `override`
- [Extended utilities](/handbook/extended-functionality#utilities) like `text-underline` and `font-italic`.

<Emoji symbol="✈" /> Tailwind preflight by default

The [base reset](https://tailwindcss.com/docs/preflight) provided by Tailwind is merged with your optional theme configuration and injected in the stylesheet during setup. This guarantees more consistent cross-browser styles out of the box.

:::tip
It is possible to [customize or disable the preflight](/handbook/configuration#preflight).
:::

<Emoji symbol="🚓" /> Escape hatch for arbitrary CSS

The Twind compiler accepts functions that can return arbitrary CSS-in-JS objects, providing a convenient escape hatch for all those one-off rules which aren't supported by Tailwind. The `&` keyword allows you to write complex rules (like pseudo elements `&::before` and `&::after`) that are beyond the scope of inline styles without having to add another dependency.

Twind also provides a [css helper function](/handbook/css-in-twind) as a convenience for this case.

<Emoji symbol="🤖" /> Built in support for conditional rule combining

The [`tw` function](./styling-with-twind.md#the-tw-function) allows you to represent your styles in arrays, objects, template literals, functions, or any combination of these.The interpreter spec is inspired by and is very similar to [clsx](https://github.com/lukeed/clsx) and offers a much more developer friendly API that handles null values gracefully.

<Emoji symbol="🧐" /> Improved readability with multiline styles

Using template literals, objects, and even arrays allows you to break rules over multiple lines, drastically improving readability and maintainability of complex rules.

<Emoji symbol="❄" /> Optional hashing of class names ensuring no conflicts

You can optionally configure Twind to hash class names before injecting them into the document. This may be useful in production as it can reduce the down-the-wire size of server-side rendered pages and eliminates any chance of class name conflicts with third-party styles.

<Emoji symbol="🔌" /> Language extension via plugins

You can effortlessly extend the Twind compiler's abilities by creating your own plugins in your Twind configuration.

Check out [the plugins guide](/handbook/plugins) for more information.

<Emoji symbol="🎩" /> No runtime overhead with static extraction

The compiler is not reliant on the DOM, which makes it an ideal candidate for static extraction and removing all runtime overhead. This is possible during [SSR](/usage-guides/ssr) or build-time prepass.

## Rationale and Inspiration

This project was started by the authors of two similar libraries – [oceanwind](https://github.com/lukejacksonn/oceanwind) and [beamwind](https://github.com/kenoxa/beamwind) – who chose to collaborate with each other in this space.

> Combining efforts has saved us time and resulted in a much more complete and production ready offering.

Furthermore we were able to agree upon, and coin, some standards for certain aspects of the implementation based on our collective learnings; things like parsing input, grouping syntax, precedence calculation and plugin API.

Our inspirations for this project come from these fine projects:

- [Tailwind](https://tailwindcss.com/): Created a wonderfully thought out API on which the compiler's grammar was defined.
- [styled-components](https://styled-components.com/): Implemented and popularized the advantages of doing CSS-in-JS.
- [htm](https://github.com/developit/htm): A JSX compiler that proved there is merit in doing runtime compilation of DSLs like JSX.
- [goober](https://github.com/cristianbote/goober): An impossibly small yet efficient CSS-in-JS implementation that defines critical module features.
- [otion](https://github.com/kripod/otion): The first CSS-in-JS solution specifically oriented around handling CSS in an atomic fashion.
- [clsx](https://github.com/lukeed/clsx): A tiny utility for constructing class name strings conditionally.
- [style-vendorizer](https://github.com/kripod/style-vendorizer): Essential CSS prefixing helpers in less than 1KB of JavaScript.
- [CSSType](https://github.com/frenic/csstype): Providing autocompletion and type checking for CSS properties and values.

### Challenges

The core problems we are trying to solve here are as follows:

1. Parsing Input: taking input and normalizing it to create a comprehendible set of Tailwind rules
2. Compiling Rules: taking a set of Tailwind rules and translating them into appropriate CSS rules
3. Injecting Styles: taking CSS rules and generating classes that get append to a stylesheet in the DOM
4. Merging Themes: combining themes which configure and constrain the compiler
5. Custom Plugins: taking functions and using them to extend the capabilities of the compiler

This has to happen in a performant way at runtime, whilst adhering to Tailwind V2 as a language specification. All grammars that exist in Tailwind should be covered by this implementation.

### Opportunities

Recreating the Tailwind experience at runtime might seem like a futile exercise, but we'd like to believe it opens up the doors to some exciting new possibilities. There is always going to be a tradeoff between compiling at ahead of time and compiling _just in time_, however we are confident that the upsides here are significant enough to pursue a runtime implementation. [The results](/handbook/benchmarks) have been promising so far.

> Note it is still possible to remove all runtime overhead via a prepass either at serve or built time

The flexible nature of a runtime first approach affords us possibilities like:

- Dynamic Theming: generating new themes on the fly without the need to rebuilding anything
- Unlimited Variants: enabling every variant combination by default because unused rules are never generated
- Enhanced Syntax: taking advantage of macros within template literals to create more terse rules
- Error Handling: warning the developer about unknown directives and theme values
- Hashing Classes: reducing the overall output size and eliminating conflicts via deterministic hashing
- [Inline Plugins](https://twind.dev/docs/handbook/advanced/plugins.html#inline-plugins): extending the capabilities of the compiler with simple functions at runtime

Another big advantage we see of shipping the interpreter compiler itself (rather than pre-compiled output) is that the effective size of the CSS for your whole app is deterministic and fixed. The weight of the compiler itself along with your theme file is all that users will ever download, no matter how many styles you use.

Currently the compiler weighs around 12KB which is smaller than styled-components and the average tailwind output.

### Benchmarks

The implementation is tested for speed alongside several popular CSS-in-JS solutions that export general CSS functions. For those that only support a _styled component_ approach an equivalent test has been setup. Currently Twind comes in second place behind [goober](https://github.com/cristianbote/goober) – a less than 1KB css-in-js solution by Cristian Bote – an awesome library worth checking out.

**CSS Function w/ template literal**

| Library        | Results                                    |
| -------------- | ------------------------------------------ |
|<EMAIL_ADDRESS>| x 632,419 ops/sec ±0.59% (95 runs sampled) |
| twind (tw)     | x 400,438 ops/sec ±0.35% (84 runs sampled) |
| twind (apply)  | x 342,725 ops/sec ±0.37% (96 runs sampled) |
| twind (css)    | x 270,020 ops/sec ±0.53% (95 runs sampled) |
|<EMAIL_ADDRESS>| x 229,990 ops/sec ±0.17% (99 runs sampled) |

**CSS Function w/ object**

| Library        | Results                                    |
| -------------- | ------------------------------------------ |
|<EMAIL_ADDRESS>| x 842,430 ops/sec ±1.10% (88 runs sampled) |
| twind (css)    | x 203,990 ops/sec ±0.32% (94 runs sampled) |
|<EMAIL_ADDRESS>| x 162,460 ops/sec ±0.75% (90 runs sampled) |
|<EMAIL_ADDRESS>  | x 53,592 ops/sec ±0.85% (96 runs sampled)  |

**Styled component w/ template literal**

| Library                 | Results                                   |
| ----------------------- | ----------------------------------------- |
| twind                   | x 51,628 ops/sec ±0.63% (89 runs sampled) |
|<EMAIL_ADDRESS>         | x 40,069 ops/sec ±0.43% (96 runs sampled) |
|<EMAIL_ADDRESS>        | x 35,349 ops/sec ±1.01% (93 runs sampled) |
|<EMAIL_ADDRESS>| x 38,284 ops/sec ±0.48% (93 runs sampled) |

For a more detailed testing summary please see the [benchmarks](https://github.com/tw-in-js/twind/blob/main/benchmarks) directory.

## <Emoji symbol="🙏🏾" /> Sponsors

Support us with a monthly donation and help us continue our activities.

[[GitHub Sponsor](https://github.com/sponsors/tw-in-js) | [Open Collective](https://opencollective.com/twind)]

repository: jbruni/twind

repo_name: jbruni/twind


text:
# Design pattern samples in Java
Demo of design-pattern-java.

# Build Status
[![Build Status](https://travis-ci.org/linnever/Design-Pattern-Java.svg?branch=master)](https://travis-ci.org/linnever/Design-Pattern-Java)

# Requirements
- Java >= 1.7
- Gradle >= 2.0(2.0 is the only version I have tried)

repository: linnever/Design-Pattern-Java

repo_name: linnever/Design-Pattern-Java


text:
---
id: getting-started
title: Getting Started
redirect_from: "docs/index.html"
layout: docs
---

## What is Stylable

**Stylable** enables you to build reusable, highly-performant components. Each component exposes a style API that maps its internal parts so you can reuse components across teams without sacrificing stylability.

* Scopes styles to components so they don't "leak" and clash with other styles.
* Enables custom pseudo-classes and pseudo-elements that abstract the internal structure of a component. These can then be styled externally.
* Uses themes so you can apply different look and feel across your web application.

At build time, the preprocessor converts the Stylable CSS into flat, static, valid, vanilla CSS that works cross-browser.

## How do I install

1. Install **Stylable** from our GitHub [repository](https://github.com/wix/stylable).

2. Install the **Stylable** [integrations package](https://github.com/wix/stylable-integration).

3. While **Stylable** can work with any component framework, we use it with [React](https://facebook.github.io/react/docs/installation.html).

## What can I do

* **Build a Stylable component** - If you are looking to style a component, follow the steps in the [Stylable Basics Guide](../docs/guides/components-basics.md) and [Best Practices Guide](../docs/guides/stylable-component-best-practices.md)

* **Build an app** - If you want to use **Stylable** while building a web application, go to [Build a Stylable Application](../docs/guides/stylable-application.md). Read the steps and recommendations for building a performant web application that doesn't depend on other libraries for styling.

* **Create a library** - If you want guidance in creating a component library, read [Create a Stylable Component Library](../docs/guides/stylable-component-library.md). Here you can follow our recommendations for building a library that can be used cross-project and includes theming, external styling and reusable components.

* **Learn** - Take a look at our reference documents to get more acquanted with our code and for specific code examples.

* **Remember** - Our [cheatsheet](../docs/getting-started/cheatsheet.md) helps you keep track of **Stylable** syntax.

## Components

We recommend using our component library, [**Stylable-Components**](https://github.com/wix/stylable-components) - a stylable, fully-tested & strictly-typed component library.

repository: oleksiik-uxd/stylable

repo_name: oleksiik-uxd/stylable


text:
# pixel-cnn++

This is a Python3 / [Tensorflow](https://www.tensorflow.org/) implementation
of [PixelCNN++](https://openreview.net/pdf?id=BJrFC6ceg), as described in the following
paper:

**PixelCNN++: A PixelCNN Implementation with Discretized Logistic Mixture Likelihood and Other Modifications**, by
Tim Salimans, Andrej Karpathy, Xi Chen, Diederik P. Kingma, and Yaroslav Bulatov.

Our work builds on PixelCNNs that were originally proposed in [van der Oord et al.](https://arxiv.org/abs/1606.05328)
in June 2016. PixelCNNs are a class of powerful generative models with tractable
likelihood that are also easy to sample from. The core convolutional neural network
computes a probability distribution over a value of one pixel conditioned on the values
of pixels to the left and above it. Below are example samples from a model
trained on CIFAR-10 that achieves **2.92 bits per dimension** (compared to 3.03 of
the PixelCNN in van der Oord et al.):

Samples from the model (**left**) and samples from a model that is conditioned
on the CIFAR-10 class labels (**right**):

![Improved PixelCNN papers](data/pixelcnn_samples.png)

This code supports multi-GPU training of our improved PixelCNN on [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html)
and [Small ImageNet](http://image-net.org/small/download.php), but is easy to adapt
for additional datasets. Training on a machine with 8 Maxwell TITAN X GPUs achieves
3.0 bits per dimension in about 10 hours and it takes approximately 5 days to converge to 2.92.

## Setup

To run this code you need the following:

- a machine with multiple GPUs
- Python3
- Numpy, TensorFlow and imageio packages:
```
pip install numpy tensorflow-gpu imageio
```

## Training the model

Use the `train.py` script to train the model. To train the default model on
CIFAR-10 simply use:

```
python3 train.py
```

You might want to at least change the `--data_dir` and `--save_dir` which
point to paths on your system to download the data to (if not available), and
where to save the checkpoints.

**I want to train on fewer GPUs**. To train on fewer GPUs we recommend using `CUDA_VISIBLE_DEVICES`
to narrow the visibility of GPUs to only a few and then run the script. Don't forget to modulate
the flag `--nr_gpu` accordingly.

**I want to train on my own dataset**. Have a look at the `DataLoader` classes
in the `data/` folder. You have to write an analogous data iterator object for
your own dataset and the code should work well from there.

## Pretrained model checkpoint

You can download our pretrained (TensorFlow) model that achieves 2.92 bpd on CIFAR-10 [here](http://alpha.openai.com/pxpp.zip) (656MB).

## Citation

If you find this code useful please cite us in your work:

```
@inproceedings{Salimans2017PixeCNN,
  title={PixelCNN++: A PixelCNN Implementation with Discretized Logistic Mixture Likelihood and Other Modifications},
  author={Tim Salimans and Andrej Karpathy and Xi Chen and Diederik P. Kingma},
  booktitle={ICLR},
  year={2017}
}
```


text:
---
layout: post
title: Implementing a liquidity pool with Python
categories: [crypto, web3, python]
excerpt: In this post, I implement a liquidity pool using python and common data structures.
last_modified_at:
---

## Table of Contents

1.  [Introduction](#org4ffb7b0)
2.  [Constant Product Automated Market Maker](#org4b555b0)
3.  [Liquidity providers](#org3474843)
4.  [Risks](#org705dc63)
5.  [Starting to code](#org43ff1b3)
6.  [Creating a pool](#orgceb7fc7)
7.  [Adding liquidity to the pool](#org50b74bc)
8.  [Swapping tokens](#orga26b845)
9.  [Conclusion](#orge7f8f49)
10. [Links](#org701f625)

In this post, I will implement a liquidity pool using python and regular data structures, with no blockchain, and no contract code. The intention is to get a better understanding on how liquidity pools work economically, without diving in blockchain development details.

## Introduction

Liquidity pools are an essential part of Defi because they enable users to exchange tokens without the need of a trusted mediator, as is the case with centralized exchanges such as Coinbase.

This mechanism can be understood as a black box that enables unstoppable and automated trading based on prices defines by an algorithm.

-   Unstoppable because once the mechanism is live, one should not be able to modify the implementation or even stop the mechanism. The only way to disable it is for users to stop using it.
-   Automated because the pricing of the assets is not dependent of users wanting to buy/sell, instead prices are defined algorithmically.

Algorithms used to manage liquidity pools are called Automated Market Makers (AMM) and the simplest one is called: Constant Product Automated Market Maker.

## Constant Product Automated Market Maker

Liquidity pools aid in avoiding large price swings by using algorithms to regulate the trade price.

The constant product formula is described below, and its result must remain constant despite the size of the trade, meaning that the total amount of liquidity on the pool remains constant:

-   `X * Y = K`
-   X represents the number of tokens of type X
-   Y represents the number of tokens of type Y
-   K is the multiplication of the amount of both tokens and must remain constant

This results in a seesaw effect, when the value of one token increases, the value of the other decreases, and vice versa. The formula dictates each transaction’s price, regardless of how much of either token is bought or sold at any given point.

Two details are extremely important to understand here:

-   Smaller markets are subjected to high price variations on transactions since there's not enough weight on the market, every transaction can impact the seesaw. So the more liquidity there is in a pool, the smaller impact trades will have on the value of the assets within that pool.
-   Since the value of assets is determined algorithmically, the system depends on the arbitrage of other actors to keep the current market price. Ex: buying items from the pool at a “discount” price and re-selling it at a secondary market for a profit.

## Liquidity providers

As mentioned in the previous topic, smaller markets are subject to high price fluctuations due to the algorithmic nature of the pools. Liquidity providers are rewarded with transaction fees for allowing other traders to buy and sell using your liquidity. However, this is not a risk-free investment, one also needs to account for impermanent loss, which takes place when a trader places their tokens within a liquidity pool and then the price changes. The value of those tokens is now less than it was at the time of the investment, which means if you remove them now, their value will have decreased.

These losses are called impermanent because until you remove the investment from the liquidity pool, the loss is not materialized. You can wait to remove your liquidity until the exchange reaches a favorable point (but this can never come to fruition).

## Risks

Other than the risk for liquidity providers described in the previous section, there is also systemic risks of interacting with these mechanisms.

These markets are self-sustaining because they don’t need intermediaries. Formulas power smart contracts that provide security and confidence for investors. However, you need to verify in order to gain confidence in the project you are using, contracts can have bugs, founders can be ill-intentioned (e.g. create backdoors on their project to remove profits), and the ecosystem around the protocol can collapse (e.g.: Terra disaster), and etc.

## Starting to code

We want to enable the following functionalities:

-   Trade one token for another freely
-   Add liquidity to the pool
-   Remove their share of liquidity of the pool

Some general notes on how we want to approach this implementation:

-   One liquidity pool should have two tokens
-   The pricing algorithm will be the Constant Product
-   All operations must keep the K value constant
-   The token ratio determines the pool’s pricing. For example, when someone buys DAI from the DAI/ETH pool, the volume of ETH increases, raising the price of DAI while lowering the price of ETH.
-   But the total price adjustment will depend on how much the person spent and how much the pool was altered.
-   For simplicity, we will not consider transaction fees.
-   Price is determined by: price_token_A = reserve_token_B / reserve_token_A (Y / X)

## Creating a pool

Liquidity pools will be called Exchange and as mentioned previously the implementation will be made in Python.

```python
class Exchange:
    """
        Exchanges is how uniswap calls the liquidity pools
    """

    def __init__(self, token0_name: str, token1_name: str, name: str, symbol: str) -> None:
        self.token0 = token0_name
        self.token1 = token1_name
        self.reserve0 = 0
        self.reserve1 = 0
        self.fee = 0

        self.name = name
        self.symbol = symbol
        self.liquidity_providers = {}
        self.total_supply = 0
```

All the storage needed is reserve0 and reserve1, to hold the number of tokens of each asset. Other attributes are secondary and are used to ease implementation and keep a record of what's happening in the pool.

## Adding liquidity to the pool

Adding liquidity means updating the reserves to enable trading. When adding liquidity to a pool for the first time, the pool’s creator determines each asset's initial price. However, if the pool's pricing does not match that of the global crypto market, the liquidity provider risks losing money.

After the first time, the liquidity added to both pairs must match a minimal value, which is defined by `(amount0 * reserve1) / reserve0`.

```python
class Exchange

    # ...

    def quote(self, amount0, reserve0, reserve1):
        """
        Given some amount of an asset and pair reserves, returns an equivalent amount of
        the other asset
        """
        assert amount0 > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'
        assert reserve0 > 0 and reserve1 > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'
        return (amount0 * reserve1) / reserve0;

    def _add_liquidity(self, balance0, balance1):
        """
        You always need to add liquidity to both types of coins
        """
        if self.reserve0 == 0 and self.reserve1 == 0:
            # initializing pool
            amount0 = balance0
            amount1 = balance1
        else:
            balance1Optimal = self.quote(balance0, self.reserve0, self.reserve1)
            if balance1Optimal <= balance1:
                amount0 = balance0
                amount1 = balance1Optimal
            else:
                balance0Optimal = self.quote(balance1, self.reserve1, self.reserve0)
                assert balance0Optimal <= balance0
                amount0 = balance0Optimal
                amount1 = balance1

        self.reserve0 += amount0
        self.reserve1 += amount1
```

A visual example is the image below, the algorithm will force the user to always add the same amount of liquidity to both assets in the pool.

This is extremely important when the pool is unbalanced, due to trades and negotiations that make the pool price equal to the market price.

## Swapping tokens

The implementation to swap tokens has more assertions than the actual code. The magic happens in the `get_amount_out` function, which calculates the correct amount out given the reserves of the pool.

```python
class Exchange
    # ...

    def get_amount_out(self, amount_in):
        """
        Given an input amount of an asset and pair reserves, returns the maximum output amount of the
        other asset

        (reserve0 + amount_in_with_fee) * (reserve1 - amount_out) = reserve1 * reserve0
        """
        assert amount_in > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'
        assert self.reserve0 > 0 and self.reserve1 > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'

        amount_in_with_fee = amount_in * 1000              # disconsidering the fee here: amount_in * 997
        numerator = amount_in_with_fee * self.reserve1
        denominator = self.reserve0 * 1000 + amount_in_with_fee
        amount_out = numerator / denominator

        return amount_out

    def swapExactTokensForTokens(self, amount0_in, amount1_out_min):
        amount0_out = 0
        amount1_out = self.get_amount_out(amount0_in)
        assert amount1_out >= amount1_out_min, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT'

        assert amount1_out > 0, 'UniswapV2: INSUFFICIENT_OUTPUT_AMOUNT'
        assert amount0_out < self.reserve0 and amount1_out < self.reserve1, 'UniswapV2: INSUFFICIENT_LIQUIDITY'

        balance0 = self.reserve0 + amount0_in - amount0_out
        balance1 = self.reverve1 - amount1_out
        balance0_adjusted = balance0 * 1000
        balance1_adjusted = balance1 * 1000
        assert balance0_adjusted * balance1_adjusted == self.reserve0 * self.reserve1 * 1000**2, 'UniswapV2: K'

        self.reserve0 = balance0
        self.reserve1 = balance1

        return amount1_out
```

Below is a set of example transactions, note that the difference between the amount in and the amount out increases as the transaction amount increases. This is what was described as the seesaw effect.

# Conclusion
In this post, you just saw how to implement a liquidity pool using python and regular data structures, no blockchain, no contract code. A more complex implementation replicating the architecture used on smart contracts can be found [here](https://github.com/rsarai/liquidity-pool).

## Links

-   [What Is an Automated Market Maker?](https://www.coindesk.com/learn/2021/08/20/what-is-an-automated-market-maker/)
-   [Know Everything about Crypto Liquidity Pools](https://www.blockchain-council.org/defi/crypto-liquidity-pools/)
-   [What Are Liquidity Pools?](https://www.gemini.com/cryptopedia/what-is-a-liquidity-pool-crypto-market-liquidity)
-   [On Path Independence](https://vitalik.ca/general/2017/06/22/marketmakers.html)
-   [A Mathematical View of Automated Market Maker (AMM) Algorithms and Its Future](https://medium.com/anchordao-lab/automated-market-maker-amm-algorithms-and-its-future-f2d5e6cc624a)
-   <https://betterprogramming.pub/uniswap-smart-contract-breakdown-ea20edf1a0ff>
-   <https://ethereum.org/pt-br/developers/tutorials/uniswap-v2-annotated-code/>
-   <https://jeiwan.net/posts/programming-defi-uniswapv2-1/>
-   <https://github.com/Uniswap/v1-contracts/blob/c10c08d81d6114f694baa8bd32f555a40f6264da/contracts/uniswap_exchange.vy>
-   <https://docs.uniswap.org/protocol/V1/guides/pool-liquidity>
-   <https://docs.uniswap.org/protocol/V1/guides/connect-to-uniswap>
-   <https://www.apifiny.com/academy-what-are-automated-market-makers-amm>

gha_language: SCSS


text:
## Image Stiching and Multi Camera Data Collection from Carla:

Data is initially colloected from dual cameras in instantiated in Carla capturing the same scene at different yaw and roll angles to get overlapping scenes. The following images are the left and the right camera capture regions respectively:

### Image Stitching:
The freatures are extracted using the ORB feature extracter. Following this, the key point descriptors are passed through a matching algorithm like BFMatcher or FLANN matcher to get the matches which are then used to find the Homography and stich the images. After experimenting, the BFmatcher was finalized as it was quicker.

### Stitching result for the above images:
![](assets/out_stiched.jpg)

### Depth Map and 3D location prediction:
This stitched image is then passed through the depth network to get the depthand through the yolo model to get the objects. This is information is then used to predict the locations.

#### Result of the Depth Network for our Data:
![](assets/out_out_stiched_working.jpg)

#### Result of the YOLO Network for our Data:
![](assets/out_stiched_working.jpg)

#### 3D Location Prediction:

Once the depth data and the bounding box info has been obtained, the pixel coordinates of the central point of each bounding box of interest are computed and using the depth data and the intrinsic parameters of the camera, thee corresponding 3d location is computed.

![](assets/3d_final_stitched.png)

---

#### References

> [**YOLOv3: An Incremental Improvement**](https://arxiv.org/abs/1804.02767)

> [**Monocular Depth Estimation Using Laplacian Pyramid-Based Depth Residuals**](https://ieeexplore.ieee.org/document/9316778)

> [**Lapdepth Official Repository**](https://github.com/tjqansthd/LapDepth-release)

---

repository: robocomp/web

repo_name: robocomp/web


text:
# Doorman

[![Build Status](https://travis-ci.org/youtube/doorman.png?branch=master)](https://travis-ci.org/youtube/doorman)

Doorman is a solution for Global Distributed Client Side Rate Limiting. Clients that talk to a shared resource (such as a database, a gRPC service, a RESTful API, or whatever) can use Doorman to voluntarily limit their use (usually in requests per second) of the resource. Doorman is written in Go and uses [gRPC](http://www.grpc.io/) as its communication protocol. For some high-availability features it needs a [distributed lock manager](https://en.wikipedia.org/wiki/Distributed_lock_manager).
We currently support [etcd](https://github.com/coreos/etcd), but it should be relatively simple to make it use [Zookeeper](https://zookeeper.apache.org/) instead.

## Getting started

The purpose of Doorman is to apportion and distribute capacity to clients based on some definition of fairness. The capacity a client gets for a resource depends on four things:

- The configured maximum capacity for the resource (world-wide).
- The capacity need (wants) of this client.
- The capacity needs (wants) of all other clients on the planet.
- The exact algorithm used (as defined by the configuration) to apportion the capacity among all the clients.

The Doorman master server remembers all clients that currently have capacity and whenever a client asks for capacity it inserts the clients request into its memory and runs the algorithm to figure out what this client should get.

### Lease length and refresh interval

Doorman only gives out capacity for a limited amount of time, in the form of leases. Each capacity grant comes with a lease length: The client is guaranteed that amount of capacity for the duration of the lease. A typical lease length is five minutes. On top of the lease length the Doorman server also returns a refresh interval. This is the interval after which the client is expected to check back in to get a new lease. A typical refresh interval is five seconds.

Note: The Doorman system is *cooperative*. The clients are expected to honour the capacity grant, the lease length, and the refresh interval. The system provides no protection against misbehaving clients.

In the normal operation of the system the clients all check in regularly with the server to refresh their capacity. The server knows of all clients and their resource needs, and on every request makes the best possible apportionment of the capacity. For optimization purposes (reduce qps on the Doorman server) the client code does bulk refreshes for all resources whenever it sends out a request to the Doorman server. This means that under specific circumstances (for instance when registering a new resource) a resource might get its capacity refreshed a bit sooner than expected.

The Doorman configuration specifies which algorithm should be used to distribute capacity among all clients. The page on algorithms explains which algorithms currently are available and how they apportion capacity to each client.

The two parameters lease\_length and refresh\_interval optimize a number of different behaviors of the system:

- The load on the Doorman server.
- The speed with which the system converges as resource needs change and clients appear and disappear.
- How the system deals with the Doorman server being unreachable or slow.

### When the Doorman server goes unreachable and comes back

When a client cannot reach the Doorman server the following happens:

- The client misses one or more refresh intervals. This does not matter much for the client other than that the capacity the client has is not adjusted for potentially changed resource needs.
- When the Doorman server is unavailable for a longer period of time leases expire and the resources revert to their configured safe capacity. This can be either:
  * -1, meaning an unbounded (infinite) rate limit, or
  * 0, meaning that all access to the resource is blocked, or
a positive number
- As soon as the Doorman server becomes reachable again the clients will resume requesting capacity.

Note: Doorman uses multiple servers in different clusters and a master election procedure to determine the current master.

Doorman does not share or store its internal database. That means that when a Doorman server becomes the master it starts with an empty repository of clients and outstanding leases. However this is not as problematic as it seems, because once the server is available all clients will start calling it to refresh their leases. Since the Doorman server knows that it does not have enough information to run its algorithms it will simply return the currently assigned capacity, or zero if it is a request from a client which currently does not have capacity for the resource. The server knows the currently assigned capacity because clients helpfully include it in every GetCapacity RPC. This phase of the server is known as *learning mode*.

During the learning mode of a resource every request will be answered with a new lease for the same capacity the client currently has. Practically speaking after a couple of refresh intervals the server can be reasonably sure that it has been contacted by every existing client out there. However for reasons of safety the default learning mode duration is the same as the lease length. This decision ensures that when the learning mode duration expires we can be sure that there are no leases out there that we don't know about (because these would have expired by then). If you want the system to converge faster after a Doorman master election you can explicitly configure a learning\_mode\_duration in the resource template (see the page on the Configuration of the system for more information).

### Who wants what?

Doorman requires the clients to inform it of the desired capacity (the so-called *wants*). If you are using the low-level Doorman client you need to figure out your capacity need and call the appropriate methods to make sure that the client library requests that amount of capacity during its refresh cycle. However if you use the rate limiter objects provided by the Doorman clients the desired capacity is determined automatically by observing the behavior of the threads that want to access the resource. This automatic wants determination uses a moving average to smoothen out any spikes.

### Next steps
- Read the [tutorial](doc/simplecluster).
- Read more about available [algorithms](doc/algorithms.md).
- Read a [Kubernetes deployment tutorial](doc/loadtest).
- Read about Doorman's [configuration](doc/configuration.md).
- Read the in-depth [design doc](doc/design.md).
- Read the [client documentation](https://godoc.org/github.com/youtube/doorman/go/client/doorman).

## Status and Plans

Doorman should be currently considered Alpha quality software. The server and Go client received a decent amount of testing at Google (both functional and load testing), so we are pretty confident they do what they are supposed to do. However, in the process of open-sourcing the code we switched from internal Google technologies to their Open Source equivalents – and this needs more testing. Finally, there's no proper versioning scheme at the moment.

Short term plans:
+ C++ client;
+ Python client;
+ Docker image;

Longer term plans:
+ Ruby client;
+ Proper semantic versioning.

## Installation

First, you need to have Go installed. You can either follow the official [installation instructions](https://golang.org/doc/install) or, on OS X, just do
```sh
brew install go
```

As part of the initial setup, you have to set `GOPATH`, wihch is the location where Go keeps all its sources and binary artifacts.
```sh
export GOPATH=...
```

With this out of the way, Doorman is just one go get away:

```sh
go get github.com/youtube/doorman/go/cmd/doorman
```

If you are interested in a checkout of Doorman that you can modify, you can do:

```sh
mkdir -p $GOPATH/src/github.com/youtube
git clone git@github.com:youtube/doorman.git
```

### Go version <= 1.5

If you are using a version of Go earlier than 1.6, you will need to set an environment variable to enable vendoring (see https://golang.org/s/go15vendor):

```sh
export GO15VENDOREXPERIMENT=1
```

## Contributing

See [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow.

## License
Doorman is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.

## Note
This is not an official Google product.

repository: fingthinking/doorman

repo_name: fingthinking/doorman


text:
---
description: If I was to build a website from scratch in 2017
keywords: research, website, scratch
title: If I was to build a website from scratch in 2017
---

## If I were to build a website right now from scratch, what language and tools would you use?

For a release in 2018AD:

A containerized back-end service mesh managed by Kubernetes and wired together using Istio.

Services implemented primarily in Python, with Go in performance-critical points. Internal communication using gRPC. External communication using REST and GraphQL, as appropriate.

Scaleout queues using Kafka. Offline and stream processing using Spark. Persistent caching storage in Cassandra, and relational data using Postgres, with text indexing using ElasticSearch.

Front-end written in TypeScript, on top of React/Redux, all packaged using Webpack and deployed to CDN using jenkins, with NGINX caching proxy servers.

Rollout using Salt. Log aggregation using Sumo, and Graphite for metrics.

We could probably go on, but the above represents close to the state of the current art, without going way off the rails with Scala/Clojure, etc.

And you wonder why software engineers are well-paid these days. ;)

The above is pretty close to what we’re working on these days, actually, although we do have some complex distributed engines written in Scala, as well as a bit more “variety” on the front-end stack, and a lot more JavaScript on the back-end.

When your “website” lives in the real world and you’re massively successful, the website’s infrastructure experiences explosive growth. The above stack is designed to assist in managing all that. As usual, though, it’s the processes and architecture that make the big difference, not the tech, per se.

The above stack is also designed to solve the problem of developing, deploying, and operating a massive, complex system. Simpler systems can benefit from much simpler stacks. For example, a serverless setup consisting of AWS lambda, with content stored in S3/, and data stored in DynamoDB could be a choice for a startup trying to get to an MVP quickly at minimal cost, but with high scalability and resilience.

## Resources

- [https://www.quora.com/If-you-were-to-build-a-website-right-now-from-scratch-what-language-and-tools-would-you-use](https://www.quora.com/If-you-were-to-build-a-website-right-now-from-scratch-what-language-and-tools-would-you-use)


text:
# cyckl's simpfhys collection
Collection of lua spawnmenu entries for Digger's simpfhys cars (Garry's Mod)

## Features and bugs
* Electric conversions for three cars with proper gearing and fueltype
* (Personal collection) Custom license plates

## Included vehicles
* 1991 BMW E30 M3
* 1964 Porsche 911 E (901 Generation)
* 1973 Porsche 911 Carrera RS 2.7 (901 Generation)
* 2017 Porsche 911 Turbo S (991.2 Generation)

## Prerequisites
* Digger's [2017 Porsche 911 Turbo S](https://steamcommunity.com/sharedfiles/filedetails/?id=870276599) and all required addons
* Digger's [Porsche Classic Pack](https://steamcommunity.com/sharedfiles/filedetails/?id=1127283447) (volume 1 & 2) and all required addons

## How to use
* Drop `electric` folder into `<steam dir>\steamapps\common\GarrysMod\garrysmod\addons`
  * Optional: also install `personal` folder into same directory for personal collection

## Future plans
* BMW M3 E30 ([done!](https://steamcommunity.com/sharedfiles/filedetails/?id=2091058395))
* Porsche 911 GT3RS (991.2 Generation)
* An offroad vehicle of some type

## Issues?
* Let me know on the issues page

repository: cyckl/simfphys

repo_name: cyckl/simfphys


text:
## CODING COMPANION
You can save your time during contest time. You don't have to write the testcases again and again. It will also create templates which will save a lot of time. This setup will download all of your testcases from the contest.
######
- supported coding platforms:
  - Codechef
  - Codeforces
  - Leetcode
  - Atcoder

## Setup/Installation
Open your Terminal/Command in the directory for the project and run these commands.

    git clone "https://github.com/saurabhkumar23/coding-companion.git"
    cd coding-companion
    npm install #install the dependencies from package.json

## Usage
- run this command on your terminal:
    - $npm link
    - $give-testcases
- give your coding platform (codeforces/codechef/leetcode/atcoder)
- for leetcode, you need to give your leetcode credentials.
- give your contest id. (you will find it on your contest URL. the id written at the end of the url)
![image](https://user-images.githubusercontent.com/43825814/119214579-8b2a1480-bae5-11eb-8d10-2f760fa8106b.png)
![image](https://user-images.githubusercontent.com/43825814/119214595-b44aa500-bae5-11eb-9b7a-67392bb9424c.png)
![image](https://user-images.githubusercontent.com/43825814/119214609-caf0fc00-bae5-11eb-80b9-7294d1f3bc45.png)
![image](https://user-images.githubusercontent.com/43825814/119214620-df34f900-bae5-11eb-9437-57c22480e90e.png)
- choose your coding language (cpp/java/python).
- now, script will handle everything:
    - will visit all the problems of the contest.
    - download their testcases.
    - create multiple directories A B C D E inside the Problemset directory depending on the number of problems in contest. directory flow will look like this:
        - *code/codeforces/1492/A*
    - each directory created will have
        - input.txt : containing problem inputs.
        - output.txt : containing problem outputs.
        - your_input.txt : testing your code.
        - your_output.txt : testing your code.
        - for eg:- A.cpp : of choosen template (cpp/java/python)


text:
---
slug: president-eduardo-m-ochoa-recognized-as-hispanic-role-model-and-leader-in-higher-ed
title: "President Eduardo M. Ochoa Recognized as Hispanic Role Model and Leader in Higher Ed"
date: January 01 2020
---

  SEASIDE, Ca., Nov. 8, 2016 -- President Eduardo Ochoa
  is one of 25 leaders recognized by Hispanic Outlook in Higher Education’s “Hispanic Leaders and Role Models in Higher Education.”

  During Dr. Ochoa’s tenure as president at CSUMB, enrollment has grown
  significantly in student numbers and diversity. From fall 2011 to fall 2016,
  Latino enrollment has increased by 84 percent and African-American
  enrollment has increased by 91 percent. As a result, current CSUMB enrollment
  more closely reflects the demographics of its three-county service area.

  In 2015, the university was the only public university in California to
  receive two awards in the California Innovation Grants program, which was
  designed to recognize universities who found creative and cost-effective
  ways to get more students to earn degrees in less time. Receiving awards were
  the CS-in-3 program, a partnership with Hartnell College through which
  a diverse cohort of students earns a bachelor’s degree in computer science in
  three years, and the Math Huge program, a successful model for teaching
  students developmental math.

  Under Dr. Ochoa's leadership, CSUMB has also made significant progress in
  improving the four and six-year graduation rates of its incoming classes,
  along with the graduation rates for transfer students.

repository: csumb-archives/news-gatsby

gha_language: JavaScript

repo_name: csumb-archives/news-gatsby


text:
# ROS-TCP-Connector

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

## Installation
1. Using Unity 2020.2 or later, open the package manager from `Window` -> `Package Manager` and select "Add package from git URL..."
![image](https://user-images.githubusercontent.com/29758400/110989310-8ea36180-8326-11eb-8318-f67ee200a23d.png)
2. Enter the following URL. If you don't want to use the latest version, substitute your desired version tag where we've put `v0.3.0` in this example:
`https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.3.0`
3. Click `Add`.

## Tutorials
Scripts used to send [ROS](https://www.ros.org/) messages to an [TCP endpoint](https://github.com/Unity-Technologies/ROS_TCP_Endpoint) running as a ROS node.

This Unity package provides three main features:

- ROSConnection: See the [Unity Robotics Hub](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/master/tutorials/ros_unity_integration/README.md) repository for information and tutorials on how to use this component.

- [Message Generation](MessageGeneration.md)

- [ROSGeometry](ROSGeometry.md)

## ROS#

Special thanks to the Siemens [ROS# Project Team]( https://github.com/siemens/ros-sharp/wiki/Info_Acknowledgements) for driving the ROS-Unity Integration Open Source since 2017.

## Community and Feedback

The Unity Robotics projects are open-source and we encourage and welcome contributions.
If you wish to contribute, be sure to review our [contribution guidelines](CONTRIBUTING.md)
and [code of conduct](CODE_OF_CONDUCT.md).

## Support
For general questions, feedback, or feature requests, connect directly with the
Robotics team at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com).

For bugs or other issues, please file a GitHub issue and the Robotics team will
investigate the issue as soon as possible.

## License
[Apache License 2.0](LICENSE)


text:
## API

The package is available by importing its default function:

```js
import idioRoutes from '@idio/routes'
```

```### idioRoutes
[
  ["arg1", "string"],
  ["arg2?", "boolean"]
]
```

Call this function to get the result you want.

%EXAMPLE: example/example.js, ../src => @idio/routes%

repository: artdecocode/-idio-routes

repo_name: artdecocode/-idio-routes


text:
# PN5_60783

**Created At:** 8/29/2018 10:26:44 AM
**Updated At:** 10/24/2018 8:47:45 PM
**Original Doc:** [pn5_60783](https://docs.jbase.com/48420-5-7-1-release-notes/pn5_60783)
**Original ID:** 336538
**Internal:** No

### Description

jQL: Selection criteria on date conversion fails on multi-value field

### Previous Release Behavior

Only the first multi-value was left in internal format, giving the wrong result.

### Current Release Behavior

All multi-values are processed correctly, i.e. the date conversion is applied to every internal value.

repository: CBarouch/docs

repo_name: CBarouch/docs


text:
### `get-cards`

Retrieves a list of the cards stored on a controller.

```
Request:

topic: <root>/<requests>/device/cards:get

message:
{
    "message": {
        "request": {
            "request-id": "<request-id>",
            "client-id": "<client-id>",
            "reply-to": "<topic>",
            "device-id": "<controller-id>",
        }
    }
}

request-id   (optional) message ID, returned in the response
client-id    (required) client ID for authentication and authorisation (if enabled)
reply-to     (optional) topic for reply message. Defaults to uhppoted/gateway/replies (or the
                        configured reply topic) if not provided.
device-id    (required) controller serial number
```

```
Response:
{
  "message": {
    "reply": {
      "request-id": <request-id>,
      "client-id": <client-id>,
      "method": "get-cards",
      "response": {
            "device-id": "<controller-id>",
            "cards": "[]uint32",
      },
      ...
    }
  },
  ...
}

request-id   message ID from the request
client-id    client ID from the request
device-id    controller serial number
cards        list of card numbers
```

Example:
```
topic: uhppoted/gateway/requests/device/cards:get

{
  "message": {
    "request": {
      "client-id": "QWERTY",
      "request-id": "AH173635G3",
      "reply-to": "uhppoted/reply/97531",
      "device-id": 405419896
    }
  }
}

{
  "message": {
    "reply": {
      "server-id": "uhppoted"
      "client-id": "QWERTY",
      "request-id": "AH173635G3",
      "method": "get-cards",
      "response": {
        "device-id": 405419896,
        "cards": [
          8165537,
          8165539,
          8165538
        ]
      }
    }
  }
}
```

repository: uhppoted/uhppoted-mqtt

gha_language: Go

repo_name: uhppoted/uhppoted-mqtt


text:
---
layout: post
title: How to Find a table in Presto
subtitle: presto commands
show-avatar : false
permalink: /blog/presto-developer
date: 2021-02-01 00:15:00 -0400
comments: true
published: false
categories: []
tags: [presto, aws]

---

I wanted to find a table in presto cluster and was looking for something similar to dba_ or v$ views in oracle to find the table.

Below is the query we can use to find with name starting with 'table'

```sql
select table_schema,
table_name
from information_schema.tables
where table_name like 'table%'
and table_schema not in ('information_schema', 'pg_catalog')
and table_type = 'BASE TABLE'
order by table_schema,
table_name;
```

Output is below format

|**table_schema**|**table_name**|
-------  |-------------
|prod_schema|	table|
|prod_schema|	table2|


text:
---
layout: default
---

# 1996-01-31 - [noise] Re: Escrowing Viewing and Reading Habits with the Governmen

## Header Data

From: Bruce Murphy<EMAIL_ADDRESS>To: Alan Horowitz<EMAIL_ADDRESS>Message Hash: 3d903b98a7dec4275c3190f36ceeca63da1f754951590665642d8333c2e9aaf8

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-01-31 16:42:47 UTC

Raw Date: Thu, 1 Feb 1996 00:42:47 +0800

## Raw message

```
{% raw  %}From: Bruce Murphy<EMAIL_ADDRESS>Date: Thu, 1 Feb 1996 00:42:47 +0800
To: Alan Horowitz<EMAIL_ADDRESS>Subject: [noise] Re: Escrowing Viewing and Reading Habits with the Governmen
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

In message<EMAIL_ADDRESS>
  Alan Horowitz wrote:
>
>
> > > Do you really think that the FBI foreign counter-intelligence squad has
> > > nothing better to do than keep a database of who is reading Che Guevara
> > > memoirs?
> >
> > Heck, I remember this was a big issue about 15 years ago. Try asking
> > someone who was active in library science in the late 70's, early 80's.
>
>     I did. They said you're wrong. Shall we start a CP flame-war of
> unattributed allegations from librarians who will recall what *they
> thought* the FBI is interested in?

Should we instead start a CP flame war involving unattributed
allegations from librarians who are being monitored by aliens who will
recall crop circles in the microfiche?

I presume all this interest was brought about by several (relatively)
recent uses of the (alleged) information about FBI monitoring of
libraries?

What the hell, I wanted to own a copy of Applied Cryptography anyway.

--
Packrat (BSc/BE;COSO;Wombat Admin)
Nihil illegitemi carborvndvm.

{% endraw %}
```

## Thread

+ Return to [January 1996](/archive/1996/01)

+ Return to "[Alan Horowitz <alanh@infi.net>](/authors/alan_horowitz_alanh_at_infi_net_)"
+ Return to "[Bruce Murphy <packrat@ratbox.rattus.uwa.edu.au>](/authors/bruce_murphy_packrat_at_ratbox_rattus_uwa_edu_au_)"
+ Return to "[Rich Graves <llurch@networking.stanford.edu>](/authors/rich_graves_llurch_at_networking_stanford_edu_)"

+ _Unknown thread root_
  + 1996-01-29 (Tue, 30 Jan 1996 05:47:01 +0800) - [Re: Escrowing Viewing and Reading Habits with the Governmen](/archive/1996/01/7919af21e917c1550b3cb91348a88123f214f11bc4149445baee4776c5806e26) - _Alan Horowitz<EMAIL_ADDRESS>    + 1996-01-30 (Tue, 30 Jan 1996 08:41:51 +0800) - [Re: Escrowing Viewing and Reading Habits with the Governmen](/archive/1996/01/c8313e12ac5d92aa89e8a4f27adcb9f189ee4ccdb23a64f0807f96fc9291f86b) - _Rich Graves<EMAIL_ADDRESS>    + 1996-01-31 (Thu, 1 Feb 1996 00:42:47 +0800) - [noise] Re: Escrowing Viewing and Reading Habits with the Governmen - _Bruce Murphy<EMAIL_ADDRESS>


text:
# Fashion-MNIST-dataset-classification [![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://share.streamlit.io/sandeep-yadav2/fashion-mnist-dataset-classification/main/fashion.py)
1.Fashion  dataset classification with streamlit GUI which machine learning powerful liblaries for more information read on streamlit.io

Click on link for open the project
https://share.streamlit.io/sandeep-yadav2/fashion-mnist-dataset-classification/main/fashion.py

2.read the requirement file for reqiured  libraries

3.cnn_model is for Convulational neural network

4.Seq_model is for Sequential model

5.I made two model then i called this model in fashion.py file which main file for running the project

![alt text](https://github.com/Sandeep-Yadav2/Fashion-MNIST-dataset-classification/blob/main/main%20page.PNG)

![alt text](https://github.com/Sandeep-Yadav2/Fashion-MNIST-dataset-classification/blob/main/uploading%20the%20image.PNG)

![alt text](https://github.com/Sandeep-Yadav2/Fashion-MNIST-dataset-classification/blob/main/classification.PNG)

![alt text](https://github.com/Sandeep-Yadav2/Fashion-MNIST-dataset-classification/blob/main/data%20explore.PNG)

![alt text](https://github.com/Sandeep-Yadav2/Fashion-MNIST-dataset-classification/blob/main/acuracy%20graph.PNG)


text:
# Extended Kalman Filter Project Starter Code
[![Udacity - Self-Driving Car NanoDegree](https://s3.amazonaws.com/udacity-sdc/github/shield-carnd.svg)](http://www.udacity.com/drive)

---

## Overview
In this project, a Kalman Filter is used to estimate the state of a moving object of interest with noisy lidar and radar measurements.

---

## Project Structure

- **[src](./src):** Folder containing the C++ source files
- **[CMakeLists.txt](./CMakeLists.txt):** CMake configuration file
- **[data](./data):** Folder containing example dataset with ground truth data for evaluating the Kalman Filter

---

## Dependencies

Keep in mind that the minimum project dependency versions are:

**cmake: 3.5**
- All OSes: [click here for installation instructions](https://cmake.org/install/)

**make: 4.1 (Linux and Mac), 3.81 (Windows)**
- Linux: make is installed by default on most Linux distros
- Mac: [install Xcode command line tools to get make](https://developer.apple.com/xcode/features/)
- Windows: [Click here for installation instructions](http://gnuwin32.sourceforge.net/packages/make.htm)

**gcc/g++: 5.4**
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - [install Xcode command line tools](https://developer.apple.com/xcode/features/)
- Windows: recommend using [MinGW](http://www.mingw.org/)

If missing, the script in the installation process below will install them automatically.

---

## Installation

Start by cloning this project.

There are 3 components to install to run the EKF:
1. Unity simulator - For interfacing and graphical output. The Term 2 Simulator can be downloaded [here](https://github.com/udacity/self-driving-car-sim/releases).
2. Installation of uWebSocketIO - handles communication between the C++ EKF and Unity simulator.
3. Installation of EKF - the Extended Kalman Filter in this repo.

### uWebSocketIO Installation

This repository includes two files that can be used to set up and install [uWebSocketIO](https://github.com/uWebSockets/uWebSockets) for either Linux or Mac systems. For windows you can use either Docker, VMware, or even [Windows 10 Bash on Ubuntu](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/) to install uWebSocketIO.

**Linux Installation**

From the project repository directory run the script: `install-ubuntu.sh`

**Mac Installation**

From the project repository directory run the script: `install-mac.sh`

**Windows Installation**
##### **Bash on Windows**

This project has been developed using the Linux Bash Shell on Windows 10 with Ubuntu 18.04 LTS and assume you have this [installed](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/).

Navigate to the project folder in bash and run: `sudo install-linux.sh`

This step may fail for number of reasons as listed below:

- `ln: failed to create symbolic link '/usr/lib/libuWS.so': File exists`, run the following command: `sudo rm /usr/lib/libuWS.so` and rerun the above command.
- `install-ubuntu.sh` has only `rw` but no `x` permission. Run `chmod a+x install-ubuntu.sh` to give execution permission
- Cannot find the package `libuv1-dev`
   - To install the package run `sudo apt-get install libuv1.dev`
   - If you still cannot install the package run the following to get the package and install it:
      ```
      sudo add-apt-repository ppa:acooks/libwebsockets6
      sudo apt-get update
      sudo apt-get install libuv1.dev
      ```
- May complain about the version of cmake you have. You need a version greater than 3.0. [Here is a link](https://askubuntu.com/questions/355565/how-to-install-latest-cmake-version-in-linux-ubuntu-from-command-line) which describes how to get version 3.8. Look at Teocci's response in this link
- Installing cmake requires g++ compiler. Install a g++ version 4.9 or greater. Here are the steps:
```
    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt-get update
    sudo apt-get install g++-4.9
```

##### **Docker**

Alternatively, a Docker image containing all the project dependencies can be used.

First install [Docker Toolbox for Windows](https://docs.docker.com/toolbox/toolbox_install_windows/) (Windows 10 Home) or [Docker Desktop on Windows](https://docs.docker.com/docker-for-windows/install/) (Windows 10 Pro, Enterprise, and Education).

Next, launch the Docker Quickstart Terminal. The default Linux virtual environment should load up. You can test that Docker is setup correctly by running `docker version` and `docker ps`.

You can enter a Docker image that has all the project dependencies by running:

`docker run -it -p 4567:4567 -v 'pwd':/work udacity/controls_kit:latest`

Once inside Docker you can clone over the GitHub project repositories and run the project from there.

##### **Port forwarding is required when running code on VM and simulator on host**

For security reasons, the VM does not automatically open port forwarding, so you need to manually [enable port 4567](https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/). This is needed for the C++ program to successfully connect to the host simulator.

**Port Forwarding Instructions**

1. First open up Oracle VM VirtualBox
2. Click on the default session and select settings.
3. Click on Network, and then Advanced.
4. Click on Port Forwarding
5. Click on the green plus, adds new port forwarding rule.
6. Add a rule that assigns `4567` as both the host port and guest Port

### EKF Installation

Once the install for uWebSocketIO is complete, the main program can be built and run by doing the following from the project top directory.

```
1. mkdir build
2. cd build
3. sudo cmake ..
4. make
5. ./ExtendedKF
```

Launch the simulator selecting the `EKF` project and press `Start`. If you see this message, it is working: `Listening to port 4567 Connected!!!`

---

## uWebSockeIO Communication

Here is the main protocol that main.cpp uses for uWebSocketIO in communicating with the simulator.

**INPUT**: values provided by the simulator to the c++ program

["sensor_measurement"] => the measurement that the simulator observed (either lidar or radar)

**OUTPUT**: values provided by the c++ program to the simulator

["estimate_x"] <= kalman filter estimated position x

["estimate_y"] <= kalman filter estimated position y

["rmse_x"]

["rmse_y"]

["rmse_vx"]

["rmse_vy"]


text:
---
title: Inline Filtered Items Display
page_title: Inline Filtered Items Display
description: Check our "Inline Filtered Items Display" documentation article for RadAutoCompleteBox for UWP control.
slug: autocompletebox-inline-filtered-items
tags: inline,filtered,items,display
published: True
position: 7
---

# Inline Filtered Items Display

In some scenarios, you might need to show the filtered items from RadAutoCompleteBox inline in the page content instead of displaying them in the default drop-down visualization. To support this, RadAutoCompleteBox exposes the FilteredItems property that can be bound to a separate list control anywhere on the page.

## Using the FilteredItems Property

The FilteredItems property returns the filtered items that are available based on the current user input. You can use this property as a data source for any list control to display filtered items in it. If you also wish to prevent the suggestions drop-down from being displayed, you can use the DropDownPlacement property and set it to None.

The following XAML code snippet demonstrates a simple scenario where the suggestions provided by RadAutoCompleteBox are displayed in a ListBox placed below the RadAutoCompleteBox on the page:

	<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
	    <Grid.RowDefinitions>
	        <RowDefinition Height="Auto"/>
	        <RowDefinition/>
		</Grid.RowDefinitions>

		<telerikInput:RadAutoCompleteBox x:Name="radAutoCompleteBox" DropDownPlacement="None" Width="200" VerticalAlignment="Top" />
		<ListBox ItemsSource="{Binding ElementName=radAutoCompleteBox, Path=FilteredItems}" Grid.Row="1" VerticalAlignment="Top" Width="400">
			<ListBox.ItemTemplate>
				<DataTemplate>
					<TextBlock Text="{Binding}"/>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
	</Grid>

Here is the expected state of the FilteredItems property:

* If the textbox part of the control is empty, the FilteredItems property will contain all available items that are bound to the control instance.
* If the textbox part of the control is non-empty, and has partial text match (based on the current filtering rules), the FilteredItems property will contain the subset of all items bound to the control instance that match the current text input.
* If the textbox part of the control is non-empty, and has no text match (based on the current filtering rules), the FilteredItems property will contain an empty collection of items.

# See Also

 * [Drop-down Behavior]({%slug autocompletebox-dropdown-customization%})

repository: telerik/uwp-docs

repo_name: telerik/uwp-docs


text:
# breastfeeding-app-polymer
Breastfeeding App: Polymer edition

## TODO

[] Test components
[] Store data better
[] Option to bottlefeed
[] Edit data for previous session
[] Preferences (e.g., default to a side)
[] Track diaper changes
[] Track weight
[] Data visualisations
[] Notes (e.g., to link cause/correlation with change in data)

repository: notaurologist/breastfeeding-app-polymer

repo_name: notaurologist/breastfeeding-app-polymer