text:
# Changelog

## v0.3.2

## New features

- Support read file from http URL (#1317)
- add a new PyText get_num_examples_from_batch function in model (#1319)
- Add support for length label smoothing (#1308)
- Add new metrics type for Masked Seq2Seq Joint Model (#1304)
- Add mask generator and strategy (#1302)
- Add separate logging for label loss and length loss (#1294)
- Add tensorizer support for masking of target tokens (#1297)
- Add length prediction and basic masked generator (#1290)
- Add self attention option to conv_encoder and conv_decoder (#1291)
- Entity Saliency modeling on PyText: EntitySalienceMetricReporter/EntitySalienceTask
- In-batch negative training for BertPairwiseModel
- Support embedding from decoder (#1284)
- Add dense features to Roberta
- Add projection layer to HuggingFace encoder (#1273)
- add PyText Embedding TorchScript Wrapper
- Add option to pad missing label in LabelListTensorizer (#1269)
- Integrate PET and Introduce ElasticTrainer (#1266)
- support PoolingType in DocNN. (#1259)
- Added WordSeqEmbedding (#1255)
- Open source Assistant NLU seq2seq model (#1236)
- Support multi label classification
- BART in decoupled model

## Bug fixes

- Cast model output to cpu (#1329)
- Fix OSS predict-py API (#1320)
- Fix "calling median on empty tensor" issue in MR (#1322)
- Add ScriptDoNothingTokenizer so that torchscriptification of SPM does not fail (#1316)
- Fix creating generator everytime (#1301)
- fix dense feature for fp16
- Avoid edge cases with quantization by setting a known seed (#1295)
- Make torchscript predictions even on empty text / token inputs
- fix dense feature TorchScript typing (#1281)
- avoid zero division error in metrics reporter (#1271)
- Fix contiguous issue in bilstm export (#1270)
- fix debug file generation for multilabel classification (#1247)
- Fix fp16 optimizer attribute name

## Other

- New Debug File for masked seq2seq
- Move MockConfigLoader to OSS (#1324)
- Pass in optimizer config instead of create_optimizer to trainer
- Remove unnecessary torch.no_grad() block (#1323)
- Fix Memory Issues in Metric Reporter for Classification Tasks over large Label Spaces
- Add contextual embedding support to OS seq2seq model (#1299)
- recover xlm_r tutorial notebook (#1305)
- Enable controlling bias in MLP decoder
- Migrate serving tutorial to TorchScript (#1310)
- delete caffe2 export (#1307)
- add whitelist for ONNX export
- Use dynamic quantization api for BeamSearch (#1303)
- Remove requirement that eos/bos be supplied for sequence export. (#1300)
- Multicolumn support
- Multicolumn support in torchscriptify
- Add caching support to RawExample and batch predict API (#1298)
- Add save-pytext-snapshot command to PyText cmdline (#1285)
- Update with Whatsapp calling data + support dictionary features (#1293)
- add arrange_caffe2_model_inputs in BaseModel (#1292)
- Replace unit-tests on LMModel and FLLanguageModelingTask by LiteLMModel and FLLiteLMTask (#1296)
- changes to make mbart work (#1911)
- handle encoder and decoder embedding
- Add tutorial for semantic parsing. (#1288)
- Add new fb beam search with fused operator (#1287)
- Move generator builder to constructor so that it can easily overridden. (#1286)
- Torchscriptify ELTensorizer (#1282)
- Torchscript export for Seq2Seq model (#1265)
- Change Seq2Seq model from_config() to a more general api (#1280)
- add max_seq_len to DocNN TorchScript model (#1279)
- support XLM-R model Embedding in TorchScript (#1278)
- Generic PyText Checkpoint Manager Interface (#1267)
- Fix backward compatibility issue of pad_missing in LabelListTensorizer (#1277)
- Update mean reduction in NLLLoss (#1272)
- migrate pages.integrity.scam.docnn_models.xxx (#1275)
- Unify model input for ByteTokensDocumentModel (#1274)
- Torchscriptify TokenTensorizer
- Allow dictionaries to overwrite entries with #fairseq:overwrite comment (#1073)
- Make WordSeqEmbedding ONNX compatible
- If the snapshot path provided is not valid, throw error (#1268)
- support vocab filter by min count
- Unify input for TorchScript Tensorizers and Models (#1256)
- Torchscriptify XLM-R
- Add class logging to task (#1264)
- Add usage logging to exporter (#1262)
- Add usage logging across models (#1263)
- Usage logging on data classes (#1261)
- GPT2 BPE add lower casing support (#1260)
- FAISS Embedding Search Space [3/5]
- Return len of tokens of each sequence in SeqTokenTensorizer (#1254)
- Vocab Limited Pretrained Embedding [2/5] (#1248)
- add Stage.OTHERS and allow TB to print to a seperate prefix not in (TRAIN, TEST, EVAL) (#1258)
- Add option to skip 2 stage tokenizer and bpe decode sequences in the debug file (#1257)
- Add Testcase for Wordpiece Tokenizer (#1249)
- modify accuracy calculation for multi-label classification (#1244)
- Enable tests in pytext/config:pytext_all_config_test
- Introduce Class Usage Logging (#1243)
- Make PyText compatible with Any type (#1242)
- Make dict_embedding Torchscript friendly (#1240)
- Support MultipleData for export and kd generation
- delete flaky/broken tests (#1238)
- Add support for returning start & end indices.

## v0.3.1

## New features
- Implement SquadQA tensorizer in TorchScript (#1211)
- Add session data source for df (#1202)
- Dynamic Batch Scheduler Implementation (#1200)
- Implement loss aware sparsifier (#1204)
- Ability to Fine-tune XLM-R for NER on CoNLL Datasets (#1201)
- TorchScriptify Tokenizer after training (#1191)
- Linear Layer only blockwise sparsifier (#478)
- Adding performance graph to pytext models (#1192)
- Enable inference on GPUs by moving tensors to specified device (#472)
- Add support for learning from soft labels for Squad (MRC) models (#1188)
- Create byte-aware model that can make byte predictions (#468)
- Minimum Trust Lamb (#1186)
- Allow model to take byte-level input and make byte-level prediction (#1187)
- Scheduler with Warmup (#1184)
- Implement LAMB optimizer (#1183)
- CyclicLRScheduler (#1157)
- PyText Entity Linking: ELTask and ELMetricReporter (#1165)

## Bug fixes
- Don't upgrade if Tensorizer already given (#504)
- avoid torchscriptify on a ScriptModule (#1214)
- Make tensorboard robust to NaN and Inf in model params (#1206)
- Fix circleCLI Test broken in D19027834 (#1205)
- Fix small bug in pytext vocabulary (#401)
- Fix CircleCI failure caused by black and regex (#1199)
- Fix CircleCI (#1194)
- Fix Circle CI Test broken by D18880705 (#1190)
- fix weight load for new fairseq checkpoints (#1189)
- Fix Heirarchical intent and slot filling demo is broken (#1012) (#1151)
- Fix index error in dict embedding when exported to Caffe2 (#1182)
- Fix zero loss tensor in SquadOutputLayer (#1181)
- qa fix for ignore_impossible=False

## Other

- Printing out error's underlying reason (#1227)
- tidy file path in help text for invocation of docnn.json example (#1221)
- PyText option to disable CUDA when testing. (#1223)
- make augmented lstm compatible w other lstms (#1224)
- Vocab recursive lookup (#1222)
- Fix simple typo: valus -> value (#1219)
- support using RoundRobin ProcessGroup in Distributed training (#1213)
- Use PathManager for all I/O (#1198)
- Make PathManager robust to API changes in fvcore (#1196)
- Support for TVM training (BERT) (#1210)
- Exit LM task if special token exists in text for ByteTensorizer (#1207)
- Config adapter for pytext XLM (#1172)
- Use TensorizerImpl for both training and inference for BERT, RoBERTa and XLM tensorizer (#1195)
- Replace gluster paths with local file paths for NLG configs (#1197)
- Make BERT Classification compatible with TSEs that return Encoded Layers.
- implement BertTensorizerImpl and XLMTensorizerImpl (#1193)
- Make is_input field of tensorizer configurable (#474)
- BERTTensorizerBaseImpl to reimplement BERTTensorizerBase to be TorchScriptable (#1163)
- Improve LogitsWorkflow to handle dumping of raw inputs and multiple output tensors (#683)
- Accumulative blockwise pruning (#1170)
- Patch for UnicodeDecodeError due to BPE. (#1179)
- Add pre-loaded task as parameter to caffe2 batch prediction API
- Specify CFLAGS to install fairseq in MacOS (#1175)
- Resolve dependency conflict by specifying python-dateutil==2.8.0 (#1176)
- Proper training behavior if setting do_eval=False (#1155)
- Make DeepCNNRepresentation torchscriptable (#453)

## v0.3.0

## New Features
**RoBERTa and XLM-R**
- Integrate XLM-R into PyText (#1120)
- Consolidate BERT, XLM and RobERTa Tensorizers (#1119)
- Add XLM-R for joint model (#1135)
- Open source Roberta (#1032)
- Simple Transformer module components for RoBERTa (#1043)
- RoBERTa models for document classification (#933)
- Enable MLM training for RobertaEncoder (#1126)
- Standardize RoBERTa Tensorizer Vocab Creation (#1113)
- Make RoBERTa usable in more tasks including QA (#1017)
- RoBERTa-QA JIT (#1088)
- Unify GPT2BPE Tokenizer (#1110)
- Adding Google SentencePiece as a Tokenizer (#1106)

**TorchScript support**
- General torchscript module (#1134)
- Support torchscriptify XLM-R (#1138)
- Add support for torchscriptification of XLM intent slot models (#1167)
- Script xlm tensorizer (#1118)
- Refactor ScriptTensorizer with general tensorize API (#1117)
- ScriptXLMTensorizer (#1123)
- Add support for Torchscript export of IntentSlotOutputLayer and CRF (#1146)
- Refactor ScriptTensorizor to support both text and tokens input (#1096)
- Add torchscriptify API in tokenizer and tensorizer (#1055)
- Add more stats in torchscript latency script (#1044)
- Exported Roberta torchscript model include both traced_model and pre-processing logic (#1013)
- Native Torchscript Wordpiece Tokenizer Op for BERTSquadQA, Torchscriptify BertSQUADQAModel (#879)
- TorchScript-ify BERT training (#887)
- Modify Return Signature of TorchScript BERT (#1058)
- Implement BertTensorizer and RoBERTaTensorizer in TorchScript (#1053)

**Others**
- FairseqModelEnsemble class (#1116)
- Inverse Sqrt Scheduler (#1150)
- Lazy modules (#1039)
- Adopt Fairseq MemoryEfficientFP16Optimizer in PyText (#910)
- Add RAdam (#952)
- Add AdamW (#945)
- Unify FP16&FP32 API (#1006)
- Add precision at recall metric (#1079)
- Added PandasDataSource (#1098)
- Support testing Caffe2 model (#1097)
- Add contextual feature support to export for Seq2Seq models
- Convert matmuls to quantizable nn.Linear modules (#1304)
- PyTorch eager mode implementation (#1072)
- Implement Blockwise Sparsification (#1050)
- Support Fairseq FP16Optimizer (#1008)
- Make FP16OptimizerApex wrapper on Apex/amp (#1007)
- Remove vocab from cuda (#955)
- Add dense input to XLMModel (#997)
- Replace tensorboardX with torch.utils.tensorboard (#1003)
- Add mentioning of mixed precision training support (#643)
- Sparsification for CRF transition matrix (#982)
- Add dense feature normalization to Char-LSTM TorchScript model. (#986)
- Cosine similarity support for BERT pairwise model training (#967)
- Combine training data from multiple sources (#953)
- Support visualization of word embeddings in Tensorboard (#969)
- Decouple decoder and output layer creation in BasePairwiseModel (#973)
- Drop rows with insufficient columns in TSV data source (#954)
- Add use_config_from_snapshot option(load config from snapshot or current task) (#970)
- Add predict function for NewTask (#936)
- Use `create_module` to create CharacterEmbedding (#920)
- Add XLM based joint model
- Add `ConsistentXLMModel` (#913)
- Optimize Gelu module for caffe2 export (#918)
- Save best model's sub-modules when enabled (#912)

## Documentation / Usability
- XLM-R tutorial in notebook (#1159)
- Update XLM-R OSS tutorial and add Google Colab link (#1168)
- Update "raw_text" to "text" in tutorial (#1010)
- Make tutorial more trivial (add git clone) (#1037)
- Changes to make tutorial code simpler (#1002)
- Fix datasource tutorial example (#998)
- Handle long documents in squad qa datasource and models (#975)
- Fix pytext tutorial syntax (#971)
- Use torch.equal() instead of "==" in Custom Tensorizer tutorial (#939)
- Remove and mock doc dependencies because readthedocs is OOM (#983)
- Fix Circle CI build_docs error (#959)
- Add OSS integration tests: DocNN (#1021)
- Print model into the output log (#1127)
- Migrate pytext/utils/torch.py logic into pytext/torchscript/ for long term maintainability (#1082)
- Demo datasource fix + cleanup (#994)
- Documentation on the config files and config-related commands (#984)
- Config adapter old data handler helper (#943)
- Nicer gen_config_impl (#944)

## Deprecated Features
- Remove DocModel_Deprecated (#916)
- Remove RNNGParser_Deprecated, SemanticParsingTask_Deprecated, SemanticParsingCppTask_Deprecate, RnngJitTask,
- Remove QueryDocumentTask_Deprecated(#926)
- Remove LMTask_Deprecated and LMLSTM_Deprecated (#882)
- CompositionDataHandler to fb/deprecated (#963)
- Delete deprecated Word Tagging tasks, models and data handlers (#910)

## Bug Fixes
- Fix caffe2 predict (#1103)
- Fix bug when tensorizer is not defined (#1169)
- Fix multitask metric reporter for lr logging (#1164)
- Fix broken gradients logging and add lr logging to tensorboard (#1158)
- Minor fix in blockwise sparsifier (#1130)
- Fix clip_grad_norm API (#1143)
- Fix for roberta squad tensorizer (#1137)
- Fix multilabel metric reporter (#1115)
- Fixed prepare_input in tensorizer (#1102)
- Fix unk bug in exported model (#1076)
- Fp16 fixes for byte-lstm and distillation (#1059)
- Fix clip_grad_norm_ if grad_norm > max_norm > 0: TypeError: '>' not supported between instances of 'float' and 'NoneType' (#1054)
- Fix context in multitask (#1040)
- Fix regression in ensemble trainer caused by recent fp16 change (#1033)
- ReadTheDocs OOM fix with CPU Torch (#1027)
- Dimension mismatch after setting max sequence length (#1154)
- Allow null learning rate (#1156)
- Don't fail on 0 input (#1104)
- Remove side effect during pickling PickleableGPT2BPEEncoder
- Set onnx==1.5.0 to fix CircleCI build temporarily (#1014)
- Complete training loop gracefully even if no timing is reported (#1128)
- Propagate min_freq for vocab correctly (#907)
- Fix gen-default-config with Model param (#917)
- Fix torchscript export for PyText modules (#1125)
- Fix label_weights in DocModel (#1081)
- Fix label_weights in bert models (#1100)
- Fix config issues with Python 3.7 (#1066)
- Temporary fix for Fairseq dependency (#1026)
- Fix MultipleData by making tensorizers able to initialize from multiple data sources (#972)
- Fix bug in copy_unk (#964)
- Division by Zero bug in MLM Metric Reporter (#968)

## v0.2.2

*Note:* this is the last release with _Deprecated classes. Those classes will be removed in the next release.

**New Features:**
- DeepCNN Representation for word tagging
- Combine KLDivergenceBCELoss with SoftHardBCELoss and F.cross_entropy() in CrossEntropyLoss (#689)
- add dense feature support for doc model (#710)
- add torchscript quantizaiton support in pytext
- pytext multi-label support (#731)
- open source transformer representations (#736)
- open source transformer based models - data, tensorizers and tokenizer (#708)
- Create AlternatingRandomizedBatchSampler (#737)
- open source MaskedLM and BERT models (#734)
- Support bytes input in word tagging model OSS (#745)
- open source extractive question answering models (#742)
- torchscriptify for ensemle task
- enabled lmlstm labels exporting (#767)
- Enable dense features in ByteTokensDocumentModel (#763)
- created bilstm dropout condition (#769)
- enabled lmlstm caffe2 exporting (#766)
- PolynomialDecayScheduler (#791)
- removed bilstm dependence on seq_lengths (#776)
- fp16 optimizer (#782)
- Add Dense Feature Normalization to FloatListTensorizer and DocModel (#859)
- Add Sparsifier component to PyText and L0-projection based sparsifier (#860)
- implemented cnn pooling for doc classification (#872)
- implemented bottleneck separable convolutions (#855)
- Add eps to Adam (#858)
- implemented mobile exporter (#785)
- support starting training from saved checkpoint (#824)
- implemented separable convolutions (#830)
- implemented gelu activations (#829)
- implemented causal convolutions (#811)
- implemented dilation for convolutions (#810)
- created weight norm option (#809)
- Ordered Neuron LSTM (#854)
- Add PersonalizedByteDocModel (#816)
- CNN based language models (#827)
- improve csv support in TSVDataSource (#777)
- Change default batch sampler DisjointMultitaskData to RoundRobinBatchSampler (#802)
- Support using serialized pretrained embedding file (#797)

**Documentation / Usability / Logging:**
- Fewer out-of-vocab print messages, with some stats (#697)
- Echo epoch number to console while training (#712)
- Separate timing for prediction and metric calculation. (#738)
- multi-label soft metrics (#754)
- changed lm metric reporting (#765)
- fix data source tutorial (#762)
- fix doc sphinx deprecation warning (#775)
- Add the ability to pass parameter values to gen-default-config (#856)
- Remove "pytext/" from paths in demo json config (#878)
- New documentation about hacking pytext and dealing with github. (#862)
- install_deps supports updates (#863)
- Reduce number of PEP print (#861)
- better error message for config with unknown component (#801)
- Add Recall at Precision Thresholds to Config (#792)
- implemented perplexity reductions for lm score reporting (#799)
- adapt prediction workflow to new design (#746)

**Bug fixes:**
- block sharded tsv eval/test fix (#698)
- Fix BoundaryPooling tracing (#713)
- fixes LMLSTM weight tying bug (#704)
- Fix duplicate entries in vocab (#721)
- Bugfix for trainer not reporting eval results (#740)
- Reintroduce metrics export in new task (#748)
- fix open source tests (#750)
- Fix missing init_tensorizers arg (#893)
- Fix intent slot metric reporter not working with byte offset (#883)
- Fix issue with some tensorizers still re-initializing vocab when loaded from saved state (#848)
- fixed overflow error in lm reporting (#831)
- fix BlockShardedTSVDataSource (#832)

## v0.2.1

(skipped because of packaging issues)

## v0.2.0

*Note:* This release makes the new data handler API the default and deprecates Task and Model classes using the old data handler API. We recommend that you migrate your models to the new API as soon as possible. More details here: http://...

**New Stuff**
- most tasks and models deprecated, replaced with better versions using the new data handler API
- performance improvements in metric reporter
- Add Multilingual TSV Data Source
- LabelSmoothedCrossEntropyLoss
- Support for pretrained word embedding in TokenTensorizer
- option to use pretrained embedding
- TorchScript export for document classification
- Improve log in trainer
- performance measurement: reporting tokens_per_second and updates_per_second
- Implement DocumentReader from DrQA in PyText (StackedBidirectionalRNN)
- improved and updated documentation
- Implement SWA(SGD|ADAM) and Adagrad Optimizers
- cache numerized data in memory
- TorchScript BPE tokenization
- CLI command to update configs
- Visualize gradients with tensorboard

*Many bug fixes and code clean-ups*

## v0.1.5

*Note:* this is a last release in 0.1.x. The next release will deprecate Task and Model base classes and make the improved API of the new data handler the default. You can start using it already by inheriting from NewTask. NewDocumentClassification and NewWordTaggingTask use this new API, and you can get the first example in the tutorial "Custom Data Format".

**New Stuff**
- add config adapter
  - PyText is very young and its API is still in flux, making the config files brittle
  - config files now have a version number reflecting the API at the time it was created
  - older versions can be loaded and internally transformed into newer versions
- better metrics and reporting
  - better training time tracking
  - cool new visualization of model state in TensorBoard
  - pretty results in the terminal
- improved distributed training
- torchscript export
- support for SQuAD dataset
- add AugmentedLSTM
- add dense features support
- new plugin system: command line option --include to import custom user classes (see tutorial "Custom Data Format" for example)

*Many bug fixes and code clean-ups*

## v0.1.4
**New Stuff**
- Refactor Metric Reporters to reduce coupling
- RNNG Improvements:
  - Support Pretrained embeddings in RNNG
  - Support GPU Training
  - More Test Coverage
  - Tensorboard Support
- Added `QueryDocumentPairwiseRankingModel`
- Distributed Training Improvments:
  - Sharded Data Loading to reduce memory consumption
  - Fix Several issues with race conditions and unserializable state
- Reduced GPU memory Consumption by skipping gradient computation on evaluation

*And lots of bug fixes*

**Known Issues**
PyText doesn't work with the new ONNX v1.4.0, so we have pinned it to 1.3.0 for now

## v0.1.3
 - Remove epoch_size param from DisjointMultitask, use target_task (or shortest) to set epoch_size

## v0.1.0

Initial version

repository: mruberry/pytext

repo_name: mruberry/pytext


text:
# What Are "Agile" and "Lean", Anyways?

### Notes

- [https://www.google.ca/search?q=what+are+agile+and+lean&oq=what+are+agile+and+lean&aqs=chrome..69i57j0l5.5913j0j7&sourceid=chrome&ie=UTF-8#safe=strict&tbs=qdr:m&q=what+are+agile+and+lean+medium.com](https://www.google.ca/search?q=what+are+agile+and+lean&oq=what+are+agile+and+lean&aqs=chrome..69i57j0l5.5913j0j7&sourceid=chrome&ie=UTF-8#safe=strict&tbs=qdr:m&q=what+are+agile+and+lean+medium.com)
- [https://medium.com/10-min-briefing-on-startup-tech-news](https://medium.com/10-min-briefing-on-startup-tech-news)
- [https://medium.com/swlh/one-for-the-forgotten-pixels-7b02e2497263](https://medium.com/swlh/one-for-the-forgotten-pixels-7b02e2497263)
- [https://hackerchick.com/agile-vs-lean-yeah-yeah-whats-the-difference/](https://hackerchick.com/agile-vs-lean-yeah-yeah-whats-the-difference/)
- [https://cstudies.ubc.ca/study-topic/agile-lean?gclid=CjsKDwjw0cXIBRCxjqnE3K3sHhIkAL1LezSMua2j1eSaVUQ-Oh0GHMHOixiiHdU0mHkSCiTcbmaDGgLwIPD_BwE](https://cstudies.ubc.ca/study-topic/agile-lean?gclid=CjsKDwjw0cXIBRCxjqnE3K3sHhIkAL1LezSMua2j1eSaVUQ-Oh0GHMHOixiiHdU0mHkSCiTcbmaDGgLwIPD_BwE)
- [https://agileleanlife.com/agile-lean-you/](https://agileleanlife.com/agile-lean-you/)
- [https://leankit.com/blog/2016/09/lean-agile-devops/](https://leankit.com/blog/2016/09/lean-agile-devops/)

https://github.com/janzeteachesit/redefining-the-classroom/tree/f9bf15024005fdf6b07c420418a8366aabebe234/pm

license: MIT

repository: johnnymck/MoocX

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: johnnymck/MoocX


text:
original source: [https://adventofcode.com/2022/day/1](https://adventofcode.com/2022/day/1)
## --- Day 1: Calorie Counting ---
Santa's reindeer typically eat regular reindeer food, but they need a lot of [magical energy](/2018/day/25) to deliver presents on Christmas. For that, their favorite snack is a special type of star fruit that only grows deep in the jungle. The Elves have brought you on their annual expedition to the grove where the fruit grows.

To supply enough magical energy, the expedition needs to retrieve a minimum of fifty stars by December 25th. Although the Elves assure you that the grove has plenty of fruit, you decide to grab any fruit you see along the way, just in case.

Collect stars by solving puzzles.  Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first.  Each puzzle grants one star. Good luck!

The jungle must be too overgrown and difficult to navigate in vehicles or access from the air; the Elves' expedition traditionally goes on foot. As your boats approach land, the Elves begin taking inventory of their supplies. One important consideration is food - in particular, the number of Calories each Elf is carrying (your puzzle input).

The Elves take turns writing down the number of Calories contained by the various meals, snacks, rations, etc. that they've brought with them, one item per line. Each Elf separates their own inventory from the previous Elf's inventory (if any) by a blank line.

For example, suppose the Elves finish writing their items' Calories and end up with the following list:

1000
2000
3000

4000

5000
6000

7000
8000
9000

10000

This list represents the Calories of the food carried by five Elves:

 - The first Elf is carrying food with 1000, 2000, and 3000 Calories, a total of 6000 Calories.
 - The second Elf is carrying one food item with 4000 Calories.
 - The third Elf is carrying food with 5000 and 6000 Calories, a total of 11000 Calories.
 - The fourth Elf is carrying food with 7000, 8000, and 9000 Calories, a total of 24000 Calories.
 - The fifth Elf is carrying one food item with 10000 Calories.

In case the Elves get hungry and need extra snacks, they need to know which Elf to ask: they'd like to know how many Calories are being carried by the Elf carrying the most Calories. In the example above, this is 24000 (carried by the fourth Elf).

Find the Elf carrying the most Calories. How many total Calories is that Elf carrying?

## --- Part Two ---
By the time you calculate the answer to the Elves' question, they've already realized that the Elf carrying the most Calories of food might eventually run out of snacks.

To avoid this unacceptable situation, the Elves would instead like to know the total Calories carried by the top three Elves carrying the most Calories. That way, even if one of those Elves runs out of snacks, they still have two backups.

In the example above, the top three Elves are the fourth Elf (with 24000 Calories), then the third Elf (with 11000 Calories), then the fifth Elf (with 10000 Calories). The sum of the Calories carried by these three elves is 45000.

Find the top three Elves carrying the most Calories. How many Calories are those Elves carrying in total?

repository: encse/adventofcode

gha_language: C#

gha_license_id: NOASSERTION

repo_name: encse/adventofcode


text:
# React Formio

A [React](http://facebook.github.io/react/) component for rendering out forms based on the [Form.io](https://www.form.io) platform.

## Install

### npm

`React Formio` can be used on the server, or bundled for the client using an
npm-compatible packaging system such as [Browserify](http://browserify.org/) or
[webpack](http://webpack.github.io/).

```
npm install react-formio --save
```

### Browser bundle

The browser bundle exposes a global `Formio` variable and expects to find
a global `React` variable to work with.

You can find it in the [/dist directory](https://github.com/formio/react-formio/tree/master/dist/build).

## Form class

Give `Form` a `src` property and render:

** For es5 require() modules. **
```javascript
var React = require('react');
var ReactDOM = require('react-dom');
var Form = require('react-formio').Form;
```

** For es6 import/export modules. **
```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import {Form} from 'react-formio';
```

```javascript
ReactDOM.render(
  <Form src="https://example.form.io/example" />
  , document.getElementById('example')
);
```

See the src folder for all the available Props.

## FormBuilder class
The FormBuilder class can be used to embed a form builder directly in your react application. Please note that you'll need to include the CSS for the form builder from formio.js as well.

** For es6 import/export modules. **
```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import {FormBuilder} from 'react-formio';
```

```javascript
ReactDOM.render(
  <FormBuilder form={{display: 'form'}} onChange={(schema) => console.log(schema)} />
  , document.getElementById('builder')
);
```

See the src folder for all the available Props.

## License
Released under the [MIT License](http://www.opensource.org/licenses/MIT).

repository: pkunchamwar/react-formio

gha_license_id: MIT

repo_name: pkunchamwar/react-formio


text:
# Browser RPG
**Current Version: 0.1.0**

A browser based RPG system

## Built With

* [NPM](https://www.npmjs.com/) - Package Management
* [Gulp](http://gulpjs.com/) - Task Runner

## Versioning

We use [SemVer](http://semver.org/) for versioning.

## Authors

* **Joe Buchalter**

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

repository: Amawuff/BrowserRPG

repo_name: Amawuff/BrowserRPG


text:
# 02. Starting Out

## Functions & if-else expression

- Function application (calling a function by putting a space after it and then typing out the parameters) has the highest precedence of them all.
- Functions in Haskell don't have to be defined in a particular order so you can define a function that uses another function that is declared later.
- `if`, `else` in haskell is an expression - must return a value
- `else` is mandatory
- functions can't begin with uppercase letters.

## List & String

strings are lists and we can use list functions on them

Watch out when using `++` for large original (left-side) list (or string) because haskell has to walk through the whole left-side list to append (linear time). Using `:` (prepend - cons) is constant time.

```haskell
'A':" SMALL CAT"
-- "A SMALL CAT"
5:[1,2,3,4,5]
-- [5,1,2,3,4,5]
```

Lists can be compared if the stuff they contain can be compared - they are compared in lexicographical order. << good to avoid writing loops to compare list elements

```haskell
[3,4,2] > [2,4]
-- True
[3,4,2] == [3,4,2]
-- True
```

Useful list functions

- `head :: [a] -> a`
- `tail :: [a] -> [a]` (always return a list: `tail [1] -> []`)
- `last :: [a] -> a`
- `init :: [a] -> [a]` (opposite of `last`)
^ **all these methods will throw an exception if called on an empty list**

- `length :: [a] -> Int`
- `null :: [a] -> Bool` - returns `True` if the list is empty use this instead of `xs == []`
- `reverse :: [a] -> [a]`
- `take :: Int -> [a] -> [a]` - takes a number of elements from the beginning of the list
- `drop :: Int -> [a] -> [a]` - drops a number of elements from the beginning of the list
- `sum`
- `elem :: a -> [a] -> Bool` - check if the value is in the list

Ranges -> `[2,4..20]` or `['a'...'z']` or `[20,19..1]` or `[13,26..24*13]` can be used to create a range - list of sequence

*Don't use float for range.*
http://learnyouahaskell.com/starting-out

Infinite list: [13,26,..]
- `cycle [1,2,3]` (infinite list of 1,2,3,1,2,..)
- `repeat`
- `replicate`

List comprehension

```haskell
-- [ <expression> | <binding> <- <seed>, <where> ]
[x*2 | x <- [1..10], x*2 >= 12]

-- multiple filters
[x | x <- [10..20], x /= 13, x /= 15, x /= 19]

-- multiple seeds
[x*y | x <- [2,5,10], y <- [8,10,11], x*y > 50]
```

## Tuples

- `("name", 1, True)`
- 2-tuples (pair) / 3-tuples (triple)
- safer to model something like known size list of items (e.g. vector)
- useful functions for pairs `fst` and `snd` (only pairs)
- `zip :: [a] -> [b] -> [(a, b)]` - create list of pairs from two lists
  ^ good for traversing two lists simultaneously
  - if two lists are different lengths - it only goes to the shorter one
  - you can zip an infinite list to a finite list (or to another infinite list)

repository: bhongy/learn-haskell

gha_language: Haskell

repo_name: bhongy/learn-haskell


text:
# Contra [![Build Status](https://travis-ci.com/aja-video/contra.svg?branch=master)](https://travis-ci.com/aja-video/contra) [![Go Report Card](https://goreportcard.com/badge/github.com/aja-video/contra)](https://goreportcard.com/report/github.com/aja-video/contra) [![GoDoc](https://godoc.org/github.com/aja-video/contra?status.svg)](https://godoc.org/github.com/aja-video/contra)

AJA's network device configuration tracker software built using GoLang.
Initially focused on routers and switches, but expected to track all
network device configurations.

As the MIT license states, use this code at your own risk. It has been
running smoothly for months on end without any issues, but something could
always go wrong.

### Features

* Automated configuration tracking for all supported network devices.
* Tracks changes in GIT, plus email notifications for changes.
* Email notifications when a device is unable to be backed up.

## Installation
* Linux packages (deb and rpm) - download the latest [release](https://github.com/aja-video/contra/releases)
* or [build](#Building) from source

### Configuration

Copy the `contra.example.conf` file to `contra.conf` and configure.

#### Encrypt Passwords

Note, all passwords are encrypted using an EncryptKey on the first run.
If an EncryptKey is not set, one will be randomly generated.
While the encryption key is in the conf file, this makes it so the passwords are not stored as plain
text.

We do this to prevent inadvertent password leak from someone standing behind you.
As well as to make it a little harder for someone who stumbles upon the file to determine the passwords.
Of course, with the source code, they can easily determine how to decrypt the passwords.

Set `EncryptPasswords = false` to disable this behavior.

#### Git Push

By default, changes will be committed to the defined workspace folder.

You can set up the workspace folder's git repo with a remote origin, and set GitPush to true.

By default, GitAuth is also set to true, and will use `.ssh/id_rsa` private keypair to attempt the push.
You can set GitAuth to false and it is effectively a `git push` from the workspace folder.

#### Config Test

Each time the application is started, a basic santiy check is run.
It only ensures that all config keys match a real key name, as well as checks
that any value which the system expects to be a bool, is actually a bool (true or false).

A failing check will exit the application. A passing check will continue to run
the application. Using the `-configtest` flag will exit even if the checks pass.

## Supported Devices

### Current

* pfSense
* Cisco Small Business
* Vyatta
* HP/Procurve
* HP/Comware
    * For locked down devices use UnlockPass in the device configuration to unlock xtd-cli-mode
* Arista
* Mikrotrik

### Someday

* Cisco
* Juniper (JunOS)
* http
* custom scripting

## Device Configuration

If a password, or any field in the config file, contains a `#` or `;` character be sure to properly
quote the password with either a backtick ``` ` ``` or a set of three double-quotes ``` """ ``` for
example, if your password is `Some#pass;word` you will need one of the following formats:

```
Pass=`Some#pass;word`
Pass="""Some#pass;word"""
```

## Building

* Binary only: `make binaries`
* Linux packages (.deb and .rpm) `make packages`
  * requires `fpm` - http://fpm.readthedocs.io/en/latest/installing.html
* Release build (compressed binary and packages) `make release`
  * requires `fpm` - http://fpm.readthedocs.io/en/latest/installing.html
  * requires `upx` - https://upx.github.io/
* If you would like to build for another platform `GOOS=$platform GOARCH=$arch go build contra.go`
  * While Contra may work on platforms other than Linux it is untested.

After the initial build, `make run` or `make` then execute `./bin/contra`

#### Dependency Management
* [Go 1.11 modules](https://github.com/golang/go/wiki/Modules) are used to manage dependencies

#### Testing
* Using [golint](https://github.com/golang/lint) for code style `go get -u golang.org/x/lint/golint`

## Contributing

If you have a device that is not yet supported, please review on of the existing devices and
consider making a pull request with support for your device. Alternatively, you can create an issue
and provide logs showing the steps necessary to pull the configs, and we can try to add support
for the device.

Be sure to `make test` to run fmt, vet, lint, and tests before each commit.

## License

Contra is licensed under the MIT License

## Acknowledgements

* This project was inspired by Splendid, Sweet, and Rancid.

repository: aja-video/contra

gha_language: Go

repo_name: aja-video/contra


text:
frontend-[webpack](https://github.com/webpack/webpack)
=================

Frontend workflow with [gulp](https://github.com/gulpjs/gulp), [webpack](https://github.com/webpack/webpack) and [bower](https://github.com/bower/bower).

Installation
------------

1. Install [node.js](http://nodejs.org/)
2. Clone the git repo `git clone https://github.com/webpack-cn/frontend-webpack.git
3. Install Gulp `npm install -g gulp`
4. Install dependencies `npm install`

How to use
----------

Run `gulp bower` to fetch current bower dependencies. The files are copied to the directory `src/lib`.

Run `gulp`, open `http://localhost:8080/webpack-dev-server/` and start coding.

Versioning
----------

This software is maintained under the [Semantic Versioning guidelines](http://semver.org/).

Bug tracker
-----------

Have a bug? Please create an issue here on GitHub:

https://github.com/webpack-cn/frontend-webpack/issues

Copyright and license
---------------------

Copyright © Jakob Linskeseder

frontend-webpack is licensed under the MIT License - see the `LICENSE` file for details.

repository: webpack-cn/frontend-webpack

repo_name: webpack-cn/frontend-webpack


text:
### [CVE-2021-34991](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34991)
![](https://img.shields.io/static/v1?label=Product&message=R6400v2&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-121%3A%20Stack-based%20Buffer%20Overflow&color=brighgreen)

### Description

This vulnerability allows network-adjacent attackers to execute arbitrary code on affected installations of NETGEAR R6400v2 <IP_ADDRESS>_10.0.80 routers. Authentication is not required to exploit this vulnerability. The specific flaw exists within the UPnP service, which listens on TCP port 5000 by default. When parsing the uuid request header, the process does not properly validate the length of user-supplied data prior to copying it to a fixed-length stack-based buffer. An attacker can leverage this vulnerability to execute code in the context of root. Was ZDI-CAN-14110.

### POC

#### Reference
- https://kb.netgear.com/000064361/Security-Advisory-for-Pre-Authentication-Buffer-Overflow-on-Multiple-Products-PSV-2021-0168

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

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

repo_name: trickest/cve


text:
# Chips

### Design

https://material.io/design/components/chips.html

### Description

`Chips` allow users to enter information, make selections, filter content, or trigger actions.

### Import

```js
import { Chips, Chip, ChipText, ChipIcon } from "@webiny/ui/Chips";
```


text:
---
layout: default
---

# 1996-05-04 - Re: PICS & CyberAngels

## Header Data

From: "Declan B. McCullagh"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: dc28a5722515c8fb84ba5a1b4ac01ddf31542b09a25524bddee9c695ba26b71f

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-05-04 22:00:19 UTC

Raw Date: Sun, 5 May 1996 06:00:19 +0800

## Raw message

```
{% raw  %}From: "Declan B. McCullagh"<EMAIL_ADDRESS>Date: Sun, 5 May 1996 06:00:19 +0800
To<EMAIL_ADDRESS>Subject: Re: PICS & CyberAngels
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Excerpts from internet.cypherpunks: 3-May-96 PICS & CyberAngels by "E.
ALLEN SMITH"@ocelot.
>         In view of the discussion of the possibility of PICS being required
> by law, plus that about the CyberAngels, I thought people might find it
> interesting that the CyberAngels home page has on it as one of their
> "responsibilities" making sure that all pages with sexual content - that
> pornography fetish again - have PICS or other (such as Safesurf...) ratings
> that would permit censorship of them.

Indeed. Under SafeSurf, I've rated the fight-censorship mailing list
archive site as suitable for all ages, which I believe it is, though the
CyberAngels think otherwise. I wonder what will happen now? SafeSurf is
supposedly sending me "an end-user license agreement" to sign...

-Declan

{% endraw %}
```

## Thread

+ Return to [May 1996](/archive/1996/05)

+ Return to "["Declan B. McCullagh" <declan+@CMU.EDU>](/authors/declan_b_mccullagh_declan_at_cmu_edu_)"
+ Return to "["E. ALLEN SMITH" <EALLENSMITH@ocelot.Rutgers.EDU>](/authors/e_allen_smith_eallensmith_at_ocelot_rutgers_edu_)"
+ Return to "["Vladimir Z. Nuri" <vznuri@netcom.com>](/authors/vladimir_z_nuri_vznuri_at_netcom_com_)"

+ 1996-05-04 (Sat, 4 May 1996 15:08:07 +0800) - [PICS & CyberAngels](/archive/1996/05/b68a6f8024834825af6833e89d45f4136362e3d1f40ed1a69774a80ec627d2c9) - _"E. ALLEN SMITH"<EMAIL_ADDRESS>  + 1996-05-04 (Sun, 5 May 1996 06:00:19 +0800) - Re: PICS & CyberAngels - _"Declan B. McCullagh"<EMAIL_ADDRESS>  + 1996-05-04 (Sun, 5 May 1996 06:05:45 +0800) - [Re: PICS & CyberAngels](/archive/1996/05/1970f8872b34b7cc36e740c74d9a224245b370b8ed92a69def0de6f610af8d38) - _"Vladimir Z. Nuri"<EMAIL_ADDRESS>


text:
# Resque Queue Driver Bundle

A driver for [Queue Manager Bundle](https://github.com/mcfedr/queue-manager-bundle) that uses resque

[![Latest Stable Version](https://poser.pugx.org/mcfedr/resque-queue-driver-bundle/v/stable.png)](https://packagist.org/packages/mcfedr/resque-queue-driver-bundle)
[![License](https://poser.pugx.org/mcfedr/resque-queue-driver-bundle/license.png)](https://packagist.org/packages/mcfedr/resque-queue-driver-bundle)
[![Build Status](https://travis-ci.org/mcfedr/resque-queue-driver-bundle.svg?branch=master)](https://travis-ci.org/mcfedr/resque-queue-driver-bundle)

## Usage

[PHP Resque](https://github.com/chrisboulton/php-resque) installs two commands into your bin folder.
Generally you should run just one instance of `resque-scheduler` and several of `resque`.

```bash
QUEUE=default APP_INCLUDE=var/bootstrap.php.cache REDIS_BACKEND=<IP_ADDRESS>:6379 ./vendor/bin/resque
PREFIX="my_app:" REDIS_BACKEND=<IP_ADDRESS>:6379 ./vendor/bin/resque-scheduler
```

Add `VVERBOSE=1` to the environment to get more logging.

## Install

### Composer

    composer require mcfedr/resque-queue-driver-bundle

### AppKernel

Include the bundle in your AppKernel

    public function registerBundles()
    {
        $bundles = [
            ...
            new Mcfedr\QueueManagerBundle\McfedrQueueManagerBundle(),
            new Mcfedr\ResqueQueueDriverBundle\McfedrResqueQueueDriverBundle(),

## Config

With this bundle installed you can setup your queue manager config similar to this:

    mcfedr_queue_manager:
        managers:
            default:
                driver: resque
                options:
                    host: <IP_ADDRESS>
                    port: 11300
                    default_queue: default
                    track_status: false

This will create a `QueueManager` service named `"mcfedr_queue_manager.default"`

* `host` and `port` - Where is your Redis server
* `default_queue` - Name of the default queue to use
* `track_status` - Set to `true` to enable extra job tracking data to be stored in redis. Useful for debugging

## Options to `QueueManager::put`

* `queue` - A `string` with the name of a queue
* `time` - A `\DateTime` object of when to schedule this job
* `delay` - Number of seconds from now to schedule this job
* `track_status` - Set to `true` to enable extra job tracking data to be stored in redis. Useful for debugging

repository: pl-github/resque-queue-driver-bundle

gha_language: PHP

repo_name: pl-github/resque-queue-driver-bundle


text:
# AMDJS

This module enables the use of AMD JavaScript modules with Magento.

## Why

If you're wondering why AMD, may I [refer you elsewhere][1]?

It's certainly possible to let require.js take care of module loading, but in a production environment, it fires off a lot of extra http requests, which nobody really wants.

The r.js optimiser does a great job of this, and this module is designed to replace it. The problem with the optimiser is that it doesn't allow very easy compilation with Magento projects. One is reduced to parsing the layouts by hand and hoping it's correct. This does it all automatically.

## Installation

Installation can be done using Modman.

### With Symlinks

1. Initialise modman  modman init
2. Install this module  modman clone https://github.com/develodesign/magento-amdjs.git

### Without Symlinks

3. Follow steps one and two above.
4. Copy the module to the correct Magento directories.  ```modman deploy magento-amdjs --copy ```

## How it works

You place your modules in a directory, and write as if you were using require.js with no optimisation.

Then, in the layout xml, simply include the modules you need:

```xml
<reference name="amdjs_modules">
    <action method="addModule"><module>my/module/name</action>
</reference>
```

Then, when the page loads, the modules will be collected, and compiled into one file along with the dependencies. This file will be loaded in the `before_body_end` block.

This system uses require.js as its loader of choice, but no asynchronous http requests will be made. This module compiles all modules and puts them into one file that loads at the end of the body. A little bit like a best practice.

## Config Options

Configuration is done in the backend. It can be found in the developer section of the configuration. The following options are presented:

+ ### Module source files location

  This allows you to customise where your modules are created.  It should be a path relative to the base directory of the Magento installation.

+ ### Module aliases

  It is possible to configure aliases similar to [those in require.js][2]. Really great if you're using a front end package manager like [Bower][3], or if your [jQuery is named with a version][4].

  This field takes a JSON object agreeing to the same specification as require.js. My aim was to make transitioning to this as easy as possible.

  The differences is that currently, it is assumed that this is a path relative to the base source files directory. Loading from a remote host or an absolute path relative to the web root is currently not permitted.

+ ### Enable minification

  Any questions? This is not a trick option.

+ ### Custom minifier

  By default, this module ships with a PHP JavaScript minifer called JShrink. But it turns out that the best minifiers are not written in PHP. I didn't want to enforce another runtime on a user, but if you've got node installed, I highly recommend upgrading the minifier.

  Specifically, the hotness at the moment is [UglifyJS2][5]. If you've got it installed, here's how you might do it:

  > uglifyjs2 {{file}} -mc

  The {{file}} variable is an ugly fix, but it allows you to use programmes that don't just take the input at the end of the command. Ideally, this would be passed to stdin, but PHP's `shell_exec` function doesn't think a lot of large inputs.

  I'll be working on fixing this in the next version, though.

+ ### Enable caching

  See "[Enable minification][6]"

+ ###  Disable caching and minification when in developer mode.

  This setting allows you to have minification turned on in a staging environment, but not in a local or shared development setup, while sharing a database. How about that?

## Contributions

I welcome them, of any kind. I write kinda sucky PHP code, and I'm quite new to Magento, which means there are a lot of things I might not be doing the correct way, or whatever. It's a complicated system, or something. So please help me out here :-)

[1]: http://requirejs.org/docs/whyamd.html
[2]: http://requirejs.org/docs/api.html#config-paths
[3]: http://bower.io
[4]: http://requirejs.org/docs/jquery.html#modulename
[5]: https://github.com/mishoo/UglifyJS2
[6]: #enable-minification

repository: develodesign/magento-amdjs

repo_name: develodesign/magento-amdjs


text:
# jest-serializer

A suite of tools to enable you to "curate" the "perfect" Jest snapshot. See
[this blog post](https://medium.com/@craigbilner/expect-anything-tomatchsnapshot-here-be-dragons-26516e02de8c)
for more details on why this package was developed. The primary focus is on JSX
in snapshots rather than other data structures.

It's designed to aid you with your tests that use Jest with no other
requirements \* other than importing the desired serializers for your needs.

### Supported

-<EMAIL_ADDRESS>-<EMAIL_ADDRESS>
## Getting started

```
yarn add @times-components/jest-serializer --dev
```

within your tests you can now use code that looks like this:

```javascript
import {
  addSerializers,
  enzymeRenderedSerializer
} from "@times-components/jest-serializer";

addSerializers(expect, enzymeRenderedSerializer());
```

and any snapshot tests that run in the context of this serializer will generate
snapshots based on these
[custom serializers](http://jestjs.io/docs/en/configuration.html#snapshotserializers-array-string).
The context being the "test file" currently under test.

## Serializers

**addSerializers(expect: JestExpect, ...serializers: Serializer[]): void**

Implicitly add your custom Jest serializer(s) by using `addSerializers`. This
takes Jest's global `expect` followed by any serializers you would like to use
e.g.

```javascript
addSerializers(expect, serializer1, serializer2);
```

These are the serializers that are currently provided:

### compose

**compose(printer: Printer, ...transformers: Transformer[]): Serializer**

A special type of serializer that takes a `printer` followed by the transformers
you would like to apply.

A transformer is any of the serializers below but with "Transform" appended.
This allows us to only visit each node once and perform each transformation
(from left to right) on it. Accordingly, order is important for transformers
that have side-effects that another transformer was relying on e.g.

```javascript
compose(
  stylePrinter,
  minimalWebTransform
);
```

is the same as running the `minimalWeb` and `rnw` serializers together, and if
`rnw` had a dependency on what `minimalWeb` was removing, you would need to swap
them round.

### Enzyme Serializers

When using enzyme in conjunction with
[enzyme-to-json](https://github.com/adriantoine/enzyme-to-json) you can use
[mount](https://github.com/airbnb/enzyme#full-dom-rendering) to give you access
to
[these modes](https://github.com/adriantoine/enzyme-to-json/blob/master/docs/modes.md).
They've been wrapped in the serializers below for convenience and clarity

#### enzymeRenderedSerializer

**enzymeRenderedSerializer(): Serializer**

Gives you your mounted Enzyme component tree as if it was rendered. i.e.
`<div>`s and `<span>`s. This useful if you don't care to manipulate the tree in
anyway.

#### enzymeRootSerializer

**enzymeRootSerializer(): Serializer**

While you may have mounted the component you can still ask to just serialize the
root component only. May be useful if you have a mixture of snapshot
requirements involving both parent and children. However you may use Enzyme's
own API to pick the correct thing to snapshot to begin with.

#### enzymeTreeSerializer

**enzymeTreeSerializer(): Serializer**

The majority of the time you may be using the rendered version but this one
allows you to see the "host" components and therefore allow you to refine the
snapshot in various ways based on them. Can be used in conjunction with the
`replace` serializer to keep the snapshots focused.

e.g.

```jsx harmony
<ParentComponent>
  <div>
    <ChildComponent>
      <span>Hello world!</span>
    </ChildComponent>
  </div>
</ParentComponent>
```

### flattenStyle

**flattenStyle: Serializer**

If you're using Enzyme you may find that styles (depending on how they've been
written) may appear as a number (a pointer to a RN stylesheet style) or an Array
(a composition of styles). This squashes it all for you, and allows you to see
the styles as intended.

On web you may want to also use `hoistStyle` to clean up the snapshot noise
further.

### hoistStyle

**hoistStyle: Serializer**

It makes sense to show a snapshot with inline styles on web,
it's perhaps a little more idiomatic to see it as a `className` and the style to
reside in a `style` block. This is a better reflection of how it'll be rendered
on the platform (RNW magic) and keeps the snapshots a little leaner too.

For the styles to be shown, use with `compose` and the `stylePrinter`.

### minimalise

**minimalise((value: Object, key: string): boolean): Serializer**

Takes a function that allows you to omit certain properties that you're not
interested in seeing. Often snapshots will spew out many `props` that are
irrelevant to your tests (especially on RN), this serializer is a key tool in
keeping them focused e.g.

```javascript
addSerializers(expect, minimalise((value, key) => key === "style"));
```

will strip all styles from your JSX nodes.

### minimalWeb

**minimalWeb: Serializer**

A convenience serializer to remove the plethora of `prop`s React prints by
default that may change React versions but have
no baring on your tests. In particular it removes `[Function]` values because
they should be tested with either interactive tests and/or a type system rather
than with snapshots.

Refer to the code for the latest removed values.

### replace

**type Replacer = (node: ReactNode, props: ReactProps, children: ReactChildren):
{ node?: ReactNode, props?: ReactProps, children?: ReactChildren };**

**replace({ [ComponentName: string]: Replacer }): Serializer**

A serializer that may be best suited to `jest.mock` but in some cases you may
find it desirable to simply switch out bits of your tree for brevity and focus
independent of what `jest.mock` provides or because you don't want to globally
mock the dependency. `jest-mock` also doesn't play well with web or named member
imports.

### replaceProp

**replaceProp((value: Object, key: string): Object): Serializer**

Similar to the `minimalise` serializer, rather than omitting values you can
replace them. This is handy for occasions when a prop value has a very long
completely unreadable value that you would like to "monitor" and see on a PR
that a change has been made but at the same time not destroy the snapshots
readability.

### rnw

**rnw(AppRegistry, string[]): Serializer**

If you're using Jest snapshots on the web platform to ensure your components are rendering
the expected web output, there'll be a lot of `className` noise.

Use this serializer with any style properties you're interested in, and when
`compose`d with the `stylePrinter` you can see these printed in a `style` block
e.g.

```javascript
compose(stylePrinter);
```

will assign a generic `className` to the Node and print the styles with that
`className`, but only for `color` and `fontSize` due to RNW producing many stock
styles.

`AppRegistry` needs to come from the consumer where the styles have been cached.

## Printers

Currently there are two types of "printers". A printer has the type:

**(serialize: ((obj: Object): string), accum: {[key: string]: string}, element:
ReactNode): string**

The custom serializers can build up something they'd like to "accumulate" over
the whole snapshot such as styles, and the printer decides how to print them.

### print

Simply takes the given `Node` and uses Jest's standard `serialize` method;

### stylePrinter

A custom printer that works with `hoistStyle` and `rnw` which takes their
accumulated "bag" of styles and prints them in a `style` block

## Patterns and Practices

Using React Test Renderer tends to be your best bet. This
doesn't give you "host" objects for the `replace` serializer leaving you with
`jest.mock`. It's currently advisable to mock all your dependencies even if you
have the best intentions with "integration" testing. They usually lead to a
multitude of snapshot updates you don't care about which dulls your interest in
reviewing them at the PR level with little benefit.

For web using Enzyme with `mount` and a mixture of the
`enzymeRenderedSerializer` and `enzymeTreeSerializer` should give you everything
you need to start with. As with the curation of any snapshot, it's best to start
with the raw output, then prune it iteratively to make sure you both don't miss
something and/or can make informed decision on where you want to split your
snapshots.

It's particularly recommended to split out styling from rendering in tests due
to the same "too many updates" problem. It's much more likely that the snapshots
will be valued if they only update when they're supposed to and changing
`padding` shouldn't change the snapshot test for "renders capital letters". It
also highlights on a PR when a styling change is made and the style snapshot _is
not_ updated to the reviewer. This would indicate it's not being correctly
captured which can get lost with large "big picture" renders.

Another pattern you want to look out for is repeated props throughout a snapshot
which probably means they should be removed and one test should represent them.
It's discretionary but probably means the snapshots aren't focused on the tests
enough.

On web you're similarly going to be looking at `minimalWeb`, `hoistStyle`,
`minimalise`, and `rnw`.

BE AWARE! Under the hood of `addSerializer` it's using
`expect.addSnapshotSerializer`. There's no `expect.removeSnapshotSerializer` and
they don't compose particularly well due to the various side-effects after
they've been applied. While it is possible to get a coincidental balance of
serializers at the test level (order very much dependent), try and run your
desired serializers per test file for sanity.

repository: newsuk/times-components

gha_language: JavaScript

repo_name: newsuk/times-components


text:
---
layout: post
title: "use the git update-ref command. To remove the last commit in the bare repo"
subtitle:   "remove the last commit in the bare repo"
date:       2017-07-06 020:00 +0800
author:     "Dongyupu"
header-img: "img/post-bg-03.jpg"
---

[You can use the git update-ref command. To remove the last commit, you would use:](https://stackoverflow.com/questions/4624881/how-can-i-uncommit-the-last-commit-in-a-git-bare-repository)

~~~bash
$ git update-ref HEAD HEAD^
~~~

Or if you're not in the branch from which you cant to remove the last commit:

~~~bash
$ git update-ref refs/heads/branch-name branch-name^
~~~

You could also pass a sha1 if you want:

~~~bash
$ git update-ref refs/heads/branch-name a12d48e2
~~~

See the documentation of the [git-update-ref](http://schacon.github.com/git/git-update-ref.html) command.


text:
### Alt Utils

This package contains the following utils which interface well with the [Alt](http://alt.js.org) library (a true flux compliant library in a very small size):

* [ActionListeners](https://github.com/altjs/utils/blob/master/src/ActionListeners.js) lets you listen to individual actions without having to create a store.
* [AltIso](https://github.com/altjs/utils/blob/master/src/AltIso.js) addon that uses [iso](https://github.com/goatslacker/iso) to render your application on both server and client.
* [atomic](https://github.com/altjs/utils/blob/master/src/atomic.js) enables your stores for atomic transactions.
* [decorators](https://github.com/altjs/utils/blob/master/src/decorators.js) lets you use a collection of useful ES7 decorators when working with alt.
* [AltManager](https://github.com/altjs/utils/blob/master/src/AltManager.js) allows you to create multiple alt instances in your app.
* [AltTestingUtils](https://github.com/altjs/utils/blob/master/src/AltTestingUtils.js)
* [Debugger](https://github.com/altjs/utils/blob/master/src/Debugger.js)
* [DispatcherDebugger](https://github.com/altjs/utils/blob/master/src/DispatcherDebugger.js)
* [DispatchRecorder](https://github.com/altjs/utils/blob/master/src/DispatcherRecorder.js) lets you record all your dispatches and replay them back at a later time.
* [Inspector](https://github.com/altjs/utils/blob/master/src/Inspector.js)
* [ImmutableUtil](https://github.com/altjs/utils/blob/master/src/ImmutableUtil.js) makes working with immutable-js easy.
* [Render](https://github.com/altjs/utils/blob/master/src/Render.js)
* [StoreExplorer](https://github.com/altjs/utils/blob/master/src/StoreExplorer.js)
* [TimeTravel](https://github.com/altjs/utils/blob/master/src/TimeTravel.js) enhances your stores so they are able to travel through different states in time.
* [chromeDebug](https://github.com/altjs/utils/blob/master/src/chromeDebug.js)
* [connect](https://github.com/altjs/utils/blob/master/src/connect.js)
* [connectToStores](https://github.com/altjs/utils/blob/master/src/connectToStores.js)
* [fp](https://github.com/altjs/utils/blob/master/src/fp.js)
* [functions](https://github.com/altjs/utils/blob/master/src/functions.js)
* [makeFinalStore](https://github.com/altjs/utils/blob/master/src/makeFinalStore.js) is a Store that only emits when all your other stores have received all their data.
* [makeFinalStore](https://github.com/altjs/utils/blob/master/src/makeFinalStore.js)
* [makeHot](https://github.com/altjs/utils/blob/master/src/makeHot.js)
* [reducers](https://github.com/altjs/utils/blob/master/src/reducers.js)
* [statics](https://github.com/altjs/utils/blob/master/src/statics.js)
* [withAltContext](https://github.com/altjs/utils/blob/master/src/withAltContext.js)

Note: If you are looking for the following utils, these are available in separate npm packages and github repos:
* [AltContainer](https://github.com/altjs/container) a higher-order container component that is your swiss army knife for React.
* [connectToStores](https://github.com/altjs/connect-to-stores) a higher-order function that wraps your React components for store listening.

### Installation

```sh
npm install alt-utils
```

### ES6 import examples

This is how specific utils can be imported to your project files:

```
import chromeDebug from 'alt-utils/lib/chromeDebug';
import {decorate, datasource, bind} from 'alt-utils/lib/decorators';
```

## License

[![MIT](https://img.shields.io/npm/l/alt.svg?style=flat)](http://josh.mit-license.org)

repository: altjs/utils

repo_name: altjs/utils


text:
# Fluent Geonames
[![Build Status](https://travis-ci.org/MenaraSolutions/fluent-geonames.svg)](https://travis-ci.org/MenaraSolutions/fluent-geonames)
[![Code Climate](https://codeclimate.com/github/MenaraSolutions/fluent-geonames/badges/gpa.svg)](https://codeclimate.com/github/MenaraSolutions/fluent-geonames/badges)
[![Test Coverage](https://codeclimate.com/github/MenaraSolutions/fluent-geonames/badges/coverage.svg)](https://codeclimate.com/github/MenaraSolutions/fluent-geonames/badges)
[![Total Downloads](https://poser.pugx.org/MenaraSolutions/fluent-geonames/d/total.svg)](https://packagist.org/packages/MenaraSolutions/fluent-geonames)
[![Latest Stable Version](https://poser.pugx.org/MenaraSolutions/fluent-geonames/v/stable.svg)](https://packagist.org/packages/MenaraSolutions/fluent-geonames)
[![Latest Unstable Version](https://poser.pugx.org/MenaraSolutions/fluent-geonames/v/unstable.svg)](https://packagist.org/packages/MenaraSolutions/fluent-geonames)
[![License](https://poser.pugx.org/MenaraSolutions/fluent-geonames/license.svg)](https://packagist.org/packages/MenaraSolutions/fluent-geonames)

A PHP library that knows how any country, state or city is called in another language.

Includes integrations with: Laravel 5

## Dependencies

* PHP >= 5.6

## Installation via Composer

To install simply run:

```
composer require menarasolutions/fluent-geonames
```

Or add it to `composer.json` manually:

```json
{
    "require": {
        "menarasolutions/fluent-geonames": "~0.1"
    }
}
```

## Usage

```php
use MenaraSolutions\FluentGeonames\Planet;
use MenaraSolutions\FluentGeonames\Country;

$planet = new Planet();

// Give me a list of all countries please
$planet->getCountries()->toArray();

// Oh, but please try to use short versions, eg. USA instead of United States of America
$planet->getCountries()->useShortNames()->toArray();

// Now please give me all states of Thailand
$countries = $planet->getCountries();
$thailand = $countries->find(['code' => 'TH']);
$thailand->getStates()->toArray();

// Oh, but I want them in Russian
$thailand->getStates()->setLanguage('ru')->toArray();

// Oh, but I want them inflicted to 'in' form (eg. 'in Spain')
$thailand->getStates()->setLanguage('ru')->inflict('in')->toArray();

// What's the capital and do you have a geonames ID for that? Or maybe latitude and longitude?
$capital = $thailand->getCapital();
$capital->getGeonamesId();
$capital->getLatitude();
$capital->getLongitude();
```

## Todo

## License

The MIT License (MIT)
Copyright (c) 2016 Denis Mysenko

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: nucreativa/fluent-geonames

repo_name: nucreativa/fluent-geonames


text:
# audio-player

It is possible to just play the audio from files such as .mkv and .webm.

index.html:

```html
<audio controls="controls">
  <source src="file:///C:/Users/Greenmochi/AppData/Roaming/ultimate-youtubedl/Anne-Marie%20-%202002%E2%94%83Cover%20by%20Raon%20Lee.mkv" type="audio/wav">
  Your browser does not support the <code>audio</code> element.
</audio>
```

repository: greenmochi/ultimate

gha_language: TypeScript

repo_name: greenmochi/ultimate


text:
### IAM Commands

Note:
`gloud iam...` -or- `gloud iam alpha` -or- `gloud iam beta`

To list all iam roles
`gcloud iam roles list`
To list custom iam roles for a project
`gcloud iam roles list --project [projectName]`

To assign a pre-built role to an iam user
1. create a new bucket
2. copy files from old bucket into new bucket
`gsutil cp -r gs://[old_bucketname]/* gs://[new_bucket]`
3. delete old bucket
`gsutil rm -r gs://[bucket_name]`

To verify your gcloud init settings, i.e. 'gcloud init...'
`gcloud init...`

To create a service account
`gcloud iam service-accounts create [SA-NAME] --display-name "[SA-DISPLAY-NAME]"`
To list services accounts
`gcloud iam service-accounts list`
To rename a service account
`gcloud iam service-accounts update<EMAIL_ADDRESS>--display-name [UPDATED-DISPLAY-NAME]"`

------

From - https://cloud.google.com/iam/docs/granting-changing-revoking-access#iam-get-policy-gcloud

To get the policy for the project my-project in JSON format and save it to the user's home directory.
`gcloud projects get-iam-policy my-project --format json > ~/policy.json`

To grant the Owner role to<EMAIL_ADDRESS>for the project my-project

`gcloud projects add-iam-policy-binding my-project --member<EMAIL_ADDRESS>--role roles/owner`

repository: lynnlangit/gcp-essentials

gha_language: Python

repo_name: lynnlangit/gcp-essentials


text:
---
home: true
heroImage: /logo.svg
metaTitle: Lantern
actionText: Get started →
actionLink: /documentation/
tagline: A deeply integrated extension to your Laravel app
footer: MIT Licensed | Copyright © 2022-present Bright Machine Ltd
---

### Why Lantern?

Laravel is a _great_ framework that [has no opinion about how your application should be structured](https://laravel.com/docs/master/structure#introduction):

> The default Laravel application structure is intended to provide a great starting point for both large and small applications. But you are free to organize your application however you like.

This is a huge part of the attraction of Laravel; it allows a developer to express themselves. **Lantern is one such expression.**

We believe that, by following declarative coding conventions, you can improve the quality of your application
and have the domain model you have built become much more evident within your code.

## 📢 Declarative

Declare the domain model of your application through Actions, grouped into Features.
The functionality of your app becomes apparent just by looking at your file structure.

## 🏘 Co-location

Each Action sits in its own class, attracting information and behaviour relevant to that Action.
For example, the code for the Availability of an Action sits alongside the Action itself, making it easier to reason about your application.

## 🏰 Laravel-powered

Lantern takes advantage of its deep integration with Laravel & its ecosystem to ensure your app always feels like a Laravel app.

Start small with a single action:

[Get started →](/documentation/) 👣

repository: lanternphp/docs

gha_language: Shell

repo_name: lanternphp/docs


text:
Chatty App
=====================

A Slack-like application that allows users to chat to one another.

## Getting Started
Install the dependencies for client-side and server-side. Start both servers.

```
npm install
npm start

open a new terminal
cd into chatty_server
npm install
node server.js

open http://localhost:3000
```

## Features
* Multiple users can connect and chat
* Users are assigned a random color for their username (up to 4)
* Users can display image URLs

## Dependencies

* React
* React-DOM
* Webpack
* [babel-loader](https://github.com/babel/babel-loader)
* [webpack-dev-server](https://github.com/webpack/webpack-dev-server)

## Final Product
1. Main Page
!["Screenshot of application" ](https://github.com/phamjoe/chatty-app/blob/master/screenshots/ss.png)

repository: phamjoe/chatty-app

repo_name: phamjoe/chatty-app


text:
### Describe the PR

A clear and concise description of what the pull request does.

### PR checklist

<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [ ] Bugfix (fixes a boo-boo in the code) - `fix(...)`, requires a patch version update
- [ ] Feature (adds a new feature to `v-aspect-ratio`) - `feat(...)`, requires a minor version update
- [ ] Enhancement (augments an existing feature) - `feat(...)`, requires a minor version update
- [ ] Documentation update (improves documentation or typo fixes) - `chore(docs)`, requires a patch version update
- [ ] Other (please describe)

**Does this PR introduce a breaking change?** (check one)

- [ ] No
- [ ] Yes (please describe since breaking changes require a major version update)

**The PR fulfills these requirements:**

- [ ] It's submitted to the `dev` branch, **not** the `master` branch
- [ ] When resolving a specific issue, it's referenced in the PR's title (i.e. `[...] (fixes #xxx[,#xxx])`, where "xxx" is the issue number)
- [ ] It should address only one issue or feature. If adding multiple features or fixing a bug and adding a new feature, break them into separate PRs if at all possible.
- [ ] The title should follow the [**Conventional Commits**](https://www.conventionalcommits.org/) naming convention (i.e. `fix: message`, `docs: message`, `chore: message`, etc.). **This is very important, as the `CHANGELOG` is generated from these messages, and determines the next version type (patch or minor).**

**If new features/enhancement/fixes are added or changed:**

- [ ] Includes documentation updates
- [ ] New/updated tests are included and passing (required for new features and enhancements)
- [ ] Existing test suites are passing

**If adding a new feature, or changing the functionality of an existing feature, the PR's
description above includes:**

- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

repository: andrewvasilchuk/v-aspect-ratio

branch_name: refs/heads/dev

repo_name: andrewvasilchuk/v-aspect-ratio


text:
---
title: Introductory Concepts
---

The guides area is designed to help developers learn to better interact with the date and time problem domain, and the Moment.js library.
We address our most frequently seen support requests here, so it is a great place to check for solutions to any issues you may have.

The guides section is new and still under construction. If you have a request for a guide that you would like to see here, or would like to add a guide
please create an issue or make a pull request in the momentjs.com repository.

Check out this [scrimba moment guide](https://scrimba.com/casts/cwpDGhG) if you're just starting.


text:
# s3-dam
Digital Asset Manager

[![Build Status](https://travis-ci.com/S3Infosoft/s3-dam.svg?branch=master)](https://travis-ci.com/S3Infosoft/s3-dam)
![autoblack_push](https://github.com/S3Infosoft/s3-dam/workflows/autoblack_push/badge.svg)

#### Initial Steps
- Go to the project directory
  ```
  cd s3-dam
  ```
- Build the Docker image
  ```
  docker build .
  ```
- Build the Docker image using docker-compose
  ```
  docker-compose build
  ```
- Migrate the models to database
  ```
  docker-compose run --rm app sh -c 'python manage.py makemigrations'
  docker-compose run --rm app sh -c 'python manage.py migrate'
  ```

#### To run the server
-   ```
    docker-compose up
    ```
#### To create a superuser
- ```
  docker-compose run --rm app sh -c 'python manage.py createsuperuser'
  ```
- Login to admin page
  <http://localhost:8000/admin/>

#### To run the tests
- ```
  docker-compose run --rm app sh -c 'python manage.py test'
  ```


text:
---
title: Mechatronics Final (EE/ME 7)
category: Coursework
category_slug: class
type: content
image: assets/img/works/EE-ME_7.jpg
button_url: projects/ee-7
---
## Project Overview
EE/ME 7 is a freshmen lab class focused on mechatronics. Over the quarter we worked on 13 labs that explored various parts of a mechatronic system in depth, including motors, sensors, gears, and many other parts. The final project was to design and build a small car with a partner that moved in the direction of an ultrasonic pulse using only op-amps and transistors. Our car was designed to allow switching between bang-bang and PI control, although only the bang-bang version was ultimately tested.

repository: lopenguin/old-website

repo_name: lopenguin/old-website


text:
# Made with LÖVE

https://love2d.org/

## Sprites

https://kenney.nl/assets/pixel-platformer

## Audio

https://kenney.nl/assets/rpg-audio
https://kenney.nl/assets/music-jingles

## Libraries

[classic](https://github.com/rxi/classic) (MIT)

repository: Mystiick/love-infinite-runner

repo_name: Mystiick/love-infinite-runner


text:
# Script `add_recovery_rotation_capability.move`

### Table of Contents

-  [Function `add_recovery_rotation_capability`](#SCRIPT_add_recovery_rotation_capability)
    -  [Summary](#SCRIPT_@Summary)
    -  [Technical Description](#SCRIPT_@Technical_Description)
    -  [Parameters](#SCRIPT_@Parameters)
    -  [Common Abort Conditions](#SCRIPT_@Common_Abort_Conditions)
    -  [Related Scripts](#SCRIPT_@Related_Scripts)

## Function `add_recovery_rotation_capability`

### Summary

Stores the sending accounts ability to rotate its authentication key with a designated recovery
account. Both the sending and recovery accounts need to belong to the same VASP and
both be VASP accounts. After this transaction both the sending account and the
specified recovery account can rotate the sender account's authentication key.

### Technical Description

Adds the LibraAccount::KeyRotationCapability for the sending account
(to_recover_account) to the RecoveryAddress::RecoveryAddress resource under
recovery_address. After this transaction has been executed successfully the account at
recovery_address and the to_recover_account may rotate the authentication key of
to_recover_account (the sender of this transaction).

The sending account of this transaction (to_recover_account) must not have previously given away its unique key
rotation capability, and must be a VASP account. The account at recovery_address
must also be a VASP account belonging to the same VASP as the to_recover_account.
Additionally the account at recovery_address must have already initialized itself as
a recovery account address using the Script::create_recovery_address transaction script.

The sending account's (to_recover_account) key rotation capability is
removed in this transaction and stored in the RecoveryAddress::RecoveryAddress
resource stored under the account at recovery_address.

### Parameters

| Name                 | Type      | Description                                                                                |
| ------               | ------    | -------------                                                                                |
| to_recover_account | &signer | The signer reference of the sending account of this transaction.                                           |
| recovery_address   | address | The account address where the to_recover_account's LibraAccount::KeyRotationCapability will be stored. |

### Common Abort Conditions

| Error Category             | Error Reason                                               | Description                                                                                |
| ----------------           | --------------                                             | -------------                                                                                |
| Errors::INVALID_STATE    | LibraAccount::EKEY_ROTATION_CAPABILITY_ALREADY_EXTRACTED | to_recover_account has already delegated/extracted its LibraAccount::KeyRotationCapability. |
| Errors::NOT_PUBLISHED    | RecoveryAddress::ERECOVERY_ADDRESS                       | recovery_address does not have a RecoveryAddress resource published under it.               |
| Errors::INVALID_ARGUMENT | RecoveryAddress::EINVALID_KEY_ROTATION_DELEGATION        | to_recover_account and recovery_address do not belong to the same VASP.                     |

### Related Scripts

* Script::create_recovery_address
* Script::rotate_authentication_key_with_recovery_address

public fun add_recovery_rotation_capability(to_recover_account: &signer, recovery_address: address)

Implementation

fun add_recovery_rotation_capability(to_recover_account: &signer, recovery_address: address) {
    RecoveryAddress::add_rotation_capability(
        LibraAccount::extract_key_rotation_capability(to_recover_account), recovery_address
    )
}

repository: gupta-suyash/libra

repo_name: gupta-suyash/libra


text:
# Kubernetes - Administrate

## How to remove all the node of a cluster

1. Check if you ip was on "Master authorized networks" on k8s cluster.

    - Click edit on cluster.
    - Check the "Master authorized networks".

2. First point to right k8s cluster:

    ```bash
    gcloud container clusters get-credentials <cluster name> --zone <gcp region> --project <gcp project>
    ```

3. Get the list of nodes.

    ```bash
    kubectl get nodes
    ```

4. Drain/disable each node of cluster.

    ```bash
    kubectl drain <node name>
    kubectl drain <node name> --ignore-daemonsets
    ```

5. Delete physically each node.

    ```bash
    kubectl delete node <node name>
    ```

## How to see node stats

```bash
kubectl top nodes
```

## Get info of all contexts

```bash
kubectl config get-contexts
```

## How to change the context

```bash
kubectl config use-context <context ID>
```

## How to see current context

```bash
kubectl config current-context
```

***

- [Home](/README.md)
- [Docker](/docker/README.md)
- [Git](/git/README.md)
- [Kubernetes](/k8s/README.md)

repository: rresino/snippets

repo_name: rresino/snippets


text:
#### Romanian counties and locations (with diacritics, improved) / Toate județele și localitățiile din România
All counties and locations

#### sursa
https://github.com/bandizsolt/romanian-counties-and-locations

#### Updated: 04-01-2018
Total: 42 county and 13755 location (format sql)

Source:
http://colectaredate.insse.ro/senin/

repository: CoruptiaUcide/datawarehousero

repo_name: CoruptiaUcide/datawarehousero


text:
# fight-cli-representation

## Description
This program simulates in cli a battle between two boxers.
For this implementation fight-log-generator provides the a JSON Object of a fight flow.

The outcome is being represented as two HP bars, with events representing the flow of a battle. Every event is being emmitted every second.

## Usage
Firstly install the npm packages
```npm i```

Run the app and enjoy the show
```npm start```

repository: stacon/fight-cli-representation

repo_name: stacon/fight-cli-representation


text:
# Porpoise

## Welcome

Porpoise implements an additional cache backend for Ruby on Rails applications. It's compatible with Rails' ActiveSupport::Cache interface and is easily configured. It also provides a Redis like interface using your chosen RDBMS as its storage engine. This provides an easy replacement for Rails applications that currently use Redis to store key/value data and would like to switch an RDBMS for whatever reason.

### Performance

Redis outperforms this implementation and I don't think I have to tell why. For an SQL based solution it still performs alright though. By using a short living in-memory cache it actually comes close to a Redis based solution, at least in our setup. Besides, this thing integrates with Rails, uses ActiveRecord and all the bloat that comes with it. And although a cache should help performance, cache read/write speed sometimes are not the problem. To prevent firing the same query when reading the same cache fragment over and over again, this thing comes with a short life in-memory cache to quickly return those items. In our situation, reading data was even faster than the Redis based solution.

### Then why?

To simplify your stack? To get a real multi-master setup using MySQL/Galera? To get rid of an unstable situation? To have a centralized cache when you have no Memcache or Redis at your disposal?

This gem was written out of the need to get rid of a shaky Redis Dynomite cluster which we implemented due to the requirement of having real multi-master clusters. Master-slave- and failover setups tend to break over time, so multi-master is the only acceptable way to go.

So Redis /w Dynomite kept exploding at every little burp so we needed a solution. MySQL / Galera was already there as our primary datastore so the alternative was easily chosen. Reasons: proven multi-master setup and a less complex stack. This was a win/win solution. With our userbase and use of Redis, performance was of minor importance.

## Compatibility

This gem has been tested with Rails 3, and includes tests for Rails 4 and Rails 5.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'porpoise'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install porpoise

After installation of the gem, install the required migration:

    $ rails generate porpoise:install

Porpoise runs in a different database for easy optimization and decoupling. Add an entry in your config/database.yml for porpoise.

    porpoise_development:
        adapter: <adapter of choice>
        username: <porpoise_db_user>
        ...

Run migrations to install the required table:

    rake db:migrate

## Usage

### Caching in Rails

Using Porpoise as caching backend in Rails is easy. Change your cache store config like this:

    config.cache_store = :porpoise_store

That's all! Optionally you can set a caching namespace like this:

    config.cache_store = :porpoise_store, { namespace: :your_namespace }

Namespacing automatically preprends each cache key with the chosen namespace.

### As generic key/value storage

Porpoise was designed as an easy replacement for Redis. Therefore it implements various of the commonly used types Redis knows (strings, sets and hashes) and most of their functions. Access them like this:

    Porpoise::String.<redis-function-name-and-arguments>
    Porpoise::Set.<redis-function-name-and-arguments>
    Porpoise::Hash.<redis-function-name-and-arguments>

Namespacing is easy as well. Surround your Porpoise calls in a block like this example:

    Porpoise.with_namespace(:your_namespace) do
        Porpoise::String.set('test-key', 'test-value')
        Porpoise::Hash.hset('test-key', 'foo', 'bar')
    end

## Development

Fork this repo. Development is done from within a Docker container for which the Dockerfile is included in this repo. Build and start the the container to access this gems development environment:

    docker build -t porpoise-app .
    docker run -it --rm -v "$PWD:/porpoise" porpoise-app

Run all other actions from within the container. Tests:

    appraisal install
    appraisal rails-3 rspec spec
    appraisal rails-4 rspec spec
    appraisal rails-5 rspec spec

Console:

    appraisal rails-3 ./bin/console
    appraisal rails-4 ./bin/console
    appraisal rails-5 ./bin/console

PR's are welcome :) This is my first gem thingie ever, so help me out.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sentialabs/porpoise.

repository: sentialabs/porpoise

gha_language: Ruby

repo_name: sentialabs/porpoise


text:
Tips And Tricks
===============

1. [Working With Symlinks](#working-with-symlinks)
2. [Remote Access](#remote-access)
3. [Deploying With Git](#deploying-with-git)

Working With Symlinks
---------------------

If you have multiple projects that use Goji, and you want to keep them up to date without too
much hassle, you can use symlinks.

Take this:

```
- ~/Sites
    - goji
    - some-project
    - some-other-project
```

In this scenario, if you want to update Goji you have to manually copy the new files from
`~/Sites/goji/` to your other projects (basically overwrite all `lib/Goji` folders).

Instead you can use symlinks. For example, navigate to `~/Sites/some-project` and replace `/lib` by
a symlink (use `ln -s <source file> <target file>`):

```sh
cd ~/Sites/some-project
rm -rf lib/Goji
ln -s ~/Sites/goji/lib/Goji lib/Goji
```

Using aliases may not work (like with `File` → `Make Alias` on macOS). Symlinks and aliases are
different in that an alias merely points to a file (and knows how to find it wherever you move it).
Symlinks on the other don't point to files (they contain a path to a file) but they can act like if
they were the file they link to.

Just be careful about using absolute paths when creating them. If you use `~/Sites/goji/lib/Goji`
they will work even if you move them (at least on macOS), but the if use `../goji/lib/Goji` they won't
work if you move them, since the relative path will be broken.

So aliases may not work because Apache or PHP or whatever will try to read them but it can't since
it isn't the original file, it is merely a small file that points to it. But if you use a symlink
Apache can read the file because it will "pass through it," as if it read the original file directly.

Just head to `project.gitignore`, under `# Ignore Goji files` to quickly get an up-to-date list of
files that could prove handy to be replace by a symlink. For now we have:

- `/bin/`
- `/docs/`
- `/lib/Goji/`
- `/public/css/lib/Goji/`
- `/public/img/lib/Goji/`
- `/public/js/lib/Goji/`

Maybe the `bin/newproject.sh` script could help you (be careful with it though).

Remote Access
-------------

This is not specific to Goji, but it's a neat trick to test the app on another device
like a phone or a tablet, without any set up.

On your local machine, you are probably connecting to the server through an address
like `http://localhost:8888` or just `http://localhost`.

Sometimes you also see `<IP_ADDRESS>` instead of `localhost`, like `http://<IP_ADDRESS>`,
which is the same because `localhost` is an alias of `<IP_ADDRESS>`. Also, the port number
isn't always `8888`, and when none is specified it means it uses the default HTTP
port (`80`), in which case you don't need to include it in the address.

In any case, `localhost` or `<IP_ADDRESS>` just means *this computer*. If you want to
connect to another computer on the same network, you must replace the `localhost`
with the local network address (LAN address) of that computer.

So to connect to the server running on your development machine from, let's say a
smartphone, you just have to connect to `http://<the machine address>:<port>`

There are different methods you can use to get this address. Just search for *lan ip mac*
or *lan ip windows* on Google. You'll probably also find it in your router settings.
This address looks something like `<IP_ADDRESS>`, `<IP_ADDRESS>` or `<IP_ADDRESS>`.

Once you have this address, let's say it's `<IP_ADDRESS>`, just replace the `localhost`
or `<IP_ADDRESS>` with it, like: `http://<IP_ADDRESS>:8888`, or `http://<IP_ADDRESS>`
(without the port). Note that this address may change. Usually it doesn't if you often
connect to the same network with your machine (like at home), but it also might forget
you and give you a new one.

This should work from any device connected to the same network (i.e. the same router) as
your development machine that runs the server. Just enter this address in the web browser,
and remember to use `http://` and not `https://`, unless you know what you are doing.

If it doesn't work, make sure your firewall doesn't block the port.

### Through the Internet

This method works straight out the box on your local network (LAN). You can also do it
through the Internet (WLAN), but it requires some additional configuration.

From the Internet, all machines connecting to the same router have the same IP address:
it's called NAT. So if you connect to your WLAN IP address, you'll actually connect to
your router, which won't know which computer to forward the request to.

To connect through the Internet, you must configure your router to forward requests on
a specific port to your computer. If your local server runs on port `8888`, and has LAN
address `<IP_ADDRESS>`, you must configure your router to redirect incoming requests
on port `8888` to the machine `<IP_ADDRESS>`.

How to do this depends on your specific router. Just search on Google for *nat port
forwarding your-router-brand*. You'll then be able to connect to your machine the same
way as before, using your WLAN IP address (which may change daily). To get your WLAN IP,
search for *what is my ip* on Google. It will look something like `http://<IP_ADDRESS>:8888`.

Deploying With Git
------------------

Git is great for versioning, and it's very good at deploying too. You can just `git clone` a
public repository on your server and keep it up-to-date with a simple `git pull`.

Even cheap host providers sometimes have Git installed, and you can access it with tools like
[_terminal](https://github.com/qrichert/_terminal) (a PHP-based CLI emulator) if you can't use SSH.
Goji itself provides you with a 'git pull' updater in the admin interface. Just click on the 'Update'
button with the Git logo to do so. If you hover over the button after the update, you'll be able to
see the changelist.

If you can't use SSH and for private repositories, you can use a deploy token/key instead of your
username and password. GitHub gives you an account-level token. If want a per-project-level token,
you might want to check out GitLab instead.

repository: qrichert/goji

repo_name: qrichert/goji


text:
# deprecated-components

Simple ways to deprecate a React component. Currently this lib shows a warning on console

## Getting started

### with high order components (HOC)

```typescript
import deprecatedComponents from 'deprecated-components'

const MySampleComponent = () => null

export default deprecatedComponents('some reason to deprecate', MySampleComponent)
```

repository: gimoteco/deprecated-components

repo_name: gimoteco/deprecated-components


text:
# pandoc-wkhtmltopdf
## overview
pandoc Dockerfile for wkhtmltopdf.
these use [pandoc docker image](https://hub.docker.com/u/pandoc).

## topics
### font install
this image is not installed Japanese fonts.
but you can install font by mounting to `/root/.fonts`

for example:
```
docker run --rm --volume "${host-font-dir}:/root/.fonts" pandoc-wkhtmltopdf README.md README.pdf
```

gha_language: Dockerfile


text:
# TypeScript Project

Boilerplate for a project built in [TypeScript](https://www.typescriptlang.org/) and running in [Node.js.](https://nodejs.org/)

## Getting Started

1. Degit the repo

```shell
npx degit MCluck90/ts-node-project#main
```

2. Search for and replace the following:
   1. `ts-node-project`
   2. `<YEAR>`
   3. `<COPYRIGHT HOLDER>`
   4. `<DESCRIPTION>`
   5. `<AUTHOR>`

3. The integrated terminal is set to "cmd" to [get around an issue with using Git Bash](https://github.com/microsoft/vscode/issues/35593). If you don't use Git Bash, remove this setting.

## Usage

### Run the application

```shell
$ npm start
```

### Development

This application is setup for debugging within VS Code. If you are not using VS Code or would prefer to just use the command line
you can use the following command to run in watch mode:

```shell
$ npm run dev
```

### Run tests

```shell
$ npm test
```

### Build for production

```shell
$ npm run build
```


text:
##  Debit Entry (RECEIPTS.E2)

<PageHeader />

##  Line Items

![](./RECEIPTS-E2-1.jpg)

**Receipt ID** Contains the system assigned record ID. The ID consists of the
purchase order number, followed by a dash (-) and the letter "D", which is
followed by a sequential number maintained in the purchase order record. If
you are creating a new debit receipt you should leave this prompt blank. If
you want to make a change to an existing debit receipt you should enter the
full debit receipt ID.

**Orig Receipt** Enter the ID of the original receipt against which you are
creating a debit. This ID will consist of the purchase order number, followed
by a dash (-), followed by a sequential number.

**Status** The status field contains the current status of the debit receipt
record. It will display one of the following codes:
N - New - no inventory has been moved. MShip has not been created.
R - Received or Released - An MSHIP will be created if "Create Mship" has been
checked, otherwise debit quantities will be moved from inventory.
S - Shipped - System controlled status only used with [ MSHIP.E ](../../../../../../../../rover/AP-OVERVIEW/AP-ENTRY/AP-E/AP-E-1/MSHIP-E) and indicates that the parts have been shipped (moved from inventory).
P - The receipt has been posted and the accounts payable record has been
created.

If the status code is not already set to "P" then the user may enter the code "N" for new, or "R" for released. The "N" status sets the receipt as a new receipt and does not create any inventory transactions. If this debit is to be shipped through [ MSHIP.E ](../../../../../../../../rover/AP-OVERVIEW/AP-ENTRY/AP-E/AP-E-1/MSHIP-E) , the "R" status will create the MSHIP record but not move inventory, otherwise the "R" status will confirm the receipt by creating inventory transactions and will then be posted the next time [ RECEIPTS.P1 ](../../../../../../../../rover/AP-OVERVIEW/AP-REPORT/APREG-R1/RECEIPTS-P1) procedure is run. Once the status has been set to "R" and the record has been filed, you may not reset the status to "N" or make any changes to the receipt. However, the debit record can be deleted at status "N" or status "R" (only with MSHIP checked).

**Debit Date** Enter the date on which this debit actually took place.

**Vendor** Contains the name of the vendor associated with the purchase order.

**Ship Debit?** Check here if you want the debit receipt to create a miscellaneous shipment when the debit record is released (status "R"). If so, the inventory movement will be processed when the MSHIP record is shipped (status is changed to "S") through [ MSHIP.E ](../../../../../../../../rover/AP-OVERVIEW/AP-ENTRY/AP-E/AP-E-1/MSHIP-E) .

**Mship Id** This is the miscellaneous shipment number created as a result of
releasing this debit receipt. This is shown for information only and is
created only if the "Create Mship" has be checked.

**Vendor Rma No** Enter the vendor's rma number here.

**Pack Slip** Contains the packing slip number associated with the original
receipt.

**Container** This is the container number associated with this receipt if
this receipt record was created from the container receipt process. It is for
information only and cannot be changed.

**Item** Enter the purchase order line item number of the item you are
debiting. This data is loaded from the original receipt.

**Part** Contains the internal part number of the item being received.

**Desc** Contains the description of the part number.

**Vend part** Contains the number used by the vendor to identify the material.

**Receipt Qty** Enter the quantity to be debited. If this item is either lot
or bin controlled, enter the quantity associated with each lot or bin. If it
is neither then enter the entire debit quantity for this line.

**Lot No** Contains the lot number assigned to the receipt line item. It may
not be changed.

**Vendor Lot No** Contains the vendor's lot number for the line item.

**Bin Number** Enter the bin number from which the material is being returned.
The bin number defaults to the bin entered during the original receipt.

**Li Qty** This is the total debit quantity entered for the line item. It is
the sum of the lot quantities, if there are multiple entries. It is for
display only and cannot be changed.

**From Loc** Enter the inventory location from which the debit items were
removed. This should be the location at which the materials currently reside.
This location is used as the FROM location for the inventory transaction. If
the original receipt was for an item that posted outside processing directly
to a work order then you may not change the location. If it was a material
charge then you can.

**WO.ID** If the original receipt for this item posted the value directly to
outside processing cost or you are removing material costs directly from a
work order then the work order number must be entered.

**Rev** Contains the revision level of the material.

**Buy U/M** The unit of measure used by the vendor when the parts were
shipped.

**Buy Factor** The factor by which the quantity is multiplied to obtain the
quantity as expressed in the internal unit of measure. For example, if the
vendor sent eggs by the dozen, but eggs are maintained in inventory
individually then the factor would be 12. You must enter the quantity to be
returned in the vendor's unit of measure.

**Notes** Enter any applicable notes for this line item.

**Close Li** Check this box if you do not wish to re-open the purchase order
line item by the quantity being returned to the vendor against this debit
memo. If this box is checked, the schedule quantity on the purchase order will
be reduced by the quantity being returned and pobook records will be created
to show the change.

**Create Dmr** Check this box if you wish to create DMR (discrepant material) records for the material being returned to the vendor. If required, enter the weighting and exception codes that should be applied to these DMR records on the DMR DATA tab. The DMR records will be created when the debit receipt is posted via [ RECEIPTS.P1 ](../../../../../../../../rover/AP-OVERVIEW/AP-REPORT/APREG-R1/RECEIPTS-P1) .

<badge text= "Version 8.10.57" vertical="middle" />

<PageFooter />

repository: zumasys/docs

repo_name: zumasys/docs