text:
---
layout: post
title: "Batch deploy artifacts to Maven repository"
date: 2013-03-19 21:32
updated: 2013-3-29 23:42
comments: true
tags:
- Maven
- SoftwareDev
---
I need to migrate a Maven repository from [Artifactory](http://www.jfrog.com/home/v_artifactory_opensource_overview) to [Nexus](http://www.sonatype.org/nexus/). Nexus's migration [solution](http://www.sonatype.com/people/2009/03/migrating-from-artifactory-to-nexus/) uses its migration plugin. But our Nexus service is managed by IT team and I don't want to bother to ask them to install a plugin.

Artifactory is able to export a whole repository into file system as local repository layout (like .m2/repository folder). So I looked for import feature in Nexus, but failed.

Searched on Google then I found [this answer](http://stackoverflow.com/a/3304212/94148) on StackOverflow. Sean provided a pom with embedded Groovy script to upload (deploy) a hierarchy of files to a Maven repository. However Sean's solution handles groupId, artifactId and version in a way differ to what I want. It requires to specify groupId and version in pom as fixed value.

I modify the Groovy script a bit to handle local repository folder layout. GroupId, artifactId and version are parsed from path of file. Here is my modified version:

{%gist https://gist.github.com/aleung/5194777 %}

Before using it, modify the setting in \<deploy.basefolder\> and \<distributionManagement\>. Make sure you have removed all non-artifact files e.g. *.sha1, *.lastUpdated from your import directory. Or you may enhance the script to filter those files out.

Suppose your import folder is ~/.m2/repository, put this pom.xml at ~/.m2. Run `cd ~/.m2; mvn install` then everything is done.

Usually you should configure your repository to allow redeploy of an existing artifact. Otherwise you'll get error if an artifact you want to import already exist in repository.

**Update** 2013-3-29:

There is a more simple way to import artifacts into Nexus, if you have privilege to access its data folder. Just copy the files into the storage location of the repository (the path can be found in repository configuration tab on Nexus web UI), change owner and group of the copied directories and files. After that, on Nexus web UI right click the folder and choose rebuild metadata. After a while everything will be ready.

repository: aleung/octopress-blog

repo_name: aleung/octopress-blog


text:
# TODO

More specific / smaller items than the roadmap in the readme.

## On deck

 *  Make sure I'm handling KeepInputArtifact correctly

    Check whether the post-processor is responsible for deleting the input file if KeepInputArtifact is not passed.
    If so, I need to implement this.
    If not, do nothing.

    Right now, I just pass the value of KeepInputArtifact on through
    from the input packer.Artifact in packer-post-processor-caryatid,
    which now that I think about it may not be right either.
    Do I need to check for my own config value or something?

 *  Improve test code, especially integration test code

    Integration tests tend to become multi-page monstrosities.
    Break these apart.

 *  Document when identical versions with different prerelease tags are considered to match and when they aren't.

    When querying like `=1.0.0`, we only return exact matches;
    we would not return e.g. `1.0.0-BETA` in this case.

    But when querying without a qualifier like `1.0.0`,
    or with a less-than/greater-than qualifier like `<1.0.0` or `<=1.0.0`,
    we *would* return e.g. `1.0.0-BETA`.

    This might be confusing.
    If we can't fix the confusion,
    we should at least document it.
    (It is already documented in comments;
    I mean documenting for the end user.)

    (Random thought: add `~`, `<~`, and `>~` for explicitly matching different prerelease tags?)

 *  Implement and test S3 backend

    I'm so ready

 *  Build a first class concept of a Vagrant Box into the Catalog

    Currently, there's a CaryatidOutputArtifact,
    which implements the *packer* concept of an *artifact*,
    but there is no *Caryatid* concept of a *Vagrant box*,
    particularly from the perspective of the Catalog.

    A box would have all the properties in a Catalog,
    and one would exist for each Catalog/Version/Provider combination.

    However, CatalogUri + VersionString + ProviderName would be all that is necessary to identify a box,
    so functions like `Equals()` should be written and documented carefully.

    (I have already dealt with this in a small way with BoxReference,
    but I'm thinking of something more comprehensive.)

 *  Improve CLI argument parsing and help

    1)  Subcommands

        The `docker` arguments are pretty complex, maybe go see what they're doing

    2)  Better messages to the user

        Subcommands are part of this,
        but basically make it more discoverable and less trial-and-error-y

    I strongly suspect this will require using something other than the standard `flags` module,
    which I have come to loathe.
    Maybe someone ported Python's `argparse`?

 *  Get a handle on logging

    1)  Support logging to a file

    2)  Maybe add debug logging?
        There's lots of bullshit in the logs that end users will absolutely not care about

    3)  Definitely add verbose logging,
        controllable via a commandline flag

    4)  How should it be handled in the Packer plugin?
        Does Packer have a logging system it wants you to use?

## Far future

Not sure how feasible this stuff is, but it's on my mind

 *  Split out backends into completely separate projects.

    This would help in two ways:

    1)  If I change the CaryatidBackend interface,
        I will be able to update the individual backends more easily to match it,
        since I won't be facing the whole set of broken integration tests all at once

    2)  Other people can build their own without forking the repo or getting a PR accepted

license: Unlicense

repository: mrled/caryatid

branch_name: refs/heads/master

extension: markdown

license_type: permissive

repo_name: mrled/caryatid


text:
# Acme Air Sample

This application shows an implementation of a fictitious airline called "Acme Air".

## Repository Contents

Source:

- **acmeair-common**: The Java entities used throughout the application
- **acmeair-services**:  The Java data services interface definitions
- **acmeair-service-jpa**:  JPA-based data service implementations
- **acmeair-webapp**:  The Web 2.0 application and associated Java REST services
- **acmeair-itests**:  Integration tests for the application

## Building

