text:
What is consciousness?
Can an artificial machine really think?
Does the mind just consist of neurons
in the brain,
or is there some intangible spark
at its core?
For many, these have been
vital considerations
for the future of artificial intelligence.
But British computer scientist Alan Turing
decided to disregard all these questions

in favor of a much simpler one:
can a computer talk like a human?
This question led to an idea for measuring
aritificial intelligence
that would famously come to be known
as the Turing test.
In the 1950 paper, "Computing Machinery
and Intelligence,"
Turing proposed the following game.
A human judge has a text conversation
with unseen players
and evaluates their responses.
To pass the test, a computer must
be able to replace one of the players
without substantially
changing the results.
In other words, a computer would be
considered intelligent
if its conversation couldn't be easily
distinguished from a human's.
Turing predicted that by the year 2000,
machines with 100 megabytes of memory
would be able to easily pass his test.
But he may have jumped the gun.
Even though today's computers
have far more memory than that,
few have succeeded,
and those that have done well
focused more on finding clever ways
to fool judges
than using overwhelming computing power.
Though it was never subjected
to a real test,
the first program with
some claim to success was called ELIZA.
With only a fairly short
and simple script,
it managed to mislead many people
by mimicking a psychologist,
encouraging them to talk more
and reflecting their own questions
back at them.
Another early script PARRY
took the opposite approach
by imitating a paranoid schizophrenic
who kept steering the conversation
back to his own preprogrammed obsessions.
Their success in fooling people
highlighted one weakness of the test.
Humans regularly attribute intelligence
to a whole range of things
that are not actually intelligent.
Nonetheless, annual competitions
like the Loebner Prize,
have made the test more formal
with judges knowing ahead of time
that some of their conversation partners
are machines.
But while the quality has improved,
many chatbot programmers have used
similar strategies to ELIZA and PARRY.
1997's winner Catherine
could carry on amazingly focused
and intelligent conversation,
but mostly if the judge wanted
to talk about Bill Clinton.
And the more recent winner
Eugene Goostman
was given the persona of a
13-year-old Ukrainian boy,
so judges interpreted its nonsequiturs
and awkward grammar
as language and culture barriers.
Meanwhile, other programs like Cleverbot
have taken a different approach
by statistically analyzing huge databases
of real conversations
to determine the best responses.
Some also store memories
of previous conversations
in order to improve over time.
But while Cleverbot's individual responses
can sound incredibly human,
its lack of a consistent personality
and inability to deal
with brand new topics
are a dead giveaway.
Who in Turing's day could have predicted
that today's computers
would be able to pilot spacecraft,
perform delicate surgeries,
and solve massive equations,
but still struggle with
the most basic small talk?
Human language turns out to be
an amazingly complex phenomenon
that can't be captured by even
the largest dictionary.
Chatbots can be baffled by simple pauses,
like "umm..."
or questions with no correct answer.
And a simple conversational sentence,
like, "I took the juice out of the fridge
and gave it to him,
but forgot to check the date,"
requires a wealth of underlying knowledge
and intuition to parse.
It turns out that simulating
a human conversation
takes more than just increasing
memory and processing power,
and as we get closer to Turing's goal,
we may have to deal with all those big
questions about consciousness after all.

repository: prewittdavon/TEDVis

gha_language: Python

repo_name: prewittdavon/TEDVis


text:
# go-git-it

A command line tool to add features around git. The aim is to reduce the verbosity of common git command while making it more customizable.

### Setting up for use
For mac users, cloning the repo and setting up an alias for the build file (already included in build folder :)) works.
Setting up alias:
- Open `~/.bashrc` [or ~/.zshrc depending upon your terminal]
- Paste `alias your_preferred_program_name="/location/to/go-git-it/build/main"`

### Building for your os
After having working installation of go locally, follow the steps:
- cd into the `src` folder of the project
- Run `go build -o ../build/main`. This makes your new build as `main` inside folder build.

### Features
- **Counting Bitbucket commits into Git**: Not only bitbucket, practically everywhere where you can use `git commit`. This feature helps you counting saving your commit from bitbucket with original commit message, without original code. To set up this feature, follow the steps:
  - Make a dummy git repo.
  - `git init` inside your new dummy repo
  - Add absolute path to that repo in the .env file (.env-example attached)
Every time you commit using go-git-it, your dummy-repo is updated with the latest commit. To upload it to github, go to your dummy repo and push to remote.

- **Command Alias** : Alias for common git commands can be set with `alias.json` inside config folder. A single command can have multiple aliases.
To print a list of all `Alias` commands, command `names` is used. E.g., `ggt names`

- **Branch Name Autocomplete** : Is used in conjunction with other commands like `checkout`. Primary function is to find a branch name with a given identifier. Auto-complete is case in-sensitive.

- **Checkout** : Checks out to a branch with just a substring identifier.
 Stashes the current branch and switches to the new one.

- **Push** : Pushes to remote taking care of setting upstream. Just simple `push` command for the user.

- **Pull** : Pull from the remote upstream of the current branch without setting up upstream or specifying current branch name. Stashes the changes on local branch before pulling.

license: MIT

repository: sivssdn/go-git-it

branch_name: refs/heads/master

extension: md

gha_language: Go

license_type: permissive

repo_name: sivssdn/go-git-it


text:
---
title: Scoring using the Vector Space Model
date: 2014-12-13 00:00:00 Z
categories:
- information-retrieval
tags:
- python
layout: post
author: Jose A. Dianes
comments: true
---

