text:
---
layout: default
---

# 1996-12-12 - Re: Check out today's Salon

## Header Data

From: Jeremiah A Blatz<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: cf7160c16194248f7290c96b370f311ec08ccc1a3b496343cf73e013b01c6b0f

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-12-12 02:44:10 UTC

Raw Date: Wed, 11 Dec 1996 18:44:10 -0800 (PST)

## Raw message

```
{% raw  %}From: Jeremiah A Blatz<EMAIL_ADDRESS>Date: Wed, 11 Dec 1996 18:44:10 -0800 (PST)
To<EMAIL_ADDRESS>Subject: Re: Check out today's Salon
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

A less obnoxious URL is
<http://www.salon1999.com/news/news2961210.html>

"standing on top of the world/ never knew how you never could/ never knew
 why you never could live/ innocent life that everyone did" -Wormhole

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQB1AwUBMq9wsckz/YzIV3P5AQHuRAMAihwGvjP5j2vX7eno1osh2w6W5ECeEQJD
ETyWYFwjopvgz5bMTMaQ8DOBSxhiWT0YZNr3jZX8Gj7uZMG1lY6ucW6bquExlYzc
O2IPmrBS+mbTrulGIh59ih5keT0ihlHb
=9IET
-----END PGP SIGNATURE-----

{% endraw %}
```

## Thread

+ Return to [December 1996](/archive/1996/12)

+ Return to "[Jeremiah A Blatz <jer+@andrew.cmu.edu>](/authors/jeremiah_a_blatz_jer_at_andrew_cmu_edu_)"
+ Return to "[Martin Minow <minow@apple.com>](/authors/martin_minow_minow_at_apple_com_)"

