text:
---
layout: post
title: "S01E05 - Configuring Windows Update for Business in Microsoft Intune - (I.T)"
date: 2019-08-06 00:00:00 -0000
categories:
---

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/YBkPWmujZz0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Steve and Adam discuss and configure Windows Update for Business in Microsoft Intune.

- [00:00](https://www.youtube.com/watch?v=YBkPWmujZz0&t=0s) - Intro
- [00:39](https://www.youtube.com/watch?v=YBkPWmujZz0&t=39s) - Microsoft Endpoint Management admin center
[https://aka.ms/dmac](https://aka.ms/dmac)
- [00:55](https://www.youtube.com/watch?v=YBkPWmujZz0&t=55s) - Manage Windows 10 software updates in Intune
[https://docs.microsoft.com/intune/windows-update-for-business-configure](https://docs.microsoft.com/intune/windows-update-for-business-configure)
- [16:36](https://www.youtube.com/watch?v=YBkPWmujZz0&t=996s) - Discussion around Delivery Optimization
[https://docs.microsoft.com/intune/delivery-optimization-windows](https://docs.microsoft.com/intune/delivery-optimization-windows)
- [20:07](https://www.youtube.com/watch?v=YBkPWmujZz0&t=1207s) - How long does it take for devices to get a policy, profile, or app after they are assigned?
[https://docs.microsoft.com/intune/device-profile-troubleshoot#how-long-does-it-take-for-devices-to-get-a-policy-profile-or-app-after-they-are-assigned](https://docs.microsoft.com/intune/device-profile-troubleshoot#how-long-does-it-take-for-devices-to-get-a-policy-profile-or-app-after-they-are-assigned)
- [22:53](https://www.youtube.com/watch?v=YBkPWmujZz0&t=1373s) - Intune and device management discussion
- [28:34](https://www.youtube.com/watch?v=YBkPWmujZz0&t=1714s) - Recap

branch_name: refs/heads/main


text:
---
metaTitle: "C# | Task Parallel Library (TPL) Dataflow Constructs"
description: "ActionBlock<T>, BroadcastBlock<T>, BufferBlock<T>, JoinBlock<T1, T2,…>, WriteOnceBlock<T>, BatchedJoinBlock<T1, T2,…>, TransformBlock<TInput, TOutput>, TransformManyBlock<TInput, TOutput>, BatchBlock<T>"
---

# Task Parallel Library (TPL) Dataflow Constructs

## ActionBlock<T>

(foreach)

This class can be thought of logically as a buffer for data to be processed combined with tasks for processing that data, with the “dataflow block” managing both. In its most basic usage, we can instantiate an ActionBlock and “post” data to it; the delegate provided at the ActionBlock’s construction will be executed asynchronously for every piece of data posted.

[](http://i.stack.imgur.com/exRaP.png)

**Synchronous Computation**

```cs
var ab = new ActionBlock<TInput>(i =>
{
    Compute(i);
});
…
ab.Post(1);
ab.Post(2);
ab.Post(3);

```

**Throttling Asynchronous Downloads to at most 5 concurrently**

```cs
var downloader = new ActionBlock<string>(async url =>
{
    byte [] imageData = await DownloadAsync(url);
    Process(imageData);
}, new DataflowBlockOptions { MaxDegreeOfParallelism = 5 });

downloader.Post("http://website.com/path/to/images");
downloader.Post("http://another-website.com/path/to/images");

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

## BroadcastBlock<T>

(Copy an item and send the copies to every block that it’s linked to)

Unlike BufferBlock, BroadcastBlock’s mission in life is to enable all targets linked from the block to get a copy of every element published, continually overwriting the “current” value with those propagated to it.

Additionally, unlike BufferBlock, BroadcastBlock doesn’t hold on to data unnecessarily.  After a particular datum has been offered to all targets, that element will be overwritten by whatever piece of data is next in line (as with all dataflow blocks, messages are handled in FIFO order).  That element will be offered to all targets, and so on.

[](http://i.stack.imgur.com/ZStaY.png)

**Asynchronous Producer/Consumer with a Throttled Producer**

```cs
var ui = TaskScheduler.FromCurrentSynchronizationContext();
var bb = new BroadcastBlock<ImageData>(i => i);

var saveToDiskBlock = new ActionBlock<ImageData>(item =>
    item.Image.Save(item.Path)
);

var showInUiBlock = new ActionBlock<ImageData>(item =>
    imagePanel.AddImage(item.Image),
    new DataflowBlockOptions { TaskScheduler = TaskScheduler.FromCurrentSynchronizationContext() }
);

bb.LinkTo(saveToDiskBlock);
bb.LinkTo(showInUiBlock);

```

**Exposing Status from an Agent**

```cs
public class MyAgent
{
    public ISourceBlock<string> Status { get; private set; }

    public MyAgent()
    {
        Status = new BroadcastBlock<string>();
        Run();
    }

    private void Run()
    {
        Status.Post("Starting");
        Status.Post("Doing cool stuff");
        …
        Status.Post("Done");
    }
}

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

## BufferBlock<T>

(FIFO Queue: The data that comes in is the data that goes out)

In short, BufferBlock provides an unbounded or bounded buffer for storing instances of T.

You can “post” instances of T to the block, which cause the data being posted to be stored in a first-in-first-out (FIFO) order by the block.

You can “receive” from the block, which allows you to synchronously or asynchronously obtain instances of T previously stored or available in the future (again, FIFO).

[](http://i.stack.imgur.com/S5vXJ.png)

**Asynchronous Producer/Consumer with a Throttled Producer**

```cs
// Hand-off through a bounded BufferBlock<T>
private static BufferBlock<int> _Buffer = new BufferBlock<int>(
    new DataflowBlockOptions { BoundedCapacity = 10 });

// Producer
private static async void Producer()
{
    while(true)
    {
        await _Buffer.SendAsync(Produce());
    }
}

// Consumer
private static async Task Consumer()
{
    while(true)
    {
        Process(await _Buffer.ReceiveAsync());
    }
}

// Start the Producer and Consumer
private static async Task Run()
{
    await Task.WhenAll(Producer(), Consumer());
}

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

## JoinBlock<T1, T2,…>

(Collects 2-3 inputs and combines them into a Tuple)

Like BatchBlock, JoinBlock<T1, T2, …> is able to group data from multiple data sources.  In fact, that’s JoinBlock<T1, T2, …>’s primary purpose.

For example, a JoinBlock<string, double, int> is an ISourceBlock<Tuple<string, double, int>>.

As with BatchBlock, JoinBlock<T1, T2,…> is capable of operating in both greedy and non-greedy mode.

- In the default greedy mode, all data offered to targets are accepted, even if the other target doesn’t have the necessary data with which to form a tuple.
- In non-greedy mode, the block’s targets will postpone data until all targets have been offered the necessary data to create a tuple, at which point the block will engage in a two-phase commit protocol to atomically retrieve all necessary items from the sources.  This postponement makes it possible for another entity to consume the data in the meantime so as to allow the overall system to make forward progress.

[](http://i.stack.imgur.com/mmXJ8.png)

**Processing Requests with a Limited Number of Pooled Objects**

```cs
var throttle = new JoinBlock<ExpensiveObject, Request>();
for(int i=0; i<10; i++)
{
    requestProcessor.Target1.Post(new ExpensiveObject());
}

var processor = new Transform<Tuple<ExpensiveObject, Request>, ExpensiveObject>(pair =>
{
    var resource = pair.Item1;
    var request = pair.Item2;

    request.ProcessWith(resource);

    return resource;
});

throttle.LinkTo(processor);
processor.LinkTo(throttle.Target1);

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

## WriteOnceBlock<T>

(Readonly variable: Memorizes its first data item and passes out copies of it as its output. Ignores all other data items)

If BufferBlock is the most fundamental block in TPL Dataflow, WriteOnceBlock is the simplest.

It stores at most one value, and once that value has been set, it will never be replaced or overwritten.

You can think of WriteOnceBlock in as being similar to a readonly member variable in C#, except instead of only being settable in a constructor and then being immutable, it’s only settable once and is then immutable.

[](http://i.stack.imgur.com/7M5Mp.png)

**Splitting a Task’s Potential Outputs**

```cs
public static async void SplitIntoBlocks(this Task<T> task,
    out IPropagatorBlock<T> result,
    out IPropagatorBlock<Exception> exception)
{
    result = new WriteOnceBlock<T>(i => i);
    exception = new WriteOnceBlock<Exception>(i => i);

    try
    {
        result.Post(await task);
    }
    catch(Exception ex)
    {
        exception.Post(ex);
    }
}

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

## BatchedJoinBlock<T1, T2,…>

(Collects a certain number of total items from 2-3 inputs and groups them into a Tuple of collections of data items)

BatchedJoinBlock<T1, T2,…> is in a sense a combination of BatchBlock and JoinBlock<T1, T2,…>.

Whereas JoinBlock<T1, T2,…> is used to aggregate one input from each target into a tuple, and BatchBlock is used to aggregate N inputs into a collection, BatchedJoinBlock<T1, T2,…> is used to gather N inputs from across all of the targets into tuples of collections.

[](http://i.stack.imgur.com/FSgue.png)

**Scatter/Gather**

Consider a scatter/gather problem where N operations are launched, some of which may succeed and produce string outputs, and others of which may fail and produce Exceptions.

```cs
var batchedJoin = new BatchedJoinBlock<string, Exception>(10);

for (int i=0; i<10; i++)
{
    Task.Factory.StartNew(() => {
        try { batchedJoin.Target1.Post(DoWork()); }
        catch(Exception ex) { batchJoin.Target2.Post(ex); }
    });
}

var results = await batchedJoin.ReceiveAsync();

foreach(string s in results.Item1)
{
    Console.WriteLine(s);
}

foreach(Exception e in results.Item2)
{
    Console.WriteLine(e);
}

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

## TransformBlock<TInput, TOutput>

(Select, one-to-one)

As with ActionBlock, TransformBlock<TInput, TOutput> enables the execution of a delegate to perform some action for each input datum; **unlike with ActionBlock, this processing has an output.**  This delegate can be a Func<TInput, TOutput>, in which case processing of that element is considered completed when the delegate returns, or it can be a Func<TInput,Task>, in which case processing of that element is considered completed not when the delegate returns but when the returned Task completes.
For those familiar with LINQ, it’s somewhat similar to Select() in that it takes an input, transforms that input in some manner, and then produces an output.

By default, TransformBlock<TInput, TOutput> processes its data sequentially with a MaxDegreeOfParallelism equal to 1.
In addition to receiving buffered input and processing it, this block will take all of its processed output and buffer that as well (data that has not been processed, and data that has been processed).

It has 2 tasks: One to process the data, and one to push data to the next block.

[](http://i.stack.imgur.com/jQcFo.png)

**A Concurrent Pipeline**

```cs
var compressor = new TransformBlock<byte[], byte[]>(input => Compress(input));
var encryptor = new TransformBlock<byte[], byte[]>(input => Encrypt(input));

compressor.LinkTo(Encryptor);

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

## TransformManyBlock<TInput, TOutput>

(SelectMany, 1-m: The results of this mapping are “flattened”, just like LINQ’s SelectMany)

TransformManyBlock<TInput, TOutput> is very similar to TransformBlock<TInput, TOutput>.

The key difference is that whereas a TransformBlock<TInput, TOutput> produces one and only one output for each input, TransformManyBlock<TInput, TOutput> produces any number (zero or more) outputs for each input.  As with ActionBlock and TransformBlock<TInput, TOutput>, this processing may be specified using delegates, both for synchronous and asynchronous processing.

A Func<TInput, IEnumerable> is used for synchronous, and a Func<TInput, Task<IEnumerable>> is used for asynchronous. As with both ActionBlock and TransformBlock<TInput, TOutput>, TransformManyBlock<TInput, TOutput> defaults to sequential processing, but may be configured otherwise.

The mapping delegate retuns a collection of items, which are inserted individually into the output buffer.

[](http://i.stack.imgur.com/h7mip.png)

**Asynchronous Web Crawler**

```cs
var downloader = new TransformManyBlock<string, string>(async url =>
{
    Console.WriteLine(“Downloading “ + url);
    try
    {
        return ParseLinks(await DownloadContents(url));
    }
    catch{}

    return Enumerable.Empty<string>();
});
downloader.LinkTo(downloader);

```

**Expanding an Enumerable Into Its Constituent Elements**

```cs
var expanded = new TransformManyBlock<T[], T>(array => array);

```

**Filtering by going from 1 to 0 or 1 elements**

```cs
public IPropagatorBlock<T> CreateFilteredBuffer<T>(Predicate<T> filter)
{
    return new TransformManyBlock<T, T>(item =>
        filter(item) ? new [] { item } : Enumerable.Empty<T>());
}

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

## BatchBlock<T>

(Groups a certain number of sequential data items into collections of data items)

BatchBlock combines N single items into one batch item, represented as an array of elements. An instance is created with a specific batch size, and the block then creates a batch as soon as it’s received that number of elements, asynchronously outputting the batch to the output buffer.

BatchBlock is capable of executing in both greedy and non-greedy modes.

- In the default greedy mode, all messages offered to the block from any number of sources are accepted and buffered to be converted into batches.

- In non-greedy mode, all messages are postponed from sources until enough sources have offered messages to the block to create a batch.  Thus, a BatchBlock can be used to receive 1 element from each of N sources, N elements from 1 source, and a myriad of options in between.

[](http://i.stack.imgur.com/tLRyw.png)

**Batching Requests into groups of 100 to Submit to a Database**

```cs
var batchRequests = new BatchBlock<Request>(batchSize:100);
var sendToDb = new ActionBlock<Request[]>(reqs => SubmitToDatabase(reqs));

batchRequests.LinkTo(sendToDb);

```

**Creating a batch once a second**

```cs
var batch = new BatchBlock<T>(batchSize:Int32.MaxValue);
new Timer(() => { batch.TriggerBatch(); }).Change(1000, 1000);

```

[Introduction to TPL Dataflow by Stephen Toub](https://www.microsoft.com/en-us/download/details.aspx?id=14782)

license: MIT

repository: haifenghuang/generate

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: haifenghuang/generate


text: # [Stream twitch via livestreamer using dmenu for selection](https://github.com/Earnestly/dotfiles/blob/master/.local/bin/ditch)

repository: kcghost/dmenu-scripts-collection

repo_name: kcghost/dmenu-scripts-collection


text:
# Rock Paper Scissors

#### _An experiment into red green refactoring with C sharp, 2020 ver 1.0.0_

#### By _Ian Gregg , Kyle Hubbard & Megan Hepner_
[Rock Paper Scissors](https://github.com/hubba180/rock-paper-scissors)

## Description

_This application is utilizing the C sharp programming language and TDD to reconstruct the game Rock Paper Scissors._

## Setup/Installation Requirements

* to clone this content, copy the url provided by the 'clone or download' button in GitHub
* in command line use the command 'git clone (GitHub url)'
* open the program in a code editor
* you will need [.NET] (https://dotnet.microsoft.com/download/dotnet-core/2.2) installed to run this program
* then install dotnet script REPL by typing 'dotnet tool installl -g dotnet-script' in the command line
* type dotnet build in the command line to compile the code
* create a .gitignore file and store the bin and obj folders in .gitignore
* type dotnet run in the command line to run the program
__
## Specs
| Behavior    | Input | Output |
| :---------- | ----- | -----: |
| Should instantiate a GameObject with a type of either "Rock", "Paper", or "Scissors". | "Rock" | { type: "Rock"; } |
| Should compare 2 GameObject types and determine which will win| "Rock" vs "Scissors | "Rock"

## Known Bugs
_No known bugs_
## Support and contact details

_Contact Ian Gregg<EMAIL_ADDRESS>or
Kyle Hubbard<EMAIL_ADDRESS>or
Megan Hepner<EMAIL_ADDRESS>
## Technologies Used

_The Technologies used in the making of this software was Chrome browser, Visual Studio editor, and Mac, C#_

### License

Copyright (c) 2020 **_Ian Gregg & Kyle Hubbard_**
Copyright (c) 2020 **_Ian Gregg & Kyle Hubbard & Megan Hepner_**

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


text:
An STL inspired embedded library both for C and C++
===================================================
_(Nested) Embedded standard library_

*Note:* Please use the new library named luepp instead: https://github.com/mlutken/luepp

Motivation
----------
This library aims to provide a way for mainly embedded software
project to use the functionality from the Standard Template Library.

The problem commonly faced on embedded platforms is that you can often only
use the "Free standing" C++ implementation and thus you will run into problems
when trying to use the compiler supplied STL implementation.

In plain C99 projects you don't have anything like an STL library so here people
often "re-invent the wheel" all over the project implementing ad hoc vectors. list etc.

*Performance and multithreading*
A secondary goal with this library is to provide classes (also in C) for performance critical
projects like games where you often want to avoid dynamic allocation and need to use effective
lock free structures like for example queues.

Current features C++
--------------------
Support for C++03 and newer for most features. Some things like move semantics and the
coming non dynamically allocation estl::function will need C++11 or newer.

- *vector_s*: A statically allocated vector that otrherwise behaves as your friendly std::vector.
  So it's _not_ the same as std::array!
- *map_s*: A statically allocated map. It works by using an internal vector_s, which is then sorted.
- *atomic*: Simple atomic for integer types only.
- *mutex*: Simple mutex and lock_guard.
- *srsw_fifo*: Single reader, single writer lockless fifo.
- *mrsw_fifo*: _(planned) Multiple reader, single writer lockless fifo._
- *srmw_fifo*: _(planned) Single reader, multiple writer lockless fifo._
- *mrmw_fifo*: _(planned) Multiple reader, multiple writer lockless fifo._
- *shared_ptr*: Simple shared_ptr and weak_ptr implementation.
- *unique_ptr*: _(planned)Simple unique_ptr. C++11 and newer only!_
- *state_machine*: A novel approach to state machines. Emphasis on splitting state changes from actions.
   Easily create unit tests that tests all transitions instantly. Can draw Graphviz "dot" state machie diagrams
   directly from the C++ code!

Current features C
------------------
- *alignment*: Simple platform abstraction for aligning variables.
- *atomic*: Simple atomic functions.
- *cesl_vector_s*: vector_s like container.
- *cesl_srsw_fifo*: _(planned) Single reader, single writer lockless fifo. Current implmentation is named cesl_llfifo and needs to be renamed and tested._
- *cesl_mrsw_fifo*: _(planned) Multiple reader, single writer lockless fifo. Current implmentation is named cesl_llfifo and needs to be renamed and tested._
- *cesl_srmw_fifo*: _(planned) Single reader, multiple writer lockless fifo. Current implmentation is named cesl_llfifo and needs to be renamed and tested._
- *cesl_mrmw_fifo*: _(planned) Multiple reader, multiple writer lockless fifo. Current implmentation is named cesl_llfifo and needs to be renamed and tested._
- *cesl_format*: C++ like type safe and MISRA compliant formatting of strings in C. An alternative to printf
  like formatting.
- *cesl_debug*: Using the above formatting functionality, this is a way to do safe debug printf like
  output from C.

CMake
-----
For anyone looking for a good "template" for a new project that uses CMake as build
system I believe you will find this project usefull.
I have tried to the best of my effort to use the most recent best practices in regards
to CMake.

# Using in existing non CMake projects
The code is written using CMake a little as possible for platfor specific stuff, leaving most
of this in plain header files using the C/C++ preprocessor. Thus it's relatively simple to simply add
all the .c and .cpp files into your own build system and set a few preprocessor macros on your compiler
command line. These are the relevant ones. (see more in the root CMakeLists.txt file,
tools/cmake/default_versions.cmake, config/nestle_default_config.h ).

- -DCXX_STANDARD_LIBRARY=(Possible values: 98, 11, 14, 17, 20)
- -DCXX_STANDARD=(Possible values: 98, 11, 14, 17, 20)
- -DC_STANDARD=(Possible values: 99)
- -DNESTLE_PLATFORM_TYPE=(Possible values: 1 (NESTLE_PLATFORM_TYPE_DESKTOP), 2 (NESTLE_PLATFORM_TYPE_EMBEDDED))
- -DNESTLE_SYSTEM_NAME=(Possible values: 1 (NESTLE_SYSTEM_NAME_LINUX), 2 (NESTLE_SYSTEM_NAME_WINDOWS), 3 (NESTLE_SYSTEM_NAME_OSX), 4 (NESTLE_SYSTEM_NAME_FREERTOS) )

*Some CMake "features" worth mentioning:*
- Multiple platform support, using toolchain files for cross compiling
- Libraries use the CMake target_xx commands which makes sure that dependencies, includes, linker paths etc.
  are "inherited" by other libraries or executables that "depend" on them.
- Unit test subdirectories called "unittest" in each subfolder, which uses gtest. It's very easy to add a new unit test file in these
  subdirectories.
- Playground subdirectories called "playground", where you can easily add simple executables usefull for any adhoc testing.

*Lastly:* I highly recommend using this project from within the freely available QTCreator.
It's really fast and capable IDE for C and C++ code - also when you don't use any QT classes at all.

Known limitations
-----------------
- Windows support has not been tested at all yet. Should not be complicated to add though.
- Mac support has not been tested at all yet. Should not be complicated to add though.

Building
--------
# Building on Linux
$ git clone https://github.com/mlutken/nestle.git
$ mkdir -p _build/nestle
$ cd _build/nestle/
$ cmake ../../nestle
$ make -j
...
Or Use QtCreator or any otherway you prefer when dealing with CMake projects.

Help wanted
-----------
It's an ambitious project and if you are willing to help please drop me a message.

license: Unlicense

repository: mlutken/nestle

repo_name: mlutken/nestle


text:
## WuLiao Android App
![logo](https://github.com/yeshuwei/WuLiao/blob/master/art/wuliao_logo128.png)

English | [中文版](https://github.com/yeshuwei/WuLiao/blob/master/README_CN.md)

Wuliao is an AI-based chat assistant, which can accompany you, amuse you, help you search information and answer your question. Check air or bus ticket? Want to know the weather? Ask for language translation? Or find a funny story for entertainment? All these could be done for you and there are even more functions waiting for exploring.
### Features
* About thirty abilities and intelligent learning ability
* Voice input , voice playback
* Support for changes theme mode
### Screenshots
![](https://github.com/yeshuwei/WuLiao/blob/master/art/jietu1.png)![](https://github.com/yeshuwei/WuLiao/blob/master/art/jietu2.PNG)

![](https://github.com/yeshuwei/WuLiao/blob/master/art/jietu3.PNG)![](https://github.com/yeshuwei/WuLiao/blob/master/art/jietu4.PNG)

### Open in Android Studio
Clone the repository：

``
git clone https://github.com/yeshuwei/WuLiao
``

check out the Master branch：

``
git checkout master
``

Note:If you want to review a different branch,replace the **master** with the name you want to checout

Finally open the wuliao/ directory in Android Studio

### Download APK
[cool](http://www.coolapk.com/apk/com.wuliao)

### Libraries used in this App

* [RxJava](https://github.com/ReactiveX/RxJava)
* [RxAndroid](https://github.com/ReactiveX/RxAndroid)
* [Retrofit](https://github.com/square/retrofit)
* [CircleImageView](https://github.com/hdodenhof/CircleImageView)
* [Gson](https://github.com/google/gson)

### Thanks to
* [Turing](http://www.tuling123.com/)
* [Google](https://github.com/googlesamples)-[android-architecture
](https://github.com/googlesamples/android-architecture)
* [xfyun](http://www.xfyun.cn/)
* Other people who helped me solve the problem


text:
# usc-multiplayer-server

This is a multiplayer server for [unnamed-sdvx-clone](https://github.com/Drewol/unnamed-sdvx-clone)

## Docs
[View Protocol Docs](https://itszn.github.io/usc-multiplayer-server/server.html)

## Getting the server

Check out the [release page](https://github.com/itszn/usc-multiplayer-server/releases) for some builds.

Otherwise see below of building

## Running

```
Usage of ./usc_multiplayer:
  -bind string
    	host:port to bind to (default "<IP_ADDRESS>:39079")
  -debug
    	Print debug info
  -password string
    	server password if required
  -refresh int
    	Number of milliseconds between score updates (0 for realtime) (default 500)
  -verbose
    	Print verbose info
```

`-refresh` controls how fast the scoreboard is updated.

repository: itszn/usc-multiplayer-server

repo_name: itszn/usc-multiplayer-server


text:
### [CVE-2023-1415](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-1415)
![](https://img.shields.io/static/v1?label=Product&message=Simple%20Art%20Gallery&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=%3D%201.0%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-434%20Unrestricted%20Upload&color=brighgreen)

### Description

A vulnerability was found in Simple Art Gallery 1.0. It has been declared as critical. This vulnerability affects the function sliderPicSubmit of the file adminHome.php. The manipulation leads to unrestricted upload. The attack can be initiated remotely. VDB-223126 is the identifier assigned to this vulnerability.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/0xxtoby/CVE-2023-1415
- https://github.com/0xxtoby/CVE-2023-1415-
- https://github.com/ARPSyndicate/cvemon
- https://github.com/nomi-sec/PoC-in-GitHub

repository: trickest/cve

gha_language: HTML

gha_license_id: MIT

repo_name: trickest/cve


text:
## Daily Coding Problem: Problem #43

Good morning! Here's your coding interview problem for today.

This problem was asked by Amazon.

Implement a stack that has the following methods:

---
* push(val), which pushes an element onto the stack
* pop(), which pops off and returns the topmost element of the stack. If there are no elements in the stack, then it should throw an error or return null.
* max(), which returns the maximum value in the stack currently. If there are no elements in the stack, then it should throw an error or return null.
---

Each method should run in constant time.

repository: TipsyPixie/go-daily-coding-problem

repo_name: TipsyPixie/go-daily-coding-problem


text:
---
layout: post
title: "I Need Your Help, Please"
comments: false
date: 2005-01-08 14:08:00
categories:
 - Community
 - Technology
subtext-id: 780d8e29-3509-4a79-a7a7-73fa00046c24
alias: /blog/post/I-Need-Your-Help2c-Please.aspx
---

Through [Keith Pleas](http://weblogs.asp.net/kpleas/), I'm trying to help the [IDEP Foundation](http://idepfoundation.org/) figure out some DNS problems that they are having. But the problem with DNS is that as a distrtibuted database of sorts, you can get different information from different places in the world.

So, your mission, should you choose to accept it, is this:

  1. Check today's date. If it is Jan&nbsp_place_holder;10, 2005 or earlier, then proceed to step 2. Otherwise, thanks for trying to help out.
  2.   If not, then thanks for trying to help out.
  3. Unzip it to a folder on your system and launch NetDig.exe (not NetDig.com). You do not need to "install" anything and you do not need to be an admistrator to do this. You should see something like this:

![NetDig](http://www.peterprovost.org/Files/NetDig.png)

  4. It should autodetect your local nameserver. If it doesn't, use "ipconfig /all" to figure out your local DNS server, and use that one in the box marked Server. Please don't use "<IP_ADDRESS>" unless that actually is your DNS server.
  5. Enter "idepfoundation.org" into the dropdown box under that one and select "ANY" in the type dropdown box.
  6. Click the Resolve button. After a second or two, you should see something like this:

![Netdig2](http://www.peterprovost.org/Files/netdig2.png)

  7. Notice, that in the Answer Section of that list I am being told that idepfoundation.org is using "dns1.whmserver.com" and "dns2.whmserver.com" for DNS. If you have any address **_other than that one_**, then proceed with step 8, otherwise go to step 9.
  8. Enter the NS record addresses (e.g dns1.whmserver.com and dns2.whmserver.com -- but not those ones) one at a time into the search box. Again, make sure the type dropdown says "ANY" and click Resolve. The output should append itself to the bottom of the textbox. Do this for each NS record you saw in the Answer Section of Step&nbsp_place_holder;6 that has "idepfoundation.org" to the left of it.
  9. Select all of the text in the big text box. Copy it to the clipboard and paste it&nbsp_place_holder;into the [contact form of my weblog](http://www.peterprovost.org/contact.aspx). Please make the subject be "idepfoundation dig results" so I can filter the responses in my mail client. If you don't mind using your real name and email address, I would appreciate it in case I need to contact you for more information about your DNS server or ISP. Also, if you can tell me where you are located (city and country), that could help as well. I promise this information will be kept in the strictest confidence and will only be used to help solve this problem.

Thanks in advance to everyone who can help. It will only take 5 minutes of your time, but may really help this group out.


text:
# Tensorflow Model Analysis Metrics and Plots

## Overview

TFMA supports the following metrics and plots:

*   Standard keras metrics
    ([`tf.keras.metrics.*`](https://www.tensorflow.org/api_docs/python/tf/keras/metrics))
    *   Note that you do not need a keras model to use keras metrics. Metrics
        are computed outside of the graph in beam using the metrics classes
        directly.
*   Standard TFMA metrics and plots
    ([`tfma.metrics.*`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/metrics))

*   Custom keras metrics (metrics derived from
    [`tf.keras.metrics.Metric`](https://www.tensorflow.org/api_docs/python/tf/keras/metrics/Metric))

*   Custom TFMA metrics (metrics derived from
    [`tfma.metrics.Metric`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/metrics/Metric))
    using custom beam combiners or metrics derived from other metrics).

NOTE: In TFMA, plots and metrics are both defined under the metrics library. By
convention the classes related to plots end in `Plot`.

TFMA also provides built-in support for converting binary classification metrics
for use with multi-class/multi-label problems:

*   Binarization based on class ID, top K, etc.
*   Aggregated metrics based on micro averaging, macro averaging, etc.

TFMA also provides built-in support for query/ranking based metrics where the
examples are grouped by a query key automatically in the pipeline.

Combined there are over 50+ standard metrics and plots available for a variety
of problems including regression, binary classification, multi-class/multi-label
classification, ranking, etc.

## Configuration

There are two ways to configure metrics in TFMA: (1) using the
[`tfma.MetricsSpec`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/api/MetricsSpec)
or (2) by creating instances of `tf.keras.metrics.*` and/or `tfma.metrics.*`
classes in python and using
[`tfma.metrics.specs_from_metrics`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/api/metrics/specs_from_metrics)
to convert them to a list of `tfma.MetricsSpec`.

The following sections describe example configurations for different types of
machine learning problems.

### Regression Metrics

The following is an example configuration setup for a regression problem.
Consult the `tf.keras.metrics.*` and `tfma.metrics.*` modules for possible
additional metrics supported.

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    metrics { class_name: "ExampleCount" }
    metrics { class_name: "MeanSquaredError" }
    metrics { class_name: "Accuracy" }
    metrics { class_name: "MeanLabel" }
    metrics { class_name: "MeanPrediction" }
    metrics { class_name: "Calibration" }
    metrics {
      class_name: "CalibrationPlot"
      config: '"min_value": 0, "max_value": 10'
    }
  }
""", tfma.EvalConfig()).metrics_specs
```

This same setup can be created using the following python code:

```python
metrics = [
    tfma.metrics.ExampleCount(name='example_count'),
    tf.keras.metrics.MeanSquaredError(name='mse'),
    tf.keras.metrics.Accuracy(name='accuracy'),
    tfma.metrics.MeanLabel(name='mean_label'),
    tfma.metrics.MeanPrediction(name='mean_prediction'),
    tfma.metrics.Calibration(name='calibration'),
    tfma.metrics.CalibrationPlot(
        name='calibration', min_value=0, max_value=10)
]
metrics_specs = tfma.metrics.specs_from_metrics(metrics)
```

Note that this setup is also avaliable by calling
`tfma.metrics.default_regression_specs`.

### Binary Classification Metrics

The following is an example configuration setup for a binary classification
problem. Consult the `tf.keras.metrics.*` and `tfma.metrics.*` modules for
possible additional metrics supported.

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    metrics { class_name: "ExampleCount" }
    metrics { class_name: "BinaryCrossentropy" }
    metrics { class_name: "BinaryAccuracy" }
    metrics { class_name: "AUC" }
    metrics { class_name: "AUCPrecisionRecall" }
    metrics { class_name: "MeanLabel" }
    metrics { class_name: "MeanPrediction" }
    metrics { class_name: "Calibration" }
    metrics { class_name: "ConfusionMatrixPlot" }
    metrics { class_name: "CalibrationPlot" }
  }
""", tfma.EvalConfig()).metrics_specs
```

This same setup can be created using the following python code:

```python
metrics = [
    tfma.metrics.ExampleCount(name='example_count'),
    tf.keras.metrics.BinaryCrossentropy(name='binary_crossentropy'),
    tf.keras.metrics.BinaryAccuracy(name='accuracy'),
    tf.keras.metrics.AUC(name='auc', num_thresholds=10000),
    tf.keras.metrics.AUC(
        name='auc_precision_recall', curve='PR', num_thresholds=10000),
    tf.keras.metrics.Precision(name='precision'),
    tf.keras.metrics.Recall(name='recall'),
    tfma.metrics.MeanLabel(name='mean_label'),
    tfma.metrics.MeanPrediction(name='mean_prediction'),
    tfma.metrics.Calibration(name='calibration'),
    tfma.metrics.ConfusionMatrixPlot(name='confusion_matrix_plot'),
    tfma.metrics.CalibrationPlot(name='calibration_plot')
]
metrics_specs = tfma.metrics.specs_from_metrics(metrics)
```

Note that this setup is also avaliable by calling
`tfma.metrics.default_binary_classification_specs`.

### Multi-class/Multi-label Classification Metrics

The following is an example configuration setup for a multi-class classification
problem. Consult the `tf.keras.metrics.*` and `tfma.metrics.*` modules for
possible additional metrics supported.

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    metrics { class_name: "ExampleCount" }
    metrics { class_name: "SparseCategoricalCrossentropy" }
    metrics { class_name: "SparseCategoricalAccuracy" }
    metrics { class_name: "Precision" config: '"top_k": 1' }
    metrics { class_name: "Precision" config: '"top_k": 3' }
    metrics { class_name: "Recall" config: '"top_k": 1' }
    metrics { class_name: "Recall" config: '"top_k": 3' }
    metrics { class_name: "MultiClassConfusionMatrixPlot" }
  }
""", tfma.EvalConfig()).metrics_specs
```

Note: For multi-label there is `MultiLabelConfusionMatrixPlot` instead of
`MultiClassConfusionMatrixPlot`

This same setup can be created using the following python code:

```python
metrics = [
    tfma.metrics.ExampleCount(name='example_count'),
    tf.keras.metrics.SparseCategoricalCrossentropy(
        name='sparse_categorical_crossentropy'),
    tf.keras.metrics.SparseCategoricalAccuracy(name='accuracy'),
    tf.keras.metrics.Precision(name='precision', top_k=1),
    tf.keras.metrics.Precision(name='precision', top_k=3),
    tf.keras.metrics.Recall(name='recall', top_k=1),
    tf.keras.metrics.Recall(name='recall', top_k=3),
    tfma.metrics.MultiClassConfusionMatrixPlot(
        name='multi_class_confusion_matrix_plot'),
]
metrics_specs = tfma.metrics.specs_from_metrics(metrics)
```

Note that this setup is also avaliable by calling
`tfma.metrics.default_multi_class_classification_specs`.

### Multi-class/Multi-label Binarized Metrics

Multi-class/multi-label metrics can be binarized to produce metrics per class,
per top_k, etc using the `tfma.BinarizationOptions`. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    binarize: { class_ids: { values: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] } }
    // Metrics to binarize
    metrics { class_name: "AUC" }
    ...
  }
""", tfma.EvalConfig()).metrics_specs
```

This same setup can be created using the following python code:

```python
metrics = [
    // Metrics to binarize
    tf.keras.metrics.AUC(name='auc', num_thresholds=10000),
    ...
]
metrics_specs = tfma.metrics.specs_from_metrics(
    metrics, binarize=tfma.BinarizationOptions(
        class_ids={'values': [0,1,2,3,4,5,6,7,8,9]}))
```

### Multi-class/Multi-label Aggregate Metrics

Multi-class/multi-label metrics can be aggregated to produce a single aggregated
value for a binary classification metric by using `tfma.AggregationOptions`.

Note that aggregation settings are independent of binarization settings so you
can use both `tfma.AggregationOptions` and `tfma.BinarizationOptions` at the
same time.

#### Micro Average

Micro averaging can be performed by using the `micro_average` option within
`tfma.AggregationOptions`. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    aggregate: { micro_average: true }
    // Metrics to aggregate
    metrics { class_name: "AUC" }
    ...
  }
""", tfma.EvalConfig()).metrics_specs
```

This same setup can be created using the following python code:

```python
metrics = [
    // Metrics to aggregate
    tf.keras.metrics.AUC(name='auc', num_thresholds=10000),
    ...
]
metrics_specs = tfma.metrics.specs_from_metrics(
    metrics, aggregate=tfma.AggregationOptions(micro_average=True))
```

Micro averaging also supports setting `top_k` where only the top k values are
used in the computation. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    aggregate: {
      micro_average: true
      top_k_list: { values: [1, 3] }
    }
    // Metrics to aggregate
    metrics { class_name: "AUC" }
    ...
  }
""", tfma.EvalConfig()).metrics_specs
```

This same setup can be created using the following python code:

```python
metrics = [
    // Metrics to aggregate
    tf.keras.metrics.AUC(name='auc', num_thresholds=10000),
    ...
]
metrics_specs = tfma.metrics.specs_from_metrics(
    metrics,
    aggregate=tfma.AggregationOptions(micro_average=True,
                                      top_k_list={'values': [1, 3]}))
```

#### Macro / Weighted Macro Average

Macro averaging can be performed by using the `macro_average` or
`weighted_macro_average` options within `tfma.AggregationOptions`. Unless
`top_k` settings are used, macro requires setting the `class_weights` in order
to know which classes to compute the average for. If a `class_weight` is not
provided then 0.0 is assumed. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    aggregate: {
      macro_average: true
      class_weights: { key: 0 value: 1.0 }
      class_weights: { key: 1 value: 1.0 }
      class_weights: { key: 2 value: 1.0 }
      class_weights: { key: 3 value: 1.0 }
      class_weights: { key: 4 value: 1.0 }
      class_weights: { key: 5 value: 1.0 }
      class_weights: { key: 6 value: 1.0 }
      class_weights: { key: 7 value: 1.0 }
      class_weights: { key: 8 value: 1.0 }
      class_weights: { key: 9 value: 1.0 }
    }
    // Metrics to aggregate
    metrics { class_name: "AUC" }
    ...
  }
""", tfma.EvalConfig()).metrics_specs
```

This same setup can be created using the following python code:

```python
metrics = [
    // Metrics to aggregate
    tf.keras.metrics.AUC(name='auc', num_thresholds=10000),
    ...
]
metrics_specs = tfma.metrics.specs_from_metrics(
    metrics,
    aggregate=tfma.AggregationOptions(
        macro_average=True, class_weights={i: 1.0 for i in range(10)}))
```

Like micro averaging, macro averaging also supports setting `top_k` where only
the top k values are used in the computation. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    aggregate: {
      macro_average: true
      top_k_list: { values: [1, 3] }
    }
    // Metrics to aggregate
    metrics { class_name: "AUC" }
    ...
  }
""", tfma.EvalConfig()).metrics_specs
```

This same setup can be created using the following python code:

```python
metrics = [
    // Metrics to aggregate
    tf.keras.metrics.AUC(name='auc', num_thresholds=10000),
    ...
]
metrics_specs = tfma.metrics.specs_from_metrics(
    metrics,
    aggregate=tfma.AggregationOptions(macro_average=True,
                                      top_k_list={'values': [1, 3]}))
```

### Query / Ranking Based Metrics

Query/ranking based metrics are enabled by specifying the `query_key` option in
the metrics specs. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    query_key: "doc_id"
    metrics {
      class_name: "NDCG"
      config: '"gain_key": "gain", "top_k_list": [1, 2]'
    }
    metrics { class_name: "MinLabelPosition" }
  }
""", tfma.EvalConfig()).metrics_specs
```

This same setup can be created using the following python code:

```python
metrics = [
    tfma.metrics.NDCG(name='ndcg', gain_key='gain', top_k_list=[1, 2]),
    tfma.metrics.MinLabelPosition(name='min_label_position')
]
metrics_specs = tfma.metrics.specs_from_metrics(metrics, query_key='doc_id')
```

### Multi-model Evaluation Metrics

TFMA supports evaluating multiple models at the same time. When multi-model
evaluation is performed, metrics will be calculated for each model. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    # no model_names means all models
    ...
  }
""", tfma.EvalConfig()).metrics_specs
```

If metrics need to be computed for a subset of models, set `model_names` in the
`metric_specs`. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    model_names: ["my-model1"]
    ...
  }
""", tfma.EvalConfig()).metrics_specs
```

The `specs_from_metrics` API also supports passing model names:

```python
metrics = [
    ...
]
metrics_specs = tfma.metrics.specs_from_metrics(
    metrics, model_names=['my-model1'])
```

### Model Comparison Metrics

TFMA supports evaluating comparison metrics for a candidate model against a
baseline model. A simple way to setup the candidate and baseline model pair is
to pass along a eval_shared_model with the proper model names (tfma.BASELINE_KEY
and tfma.CANDIDATE_KEY):

```python

eval_config = text_format.Parse("""
  model_specs {
    # ... model_spec without names ...
  }
  metrics_spec {
    # ... metrics ...
  }
""", tfma.EvalConfig())

eval_shared_models = [
  tfma.default_eval_shared_model(
      model_name=tfma.CANDIDATE_KEY,
      eval_saved_model_path='/path/to/saved/candidate/model',
      eval_config=eval_config),
  tfma.default_eval_shared_model(
      model_name=tfma.BASELINE_KEY,
      eval_saved_model_path='/path/to/saved/baseline/model',
      eval_config=eval_config),
]

eval_result = tfma.run_model_analysis(
    eval_shared_models,
    eval_config=eval_config,
    # This assumes your data is a TFRecords file containing records in the
    # tf.train.Example format.
    data_location="/path/to/file/containing/tfrecords",
    output_path="/path/for/output")
```

Comparison metrics are computed automatically for all of the diff-able metrics
(currently only scalar value metrics such as accuracy and AUC).

### Multi-output Model Metrics

TFMA supports evaluating metrics on models that have different outputs.
Multi-output models store their output predictions in the form of a dict keyed
by output name. When multi-output model's are used, the names of the outputs
associated with a set of metrics must be specified in the `output_names` section
of the MetricsSpec. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    output_names: ["my-output"]
    ...
  }
""", tfma.EvalConfig()).metrics_specs
```

The `specs_from_metrics` API also supports passing output names:

```python
metrics = [
    ...
]
metrics_specs = tfma.metrics.specs_from_metrics(
    metrics, output_names=['my-output'])
```

### Customizing Metric Settings

TFMA allows customizing of the settings that are used with different metrics.
For example you might want to change the name, set thresholds, etc. This is done
by adding a `config` section to the metric config. The config is specified using
the JSON string version of the parameters that would be passed to the metrics
`__init__` method (for ease of use the leading and trailing '{' and '}' brackets
may be omitted). For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    metrics {
      class_name: "ConfusionMatrixAtThresholds"
      config: '"thresholds": [0.3, 0.5, 0.8]'
    }
  }
""", tfma.MetricsSpec()).metrics_specs
```

This customization is of course also supported directly:

```python
metrics = [
   tfma.metrics.ConfusionMatrixAtThresholds(thresholds=[0.3, 0.5, 0.8]),
]
metrics_specs = tfma.metrics.specs_from_metrics(metrics)
```

NOTE: It is advisable to set the default number of thresholds used with AUC, etc
to 10000 because this is the default value used by the underlying histogram
calcuation which is shared between multiple metric implementations.

## Outputs

The output of a metric evaluation is a series of metric keys/values and/or plot
keys/values based on the configuration used.

### Metric Keys

[MetricKeys](https://github.com/tensorflow/model-analysis/blob/master/tensorflow_model_analysis/proto/metrics_for_slice.proto)
are defined using a structured key type. This key uniquely identifies each of
the following aspects of a metric:

*   Metric name (`auc`, `mean_label`, etc)
*   Model name (only used if multi-model evaluation)
*   Output name (only used if multi-output models are evaluated)
*   Sub key (e.g. class ID if multi-class model is binarized)

### Metric Value

[MetricValues](https://github.com/tensorflow/model-analysis/blob/master/tensorflow_model_analysis/proto/metrics_for_slice.proto)
are defined using a proto that encapulates the different value types supported
by the different metrics (e.g. `double`, `ConfusionMatrixAtThresholds`, etc).

Below are the supported metric value types:

*   [`double_value`](https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/double-value) -
    A wrapper for a double type.
*   [`bytes_value`](https://developers.google.com/protocol-buffers/docs/proto3) -
    A bytes value.
*   `bounded_value` - Represents a real value which could be a pointwise
    estimate, optionally with approximate bounds of some sort. Has properties
    `value`, `lower_bound`, and `upper_bound`.
*   `value_at_cutoffs` - Value at cutoffs (e.g. precision@K, recall@K). Has
    property `values`, each of which has properties `cutoff` and `value`.
*   `confusion_matrix_at_thresholds` - Confusion matrix at thresholds. Has
    property `matrices`, each of which has properties for `threshold`,
    `precision`, `recall`, and confusion matrix values such as
    `false_negatives`.
*   `array_value` - For metrics which return an array of values.

### Plot Keys

[PlotKeys](https://github.com/tensorflow/model-analysis/blob/master/tensorflow_model_analysis/proto/metrics_for_slice.proto)
are similar to metric keys except that for historical reasons all the plots
values are stored in a single proto so the plot key does not have a name.

### Plot Values

All the supported plots are stored in a single proto called
[PlotData](https://github.com/tensorflow/model-analysis/blob/master/tensorflow_model_analysis/proto/metrics_for_slice.proto).

### EvalResult

The return from an evaluation run is an
[`tfma.EvalResult`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/EvalResult).
This record contains `slicing_metrics` that encode the metric key as a
multi-level dict where the levels correspond to output name, class ID, metric
name, and metric value respectively. This is intended to be used for UI display
in a Jupiter notebook. If access to the underlying data is needed the `metrics`
result file should be used instead (see
[metrics_for_slice.proto](https://github.com/tensorflow/model-analysis/blob/master/tensorflow_model_analysis/proto/metrics_for_slice.proto)).

## Customization

In addition to custom metrics that are added as part of a saved keras (or legacy
EvalSavedModel). There are two ways to customize metrics in TFMA post saving:
(1) by defining a custom keras metric class and (2) by defining a custom TFMA
metrics class backed by a beam combiner.

In both cases, the metrics are configured by specifying the name of the metric
class and associated module. For example:

```python
from google.protobuf import text_format

metrics_specs = text_format.Parse("""
  metrics_specs {
    metrics { class_name: "MyMetric" module: "my.module"}
  }
""", tfma.EvalConfig()).metrics_specs
```

NOTE: When customizing metrics you must ensure that the module is available to
beam.

### Custom Keras Metrics

To create a custom keras metric, users need to extend `tf.keras.metrics.Metric`
with their implementation and then make sure the metric's module is available at
evaluation time.

Note that for metrics added post model save, TFMA only supports metrics that
take label (i.e. y_true), prediction (y_pred), and example weight
(sample_weight) as parameters to the `update_state` method.

#### Keras Metric Example

The following is an example of a custom keras metric:

```python
class MyMetric(tf.keras.metrics.Mean):

  def __init__(self, name='my_metric', dtype=None):
    super(MyMetric, self).__init__(name=name, dtype=dtype)

  def update_state(self, y_true, y_pred, sample_weight=None):
    return super(MyMetric, self).update_state(
        y_pred, sample_weight=sample_weight)
```

### Custom TFMA Metrics

To create a custom TFMA metric, users need to extend `tfma.metrics.Metric` with
their implementation and then make sure the metric's module is available at
evaluation time.

#### Metric

A `tfma.metrics.Metric` implementation is made up of a set of kwargs that define
the metrics configuration along with a function for creating the computations
(possibly multiple) needed to calcuate the metrics value. There are two main
computation types that can be used: `tfma.metrics.MetricComputation` and
`tfma.metrics.DerivedMetricComputation` that are described in the sections
below. The function that creates these computations will be passed the following
parameters as input:

*   `eval_config: tfam.EvalConfig`
    *   The eval config passed to the evaluator (useful for looking up model
        spec settings such as prediction key to use, etc).
*   `model_names: List[Text]`
    *   List of model names to compute metrics for (None if single-model)
*   `output_names: List[Text]`.
    *   List of output names to compute metrics for (None if single-model)
*   `sub_keys: List[tfma.SubKey]`.
    *   List of sub keys (class ID, top K, etc) to compute metrics for (or None)
*   `aggregation_type: tfma.AggregationType`
    *   Type of aggregation if computing an aggregation metric.
*   `class_weights: Dict[int, float]`.
    *   Class weights to use if computing an aggregation metric.
*   `query_key: Text`
    *   Query key used if computing a query/ranking based metric.

If a metric is not associated with one or more of these settings then it may
leave those parameters out of its signature definition.

If a metric is computed the same way for each model, output, and sub key, then
the utility `tfma.metrics.merge_per_key_computations` can be used to perform the
same computations for each of these inputs separately.

#### MetricComputation

A `MetricComputation` is made up of a combination of `preprocessors` and a
`combiner`. The `preprocessors` is a list of `preprocessor`, which is a
`beam.DoFn` that takes extracts as its input and outputs the initial state that
will be used by the combiner (see [architecture](architecture.md) for more info
on what are extracts). All preprocessors will be executed sequentially in the
order of the list. If the `preprocessors` is empty, then the combiner will be
passed
[StandardMetricInputs](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/metrics/StandardMetricInputs)
(standard metric inputs contains labels, predictions, and example_weights). The
`combiner` is a `beam.CombineFn` that takes a tuple of (slice key, preprocessor
output) as its input and outputs a tuple of (slice_key, metric results dict) as
its result.

Note that slicing happens between the `preprocessors` and `combiner`.

Note that if a metric computation wants to make use of both the standard metric
inputs, but augment it with a few of the features from the `features` extracts,
then the special
[FeaturePreprocessor](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/metrics/FeaturePreprocessor)
can be used which will merge the requested features from multiple combiners into
a single shared StandardMetricsInputs value that is passed to all the combiners
(the combiners are responsible for reading the features they are interested in
and ignoring the rest).

##### Example

The following is a very simple example of TFMA metric definition for computing
the ExampleCount:

```python
class ExampleCount(tfma.metrics.Metric):

  def __init__(self, name: Text = 'example_count'):
    super(ExampleCount, self).__init__(_example_count, name=name)

def _example_count(
    name: Text = 'example_count') -> tfma.metrics.MetricComputations:
  key = tfma.metrics.MetricKey(name=name)
  return [
      tfma.metrics.MetricComputation(
          keys=[key],
          preprocessors=[_ExampleCountPreprocessor()],
          combiner=_ExampleCountCombiner(key))
  ]

class _ExampleCountPreprocessor(beam.DoFn):

  def process(self, extracts: tfma.Extracts) -> Iterable[int]:
    yield 1

class _ExampleCountCombiner(beam.CombineFn):

  def __init__(self, metric_key: tfma.metrics.MetricKey):
    self._metric_key = metric_key

  def create_accumulator(self) -> int:
    return 0

  def add_input(self, accumulator: int, state: int) -> int:
    return accumulator + state

  def merge_accumulators(self, accumulators: Iterable[int]) -> int:
    accumulators = iter(accumulators)
    result = next(accumulator)
    for accumulator in accumulators:
      result += accumulator
    return result

  def extract_output(self,
                     accumulator: int) -> Dict[tfma.metrics.MetricKey, int]:
    return {self._metric_key: accumulator}
```

#### DerivedMetricComputation

A `DerivedMetricComputation` is made up of a result function that is used to
calculate metric values based on the output of other metric computations. The
result function takes a dict of computed values as its input and outputs a dict
of additional metric results.

Note that it is acceptable (recommended) to include the computations that a
derived computation depends on in the list of computations created by a metric.
This avoid having to pre-create and pass computations that are shared between
multiple metrics. The evaluator will automatically de-dup computations that have
the same definition so ony one computation is actually run.

##### Example

The
[TJUR metrics](https://github.com/tensorflow/model-analysis/blob/master/tensorflow_model_analysis/metrics/tjur_discrimination.py)
provides a good example of derived metrics.

repository: tensorflow/model-analysis

gha_language: Python

repo_name: tensorflow/model-analysis


text:
# Argo Events - The Event-Based Dependency Manager for Kubernetes

## What is Argo Events?
Argo Events is an open source event-based dependency manager for Kubernetes. The core concept of the project are `sensors` which are implemented as Kubernetes-native Custom Resource Definition that define a set of dependencies (signals) and actions (triggers). The sensor's triggers will only be fired after it's signals have been resolved. `Sensors` can trigger once or repeatedly.
- Define multiple dependencies from a variety of signal sources
- Build custom signal microservices to support business-level constraint logic
- Trigger messages and Kubernetes object creation after successful dependency resolution
- Trigger escalation after errors, or dependency constraint failures
- Build and manage a distributed, cross-team, event-driven architecture
- Easily leverage Kubernetes-native APIs to monitor dependencies

## Why Argo Events?
- Runtime agnostic. The first runtime and package agnostic event framework for Kubernetes.
- Containers. Designed from the ground-up as Kubernetes-native.
- Extremely lightweight. All signals, with the exception of calendar-based signals, are event-driven, meaning that there is no polling involved.
- Configurable. Choose which signals to support and only deploy those you want to Kubernetes.
- Scalability & Resilient. Signal sources run as stateless microservices enabling you to easily scale.
- Simple or Complex dependencies. Manage everything from simple, linear, real-time dependencies to complex, multi-source, batch job dependencies.

## Getting Started
Argo Events is a Kubernetes CRD which can manage dependencies using kubectl commands.
- [Learn about signals](./docs/signal-guide.md)
- [Learn about triggers](./docs/trigger-guide.md)
- [Getting started](./docs/quickstart.md)
- [Want to contribute or develop/run locally?](./CONTRIBUTING.md)
- See where the project is headed in the [roadmap](./ROADMAP.md)

repository: capier/argo-events

repo_name: capier/argo-events


text:
# cross-zip [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/feross/cross-zip/master.svg
[travis-url]: https://travis-ci.org/feross/cross-zip
[npm-image]: https://img.shields.io/npm/v/cross-zip.svg
[npm-url]: https://npmjs.org/package/cross-zip
[downloads-image]: https://img.shields.io/npm/dm/cross-zip.svg
[downloads-url]: https://npmjs.org/package/cross-zip
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

### Cross-platform .zip file creation

## install

```
npm install cross-zip
```

## usage

```js
var zip = require('cross-zip')

var inPath = path.join(__dirname, 'myFolder') // folder to zip
var outPath = path.join(__dirname, 'myFile.zip') // name of output zip file

zip.zipSync(inPath, outPath)
```

## api

### `zip.zip(inPath, outPath, [callback])`

Zip the folder at `inPath` and save it to a .zip file at `outPath`. If a `callback`
is passed, then it is called with an `Error` or `null`.

### `zip.zipSync(inPath, outPath)`

Sync version of `zip.zip`.

### `zip.unzip(inPath, outPath, [callback])`

Unzip the .zip file at `inPath` into the folder at `outPath`. If a `callback` is
passed, then it is called with an `Error` or `null`.

### `zip.unzipSync(inPath, outPath)`

Sync version of `zip.unzip`.

## Windows users

This package requires [.NET Framework 4.5 or later](https://www.microsoft.com/net)
and [Powershell 3](https://www.microsoft.com/en-us/download/details.aspx?id=34595).
These come **pre-installed** on Windows 8 or later.

On Windows 7 or earlier, you will need to install these manually in order for
`cross-zip` to function correctly.

## reference

- [Stack Overflow - zipping from command line in Windows](https://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-command-prompt-using-only-windows-built-in-ca)

## related

- [cross-zip-cli](https://github.com/jprichardson/cross-zip-cli): CLI version of cross-zip.

## license

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).

repository: Hugo-AOYAGI/ToDoApp

repo_name: Hugo-AOYAGI/ToDoApp


text:
This is what is currently available in the `nightly` docker build.

**Alternate endpoint:**
To configure Firefly like you want you need to use the alternate entry point.

- Instructions are in the docker hub, scroll to the bottom. https://hub.docker.com/r/ipac/firefly
- Basically you load firefly with an alternate html path
   http://localhost/local/ instead of http://localhost/firefly/

- You can configure the image panel in the HTML file.

- When you map a directory (per the instructions) the first time, and the directory is empty,
   it will place example HTML files in there. You want to look at `firefly-dev.html`, take
   the config examples, and put them in the `index.html` and reload.

**Image Panel config:**
In `firefly-dev.html` and `index.html` you will see this big firefly config object.

- It allows for an array in `firefly.options.imageMasterAdditionalSources`
- In `firefly-dev.html` this array is created in `getMoreImagePanelDataTest()`. You can modify the function or just set the array of objects directly.
- Modify this array to your needs.  All data defined will go on the top of the panel.
- The key is setting up the URL correctly. Firefly will do token substitution with the following keys before it calls the service
	- Token substitution keys: `ra,dec,size, sizeDeg, sizeArcMin, sizeArcSec` - e.g. `${ra}`
	- Part of the DSS URL looks like this: `r=${ra}&d=${dec}&e=J2000&h=${sizeArcMin}&w=${sizeArcMin}&f=FITS&v=poss2ukstu_ir&s=ON&c=gz`
You can also see this in the examples.
	- There are 4 or 5 examples in the `firefly-dev.html`, calling DSS images, IRSA table, and a TAP obscore table.
	- Make sure you set dataType to ‘image' or ‘table'. This determines how the url is is called and what to expect for the return. 'image' returns a fits, 'table' returns a table.
	- If you have a  non-ObsCore table that has a columns with image URLs make sure you set that as well. look at around line 142 of `firefly-dev.html`, see datasource. It should have the column name that has the fits file URLs.
	- The example TAP call is to a sync service, this is one way to test out your TAP stuff until you get the async in place.
	- The token substitution is very similar to the type of stuff you see in VO standards.

**Adding more TAP services**
- `firefly.options.tap.additional.services`
- The above are object paths.  Sorry it is so deep.
- An array of objects that look like this:
	- [{ label: 'IRSA https://irsa.ipac.caltech.edu/TAP',    value: 'https://irsa.ipac.caltech.edu/TAP’ }]
- In the html file under options should/would have a entry like:
	- tap: {additional: {services: [{ label: 'IRSA https://irsa.ipac.caltech.edu/TAP', value: 'https://irsa.ipac.caltech.edu/TAP’ }]}}

I think this covers your basic needs. Turns out that there were just some simple changes in
the code and docker container that needed to be made to support your request. Like I said,
this is only in the nightly right now. We are putting out our next release sometime after
ADASS in mid October, release-2019.3.0.

repository: AstrolabeProject/firefly-al

repo_name: AstrolabeProject/firefly-al


text:
# mozart-walkthrough
A complete walkthrough for Mozart project

[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.png)](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/hejnal/mozart-walkthrough&tutorial=walkthrough.md)

repository: hejnal/mozart-walkthrough

repo_name: hejnal/mozart-walkthrough


text:
## MCUboot test plan

The current target for running the tests is the Freedom K64F board.

### Basic sign support (RSA/EC/EC256)

For each supported signing algorithm, check that non-signed, and signed
with wrong key images are not swapped to, and image signed with correct key
is swapped to.

For the 3 algorithms supported, rsa, ec and ec256, two files are provided:
key_<sign-algo>.pem, key_<sign-algo>_2.pem. And a keys file with the C public
key data for key_<sign-algo>.pem.

Build and load MCUboot:

* `newt build k64f_boot_<sign-algo>`
* `newt load k64f_boot_<sign-algo>`

Build and load good image in slot 0:

* `newt create-image k64f_blinky 1.0.1 key_<sign-algo>.pem`
* `newt load k64f_blinky`

---
***Note***

*If testing RSA/PSS `newt create-image` needs to be passed in the extra*
*flag `--rsa-pss` eg:*

`newt create-image k64f_blinky 1.0.1 key_rsa.pem --rsa-pss`

---

Build and load image in slot 1 with no signing, signed with
key_<sign-algo>_2.pem and signed with key_<sign-algo>.pem. Mark each one as
test image and check that swap only happens for image signed with
key_<sign-algo>.pem. Both others should be erased.

* `newt create-image k64f_blinky2 1.0.2 <one-of-the-sign-keys-or-none>`
* `newtmgr image upload k64f_blinky2`
* `newtmgr image list`
* `newtmgr image test <hash of slot 1>`

### Image signed with more than one key

FIXME: this is currently not functional, skip this section!

Build and load MCUboot:

* `newt build k64f_boot_rsa_ec`
* `newt load k64f_boot_rsa_ec`

Build and load good image in slot 0:

* `newt create-image k64f_blinky 1.0.1 key_rsa.pem`
* `newt load k64f_blinky`

Build and load image in slot 1 with no signing, signed with
key_<sign-algo>_2.pem and signed with key_<sign-algo>.pem. Mark each one as
test image and check that swap only happens for image signed with
key_<sign-algo>.pem. Both others should be erased.

Use all of this options:

* `newt create-image k64f_blinky2 1.0.2`

And load

* `newtmgr image upload k64f_blinky2`
* `newtmgr image list`
* `newtmgr image test <hash of slot 1>`

### Overwrite only functionality

Build/load MCUboot:

* `newt build k64f_boot_rsa_noswap`
* `newt load k64f_boot_rsa_noswap`

Build/load blinky to slot 0:

* `newt create-image k64f_blinky 1.0.1 key_rsa.pem`
* `newt load k64f_blinky`

Build/load blinky2 both with bad and good key, followed by a permanent swap
request:

* `newt create-image k64f_blinky2 1.0.2 <bad and good rsa keys>.pem`
* `newtmgr image upload k64f_blinky2`
* `newtmgr image list`
* `newtmgr image confirm <hash of slot 1>`

This should not swap and delete the image in slot 1 when signed with the wrong
key, otherwise the image in slot 1 should be *moved* to slot 0 and slot 1 should
be empty.

### Validate slot 0 option

Build/load MCUboot:

* `newt build k64f_boot_rsa_validate0`
* `newt load k64f_boot_rsa_validate0`

Build non-signed image:

* `newt create-image k64f_blinky 1.0.1`
* `newt load k64f_blinky`
* Reset and no image should be run

Build signed image with invalid key:

* `newt create-image k64f_blinky 1.0.1 key_rsa_2.pem`
* `newt load k64f_blinky`
* Reset and no image should be run

Build signed image with *valid* key:

* `newt create-image k64f_blinky 1.0.1 key_rsa.pem`
* `newt load k64f_blinky`
* Reset and image *should* run

### Swap with random failures

DISCLAIMER: be careful with copy/paste of commands, this test uses another
target/app!

Build/load MCUboot:

* `newt build k64f_boot_rsa`
* `newt load k64f_boot_rsa`

Build/load slinky to slot 0:

* `newt create-image k64f_slinky 1.0.1 key_rsa.pem`
* `newt load k64f_slinky`

Build/load slinky2 to slot 1:

* `newt create-image k64f_slinky2 1.0.2 key_rsa.pem`
* `newtmgr image upload k64f_slinky2`

Confirm that both images are installed, request a permanent request to the
image in slot 1 and check that it works.

* `newtmgr image list`
* `newtmgr image confirm <hash of slot 1>`

If everything works, now proceed with requests for permanent swap to the image
in slot 1 and do random swaps (as much as you like!). When the swap finishes
confirm that the swap was finished with the previous slot 1 image now in
slot 0 and vice-versa.

### Help

* Mass erase MCU

        $ pyocd erase --chip

* Flashing image in slot 1:

        $ pyocd flash -e sector -a 0x80000 ${IMG_FILE} bin

repository: mcu-tools/mcuboot

gha_language: C

repo_name: mcu-tools/mcuboot


text:
/*
Title: Subscriptions
Description: Managing your subscription, users, and seats
*/

# Subscriptions

The software needs to be activated using a license key. For the initial purchase and [frequently asked questions](https://www.devsense.com/purchase#faq), please see [devsense.com/purchase](https://www.devsense.com/purchase).

## Dashboard

Existing subscriptions and license keys can be managed at our [dashboard](https://www.devsense.com/account/dashboard) (upper right icon at our Web Site).

1. Create an account at the **[login/register page](https://www.devsense.com/account/login)**. You can instantly login using a social account or you can create a new account with email. The login information supplied from the vendor (*2checkout*) does not work here.

    Don't forget to click **[Send verification code]** button after filling up the e-mail address.

    ---
    ![Create new account first](imgs/create-account.png)

    ---

2. The dashboard lists license keys associated with your account. In case there are no keys yet, add it to your account using the **[Associate License Key]** button.

    ---
    ![Dashboard](imgs/dashboard.png)

    ---

## Subscriptions

The dashboard provides information about active and past subscriptions. It lists the subscriptions, shows the expiration dates, lets you to renew it, or to manage users actively using your subscription.

---
![Subscriptions](imgs/subscriptions.png)

---

## Manage Users

Under the **Subscriptions** page, each subscription lets you to **Manage Users**. Here users can be disabled to increase the available seats number, or to **extend seats** by purchasing additional seats for more users.

- **Active** state signalizes a user that activated the license on his machine.
- **Inactive** state signalizes a user that has been disabled, or a user that could not activate the product due to insufficient seats count.
- **Disable** button frees the taken seat, and deactivates the user.
- **Block** disallows user to activate the product.

---
![Manage Users](imgs/seats.png)

---

## Purchase more seats

The **Manage Users** page above allows to quickly increase the subscription seats count. Whenever there are more active users than the license was purchased for, the number can be increased at this page.

---
![Buy more seats](imgs/buy-seats.png)

---

The number represents **the total number** of seats after the purchase. Extending the number of seats also renews the subscription. The price is calculated as new seats price after the quantity discount, plus the renewal price accordingly to the expiration date.

---

For more information about subscriptions and licensing, please see the [frequently asked questions](https://www.devsense.com/purchase#faq).

repository: DEVSENSE/phptools-docs

gha_language: PHP

repo_name: DEVSENSE/phptools-docs


text:
# Communications Channels

### Overview
There are two mechanism with communicating with an TankBot platform, Remote and Local.  Remote uses network messages that are defined as part of the TankBot Platform.  Local uses the native mechanism which is likely BlueTooth to communicate with the device.  Once the network mechanism communicates with the report TankBot, the software within the TankBot takes those remote messages and passes them to the Local Mechanism.

![Alt](Documentation/Messaging.jpg)

repository: TampaIoT/TankBot

gha_language: C#

repo_name: TampaIoT/TankBot


text:
---
---

# Timeline

Use this module to create time based visualisations. The module is essentially a component manager written on top of [d3.js](http://d3js.org/), it doesn't accomplish much by itself as long as you don't pass it in some component to display.

## Example usage

This illustrates how to use the `timeline` with a [segment](#ui-segment) component.

{% highlight js %}
var {segment, timeline} = require('waves');
var d3 = timeline.d3 // or require('d3');

// some data to display
var segmentData = [
  { start: 200, duration: 200 },
  { start: 500, duration: 300 },
  // ...
];

// create the graph
var graph = timeline()
  .xDomain([0, 1000])
  .width(1000)
  .height(150);

// create the segment layer
var segmentLayer = segment()
  .data(segmentData);

// add the segment layer to the timeline
graph.add(segmentLayer);
// draw the timeline
d3.select('#timeline').call(graph.draw);

// ...later you may want to remove the layer
graph.remove(segmentLayer);
{% endhighlight %}

## Methods

{% assign method = 'constructor' %}
{% assign argument = 'opts' %}
{% assign type = 'Object' %}
{% include includes/method.md %}

If `opts` is present sets the timeline's parameters via the passed in `Object`.

Available parameters :

* `name:String = n:Number (generated unique id)`
  Sets the timeline's svg name. Can be recovered though the `timeline.name()` getter

* `fps:Number = 60`
  Sets the refresh rate of the internal `requestAnimationFrame`. In most case the default value should be fine, but can be used to force a slower drawing rate in case of heavy DOM applications

~~~javascript
var graph = timeline({
  name: 'my-timeline',
  fps: 60,
});
~~~

## Methods

{% assign method = 'xDomain' %}
{% assign argument = 'domain' %}
{% assign type = 'Array' %}
{% include includes/method.md %}

Sets the domain of the timeline in the x axis, the given `array` represents the time domain if the visualised data. To keep time consistency, this value is shared with the installed components. To prevent any unit problems with other components, the `xDomain` should be defined in seconds

{% assign method = 'yDomain' %}
{% assign argument = 'domain' %}
{% assign type = 'Array' %}
{% assign default = '[0, 1]' %}
{% include includes/method.md %}

Sets the domain of the timeline in the y axis, this value can be overriden from each installed components. If setted, the value basically acts as a default domain for the y axis in all components.

{% assign method = 'width' %}
{% assign argument = 'w' %}
{% assign type = 'Number' %}
{% include includes/method.md %}

Sets the width of the `svg` tag. Is also used to create the internal scale in the x axis, basically  a `d3.scale.linear()` with domain setted to the timeline's `xDomain` and a range setted to `[0, width]`

{% assign method = 'height' %}
{% assign argument = 'h' %}
{% assign type = 'Number' %}
{% include includes/method.md %}

Sets the height of the `svg` tag. Is also used to create the internal scale in the y axis, basically  a `d3.scale.linear()` with domain setted to the timeline's `yDomain` and a range setted to `[height, 0]`

{% assign method = 'margin' %}
{% assign argument = 'm' %}
{% assign type = 'Object' %}
{% assign default = '{ top: 0, right: 0, bottom: 0, left: 0 }' %}
{% include includes/method.md %}

Sets the margin of of the layout inside the create `svg` element. [insert Bostock link here]

{% assign method = 'add' %}
{% assign type = 'Layer' %}
{% include includes/method.md %}

Register a new component to the timeline. The added component is then configured and initialized by the timeline.

{% assign method = 'remove' %}
{% assign type = 'Layer' %}
{% include includes/method.md %}

Remove a previously registered component from the timeline. The component's group is also removed from the DOM

{% include includes/ui/color.md %}


text:
layout:post
title: Week 5
#Week 5

## This week's questions

1. When looking for an open source project to work on, I look at a number of different factors. One of the first things I try to gauge is whether the project matches well with what I know. I also look for instructions about how to contribute and try to gauge if the project welcomes new contributors. Activity in the issue tracker as well as with code commits is something else that I also look for in considering an open source project.
2. I could bring my experience working in web development to the project and perhaps contribute by helping edit the project's site and fix issues there. I could also help edit project documentation or hunt for bugs in addition to fixing minor bugs.
3. I hope to learn more about the longer term maintenance of a software project from working on open source, as well as gain experience working on a larger project. Most of my projects have been small in scope, and I have more experience in coding from scratch than in project software maintenance.
4.  I'm most worried about the reception of my potential contributions and how I can gain better understanding of a project and help out in the best way.

## Questions for Aurelia
1. What trends have you noticed in web cartography that will affect web maps the most in the near future?
2. What are the most common misconceptions about web cartography that you hear?


text:
# Training a Text Classification Model Using SQLFlow

This is a tutorial on how to train a Text Classification Model Using SQLFlow.
Note that the steps in this tutorial may be changed during the development
of SQLFlow, we only provide a way that simply works for the current version.

To support custom models like CNN text classification, you may check out the
current [design](https://github.com/sql-machine-learning/models/pull/5/files)
for ongoing development.

In this tutorial we use a
[chinese-text-classification-dataset](https://github.com/fate233/toutiao-text-classfication-dataset),
which is more complicated since we need to consider sentence segments. To adapt
this tutorial to some English data set could be simple.

**NOTE**: to achieve better accuracy

# Steps to Run

1. Download the dataset from https://github.com/fate233/toutiao-text-classfication-dataset and unpack
   `toutiao_cat_data.txt.zip`.
1. Copy `toutiao_cat_data.txt` to `/var/lib/mysql-files/` on the server your MySQL located on, this is
   because MySQL may prevent importing data from an untrusted location.
1. Login to MySQL command line like `mysql -uroot -p` and create a database and table to load the
   dataset, note the table must create with `CHARSET=utf8 COLLATE=utf8_unicode_ci` so that the Chinese
   texts can be correctly shown.
    ```sql
    CREATE DATABASE toutiao;
    CREATE TABLE `train` (
        `id` bigint(20) NOT NULL,
        `class_id` int(3) NOT NULL,
        `class_name` varchar(100) NOT NULL,
        `news_title` varchar(255) NOT NULL,
        `news_keywords` varchar(255) NOT NULL)
    ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

    CREATE TABLE `train_processed` (
        `id` bigint(20) NOT NULL,
        `class_id` int(3) NOT NULL,
        `class_name` varchar(100) NOT NULL,
        `news_title` TEXT NOT NULL,
        `news_keywords` varchar(255) NOT NULL)
    ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

    CREATE TABLE `test_processed` (
        `id` bigint(20) NOT NULL,
        `class_id` int(3) NOT NULL,
        `class_name` varchar(100) NOT NULL,
        `news_title` TEXT NOT NULL,
        `news_keywords` varchar(255) NOT NULL)
    ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
    COMMIT;
    ```
1. In the MySQL shell, type below line to load the dataset into created table:
    ```sql
    LOAD DATA LOCAL
    INFILE '/var/lib/mysql-files/toutiao_cat_data.txt'
    INTO TABLE train
    CHARACTER SET utf8
    FIELDS TERMINATED by '_!_'
    LINES TERMINATED by "\n";
    ```
1. Run [this](https://gist.github.com/typhoonzero/dd3d814f3d4bae4538842df2a659d278)
   python script to generate a vocabulary, and process the raw news title texts to padded word ids. The max length of the segmented sentence is `92`. Note that this python script also change the `class_id`
   column's value to `0~17` which originally is `100~117` since we accept label start from `0`.
1. Split some of the data into a validation table, and remove the validation
   data from train data:
    ```sql
    INSERT INTO `test_processed` (`id`, `class_id`, `class_name`, `news_title`, `news_keywords`)
    SELECT `id`, `class_id`, `class_name`, `news_title`, `news_keywords` FROM `train_processed`
    ORDER BY RAND()
    LIMIT 5000;

    DELETE FROM `train_processed` WHERE id IN (
        SELECT id FROM `test_processed` AS p
    )
    ```
1. Then use the following statements to train and predict using SQLFlow:
    ```sql
    SELECT *
    FROM toutiao.train_processed
    TRAIN DNNClassifier
    WITH
    n_classes = 17,
    hidden_units = [128, 512]
    COLUMN news_title
    LABEL class_id
    INTO sqlflow_models.my_text_model;

    SELECT *
    FROM toutiao.test_processed
    PREDICT toutiao.predict.class_id
    USING sqlflow_models.my_text_model;
    ```
1. Then you can get validation result from table `toutiao.predict`:

branch_name: refs/heads/develop

gha_language: Go


text:
# fexplorer
A minimal in-browser file explorer for Unix-like systems, written in python.

# About

This program starts a local server which can be visited from the browser to
access the files on which the server is running. This program can run on
servers, home computer or a RaspberryPi and grants access their files anywhere
in the Internet.

It features an in-built text viewer and by default will open any file that can
be opened as text. ALso it can open any other content(pdfs, videos, audios) as
long as the browser can open it. Most modern browsers often come with a video
player, music player and a pdf reader, so no external dependencies are
required. Files can also be downloaded from the web UI directrly or streamed
using your favourite player. .

# Pre-requisites

* python3 (3.6+)
* gunicorn (installed via package manager)

# Installation

* Clone the repo:
    ```bash
    git clone https://github.com/neelkamal0310/fexplorer.git
    cd fexplorer
    ```
* Install requirements.
    ```bash
    python3 -m pip install -r requirements.txt
    ```
* Run `install.sh` after making it executable.
    ```
    chmod +x install.sh
    ./install.sh
    ```

* This creates and copies files to a relevant location and starts a systemd
  service. To autostart this after you login, run
  ```bash
  systemctl enable --user fexplorer.service
  ```

* Note: The systemd service will terminate when the user logs out. This is more
  relevant on a server or Raspberry Pi where you have to SSH to log in. After
  you log out or exit the SSH session, the service will be terminated. To
  prevent this either start the service inside a `tmux` session or run the
  following command:
  ``` bash
  loginctl enable-linger $(whoami)
  ```
  More info on what this command does [here](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances)

# Notes

* By default, the program listens on loopback address <IP_ADDRESS> and port 5000 (can be changed), and will not work if there are any other programs using port 5000.
* Only files and directories accessible by the user running the program will be accessible.

# Work in progress

* Authentication


text:
# Target Reacts
## This module requires the following modules
- Sequencer
- Token Magic Fx
- MIDI-QOL

## Overview
- This module works in conjunction with MIDI-QOL to add certain effects to the target when they are hit by a roll.
- Reactions can be set up and customzied for each item, as well as each target individually
- Sounds can be added to targets to be played at random when they are hit

## Usage Instructions

# Item Settings
- These are the item specific settings. The first tab controlls settings for when the target is hit, but does not die from the hit
- The second tab controlls settings for when the target dies from the hit

![target-reacts-item-settings](https://user-images.githubusercontent.com/32877348/142693460-f01692ab-0783-4fed-b889-89c407a7a74e.png)
- **Reaction Delay:** Delay on the target's reaction caused by this item
- **Shake Magnitude:** How far from the initial spot the target will move
- **Shake Amount:** How many times to shake the target
- **Shake Duration:** How long each (singular) shake animation will take in ms

# Actor Settings
- These are the actor specific settings. Similarly to the item settings, the first tab controlls settings for when the target is hit, but does not die from the hit
- The second tab controlls settings for when the target dies from the hit

![target-reacts-actor-settings](https://user-images.githubusercontent.com/32877348/142693877-d37d92c6-fc0d-4705-bc48-2c4330d8e5e9.png)
- **Sound File Path:** Path to the sound file
- **Add Sound:** Add a new row to be assign another sound
- **Remove Sound:** Remove the bottom sound file row
- **Target Volume:** Volume of the sound effect played
- **Enable Blood:** Put a blood splash on the target when it is hit
- **Blood Color:** The color of the blood splash to be put on the target

# Scene Controls
- A new button in the token scene control can be used to remove any TargetReacts blood effects on a token. The token must be selected before the button is pressed.

![target-reacts-scene-menu](https://user-images.githubusercontent.com/32877348/142694361-f842cf86-d0f6-4235-b5ba-881ef0a54a97.png)


text:
Super ListView Viewer
=====================

Demonstrates the use of the Salesforce List View API, for more information see [blog](http://andyinthecloud.com/2014/09/20/super-listview-viewer-using-winter15-listview-api/) for more details.

![Alt text](/images/screenshot.png "Optional title")

repository: tquilapratyush/listviewapidemo

repo_name: tquilapratyush/listviewapidemo


text:
Great news for everyone who wants to work side-by-side with best developers and practice in creating your own apps!
On **Saturday** we’ll have **3** cool **workshops** in Community track:

* **Getting started with Firebase** from [Juarez Filho](http://devfest.gdg.org.ua/#!/speakers/19), an enthusiastic Front end Engineer with over 7 years of experience. You will learn how to use Firebase to empower your web applications using all features provided by Firebase like realtime database, authentication, hosting and much more.

* **Your first server-side application in Dart** from [Jana Moudrá](http://devfest.gdg.org.ua/#!/speakers/14), Google Developer Expert for Dart and event organiser for GDG Prague.
In this session you will explore how to write your first Dart server-side application which will be later used during the Polymer workshop. Come to this workshop to try and learn Dart, have fun and see how you can write awesome applications with it.
Note: please don't forget to bring your laptop with downloaded Dart and some editor/IDE with Dart support. More info:
[https://www.dartlang.org/downloads/](https://www.dartlang.org/downloads/)

* **Let's build a new Polymer application** from [Jakub Škvára](http://devfest.gdg.org.ua/#!/speakers/15), a member of GDG Prague and GDG ČVUT in Czech republic.
You will see how to build nice looking front-end application using Polymer Starter Kit and predefined set of elements and components. We're going to use backend API from Dart code lab. Note: please don't forget to bring your laptop and download [Polymer Starter Kit](https://developers.google.com/web/tools/polymer-starter-kit/)

Feel free to visit both workshops, but you can also attend Dart or Polymer workshops individually.

**Workshops format - Bring your own laptop.** All workshops will be conducted in English.

See you soon!

extension: markdown


text:
Function: ephemeral
===================

This function defines the configuration for a bare metal ephemeral
bootstrapping image, which can be built via ``airshipctl image build``
and delivered over the WAN to a remote
host via redfish using ``airshipctl baremetal remotedirect``.

REQUIRED: a ``networking`` VariableCatalogue must be used to
override some Kubernetes networking configuration.
A base example for this catalogue can be found in the ``airshipctl-base-catalogues``
function.  If using the catalogue, apply the ``replacements/`` entrypoint
at the site level, as a Kustomize transformer.

Alternately, the entire text payload of the ephemeral secret may be overridden
via normal Kustomize patching.

repository: airshipit/airshipctl

repo_name: airshipit/airshipctl


text:
# README #

Attention: for Windows users, replace `gradlew` with `gradlew.bat`

## How to Use ##
- Set up EC2 instance and pull from master
- Update instances to [Java 9](#markdown-header-to-install-java9) if required
- Create a "server.txt" file in the project root with Public DNS addresses of each EC2 instance
- Generate public/private ssh key (without password) and save to keys/server-to-server:

_Note: from the project root directory_
```
> ssh-keygen -t rsa -b 4096 -C "server-to-server"
```
- Initialize the instances with the following commands:

_Note: substitute first argument with path to actual pem file_
```
> ./script/deploymentScript /Users/kierse/.ssh/eece513_aws.pem --ssh-keys
```
- Run the following command to build and deploy:

_Note: substitute populate pem flag with path to actual file_
```
> ./gradlew bootstrapAws -Ppem=/Users/kierse/.ssh/eece513_aws.pem
```
- In any EC2 instance home directory, start a cluster node:
```
> java -jar distributed-app-1.0.jar
```
- On startup, the node will print out its join address. This address can be used by other nodes wishing to join its cluster:

_Note: replace <IP_ADDRESS> with the join address obtained in the previous step_
```
> java -jar distributed-app-1.0.jar <IP_ADDRESS>
```

**_Warning: starting a node without the address of an existing cluster will effectively create a second cluster._**

### Run commands across cluster ###

_Note: substitute path to actual pem file_
```
> csshx/csshX --login ec2-user -ssh_args "-i ~/.ssh/eece513_aws.pem" --hosts servers.txt
```

## fs513 ##
fs513 is a command line script that can be used to interact with the distributed filesystem.
```
usage: ./fs513 <action> [<option1> <option2>]

 Actions:
    put <localFileName> <remoteFileName>  (add a local file to fs513 with the given fs513 name)
    get <remoteFileName> <localFileName>  (fetch a fs513 file to the local machine)
    remove <remoteFileName>               (delete a file from fs513)

    grep [<arg1> <arg2> ... <argN>]       (search the fs513 server logs)
    locate <remoteFileName>               (list all machines (name / id / IP address) of the servers that contain a copy of the file)
    ls                                    (list all files in fs513)
    lshere                                (list all fs513 files stored on the local machine)

    --help                                (print this message)
```
### Supported fs513 commands ###
##### add file #####
```
./fs513 put foo.txt foo/bar/baz
```
##### get file #####
```
./fs513 get foo/bar/baz foo.txt
```
##### remove file #####
```
./fs513 remove foo/bar/baz
```
##### grep server logs #####
```
./fs513 grep -i "no files to sync""
```
##### locate file #####
```
./fs513 locate foo/bar/baz
```
##### list files in filesystem #####
```
./fs513 ls
```
##### list files on current machine #####
```
./fs513 lshere
```

## Tests ##

#### Unit Tests ####
```
 > ./gradlew test
```
#### Distributed Tests ####
```
 > ./gradlew distributedTest
```

## UPGRADE FROM JAVA7/8 TO JAVA9 ###

### To install Java9 ###

```
> wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9.0.4+11/c2514751926b4512b076cc82f959763f/jdk-9.0.4_linux-x64_bin.rpm
> sudo yum install jdk-9.0.4_linux-x64_bin.rpm
```

### To remove old Java versions ###

```
> sudo yum remove java-1.8.0-openjdk
> sudo yum remove java-1.7.0-openjdk
```

repository: kierse/distributed-app

repo_name: kierse/distributed-app


text:
# jindex

Enumerate the paths through a JSON document,
with an output that is API-compatible with [gron](https://github.com/tomnomnom/gron)

[![Rust](https://github.com/ckampfe/jindex/actions/workflows/rust.yml/badge.svg)](https://github.com/ckampfe/jindex/actions/workflows/rust.yml)

## Installation

Latest stable release from crates.io:

```
$ cargo install jindex
```

Latest unstable (HEAD) release from source:

```
$ cargo install --git https://github.com/ckampfe/jindex
```

## Examples

You can pass JSON through stdin:

```
$ echo '{
  "a": 1,
  "b": 2,
  "c": ["x", "y", "z"],
  "d": {"e": {"f": [{}, 9, "g"]}}
}' | jindex

json.d.e.f[2] = "g";
json.d.e.f[1] = 9;
json.d.e.f[0] = {};
json.c[2] = "z";
json.c[1] = "y";
json.c[0] = "x";
json.b = 2;
json.a = 1;
```

or from a file:

```
$ jindex myfile.json

json.d.e.f[2] = "g";
json.d.e.f[1] = 9;
json.d.e.f[0] = {};
json.c[2] = "z";
json.c[1] = "y";
json.c[0] = "x";
json.b = 2;
json.a = 1;
```

With the [json_pointer](https://datatracker.ietf.org/doc/html/rfc6901) format option:

```
$ jindex -fjson_pointer myfile.json
/d/e/f/2        "g"
/d/e/f/1        9
/d/e/f/0        {}
/c/2    "z"
/c/1    "y"
/c/0    "x"
/b      2
/a      1
```

With the `json` format option:

```
jindex -fjson myfile.json
{"path_components":["d","e","f",2],"value":"g"}
{"path_components":["d","e","f",1],"value":9}
{"path_components":["d","e","f",0],"value":{}}
{"path_components":["c",2],"value":"z"}
{"path_components":["c",1],"value":"y"}
{"path_components":["c",0],"value":"x"}
{"path_components":["b"],"value":2}
{"path_components":["a"],"value":1}
```

## Command-line interface

```
$ jindex -h
jindex 0.8.2
Enumerate the paths through a JSON document

USAGE:
    jindex [OPTIONS] [json-location]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --format <format>    gron, json_pointer, json [default: gron]

ARGS:
    <json-location>    A JSON file path

```

## Path output order

`jindex` makes *no guarantees at all* about the order in which paths are output.
Paths may appear depth-first, breadth-first, or any other order at all relative to their position in the input JSON document.
Further, *any ordering is not guaranteed to be stable from one version to the next*,
as it may change to aid the implementation of new optimizations.
If a stable order is important, I recommend using `sort` or some other after-the-fact
mechanism, as the set of paths output from a given input document are guaranteed
to be stable over time.

## Performance

To run the benchmarks:

```
# install the benchmark runner
$ cargo install cargo-criterion
```

```
# clone the project
$ git clone https://github.com/ckampfe/jindex
```

```
# run the benchmarks
$ cd jindex
$ cargo criterion
```

## Features

`jindex` uses [jemalloc](http://jemalloc.net/) by default for a substantial increase in throughput.
If you do not wish to use jemalloc, you can build without it by passing the `--no-default-features` flag to Cargo.

## Version policy

`jindex` remains pre-1.0 and as such does not guarantee API compatibility from one version to the next. That said, `jindex` has a very small API, and is not likely to change markedly in the future. Reaching a 1.0 version is a project goal but not one I consider more important than others. If this is a problem or if you have questions please open an issue.

repository: ckampfe/jindex

gha_language: Rust

repo_name: ckampfe/jindex


text:
---
layout: page
title: Lean Prover Zulip Chat Archive
permalink: archive/116395maths/54424intcoenatmax.html
---

## [maths](index.html)
### [int.coe_nat_max](54424intcoenatmax.html)

#### [Kevin Buzzard (Sep 06 2018 at 19:13)](https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/int.coe_nat_max/near/133455883):
I don't *think* `int.coe_nat_max : {m n : ℕ} : (↑(max m n) : ℤ) = max m n` is in mathlib, and I needed it today. Kenny produced this proof:

```lean
theorem int.coe_nat_max {m n : ℕ} : (↑(max m n) : ℤ) = max m n :=
begin
  unfold max,simp [int.coe_nat_le],
  split_ifs;refl,
end
```

but I was thinking that the result probably lived near the beginning of `data.int.basic` and I'm not sure that the devs will want `split_ifs` to be used in such a low-level file. Should it go later on or should we think of a more low-level proof? (or is it there already?)

#### [Mario Carneiro (Sep 06 2018 at 19:28)](https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/int.coe_nat_max/near/133456744):
I agree this belongs in `data.int.basic`, and there is no problem using `split_ifs`. The mathlib tactics are all very low in the dependency order so that mathlib can use them