text:
---
extends: _layouts.post
section: content
title: Supercharged Dynamic Vue SVG Icon Component
date: 2019-02-07
description: Building a versatile, reusable Vue component wrapper for a SVG icon library.
categories: [VueJS, SVG, TailwindCSS]
featured: false
image: /assets/img/2019-02-07-supercharged-dynamic-vue-svg-icon-component-1.png
image_thumb: /assets/img/2019-02-07-supercharged-dynamic-vue-svg-icon-component-1.png
image_author:
image_author_url:
image_unsplash:
---

> **UPDATE 8 Feb 2019** _In my excitement I failed to realize that TailwindCSS makes it even easier to accomplish what I've outlined in this article, with fewer lines of code and a simplified API. Check out my [follow-up article](/blog/simplified-dynamic-svg-icon-component/) for the details._

As a developer with designer aspirations I've found it a little cumbersome to use SVG icons in my projects. Unfortunately SVG is not as straightforward to use as a popular font icon library such as [FontAwesome](https://fontawesome.com/). There are all kinds of considerations to keep in mind, amongst them fill color and size.

And then there's the verbosity of the code required to render this stuff.

Compare the code for a FontAwesome `plane` icon...

```html
<i class="fas fa-plane"></i>
```

... with the code for the same type of icon from one of my favorite SVG icon libraries, [Zondicons](http://www.zondicons.com/):

```html
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M8.4 12H2.8L1 15H0V5h1l1.8 3h5.6L6 0h2l4.8 8H18a2 2 0 1 1 0 4h-5.2L8 20H6l2.4-8z"/></svg>
```

I mean, who wants to deal with this stuff? And the example above is actually a simple one. The more complex the icon, the more complex the code.

And yet, SVG icons have a [lot](https://css-tricks.com/icon-fonts-vs-svg/) of [advantages](https://cloudfour.com/thinks/seriously-dont-use-icon-fonts/) over font icons.

I started moving away from FontAwesome towards SVG icons the same way I've ditched [Bootstrap](https://getbootstrap.com/) in favor of [TailwindCSS](https://tailwindcss.com/).

So one of the things I've tried to accomplish is to create a reusable Vue component that I can wrap around the SVG icon definition. That way I don't have to worry about SVG code polluting my views but I can also control the icon's properties (fill and size for now) through a consistent interface in the form of props.

Yeah, I'm still dependent on Vue but all of my projects these days include it, whether I'm building a Laravel app (which comes with Vue) or a front-end app (which would also be Vue). While this article is written from Vue's perspective, I'm sure other front-end frameworks can accomplish the same thing.

After several iterations on the concept I arrived at this version that I feel covers most use-cases that I've encountered. The idea of a dynamic component surfaced after reading this article on [dynamic Vue components](https://alligator.io/vuejs/dynamic-components/).

## The Goal

The end-goal is to be able to invoke my dynamic SVG icon like this:

```html
<v-icon icon="menu" fill="red" :size=32></v-icon>
```

I also want to have a sensible default, so if do this...

```html
<v-icon></v-icon>
```

... I'll see a square 24px `x` icon colored `grey-darkest` going by Tailwind colors.

## Assumptions

For this example I'm using the awesome free SVG icon library [Feathericons](https://feathericons.com/). I just love the subtle style of these icons.

I created this mostly for Vue components inside of a Laravel project because this is what I'm mainly working with on a daily basis. There are some differences compared to a full Vue app, amongst them being the fact that I use auto-import and registration of components in Laravel. In a pure Vue app components are imported in a slightly different way, but that's not the subject of this exercise.

Finally, for `fill` I wanted to be able to use TailwindCSS's color classes, so the icon wrapper component is dependent on that.

## The Setup

Starting with a `components` folder which contains all my `.vue` single-file components, I'll create a folder named `icons` and yet another folder named `svg` inside of that.

![Folder structure](/assets/img/2019-02-07-supercharged-dynamic-vue-svg-icon-component-2.jpg)

In the `icons` folder I have single Vue file named `VIcon.vue`. (If you're wondering why the V, it's sort of a [Vue component naming convention](https://vuejs.org/v2/style-guide/#Multi-word-component-names-essential)). This is the icon wrapper component that handles all the logic and figures out which icon to load. Here's what it contains:

```html
<template>
    <svg
        xmlns="http://www.w3.org/2000/svg"
        :width="dynamicSize"
        :height="dynamicSize"
        :fill="dynamicFill"
        :stroke="dynamicFill"
        viewBox="0 0 24 24"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
        class="feather"
        :class="icon"
    >
        <keep-alive>
            <component
                :is="dynamicIcon"
                :size=dynamicSize
                :fill="dynamicFill"
            ></component>
        </keep-alive>
    </svg>
</template>

<script>
    import {colors} from '../../../../../tailwind';

    export default {
        props: {
            'icon': {
                'type': String,
                'required': false,
                'default': 'x',
            },
            'size': {
                'type': Number,
                'required': false,
                'default': 24,
            },
            'fill': {
                'type': String,
                'required': false,
                'default': 'grey-darkest',
            }
        },
        computed: {
            dynamicIcon: function () {
                return `v-${this.icon}`; // default icon: x
            },
            dynamicSize: function () {
                return this.size; // default size: 24
            },
            dynamicFill: function () {
                return colors[this.fill]; // default fill: grey-darkest
            }
        }
    }
</script>

<style>
svg {
    @apply cursor-pointer;
    @apply inline-block;
}
</style>
```

Next, inside the `svg` sub-folder I can dump all my icons. Based on the Feathericons library, I will name the files `VX.vue`, `VMenu.vue`, `VArrowDown.vue` and so on. Here's what `VMenu.vue` contains.

```html
<template>
    <g>
        <line x1="3" y1="12" x2="21" y2="12"></line>
        <line x1="3" y1="6" x2="21" y2="6"></line>
        <line x1="3" y1="18" x2="21" y2="18"></line>
    </g>
</template>
```

Notice that I moved the `svg` wrapper from the original Feathericon `.svg` file to the parent component and replaced it with a SVG group `g`.

## The Explanation

The dyamic component magic happens here:

```html
<component
    :is="dynamicIcon"
...

computed: {
    dynamicIcon: function () {
        return `v-${this.icon}`; // default icon: x
    },
...
```

If the code is not self-explanatory, basically I'm using Vue's `component` tag along with the `:is` prop to load a component whose name is computed. If I were to load the component statically I would do:

```html
<v-menu></v-menu>
```

Because I'm receiving the string `menu` in my `:icon` prop, the computed property `dynamicIcon` becomes `v-icon`. At this point Vue knows how to render the correct component.

Next I'll bind a few dynamic properties on the `svg` tag with (computed) component props:

```html
    <svg
        ...
        :width="dynamicSize"
        :height="dynamicSize"
        :fill="dynamicFill"
        :stroke="dynamicFill"
        ...
```

If you take a closer look at `dynamicFill` you'll notice the definition is:

```javascript
dynamicFill: function () {
    return colors[this.fill]; // default fill: grey-darkest
}
```

So what is this weird `colors[this.fill]` stuff? Well, I'm also importing the `colors` object from Tailwind's config file, typically located in the root of the project and named `tailwind.js`. Because it's a JS file, this is easy to do. Here's I'm simply referencing a key in the `colors` object.

If I were to render an icon like this...

```html
<v-icon
    fill="red-darkest"
></v-icon>
```

... then `dyamicFill` translates to `colors['red-lightest']` and returns the string `#3b0d0c` which is how Tailwind's `red-lightest` color is defined. This, in turn, is applied to the SVG fill and stroke properties.

## Finally

I hope that made sense but that's all there is to it. Here are a few more examples of how I would use this component.

![Default icons, different sizes](/assets/img/2019-02-07-supercharged-dynamic-vue-svg-icon-component-3.jpg)

```html
<v-icon :size=12></v-icon>

<v-icon></v-icon>

<v-icon :size=32></v-icon>
```

![Different icons, sizes, fills](/assets/img/2019-02-07-supercharged-dynamic-vue-svg-icon-component-4.jpg)

```html
<v-icon :size=12></v-icon>

<v-icon></v-icon>

<v-icon icon="menu" fill="green" :size=32></v-icon>
```

gha_language: CSS


text:
# Onyxia API Documentation

Onyxia's API is stateless in itself, using Keycloak for users management and helm for infrastructure management. It was built using [Spring Framework](https://spring.io/), it is recommended to use [Maven](https://maven.apache.org/) to test and build the application, given the already generated `pom.xml` files.

The Onyxia API documentation is in development and divided into the following sections:
- [Onyxia API Documentation](./README.md)
- [Onyxia API Architecture](./ARCHITECTURE.md)
- [Onyxia API Specification](./SPECIFICATION.md)

## :warning: Disclaimer :warning:
The documentation is still in development.

## Main Routes

Onyxia API has two main routes of interaction:
- `/my-lab/`: which handles authenticated requests to the Data Lab itself running on Kubernetes. For example, to request a service to be launched in a self-service basis, or to delete an owned running service.
- `/public/`: which handles public requests from unauthenticated users, providing information that is not protected. For example, listing a catalog service (package) offerings.

### Example: Request a Service
This request is usually done through the Onyxia Web interface. However, if you're an authenticated user with an access token and desire to do it programatically, you can also do it through API calls.

To request a service, it is necessary to indicate a which service package we want to install from a catalog. So a normal flow would be to, first know the existing catalogs:
```
GET /public/catalog
```
Then from the catalog select a service package by its `name`, and provide the configuration `options` following the catalog specification on your service request. For example, requesting a `jupyter` service with the default configurations would be done as follows:
```
PUT /my-lab/app
```
```json
{
  "catalogId": "inseefrlab-helm-charts-datascience",
  "packageName": "jupyter",
  "packageVersion": "4.0.0",
  "name": "jupyter",
  "options": {},
  "dryRun": false
}
```

license: MIT

repository: InseeFrLab/onyxia-api

branch_name: refs/heads/master

extension: md

gha_language: Java

gha_license_id: MIT

license_type: permissive

repo_name: InseeFrLab/onyxia-api


text:
# EuroSAT: Land Use and Land Cover Classification with Sentinel-2

![EuroSAT overview image](https://github.com/phelber/EuroSAT/blob/master/eurosat_overview_small.jpg?raw=true)

## Short Description

In this study, we address the challenge of land use and land cover classification using Sentinel-2 satellite images. The Sentinel-2 satellite images are openly and freely accessible provided in the Earth observation program Copernicus. We present a novel dataset based on Sentinel-2 satellite images covering 13 spectral bands and consisting out of 10 classes with in total 27,000 labeled and geo-referenced images. We provide benchmarks for this novel dataset with its spectral bands using state-of-the-art deep Convolutional Neural Network (CNNs). With the proposed novel dataset, we achieved an overall classification accuracy of 98.57\%. The resulting classification system opens a gate towards a number of Earth observation applications. We demonstrate how this classification system can be used for detecting land use and land cover changes and how it can assist in improving geographical maps.

### Dataset
The dataset is available via [Zenodo](https://zenodo.org/record/7711810#.ZAm3k-zMKEA).

##### Deprecated Hosting
* [EuroSAT Dataset (RGB)](https://madm.dfki.de/files/sentinel/EuroSAT.zip)
* [EuroSAT Dataset (MS)](https://madm.dfki.de/files/sentinel/EuroSATallBands.zip)

### Paper
* The full-text PDF is available via [ResearchGate](https://www.researchgate.net/publication/319463676_EuroSAT_A_Novel_Dataset_and_Deep_Learning_Benchmark_for_Land_Use_and_Land_Cover_Classification).

### FAQ

#### How to create the RGB version of an image using the multi-spectral version of an image using the GDAL command line tools?

One option to do this is:

```
gdal_translate --config GDAL_PAM_ENABLED NO -of JPEG -co QUALITY=100 -ot Byte -a_nodata 0 -scale 0 2750 1 255 -b 4 -b 3 -b 2 -of JPEG <input> <output>

```

You can also perform this process using your favorite geo lib (e.g. rasterio). Please note the scaling parameters set in the command line above, which lead to clipping and scaling effects.

### References

If you have used the EuroSAT dataset, please cite the following papers:

[1] Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. Patrick Helber, Benjamin Bischke, Andreas Dengel, Damian Borth. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 2019.

```
@article{helber2019eurosat,
  title={Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification},
  author={Helber, Patrick and Bischke, Benjamin and Dengel, Andreas and Borth, Damian},
  journal={IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing},
  year={2019},
  publisher={IEEE}
}
```

[2] Introducing EuroSAT: A Novel Dataset and Deep Learning Benchmark for Land Use and Land Cover Classification. Patrick Helber, Benjamin Bischke, Andreas Dengel. 2018 IEEE International Geoscience and Remote Sensing Symposium, 2018.

```
@inproceedings{helber2018introducing,
  title={Introducing EuroSAT: A Novel Dataset and Deep Learning Benchmark for Land Use and Land Cover Classification},
  author={Helber, Patrick and Bischke, Benjamin and Dengel, Andreas and Borth, Damian},
  booktitle={IGARSS 2018-2018 IEEE International Geoscience and Remote Sensing Symposium},
  pages={204--207},
  year={2018},
  organization={IEEE}
}
```

### License
The dataset is licensed under the MIT license. In general, Sentinel data is free and open to the public under EU law. Please consider the [Copernicus Sentinel Data Terms and Conditions](https://sentinel.esa.int/documents/247904/690755/Sentinel_Data_Legal_Notice) when using Copernicus Sentinel data.

repository: phelber/EuroSAT

repo_name: phelber/EuroSAT


text:
# Temporal variation in transmission during the COVID-19 outbreak in Italy

**This analysis has now be superseded. For the new results see [here](https://epiforecasts.io/covid/posts/national/italy/) and see [here](https://github.com/epiforecasts/covid)  and [here](https://github.com/epiforecasts/EpiNow) for the supporting code.**

*Warning: This analysis is a work in progress. Breaking changes may occur and the authors cannot guarantee support.*

**Aim:** To identify changes in the reproduction number, rate of spread, and doubling time during the course of the COVID-19 outbreak in Italy whilst accounting for potential biases due to delays in case reporting.

## Usage

### Set up

Set your working directory to the home directory of this project (or use the provided Rstudio project). Install the analysis and all dependencies with:

```r
remotes::install_github("cmmid/CovidItalyNow", dependencies = TRUE)
```

### Update all regional nowcasts and report

All regional nowcasts and the report can be updated by running the following from the package root directory:

```bash
Rscript utils/update_nowcasts.R
```

### Update individual nowcasts

Results from each nowcast are stored in `results/region/nowcast_date`. It is assumed that the user is in the project root for all analysis.

### Inspect results

See `vignettes/report.md` for a markdown version of the analysis containing all results. See `vignettes/rendered_output` for version of the analysis rendered in other formats.

## Docker

This analysis was developed in a docker container based on the `rocker/geospatial` docker image.

To build the docker image run (from the `CovidItalylNow` directory):

```bash
docker build . -t coviditalynow
```

To run the docker image run:

```bash
docker run -d -p 8787:8787 --name covidglobalnow -e USER=coviditalynow -e PASSWORD=coviditalynow coviditalynow
```

The rstudio client can be found on port :8787 at your local machines ip. The default username:password is coviditalynow:coviditalynow, set the user with -e USER=username, and the password with - e PASSWORD=newpasswordhere. The default is to save the analysis files into the user directory.

To mount a folder (from your current working directory - here assumed to be `tmp`) in the docker container to your local system use the following in the above docker run command (as given mounts the whole `coviditalynow` directory to `tmp`).

```{bash, eval = FALSE}
--mount type=bind,source=$(pwd)/tmp,target=/home/coviditalynow
```

To access the command line run the following:

```{bash, eval = FALSE}
docker exec -ti coviditalynow bash
```

repository: cmmid/CovidItalyNow

repo_name: cmmid/CovidItalyNow


text:
# Greetings App

A simple Neutralino App that displays a greeting message with the username of a user logged in the system.

> Hello.. `<Your system user Name>`

## Running This application

1. Clone/Download this Repository
2. Open the `neutralino.exe` file.
3. The app fires up in your browser, it is running.

The app closes as soon as you close the browser tab.

## Screenshot

[View More Samples](https://github.com/neutralinojs/neutralinojs-samples)

Build your own NeutralinoJs app? [Get Started](https://neutralinojs.github.io/docs/#/gettingstarted/quickstart)


text:
# Changelog Ikea

>**Important**
>
>As a reminder if there is no information on the update, it means that it only concerns the updating of documentation, translation or text

# 02/02/2022

- Fixed dependency installation bug with Jeedom 4.2

# 09/24/2021

- Correction of a problem on the installation of dependencies

# 04/05/2021

- Switching to nodejs 14

# 23/11/2020

- New presentation of the list of objects
- Addition of the tag "V4 compatibility"

# 05/23/2020

- Installation of nodejs 12 instead of 8

# 01/12/2020

- Bug fix in the dependencies installation script
- Inversion of the widget for the stores (be careful to remove the store type equipment and restart the demon)

# 10/16/2019

- Updating the doc

# 10/14/2019

- Bugfix

# 10/10/10

- Blind support
- Improvement of command names and generic type
- Adapting the interface to Jeedom V4
- Support PHP 7.3
- complete demon change

Important : following this update you must reinstall the dependencies and relaunch the demon

# 07-06-2019

- Improved dependency script

# 2019-05-27

- Temporary change due to the change brought about by the last IKEA update
- Adding plugs
- Improved management of status returns

# 02/14/2019

- Correction bug auto detection of confs

# 10/16/2018
- Add conf transform
- Name management with /

# 04/24/2018

- Addition of LED panel 30x90
- Addition of the E26 980lm bulb

# 03/21/2018

- The 1000lm bulb has two variants adding the conf

repository: jeedom/documentations

gha_language: HTML

repo_name: jeedom/documentations


text:
[![Pipeline](https://github.com/LeFnord/grape-starter/actions/workflows/pipeline.yml/badge.svg?branch=master)](https://github.com/LeFnord/grape-starter/actions/workflows/pipeline.yml)
[![Gem Version](https://badge.fury.io/rb/grape-starter.svg)](https://badge.fury.io/rb/grape-starter)

# Grape Starter

Is a tool to help you to build up a skeleton for a [Grape](http://github.com/ruby-grape/grape) API mounted on [Rack](https://github.com/rack/rack) ready to run.
[grape-swagger](http://github.com/ruby-grape/grape-swagger) would be used to generate a  [OAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) compatible documentation, which could be shown with [ReDoc](https://github.com/Rebilly/ReDoc).

![ReDoc demo](doc/re-doc.png)

## Why the next one?

- build up a playground for your ideas, prototypes, testing behaviour … whatever
- ~~no assumtions about~~ you can choose, if you want to use a backend/ORM, ergo no restrictions, only a pure grape/rack skeleton with a nice documentation

## Usage

### Install it
```
$ gem install grape-starter
```

### Create a new project
```
$ grape-starter new awesome_api
```
with following options:
```
-f, --force                # overwrites existend project
-p foobar, --prefix=foobar # sets the prefix of the API (default: none)
-o sequel, --orm=sequel    # create files for the specified ORM, available: sequel, activerecord (ar) (default: none)
```
This command creates a folder named `awesome_api` containing the skeleton. With following structure:
```
├── <Standards>
├── api
│   ├── base.rb        # the main API class, all other endpoints would be mounted in it
│   ├── endpoints      # contains the endpoint file for a resource
│   │   └── root.rb    # root is always available, it exposes all routes/endpoints, disable by comment it out in base.rb
│   └── entities       # contains the entity representation of the reource, if wanted
│       └── route.rb
├── config             # base configuration
│   └── …
├── config.ru          # Rack it up
├── lib                # contains the additional lib file for a resource
│   ├── models
│   │   └── version.rb
│   └── models.rb
├── public             # for serving static files
│   └── …
├── script             # setup / server / test etc.
│   └── …
└── spec               # RSpec
    └── …
```

… using `--orm` flag adds follwing files and directories to above project structure:
```
├── .config
├── config
│   …
│   ├── database.yml
│   └── initializers
│       └── database.rb
…
├── db
│   └── migrations
…
```

Don't forget to adapt the `config/database.yml` to your needs
and also to check the Gemfile for the right gems.

In `.config` the choosen ORM would be stored.

To run it, go into awesome_api folder, start the server
```
$ cd awesome_api
$ ./script/server *port
```
the API is now accessible under: [http://localhost:9292/api/v1/root](http://localhost:9292/api/v1/root)
the documentation of it under: [http://localhost:9292/doc](http://localhost:9292/doc).

More could be found in [README](template/README.md).

### Add resources
```
$ grape-starter add foo [http methods]
```
This adds endpoint and lib file and belonging specs, and a mount entry in base.rb.

Using it with following options:
```
-e, --entity    # a grape entity file will also be created
-m, --migration # adds also a migration file, if an ORM is used
-o, --orm       # sets the parent class of libe file (e.g: `Foo < Sequel::Model` for Sequel)
```
to add CRUD endpoints for resource foo. By given http methods only this one would be generated.
For available methods see: [`Templates::Endpoints`](https://github.com/LeFnord/grape-starter/blob/d7bb6c4946dc27fcafa5a75435b45bfe2b7277f0/lib/starter/builder/templates/endpoints.rb#L7-L26).

Example:
```
grape-starter add foo post get
```
will use `post` and `get_one` to create the `post` and `get` endpoint, it would be respected, if it is the singular or plural form of it, so the plural form would look like:
```
grape-starter add foos post get
```
this will use `post`, `get_all` and `get_specific` to create the `post`, `get` and `get :id` endpoints.

If the `orm` switch `true`, the lib class would be created as child class of a specific ORM class,
so for example for Sequel, it would be wirtten: `Foo < Sequel::Model` instead of `Foo`, hereby the using ORM would be taken from the configuration, which was stored by project creation.

### Import OAPI spec [WIP]
```
$ grape-starter import path/to/spec
```
to create an API based on the spec.

### Remove a resource
```
$ grape-starter rm foo
```
to remove previous generated files for a resource.

## Contributing

Any contributions are welcome on GitHub at https://github.com/LeFnord/grape-starter.

### Adding a new ORM template

To add an new ORM, it needs following steps:

1. A template class, with predefined methods …

  ```ruby
  module Starter
    module Templates
      module <YOUR NAME>
        def model_klass
          # the class, from which self inherit, e.g. 'Sequel::Model'
        end

        def initializer
          # provide your string
        end

        def config
          # provide your string
        end

        def rakefile
          # provide your string
        end

        def gemfile
          # provide your string
        end
      end
    end
  end
  ```

  see as example [sequel.rb](lib/starter/builder/templates/sequel.rb), there the return value of each method would be written into the
  corresponding file (see: [orms.rb](lib/starter/builder/orms.rb)).

2. An additional switch in the [`Starter::Orms.build`](https://github.com/LeFnord/grape-starter/blob/ef45133e6d2254efee06ae4f17ede2fc5c06bebb/lib/starter/builder/orms.rb#L7-L18) and [`Starter::Names.lib_klass_name`](https://github.com/LeFnord/grape-starter/blob/ef45133e6d2254efee06ae4f17ede2fc5c06bebb/lib/starter/builder/names.rb#L13-L24) methods to choose the right template.
3. An entry in the description of the [`new` command](https://github.com/LeFnord/grape-starter/blob/fa62c8a2ff72f984144b2336859d3e0b397398bd/bin/grape-starter#L28), when it would be called with `-h`

## License

The gem is available as open source under the terms of the [MIT License](LICENSE).

repository: LeFnord/grape-starter

gha_language: Ruby

repo_name: LeFnord/grape-starter


text:
# bike-sharing-demand-analysis

## Objective:
To understand the factors affecting the demand for shared bikes in the American market to help us come up with a mindful business plan to be able to accelerate its revenue.

## Approach:
- Carried out multivariate statistical regression analysis to study significant variables in predicting bike sharing demand.
- Performed distplots analysis, multicollinearity check using VIF, Feature selection using RFE based on p values.

## Results:
Achieved Adjusted R2 of 0.728 with the final OLS model of only 7 input features with 95% confidence.

## Dataset Characteristics:

[Dataset](https://www.kaggle.com/gauravduttakiit/bike-sharing) have the following fields:

	- instant: record index
	- dteday : date
	- season : season (1:spring, 2:summer, 3:fall, 4:winter)
	- yr : year (0: 2018, 1:2019)
	- mnth : month ( 1 to 12)
	- holiday : weather day is a holiday or not (extracted from http://dchr.dc.gov/page/holiday-schedule)
	- weekday : day of the week
	- workingday : if day is neither weekend nor holiday is 1, otherwise is 0.
	+ weathersit :
		- 1: Clear, Few clouds, Partly cloudy, Partly cloudy
		- 2: Mist + Cloudy, Mist + Broken clouds, Mist + Few clouds, Mist
		- 3: Light Snow, Light Rain + Thunderstorm + Scattered clouds, Light Rain + Scattered clouds
		- 4: Heavy Rain + Ice Pallets + Thunderstorm + Mist, Snow + Fog
	- temp : temperature in Celsius
	- atemp: feeling temperature in Celsius
	- hum: humidity
	- windspeed: wind speed
	- casual: count of casual users
	- registered: count of registered users
	- cnt: count of total rental bikes including both casual and registered

#### License:

Use of this dataset in publications must be cited to the following publication:

[1] Fanaee-T, Hadi, and Gama, Joao, "Event labeling combining ensemble detectors and background knowledge", Progress in Artificial Intelligence (2013): pp. 1-15, Springer Berlin Heidelberg, [doi:10.1007/s13748-013-0040-3](http://dx.doi.org/10.1007/s13748-013-0040-3).

#### Contact:
For further information about this dataset please contact Hadi Fanaee-T<EMAIL_ADDRESS>

branch_name: refs/heads/main


text:
[![Build Status](https://travis-ci.org/ipatalas/ngComponentUtility.svg?branch=master)](https://travis-ci.org/ipatalas/ngComponentUtility)
[![bitHound Dependencies](https://www.bithound.io/github/ipatalas/ngComponentUtility/badges/dependencies.svg)](https://www.bithound.io/github/ipatalas/ngComponentUtility/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/ipatalas/ngComponentUtility/badges/code.svg)](https://www.bithound.io/github/ipatalas/ngComponentUtility)

# Table of contents

- [Synopsis](#synopsis)
- [Breaking changes](#breaking-changes)
	- [Upgrading from 0.2.0](#upgrading-from-020)
- [Features](#features)
	- [Intellisense](#intellisense)
		- [Controller model in views (**introduced in 0.4.0**)](#controller-model-in-views)
	- [Go To Definition](#go-to-definition)
		- [Controllers](#controllers)
		- [Templates](#templates)
	- [Find All References (**introduced in 0.5.0**)](#find-all-references)
	- [Find unused components (**introduced in 0.5.0**)](#find-unused-components-experimental)
	- [Watch file changes (**introduced in 0.6.0**)](#watch-file-changes)
- [Configuration](#configuration)
- [Commands](#commands)
- [Performance note on configuration globs](#performance-note-on-configuration-globs)
- [Changelog](#changelog)
- [Roadmap](#roadmap)

# Synopsis

This extension is a result of hackathon event done in the company we work for. We had an opportunity to invest 2 days into anything we could possibly want.
We chose to develop an extension for VS Code which would make our daily work easier. Our current project is an Angular 1.5 based web application. As Angular developers we wanted to have auto-completion for all custom components that are available in our application.
Do not hesitate to [report](https://github.com/ipatalas/ngComponentUtility/issues) any issues you may find.

## Breaking changes

### Upgrading from 0.2.0

Please note that the configuration key has been changed from `ngIntelliSense.componentGlob` to `ngComponents.componentGlobs`. Sorry for inconvenience.

# Features

## Intellisense

Given the following components in a project:
```TypeScript
angular.module('app').component('exampleComponent', {
	/* other settings */
	bindings: {
		config: '<',
		data: '<'
	}
});

angular.module('app').component('otherComponent', {
	/* other settings */
	bindings: {
		config: '<',
		data: '<'
	}
});
```

One should be able to use auto-completion like that:

![Auto-completion popup](images/component.gif)

As a result component's html code along with all bindings is added.

It can also help with the bindings themselves (will only suggest missing ones):

![Auto-completion popup](images/bindings.png)

There is now a command to refresh components cache which might be useful if you're developing components constantly and don't want to restart vscode each time.
You can trigger the command from command panel, it's called `Refresh components cache`. Alternatively you can just click the button on the status bar:

![Status bar button](images/statusbar.png)

### Controller model in views

A new feature has been introduced to make working with views easier. You can now autocomplete controller member while being in component's view like seen on the screenshot below:

![Model intellisense](images/model-intellisense.png)

Currently only one level of intellisense is available since otherwise the extension would have to scan all files in the whole project. Controller files are already scanned so it was little effort to suggest its members.
There is a plan to extend this in the future to allow more complex behavior but it requires some research first to find an optimal way of scanning whole project (and perhaps caching the results to speed up consequent startups).
For now you can use this intellisense regardless of the cursor context. It works in every place in the file even though it makes no sense in some places.
It was just much easier to implement that way. Scanning for the context would require a lot of effort and the outcome wouldn't be so much visible. It's only a tool so take care of the context yourself. It might change in future.

> **New in 0.6.0:** `Go To Definition` also works for model members

## Go To definition

You can go from html directly to either the component definition, controller or template. Just use F12 (default) or `Go To Definition` command (either from context menu or commands panel) when cursor is focused on a component in html view.
Depending on the configuration in `ngComponents.goToDefinition` specific files will show up in Go To Definition window (see screenshot below).
If there is only one file configured, let's say the template, it will go straight to this file.

### Controllers

Controllers are searched using `ngComponents.controllerGlobs` setting. They are matched against the name used in component options `controller` field.
This can be either an identifier of the class used directly or string literal specifying the name of the controller registration in Angular which basically means one can name the Angular controller differently than the class itself and this feature will still work.

### Templates

Templates are searched based on either the `templateUrl` component option field or `template` field in the same component. They are mutually exclusive and both work here. Currently supported variations are:

- `templateUrl: 'components/exampleComponent.html'`
- `template: '<div>inline html template</div>'`
- `template: require('./components/exampleComponent.html')`

In case you have different scenarios please let me know the details and I'll try to include it in next version.

![Go To Definition](images/gotodefinition.gif)

## Find All References

Finnaly it's here! A feature I've been waiting for long but never had time to implement :)

You can now use `Find All References` feature of vscode to navigate through usages of particular components. It works in all component parts: html template, controller and component itself. ~~Unfortunately currently it only works with usages found by `ngComponents.htmlGlobs` setting which should be the vast majority of components unless you use inline templates heavily which I stronly discourage to do :)~~
However there are places which do not require separate template files because they are too small, ie. angular-ui-router state definitions which possibly only contain oneliners with specific component. ~~Those usages won't be found... yet :) It's planned for next version.~~ (implemented in 0.5.1)

In HTML template cursor has to be focused on component name, not the binding or the inner html of the component for this to work:

![Find unused components](images/find-all-references-1.png)

In component definition file cursor has to be on component name:

![Find unused components](images/find-all-references-2.png)

In controller file cursor has to be on the class name:

![Find unused components](images/find-all-references-3.png)

**New in 0.7.0**

Find all references now works also for controller members, ie. they will be found in components' templates as well:

![Find unused components](images/find-all-references-4.png)

## Find unused components (experimental)

This feature will allow you to easily find components which are not used in the project.
Currently it only finds references throughout all HTML files found by `ngComponents.htmlGlobs` setting. This is still not perfect as some components may be used inside inline templates in other components. Hopefully it will be improved in next version.
Selecting one of the unused components will navigate to it in the editor.

It does understand HTML a bit so commented out parts will be taken into account. See screenshot below:

![Find unused components](images/find-unused.png)

## Watch file changes

To avoid a need to manually refresh components cache every time a change is introduced a new mechanism of file watching has been introduced. It watches all parts of the component - ie. component itself, template and controller.
Whenever one of the file is changed it should automatically rebuild the cache so that all features relying on that file should immediately reflect the changes. It will work for intellisense, Find All References, Go To Definition and the others.

It is not perfect yet and may not always work as desired. One known issue is when a project changes the branch. It sometimes loses the changes and for that case it's still better to call `Refresh Components Cache` command. For normal development it should work just fine.

# Configuration

This plugin contributes the following [settings](https://code.visualstudio.com/docs/customization/userandworkspace):

- `ngComponents.componentGlobs`: array of glob strings used to search for components. Default value is  **[\*\*/\*Component.ts]**
- `ngComponents.controllerGlobs`: array of glob strings used to search for controllers (used by `Go To Definition`). Default value is  **[\*\*/\*Component.ts]**
- `ngComponents.htmlGlobs`: array of glob strings used to search for html views (used by `Find All References`). Default value is  **[\*\*/\*Component.ts]**
- `ngComponents.routeGlobs`: array of glob strings used to search for angular-ui-router files (used by `Find All References`). Default value is  **[\*\*/\*route.ts]**
- `ngComponents.goToDefinition`: array of strings to define which files `Go To Definition` for a component should show. Allowed values are *template*, *controller*, *component*. Default value is **["template", "controller"]**
- `ngComponents.debugConsole`: boolean value to show debug information. Default value is **false**
- `ngComponents.controller.publicMembersOnly`: whether to suggest all members in view model auto complete. Default value is **true**
- `ngComponents.controller.excludedMembers`: a regular expression excluding member from view model auto completion. Default value is **^\\$** (for Angular lifecycle methods)
- `ngComponents.logging.verbose`: enable verbose logging (for troubleshooting)
- `ngComponents.logging.redirectToFile`: path to redirect logs to - needed when console is flooded with too many messages and supresses them
- `ngComponents.forceEnable`: force enable the extension if AngularJS was not detected automatically

Whenever one of the globs changes components cache is automatically rebuilt. Additionally all component files are monitored for changes and they will be reflected immediately, ie. after adding a binding you can just save the file and go straight to template file to use that binding.

# Commands

This extension contributes the following commands to the Command palette.

- `Refresh Components Cache`: refreshes components cache on demand
- `Find unused Angular components`: searches for [unused components](#find-unused-components)
- `Force enable ngComponents utility on this workspace`: see above for description of `ngComponents.forceEnable`

# Performance note on configuration globs

Please use as specific globs as possible. Parsing files is only a fraction of the whole process.
Vast majority of time is consumed on "globbing" for files to be processed so the more precise the globs are the better performance you can expect.

In my example project there are around 22k files and 3k folders. Given default glob pattern it takes slightly above a second to scan all these folders to find all component files.
Restricting the pattern to one single subfolder (ie. **subdir/\*\*/\*Component.ts**) which contains only 3k files and 500 folders it goes down to around 200-300ms on my machine being almost a second faster than the default.

The bigger the project the greater the impact so in general it is better to use multiple specific patterns rather than *one pattern to glob them all* :)

> **New in 0.7.0:** glob library has been fully replaced with built-in VSCode API to find files and it's simply much better
> No longer needs to be so specific with glob patterns - it should perform very well on default settings as well (well, it does for me)

# Changelog

Full changelog is available [here](https://github.com/ipatalas/ngComponentUtility/blob/master/CHANGELOG.md) or in the Changelog tab from within vscode itself.

# Roadmap

The following features are planned:
- ~~ability to specify multiple globs in configuration~~
- ~~**Find all references** for components in html view~~
- ~~**Go to definition** for components in html view~~
	- ~~ability to pick which file to open if possible (view, component or controller)~~
	- ~~should work for both the component and it's attributes/bindings~~
- ~~auto refresh components when they change (reload only the one that has changed)~~
- ~~refresh all when configuration changes (glob for example)~~
- ~~basic intellisense for view model used in html files (at least first level)~~
- ~~Go To Definition for view model properties/methods (at least first level)~~
- ability to add binding from component usage in html (by typing it's name and selecting "Add binding" from intellisense menu or command)
- rename component feature - update all usages
- optimize parsing files, especially when component and controller globs have common files
	- careful to clear cache after entire scan, will need refactoring on file scanner first
- feature flags to disable specific functions
- ~~rethink the way components are parsed (component config is not a JSON, might contain incompatible stuff)~~
	- ~~`controller` field does not necessarily is a string, may be a class name directly~~
	- ~~`template` field may `require` a file instead of hardcoding it in the component~~
	- make sure both TypeScript and bare JS are supported (currently we focus on TS cause it's what we use)
- add support for Angular2 (perhaps as a separate extension)

repository: ekulabuhov/ngComponentUtility

repo_name: ekulabuhov/ngComponentUtility


text:
# DBLP Playground

This repo contains some code for converting the DBLP XML dump into a PostgreSQL database, and some sample queries that can be run on this database, including those that generated the tables [here](https://johnwickerson.github.io/dblp-playground/).

## Getting started

Note: I've only tested this on my Mac. I think PostgreSQL tends to be configured a little differently on Linux.

0. System requirements: PostgreSQL (`brew install postgresql`), wget (`brew install wget`), GNU's sed (`brew install gnu-sed`).

1. Start your PostgreSQL server using `pg_ctl -D /opt/homebrew/var/postgres start`. There are further instructions about getting started with PostgreSQL on [this webpage](https://www.robinwieruch.de/postgres-sql-macos-setup).

2. Run `make`. This downloads the DBLP XML dump from `http://dblp.org/xml/dblp.xml.gz`, unzips it into `dblp.xml`, and then converts it into a PostgreSQL database. Caution: the DBLP XML dump is quite a large file, and converting it into a database took me about half an hour.

3. Run `make myqueries`. See the Makefile for the gory details.

## Credits

My code is adapted from some code I found on [this website](http://agdb.informatik.uni-bremen.de/dblp/statistics.php). Unfortunately I can't find any names of people to credit. My SQL queries are hodge-podge of snippets pasted from StackOverflow.

license: Unlicense

repository: johnwickerson/dblp-playground

repo_name: johnwickerson/dblp-playground


text:
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![codecov](https://codecov.io/gh/itmayziii/gatsby-plugin-no-javascript/branch/master/graph/badge.svg)](https://codecov.io/gh/itmayziii/gatsby-plugin-no-javascript)

# gatsby-plugin-no-javascript

Removes all javascript files created by Gatsby from the static HTML files. This plugin does **NOT** remove all javascript, but only the
javascript that Gatsby is adding to the page.

:warning: The Gatsby javascript is only removed from the production build `gatsby build` and not during the dev build `gatsby develop`.
If you do not write any state logic or event handlers then this should not effect you. This feature may be something this plugin wants to
tackle in the future.

## How to install

`npm install gatsby-plugin-no-javascript` or `yarn add gatsby-plugin-no-javascript`

:warning: This plugin should be included last in your `gatsby-config.js` as it relies on [onPreRenderHTML](https://www.gatsbyjs.org/docs/ssr-apis/#onPreRenderHTML)
`replaceHeadComponents` and `replacePostBodyComponents`.

## Available options

* `excludeFiles`: `string (optional)`
    * Will be used as a regular expression to test whether or not a Gatsby javascript file should be excluded by this plugin. The default
      behavior is that all Gatsby javascript files are removed by this plugin, so this option gives you a chance to "exclude them from being
      excluded :sweat_smile:".
    * A use case for this option is to not remove the webpack-runtime.js file that Gatsby ships by default in case you have other javascript
      that relies on that runtime.
    * :warning: Make sure you enter a string 'a-string' instead of JS regexp like `/a-string/`, Gatsby has trouble handing off regular
      expressions to plugins. The string you pass in will be handled as a regular expression for you.

* `excludePaths`: `string (optional)`
    * An array of paths that are to be excluded from removing all the JS. The code runs a "contains" so this can be used to block a
      directory and all subdirectories, or to get as specific as you want.

## When do I use this plugin?

Use this plugin if you want to remove the javascript that comes out of the box with Gatsby. This is useful if your site is truly a static
site with no interactivity or maybe the interactivity is handled by different javascript than your React components.

## Examples of usage

```javascript
module.exports = {
  siteMetadata: {
    title: 'Budget Dumpster',
    description: 'Budget Dumpster specializes in local dumpster rentals for homeowners and contractors alike. Call us to rent a dumpster in your area.'
  },
  plugins: [
    'gatsby-plugin-react-helmet',
    'gatsby-plugin-remove-trailing-slashes',
    'gatsby-plugin-postcss',
    'gatsby-plugin-react-svg',
    {
      resolve: `gatsby-plugin-google-tagmanager`,
      options: {
        id: process.env.GATSBY_GTM_ID,
        includeInDevelopment: true
      }
    },
    'gatsby-plugin-no-javascript' // <-- Here is the plugin, make sure it is included last in the plugins array.
  ]
}
```

## Upgrade Guide v1 -> v2
* Update the `exclude` pluginOption to `excludeFiles` in your gatsby-config file. The value passed in is exactly the same as it was before.

## How to run tests
`npm run test`

### Node versions
We also test against the [minimum supported Node version of Gatsby](https://www.gatsbyjs.org/docs/upgrading-node-js/#gatsbys-nodejs-support-policy) up
to the latest version during each pull request to make sure the code will work for all supported NodeJS versions. You can find this configuration in the
[Cloud Build config file](cloudbuild.yaml).

## How to develop locally

This project relies on Typescript for all the type safety goodness which can be found in the `src` directory. The compiled output goes
directly into the root of the project because Gatsby expects [certain files](https://www.gatsbyjs.org/docs/files-gatsby-looks-for-in-a-plugin/)
to be in the root.

### Dev workflow

1. Get the latest updates `npm install`.
2. Run `npm run watch` to tell Typescript to listen to changes in the `src` directory and recompile on the fly.
3. Link this package to an actual gatsby project to test the plugin working, there is a good article for this
[here](https://medium.com/@the1mills/how-to-test-your-npm-module-without-publishing-it-every-5-minutes-1c4cb4b369be).

## How to contribute
See the [contributing docs](CONTRIBUTING.md)

### Code of conduct
See the [code of conduct](CODE_OF_CONDUCT.md)

repository: FraserMuir/gatsby-plugin-no-javascript

repo_name: FraserMuir/gatsby-plugin-no-javascript


text:
Fields
========

Fields are used for data operating by models. Fields are python `Descriptors`. When you get a field, it reads
some value from dict data by a key, and transform it in some python object. When you set field, it transform a value into
simple type and writes it out into the dict data.

**DateTime example:**

We have dict with date in ISO format, which came from web.

```json
{"date": "1981-02-21"}
```
We want to compare this date with some other date generated in python. We cant just compare string and python datetime format.
We must convert date into python datetime for comparison, and into string when we want to send this date to the web.

```python
from datetime import datetime

expected_datetime = datetime(year=1981, day=21, month=2)
actual_datetime = {"date": "1981-02-21"}["date"]

print(expected_datetime == actual_datetime)
```

Fields can do this on the fly.

``` python
from datetime import datetime
from arsenalqa.fields import Field, DateTimeField
from arsenalqa.models import Model

class DateTimeExample(Model):

    date = DateTimeField(fmt='%Y-%m-%d')  # fmt - datetime format mask for saving

expected_datetime = DateTimeExample()
expected_datetime.date = datetime(year=1981, day=21, month=2)

actual_datetime = DateTimeExample.wrap({"date": "1981-02-21"})

print(expected_datetime.date == actual_datetime.date)  # True
```

Lets look inside:

``` python
datetime_model = DateTimeExample()
print(datetime_model.data)  # data of our model is empty. Lets add datetime

datetime_model.date = datetime.now()  # create datetime and set it to field date
print(datetime_model.data)  # descriptor DateTimeField converts datetime in str type and saves it into data
print(datetime_model.date)  # get field from data converts field in python datetime
print(type(datetime_model.data['date']))
print(type(datetime_model.date))
```

**ModelField and ListModelField**

We can make entities relations in deep by models.

``` json

{
    "id": 1,
    "logo":
        {
            "icon": "icon.png",
            "background": "background.png"
        },
    "countries":[
        {"code": "ru", "currency": "rub"},
        {"code": "eu", "currency": "eur"},
        {"code": "by", "currency": "byn"},
    ]
}
```
In this case `logo` is submodel, and countries is submodels list of User model

``` python
from arsenalqa.fields import Field, ModelField, ListModelField
from arsenalqa.models import Model

class Logo(Model):
    icon = Field()
    background = Field()

class Country(Model):

    code = Field()
    currency = Field()

class User(Model):
    id = Field()
    logo = ModelField(Logo)
    countries = ListModelField(Country)
```

We have wrote all models for this case. Main model is User. Logo and Country are submodels of our model.

Lets fill this model by our dict.

``` python
user = User.wrap({
    "id": 1,
    "logo":
        {
            "icon": "icon.png",
            "background": "background.png"
        },
    "countries":[
        {"code": "ru", "currency": "rub"},
        {"code": "eu", "currency": "eur"},
        {"code": "by", "currency": "byn"},
    ]
})

print(user)
print(user.logo.icon)

print(user.countries.unique_by_attrs(code="ru").currency)  # This string filters one submodel from countries list and gets country currency

new_country = Country()
new_country.code = 'us'
new_country.currency = 'usd'
user.countries.append(new_country)
print(user.countries)  # New country in countries list
```


text:
# Deployment

## Servers

Represent and [openparliament.ca](https://openparliament.ca/) currently share two: a large dedicated server, `alpheus`, and a smaller virtual server, `tempeh`. The servers are configured identically, except that PostgreSQL on `tempeh` has streaming replication set up with `alpheus` (meaning that the Represent database on `tempeh` is read-only). If `alpheus` goes down, Represent fails over to `tempeh` ([see below](#dns)). The servers run Nginx, PostgreSQL 9.6, PostGIS 2.3, and Memcached.

This directory contains some server configuration files.

The `represent` user's directory contains:

* `app/`: a clone of [represent-canada](https://github.com/opennorth/represent-canada/)
* `app/represent/settings.py`: a copy of `settings.py.example` with appropriate changes
* `app/data/shapefiles/public`: a symlink to a clone of `represent-canada-data`
* `app/data/shapefiles/private`: a symlink to a clone of `represent-canada-private-data`
* `logs/`: Gunicorn and Nginx log files
* `ssl/`: public key certificates
* a clone of [represent-canada-data](https://github.com/opennorth/represent-canada-data/)
* a clone of `represent-canada-private-data`
* `represent-env/`: a Python 3.5 virtualenv

The `represent` user's crontab contains:

```
<EMAIL_ADDRESS>0 4 * * * /home/represent/.virtualenvs/app35/bin/python /home/represent/app/manage.py updaterepresentatives
```

### Adding a maintainer

Add the maintainer's public key to `represent`'s `.ssh/authorized_keys` on `alpheus` and `tempeh`

### Running Fabric commands

It's generally unnecessary to login to servers, as regular tasks can be done with Fabric. See `fabfile.py` for details.

    brew install Fabric

The two most common tasks are to deploy code and update boundaries.

Run `fab alpheus deploy` to update the deployment; occasionally, update the deployment on `tempeh` (`fab tempeh deploy`).

Run `fab alpheus update_boundaries` to update the boundaries. You can pass arguments like:

    fab alpheus update_boundaries:args="--merge union -d data/shapefiles/public/boundaries/ocd-division/country:ca/2013"

## DNS

`opennorth.ca` has a hosted zone and health check in [AWS Route 53](https://console.aws.amazon.com/route53/home?region=us-east-1#). Notably:

* `represent-alpheus.opennorth.ca.` aliases `alpheus.opennorth.ca.`
* `represent-tempeh.opennorth.ca.` aliases `tempeh.opennorth.ca.`
* `represent.opennorth.ca.` aliases `represent-alpheus.opennorth.ca.`
  * TTL: 60, Routing Policy: Failover, Failover Record Type: Primary
* `represent.opennorth.ca.` aliases `represent-tempeh.opennorth.ca.`
  * TTL: 60, Routing Policy: Failover, Failover Record Type: Secondary

A health check named `represent-alpheus.opennorth.ca` monitors an endpoint specified by domain name using the HTTP protocol. The domain name is `represent-alpheus.opennorth.ca` and the port is `80`.

repository: opennorth/represent-canada

repo_name: opennorth/represent-canada


text:
## 0.8.1 / 2021-08-13

* Version 0.8.0 fixed a bug with newer versions of nokogiri, however due to the way this fix works it breaks compatability with
  older versions so we now added `'nokogiri', '~> 1.11'` as dependency
* Update gemspec

## 0.8.0 / 2021-08-12

### WARNING: COMPATABILITY (see 0.8.1)
* [Fix](https://github.com/digidentity/xmlmapper/pull/2) missing namespace when adding a child

## 0.7.0

* Set xml_value with a non canonicalized version

## 0.5.9 / 2014-02-18

* Correctly output boolean element value 'false'  (confusion)

## 0.5.8 / 2013-10-12

* Allow child elements to remove their parent's namespacing (dcarneiro)
* has_many elements were returning nil because the tag name was being ignored (haarts)
* Subclassed xmlmapper classes are allowed to override elements (benoist)
* Attributes on elements with dashes will properly created methods (alex-klepa)
* 'Embedded' attributes break parsing when parent element is not present (geoffwa)

## 0.5.7 / 2012-10-29

## 0.5.6 / 2012-10-29

* Add possibility to give a configuration block to Nokogiri when parsing (DieboldInc).

## 0.5.5 / 2012-09-30

* Fix for Boolean attributes to ensure that they parse correctly (zrob)

## 0.5.4/ 2012-09-25

* the #wrap method allows you to better model xml content that is buried deep
  within the xml. This implementation addresses issues with calling #to_xml
  with content that was parsed from an xpath. (zrob)

* Parent XmlMapper classes may dictate the name of the tag for the child
  XmlMapper instances. (zrob)

## 0.5.3/ 2012-09-23

* String is the default type for parsed fields. (crv)
* Update the attributes of an existing XmlMapper instance with new XML (benoist)

repository: digidentity/xmlmapper

repo_name: digidentity/xmlmapper


text:
---
title: Pondering
author: Kerim
layout: post
permalink: /archives/2004/01/03/pondering/
dsq_thread_id:
  - 825169185
categories:
  - Unfiled (oops!)
---
Announcing, the Keywords **“Pinky and the Brain” Competition.**

> Cheney: “George, are you pondering what I’m pondering?”
>
> Bush: “Wuh, I think so, Brain Dick, but…”

Complete Bush’s sentence!

Use the comments to submit your entries.

For those who don’t know the show, Pinky and the Brain are lab mice who escape their lab every night in an effort to take over the world. While “the Brain” is always pondering some method of taking over the world, his sidekick, Pinky, is usually pondering something along the lines of:

> “Uh… yeah, Brain, but where are we going to find rubber pants our size?”

Here is the original list to inspire you.

repository: kerim/keywords

repo_name: kerim/keywords


text:
### [CVE-2018-1354](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1354)
![](https://img.shields.io/static/v1?label=Product&message=Fortinet%20FortiManager%2C%20FortiAnalyzer&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=Improper%20Access%20Control&color=brighgreen)

### Description

An improper access control vulnerability in Fortinet FortiManager 6.0.0, 5.6.5 and below versions, FortiAnalyzer 6.0.0, 5.6.5 and below versions allows a regular user edit the avatar picture of other users with arbitrary content.

### POC

#### Reference
- https://fortiguard.com/advisory/FG-IR-18-014

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

repo_name: trickest/cve


text:
# Spidey

[![Build status](https://ci.appveyor.com/api/projects/status/0derh6adccmnc8py?svg=true)](https://ci.appveyor.com/project/JaCraig/spidey)

Library to help with crawling web content. Compatible with .Net Core and .Net Framework.

 In order for this to work, you must do the following at startup:

    new ServiceCollection().AddCanisterModules();

The AddCanisterModules function is an extension method that registers it with the IoC container. When this is done, Spidey is ready to use.

## Basic Usage

Spidey really boils down to using one class called Crawler:

    ServiceCollection.AddSingleton(new Options
				{
				    ItemFound = FoundFile=>{}                                            //The callback method used when a new page is discovered.
				    Allow = new List<string> { "http://mywebsite", "http://mywebsite2" },    //Regexes of what sites/pages are allowed to be crawled.
				    FollowOnly = new List<string> { "..." },                                 //Regexes of pages to only follow links that are found on them.
				    Ignore = new List<string> { "..." },                                     //Regexes that the system will ignore when they are encountered.
				    StartLocations = new List<string> { "http://mywebsite", "http://mywebsite2" },    //Starting URLs for the crawler.
				    UrlReplacements = new Dictionary<string,string> {...}                    //When the system hits one of the keys in the dictionary, it will replace it with the value.
				});

Note that it is recommended that you actually register the Options object in your ServiceCollection and resolve the Crawler object from the service provider but it is not required. You can simply new up an instance of Crawler if you want. Anyway, the Options class has a number of properties, some of which are not displayed above such as NetworkCredentials, UseDefaultCredentials, and Proxy. The callback method is what will be called by the system once a link's info has been received and looks like this:

    void CallbackMethod(ResultFile obj) { ... }

The library will handle parsing of links found within the page, downloading the content, etc. for the most part. At this point all you have to do is call the StartCrawl method:

    MyCrawler.StartCrawl();

## Customization

Note that it's possible to customize the crawler's various parts. The system is divided into the following sections:

1. Content Parser (IContentParser) - This parses the resulting data and converts it to the ResultFile object.
2. Engine (IEngine) - This downloads the content from the server.
3. Link Discoverer (ILinkDiscoverer) - Takes the content from the engine and looks for links to other resources.
4. Processor (IProcessor) - Takes the parsed content and hands it off to your code. The default one simply calls the method provided in the options.
5. Scheduler (IScheduler) - Handles handing out work to the various workers.
6. Pipeline (IPipeline) - Manages the various parts of the process by feeding the content to the next bit of the process.

These subsystems all implement interfaces found in the Spidey.Engines.Interfaces namespace. In order to replace the default in any of these systems all you need to do is create a class that implements the interface that you want to replace. After that the system will automatically pick it up if resolved from the service provider. If you, instead, new up a Crawler object then you will need to compose the Pipeline object.

## Installation

The library is available via Nuget with the package name "Spidey". To install it run the following command in the Package Manager Console:

Install-Package Spidey

## FAQ

1. Is it possible to run the crawler using multiple nodes?

The default scheduler assumes that you are only running the crawler from one location and doesn't talk to other instances of the application. But it is possible to replace the scheduler with one that will talk via some mechanism like a database to coordinate work between instances and is recommended for more complex setups.

## Build Process

In order to build the library you will require the following:

1. Visual Studio 2019

Other than that, just clone the project and you should be able to load the solution and build without too much effort.

repository: JaCraig/Spidey

gha_language: C#

repo_name: JaCraig/Spidey


text:
---
description: A handle to an asset and the handle to where it will be moved.
seo-description: A handle to an asset and the handle to where it will be moved.
seo-title: AssetMove
solution: Experience Manager
title: AssetMove
topic: Scene7 Image Production System API
uuid: 71335886-efe7-4565-a088-769bcbe7abaf
---

# AssetMove{#assetmove}

A handle to an asset and the handle to where it will be moved.

 Syntax

## Parameters {#section-3cf94fa46d3848729dc841b123a1cea7}

|  Name  | Type  | Description  |
|---|---|---|
|  ` *`assetHandle`*`  | `xsd:string`  | The handle to the asset you want to move.  |
|  ` *`folderHandle`*`  | `xsd:string`  | The handle to the destination folder.  |


text:
# articlebase

a relatively small [Sails v1](https://sailsjs.com) application project from
https://www.youtube.com/watch?v=AmjiDC_JUt4&list=PLillGF-RfqbZIA-9sI3T1uu7d7_CtbwPm

### Links

+ [Sails framework documentation](https://sailsjs.com/documentation)
+ [Version notes / upgrading](https://sailsjs.com/documentation/upgrading)
+ [Deployment tips](https://sailsjs.com/documentation/concepts/deployment)
+ [Community support options](https://sailsjs.com/support)
+ [Professional / enterprise options](https://sailsjs.com/enterprise)

# Setup

1. run `npm install`

2. Setup your datastore connection in `config/datastores.js`, and that's it, I was using MySQL
so that's why you will see the entry at `Package.json`

# Screenshots

![Home](https://i.imgur.com/UNnliK7.png)
___
![Editing](https://i.imgur.com/XWKrR72.png)
___
![Article Details](https://i.imgur.com/lE73u8O.png)
___

repository: AxDSan/ArticleBase

repo_name: AxDSan/ArticleBase


text:
# LaravelAPIBoilerplateJWT

An API Boilerplate to create a ready-to-use REST API in seconds with Laravel 8.x

## Install with Composer

```
    $ curl -s http://getcomposer.org/installer | php
    $ php composer.phar install or composer install
```

## Set Environment

```
    $ cp .env.example .env
```

## Set the application key

```
   $ php artisan key:generate
```

## Generate jwt secret key

```
    $ php artisan jwt:secret
```

## Run Migrations
```
    $ php artisan migrate
```

## Run seeder
```
    $ php artisan db:seed
```

## Level of User
```
   When you run seeder, There are three level of user determined by their roles; the admin, photographer and the user(product owner)
```

## User Registration with Curl

```
    $ curl  -H 'content-type: application/json' -H 'Accept: application/json' -v -X POST -d '{"full_name":"thomas", "username":"thomas123", "email":"admin@laravel.com","password":"secret", "role_id":"1"}' http://<IP_ADDRESS>:8000/api/register
```

## User Authentication with Curl

```
    $ curl  -H 'content-type: application/json' -H 'Accept: application/json' -v -X POST -d '{"email":"admin@laravel.com","password":"secret"}' http://<IP_ADDRESS>:8000/api/login
```

## Get the logged in user with Curl

```
    $ curl  -H 'content-type: application/json' -H 'Accept: application/json'  -v -X GET http://<IP_ADDRESS>:8000/api/me?token=[:token]
```

## User Logout with curl

```
    $ curl  -H 'content-type: application/json' -H 'Accept: application/json' -v -X GET http://<IP_ADDRESS>:8000/api/logout?token=[:token]

```

## Refresh token with curl

```
    $ curl  -H 'content-type: application/json' -H 'Accept: application/json' -v -X GET http://<IP_ADDRESS>:8000/api/refresh?token=[:token]

```

## User Forgot Password with Curl

```
    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v POST -d '{"email"<EMAIL_ADDRESS>http://<IP_ADDRESS>:8000/api/forgot
```

## User Change Password with Curl

```
    $ curl -H 'content-type: application/json' -H 'Accept: application/json' -v POST -d '{"email"<EMAIL_ADDRESS>"password": "secret"}' http://<IP_ADDRESS>:8000/api/change?token=[:token]
```

```
    Api collection is attached to the project
```

repository: adamsmithtee/corderbyte-challenge

repo_name: adamsmithtee/corderbyte-challenge


text:
# Colossus Network Module

This module is the base Colossus Network implementation for Google Cloud.

## Resources

### `google_dns_managed_zone.public`

The public hosted zone for the network.

#### Resource Outputs

 - `id`: the unique ID for this resource
 - `name_servers[]`: a list of Google nameservers for this public hosted zone.

### `google_compute_network.default`

The network itself.

#### Resource Outputs

 - `gateway_ipv4`: the IPv4 address of the default gateway for the network.
 - `name`: the unique name of the network.
 - `self_link`: the unique VPC identifier.

### `google_compute_route.public`

The default public route to the internet for instances in the DMZ layer.

#### Resource Outputs

 - `self_link`: the unique route identifier.

repository: asmtal/titan

repo_name: asmtal/titan


text:
# krud

krud is a kubernetes rolling-update service for use with docker registry webhook pushes.

For example, when you push a new image to Quay.io, you can configure a HTTP POST webhook.
When krud gets the webhook, it does a rolling update of a kubernetes replication controller (almost identical to `kubectl rolling-update`).
krud can run in a separate kubernetes service along side your other services.

**WARNING**: krud is an early product. It has no authentication, can easily be DDoS'd, and is not widely tested. It is open source so we can improve it and remove this message in the future.

# Usage

Configure the webhook to connect to `/push` at the address it's running, for example: `http://krud.company.com/push`.

A bad UI exists at `/` showing status of past update attempts.

# Configuration

The following environment variables are used to configure krud:

Required:

- `KRUD_CONTROLLER_NAME`: name of the replication controller to update

Optional:

- `KRUD_DEPLOYMENT_KEY`: key to use to differentiate between two different controllers; defaults to `deployment`
- `KRUD_K8S_ENDPOINT`: kubernetes endpoint; defaults to `http://localhost:8080`
- `KRUD_LISTEN`: listen address; defaults to `:9500`
- `KRUD_NAMESPACE`: namespace of the replication controller; defaults to the kubernetes default

These options can also be specified on the command line. See `krud -help` for usage.

# Supported Registries

- [Docker Hub](https://hub.docker.com/)
- [Quay.io](https://quay.io)

# Running on kubernetes

There are example `rc.yaml` and `svc.yaml` files.
The only required change is setting the `KRUD_CONTROLLER_NAME` environment variable in `rc.yaml`.

repository: UNIVERSAL-IT-SYSTEMS/krud

repo_name: UNIVERSAL-IT-SYSTEMS/krud


text:
---
title: defer
toc: false
---

# `defer`

This is a shortcut for creating a streaming/deferred response. It assumes you are using `utf-8` encoding. From a developer perspective it behaves just like [`json()`][json], but with the ability to transport promises to your UI components.

```tsx lines=[1,7-10]
import { defer } from "@remix-run/node"; // or cloudflare/deno

export const loader = async () => {
  const aStillRunningPromise = loadSlowDataAsync();

  // So you can write this without awaiting the promise:
  return defer({
    critical: "data",
    slowPromise: aStillRunningPromise,
  });
};
```

You can also pass a status code and headers:

```tsx lines=[9-14]
export const loader = async () => {
  const aStillRunningPromise = loadSlowDataAsync();

  return defer(
    {
      critical: "data",
      slowPromise: aStillRunningPromise,
    },
    {
      status: 418,
      headers: {
        "Cache-Control": "no-store",
      },
    }
  );
};
```

[json]: ./json


text:
---
title: Setting up autoconf and automake for Phoenix2D
slug: setting-up-autoconf-and-automake-for-phoenix2d
date_published: 2014-03-27T18:24:57.546Z
date_updated:   2015-07-24T13:23:15.987Z
tags: Phoenix2D, autotools, programming
---

If there is one thing I hate doing with fervor, pure hatred, and cold sweat running through my spine, is *makefiles*. The first makefile I did was for a simple library, app, and testing project, it took me an entire day of reading best practices, which are kind of non existent, [the makefile manual](http://www.gnu.org/software/make/manual/make.html), and a lot of diet coke.

What I feel, and what I'm saying, it is not something new. Someone, or some people to be exact have suffered through this just like I have. Don't believe me?

The proof is in Autoconf and Automake.  Now I did used once [cmake](http://www.cmake.org/cmake/help/cmake_tutorial.html) and considered using [scons](http://www.scons.org/) [for a build system] but I feel like I have to sell the idea to myself and then to others, so for now let's go all standard on the project.

```language-bash
.
+-- base                    // home folder
|   +-- phoenix2d-{version} // the lib
|   |   +-- phoenix2d       // master folder
|   +-- player              // app example
```
That is the structure of the project, in the libs master folder we'll be placing different modules, right now the content looks like this.

```language-bash
.
+-- phoenix2d           // master folder
|   +-- autom4te.cache  // autoconf m4 files
|   +-- build   // for testing the build system
|   +-- communications  // a module
|   |   +-- *.h         // CODE
|   |   +-- *.cpp       // CODE
|   |   +-- Makefile.am // Make rules
|   |   +-- Makefile.in // Make rules
|   +-- config          // app example
|   +-- doc             // doxygen settings
|   +-- m4              // autoconf m4 files
|   +-- aclocal.m4
|   +-- AUTHORS
|   +-- autogen.sh
|   +-- ChangeLog
|   +-- communications.hpp      // important
|   +-- communications.hpp.in
|   +-- communications.hpp.in~
|   +-- configure
|   +-- configure.ac            // important
|   +-- configure.scan
|   +-- COPYING
|   +-- INSTALL
|   +-- Makefile.am             // important
|   +-- Makefile.in
|   +-- NEWS
|   +-- README
```

Now that I'm writing this, I feel some changes will be necessary, since this could easily populate with a lot of folders maybe I should add everything to a **lib** folder just like the boost guys.

###The communications module

This is the first module and the first feature we have to maintain, which is the parsing and sending data to the server. I don't know, maybe I should split it to a **parsing** module and the **communications** leave it for sockets.

This module as of March 2014 has a lot of code that doesn't belong there, such as the pde_engine which will most likely be another module.

The [official site for the repository is here](https://github.com/ivanGzz/Phoenix2D) but I maintain a [personal copy here](https://github.com/claudiordgz/Phoenix2D) mostly for development purposes.

Some changes will be necessary on the code to add better threading support, since as of right now accessing shared variables is not multi threaded supported.

Expect big changes.

###How to setup your own autoconf

Essentially I had to build 3 files using autoscan and autoreconf. The autogen.sh is just a tool for running autoreconf.

```language-bash
#!/bin/sh
autoreconf --force --install -I m4
```

####The configure.ac file

I added a **communications.hpp** file that includes all the files in the module. This system will likely get replicated for the subsequent modules.

Most of what's here is generated by *autoscan*, I just added some include and src files.

```language-makefile
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AM_INIT_AUTOMAKE([-Wall])

# Checks for programs.
AC_LANG(C++)
AC_PROG_CXX
AC_PROG_CC

# Checks for libraries.
LT_INIT

# Check for Boost libraries
# We need the regex headers
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([boost/regex.hpp], [],
    [AC_MSG_ERROR(You need the Boost libraries.)])
AC_LANG_POP([C++])

AC_SUBST([PHOENIX_API_VERSION], [0.1])

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h netdb.h string.h sys/socket.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_SIZE_T

# Checks for library functions.


text:
slogo
=====

Provides a development environment that supports users to write SLogo programs.

=======
Jack Baskin, Rahul Harikrishnan, Duke Kim, Petra Ronald, $cotty $haw

Start Date: September 29

Finish Date: October 26

Estimated Work Hours: 600

Responsibilities
=======

Jack: Frontend, interaction with controller

Petra: Frontend, frontend design, GUI, buttons, grids, command history, Turtle, frontend refactoring

Duke: Backend/Middle, containers, gateways, controller, ControlCommands, VariableCommands, JUnit tests, recursive parsing, resource bundles, overall design

Rahul: Backend/Middle, save/load, controller, ViewCommands, TurtleCommands, ControlCommands, JUnit tests, middle design, translators

Scotty: Backend/Middle, parser, factories, command hierarchies, ExpressionCommands, linguistics, JUnit tests, backend and middle design

Resources
=======
Dr. Duvall, Cody Lieu

Start File: Slogo.java (View package)

Resource Files: The entire resources package

Important Information
=======
The user may type in commands or click on buttons to interact with the program. There is the ability to add extra grids and turtles under the Add option. There are also options for changing the background, the pen, the languages, etc. The frontend also allows keyboard interactions. With the backend, the user to add and create turtles, commands, etc.

Problems
=======
We were not able to maintain our original design and therefore have some blurring of the frontend and backend. Our powerful middle does help separate the two, but some aspects of the design, such as the location of the turtle (originally in the backend as a model), changed during the last week of the project.

Redeeming Qualities and Extra Features
=======
Our project is anchored by a powerful reflective middle, which consists of the parser, the translators, the factories, the gateways, the containers, and the controller. They work to convert the user input into commands that allow the user to interact with the program.

The parser breaks down the user input, including valid examples in which commands may be freely substituted in place of arguments of a command, into separate words. The translators then convert the words into keys that correspond to command classes so the factories can build the command objects recursively. This process relies on a strong command hierarchy designed early in the project and maintained in essence throughout the implementation of SLOGO.

The gateways hold all the information related to the backend of the program. Most of this information is required for commands. The gateways also limit information access in the extending commands to minimize the risks of errors. Method command execution can remain general, and data access is streamlined to ideally limit repeated data. The containers unify all containers (turtles, grids, variables) to one specific type. This allows the extension of methods in the interface that share behavior and maintain a sense of scope in the “active” and “inactive” regardless of turtles, grids, variables, etc. Our controller handles communication between the frontend and backend. It also checks for errors, allows the saving and loading of files, and throws exceptions that may arise. In short, it acts as the brain of our program.

Our JUnit tests show that our commands are all functioning correctly, and much of that owes credit to our robust command hierarchy design. This very simply and nearly organizes all commands, including future additions. Finally, our additional linguistic translations can help expand SLOGO to many others around the world, if the user chooses to.

Impressions
=======
Peer programming was extremely useful throughout this project. Communication was also extremely important. Much of the divergence and later issues during our implementation resulted from not working, or at least not communicating, as a team. Increased interaction and communication did, however, build stronger team chemistry.

Design Document
=======
Our Design Document for Cell Society has been added as a PDF named “PartOnePlan.pdf" to the src folder. It has not been altered since its original submission, so any current information at the time of submitting the entire Cell Society project will be found above in this README.

repository: thefreshduke/slogo

repo_name: thefreshduke/slogo


text:
# HTTP error classes

[![Node.js CI](https://github.com/tlaanemaa/http-error-classes/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/tlaanemaa/http-error-classes/actions/workflows/node.js.yml)

This package provides error classes for every HTTP 4xx and 5xx error code. This makes it easy to throw HTTP errors in your application without having to build the classes yourself for that, just a small win.

You can also check if an error is a HttpError by checking if it's an instance of the `HttpError` class from this package, all errors here extend that class.

The error classes allow you to provide a message and a context object, status codes are built into the errors. You can also just use the `HttpError` class to provide your own status code.

## Example

### Throwing an error with some context

Here we have a function to calculate the Fibonacci value at `n` steps. If the `n` we receive is not a number then we'll throw a `BadRequestError` and give the `n` we received as context.

```js
const { BadRequestError } = require("http-error-classes");

const fibonacci = (n) => {
  if (typeof n !== "number") {
    throw new BadRequestError("n must be a number!", { n });
  }
  // Calculate fibonacci
};
```

### Filtering for HttpErrors

Here we have an express error middleware that handles how errors get returned to the client. We don't want to expose errors that are not HttpErrors, so we mask them with a generic `InternalServerError`. It's also important to explicitly map the error to the returned object because HttpErrors, like regular Errors, contain the stack trace which should not be exposed.

```js
const { HttpError, InternalServerError } = require("http-error-classes");

const errorHandlerMiddleware = (err, req, res, next) => {
  const error = err instanceof HttpError ? err : new InternalServerError();
  res.status(error.status).send({
    message: error.message,
    context: error.context,
  });
};
```

## API

### `HttpError`

```ts
declare class HttpError<ContextType> extends Error {
  readonly status: number;
  readonly message: string;
  readonly context?: ContextType | undefined;
  readonly name: string;
  readonly statusCode: number;

  constructor(
    status: number,
    message: string,
    context?: ContextType | undefined = undefined
  );
}
```

### Any other error, for example `BadRequestError`

```ts
declare class BadRequestError<ContextType> extends HttpError<ContextType> {
  readonly message: string;
  readonly context?: ContextType | undefined;
  readonly name = "BadRequestError";

  constructor(
    message?: string = "Bad Request",
    context?: ContextType | undefined = undefined
  );
}
```

repository: tlaanemaa/http-error-classes

repo_name: tlaanemaa/http-error-classes


text:
---
layout: single
title: WWDC Sessions, and `UIResponder textInputContextIdentifier`
date: 2017-06-13 17:54:54
tags: [iOS, apple, documentation, UIKit, WWDC, WWDC17]
published: true
---

I love WWDC. The new announcements are thrilling, new APIs are fantastic, the sessions are incredibly useful, and the access to Apple engineers is unmatched.

I also find it frustrating, primarily because it only happens once a year and some of the best content is locked inside of videos. I'm particularly discouraged when a session covers APIs from a previous year and it's the **only** place that information is available.

A shining example: I've never found the official documentation that clearly delineates the constraint, layout, and draw lifecycle of views and view controllers. I have definitely watched (several times!) the WWDC session where an Apple engineer explains it, with diagrams and examples, tying together methods like the three `UIView.setNeeds...`, `UIViewController.view{Will,Did}LayoutSubviews`, `UIView.drawRect` (etc, etc), along with the order that the view hierarchy is traversed for constraints, layout, and drawing (it's not the same!). It was one of the early AutoLayout presentations. For a long time I had the lifecycle transcribed onto a whiteboard in my cube, both for myself and for explaining to coworkers. I don't have that whiteboard anymore, maybe I'll blog about it.

I know that [ASCIIwwdc](http://asciiwwdc.com) exists, and I love that it does. However I rarely, if ever, see it as a result in my Google searches. So I still consider WWDC video content essentially invisible.

# UIResponder textInputContextIdentifier

[The Keys to a Better Text Input Experience](https://developer.apple.com/videos/play/wwdc2017/242/) has a section explaining [`UIResponder.textInputContextIdentifier`](https://developer.apple.com/documentation/uikit/uiresponder/1621091-textinputcontextidentifier). But first, here is what the documentation currently says about this API that's been available since iOS 7:

> An identifier signifying that the responder should preserve its text input mode information.

> If you redefine this property and return a string value, UIKit tracks the current text input mode for the responder. While in tracking mode, any programmatic changes you make to the text input mode are remembered and restored whenever the responder becomes active.

Now, contrast that with the contents of one of the slides presented by Shuchen Li during the session, particularly the comment:

```
class ConversationViewController: UITableViewController, UITextViewDelegate {
    // ... other code ...
    override var textInputContextIdentifier: String? {
        // Returning some unique identifier here allows the keyboard to remember
        // which language the user was typing in when they were last communicating
        // with this person.
        // It can be anything, as long as it's unique to each
        // recipient (here we're just returning the name)
        return self.conversation?.otherParticipant
}
    // ... other code ...
}
```

She previously described the use case: the user wants to use an English keyboard for messaging their coworkers and a Chinese keyboard for communicating with their family.

I honestly think I could end this post right now, and my point would be made.

I had no idea this existed. Even if I thought it might exist, this property doesn't seem like the right one after reading the documentation. After the session, I looked around the internet for `textInputContextIdentifier`, and this is what I found:

* Google: on the first page there are links to the documentation for the property, headers for UIResponder containing the property declaration, a single StackOverflow result, and a tweet from @viticci that was *replied to* with information about it.
* StackOverflow: 2 hits. 1 user complaining about AppCode autocomplete suggesting `textInputContextIdentifier` when they want to type `text`, and a user trying to put the identifier into his CoreData model for unknown reasons (the answer to his question is his IBAction wasn't connected).
* GitHub: 38 code results for the property name in `.m` and `.swift` files, which at a brief glance look like they don't know what it does, or it's commented out, or often both.
* Apple Developer Forums: 0 hits.
* Twitter: 3 tweets, from 2 different people who **definitely know** what it does. All from 2015.

To be fair, I've never built an app that needed this behavior. I'm also not bilingual, so I've also never needed the behavior as a user. So maybe this is nearly invisible in the places I looked, but is commonly known elsewhere. I doubt it.

I think it's a problem that 4 years after a property was introduced, providing a feature that [some users love](https://www.macstories.net/news/ios-6-messages-now-automatically-selects-last-used-international-keyboard-for-each-contact/) to 3rd party apps, an explanation of that property is included inside of a 40+ minute video at the same time that *~130 other videos* are made available.

gha_language: JavaScript


text:
```
================================================================================
             _        _    _____      __       __   _______
            \  \    /  /  |  ___|    \  \    /  /  /  ____|
             \  \  /  /   | |___      \  \  /  /    \ `__.
              \  \/  /    |     |      \  \/  /      `__.  \
               \    /     |  ___|      /  /\  \          \  |
                \  /      | |___      /  /  \  \    /\__/   /
                 \/       |_____|    /__/     \__\  \______/

================================================================================
```

A collaboration between the Florida Advanced Multiphysics Modeling and Siulation (FAMMoS) Group at the University of Florida (http://watson.mse.ufl.edu) and the Future Technologies (FT) Group at Oak Ridge National Laboratory (https://csmd.ornl.gov/group/future-technologies).

Primary developers:
Forrest Shriver<EMAIL_ADDRESS>
Seyong Lee<EMAIL_ADDRESS>
Steven Hamilton<EMAIL_ADDRESS>
# What is it?
VEXS (Very Easy XS) is a variant of the XSBench mini-app (https://github.com/ANL-CESAR/XSBench) that specifically tries to capture finer details of the memory and compute model that XSBench, by necessity, approximates. It is targeted specifically at performance analysis and prediction on platforms where more limited memory and compute resources might make the hardware more sensitive to approximations and assumptions that CPU-based platforms may not be sensitive to.

# Quickstart
To get started:
```
cd VEXS/
./unpack_all_libraries.script
cd generate_binary_files/
./runme.script
```
This will unpack all data libraries to their appropriate places under the VEXS/ directory, and will run a reduced version of VEXS to create binary versions of all data files.

To compile and run:

```
cd VEXS/packages/GPU/CUDA/xsbench-like/naive/struct-of-arrays/
make -j16
./VEXS -i detailed_model_depleted_core -b --gputhreads 256 --gpublocks 4096
```

This launches the Struct-of-Arrays naive (basic binary) search kernel by compiling and linking together both the local kernel files located under kernels/ and the parser backend located under VEXS/parser/.

All kernels in VEXS are designed, compiled and run like above: Implementations of a specific cross-section lookup algorithm are located in their own separate folders, allowing the user to focus on specific algorithms in isolation without needing to deal with functions or code contamination from other implementatons.

# General guidelines
The VEXS codebase is essentially divided into two parts: the parser backend, located under VEXS/parser/, and the kernels that will be studied, located under VEXS/packages/. Compiling is as simple as running 'make' in the kernel folder one wishes to run. The idea is that a user will never need to touch the parser backend, instead being able to limit themselves to only the code that is located in the kernels folder they wish to examine. To avoid code duplication, the parser backend is designed to launch a call_kernels() function, which is located in the same kernel folder. This call_kernels() function subsequently calls any parser backend functions that are specifically required by the kernel under use. In this way, we can implement machinery to accomodate different lookup schemes without having this different machinery interfere with each other, and without requiring different command-line options be implemented to accomodate new features.

# Kernel guide

```packages/GPU/CUDA/xsbench-like/naive/struct-of-arrays: ``` Struct-of-Arrays version of the basic binary search kernel.
```packages/GPU/CUDA/xsbench-like/hash/struct-of-arrays/binary-completion: ``` Struct-of-Arrays version of the hash-accelerated search, with a binary search used to complete the reduced search window.
```packages/GPU/CUDA/xsbench-like/hash/struct-of-arrays/linear-completion: ``` Struct-of-Arrays version of the hash-accelerated search, with a linear search used to complete the reduced search window.

# Program Options
```
--help,-h : Outputs this help message.
--input,-i : Directory under the DATA folder where VEXS will look for library data. Default path: test
--write-binary,-w : Write library data to binary file for faster reading in the future.
--binary-b : Load library data from a binary file as opposed to reading from a text file.
--lookups,-l : Total number of macroscopic cross-section lookups to perform. Default value: 1
--hashbins,-h : Number of hash-bins to use in the hash-accelerated search. Default value: 1
--openmpthreads : Number of OpenMP threads to use. Only applicable for OpenMP-specific kernels. Default value: 1
--gpublocks : Number of blocks to use for GPU-specific kernels. Default value: 1
--gputhreads: Number of threads per block to use for GPU-specific kernels. Default value: 1
```

# Why not just merge with XSBench?
A significant amount of work has gone into creating data libraries that represent synthetic data in a manner that is closer to real-life scenarios, which requires significantly more storage (~91 MB compressed, ~500 MB uncompressed) compared to XSBench's minimal usage of memory. Additional parsing infrastructure is also required to accomodate this significantly different dataset, which has also been engineered to accomodate VEXS' unique method of kernel construction (more on this in the wiki). As a result, establishing these various changes as a merge to the XSBench respository is infeasible, as the two applications are significantly diverged in methods and current codebases.

repository: MikeDengfei/VEXS

repo_name: MikeDengfei/VEXS


text:
$().clone(deep) clones all the DOM nods in the collection.  If deep is set to "true", it will also clone the elements children.

Let's say we have an ordered list and we want to keep adding elements by cloning the first LI.

```html
<ol>
    <li>Entry</li>
</ol>
```

We can clone and then add it to the list like the following.

```js
var obj=$("ol li").eq(0).clone();

$("ol li").append(obj);
```

repository: weijiancai/metaui

repo_name: weijiancai/metaui


text:
# 3. Separate backend types

Date: 2023-02-22

## Context

Sttp base types are [being refactored](https://github.com/softwaremill/sttp/pull/1703) to decrease the learning curve,
and generally improve the developer experience.

## Decision

The `SttpBackend` type is split into a type hierarchy, with new subtypes representing backends with different
effects and capabilities.

The root of the hierarchy is `GenericBackend`, which corresponds to the old backend: it is parametrised with the
type constructor used to represent effects, and a set of capabilities that the backend supports. Additionally, there's
a number of subtypes: `Backend`, `SyncBackend`, `StreamBackend`, `WebSocketBackend` and `WebSocketStreamBackend` which
fix the capabilities, and in case of `SyncBackend` also the effect type.

### What do we gain

Thanks to the different kinds of backends being represented by top-level types, the `send` methods on request
descriptions can now have more developer-friendly and precise signatures. For example:

```scala
class Request[T] {
  def send[F[_]](backend: Backend[F]): F[Response[T]] = backend.send(this)
  def send(backend: SyncBackend): Response[T] = backend.send(this)
}
```

Specifically, for a request sent using a synchronous request, the result type is a `Response` directly, without
the `Identity` wrapper. This improves ergonomics (e.g. when using autocomplete) and type inference.

Moreover:
* users are exposed to simpler types, such as `SyncBackend` instead of `SttpBackend[Identity, Any]`
* error messages are more precise, pointing to the specific backend type that is required to send a request

### What do we loose

Backend wrappers, which are designed to work with any delegate backend, now need to have 5 alternate constructors,
for each specific backend subtype. For example:

```scala
object FollowRedirectsBackend {
  def apply(delegate: SyncBackend): SyncBackend = new FollowRedirectsBackend(delegate) with SyncBackend {}
  def apply[F[_]](delegate: Backend[F]): Backend[F] = new FollowRedirectsBackend(delegate) with Backend[F] {}
  def apply[F[_]](delegate: WebSocketBackend[F]): WebSocketBackend[F] = new FollowRedirectsBackend(delegate) with WebSocketBackend[F] {}
  def apply[F[_], S](delegate: StreamBackend[F, S]): StreamBackend[F, S] = new FollowRedirectsBackend(delegate) with StreamBackend[F, S] {}
  def apply[F[_], S](delegate: WebSocketStreamBackend[F, S]): WebSocketStreamBackend[F, S] = new FollowRedirectsBackend(delegate) with WebSocketStreamBackend[F, S] {}
}
```

Additionally, adding more capabilities will require enriching the type hierarchy with more subtypes, as well as adding
new variants to any backend wrappers. However, in the course of sttp's history, no new capabilities have been added, and
we do not foresee having to add more in the future.

### Alternate designs

We [have explored](https://github.com/adpi2/sttp/pull/5) an alternate design, where the `GenericBackend` was a
stand-alone type, to which types representing to specific capabilities (`Backend`, `StreamBackend` etc.) delegate.
This partially replaced the inheritance with composition.

The main goal of the change was to allow implementing generic backend wrappers in a more straightforward way. The
delegating types included a `SelfType` type parameter, which was leveraged by generic backend wrappers, e.g.:

```scala
trait SyncBackend extends Backend[Identity] { self =>
  override type Capabilities <: Any
  override type SelfType <: SyncBackend
}

object FollowRedirectsBackend {
  def apply[F[_]](delegate: Backend[F]): delegate.SelfType =
    delegate.wrap(new FollowRedirectsBackend(_, FollowRedirectsConfig.Default))
}
```

However, this had two major drawbacks:

* the type inference on the wrapped backends was worse, as it returned e.g. `SyncBackend.SelfType` instead of
  `SyncBackend`
* alternatively, we could fix the self type to become type aliases instead of type bounds, but then the subtyping
  relation between the backend types has been lost
* additionally, using two wrappers in a generic way resulted in type such as `delegate.SelfType#SelfType`, which
  are not only not readable, but also rejected by the Scala 3 compiler.

repository: kamilkloch/sttp

repo_name: kamilkloch/sttp


text:
# hello-terminal

## terminal-workflow

Small, simple sample library for writing terminal applications with workflows.

The API entry points are `TerminalWorkflow` and `TerminalWorkflowRunner`. Create one of each of
those, and pass your workflow to `TerminalWorkflowRunner.run()`.

Your `TerminalWorkflow` will get the current size of the terminal as `PropsT`, render a
`TerminalRendering` that includes the text to display, foreground and background colors, and an
event handler to receive keystroke events. It can also exit the process by emitting an integer
exit code.

This module delegates to the third-party library [Lanterna](https://github.com/mabe02/lanterna)
to do the actual hard work of talking to the system terminal.

## hello-terminal-app

Sample app demonstrating one possible way of writing terminal applications with workflows.
Makes use of the terminal workflow infrastructure in `:samples:hello-workflow:terminal-workflow`.

Run with `./gradlew :samples:hello-terminal:hello-terminal-app:run`

![Screen recording of the sample app](.assets/hello-terminal-demo.gif)

## todo-terminal-app

Sample app that uses the sample `terminal-workflow` library to build a really simple TODO app that
can only track one todo list.

It has a root workflow that stores the title and list of items and their checked flags in its state.
It is responsible for rendering the list. It also keeps track of which item or the title is
currently selected/focused, and listens to keyboard events to update that pointer. When an item
is selected, pressing the Enter key will toggle its checked state. The currently-selected item or
title can also be edited by just typing.

When rendering the focused field, the root workflow delegates to an `EditTextWorkflow`. This
workflow takes the text to render as input, and returns that text with a "cursor" rendered on it.
It also maintains internal state of where the cursor is in the text, and listens for key events
that either add text, remove text (backspace), or move the cursor (left/right arrow keys). The
parent workflow just declaratively renders the edit text workflow and is oblivious to how it's doing
text entry.

Run with `./gradlew :samples:hello-terminal:todo-terminal-app:run`

![Screen recording of the sample TODO app](.assets/todo-terminal-demo.gif)

repository: square/workflow-kotlin

gha_language: Kotlin

repo_name: square/workflow-kotlin