Previously we discussed [tf-idf](/tf-idf-101) as a way to calculate how relevant a search term
is given a set of indexed documents. When having multiple terms, we used
*overlap score measure* consisting in the sum of the *tf-idf* for each term in
the given input. A more general and flexible way of scoring multi-term searches
is using the **[vector space model](http://en.wikipedia.org/wiki/Vector_space_model)**.

In the vector space model, each document in the corpus is represented by a
vector. The search input terms are also represented by a vector. Scoring search
results consists then in vector operations between the documents vectors and the
search terms vector.

But what each of these vectors represent? Basically they define term
frequencies (or tf-idf in our implementation). That is, each dimension in a
given vector represents the term frequency
for a given term. Doing so, a document is represented in a multi-dimensional space
by a vector of the frequencies of each of the words in hte corpus. Equally, a
search query is represented by a vector in the same space but using the input
terms.

#### Python implementation

The following is a Python representation if this concept.

{% highlight python %}
import re

class IrIndex:
    """An in-memory inverted index"""

    pattern = re.compile("^\s+|\s*,*\s*|\s+$")

    def __init__(self):
        self.index = {}
        self.documents = []
        self.vectors = []

    def index_document(self, document):
        # split
        terms = [word for word in self.pattern.split(document)]
        # add to documents
        self.documents.append(document)
        document_pos = len(self.documents) - 1
        # add posts to index, while creating document vector
        vector = {}
        for term in terms:
            if term not in self.index:
                self.index[term] = []
            self.index[term].append(document_pos)
            if term not in vector:
                vector[term] = 1
            else:
                vector[term] += 1
        # add the vector
        self.vectors.append(vector)
{% endhighlight %}

We use the same `IrIdenx` class and a boolean search schema. The difference is
when calculating scores. We don't store a precalculated `tf` structure anymore
but operate vectors directly.

In terms of complexity, when indexing we have moved from:

* Recalculate every `tf` entry when indexing a new document. This involves
lookup + sum for each term in the document.

To:

* Indexing stage: store a new document as a vectors of `tf` values. Here we save
the recalculation of `tf` entries.

So as we can see, the indexing stage is simpler (and more scalable) when using
the vector space model. This scalability gain when indexing is not to be
overlooked. In an index with hundreds of thousands or even millions of terms,
indexing a new large document and recalculating term frequencies at a global
scale can be costly. We could calculate term frequencies when searching instead,
but then using the vector space model makes even more sense.

Next the search and scoring part.

{% highlight python %}
from numpy import array, dot
from math import log

def create_tfidf_list(self, *args):
        if len(args) == 1:
            res = [tf for tf in args[0].itervalues()]
        elif len(args) == 2:
            res = []
            for term in args[0].iterkeys():
                if term in args[1]:
                    idf = log(float(len(self.documents)) / float(len(self.index[term])))
                    res.append(args[1][term] * idf)
                else:
                    res.append(0)
        return res

def create_tf_dictionary(self, terms):
    res = {}
    for term in self.pattern.split(terms):
        if term not in res:
            res[term] = terms.count(term)
    return res

def vector_space_search(self, terms):
    res = []
    hits = {}
    # create a numeric vector from terms
    terms_tf_dictionary = self.create_tf_dictionary(terms)
    terms_tfidf_list = self.create_tfidf_list(terms_tf_dictionary)
    # create a numeric vector for each hitting document
    hitting_terms = [term for term in self.pattern.split(terms) if term in self.index]
    for term in hitting_terms:  # for each term having at least on hit...
        for post in self.index[term]:  # for each document create the numeric vector
            if post not in hits:
                tfidf_list = self.create_tfidf_list(terms_tf_dictionary, self.vectors[post])
                hits[post] = tfidf_list
    # do the dot products
    for post in hits.iterkeys():
        score = dot(array(terms_tfidf_list), array(hits[post]))
        res.append((score, self.documents[post]))
    return res

IrIndex.create_tf_dictionary = create_tf_dictionary
IrIndex.create_tfidf_list = create_tfidf_list
IrIndex.vector_space_search = vector_space_search
{% endhighlight %}

At search stage, we have moved from:

* Calculate the `idf` and access the `tf` lookup table for each search term and
document hit. Sum the resulting `tf-idf` values for each document hit. This is
done using two for loops, one of them including another nested internal for
loop.

To:

* Access the `index` lookup table for any of the search terms and perform dot-
product with the resulting vectors. The later is an overhead introduced by this
approach in the search stage.

The new search stage has introduced vector dot products where there were just
sums (although using nested lopps) when the vector space model was not used.
However the data structures and their usage has been simplified. Note that we
build the vectors from pre-calculated dictionaries. Doing so we can determine
the dimensions form the search query vector.

#### Examples

Let us now recall our sample wine-related mini-corpus in order to see if we get
similar results using the new Vector Space Model. Remember that results are
given unsorted.  These are some of
them:

* Treating queries as vectors allows us simplifying data structures and
calculations. Where we used two dictionaries and loops, now we use a single
dictionary and linear algebra.

* The compact and easy to operate vector representation leaves the door open to
different weighting and transformation schemas that were difficult to apply
before (or at least the result were not so clean).

* Vectors can be the input of additional Information Retrieval and Machine
Learning techniques including supervised (e.g. classification) and unsupervised
(e.g. clustering, frequent pattern mining). You can find all the code for this notebook
[on GitHub](https://github.com/jadianes/data-science-your-way/blob/master/apps/information-retrieval/Vector%20Space.ipynb)
where you can fork it and make it yours to experiment.

filename: 2014-12-13-Vector-Space-Scoring 2.md


text:
# Blender 2.9x environment config

## Contents

* userpref: customized user preferences with vertex color set to red and auto depth enabled, for a better user experience.

* startup: custom startup file with units configured to match UE4, a cube of 1x1x1 meter and a gizmo showing the orientation of the exported asset.

## Instructions

> Before doing this! Open Blender and go to **File > Defaults > Save Startup File** to generate the configuration folder.

Open the Blender user directory on your OS:

 * Windows:
    ```
    %USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\
    ```
* Linux:
    ```
    $HOME/.config/blender/
    ```
* Mac:
    ```
    /Users/$USER/Library/Application Support/Blender/
    ```

Inside that directory, open the folder configuration folder for yor Blender version (EX: **2.9/config**, **2.91/config**, etc).

Copy the **.blend** files contained in this repo that you want to apply to your configuration (it could be just one or both).

repository: dacanizares/my-work-environments

repo_name: dacanizares/my-work-environments


text:
# LIFX Client

Java client to consume [LIFX HTTP API](https://api.developer.lifx.com/).

[![Coverage Status](https://coveralls.io/repos/github/gilbertotcc/lifx-client/badge.svg?branch=develop)](https://coveralls.io/github/gilbertotcc/lifx-client?branch=develop)
[![Download](https://api.bintray.com/packages/gilbertotcc/lifx/lifx-client/images/download.svg?version=2.0.1) ](https://bintray.com/gilbertotcc/lifx/lifx-client/2.0.1/link)

## Usage

Library artifactory is published on Bintray. In order to use it, add the `lifx` Bintray repository to your `build
.settings` Gradle file and include the `lifx-client` dependency as shown below.

```groovy
repositories {
  maven {
    url  "https://dl.bintray.com/gilbertotcc/lifx"
  }
}

dependencies {
  compile 'com.github.gilbertotcc.lifx:lifx-client:<VERSION>'
}
```

### Sample application

Following code provides a brief example that show how LIFX Client can be used to turn on all the lights in red color.

To generate the access token, visit [LIFX Cloud Settings page](https://cloud.lifx.com/settings).

```java
import static com.github.gilbertotcc.lifx.models.Selectors.All;

import com.github.gilbertotcc.lifx.models.Power;
import com.github.gilbertotcc.lifx.models.State;

public class RedLightOnSwitcher {

  public static void main(String[] args) {

    LifxClient client = LifxClient.newLifxClientFor("<YOUR_ACCESS_TOKEN>");

    var state = State.builder()
      .power(Power.ON)
      .color("red")
      .brightness(1.0)
      .build();
    var input = new LightsStateInput(all(), state);

    client.setLightsState(input);
  }
}
```

In `src/test` directory can be found more examples that show how LIFX client can be used for the more advanced
operations that LIFX HTTP API provides.

repository: gilbertotcc/lifx-client

branch_name: refs/heads/develop

gha_language: Java

repo_name: gilbertotcc/lifx-client


text:
> [Go to French version](/fr/Lois/Lois%20du%20Canada/1995/ch.%2028.md)

# Business Development Bank of Canada Act

**S.C. 1995, c. 28**

Assented to on 13 July 1995

----------

Her Majesty, by and with the advice and consent of the Senate and House of Commons of Canada, enacts as follows:

## Short Title

**Short title**

**1** This Act may be cited as the Business Development Bank of Canada Act.

## Interpretation

**Definitions**

**2** In this Act,

***Bank*** means the Business Development Bank of Canada continued by subsection 3(1); (*Banque*)

***bill of lading*** has the same meaning as in subsection 425(1) of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md); (*connaissement*)

***Board*** means the Board of Directors of the Bank; (*conseil*)

***by-law*** means a by-law of the Bank; (*règlement administratif*)

***Chairperson*** means the Chairperson of the Board; (*président du conseil*)

***Crown*** means Her Majesty in right of Canada; (***Version anglaise seulement***)

***debt obligation*** means a bond, debenture, note, investment certificate or other evidence of indebtedness or a guarantee of a corporation, whether secured or unsecured; (*titre de créance*)

***Designated Minister*** means such member of the Queen’s Privy Council for Canada as may be designated by the Governor in Council as the Minister for the purposes of this Act; (*ministre compétent*)

***director*** means a member of the Board; (*administrateur*)

***enterprise*** means an organized economic activity carried on by one or more persons; (*entreprise*)

***Executive Committee***[Repealed, 2014, c. 39, s. 211]

***goods, wares and merchandise*** has the same meaning as in subsection 425(1) of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md); (*effets, denrées ou marchandises*)

***joint venture*** means an association of persons, when the relationship among those associated persons does not, under the laws of Canada, constitute a corporation, partnership or trust; (*coentreprise*)

***person*** includes a trust, a partnership, a joint venture and an association of natural persons or corporations; (*personne*)

***President*** means the President of the Bank; (*président*)

***resolution*** means a resolution of the Board; (*résolution*)

***securities*** means the shares of any class or series of shares or the debt obligations of a corporation and includes certificates evidencing those shares or debt obligations; (*valeurs mobilières*)

***subsidiary*** has the same meaning as in subsection 83(6) of the [Financial Administration Act](/en/Acts/Revised%20Statutes%20of%20Canada/F/F-11.md); (*filiale*)

***warehouse receipt*** has the same meaning as in subsection 425(1) of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md). (*récépissé d’entrepôt*)
> 1995, c. 28, s. 2; 2014, c. 39, s. 211.

## Establishment and Organization of the Bank

### Status of the Bank

**Continuation of Federal Business Development Bank**

**3**

- **(1)** The Federal Business Development Bank established by the Federal Business Development Bank Act is continued as a body corporate under the name “Business Development Bank of Canada”.

**Head office**

- **(2)** The head office of the Bank must be at a place in Canada that the Governor in Council may designate.

**Capacity**

- **(3)** The Bank has, in respect of its powers, all the rights, powers, privileges and capacity of a natural person.

**Agent of the Crown**

- **(4)** The Bank is for all purposes an agent of the Crown.

### Purpose

**Purpose of Bank**

**4**

- **(1)** The purpose of the Bank is to support Canadian entrepreneurship by providing financial and management services and by issuing securities or otherwise raising funds or capital in support of those services.

**Consideration to small and medium-sized enterprises**

- **(2)** In carrying out its activities, the Bank must give particular consideration to the needs of small and medium-sized enterprises.

### Board of Directors

**Membership of Board**

**5**

- **(1)** The Bank has a Board of Directors comprised of the Chairperson, the President and not fewer than three, but no more than 11, other directors.

**Limit on directors from public service**

- **(2)** No more than two of the directors, excluding the Chairperson and President, may be appointed from the federal public administration.
> 1995, c. 28, s. 5; 2003, c. 22, s. 224(E); 2010, c. 12, s. 1660.

**Appointment of Chairperson**

**6**

- **(1)** The Chairperson is to be appointed by the Governor in Council to hold office during pleasure for a term that the Governor in Council considers appropriate.

**Absence or incapacity**

- **(1.1)** If the Chairperson is absent or unable to act or the office of Chairperson is vacant, the Board may authorize one of the other directors to act as Chairperson, but that person is not authorized to act as Chairperson for a period of more than 180 days without the approval of the Governor in Council.

**Appointment of President**

- **(2)** Notwithstanding subsection 105(5) of the [Financial Administration Act](/en/Acts/Revised%20Statutes%20of%20Canada/F/F-11.md), the President is to be appointed by the Governor in Council to hold office during good behaviour for a term that the Governor in Council considers appropriate and may be removed for cause.

**Reappointment**

- **(3)** The President is eligible for reappointment on the expiration of his or her term of office.

**Appointment of directors**

- **(4)** The other directors are to be appointed by the Designated Minister, with the approval of the Governor in Council, for a term not exceeding four years that will ensure, as far as possible, the expiration in any one year of the terms of office of not more than half of the directors.

**Acting directors**

- **(5)** The Governor in Council may appoint an individual to act as a director if a director is absent or unable to act.

**Eligibility**

- **(6)** No individual is eligible to be appointed or to continue as President, Chairperson or a director if the individual is
	- **(a)** neither a Canadian citizen nor a permanent resident within the meaning of subsection 2(1) of the [Immigration and Refugee Protection Act](/en/Acts/Statutes%20of%20Canada/2001/c.%2027.md);
	- **(b)** a Canadian citizen who is not ordinarily resident in Canada;
	- **(c)** a permanent resident, within the meaning of subsection 2(1) of the [Immigration and Refugee Protection Act](/en/Acts/Statutes%20of%20Canada/2001/c.%2027.md), who has been ordinarily resident in Canada for more than one year after first becoming eligible to apply for Canadian citizenship;
	- **(d)** a member of the Senate or House of Commons or a member of the legislature of a province; or
	- **(e)** employed in the public service of a province.
> 1995, c. 28, s. 6; 2001, c. 27, s. 208; 2006, c. 9, s. 229; 2014, c. 39, s. 212.

**Functions of Board**

**7**

- **(1)** The Board shall direct and manage the business and affairs of the Bank.

**By-laws**

- **(2)** The Board may, by resolution, make by-laws to regulate the business and affairs of the Bank.

**Committees of Board**

- **(3)** The Board may establish any committee of the Board that it considers advisable and may determine the committee’s composition and duties and the tenure of its members.

**Delegation of powers and specification of duties**

- **(4)** The Board may delegate power to, and specify the duties and authority of, any committee of the Board to act in all matters that are not by this Act or any by-law or resolution specifically reserved to be done by the Board.
> 1995, c. 28, s. 7; 2014, c. 39, s. 213.

### Officers and Employees

**Duties of Chairperson**

**8** The Chairperson shall carry out the duties determined by by-law.

**Duties of President**

**9**

- **(1)** The President is the chief executive officer of the Bank and has, on behalf of the Board, responsibility for the direction and management of the business and affairs of the Bank with authority to act in all matters that are not by this Act or any by-law or resolution specifically reserved to be done by the Board or a committee of the Board.

**Absence or incapacity**

- **(2)** If the President is absent or unable to act or the office of President is vacant, the Board may authorize an officer or employee of the Bank to act as President, but that person is not authorized to act as President for a period of more than 180 days without the approval of the Governor in Council.
> 1995, c. 28, s. 9; 2014, c. 39, s. 214.

**Officers and employees**

**10** The Bank may employ the officers and employees, and may hire the agents or mandataries, advisers and consultants, it considers necessary to carry out the purpose of this Act and for the proper conduct of its business and the Bank may fix the terms and conditions of their employment or hiring.
> 1995, c. 28, s. 10; 2011, c. 21, s. 4(E).

**Delegation of powers and specification of duties**

**11** The Board may delegate power to, and specify the duties and authority of, any officer, employee or agent or mandatary of the Bank to act in all matters that are not by this Act or any by-law or resolution specifically reserved to be done by the Board or a committee of the Board.
> 1995, c. 28, s. 11; 2011, c. 21, s. 4(E); 2014, c. 39, s. 215.

**Confidentiality**

**12** All directors, officers and employees of the Bank or of any subsidiary, and all agents or mandataries, advisers and consultants whose services are engaged by the Bank or any subsidiary, must, before commencing their duties, take an oath or make a solemn affirmation of office and confidentiality in the form set out in the schedule before a commissioner of oaths or other person having authority to administer the oath or solemn affirmation in the place where it is taken or made.
> 1995, c. 28, s. 12; 2011, c. 21, s. 4(E); 2014, c. 39, s. 215.

### Remuneration and Benefits

**Remuneration of directors**

**13**

- **(1)** The Chairperson and each director, except the President and any director employed in the federal public administration, are entitled to be paid by the Bank the remuneration fixed by the Governor in Council for their time to attend meetings of the Board or any committee of the Board and to perform their duties under this Act.

**Remuneration of President**

- **(2)** The President is entitled to be paid by the Bank the remuneration fixed by the Governor in Council.

**Expenses of directors**

- **(3)** Directors are entitled to be paid by the Bank reasonable travel and living expenses incurred in connection with the performance of their duties under this Act while absent from their ordinary places of residence.

**Other remuneration and expenses**

- **(4)** Officers, employees, agents or mandataries, advisers and consultants are entitled to be paid by the Bank the remuneration, expenses and benefits that the Bank may determine.

**Pension fund**

- **(5)** The Board may make by-laws respecting
	- **(a)** the establishment, management and administration of a pension fund for the officers and employees of the Bank and their dependants;
	- **(b)** the contributions to be made to the fund by the Bank;
	- **(c)** the provision of benefits under the fund;
	- **(d)** the payment of pensions; and
	- **(e)** the investment of the money of the fund.
> 1995, c. 28, s. 13; 2003, c. 22, s. 224(E); 2011, c. 21, s. 5(E); 2014, c. 39, s. 216(F).

## Specific Powers of the Bank

### Financial Services

**Loans, investments, etc.**

**14**

- **(1)** The Bank may
	- **(a)** make loans to, or investments in, any person;
	- **(b)** give guarantees in relation to any person; or
	- **(c)** extend credit or provide liquidity to, or in relation to, any person through a category of transactions that is prescribed by the regulations.

**How services may be provided**

- **(2)** The services referred to in subsection (1) may be
	- **(a)** provided directly;
	- **(b)** provided through arrangements with other persons; or
	- **(c)** provided by the Bank as a member of a financing syndicate.

**Criteria for making loans, etc.**

- **(3)** The loans, investments and guarantees may be made or given only where, in the opinion of the Board or any committee or officer designated by the Board,
	- **(a)** the person is engaged, or is about to engage, in an enterprise in Canada;
	- **(b)** the amount invested, or to be invested, in the enterprise by persons other than the Bank and the character of the investment are such that the Bank may reasonably expect that those persons will have a continuing commitment to the enterprise; and
	- **(c)** the enterprise may reasonably be expected to prove successful.

**Enterprises outside Canada  — loans and guarantees**

- **(4)** Despite paragraph (3)(a), loans may be made to, or guarantees given in relation to, a person that is engaged or about to be engaged in an enterprise outside Canada if
	- **(a)** the person is a corporation, trust, partnership or joint venture in which at least one third of the voting interests are held by Canadians or is an association of natural persons or corporations of which at least half the members are Canadians; and
	- **(b)** at least one of the Canadians referred to in paragraph (a) is also engaged or about to be engaged in an enterprise in Canada.

**Enterprises outside Canada — investments**

- **(5)** Despite paragraph (3)(a), investments may be made in a person that is engaged or about to be engaged in an enterprise outside Canada if
	- **(a)** the person meets the requirements set out in paragraphs (4)(a) and (b); and
	- **(b)** the investment is of a category prescribed by the regulations.

**Funds outside Canada — investments**

- **(6)** Despite paragraph (3)(a), investments may be made in a person outside Canada if, in the opinion of the Board or any committee or officer designated by the Board,
	- **(a)** the person is an investment fund or other investment vehicle of which at least one half of the investment managers reside in Canada; and
	- **(b)** that fund or vehicle has an investment strategy that reflects an ongoing commitment to invest in Canada.

**Limitation**

- **(7)** Paragraph (3)(b) does not apply
	- **(a)** to a person that is a trust, a corporation as defined in subsection 2(1) of the [Canada Not-for-profit Corporations Act](/en/Acts/Statutes%20of%20Canada/2009/c.%2023.md) or a corporation incorporated under a provincial statute equivalent to that Act; or
	- **(b)** in the case where a loan, investment or guarantee is made or given through an arrangement referred to in paragraph (2)(b).

**Complementary to other services**

- **(8)** The services referred to in subsection (1) are to fill out or complete services available from commercial financial institutions.

**Acquiring and dealing with property**

- **(9)** In any circumstances in which the Bank may provide a service to a person under this section, the Bank may
	- **(a)** purchase or otherwise acquire real or personal property or immovables or movables including accounts receivable; and
	- **(b)** subject to any right of redemption that may exist, hold, lease to the person or subsequently sell, dispose of or otherwise deal with the property or immovables or movables.

**Definitions**

- **(10)** The following definitions apply in this section.

***Canadian*** has the same meaning as in paragraph (a), (b) or (d) of the definition Canadian in section 3 of the [Investment Canada Act](/en/Acts/Statutes%20of%20Canada/1985/c.%2028%20(1st%20Supp.).md). (*Canadien*)

***voting interest***
- **(a)** with respect to a corporation with share capital, means a voting share;
- **(b)** with respect to a corporation without share capital, means an ownership interest in the assets of the corporation that entitles the owner to rights similar to those enjoyed by the owner of a voting share; and
- **(c)** with respect to a partnership, trust or joint venture, means an ownership interest in the assets of the partnership, trust or joint venture that entitles the owner to receive a share of the profits and to share in the assets on dissolution. (*intérêt avec droit de vote*)
> 1995, c. 28, s. 14; 2001, c. 34, s. 9(F); 2011, c. 21, s. 6; 2014, c. 39, s. 217.

**Security**

**15**

- **(1)** The Bank may
	- **(a)** acquire and hold security or a security interest, including, in Quebec, a right in a security, of any kind and in any form for the due discharge of obligations under a loan, investment, guarantee or agreement that it makes or gives;
	- **(b)** surrender the security, security interest or right in the security and acquire and hold, in exchange, security or a security interest, including, in Quebec, a right in a security, of any kind and in any form;
	- **(c)** realize the security, security interest or right in the security made, acquired or held by it on the loan, investment, guarantee or agreement; and
	- **(d)** exchange, lease, sell, assign, convey or otherwise dispose of the loan, investment, guarantee, agreement, security, security interest or right in a security.

**Additional security**

- **(2)** Without limiting the generality of the powers of the Bank under this section, the Bank may, for the due discharge of the obligations referred to in paragraph (1)(a),
	- **(a)** acquire and hold a warehouse receipt or bill of lading as security; or
	- **(b)** take security on goods, wares and merchandise in the same form and manner as security on such property may be taken by a bank under section 427 of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md).

**Warehouse receipts and bills of lading**

- **(3)** Where the Bank acquires and holds a warehouse receipt or bill of lading as security, subsections 428(1), (2), (7), (8), (9) and (12) and 435(2) and section 436 of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md) apply, with any modifications that the circumstances require, as if the Bank were a bank under that Act.

**Goods, wares and merchandise**

- **(4)** Where the Bank takes security on goods, wares and merchandise, section 427 and subsections 428(1), (2), (7), (8), (9) and (12) of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md) apply, with any modifications that the circumstances require, as if the Bank were a bank under that Act.

**Deemed loan or advance**

- **(5)** Where the Bank issues a guarantee or otherwise makes a promise to effect a payment, the Bank is deemed to lend money or make an advance for the purposes of subsections (3) and (4) and the provisions of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md) that they refer to.
> 1995, c. 28, s. 15; 2011, c. 21, s. 7.

**Acquisition of loans**

**16** The Bank may acquire and deal with as its own any loan, investment or guarantee made or given by another person if
- **(a)** the loan, investment or guarantee would meet the Bank’s eligibility criteria in subsection 14(3); or
- **(b)** it is part of a block of loans, investments or guarantees the majority of which meet those criteria.

### Management Services

**Agreements**

**17**

- **(1)** The Bank may provide, or enter into agreements for the provision of, any of the following services:
	- **(a)** consulting;
	- **(b)** management training and mentoring;
	- **(c)** networking, referral and sourcing;
	- **(d)** information and research;
	- **(e)** any other management services prescribed by the regulations.

**Complementary to service providers**

- **(2)** The services are to fill out or complete services available from private sector service providers.
> 1995, c. 28, s. 17; 2014, c. 39, s. 218.

### Treasury Activities

**Borrowing powers**

**18**

- **(1)** The Bank may borrow money by any means, including issuing, selling, pledging or hypothecating debt obligations of the Bank.

**Debt obligations**

- **(2)** The debt obligations may, in accordance with their terms, be subordinated to secured or unsecured indebtedness of the Bank and liability under them may be limited to the remaining assets of the Bank, after payment of indebtedness ranking prior to the debt obligations.

**Investment powers**

- **(3)** The Bank may invest any money administered by it
	- **(a)** in debentures, bonds, stocks, bankers’ acceptances or other securities of or guaranteed by any member of the Canadian Payments Association, or the government of Canada or a province; or
	- **(b)** in any other manner that the Minister of Finance may approve.

**Financial management**

- **(4)** The Bank may enter into any transaction for the purpose of reducing risk in the financial management of the Bank, including any financial instrument or agreement whose object is the management of financial risks, such as interest rate or currency exchange agreements, options, futures contracts and any other similar agreements.

**Securities**

- **(5)** The Bank may pledge or hypothecate any of its assets or give deposits as security for any debt obligations issued by the Bank or as security for the due performance of its obligations under any financial management agreement.

**Non-application of certain provisions**

- **(6)** For greater certainty, this section has effect notwithstanding sections 100 and 101 of the [Financial Administration Act](/en/Acts/Revised%20Statutes%20of%20Canada/F/F-11.md).
> 1995, c. 28, s. 18; 2011, c. 21, s. 8.

**Loans to the Bank from Consolidated Revenue Fund**

**19** At the request of the Bank, the Minister of Finance may, out of the Consolidated Revenue Fund, lend money to the Bank on any terms and conditions that the Minister of Finance may fix.

### Agreements and Programs

**Agreements**

**20** The Bank may enter into agreements with, and act as agent or mandatary for, any department or agency of the government of Canada or a province, or any other body or person, for the provision of services or programs to, by, on behalf of or jointly with that body or person and, subject to subsection 14(3), may deliver financial assistance on their behalf under the agreement.
> 1995, c. 28, s. 20; 2011, c. 21, s. 9(E); 2014, c. 39, s. 219.

**Entrepreneur-ship programs**

**21** The Bank may carry out duties or functions that may be assigned to it by the Designated Minister in relation to the administration of any program supporting Canadian entrepreneurship, to the extent that it is able to recover the costs of carrying out the duties or functions.

### Ancillary Powers

**Powers**

**22** The Bank may
- **(a)** accept deposits as security for the due performance of any arrangement or agreement with the Bank;
- **(b)** determine and charge interest and any other form of compensation for services provided by the Bank in the exercise of its powers under this Act;
- **(c)** procure the incorporation, dissolution or amalgamation of subsidiaries and acquire or dispose of any shares in them;
- **(d)** acquire and dispose of any interest or right in any entity by any means;
- **(e)** acquire, hold, exchange, lease, sell or otherwise dispose of any interest or right in real or personal property or immovables or movables and retain and use the proceeds of disposition; and
- **(f)** generally, do all other things that are incidental or conducive to attaining the purpose of this Act and the exercise of the powers of the Bank.
> 1995, c. 28, s. 22; 2011, c. 21, s. 10.

## Capital of the Bank

**Authorized capital**

**23**

- **(1)** The authorized capital of the Bank consists of an unlimited number of common shares with a par value of $100 each and an unlimited number of preferred shares without par value, but the paid-in capital of the Bank, together with any contributed surplus relating to it and any proceeds referred to in paragraph 30(2)(d) that have been prescribed as equity, must not at any time exceed $4,500,000,000.

**Issuance of shares**

- **(2)** The shares of the Bank may be issued only to the Designated Minister to be held in trust for the Crown.

**Subscription by Designated Minister**

- **(3)** Where the Board recommends that the Designated Minister subscribe for unissued shares of the Bank, the Designated Minister may, if the Minister of Finance concurs, subscribe for the amount that the Designated Minister considers desirable.

**Payment out of Consolidated Revenue Fund**

- **(4)** The amount of the subscription is to be paid to the Bank out of the Consolidated Revenue Fund at any time and in any amount that the Board may require.
> 1995, c. 28, s. 23; 2009, c. 2, s. 264; 2017, c. 33, s. 260.

**Rights of common shares**

**24**

- **(1)** The rights conferred by common shares include
	- **(a)** the right to vote at any meeting of shareholders;
	- **(b)** the right to receive dividends declared on common shares; and
	- **(c)** the right to receive the remaining property of the Bank on dissolution.

**Rights of preferred shares**

- **(2)** The rights conferred by preferred shares of any class or series are limited as follows:
	- **(a)** the holders of preferred shares are not entitled to vote at meetings of shareholders;
	- **(b)** dividends, once declared, are limited to the rate, whether fixed or variable, cumulative or non-cumulative, that may be provided for in the by-laws; and
	- **(c)** participation in the remaining property of the Bank on dissolution is limited to the consideration paid for the shares plus any dividend accumulated or declared and unpaid, but no more.

**Declaration and payment of dividends**

**25**

- **(1)** In any financial year of the Bank, it may declare and pay to the shareholders of the Bank any dividends out of the retained earnings or surplus account of the Bank.

**Limitation**

- **(2)** The Bank may not declare or pay a dividend if there are reasonable grounds for believing that
	- **(a)** the Bank is, or would after the payment be, unable to pay its liabilities as they become due; or
	- **(b)** the realizable value of the Bank’s assets would, after the payment, be less than the aggregate of its liabilities and paid-up capital of all classes.

**Participation in dividends**

- **(3)** If any cumulative dividends or amounts payable on return of capital in respect of a series of shares are not paid in full, the shares of all series of the same class participate rateably in respect of accumulated dividends and the return of capital.

**Cancellation or restoration of shares**

**26** Shares, or fractions of them, of any class or series of shares issued by the Bank and purchased, redeemed or otherwise acquired by it must be cancelled or, if the number of them is limited and the by-laws so authorize, they may be restored to the status of authorized but unissued shares of that class or series.

**By-laws relating to shares**

**27** Subject to the approval of the Governor in Council on the recommendation of the Minister of Finance, the Board may make by-laws
- **(a)** setting out the rights, privileges, restrictions and conditions attaching to preferred shares, creating one or more additional classes of preferred shares and generally determining the rights and obligations of the holders of preferred shares, including
	- **(i)** limiting the right of the shareholders to specific dividends or repayments, whether fixed or variable,
	- **(ii)** authorizing the purchase or redemption of the shares by the Bank, either at the Bank’s option or at the shareholder’s request, and
	- **(iii)** limiting or extending the rights of the shareholders in any other way;
- **(b)** authorizing the issue of any class of shares in one or more series and authorizing the Board to fix, by resolution, the maximum number of shares in each series and to determine the designation, rights, privileges, restrictions and conditions attaching to the shares of each series, subject to any limitations set out in the by-law;
- **(c)** determining a maximum number of shares with respect to any class or series of preferred shares;
- **(d)** changing authorized shares without par value, whether issued or not, into shares with a par value and changing authorized shares with a par value, whether issued or not, into shares without par value;
- **(e)** consolidating or subdividing shares;
- **(f)** converting shares of any class into shares of another class; and
- **(g)** increasing or reducing the issued share capital or any part of it, with or without distribution of paid-in capital or reduction of liability on any of the shares.

**Hybrid capital instruments**

**28**

- **(1)** With the approval of the Governor in Council on the recommendation of the Minister of Finance, the Bank may issue to persons other than the Crown hybrid capital instruments prescribed, in whole or in part, as equity of the Bank under paragraph 30(2)(d).

**Crown not liable**

- **(2)** The Crown is not in any way liable for payment of amounts owing under an instrument issued under subsection (1).

**Instruments not shares**

- **(3)** For greater certainty, an instrument issued under subsection (1) is not a share within the meaning of Part X of the [Financial Administration Act](/en/Acts/Revised%20Statutes%20of%20Canada/F/F-11.md).
> 1995, c. 28, s. 28; 2014, c. 39, s. 220(F).

**Appropriations**

**29** Moneys may be appropriated by Parliament and paid out to the Bank for use in any of its activities.

## Debt-to-equity Ratio

**Limit on borrowings and guarantees**

**30**

- **(1)** The aggregate of
	- **(a)** the borrowings of the Bank under subsection 18(1) and section 19, and
	- **(b)** the contingent liabilities of the Bank in the form of guarantees given by it
must not at any time exceed twelve times the equity of the Bank.

**Definition of equity**

- **(2)** For the purpose of subsection (1), the equity of the Bank consists of
	- **(a)** the amounts paid for its shares, including any contributed surplus;
	- **(b)** the retained earnings of the Bank, which may be positive or negative;
	- **(c)** amounts paid to the Bank as capital by Parliamentary appropriation; and
	- **(d)** such proceeds of debt instruments, hybrid capital instruments or other arrangements as may be prescribed as equity by the Governor in Council.
> 1995, c. 28, s. 30; 2014, c. 39, s. 221(F).

## Conflict of Interest

**Definitions**

**31** In section 33,

***applicant*** means a person who applies to the Bank for assistance in the form of a loan, investment, guarantee, purchase or lease; (*demandeur*)

***interested person*** means
- **(a)** the spouse, common-law partner within the meaning of section 2 of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md), child, brother, sister or parent of a director,
- **(b)** the spouse, or the common-law partner within the meaning of section 2 of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md), of a child, brother, sister or parent of a director, or
- **(c)** the parent, sister or brother of the spouse, or of the common-law partner within the meaning of section 2 of the [Bank Act](/en/Acts/Statutes%20of%20Canada/1991/c.%2046.md), of a director. (*personne intéressée*)
> 1995, c. 28, s. 31; 2000, c. 12, s. 26.

