This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anchor_lang::prelude::*; | |
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv"); | |
#[program] | |
pub mod mycalculator { | |
use anchor_lang::solana_program::entrypoint::ProgramResult; | |
use super::*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anchor_lang::prelude::*; | |
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv"); | |
#[program] | |
pub mod mycalculator { | |
use anchor_lang::solana_program::entrypoint::ProgramResult; | |
use super::*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anchor_lang::prelude::*; | |
declare_id!("5gaQPYyZV2EzyMEG6z2a1B5ZpdXxGmru7eEV5pNZJeNv"); | |
#[program] | |
pub mod mycalculator { | |
use anchor_lang::solana_program::entrypoint::ProgramResult; | |
use super::*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; | |
import { themeColors } from 'styles/global-styles'; | |
export const useStyles = makeStyles((theme: Theme) => | |
createStyles({ | |
main: { | |
// height: '84vh', | |
textAlign: 'left' | |
}, | |
comment: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from collections import defaultdict | |
from typing import List, Tuple | |
def cosine_similarity(v1: np.ndarray, v2: np.ndarray) -> float: | |
dot_product = np.dot(v1, v2) | |
norm_v1 = np.linalg.norm(v1) | |
norm_v2 = np.linalg.norm(v2) | |
return dot_product / (norm_v1 * norm_v2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) | |
pragma solidity ^0.8.19; | |
import {Context} from "../utils/Context.sol"; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) | |
pragma solidity ^0.8.19; | |
import {Context} from "../utils/Context.sol"; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) | |
pragma solidity ^0.8.19; | |
import {Context} from "../utils/Context.sol"; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity >= 0.4.22 <0.9.0; | |
library console { | |
address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); | |
function _sendLogPayload(bytes memory payload) private view { | |
uint256 payloadLength = payload.length; | |
address consoleAddress = CONSOLE_ADDRESS; | |
assembly { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.0; | |
contract Proxy { | |
address private _implementation; | |
event Upgraded(address indexed implementation); | |
constructor(address implementation_) { | |
_implementation = implementation_; | |
} |
NewerOlder