text:
# Self-Publishing Spartacus Libraries Using the Open Source Code

The procedures on this page describe how to check out the Spartacus source code, build the libraries locally, and then make them available for installation. This allows you to use the Spartacus libraries that you have compiled, and as a result, accessing Spartacus packages from the npm repository is no longer necessary.

## Prerequisites

Before starting any the procedures on this page, you must fulfill the follow prerequisites:

- Install the appropriate versions of node.js and Angular CLI for the release you are building.
- Install the ts-node TypeScript execution engine. To install ts-node, open a terminal window and enter the following command:

    ```bash
    npm install -g ts-node
    ```

- Install an npm-like registry software, such as Verdaccio, which is a lightweight Node.js private proxy registry. To install Verdaccio, open a terminal window and enter the following command:

    ```bash
    npm install -g verdaccio@4
    ```

## Building and Serving the Spartacus Libraries Using a Local Registry

In the following procedure, Verdaccio is used in the steps involving registry software, but you can use any proxy registry software that is similar to npm.

**Note:** These steps assume that your proxy registry is already running in a terminal window.

For more information about using Verdaccio or another registry software, see the [Prerequisites](#prerequisites) section, above.

1. Open a terminal window.

1. Run the following command to clone the Spartacus repository from GitHub and then change to the directory of the cloned repo:

    ```bash
    git clone https://github.com/SAP/spartacus.git && cd spartacus
    ```

1. Use the tag name to check out the required release version.

    For example, the following command checks out the 6.1.0 release:

    ```bash
    git checkout 6.1.0
    ```

    When specifying the tag of the release version, use the specific major.minor.patch (for example, `6.1.0`) of the release you want to use. The latest release is always recommended.

    You can use the `git branch` command to confirm which branch you are on.

1. Run the following command to install packages and then build the libraries:

    ```bash
    npm install && npm run build:libs
    ```

1. Run the following schematics testing script provided by the Spartacus project:

    ```bash
    ts-node ./tools/schematics/testing
    ```

    DISCLAIMER: The script located in `tools/schematics/testing.ts` is for building the libraries only, and is subject to change. You can use this script as an example, or you can save and modify it according to your needs.

1. Do not publish yet. To avoid having to enter user details as each package is published locally, open a separate terminal window, run the following command, and enter a username, password, and email when prompted:

    ```bash
    npm adduser --registry http://localhost:4873
    ```

1. In the terminal window running your proxy registry (such as Verdaccio), select the `Publish` option and press `Enter`.

    The `Publish` command creates a local repository for Spartacus packages to be installed. It also redirects npm to use this repository instead of `npmjs.com` (only for `@spartacus/*` packages).

1. If you did not add an npm user in the previous step, you may be asked for an npm user name for each library. In this case, press `Enter` each time to use `public`.

    **Note:** After publishing, you will be asked what to do next. Do not close the window after publishing. The local Verdaccio repository only remains accessible for as long as the script is running. Published packages will be lost after closing the script.

    You can see the published libraries by browsing to [http://localhost:4873/](http://localhost:4873/) while Verdaccio is running.

## Upgrading or Creating an Application Using the Local Repository

When using the local repository method, the next steps (upgrading or creating a new application) do not differ from the standard documented steps for upgrading or creating a new Spartacus application. The `@spartacus` packages are obtained from the local npm-like registry you are running, and everything else is obtained from standard sources.

### Installing Libraries in a New App

This procedure can be used to create a fresh application.

1. In a new terminal window, use the following command to create a new Angular app and then change to the directory of the new app folder:

    ```bash
    ng new spartacus-app --style=scss && cd spartacus-app
    ```

1. Type `N` and then press `Enter` when prompted for Angular routing.

1. Add Spartacus dependencies by running the following command:

    ```bash
    ng add @spartacus/schematics --baseUrl https://commercebackendurl
    ```

1. Follow the onscreen instructions that appear after running the command.

    The Spartacus libraries will come from your local npm repository provided by your registry software (such as Verdaccio).

    You can open `node_modules` and check the `@spartacus` libraries that were installed.

1. You can exit the proxy registry when the installation is complete.

    If you are using Verdaccio, you can end the script by selecting `Exit`. Do not force-close the script; doing so will prevent cleanup from running, and as a result, the script may not run correctly in the future.
1. Start the application. You should now be running with the latest Spartacus libraries installed.

## Upgrading an Existing Spartacus App

Before upgrading your Spartacus app to version 6.0, you first need to make sure your Angular libraries are up to date. Spartacus 6.0 requires Angular 15.

### Upgrading Your Angular Libraries

When upgrading your Angular libraries to version 15, you might have to append the `--force` flag if you encounter a mismatch between peer dependencies during the migration. The following is an example command that upgrades Angular to version 15.

```bash
ng update @angular/cli@15 --force
```

Afterwards, you need to upgrade third party dependencies to the version that is compatible with Angular 15, such as `ngx-infinite-scroll`, `@ng-select/ng-select` or `@ngrx/store`.

For more information, see the official [Angular Update Guide](https://update.angular.io/).

### Upgrading Your Spartacus App to 6.0

Spartacus 6.0 includes many new features and fixes. Since this update is a major release, some of the updates may also be breaking changes for your application. In this case, additional work on your side may be required to fix issues that result from upgrading from 5.2 to 6.0.

**Note:** You must start with a version 5.2 composable storefront app to be able to update to version 6.0.

**Note:** In the following procedure, Verdaccio is used as an example of registry software, but you can use any proxy registry software that is similar to npm. These steps assume that your proxy registry is already running in a terminal window. For more information about using Verdaccio or another registry software, see the [Prerequisites](#prerequisites) section, above.

1. To update your Spartacus app to version 6.0, run the following command in the workspace of your Angular application:

    ```bash
    ng update<EMAIL_ADDRESS>    ```

1. Follow the onscreen instructions that appear after running the command.
1. When the update has finished running, you can exit the proxy registry.

    If you are using Verdaccio, you can end the script by selecting `Exit`. Do not force-close the script; doing so will prevent cleanup from running, and as a result, the script may not run correctly in the future.
1. Inspect your code for comments that begin with `// TODO:Spartacus`. For detailed information about each added comment, see the following:

   - [Typescript Breaking Changes in Composable Storefront 6.0](https://help.sap.com/doc/typescript-breaking-changes-in-composable-storefront-60/6.0/en-US/typescript-changes-version-6.html)
   - [Technical Changes in Composable Storefront 6.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/10a8bc7f635b4e3db6f6bb7880e58a7d/93ffb557d3c14922bda14dfc8b4250b4.html?locale=en-US&version=6.0#loio93ffb557d3c14922bda14dfc8b4250b4)
   - [Changes to Styles in Composable Storefront 6.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/10a8bc7f635b4e3db6f6bb7880e58a7d/d008d0179ea141bf84fde6ec98244ae5.html?locale=en-US&version=6.0#loiod008d0179ea141bf84fde6ec98244ae5)
   - [Changes to HTML in Composable Storefront 6.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/10a8bc7f635b4e3db6f6bb7880e58a7d/f6ecd8ecdc6042dca6552c0c16448e0c.html?locale=en-US&version=6.0#loiof6ecd8ecdc6042dca6552c0c16448e0c)
   - [Changes to Sample Data in Composable Storefront 6.0](https://help.sap.com/docs/SAP_COMMERCE_COMPOSABLE_STOREFRONT/10a8bc7f635b4e3db6f6bb7880e58a7d/911c4c3a9e8c4d51a9ac4cc48cd4fda6.html?locale=en-US&version=6.0#loio911c4c3a9e8c4d51a9ac4cc48cd4fda6)

    **Note:** The process might also downgrade some dependencies (namely RxJS), because Spartacus does not yet support the newer version.

1. Start the application.

    You should now be running with the latest libraries installed. You can open `node_modules` and check the `@spartacus` libraries that were installed.

## Sharing the Local Repository

Other team members may want to consume the locally-available libraries. It is recommended that you set up a server where you can install the npm-like registry of your choice, and where you can publish locally-built Spartacus libraries.

repository: SAP/spartacus

gha_language: TypeScript

repo_name: SAP/spartacus


text:
# Git Truck 🚛 ·
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/git-truck/git-truck/blob/main/LICENSE)
[![Git Truck on NPM](https://img.shields.io/npm/v/git-truck)](https://www.npmjs.com/git-truck)

![Demo](demo.gif)

Git-Truck provides you with a truckload of visualizations for your git repository, and helps you find out if your project has a good [truck factor](https://www.agileadvice.com/2005/05/15/agilemanagement/truck-factor/):

| | |
|-|-|
| The files in your system where you have a single contributor (i.e., truck-factor = 1) |  |
| You can see how the various developers contribute to your codebase |  |
| You can determine which parts of the system that are most often changed |  |

### What makes Git Truck different?

- Private by design
- Works offline
- Git provider agnostic - Works with any Git repository
- No tracking, no ads, no data mining, no analytics, no cloud, no servers

## [Prerequisites](#prerequisites)

To use Git Truck, you will need to have the following programs installed:

- [Node.js](https://nodejs.org/en/) 16.13 or newer
- npm 6.14 or newer
- [git](https://git-scm.com/downloads) 2.29 or newer

To check if these programs are installed, and what version you have, run `node --version`, `npm --version` and `git --version`. If any of these are not installed on your system, or are just very old, they can be installed from the links above. Note that `npm` is installed along with `node`.

## [Get started](#get-started)

1.
2. The application will now open in your default browser.

**Git Truck is part of a research study, so please fill out our [short survey](https://forms.gle/9wCCAw6zae7wuwZQ6) after trying out the tool. Thanks!**

## [I got an error or I want to give feedback, what do i do?](#i-got-an-error-or-i-want-to-give-feedback-what-do-i-do)

Please open an issue [here](https://github.com/git-truck/git-truck/issues) where you describe your problem. Please include git version, node version, npm version, operating system, and an image of the problem would be great too!

If you have any suggestions about new features, or things that you think should be different, also feel free to open an issue.

## [Advanced use](#advanced-use)

Run `npx git-truck` in the root of a git repository, that you want to visualize:

```sh
npx git-truck [args]
```

### [Arguments](#arguments)

|         arg          |                              description                              |   default value    |
| :------------------: | :-------------------------------------------------------------------: | :----------------: |
|       `--path`       |                 path to a folder or a git repository                  | current directory  |
|       `--log`        | output log level. See [here](./src/analyzer/log.server.ts) for values |         -          |
|       `--port`       |                      port to use for the program                      |        3000        |
| `--invalidate-cache` |                    bypass analyzer cache manually                     |         -          |
| `--headless`         |       run the program without opening the browser                     |         -          |

**Note:** Using `--invalidate-cache` will cause the analyzer to run every time the client talks to the server.

### [Configuration](#configuration)

You can add a `truckconfig.json` file to the root of your project, where you can define the arguments you want.
Additionally you can define which git-aliases should be considered as the same person using `unionedAuthors`. If provided, the first name in the array is used as the name of the person.
You can also define files to ignore.

**Example:**

```json
{
  "log": "debug",
  "branch": "main",
  "unionedAuthors": [
    ["Bob", "Bobby Bob"],
    ["Alice", "aliiii", "alice alice"]
  ],
  "hiddenFiles": ["package-lock.json", "*.bin", "*.svg"],
  "invalidateCache": true
}
```

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=git-truck/git-truck&type=Date)](https://star-history.com/#git-truck/git-truck&Date)

license: MIT

repository: git-truck/git-truck

branch_name: refs/heads/main

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: git-truck/git-truck


text:
# Gosick

Scheme interpreter implemented by Golang.
This is started as [a programming project](https://github.com/k0kubun/gosick/blob/master/project.md) for newcomers of my laboratory.

## Installation

```bash
$ go get github.com/k0kubun/gosick
```

## Usage

```bash
# Invoke interactive shell
$ gosick

# Excecute scheme source code
$ gosick source.scm

# One liner
$ gosick -e "(+ 1 2)"

# Dump AST of input source code
$ gosick -a

# Show help
$ gosick -h
```

## Implemented syntax and functions
- +, -, *, /, =, <, <=, >, >=
- cons, car, cdr, list, length, last, append, set-car!, set-cdr!
- if, cond, and, or, not, begin, do
- memq, eq?, neq?, equal?
- null?, number?, boolean?, procedure?, pair?, list?, symbol?, string?
- string-append, symbol->string, string->symbol, string->number, number->string
- let, let*, letrec, lambda, define, set!, quote
- write, print, load

## License

Gosick is released under the [MIT License](http://opensource.org/licenses/MIT).

repository: bundgaard/gosick

branch_name: refs/heads/master

repo_name: bundgaard/gosick


text:
# Nigel
The Nigel programming language

## What is it?
Nigel is a new programming language for the 8051 microcontroller, with a c-like syntax.

## Goals
- [x] Complete compilation from source code to hex files.
- [x] Resolve complex expressions
- [x] Functions
- [x] Control flow (if, while, etc.)
- [x] Pointers
- [x] Intern/extern RAM
- [x] Preprocessor
- [x] Compile the compiler on linux (clang/gcc)
- [x] Interrupts
- [x] 8051-specific stuff (ports, timer, etc.)

## Nice to have
* arrays (can be emulated with a pointer)
* string literals
* structs
* optimizing code

## How does it work?
The Compiler is divided into these parts:
```
     Source code
          |
          v
+--------------------+
|    Preprocessor    |
+--------------------+
          |
          v
    Line textcode
          |
          v
+--------------------+
|       Lexer        |
+--------------------+
          |
          v
     Lexer code
          |
          v
+--------------------+
|     AST Parser     |
+--------------------+
          |
          v
         AST
          |
          v
+--------------------+
|    IM Generator    |
+--------------------+
          |
          v
         IMC
          |
          v
+--------------------+
|       Linker       |
+--------------------+
          |
          v
       HEX code
```
The resulting Hex code can be uploaded onto a 8051 microcontroller or be interpreted in a simulator.

### Next development steps
* new, delete (dynamic memory)

* std-library

## Getting started
### Building
#### On Windows
Pre-generated solution:
1. Install Visual Studio (tested with VC 2017).
2. Install the boost library:
    1. Download the library from http://www.boost.org/ and add it to the project dependencies (make sure filesystem and system are compiled)
    2. __or__ use vcpkg (https://github.com/Microsoft/vcpkg/) and install boost with
       ```<vcpkg_install_dir>\vcpkg install boost-filesystem boost-system```.
       This might be the easier way.
3. Clone this repository.
4. Open Compiler\Nigel.sln, compile and hope for the best.
The output binaries will be in Nigel\Compiler\Release\ or Nigel\Compiler\Debug\ depending on your configuration.

CMake (static build):
1. Install cmake
2. Install the boost library with vcpkg as above
use ```<vcpkg_install_dir>\vcpkg install --triplet x86-windows-static boost-filesystem boost-system``` for static build
3. Clone this repository.
4. create the project
```
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=<vcpkg_install_dir>/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static
```
5. Open build\Nigel.sln and compile

#### On Linux
1. Install cmake (https://cmake.org/ or just ```sudo apt-get install cmake```).
2. Install boost with ```sudo apt-get install libboost-all-dev```.
3. Clone this repository (```git clone https://github.com/erikgoe/nigel```).
    1. Use clang (recommanded):
       Install clang-4.0 (google it for your distribution). This should work for ubuntu 16.04 xenial:
       ```sudo apt-add-repository "deb http://llvm.org/apt/xenial/ llvm-toolchain-xenial-4.0 main"```
       ```sudo apt-get update```
       ```sudo apt-get install clang-4.0 lldb-4.0```
       Then just run 'build_clang.sh' script from this repository.
    2. __or__ use gcc:
       ```mkdir build | cd```
       ```cmake ..```
       ```make```
The output binaries will be in Nigel/Compiler/build/Nigel/.

### Usage
```cd <binaries_output>```,

then, with cmake
```nigel build --c ../../tests/code/functions.nig --o ../../tests/code/functions.hex```
or without (on Windows)
```nigel build --c ..\tests\code\functions.nig --o ..\tests\code\functions.hex```
to compile a test program

or
```nigel help```
to get further information on how to use nigel.

Alternatively you can add the binaries output directory to your PATH environment variable on windows.

## Who uses Nigel?
Hmm... maybe you?

repository: erikgoe/Nigel

repo_name: erikgoe/Nigel


text:
# Installation

After pulling the code, execute `npm install` or `yarn` in the root directory of the project. After success, execute `npm run dev` or `yarn dev` to start the project (nodejs + npm needs to be installed)

# Others Template
- [vite-ts-quick](https://github.com/pohunchn/vite-ts-quick) - For Vue 3.x

# Built-in
* NetBase([Fetch](https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API/Using_Fetch))
* Cookie
* Storage
* [react-router-dom](https://reactrouter.com/web/guides/quick-start)
* [antd](https://ant.design/docs/react/introduce-cn)

# Note
* This framework adopts [Fetch](https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API/Using_Fetch) as a network requester, it is not recommended to introduce Axios again
* Please do not modify all the files under the `lib` folder in the business project
* [gitee](https://gitee.com/phcs/vite-react-quick) is only for domestic users to pull code，from [github](https://github.com/pohunchn/vite-react-quick) to synchronize，please visit [github](https://github.com/pohunchn/vite-react-quick) for PR
* **Welcome to Issues and PR**

repository: pohunchn/vite-react-quick

repo_name: pohunchn/vite-react-quick


text:
e-Inventory System
============================

**NOTES:**

- Refer to the README before start your system.
- Delete all table in e-ims database then import dump sql file table into e-ims database. All dumpfile mysql can get at db folder.

CHANGELOG 15/06/2016
-------------------

- Add send email to vendor after make the order or admin make the order.
- Add kartik-mpdf
- Add new features for access control filter
- Fixed bugs purchase by admin
- Fixed bugs for count total order by staff
- Fixed bugs for UI invoice

DIRECTORY STRUCTURE
-------------------

      assets/             contains assets definition
      commands/           contains console commands (controllers)
      config/             contains application configurations
      controllers/        contains Web controller classes
      mail/               contains view files for e-mails
      models/             contains model classes
      runtime/            contains files generated during runtime
      tests/              contains various tests for the basic application
      vendor/             contains dependent 3rd-party packages
      views/              contains view files for the Web application
      web/                contains the entry script and Web resources

REQUIREMENTS
------------

The minimum requirement by this project template that your Web server supports PHP 5.4.0.

INSTALLATION
------------

### Download from an Archive File

Extract the archive file downloaded from [https://github.com/shahriltech/e-ims.git) to
a directory and rename master(name folder) to `e-ims` that is directly under the Web root.

You can then access the application through the following URL:

~~~
http://localhost/e-ims/web/index.php
~~~

CONFIGURATION
-------------

### Database

Edit the file `config/db.php` with real data, for example:

```php
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=e-ims',
    'username' => 'root',
    'password' => '', //if default should be no password.
    'charset' => 'utf8',
];
```

repository: shahriltech/e-ims

repo_name: shahriltech/e-ims


text:
```python
# Printing
print("Hello World!")
print "Hello Again"
print("I like typing this.")
print "This is fun."
print 'Yay! Printing.'
print "I'd much rather you 'not'."
print 'I "said" do not touch this.'
```

      File "<ipython-input-12-3577acc6aaf8>", line 3
        print "Hello Again"
                          ^
    SyntaxError: Missing parentheses in call to 'print'

```python
# Comments in python
# Comment  ->
# This is a comment
print("This is not a comment")
'''
multiple comment
print("Bucky" + "Roberts")
'''
```

```python
# Basic Operators - Knowledge box
    + plus
    - minus
    / slash
    * asterisk
    % percent
    < less-than
    > greater-than
    <= less-than-equal
    >= greater-than-equal
```

```python
print "I will now count my chickens:"

print "Hens", 25 + 30 / 6
print "Roosters", 100 - 25 * 3 % 4

print "Now I will count the eggs:"

print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6

print "Is it true that 3 + 2 < 5 - 7?"

print 3 + 2 < 5 - 7

print "What is 3 + 2?", 3 + 2
print "What is 5 - 7?", 5 - 7

print "Oh, that's why it's False."

print "How about some more."

print "Is it greater?", 5 > -2
print "Is it greater or equal?", 5 >= -2
print "Is it less or equal?", 5 <= -2
```

```python
# Variables
a = 10
print(a)
b = "Computer Club"
print(b)
num = 3.244
print(num)
```

```python
# Basic Commands - Execute on python terminal
print("hey now brown cow")

firstName = "Mohit "
firstName + "Khare"
firstName * 5
```

```python
# Accessing Characters via index
# >>> denotes python command line
>>> user = "Tuna McFish"
>>> user[0]
'T'
>>> user[5]
'M'
>>> user[-1]
'h'
>>> user[-3]
'i'
>>> user[2:7]
'na Mc'
>>> user[:7]
'Tuna Mc'
>>> user[2:]
'na McFish'
>>> user[:]
'Tuna McFish'
>>> print('dsadasd')
dsadasd
>>> len('dfjhf22893hfsdfjkasdf')
21
>>> len(user)
11
```

```python
# List in python
# list --> []
>>> players = [29, 58, 66, 71, 87]
>>> players[2]
66
>>> players[2] = 68
>>> players
[29, 58, 68, 71, 87]
>>> players + [90, 91, 98]
[29, 58, 68, 71, 87, 90, 91, 98]
>>> players
[29, 58, 68, 71, 87]
>>> players.append(120)
>>> players
[29, 58, 68, 71, 87, 120]
>>> players[:2]
[29, 58]
>>> players[:2] = [0, 0]
>>> players
[0, 0, 68, 71, 87, 120]
>>> players[:2] = []
>>> players
[68, 71, 87, 120]
>>> players[:] = []
>>> players
[]
```

```python
# If-Else conditions
# Note the syntax
# if condition :
#      statements
# else:
#      statements

age = 13

if age < 21:
    print("No beer for you!")

#name = "Lucy"
name = "Tommy D"
if name is "Bucky":
    print("Hey there Bucky")
elif name is "Lucy":
    print("What up Lucedawg")
elif name is "Sammy":
    print("What up Slammy")
else:
    print("Please sign up for the site!")

# Try for different ages , age = 27
```

```python
# Iterations in python
# food list and inside some items
foods = ['bacon', 'tuna', 'ham', 'snausages', 'beef']

for f in foods[:2]:
    print(f)
    print(len(f))
```

```python
# For , while loops
#from 0 to 10
for x in range(10):
    print(x)

print("")

#from 5 to 12
for x in range(5, 12):
    print(x)

print("")

#from 10 to 40 increment value 5
for x in range(10, 40, 5):
    print(x)

print("")

#While loop

buttcrack = 5

while(buttcrack < 10):
    print(buttcrack)
    buttcrack += 1
```

```python
magicNumber = 26

# ok this program find a magic number

for n in range(101):
    if n is magicNumber:
        print(n, "is the magic number ! ")
        break
    else:
        print(n)
```

```python
#Challenge
#Find the numbers whıch can dive 4 and 4 multiple(tetragenous) in from 0 to 100
for n in range(101):
    if(n % 4 is 0):
        print(n)
```

```python
numbersTaken = [2, 5, 12, 13, 17]

print("Here are the numbers that are still available")

for n in range(1,20):
    if n in numbersTaken:
        continue
    print(n)
```

```python
def beef():
    print("Dayum, functions are cool")

def bitcoin_to_usd(btc):
    amount = btc * 527
    print(amount)

beef()
bitcoin_to_usd(3.85)
bitcoin_to_usd(1)
bitcoin_to_usd(13)
```

```python
def allowed_dating_age(my_age):
    girls_age = (my_age/2)+7
    return girls_age

my_limit = allowed_dating_age(22)
creppy_limit = allowed_dating_age(49)
print("I can date girls", my_limit,"or older")
print("Creepy can date girls", creppy_limit,"or older")
```

```python
def get_gender(sex = 'Unknown'):
    if sex is 'm':
        sex = 'Male'
    elif sex is 'f':
        sex = 'Female'
    print(sex)

get_gender('m')
get_gender('f')
get_gender()
```

```python
a = 7823

def corn():
  print(a)

def fudge():
  print(a)

corn()
fudge()
```

```python
def dumb_sentence(name='Mohit', action='ate', item='pizza'):
  print(name, action, item)

dumb_sentence()
dumb_sentence("CC", "teaches", "coding")
dumb_sentence(item='burger')
dume_sentence(item='football', action='loves')
```

```python
def add_numbers(*args):
  total = 0
  for a in args:
    total += a
  print(total)

add_numbers(3)
add_numbers(3, 32)
add_numbers(3, 43, 5453, 354234, 463463)
```

```python
def health_calculator(age, apples_ate, cigs_smoked):
  answer = (100-age) + (apples_ate*3.5) - (cigs_smoked*2)
  print(answer)

data = [27, 20, 0]

health_calculator(data[0], data[1], data[2])
health_calculator(*data)
```

```python
groceries = {'cereal', 'milk', 'starcrunch', 'beer', 'duck tape', 'lotion', 'beer'}
print(groceries)

if 'milk' in groceries:
  print("You already have milk hoss!")
else:
  print("Oh yea, you need milk!")
```

```python
classmates = {'Tony': ' cool but smells', 'Emma': ' sits behind me', 'Lucy': ' asks too many questions'}

for k, v in classmates.items():
    print(k + v)
```

```python
import tuna_21
import random

tuna_21.fish()

x = random.randrange(1, 1000)
print(x)
```

```python
import random
import urllib.request

def download_web_image(url):
    name = random.randrange(1, 1000)
    full_name = str(name) + ".jpg"
    urllib.request.urlretrieve(url, full_name)

download_web_image("https://www.thenewboston.com/images/homepage_images/main_homepage_01.png")
```

```python
# Writing and Reading Files
fw = open('sample.txt', 'w')
fw.write('Writing some stuff in my text file\n')
fw.write('I like bacon\n')
fw.close()

fr = open('sample.txt', 'r')
text = fr.read()
print(text)
fr.close()
```

```python
from urllib import request

goog_url = http://real-chart.finance.yahoo.com/table.csv?s=GOOG&d=2&e=8&f=2015&g=d&a=2&b=27&c=2014&ignore=.csv

def download_stock_data(csv_url):
    response = request.urlopen(csv_url)
    csv = response.read()
    csv_str = str(csv)
    lines = csv_str.split("\\n")
    dest_url = r'goog.csv'
    fx = open(dest_url, "w")
    for line in lines:
        fx.write(line + "\n")
    fx.close()

download_stock_data(goog_url)
```

```python
while True:
    try:
        number = int(input("What's your fav number hoss?\n"))
        print(18/number)
        break
    except ValueError:
        print("Make sure and enter a number")
    except ZeroDivisionError:
        print("Don't pick zero")
    except:
        break
    finally:
        print("loop complete")
```

```python
class Enemy:
    life = 3

    def attack(self):
        print("ouch!")
        self.life -=1

    def checkLife(self):
        if self.life <= 0:
            print("I am dead")
        else:
            print(str(self.life) + " life left")

enemy1 = Enemy()
enemy2 = Enemy()

enemy1.attack()
enemy1.attack()
enemy1.checkLife()
enemy2.checkLife()
```

```python
class Enemy:
    def __init__(self, x):
        self.energy = x

    def get_energy(self):
        print(self.energy)

jason = Enemy(5)
sandy = Enemy(18)

jason.get_energy()
sandy.get_energy()
```

```python
class Girl:

    gender = 'female'

    def __init__(self, name):
        self.name = name

r = Girl('Rachel')
s = Girl('Stanky')
print(r.gender)
print(s.gender)
print(r.name)
print(s.name)
```

```python
class Parent:

    def print_last_name(self):
        print('Roberts')

class Child(Parent):

    def print_first_name(self):
        print('Bucky')

    def print_last_name(self):
        print('Snitzleberg')

bucky = Child()
bucky.print_first_name()
bucky.print_last_name()
```

```python
class Mario():

    def move(self):
        print('I am moving!')

class Shroom():

    def eat_shroom(self):
        print('Now I am big!')

class BigMario(Mario, Shroom):
    pass

bm = BigMario()
bm.move()
bm.eat_shroom()
```

```python
def drop_first_last(grades):
    first, *middle, last = grades
    avg = sum(middle) / len(middle)
    print(avg)

drop_first_last([65, 76, 98, 54, 21])
drop_first_last([65, 76, 98, 54, 21, 54, 65, 99, 88, 78])
```

```python
first = ['Mohit', 'Abhey', 'Akshay']
last = ['Khare', 'Rana', 'Sharma']

names = zip(first, last)

for a, b in names:
    print(a, b)
```

```python
answer = lambda x: x*7
print(answer(5))
```

gha_language: Jupyter Notebook


text:
# minecraft-docker

A minimal minecraft server based on [papermc](https://papermc.io/) and the docker-images of [Nerd2201](https://github.com/Nerd2201/docker-images).

## Usage

This repository provides a simple makefile.

```shell
# Build
make build

# Run
make run

# Access logs
make logs

# Stop
make stop

# Cleanup
make clean

# Delete the volume
make cleanall
```

repository: andresterba/minecraft-docker

repo_name: andresterba/minecraft-docker


text:
# pytest is a mature full-featured Python testing tool that helps you write better programs.
[https://docs.pytest.org/en/latest/](https://docs.pytest.org/en/latest/)
## Pytest with selenium for browser based functional testing
Use pytest-selenium python library for easy integration
[https://pytest-selenium.readthedocs.io](https://pytest-selenium.readthedocs.io)
- Install
```
pip install pytest-selenium
```

repository: rajarshig/MyReference

gha_language: Dockerfile

repo_name: rajarshig/MyReference


text:
# Installation

Assuming you have a local copy of the KinoML repository, `cd` into the repo and use `conda` to create an environment:

1. `conda env create -n kinoml -f devtools/conda-envs/test_env.yaml`
2. `conda activate kinoml`
3. `pip install .`

Note this has only been tested in Linux and MacOS. In the future, a `conda` package `kinoml` will be provided, but right now we are in a very early stage of development.

repository: t-kimber/kinoml

repo_name: t-kimber/kinoml


text:
<!-- PROJECT SHIELDS -->
<!--
*** I'm using markdown "reference style" links for readability.
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
*** See the bottom of this document for the declaration of the reference variables
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
-->

# Helm Chart: Google Microservices Demo

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]

<!-- TABLE OF CONTENTS -->
## Table of Contents

* [About the Project](#about-the-project)
* [Getting Started](#getting-started)
  * [Prerequisites](#prerequisites)
* [Installation](#installation)
  * [Istio-enabled](#Istio-enabled)
* [Un-Install](#un-installation)

<!-- ABOUT THE PROJECT -->
## About The Project

I wanted a helm chart of [Googles microservices demo](https://github.com/GoogleCloudPlatform/microservices-demo) to deploy and maintain the deployment using helm. That's it.

<!-- GETTING STARTED -->
## Getting Started

Get yourself a copy of the repo: [git@github.com:ronamosa/hipstershop-demo.git](git@github.com:ronamosa/hipstershop-demo.git), and follow the instructions below, depending on your intended setup.

### Prerequisites

#### Local setup: microK8s

Ubuntu:

```sh
sudo snap install microk8s --classic
microk8s.status
```

enable helm version 3

```sh
microk8s.enable helm3
```

#### Remote setup: cloud

TBC

## Installation

### Non-Istio

Do a dry-run first before you deploy to make sure the charts are happy.

The cli convention here is: `helm-command 'install|upgrade --install' '--debug --dry-run' <helm release name> <chart-folder>`

```sh
microk8s.helm3 install --debug --dry-run hipstershop helm/
```

Now, deploy it

```sh
microk8s.helm3 install --debug hipstershop helm/
```

Check the release

```sh
microk8s.helm3 list
NAME       	NAMESPACE	REVISION	UPDATED                                 	STATUS  	CHART            	APP VERSION
hipstershop	default  	1       	2020-07-15 19:25:45.695583276 +1200 NZST	deployed	hipstershop-0.1.0	1.16.0
```

### Istio-enabled

Enable istio in microK8s:

```sh
microk8s.enable istio
```

Enable side-car injection on the namespace where helm chart will be deployed e.g. 'default'

```sh
microk8s.kubectl label namespace default istio-injection=enabled
```

Deploy helm chart

```sh
microk8s.helm3 install --debug hipstershop helm/
```

Check the release

```sh
microk8s.helm3 list
NAME       	NAMESPACE	REVISION	UPDATED                                 	STATUS  	CHART            	APP VERSION
hipstershop	default  	1       	2020-07-15 19:25:45.695583276 +1200 NZST	deployed	hipstershop-0.1.0	1.16.0
```

Check the deployment for Istio side-cars, each pod should have a READY column with '2/2'

```sh
microk8s.kubectl get po
NAME                                     READY   STATUS    RESTARTS   AGE
adservice-59bd9cb647-9z28b               2/2     Running   0          114s
cartservice-6d4ccdfd5-qhbfl              2/2     Running   3          114s
checkoutservice-56cd667bbb-fq4xt         2/2     Running   0          113s
currencyservice-6cb45fbff5-l4xsj         2/2     Running   0          114s
emailservice-75c874fb64-fxlzw            2/2     Running   0          114s
frontend-5444bd96ff-6glnb                2/2     Running   1          114s
loadgenerator-7cb5886b74-wj4hf           2/2     Running   4          113s
paymentservice-6586f9667d-drq5n          2/2     Running   0          114s
productcatalogservice-565d4975cd-8mkcl   2/2     Running   0          114s
recommendationservice-596bbccd5d-cpjz4   2/2     Running   0          114s
redis-cart-8465c75f49-kr76p              2/2     Running   0          113s
shippingservice-6ccbc78688-mfz46         2/2     Running   0          114s
```

Check Istio proxy status

```sh
microk8s.istioctl ps
NAME                                                   CDS        LDS        EDS        RDS          PILOT                            VERSION
adservice-59bd9cb647-9z28b.default                     SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
cartservice-6d4ccdfd5-qhbfl.default                    SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
checkoutservice-56cd667bbb-fq4xt.default               SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
currencyservice-6cb45fbff5-l4xsj.default               SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
emailservice-75c874fb64-fxlzw.default                  SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
frontend-5444bd96ff-6glnb.default                      SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
istio-egressgateway-79b99bfc6b-lrj5d.istio-system      SYNCED     SYNCED     SYNCED     NOT SENT     istio-pilot-856b6b9b8f-p97pc     1.5.1
istio-ingressgateway-696d6f46f5-48h4g.istio-system     SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
loadgenerator-7cb5886b74-wj4hf.default                 SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
paymentservice-6586f9667d-drq5n.default                SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
productcatalogservice-565d4975cd-8mkcl.default         SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
recommendationservice-596bbccd5d-cpjz4.default         SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
redis-cart-8465c75f49-kr76p.default                    SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
shippingservice-6ccbc78688-mfz46.default               SYNCED     SYNCED     SYNCED     SYNCED       istio-pilot-856b6b9b8f-p97pc     1.5.1
```

## Access the Hipster Shop

If your deploy went without error you should be able to run these commands and see the IP addressses of the services you deployed:

for example

```sh
microk8s.kubectl get svc
NAME                    TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
adservice               ClusterIP      <IP_ADDRESS>    <none>        9555/TCP       4m
cartservice             ClusterIP      <IP_ADDRESS>    <none>        7070/TCP       4m
checkoutservice         ClusterIP      <IP_ADDRESS>   <none>        5050/TCP       4m
currencyservice         ClusterIP      <IP_ADDRESS>   <none>        7000/TCP       4m
emailservice            ClusterIP      <IP_ADDRESS>    <none>        5000/TCP       4m
frontend                ClusterIP      <IP_ADDRESS>    <none>        80/TCP         4m
frontend-external       LoadBalancer   <IP_ADDRESS>   <pending>     80:31446/TCP   4m
kubernetes              ClusterIP      <IP_ADDRESS>     <none>        443/TCP        16d
paymentservice          ClusterIP      <IP_ADDRESS>   <none>        50051/TCP      4m
productcatalogservice   ClusterIP      <IP_ADDRESS>    <none>        3550/TCP       4m
recommendationservice   ClusterIP      <IP_ADDRESS>    <none>        8080/TCP       4m
redis-cart              ClusterIP      <IP_ADDRESS>   <none>        6379/TCP       4m
shippingservice         ClusterIP      <IP_ADDRESS>    <none>        50051/TCP      4m
```

Open your browser to `http://<IP_ADDRESS>` (frontend) or `http://<IP_ADDRESS>` (frontend-external)

## Patch frontend-external

If you want to expose your shop deployment to your LAN (the network your PC is on) use the following command to patch the `frontend-external` service to your machines IP address

`kubectl patch svc frontend-external -n hipster-shop -p '{"spec": {"type": "LoadBalancer", "externalIPs":["<ip-address of masternode>"]}}'`

for example, have look at your k8s services

```sh
$ microk8s.kubectl get svc

NAME                    TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
adservice               ClusterIP      <IP_ADDRESS>   <none>        9555/TCP       3h26m
cartservice             ClusterIP      <IP_ADDRESS>   <none>        7070/TCP       3h26m
checkoutservice         ClusterIP      <IP_ADDRESS>   <none>        5050/TCP       3h26m
currencyservice         ClusterIP      <IP_ADDRESS>   <none>        7000/TCP       3h26m
emailservice            ClusterIP      <IP_ADDRESS>    <none>        5000/TCP       3h26m
frontend                ClusterIP      <IP_ADDRESS>    <none>        80/TCP         3h26m
frontend-external       LoadBalancer   <IP_ADDRESS>   <pending>     80:30829/TCP   3h26m
kubernetes              ClusterIP      <IP_ADDRESS>     <none>        443/TCP        11d
paymentservice          ClusterIP      <IP_ADDRESS>   <none>        50051/TCP      3h26m
productcatalogservice   ClusterIP      <IP_ADDRESS>    <none>        3550/TCP       3h26m
recommendationservice   ClusterIP      <IP_ADDRESS>   <none>        8080/TCP       3h26m
redis-cart              ClusterIP      <IP_ADDRESS>     <none>        6379/TCP       3h26m
shippingservice         ClusterIP      <IP_ADDRESS>    <none>        50051/TCP      3h26m
```

get your computers IP address (e.g. <IP_ADDRESS>)

run the patch: `microk8s.kubectl patch svc frontend-external -p '{"spec": {"type": "LoadBalancer", "externalIPs":["<IP_ADDRESS>"]}}'`

check out your k8s services again

```sh
$ microk8s.kubectl get svc
NAME                    TYPE           CLUSTER-IP       EXTERNAL-IP    PORT(S)        AGE
adservice               ClusterIP      <IP_ADDRESS>   <none>         9555/TCP       6h45m
cartservice             ClusterIP      <IP_ADDRESS>   <none>         7070/TCP       6h45m
checkoutservice         ClusterIP      <IP_ADDRESS>   <none>         5050/TCP       6h45m
currencyservice         ClusterIP      <IP_ADDRESS>   <none>         7000/TCP       6h45m
emailservice            ClusterIP      <IP_ADDRESS>    <none>         5000/TCP       6h45m
frontend                ClusterIP      <IP_ADDRESS>    <none>         80/TCP         6h45m
frontend-external       LoadBalancer   <IP_ADDRESS>   <IP_ADDRESS>   80:30829/TCP   6h45m
kubernetes              ClusterIP      <IP_ADDRESS>     <none>         443/TCP        11d
paymentservice          ClusterIP      <IP_ADDRESS>   <none>         50051/TCP      6h45m
productcatalogservice   ClusterIP      <IP_ADDRESS>    <none>         3550/TCP       6h45m
recommendationservice   ClusterIP      <IP_ADDRESS>   <none>         8080/TCP       6h45m
redis-cart              ClusterIP      <IP_ADDRESS>     <none>         6379/TCP       6h45m
shippingservice         ClusterIP      <IP_ADDRESS>    <none>         50051/TCP      6h45m
```

Now, open `http://<IP_ADDRESS>:30829` and you will see the hipster shop.

### StackDriver errors

If you see the recommendationservice pod 'CrashLooping', check the logs and if they are talking about `'GOOGLE_APPLICATION_CREDENTIALS'` being missing you have two choices:

1. Get your creds from your GCP account, save them as a .json file, and then run `'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/json/file'`, and now your stackdriver should be ok.
2. Disable the functions in the microservice that needs stackdriver

make sure your `'recommendationservice/templates/deployment.yaml'` has these uncommented

```yaml
  - name: DISABLE_TRACING
    value: "1"
  - name: DISABLE_PROFILER
    value: "1"
  - name: DISABLE_DEBUGGER
    value: "1"
```

### Un-Installation

Uninstallation is really easy with helm, run this command and watch (only if you want to) the pods terminate and everything deployed by helm will be removed (remember the release name for the example is 'hipstershop'):

```sh
microk8s.helm3 delete hipstershop
```

## Contact

Ron Amosa<EMAIL_ADDRESS>
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/ronamosa/hipstershop-demo.svg?style=flat-square
[contributors-url]: https://github.com/ronamosa/hipstershop-demo/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/ronamosa/hipstershop-demo.svg?style=flat-square
[forks-url]: https://github.com/ronamosa/hipstershop-demo/network/members
[stars-shield]: https://img.shields.io/github/stars/ronamosa/hipstershop-demo.svg?style=flat-square
[stars-url]: https://github.com/ronamosa/hipstershop-demo/stargazers
[issues-shield]: https://img.shields.io/github/issues/ronamosa/hipstershop-demo.svg?style=flat-square
[issues-url]: https://github.com/ronamosa/hipstershop-demo/issues
[license-shield]: https://img.shields.io/github/license/ronamosa/hipstershop-demo.svg?style=flat-square
[license-url]: https://github.com/ronamosa/hipstershop-demo/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/ron-amosa

repository: ronamosa/hipstershop-demo

gha_language: Smarty

repo_name: ronamosa/hipstershop-demo


text:
pchico83/compose-up
===================

A docker image that clones a git repository and runs the `docker-compose.yml` file on it.

# Usage

## Run `docker-compose.yml` from Git repository

Run the following command:

	docker run --rm -it --privileged -e REPOSITORY=$REPOSITORY -e COMMIT=$COMMIT -e PATH=$PATH -e VERSION=$VERSION pchico83/compose-up

Where:

* `$REPOSITORY` is the git repository to clone, i.e. `https://github.com/pchico83/compose-up.git`.
* `$COMMIT` (optional, defaults to _HEAD_) is the git commit to be used.
* `$PATH` (optional, defaults to _/docker-compose.yml_) is the relative path to the root of the repository where the `docker-compose.yml` file is located.
* `$VERSION` (optional, defaults to _1.3.2_) is the _docker-compose_ version to be used.

Note that you need to publish the required ports if you want you `docker-compose.yml` file to be accesible from the host network.

## Adding credentials via .dockercfg

If your `docker-compose.yml` file requires private images, you can pass their credentials either by mounting your local `.dockercfg` file inside the container appending:

```
-v $HOME/.dockercfg:/.dockercfg:r
```

or by providing the contents of this file via an environment variable called `$DOCKERCFG`:

```
-e DOCKERCFG=$(cat $HOME/.dockercfg)
```

## Using the host docker daemon instead of docker-in-docker

If you want to use the host docker daemon instead of letting the container run its own, mount the host's docker unix socket inside the container by appending:

```
-v /var/run/docker.sock:/var/run/docker.sock:rw
-v /usr/bin/docker:/usr/bin/docker:rw

```

to the `docker run` command. Note that this will cache your `docker-compose.yml` iamges between different executions of the `compose-up` image and will make ports published in the `docker-compose.yml` file directly accesible from the host network, but will not clean the created container when the `compose-up` container is terminated.


text:
---
layout: essay
type: essay
title: Freshly Baked Project
# All dates must be YYYY-MM-DD format!
date: 2021-04-29
labels:
  - Design patterns
  - Programming
---

## Baking

Recently I got back into baking, more specifically baking bread. The basic ingredients for most breads are flour, yeast, sugar, salt, and water. The addition of other ingredients produces different types of breads, airy, dense, sweet or savory, but the dough is pretty much the same. Before the bread is baked or steamed, there are many actions that are done to the dough like proofing (activating the yeast for the dough to rise), kneading, and punching down. Weather conditions play a role in knowing how long or quick the dough will proof. Depending on the type of bread, multiple kneads and proofs may be required, as well as how long to knead, I kneaded a dough for seven minutes! As the baker, creative liberties are taken to shaping and decorating the dough.

## "Kneading" Patterns

Design patterns can be applied to bread baking. The basic dough is the factory method’s object and added ingredients are the child classes. The baker uses the observer pattern to monitor the conditions and events of the dough that triggers actions like punching it down and kneading, shaping the dough, and baking or steaming. In a model-view-controller pattern, the ingredients are the model, the dough and baker are the views, and the controller takes the actions from the baker, interacts with the model and views. For example: the baker combines the ingredients to form a dough, the yeast activates causing the dough to rise. The baker punches down and kneads the dough once or multiple times. When the dough is ready, the baker shapes and bakes the dough, resulting in freshly baked bread.

## Mainly MVC

In programming projects I’ve created, I mainly use the model-view-controller design pattern where a SQL server or Microsoft Access database is the model. The views are the web pages and forms that contain actionable items like buttons for the end user to interact with the model. The buttons act as the controller to perform a certain type of action such as generating a report or saving data.


text:
---
title: Mini Stats
layout: usermanual-page.hbs
position: 3
---

Mini stats is a lightweight graphical display of an application's key performance statistics. It shows draw call count, frame time, CPU load and (where supported) GPU load.

Editor users can enable the mini-stats panel via the Launch button menu:

Clicking on the mini-stats will cycle through three supported sizes:

The information displayed is as follows:

* **DrawCalls** - The number of rendered objects dispatched every frame. Each draw call has a cost on the CPU and GPU, so minimizing this number is sensible.
* **Frame** - The total time in milliseconds for the browser to process each frame.
* **GPU** - Shows the time in milliseconds to render each frame by the GPU. This stat is only shown if the underlying WebGL implementation supports the extension `EXT_disjoint_timer_query` (WebGL 1.0) or `EXT_disjoint_timer_query_webgl2` (WebGL 2.0). You can confirm whether your browser supports either of these extensions by visiting [WebGL Report][1].
* **CPU** - Shows the time in milliseconds to render each frame by the CPU.

The CPU and GPU graphs display a breakdown of the update and render portion of the frame using red and green respectively.

## Using Mini-Stats Outside of the Editor

While the mini-stats panel is incorporated into the Editor's Launch page, you can also use it independent of the Editor. The source code can be found [here][2]. Simply build `playcanvas-extras.js`, include it in your project and call:

```javascript
    const miniStats = new pcx.MiniStats(app);
```

The ['Engine-only' examples][3] all do this.

[1]: https://webglreport.com/
[2]: https://github.com/playcanvas/engine/tree/master/extras/mini-stats
[3]: https://playcanvas.github.io/

branch_name: refs/heads/dev

gha_language: JavaScript


text:
Once you know how to access to your Metavisitor Galaxy instance with a web browser and are able to perform basic start/stop/restart operations, there is still some work needed to import and configure reference data (genomes) so that they are directly available to all instance users for running tools and workflows

Here we provide the step-by-step description of what we *actually did ourselves* to prepare our Metavisitor instance before performing the analyses described [here](http://dx.doi.org/10.1101/048983).

## 1. Connect to your Metavisitor Galaxy admin account with your web browser

## 2. Import reference data in an history "References"

At first, you need to import and prepare the reference datasets you will need for most of the Metavisitor analyses. As a Galaxy admin you will make latter some of these references directly accessible to the Galaxy tools, and/or accessible to any other users by putting them in a Galaxy public library.

#### a. Preliminary actions
click on the `Analyze Data` menu
rename the `Unnamed history` to `References`

#### b. Upload nucleotide vir1 fasta file

```
Click on the small arrow icon at the top of the tool bar (left handside of the Galaxy interface)
In the open window, click on the Paste/Fetch data button
Paste the URL https://ndownloader.figshare.com/files/4949173
Click the start button.
```
A first dataset will show up in your history, first in grey (the job is starting), then yellow (the job - upload - is running), and eventually green (job is successfully done).

When finished, rename the dataset 1 `https://ndownloader.figshare.com/files/4949173` to `nucleotide vir1` for clarity (using the small pencil icon).

#### c. Upload protein vir1 fasta file
Repeat the same operation as in `b.` using the url `https://ndownloader.figshare.com/files/4949170`.
When finished, rename the dataset 2 `https://ndownloader.figshare.com/files/4949170` to `protein vir1` for clarity.

#### d. Upload the Drosophila melanogaster release 6 genome
Repeat the same operation as in `b.` using the url `ftp://ftp.flybase.net/genomes/Drosophila_melanogaster/dmel_r6.10_FB2016_02/fasta/dmel-all-chromosome-r6.10.fasta.gz`.
When finished, rename the dataset 3 `ftp://ftp.flybase.net/genomes/Drosophila_melanogaster/dmel_r6.10_FB2016_02/fasta/dmel-all-chromosome-r6.10.fasta.gz` to `dm6` for clarity.

#### e. Upload the Anopheles gambiae release P4
Repeat the same operation as in `b.` using the url `https://www.vectorbase.org/sites/default/files/ftp/downloads/Anopheles-gambiae-PEST_CHROMOSOMES_AgamP4.fa.gz`.
When finished, rename the dataset 4 `https://www.vectorbase.org/sites/default/files/ftp/downloads/Anopheles-gambiae-PEST_CHROMOSOMES_AgamP4.fa.gz` to `AgamP4` for clarity.

#### f. Upload the Plasmodium berghei genome
Repeat the same operation as in `b.` using the url `ftp://ftp.ensemblgenomes.org/pub/release-28/protists/fasta/plasmodium_berghei/dna/Plasmodium_berghei.May_2010.28.dna_sm.genome.fa.gz`.
When finished, rename the dataset 5 `ftp://ftp.ensemblgenomes.org/pub/release-28/protists/fasta/plasmodium_berghei/dna/Plasmodium_berghei.May_2010.28.dna_sm.genome.fa.gz` to `P. berghei` for clarity.

#### g. Upload the Homo sapiens release GRCh38/hg19
Repeat the same operation as in `b.` using the url `ftp://ftp.ensembl.org/pub/release-84/fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz`.
When finished, rename the dataset 6 `ftp://ftp.ensembl.org/pub/release-84/fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz` to `hg19` for clarity.

## 3. Prepare Blast databases
#### a. Nucleotide vir1 blast database
Use the tool `NCBI BLAST+ makeblastdb`, check the radio button "nucleotide", select the dataset 1 (nucleotide vir1), give "nucleotide vir1 blastdb" as a "Title for BLAST database", leave the rest of the tool form unchanged and click "Execute" button.

Rename the generated dataset 7 "nucleotide BLAST database from data 1" to "nucleotide vir1 blast database" for clarity

#### b. Protein vir1 blast database
Use the tool `NCBI BLAST+ makeblastdb`, check the radio button "protein", select the dataset 2 (protein vir1), give "protein vir1 blastdb" as a "Title for BLAST database", leave the rest of the tool form unchanged and click "Execute" button.

Rename the generated dataset 8 "protein BLAST database from data 2" to "protein vir1 blast database" for clarity

## 4. Creating Galaxy dbkey and fasta references accessible to tools for every user
Here we are going in the `admin` panel, click `Local data` in the left menu and select the `Create DBKey and Reference Genome` in the "**Run Data Manager Tools**" (last line of the top section).

#### a. nucleotide vir1
in the newly open browser window (from the last click on `Create DBKey and Reference Genome`)
- select "New" for `Use existing dbkey or create a new one`
- enter "vir1" in the `dbkey`field
- leave "Display name for dbkey", `Name of sequence` and `ID for sequence` empty !
- select `history` in the `Choose the source for the reference genome` menu
- select "nucleotide vir1" in the `FASTA File` menu
- let `Sort by chromosome name` selected on `As is`
- press the `execute`button !

#### b. dm6
Repeat the operation described in a., but this time

- put "dm6" for the `dbkey` field
- select "3: dm6" in the `FASTA File` menu

Be sure that the `References` history is selected in the background, otherwise the uploaded genomes will not be available in this menu.

#### c. AgamP4
Repeat the operation described in a., but this time

- put "AgamP4" for the `dbkey` field
- select "4: AgamP4" in the `FASTA File` menu

Be sure that the `References` history is selected in the background, otherwise the uploaded genomes will not be available in this menu.

#### d. hg19
Repeat the operation described in a., but this time

- put "hg19" for the `dbkey` field
- select "6: hg19" in the `FASTA File` menu

Be sure that the `References` history is selected in the background, otherwise the uploaded genomes will not be available in this menu.

## 5. Creating Galaxy bowtie indexes accessible to tools for every user
Now we are going to generate the bowtie indexes using another data manager tool.
But before doing this, we have to perform a low level Galaxy admin task: restart the Galaxy server instance so that the dbkey and the fasta genomes that we've just created for the server are registered and seen by the tools.

Depending on your skill level, you have the simple, dirty way:

- reboot the machine where the galaxy server is running !

or the clean, freaking (for non-Geek normal biologists) way:

- Connect to the server where the Galaxy instance has been installed either through an ssh connection or using your local terminal. and type

`sudo supervisorctl restart galaxy:`

If everything went fine you should see in your terminal
```
# supervisorctl restart galaxy:
galaxy_web: stopped
handler0: stopped
handler1: stopped
handler0: started
handler1: started
galaxy_web: started
```
 freaking insn't it ?

----
#### a. vir 1 bowtie index
Now, Go back to your web browser and the `admin` panel, click again `Local data` in the left menu and  select this time the `Bowtie index - builder` in the "**Run Data Manager Tools**" (top section).

select "vir1" in the `Source FASTA Sequence` menu of the Bowtie index builder tool form, leave the other options empty, and click execute.

#### b. dm6 bowtie index
Go back to your web browser and the `admin` panel, click again `Local data` in the left menu and  select this time the `Bowtie index - builder` in the "**Run Data Manager Tools**" (top section).

select "dm6" in the `Source FASTA Sequence` menu of the Bowtie index builder tool form, leave the other options empty, and click execute.

#### c. AgamP4 bowtie index
Go back to your web browser and the `admin` panel, click again `Local data` in the left menu and  select this time the `Bowtie index - builder` in the "**Run Data Manager Tools**" (top section).

select "AgamP4" in the `Source FASTA Sequence` menu of the Bowtie index builder tool form, leave the other options empty, and click execute.

#### d. hg19 bowtie index
Go back to your web browser and the `admin` panel, click again `Local data` in the left menu and  select this time the `Bowtie index - builder` in the "**Run Data Manager Tools**" (top section).

select "hg19" in the `Source FASTA Sequence` menu of the Bowtie index builder tool form, leave the other options empty, and click execute.

----
#### Note that the preparation of bowtie indexes can be long ! (several hours for the vir1 bowtie index for instance)

** When bowtie indexes are ready (green in the `Data Manager History (automatically created)`) restart the Galaxy server instance as explained above, so that the bowtie indexes that we've just created for the server are registered and seen by the tools.**

## 6. Creating Galaxy bowtie2 indexes accessible to tools for every user
Finally, we are going to generate the bowtie2 indexes using another data manager tool.
If not done before, restart the Galaxy instance as explained above.

----
#### a. vir 1 bowtie2 index
Now, Go back to your web browser and the `admin` panel, click again `Local data` in the left menu and  select this time the `Bowtie2 index - builder` in the "**Run Data Manager Tools**" (top section).

select "vir1" in the `Source FASTA Sequence` menu of the Bowtie index builder tool form, leave the other options empty, and click execute.

#### b. AgamP4 bowtie2 index
Go back to your web browser and the `admin` panel, click again `Local data` in the left menu and  select this time the `Bowtie2 index - builder` in the "**Run Data Manager Tools**" (top section).

select "AgamP4" in the `Source FASTA Sequence` menu of the Bowtie index builder tool form, leave the other options empty, and click execute.

#### c. hg19 bowtie2 index
Go back to your web browser and the `admin` panel, click again `Local data` in the left menu and  select this time the `Bowtie2 index - builder` in the "**Run Data Manager Tools**" (top section).

select "hg19" in the `Source FASTA Sequence` menu of the Bowtie index builder tool form, leave the other options empty, and click execute.

----
#### Note that the preparation of bowtie2 indexes can be long too ! (several hours for the vir1 bowtie2 index for instance)

** When bowtie2 indexes are ready (green in the `Data Manager History (automatically created)`) restart the Galaxy server instance as explained above, so that the bowtie indexes that we've just created for the server are registered and seen by the tools.**

repository: ARTbio/Metavisitor-manual

gha_language: Shell

repo_name: ARTbio/Metavisitor-manual


text:
# Hamming

Calculate the Hamming difference between two DNA strands.

A mutation is simply a mistake that occurs during the creation or
copying of a nucleic acid, in particular DNA. Because nucleic acids are
vital to cellular functions, mutations tend to cause a ripple effect
throughout the cell. Although mutations are technically mistakes, a very
rare mutation may equip the cell with a beneficial attribute. In fact,
the macro effects of evolution are attributable by the accumulated
result of beneficial microscopic mutations over many generations.

The simplest and most common type of nucleic acid mutation is a point
mutation, which replaces one base with another at a single nucleotide.

By counting the number of differences between two homologous DNA strands
taken from different genomes with a common ancestor, we get a measure of
the minimum number of point mutations that could have occurred on the
evolutionary path between the two strands.

This is called the 'Hamming distance'.

It is found by comparing two DNA strands and counting how many of the
nucleotides are different from their equivalent in the other string.

    GAGCCTACTAACGGGAT
    CATCGTAATGACGGCCT
    ^ ^ ^  ^ ^    ^^

The Hamming distance between these two DNA strands is 7.

# Implementation notes

The Hamming distance is only defined for sequences of equal length, so
an attempt to calculate it between sequences of different lengths should
not work. The general handling of this situation (e.g., raising an
exception vs returning a special value) may differ between languages.

## Rust Installation

Refer to the [exercism help page][help-page] for Rust installation and learning
resources.

## Writing the Code

Execute the tests with:

```bash
$ cargo test
```

All but the first test have been ignored. After you get the first test to
pass, open the tests source file wich is located in the `tests` directory
and remove the `#[ignore]` flag from the next test and get the tests to pass
again. Each separate test is a function with `#[test]` flag above it.
Continue, until you pass every test.

If you wish to run all tests without editing the tests source file, use:

```bash
$ cargo test -- --ignored
```

To run a specific test, for example `some_test`, you can use:

```bash
$ cargo test some_test
```

If the specfic test is ignored use:

```bash
$ cargo test some_test -- --ignored
```

To learn more about Rust tests refer to the [online test documentation][rust-tests]

Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
haven't already, it will help you with organizing your files.

## Feedback, Issues, Pull Requests

The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!

If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).

[help-page]: http://exercism.io/languages/rust
[modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
[cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
[rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html

## Source

The Calculating Point Mutations problem at Rosalind [http://rosalind.info/problems/hamm/](http://rosalind.info/problems/hamm/)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.


text:
##What's Countly?

[Countly](http://count.ly) is an innovative, real-time, open source mobile analytics application.
It collects data from mobile devices, and visualizes this information to analyze mobile application
usage and end-user behavior. There are two parts of Countly: the server that collects and analyzes data,
and mobile SDK that sends this data. Both parts are open source with different licensing terms.

This repository includes the SDK for Windows Phone. It's developed by [Tom Myles](mailto:tom.m935@gmail.com), [Devran<EMAIL_ADDRESS>and [Orkun Senturk](mailto:orkun.senturk@8bitiz.com).

##Installing Windows Phone SDK

  1. Download Countly Windows Phone SDK
  2. Extract all to any folder
  3. Open **Countly.sln** file with Visual Studio 2012
  4. You now have three projects in your solution : Countly (main SDK) , OpenUDID (dependency) and Countly Test quickstarter project.
  5. Right click solution , click **"Manage NuGet Packages"**. Select Online and search for **Json.NET** and install it for Countly SDK project only. After installation completed, go to References of the Countly SDK project and check **newtonsoft.json** is added to the references.
  6. Right click Countly SDK project, click Properties, then at Application tab select appropriate **"Target Windows Phone OS Version"**. If you select Windows 7, please **comment or remove line 2 in Countly.cs** in Countly SDK project :

   #define WP8

  7. Right click Countly Test , click properties then at Application tab select **Target Windows Phone OS Version**.

  8. Go to **App.xaml** file in Countly Test project and update init method in **Application_Activated** and **Application_Deactivated** event handlers with your application key. There is third optional parameter at init method which you can use to send your application version number to countly. Final look should be like this :

...
   // Code to execute when the application is launching (eg, from Start)
        // This code will not execute when the application is reactivated
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            System.Threading.ThreadPool.QueueUserWorkItem((o) =>
                {
                    Countly.Countly.SharedInstance().init("http://demo.count.ly", "YOUR_APP_KEY", "2.0");
                    Countly.Countly.SharedInstance().OnStart();
                });
        }

        // Code to execute when the application is activated (brought to foreground)
        // This code will not execute when the application is first launched
        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
            System.Threading.ThreadPool.QueueUserWorkItem((o) =>
            {
                Countly.Countly.SharedInstance().init("http://demo.count.ly", "YOUR_APP_KEY", "2.0");
                Countly.Countly.SharedInstance().OnStart();
            });
        }
...

  9. Build solution and now you have ready for test your first application. Right click to Countly Test project and click **"Set as StartUp Project"**

  10. You can run your application on a device or an emulator provided by Visual Studio Windows Phone 8 development kit.

Check Countly Server source code here:

- [Countly Server (countly-server)](https://github.com/Countly/countly-server)

There are also other Countly SDK repositories below:

- [Countly iOS SDK](https://github.com/Countly/countly-sdk-ios)
- [Countly Android SDK](https://github.com/Countly/countly-sdk-android)
- [Countly Windows Phone SDK](https://github.com/Countly/countly-sdk-windows-phone)
- [Countly Blackberry Webworks SDK](https://github.com/Countly/countly-sdk-blackberry-webworks)
- [Countly Blackberry Cascades SDK](https://github.com/craigmj/countly-sdk-blackberry10-cascades) (Community supported)
- [Countly Mac OS X SDK](https://github.com/mrballoon/countly-sdk-osx) (Community supported)
- [Countly Appcelerator Titanium SDK](https://github.com/euforic/Titanium-Count.ly) (Community supported)
- [Countly Unity3D SDK](https://github.com/Countly/countly-sdk-unity) (Community supported)

##How can I help you with your efforts?
Glad you asked. We need ideas, feedbacks and constructive comments. All your suggestions will be taken care with upmost importance.

We are on [Twitter](http://twitter.com/gocountly) and [Facebook](http://www.facebook.com/Countly) if you would like to keep up with our fast progress!

For community support page, see [http://support.count.ly](http://support.count.ly "Countly Support").

repository: jvlstudio/countly-sdk-windows-phone

repo_name: jvlstudio/countly-sdk-windows-phone


text:
# cson

A [CSON](https://github.com/bevry/cson)
parser, with full unmarshalling support, in Go.

How? It takes an CSON input and converts it to JSON, and lets the
native Golang parser do the hard stuff.

### Warning

 * Currently does not handle "array of objects".  Neither CSON nor
   CoffeeScript sites have examples.  The only reference I found was
   from [stack
   overflow](http://stackoverflow.com/questions/9029481/defining-an-array-of-anonymous-objects-in-coffeescript)
 * It is not clear what the rules are for explicity marking objects using `{` and implicitly using indentation.

### Other differences and/or bugs:

 * Supports CoffeeScript multi-line comments
 * Multi-line strings may have some minor edge case bugs with whitespace

repository: oklahomer/xson

repo_name: oklahomer/xson