text:
# Geomagnetically induced currents in Austria (GEOMAGICA)

Project GEOMAGICA has been an FFG-funded project conducted in Austria with contributions from international partners. The aim was to model the nature of geomagnetically induced currents (GICs) in Austria and provide predictions or warnings of areas in the power grid particularly at risk. Details on the Austrian power grid cannot be provided, so the modelling code has instead been applied here to an example grid taken from the literature. Geoelectric fields induced by geomagnetic variations are modelled using a thinsheet approximation that includes information on the lateral surface and layered subsurface resistivity. From a given geoelectric field, the GICs in the network are computed using the Lehtinen-Pirola method.

## Basic usage

Requires some standard scientific Python packages and a FORTRAN compiler.

To run the most basic example using the Horton (2012) example grid and a 1 V/km geoelectric field in the N and E components, then print the results:

```
python GIC_Model_Horton.py
```

Instructions on how to run the scripts for more complex models are included in GUN_RUN.sh. The only non-intuitive part is the compilation of the thinsheet FORTRAN code, which may need an option for legacy code:

```
gfortran -std=legacy -g thinsheet/nonuni_short_2d.f thinsheet/anomal.f thinsheet/seidel_new.f90 thinsheet/newmodel.f -o thinsheet.exe
```

The thinsheet code should be run with input files specified:

```
./thinsheet.exe <DBDT-FILE> <PERIOD> <1DMODEL-CODE> <2DMODEL-FILE>
OR
./thinsheet.exe dB_2017-09-07T23:25:00.txt 300 39 ts_aerosq1000.txt
```

## Modelling GIC - GIC_Model_Horton.py

This script uses the original method devised by Lehtinen and Pirjola (see 1985 paper) for computing the amount of GIC flowing between a grounded conductive network (such as a power grid) and the Earth.

In this example, the example network provided in the Horton et al. (2012) paper is used for testing purposes.

### Input

* **Efiles/E_\<1DMODEL\>_\<DATETIME\>.txt** - Coming soon.

## Thinsheet code - thinsheet.exe

This program takes a file describing the geomagnetic variations in a region, a 1D subsurface resistivity layer model and a 2D surface thinsheet model to compute the induced geoelectric field in the region. It is based off of the formulae derived in the Vasseur and Weidelt (1977) paper and this particular code was developed by P. Weidelt and later adapted by British Geological Survey researchers for modelling regions in Britain. This has been adapted to work in Austria.

### Code

* **nonuni_short_2d.f** is where the main computation happens and contains most of the algorithm. Geomagnetic variation data is read directly from the folder dBfiles/dB_\<DATETIME\>.txt, and output geoelectric field is written to folder Efiles/E_\<1DMODEL\>_\<DATETIME\>.txt.
* **anomal.f** reads in the thinsheet surface conductivity model stored under condmodels/ts_\<2DMODEL\>.txt and returns it to the main code.
* **newmodel.f** reads in the layered subsurface resistivity model stored under condmodels/layers_\<1DMODEL\>.txt and returns it to the main code.
* **seidel_new.f90** determines the solution of the integral equations (see Vasseur and Weidelt 1977 paper) using the Gauss-Seidel iteration method. (Old version **seidel.f** is also included.)

### Setting parameters

The parameters required for determining how thinsheet.exe executes are listed in the file *thinsheet_Parameters.txt*. Below is a description of each parameter:

```
 10000.0                # DX, dimension of square cells in the thinsheet in m
 42                     # NX, number of cells in the x (North-South) direction
 65                     # NY, number of cells in the y (East-West) direction
 5.37                   # X_INC, cell spacing in x direction in arcmin
 8.08                   # Y_INC, cell spacing in y direction in arcmin
 0.0                    # ZA, depth of thinsheet, 0 for sheet at surface
 0.0                    # ZD, depth of data level, 0 for surface
 49.81                  # NBOUND, northern boundary of data in lat
 46.05                  # SBOUND, southern boundary of data in lat
 17.85                  # EBOUND, eastern boundary of data in lon
 9.1                    # WBOUND, western boundary of data in lon
 6                      # NITER, iteration count, usually converges after 5 in this case
 10                     # NL, number of layers in resistivity layers
 20.0                   # TAUN, conductance of thinsheet outside the anomalous domain
```

Note that the last two parameters are read in the *newmodel.f* subroutine. The others are read in the main code *nonuni_short_2d.f*.

### Input files

* **dBfiles/dB_\<DATETIME\>.txt** - should contain *NX x NY* lines for the geomagnetic variations (in the northward and eastward directions) over each cell. These variations should be in nT per period, with the period *P* defined when calling *thinsheet.exe*. In the example file *dB_2017-09-07T23:25:00.txt*, variations from September 7 2017 were used as these were larger than usual. The original data was filtered down to 300 s to calculate the dB/dt value over the time window. The result is 24.5 nT/300s in X and 31.9 nT/300s in Y, which is assumed to be constant across the whole region. The grid used is *42 x 65*, roughly 10 x 10 km, resulting in 2730 cells.
* **condmodels/ts_\<2DMODEL\>.txt** - this contains the "thinsheet" in conductance S. The example provided, *ts_aerosq1000.txt*, is the inhomogeneous model based off aerogeomagnetic measurements conducted in Austria of the surface conductivity projected onto a hydrogeological map of Austria (see Schattauer et al. 2017). The same shape constraints apply as with the dB/dt values, and the grid of *NX x NY* cells must be provided in the same format.
* **condmodels/layers_\<1DMODEL\>.txt** - contains 1D information on the resistivity of the Earth in layers. The values for Austria in *layers_austria.txt* were taken from the European Rho Model EURHOM (see Adam et al. 2012). For additional tests, a model of Quebec is also included in *layers_quebec.txt*. Here, the layers are defined as *D* and *RHO*, so the first column (after the layer numbers) is thickness in m followed by resistivity in Ohm. EURHOM model 39 (third set of columns), for example, has a top layer thickness of 55 km with a resistivity of 1000 Ohm. Below that is a layer with thickness 45 km and a resistivity of 300 Ohm, and so on...

### Output files

* **Efiles/E_\<1DMODEL\>_\<DATETIME\>.txt** - the output is written in the same grid format as the input dB/dt and thinsheet files, assuming that the cell numbers and cell spacings were defined correctly in the thinsheet parameters.

## Resources

1. Adam, A., E. Pracser, and V. Wesztergom (2012), Estimation of the electric resistivity distribution (EURHOM) in the European lithosphere in the frame of the EURISGIC WP2 project, Acta Geodaetica et Geophysica Hungarica, 47 (4), 377–387, doi:10.1556/AGeod.47.2012.4.1.

2. Horton, R., D. Boteler, T. J. Overbye, R. Pirjola, and R. C. Dugan (2012), A test case for the calculation of geomagnetically induced currents, IEEE Transactions on Power Delivery, 27 (4), 2368–2373.

3. Lehtinen, M., and R. Pirjola (1985), Currents produced in earthed conductor networks by geomagnetically-induced electric fields, Annales Geophysicae, 3, 479–484.

4. Schattauer, I., A. Römer, R. Bailey, R. Leonhardt, K. Motschka, R. Supper, and A. Schiller (2017), Lateral conductivity variations within Austria and its surroundings by extrapolating airborne electromagnetic data, 2nd European Airborne Electromagnetics Conference 2017, Held at Near Surface Geoscience Conference and Exhibition 2017, pp. 136–140.

5. Vasseur, G., and P. Weidelt (1977), Bimodal electromagnetic induction in non-uniform thin sheets with an application to the northern Pyrenean induction anomaly, Geophysical Journal International, 51 (3), 669–690.

## Authors

* **P. Weidelt** - developer of the thinsheet approximation algorithm
* **C. Beggan, K. Turnbull, A. Mckay** (BGS) - adapted and provided the original code
* **R. Bailey** - adapted said code to region of Austria

<!---## License

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

repository: bairaelyn/GEOMAGICA

repo_name: bairaelyn/GEOMAGICA


text:
XAudio2 in C Demo
=================

A small example of using the Windows XAudio2 API in C.

I found documentation on how to use XAudio2 in C essentially non-existent, so I put together this demo in the hope it might save others some trouble. The code is all in a single, heavily-commented file, `xaudio2-c-demo.c`.

To build, run `build.bat` from a shell with [cl](https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-160) set up (or in your favorite IDE with the audio file `sound.wav`).

Asset Credit
------------

Jumping sound effect from: https://groovymaster.itch.io/groovys-50-retro-sound-effects-package

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# flight app

## Installation

```
npm install & bower install
```

## Static file server

