text:
### 2017-04-19

#### swift
* [google / xi-mac](https://github.com/google/xi-mac):
* [Nirma / UIFontComplete](https://github.com/Nirma/UIFontComplete):
        Make working with UIFont faster and less error-prone.

* [Luubra / EmojiIntelligence](https://github.com/Luubra/EmojiIntelligence):
        Neural Network built in Apple Playground using Swift

* [younatics / YNSearch](https://github.com/younatics/YNSearch):

🔍 Awesome fully customizable search view like Pinterest written in Swift 3

* [efremidze / Haptica](https://github.com/efremidze/Haptica):
        Easy Haptic Feedback Generator 📳

* [vsouza / awesome-ios](https://github.com/vsouza/awesome-ios):
        A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

* [danielgindi / Charts](https://github.com/danielgindi/Charts):
        Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.

* [CrystalMarch / CoordinateAxisChart](https://github.com/CrystalMarch/CoordinateAxisChart):
        Drawing graphs of point, linear function, power function, exponential function, logarithmic function, circular function, etc in a coordinate. （实现了在坐标系中画点，一次函数，幂函数，指数函数，对数函数，三角函数等）

* [gokulgovind / GLInAppPurchase](https://github.com/gokulgovind/GLInAppPurchase):
        Tinder Style InApp Purchase Banner

* [IvanVorobei / RequestPermission](https://github.com/IvanVorobei/RequestPermission):
        simple permission request with beautiful UI

* [dkhamsing / open-source-ios-apps](https://github.com/dkhamsing/open-source-ios-apps):

📱 Collaborative List of Open-Source iOS Apps

* [jerkoch / SwipeCellKit](https://github.com/jerkoch/SwipeCellKit):
        Swipeable UITableViewCell based on the stock Mail.app, implemented in Swift.

* [SwiftyBeaver / SwiftyBeaver](https://github.com/SwiftyBeaver/SwiftyBeaver):
        Convenient logging during development & release in Swift 2 & 3

* [Alamofire / Alamofire](https://github.com/Alamofire/Alamofire):
        Elegant HTTP Networking in Swift

* [ReactiveX / RxSwift](https://github.com/ReactiveX/RxSwift):
        Reactive Programming in Swift

* [SwiftyJSON / SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON):
        The better way to deal with JSON data in Swift

* [ninjaprox / Inkwell](https://github.com/ninjaprox/Inkwell):
        An inkwell to use custom fonts on the fly.

* [lkzhao / Hero](https://github.com/lkzhao/Hero):
        Elegant transition library for iOS & tvOS

* [c-Viorel / MBIcons](https://github.com/c-Viorel/MBIcons):
        MBIcons contains over 200 icons that can be resized to any dimensions as they are drawn using NSBezierPath.

* [raywenderlich / swift-algorithm-club](https://github.com/raywenderlich/swift-algorithm-club):
        Algorithms and data structures in Swift, with explanations!

* [matteocrippa / awesome-swift](https://github.com/matteocrippa/awesome-swift):
        A collaborative list of awesome swift resources. Feel free to contribute!

* [material-motion / material-motion-swift](https://github.com/material-motion/material-motion-swift):
        A toolkit for building responsive motion using Core Animation.

* [EthanSchatzline / DrawableView](https://github.com/EthanSchatzline/DrawableView):
        A UIView subclass that allows the user to draw on it.

* [Ramotion / folding-cell](https://github.com/Ramotion/folding-cell):
        FoldingCell is an expanding content cell inspired by folding paper material

* [jflinter / Dwifft](https://github.com/jflinter/Dwifft):
        Swift Diff

#### objective-c
* [ReticentJohn / Amaroq](https://github.com/ReticentJohn/Amaroq):
        A floofy Mastodon companion for iOS

* [sympli / autodraw-sketch](https://github.com/sympli/autodraw-sketch):
* [hackiftekhar / IQKeyboardManager](https://github.com/hackiftekhar/IQKeyboardManager):
        Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.

* [rs / SDWebImage](https://github.com/rs/SDWebImage):
        Asynchronous image downloader with cache support as a UIImageView category

* [AFNetworking / AFNetworking](https://github.com/AFNetworking/AFNetworking):
        A delightful networking framework for iOS, OS X, watchOS, and tvOS.

* [ViccAlexander / Chameleon](https://github.com/ViccAlexander/Chameleon):
        Flat Color Framework for iOS (Obj-C & Swift)

* [snail-z / SnailPopupController](https://github.com/snail-z/SnailPopupController):
        快速弹出自定义视图，支持自定义蒙版样式/过渡效果/手势拖动等

* [airbnb / lottie-ios](https://github.com/airbnb/lottie-ios):
        An iOS library to natively render After Effects vector animations

* [facebook / KVOController](https://github.com/facebook/KVOController):
        Simple, modern, thread-safe key-value observing for iOS and OS X.

* [libobjc / SGPlayer](https://github.com/libobjc/SGPlayer):
        A powerful media player framework for iOS, macOS, and tvOS. Support 360° panorama video, VR video. RTMP streaming.

* [JunyiXie / XJYChart](https://github.com/JunyiXie/XJYChart):
        优秀的的图表框架。支持动画，点击，滑动，区域高亮。Excellent charting framework. Support animation, click, slide, area highlight.

* [facebook / SocketRocket](https://github.com/facebook/SocketRocket):
        A conforming Objective-C WebSocket client library.

* [PureLayout / PureLayout](https://github.com/PureLayout/PureLayout):
        The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.

* [realm / realm-cocoa](https://github.com/realm/realm-cocoa):
        Realm is a mobile database: a replacement for Core Data & SQLite

* [HJaycee / JCAlertController](https://github.com/HJaycee/JCAlertController):
        AlertController presented FIFO or LIFO and customed easily

* [Instagram / IGListKit](https://github.com/Instagram/IGListKit):
        A data-driven UICollectionView framework for building fast and flexible lists.

* [wubianxiaoxian / DanmuTool](https://github.com/wubianxiaoxian/DanmuTool):
        一个弹幕渲染工具

* [coolnameismy / BabyBluetooth](https://github.com/coolnameismy/BabyBluetooth):

👶 The easiest way to use Bluetooth (BLE )in ios/os ,even bady can use . 一个非常容易使用的蓝牙库,适用于ios和os

* [jessesquires / JSQMessagesViewController](https://github.com/jessesquires/JSQMessagesViewController):
        An elegant messages UI library for iOS

* [WenchaoD / FSCalendar](https://github.com/WenchaoD/FSCalendar):
        A fully customizable iOS calendar library, compatible with Objective-C and Swift

* [zhengwenming / WMPlayer](https://github.com/zhengwenming/WMPlayer):
        WMPlayer视频播放器，AVPlayer的封装，继承UIView，想怎么玩就怎么玩。支持播放mp4、m3u8、3gp、mov，网络和本地视频同时支持。全屏和小屏播放同时支持。自动感应旋转屏幕。

* [expo / expo](https://github.com/expo/expo):
        Expo iOS/Android Client

* [gsdios / SDAutoLayout](https://github.com/gsdios/SDAutoLayout):
        One line of code to implement automatic layout. 一行代码搞定自动布局！支持Cell和Tableview高度自适应，Label和ScrollView内容自适应，致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based on runtime.

* [Augustyniak / RATreeView](https://github.com/Augustyniak/RATreeView):
        Library providing easy-to-use interface for displaying tree structures on iOS and tvOS.

* [CocoaLumberjack / CocoaLumberjack](https://github.com/CocoaLumberjack/CocoaLumberjack):
        A fast & simple, yet powerful & flexible logging framework for Mac and iOS

#### go
* [moby / moby](https://github.com/moby/moby):
        Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

* [quilt / quilt](https://github.com/quilt/quilt):
        Deploy and manage containers with JavaScript

* [deoxxa / don](https://github.com/deoxxa/don):
        Less than half of mastodon.

* [m-reda / pipeline](https://github.com/m-reda/pipeline):
        Node-based automation server

* [golang / go](https://github.com/golang/go):
        The Go programming language

* [lpereira / gomoku](https://github.com/lpereira/gomoku):
        Gomoku compiles Go code to C++

* [docker / cli](https://github.com/docker/cli):
        The Docker CLI

* [uber / jaeger](https://github.com/uber/jaeger):
        Jaeger - Uber's Distributed Tracing System

* [prometheus / prometheus](https://github.com/prometheus/prometheus):
        The Prometheus monitoring system and time series database.

* [ChrisRx / dungeonfs](https://github.com/ChrisRx/dungeonfs):
        A FUSE filesystem and dungeon crawling adventure game engine

* [astaxie / build-web-application-with-golang](https://github.com/astaxie/build-web-application-with-golang):
        A golang ebook intro how to build a web with golang

* [spf13 / hugo](https://github.com/spf13/hugo):
        A Fast and Flexible Static Site Generator built with love in GoLang

* [kubernetes / kubernetes](https://github.com/kubernetes/kubernetes):
        Production-Grade Container Scheduling and Management

* [gravitational / teleport](https://github.com/gravitational/teleport):
        Modern SSH server for clusters and teams.

* [grafana / grafana](https://github.com/grafana/grafana):
        The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More

* [ponzu-cms / ponzu](https://github.com/ponzu-cms/ponzu):
        Headless CMS with automatic JSON API. Featuring auto HTTPS, HTTP/2 Server Push, and flexible server framework written in Go.

* [avelino / awesome-go](https://github.com/avelino/awesome-go):
        A curated list of awesome Go frameworks, libraries and software

* [docker / infrakit](https://github.com/docker/infrakit):
        A toolkit for creating and managing declarative, self-healing infrastructure.

* [minio / minio](https://github.com/minio/minio):
        Minio is an open source object storage server compatible with Amazon S3 APIs

* [cilium / cilium](https://github.com/cilium/cilium):
        Linux Native, HTTP Aware Network Security for Containers

* [go-kit / kit](https://github.com/go-kit/kit):
        A standard library for microservices.

* [mattn / go-mastodon](https://github.com/mattn/go-mastodon):
        mastodon client for golang

* [coreos / etcd](https://github.com/coreos/etcd):
        Distributed reliable key-value store for the most critical data of a distributed system

* [containous / traefik](https://github.com/containous/traefik):
        Træfik, a modern reverse proxy

* [hashicorp / terraform](https://github.com/hashicorp/terraform):
        Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.

#### javascript
* [ramon82 / zuck.js](https://github.com/ramon82/zuck.js):
        A javascript library that lets you add stories EVERYWHERE.

* [notwaldorf / tiny-care-terminal](https://github.com/notwaldorf/tiny-care-terminal):

💖💻 A little dashboard that tries to take care of you when you're using your terminal.

* [ianstormtaylor / slate](https://github.com/ianstormtaylor/slate):
        A completely customizable framework for building rich text editors.

* [BoostIO / Boostnote](https://github.com/BoostIO/Boostnote):
        Boostnote is an open source note-taking app made for programmers just like you🚀

* [facebook / react-vr](https://github.com/facebook/react-vr):
        Create amazing 360 and VR content using React

* [prettier / prettier](https://github.com/prettier/prettier):
        Prettier is an opinionated JavaScript formatter.

* [facebook / react](https://github.com/facebook/react):
        A declarative, efficient, and flexible JavaScript library for building user interfaces.

* [getify / You-Dont-Know-JS](https://github.com/getify/You-Dont-Know-JS):
        A book series on JavaScript. @YDKJS on twitter.

* [vuejs / vue](https://github.com/vuejs/vue):
        A progressive, incrementally-adoptable JavaScript framework for building UI on the web.

* [javierbyte / control-user-cursor](https://github.com/javierbyte/control-user-cursor):
        Experiment to alter the cursor behavior. Proof of concept.

* [mzabriskie / axios](https://github.com/mzabriskie/axios):
        Promise based HTTP client for the browser and node.js

* [SheetJS / js-xlsx](https://github.com/SheetJS/js-xlsx):
        Spreadsheet Parser and Writer

* [nylas / nylas-mail](https://github.com/nylas/nylas-mail):

💌 An extensible desktop mail app built on the modern web.

* [twbs / bootstrap](https://github.com/twbs/bootstrap):
        The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

* [facebookincubator / create-react-app](https://github.com/facebookincubator/create-react-app):
        Create React apps with no build configuration.

* [facebook / react-native](https://github.com/facebook/react-native):
        A framework for building native apps with React.

* [tasjs / tas](https://github.com/tasjs/tas):
        Make code simple and easy to maintain, and is better than Promise.

* [airbnb / javascript](https://github.com/airbnb/javascript):
        JavaScript Style Guide

* [d3 / d3](https://github.com/d3/d3):
        Bring data to life with SVG, Canvas and HTML. 📊📈🎉

* [ecomfe / echarts](https://github.com/ecomfe/echarts):
        A powerful, interactive charting and visualization library for browser

* [facebook / relay](https://github.com/facebook/relay):
        Relay is a JavaScript framework for building data-driven React applications.

* [reactjs / redux](https://github.com/reactjs/redux):
        Predictable state container for JavaScript apps

* [zeit / next.js](https://github.com/zeit/next.js):
        Framework for server-rendered React apps

* [xtuc / async-reactor](https://github.com/xtuc/async-reactor):
        Render async Stateless Functional Components

* [webpack / webpack](https://github.com/webpack/webpack):
        A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders," modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

#### ruby
* [tootsuite / mastodon](https://github.com/tootsuite/mastodon):
        A GNU Social-compatible microblogging server

* [janlelis / uniscribe](https://github.com/janlelis/uniscribe):
        Debug help for Unicode strings

* [sagivo / algorithms](https://github.com/sagivo/algorithms):
        algorithms playground for common questions

* [brunofacca / zen-rails-security-checklist](https://github.com/brunofacca/zen-rails-security-checklist):
        Checklist of security precautions for Ruby on Rails applications.

* [rapid7 / metasploit-framework](https://github.com/rapid7/metasploit-framework):
        Metasploit Framework

* [fastlane / fastlane](https://github.com/fastlane/fastlane):

🚀 The easiest way to automate building and releasing your iOS and Android apps

* [jondot / awesome-react-native](https://github.com/jondot/awesome-react-native):
        Awesome React Native components, news, tools, and learning material!

* [nickelser / zhong](https://github.com/nickelser/zhong):
        Reliable, distributed cron.

* [gmontard / dockrails](https://github.com/gmontard/dockrails):
        Simple CLI to Generate and Run a Rails environment with Docker (in Development) !

* [Homebrew / brew](https://github.com/Homebrew/brew):

🍺 The missing package manager for macOS

* [bayandin / awesome-awesomeness](https://github.com/bayandin/awesome-awesomeness):
        A curated list of awesome awesomeness

* [rails / rails](https://github.com/rails/rails):
        Ruby on Rails

* [jekyll / jekyll](https://github.com/jekyll/jekyll):

🌐 Jekyll is a blog-aware, static site generator in Ruby

* [github / github-ds](https://github.com/github/github-ds):
        A collection of Ruby libraries for working with SQL on top of ActiveRecord's connection

* [ruby / ruby](https://github.com/ruby/ruby):
        The Ruby Programming Language

* [kilimchoi / engineering-blogs](https://github.com/kilimchoi/engineering-blogs):
        A curated list of engineering blogs

* [gitlabhq / gitlabhq](https://github.com/gitlabhq/gitlabhq):
        GitLab CE | Please open new issues in our issue tracker on GitLab.com

* [Thibaut / devdocs](https://github.com/Thibaut/devdocs):
        API Documentation Browser

* [mitchellh / vagrant](https://github.com/mitchellh/vagrant):
        Vagrant is a tool for building and distributing development environments.

* [Tim9Liu9 / TimLiu-iOS](https://github.com/Tim9Liu9/TimLiu-iOS):
        iOS开发常用三方库、插件、知名博客等等

* [arbox / nlp-with-ruby](https://github.com/arbox/nlp-with-ruby):
        Practical Natural Language Processing done in Ruby.

* [stympy / faker](https://github.com/stympy/faker):
        A library for generating fake data such as names, addresses, and phone numbers.

* [doorkeeper-gem / doorkeeper](https://github.com/doorkeeper-gem/doorkeeper):
        Doorkeeper is an OAuth 2 provider for Rails.

* [comfy / active_link_to](https://github.com/comfy/active_link_to):
        View helper to manage "active" state of a link

* [discourse / discourse](https://github.com/discourse/discourse):
        A platform for community discussion. Free, open, simple.

repository: josephyzhou/github-trending

repo_name: josephyzhou/github-trending


text:
# PMI - use Prepare Method (Instantiation) to jit all methods in an assembly

PMI uses reflection to locate all the types in an assembly and all methods
each type. Then it calls `PrepareMethod` on each method in turn.

This gives us the ability to look at the code the jit will generate for a large
number of methods without needing to have test cases that call the methods. So
it is very useful for doing widespread jit-time testing and analysis of jit
codegen.

The methods jitted are not called, so PMI is not as useful for finding bugs in
the jit-generated code.

This initial commit is a preliminary port of the PMI tool we have developed for
.Net Framework testing. Over time we'll improve it and adapt it better for use
with .Net Core.

Improvements to come:
* proper subprocess launching for core
* integrated support for alt jits and/or alternate codegen modes
* jitting of methods in generic types
* jitting of generic methods
* support for corelib
* (possibly) the ability to fetch code via nuget
* integration into jit-diffs

license: MIT

repository: dotnet/jitutils

branch_name: refs/heads/main

extension: md

gha_language: C#

gha_license_id: MIT

license_type: permissive

repo_name: dotnet/jitutils


text:
# Program transformation

是在阅读 [Aspect Oriented Programming in C++ - Current supported alternatives](https://stackoverflow.com/questions/4200183/aspect-oriented-programming-in-c-current-supported-alternatives) # [A](https://stackoverflow.com/a/4331966) 时，发现的:

> Aspect-oriented programming is a just a special kind of program transformation ("*find places that match this condition ('pointcut') and do this to the code at that place*"). So, if you have a program transformation tool, you can emulate AOP pretty easily. To do transformation on C++ you need a strong C++ front end and as well as ability to transform and regenerate code. OpenC++ was a project to do C++ transformations, where the transformations are coded purely as procedural AST-walks with procedural AST modifications. A particular issue had to do with which dialect of C++ was handled by OpenC++; in particular, I'm not sure OpenC++ handled templates or full common dialects (GCC, MS) of C+; however I have no direct experience with it, just a keen aficionado of such tools.

看到了这段描述，我想到了 JavaScript [Babel (transcompiler)](https://en.wikipedia.org/wiki/Babel_(transcompiler)) ，现在想想，compiler所做的其实就是 program transformation。

## semanticdesigns [Program Transformation](http://www.semanticdesigns.com/Products/DMS/ProgramTransformation.html?Home=DMSToolkit)

## TODO

1、Google Logica

**Logica代码可以编译成SQL**

参见:

branch_name: refs/heads/master


text:
#Dawid's Dotfiles

 - I maintain this repo as *my* dotfiles.
 - You're quite welcome to make suggestions, however I may decline if it's not of personal value to me.
 - Based largely off of [paulirish/dotfiles][1], [mathiasbynens/dotfiles][2] and very possible other resources found online.

[1]: https://github.com/paulirish/dotfiles
[2]: https://github.com/mathiasbynens/dotfiles

repository: dawidvdh/dotfiles

repo_name: dawidvdh/dotfiles


text:
# hapi-friendly-errors

[![Coverage Status](https://coveralls.io/repos/github/firstandthird/hapi-friendly-errors/badge.svg)](https://coveralls.io/github/firstandthird/hapi-friendly-errors)

A small library for displaying very friendly errors in hapi.

## Installation

```
npm install hapi-friendly-errors
```

## Basic Usage

 Just register like a normal hapi plugin:

```js
await server.register({
  plugin: require('hapi-friendly-errors')
});
```

If you have a broken route like this:
```js
server.route({
  path: '/foobar',
  method: 'GET',
  handler(request, reply) {
    throw Boom.notFound('this is not foobar');
  }
});
```

when you fetch the _/foobar_ route, you will get back a 404 code with the following:

```html
<h1>There was an error</h1>
<h2>Not Found: this is not foobar</h2>
```

## Custom Views

hapi-friendly-errors will also work with your view engine if you want a custom error page.  For example
if you have a [handlebars](https://handlebarsjs.com/) template named _error-page_:

```html
<h1>Unfortunately You Have Encountered an Error</h1>

<b>Error</b>: {{error}}
<b>Reason</b>: {{message}}
<b>Additional Stuff</b>: {{protocol}}{{domain}}
```

```js
await server.register({
  plugin: require('hapi-friendly-errors'),
  options: {
    view: 'error-page'
  }
});
server.views({
  engines: { html: require('handlebars') },
  context: {
    protocol: 'http://',
    domain: 'foobar.com'
  }
});
```

Now fetching the _/foobar_ route will give:

```html
<h1>Unfortunately You Have Encountered an Error</h1>

<b>Error</b>: Not Found
<b>Reason</b>: this is not foobar
<b>Additional Stuff</b>: http://foobar.com
```

## JSON

hapi-friendly-errors will skip HTML and just return a JSON object when requests contain the _Accept: application/json_ header:
```js
{ statusCode: 403, error: 'Forbidden', message: 'Not Authorized' }
```

## Plugin Options

  You can pass these when you register the plugin

- __errorBlacklist__

  A regular expression passed as a string. Routes matching this regular expression will be ignored by hapi-friendly-errors

- __logErrors__

  When true will log output any time there is a 500 Server error.

- __url__

  You can also specify a local URL to render and return HTML errors, when this happens the statusCode, error and message will be passed as query parameters:

  ```js
  await server.register({
    plugin: require('hapi-friendly-errors'),
    options: {
      url: '/error'
    }
  });

  server.route({
    path: '/foobar',
    method: 'GET',
    handler(request, reply) {
      throw Boom.notFound('this is not foobar');
    }
  });

  server.route({
    path: '/error',
    method: 'GET',
    handler(request, h) {
      const query = request.query;
      return `
      <h1>An Error Handled by Route</h1>
      <b>Error</b> ${query.statusCode} ${query.error.}
      <b>Message</b> ${query.message}
      `;
    }
  });
  ```

  Now when you call the _/foobar_ route you will get back:
  ```HTML
  <h1>An Error Handled by Route</h1>
  <b>Error</b> 404 Not Found
  <b>Message</b> this is not foobar!
  ```

- __context__

  An object that will be merged with the context and passed to the rendering engine. If specified, _error_, _message_ and _statusCode_ will be overridden.
  ```js
  await server.register({
    plugin: require('hapi-friendly-errors'),
    options: {
      context: {
        data1: 'some more data',
        error: 'A Server Error'
      }
    }
  });
  ```

  Now errors will look something like:

  ```html
  <h1>There was an error</h1>
  <h2>A Server Error: this is not foobar</h2>
  ```

- __view__

  Name of the view to render, if not specified then view will default to:

  ```js
  `<h1>There was an error</h1><h2>${context.error}: ${context.message}</h2>`
  ```

repository: firstandthird/hapi-friendly-errors

gha_language: JavaScript

repo_name: firstandthird/hapi-friendly-errors


text:
# LuMutator
[![Build Status](https://travis-ci.com/ZhongXiLu/LuMutator.svg?token=8ED8fdyNhxKsYhegKEJg&branch=master)](https://travis-ci.com/ZhongXiLu/LuMutator)
[![](https://github.com/ZhongXiLu/LuMutator/workflows/Java%20CI/badge.svg)](https://github.com/ZhongXiLu/LuMutator/actions?query=workflow%3A%22Java+CI%22)

*A tool that expands tests to kill survived mutants*

```diff
Mutator: MathMutator (Replaced integer subtraction with addition)
src/main/java/bank/Bank.java:
  96                Customer toCustomer = customers.get(toCustomerId);
  97
  98                if (fromCustomer.getBalance() >= amount) {
! 99                    fromCustomer.setBalance(fromCustomer.getBalance() - amount);
  100                    toCustomer.setBalance(toCustomer.getBalance() + amount);
  101                    return true;
  102                }

src/test/java/bank/BankTest.java:
  58
  59        boolean success = bank.internalTransfer(customer1.getAccountNumber(), customer2.getAccountNumber(), balanceCustomer1);
  60
+ 61        assertEquals(0, customer1.getBalance());
  62        assertEquals(balanceCustomer1 + balanceCustomer2, customer2.getBalance());
  63    }
  64

(4/5) Add this new assertion? (Y/N):
```

## Download

Either visit the [releases page](https://github.com/ZhongXiLu/LuMutator/releases) to directly download the jar files or visit [packages page](https://github.com/ZhongXiLu/LuMutator/packages) to add the jar files to your `pom.xml`.

## How to use

### Using [PITest](http://pitest.org/)

1. First let PITest run the mutation analysis and generate the reports,
make sure there's a directory `/target/pit-reports` present afterwards.
```bash
mvn test -Dfeatures=+EXPORT org.pitest:pitest-maven:mutationCoverage
```
To include PITest into your project, add the following plugin in your `pom.xml`:
```xml
<plugin>
    <groupId>org.pitest</groupId>
    <artifactId>pitest-maven</artifactId>
    <version>1.4.7</version>
    <configuration>
        <outputFormats>XML</outputFormats>
    </configuration>
    <executions>
        <execution>
            <id>pitest</id>
            <goals>
                <goal>mutationCoverage</goal>
            </goals>
        </execution>
    </executions>
</plugin>
```

2. Set up the [config file](https://github.com/ZhongXiLu/LuMutator/releases/download/v1.0/config.xml) for LuMutator; a default one can be downloaded on the [releases page](https://github.com/ZhongXiLu/LuMutator/releases).

3. Now everything is ready to call LuMutator:
```bash
java -jar pitest-example-1.0.jar -c config.xml
```

### Using another mutation tool

Use the [`lumutator-core-1.0.jar`](https://github.com/ZhongXiLu/LuMutator/packages/57327) library to call LuMutator and pass the survived mutants. An example of how this is done can be found in the [`pitest-example` module](https://github.com/ZhongXiLu/LuMutator/tree/master/pitest-example/src/main/java/pitest-example).

## Publication

- [Z. X. Lu, S. Vercammen and S. Demeyer, "Semi-automatic Test Case Expansion for Mutation Testing," 2020 IEEE Workshop on Validation, Analysis and Evolution of Software Tests (VST), London, ON, Canada, 2020, pp. 1-7.](https://ieeexplore.ieee.org/abstract/document/9051637)

repository: ZhongXiLu/LuMutator

gha_language: Java

repo_name: ZhongXiLu/LuMutator


text:
---
layout: post
title:  "Leet759 Employee Free Time"
date:   2018-04-28 08:00:00
categories:  Heap Greedy Hard
tags: [ Airbnb ]
---

We are given a list `schedule` of employees, which represents the working time for each employee.

Each employee has a list of non-overlapping `Intervals`, and these intervals are in sorted order.

Return the list of finite intervals representing common, positive-length free time for all employees, also in sorted order.

Example 1:
```
Input: schedule = [[[1,2],[5,6]],[[1,3]],[[4,10]]]
Output: [[3,4]]
Explanation:
There are a total of three employees, and all common
free time intervals would be [-inf, 1], [3, 4], [10, inf].
We discard any intervals that contain inf as they aren't finite.
```
Example 2:
```
Input: schedule = [[[1,3],[6,7]],[[2,4]],[[2,5],[9,12]]]
Output: [[5,6],[7,9]]
```
(Even though we are representing `Intervals` in the form `[x, y]`, the objects inside are `Intervals`, not lists or arrays. For example, `schedule[0][0].start = 1`, `schedule[0][0].end = 2`, and `schedule[0][0][0]` is not defined.)

Also, we wouldn't include intervals like [5, 5] in our answer, as they have zero length.

Note:

1. `schedule` and `schedule[i]` are lists with lengths in range `[1, 50]`.
2. `0 <= schedule[i].start < schedule[i].end <= 10^8`.

Solution1: Sort and merge intervals then calculate idle intervals. Suppose `k` intervals with `n` length. Time complexity should be `O(knlogkn) - O(k*nlogn) = O(knlogk)`? Space complexity is `O(kn)`
{% highlight c++ %}
{% include leet759/leet759.cpp %}
{% endhighlight %}

Solution2: Use priority queue to store `pair<vector<Interval>::iterator,vector<Interval>::iterator>`. Time complexity: `O(nklogk)`, Space complexity: `O(k)`
{% highlight c++ %}
{% include leet759/leet759_2.cpp %}
{% endhighlight %}

repository: mingdaz/leetcode

repo_name: mingdaz/leetcode


text:
# STAGE: Surface Tiled Aerosol and Gaseous Exchange dry deposition option

**Author/P.O.C.:** [Jesse O. Bash](mailto:bash.jesse@epa.gov), Computational Exposure Division, U.S. EPA

This deposition option estimates fluxes from sub-grid cell fractional land uses and aggregates the fluxes to the model grid cell and unifies the bidirectional and unidirectional deposition schemes using the resistance model framework of Massad et al. 2010 and Nemitz et al. 2001. The MOSAIC option has been modified to work with this module to output the land use specific fluxes and deposition velocities. The following general changes to model processes and resistances have been made.

Bidirectional NH3 utilizes the widely used resistance model framework of Nemitz et al. 2001 with the cuticular resistance from Massad et al. 2010. Additionally, the nitrification rates are now estimated from EPIC model output as well as NH4 input from organic nitrogen mineralization.  Soil resistances were updated to be more consistent with the measurements that they were parameterized from. This included changing the maximum diffusive depth to be consistent with Kondo et al. 1990 and Swenson and Lawrence 2014.  Soil moisture at plow depth, 5 cm, is now estimated from gravitational draining rather than a weighted mean of the 0.01 m and 1 m soil layers. ABFLUX_MOD.F is now replaced with NH3_BIDI_MOD.F as the resistance model in STAGE now only needs the soil NH3 concentration and not a parallel resistance model.

The bidirectional Hg code was simplified and modified to provide soil, vegetation and water Hg concentrations and to integrate the fluxes from the STAGE model.

The form of the quasi boundary layer resistance has been changed to the leaf specific parameterization from Jensen and Hummelshoj 1995 and the quasi boundary layer resistance of soil parameterization from Nemitz et al. 2000. This form of quasi laminar boundary layer resistance for soil was previously used in the ABFLUX_MOD.F module and the parameterization of friction velocity at the soil surface was changed to be consistent with Yi 2008.

A new form of the in-canopy aerodynamic resistance was derived by integrating the in-canopy eddy diffusivity as parameterized by Yi 2008 from 0 to the full canopy leaf area index.

The parameterization of deposition to snow has been changed and it is now assumed that when snow is present it covers vegetation and soil thus eliminating the deposition pathways to those surfaces.

Ozone deposition to soil has been updated based on under canopy measurements Fares et al 2014 and Fumagalli et al. 20016. Here an asymptotic function was applied to set lower and upper bounds in the resistance as repoerted by Fumagalli et al. 2016.

The resistance to deposition to wet terrestrial surfaces was modified following Fahey et al. 2017 to be consistent with the AQCHEM-KMT2 aqueous parametrization this added an additional diffusive rate that occasionally becomes the limiting resistance when the surface is wet and the aerodynamic resistance is low.

The cuticular resistance of non-ionic organic species is now modeled similar to the processes involving the partitioning of semi-volatile gases to organic aerosols. Bulk leaf wax properties and composition are taken from the observations of Schreiber and Schoenherr 2009 and the vapor pressure or C* is used to estimate the partitioning following Raoult’s law this is then used to estimate a relative reactivity used for the cuticular resistance.

Aerosol deposition followed the changes in M3dry with the following changes. Aerosol impaction for vegetated surfaces is parameterized following Slinn 1982 for vegetated surfaces using the characteristic aerodynamic leaf radius for plant functional types from Zhang et al. 2001 and Giorgi 1986 for soil and water surfaces.  Aerosol deposition velocities are then estimated for both smooth and vegetated surfaces and area weighted by the vegetation coverage.

![Resistance](Resistance.model.png)

Figure 1: Resistance schematic for STAGE adapted from Massad et al. 2010 and Nimitz et al. 2001

## Significance and Impact

Ozone deposition increases for soil surfaces and forests during the summer due to the new soil resistance parameterization and in-canopy resistance respectively and decreases to snow surfaces. This generally results in a reduced model biases. This is particularly evident in the winter where the reduction to the deposition velocity to snow was large.

![O3_Bias](CMAQv521_Stage_Beta_O3_8hrmax_275594_spatialplot_bias_diff.png)
Figure 2: Change in the January through February 2011 O3 bias from CMAQ v5.2.1. Cool colors indicate a reduction in bias and warm colors indicate an increase. Biases and errors were reduced at 75.5% and 80.0% of AQS sites respectively.

The changes in the NH3 bidirectional exchange model increased NH3 concentrations in winter and the Western US and decreased the model overprediction in the East when using Fest-C 1.3 output for 2011.
A large reduction in the coarse mode aerosol deposition velocities tended to increase wet deposition fluxes throughout the year. This has generally reduced the model wet deposition biases.
The additional diffusive resistance in deposition to wetted surfaces results in lower maximum deposition velocities for soluble compounds. This impacts soluble species that participate in nighttime chemistry the most, e.g. N2O5, and results in higher concentrations.
The revised cuticular resistance for organics tends to reduce the deposition velocity of species with a vapor pressure greater than approximately 1.7e-8 atm and increase deposition velocities for lower vapor pressures. This results in deposition velocities that exhibit a similar relationship to vapor pressure as the gas aerosol partitioning in CMAQ. Organic aerosol concentrations were reduced by approximately 5% due to these changes on a CONUS 12km domain.

## Affected Files

CCTM/src/depv/stage/BIDI_MOD.F
CCTM/src/depv/stage/DEPV_DEFN.F
CCTM/src/depv/stage/HGSIM.F
CCTM/src/depv/stage/LSM_MOD.F
CCTM/src/depv/stage/MOSAIC_MOD.F
CCTM/src/depv/stage/NH3_BIDI_MOD.F
CCTM/src/depv/stage/STAGE_DATA.F
CCTM/src/depv/stage/STAGE_MOD.F
CCTM/src/depv/stage/gas_depv_map.F
CCTM/src/depv/stage/opdepv_diag.F
CCTM/src/depv/stage/opdepv_fst.F
CCTM/src/depv/stage/opdepv_mos.F
CCTM/src/vdiff/acm2_stage/ASX_DATA_MOD.F
CCTM/src/vdiff/acm2_stage/opddep.F
CCTM/src/vdiff/acm2_stage/opddep_fst.F
CCTM/src/vdiff/acm2_stage/opddep_mos.F
CCTM/src/vdiff/acm2_stage/vdiffacmx.F
CCTM/src/vdiff/acm2_stage/vdiffproc.F

## References

Fahey, K. M., Carlton, A. G., Pye, H. O. T., Baek, J., Hutzell, W. T., Stanier, C. O., Baker, K. R., Appel, K. W., Jaoui, M., and Offenberg, J. H.: A framework for expanding aqueous chemistry in the Community Multiscale Air Quality (CMAQ) model version 5.1, Geosci. Model Dev., 10, 1587-1605, 2017

Fares, S., Savi, F., Muller, J., Matteucci, G., Paoletti, E., Simultaneous measurements of above and below canopy ozone fluxes help partitioning ozone deposition between its various sinks in a Mediterranean Oak Forest, Agriculture and Forest Meteorology, Vol. 198-199, 181-191, 2014

Fumagalli, I., Gruening, C., Marzouli, R., Cieslik, S., Gerosa, G., Long-term measurements of NOx and O3 soil fluxes in a temperate deciduous forest, Agriculture and Forest Meteorology, Vol. 228-229, 205-216, 2016

Giorgi, F., A particle dry-deposition parameterization scheme for use in tracer transport models, Journal of Geophysical Research Atmopsheres, 91, D9, 9794-9806, 1986

Jenson, N.O. and Hummelshoj, P., derivation of canopy resistance for water vapor fluxes over a spruce forest, using a new technique for the viscous sublayer resistance, Agricultural and Forest Meteorology, 73(3-4), 339-352, 1995

Kondo, J., N. Saigusa, and T. Sato , A parameterization of evaporation from bare soil surfaces, Journal of Applied Meteorology, 29, 385–389, 1990

Massad, R.-S., Nemitz, E., and Sutton, M. A.: Review and parameterisation of bi-directional ammonia exchange between vegetation and the atmosphere, Atmos. Chem. Phys., 10, 10359-10386, 2010

Nemitz, E., Milford, C., and Sutton, M. A.: A two-layer canopy compensation point model for describing bi-directional biosphere-atmosphere exchange of ammonia, Q. J. Roy Meteor. Soc., 127, 815–833, 2001

Nemitz, E., Sutton, M. A., Schjoerring, J. K., Husted, S., and Wyers, G. P.: Resistance modelling of ammonia exchange over oilseed rape, Agr. Forest Meteorol., 105, 405–425, 2000

Schreiber, L., Schoenherr, J., Water and solute permeabilities of plant cuticles: measurements and data analysis, Springer, 299pp, 2009

Slinn, W.G.N., Predictions for particle deposition to vegetative canopies, Atmospheric Environment, 16(7), 1785-1794, 1982

Swenson, S.C. and Lawrence, D.M., Assessing a dry surface layer-based soil resistance parameterization for the Community Land Model using GRACE and FLUXNET-MTE data, Journal of Geophysical Research Atmospheres, 119, 10299-10312, 2014

Yi C., Momentum transfer within canopies, Journal of Applied Meteorology and Climatology, 47, 262-275, 2008

-----
## Internal Records:
#### Relevant Pull Requests:
[PR #340](https://github.com/USEPA/CMAQ_Dev/pull/340)
[PR #345](https://github.com/USEPA/CMAQ_Dev/pull/345)
[PR #361](https://github.com/USEPA/CMAQ_Dev/pull/361)
[PR #368](https://github.com/USEPA/CMAQ_Dev/pull/368)
[PR #370](https://github.com/USEPA/CMAQ_Dev/pull/370)
[PR #375](https://github.com/USEPA/CMAQ_Dev/pull/375)
[PR #385](https://github.com/USEPA/CMAQ_Dev/pull/385)
#### Commit
IDs: 2add0b1fb7fd8538718736ee3c9c7c7b51c63ca8
IDs: 4810f5870162c495843e5af393345184d656b661
IDs: 07c80ada44967bd5e964190d32512bb8496de5aa
IDs: 525e175f52a6d87d1f3d9e03179206016cc15946
IDs: 11259eb91aaaedca9dadf5ca2c93361a8017745f
IDs: b8e9f4685c930338e887b2291865c6c1f17652cc
IDs: ba4e413d4f38bb332e468df6bfaa8437f5910b60

-----

repository: rcboykin/CMAQ

repo_name: rcboykin/CMAQ


text:
## To Reproduce:

## Install wksctl binary

1. Download the OS specific `wksctl` release package from the [release page](https://github.com/weaveworks/wksctl/releases)
1. Unpack and add the `wksctl` binary to your path

For example:

```console
cd <download dir>
tar xfz wksctl-0.8.3-linux-x86_64.tar.gz
chmod +x wksctl
sudo mv wksctl /usr/local/bin/
```

## Install prerequisites

The following steps will create a wksctl cluster on GCE VMs. For other deployment options, please refer to the examples in our [documentation](https://wksctl.readthedocs.io/en/latest)

1. Install:
    - [`gcloud`](https://cloud.google.com/sdk/docs/#install_the_latest_cloud_tools_version_cloudsdk_current_version)
    - [`jk`](https://github.com/jkcfg/jk)
    - [`direnv`](https://direnv.net/)

1. [Configure `gcloud`](https://cloud.google.com/sdk/gcloud/#configurations).

1. If you have never used direnv, you need to [set it up](https://github.com/direnv/direnv#setup).
   It hooks itself into your shell to set/unset environment variables when you
   enter or leave a directory.

   ```console
   eval "$(direnv hook bash)"
   ```

1. Create an `.envrc` file with, for example, the following content (or change to appropriate values where relevant):

    ```console
    export project="wks-tests"
    export zone="europe-west1-b"
    export user="$(whoami)"
    export network="${user}-demo"
    export image_project="centos-cloud"
    export image_family="centos-7"
    export network_interface="eth0"
    ```

    (see also: [GCP images](https://cloud.google.com/compute/docs/images#images_without_shielded_vm_name_support))
    and run:

    ```console
    direnv allow
    ```

## Create the WKS cluster

1. Create the GCE network and instances:

    ```console
    ./create-network.sh && ./create-instances.sh
    ```

    > **Note:** In case cluster capacity for number of instances is reached, try using another zone in `.envrc`.

1. Generate `machines.yaml`:

    ```console
    ./generate-machines-manifest.sh
    ```

1. Create & configure the WKS cluster:

    ```console
    wksctl apply
    ```

1. Generate the kubeconfig file

    ```console
    wksctl kubeconfig
    ```

    This will print a line to the console similar to `$ export KUBECONFIG=/[path to kubeconfig file]`.  Copy that line and paste it into any terminal you are using `kubectl` in.

1. Ensure that everything's working:

    ```console
    kubectl get namespaces
    ```

    should return something like

    ```console
    NAME          STATUS   AGE
    default       Active   1m59s
    kube-public   Active   1m59s
    kube-system   Active   1m59s
    system        Active   1m54s
    ```

## Run sonobuoy conformance tests

Ensure you have installed the sonobuoy binary, steps from the [instructions on github](https://github.com/vmware-tanzu/sonobuoy#installation):

1. Download the latest release of sonobuoy for your client platform.

1. Extract the tarball:

    ```console
    tar -xvf <RELEASE_TARBALL_NAME>.tar.gz
    ```

1. Move the extracted sonobuoy executable to somewhere on your PATH.

1. Run the certified-conformance tests:

    ```console
    sonobuoy run --wait --mode certified-conformance
    ```

1. Once finished, retrieve and inspect the results:

    ```console
    results=$(sonobuoy retrieve)
    sonobuoy results $results
    ```

## Delete the WKS cluster

To delete your WKS cluster, run:

```console
./delete-instances.sh && ./delete-network.sh
```


text:
# Changelog

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.0.4](https://github.com/Availity/sdk-js/compare/@availity/dockyard@1.0.3<EMAIL_ADDRESS>(2023-08-23)

# 1.0.0 (2023-08-23)

### Bug Fixes

* add browser field for output ([0ce7170](https://github.com/Availity/sdk-js/commit/0ce717075a82675b8707e4db0cc07cd4af370f3d))
* **dockyard:** deep object definitions ([f4a699b](https://github.com/Availity/sdk-js/commit/f4a699bba8afa9aa88ed791a99a34671aa354b35))
* **dockyard:** handle undefined required subfields ([38095a9](https://github.com/Availity/sdk-js/commit/38095a95fd64da862045a215b99d4297a0076506))
* **dockyard:** support includeTypes ([f30f064](https://github.com/Availity/sdk-js/commit/f30f0647387a5d137b86e3fb00b6d5eb7e34c02f))
* **dockyard:** top-level fields that do not have subFields ([0851c0b](https://github.com/Availity/sdk-js/commit/0851c0be17b1928833a62247cdd78d02406aac2b))

* build!: switch from lerna to nx and compile to esm with tsup ([c586085](https://github.com/Availity/sdk-js/commit/c5860856ca96b743a0653d335ea00f0889132f7f))

### Features

* **dockyard:** convert yup schema to friendly docs object ([ac4726d](https://github.com/Availity/sdk-js/commit/ac4726dbde353e03410960e220337c313df6e15e))

### BREAKING CHANGES

* Drop Internet Explorer support

## [1.0.3](https://github.com/Availity/sdk-js/compare/@availity/dockyard@1.0.2<EMAIL_ADDRESS>(2022-06-15)

## [1.0.2](https://github.com/Availity/sdk-js/compare/@availity/dockyard@1.0.1<EMAIL_ADDRESS>(2022-05-24)

## [1.0.1](https://github.com/Availity/sdk-js/compare/@availity/dockyard@1.0.0<EMAIL_ADDRESS>(2022-04-28)

### Bug Fixes

* add browser field for output ([0ce7170](https://github.com/Availity/sdk-js/commit/0ce717075a82675b8707e4db0cc07cd4af370f3d))

# [1.0.0](https://github.com/Availity/sdk-js/compare/@availity/dockyard@1.0.0-alpha.3<EMAIL_ADDRESS>(2022-04-28)

* build!: switch from lerna to nx and compile to esm with tsup ([c586085](https://github.com/Availity/sdk-js/commit/c5860856ca96b743a0653d335ea00f0889132f7f))

### BREAKING CHANGES

* Drop Internet Explorer support

# 1.0.0-alpha.3 (2021-12-21)

**Note:** Version bump only for package @availity/dockyard

# 1.0.0-alpha.2 (2021-11-02)

### Bug Fixes

* **dockyard:** handle undefined required subfields ([38095a9](https://github.com/Availity/sdk-js/commit/38095a95fd64da862045a215b99d4297a0076506))

# 1.0.0-alpha.1 (2021-10-29)

### Bug Fixes

* **dockyard:** deep object definitions ([f4a699b](https://github.com/Availity/sdk-js/commit/f4a699bba8afa9aa88ed791a99a34671aa354b35))
* **dockyard:** support includeTypes ([f30f064](https://github.com/Availity/sdk-js/commit/f30f0647387a5d137b86e3fb00b6d5eb7e34c02f))
* **dockyard:** top-level fields that do not have subFields ([0851c0b](https://github.com/Availity/sdk-js/commit/0851c0be17b1928833a62247cdd78d02406aac2b))

### Features

* **dockyard:** convert yup schema to friendly docs object ([ac4726d](https://github.com/Availity/sdk-js/commit/ac4726dbde353e03410960e220337c313df6e15e))

repository: Availity/sdk-js

repo_name: Availity/sdk-js


text:
---
id: p005_call_tracing
title: Call Tracing for Troubleshooting
hide_title: true
---

# Tracing Support

*Status: In review*
*Feature owner: @andreilee*
*Feedback requested from: @amarpad, @xjtian, @karthiksubraveti*
*Last Updated: 10/21*

## Summary

As a general purpose debugging tool, a tracing tool will be added for
understanding control messaging flow through a Magma access gateway.

## Motivation

Example use cases include the following:

### Subscriber Tracing

When issues are experienced by a subscriber on the network, network operators
would like to have a tool which allows them to see the messages between the UE,
eNodeB, and Magma components relating to the subscriber. This feature already
exists for other NMS tools. Ideally, this capture should be a packet capture to
fit with existing workflows using Wireshark. Wireshark has features to decode
and display relevant messages for Gx, Gy, S1AP, TR-069, etc., as well as
plugins to support decoding and viewing gRPC messages which are passed between
Magma gateway components.

### Protocol Tracing

Operators would like to be able to capture traces for specific protocol stacks,
such as SCTP or DIAMETER. This could be used for troubleshooting specific
integrations.

## Goals

- Allow network operators to trace the control plane messaging for a subscriber
- Allow network operators to trace control plane messaging for a specific
protocol or interface
- Allow call trace captures to started and stopped from the NMS
- Allow call trace captures to be filtered by subscriber/protocol/interface
control plane messaging

As an additional criteria which is not necessary, call trace captures should
be viewable in Wireshark.

## Implementation Phases

The implementation will be done in two phases.

### Phase 1 - MVP

(October - November 27)

The first phase of implementation will focus on bringing an MVP. Call traces
will be able to be initiated from the NMS, and downloads of captures viewable
through Wireshark after capture will be available.

### Phase 2 - Call Trace Filtering

(December - January)

In the second phase, features will be provided for filtering call traces by
subscriber, protocol, or interface.

## Phase 1

### User Flow

For call tracing with Magma, we will provide the following user flow:

1. User accesses NMS
2. User selects either the gateway or subscriber that they would like to do
call tracing for
3. User starts the call trace
4. After a timeout, or by user control, the call trace stops
5. The call trace will be provided as a download to the user

### Design

#### Orchestrator - API

The API supports starting the call trace, ending the tracing session, and
downloading the resulting capture.

The API will be as follows:

```text
GET      /networks/{network_id}/tracing/{trace_type}/{trace_id}
POST     /networks/{network_id}/tracing/{trace_type}/{trace_id}
PUT      /networks/{network_id}/tracing/{trace_type}/{trace_id}
DELETE   /networks/{network_id}/tracing/{trace_type}/{trace_id}

GET      /networks/{network_id}/tracing/{trace_type}/download/{trace_id}
```

To use call tracing via the REST API, the following steps should be followed.

To begin a call trace, the POST endpoint should be called to create a
`call_trace` resource. During this time, the type of call trace should be
specified, along with timeout, and the `trace_id`.

To end a call trace, either the user can wait for the timeout, or to manually
end the call trace, the PUT endpoint can be called, specifying `requested_end`
as `true`.

To download the call trace, the GET endpoint should return whether the call
trace has ended and is ready to download, and if it is, will return the
download URL.

```yaml
definitions:
  call_trace:
   description: Mutable Call Trace
   type: object
   required:
     - trace_id
     - config
   properties:
     trace_id:
       type: string
       x-nullable: false
       example: "pair1"
     config:
       $ref: call_trace_config
     state:
       $ref: call_trace_state

  mutable_call_trace:
   description: Mutable Call Trace
   type: object
   required:
     - trace_id
     - config
   properties:
     trace_id:
       type: string
       x-nullable: false
       example: "pair1"
     requested_end:
       type: boolean
     config:
       $ref: call_trace_config

  call_trace_config:
    type: object
    description: Call Trace spec
    required:
      - type
    properties:
      trace_type:
        type: string
        x-nullable: false
        enum:
          - 'GATEWAY'
          - 'SUBSCRIBER'
          - 'PROTOCOL'
          - 'INTERFACE'
      imsi:
        type: string
      protocol:
        type: string
      interface:
        type: string
      timeout:
        type: integer
        format: uint32
        description: Timeout of call trace in seconds

  call_trace state:
    type: object
    description: Full state object of a call trace
    properties:
      call_trace_available:
        type: boolean
```

#### Orchestrator - ctraced

On the gateway, the ctraced service will manage call tracing for the network.
This service will be responsible for initiating call tracing sessions on
gateways, and servicing downloads of call trace captures.

Call traces will be stored in postgresql, and periodically, ctraced should
delete old traces. Traces will expire after a week, and so a cronjob will be
responsible for deleting old traces. This setting will be configurable.

#### Orchestrator - Trace storage

Storage of call trace captures will be done in postgresql, stored as binary
data. A new table will be created for storage of call traces.

A migration script is required to ensure that existing deployments will get
this new table for storing call traces.

#### Gateway - ctraced

The ctraced service on the gateway will be a new service, responsible for
managing call tracing. Options will be provided for gateway wide
packet-capture, and later on, options will be provided for protocol, interface,
or subscriber specific call tracing.

```grpc
service CallTraceService {
  rpc StartCallTrace (StartTraceRequest) returns (StartTraceResponse) {}

  rpc EndCallTrace (EndTraceRequest) returns (EndTraceResponse) {}
}

message StartTraceRequest {
  enum TraceType {
    ALL = 0;
    SUBSCRIBER = 1;
    PROTOCOL = 2;
    INTERFACE = 3;
  }

  TraceType trace_type = 1;
  // IMSI specified only if trace_type is SUBSCRIBER
  string imsi = 2; // Include prefix 'IMSI'

  enum ProtocolName {
    SCTP = 0;
    DIAMETER = 1;
  }
  // Protocol name specified only if trace_type is PROTOCOL
  ProtocolName protocol = 3;
  enum InterfaceName {
    S1AP = 0;
    GX = 1;
    GT = 2;
  }
  // Interface name specified only if trace_type is INTERFACE
  InterfaceName interface = 4;
}

message StartTraceResponse {
  bool success = 1; // May fail due to an existing tracing session
}

message EndTraceRequest {}

message EndTraceResponse {
  bool success = 1; // May fail due to no existing tracing session
  bytes trace_content = 1; // Max size of 4MB
}
```

To perform call tracing, ctraced will use `tshark`, a terminal-based wireshark
tool to do packet capture on the gateway. This will be installed as a
provisioning step on the gateway.

Call tracing will be initiated from the orc8r, and the packet-capture will be
transferred back to orc8r from AGW via gRPC. Currently there is a limit for
gRPC message sizes to 4MB, which limits the size of packet capture. Given that
the packet capture should filter out data plane traffic, this should be
sufficient for short tracing sessions, for an MVP.

#### NMS - Interface

A new section will be added to the NMS to initiate call traces,
see past call traces, and download them.

---

## Phase 2

### User Flow

Phase 2 user flow will be the same from the user interface. The differentiation
will be in the call trace provided to the operator, which will have its tracing
information filtered by the specified subscriber.

1. User accesses NMS
2. User options of the trace: protocol, interface, and subscriber/gateway
3. User starts the call trace
4. After a timeout, or by user control, the call trace stops
5. The call trace will be provided as a download to the user

### Gateway - ctraced

The ctraced service will need to be modified to filter messages. For protocols
including S1-AP or interfaces like Gx, tshark will be used to filter for the
relevant subscriber, protocol, or interface.

For gRPC messages, tshark does not provide features to filter.
Separate gRPC tracing will need to be implemented, and from this separate gRPC
trace, ctraced will filter for relevant messages. Together with the packet
capture acquired through tshark, these two traces will be provided for download
to the user.

### Tracing Options

Tracing will be able to be filtered for the following interfaces:

- S6a
- Gx
- Gy

Or for the following protocols:

- S1-AP
- Diameter Credit-Control Application
- TR-069

repository: magma/magma

gha_license_id: NOASSERTION

repo_name: magma/magma


text:
---
published: true
tags: 'javascript, coding-journey, walkthrough'
---
So, it's been a crazy month and I haven't had the chance to get on here and give you guys an update recently. There were doctors and dogs and Dungeons and Dragons games. It was interesting, and stressful, to say the least. I did manage to keep coding while I was gone, though.

Learning something new is always fun. It is also challenging- honestly, that's part of the fun- and sometimes anxiety inducing. When you have anxiety to begin with, anything can be anxiety inducing, but new things, no matter how fun, are especially stressful. It's not that it was hard to start, there are tons of resources out there for learning Javascript. Great resources from straight documentation like [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript) to interactive tutorials like [Free Code Camp](https://www.freecodecamp.org/) and, of course, the never ending list of YouTube tutorials.

All those sources can be a bit overwhelming. How do you know where to start? Do you start with theory or practice? How much theory is enough theory before starting a project? Do you really have to do a To Do List as your first project?

You don't, but I did anyway. Everyone does a To Do List as their first project. It's a good place to start, uses the HTML and CSS basis and the JavaScript basics you learn from the get go. After a little bit of theory from FreeCodeCamp and Mozilla I decded it was time to put the theory to work and the best way to do that was to build the ubiquitous To Do List.

With how common this project is, there are what seems to be a never ending list of tutorials for it, a million choices on what to follow. So, of course, I decided to do mine from scratch on my own. Mostly. Well, the Javascript part, anyway. The HTML and CSS I basically took from [W3Schools To Do List Tutorial](https://www.w3schools.com/howto/howto_js_todolist.asp), with a few slight changes.

I added just enough JavaScript to get it working to the minimum requirements- adding and checking off items. I'll keep building on to the code as I learn more JavaScript. For now, you can take a look at what I have so far [here](https://codepen.io/sjcswank/pen/YMZbLP). It's pretty basic.

The HTML is minimal, just a header, text input, an add button, and a blank list for the to-do items. The most important part was putting in ids on each of the elements so that I could pull them into the JavaScript later. For the CSS, There are only a few basic concepts, the header and inputs, the list items when first added, and the list items when checked off. It looks more complex than it actually is. Again, I mostly took those elements from W3Schools.

The JavaScript, though, that I wrote myself. I figured following a single tutorial straight through would be cheating, since it's JavaScript I'm trying to practice. So I watched and read several and put together a simplist version of a to do list I could manage.

There's only two parts to this todo list's functionality: adding items to the list, and checking off completed items. So, there's only two functions in the Javascript: addTodoListItem() and boxChecked().

Adding items takes just a few steps, type in the name of the item, click the add button, show the item in the to do list. I added the ids to the input, button and list so that I could later use them in the JavaScript.

    <input type="text" id="input" placeholder="Enter todo list item">
    <button id="btnAdd" type="submit" class="btn">Add</button>

In the JavaScript you can find an element by it's id, which is always unique to each element, and assign it to a variable so you can do actions on it. I needed to do this for the input, the button, and the list, as I needed to use all of those elements for the functionality. To begin with, I needed to pull in the value of the input so that I can add it to the to-do list. I will also need to use the button and the list later on so I assigned them all to variables at the start. One last vairable I will need is an id number for the newly created list items.

    var input = document.getElementById("new");
	var btnAdd = document.getElementById("btnAdd");
	var list = document.getElementById("list");
    var id = 1;

To add an item to the to-do list, once the add button has been clicked, I needed to create an html element with the value of the input included and then tack it on to the current unordered list. I also had to verify that the input is actually there and I'm not creating a blank item. The first step is to figure out when the button has been clicked.

In JavaScript there is a function that picks up when the user interacts with an element on the webpage called an event listener. An action and a function to call are passed as paramaters to the creating function. For the add button, the action I am looking for is a click, and the function to call is the function I wrote to add an item to the list. Once the event listener was added I could move on to writing the actual function to add the list item.

    //add event listener to btnAdd
	btnAdd.addEventListener("click", addTodoListItem);

    //add todo item to list
	function addTodoListItem() {
		//check for valid input
		if(input.value === "") {
			alert("You must enter some value!");
		}
		//create li with unique id
		let text = input.value;
		let item = `<li id="li-${id}">${text}<input id="box-${id}" class="checkboxes" type="checkbox"></li>`;
        //add li to ul
		list.insertAdjacentHTML('beforeend', item);
        //increment the id number for the next item
		id++;
        //reset the input field
		input.value = "";
	}

The second part of the list functionality is being able to check off items on the list. Again, I needed an event listener on the list item so when it is clicked I could call the check function. The check function needed to do only one thing: change the style of the list item so it looks checked off. I'd already created the CSS for the checked list items so it was a simple matter of adding the right class to the list item element.

    //add event listener to list
	list.addEventListener("click", boxChecked);

    //add strike through style to checked items
	function boxChecked(event) {
		const element = event.target;
        //check if element click was the checkbox and not just the item
		if (element.type === "checkbox"){
        	//add the checked class to the list item (parent of the check box)
			element.parentNode.classList.add("checked");
            //hide the check box
			element.style.display = "none";
		}
	}

Once those two functions were completed I decided to call it quits for the night. I intend to add more functionality to this as I practice more JavaScript. I also intend to make it look a little better as I go. For now, it works. I can add an item, I can see what items I've done. There is something just so satisfying about seeing what you've checked off your list. I'm not concerned with removing those items yet, because I want to see them! Next, though, I'll add that functionality to keep things from getting messy or overwhelming.

I'll come back with more about this to-do list when I update it again. Should be fairly soon. I haven't forgotten about the Strings and Things challenge, either! More solutions for that are coming soon as well! Until then,

Thanks for reading, and Happy Coding!


text:
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/)
[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)

# argoverse-kitti-adapter
A toolbox to translate [Argoverse dataset (CVPR2019)](https://www.argoverse.org/data.html) into [KITTI dataset (CVPR2012)](http://www.cvlibs.net/datasets/kitti/) format for perception/tracking tasks.

 - Author: Yiyang Zhou
 - Contact<EMAIL_ADDRESS>
## Introduction
This toolbox is to translate Argoverse dataset from CVPR2019 into the KITTI dataset format. The major changes are:
1. Changing labels from the .json files into the .txt file format (15 columns) used in KITTI dataset;
2. Reconfigure the calibration files from the .json files per log into .txt file format per image/lidar scan;
3. Copying related image files and lidar files to form the corrsponding data structure used in KITTI perception tasks;

## Usage
### 1. Download Data
- Please download the most recent [argoverse dataset](https://www.argoverse.org/data.html). Once the data is downloaded, it is convenient to put all the training logs under one training folder. Please do not change any contents under the individual log folder. Here is a document tree as an illustration:
```
argodataset
└── argoverse-tracking <----------------------------root_dir
    └── train <-------------------------------------data_dir
        └── 0ef28d5c-ae34-370b-99e7-6709e1c4b929
        └── 00c561b9-2057-358d-82c6-5b06d76cebcf
        └── ...
    └── validation
        └──5c251c22-11b2-3278-835c-0cf3cdee3f44
        └──...
    └── test
        └──8a15674a-ae5c-38e2-bc4b-f4156d384072
        └──...
```
### 2. Download Argoverse Repo
- To use the toolbox, please follow the instructions in the [argoverse github repository](https://github.com/argoai/argoverse-api/tree/16dec1ba51479a24b14d935e7873b26bfd1a7464) to install the corrsponding python API.

### 3. Clone the Argoverse-kitti-adapter Repo
'''git clone https://github.com/yzhou377/argoverse-kitti-adapter.git'''
- Once the data and the API are well equipped, please open the 'apater.py' file for changing your root_dir (the directory to your argoverse-tracking folder). The toolbox will automatically construct a new folder (train_kitti) for you. The new file structure is shown as below:

```
argodataset
└── argoverse-tracking <----------------------------root_dir
    └── train <-------------------------------------data_dir
        └──5c251c22-11b2-3278-835c-0cf3cdee3f44
        └──...
    └── train_kitti <-------------------------------goal_dir
        └──velodyne
        └──iamge_2
        └──calib
        └──label_2
        └──velodyne_reduced <-----------------------empty folder
    └── ...
```

### 4. Change Hyperparameters
- On the top of the adapter.py file, please change the root directory and the distance threshold.

### 5. Run the Adapter
- After changing the configruation file, please run the adapter.py file using the following commands
"""python adapter.py"""

## Note
1. Frequency and Sychronization
- In KITTI, the camera and the LIDAR are synchronized at 10Hz. However, in Argoverse, the ring cameras are running at 30Hz, while the LIDAR is running at 10Hz. To fully realize the KITTI dataset format, we match each LIDAR scan with the corresponding camera at the closest timestamp. As a result, the sensor combo in the modified KITTI version of Argoverse is still running at 10Hz.
2. Multi-camera
- In KITTI dataset, each image is matched up with one LIDAR scan, one label file, and one calibration document. However, in Argoverse, seven images share one LIDAR scan, and one log only has one single label/calibration combo. Using only the ring cameras, the LIDAR file is copied 7 times to match with each image, and corresponding label/calibration files are generated as well.
3. Labelling File Clips
- KITTI only labels the object in the view of the front camera, while Argoverse, given its panoramic nature, labels all the obstacles around the object. Thus, for each associated labelling file, if the object is not seen in this specific image, then it is not labelled. Furthermore, objects that are too small (beyond 50m) were not labelled. One can cetrainly change this threshold in the ['apater.py'](https://github.com/yzhou377/argoverse-kitti-adapter/blob/master/adapter.py).  [Here](https://github.com/yzhou377/argoverse-kitti-adapter/blob/master/supplementals/KITTI_README) attaches the KITTI label README file . For the Argoverse label file, please go check the [Argoverse github](https://github.com/argoai/argoverse-api/tree/16dec1ba51479a24b14d935e7873b26bfd1a7464)
4. Calibration File
- To match the KITTI calibration file, the tool is designed to combine the 'R0_rect' matrix together with the 'P2' matrix to form intrinsic matrix 'K' of the  camera. In the new label file, 'R0_rect' is set to be an identity matrix, while 'P2' contains all the intrinsics.

## Reference
- [1] M. Chang et al., Argoverse: 3D Tracking and Forecasting with Rich Maps, CVPR2019, Long Beach, U.S.A
- [2] A. Geiger et al., Are we ready for Autonomous Driving? The KITTI Vision Benchmark Suite, CVPR2012, Rhode Island, U.S.A

repository: monghimng/argoverse-kitti-adapter

repo_name: monghimng/argoverse-kitti-adapter


text:
---
title: Massage Establishment Licence- Employee Registration
permalink: /browse-all-licences/Singapore-Police-Force-(SPF)/Massage-Establishment-Licence--Employee-Registration
third_nav_title: Singapore Police Force (SPF)
---

## Apply for Massage Establishment Licence- Employee Registration

Singapore Police Force (SPF)

{% include spcp-text.html type="cp" %}

{% include button.html text="Apply on GoBusiness Licensing" src="https://licence1.business.gov.sg/feportal/web/frontier/eAdvisor?redirection=true&selectedLicenceIds=44" type="primary" %}

Application Details

Under the Massage Establishments (ME) Act, the licensee of a licensed ME(Cat I, Cat II and Provisional Cat I) is required to seek the prior approval of the Licensing Officer before the employee is allowed to work in the Massage Establishment.

FAQ

    Where can I get more information for Massage Establishment Licence - Employee Registration?

More information can be found at the
SPF website

    Who can be an applicant?

If you have just updated ACRA for any changes related to your Company's name or staff listing, Please allow for at least a day before you submit any application in LicenceOne with relation to these changes. This waiting time is required to get the updates synced for LicenceOne system verification.

Entity Type:

Limited Liability Partnership

Eligibility Criteria:

Applicant must be having position:

* PARTNER cum MANAGER

Entity Type:

Company

Eligibility Criteria:

Applicant must be having one of the following position:

* MANAGING DIRECTOR

* SECRETARY

* DIRECTOR

* CHIEF EXECUTIVE OFFICER

Entity Type:

Business (Sole Proprietor/Partnership)

Eligibility Criteria:

Applicant must be having one of the following position:

* OWNER

* AUTHORIZED REPRESENTATIVE

Entity Type:

LP

Eligibility Criteria:

Applicant must be having one of the following position:

* GENERAL PARTNER

* LIMITED PARTNER

    What are the supporting documents that needs to be submitted?

If the employee is not a Singapore Citizen or Singapore Permanent Resident, a copy of the employee's work pass must be submitted together with the application via GoBusiness Licensing.

If the employee is applying to be a qualified masseuse/therapist, a copy of the relevant recognised certification must be submitted together with the application via GoBusiness Licensing.

Applications submitted without all the relevant supporting documents will be rejected.

    Can I submit my application if I do not have all the required supporting documents at the point of application?

No, all applications submitted with incomplete or incorrect supporting documents will be rejected immediately.

    Do I have to pay the application fees again for the resubmission of the application if my application is rejected?

Applicants will be required to pay any application fees payable for all resubmission of applications.

Documents Needed

A copy of the employee's work pass
If the employee is not a Singapore Citizen or Singapore Permanent Resident, a copy of the employee's work pass must be submitted together with the application via GoBusiness Licensing.

A copy of the relevant recognised certification
If the employee is applying to be a qualified masseuse/therapist, a copy of the relevant recognised certification must be submitted together with the application via GoBusiness Licensing.

Requirements

Limited Liability Partnership
Applicant must be having position:
* PARTNER cum MANAGER

Company
Applicant must be having one of the following position:
* MANAGING DIRECTOR
* SECRETARY
* DIRECTOR
* CHIEF EXECUTIVE OFFICER

Business (Sole Proprietor/Partnership)
Applicant must be having one of the following position:
* OWNER
* AUTHORIZED REPRESENTATIVE

LP
Applicant must be having one of the following position:
* GENERAL PARTNER
* LIMITED PARTNER

repository: isomerpages/govtech-gobusiness

branch_name: refs/heads/staging

gha_language: HTML

repo_name: isomerpages/govtech-gobusiness


text:
Chapter IV : Software Design
==============================

## System Architecture

The application was developed using the following architecture :

\begin{figure}[H]
\centering
\caption{System Architecture}
\includegraphics[scale=0.7]{imgs/system-archi.png}
\end{figure}

\rightline{{\rm --- From frontbackend.com}}

The system is made of three components :

   - The backend Spring Boot application as a REST API to be consumed by the Angular application.
   - The frontend Angular application as the client side of this whole system.
   - The PostgreSQL database used by the API.

## Backend Architecture

\begin{figure}[H]
\centering
\caption{Backend REST API Architecture}
\includegraphics[scale=0.6]{imgs/spring-archi.png}
\end{figure}

\rightline{{\rm --- From petrikainulainen.net}}

### Technology stack

- Language : JAVA 15
- Web Framework: Spring Boot
- Build Tool : Maven

    **Database :**

    - DBMS : PostgreSQL
    - ORM : Hibernate
    - Migrations : Flyway

### Why Java ?

  - Java Ergonomics

The craftsmanship of JetBrains makes Java really easy to use. Most java features are autocompleted, jump to java
doc is really fast, method and class refactoring is done efficiently. However, I gravitated towards Java because
I wanted a good and efficient developer experience with third-party libraries. When consuming third-party
libraries in Java, you always know exactly what types are needed for a method but most importantly, an incorrect
usage of the latter will result into a compilation error.

  - Nominal Typing

On of the reasons a dynamic typed language wasn't chosen is because I wanted my application to fail at compile
time rather than at runtime upon a change in a third-party method. It's completely a waste of time when you have
to refer back to the implementation of a method to figure out which type(s) to pass it.

The typed version of Javascript called TypeScript somehow solves this problem, but still lack the ability to validate
passed types at runtime without extra code. You have to implement yourself typing/interfaces for you to have some
type safety in your application.

## Frontend Architecture

The Angular application was developed using the following architecture:

\begin{figure}[H]
\centering
\caption{Frontend Architecture}
\includegraphics[scale=0.24]{imgs/angular-archi.jpeg}
\end{figure}

\rightline{{\rm --- From tomastrajan.medium.com}}

### Technology stack

- Language : TypeScript
- Framework: Angular 10
- Build Tool : NPM
- CSS Library: PrimeNG

path: /docs/tfe report/src/07_design.md


text:
# How does Light Framework validate request based on the JSON schema on server side?

## Overview
Most update APIs to the Light Framework are utilizing [React Schema Form](https://github.com/networknt/react-schema-form)
to collect data from Browser. JSON schema is part of the schema form so the data from browser have been validated by the
schema form before sending to the server; however, we cannot trust the browser side validation as it is easily
manipulated.

## Shared schemas
Each API on Light Framework maps to a Java class that implements Rule interface. For the rules that
are associated with schema forms, the validation schema will be loaded from schema forms automatically.

Here is the code in impForm to update rule schema and remove the rule from the cache.
```
    // According to action in the list, populate validation schema.
    List<Map<String, Object>> actions = form.getProperty("action");
    for(Map<String, Object> action: actions) {
        String ruleClass = Util.getCommandRuleId(action);
        Vertex rule = graph.getVertexByKey("Rule.ruleClass", ruleClass);
        if(rule != null) {
            rule.setProperty("schema", data.get("schema"));
            Map<String, Object> ruleMap = ServiceLocator.getInstance().getMemoryImage("ruleMap");
            ConcurrentMap<String, Map<String, Object>> cache = (ConcurrentMap<String, Map<String, Object>>)ruleMap.get("cache");
            if(cache != null) {
                cache.remove(ruleClass);
            }
        }
    }

```

## Validation
Server side schema validation is done in RestHandler

repository: Arsalaan-Hameed/light

repo_name: Arsalaan-Hameed/light


text:
# vim-easyreplace

Replace the substitute mode launched with the `c` flag (as in `:s/foo/bar/c`) with a solution that allows you to stay in normal mode and freely move / execute other commands while substituting.

![Sample pic](/../screenshots/1.gif?raw=true "easyreplace in action")

## Usage

Type `:s/foo/bar` like you normally would to substitute "foo" with "bar". Then press the initiate key set by this plugin (`ctrl-enter` if you run Vim with a GUI, otherwise `ctrl-g` for the command line and `ctrl-b` for the command window). You'll be put back to normal mode on the next match of `foo`. Now you can press `ctrl-n` in normal mode replace the closest `foo` with `bar` (and move to the next `foo` if possible). Or, unlike with `:s/foo/bar/c`, you can do any normal mode stuff you feel like doing. Use `n` to skip results between `c-n`s as you normally would.

You can prefix the `ctrl-n` command with a count to replace the next *n* matches at once.

Press `cpr` (mnemonic: change previous replace) in normal mode to make easyreplace always replace the latest search result with your latest substitution. This is also the default if you haven't started a replace with the initiate key yet, which means you can just type `:s/foo/bar<cr>` and start replacing foos with bars by hitting `ctrl-n`.

NOTE: If you are sure you'll never have multiple matches on one line, this built-in solution is probably better for you:

	nnoremap <c-n> :&&<cr>j0gn<esc>`<

The above replaces all the matches on the current line with the result of your latest substitution. The difference to easyreplace is that easyreplace can handle multiple matches on a line one by one, and is immune to new searches and substitutions if you want it to be.

## Installation

Use your favorite plugin manager or just paste the files in your vim folder

## Configuration

`:let g:erepl_after_initiate = "zz"` (default '') Replace the `zz` to issue any normal mode commands to executue after you've entered a regex. NOTE: special characters (such as `<esc>`) and `"` must be escaped with `\`

`:let g:erepl_after_replace = "zz"` (default '') Same as g:erepl_after_initiate, except this gets executed after each substitution

`:let g:erepl_always_verymagic = 1` (default 0) Treat the target regex when executing a new substitution as if it started with `\v` if no other modifiers are given

**Available mappings:**

`<Plug>EasyReplaceInitiate` Map this to what you want to press in command line or cmdwindow to start the substitution.

example: `:cmap <c-x> <Plug>EasyReplaceInitiate`

`<Plug>EasyReplaceDo` Map this to what you want to press in normal mode to substitute the current match and move to the next match after that.

example: `:nmap <c-x> <Plug>EasyReplaceDo`

`<Plug>EasyReplaceInPlace` Map this to what you want to press in normal mode to substitute the current match and stay in place.

example: `:nmap <leader>n <Plug>EasyReplaceInPlace`

`<Plug>EasyReplaceBackwards` Map this to what you want to press in normal mode to substitute the current match and move to the preceding match.

example: `:nmap <c-x> <Plug>EasyReplaceBackwards`

`<Plug>EasyReplaceToggleUsePrevious` Make easyreplace always replace the latest search result with your latest substitution.

example: `:nmap cpr <Plug>EasyReplaceToggleUsePrevious`

`<Plug>EasyReplaceArea` Map this in visual mode to replace all your selected matches at once.

example: `:xmap <c-x> <Plug>EasyReplaceArea`

## Requirements

* The 'history' setting set to 1 or more (sorry!)
* Vim 7.4+

## Bugs

* Really long / complex searches might not work. The gn function used by this plugin tends to sometimes select only the first char on those, and these situations are where the plugin also fails.
* Searches containing only one char might not work. gn sometimes fails to keep the cursor still when the match is only 1 char long and you're on it. gn might even skip these matches altogether.
* If your substitution contains lookbehinds you might unwantedly get new matches or lose old ones between substitutions. This happens when the text seen by the next lookbehind changes after a substitution. If this ever becomes a problem you'll just have to use a normal substitution with the `c` flag instead.
* Doesn't "bump up" search/cmd history items (if needed) after replaces, only after initializations.

## License

Published under the MIT License.

repository: sosmo/vim-easyreplace

repo_name: sosmo/vim-easyreplace


text:
---
layout: post
title: A Place for Us
date: 2020-05-11
category: books
---

The last section of this book really got to me in ways I was not expecting. Perhaps it was the frayed emotional state that comes along with quarantine life, or maybe it was the build up from the first few sections of the book. Whatever the reason, I found that section very moving.

Families ask a lot of each other. The give and take is not uniform or fair. And this book does a fantastic job at revealing the big and small injustices that siblings, parents, and children enact on one another over decades. Over the course of the book, you also get a sense for why, despite it all, families (if you so choose) are some of the central definining features of our identities in our lives. We don't choose the ones we're born in. And we only get to shape a small part of what shape they take.

Like Hulu's Ramy, this book is among of the best evocatios of modern Islam in America.


text:
---
layout: blog
title: May Walk To School with the Mayor

---

[See flyer here](https://storage.googleapis.com/static.rutherford-nj.com/recreation/posts/May%20Walk%20to%20School%20w-%20Mayor.pdf)

Walk to School with the Mayor in May 2018 as part of the Mayor’s Wellness Campaign

**May 2nd - Washington School**

(1st - 3rd graders) Meet at the corner of Raymond Ave. and Washington Ave. promptly at 8:00AM

**May 9th - Pierrepont School**

Meet at Lincoln Park at the corner of Lincoln Ave./Highland Cross promptly at 7:40AM

**May 16th - Lincoln School**

(1st - 3rd graders) Meet at Lincoln Park at the corner of Park Ave./Highland Cross promptly at 8:00AM

**May 23rd - Kindergarten Center**

Meet at Lincoln Park at the corner of Lincoln Ave./Highland Cross promptly at 8:25AM

All children are welcome to walk to school with
Rutherford Mayor Joe DeSalvo to help promote a healthy lifestyle as part of the
Mayor’s Wellness Campaign Initiative.
Parents are welcome to join in the walk.
These events are rain or shine!

Thank you!

branch_name: refs/heads/beta


text:
# :exclamation: This repo is no longer used a source of config files for HCC! :exclamation:

Due to ongoing migration to the frontend operator, module and navigation files were moved to te chrome service api. Follow this [link](https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md) to learn more.

If you need to make updatse to `qaprodauth` environment add the `qaprodauth` label to your PR. The PR will not be closed.

# About

This repo deals with the high-level configuration of Cloud Services. `main.yml` contains the source of truth for CS apps, and the `akamai` folder deals with updating our Akamai configuration.

## Branch links and syncing

These are the urls for each branch:

### Beta
* ci-beta -> https://ci.console.redhat.com/beta
* qa-beta -> https://qa.console.redhat.com/beta
* stage-beta -> https://console.stage.redhat.com/beta
* prod-beta -> https://console.redhat.com/beta

### Stable
* ci-stable -> https://ci.console.redhat.com
* qa-stable -> https://qa.console.redhat.com
* stage -> https://console.stage.redhat.com
* prod-stable -> https://console.redhat.com

These branches sync:

* ci-beta -> qa-beta -> stage-beta
* ci-stable -> qa-stable -> stage-stable

## Adding Config for New Apps

To enable a new app in our environments, you need to create configuration for it in `main.yml` and in `/chrome` directory. After that create a PR to merge it into the `ci-beta` branch. The configuration for the non-prod beta branches is kept in sync. Changes to `ci-beta` will automatically be merged into `qa-beta` (as mentioned above).

When you need this config added to another environment (`prod-beta`, `ci-stable`, `qa-stable`, `prod-stable`), please open another PR for that environment. If you have any concerns about this process, feel free to ping #forum-clouddot-ui on Slack for assistance.

Here is some example configuration that demonstrates the structure, using all required and optional properties:

### `main.yml`

```yml
{app_id}:
    title: App Title
    api:
        versions:
            - v1
            - v2
        subItems:
            oneApi:
                title: Some title
                versions:
                    - v1
    channel: '#some-slack-channel'
    description: App Title is a cool app that does business things for its users.
    deployment_repo: https://github.com/app-deployment-repo-url
    disabled_on_prod: true
    docs: https://link.to.docs.com/docs
    permissions:
        method: isOrgAdmin
        apps:
            - app_id_1
    frontend:
        paths:
            - /example/path
            - /another/example/path
    source_repo: https://github.com/app-development-repo-url
    mailing_list<EMAIL_ADDRESS>```

### `/chrome/fed-modules.json`

Add new application metadata to chrome modules registry.

[More details](https://github.com/RedHatInsights/cloud-services-config/blob/ci-beta/docs/chrome/docs.md#registering-new-module-app-to-chrome)

```js
{
    /** app-id must be the same as in the main.yml file */
    "<app-id>": {
        "manifestLocation": "/apps/<app-id>/fed-mods.json",
        "modules": [
            {
                "id": "module identifier",
                "module": "./RootApp",
                "routes": [
                    "/example/path",
                    "/another/example/path"
                ]
            }
        ]
    }
}
```
### `/chrome/<bundle>-navigation.json`

Add a new link to chrome navigation files. The navigation registry file is based on application location within the chrome application. For example, if the application should live under `/settings` route, modify the `settings-navigation.json` file.

[More details](https://github.com/RedHatInsights/cloud-services-config/blob/ci-beta/docs/chrome/docs.md#adding-a-new-top-level-link-to-the-chrome-left-navigation)

```js
{
    /** app-id must be the same as in the main.yml file */
    "appId": "<app-id>",
    /** Title of the link in browser */
    "title": "App title",
    /** Exact URL path to the application. Can be a nested route. */
    "href": "/settings/new-app"
}
```

### Required Properties (All Apps)

Each of the following properties is required for all apps:

#### app_id

This is your app's ID. It's used as the path to your app, and must be unique.

#### app_id.title

The main title for your app. This is what you want everyone to see when they use your app.

#### app_id.deployment_repo

This is the location of your app's deployment repo (not development repo). These repos generally have `build` or `deploy` as a suffix.

### API Properties

The following properties are used if your app has an API:

#### app_id.api.versions

This is the list of API versions your app can use. Since `v1` is the default, you'll usually want at least that one defined.

#### app_id.api.subItems

If your API consists of multiple APIs, you can list them here. Each has the same signature as `{app_id.api}`.

#### app_id.api.apiName

If your API is accessible on a URL other than `/api/{app_id}/{versions[0]}/openapi.json`, you can change it by passing the correct name. The URL will look like `/api/{apiName}/{versions[0]}/openapi.json`

### Frontend Properties

The following properties are used if your app has a frontend:

#### app_id.frontend.title

If you want the name of your app to appear differently on the frontend, set this property to override it.

#### app_id.frontend.app_base

If you want this app to use the same codebase as another existing app, set this value to the ID of that app.

#### app_id.frontend.paths

This is the list of URL paths where your app will be located.

### Other Optional Properties

The following properties aren't required for all apps, but may still apply to your app:

#### app_id.productId

The Red Hat product ID for your application. This is tied to fields on Portal Case Management for pre-filling information.

#### app_id.infoId

Some applications are mounted in two locations, but use the same base repo (ex. RBAC and MUA), in this case MUA needs to point to RBAC's app.info.json, so this is the base app for that url.

#### app_id.channel

This is the ID of the slack channel on ansible.slack.com that you want automatic notifications to be posted to.

#### app_id.description

This is a description of your app's purpose or functionalities, which is used by some other apps.

#### app_id.disabled_on_prod

Setting this value to `true` will disable the app from deploying to Prod (and appearing in Prod). This applies to both `stable` and `beta` releases.

#### app_id.docs

This is the link to your app's documentation.

#### app_id.source_repo

This is the URL of the development (not deployment) repo for your app, i.e. the one you commit to.

#### app_id.mailing_list

This is the mailing list associated with your project. Used to automate email notifications.

## Akamai API Access

Before you can run the property-updating script locally, you need to have access to the Akamai API.
To do this, follow the steps located [here](https://developer.akamai.com/api/getting-started). In step 5 of this doc the guide instructs you to set the Access Level of the Diagnostics Tools API to READ_WRITE; do this but also set the Access Level of the Property Manager API (PAPI) to READ-Write. Otherwise you will not have authorization to the configurations of Cloud Services. Make sure that the `.edgerc` file you create is located in your `home` directory and has the credentials defined in the `[default]` section of the file.
If you're able to run the sample call at the end of the doc, you should be able to run the script. If you run into issues, there may be something wrong with your `.edgerc` file.

For more information on the Akamai API, read the [property manager docs](https://developer.akamai.com/api/core_features/property_manager/v1.html).

## Build Process

This repository has a webhook that automatically builds a [Jenkins job](https://jenkins-jenkins.5a9f.insights-dev.openshiftapps.com/job/akamai-config-deployer/) on every push. To configure this webhook, check the project's [webhook settings](https://github.com/RedHatInsights/cloud-services-config/settings/hooks)

## Testing your changes locally

Testing local changes is straightforward. First, add a line like this to your insights-proxy spandx config:

```diff
--- a/profiles/local-frontend.js
+++ b/profiles/local-frontend.js
@@ -9,5 +9,6 @@ routes[`/beta/${SECTION}/${APP_ID}`] = { host: `http://localhost:${FRONTEND_PORT
 routes[`/${SECTION}/${APP_ID}`]      = { host: `http://localhost:${FRONTEND_PORT}` };
 routes[`/beta/apps/${APP_ID}`]       = { host: `http://localhost:${FRONTEND_PORT}` };
 routes[`/apps/${APP_ID}`]            = { host: `http://localhost:${FRONTEND_PORT}` };
+routes[`/beta/config`]            = { host: `http://localhost:8889` };

 module.exports = { routes };
```

Restart your insights-proxy to pick up the change.

Create a `beta/config` directory inside of `cloud-services-config` and crate a sym link (or copy) to `/chrome` directory in it. Then, from the `cloud-services-config` dir, run `npx http-server -p 8889`. In your browser, go to `https://ci.foo.redhat.com:1337/beta/rhel/dashboard`. You should see something logged like this from npx:

```text
$ npx http-server -p 8889
npx: installed 25 in 2.484s
Starting up http-server, serving ./
Available on:
  http://<IP_ADDRESS>:8889
  http://<IP_ADDRESS>:8889
  http://<IP_ADDRESS>:8889
Hit CTRL-C to stop the server
[Tue Nov 05 2019 09:50:55 GMT-0500 (Eastern Standard Time)] "GET /beta/config/main.yml" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:69.0) Gecko/20100
101 Firefox/69.0"
```

Before you go developing, make sure you can make a simple change and see it in the web UI. Try renaming "Dashboard" link title to "XDashboardX" in `/chrome/rhel-navigation.json`.

```diff
diff --git a/chrome/rhel-navigation.json b/chrome/rhel-navigation.json
index 67237cc..4485daa 100644
--- a/chrome/rhel-navigation.json
+++ b/chrome/rhel-navigation.json
@@ -4,7 +4,7 @@
     "navItems": [
         {
             "appId": "dashboard",
-            "title": "Dashboard",
+            "title": "XDashboardX",
             "filterable": false,
             "href": "/insights/dashboard",
             "product": "Red Hat Insights"

```

Now go to `/insights/dashboard`. You may not see your navigation change at this point! Try clearing your local storage in your browser. To do this in Firefox, hit Shift-F9 and click "Local Storage", then right click on <https://ci.foo.redhat.com:1337> and delete all. Refresh the page and you should then see your changes. You'll notice too that SimpleHTTPServer logged another request.

repository: RedHatInsights/cloud-services-config

branch_name: refs/heads/ci-beta

gha_language: Python

repo_name: RedHatInsights/cloud-services-config


text:
# Zcoin REST Service

ZRS (Zcoin REST Service) is a REST service to provide an access to Zcoin network.

## Development
### Requirements

- .NET Core 3.1
- Docker Compose

### Build

```sh
dotnet build src/Zrs.sln
```

### Start required services

```sh
docker-compose up -d
```

### Start REST service

```sh
dotnet run -p src/Zrs
```

repository: firoorg/zrs

repo_name: firoorg/zrs


text:
# Data
Data for the neuroscience use case is available at [HCP](https://wiki.humanconnectome.org/display/PublicData/How+To+Connect+to+Connectome+Data+via+AWS)

## Get the data from AWS S3
We assume that you have a file '.aws/credentials',
that includes a section with credentials needed to access HCP data.
```
[hcp]
AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXX
```

Following code excerpt shows how to access the data from the hcp-openaccess s3 bucket.
```python
import botocore.session
import boto3
boto3.setup_default_session(profile_name='hcp')
s3 = boto3.resource('s3')
bucket = s3.Bucket('hcp-openaccess')

 data_files = {'./bvals':'HCP/994273/T1w/Diffusion/bvals',
              './bvecs':'HCP/994273/T1w/Diffusion/bvecs',
              './data.nii.gz':'HCP/994273/T1w/Diffusion/data.nii.gz'}

for k in data_files.keys():
    if not op.exists(k):
        bucket.download_file(data_files[k], k)
```


text:
# Moonscript

Moonscript is a langauge that can be compiled into Lua.

This sample requires Make (`make`) and Moonscript (`moonc`) to be installed and working.

Just run `make` to build `hello.moon` and serve it with `algernon`.

Use `make index` to build `index.moon` and serve it with `algernon`.

* `hello.lua` is served as server configuration script that sets up a simple handle.
* `index.lua` is served as a regular Algernon handler.

Different Lua functions are available in the two modes.

repository: xyproto/algernon

gha_language: Go

repo_name: xyproto/algernon


text:
# Juliet *- workflow*

Ongoing documentation work.

## Initial setup

The following commands will

* initialize a juliet source directory
* create a first blog post
* build the newly created blog to `build-area`

```
$ juliet init
$ juliet new -- title "Going to Mars" author "Opportunity (a.k.a MER-B)" date "July 7, 2003"
$ echo "\nTo Infinity... and Beyond\!" >> posts/2003-07-07-going-to-mars.md
$ juliet build --auto-baseurl
```

Open your new blog in your favourite browser: it works!

    $ firefox build-area/index.html

repository: hlef/juliet

repo_name: hlef/juliet