text:
# SnipCoin Token Contract Audit

## Summary

[Snip](https://www.snip.today/) intends to run a [crowdsale](https://www.snip.network/sale/signup/?next=/sale/) commencing on
September 29 2017.

Bok Consulting Pty Ltd was commissioned to perform an audit on the Ethereum smart contracts for Snip's crowdsale.

This audit has been conducted on Snip's source code in commits
[547c295](https://github.com/SnipToday/SnipCoin/commit/547c295895700ce44ab5d63cab506978e2f01634),
[022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b),
[f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43),
[94ffa4d](https://github.com/SnipToday/SnipCoin/commit/94ffa4d4a3750c0cf584ac63a1df464dd4d6c3dc),
[07a5991](https://github.com/SnipToday/SnipCoin/commit/07a5991327b7c26e040e319aa67205ff96697a7d),
[a5c4d0d](https://github.com/SnipToday/SnipCoin/commit/a5c4d0d32dcfeb9aa120a208c4ba285fdacabe60),
[4cda853](https://github.com/SnipToday/SnipCoin/commit/4cda85368a553832b01e16ebfcff43c816ed6b02),
[bf168d8](https://github.com/SnipToday/SnipCoin/commit/bf168d8e22fa6b73792513e6ce4e611a2f8209eb) and
[44a48f3](https://github.com/SnipToday/SnipCoin/commit/44a48f3567c0c97b31371c7cbe77c071665677c2).

No potential vulnerabilities have been identified in the crowdsale and token contract.

Note that this crowdsale contract does not have a built in start and end date. The crowdsale contract can commence receiving
contributions when the crowdsale administrator executes `openOrCloseSale(true)`. The crowdsale contract closes when the
crowdsale administrator executes `openOrCloseSale(false)`. The tokens are transferable after the crowdsale administrator
executes `allowTransfers()`.

### Crowdsale Mainnet Addresses

Crowdsale and token contract deployed to [0x44f588aeeb8c44471439d1270b3603c66a9262f1](https://etherscan.io/address/0x44f588aeeb8c44471439d1270b3603c66a9262f1#code).

Crowdsale wallet at [0xb4ad56e564aab5409fe8e34637c33a6d3f2a0038](https://etherscan.io/address/0xb4ad56e564aab5409fe8e34637c33a6d3f2a0038).

### Crowdsale And Token Contract

The *SnipCoin* crowdsale and token contract will accept ethers (ETH) sent from Ethereum account to the contract address.

Accounts contributing to this crowdsale will have to be registered by Snip in either the capped or uncapped whitelist.

ETH contributed by participants to the *SnipCoin* crowdsale contract will result in SNIP tokens being allocated to the
participant's account in the token contract. The contributed ETHs are immediately transferred to the `saleWalletAddress`
wallet, reducing the risk of the loss of ETHs in this bespoke smart contract.

The crowdsale contract will generate `Transfer({contract owner}, {participantAddress}, {tokens})` events during the crowdsale
period and this event is used by token explorers to recognise the token contract and to display the ongoing token sale progress.

The *SnipCoin* token contract is [ERC20 token standard](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md)
compliant with the following features:

* `decimals` is correctly defined as `uint8` instead of `uint256`
* `name` is `SnipCoin`
* `symbol` is `SNIP`
* `transfer(...)` and `transferFrom(...)` will throw if there is an error instead of returning false. A 0 value transfer will
  return true
* `transfer(...)` and `transferFrom(...)` have not been built with a check on the size of the data being passed. This check is
  not an effective check anyway - refer to [Smart
  Contract Short Address Attack Mitigation Failure](https://blog.coinfabrik.com/smart-contract-short-address-attack-mitigation-failure/)
* `approve(...)` does require that a non-zero approval limit be set to 0 before a new non-zero limit can be set. Refer to
  [this](https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729) for further information

This *SnipCoin* token contract does not use *SafeMath* but has the checks to prevent unsigned integer math overflows and underflows.

## Table Of Contents

* [Summary](#summary)
  * [Crowdsale Mainnet Addresses](#crowdsale-mainnet-addresses)
  * [Crowdsale And Token Contract](#crowdsale-and-token-contract)
* [Recommendations](#recommendations)
  * [First Review Recommendations](#first-review-recommendations)
  * [Second Review Recommendations](#second-review-recommendations)
  * [Third Review Recommendations](#third-review-recommendations)
* [Potential Vulnerabilities](#potential-vulnerabilities)
* [Scope](#scope)
* [Limitations](#limitations)
* [Due Diligence](#due-diligence)
* [Risks](#risks)
* [Testing](#testing)
  * [Contribution From Capped And Uncapped Whitelisted Accounts](#contribution-from-capped-and-uncapped-whitelisted-accounts)
  * [Contribution From Uncapped Whitelisted Accounts To Max USD Cap](#contribution-from-uncapped-whitelisted-accounts-to-max-usd-cap)
  * [Contribution From Capped Whitelisted Accounts To Account Cap](#contribution-from-capped-whitelisted-accounts-to-account-cap)
  * [New ERC20 Standard](#new-erc20-standard)
* [Code Review](#code-review)

## Recommendations

### First Review Recommendations

* **LOW IMPORTANCE** Fix the compiler warnings - address not checksummed. Paste the address in the [https://etherscan.io](https://etherscan.io)
  search box and the checksummed address will be displayed. Use this checksummed address, e.g., `0x686f152daD6490DF93B267E319f875A684Bd26e2`.

  For an example, see [test/modifiedContracts/SnipCoin_firstreview_example.sol](test/modifiedContracts/SnipCoin_firstreview_example.sol)

      SnipCoin.sol:107:29: Warning: This looks like an address but has an invalid checksum. If this is not used as an address, please prepend '00'.
              saleWalletAddress = 0x686f152dad6490df93b267e319f875a684bd26e2; // Change before the sale
                                  ^----------------------------------------^

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b)

* **LOW IMPORTANCE** Fix the compiler warnings - unused variables. Replace the empty function body `{}` with a `;` for the
  *Token* interface to declare the functions as un-implemented functions that will be overridden in the derived contract.

  For an example, see [test/modifiedContracts/SnipCoin_firstreview_example.sol](test/modifiedContracts/SnipCoin_firstreview_example.sol)

      SnipCoin.sol:6:46: Warning: Unused local variable
          function totalSupply() constant returns (uint256 supply) {}
                                                   ^------------^
      SnipCoin.sol:10:24: Warning: Unused local variable
          function balanceOf(address _owner) constant returns (uint256 balance) {}
                             ^------------^
      SnipCoin.sol:10:58: Warning: Unused local variable
          function balanceOf(address _owner) constant returns (uint256 balance) {}
                                                               ^-------------^
      SnipCoin.sol:16:23: Warning: Unused local variable
          function transfer(address _to, uint256 _value) returns (bool success) {}
                            ^---------^
      SnipCoin.sol:16:36: Warning: Unused local variable
          function transfer(address _to, uint256 _value) returns (bool success) {}
                                         ^------------^
      SnipCoin.sol:16:61: Warning: Unused local variable
          function transfer(address _to, uint256 _value) returns (bool success) {}
                                                                  ^----------^
      SnipCoin.sol:23:27: Warning: Unused local variable
          function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
                                ^-----------^
      SnipCoin.sol:23:42: Warning: Unused local variable
          function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
                                               ^---------^
      SnipCoin.sol:23:55: Warning: Unused local variable
          function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
                                                            ^------------^
      SnipCoin.sol:23:80: Warning: Unused local variable
          function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
                                                                                ^----------^
      SnipCoin.sol:29:22: Warning: Unused local variable
          function approve(address _spender, uint256 _value) returns (bool success) {}
                           ^--------------^
      SnipCoin.sol:29:40: Warning: Unused local variable
          function approve(address _spender, uint256 _value) returns (bool success) {}
                                             ^------------^
      SnipCoin.sol:29:65: Warning: Unused local variable
          function approve(address _spender, uint256 _value) returns (bool success) {}
                                                                      ^----------^
      SnipCoin.sol:34:24: Warning: Unused local variable
          function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
                             ^------------^
      SnipCoin.sol:34:40: Warning: Unused local variable
          function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
                                             ^--------------^
      SnipCoin.sol:34:76: Warning: Unused local variable
          function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
                                                                                ^---------------^

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b) except for `totalSupply()`

* **HIGH IMPORTANCE** The statement `totalSupply =<PHONE_NUMBER>0;` in `SnipCoin.SnipCoin()` should have the decimals factor
  factored in. The statement should be something like `totalSupply =<PHONE_NUMBER>0 * DECIMALS_MULTIPLIER;`, and the following
  statement should be `balances[msg.sender] = totalSupply;`

  For an example, see [test/modifiedContracts/SnipCoin_firstreview_example.sol](test/modifiedContracts/SnipCoin_firstreview_example.sol)

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b)

* **LOW IMPORTANCE** The [ERC20 token standard](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md)
  defines `decimals` as `uint8`. Update the token contract to use `uint8` instead of `uint`

  For an example, see [test/modifiedContracts/SnipCoin_firstreview_example.sol](test/modifiedContracts/SnipCoin_firstreview_example.sol)

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b)

* **LOW IMPORTANCE** `DECIMALS_MULTIPLIER =<PHONE_NUMBER>000000000;` is a constant, but `decimals` is initialised in the
  `SnipCoin.SnipCoin()` constructor. As both these are directly related, consider using the statement
  `uint8 public constant decimals = 18;`, then `uint public constant DECIMALS_MULTIPLIER = 10**uint(decimals);`. And
  remove `decimals = 18;` in `SnipCoin.SnipCoin()`

  For an example, see [test/modifiedContracts/SnipCoin_firstreview_example.sol](test/modifiedContracts/SnipCoin_firstreview_example.sol)

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b)

* **MEDIUM IMPORTANCE** `tokenName` and `tokenSymbol` should be named `name` and `symbol` respectively, as documented in
  the [ERC20 token standard](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md). Consider defining
  these as constant values in `SnipCoin` like `string public constant symbol = "SNP";` and
  `string public constant name = "SnipCoin";`, removing the assignments in `SnipCoin.SnipCoin()`

  For an example, see [test/modifiedContracts/SnipCoin_firstreview_example.sol](test/modifiedContracts/SnipCoin_firstreview_example.sol)

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b)

* **LOW IMPORTANCE** `SnipCoin.sendCoin(...)` provides the exact same functionality as `StandardToken.transfer(...)`.
  Consider removing `SnipCoin.sendCoin(...)`

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b)

* **LOW IMPORTANCE** `SnipCoin.function()` has the statement `if (!saleWalletAddress.send(msg.value)) revert();` that
  can be written as `saleWalletAddress.transfer(msg.value);` that will throw an exception when there is an error. See the
  [difference between `send(...)` and `transfer(...)`](https://github.com/ConsenSys/smart-contract-best-practices#be-aware-of-the-tradeoffs-between-send-transfer-and-callvalue)

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b)

* **LOW IMPORTANCE** The variable `SnipCoin.ownerAddress` is unused and can be removed

  * [X] Fixed in [022fbf8](https://github.com/SnipToday/SnipCoin/commit/022fbf8f901cba0dcffe8121f97580bfdcc2ba0b)

### Second Review Recommendations

For an example, see [test/modifiedContracts/SnipCoin_secondreview_example.sol](test/modifiedContracts/SnipCoin_secondreview_example.sol)

* **HIGH IMPORTANCE** The statement `transferFrom(...)` in the fallback `function ()` will not execute as expected because the
  `transferFrom(...)` transfer of tokens require an `approve(...)` function call before the tokens can be moved

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **MEDIUM IMPORTANCE** The functions `initializeSaleWalletAddress()`, `initializeEthReceived()` and `initializeUsdReceived()` have
  no access modifiers specified. Anyone can call these functions anytime to reset these variables. Mark these functions as `internal`
  to prevent these functions being executed by anyone

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **MEDIUM IMPORTANCE** The functions `getBalance(...)`, `getWeiToUsdExchangeRate()` should be marked `constant`

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **MEDIUM IMPORTANCE** Consider disabling `transfer(...)` and `transferFrom(...)` while the sale is in progress

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43) and
    [94ffa4d](https://github.com/SnipToday/SnipCoin/commit/94ffa4d4a3750c0cf584ac63a1df464dd4d6c3dc)

* **MEDIUM IMPORTANCE** Prevent the crowdsale being reopened once the tokens are transferable

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Fix the compiler warnings - unused variables. Replace the empty function body `{}` with a `;` for the
  *Token* interface to declare the functions as un-implemented functions that will be overridden in the derived contract.

      SnipCoin.sol:6:46: Warning: Unused local variable
          function totalSupply() constant returns (uint256 supply) {}
                                                   ^------------^

  Note that in the example, `uint public totalSupply` is defined in *Token* because the automatically generated getter function
  does not match the abstract function `function totalSupply() constant returns (uint256 supply);`

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Use `uint` or `uint256` consistently, not both

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Consider moving `require((msg.sender == contractOwner) || (msg.sender == accountWithUpdatePermissions)); // Verify ownership`
  into a modifier like `onlyPermissioned` and using this modifier in function that would otherwise have repeated code

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Consider converting `verifySaleNotOver()` and `verifyBuyerCanMakePurchase()` into modifiers and applying them to
  the fallback `function()`

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** `WEI_IN_ETHER = 1000 * 1000 * 1000 * 1000 * 1000 * 1000` is the same as `1 ether`. Consider using `1 ether`
  to simplify the code

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Consider explicitly using the `public` on functions that are meant to be executed directly via transactions

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Consider moving the statement `balances[_to] += _value;` after subtracting `_value` from the source account and
  the approval in `transferFrom(...)`

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Consider adding the overflow check `balances[_to] + _value > balances[_to]` to `transfer(...)` and
  `transferFrom(...)` and removing the comments that it could be used

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** The event `Transfer({source}, {destination}, {value});` should be logged whenever there is a change in the
  balances mapping structure

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Move `saleWalletAddress.transfer(msg.value);` to the last statement in the fallback `function ()` as
  good practice, even though the `saleWalletAddress` is under the control of the crowdsale project

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Consider using the statement `balances[contractOwner] = totalSupply;` instead of
  `balances[msg.sender] = totalSupply;` in the `SnipCoin.SnipCoin()` constructor as this explicitly states that the tokens
  are all initially assigned to the `contractOwner`

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** The recently standardised [ERC20 standard](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#transfer)
   states that `Note Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event.`. Consider updating
  `transfer(...)` and `transferFrom(...)` to treat 0 transfers as valid transfers

  The recently standardised ERC20 standard also states that
  `The function SHOULD throw if the _from account balance does not have enough tokens to spend.` for the `transfer(...)` function, and
  `The function SHOULD throw unless the _from account has deliberately authorized the sender of the message via some mechanism.` for
  the `transferFrom(...)` function. This `throw` behaviour has not been implemented in the example

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

* **LOW IMPORTANCE** Consider making `contractOwner`, `accountWithUpdatePermissions` and `DECIMALS_MULTIPLIER` public to allow for easier
  validation

  * [x] Fixed in [f9d4c42](https://github.com/SnipToday/SnipCoin/commit/f9d4c4290dfa477e7d07578b10a6cd35e69cfa43)

### Third Review Recommendations

* **LOW IMPORTANCE** `getBalance(...)` is exact duplicate of the ERC20 standard function `balanceOf(...)`

  * [x] Fixed in [07a5991](https://github.com/SnipToday/SnipCoin/commit/07a5991327b7c26e040e319aa67205ff96697a7d)

* **LOW IMPORTANCE** The whitelisted cap amount applies to each transaction and not a participant's total contributions. Consider whether
  the cap amount should be applied to a participant's total contribution or to each individual transaction

  * [x] Fixed in [07a5991](https://github.com/SnipToday/SnipCoin/commit/07a5991327b7c26e040e319aa67205ff96697a7d)

* **LOW IMPORTANCE** `saleWalletAddress.transfer(msg.value);` should be the last statement in `function ()`. This is not very
  important as `saleWalletAddress` is under the control of the crowdsale administrator. But if the destination of this ETH transfer
  is a participants wallet, the program control flow can be hijacked

  * [x] Fixed in [4cda853](https://github.com/SnipToday/SnipCoin/commit/4cda85368a553832b01e16ebfcff43c816ed6b02)

* **LOW IMPORTANCE** Some of the recent tokens have a requirement that a non-0 approval amount must be set to 0 before being able to set it
  to a new non-0 approval amount. See [GimliToken.sol](https://github.com/bokkypoobah/GimliTokenContractAudit/blob/master/sol/GimliToken.sol#L79-L83)
  for an example, including the linked comment

  * [x] Fixed in [bf168d8](https://github.com/SnipToday/SnipCoin/commit/bf168d8e22fa6b73792513e6ce4e611a2f8209eb)

* **LOW IMPORTANCE** The `transfer(...)` and `transferFrom(...)` return a false if the transfer fails. Some of the newer tokens throw
  an error instead of returning false - search for "throw" in the [ERC20 standard](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md)

  * [x] Fixed in [bf168d8](https://github.com/SnipToday/SnipCoin/commit/bf168d8e22fa6b73792513e6ce4e611a2f8209eb)

* **LOW IMPORTANCE** Fix compiler warning from using `throw` in `transfer(...)` and `transferFrom(...)` instead of `revert()`

  * [x] `throw` statement left as is

## Potential Vulnerabilities

No potential vulnerabilities have been identified in the crowdsale and token contract.

## Scope

This audit is into the technical aspects of the crowdsale contracts. The primary aim of this audit is to ensure that funds
contributed to these contracts are not easily attacked or stolen by third parties. The secondary aim of this audit is that
ensure the coded algorithms work as expected. This audit does not guarantee that that the code is bugfree, but intends to
highlight any areas of weaknesses.

## Limitations

This audit makes no statements or warranties about the viability of the Snip's business proposition, the individuals
involved in this business or the regulatory regime for the business model.

## Due Diligence

As always, potential participants in any crowdsale are encouraged to perform their due diligence on the business proposition
before funding any crowdsales.

Potential participants are also encouraged to only send their funds to the official crowdsale Ethereum address, published on
the crowdsale beneficiary's official communication channel.

Scammers have been publishing phishing address in the forums, twitter and other communication channels, and some go as far as
duplicating crowdsale websites. Potential participants should NOT just click on any links received through these messages.
Scammers have also hacked the crowdsale website to replace the crowdsale contract address with their scam address.

Potential participants should also confirm that the verified source code on EtherScan.io for the published crowdsale address
matches the audited source code, and that the deployment parameters are correctly set, including the constant parameters.

## Risks

* The risk of funds getting stolen or hacked from the *Snip* contract is low as the contributed funds are immediately
  transferred to an external multisig, hardware or regular wallet.

## Testing

### Contribution From Capped And Uncapped Whitelisted Accounts

The following functions were tested using the script [test/01_test1.sh](test/01_test1.sh) with the summary results saved
in [test/test1results.txt](test/test1results.txt) and the detailed output saved in [test/test1output.txt](test/test1output.txt):

* [x] Deploy Crowdsale/Token contract
* [x] Add accounts to capped and uncapped whitelists
* [x] Contribute before crowdsale start - rejected
* [x] Open crowdsale
* [x] Small contribution after crowdsale start
* [x] Large contribution after crowdsale start, past cap. Capped whitelisted contribution rejected. Uncapped whitelisted accepted
* [x] Moderate contribution after crowdsale start, below cap. Both capped and uncapped contribution accepted
* [x] Close crowdsale
* [x] Enable transfers
* [x] `transfer(...)` and `transferFrom(...)` the *SNIP* tokens

### Contribution From Uncapped Whitelisted Accounts To Max USD Cap

The following functions were tested using the script [test/02_test2.sh](test/02_test2.sh) with the summary results saved
in [test/test2results.txt](test/test2results.txt) and the detailed output saved in [test/test2output.txt](test/test2output.txt):

* [x] Deploy Crowdsale/Token contract
* [x] Add accounts to capped and uncapped whitelists
* [x] Open crowdsale
* [x] Contribute from uncapped account to just below the 8m USD cap
* [x] Contribute from uncapped account to just above the 8m USD cap - contribution rejected
* [x] Contribute from uncapped account to the 8m USD cap
* [x] Close crowdsale
* [x] Enable transfers
* [x] `transfer(...)` the *SNIP* tokens

### Contribution From Capped Whitelisted Accounts To Account Cap

The following functions were tested using the script [test/03_test3.sh](test/03_test3.sh) with the summary results saved
in [test/test3results.txt](test/test3results.txt) and the detailed output saved in [test/test3output.txt](test/test3output.txt):

* [x] Deploy Crowdsale/Token contract
* [x] Add accounts to capped and uncapped whitelists
* [x] Open crowdsale
* [x] Contribute from capped account to just below the capped amount
* [x] Contribute from uncapped account to just above the capped amount - contribution rejected
* [x] Contribute from uncapped account to the capped amount

### New ERC20 Standard

The following functions were tested using the script [test/04_test4.sh](test/04_test4.sh) with the summary results saved
in [test/test4results.txt](test/test4results.txt) and the detailed output saved in [test/test4output.txt](test/test4output.txt):

* [x] Deploy Crowdsale/Token contract
* [x] Add accounts to capped and uncapped whitelists
* [x] Open crowdsale
* [x] Contribute from capped and uncapped accounts
* [x] Transfer 0 tokens - NOT thrown
* [x] Transfer more tokens than accounts own - thrown
* [x] Change approval without setting to 0 - thrown
* [x] Change approval by setting to 0 first - NOT thrown

Details of the testing environment can be found in [test](test).

## Code Review

* [x] [code-review/SnipCoin.md](code-review/SnipCoin.md)
  * [x] contract Token
  * [x] contract StandardToken is Token
  * [x] contract SnipCoin is StandardToken

(c) BokkyPooBah / Bok Consulting Pty Ltd for Snip - Oct 5 2017. The MIT Licence.

repository: bokkypoobah/SnipCoinTokenContractAudit

repo_name: bokkypoobah/SnipCoinTokenContractAudit


text:
# Email

A linux servers own email solution can be used to recieve alerts about LinuxGSM.

## Sending emails

LinuxGSM will send an email using the `mail` command.

Postfix or equivalent must be setup and correctly configured before sending emails. Failure to correctly configure Postfix and a domain for your server will mean that the email alert may be flagged as spam or not arrive at all. Configuring postfix is not covered here, but there are many tutorials online to help.

{% hint style="success" %}
[Mailgun](mailgun.md) can be used as an email relay to reduce the changes of email alerts being block as spam.
{% endhint %}

## Enable Email alerts

To enable email alerts you will need to add an email address to the [LinuxGSM config](../configuration/linuxgsm-config.md).

```bash
# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
emailalert="off"
<EMAIL_ADDRESS>emailfrom=""
```

license: MIT

repository: phoenixseo/LinuxGSM-Docs

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: phoenixseo/LinuxGSM-Docs


text:
---
id: "statefulassertion"
title: "StatefulAssertion"
sidebar_label: "StatefulAssertion"
---

## Hierarchy

* [Assertion](assertion.md)

* Assertion

  ↳ **StatefulAssertion**

## Index

### Constructors

* [constructor](statefulassertion.md#constructor)

### Properties

* [api](statefulassertion.md#api)
* [asserter](statefulassertion.md#asserter)

### Methods

* [ensureIsInOneOfStates](statefulassertion.md#ensureisinoneofstates)
* [ensureIsInState](statefulassertion.md#ensureisinstate)
* [ensureIsNotInOneOfStates](statefulassertion.md#ensureisnotinoneofstates)
* [ensureIsNotInState](statefulassertion.md#ensureisnotinstate)
* [getApi](statefulassertion.md#getapi)

## Constructors

###  constructor

\+ **new StatefulAssertion**(`asserter`: [Asserter](../interfaces/types.asserter.md)): *[StatefulAssertion](statefulassertion.md)*

*Inherited from [Assertion](assertion.md).[constructor](assertion.md#constructor)*

*Overrides void*

**Parameters:**

Name | Type |
------ | ------ |
`asserter` | [Asserter](../interfaces/types.asserter.md) |

**Returns:** *[StatefulAssertion](statefulassertion.md)*

## Properties

###  api

• **api**: *Map‹string, Function›* = new Map([
    ['ensure.is.inState', this.ensureIsInState as Function],
    ['ensure.is.not.inState', this.ensureIsNotInState as Function],
    ['ensure.is.inOneOfStates', this.ensureIsInOneOfStates as Function],
    ['ensure.is.not.inOneOfStates', this.ensureIsNotInOneOfStates as Function],
  ])

*Overrides [Assertion](assertion.md).[api](assertion.md#api)*

___

###  asserter

• **asserter**: *[Asserter](../interfaces/types.asserter.md)*

*Inherited from [Assertion](assertion.md).[asserter](assertion.md#asserter)*

*Overrides void*

## Methods

###  ensureIsInOneOfStates

▸ **ensureIsInOneOfStates**(`expectedStates`: [State](../modules/types.md#state)[], `error?`: [DomainError](domainerror.md)): *[Asserter](../interfaces/types.asserter.md)*

Ensures that `Entity` is one of expected states.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expectedStates` | [State](../modules/types.md#state)[] | Expected list of states in one of which `Entity` should be. |
`error?` | [DomainError](domainerror.md) | Optional instance of `DomainError` that will be thrown upon failed assertion. |

**Returns:** *[Asserter](../interfaces/types.asserter.md)*

`Asserter` implementation instance.

___

###  ensureIsInState

▸ **ensureIsInState**(`expectedState`: [State](../modules/types.md#state), `error?`: [DomainError](domainerror.md)): *[Asserter](../interfaces/types.asserter.md)*

Ensures that `Entity` is expected state.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expectedState` | [State](../modules/types.md#state) | Expected state that `Entity` should be in. |
`error?` | [DomainError](domainerror.md) | Optional instance of `DomainError` that will be thrown upon failed assertion. |

**Returns:** *[Asserter](../interfaces/types.asserter.md)*

`Asserter` implementation instance.

___

###  ensureIsNotInOneOfStates

▸ **ensureIsNotInOneOfStates**(`expectedStates`: [State](../modules/types.md#state)[], `error?`: [DomainError](domainerror.md)): *[Asserter](../interfaces/types.asserter.md)*

Ensures that `Entity` is NOT in one of expected states.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expectedStates` | [State](../modules/types.md#state)[] | Expected list of states in one of which `Entity` shouldn't be. |
`error?` | [DomainError](domainerror.md) | Optional instance of `DomainError` that will be thrown upon failed assertion. |

**Returns:** *[Asserter](../interfaces/types.asserter.md)*

`Asserter` implementation instance.

___

###  ensureIsNotInState

▸ **ensureIsNotInState**(`expectedState`: [State](../modules/types.md#state), `error?`: [DomainError](domainerror.md)): *[Asserter](../interfaces/types.asserter.md)*

Ensures that `Entity` is NOT in expected state.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expectedState` | [State](../modules/types.md#state) | Expected state that `Entity` shouldn't be in. |
`error?` | [DomainError](domainerror.md) | Optional instance of `DomainError` that will be thrown upon failed assertion. |

**Returns:** *[Asserter](../interfaces/types.asserter.md)*

`Asserter` implementation instance.

___

###  getApi

▸ **getApi**(): *Map‹string, Function›*

*Inherited from [Assertion](assertion.md).[getApi](assertion.md#getapi)*

*Overrides void*

**Returns:** *Map‹string, Function›*

repository: Eveble/eveble

gha_language: TypeScript

gha_license_id: NOASSERTION

repo_name: Eveble/eveble


text:
# Brazil's Bolsonaro says 'worst is yet to come' on oil spill

Published at: **2019-11-04T02:59:34+00:00**

Author: **AFP**

Original: [Yahoo](https://news.yahoo.com/brazils-bolsonaro-says-worst-yet-come-oil-spill-022555806.html)

Sao Paulo (AFP) - Brazilian President Jair Bolsonaro said Sunday that "the worst is yet to come" with an oil spill that has affected more than 200 beaches on the country's coast.
"What came so far and what was collected is a small amount of what was spilled," Bolsonaro said in an interview with Record television.
He said he did not know if additional oil would impact his country's coastline, but that "everything indicates that the currents went to the coast of Brazil."
Oil slicks have been appearing for three months off the coast of northeast Brazil and fouling beaches along a 2,000 kilometer (1,250 mile) area of Brazil's most celebrated shoreline.
Crews and volunteers have cleaned up tons of oil on the beaches.
Officials say it not yet possible to quantify the environmental and economic damage from the oil slicks.
The government on Friday named a Greek-flagged tanker as the prime suspect behind the oil slicks.
The ship Bouboulina took on oil in Venezuela and was headed for Singapore, it said.
The space agency Inpe said Friday there might still be oil at sea being pushed by currents and it could reach the states of Espiritu Santo and Rio de Janeiro in southeast Brazil.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# py-snake-game
Building snake and apple game in `pygame and python`

Snake and apple is a simple game where when snake eats an apple it gets longer and your score increases. If you snake hits any part of its body it will die.

**Final source code is in 8_final_code_background_music.py**

![](game_preview.gif)

### Exercise

1. Add a logic to end the game if snake hits any of the wall boundaries of main screen.
Here you need to check the position of your head and see if it goes beyond window boundaries (1000,800).
If it does, game should end in same way as we end it when snake collides with itself.

2. Try increasing speed of snake to make game little more challenging.  Reduce the sleep time to may be 0.1 sec to achieve this.

[Solution](https://github.com/codebasics/python_projects/blob/main/1_snake_game/exercise_solution.py)

### Tool to convert python file to .exe

I used below tool to convert python file to .exe file

https://pypi.org/project/auto-py-to-exe/

repository: cseshahriar/pysnake

branch_name: refs/heads/main

repo_name: cseshahriar/pysnake


text:
---
title: Using GCP Marketplace Ingress Controller
description: "This document will walk you through the steps needed to deploy the NGINX Ingress Controller through the GCP Marketplace."
weight: 2400
doctypes: [""]
toc: true
docs: "DOCS-000"
---

This document will walk you through the steps needed to deploy and configure the NGINX Ingress Controller through the GCP Marketplace.

## Product overview

The F5 NGINX Ingress Controller is an implementation of a Kubernetes Ingress Controller for NGINX and NGINX Plus.

Basic features include:

- Host-based routing. For example, routing requests with the host header foo.example.com to one group of services and the host header bar.example.com to another group.
- Path-based routing. For example, routing requests with the URI that starts with /serviceA to service A and requests with the URI that starts with /serviceB to service B.
- TLS/SSL termination for each hostname, such as foo.example.com.

## One-time setup

To quickly get the NGINX Ingress Controller up and running, follow our [Installation with Manifests](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/) guide.
This details how to locally build an image of the NGINX Ingress Controller as well as the necessary CustomResourceDefinitions (CRDs) required.

## Installation

### Install NGINX Ingress Controller to an existing GKE cluster

1. Deploy NGINX Ingress Controller from GUI

   Open [Google Cloud Console](https://console.cloud.google.com/) and navigate to **Kubernetes Engine > Applications**

2. Click on **DEPLOY FROM MARKETPLACE**, and search for *NGINX Ingress Controller*

   <!-- TODO Add an image of KIC options in marketplace once listing are approved -->
   > **NOTE**: Please verify that you select a *Premium Edition* controller image that has been published by *NGINX, Inc.*, and not a third-party.

   Choose the appropriate *NGINX Ingress Controller* image, and click **CONFIGURE**

3. Install to an existing cluster

   > **NOTE**: Click on **OR SELECT AN EXISTING CLUSTER** if you see the **CREATE NEW CLUSTER** button.

   {{< img title="Install to existing GKE cluster" src="./img/gke-existing-cluster.png" >}}

   Choose an **Existing Kubernetes Cluster** to target from the options provided.

   The *default* namespace will be selected automatically, but you can choose to **Create a namespace** and enter the **New namespace name**.

   The **App instance name** will be used as a prefix for all resources created by the deployment, and must be unique within the selected namespace. A default value will be generated and can be used as-is, or changed.

   Recommended options for NGINX Ingress Controller will be pre-selected, but can be adjusted as necessary.

   Click **DEPLOY** to launch NGINX Ingress Controller installation process.

   {{< img title="Install to existing GKE cluster" src="./img/gke-ingress-controller-application.png" >}}

   You can find the NGINX Ingress Controller *application* by navigating back to **Kubernetes Engine > Applications**

### Install NGINX Ingress Controller to a new GKE cluster

As an alternative to using an existing GKE cluster, GCP Marketplace can create a small zonal cluster for you during the installation process. Please note that you will need to resize the cluster to provide enough vCPU for NGINX Ingress Controller and your other applications.

1. Find NGINX Ingress Controller on the marketplace

   Open [Google Cloud Console](https://console.cloud.google.com/) and navigate to **Marketplace**, then search for *NGINX Ingress Controller*

   <!-- TODO Add an image of KIC options in marketplace once listing are approved -->
   > **NOTE**: Please verify that you select a *Premium Edition* controller image that has been published by *NGINX, Inc.*, and not a third-party.

   Choose the appropriate *NGINX Ingress Controller* image, and click **CONFIGURE**

2. Configure the new GKE cluster

   Choose the **zone**, **network**, and **subnetwork** that is appropriate for your new cluster from the options provided.

   {{< img title="Create a new GKE cluster" src="./img/gke-create-cluster.png" >}}

   Click **CREATE NEW CLUSTER**.

   {{< img title="New cluster creation in progress" src="./img/gke-creating-cluster.png" >}}

   After a short delay the cluster will be ready for step 3.

3. Complete the NGINX Ingress Controller deployment options

   {{< img title="Complete new GKE cluster installation" src="./img/gke-install-to-new-cluster.png" >}}

   The *default* namespace will be selected automatically, but you can choose to **Create a namespace** and enter the **New namespace name**.

   The **App instance name** will be used as a prefix for all resources created by the deployment, and must be unique within the selected namespace. A default value will be generated and can be used as-is, or changed.

   Recommended options for NGINX Ingress Controller will be pre-selected, but can be adjusted as necessary.

   Click **DEPLOY** to launch NGINX Ingress Controller installation process.

   {{< img title="Install to existing GKE cluster" src="./img/gke-ingress-controller-application.png" >}}

   You can find the NGINX Ingress Controller *application* by navigating back to **Kubernetes Engine > Applications**

## Configuration

The GCP Marketplace will deploy the NGINX Ingress Controller with a default configuration and an empty *ConfigMap*. These resources will all be named `<app-instance-name>-nginx-ingress`, where `<app-instance-name>` matches the value you provided during the [installation](#installation) step.

For example, if NGINX Ingress Controller was deployed to namespace `nginx-ingress` and with an **App instance name** of `nginx-ingress-plus` (as used in the examples above), the ConfigMap can be viewed with `kubectl`:

```
$ kubectl get configmap -n nginx-ingress nginx-ingress-plus-nginx-ingress -o yaml
apiVersion: v1
kind: ConfigMap
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","data":null,"kind":"ConfigMap","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"nginx-ingress-plus","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"nginx-ingress-plus-nginx-ingress","helm.sh/chart":"nginx-ingress-0.16.2"},"name":"nginx-ingress-plus-nginx-ingress","namespace":"nginx-ingress","ownerReferences":[{"apiVersion":"app.k8s.io/v1beta1","blockOwnerDeletion":true,"kind":"Application","name":"nginx-ingress-plus","uid":"5cbbebd8-df13-4001-bd65-9467405d9a9d"}]}}
  creationTimestamp: "2022-08-25T01:03:10Z"
  labels:
    app.kubernetes.io/instance: nginx-ingress-plus
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: nginx-ingress-plus-nginx-ingress
    helm.sh/chart: nginx-ingress-0.16.2
  name: nginx-ingress-plus-nginx-ingress
  namespace: nginx-ingress
  ownerReferences:
  - apiVersion: app.k8s.io/v1beta1
    blockOwnerDeletion: true
    kind: Application
    name: nginx-ingress-plus
    uid: 5cbbebd8-df13-4001-bd65-9467405d9a9d
  resourceVersion: "147519"
  uid: 3fa33891-7a30-4004-91bd-bd5d652e34a9
```

See the [Configuration](https://docs.nginx.com/nginx-ingress-controller/configuration/) documentation to modify the resources.

## Basic Usage

To setup a basic application that uses the NGINX Ingress Controller, see our [basic configuration](https://github.com/nginxinc/kubernetes-ingress/tree/main/examples/custom-resources/basic-configuration) example page.

repository: nginxinc/kubernetes-ingress

gha_language: Go

repo_name: nginxinc/kubernetes-ingress


text:
# Introduction to jODBC

<PageHeader />

## Introduction

This user guide provides detailed instructions for the configuration and deployment of the jBASE **jDBC 2.0 Driver**.

The **jBASE jDBC 2.0 Driver** is a jBASE component implementing the JDBC API. The JDBC API is part of the JavaTM 2 Platform Standard Edition 5.0 (J2SETM).

The following diagrams show two of the most common deployment scenarios. In both cases, the JDBC API implemented by the jBASE JDBC 2.0 Driver provides client applications with the ability to perform SQL queries against a jBASE server.

**Two-tier model**:

This model represents deployment scenarios where a Java Client Application has the responsibility to create and manage connection, transaction and security resource.

**![251032-introduction-to-jodbc: jdbc](./jdbc.png)**

**Three-tier model:**

A three-tier deployment scenario would often involve an application server hosting different application components as e.g EJBs, servlets, etc. Deploying the jBASE JDBC Driver on a J2EE application server does not only allow those applications to perform SQL queries against jBASE, but also allows the application server to manage its connections, transactions and security aspects.

![251032-introduction-to-jodbc: jdbc2](./jdbc2.png)

## Assumptions

This document describes many concepts and methodologies that are highly technical in nature, and as such prerequisite knowledge of the following is considered essential:

- Java Standard Edition
- Java Enterprise Edition
- SQL
- jBASE
- Secure Sockets Layer (SSL) protocol

## Deploying the jDBC driver

The jBASE JDBC Driver is packaged as a Java Archive (jar) file.

To use the JDBC Driver from a **non-managed** client application, it necessary to place this archive inside your CLASSPATH.

To deploy this archive on a **managed**environment it is necessary to configure a deployment descriptor specific to the application server.

## JBoss deployment

The following deployment descriptor is used by JBoss to load the jBASE JDBC Driver, as specified by “driver-class”. This file should be modified according to deployment requirements.

**[jbasejdbc-ds.xml](jbasejdbc-ds.xml)**

``` xml
<?xml version="1.0" encoding="UTF-8"?>
<!--========================================================================== -->
<!--                                                                           -->
<!--  JBoss deployment descriptor for jBASE JDBC Data Sources                  -->
<!--                                                                           -->
<!-- ========================================================================= -->
<datasources>
    <!—jBASE JDBC Data Source -->
    <local-tx-datasource>
        <jndi-name>jdbc/jBaseJdbcDS</jndi-name>
        <connection-url>
            jdbc:jbase:thin:@<IP_ADDRESS>:20002/mytestaccount
        </connection-url>
        <driver-class>
            com.jbase.jdbc.driver.JBaseJDBCDriver
        </driver-class>
        <user-name>test</user-name>
        <password>test</password>
    </local-tx-datasource>
</datasources>
```

After configuring the deployment descriptor, follow the steps below to deploy the jBASE JDBC driver:

- Copy the jBASE JDBC Driver (jbasejdbc.jar) archive to the *lib* directory of the JBoss *default* configuration.
- Copy the JBoss deployment descriptor to the *deploy* directory of the JBoss *default* configuration.

## Developers Guide

The following section provides a detailed guide on how to connect and access the jBASE server.

## jAgent

jBASE jAgent is a server-side jBASE component which must be listening on a user-defined TCP port on the remote jBASE instance. It accepts socket connections to process incoming requests from the JDBC Driver. Please refer to the jBASE jAgent user guide for more information on how to configure and start jAgent.

## Connecting to jBASE

JDBC provides two mechanisms to establish a connection to a data source:

- *DriverManager*:  This class requires an application to load the specific JDBC driver which in our case would be the jBASE JDBC Driver. This interface is typically used on a **non-managed** two-tier deployment scenario where a java naming service is not available.
- *DataSource*:       This interface is preferred on **managed** scenarios because JNDI is typically used to lookup a data source. The advantages of having a data source managed by the application are e.g. connection pooling, security and distributed transaction processing for XA-compliant JDBC drivers as is the jBASE JDBC driver.

*DataSource* and *DriverManager* provide the following methods to create a new connection.

For more information on these methods, please read the JDBC API documentation.

- *getConnection(String url)*
  - Obtain a new connection for the specified connection string. Connection properties must be specified inside the connection string.
- *getConnection(String url, String user, String password)*
  - Obtain a new connection for the specified connection string. Connection properties, except user and password must be specified inside the connection string.

*DriverManager* provides an additional method:

- *getConnection(String url, **Properties info**)*
  - Obtain a new connection for the specified connection string. The second parameter specifies the connection properties.

### Authentication

jAgent will attempt to authenticate a user given the user credentials provided to the *getConnection()* method.

The jBASE JDBC Driver implements the following connection properties to provide user credentials:

- **user**           Specifies the user to be authenticated
- **password**       Specifies the user’s password

### Encryption

jAgent can be configured to use SSL encrypted connections for deployment scenarios which require enhanced security.

The jBASE JDBC Driver implements the following connection properties:

- **SSL** [Default value:  **false**]
  - Specifies whether the connection should use SSL encryption. SSL should only be used if the jAgent instance running on the jBASE server has also been configured to accept SSL connections.
- **enableNaiveTrustManager**[Default value:  **false**]
  - This property forces the JDBC Driver to trust all server certificates.

### Example using the *DataSource* interface

``` java
Connection cx = null;
try {
    InitialContext ic = new InitialContext();
    Object cxfObj = ic.lookup("java:comp/env/jdbc/jBaseDB");
    DataSource cxf = (DataSource) cxfObj;
    cx = (Connection) cxf.getConnection();
} catch(NamingException e) {
    // error
}
```

### Example 1 using the *DriverManager* interface

``` java
//Load jBASE JDBC Driver
Class.forName("com.jbase.jdbc.driver.JBaseJDBCDriver");
//Set connection properties and request a new connection
String url = "jdbc:jbase:thin:@<IP_ADDRESS>:20002";
Properties cxProps = new Properties();
cxProps.setProperty("user", "test");
cxProps.setProperty("password", "newpassword");
cxProps.setProperty("SSL", "true");                  //Enable SSL
cxProps.setProperty("NaiveTrustManager", "true");
Connection cx = DriverManager.getConnection(url, cxProps);
```

### Example 2 using the *DriverManager* interface

``` java
//Load jBASE JDBC Driver
Class.forName("com.jbase.jdbc.driver.JBaseJDBCDriver");
//Set connection properties and request a new connection
String url = "jdbc:jbase:thin:@<IP_ADDRESS>:20002/MyTestAccount?user=test&password=newpassword&SSL=true&NaiveTrustManager=true";
Connection cx = DriverManager.getConnection(url);
```

## Closing a connection

After finishing with the connection, it must be closed:

``` java
cx.close();
```

## jDBC API reference

The jBASE jDBC 2.0 Driver implements a subset of the jDBC 2.0 API.

Please read the jDBC specification documentation or refer to the JDBC API javadoc documentation for further information.

The following example shows how a client application executing an SQL SELECT query and display the obtained result set:

``` java
Statement stat = null;
try {
    //Create an SQL statement and perform a SQL SELECT query
    stat = cx.createStatement();
    ResultSet rs = stat.executeQuery("SELECT NAME FROM MYTABLE");
    //Obtain the meta data associated to the result set to print the no. of columns
    ResultSetMetaData rsMetaData = rs.getMetaData();
    System.out.println("Number of columns: " + rsMetaData.getColumnCount());
    //Fetch all rows and display the first column
    while(rs.next()) {
        System.out.println("NAME: " + rs.getString("NAME"));
    }
} catch(SQLException e) {
    throw e;
} finally {
    closeDB(stat);
}
```

<PageFooter />

repository: josepheshaw/docs

gha_license_id: MIT

repo_name: josepheshaw/docs


text:
# ywanglab.github.io
====================

Technologies this website uses:

    Jekyll
    Github Pages
    Twitter Bootstrap 4.4.1

    background color: #1b2530;
Before pushing changes, please check that they will work on your system first with the plugins included in the Gemfile using the bundler tool (results served at [<IP_ADDRESS>:4000](<IP_ADDRESS>:4000)):

    sudo gem install bundler
    bundle install
    bundle exec jekyll serve --port 1234

    And go to http://localhost:1234/

    Header & Footer for all pages: ./_includes/header.html ./_includes/footer.html
    Configurations: ./_config.yml
    Navigation Links: ./_data/navlinks.yml
    Home: ./index.md; sidebar included from ./_includes/sidebar.md
    Research: ./research/index.md
    Publications: ./publications/index.md
    Members: ./members/index.html, script automatically loops through posts in ./_members with a _template.md
    News: ./news/index.html; the script automatically loops through posts in ./_posts
    Join: ./join/index.md
    Contact: ./contact/index.md
    Twitter side bars in Members and News page: ./_includes/twitter_sidebar.html
    All images: ./docs/assets/

    Custom styles: ./static/css/custom.css

### Statement

This website was created using the template kindly open-sourced by Fraser Lab (https://github.com/fraser-lab/fraser-lab.github.io). Please refer to the Fraser lab for information on license. A copy of the license file is also included in this folder.


text:
---
type: rule
title: Do you know how to modernize your .NET applications?
guid: 1037b509-c22b-4244-84ac-0f5c709a090b
uri: dotnet-upgrade-assistant
created: 2022-11-11T00:00:00.0000000Z
authors:
- title: Tylah Kapa
  url: https://www.ssw.com.au/people/tylah-kapa

- dotnet-upgrade-for-complex-projects

---

With outdated NuGet packages, C# stylings and architectures, keeping our .NET Framework applications up to date can be a pain. Especially when we want to make the leap from .NET Framework to .NET for that juicy performance and compatibility bump.

Luckily Microsoft provides excellent tooling for supporting your great leap into .NET. The best part? It's free and Open Source!

The [.NET Upgrade Assistant](https://dotnet.microsoft.com/en-us/platform/upgrade-assistant) is a .NET global tool that helps you incrementally upgrade your .NET Framework-based Windows applications. It's available on [GitHub](https://github.com/dotnet/upgrade-assistant) as a public repository.

<!--endintro-->
# ✅ Benefits

+ Stay agile - Receive immediate feedback on your migration progress
+ Guided steps - Get the recommended steps for upgrading your application and action them as you see fit
+ Multiple project types and languages - Receive support for project types including:
   - ASP.NET MVC
   - Windows Forms
   - Windows Presentation Foundation
   - Console
   - Libraries
   - UWP to Windows App SDK (WinUI)
   - Xamarin.Forms to .NET MAUI
+ Extensible - Customize the .NET Upgrade Assistant as you see fit
+ Open Source - Contribute features and bugfixes to help others achieve the same goal
+ Upgrading to modern .NET - Provides more opportunity for the future of your application

# ❌ Downsides

+ Generic - the .NET Upgrade Assistant tries its best to be generic, and therefore may not be able to identify and work with your proprietary NuGet packages. Those dependencies will need to be upgraded separately, or an alternative needs to be found.
+ Time consuming - While the .NET Upgrade Assistant does well to reduce the time and cost of upgrading your .NET applications, it will still take a significant amount of time, especially on live projects.

gha_language: TSQL


text:
# The Necessity of Geometrical Representation for Deep Graph Analysis

```
@inproceedings{gnnesr_icdm20,
  author    = {Mostafa Rahmani and Ping Li},
  title     = {The Necessity of Geometrical Representation for Deep Graph Analysis},
  booktitle = {20th {IEEE} International Conference on Data Mining (ICDM)},
  pages     = {1232--1237},
  year      = {2020}
}
```

links
- [ieee](https://ieeexplore.ieee.org/document/9338360)
- [researchgate](https://www.researchgate.net/publication/344232388_The_Necessity_of_Geometrical_Representation_for_Deep_Graph_Analysis)

gha_language: Jupyter Notebook


text:
## disaster events

Returns all events occurring in the world at this point in time.

### Synopsis

Return all defined events in the world

```
disaster events [flags]
```

### Options

```
  -d, --display-map   Displays the Google Maps URL
  -h, --help          help for events
```

### Options inherited from parent commands

```
  -a, --api-key string   Override default apikey from nasa.gov
  -c, --documentation    Generate documentation
  -o, --output string    Output format options: table | text | json (default "text")
```

### SEE ALSO

* [disaster](disaster.md)	 - A CLI too for determining natural catastrophe near you, or a location specified

###### Auto generated by spf13/cobra on 23-Apr-2020

repository: developerfred/disaster-cli

repo_name: developerfred/disaster-cli


text:
---
layout: post
title: How to generate beautiful PowerShell documentation
date: 2015-04-27 12:15:35
categories: [powershell]
tags: [documentation, powershell, devops]
---

I'm currently maintaining a suite of powershell modules called [poshBAR](https://github.com/FutureStateMobile/poshBAR), and there's a lot of activity going on in the library right now. The last thing I want to do is write all of the documentation for this library, and then try to remember to edit it when the API changes.

So with this, I began searching around to see if anyone has already created a documentation generator... and yes, there are a few out there. The trouble I had was two fold

 1. It needed to be beautiful to look at.
 2. It needed to be simple to invoke, with sensible command parameters.

With those two in mind, there was one script that I found that did a pretty good job overall. The [example I found](http://poshcode.org/587) was located over at poshcode. It's pretty rough around the edges, but gave me a little kickstart to get what I needed.

With a little help from [Matt](https://stackoverflow.com/users/3829407/matt) on a [StackOverflow Question](http://stackoverflow.com/q/29780709/124069) that I had, I went on to heavily refactor pretty much all of the original example. I split it into two files, a template, and the runner, and I brought in a little Bootstrappyness for beautification. Essentially, all you need to do is import your module, and kick off the script.

```
Import-Module MySpecialModule
.\psDoc.ps1 -moduleName MySpecialModule
```

If you'd like to look at (or improve) the repository, it can be found on [github under psDoc](https://github.com/chaseflorell/psdoc).

*If you've got bootstrap chops, I'd be happy to get a little help, it's one area I'm not great it, and I know it could use a little improvement.*

-----

**Screenshots**
![](https://i.imgur.com/vVIHpP8.png)
![](https://i.imgur.com/H99LOoy.png)
![](https://i.imgur.com/ZJO7Qhj.png)

**EDIT [09.14.2015]:**
Edited to remove the old gist and instead point to the psDoc repository.


text:
# [Grasshopper - Check for factor](https://www.codewars.com/kata/grasshopper-check-for-factor "https://www.codewars.com/kata/55cbc3586671f6aa070000fb")

This function should test if the `factor` is a factor of `base`.

Return `true` if it is a factor or `false` if it is not.

## Information
Factors are numbers you can multiply together to get another number.

2 and 3 are factors of 6 because:
```
2 * 3 = 6
```

- You can find a factor by dividing numbers. If the remainder is 0 then the number is a factor.
- In Javascript and C# you can use `%` to check for a remainder

For example 2 is not a factor of 7 because:
```
7 % 2 = 1
```

repository: ParanoidUser/codewars-handbook

gha_language: Java

repo_name: ParanoidUser/codewars-handbook


text:
ClueBot NG - IRC Relay
======================

The IRC relay process accepts UDP messages and relays them to an IRC channel.

It is designed to be a single Python 3.5 compatible script requiring no external dependencies.


text:
# Awesome English [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)

A collection of awesome study resources for learners of English.
Please read the [contributing guidelines](contributing.md) if you wish to contribute.

## Contents <!-- omit in toc -->

- [Listening](#listening)
  - [Podcasts](#podcasts)
  - [Tech Podcasts](#tech-podcasts)
  - [Interview Podcasts](#interview-podcasts)
  - [Live Radio Stations](#live-radio-stations)
  - [Sites](#sites)
- [Watching](#watching)
  - [YouTube](#youtube)
  - [Live TV Channels](#live-tv-channels)
  - [TV Talk Shows](#tv-talk-shows)
  - [Tech Shows](#tech-shows)
- [Grammar](#grammar)
- [Learn more words](#learn-more-words)
  - [Word lists](#word-lists)
  - [Flashcards](#flashcards)
  - [Online Dictionaries](#online-dictionaries)
- [Speaking](#speaking)
  - [Language Exchange Sites](#language-exchange-sites)
  - [Speaking Lessons](#speaking-lessons)
  - [Pronunciation](#pronunciation)
- [Online Classes](#online-classes)
  - [Private Classes](#private-classes)
  - [Group Classes](#group-classes)
- [Reading](#reading)
- [Exercises and Tests](#exercises-and-tests)
- [Tools](#tools)
- [Answers](#answers)
- [License](#license)

## Listening

### Podcasts

Listen podcasts anytime and anywhere to improve your listening skill. Podcasts often have transcripts and them allow you to listen and read at the same time.

- [All Ears English](http://allearsenglish.com/) - Learn advanced conversational american english.
- [ESL Podcasts](https://www.eslpod.com/) - Anyone who wants to improve their english speaking and listening skills.
- [Culips Podcast](http://esl.culips.com/) - Learn conversational english for everyday use by native english speakers.
- [Luke’s English Podcast](http://teacherluke.co.uk/) - Luke is qualified english language teacher and stand-up comedian who provides engaging and entertaining podcast series.
- [A Way with Words](http://www.waywordradio.org/category/episodes/) - Public radio program about language examined through history, culture, and family.
- [This American Life](http://www.thisamericanlife.org/radio-archives) - One of the most popular podcast. Most of the stories are journalism, with an occasional comedy routine or essay.
- [6 Minute English](http://www.bbc.co.uk/programmes/p02pc9tn/episodes/downloads) - Learn and practise useful English language for everyday situations with the BBC.
- [CNN 10](http://edition.cnn.com/cnn10) - A 10-minute digital news show that explains global news to a global audience.
- [English Learning for Curious Minds](https://www.leonardoenglish.com/podcasts) - A podcasts with episodes on history, politics, and unusual stories. Transcripts, subtitles and vocabulary available.

### Tech Podcasts

The collection of podcasts about technologies.

- [MageTalk](https://magetalk.com/) - This is a great show with the latest news around Magento ecosystem, community and eCommerce.
- [Talk Python To Me](https://talkpython.fm/) - A podcast on Python and related technologies.
- [The PHP Roundtable](https://www.phproundtable.com/) - The PHP Roundtable is a podcast of web developers discussing PHP, JavaScript, community, open source.
- [Google Cloud Platform Podcast](https://www.gcppodcast.com/) - The Google Cloud Platform Podcast, coming to you every week. Discussing everything from on Google Cloud Platform from App Engine to Big Query.

### Interview Podcasts

Interviews are one of the best formats for podcasting and learn a real english conversations. The art of conversation is not an easy thing and can be tricky.

- [Lex Fridman Podcast](https://lexfridman.com/podcast/) - Conversations about the nature of intelligence, consciousness, love, and power.
- [Joe Rogan Experience](https://open.spotify.com/show/4rOoJ6Egrf8K2IrywzwOMk) - The official podcast of comedian Joe Rogan. Follow The Joe Rogan Clips show page for some of the best moments from the episodes.
- [The Tim Ferriss Show](https://tim.blog/podcast/) - The Tim Ferriss Show is often the #1 business podcast. Each episode, I deconstruct world-class performers from eclectic areas (investing, sports, business, art, etc.) to extract the tactics, tools, and routines you can use.
- [The Knowledge Project](https://fs.blog/knowledge-project-podcast/) - The Knowledge Project Podcast unlocks your potential. We interview world-class doers and thinkers so you can better analyze problems, seize opportunities, and master decision-making. Every episode is packed with lessons and insights that never expire.

### Live Radio Stations

Online radio stations is one of the best and most effective ways to improve your English listening skills, while also getting accustomed to the speed and tone of native English speakers.

- [NPR](http://www.npr.org/) - National american radio with transcripts.
- [Fox News Talk](http://tunein.com/radio/FOX-News-Talk-s20431/) - News New York radio station.
- [WNYC](http://www.wnyc.org/) - Public radio stations located in New York City.
- [BBC London](http://www.bbc.co.uk/bbclondon) - News and talks radio station from London.
- [LBC - London Broadcasting Company](https://www.lbc.co.uk) - Independent news/talk radio station in London.
- [WBAP 820AM - Dallas, Texas](http://www.wbap.com/listenlive/) - News/talk radio station in Dallas, Texas.
- [KRLA 870AM - Los Angeles, California](https://am870theanswer.com) - News/talk radio station in Los Angeles, California.
- [KTRH 740AM - Houston, Texas](https://ktrh.iheart.com) - News/talk radio station in Houston, Texas.
- [KJCE 1370AM - Austin, Texas](https://talk1370.radio.com) - News/talk radio station in Austin, Texas.
- [KRLD 1080AM - Dallas, Texas](https://krld.radio.com) - News/talk radio station in Dallas, Texas.
- [KGO 810AM - San Francisco, California](http://www.kgoradio.com) - News/talk radio station in San Francisco, California.
- [WOR 710AM - New York, New York](https://710wor.iheart.com) - News/talk radio station in New York, New York.
- [Bloomberg Radio](https://www.bloomberg.com/audio) - Financial markets news radio.
- [KOA 850AM - Denver, Colorado](https://koanewsradio.iheart.com) - News/talk radio station in Denver, Colorado.
- [WBBM 780AM - Chicago, Illinois](https://wbbm780.radio.com) - News/talk radio station in Chicago, Illinois.
- [KMOX 1120AM - St. Louis, Missouri](https://kmox.radio.com) - News/talk radio station in St. Louis, Missouri.

### Sites

- [Spotlight](http://spotlightenglish.com/) - Spotlight is a daily 15 minute radio program for learning English.
- [ESL Lab](http://www.esl-lab.com/) - Different levels of conversations.
- [EngVid](https://www.engvid.com/) - Free English Video Lessons.

## Watching

### YouTube

- [Rachel's English](https://www.youtube.com/user/rachelsenglish) - Most popular american english pronunciation videos.
- [Learn English with Ronnie](https://www.youtube.com/user/EnglishLessons4U) - Funny english videos with Ronnie.
- [BBC English Grammar](https://www.youtube.com/playlist?list=PLcetZ6gSk96_zHuVg6Ecy2F7j4Aq4valQ) - Short videos by BBC.
- [BBC English HowTo](https://www.youtube.com/playlist?list=PLcetZ6gSk9692RVJgFx4JXwFG4mWK0XGj) - Useful english phrases that you can use immediately.
- [Anglo-Link](https://www.youtube.com/user/MinooAngloLink/) - Useful grammar lessons.
- [Daily Dictation](https://www.youtube.com/user/dailydictation) - Daily dictation for students who want to improve their listening comprehension skills.
- [Learn English with Let's Talk](https://www.youtube.com/user/learnexmumbai) - On this channel different experts will tell you how to expertise in the different consequences in daily life and in which situation what type of phrases you should use.

### Live TV Channels

- [ABC7 Eyewitness News](http://abc7.com/live/) - TV station licensed to Los Angeles, California.
- [ABC News](http://abcnews.go.com/Live) - ABC news TV channel.
- [Bloomberg](http://www.bloomberg.com/live/us) - Bloomberg business TV channel in New York.
- [CBS News](http://www.cbsnews.com/live/) - CBS news is the news division of American TV and radio network CBS.
- [KTLA 5](http://ktla.com/on-air/live-streaming/) - TV station located in Los Angeles, California, United States.

### TV Talk Shows

- [Jimmy Kimmel Live!](https://www.youtube.com/user/JimmyKimmelLive) - Very popular american late-night talk show with famous people.
- [The Wendy Williams Show](https://www.youtube.com/user/WendyWilliamsShow) - American syndicated infotainment talk show hosted by Wendy Williams.
- [The Tonight Show Starring Jimmy Fallon](https://www.youtube.com/user/latenight) - American late-night talk show hosted by Jimmy Fallon on NBC.
- [Late Night with Seth Meyers](https://www.youtube.com/user/LateNightSeth) - American late-night talk show hosted by Seth Meyers on NBC.
- [The Late Late Show with James Corden](https://www.youtube.com/user/TheLateLateShow) - American late-night talk show hosted by James Corden on CBS.
- [The Late Show with Stephen Colbert](https://www.youtube.com/channel/UCMtFAi84ehTSYSE9XoHefig) - American late-night talk show by Stephen Colbert on CBS.
- [The Daily Show with Trevor Noah](https://www.youtube.com/channel/UCwWhs_6x42TyRM4Wstoq8HA) - American late-night talk show by Trevor Noah on Comedy Central

### Tech Shows

- [Bloomberg Technology](https://www.youtube.com/channel/UCrM7B7SL_g1edFOnmj-SDKg) - Bloomberg Technology focuses on the topics of technology, innovation and business.
- [BBC Click](https://www.youtube.com/user/ClickBBC) - BBC Click is the BBC’s flagship technology programme.
- [Sky News Swipe](https://www.youtube.com/playlist?list=PLG8IrydigQfckEQNNdxoPiQ0GtAJLP5_5) - Sky News`s tech show.
- [FRANCE 24 Tech24](https://www.youtube.com/playlist?list=PLCUKIeZnrIUmpC0R31n7lXY__0iWEuPQ3) - Tech24 explores the digital revolution and check out the latest technological trends.

## Grammar

- [Book: English Grammar in Use by Raymond Murphy](https://www.cambridge.org/us/cambridgeenglish/catalog/grammar-vocabulary-and-pronunciation/english-grammar-use-5th-edition) - The world's best selling grammar book for learners of English.
- [Ego4u](http://www.ego4u.com) - Grammar and tests.

## Learn more words

### Word lists

- [Ogden's Basic English](http://ogden.basic-english.org/) - 850 simplified Language Basic English Words by Charles K. Ogden. It was released in 1930. With just 850 words everything may be said for all the purposes of everyday existence. [Simple English Wikipedia](https://simple.wikipedia.org/wiki/Basic_English) is based on these 850 basic English words.
- [Book: Verbal Advantage by Charles Harrington Elster](https://www.academia.edu/27879831/Verbal_Advantage_by_Charles_Harrington_Elster) - This book for advanced levels and will help you learn more words. It's highly recommended book which not just informative but also interesting and fun to read.

### Flashcards

- [Anki](https://apps.ankiweb.net/) - Anki is a program which makes remembering things easy. Because it's a lot more efficient than traditional study methods, you can either greatly decrease your time spent studying, or greatly increase the amount you learn.
- [Memrise](https://www.memrise.com/) - Flashcard platform to build vocabulary with user created lists of words.
- [Quizlet](https://quizlet.com/) - Simple tools that let you study words.

### Online Dictionaries

- [Forvo](http://forvo.com/) - Find out how any english word is pronounced in different countries.
- [Dictionary](https://www.dictionary.com/) - The world's leading digital dictionary. It provides defenitions, spellings, audio pronunciations, example sentences and word origins.
- [Thesaurus.com](https://www.thesaurus.com/) - The world's largest online thesaurus by Dictionary.com
- [Oxford Dictionaries](http://www.oxfordlearnersdictionaries.com/) - Dictionaries with meanings, definitions, pronunciations and pictures.
- [Linguee](https://www.linguee.com/) - Dictionary with many examples of usage and pronunciation.
- [ReversoContext](http://context.reverso.net/translation) - Translate word in context.

- [Verbling](https://www.verbling.com/) - Verbling allows you to free practice english speaking skill by Google Hangout.

### Speaking Lessons

- [Talk English](http://www.talkenglish.com/) - Learn english speaking.

### Pronunciation

- [The Sound of English](http://thesoundofenglish.org/) - Learn how to speak clear English with a neutral British accent. Very helpful resource to improve your pronunciation.

## Online Classes

### Private Classes

- [iTalki](https://www.italki.com/) - One of the most popular resource where you can find a teacher 1 on 1.
- [Verbling](https://www.verbling.com/community) - One of the most popular resource where you can find a teacher 1 on 1.

### Group Classes

- [Lingoda](https://lingoda.com/) - They have group and private classes, fixed monthly payment and really convenient interface where you can schedule your classes. All teachers are native speakers.

## Reading

- [Breaking News English](http://www.breakingnewsenglish.com/) - Breaking news listen, read and write.
- [Short Stories](http://www.short-stories.co.uk/) - Short stories for every day reading.
- [Reading Room](http://www.englishpage.com/readingroom/readingroomintro.html) - Newspapers, magazines, books and libraries.
- [Reading Comprehension Exercises](http://www.usingenglish.com/comprehension/) - 3 Levels of texts with exercises.
- [IMDB scripts](http://www.imsdb.com/) - internet movie script database.
- [Today I Found Out](http://www.todayifoundout.com/) - Daily interesting fact articles from various authors.
- [Newsy](http://www.newsy.com/) - Short news with transcriptions.
- [Engoo](https://engoo.com/app/daily-news) - Daily news for english learners

## Exercises and Tests

- [ETS](http://englishteststore.net/) - English tests.
- [Ego4u](http://www.ego4u.com) - Grammar and tests.
- [Duolingo](https://www.duolingo.com) - Free language-learning platform that includes a language-learning site and app, as well as a digital language proficiency assessment exam.
- [LingoRank](http://lingorank.com) - Test and improve your english listening skills with TED talks.

## Tools

- [Play Phrase](http://playphrase.me/) - Tools allows to search and play specific soundbites from movies.
- [Lyrics Training](http://lyricstraining.com/) - LyricsTraining is the new way to learn english and other languages through music and the lyrics of your favourite songs.
- [Quizlet](https://quizlet.com/) - Simple tools that let you study words.
- [Grammarly](http://grammarly.com/) - Grammarly makes you a better writer by finding and correcting up to 10 times more mistakes than your word processor.
- [Test your vocab](http://testyourvocab.com/) - Measure your vocabulary sizes.
- [YouGlish](https://youglish.com/) - Improve your pronunciation
- [visuwords](https://visuwords.com/) - to visualize words and its related lexicon
- [Write & Improve](https://writeandimprove.com/) - FREE tool that helps every learner to improve their English writing.

## Answers

- [How can I improve my English listening abilities?](https://www.quora.com/How-can-I-improve-my-English-listening-abilities)
- [How can I learn to speak English well in non-English environment?](https://www.quora.com/How-can-I-learn-to-speak-English-well-in-non-English-environment)
- [How can I make tangible improvements to my spoken English in one month?](https://www.quora.com/How-can-I-make-tangible-improvements-to-my-spoken-English-in-one-month)
- [Are English speaking courses helpful?](https://www.quora.com/Are-English-speaking-courses-helpful)

## License

[![CC0](http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](https://creativecommons.org/publicdomain/zero/1.0/)

repository: yvoronoy/awesome-english

repo_name: yvoronoy/awesome-english


text:
# About TYPEMILL

TYPEMILL is a small flat file cms designed for writers. It creates websites based on markdown files and can be used for manuals, documentations, web-books and similar publications. The website http://typemill.net itself is an example-website for TYPEMILL.

![TYPEMILL Screenshot](/themes/typemill/typemill.jpg)

## Features

* Creates a website based on markdown files.
* Ships with a fully responsive standard theme.
* Works with a natural folder and file structure (like on your file-system).
* Creates a navigation, a breadcrumb and a pagination based on your file structure.
* Creates chapter numbers.
* Creates SEO-friendly urls.
* Supports configurable themes and plugins.
* Provides an author panel to configure the system, the themes and the plugins.
* Creates and manages users.
* Online editing is on its way (for time beeing upload markdown files).
* Markdown supports table of contents (TOC), tables, footnotes, abbreviations and definition lists.
* Supports MathJax and KaTeX (plugin).
* Supports code highlighting (plugin).
* Supports Matomo/Piwik and Google Analytics (plugin).
* Supports Cookie Consent (plugin).

## Installation

Download TYPEMILL from the [TYPEMILL website](http://typemill.net) or clone this repository with git. Open your git command line (e.g. gitbash), go to your project folder (e.g. htdocs) and type:

    git clone git://github.com/trendschau/typemill.git

The GitHub-version has no vendor-folder, so you have to update and include all libraries and dependencies with composer. To do so, open your command line, go to your TYPEMILL folder and type:

    composer update
If you did not use composer before, please go to the [composer website](http://getcomposer.org) and start to learn.

To run TYPEMILL **live**, simply upload the files to your server.

## Setup

Please go to `your-typemill-website.com/setup`, create an initial user and then setup your system in the author panel.

## Login

You can find your login screen under `/tm-author/login` or simply go to `/setup` and you will be redirected to the login-page.

## Requirements

Your server should run with PHP 5.6 or newer. No database is required.

## Documentation

You can read the full documentation for writers, for theme developers and for plugin developers on the [TYPEMILL website](http://typemill.net).

## Contribute

If you want to contribute to TYPEMILL, please fork this GitHub repository first. Then make your changes and create a pull request. I will review all request as soon as possible.

For hints, questions, problems and support, please open up a new issue on GitHub.

## Licence

TYPEMILL is published under MIT licence.

repository: BogusCurry/typemill

repo_name: BogusCurry/typemill


text:
# Amazon S3 Download

The new Amazon S3 Download step.

Syncs the given S3 Bucket with the local folder.

This Step requires an Amazon S3 registration.

*Check the `bitrise.yml` file for required inputs which have to be
added to your `.bitrise.secrets.yml` file!*


text:
---
permalink: /about/
title: "About"
---

I am a Software Engineer. I am from Chikkamagaluru, Karanataka, India and currently residing in Redmond, Washington, USA.
{: style="text-align: justify;"}

I started my software journey from RedForce Labs as an Intern. Next hop was at Honeywell Technology Solutions Pvt. Ltd. Then took a break and went to do my Masters in Software Engineering at ASU. Once I completed my Masters, I landed in AWS - Amazon as Software Development Engineer.
{: style="text-align: justify;"}

The work experience & university experience has taught me many concepts - technical as well as soft skills related to software engineering. The next important source of knowledge is via books. I like to read books of varying topics. This not only helps in the immediate field of work but also helps to expand my intellect on various other topics as well. I do believe in learning via practice so I spend time in personal coding projects too.
{: style="text-align: justify;"}

My old blogs - just for reference

1. [harshakadekar.blogspot.com](http://harshakadekar.blogspot.com/)
2. [harshakadekar.wordpress.com](https://harshakadekar.wordpress.com/)

{: style="text-align: justify;"}


text:
[![img](https://img.shields.io/badge/Lifecycle-Maturing-007EC6)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

# Aquifer Factsheets

This repository contains [R](http://www.r-project.org) code that generates aquifer factsheets for British Columbia.

## Usage

The data sourced for the analyses is provided under the [Open Government Licence – British Columbia](http://www2.gov.bc.ca/gov/content?id=A519A56BC2BF44E4A008B33FCF527F61).

#### A detailed walk-through is provided in the [MANUAL.md file](MANUAL.md)

### Data - To be provided

Data used by, but not created in, these scripts are stored in the "./data/" folder and include:

**Groundwater Trends Full Data** (Temporary data, future to be accessed from finalized BC Groundwater datasets)
- `clean_well_data.RData`

**Miscellaneous**
- Piper Plot descriptions (`piper_text.xlsx`)
- Index of extra page types (`extra_page_index.xlsx`)
- Images to include on extra pages (`extra_page_images.xlsx`)

### Data - To be downloaded

Data sets downloaded for use in these scripts (automatically downloaded by the `00_download.R` script) are stored in the "./data_dl/" folder and include:

- Daily mean water levels in observation wells (`obs_well_daily_mean.csv`)
- Well data from GWELLS (`well.csv` & `lithology.csv`)
- University of Victoria aquifer stress test results (`uvic_stress_index.xlsx`)
- Water licences (`licenced_vol.csv`)
- Aquifer data (`aquifers.csv`)
- Aquifer subtype index (`aquifer_subtypes.csv`)
- Aquifer map (`./data_dl/aquifer_map.rds`)
- Groundwater trends - summarized (`groundwater_trends.csv`)

### Figures

Some figures are created as part of the analysis, some are created in other software. Additional figures used by, but not created in, these scripts are stored in the "./figures/" folder:

- ./figures/maps/ - Aquifer maps (i.e., `Aquifer_Map_0001.pdf`)
- ./figures/piperplots/ - Piper plots (i.e., `Piperplot_0001_OW0001.jpg`)
- ./figures/na/ - Missing plot figures for Combo, Piper plots and Trend plots
- ./figures/boxplot_key.png - Figure explaining the boxplots for the companion document
- ./figures/BCID_H_cmyk_rev.pdf - BC Gov Logo

**To get the BC Government logo: **

Download BC Government logo and unzip into figures folder (Then convert to pdf by hand)
```
if(!file.exists("./figures/BCID_H_cmyk_rev.eps")) {
  download.file(url = "http://www.corporate.gov.bc.ca/print-ads/Govt_of_BC_Logos/Resources/2018_BCID_Files.zip",
                dest = "./figures/2018_BCID_Files.zip")
  unzip(zipfile = "./figures/2018_BCID_Files.zip",
        files = "2018_BCID_Files/_Horizontal/Reverse/CMYK/BCID_H_cmyk_rev.eps",
        exdir = "./figures", junkpaths = TRUE)
  file.remove("./figures/2018_BCID_Files.zip")
}
```

### Code

There are four core scripts that are required for the analysis, they need to be run in order:

- 01_download.R
- 02_load.R
- 03_clean.R
- 04_output.R

**To create all factsheets**, it is best to use the helper script: **`run_all.R`**

This script will guide the user through aquifer selection and running the required analysis scripts sequentially.

### Packages and Software

Each script will first run the `00_header.R` script file which will ensure the correct folder structure and will install and load all relevant packages.

An installation of LaTeX (e.g. MiKTex, MacTeX or [`tinytex`](https://cran.r-project.org/web/packages/tinytex/index.html)) is required to render the .Rmd files to PDF with `knitr`.

### Output

These scripts output Aquifer Factsheets and the Aquifer Factsheet Companion document to the "./factsheets/" folder.

- Factsheet for each Aquifer (e.g., for Aquifer #1 `AQ_00001_Aquifer_Factsheet.pdf`)
- A companion document containing methodological details (`Aquifer Factsheet - Companion Document.pdf`)

## Project Status

This project is under development.

## Getting Help or Reporting an Issue

To report bugs/issues/feature requests, please file an [issue](https://github.com/bcgov/aquifer-factsheets/issues/).

## How to Contribute

If you would like to contribute, please see our [CONTRIBUTING](CONTRIBUTING.md) guidelines.

Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

## License

```
Copyright 2020 Province of British Columbia

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
for the specific language governing permissions and limitations under the
License.
```

This repository is maintained by the [ENVWater Team](https://github.com/orgs/bcgov/teams/envwater/members) in the [GitHub BCGov Organization](https://github.com/bcgov).

---
*This project was created using the [bcgovr](https://github.com/bcgov/bcgovr) package.*

repository: bcgov/aquifer-factsheets

gha_language: R

repo_name: bcgov/aquifer-factsheets


text:
# Proxy
Pitch for proxy

# Live
[Live Demo](https://yagnyam-in.github.io/proxy-pitch/index.html)

# How to modify
Start with index.html

# Source
[reveal.js](https://github.com/hakimel/reveal.js.git) is a framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://revealjs.com/).

repository: yagnyam-in/proxy-pitch

gha_language: JavaScript

repo_name: yagnyam-in/proxy-pitch


text:
---
description: Explains how to use the Student Robotics tablet as part of the kit issued
  to teams.
layout: docs
title: Tablet
---
The tablet provided with your kit allows you to interface with and debug your
robot.

![An image of the tablet](/images/content/kit/tablet-cropped.png "The Tablet")

Connecting to the robot
-----------------------

First you should make sure the tablet is connected to your robot's WiFi. This
should happen automatically when you turn on the tablet if the robot is also
powered up. If there is a problem you can manually connect to the robot by
finding your WiFi key from the `wifi.yaml` file inside the `robot.zip` from the
IDE which should be on your memory stick. If you are still experiencing
problems, you should ask a question on the [forum](/forum).

![WiFi status](/images/content/kit/tablet/wifi_status.png "WiFi status")

Once you have a WiFi connection, you can open the "Student Robotics" app which
will open the browser and display the tablet interface for your robot. If you
are experiencing problems with the app, you can try connecting to the robot
manually by opening the "Chrome Shell" app from the apps list and navigating to
`http://robot.sr/`.

<div class="warning">
If the tablet is already connected to a WiFi access point before turning on the
robot, it will not automatically switch to the robot access point. You will
need to do that yourselves by either disconnecting from the original access
point or by selecting the robot one in the WiFi settings screen on the tablet.
</div>

repository: prophile/srweb-jekyll

gha_language: CSS

repo_name: prophile/srweb-jekyll


text:
# Color Sensor

The third orange block looks like continuous color reading:

![ColorSensor](https://github.com/JorgePe/BOOSTreveng/blob/master/LEGO_BOOST_App_blocks/ColorSensor_continuous.png)

I've been sniffing it with the color sensor at port C.

We need to activate notifications by writing "0100" to handle 0x0f = UUID 2902

UUID 2902 is defined as the [Client Characteristic Configuration](https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml) in the
Bluetooth specs. By activating notifications on one characteristic we "subscribe" to further messages comming
from it.

Then we activate "?continuous color reading?" mode by writing `0a004101080100000001` to handle 0x0e and keep reading.

```
gatttool -b 00:16:53:A4:CD:7E --char-write-req --handle=0x0f --value=0100
gatttool -b 00:16:53:A4:CD:7E --char-write-req --handle=0x0e --value=0a004101080100000001 --listen
Notification handle = 0x000e value: 08 00 45 01 03 03 ff 03
Notification handle = 0x000e value: 08 00 45 01 09 07 ff 01
Notification handle = 0x000e value: 08 00 45 01 00 07 ff 01
Notification handle = 0x000e value: 08 00 45 01 ff 09 ff 01
Notification handle = 0x000e value: 08 00 45 01 ff 0a ff 01
....
```

   The BOOST Move Hub only send a notification when there is a change.

   The color sensor understands few colors, apparently the same 7 available as options in the
   first and second orange blocks where we need to choose the color to be detected:
   - ? null ?
   - black
   - blue
   - green
   - yellow
   - red
   - white

   If I touch a white surface with the sensor it reads null.
   Dark color surfaces read black

   Some rough measurings:

   WHITE              08 00 45 01 0a 00 ff 0a
   BLUE               08 00 45 01 03 00 ff 01
   BLACK              08 00 45 01 00 0a ff 01
   RED                08 00 45 01 09 00 ff 03
   GREEN              08 00 45 01 05 00 ff 02
   YELLOW             08 00 45 01 07 00 ff 05

First byte = 08 is the number of bytes in the message (thanks @rblaakmeer)

2nd, 3rd and 4th bytes = 00 45 01 are still unknown

5th byte seems the same index used for RGB LED, with BLACK as OFF

- BLACK  0x00
- BLUE   0x03
- GREEN  0x05 (Cyan or Turquoise in RGB LED)
- YELLOW 0x07
- RED    0x09
- WHITE  0x0A

   When the sensor is a few centimeters far, instead of returning a color index it returns
   FF.
   The 6th byte changes with distance but it doesn't seem to measure it.
   The 8th byte also changes. It's strange to be be separated from 5th and 6th bytes by a
   fixed 7th byte, always FF.

Based on this, this shell script works fine in Ubuntu:

```
#!/usr/bin/env bash

# activate notifications
gatttool -b 00:16:53:A4:CD:7E --char-write-req --handle=0x0f --value=0100
# activate continuous color reading
gatttool -b 00:16:53:A4:CD:7E --char-write-req --handle=0x0e --value=0a004101080100000001 --listen |
  while IFS= read -r line
  do
    output=${line##*:}
    output2=($output)

    case ${output2[4]} in
      00)
        echo "BLACK"
        ;;
      03)
        echo "BLUE"
        ;;
      05)
        echo "GREEN"
        ;;
      07)
        echo "YELLOW"
        ;;
      09)
        echo "RED"
        ;;
      0a)
        echo "WHITE"
        ;;
      ff)
        echo "TOO FAR"
        ;;
      *)
        echo "???"
        ;;
    esac
  done
```

repository: hobbyquaker/BOOSTreveng

repo_name: hobbyquaker/BOOSTreveng


text:
# OpenLayers 3

This document describes a bit about the work going toward OpenLayers 3.0.

OpenLayers v3 development is taking place in git, with a central repository
hosted on [GitHub][1].  To contribute to development, it's important to be
comfortable working with git.  The [help pages][2] on GitHub provide a nice
starting place for this.

The repository contains a master branch and a 2.x branch.  Other branches may
come and go as people work on specific features.  The master branch should be
the closest stable thing to OpenLayers 3.0 (and this readme should get updated
before 3.0 is released).  However, at any time before the 3.0 release, the
master branch should not be considered production ready.  The 2.x branch is used
to merge in changes from any ongoing development in the v2 line of development.

If you are interested in contributing, please fork the central repository, make
changes, and issue a pull request.  We may change the process along the way, but
for now, developers with access to the subversion trunk will be able to push to
the central git repository.  We welcome your contributions and thank you for
helping us work toward OpenLayers 3.

[1]: http://github.com/openlayers/openlayers
[2]: http://help.github.com/

repository: crindt/tmcpe-legacy

repo_name: crindt/tmcpe-legacy


text:
# fltkhs-light-theme-skeleton
This is a skeleton app to help get going with a light themed FLTKHS native GUI application. To install clone this repo then do:

    > stack build --flag fltkhs:bundled
    > stack exec fltkhs-light-theme-skeleton

repository: deech/fltkhs-light-theme-skeleton

repo_name: deech/fltkhs-light-theme-skeleton


text:
---
layout: post
title: Spring Cloud @FeignClient name as property
---

I've been using the fantastic [Spring Cloud Netflix](http://cloud.spring.io/spring-cloud-netflix/) a lot recently during a project to migrate a monolith to microservices. I spent some time recently writing a set of Selenium integration tests using Sorin Costea's excellent [example project](https://github.com/sorin-costea/bdd). I found myself wanting to run multiple Spring Boot microservices locally in order to run the Selenium tests. I wanted to run one service in particular locally but use Eureka for the others.

###Disabling Eureka For a Service

According to the [docs](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-ribbon-without-eureka) you simply need to set `ribbon.listOfServers` for the service you want to point to locally. However I found this wasn't enough, after much searching, here's the final working configuration.

```
servicename:
  ribbon:
    eureka:
        enabled: false
    NIWSServerListClassName: com.netflix.loadbalancer.ConfigurationBasedServerList
    listOfServers: localhost:7000
```

This [configures Ribbon](http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html#_customizing_the_ribbon_client_using_properties) to use your specified server list instead of those configured in Eureka.

gha_language: HTML


text:
# Grappling Gun

![](https://nerdist.com/wp-content/uploads/2016/12/Grappling-Hook-GIF-2-12092016.gif)

## Introduction

Grappling Gun is a Chat Bridge powered by [gunDb](https://github.com/amark/gun), for gunDb.

Building upon the concept of [matterbridge](https://github.com/42wim/matterbridge), different listener chat bots are treated as [SEA](https://github.com/amark/gun/blob/master/sea.js) users that connect to one canonical source (a distributed Gun database).

## Roadmap
- [X] Bridge Gitter and Discord rooms
- [ ] Store the canonical chat log in Gun
- [ ] Create a UX for accessing Gun chat log directly

repository: Dletta/grappling-gun

repo_name: Dletta/grappling-gun


text:
### Section 1: Exploring the lab environment

#### Step 1

Navigate to the `networking-workshop` directory.

```
[vagrant@ansible ~]$ cd linklight/
[vagrant@ansible linklight]$

```

#### Step 2

Run the `ansible` command with the `--version` command to look at what is configured:

```
[vagrant@ansible linklight]$ ansible --version
ansible 2.7.0.dev0
  config file = /home/vagrant/.ansible.cfg
  configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
```

> Note: The ansible version you see might differ from the above output

This command gives you information about the version of Ansible, location of the executable, version of Python, search path for the modules and location of the `ansible configuration file`.

#### Step 3

Use the `cat` command to view the contents of the `ansible.cfg` file.

```
[vagrant@ansible linklight]$ cat ~/.ansible.cfg
[defaults]
deprecation_warnings=False
host_key_checking = False
inventory = /home/vagrant/linklight/vagrant-demo/arista/hosts
gathering = explicit
[paramiko_connection]
host_key_auto_add = True

```

Note the following parameter within the `ansible.cfg` file:

 - `inventory`: shows the location of the ansible inventory being used

#### Step 4

The scope of a `play` within a `playbook` is limited to the groups of hosts declared within an Ansible **inventory**. Ansible supports multiple [inventory](http://docs.ansible.com/ansible/latest/intro_inventory.html) types. An inventory could be a simple flat file with a collection of hosts defined within it or it could be a dynamic script (potentially querying a CMDB backend) that generates a list of devices to run the playbook against.

In this lab you will work with a file based inventory written in the **ini** format. Use the `cat` command to view the contents of your inventory:

```
[vagrant@ansible linklight]$ cat /home/vagrant/linklight/vagrant-demo/arista/hosts
[leafs]
leaf01 ansible_host=<IP_ADDRESS>
leaf02 ansible_host=<IP_ADDRESS>

[spines]
spine01 ansible_host=<IP_ADDRESS>
spine02 ansible_host=<IP_ADDRESS>

[network:children]
leafs
spines

[network:vars]
ansible_network_os=eos
ansible_connection=network_cli
ansible_user=admin
ansible_password=admin

[servers]
server01 ansible_host=<IP_ADDRESS>
server02 ansible_host=<IP_ADDRESS>

[datacenter:children]
leafs
spines
servers
```

#### Step 5

In the above output every `[ ]` defines a group. For example `[spines]` is a group that contains the hosts `spine01` and `spine02`. Groups can also be _nested_. The group `[network]` is a parent group to the group `[spines]` and `[leafs]`

> Parent groups are declared using the `children` directive. Having nested groups allows the flexibility of assigining more specific values to variables.

> Note: A group called **all** always exists and contains all groups and hosts defined within an inventory.

We can associate variables to groups and hosts. Host variables are declared/defined on the same line as the host themselves. For example for the host `leaf01`:

```
leaf01 ansible_host=<IP_ADDRESS>
```

 - `leaf01` - The name that Ansible will use.  This can but does not have to rely on DNS
 - `ansible_host` - The IP address that ansible will use, if not configured it will default to DNS

We can also define variable at a group var, indicated by the groupname:vars, for example `[network:vars]`

```
[network:vars]
ansible_network_os=eos
ansible_connection=network_cli
ansible_user=admin
ansible_password=admin
```

- `ansible_user` - The user ansible will use to login to hosts for this group, if not configured it will default to the user the playbook is run from
- `ansible_connection=network_cli` The connection method can be set in the inventory (or the playbook level).  The `network_cli` plugin is written specifically for network equipment and handles things like ensuring a persistent SSH connection across multiple tasks.
- `ansible_password` - this is the password that will be used to hosts for this group, for demonstration purposes we are using a plain-text password, this can be encrypted with Ansible vault.
- `ansible_network_os` - This variable is necessary while using the `network_cli` connection type within a play definition, as we will see shortly.

## Complete
You have completed Exercise 01.

[Return to training-course](../README.md)

repository: pharriso/workshops

repo_name: pharriso/workshops


text:
EXAMPLE 1 - Basic stack
=======================

Basic example using the following features:
* Using `!yaml` to include a JSON file for the mappings
* Using `!file64` to include the userdata.txt file

Note that the stack parameters are coming from the parameters.yaml file

repository: rewardle/rainbow

gha_language: Python

repo_name: rewardle/rainbow