Skip to content

Instantly share code, notes, and snippets.

View abhik-99's full-sized avatar
🎯
Lyadh...

Abhik Banerjee abhik-99

🎯
Lyadh...
View GitHub Profile
@abhik-99
abhik-99 / OurSBT.sol
Created September 13, 2022 16:08
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.7.3/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts@4.7.3/access/Ownable.sol";
import "@openzeppelin/contracts@4.7.3/utils/Counters.sol";
contract OurSBT is ERC721Enumerable, Ownable {
using Counters for Counters.Counter;
@abhik-99
abhik-99 / Contract3.sol
Created June 19, 2022 15:28
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.12+commit.f00d7308.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
contract Contract3 {
uint constant c1 = 10;
constructor() {}
function getSum(uint _v) public returns (uint){
@abhik-99
abhik-99 / Contract2.sol
Created June 19, 2022 07:31
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.12+commit.f00d7308.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
contract Contract2 {
uint constant c1 = 7894578;
uint immutable i1;
constructor(uint _i1){
@abhik-99
abhik-99 / Contract2.sol
Created June 19, 2022 07:31
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.12+commit.f00d7308.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
contract Contract1 {
uint constant c1 = 7894578;
uint immutable i1;
constructor(uint _i1){
@abhik-99
abhik-99 / Contract1.sol
Created June 19, 2022 07:30
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.12+commit.f00d7308.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
contract Contract1 {
uint public constant c1 = 7894578;
uint public immutable i1;
uint public v1;
constructor(uint _i1, uint _v1){
@abhik-99
abhik-99 / matthews_corr_coef_pl.py
Created January 4, 2021 20:15
Matthews Correlation Coefficient implemented as a Pytorch Lightning Metric. This metric can be used for calculating MCC as a part of training/val/test loops with native Pytorch Lightning Support for Logging.
from pytorch_lightning.metrics import Metric
from pytorch_lightning.metrics.functional.classification import (
stat_scores_multiple_classes
)
class MCC(Metric):
r"""
Computes `Mathews Correlation Coefficient <https://en.wikipedia.org/wiki/Matthews_correlation_coefficient>`_:
Forward accepts
- ``preds`` (float or long tensor): ``(N, ...)`` or ``(N, C, ...)`` where C is the number of classes