text:
** Go3p-Github-Pkg-Errors; version 1.x --
https://godoc.org/github.com/pkg/errors
Copyright (c) 2015, Dave Cheney<EMAIL_ADDRESS>All rights reserved.

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

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

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

------

**  Go3p-Golang-X-Sys; version 1.x -- https://github.com/golang/sys
Copyright (c) 2009 The Go Authors. All rights reserved.
** go; version 1.13.8 -- https://github.com/golang/go/
Copyright (c) 2009 The Go Authors. All rights reserved.
** Go3p-Github-Jessevdk-GoFlags; version 0.1.0 --
https://github.com/jessevdk/go-flags
Copyright (c) 2012 Jesse van den Kieboom. All rights reserved.
** Go3p-Golang-X-Crypto; version 20180728-614d502 --
https://tip.golang.org/pkg/crypto/
Copyright (c) 2009 The Go Authors. All rights reserved.
** Go3p-Golang-X-Net; version 20180521-5706520 --
https://tip.golang.org/pkg/net/
Copyright (c) 2009 The Go Authors. All rights reserved.
** Go3p-Golang-X-Text; version 1.x -- https://tip.golang.org/pkg/text
Copyright (c) 2009 The Go Authors. All rights reserved.
** google-uuid; version 1.0 -- https://github.com/google/uuid
Copyright (c) 2009,2014 Google Inc. All rights reserved.

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

   * Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above
     copyright notice, this list of conditions and the following disclaimer
     in the documentation and/or other materials provided with the
     distribution.
   * Neither the name of Google Inc. nor the names of its
     contributors may be used to endorse or promote products derived from
     this software without specific prior written permission.

------

