This file contains 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 * as anchor from "@coral-xyz/anchor"; | |
import { PublicKey, Transaction, ComputeBudgetProgram } from "@solana/web3.js"; | |
import * as token from "@solana/spl-token"; | |
const provider = anchor.AnchorProvider.env(); | |
anchor.setProvider(provider); | |
// Assumes your running with `anchor run closeAux --provider.cluster mainnet --provider.wallet ~/.config/solana/your-key.json` | |
const payer = provider.wallet["payer"]; |
This file contains 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
from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QTextEdit, QPushButton | |
from PyQt6.QtCore import Qt, pyqtSignal | |
from ib_insync import IB, util | |
from aiogram import Bot, Dispatcher, types | |
import asyncio | |
import threading | |
# Import logging | |
import logging | |
# Setup logging |
This file contains 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
Proposal | |
A 13,500 token grant for adding closeable markets to serum v3. | |
This PR will allow permissioned markets to be disabled and to redeem the rent exempt Sol used for the event queue, request queue, bid and ask queues. | |
It’s been a feature long requested by many in the community building on top and serum and we were very happy to be able to make this PR. | |
https://github.com/project-serum/serum-dex/pull/191 | |
3,500 tokens will go to Tom, 10,000 will go to Henry |
This file contains 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
const BASE: u128 = 1_000_000 | |
// Assumes limit price and coin amount have 6 decimals and the u64 int contains all decimal places | |
fn new_order( | |
&self, | |
side: Side, | |
limit_price: u64, | |
coin_amount: u64, | |
order_type: OrderType, | |
) -> ProgramResult { | |
let (price_lots, coin_lots, pc_lot_size) = { |
This file contains 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
pub fn proxy_transfer(ctx: Context<ProxyTransfer>, amount: u64, nonce: u8) -> ProgramResult { | |
token::transfer(ctx.accounts.into(), amount)?; | |
// let seeds = &[TEST_SEED.as_bytes(), &[nonce]]; | |
let seeds: &[&[u8]] = &[ctx.accounts.authority.to_account_info().key.as_ref(), &[nonce]]; | |
let signer = &[&seeds[..]]; | |
// let cpi_ctx = CpiContext::from(&*ctx.accounts).with_signer(signer); | |
let cpi_ctx = CpiContext::new_with_signer( | |
ctx.accounts.token_program.clone(), |
This file contains 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
#!/bin/bash | |
# make it easier to request interactive jobs | |
int () | |
{ | |
# there's issues with getopts working in functions if OPTIND isn't reset | |
# every time the function is called | |
local OPTIND; | |
# should we use gpu queue, defaults to cpu |
This file contains 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
// all this code needs to go in the loop which initialises the asteroids | |
bool isStillCheckingLocation = true; | |
while(isStillCheckingLocation) | |
{ | |
asteroidStartLocation = new Vector2 (UnityEngine.Random.Range (0, gameWidth), | |
UnityEngine.Random.Range (0, gameHeight)); | |
// we need to make sure the asteroids are not spawned too close to the player | |
if( (asteroidStartLocation.x < gameWidth * 0.4f || asteroidStartLocation.x > gameWidth * 0.6f) && | |
(asteroidStartLocation.y < gameHeight * 0.4f || asteroidStartLocation.y > gameHeight * 0.6f) ) | |
isStillCheckingLocation = false; |
This file contains 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
//initialise this variable | |
shootingRangeDeg = 5f; | |
if( atan2 * mathf.Rad2Deb < shootingRangeDeg ) | |
fire(); |
This file contains 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
// outside of the class, below "Using UnityEngine" | |
using Random = UnityEngine.Random; | |
// make sure to initialise this properly | |
fudgeFactor = 30; | |
// inside the update function | |
atan2 = Mathf.Atan2 (v_diff.y, v_diff.x); | |
Quaternion newAngle = Quaternion.Euler (0f, 0f, atan2 * Mathf.Rad2Deg + Random.Range( - fudgeFactor, fudgeFactor) ); |
This file contains 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
// this needs to go into the asteroid's update function. | |
// It might be prudent to store the gameHeight and gameWidth variables | |
// in the GameManager script and assign them to variables in this | |
// script on awake. | |
// I'm neglecting to add any initialisation here but I'm sure you know what to do | |
aWidth = GameManager.instance.gameWidth | |
aHeight = GameManager.instance.gameHeight | |
// inside the update function |
NewerOlder