A local installation of [Grunt](http://gruntjs.com) provides a Node-based
foundation for running development and build tasks.

The watch task serves the contents of the 'app' directory on
`http://localhost:3080/`, and watches files for changes. Browser Sync
automatically refreshes the browser tab when files are changed.

```
grunt serve
```

Additional tasks can be included in the `Gruntfile.js`. For further information
about using Grunt, please refer to the [Grunt website](http://gruntjs.com/).

## Unit tests

A local installation of Karma is used to run the JavaScript unit tests.
Karma makes it easy to watch files and run unit tests in real browsers:

```
grunt
```

This is the recommended approach because the moment your unit tests start
failing, you'll be notified in the terminal.

For further information about configuring Karma, please refer to the [Karma
website](http://karma-runner.github.io/).

## Contributing to this project

Anyone and everyone is welcome to contribute.

repository: DeloitteDigitalUK/DDFlightGenerator

branch_name: refs/heads/flight-gen

gha_language: JavaScript

repo_name: DeloitteDigitalUK/DDFlightGenerator


text:
---
layout: post
title: "Apache Maven Surefire Plugin Version 3.0.0-M6 Released"
date: 2022-04-04 17:33:33
comments: true
categories: [Neuigkeiten,BM,Maven,Maven-Plugins,Maven-Plugin-Releases]
---
The Apache Maven team is pleased to announce the release of the
[Apache Maven Surefire Plugin, version 3.0.0-M6](https://maven.apache.org/plugins/maven-surefire-plugin/).

The release contains 111 bug fixes.
Again we received contributions from the community in form of bug reports
and bug fixes. Thank you and keep them coming!

You should specify the version in your project's plugin configuration:

```xml
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>3.0.0-M6</version>
</plugin>
```

or for failsafe:

```xml
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <version>3.0.0-M6</version>
</plugin>
```

or for surefire-report:

```xml
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-report-plugin</artifactId>
  <version>3.0.0-M6</version>
</plugin>
```

You can download the appropriate [sources etc. from the download page](https://maven.apache.org/surefire/download.cgi).

<!-- more -->

[Release Notes - Maven Surefire - Version 3.0.0-M6](https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12344613&styleName=Text&projectId=12317927)

* Bugs:

  * {%ajl SUREFIRE-1398 %} - TestNG test fails when both JUnitCore provider and TestNG provider are on classpath
  * {%ajl SUREFIRE-1426 %} - Fork crash doesn't fail build with -Dmaven.test.failure.ignore=true
  * {%ajl SUREFIRE-1432 %} - trimStackTrace = false by default
  * {%ajl SUREFIRE-1556 %} - Test XML file is not valid when rerun "fails" with an assumption
  * {%ajl SUREFIRE-1659 %} - Log4j logger in TestExecutionListener corrupts Surefire's STDOUT.
  * {%ajl SUREFIRE-1800 %} - SurefireForkChannel binds to wrong IP
  * {%ajl SUREFIRE-1806 %} - Site: Link to "TCP/IP Communication between Forks" is broken
  * {%ajl SUREFIRE-1809 %} - Differences between Oracle JDK and AdoptOpenJDK caused by JPMS
  * {%ajl SUREFIRE-1815 %} - Thread interrupted state cleared on any console output
  * {%ajl SUREFIRE-1820 %} - Using SurefireForkNodeFactory with JDK8 results in NoSuchMethodError
  * {%ajl SUREFIRE-1840 %} - Why sudo docker?
  * {%ajl SUREFIRE-1842 %} - Surefire - NPE at end of successful test run
  * {%ajl SUREFIRE-1844 %} - Trademarks / privacy policy footer displays broken
  * {%ajl SUREFIRE-1851 %} - NPE in SmartStackTraceParser causes false positive test results
  * {%ajl SUREFIRE-1857 %} - JUnit 5 report does not contain assertion failure message
  * {%ajl SUREFIRE-1865 %} - ChecksumCalculator getSha1 does not compute checksums correctly
  * {%ajl SUREFIRE-1869 %} - Classloader.getResource() doesn't encode blanks with forkCount=0
  * {%ajl SUREFIRE-1881 %} - Java agent printing to native console makes build block when using SurefireForkNodeFactory
  * {%ajl SUREFIRE-1882 %} - Fix failures when compiled on Java 9+ and run on Java 8
  * {%ajl SUREFIRE-1890 %} - Not compatible with TestNG 7.4.0
  * {%ajl SUREFIRE-1894 %} - Surefire report XML schema is incomplete (attribute version not allowed in testsuite)
  * {%ajl SUREFIRE-1909 %} - Support JUnit 5 reflection access by changing add-exports to add-opens
  * {%ajl SUREFIRE-1910 %} - Missleading error message when using -Dtest=....
  * {%ajl SUREFIRE-1912 %} - user.dir should not be set lazily within the surefire fork JVM
  * {%ajl SUREFIRE-1913 %} - system properties should be restored after the in-process tests have been executed
  * {%ajl SUREFIRE-1914 %} - XML report omits method signature / display name of Junit 5 parameterized tests if testset reporter is configured to use phrased naming
  * {%ajl SUREFIRE-1926 %} - Console logs should be synchronized
  * {%ajl SUREFIRE-1935 %} - Upgrade to JUnit Platform 1.8, start Launcher via LauncherSession
  * {%ajl SUREFIRE-1945 %} - crashed tests - unit tests with large logging output does not produce surefire report
  * {%ajl SUREFIRE-1967 %} - High resource consumption when executing TestNG tests in parallel mode with a suite file
  * {%ajl SUREFIRE-1975 %} - JDK18 - The Security Manager is deprecated and will be removed in a future release
  * {%ajl SUREFIRE-1982 %} - Fix failures (java.nio.ChartBuffer) when compiled on Java 9+ and run on Java 8
  * {%ajl SUREFIRE-1983 %} - Corrupted STDOUT by directly writing to native stream in forked JVM 1. [setupJunitLogger() should be called AFTER startCapture()]
  * {%ajl SUREFIRE-1990 %} - The previous XML report should be deleted before new run or re-run
  * {%ajl SUREFIRE-1993 %} - Failsafe fails to detect module dependencies
  * {%ajl SUREFIRE-2002 %} - TCP client throws WritePendingException
  * {%ajl SUREFIRE-2006 %} - Don't use Services Transformer in shadefire
  * {%ajl SUREFIRE-2023 %} - The integration test Surefire946KillMainProcessInReusableForkIT hanged and timed out because SIGTERM happened before the first test has started. The plugin should be able to terminate itself whenever after SIGTERM.
  * {%ajl SUREFIRE-2036 %} - Regression: 3.0.0-M5 fails with configured JUnit 5 provider
  * {%ajl SUREFIRE-2040 %} - No tests executed with junit-platform-suite and -Dtest=TestSuite

* New Features:

  * {%ajl SUREFIRE-756 %} - Allow ability to capture executed random runOrder for re-play purposes
  * {%ajl SUREFIRE-1854 %} - Support include/exclude junit test engine
  * {%ajl SUREFIRE-1860 %} - extend ReportEntry interface and SimpleReportEntry with mandatory properties runMode:String, testRunId:long
  * {%ajl SUREFIRE-1878 %} - Add failOnFlakeCount option
  * {%ajl SUREFIRE-1893 %} - New maven-surefire JUnit5 extension by Fabricio Yamamoto
  * {%ajl SUREFIRE-1964 %} - Method filtering support on excludes and includes file

* Improvements:

  * {%ajl SUREFIRE-1824 %} - failsafe-summary.xml should properly use UTF-8
  * {%ajl SUREFIRE-1825 %} - Unable to zip the Cucumber TXT report file on Linux and MacOS
  * {%ajl SUREFIRE-1826 %} - Improved performance of ThreadedStreamConsumer
  * {%ajl SUREFIRE-1827 %} - The console output is not flushed
  * {%ajl SUREFIRE-1845 %} - Fixed the performance of Utf8RecodingDeferredFileOutputStream as a bottleneck for the tests with logs
  * {%ajl SUREFIRE-1846 %} - Remove Base64 in the Encoder/Decoder and gain the performance for the communication flow: Fork to Plugin
  * {%ajl SUREFIRE-1847 %} - Remove Base64 in the Encoder/Decoder and gain the performance for the communication flow: Plugin to Fork
  * {%ajl SUREFIRE-1853 %} - Clarify useModulePath documentation
  * {%ajl SUREFIRE-1856 %} - Updated documentation for the TestNG Provider - may not disable JUnit in suiteXmlFiles
  * {%ajl SUREFIRE-1858 %} - Change default debug options to not use legacy options
  * {%ajl SUREFIRE-1954 %} - move inner class ProviderList to upper level
  * {%ajl SUREFIRE-1955 %} - Switch project to Java 8
  * {%ajl SUREFIRE-1957 %} - Get rid of maven-artifact-transfer
  * {%ajl SUREFIRE-1958 %} - Replace fest-assert by AssertJ
  * {%ajl SUREFIRE-1959 %} - Update plugin (requires Maven 3.2.5+)
  * {%ajl SUREFIRE-1965 %} - Refactor beanshell script in project
  * {%ajl SUREFIRE-1972 %} - Use current version of surefire-shared-utils
  * {%ajl SUREFIRE-1987 %} - Refactor ProviderDetector#autoDetectOneWellKnownProvider
  * {%ajl SUREFIRE-1992 %} - Increase output length of test errors/failures in summary
  * {%ajl SUREFIRE-1994 %} - Upgrade and configure javacc-maven-plugin in module surefire-grouper
  * {%ajl SUREFIRE-1995 %} - Ping and process checker should use isolated schedulers and the errors should be logged
  * {%ajl SUREFIRE-1997 %} - InterruptedIOException and cause:InterruptedException have the same purpose and should be caught in CommandReader
  * {%ajl SUREFIRE-1998 %} - Interrupted PPID Checker should have the same meaning as stopped PPID Checker
  * {%ajl SUREFIRE-1999 %} - PPID checker should redirect the error stream of the checker command to a dump file
  * {%ajl SUREFIRE-2005 %} - Improved dump message "Boot Manifest-JAR contains absolute paths in classpath" with exception message
  * {%ajl SUREFIRE-2009 %} - Refactoring of surefire-junit3. JUnitTestSetExecutor and PojoTestSetExecutor should be stateless.
  * {%ajl SUREFIRE-2011 %} - Updated abstractions which helps associating standard out/err with a test
  * {%ajl SUREFIRE-2012 %} - Use maven-shared-utils instead of surefire-shared-utils in Report Parser. Removed commons-lang in Report Plugin.
  * {%ajl SUREFIRE-2014 %} - Implement testRunId and RunMode in the EventEncoder and EventDecoder
  * {%ajl SUREFIRE-2015 %} - Implement testRunId and RunMode in the SimpleReportEntry
  * {%ajl SUREFIRE-2016 %} - The MOJO parameter testSourceDirectory is used only in the TestNG HTML, and it should be optional. Javadoc and documentation should be fixed.
  * {%ajl SUREFIRE-2017 %} - Unstable build with ParallelParameterized
  * {%ajl SUREFIRE-2019 %} - ThreadedStreamConsumer - use Thread.join() instead of CountDownLatch.await()
  * {%ajl SUREFIRE-2020 %} - Use addShutDownHook() from maven-shared-utils
  * {%ajl SUREFIRE-2021 %} - Commands should be flushed immediately. Use Channels.newChannel() instead of newBufferedChannel(). Delete the old flushing mechanism on forked processes.
  * {%ajl SUREFIRE-2024 %} - Replace testng-junit5 by testng-engine in tests and documentation
  * {%ajl SUREFIRE-2025 %} - Updated abstractions which helps associating systemProperties() with a test context
  * {%ajl SUREFIRE-2026 %} - Improve assertions in Surefire1787JUnit5IT
  * {%ajl SUREFIRE-2031 %} - Both fields/parameters "includes" and "excludes" should be in target MOJO class. User properties should be unique.
  * {%ajl SUREFIRE-2042 %} - Remove unused method TestListResolver#getWildcard
  * {%ajl SUREFIRE-2046 %} - Resolved TODOs. Updated callbacks ForkedProcessPropertyEventListener and ForkedProcessStandardOutErrEventListener.
  * {%ajl SUREFIRE-2051 %} - Propagate `ArtifactResolutionException` while resolving artifacts in `SurefireDependencyResolver`
  * {%ajl SUREFIRE-2052 %} - Handles internal exceptions do not have suppressed exceptions in ThreadedStreamConsumer

* Test:

  * {%ajl SUREFIRE-1922 %} - Fixed internal tests after SUREFIRE-1921

* Wish:

  * {%ajl SUREFIRE-1908 %} - Wish by Stackoverflow - Documented strategy with parallel Java packages

* Tasks:

  * {%ajl SUREFIRE-1807 %} - Shadefire should not duplicate entries in Provider SPI
  * {%ajl SUREFIRE-1889 %} - Support Java 16 in Surefire Integration Tests

* Dependency upgrades:

  * {%ajl SUREFIRE-1785 %} - Upgrade Maven Artifact Transfer to Version 0.13.1
  * {%ajl SUREFIRE-1850 %} - Unnecessary dependency incorrectly resolved in certain phases
  * {%ajl SUREFIRE-1886 %} - Upgrade plexus-java to Version 1.0.6
  * {%ajl SUREFIRE-1921 %} - Upgrade Doxia to Version 1.10
  * {%ajl SUREFIRE-1924 %} - Upgrade plexus-java to Version 1.0.7
  * {%ajl SUREFIRE-1937 %} - Upgrade Apache commons-io to Version 2.11.0
  * {%ajl SUREFIRE-1938 %} - Upgrade Apache commons-compress to Version 1.21
  * {%ajl SUREFIRE-1968 %} - Bump maven Plugin Tools to 3.6.2
  * {%ajl SUREFIRE-1974 %} - Upgrade plexus-java to Version 1.1.0
  * {%ajl SUREFIRE-1977 %} - Upgrade com.google.code.findbugs:jsr305 from 2.0.3 to 3.0.2
  * {%ajl SUREFIRE-1979 %} - Upgrade doxiaSitetoolsVersion from 1.9.2 to 1.11.1
  * {%ajl SUREFIRE-1980 %} - Upgrade Apache commons-lang3 to 3.12.0
  * {%ajl SUREFIRE-1981 %} - Upgrade Apache maven-shared-utils to 3.3.4
  * {%ajl SUREFIRE-1989 %} - Update maven-common-artifact-filters to Version 3.1.1
  * {%ajl SUREFIRE-1996 %} - Upgrade plexus-java to Version 1.1.1
  * {%ajl SUREFIRE-2003 %} - Upgrade Maven Reporting to 3.1.0
  * {%ajl SUREFIRE-2008 %} - Upgrade animal-sniffer-maven-plugin to 1.21
  * {%ajl SUREFIRE-2038 %} - Upgrade Maven Parent to 35

Enjoy,

-The Apache Maven team

repository: khmarbaise/octopress

gha_language: Ruby

repo_name: khmarbaise/octopress


text:
# Damn-Vulnerable-Bank

**Guide:** https://rewanthtammana.com/damn-vulnerable-bank/

## About application
Damn Vulnerable Bank Android Application aims to provide an interface for everyone to get a detailed understanding with internals and security aspects of android application.

## How to Use Application
- Clone the repository and run the [Backend Server](https://github.com/rewanth1997/Damn-Vulnerable-Bank/tree/master/BackendServer) as per instructions in the link.
- We have released the Apk so after downloading install it via adb or manual.
- After Installation open the App and add Backend IP in Homescreen
- Test running status by pressing health check
- Now create an account by signup option and then login with your credentials
- Now you can see the dashboard and perform banking operations
- Login as admin to approve beneficiary
- The database is pre-populated with a few users for quick exploration.

|  Username |  Password |  Account Number | Beneficiaries | Admin privileges |
|---|---|---|---|---|
| user1  | password1  | 111111 | 222222, 333333, 444444 | No |
| user2  | password2  | 222222 | None  | No |
| user3  | password3  | 333333 | None  | No |
| user4  | password4  | 444444 | None  | No |
| admin  | admin  | 999999 | None  | Yes |

## Features
- [x] Sign up
- [x] Login
- [x] My profile interface
- [x] Change password
- [x] Settings interface to update backend URL
- [x] Add fingerprint check before transferring/viewing funds
- [x] Add pin check before transferring/viewing funds
- [x] View balance
- [x] Transfer money
  - [x] Via manual entry
  - [ ] Via QR scan
- [x] Add beneficiary
- [ ] Delete beneficiary
- [x] View beneficiary
- [x] View transactions history
- [ ] Download transactions history

## Building the Apk with Obfuscation

- Go to Build options and select Generate Signed Bundled/Apk
- Then select Apk as option and click next
- Now we need a keystore to sign an apk
- Create a new keystore and remember its password
- After creating select that keystore and enter password
- Now select Build variant as Release and signature version as V2
- Now we can build the apk successfully

## List of vulnerabilities in the application

To keep things crisp and interesting, we hidden this section. Do not toggle this button if you want a fun and challenging experience. Try to explore the application, find all the possible vulnerabilities and then cross check your findings with this list.

  Spoiler Alert

- [x] Root and emulator detection
- [x] Anti-debugging checks (prevents hooking with frida, jdb, etc)
- [ ] SSL pinning - pin the certificate/public key
- [x] Obfuscate the entire code
- [x] Encrypt all requests and responses
- [x] Hardcoded sensitive information
- [x] Logcat leakage
- [ ] Insecure storage (saved credit card numbers maybe)
- [x] Exported activities
- [ ] JWT token
- [x] Webview integration
- [x] Deep links
- [ ] IDOR

## Backend to-do

- [x] Add profile and change-password routes
- [ ] Create different secrets for admin and other users
- [ ] Add dynamic generation of secrets to verify JWT tokens
- [ ] Introduce bug in jwt verification
- [x] Find a way to store database and mount it while using docker
- [X] Dockerize environment

## Authors

Thanks to these amazing people

|   |   |   |
|---|---|---|
| Rewanth Tammana (Rest API)  | [Github](https://github.com/rewanthtammana/)  | [LinkedIn](https://www.linkedin.com/in/rewanthtammana/)  |
| Hrushikesh Kakade (Android App)  | [Github](https://github.com/HrushikeshK/)  | [LinkedIn](https://www.linkedin.com/in/hrushikeshkakade/)  |
| Akshansh Jaiswal (Android App)  | [Github](https://github.com/jaiswalakshansh)  | [LinkedIn](https://www.linkedin.com/in/akshanshjaiswal/)  |

repository: ActorExpose/Damn-Vulnerable-Bank

repo_name: ActorExpose/Damn-Vulnerable-Bank


text:
### ulcerindex

Ulcer Index

#### Syntax

ubique.ulcerindex(x,mode,dim)

#### Description

Ulcer Index of Peter G. Martin (1987). The impact of long, deep drawdowns will have significant
impact because the underperformance since the last peak is squared.

#### Arguments

|Params|Type|Description
|---------|----|-----------
|`x` | array/matrix | asset/portfolio returns
|`mode` | string | drawdown calculation. 'return','geometric' (def: 'return')
|`dim` | number | dimension 0: row, 1: column (def: 0)

#### Examples

```js
var x = [0.003,0.026,0.015,-0.009,0.014,0.024,0.015,0.066,-0.014,0.039];
var xt = [[0.003,0.026],[0.015,-0.009],[0.014,0.024],[0.015,0.066],[-0.014,0.039]];
ubique.ulcerindex(x);
// 0.005263

ubique.ulcerindex(xt,'return',1);
// [ [ 0.006261, 0.004025 ] ]
```

repository: maxto/ubique

repo_name: maxto/ubique


text:
---
title: How to Make a Minimal Reproduction
---

## What is a reproducible test case?

A reproducible test case is a small Gatsby site built to demonstrate a problem - often this problem is caused by a bug in Gatsby or a Gatsby plugin. Your reproducible test case should contain the bare minimum features needed to clearly demonstrate the bug.

## Why should you create a reproducible test case?

A reproducible test case lets you isolate the cause of a problem, which is the first step towards fixing it!

The [most important part of any bug report](https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines#Writing_precise_steps_to_reproduce) is to describe the exact steps needed to reproduce the bug.

A reproducible test case is a great way to share a specific environment that causes a bug. Your reproducible test case is the best way to help people that want to help _you_.

## Steps to create a reproducible test case

- Create a new Gatsby site with a starter, the official `hello-world` starter is a great 'barebones' starting point here: `gatsby new bug-repro https://github.com/gatsbyjs/gatsby-starter-hello-world`
- Add any Gatsby plugins that relate to the Issue. For example, if you're having problems with Gatsby MDX you should install and configure [`gatsby-plugin-mdx`](https://www.gatsbyjs.org/packages/gatsby-plugin-mdx/). Only add plugins that are needed to demonstrate the problem.
- Add the code needed to recreate the error you've seen.
- Publish the code (your GitHub account is a good place to do this) and then link to it when [creating an issue](/contributing/how-to-file-an-issue/).

## Places to develop a reproducible test case

- Locally with a starter: You can start with a [Starter](/docs/starters) locally and then build it on your own machine. Gatsby's official [`hello-world`](https://github.com/gatsbyjs/gatsby/tree/master/starters/hello-world) or [`default`](https://github.com/gatsbyjs/gatsby-starter-default) starter are both good foundations for a reproducible test case.
- Host on CodeSandbox: You can develop a Gatsby site straight from your browser with CodeSandbox using their [Gatsby template](https://codesandbox.io/s/github/gatsbyjs/gatsby-starter-default). CodeSandbox also hosts your site automatically, which can be useful to demonstrate the behavior of your site.

## Benefits of reproducible test cases

- Smaller surface area: By removing everything but the error, you don't have to dig to find the bug.
- No need to publish secret code: You might not be able to publish your main site (for many reasons). Remaking a small part of it as a reproducible test case allows you to publicly demonstrate a problem without exposing any secret code.
- Proof of the bug: Sometimes a bug is caused by some combination of settings on your machine. A reproducible test case allows contributors to pull down your build and test it on their machines as well. This helps verify and narrow down the cause of a problem.
- Get help with fixing your bug: If someone else can reproduce your problem, they often have a good chance of fixing the problem. It's almost impossible to fix a bug without first being able to reproduce it.

repository: gatsbyjs/gatsby-ja

gha_license_id: MIT

repo_name: gatsbyjs/gatsby-ja


text:
# PARSIQ-AXS

In this project we utilize PARSIQ Smart Triggers and Google Spreadsheets integration to track and visualize AXS token transfers on Ethereum and Binance Smart Chain that involves most liquid exchanges.

AXS is an Ethereum token that powers Axie Infinity, a blockchain-based game where players can battle, collect, and build a digital kingdom for their pets. AXS holders can claim rewards for staking their tokens, playing the game, and participating in key governance votes.

The token is available on multiple chains including Ethereum and Binance Smart Chain.

On April 28 2021 the game has made a significant update introducing Ronin Bridge, Axie Infinity Ethereum sidechain.

The contract has since become the crucial link in the Axie Infinity ecosystem and largely contributes to the price action of AXS. With the update the bridge has become the only available option for Axie marketplace, breeding, and morphing contracts.

The idea for the project comes from the fact that on the Binance Exchange the highest earning product in Locked staking is AXS with an estimated APY of 131.25% far outperforming any similar prooduct on the exchange.

![image](https://user-images.githubusercontent.com/66903336/140820286-7b9a6fd7-2635-4095-9783-1931f02ea1ac.png)

In order to justify such returns the company would usually rely on large inflows and minor outflows from the cryptocurrency. Therefore, monitoring the most liquid day-to-day endpoints provides an indicator of the success of the staking solution.

# Triggers

### Trigger for Token transfer from or to Binance Account of SPL or AXS token on Ethereum
Apart from collecting the data from the transaction we collect data using Chainlink and CryptoRank.

```javascript
stream _
from TokenTransfers

where (@from == AXScontract || @to == AXScontract || @from == Binance14 || @to == Binance14) && (@erc20.symbol == "AXS" || @erc20.symbol == "SLP")

process
    let symb = @erc20.symbol
    let cryptorankFiatRate = getRate(symb)
    let fiat_value = @value * cryptorankFiatRate.value
    let fiat_decimals = @erc20.decimals + cryptorankFiatRate.decimals
    let eth_usd_pair = getChainlinkPriceFeedPair("ETH/USD")
    let score_from = getScore(@from)
    let score_to = getScore(@to)
    emit {@action_type, @block_hash, @code_address, @from, @gas_used, @origin, @to, @value, fiat_value, fiat_decimals, eth_usd_pair, @tx_hash, symb, @block_timestamp, @gas_price, score_from, score_to }
end
```

### Trigger for Token transfer from or to Binance Accounts of AXS token on Bsc

```javascript
stream _
from BscBEP20Transfers

where @token.contract == ContractBSC && (@from in BSCdata || @to in BSCdata )

process
  emit { @from, @to, @value, @token, @transaction, @block }
end
```

# User Data

**Primitives**

![image](https://user-images.githubusercontent.com/66903336/140822828-30294eb4-e2d0-40ed-a3a7-e46cc74794bf.png)

![image](https://user-images.githubusercontent.com/66903336/140831152-beb22e53-efe8-45d0-9858-7ff83208e860.png)

**Table**

![image](https://user-images.githubusercontent.com/66903336/140823112-159f545c-bcb1-4177-9f4d-97e7c1eb9a36.png)

![image](https://user-images.githubusercontent.com/66903336/140822678-717d0201-4b88-4ba4-9dd6-378ff47500cf.png)

# Results

### Data and Notebook

* [Binance Smart Chain Data](https://docs.google.com/spreadsheets/d/15TcqKG7zHvXzIhEKgtXlkYvKwdJCZJuSti52J2Q5mNk/edit?usp=sharing)

* [Ethereum Data](https://docs.google.com/spreadsheets/d/1ylJp5Y7eoVZUFRcNT3NapTdZa8b6Zd2geQpWZkEongc/edit?usp=sharing)

* [Python Notebook on Kaggle](https://www.kaggle.com/pavfedotov/parsiq-axs)

## Analysis

### Ethereum Axie Infinity
There are 231 AXS token transactions in our ethereum dataset.
Only 46 are from Ronin and Binance accounts.

![image](https://user-images.githubusercontent.com/66903336/140833808-441336cc-4383-43b4-a40c-067279d44e0a.png)

Meanwhile, the rest 80% are coming to the Ronin and Binance accounts.

![image](https://user-images.githubusercontent.com/66903336/140834230-60f4fdaa-1ebd-4ddd-ba82-ded30833aebc.png)

There are also more transactions to the native staking solution rather than Binance by a factor of 2.

Nevertheless, when we analyze the volume of outflows vs. inflows the sum of outflows dominate.

![image](https://user-images.githubusercontent.com/66903336/140838512-fdd1d2bb-97ab-45e3-98ba-31a70fd61d57.png)

This would indicate more incoming users and one or few significant withdrawals from Binance.

We look at the more granular data and notice that one account is responsible for such bleak snapshot of AXS flows.

![image](https://user-images.githubusercontent.com/66903336/140838840-b8bff3aa-e094-453f-805e-8171dff13f87.png)

We plot full ethereum dataset value of transactions against time.

When plotted the inflows have a lot of spikes and more numerous for Binance.

![image](https://user-images.githubusercontent.com/66903336/140849815-79710dd7-80db-4ae8-8070-70d36c1cf141.png)

While the outflows are more steady.

![image](https://user-images.githubusercontent.com/66903336/140850027-cab9d8b4-02cb-4f46-af99-ffdc9ac723f8.png)

The following picture is very similar for only AXS. With two spikes in Binance outflows against 0 in Ronin Bridge.

![image](https://user-images.githubusercontent.com/66903336/140851348-01692e99-9051-4da4-aa0a-de281140f1d5.png)

We would need to further incorporate more data in our analysis to determine the scope of weekly and monthly flows in AXS token.

### BSC AXS

In our BSC dataset we have 157 observations. The count of transactions is in favour of outflows from Binance Hot Wallets.

![image](https://user-images.githubusercontent.com/66903336/140844882-8a1650fc-ebbf-4913-9605-426e091543fb.png)

Whereas the sum of transferred AXS value out of binance is nearly identical to the inflows.

![image](https://user-images.githubusercontent.com/66903336/140845336-028a5cb7-c38a-483e-9b4b-5ace63128f93.png)

### Comparison of AXS on BSC and Ethereum

The volume of transactions is much greater on Ethereum of AXS than on Binance Smart Chain.

![image](https://user-images.githubusercontent.com/66903336/140845836-17679545-5f28-4065-bd0f-1597593be00f.png)

### Score of the addresses (in-built PARSIQ function)

In our AXS dataset on Ethereum we also obtained scores for addresses by using `getScore` in our trigger.

What is interesting is that the system scores higher the Binance account (85) rather than Ronin Bridge (76).

Besides, the average address that transacts to Ronin has score of 79. For Binance this figure is 80.
For outflows the number is 79 for Ronin and 77 for Binance.

# Further Resources

* [CryptoPunks with PARSIQ Github Repository](https://github.com/Pfed-prog/PARSIQ-CryptoPunks)
* [Axie Infinity Great Migration FAQ](https://www.notion.so/axie/Great-Migration-FAQ-fc64fd460c8046b2a45d8798d06c0feb)
* [This Project as a blog post](https://dspyt.com/blockchain-insights-with-parsiq-triggers-for-axie-infinity/)

repository: Pfed-prog/PARSIQ-AXS

branch_name: refs/heads/main

repo_name: Pfed-prog/PARSIQ-AXS


text:
# Sennheiser HD 660 S
See [usage instructions](https://github.com/jaakkopasanen/AutoEq#usage) for more options and info.

### Parametric EQs
In case of using parametric equalizer, apply preamp of **-6.7dB** and build filters manually
with these parameters. The first 5 filters can be used independently.
When using independent subset of filters, apply preamp of **-6.7dB**.

| Type    | Fc      |     Q | Gain    |
|:--------|:--------|:------|:--------|
| Peaking | 25 Hz   |  0.37 | 6.2 dB  |
| Peaking | 167 Hz  |  0.65 | -2.5 dB |
| Peaking | 1643 Hz |  1.9  | -1.8 dB |
| Peaking | 2629 Hz |  2.31 | 1.5 dB  |
| Peaking | 5812 Hz |  2.21 | 3.6 dB  |
| Peaking | 82 Hz   |  6.59 | 0.6 dB  |
| Peaking | 808 Hz  |  3.12 | 0.8 dB  |
| Peaking | 1103 Hz |  3.87 | -0.5 dB |
| Peaking | 6740 Hz | 10.47 | 2.1 dB  |
| Peaking | 7994 Hz |  2.21 | -1.0 dB |

### Fixed Band EQs
In case of using fixed band (also called graphic) equalizer, apply preamp of **-7.5dB**
(if available) and set gains manually with these parameters.

| Type    | Fc       |    Q | Gain    |
|:--------|:---------|:-----|:--------|
| Peaking | 31 Hz    | 1.41 | 6.7 dB  |
| Peaking | 62 Hz    | 1.41 | 2.4 dB  |
| Peaking | 125 Hz   | 1.41 | -1.1 dB |
| Peaking | 250 Hz   | 1.41 | -1.7 dB |
| Peaking | 500 Hz   | 1.41 | -0.0 dB |
| Peaking | 1000 Hz  | 1.41 | -0.4 dB |
| Peaking | 2000 Hz  | 1.41 | -1.0 dB |
| Peaking | 4000 Hz  | 1.41 | 2.3 dB  |
| Peaking | 8000 Hz  | 1.41 | 1.0 dB  |
| Peaking | 16000 Hz | 1.41 | -0.2 dB |

### Graphs
![](https://raw.githubusercontent.com/jaakkopasanen/AutoEq/master/results/innerfidelity/sbaf-serious/Sennheiser%20HD%20660%20S/Sennheiser%20HD%20660%20S.png)

path: /results/innerfidelity/sbaf-serious/Sennheiser HD 660 S/README.md


text:
---
title: "Welcome to my blog"
date: 2019-01-20
---

# A lot has happened.
## Let's get caught up.
***
Hi there. Please allow me to introduce myself.

My name is **Matt**, and I live in *Vail, Colorado*.

I love exploring, traveling, camping, road tripping, and getting lost. I excellent beard-growing skills, and I have an amazing cookie recipe that you can't have.
But, if you ask nicely, I might make you some cookies.

Once upon a time I graduated from CSU with a B.A. in sociology. After considering my options, I chose one winter in Vail over Grad School.
I moved here for that one winter about eight years ago, and then summer happened. And camping, fishing, climbing, rafting, and hiking. And then one more winter happened. And so on.

I love living in the mountains.
On one side I live in a tourist community, a rich variety of priveledged people and a huge ski resort that has sustained me financially and recreationally.

I've worked in restaurants my entire adult life.
I love making food and creating amazing drinks. I love meeting new people and hearing their stories.
I love creating experiences.

And then, the COVID-19 pandemic happened last March. Life as we knew it came to a screeching halt.
Everything closed down. The chairlifts stopped. The restaurants and bars closed. At first it was for a couple of weeks, which slowly turned into months.
I was out of work with a lot of free time on my hands and nothing to really "do".

So I started taking online classes, because why not.
The first class I signed up for was edX's CS50 at Harvard with David Malan. At first I chipped away at the videos, trying to understand what was going on.
I had a lot of catching up to do, and that I did. I made it halfway through the course when the restaurants re-opened in May.

When we first re-opened, social distancing and mask wearing was being invented.

It was horrible.

People were insane.

We were asking for consideration, and literally got spit at.

I asked my boss if I could work only 2 dinner shifts a week to stay afloat and not drain my savings in one go.

I signed up for Codecademy Pro in July, and committed myself to learn how to make web pages.
I loved learning to code so much, and I could see myself being immensely happier doing it for a living.

And so I started down this long and windy road.

Now, I spend every day in front of the computer, soaking in all I can. And I'm so happy doing it.

My curriculum is a blend of concurrent web development programs from Codecademy, Udemy (Brad Traversy & Angela Yu, among others), FreeCodeCamp, MDN, and Sololearn on mobile.
I've found that utilizing multiple sources fills in a lot of small holes in my understanding.

It's taking longer this way, compared to College or a Boot Camp, but I fully intend to have a deep and rich understanding of what I'll be doing as a Developer.

The learning process is a learning process in and of itself. At first, I cruised through HTML and CSS and jumped right into JavaScript.
After stumbling over so many unfinished projects, I had to re-dedicate my full attention to CSS until I had it down.
I still don't, not yet, but I know how to figure out what I don't know.
I'm progressing again with JavaScript, still refining what I know in CSS, and this Spring I plan on moving into Bootstrap and React.

I have a lot to do, so I'd better get back to it. I have to work at the restaurant in a few hours (it is Superbowl Sunday).
Before I go, today I am learning how to use GitHub.

The more I work at it, the more firmly I understand. I've got this.

repository: matthewkohn/github-pages-with-jekyll

repo_name: matthewkohn/github-pages-with-jekyll


text:
# Framework

The Curator Framework is a high-level API that greatly simplifies using ZooKeeper. It adds many features that build on ZooKeeper and handles the complexity of managing connections to the ZooKeeper cluster and retrying operations. Some of the features are:

- Automatic connection management:
  * There are potential error cases that require ZooKeeper clients to recreate a connection and/or retry operations. Curator automatically and transparently (mostly) handles these cases.
- Cleaner API:
  * simplifies the raw ZooKeeper methods, events, etc.
  * provides a modern, fluent interface
- Recipe implementations (see Recipes):
  * Leader election
  * Shared lock
  * Path cache and watcher
  * Distributed Queue
  * Distributed Priority Queue
  * ...

## Allocating a Curator Framework Instance

CuratorFrameworks are allocated using the CuratorFrameworkBuilder which provides both factory methods and a builder for creating instances. IMPORTANT: CuratorFramework instances are fully thread-safe. You should share one CuratorFramework per ZooKeeper cluster in your application.

The factory methods [NewClient()](http://godoc.org/github.com/curator-go/curator#NewClient) provide a simplified way of creating an instance. The Builder gives control over all parameters. Once you have a CuratorFramework instance, you must call the [Start()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.Start) method. At the end of your application, you should call [Close()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.Close).

## CuratorFramework API

The CuratorFramework uses a Fluent-style interface. Operations are constructed using builders returned by the CuratorFramework instance. When strung together, the methods form sentence-like statements. e.g.

```
client.Create().ForPathWithData("/head", []byte{});
client.Delete().InBackground().ForPath("/head");
client.Create().WithMode(curator.EPHEMERAL_SEQUENTIAL).ForPath("/head/child", []byte{});
client.GetData().Watched().InBackground().ForPath("/test");
```

## Methods

- [Create()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.Create)	Begins a create operation. Call additional methods (mode or background) and finalize the operation by calling ForPath() or ForPathWithData()
- [Delete()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.Delete)	Begins a delete operation. Call additional methods (version or background) and finalize the operation by calling ForPath()
- [CheckExists()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.CheckExists)	Begins an operation to check that a ZNode exists. Call additional methods (watch or background) and finalize the operation by calling ForPath()
- [GetData()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.GetData)	Begins an operation to get a ZNode's data. Call additional methods (watch, background or get stat) and finalize the operation by calling ForPath()
- [SetData()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.SetData)	Begins an operation to set a ZNode's data. Call additional methods (version or background) and finalize the operation by calling ForPath() or ForPathWithData()
- [GetChildren()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.GetChildren)	Begins an operation to get a ZNode's list of children ZNodes. Call additional methods (watch, background or get stat) and finalize the operation by calling ForPath()
- [InTransaction()](http://godoc.org/github.com/curator-go/curator#CuratorFramework.InTransaction)	Begins an atomic ZooKeeper transaction. Combine Create, SetData, Check, and/or Delete operations and then Commit() as a unit.

## Notifications

Notifications for background operations and watches are published via the ClientListener interface. You register listeners with the CuratorFramework instance using the addListener() method. The listener implements two methods:

- [EventReceived()](http://godoc.org/github.com/curator-go/curator/#CuratorListener)	A background operation has completed or a watch has triggered. Examine the given event for details

## CuratorEvent

The CuratorEvent object is a super-set POJO that can hold every type of background notification and triggered watch. The useful fields of ClientEvent depend on the type of event which is exposed via the Type() method.

- **CREATE**	    Err(), Path(), Data()
- **DELETE**	    Err(), Path()
- **EXISTS**	    Err(), Path(), Stat()
- **GETDATA**    Err(), Path(), Stat(), Data()
- **SETDATA**    Err(), Path(), Stat()
- **CHILDREN**   Err(), Path(), Stat(), Children()
- **WATCHED**	 WatchedEvent()

## Namespaces

Because a ZooKeeper cluster is a shared environment, it's vital that a namespace convention is observed so that various applications that use a given cluster don't use conflicting ZK paths.

The CuratorFramework has a concept of a "namespace". You set the namespace when creating a CuratorFramework instance (via the CuratorFrameworkBuilder). The CuratorFramework will then prepend the namespace to all paths when one of its APIs is called. i.e.

```
client := &CuratorFrameworkBuilder{Namespace: "MyApp"} ... Build()
 ...
client.Create().ForPathWithData("/test", data)
// node was actually written to: "/MyApp/test"
```

repository: yext/curator

gha_language: Go

repo_name: yext/curator


text:
---
package_name: "jojo-gifs"
package_title: "JoJo GIFs"
package_desc: "Macros for JoJo reaction GIFs imgur URLs"
package_version: "0.1.0"
package_author: "sin3point14"
package_original_repo: "https://github.com/sin3point14/espanso-package-example"
package_repo: "https://github.com/federico-terzi/espanso-hub-core"
is_core: true
---
:angelo -> 🗿
(Why is this here? ¯\\_(ツ)_/¯)

:nice -> https://imgur.com/yFsi2sj

![Niiiiiice](https://i.imgur.com/yFsi2sj.gif)

:omg -> https://imgur.com/OFEhWLt

![Oh My God](https://i.imgur.com/OFEhWLt.gif)

:okmasta -> https://imgur.com/uMt4FVE

![Ok Masta Lets Kil da Ho, Beeeeeetchi](https://i.imgur.com/uMt4FVE.gif)

:relo -> https://imgur.com/92u2qsw

![Relo Relo Relo Relo](https://i.imgur.com/92u2qsw.gif)

:iam -> https://imgur.com/5TGCZO5

![Yes I am!](https://i.imgur.com/5TGCZO5.gif)

:yesomg -> https://imgur.com/5hPKiEm

![Yes Yes Yes Oh My God](https://i.imgur.com/5hPKiEm.gif)

:no -> https://imgur.com/5qV57FJ

![No No No NO](https://i.imgur.com/5qV57FJ.gif)

:yes -> https://imgur.com/SN9R0EG

![Yes Yes Yes YES](https://i.imgur.com/SN9R0EG.gif)

repository: federico-terzi/espanso-hub

repo_name: federico-terzi/espanso-hub


text:
# Creating a Windows Server VM Using ARM APIs

This sample builds on the 'check-name' and 'create-group' ARM samples, which demonstrated how to authenticate
and create a resource group, respectively. Now, it's time to kick it up a notch and do something real, create
a virtual machine within a resource group that we will create.

One thing that will stand out is how much more complex the ARM APIs are than the classic API to create a virtual
machine. This is due to the significantly increased flexibility that ARM provides, and we're examining the low-
level mechanisms here. There is a more efficient way to do the same thing with ARM templates, but it is worth
first understanding all the gory details of creating resources and linking them together.

## The Code Flow

Let's dive right into the code. The main() function doesn't really do any of the real work, it's all been
broken out into its stages, but the logic provides a nice outline of what needs to be done:

1. Create a resource group
2. Create a storage account
3. Create an availability set
4. Create a virtual network and a subnet
5. Create a network interface (NIC) with a public IP address, if applicable.
6. Create the virtual machine

The resources in 1-4 can be shared with other virtual machines, while the resources created in stage 5 are
per-virtual machine the network interface and its associated public IP address are specific to the virtual machine.
To create more than one virtual machine, you have to create another network interface (and public address, if there
should be one).

**Note**: all error-checking code has been removed from the code snippets here, but it is present in the
actual sample source code.

## The Functions
**createResourceGroup()**

This is more or less a repeat of the 'create-group' sample, except that we also register ARM resource providers
that we will be needing later.
```go
	rgc := resources.NewGroupsClient(subscription)
	rgc.Authorizer = spt

	params := resources.ResourceGroup { ame:&name,Location:&location }

	group,err = rgc.CreateOrUpdate(name, params)

	fmt.Printf("Created resource group '%s'\n", *group.Name)
	rpc := resources.NewProvidersClient(subscription)
	rpc.Authorizer = spt

	_,err1 := rpc.Register("Microsoft.Storage")
	...
```
**createStorageAccount()**

This function is similar to the 'check-name' sample, except that it not only checks to see whether a name
is available, it also creates the account if it is. This function takes a while to finish, since creation of a
storage account is an expensive process and can take a minute or so.
```go
	cna, err := ac.CheckNameAvailability(...)

	...

	if to.Bool(cna.NameAvailable) {

		name := *group.Name
		props := storage.AccountPropertiesCreateParameters {
			AccountType: storage.StandardLRS,
		}

		_,err = ac.Create(name, name,
			storage.AccountCreateParameters {
				Name: group.Name,
				Location: group.Location,
				Properties: &props,
			})
	}
```
**createAvailabilitySet()**

Strictly speaking, it doesn't make much sense to use an [availability set](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-manage-availability/)
for a single VM, but most real installations will use more than one virtual machine, and so the code demonstrates how to set it up.

The availability set function is the simplest in the sample. The name is created from the group name, which
simplifies the code a bit. In a real installation, there would be multiple availability sets with fixed names,
typically one for each tier in your service architecture. The name and location of the set are the only parameters
needed to create the set.
```go
	avsc := compute.NewAvailabilitySetsClient(subscription)
	avsc.Authorizer = spt;

	name := *group.Name

	result,err = avsc.CreateOrUpdate(
		name,
		name+"avset",
		compute.AvailabilitySet {
			Location: group.Location,
		})
```

**createNetwork()**

For virutal machines to find each other within the data center, they need to be configured on the same virtual network.
We need to create a vnet and a subnet in order to get everything set up correctly. The details of network configuration
are beyond the scope of this tutorial sample, we're concerned with setting up the right calls only.

The first step is to create the clients, in what should not be a familiar way.
```go
	vnetc := network.NewVirtualNetworksClient(subscription)
	snetc := network.NewSubnetsClient(subscription)

	vnetc.Authorizer = spt;
	snetc.Authorizer = spt;
```
Then, we set up some of the properties data structures that will contain the arguments to the service calls.
```go
	snet := network.Subnet {
		Name: &subnet,
		Properties: &network.SubnetPropertiesFormat {
			AddressPrefix: to.StringPtr("<IP_ADDRESS>/24"),
		},
	}
	snets := make([]network.Subnet, 1, 1)
	snets[0] = snet

	addrPrefixes := make([]string,1,1)
	addrPrefixes[0] = "<IP_ADDRESS>/16"
	address := network.AddressSpace {
		AddressPrefixes: &addrPrefixes,
	}
```
Finally, our code makes the two service calls that we need, one for the vnet, one for the subnet. The subnet is the only data
we'll need to create the virtual machine, so that's what the function returns.
```go
	nwkProps := network.VirtualNetworkPropertiesFormat {
		AddressSpace: &address,
		Subnets: &snets,
	}

	_,err = vnetc.CreateOrUpdate(
		name,
		vnet,
		network.VirtualNetwork {
			Location: group.Location,
			Properties: &nwkProps,
		})

	snetResult, err = snetc.CreateOrUpdate(name, vnet, subnet, snet)
```
**createNetworkInterface()**

With a virtual network and a subnet available, we can now proceed to set up the network interfaces that our virtual machine will
be using to communicate. In our case, we want to be able to communicate with the Windows server from other locations, so we also
need to give the interface a public IP address. The public IP address is not necessary for virtual machines that only need to be reachable from
other machines on the same virtual network.

Once more, we'll need more than one client to get anything done:
```go
	pipc  := network.NewPublicIPAddressesClient(subscription)
	nicc  := network.NewInterfacesClient(subscription)

	pipc.Authorizer = spt;
	nicc.Authorizer = spt;
```

With those in hand, we can set up the public IP address, a fairly simple call:

```go
	pipResult,err := pipc.CreateOrUpdate(
		groupName,
		ipName,
		network.PublicIPAddress {
			Location: group.Location,
			Properties: &network.PublicIPAddressPropertiesFormat {
				PublicIPAllocationMethod: network.Dynamic,
			},
		})
```
and then the network interface itself, which requires a little more parameter setup. The network interface is what we'll need
in order to create a virtual machine, so that's what the function returns.
```go
	nicProps := network.InterfaceIPConfigurationPropertiesFormat {
		PublicIPAddress: &network.SubResource { ID: pipResult.ID },
		Subnet: &network.SubResource { ID: subnet.ID },
	}

	ipConfigs := make([]network.InterfaceIPConfiguration,1,1)
	ipConfigs[0] = network.InterfaceIPConfiguration {
		Name: to.StringPtr(nicName+"Config"),
		Properties: &nicProps,
	}
	props := network.InterfacePropertiesFormat { IPConfigurations: &ipConfigs }

	networkInterface,err = nicc.CreateOrUpdate(
		groupName,
		nicName,
		network.Interface{
			Location: group.Location,
			Properties: &props,
		})
```
**createVirtualMachine()**

The actual virtual machine creation call is fairly straight-forward, but there are a lot of parameters that need to be set up first.
VM creation takes a VirtualMachine object containing a number of distinct 'profiles,' describing what OS image to use, how big a VM to
create, what virtual hard drives to mount, and where to allocate backing storage (this is what the storage account is needed for),
as well as how to configure the machine with an admin user and password. The network interface and availability set are also
identified.

Since a virtual machine may have more than one network interface, the NIC data needs to be passed in a slice:

```go
	netRefs := make([]compute.NetworkInterfaceReference,1,1)
	netRefs[0] = compute.NetworkInterfaceReference{ ID: networkInterface.ID }
```
The rest is just a big document:
```go
	vmParams := compute.VirtualMachine {
		Location: group.Location,
		Properties: &compute.VirtualMachineProperties {
			AvailabilitySet: &compute.SubResource { ID: availSet.ID },
			HardwareProfile: &compute.HardwareProfile { VMSize: compute.StandardA0 },
			NetworkProfile: &compute.NetworkProfile { NetworkInterfaces: &netRefs },
			StorageProfile: &compute.StorageProfile {
				ImageReference: &compute.ImageReference {
					Publisher: to.StringPtr("MicrosoftWindowsServer"),
					Offer: to.StringPtr("WindowsServer"),
					Sku: to.StringPtr("2012-R2-Datacenter"),
					Version: to.StringPtr("latest"),
				},
				OsDisk: &compute.OSDisk {
					Name: to.StringPtr("mytestod1"),
					CreateOption: compute.FromImage,
					Vhd: &compute.VirtualHardDisk {
						URI: to.StringPtr("http://" + accountName + ".blob.core.windows.net/vhds/mytestod1.vhd") },
				},
			},
			OsProfile: &compute.OSProfile {
				AdminUsername: to.StringPtr(adminName),
				AdminPassword: to.StringPtr(adminPassword),
				ComputerName: to.StringPtr(vmName),
				WindowsConfiguration: &compute.WindowsConfiguration {
					ProvisionVMAgent: to.BoolPtr(true),
				},
			},
		},
	}
```

Compared to all that, the actual call is trivial:

```go
	_,err := vmc.CreateOrUpdate(groupName, vmName, vmParams)
```
It's going to take a while to get the virtual machine started. Monitor its progress in the [Azure Portal](http://portal.azure.com)
and when it's done, connect to it using Remote Desktop.

As is the case with all ARM samples here, the easiest way to clean up afterwards is to simply delete the entire resource group.

repository: scotthavird/azure-go-samples

repo_name: scotthavird/azure-go-samples


text:
# print\_bytes

This crate allows printing broken UTF-8 bytes to an output stream as losslessly
as possible.

Usually, paths are printed by calling [`Path::display`] or
[`Path::to_string_lossy`] beforehand. However, both of these methods are always
lossy; they misrepresent some valid paths in output. The same is true when
using [`String::from_utf8_lossy`] to print any other UTF-8–like byte sequence.

Instead, this crate only performs a lossy conversion when the output device is
known to require Unicode, to make output as accurate as possible. When
necessary, any character sequence that cannot be represented will be replaced
with [`REPLACEMENT_CHARACTER`]. That convention is shared with the standard
library, which uses the same character for its lossy conversion functions.

[![GitHub Build Status](https://github.com/dylni/print_bytes/workflows/build/badge.svg?branch=master)](https://github.com/dylni/print_bytes/actions?query=branch%3Amaster)

## Usage

Add the following lines to your "Cargo.toml" file:

```toml
[dependencies]
print_bytes = "1.2"
```

See the [documentation] for available functionality and examples.

## Rust version support

The minimum supported Rust toolchain version is currently Rust 1.63.0.

Minor version updates may increase this version requirement. However, the
previous two Rust releases will always be supported. If the minimum Rust
version must not be increased, use a tilde requirement to prevent updating this
crate's minor version:

```toml
[dependencies]
print_bytes = "~1.2"
```

## License

Licensing terms are specified in [COPYRIGHT].

Unless you explicitly state otherwise, any contribution submitted for inclusion
in this crate, as defined in [LICENSE-APACHE], shall be licensed according to
[COPYRIGHT], without any additional terms or conditions.

[COPYRIGHT]: https://github.com/dylni/print_bytes/blob/master/COPYRIGHT
[documentation]: https://docs.rs/print_bytes
[LICENSE-APACHE]: https://github.com/dylni/print_bytes/blob/master/LICENSE-APACHE
[`Path::display`]: https://doc.rust-lang.org/std/path/struct.Path.html#method.display
[`Path::to_string_lossy`]: https://doc.rust-lang.org/std/path/struct.Path.html#method.to_string_lossy
[`REPLACEMENT_CHARACTER`]: https://doc.rust-lang.org/std/char/constant.REPLACEMENT_CHARACTER.html
[`String::from_utf8_lossy`]: https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8_lossy

gha_language: Rust

gha_license_id: NOASSERTION


text:
# Richard::Cli

Command line interface for accessing richard.

## Installation

Install it yourself as:

    $ gem install richard-cli

## Usage

    Usage:
      richard command [user_id]

    Commands:
      list - List current queue
      grab - Add yourself to the queue
      release - Removes you from the queue
      force_release - Force releases another user.  The user_id must be provided.
      is_it_my_turn - Returns 'Yes' or 'No'. It also returns status code 0 for 'Yes' and -1 for 'No'

## Contributing

1. Fork it ( https://github.com/[my-github-username]/richard-cli/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

repository: nulogy/richard-cli

repo_name: nulogy/richard-cli


text:
# VK to Telegram auto-posting Bot

## Info

* [Vote for next feature to release here](https://github.com/littleguga/vk-to-telegram-bot/issues/1)
* Bot manager with posting to few channels from few groups/users can be found in master branch
* Bot posting only links can be found in link branch
* Bot posting full posts(text and images) can be found in extended branch
* Also you can find answers and help [here](./faq.md)

### Extended version
* Send full post text, all photos and other attachments

### Simple version
* Send text preview or only link to vk post(depends on content(is there text in the post) and on needPostPreview setting)

## Requirements:

* composer require longman/telegram-bot - [sources](https://github.com/akalongman/php-telegram-bot)

## Installation [production]

* !IMPORTANT! you need SSL certificate on your server
* `composer install --no-dev --optimize-autoloader`
* `composer dump-autoload`
* rename Config-sample.php to Config.php
* then configure Config.php
* !IMPORTANT! watch repository for 'config' updates
* add task to cron(usually you have crontab on your server)
    * if you have crontab - run ```crontab -e``` from web user(usually webadmin or www-data)
    * add ```*/5 * * * * cd /var/www/console/telegrambot && php index.php >> /dev/null 2>&1```
    * you should change cd command to path where your bot is located
    * this will run bot every 5 minutes, if you need every minute check - replace ```*/5``` to ```*```
* if you want to clear your logs add task for clear.php with ```php clear.php?clear

## Configuration:

* $configs - array of arrays
    * VK:
        * vk - id of vk user or group to parse(!IMPORTANT! for users you should set only numbers, for groups -numbers(e.g. "1" is id1, "-1" is club1))
    * Telegram:
        * $t_key - bot api key
        * $t_name - bot name
        * $t_chat - chat id/url (e.g. myawesomechannel) (without @)
    * Bot manager:
        * isExtended - use Extended or Simple version of bot
        * needLink - need to append link in extended mode
        * needPostPreview - need to send text preview in simple mode
* Files:
    * $file_log - file to save logs
    * $file_last - file to save last posts

## Links and Copyrights:

* LICENSE: MIT
* Author: [littleguga](https://github.com/littleguga)
* Thanks to [akalongman](https://github.com/akalongman) for [php-telegram-bot](https://github.com/akalongman/php-telegram-bot)

repository: PrptmMobile/vk-to-telegram-bot

repo_name: PrptmMobile/vk-to-telegram-bot


text:
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->

# File and Code Templates

<link-summary>File templates allow generating files and code fragments containing repetitive text and patterns.</link-summary>

<tldr>

**Product Help:** [File and Code Templates](https://www.jetbrains.com/help/idea/settings-file-and-code-templates.html), [File templates](https://www.jetbrains.com/help/idea/using-file-and-code-templates.html), [Templates with multiple files](https://www.jetbrains.com/help/idea/templates-with-multiple-files.html)

</tldr>

The _File templates_ mechanism allows generating files and code fragments containing repetitive text and patterns.
Its main purpose is to relieve users from unnecessary manual work by generating boilerplate code automatically.

File templates can be used to create new project files populated with predefined content like code scaffolds or license headers that are specific to a certain file type and context.
For example, when a new Java class is created in IntelliJ IDEA, the file already contains a class declaration with the provided name and empty body.
File Templates are not limited to creating a single file.
It is possible to create [templates with child/multiple files](https://www.jetbrains.com/help/idea/templates-with-multiple-files.html) used for a set of related files, e.g., model, view and controller classes, at once in an MVC framework.

Another use case is generating code fragments from code intentions and fixes, e.g., adding a test method inside an existing test class or a quick fix for adding a missing interface method implementation.

As file templates are based on [Apache Velocity](https://velocity.apache.org/), their content is not static.
A template can contain dynamic parts based on the context, e.g., project or package name, created entity name, author data, and more.
It is also possible to create custom properties and populate them with the required values.

The contents of all listed file templates can be edited in the IDE settings so that users can adjust them to their specific needs.

These sections describe how to add File and Code Templates, and their associated building blocks, to plugins:
* [](providing_file_templates.md)
* [](using_file_templates.md)

repository: JetBrains/intellij-sdk-docs

gha_language: Markdown

repo_name: JetBrains/intellij-sdk-docs


text:
---
layout: stt
title: Speaking Times Tables
subtitle: Universal device support
bodyclass: stt
date: 2015-10-03 10:50:39
---
{::nomarkdown}

	The first version of the app was designed purely for iPad. However, all of the images in that version have been converted into drawing code. This has made it possible to cater for larger devices without a loss in quality.

	Adding support for the iPad Pro 12 inch created some development issues. Drawing code had to be specifically modified to cater for the bigger size. We also support the iPad Pro 10.5 inch and the iPhone X.

	The app also now supports Touch ID and Face ID, this is optionally available as an alternative to the pin login feature, which restricts access to the settings screens.

{% assign settingicloud = "" %}{% for t in site.stt_userguides %}{% if t.ident == 'sis' %}{% assign settingicloud = t.url %}{% endif %}{% endfor %}

	In order to provide multiple student features, iCloud was required to allow students to share several devices, perhaps an iPhone and iPad. Adding iCloud support was complex and care was taken to provide easy to use features which had flexibility for use in schools.

{% assign sirivoicerecordings = "" %}{% for t in site.stt_features %}{% if t.ident == 'svr' %}{% assign sirivoicerecordings = t.url %}{% endif %}{% endfor %}

	Version 1 of the app had voice recordings, however there was no choice to use Siri. English students can now use Siri or voice recordings. With improvements to Siri, other languages were possible and have been added to the app for use primarily by non English students.

{:/}

		{% include sttdownloadbtn.html %}

{% include sttfeaturespagnation.html %}

repository: JulesMoorhouse/web

gha_language: HTML

repo_name: JulesMoorhouse/web


text:
![Giftoppr](https://github.com/desktoppr/giftoppr/blob/master/app/assets/images/logo.png?raw=true)

[![Build Status](https://travis-ci.org/desktoppr/giftoppr.png?branch=master)](https://travis-ci.org/desktoppr/giftoppr)

### Getting started

You'll first need to grab a Dropbox API key from here: https://www.dropbox.com/developers.

When asked (full dropbox, or single folder only) choose single folder.

Set these env variables

```bash
DROPBOX_KEY=""
DROPBOX_SECRET=""
```

Then:

```bash
brew install postgresql imagemagick
createuser -sPE postgres # Creates the postgres user we use in database.yml

git clone git@github.com:desktoppr/giftoppr.git
cd giftoppr
bundle
rake db:schema:load
rake db:seed # Loads in gifs from ~/Dropbox/Apps/Giftoppr
rails server
```

### Heroku

Ensure environment variables are available during deploys.

```bash
heroku labs:enable user-env-compile
```

Increase maximum database connections to 20

```bash
heroku config -s | awk '/^DATABASE_URL=/{print $0 "?pool=20"}' | xargs heroku config:add
```

You'll need these environment variables for asset_sync and S3

### Environment Variables

```bash
DROPBOX_KEY=""
DROPBOX_SECRET=""
AWS_ACCESS_KEY_ID=""
AWS_SECRET_ACCESS_KEY=""
FOG_DIRECTORY=""
FOG_HOST=""
FOG_PROVIDER=""
ASSET_SYNC_GZIP_COMPRESSION=true
SECRET_TOKEN=""
```

### CORS and S3

If you're hosting the gifs on S3, you'll need to edit its CORS configuration so it allows XHR requests

```xml
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>
```

### Contributers

Here are the amazing people that have contributed to Giftoppr. Thank you so much :)

- [Keith Pitt](https://github.com/keithpitt)
- [Mario Visic](https://github.com/mariovisic)
- [Jeremy](https://github.com/j10io)
- [Jared Fraser](https://github.com/modsognir)
- [James Dowling](https://github.com/james-dowling)
- [Martin Jagusch](https://github.com/mjio)

### Contributing

1. Fork this repository
2. Create your feature branch for each new feature (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push the branch to github (git push origin my-new-feature)
5. Create new Pull Request

**Looking for ideas? There may be some unassigned [feature requests here](https://github.com/desktoppr/giftoppr/issues?labels=feature-request)**

repository: berkcaputcu/giftoppr

repo_name: berkcaputcu/giftoppr


text:
# ~/.config/awesome

> @sergeyklay's aweswesome files

My Awesome WM config

## This configuration uses following software

* rxvt (with unicode support)
* vim
* scrot
* firefox
* pcmanfm
* xscreensaver
* alsa (lib/util/plugins/etc.)
* ponymix
* mpd
* acpi
* acpid
* iwconfig
* polkit
* systemd

### Temes

* Tango icon theme (standard edition)
* "Zenburn" awesome theme

## License

Licensed under the same terms as Lua itself (MIT License).
© 2014 [Serghei Iakovlev](https://github.com/sergeyklay)

repository: igiroux/awesomefiles

repo_name: igiroux/awesomefiles


text:
# ngrx-immutable

Redux state made easy.

Wile there is lot of other tools in the wild - most of them are either overengineered or do not provide enough flexibility to do the job.  Maintaining Redux state with plain JavaScript might be pain in the...neck - due to nested objects. Therefor lot of people go for the immutable-js along with redux-immutable. While it wokrs perfectly well it also brings thousands lines of code which is not really necessary... especially if you prefere classic approach.

Short overview of "immute" function:

```
immute (
	store: object | [any],
	path: Array<string | number | function>,
	value: any | (current: any) => any
): object | [any]
```

It accepts 3 parameters: store, path and value.
Returned value is new state of the store.

	1. "store" is an object or array
	2. "path" is array of "string", "number" and "function" elements, where:

		a. "string" is consider to be a key of Object,
		b. "number" is consider to be an index of Array,
		c. "function" is consider to be a Array.findIndex() callable,
    used for collection lookup.

	3. "value" can be explicit value or function, where:

		a. explicit value should be primitive (string | number | boolean | undefined*),
    or immutable object | Array<any>.

"undefined" is used to remove key from object or element from array.
Example below.

		b. function accepts current value for selected part of the store.
    Returned value should met the same criteria as "explicit value" does.

Please be aware that "immute" won't work if path doesn't match given store. That is intentional.

This is how our sample store looks like.

```var store = {
  users: [
    {
      id: 1,
      name: 'Tom',
      ownedVehicles: [{
          type: 'Car',
          subType: 'SUV',
          make: 'Suzuki',
          model: 'Vitara',
          features: [
            { id: 1, name: 'Radio'},
            { id: 2, name: 'A/c'},
          ],
      }, {
          type: 'Car',
          subType: 'Sedan',
          make: 'Audi',
          model: 'A4 B6',
          features: [
            { id: 1, name: 'Radio'},
            { id: 2, name: 'A/c'},
            { id: 3, name: 'AirBag'},
            { id: 4, name: 'Xenon'},
          ]
      }, {
          type: 'Motorcycle',
          subType: 'Sportbike',
          make: 'Suzuki',
          model: 'GSXR600',
          features: []
      },
    ]
  },
 ...
  ],
  ...
};
```

Let's now do couple of basic Redux store operations.
For sake of presentation we will:

1. Change Car Model for Audi from "A4 B6" to "R8",
2. Add "Akrapovic exhaust" feature for Suzuki GSXR,
3. Remove "A/c" feature from Suzuki Vitara

All of those presented head-to-head, vanilla javascript and ngrx-immutable "immute" function.

1. Change of Car Model, vanilla javascript
```
const userIndex = store.users.findIndex(...);
const vehicleIndex = store.users[userIndex].ownedVehicles.findIndex(...);

store = {
  ...store,
  users: [
    ...store.users.slice(0, userIndex),
    {
      ...store.users[userIndex],
      ownedVehicles: [
        ...store.users[userIndex].ownedVehicles.slice(0, vehicleIndex),
        {
          ...store.users[userIndex].ownedVehicles[vehicleIndex],
          model: "R8"
        },
        ...store.users[userIndex].ownedVehicles.slice(vehicleIndex + 1),
      ]
    },
    ...store.users.slice(userIndex + 1)
  ]
}
```

? WAT ?

Now do same operation with immute:

```
store = immute(store, [
  'users',
  (user) => user.id === <something>,
  'ownedVehicles',
  (vehicle) => vehicle.<something> = <something>,
  'model'
], "R8"];
```

It is also possible to use function to produce value:

```
store = immute(store, [
  'users',
  (user) => user.id === <something>,
  'ownedVehicles',
  (vehicle) => vehicle.<something> = <something>
], (vehicle) => ({ ...vehicle, model: "R8"})];
```

2. Add "Akrapovic exhaust" feature for Suzuki GSXR, vanilla javascript

```
const userIndex = store.users.findIndex(...);
const vehicleIndex = store.users[userIndex].ownedVehicles.findIndex(...);

store = {
  ...store,
  users: [
    ...store.users.slice(0, userIndex),
    {
      ...store.users[userIndex],
      ownedVehicles: [
        ...store.users[userIndex].ownedVehicles.slice(0, vehicleIndex),
        {
          ...store.users[userIndex].ownedVehicles[vehicleIndex],
          features: [
            ...store.users[userIndex].ownedVehicles[vehicleIndex].features,
            {
              id: 1,
              name: 'Akrapovic exhaust'
            }
          ]
        },
        ...store.users[userIndex].ownedVehicles.slice(vehicleIndex + 1),
      ]
    },
    ...store.users.slice(userIndex + 1)
  ]
}
```
 This became unreadable in previous example already.
 Yet we had to add another level of nesting.
 Ouch!

 Let's do the same with immute:
 ```
store = immute(store, [
  'users',
  (user) => user.id === <something>,
  'ownedVehicles',
  (vehicle) => vehicle.<something> = <something>,
  'features'
], (features) => ([ ...features, { id: 1, name: "Akrapovic exhaust"}]));
```

We can also shorten this syntax using named functions inside path:

```
  const selectUser = userID => userObj => userObj === userID;
  const selectVehicle = vehicleModel => vehicle => vehicle.model === vehicleModel

  store = immute(
    store,
    ['users', selectUser(1), 'ownedVehicles', selectVehicle('GSXR600'), 'features'],
    (features) => ([ ...features, { id: 1, name: "Akrapovic exhaust" } ])
  );
```

... And how do you can delete item from array you might ask.
3. Remove "A/c" feature from Suzuki Vitara using immute:

```
  const selectUser = userID => userObj => userObj === userID;
  const selectVehicle = vehicleModel => vehicle => vehicle.model === vehicleModel
  const selectFeature = featureName => feature => feature.name === featureName;

  store = immute(
    store,
    ['users', selectUser(1), 'ownedVehicles', selectVehicle('Vitara'), 'features', selectFeature('A/c')],
    undefined
  );
```

Passing "undefined | () => undefined" as a value will exclude pointed key from object or pointed element from array.

I've been recently asked if this library supports modifying a subset of a larger collection.
While the answer is NO - you can still do it very easily by leveraging Array.reduce and Array.findIndex like so:

```
const data = {
	lvl1: {
		lvl2: [
			{
				userId: 1,
				data: { value: 'aaa', },
			},
			{
				userId: 2,
				data: { value: 'bbb', },
			},
			{
				userId: 1,
				data: { value: 'ccc', },
			},
			{
				userId: 3,
				data: { value: 'ddd', },
			}
		],
	},
};

const filterUser = (userId) => (user) => user.userId === userId;
const findUser = (_user) => (user) => user === _user;

immute(data, ['lvl1', 'lvl2'], (uArr) => uArr
	.filter(filterUser(1))
	.reduce((acc, _u) => immute(acc, [uArr.findIndex(findUser(_u))], (_uObj) => ({
			... _uObj,
			extra: 'some extra data'
		})
	), uArr)
);

```

In given situation the output would be:

```
{
	lvl1: {
		lvl2: [
			{
				userId: 1,
				extra: 'some extra data',   // this was added
				data: { value: 'aaa', },
			},
			{
				userId: 2,
				data: { value: 'bbb', },
			},
			{
				userId: 1,
				extra: 'some extra data',   // this was added
				data: { value: 'ccc', },
			},
			{
				userId: 3,
				data: { value: 'ddd', },
			}
		],
	},
};
```

repository: tswirski/ngrx-immutable

repo_name: tswirski/ngrx-immutable


text:
## Eluvio Javascript Client

The Eluvio Javascript Client is designed to make interacting with the Eluvio Content Fabric simple by encapsulating all of the necessary HTTP requests, authorization, and blockchain interaction.

## [API Documentation](https://eluv-io.github.io/elv-client-js/ElvClient.html)

- [ Installation ](#installation)
- [ Getting Started ](#initialization)
- [ Authorization ](#authorization)
- [ Identifying Content ](#id-format)
- [ Creating and Editing Content ](#editing)
- [ Playing Video ](#video)
- [ Publishing ABR Video Content ](#abr-publishing)
- [ Other Resources](#resources)

## Installation

#### Install from NPM:

```
npm install --save @eluvio/elv-client-js
```

NOTE: If you see an `unsupported architecture` error on Mac OS X, try the following:

```
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

export SDK_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
```

#### Usage

```
// From source
import { ElvClient } from "elv-client-js";
const { ElvClient } = require("elv-client-js");

// From babel-compiled source
import { ElvClient } from "elv-client-js/dist/src/ElvClient.js";
const { ElvClient } = require("elv-client-js/dist/src/ElvClient.js");

// Minified (browser)
import { ElvClient } from "elv-client-js/dist/ElvClient-min.js";
const { ElvClient } = require("elv-client-js/dist/ElvClient-min.js");

// Minified (node)
import { ElvClient } from "elv-client-js/dist/ElvClient-node-min.js";
const { ElvClient } = require("elv-client-js/dist/ElvClient-node-min.js");

// HTML
<script src=".../elv-client-js/dist/ElvClient-min.js"></script>
```

## Initializing the Client

Initializing the client is as simple as pointing it at the appropriate Eluvio configuration URL. This URL will automatically return information about the best Fabric, blockchain and KMS nodes, as well as the Fabric's content space - all the information the client needs to know to communicate with the Fabric.

For the main net:

```javascript
const client = await ElvClient.FromConfigurationUrl({
  configUrl: "https://main.net955305.contentfabric.io/config"
});
```

For the demo net:

```javascript
const client = await ElvClient.FromConfigurationUrl({
  configUrl: "https://demov3.net955210.contentfabric.io/config"
});
```

## Authorization

### Wallets and Signers

Built on blockchain technology, interaction with the Fabric requires the use of an ethereum private key - representing a user account - in order to verify and authenticate requests, perform encryption, transfer funds, interact with smart contracts, and generally serve as an identity for the user.

To perform the necessary blockchain interactions, the client requires a *signer* containing the user's private key. This is an instance of an [ethers.js](https://github.com/ethers-io/ethers.js/) wallet. ElvClient has a utility class ```ElvWallet``` to make handling this easier. (Note: the new elv-media-wallet takes advantage of new Fabric APIs that manage the signer on behalf of the user. For more info, please contact<EMAIL_ADDRESS>
After creating the ElvClient instance, you can generate an ```ElvWallet``` for the client using ```client.GenerateWallet()```. This class provides simple methods to generate signers from various information, as well as storing and retrieving signers by name.

After creating a signer using one of the AddAccount methods, you can set the signer for ElvClient using ``client.SetSigner``.

```javascript
const wallet = client.GenerateWallet();
const signer = wallet.AddAccount({
  privateKey: "0x0000000000000000000000000000000000000000000000000000000000000000"
});

client.SetSigner({signer});
```

You do not need to use the account management functionality of the wallet, you can simply use the wallet to generate signer objects as needed. Omitting the name parameter when calling any of the AddAccount is valid - the signer will only be returned and not stored.

Note that most operations on the Fabric require funds. If the account does not have any funds, most operations will fail. You can send funds from one account to another using [ElvClient#SendFunds](https://eluv-io.github.io/elv-client-js/ElvClient.html#SendFunds).

State channel authentication (as used in [ElvClient#PlayoutOptions](https://eluv-io.github.io/elv-client-js/ElvClient.html#PlayoutOptions)) does not require funds.

**Note: Always treat private keys (and mnemonics) as private, sensitive user data. Always store and transfer them encrypted (the client has a method for encrypting private keys with a password - see [ElvWallet#GenerateEncryptedPrivateKey](https://eluv-io.github.io/elv-client-js/ElvWallet.html#GenerateEncryptedPrivateKey)). A plaintext private key or mnemonic should *never* leave the user's browser - all use of the private key is done on the client.**

### Accessing Content
As a decentralized, trustless ecosystem, the content Fabric relies on smart contracts and blockchain transactions to verify that a user is allowed to perform an action. Each type of content (content spaces, libraries, objects, types, etc.) have associated smart contracts deployed to the blockchain that mediate access.

For example, to access a content object, the requester must call the accessRequest method on that content object's smart contract, then pass the transaction hash in the authorization token when querying the content Fabric API. The content Fabric will then verify the transaction before performing the requested action. If the transaction is missing or invalid, access will be denied.

The ElvClient handles all of this automatically. When a method is called, it will perform the appropriate transaction and send the correct authorization token with the request.

## Content, Contracts and Multi-format Hashes

As mentioned previously, every entity on the Fabric is backed by a smart contract. This contract is used for authorization and other functionality, but it is also used as the identity of the entity.

Every smart contract has a blockchain address. For example:

```
0x0472ec0185ebb8202f3d4ddb0226998889663cf2
```

This address is used when interacting with the contract directly, to call methods and perform transactions.

However, this address can be transformed into an ID to address the content on the Fabric.

By encoding the address in Base58, we get:

```
4bWCz6SZZiJ51VUkAb4xGLTgKGm
```

Each different type of entity on the Fabric has a prefix. For a library, it is `ilib`. If this contract is a content library contract, we can refer to the corresponding library on the Fabric using the library ID

```
ilib4bWCz6SZZiJ51VUkAb4xGLTgKGm
```

We can then use this ID as the `libraryId` argument in the client.

Additionally, we can go the opposite direction - convert a Fabric ID to its corresponding contract address. This is critically useful - when we want to access content, we need to make a call to the contract of that content. With this scheme, we just easily determine the contract address from a Fabric ID.

In short, every Fabric ID contains

- the type of the entity (library, object, type, user wallet, etc.) as a 4 byte prefix
- the address of its contract

This conversion should not be something that must be done often, as the client encapsulates a lot of the common interactions between Fabric and blockchain, but it is useful when you want to call methods on the content's contract.

The client contains utility methods to make this conversion simple.

```javascript
const address = "0x0472ec0185ebb8202f3d4ddb0226998889663cf2";

// Convert to multihash
const id = client.utils.AddressToHash(address);

// Convenience methods for automatically adding prefixes
const libraryId = client.utils.AddressToLibraryId(address);
const objectId = client.utils.AddressToObjectId(address);

// Convert back to address (requires prefix)
client.utils.HashToAddress(libraryId);
```

### Version Hashes

Content objects on the Fabric are comprised of immutable versions. Whenever content is modified, a new version is created, while older versions remain unchanged.

When referring to an object, an object ID (`iq__2vDbmxTdaivPnmDn8RKLbxSHUMfj`) refers to the object as a whole. Referring to content with an object ID will refer to the latest version.

However, you can also refer to a specific version of the object using a version hash. One such version of this object is `hq__BD1BouHkFraAcDjvoyHoiKpVhf4dXzNsDT5USe8mrZ7YDhLPDoZGnoU32iZvDYiQW8vVi6X7rV`.

As an analogy, referring to an object with an object ID compared to referring it using version hash is like referring to a Git repo versus referring to a repo at a specific commit. The former refers to the entity as a whole and updates as changes are made, while the latter refers to the entity at a specific point in time and does not change.

This version hash is a Base58 encoded string with the following format:

```
hq__<Base58(<SHA256 digest><size><object ID>)>
```

In short, the version hash refers to a specific of content on the Fabric, and it also contains the object ID, which means we can determine its contract address.

The client contains a utility method for parsing version hashes:

```javascript
client.utils.DecodeVersionHash("hq__BD1BouHkFraAcDjvoyHoiKpVhf4dXzNsDT5USe8mrZ7YDhLPDoZGnoU32iZvDYiQW8vVi6X7rV")

/*
{
  "digest": "7e98af41257c1446a4c5fcab9306e5d4f783145391cfa996bf9eca0197dd9388",
  "size": 139,
  "objectId": "iq__2vDbmxTdaivPnmDn8RKLbxSHUMfj",
  "partHash": "hqp_3rzPdsErVFeqjdG9o31rhr62fpEGhg5qv7QJjL6esVLV47i"
}
*/
```

Note that version hashes can not be generated from contract addresses like object IDs. They are specific to the Fabric and must be retrieved using the object ID.

See [ElvClient#ContentObjectVersions](https://eluv-io.github.io/elv-client-js/ElvClient.html#ContentObjectVersions)

## Creating and Editing Content

As mentioned in the previous section, content is comprised of immutable versions. These versions are created by making a draft, modifying that draft, then finalizing and committing the draft.

In this client, new drafts are created with the `CreateContentObject` and `EditContentObject` methods. The former creates a new content object, with the draft referring to the initial version of the object, while the latter creates a new draft based on the latest version of the specified content object.

Both methods return *write tokens*. These tokens are used in all of the methods used to modify content and in the finalize method to refer to the draft.

When the object is finalized, the draft is closed for editing, the version hash is created for the new version, and the object is committed and distributed across the fabric.

The process for creating or editing a content object is the following:
- Open draft and retrieve a write token
- Use the write token to modify the content (update metadata, upload files, etc.)
- Finalize the draft to create a new version of the content

Here is an example of creating new content with files and metadata:

```javascript
const createResponse = await client.CreateContentObject({libraryId});
const objectId = createResponse.id;
const writeToken = createResponse.write_token;

await client.ReplaceMetadata({
  libraryId,
  objectId,
  writeToken,
  metadata: {
    tags: [
      "video",
      "audio"
    ]
  }
});

await client.UploadFiles({
  libraryId,
  objectId,
  writeToken,
  fileInfo: [
    {
      path: "image.jpg",
      mime_type: "image/jpeg",
      size: 10000,
      data: (<ArrayBuffer 10000>)
    }
  ]
});

const finalizeResponse = await client.FinalizeContentObject({
  libraryId,
  objectId,
  writeToken
});

const versionHash = finalizeResponse.hash;
```

Regardless of what kind of edits are made, the process of editing content will always be bookended by `CreateContentObject` or `EditContentObject` to open a draft, and `FinalizeContentObject` to publish it.

Besides content objects, other entities on the fabric can be accessed and modified in the same way, including libraries, access groups and user wallets. To do so, obtain the objectId of the entity by converting its address:

```javascript
const libraryId = "ilib2vDbmxTdaivPnmDn8RKLbxSHUMfj";
const libraryAddress = client.utils.HashToAddress(libraryId);
const libraryObjectId = client.utils.AddressToObjectId(libraryAddress);
```

The objectId can then be used in these methods to modify them as content objects. For the libraryId parameter, specify libraryId for libraries, and `client.contentSpaceLibraryId` for other types.

**NOTE** By default, `FinalizeContentObject` will wait for the new version to be distributed and confirmed across the fabric. In most cases, this occurs very quickly. However, if a lot of file content is uploaded in a draft, this may take some time. In this case, you can specify not to wait when finalizing so your program can continue:

```javascript
await client.FinalizeContentObject({
  libraryId,
  objectId,
  writeToken,
  awaitCommitConfirmation: false
});
```

Only the modifications made within a version are distributed, so this is only a factor when large files are uploaded within an edit.

## Frame Client

To protect access to users private keys and unify account management functionality, applications are run within an IFrame by [Eluvio Core](https://github.com/eluv-io/elv-fabric-browser). The FrameClient can be used equivalently in place of ElvClient within this restricted IFrame without having access to any user keys.

The frame client contains dynamically defined methods corresponding to those in ElvClient, and works by passing a message to the Eluvio Core frame with the method name and arguments. Core then takes that message, calls the method in its own client (which has the key for the current user) with the provided arguments, and passes the results back in another message. The frame client then hands the results back to the caller.

With few exceptions, using FrameClient within Core works identically to the full client.

Note that functions can not be passed between frames - any functions, including those contained in objects, will be automatically stripped out of the sent message by the browser.

Both the [Eluvio Fabric Browser](https://github.com/eluv-io/elv-fabric-browser) and the [Eluvio Video Editor](https://github.com/eluv-io/elv-video-editor) use the FrameClient exclusively.

## Playing Video from the Fabric

See the [Stream Sample App](https://github.com/eluv-io/elv-stream-sample) for a detailed explanation on playing video from the Fabric using the Eluvio JavaScript client.

## Publishing ABR Video Content on the Fabric

For more information on how to publish ABR content see [this detailed guide](https://eluv-io.github.io/elv-client-js/abr/index.html).

## Other Resources

Our Core, Fabric Browser and Video Editor apps are all completely open source, and make extensive use of this client:

* [Eluvio Core](https://github.com/eluv-io/elv-fabric-browser)
* [Eluvio Fabric Browser](https://github.com/eluv-io/elv-fabric-browser)
* [Eluvio Video Editor](https://github.com/eluv-io/elv-fabric-browser)

You can also look at the source and test code for this client. It contains many examples of how to interact with the Fabric, blockchain, and contract code.

repository: eluv-io/elv-client-js

branch_name: refs/heads/develop

repo_name: eluv-io/elv-client-js


text:
# Quality Of Life Indicators

## Dataset

| Name | Value |
| :--- | :---- |
| Catalog | [Link](https://catalog.data.gov/dataset/quality-of-life-indicators-a785e) |
| Metadata | [Link](https://data.cityofnewyork.us/api/views/8hkx-uppz) |
| Data: JSON | [100 Rows](https://data.cityofnewyork.us/api/views/8hkx-uppz/rows.json?max_rows=100) |
| Data: CSV | [100 Rows](https://data.cityofnewyork.us/api/views/8hkx-uppz/rows.csv?max_rows=100) |
| Host | data.cityofnewyork.us |
| Id | 8hkx-uppz |
| Name | Quality Of Life Indicators |
| Attribution | Downtown Alliance |
| Category | City Government |
| Tags | life, quality, statistic, community |
| Created | 2011-08-30T22:14:23Z |
| Publication Date | 2013-06-26T17:12:44Z |

## Description

Statistics on NYC quality of life

## Columns

```ls
| Included | Schema Type    | Field Name  | Name       | Data Type | Render Type |
| ======== | ============== | =========== | ========== | ========= | =========== |
| No       | time           | :updated_at | updated_at | meta_data | meta_data   |
| Yes      | series tag     | indicator   | INDICATOR  | text      | text        |
| Yes      | numeric metric | q1_09       | Q1 09      | percent   | percent     |
| Yes      | numeric metric | q2_09       | Q2 09      | percent   | percent     |
| Yes      | numeric metric | q3_09       | Q3 09      | percent   | percent     |
| Yes      | numeric metric | q4_09       | Q4 09      | percent   | percent     |
```

## Time Field

```ls
Value = updated_at
Format & Zone = seconds
```

## Data Commands

```ls
series e:8hkx-uppz d:2011-08-30T15:14:24.000Z t:indicator="Downtown Commercial Vacancy Rates" m:q3_09=9.9 m:q1_09=8.1 m:q2_09=8.7 m:q4_09=9.6

series e:8hkx-uppz d:2011-08-30T15:14:24.000Z t:indicator="Hotel Occupancy Rates*" m:q3_09=87.8 m:q1_09=68.61 m:q2_09=84.22 m:q4_09=86

series e:8hkx-uppz d:2011-08-30T15:14:24.000Z t:indicator="Operation Scorecard - Percentage of Acceptably Clean Streets" m:q3_09=97.8 m:q1_09=98.8 m:q2_09=97.5 m:q4_09=99.4
```

## Meta Commands

```ls
metric m:q1_09 p:double l:"Q1 09" t:dataTypeName=percent

metric m:q2_09 p:double l:"Q2 09" t:dataTypeName=percent

metric m:q3_09 p:double l:"Q3 09" t:dataTypeName=percent

metric m:q4_09 p:double l:"Q4 09" t:dataTypeName=percent

entity e:8hkx-uppz l:"Quality Of Life Indicators" t:attribution="Downtown Alliance" t:url=https://data.cityofnewyork.us/api/views/8hkx-uppz

property e:8hkx-uppz t:meta.view v:id=8hkx-uppz v:category="City Government" v:averageRating=0 v:name="Quality Of Life Indicators" v:attribution="Downtown Alliance"

property e:8hkx-uppz t:meta.view.owner v:id=5fuc-pqz2 v:screenName="NYC OpenData" v:lastNotificationSeenAt=1491336998 v:displayName="NYC OpenData"

property e:8hkx-uppz t:meta.view.tableauthor v:id=5fuc-pqz2 v:screenName="NYC OpenData" v:roleName=administrator v:lastNotificationSeenAt=1491336998 v:displayName="NYC OpenData"
```

## Top Records

```ls
| :updated_at | indicator                                                      | q1_09  | q2_09   | q3_09   | q4_09   |
| =========== | ============================================================== | ====== | ======= | ======= | ======= |
|<PHONE_NUMBER>  | Downtown Commercial Vacancy Rates                              | 8.1    | 8.7     | 9.9     | 9.60    |
|<PHONE_NUMBER>  | Hotel Occupancy Rates*                                         | 68.61  | 84.22   | 87.8    | 86      |
|<PHONE_NUMBER>  | Operation Scorecard - Percentage of Acceptably Clean Streets   | 98.8   | 97.5    | 97.8    | 99.40   |
|<PHONE_NUMBER>  | Operation Scorecard - Percentage of Acceptably Clean Sidewalks | 98.2   | 99.4    | 100.0   | 100     |
|<PHONE_NUMBER>  | Visitors to Downtown Attractions*                              | 704461 | 2272824 | 2650642 | 1228309 |
|<PHONE_NUMBER>  | Average # of Homeless Individuals Encountered in Weekly 1 Hour | 2.18   | 4.47    | 2.43    | 3.33    |
|<PHONE_NUMBER>  | Number of Homeless encountered by Outreach Workers             | 187    | 106     |         | 239     |
|<PHONE_NUMBER>  | Services Accepted                                              | 88     | 53      |         | 150     |
|<PHONE_NUMBER>  | Services Declined                                              | 99     | 53      |         | 195     |
|<PHONE_NUMBER>  | Public Contacts                                                | 164273 | 198670  | 217154  | 141836  |
```

repository: SpellarBot/open-data-catalog

repo_name: SpellarBot/open-data-catalog