text:
# facebook_audience_network
![Pub](https://img.shields.io/pub/v/facebook_audience_network.svg) ![GitHub](https://img.shields.io/github/license/dreamsoftin/facebook_audience_network.svg)

[Facebook Audience Network](https://developers.facebook.com/docs/audience-network) plugin for Flutter applications (Android & iOS).

| Banner Ad | Native Banner Ad | Native Ad |
| - | - | - |
| ![Banner Ad](https://raw.githubusercontent.com/dreamsoftin/facebook_audience_network/master/example/gifs/banner.gif "Banner Ad") | ![Native Banner Ad](https://raw.githubusercontent.com/dreamsoftin/facebook_audience_network/master/example/gifs/native_banner.gif "Native Banner Ad") | ![Native Ad](https://raw.githubusercontent.com/dreamsoftin/facebook_audience_network/master/example/gifs/native.gif "Native Ad") |

| Interstitial Ad | Rewarded Video Ad |
| - | - |
| ![Interstitial Ad](https://raw.githubusercontent.com/dreamsoftin/facebook_audience_network/master/example/gifs/interstitial.gif "Interstitial Ad") | ![Rewarded Ad](https://raw.githubusercontent.com/dreamsoftin/facebook_audience_network/master/example/gifs/rewarded.gif "Rewarded Video Ad") |

---
## Getting Started

### 1. Initialization:

For testing purposes you need to obtain the hashed ID of your testing device. To obtain the hashed ID:

1. Call `FacebookAudienceNetwork.init()` during app initialization.
2. Place the `FacebookBannerAd` widget in your app.
3. Run the app.

The hased id will be in printed to the logcat. Paste that onto the `testingId` parameter.

```dart
FacebookAudienceNetwork.init(
  testingId: "37b1da9d-b48c-4103-a393-2e095e734bd6", //optional
  iOSAdvertiserTrackingEnabled: true //default false
);
```
##### IOS Setup
In Pod file, set the IOS deployment target version to 9.0

*IN iOS, Banner, Interstital and Native Ads are supported*

---
### 2. Show Banner Ad:

```dart
Container(
  alignment: Alignment(0.5, 1),
  child: FacebookBannerAd(
    placementId: Platform.isAndroid ? "YOUR_ANDROID_PLACEMENT_ID" : "YOUR_IOS_PLACEMENT_ID",
    bannerSize: BannerSize.STANDARD,
    listener: (result, value) {
      switch (result) {
        case BannerAdResult.ERROR:
          print("Error: $value");
          break;
        case BannerAdResult.LOADED:
          print("Loaded: $value");
          break;
        case BannerAdResult.CLICKED:
          print("Clicked: $value");
          break;
        case BannerAdResult.LOGGING_IMPRESSION:
          print("Logging Impression: $value");
          break;
      }
    },
  ),
)
```
---
### 3. Show Interstitial Ad:

```dart
FacebookInterstitialAd.loadInterstitialAd(
  placementId: "YOUR_PLACEMENT_ID",
  listener: (result, value) {
    if (result == InterstitialAdResult.LOADED)
      FacebookInterstitialAd.showInterstitialAd(delay: 5000);
  },
);
```
---
### 4. Show Rewarded Video Ad:
(Android Only)

```dart
FacebookRewardedVideoAd.loadRewardedVideoAd(
  placementId: "YOUR_PLACEMENT_ID",
  listener: (result, value) {
    if(result == RewardedVideoResult.LOADED)
      FacebookRewardedVideoAd.showRewardedVideoAd();
    if(result == RewardedVideoResult.VIDEO_COMPLETE)
      print("Video completed");
  },
);
```
---
### 5. Show Native Ad:
- NativeAdType NATIVE_AD_HORIZONTAL & NATIVE_AD_VERTICAL ad types are supported only in iOS. In Android use NATIVE_AD.
```dart
FacebookNativeAd(
  placementId: "YOUR_PLACEMENT_ID",
  adType: NativeAdType.NATIVE_AD,
  width: double.infinity,
  height: 300,
  backgroundColor: Colors.blue,
  titleColor: Colors.white,
  descriptionColor: Colors.white,
  buttonColor: Colors.deepPurple,
  buttonTitleColor: Colors.white,
  buttonBorderColor: Colors.white,
  keepAlive: true, //set true if you do not want adview to refresh on widget rebuild
  keepExpandedWhileLoading: false, // set false if you want to collapse the native ad view when the ad is loading
  expandAnimationDuraion: 300, //in milliseconds. Expands the adview with animation when ad is loaded
  listener: (result, value) {
    print("Native Ad: $result --> $value");
  },
),
```
---
### 6. Show Native Banner Ad:
Use `NativeBannerAdSize` to choose the height for Native banner ads. `height` property is ignored for native banner ads.

```dart
FacebookNativeAd(
  placementId: "YOUR_PLACEMENT_ID",
  adType: NativeAdType.NATIVE_BANNER_AD,
  bannerAdSize: NativeBannerAdSize.HEIGHT_100,
  width: double.infinity,
  backgroundColor: Colors.blue,
  titleColor: Colors.white,
  descriptionColor: Colors.white,
  buttonColor: Colors.deepPurple,
  buttonTitleColor: Colors.white,
  buttonBorderColor: Colors.white,
  listener: (result, value) {
    print("Native Ad: $result --> $value");
  },
),
```
---
**Check out the [example](https://github.com/dreamsoftin/facebook_audience_network/tree/master/example) for complete implementation.**

iOS wrapper code contribution by **lolqplay team from birdgang**

### Note: Instream video ad has been removed by Facebook. Read more [here](https://www.facebook.com/business/help/645132129564436?id=211412110064838)

## Future Work
Implement Rewarded video for iOS platform.


text:
This directory contains the Passenger main source code. There are source files written in various programming languages, including C++, Ruby and Javascript. Browse to a subdirectory for a README which explains that particular subdirectory.

If you aren't familiar with the Passenger codebase then we encourage you to read these first:

 * [Contributors Guide](https://github.com/phusion/passenger/blob/master/CONTRIBUTING.md)
 * [Design & Architecture](https://www.phusionpassenger.com/documentation/Design%20and%20Architecture.html)
 * [Code walkthrough](http://vimeo.com/phusionnl/review/98027409/03ba678684)

license: MIT

repository: phusion/passenger

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: phusion/passenger


text:
# Node Web Scraper

## Overview

A modular template for web scraping with Node.js.
It serves as a starting point for any future web scraping project.

## Features

* Modular (separate functionalities: connectors, scrapers, DAOs)
* Stores data in SQLite DB
* Logs
* Supports multiple environments: production, development, test

## General idea

* Each URL has its own [**connector**](./connectors/) responsbile only for getting the HTML
* Each HTML has its own [**scraper**](./scrapers/) responsible only for extracting data
* Each [**DB table**](./db/tables/) has its own class responsible for manipulating data in this table
* [**Scripts**](./scripts/) are the main files, entry points. They are run using **npm scripts**
* Different [**config**](./config/) is loaded based on selected environment. Config determines database file path and logging options.
* Each day has its own [**log file**](./logs/)

## Prerequesities

* [Node.js](https://nodejs.org/en 'Node.js download page') `>=16.13.0`

## Example usage

```bash
git clone https://github.com/schwastek/node-web-scraper.git

cd node-web-scraper
npm install

# Run in production mode
npm run prod:update-products

# Run in development mode
npm run dev:update-products
```

Logic:

1. Scrape companies from [dummy website](https://schwastek.github.io/node-web-scraper/dummy-website/companies.html) and insert them into DB
2. Get companies from DB
3. Scrape products of each company

![Example usage](./docs/img/example-usage.png)

# Project architecture

```
📦node-web-scraper
 ┣ 📂config         # config for each environment
 ┣ 📂connectors     # connector for every URL
 ┣ 📂db             # DB files and handlers for every DB table
 ┣ 📂logs           # 1 log file = 1 day
 ┣ 📂scrapers       # scraper for every URL
 ┣ 📂scripts        # main files
 ┣ 📂test           # test files
```

## Config

```
📂config
 ┣ 📜config.js
 ┣ 📜config.dev.js
 ┣ 📜config.prod.js
 ┗ 📜config.test.js
```
Environment is determined based on `NODE_ENV` variable.

`NODE_ENV` variable is set by **npm script** in `package.json`.

NPM scripts use [cross-env](https://www.npmjs.com/package/cross-env "Sets and uses environment variables across platforms")
which takes care of setting variables properly independently from OS (Linux or Windows).

[Debugging in VS Code](https://code.visualstudio.com/docs/editor/debugging#_launchjson-attributes "Debugging in Visual Studio Code - launch.json attributes") starts in **development** mode (set by `env` attribute in `launch.json`). Tests are using **test** environment.

## Connectors

```
📂connectors
 ┣ 📜companies.js
 ┗ 📜products.js
```

Connectors are responsible _only_ for getting response body HTML from specific URL.
Each URL has its own connector class.

## Database

```
📂db
 ┣ 📂files               # each environment has its own DB file
 ┃ ┣ 📜dev.db
 ┃ ┣ 📜prod.db
 ┃ ┗ 📜test.db
 ┣ 📂tables              # each table has its own file
 ┃ ┣ 📜companies.js
 ┃ ┣ 📜products.js
 ┣ 📜database.js         # DB connector
```

Data is saved to a different DB based on currently set environment.
Each DB table has its own DAO class.

**Note:** You can use [SQLiteStudio](https://sqlitestudio.pl/ "SQLite database manager") to browse `.db` files.

## Logs

```
📂logs
 ┣ 📂files
 ┃ ┣ 📂dev
 ┃ ┃ ┣ 📜2020-03-01.log
 ┃ ┃ ┣ 📜2020-03-02.log
 ┃ ┗ 📂prod
 ┃ ┃ ┣ 📜2020-03-11.log
 ┗ 📜logger.js              # logger instance
```

Each day has its own `.log` file e.g. `2020-03-04.log` in JSON format.

All logs output to the console or a file. I don't avoid client-side console logs in production. Ultimately, it's an npm script being executed from the CLI, you want to know what's happening.

**Note:** Logging is disabled in test environment.

## Scrapers

```
📂scrapers
 ┣ 📜companies.js
 ┗ 📜products.js
```

Scrapers are responsible _only_ for extracting data from passed HTML.

## Scripts

```
📂scripts
 ┗ 📜update-products.js
```

Scripts are the top-level callers, **they put all the pieces together**.
Also, it's the only place where logging and error handling happen.

Scripts are run using npm (`scripts` field in `package.json`).
You can run them with `npm run <script-name>`.

## Tests

```
📂test
 ┗ 📜update-products.test.js
```
Use `npm test` CLI command to run the tests.

repository: schwastek/node-web-scraper

branch_name: refs/heads/master

gha_language: JavaScript

repo_name: schwastek/node-web-scraper


text:
Each language port of Diff Match Patch uses the [same API](API).  These are the language-specific notes regarding **Lua**.

A critical note with Lua is that (unlike most other languages) it does not have any awareness of Unicode.  Thus:

```string.len("中国") → 6```

Strings in Lua are treated as a series of bytes, not a series of characters.  This means that the functions in Diff Match Patch may return unexpected and non-printable results as it splits characters at the byte level.

A side effect of the lack of Unicode support is that the line-mode speedup in diff is not available.

### Hello World

Here's a minimal example of a diff in Lua:

```lua
local dmp = require 'diff_match_patch'

diff = dmp.diff_main('Hello World.', 'Goodbye World.')
-- Result: [(-1, "Hell"), (1, "G"), (0, "o"), (1, "odbye"), (0, " World.")]
dmp.diff_cleanupSemantic(diff)
-- Result: [(-1, "Hello"), (1, "Goodbye"), (0, " World.")]
for i,tuple in ipairs(diff) do
  print('(' .. tuple[1] .. ', ' .. tuple[2] .. ')')
end
```

Go to the `lua` directory and save the above program as `hello.lua`.  Then execute `lua hello.lua`.

### Tests

Unit tests can be performed from the `lua/tests` directory by executing `lua diff_match_patch_test.lua`.  Over twenty test groups should run, with zero failures.

Speed test for diff can be performed from the `lua/tests` directory by executing `lua speedtest.lua`.  It takes about 15 seconds.

gha_language: Python


text:
---
layout: post
title: Data Science Portfolio - Content - Project Indexing
project: overview
series: Project Organisation
published: true
categories: [data science, project, content management]
tags: [strategy]
---

## Introduction

Now that we have the project html layouts sorted, the next challenge is to populate them seamlessly. Seamlessly, being the operative word due to the fact that the degree of content linkage precludes manual linking. Why? As more content is added, updating and relinking content becomes quickly impractical.

The simple answer to that in the Jekyll framework is the [includes](http://jekyllrb.com/docs/includes/) functionality.

## Includes Project Index

This file is included in the **`project_index_page.html`** layout file within a div element as follows:

{% highlight liquid %}
{% raw %}{% include project_index.html %}{% endraw %}
{% endhighlight %}

The basic logic is:

1. Iterate through all of the pages on the site
2. Select pages that match the following criteria:
* pages with the project layout
* pages that do not match the project assigned to **`project_index_page.html`**.
3. Extract the page title and URL
4. Include the abstract within the project index entry

## Includes project abstract

In the process outlined in the section [above](#includes-project-index), step 4 proved the most challenging. This is because the inclusion of the abstract file was more complicated than expected.

Inclsion of the project abstract within [project pages]({{ site.baseurl }}{% post_url 2017-03-07-project-mgt-page-layouts %}#project-pages) was a simple matter, as both files are intended to exist in the same subdirectory, hence the simple includes call in the project page layout:

{% highlight liquid %}
{% raw %}{% include abstract.html %}{% endraw %}
{% endhighlight %}

However, when including a file that is not in the same directory or within the **`_includes`** subdirectory it needs to be included with an [includes relative](http://jekyllrb.com/docs/includes/#including-files-relative-to-another-file) Liquid tag. This essentially extracts the file from the chosen path, which is relative to the **`projects/`** directory, which is the parent of the directory where all the abstracts should exist.

{% highlight liquid %}
{% raw %}{% include_relative project_dir/abstract.html %}{% endraw %}
{% endhighlight %}

This was NOT as simple as it first seemed :alien:. However, after some searching I was able to find a useful solution. This essentially involved splitting of each selected project page path in order to obtain the project directory path segment so that it could be captured and prefixed to the **`abstract.html`** path segment. I got my inspiration [here](http://stackoverflow.com/questions/27433649/reuse-file-path-in-jekyll#27434079) and basically cribbed the entire solution, tweaking it to exclude first path element (the project parent dir) from the reconstructed path, using a [minus](https://help.shopify.com/themes/liquid/filters/math-filters#minus) subtraction filter, to properly locate each file. The code section that delivered the completed solution was this:

{% highlight liquid %}
{% raw %}{% include_relative {{path}}/{{page.abstract}} %}{% endraw %}
{% endhighlight %}

## Styling

Now that the index page was laid out, it was time to add some styling. I fiddled with the styling of [borders](https://www.w3schools.com/cssref/pr_border-top_style.asp) (and [here](https://www.w3schools.com/cssref/pr_border-style.asp)); text [indentation](https://www.w3schools.com/cssref/pr_text_text-indent.asp) and [alignment](https://www.w3schools.com/cssref/css3_pr_text-justify.asp); font [weight](https://www.w3schools.com/cssref/pr_font_weight.asp) and [styling](https://www.w3schools.com/cssref/pr_font_font-style.asp); and CSS [padding](https://www.w3schools.com/CSS/css_padding.asp) and [margin](https://www.w3schools.com/CSS/css_margin.asp).

At the moment, the styles are implemented in **project_overview_page.html** based on html elements created and defined in the **project_index.html** includes fragment. Once I am finished with the styling, I will include the final styling in the main CSS file, as previously done in an [earlier post]({{ site.baseurl }}{% post_url 2016-11-08-setup-us-the-blog-part4-in-series %}).

## Conclusion

This was an important milestone to accomplish, because I now have a mechanism to automatically cataloque, build and showcase all the projects by simply building a project page to summarise its content and supply a brief abstract :smile::smile:.


text:
# filesystem watch

[![npm package](https://img.shields.io/npm/v/@dmail/filesystem-watch.svg)](https://www.npmjs.com/package/@dmail/filesystem-watch)
[![build](https://travis-ci.com/dmail/filesystem-watch.svg?branch=master)](http://travis-ci.com/dmail/filesystem-watch)
[![codecov](https://codecov.io/gh/dmail/filesystem-watch/branch/master/graph/badge.svg)](https://codecov.io/gh/dmail/filesystem-watch)

> Watch changes on your filesystem, either in a folder or on a specific file.

## Introduction

`@dmail/filesystem-watch` has the following exports.

- `registerFolderLifecycle`
- `registerFileLifecycle`

## `registerFolderLifecycle` example

`registerFolderLifecycle` is meant to be used when you need to something in sync with a given folder contents.

```js
import { registerFolderLifecycle } from "@dmail/filesystem-watch"

const folderContentMap = {}
registerFolderLifecycle("/Users/you/folder", {
  added: ({ relativePath, type ) => {
    folderContentMap[relativePath] = type
  },
  removed: ({ relativePath }) => {
    delete folderContentMap[relativePath]
  },
})
```

— see [`registerFolderLifecycle` documentation](./docs/register-folder-lifecycle-doc.md)

## `registerFileLifecycle` example

`registerFileLifecycle` is meant to be used when you need to do something in sync with a given file content.

```js
import { readFileSync } from "fs"
import { registerFileLifecycle } from "@dmail/filesystem-watch"

const path = "/Users/you/folder/config.js"
let currentConfig = null
registerFileLifecycle(path, {
  added: () => {
    currentConfig = JSON.parse(String(readFileSync(path)))
  },
  updated: () => {
    currentConfig = JSON.parse(String(readFileSync(path)))
  },
  removed: () => {
    currentConfig = null
  },
})
```

— see [`registerFileLifecycle` documentation](./docs/register-file-lifecycle-doc.md)

## Installation

```console
npm install<EMAIL_ADDRESS>```

## Why ?

I needed something capable to watch file changes on the filesystem.

The documentation of fs.watch makes it clear that you cannot really use it directly because it has several limitations specific to the filesystem.

Then I tried chokidar, a wrapper around fs.watch. However I could not fully understand what chokidar was doing under the hood.

What I needed was small wrapper around fs.watch that do not shallow events sent by the operating system. Ultimately chokidar could maybe do what I need but it's a bit too big for my use case.

— see [fs.watch documentation](https://nodejs.org/docs/latest/api/fs.html#fs_fs_watch_filename_options_listener)

— see [chokidar on github](https://github.com/paulmillr/chokidar)

## fs.watch caveats

Everywhere:

- Writing a file emits a `change` as chunk gets written in the file.
- Trigger `change` on folder when something inside folder changes
- might send event with filename being null (never reproduced yet)

On mac:

- Trigger `rename` instead of `change` when updating a file

On linux:

- recursive option not supported

On windows:

- filesystem emits nothing when a file is removed
- removing a watched folder throw with EPERM error

repository: dmail-old/filesystem-watch

repo_name: dmail-old/filesystem-watch


text:
# Device.swift [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
Super-lightweight library to detect used device

## Usage

`Device.swift` extends the `UIDevice` class by adding a `deviceType: DeviceType` property.

```swift
import Device

let deviceType = UIDevice.currentDevice().deviceType

switch deviceType {
case .IPhone6SPlus: print("Do stuff for iPhone6S Plus")
case .IPadMini: print("Do stuff for iPad mini")
default: print("Check other available cases of DeviceType")
}
```

### Available `DeviceType` cases

```swift
enum DeviceType {
    case NotAvailable

    case IPhone2G
    case IPhone3G
    case IPhone3GS
    case IPhone4
    case IPhone4S
    case IPhone5
    case IPhone5C
    case IPhone5S
    case IPhone6Plus
    case IPhone6
    case IPhone6S
    case IPhone6SPlus

    case IPodTouch1G
    case IPodTouch2G
    case IPodTouch3G
    case IPodTouch4G
    case IPodTouch5G

    case IPad
    case IPad2
    case IPad3
    case IPad4
    case IPadMini
    case IPadMiniRetina
    case IPadMini3

    case IPadAir
    case IPadAir2

    case Simulator
}
```

## Install

### Carthage

Add the following to your `Cartfile` and follow [these instructions](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application)

```
github "schickling/Device.swift"
```

### CocoaPods

CocoaPods 0.36 adds supports for Swift and embedded frameworks. To integrate `Device` into your project add the following to your `Podfile`:

```ruby
platform :ios, '8.0'
use_frameworks!

pod 'Device.swift'
```


text:
### [CVE-2021-25975](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-25975)
![](https://img.shields.io/static/v1?label=Product&message=publify_core&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=%3E%3D%20v8.0%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-79%20Cross-site%20Scripting%20(XSS)&color=brighgreen)

### Description

In publify, versions v8.0 to v9.2.4 are vulnerable to stored XSS as a result of an unrestricted file upload. This issue allows a user with “publisher” role to inject malicious JavaScript via the uploaded html file.

### POC

#### Reference
- https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25974

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

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

repo_name: trickest/cve


text:
---
description: Material color. The principal color for solid color materials and the additive color for colorized texture materials.
seo-description: Material color. The principal color for solid color materials and the additive color for colorized texture materials.
seo-title: Color
solution: Experience Manager
title: Color
topic: Scene7 Image Serving - Image Rendering API
uuid: 5bf6c586-8165-4a2b-97a3-ba88bb9f72df
---

# Color{#color}

Material color. The principal color for solid color materials and the additive color for colorized texture materials.

## Properties {#section-073772b43b264b37bd96d1fb7404d10b}

Color. Required for solid color materials. Optional for repeatable texture, cabinet, and window covering materials, to specify the colorization color. This field must be left empty if the color of a repeatable texture or cabinet materials is not to be modified.

## Default {#section-bf2c2ec642ed47da880ae2943b7d2c18}

None.

## See also {#section-5e7e4a3cd0f745ab99a061db6f9bdfc7}

[color=](../../../../../ir-api/http-protocol/image-rendering-api-ref/c-ir-http-protocol-ref/c-ir-http-protocol-command-reference/r-ir-http-color.md#reference-ea3cba9edfe94dbab86d8f123a9ed0aa)


text:
# Django DRF Elasticsearch

## Want to learn how to build this?

Check out the [post](https://testdriven.io/blog/django-drf-elasticsearch/).

## Want to use this project?

1. Fork/Clone

2. [Install Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html) if you haven't already and make sure it is running on port `9200`.

3. Create and activate a virtual environment:

    ```sh
    $ python3 -m venv venv && source venv/bin/activate
    ```

4. Install the requirements:

    ```sh
    (venv)$ pip install -r requirements.txt
    ```

5. Apply the migrations:

    ```sh
    (venv)$ python manage.py migrate
    ```

6. Populate the database with some test data by running the following command:

    ```sh
    (venv)$ python manage.py populate_db
    ```

7. Create and populate the Elasticsearch index and mapping:

    ```sh
    (venv)$ python manage.py search_index --rebuild
    ```

8. Run the server

    ```sh
    (venv)$ python manage.py runserver
    ```

9. Test Elasticsearch with the following queries:

     - [http://<IP_ADDRESS>:8000/search/user/mike/](http://<IP_ADDRESS>:8000/search/user/mike/) - should find the user 'mike13'
     - [http://<IP_ADDRESS>:8000/search/user/jess_/](http://<IP_ADDRESS>:8000/search/user/jess_/) - should find the user 'jess_'
     - [http://<IP_ADDRESS>:8000/search/category/seo/](http://<IP_ADDRESS>:8000/search/category/seo/) - should find the category 'SEO optimization'
     - [http://<IP_ADDRESS>:8000/search/category/progreming/](http://<IP_ADDRESS>:8000/search/category/progreming/) - should find the category 'Programming' (:warning: notice the typo)
     - [http://<IP_ADDRESS>:8000/search/article/linux/](http://<IP_ADDRESS>:8000/search/article/linux/) - should find the article 'Installing the latest version of Ubuntu'
     - [http://<IP_ADDRESS>:8000/search/article/java/](http://<IP_ADDRESS>:8000/search/article/java/) - should find the article 'Which programming language is the best?'

repository: yvdjee/django-drf-elasticsearch

repo_name: yvdjee/django-drf-elasticsearch


text:
[TOC]

# 1 Introdution
In this article, we will see an example of the __S__ ingle __R__ esponsibility __P__ rinciple in Cplusplus along with its benefits & generic guideline:

* [x] __S__ RP - Single Responsibility Principle
* [ ] __O__ CP - Open/Closed Principle
* [ ] __L__ SP - Liskov Substitution Principle
* [ ] __I__ Sp - Interface Segregation Principle
* [ ] __D__ IP - Dependency Inversion Principle

# 2. Single Responsibility Principle
__A class should have only one reason to change__.

# 3 Motivation: Violating the Single Responsibility Principle (Bad example)

```cpp
class Journal
{
	string m_title;
	vector<string> m_entries;

	public:
		explicit Journal(const string& title) : m_title(title) {
		}

		void add_entries(const string& entry) {
			static uint32_t count = 1;
			m_entries.push_back(to_string(count++) + ": " + entry);
		}

		auto get_entries() const {
			return m_entries;
		}

		void save(const string& filename) {
			ofstream ofs(filename);
			for (auto& s : m_entries) {
				ofs << s <<endl;
			}
		}
};

int main(int ac, char* av[])
{
	Journal journal{"Dear XYZ"};
	journal.add_entries("I ate a bug");
	journal.add_entries("I cried today");
	journal.save("diary.txt");

	return 0;
}
```

+ Above cplusplus example, seems fine as long as you have a single domain object. But this is not usually the case in a real-word application
+ As we start adding domain objects like __Book, File__, etc. you have to implement save method for everyone separately which is not the actual problem.
+ In this case, you have to go through every domain object implementation and need to change code all over which is not good.
+ Here, we have violate the Single Responsibility Principle by providing Journal class two reason to change.
	+ Things related to Journal
	+ Saving the Journal
+ Moreover, code will also become repetitive, bloated and hard to maintain

# 4 Solution: Single Responsibility Principle Example in cplusplus

```cpp
class Journal
{
	string m_title;
	vector<string> m_entries;

	public:
		explicit Journal(const string& title) : m_title(title) {
		}

		void add_entries(const string& entry) {
			static uint32_t count = 1;
			m_entries.push_back(to_string(count++) + ": " + entry);
		}

		auto get_entries() const {
			return m_entries;
		}

		//void save(const string& filename) {
		//	ofstream ofs(filename);
		//	for (auto& s : m_entries) {
		//		ofs << s <<endl;
		//	}
		//}
};

struct SavingManager
{
	static void save(const Journal& j, const string& filename) {
		ofstream ofs(filename);
		for (auto& s: j.get_entries()) {
			ofs << s << endl;
		}
	}
};

int main(int ac, char* av[])
{
	Journal journal{"Dear XYZ"};
	journal.add_entries("I ate a bug");
	journal.add_entries("I cried today");
	//journal.save("diary.txt");
	SavingManager::save(joural, "diary.txt");

	return 0;
}
```


text:
# ![XSX-Logo](doc/xsx-logo.png?raw=true) – eXtended S-eXpressions

[**Repository moved to codeberg.org**](https://codeberg.org/fractalqb/xsx)

`import "git.fractalqb.de/fractalqb/xsx"`

---

Package XSX provides tools for parsing something I call eXtended
S-eXpressions.  Extended means the following things compared to
[SEXP S-expressions](https://people.csail.mit.edu/rivest/sexp.html):

1. Nested structures are delimited by balanced braces '()', '[]' or
   '{}’ – not only by '()'.

2. XSX provides a notation for "Meta Values", i.e. XSXs that provide
   some sort of meta information that is not part of the "normal"
   data.

On the other hand some properties from SEXP were dropped, e.g. typing
of the so called "octet strings". Things like that are completely left
to the application.

## Somewhat more formal description

Frist of all, XSX is not about datatypes, in this it is comparable to
e.g. XML (No! don't leave… its much simpler). Instead its building
block is the _atom_, i.e. nothing else than a sequence of characters,
aka a 'string'. Atoms come as _quoted atoms_ and as _unquoted
atoms_. One needs to quote an atom when the atom's string contains
characters that have a special meaning in XSX: ()[]{}\ and
white-space.

### Regexp style definition of Atom

    atom     := nq-atom | q-atom
    nq-atom  := ([^()[]{}]|\s)+
	q-atom   := "([^"\]|(\")(\\))+"
	XSX      := atom

I.e. `x` is an atom and `foo`, `bar` and `baz` are atoms. An atom that
contains a '"' or '\' would be `"quote: \" and backslash: \\ in a
quoted atom"`.  Also `"("` is an atom but `(` is not an atom. We need
'(' for other things!

### Sequences now BNF Style

Each atom is an XSX and from XSX'es one can build sequences:

    XSX  ::= atom | seq1 | seq2 | seq3
    seq1 ::= '(' ws* ')' | '(' ws* xsxs ws* ')'
    seq2 ::= '[' ws* ']' | '[' ws* xsxs ws* ']'
    seq3 ::= '{' ws* '}' | '{' ws* xsxs ws* '}'
    xsxs ::= XSX | XSX ws* xsxs
    ws   ::= “Unicode's White Space”

### Out-Of-Band Information with Meta XSXs

You can prefix each XSX with a backslash to make that expression a
meta-expression. A meta-expression is not considered to be a XSX,
i.e. you cannot create meta-meta-expressions or
meta-meta-meta-expressions… hmm… and not event
meta-meta-meta-meta-expressions! I think it became clear?

E.g. `\4711` is a meta-atom and `\{foo 1 bar false baz 3.1415}` is a
meta-sequence. What _meta_ means is completely up to the
application. Imagine e.g. `(div hiho)` and `(div \{class green} hiho)`
to be a translation from `<div>hiho</div>` and `
hiho
`.

## Rationale

None! … despite the fact that I found it to be fun – and useful in
some situations.

Because XSX syntax so simple it is easy to use the `PullParser` as a
tokenizer to build customized parsers for proprietary data
files. E.g. see the `table` sub-package. On the other hand the low
level parser and scanner API is inspired by the
[expat](https://libexpat.github.io/) streaming parser that allows one
to push some data into the paring machinery and it will fire
appropriate callbacks when tokes are detected.

So, if you are looking for something that's even simpler than JSON or
YAML you might give it a try… Happy coding!

repository: fractalqb/xsx

repo_name: fractalqb/xsx


text:
# TC66C

The [TC66C](https://www.aliexpress.com/item/32968303350.html) is a USB-C load
meter that communicates its measurements over Bluetooth Low Energy.

![TC66C diagram](./TC66C_buttons.jpg)

## Hardware/firmware revision 1.15

TC66C units that come with firmware version 1.15 preinstalled appear to contain
new/different Bluetooth hardware.

They use a different set of characteristics:

- primary (transmit & receive): `0000ffe0-0000-1000-8000-00805f9b34fb`
- txChr: `0000ffe2-0000-1000-8000-00805f9b34fb`
- rxChr: `0000ffe1-0000-1000-8000-00805f9b34fb`

Furthermore, the `txChr` doesn't allow a `reliable`-write. Instead (and perhaps
more sensibly) it expects a `command`-write ("write without response" – see
<https://github.com/bluez/bluez/blob/master/doc/gatt-api.txt>).

Issuing a `reliable`-write causes a `ERROR: DBusError: Write not permitted` to
be raised. To be able to issue a `command`-write, at least
[`node-ble` 1.5.0](https://github.com/chrvadala/node-ble/pull/20) is required.

**N.B.** the older units _require_ a `reliable`-write to function properly (they
will not issue an error when send a `command`-write, but won't produce any data
as a result either).

Apart from the above two changes, all other aspects (including the AES
decryption-key) remain unchanged.

## References

1. <https://ralimtek.com/reverse%20engineering/software/tc66c-reverse-engineering/>
2. <https://sigrok.org/wiki/RDTech_TC66C>


text:
# thoughtram Blog

We use Jekyll as static site generator. You can read its docs [here](http://jekyllrb.com/docs/home/).

```terminal
sudo gem install jekyll
sudo gem install jekyll-redirect-from
sudo gem install jekyll-paginate

jekyll serve
```

## Using docker

This blog requires `ruby`, `jekyll` and a bunch of other dependencies in specific versions. Managing these dependencies can become difficult over time and often the simplest solution is to use `docker`.

**NOTE: Depending on the `docker` installation, the following commands might need to be run using `sudo`.**

| Action    |      Local Jekyll   |  Using Docker                    |
|-----------|---------------------|----------------------------------|
| Building  | `jekyll build`      | `yarn docker-jekyll-build`       |
| Serving   | `jekyll serve`      | `yarn docker-jekyll-serve`       |
| Deplyoing | `yarn deploy [...]` | `yarn deploy --use-docker [...]` |

### Caveats

These commands are intended to be used as straight forward replacements. There's one caveat though: They don't let one use additional parameters. E.g. one can not change the default port for serving, it is hard-wired to serve the site on `http://localhost:4000`.

Also if `sudo` is needed to run these tasks, the repo might end up owned by the super user which may be a slight inconvenience.

repository: thoughtram/blog

gha_language: SCSS

repo_name: thoughtram/blog


text:
[![Build Status](https://travis-ci.org/autostructure/harden_docker.svg?branch=master)](https://travis-ci.org/autostructure/harden_docker)
[![Puppet Forge](https://img.shields.io/puppetforge/v/autostructure/harden_docker.svg)](https://forge.puppetlabs.com/autostructure/harden_docker)
[![Puppet Forge](https://img.shields.io/puppetforge/f/autostructure/harden_docker.svg)](https://forge.puppetlabs.com/autostructure/harden_docker)

#### Table of Contents

1. [Overview](#overview)
2. [Module Description - What the module does and why it is useful](#module-description)
3. [Setup - The basics of getting started with harden_docker](#setup)
    * [What harden_docker affects](#what-harden_docker-affects)
    * [Setup requirements](#setup-requirements)
    * [Beginning with harden_docker](#beginning-with-harden_docker)
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)

## Overview

Hardens a Docker installation. Please note: this does NOT install Docker. It does not harden images or containers

## Module Description

One of Puppet biggest strength's is securing and enforcing your environment. If you decide to run Docker it's very important you secure its
configuration files and daemon.

Docker is a great product, but it open to exploitation by savvy hackers. This module will help ensure:

* Common sense hardening rules are enforced
* Basic rules to help network performance between containers

## Setup

### What harden_docker affects

* Configuration files and directories
* Docker daemon Configuration
  * **Warning** A daemon change will restart dockerd. But, only if the service is managed elsewhere.
* Auditing rules for configuration files and directories

### Setup Requirements

This module requires that Docker already be installed.

### Beginning with harden_docker

To have Puppet harden docker with the default parameters, declare the [`harden_docker`][] class:

``` puppet
class { 'harden_docker': }
```

## Usage

You can choose to turn off management of the files and configurations harden_docker manages.

If you are using Swarm you will want to turn off management of live-restore.

``` puppet
class { 'harden_docker':
  enable_live_restore => false,
}
```

## Reference

- [**Public classes**](#public-classes)
    - [Class: harden_docker](#class-harden_docker)
- [**Private classes**](#private-classes)
    - [Class: harden_docker::config](#class-harden_dockerconfig)
    - [Class: harden_docker::config_auditd](#class-harden_dockerconfig_auditd)
    - [Class: harden_docker::config_daemon](#class-harden_dockerconfig_daemon)

### Public Classes

#### Class: `harden_docker`

Hardens a Docker installation. Please note: this does NOT install Docker. It also does not harden images or containers.

##### `restrict_network_traffic_between_containers`

Disables inter-container communication.

Values: true, false

Default: `true`

##### `set_the_logging_level`

Set the logging level ("debug", "info", "warn", "error", "fatal") or false to turn off management (default "info")

Values: false, "debug", "info", "warn", "error", "fatal"

Default: `info`

##### `allow_docker_to_make_changes_to_iptables`

Enable addition of iptables rules.

Values: true, false

Default: `true`

##### `disable_operations_on_legacy_registry`

Disables contacting legacy registries.

Values: true, false

Default: `true`

##### `enable_live_restore`

Enables live restore of docker when containers are still running. Do not use with Swarm.

Values: true, false

Default: `true`

##### `disable_userland_proxy`

Disables use of userland proxy for loopback traffic.

Values: true, false

Default: `true`

## Limitations

Currently only supports Linux OS's.

## Development

Feel free to pull and contribute.

extension: markdown


text:
## Overview
The ete benchmarks consist of two projects:
- **timelock-server-benchmark-client**: the benchmark client server. Hosts a set of http endpoints which return benchmark results. This server creates a `TransactionManager` which runs against the timelock cluster, and performs benchmarks on it.
- **timelock-server-benchmark-cluster**: the timelock server cluster. This is just a normal timelock cluster used by the benchmark client to execute transactions

There are two scripts for deploying the above projects:
- **push-benchmark-client.sh**: deploys the benchmark client server
- **push-benchmark-cluster.sh**: deploys a cluster of 3 timelock nodes

Finally, code for actually executing benchmarks is located in `BenchmarksRunner.java`. This class simply hits endpoints on the benchmark server, and prints the output.

## Config and Hostnames
Configs for both the client and timelock cluster are controlled via templates, located in `var/conf/template`. The purpose of these templates is to allow substitution of the hostnames, so that the hostnames don't have to be checked in.

Hostnames are configured via the `scripts/benchmarks/servers.txt` file. The format is mostly self-explanatory; there are spots to configure the client node, the three timelock cluster nodes, and three cassandra nodes (if using cassandra)

## Host Setup
The scripts require your user to have access to the `/opt/palantir/timelock` directory, and to be able to view running processes. This applies to both the benchmark cluster and client hosts.

## Cassandra Setup
Your cassandra cluster should be configured to NOT require client ssl. This is set in `cassandra.yaml` via the `client_encryption_options.enabled` property (should be set to `false`). Alternatively you can enable ssl, but you'll need to modify the atlas configuration in `timelock-server-benchmark-client/var/conf/template/benchmark-server.yml` to use ssl for cassandra, and create a truststore.

## Running Benchmarks
To run the benchmarks:
1. Launch four server boxes (3 for the timelock cluster + 1 for the benchmark client), and configure them per the "host setup" section above
2. Launch a cassandra cluster, and configure it per the "cassandra setup" section above
3. Add the hostnames to `scripts/benchmarks/servers.txt`
4. Run `./push-benchmark-client` and `./push-benchmark-cluster` to deploy the client and timelock cluster
5. Use `BenchmarksRunner.java` to execute benchmarks

repository: stefank-palantir/atlasdb

branch_name: refs/heads/develop

repo_name: stefank-palantir/atlasdb


text:
### Internships

**Title:** Job Opening – Field Research Technician

**Date:** January 6, 2016

The Office for Creative Research is looking to hire field research technician for a 3 month scientific expedition in the highlands of Angola. Expected dates are January 28th – May 1st. The expedition will involve land and water-based travel. Applicants can expect extreme weather conditions, rigorous physical activity and significant environmental risks (land mines, insects, crocodiles, hippopotamus)

The responsibilities of the field research technician will be to:
Coordinate data collection from various scientific teams
Collect field data via custom sensor systems
Upload data to project database
Maintain and troubleshoot electronics + satellite communication units
Communicate with NYC-based data team
The ideal candidate will have excellent technical skills (hardware and software), significant outdoors experience, and should be confident problem-solving in high pressure environments. Working knowledge of Portuguese is a definite plus. Applicants must have a valid passport, and must be able to secure an Angolan visa before departure (we will provide supporting documents)

Compensation for this position includes:
All travel costs (flights, visa etc) for the return journey to Angola
Food and accommodation (camping / expedition style) for the duration of the expedition
A stipend of $1,500 per month for February, March and April – total $4,500.
Interested applicants can send a cover letter and a resume to [jobs<EMAIL_ADDRESS>


text:
# 𝕴𝖈𝖔𝖓 𝕲𝖊𝖓𝖊𝖗𝖆𝖙𝖔𝖗

❤ Support my apps ❤

- [Push Hero - pure Swift native macOS application to test push notifications](https://onmyway133.com/pushhero)
- [PastePal - Pasteboard, note and shortcut manager](https://onmyway133.com/pastepal)
- [Quick Check - smart todo manager](https://onmyway133.com/quickcheck)
- [Alias - App and file shortcut manager](https://onmyway133.com/alias)
- [My other apps](https://onmyway133.com/apps/)

❤❤😇😍🤘❤❤

## Description

- An `electron.js` app used for generating app icons
- Support macOS
- Follow [Human Interface Guidelines iOS](https://developer.apple.com/ios/human-interface-guidelines/graphics/app-icon/)
- Generate based on latest Xcode [Contents.json](https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/Contents.html)

## How to install

- Download latest release from https://github.com/onmyway133/IconGenerator/releases

## How to use

- Drag image onto left box
- Support `png`, `jpeg`, `jpg`, `webp`, `tiff`, `gif`, `svg`
- Choose platform to generate: `iPhone`, `iPad`, `macOS`, `tvOS`, `watchOS`, or an `icns file`
- Generated `AppIcon.appiconset` or `AppIcon.icns` and save to `Downloads` folder

## Credit

- Icon http://emojione.com/
- Use [sharp](https://github.com/lovell/sharp) to resize images

## Author

Khoa Pham<EMAIL_ADDRESS>
## License

**IconGenerator** is available under the MIT license. See the [LICENSE](https://github.com/onmyway133/IconGenerator/blob/master/LICENSE.md) file for more info.

gha_license_id: NOASSERTION


text:
# fe-seed

Use `npm install` to download all project dependencies.

Use `node app.js` to start the server.

The available methods on the backend are:
```
    GET   /api/text      // retrieve a text fragment so you don't have to search the web
    POST  /api/save      // persist the body of the request to the server
    GET   /api/load      // retrieve what `/api/save` persisted

```

Good luck!

repository: llvp/fe-seed

repo_name: llvp/fe-seed


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

### Description

A vulnerability in the update mechanism of Subaru StarLink Harman head units 2017, 2018, and 2019 may give an attacker (with physical access to the vehicle's USB ports) the ability to rewrite the firmware of the head unit. This occurs because the device accepts modified QNX6 filesystem images (as long as the attacker obtains access to certain Harman decryption/encryption code) as a consequence of a bug where unsigned images pass a validity check. An attacker could potentially install persistent malicious head unit firmware and execute arbitrary code as the root user.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/sgayou/subaru-starlink-research


text:
# Cluster Management

Wave enables you to see an overview of all your Wave clusters, get status at a glance, perform tasks such as adding and removing clusters, and drill down to more detailed cluster information when you need to.

To manage your clusters in the Spot console, go to Wave in the menu tree and click Clusters.

## View List of Clusters

The list of Wave clusters gives you a quick view of your clusters and basic information including:

- Cluster Name: The user-given name of the cluster.
- Cluster ID: The ID that Wave assigned to the cluster upon creation.
- Region: The AWS region where the cluster is located.
- Nodes: The number of nodes in the cluster.
- Running Apps: The number of applications running in the cluster.
- Creation Date: The date the cluster was created.
- Status: The health status of the cluster (up or down).
- Action: An option to remove the cluster from Wave.

## Filter Cluster List

If you have a long list of clusters, you can use the filter above the list to find one or multiple clusters. Just enter a tag, an attribute, a keyword or simply a string of text into the filter box and type enter.

## View Cluster Details

To get detailed information, statistics, and operational information about a cluster, click on the Cluster Name. This will open the [Cluster Overview](wave/features/wave-cluster-overview) tab for that cluster which serves as your operational dashboard for the cluster.

## Add Cluster

To add a cluster, click Add Cluster above the cluster list and complete the procedures described in [Get Started with Wave](wave/getting-started/).

## Remove Cluster

To disconnect a cluster you don’t need any more, do the following:

1. Click Remove in the Action column.
2. Enter the name of the cluster to confirm, and click Remove Cluster.

## What’s Next?

Learn how to use the detailed cluster dashboard in the [Wave Cluster Overview](wave/features/wave-cluster-overview) tab.


text:
---
title: Mailbox after save
uid: event_model_mailbox_after_save
description: CRMScript event model - Mailbox event, execute after message is saved
so.author:
so.date:
keywords:
so.topic: reference
---

# Mailbox event, execute after message is saved

This is a CRMScript you can add under the menu **System design** in the screen **System Script**.

Here you can add CRMScript code that will be executed for all mailboxes after the mail has been processed by any email filters (except scripts to be executed for the filter) and saved to the system. The script will be executed before any notifications and email-filter scripts are run. The call sequence can be described like this:

1. Get emails from the mail server
2. Analyze email
3. Run the "Mailbox event, executed before message is saved" script
4. Run mailbox filter code (except attached script)
5. Store message to the system
6. Run this script
7. Run mailbox filter attached scripts
8. Send notifications

There are several variables available in this context. These can be obtained by

```crmscript
getVariable("xxx")
```

## Read-only variables

| Variable | Description |
|---|---|
| messageId | The ID of the newly created message |
| ticketId | The ID of the ticket |
| customerId|  The ID of the primary customer connected to this ticket |
| customerEmail|  Email address of the primary customer connected to this ticket |
| mailBackup | Raw version of the email |
| isNewCustomer | set to 1 if this email created a new customer/person (from version 8.1 - R13) |

In addition, any variables set by the email filter are also available with the name specified in the email filter.

repository: ArildEik/superoffice-docs

repo_name: ArildEik/superoffice-docs


text:
Change Log {#changelog}
==========

# 1.5.1 - 2023-06-08 # {#changelog_1_5_1}
- Any String or Strings attributes containing fileystem paths are now
  rewritten when the RMF static frame is cloned (e.g. during `rmf_slice`
  or `rmf_cat`) so that they are relative to the new file, not the old one.
  This relies on the convention that path attributes have names ending in
  "filename" or "filenames".
- Bugfix: particles without Cartesian coordinates are now handled correctly
  by the `get_all_global_coordinates()` Python function.
- Bugfix: relative paths should now be set correctly when the path to the
  RMF file itself contains one or more '..' components.

# 1.5.0 - 2023-03-22 # {#changelog_1_5_0}
- Windows builds now require MS Visual Studio 2015 or later (for full C++11
  support). The following macros for pre-C++11 environments are no longer
  needed and are deprecated: `RMF_NOEXCEPT`, `RMF_CANEXCEPT`.
- All RMF binaries now report the full version (including micro version)
  when the --version flag is used (e.g. "1.4.1", not "1.4").
- If built with NumPy, some Python-specific functions are now provided to
  allow direct access to RMF data via NumPy arrays.
- File handles can now be explicitly closed (via a `close` method). Most IO
  operations on a closed handle will now raise an error. In Python file handles
  now support the context manager protocol so can be used in 'with' blocks.

# 1.4.1 - 2022-11-21 # {#changelog_1_4_1}
- Build fixes to work with SWIG 4.1.
- Various internal build scripts now use 'python3' rather than
  unversioned 'python'.

# 1.4 - 2022-03-10 # {#changelog_1_4}
- RMF now requires a C++11 compiler and SWIG 3 (or later) to build. Most
  recent compilers should support C++11, such as gcc, clang
  or MS Visual Studio 2012 or later. Various macro and header workarounds
  for pre-C++11 environments are thus no longer needed and are deprecated:
  `RMF_FINAL`, `RMF_OVERRIDE`, and `RMF_FOREACH`.
- Build fixes for latest log4cxx, in C++17 mode, or with newer versions of gcc.

# 1.3.1 - 2021-12-01 # {#changelog_1_3_1}
- Various build fixes for newer versions of gcc and clang.
- Build fixes for Fedora 33 or later.
- Add support for Python 3.10.
- Minor documentation improvements.

# 1.3 - 2021-04-21 # {#changelog_1_3}
- All RMF binaries now support the --version flag, and the RMF library itself
  is versioned.

# 1.2 - 2021-04-19 # {#changelog_1_2}
- A new category of decorators 'provenance' allows information about how the
  structure was generated to be added to the file.
- The new RMF::decorator::Reference decorator allows for a node to mark
  another node as its reference.
- The new RMF::decorator::ExplicitResolution decorator allows attaching an
  explicitly-set resolution to a node. (This allows such values from IMP to
  be accurately stored in the file.)

# 1.1 - 2014-03-07 # {#changelog_1_1}
- To be more consisent, RMF::decorator::Domain and
	RMF::decorator::Fragment had their access methods modified to
	include `residue` in the name.
- A Pymol plugin was added
- RMF now uses the new avro-based format with the `.rmf` suffix, you
	should use this and `.rmfz` as your suffixes.
- RMF::decorator::Bond and RMF::decorator::BondConst now return
	RMF::NodeHandle and RMF::NodeConstHandle instead of ints.
- RMF::decorator::Representation and RMF::decorator::RepresentationConst now return
	RMF::NodeHandles and RMF::NodeConstHandles instead of ints.
- RMF::decorator::Domain takes two ints in its set method rather than a list
- RMF::NodeConstHandle::get_index() went away as it was a duplicate of
	RMF::NodeConstHandle::get_id()
- RMF::NodeType and RMF::FrameType were replaced with RMF::Enum
	instances. This increases type safety in python and makes
	converting to and from strings easier (you can now use `str()` in python).
- RMF::decorator::Residue::get_residue_index() and
	RMF::decorator::Residue::get_residue_type() replace the versions
	without `residue` in the name
- Decorators and factories have been moved into the RMF::decorator namespace in C++.
- You can now only either create a new RMF or open an existing one read
	only. Most backends only supported those two anyway.
- Managing of data buffers has been revamped and wrapped in the
	RMF::BufferHandle class which tracks a shared buffer.
- You now get keys by passing the appropriate traits object instead of
	having the type in the function name: eg `f.get_key(cat, "name", RMF.IntTraits())`
- Appropriate decorators now return RMF::Vector3, RMF::Vector4 or
	RMF::Vector3s instead of RMF::Floats or RMF::FloatsList.
- There are now static and non-static versions of the decorators.
- You now have to explicitly add a frame or set the current frame before
	manipulating frame data.
- RMF::NodeConstHandle::get_value() subsumes get_value_always() which was
	removed. If there is no value, then either a RMF::Nullable for
	which RMF::Nullable::get_is_null() is true is returned (C++) or
	`None` is returned (python).
- RMF::FileHandle::get_node_from_id() was renamed to
	RMF::FileHandle::get_node()
- Various methods that took ints to identify frames now expect RMF::FrameID.
- A VMD plugin was added

repository: salilab/rmf

repo_name: salilab/rmf


text:
[![NPM version](https://img.shields.io/npm/v/stylelint-csstree-validator.svg)](https://www.npmjs.com/package/stylelint-csstree-validator)
[![Build Status](https://travis-ci.org/csstree/stylelint-validator.svg?branch=master)](https://travis-ci.org/csstree/stylelint-validator)

# stylelint-csstree-validator

CSS syntax validator based on [csstree](https://github.com/csstree/csstree) as plugin for [stylelint](http://stylelint.io/). Currently it's only checking declaration values to match W3C specs and browsers extensions. It would be extended in future to validate other parts of CSS.

> Validator is designed to check CSS syntax only. However PostCSS (that used by stylelint as backend) may parse other syntaxes like Less or Sass and can be used for these syntaxes too. In this case validator is limited to check declaration that doesn't contain any CSS extension (e.g. variables).

## Install

```
$ npm install --save-dev stylelint-csstree-validator
```

## Usage

Setup plugin in your [stylelint config](http://stylelint.io/user-guide/configuration/):

```json
{
  "plugins": [
    "stylelint-csstree-validator"
  ],
  "rules": {
    "csstree/validator": true
  }
}
```

### Options

#### ignore

Type: `Array` or `false`
Default: `false`

Defines a list of property names that should be ignored by the validator.

```json
{
  "plugins": [
    "stylelint-csstree-validator"
  ],
  "rules": {
    "csstree/validator": {
      "ignore": ["composes", "foo", "bar"]
    }
  }
}
```

In this example, plugin would not test declaration with property name `composes`, `foo` or `bar`. As a result, no warnings for these declarations.

## License

MIT

repository: zabute/stylelint-validator

repo_name: zabute/stylelint-validator


text:
# Confirming Installation of Prerequisites

In this lab we'll confirm that everyone has the software installed for subsequent labs.

See this [list of prerequisites](https://github.com/rockfordlhotka/Cloud-Native-HOL/blob/master/docs/prerequisites.md). ⚠ These must be installed _before arriving at the event_!

## Chocolatey

1. Open a console window (CLI) of your choice
1. Type `choco --version`
1. Ensure that the version is at least `0.10.15`

## Git for Windows

1. Open the Git Bash CLI
1. Type `git --version`
1. Ensure that the version is at least `2.19.0`

## Clone/update local repo

If you have not yet cloned the repo

1. Change to your root source directory (such as `cd /c/src`)
1. `git clone https://github.com/rockfordlhotka/Cloud-Native-HOL.git`

If you have already cloned the repo do a pull

1. Change to the repo directory (such as `cd /c/src/Cloud-Native-HOL`)
1. `git pull`

This should ensure that you have a local copy of the latest content from GitHub.

## .NET Core

1. Open the Git Bash CLI
1. Type `dotnet --version`
1. Ensure that the version is at least `2.1.700`

## Docker

1. Open the Git Bash CLI
1. Type `docker --version`
1. Ensure that the version is at least `18.09.2`
1. Type `docker run hello-world`
1. You should get several lines of output, starting with `Hello from Docker!`

## minikube and Helm

1. Open the Git Bash CLI (**as admin**)
1. Type `minikube version`
1. Ensure that the version is at least `1.2.0`
1. Type `minikube status`
1. Output should appear similar to: ![mkstatus](images/mkstatus.png)
   1. If minikube is not running follow the instructions to start minikube

### Starting minikube

1. Type `winpty minikube start --vm-driver hyperv --hyperv-virtual-switch "Default Switch"`

Alternately you can use pre-built bash shell scripts to start/stop the cluster:

1. Change directory to the `Lab00` in this repo
1. Type `chmod +x mkstart.sh`
1. Type `chmod +x mkstop.sh`
1. Type `./mkstart.sh` to start minikube
   1. Type `cat mkstart.sh` to view script contents

### Initialize Helm

1. minikube must be running
1. Type `helm init`

### Stopping minikube

**IMPORTANT:** Don't actually stop minikube, as you'll be using it throughout the day. However, when you do want to stop minikube this is how you do it.

1. Type `winpty minikube ssh "sudo poweroff"`

Alternately you can use the pre-built bash command script:

1. Type `./mkstop.sh` to stop minikube
   1. Type `cat mkstop.sh` to view script contents

Finally: Close the admin CLI window (type `exit`)

## Kubernetes CLI

1. Open the Git Bash CLI
1. Type `kubectl version`
1. The result will be version numbers for numerous components
   1. Client versions are for the Kubernetes CLI
   2. Server versions are for minikube

![kubectl version](images/kubectlversion.png)

**NOTE:** It is very likely that your path (Windows and Mac) will have you running `kubectl` from Docker rather than the one directly installed for Kubernetes. This is a problem, because the Docker install is outdated. In the image above you can see that the client is version `v1.10.11`, but the current version is at least `v1.15.2`.

To fix this on Windows:

1. Open a Git Bash CLI window _as administrator_
1. Change directory to `/c/Program\ Files/Docker/Docker/resources/bin`
1. Type `curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.2/bin/windows/amd64/kubectl.exe`

This will download version `v1.15.2` of the tool, overwriting the older version in the Docker directory.

For Mac users you can do something similar, or change a symlink as described in this Stackoverflow thread[1](#1).

## Azure CLI

1. Open the Git Bash CLI
1. Type `az --version`
1. Ensure that the version is at least `2.0.68`
1. Type `az login`
   1. You should get see a browser window
   1. Log into your Microsoft Azure account
   1. The console should now list your subscriptions

## References

* [1]: [kubectl version SO thread](https://stackoverflow.com/questions/55417410/kubernetes-create-deployment-unexpected-schemaerror)

repository: jamierytlewski/Cloud-Native-HOL

repo_name: jamierytlewski/Cloud-Native-HOL


text:
---
layout: post
title: "Week 2: Learning Python"
---

It feels weird to have a cookie-cutter set of questions in a blog post, but as it's now part of the specification, here goes:

1) *What did you do this past week?*

Last week I was able to attend all of my lectures, thankfully, and made a little more progress on the Collatz project. I just got back from a [very successful concert](http://hawesdomingue.github.io/images/pax_returners_selfie.png) at the PAX South convention, which I spent a lot of time practicing and getting ready for.

2) *What's in your way?*

Now that PAX is over with, not much, but since it's still early in the semester I always worry about how I'm going to manage my time best, especially since I work 20+ hours/week. Python is still very new to me, so that's probably my biggest hurdle in this class, but I've learned new programming languages in the past, and Python doesn't seem like a particularly scary one so far.

3) *What will you do next week?*

If nothing goes horribly wrong, finish the Collatz project of course. Maybe I can even make mine fast, by Python standards.

Other comments about this class so far - since I've been in two of Glenn Downing's other classes before, a lot of the material has been the same, but the fact that we're learning in Python is keeping things interesting for me. The Friday lecture on exceptions was especially illuminating - first of all, I was surprised by the fact that you can make a local variable in a function with the same name as a global, and use it independent of the global. For example:

```python
x = 0

def fun():
	x = 42

fun()
print(x)
```

... prints 0, not 42. If you actually want to use a global inside a function, you need to use the `global` keyword:

```python
x = 0

def fun():
	global x
	x = 42

fun()
print(x)
```

Which gets you 42. Small things like that are easy to learn and easier to forget, so I need to make sure I'm getting plenty of reminders by doing a little bit of Python programming every day.

**Tip of the Week**: I am a big fan of JetBrains IDEs, which make my life way easier by providing lots of helpful coding shortcuts and checking the correctness and quality of my code while I focus on the bigger picture. The best part is that they let [students use their software for free](https://www.jetbrains.com/student/). JetBrains' Python IDE, [PyCharm](https://www.jetbrains.com/pycharm/), has been around for quite a while and I highly recommend it!


text:
# vue-mobile-starter ·  [![PyPI](https://img.shields.io/pypi/status/Django.svg)]()  [![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)](https://github.com/JohnsenZhou/vue-mobile-starter/blob/master/LICENSE)

> A app based on vue2 + vuex + vue-router，you can learn the core concepts of  vue2,vuex and vue-router from this app.
>

## Introduction
There are a lot of pretty open sources about Vue practice on the internet,most of the items are not too big or too small.So i did the item for novice to get started **vue.js**.
> Then i will do a version of **react + redux**,interested students can continue to focus on😊.
>
> If you have any problems，give me an issue.

## Open Sources

1. **[vue family](https://cn.vuejs.org/)**：vue2 + vuex + vue-router + vue-cli.
2. **[jsonplaceholder](http://jsonplaceholder.typicode.com)**：A free online REST service that you can use whenever you need some fake data.
3. **[axios](https://github.com/mzabriskie/axios)**：Promise based HTTP client for the browser and node.js.
4. **[muse-ui](https://museui.github.io/)**：Material Design UI library for Vuejs 2.0.
5. **[express](http://www.expressjs.com.cn/)**：Fast, unopinionated, minimalist web framework for node.
6. **[pm2](http://pm2.keymetrics.io/)**：Production Process Manager for Node.js apps with a built-in Load Balancer.

## Build Setup

``` bash
# clone the repository
git clone https://github.com/JohnsenZhou/vue-mobile-starter.git

# go to the repository catalog
cd vue-mobile-starter

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

```

## Directory Structure
```
.
├── README.md
├── build
├── config
├── config.dev.json
├── config.prod.json
├── index.html
├── node_modules
├── npm-shrinkwrap.json
├── package.json
├── pm2.json
├── server.js
├── src
│   ├── App.vue
│   ├── assets
│   ├── components
│   ├── main.js
│   ├── router
│   ├── services
│   ├── store
│   ├── utils
│   └── views
└── static

```

## Demos

[**click this to view demo**](http://<IP_ADDRESS>:8001)

>1. The project was deployed through centOS 7.

### Scanning the following qrcode and browsing the demo on your phone

![在线浏览](https://raw.githubusercontent.com/JohnsenZhou/NodeApp-Deploy/img/qrcode.png)

## License
[MIT](https://github.com/JohnsenZhou/vue-mobile-starter/blob/master/LICENSE) license.

repository: JohnsenZhou/vue-mobile-starter

repo_name: JohnsenZhou/vue-mobile-starter


text:
+++
title = "docker_image resource"
draft = false
platform = "linux"

[menu]
  [menu.inspec]
    title = "docker_image"
    identifier = "inspec/resources/os/docker_image.md docker_image resource"
    parent = "inspec/resources/os"
+++

[\[edit on GitHub\]](https://github.com/inspec/inspec/blob/master/docs-chef-io/content/inspec/resources/docker_image.md)

Use the `docker_image` Chef InSpec audit resource to verify a Docker image.

## Availability

### Installation

This resource is distributed along with Chef InSpec itself. You can use it automatically.

### Version

This resource first became available in v1.21.0 of InSpec.

## Syntax

A `docker_image` resource block declares the image:

    describe docker_image('alpine:latest') do
      it { should exist }
      its('id') { should eq 'sha256:4a415e...a526' }
      its('repo') { should eq 'alpine' }
      its('tag') { should eq 'latest' }
    end

## Resource Parameter Examples

The resource allows you to pass in an image id:

    describe docker_image(id: alpine_id) do
      ...
    end

If the tag is missing for an image, `latest` is assumed as default:

    describe docker_image('alpine') do
      ...
    end

You can also pass in repository and tag as separate values

    describe docker_image(repo: 'alpine', tag: 'latest') do
      ...
    end

## Property Examples

### id

The `id` property returns the full image id:

    its('id') { should eq 'sha256:4a415e3663882fbc554ee830889c68a33b3585503892cc718a4698e91ef2a526' }

### image

The `image` property tests the value of the image. It is a combination of `repository/tag`:

    its('image') { should eq 'alpine:latest' }

### repo

The `repo` property tests the value of the repository name:

    its('repo') { should eq 'alpine' }

### tag

The `tag` property tests the value of image tag:

    its('tag') { should eq 'latest' }

### Test a Docker Image

    describe docker_image('alpine:latest') do
      it { should exist }
      its('id') { should eq 'sha256:4a415e...a526' }
      its('image') { should eq 'alpine:latest' }
      its('repo') { should eq 'alpine' }
      its('tag') { should eq 'latest' }
    end

## Matchers

For a full list of available matchers, please visit our [matchers page](/inspec/matchers/).

### exist

The `exist` matcher tests if the image is available on the node:

    it { should exist }


text:
# Tesseract-OCR
Text detection and recognition based on [this tutorial](https://www.pyimagesearch.com/2018/09/17/opencv-ocr-and-text-recognition-with-tesseract/).

1. Please follow the installation instructions in the above link.

2. Download east text detection model from [here](https://drive.google.com/file/d/1I5iijZKuuCXMvNOMSwknOs3c9-QVn50V/view?usp=sharing) and put it in models folder.

3. Running script is scripts/simple_ocr.py.


text:
# Profiling

[Dotnet-trace](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace) offers a simple way to collect profiling
telemetry. This can then be used with [Speedscope](https://www.speedscope.app) by importing the result.

## Client

The simplest way to profile the client would be to go via a Sample application, e.g. the Bank sample.
Navigate to [/Samples/Banking/Bank/Main](../../Samples/Banking/Bank/Main) and run the following after a build.

```shell
dotnet trace collect --format Speedscope -- dotnet bin/Debug/net6.0/Main.dll
```

> Note: You'll see a file called **dotnet_<date_time>.speedscope.json** file, this is the one you'll upload to Speedscope.

## Kernel

Similar for the Kernel you can simply go to [/Source/Kernel/Server](../../Source/Kernel/Server) folder and run:

```shell
dotnet trace collect --format Speedscope -- dotnet bin/Debug/net6.0/Aksio.Cratis.Kernel.Server.dll
```

> Note: You'll see a file called **dotnet_<date_time>.speedscope.json** file, this is the one you'll upload to Speedscope.

repository: aksio-insurtech/Cratis

gha_language: C#

repo_name: aksio-insurtech/Cratis


text:
# Paralleloopta

A simple object-oriented wrapper (with just a little bit of syntax sugar) for SPTA Framework (SAP Standard Parallel processing framework).

As many developers know, SPTA internally works with classes, but for unkown reasons SAP never released an OO API for it. You always have to rely on Function Module that enforces you to create a FORM (already obsolete). This wrapper still have one, but you will never need to create it again to use SPTA.

It was mainly developed for some mass ETL activities, but you can use for any other purpose.
Its current state is more like a PoC than a full fledged and robust wrapper, but still does it job nicely.

## Steps to use

Requires 7.40+ ABAP Stack because, but can be downported to older versions (PRs welcome).

1. Clone into system.
1. Create a class that implements interface ``zif_proota_parallel_code`` (it can be either a global or local class).
1. Feed it to a runner instance ``zcl_proota_parallel_runner``. You decide when it should start, or simply ignore and abort mission.
1. Profit.

You can alco check [``zproota_demo_01`` report][demo_report] for a working example.

## Other implementaions are also available

There are other implementations available (mentioned below), and the modern way to parallel things is by [bgRFC queues][bgrfc_queues], so this wrapper acts as a backup / cheap shot to save your day.

* https://blogs.sap.com/2013/07/16/parallel-abap-objects/
* https://blogs.sap.com/2019/03/19/parallel-processing-made-easy/

[bgrfc_queues]: help.sap.com/viewer/753088fc00704d0a80e7fbd6803c8adb/latest/en-US/489f05f8f7ec6bb9e10000000a42189d.html
[demo_report]: //github.com/thalesvb/paralleloopta/blob/master/src/zproota_demo_01.prog.abap

repository: thalesvb/paralleloopta

repo_name: thalesvb/paralleloopta


text:
# DSPS Redis storage

DSPS servers can store & share messages on Redis.

Multiple servers can share same channels & messages with using this storage setup. Client can connect to any server, and any server receives all messages of the channel. So that you can use load balancers without any special care with this storage.

## `storage.redis` configuration block

To setup redis storage, write `redis` section under `storage` configuration block.

Note: to understand configuration file, see [configuration guite](../config.md).

### Redis endpoint configuration

Redis storage implementation requires Redis Clusters or Redis nodes.

Note that Redis or Redis cluster could lose data when reboot/failover occurs.
To prevent data loss, write multiple storage configurations to use multiple Redis-es.
See [Multiple Storages](./README.md#multiple-storage) section of storage configuration document.

Each `redis` configuration requires exactly one of followings:

- `singleNode` (string): `host:port` (e.g. `'localhost:6379'`) strings point Redis
- `cluster` (list of string): Cluster endpoint list that is list of `host:port` points seed nodes

You must supply `singleNode` xor `cluster`. Should not supply both. If you use Redis Cluster, supply `cluster`. If you use simple Redis, supply `singleNode`.

```yaml
# ex. Simple (non-Cluster) Redis
storage:
  myRedisA:  # Keep in mind not to change this name ("myRedisA") after first deployment, otherwise causes data-loss.
    redis:
      singleNode: 'my-redis-server-host-1:6379'
  myRedisB:
    redis:
      singleNode: 'my-redis-server-host-2:6379'
```

```yaml
# ex. Redis Clusters
storage:
  myCluster1:
    redis:
      cluster:
        # List of nodes of a cluster
        - 'a-node-of-cluster-1:6379'
        - 'another-node-of-cluster-1:6379'
  myCluster2:
    redis:
      cluster:
        # List of nodes of another cluster
        - 'a-node-of-cluster-2:6379'
        - 'another-node-of-cluster-2:6379'
```

### Other Redis storage options

Each Redis storage option can take additional options:

```yaml
# ex. db & timeout configurations
storage:
  myRedis1:
    redis:
      singleNode: 'my-redis-server-host-1:6379'
      db: 0  # database number of the Redis
      timeout:
        connect: 5s
        read: 5s
        write: 5s
  myRedis2:
    redis:
      cluster:
        # List of nodes of a cluster
        - 'a-node-of-cluster-1:6379'
        - 'another-node-of-cluster-1:6379'
      db: 1
      timeout:
        connect: 5s
        read: 5s
        write: 5s
```

Configuration items:

- `username` (string, default `""`): Username of Redis authentication
- `password` (string, default `""`): Password of Redis authentication
- `db` (number, optional, default `0`): Database number of the Redis
  - Note: ignored if using redis cluster because it does not support database number
- `scriptReloadInterval` (duration, default `5m`): Interval of [SCRIPT LOAD](https://redis.io/commands/script-load) to preload Redis lua scripts
- `timeout.connect` (duration, default `5s`): Timeout to connect to the Redis
- `timeout.read` (duration, default `5s`): Timeout to wait response from the Redis
- `timeout.write` (duration, default `5s`): Timeout of request write operation to the Redis
- `retry.count` (integer, default: `3`): 0 to disable retry, 1 to retry only once, ...
- `retry.interval` (duration string, default: `500ms`): Retry base interval
- `retry.intervalJitter` (duration string, default: `200ms`): Max range of the retry interval randomization, plus or minus to the interval
- `connection.max` (integer, default: `max(1024, NumCPU * 64)`): Max connections between DSPS server and the Redis
- `connection.min` (integer, default: `NumCPU * 16`): Minimum connections to keep-alive to reduce connect round-trip overhead
- `connection.maxIdleTime` (duration string, default: `5m`): Max idle time to keep-alive connections

repository: saiya/dsps

gha_language: Go

repo_name: saiya/dsps


text:
---
id: 12169
title: 'Mark Headd: Why I’m Coding for America'
date: 2012-04-04T17:46:04+00:00
author: Mark Headd
layout: post
guid: http://codeforamerica.org/?p=12169
permalink: /2012/04/04/mark-headd-why-im-coding-for-ameria/
dsq_thread_id:
  - 636894525
categories:
  - Coding for America
  - Commentary
---
When I finished my undergraduate studies at a small state university in upstate New York almost 20 years ago, I wanted to make a difference.

This desire led me to volunteer for my first (but not my last) political campaign, it led me to pursue a graduate degree in Public Administration at Syracuse University, and it eventually led me into government service.

This same desire to make a difference that has driven almost every major decision of my professional career and has now led me to Code for America.

I’m joining Code for America to become the Director of Government Relations, to work with cities across the country to bring talented designers and coders to bear on urban issues.

For me, entering public service at the dawn of the internet age provided a unique perspective on how governments use technology, particularly web-based technologies. As a result, I’ve always been fascinated with how governments use technology to provide services and engage citizens.

I spent enough time in the world of government, and – since leaving several years ago – in the private sector, to see technology misapplied and used as an excuse when things went wrong.

Technology is stimultaneously both the greatest challenge facing governments struggling to do more with fewer resources, and also one of the greatest opportunities to do so. There should be no illusions that technology is a panacea to the problems facing governments, but it is a uniquely powerful tool that has enormous potential for helping governments do their jobs more efficiently.

We are now at a critical juncture in the development of how we govern ourselves; at an important crossroad for how governments engage with citizens and develop technology-based solutions to make our communities better. Cities are at the heart of this important change, and we have a unique opportunity to shape the future of how cities work by applying new thinking and new technologies to old problems.

In the words of Tim O’Reilly, governments are becoming computing platforms – foundations on which software ecosystems can be built to make our neighborhoods better. The way we build software and utilize government data has gone through a radical change in the last few years, and Code for America is harnessing the dynamic behind this change and bringing it to cites.

Code for America helps city governments leverage the internet generation to develop innovative approaches to the challenges cities continue to face. It’s an important mission, and I am extremely proud to be a part of it.

I Code for America to build on the computing platforms our cities are becoming. I Code for America because it matters.

I Code for America because I want to make a difference.


text:
This exercise will setup a login page and send the credentials using Basic Authentication which will be stored for future SData requests.

1\. In `argos-template/src/Views` create a new file named `Login.js`

2\. Define the module and inherit the base Edit View

    define('Mobile/SalesLogix/Views/Login', [
        'dojo/_base/declare',
        'Sage/Platform/Mobile/Edit'
    ], function(
        declare,
        Edit
    ) {
        return declare('crm.Views.Login', [Edit], {
        });
    });

3\. Add a button element to the `widgetTemplate`, while normally we would add a toolbar item for actions like this a Login page doesn't look quite right without a big ol' Login button.

            widgetTemplate: new Simplate([
                '
',
                '

',
                '<button class="button actionButton" data-action="authenticate">{%: $.logOnText %}</button>',
                '
'
            ]),

4\. Pointers:

    * Use of variables for text strings. This is so localization modules can override the values, no hard-coded strings should be displayed to the user.
    * `hideBackButton="true"` on a View you can add this attr to the main div to remove the back button.
    * `<button>` elements have fuzzy touch areas on phones increasing usability
    * `data-action="function"` place this attribute on any element to have it respond to `onclick` events. The corresponding function name will then be fired in that views' context.

5\. Add the localizable text variables:

            logOnText: 'Log On',
            titleText: 'My App',

6\. Add the view properties id to login and busy to false. The busy flag is for Edit views and is tied to their `enable()` and `disable()` functions for controlling user interactions.

            id: 'login',
            busy: false,

7\. Empty the toolbars, no need for any buttons

            createToolLayout: function() {
                return this.tools || (this.tools = {
                    bbar: false,
                    tbar: false
                });
            },

8\. Create the layout with our login fields

            createLayout: function() {
                return this.layout || (this.layout = [
                    {
                        name: 'username',
                        label: this.userText,
                        type: 'text'
                    },
                    {
                        name: 'password',
                        label: this.passText,
                        type: 'text',
                        inputType: 'password'
                    }
                ]);
            },

9\. Add the `authenticate` handler for the button:

            authenticate: function () {
                if (this.busy) return;

                var credentials = this.getValues(),
                    username = credentials && credentials.username;

                if (username && /\w+/.test(username))
                    this.validateCredentials(credentials);
            },

10\. Feel free to expand the username/password check before firing a request, the above makes sure we have a name that is not just spaces.

11\. Add the `validateCredentials` function

            validateCredentials: function (credentials) {
                this.disable();
                App.authenticateUser(credentials, {
                    success: function(result) {
                        this.enable();
                        App.navigateToInitialView();
                    },
                    failure: function(result) {
                        this.enable();
                        if (result.response.status == 403)
                            alert(this.invalidUserText);
                        else
                            alert(this.serverProblemText);
                    },
                    scope: this
                });
            }

12\. What the above does is disable the view (so no interactions) and pass along to the Application level authenticate user (we will add this soon), which is a wrapper for a SData request and as such it takes the normal SData request callback options.

13\. Before we leave `Login.js` lets go back and add the rest of the localizable strings for our fields and messages

            logOnText: 'Log On',
            passText: 'password',
            titleText: 'My App',
            userText: 'user name',
            invalidUserText: 'The user name or password is invalid.',
            serverProblemText: 'A problem occured on the server.',

14\. Now go into `src/Application.js` and let's add the `authenticateUser(credentials, options)` function.

            authenticateUser: function(credentials, options) {
                var service = this.getService()
                    .setUserName(credentials.username)
                    .setPassword(credentials.password || '');

                var request = new Sage.SData.Client.SDataServiceOperationRequest(service)
                    .setContractName('system')
                    .setOperationName('getCurrentUser');

                request.execute({}, {
                    success: lang.hitch(this, this.onAuthenticateUserSuccess, credentials, options.success, options.scope),
                    failure: lang.hitch(this, this.onAuthenticateUserFailure, options.failure, options.scope),
                    aborted: lang.hitch(this, this.onAuthenticateUserFailure, options.failure, options.scope)
                });
            },

15\. The key point here is that it is creating a `Sage.SData.Client.SDataServiceOperationRequest` and in the case of SalesLogix SData using the `system` contract and the `getCurrentUser` operation which ends up looking like:

    http://localhost/sdata/slx/system/-/$service/getCurrentUser?format=json

It is also important to note that the `getService()` calls returns the _instance_ of the service meaning any changes will affect all future use of the service. Here was are setting the username and password meaning all future calls with this service will use this credential.

16\. To process the returned response we have the `onAuthenticateUserSuccess` function which is passed the `credentials`, `options.success` callback and `options.scope`. It's last parameter will be the SData result as `dojo.hitch` prepends the argument list.

            onAuthenticateUserSuccess: function(credentials, callback, scope, result) {
                var user = {
                    '$key': lang.trim(result['response']['userId']),
                    '$descriptor': result['response']['prettyName'],
                    'UserName': result['response']['userName']
                };

                this.context['user' ] = user;
                this.context['roles'] = result['response']['roles'];
                this.context['securedActions'] = result['response']['securedActions'];

                if (this.context['securedActions'])
                {
                    array.forEach(this.context['securedActions'], function(item) {
                        this[item] = true;
                    }, (this.context['userSecurity'] = {}));
                }

                if (callback)
                    callback.call(scope || this, {user: user});
            },

17\. That's a lot of code but it really breaks down to three parts:

   1\. Parse the response to get the Users details and store that information into the App.context object

   2\. Flatten the securedActions array into an object for quicker lookups

   3\. Call the callback, which passes control back over to `Login.js`, where it gets `enable()`ed and calls `App.navigateToInitialView()`.

      * Implementation of parsing the user details and security will differ on your SData provider.

18\. When authentication fails we want to remove the user/pass from the service instance just to be on the safe side:

            onAuthenticateUserFailure: function(callback, scope, response) {
                var service = this.getService();
                if (service)
                    service
                        .setUserName(false)
                        .setPassword(false);

                if (callback)
                    callback.call(scope || this, {response: response});
            },

19\. In which the callback will alert the user with an error message as defined in `Login.js`.

20\. Before we go and test we need to make sure that the login page is the first one shown instead of the home page.

21\. Still in `Application.js` at the very bottom create the function `navigateToLoginView` and have it show our login view:

            navigateToLoginView: function() {
                var view = this.getView('login');
                if (view)
                    view.show();
            }

22\. Scroll up to the `run()` function and change the navigate to home to navigate to login:

            run: function() {
                this.inherited(arguments);
                this.navigateToLoginView();
            },

23\. We now need to undo the hard coded userName and password that was added in [Argos-Template Guide](#!/guide/v2_template_guide).

24\. Open `argos-template/configuration/development.js` and remove the `userName` and `password` keys from the `crm` service.

23\. Save and run your app, logging in with a valid user (example: "lee" no pass).

24\. To verify, after logging in type in the console: `App.context.user` and make sure you see the returned information.

You now have a working authentication system with login page. This could be further expanded with a remember me (storing credentials), or any other hooks you need for getting the initial user information. From here all the List, Detail and Edit views are "live" meaning you can set their view properties to point to various SData endpoints.

repository: Saleslogix/argos-saleslogix

repo_name: Saleslogix/argos-saleslogix


text:
# compare_follower
Get difference between follower and followed on instagram

## Configuration

1) Option
You need create a file : coockies.json
And to put your login Cookies inside in a JSON format

2) Option
 - create only coockies.json with ```[{}]``` inside
 - run ```python get_cookies.py ```

 Now you will login to you account you have 1 minute to login
 after that the page will close and your coockies.json will be ready

## Run Bot :

```
python bot_insta.py
```

## what it s will do it :
You will see your account open a the script get the data of your follower and followed

at the end you will have 1 single file  :notfollower.json
you have all name of followed  that not follow you


text:
THIS IS A WORK IN PROGRESS
----------------

**Shannon** is a new general purpose stream-oriented programming language; it is concise and yet feature rich. Some (and only some) of the features that make Shannon distinct are:

* Streams, FIFOs and UNIX shell-style pipes are first-class concepts in the language. You can connect functions and FIFOs within your program similar to the way you connect processes with pipes in the UNIX shell. These constructs in Shannon, however, allow any structured data to be passed through the pipes, not only characters. These features allow for more concise and readable code for chained data processing and inter-thread communication.

* State is a special type of function that returns a reference to its own internal (local) data and nested functions. In effect, states implement classes in terms of OOP.

* (Planned for future releases) Special type of modules marked as "persistent" is an effective replacement for databases and SQL - you can access persistent shared data using native Shannon constructs, eliminating the need for an extra query language.

* Intuitive and minimalist syntax and semantics. Particularly "minimalist semantics" means less things to remember - more possibilities.

* Shannon is statically-typed although it provides dynamic typing facilities as well.
The current implementation is a monolithic compiler+VM binary. It is written in fairly straightforward C++ which produces a very compact binary.

```
'Run, Rabbit, Run!' || preplace('Rabbit', 'Shannon') || sio

def dow = (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday)
def shortDowNames = {Monday = 'Mon', Tuesday = 'Tue', Wednesday = 'Wed',
    Thursday = 'Tue', Friday = 'Fri', Saturday = 'Sat', Sunday = 'Sun'}

for dow, name = shortDowNames
{
    sio << name
    if dow >= Saturday:
        sio << ' (Yay! Weekend! Still working though.)'
    sio << endl
}
```

repository: crontab/shannon

repo_name: crontab/shannon


text:
# Hathor Wallet Library

Library used by [Hathor Wallet](https://github.com/HathorNetwork/hathor-wallet). More information at Hathor Network [website](https://hathor.network/).

## Install

`npm install @hathor/wallet-lib`

## Setting storage

This lib requires a storage to be set so it can persist data. Take a look at `src/storage.js` for the methods this storage object should implement.
```
const hathorLib = require('@hathor/wallet-lib');
hathorLib.storage.setStore(storageFactory);
```

repository: HathorNetwork/hathor-wallet-lib

gha_language: TypeScript

repo_name: HathorNetwork/hathor-wallet-lib


text:
+++
# A Demo section created with the Blank widget.
# Any elements can be added in the body: https://sourcethemes.com/academic/docs/writing-markdown-latex/
# Add more sections by duplicating this file and customizing to your requirements.

widget = "blank"  # See https://sourcethemes.com/academic/docs/page-builder/
headless = true  # This file represents a page section.
active = true  # Activate this widget? true/false
weight = 25  # Order that this section will appear.

#title = "Establishing a global, freely available database of stable isotope ratios for deep-sea ecosystems"
#subtitle = ""

[design]
  # Choose how many columns the section has. Valid values: 1 or 2.
  columns = "1"

[design.background]
  # Apply a background color, gradient, or image.
  #   Uncomment (by removing `#`) an option to apply it.
  #   Choose a light or dark text color by setting `text_color_light`.
  #   Any HTML color name or Hex value is valid.

  # Background color.
  # color = "navy"

  # Background gradient.
  # gradient_start = "DeepSkyBlue"
  # gradient_end = "SkyBlue"

  # Background image.
  #image = "headers/bubbles-wide.jpg"  # Name of image in `static/img/`.
  #image_darken = 0.6  # Darken the image? Range 0-1 where 0 is transparent and 1 is opaque.
  #image_size = "cover"  #  Options are `cover` (default), `contain`, or `actual` size.
  #image_position = "center"  # Options include `left`, `center` (default), or `right`.
  #image_parallax = true  # Use a fun parallax-like fixed background effect? true/false

  # Text color (true=light or false=dark).
  text_color_light = false

[design.spacing]
  # Customize the section spacing. Order is top, right, bottom, left.
  padding = ["20px", "0", "20px", "0"]

[advanced]
 # Custom CSS.
 css_style = ""

 # CSS class.
 css_class = ""
+++
The use of stable isotopes as ecological tracers in deep-sea ecosystems has a long history, dating back to the late 1970's. Stable isotopes have been instrumental to many key-findings about ecosystem functioning, particularly in active habitats (hydrothermal vents, cold seeps). However, constraining sampling logistics commonly limit the scope, extent, and therefore insights drawn from isotope-based deep-sea studies. Overall, much is left to discover about factors globally influencing food web structure in deep-sea ecosystems. In this context, deep-sea ecologists have to ensure that no sample is left unexploited, and that all generated data  are easily discoverable and reusable.

To help achieving this goal, we are setting up a large-scale compilation of stable isotope ratios of C, N and S in organisms from deep-sea ecosystems. The data acquisition strategy is based on 1) analysis of available literature and 2) new valorization of material already sampled during past cruises.

The compiled database will soon be freely available through the [IsoBank repository](http://www.isobank.org/). In doing so, we aim to provide the deep-sea community with an open data analysis tool that can be used in the context of future ecological research, and to help deep-sea researchers to use stable isotope markers at their full efficiency.

{{
}}

## More info

For more info, you can [download this poster](/img/michell_isoecolchile.pdf) or [get in touch here](/#contact/).

## How can you contribute?

To maximise the scope of the project, we are looking for

*   Raw data underlying published articles
*   Unpublished / grey literature data
*   Suitable samples for analysis

If you are willing to share any of the above, please [get in touch](/#contact/)!

## Involved people & funding

The working group currently includes **Loïc N. Michel** (Ifremer, FR), **Stanislas F. Dubois** (Ifremer, FR), **Brian Hayden** (University of New Brunswick, CA), **Gilles Lepoint** (University of Liège, BE), **Karine Olu** (Ifremer, FR), **Gauthier Schaal** (University of Western Brittany, FR) and **Jozée Sarrazin** (Ifremer, FR).

This work is supported by the "Laboratoire d’excellence" [LabexMER](https://www.labexmer.eu/en) (ANR-10-LABX-19) and co-funded by a grant from the French government under the program "Investissements d’avenir".

repository: loicnmichel/personal-website

repo_name: loicnmichel/personal-website


text:
---
layout: post
title: "Capturing Motion"
date: 2014-09-17 11:09:26
image: '/assets/img/project_screenshots/kinect.screenshot.png'
image-description: "Photo of an xbox kinect"
image-position: center
description:
tags:
- Kinect
- Asus Xtion Pro
- Systems
- Hardware
- c++
categories:
- Robotics
twitter_text:
---

## The Goal

The first step taken to set up the [R. Links project ](http://scaperoth.com/?p=12757 "The Project has Landed")is to give the robot the gift of sight. Without vision, it would be unable to make sense of its [IMU (intertial measurement unit)](http://en.wikipedia.org/wiki/Inertial_measurement_unit) and other sensors that will be added on later. The [Xtion Pro Live](http://www.asus.com/us/Multimedia/Xtion_PRO_LIVE/) will allow the "brain" to calculate things along the lines of what sort of terrain is being walked on, distance to an object, and current velocity. One of the most interesting components here is the velocity. Since there is no real way to sense velocity data, the motion sensor will be used to compare frames to calculate distance over time to find a velocity. Once we find the velocity, we can derive the acceleration (or change in velocity over time). In pseudocode we can calcuate the velocity with something ilke

{% highlight python %}
    //get velocity at some time interval
    function store_velocity:
        velocity[] = get_velocity()

    function velocity_derivative(velocity[], time_interval):
        num_records = size(velocity)
        for i in num_records:
            f_xh = velocity(i+1)
            f_x = velocity(i)
            deriv += f_xh - f_x / time_interval
        //return average derivative
        return deriv/num_records
{% endhighlight %}

the real tricky part is using the device to get the velocity in ~.01 second. That, I am still working on.

## The Device

[The Xtion Pro Live](http://www.asus.com/us/Multimedia/Xtion_PRO_LIVE/) is a motion sensing device that can be used for development on the PC. This device uses infrared and depth detection to draw out a real-time image of the environment. The real kicker is that it works using the OpenNI library which comes with tons of great sample code to pull from.

## The Setup

This is the tricky part. There are a few dependencies and some libraries you need to download. The setup is very similar to if you were using the Kinect, but Xtion does have some nice documentation. Initially (assuming you're running Ubuntu 14.04 on a 4 bit system), you will want to run
{% highlight c %}
sudo apt-get update
{% endhighlight %}

{% highlight c %}
sudo apt-get install git g++ python libusb-1.0-0-dev libudev-dev openjdk-6-jdk freeglut3-dev doxygen graphviz -y
{% endhighlight %}
Next if you go to the [ASUS website](http://www.asus.com/us/Multimedia/Xtion_PRO_LIVE/HelpDesk_Download/), they have files that you can download for Ubunut with helpful README documents to walk you through downloading OpenNi and NITE. Once you have those files downloaded, it is fairly simple. You can run ./install.sh from the top directory and then navigate to the OpenNi folder. Once there you will see a Bin folder (if that doesn't exist, you can run
{% highlight c %}
make
{% endhighlight %}
from one of the "Sample/*" folders that hold sample code). Once in Bin/x64-Release/, run
{% highlight c %}
./Sample-<modulename>
{% endhighlight %}
to run whichever module you'd like to test. If everything went smoothly, you should be able to view the output of that compiled code. Once you've got the samples working, you can review the Makefile of each sample to get an idea of how to create your own custom motion sensing code.