text:
---
date: 2012-08-08
layout: post
title:  To install the Hadoop to Linux for design
categories:
- 大数据
tags:
- 大数据
- Hadoop
---

# To install the Hadoop to Linux for design
This is a summary of hadoop stuff by Yaotian. If you have question or correction, please infor me.
Email<EMAIL_ADDRESS>

## Preparation:
    1.Linux server
    2.hadoop 0.20.2 ( It's stable version.)
    3.unzip hadoop to /opt/hadoop.0.20.2 and make ln to /opt/hadoop
        ln -s /opt/hadoop.0.20.2 /opt/hadoop
    4.Install openjdk

## Steps:

a. Need sshd and install it

    apt-get install ssh

And have a test

    ssh localhost

b. To create an account like "hadoop"

    useradd -m -U hadoop
    passwd hadoop

And have a test

    su hadoop

c. To generate the authorizated keys so that user can login the server without password. Before that login as "hadoop" or su to "hadoop"

    su hadoop
    ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
    cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

And have a test, which is supposed not need any password

    ssh localhost

d. If you run the hadoop as root before, you may need change the owner of the folder so that the hadoop can be run by "hadoop" account

    chown -R hadoop:hadoop /opt/hadoop-0.20.2/

e. To update some files of hadoop

conf/hadoop-env.sh and update following:

    export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
    export HADOOP_HOME=/opt/hadoop
    export PATH=$PATH:/opt/hadoop/bin

conf/core-site.xml and add following:

      <property>
              <name>fs.default.name</name>
              <value>hdfs://localhost:9000</value>
      </property>
      <property>
               <name>hadoop.tmp.dir</name>
               <value>/tmp/hadoop/hadoop-${user.name}</value>
      </property>

conf/hdfs-site.xml and add following:

      <property>
              <name>dfs.replication</name>
              <value>1</value>
      </property>

conf/mapred-site.xml

      <property>
        <name>mapred.job.tracker</name>
        <value>localhost:9001</value>
      </property>

f. To format the namenode

    bin/hadoop namenode -format

*If you get the error, maybe you need check if the /tmp/hadoop is the root permission. If that, su to root and delete it.

g. To start hadoop

    bin/start-all.sh

And have a test. This is the admin web interface
    http://localhost:50030/

h. To stop haddop

    bin/stop-all.sh


text:
# SaveURL

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GitHub contributors](https://img.shields.io/github/contributors/dvlpsh/SaveURL)](#contributors)
[![python-3.6.8](https://img.shields.io/badge/python-3.6-blue)](#dependencies)
[![pathlib](https://img.shields.io/badge/-pathlib-blue)](#dependencies)
[![lz4](https://img.shields.io/badge/-lz4-blue)](#dependencies)

![Screenshot](saveurls.jpg)

## Table of contents
* [Description](#description)
* [Dependencies](#dependencies)
* [Setup](#setup)
* [Run this project](#run-this-project)
* [Features](#features)
* [To Do](#to-do)
* [Feature Requests](#feature-requests)
* [Contribute to this Project](#contribute-to-this-project)
* [Contributors](#contributors)
<!--* [Contact](#contact)-->
* [License](#license)

## Description
A simple Python script to save URLS of all open tabs across multiple windows in a single text file.

## Dependencies
Project is created with:
* Python version: 3.6.8
* Pathlib library
* lz4

## Setup
If the above depedencies are already install on your system, skip to [Run this project](#run-this-project).
If not installed, proceed with the installation steps below.

### Installations

#### Install the requirements on a virtual environment
Follow the instructions in [this Github gist](https://gist.github.com/frfahim/73c0fad6350332cef7a653bcd762f08d) for your system.

Or do as follows:
#### Install pip
$`sudo apt-get install python3-pip`

#### Install virtualenv
$`sudo pip3 install virtualenv
`
#### Create a virtual environment
$`virtualenv -p python3.6 url_env `

Once `virtualenv` is installed, activate it using
$`source url_env/bin/activate`

#### Install pathlib module
$`pip install pathlib`

#### Installing lz4
$`pip install lz4`

## Run this project
To run this project, fork and clone this repository. *(Donot forget to star this repository if you like the project :P)*

Execute this script from the terminal/command line using
`$ python save_urls.py`

You will be prompted for the following:
- Save Links to a file
- Open saved files on a Browser Window

Enter your choice.

<!--- Add screenshots for various functions so that it's clear what has been done. --->

## Features
* Provision for automatic saving of all URLs hassle-free
* Opens saved URLs in a specified file on the browser tab

## To Do ##
- Add GUI, if possible
- Add screenshots/GIFs of the working

## Feature Requests ##
Please open an issue titled '[Feature Request]' and provide as much details as possible for what you'd like as a feature.
Any suggestions to make this project better is welcomed! :)

## Contribute to this Project
To contribute to this Project, follow these steps:
- Fork this repository.
- Create a branch: `$ git checkout -b <branch_name>`
- Make your changes and commit them: `$ git commit -m <commit_message>`
- Push to the original branch: `$ git push origin <project_name>/<location>`
- Create the pull request

Alternatively see the GitHub documentation on [creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).

## Contributors
This project is developed and maintained by [@dvlpsh](https://github.com/dvlpsh).

<!--## Contact
Reach me at my email: [dvlpsh21@gmail.com](mailto:dvlpsh21@gmail.com).-->

## License
This project uses the [MIT LICENSE](LICENSE).

license: MIT

repository: dvlpsh/SaveURL

branch_name: refs/heads/master

extension: md

gha_language: Python

license_type: permissive

repo_name: dvlpsh/SaveURL


text:
# Kotlin Clean Architecture Backend

Kotlin backend based on the Clean Architecture principles.

The application is separated into three modules: Domain, Usecases and Adapters

- Domain module contains all entities, it's validation and repository interfaces
- Usecases module performs actions on the domain entities and repositories and does authorization

The domain and usecases modules do not have any external dependencies.

- Adapter layer: each adapter is implemented as a standalone module, lowering dependence on specific frameworks and
  libraries and making them interchangable. The infrastructure module consumes all adapters (e.g. databases, (graphql)
  endpoints, authentication logic)

GraphQL endpoints are auto-generated from the Usecases

##### Technologies:

Ktor, JWT, Exposed, Flyway, KGraphQL/GraphQL generated endpoints, Gradle.

![image](https://miro.medium.com/max/800/1*0R0r00uF1RyRFxkxo3HVDg.png)

## GraphQL Plaground

Default url: http://localhost:8080/graphql

### Login

```
query Login {
  LoginUser(a0: { email<EMAIL_ADDRESS>password: "P@ssw0rd!" })
}
```

### Retrieve current user

```
query CurrentUser {
  AuthenticatedUser {
    id
    email
    authorities
  }
}
```

##### HTTP Headers

```
{
  "Authorization": "Bearer [TOKEN FROM LOGIN]"
}
```

### Create new user

```
mutation CreateUser {
  CreateUser(
    a0: {
      email<EMAIL_ADDRESS>      password: "Penait1!"
      authorities: [USER]
    }
  ) {
    id
    email
    authorities
  }
}
```

##### HTTP Headers

```
{
  "Authorization": "Bearer [TOKEN FROM LOGIN]"
}
```

repository: sobotkami/CleanArchitecture

branch_name: refs/heads/main

repo_name: sobotkami/CleanArchitecture


text:
## **Background**

### **What is Context**

All necessary information to keep a certain operation going on. For example: reading three books at the same time, the page number of each book has been turned is the context of continuing to read the book.

### **Why do you need CS (Context Service)?**

CS is used to solve the problem of data and information sharing across multiple systems in a data application development process.

For example, system B needs to use a piece of data generated by system A. The usual practice is as follows:

1. B system calls the data access interface developed by A system;

2. System B reads the data written by system A into a shared storage.

With CS, the A and B systems only need to interact with the CS, write the data and information that need to be shared into the CS, and read the data and information that need to be read from the CS, without the need for an external system to develop and adapt. , Which greatly reduces the call complexity and coupling of information sharing between systems, and makes the boundaries of each system clearer.

## **Product Range**

![](../../../Images/Architecture/Public_Enhancement_Service/ContextService/linkis-contextservice-01.png)

### Metadata context

The metadata context defines the metadata specification.

Metadata context relies on data middleware, and its main functions are as follows:

1. Open up the relationship with the data middleware, and get all user metadata information (including Hive table metadata, online database table metadata, and other NOSQL metadata such as HBase, Kafka, etc.)

2. When all nodes need to access metadata, including existing metadata and metadata in the application template, they must go through the metadata context. The metadata context records all metadata information used by the application template.

3. The new metadata generated by each node must be registered with the metadata context.

4. When the application template is extracted, the metadata context is abstracted for the application template (mainly, the multiple library tables used are made into \${db}. tables to avoid data permission problems) and all dependent metadata information is packaged.

Metadata context is the basis of interactive workflows and the basis of application templates. Imagine: When Widget is defined, how to know the dimensions of each indicator defined by DataWrangler? How does Qualitis verify the graph report generated by Widget?

### Data context

The data context defines the data specification.

The data context depends on data middleware and Linkis computing middleware. The main functions are as follows:

1. Get through the data middleware and get all user data information.

2. Get through the computing middleware and get the data storage information of all nodes.

3. When all nodes need to write temporary results, they must pass through the data context and be uniformly allocated by the data context.

4. When all nodes need to access data, they must pass the data context.

5. The data context distinguishes between dependent data and generated data. When the application template is extracted, all dependent data is abstracted and packaged for the application template.

### Resource context

The resource context defines the resource specification.

The resource context mainly interacts with Linkis computing middleware. The main functions are as follows:

1. User resource files (such as Jar, Zip files, properties files, etc.)

2. User UDF

3. User algorithm package

4. User script

### Environmental context

The environmental context defines the environmental specification.

The main functions are as follows:

1. Operating System

2. Software, such as Hadoop, Spark, etc.

3. Package dependencies, such as Mysql-JDBC.

### Object context

The runtime context is all the context information retained when the application template (workflow) is defined and executed.

It is used to assist in defining the workflow/application template, prompting and perfecting all necessary information when the workflow/application template is executed.

The runtime workflow is mainly used by Linkis.

## **CS Architecture Diagram**

![](../../../Images/Architecture/Public_Enhancement_Service/ContextService/linkis-contextservice-02.png)

## **Architecture Description:**

### 1. Client
The entrance of external access to CS, Client module provides HA function;
[Enter Client Architecture Design] (ContextService_Client.md)

### 2. Service Module
Provide a Restful interface to encapsulate and process CS requests submitted by the client;
[Enter Service Architecture Design] (ContextService_Service.md)

### 3. ContextSearch
The context query module provides rich and powerful query capabilities for the client to find the key-value key-value pairs of the context;
[Enter ContextSearch architecture design](ContextService_Search.md)

### 4. Listener
The CS listener module provides synchronous and asynchronous event consumption capabilities, and has the ability to notify the Client in real time once the Zookeeper-like Key-Value is updated;
[Enter Listener architecture design](ContextService_Listener.md)

### 5. ContextCache
The context memory cache module provides the ability to quickly retrieve the context and the ability to monitor and clean up JVM memory usage;
[Enter ContextCache architecture design] (ContextService_Cache.md)

### 6. HighAvailable
Provide CS high availability capability;
[Enter HighAvailable architecture design](ContextService_HighAvailable.md)

### 7. Persistence
The persistence function of CS;
[Enter Persistence architecture design](ContextService_Persistence.md)

repository: yangzhiyue/Linkis-Doc

repo_name: yangzhiyue/Linkis-Doc


text:
- [Riot Medicine](https://riotmedicine.net/) - [Håkan Geijer / riot-medicine-en · GitLab](https://gitlab.com/hakan-geijer/riot-medicine-en)
- [EQUIPPED TO SURVIVE (tm) - A Survival Primer](http://www.equipped.com/primer.htm)
- [EQUIPPED TO SURVIVE (tm) - Earthquake & Disaster Preparedness Kits](http://www.equipped.com/earthqk.htm)
- U.S. Army Survival Field Manuals:
	FM 3-05.70:
	- [U.S. Army Field Manual 3-05.70 Survival](http://www.survivalebooks.com/survivalfm3-0570.html)
	- [FM 3-05.70 : Free Download, Borrow, and Streaming : Internet Archive](https://archive.org/details/JungleSurvival/page/n57/mode/2up)

	FM 21-76 (replaced by FM 3-05.70)
	- [FM 21-76 Survival Manual : US-Army : Free Download, Borrow, and Streaming : Internet Archive](https://archive.org/details/Fm21-76SurvivalManual)
	- [U.S. Army survival manual : United States. Department of the Army : Free Download, Borrow, and Streaming : Internet Archive](https://archive.org/details/usarmysurvivalma00depa)
- [Arctic Survival 1953 UK Air Ministry PAM AIR 226 plus Jungle Survival 1950 UK Air Ministry PAM AIR 214](https://archive.org/details/ArcticSurvival/page/n57/mode/2up)

> S: Size up the situation, surroundings, physical condition, equipment.
> U: Use all your sensesR  -  Remember where you are.
> V: Vanquish fear and panic.
> I: Improvise and improve.
> V: Value living.
> A: Act like the natives.
> L: Live by your wits.

url: https://raw.githubusercontent.com/mems/calepin/ff95a8a301a40c5ebb1e1fb4e640d5e17710ac80/Medical and survival/Medical and survival.md

repository: mems/calepin

filename: Medical and survival.md

repo_name: mems/calepin


text:
# Piraeus
## Introduction
Getting the right information to the right place at the right time is a difficult task in highly distributed environments.  Piraeus simplifies how heterogenous subsystems can interact statically, dynamically, and organically using an open-systems approach to real-time communications. Simplicity is the key where standard channels and protocols are supported with no coupling between subsystems.  The technology utilizes Microsoft Orleans to facilate on-demand routes for information delivery and Claims Authorization Policy Language (CAPL) for fine-grain access control between senders and receivers of messages.  The low latency and linearly scalable technology means you can build distributed systems, even complex systems, with simplicity and have real-time communications that scale.

The technology is designed to run on docker containers and the getting started sample show you how to get up and running in minutes on Azure AKS.

For custom production deployments see [here](/docs/deployconfig.md)

![Architecture](/docs/arch.jpg)
[Deployment Details](/docs/deploydetail.md)
## Getting Started

 1. Clone the source
 2. Ensure the [prereqs](/docs/prereqs.md) are installed.
 3. Deploy Piraeus to Azure AKS
 4. Configure Piraeus
 5. Run a sample client

 ### Deploy Piraeus to Azure AKS

 1. Open a command prompt and navigate to the /kubernetes folder
 2. Type *pwsh* to get a powershell v6 command prompt
 3. Open the deploy.json file in notepad and update the following parameters in the file
 *Email* - Your email address, i.e., required for Let's Encrypt certificate issuance
*DnsNaame* - The DNS name for the deployment, e.g., "growlingdog"
*Location* - The Azure data center location, e.g., "eastus"
*StorageAcctName* - A name for the Azure storage account
*ResourceGroupName* - Name of the resource group to deploy in your Azure subscription

4.  Load the PowerShell deployment script by typing
 ```. ./piraeusdeploy.ps1 ```
 5. Start the deployment with the following command and completing the desired custom parameters
> New-PiraeusDeploy -File "deploy.json"
>

FQDN of the Piraeus deployment will be:

```<dns>.<location>.cloudapp.azure.com```

### Configure Piraeus

 1. In the /kubernetes folder and using a Powershell 6 prompt load the SampleConfig script

 ``` . ./Sample.Config.ps1```

 2. Run the sample configuration using the same DNS and Location parameters used in the deployment to AKS

 ``` New-SampleConfig *Dns* *Location*```

 3. The first time you run the Sample Configuration you will be prompted to load the Piraeus.Module.Core powershell module.  Select "Y" the first time you run the script to load the module.
 4. You should see the metadata output to the console when the script completes for resource-a and resource-b

### Run the Sample Client

 1. Open the Samples.Mqtt.Client project in Visual Studio 2017.
 2. Right-click the project and select Debug and Start New Instance from the menu.  This will launch the client console app.  Follow the instructions in console window entering the information in the image below using your FQDN, e.g., growlingdog.eastus.cloudapp.azure.com.
 3. Right-click the project again and Debug and Start new instance from the menu.  This will launch a 2nd client console app.  Follow the instructions in the console window and enter in the information in image below using your FQDN.
 4. Send messages to and from both client apps and feel welcome to open more clients if you like.


text:
# Drupal Gold Coast Meetup Notes for 20th November 2018

## Core

### DrupalCon Seattle: Where cutting-edge content, networking & contributing come together.
[https://events.drupal.org/seattle2019/news/drupalcon-seattle-where-cutting-edge-content-networking-contributing-come-together](https://events.drupal.org/seattle2019/news/drupalcon-seattle-where-cutting-edge-content-networking-contributing-come-together)

### Helping visitors find their home - a refreshed /community
[https://www.drupal.org/association/blog/helping-visitors-find-their-home-a-refreshed-community](https://www.drupal.org/association/blog/helping-visitors-find-their-home-a-refreshed-community)

### Security Advisories: Drupal Core - Multiple Vulnerabilities - SA-CORE-2018-006
[https://www.drupal.org/sa-core-2018-006](https://www.drupal.org/sa-core-2018-006)

### State of JSON API (October 2018)
[https://wimleers.com/blog/state-of-jsonapi-2018-10](https://wimleers.com/blog/state-of-jsonapi-2018-10)

### Drupal 7.61 pre-release announcement
[https://groups.drupal.org/node/534483](https://groups.drupal.org/node/534483) PHP 7+ support

### Global Training Days in 2019
[https://www.drupal.org/association/blog/global-training-days-in-2019](https://www.drupal.org/association/blog/global-training-days-in-2019)

### PHP 7.3 support
[https://www.drupal.org/node/3011831](https://www.drupal.org/node/3011831) Drupal 8 now supports PHP 7.3

### Why Drupal's Layout Builder is so powerful and unique
[https://dri.es/why-drupal-layout-builder-is-so-unique-and-powerful](https://dri.es/why-drupal-layout-builder-is-so-unique-and-powerful)

### The end of PHP 5
[https://dri.es/the-end-of-php-5](https://dri.es/the-end-of-php-5)

## Articles

### A fresh look for dri.es
[https://dri.es/a-fresh-look-for-dri-es](https://dri.es/a-fresh-look-for-dri-es)

### Accessibility Remediation is a Must
[https://www.prometsource.com/blog/accessibility-remediation-must](https://www.prometsource.com/blog/accessibility-remediation-must)

### Efficacy of Kubernetes in Drupal Deployment
[https://opensenselabs.com/blog/articles/kubernetes-drupal](https://opensenselabs.com/blog/articles/kubernetes-drupal)

### The Cost of Custom
[https://chromatichq.com/blog/cost-custom](https://chromatichq.com/blog/cost-custom)

### Decoupling in Drupal, All the Questions You Had, Answered by Internet
[https://dev.acquia.com/decoupling-drupal](https://dev.acquia.com/decoupling-drupal)

### What's new in the Commerce 2.10 release?
[https://drupalcommerce.org/blog/114244/whats-new-commerce-210-release](https://drupalcommerce.org/blog/114244/whats-new-commerce-210-release)

### Moving weKnow's personal blog sites from Drupal to GatsbyJS
[https://jmolivas.weknowinc.com/moving-weknows-personal-blog-sites-drupal-gatsbyjs](https://jmolivas.weknowinc.com/moving-weknows-personal-blog-sites-drupal-gatsbyjs)

### 4 Million Euros in 5 Days, with Elm and Drupal
[https://www.gizra.com/content/million-euros-elm-drupal/](https://www.gizra.com/content/million-euros-elm-drupal/)

### The New Normal for Open Source
[https://www.phase2technology.com/blog/new-normal-open](https://www.phase2technology.com/blog/new-normal-open) discussions on the acquisition of Red Hat by IBM

### BigPipe's strength: available to all
[https://wimleers.com/blog/bigpipe-strength](https://wimleers.com/blog/bigpipe-strength)

### Isn’t it time your client created an organisation account on D.O?
[https://medium.com/@pdjohnson/isnt-it-time-your-client-created-an-organisation-account-on-d-o-1a09df7b769a](https://medium.com/@pdjohnson/isnt-it-time-your-client-created-an-organisation-account-on-d-o-1a09df7b769a)

### New Lagoon UI and Logging Systems
[https://stories.amazee.io/new-lagoon-ui-and-logging-systems-99f206e226e9](https://stories.amazee.io/new-lagoon-ui-and-logging-systems-99f206e226e9)

## Tutorials

### Need to reuse HTML in multiple templates? Try using partial Twig templates
[https://befused.com/drupal/partial-twig](https://befused.com/drupal/partial-twig)

### Decoupled Drupal + Gatsby: Getting Started
[https://atendesigngroup.com/blog/decoupled-drupal-gatsby-getting-started](https://atendesigngroup.com/blog/decoupled-drupal-gatsby-getting-started)

### Introducing Entity Access Audit module
[https://www.previousnext.com.au/blog/introducing-entity-access-audit-module](https://www.previousnext.com.au/blog/introducing-entity-access-audit-module)

### Custom Cache Tags and Max-age: Advanced Cache Handling in Drupal 8
[https://info.ashday.com/blogs/custom-cache-tags-max-age-drupal](https://info.ashday.com/blogs/custom-cache-tags-max-age-drupal)

## Videos

### An Intro to Lando with Drupal 8
[http://codekarate.com/daily-dose-of-drupal/intro-lando-drupal-8](http://codekarate.com/daily-dose-of-drupal/intro-lando-drupal-8)

### How to Keep Drupal Relevant in the Git-Based and API-Driven CMS Era
[https://2018.badcamp.org/session/how-keep-drupal-relevant-git-based-and-api-driven-cms-era](https://2018.badcamp.org/session/how-keep-drupal-relevant-git-based-and-api-driven-cms-era)

### Drupal 8 Linkit Module
[http://codekarate.com/daily-dose-of-drupal/drupal-8-linkit-module](http://codekarate.com/daily-dose-of-drupal/drupal-8-linkit-module)

## Podcasts

### Update on the Admin UI / JavaScript Modernization Initiative
[https://www.lullabot.com/podcasts/drupalizeme-podcast/update-on-the-javascript-modernization-initiative](https://www.lullabot.com/podcasts/drupalizeme-podcast/update-on-the-javascript-modernization-initiative)

### Talking Drupal #180 - Media in 8.6
[http://sacstudio.libsyn.com/talking-drupal-180-media-in-86](http://sacstudio.libsyn.com/talking-drupal-180-media-in-86)

### Drupal is a pretty big deal
[https://changelog.com/podcast/321](https://changelog.com/podcast/321)

### Talking Drupal #183 - Drupal Association
[http://sacstudio.libsyn.com/talking-drupal-183-drupal-association](http://sacstudio.libsyn.com/talking-drupal-183-drupal-association)

repository: drupalgoldcoast/meetupnotes

gha_license_id: MIT

repo_name: drupalgoldcoast/meetupnotes


text:
# Making the Grade

Welcome to Making the Grade on Exercism's C++ Track.
If you need help running the tests or submitting your code, check out `HELP.md`.
If you get stuck on the exercise, check out `HINTS.md`, but try and solve it without using those first :)

## Introduction

## Arrays and Vectors

C++ offers different containers to store elements of the same type in an ordered way.
There is `std::array` for containers of a fixed size and `std::vector`, which comes with dynamic resizing capabilities.

### Construction

When you declare an array or a vector you need to specify the type of elements, that container will hold.
Arrays also need a size.
Look at these examples to see the two container types' initializations:

```cpp
#include<array>
#include <string>

// std::array variable_name<element_type, size> {list of elements}
std::array<std::string, 3> indie_rock {"yeah", "yeah", "yeah"};
// indie_rock contains the elements "yeah" three times
```

Vectors usually need more space, as they allocate memory for further growth.
You do not need to specify a size:

```cpp
#include<vector>

// std::vector variable_name<element_type> {list of elements}
std::vector countdown<int> {3, 2, 1};
// my_vector contains the elements 3, 2 and 1
```

> Note: You do not need to know the exact mechanics behind the template concept yet, it will have its own concept further down the syllabus tree.

### Element access

Vectors and arrays share the same functions to access their elements.
You can use the member functions `front` and `back` to get the first and last elements of the container.
There is also `at` and the `[]` operator to access specific elements.

```cpp
countdown[0];
// => 3
countdown.at(2);
// => 1
countdown[1] = 4;
// countdown now contains 3, 4 and 1
indie_rock.back() = "yeahs";
// indie_rock is now "yeah", "yeah", "yeahs"
```

> Note: If you pick a position that is not in the range of your container, `[]` might lead to undefined behavior.
> The `at` function would raise an exception, which might make your life easier in the long term.

### Vector modifiers

As a `vector` is not fixed in size, it is possible to add or remove elements.
Two common functions for that purpose are `emplace_back` and `pop_back`.

```cpp
std::array<std::string, 3> witches {"Holly", "Alyssa", "Shannen"};
witches.pop_back();
// Shannen is no longer with the witches
witches.emplace_back("Rose");
// Rose has joined the team
```

### Capacity

You can check the containers for emptiness with the member function `empty`.
If you want to know the number of elements, you can use `size`.

## Instructions

You're a teaching assistant correcting student exams.
Keeping track of results manually is getting both tedious and mistake-prone.
You decide to make things a little more interesting by putting together some functions to count and calculate results for the class.

## 1. Rounding Scores

While you can give "partial credit" on exam questions, overall exam scores have to be `int`s.
So before you can do anything else with the class scores, you need to go through the grades and turn any `double` scores into `int`s.

Create the function `round_down_scores()` that takes a `vector` of `student_scores`.
The schools' requested rounding is a truncation.
Lucky for you, C++ can cast one type into another with `static_cast`.
The `static_cast` conversion from `double` to `int` cuts off any digit after the decimal.
This function should take the input `vector` and `return` a new vector with all the scores converted to `int`s.

```cpp
std::vector<double> student_scores {90.33, 40.5, 55.44, 70.05, 30.55, 25.45, 80.45, 95.3, 38.7, 40.3};
round_down_scores(student_scores)
// => {90, 40, 55, 70, 30, 25, 80, 95, 38, 40}
```

## 2. Non-Passing Students

As you were grading the exam, you noticed some students weren't performing as well as you'd hoped.
But you were distracted, and forgot to note exactly _how many_ students.

Create the function `count_failed_students()` that takes a `vector` of `student_scores`.
This function should count up the number of students who don't have passing scores and return that count as an integer.
A student needs a score greater than **40** to achieve a passing grade on the exam.

```cpp
count_failed_students({90,40,55,70,30,25,80,95,38,40});
// => 5
```

## 3. The "Best"

The teacher you're assisting wants to find the group of students who've performed "the best" on this exam.
What qualifies as "the best" fluctuates, so you need to find the student scores that are **greater than or equal to** the current threshold.

Create the function `above_threshold()` taking `student_scores` (a `vector` of grades), and `threshold` (an `int`, the "top score" threshold) as parameters.
This function should return a `vector` of all scores that are `>=` to `threshold`.

```cpp
above_threshold({90,40,55,70,30,68,70,75,83,96}, 75);
// => {90,75,83,96}
```

## 4. Calculating Letter Grades

The teacher you're assisting likes to assign letter grades as well as numeric scores.
Since students rarely score 100 on an exam, the "letter grade" lower thresholds are calculated based on the highest score achieved, and increment evenly between the high score and the failing threshold of **<= 40**.

Create the function `letter_grades()` that takes the "highest" score on the exam as a parameter, and returns an `array` (not a vector) of lower score thresholds for each "American style" grade interval: `["D", "C", "B", "A"]`.

```cpp
/*Where the highest score is 100, and failing is <= 40.
       "F" <= 40
 41 <= "D" <= 55
 56 <= "C" <= 70
 71 <= "B" <= 85
 86 <= "A" <= 100
*/

letter_grades(100);
// => {41, 56, 71, 86}

/*Where the highest score is 88, and failing is <= 40.
       "F" <= 40
 41 <= "D" <= 52
 53 <= "C" <= 64
 65 <= "B" <= 76
 77 <= "A" <= 88
*/

letter_grades(88);
// => {41, 53, 65, 77}
```

## 5. Matching Names to Scores

You have exam scores in descending order, and the respective student names (sorted in the order of their exam scores).
You would like to match each student's name with their exam score and print out an overall class ranking.

Create the function `student_ranking()` with parameters `student_scores` and `student_names`.
Match each student name on the student_names `vector` with their score from the student_scores `vector`.
You can assume each argument `vector` is sorted from highest score(er) to lowest score(er).
The function should return a `vector` of strings with the format `<rank>. <student name>: <student score>`.

```cpp
std::vector<int> student_scores {100, 99, 90, 84, 66, 53, 47};
std::vector<std::string> student_names {"Joci", "Sara","Kora","Jan","Indra","Bern", "Fred"};
student_ranking(student_scores, student_names)
// =>
//  {"1. Joci: 100", "2. Sara: 99", "3. Kora: 90", "4. Jan: 84", "5. Indra: 66", "6. Bern: 53", "7. Fred: 47"}
```

## 6. A "Perfect" Score

Although a "perfect" score of 100 is rare on an exam, it is interesting to know if at least one student has achieved it.

Create the function `perfect_score()` with parameters `student_scores` and `student_names`.
The lists are the same as in task 5.
The function should `return` _the first_ `<name>` (as a string) of the student who scored 100 on the exam.

If no 100 scores are found, an empty string `""` should be returned.

```cpp
perfect_score({"Nur", "Tony", "Fatima"}, {90, 80, 100});
// => "Fatima"

perfect_score({"Nur", "Tony"}, {90, 80});
// => ""
```

## Source

### Created by

- @vaeng

repository: ErikSchierboom/exercism

gha_language: C#

gha_license_id: NOASSERTION

repo_name: ErikSchierboom/exercism


text:
* Teach view generator to update existing views [683361d](https://github.com/thoughtbot/scenic/commit/683361d59410f46aba508a3ceb850161dd0be027)

  *Caleb Thompson*

* Raise an error if view definition is empty. [PR #38](https://github.com/thoughtbot/scenic/issues/38)

  *Caleb Thompson*

repository: DamirSvrtan/scenic

repo_name: DamirSvrtan/scenic


text:
# Get Started

This topic describes how to quickly train a machine learning model from examples.

## Environment Requirements

- Operating system: MacOs and Linux are supported
- Runtime Environment: Node. js> = 10.16, Npm> = 6.1.0
- Python >= 3.6

## Quick Start

### Local

First install the pipcook scaffold pipcook-cli, which provides environment initialization, control the start and end of the process, and view logs.

```sh
$ npm install -g @pipcook/pipcook-cli
```

After the scaffold is installed, you can create a project folder (or integrate it into any existing front-end project), and then use a few simple instructions of the scaffold to quickly generate a project.

```sh
$ mkdir pipcook-example && cd pipcook-example
$ pipcook init
```

At this point, all the relevant environments required by Pipcook have been installed. In addition, some examples  of the Pipcook project are generated for you.<br />You can directly run them to start a machine learning engineering pipeline. For example, you can quickly perform image classification recognition. To start this training, you only need a simple command

```sh
$ pipcook run examples/pipelines/mnist-image-classification.json
```

### Install via Docker

First install [Dockerfile](https://github.com/alibaba/pipcook/blob/master/Dockerfile).

Open Dockerfile's path and install image.

```sh
$ git clone https://github.com/alibaba/pipcook.git && cd pipcook
$ docker build -t alibaba/pipcook .
```

Check if the image is installed successfully.

```sh
$ docker images
REPOSITORY                                    TAG                 IMAGE ID            CREATED             SIZE
alibaba/pipcook                               latest              c297c73d62d4        7 hours ago         3.67GB
```

And run in the following command:

```sh
$ docker run -it --name pipcook_test alibaba/pipcook /bin/bash
```

repository: Heluwe/pipcook

repo_name: Heluwe/pipcook


text:
# NavGrills

This is Project from Navigus Hiring Assesment.
In the this assignment, we are going to build an adaptive learning platform, leveraging gamification to engage users. There are two types of user roles in this application: ● Teachers ● Students A teacher is supposed to add, remove, edit, and delete courses. For each course, they will be able to create one quiz only, based on a set of questions and their respective answers (Choice-based Questions only). Teachers should also be able to add/edit/delete questions and answers to a quiz for a course.
### SCREENSHOTS :fireworks:
![Landing_page](/src/img.PNG)
![Landing_page](/src/img1.PNG)
![Popular_page](/src/img2.PNG)

## HOW TO RUN THIS PROJECT LOCALLY
- Install Python(3.8) (Dont Forget to Tick Add to Path while installing Python)
- Open Terminal and Execute Following Commands :
```
python -m pip install -r requirements. txt
```
- Download This Project Zip Folder and Extract it
- Move to project folder in Terminal. Then run following Commands :
```
py manage.py makemigrations
py manage.py migrate
py manage.py runserver
```
- Now enter following URL in Your Browser Installed On Your Pc
```
http://<IP_ADDRESS>:8000/
```

repository: cybertronayush/NavGrills

repo_name: cybertronayush/NavGrills


text:
# TodoMVC Protractor Example

Angular Protractor example using TodoMVC (http://todomvc.com/). This is my first take at Protractor, feel free to supply feedback!

![img](https://github.com/MatthewVita/TodoMVC-Protractor-Example/blob/master/tests.gif)

## Run
- Install Node, Chrome, [Protractor](http://www.protractortest.org/#/protractor-setup), and [local-web-server](https://www.npmjs.com/package/local-web-server)
- Execute `webdriver-manager start`
- From the root of the repo, execute `cd todomvc && ws` to spin up a web server with the Angular code
- From the root of the repo, execute `protractor spec.js` to run the tests

## TODOs
- Test deletion of tasks at specific indexes
- Test editing of tasks at specific indexes
- Implement "uncomplete" tests
- Check for strikethrough text on completed tasks
- Figure out a way to include "active" page in existing tests

## License
MIT.

View the [TodoMVC copyright holder list](https://github.com/tastejs/todomvc#license)

repository: MatthewVita/TodoMVC-Protractor-Example

repo_name: MatthewVita/TodoMVC-Protractor-Example


text:
---
layout: post102
title:  Executor Based Remoting
categories: XAP102
parent: space-based-remoting-overview.html
weight: 200
---

{% summary%}{%endsummary%}

*Executor Based Remoting* uses [Executors](./task-execution-over-the-space.html) to provided remoting capabilities on top of the Space. Executor Based Remoting allows for direct invocation of services in an asynchronous manner in a broadcast or routed manner. Executor Remoting works with services that are deployed in a Processing Unit and execute within a collocated space.

![Executor.jpg](/attachment_files/Executor.jpg)

# The executor-proxy

The `executor-proxy` should be created on the client side to interact with the remote service. It can be created via Spring namespace, Spring Bean or via API.

The `executor-proxy` include the following properties:

{: .table .table-bordered .table-condensed}
| property| Class Type | Required | NameSpace Bean | Description | Default |
|:--------|:-----------|:---------|:---------------|:------------|:--------|
|gigaSpace | GigaSpace | giga-space | Yes |Sets the GigaSpace interface that will be used to work with the space as the transport layer for executions of Space tasks.| |
|timeout | long |  Yes | timeout | Sets the timeout that will be used to wait for the remote invocation response. The timeout value is in milliseconds.  | 60000 (60 seconds).|
|remoteRoutingHandler | RemoteRoutingHandler | No | routing-handler |In case of remote invocation over a partitioned space,  the default partitioned routing index will be random (the hashCode of the newly created remote invocation). This RemoteRoutingHandler allows for custom routing computation (for example, based on one of the service method parameters).| |
|metaArgumentsHandler | MetaArgumentsHandler | No | meta-arguments-handler | Allows the meta arguments handler to be set, which will process the meta-arguments passed on each remote invocation.| |
|asyncMethodPrefix | String |
|broadcast | boolean | No | broadcast| If set the true (defaults to false), the remote invocation will be called on all active (primary) cluster members.| |
|returnFirstResult | boolean |No | return-first-result | When set to true (defaults to true), the first result will be returned (when using broadcast). If set to false, an array of results will be returned. Note, this only applies when no reducer is provided.| |
|remoteResultReducer | RemoteResultReducer |No| result-reducer | When using broadcast is set to true, a custom reducer can be provided to reduce the array of result objects into a calculated response object.| |
| remoteInvocationAspect | RemoteInvocationAspect |No| An Aspect that will be executed around each service invocation.| |
|serviceProxy | Object |
| methodHashLookup | Map<Method, MethodHash> |
|interface | Class | Yes | | The interface (fully qualified class name) that this remoting proxy implements. Also controls which service will be invoked in the "server" (Processing Unit).| |

Example:
{% highlight xml %}
<bean id="dataProcessor" class="org.openspaces.remoting.ExecutorSpaceRemotingProxyFactoryBean">
    <property name="gigaSpace" ref="gigaSpace" />
    <property name="timeout" value="60000" />

    <property name="serviceInterface" value="org.openspaces.example.data.common.IDataProcessor" />
    <property name="broadcast" value="true" />

    <property name="remoteInvocationAspect">
    	<bean class="eg.MyRemoteInvocationAspect" />
    </property>

	<property name="metaArgumentsHandler">
    	<bean class="eg.MyMetaArgumentsHandler" />
    </property>

	<property name="remoteResultReducer">
    	<bean class="eg.MyRemoteResultReducer" />
    </property>

	<property name="remoteRoutingHandler">
        <bean class="org.openspaces.example.data.feeder.support.DataRemoteRoutingHandler"/>
    </property>
</bean>
{% endhighlight %}

# Defining the Contract

In order to support remoting, the first step is to define the contract between the client and the server. In our case, the contract is a simple Java interface. Here is an example:

{% highlight java %}
public interface IDataProcessor {

    /**
     * Process a given Data object, returning the processed Data object.
     */
    Data processData(Data data);
}
{% endhighlight %}

{% exclamation %} The `Data` object should be `Serializable`, or better yet, `Externalizable` (for better performance).

# Implementing the Contract

Next, an implementation of this contract needs to be provided. This implementation will "live" on the server side. Here is a sample implementation:

{% inittab os_simple_space|top %}
{% tabcontent Annotation %}

{% highlight java %}
@RemotingService
public class DataProcessor implements IDataProcessor {

    public Data processData(Data data) {
    	data.setProcessor(true);
    	return data;
    }
}
{% endhighlight %}

{% endtabcontent %}
{% tabcontent XML %}

{% highlight java %}
public class DataProcessor implements IDataProcessor {

    public Data processData(Data data) {
    	data.setProcessor(true);
    	return data;
    }
}
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

The XML tab corresponds to exporting the service using an xml configuration (explained in the next section). The Annotation tab corresponds to exporting the service using annotations.

# Exporting the Service Over the Space

The next step is exporting the service over the space. Exporting the service is done on the server side. As with other Spring remoting support, exporting the service and the mechanism of exporting the service is a configuration-time decision. Here is an example of a Spring XML configuration:

{% inittab os_simple_space|top %}
{% tabcontent Annotation %}

{% highlight xml %}

<context:component-scan base-package="com.demo"/>

<os-remoting:annotation-support />

<os-core:embedded-space id="space" name="mySpace"/>

<os-core:giga-space id="gigaSpace" space="space"/>

<os-remoting:service-exporter id="serviceExporter" />
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Namespace %}

{% highlight xml %}
<os-core:embedded-space id="space" name="mySpace"/>

<os-core:giga-space id="gigaSpace" space="space"/>

<bean id="dataProcessor" class="DataProcessor" />

<os-remoting:service-exporter id="serviceExporter">
     <os-remoting:service ref="dataProcessor"/>
</os-remoting:service-exporter>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Plain XML %}

{% highlight xml %}
<bean id="space" class="org.openspaces.core.space.EmbeddedSpaceFactoryBean">
    <property name="name" value="space" />
</bean>

<bean id="gigaSpace" class="org.openspaces.core.GigaSpaceFactoryBean">
	<property name="space" ref="space" />
</bean>

<bean id="dataProcessor" class="DataProcessor" />

<bean id="serviceExporter" class="org.openspaces.remoting.SpaceRemotingServiceExporter">
    <property name="services">
        <list>
            <ref bean="dataProcessor" />
        </list>
    </property>
</bean>
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

The name/id of the `SpaceRemotingServiceExporter` bean is important when using Executor Based Remoting. By default, the `Task` representing the remote invocation searches for a service exporter named `serviceExporter`, otherwise, it uses the first bean that is of the type `SpaceRemotingServiceExporter`.

{% note %}
Exporting services is done on a Processing Unit (or a Spring application context) that starts an embedded space.
{%endnote%}

# Using the Service on the Client Side

In order to use the exported `IDataProcessor` on the client side, beans should use the `IDataProcessor` interface directly:

{% highlight java %}
public class DataRemoting {

    private IDataProcessor dataProcessor;

    public void setDataProcessor(IDataProcessor dataProcessor) {
        this.dataProcessor = dataProcessor;

    }
}
{% endhighlight %}

Configuring the `IDataProcessor` proxy can done in the following manner:

{% inittab os_simple_space|top %}
{% tabcontent Namespace %}

{% highlight xml %}
<os-core:space-proxy  id="space" name="mySpace"/>

<os-core:giga-space id="gigaSpace" space="space"/>

<os-remoting:executor-proxy id="dataProcessor" giga-space="gigaSpace"
                   interface="org.openspaces.example.data.common.IDataProcessor">
</os-remoting:executor-proxy>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Plain XML %}

{% highlight xml %}
<bean id="space" class="org.openspaces.core.space.SpaceProxyFactoryBean">
    <property name="name" value="space" />
</bean>

<bean id="gigaSpace" class="org.openspaces.core.GigaSpaceFactoryBean">
	<property name="space" ref="space" />
</bean>

<bean id="dataProcessor" class="org.openspaces.remoting.ExecutorSpaceRemotingProxyFactoryBean">
    <property name="gigaSpace" ref="gigaSpace" />
    <property name="serviceInterface" value="org.openspaces.example.data.common.IDataProcessor" />
</bean>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Code %}

{% highlight java %}
SpaceProxyConfigurer configurer = new SpaceProxyConfigurer("space");

GigaSpace gigaSpace = new GigaSpaceConfigurer(configurer).gigaSpace();

IDataProcessor dataProcessor = new ExecutorRemotingProxyConfigurer<IDataProcessor>(gigaSpace, IDataProcessor.class)
                               .proxy();

DataRemoting dataRemoting = new DataRemoting();

dataRemoting.setDataProcessor(dataProcessor);
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

The example above uses the `executor-proxy` bean in order to create the remoting proxy which can later be injected into the `DataRemoting` object. OpenSpaces remoting also allows injection of the remoting proxy into the remoting service property using annotations. Here is an example of annotating the `DataRemoting` class:

{% highlight java %}
public class DataRemoting {

    @ExecutorProxy
    private IDataProcessor dataProcessor;

    // ...
}
{% endhighlight %}

If there are more than one `GigaSpace` beans defined within the application context, the ID of the `giga-space` bean should be defined explicitly on the annotations via the `name` attribute.

In order to enable this feature, the following element needs to be added to the application context XML:

{% inittab os_simple_space|top %}
{% tabcontent Namespace %}

{% highlight xml %}
<os-remoting:annotation-support />
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Plain XML %}

{% highlight xml %}
<bean id="space" class="org.openspaces.remoting.RemotingAnnotationBeanPostProcessor" />
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

## Remote Routing Handler

Many times, space remoting is done by exporting services in a space with a partitioned cluster topology. The service is exported when working directly with a cluster member (and not against the whole space cluster). When working with such a topology, the client side remoting automatically generates a random routing index value. In order to control the routing index, the following interface can be implemented:

{% highlight java %}
public interface RemoteRoutingHandler<T> {

    /**
     * Returns the routing field value based on the remoting invocation. If null
     * is returned, will use internal calcualtion of the routing index.
     */
    T computeRouting(SpaceRemotingInvocation remotingEntry);
}
{% endhighlight %}

Here is a sample implementation which uses the first parameter `Data` object type as the routing index.

{% highlight java %}
public class DataRemoteRoutingHandler implements RemoteRoutingHandler<Long> {

    public Long computeRouting(SpaceRemotingInvocation remotingEntry) {
        if (remotingEntry.getMethodName().equals("processData")) {
            Data data = (Data) remotingEntry.getArguments()[0];
            return data.getType();
        }
        return null;
    }
}
{% endhighlight %}

Finally, the wiring is done in the following manner:

{% inittab os_simple_space|top %}
{% tabcontent Namespace %}

{% highlight xml %}
<os-core:space-proxy  id="space" name="mySpace"/>

<os-core:giga-space id="gigaSpace" space="space"/>

<os-remoting:executor-proxy id="dataProcessor" giga-space="gigaSpace"
                   interface="org.openspaces.example.data.common.IDataProcessor">
    <os-remoting:routing-handler>
        <bean class="org.openspaces.example.data.feeder.support.DataRemoteRoutingHandler"/>
    </os-remoting:routing-handler>
</os-remoting:executor-proxy>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Plain XML %}

{% highlight xml %}
<bean id="space" class="org.openspaces.core.space.SpaceProxyFactoryBean">
    <property name="name" value="space" />
</bean>

<bean id="gigaSpace" class="org.openspaces.core.GigaSpaceFactoryBean">
	<property name="space" ref="space" />
</bean>

<bean id="dataProcessor" class="org.openspaces.remoting.ExecutorSpaceRemotingProxyFactoryBean">
    <property name="gigaSpace" ref="gigaSpace" />
    <property name="serviceInterface" value="org.openspaces.example.data.common.IDataProcessor" />
    <property name="remoteRoutingHandler">
        <bean class="org.openspaces.example.data.feeder.support.DataRemoteRoutingHandler"/>
    </property>
</bean>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Code %}

{% highlight java %}
SpaceProxyConfigurer configurer = new SpaceProxyConfigurer("space");

GigaSpace gigaSpace = new GigaSpaceConfigurer(configurer).gigaSpace();

IDataProcessor dataProcessor = new ExecutorRemotingProxyConfigurer<IDataProcessor>(gigaSpace, IDataProcessor.class)
                               .remoteRoutingHandler(new DataRemoteRoutingHandler())
                               .proxy();

DataRemoting dataRemoting = new DataRemoting();

dataRemoting.setDataProcessor(dataProcessor);
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

## Routing Annotation

The option, above, using the remote routing handler is very handy when not using annotations (broadcasting). OpenSpaces remoting also supports the `@Routing` annotation in order to define which parameter controls the routing. Here is an example:

{% highlight java %}
public interface MyService {

    void doSomething(@Routing int param1, int param2);
}
{% endhighlight %}

In the example above, the routing is done using the param1 value. In complex objects, a method name can be specified to be invoked on the parameter, in order to get the actual routing index. Here is an example:

{% highlight java %}
public interface MyService {

    void doSomething(@Routing("getProperty") Value param1, int param2);
}
{% endhighlight %}

In the example, the `getProperty` method is called on the `Value` object, and its return value is subsequently used to extract the routing index.

{% note %}
**Note:** Using a [SpaceDocument](./document-api.html) as the annotated routing argument will cause an Exception since the `SpaceDocument` class does not define a getter method for each property, but rather a generic getter method to get a property value by its name. To avoid the Exception, simply extend the `SpaceDocument` class as described in [Extending Space Documents](./document-extending.html) and then define the relevant `getProperty` method in the extension class. Alternatively, an Exception can be avoided by implementing a `RemoteRoutingHandler`, as described above.
{%endnote%}

# Asynchronous Execution

OpenSpaces executor remoting supports asynchronous execution of remote services using the `AsyncFuture` interface (which extends the `java.util.concurrent.Future` interface). Since the remoting implementation is asynchronous by nature, a `Future` can be used to execute remote services asynchronously.

Since the definition of the interface acts as the contract between the client and the server, asynchronous invocation requires the interface to also support the same business method, returning a `Future` or `AsyncFuture` instead of its actual return value. The asynchronous nature is only relevant on the client side, provided by the asynchronous nature of OpenSpaces remoting. There are two options to implement such behavior:

## Different Service Interfaces

The client and the server can have a different service interface definition under the same package and under the same name. The server includes the actual implementation:

{% highlight java %}
public interface SimpleService {

    String say(String message);

    int calc(int value1, int value2);
}
{% endhighlight %}

The client has the same method except it returns a future:

{% highlight java %}
public interface SimpleService {

    AsyncFuture<String> say(String message);

    int calc(int value1, int value2);
}
{% endhighlight %}

In the above example, the `say()` method uses a `Future` in order to receive the result, while the `calc` method remains synchronous.

{% info %}
When using different services, it is important to include the interface definition in the processing unit `lib` directory (or the compiled classes root directory), so that both client and server use their own definitions and don't share a single one.
{%endinfo%}

## Single Service Interface

Both the client and server share the same interface, with the interface holding both synchronous and asynchronous services. Here is an example:

{% highlight java %}
public interface SimpleService {

    String say(String message);

    AsyncFuture<String> asyncSay(String message);
}
{% endhighlight %}

In the above case, the server implementation does not need to implement the `asyncSay` method (simply return `null` for the `asyncSay` method). The client side can choose which service to invoke.
You should note the naming convention and the signature of the asynchronous method in this case.
If the regular method looks as follows:
`T doSomething(String arg)`, T being the return value type, then the asynchronous method should have the following signature:
`Future<T> asyncDoSomething(String arg)`.
In other words, the regular method should be prefixed with `async` and the return value should be a `Future` of the original return value (unless it's `void`, in which case it stays `void`).

# Server Side Services Injection

Each parameter of a remote service can be dynamically injected as if it were a bean defined within the server side (where the service is actually executed) context. This allows you to utilize server side resources and state, within the actual invocation. In order to enable such injection the service interface should either be annotated with `AutowireArguments` annotation, or implement the marker interface `AutowireArgumentsMarker`. Let's see an example:

{% highlight java %}
@AutowireArguments
public interface MyService {

    void doSomething(Value param1);
}
{% endhighlight %}

The above service exposes a service which accepts a `Value` as a parameter. The `Value` parameter, if needed, can be injected dynamically with server side resources and state. For example, if the server side execution needs to be aware of the `ClusterInfo`, the `Value` parameter can implement the `ClusterInfoAware` interface. Here is what it looks like:

{% highlight java %}
public class Value implements ClusterInfoAware {

    private transient ClusterInfo clusterInfo;

    public void setClusterInfo(ClusterInfo clusterInfo) {
        this.clusterInfo = clusterInfo;
    }
}
{% endhighlight %}

{% info %}
Note the fact that `clusterInfo` is transient, so it won't be marshaled after injection back to the client.
{%endinfo%}

Another example is injecting another service that is defined in the server side directly into the parameter, for example, using Spring `@Autowired` annotation.

{% highlight java %}
public class Value implements ClusterInfoAware {

    @Autowired
    private transient AnotherService anotherService;
}
{% endhighlight %}

# Transactional Execution

Executor remoting supports transactional execution of services. On the client side, if there is an ongoing declarative transaction during the service invocation (a Space based transaction), the service will be executed under the same transaction. The transaction itself is passed to the server and any Space related operations (performed using `GigaSpace`) will be executed under the same transaction. The transaction lifecycle itself is controlled on the client side (declaratively) and is committed / rolled back only on the client side. (Note, exceptions on the server side will simply propagate to the client side, and will cause a rollback only if the client "decides" so.)

When using broadcast with executor remoting, a declarative distributed transaction must be used and not a local (or JTA one). Also note, the `GigaSpace` instance that is used internally by the executor remoting invocation must be configured with a transaction manager (as is the case for enabling transaction execution with any other `GigaSpace` based operation).

Here is a simple example how the Client and the Service should be configured:

Client pu.xml

{% highlight xml %}
<context:component-scan base-package="com.demo"/>
<os-core:space-proxy id="space" name="mySpace"/>

<os-core:distributed-tx-manager id="myTransactionManager" />
<os-core:giga-space id="gigaspace" space="space"  tx-manager="myTransactionManager"/>
<tx:annotation-driven transaction-manager="myTransactionManager" />

<os-remoting:executor-proxy id="myService" giga-space="gigaspace" interface="com.demo.IMyService" broadcast="true">
<os-remoting:result-reducer>
	<bean class="com.demo.MyRemoteResultReducer" />
	</os-remoting:result-reducer>
	</os-remoting:executor-proxy>

<bean id="callingBean" class="com.demo.ClientWarrper">
           <property name="client" ref="client"/>
</bean>

<bean id="client" class="com.demo.Client">
	   <property name="myService" ref="myService" />
	   <property name="gigaspace" ref="gigaspace" />
</bean>
{% endhighlight %}

Client Implementation

{% highlight java %}
@Transactional(readOnly = true , value="myTransactionManager")
public class Client{
	GigaSpace gigaspace ;
	IMyService myService ;

	public static void main(String[] args) {
	}

	@Transactional(propagation=Propagation.REQUIRES_NEW , value="myTransactionManager")
	public void doTX() throws Exception
	{
		MyData myObj = new MyData(1);
		gigaspace.write(myObj);

		System.out.println("Client - TX:" + gigaspace.getCurrentTransaction());
		boolean ret = myService.doTX();
		System.out.println("Service Call Done! - Result:"+ret);
	}
}
{% endhighlight %}

Service pu.xml

{% highlight xml %}
<context:component-scan base-package="com.demo"/>
<os-remoting:annotation-support />
<os-core:embedded-space id="space" name="mySpace"/>
<os-core:giga-space id="gigaSpace" space="space"/>
<os-remoting:service-exporter id="serviceExporter" />
{% endhighlight %}

Service Implementation

{% highlight java %}
@RemotingService
@Transactional(readOnly = true)
public class MyService implements IMyService {
	public MyService()	{}
	@Autowired
	GigaSpace gigaSpace;

	@Transactional(propagation=Propagation.SUPPORTS)
	public boolean doTX()
	{
		MyData myObj = new MyData(2);
		gigaSpace.write(myObj);
		System.out.println("Service - TX:" + gigaSpace.getCurrentTransaction());
	}
}
{% endhighlight %}

# Execution Aspects

Space based remoting allows you to inject "aspects" that can wrap the invocation of a remote method on the client side, as well as wrapping the execution of an invocation on the server side.

## The Client Invocation Aspect

The client invocation aspect interface is shown below. You should implement this interface and wire and instance of the implementing class to the client side remote proxy, as explained below:

{% highlight java %}
public interface RemoteInvocationAspect<T> {

    /**
     * The aspect is called instead of the actual remote invocation. The methodInvocation can
     * be used to access any method related information. The remoting invoker passed can be used
     * to actually invoke the remote invocation.
     */
    T invoke(MethodInvocation methodInvocation, RemotingInvoker remotingInvoker) throws Throwable;
}
{% endhighlight %}

An implementation of such an aspect can be configured as follows:

{% inittab os_simple_space|top %}
{% tabcontent Namespace %}

{% highlight xml %}
<os-core:space-proxy  id="space" name="mySpace"/>

<os-core:giga-space id="gigaSpace" space="space"/>

<os-remoting:executor-proxy id="dataProcessor" giga-space="gigaSpace"
                   interface="org.openspaces.example.data.common.IDataProcessor">
    <os-remoting:aspect>
    	<bean class="eg.MyRemoteInvocationAspect" />
    </os-remoting:aspect>
</os-remoting:executor-proxy>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Plain XML %}

{% highlight xml %}
<bean id="space" class="org.openspaces.core.space.SpaceProxyFactoryBean">
    <property name="name" value="space" />
</bean>

<bean id="gigaSpace" class="org.openspaces.core.GigaSpaceFactoryBean">
	<property name="space" ref="space" />
</bean>

<bean id="dataProcessor" class="org.openspaces.remoting.ExecutorSpaceRemotingProxyFactoryBean">
    <property name="gigaSpace" ref="gigaSpace" />
    <property name="serviceInterface" value="org.openspaces.example.data.common.IDataProcessor" />
    <property name="remoteInvocationAspect">
    	<bean class="eg.MyRemoteInvocationAspect" />
    </property>
</bean>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Code %}

{% highlight java %}
SpaceProxyConfigurer configurer = new SpaceProxyConfigurer("space");

GigaSpace gigaSpace = new GigaSpaceConfigurer(configurer).gigaSpace();

IDataProcessor dataProcessor = new ExecutorRemotingProxyConfigurer<IDataProcessor>(gigaSpace, IDataProcessor.class)
                               .remoteInvocationAspect(new MyRemoteInvocationAspect())
                               .proxy();

DataRemoting dataRemoting = new DataRemoting();

dataRemoting.setDataProcessor(dataProcessor);
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

The instance of the class that implements the `RemoteInvocationAspect` interface will be called by the framework prior to the invocation on the client side. Note that it is up to the aspect implementation to decide whether or not the call should proceed.
If the aspect implementation decides to proceed with the call it should call `method.invoke()` on the provided `method` argument. Otherwise the call to the server will not be performed.

{% anchor serverExecutionApect %}

## The Server Invocation Aspect

The server side invocation aspect interface is shown below. You should implement this interface and wire and instance of the implementing class to the server side service exporter (this is the component that is responsible for exposing your service bean to remote clients):

{% highlight java %}
public interface ServiceExecutionAspect {

    /**
     * A service execution callback allows you to wrap the execution of "server side" service. If
     * actual execution of the service is needed, the invoke method will need to
     * be called on the passed Method using the service as the actual service to
     * invoke it on, and {@link SpaceRemotingInvocation#getArguments()} as the method arguments.
     *
     *
As an example: method.invoke(service, invocation.getArguments()).
     */
    Object invoke(SpaceRemotingInvocation invocation, Method method, Object service)
                                  throws InvocationTargetException, IllegalAccessException;
}
{% endhighlight %}

An implementation of such an aspect can be configured as follows:

{% inittab os_simple_space|top %}
{% tabcontent Namespace %}

{% highlight xml %}
<os-core:embedded-space id="space" name="mySpace"/>

<os-core:giga-space id="gigaSpace" space="space"/>

<bean id="dataProcessor" class="DataProcessor" />

<os-remoting:service-exporter id="serviceExporter">
     <os-remoting:aspect>
         <bean class="eg.MyServiceExecutionAspect" />
     </os-remoting:aspect>
     <os-remoting:service ref="dataProcessor"/>
</os-remoting:service-exporter>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Plain XML %}

{% highlight xml %}
<bean id="space" class="org.openspaces.core.space.EmbeddedSpaceFactoryBean">
    <property name="name" value="space" />
</bean>

<bean id="gigaSpace" class="org.openspaces.core.GigaSpaceFactoryBean">
	<property name="space" ref="space" />
</bean>

<bean id="dataProcessor" class="DataProcessor" />

<bean id="serviceExporter" class="org.openspaces.remoting.SpaceRemotingServiceExporter">
    <property name="serviceExecutionAspect">
         <bean class="eg.MyServiceExecutionAspect" />
    </property>
    <property name="services">
        <list>
            <ref bean="dataProcessor" />
        </list>
    </property>
</bean>
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

The instance of the class that implements the `ServiceExecutionAspect` interface will be called by the framework prior to the invocation of the service bean on the server side. Note that it is up to the aspect implementation to decide whether or not the call should proceed.
If the aspect implementation decides to proceed with the call it should call `method.invoke()` on the provided `method` argument. Otherwise the call to the service bean will not be performed.

# The Metadata Handler

When executing a service using Space based remoting, a set of one or more metadata arguments (in the form of a `java.lang.Object` array) can be passed to the server with the remote invocation. This feature is very handy when you want to pass certain metadata with every remote call that is not part of the arguments of the method you call. A prime example for using meta arguments is security -- i.e. passing security credentials as meta arguments, and using a server side aspect to authorize the execution or to log who actually called the method.

To create the meta arguments on the client side you should implement the following interface and inject an instance of the implementing class to the client side proxy:

{% highlight java %}
public interface MetaArgumentsHandler {

    /**
     * Meta argument handler can control the meta data objects that will be used
     * for the remote invocation.
     */
    Object[] obtainMetaArguments(SpaceRemotingInvocation remotingEntry);
}
{% endhighlight %}

The following snippets show how to plug a custom meta arguments handler to the client side remote proxy. The `Object` array returned by the implementation of the `MetaArgumentsHandler` interface will be sent along with the invocation to server side.

{% inittab os_simple_space|top %}
{% tabcontent Namespace %}

{% highlight xml %}

<os-core:space-proxy  id="space" name="mySpace"/>

<os-core:giga-space id="gigaSpace" space="space"/>

<os-remoting:executor-proxy id="dataProcessor" giga-space="gigaSpace"
                   interface="org.openspaces.example.data.common.IDataProcessor">
    <os-remoting:meta-arguments-handler>
    	<bean class="eg.MyMetaArgumentsHandler" />
    </os-remoting:meta-arguments-handler>
</os-remoting:executor-proxy>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Plain XML %}

{% highlight xml %}

<bean id="space" class="org.openspaces.core.space.SpaceProxyFactoryBean">
    <property name="name" value="space" />
</bean>

<bean id="gigaSpace" class="org.openspaces.core.GigaSpaceFactoryBean">
	<property name="space" ref="space" />
</bean>

<bean id="dataProcessor" class="org.openspaces.remoting.ExecutorSpaceRemotingProxyFactoryBean">
    <property name="gigaSpace" ref="gigaSpace" />
    <property name="serviceInterface" value="org.openspaces.example.data.common.IDataProcessor" />
    <property name="metaArgumentsHandler">
    	<bean class="eg.MyMetaArgumentsHandler" />
    </property>
</bean>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Code %}

{% highlight java %}
SpaceProxyConfigurer configurer = new SpaceProxyConfigurer("space");

GigaSpace gigaSpace = new GigaSpaceConfigurer(configurer).gigaSpace();

IDataProcessor dataProcessor = new ExecutorRemotingProxyConfigurer<IDataProcessor>(gigaSpace, IDataProcessor.class)
                               .metaArgumentsHandler(new MyMetaArgumentsHandler())
                               .proxy();

DataRemoting dataRemoting = new DataRemoting();

dataRemoting.setDataProcessor(dataProcessor);
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

The way to access the meta arguments on the server side is to configure a [server side execution aspect](#serverExecutionApect) by implementing the `ServiceExecutionAspect` and wiring it on the server side as shown [above](#serverExecutionApect). To access the meta arguments, you should call `SpaceRemotingInvocation.getMetaArguments()` on the `invocation` argument provided to the server side aspect.

# Broadcast Remoting

When using executor remoting, a remote invocation can be broadcasted to all active (primary) cluster members. Each Service instance is invoked and return a result to its called which in turn reduce these and pass the final result to the application.

The First phase involves the Service invocation:
![Executor1.jpg](/attachment_files/Executor1.jpg)

The Second phase involves reducing the results retrieved from the Services:
![Executor2.jpg](/attachment_files/Executor2.jpg)

The configuration of enabling broadcasting is done on the client level, by setting the broadcast flag to `true`:

{% inittab os_simple_space|top %}
{% tabcontent Namespace %}

{% highlight xml %}
<os-core:space-proxy id="space" name="mySpace"/>

<os-core:giga-space id="gigaSpace" space="space"/>

<os-remoting:executor-proxy id="dataProcessor" giga-space="gigaSpace"
                   interface="org.openspaces.example.data.common.IDataProcessor" broadcast="true">
</os-remoting:executor-proxy>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Plain XML %}

{% highlight xml %}
<bean id="space" class="org.openspaces.core.space.SpaceProxyFactoryBean">
    <property name="name" value="space" />
</bean>

<bean id="gigaSpace" class="org.openspaces.core.GigaSpaceFactoryBean">
	<property name="space" ref="space" />
</bean>

<bean id="dataProcessor" class="org.openspaces.remoting.ExecutorSpaceRemotingProxyFactoryBean">
    <property name="gigaSpace" ref="gigaSpace" />
    <property name="serviceInterface" value="org.openspaces.example.data.common.IDataProcessor" />
    <property name="broadcast" value="true" />
</bean>

<bean id="dataRemoting" class="DataRemoting">
    <property name="dataProcessor" ref="dataProcessor" />
</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Code %}

{% highlight java %}
SpaceProxyConfigurer configurer = new SpaceProxyConfigurer("space");

GigaSpace gigaSpace = new GigaSpaceConfigurer(configurer).gigaSpace();

IDataProcessor dataProcessor = new ExecutorRemotingProxyConfigurer<IDataProcessor>(gigaSpace, IDataProcessor.class)
                               .broadcast(true)
                               .proxy();

DataRemoting dataRemoting = new DataRemoting();

dataRemoting.setDataProcessor(dataProcessor);
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

## The Remote Result Reducer

When broadcasting remote invocations to all active cluster members, and the remote method returns a result, on the client side an array of all remote results needs to be processed. By default, the first result is returned, and it can be overridden using the `return-first-result` flag (which will then return the array of responses). The executor remoting proxy allows for a pluggable remote result reducer that can reduce a collection of remoting results into a single one. Here is the defined interface:

{% highlight java %}
public interface RemoteResultReducer<T, Y> {

    /**
     * Reduces a list of Space remoting invocation results to an Object value. Can use
     * the provided remote invocation to perform different reduce operations, for example
     * based on the {@link SpaceRemotingInvocation#getMethodName()}.
     *
     *
An exception thrown from the reduce operation will be propagated to the client.
     *
     * @param results            A list of results from (usually) broadcast sync remote invocation.
     * @param remotingInvocation The remote invocation
     * @return A reduced return value (to the calling client)
     * @throws Exception An exception that will be propagated to the client
     */
    T reduce(SpaceRemotingResult<Y>[] results, SpaceRemotingInvocation remotingInvocation) throws Exception;
}
{% endhighlight %}

# Failover

In case of a Primary Backup clusters and Partitioned Sync2Backup clusters, when there is failure of primary space partition, remoting request is transparently forwarded to the backup.

Executor proxy is aware of each partition in the cluster and connection with the failed primary partition will get interrupted/disconnected in case of a failure. Proxy recognizes failure and redirects the request to the backup partition. When the backup becomes ready (any warmup code that needs to run and is ready to accept operations), it will accept this request and process the request. All of this failover behavior is done within the GigaSpaces proxy code and client does not need any extra logic. For more information refer to [Proxy Connectivity]({%currentadmurl%}/tuning-proxy-connectivity.html).

If the backup space does not become ready to accept requests within the configured number of retries, execute request will fail with an Exception. In case of a broadcast request, `SpaceRemotingResult` for failed partition will have an exception. Following example shows how to inspect for exceptions in Reducer,

{% highlight java %}
public class DataProcessorServiceReducer implements RemoteResultReducer<Integer, Integer>{

	public Integer reduce(SpaceRemotingResult<Integer>[] results,
                               SpaceRemotingInvocation sri) throws Exception {
		int total_result =0;
		for (SpaceRemotingResult<Integer> result : results)
		{
			if (result.getException() == null) {
				int temp_result = result.getResult().intValue();
				total_result +=  temp_result ;
			} else {
				System.out.println("Exception on the Server: "
                                                   + result.getException().getMessage());
				result.getException().printStackTrace();
			}

		}
		return total_result/results.length  ;
	}
}
{% endhighlight %}

# Working Examples

{%refer%}
[This repository](https://github.com/jasonnerothin/gs-executor-remoting/) provides both a [service exporter](https://github.com/jasonnerothin/gs-executor-remoting/blob/master/src/main/resources/META-INF/Spring/pu.xml#L23) and a [service consumer](https://github.com/jasonnerothin/gs-executor-remoting/blob/master/src/test/resources/com/gigaspaces/sbp/WatchRepairClient.xml#L24). Test code dispatches a remoted request right [here](https://github.com/jasonnerothin/gs-executor-remoting/blob/master/src/test/scala/com/gigaspaces/sbp/WatchRepairSuite.scala#L95).
{%endrefer%}

repository: barakb/gigaspaces-wiki-jekyll

extension: markdown

gha_language: HTML

repo_name: barakb/gigaspaces-wiki-jekyll


text:
# Number.cmd
A new data type for Batch, that can represent large and floating-point numbers and enables calculation with those.

[![GitHub](https://img.shields.io/github/license/timlg07/Number.cmd)](LICENSE)
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/timlg07/Number.cmd)](/)
[![Discord](https://img.shields.io/discord/728958932210679869?label=Support)](https://discord.gg/tapENZws2e)

# Syntax
The basic syntax of Number.cmd looks like this:
```
Number <variable-name> = <operand1> <operator> <operand2> [precision:<digits>] [format:<pattern>]
```
- With `<variable-name>` being the plain string of the batch variable that should be set.

- With `<operand1>` and `<operand2>` being the two operands of the calculation. They can be either normal integers or numbers in the internally used notation with mantissa and exponent, seperated by an `E`.
For example the number `1,23` would be `123E-2` in this notation. If you want, you can write normal integers in this notation as well: `1200` for example would be `12E2`.
The operands can also be constants like `Number.pi` or `Number.e`.

- And `<operator>` should be one of the following mathematical operators: `+`, `-`, `*`, `/`.

- If you want, you can also specify a custom precision by adding an additional parameter, starting with `precision:` or the short form `p:`. Then you can specify the amount of significant digits.
For example `1 / 3 p:4` will give you an output with 4 digit precision: `+3333E-4`.
_(This works for all operations. Because division sometimes only terminates when specifying an maximum amount of digits, the precision has a default value of `8` that is used for division only.)_

- To get the output in a specific format, you can provide a format pattern as optional argument.
The argument needs to start with `format:` or, to keep it short, `f:`. Then you can specify the format-pattern for the output number: First the amount of digits before the floating point (leaving this unspecified will cause it to be dynamically set), then the symbol that should be used as floating point (has to be any other than `[0-9]`) and finally the amount of digits after the floating point (again you can leave this out for dynamic calcualtion).
If you do not specify both amounts of digts and only provide a floating point symbol, the output will get adjusted completely dynamic and will never contain any exponents (exponent is adjusted to be zero and then omited).
You can find more information about the format options here: https://github.com/timlg07/Number.cmd/issues/23#issuecomment-731588478.

# Examples
```cmd
Number x = 4 + 48
Number x = %x% * -E5
Number y = 50E5 + 2E5
Number result = %x% - %y%
Number result = %result% / 3000
Number result = %result% + 4 "format:."

echo result: %result%
```
Note: In batch files you have to `call Number` to continue execution.

Other examples for real use cases can be found in [examples](examples/)

# Usage
The Number.cmd file does not need any dependencies and can be used as is without other files from this repository.

To use Number.cmd in your projects, you can of course manually download or clone the repository or just copy or clone the Number.cmd file.
But the latest version of Number.cmd (and the whole repository) can also be found on [git.tim-greller.de/number/Number.cmd](https://tim-greller.de/git/number/Number.cmd). This allows you to import the latest version in your project using curl:
```cmd
curl "https://tim-greller.de/git/number/Number.cmd" > Number.cmd
```
This way you won't have to add Number.cmd to your git-repository and you won't have to worry about manually checking for updates in order to recieve bugfixes or new features.

# Exitcodes
```
 0: Success
 1: First operand is not a number (NaN)
 2: Second operand is not a number (NaN)
 3: Unknown operator
 4: Missing parameter(s)
```

# Standard Output
Number.cmd does not write anything to standard output (stdout) by default. If you want the result to be printed, for example when using Number.cmd directly in cmd, you can use `#` instead of a variable-name with an equal-sign.
The following command for example will output "+8E-1" to the standard output stream:
```cmd
Number # 4 / 5
```

gha_language: Batchfile