**Restriction**

**32** The Bank shall not grant a loan, investment or guarantee to a director or officer of the Bank.
> 1995, c. 28, s. 32; 2001, c. 34, s. 10.

**Disclosure**

**33**

- **(1)** An applicant must disclose in writing to the Bank whether the applicant is an interested person or, if the applicant is a firm or corporation, whether a partner of the firm or a shareholder, director or officer of the corporation is an interested person or a director or officer of the Bank.

**Submission of application to Board for approval**

- **(2)** If the applicant discloses that the applicant is an interested person, or that a partner, shareholder, director or officer is an interested person or a director or an officer of the Bank, the application must be submitted to the Board for approval before the Bank enters into an agreement to provide the assistance.

**Director must not be at meeting or vote**

- **(3)** A director must not be present at a meeting of the Board when the Board is considering an application, or vote on a resolution relating to it, if the applicant is
	- **(a)** a person related to the director as described in paragraph (a), (b) or (c) of the definition ***interested person*** in section 31; or
	- **(b)** a firm or corporation of which the director, or a person referred to in paragraph (a), is a partner, shareholder, director or officer.

**Annual report**

- **(4)** The amount of each agreement referred to in this section and the name of the person, firm or corporation with whom the agreement is entered into must be included in the annual report that the Bank is required to submit under subsection 150(1) of the [Financial Administration Act](/en/Acts/Revised%20Statutes%20of%20Canada/F/F-11.md).
> 1995, c. 28, s. 33; 2001, c. 34, s. 11.

