text:
EmulGL
=========

EmulGL is a Java implementation of OpenGL running *C*PU, hence allowing to avoid using native dependencies to *G*PU.

Traditional GPU rendering offers great performance but sometimes hit a compatibility issue for some rare {OS, JDK, GPU} combination. EmulGL processes the 3D scene inside the JVM with Java code only with rendering time below 40ms for most surface and scatter charts. This makes EmulGL a good fallback renderer for both offscreen chart and onscreen interactive chart that may be animated without visible lag (and without flooding CPU either).

EmulGL relies on [jGL](https://github.com/jzy3d/jzy3d-api/tree/master/jzy3d-jGL), a pure Java implementation of the OpenGL 1 specification. EmulGL remains relevant for simple charts.

Native charts (using [JOGL](https://jogamp.org/jogl/www/)) remains the preferred option for fast rendering of very large geometries, volumes or rendering involving shaders. Native charts also tend to better handle alpha blending (using translucent objects).

# EmulGL examples in integration tests

The below image are baseline for pixel-wise non regression tests that can be found [there](src/test/java/org/jzy3d/emulgl/integration).

# EmulGL code architecture

Making a chart CPU based for rendering is easy :
```java
IPainterFactory painter = new EmulGLPainterFactory();
ChartFactory factory = new AnyChartFactory(painter);
Chart chart = factory.newChart();
// then edit chart as usual
```

The base entry point for exploring EmulGL component is starting with `EmulGLPainterFactory` which handles all compatibility related objects, such as `EmulGLPainter`, `EmulGLCanvas`, `EmulGLViewOverlay`, `EmulGLViewAndColorbarsLayout`.

Using `EmulGLChartFactory` is not mandatory : making a chart EmulGL based only requires passing a `EmulGLPainterFactory` to any `ChartFactory`. `EmulGLChartFactory` is usefull to get a `CameraThreadControllerWithTime` which differs to native in that it make the chart rotation speed independent of the rendering speed.

To easily access implementations of EmulGL chart components without lot of downcasts, we added the below class :

```java
EmulGLSkin skin = EmulGLSkin.on(chart);
// returns the Emulgl Canvas to call its own methods
skin.getCanvas().setProfileDisplayMethod(true);
// returns the EmulGL Mouse to call its own methods
skin.getMouse().setPolicy(policy);
```

The next sections depict what is particular in EmulGL overrides of Jzy3D core.

## EmulGL Canvas

The below map describes how EmulGL canvas replies to all events.

[Edit schema](https://lucid.app/lucidchart/78ec260b-d2d1-430d-a363-a95089dae86d/edit?page=IG_tq9NVLe03#)

## EmulGL EmulGLViewAndColorbarsLayout (containing images)

# High pixel density screens (HiDPI, Retina)

HiDPI is supported by EmulGL on all JVM above Java 9. Until Java 8, AWT Canvas do not expose the pixel scale, so charts will simply render without HiDPI. Appart of this limitation, EmulGL will deal with multiple screens configuration on all OS whatever the pixel scales (100%, 150%, 200%, ...). It has also been tested successfully on 32' 4K screens.

EmulGL has the nice property of detecting pixel scale change over time and will handle resolution change of a chart when the application change screens at runtime. This allows handling all resolution dependent items (text size, image layout and scale, 2D post rendering, etc).

The below configuration asks for using HiDPI if it is available.

```java
Quality q = Quality.Advanced();
q.setHiDPI(HiDPI.ON);
```

This allows getting the current pixel scale of the chart.
```java
Coord2d pixelScale = chart.getView().getPixelScale();
```

Usefull links about HiDPI and java
* https://bugs.openjdk.java.net/browse/JDK-8055212
* https://intellij-support.jetbrains.com/hc/en-us/articles/360007994999-HiDPI-configuration
* https://cwiki.apache.org/confluence/display/NETBEANS/HiDPI+%28Retina%29+improvements

# Performance

I was able to have the following performance on a MacBook Pro (Retina 15 inches, 2013), 2,7 GHz Intel Core i7, RAM 16 Go 1600 MHz DDR3

[EmulGL Surface charts](https://github.com/jzy3d/jzy3d-api/blob/master/jzy3d-tutorials/src/main/java/org/jzy3d/demos/surface/SurfaceDemoEmulGL.java)
* A 60x60 polygon 3D surface in a 500x500 pixels frame is rendered in ~30ms
* A 60x60 polygon 3D surface in a 1440x800 pixel frame is rendered in ~45ms

[EmulGL Scatter charts](https://github.com/jzy3d/jzy3d-api/blob/master/jzy3d-tutorials/src/main/java/org/jzy3d/demos/scatter/ScatterDemoEmulGL.java)
* A 50.000 points 3D scatter in a 500x500 pixels frame is rendered in ~10ms
* A 500.000 points 3D scatter in a 500x500 pixels frame is rendered in ~90ms

Please report here the performance you encounter while running EmulGL charts by [adding comments to this issue](https://github.com/jzy3d/jzy3d-api/issues/149).

## Tuning performance

The quick hints to play with performance are below, if you are willing to understand how these parameters affect performance, read the next section.

### Reducing rendering quality in favor of faster repaint in all cases

```java
Quality q = Quality.Advanced;
q.setHiDPI(HiDPI.OFF); // prevent HiDPI/Retina to apply hence reduce the number of pixel to process

Chart chart = factory.newChart(q);
```

### Reducing rendering quality in favor of faster repaint only in case of rotation AND low performance

Visible rendering lag mainly occur when the chart rotates. This may happen according to two situations
* canvas is large
* hidpi is active on a computer that has the ability to enable HiDPI

This is a complex but usefull configuration as it will lower dynamically the rendering quality only if rendering performance drops (which will depend mainly on the computer running your program) to ensure rotation remains fluid.

```java
// Configure base quality for standard case
EmulGLChartFactory factory = new EmulGLChartFactory();
Quality q = Quality.Advanced;
q.setAnimated(false); // enable repaint on demand to minimize CPU usage when chart do not change
q.setHiDPI(HiDPI.ON); // enable HiDPI if hardware provides it

Chart chart = factory.newChart(q);
chart.open(1264, 812);

// Configure adaptive quality optimization upon slow rendering
AdaptiveRenderingPolicy policy = new AdaptiveRenderingPolicy();
// The rate limiter will ensure mouse events won't flood AWT with repaints
policy.renderingRateLimiter = new RateLimiterAdaptsToRenderTime();
// This is the rendering time above which dynamic optimizer will trigger according to options
policy.optimizeForRenderingTimeLargerThan = 100;//ms
// If optimizer active, allow -or not- to disable faces of the surface polygons and only draw wireframe colored with face edge colors. Very good looking, fast rendering. Keep default value
policy.optimizeByDroppingFaceAndKeepingWireframeWithColor = true;

// Apply this policy (or your override of this policy) to the adaptive mouse controller
EmulGLSkin skin = EmulGLSkin.on(chart);
skin.getMouse().setPolicy(policy);
skin.getThread().setSpeed(15);

```

Which will turn the chart in the below mode if _by default_ mouse drag leads to a rendering time above  `policy.optimizeForRenderingTimeLargerThan`. In that case, rendering drops face rendering to go faster and reach ~30ms to render which lead to a fluid chart rotation.

### Reducing liveness in favor of less CPU usage

```java
Quality q = Quality.Advanced;
q.setAnimated(false); // avoid rendering continuously, especially when chart does not need to change (most often)
// controllers (mouse, thread, etc) will have to update the chart themselves and won't rely on an animator.

Chart chart = factory.newChart(q);
```

### Improving rendering quality with possible liveness issues

```java
Quality q = Quality.Advanced;
q.setHiDPI(HiDPI.ON); // Let HiDPI/Retina inform their pixel ratio to process GL image on more pixels
q.setAnimated(true); // the chart repaints every 100ms, without knowing if hardware can handle it

// Possible liveness issue : mouse drag looks slow on large HiDPI screens as rendering is slower than usual
// Possible solution at runtime : diminish canvas size (make it smaller in your application)

Chart chart = factory.newChart(q);
```

# Repaint on demand VS repaint continuously

Repaint on demand means refreshing the canvas if at least one pixel changes. This is less CPU intensive in the long term as
chart are only changed if user interacts with it, add elements, or if the application resizes. Repainting on demand requires
however a carefull management of events that is exposed below and shows liveness issues in some rare conditions.

Repainting continuously allows getting rid off all these issues : a CPU thread will run [at a mean rate](https://github.com/jzy3d/jzy3d-api/blob/master/jzy3d-emul-gl/src/main/java/org/jzy3d/chart/EmulGLAnimator.java#L6) and ensure the chart always appear in the correct position without needing to handle refresh upon mouse, key or other thread events.

Setting repaint on demand is handled by
```java
Quality q = Quality.Advanced;
q.setAnimated(false);

Chart chart = factory.newChart(q);
chart.addMouseCameraController();
chart.addKeyboardCameraController();
```
Mouse, keyboard, and rotation thread controllers will behave according to the configuration (trigger repaint is repaint is
  on demand, do nothing if repaint continuously).

# Handling slow rendering

EmulGL/jGL run in CPU, hence the rendering performance remains sensitive to
* the number of pixels, hence the canvas size (the same processing unit (*C*PU) thread must handle all pixels)
* the hardware capacity (HiDMI & Retina display may multiply number of actual physicial pixels to draw if maximal quality is required)
* the number of drawables to draw (a 60x60 surface leads to 3600 polygons to render, that are sorted and lead to pixel change requests)
* the number of rendering requests (canvas resize, mouse, keyboard, or external rendering requests)

In the worse conditions, rendering time may reach a visible duration (e.g. 200ms). In that case, policies must
be defined to avoid freezing AWT either for rendering or for handling interactions. The below sections explain why the JVM
brings limitations, and how EmulGL resolves them.

## Integrating in AWT

### Unpredictability of AWT

Integrating in AWT is tricky because of how AWT works and how it will react to multiple events. Such events may be
* canvas display & resize occuring in the embedding application
* mouse events
* keyboard events
* application events (e.g. a NON GUI class allows edit a 3D parameter triggering a new rendering outside the AWT Thread)

I discovered a few thing about non predictability of rendering upon reaction to these events. These are my understanding but *I may wrong*.
Please correct me via [an issue](https://github.com/jzy3d/jzy3d-api/issues) if I am!

#### You don't know when AWT will really render

AWT send rendering or interaction events (mouse, ...) to the EventQueue.
The JVM will decide when it will be actually displayed.
I found no event or hook to get notified when an update happens.

[Edit schema](https://lucid.app/lucidchart/78ec260b-d2d1-430d-a363-a95089dae86d/edit?page=wz_twV5gX99-#)

#### You can't be sure that all events will all be handled independently

The [EventQueue has the ability to coalesce multiple mouse or paint event](https://docs.oracle.com/javase/8/docs/api/java/awt/EventQueue.html#postEvent-java.awt.AWTEvent-)
in case it becomes overwhelmed by similar queries that it had no time to process. A mouse event or a canvas repaint on the
whole canvas (as EmulGL does) are events considered coalescable : the JVM is right dropping images display if a new image
rendering has been queried.

As a consequence, in the case multiple rotation command triggered by a mouse drag event -
and if these events lead to slow rendering, then you may only see the last rendering and not all intermediate images. This will
let the user feel that rotating is slow whereas intermidate rotation updates were just drop for display.

In that case, it is necessary to limit the event rate to ensure not too many rendering are triggered (said
differently, that repaint query are not arriving faster than the ability to compute what should
be drawn). ```EmulGLPainterFactory``` adds an adaptive rate limiter to the controllers (mouse, keyboard) to ensure they do not
flood AWT Event Queue. To ensure the rate limiter is optimal with the current canvas size/hidpi requirements  (e.g. not compromising liveness of a mouse rotation), it keeps an history
of past rendering time and fits to the poorest case plus a time margin of 20ms. I did this because I observed peaks in rendering time that may not be relevant for performance (optimal performance & liveness tradeoff in the beginning of chart lifetime may not relevant 1 minute later if the chart get resized). With this liveness is very fluid for small charts, and acceptable for fullscreen
canvas with HiDPI/Retina enabled, both holding high quality and alpha.

[Edit schema](https://lucid.app/lucidchart/78ec260b-d2d1-430d-a363-a95089dae86d/edit?page=IG_tq9NVLe03#)

All windowing toolkit event are not coalesced! For example the mouse wheel events do not seam to be coalesced, whereas mouse dragged events are.

#### Actual rendering in AWT

Rendering of AWT components is made with... OpenGL! But it is limited to 2D graphics only.

# Further work

## Fail : Performance with multithreading

We explored multithreaded rendering in `SurfaceDemoEmulGL_Multithreaded` which is a complete failure. jGL  won't support multithreading easily. OpenGL indeed requires a consistent call to a serie of commands (glBegin, glVertex, glEnd, etc) that prevent multiple
threads to deal with a sub group of geometries to render since the GL context will receive commands from multiple interlaced geometries.

Note that JOGL has the same limitation. We explored Newt canvas in JOGL supposed to allow such multithreaded access to the same OpenGL context but did not succeed. This attempt was made with `MultithreadedGraph` wich may not be designed properly for Newt.

Performance studies shows that handling all geometries draw() method is where an optimization may be done. Handling copy of colorbuffer to the canvas is negligeable compared
to handling all OpenGL drawing primitives.


text:
---
slug: /1001/install/
---

# Install Dagger

{@include: ../partials/_caution-old-version.md}

:::caution Requirement

- Dagger requires [Docker](https://docs.docker.com/get-docker/) to be installed and running.

:::

## Option 1 (Mac OS and Linux): Use Homebrew

From a terminal, run the following command:

```shell
brew install dagger/tap/dagger
```

If dagger is already installed, you can upgrade it using this command:

```shell
brew update
brew upgrade dagger
```

## Option 2 (Mac OS and Linux): Run a shell script

From a terminal, run the following command:

```shell
curl -sfL https://releases.dagger.io/dagger/install.sh | sh
```

You now have the dagger binary in the local directory under `./bin/dagger`.

You can also install it globally on your system:

```shell
curl -sfL https://releases.dagger.io/dagger/install.sh | sudo BIN_DIR=/usr/local/bin sh
```

or

```shell
curl -sfLo install.sh https://releases.dagger.io/dagger/install.sh; sudo BIN_DIR=/usr/local/bin sh ./install.sh
```

## Option 2 (Windows): Run a shell script

From a terminal, run the following command:

```shell
curl https://releases.dagger.io/dagger/install.ps1 -OutFile install.ps1 ; ./install.ps1; rm install.ps1
```

We try to move the dagger binary under `C:\Windows\System32` but
in case use missing the necessary permission we'll save everything under `<your home folder>/dagger`

## Option 3: Download a binary release

Open your web browser to [the latest release](https://github.com/dagger/dagger/releases/latest).

From the **assets** section, download the archive corresponding to your OS and Arch.

## Option 4: Install from source

You will need [Go](https://golang.org) version 1.18 or later.

1\. Clone the dagger repository

```shell
git clone https://github.com/dagger/dagger.git
```

2\. Build the `dagger` binary.

```shell
cd dagger; make dagger
```

3\. Copy the `dagger` tool to a location listed in your `$PATH`. For example, to copy it to `/usr/local/bin`:

```shell
cp ./cmd/dagger/dagger /usr/local/bin
```

## Enable autocompletion manually

You can generate an auto completion script using `dagger completion <your shell>`

```sh
Usage:
  dagger completion [command]

Available Commands:
  bash        generate the autocompletion script for bash
  fish        generate the autocompletion script for fish
  powershell  generate the autocompletion script for powershell
  zsh         generate the autocompletion script for zsh
```

Use `dagger completion <your shell> --help` for shell specific instructions.

repository: dgageot/dagger

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: dgageot/dagger


text:
# creating the database and postgresql role
## create a user with a password

> CREATE USER new_user WITH PASSWORD 'my_new_password';

### example
> CREATE USER postgres WITH PASSWORD 'postgres';

## verify role exists
### note usename not username

> SELECT usename FROM pg_user;

### create a database with db owner of role created previously

> CREATE DATABASE todo OWNER <new_user>;
### example
> CREATE DATABASE todo_app OWNER postgres;

source:
http://www.patricksoftwareblog.com/database-using-postgresql-and-sqlalchemy/

license: MIT

repository: calvinsettachatgul/athena

branch_name: refs/heads/master

gha_language: Python

gha_license_id: MIT

repo_name: calvinsettachatgul/athena


text:
# pbasu-OracleDB-tutorials

# Oracle Password Expire & Locked - RESET
* https://www.krenger.ch/blog/oracle-workaround-for-password-unexpire/
* http://www.ateam-oracle.com/avoiding-and-resetting-expired-passwords-in-oracle-databases
* https://blogs.oracle.com/sql/how-to-fix-ora-28002-the-password-will-expire-in-7-days-errors
* https://daviewning.wordpress.com/2015/09/17/set-oracle-user-password-never-expired/
* https://shaileshpurani.wordpress.com/2012/01/30/verify-oracle-user-password-expiry-date/
*
*
*
*
*

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
select * from dba_profiles;

select username,account_status from dba_users where account_status like '%EXPIRED%' or account_status like '%LOCKED%';

select * from dba_users;

select 'ALTER USER '|| USERNAME || ' account unlock;' from dba_users where ACCOUNT_STATUS like '%LOCKED%';
select 'ALTER USER '|| USERNAME || ' identified by values ''' || spare4 || ''';' from dba_users,user$ where ACCOUNT_STATUS like '%EXPIRED%' and USERNAME=NAME;

repository: pradiptabasu/pbasu-OracleDB-tutorials

repo_name: pradiptabasu/pbasu-OracleDB-tutorials


text:
# Project 4, 5 - *Twitter*

**Twitter** is a basic twitter app to read and compose tweets the [Twitter API](https://apps.twitter.com/).

Time spent: **30** hours spent in total

## User Stories

The following **required** functionality is completed:

- [x] User can sign in using OAuth login flow
- [x] User can view last 20 tweets from their home timeline
- [x] The current signed in user will be persisted across restarts
- [x] In the home timeline, user can view tweet with the user profile picture, username, tweet text, and timestamp.
- [x] Retweeting and favoriting should increment the retweet and favorite count.

**update for assignment 5**
- [x] Tweet Details Page: User can tap on a tweet to view it, with controls to retweet, favorite, and reply.
- [x] Profile page:
   - [x] Contains the user header view
   - [x] Contains a section with the users basic stats: # tweets, # following, # followers
- [x] Home Timeline: Tapping on a user image should bring up that user's profile page
- [x] Compose Page: User can compose a new tweet by tapping on a compose button.
The following **optional** features are implemented:

- [x] User can load more tweets once they reach the bottom of the feed using infinite loading similar to the actual Twitter client.
- [x] User should be able to unretweet and unfavorite and should decrement the retweet and favorite count.
- [x] User can pull to refresh.
- [x] When composing, you should have a countdown in the upper right for the tweet limit.
- [x] After creating a new tweet, a user should be able to view it in the timeline immediately without refetching the timeline from the network.
- [x] Profile Page
   - [ ] Implement the paging view for the user description.
   - [ ] As the paging view moves, increase the opacity of the background screen. See the actual Twitter app for this effect
   - [x] Pulling down the profile page should blur and resize the header image.
- [x] Account switching
   - [x] Long press on tab bar to bring up Account view with animation
   - [] Tap account to switch to
   - [x] Include a plus button to Add an Account
   - [x] Swipe to delete an account

The following **additional** features are implemented:

- [x] List anything else that you can get done to improve the app functionality!
- [x] Use custom presentation for presenting view controller to improve user experiece (slide in and out)
- [x] Log out implmented
- [x] Animate icons changes after retweet and favor
- [x] Added tabbar
- [x] Added media to tweet
- [x] Added Following, Edit Profile button based upon the relationship with the profile user
- [x] Added Followers in user's profile
- [x] Added Followings in user's profile
- [x] Notification Center
- [x] Messages
- [x] Profile links in user's profile using WebView
- [x] Implemnted web view progressing bar
- [x] Style mentioneds, hashTags, links using NSAttributedString
- [x] Added media filter in the user's profile(see only the tweets with media)
- [x] Added the likes filter showing the tweets that the user likes
- [x] Added Media preview in the and zoom
- [x] Implmented the Twitter introduction scale effect

Please list two areas of the assignment you'd like to **discuss further with your peers** during the next class (examples include better ways to implement something, how to extend your app in certain ways, etc):

1. Add tab bar, notification, profile scene, etc
2. Load media and add attributed string for hash tag, link, etc

## Video Walkthrough

Here's a walkthrough of implemented user stories:

<img src='https://github.com/kesongxie/CodePath-Week4-5-Twitter/blob/master/Twitter/Gif%20Demo/Twitter-update.gif' title='Video Walkthrough' width='' alt='Video Walkthrough' />

GIF created with [LiceCap](http://www.cockos.com/licecap/).

## Notes

Twitter API, Model, etc

## License

    Copyright [2017] [Kesong Xie]

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

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

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

repository: kesongxie/Twitter

repo_name: kesongxie/Twitter


text:
# ⚠ DEPRECATION NOTICE
Unfortunately as of July 27, 2021, the mod host website which this mod manager used is now permanently offline. What this means is you will be unable to install the majority of mods which are listed. Deli Counter was my stopgap while we waited for something more and now since we are hosting mods on [Thunderstore](https://h3vr.thunderstore.io/) we have that. I highly recommend you switch to using [r2modman](https://h3vr.thunderstore.io/package/ebkr/r2modman/). I'm glad I was able to provide a tool which so many people used.

Cheers.

# Deli Counter
Deli Counter is a mod manager for games supporting BepInEx / Deli with a nice clean modern UI
![image](https://user-images.githubusercontent.com/22647801/118531246-9fe86000-b713-11eb-974c-a46337fe7231.png)

## Usage
1. Download the [latest release](https://github.com/Deli-Collective/Slicer/releases/latest/)
2. Extract the application
3. Run DeliCounter.exe

## Advanced usage
* Using standard list view multi select keys you can install multiple mods at the same time (Holding control or shift while selecting items)
* You can change the repsitory you pull mods from by entering the settings page and replacing the GitHub URL there with the URL of another. This can be very useful to test changes made on database forks before creating a PR to merge them in. Additionally, you can specify the branch by adding `/tree/{branch}` to the end of the URL. This matches the GitHub URL for that branch, so you could also select the branch in a web browser and then copy the URL from there too.

## Where do the mods come from
The mods listed in Deli Counter are pulled from a seperate dedicated repository because it keeps the git history clean and makes it easier for people to make edits and PRs. Deli Counter clones the repository locally and fetches the latest commits when it tries to update so any changes can be received immidiately. The repository can be found here:
https://github.com/Deli-Collective/Deli-Counter-Database.

### How do I add my own mod to the database?
Follow this guide on the database repo: https://github.com/Deli-Collective/Deli-Counter-Database/blob/main/CONTRIBUTING.md

repository: Deli-Collective/DeliCounter

repo_name: Deli-Collective/DeliCounter


text:
# metal-throttle

Metal's throttle utility

## Setup

1. Install NodeJS >= [v0.12.0](http://nodejs.org/dist/v0.12.0/), if you don't have it yet.

2. Install global dependencies:

  ```
  [sudo] npm install -g gulp
  ```

3. Install local dependencies:

  ```
  npm install
  ```

4. Build the code:

  ```
  gulp build
  ```

repository: metal/metal-plugins

gha_language: JavaScript

gha_license_id: NOASSERTION

repo_name: metal/metal-plugins


text:
# _music-game_

#### _music-game, 03-22-2017_

#### By _**Xi Xia and Shane Stafford**_

## Description
_Example text for the description of the project_

## Specifications

| Behavior                   | Input Example     | Output Example    |
| -------------------------- | -----------------:| -----------------:|

## Setup/Installation Requirements

* _Clone the repository_
* _Run the command 'gradle run'_
* _Open browser and go to localhost:4567_

### License

Copyright (c) 2017 **_Xi Xia and Shane Stafford_**

This software is licensed under the MIT license.


text:
# Locative iBeacon Sample App

[![Twitter: @Kidmar](https://img.shields.io/badge/contact-@Kidmar-blue.svg?style=flat)](https://twitter.com/Kidmar)
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/LocativeHQ/ibeacon-sample-app/blob/master/LICENSE.md)
[![TravisCI](https://api.travis-ci.org/LocativeHQ/ibeacon-sample-app.svg?branch=master)](https://travis-ci.org/LocativeHQ/ibeacon-sample-app)
[![Join the chat at https://gitter.im/LocativeHQ/ibeacon-sample-app](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/LocativeHQ/ibeacon-sample-app?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![codecov.io](https://codecov.io/github/LocativeHQ/ibeacon-sample-app/coverage.svg?branch=master)](https://codecov.io/github/LocativeHQ/ibeacon-sample-app?branch=master)

Since v1.4.0 Locative supports the use of iBeacons as Geofences.

The feature set is pretty the same as with geographical Geofences, this App can be used with any Bluetooth 4.0 (LE) iDevice to advertise as am iBeacon.

When using Locative, the iBeacons UUID must be entered when adding an iBeacon, the Sample App's UUID defaults to **954FBC91-620E-4B5A-86F7-1F31A0054194**

To use the Sample project, simply check out this Repo open the **GFBeacon.xcodeproj** and hit run.

For more info about **Locative** check out [http://locative.io](http://locative.io) or get it in the App Store at [http://get.locative.io](http://get.locative.io).

There's also another neat little feature which will gain more attention in the near future. Locative features a Geofence-Logging as-a-service at [https://my.locative.io](https://my.locative.io). So check it out and grab yourself an account ;-)

![image](https://raw.github.com/kimar/GFBeacon/master/Assets/Screenshot.png)

repository: lif-wtag/ibeacon-sample-app

repo_name: lif-wtag/ibeacon-sample-app


text:
# Dropzone
A file input that supports drag and drop and multiple files. Forked and reworked for our purposes (accessibility, stylability) from 'react-dropzone'.

### Examples
#### General
```
  import { Dropzone } from 'bloom-inputs'

  ...

  <Dropzone
    accept='.jpg'
    files={this.props.profileImage.value}
    label='Upload your Profile Picture'
    name='profileImage'
    onChange={(formId, fieldName='profileImage', value, type='file') => this.props.updateImageField(formId, fieldName, value, type)}
  />
```

#### Bloom-Forms use
```
  import { Dropzone } from 'bloom-inputs'

  ...

  const { checkField, formData, manualFieldUpdate } = this.props

  ...

  <Dropzone
    accept='.jpg'
    formData={formData}
    label='Upload your Profile Picture'
    name='profileImage'
    onBlur={checkField}
    onChange={manualFieldUpdate}
    validateAs='jpgFile' // make sure this custom validation type is defined in your form wrapper
  />
```

### Required Props
- Either `files` or `formData`:
  files: An array of File objects. Should be passed in like `formData.field.value`, as file inputs append an array of Files to the redux store.
  formData: The object holding all keys mapped to fields in your form. See [bloom-forms' formData prop](https://github.com/vineyard-bloom/bloom-forms/blob/master/docs/children-props.md). If you use formData via bloom-forms, the value will be derived from it, and any errors on that field will be passed in for you too.
- `label`:
  A string that labels the `Dropzone`. Required for accessibility purposes, but hidden by default.
- `name`:
  A string for the component's name and id. When using bloom-forms, name ties the `formData` to the input's value. It should match one of the strings in `fieldNames` array passed into `<Form>`.
- `onChange`:
  A function used to update the `Dropzone`'s value. Generally, this should be `manualFieldUpdate`.

### Optional Props
- `accept`:
  A string limiting the file types accepted. Native HTML5 'accept' attribute on input type='file'.
- `containerClass`:
  A string for styling the entire div around the input and its label.
- `imageStyle`:
  An object with CSS for styling the preview images of any uploaded files. Will fall back to default styles if not defined.
- `loadingElement`:
  A React Element containing a spinner or other loading indicator in case you don't want to use the bloom-forms default spinner.
- `multiple`:
  A boolean allowing multiple files to be uploaded simultaneously. Defaults to `true`.
- `required`:
  A boolean indicating if the input value can't be empty.

[Back to Contents](https://github.com/vineyard-bloom/bloom-inputs#contents)


text:
# Citrix XenDesktop 7 Storefront puppet module #

This modules install a fully working Citrix XenDesktop 7.x Storefront and a default Store. It provides puppet types configuration of additionnal stores as well as Netscaler Gateways for external access.

The following options are available for a production-grade installation :
- Security : SSL configuration to secure communications with the Citrix XML service
- Security : IIS SSL configuration to secure communications between Storefront and the client device.

## Requirements ##

The minimum Windows Management Framework (PowerShell) version required is 5.0 or higher, which ships with Windows 10 or Windows Server 2016, but can also be installed on Windows 7 SP1, Windows 8.1, Windows Server 2008 R2 SP1, Windows Server 2012 and Windows Server 2012 R2.

This module requires a custom version of the puppetlabs-dsc module compiled with [XenDesktop7](https://github.com/VirtualEngine/XenDesktop7) and [Storefront](https://github.com/VirtualEngine/Storefront/) Powershell DSC resources as a dependency. Ready to use virtualdesktopdevops/dsc v1.5.0 puppet module provided on [Puppet Forge](https://forge.puppet.com/virtualdesktopdevops/dsc).

## Change log ##

A full list of changes in each version can be found in the [change log](CHANGELOG.md).

## Integration informations ##
Storefront is deployed with a default store configured during install.

The SSL certificate provided needs to be a password protected p12/pfx certificate including the private key.

The SSL trust chain is checked by Storefront during HTTPS web access and callback process to Netscaler Gateway. The server certificate deployed for Storefront (IIS HTTPS binding) and Netscaler Callback VIP have to be signed by the Certification Authority certificate deployed in this puppet module. **Client access to Storefront will fail with self signed certificates or if Storefront is not able to verify the SSL trust chain.**

The module can be installed on a Standard, Datacenter version of Windows 2012R2 or Windows 2016.

## Usage ##
### xd7storefront ###
This class will install and configure IIS and Citrix Storefront. Storefront deployment is initialized after IIS installation and a default store is created. Additionnal stores can be configured later using the xd7storefront::store puppet type.

- **`[String]` baseurl** _(Required)_: Storefront cluster/group base url, i.e. 'https://storefront.domain.com/'.
- **`[String]` svc_username** _(Required)_: Privileged account used by Puppet for installing IIS and Citrix Storefront.
- **`[String]` svc_password** _(Required)_: Password of the privileged account. Should be encrypted with hiera-eyaml.
- **`[String]` sourcepath** _(Required)_: Path of a folder containing the Citrix Xendesktop 7.x installer (unarchive the ISO image in this folder).
- **`[String]` xd7sitename** _(Required)_: Name of the Xendesktop 7 farm hosted on the Delivery Controllers to which Storefront will be linked
- **`[String Array]` deliverycontrollers** _(Required)_: List of Citrix Delivery Controllers of the XenDesktop 7 site ['srv-cxdc01.domain.net', 'srv-cxdc012.domain.net']
- **`[Uint32]` deliverycontrollersport** _(Optional, default is 443)_: Delivery Controllers XML service communication port. If not specified, defaults to 443.
- **`[String]` deliverycontrollerstransporttype** _(Optional, default is HTTPS)_: Delivery Controllers XML service transport type. Valid values are: HTTP, HTTPS, SSL. If not specified, defaults to "HTTPS".
- **`[Boolean]` deliverycontrollersloadbalance** _(Optional, default is true)_: Round robin load balance the xml service servers. If not specified, defaults to True.
- **`[String]` xd7farmtype** _(Optional `[XenDesktop|XenApp]`, default is XenDesktop)_: The type of Citrix XenDesktop site/farm hosted on the Delivery Controllers to which Storefront will be linked
- **`[String Array]` storefrontauthmethods** _(Optional, default is `['ExplicitForms','IntegratedWindows']`)_: Storefront user authentification method. Must be an array with at least one of the following values : `[ 'Certificate',  'CitrixAGBasic', 'CitrixFederation', 'ExplicitForms', 'HttpBasic', 'IntegratedWindows' ]`
- **`[Boolean]`https** _(Optional, default is false)_: Deploy SSL certificate on IIS and activate SSL access to Storefront ? Default : false
- **`[String]` sslcertificatesourcepath** _(Required if https = true)_: Location of the SSL certificate (p12 / PFX format with private key). Can be local folder, UNC path, HTTP URL)
- **`[String]` sslcertificatepassword** _(Required if https = true)_: Password protecting the p12/pfx SSL certificate file.
- **`[String]` sslcertificatethumbprint** _(Required if https = true)_: Thumbprint of the SSL certificate (available in the SSL certificate).
- **`[String]` cacertificatesourcepath** _(Required if https = true)_: Location of the SSL Certification Autority root certificate (PEM or CER format). Can be local folder, UNC path, HTTP URL)
- **`[String]` cacertificatethumbprint** _(Required if https = true)_: Thumbprint of the SSL Certification Autority root certificate (available in the SSL certificate).

~~~puppet
node 'storefront' {
	class{'xd7storefront':
	  baseurl => 'https://storefront.testlab.com/'
	  svc_username => 'TESTLAB\svc-puppet',
	  svc_password => 'P@ssw0rd',
	  sourcepath => '\\\\fileserver\xendesktop715',
	  xd7sitename => 'XD7TestSite',
	  xd7farmtype => 'XenDesktop',
	  deliverycontrollers => ['srv-cxdc01.testlab.com', 'srv-cxdc02.testlab.com'],
	  deliverycontrollerstransporttype => 'HTTPS',
	  deliverycontrollersport => 443,
	  deliverycontrollersloadbalance => true,
	  storefrontauthmethods => ['IntegratedWindows', 'ExplicitForms']
	  https => true,
	  sslcertificatesourcepath => '\\\\fileserver\ssl\cxdc.pfx',
	  sslcertificatepassword => 'P@ssw0rd',
	  sslcertificatethumbprint => '44cce73845feef4da4d369a37386c862eb3bd4e1',
	  cacertificatesourcepath => '\\\\fileserver\ssl\ca-root.pem',
	  cacertificatethumbprint => '48jise7dssdsd4da4d369a3738dsdsdeeb3sdiu3'
	}
}
~~~

### xd7storefront::store ###
Puppet type to configure additionnal stores to a Citrix Storefront deployment. Can be declared multiple times in a node configuation.

- **`[String]` storeName** _(Required)_: Name of the storefront store. Will be used as a Friendly name and as a base for store URL construction.
- **`[String]` xd7sitename** _(Required)_: Name of the Xendesktop farm hosted on the Delivery Controllers to which Storefront will be linked
- **`[String Array]` deliverycontrollers** _(Required)_: List of Citrix Delivery Controllers of the XenDesktop 7 site `['srv-cxdc01.domain.net', 'srv-cxdc012.domain.net']`
- **`[UInt32]` deliverycontrollersport** _(Optional, default is 443)_: Delivery Controllers XML service communication port. If not specified, defaults to 443.
- **`[String]` deliverycontrollerstransporttype** _(Optional, default is HTTPS)_: Delivery Controllers XML service transport type. Valid values are: HTTP, HTTPS, SSL. If not specified, defaults to "HTTPS".
- **`[Boolean]` deliverycontrollersloadbalance** _(Optional, default is true)_: Round robin load balance the xml service servers. If not specified, defaults to True.
- **`[String]` xd7farmType** _(Optional `[XenDesktop|XenApp]`, default is XenDesktop)_: The type of Citrix XenDesktop site/farm hosted on the Delivery Controllers to which Storefront will be linked.
- **`[String Array]` storefrontauthmethods** _(Optional, default is `['ExplicitForms','IntegratedWindows']`)_: Storefront user uthentification method. Must be an array with at least one of the following values : `[ 'Certificate',  'CitrixAGBasic', 'CitrixFederation', 'ExplicitForms', 'HttpBasic', 'IntegratedWindows' ]`

~~~puppet
node 'storefront' {
	class{'xd7storefront':
	  baseurl => 'https://storefront.testlab.com/'
	  svc_username => 'TESTLAB\svc-puppet',
	  svc_password => 'P@ssw0rd',
	  sourcepath => '\\\\fileserver\xendesktop715',
	  xd7sitename => 'XD7TestSite',
	  xd7farmtype => 'xendesktop',
	  deliverycontrollers => ['srv-cxdc01.testlab.com', 'srv-cxdc02.testlab.com'],
	  deliverycontrollerstransporttype => 'HTTPS',
	  deliverycontrollersport => 443,
	  deliverycontrollersloadbalance => true,
	  storefrontauthmethods => ['IntegratedWindows', 'ExplicitForms']
	  https => true,
	  sslcertificatesourcepath => '\\\\fileserver\ssl\cxdc.pfx',
	  sslcertificatepassword => 'P@ssw0rd',
	  sslcertificatethumbprint => '44cce73845feef4da4d369a37386c862eb3bd4e1',
	  cacertificatesourcepath => '\\\\fileserver\ssl\ca-root.pem',
	  cacertificatethumbprint => '48jise7dssdsd4da4d369a3738dsdsdeeb3sdiu3'
	}->

	xd7storefront::store{'CustomStore01':
	  storename => 'CustomStore01',
	  xd7sitename => 'XD7TestSite',
	  xd7farmtype => 'XenDesktop',
	  deliverycontrollers => ['srv-cxdc01.testlab.com', 'srv-cxdc02.testlab.com'],
	  deliverycontrollerstransporttype => 'HTTPS',
	  deliverycontrollersport => 443,
	  deliverycontrollersloadbalance => true,
	  storefrontauthmethods => ['IntegratedWindows', 'ExplicitForms']
	}

	xd7storefront::store{'CustomStore02':
	  storename => 'CustomStore02',
	  xd7sitename => 'XD7DevelopmentSite',
	  xd7farmtype => 'XenDesktop',
	  deliverycontrollers => ['srv-cxdc03.testlab.com', 'srv-cxdc04.testlab.com'],
	  deliverycontrollerstransporttype => 'HTTPS',
	  deliverycontrollersport => 443,
	  deliverycontrollersloadbalance => true,
	  storefrontauthmethods => ['CitrixFederation']
	}
}
~~~

### xd7storefront::netscalergateway - Configure netscaler gateway ###
Puppet type to declare a Netscaler Gateway in a Citrix Storefront deployment. Can be declared multiple times in a node configuation.
Declaration of a Netscaler Gateway will create an associated external beacon in Storefront for external access.

**In this first version of the xd7storefront module, Netscaler Gateway has to be manually linked to a store to enable external access.**

- **`[String]` netscaler_name** _(Required)_: Name of the Netscaler Gateway object which will be registered in Storefront,
- **`[String]` netscaler_external_url** _(Required)_: NetScaler gateway external URL for Storefront access.
- **`[String]` netscaler_authentication_method** _(Required, ValueMap{"UsedForHDXOnly", "Domain", "RSA", "DomainAndRSA", "SMS", "GatewayKnows", "SmartCard", "None"})_: Login type required and supported by the Gateway. Valid values are: UsedForHDXOnly, Domain, RSA, DomainAndRSA, SMS, GatewayKnows, SmartCard, None.
- **`[String]` netscaler_callback_url** _(Required)_: NetScaler gateway authentication NetScaler call-back Url.
- **`[String]` netscaler_snip** _(Required)_: NetScaler subnet IP address used to contact Storefront.
- **`[String Array]` sta_urls** _(Required)_: (String Array) Array containing XD7 Secure Ticket Authority server URLs at format `['http://srv-cxdc01.domain.net/scripts/ctxsta.dll', 'http://srv-cxdc02.domain.net/scripts/ctxsta.dll']`
- **`[String]` netscaler_smartcardfallbacklogontype** _(Optional, default is none)_: Login type to use when SmartCard fails. Valid values are: UsedForHDXOnly, Domain, RSA, DomainAndRSA, SMS, GatewayKnows, SmartCard, None.

~~~puppet
node 'storefront' {
	xd7storefront::netscalergateway {'ExternalAccess':
	  netscaler_external_url => 'http://ext.domain.net',
	  netscaler_authentication_method => 'SmartCard',
	  netscaler_smartcardfallbacklogontype => 'None',
	  netscaler_callback_url => 'http://callback.domain.net',
	  netscaler_snip => '<IP_ADDRESS>',
	  sta_urls => ['http://srv-cxdc01.domain.net/scripts/ctxsta.dll']
	}
}
~~~

extension: markdown


text:
1.0.3 / 2018-02-12
==================

* [[`757b09f485`](https://github.com/TooTallNate/superagent-proxy/commit/757b09f485)] - Upgrading debug dependency to avoid ReDoS (#26) (Adrián Estrada)
* [[`17fd826650`](https://github.com/TooTallNate/superagent-proxy/commit/17fd826650)] - rename History.md to CHANGELOG.md (Nathan Rajlich)
* [[`050b80b237`](https://github.com/TooTallNate/superagent-proxy/commit/050b80b237)] - fix date (Nathan Rajlich)

1.0.2 / 2016-11-21
==================

* [[`915a4b0ee9`](https://github.com/TooTallNate/superagent-proxy/commit/915a4b0ee9)] - Update to use superagent 3 (#23, Matt Blair)

1.0.1 / 2016-06-22
==================

  * package: allow "superagent" v2
  * fixed example (#15, @reedrosenbluth)

1.0.0 / 2015-07-15
==================

  * bumping to v1.0.0 for stricter defined semver semantics

0.4.0 / 2015-07-15
==================

  * update to "proxy-agent" v2 API
  * use %o debug() formatter

0.3.2 / 2015-05-18
==================

  * package: update "debug" to v2.2.0
  * package: still limit "superagent" to < v2
  * package: support superagent >= 1.0 (#14, @Jxck)

0.3.1 / 2014-08-21
==================

  * package: looser "superagnet" peerDependency version

0.3.0 / 2014-01-13
==================

  * index: fix the redirect http -> https scenario
  * index: use `debug` component
  * package: update "proxy-agent" to v1

0.2.0 / 2013-11-20
==================

  * index: use "proxy-agent"

0.1.0 / 2013-11-16
==================

  * index: implement an LRU cache to lower the creation of `http.Agent` instances
  * index: include the ":" when generating the cache URI
  * index: add support for calling the proxy function directly
  * index: cleanup and refactor to allow for an opts object to be used
  * test: add some basic tests for the .proxy() function

0.0.2 / 2013-11-15
==================

  * package: add "superagent" to `devDependencies`
  * only invoke `url.parse()` when the proxy is a string
  * README++

0.0.1 / 2013-07-11
==================

  * Initial release, currently supports:
    * `http:`
    * `https:`
    * `socks:` (version 4a)


text:
## Job Scheduling With Profits And Deadlines

__Problem statement__

There are a few greedy algorithms to tackle this problem. Beyond the general fast behavior of greedy algorithms,
the good thing is that they are also optimal in this case (they find the optimal solution).

Note, however, that these algorithms are proven to be optimal only when all tasks can be completed in a unit of time (or slot).
When each task can last 1 or more slots, the problem is more challeging and these solutions will not work anymore.

__Problem formulation__

This problem can be formally written as follows:

subject to:

where:

 is the deadline of job i (positive integer >= 1).

 is the profit of job i (positive integer >= 0).

 binary variable defines the schedule (0 or 1).

 is the maximum length of the schedule (positive integer >= 0).

Note that each job takes 1 slot to complete always.

__Examples of greedy algorithms__

Example of a naive sequential algorithm:

__Difficulty in literature__

This problem is considered Medium in literature.

__References__

[[1]](https://www.techiedelight.com/job-sequencing-problem-deadlines/) Job Sequencing Problem with Deadlines, Techie Delight.

[[2]](https://ocw.mit.edu/courses/civil-and-environmental-engineering/1-204-computer-algorithms-in-systems-engineering-spring-2010/lecture-notes/MIT1_204S10_lec10.pdf) 1.204 Lecture 10, Greedy algorithms: Knapsack (capital budgeting) and Job Scheduling, MIT.

[[3]](http://www.cs.mun.ca/~kol/courses/6783-w13/lec3.pdf) Lecture 3, Applied Algorithms, CS 6783.

## Greedy Algorithm 1

__Runtime Complexity__

O(n^2)

__Description__

First, sort jobs by profit.
Then, traverse sorted jobs sequentially and schedule a job to its most latest available slot.

## Greedy Algorithm 2 (Union-Find improvement)

__Runtime Complexity__

O(n log n) because the algorithm is dominated by the sorting time.
The Union-Find (to assign the latest available slot to a job) is O(1) in average.

__Description__

First, sort jobs by profit.
Then, traverse sorted jobs sequentially and schedule a job to its most latest available slot.

However, instead of traversing all slots from right to left until we get a free slot,
in this algorithm we use the Union-Find data structure (a.k.a. Disjoint Sets) to do that.

This change will improve the runing time of the algorithm.

Below is an illustration of the algorithm:


text:
For original documentation please refer to https://github.com/tzutalin/labelImg.

install python-pcl - Latest commit 1d83d2d plus the solution on the following issue
https://github.com/strawlab/python-pcl/issues/127

![image](pic1.png)  ![image](pic2.png)

All changes in the labelImg.py file are marked by "# Blender change".
File changed include:
* labelImg.py
* libs/labelFile.py
* data/pretrained_classes.txt
File added include:
* create_blender_bbox.py
* pascal_to_yolo.py

### What the tool does
* Map pixel box coordinates to camera box coordinates
* Map camera box coordinates to world box coordinates
* Based on world coordinates and the overall transformation matrix, calculate the midpoint, dimension and orientation of each bounding box
* Display boxes in Blender with a separate script

### Directory structure under the top level project directory is as follows:
* visim_project.json
* **output**
    * **1_InertialPose**
        * imu_data.csv
        * pose_data.csv
    * **2_Blender**
        * **cam0_original**
            * .png images
        * **cam0_exr**
            * .exr images
        * **cam0_segmented**
            * .png images
    * **3_labelimg**
        * .xml Pascal format labels
        * world_bbox.txt

### How to use the label tool:
* python3 labelImg.py
* Click "Open Dir" button and select the top level project folder
* Click "Create RectBox" button to create labels
* Click "Save" to save labels
* Click "Export to Blender" to calculate and save 3D bounding box info for Blender use
   * box info is stored in the format "xm ym zm xd zd yd ex ez ey" where "m" stands for midpoint, "d" stands for dimension, and "e" stands for Euler angle
   * The path to the saved "world_bbox.txt" would be displayed in a pop-up window; it should be /path/to/project/output/3_labelimg/world_bbox.txt.

### How to create 3D oriented bounding boxes in Blender
* Open blender and the 3D model (a .blend file)
* Import vis_simulator_addon.py to blender, and click the botton "create bounding boxes". Everything is already embedded.

### Notes
* Coordinate systems of the pixel image, camera and world are as shown below:


text:
# myshow
A little script that will automatically download serie's episodes
based on http://showRSS.info rss list using P2P (torrent).

*NOTE: for the moment only showrss.info is supported.*

# Dependencies
- Linux (not tested with other plateforms but it should work with some adaptations)
- python3 for myshow (https://www.python.org/)
- python2 for deluge (https://www.python.org/)
- deluge (http://deluge-torrent.org/)
- [optional] pip2 to automatically install python2 dependencies (https://pypi.python.org/pypi)
- [optional] showRSS.info account (http://showrss.info/?cs=feeds)
- [optional] python2-service_identity for deluge (https://pypi.python.org/pypi/service_identity)
- [optional] python2-mako for deluge-web (http://www.makotemplates.org/)

# Installation
Be sure to install all dependencies and check if the command `> deluged`
is working correctly in your terminal. MyShow will try to automatically
install python2 dependencies if you installed pip2 and python2.

*You might get a warning for 'service_identity' while running myshow. This warning comes
from deluge-web. Install the dependencie service_identity (`pip2 install service_identity`)
if it failed with the automatic installation from myshow.
 `UserWarning: You do not have the service_identity module installed.`.
This is not important. Deluge deamon (deluged) is working correctly.*

# Check if myshow works
Check if the command works correctly

`> python myshow.py -v` or `> python3 myshow.py -v`

You should have something like this
```
> python myshow.py -v
[?] Checking python dependencies
[OK]  Checking hashed.dat
```

If so, then myshow is ready to do the job.

# MyShow commands
```
usage: myshow.py [-h] [--init] [-u] [-a] [-d] [-dw] [-n NEW] [-i INTERVAL]
                 [--version] [-v]

Automatically download your rss torrents

optional arguments:
  -h, --help            show this help message and exit
  --init                Init myshow with 'series.json' (without downloading on
                        first run)
  -u, --update          Check and download new series once (deluged
                        automatically launched)
  -a, --auto            Automatically update based on hourly interval (deluged
                        automatically launched)
  -d, --deluged         Start deluged
  -dw, --deluge-web     Start deluge-web (default port: 8112)
  -n NEW, --new NEW     Add a new serie
  -i INTERVAL, --interval INTERVAL
                        Interval of updates in hour (default: 1)
  --version             Show version number of MyShow
  -v, --verbose         Verbose mode
```

# Adding series / Track a serie

1. Go to http://showrss.info and create an account (no email needed)
2. Navigate to **feeds** in the top menu (http://showrss.info/?cs=feeds)
3. Select **A single show** (your serie) and click on **Get feed address**
4. Copy the **public feed** address for that specific serie (eg:
 *http://showrss.info/feeds/1014.rss*)

Then add the serie to myshow with initialization:
`python3 myshow.py -n http://showrss.info/feeds/1014.rss --init -v`

- `-n`: will append the new feed to be tracked by myshow.
- `--init`: will catch the latest feed. This step should be done in order to
avoid downloading all episodes.
- `-v`: will launch myshow in verbose mode.

You should have something like this
```
python3 myshow.py -n http://showrss.info/feeds/1014.rss -u --init -v
[?] Checking python dependencies
[OK]  Checking hashed.dat
[?] Getting series
[OK]  found 3 series
 Arrow
 The Vampire Diaries
 Game of Thrones
http://showrss.info/feeds/1014.rss
{'Arrow': 'http://showrss.info/feeds/505.rss', 'The Vampire Diaries': 'http://showrss.info/feeds/205.rss', '12 Monkeys': 'http://showrss.info/feeds/1014.rss', 'Game of Thrones': 'http://showrss.info/feeds/350.rss'}
Initializing MyShow...
[?] Getting series
[OK]  found 4 series
 Arrow
 The Vampire Diaries
 12 Monkeys
 Game of Thrones
[OK]  New episode: 12 Monkeys 1x09 Tomorrow 720p
[OK]  New episode: 12 Monkeys 1x08 Yesterday 720p
[OK]  New episode: 12 Monkeys 1x07 The Keys 720p
[OK]  New episode: 12 Monkeys 1x06 The Red Forest 720p
[OK]  New episode: 12 Monkeys 1x05 The Night Room 720p
[OK]  New episode: 12 Monkeys 1x04 Atari 720p
[OK]  New episode: 12 Monkeys 1x03 Cassandra Complex 720p
[OK]  New episode: 12 Monkeys 1x02 720p
```

Now MyShow will track: 12 Monkeys, Arrow and Vampire Diaries episodes.
Since we specified the `--init` option, myshow will prevent downloading the latest episode
directly. Thus when running myshow with the update option (see section: **Run myshow**)

# Run myshow
Just run this command

`> python myshow.py -u -v`

in order to check for new series and start downloading new episodes in deluge.

*The downloaded file should be in "Deluge download folder".
You can check this by opening deluge and look at the configuration options. Normally,
it should be downloaded into your `home/username/Downloads` folderi by default.*

# Run periodically
Simply launch the script with the option `--auto`. By defaut the interval is set to
one hour. But you can specify yours using the `-i INTERVAL` option. Example for two hours
interval:

`> python3 myshow.py -a -v -i 2`

Every 2 hours, myshow will get the list of the RSS flux and check for new episodes. If
it detectes an undownloaded episode, it will add the torrent to *deluged*.

# Deluge web interface
You can also tell myshow to run the deluge-web interface by passing the option `-dw` or `--deluge-web`.
Example:

`> python3 myshow.py -a -v -i 2 -dw`

The default port is *8112*, and the default password is *deluge*

# Decrease resources notes
For low settings, you should modify deluge to consume less resources. The first time I saw
"Deluge is a lightweight client for torrent", I told myself: "Perfect for my project !". But
I found out that deluged and deluged-web needed more thant 500Mb of RAM memory in order to
work. Well, this isn't true. Here is a simple guide to low down deluge resources:

- Launche the web interface (`python3 myshow.py -dw`) and connect on "<IP_ADDRESS>:8112" with your favorite browser. It can
take up to 1-2 minutes in order to launch deluge-web.
- Go to "Preferences" (at the top) and choose the "Bandwidth" category.
- Low down the following options to decrease deluged resources: Max Connections, Max Upload slots,
Max Half-Open Connections, Maximum Connection Attempts per Second in the **Global Bandwitch Usage** section.

# Deluge-web example for Raspberry PI
Here is an example of configuration for RaspberryPI:
```
Global Bandwith Usage
Maximum Connections: 60
Maximum Upload Slots: 2
Maximum Download Speed (KiB/s): 2000     [this depends on your bandwitdh]
Maximum Upload Speed (KiB/s): 10         [this depends on your bandwidth]
Maximum Half-Open Connection: 30
Maximum Connection Attempts per Second: 5
Uncheck "Ignore limits on local network"
Check "Rate limit IP overhead"
```

# Things to do
- Parsers folder to have multiple source (not only showrss.info)
- Installer for /usr/bin

repository: kursion/myshow

repo_name: kursion/myshow


text:
## FluentCFFReader: Add ANSYS Fluent CFF (Common Fluid Format) reader

Add the Fluent CFF Reader (Common Fluid Format). This file format is the default format in the latest Fluent version.
The legacy format (Binary or ASCII) is not used anymore by ANSYS. The CFF format uses the HDF library. Similarly to
the legacy Fluent format, it needs 2 files : a case file (extension '.cas.h5') and a data file (extension '.dat.h5').
It works with Cartesian grid, Unstructured grid (poly, tetra, ...), 3D/2D, double and single precision files.

repository: gview/VTK

repo_name: gview/VTK


text:
# Sparse operators

A sparse operator ([`SparseOperator`](@ref)) in `LazyAlgebra` is the
generalization of a sparse matrix.  Like a [`GeneralMatrix`](@ref), rows and
columns may be multi-dimensional.  However unlike a [`GeneralMatrix`](@ref), a
sparse operator only stores its *structural non-zero* entries and thus requires
fewer memory and is usually faster to apply.

There are many different possibilities for storing a sparse operator, hence
`SparseOperator{T,M,N}` is an abstract type inherited by the concrete types
implementing compressed sparse storage in various formats.  Parameter `T` is
the type of the elements while parameters `M` and `N` are the number of
dimensions of the *rows* and of the *columns* respectively.  Objects of this
kind are a generalization of sparse matrices in the sense that they implement
linear mappings which can be applied to `N`-dimensional arguments to produce
`M`-dimensional results (as explained below).  The construction of a sparse
operator depends on its storage format.  Several concrete implementations are
provided: [*Compressed Sparse Row* (CSR)](#Compressed-sparse-row-format),
[*Compressed Sparse Column* (CSC)](#Compressed-sparse-column-format) and
[*Compressed Sparse Coordinate* (COO)](#Compressed-sparse-coordinate-format).

## Basic methods

The following methods are generally applicable to any sparse operator `A`:

- `eltype(A)` yields `T`, the type of the elements of `A`;

- `row_size(A)` yields an `M`-tuple of `Int`: the size of the rows of `A`, this
  is equivalent to `output_size(A)`;

- `col_size(A)` yields an `N`tuple of `Int`: the size of the columns of `A`,
  this is equivalent to `input_size(A)`;

- `nrows(A)` yields `prod(row_size(A))`, the equivalent number of rows of `A`;

- `ncols(A)` yields `prod(col_size(A))`, the equivalent number of columns of
  `A`.

- `ndims(A)` yields `M + N` the number of dimensions of the regular array
   corresponding to the sparse operator `A`;

- `size(A)` yields `(row_size(A)..., col_size(A)...)` the size of the regular
   array corresponding to the sparse operator `A`;

- `length(A)` yields `prod(size(A))` the number of elements of the regular
   array corresponding to the sparse operator `A`;

- `nnz(A)` yields the number of *structural non-zeros* in `A`;

- `nonzeros(A)` yields the vector of *structural non-zeros* in `A`.

The *structural non-zeros* are the entries stored by the sparse structure, they
may or not be equal to zero, un-stored entries are always considered as being
equal to zero.

As can be seen above, `eltype`, `ndims`, `size` and `length` yield the same
results as if applied to the multi-dimensional array corresponding to the
sparse operator.

## Generalized matrix multplication by a sparse operator

A sparse operator `A` can be directly used as any linear mapping in
`LazyAlgebra`:

```julia
A*x
```

yields the generalized matrix multiplication of `x` by `A`.  The size of `x`
must be that of the *columns* of `A`, that is `col_size(A)`.  The result is an
array whose size is that of the *rows* of `A`, that is `size(A*x) =
row_size(A)`.  Applying the adjoint of `A` is also implemented by the usual
syntax:

```julia
A'*y
```

to produce an array of size `col_size(A)` provided `y` is of suitable size,
i.e. `size(y) = row_size(A)`.

Sparse operators can be used as iterators, the value returned by the iterator
is a 3-tuple `(v,i,j)` with the value, the linear row index and the linear
column index of the entry.  For instance:

```julia
for (v,i,j) in A
    println("A[$i,$j] = $v")
end
```

This can be used to illustrate how `w = A*x` and `z = A'*y` could be computed
for the sparse operator `A`:

```julia
# Compute w = A*x:
@assert !Base.has_offset_axes(x)
@assert size(x) == col_size(A)
T = promote_type(eltype(A),eltype(x))
w = zeros(T, row_size(A))
@inbounds for (v,i,j) in A
    w[i] += v*x[j]
end
```

and

```julia
# Compute z = A'*y:
@assert !Base.has_offset_axes(y)
@assert size(y) == row_size(A)
T = promote_type(eltype(A),eltype(y))
z = zeros(T, col_size(A))
@inbounds for (v,i,j) in A
    z[j] += conj(v)*y[i]
end
```

Actual implementations of sparse operators in `LazyAlgebra` are equivalent to
the above examples but should be more efficient because they exploit the
specific storage format of a compressed sparse operator (see
[`CompressedSparseOperator`](@ref), [`SparseOperatorCSR`](@ref),
[`SparseOperatorCSC`](@ref) and [`SparseOperatorCOO`](@ref)).

!!! note
    For now, row and column indices are restricted to be linear indices and
    arguments to the linear mappings implemented by compressed sparse
    operators must be arrays with conventional indexing (1-based linear
    indices) and preferably implementing linear indices (not Cartesian ones).

## Simple construction of compressed sparse operators

Compressed sparse operators only store their structural non-zero elements.  The
abstract super-type of these sparse operators is
`CompressedSparseOperator{F,T,M,N}` which is a direct sub-type of
`SparseOperator{T,M,N}` with an additional parameter `F` to specify the storage
format.  The parameter `F` is specificed as a symbol and can be:

- `:COO` for *Compressed Sparse Coordinate* storage format.  This format is not
  the most efficient, it is mostly used as an intermediate for building a
  sparse operator in one of the following format.

- `:CSC` for *Compressed Sparse Column* storage format.  This format is very
  efficient for applying the adjoint of the sparse operator.

- `:CSR` for *Compressed Sparse Row* storage format.  This format is very
  efficient for directly applying the sparse operator.

To construct a compressed sparse operator in a given format `F` from the values
in a 2-dimensional array `A` call:

```julia
CompressedSparseOperator{F}(A, sel = (v,i,j) -> (v != zero(v)))
```

where optional argument `sel` is a selector function which is called as
`sel(v,i,j)` with `v`, `i` and `j` the value, the row and the column linear
indices for each entries of `A` and which is assumed to yield `true` for the
entries of `A` to be selected in the sparse structure and `false` for the
entries of `A` to discard.  The default selector is such that all non-zeros of
`A` are selected.  As an example, to select the non-zeros of the lower
triangular part of `A`, the constructor can be called as:

```julia
CompressedSparseOperator{F}(A, (v,i,j) -> ((i ≥ j)&(v != zero(v))))
```

Note the (slight) optimization of the expression with a biwise AND `&` instead
of a short-circuiting logical AND `&&` to avoid branching.

By default the values of the structural non-zeros of the sparse operator have
the same type as the elements of `A`, you can enforce a specific element type
`T` with:

```julia
CompressedSparseOperator{F,T}(A[, sel])
```

To generalize the matrix-vector product, a sparse operator can emulate an array
with more than 2 dimensions.  In that case, you must specify the number `M` of
leading dimensions that are considered as the *rows*:

```julia
CompressedSparseOperator{F,T,M}(A[, sel])
```

The number `N` of trailing dimensions that are considered as the *columns* can
also be specified (although they can be automatically guessed):

```julia
CompressedSparseOperator{F,T,M,N}(A[, sel])
```

with the restriction that `M ≥ 1`, `N ≥ 1` and `M + N = ndims(A)`.  Note that
parameter `T` can be `Any` to keep the same element type as `A`.

Finally, the type `V` of the vector used to store the coefficients of the sparse
operator may also be specified:

```julia
CompressedSparseOperator{F,T,M,N,V}(A[, sel])
```

with the restriction that `V` must have standard linear indexing.  The default
is to take `V = Vector{T}`.  As a special case, you can choose a uniform
boolean vector from the
[`StructuredArrays`](https://github.com/emmt/StructuredArrays.jl) package to
store the sparse coefficients:

```julia
CompressedSparseOperator{F,T,M,N,UniformVector{Bool}}(A[, sel])
```

yields a compressed sparse operator whose values are an immutable uniform
vector of `true` values requiring no storage.  This is useful if you want to
only store the sparse structure of the selected values, that is their indices
in the compressed format `F` not their values.

As explained in the last sections, compressed sparse operators can also be
consructed by providing the values of the structural non-zeros and their
respective row and column indices.  As a general rule, to construct (or convert
to) a sparse operator with compressed storage format `F`, you can call:

```julia
CompressedSparseOperator{F}(args...; kwds...)
CompressedSparseOperator{F,T}(args...; kwds...)
CompressedSparseOperator{F,T,M}(args...; kwds...)
CompressedSparseOperator{F,T,M,N}(args...; kwds...)
CompressedSparseOperator{F,T,M,N,V}(args...; kwds...)
```

where given parameters `T`, `M`, `N` and `V`, arguments `args...`
and optional keywords `kwds...` will be passed to the concrete constructor
[`SparseOperatorCOO`](@ref), [`SparseOperatorCSC`](@ref) or
[`SparseOperatorCSR`](@ref) corresponding to the format `F`.  For instance,

```julia
CompressedSparseOperator{:CSR}(A) -> SparseOperatorCSR(A)
```

## Accessing the structural non-zeros

It is possible to use a compressed sparse operator `A` as an iterator:

```julia
for (Aij,i,j) in A # simple but slow for CSR and CSC
    ...
end
```

to retrieve the values `Aij` and respective row `i` and column `j` indices for
all the entries stored in `A`.  It is however more efficient to access them
according to their storage order which depends on the compressed format.

- If `A` is in CSC format:

  ```julia
  using LazyAlgebra.SparseMethods
  for j in each_col(A)        # loop over column index
      for k in each_off(A, j) # loop over structural non-zeros in this column
          i   = get_row(A, k) # get row index of entry
          Aij = get_val(A, k) # get value of entry
       end
  end
  ```

- If `A` is in CSR format:

  ```julia
  using LazyAlgebra.SparseMethods
  for i in each_row(A)        # loop over row index
      for k in each_off(A, i) # loop over structural non-zeros in this row
          j   = get_col(A, k) # get column index of entry
          Aij = get_val(A, k) # get value of entry
       end
  end
  ```

- If `A` is in COO format:

  ```julia
  using LazyAlgebra.SparseMethods
  for k in each_off(A)
       i   = get_row(A, k) # get row index of entry
       j   = get_col(A, k) # get column index of entry
       Aij = get_val(A, k) # get value of entry
  end
  ```

The low-level methods `each_row`, `each_col`, `each_off`, `get_row`, `get_col`
and `get_val` are not automatically exported by `LazyAlgebra`, this is the
purpose of the statement `using LazyAlgebra.SparseMethods`.  These methods may
be extended to implement variants of compressed sparse operators.

## Sparse operators in COO format

Sparse operators in *Compressed Sparse Coordinate* (COO) format store the
significant entries in no particular order, as a vector of values, a vector of
linear row indices and a vector of linear column indices.  It is even possible
to have repeated entries.  This format is very useful to build a sparse
operator.  It can be converted to a more efficient format like *Compressed
Sparse Column* or *Compressed Sparse Row* for fast application of the sparse
linear mapping or of its adjoint.

A sparse operator in with COO storage can be directly constructed by:

```julia
CompressedSparseOperator{:COO}(vals, rows, cols, rowsiz, colsiz)
```

which is the same as:

```julia
SparseOperatorCOO(vals, rows, cols, rowsiz, colsiz)
```

or, if you want to force the element type of the result, one of the following:

```julia
CompressedSparseOperator{:COO,T}(vals, rows, cols, rowsiz, colsiz)
SparseOperatorCOO{T}(vals, rows, cols, rowsiz, colsiz)
```

Here, `vals` is the vector of values of the sparse entries, `rows` and `cols`
are integer valued vectors with the linear row and column indices of the sparse
entries, `rowsiz` and `colsiz` are the sizes of the row and column dimensions.
The entries values and respective linear row and column indices of the `k`-th
sparse entry are given by `vals[k]`, `rows[k]` and `cols[k]`.

For efficiency reasons, sparse operators are currently limited to *fast* arrays
because they can be indexed linearly with no loss of performances.  If `vals`,
`rows` and/or `cols` are not fast arrays, they will be automatically converted
to linearly indexed arrays.

## Sparse operators in CSC format

Sparse operators in *Compressed Sparse Column* (CSC) format store the
significant entries in a column-wise order, as a vector of values, a vector of
corresponding linear row indices and a vector of offsets indicating, for each
column, the range of indices in the vectors of values and of row indices.

A sparse operator in with CSC storage can be directly constructed by:

```julia
CompressedSparseOperator{:CSC}(vals, rows, offs, rowsiz, colsiz)
```

which is the same as:

```julia
SparseOperatorCSC(vals, rows, offs, rowsiz, colsiz)
```

or, if you want to force the element type of the result, one of the following:

```julia
CompressedSparseOperator{:CSC,T}(vals, rows, offs, rowsiz, colsiz)
SparseOperatorCSC{T}(vals, rows, offs, rowsiz, colsiz)
```

Here, `vals` is the vector of values of the sparse entries, `rows` is an
integer valued vector of the linear row indices of the sparse entries, `offs`
is a column-wise table of offsets in these arrays, `rowsiz` and `colsiz` are
the sizes of the row and column dimensions.  The entries values and respective
linear row indices of the `j`-th column are given by `vals[k]` and `rows[k]`
with `k ∈ offs[j]+1:offs[j+1]`.  The linear column index `j` is in the range
`1:n` where `n = prod(colsiz)` is the equivalent number of columns.

For efficiency reasons, sparse operators are currently limited to *fast* arrays
because they can be indexed linearly with no loss of performances.  If `vals`,
`rows` and/or `offs` are not fast arrays, they will be automatically converted
to linearly indexed arrays.

## Sparse operators in CSR format

Sparse operators in *Compressed Sparse Row* (CSR) format store the significant
entries in a row-wise order, as a vector of values, a vector of corresponding
linear column indices and a vector of offsets indicating, for each row, the
range of indices in the vectors of values and of column indices.

A sparse operator in with CSR storage can be directly constructed by:

```julia
CompressedSparseOperator{:CSR}(vals, cols, offs, rowsiz, colsiz)
```

which is the same as:

```julia
SparseOperatorCSR(vals, cols, offs, rowsiz, colsiz)
```

or, if you want to force the element type of the result, one of the following:

```julia
CompressedSparseOperator{:CSR,T}(vals, cols, offs, rowsiz, colsiz)
SparseOperatorCSR{T}(vals, cols, offs, rowsiz, colsiz)
```

Here, `vals` is the vector of values of the sparse entries, `cols` is an
integer valued vector of the linear column indices of the sparse entries,
`offs` is a column-wise table of offsets in these arrays, `rowsiz` and `colsiz`
are the sizes of the row and column dimensions.  The entries values and
respective linear column indices of the `i`-th row are given by `vals[k]` and
`cols[k]` with `k ∈ offs[j]+1:offs[j+1]`.  The linear row index `i` is in the
range `1:m` where `m = prod(rowsiz)` is the equivalent number of rows.

For efficiency reasons, sparse operators are currently limited to *fast* arrays
because they can be indexed linearly with no loss of performances.  If `vals`,
`cols` and/or `offs` are not fast arrays, they will be automatically converted
to linearly indexed arrays.

## Conversion

Calling a sparse operator constructor can also be used to convert between
different formats or to change the type of the stored values.  For example, to
convert a sparse operator `A` into a Compressed Spase Row (CSR) format, the
following calls are equivalent:

```julia
SparseOperatorCSR(A)
CompressedSparseOperator{:CSR}(A)
convert(SparseOperatorCSR, A)
convert(CompressedSparseOperator{:CSR}, A)
```

If `A` is in Compressed Sparse Coordinate (COO) format, entries are sorted and
duplicates merged.  This also occurs when converting from COO format to
Compressed Sparse Column (CSC) format.  Such conversions are very useful as
building a sparse operator in COO format is easier while CSC and CSR formats
are more efficients.

It is sufficient to specify the element type `T` to convert the storage format
and the type of the stored values.  For example, any of the following will
convert `A` to CSC format with element type `T`:

```julia
SparseOperatorCSC{T}(A)
CompressedSparseOperator{:CSC,T}(A)
convert(SparseOperatorCSC{T}, A)
convert(CompressedSparseOperator{:CSC,T}, A)
```

If you just want to convert the type of the values stored by the sparse
operator `A` to type `T` while keeping its storage format, any of the following
will do the job:

```julia
SparseOperator{T}(A)
CompressedSparseOperator{Any,T}(A)
convert(SparseOperator{T}, A)
convert(CompressedSparseOperator{Any,T}, A)
```

As can be seen, specifying `Any` for the format parameter in
`CompressedSparseOperator` is a mean to keep the same storage format.

## Other methods

A sparse operator `S` can be reshaped:

```julia
reshape(S, rowdims, coldims)
```

where `rowdims` and `coldims` are the new list of dimensions for the rows and
the columns, their product must be equal to the product of the former lists of
dimensions (which means that you cannot change the number of elements of the
input and output of a sparse operator).  The reshaped sparse operator and `S`
share the arrays of non-zero coefficients and corresponding row and column
indices, hence reshaping is a fast operation.

The non-zero coefficients of a sparse operator `S` can be unpacked into
a provided array `A`:

```julia
unpack!(A, S; flatten=false) -> A
```

Keyword `flatten` specifies whether to only consider the length of `A` instead
of its dimensions.  In any cases, `A` must have as many elements as `length(S)`
and standard linear indexing.  Just call `Array(S)` to unpack the coefficients
of the sparse operator `S` without providing the destination array or
`Array{T}(S)` if you want to a specific element type `T`.

[LinearInterpolators]: https://github.com/emmt/LinearInterpolators.jl
[SparseArrays]: https://docs.julialang.org/en/latest/stdlib/SparseArrays/#Sparse-Arrays-1
[sparse]: https://docs.julialang.org/en/latest/stdlib/SparseArrays/#SparseArrays.sparse
[SparseMatrixCSC]: https://docs.julialang.org/en/latest/stdlib/SparseArrays/#SparseArrays.SparseMatrixCSC


text:
# development-self-signed-ca-and-cert
that allows you to generate a certificate authority and a certificate to work in the local environment quickly and easily.

#### Requirements

* openssl

#### How works?

1. The script request a name (the project name).
2. The script request a list of domains to sign (separated with ','), for example: acme.local, api.acme.local, *.acme.local
3. The script will be create a certification authority and a server certificate using the project name, after that, will be sign the server certificate usign the ca authority.
5. The script will be open a new window in the location of the generated files.
6. Import the generate caCert.pem in your os or browser.
7. Use the generated .cert in your app (nginx,apache ...).


text:
# nextflow-tutorial

Run Nextflow remotely

```

# Pull from github and run the latest!
nextflow run danielecook/nextflow-tutorial -latest

```

repository: danielecook/nextflow-tutorial

repo_name: danielecook/nextflow-tutorial


text:
---
title: 'Kotlin std-function: apply() and also()'
date: 2019-01-17T00:00:00.000Z
desc: A little notes about apply() and also() function on kotlin
tags:
  - Kotlin
  - android
splash:
  credit: pacman-like Kotlin logo
  url: /assets/img/contents/kotlin.jpg
---

After learning a kotlin and made some apps with it, I came to the realisation that there are a lot of my code that still not use "the kotlin-ways" to solve a problem.
And maybe someone will says like "It's okay, as long as your app is works and you can bought a starbucks coffee from it".

Yeah that is the another reason why I code, I do this for the cup of coffee,
but the another reason is because I like doing it.
I like making a progress and improving my skills.
And while that, I think I'll wrote a simple note for it on my web :)

Anyways, let's just jump into it guys!

![lets-just-jump-into-it](/assets/img/contents/lets-just-jump-into-it.gif)

# Infix Functions No.1 : apply()

By definition, `apply()` accepts a function, and sets its scope to the object on which apply has been invoked.

Okay, That means we can initialize an object properties without even explicitly referencing the object itself, of course as long as we declare it inside the scope of `apply()` itself

Let's take a look about this code :

```kotlin
val sticker = ImageView(this)
sticker.id = R.id.thesticker
sticker.alpha = (input.transparency / 10f)
sticker.isClickable = false
if (fromURI) {
  sticker.setImageURI(Uri.parse(input.uri))
} else {
  sticker.setImageResource(Const.STICKER_LIST[input.index])
  sticker.setColorFilter(input.color)
}
```

as you can see, everytime we set a properties, we need to type the variable name of the `ImageView()` that we initialize before.
with the `apply()` infix, we can forget about that variable name :

```kotlin
val sticker = ImageView(this).apply{
  id = R.id.thesticker
  alpha = (input.transparency / 10f)
  isClickable = false
  if (fromURI) {
    setImageURI(Uri.parse(input.uri))
  } else {
    setImageResource(Const.STICKER_LIST[input.index])
    setColorFilter(input.color)
  }
}
```

# Infix Function No.2 : also()

From the description, it calls the specified function block with `this` value as its argument and returns `this` value.
It maybe sounds confusing to beginners like me, but in practical it very simple.

The `also()` itself will invoke the code inside the scope of `also()`, but also it taking a `this` from the parent scope.

Okay, let's try to apply it into our code before :

```js
val sticker = ImageView(this).apply{
  id = R.id.thesticker
  alpha = (input.transparency / 10f)
  isClickable = false
  if (fromURI)
    setImageURI(Uri.parse(input.uri))
  else
    setImageResource(STICKER_LIST[input.index])
      .also{ setColorFilter(input.color) }
}
```

So, the `setColorFilter()` now are inside the `also()` of `setImageResource()`.
But the context values are still following the `apply()` of our `ImageView()`.
It allow us to chaining multiple functions but still not forgetting that we're still passing our properties to the objects.

...

I hope it’s helpful for you. Thanks!


text:
rxattr: A simple interface to filesystem extended attributes for Ruby
=====================================================================

This was a really quick and dirty wrapper to get xattr support for one
of my projects. Due to limited time, it's not in gem form, sorry. But
maybe it's useful for someone anyway.

Requirements
------------

Just the ffi gem.

Usage
-----

Every File object gains a few methods. xattr acts as an
array-like. You can query attributes via [] and set them via
[]=. Setting an attribute nil will remove it. A list of all keys is
available via listxattr and a hash of all xattrs, key and value, is
available via dumpxattr.

    f = File.new("testfile.txt")
    f.xattr["user.note"] = "Just a text file"
    f.xattr["user.note"]
      => "just a text file"
    f.listxattr
      => ["user.note"]
    f.dumpxattr
      => { "user.note" => "Just a text file"

Caveats
-------

It's far from being good code, but it works. I used it only for
strings, so everything gets converted to UTF_8 before and after
writing/reading.

It's only a thin wrapper. Depending on the system you normally have
only access to a specific namespace. For linux, that's the "user.*"
namespace. Forgetting the "user." part will raise an error.

License
-------

BSD 2-Clause.

Copyright (c) 2012, Sören Finster
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

repository: sf/rxattr

repo_name: sf/rxattr


text:
# Today I Learned

Aisolab이 오늘 새로 배운 것을 다음의 규칙으로 commit 합니다. [thoughtbot til 참고](https://github.com/thoughtbot/til)

## 작성 규칙
* 문서 생성은 [GFM (Github Flavored Markdown)](https://help.github.com/articles/github-flavored-markdown/) 을 사용한다. (확장자 `.md`)
	+ code 실행결과가 필요한 문서의 경우 `.ipynb` 파일을 활용한다. 단 `README.md`에 link 시 [nbviewer](https://nbviewer.jupyter.org/)를 활용한다.
* 언어나 기술명으로 폴더를 만든다. (root에 문서를 만들지 않는다.)
* 파일명은 영어로!
* [좋은 git commit message를 작성하기 위한 7가지 약속](http://meetup.toast.com/posts/106)

---
### CS
* [Variable.md](https://github.com/aisolab/TIL/blob/master/CS/Variable.md)
* [Integer.md](https://github.com/aisolab/TIL/blob/master/CS/Integer.md)
* [Real number.md](https://github.com/aisolab/TIL/blob/master/CS/Real%20number.md)
* [Character and Strings.md](https://github.com/aisolab/TIL/blob/master/CS/Character%20and%20Strings.md)
* [Function.md](https://github.com/aisolab/TIL/blob/master/CS/Function.md)
* [Object-oriented programming.md](https://github.com/aisolab/TIL/blob/master/CS/Object-oriented%20programming.md)
* [Class.md](https://github.com/aisolab/TIL/blob/master/CS/Class.md)

### Git
* [Git_basics.md](https://github.com/aisolab/TIL/blob/master/Git/Git_basics.md)
* [Git_github.md](https://github.com/aisolab/TIL/blob/master/Git/Git_github.md)

### HTML-CSS
* [HTML_basics.md](https://github.com/aisolab/TIL/blob/master/HTML-CSS/HTML_basics.md)
* [HTML intermediates.md](https://github.com/aisolab/TIL/blob/master/HTML-CSS/HTML_intermediates.md)

### Linux
* [Package manager.md](https://github.com/aisolab/TIL/blob/master/Linux/Package%20manager.md)

### Python
* [What is first-class function.md](https://github.com/aisolab/TIL/blob/master/Python/What%20is%20first-class%20function.md)
* [How to handle errors.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20handle%20errors.md)
* [How to use closure.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20use%20closure.md)
* [How to use decorator.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20use%20decorator.md)
* [How to use functional programming.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20use%20functional%20programming.md)
* [How to use argparse module.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20use%20argparse%20module.md)
* [How to use class method and static method.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20use%20class%20method%20and%20static%20method.md)
* [How to implement information hiding.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20implement%20information%20hiding.md)
* [How to use iterator and generator.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20use%20iterator%20and%20generator.md)
* [How to use abstract class.md](https://github.com/aisolab/TIL/blob/master/Python/How%20to%20use%20abstract%20class.md)

### Tensorflow
* [How to simply use tf.data.ipynb](https://nbviewer.jupyter.org/github/aisolab/TIL/blob/master/Tensorflow/How%20to%20simply%20use%20tf.data.ipynb)
* [How to implement reusing variables.ipynb](https://nbviewer.jupyter.org/github/aisolab/TIL/blob/master/Tensorflow/How%20to%20implement%20reusing%20variables.ipynb)
* [How to use TFRecord format.ipynb](https://nbviewer.jupyter.org/github/aisolab/TIL/blob/master/Tensorflow/How%20to%20use%20TFRecord%20format.ipynb)
* [How to use pre-trained models.ipynb](https://nbviewer.jupyter.org/github/aisolab/TIL/blob/master/Tensorflow/How%20to%20use%20pre-trained%20models.ipynb)
* [How to implement data augmentation.ipynb](https://nbviewer.jupyter.org/github/aisolab/TIL/blob/master/Tensorflow/How%20to%20implement%20data%20augmentation.ipynb)

### Clean code
* [CC01_Introduction, Tools and Formatting.md](https://github.com/aisolab/TIL/blob/master/Clean_code/CC01_Introduction%2C%20Tools%20and%20Formatting.md)

### Data structure

### Algorithm
* [bubble_sort.py](https://github.com/aisolab/TIL/blob/master/Algorithm/bubble_sort.py)
* [selection_sort.py](https://github.com/aisolab/TIL/blob/master/Algorithm/selection_sort.py)
* [quick_sort.py](https://github.com/aisolab/TIL/blob/master/Algorithm/quick_sort.py)


text:
# Copy AS versions table
Copy AS versions table to markdown with snippet and bookmarklet.
Useful for creating Jira tickets or comments.

See [snippet](./snippet.js) version for devtools.
See [bokmarklet](./bookmarklet.js) version (minifying by https://babeljs.io/repl).

### Browsers:
* Chrome 56.0.2924.87
* Firefox 52.0 - Use Scratchpad in devtools. Copying from scratchpad doesn't work, use generated button after versions table.
* Safari 10.0.3 - Just run snippet from console.

See [CHANGELOG](./CHANGELOG.md).

repository: chaos-adept/copy-as-version

repo_name: chaos-adept/copy-as-version


text:
[Home](README.md)

# Class 13
## "The Past, Present, and Future of Local Storage for Web Applications."
### What are cookies?
The cookies we see in some sites can be used for local storage of small amounts. There are a few negatives.
1. The site is sometimes slowed down due the application constantly transmitting the same data repeatedly.
2. Sends data unencrypted over the internet
3. Cookies are limited to 4KB of data. This causes your application to slow down.

### DHTML userData
userData is way better than cookies because these allow your web page to store up to 64 KB rather than just about 4KB of data. Adobe introduced a feature in Flash 6 in 2002, this gained the name of "Flash cookies". This allowed the Flash objects to store up to 100KB of data per domain.

### HTML5 Storage Support
1. IE: 8.0+
2. FIREFOX: 3.5+
3. SAFARI: 4.0+
4. CHROME: 4.0+
5. OPERA: 10.5+
6. IPHONE: 2.0+
7. ANDROID: 2.0+
### Web SQL Database Support
1. IE: N/A
2. FIREFOX: N/A
3. SAFARI: 4.0+
4. CHROME: 4.0+
5. OPERA: 10.5+
6. IPHONE: 3.0+
7. ANDROID: 2.0+

(sorry there's not much. I didn't know what to all write down. http://diveinto.html5doctor.com/storage.html)


text:
<IntegrationDetailCard title="Create an enterprise self-built application">

1. If you have not yet opened a Feishu developer account, please go to [Feishu Open Platform](https://open.feishu.cn/?lang=en-US) to create a developer account;
2. In the [Developer Background](https://open.feishu.cn/app?lang=en-US), click "Create an enterprise self-built application";
3. Enter **application name** and **application description**, and upload the logo;

<EMAIL_ADDRESS>

4. Click the "OK Create" button.

</IntegrationDetailCard>

<IntegrationDetailCard title="Get app credentials">

After the creation is complete, click the application you just created to enter the application details page:

<EMAIL_ADDRESS>

1. On the **Certificate and Basic Information** page of Feishu application details, you can get the **App ID** and **App Secret** of the application, and copy these two values;

2. On the [Authing Console](https://console.authing.cn) **Connect Identity Source** - **Social Login** page, find the **Feishu Enterprise Self-built Application**;

<EMAIL_ADDRESS>

3. Fill the form with **App ID** and **App Secret**:

<EMAIL_ADDRESS>

4. Click the "Save" button.

</IntegrationDetailCard>

<IntegrationDetailCard title="Enable web functionality">

1. On the **App Features** - **Webpage** page of Feishu application details, click the **Enable Webpage** button, and the webpage settings can be ignored.

<EMAIL_ADDRESS>

Finally click save.

</IntegrationDetailCard>

<IntegrationDetailCard title="Configure redirect URL">

1. On the **Security Settings** page of Feishu app details, add the following link to the list of redirect URLs:

```
https://core.authing.cn/connection/social/{Unique Identifier}/{YOUR_USERPOOL_ID}/callback
```

> Replace `{Unique Identifier}` with the unique identifier filled in by the identity provider you are creating by Authing, and replace `{YOUR_USERPOOL_ID}` with your [UserPool ID](/en/guides/faqs/get-userpool-id-and-secret.md)。

<EMAIL_ADDRESS>

After replacing, click the "Add" button.

</IntegrationDetailCard>

<IntegrationDetailCard title="Apply for permission">

1.On the **Permission Management** page of Feishu application details, select the permissions required by the application, such as:

- Get user email;
- Get the user's mobile phone number;
- Get user userid;
- Obtain user ID through mobile phone number or email;
- Obtain basic user information;
- Get user unified ID;
- access the address book as an app;

<EMAIL_ADDRESS>

After setting permissions, you need to publish the latest version.

</IntegrationDetailCard>

<IntegrationDetailCard title="Publish the app">

1. On the **Version Management and Release** page of Feishu application details, click **Create Version** in the upper right corner:

<EMAIL_ADDRESS>

2. Fill in **App version number** (in the format like `1.0.0`) and **Update description**, set the availability status, and finally click Save:

<EMAIL_ADDRESS>

3. After saving, click Apply to Publish:

<EMAIL_ADDRESS>

4. After submitting the application, your enterprise administrator will review it, and the review result will be sent to you through Feishu and the developer backend. For details, please refer to [Feishu Documents - Developing Enterprise Self-built Applications](https://open.feishu.cn/document/uQjL04CN/ukzM04SOzQjL5MDN?lang=en-US).

</IntegrationDetailCard>

repository: Authing/docs

repo_name: Authing/docs


text:
[//000000001]: # (mkdoc \- Source code documentation using Markdown)
[//000000002]: # (Generated from file 'mkdoc\.man' by tcllib/doctools with format 'markdown')
[//000000003]: # (Copyright © 2019\-2022, Detlef Groth <detlef\(at\)dgroth\(dot\)de>)
[//000000004]: # (mkdoc\(n\) 0\.7\.0 tcllib "Source code documentation using Markdown")

 [ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

# NAME

mkdoc \- Extracts and optionally converts Markdown comments in source code to
HTML

# Table Of Contents

  - [Table Of Contents](#toc)

  - [Synopsis](#synopsis)

  - [Description](#section1)

  - [Examples](#section2)

  - [Formatting](#section3)

  - [Bugs, Ideas, Feedback](#section4)

  - [Code Copyright](#section5)

  - [Category](#category)

  - [Copyright](#copyright)

# SYNOPSIS

package require Tcl 8\.6
package require Markdown ?1\.2\.1?
package require yaml ?0\.4\.1?
package require mkdoc ?0\.7\.0?
package require hook

[__::mkdoc::mkdoc__ *infile* *outfile* ?__\-css__ *cssfile*?](#1)
[__::mkdoc::run__ *infile*](#2)

# DESCRIPTION

The package __mkdoc__ provides a command to extract documentation embedded
in code and optionally convert these comments into HTML\. The latter uses
Tcllib's __[Markdown](\.\./markdown/markdown\.md)__ package\. Each line of
the embedded documentation begins with the special comment marker __\#'__\.

  - __::mkdoc::mkdoc__ *infile* *outfile* ?__\-css__ *cssfile*?

    The command reads the specified *infile* and extracts the code comments
    introduced by the __\#'__ marker\. If the *outfile* is either a "\.html"
    or "\.htm" file the Markdown is converted into HTML using either a default
    style or the specified style sheet *cssfile*\.

    All arguments are paths to the files to read from or write to\.

    The result of the command is the empty string\.

    See section [Formatting](#section3) for the supported Markdown syntax
    and extensions to it\.

  - __::mkdoc::run__ *infile*

    The command reads the specified *infile*, extracts the embedded
    documentation, and then executes the contents of the first example, i\.e\.
    __\`\`\`__\-quoted block, found in the __Example__ section\.

    Here is such an example which will be executed by the Tcl interpreter

        #' ## Example
        #'
        #' ```
        #' puts "Hello mkdoc package"
        #' puts "I am in the example section"
        #' ```

    *DANGER, BEWARE*\. Failing to open the *infile* causes the command to
    *exit* the entire process\.

    Use of this command in a general context is not recommended\.

# Examples

The example below demonstrates the conversion of the documentation embedded into
the file "mkdoc\.tcl" itself:

    package require mkdoc
    # extracting the Markdown
    mkdoc::mkdoc mkdoc.tcl mkdoc.md
    # converting Markdown to HTML
    mkdoc::mkdoc mkdoc.md mkdoc.html
    # direct conversion without intermediate file
    mkdoc::mkdoc mkdoc.tcl mkdoc.html

# Formatting

The package supports the syntax supported by Tcllib's
__[Markdown](\.\./markdown/markdown\.md)__ package\.

It further supports a set of simple YAML headers whose information is inserted
into appropriate HTML __meta__\-tags\. The supported keys are

  - __author__

    Set the document author\. Defaults to __NN__\.

  - __title__

    Set the document title\. Defaults to __Documentation ____filename__\]\.

  - __date__

    Sets the document date\. Defaults to the current day\.

  - __css__

    Sets a custom CSS stylesheet\. Defaults to the internal mkdoc sheet\.

*Note* that in Markdown output mode these headers are simply passed through
into the result\. This is proper, as processors like __pandoc__ are able to
use them as well\.

See the example below for the syntax:

    #' ---
    #' title: mkdoc::mkdoc 0.7.0
    #' author: Detlef Groth, Schwielowsee, Germany
    #' date: 2022-04-17
    #' css: mini.css
    #' ---
    #'

Another extension over standard Markdown is the support of a single level of
includes\.

See the example below for the syntax:

    #' #include "path/to/include/file"

*Note*, the double\-quotes around the path are part of the syntax\.

*Beware* further that relative paths are resolved relative to the current
working directory, and *not* relative to the location of the including file\.

# Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and
other problems\. Please report such to the author of this package\. Please also
report any ideas for enhancements you may have for either package and/or
documentation\.

# Code Copyright

BSD License type:

The following terms apply to all files a ssociated with the software unless
explicitly disclaimed in individual files\.

The authors hereby grant permission to use, copy, modify, distribute, and
license this software and its documentation for any purpose, provided that
existing copyright notices are retained in all copies and that this notice is
included verbatim in any distributions\. No written agreement, license, or
royalty fee is required for any of the authorized uses\. Modifications to this
software may be copyrighted by their authors and need not follow the licensing
terms described here, provided that the new terms are clearly indicated on the
first page of each file where they apply\.

In no event shall the authors or distributors be liable to any party for direct,
indirect, special, incidental, or consequential damages arising out of the use
of this software, its documentation, or any derivatives thereof, even if the
authors have been advised of the possibility of such damage\.

The authors and distributors specifically disclaim any warranties, including,
but not limited to, the implied warranties of merchantability, fitness for a
particular purpose, and non\-infringement\. This software is provided on an "as
is" basis, and the authors and distributors have no obligation to provide
maintenance, support, updates, enhancements, or modifications\.

*RESTRICTED RIGHTS*: Use, duplication or disclosure by the government is
subject to the restrictions as set forth in subparagraph \(c\) \(1\) \(ii\) of the
Rights in Technical Data and Computer Software Clause as DFARS 252\.227\-7013 and
FAR 52\.227\-19\.

# CATEGORY

Text processing

# COPYRIGHT

Copyright © 2019\-2022, Detlef Groth <detlef\(at\)dgroth\(dot\)de>

repository: markemer/macports-base

gha_language: Tcl

repo_name: markemer/macports-base


text:
# CodePass
Javascript module for [CodePass](https://api.breezecodes.com/)

# Usage
This module requires [node-fetch](https://www.npmjs.com/package/node-fetch). If you are going to use it in your own project, please install it with npm i node-fetch

# Where do I get this?
You can clone the repo and run npm i and npm run build.
You can also get it from [Github Actions](https://github.com/mygizli04/CodePass/actions). (Click on the latest run, scroll down, and download "CodePass")

# API Keys
How to get API keys is detailed on [the CodePass website](https://api.breezecodes.com/).

# Documentation
Documentation is available at [my website](https://sbeve.me/CodePass/docs/)

# Example

This module is built with typescript, so it comes with .d.ts files! But here's a javascript example showing all possible errors/uses.
```javascript
// Import codepass
const codepass = require('./codepass.js')

// Create account
// Note: All methods in this lib are async functions
codepass.create("YOUR-API-KEY", "USERNAME", "PASSWORD").then(() => {
    console.log("Created account!")
}).catch(err => {
    // Uh oh, account creation failed! Let's see why...

    switch (err) {
        case "Username already in use.":
            console.error("Sorry, the username you have chosen is already in use. Please try again.");
            break;
        case "Invalid API key.":
            console.error("Uh oh, my developer has to fix my API key!");
            break;
        default:
            console.error("Oh no, some internal error! Do you have an internet connection?");
            break;
    }

    process.exit(1);
})

// Check account
codepass.check("YOUR-API-KEY", "USERNAME", "PASSWORD").then(result => {
    // result === [true/false, CheckResult] (see https://sbeve.me/CodePass/docs/modules.html#CheckResult)

    if (result[0]) {
        console.log("Success!");
    }
    else {
        console.error("Failure because of " + result[1]);
    }
}).catch(err => {
    // Oops! An error occured! Your API token is probably incorrect.
    if (err === "Invalid API key.") {
        console.error("Oops. Please ask my dev to fix me.");
        process.exit(1);
    }
    else {
        // If you're here it's an internal error. Check your internet connection!
        console.error("Uh oh, it appears there are some internal errors that I cannot fix!");
        process.exit(1);
    }

});
```