** Go3p-Github-GoChi-Chi; version 3.3.2 -- https://github.com/go-chi/chi
Copyright (c) 2015-present Peter Kieltyka (https://github.com/pkieltyka),
Google Inc.
** Go3p-Github-GoChi-Render; version 1.0.0 -- https://github.com/go-chi/render
Copyright (c) 2016-Present https://github.com/go-chi authors

MIT License

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.

------

** Go3p-Golang-X-Sync; version 1.x -- https://github.com/golang/sync/
Copyright (c) 2009 The Go Authors. All rights reserved.

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

   * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
   * Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

 IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

------

** sirupsen-logrus; version 1.0.6 -- https://github.com/sirupsen/logrus
Copyright (c) 2014 Simon Eskildsen

The MIT License (MIT)

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.

------

** Go3p-Github-Satori-GoUUID; version 1.1.0 --
https://github.com/satori/go.uuid
Copyright (C) 2013-2016 by Maxim Bublis<EMAIL_ADDRESS>
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.


text:
# Agent plugin: KeyManager "disk"

The `disk` plugin generates a key pair for the agent's identity, storing the private key
on disk. If the agent is restarted, the key will be loaded from disk. If the agent is unavailable
for long enough for its certificate to expire, attestation will need to be re-performed.

| Configuration | Description                                      |
|---------------|--------------------------------------------------|
| directory     | The directory in which to store the private key. |

A sample configuration:

```hcl
    KeyManager "disk" {
        plugin_data = {
            keys_path = "/opt/spire/data/server/keys.json"
        }
    }
```

repository: spiffe/spire

branch_name: refs/heads/main

extension: md

gha_language: Go

license_type: permissive

repo_name: spiffe/spire


text:
# Titanic Overview

## Author

* **Maik Müller** *Applied Computer Science (M. Sc.)* - [LinkedIn](https://www.linkedin.com/in/maik-m-253357107), [Xing](https://www.xing.com/profile/Maik_Mueller215/cv)

#### Background

I finished my studies in Applied Computer Science (B.Sc and M.Sc.) at the HTW University of Applied Science Berlin in January 2020. During my studies, I worked on several projects that contained app prototypes in the areas of public health and professional environments. All apps were written in Swift (I started with Swift 2.2 in 2016). The present project, Titanic, is based on a simple app exercise during the swift course: B53.1 Current Applications in Computing: Swift Programming for iOS¹.

¹Course was renamed to ["B53.1 Current Applications in Computing: iOS Programming with Swift, UIKit and SwiftUI"](https://lsf.htw-berlin.de/qisserver/rds?state=verpublish&status=init&vmfile=no&publishid=164482&moduleCall=webInfo&publishConfFile=webInfo&publishSubDir=veranstaltung&expand=0&noDBAction=y&init=y)

## Table of Contents

* [1. About the App](#1-about-the-app)
  * [1.1. Goals](#11-goals)
  * [1.2. What's the Game About?](#12-whats-the-game-about)
  * [1.3. Game Features](#13-game-features)
  * [1.4. Technical Infos](#14-technical-infos)
* [2. Concept and Implementation](#2-concept-and-implementation)
  * [2.1. MVP Design Pattern](#21-mvp-design-pattern)
  * [2.2. Avoid Massive View Controller](#22-avoid-massive-view-controller)
  * [2.3. Layout](#23-layout)
    * [2.3.1. Adapting Layout](#231-adapting-layout)
    * [2.3.2. Animation](#232-animation)
    * [2.3.3. SwiftUI](#233-swiftui)
* [3. Persistence](#3-persistence)
* [4. Testing](#4-testing)

## 1. About the App

### 1.1. Goals

The main goal of the project was to gain knowledge about Swift and iOS development. In order to learn more while practicing and improve my skills, I've tested different technologies e.g. several package managers. So, I used Cocoa Pods, Homebrew, and Swift Package Manager to implement third-party libraries.

There were three subgoals:

* Implementing the MVP pattern ([chapter 2.1](#21-mvp-design-pattern))
* Readable code and clear project structure
* Adapting layout for different screen and text sizes ([chapter 2.3.1](#231-adapting-layout))

### 1.2. What's the Game About?

Users move a boat horizontally by their thumb to avoid collisions with icebergs, which are moving vertically from top to bottom. Any collision will increase the crash count, and slow down the boat. The game is over when the user reaches 5 crashes or the time is up. After the end of the game, the driven sea miles will be checked. If they are in the top ten, a highscore entry is provided. The game state can be controlled with the action button in the upper right corner. Image 1 shows a game scene.

Image 1: Game Scene; Source: Own Illustration

### 1.3. Game Features

The following game features haven been implemented:

* Countdown timer
* Score counter
* Game control options
* Vertically movable ship
* Horizontally moving icebergs
* Highscore list
* Store and continue a game

### 1.4. Technical Infos

The following list contains the most important technical informations about the app:

* Development Environment: Xcode
* Interface: Storyboard
* Life Cycle: UIKit App Delegate
* Language: Swift
* Deployment Info: iOS 14.0, iPhone
* 3pp Libraries/Projects: [SRCountdownTimer](https://github.com/rsrbk/SRCountdownTimer), [SwiftLint](https://github.com/realm/SwiftLint), [SnapshotTesting](https://github.com/pointfreeco/swift-snapshot-testing), [SwipeCell](https://github.com/EnesKaraosman/SwipeCell)
* Dependency Manager: [CocoaPods²](https://cocoapods.org), [Homebrew](https://brew.sh), [SwiftPackageManager](https://swift.org/package-manager/)

²CocoaPods was used to implement SRCountdownTimer from Github during the first phase of development. Later it was replaced with a customized class of SRCountdownTimer.

---

## 2. Concept and Implementation

### 2.1. MVP Design Pattern

MVP stands for Model-View-Presenter. Graphic 1 shows the theoretical concept of MVP. In comparison to the common MVC (Model-View-Controller) pattern, MVP offers an additional entity, the presenter. Furthermore, view and view controller form together the view entity. There are two different versions of MVP: Supervising Controller and Passive View. In Titanic, the Passive View was implemented, so all data synchronization between view and model is organized by the presenter. The view should only implement view logic. There is no direct data binding between view and model or view and presenter. The view sends intents via public API to the presenter, it calls the public API of the model and communicates back to the view via delegate methods. The presenter is like a portal for the view to see and get relevant view-formatted model data to update their UI. It’s to be mentioned that only the game scene uses the MVP pattern. All other Scenes use MVC.
A big benefit of MVP is to avoid a massive view controller (chapter 2.2) and create a reusable view.

**Code Links:**
  * [GameModel](Titanic/Models/Game/TitanicGame.swift)
  * [GameView](Titanic/CustomViews/Game/TitanicGameView.swift)
  * [GameViewController](Titanic/Scenes/Game/TitanicGameViewController.swift)
  * [GameViewPresenter](Titanic/Presenter/GameView/TitanicGameViewPresenter.swift)

Graphic 1: MVP Design Pattern; Source: Own Illustration

### 2.2. Avoid Massive View Controller

In MVC the view controller implements UI logic and communicates to the model. Depending on the complexity, it can end up in many functions and properties. This makes the view controller less readable, reusable, and gains complexity. In MVC the view is "general" and the view controller is "special". In MVP both (view and view controller) are "general" and seen as one part. The presenter is "special" and communicates to the model. So, you can get rid of all model related code in the view controller. In order to reduce complexity further, a few more steps were done:

* Game view is used as the main view and implements the adding and handling of subviews and their layout
* Game view adds observers to each iceberg that sends notifications when an iceberg and ship intersect or if an iceberg reaches the vertical end of the screen
* Lightweight view presenters are used to navigating to other view controllers or presenting alerts including the call back handling
* Child view controllers are used to encapsulate reusable UI logic, which handles UI improvements for the user, e.g. the animated preparation view

Graphic 2 shows the theoretical concept of implementations in Titanic to avoid a massive game view controller.

**Code Links:**
  * Child view controller: [GameEnd](Titanic/Scenes/Game/GameEndViewController.swift), [GamePreparation](Titanic/Scenes/Game/PreparationCountdownViewController.swift)
  * Lightweight presenter e.g.: [GameViewNavi](Titanic/Presenter/GameView/TitanicGameViewNaviPresenter.swift), [HighscoreListNavi](Titanic/Presenter/HighscoreList/HighscoreListNaviPresenter.swift), [NewHighscoreEntry](Titanic/Presenter/Alert/NewHighscoreEntryPresenter.swift)

Graphic 2: Avoid Massive Game View Controller; Source: Own Illustration

### 2.3. Layout

#### 2.3.1. Adapting Layout

Different technologies were used to create layouts in Titanic: game view and game view controller programmatically and all others in a storyboard via interface builder. Autolayout was mostly used. The layout of the game view was challenging. On one hand, the score and countdown label should be related to the text size chosen in iPhone settings. On the other hand icebergs and ship sizes should be related to the screen size. According to the game logic, it doesn’t make sense to have a relation between text and the size of the objects.

That means that always three icebergs fit side by side on a screen. If the screen width grows, icebergs and ship will grow as well. In order to achieve the described behaviors, the following three points were made:

* Autolayout and geometry were mixed
* Constraints and object coordinates were defined programmatically in game view
* Iceberg image was created by myself, ship image was created and designed by myself

A second challenge was the SRCountdownTimer, which was imported from Github. Originally the circle and the time label were created without any constraints or any consideration of implementing the content size category. The result was, that the font size didn’t change when the text size was changed by the user. This was resolved by implementing constraints and setting the „adjustsFontForContentSize Category" property of the time label to true. Additionally, dark mode was implemented to improve the UI. Image 2 illustrates the implementation of dark mode and the content size category of the font. An extra layout feature is the localization of texts. Titanic supports English as the default language and German as an additional language.

**Code Links:**
  * Custom views e.g.: [Image](Titanic/CustomViews/Game/ImageView.swift), [GameState](Titanic/CustomViews/Game/GameStateView.swift), [ScoreStack](Titanic/CustomViews/Game/ScoreStackView.swift)

Image 2: Dark Mode, and Font Size Related to Content Size Category; Source: Own Illustration

#### 2.3.2. Animation

The goal of animations is to improve the user experience. So, two scenes were chosen to implement animations: welcome and game scene. After starting the app, the welcome view controller shows up and animates an iceberg in the middle of the view. At first, the iceberg is scaled to the left and right edge of the view. Afterwards, the iceberg scales down and becomes transparent. The animation is called when the view did load or the iOS environment changes e.g. the font size. The following GIF shows the animated iceberg after starting the app.

**Code Links:**
  * [WelcomeViewController](Titanic/Scenes/Welcome/WelcomeViewController.swift) -> see line 180 for iceberg animation

GIF 1: Animated Iceberg in Welcome Scene; Source: Own Illustration

When the user taps on the start button, the game view controller gets called.
There are two other animations before the game is starting. At first, a preparation view with a countdown for the user comes up in order to get ready for the game. The change of the alpha value of the view is animated. Additionally, during the preparation countdown, the slider moves from one side to the other to find a random position. The following GIF illustrates the animation at the beginning of each game.

GIF 2: Animated Preparation; Source: Own Illustration

#### 2.3.3. SwiftUI

In Titanic SwiftUI is implemented within the UIKit life cycle. Firstly, it was used to work together with Core Data.
That means to show a list of stored games and handle the cell behaviour. SwipeCell, a project from Github, was customized to handle the deletion behaviour of a cell.
GIF 3 illustrates the list of stored games and the deletion of a single game. Additionally, an edit mode was implemented in order to delete multiple games together.

**Code Links:**
  * [GameChooser](Titanic/SwiftUI/GameChooserView.swift),  [GameList](Titanic/SwiftUI/GameListView.swift), [GameListEntry](Titanic/SwiftUI/GameListEntryView.swift)
  * [SlidableSlot](Titanic/SwiftUI/SlidableSlot.swift)

GIF 3: Animated Iceberg in Welcome Scene; Source: Own Illustration

Secondly, SwiftUI was used to create the layout of the "How to Play?" overview,
which is showing up after the app was launched. It is a scrollable list with 3 sections: question, button descriptions and rules. The view can be hidden for future app launches.
However, the game rules can be found under "App Information", too.
GIF 4 shows the "How to Play?" overview.

**Code Links:**
  * [HowToPlay](Titanic/SwiftUI/HowToPlayView.swift)

GIF 4: "How to Play?" Overview; Source: Own Illustration

## 3. Persistence

3 different technologies were used to persist data:

* UserDefaults: storing of key value pairs
* FileManager: convenient interface to the file system
* Core Data: a framework, that manages an object oriented database

The UserDefaults store the information if after the start of the app a "How to Play?" overview will be shown or not. Furthermore, the previous chosen boat speed is stored, too.

Titanic uses the FileManager to save a JSON formatted file in the application support directory. The file contains the top ten players with names and ordered by their driven sea miles.

Core Data was implemented in order to store and continue a game. It's possible to show a list of all stored games. The user can pick and continue or delete a game.

**Code Links:**
  * FileManager: [PlayerHandling](Titanic/Handler/PlayerHandling.swift)
  * CoreData:  [GameHandling](Titanic/Handler/GameHandling.swift), [GameObject](Titanic/Models/CoreData/GameObject.swift)

## 4. Testing

The testing part doesn’t focus on every unit and every feature. Rather the purpose was to implement different types of test strategies:

* [Unit tests](TitanicTests)
* [UI tests](TitanicUITests)
* [TitanicSnapshotTests](TitanicSnapshotTests)
* Tests with mocked objects: [PlayerHandling](TitanicTests/PlayerHandlingTests.swift),  [GameViewController](TitanicTests/TitanicGameViewControllerTests.swift), [GameViewPresenter](TitanicTests/TitanicMockGameViewPresenterTest.swift)

Additionally to the preinstalled UI and unit test possibilities of Xcode, a third-party library (SnapshotTesting) was installed and used to verify the UI of the game view. Snapshots were very useful while playing around with the programmatical initialization of the game view controller. Of course, unit tests are quicker and don't need as much resources as UI tests, but it was possible to test the responsivity of the UI without the need for manual tests. To test edge cases, manual tests were mainly used.

In order to avoid and detect a retained memory cycle, three general points were important besides taking care when self is captured in a closure or during property initialization:

* Using structs before classes
* Print statements when a class is deinitialized
* Check for memory leaks with Xcode Instruments

---

#### Main Sources

##### Documentations, Blogs and Tutorial Providers

* [App Coda](https://www.appcoda.com)
* [Apple Developer Documentation](https://developer.apple.com/documentation/technologies)
* [Hacking With Swift](https://www.hackingwithswift.com)
* [Learn App Making](https://learnappmaking.com)
* [Medium](https://medium.com)
* [NSHipster](https://nshipster.com)
* [Ray Wenderlich](https://www.raywenderlich.com)
* [Swift](https://swift.org)
* [Swift Book](https://docs.swift.org/swift-book/index.html)
* [Swift by Sundell](https://www.swiftbysundell.com)
* [Swift Lee](https://www.avanderlee.com)
* [Swift Standard Library](https://developer.apple.com/documentation/swift/swift_standard_library)

##### Podcasts and Videos

* [Stanford, CS193p, Developing Applications for iOS using SwiftUI](https://www.youtube.com/playlist?list=PLpGHT1n4-mAtTj9oywMWoBx0dCGd51_yG)
* [Stanford, CS193p, Developing iOS11 Apps with Swift](https://podcasts.apple.com/de/podcast/developing-ios-11-apps-with-swift/id1315130780?l=en)
* [Hallo Swift](https://podcasts.apple.com/de/podcast/hallo-swift/id1225721421?l=en)

license: MIT

repository: maikdrop/Titanic

branch_name: refs/heads/master

repo_name: maikdrop/Titanic


text:
# code_transfer_learning

*Some useful transfer learning and domain adaptation codes*

> It is a waste of time looking for the codes from others. So I **collect** or **reimplement** them here in a way that you can **easily** use. The following are some of the popular transfer learning (domain adaptation) methods in recent years, and I know most of them will be chosen to **compare** with your own method.

> You are welcome to contribute and suggest other methods.

**Codes here are widely used by top conferences and journals:**
- Conferences: [[NeurIPS'21](https://proceedings.neurips.cc/paper/2021/file/731b03008e834f92a03085ef47061c4a-Paper.pdf)] [[IJCAI'21](https://arxiv.org/abs/2103.03097)] [[ESEC/FSE'20](https://dl.acm.org/doi/abs/10.1145/3368089.3409696)] [[IJCNN'20](https://ieeexplore.ieee.org/abstract/document/9207556)] [[ACMMM'18](https://dl.acm.org/doi/abs/10.1145/3240508.3240512)] [[ICME'19](https://ieeexplore.ieee.org/abstract/document/8784776/)]
- Journals: [[ACM TIST](https://dl.acm.org/doi/abs/10.1145/3360309)] [[Information sciences](https://www.sciencedirect.com/science/article/pii/S0020025520308458)] [[Neurocomputing](https://www.sciencedirect.com/science/article/pii/S0925231221007025)] [[IEEE Transactions on Cognitive and Developmental Systems](https://ieeexplore.ieee.org/abstract/document/9659817)]
- If you find the codes are useful, please cite it in your research.

This document contains codes from several aspects: **tutorial**, **theory**, **traditional** methods, and **deep** methods.

Testing **dataset** can be found [here](https://github.com/jindongwang/transferlearning/blob/master/data/dataset.md).

- - -

- [code_transfer_learning](#code_transfer_learning)
	- [Notebooks](#notebooks)
	- [Fine-tune](#fine-tune)
	- [Deep feature extractor 提取深度网络特征用于传统方法](#deep-feature-extractor-提取深度网络特征用于传统方法)
	- [Basic distance 常用的距离度量](#basic-distance-常用的距离度量)
	- [Semi-supervised learning](#semi-supervised-learning)
	- [Personalized federated learning](#personalized-federated-learning)
	- [Useful tools 常用工具](#useful-tools-常用工具)
	- [Domain generalization 领域泛化](#domain-generalization-领域泛化)
	- [Traditional transfer learning methods  非深度迁移](#traditional-transfer-learning-methods--非深度迁移)
	- [Deep transfer learning methods  深度迁移](#deep-transfer-learning-methods--深度迁移)
	- [Applications](#applications)
			- [References](#references)

## Notebooks

**There's even no need to install a library or package, which will make things worse.** I've already put everything you need into a jupyter notebook, which you can access in Google's colab or just see it in this repo [here](https://github.com/jindongwang/transferlearning/tree/master/notebooks/deep_transfer_tutorial.ipynb).
To run it instantly without any configuration, I also put it to Google's Colab: [Colab](https://colab.research.google.com/drive/1MVuk95mMg4ecGyUAIG94vedF81HtWQAr?usp=sharing)

## Fine-tune

- Fine-tune using **AlexNet** and **ResNet**
	- [PyTorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/finetune_AlexNet_ResNet)

- Safe finetune 安全迁移学习
  - [PyTorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/ReMoS)

- CLIP for zero-shot transfer 使用OpenAI的CLIP模型进行zero-shot迁移
  - [PyTorch](https://github.com/jindongwang/transferlearning/tree/master/code/clip)

## Deep feature extractor 提取深度网络特征用于传统方法

- [Deep feature extractor](https://github.com/jindongwang/transferlearning/blob/master/code/feature_extractor/readme.md)
- [Extract features using CLIP](https://github.com/jindongwang/transferlearning/tree/master/code/clip)

## Basic distance 常用的距离度量

- MMD and MK-MMD：[Python](https://github.com/jindongwang/transferlearning/blob/master/code/distance/mmd_numpy_sklearn.py) | [Pytorch](https://github.com/jindongwang/transferlearning/blob/master/code/distance/mmd_pytorch.py) | [Matlab](https://github.com/jindongwang/transferlearning/blob/master/code/distance/mmd_matlab.m)
- $A$-distance: [Python](https://github.com/jindongwang/transferlearning/tree/master/code/distance/proxy_a_distance.py)
- CORAL loss: [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/distance/coral_loss.py)
- Several metric learning algorithms: [Python](https://github.com/metric-learn/metric-learn)
- Wasserstein distance (earch mover's distance):
	- Scipy built-in function: [scipy.stats.wasserstein_distance](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wasserstein_distance.html)
	- OpenCV built-in function: `cv.CalcEMD2`
	- Google's implementation: [Tensorflow](https://github.com/google/wasserstein-dist)

## Semi-supervised learning

- [[USB: A unified semi-supervised learning library (TorchSSL's update)](https://github.com/microsoft/Semi-supervised-learning)]
- [[TorchSSL: a unified library for semi-supervised learning](https://github.com/TorchSSL/TorchSSL)]

## Personalized federated learning

[[PersonalizedFL: a unified library for personalized federated learning](https://github.com/microsoft/PersonalizedFL)]

## Useful tools 常用工具

- Feature visualization using t-SNE (用t-SNE进行特征可视化)：[Python](https://github.com/jindongwang/transferlearning/tree/master/code/utils/feature_vis.py)
- **Gradient Reversal Layer (梯度反转层，GRL)**：[Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/utils/grl.py)
  - Support all Pytorch versions! (We know that `autograd` has been changed since 1.0)

## Domain generalization 领域泛化

- **DeepDG** (Deep domain generalization toolkit) [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/DeepDG)
  - Including: ERM, MMD, DANN, CORAL, Mixup, RSC, GroupDRO, etc.

- **DIFEX** (Domain-Invariant Feature EXploration, TMLR-22) [88] [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/DeepDG)

## Traditional transfer learning methods  非深度迁移

- **SVM** (baseline) [Matlab](https://github.com/jindongwang/transferlearning/tree/master/code/traditional/SVM.m)
- **TCA** (Transfer Component Anaysis, TNN-11) [1] [Matlab and Python](https://github.com/jindongwang/transferlearning/tree/master/code/traditional/TCA)
- **KMM** (Kernel Mean Matching, NIPS-06) [67] [Python](https://github.com/jindongwang/transferlearning/tree/master/code/traditional/KMM.py)
- **GFK** (Geodesic Flow Kernel, CVPR-12) [2] [Matlab and Python](https://github.com/jindongwang/transferlearning/blob/master/code/traditional/GFK)
- **DA-NBNN** (Frustratingly Easy NBNN Domain Adaptation, ICCV-13) [39] [Matlab](https://github.com/enoonIT/nbnn-nbnl/tree/master/DANBNN_demo)
- **JDA** (Joint Distribution Adaptation, ICCV-13) [3] [Matlab and Python](https://github.com/jindongwang/transferlearning/blob/master/code/traditional/JDA)
- **TJM** (Transfer Joint Matching, CVPR-14) [4] [Matlab](https://github.com/jindongwang/transferlearning/blob/master/code/traditional/MyTJM.m)
- **CORAL** (CORrelation ALignment, AAAI-15) [5] [Matlab and Python](https://github.com/jindongwang/transferlearning/blob/master/code/traditional/CORAL) | [Github](https://github.com/VisionLearningGroup/CORAL)
- **JGSA** (Joint Geometrical and Statistical Alignment, CVPR-17) [6] [Matlab(official)](https://www.uow.edu.au/~jz960/codes/JGSA-r.rar) | [Matlab(easy)](https://github.com/jindongwang/transferlearning/blob/master/code/traditional/CORA/MyJGSA.m)
- **TrAdaBoost** (ICML-07)[8] [Python](https://github.com/chenchiwei/tradaboost)
- **SA** (Subspace Alignment, ICCV-13) [11] [Matlab(official)](http://users.cecs.anu.edu.au/~basura/DA_SA/) | [Matlab](https://github.com/jindongwang/transferlearning/tree/master/code/traditional/SA_SVM.m)
- **BDA** (Balanced Distribution Adaptation for Transfer Learning, ICDM-17) [15] [Matlab(official)](https://github.com/jindongwang/transferlearning/tree/master/code/BDA)
- **MTLF** (Metric Transfer Learning, TKDE-17) [16] [Matlab](https://github.com/xyh2016/MTLF)
- **Open Set Domain Adaptation** (ICCV-17) [19] [Matlab(official)](https://github.com/Heliot7/open-set-da)
- **TAISL** (When Unsupervised Domain Adaptation Meets Tensor Representations, ICCV-17) [21] [Matlab(official)](https://github.com/poppinace/TAISL)
- **STL** (Stratified Transfer Learning for Cross-domain Activity Recognition, PerCom-18) [22] [Matlab](https://github.com/jindongwang/activityrecognition/tree/master/code/percom18_stl)
- **LSA** (Landmarks-based kernelized subspace alignment for unsupervised domain adaptation, CVPR-15) [29] [Matlab](http://homes.esat.kuleuven.be/~raljundi/papers/LSA%20Clean%20Code.zip)
- **OTL** (Online Transfer Learning, ICML-10) [31] [Matlab(official)](http://stevenhoi.org/otl)
- **RWA** (Random Walking, arXiv, simple but powerful) [46] [Matlab](https://github.com/twanvl/rwa-da/tree/master/src)
- **MEDA** (Manifold Embedded Distribution Alignment, ACM MM-18) [47] [Matlab(Official)](https://github.com/jindongwang/transferlearning/tree/master/code/traditional/MEDA)
- **DeepMEDA (DDAN)** (Deep version of MEDA, or DDAN) [82] [Pytorch(official)](https://github.com/jindongwang/transferlearning/tree/master/code/deep/DeepMEDA)
- **EasyTL** (Practically Easy Transfer Learning, ICME-19) [63] [Matlab(Official)](https://github.com/jindongwang/transferlearning/tree/master/code/traditional/EasyTL) | [Python](https://github.com/jindongwang/transferlearning/tree/master/code/traditional/pyEasyTL)
- **SCA** (Scatter Component Analysis, TPAMI-17) [79] [Matlab](https://github.com/amber0309/SCA)
- **SOT** (Substructural Optimal Transport, arxiv-21) [84] [python](https://github.com/jindongwang/transferlearning/tree/master/code/traditional/sot)

## Deep transfer learning methods  深度迁移

- **DaNN** (Domain Adaptive Neural Network, PRICAI-14) [41] [PyTorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/DaNN)
- **DDC** (Deep Domain Confusion, arXiv-14) [PyTorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/DDC_DeepCoral)
- **DeepCORAL** (Deep CORAL: Correlation Alignment for Deep Domain Adaptation) [33] [PyTorch(recommend)](https://github.com/jindongwang/transferlearning/tree/master/code/deep/DeepCoral) | [PyTorch](https://github.com/SSARCandy/DeepCORAL) | [中文解读](https://ssarcandy.tw/2017/10/31/deep-coral/)
- **DAN/JAN** (Deep Adaptation Network/Joint Adaptation Network, ICML-15,17) [9,10] [PyTorch(Official)](https://github.com/thuml/Xlearn/tree/master/pytorch) | [Caffe(Official)](https://github.com/thuml/Xlearn) | [PyTorch(DAN)(recommend)](https://github.com/jindongwang/transferlearning/tree/master/code/deep/DAN)
- **B-JMMD** (Balanced Joint Maximum Mean Discrepancy for Deep Transfer Learning, AA-20) [Caffe(Official)](https://github.com/mengchuangji/balanced-joint-maximum-mean-discrepancy)
- **RTN** (Unsupervised Domain Adaptation with Residual Transfer Networks, NIPS-16) [12] [Caffe](https://github.com/thuml/Xlearn)
- **ADDA** (Adversarial Discriminative Domain Adaptation, arXiv-17) [13] [Tensorflow(Official)](https://github.com/erictzeng/adda) | [Pytorch](https://github.com/corenel/pytorch-adda) | [Pytorch(another)](https://github.com/jvanvugt/pytorch-domain-adaptation/blob/master/adda.py)
- **DANN/RevGrad** (Unsupervised Domain Adaptation by Backpropagation, ICML-15) [14] [Caffe(Official)](https://github.com/ddtm/caffe/tree/grl) | [PyTorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/DANN(RevGrad)) | [Pytorch(another)](https://github.com/jvanvugt/pytorch-domain-adaptation/blob/master/revgrad.py) | [Tensorflow(third party)](https://github.com/shucunt/domain_adaptation)
- **DANN** Domain-Adversarial Training of Neural Networks (JMLR-16)[17]  [Python(official)](https://github.com/GRAAL-Research/domain_adversarial_neural_network) | [Tensorflow](https://github.com/jindongwang/tf-dann) | [PyTorch](https://github.com/CuthbertCai/pytorch_DANN)
- Associative Domain Adaptation (ICCV-17) [18] [Tensorflow](https://github.com/haeusser/learning_by_association)
- Deep Hashing Network for Unsupervised Domain (CVPR-17) [20] [Matlab](https://github.com/hemanthdv/da-hash)
- **CCSA** (Unified Deep Supervised Domain Adaptation and Generalization, ICCV-17) [23] [Python(Keras)](https://github.com/samotiian/CCSA)
- **MRN** (Learning Multiple Tasks with Multilinear Relationship Networks, NIPS-17) [24] [Pytorch](https://github.com/thuml/MTlearn)
- **AutoDIAL** (Automatic DomaIn Alignment Layers, ICCV-17) [25] [Caffe](https://github.com/ducksoup/autodial)
- **DSN** (Domain Separation Networks, NIPS-16) [26] [Pytorch](https://github.com/fungtion/DSN) | [Tensorflow](https://github.com/tensorflow/models/tree/master/research/domain_adaptation)
- **DRCN** (Deep Reconstruction-Classification Networks for Unsupervised Domain Adaptation, ECCV-16) [27] [Keras](https://github.com/ghif/drcn) | [Pytorch](https://github.com/fungtion/DRCN)
- Multi-task Autoencoders for Domain Generalization (ICCV-15) [28] [Keras](https://github.com/ghif/mtae)
- Encoder based lifelong learning (ICCV-17) [30] [Matlab](https://github.com/rahafaljundi/Encoder-Based-Lifelong-learning)
- **MECA** (Minimal-Entropy Correlation Alignment, ICLR-18) [32] [Python](https://github.com/pmorerio/minimal-entropy-correlation-alignment)
- **WAE** (Wasserstein Auto-Encoders, ICLR-18) [34] [Python(Tensorflow)](https://github.com/tolstikhin/wae)
- **ATDA** (Asymmetric Tri-training for Unsupervised Domain Adaptation, ICML-15) [35] [Pytorch](https://github.com/corenel/pytorch-atda#pytorch-atda)
- **PixelDA_GAN** (Unsupervised pixel-level domain adaptation with GAN, CVPR-17) [36] [Pytorch](https://github.com/vaibhavnaagar/pixelDA_GAN)
- **ARDA** (Adversarial Representation Learning for Domain Adaptation) [37] [Pytorch](https://github.com/corenel/pytorch-arda)
- **DiscoGAN** (Learning to Discover Cross-Domain Relations with Generative Adversarial Networks) [38] [Pytorch](https://github.com/carpedm20/DiscoGAN-pytorch)
- **MCD** (Maximum Classifier Discrepancy, CVPR-18) [42] [Pytorch(official)](https://github.com/mil-tokyo/MCD_DA)
- Adversarial Feature Augmentation for Unsupervised Domain Adaptation (CVPR-18) [43] [Tensorflow](https://github.com/ricvolpi/adversarial-feature-augmentation)
- **DML** (Deep Mutual Learning, CVPR-18) [44] [Tensorflow](https://github.com/YingZhangDUT/Deep-Mutual-Learning)
- Self-ensembling for visual domain adaptation (ICLR 2018) [45] [Pytorch](https://github.com/Britefury/self-ensemble-visual-domain-adapt)
- **iCAN** (Incremental Collaborative and Adversarial Network for Unsupervised Domain Adaptation, CVPR-18) [49] [Pytorch](https://github.com/mahfuj9346449/iCAN)
- **WeightedGAN** (Importance Weighted Adversarial Nets for Partial Domain Adaptation, CVPR-18) [50] [Caffe](https://github.com/hellojing89/weightedGANpartialDA)
- **OpenSet** (Open Set Domain Adaptation by Backpropagation) [51] [Tensorflow](https://github.com/Mid-Push/Open_set_domain_adaptation)
- **WDGRL** (Wasserstein Distance Guided Representation Learning, AAAI-18) [52] [Pytorch](https://github.com/jvanvugt/pytorch-domain-adaptation/blob/master/wdgrl.py)
- **JDDA** (Joint Domain Alignment and Discriminative Feature Learning) [53] [Tensorflow](https://github.com/A-bone1/JDDA)
- Multi-modal Cycle-consistent Generalized Zero-Shot Learning (ECCV-18) [54] [Tensorflow](https://github.com/rfelixmg/frwgan-eccv18)
- **MSTN** (Moving Semantic Transfer Network, ICML-18) [55] [Tensorflow](https://github.com/Mid-Push/Moving-Semantic-Transfer-Network) | [Pytorch](https://github.com/EasonApolo/mstn)
- **SAN** (Partial Transfer Learning With Selective Adversarial Networks, CVPR-18) [56] [Caffe, Pytorch](https://github.com/thuml/SAN)
- **M-ADDA** (Metric-based Adversarial Discriminative Domain Adaptation, ICML-18 workshop) [57] [Pytorch](https://github.com/IssamLaradji/M-ADDA)
- **Openset_DA** (Open Set Domain Adaptation by Backpropagation) [58] [Pytorch](https://github.com/YU1ut/openset-DA)
- **DIRT-T** (A DIRT-T Approach to Unsupervised Domain Adaptation, ICLR-18) [59] [Tensorflow](https://github.com/RuiShu/dirt-t)
- **CMD** (Central Moment Discrepancy, ICLR-17 and InfSc-19) [61], [62] [Keras(Theano)](https://github.com/wzell/cmd) | [Keras(Theano, journal extension)](https://github.com/wzell/mann)
- **OPDA_BP** (Open Set Domain Adaptation by Back-propagation, ECCV-18) [64] [Pytorch(Official)](https://github.com/ksaito-ut/OPDA_BP)
- **TCP** (Transfer Channel Prunning, IJCNN-19) [65] [Pytorch(Official)](https://github.com/jindongwang/transferlearning/tree/master/code/deep/TCP)
- **MTAN** (Multi-Task Attention Network, CVPR-19) [66] [Python](https://github.com/lorenmt/mtan)
- **L2T_ww** (Learning What and Where to Transfer, ICML-19) [68] [Pytorch](https://github.com/alinlab/L2T-ww)
- **SSDA_MME** (Semi-supervised Domain Adaptation via Minimax Entropy, ICCV-19) [71] [Pytorch](https://github.com/VisionLearningGroup/SSDA_MME)
- **MRAN** (Multi-representation adaptation network for cross-domain image classification, Neural Networks 2019) [72] [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/MRAN)
- **TA3N** (Temporal Attentive Alignment for Large-Scale Video Domain Adaptation, ICCV-19) [73] [Pytorch](https://github.com/cmhungsteve/TA3N)
- **MDAN** (Multiple Source Domain Adaptation with Adversarial Learning, NeurIPS-18) [74] [Pytorch](https://github.com/KeiraZhao/MDAN)
- Deep model transferribility from attribution maps (NeurIPS-19) [75] [Tensorflow](https://github.com/DeepDarkFantasy20/TransferbilityFromAttributionMaps)
- **DIVA** (Domain Invariant Variational Autoencoders, arXiv-19) [76] [Pytorch](https://github.com/AMLab-Amsterdam/DIVA)
- **CDCL** (Cross-Domain Complementary Learning with Synthetic Data for Multi-Person Part Segmentation, arXiv, ICCV-19 Demo) [77] [Tensorflow](https://github.com/kevinlin311tw/CDCL-human-part-segmentation)
- **DTA** (Drop to Adapt: Learning Discriminative Features for Unsupervised Domain Adaptation, arXiv, ICCV-19) [78] [PyTorch](https://github.com/postBG/DTA.pytorch)
- **DAAN** (Dynamic Adversarial Adaptation Network, ICDM 2019) [80] [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/DAAN)
- **DAEL** (Domain Adaptive Ensemble Learning, ArXiv 2020) [81] [Pytorch](https://github.com/KaiyangZhou/Dassl.pytorch)
- **DSAN** (Deep Subdomain Adaptation Network for Image Classification, DSAN 2020) [82] [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/DSAN)
- **CSG** (Learning Causal Semantic Representation for Out-of-Distribution Prediction) [87] [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/deep/CSG)

## Applications

- **PTUPCDR** Personalized Transfer of User Preferences for Cross-domain Recommendation (WSDM-22) [86] [Pytorch](https://github.com/easezyc/WSDM2022-PTUPCDR)
- Learning to select data for transfer learning with Bayesian Optimization (EMNLP-17) [69] [Python](https://github.com/sebastianruder/learn-to-select-data)
- **SDG4DA** (Reinforced Training Data Selection for Domain Adaptation, ACL-19) [70] [Tensorflow](https://github.com/timerstime/SDG4DA)
- **CMatch** (Cross-domain Speech Recognition with Unsupervised Character-level Distribution Matching, arXiv-21) [83] [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/ASR/CMatch)
- **Adapter** for speech recognition (Adapter-based Cross-lingual ASR with EasyEspnet) [Pytorch](https://github.com/jindongwang/transferlearning/tree/master/code/ASR/Adapter) [85]

- - -

#### References

[1] Pan S J, Tsang I W, Kwok J T, et al. Domain adaptation via transfer component analysis[J]TNN, 2011, 22(2): 199-210.

[2] Gong B, Shi Y, Sha F, et al. Geodesic flow kernel for unsupervised domain adaptation[C]//CVPR, 2012: 2066-2073.

[3] Long M, Wang J, Ding G, et al. Transfer feature learning with joint distribution adaptation[C]//ICCV. 2013: 2200-2207.

[4] Long M, Wang J, Ding G, et al. Transfer joint matching for unsupervised domain adaptation[C]//CVPR. 2014: 1410-1417.

[5] Sun B, Feng J, Saenko K. Return of Frustratingly Easy Domain Adaptation[C]//AAAI. 2016, 6(7): 8.

[6] Zhang J, Li W, Ogunbona P. Joint Geometrical and Statistical Alignment for Visual Domain Adaptation[C]//CVPR 2017.

[8] Dai W, Yang Q, Xue G R, et al. Boosting for transfer learning[C]//ICML, 2007: 193-200.

[9] Long M, Cao Y, Wang J, et al. Learning transferable features with deep adaptation networks[C]//ICML. 2015: 97-105.

[10] Long M, Wang J, Jordan M I. Deep transfer learning with joint adaptation networks[J]//ICML 2017.

[11] Fernando B, Habrard A, Sebban M, et al. Unsupervised visual domain adaptation using subspace alignment[C]//ICCV. 2013: 2960-2967.

[12] Long M, Zhu H, Wang J, et al. Unsupervised domain adaptation with residual transfer networks[C]//NIPS. 2016.

[13] Tzeng E, Hoffman J, Saenko K, et al. Adversarial discriminative domain adaptation[J]. arXiv preprint arXiv:1702.05464, 2017.

[14] Ganin Y, Lempitsky V. Unsupervised domain adaptation by backpropagation[C]//International Conference on Machine Learning. 2015: 1180-1189.

[15] Jindong Wang, Yiqiang Chen, Shuji Hao, Wenjie Feng, and Zhiqi Shen. Balanced Distribution Adaptation for Transfer Learning. ICDM 2017.

[16] Y. Xu et al., "A Unified Framework for Metric Transfer Learning," in IEEE Transactions on Knowledge and Data Engineering, vol. 29, no. 6, pp. 1158-1171, June 1 2017. doi: 10.1109/TKDE.2017.2669193

[17] Ganin Y, Ustinova E, Ajakan H, et al. Domain-adversarial training of neural networks[J]. Journal of Machine Learning Research, 2016, 17(59): 1-35.

[18] Haeusser P, Frerix T, Mordvintsev A, et al. Associative Domain Adaptation[C]. ICCV, 2017.

[19] Pau Panareda Busto, Juergen Gall. Open set domain adaptation. ICCV 2017.

[20] Venkateswara H, Eusebio J, Chakraborty S, et al. Deep hashing network for unsupervised domain adaptation[C]. CVPR 2017.

[21] H. Lu, L. Zhang, et al. When Unsupervised Domain Adaptation Meets Tensor Representations. ICCV 2017.

[22] J. Wang, Y. Chen, L. Hu, X. Peng, and P. Yu. Stratified Transfer Learning for Cross-domain Activity Recognition. 2018 IEEE International Conference on Pervasive Computing and Communications (PerCom).

[23] Motiian S, Piccirilli M, Adjeroh D A, et al. Unified deep supervised domain adaptation and generalization[C]//The IEEE International Conference on Computer Vision (ICCV). 2017, 2.

[24] Long M, Cao Z, Wang J, et al. Learning Multiple Tasks with Multilinear Relationship Networks[C]//Advances in Neural Information Processing Systems. 2017: 1593-1602.

[25] Maria Carlucci F, Porzi L, Caputo B, et al. AutoDIAL: Automatic DomaIn Alignment Layers[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2017: 5067-5075.

[26] Bousmalis K, Trigeorgis G, Silberman N, et al. Domain separation networks[C]//Advances in Neural Information Processing Systems. 2016: 343-351.

[27] M. Ghifary, W. B. Kleijn, M. Zhang, D. Balduzzi, and W. Li. "Deep Reconstruction-Classification Networks for Unsupervised Domain Adaptation (DRCN)", European Conference on Computer Vision (ECCV), 2016

[28] M. Ghifary, W. B. Kleijn, M. Zhang, D. Balduzzi.
Domain Generalization for Object Recognition with Multi-task Autoencoders,
accepted in International Conference on Computer Vision (ICCV 2015), Santiago, Chile.

[29] Aljundi R, Emonet R, Muselet D, et al. Landmarks-based kernelized subspace alignment for unsupervised domain adaptation[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2015: 56-63.

[30] Rannen A, Aljundi R, Blaschko M B, et al. Encoder based lifelong learning[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2017: 1320-1328.

[31] Peilin Zhao and Steven C.H. Hoi. OTL: A Framework of Online Transfer Learning. ICML 2010.

[32] Pietro Morerio, Jacopo Cavazza, Vittorio Murino. Minimal-Entropy Correlation Alignment for Unsupervised Deep Domain Adaptation. ICLR 2018.

[33] Sun B, Saenko K. Deep coral: Correlation alignment for deep domain adaptation[C]//European Conference on Computer Vision. Springer, Cham, 2016: 443-450.

[34] Tolstikhin I, Bousquet O, Gelly S, et al. Wasserstein Auto-Encoders[J]. arXiv preprint arXiv:1711.01558, 2017.

[35] Saito K, Ushiku Y, Harada T. Asymmetric tri-training for unsupervised domain adaptation[J]. arXiv preprint arXiv:1702.08400, 2017.

[36] Bousmalis K, Silberman N, Dohan D, et al. Unsupervised pixel-level domain adaptation with generative adversarial networks[C]//The IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2017, 1(2): 7.

[37] Shen J, Qu Y, Zhang W, et al. Adversarial representation learning for domain adaptation[J]. arXiv preprint arXiv:1707.01217, 2017.

[38] Kim T, Cha M, Kim H, et al. Learning to discover cross-domain relations with generative adversarial networks[J]. arXiv preprint arXiv:1703.05192, 2017.

[39] Tommasi T, Caputo B. Frustratingly Easy NBNN Domain Adaptation[C]. international conference on computer vision, 2013: 897-904.

[40] Pei Z, Cao Z, Long M, et al. Multi-Adversarial Domain Adaptation[C] // AAAI 2018.

[41] Ghifary M, Kleijn W B, Zhang M. Domain adaptive neural networks for object recognition[C]//Pacific Rim International Conference on Artificial Intelligence. Springer, Cham, 2014: 898-904.

[42] Saito K, Watanabe K, Ushiku Y, et al. Maximum Classifier Discrepancy for Unsupervised Domain Adaptation[J]. arXiv preprint arXiv:1712.02560, 2017.

[43] Volpi R, Morerio P, Savarese S, et al. Adversarial Feature Augmentation for Unsupervised Domain Adaptation[J]. arXiv preprint arXiv:1711.08561, 2017.

[44] Zhang Y, Xiang T, Hospedales T M, et al. Deep Mutual Learning[C]. CVPR 2018.

[45] French G, Mackiewicz M, Fisher M. Self-ensembling for visual domain adaptation[C]//International Conference on Learning Representations. 2018.

[46] van Laarhoven T, Marchiori E. Unsupervised Domain Adaptation with Random Walks on Target Labelings[J]. arXiv preprint arXiv:1706.05335, 2017.

[47] Jindong Wang, Wenjie Feng, Yiqiang Chen, Han Yu, Meiyu Huang, Philip S. Yu. Visual Domain Adaptation with Manifold Embedded Distribution Alignment. ACM Multimedia conference 2018.

[48] Zhangjie Cao, Mingsheng Long, et al. Partial Adversarial Domain Adaptation. ECCV 2018.

[49] Zhang W, Ouyang W, Li W, et al. Collaborative and Adversarial Network for Unsupervised domain adaptation[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2018: 3801-3809.

[50] Zhang J, Ding Z, Li W, et al. Importance Weighted Adversarial Nets for Partial Domain Adaptation[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2018: 8156-8164.

[51] Saito K, Yamamoto S, Ushiku Y, et al. Open Set Domain Adaptation by Backpropagation[J]. arXiv preprint arXiv:1804.10427, 2018.

[52] Shen J, Qu Y, Zhang W, et al. Wasserstein Distance Guided Representation Learning for Domain Adaptation[C]//AAAI. 2018.

[53] Chen C, Chen Z, Jiang B, et al. Joint Domain Alignment and Discriminative Feature Learning for Unsupervised Deep Domain Adaptation[J]. arXiv preprint arXiv:1808.09347, 2018.

[54] Felix R, Vijay Kumar B G, Reid I, et al. Multi-modal Cycle-consistent Generalized Zero-Shot Learning. ECCV 2018.

[55] Xie S, Zheng Z, Chen L, et al. Learning Semantic Representations for Unsupervised Domain Adaptation[C]//International Conference on Machine Learning. 2018: 5419-5428.

[56] Cao Z, Long M, Wang J, et al. Partial transfer learning with selective adversarial networks. CVPR 2018.

[57] Issam Laradji, Reza Babanezhad. M-ADDA: Unsupervised Domain Adaptation with Deep Metric Learning. ICML 2018 workshop.

[58] Saito K, Yamamoto S, Ushiku Y, et al. Open Set Domain Adaptation by Backpropagation[J]. arXiv preprint arXiv:1804.10427, 2018.

[59] Shu R, Bui H H, Narui H, et al. A DIRT-T Approach to Unsupervised Domain Adaptation[J]. arXiv preprint arXiv:1802.08735, 2018.

[60] Mingsheng Long, et al. Conditional Adversarial Domain Adaptation. NeurIPS 2018.

[61] W.Zellinger, T. Grubinger, E. Lughofer, T. Natschlaeger, and Susanne Saminger-Platz, "Central moment discrepancy (cmd) for domain-invariant representation learning," ICLR 2017.

[62] W. Zellinger, B.A. Moser, T. Grubinger, E. Lughofer, T. Natschlaeger, and S. Saminger-Platz, "Robust unsupervised domain adaptation for neural networks via moment alignment," Information Sciences (in press), 2019, https://doi.org/10.1016/j.ins.2019.01.025, arXiv preprint arxiv:1711.06114

[63] Jindong Wang, Yiqiang Chen, Han Yu, Meiyu Huang, Qiang Yang. Easy Transfer Learning By Exploiting Intra-domain Structures. IEEE International Conference on Multimedia & Expo (ICME) 2019.

[64] Saito K, Yamamoto S, Ushiku Y, et al. Open set domain adaptation by backpropagation[C]//Proceedings of the European Conference on Computer Vision (ECCV). 2018: 153-168.

[65] Chaohui Yu, Jindong Wang, Yiqiang Chen, Zijing Wu. Accelerating Deep Unsupervised Domain Adaptation with Transfer Channel Pruning. IJCNN 2019.

[66] Shikun Liu, Edward Johns, and Andrew Davison. End-to-End Multi-Task Learning with Attention. CVPR 2019.

[67] Huang J, Gretton A, Borgwardt K, et al. Correcting sample selection bias by unlabeled data[C]//Advances in neural information processing systems. 2007: 601-608.

[68] Yunhun Jang, Hankook Lee, Sung Ju Hwang, Jinwoo Shin. Learning what and where to transfer. ICML 2019.

[69] Sebastian Ruder, Barbara Plank (2017). Learning to select data for transfer learning with Bayesian Optimization. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, Copenhagen, Denmark.

[70] Liu M, Song Y, Zou H, et al. Reinforced Training Data Selection for Domain Adaptation[C]//Proceedings of the 57th Conference of the Association for Computational Linguistics. 2019: 1957-1968.

[71] Saito K, Kim D, Sclaroff S, et al. Semi-supervised Domain Adaptation via Minimax Entropy. ICCV 2019.

[72] Zhu Y, Zhuang F, Wang J, et al. Multi-representation adaptation network for cross-domain image classification[J]. Neural Networks, 2019.

[73] Min-Hung Chen, Zsolt Kira, Ghassan AlRegib, et al. Temporal Attentive Alignment for Large-Scale Video Domain Adaptation. ICCV 2019.

[74] Zhao H, Zhang S, Wu G, et al. Multiple source domain adaptation with adversarial learning. NeurIPS 2018.

[75] Jie Song, et al. Deep model transferrability from attirbution maps. NeurIPS 2019.

[76] Ilse, M., Tomczak, J. M., C. Louizos & Welling, M. (2018). DIVA: Domain Invariant Variational Autoencoders. arXiv preprint arXiv:1905.10427

[77] Lin K., et al. Cross-Domain Complementary Learning with Synthetic Data for Multi-Person Part Segmentation[J]. arXiv preprint arXiv:1907.05193, ICCV demo, 2019.

[78] Lee S., Kim D., et al. Drop to Adapt: Learning Discriminative Features for Unsupervised Domain Adaptation. ICCV 2019.

[79] Ghifary M, Balduzzi D, Kleijn W B, et al. Scatter component analysis: A unified framework for domain adaptation and domain generalization[J]. IEEE transactions on pattern analysis and machine intelligence, 2016, 39(7): 1414-1430.

[80] Chaohui Yu, Jindong Wang, Yiqiang Chen, Meihu Huang. Transfer learnign with dynamic adversarial adaptation network. ICDM 2019.

[81] Kaiyang Zhou, Yongxin Yang, Yu Qiao, Tao Xiang. Domain Adaptive Ensemble Learning. ArXiv preprint, 2020.

[82] Wang J, Chen Y, Feng W, et al. Transfer learning with dynamic distribution adaptation[J]. ACM Transactions on Intelligent Systems and Technology (TIST), 2020, 11(1): 1-25.

[83] Wenxin Hou, Jindong Wang, Xu Tan, Tao Qin, Takahiro Shinozaki, "Cross-domain Speech Recognition with Unsupervised Character-level Distribution Matching", arxiv 2104.07491.

[84] Lu W, Chen Y, Wang J, et al. Cross-domain Activity Recognition via Substructural Optimal Transport[J]. arXiv preprint arXiv:2102.03353, 2021.

[85] Hou W, Zhu H, Wang Y, et al. Exploiting Adapters for Cross-lingual Low-resource Speech Recognition[J]. arXiv preprint arXiv:2105.11905, 2021.

[86] Yongchun Zhu, ZhenWei Tang, Yudan Liu, et al. Personalized Transfer of User Preferences for Cross-domain Recommendation[C]. WSDM, 2022.

[87] Chang Liu, Xinwei Sun, Jindong Wang, et al. Learning Causal Semantic Representation for Out-of-Distribution Prediction. NeurIPS 2021.

[88] Lu et al. Domain-invariant feature exploration for domain generalization. TMLR 2022.

repository: jindongwang/transferlearning

gha_language: Python

gha_license_id: MIT

repo_name: jindongwang/transferlearning


text:
![PyPi version](https://img.shields.io/pypi/v/krest.svg)

# krest

The Silk REST (krest) is a client library that provides ORM like interface for working with Silk SDP
REST API.

Krest is written in Python and is aimed to provide rapid enablement of managing
and monitoring SDPs all-flash arrays using Python.

This readme file complements the Silk SDP REST API guide document. You can request
this document from the Silk support team.

# Installation
```
pip install krest
```

# Usage

## login
Below are the examples of using krest. Again, we'll mostly explain how the Python interface
maps to a URL spec which is outlined in SDP REST API guide.

First you need to obtain an endpoint (connection) to your SDP:
```
import krest
basic_auth = krest.KrestBasicAuth("username", "password")
ep = krest.EndPoint("SDP IP address", auth=basic_auth, ssl_validate=False)
```

In case you are using an "app token" from Flex you should connect to your SDP via Flex:
```
import krest
bearer_auth = krest.KrestBearerAuth("your token")
ep = krest.EndPoint('Flex IP address', sdp_id="SDP ID", auth=bearer_auth, ssl_validate=False)
```

If you configured your SDP with real SSL certificates, set `ssl_validate=True` in the above call.

## Creating and changing objects

Once you've obtained an endpoint, you can use it to CREATE/READ/UPDATE/DELETE objects.
```
# create host-group
hg = ep.new("host_groups")
hg.name = "hg1"
hg.save()
```

Parameters can also be passed inline:
```
# save() also returns the updated object
host = ep.new("hosts", name="h1", type="Linux", host_group=hg).save()
```
Note how we can use our `hg` object as host-group reference in newly created volume above.

Changing is simple - just change attributes and hit `.save()`
```
host.type = "Windows"
host.name = "h2"
host.save()
```

## Searching stuff

If you know a specific object id, you can `.get()` it:
```
vol = ep.get("volumes", 1)
```

Otherwise use `.search()` to retrieve multiple objects that match search query.
In the simplest form:
```
rv = ep.search("hosts", name="h2")
```
The returned object is a `ResultSet` object that has a `.hits` array containing `RestObject`s.
The total number of matched objects is recorded in the `ResultSet.total` attribute.

`.search()` method recieves `resource_type`, `options` and query keyword arguments.
Each query argument is treated as a field name and its value and a requested field value.
i.e. in the above example, we search for hosts having `name="h2"`.

You can add search modifiers to field names:
```
rv = ep.search("events", level="INFO", message__contains="h1", name__contains="HOST")
```
For the full list of search modifiers please refer to the SDP REST API guide.

### Notes on field values
1. If a field value is an instance of `RestObject`, it is converted to its reference url and `.ref` is added to the field name.
   This allows native usage of `RestObject` in your code, i.e. `ep.search("hosts", host_group=hg)`
1. If a field value is instance of `ResultSet`, `list` or `tuple`, then list elements are converted to string by comma-joining
   and `__in` is added to the field name. This allows doing things like
   `ep.search("hosts", host_group=[hg1, hg2])`

## Working with `ResultSet`s
`ResultSet`s are returned by the  `.search()` method of `KrestEndPoint`. The number of results returned from the API
is limited to 100. You can check the total number of results matching your search query
by inspecting the `.total` attribute of the result set.

For queries matching a large number of objects, you can use `__limit` and `__offset` query
parameters to fetch results by chunks.

**NOTE:** Its crucial to sort results to retrieve
objects in predictable order (use the `__sort` and `__sort_order` query attributes). All objects have an `id` field, to it is a good candidate to be used as a sorting field.

`ResultSet` is iterable, i.e. `for r in rv:...` is similar to
`for r in rv.hits:...`. It also supports `len(rv)` and *truthy* evaluation.

If you set the `.autofetch` attribute of a `ResultSet` object to 'true' before iterating it,
it will automatically fetch the next chunk of objects when the current chunk is
exhausted. Don't forget to apply the sorting (as in the above note).

## Deleting objects
Once you have a `RestObject` at hand, simply call its `.delete()` method to delete it.

# More examples for object creation and manipulation

**NOTE:** All sizes in our SDP REST API are in kilobytes, with performance data being
the only exception - it returns results in bytes.

Create a volume-group
```
vg = ep.new("volume_groups", name="vg1", quota=100*2**20)
vg.capacity_policy = ep.search("vg_capacity_policies").hits[0]  # search ad-hoc
vg.save()
```

Create a volume in the above volume-group
```
vol = ep.new("volumes", name="v1", size=10*2**20, volume_group=vg).save()
```

Map a volume to a host-group
```
mapping = ep.new("mappings", volume=vol, host=hg)
mapping.save()
```

LUN editing is easy:
```
mapping.lun += 10
mapping.save()
```

Map a volume to a host
```
host2 = ep.new("hosts", name="standalone", type="Linux").save()
mapping = ep.new("mappings", volume=vol, host=host2).save()
```

Create a snapshot
```
snap = ep.new("snapshots")
snap.source = vg
snap.retention_policy = ep.search("retention_policies").hits[0]
snap.short_name = "s1"   # Note - use short_name, and not just name
snap.save()
```

Create a replica from the snapshot and map it
```
rep = ep.new("snapshots")
rep.source = snap
rep.short_name = "r1"
rep.retention_policy = ep.search("retention_policies").hits[0]
rep.is_exposable = True
rep.save()
mapping = ep.new("mappings", volume=rep, host=hg).save()
```

Restoring a volume-group from a snap is a breeze:
```
vg.last_restored_from = snap
vg.save()
```

repository: Kaminario/krest

gha_license_id: NOASSERTION

repo_name: Kaminario/krest


text:
# HitList
From [raywenderlich.com](https://www.raywenderlich.com) : [Getting Started with Core Data Tutorial](https://www.raywenderlich.com/7569-getting-started-with-core-data-tutorial)

The tutorial shows you how to:
* Model data using Xcode's model editor
* Add new records to Core Data
* Fetch a set of records from Core Data
* Display the fetched records using a table view

![Image of The List - New Name](./images/The_List_01.png "The List - Add a new name")

![Image of The List - TableView](./images/The_List_02.png "The List - TableView")

repository: enwinn/HitList

repo_name: enwinn/HitList


text:
Create a function that returns the name of the winner in a fight between two fighters.

Each fighter takes turns attacking the other and whoever kills the other first is victorious.Death is defined as having health<=0.

Each fighter will be a Fighter object/instance.See the Fighter
class below
in your
chosen language.

Both health

and damagePerAttack (damage_per_attack for python) will be integers larger than 0. You can mutate the Fighter objects.

Example:
```java
public class Fighter {
  public String name;
  public int health, damagePerAttack;
  public Fighter(String name, int health, int damagePerAttack) {
    this.name = name;
    this.health = health;
    this.damagePerAttack = damagePerAttack;
  }
}
```


text:
## API
Hey, welcome to this super awesome API. It has one endpoint! Here is an example request:

```sh
curl whatsinstandard.com/api/v5/sets.json
```

This will return something like:

```json
{
  "deprecated": false,
  "sets": [
    {
      "name": "Battle for Zendikar",
      "block": "Battle for Zendikar",
      "code": "BFZ",
      "enter_date": "2015-10-02T00:00:00.000Z",
      "exit_date": "2017-09-29T00:00:00.000Z",
      "rough_exit_date": "Q4 2017"
    },
    ...
  ]
}
```

But you can just [visit it yourself][1] to see everything. You'll get some JSON containing an array of Magic sets. Each
set has some fields:

| field             | type                                             | description                               |
|:------------------|:-------------------------------------------------|:------------------------------------------|
| `name`            | string                                           | human-readable name of the set            |
| `block`           | string, or null if the set is blockless          | human-readable name of the set's block    |
| `code`            | string, matching regex `/[A-Z]{3}/`              | official three-character code of the set  |
| `enter_date`      | string (ISO 8601), or null if not exactly known  | release date of the set                   |
| `exit_date`       | string (ISO 8601), or null if not exactly known  | date the set exits Standard               |
| `rough_exit_date` | string, matching regex <code>/Q\d 20\d\d/</code> | rough time of year the set exits Standard |

The sets array is in order of release (aka `enter_date`), from oldest set to newest. It contains a superset of all sets
in Standard -- it may contain some sets that have dropped and some sets that have not yet released. It is your
responsibility to filter these sets out by comparing each set's `enter_date` and `exit_date` to the current date.

Here's a JavaScript function that does just that:
```javascript
var standardSets = function(callback) {
  fetch('https://whatsinstandard.com/api/v5/sets.json').then(function(response) {
    response.json().then(function(body) {
      callback(body.sets.filter(function(set) {
        return ((Date.parse(set.enter_date) || Infinity) <= Date.now())
            && ((Date.parse(set.exit_date)  || Infinity) >  Date.now());
      }));
    });
  });
};
```

[1]: https://whatsinstandard.com/api/v5/sets.json

### Set images
You can fetch set images from Gatherer by inserting the set's `code` into this URL template:

    http://gatherer.wizards.com/Handlers/Image.ashx?type=symbol&size=large&rarity=C&set=CODE_GOES_HERE

You can change the `rarity` parameter to any of `C`, `U`, `R`, or `M` to get the set image for common, uncommon, rare,
or mythic rare rarities respectively.

### Canary Deprecation
When using the API, you should always check the root object's boolean field `deprecated`, which will flip on if that API
version becomes deprecated. Configure your program to notify you if this field is ever `true` so you aren't caught off
guard if the version you use is deprecated then eventually killed.

API v1 through v4 are past deprecation and no longer available.

#### Changelog

##### Version 5
* The root element in the response is now an object, not an array. The root object's `sets` field is the array.
* Added a new `deprecated` field to the root object. This field will be `false` until v6 of the API is introduced, which
  will flip it to `true`.
* The API base path has changed from `whatsinstandard.com/api/\d` to `whatsinstandard.com/api/v\d` to be more consistent
  with the rest of the internet.
* Like upcoming sets in v4, sets that have rotated out of Standard can now be included in the sets array. There is no
  guarantee about the number of these sets included (though it will generally be single-digit). You should filter on
  `enter_date` and `exit_date` if you care only about the sets currently in Standard.
* `enter_date` can now be null to allow for upcoming sets whose release dates are not known.
* `block` can now be null to allow for new [blockless sets][2].
###### Midversion nonbreaking changes
* **2018-04-28:** `enter_date` and `exit_date` no longer include timezone (see #75). The dates are still ISO 8601
  compatible and are now intended to be parsed in the local timezone.

[2]: http://magic.wizards.com/en/articles/archive/making-magic/metamorphosis-2-0-2017-06-12

##### Version 4
* Upcoming sets are once again included in the sets array. To use only released sets or only unreleased sets, filter on
  `enter_date`.
* `block` can no longer be `null`, as no more core sets will enter Standard.
* The `symbol` field has been removed to decrease maintenance work. If you'd like still like to fetch set images, you
  can instead use the `code` field to construct an image URL like
  `http://gatherer.wizards.com/Handlers/Image.ashx?type=symbol&set=<code>&size=large&rarity=C`.
* `rough_exit_date` regex has changed from `/(early\/mid|late) 20\d\d/` to `/Q\d 20\d\d/` for simplicity.

##### Version 3
Valid `rough_exit_date` regex has changed from `/(early|late) 20\d\d/` to `/(early\/mid|late) 20\d\d/` to account for
the new Standard rotation style. Old API versions will continue to match their respective regexes, but with potentially
less accuracy. See Wizards's [article on the change][3] for details.

[3]: http://magic.wizards.com/en/articles/archive/mm/metamorphosis

##### Version 2
Upcoming unreleased sets are no longer included in the sets array.

## Contributing
If you're making changes to the API, note that the `api/v*/sets.json` files are generated programmatically by
`api/v*/generate.js` scripts. The scripts read the unstable `api/internal.json` file in this directory and output
version-stable JSON.

In other words: `api/internal.json` is the database, `api/v*/generate.js` is the view, and `api/v*/sets.json` is the
generated output.

Run
```sh
npm install
```
to regenerate the endpoints.

repository: BlaKDetH/whatsinstandard

repo_name: BlaKDetH/whatsinstandard


text:
## Installation

With [yarn](https://classic.yarnpkg.com).

```sh
yarn add @roots/bud-cli --dev
```

With npm:

```sh
npm install @roots/bud-cli --save-dev
```

## Getting started

The CLI includes detailed usage instructions:

```sh
yarn bud --help
```

## bud build

Compile assets for production:

```sh
bud build
```

Compile assets for development:

```sh
bud build:dev
```

## bud extensions

List installed extensions:

```sh
bud extensions:list
```

Install extension dependencies:

```sh
bud extensions:install
```

## Running the build with logging

Use the `--log` flag to run the build with logging enabled.

## Installing dependencies automatically

Try the `--install` flag to install packages flagged as required by various extensions.

## Running the build in CI

It is possible, depending on your environment, that Bud's CLI output causes issues. In particular, it's usage of tty `raw mode` can cause issues in CI.

To run the build but not use the `@roots/bud-cli` renderer, there is a `--ci` flag which indicates you want to run the build for these environments.

## Exiting the CLI from `dev` mode

Type `q` to gracefully exit the interface when running in development mode.

repository: fossabot/bud

branch_name: refs/heads/stable

repo_name: fossabot/bud


text:
---
type: ftpserver
title: FtpServer Logging
---

# Logging

## FtpServer Logging

FtpServer uses [SLF4J](http://slf4j.org/) throughout its internal code allowing the developer to choose a logging configuration that suits their needs, e.g java.util.logging or Log4J. SLF4J provides FtpServer the ability to log hierarchically across various log levels without needing to rely on a particular logging implementation.

## MDC logging

FtpServer supports [MDC logging](http://www.slf4j.org/manual.html#mdc). Basically, it provides session based information for the logger. Of primary interest in the case of FtpServer are the user name and remote IP address for each session. The log4j example below shows how to enable these to be logged.

The following properties are made available for MDC logging

| Token | Description |
|---|---|
| session | A unique session ID, the same available from FtpSession.getSessionId() |
| userName | The user name of the user, only available after the USER command has been issued |
| remoteAddress | The IP and local port of the client |
| remoteIp | The IP of the client |
| remotePort | The port used for the socket at the client |
| localAddress | The local IP and port of the server for this session |
| localIp | The local IP of the server for this session |
| localPort | The local port of the server for this session |

## log4j

If you need to setup detailed logging from within FtpServer's code, then you can use a simple log4j configuration. Note that this logging can be very verbose depending on the log level you chose to use. The log4j jar is bundled with the binary distribution. This is an optional jar file.

The log4j configuration file location is <INSTALL_DIR>/common/classes/log4j.properties. You can modify this file to configure log4j.

```text
log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=./res/log/log.gen
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[%5p] %d [%X{userName}] [%X{remoteIp}] %m%n
```

This log4j configuration sets up a file called log.gen in your FTP Server ./res/log folder with a maximum file size of 10MB and up to 10 backups. DEBUG log level is specified.

You should consult the log4j documentation for more options.

repository: apache/mina-site

gha_language: HTML

repo_name: apache/mina-site


text:
# WaterModels Examples

The `examples` directory contains two water network optimization instances that have been developed or modified from two literature instances.

The first is the famous "two-loop" water network design instance.
(It is sometimes titled after one of its authors as `shamir`.)
This design instance dates back to 1977, first appearing in [1].
The globally optimal design cost is known to be \$419,000.
Solutions of this instance using various formulation types and assumptions appeared in the [Quick Start Guide](@ref).
As an example, it can be solved using a linear relaxation-based formulation (`LRDWaterModel`) via the following:
```julia
using WaterModels
import HiGHS

data = parse_file("examples/data/json/shamir.json")
set_flow_partitions_si!(data, 0.5, 1.0e-4)
result = solve_des(data, LRDWaterModel, HiGHS.Optimizer)
```

The second is a modified version of the popular `van_zyl` optimal water flow instance, which first appeared in [2] and is also named after one of that article's authors.
Unlike the design problem, this problem has temporal aspects.
It can be constructed and solved (e.g., using the `LRDWaterModel` formulation) using the following:
```julia
using WaterModels
import HiGHS
import JuMP

data = parse_file("examples/data/epanet/van_zyl.inp")
data_mn = WaterModels.make_multinetwork(data)
set_flow_partitions_si!(data_mn, 1.0, 1.0e-4)
highs = JuMP.optimizer_with_attributes(HiGHS.Optimizer, "time_limit" => 60.0)
result = solve_mn_owf(data_mn, LRDWaterModel, highs)
```
The instance is challenging, and only a feasible solution is returned within the time limit for the script above.
Also note that results are presented in an automatically-applied per-unit system.
To convert the solution to SI units, the following can be executed:
```julia
make_si_units!(result["solution"])
```

## References
[1] Alperovits, E., & Shamir, U. (1977). Design of optimal water distribution systems. _Water Resources Research_, _13_(6), 885-900.

[2] Van Zyl, J. E., Savic, D. A., & Walters, G. A. (2004). Operational optimization of water distribution systems using a hybrid genetic algorithm. _Journal of Water Resources Planning and Management_, _130_(2), 160-170.

gha_language: Julia


text:
---
title: Manage contractors with mobile scheduling
contexts: office365,microsoft365
copyright: Microsoft
translations: en
tools: Microsoft Teams,SharePoint,StaffHub
areas: HUMAN RESOURCES
color: #777777
icon: https://jumpto365.com/resources/images/app/jumpto365-Icon-white.png
externalref: https://www.microsoft.com/en-us/microsoft-365/success/productivitylibrary/manage-contractors-with-mobile-scheduling
---
Use mobile communication and scheduling tools to manage contract worker staffing at an event.

## Prepare your team for the event

Managing contractors for an event, such as a product rollout or retail roadshow, requires excellent communication and scheduling tools. Prepare your HR team for the event by bringing them together in a **Microsoft** **Teams** channel to share news, files, and tools with your internal team. Then use the **StaffHub** scheduling app to provide your contract workers with schedule management and information-sharing tools they can use right from their devices.

[View Training](https://support.office.com/article/Microsoft-Teams-Quick-Start-422bf3aa-9ae8-46f1-83a2-e65720e1a34d)

[IFRAME](https://www.microsoft.com/en-us/videoplayer/embed/RE1Tmr7)

## Let contractors view shift schedules on their devices

With **StaffHub** installed on their mobile devices, your contractors can view their own schedules and those of their coworkers right from their smartphone or tablet, and you can view and manage staffing, shift swaps, and other changes. StaffHub also provides a chat feature that you can use to share news and updates with your event team in real time.

[View Training](https://support.office.com/article/Request-and-approve-shift-swaps-in-Microsoft-StaffHub-d72d98ec-c48b-4e8c-a037-57579789a1fc)

![](http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1NOWr?ver=d3cc)

## Provide secure access to event resources from anywhere

Your team needs access to company documents to plan and staff your event, and the contractors need to access day-of-event documents. **SharePoint** provides secure access to internal company resources from almost anywhere, on almost any device. To share documents with the firstline contract workers who are staffing the event, you can add the documents to the team's **StaffHub** Files tab, so they can access the information directly from their mobile devices, any time they need it.

[View Training](https://support.office.com/article/Get-started-with-SharePoint-909ec2f0-05c8-4e92-8ad3-3f8b0b6cf261)

![](http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE1NOht?ver=dffe)

## Collaborate in real time with the contractors on the event floor

During the event, your contractors might need to contact you with questions, and you might need to connect with your stakeholders to make last-minute arrangements. You can use the **StaffHub** chat feature to communicate in real time with individuals or with the event's entire firstline team.

[View Training](https://staffhub.ms/what-it-is)

[IFRAME](https://www.microsoft.com/en-us/videoplayer/embed/RE1TjQX)

repository: Hexatown/docs

path: /microsoft/usecases/microsoft365/manage contractors with mobile scheduling/index.md

gha_language: PowerShell

repo_name: Hexatown/docs


text:
## okta-admin idps list

Enumerates IdPs in your organization with pagination.

### Synopsis

Enumerates IdPs in your organization with pagination. A subset of IdPs can be returned that match a supported filter expression or query.

```
okta-admin idps list [flags]
```

### Options

```
  -h, --help   help for list
```

### SEE ALSO

* [okta-admin idps](okta-admin_idps.md)	 - Provides operations to manage federations with external Identity Providers (IdP).

###### Auto generated by spf13/cobra on 29-May-2021

repository: gammastudios/okta-admin

repo_name: gammastudios/okta-admin


text:
# nginx on CentOS

Custom Docker images with nginx on CentOS. The images are published on Docker Hub here: https://hub.docker.com/r/qaware/centos-nginx/

# Maintainer

Armin Heller<EMAIL_ADDRESS>
# License

This software is provided under the Apache License Version 2.0, read the `LICENSE` file for details.


text:
# NB: You are advised to use this project from here on in: http://laraveldoctrine.org/

# Doctrine2Bridge for Laravel 5

Adds the power of Doctrine2 to Laraval 5 (including authentication and SQL query logging support).

For Laravel4, see [opensolutions/doctrine2bridge](https://github.com/opensolutions/doctrine2bridge)

Laravel's Eloquent ORM is nice for rapid development and the active model pattern. However there's little out
there that can beat Doctrine2 when you need a more full-featured ORM.

This is an integration of Doctrine 2.x to Laravel 5.x as a composer package. Doctrine's EntityManager instance is accessible through a facade named `D2EM` and the cache is directly available via `D2Cache`.

Metadata is currently obtained via the [XML driver](http://docs.doctrine-project.org/en/latest/reference/xml-mapping.html). It should be easy to add additional drivers to this.

Authentication support is also included via a `Auth/Doctrine2UserProvider` class. Documentation on integrating this with Laravel's own authentication system [can be found here](https://github.com/opensolutions/doctrine2bridge/wiki/Auth).

## Installation

Installation is the usual for Laravel packages. You can find a detailed worked version of [how to install and test in the wiki](https://github.com/opensolutions/doctrine2bridge-l5/wiki/Install-from-Scratch).

Insert the following in the packages (`require`) section of your composer.json file and run an update (`composer update`):

    "opensolutions/doctrine2bridge-l5": "2.4.*",

Generally speaking, we'll try and match our minor versions (2.4.x) with Doctrine's but you should always use the latest `x` version of this.

Add the service providers to your Laravel application in `app/config/app.php`. In the `'providers'` array add:

    'Doctrine2Bridge\Doctrine2CacheBridgeServiceProvider',
    'Doctrine2Bridge\Doctrine2BridgeServiceProvider',

You'll need to publish and edit the configuration files:

    ./artisan vendor:publish --provider "Doctrine2Bridge\Doctrine2CacheBridgeServiceProvider"
    ./artisan vendor:publish --provider "Doctrine2Bridge\Doctrine2BridgeServiceProvider"

This should get you a fresh copy of the configuration files (`d2bcache.php` and `db2doctrine.php`) in the configs directory.

Now, edit these as well as setting Laravel5's own `cache.php` and `database.php` appropriately.

The default directory for Doctrine2's xml schema is `database/xml`. This can be configured in `config/d2bdoctrine.php`.

Documentation on integrating this with Laravel's own authentication system [can be found here](https://github.com/opensolutions/doctrine2bridge-l5/wiki/Auth).

## Usage

Four bindings are created which can be injected via Laravel's IoC in the standard manner:

 * `Doctrine\ORM\EntityManagerInterface` (which is an instance of Doctrine\ORM\EntityManager)
 * `Doctrine\Common\Cache\Cache` (which is an instance of the appropriate cache provider)
 * `Doctrine\ORM\Mapping\ClassMetadataFactory` (used in this package by the console generator commands)
 * `Doctrine2Bridge\Support\Repository` (used by the `D2R` facade, see below)

Three facades are provided - for the Doctrine2 cache, the entity manager and a convenience repository generator. These can be used as follows:

    D2Cache::save( $key, $value );
    D2Cache::fetch( $key );

    D2EM::persist( $object );
    D2EM::flush();
    $users = D2EM::getRepository( 'Entities\User' )->findAll();

Typically we'd create and use a repository as follows:

    $sample = D2EM::getRepository( '\Entities\SampleEntity' )->find(5);

Assuming `d2bdoctrine.namespaces.models => 'Entities'`, then we can use the `D2R` facade in any of the following ways to achieve the same result:

    $sample = D2R::r( 'SampleEntity' )->find(5);
    $sample = D2R::r( 'Entities\SampleEntity' )->find(5);
    $sample = D2R::r( 'SampleEntity', 'Entities' )->find(5);

## More Detailed Usage

The configuration file by default expects to find XML schema definitions under `database/xml`. Let's say for example we have a single schema file called `database/xml/Entities.SampleEntity.dcm.xml` containing:

    <?xml version="1.0"?>
    <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
        <entity name="Entities\SampleEntity" repository-class="Repositories\Sample">
            <id name="id" type="integer">
                <generator strategy="AUTO"/>
            </id>
            <field name="name" type="string" length="255" nullable="true"/>
        </entity>
    </doctrine-mapping>

Assuming you've configured your database connection parameters in the config file and you're positioned in the base directory of your project, we can create the entities, proxies and repositories with:

    ./artisan d2b:generate:entities
    ./artisan d2b:generate:proxies
    ./artisan d2b:generate:repositories

There is also a handy shortcut for this:

    ./artisan d2b:generate:all

Read the output of these commands as they may need to be run twice.

We also bundle a full Doctrine2 CLI utilty so the above could also be done via:

    ./vendor/bin/d2b-doctrine2 orm:generate-entities database/
    ./vendor/bin/d2b-doctrine2 orm:generate-proxies
    ./vendor/bin/d2b-doctrine2 orm:generate-repositories database/

You can also (drop) and create the database with:

    ./artisan d2b:schema:drop --commit
    ./artisan d2b:schema:create --commit

And you can update and validate via:

    ./artisan d2b:schema:update --commit
    ./artisan d2b:schema:validate

Now you can add some data to the database:

    $se = new Entities\SampleEntity;
    $se->setName( rand( 0, 100 ) );
    D2EM::persist( $se );
    D2EM::flush();

And query it:

    echo count( D2EM::getRepository( 'Entities\SampleEntity' )->findAll() );

I use the excellent [Skipper](http://www.skipper18.com/) to create and manage my XML schema files.

## Convenience Function for Repositories

## SQL Query Logging

This package includes an implementation of `Doctrine\DBAL\Logging\SQLLlogger` which times the queries and calls the Laravel [Log](http://laravel.com/docs/errors#logging) facade to log the query execution times and the SQL queries.

This logger can be enabled in the configuration file.

## License

Like the Laravel framework itself, this project is open-sourced under the [MIT license](http://opensource.org/licenses/MIT).

## Inspiration

Based on my original package [opensolutions/doctrine2bridge](https://github.com/opensolutions/doctrine2bridge) for Laravel4. Some additional inspiration when porting to Laravel5 from [mitchellvanw/laravel-doctrine](https://github.com/mitchellvanw/laravel-doctrine).


text:
# IBM-Data-Analysis-Course
This repository is for the various data analysis and visualization problems encountered in Coursera's Applied Data Science Specialization by IBM.

URL for the Coursera Specialization : https://www.coursera.org/specializations/applied-data-science

repository: diabmohab/Applied-Data-Science-IBM

repo_name: diabmohab/Applied-Data-Science-IBM


text:
# Rancher WebHook Update
Upgrade rancher service when API call. It can used in some process like in CI finished

# Usage
Config your settings in `config.py` or use env to set settings

It will run in `http://your-ip:5000` and in default `/webhook` will update service


text:
# Table of contents

* [Overview on Developing](README.md)
  * [Contributing](contributing.md)
* [Architectural Decisions](adr/README.md)
* Getting into the code
  * [Set up a local workspace](guidelines-for-setting-up-a-local-workspace.md)
  * [High-level documentation](high-level-documentation.md)
  * [How to test](testing.md)
  * [Code Howtos](code-howtos.md)
  * [JabRef's development strategy](development-strategy.md)
* Advanced reading
  * [Code Quality](code-quality.md)
  * [Recommendations for UI design](ui-recommendations.md)
  * [Custom SVG icons](custom-svg-icons.md)
  * [Creating a binary and debug it](jpackage.md)
* [JabRef and Software Engineering](teaching.md)
* Readings on Coding
  * [Readings on JavaFX](javafx.md)
  * [Useful development tooling](tools.md)

repository: leitianjian/jabref

repo_name: leitianjian/jabref


text:
# An Illegal Fishing Vessel Risk Framework - Satellite imagery

### Requirements and authentications
Our satellite images providers are commercial. In order to run the codes inside this repository you must have an active account for [Digital Globe] or [Planet Labs]. Each provider has its own API to query, activate, preprocess, and download imagery. Both API's are listed in the `development` environment and can be installed excecuting the following:

```bash
source environment_variables
conda env create -f envs/development.yml
source activate development
```

Digital Globe API, [GBDX], is Python native and needs the user to define authentication credentials under `~/.gbdx_config` (see API documentation). To run [Planet API] the user needs to define a environment variable with the API key named `PLANET_API_KEY`. In this repo, the key is defined in: `./auth/db_credentials_example`

In order to upload data to our PostgreSQL database and use its geometry operations, we need to create the schemas to upload the data. To do this, we need to run first the following:

```bash
psql -f ./sql_scripts/upload_gbdx_schema.sql
psql -f ./sql_scrips/upload_planet_schema.sql
```

### Running the code

As described in the Technical documentation, a supplementary part of the analysis includes the visual validation of vessel position data. This is done for our two sources of imagery following a common fashion. First, we retrieve imagery metadata from marine areas in the whole world using each provider API in our defined timeframe (May 2016 - Jun 2017). Second, we find the spatial and temporal overlap of the vessel positional data with the images using PostgreSQL and PostGIS and create a new SQL table. Third, we load the overlap subset and create for each vessel positional point a buffer and use it to crop the satellite image.

#### 1. Retrieve imagery:

GBDX: `python src/sat_imagery/get_images_metadata.py`

Planet: `python src/sat_imagery/search-items.py`

Digital Globe's code will iterate the query for each marine and ocean area in the world (see [CartoDB Boundaries]). Planet Labs code will look for an area defined in the `coords.json` file in the same directory, you can check the [Geojson geometry builder] to create a new area of interest. Both files will upload the metadata table directly to defined SQL Schemas. Additionally, the Planet `search-items.py` will save a HTML Leaflet map to explore the retrieved data.

#### 2. Intersection:

GBDX: `psql -f ./sql_scripts/overlap_gbdx.sql`

Planet: `psql -f ./sql_scrips/overlap_planet.sql`

Both codes will create a SQL query which will create a new table with the total of vessel positional points inside the polygon of the images.

#### 3. Croping and dowloading
GBDX: `python src/sat_imagery/retrieve_gbdx_crop.py`

Planet: `python src/sat_imagery/planet_check.py `

The GBDX code will create the buffers and use the GBDX's API crop task to retrieve the cropped images. This images are downloaded to the client S3 bucket. For Planet, the code will project and crop the downloaded images using the `rasterio` library. The code also will save a mosaic of selected cropped images

[Digital Globe]:http://www.digitalglobe.com/
[Planet Labs]:https://www.planet.com/
[GBDX]:http://gbdxtools.readthedocs.io/en/latest/
[Planet API]:https://planetlabs.github.io/planet-client-python/index.html
[CartoDB Boundaries]: https://cartodb.github.io/bigmetadata/global/boundary.html
[Geojson geometry builder]:http://geojson.io/#map=2/20.0/0.0


text:
---
home: true
head:
  - - meta
    - name: twitter:title
      content: Image cache & resize service
  - - meta
    - name: twitter:description
      content: Manipulate images on-the-fly with a worldwide cache
  - - meta
    - property: og:title
      content: Image cache & resize service
  - - meta
    - property: og:description
      content: Manipulate images on-the-fly with a worldwide cache
heroImage: /logo.svg
heroAlt: wsrv.nl
heroText: wsrv.nl
tagline: An image cache & resize service.
Manipulate images on-the-fly with a worldwide cache.
actionText: Read the documentation →
actionLink: /docs/
features:
- title: Crazy Fast
  icon: la-fighter-jet
  details: Performance is not just an afterthought, we baked it in from the start!
- title: Awesome Technology
  icon: la-cubes
  details: wsrv.nl employs best-in-class technologies such as nginx and libvips.
- title: Free / Open Source
  icon: la-money-bill-wave-alt
  details: wsrv.nl is an open source project, so you can spend your money on other stuff.
---

### Your images unchained

The CDN is provided by [Cloudflare](https://www.cloudflare.com/). Images are being cached and delivered straight from
[200+ global datacenters](https://www.cloudflare.com/network/). This ensures the fastest load times and best performance.

### Widely used
On average, we resize 6 million (6×106) images per hour, which generates around 400TB of outbound traffic per month.

repository: weserv/docs

gha_language: Vue

repo_name: weserv/docs


text:
---
layout: default
title: Github
description: What the the Mdoq github dialog can do
section: instance
priority: 40
---

# {{ page.title }}

The github dialog is designed to enable automation of a few simple git tasks commonly carried out by a developer.

<img src="/assets/img/github_dialog.jpg" alt="Mdoq Github Dialog" />

- [Clone Links](#clone-links)
- [View Branch](#view-branch)
- [Git Pull](#git-pull)
- [Git Push](#git-push)
- [Merging In Branches](#merging-in-branches)
- [Common Issues](#common-issues)

## Clone Links
These are the cli commands to clone the branch your instance is on, should you wish to get a local copy of the code base.

## View Branch
This is a link to the branch your instance is on, useful when you need to look in Github for more information quickly.

## Git Pull
This allows you to pull changes from Github onto your instance.
For example, you rolled up your instance, but another developer made a change in github. Which would make the github branch ahead of your local copy of the branch.
To get these new changes on your instance just click Git pull.

## Git Push
This allows your to push changes on your instance to git so they can be taken live.
For example, you rolled up an instance, and made some changes using the Web IDE, you now want to push these changes to git so they aren't lost.
1. Git push
2. Select the files you want to push (you may not want to push them all, see [Maintaining your .gitignore](#maintaining-your-gitignore) if there are lots of files).
  Enter a commit message, this will be the message shown in git.
3. Click Commit And Push

All done

## Merging In Branches
This feature allows you to pull changes from another git branch into your branch.
For example you created an instance, then did some work, in the time it took you to do the work, a bug fix was fixed and released. This would leave your branch behind master. Before Mdoq will let you put your branch into master it will force you to be ahead. So the bug fix in master will need merging into your branch.
To do this, just select `master` from the branch list and click merge. This will pull all the new changes in, so they can be tested on your instance.

## Common Issues
Although the Github dialog can perform a lot, unfortunately it's not magic and there may be times where a human is required.
When an issue occurs it will be shown in the logs for the instance, it will be signified by a red exclamation mark.
Inside that log will be all the information about the issue Mdoq hit, which should give you an idea of what the issue is.

### Common Issues: Merge In Branches
Unab
- Where you are trying to merge another branch into yours and git cannot auto resolve the conflicts.
  *Solution:* To solve this resolve the conflicts either on the CLI or in Github it's self, you should then be able to pull your modifications onto your instance.

### Common Issues: Git Pull
When git pulling using Mdoq it fails.
- "Your local changes to the following files would be overwritten by merge"
  *Solution:* this means you have changed the file on Mdoq, outside of git, and then the file has also been changed in git. The easiest solution is to revert the changes to the file on Mdoq `git checkout /path/to/file` you should then be able to pull.
- " Automatic merge failed; fix conflicts and then commit the result."
  *Solution:* this is down to the situation but it means you have committed changes to the file on Mdoq, and the same file has also been changed in github. Git can't work out how to merge the output of the commits.

### Common Issues: Git Commit And Push
When trying to commit and push it fails.
- "Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes"
  *Solution:* Run a git pull from Mdoq
- "The current branch XXXXXX has no upstream branch"
  *Solution:* Git commands have been ran on the Mdoq instance, which have corrupted the config, such that it cannot determine where to push changes to. Where possible the best option will be to recreate code (though this will cause any uncommitted changes to be lost). An alternate option would be to set the remote upstream, which should allow you to push your changes.

## Maintaining Your .gitignore
A .gitignore file tells git what files to ignore when its working out what you would want to commit to git.
For example: temporary files, or files containing sensitive information.
See [here](https://git-scm.com/docs/gitignore) for more information.