## Miscellaneous Provisions

**Financial year**

**34** Notwithstanding section 121 of the [Financial Administration Act](/en/Acts/Revised%20Statutes%20of%20Canada/F/F-11.md), the financial year of the Bank is the period of twelve months beginning on April 1 and ending on the next March 31, unless the Governor in Council directs otherwise.

**Exemption from taxes**

**35** The Bank is exempt from taxes imposed by the [Income Tax Act](/en/Acts/Statutes%20of%20Canada/1985/c.%201%20(5th%20Supp.).md).

**Ten-year review**

**36**

- **(1)** Five years after this Act comes into force, and every ten years afterward, the Designated Minister must have a review of the provisions and operation of this Act undertaken in consultation with the Minister of Finance.

**Report to Parliament**

- **(2)** Within one year after the review is undertaken, the Designated Minister must submit to Parliament a report on the review.

**Review of report**

- **(3)** The report must be reviewed by any committee of the Senate or of the House of Commons, or any joint committee, that may be designated or established for the purpose of reviewing the report.

**Privileged information**

**37**

- **(1)** Subject to subsection (2), all information obtained by the Bank or by a subsidiary in relation to its customers is privileged and a director, officer, employee or agent or mandatary of, or adviser or consultant to, the Bank or a subsidiary must not knowingly communicate, disclose or make available the information, or permit it to be communicated, disclosed or made available.