The sample can be build using [Apache Maven](http://maven.apache.org/).

```bash
$ mvn install
```

### Running integration tests

The integration tests are executed against the AcmeAir application running in a Liberty profile server. The project uses [Liberty Maven Plug-in][] to automatically download, install, and configure the Liberty profile runtime for the tests.

```bash
$ mvn install -Prun-its
```

## Deploying to Bluemix

Click the button below to deploy your own copy of this application to [Bluemix](https://bluemix.net). Once the application is deployed, visit *http://<yourAppName>.mybluemix.net/rest/api/loader/loadSmall* first to preload the database with sample data.

[![Deploy to Bluemix](https://bluemix.net/deploy/button.png)](https://bluemix.net/deploy?repository=https://github.com/WASdev/sample.acmeair.git)

[Liberty Maven Plug-in]: https://github.com/WASdev/ci.maven

repository: svjeyaprakash/jenkins-test

extension: md

repo_name: svjeyaprakash/jenkins-test


text:
# .NET Configuration Module for AppDynamics

This project is a generic configuration block to include in .NET config files relating to AppDynamics. NOTE: This does not
tie in with the .NET agent, it's merely a construct to assist with configuration and automation.

## Installation

This package is available as a Nuget package:

```
Install-Package AppDynamics.Configuration
```

Installing the package includes a transform of your Web.config or App.config to include the config section declaration
and the configuration block. After installation, your config file will look as follows:

```
<configuration>
  <configSections>
	...
    <section name="appdynamics" type="AppDynamics.Configuration.AppDynamicsConfigurationSection, AppDynamics.Configuration"/>
  </configSections>
  <appdynamics>
	<app name="test_app">
		<properties/>
	</app>
	<tier name="...your assembly name...">
		<properties/>
	</app>
    <properties/>
  </appdynamics>
  ...
</configuration>
```

## Configuration Elements and Attributes

* appdynamics: top-level configuration element
	* app: (required) configuration block relating to the AppDynamics app this application relates to
		* @name: (required) AppDynamics app name to attach this application to
		* properties: (optional) key/value configuration block to app-specific AppDynamics properties
	* tier: (required) configuration block relating to the AppDynamics tier this application relates to
		* @name: (required) AppDynamics tier name within the app
		* properties: (optional) key/value configuration block to tier-specific AppDynamics properties
	* properties: (optional) key/value configuration block for node-specific AppDynamics properties

license: MIT

repository: adamschmidt/appdynamics-configuration

repo_name: adamschmidt/appdynamics-configuration


text:
## override resolution in rendered image with pdf renderer sdk in VBScript with ByteScout Premium Suite

### How to apply ByteScout Premium Suite for override resolution in rendered image with pdf renderer sdk in VBScript

This page helps you to learn from code samples for programming in VBScript. ByteScout Premium Suite helps with override resolution in rendered image with pdf renderer sdk in VBScript. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.

If you want to quickly learn then these fast application programming interfaces of ByteScout Premium Suite for VBScript plus the guideline and the VBScript code below will help you quickly learn override resolution in rendered image with pdf renderer sdk. If you want to know how it works, then this VBScript sample code should be copied and pasted into your application’s code editor. Then just compile and run it. Check these VBScript sample code examples to see if they acknowledge to your needs and requirements for the project.

Visit our website to get a free trial version of ByteScout Premium Suite. Free trial contains many of source code samples to help you with your VBScript project.

## REQUEST FREE TECH SUPPORT

[Click here to get in touch](https://bytescout.zendesk.com/hc/en-us/requests/new?subject=ByteScout%20Premium%20Suite%20Question)

or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20Premium%20Suite%20Question)

## ON-PREMISE OFFLINE SDK

[Get Your 60 Day Free Trial](https://bytescout.com/download/web-installer?utm_source=github-readme)
[Explore SDK Docs](https://bytescout.com/documentation/index.html?utm_source=github-readme)
[Sign Up For Online Training](https://academy.bytescout.com/)

## ON-DEMAND REST WEB API

[Get your API key](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Documentation](https://pdf.co/documentation/api?utm_source=github-readme)
[Explore Web API Samples](https://github.com/bytescout/ByteScout-SDK-SourceCode/tree/master/PDF.co%20Web%20API)

## VIDEO REVIEW

[https://www.youtube.com/watch?v=NEwNs2b9YN8](https://www.youtube.com/watch?v=NEwNs2b9YN8)

<!-- code block begin -->

##### ****OverrideResolutionInRenderedImage.vbs:**

```
' Create Bytescout.PDFRenderer.RasterRenderer  object
Set renderer = CreateObject("Bytescout.PDFRenderer.RasterRenderer")

renderer.RegistrationName = "demo"
renderer.RegistrationKey = "demo"

' Load sample PDF document
renderer.LoadDocumentFromFile "../../multipage.pdf"

' Set resolution of rendered images to 300DPI
Set renderingOptions = CreateObject("Bytescout.PDFRenderer.RenderingOptions")
renderingOptions.ResolutionOverride= 300

' Iterate through pages
For i = 0 To renderer.GetPageCount()-1
    ' Generate 800x600 px PNG image
    renderer.Save_4 "image" & i & ".png", 2, i, 600, 800, (renderingOptions)
Next

```

<!-- code block end -->

url: https://raw.githubusercontent.com/bytescout/ByteScout-SDK-SourceCode/67a20983df78dea26d2a8f25ec98000d3ec81928/Premium Suite/VBScript/Override resolution in rendered image with pdf renderer sdk/README.md

repository: bytescout/ByteScout-SDK-SourceCode

gha_language: HTML

repo_name: bytescout/ByteScout-SDK-SourceCode


text:
---
title: Lysistrata
playwright: Aristophanes
translator: Alan Sommerstein
season: Lakeside
season_sort: 252
period: Spring
venue: Djanogly Theatre
date_start: 2013-04-24
date_end: 2013-04-27
comment: Preview on 23rd

cast:
  - role: Ismenia / Chorus
    name: "Emma-Louise Amanshia"
  - role: Myrrhine / Chorus
    name: Ali Blatcher
  - role: Cinesias / Chorus
    name: Phil Damms
  - role: Mens Leader / Herald / Chorus
    name: James Gregory
  - role: Calonice / Chorus
    name: Alix Hattenstone
  - role: Lysistrata
    name: Emma McDonald
  - role: Teacher
    name: Mitchell Masterson
  - role: Lampito / Chorus
    name: Toby Stevens
  - role: Magistrate Stratyllis / Chorus
    name: Yalda Tomlinson
  - role: Director / Chorus
    name: Ruth Wogan
  - role: Fight Director
    name: Catherine Boot
crew:
  - role: Director
    name: Martin Berry
    note: Professional
    person: false
  - role: Desinger
    name: Gem Greaves
    note: Professional
    person: false
  - role: Composer
    name: Joshua Goodman
    note: Professional
    person: false
  - role: Movement
    name: Alice Bentham
    note: Professional
    person: false
  - role: Movement
    name: Ellie Woodhead
    note: Professional
    person: false
  - role: Assistant Director
    name: Peter Bradley
  - role: Assistant Director
    name: Zoe Plummer
  - role: Lighting Designer
    name: Alyssa Watts
    note: Professional
    person: false
  - role: Sound Designer
    name: Nick Hobbs
    note: Professional
    person: false
  - role: Production Manager
    name: Richard Statham
    note: Professional
    person: false
  - role: Company Stage Manager
    name: Jo James
    note: Professional
    person: false
  - role: Production Assistant
    name: Joseph Heil

assets:
  - type: poster
    image: bsNfxdv
  - type: backstage
    video: 484MvZf
    title: Backstage At

links:
  - type: Review
    href: https://impactnottingham.com/2013/04/lysistrata-lakeside-arts-centre/
    snapshot: BMh9d
    publisher: Impact Nottingham
    author: Radhika Chond
    title: "Lysistrata @ Lakeside Arts Centre"
    date: 2013-04-24
    quote: "From the moment Lysistrata opened with its musical number to the final bows of the cast, it did not fail to induce continuous  laughter."
  - type: Article
    href: https://www.theguardian.com/education/2013/apr/22/lysistrata-nottingham-university
    snapshot: ibBqg
    publisher: The Guardian
    author: Alix Hattenstone
    title: Why I took to the stage wielding a giant penis
    date: 2013-04-22
    quote: "It's always a dilemma, choosing whether to dedicate time to your studies or extra-curricular interests. But there are 1,440 minutes in a day – that's a lot of time to balance both."

prod_shots: jnNkKq
---

The ancient world is gripped by a seemingly interminable war. With the men of Athens all serving in the forces, the women of the city can take no more. In secret, they meet with the enemy women and form a pact. The battle moves into the bedroom. No sex for the men - unless the women get peace. Lysistrata is the original battle of the sexes and its themes of feminism, power and politics are as relevant now as they were in ancient Greece.

Lakeside and The Nottingham New Theatre are thrilled to be working on a first collaborative theatre project, marrying the talents of the University’s student-run theatre company with a professional team including direction, design, stage management, education and marketing. This project has been funded by Cascade: a grants programme supported by donations from the University of Nottingham's alumni and friends

repository: newtheatre/history-project

gha_license_id: MIT

repo_name: newtheatre/history-project


text:
# Trinity

*Trinity* is the third public jailbreak for the *PS Vita™*, which supports the latest firmwares 3.69 and 3.70. The exploit chain consists of three stages: the MIPS Kernel Exploit, the PSP Emulator Escape and the ARM Kernel Exploit.

## Write-up

A technical explanation of the *Trinity* exploit chain is available [here](<https://theofficialflow.github.io/2019/06/18/trinity.html>).

## Requirements

- Your device must be on firmware 3.69 or 3.70. If you're on a lower firmware, please use [h-encore](<https://github.com/TheOfficialFloW/h-encore>) instead.
- If your device is a phat OLED model, you need a Memory Card in order to install. There's no need for a Memory Card on Slim/PS TV models, since they already provide an Internal Storage.
- Your device must be able to access the PlayStation Store.
- If your device region is mainland China (model PCH-2009) then this exploit may not be available for you, since this model is region locked to only accept mainland China PSN accounts to login and can only access mainland China PS Store, which doesn't contain any PSP games at all.

## Preparation

If you have already done the preparation, you can skip this part and go to the `Installation` section.

1. If you're on firmware 3.69, you have two options:

   - Either update to firmware 3.70 (go to Settings → System Update).
   - Or set DNS to `<IP_ADDRESS>` (go to Settings → Network → Wi-Fi Settings → Your access point → Advanced Settings and set DNS Settings to Manual and Primary DNS to `<IP_ADDRESS>`).

2. Register a PSN account if you don't have one yet (note that only 3 devices can be activated using the same account).

3. Download and install **any PSP/minis game (PS Vita or PS one Classics do not work)**. There are **demos** in most regions (if you know a title that is not listed here, please let me know):
   - EU/UK: Ape Quest
   - NA/SG: LocoRoco Midnight Carnival
   - JP: YS seven

   Unfortunately, if you can't find a demo in your region, you must either buy any PSP/minis game, or register a new PSN account in one of the regions listed above.

4. Please make sure that your demo **is a PSP/minis** game. To verify, please launch the game and hold the PS button for a while. Then a quick menu should come up with the `Settings` option, where you can set bilinear filter, etc. If this option is not there, you've likely downloaded the wrong game. For help, please consider watching some youtube tutorials and see how a PSP game should look like.

## Installation

1. Download and install [qcma](<https://codestation.github.io/qcma/>) and [psvimgtools](<https://github.com/yifanlu/psvimgtools/releases>).

2. Start qcma and within the qcma settings set the option `Use this version for updates` to `FW 0.00 (Always up-to-date)` to spoof the System Software check.

3. Launch Content Manager on your PS Vita and connect it to your computer, where you then need to select `PS Vita System -> PC`, and after that you select `Applications`. Finally select `PSP™/Other` and click on the game that you want to turn into the *Trinity* exploit. If you see an error message about System Software, you should simply reboot your device to solve it (if this doesn't solve, then put your device into airplane mode and reboot). If this does still not work, then alternatively set DNS to `<IP_ADDRESS>` to block updates.

4. Transfer the game over to your computer by clicking on `Copy` on your PS Vita. After copying, you go to the folder `/Documents/PS Vita/PGAME/xxxxxxxxxxxxxxxx/YYYYZZZZZ` on your computer, where `xxxxxxxxxxxxxxxx` is some string corresponding to your account ID and `YYYYZZZZZ` is the title id of the game that you've just copied over. You can look at the image at `YYYYZZZZZ/sce_sys/icon0.png` to verify that it is indeed your chosen game. Furthermore, the `YYYYZZZZZ` folder should contain these folders: `game`, `license` and `sce_sys`.

5. Before you attempt to modify the backup, you should make a copy of it. Just copy `YYYYZZZZZ` somewhere else, such that if you fail to follow the instructions, you can copy it back and retry.

6. Insert the `xxxxxxxxxxxxxxxx` string [here](<http://cma.henkaku.xyz/>). If the AID is valid, it will yield a key that you can now use to decrypt/re-encrypt your game.

7. Decrypt the game backup by executing the following command in your command line/terminal (make sure you're in the right working directory. On Windows you can open the terminal in the current working directory by typing in `cmd` in the path bar of the file explorer. Also, if you haven't installed psvimgtools yet, then just place them in the `YYYYZZZZZ` folder):

   ```
   psvimg-extract -K YOUR_KEY game/game.psvimg game_dec
   ```

   If done correctly, you should see an output like this:

   ```
   creating file ux0:pspemu/temp/game/PSP/GAME/YYYYZZZZZ/EBOOT.PBP (x bytes)...
   creating file ux0:pspemu/temp/game/PSP/GAME/YYYYZZZZZ/__sce_ebootpbp (x bytes)...
   all done.
   ```

8. Download [Trinity](<https://github.com/TheOfficialFloW/Trinity/releases/download/v1.0/PBOOT.PBP>) and copy the `PBOOT.PBP` file to `game_dec/ux0_pspemu_temp_game_PSP_GAME_YYYYZZZZZ/PBOOT.PBP` (the files `EBOOT.PBP`, `__sce_ebootpbp` and `VITA_PATH.txt` should exist in this folder). If `PBOOT.PBP` does already exist there, just overwrite it.

9. Now re-encrypt the backup similar to above by typing this in your command line/terminal:

   ```
   psvimg-create -n game -K YOUR_KEY game_dec game
   ```

   If done correctly, you should see an output like this:

   ```
   adding files for ux0:pspemu/temp/game/PSP/GAME/YYYYZZZZZ
   packing file ux0:pspemu/temp/game/PSP/GAME/YYYYZZZZZ/EBOOT.PBP (x bytes)...
   packing file ux0:pspemu/temp/game/PSP/GAME/YYYYZZZZZ/PBOOT.PBP (x bytes)...
   packing file ux0:pspemu/temp/game/PSP/GAME/YYYYZZZZZ/__sce_ebootpbp (x bytes)...
   created game/game.psvimg (size: x, content size: x)
   created game/game.psvmd
   ```

10. Remove the `game_dec` folder (and PSVimg tools if copied here) and select `Refresh database` in qcma settings.

11. Now you need to copy back the modified backup to your PS Vita: Launch Content Manager on your PS Vita and connect it to your computer (if it's already open, just go back to the first menu), where you then need to select `PC -> PS Vita System`, and after that you select `Applications`. Finally select `PSP™/Other` and click on the modified game. Perform the copy operation and exit Content Manager.

12. In the livearea, the game should now have a different icon and should now be called *Trinity* (eventually you have to rebuild the database in recovery mode to make the bubble change its look). If not, please re-read the instructions more carefully and begin from fresh.

13. Turn on Wi-Fi, then reboot your device and straightly launch *Trinity*. Do not do anything else, otherwise the exploit will be less reliable. It is very important that you do not have any running downloads in background.

14. Enjoy the exploitation process and wait until it launches the *Construct*. If the exploit fails, simply rerun *Trinity*.

15. Within the *Construct*, select `Download VitaShell`, then `Install HENkaku` and finally `Exit`.

16. Congratulations, your device is now able to run homebrews. It is highly suggested that you downgrade your device to either firmware 3.60 or 3.65/3.67/3.68 using [modoru](<https://github.com/TheOfficialFloW/modoru>). On 3.60, you can use [HENkaku](<http://henkaku.xyz/>) and on 3.65/3.67/3.68 you can use [h-encore](<https://github.com/TheOfficialFloW/h-encore>). If you don't downgrade your device now, you may lose the ability to launch *Trinity* later and therefore not be able to hack your device anymore.

## FAQ

### Exploit

- "I get the error `[TURN ON WI-FI TO USE THIS EXPLOIT].`" - Just hold the PS button and turn on Wi-Fi in the quickmenu.
- "I get the error `[EXPLOIT FAILED: 0x800200CB].`" - This can sometimes happen. Just rerun the exploit.
- "My device freezes/panics." - Be sure you do not have any downloads running in background. Also make sure that you do not launch anything else before *Trinity*. A fresh reboot is always recommended.
- "Trinity crashes in the second run." - It is not recommended that you launch *Trinity* multiple times. Always reboot your device before launching *Trinity*.
- "Trinity bubble disappeared after downgrading." - Sony prevents you from playing games that have been downloaded from a higher firmware. Therefore, after downgrading, it is hidden. You can redownload the game on your lower firmware and reapply the *Trinity* patch to make it compatible with your current firmware and higher.

### HENkaku Settings

- "I don't see all folders in VitaShell." - Launch the Settings application and select `HENkaku Settings`, then select `Enable unsafe homebrews`. This will grant you full permission in VitaShell.
- "I can't find the HENkaku Settings." - Launch the exploit and reset taiHEN config.txt and reinstall HENkaku.

### enso/permanent hack

- "Can I install enso on 3.69 or 3.70?" - Not on these firmwares, but you can downgrade to firmware 3.60/3.65 using [modoru](https://github.com/TheOfficialFloW/modoru) and then install enso.

## Donation

If you like my work and want to support future projects, you can make a donation:

- via bitcoin `361jRJtjppd2iyaAhBGjf9GUCWnunxtZ49`
- via [paypal](https://www.paypal.me/flowsupport/20)
- via [patreon](https://www.patreon.com/TheOfficialFloW)

Thank you!

## Credits

- Thanks to qwikrazor87 for the PSP kernel exploit.
- Thanks to Freakler for the *Trinity* icon.
- Thanks to molecule for their initial work on the PS Vita.
- Thanks to Davee and Proxima for http://cma.henkaku.xyz/.
- Thanks to yifanlu for psvimgtools.
- Thanks to codestation for qcma.
- Thanks to the PS Vita hacking community.
- Thanks to Sony for this awesome device.

repository: paulloeduardo/Trinity

repo_name: paulloeduardo/Trinity


text:
# yoro

You only run once to generate train set

# why

Just want to make a easy way to generate yolov3 train set and cfg automatically

# usage

```bash

1、 git clone https://github.com/leegohi/yoro.git

2、 cd yoro

3、 python yolo.py --name 2019 --img ./imges_folder --voc ./voc_folder --cls ./2019.names --prt 0.8

```

# output

```bash
.
├── 2019.names
├── LICENSE
├── README.md
├── TrainSet-2019
│   ├── 2019.names
│   ├── backup
│   ├── exclude
│   ├── train.data
│   ├── train.txt
│   ├── train_test.txt
│   ├── voc
│   ├── yolo
│   └── yolov3.cfg
├── train.data.template
├── yolov3.cfg.template
└── yoro.py
```

after these commands,you will see like below,the script generate a folder names **TrainSet-2019** contains:

- **2019.names** ：copy from ./2019.names contains the classes，it is just a txt file，each line put one label.

- **backup** ：when we are training,the darknet puts it weight file to it

- **exclude** ： useless image，ignore

- **train.data** : the file tells darknet where the train image,test image,classes count,classes file and backup folder are

- **voc** : collect the .xml voc file

- **yolo**: collect the train images and corresponding yolo txt format file

- **yolov3.cfg** : yolov3.cfg,the script just replace the classes and filters

# command

```bash
usage: yoro.py [-h] -n NAME -i IMG -v VOC -c CLS [-p PRT]

optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME name of trainset
-i IMG, --img IMG path to image
-v VOC, --voc VOC path to voc
-c CLS, --cls CLS path to classes file
-p PRT, --prt PRT how much percentage of image will be used to train.
e.g. if you has labeled 100 images you want to use 80
for train and 20 for test,so the percentage is 0.8
```

# Train

now you need get the pretrain file:

```bash
wget https://pjreddie.com/media/files/darknet53.conv.74

```

**start training**

```bash

./darknet detector train  TrainSet-2019/train.data   TrainSet-2019/yolov3.cfg darknet53.conv.74

```

remind that you need change the path to yourself above

repository: leegohi/yoro

repo_name: leegohi/yoro


text:
---
layout: post
title: Practical AI
---

It is well known that artificial intelligence (AI) has gotten through multiple tides and ?? through its history. People's assumption about how quickly implement human level intelligence has been strikingly wrong (including Alan Turing's prediction of the necessary memory to replicate human intelligence in 1950). In spite of the recent successful demonstration of AlphaGo and various deep learning techniques, the progress toward human-level intelligence seems to be slower compared to all the hypes around artificial intelligence.

At this current stage, I believe that we have to focus on is practical artificial intelligence.

One of the definitions of intelligence, I think that the following one from ??, "". I believe that the definition includes the pragmatism. In order to achieve the pragmatism, I believe that the following hurdles should be overcome.

1. Expensive Data

Though some of mechanisms (e.g., reinforcement learning) have been developed to circumvent the cost of data collection, cleansing, and annotation, genernally many researchers and engineers are stuck in this issue. Crowdsourcing could be another way to distribute the arduous burden to multiple people and several approaches have been divsed (e.g., divice and conqor [??]), but often it has limitations in achieving the highest quality. Trained data curators are often necessary, and retaining skilled data curators is often problematic because of the innate tediousness of job.

Facebook M's attempt has been interesting because it has attempted to collect data while human agents pretend artifical agents--basically, the wizard of OZ approach. Though the results of the attempt have not been publicly shared (?? this should be verified again), it would have been quite challenging because human users tend to change their behaviors depending on the quality of the service. In other words, as soon as users learned that the system is backed up by human agents and the responses from human agents are slow, people would issue more complicated and worthwhile-to-wait queries (e.g., what would be the best way to issue Canadian passport from Cuba?). Thus, the collected data from this approach would not work. Pretending to be artificial agents is quite challenging. In order to generate fast responses, you need to increase the human agents substantially and make them shifted to serve 24/7 services.

Only scalable ways to collect data for natural language understanding would be relying on text accumulated over the internet. There have been several approaches (e.g., DeepDive at Standford) to construct knowledge base using various statistical approaches. It is not fully automatic, but with some intervention from data curator,

2. Still understanding natural languages

I partly agree with ??'s blog post regarding deep neural network is not perfectly aligned approach to learn human language.

3. What's the most cognitive difficulties that human being have.

There are some tasks that human agents have more difficulties than others. If you review the mistakes that human agents made. Human factors is a good discipline to archieve various failures that human agents have made. Out of these issues, some solutions with the structured steps have been overcome by simply applying

Follow the structure -
Avoid stereotype -
Getting tired -
Knowing everythings - Open Q&A.
Visilance - Reminder.

4. Infrastructure to help machine agents do its jobs better

5. Things should be still controlable

I don't believe that truly machine-learned experiences are not optimal.

6. Focus on the most important things.

Really working natural language understanding. Some good source of data is necessary.

Unsupervised leanring


text:
## Bowser
A Browser detector. Because sometimes, there is no other way, and not even good modern browsers always provide good feature detection mechanisms.

[![bowser ci](https://secure.travis-ci.org/ded/bowser.png)](https://travis-ci.org/ded/bowser/)

So... it works like this:

``` js
if (bowser.msie && bowser.version <= 6) {
  alert('Hello China');
}
```

## 1.0.0 breaking changes
`browser = require('bowser').browser;` becomes `browser = require('bowser');`

## Flags set for detected Browsers[Engines]

  * `chrome`[`webkit`]
  * `firefox`[`gecko`]
  * `msie`
  * `msedge`
  * Android native browser as `android`[`webkit`]
  * iOS native browser as `ios`[`webkit`]
  * `opera`[`webkit` if >12]
  * `phantom`[`webkit`]
  * `safari`[`webkit`]
  * `seamonkey`[`gecko`]
  * BlackBerry native browser as `blackberry`[`webkit`]
  * WebOS native browser as `webos`[`webkit`]
  * Amazon Kindle browser as `silk`[`webkit`]
  * Bada browser as `bada`[`webkit`]
  * Tizen browser as `tizen`[`webkit`]
  * Sailfish browser as `sailfish`[`gecko`]

For all detected browsers the browser version is set in the `version` field.

## Flags set for detected Operating Systems

  * `mac`
  *  Windows other than Windows Phone as `windows`
  *  Windows Phone as `windowsphone`
  * `linux` for Linux other than `android`, `chromeos`, `webos`, `tizen`, and `sailfish`
  * `chromeos`
  * `android`
  * `ios` (`iphone`/`ipad`/`ipod`)
  * `blackberry`
  * `firefoxos`
  * `webos` (`touchpad`)
  * `bada`
  * `tizen`
  * `sailfish`

Android, iOS, Windows Phone, WebOS, Bada, and Tizen will all report the OS version number if it is contained in the UA string in the `osversion` field. iOS is always reported as `ios` and additionally as `iphone`/`ipad`/`ipod`, whichever one matches best. If WebOS device is an HP TouchPad the flag `touchpad` is additionally set.

All detected mobile OSes are additionally flagged `mobile`, **if they are not powering a tablet device**. If a tablet device is detected, the flag `tablet` is set instead.

### Notes
Safari, Chrome and some other minor browsers will report that they have `webkit` engines, Firefox and Seamonkey will report that they have `gecko` engines.

``` js
if (bowser.webkit) {
  // do stuff with safari & chrome & opera & android & blackberry & webos & silk
}
```

### Ender Support

`package.json`

``` json
"dependencies": {
  "bowser": "x.x.x"
}
```

``` js
if (require('bowser').chrome) {
  alert('Hello Silicon Valley')
}
```

### Graded Browser Support

``` js
if (bowser.a) {
  // support full feature set
}
else if (bowser.c) {
  // serve degraded version
}
else {
  // unsupported (bowser.x)
}
```

### Contributing
If you'd like to contribute a change to bowser, modify the files in `src/`, then run the following (you'll need node + npm installed):

``` sh
$ npm install
$ make test
```

Please do not check-in the built files `bowser.js` and `bowser.min.js` in pull requests.

### Adding tests
See the list in `src/useragents.js` with example user agents and their expected bowser object.

Whenever you add support for new browsers or notice a bug / mismatch, please update the list and
check if all tests are still passing.

### License
Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

repository: duson/javaFramework

gha_language: JavaScript

repo_name: duson/javaFramework


text:
# KTANE Twitch Plays Macro Helper
This is a script written in AutoHotkey that is able to speed up and/or ease typing repetitive commands when playing Keep Talking and Nobody Explodes on Twitch channels. So far, it includes the basic, most commonly used commands. It also contains one or two features that can help with the KTANE game itself. So far, it can:

- Claim/unclaim modules
- Flip bomb
- Show bomb edges and submit edgework for storing
- Quickly open Expert Profile and Bomb Log folders
- Features hotstrings for alternative input

Because this script is written in AHK, it will only work in Windows-based systems.

## How To Use
Detailed list of commands and their input is shown when executing the script, and can be called again by pressing Ctrl-F1. The script can be (and should be) made to disregard your keystrokes by pressing Ctrl-H, Ctrl-X terminates the script completely. All inputs triggering the script are intercepted; the system does not see them.

Some commands expect a parameter to be entered, typically a number assigned by the game to a module in question. Once the command is triggered, simply type the number (its input is intercepted) and press Space.

The script offers *hotstrings* as an alternative to hotkeys. Simply type the keyword of the command and press space, and the keyword disappears and command is triggered.

The script triggers type the TP commands indiscriminantly, whereever your text cursor is pointing. Make sure to have your text input focus on the Twitch Chat window.

## Download
The script is also available as a stand-alone binary file. Its capabilities are the same as the script on its own, but the system does not need to install the AHK runtime libraries.

[Download Here](https://github.com/Peliia/tp-ahk-helper/blob/master/KTaNE%20TP%20Helper.exe?raw=true)

## Feedback
Feel free to leave feedback about your experiences, bugs, or suggestions on the repository Issue page. Alternatively, I am available on the official [KTANE Discord server](https://discord.gg/Fv7YEDj) as @Pelia.

repository: Peliia/tp-ahk-helper

repo_name: Peliia/tp-ahk-helper


text:
# Simple samples

Execute

```
node run <lspfile>
```

Example

```
node run hello.lsp
```

Compile a file
```
node compile hello.lsp
```

The JavaScript source code is printed to console.

repository: ajlopez/SimpleLisp

repo_name: ajlopez/SimpleLisp


text:
# thing-it-device-browser

[![NPM](https://nodei.co/npm/thing-it-device-browser.png)](https://nodei.co/npm/thing-it-device-browser/)
[![NPM](https://nodei.co/npm-dl/thing-it-device-browser.png)](https://nodei.co/npm/thing-it-device-browser/)

[[thing-it-node]](https://github.com/marcgille/thing-it-node/) Device Plugin for a custom Website that allows you to display and interact with the [[thing-it]](http://www.thing-it.com) universe via the [official Raspberry Pi 7" touchscreen display](https://github.com/marcgille/thing-it-node/)

## Setup
**[thing-it-device-browser]** is currently tested only on a Raspberry Pi 3. It may works on other versions of Raspberry but the installation process may differ from the following.

### Hardware
Follow the instructions on XXX to Connect your Touchscreen to your Raspberry Pi 3.

**Note:** Make sure your power supply delivers enough power for your Pi and your Touchscreen.

### Software

#### Image
The easiest way to use **[thing-it-device-browser]** is to download one of our preinstalled **[thing-it-node-image-display]** from [thing-it.com](http://www.thing-it.com). These image comes with full out of the Box support for the offiziell 7" Raspberry Pi Display.

#### Raspbian Lite

You can also install all requirements by hand.
The first step will be to follow the install instrunctions on the [thing-it-node wiki](https://github.com/marcgille/thing-it-node/wiki) to [setup a raspberry pi 3](https://github.com/marcgille/thing-it-node/wiki/Raspberry-Pi-Installation) as **[thing-it-node]**.

**Note:** Make sure you grap the latest **LITE** version of Raspbian. We don't need all the stuff "Raspbian With Desktop" will come with.

Manuell install xServer, Chromium Browser and a few dependencies.

```
sudo apt-get -y update

sudo apt-get -y install lsb-release xserver-xorg xorg jwm chromium-browser libgtk-3-dev
```

Now you are ready to add and configure a **[thing-it-device-browser]** in your Mesh.

## User Interface

repository: marcgille/thing-it-device-browser

repo_name: marcgille/thing-it-device-browser


text:
# PIXI Intro Workshop
#projects/pixi

## Database Vulnerabilities
1. Find the MongoDB Rest API
○	Using nmap find some open ports
```
		nmap pixi.ip -p1-65535
		27017/tcp open  mongod
		28017/tcp open  mongod
```
2. Browse to Mongo HTTP interface
○	http://localhost:28017/
○	http://localhost:28017/Pixidb/users/
■	What does this show us?

## Web App Vulnerabilities
3. Find the Reflected XSS attack
○	Explain XSS
○	Explain difference between stored vs. reflected XSS
○	Search field is reflected, because when you do a normal search you see the query on the actual page, when the developer doesn't make sure all malicious input is properly escaped, it will be rendered by the browser, which is what executes the javascript.
○	 `<script>alert('hi')</script>`

4. Find the Angular Constructor XSS attack
○	Angular uses constructors to instantiate and initialize fields in an angular template.  You can actually perform an XSS attack without using HTML but using angular constructor syntax.
○	Angular templates can contain expressions - JavaScript-like code snippets inside double curly braces.  The text input `{{1+1}} `will be evaluated by the angular engine and result in 2
○	This means anyone able to inject double curly braces can execute Angular expressions. Angular expressions can't do much harm on their own, but when combined with a sandbox escape we can execute arbitrary JavaScript and do some serious damage.
○	`{{constructor.constructor('alert(1)')()}}`

5. Bypass the admin page restriction on the web app
○	Pixi's Express.js routes contains code preventing anyone from accessing /admin section unless they are actually administrators.  Trouble is that the code is just using regular expressions (RegEx) against the word 'admin'.
○	Therefore if you type in /ADMIN you should be able to bypass the unless routing control.

6. Find the actual administrator service account in a file
○	Pixi accidentally stores valuable keys and credentials in a publicly access web directory
○	http://localhost:8000/service.conf

7. Find the session secret for web app session cookies
○	Pixi accidentally stores valuable keys and credentials in a publicly access web directory
○	You get a hint that there are conf files by clicking on the secret menu item
○	http://localhost:8000/secret.conf

8. Using CSRF create a link to delete a photo you uploaded
○	Explain what CSRF is
○	When you are logged into your account and go to the profile page, you see a button on each photo to delete it.
○	Right-clicking and inspecting that takes you to
○	`<a href="# “ ng-click="user_delete_photo(picture._id)" class="btn btn-info">Delete Photo <i class="fa fa-trash" aria-hidden="true"></i> </a>`
○	This means that angular calls a `user_delete_photo` method with a picture id parameter.
○	Digging further to find the `user_delete_photo` javascript
```
	$scope.user_delete_photo = function(photo){
	$http.get('/user_delete_photo/' + photo)
	  .then(function success(response){
		$scope.user_pictures();
		$scope.picture_alerts = [
	      { type: 'success',  msg: "Buh-Bye, Photo Deleted! " }
```
○	This shows that the GET method is used to delete the photo.
○	Construct a URL with a valid photo id (that belongs to you) while you are logged in
■	http://localhost:8000/user_delete_photo/photo_id
■	If you create these links and get people to click on them you have launched a CSRF attack.

9. Log in as another user by bypassing authentication
○	The login page is just a pure express.js form.  It will allow MongoDB injection for the same reason all injection happens, improper input sanitization.
○	By setting up a web proxy you see that<EMAIL_ADDRESS>is in the POST body of the request.
○	If you modify that to<EMAIL_ADDRESS>Mongo uses `$ne` to specify not equal - `db.users.find({_id: {$ne: ''} })`

10. Upload something that is not a photo
○	Pixi allows for binary data upload.  Good practice would be to ensure that the file uploaded is actually what you'd expect (JPG/PNG), or do the conversion on the back-end.  Pixi allows arbitrary file upload, including executables.

11. Inject on the admin page to find all users
○	`http://localhost:8000/ADMIN/search?search[$ne]=1`

12. Inject on the admin page to find all likes
○	`http://localhost:8000/ADMIN/likes/search?search[$ne]=`

13. Inject on the admin page to find all loves
○	`http://localhost:8000/ADMIN/loves/search?search[$ne]=`

API Vulnerabilities
14. Make yourself an admin using by mass assigning via the API
○	Authenticate to the API using valid credentials
○	GET request to `localhost:8090/api/user/info`
○	Look at the is_admin field.
○	PUT request to `localhost:8090/api/user/edit_info`
○	Set is_admin to true.
○	Run the GET request again

15. Delete another Users photos
○	By looking at the API Definition you see that to delete photos you can use the DELETE Method: /api/picture/delete
○	If we try to leverage that method using
○	`localhost:8090/api/picture/delete?picture_id=11`
○	We see that because of underprotected API Routes, the picture is allowed to be deleted.
16. Change another users profile
○	I forgot this…
17. Inject on the admin api to find all users
○	`http://localhost:8000/api/ADMIN/search?search[$ne]=`
18. Inject on the admin api to find all likes
○	`http://localhost:8090/api/ADMIN/likes/search?search[$ne]=1`
19. Inject on the admin api to find all loves
○	`http://localhost:8090/api/ADMIN/loves/search?search[$ne]=1`
20. Give yourself more money!
○	`http://localhost:8000/admin/money`
○	POST to` http://localhost:8000/admin/money?userid=36`

Authentication Vulnerabilities
21. Find the session secret for JWT/sessions.
○	http://localhost:8000/secret.conf
22. Decode a JWT token
○	Jwt.io
23. Brute Force User/Passwords

repository: apiaxl/Pixi

repo_name: apiaxl/Pixi


text:
---
layout: post
title:      "Active Record Build Method"
date:       2019-09-06 09:05:58 -0400
permalink:  active_record_build_method
---

When Active Record associations are declared, the declaring class automatically gains methods related to the association [[documentation](https://guides.rubyonrails.org/association_basics.html#detailed-association-reference)].

When has_many, or belongs_to associations are declared, the class gains the build method, among others. The build method is an alias [[doc](https://github.com/rails/rails/blob/959fb8ea651fa6638aaa7caced20d921ca2ea5c1/activerecord/lib/active_record/relation.rb#L84)] for the new method, however, the build method has the association present, which new does not. As with new, build will not insert a record into the database, but in working memory. If you would like it to persist to the database, it must be saved.

When declaring a has_many association, the class gains:

collection.build(attributes = {}, ...)

This following example comes from apidock.com [[doc](https://apidock.com/rails/ActiveRecord/Associations/CollectionProxy/build)]

```
class Person
  has_many :pets
end

person.pets.build
#=> #<Pet id: nil, name: nil, person_id: 1>

person.pets.build(name: 'Fancy-Fancy')
 => #<Pet id: nil, name: "Fancy-Fancy", person_id: 1>

person.pets.build([{name: 'Spook'}, {name: 'Choo-Choo'}, {name: 'Brain'}])
 => [
      #<Pet id: nil, name: "Spook", person_id: 1>,
      #<Pet id: nil, name: "Choo-Choo", person_id: 1>,
      #<Pet id: nil, name: "Brain", person_id: 1>
    ]

person.pets.size  # => 5 # size of the collection
person.pets.count # => 0 # count from database
```

When using collection.build, you may choose whether or not to pass in attributes. From the above example, none of the pets have been persisted to the database, because nothing is being saved. The size of the collection in working memory is 5, the database count is 0.

When declaring a belongs_to association, or has_one, the class gains:

build_association(attributes = {})
pet.build_person(attributes = {}, ...)

"The build_association method returns a new object of the associated type. This object will be instantiated from the passed attributes, and the link through this object's foreign key will be set, but the associated object will not yet be saved[doc](https://guides.rubyonrails.org/association_basics.html)." In this case, you cannot use pet.person.build, because pet.person is nil until defined.

Using build makes things easier because the associations are already set for you. But remember, as with new, the instance(s) returned must be saved in order to persist to the database.


text:
Install dependencies
```
composer install
```

Generate Certificate for JWT
```
$ mkdir var/jwt
$ openssl genrsa -out var/jwt/private.pem -aes256 4096
$ openssl rsa -pubout -in var/jwt/private.pem -out var/jwt/public.pem
````


text:
Inherently concurrent operations
--------------------------------

When working with tables of data, many operations are inherently
concurrent. Simple transforms that take one table and generate the next
step, such as those of physics systems or AI state / finite state
machines, are inherently concurrent. You could provide a core per row /
element and there would be no issues at all. Setting up the local bone
transforms from a skeletal animation data stream, ticking timers,
producing condition values for later use in condition tables. All these
are completely concurrent tasks. Anything that could be implemented as a
pixel or vertex shader is inherently concurrent, which is why parallel
processing languages such as shader models, do not cheaply allow for
random write to memory, and don’t allow accumulators across elements.

Seeing that these operations are inherently concurrent, we can start to
see that it’s possible to restructure our game from an end result
perspective. We can use the idea of a structured query to help us find
our critical path back to the game state. Many table transforms can be
split up into much smaller pieces, possibly thinking along the lines of
map reduce, bringing some previously serial operations into the
concurrent solution set.

Any N to N transform is perfectly concurrent. Any N to \<=N is perfectly
concurrent, but depending on how you handle output NULLs, you could end
up wasting memory. A reduce stage is necessary, but that could be
managed by a gathering task after the main task has finished, or at
least, after the first results have started coming in.

Any uncoupled transforms can be run concurrently. Ticking all the finite
state machines can happen at the same time as updating the phsyics
model, can happen at the same time as the graphics culling system
building the next frame’s render list. As long as all your different
game state transforms are independent from each other’s current output,
they can be dependent on each other’s original state and still maintain
concurrency.

For example, the physics system can update while the renderer and the AI
rely on the positions and velocities of the current frame. The AI can
update while the animation system can rely on the previous set of
states.

Multi stage transforms, such as physics engine broadphase, detection,
reaction and resolution, will traditionally be run in series while the
transforms inside each stage run concurrently. Standard solutions to
these stages require that all data be finished processing from each
previous stage, but if you can find some splitting planes for the
elements during the first stage, you can then remove temporal cohesion
from the processing because you can know what is necessary for the next
step and hand out jobs from finished subsets of each stage’s results.

Concurrent operation assumes that each core operating on the data is
free to access that data without interfering, but there is a way that
seemingly unconnected processes can end up getting in each other’s way.
Most systems have multiple layers of cache, and this is where the
accident can happen. False sharing is when data, though actually
unrelated, is connected by the physical layout of the hardware. For
example, the cachelines of a CPU might be 16 to 128 bytes long. If two
different CPUs try to write to neighbouring bytes, or words, at best the
cores will lock up as the memory is shunted around trying to keep memory
consistent, but worse, could end up losing data if the cache is not
coherent[^2]. To reduce the chance of this happening, processing of
small element tables should consider this and split any cooperation into
cacheline size jobs.

[^2]: cache coherency is the system by which changed data is propagated
    to other caches so that consistent state is achieved.

repository: dejan-stankovic/dodbook

repo_name: dejan-stankovic/dodbook


text:
Secure Netmet Server API
========================

Netmet Server supports basic auth for any potentially dangeours method:

    GET /api/v2/config
    POST /api/v2/config
    POST /api/v1/events/<event_id>
    DELETE /api/v1/events/<event_id>
    POST /api/v1/events/<event_id>/_stop

To Enable Basic Auth
--------------------

Set enviorment variable

    NETMET_AUTH="<user1>:<password1>,<user2>:<password2>"

password should have at least 1 number and 1 uppercase 1 lowercase and
more then 6 characters.

This is temporary soultion that is going to be replaced by full RBAC.

Secure Netmet Server <-> Netmet Client Traffic
==============================================

Intro
-----

Type of Inteactions:
1) Netmet Server sets Netmet Config via POST /api/v2/config
2) Netmet Server disables Netmet Client via POST /api/v1/unregister
3) Netmet Client restores it's config via POST /api/clients/<host>/<port>
4) Netmet Client sends metrics to Netmet Server via POST /api/v1/metrics

In interactions are not secured anybody can perform any of this operations.
Which means that one can changed configuration of client, or send own metrics
back and they are going to process.

In trusted enviorment it may be OK.
However, Netmet provides simple way to secure this interaction and avoid
potential risks.

To do that Netmet uses HMAC mechanism.
Data that is send during these requests is singed with HMAC key, and other
side validates HMAC signature and drops requests with invalid signature.

How To Run NetMet Without HMAC
------------------------------

Set Env variable:

    NETMET_HMAC_SKIP=True

How To Enable HMAC
------------------

Provide to Netmet Server or Client:

    NETMET_HMACS="key1"

You can provide multiple keys, e.g. "key1,key2". First key is going to be
used to sign data, both for check signature.

How To Add HMAC To Existing Netmet Deployment
---------------------------------------------

1) Re run netmet server specifing:

   NETMET_HMAC_SKIP=True
   NETMET_HMACS="your_key"

2) Re run all netmet clients with

    NETMET_HMACS="your_key"

3) Re run all netmet servers with

    NETMET_HMACS="your_key"

How To Perform Rolling Upgrade of Netmet HMAC Keys
--------------------------------------------------

1) Re run NetMet Servers with

    NETMET_HMACS="<old_key>,<new_key>"

2) Re run NetMet Clients with

    NETMET_HMACS="<new_key>,<old_key>"

3) Re run Netmet Servers with

    NETMET_HMACS="<new_key>"

4) Re run Netmet Clients with

    NETMET_HMACS="<new_key>"

repository: godaddy/netmet

gha_language: Python

repo_name: godaddy/netmet


text:
# Crossing the Bounds of Your Computer

`scp` can be used to get files to/from a remote computer and takes the similar form to `cp`:

```
BabyMac:~ jennapederson$ scp hello_world.sh jenna@612softwarefoundry.com:~/hello_world_remote.sh
hello_world.sh                                                     100%  137     0.1KB/s   00:00
```

Or run a command on a remote server:

```
BabyMac:~ jennapederson$ ssh<EMAIL_ADDRESS>‘ls -l ~'
total 4
-rwxr--r-- 1 jenna jenna 137 Mar  7 19:48 hello_world_remote.sh
```

Back: [Who Cares?](11_who_cares.md)
Forward: [More Commands & Tools](17_commands_and_tools.md)

repository: jennapederson/cli-crash-course

gha_language: Shell

repo_name: jennapederson/cli-crash-course


text:
# Coin Flipping Request Delegation

The goal of Coin Flipping Request Delegation (CFRD) is to add plausible
deniability of routing and lookup requests in P2P networks, with special
emphasis on DHT networks. The CFRD lookup protocol works by probabilistically
creating a new lookup from a received routing request in order to add noise
(potentially useful) noise against passive local adversaries.

###  Example: CFRD in Kademlia DHT

In a Kademlia lookup request (as defined by these specs), the lookup initiator
creates an ordered shortlist containing k peers closest to the ID of the
contentID requested. The shortlist is ordered by proximity and is first
populated with peers in the initiator's bucket list. Each iteration of the
protocol consists of selecting α of the closest peers to the `contentID` in the
shortlist and issue in parallel a `FIND_VALUE` request to them. The responses
contain a set of the closest peers of each of the peers which that received the
`FIND_VALUE` request. This information is added to the shortlist in a way that it
maintains its order (i.e. first peers are closer to the `contentID`). This
protocol proceeds until 1) a peer responds with STORE message (value found); 2)
an iteration in which no new peer is added to the shortlist (value not found)
and; 3) lookup timeout.

The CFRD construction transforms `FIND_VALUE` requests into new `FIND_VALUE`
requests in a probabilistic way. When a peer receives a `FIND_VALUE` request, it
will flip a coin to decide whether to respond to the request or instead start a
lookup request itself. Once the lookup is resolved by the new peer (which is not
the original initiator), it will cache the content and reply to the peer which
initially asked for the content with a STORE message.

This mechanism adds plausible deniability to DHT lookups, since (privacy)
adversaries monitoring network requests (locally and to a certain threshold)
will not be able to distinguish between original content lookups from lookups
that were initiated because of the CFRD mechanism. This mechanism aims at
decoupling peer behaviour (network request) from user behaviour (interests and
personal behaviour).


text:
# Multi-class CenterPoint Detection (McCPD) website

1. Click "launch blinder" button below:

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/slee5777/McCPD.git/master?filepath=%2Fvolia%2Frender%2Finference.ipynb)

2. Upload a tile (1024 x 1024)

3. Press the "submit" button.

Note: The model achieved mAP at 0.77 (using ResNet34, bs=16, size=256)

TODO: Update the ouput message.


text:
---
title: New GitHub Actions addin
category: Release Notes
---

A new [Cake.Issues.PullRequest.GitHubActions addin] has been released which brings integration with GitHub Actions and GitHub pull requests.

<!--excerpt-->

[Cake.Issues.PullRequest.GitHubActions addin] creates annotations from issues when running on GitHub Actions:

![Annotations](../docs/pull-request-systems/github-actions/githubactions-annotations.png "Annotations")

These annotations will also be shown in pull requests on the related file / position,
bringing first class integration for GitHub pull requests to Cake.Issues:

![Pull request integration](../docs/pull-request-systems/github-actions/githubactions-pullrequest-integration.png "Pull request integration")

This integration was [first released in Cake.Issues.Recipe 0.4.2] and has now been moved to its own addin, which can also be used outside of
Cake.Issues.Recipe.

[Cake.Issues.PullRequest.GitHubActions addin]: ../docs/pull-request-systems/github-actions/
[first released in Cake.Issues.Recipe 0.4.2]: cake-issues-recipe-v0.4.2-released

branch_name: refs/heads/develop


text:
---
layout: post
title: Clādēs Cimicum
date: 2018-04-10
categories:
    - debugger,c
description: A small debugger that can read memory from another process.
author: Collin Tod
author-image: https://avatars2.githubusercontent.com/u/9722413?s=400&u=58f02226ffe89fa4f69ad4a7f89f07efb1b72f4f&v=4
author-bio: First year computer science student at Rochester Institute of Technology
author-email<EMAIL_ADDRESS>author-social:
    github: https://github.com/squablyScientist
---
# What Is It?
This program, Clādēs Cimicum, (which means 'Bane of Bugs' in Latin) is a very small and simple debugger for interprocess debugging. This is slightly different from that of GDB, since GDB actually creates a child process when debugging. Cladēs Cimicum can read the memory of any running process, without having to be run in some special environment beforehand.

# Why I Wrote It
A while back, I found [this](https://github.com/scvalencia/MNIST_ASCII_challenge) challenge, and figured that I could do it. I started doing research into the best way to read the memory of another process, and found a few options:

1. Using ptrace to attach to the process and read its memory (This is what GDB does to a child proces)
2. Manually stopping the process and reading from its mem file in `/proc`

I chose the latter of the two options because I wanted a bit of a challenge.

# How To Use It
Program usage

```sh
debugger PID offset nbytes
```

where `PID` is the process ID of the target process, `offset` is the address in the virtual memory of the process that you wish to read from, and `nbytes` is the number of bytes to read from the target process

# How It Works

First of all, a distinction must be made between the concept of a program, and the concept of a process. A program is the code that you write, and the binary file that it becomes when compiled, or the set of instructions executed as it is interpreted, or any number of other programming paradigms. In essence, it is the blueprint for behavior of the computer when that program is 'run'. A process on the other hand, is an individual instance of that program running. For example, you can have two instances of vim running, each their own separate process, but using the same program.

As it turns out, a process on UNIX systems is nothing more than a collection of pseudo files stored in `/proc`. Everything about the process is stored in a folder within `/proc`, and the name of that folder for each process is the PID (Process ID) for that process. For example, if there is an instance of vim running with PID 413, everything about that specific process will be stored at `/proc/413`. In general, for any process, I will be referring to this location as `/proc/PID`.

Among the numerous useful files and folders within `/proc/PID`, one stands out as immediately useful for the problem at hand: `/proc/PID/mem`. This file holds ALL of the virtual memory mapped to a process. (I am aware that it is not technically a file, but going into the mechanics of what a pseudo filesystem is is beyond the scope of the description of this project). Therefore, you should be able to read all of the memory of a running process just by opening that file right? Well yes, but it is slightly more involved than that.

Firstly, the process that is to be examined (from here on out the target process) must not be running if you want to read the mem file. This is extrememly important in avoiding [race conditions.](https://en.wikipedia.org/wiki/Race_condition). My solution to this is to simply pause the execution of the process by utilizing signalling. Before I attempt to read the mem file, the target process is stopped with SIGSTOP. The once reading is done, the process is continued with SIGCONT.

Secondly, you must be root to read the memory of another process in this way. It would be extremely unsafe for non-root or super users to be able to read the memory of any process on a machine at any time.

Thirdly, and maybe most importantly, you must know the exact memory address of the memory you want to access. This is because attempting to accesss an address in virtual memory that is not mapped to a physical address by `/proc/PID/maps` will result in an IO error. This makes sense, because there is no physical representation of the area of memory attemting to be accessed. Thus, you must be extremely familiar with the target process in order to effectively use this method.

# How I Solved the Captcha Problem

The biggest challenge for this problem was actually finding the memory address of the answer to the captcha. Input is read in 1 by 1 so there is no array to immediately check against in the input function, where there is a blocking call to `scanf`. The solution I found however, does involve a simple array of ints that holds the answer. A stack frame always holds a pointer to the previous stack frame's stack pointer. The stack pointer is a register that holds a memory address to the last piece of memory that was requested to be allocated on the stack. This piece of memory just so happened, in the previous stack frame, to be an array holding the answer. Done. Using GDB to grab this value (There is absolutely a way to do this not using GDB, but there was not enought time to research how to search the stack for this exact value), I simply used the Clādēs Cimicum program to grab the memory at that pointer and print it out. This is the solution to the captcha.

# What I Learned

Pretty much everything that I know about the `/proc` folder, and how stack frames work.

# The Project
The project is hosted [here](https://github.com/squablyScientist/Clades-Cimicum). The `master` branch is the general debugger, whilst the `injection` branch is the solution for the captcha challenge.

repository: LeulBM/blog

repo_name: LeulBM/blog


text:
[![PyPI version](https://badge.fury.io/py/aiida-shell.svg)](https://badge.fury.io/py/aiida-shell)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-shell.svg)](https://pypi.python.org/pypi/aiida-shell)
[![CI](https://github.com/sphuber/aiida-shell/workflows/ci/badge.svg)](https://github.com/sphuber/aiida-shell/actions/workflows/ci.yml)

AiiDA plugin that makes running shell commands easy.
Run any shell executable without writing a dedicated plugin or parser.

## Documentation

Please refer to the [online documentation](https://aiida-shell.readthedocs.io/) for a complete guide.

repository: sphuber/aiida-shell

repo_name: sphuber/aiida-shell


text:
# Sampler Single Peak [[HSD13]](http://kops.uni-konstanz.de/bitstream/handle/123456789/24358/Heck_243584.pdf%3Bjsessionid%3D6A7E6EFBFF35CDC5C5F8EBB5928C44F8?sequence%3D2)

## Description

The sampler from [[HSD13]](http://kops.uni-konstanz.de/bitstream/handle/123456789/24358/Heck_243584.pdf%3Bjsessionid%3D6A7E6EFBFF35CDC5C5F8EBB5928C44F8?sequence%3D2) with a single peak profile.

For a more precise description of this sampler and its performances in terms of aliasing and discrepancy, please refer to the following web bundle [https://liris.cnrs.fr/ldbn/HTML_bundle/index.html](https://liris.cnrs.fr/ldbn/HTML_bundle/index.html).

## Files

```
src/samplers/SinglePeak.cpp
include/utk/samplers/SinglePeak.hpp
externals/SinglePeak/*
```

## Usage

<button class="tablink exebutton" onclick="openCode('exe', this)" markdown="1">Exe</button>
<button class="tablink cppbutton" onclick="openCode('cpp', this)" markdown="1">C++</button>
<button class="tablink pybutton" onclick="openCode('py', this)" markdown="1">Python</button>

```bash
SinglePeak sampler
Usage: ./SinglePeak [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
  -n UINT REQUIRED            Number of points
  -d UINT                     UNUSED ! Here for compatibility with others.
  -s,--seed UINT              Seed (unspecified means 'random')
  -m UINT [1]                 Number of pointsets
  -o,--out TEXT [out.dat]     Output file (format). {i} splits outputs in multiple files and token is replaced by index.
  --criticalFreq FLOAT [36.5]
                              Critical frequency
  --smoothing FLOAT [8]       Smoothing
  --peakPower FLOAT [2]       Peak power
  --peakSmoothing FLOAT [2]   Peak smoothing

```

```  cpp
#include <utk/utils/PointsetIO.hpp>
#include <utk/utils/Pointset.hpp>
#include <utk/samplers/SamplerSinglePeak.hpp>

int main()
{
    utk::Pointset<double> pts;

    utk::SamplerSinglePeak step(
      36.5, /* critical frequency */
      8,    /* smoothing */
      2,    /* peak smoothing */
      2,    /* peak power */
    );
    step.setRandomSeed(args->seed);
    // Check for no errors
    if (step.generateSamples(pts, 1024 /* Number of points */))
    {
        write_text_pointset("step.dat", pts);
    }
}
```

``` python
import pyutk

sp = pyutk.SinglePeak(
  36.5, # critical frequency
  8,    # smoothing
  2,    # peak smoothing
  2,    # peak power
)
samples = sp.sample(1024) # This is a numpy array !
```

## Results

## License

See Licence.md file. Author code from has no licence but is provided with following header.

```
//
// Source code for the paper, edited to fit the utk framework
//
// D. Heck and T. Schloemer and O. Deussen, "Blue Noise Sampling with
// Controlled Aliasing", ACM Trans. Graph., 2013, in press
//
// Copyright (C) 2012,2013 Daniel Heck and Thomas Schloemer
//
```

repository: utk-team/utk

gha_license_id: NOASSERTION

repo_name: utk-team/utk


text:
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.0.0](https://github.com/webpack-contrib/json-minimizer-webpack-plugin/compare/v1.0.1...v2.0.0) (2020-11-09)

### ⚠ BREAKING CHANGES

* minimum supported `webpack` version is `5.1.0`

## 1.0.1 (2020-10-07)

### Chore

* update `schema-utils`

## 1.0.0 (2020-10-05)

Initial release

# Change Log

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.


text:
# Terraform::Heroku::SpaceInboundRuleset

Provides a resource for managing [inbound rulesets](https://devcenter.heroku.com/articles/platform-api-reference#inbound-ruleset) for Heroku Private Spaces.

## Properties

`Space` - (Required) The name of the space.

`Rule` - (Required) At least one `Rule` block. Rules are documented below.

### Rule Properties

`Action` - (Required) The action to apply this rule to. Must be one of `allow` or `deny`.

`Source` - (Required) A CIDR block source for the rule.

## Return Values

### Fn::GetAtt

`Id` - The ID of the inbound ruleset.

## See Also

* [heroku_space_inbound_ruleset](https://www.terraform.io/docs/providers/heroku/r/space_inbound_ruleset.html) in the _Terraform Provider Documentation_


text:
# diffmah

For a typical development environment in conda:

```bash
conda create -n diffit python=3.7 numpy numba emcee flake8 pytest tqdm pyyaml jax ipython jupyter matplotlib scipy h5py
```

You can then install the package into your environment with
```
$ conda activate diffit
$ cd /path/to/root/diffmah
$ python setup.py install
```

Simulation data formatted for this project can be found [at this URL](https://portal.nersc.gov/project/hacc/aphearin/umachine_sfh_jonas/full_histories/binary_column_store).

repository: abensonca/diffmah

repo_name: abensonca/diffmah


text:
[Week 3 Home](../)

#U1.W3: GPS 1.2: Pairing Website

**DO NOT LOOK AT THIS CHALLENGE UNTIL YOUR GUIDED PAIRING SESSION!!**

## Learning Competencies
  - Use HTML tags to place content on a website
  - Apply CSS to position elements on an HTML page
  - Compare different HTML tags to one another
  - Examine pair-programming concepts

## Summary
This GPS is designed to help you examine pair programming and the roles of driver and navigator. Your goal is to design and build a single-page website that introduces the concept of pair programming!

**Don't forget to check in!**

## Release 0: Wireframe the site
Discuss how you want the page to look. Draw a wireframe or use a wireframing tool with your pair. It doesn't have to be perfect, but get a rough idea of how you want the site to look.

If you want to use a collaborative drawing site, you can use [Precursor](https://prcrsr.com/) or [flockdraw](http://flockdraw.com) (It's like a collaborative version of MSPaint). You don't need an account, and you can invite people by sharing the URL. You can also use any other wireframing tool and share your screen. (Or use a pen and paper and share)

You'll need sections for:
- Title
- Your names
- What is pair programming?
- Why is pair programming important to DBC?
- Compare Driver and Navigator
- Anything else you want!

## Release 1: HTML

Open a stypi file (only one person needs to do this) and name it with a `.html` extension (You will be able to see it in stypi by either hovering or clicking on the "eye" in the top right of the navigation bar). Share the URL with your pair and guide.

Based on your wireframe, add a skeleton for each section.

Be sure to include a link to the phase-0-unit-1/week-3/9-gps1-2/gps1-2.css stylesheet in your html! It won't work now, but you will be thankful later when you are copying and pasting the html and css into the separate files.

## Release 2: Discuss Pair Programming
Discuss the following topics, and add content for each section in the skeleton. Time-box this section to about 10 minutes or so.

- What is pair programming?
- Why is pair programming important to DBC?
- Compare Driver and Navigator

## Release 3: Dress it up!
Use CSS to make it look nice. Include pictures, outside fonts, etc. You will need to add CSS inside the `<style>` tags because stypi won't accept an actual link to an external stylesheet. This isn't good practice though. Why do you think it's not good practice?

## Release 4: Reflect

Reflect on your learning. How was it to pair this time? Did you feel more comfortable? How did you do with the learning competencies? Add your reflection as a comment in your gps1-2.html file.

## Release 5: Copy, commit, and push
When you are finished, copy your code into the [gps1-2.css](gps1-2.css) and [gps1-2.html](gps1-2.html) files. Make sure your css from the `<style>` section is in the CSS file and remove it from the HTML section. Update the html file. Then, test that everything is still  working by saving them and running them together from your computer.

Commit and push your changes onto the phase-0-unit-1 repository.

## Release 6: Publish
Using the terminal, practice copying the html and css sheets into a new folder in your [USERNAME].github.io site. Commit and push your changes to your github.io site. Double check that everything is displaying properly. Then add a link on the index of your site to make sure people can find it!

## Release 7: Give Feedback
Don't forget to give [feedback](https://socrates.devbootcamp.com/feedback/new) to your pair!


text:
This folder contains definitions of Elasticsearch mappings for distinct
search types, see [http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html)

Subfolder is name of index where given mapping is used, name of file in
subfolder is name of Elasticsearch type in given index with .json suffix added.

How to copy to OpenShift:

	zip -r mappings.zip **
	scp mappings.zip 5163d7b25973ca8ae4001fcf@dcp-jbossorgdev.rhcloud.com:~/app-root/data/

repository: searchisko/configuration

repo_name: searchisko/configuration


text:
# ebay-filter-menu

The `ebay-filter-menu` component is used as a checkbox menu specificially styled for filtering actions. Generally it is coupled with the `ebay-filter-menu-button` to create a selectable set of items by which to filter.

## ebay-filter-menu Tag

### ebay-filter-menu Usage

```marko
<ebay-filter-menu>
    <ebay-filter-menu-item value="item 1">item 1</ebay-filter-menu-item>
    <ebay-filter-menu-item value="item 2">item 2</ebay-filter-menu-item>
    <ebay-filter-menu-item value="item 3">item 3</ebay-filter-menu-item>
</ebay-filter-menu>
```

### ebay-filter-menu Attributes

Name | Type | Stateful | Required | Description
--- | --- | --- | --- | ---
`footer-text` | String | Yes | No | footer button text
`variant` | String | No | No | "" (default) / "form"
`form-name` | String | No | No | form's `name` attribute (used with `variant="form"`)
`form-action` | String | No | No | form's `action` attribute (used with `variant="form"`)
`form-method` | String | No | No |form's `method` attribute (used with `variant="form"`)
`class-prefix` | String | No | No | "filter-menu" (default) / modifies the base prefix for all Skin classes in the menu

#### Additional attributes for when footer-text is set

Name | Type | Stateful | Required | Description
--- | --- | --- | --- | ---
`a11y-footer-text` | String | No | Yes | a11y text for the footer button

### ebay-filter-menu Events

Event | Data | Description
--- | --- | ---
`filter-menu-button-change` | `{ el, checked, originalEvent }` | items changed/checked
`filter-menu-button-footer-click` | `{ checked, originalEvent }` | footer button clicked
`filter-menu-button-form-submit` |  | `{ checked, originalEvent }` | when using `variant="form"`, and form is submitted (emits current checked state)

## ebay-filter-menu-item Tag

### ebay-filter-menu-item Usage

```marko
<ebay-filter-menu-item>item 1</ebay-filter-menu-item>
```

### ebay-filter-menu-item Attributes

Name | Type | Stateful | Required | Description
--- | --- | --- | --- | ---
`checked` | Boolean | Yes | No | whether or not the item is checked
`value` | Boolean | Yes | No | the item's value (returned in emitted events when checked)

repository: seangates/ebayui-core

repo_name: seangates/ebayui-core


text:
Opyoid
======

![CI](https://github.com/illuin-tech/opyoid/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/illuin-tech/opyoid/branch/master/graph/badge.svg)](https://codecov.io/gh/illuin-tech/opyoid)

Dependency injection library using typings, to easily manage large applications.

This project is inspired from [Guice](https://github.com/google/guice).

# Installation

Run `pip install opyoid` to install from PyPI.

Run `pip install .` to install from sources.

This project follows the [Semantic Versioning Specification](https://semver.org/).
All breaking changes are described in the [Changelog](CHANGELOG.md).

# Usage
### Simple Injection
```python
from opyoid import Module, Injector

class MyClass:
    pass

class MyParentClass:
    def __init__(self, my_param: MyClass):
        self.my_param = my_param

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass)
        self.bind(MyParentClass)

injector = Injector([MyModule()])
my_instance = injector.inject(MyParentClass)
assert isinstance(my_instance, MyParentClass)
assert isinstance(my_instance.my_param, MyClass)
```
If they are multiple bindings for the same class, the latest will be used.

### Module
The module is used to group bindings related to a feature.
You can include a module in another with `install`:
```python
from opyoid import Module, Injector

class MyClass:
    pass

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass)

class MyParentClass:
    def __init__(self, my_param: MyClass):
        self.my_param = my_param

class MyParentModule(Module):
    def configure(self) -> None:
        self.install(MyModule())
        self.bind(MyParentClass)

injector = Injector([MyParentModule()])
my_instance = injector.inject(MyParentClass)
assert isinstance(my_instance, MyParentClass)
assert isinstance(my_instance.my_param, MyClass)
```

### Binding Subclasses
```python
from opyoid import Module, Injector

class MyClass:
    pass

class MySubClass(MyClass):
    pass

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass, to_class=MySubClass)

injector = Injector([MyModule()])
my_instance = injector.inject(MyClass)
assert isinstance(my_instance, MySubClass)
```

### Binding Instances
```python
from opyoid import Module, Injector

class MyClass:
    def __init__(self, my_param: str):
        self.my_param = my_param

my_instance = MyClass("hello")

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass, to_instance=my_instance)

injector = Injector([MyModule()])
injected_instance = injector.inject(MyClass)
assert my_instance is injected_instance
```

### Binding scopes
When binding a class, you can choose the scope in which it will be instantiated.
This will only have an effect when binding classes, not instances.

#### Singleton Scope
By default, all classes are instantiated in a Singleton scope.
This means that only one instance of each class will be created, and it will be shared between all classes requiring it.

```python
from opyoid import Module, Injector, SingletonScope

class MyClass:
    pass

class MyParentClass:
    def __init__(self, my_param: MyClass):
        self.my_param = my_param

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass, scope=SingletonScope)
        self.bind(MyParentClass, scope=SingletonScope)

injector = Injector([MyModule()])
instance_1 = injector.inject(MyClass)
instance_2 = injector.inject(MyClass)
parent_instance = injector.inject(MyParentClass)
assert instance_1 is instance_2
assert instance_1 is parent_instance.my_param
```

#### PerLookup Scope
If you use the per lookup scope, a new instance will be created every time each class is injected.
```python
from opyoid import Module, Injector, PerLookupScope

class MyClass:
    pass

class MyParentClass:
    def __init__(self, my_param: MyClass):
        self.my_param = my_param

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass, scope=PerLookupScope)
        self.bind(MyParentClass)

injector = Injector([MyModule()])
instance_1 = injector.inject(MyClass)
instance_2 = injector.inject(MyClass)
parent_instance = injector.inject(MyParentClass)
assert instance_1 is not instance_2
assert instance_1 is not parent_instance.my_param
```

#### Thread Scope
This scope only creates a new instance the first time that the class is injected in the current thread.
There will only be one instance of each class in each thread, and two instances injected from different threads will be
different objects.

```python
from threading import Thread

from opyoid import Module, Injector, ThreadScope

class MyClass:
    pass

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass, scope=ThreadScope)

injector = Injector([MyModule()])
instance_1 = injector.inject(MyClass)
instance_2 = injector.inject(MyClass)

def thread_target():
    instance_3 = injector.inject(MyClass)
    assert instance_1 is not instance_3

Thread(target=thread_target).start()

assert instance_1 is instance_2
```

### Bindings without Module
If you prefer, you can add bindings to your injector without creating a Module class (or using both).

```python
from opyoid import Module, Injector, SelfBinding

class MyClass:
    pass

class MyParentClass:
    def __init__(self, my_param: MyClass):
        self.my_param = my_param

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass)

injector = Injector([MyModule()], [SelfBinding(MyParentClass)])
my_instance = injector.inject(MyParentClass)
assert isinstance(my_instance, MyParentClass)
assert isinstance(my_instance.my_param, MyClass)
```

The same options of Module.bind are available when using bindings:
```python
from opyoid import ClassBinding, InstanceBinding, PerLookupScope, SelfBinding

class MyClass:
    pass

class MySubClass(MyClass):
    pass

my_instance = MyClass()

SelfBinding(MyClass)  # binding a class to itself
ClassBinding(MyClass, MySubClass)  # binding a class to a subclass
SelfBinding(MyClass, scope=PerLookupScope)  # specifying scope
InstanceBinding(MyClass, my_instance)  # binding an instance
SelfBinding(MyClass, named="my_name")  # binding a class to itself with a specific name
InstanceBinding(MyClass, my_instance, named="my_name")  # binding an instance with a specific name
```

### Injecting Type
If no explicit binding is defined, the last class binding will be used to inject a type:

```python
from typing import Type

from opyoid import Module, Injector

class MyClass:
    pass

class SubClass(MyClass):
    pass

class MyParentClass:
    def __init__(self, my_param: Type[MyClass]):
        self.my_param = my_param

my_instance = MyClass()

class MyModule(Module):
    def configure(self) -> None:
        self.bind(MyClass)
        self.bind(MyClass, to_instance=my_instance)
        self.bind(MyClass, to_class=SubClass)
        self.bind(MyParentClass)

injector = Injector([MyModule()])
parent_instance = injector.inject(MyParentClass)
assert isinstance(parent_instance, MyParentClass)
assert parent_instance.my_param is SubClass
```

## Dataclasses
`opyoid` can inject classes and parameters defined with the `attrs` library and python data classes.

##  Notes about Generics
- The supported generic types are `List`, `Set`, `Tuple`, `Optional`, `Union` and `Type` (and any combination of them).
Other generics must be bound explicitly (e.g. you must bind a dict to `Dict[str, MyClass]` if you want to inject it).
- Be careful when using generics, the bindings will only be used if the type matches exactly. For example, you cannot
implicitly bind `MyClass[T]` to inject `MyClass`, or `MyClass[str]` to inject `MyClass[T]`. You need to bind something
to `MyClass[str]` to be able to inject it.

# Advanced usage
More advanced features and examples are available in the [./docs](docs) folder.

repository: njyuhe/opyoid

repo_name: njyuhe/opyoid


text:
# ios_textfields_on_scrollview
show cases how to wire UITextField(s) on an UIScrollView
It is  demonstrated how to wire UITextFields to get the wanted
"scroll into view" behavior on a UIScrollView when tapping/focusing fields.
The UITextField scrolls into view upon  [MyTextField becomeFirstResponder]
 if the keyboard appears/disappears, UIScrollViews contentInset.bottom is updated.

In addition a custom inputAccessoryView is demonstrated to jump to the prev/next field (like in WkWebView) and close the keyboard.


text:
# Changelog

* 1.0.4 (2012-01-17)
	* Fixed bug that included empty/null lines in translation files

* 1.0.3 (2012-01-16)
	* Using Yaml:Dumper to export translations to fix issues with special characters in keys

* 1.0.2 (2012-01-13)
	* Added check for existence of key

* 1.0.1 (2012-01-12)
	* Fixed issue #2 and #3
	* Added check for existing keys when adding a new key (update an existing entry instead)
	* several usability improvements

* 1.0.0 (2012-01-09)

	* Initial release

repository: zvenni/TranslationEditorBundle

repo_name: zvenni/TranslationEditorBundle


text:
# Artefact

ARTEFACT stands for Augmented Reality Tool Enhancing Flight ACTions.
It aims to improve the flight experience with UAVs by inserting  spatially positioned objects despite the imprecision of UAV positioning systems.

# Installation guide
+ Download the `install_ARTEFACT.sh` script **ONLY**.
+ Run `chmod +x install_ARTEFACT.sh` to make it executable.
+ Run `./install_ARTEFACT.sh`

**OR**

+ Install on target host
	1. ros-kinetic
	2. Install following packages using terminal
	```sh
	$ sudo apt-get install build-essential python-rosdep python-catkin-tools
	$ sudo apt install python-pip
	$ sudo apt-get install libglfw3-dev libglfw3
	$ python -m pip install --user numpy cython scipy matplotlib ipython jupyter sympy nose
	$ sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
	$ python -m pip install --user glumpy
	$ python -m pip install --user triangle
	$ sudo apt install ros-kinetic-ardrone-autonomy
	$ sudo apt install ros-kinetic-joy
	$ sudo apt install ros-kinetic-gps-common
	$ sudo apt install ros-kinetic-hector*
	```
+ Clone repository to src folder of your workspace
+ run following command from workspace root
```sh
	$ rosdep update && rosdep install --from-paths src -i
```
+ Run `catkin build bebop_autonomy`
+ Run `catkin_make` from workspace root.
+ To start simulation, `roslaunch sim_launcher sim.launch` OR
+ To use with real drone, `roslaunch sim_launcher bebop.launch`
+ To fly quadrotor, plug in an xbox360 or logitech joystick controller.

![](resources/index.jpeg)
![](resources/index1.jpeg)
![](resources/index2.jpeg)

repository: rahulghangas/artefact

repo_name: rahulghangas/artefact


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2019-06-10

### Added

- Project setup
- First release

## [0.1.1] - 2020-04-09

### Fixed

- Improving the documentation
- Adding types

## [0.1.2] - 2020-04-09

### Fixed

- Improving the documentation
- Updating the dependencies
- Removing the .idea folder from the repository

## [0.1.2] - 2020-04-09

### Fixed

- Improving the documentation

## [0.1.3] - 2020-04-09

### Fixed

- Fixing test setup
- Improving README.md file

## [0.1.4] - 2020-04-10

### Fixed

- Fixing the missing exported CSS
- Improving the documentation

## [0.1.5] - 2020-04-10

### Fixed

- The linking process does not take into account the segment direction

## [0.2.0] - 2020-09-25

### Added

- New, more efficient build system based on `rollup` instead of `gulp`

### Fixed

- Wrong link position after window resize
- Minor types error in @types

## [0.2.1] - 2020-09-26

### Added

- className property to links

### Fixed

- `tailwind` removed

## [0.2.2] - 2020-10-10

### Added

- TS tests

### Fixed

- build system setup causing a missing `style.css` in the project `dist` directory

## [0.3.0] - 2020-09-26

### Added

- useSchema hook and tests
- createSchema utility function + tests
- validator functions + tests

### Fixed

- Child Nodes receive an outdated version of the schema bug

## [0.3.1] - 2020-10-22

### Fixed

- Removing linked node cause 'undefined entity' error
- Removing a node deletes the involved links

## [0.3.2] - 2020-11-06

### Fixed

- fixed `Diagram` generic types

## [0.3.3] - 2020-11-12

### Fixed

- Typescript tests to CI

## [0.4.0] - 2020-11-13

### Added

- Added the `disableDrag` option to node schema
- Validator examples in the documentation

## [0.5.0] - 2020-11-20

### Added

- First implementation of draggable canvas
- First implementation of zoomable canvas

## [0.5.1] - 2020-11-25

### Added

- Added `disconnect` function exported in `useSchema` hook

## [0.5.1] - 2020-11-27

  ### Reverted

  - Reverted changes in `0.5.0` related to draggable canvas and zoomable
    canvas due to an uncaught bug. We will continue working on these features
    and release them in an upcoming version. Apologies everyone!

## [0.6.0] - 2020-12-12

### Added

- Canvas Component for panning and zooming
- useCanvas hook
- CanvasControl component

repository: synerops/diagrams

repo_name: synerops/diagrams


text:
# Javascript/Angular
## Xerius
by Peter Cosemans, Euricom

Copyright (c) 2017 Euricom nv. Licensed under the [MIT license](https://opensource.org/licenses/MIT).

---

# Content

### [http://bit.ly/2prsTJt](http://bit.ly/2prsTJt)

- Slides
- Templates
- Examples
- Exercises

For code samples: https://gist.github.com/cosemansp

---

# Me

- Peter Cosemans (Euricom)
    -<EMAIL_ADDRESS>    - https://github.com/mjrio
    - http://github.com/euricom
    - https://gist.github.com/cosemansp
- 12 year Microsoft .NET Development
- 4 year Front-end Development
- Architect, Tech Coach, Trainer
    + JavaScript
    + Angular, React, VueJS
    + NodeJS, MongoDB
    + Mobile (hybrid)

---

# Agenda

- Day 1 (thu 04/05): ES5 to ES6 and TypeScript refresher
- Day 2 (fri 05/05): Angular Getting Started
- Day 3 (mon 08/05): Angular Routing & Forms
- Day 4 (tue 09/05): Intro RxJS & Angular RxJS
- Day 5 (wed 10/05): Angular In Depth & Unit testing

Day

10:00 - 12:00 & 12:30 - 16:00

---

# Prerequisites

- Knowledge / Experience
    + Javascript (jquery)
    + HTML / CSS / BootStrap
    + Chrome Dev Tools

- System Setup
    + GIT client ([git cli](https://git-scm.com/), [SourceTree](https://www.sourcetreeapp.com/))
    + [NodeJS 7.x](https://nodejs.org/en/download/current/)
    + [Yarn](https://yarnpkg.com/)
    + [Visual Studio Code](https://code.visualstudio.com/)
    + [Chrome](https://www.google.com/chrome/)
    + Optional:
        * OSX: [iTerm](https://www.iterm2.com/)
        * Windows: [cmdr](http://cmder.net/) + bash

---

# A better VSCode

> Powercharge your editor

----

## Plugins - Must have

| Plugin                    | Remark                           |
| ------------------------- | ---------------------------------|
| EditorConfig for VS Code  | -                                |
| TSLint                    | TypeScript Linter integration    |
| beautify                  | Format JS, CSS, and HTML         |
| Path Intellisense         | Autocompletes path and filenames |
| Angular Language Service  | Angular editor helper            |

----

## Plugins - Usefull

| Plugin                    | Remark                           |
| ------------------------- | ---------------------------------|
| Angular v4 Typescript ... | Angular snippets                 |
| TypeScript Hero           | Typescript helper                |
| Git History (git log)     | Git commits logs                 |
| Git Blame                 | See Git Blame info in status bar |
| Git Flow                  | Git Flow Branching commands      |
| mssql                     | Autocomplete & exec sql scripts  |

----

## Custom config

Goto `preferences - user settings`

```json
{
    // auto save on close
    "files.autoSave": "onFocusChange",
}
```


text:
game
====

This project implements the game of Breakout.

Name: Harry Ross (hgr8, Lead developer)

### Timeline

Start Date: 1/15/19

Finish Date: 1/21/19

Hours Spent: 20

### Resources Used
- JavaFX Tutorial (https://www.tutorialspoint.com/javafx/)
- Java & JavaFX API documents

### Running the Program

Main class: Breakout.java

Data files needed:
(All located in resources folder)
- 0.txt
- 1.txt
- 2.txt
- 3.txt
- ball.gif
- pup0.gif
- pup1.gif
- pup2.gif
- pup3.gif
- en0.gif
- en1.gif
- en2.gif

Key/Mouse inputs:
- Use mouse cursor to move paddle
- Use Space to launch ball
- Press Enter to begin game

Cheat keys:
- F1 - Go to level 1
- F2 - Go to level 2
- F3 - Go to level 3
- F11 - Add one life to current lives
- B - Add one ball to play

Known Bugs:
- If player has been hit by enemy, program will not stop when
 window is closed due to an issue with the Timer object used
 in Paddle.flash()

Extra credit:
Added enemies to game to make it more interactive and lively:
- One enemy zig-zags across screen
- One enemy zig-zags and occasionally shoots downward projectiles

### Notes
- Included three paddle enhancements that count toward overall
power-up requirement since specifications implied these enhancements
are power-ups if implemented as such.

### Impressions
- Design checklist and specification pages on CS308 website
give slightly conflicting information relating to power-up specifications,
 which confused me and ultimately led to a PLAN.txt file that lacked some
 details in the full specification document.


text:
---
# This file is licensed under the MIT License (MIT) available on
# http://opensource.org/licenses/MIT.

layout: base-core
lang: en
id: bitcoin-core-about-site
columns: 1
title: About Site - Bitcoin Core
breadcrumbs:
  - bitcoin
  - bcc
  - About site
---

# About the Bitcoin Core pages on Bitcoin.org

Bitcoin.org hosts several pages about Bitcoin Core as well as the
[Bitcoin Core downloads][bcc download], but the Bitcoin.org and Bitcoin
Core open source projects are run by separate teams.

## History

Bitcoin.org was originally used by [Satoshi Nakamoto][] to host his
[Bitcoin paper][bitcoinpdf]. Soon after, it began linking to
downloadable versions of the original Bitcoin software, making it the
homepage for the Bitcoin program.

New educational content about Bitcoin was added to Bitcoin.org over
time, but that home page remained even when the name of the original
program was changed to Bitcoin Core.

In the years since, the amount of content on Bitcoin.org has continued
to increase.  There's more content about Bitcoin Core than ever before
and also more content about other Bitcoin software and resources.

## Separation of concerns

As of Dec 2015, Bitcoin.org has 876 pages in 25 different languages,
but fewer than 100 of those pages belong to Bitcoin Core. The Bitcoin
Core project has no control over those non-Core pages or any polices
enacted on them.

Likewise, content provided through the Bitcoin Core pages is not
necessarily endorsed or supported by the Bitcoin.org contributors.

## Maintenance

Pull requests and issues directly relating to Bitcoin Core are tagged as
*[Core][core github tag]* in the Bitcoin.org repository.

{% include references.md %}


text:
# Protected.design
Protected.design uses Vue.js on the front-end. It communicates through REST API with the barebones Wordpress PHP + MySQL back-end.

To generate a SHA-256 hash, it uses CryptoJS library. It then sends the hash (and the message, if provided by the user) to a separate dedicated Linux server to generate Ethereum raw transaction and sign it offline using php-eth-raw-tx tool. Generated tx hex is returned to Protected.design and then broadcasted through Etherscan's API to the Ethereum blockchain.

Server that does the tx signing contains the private key and other sensitive information. It is not a part of this repository.

## How to run the app? ##

1. Install fresh Wordpress on your Apache web server.
2. Upload Protected.design folder from this repository to your Wordpress /wp-content/themes/ folder.
3. Update /setup/_auth.php and /setup/_auth.js files with your credentials.
4. Open /setup/create_db.php file in your browser. It will create the necessary database tables.
5. Activate Protected.design theme in your Wordpress settings.
6. Create a new empty page. Select Protected.design template and set it as a default Homepage in your Wordpress settings.

You can then use a preferred solution to sign transaction offline. Transaction hex should be returned to the app's broadcast_tx/tx endpoint with the correct auth token. Then the tx will be automatically broadcasted by the app to the Ethereum blockchain.

check_donations.php file is set to */4 cron and is checking donation address balance for incoming transactions. If someone donates any amount greater than 0.001 ETH, the script initiates a grouped protection. Grouped protection is also initiated on every Sunday GMT 00:00.

For payment processing Protected.design uses Cardinity service and its PHP library.


text:
# Httpprefix-remover

 This PHP script displays a form where you can submit a list of urls and it will remove first ocurrence in each line of prefix (http:// , http:// , http://www. , https://www.) but it keeps rest of ocurrences per line. (Script name: batch http?://??? remover.)

Examples usage:

upload php file to server, and fill form with urls you want to modify.

COLLABORATIONS:

Collaborations to improve script are always welcome.