text:
# mod_deepgram_transcribe

A Freeswitch module that generates real-time transcriptions on a Freeswitch channel by using Deepgram's streaming transcription API

## API

### Commands
The freeswitch module exposes the following API commands:

```
uuid_deepgram_transcribe <uuid> start <lang-code> [interim]
```
Attaches media bug to channel and performs streaming recognize request.
- `uuid` - unique identifier of Freeswitch channel
- `lang-code` - a valid AWS [language code](https://docs.deepgram.amazon.com/transcribe/latest/dg/what-is-transcribe.html) that is supported for streaming transcription
- `interim` - If the 'interim' keyword is present then both interim and final transcription results will be returned; otherwise only final transcriptions will be returned

```
uuid_deepgram_transcribe <uuid> stop
```
Stop transcription on the channel.

### Channel Variables

| variable | Description |
| --- | ----------- |
| DEEPGRAM_API_KEY | Deepgram API key used to authenticate |
| DEEPGRAM_SPEECH_TIER | https://developers.deepgram.com/documentation/features/tier/ |
| DEEPGRAM_SPEECH_CUSTOM_MODEL | custom model id |
| DEEPGRAM_SPEECH_MODEL | https://developers.deepgram.com/documentation/features/model/ |
| DEEPGRAM_SPEECH_MODEL_VERSION | https://developers.deepgram.com/documentation/features/version/ |
| DEEPGRAM_SPEECH_ENABLE_AUTOMATIC_PUNCTUATION | https://developers.deepgram.com/documentation/features/punctuate/ |
| DEEPGRAM_SPEECH_PROFANITY_FILTER | https://developers.deepgram.com/documentation/features/profanity-filter/ |
| DEEPGRAM_SPEECH_REDACT | https://developers.deepgram.com/documentation/features/redact/ |
| DEEPGRAM_SPEECH_DIARIZE | https://developers.deepgram.com/documentation/features/diarize/  |
| DEEPGRAM_SPEECH_DIARIZE_VERSION |  https://developers.deepgram.com/documentation/features/diarize/  |
| DEEPGRAM_SPEECH_NER | https://developers.deepgram.com/documentation/features/named-entity-recognition/ |
| DEEPGRAM_SPEECH_ALTERNATIVES | number of alternative hypotheses to return (default: 1) |
| DEEPGRAM_SPEECH_NUMERALS | https://developers.deepgram.com/documentation/features/numerals/ |
| DEEPGRAM_SPEECH_SEARCH | https://developers.deepgram.com/documentation/features/search/ |
| DEEPGRAM_SPEECH_KEYWORDS | https://developers.deepgram.com/documentation/features/keywords/ |
| DEEPGRAM_SPEECH_REPLACE | https://developers.deepgram.com/documentation/features/replace/  |
| DEEPGRAM_SPEECH_TAG | https://developers.deepgram.com/documentation/features/tag/ |
| DEEPGRAM_SPEECH_ENDPOINTING  | https://developers.deepgram.com/documentation/features/endpointing/ |
| DEEPGRAM_SPEECH_VAD_TURNOFF | https://developers.deepgram.com/documentation/features/voice-activity-detection/ |

### Events
`deepgram_transcribe::transcription` - returns an interim or final transcription.  The event contains a JSON body describing the transcription result:
```js
{
	"channel_index": [0, 1],
	"duration": 4.59,
	"start": 0.0,
	"is_final": true,
	"speech_final": true,
	"channel": {
		"alternatives": [{
			"transcript": "hello hello hello",
			"confidence": 0.98583984,
			"words": [{
				"word": "hello",
				"start": 3.0865219,
				"end": 3.206,
				"confidence": 0.99902344
			}, {
				"word": "hello",
				"start": 3.5644348,
				"end": 3.644087,
				"confidence": 0.9741211
			}, {
				"word": "hello",
				"start": 4.042348,
				"end": 4.3609567,
				"confidence": 0.98583984
			}]
		}]
	},
	"metadata": {
		"request_id": "37835678-5d3b-4c77-910e-f8914c882cec",
		"model_info": {
			"name": "conversationalai",
			"version": "2021-11-10.1",
			"tier": "base"
		},
		"model_uuid": "6b28e919-8427-4f32-9847-492e2efd7daf"
	}
}
```

## Usage
When using [drachtio-fsrmf](https://www.npmjs.com/package/drachtio-fsmrf), you can access this API command via the api method on the 'endpoint' object.
```js
ep.api('uuid_deepgram_transcribe', `${ep.uuid} start en-US interim`);
```


text:
## FAQ

**Q:**
If Textadept is so minimalist, why are the downloads tens of MB in size and the unzipped
folders more than double that? Why is the Git repository more than 50MB in size?

**A:**
Each download contains 2 executables: a GUI version and a terminal version. Furthermore, the
Windows and macOS packages bundle in Qt runtimes, accounting for 60-90% of the total application
size. (Qt is the cross-platform GUI toolkit Textadept uses.)

The Git repository is an export of an underlying Mercurial repository and is not compressed or
optimized for size. After the initial clone, you can run `git gc --aggressive` to reduce its
footprint to about a third of the original size.

- - -

**Q:**
On Linux, Textadept will not run, or I get odd behavior in the terminal version, even crashes. How
do I fix this?

**A:**
Short answer: you will need to [compile][] Textadept manually for your system, which is a very
straightforward and easy process.

Long answer: it is difficult to provide a binary that runs on all Linux platforms since
the library versions installed vary widely from distribution to distribution. For example,
"libpng14" was available for many distributions starting in late 2009 while Ubuntu 12.04 (circa
2012) used "libpng12". More recently, some distributions have started using "libncurses6"
while many distributions are still on "libncurses5". Finally, C++ runtime libraries are not
always compatible between versions. The only way to avoid problems that stem from these cases
is to compile Textadept for the target system.

[compile]: manual.html#compiling

- - -

**Q:**
On Windows my anti-virus software says Textadept contains a virus. Does it? Or is this a
false-positive?

**A:**
Textadept does not contain any viruses and it certainly is a false positive. The likely culprit
is the `textadept-curses.exe` executable, which runs in the Windows command prompt.

- - -

**Q:**
Why can't Textadept handle HUGE files very well?

**A:**
Textadept is an editor for programmers. It is unlikely a programmer would be editing a gigantic
log file. There are other tools for that case.

- - -

**Q:**
When I open a file in a non-English or non-European language, I see a lot of strange characters.

**A:**
Textadept was not able to detect the file's encoding correctly. You'll need to [help it][].

On Windows, if you are seeing strange characters in the filename (including '?'), your file's
name contains characters outside the system's encoding, and due to Microsoft's C runtime library
limitations, Textadept cannot open files like those.

[help it]: manual.html#encoding

- - -

**Q:**
When I click the "Compile" or "Run" menu item (or execute the key command), either nothing shows up
in the command entry, or the wrong command shows up. How can I tell Textadept which command to run?

**A:**
The LuaDoc describes [compile and run commands][] and you can configure them in your
[preferences][]. Also, Textadept will remember any compile/run commands you manually enter for
the current session.

[compile and run commands]: api.html#textadept.run
[preferences]: manual.html#textadept

- - -

**Q:**
In Linux, middle-clicking in the terminal version does not paste the primary selection and
selecting text does copy to the primary selection. All other terminal apps support this
functionality, why not Textadept?

**A:**
It does; use the `Shift` modifier key with your middle-clicking and text selecting. Textadept
interprets non-`Shift`ed mouse events like a GUI application.

- - -

**Q:**
The terminal version does not support feature _x_ the GUI version does. Is this a bug?

**A:**
Maybe. Some terminals do not recognize certain key sequences like `Shift+Arrow` for making
selections. Linux's virtual terminals (the ones accessible with `Ctrl+Alt+FunctionKey`) are an
example. GNOME Terminal, LXTerminal and XTerm seem to work fine. rxvt and rxvt-unicode do not
work out of the box, but may be configurable.

Please see the [terminal version compatibility][] section of the appendix. If the feature
in question is not listed there, it may be a bug. Please contact me (see README.md) with any
bug reports.

[terminal version compatibility]: manual.html#terminal-version-compatibility

- - -

**Q:**
Pressing `^O` in the terminal version on macOS does not do anything. Why?

**A:**
For whatever reason, `^O` is discarded by the terminal driver. To enable it, run `stty discard
undef` first. You can put the command in your *~/.bashrc* or *~/.bash_profile* to make it
permanent.

- - -

**Q:**
How can I get the terminal version on macOS to show more than 8 colors?

**A:**
Enable the "Use bright colors for bold text" setting in your Terminal.app preferences.

- - -

**Q:**
Why does Textadept remember its window size but not its window position?

**A:**
Your window manager is to blame. Textadept is not responsible for, and should never attempt to
set its window position.

- - -

**Q:**
I am not able to use the "Consolas" or [insert other Windows font package here] on
Windows. Textadept just uses a default font. How can I get it to use my font?

**A:**
You'll have to provide the full name of the font, such as "Consolas Regular", rather than just
the name of the "ttf" file in your Fonts directory.

- - -

**Q:**
Where can I find a complete list of key bindings for Textadept?

**A:**
[Here](api.html#textadept.keys).

license: MIT

repository: orbitalquark/textadept

branch_name: refs/heads/default

extension: md

gha_language: Lua

gha_license_id: MIT

license_type: permissive

repo_name: orbitalquark/textadept


text:
![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)
[![Build Status](https://github.com/goccmack/gogll/workflows/build/badge.svg)](https://github.com/goccmack/gogll/actions)

Copyright 2019 Marius Ackerman.

# Note
This version does not support Rust. Please use v3.2.0 for Rust or log an issue if you need the features of this version in Rust.

# GoGLL
Gogll generates a GLL or LR(1) parser and FSA-based lexer for any context-free grammar.
The generated code is Go or Rust.

[Click here](https://goccmack.github.io/posts/2020-05-31_gogll/) for an introduction
to GLL.

See the [LR(1) documentation](doc/lr1/Readme.md) for generating LR(1) parsers.

The generated GLL parser is a clustered nonterminal parser (CNP) following
[[Scott et al 2019](#Scott-et-al-2019)].
CNP is a version of generalised LL parsing (GLL)
[[Scott & Johnstone 2016](#Scott-et-al-2016)].
GLL parsers can parse all context free (CF) languages.

The generated LR(1) parser is a Pager's PGM or Knuth's original LR(1)
machine [[Pager 1977](Pager-1977)].

The generated lexer is a linear-time finite state automaton FSA
[[Grune et al 2012](#Grune-et-al-2012)].
The lexer ignores whitespace.

Gogll accepts grammars in markdown files, which is very useful for documenting the grammar.
For example: see
[gogll's own grammar](gogll.md).

GLL has worst-case cubic time and space complexity but linear complexity for all
LL productions [[Scott et al 2016](#Scott-et-al-2016)].
[See here](https://goccmack.github.io/posts/2020-05-31_gogll/) for space and
CPU time measurements of an extreme ambiguous example.
For comparable grammars tested so far gogll produces faster lexers and parsers
than [gocc](https://github.com/goccmack/gocc) (FSA/LR-1).

# News
## 2022-10-11
SPPF extraction added to the generated code. See [boolx example](examples/boolx/SPPF.md)
## 2022-08-09
Gogll is used to build DAU [DASL](https://dau-technology.github.io/dau-blog/post/2022-08-02-dasl/)

## 2020-08-12
From v3.2.0 gogll supports tokens that can be suppressed by the lexer. This is useful, for example, to implement code comments. See [example](examples/comments/comments.md).

## 2020-06-28
1. Gogll now also generates LR(1) parsers. It supports
_Pager's Practical General Method, weak compatibility_ as well as
_Knuths original LR(1) machine_ for
comparison. Pager's PGM generates LR(1) parser tables similar is size to LALR.
The option to generate a Knuth LR(1) machine is provide for reference.
See [LR(1) documentation](doc/lr1/Readme.md) for details.

2. Please note that the `-t <target>` option has been replace by `-go` and `-rust`.
See see [usage](#Usage) below.

## 2020-06-01
[See](https://goccmack.github.io/posts/2020-05-31_gogll/) for an introduction
to GLL and a performance comparison of the generated Go and Rust code parsers.

## 2020-05-22
GoGLL v3.1 generates Rust as well as Go parsers with similar performance:

|| Lexer | Parser | Build
|---|---|---|---|
Go | 119 μs | 1324 μs | 0.124s
Rust | 71 μs | 1297 μs | 2.932s

1. The duration was averaged over 1000 repetitions.
1. Build time was measures with the time command.
    1. For Rust: `time cargo build --release`
    2. For Go: `time go build`

See [examples/rust](examples/rust/Readme.md) for the Rust and Go programs used
for this comparison.

Use gogll's target option to generate a Rust lexer/parser: `-t rust` (see [usage](#Usage) below).
Gogll generates Go code by default.

## 2020-04-24
1. GoGLL now generates a linear-time FSA lexer matching the CNP parser.
1. This version of *GoGLL is faster than gocc*. It compiles a sample grammar in
0.074 s, which GoCC compiles in 0.118 s. Gogll compiles itself in 0.041s.

#

# Benefits and disadvantages of GLL and LR(1)
GLL is a parsing technique that can handle any context-free (CF) language. GLL has
worst case cubic time and space complexity.

LR(1) handles a subset of the context-free languages that can be parsed bottom-up
with one token look-ahead. LR(1) has linear time complexity and its table driven
parser is very efficient. Pager's _Practical General Method_ (PGM) combines
compatible states as they are generated, keeping the state space small.

A GLL parser has more expensive bookkeeping than an LR(1) parser, making the
LR(1) parser more efficient for parsing very large inputs.

## When to use GLL
1. When the CF grammar that best expresses the problem is not LR(1).
2. When the LR(1) parser has more than a few conflicts that require additional
language symbols or complex grammar refactorisation to resolve.
3. The inputs to be parsed are not too big. GLL works very well for DSLs or
programming languages.

## When to use LR(1)
1. When the language can be expressed as an LR(1) grammar. A grammar is LR(1) if
gogll can generate a conflict-free parser for it.
2. When the input is very big, for example: log files containing tens of thousands
of lines.

# Motivation for a separate lexer
The following observations were made while using GoGLLv2 on a couple of projects.

* Most of the ambiguity in grammars were generated by the lexical rules.
* Handling token separation explicitly produces messy, hard to maintain grammars.
* Most of a grammar input file is whitespace, which together with the additional
ambiguity introduced by the lexical rules, causes most of the parse time in a
scannerless parser.
* Writing good markdown with the grammar produced slow compilations.

# Input Symbols, Markdown Files
Gogll and lexers generated by gogll accept UTF-8 input strings, which may be in
a markdown file or a plain text file.

If the input is a markdown file gogll and lexers generated by gogll treat all
text outside markdown code blocks as whitespace. Markdown code blocks are
delimited by triple backticks. See [gogll.md](gogll.md) for an example.

# Gogll Grammar
Gogll v3 has a BNF grammar. See [gogll.md](gogll.md)

# Installation
1. Install Go from [https://golang.org](https://golang.org)
1. `go install github.com/goccmack/gogll/v3@latest` or
1. Clone this repository and run `go install` in the root of the directory where
it is installed.

# Usage
Enter `gogll -h` or `gogll` for the following help:

```
use: gogll -h
    for help, or

use: gogll -version
    to display the version of goggl, or

use: gogll [-a][-v] [-CPUProf] [-o <out dir>] [-go] [-rust] [-gll] [-pager] [-knuth] [-resolve_conflicts] <source file>
    to generate a lexer and parser.

    <source file>: Mandatory. Name of the source file to be processed.
        If the file extension is ".md" the bnf is extracted from markdown code
        segments enclosed in triple backticks.

    -a: Optional. Regenerate all files.
        WARNING: This may destroy user editing in the LR(1) AST.
        Default: false

    -v: Optional. Produce verbose output, including first and follow sets,
        LR(1) sets and lexer FSA sets.

    -o <out dir>: Optional. The directory to which code will be generated.
                  Default: the same directory as <source file>.

    -go: Optional. Generate Go code.
          Default: true, but false if -rust is selected

    -rust: Optional. Generate Rust code.
           Default: false

    -gll: Optional. Generate a GLL parser.
          Default true. False if -knuth or -pager is selected.

    -knuth: Optional. Generate a Knuth LR(1) parser
            Default false

    -pager: Optional. Generate a Pager PGM LR(1) parser.
            Default false

    -resolve_conflicts: Optional. Automatically resolve LR(1) conflicts.
            Default: false. Only used when generating LR(1) parsers.

    -bs: Optional. Print BSR statistics (GLL only).

    -CPUProf : Optional. Generate a CPU profile. Default false.
        The generated CPU profile is in <cpu.prof>.
        Use "go tool pprof cpu.prof" to analyse the profile.
```

# Using the generated lexer and parser
1. Create a lexer:
From an `[]rune`:
```
	lexer.New(input []rune) *Lexer
```
  or from a file. If the file extension us `.md` the lexer will
  treat all text outside the markdown code blocks as whitespace.
```
	lexer.NewFile(fname string) *Lexer
```
2. Parse the lexer:
```
	if err, errs := parser.Parse(lex); err != nil {...}
```
3. Check for ambiguities in the parse forest
```
	if bsr.IsAmbiguous() {
		fmt.Println("Error: Ambiguous parse forest")
		bsr.ReportAmbiguous()
		os.Exit(1)
	}
```
Ambiguous BSRs must be resolved by walking the parse forest and ignoring
unwanted children of ambiguous NTs (see [Complete Example](#Complete-Example)).
4. Use the disambiguated parse tree for the further stages of compilation.
For example, see gogll's [AST builder](ast/build.go).

# Complete Example
The code of following example can be found at [examples/boolx](examples/boolx/boolx.md).
The example has the following grammar: [boolx.md](examples/boolx/boolx.md), which generates boolean expressions such as: `a | b & c | d & e`:

```
package "github.com/goccmack/gogll/examples/boolx"

Expr :   var
     |   Expr Op Expr
     ;

var : letter ;

Op : "&" | "|" ;
```
The second alternate above, `Expr : Expr Op Expr`, is ambiguous and can produce an ambiguous parse forest.
The grammar does not enforce operator precedence,
this has to be done during semantic analysis.

The grammar is compiled by the following command:
```
gogll examples/boolx/boolx.md
```

The test file, [boolx_test.go](examples/boolx/boolx_test.go) shows the steps
required to parse an input string and produce a disambiguated abstract syntax tree:

```
const t1Src = `a | b & c | d & e`

func Test1(t *testing.T) {
```
1. Create a lexer from the input string and parse. Fail if there are parse errors.
```
	if err, errs := parser.Parse(lexer.New([]rune(t1Src))); err != nil {
		fail(errs)
	}

```
2. Build an abstract syntax tree for each root of the parse forest and print them.
```
	for i, r := range bsr.GetRoots() {
		fmt.Printf("%d: %s\n", i, buildExpr(r))
	}
}
```
The input string produces an ambiguous parse forest, which is partially
disambiguated by applying operator precedence.
We get the following output from this test:
```
> go test -v ./examples/boolx
=== RUN   Test1
0: (a | ((b & c) | (d & e)))
1: <nil>
2: <nil>
3: ((a | (b & c)) | (d & e))
--- PASS: Test1 (0.00s)
PASS
```
The output shows that the parse forest has 4 roots, 2 of which produce valid ASTs
after disambiguation. The removed trees are syntactically valid by semantically
invalid because they give `|` precedence over `&`.
Both the remaining ASTs are syntactically and semantically
valid. The AST encodes operator precedence as shown by the parentheses.
The choice of which valid AST to use for further processing is application specific.

In this example disambiguation by operator precedence is applied during the
AST build.

Our AST has only one type of node: `Expr`.
```
type ExprType int

const (
	Expr_Var ExprType = iota
	Expr_Expr
)

type Expr struct {
	Type  ExprType
	Var   *token.Token
	Op    *token.Token
	Left  *Expr
	Right *Expr
}

```
A node can represent a variable (`Type` = `Expr_Var`) or an expression (`Type` = `Expr_Expr`).
If the node represents a variable the field `Var` contains the variable token.
Otherwise `Op` contains the operator token and `Left` and `Right` contain the nodes
of the sub-expressions.

The AST is constructed recursively from each BSR root by the function, `buildExpr`
in [boolx_test.go](examples/boolx/boolx_test.go).

```
/*
Expr :   var
     |   Expr Op Expr
     ;
Op : "&" | "|" ;
*/
func buildExpr(b bsr.BSR) *Expr {
	/*** Expr :   var ***/
	if b.Alternate() == 0 {
		return &Expr{
			Type: Expr_Var,
			Var:  b.GetTChildI(0),
		}
	}

	/*** Expr : Expr Op Expr ***/
	op := b.GetNTChildI(1). // Op is symbol 1 of the Expr rule
				GetTChildI(0) // The operator token is symbol 0 for both alternates of the Op rule

	// Build the left subexpression Node. The subtree for it may be ambiguous.
	left := []*Expr{}
	// b.GetNTChildrenI(0) returns all the valid BSRs for symbol 0 of the body of the rule.
	for _, le := range b.GetNTChildrenI(0) {
		// Add subexpression if it is valid and has precedence over this expression
		if e := buildExpr(le); e != nil && hasPrecedence(e, op) {
			left = append(left, e)
		}
	}
	// No valid subexpressions therefore this whole expression is invalid
	if len(left) == 0 {
		return nil
	}
	// Belts and braces
	if len(left) > 1 {
		panic(fmt.Sprintf("%s has %d left children", b, len(left)))
	}
	// Do the same for the right subexpression
	right := []*Expr{}
	for _, le := range b.GetNTChildrenI(2) {
		if e := buildExpr(le); e != nil && hasPrecedence(e, op) {
			right = append(right, e)
		}
	}
	if len(right) == 0 {
		return nil
	}
	if len(right) > 1 {
		panic(fmt.Sprintf("%s has %d right children", b, len(right)))
	}

	// return an expression node
	return &Expr{
		Type:  Expr_Expr,
		Op:    op,
		Left:  left[0],
		Right: right[0],
	}
}
```

# Status
* `gogll v3` generates a matching lexer and parser. It generates GLL and LR(1)
parsers. v3 compiles itself.
v3 is used in a real-world project.
* `gogll v2` had the last vestiges of the bootstrap compiler grammar removed from
its input grammar. v2 compiled itself.
* `gogll v1` was a GLL scannerless parser, which compiled scannerless GLL parsers.
v1 compiled itself.
* `gogll v0` was a bootstrap compiler implemented by a [gocc](https://github.com/goccmack/gocc) lexer and parser.

# Features considered for future implementation
1. Tokens suppressed by the lexer, e.g.: code comments.
1. Better error reporting.
1. Better documentation, including how to traverse the binary subtree representation (BSR [Scott et al 2019](#Scott-et-al-2019)) of the parse forest as well as on disambiguating
parse forests.
1. Letting the parser direct which tokens to scan [Scott & Johnstone 2019](#Scott-et-al-2019a)

# Documentation
At the moment this document and the [gogll grammar](gogll.md) are the only documentation. Have a look at
`gogll/examples/ambiguous` for a simple example and also for simple disambiguation.

Alternatively look at `gogll.md` which is the input grammar and also the grammar
from which the `parser` for this version of `gogll` was generated. `gogll/da` disambiguates the parse forest for an input string.

## LR(1)
See the [LR(1) documentation](doc/lr1/Readme.md).

# Changelog
[see](ChangeLog.md)

# Bibliography

* [Pager 1977] David Pager
A Practical General Method for Constructing LR(k) Parsers
Acta Informatica 7, 1977

* [Scott & Johnstone 2019] Elizabeth Scott and Adrian Johnstone
Multiple lexicalisation (a Java based study)
In: [Proceedings of Software Language Engineering 2019. ACM, 2019. p. 71-82](https://pure.royalholloway.ac.uk/portal/files/34483813/lcnpSubmitFromEASForPure.pdf)

* [Scott et al 2019] Elizabeth Scott, Adrian Johnstone and L. Thomas van Binsbergen.
Derivation representation using binary subtree sets.
In: Science of Computer Programming (175) 2019

* [Scott & Johnstone 2018] Elizabeth Scott and Adrian Johnstone.
GLL Syntax Analysers For EBNF Grammars.
In: [Science of Computer Programming
Volume 166, 15 November 2018](https://pure.royalholloway.ac.uk/portal/en/publications/gll-syntax-analysers-for-ebnf-grammars(58d1ec5e-28df-486a-879e-36d58a9f8abf).html)

* [Scott & Johnstone 2016] Elizabeth Scott and Adrian Johnstone.
Structuring the GLL parsing algorithm for performance.
In: [Science of Computer Programming
Volume 125, 1 September 2016](https://pure.royalholloway.ac.uk/portal/en/publications/structuring-the-gll-parsing-algorithm-for-performance(a95fc020-9918-4f17-a87a-845e2aee12b8).html)

* [Afroozeh et al 2013] Ali Afroozeh, Mark van den Brand, Adrian Johnstone, Elizabeth Scott, Jurgen Vinju.
Safe Specification of Operator Precedence Rules.
In: [Erwig M., Paige R.F., Van Wyk E. (eds) Software Language Engineering. SLE 2013. Lecture Notes in Computer Science, vol 8225. Springer, Cham](https://pure.royalholloway.ac.uk/portal/en/publications/safe-specification-of-operator-precedence-rules(0287d70e-92b8-4204-aafb-15a81de84968).html)

* [Grune et al 2012] Dick Grune, Kees van Reeuwijk, Henri E. Bal, Ceriel J.H. Jacobs and Koen Langendoen.
Modern Compiler Design. Second Edition.
Springer 2012

* [Basten & Vinju 2012] Basten H.J.S., Vinju J.J. (2012) Parse Forest Diagnostics with Dr. Ambiguity. In: Sloane A., Aßmann U. (eds) Software Language Engineering. SLE 2011. [Lecture Notes in Computer Science, vol 6940. Springer, Berlin, Heidelberg](https://homepages.cwi.nl/~jurgenv/papers/SLE2011-2.pdf)

repository: goccmack/gogll

branch_name: refs/heads/master

gha_language: Go

repo_name: goccmack/gogll


text:
composer require sharmaji/jsonviewer:dev-master
```
## Register with config/app.php
Register the service providers to enable the package:
```
Sharmaji\Jsonviewer\Providers\AppServiceProvider::class,
```

Autoload it:
```
composer dumpautoload
```
## Test with Laravel
```
php artisan serv
```
Browse to http://localhost:8000/dashboard

# Test the Package
In the packages repository folder:
```
composer install
vendor/bin/phpunit
```


text:
---
layout: default
title: About
permalink: /
---

I'm a graduate student at QMUL EECS advised by [Gianni Antichi](https://gianniantichi.github.io/)
. I'm also working with [Brent Stephens](https://www.cs.utah.edu/~brent/)
 at Utah. My interests centers around computer systems at data centers.

### Selected Publications
Backdraft: a Lossless Virtual Switch that Prevents the Slow Receiver Problem
**Alireza Sanaee**, Farbod Shahinfar, Gianni Antichi, Brent Stephens
USENIX NSDI 22, [Paper](https://www.usenix.org/system/files/nsdi22-paper-sanaee.pdf), [Talk](https://youtu.be/ovUH3Yjl37o), [Code](https://youtu.be/ovUH3Yjl37o)

Morpheus: Domain Specific Run Time Optimization for Software Data Planes
Sebastiano Miano, **Alireza Sanaee**, Gabor Retravi, Gianni Antichi
ACM ASPLOS 22, [Paper](https://dl.acm.org/doi/10.1145/3503222.3507769), [Talk](https://youtu.be/PDUVUv39CUQ), [Code](https://github.com/Morpheus-compiler/Morpheus)

### Other Publications

### Mini-Teaching
Distributed systems - Spring'22 (TA)
Distributed systems - Spring'21 (TA)
Big data analytics - Fall'20 (TA)

### Service
[SOSP'19](https://sysartifacts.github.io), AEC Member (Artifact Evaluation Committee)

### Mentees
[Farbod Shahinfar](https://fshahinfar1.github.io/), (now pursuing PhD at Politecnico di Milano)
Mohammad Siavashi, (Received MSc from IUST), Master thesis title: Development of a Page Table Aware Scheduler.
Mehran Salmani, (Received MSc from IUST, now pursuing PhD at Technische Universität Ilmenau), Master thesis title: A Mechanism for Auto-Configuration of ML Inference Services.

#### What am I currently working on?
Looking for problems!

#### Some thoughts
Hosts can get congested too, [here for more]({{ site.baseurl }}/hcongestion)
TCP seems to be hampering the innovation.
The process of conducting research is slow.
Pipelined academic collaborations does not sound quite right.


text:
### [CVE-2023-0903](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-0903)
![](https://img.shields.io/static/v1?label=Product&message=Employee%20Task%20Management%20System&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-89%20SQL%20Injection&color=brighgreen)

### Description

A vulnerability was found in SourceCodester Employee Task Management System 1.0. It has been declared as critical. This vulnerability affects unknown code of the file edit-task.php. The manipulation of the argument task_id leads to sql injection. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used. The identifier of this vulnerability is VDB-221452.

### POC

#### Reference
- https://github.com/navaidzansari/CVE_Demo/blob/main/2023/Employee%20Task%20Management%20System%20-%20SQL%20Injection.md

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

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

repo_name: trickest/cve


text:
---
name: Bug report
about: Report a bug to help us improve
title: ''
labels: bug
assignees: ''

---

<!-- NOTE: If you ignore this template, we will send it again and ask you to fill it out anyway. -->

**Have you checked for duplicate open issues [here](https://github.com/davidjamesherzog/videojs-shaka/issues)?**

**What version of Shaka Player and videojs-shaka are you using?**

**Can you reproduce the issue with our latest release version?**

**Can you reproduce the issue with the latest code from `master`?**

**Are you using the demo app or your own custom app?**

**If custom app, can you reproduce the issue using our demo app?**

**What browser and OS are you using?**

**What are the manifest and license server URIs?**
<!-- NOTE:
  You can send the URIs to<EMAIL_ADDRESS>instead,
  but please use GitHub and the template for the rest.
  A copy of the manifest text or an attached manifest will **not** be
  enough to reproduce your issue, and we **will** ask you to send a
  URI instead.  You can copy the URI of the demo app to send us the
  exact asset, licence server, and settings you have selected there.
-->

**What did you do?**
<!-- Steps to reproduce the bug -->

**What did you expect to happen?**

**What actually happened?**
<!-- A clear and concise description of what the bug is -->
<!-- If applicable, you may add screenshots to help explain your problem. -->

repository: davidjamesherzog/videojs-shaka

gha_language: JavaScript

repo_name: davidjamesherzog/videojs-shaka


text:
**Baklava**

Ingredients:

  - 4 cups chopped nuts (pecans and/or walnuts)

  - 1/2 cup sugar

  - 1tsp cinnamon

  - 1 box fillo dough

  - 1 cup butter (melted)

  - 12oz honey (heated until runny)

Directions:

  - Grease a 13x9 baking pan

  - mix nuts, sugar, cinnamon

  - alternate 6 buttered layers of fillo dough and 1 cup nut mixture

  - cut serving slices 1/2 way through

  - pour remaining butter on top

  - cook at 300 for 1hr 25min

  - remove from oven, immediately pour on honey

  - let cool for several hours

Variations:

  - add ground cloves to sugar/nut mixture

  - add whole cloves to honey while heating, remove cloves before
    pouring

  - add a whole clove to the top of each serving

  - substitute honey with syrup (water + sugar + small amount of lemon
    juice), works best with pistachios

repository: nanderson/recipes

repo_name: nanderson/recipes


text:
This pack has a collection of playbooks to rapidly respond to high profile breaches with existing deployed tools in your enterprise.
The playbooks in this pack can also be used as a template to hunt and block these indicators using additional tools in your environment.
This pack contains the response playbooks for the following breaches:
- Sunburst and SolarStorm hunting.
- FireEye Red Team Tools Investigation and Response.
- HAFNIUM - Exchange 0-day exploits

##### How to enable it?

- Install the pack.
- Check if the pack has the steps that are relevant to the tools used in your environment.
- Create a job that will run this playbook on a periodic basis.

![SolarStorm and SUNBURST Hunting and Response Playbook](https://raw.githubusercontent.com/demisto/content/bb46740bed0452cd1c9e673e07567efa8236d76b/Packs/MajorBreachesInvestigationandResponse/doc_files/SolarStorm_and_SUNBURST_Hunting_and_Response_Playbook_V6.png)
![HAFNIUM - Exchange 0-day exploits](https://raw.githubusercontent.com/demisto/content/5e260b4541666936a241432c2a163049d9ffcfec/Packs/MajorBreachesInvestigationandResponse/doc_files/HAFNIUM_-_Exchange_0-day_exploits_6.png)

repository: debasish-xsoar/content

repo_name: debasish-xsoar/content


text:
# Instructions append

You may use the [`arithmetic remainder` operator](https://doc.rust-lang.org/book/appendix-02-operators.html) to test for divisibility.

repository: exercism/rust

gha_language: Rust

repo_name: exercism/rust


text:
# node-shield

[![npm version](https://badge.fury.io/js/node-shield.svg)](https://badge.fury.io/js/node-shield)
[![Build Status](https://travis-ci.com/panga/node-shield.svg?branch=master)](https://travis-ci.com/panga/node-shield)

Protects against common Node.js vulnerabilities in MEAN stack (MongoDB, Node.js).

Provides an extremelly fast and low overhead API and Express 4.x middleware.

- Executes in ~200ns (nanoseconds) for a payload with 10 keys and 500 bytes.
- 100% code coverage.
- Zero dependencies.
- Supports Node 6+

## Install

`npm install node-shield`

## Description

This module aims in protecting Node.js applications againt OWASP Injection (A1) attacks.

One of the most common attacks of MEAN stack is the MongoDB NoSQL injection using arbitraty input in request parameters.

A second and more recent attack comes with JavaScript prototype pollution and it was seen in multiple libraries in last years ([Lodash](https://snyk.io/vuln/SNYK-JS-LODASH-450202), [Hapi.js](https://github.com/hapijs/hapi/issues/3916)), but it is also present if you use `Object.assign` API.

**WARNING** This is not a replacement for good coding practices like:
* Use parameterized queries to prevent injection flaws.
* Always validate input parameters types (JSON Schema recommended)

### MongoDB NoSQL protection

Block object keys which start with `$` operator for MongoDB. e.g: `username: { $gt: ''}`.

References:
* https://www.owasp.org/index.php/Testing_for_NoSQL_injection
* https://blog.websecurify.com/2014/08/hacking-nodejs-and-mongodb.html
* https://blog.websecurify.com/2014/08/attacks-nodejs-and-mongodb-part-to.html

### Prototype Pollution protection

Block object keys with names `__proto__` or `constructor` which are also an object.

References:
* https://github.com/HoLyVieR/prototype-pollution-nsec18/blob/master/paper/JavaScript_prototype_pollution_attack_in_NodeJS.pdf

## API usage

### Callback style

```javascript
const { shield } = require('node-shield');

shield.evaluate({ user: { $gt: '' } }, { mongo: true, proto: true },
  (err) => {
    if (err) {
      throw err;
    }
  });
```

### Promise style

```javascript
const { shield } = require('node-shield');

shield.evaluateAsync({ user: { $gt: '' } }, { mongo: true, proto: true })
  .catch((err) => {
    throw err;
  });
```

## Express 4.x middleware usage

By default, both `mongo` and `proto` protections are evaluated and the error handler return a `403` error.
You can do anything you would normally do in a express middleware.
Example, but not limited to:
- Log the injection attempt and continue to process the request
- Log the injection attempt and response with an error

```javascript
const express = require('express');
const { expressShield } = require('node-shield');

const app = express();
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(expressShield({
  errorHandler: (shieldError, req, res, next) => {
    console.error(shieldError);
    res.sendStatus(400);
  },
}));

app.listen(3000);
```

## License

[Apache2.0](https://www.apache.org/licenses/LICENSE-2.0)

## Author

Leonardo Zanivan
<EMAIL_ADDRESS>[www.panga.dev](https://panga.dev)

repository: panga/node-shield

gha_language: TypeScript

repo_name: panga/node-shield


text:
---
name: Bug report
about: Report a malfunctioning feature
title: ''
labels: bug
assignees: ''

---

## Bug description
A clear and concise description of what the bug is.

## How to reproduce
Provide the steps needed to reproduce the bug.

## Expected behavior
Describe what should be the expected behavior..

## Context
Provide the context where the bug has happened with any relevant information that might be useful for debugging. For instance, the operating system, Python version, and so on.


text:
+++
# About/Biography widget.
widget = "about"
active = true
date = 2016-04-20T00:00:00

# Order that this section will appear in.
weight = 5

# List your academic interests.
[interests]
  interests = [
    "Signal Processing",
    "Medical Imaging",
    "Scientific Computing",
    "Neurology"
  ]

# List your qualifications (such as academic degrees).
#[[education.courses]]
#  course = "PhD in Artificial Intelligence"
#  institution = "Stanford University"
#  year = 2012

[[education.courses]]
  course = "BS in Physics"
  institution = "Middle Tennessee State University"
  year = 2016

[[education.courses]]
  course = "BS in Chemistry"
  institution = "Rhodes College"
  year = 2014

+++

# Biography

I am a research coordinator at The Ohio State University College of Nursing's Pain and Aging Lab. My research is focused on alterations in pain processing in older adults with Alzheimer's disease. Our methods incorporate psychophysics collection and MRI acquisition. With my background in physics and chemistry, I possess a technical knowledge of multiple imaging modalities, as well as a strong competency in mathematics and statistics.

repository: swatalla/academic-kickstart

repo_name: swatalla/academic-kickstart


text:
# mnm

Make Node Module is a build tool for making native node.js modules.

## Installation

```bash
$ npm install mnm
```

## Quick Examples

```javascript
var builder = new Builder();

builder.appendUnique('CXXFLAGS', ['-fno-builtin']);
builder.appendIncludeDir('src/');
builder.appendSourceDir('./src');
builder.target = "mynativemodule_bindings";

builder.run();
```

## Realworld Examples

 * [node-java](https://github.com/nearinfinity/node-java) - A node.js to Java bridge.
 * [node-shark](https://github.com/nearinfinity/node-shark) - Wrapper around libwireshark providing network packet dissection.
 * [node-oracle](https://github.com/nearinfinity/node-oracle) - node.js driver to connect with an oracle database.

# Index

## command line arguments
 * [-v](#cmdline_verbose) - Verbose
 * [-Wall](#cmdline_showWarnings) - Show Warnings

## builder
 * [appendLinkerLibrary](#builder_appendLinkerLibrary)
 * [appendLinkerSearchDir](#builder_appendLinkerSearchDir)
 * [appendIncludeDir](#builder_appendIncludeDir)
 * [appendUnique](#builder_appendUnique)
 * [appendSourceDir](#builder_appendSourceDir)
 * [appendSource](#builder_appendSource)
 * [compile](#builder_compile)
 * [link](#builder_link)
 * [compileAndLink](#builder_compileAndLink)
 * [run](#builder_run)

# API Documentation

## command line

### verbose -v or --verbose

Prints the command lines being executed along with other verbose output.

### -Wall or --showWarnings

Adds the -Wall flag to the compile and prints all compiler warnings.

## builder

### builder.appendLinkerLibrary(libname)

Adds a library to the linker.

__Arguments__

 * libname - The name of the library to add. This string should not contain the lib prefix or the extension.

__Example__

    builder.appendLinkerLibrary('ssl');

### builder.appendLinkerSearchDir(dir)

Adds a library to the linker search path.

__Arguments__

 * dir - The directory to add to the search path.

__Example__

    builder.appendLinkerSearchDir('/usr/local/lib');

### builder.appendIncludeDir(dir)

Adds a path to the list of include search directories.

__Arguments__

 * dir - The directory to add to the search path.

__Example__

    builder.builder_appendIncludeDir('/src');

### builder.appendUnique(flagGroup, flags)

Adds a flag or flags to a flag group.

__Arguments__

 * flagGroup - The flag group to add the flags to. This should be LINKFLAGS or CXXFLAGS.
 * flags - A single string or array of strings to add to the group.

__Example__

    builder.appendUnique('CXXFLAGS', '-Wall');
    builder.appendUnique('CXXFLAGS', ['-Idir1', '-Idir2']);

### builder.appendSourceDir(dir)

Adds a source code directory to the list of compilable items. All files with the extensions cpp, c, cxx will be added to the compile step.

__Arguments__

 * dir - The path to the directory containing the source files.

__Example__

    builder.appendSourceDir('./src');

### builder.appendSource(fileName)

Adds a single source file to the list of compilable items.

__Arguments__

 * fileName - The name of the file to compile.

__Example__

    builder.appendSource('./src/myModule.cpp');

### builder.compile([callback])

Performs the compile.

__Arguments__

 * callback (optional) - An optional callback to be called when the compile is complete.

__Example__

    builder.compile();

### builder.link([callback])

Performs the link.

__Arguments__

 * callback (optional) - An optional callback to be called when the link is complete.

__Example__

    builder.link();

### builder.compileAndLink([callback])

Performs the compile and link.

__Arguments__

 * callback (optional) - An optional callback to be called when the compile and link is complete.

__Example__

    builder.compileAndLink();

### builder.run([options], [callback])

Run the builder. If no options are specified will use command line arguments to determine what to do.

__Arguments__

 * options (optional) - An object containing the following options
  * verbose - true to be verbose
  * showWarnings - true to show all compiler warnings
  * action - set to one of the following actions
   * build - compile and link the project
   * compile - just perform the compile step.
   * link - just perform the link step.
 * callback (optional) - An optional callback to be called when the run is complete.

__Example__

    builder.compileAndLink();

## License

(The MIT License)

Copyright (c) 2012 Near Infinity Corporation

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

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

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

repository: joeferner/node-mnm

repo_name: joeferner/node-mnm


text:
mongo-map [![npm version](https://badge.fury.io/js/mongo-map.svg)](http://badge.fury.io/js/mongo-map) [![Build Status](https://travis-ci.org/e-conomic/mongo-map.svg?branch=master)](https://travis-ci.org/e-conomic/mongo-map) [![devDependency Status](https://david-dm.org/e-conomic/mongo-map/dev-status.svg)](https://david-dm.org/e-conomic/mongo-map#info=devDependencies)
=========

When working with [mongoDB Aggregation Framework](http://docs.mongodb.org/manual/aggregation) sometimes you need to transform a field based on plain js map object. Consider you have:
```javascript
var map = {
	forThisKey: 'retrun this value',
	thisKeyEqualsTo: 'something like this',
	andForThisOne: 'return some other string'
};
```
In regular js code you would do:
```javascript
var value = map[key];
```
This module helps you do the same inside aggregation framework pipeline.

	npm install mongo-map

## Requirements
- mongo 2.6.x or higher

## Usage

```javascript
var getInMap = require('mongo-map');

db.myCollection.aggregate([
	{ $project: {
		value: getInMap(map, '$key')
	} }
]);
```
Here `getInMap` expands your map object into a balanced search tree that aggregation framework uses to efficiently look up your key.

## License

[MIT](http://opensource.org/licenses/MIT)

repository: debitoor/mongo-map

repo_name: debitoor/mongo-map


text:
# Module SIM800L

SKU:M004

## Description

**SIM800L** is a cellular phone module, integrated SIM800L, a GSM/GPRS module, only cpmpatible with 2G network. if you want to integrate a cellular module into your design with vioce, text and SMS, this hand-solderable module is pretty nice!

## Product Features

-  3.5 mm phone audio jack
-  MIC (MIC is disable by default. To enable it, you will need to weld a 0 ohm resistor at MIC-EN )
- Supply voltage: 3.8V - 4.2V
- Recommended supply voltage: 4V
- Power consumption:
    sleep mode < 2.0mA
    idle mode < 7.0mA
    GSM transmission (avg): 350 mA
    GSM transmission (peek): 2000mA
- Module size: 25 x 23 mm
- Interface: UART (max. 2.8V) and AT commands
- SIM card socket: microSIM (bottom side)
- Supported frequencies: Quad Band (850 / 950 / 1800 /1900 MHz)
- Antenna connector: IPX
-  Spring Antenna on board
- Status signaling: LED
- Working temperature range: -40 do + 85 ° C
- Product Size：54.2mm x 54.2mm x 12.8mm
- Product weight：16.5g

!> **M5Stack Fire** has occupied GPIO16 / 17 to connect with the PSRAM by default, it's conflict with TXD / RXD (GPIO16, GPIO17) of SIM800L module. Therefore, when using the SIM800L module with the M5Stack Fire, you might have to cut the TXD and RXD from SIM800L module and wire fly to another set of UART pin

## PinMap

**SIM800**

| SIM800 Pin        | ESP32 Chip      |
| :----------:  |:------------: |
| TXD        | U2RXD(GPIO16)         |
| RXD        | U2TXD(GPIO17)         |
| RST        | GPIO5         |

## Include

-  1x M5Stack SIM800L Module

## Applications

-  Nitrogen dioxide alarm
-  Automatic Web Spider SMS-notifier
-  Remote meter reading system

## EasyLoader

<button type="button" class="btn btn-primary">click to download EasyLoader</button>

>1.EasyLoader is a simple and fast program burner. Every product page in EasyLoader provides a product-related case program. It can be burned to the master through simple steps, and a series of function verification can be performed.(**Currently EasyLoader is only available for Windows OS**)

>2.After downloading the software, double-click to run the application, connect the M5 device to the computer via the data cable, select the port parameters, and click **"Burn"** to start burning.

!>3.The CP210X (USB driver) needs to be installed before the EasyLoader is burned. [Click here to view the driver installation tutorial](en/related_documents/M5Burner#install-usb-driver)

## Links

-  **AT Command**
   - [SIM800 AT Command](https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/datasheet/module/SIM800_Series_AT_Command_Manual_V1.09.pdf)

## Schematic

## Example

### 1. Arduino

Use with Arduino, please click [here](https://github.com/m5stack/M5Stack/tree/master/examples/Modules/SIM800L)


text:
# Development Tools

For tutorials that are marked to use either *Anaconda* or *Jupyter Notebook*, using [Anaconda](https://docs.anaconda.com/anaconda/) is recommended.

## I. Anaconda

### i. Install on different operating systems
Anaconda can be used on Linux (inc. on ChromeOS), Windows and MacOS. Please follow the [official installation instructions](https://docs.anaconda.com/anaconda/install/) for individual machines.

### ii. Create a conda environment
After installing Anaconda, one needs to set up the environment with additional libraries. The simplest way to install the useful packages is to use the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux. Creatie a new `mphy0043` environment:
```bash
conda create --name mphy0043 tensorflow==2.5
```
In the activated `mphy0043`, install other useful libraries:
```bash
conda activate mphy0043
pip install notebook matplotlib av "monai[nibabel, gdown, ignite]"  # monai includes PyTorch
```

> Installation of TensorFlow and PyTorch can be OS-dependent, especially for GPU-enbaled versions. Please refer to the official guidelines if any issue on individual machines.

### iii. Run Python scripts
Some tutorials are written in Python scripts, which can be run at the Anaconda Prompt for Windows or in a terminal window for macOS or Linux with the activated `mphy0043`, by typing the command line commands, e.g.:
```bash
python video_classification.py
```

## II. Jupyter Notebook

### i. Use notebook with Anaconda
After installing Anaconda and setting up the conda environment, there are different ways to start the Jupyter Notebook in `mphy0043`, for example:

- Start [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/index.html);
- Select the created `mphy0043` in the drop-down menu "Applications on ...";
- Launch the Jupyter Notebook in the below tab;
- Select to open the notebook files with _.ipynb_ extension, using the browser-based interface, .

### ii. Google Colab
The links to upload the notebooks to [Colab](https://research.google.com/colaboratory/) may be provided but not technically supported in this module. Stable internet connection is required.

## III. Advanced users
For those experienced, direct use of [miniconda](https://docs.conda.io/en/latest/miniconda.html) and [Jupyter Notebook](https://jupyter.org/) should also work for those materials that are marked with Anaconda and Jupyter Notebook, respectively. However, technical support may not be available from this module.


text:
VERSION:
   <IP_ADDRESS>7 Beta

COMMANDS:
   list		list all dependencies of current project
   gen		generate a gopmfile for current Go project
   get		fetch remote package(s) and dependencies
   bin		download and link dependencies and build binary
   config	configure gopm settings
   run		link dependencies and go run
   test		link dependencies and go test
   build	link dependencies and go build
   install	link dependencies and go install
   clean	clean all temporary files
   update	check and update gopm resources including itself
   help, h	Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --noterm, -n		disable color output
   --strict, -s		strict mode
   --debug, -d		debug mode
   --help, -h		show help
   --version, -v	print the version
```

repository: iicoom/Note

repo_name: iicoom/Note


text:
These are my edits to David Scott's original Ribbon Menu. It adds options to make left and right side menus, and an interface to toggle the menu from a non activity class.

Take a look at the tekschola application for examples on how to use the callbacks. Both menu and ui threading stuff.

www.github.com/aidandj/Tekschola for examples

-ADJ

RibbonMenu
==========

Navigation menu for Android (based on Google+ app).

![RibbonMenu](https://github.com/darvds/RibbonMenu/raw/master/rbm1.png)

Usage
=====

Menus are created in xml as normal, adding text and an icon.

In the layout you want to show the menu, add a FrameLayout as the root layout and add the RibbonMenuView set with width and height to match_parent.

In your class you need to implement the iRibbonMenuCallback interface. This is called when you click a menu item and it passes the menu item id from the xml. You then make a reference to the RibbonMenuView and set the callback, set the menu items and add toggleMenu() to your android.R.id.home in your onOptionsItemSelected

The sample activity shows how it should all work.

License
=======

Copyright 2012 David Scott

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

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

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

repository: aidandj/RibbonMenu

repo_name: aidandj/RibbonMenu


text:
<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tfma.extractors.SliceKeyExtractor" />
<meta itemprop="path" content="Stable" />
</div>

# tfma.extractors.SliceKeyExtractor

```python
tfma.extractors.SliceKeyExtractor(
    slice_spec=None,
    materialize=True
)
```

Defined in
[`extractors/slice_key_extractor.py`](https://github.com/tensorflow/model-analysis/tree/master/tensorflow_model_analysis/extractors/slice_key_extractor.py).

<!-- Placeholder for "Used in" -->

Creates an extractor for extracting slice keys.

The incoming Extracts must contain a FeaturesPredictionsLabels extract keyed by
tfma.FEATURES_PREDICTIONS_LABELS_KEY. Typically this will be obtained by calling
the PredictExtractor.

The extractor's PTransform yields a copy of the Extracts input with an
additional extract pointing at the list of SliceKeyType values keyed by
tfma.SLICE_KEY_TYPES_KEY. If materialize is True then a materialized version of
the slice keys will be added under the key tfma.SLICE_KEYS_KEY.

#### Args:

*   <b>`slice_spec`</b>: Optional list of SingleSliceSpec specifying the slices
    to slice the data into. If None, defaults to the overall slice.
*   <b>`materialize`</b>: True to add MaterializedColumn entries for the slice
    keys.

#### Returns:

Extractor for slice keys.

repository: tensorflow/model-analysis

gha_language: Python

repo_name: tensorflow/model-analysis


text:
---
title: Simple Git Workflow
description:
header: Simple Git Workflow
---
On the past I have difficulty using git because there are so many git commands. Today I will tell you a simple git workflow, because there are so many ways people using git for their project, and here is mine.

### Prerequisites
- Github account
- Git installed
- Working internet :-)

![image](/img/simple-git-workflow/01-new-repo-button.jpg)
Once you log in into your GitHub account, you will find "+" button on top right corner. Press that button then click "New repository"

![image](/img/simple-git-workflow/02-new-repo-example.jpg)
After you click that button, you will directed to "Create a new repository page". On this page there are so many buttons to choose, so I will explain them one by one.
- Repository name - The name of your repository or the name of your project. I use "learning-git" for example. Note that you can't use spaces on repository name, so I use "-" here.
- Description - The description about your project. I leave the blank but you should use it to write what is the intention of your project. For example "Simple password manager"
- Public/Private - Project created on GitHub can be for public or if the project shouldn't be seen seen by people (for example, the project should be seen only by your team or your manager), you can use private option.
- On GitHub you can set up README files. It is the files that contains anything about your project, like why you created the project, how to contribute to this project, what is the software functions, etc.
- You have option to add .gitignore file. .gitignore file is a file that git system will ignore. For example, you have a habit of writing to do list of the project on the project folder, but you don't want that to do list to be uploaded. Or maybe it is cache files or your text editor's configuration files. By adding those files into .gitignore, git will ignore those files so it would not be uploaded. I don't have any files that need to be ignored, so I did not add .gitignore file.
- Add a license - If your projects need license you can use it, this is just an example repository, so I don't add any license.

![image](/img/simple-git-workflow/03-new-repo-created.jpg)
After you create the repository, this is the repository page. It contains the content list and show you your README files.

![image](/img/simple-git-workflow/04-clone-button.jpg)
After your repository is done, you should clone it to your hard drive by clicking that large green button and then copy the link.

![image](/img/simple-git-workflow/05-clone-terminal.png)
Open up your terminal then go to your programming folder, for example mine is in `~/Programming/git`. Then type
`git clone <link>`
This first git command is for saving (cloning) your project from GitHub website to your local hard drive.

![image](/img/simple-git-workflow/06-cd-git.png)
After the cloning done, you can see your project name is in the folder now. Then go to your project folder by typing
`cd <project name>`

![image](/img/simple-git-workflow/07-editing.png)
After you are in your project folder you can edit the files. For example, I add files named files.txt and editing my README.md file

![image](/img/simple-git-workflow/08-git-add.png)
After you finished meddling with your project, it is time to "save" your project. When using git, you did not just save the files normally, but you must "add" them then "commit" them so git take a note what you add and what you remove.  This is an optional command.

![image](/img/simple-git-workflow/09-git-push.png)
`git commit -m "message"`
-m means you want to add commit message, so you can keep track of what you've edited. Keep a simple title for the commit message, for example I write "edited README.md and add files.txt", Pretty simple and understandable message.
 You can do that by typing
`git push`

![image](/img/simple-git-workflow/10-done.png)
And your project is done!

### Sum it up
1. Create the repository
2. `git clone <link>`
3. Edit the files
4. `git add -A`
5. `git commit -m "message"`
6. `git push`
Okay, that's it! every time you make edits, just do the 4, 5, and 6 command.

Happy programming!


text:
# Workarounds
A library to correct different bugs and problems of the different players.

### Purpose
This library provides workarounds for known problems where it is possible.
Not for all bug there is a workaround. But if there is one, a solution could
found here.

### Installation
The code of this library should be placed directly after the 'require "Wherigo"'
in the cartridge Lua file, but it must place before any creation of objects.
Normally this is only possible by builder authors or authors, who write
cartridges "by hand" without a build. You don't need to call any function so
that the workaround take place. If you use Urwigo, you could place the code
into the "Lua user directives".

### Removed bugs

#### Garmin
- ZTimer bug: bug that timer could be stopped in the OnTick event
- ZInput bug: bug that lets the player crash if an input screen is removed
by another screen
- ShowScreen bug: bug that lets the player crash if ShowScreen() is called with
a list type screen

#### Emulator
- ZTimer bug: bug that timer could be stopped in the OnTick event
- ZInput bug: bug that lets the player crash if an input screen is removed
by another screen

### Testing
For testing you could find an attached demo cartridge in folder
"WorkaroundsCartridge". There you could also find a compilible cartridge where
the author script is placed correcly. This isn't possible in Urwigo up to now.

### Author
- Charlenni (Wherigo Foundation)


text:
---
title: "TableauKit: A PowerShell Module for Tableau"
layout: post
categories: powershell tableau
description: "TableauKit is a PowerShell module for working with Tableau files. It is shipping with commands like Get-TableauObject, Get-TableauXml, and Export-Tableau."
iwpost: https://www.interworks.com/blogs/jpoehls/2013/08/09/tableaukit-powershell-module-tableau
redirect_to: http://joshua.poehls.me/2013/tableaukit-powershell-module-for-tableau
---

If you've been following my [Tableau via PowerShell][1] series then you already
know there are a lot of cool things you can do with Tableau workbooks using
PowerShell. Up until now I've been sharing helper functions in a stand-alone
fashion. No longer.

I'd like to introduce you to [TableauKit][2]. A pure, script-based PowerShell
module for working with Tableau files.

## Say what?

Today TableauKit is shipping with the following commands:

Get-TableauObject - Gets a summary object for a workbook. The summary
  contains things like the list of dashboards, worksheets, data sources, and
  parameters in the workbook. It also contains metadata like the version of
  Tableau that saved the workbook.

You can dig a bit deeper to find the
  parameter values and which worksheets are included on specific dashboards.

No XPath required!

Get-TableauXml - Opens up a TWB or TWBX file and returns the workbook's
  raw XML. XPath Heaven.

Export-Tableau - Lets you save changes you've made to the workbook's
  XML back into a new or existing TWB or TWBX file.

You'll probably recognize **Get-TableauXml** and **Export-Tableau** from my
[previous][1] [posts][3] about them. They are much better than when you last
met them, though! Several bugs have been fixed and the names are shorter now.

**Get-TableauObject** is all new. Just because you _can_ dig through the
workbook with XPath doesn't mean it's fun. This command provides quick access
to the most common parts of a workbook. Don't worry, it also gives you the raw
XML so you can go spelunking for the hard to find stuff!

## No really, what can it do?

### Find workbooks by worksheet name

Can't remember which workbook contains that elusive "Top 10 Hot Dogs" worksheet?

	Get-TableauObject *.twb, *.twbx |
		where {
			($_.Worksheets | select -Expand DisplayName) -contains "Top 10 Hot Dogs"
		} |
		select FileName

FileName
--------
C:\users\jpoehls\desktop\result.twb
C:\users\jpoehls\desktop\another-result.twbx

### Analyze connection types

What types of connections do my workbooks use?

	Get-TableauObject *.twb, *.twbx |
		select -Expand DataSources |
		group ConnectionType |
		sort Count -Desc

Count Name
----- ----
   26 excel
   12 sqlserver
   10 csv
    4
    3 dataengine
    3 msaccess
    2 bigquery
    1 firebird

### Find workbooks by connection type

Which workbooks use the Big Query connection?

	Get-TableauObject *.twb, *.twbx |
		where { ($_.DataSources | select -Expand ConnectionType) -eq "bigquery" } |
		select FileName

FileName
--------
C:\users\jpoehls\desktop\Shakespeare.twb
C:\users\jpoehls\desktop\Shakespeare_Extract.twb

### List all dashboard worksheets

Let's get a list of all dashboards and their worksheets for all
of our workbooks.

Oh, and we want that list presented in a GUI that we can
use to further search and filter.

	Get-TableauObject *.twb, *.twbx |
		foreach { $workbook = $_; $_ } |
		select -Expand Dashboards |
		foreach { $dashboard = $_; $_ } |
		select -Expand Worksheets |
		select @{ Label="Dashboard"; Expression={$dashboard.DisplayName} },
		       @{ Label="Worksheet"; Expression={$_.DisplayName} },
		       @{ Label="File"; Expression={$workbook.FileName} } |
		Out-GridView

![Results Screenshot]({{site.url}}/assets/forposts/tableaukit1.png "Results Screenshot")

### Find worksheets with a specific column filter

Looking for all the workbooks and worksheets that have a filter
on your "NextPaymentDate" column? Sure, we can do that.

> This code is pretty ridiculous so I'm going to break it up with annotations
> to make it easier to grok.
>
> This kind of query requires advanced knowledge of workbook internals and
> your mileage may vary if you run this against your own workbooks.

# Name of the data source.
$dataSource = "MonthlySummary (Landboss_com-Accounts)"
# Name of column that has a filter on it.
$column = "NextPaymentDate"

# Read all the workbooks.
Get-ChildItem *.twb , *.twbx |

    # Save a reference to the file name.
    foreach { $file = $_.FullName; $_ } |
    Get-TableauXml |

	# Find all worksheets with the data source we
	# are looking for.
	Select-Xml "/workbook/worksheets/worksheet/table/view/datasources/datasource" |
	Select -Expand Node |
	where {
        $_.caption -eq $dataSource -or $_.name -eq $dataSource
    } |

    # Save a reference to the data source's actual name
    # for later parts of the pipeline.
    foreach { $dataSourceName = $_.name; $_	} |

	# Find references to the column we are looking for.
	# Note we're still inside the worksheet node.
	Select-Xml "../../datasource-dependencies[@datasource='$dataSourceName']/column-instance[@column='[$column]']" |
	Select -Expand Node |

    # Save a reference to the column's actual name
    # for the next part of the pipeline.
    foreach { $filterColumnName = $_.name; $_ } |

	# Find any filters on the worksheet that
	# apply to the column we care about.
	Select-Xml<EMAIL_ADDRESS>|
	select -Expand Node |

	# Traverse back to the worksheet node.
	Select-Xml "../../.." |
	select -Expand Node |

	# Build the final result display.
	select @{ Label="Worksheet"; Expression={
        	if ($_.caption) { $_.caption }
    		else { $_.name }
			}},
			@{ Label="File"; Expression={$file} }

Worksheet                 File
---------                 ----
Avg Monthly Income        C:\users\jpoehls\desktop\Landboss Income.twb
Monthly Income by Account C:\users\jpoehls\desktop\Landboss Income.twb

### You can do anything!

Hopefully this has given you a glimpse at the power of querying your workbooks
en masse. The queries are pretty gnarly so I definitely recommend wrapping
anything you'll reuse into helper functions.

## What are you waiting for?

- [Download it][2]

After you download it, check the README for detailed installation and usage instructions.

TableauKit is a product of [InterWorks](https://www.interworks.com), a fantastic company that
[you _really_ want to work for](https://www.interworks.com/company/careers)!

## Roadmap

The future is wide open for this. What kind of functionality would you like to
see added? Let me know in the comments!

{{site.powershell_book_ad}}

[1]: {{site.url}}/2013/exploring-tableau-workbooks-with-powershell-part-1-opening-workbooks/
[2]: https://www.interworks.com/content/download-tableaukit
[3]: {{site.url}}/2013/tableau-via-powershell-part-2-saving-changes/

branch_name: refs/heads/gh-pages


text:
---
title: o[php/js/mysql] mass combo add w/ new functionality
author: PipisCrew
date: 2015-11-08
categories: [js,php,sql]
toc: true
---

## Fill HTML control via Server Side

```js
<?php

	$building_type= getSet($db, "select building_type as txt from elevators group by building_type order by building_type", null);
	$elevator_type= getSet($db, "select elevator_type as txt from elevators group by elevator_type order by elevator_type", null);
	$internal_doors= getSet($db, "select internal_doors as txt from elevators group by internal_doors order by internal_doors", null);
	$door_type= getSet($db, "select door_type as txt from elevators group by door_type order by door_type", null);
	$external_floor_door= getSet($db, "select external_floor_door as txt from elevators group by external_floor_door order by external_floor_door", null);
	$door_collisions= getSet($db, "select door_collisions as txt from elevators group by door_collisions order by door_collisions", null);
	$lock_type= getSet($db, "select lock_type as txt from elevators group by lock_type order by lock_type", null);
	$engine_room= getSet($db, "select engine_room as txt from elevators group by engine_room order by engine_room", null);
	$trochaliostasio= getSet($db, "select trochaliostasio as txt from elevators group by trochaliostasio order by trochaliostasio", null);
	$cableway_count= getSet($db, "select cableway_count as txt from elevators group by cableway_count order by cableway_count", null);
	$magnet_power_supply= getSet($db, "select magnet_power_supply as txt from elevators group by magnet_power_supply order by magnet_power_supply", null);
	$brake_power_supply= getSet($db, "select brake_power_supply as txt from elevators group by brake_power_supply order by brake_power_supply", null);
	$light_chamber= getSet($db, "select light_chamber as txt from elevators group by light_chamber order by light_chamber", null);
	$light_type= getSet($db, "select light_type as txt from elevators group by light_type order by light_type", null);
	$light_well= getSet($db, "select light_well as txt from elevators group by light_well order by light_well", null);

	$building_type_html = create_html_select_elements($building_type);
	$elevator_type = create_html_select_elements($elevator_type);
	$internal_doors = create_html_select_elements($internal_doors);
	$door_type = create_html_select_elements($door_type);
	$external_floor_door = create_html_select_elements($external_floor_door);
	$door_collisions = create_html_select_elements($door_collisions);
	$lock_type = create_html_select_elements($lock_type);
	$engine_room = create_html_select_elements($engine_room);
	$trochaliostasio = create_html_select_elements($trochaliostasio);
	$cableway_count = create_html_select_elements($cableway_count);
	$magnet_power_supply = create_html_select_elements($magnet_power_supply);
	$brake_power_supply = create_html_select_elements($brake_power_supply);
	$light_chamber = create_html_select_elements($light_chamber);
	$light_type = create_html_select_elements($light_type);
	$light_well = create_html_select_elements($light_well);

	function create_html_select_elements($record_set)
	{
		$html = "<option value='0'></option>";
		foreach($record_set as $row) {
			$html .= "<option>{$row['txt']}</option>";
		}

		$html .= "<option>**new**</option>";

		return $html;
	}

?>

    $(function ()
        {
            //when new add it to combo + select it - http://stackoverflow.com/a/24281246/1320686
            $('#light_well, #light_type, #light_chamber, #brake_power_supply, #magnet_power_supply, #cableway_count, #trochaliostasio, #engine_room, #lock_type, #door_collisions, #external_floor_door, #door_type, #internal_doors, #elevator_type, #building_type').on('change', function() {

                 if (this.value == "**new**")  {

                    var new_entry = prompt("Input the new record", "");

                    if (!new_entry)
                        return;

                    var o = new Option(new_entry);
                    o.selected=true;
                    $("#" + this.name).append(o);
                }

            });
    }); // jQ

	<div class='form-group'>
		<label>building_type :</label>
		<select name='building_type' id='building_type' class='form-control'> <?=$building_type_html?> </select>
	</div>

	<div class='form-group'>
		<label>elevator_type :</label>
		<select name='elevator_type' id='elevator_type' class='form-control'><?=$elevator_type?> </select>
	</div>
.
.
.
.
.
.
.
	<div class='form-group'>
		<label>light_well :</label>
		<select name='light_well' id='light_well' class='form-control'><?=$light_well ?> </select>
	</div>

```

* * *

## Fill  HTML control via Client Side

```js
<?php

	$building_type= getSet($db, "select building_type from elevators group by building_type order by building_type", null);
	$elevator_type= getSet($db, "select elevator_type from elevators group by elevator_type order by elevator_type", null);
	$internal_doors= getSet($db, "select internal_doors from elevators group by internal_doors order by internal_doors", null);
	$door_type= getSet($db, "select door_type from elevators group by door_type order by door_type", null);
	$external_floor_door= getSet($db, "select external_floor_door from elevators group by external_floor_door order by external_floor_door", null);
	$door_collisions= getSet($db, "select door_collisions from elevators group by door_collisions order by door_collisions", null);
	$lock_type= getSet($db, "select lock_type from elevators group by lock_type order by lock_type", null);
	$engine_room= getSet($db, "select engine_room from elevators group by engine_room order by engine_room", null);
	$trochaliostasio= getSet($db, "select trochaliostasio from elevators group by trochaliostasio order by trochaliostasio", null);
	$cableway_count= getSet($db, "select cableway_count from elevators group by cableway_count order by cableway_count", null);
	$magnet_power_supply= getSet($db, "select magnet_power_supply from elevators group by magnet_power_supply order by magnet_power_supply", null);
	$brake_power_supply= getSet($db, "select brake_power_supply from elevators group by brake_power_supply order by brake_power_supply", null);
	$light_chamber= getSet($db, "select light_chamber from elevators group by light_chamber order by light_chamber", null);
	$light_type= getSet($db, "select light_type from elevators group by light_type order by light_type", null);
	$light_well= getSet($db, "select light_well from elevators group by light_well order by light_well", null);

?>

	$(function ()
		{
			fill_elevator_combos();

			//when new add it to combo + select it - http://stackoverflow.com/a/24281246/1320686
			$('#light_well, #light_type, #light_chamber, #brake_power_supply, #magnet_power_supply, #cableway_count, #trochaliostasio, #engine_room, #lock_type, #door_collisions, #external_floor_door, #door_type, #internal_doors, #elevator_type, #building_type').on('change', function() {

				 if (this.value == "**new**")  {

					var new_entry = prompt("Input the new record", "");

					if (!new_entry)
						return;

					var o = new Option(new_entry);
					o.selected=true;
					$("#" + this.name).append(o);
				}

			});
	}); // jQ

	function fill_elevator_combos()
	{
			var building_type =   <?php echo json_encode($building_type); ?>;
			setComboItems("building_type", building_type);

			var elevator_type =   <?php echo json_encode($elevator_type); ?>;
			setComboItems("elevator_type", elevator_type);

			var internal_doors =   <?php echo json_encode($internal_doors); ?>;
			setComboItems("internal_doors", internal_doors);

			var door_type =   <?php echo json_encode($door_type); ?>;
			setComboItems("door_type", door_type);

			var external_floor_door =   <?php echo json_encode($external_floor_door); ?>;
			setComboItems("external_floor_door", external_floor_door);

			var door_collisions =   <?php echo json_encode($door_collisions); ?>;
			setComboItems("door_collisions", door_collisions);

			var lock_type =   <?php echo json_encode($lock_type); ?>;
			setComboItems("lock_type", lock_type);

			var engine_room =   <?php echo json_encode($engine_room); ?>;
			setComboItems("engine_room", engine_room);

			var trochaliostasio =   <?php echo json_encode($trochaliostasio); ?>;
			setComboItems("trochaliostasio", trochaliostasio);

			var cableway_count =   <?php echo json_encode($cableway_count); ?>;
			setComboItems("cableway_count", cableway_count);

			var magnet_power_supply =   <?php echo json_encode($magnet_power_supply); ?>;
			setComboItems("magnet_power_supply", magnet_power_supply);

			var brake_power_supply =   <?php echo json_encode($brake_power_supply); ?>;
			setComboItems("brake_power_supply", brake_power_supply);

			var light_chamber =   <?php echo json_encode($light_chamber); ?>;
			setComboItems("light_chamber", light_chamber);

			var light_type =   <?php echo json_encode($light_type); ?>;
			setComboItems("light_type", light_type);

			var light_well =   <?php echo json_encode($light_well); ?>;
			setComboItems("light_well", light_well);

			//empty vars
			building_type = elevator_type = internal_doors = door_type = external_floor_door = door_collisions = lock_type = engine_room = trochaliostasio = cableway_count = magnet_power_supply = brake_power_supply = light_chamber = light_type = light_well = null
	}

	function setComboItems(ctl_name, jArray)
	{
		if(jArray) {
			var combo_rows = "<option value='0'></option>";
			for (var i = 0; i < jArray.length; i++)
			{
				combo_rows += "<option>" + jArray[i][ctl_name] + "</option>";
			}

			combo_rows+= "<option>**new**</option>";

			$("[name=" + ctl_name + "]").html(combo_rows);
			$("[name=" + ctl_name + "]").change();
		}
	}

	<div class='form-group'>
		<label>building_type :</label>
		<select name='building_type' id='building_type' class='form-control'> </select>
	</div>

	<div class='form-group'>
		<label>elevator_type :</label>
		<select name='elevator_type' id='elevator_type' class='form-control'> </select>
	</div>
.
.
.
.
.
.
.

	<div class='form-group'>
		<label>light_well :</label>
		<select name='light_well' id='light_well' class='form-control'> </select>
	</div>

```

origin - http://www.pipiscrew.com/?p=2366 phpjsmysql-mass-combo-add-w-new-functionality


text:
# GIT MICROMATERIAL FOR REBASING

Rebasing is scary for people. We need to practice it to feel
less scared. Practicing with immediate actionable feedback
could help this process. Here's me trying to do that with
node.

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/lpmi-13/rebasic)

## Task - switch to a feature branch and fixup two commits

If you're ready to start, switch to the `clean_up` branch using:

`git checkout clean_up`

and read the README to find out what to do.


text:
---
layout: post
title: Awesome Resources
abstract: A list of awesome things on the web I've stumbled upon or have been directed to. Those include great (visual) explanations of complicated topics in machine learning and science in general, software tools and other fun stuff.
tags: [learning, inspirational, awesome]
category: resource
update: 2020-10-04
banner: /images/awesome-banner.jpg
banner-text: Awesome Resources
words: 857
time: 3
---

If I had to give one reason for writing this blog, it would be to end up in a list like the one I intend to compile below. Like I’ve already mentioned [here](https://hummat.github.io/thought/2020/05/28/writing-good-articles.html), I’m astonished and amazed at the amount of great resources one can access online for free. It helped me tremendously during my studies (and still does when I need to understand a new topic) and really gives everyone the possibility to learn almost anything. There are, of course, different shades of awesomeness.

While there is a mind boggling amount of great stuff out there, it is hidden by an even greater amount of, to put it euphemistically, less than inspiring content. This is why I decided to share whatever great resources I’ve encountered during my time on the Internet in the hope to help or inspire one or another of you. I’ll try to come up with an intuitive way of grouping similar things together. Let’s see how that goes. For now I’ll group by content instead of, e.g., by source or medium and I’ll keep adding stuff till I die or lose interest.

#### If you know of anything awesome that’s not yet in the list please comment!

<style>
    ol {
        list-style: none;
        counter-reset: item;
        padding: 0 0 0 40px;
    }
    li {
        line-height: 1.5em;
    }
    ol > li {
        counter-increment: item;
        margin-bottom: 1em;
    }
    ol > li:before {
        margin-right: 10px;
        margin-left: -40px;
   		content: counter(item);
        border: 1px solid black;
   		border-radius: 50%;
        line-height: 1.7em;
    	width: 1.8em;
        display: inline-block;
        text-align: center;
    }
</style>

## Science

1. [Kurzgesagt – In a Nutshell](https://www.youtube.com/kurzgesagt) - _Videos explaining things with optimistic nihilism._
   * [The Great Filter](https://www.youtube.com/watch?v=UjtOGPJ0URM)
   * Also check out their videos on meat [[1](https://www.youtube.com/watch?v=NxvQPzrg2Wg), [2](https://www.youtube.com/watch?v=ouAccsTzlGU)], [nuclear](https://www.youtube.com/watch?v=HEYbgyL5n1g) [energy](https://www.youtube.com/watch?v=pVbLlnmxIbY) and the [immune](https://www.youtube.com/watch?v=zQGOcOUBi6s) [system](https://www.youtube.com/watch?v=BSypUV6QUNw)!
2. [3Blue1Brown](https://www.youtube.com/3blue1brown) - _Some combination of math and entertainment, depending on your disposition._
   * [Neural Networks](https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi)
   * [Essence of linear algebra](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab)
   * [Cryptocurrencies](https://www.youtube.com/watch?v=bBC-nXj3Ng4&t=64s)
3. [Ben Eater](https://www.youtube.com/beneater) - _Tutorial-style videos about electronics, computer architecture, networking, and various other technical subjects._
   * He also has a [website](https://eater.net) where he did things like this [interactive quaternion explanation](https://eater.net/quaternions) together with 3Blue1Brown.
4. [minutephysics](https://www.youtube.com/user/minutephysics) - _Simply put: cool physics and other sweet science._
5. [Domain of Science](https://www.youtube.com/domainofscience) - _Aiming for the clearest explanations of science and mathematics._
6. [Two Minute Papers](https://www.youtube.com/user/keeroyz) - _Awesome research for everyone._
7. [Seeing Theory](https://seeing-theory.brown.edu/) - _A visual introduction to probability and statistics._
8. [Slate Star Codex](https://slatestarcodex.com/) - _A blog about science, medicine, philosophy, politics, and futurism._
9. [Khan Academy](https://www.khanacademy.org/) - _Free, world‑class education for anyone, anywhere._
10. [from Data to Viz](https://www.data-to-viz.com/#explore) - _Decision tree that leads you to the most appropriate graph for your data._
11. [Arxiv-Sanity](http://arxiv-sanity.com/) - _Arxive in better: Search and find research relevant to you._

## Machine Learning, Data Science & AI

1. [Distill](https://distill.pub/) - _Machine Learning Research Should Be Clear, Dynamic and Vivid. Distill Is Here to Help._
   * [Feature Visualization](https://distill.pub/2017/feature-visualization/)
   * [The Building Blocks of Interpretability](https://distill.pub/2018/building-blocks/)
   * [A Visual Exploration of Gaussian Processes](https://distill.pub/2019/visual-exploration-gaussian-processes/)
2. [Brandon Rohrer](https://www.youtube.com/brandonrohrer) - _Mainly machine learning videos._
   * [How Neural Networks Work](https://www.youtube.com/playlist?list=PLVZqlMpoM6kaJX_2lLKjEhWI0NlqHfqzp)
3. [R2D3](http://www.r2d3.us) - _An experiment in expressing statistical thinking with interactive design._
   * A visual introduction to machine learning [[1](http://www.r2d3.us/visual-intro-to-machine-learning-part-1/), [2](http://www.r2d3.us/visual-intro-to-machine-learning-part-2/)]
4. [colah’s blog](https://colah.github.io/) - _I want to understand things clearly, and explain them well._
5. [Quora: The Kernel Trick](https://www.quora.com/q/rrfsinhyglsnclow/The-Kernel-Trick) - _The ONLY explanation of the kernel trick that finally made it click._
6. [Sebastian Ruder](https://ruder.io/) - _Blog about machine learning, deep learning, and natural language processing._
   * [An overview of gradient descent optimization algorithms](https://ruder.io/optimizing-gradient-descent/index.html)
7. [Ben Frederickson](https://www.benfrederickson.com/blog/) - _Blog on programming topics_
   * [An Interactive Tutorial on Numerical Optimization](https://www.benfrederickson.com/numerical-optimization/)
8. [ConvNetJS](https://cs.stanford.edu/people/karpathy/convnetjs/index.html) - _Javascript library for training Deep Learning models entirely in your browser._
9. [Neural Network Playground](https://playground.tensorflow.org/) - _Tinker With a Neural Network Right Here in Your Browser._
10. [fast.ai](https://www.fast.ai/) - _Making deep learning easier to use._
11. [OpenAI: Spinning Up as a Deep Reinforcement Learning Researcher](https://spinningup.openai.com/en/latest/spinningup/spinningup.html)
12. [losslandscapes](https://losslandscape.com/) - _Very neat visualizations of neural network loss landscapes.

## Career

5. [80,000 hours](https://80000hours.org/) - _Providing research and support to help people switch into careers that effectively tackle the world’s most pressing problems._

## Rationality

1. [Less Wrong](https://www.lesswrong.com/) - _We work to develop and practice the art of human rationality._
2. [Change My View](https://www.reddit.com/r/changemyview/) - _A place to post an opinion you accept may be flawed, in an effort to understand other perspectives on the issue._
3. [Wikipedia: List of common misconceptions](https://en.wikipedia.org/wiki/List_of_common_misconceptions)
4. [Spurious Correlations](https://www.tylervigen.com/spurious-correlations) - _A fun way to look at correlations and to think about data_

## Tools

1. [Detexify](https://detexify.kirelabs.org/classify.html) - _LaTeX handwritten symbol recognition._

## Privacy & Security

1. [Tristan Harris](https://www.tristanharris.com/) - _The closest thing Silicon Valley has to a consciousness._
2. [Restore Privacy](https://restoreprivacy.com/) - _Your online privacy and security resource center._
    * [Alternatives to Google Products](https://restoreprivacy.com/google-alternatives/)

## Fun

1. [Simone Giertz](https://www.youtube.com/simonegiertz) - _Maker/robotics enthusiast/non-engineer._
2. [Phil Vandelay](https://www.youtube.com/channel/UCchU2gYo5UunA6uh6JVOd9A) - _Maker. I like to build cargo bikes, furniture, and more._
3. [Primitive Technology](https://www.youtube.com/channel/UCAL3JXZSzSm8AlZyD3nQdBA) - _A hobby where you build things in the wild completely from scratch using no modern tools or materials._

## "The rest"

1. Reddit - _Great place to find like minded people._
   - [Machine Learning](https://www.reddit.com/r/MachineLearning)
   - [Learn Machine Learning](https://www.reddit.com/r/learnmachinelearning)
   - [Deep Learning](https://www.reddit.com/r/deeplearning/)
   - [Data Science](https://www.reddit.com/r/datascience/)
   - [Artificial](https://www.reddit.com/r/artificial)
2. Blogs
   - [Deep Mind](https://deepmind.com/blog/)
   - [Apple - Machine Learning](https://machinelearning.apple.com/)
   - [Open AI](https://openai.com/blog/)


text:
# CompositeKeyGen
![CompositeKeyGen](https://img.shields.io/nuget/v/CompositeKeyGen)

Allows to create composite key encoded as Int64 (long).

*Usually you should use these identifiers in domain objects (aggregates).*

Each key is composed from 3 elements:
- instanceId - could be server identifier
- tenantId - could be tenant identifier
- sequenceId - incrementing identifier from other source

## Configuration
This should be done once at application startup:
``` c#
// Define configuration
var config = new MaskConfig(instanceBits: 5, tenantBits: 14);

// Create key generator
var serverId = _application.Configuration.GetServerId(); // this is your code :)
var generator = new KeyGenerator(serverId, config);
```

Configuration defined above will give you the following maximum values:
```
   Max InstanceId:     31
   Max TenantId:       16383
   Max SequenceId:<PHONE_NUMBER>4415
```

For given configuration max sequenceId will be 8192 times bigger than int.MaxValue.

## Usage

When you need to create key:
``` c#
// Create key providing tenantId and sequenceId
var sequenceId = _hiloGenerator.GetNext(); // this is your code :)
var id = generator.Create(tenantId, sequenceId);
```
*Instead of HiLo you can use [LinearKeyAllocator](https://github.com/dario-l/LinearKeyAllocator).*

Output for example data:
```
    For:
        instanceId = 1;
        tenantId = 10;
        sequenceId = 100;

    Created id will be:
        long id =<PHONE_NUMBER>12156004
```

When you need to verify key for given tenantId you can reconstruct provided identifier:
``` c#
CompositeKey reconstructed = generator.Reconstruct(id);
if (reconstructed.TenantId != _userContext.TenantId) throw...
```

repository: dario-l/CompositeKeyGen

repo_name: dario-l/CompositeKeyGen


text:
# modules

If you quit from the Python interpreter and enter it again, the definitions you have made (functions and variables) are lost. Therefore, if you want to write a somewhat longer program, you are better off using a text editor to prepare the input for the interpreter and running it with that file as input instead. This is known as creating a script. As your program gets longer, you may want to split it into several files for easier maintenance. You may also want to use a handy function that you’ve written in several programs without copying its definition into each program.

如果你从python退出又重新进入的话，你创建过的定义（函数和变量）将会丢失。因此，如果你想写一些长的程序，为了给输入python做准备工作你最好使用文本编辑器，and running it with that file as input instead(不知道怎么翻比较好)。这就是所谓的创建script。随着你的程序变长，为了更好的维护，你可能会想把程序分成几个文件。你可能也会想使用你已经在一些文件里写过的hardy函数，而不是复制函数到每个文件。

To support this, Python has a way to put definitions in a file and use them in a script or in an interactive instance of the interpreter. Such a file is called a module; definitions from a module can be imported into other modules or into the main module (the collection of variables that you have access to in a script executed at the top level and in calculator mode).

为了支持这种做法，python有种方法用来把定义放进一个文件，并且在script或an interactive instance of the interpreter中来使用这些定义。这种文件就叫module。一个module中的定义可以导入到其他的modules中或是主module中（你可以进入的script中的变量集合，在计算模式中会被优先执行）

A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended. Within a module, the module’s name (as a string) is available as the value of the global variable __name__. For instance, use your favorite text editor to create a file called fibo.py in the current directory with the following contents:

Module是一种包括了python的定义和statements的文件。文件名是module名并加上.py的后缀。在一个module中，module的名字（作为字符串string）作为the value of the global variable_name_是可用的。举例来说，用你最爱的编辑器在现有directory建了个名叫fibo.py的文件，如下所示：

![](module 1.PNG)

Now enter the Python interpreter and import this module with the following command:太简单不翻了

![](module 2.PNG)

This does not enter the names of the functions defined in fibo directly in the current symbol table; it only enters the module name fibo there. Using the module name you can access the functions:

在现symbol table中，这步没有直接输入在fibo里定义的函数名称；仅仅只是输入了module的名字fibo。通过调用Module的名称，你可以直接进入这些函数：

![](module 3.PNG)

If you intend to use a function often you can assign it to a local name:

如果你打算经常使用一个函数，你可以把它指定到本地名

![](module 4.PNG)

## More on Modules
A module can contain executable statements as well as function definitions. These statements are intended to initialize the module. They are executed only the first time the module name is encountered in an import statement. [1] (They are also run if the file is executed as a script.)

就像函数一样，module也可以含有执行说明。这些说明是用来初如化module。他们只会在第一次module名字遇到。。。被执行。（如果文件像script执行，这些说明也会被执行）

Each module has its own private symbol table, which is used as the global symbol table by all functions defined in the module. Thus, the author of a module can use global variables in the module without worrying about accidental clashes with a user’s global variables. On the other hand, if you know what you are doing you can touch a module’s global variables with the same notation used to refer to its functions, modname.itemname.

每个module都有自己特有的结构，就像在module里所有函数所使用通用的结构那样。因此，module的作者可以使用global变量，而不用担心在使用global变量时出现意外的崩溃。从另一个方面来说，如果你知道。。。

Modules can import other modules. It is customary but not required to place all import statements at the beginning of a module (or script, for that matter). The imported module names are placed in the importing module’s global symbol table.

module可以导入其他的module。在module(或是script，for that matter)的开头，放置import的说明是默认的，但不是必须的。在导入的module的特征化的全局树型结构中，被导入的module

There is a variant of the import statement that imports names from a module directly into the importing module’s symbol table. For example

在导入说明里有个变量，

![](module 5.PNG)

This does not introduce the module name from which the imports are taken in the local symbol table (so in the example, fibo is not defined).
There is even a variant to import all names that a module defines:
这部份没有介绍module的名字，

![](module 6.PNG)

This imports all names except those beginning with an underscore (_).

这步导入了所有的名字，除了那些以下划线开头的部份。

Note that in general the practice of importing * from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions.

要注意，一般来说从module或是压缩包里导入*是不赞同的，因为这经常会引起可读性很差的代码。但是，在interactive session里用来节省输入是没问题的。

### Executing modules as scripts 像脚本一般的执行

When you run a Python module with
![](module 7.PNG)

the code in the module will be executed, just as if you imported it, but with the __name__ set to "__main__". That means that by adding this code at the end of your module:

module里的代码将会被执行，just as if you imported it, but with the  _name_ set to "_main_". 这意味着说在你的module后加上这行代码:

```if _name_ == "_main_":
   import sys
   fib(int(sys.argv[1]))```

   you can make the file usable as a script as well as an importable module, because the code that parses the command line only runs if the module is executed as the “main” file:

   你可以让文件变得不可用，因为。。。。

  ``` $ python fibo.py 50
   1 1 2 3 5 8 13 21 34 ```

   If the module is imported, the code is not run:
   >>> import fibo
   >>>

   This is often used either to provide a convenient user interface to a module, or for testing purposes (running the module as a script executes a test suite).
   这常被用来给使用都提供方便，或是测目的（像script一样执行module会引发测试suite）.

### The Module Search Path

When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path. sys.path is initialized from these locations:

当一个名中spam的module导入的时候，翻译器首先会在内置module里进行搜索。如果没有找到，然后才会去变量sys.path给出的目录里找名叫spam.py的文件。sys.path是从这些地方被初始化的：

•the directory containing the input script (or the current directory).
•PYTHONPATH (a list of directory names, with the same syntax as the shell variable PATH).
•the installation-dependent default.

After initialization, Python programs can modify sys.path. The directory containing the script being run is placed at the beginning of the search path, ahead of the standard library path. This means that scripts in that directory will be loaded instead of modules of the same name in the library directory. This is an error unless the replacement is intended. See section Standard Modules for more information.

初始化后，python可以编辑sys.path。包含了正在运行script的目录会在一开始搜索路径的时候被取代。这也就是说，在那个目录下的script将会被装载，以替代在目录里相同名字的module.这种说明出错了，除非这种代替结果是你想要的。查看Module部份以得到更多信息。

### “Compiled” Python files
As an important speed-up of the start-up time for short programs that use a lot of standard modules, if a file called spam.pyc exists in the directory where spam.py is found, this is assumed to contain an already-“byte-compiled” version of the module spam. The modification time of the version of spam.py used to create spam.pyc is recorded in spam.pyc, and the .pyc file is ignored if these don’t match.


text:
# scbcn17 Customer Segmentation Workshop
This workshop will be part of the [Software Craftsmanship 2017 conference](http://softwarecraftsmanshipbarcelona.org) in Barcelona, October 2017.

## Workshop Description
Let's learn about useful Machine Learning algorithms, invoking them from common data science libraries.

The workshop session starts with a brief introduction to ML (slides to be released after the workshop) and the different approaches we can apply. After that we will use this repository to practice exploring a real dataset, cleaning and optimizing the data, and using ML algorithms to find hidden insights.

No need to know about maths, machine learning, nor python; this is an introductory but profitable workshop!

## Requirements
You will need [docker](https://www.docker.com/) already installed in your machine.

We'll use a *docker container* that contains a data science stack, [jupyter/scypy-notebook](https://hub.docker.com/r/jupyter/scipy-notebook), so you don't need to install anything locally.

This container comes with the tools we need for this workshop:
- **jupyter**: A web IDE that edits notebooks
- **python3**: The language that will use as interface
- **numpy** and **pandas**: Python libraries to work with matrices and datasets
- **matplotlib**: Python ploting library to display data
- **scikit-learn**: Library with lots of Machine Learning algorithms

## Dataset
The workshop uses a [dataset released by ulabox](https://github.com/ulabox/datasets) in september 2017, that includes real purchases on ulabox website.

## Preparing and running this workshop
1. docker pull jupyter/scipy-notebook
2. git clone git@github.com:ulabox/datasets
3. git clone git@github.com:liopic/scbcn17-customer-segmentation
4. cp datasets/data/*.csv scbcn17-customer-segmentation/
5. cd scbcn17-customer-segmentation
6. ./jupyter.sh
7. Open the link in your browser and open the Workshop.ipynb file


text:
# To do

## Server

- [X] Spin up a server to house the GUI & handle the service that'll return the
rendered markup.
- [X] Look into BrowserSync for live reload https://www.browsersync.io/docs/gulp/.

---

## GUI

- [X] Loads form components from a folder.
- [X] Set up a 2 column shell. Left column holds the components, right column is
the drop-zone.
   - [ ] When components are dragged from the left to right, it'll start
   building out the JSON config Object.
   - [ ] Configs will either be saved locally or to a Database.

---

## Service

- [ ] When passed a config, it'll return the rendered markup.

---

## Bugs

- [X] When options are added for a select, they don't persist when you open the
config modal again.
- [X] When adding multiple options at once the index is the same causing previous
values to be blank since only the last one is written.