**Authorized disclosure**

- **(2)** Privileged information may be communicated, disclosed or made available
	- **(a)** for the purpose of the administration or enforcement of this Act and legal proceedings related to it;
	- **(b)** for the purpose of prosecuting an offence under this Act or any other Act of Parliament;
	- **(c)** to the Minister of National Revenue solely for the purpose of administering or enforcing the [Income Tax Act](/en/Acts/Statutes%20of%20Canada/1985/c.%201%20(5th%20Supp.).md) or the [Excise Tax Act](/en/Acts/Revised%20Statutes%20of%20Canada/E/E-15.md); or
	- **(d)** with the written consent of the person to whom the information relates.
> 1995, c. 28, s. 37; 2011, c. 21, s. 11(E); 2014, c. 39, s. 222.

**Use of Bank’s names or initials**

**38** Except with the consent in writing of the Bank, a person must not in any prospectus or advertisement, or for any other business purpose, use the name of the Bank or any of the following names or initials: “Federal Business Development Bank”, “*Banque fédérale de développement*”, “Industrial Development Bank”, “*Banque d’expansion industrielle*”, “B.D. Canada”, “B.D.C.”, “B.D.B.C.”, “B.F.D.” or “F.B.D.B.”.
> 1995, c. 28, s. 38; 2001, c. 34, s. 12.

**Offence**

**39** A person who contravenes section 37 or 38 is guilty of an offence and liable on summary conviction to a fine not exceeding $10,000 or to imprisonment for a term not exceeding six months, or to both.

**Regulations**

**40** The Governor in Council may make regulations
- **(a)** defining hybrid capital instrument; and
- **(b)** prescribing anything that by this Act is to be prescribed.
> 1995, c. 28, s. 40; 2014, c. 39, s. 223.

## Repeal

**41** [Repeal]

## Transitional Provisions

**Continuation of Federal Business Development Bank**

**42**

- **(1)** The Bank continues for all purposes the existence of the Federal Business Development Bank established by the Federal Business Development Bank Act.

**Rights preserved**

- **(2)** Without limiting the generality of subsection (1),
	- **(a)** the property of the Federal Business Development Bank continues to be the property of the Bank;
	- **(b)** the Bank continues to be liable for the obligations of the Federal Business Development Bank;
	- **(c)** an existing cause of action, claim or liability to prosecution relating to the Federal Business Development Bank is unaffected;
	- **(d)** a civil, criminal or administrative action or proceeding pending by or against the Federal Business Development Bank may be continued to be prosecuted by or against the Bank; and
	- **(e)** a conviction against, or ruling, order or judgment in favour of or against, the Federal Business Development Bank may be enforced by or against the Bank.

**Capital vests in Bank**

**43**

- **(1)** The capital paid in by Canada with respect to the Federal Business Development Bank as of the coming into force of this Act is vested in the Bank as its paid-in capital and is converted into common shares of the Bank on the basis of one fully paid common share for each $100 of paid-in capital.

**Definition of capital**

- **(2)** The capital vested in the Bank by subsection (1) includes
	- **(a)** amounts referred to in paragraph 28(1)(a) of the Federal Business Development Bank Act;
	- **(b)** amounts paid in under subsection 28(1) of that Act; and
	- **(c)** amounts paid in as capital by Parliamentary appropriation.

## Consequential Amendments

**44 to 55** [Amendments]

### **SCHEDULE**
**(Section 12)**
## Oath or Solemn Affirmation of Office
I, ____________, solemnly swear (*or* affirm) that I will faithfully, truly and to the best of my judgement, skill and knowledge, perform the duties required of me as a director (*or* officer, employee or agent or mandatary, as the case may be) of (*or* adviser or consultant to, as the case may be) the Business Development Bank of Canada (the “Bank”) and that properly relate to my duties as a director (*or* officer, employee or agent or mandatary, as the case may be) of (*or* adviser or consultant to, as the case may be) the Bank.

I also solemnly swear (*or* affirm) that I will not communicate, disclose or make available any information relating to the business of the Bank or the affairs of its customers to any person who is not legally entitled to receive the information and I will not permit it to be communicated, disclosed or made available to such a person.

I also solemnly swear (*or* affirm) that, except as authorized by law, I will not allow any person to inspect or have access to any books or documents that belong to, or are in the possession of, the Bank and that relate to the business of the Bank or the affairs of its customers.

> 1995, c. 28, Sch.; 2011, c. 21, s. 12(E).

repository: TravisMadill/CanadianLaws

path: /en/Acts/Statutes of Canada/1995/c. 28.md

repo_name: TravisMadill/CanadianLaws


text:
# JFile (jremote API)

<PageHeader />

## Interface JFile

All Known Implementing Classes:[JFileImpl](./../io/jfileimpl-(jremote-api) "class in com.jbase.jremote.io"), [WrappedJFile](./../jca/wrappedjfile-(jremote-api) "class in com.jbase.jremote.jca")
* * *

```
public interface JFile
```

The JFile object is used to query, read, and write to jBASE files.

### Method Summary

| Modifier and Type
 | Method and Description
 |
| --- | --- |
| `boolean`
 | `clear()`
Delete all records from the file.
 |
| `boolean`
 | `close()`
Closes this jBASE file.
 |
| `boolean`
 | `delete(String recordKey)`
Delete a record where the supplied recordKey is the key to the record.
 |
| `boolean`
 | `exists(String recordKey)`
This method returns true if the supplied record id exists.
 |
| `JCursor`
 | `getCursor()`
Returns a cursor to this jBASE file.
 |
| `boolean`
 | `hasLock(String recordKey)`
Check if the specified key holds a lock.
 |
| `JDynArray`
 | `read(String recordKey)`
Read a record where the supplied recordKey is the key to the record.
 |
| `JDynArray`
 | `readU(String recordKey, boolean blockedRead)`
Read a record where the supplied recordKey is the key to the record and locks it for update.
 |
| `boolean`
 | `releaseLock(String recordKey)`
Release the update lock (if held) on the specified key.
 |
| `boolean`
 | `releaseLocks()`
Releases all locks held by this file.
 |
| `JSelectList`
 | `select()`
Returns a select list containing the record keys in this jBASE file.
 |
| `boolean`
 | `write(String recordKey, JDynArray record)`
Write the supplied record to the jBASE file.
 |
| `boolean`
 | `writeU(String recordKey, JDynArray record, boolean blockedWrite)`
Write the supplied record to the jBASE file.
 |

### Method Detail

#### exists

```
boolean exists(String recordKey)
        throws JRemoteException
```

This method returns true if the supplied record id exists.
Parameters:`recordKey` -Returns:record existsThrows:`JRemoteException`
#### read

```
JDynArray read(String recordKey)
        throws JRecordNotFoundException,
               JRemoteException
```

Read a record where the supplied recordKey is the key to the record.
Parameters:`recordKey` -Returns:the record that was readThrows:`JRecordNotFoundException``JRemoteException`

#### readU

```
JDynArray readU(String recordKey,
                boolean blockedRead)
         throws JRecordNotFoundException,
                JRecordLockedException,
                JRemoteException
```

Read a record where the supplied recordKey is the key to the record and locks it for update.
Parameters:`recordKey` - The record key`blockedRead` - Specifies whether this method call should block if the record is lockedReturns:the record that was read and lockedThrows:`JRecordNotFoundException``JRemoteException``JRecordLockedException`
#### write

```
boolean write(String recordKey,
              JDynArray record)
       throws JRemoteException
```

Write the supplied record to the jBASE file. If an update lock was held against the supplied key, it will be released after the record has been written.
Parameters:`recordKey` -`record` -Returns:Returns true if the record did not exist prior to this write or false if the record was updated.Throws:`JRemoteException`

#### writeU

```
boolean writeU(String recordKey,
               JDynArray record,
               boolean blockedWrite)
        throws JRecordLockedException,
               JRemoteException
```

Write the supplied record to the jBASE file. If an update lock was held against the supplied key, it will *NOT* be released.
Parameters:`recordKey` -`record` -`blockedWrite` - Specifies whether this method call should block if the record is already lockedReturns:Returns true if the record did not exist prior to this write or false if the record was updated.Throws:`JRemoteException``JRecordLockedException`

#### releaseLock

```
boolean releaseLock(String recordKey)
             throws JRemoteException
```

Release the update lock (if held) on the specified key.
Parameters:`recordKey` -Returns:Returns true if lock has been released successfullyThrows:`JRemoteException`
#### releaseLocks

```
boolean releaseLocks()
              throws JRemoteException
```

Releases all locks held by this file.
Returns:Returns true if locks have been released successfullyThrows:`JRemoteException`
#### hasLock

```
boolean hasLock(String recordKey)
         throws JRemoteException
```

Check if the specified key holds a lock.
Parameters:`recordKey` -Returns:Returns true if the record is lockedThrows:`JRemoteException`

#### delete

```
boolean delete(String recordKey)
        throws JRemoteException
```

Delete a record where the supplied recordKey is the key to the record.

Returns true if the delete was successful or false if the record was not found.
An exception will be thrown if an error occurs whilst deleting the record.
Parameters:`recordKey` -Returns:delete successfulThrows:`JRemoteException`
#### close

```
boolean close()
       throws JRemoteException
```

Closes this jBASE file.

Closing a JFile frees the associate remote system resources. Subsequent actions on this JFile object will reopen the file.
Returns:close successfulThrows:`JRemoteException`

#### select

```
JSelectList select()
            throws JRemoteException
```

Returns a select list containing the record keys in this jBASE file.
Returns:JSelectList all record keysThrows:`JRemoteException`

#### getCursor

```
JCursor getCursor()
           throws JRemoteException
```

Returns a cursor to this jBASE file.
Returns:JCursor cursorThrows:`JRemoteException`
#### clear

```
boolean clear()
       throws JRemoteException
```

Delete all records from the file.

Returns true if the operation was successful or false if the records could not be deleted.
Returns:clear successfulThrows:`JRemoteException`

Back to [jRemote API](../../../../jremote-api/README.md)

<PageFooter />

repository: alonsogb/docs

repo_name: alonsogb/docs


text:
# Redux Async

https://github.com/freddyrangel/async-in-redux-workshop

## Generators

* Generators can be async, woo!
* if you yield a generator, add star (*)

## Redux-Saga

* Implementation of Saga Pattern, instead of thunks, all side effect (async) logic in one place
* Failure management pattern
* Multi-workflow, compensating actions for every step of the workflow where it can fail
* Like daemons, long-living processes for orchestrating transactions and handling recovery from failures
* functions takeEvery takeLatest (direct), call put (redux-saga/effects)
* redux-saga has it's own control flow
* root saga gathers all effects

## Redux-Saga Functions

* call
  * accepts a function, and returns value of function in object (an effect)
  * can test without api calls happening, just assert that it returns an effect
