text:
# Resource Scheduling

Website and backend allowing to anyone schedule a resource.

# Front End

This application will have a front end allow all users to

- Confirm meeting participation
- Book a resource if authorized by the domain company
-

**/**
Initial page will explain the application propose, how to use, why subscribe.

# Backend

**/User**
Manages the user information

_Models_

1. CreateUserCommand
2. Roles

- IncludeRole
- RemoveRole

**/Domain**

- Default availability - Begin, End, Minor Time, Max Time
- MustConfirm
- Administrators
- Book users

**/ResourceType**
Manages the standard default types for this application along with its pictures such as

_Models_

1. ResourceTypeModel

- Id
- Domain
- Name
- HasMaxUsers
- Picture

_Apis_

- Standard crud with ResourceTypeModel

**/ResourceItem/:domain**
Enlists the resources for this application

_Models_

1. ResourceItem

- Id
- Domain
- Name
- InfrastructureDescription
- MaxUsers
- ResourceType
- Location
- Availability - Begin, End, Minor Time, Max Time
  - Second version
- Picture
- UsersToApprove
- UsersToNotify

_Apis_

- Standard crud with ResourceTypeModel

**/Booking/:domain**
Manages room booking

_Models_

1. MyBookingsCommand

- InitialDate
- FinalDate
- OnlyFuture
- NotRealized

2. AvailableResoucesCommand

- InitialDate
- FinalDate
- ResourceType

3. Book

- InitialDate
- Final
- InvitedUserList
- ConfirmedUserList
- PresentUserList
- ResourceList
- IsConfirmed
- IsApproved

repository: alexandreapplications/rescheduler

repo_name: alexandreapplications/rescheduler


text:
# Lab 05 - Common Errors

Created: 27 June 2018

Updated: 27 June 2018

Certain types of errors are common to the new Verilog programmer. The aim of this
exercise is to make a few of those errors and see they way manifest.

## Reg vs Wire Mixups

One of the more confusing parts of Verilog is the wire vs reg requirements. It is
very easy to get this wrong and sometimes the error messages aren't as obvious as
you'd like.

1. Open the logic.v file
1. Modify the port definition for output signals s, z etc. so that it changes from a wire type to a reg type i.e. insert the 'reg' keyword
1. Run behavioural simulation
1. Locate the error message in the Tcl Console. Does the error mesage make sense to you?
1. Remove the 'reg' keyword from the s, z port i.e. undo previous change
1. Modify the port definition for output signal sum so that it changes from a reg type to a wire type i.e. remove the 'reg' keyword
1. Run behavioural simulation
1. Locate the error message in the Tcl Console.  Does the error mesage make sense to you?
1. Add the 'reg' keyword to the sum port i.e. undo previous change
1. Run behavioural simulation
1. Verify all tests pass

## Combinational Sensitivities

Sensitivity lists will cause problems with combinational circuits when you get them
wrong. Verilog 2001 makes this less likely due to the @* value but you will encounter
many examples of older style sensitivity lists in textbooks and internet search
results.

They aren't wrong, just an older style that was error prone. The language was updated
in 2001 to make this less likely to occur.

1. Open the logic.v file
1. Modify the always statement sensitivity list to read '@(fn or a or b)'
1. Run behavioural simulation
1. The module should pass all tests
1. Modify the always statement sensitivity list to read '@(fn, a)'
1. Run behavioural simulation
1. The module should fail test 6 but pass all others
1. Modify the always statement sensitivity list to read '@(fn)'
1. Run behavioural simulation
1. The module should fail multiple tests. What do the passing tests have in common?
1. Modify the always statement sensitivity list to read '@*'
1. Run behavioural simulation
1. Verify all tests pass

license: MIT

repository: makehackvoid/fpga-sig

branch_name: refs/heads/master

extension: md

gha_language: Verilog

gha_license_id: MIT

license_type: permissive

repo_name: makehackvoid/fpga-sig


text:
#  BiometricKit for Android

This library provides an easy way to implement fingerprint authentication without having to deal with all the boilerplate stuff going on inside. You can choose between AndroidX BiometricPrompt (if you want latest and greatest) or FingerprintManagerCompat (if you want additional customization)

This library wraps around AndroidX Biometric 1.0.1 in case you want to use biometric dialog provided by Android system. It will use biometrics according to user's settings (it could be fingerprint, iris, etc), whatever manufacturer provided as SECURE. For example, on some devices FaceID is flagged as NOT SECURE by manufacturer (they can be tricked using your photo). However, Goodle didn't provide us with the prompt or dialog for devices with in-display fingerprint sensor (eg: OnePlus 6T, 7, 7T, Galaxy S10, S20, etc). AndroidX shows you fingerprint icon at the bottom of the display for such devices.

In case you want full control over the biometrics prompt and have consistency across devices, please you FingerprintManagerCompat option. Although deprecated, it still has some advantages until AndroidX has minor problems with in-display sensors.

## Requirements
- AndroidX artifacts
- You can use this library on from API16. However, biometric authentication is only supported from API23 (Marshmallow). Before API23 your dialog won't be displayed and you will get a callback

## Usage

1. Add jitpack.io to your project's build.gradle repositories:

```gradle
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
```

2. Add this line your app's gradle dependencies:

```gradle
dependencies {
    ...
    implementation 'com.github.Sultan1993:Android-BiometricKit:1.0.1'
    ...
}
```

Alternatively, you can downlaod the project and customize you dialog as you want. Download the source code and import it to your project. In case you want to import it as a module:
1. Download the project
2. Click "Import module.."
3. Choose biometrickit folder
4. Add this line to your app's build gradle.

```gradle
dependencies {
    implementation project(":biometrickit")
}
```

#### Android X option

To create Android X Biometric Prompt you need to create BiometricXBuilder class instance. Here you define properties of the prompt. Most of the methods are self-explanatory, however, you want to read more, open to AndroidX BiometricPrompt documentation

```kotlin
val biometricXManager = BiometricXManager.BiometricXBuilder(context)
    .setTitle("Dialog title. It's required")
    .setNegativeButtonText("Dialog dismiss button text. It's required")
    .setSubtitle("Dialog subtitle. It's optional")
    .setDescription("Description for user. It's optional")
    .setDeviceCredentialsAllowed(false)
    .setConfirmationRequired(false)
    .build()
```