+ 1996-12-11 (Wed, 11 Dec 1996 11:55:13 -0800 (PST)) - [Check out today's Salon](/archive/1996/12/80248d52e25b69b5bf633d92c35ba6b6c414de680032fc8017157ee496abe03d) - _Martin Minow<EMAIL_ADDRESS>  + 1996-12-12 (Wed, 11 Dec 1996 18:44:10 -0800 (PST)) - Re: Check out today's Salon - _Jeremiah A Blatz<EMAIL_ADDRESS>


text:
---
id: 1111
title: Would you like to live a recluse life?
date: 2012-07-04T23:32:02+00:00
author: kushalashok
layout: post
guid: http://kushalashok.wordpress.com/?p=1111
permalink: /2012/07/04/would-you-like-to-live-a-recluse-life/
geo_latitude:
  - "30.359057"
geo_longitude:
  - "76.449078"
geo_accuracy:
  - "812"
geo_address:
  - punjabi university, patiala, punjab, india
geo_public:
  - "1"
reddit:
  - 'a:2:{s:5:"count";i:0;s:4:"time";i:1365614822;}'
twitter_cards_summary_img_size:
  - 'a:7:{i:0;i:320;i:1;i:457;i:2;i:2;i:3;s:24:"width="320" height="457"";s:4:"bits";i:8;s:8:"channels";i:3;s:4:"mime";s:10:"image/jpeg";}'
categories:
  - K-Diaries
  - 'Korean Movies & Dramas'
  - Movie Reviews
---
[](http://getglue.com/movies/castaway_on_moon/lee_heyjun)

Just watched another Korean movie called “Castaway on the moon”. A very insightful movie indeed.

We often come across incidents when people lock themselves in a room and cut off from the society. What leads us to think like that? Even animals like birds like to stay in a group, then how can a human being want to be alone? After all, man is called a social animal.

I started by looking into my own thought process. Of course I don’t like being alone but there are times when I just need my space. I tried thinking about the reasons and I couldn’t come up with one that is justifiable. Maybe the mind gets so confiscated that it starts asking for a vacation. But our mind never stops working, so even when we are trying to sleep or just doing nothing, we are thinking about one thing or the other. Which makes me wonder, can we really give our mind a rest by meditation? I have tried meditating, but I could never reach the state when my mind stops questioning. No matter how hard I try to keep my eyes closed and relax, it doesn’t work that way for me.

Coming back to the recluse thing, many of us are already moving towards this lifestyle without even knowing it. It’s natural for us to stay busy with our work and ignore the society. This habit of ignoring then becomes a way of living. For instance, we may stop greeting people, first due to lack of time and later because we just don’t find it comfortable. We get so busy making friends on social networks that we forget how to make new friends in real life. We are so scared of getting duped that we can’t risk to pass a smile to a stranger. This is why I have created a poll:

  Take Our Poll

**If the answer to any of these questions is yes, then probably you like a recluse life.

**

But one is not born thinking like that. It is what the society makes of us and what we make of the society. People may accept us or cast away, we may adjust with them or just run away. Just something we need to figure out.****

You can watch the movie with english subtitles here:

**Part 1:**

**Part 2:**

license: MIT

repository: speedoholic/blog

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: speedoholic/blog


text:
This directory gives the configuration for the Karma test runner.
Karma runs the Jasmine tests defined in the privly-applications
module on browsers you have defined locally or on Sauce labs.

## Setup ##

Prerequisites:
You need to have [node](http://nodejs.org/) installed.

Once you have node installed, you should install the Karma
command line interface from the directory where this README
is located:

> npm install -g karma-cli && npm install

This will install the necessary node modules to the current
directory.

### Selecting Which Tests to Run ###

The Karma configuration has a default test set, but it is
possible to add your own tests by defining a CSV of test
files as an environment variable. For example, if you want to
test a file in the Fu application named bar.js, you would
type this before running your tests:

> export FILES_TO_TEST="Fu/js/bar.js,Fu/test/bar.js"

This will tell the Karma config to load the bar.js file
into the testing iframe and then run the tests defined
by the bar.js testing script.

## Running ##

In each browser Karma creates
a set of iframes that run your tests in parallel.

There are two ways to run your tests. If you run the tests locally,
your local browsers will be opened. This allows you
to edit your local source files, which will be run against their
tests every time the file is saved.

### Running Locally ###

To run karma locally you should add anything you want to test
as an environmental variable (see above) then issue the command
found below from this directory.

> karma start

Firefox should open and run your tests every time you save them.
If you want different browsers to run, you can specify them in CSVs:

> karma start --browsers Firefox,Chrome,Safari

### Running on Sauce Labs ###

[SauceLabs](https://saucelabs.com/) is a browser virtualization service that
allows for simultaneous tests across a variety of platforms and browsers.
When tests run on Sauce they are usually run from the TravisCI server, but
you can also hook your local dev environment into SauceLabs by
first associating your machine with Sauce Labs (see below), then
issuing:

Firefox should open and run your tests every time you save them.
If you want different browsers to run, you can specify them in CSVs:

> karma start karma.conf-ci.js --sauce-browsers=Firefox,Chrome,Safari

For more details on how this was setup, see [SauceLab's tutorial](https://docs.saucelabs.com/tutorials/js-unit-testing/). There is different
syntax for selecting browsers because the default syntax breaks the ability to
run tests on SauceLabs.

If you want your tests to run on the Continuous Integration server, you should
appropriately edit the run_each.sh file to include your test set.

### Running All the Tests ###

This directory contains the script `run_each.sh` that will run all the test sets it defines.
You can tell run_each to open a particular set of browsers by exporting an environment variable first:

> export BROWSERS_TO_TEST=Firefox,Chrome,Safari
> ./run_each.sh [karma config file]

The Karma config variable defaults to running karma.conf.js which runs the tests locally.

# Writing Your Own Unit Tests

Privly has several test types serving different purposes. This directory
is aimed at unit testing, which means you should strive to
isolate individual functions and test their functionality and
assumptions.

Other test types include:

* Integration tests: makes sure Privly
injects properly
* Content server tests: makes sure the content server functions properly
* Application tests: makes sure the whole applications are functioning properly

For more information, you can read about the complete overview of
[Privly testing](https://github.com/privly/privly-organization/wiki/Testing).

## Hello World ##

Assuming you have gotten Karma running as directed earlier in this README,
you can now write your first test. Open the test file for the shared script
that handles grabbing parameters from the URL, `shared/test/parameters.js`,
and start Karma with:

> karma start

If you get a message about tests passing and failing you are ready to
add your first test.

Edit the parameters test file you opened earlier. First add the following
inside the `describe` block.

    it("Doesn't fail", function() {
      expect(true).toBe(true);
    });

Then save the file. Now you should see the tests re-run, with one more passing test.
If that worked, you should try to purposefully make a test fail.

Try adding:

    it("Fails", function() {
      expect(true).toBe(false);
    });

If that worked, it is time to learn the Jasmine syntax these tests are written in.

## Jasmine Crash Course ##

You should read through the [Jasmine docs](http://jasmine.github.io/2.0/introduction.html) to learn how to write Jasmine tests. It is a quick read and it will be *very* useful for writing good tests.

## Headless Browsers and Fixtures ##

Generally Jasmine assumes you are running the tests inside a Headless browser (Scripts without HTML), which means you cannot assume your Javascript will run in the context of
its HTML. Good tests will write "fixtures" so they don't have to run in the context of
HTML, but the legacy of Privly tests currently assumes the presence of the DOM.
This is why most of the current tests load their applications using the HTML2JS
plugin for Karma. New tests should not use the HTML2JS module to create fixtures,
but you should instead write your code so it either doesn't require page DOM or
the tests create the minimal DOM they require before testing their scripts.


text:
# AI-projects

Collection of ML/Deep Learning projects that I created during my studies of deep learning.

## Contents

### Boston housing prices

Regression of boston housing prices using neural network, linear regression and SVM.

https://github.com/Bill2462/AI-projects/blob/master/boston_housing_prices/boston-housing-prices.ipynb

### Character RNN

Predicting next character in a text using vanilla Recursive Neural Network.

https://github.com/Bill2462/AI-projects/blob/master/character_rnn/character_rnn.ipynb

### Flower classifier

Classification of flowers using densenet. Transfer learning and fine tuning are applied to achive 92% accuracy on test set.

https://github.com/Bill2462/AI-projects/blob/master/flower_classifier/classification-using-densenet-92-acc.ipynb

### Fashion mnist and LeNet

Classification of clothes from MNIST - fashion dataset using different versions of LeNet.

https://github.com/Bill2462/AI-projects/blob/master/lenet_fashion_mnist/lenet_fashion_mnist.ipynb

Enjoy!


text:
dropbox-offline
===============

A Chrome extension to make Dropbox files available offline using modern web technologies.
This will likely be built upon the new HTML5 Filesystem APIs to provide a subset of the user's files available offline.
This is particularly useful on devices such as Chromebooks and mobile devices which do not have a dedicated offline Dropbox client.

repository: adelq/dropbox-offline

gha_language: JavaScript

repo_name: adelq/dropbox-offline


text:
# CS 216 Project 3

This is a small school project to show how to use classes in C++

## Installation

Clone the repo and run

```bash
make
```

## Running

```bash
./a.out
```

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


text:
# Cinder
Interpreted or Compiled, stack-based, RPN programming language/instruction set.

## Defining Features:
  * Interpreted or Compiled (to a script, not assembly)
  * Stack Based
  * Uses Reverse Polish Notation
  * Optimized for job security- very difficult to read.
  * Has verbose debugging
  * Sort of sandboxed. Sandboxed inside of the interpreter, but not memory-safe.

## Project Goals:
  * Create a VM implemented in Javascript that has its own bytecode.
  * Create a compiler capable of translating Javascript to Cinder bytecode.

Thus I will have a Javascript interpreter written in Javascript.

branch_name: refs/heads/main


text:
# Serialization in Glow

Glow supports multiple pathways for both exporting and loading a serialized model.

## Loading

Glow can load Caffe2 and ONNX protobufs, as well as TorchScript exported from a
PyTorch model. For ONNX protobufs, Glow supports loading ops specified by the
[ONNX spec](https://github.com/onnx/onnx/blob/master/docs/Operators.md), as well
as custom ops that are only used by Glow (see below).

## Exporting

Glow supports exporting ONNX protobufs. One way this is done is by trying to
abide by the ONNX spec for ops which can be represented in ONNX. However this
can be problematic as not all ops may fit into ONNX. Additionally, if the
intention is to later on reload this serialized model into Glow, then there is
downside in moving to ONNX and back, as some information may be lost in the
conversion from Glow -> ONNX -> Glow.

As an alternative, Glow also supports exporting to custom ONNX ops, which are
annotated with attributes to ensure that the Glow graph that is exported is the
exact same as the one that is reloaded. See the `useGlowCustomOps_` flag in the
`ONNXModelWriter`.

### Format of custom Glow ops in ONNX

Glow has unique names used for all `Nodes` in a Function, and can specify unique
names for each `NodeValue` based on its result number. Therefore it's natural to
use these to specify input and output names in protobuf form. This is done via
calls to `NodeValue::generateNodeOutputName()`.

Additionally, it's desirable for an exported and reimported graph to retain the
same names for all `Nodes` and `Storage` (`Placeholders` and
`Constants`). Keeping the same name for inputs, nodes, and initializers in ONNX
is easily done by setting the name of the corresponding proto object. However
for outputs, we need to retain both the name of the `SaveNode` as well as the
name of the `Placeholder`. We use the `doc_string` of the output to retain the
name of the `Placeholder`, and use the name of the output itself to retain the
name of the `SaveNode`.

Another note is that we use ONNX `Identity` ops to connect an output name of a
`Node` to a `SaveNode` if it is indeed used by a `SaveNode`. This allows us to
simplify the export process, i.e. we do not need to check the users of a `Node`
and decide whether to overwrite its name to match the `SaveNode` name.

In order to retain properties of `Storage`, the `doc_string` of inputs and
outputs is used to save these properties. This currently includes:

* `offline`: Used for static Placeholders
* `layout`: Used for the layout of Storage
* `trainable`: Used for the trainable property of Placeholders
* `ElemKind`: Save the ElemKind of Storage
* `qScale`: Scale of quantized ElemKinds
* `qOffset`: Offset of quantized ElemKinds
* `saveName`: Used for retaining the name of SaveNodes used by output Placeholders

You can find a couple examples of some tests that were exported with the
`useGlowCustomOps` flag mentioned above here:
[Quantized TopK](https://github.com/pytorch/glow/tree/master/tests/models/onnxModels/glow_custom_op_topk_quantized.onnxtxt)
and
[ChannelwiseQuantizedConvolution](https://github.com/pytorch/glow/tree/master/tests/models/onnxModels/glow_custom_op_channelwise_quantized_group_conv.onnxtxt).

repository: pytorch/glow

repo_name: pytorch/glow


text:
# Define the state data structure

The first thing you need to do is to define a structure to store your app’s state.
To do that, we must determine what’s considered to be the app’s state.

We know there are at least two components that require state: the product list and the cart icon.

In the source code, the product list corresponds to the `ProductListWidget`,
and the cart icon corresponds to the `ShoppingCartIcon`.

Let's look at the `ProductListWidget` widget first. This widget builds the
scrollable body and displays Google products.  Because the widget needs to know which products to display and which products are already in the cart, the
`ProductListState` stores the `productList` and the `itemsInCart`.

```dart
class ProductListWidgetState extends State<ProductListWidget> {
  List<String> get productList => _productList;
  List<String> _productList = Server.getProductList();
  set productList (List<String> value) {
    setState(() {
      _productList = value;
    });
  }

  Set<String> get itemsInCart => _itemsInCart;
  Set<String> _itemsInCart = <String>{};
  set itemsInCart(Set<String> value) {
    setState(() {
      _itemsInCart = value;
    });
  }

  // ...
}
```

On the other hand, the `ShoppingCartIcon` also stores `itemsInCart` because
it needs to know number of products that are in the cart.

```dart
class ShoppingCartIconState extends State<ShoppingCartIcon> {
  Set<String> get itemsInCart => _itemsInCart;
  Set<String> _itemsInCart = <String>{};
  set itemsInCart(Set<String> value) {
    setState(() {
      _itemsInCart = value;
    });
  }

  //...
}
```

This is where things get interesting. Both `ShoppingCartIcon` and `ProductListWidget` store their own
versions of `itemsInCart`, and the `itemsInCart` must be kept in sync. When the `itemsInCart` is updated
in the `ProductListWidget`, the `ProductListWidget` also needs to update the `itemsInCart` in the `ShoppingCartIcon`. Things can
can get out of hand very quickly if we added more widgets that depends on the `itemsInCart`.

Now, let's pull these states out of the widgets.

You can find the class by searching for `TODO` in the IDE

```dart
class AppState {
  // TODO: fill in this data structure.

  AppState copyWith({
    //..
  }) {
    // TODO: implement copy method.
  }
}
```

repository: flutter/codelabs

gha_language: C

repo_name: flutter/codelabs


text:
# balena-osquery
Experiment on running osquery as a container in a balenaCloud device

## Getting started
1. Clone the repo.
1. Push it to a aarch64 balenaCloud app (eg Raspberry Pi 3 64bit or Raspberry Pi 4).
1. Wait for your device to download the release.
1. SSH to the `osquery` service.
1. Run `osqueryi` to start the osquery shell.
1. Start running your osquery commands.

For example running `SELECT name, path, pid FROM processes` should print something like:
```
+----------+-------------------+-----+
| name     | path              | pid |
+----------+-------------------+-----+
| osqueryd | /usr/bin/osqueryd | 1   |
| osqueryd | /usr/bin/osqueryd | 17  |
| bash     | /bin/bash         | 28  |
| osqueryi | /usr/bin/osqueryd | 37  |
+----------+-------------------+-----+
```

Note: the data returned by osquery is related to the container, if you want to query
information about the host, you should make sure to enable the correct feature by using
the appropriate [Balena label](https://www.balena.io/docs/reference/supervisor/docker-compose/#labels),
e.g. `io.balena.features.procfs` to mount the proc subsystem.

## Querying docker status using osquery

1. In order to query docker status, the docker socket must be mounted in the container
by using the `io.balena.features.balena-socket` label.
2. Run the osquery shell by passing the location of the socket as stated by
the [osquery documentation](https://osquery.readthedocs.io/en/latest/installation/cli-flags/#docker-flags):
`osqueryi --docker_socket=/var/run/balena-engine.sock`
3. Query any of the docker tables in the [osquery schema](https://osquery.io/schema/4.5.1/#docker_containers), for example:
```
osquery> select name, status from docker_containers;
+-------------------+----------------------+
| name              | status               |
+-------------------+----------------------+
| /osquery_1_1      | Up 24 minutes        |
| /resin_supervisor | Up 2 hours (healthy) |
+-------------------+----------------------+
```

repository: balena-io-experimental/balena-osquery

repo_name: balena-io-experimental/balena-osquery


text:
### [CVE-2021-41219](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41219)
![](https://img.shields.io/static/v1?label=Product&message=tensorflow&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-824%3A%20Access%20of%20Uninitialized%20Pointer&color=brighgreen)

### Description

TensorFlow is an open source platform for machine learning. In affected versions the code for sparse matrix multiplication is vulnerable to undefined behavior via binding a reference to `nullptr`. This occurs whenever the dimensions of `a` or `b` are 0 or less. In the case on one of these is 0, an empty output tensor should be allocated (to conserve the invariant that output tensors are always allocated when the operation is successful) but nothing should be written to it (that is, we should return early from the kernel implementation). Otherwise, attempts to write to this empty tensor would result in heap OOB access. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.

### POC

#### Reference
No PoCs from references.

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

repository: trickest/cve

gha_language: HTML

gha_license_id: MIT

repo_name: trickest/cve


text:
## Summary ##
Client code examples demonstrating usage of aws-mock with AWS-SDK in JavaScript.

## Installation ##
1. Install dependencies including aws-sdk by running `npm install`.
2. Add a reverse proxy route for actual backend endpoint url `http://localhost:8000/aws-mock/ec2-endpoint/` to a root directory `http://localhost:9090/`. You can have that done by running `node LocalProxy.js`, or alternatively, add such a proxy route to your favourate web server such as Apache or Nginx.
3. Run the tests with `node RunExamples.js <options>`.

## Why endpoint on "/" ? ##
Endpoint for mock ec2 should be running on "/" (root context) as Amazon's node.js aws-sdk doesn't support endpoint in a directory (while java version of aws-sdk does).
And of course, that lack of support is because aws-sdk is designed for accessing their own endpoints on root context (https://*.amazonaws.com/) only.
As in the node.js examples here we use the endpoint at http://localhost:9090/ for calling interfaces on aws-mock.

repository: treelogic-swe/aws-mock

gha_language: Java

repo_name: treelogic-swe/aws-mock


text:
---
id: "12"
title: "Attack/Defense CTF"
shortdesc: "Participated in Attack and Defense CTF organized by Prof. Adam Doupe at ASU."
path: "/projects/pctf"
date: 2018-05-22 07:00:00
tags: "hackathon"
type: "other"
includeOnPortfolio: false
thumbnail: ./pctf-cover.png
language: "python"
---

## Attack/Defense CTFs

A key part of studying security is putting our skills to the test in practice. Hacking challenges known as Capture The Flag (CTF) competitions are a great way to do this. CTF is a special kind of information security competition or training. There are two main types of Capture the Flag events:

- Jeopardy
- Attack/Defense.

A Jeopardy-style CTF is providing several tasks or so-called “challenges” in a wide range of computer and network security categories, including Web, Forensic, Crypto, Binary, Reverse Engineering, Mobile Security, IoT, Secure Programming. Teams are not playing against each others. The more challenges they solve, the more difficult tasks they do, the better they score in the jeopardy CTF scoreboard.

An Attack/Defense CTF is really spicing up the jeopardy style CTF. Every team has its own “vulnerable” servers and services. Teams must attack other teams application while protecting the own from being hacked. Teams must keep their services up and running and must solve additional tasks and achievements in parallel.

## PCTF

[link to repository](https://github.com/AchyuthaBharadwaj/PCTF)

There were over 20 teams participating in this PCTF. Each team was given a Virtual Machine hosted on the same central server. The IP addresses of these team VMs were known to everyone beforehand. The goal was to analyze each service, find the vulnerability, create an exploit, launch the exploit at all the other teams, and patch our service.

The scoring system was setup in such a way that it would periodically try to attack other teams VM with our exploit script and for each successful exploit we would be awarded points and at the same time it would deduct points if our VM was exploited by some other team.

![](./pctf-board.jpg)

The first thing we did was add loggers to our services which would log each incoming request before processing it. So that even if our system was exploited, we can find out which kind of exploit was used and probably fix it. We can also use this as exploit against other teams as well. Next we split our team into two parts, the first would find the vulnerabilities in our system and create exploits for it to use against other teams. The other was responsible for patching these vulnerabilities in our system.

Although we did not win the contest, we had a great time and really enjoyed the CTF. It was both, fun and educational . Awesome.

repository: AchyuthaBharadwaj/portfolio-ab

repo_name: AchyuthaBharadwaj/portfolio-ab


text:
---
layout: post
title:  "Build an online store without dealing with WordPress unreliability"
excerpt: "The couple WordPress and WooCommerce have been for too long the favorite solution to deploy quickly an online shop and start making revenue. Now every developer who encountered WordPress knows its many drawbacks. In this article, we will explain how we overcame WordPress's unreliability by turning it basically into a backend service. "
categories: Articles
author: Lawrence Zhao, Sonny Alves Dias
tags: [ articles, wordpress, woocommerce, devops, web ]
---

The couple WordPress and WooCommerce have been for too long the favorite solution to deploy quickly an online shop and start making revenue. Now every developer who encountered WordPress knows its many drawbacks. In this article, we will explain how we overcame WordPress's unreliability by turning it basically into a backend service.

## First of all why WordPress is so popular?

* WordPress is **easy to deploy**, there are plenty of hosting solution that offers WordPress directly but also PHP hosting are still very commonly available, i.e. [wordpress.com](wordpress.com){:target="_blank"}, [DreamHost](https://www.dreamhost.com/wordpress/){:target="_blank"}, [BlueHost](https://www.bluehost.com/wordpress/wordpress-hosting){:target="_blank"}, etc.
* There are **a lot of plugins available**, and you can develop your plugin as well.
* There are **many pretty good looking themes**.
* It is **user-friendly**, especially to non-technical people.
* It has a **huge community** and numerous learning resources online.

## Then what's the problem with WordPress?

His popularity also brought weaknesses:

- His huge community, mostly composed of non-technical users, generated a **huge amount** of non-official learning **resources** that are either **outdated or of poor quality**.

 [//]: <> (a lot of security holes because these users may not apply security patches to their WordPress regularly)

 - It also attracted **a lot of malicious and scammy developers** to make their own plugins polluting the plugins market.

On a technical side:

- WordPress is **too flexible** in the sense that to implement something it can be done on different layers: in the PHP source code, in the WordPress page/post editor, or in the theme configuration. It leads non-technical users to not adopt clear conventions and let them try out different tricks here and there resulting in a very hacky usage of the CMS.

- WordPress is also **unreliable** because of how updates are conducted, plugins and themes are simply overwritten thus losing any local changes (generally tailored-changes made to customize plugins and themes).
To be precise, WordPress has a child theme system that allows defining changes that will be applied on top of a parent that helps to prevent some of the local changes to be overwritten. But it is not well integrated or either user-friendly.
For webmasters, especially amateur ones, it is too risky to update plugins, themes, and WordPress itself because they are afraid of losing their changes and/or even break their entire website. Hence WordPress websites are de facto never updated.

## How to overcome the unreliability of WordPress?

Let's imagine we could use WordPress and WooCommerce for what they worth only which are a blog system and an online store system.
The first thing we probably want to do is to remove the risks that are the plugins, and only install the minimum, WooCommerce.
The second thing we want to do is to get rid of the themes too. To do that we started to look at Headless WordPress and found out about the WordPress API and the WooCommerce API.

### WordPress API

WordPress, since its version `4.7.0` (released in December 2016), offers a RESTful API  that is to say 13 years after its first release in 2003 and only 3 years ago from the time of the writing of this article.

The API allows interactions with WordPress using JSON (JavaScript Object Notation) format only. While for requesting data from it, it does not require authentication if you wish to edit, create, or delete information you will need to authenticate. It is worth noting that WordPress only supports Cookie Authentication natively, but some plugins allow for more types.

The  consumption of the API is pretty straight-forward and allows you to retrieve any data pretty easily. The root endpoint is mounted on `/wp-json/`. From there you will be able to see all the available sub-endpoints.
But let's dig into some examples:

- To retrieve the list of posts (articles) on your blog you can run a GET request at the endpoint `/wp-json/wp/v2/posts/` you will then receive the first page of the posts in JSON format. Complete example details are available here: [https://developer.wordpress.org/rest-api/reference/posts/#list-posts](https://developer.wordpress.org/rest-api/reference/posts/#list-posts){:target="_blank"}
- To retrieve a media that was used in a post you can run a GET request against the endpoint `/wp-json/wp/v2/media/<id>`, replace `<id>` by the actual id of the media. Complete example details are available here: [https://developer.wordpress.org/rest-api/reference/media/#retrieve-a-media-item](https://developer.wordpress.org/rest-api/reference/media/#retrieve-a-media-item){:target="_blank"}
- For more examples and details, the official documentation for the WordPress REST API is available at that address: [https://developer.wordpress.org/rest-api/](https://developer.wordpress.org/rest-api/){:target="_blank"}

### WooCommerce API

WooCoomerce has been offering a RESTful API to its users for a longer time than WordPress. The first WooCommerce API was released with WooCommerce `2.1.0` in February 2014 which is almost three years before WordPress' REST API.

It is more commonly used. For example, when you set up your logistics with ShipBob they will use the API to retrieve your shop orders automatically.

It is important to note that the original WooCommerce API after several updates has been deprecated and relabeled Legacy API. WooCommerce decided to fully rework their API to extend the WordPress API directly after the release of the latter.

We recommend to use the latest version which is at the time of this article is the WooCommerce API v3 (not the Legacy one but the current one).

When using the API whether the Legacy or the current one, you need to create first an API token in the settings of WooCommerce steps to follow are described here: [https://docs.woocommerce.com/document/woocommerce-rest-api/](https://docs.woocommerce.com/document/woocommerce-rest-api/){:target="_blank"}

Then to find out how to use the tokens to authenticate please go here: [https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication](https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication){:target="_blank"}

Finally here are some examples:
- To create an order, you can run a POST request against that endpoint `/wp-json/wc/v3/orders` with a JSON object describing your order. Complete example details are available here: [https://woocommerce.github.io/woocommerce-rest-api-docs/#create-an-order](https://woocommerce.github.io/woocommerce-rest-api-docs/#create-an-order){:target="_blank"}
- To retrieve the list of products, you can run a GET request against that endpoint `/wp-json/wc/v3/products`. Complete example details are available here: [https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products](https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products){:target="_blank"}
- For more examples and details, the official documentation for the WooCommerce REST API is available at that address: [https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction](https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction){:target="_blank"}

### The next step

Now that we know how to use WordPress API and WooCommerce API, there are two things we need to consider:

* WooCommerce API needs authentication, so how are we going to keep our API tokens secret?
* And by using only the API, we are cutting ourselves from the payment process of WooCommerce. It means we will have to process payments ourselves outside of WordPress/WooCommerce.

This is why we went with the architecture below:

![Muted Wordpress](/assets/posts/muted-wordpress/architecture_wordpress_muted.svg)

- The front-end is running an Angular app written in Typescript.
- The middleware is a Node.js app written in Typescript, it holds the API tokens and implements the necessary things for processing payments too, for example, we usually implement [Stripe](https://stripe.com/docs/payments/accept-a-payment){:target="_blank"} and [GloBee](https://globee.com/docs/payment-api/v1){:target="_blank"}.
- The back-end and back-office is our WordPress.
- The CDN and storage are respectively running on AWS CloudFront and AWS S3.

It means that with that architecture when we want:

- To post an article, we add a post in WordPress, and we retrieve it through the WordPress API via our middleware,
- To host a picture, we simply upload it into WordPress media, and retrieve it with the CDN link,
- To do some changes in some parts of our website, we edit a WordPress page and retrieve the content of the page dynamically through the WordPress API via our middleware,
- To add a product, we simply add it into WooCommerce,
- ...

Note To automate the upload of the media to S3 in WordPress we installed the plugin [WP Offload Media Lite](https://wordpress.org/plugins/amazon-s3-and-cloudfront/){:target="_blank"}. Making the total count of our plugins installed into WordPress to only two: _WooCommerce_ and _WP Offload Media Lite_.

## Difficulties Encountered

- The WordPress API is slow:
[https://stackoverflow.com/questions/45421976/wordpress-rest-api-slow-response-time/45425091#45425091](https://stackoverflow.com/questions/45421976/wordpress-rest-api-slow-response-time/45425091#45425091){:target="_blank"}
Though a plugin seems to help for that, by caching answers from the API:
[https://wordpress.org/plugins/wp-rest-cache/](https://wordpress.org/plugins/wp-rest-cache/){:target="_blank"} (We haven't tested it yet).

 [//]: <> (- Under special circumstances, you may want to register custom endpoint [https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/](https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/){:target="_blank"})

- To keep WordPress fully hidden behind our middleware (and avoid curious eyes), we had to filter all the links returned by WordPress to make sure they either use the CDN, use a vetted domain, or simply don't appear in the API calls answers. For that, the plugin _WP Offload Media Lite_ helps a lot because it updates every media link to use the CDN.

## Final Thoughts

For us at Pixelmatic, to be able to fully customize the front-end as we want, while also keeping our website more secure is a major win for us. Admittedly the infrastructure needs are bigger but the maintainability and stability in the long term are higher.


text:
# [Movie Quotes Trivia Game](http://alexa.amazon.com/#skills/amzn1.echo-sdk-ams.app.e51ccb8d-59bd-478f-a58a-4cfb511fb167)
![2 stars](../../images/ic_star_black_18dp_1x.png)![2 stars](../../images/ic_star_black_18dp_1x.png)![2 stars](../../images/ic_star_border_black_18dp_1x.png)![2 stars](../../images/ic_star_border_black_18dp_1x.png)![2 stars](../../images/ic_star_border_black_18dp_1x.png) 40

To use the Movie Quotes Trivia Game skill, try saying...

* *Alexa, start Movie Quotes*

* *give me a hint; repeat quote*

* *the answer is 'Gone With The Wind'*

Test your knowledge of Hollywood's great movies by matching five famous movies quotes with the movies they came from.

** Now with over 200 quotes, hints to help you answer questions, music and sound effects, and improved functionality! **

***

### Skill Details

* **Invocation Name:** movie quotes
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.e51ccb8d-59bd-478f-a58a-4cfb511fb167
* **ASIN:** B017OBWZU0
* **Author:** Michael E Strupp
* **Release Date:** November 25, 2015 @ 17:09:06
* **In-App Purchasing:** No


text:
---
id: 590
title: Negative binomial with continuous parameters in python
date: 2013-11-11T03:14:09+00:00
author: Tiago Ramalho
layout: post
guid: http://www.nehalemlabs.net/prototype/?p=590
permalink: /blog/2013/11/11/negative-binomial-with-continuous-parameters-in-python/
categories:
  - Development
  - Science
tags:
  - data analysis
  - python
---
So scipy doesn't support a [negative binomial](https://en.wikipedia.org/wiki/Negative_binomial_distribution) for a continuous r parameter.
The expression for its pdf is <span>$P(k)=\frac{\Gamma(k+r)}{k!\,\Gamma(r)} (1-p)^rp^k$</span>.
I coded a small class which computes the pdf and is also able to find MLE estimates for p and k given some data.
It relies on the [mpmath](https://github.com/fredrik-johansson/mpmath/) arbitrary precision library since the gamma function values can get quite large and overflow a double.
It might be useful to someone so here's the code below.

```python
import scipy.special as special
import scipy.optimize as optimize
import numpy as np
import mpmath

class negBin(object):
	def __init__(self, p = 0.1, r = 10):
		nbin_mpmath = lambda k, p, r: mpmath.gamma(k + r)/(mpmath.gamma(k+1)*mpmath.gamma(r))*np.power(1-p, r)*np.power(p, k)
		self.nbin = np.frompyfunc(nbin_mpmath, 3, 1)
		self.p = p
		self.r = r

	def mleFun(self, par, data, sm):
		'''
		Objective function for MLE estimate according to
		https://en.wikipedia.org/wiki/Negative_binomial_distribution#Maximum_likelihood_estimation

		Keywords:
		data -- the points to be fit
		sm -- \sum data / len(data)
		'''
		p = par[0]
		r = par[1]
		n = len(data)
		f0 = sm/(r+sm)-p
		f1 = np.sum(special.psi(data+r)) - n*special.psi(r) + n*np.log(r/(r+sm))
		return np.array([f0, f1])

	def fit(self, data, p = None, r = None):
		if p is None or r is None:
			av = np.average(data)
			va = np.var(data)
			r = (av*av)/(va-av)
			p = (va-av)/(va)
		sm = np.sum(data)/len(data)
		x = optimize.fsolve(self.mleFun, np.array([p, r]), args=(data, sm))
		self.p = x[0]
		self.r = x[1]

	def pdf(self, k):
		return self.nbin(k, self.p, self.r).astype('float64')
```


text:
# Contribution Guidelines

- Files must use only `<?php` tags.
- Class names must be declared in `StudlyCaps`.
- Method names must be declared in `camelCase`.
- Helper functions must be declared in `snake_case`.
- Indent with two spaces.
- A class' opening `{` must be on the same line as the class name.
- K&R style braces:
 - Functions have brackets on their own line.
 - Control structures have brackets on the same line.


text:
---
layout: page
title : About
permalink: /about/
---

A Little About Me

I am a junior at the University of North Carolina at Chapel Hill! I am pursuing a Computer Science B.A and a Cognitive Science minor.
My Myers-Briggs personality type is INFP. I often overthink things and get anxious about silly stuff. I am kind of shy at first but
I am an outspoken and loyal friend once I have become comfortable! I am an intersectional feminist and I am unafraid to tell you about it. I love food, art, and music and it shows in everything that I do. I'll get
into the details of what I like and dislike next!

Music I Like
>

I have a pretty eclectic taste in music. I listen to a lot of different styles and genres, anywhere from electronic-trap to jazz and symphonic.
I have been particularly interested in k-pop, as I recently learned more about the culture and language. Some artists that I quite like are Norah Jones,
Blackbear, BTS, Chance the Rapper, Kendrick Lamar, Nat King Cole, and Khalid.

Here are some links to soundcloud and spotify for the music I generally listen to:

 Blackbear

BTS

Kendrick

Chance

Norah Jones

Art that I Like

I have been interested in art my entire life. I was always in painting classes and drawing was my number one pastime.
Though I do still thoroughly enjoy it, as a college student I have less time to work on my own projects. So during the school year I peruse pinterest
for art that I find inspiring or I go to the Ackland Art Museum in my free time! But during the summer I work on projects for hours at a time and sometimes
I am commissioned to paint for other people!

Here are some links to art that I enjoy and my own website!

My Website

My Pinterest

The Ackland

The MoMA


text:
# ~~Best~~ Good Practices for Research Software Engineering

This is a repository for the examples to supplement the talk "Good Practices for Research Software Engineering"

It is a collaborative effort of the [Research Software Engineering (RSE) Group](https://researchcomputing.princeton.edu/software-engineering) at Princeton University.

## Contact
Ian A. Cosden

Princeton University

<EMAIL_ADDRESS>


text:
# Account Service

## Get Account

```http request
GET https://HOSTNAME/v1/account
```

** Get the currently logged in user. **

## Update Email

```http request
PATCH https://HOSTNAME/v1/account/email
```

** Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
 **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| email | string | User email. |  |
| password | string | User password. Must be at least 8 chars. |  |

## List Identities

```http request
GET https://HOSTNAME/v1/account/identities
```

** Get the list of identities for the currently logged in user. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | string | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry | [] |

## Delete Identity

```http request
DELETE https://HOSTNAME/v1/account/identities/{identityId}
```

** Delete an identity by its unique ID. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| identityId | string | **Required** Identity ID. |  |

## List Logs

```http request
GET https://HOSTNAME/v1/account/logs
```

** Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset | [] |

## Update Name

```http request
PATCH https://HOSTNAME/v1/account/name
```

** Update currently logged in user account name. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| name | string | User name. Max length: 128 chars. |  |

## Update Password

```http request
PATCH https://HOSTNAME/v1/account/password
```

** Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| password | string | New user password. Must be at least 8 chars. |  |
| oldPassword | string | Current user password. Must be at least 8 chars. |  |

## Update Phone

```http request
PATCH https://HOSTNAME/v1/account/phone
```

** Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](/docs/client/account#accountCreatePhoneVerification) endpoint to send a confirmation SMS. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| phone | string | Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. |  |
| password | string | User password. Must be at least 8 chars. |  |

## Get Account Preferences

```http request
GET https://HOSTNAME/v1/account/prefs
```

** Get the preferences as a key-value object for the currently logged in user. **

## Update Preferences

```http request
PATCH https://HOSTNAME/v1/account/prefs
```

** Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| prefs | object | Prefs key-value JSON object. | {} |

## Create Password Recovery

```http request
POST https://HOSTNAME/v1/account/recovery
```

** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| email | string | User email. |  |
| url | string | URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. |  |

## Create Password Recovery (confirmation)

```http request
PUT https://HOSTNAME/v1/account/recovery
```

** Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/docs/client/account#accountCreateRecovery) endpoint.

Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | User ID. |  |
| secret | string | Valid reset token. |  |
| password | string | New user password. Must be at least 8 chars. |  |
| passwordAgain | string | Repeat new user password. Must be at least 8 chars. |  |

## List Sessions

```http request
GET https://HOSTNAME/v1/account/sessions
```

** Get the list of active sessions across different devices for the currently logged in user. **

## Delete Sessions

```http request
DELETE https://HOSTNAME/v1/account/sessions
```

** Delete all sessions from the user account and remove any sessions cookies from the end client. **

## Get Session

```http request
GET https://HOSTNAME/v1/account/sessions/{sessionId}
```

** Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| sessionId | string | **Required** Session ID. Use the string 'current' to get the current device session. |  |

## Update OAuth Session (Refresh Tokens)

```http request
PATCH https://HOSTNAME/v1/account/sessions/{sessionId}
```

** Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to "refresh" the access token. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| sessionId | string | **Required** Session ID. Use the string 'current' to update the current device session. |  |

## Delete Session

```http request
DELETE https://HOSTNAME/v1/account/sessions/{sessionId}
```

** Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](/docs/client/account#accountDeleteSessions) instead. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| sessionId | string | **Required** Session ID. Use the string 'current' to delete the current device session. |  |

## Update Status

```http request
PATCH https://HOSTNAME/v1/account/status
```

** Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead. **

## Create Email Verification

```http request
POST https://HOSTNAME/v1/account/verification
```

** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#accountUpdateEmailVerification). The verification link sent to the user's email address is valid for 7 days.

Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
 **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| url | string | URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. |  |

## Create Email Verification (confirmation)

```http request
PUT https://HOSTNAME/v1/account/verification
```

** Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | User ID. |  |
| secret | string | Valid verification token. |  |

## Create Phone Verification

```http request
POST https://HOSTNAME/v1/account/verification/phone
```

** Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone) endpoint. Learn more about how to [complete the verification process](/docs/client/account#accountUpdatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. **

## Create Phone Verification (confirmation)

```http request
PUT https://HOSTNAME/v1/account/verification/phone
```

** Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| userId | string | User ID. |  |
| secret | string | Valid verification token. |  |

repository: appwrite/sdk-for-php

gha_language: PHP

repo_name: appwrite/sdk-for-php


text:
The Piecewise Geometric Model index (PGM-index) is a data structure that enables fast lookup, predecessor, range searches and updates in arrays of billions of items using orders of magnitude less space than traditional indexes while providing the same worst-case query time guarantees.

    Website
    | Documentation
    | Paper
    | Slides
    | Python wrapper
    | A³ Lab

## Quickstart

This is a header-only library. It does not need to be installed. Just clone the repo with

```bash
git clone https://github.com/gvinciguerra/PGM-index.git
cd PGM-index
```

and copy the `include/pgm` directory to your system's or project's include path.

The `examples/simple.cpp` file shows how to index and query a vector of random integers with the PGM-index:

```cpp
#include <vector>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include "pgm/pgm_index.hpp"

int main() {
    // Generate some random data
    std::vector<int> data(1000000);
    std::generate(data.begin(), data.end(), std::rand);
    data.push_back(42);
    std::sort(data.begin(), data.end());

    // Construct the PGM-index
    const int epsilon = 128; // space-time trade-off parameter
    pgm::PGMIndex<int, epsilon> index(data);

    // Query the PGM-index
    auto q = 42;
    auto range = index.search(q);
    auto lo = data.begin() + range.lo;
    auto hi = data.begin() + range.hi;
    std::cout << *std::lower_bound(lo, hi, q);

    return 0;
}
```

[Run and edit this and other examples on Repl.it](https://repl.it/github/gvinciguerra/PGM-index). Or run it locally via:

```bash
g++ examples/simple.cpp -std=c++17 -I./include -o simple
./simple
```

## Classes overview

Other than the `pgm::PGMIndex` class in the example above, this library provides the following classes:

- `pgm::DynamicPGMIndex` supports insertions and deletions.
- `pgm::MultidimensionalPGMIndex` stores points in k dimensions and supports orthogonal range queries.
- `pgm::MappedPGMIndex` stores data on disk and uses a PGMIndex for fast search operations.
- `pgm::CompressedPGMIndex` compresses the segments to reduce the space usage of the index.
- `pgm::OneLevelPGMIndex` uses a binary search on the segments rather than a recursive structure.
- `pgm::BucketingPGMIndex` uses a top-level lookup table to speed up the search on the segments.
- `pgm::EliasFanoPGMIndex` uses a top-level succinct structure to speed up the search on the segments.

The full documentation is available [here](https://pgm.di.unipi.it/docs/).

## Compile the tests and the tuner

After cloning the repository, build the project with

```bash
cmake . -DCMAKE_BUILD_TYPE=Release
make -j8
```

The test runner will be placed in `test/`. The [tuner](https://pgm.di.unipi.it/docs/tuner/) executable will be placed in `tuner/`. The [benchmark](https://pgm.di.unipi.it/docs/benchmark/) executable will be placed in `benchmark/`.

## License

This project is licensed under the terms of the Apache License 2.0.

If you use the library please put a link to the [website](https://pgm.di.unipi.it) and cite the following paper:

> Paolo Ferragina and Giorgio Vinciguerra. The PGM-index: a fully-dynamic compressed learned index with provable worst-case bounds. PVLDB, 13(8): 1162-1175, 2020.

```tex
@article{Ferragina:2020pgm,
  Author = {Paolo Ferragina and Giorgio Vinciguerra},
  Title = {The {PGM-index}: a fully-dynamic compressed learned index with provable worst-case bounds},
  Year = {2020},
  Volume = {13},
  Number = {8},
  Pages = {1162--1175},
  Doi = {10.14778/3389133.3389135},
  Url = {https://pgm.di.unipi.it},
  Issn = {2150-8097},
  Journal = {{PVLDB}}}
```

repository: gvinciguerra/PGM-index

repo_name: gvinciguerra/PGM-index


text:
---
layout: default
---

# 1995-01-21 - Re: Remailer In a Box available for beta testing

## Header Data

From<EMAIL_ADDRESS>(Samuel Kaplin)

To: sameer<EMAIL_ADDRESS>Message Hash: 8733dc64a9ddb21616b186a9acb32c722ec06706c7e39da58ec164db3c6f905a

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1995-01-21 08:36:26 UTC

Raw Date: Sat, 21 Jan 95 00:36:26 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Samuel Kaplin)
Date: Sat, 21 Jan 95 00:36:26 PST
To: sameer<EMAIL_ADDRESS>Subject: Re: Remailer In a Box available for beta testing
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

-----BEGIN PGP SIGNED MESSAGE-----

In article<EMAIL_ADDRESS>you wrote:
> (Sameer uses PGP)

> 3) If you wish, you can setup a .forward file to point to mailfilters
> or to another account.
>
> 4) Run the program /usr/local/lib/boxed-remailer/install_remail. The
> remailer will be installed, and non-remailed mail will be acted upon
> according to how the account was setup before you ran the program.
>
> 5) Answer the questions, they should be pretty simple.
>
> 	Once an account is created there is a one week free grace period.
> If you'd like to continue the account you can pay for it.
>
> 	If you have problems and suggestions, make sure you mail me, and
> I'll fix it. This is still in beta testing, so if you have problems I won't
> disable the account waiting for payment until the problems are fixed.
>

One minor question, is it possible to set it up so that it is not a final
hop remailer. In other words the remailer is set up to pass its mail on to
another remailer which is the final destination (preferably non-U.S.) If
so, I'm in. I've already got my account on c2 doing three things, what's
one more. If we could make this possible, it could really propagate
remailers as it removes some of the liability from those who can't afford
it.

I would love to run a final hop remailer, unfortunately financially I
barely have enough cash to keep on the net, let alone pay for a lawyer if
needed. Hopefully this is only temporary, (wifey finally found a job, now
it's catch-up time) but I'm unfortunately getting used to it.

Sam
- --
==============================================================================
<EMAIL_ADDRESS>                 | Finger<EMAIL_ADDRESS>for
                                       | a listing of crypto related files
PGP encrypted mail is accepted and     | available on my auto-responder.
preferred.                             | (Yes...the faqs are there!)
                                       |
E-mail<EMAIL_ADDRESS>for PGP Key or   | "...vidi vici veni" - Overheard
Finger<EMAIL_ADDRESS>   | outside a Roman brothel.
==============================================================================
     Any two philosophers can tell each other all they know in two hours.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQEVAwUBLyDF38lnXxBRSgfNAQG95gf9GHzDj4NYoMe+mwms8kbeVEpDIZo6gI2u
0CnmGQ6QgHPloUim53cHeJXO/wockD7ofRy/OiN0ohbCk51R7MJ2mpgC1VMZRy1h
PYz+HILjTxI4Ejkf7JFWiaDl9YBiXJojdkkyLvqHIGvz2v/jgY45zaR9jyhwDQYf
1qxZmzi9S2VvHa+e4KJ99tG/+4C/b92W5KtQPd3P/+N1dUHzWhiBkQTxi2Sbj/DW
GkS4O5qwGQS7FXIEN880HJzIExLTSg3UgbmkRPNo9yyETvco/XBYTpzTefVPNUC9
rCW/pgl8GpJtYIsXYn65j0p1xWUTjYvTpXFyXvXjBr1eFF/IVHJ4gQ==
=bV0h
-----END PGP SIGNATURE-----

{% endraw %}
```

## Thread

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

+ Return to "[sameer <sameer@c2.org>](/authors/sameer_sameer_at_c2_org_)"
+ Return to<EMAIL_ADDRESS>(Samuel Kaplin)](/authors/skaplin_at_mirage_skypoint_com_samuel_kaplin_)"

+ 1995-01-21 (Fri, 20 Jan 95 17:43:18 PST) - [Remailer In a Box available for beta testing](/archive/1995/01/0e7a1767841efe4348fbf317203ac06207cebe52f22107cfb1dfd0d8387bd9c3) - _sameer<EMAIL_ADDRESS>  + 1995-01-21 (Sat, 21 Jan 95 00:36:26 PST) - Re: Remailer In a Box available for beta testing -<EMAIL_ADDRESS>(Samuel Kaplin)_
    + 1995-01-21 (Sat, 21 Jan 95 15:38:22 PST) - [Re: Remailer In a Box available for beta testing](/archive/1995/01/cfa7d593e4e3faac75afa4774463950053f59a446b95c9156b41a3251c39aad7) - _sameer<EMAIL_ADDRESS>


text:
# Session 4 - Views

To wrap up the Award-Winning trilogy of abstraction layers, we take a
closer look at _View_ of the MVC architecture.

The _view_ layer is responsible for presenting data appropriately. In a
Rails application, the views are stored in `app/views` folder.

Each controller has their own views and the name of view file must match
the action name exactly. Depending on the action executed, the views are
used.

> Throughout the session, consider the views to be HTML-based unless
> specified otherwise.

- https://www.theodinproject.com/courses/ruby-on-rails/lessons/views

## Views as HTML Files

At a basic level, views are HTML files in which we insert information
from our controllers. As views are HTML files, anything that works in
HTML, CSS and Javascript works here.

- [HTML Tutorial](https://www.w3schools.com/html/default.asp)
- [Javascript Tutorial](https://www.w3schools.com/js/default.asp)

## Embedded Ruby

Embedded Ruby refers to pieces of code in between HTML code, to make the
views dynamic and extensible.

There are two ways of invoking ERB:
- `<%=` and `%>` wrap Ruby code whose return value will be output in
  place of marker.
- `<%` and `%>` wrap Ruby code whose return value will NOT be output.

```
# Displays current time
<p>Page generated at: <%= DateTime.now %></p>

# Does display not current time
<p>Page generated at: <% DateTime.now %></p>
```

![Current Time](screenshots/current_time.png)

The non-returning tag is used for iterating and preparing data:

```erb
<% @articles.each do |article| %>
  <tr>
    <td><%= article.title %></td>
    <td><%= article.content %></td>
    ...
  </tr>
<% end %>
```

The variables are shared between the controller and views using [instance
variables](https://www.rubyguides.com/2019/07/ruby-instance-variables/), that is variables prefixed by `@`:

```ruby
class ArticlesController < ApplicationController
  def index
    @articles = Article.all
  end
end
```

```erb
<% @articles.each do |article| %>
  <tr>
    <td><%= article.title %></td>
    <td><%= article.content %></td>
    ...
  </tr>
<% end %>
```

## Partials

When writing Ruby, we break up complex methods into multiple, smaller
methods. When writing views, we break up complex views into smaller
partials.

- The partials are named with the leading underscore and are in the same
  directory as the original view.
- You can pass variables to partials using `locals` keyword.

`app/views/articles/index.html.erb`:
```erb
<h1>Articles</h1>

<% @articles.each do |article| %>
  <%= render partial: "card", locals: {article: article} %>
<% end %>
```

`app/views/articles/_card.html.erb`:

```erb
<div>
  <h2><%= article.title %></h2>

  <p><%= article.content %></p>
</div>
```

![Articles Index - Partials](screenshots/articles_index_partials.png)

- [View Partials](http://tutorials.jumpstartlab.com/topics/better_views/view_partials.html)

## Layouts

A layout defines the surrounding of an HTML page. It's the place to
decide a common look and feel of generated page.

If we take a look at HTML generated by `localhost:3000/articles`:

```html
<!DOCTYPE html>
<html>
  <head>
    <title>Blogspot</title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="csrf-param" content="authenticity_token" />
    <meta name="csrf-token" content="9iJszH1WYV7RTAbOftTGlVETo027yYzcZ2B5bHelAu6QypMCMoquMEzFdfk_i9CgV1tZLluq7gBAFgHX_r_R_g" />

    <link rel="stylesheet" media="all" href="/assets/application.debug-56c72c26edc55c1b447e1442bf9c46e5d0f0ca6e85974ac24161c48b6a522f5f.css" />
  </head>

  <body>
    <p id="notice"></p>

    <h1>Articles</h1>

    <table>
      <thead>
        <tr>
          <th>Title</th>
          <th>Topic</th>
          <th>Tags</th>
          <th>Content</th>
          <th colspan="3"></th>
        </tr>
      </thead>

      <tbody>
          <tr>
            <td>Session 4</td>
            <td>Views</td>
            <td>Models</td>
            <td>Texty texty</td>
            <td><a href="/articles/1">Show</a></td>
            <td><a href="/articles/1/edit">Edit</a></td>
            <td><a data-confirm="Are you sure?" rel="nofollow" data-method="delete" href="/articles/1">Destroy</a></td>
          </tr>
      </tbody>
    </table>

    <br>

    <a href="/articles/new">New Article</a>

  </body>
</html>
```

However, we have added only the following in `app/views/articles/index.html.erb` view file:

```erb
<p id="notice"><%= notice %></p>

<h1>Articles</h1>

<table>
  <thead>
    <tr>
      <th>Title</th>
      <th>Topic</th>
      <th>Tags</th>
      <th>Content</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @articles.each do |article| %>
      <tr>
        <td><%= article.title %></td>
        <td><%= article.topic %></td>
        <td><%= article.tags %></td>
        <td><%= article.content %></td>
        <td><%= link_to 'Show', article %></td>
        <td><%= link_to 'Edit', edit_article_path(article) %></td>
        <td><%= link_to 'Destroy', article, method: :delete, data:
        {confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Article', new_article_path %>
```

The remaining HTML is generated by `app/views/layouts/application.html.erb`:

```erb
<!DOCTYPE html>
<html>
  <head>
    <title>Blogspot</title>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>

    <%= stylesheet_link_tag 'application', media: 'all' %>
  </head>

  <body>
    <%= yield %>
  </body>
</html>
```

- [Ruby on Rails - Layouts](https://www.tutorialspoint.com/ruby-on-rails/rails-layouts.htm)

## Link Helper

Rails provides view helpers to generate HTML code using a simple,
ruby-like language.

For example, we can use:

```erb
<%= link_to 'Home', root_path %>
```

to generate a link to home page easily. We can also link to resources,
using the path helpers.

```erb
<%= link_to 'Delete', article, method: delete, data: { confirm: 'Are you sure? } %>
```

For reference, the named routes, path and HTTP verbs are related as
follows:

| Path | HTTP Verb | Controller#Action | Named Route | Used for |
| ---- | ----------------- | --------- | ----------- | -------- |
| /articles | GET | articles#index | articles_path | display all articles |
| /articles/new | GET | articles#new | new_article_path | return an HTML form for creating a new article |
| /articles | POST | articles#create | articles_path | create a new article |
| /articles/:id | GET | articles#show | article_path(@article) | display a specific article |
| /articles/:id/edit | GET | articles#edit | edit_article_path(@article) | return an HTML for editing an article |
| /articles/:id | PATCH/PUT | articles#update | update_article_path(@article) | update a specific article |
| /articles/:id | DELETE | articles#destroy | article_path(@article) | delete a specific article |

- [How to use link_to in Rails](https://mixandgo.com/learn/how-to-use-link_to-in-rails)

## Form Helper

We can write forms as well using view helpers as well.

```erb
<%= form_with(model: article) do |form| %>
  <div class="field">
    <%= form.label :title %>
    <%= form.text_field :title %>
  </div>

  <div class="field">
    <%= form.label :topic %>
    <%= form.text_field :topic %>
  </div>

  <div class="field">
    <%= form.label :tags %>
    <%= form.text_field :tags %>
  </div>

  <div class="field">
    <%= form.label :content %>
    <%= form.text_area :content %>
  </div>

  <div class="actions">
    <%= form.submit %>
  </div>
<% end %>
```

```html
<form action="/articles" accept-charset="UTF-8" method="post">
  <input type="hidden" name="authenticity_token" value="zCFC9p_L2J97AaNKU_frHWj6PFEUyHJyES5Rik8efNDfrzeX-oLBPGC8u0VlkhJdQlz6xT9OlBWnH2lcyJkOmQ" />

  <div class="field">
    <label for="article_title">Title</label>
    <input type="text" name="article[title]" id="article_title" />
  </div>

  <div class="field">
    <label for="article_topic">Topic</label>
    <input type="text" name="article[topic]" id="article_topic" />
  </div>

  <div class="field">
    <label for="article_tags">Tags</label>
    <input type="text" name="article[tags]" id="article_tags" />
  </div>

  <div class="field">
    <label for="article_content">Content</label>
    <textarea name="article[content]" id="article_content"></textarea>
  </div>

  <div class="actions">
    <input type="submit" name="commit" value="Create Article" data-disable-with="Create Article" />
  </div>
</form>
```

If we use a model, Rails automatically figures out which url to send
the form inputs to. Alternatively, we can also specify a url as:

```erb
<%= form_with url: search_path do |form| %>
  <%= form.label :query, "Search for:" %>
  <%= form.text_field :query %>
  <%= form.submit "Search" %>
<% end %>
```

Like `text_field` and `text_area`, Rails also has other helpers of interest:

```erb
<%= form.text_area :message, size: "70x5" %>
<%= form.hidden_field :parent_id, value: "foo" %>
<%= form.password_field :password %>
<%= form.number_field :price, in: 1.0..20.0, step: 0.5 %>
<%= form.range_field :discount, in: 1..100 %>
<%= form.date_field :born_on %>
<%= form.time_field :started_at %>
<%= form.datetime_local_field :graduation_day %>
<%= form.month_field :birthday_month %>
<%= form.week_field :birthday_week %>
<%= form.search_field :name %>
<%= form.email_field :address %>
<%= form.telephone_field :phone %>
<%= form.url_field :homepage %>
<%= form.color_field :favorite_color %>
```

> In practice, you should use third-party gems like
> [bootstrap_form](https://github.com/bootstrap-ruby/bootstrap_form)
> and [Simple Form](https://github.com/heartcombo/simple_form) as they
> are even easier to write.

- [Dealing with Model Objects](https://guides.rubyonrails.org/form_helpers.html#dealing-with-model-objects)
- [Understanding Parameter Naming Conventions](https://guides.rubyonrails.org/form_helpers.html#understanding-parameter-naming-conventions)

## Additional Topics

### Presenting other formats

Rails can present data in multiple ways, with different View file
formats using a `respond_to` block. These often require additional
third-party gems and libraries.

```rb
def index
  @aticles = Article.all

 respond_to do |format|
   format.html # renders index.html.erb
   format.json # renders index.json.jbuilder
 end
end
```

- [JBuilder](https://github.com/rails/jbuilder)
- [Generating PDFs with Rails](https://thoughtbot.com/upcase/videos/generating-pdfs-with-rails)
- [Ruby on Rails - Exporting Data to Excel](https://medium.com/@JasonCodes/ruby-on-rails-exporting-data-to-excel-b3b204281085)


text:
These tests originated at https://github.com/kr/okjson

Except following changes:

* GSON generates floats with uppercase 'E'
* It doesn't renders Bignum's as numbers, it renders Infinity. See
  `*bignum*.json` tests
* GSON understands escaping illegal characters like single quote and
  silently skip the backslash. Therefore these tests were renamed:
  * `invalid15.json` to `decode-invalid15.json{,.exp}`
  * `invalid16.json` to `decode-invalid16.json{,.exp}`
  * `invalid17.json` to `decode-invalid17.json{,.exp}`
* GSON understands verbatim tabs and line breaks in the JSON string.
  Therefore these tests were renamed:
  * `invalid25.json` to `decode-invalid25.json{,.exp}`
  * `invalid26.json` to `decode-invalid26.json{,.exp}`
  * `invalid27.json` to `decode-invalid27.json{,.exp}`
  * `invalid28.json` to `decode-invalid28.json{,.exp}`

extension: markdown


text:
## SecretGenerator

This is a general-purpose sops to Secret (or ConfigMap) generator.

Given an input like:

```
---
apiVersion: agilicus/v1
kind: SecretGenerator
metadata:
  name: mysecret
  namespace: default
type: Secret
secret:
  - secret
```

It will emit Secret with the required entry.

repository: alimeerutech/kustomize-plugins

repo_name: alimeerutech/kustomize-plugins


text:
# Security Policy

<!-- TOC -->

- [Security Policy](#security-policy)
  - [Vulnerability Disclosure Policy](#vulnerability-disclosure-policy)
    - [Reporting vulnerabilities](#reporting-vulnerabilities)
  - [Supported Versions](#supported-versions)
  - [End of Life](#end-of-life)
  - [Known vulnerabilities](#known-vulnerabilities)

<!-- /TOC -->

## Vulnerability Disclosure Policy

Cascoda is committed to addressing and reporting security issues through a coordinated and constructive approach designed to provide the greatest protection for our customers, partners, staff and all Internet users.

A security vulnerability is a weakness in our systems or services that may compromise their security. This policy applies to security vulnerabilities discovered anywhere by both Cascoda staff and by others using Cascoda services. The responsibility for this policy is with the senior management team of Cascoda who will review it on an annual basis.  All day-to-day staff must follow this policy and will receive regular training on how to follow it.

### Reporting vulnerabilities

If you believe you have discovered a vulnerability in one of our services or have a security incident to report, please email<EMAIL_ADDRESS>Please supply the following information:

- SDK version that contains the issue
- Example application or library

Once we have received a vulnerability report, Cascoda takes a series of steps to address the issue:

1. We will provide prompt acknowledgement of receipt of your report of the vulnerability
2. We request the reporter keep any communication regarding the vulnerability confidential
3. We will work with you to understand and investigate the vulnerability
4. We will provide a timeframe for addressing the vulnerability.
5. We will notify you once the vulnerability has been resolved, to allow retesting by the reporter if needed.
6. We publicly announce the vulnerability in the release notes of the update. We may also issue additional public announcements, for example via social media.
7. Release notes (and blog posts when issued) will include a reference to the person/people who reported the vulnerability, unless the reporter(s) would prefer to stay anonymous.

Cascoda will endeavour to keep the reporter apprised of every step in this process as it occurs.

We greatly appreciate the efforts of security researchers and discoverers who share information on security issues with us, giving us a chance to improve our services, and better protect our customers. In line with general responsible disclosure good practice, we ask that security researchers:

- Allow Cascoda an opportunity to correct a vulnerability within a reasonable time period before publicly disclosing the identified issue.
- Provide sufficient detail about the vulnerability to allow us to investigate successfully including steps required to reproduce the issue
- We appreciate the use of the Common Vulnerability Scoring System

When reporting a vulnerability:
- Do not modify or delete data, or take actions that would impact Cascoda's customers
- Do not carry out social engineering exercises or to attempt to find weaknesses in the physical security of Cascoda offices or other locations.

## Supported Versions

The latest version of the SDK is supported for security updates.
See the [release page](https://github.com/Cascoda/cascoda-sdk/releases)

## End of Life

All SDK features are supported. SDK feature depreciation will be announced 6 months in advance.
No features have deprecation announcements.

## Known vulnerabilities

No known vulnerabilities.

### Copyright Disclosure

Text copyright The IASME Consortium Ltd. 2020
Modifications copyright Cascoda Ltd. 2020
Licensed under Creative Commons BY-SA license https://creativecommons.org/licenses/by-sa/4.0/

Applies to sections:

- Vulnerability Disclosure Policy
- Reporting vulnerabilities

repository: CiaranWoodward/cascoda-sdk

repo_name: CiaranWoodward/cascoda-sdk


text:
# tap
Tap: Type-Assert-Php-Object

## Type less, code better

Instead of checking every input variable if it was set:

Old style:
```
if ( ! isset ($_POST["someData"]))
    throw new ValidationException ("Something went wrong")

$data = $_POST["someData"]
if ( ! preg_match ("/somePreg/", $data))
    throw new ValidationException ("And another ting");

$object->someKey = $data;

..next dataset..
```

TAP Style:

```
beamMap($_POST)
    ->use("someData")->reqNotNull()->reqPregMatch("/somePreg/")->beam($someObj->someData)
    ->use("nextData")->reqPregMatch("/SomeOtherPreg/")->beam($someObj->someData)
```

repository: eskirex/tap

repo_name: eskirex/tap


text:
[![Build Status](https://travis-ci.org/alekhrycaiko/postcss-forced-variables.svg?branch=master)](https://travis-ci.org/alekhrycaiko/postcss-forced-variables)

 PostCSS Forced Variables

 Description

The plugins purpose is to help enforce more consistent SASS-like variable usage in stylesheets.

 Features

 Reads an array of CSS properties and provides warnings when these properties could be using pre-existing variables.

 Throws errors when CSS properties from the array do not use variables.

 Setup:

 npm install postcss-forced-variables

 Follow the format below:

```javascript
// require in postcss-forced-variables
var forcedVariables = require('postcss-forced-variables');

//  ...

// add the following call to your processors array.
// ruleset must be an Array of CSS properties.
// variables must be an Object of Key:Value pairs consisting of $Variable:Value
forcedVariables({ruleset : ['color', 'font-size'], variables : { $white : 'fff', $fontLarge : '16px'});
```

 Example of Warning Generation

```javascript

/* Consider the following CSS being processed */
.body {
  color: #fff;
}

```

```javascript
// The following call will result in a Warning that the value #fff has a variable which can be used in the CSS.
forcedVariables({ruleset : ['color'], variables : { $white : 'fff'});
```

 Example of console warning output:

```javascript
forced-variables : <css input>: Warning! The value #fff has a variable that could be used here.
```

 Example of Error Generation

```javascript
.body {
  color: #fff
}
```

```javascript
// The following call will result in an Error being thrown that states a variable must be used in the CSS.
forcedVariables({ruleset : ['color'], variables : { $white : 'fff'});
```

 Example of error output:

```javascript
Error: forced-variables: <css input> Error! Variable have been set to required for this rule
.body {
  color: #fff
}
```

Feel free to e-mail me at<EMAIL_ADDRESS>with any suggestions or questions!

repository: alekhrycaiko/postcss-forced-variables

repo_name: alekhrycaiko/postcss-forced-variables


text:
---
# Display name
title: Yunus Serhat Bıçakçı

# Username (this should match the folder name)
authors:
- admin

# Is this the primary user of the site?
superuser: true

# Role/position
role: Research Assistant

# Organizations/Affiliations
organizations:
- name: Marmara University
  url: "https://www.marmara.edu.tr/"

# Short bio (displayed in user profile at end of posts)
bio: My research interests include geography of crime, electronic monitoring, geographic information systems, and data mining.

interests:
- Geographic Information Systems
- Data Mining
- Environmental Criminology

education:
  courses:
  - course: Geographical Information Technologies-Ph.D.
    institution: Istanbul Technical University
    year: 2021
  - course: Management Information Systems-M.Sc.
    institution: Sakarya University
    year: 2013
  - course: Business Administration-B.B.A.
    institution: Anadolu University
    year: 2011

# Social/Academic Networking
# For available icons, see: https://sourcethemes.com/academic/docs/page-builder/#icons
#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
#   form<EMAIL_ADDRESS>or "#contact" for contact widget.
social:
- icon: envelope
  icon_pack: fas
  link: '#contact'  # For a direct email link, use<EMAIL_ADDRESS>- icon: twitter
  icon_pack: fab
  link: https://twitter.com/yunusserhat
- icon: google-scholar
  icon_pack: ai
  link: https://scholar.google.com.tr/citations?user=2FSN2voAAAAJ&hl
- icon: github
  icon_pack: fab
  link: https://github.com/bicakciyu
- icon: facebook
  icon_pack: fab
  link: https://www.facebook.com/yunusserhat
- icon: instagram
  icon_pack: fab
  link: https://www.instagram.com/yunusserhat/
- icon: linkedin
  icon_pack: fab
  link: https://www.linkedin.com/in/yunus-serhat-bi%C3%A7ak%C3%A7i-60365825/
- icon: orcid
  icon_pack: fab
  link: https://orcid.org/0000-0002-7288-9959
- icon: academia
  icon_pack: ai
  link: https://marmara.academia.edu/YunusSerhatBicakci
- icon: researchgate
  icon_pack: ai
  link: https://www.researchgate.net/profile/Yunus_Bicakci

# Link to a PDF of your resume/CV from the About widget.
# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
# - icon: cv
#   icon_pack: ai
#   link: files/cv.pdf

# Enter email to display Gravatar (if Gravatar enabled in Config)
email: ""

# Organizational groups that you belong to (for People widget)
#   Set this to `[]` or comment out if you are not using People widget.
user_groups:
- Researchers
- Visitors
---

Yunus Serhat Bıçakçı is a research assistant in the Vocational School of Social Sciences at Marmara University at Istanbul.

My research interests include geography of crime, electronic monitoring, geographic information systems, and data mining.

repository: yunusserhatbicakci/academic-kickstart

repo_name: yunusserhatbicakci/academic-kickstart


text:
# Release Notes

NetBox releases are numbered as major, minor, and patch releases. For example, version 3.1.0 is a minor release, and v3.1.5 is a patch release. Briefly, these can be described as follows:

* **Major** - Introduces or removes an entire API or other core functionality
* **Minor** - Implements major new features but may include breaking changes for API consumers or other integrations
* **Patch** - A maintenance release which fixes bugs and may introduce backward-compatible enhancements

Minor releases are published in April, August, and December of each calendar year. Patch releases are published as needed to address bugs and fulfill minor feature requests, typically around every one to two weeks.

This page contains a history of all major and minor releases since NetBox v2.0. For more detail on a specific patch release, please see the release notes page for that specific minor release.

#### [Version 3.5](./version-3.5.md) (April 2023)

* Customizable Dashboard ([#9416](https://github.com/netbox-community/netbox/issues/9416))
* Remote Data Sources ([#11558](https://github.com/netbox-community/netbox/issues/11558))
* Configuration Template Rendering ([#11559](https://github.com/netbox-community/netbox/issues/11559))
* NAPALM Integration Plugin ([#10520](https://github.com/netbox-community/netbox/issues/10520))
* ASN Ranges ([#8550](https://github.com/netbox-community/netbox/issues/8550))
* Provider Accounts ([#9047](https://github.com/netbox-community/netbox/issues/9047))
* Job-Triggered Webhooks  ([#8958](https://github.com/netbox-community/netbox/issues/8958))

#### [Version 3.4](./version-3.4.md) (December 2022)

* New Global Search ([#10560](https://github.com/netbox-community/netbox/issues/10560))
* Virtual Device Contexts ([#7854](https://github.com/netbox-community/netbox/issues/7854))
* Saved Filters ([#9623](https://github.com/netbox-community/netbox/issues/9623))
* JSON/YAML Bulk Imports ([#4347](https://github.com/netbox-community/netbox/issues/4347))
* Update Existing Objects via Bulk Import ([#7961](https://github.com/netbox-community/netbox/issues/7961))
* Scheduled Reports & Scripts ([#8366](https://github.com/netbox-community/netbox/issues/8366))
* API for Staged Changes ([#10851](https://github.com/netbox-community/netbox/issues/10851))

#### [Version 3.3](./version-3.3.md) (August 2022)

* Multi-object Cable Terminations ([#9102](https://github.com/netbox-community/netbox/issues/9102))
* L2VPN Modeling ([#8157](https://github.com/netbox-community/netbox/issues/8157))
* PoE Interface Attributes ([#1099](https://github.com/netbox-community/netbox/issues/1099))
* Half-Height Rack Units ([#51](https://github.com/netbox-community/netbox/issues/51))
* Restrict API Tokens by Client IP ([#8233](https://github.com/netbox-community/netbox/issues/8233))
* Reference User in Permission Constraints ([#9074](https://github.com/netbox-community/netbox/issues/9074))
* Custom Field Grouping ([#8495](https://github.com/netbox-community/netbox/issues/8495))
* Toggle Custom Field Visibility ([#9166](https://github.com/netbox-community/netbox/issues/9166))

#### [Version 3.2](./version-3.2.md) (April 2022)

* Plugins Framework Extensions ([#8333](https://github.com/netbox-community/netbox/issues/8333))
* Modules & Module Types ([#7844](https://github.com/netbox-community/netbox/issues/7844))
* Custom Object Fields ([#7006](https://github.com/netbox-community/netbox/issues/7006))
* Custom Status Choices ([#8054](https://github.com/netbox-community/netbox/issues/8054))
* Improved User Preferences ([#7759](https://github.com/netbox-community/netbox/issues/7759))
* Inventory Item Roles ([#3087](https://github.com/netbox-community/netbox/issues/3087))
* Inventory Item Templates ([#8118](https://github.com/netbox-community/netbox/issues/8118))
* Service Templates ([#1591](https://github.com/netbox-community/netbox/issues/1591))
* Automatic Provisioning of Next Available VLANs ([#2658](https://github.com/netbox-community/netbox/issues/2658))

#### [Version 3.1](./version-3.1.md) (December 2021)

* Contact Objects ([#1344](https://github.com/netbox-community/netbox/issues/1344))
* Wireless Networks ([#3979](https://github.com/netbox-community/netbox/issues/3979))
* Dynamic Configuration Updates ([#5883](https://github.com/netbox-community/netbox/issues/5883))
* First Hop Redundancy Protocol (FHRP) Groups ([#6235](https://github.com/netbox-community/netbox/issues/6235))
* Conditional Webhooks ([#6238](https://github.com/netbox-community/netbox/issues/6238))
* Interface Bridging ([#6346](https://github.com/netbox-community/netbox/issues/6346))
* Multiple ASNs per Site ([#6732](https://github.com/netbox-community/netbox/issues/6732))
* Single Sign-On (SSO) Authentication ([#7649](https://github.com/netbox-community/netbox/issues/7649))

#### [Version 3.0](./version-3.0.md) (August 2021)

* Updated User Interface ([#5893](https://github.com/netbox-community/netbox/issues/5893))
* GraphQL API ([#2007](https://github.com/netbox-community/netbox/issues/2007))
* IP Ranges ([#834](https://github.com/netbox-community/netbox/issues/834))
* Custom Model Validation ([#5963](https://github.com/netbox-community/netbox/issues/5963))
* SVG Cable Traces ([#6000](https://github.com/netbox-community/netbox/issues/6000))
* New Views for Models Previously Under the Admin UI ([#6466](https://github.com/netbox-community/netbox/issues/6466))
* REST API Token Provisioning ([#5264](https://github.com/netbox-community/netbox/issues/5264))
* New Housekeeping Command ([#6590](https://github.com/netbox-community/netbox/issues/6590))
* Custom Queue Support for Plugins ([#6651](https://github.com/netbox-community/netbox/issues/6651))

#### [Version 2.11](./version-2.11.md) (April 2021)

* Journaling Support ([#151](https://github.com/netbox-community/netbox/issues/151))
* Parent Interface Assignments ([#1519](https://github.com/netbox-community/netbox/issues/1519))
* Pre- and Post-Change Snapshots in Webhooks ([#3451](https://github.com/netbox-community/netbox/issues/3451))
* Mark as Connected Without a Cable ([#3648](https://github.com/netbox-community/netbox/issues/3648))
* Allow Assigning Devices to Locations ([#4971](https://github.com/netbox-community/netbox/issues/4971))
* Dynamic Object Exports ([#4999](https://github.com/netbox-community/netbox/issues/4999))
* Variable Scope Support for VLAN Groups ([#5284](https://github.com/netbox-community/netbox/issues/5284))
* New Site Group Model ([#5892](https://github.com/netbox-community/netbox/issues/5892))
* Improved Change Logging ([#5913](https://github.com/netbox-community/netbox/issues/5913))
* Provider Network Modeling ([#5986](https://github.com/netbox-community/netbox/issues/5986))

#### [Version 2.10](./version-2.10.md) (December 2020)

* Route Targets ([#259](https://github.com/netbox-community/netbox/issues/259))
* REST API Bulk Deletion ([#3436](https://github.com/netbox-community/netbox/issues/3436))
* REST API Bulk Update ([#4882](https://github.com/netbox-community/netbox/issues/4882))
* Reimplementation of Custom Fields ([#4878](https://github.com/netbox-community/netbox/issues/4878))
* Improved Cable Trace Performance ([#4900](https://github.com/netbox-community/netbox/issues/4900))

#### [Version 2.9](./version-2.9.md) (August 2020)

* Object-Based Permissions ([#554](https://github.com/netbox-community/netbox/issues/554))
* Background Execution of Scripts & Reports ([#2006](https://github.com/netbox-community/netbox/issues/2006))
* Named Virtual Chassis ([#2018](https://github.com/netbox-community/netbox/issues/2018))
* Changes to Tag Creation ([#3703](https://github.com/netbox-community/netbox/issues/3703))
* Dedicated Model for VM Interfaces ([#4721](https://github.com/netbox-community/netbox/issues/4721))
* REST API Endpoints for Users and Groups ([#4877](https://github.com/netbox-community/netbox/issues/4877))

#### [Version 2.8](./version-2.8.md) (April 2020)

* Remote Authentication Support ([#2328](https://github.com/netbox-community/netbox/issues/2328))
* Plugins ([#3351](https://github.com/netbox-community/netbox/issues/3351))

#### [Version 2.7](./version-2.7.md) (January 2020)

* Enhanced Device Type Import ([#451](https://github.com/netbox-community/netbox/issues/451))
* Bulk Import of Device Components ([#822](https://github.com/netbox-community/netbox/issues/822))
* External File Storage ([#1814](https://github.com/netbox-community/netbox/issues/1814))
* Rack Elevations Rendered via SVG ([#2248](https://github.com/netbox-community/netbox/issues/2248))

#### [Version 2.6](./version-2.6.md) (June 2019)

* Power Panels and Feeds ([#54](https://github.com/netbox-community/netbox/issues/54))
* Caching ([#2647](https://github.com/netbox-community/netbox/issues/2647))
* View Permissions ([#323](https://github.com/netbox-community/netbox/issues/323))
* Custom Links ([#969](https://github.com/netbox-community/netbox/issues/969))
* Prometheus Metrics ([#3104](https://github.com/netbox-community/netbox/issues/3104))

#### [Version 2.5](./version-2.5.md) (December 2018)

* Patch Panels and Cables ([#20](https://github.com/netbox-community/netbox/issues/20))

#### [Version 2.4](./version-2.4.md) (August 2018)

* Webhooks ([#81](https://github.com/netbox-community/netbox/issues/81))
* Tagging ([#132](https://github.com/netbox-community/netbox/issues/132))
* Contextual Configuration Data ([#1349](https://github.com/netbox-community/netbox/issues/1349))
* Change Logging ([#1898](https://github.com/netbox-community/netbox/issues/1898))

#### [Version 2.3](./version-2.3.md) (February 2018)

* Virtual Chassis ([#99](https://github.com/netbox-community/netbox/issues/99))
* Interface VLAN Assignments ([#150](https://github.com/netbox-community/netbox/issues/150))
* Bulk Object Creation via the API ([#1553](https://github.com/netbox-community/netbox/issues/1553))
* Automatic Provisioning of Next Available Prefixes ([#1694](https://github.com/netbox-community/netbox/issues/1694))
* Bulk Renaming of Device/VM Components ([#1781](https://github.com/netbox-community/netbox/issues/1781))

#### [Version 2.2](./version-2.2.md) (October 2017)

* Virtual Machines and Clusters ([#142](https://github.com/netbox-community/netbox/issues/142))
* Custom Validation Reports ([#1511](https://github.com/netbox-community/netbox/issues/1511))

#### [Version 2.1](./version-2.1.md) (July 2017)

* IP Address Roles ([#819](https://github.com/netbox-community/netbox/issues/819))
* Automatic Provisioning of Next Available IP ([#1246](https://github.com/netbox-community/netbox/issues/1246))
* NAPALM Integration ([#1348](https://github.com/netbox-community/netbox/issues/1348))

#### [Version 2.0](./version-2.0.md) (May 2017)

* API 2.0 ([#113](https://github.com/netbox-community/netbox/issues/113))
* Image Attachments ([#152](https://github.com/netbox-community/netbox/issues/152))
* Global Search ([#159](https://github.com/netbox-community/netbox/issues/159))
* Rack Elevations View ([#951](https://github.com/netbox-community/netbox/issues/951))

repository: netbox-community/netbox

branch_name: refs/heads/develop

gha_language: Python

repo_name: netbox-community/netbox


text:
# NEVADA
Simple 2D game made in C with SDL2

Just to learn C and SDL.

## Used libraties

- SDL2
- libxml2
- lua53

## Examples

### previous assets:
![alt text](/doc/nevada_2019-02-15_09-02-33-17.png "Screenshot 3")
### current assets:
![alt text](/doc/nevada_2020-02-06_11-27-51-51.png "Screenshot 1")
![alt text](/doc/nevada_2019-03-11_23-16-01-98.png "Screenshot 2")

### example video:
[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/frHvnh2pkSk/0.jpg)](https://www.youtube.com/watch?v=frHvnh2pkSk)

## Main goals

- I've no idea what kind of game it would be ;)
- level entirely generated from .tmx (TiledMap Editor) map file (including templates and tilesets)
- use Lua as scripting language (I plan to use scripts that would be attached to various objects in the game)
- some graphics improvements

repository: szczypiorofix/nevada

repo_name: szczypiorofix/nevada


text:
---
layout: post
title: "Multiple has_many associations beetween same tables"
description: ""
category: [rails, activerecord]
tags: [associations]
---
{% include JB/setup %}

This is an industrial site where a [pipe rack](https://en.wikipedia.org/wiki/Pipe_rack) runs through several kilometres.
This rack, as usual, has several bents, in this case, they call loops (even though they are not loops!)
All the site is divided into areas.
Each area can have several loops.
Each loop can have several pipes.
Not necessarily all the pipes that belong to an area pass through a loop.

My models are (simplified):

    # models/loop.rb
    class Loop < ActiveRecord::Base
      belongs_to :area
      has_many :pipes
    end

    # models/area.rb
    class Area < ActiveRecord::Base
      has_and_belongs_to_many :pipes
      has_many :loops
      has_many :looppipes, through: :loops, source: :pipes
    end

    # models/pipe.rb
    class Pipe < ActiveRecord::Base
      belongs_to :loop
      has_and_belongs_to_many :areas
    end

The line ```has_and_belongs_to_many :pipes``` gives the association for those pipes that have no loop associated.

To get the ```pipes``` that don't pass through any ```loop``` of certain ```area```, that is, pipes directly assigned, we can write

    area.pipes

The line ```has_many :looppipes, through: :loops, source: :pipes``` in the area model gives the association area-pipe for those pipes that pass through a loop.

To get the ```pipes``` that go through any ```loop``` of certain ```area```, we can write

    area.looppipes

To join both lists we can write

    area.pipes + area.looppipes

When the loop information is needed:

    area.looppipes.includes(:loop)
    area.looppipes.includes(:loop).first.loop.name

    area.pipes.includes(:loop)

In the views

area/show.html.erb

    <%= render partial: 'area_pipes', locals: { area: @area, pipes: @area.pipe, with_loop: false, listing_title: t(:Listing_pipes_without_loop) } unless @area.pipes.empty? %>

    <%= render partial: 'area_pipes', locals: { area: @area, pipes: @area.looppipes.includes(:loop), with_loop: true, listing_title: t(:Listing_pipes_through_loop)  } unless @area.looppipes.empty? %>

area/_area_pipes.html.erb

<%= listing_title %>

          <%= t :Name %>
        <% if with_loop %>  <%= t :Loop %>	 <% end -%>
          <%= t :Areas %>

        <% pipes.each do |pipe| %>

            <%= pipe.name %>
           <% if with_loop %> <%= pipe.loop.name %>	 <% end -%>
            <%= pipe.areas.count %>
            <%= link_to t(:show_pipe_info), pipe if policy(Pipe).show? %>
            <%= link_to t(:Remove_pipe), area_remove_pipe_path(area, pipe), method: :delete, data: { confirm: t(:Are_you_sure) } if policy(Area).remove_pipe? %>

        <% end %>


text:
---
layout: nodes.liquid
section: smartContract
title: "Page Not Found (404)"
eleventyExcludeFromCollections: true
permalink: /404.html
---
We're sorry, but we couldn't find the page you were looking for. You can select a section from the top of the page, or browse the links on the left.

If you followed a broken link, [let us know](https://github.com/smartcontractkit/documentation/issues/new), or send a PR on [GitHub](https://github.com/smartcontractkit/documentation/).

repository: lukeramsden/documentation

repo_name: lukeramsden/documentation