* put
  * creates an effect? (look up info)
* takeEvery
  * is a generator
  * like a reducer, for each of something, do this thing
* takeLatest
  * creates a buffer of size 1 (ish)
  * for multiple calls, takes last, cancels all previous
  * is a generator


text:
---
title: Paul Gicheru and Philip Kipkoech Bett - Paul Gicheru
published: true
action:
case: the-prosecutor-v-paul-gicheru-and-philip-kipkoech-bett
accused: paul-gicheru
youtube_id:
slug: paul-gicheru-and-philip-kipkoech-bett-events-paul-gicheru
---

On 9 February 2015 the Prosecutor requested an arrest warrant. Pre-Trial Chamber II [issued](https://www.icc-cpi.int/en_menus/icc/situations%20and%20cases/situations/situation%20icc%200109/related%20cases/ICC-01_09-01_15/court-records/chambers/ptcII/Pages/1.aspx) a sealed arrest warrant on 10 March 2015, which was [unsealed](https://www.icc-cpi.int/en_menus/icc/situations%20and%20cases/situations/situation%20icc%200109/related%20cases/ICC-01_09-01_15/court-records/chambers/ptcII/Pages/11.aspx) on 10 September 2015. The suspect remains [at-large](https://www.icc-cpi.int/pages/defendants.aspx).

branch_name: refs/heads/gh-pages

gha_license_id: MIT


text:
The AMEE category
business/processes/production/electronics/etchingandcvdcleaning/production
provides a methodology for calculating the fluorinated compound (FC)
emissions associated with the plasma etching of
silicon-containing-materials and cleaning of the chamber-walls of
chemical vapour deposition (CVD) tools in the semiconductor, LCD and
photovoltaic industries. The methodology uses typical emissions factors
for several greenhouse gases based on the quantity of electronics
substrate produced and represents the *Tier 1* approach described by the
IPCC Guidelines for National Greenhouse Gas Inventories
([NGGIP](http://www.ipcc-nggip.iges.or.jp/public/2006gl/vol3.html)).

-----

## How to use this category

### Selecting an emissions scenario

To use this category, specify the electronics industry sector using the
*sector* drill choice.

### Specifying activity data

Next, the user must specify the annual manufacturing design *capacity*
of substrate processes, and the annual capacity *utilisation* using the
***capacity*** and ***fractionCapacityUtilised*** profile item values.

Since the use of FC's is variable in the photovoltaic (PV) industry,
users can also specify the proportion of PV manufacture under
consideration that employs FC's. This should be set as a decimal
fraction (i.e. 0-1) using the ***fractionFluorinatedCompounds*** profile
item value. The returned emissions quantity is scaled according to the
fraction which uses FC's. Note: this option is only valid when
specifying the 'PV-cells' option in the *sector* drill choice.

### Results and calculation

The returned amounts represent the greenhouse gas emissions associated
with the quantity specified. Two quantities are returned, as follows:

  - ***CF4***: quantity of CF4 emissions (where appropriate)
  - ***C2F6***: quantity of C2F6 emissions (where appropriate)
  - ***C3F8***: quantity of C3F8 emissions (where appropriate)
  - ***CHF3***: quantity of CHF3 emissions (where appropriate)
  - ***NF3***: quantity of NF3 emissions (where appropriate)
  - ***SF6***: quantity of SF6 emissions (where appropriate)
  - ***CO2e***: CO2e emissions (all gases converted using the
    appropriate [global warming
    potential](Greenhouse_gases_Global_warming_potentials) and combined
    into a single quantity)

-----

## Notes

### Emissions factors

The IPCC stresses that the emissions factors used in this methodology
are designed to give an aggregated estimate of FC emissions. These
emissions factors should not be used separately or in combination with
any other data, but are appropriate only in the use specified within
this methodology and reported as a complete set.

repository: thegreenwebfoundation/datasets

gha_language: JavaScript

repo_name: thegreenwebfoundation/datasets


text:
# JSON Feed for Jekyll

A simple feed file that follows the [1.0 spec](https://jsonfeed.org/version/1) of the JSON Feed standard established by [Manton Reece](http://manton.org/) and [Brent Simmons](http://inessential.com/).

## Installation
Copy the `feed.json` file to the root directory of your Jekyll install.

Add the following line to your `head.html` (or similar theme file where the `<head>` section of your site is defined.

```
<link rel="alternate" title="{{ site.title }}" type="application/json" href="{{ "/feed.json" | absolute_url }}" />
```

If your server is not configured to serve JSON files, you might need to add this to your .htaccess file:

```
AddType application/json .json
```

repository: vallieres/jekyll-json-feed

repo_name: vallieres/jekyll-json-feed


text:
# simple_img_gallery
The simplest way to make a static image library, with only a little Python, minimal HTML, and nothing else

## Quickstart

	./generate_gallery.py ./sample_images

Alternatively, instead of `sample_images`, pass a full path to a directory of images of your choice:

	./generate_gallery.py /path/to/image_directory

The script will create an `index.html` in that directory, and view it with Firefox.

## Dependencies

There are no dependencies other than Python.  (Currently only Python 2 supported.)

## Installation

If you'd like to be able to use from any directory on your machine, you can:
```
cd simple_img_gallery
python ./setup.py install --prefix=${INSTALL_PATH}
```
where `INSTALL_PATH` must be on your `PYTHONPATH`.

The installation step (to a directory that lies on your `PYTHONPATH`)
allows you to call `generate_gallery.py` from any directory.

## Features

- Tile `N` images per row: pass an argument after the directory path.  (The default is `3`.)  For example, to tile `6` per row:

```
	generate_gallery.py /path/to/image_directory 6
```

- Click on any image to zoom (thank you browser)

- Right click on any image and "Save Image As" (if you want it for your plots)

Note:

- Currently only supports tiling the images in alphabetical order.

Future features:

- Support Python3

- Multi-browswer support (currently we only natively support Firefox)

- Support randomization, down-sampling


text:
# MNotes

MNotes is an Android app for adding selected text (from the Instagram, Google Chrome, Facebook, etc.) to the app and for the automatic searching/downloading
(if it's music) to your phone.

## Usage

```
[link to PlayMarket]
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: MishaVernik/MNotes

repo_name: MishaVernik/MNotes


text:
# Contributing

If you can think of something nice to add or want to change / extend some of the functionality, feel free to create a Pull Request or an Issue. Please make sure to follow the code style (.prettierrc is included in the GitHub) and not break any of the existing functionality. Any help is greatly appreciated!

## Setting up the repository and build the package

## Prerequisites

- NodeJS v14
- npm 7

## Setup

To setup a local environment you need to do the following steps:

- Fork the repository to your GitHub account, so you can push your changes
- Clone the repository
- Install dependencies: `npm install`
- Run the build `npm run build` (only required once to copy assets)
- Start the Live Server: `npm run start` or `npm run start:big`
- If you want to package OctoDash, so you can install it on your Raspberry Pi: `npm run pack`

## Languages

To launch the app in development mode in a specific locale instead of the source english locale, use

```
npm run start --serve="--configuration=<lang>"
```

For a list of available locales have a look at the `angular.json` (`projects.OctoDash.i18n.locales`) file.

### Add a new language

To add a language to the list of supported languages, follow these steps or follow the official Angular Tutorial [here](https://angular.io/guide/i18n#translate-each-translation-file):

- find your ISO639-2 language code [here](https://www.loc.gov/standards/iso639-2/php/code_list.php)
- run `npm run locale:extract` to generate a new locale file
- locate the newly created file in the `src/locale` folder
- rename the file to include your language code in the format `messages.<languageCode>.xlf`
- in the `<file>` tag (second line of the xlf file) add `target-language="<languageCode>"`
- duplicate the `<source>` tags for each element, replace `source` with `target` and put your translation in that tag
- you can also use any XLIFF translation tool (i.e. [Brightex XLIFF](http://xliff.brightec.co.uk/)) to speed up the process
- add your language reference in `angular.json`

  - `Projects.OctoDash.i18n.locales`

    - add:

      ```
      "<lang>": {
        "translation": "src/locale/messages.<lang>.xlf",
        "baseHref": ""
      }
      ```

  - `Projects.OctoDash.architect.build.configurations.production.localize`.

    - add:

      ```
        "<lang>"
      ```

  - `Projects.OctoDash.architect.build.configurations`.

    - add:

      ```
      "<lang>": {
        "localize": ["<lang>"]
      },
      ```

  - `Projects.OctoDash.architect.serve.configurations`.

    - add:

      ```
        "<lang>": {
          "browserTarget": "OctoDash:build:<lang>"
        },
      ```

## Update translations IDs and sources

To update translations with the latest codebase and IDs, run `npm run locale:update`. Only commit the files that do not have a date, these are only backups of the locale versions before the update.

repository: UnchartedBull/OctoDash

branch_name: refs/heads/main

gha_language: TypeScript

repo_name: UnchartedBull/OctoDash


text:
# Connect 4
Connect 4 written in Go
Starter code for assignment 3

## Running

Run `go run board.go connect4.go play.go minimax.go` when in the same directory as the source files.

## Testing

Run `go test` when in the source's directory.


text:
# Description: Docker Diff Command

### Note
* This command inspects changes to files or directories on a container's filesystem.
* Equivalent to ``.

### Commands
```
Write Here
```

### TODO
* None


text:
## Coding Conventions

This software is organised into various modules.
Each module has various type definitions and methods declared.
Commenting is
done inside each module file to describe the purpose of the module and its usage.
Most of the comments in the code are inline with the text in this documentation.
Within each module, variable naming is done
to reduce the effort needed to understand the source code.
For example,
`distance = velocity * time` is prefered over using
`a = b * c` in most parts of the software.
The code inside each method is properly intended using spaces to facilitate
redability.
We followed this documentation [![guide](http://www.stochasticlifestyle.com/finalizing-julia-package-documentation-testing-coverage-publishing/)](http://www.stochasticlifestyle.com/finalizing-julia-package-documentation-testing-coverage-publishing/)

* The methods ending with `!` ideally should not allocate and memory. They are supposed to be fast and iteratively called inside loops.

gha_license_id: NOASSERTION


text:
[![BuildStatus](https://travis-ci.org/roskenet/springboot-javafx-support.svg?branch=master)](https://travis-ci.org/roskenet/springboot-javafx-support)
[![Coverage Status](https://coveralls.io/repos/github/roskenet/springboot-javafx-support/badge.svg?branch=master)](https://coveralls.io/github/roskenet/springboot-javafx-support?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.roskenet/springboot-javafx-support/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.roskenet/springboot-javafx-support)
[![ReadTheDocs](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://springboot-javafx-support.readthedocs.io)
# springboot-javafx-support
Attention:
The current master is for Spring Boot 2 and Spring Framework 5.

The latest production ready releases:
*  For Spring Boot 1.5.x is 1.4.5.
*  For Spring Boot 2.x is 2.1.5.

Spring Boot and JavaFx - A perfect match!

You will need at least JDK1.8 patch level 40.

Find a step-by-step example here: https://www.felixroske.de/page/programmierung/index.html

And a bunch of examples here: https://github.com/roskenet/spring-javafx-examples/

repository: Pyknic/springboot-javafx-support

repo_name: Pyknic/springboot-javafx-support


text:
# React example

This example runs a web React application written in Una

## Install
```
npm install
```

## Run
```
npm start
```

repository: una-language/example-react

repo_name: una-language/example-react


text:
## Artifical Intelligence Project: Predicting Wine Quality

**Project description:** This project involved using Python with Keras to build a classification model that will predict the wine quality based on the 11 different wine attributes for Portuguese "Vinho Verde" wine.

### 1.	Data Used:
The data that was used to create this neural network was retrieved from the UCI Machine Learning Repository. This data from the “winequality-white.csv” included information on the white variants of the Portuguese "Vinho Verde" wine. This data set included 11 different columns of various wine attributes such as fixed acidity, volatile acidity, citric acidity, residual sugar, chlorides, free sulfur dioxide, total sulfur dioxide, density, pH, sulphates and alcohol level. The 12th column consisted of the quality of the wine.

### 2.	Objective:
The objective of creating this neural network is to build a classification model that will predict the wine quality based on the 11 different wine attributes. The quality of the wine is ranked from 0 to 10 with 0 being the lowest and 10 being the highest. The goal is to train the neural network so that it can learn which attributes result in the overall quality score. The model that produces the highest accuracy will be the model considered the most efficient model.
To measure how well our model is performing we will create a training and test set sample from the wine data set. We will then measure how well our training model fits our test model by using the categorical crossentrophy and accuracy metric. The categorical crossentrophy metric will tell us how often our model classified the right quality level or not. We will also be using a confusion matrix to see which quality ratings were being predicted more correctly than others. The accuracy metric is also included in this model to assess the overall accuracy rate of predicted classifications.

### 3.	Input variables explanation / preprocessing steps:
The input variables that were used came from the winequality-white.csv file. The independent variables are the first 11 columns which are the wine attributes. These are the 11 columns that I subset into its own x variable to later scale.
I also separated out the dependent variable, y, to use in the model to predict its accuracy. The last column is wine quality which is the dependent variable we are using to access how our model is performing. Since this is a classification problem, it is necessary to turn the wine quality feature into a categorical feature.

The to_categorical function allows us to take each number that is in the quality column and turn it into a binary factor of 1 and 0 for every wine quality rating. This allows our model to better understand when it wrongly predicts the wine quality rating.

Before running the model, it was also important to scale the features of the different wine attributes. If we were to run the model without scaling these x’s then, the model would believe that the larger numbers are more important. We scale the data to ensure that one column is not favored largely over the other.
###  4.	Metric Explanation and Justification:
I chose to measure how well my neural network was performing by using the categorical crossentropy and accuracy metric. The categorical crossentropy metric would allow me to understand how often my training model was correctly classifying the training set wine qualities to the wine qualities test set. I didn’t really use this metric as a hard determinant with how well my model was performing but, instead used it as a loss function to understand what number of each classification was being calculated correctly.
Since this is a classification problem, accuracy was a more useful metric in determining if my model was correctly predicting the wine quality class or not.
It was also important to include a confusion matrix with my neural network classification model. Accuracy measures the overall corrected predictions but, a confusion matrix allows us to tell if the model is predicting one number more than other numbers. A model that has similar incorrect predictions across all of the different classes is a good model but, a model with great accuracy with one class and terrible at all the other classes is a poor model.
*I have included a confusion matrix screenshot with every experiment I conducted.
*I have also included the metrics of my NN below in Table 1.1.

### 5.	Final ANN model code:
```python
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Import Libraries Section
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
import datetime
import pandas as pd
import keras
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import KFold
from keras.utils import to_categorical
from sklearn.model_selection import GridSearchCV
import itertools
from sklearn.metrics import confusion_matrix
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Load Data Section
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
data = pd.read_csv("winequality-white.csv", delimiter=";", header=0)
dataset = data.values
x = dataset[:,0:11]
y = dataset[:,11]
#print(y)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Pretreat Data Section
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
np.random.seed(22)
scaler=MinMaxScaler()
x_scaled=scaler.fit_transform(x)
#print(x_scaled.shape)
cat_y = to_categorical(y)

#print(cat_y.shape)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Parameters Section
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Define Model Section
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
start_time=datetime.datetime.now()

# create model
def create_model():
    model=Sequential()
    model.add(Dense(22, input_dim=x_scaled.shape[1], activation = 'relu'))
    model.add(Dense(15, activation = 'sigmoid'))
    model.add(Dense(11, activation = 'relu'))
    model.add(Dense(10, activation = 'softmax'))

    #compile network
    model.compile(optimizer='adam', loss='categorical_crossentropy', metrics = ['categorical_accuracy'])
    return model

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Train Model Section
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
def plot_confusion_matrix(cm, classes,
                          normalize=False,
                          title='Confusion matrix',
                          cmap=plt.cm.Blues):
    """
    This function prints and plots the confusion matrix.
    Normalization can be applied by setting `normalize=True`.
    """
    plt.figure()
    plt.imshow(cm, interpolation='nearest', cmap=cmap)
    plt.title(title)
    plt.colorbar()
    tick_marks = np.arange(len(classes))
    plt.xticks(tick_marks, classes, rotation=45)
    plt.yticks(tick_marks, classes)

    if normalize:
        cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]

    thresh = cm.max() / 2.
    for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):
        plt.text(j, i, cm[i, j],
                 horizontalalignment="center",
                 color="white" if cm[i, j] > thresh else "black")
    plt.tight_layout()
    plt.ylabel('True label')
    plt.xlabel('Predicted label')
n_split= 5
for train_index, test_index in KFold(n_splits=n_split, shuffle=False, random_state=None).split(x_scaled):
    x_train, x_test=x_scaled[train_index], x_scaled[test_index]
    y_train, y_test=cat_y[train_index], cat_y[test_index]
    model=create_model()
    history=model.fit(x_train, y_train, batch_size=3, epochs=60, verbose=1, validation_data=(x_test, y_test))
    print('Model Evaluation Train MSE:', model.evaluate(x_train, y_train))
    print('Model Evaluation Test MSE:', model.evaluate(x_test, y_test))
    plt.figure()
    plt.plot(history.history['loss'], label='Training loss')
    plt.plot(history.history['val_loss'], label='Test loss')
    plt.title('Loss values')
    plt.ylabel('Loss value')
    plt.xlabel('Epoch')
    plt.legend(loc="upper left")
    plt.show()
    pred_label = model.predict(x_test)
    # Get classes
    pred_label_classes = np.argmax(pred_label, axis=1)
    # get true
    label_true = np.argmax(y_test, axis = 1)
    confusion_mtx = confusion_matrix(label_true, pred_label_classes)
    print(confusion_mtx)
    # Call plot confusion Matrix
    plot_confusion_matrix(confusion_mtx, classes = range(7))
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Show output Section
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
stop_time = datetime.datetime.now()
print("Time required for training:", stop_time- start_time)
#print('dataset.type', dataset)
print('Model Evaluation Train Cateogrical Crossentrophy, Accuracy:', model.evaluate(x_train, y_train))
print('Model Evaluation Test Cateogrical Crossentrophy, Accuracy:', model.evaluate(x_test, y_test))
```

### 6.	Final model in words:
My final model had three hidden layers starting with 22, 15 and 11 nodes. The first hidden layers used the activation function relu. The second hidden layer used the activation function sigmoid and the third hidden layer used relu. I used the optimizer adam and calculated loss by using categorical crossentrophy and included accuracy as an added metric. I utilized a 5 K-fold cross validation method and had an 80/20% mix of training and test data. My overall test accuracy was .591.

### 7.	Training algorithm in words:
It was important to create the training and test set within the K-Fold cross validation for loop. This allowed me to specify the number of K-fold splits for the model as well as the number of training and test splits. Every model created had a training split of 80% and test split of 20%. I wanted a high training split so my model could have a larger opportunity to predict the right wine quality rating.
The training and test set for the x’s/ y’s were created from the pretreated step of the scaled x’s and converted categorical y’s.

### 8.	Validation explanation of method chosen:
All my models used a K-fold cross validation split for the white wine data set. I kept shuffle equal to false to ensure that all the wine data was used. I was afraid if I set this to true, then some of the wine quality ratings might not be reported since there was not an even amount of wine quality ratings in the data set.
I found my best results with a K-fold split of five and found little improvement in increasing or decreasing the number. This method will ensure that four subsets of the data will be trained on the neural network with the last subset used for testing whether our model predicted the right wine quality or not.

### 9.	Objective results and Problem:
There were many problems in running my neural network as a classification model for predicting the wine quality rating. The first issue was that the data within the wine quality column did not have an even distribution of quality samples.

In the picture above, there was only five records with a quality rating of 9 and seven records with a wine quality of 3. The wine qualities that were in the middle of 3 and 9 had a better sample size and it was easier to predict its classification.

Overall my model hovered around 55% to 60% accuracy which is slightly better than flipping a coin but, still not accurate enough to be highly predictive. My best model had a test accuracy of .591. If there were a more evenly distribution of sample size among the various wine qualities, then this model would have a better chance at becoming more predictive.
At first, I used the binary crossentropy loss metric and had an average accuracy over 90% but, this was very misleading. The model was measuring its loss on how well it predicted either 1 or 0 but, that is not the accuracy we wanted to measure. When I changed it to categorical crossentropy as the loss metric, this allowed me to better understand how often my model was predicting the wine quality classes.
### 10.  Final Remarks
If we were to have a larger sample size within the wine qualities on the high and low ends, then we could create a more predictive model. If this model was only used to predict wine quality classifications between four and seven, then we could generate an efficient model that predicts at a high level of accuracy.


text:
# Missing variable declaration
In JavaScript, if a variable is used in a function but not declared as a local variable, it becomes a global variable by default. This can have unintended consequences: unlike local variables, global variables can be read and modified by all functions. If different functions use the same global variable, they may end up overwriting each others values, leading to subtle and difficult to diagnose bugs.

## Recommendation
Check whether the variable in question was meant to be local; if so, declare it by means of a `var` declaration. If the variable is really meant to be global, it is best to document this fact by inserting a global `var` declaration at the beginning of the source file.

## Example
In the following example, both `f` and `g` use a loop counter variable `i`. Since neither of them declares `i` to be a local variable, they end up accessing the same global variable, so every time `f` invokes `g` inside the loop, `g` overwrites `f`'s value for `i`.

```javascript
function f(a) {
	var sum = 0;
	for (i=0; i<a.length; ++i)
		sum += g(a[i]);
	return sum;
}

function g(b) {
	var prod = 1;
	for (i=0; i<b.length; ++i)
		prod *= b[i];
	return prod;
}
```
The example should be fixed by declaring `i` to be a local variable in `f` and `g`.

## References
* D. Crockford, *JavaScript: The Good Parts*, Appendix A. O'Reilly, 2008.


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0](https://github.com/strvcom/code-quality-tools/compare/@strv/remark-config@2.0.0-alpha.2<EMAIL_ADDRESS>(2021-09-07)

**Note:** Version bump only for package @strv/remark-config

# [2.0.0-alpha.2](https://github.com/strvcom/code-quality-tools/compare/@strv/remark-config@2.0.0-alpha.1<EMAIL_ADDRESS>(2021-09-07)

### Bug Fixes

* **rule:** use correct semver ranges for engines.node 🤦♂ ([5f1737f](https://github.com/strvcom/code-quality-tools/commit/5f1737fb43dce5a7099cfc448cd98ee3cbf9879b))

### chore

* **deps:** upgrade all deps 💣 ([3a827aa](https://github.com/strvcom/code-quality-tools/commit/3a827aa2fe0f62a055de69323665ba03cd7eaf08))
* **repo:** bump minimum Node.js version ([a8125c2](https://github.com/strvcom/code-quality-tools/commit/a8125c2772a67a4565786667fb95f4b32b9b468c))

### BREAKING CHANGES

* **repo:** All packages must now be used with a minimum of Node.js 14 or 16.
* **deps:** Most dependencies have been upgraded to a newer major version. Most of the time these upgrades dropped support for old Node.js versions.

# [2.0.0-alpha.1](https://github.com/strvcom/code-quality-tools/compare/@strv/remark-config@2.0.0-alpha.0<EMAIL_ADDRESS>(2021-02-03)

### Features

* **remark:** upgrade deps 💣 ([f912e3c](https://github.com/strvcom/code-quality-tools/commit/f912e3ce5a79f6279521e9ee49984d234e74cbc2))

# [2.0.0-alpha.0](https://github.com/strvcom/code-quality-tools/compare/@strv/remark-config@1.0.2<EMAIL_ADDRESS>(2020-10-09)

### Features

* **remark:** upgrade deps, require Node.js v10 ([0042eab](https://github.com/strvcom/code-quality-tools/commit/0042eab1851afbddc6811ba6719eecaddafad0bf))

### BREAKING CHANGES

* **remark:** This ruleset now requires at least Node.js v10.

## [1.0.2](https://github.com/strvcom/code-quality-tools/compare/@strv/remark-config@1.0.1<EMAIL_ADDRESS>(2019-08-13)

### Bug Fixes

* add missing deps to @strv/remark-config 🤦♂ ([9a279ba](https://github.com/strvcom/code-quality-tools/commit/9a279ba))
* fix package.json author typo ([80ec1e6](https://github.com/strvcom/code-quality-tools/commit/80ec1e6))

## [1.0.1](https://github.com/strvcom/code-quality-tools/compare/@strv/remark-config@1.0.0<EMAIL_ADDRESS>(2019-04-05)

**Note:** Version bump only for package @strv/remark-config

# 1.0.0 (2019-03-07)

### Features

* add @strv/remark-config ([735e7dd](https://github.com/strvcom/code-quality-tools/commit/735e7dd))

### BREAKING CHANGES

* Initial release 🚀

repository: strvcom/code-quality-tools

repo_name: strvcom/code-quality-tools


text:
# go-localstack-sample

[![CircleCI](https://circleci.com/gh/ushios/go-localstack-sample.svg?style=shield&circle-token=49d19d012d570b2af1f0f5c08ba58f6bde352526)](https://circleci.com/gh/ushios/go-localstack-sample)

Using localstack on golang

* [S3 PutObject sample](./s3.go#L15-L38)

repository: ushios/go-localstack-sample

repo_name: ushios/go-localstack-sample


text:
# FnJS

> A functional JavaScript library prototype

This is a simple prototype of a syntax that could be used to simulate a
Clojure-type of syntax with JavaScript.

## Usage examples

The basic usage is to include the library `fnjs.js` in your project and use the
library to "compile" your fnjs syntax:

```javascript
// Run directly
require('./fnjs.js')(
  [console.log, 'Hello world!'] // Prints "Hello world!"
)

// Or have it inside a variable
const fnjs = require('./fnjs.js')
fnjs([console.log, 'hello world'])
```

This includes the script "compiler" library and runs the `console.log` against
the input string.

### Math library

You can do basic calculations by including the Math library, such as:

```javascript
fnjs([
  [fnjs.stdlib.imports.Math], // Imports math functions

  [console.log, ['*', 2, 2, 2]], // Prints "8"

  [console.log, ['+', 10, 10, ['-', 10, 5]]] // Prints "25"
])
```

As with Clojure, the numbers are calculated from left-to-right.

### Defining functions

You can define your own functions as such:

```javascript
fnjs([
  ['defn', 'square', a => a * a],

  [console.log, ['square', 5]] // Prints "25"
])
```

You can also use the `defn` to run more fnjs code

```javascript
fnjs([
  [fnjs.stdlib.imports.Math], // Imports math functions

  ['defn', 'square', a => ['*', a, a]],

  [console.log, ['square', 5]] // Prints "25"
])
```

### Using builtin stdlib

The builtin stdlib comes with many handy functions. You can find the different
functions in the `stdlib`:

```javascript
const fnjs = require('fnjs')
fnjs([fnjs.stdlib.inc, 15]) // Outputs 16
```

However you might want to use functions from the `stdlib` by spreading them to
top-level functions:

```javascript
const fnjs = require('fnjs')
const { inc } = fnjs.stdlib
fnjs([inc, 15]) // Outputs 16
```

Note that the `stdlib` only includes a number of functions that you can use, but
any JavaScript function can be used:

```javascript
fnjs([Math.ceil, 0.5]) // Outputs 1
```

Here's a few `stdlib` functions to get you started, note the minor differencies
between Clojure:

#### list

While you have a list shorthand available at Clojure (use `[]` instead of `()`),
in fnjs you'll need to use the list constructor to build up lists:

```javascript
fnjs([list, 1, 2, 3, 4, 5]) // outputs [1, 2, 3, 4, 5]
```

#### map

Using `map` you'll need to pass a `list` as the third argument to make it work
properly, otherwise the first value is epected to be a function or global
function name.

```javascript
fnjs([map, inc, [list, 1, 2, 3]]) // Outputs [2, 3, 4]
```

#### cond

You can use `cond` pretty much the same as you'd use it with Clojure, but the
predicates will need to be prefixed with `pred` function:

```javascript
fnjs(
  [cond,
    [pred, lt, 2, 2], 'foo',
    [pred, gt, 5, 2], 'bar'])
```

## Features

This project:

- Achieves Clojure-like syntax for your JavaScript
- Does not actually isolate the scopes (yet)
- Is just a quick draft of an idea
  - Please do not use in production (yet)

## Contributing

If you'd like to contribute, please fork the repository and use a feature
branch. All improvements and ideas are warmly welcome.

## Licensing

The code in this project is licensed under MIT license.

repository: jehna/fnjs

repo_name: jehna/fnjs


text:
Another build system. Sort-of

This is designed to be a helper library so that anyone can make a build system
that suits their needs _and_ program it in Python, taking full advantage of its
flexibility and modularity.

An example of how to use this library is available: https://github.com/ianwlarson/ilmakelib_example

repository: ianwlarson/ilmklib

repo_name: ianwlarson/ilmklib


text:
[pickui](../../index.md) / [com.lovoo.android.pickui.view](../index.md) / [PictureDecoration](index.md) / [<init>](./-init-.md)

# <init>

`PictureDecoration(spanCount: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, padding: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)`

Custom decoration for items of an RecycleView that should get
equal space between each other and its parent.

repository: lovoo/android-pickpic

gha_language: Kotlin

repo_name: lovoo/android-pickpic


text:
# Haxe macros for working with JS npm externs

Macros utilities for making it easier/faster when working with npm libraries, such as [sequelize](http://docs.sequelizejs.com/).

NPM modules supported so far:

 - [sequelize](http://docs.sequelizejs.com/)

Haxe macros are particularly useful in generating boilerplate code from other code or configuration, allowing compiler type checking, and ensuring correct arguments in an otherwise runtime-only checked language (Javascript).

## [Sequelize](http://docs.sequelizejs.com/)

Generate the attributes for your models, so you can keep model variables type checked.

MyModel.hx:

	#if !macro
	import npm.sequelize.ModelInstance;
	#end

	extern class MyModel
	#if !macro
		extends ModelInstance<MyModel>
	#end
	{
		@db({allowNull: false, primaryKey: true})
		var id :String;

		@db({allowNull: false})
		var name :String;

		@db({type:'JSONB'})
		var blob :SomeTypeDef;

		@db({type:'STRING(20)'})
		var customString :String;
	}

Then in your Sequelize initialization:

	var sequelize :Sequelize = new Sequelize(<your db config options>);

	var MyModel = sequelize.define('mymodel',
			SequelizeTools.ensureCorrectTypes(
				SequelizeMacros.getSequelizeFieldAttributes(MyModel)));

This will generate the model attributes defined in the [sequelize docs](http://docs.sequelizejs.com/manual/tutorial/models-definition.html).

This means you do not have to write separately the fields in the model configuration that are already specified in your model class. Writing the same thing in two places means a human has to validate something that should be the job of the compiler.

repository: dionjwa/haxe-js-extern-macros

repo_name: dionjwa/haxe-js-extern-macros


text:
Boiler
======

Command-line utility for generating boilerplate files. At the moment, it's a glorified file-copy utility, but the plan is to include basic templating in the future.

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

The utility itself lives in a single file, `boiler.py`. To install, just drop the file (or a link to the file) anywhere in your `PATH`.

To run the tests, download both files, make sure `test-boiler.py` can reference `boiler.py` via `import boiler` (putting them in the same folder is easiest), and run `python test-boiler.py`.

Usage
-----

The utility copies named files from a _templates directory_ (by default, `~/.boiler`) into an _output directory_ (by default, the working directory):

```bash
$ ls
awesome-program.c
$ ls ~/.boiler
build.xml setup.py Makefile LICENSE
$ boiler.py Makefile LICENSE
$ ls
awesome-program.c Makefile LICENSE
```

The default templates directory and output directory may be overridden:

```bash
$ ls project
$ ls ../templates
build.xml setup.py Makefile LICENSE
$ boiler.py --templates-dir ../templates --output-dir project Makefile LICENSE
$ ls project
Makefile LICENSE
```

repository: mnesvold/Boil

repo_name: mnesvold/Boil