To show your prompt in Activity, you have to call authenticate (see below for callback's definition):
```kotlin
biometricXManager.authenticate(activity, authenticationCallback, compatibilityCallback)
```

To show your prompt in Fragment:

```kotlin
biometricXManager.authenticate(fragment, authenticationCallback, compatibilityCallback)
```

#### FingerprintManagerCompat option

To create custom biometrics dialog you need to create BiometricBuilder class instance. Here you define properties of the dialog.

```kotlin
val biometricManager = BiometricManager.BiometricBuilder(this)
    .setTitle("Dialog title. It's required")
    .setNegativeButtonText("Dismiss button. It's required")
    .setSubtitle("Dialog subtitle. It' optional")

    //success text will be shown if auth succeeds
    .setSuccessText("Success authentication text. It's optional")

    //error title and subtitle will be shown if auth fails for some reason
    //if you don't provide them, system error text will be shown
    .setErrorTitle("Error authentication title. It's optional")
    .setErrorSubtitle("Error authentication subtitle. It's optional")
    .build()
```

To show your dialog:

```kotlin
biometricManager.authenticate(authenticationCallback, compatibilityCallback)
```

#### Authentication & Compatibility Callbacks

Both of them are interfaces which return callbacks. Authentication callback as it's name suggests returns all events corresponding to authentication. Similarly, Compatibility callback returns events for compatibility checks (eg: illegal arguments, SDK not supported, Fingerprint not available).

```kotlin
object : BiometricKit.AuthenticationCallback {

    override fun onAuthenticationFailed() {
        /*
        *  Will be called if the fingerprint doesn’t match with any of the fingerprints registered on the device
        */
    }

    override fun onAuthenticationCancelled() {
        /*
        *  Will be called if the authentication was cancelled by the user
        */
    }

    override fun onAuthenticationSuccessful() {
        /*
        *  Will be called if the fingerprint has been successfully matched with one of the fingerprints in the device
        */
    }

    override fun onAuthenticationHelp(helpCode: Int, helpString: CharSequence?) {
        /*
        *  This method is called when a non-fatal error has occurred during the authentication
        * process. The callback will be provided with an help code to identify the cause of the
        * error, along with a help message.
        */
    }

    override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) {
        /*
        * When an unrecoverable error has been encountered and the authentication process has
        * completed without success, then this callback will be triggered. The callback is provided
        * with an error code to identify the cause of the error, along with the error message.
        */
    }
}
```

```kotlin
object : BiometricKit.CompatibilityCallback {

    override fun onBiometricAuthenticationNotSupported() {
        /*
        *  Will be called if the device SDK version does not support Biometric authentication or
        *  if the device does not contain any fingerprint sensors
        */
    }

    override fun onBiometricAuthenticationNotAvailable() {
        /*
        *  Will be called if the device does not have any biometrics registered in the device
        */
    }

    override fun onBiometricAuthenticationPermissionNotGranted() {
        /*
        *  Will be called if biometrics permissions were not granted to the app
        */
    }
}
```

## Screenshots

This is how AndroidX Biometric Prompt looks:

This is how AndroidX Biometric Prompt looks on devices with in-display fingerprint scanner:

This is how FingerprintManagerCompat custom dialog looks (in case you obtained full source code of this library, you can customize this dialog as you want. It's just a subclass of Android Dialog):

This is how FingerprintManagerCompat dialog looks both on regular fingerprint sensors:

This is how FingerprintManagerCompat dialog looks both on in-display fingerprint sensors:


text:
# AndelaChallenge
Android app to retrieve a list of Java Developers in Lagos using the Github API

# Screenshots

# License

Copyright 2017 Olorunishola Habeeb Bayo

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

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

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

repository: habeex/AndelaChallenge

repo_name: habeex/AndelaChallenge


text:
# IronWorker::RunnerApi

All URIs are relative to *https://localhost:8080/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**groups_name_tasks_id_error_post**](RunnerApi.md#groups_name_tasks_id_error_post) | **POST** /groups/{name}/tasks/{id}/error | Mark task as failed.
[**groups_name_tasks_id_start_post**](RunnerApi.md#groups_name_tasks_id_start_post) | **POST** /groups/{name}/tasks/{id}/start | Mark task as started, ie: status = 'running'
[**groups_name_tasks_id_success_post**](RunnerApi.md#groups_name_tasks_id_success_post) | **POST** /groups/{name}/tasks/{id}/success | Mark task as succeeded.

# **groups_name_tasks_id_error_post**
> TaskWrapper groups_name_tasks_id_error_post(name, id, body)

Mark task as failed.

Task is marked as failed if it was in a valid state. Task's `finished_at` time is initialized.

### Example
```ruby
# load the gem
require 'worker_ruby'

api_instance = IronWorker::RunnerApi.new

name = "name_example" # String | Name of group for this set of tasks.

id = "id_example" # String | Task id

body = IronWorker::Complete.new # Complete |

begin
  #Mark task as failed.
  result = api_instance.groups_name_tasks_id_error_post(name, id, body)
  p result
rescue IronWorker::ApiError => e
  puts "Exception when calling RunnerApi->groups_name_tasks_id_error_post: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **name** | **String**| Name of group for this set of tasks. |
 **id** | **String**| Task id |
 **body** | [**Complete**](Complete.md)|  |

### Return type

[**TaskWrapper**](TaskWrapper.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

# **groups_name_tasks_id_start_post**
> TaskWrapper groups_name_tasks_id_start_post(name, id, body)

Mark task as started, ie: status = 'running'

Task status is changed to 'running' if it was in a valid state before. Task's `started_at` time is initialized.

### Example
```ruby
# load the gem
require 'worker_ruby'

api_instance = IronWorker::RunnerApi.new

name = "name_example" # String | Name of group for this set of tasks.

id = "id_example" # String | Task id

body = IronWorker::Start.new # Start |

begin
  #Mark task as started, ie: status = 'running'
  result = api_instance.groups_name_tasks_id_start_post(name, id, body)
  p result
rescue IronWorker::ApiError => e
  puts "Exception when calling RunnerApi->groups_name_tasks_id_start_post: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **name** | **String**| Name of group for this set of tasks. |
 **id** | **String**| Task id |
 **body** | [**Start**](Start.md)|  |

### Return type

[**TaskWrapper**](TaskWrapper.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

# **groups_name_tasks_id_success_post**
> TaskWrapper groups_name_tasks_id_success_post(name, id, body)

Mark task as succeeded.

Task status is changed to succeeded if it was in a valid state before. Task's `completed_at` time is initialized.

### Example
```ruby
# load the gem
require 'worker_ruby'

api_instance = IronWorker::RunnerApi.new

name = "name_example" # String | Name of group for this set of tasks.

id = "id_example" # String | Task id

body = IronWorker::Complete.new # Complete |

begin
  #Mark task as succeeded.
  result = api_instance.groups_name_tasks_id_success_post(name, id, body)
  p result
rescue IronWorker::ApiError => e
  puts "Exception when calling RunnerApi->groups_name_tasks_id_success_post: #{e}"
end
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **name** | **String**| Name of group for this set of tasks. |
 **id** | **String**| Task id |
 **body** | [**Complete**](Complete.md)|  |

### Return type

[**TaskWrapper**](TaskWrapper.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


text:
nlp - Microsoft cognitive service APIs
=

This repository contains some demos to show what can be done with some of the language APIs.

Installation
-

Clone this repository and execute the following:

    npm install
    npm run dev

Make sure to register on the Microsoft azure page and replace the `YOUR KEY HERE` placeholders
with your actual keys.

Slides and summarisation
-

* Slides: [doc/slides.pdf](https://github.com/thormeier-fhnw-repos/nlp-ms-cognitive-services-demos/tree/master/doc/slides.pdf)
* Summarisation: [doc/summarisation.pdf](https://github.com/thormeier-fhnw-repos/nlp-ms-cognitive-services-demos/tree/master/doc/summarisation.pdf)

Disclaimer
-
All images belong to their respective owner. All resurces used are purely for educational purposes.
The code itself is published under MIT.


text:
# RPS Project

#### RPS, 1.0 2/1/2018

#### By **Victor Felix**, **Dillon**, **Drew**, **Jhamanz**

## Description

This is a Rock, Paper, Scissor game were you can choose to compete against a computer
or against another person. You can only choose different characters and stage to battle on.
Keybinds for pvp: Q,W,E = Player1  I,O,P = Player2
GET READY AND FIGHT!

## Setup/Installation Requirements

* Direct link: https://vfelix82.github.io/rps-project/
* Clone from github
* Open with html

## Known Bugs

## Support and contact details

If you would like to get a hold me, please email me at<EMAIL_ADDRESS>
## Technologies Used

Html

CSS

BOOTSTRAP

JAVASCRIPT

### License

MIT lincense

Copyright (c) 2016 **Victor Felix**, **Dillon**, **Drew**, **Jhamanz**


text:
# Asponte [![Build Status](https://secure.travis-ci.org/morrissinger/slush-asponte.png?branch=master)](https://travis-ci.org/morrissinger/slush-asponte) [![NPM version](https://badge-me.herokuapp.com/api/npm/slush-asponte.png)](http://badges.enytc.com/for/npm/slush-asponte)

> A slush generator to scaffold an AngularJS / ECMAScript6-based front-end with a solid developer toolkit and build processes.

Asponte is a play on the Latin *sua sponte* meaning "of one's own volition". This generator is so named because many
seemingly hard-to-set-up features of your application can be deployed with ease; the generator takes care of a lot
of heavy lifting.

Applications built with Asponte include:
  * [Angular.js](https://angularjs.org/)
  * ECMAScript 6 (with transpiling via [6to5](https://6to5.org))
  * Test server (via [Express](http://expressjs.com/))
  * Test, Dev and Production builds (via [Gulp](gulpjs.com))
  * Tests (with [Mocha](mochajs.org), [Karma](http://karma-runner.github.io/), [Chai](http://chaijs.com/), and full ES6 [sourcemap support](https://www.npmjs.com/package/karma-source-map-support))
  * Code coverage (via [Istanbul](https://github.com/gotwarlost/istanbul) and [Istanbul Custom Reports](https://github.com/Cellarise/gulp-istanbul-custom-reports), featuring full ES6 [sourcemap](git://github.com/douglasduteil/isparta) [support](https://github.com/Cellarise/istanbul-coverage-source-map))
  * LiveReload

Additionally, there are a some optional components you may choose to deploy:
  * [Bootstrap](http://getbootstrap.com/) (with [SASS](sass-lang.com) and [LESS](http://lesscss.org/))
  * [Bourbon](http://bourbon.io/)

This generator is both opinionated and non-opinionated. It is built with certain assumptions about the best way to
organize one's Angular.js project. There will naturally be disagreement about this. The good news is that Slush
allows one to use only the generators she pleases. So, if you do not like the app organization, but like the
code generation utilities for modules and their components, for example, you can use only those portions
of this project.

## Getting Started

Install `slush-asponte` globally:

```bash
$ npm install -g slush-asponte
```

### Usage

Create a new folder for your project:

```bash
$ mkdir my-slush-asponte-project
```

Run the generator from within the new folder:

```bash
$ cd my-slush-asponte-project && slush asponte
```

## Project Layout
Projects built with Asponte are highly organized, as follows:

/ (contains README, gulpfile, Express server, and some configuration files.

/build (contains builds)

/dev (contains development build)

/production (contains production build)

/test (contains test build, for running tests via Karma / Gulp)

/src (contains the index.html of your project)

/js (contains Angular bootstrapping and other JavaScript that has to run before Angular does is ready)

/modules (contains a set of Angular modules you create with Asponte or otherwise)

*module name* (contains an individual module created with Asponte or othwerise)

/controllers (contains controllers and controller tests)

/services (contains services and service tests)

/directives (contains directives and directive tests)

/templates (contains Angular HTML templates)

/scss (contains module-specific SCSS)

/tasks (contains a set of Gulp tasks, one per file)

/test (contains test configuration files, other than the karma.conf.js file, which is at the project root)

## Generators
Asponte includes several generators to help you build your project.

### asponte
> Builds a starter application with AngularJS featuring a number of advantageous features that can be a pain to set up.

This generator adds *src* directory, basis Gulp tasks in the *tasks* directory, basic test configuration in the *test* directory.
To use, run:

```bash
slush asponte
```

#### Customizations
This generator allows you to specify the following parameters:
  * Project name
  * Project description
  * Project version
  * Author name
  * Author email
  * Author github username
  * License

Additionally, you can choose whether or not you wish to include the following components:

  * [Bootstrap] (http://getbootstrap.com/) with [ui-Bootstrap] (http://angular-ui.github.io/bootstrap/)
  * [uiRouter] (https://github.com/angular-ui/ui-router)
  * [uiSelect] (https://github.com/angular-ui/ui-select)
  * [Bourbon] (http://bourbon.io/)

### module
> Creates a new module in src/modules and creates a -module.js file to declare the Angular module.

This generator adds [module-name] directory under src/modules, and adds [module-name]-module.js in that directory. To use, run:

```bash
slush asponte:module
```

### Angular Standard Recipes

Asponte contains generators for all of the standard angular recipes:
  * animation
  * constant
  * controller
  * directive
  * factory
  * filter
  * provider
  * service
  * value

#### service
> Creates a new Angular service in the module of your choice, and sets up some scaffolding for the service and for tests.

This generator adds [service-name]-service.js and [service-name]-service-spec.js under src/modules/[module-name]/services. To use, run:

```bash
slush asponte:service
```

#### factory
> Creates a new Angular factory in the module of your choice, and sets up some scaffolding for the factory and for tests.

This generator adds [factory-name]-factory.js and [factory-name]-factory-spec.js under src/modules/[module-name]/factories. To use, run:

```bash
slush asponte:factory
```

#### controller
> Creates a new Angular controller in the module of your choice, and sets up some scaffolding for the controller and for tests.

This generator adds [controller-name]-controller.js and [controller-name]-controller-spec.js under src/modules/[module-name]/controllers. To use, run:

```bash
slush asponte:controller
```

#### value
> Creates a new Angular value in the module of your choice, and sets up some scaffolding for the value and for tests.

This generator adds [value-name]-value.js and [value-name]-value-spec.js under src/modules/[module-name]/values. To use, run:

```bash
slush asponte:value
```

#### provider
> Creates a new Angular provider in the module of your choice, and sets up some scaffolding for the provider and for tests.

This generator adds [provider-name]-provider.js and [provider-name]-provider-spec.js under src/modules/[module-name]/providers. To use, run:

```bash
slush asponte:provider
```

#### constant
> Creates a new Angular constant in the module of your choice, and sets up some scaffolding for the constant and for tests.

This generator adds [constant-name]-constant.js and [constant-name]-constant-spec.js under src/modules/[module-name]/constants. To use, run:

```bash
slush asponte:value
```

#### filter
> Creates a new Angular filter in the module of your choice, and sets up some scaffolding for the filter and for tests.

This generator adds [filter-name]-filter.js and [filter-name]-filter-spec.js under src/modules/[module-name]/filters. To use, run:

```bash
slush asponte:filter
```

#### directive
#### animation

### Special Recipes

In addition to the standard recipes available to Angular, Asponte provides some additional ones. These largely mirror
the standard recipes (and, in fact, will all call `module.service()`) but are broken out here into special
recipes in case you want to leverage some additional organization in your project.

#### template
> Creates a new Angular template HTML file in the module of your choice, along with a file for SCSS styles.

This generator adds [template-name]-template.html under src/modules/[module-name]/templates and [template-name]-styles.scss under src/modules/[module-name]/scss. To use, run:

```bash
slush asponte:template
```

#### interceptor
#### resource
#### resolver

## Getting To Know Slush

Slush is a tool that uses Gulp for project scaffolding.

Slush does not contain anything "out of the box", except the ability to locate installed slush generators and to run them with liftoff.

To find out more about Slush, check out the [documentation](https://github.com/klei/slush).

## Contributing

See the [CONTRIBUTING Guidelines](https://github.com/morrissinger/slush-asponte/blob/master/CONTRIBUTING.md)

## Support
If you have any problem or suggestion please open an issue [here](https://github.com/morrissinger/slush-asponte/issues).

## License

The MIT License

Copyright (c) 2015, Morris Singer

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

repository: morrissinger/slush-asponte

repo_name: morrissinger/slush-asponte


text:
# cnn-lstm
reference
 [cnn lstm tutorial and keras implement](https://machinelearningmastery.com/cnn-long-short-term-memory-networks/)

##prepair
### _keras model visualize_
 * 1.use model.summary

		model.summary()
* 2.use keras vislualize utils

		pip install graphviz

	for python3 use

		pip install pydot

## reference

* [Image denoising and restoration with CNN-LSTM Encoder Decoder with Direct Attention](https://arxiv.org/abs/1801.05141)
* [CONVOLUTIONAL, LONG SHORT-TERM MEMORY,
FULLY CONNECTED DEEP NEURAL NETWORKS](https://research.google.com/pubs/archive/43455.pdf)

__flatten layer__
>The last stage of a convolutional neural network (CNN) is a classifier. It is called a dense layer, which is just an artificial neural network (ANN) classifier.
>And an ANN classifier needs individual features, just like any other classifier. This means it needs a feature vector.
>Therefore, you need to convert the output of the convolutional part of the CNN into a 1D feature vector, to be used by the ANN part of it. This operation is called flattening. It gets the output of the convolutional layers, flattens all its structure to create a single long feature vector to be used by the dense layer for the final classification.

__reference__
[quora answer by Mehmet Ufuk Dalmis](https://www.quora.com/What-is-the-meaning-of-flattening-step-in-a-convolutional-neural-network)

#keras issues

[How to use Different Batch Sizes when Training and Predicting with LSTMs](https://machinelearningmastery.com/use-different-batch-sizes-training-predicting-python-keras/)
[What should be the batch for Keras LSTM CNN to process image sequence](https://stackoverflow.com/questions/46187124/what-should-be-the-batch-for-keras-lstm-cnn-to-process-image-sequence)
[How are inputs fed into the LSTM/RNN network in mini-batch method?](https://www.quora.com/How-are-inputs-fed-into-the-LSTM-RNN-network-in-mini-batch-method)
[What is batch size in neural network?](https://stats.stackexchange.com/questions/153531/what-is-batch-size-in-neural-network)

#scene text detection papers & resources
1. [Detecting and Recognizing Text in Natural Images](https://www.youtube.com/watch?v=Vb0adWGfWqo)
2. [vikesh_final](http://cs231n.stanford.edu/reports/2015/pdfs/vikesh_final.pdf)
3. [ICDAR2017 Competition on Reading Chinese Text in the Wild](https://vision.cornell.edu/se3/wp-content/uploads/2017/08/PID4980421.pdf)
4. [Detecting Oriented Text in Natural Images by Linking Segments](https://www.researchgate.net/publication/315454607_Detecting_Oriented_Text_in_Natural_Images_by_Linking_Segments)
5. [An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition](https://arxiv.org/abs/1507.05717)
6. [TextBoxes: A Fast Text Detector with a Single Deep Neural Network](https://arxiv.org/abs/1611.06779)
7. [AID: A Benchmark Dataset for Performance Evaluation of Aerial Scene Classification](https://arxiv.org/abs/1608.05167)
8. [Robust Scene Text Recognition with Automatic Rectification](https://arxiv.org/abs/1603.03915)

repository: friendshipity/keras-resnet

repo_name: friendshipity/keras-resnet


text:
This repository contains a C++ cross platform wrapper for the MarkLogic Server REST API.

## Introduction

The MLCPlusPlus project maintains the MarkLogic C++ mlclient API. This API provides a C++ native connection
to MarkLogic Server version 6 and above.

A C wrapper API around the core C++ API is also provided. This enables legacy C applications to be configured to
talk to MarkLogic Server. All C++ usage is abstracted behind this wrapper API.

## Latest release

The latest release is 8.0.0 - See [The release notes](https://raw.githubusercontent.com/adamfowleruk/mlcplusplus/develop/documentation/release-notes/release-notes-8.0.0.md) for details.

Note the Major and Minor version numbers of this project track MarkLogic Server, the revision number tracks this API's changes, rather than the revision number of MarkLogic Server.

## Documentation

Various documentation is available:-
 - mlclient API overview - http://adamfowleruk.github.io/mlcplusplus/api/index.html
 - mlclient Design Document -http://adamfowleruk.github.io/mlcplusplus/api/page__design.html
 - mlclient Install guide - http://adamfowleruk.github.io/mlcplusplus/api/page__install.html
 - GitHub future Release features - https://github.com/adamfowleruk/mlcplusplus/milestones
 - GitHub Issues tracker - https://github.com/adamfowleruk/mlcplusplus/issues

## Quick Start

You can build from source then use in your projects.

Please see the http://adamfowleruk.github.io/mlcplusplus/api/page__install.html file for details

## Getting involved

Please email adam dot fowler at marklogic.com if you are interested in helping out.

repository: ableasdale/mlcplusplus

repo_name: ableasdale/mlcplusplus


text:
chrome-ssb
==========
Simple script for making Chrome SSBs on OS X

This is an update of [Bracken King](https://twitter.com/brackenthebox)'s original script published in [this 2010 article](http://www.lessannoyingcrm.com/articles/149/Create_application_shortcuts_in_Google_Chrome_on_a_Mac).

I've updated it a bit to work better:
* Allow spaces in all variables
* Properly Trim spaces for easy drag and dropping of icon paths
* Properly look for Chrome location in /Applications (it uses the first one it finds)
* Make the new App wherever it's called from
* Your Profile is placed in the correct location (in the Bundle) no matter where you move the app

## Usage
* Place chrome-ssb.sh in your path or somewhere convenient to call from
* Run chrome-ssb.sh wherever you want
* You can also move the created app anywhere you want without issues

**Note:** Finder may not pick up the icon (shows up as invisible) if you have the creation target folder active/open. You can make it show up by moving the App to a different folder. If you know a workaround, please send a pull request...

## Notes
* This script now makes a copy of the 'Google Chrome' launcher executable stub at application start (it is pretty small, about 13KB) instead of symlinking to solve 10.9 compatibility issues (see #22). The executable points to a specific version of the Google Chrome Framework (../Versions/[VERSION]/Google Chrome Framework.framework/Google Chrome Framework).
* Copying the launcher executable instead of symlinking will break OS X Gatekeeper's code signing. This shouldn't normally be a problem, but is discussed in depth in Issue #23

## TODO
* Better Icon Processing
  * http://www.amnoid.de/icns/makeicns.html
  * http://superuser.com/questions/133784/manipulate-mac-os-x-file-icons-from-automator-or-command-line

## License
Do as you will

repository: samejar/dotfiles

repo_name: samejar/dotfiles


text:
---
layout: post
title: Simulating Double Digest to get Fragment Distributions
category: [ Methylation ]
tags: [ DNA, RAD, Porites, Pocillopora ]
---

# Using ddRADSeqTools, the _Porites lutea_ genome, and the _Pocillopora damicornis_ genome to simulate PstI and MspI restriction enzyme fragment distributions

Downloaded [ddRADSeqTools](https://github.com/GGFHF/ddRADseqTools) from Github by clicking Clone or Download, and select Download Zip
This Downloaded the repo to my computer, which is probably not the best way to do this, but it worked. I then copied it to my KITT account.

```
# in KITT made a directory to work in
mkdir sim-rad-frags
```
Have to use my terminal to copy things to KITT
```
scp -r -P zzzz /Users/maggieschedl/Desktop/ddRADseqTools-master.zip mschedl@kitt.uri.edu:/home/mschedl/sim-rad-frags
```
Then I unzipped it and made the scrips exicutable by using the commands they have in the [manual](https://github.com/GGFHF/ddRADseqTools/blob/master/Package/manual/ddRADseqTools-manual.pdf)
```
unzip ddRADseqTools-master.zip
cd ddRADseqTools-master/Package
chmod u+x *.py
conda install NumPy #also the manual says you need this program installed
```
Then download the two genomes
[_Porites lutea_](http://plut.reefgenomics.org/)
[_Pocillopora damicornis_](https://www.ncbi.nlm.nih.gov/genome/22550)

```
scp -r -P zzzz /Users/maggieschedl/Desktop/porites_plut_final_2.1.fasta.gz mschedl@kitt.uri.edu:/home/mschedl/

scp -r -P zzzz /Users/maggieschedl/Desktop/poc_GCF_003704095.1_ASM370409v1_genomic.fna.gz mschedl@kitt.uri.edu:/home/mschedl/
```
Move them to storage then link them to the directory where the scripts are
```
mv porites_plut_final_2.1.fasta.gz /RAID_STORAGE2/mschedl/geenomes/

mv poc_GCF_003704095.1_ASM370409v1_genomic.fna.gz /RAID_STORAGE2/mschedl/geenomes/

cd sim-rad-frags/ddRADSeqTools-master/Package

ln -s /RAID_STORAGE2/mschedl/geenomes/* .
```
The program uses a text file with all the restriction enzymes and their cut sites as a reference, I went through the file and saw that they didn't have MspI so I added it in

```
nano restrictionsites.txt

MspI;C*CGG # add this in alphabetical order
```
Then the rsitesearch.py script uses the rsitesearch-config.txt to get all the information on what genome and enzymes to use. This is the only script I used, because it "extracts the fragments resulting from an _in silico_ digestion of a reference genome with two particular restriction endonucleases."

I edited the config file to do _Pocillopora_ first.
```
nano  rsitesearch-config.txt

genfile=./poc_GCF_003704095.1_ASM370409v1_genomic.fna.gz             # add in the pocillopora genome, the . because I linked it to this directory
fragsfile=./results/fragments.fasta         # path of the fragments file
rsfile=./restrictionsites.txt               # path of the restriction sites file
enzyme1=PstI                              # id of 1st restriction enzyme used in rsfile or its restriction site sequence
enzyme2=MspI                                # id of 2nd restriction enzyme used in rsfile or its restriction site sequence
minfragsize=150                             # lower boundary of loci fragment's size
maxfragsize=700                             # upper boundary of loci fragment's size
fragstfile=./results/fragments-stats.txt    # path of the output statistics file
fragstinterval=25                           # interval length of fragment size
plot=NO                                    # statistical graphs: YES or NO
verbose=YES                                 # additional job status info during the run: YES or NO
trace=NO                                    # additional info useful to the developer team: YES or NO
```

Then you have to make the results directory for some reason before it runs
```
mkdir results
```
Then run the script
```
python rsitesearch.py
```
**Output: 22679 fragments written**
This means that there are 22679 fragments digested by both PstI and MspI in this _Pocillopora_ genome that are between 150 and 700bp long.

Change the name of the directory because doing two of these
```
mv results results-poc
```
The names of the files it gives you are
fragments.fasta  fragments-GC-distribution.csv  poc-fragments-stats.csv  poc-fragments-stats.txt

Copy the results to my computer to run them on R. I had to change the CSV file format in excel to make the figure in R
```
scp -r -P zzzz mschedl@kitt.uri.edu:/home/mschedl/sim-rad-frags/ddRADseqTools-master/Package/results/* /Users/maggieschedl/Desktop/URI/Maggie/PutnamPuritzMoorea

```

The CSV file doesn't go into excel well, the columns are separated by ; instead of commas. I changed the fragments-stats.csv to a .txt by renaming it (it gives an error but do it anyways), then in excel in the Data tab, import from text and use that file. Follow the GUI and say that the fields are delimitated, then specify ; as the symbol. After that it makes a column for each field. But, the fragment interval values 1-25, 26-50 etc are not continuous, so those don't work for the graph I wanted. So I created a new column to the right of the interval column to split it. Select the interval column and click text to column in the data tab. Again say delaminated and this time by - this should make two columns and I named them fragment_interval_start and fragment_interval_end. This way I could make another column mean_locus_size that was the average of those two columns. There's probably a way to do this in R but 🤷🏻

Then I did the same thing for the _Porites_

```
nano  rsitesearch-config.txt

genfile=./porites_plut_final_2.1.fasta.gz             # file of the reference genome in fasta format
fragsfile=./results/fragments.fasta         # path of the fragments file
rsfile=./restrictionsites.txt               # path of the restriction sites file
enzyme1=PstI                              # id of 1st restriction enzyme used in rsfile or its restriction site sequence
enzyme2=MspI                                # id of 2nd restriction enzyme used in rsfile or its restriction site sequence
minfragsize=150                             # lower boundary of loci fragment's size
maxfragsize=700                             # upper boundary of loci fragment's size
fragstfile=./results/por-fragments-stats.txt    # path of the output statistics file
fragstinterval=25                           # interval length of fragment size
plot=NO                                    # statistical graphs: YES or NO
verbose=YES                                 # additional job status info during the run: YES or NO
trace=NO                                    # additional info useful to the developer team: YES or NO
```
Saved and ran the script
```
mkdir results
python rsitesearch.py
mv results results-por
```
**Output: 70510 fragments written**
This means that there are 70510 fragments digested by both PstI and MspI in this _Porites_ genome that are between 150 and 700bp long.

Then copied to my computer
```
scp -r -P zzzz mschedl@kitt.uri.edu:/home/mschedl/sim-rad-frags/ddRADseqTools-master/Package/results-por/* /Users/maggieschedl/Desktop/URI/Maggie/PutnamPuritzMoorea
```
Changed the csv file in the same way and renamed it for _Porites_

### Using R to Make Figures of the Fragment Distributions

Load Packages
```{r}
getwd()
library(ggplot2)
library(tidyverse)
```
Read the edited CSV files from ddRADSeqTools output
```{r}
pocillopora_RAD_stats <- read.csv("POC-PstI-MspI-RAD-frags.csv")

porites_RAD_stat <- read.csv("POR-PstI-MspI-frags.csv")
```

**Pocilliopora Fragments**
Using mutate highlights the region between 150-700bp, then I also set the cut off of the x axis to be 5000, we aren't looking that high anyways.
```{r}
pocillopora_RAD_stats %>%
mutate(highlight_flag = ifelse(mean_loci_size > 150 & mean_loci_size < 700, T, F)) %>%
ggplot(aes(x=mean_loci_size, y=num_frags))+
geom_bar(aes(fill= highlight_flag), stat="identity") +
theme_bw(base_size=18) + scale_fill_manual(values = c('#58a2d3', '#b2e58e'))  + theme(legend.position = "none") + xlab("Mean Locus Size") + ylab("Number of Loci") + xlim(0, 5000)

ggsave("pocillopora150-700frag.jpg", height=7, width=10, units="in", dpi=600)

```
![poc]({{ site.baseurl}}/images/pocillopora150-700frag.jpg "poc")

**Porites Fragments**

```{r}
porites_RAD_stat %>%
mutate(highlight_flag = ifelse(mean_loci_size > 150 & mean_loci_size < 700, T, F)) %>%
ggplot(aes(x=mean_loci_size, y=num_frags))+
geom_bar(aes(fill= highlight_flag), stat="identity") +
theme_bw(base_size=18) + xlim(0, 5000) + scale_fill_manual(values = c('#58a2d3', '#b2e58e')) + theme(legend.position = "none") + xlab("Mean Locus Size") + ylab("Number of Loci")

ggsave("porites150-700frag.jpg", height=7, width=10, units="in", dpi=600)
```
![por]({{ site.baseurl}}/images/porites150-700frag.jpg "por")


text:
# Getting environment up and running

## Set up local development environment

To get the a local development environment up and running quickly using docker run:
```bash
./bin/build-images.sh
./bin/set-me-up.sh
```

You can skip running `./bin/build-images.sh` if the images are already built.

The `./bin/set-me-up.sh` script will do the following:
- Run a docker container
- Copy the built workspace to the destination folder of choice
- Stop the container

## Use Docker as a development environment

If you have your workspace locally and want to use the docker machine to run your code do:
```bash
./bin/run-desktop.sh <ABSOLUTE_PATH_OF_FOLDER_PROVIDED_IN_SET_ME_UP>
```

For instance:
```bash
./bin/run-desktop.sh /home/ian/yolact-docker
```
Where `/home/ian/yolact-docker` is the folder you provided to `./bin/set-me-up.sh`

repository: cmrobotics/yolact

gha_language: Python

repo_name: cmrobotics/yolact


text:
# Overview {#concept_lpz_q5l_l2b .concept}

This topic describes common operations and best practices for activating and using Web Application Firewall \(WAF\), and helps you learn about WAF and its configuration procedure.

## How to use WAF {#section_exg_kvj_wgb .section}

Web Application Firewall \(WAF\) helps you monitor HTTP and HTTPS requests to your website and implement access control. WAF supports custom ACL rules and provides multiple built-in scenario-based protection features.

Configuration procedure:

1.  [Activate WAF](#) and [configure WAF for your website](#) to redirect requests that are sent to your website to WAF for monitoring.
2.  After you have configured WAF for your website, [specify WAF protection policies](#). WAF detects and filters malicious requests to your website based on the specified protection policy. Only valid requests are allowed to access the origin server.
3.  After WAF is enabled, you can [view WAF security reports](#) to learn about security details and risks. You can also configure [WAF settings](#) to view WAF resource usage status and adjust alarm settings.
4.  You can use [WAF best practices](#) to improve security management, or [contact technical support](#).

## Activate WAF {#activate .section}

WAF supports the Subscription billing method. When you use the Subscription billing method, you are billed on a monthly or annual basis. After you choose a Subscription plan, the payment must be settled immediately. WAF services are available during the valid subscription period.

After you activate WAF, you will obtain a WAF instance and a WAF IP address. This WAF instance provides protection for up to 10 domains. These domains must use the same top-level domain.

**Related topics**

-   [WAF billing methods](../../../../../reseller.en-US/Pricing/Billing method.md#)
-   [Activate Web Application Firewall](../../../../../reseller.en-US/Pricing/Subscription/Activate Alibaba Cloud WAF.md#)
-   [WAF renewal and upgrade](../../../../../reseller.en-US/Pricing/Renewal and upgrade.md#)
-   [Disable Web Application Firewall](reseller.en-US/User Guide/Setting/Release WAF instance.md#)

**WAF instance specifications**

-   [Subscription plans](../../../../../reseller.en-US/Pricing/Subscription/Subscription plans.md#)

    Web Application Firewall offers three Subscription plans: Advanced, Enterprise, and Flagship. You can select an appropriate Subscription plan based on your Web business scale and actual protection requirements.

-   [Extra bandwidth](../../../../../reseller.en-US/Pricing/Subscription/Extra bandwidth.md#)

    Before you choose a WAF Subscription plan, you need to evaluate your normal business traffic to separate normal traffic from unusual traffic, such as DDoS attacks. Different Subscription plans support different bandwidth conditions. If your actual business traffic exceeds the upper limit offered by the plan, you must purchase extra bandwidth.

-   [Extra domain quotas](../../../../../reseller.en-US/Pricing/Subscription/Extra domain quota.md#)

    If you need to protect domain names that use different top-level domains, you must purchase extra domain quotas.

-   [Exclusive WAF IP addresses](../../../../../reseller.en-US/Pricing/Subscription/Exclusive WAF IP.md#)

    If you need exclusive protection for an important domain, instead of using one WAF IP address to protect all domains, you can purchase an exclusive WAF IP address.

## Configure WAF {#implement .section}

After you activate WAF, you can use the transparent proxy mode or DNS proxy mode to configure WAF for your website.

**Note:** You can choose either mode to configure WAF. If you choose the transparent proxy mode, clear the website configuration that you have set for the DNS proxy mode. If you choose the DNS proxy mode, clear the website configuration for the transparent proxy mode.

-   Transparent proxy mode: This mode directs HTTP requests that are received on port 80 of the specified origin server to WAF. WAF processes the requests and then redirects the requests to the origin server.

    To use this mode, you must authorize WAF to access the ECS instances where your services are deployed. To configure this mode, add a domain and specify the IP address of the server that hosts your website in the WAF console.

-   DNS proxy mode: This mode directs requests that are sent to the protected domain to WAF based on the specified DNS record. WAF then processes and redirects the requests to the specified origin server.

    In DNS proxy mode, you must add website configuration and specify the domain that needs protection in the WAF console. Requests sent to the website are directed to WAF for monitoring based on [DNS settings](https://en.wikipedia.org/wiki/Domain_Name_System).

    -   Add website configuration: Website configuration specifies the domain that needs protection and the origin server IP address. WAF can automatically add website configuration. You can also manually add website configuration. You must specify required information including the domain name of the website that needs protection and the IP address of the server that hosts the website in the website configuration. After you add website configuration, WAF assigns an exclusive [CNAME record](https://en.wikipedia.org/wiki/CNAME_record) for the domain name.

        **Note:** If you use Alibaba Cloud DNS to translate your domain name, website configuration is automatically added. Otherwise, you need to manually add website configuration and change the DNS record.

    -   Change the DNS record: Only after you have added and enabled the WAF CNAME record for the specified domain name, requests sent to the website can be redirected to WAF for monitoring.

After you configure WAF for your website, WAF can filter out malicious requests. Only valid requests are allowed to access the origin server.

**Related topics**

-   [Use the transparent proxy mode to configure WAF](reseller.en-US/User Guide/Use the transparent proxy mode to implement WAF.md#)
-   [Website configuration \(DNS proxy mode\)](reseller.en-US/User Guide/Use the DNS proxy mode to configure WAF/Website configuration.md#)
-   [Configure DNS settings \(DNS proxy mode\)](reseller.en-US/User Guide/Use the DNS proxy mode to configure WAF/Configure DNS settings.md#)

## Configure protection policies {#configure .section}

Alibaba Cloud WAF offers multiple protection policies. You can adjust your protection policies based on your actual needs.

You can create custom ACL rules or use the built-in protection features. The Web Application Firewall team wrote the filtering algorithms based on attacks patterns and analysis of request headers and request bodies, and encapsulated the algorithms into the protection features for efficient use.

 After you enable WAF and configure a protection policy, a request sent from a client to WAF has been filtered on multiple layers. Default detection sequence: **Access Control** \> **HTTP Flood Protection** \> **Web Application Protection**.

**Related topics**

-   [HTTP ACL policy](reseller.en-US/User Guide/Configuration/HTTP ACL policy.md#) and [Configure a whitelist or blacklist](reseller.en-US/User Guide/Configuration/Configure a whitelist or blacklist.md#)

    Custom access control rules allow WAF to filter requests based on client IP addresses, request URLs, and common request header fields.

-   [Web application protection](reseller.en-US/User Guide/Configuration/Web application protection.md#)

    This feature protects your Web applications against common Web attacks, such as SQL injection and XSS attacks.

-   [HTTP flood protection](reseller.en-US/User Guide/Configuration/HTTP flood protection.md#) and [Custom HTTP flood protection](reseller.en-US/User Guide/Configuration/Custom HTTP flood protection.md#)

    These features protect your Web applications against HTTP floods.

-   [New intelligent protection engine](reseller.en-US/User Guide/Configuration/New intelligent protection engine.md#)

    This feature performs semantic analysis on requests, detects malicious requests, and protects your Web applications against attacks such as confusion attacks and attack variants.

-   [Malicious IP blocking](reseller.en-US/User Guide/Configuration/Malicious IP Penalty.md#)

    This feature automatically blocks a client IP address that has launched multiple attacks on your website in a short period of time.

-   [Blocked regions](reseller.en-US/User Guide/Configuration/Blocked regions.md#)

    This feature blocks access requests based on the geographic location of the client's IP address and supports blocking all requests from one or more specified Chinese provinces or other countries or regions.

-   [Antifraud Service](reseller.en-US/User Guide/Configuration/Data risk control.md#)

    This feature protects your Web applications against bot attacks such as zombie accounts, account theft, vote cheating, and spam messages.

-   [Webpage defacement protection](reseller.en-US/User Guide/Configuration/Website tamper-proofing.md#)

    This feature can lock specified webpages to avoid content tampering. When a locked webpage receives a request, only the cached page that you have set is returned.

-   [Data leakage prevention](reseller.en-US/User Guide/Configuration/Data leakage prevention.md#)

    This feature masks sensitive information in the response returned by the server, such as the ID number, bank card number, telephone number, and sensitive words.

## Security reports {#reporting .section}

Web Application Firewall provides visualized data and statistics for you to learn about your business status and security statistics.

**Related topics**

-   [Overview](reseller.en-US/User Guide/Reporting/Business and security overview.md#)

    View business QPS data and security protection statistics.

-   [Security reports](reseller.en-US/User Guide/Reporting/WAF security reports.md#)

    Search for attack details and risk warnings on your domain name within 30 days.

-   [Full logs](reseller.en-US/User Guide/Reporting/Log search.md#)

    Search for your website logs and use online analysis to quickly locate requests.

    **Note:** You must enable the **Log Query** feature on the Website Configuration page for the domain name for WAF to collect access logs for a specified domain name.

## WAF settings {#setting .section}

You can learn about WAF resources and manage alarm settings and custom rule groups on the Settings page.

**Related topics**

-   [View product information](reseller.en-US/User Guide/Setting/View product information.md#)

    You can view resource details of your WAF instance, updates on WAF protection policies and features, and WAF back-to-origin CIDR block.

-   [Alarm settings](reseller.en-US/User Guide/Setting/Configure alarm settings.md#)

    WAF informs you about security events and system alarms through emails or SMS. You can configure the alarm triggering condition, alarm interval, and the method to receive alarms.

-   [Custom rule groups](reseller.en-US/User Guide/Setting/Custom rule groups.md#)

    A rule group is a combination of the built-in protection rules of WAF that make up a protection policy for a specific protection feature. You can create and use a custom rule group for a specific protection feature of WAF to suit your needs.

## Best practices {#practice .section}

Best practices help you improve the management and use of WAF.

**Related topics**

-   [Obtain authentic client IP address](../../../../../reseller.en-US/Best Practices/Get real client IP address.md#)

    After you configure WAF for a website, all requests that are received by the origin server are redirected by WAF. The IP addresses of the clients that initiate the requests are not displayed. This topic describes how to obtain the real IP address that initiates the request to your origin server.

-   [Protect your origin server](../../../../../reseller.en-US/Best Practices/Protect your origin server.md#)

    After WAF is activated, the origin server IP address is not visible to the client. If your origin server IP address is exposed or unintentionally disclosed, attackers can bypass WAF and launch attacks on your origin server. This topic describes how to configure protection features to protect your origin server.

-   [Deploy WAF and Anti-DDoS Pro together](reseller.en-US/User Guide/Use the DNS proxy mode to configure WAF/Deploy WAF and Anti-DDoS Pro together.md#)

    If you have activated Alibaba Cloud Anti-DDoS Pro and Web Application Firewall, you can follow the procedures in this topic to complete the configuration.

-   [Deploy WAF and CDN together](reseller.en-US/User Guide/Use the DNS proxy mode to configure WAF/Deploy WAF and CDN together.md#)

    If you have activated Alibaba CloudCDN and Web Application Firewall, you can follow the procedures in this topic to complete the configuration.

## Technical support {#expert .section}

If you experience any problems while using Web Application Firewall, hover over the **Technical Support** icon in the left-side navigation pane in the [WAF console](https://partners-intl.console.aliyun.com/#/waf). A DingTalk QR code is displayed.

Scan the QR code with DingTalk to join the technical support group to consult the experts on any technical problems or urgent issues.

**Note:** You can download DingTalk on the [DingTalk website](https://www.dingtalk.com/).

![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/15550/15532340347113_en-US.png)

path: /intl.en-US/User Guide/Overview.md


text:
---
layout: post
title: "IntelliJ Rust Changelog #144"
date: 2021-03-29 17:00:00 +0300
---

## New Features

* Support import aliases in `Move` refactoring (`Refactor | Move` or F6)

  {% include gif-img.html path="/assets/posts/changelog-144/6947" w="600px" %}

* [Const generics](https://rust-lang.github.io/rfcs/2000-const-generics.html) support improvements:

  * Support const generics in `Wrong generic arguments number` ([E0107](https://doc.rust-lang.org/error-index.html#E0107)) inspection

  * Support `Move Element Right/Left` actions for const generic parameters

  * Properly render const generics in signature of a top-level item

  * Fix type rendering with const generic parameters

* Complete dependencies by subwords in `Cargo.toml` when using experimental local crates index. This feature is disabled by default
  for now. To use it, enable `org.rust.crates.local.index` option in `Experimental Feature` dialog (`Help | Find Action` and type `Experimental features` to open the dialog)

  {% include gif-img.html path="/assets/posts/changelog-144/6799" w="600px" %}

* Import unresolved types from a function signature after performing `Extract Function` refactoring (`Refactor | Extract Method` or
  Ctrl+Alt+M)

* Automatically select the default project Rust toolchain from `Preferences | Languages & Frameworks | Rust` when creating a new project

*  Use [`todo!()`](https://doc.rust-lang.org/std/macro.todo.html) instead of [`unimplemented!()`](https://doc.rust-lang.org/std/macro.unimplemented.html)
   in function bodies generated by [code generation](https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-code-generation.html) features like  `Implement members` and `Create function` actions (by [@KarelPeeters])

* Auto-indent line when typing Enter in macro bodies

* Provide debugging with LLDB in [Rider for Unreal Engine](https://www.jetbrains.com/lp/rider-unreal/) 2021.1.
  Note, only [MSVC toolchain](https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/msvc-toolchain-support.html) is supported

* Increase minimal supported rustc version to 1.41.0

* Enable by default `Simplify boolean expression` inspection

## Fixes

* Do not show `` Redundant `::` `` warning for expressions inside length of array types

* Reduce availability range of some intention actions. For example, now `Add else branch to this if statement` is not suggested in Alt+Enter menu when the caret is placed inside an `if` body

* Do not insert default type parameters by `Implement Member` actions

* Do not move the entire `match` arm in [`Move Statement Up/Down`](https://www.jetbrains.com/help/idea/working-with-source-code.html#move-statements) action (Ctrl+Shift+Up/Down) invoked on the statement inside the arm body (by [@t-kameyama])

* Ignore environment variables when comparing Cargo run configurations. This allows reusing a similar existing configuration instead of creating a new one

* Fix code insight and name resolution for [in-band lifetimes](https://doc.rust-lang.org/beta/unstable-book/language-features/in-band-lifetimes.html)

* Expand macro calls under `cfg` attribute after toggling a Cargo feature

* Fix false-positive [E0658](https://doc.rust-lang.org/error-index.html#E0658) in stdlib

Full set of changes can be found [here](https://github.com/intellij-rust/intellij-rust/milestone/52?closed=1)

[@KarelPeeters]: https://github.com/KarelPeeters
[@t-kameyama]: https://github.com/t-kameyama

extension: markdown


text:
---
title: Was du brauchst
---

To make Holmes, you will need the following:

- Grundlegendes Nähzubehör
- About 0.5 meter of a suitable fabric ([see Fabric options](/docs/patterns/holmes/fabric/))
- About 0.5 meter of lining fabric
- A sheet of plastic or something rigid for the brim (1 mm thick or less)

branch_name: refs/heads/develop


text:
# StringSegment.After method

Returns everything that follows this segment in the source string.

```csharp
public StringSegment After()
```

## Return Value

Everything that follows this segment in the source string.

## See Also

* struct [StringSegment](../StringSegment.md)
* namespace [Faithlife.Utility](../../Faithlife.Utility.md)

<!-- DO NOT EDIT: generated by xmldocmd for Faithlife.Utility.dll -->

repository: Faithlife/FaithlifeUtility

gha_language: C#

repo_name: Faithlife/FaithlifeUtility


text:
## Command `peekpointers`

_Author_: [bkth](https://github.com/bkth)

This command helps find pointers belonging to other memory regions
helpful in case of OOB Read when looking for specific pointers

Syntax:

```python
gef➤  peek-pointers LOCATION [section-name]
```

Examples:

```python
gef➤  peek-pointers 0x55555575c000
cat pointer at 0x55555575c008, value 0x55555575c008
[stack] pointer at 0x55555575c0c0, value 0x7fffffffe497
libc-2.24.so pointer at 0x55555575c0c8, value 0x7ffff7dd2600 <_IO_2_1_stdout_>
[heap] pointer at 0x55555575d038, value 0x55555575d010
locale-archive pointer at 0x55555575d0b8, value 0x7ffff774e5c0
Could not read from address 0x55555577e000, stopping.
```

```python
gef➤  peek-pointers 0x55555575c000 libc-2.24.so
libc-2.24.so pointer at 0x55555575c0c8, value 0x7ffff7dd2600 <_IO_2_1_stdout_>
gef➤  peek-pointers 0x55555575c000 libc-2.24.so all
libc-2.24.so pointer at 0x55555575c0c8, value 0x7ffff7dd2600 <_IO_2_1_stdout_>
libc-2.24.so pointer at 0x55555575c0e0, value 0x7ffff7dd2520 <_IO_2_1_stderr_>
libc-2.24.so pointer at 0x55555575dfe8, value 0x7ffff7ba1b40 <_nl_default_dirname>
Could not read from address 0x55555577e000, stopping.
```

repository: clayne/gef-extras

branch_name: refs/heads/main

repo_name: clayne/gef-extras


text:
# Working with Redirect and Errors in Flask

## Description
	This is a simple program to show how to use the redirect method
	and to show how errors can be rendered in flask.

## Usage
	- Navigate to the 10_redirect_and_errors sub directory
	- Browse the directory
	- Read and understand the app.py file.
	- Open the terminal and export the flask application environment variable
		$ export FLASK_APP=app.py
	- Run the flask application
		$ flask run
	- Click the link in the terminal to view the application running in the browser
	- The output you see which is the result of serving the 401 error page is the customized 401 error page.
	- Change the url in the brower to <IP_ADDRESS>:5000/g in order to obtain a 404 error and to be served the 404  error page by the server.
	- See the output (the output is the customized 404 page)
	- You could comment the areas in the app.py file where we loaded the error pages to be loaded and then run the application again to view the default error pages served to the browser.


text:
# Android SDK integration guide {#concept_onv_rdb_r2b .concept}

This topic describes how to use DTplus data acquisition \(App Usertrack\) Android SDK.

App Usertrack Android SDK is a DTplus data statistics and monitoring service on Android platform for mobile developers. The SDK enables developers to easily track data in apps to monitor daily business data, network performance data, and observe the corresponding data report display in the DTplus console. In addition, you can customize the data chart display by setting custom data parsing rules.

You can obtain an example of Mobile Data Analysis Service from the engineering source code. For more information, see the man\_android\_demo project.

## 2. Install Mobile Analytics Android SDK {#section_mnc_ct1_r2b .section}

**Manually integrated SDK**

SDK directory structure

```
OneSDK Problems
|-- libs
|-- |-- jniLibs
| | |-- armeabi
| | | |-- libMotu.so
| | | |-- libtnet-3.1.1.so
| | |-- armeabi-v7a
| | | |-- libMotu.so
| | | |-- libtnet-3.1.1.so
| | |-- x86
| | | |-- libMotu.so
| | | |-- libtnet-3.1.1.so
| |-- alicloud-android-sdk-man-2.0.0.aar - Main feature package of Mobile Analytics
| |-- fastjson-1.1.41.sec01.jar
| |-- tlog_adapter-<IP_ADDRESS>.jar
| |-- tnet-jni-3.1.1.jar
| -- Ut-analytics-<IP_ADDRESS>.aar
| |-- utdid4all-1.5.0.jar
```

SDK integration

-   Manually copy jniLibsfrom the directory to the directory src/main.
-   Add the following configuration item in the build.gradle configuration.

    ```
    android {
      ...
      defaultConfig {
        ...
        ndk {
          moduleName "jniLibs"
          abiFilters "armeabi", "armeabi-v7a", "x86"
        }
      }
    }
    ...
    repositories {
      flatDir {
          dirs 'libs'
      }
    }
    ...
    dependencies {
       ...
      compile 'com.taobao.android:ut-analytics:<IP_ADDRESS>@aar'
      compile 'com.aliyun.android:alicloud-android-sdk-man:2.0.0@aar'
    }
    ```

## Application initialization {#section_txp_k51_r2b .section}

Before using the UserTrack app analytics, the Android SDK for data statistics and monitoring, the SDK context must be declared for permission. The application context passed, access control, and other initialization configurations. One of the permissions is declared as an AndroidManifest.xml file.

**3.1 Permission statement, AppKey, and AppSecret configurations**

The following are Android permissions required by the AppKey and AppSecret configurations of Mobile Analytics Android SDK . Ensure these permissions are already configured in AndroidManifest.xml file or SDK errors may occur.

```
...
<meta-data android:name="com.alibaba.app.appkey" android:value="YourAppKey"></meta-data>
<meta-data android:name="com.alibaba.app.appsecret" android:value="YourAppSecret"></meta-data>
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.GET_TASKS"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.READ_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
```

**Examples of app initialization and parameter settings**

Add the code to initialize the SDK in the application implementation class.

Initialize the API of App Usertack Analytics Android SDK:

```
public class YourApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
    /*  [Note] We recommend that you initialize MAN in Application to ensure the normal access to MANService/
    // Obtain MAN service
    MANService manService = MANServiceProvider.getService();
    // Enable the debug log. We recommend that you disable it for an online version.
    // manService.getMANAnalytics().turnOnDebug();
     // Set the channel (to mark the distribution channel name of this App). If not interested, you may skip this step so that this API is not called. Channel setting affects the report presentation of the Channel Analytics topic in the console. If the method in Section 3.3 can better meet your channel configuration needs, make configurations in accordance with Section 3.3 instead of calling this method;
    manService.getMANAnalytics().setChannel("A channel");
    // One of the MAN initialization methods is getting appKey and appSecret from AndroidManifest.xml
    manService.getMANAnalytics().init(this, getApplicationContext());
    // Another MAN initialization method is to manually specify appKey and appSecret
    // String appKey = "******";
    // String appsecret = "******";
    // manService.getMANAnalytics().init(this, getApplicationContext(), appKey, appSecret);
    // Disable the auto-hitting feature of the page with this API. For details, see 4.2
    manService.getMANAnalytics().turnOffAutoPageTrack();
    // If android:versionName in AndroidManifest.xml fails to meet your requirements, it can be specified here
    // If the app version is not set in either of the two locations, the reported field is null by default
    manService.getMANAnalytics().setAppVersion("3.1.1");
    }
}
```

**Configure channel information**

You can configure the channel information in AndroidManifest.xml by replacing `<YOUR CHANNEL ID>` with your channel information.

**Note:** When the SDK initialization is implemented, the AndroidManifest.xml field is automatically obtained, and entered in the channel field., When the initialization is completed, if the setChannel method is also called, the parameters in the setChannel method prevail.

```
<application ...
  <meta-data
    android:name="ALIYUN_MAN_CHANNEL"
        android:value="<YOUR CHANNEL ID>" >
    </meta-data>
</application>
```

## Business Data Statistics {#section_e5j_dx1_r2b .section}

**Member account information tracking point**

-   User Registration tracking point

    You can use userRegister to complete the user registration tracking after completing user registration.

    ```
    MANService manService = MANServiceProvider.getService();
    // User registration tracking
    manService.getMANAnalytics().userRegister("usernick");
    ```

-   User logon tracking:

    User Login tracking points are as follows:

    ```
    MANService manService = MANServiceProvider.getService();
    // User logon tracking
    manService.getMANAnalytics().updateUserAccount("usernick", "userid");
    ```

-   User logout tracking:

    The user logoff tracking points are as follows:

    ```
    // User logout tracking
    manService.getMANAnalytics().updateUserAccount("", "");
    ```

**Page tracking point**

Note: By default, the App Usertrack Analytics SDK is automatically set to obtain the Activity page of operation systems that are Android 4.0 and later. When the automatic page tracking is enabled, the default page name is class.getSimpleName \(\) and removes the suffix Activity. If automatic acquisition is unnecessary, disable the automatic page hitting with the following methods.

```
// Disable automatic hitting
MANService manService = MANServiceProvider.getService();
manService.getMANAnalytics().turnOffAutoPageTrack();
```

To meet page acquisition requirements in operating systems earlier than Android 4.0, you can perform manual tracking with the following instructions.

**Note:** If no page tracking is available in the App, no statistics can be performed on the Active User parameter.

-   Manual activity page tracking point

    In onreason and onpause of the Acitivity page, add the pageappear and the exact code. To complete all subclassed page tracking points, we recommend you use the following code respectively to complete activities in base class, and allow other activity classes to inherit the base class . The following is a template example:

    ```
    public class BaseActivity extends Activity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
        }
        @Override
        protected void onResume() {
            super.onResume();
            MANService manService = MANServiceProvider.getService();
            manService.getMANPageHitHelper().pageAppear(this);
        }
        @Override
        protected void onPause() {
            super.onPause();
            MANService manService = MANServiceProvider.getService();
            manService.getMANPageHitHelper().pageDisAppear(this);
        }
    }
    ```

-   Adding attribute statistics to an Activity page

    Assume you want to develop a shopping app, and want to view the items displayed on the baby display page of the shopping app. In other words, we can add an item property to the acquired page \(GoodsDetails page\) records, such as item\_id=xxxxxx. The following is a template example:

    ```
    // The statement can be called anywhere before the onPause of a page is called
    Map<String, String> lMap = new HashMap<String, String>();
    lMap.put("item_id", "xxxxxx");
    MANService manService = MANServiceProvider.getService();
    manService.getMANPageHitHelper().updatePageProperties(lMap);
    ```

    The sample log is as follows:

    ```
    11-06 16:10:32.088: I/cache_log(10879): UT:...||2001||-||-||3191||item_id=xxxxxx
    ```

    -   2001: The page event ID.
    -   3191: The page duration is displayed.
    -   Item\_id = dusk: The property.
-   Using base page tracking point

    The preceding sections focus on page tracking at the Activity level, where data reporting can be completed by calling pageAppear and pageDisapear. The reported data includes the page name, source page name, time-on-page, and additional property settings.

    If you want to track a non-Activity page for example, a Fragment page, or flexibly manage the reported information from page tracking , such as modifying the reported page information. You can use basic page tracking for special processing, such as the time-on-page.

    Obtain the base page management object as follows:

    ```
    // The input parameter is the page name
    MANPageHitBuilder pageHitBuilder = new MANPageHitBuilder(String pageName);
    ```

    Set the Source Page name as follows:

    ```
    pageHitBuilder.setReferPage(String referPageName);
    ```

    Set the page stop time as follows:

    ```
    pageHitBuilder.setDurationOnPage(long duration);
    ```

    Set page properties as follows:

    ```
    pageHitBuilder.setProperty(String key, String value);
    pageHitBuilder.setProperties(Map<String, String> properties);
    ```

    Construct the page tracking point log data as follows:

    ```
    pageHitBuilder.build();
    ```

## Performance data statistics {#section_jhd_yz1_r2b .section}

Developers often overlook how app performance can directly affect user experience. Mobile Analytics provides multiple performance monitoring APIs for you to comprehensively monitor the app status.

**Basic network performance statistics**

App Usertrack Analytics is encapsulated against the network performance statistics for traditional apps, making it easy for users to track data and obtain common metrics at the network level including:

-   Overall response time for the request
-   Overall app bandwidth utilization
-   Network exception statistics

After reporting the statistics from the correct data tracking point, you can view the apps corresponding performance metrics on the Mobile Analytics monitor page on Alibaba Cloud console.

**Starting a network request**

The App UserTrack Analytics performs network performance statistics based on a network request. You must track some record points in the network request process so that Mobile Analytics can collect the request statistics and report it to the data analysis center.

The network request statistics is completed with `MANNetworkPerformanceHitBuilder`. Before initiating a network request, you must call the following codes, record the Host information, and the request method of the network request, and mark the start of the network request:

```
MANNetworkPerformanceHitBuilder networkPerfBuilder = new MANNetworkPerformanceHitBuilder("taobao.com", "GET");
/ Record the start of a network request by hitting /
networkPerfBuilder.hitRequestStart();
```

In addition, the Mobile Analytics Android SDK provides an API for attaching additional information:

```
/ With additional information to be reported /
networkPerfBuilder.withExtraInfo("name1", "value1");
```

**Note:** The host must be in the standard Hostname format or it will be ignored. The method must be "GET" or "POST". The default method is "GET". Currently, only these two values are supported.

The front end display uses Host and Method as dimensions in these messages.

**Normal network request response time**

After the network request is completed, another tracking point is required to mark the end of the network request. The API is as follows:

```
networkPerfBuilder.hitRequestEndWithLoadBytes(loadBytes);
```

The loadBytes parameter of int type is used to input the total downloaded data volume of the network request for easy hitting records by Mobile Analytics Android SDK.

After calling this function, the entire tracking process of network performance is completed. The network request data is reported to the data analysis platform for analysis and summary. Then, you can view data in the configured MaxCompute table.

**Reporting network exceptions**

If a network exception occurs during tracking that interrupts the network request flow. You must handle this issue, otherwise it can cause hitting data disorder.

To report captured exceptions, mark the exception request by selecting the default network exception type or the custom network exception type:

**Default network exception types**

|Exception type or fig|Corresponding interface|
|:--------------------|:----------------------|
|400<=HttpResponseCode<500|buildHttpCodeClientError4XX\(\)|
|500<=HttpResponseCode|buildHttpCodeServerError5XX\(\)|
|MalformedURLException|buildMalformedURLException\(\)|
|InterruptedIOException|buildInterruptedIOException\(\)|
|SocketTimeoutException|buildSocketTimeoutException\(\)|
|IOException|buildIOException\(\)|

Usage:

```
// If you want to report other exceptions, replace the buildIOException with an appropriate API according to the preceding table
MANNetworkErrorInfo errorInfo = MANNetworkErrorCodeBuilder.buildIOException()
    .withExtraInfo("error_url", url.toString())
    .withExtraInfo("other_info", "value");
networkPerfBuilder.hitRequestEndWithError(errorInfo);
```

**Custom network exception types**

If the default network exception type does not meet your needs, you can customize network exception types, however, the network exception type encoding is within the range of 1001 <= yourerrorcode <= 1010. If you are not using a front end configuration, it will be displayed as an error code \(10xx\) if the information corresponding to the error code is configured on the front end. The information you configured is displayed.

Usage:

```
MANNetworkErrorInfo errorInfo = MANNetworkErrorCodeBuilder.buildCustomErrorCode(1001)
    .withExtraInfo("error_url", url.toString());
networkPerfBuilder.hitRequestEndWithError(errorInfo);
```

The API errorInfo parameter allows you to report important exception information.

**Note:** Once you call the API `networkPerfBuilder.hitRequestStart();`of `MANNetworkPerformanceHitBuilder`, you must verify that the code is run in `networkPerfBuilder.hitRequestEndWithLoadBytes(loadBytes);`. Under normal conditions, or in `networkPerfBuilder.hitRequestEndWithError(errorInfo);` in case of exceptions. Otherwise, the network request information may fail to be reported.

**4.1.4 Call the Tracker send method to report hitting data**

After using builder for hitting data in various phases, you must obtain the MANTracker to report data as follows:

```
manService.getMANAnalytics().getDefaultTracker().send(networkEvent); // Call the send method of Tracker to report the hitting data
```

The template sample is as follows:

```
MANService manService = MANServiceProvider.getService();
String urlString = "http://www.aliyun.com";
MANNetworkPerformanceHitBuilder networkPerformanceHitBuilder = new MANNetworkPerformanceHitBuilder("www.aliyun.com", "GET");
try {
    URL url = new URL(urlString);
    byte[] buf = new byte[64 * 1024];
    // Record-by-hitting request starts
    networkPerformanceHitBuilder.hitRequestStart();
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    // Establish the connection
    conn.connect();
    // Start obtaining response content
    int responseCode = conn.getResponseCode();
    long totalBytes = 0;
    int len = 0;
    if (responseCode == 200) {
        // Read all the response content
        InputStream in = conn.getInputStream();
        while ((len = in.read(buf)) ! = -1) {
            Totalbytes + = Len;
        }
        in.close();
    }
    // With additional information to be reported
    networkPerformanceHitBuilder.withExtraInfo("name1", "value1");
    // Mark-by-hitting request ends
    networkPerformanceHitBuilder.hitRequestEndWithLoadBytes(totalBytes);
} catch (IOException e) {
    e.printStackTrace();
    // As described in 5.1.3, select a default network exception type or a custom network exception type to report any network exception.
    MANNetworkErrorInfo errorInfo = MANNetworkErrorCodeBuilder.buildIOException()
            .withExtraInfo("error_url", urlString)
            .withExtraInfo("other_info", "value");
    // MANNetworkErrorInfo errorInfo = MANNetworkErrorCodeBuilder.buildCustomErrorCode(1001)
    // .withExtraInfo("error_url", urlString)
    // .withExtraInfo("other_info", "value");
    // Record errors by hitting
    networkPerformanceHitBuilder.hitRequestEndWithError(errorInfo);
}
// Report hitting data of network performance events
manService.getMANAnalytics().getDefaultTracker().send(networkPerformanceHitBuilder.build());
```

**Advanced network performance statistics**

If you require fine-grained network metrics and have used tracking points in network performance, according to instructions in 5.1. You can track the TCP connection time and first byte response time by following operations in this section.

-   TCP build time

    If you want to count the time spent on the network request TCP connections . After initiating the network request, you must call the following API to mark the successful TCP connection when the connection is established successfully:

    ```
    /Record the successful connection by hitting/
    Networkperfbuilder. hitfinished ();
    ```

    This function is typically called when the `httpURLConnection. connect ()` method or `httpClient. execute ()` method is completed.

-   The request first byte response time

    If you want to count the first byte response time of the network request, you must call the following API to mark the arrival of the first byte:

    ```
    networkPerfBuilder.hitRecievedFirstByte();
    ```

    The first byte usually arrives after running the `httpURLConnection.getResponseCode()` method or the `HttpResponse.getStatusLine.getStatusCode()` method.

    Example code after increasing TCP build-up time and first-byte response time tracking point as follows:

    ```
    MANService manService = MANServiceProvider.getService();
    String urlString = "http://www.aliyun.com";
    MANNetworkPerformanceHitBuilder networkPerformanceHitBuilder = new MANNetworkPerformanceHitBuilder("www.aliyun.com", "GET");
    try {
        URL url = new URL(urlString);
        byte[] buf = new byte[64 * 1024];
        // Record-by-hitting request starts
        networkPerformanceHitBuilder.hitRequestStart();
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        // Establish the connection
        conn.connect();
        // Record the connection time by hitting
        networkPerformanceHitBuilder.hitConnectFinished();
        // Start obtaining response content
        int responseCode = conn.getResponseCode();
        // Record the time for the first packet by hitting
        networkPerformanceHitBuilder.hitRecievedFirstByte();
        long totalBytes = 0;
        int len = 0;
        if (responseCode == 200) {
            // Read all the response content
            InputStream in = conn.getInputStream();
            while ((len = in.read(buf)) ! = -1) {
                Totalbytes + = Len;
            }
            in.close();
        }
        // With additional information to be reported
        networkPerformanceHitBuilder.withExtraInfo("name1", "value1");
        // Mark-by-hitting request ends
        networkPerformanceHitBuilder.hitRequestEndWithLoadBytes(totalBytes);
    } catch (IOException e) {
        e.printStackTrace();
        // Select a default network exception type or a custom network exception type to report a network exception
        MANNetworkErrorInfo errorInfo = MANNetworkErrorCodeBuilder.buildIOException()
                .withExtraInfo("error_url", urlString)
                .withExtraInfo("other_info", "value");
        // MANNetworkErrorInfo errorInfo = MANNetworkErrorCodeBuilder.buildCustomErrorCode(1001)
        // .withExtraInfo("error_url", urlString)
        // .withExtraInfo("other_info", "value");
        // Record errors by hitting
        networkPerformanceHitBuilder.hitRequestEndWithError(errorInfo);
    }
    // Report hitting data of network performance events
    manService.getMANAnalytics().getDefaultTracker().send(networkPerformanceHitBuilder.build());
    ```

-   Overall request response time \(See 4.1 Basic network performance statistics.\)
-   Overall app bandwidth utilization \(See 4.1 Basic network performance statistics.\)
-   Network exception statistics \(See 4.1 Basic network performance statistics.\)

**Custom performance event tracking point**

Custom performance event tracking can be used for real-time monitoring of customized performance events, such as time consumed by cache reading and writing, by RPC of private network protocol, and by client algorithm. After correct client tracking, you can perform multi-dimensional real-time data monitoring using the Alibaba Cloud console.

Custom performance events include the following parts:

-   The event name \(event\_label\), which must be a combination of letters, numbers, and underscores \[Required\].
-   The time duration from start to finish \(required\).
-   The property carried by the event \(optional\).

**Note:** Custom performance events are used to monitor the time overhead of user events. Ensure the correct parameter is passed by using the following code examples for reference .

```
String labelKey = "fibonacci";
MANCustomPerformanceHitBuilder performanceHitBuilder = new MANCustomPerformanceHitBuilder(labelKey);
// Record the starting time of custom performance events
performanceHitBuilder.hitStart();
Fresno (1 );
// Record the ending time of custom performance events
performanceHitBuilder.hitEnd();
// Method 2 for duration setting
// long timeCost = 0;
// performanceHitBuilder.setDuration(timeCost);
performanceHitBuilder.withExtraInfo("EXTRA_INFO_KEY1", "EXTRA_INFO_VALUE")
        .withExtraInfo("EXTRA_INFO_KEY2", "EXTRA_INFO_VALUE");
// Report hitting data of custom performance events
manService.getMANAnalytics().sendCustomPerformance(performanceHitBuilder.build());
```

## 5. Tracking of custom events {#section_qvh_3fb_r2b .section}

Custom event tracking can be used to meet users customization requirements. Custom performance events include the following parts:

-   1. Event name \(event\_label\)
-   2. Event duration from initiation to completion.
-   3. The event properties.
-   4. The page corresponding to the event.

For example:

```
// Event name: play_music
MANCustomHitBuilder hitBuilder = new MANHitBuilders.MANCustomHitBuilder("playmusic");
// Use the following API to set the duration: three minutes.
hitBuilder.setDurationOnEvent(3 * 60 * 1000);
// Set the associated page name: Listen
hitBuilder.setEventPage("Listen");
// Set the property: genre_rock
hitBuilder.setProperty("type", "rock");
// Set the property: song title
hitBuilder.setProperty("title", "wonderful tonight");
// Send hitting data of custom events
MANService manService = MANServiceProvider.getService();
manService.getMANAnalytics().getDefaultTracker().send(hitBuilder.build());
```

Custom Event extension parameters can be viewed in the console **Customization Time** \> **Detail Data** \> **Parameter Analysis**. Before viewing, you need to add the event ID to display in the console under **Administration Settings** \> **Custom Time Management**. For more information about how to monitor custom events in real time, see section 4.3 "Custom performance event".

## Does the real-time validation data report properly? {#section_dth_mgb_r2b .section}

If you want to verify that the data is reported in real time, you can perform the following.

1.  Open the SDK debug log:

    ```
    manService.getMANAnalytics().turnOnDebug();
    ```

2.  View the process log in logcat, assume your app process name is test\_app, then check the log for the process test\_app: Channel, test\_app: The channel process starts 10 seconds after your app process starts.
3.  In the process test\_app:channel, if you see the following log: `[uploadLogs] ,isSendSuccess:true,upload` it indicates that the logs have been uploaded successfully. You can see the related data in the MaxCompute table about five minutes later.

## Reporting H5 data {#section_hcc_xgb_r2b .section}

The H5 page data aggregation can be uploaded by notifying native through JSBridge, and then call the corresponding MAN method is called to report data.

JavaScript code:

```
// First, the JS Alert message appears. Then, the capture communication is performed on the native end.
Alert ("jsbridge: // custom ");
```

Java overrides the `onAlert` method in the `WebChromeClient`and intercepts the specified scheme. Then Java executes the method based on the corresponding content to achieve the purpose of calling the native tracking point.

```
WebView webView = (WebView) findViewById(R.id.h5DemoWebview);
webView.setWebChromeClient(new WebChromeClient(){
    @Override
    public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
         // Determine the format (uri, json, and xml).
        Uri uri = Uri.parse(message);
        if ( uri.getScheme().equals( "jsbridge" ) ) {
            if ( uri.getHost().equals( "custom" ) ) {
                // Event name: play_music
                MANHitBuilders.MANCustomHitBuilder hitBuilder = new MANHitBuilders.MANCustomHitBuilder("playmusic");
                // Use the following API to set the duration: three minutes.
                hitBuilder.setDurationOnEvent(3 * 60 * 1000);
                // Set the associated page name: Listen
                hitBuilder.setEventPage("Listen");
                // Set the property: genre_rock
                hitBuilder.setProperty("type", "rock");
                // Set the property: song title
                hitBuilder.setProperty("title", "wonderful tonight");
                // Send hitting data of custom events
                MANService manService = MANServiceProvider.getService();
                manService.getMANAnalytics().getDefaultTracker().send(hitBuilder.build());
            }
            return true;
        }
        return super.onJsAlert(view, url, message, result);
    }
});
```

## Obfuscate configuration { .section}

```
-keep class com.alibaba.sdk.android.**{*;}
-keep class com.ut.**{*;}
-keep class com.ta. **{*;}
```

url: https://raw.githubusercontent.com/xiaoyeziji/ide/eb85bd3aadb35d40931fc8b13803b685b65693c7/intl.en-US/User Guide/Data integration/Client data collection/Android SDK integration guide.md

repository: xiaoyeziji/ide

filename: Android SDK integration guide.md

repo_name: xiaoyeziji/ide


text:
---
# the default layout is 'page'
icon: fas fa-info-circle
order: 2
---

This is my own cheatsheet splitted in different topics with chunks of useful code.

> **Note:** This is an initial version.
{: .prompt-info }

## Table of contents
1. PowerShell
2. Malware Debugging

-----

## 1. PowerShell

* Get file's hashes via PowerShell:
`Get-FileHash -Path file.exe -Algorithm MD5 | Format-List`

* Watch a folder for file creation and copy files to Desktop:

```powershell
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.IncludeSubdirectories = $true
$watcher.Path = 'C:\'
$watcher.EnableRaisingEvents = $true

$action = {
    $path = $event.SourceEventArgs.FullPath
    copy $path %userprofile%\Desktop
}

Register-ObjectEvent $watcher 'Created' -Action $action
```

## 2. Malware Debugging

General manual unpacking breakpoints:
* CreateProcessInternalW
* VirtualProtect
* ResumeThread
* VirtualAlloc (on its return)


text:
---
title:  "GitLab"
date:   2017-09-22 16:34:46 -0700
categories: [git]
tags: [git, github, gitlab, source control]
---
I found out [GitHub](http://github.com) is the best place to host your code repositories. It is a git server with all functional collaboration tools yet fancy. But how about to have it for your own organization?

In search for a github-like git server, I was stumbled upon [GitLab](https://about.gitlab.com/).

gha_language: CSS


text:
---
layout: post
title:  LOs O
date:   2014-03-01
thumbImagePath: assets/thumbs/losO.png
shortDescription: These minimal vignettes describe the activity around each station in the Bay Area Bike Share system and beautifully illustrate the diversity of the system.
mainImagePath: assets/projectImages/losO/losO_main.jpg
---
*This project was created in collaboration with Natasa Papadi.*

Part of the Bay Area Bike Share Data Challenge, this projects visualizes different characteristics of every single station in the system. Based on a matrix of circles, the projects makes it easy to distinguish patterns and outlier stations, at the same time creating visually compelling images.

![Intro](../../../assets/projectImages/losO/O_01.jpg)

![Average number of trips per day](../../../assets/projectImages/losO/O_02.jpg)

![Percentage of trips per day of the week](../../../assets/projectImages/losO/O_03.jpg)

![Origins vs. destinations](../../../assets/projectImages/losO/O_04.jpg)

![Percentage of trips taken by subscribers](../../../assets/projectImages/losO/O_05.jpg)

![Outro](../../../assets/projectImages/losO/O_06.jpg)

*Built with [Processing](https://processing.org/).*

gha_language: SCSS