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
#imports | |
# QSTK Imports | |
import QSTK.qstkutil.qsdateutil as du | |
import QSTK.qstkutil.tsutil as tsu | |
import QSTK.qstkutil.DataAccess as da | |
# Third Party Imports | |
import datetime as dt | |
import matplotlib.pyplot as plt | |
import pandas as pd |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 HttpStatus = require('http-status-codes'); | |
const TokenModel = require('../models/token'); | |
const UserModel = require('../models/user'); | |
const UserTokenModel = require('../models/user-token'); | |
const OHLVCModel = require('../models/ohlvc'); | |
const TransactionModel = require('../models/transaction'); | |
const { | |
paramsNotValid, generateTransactionReference, handleError, handleSuccess | |
} = require('../utils/utils'); | |
const { |
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
Commander Lambda uses an automated algorithm to assign minions randomly to tasks, in order to keep her minions on their toes. But you've noticed a flaw in the algorithm - it eventually loops back on itself, so that instead of assigning new minions as it iterates, it gets stuck in a cycle of values so that the same minions end up doing the same tasks over and over again. You think proving this to Commander Lambda will help you make a case for your next promotion. | |
You have worked out that the algorithm has the following process: | |
1) Start with a random minion ID n, which is a nonnegative integer of length k in base b | |
2) Define x and y as integers of length k. x has the digits of n in descending order, and y has the digits of n in ascending order | |
3) Define z = x - y. Add leading zeros to z to maintain length k if necessary | |
4) Assign n = z to get the next minion ID, and go back to step 2 | |
For example, given minion ID n = 1211, k = 4, b = 10, then x = 2111, y = 1112 and z = 2111 - 1112 = 0999. Then the next m |
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 Vue from 'vue' | |
import Router from 'vue-router' | |
import UserDashboardLayout from '@/layout/User/DashboardLayout' | |
import CompanyDashboardLayout from '@/layout/Company/DashboardLayout' | |
import AdminDashboardLayout from '@/layout/Admin/DashboardLayout' | |
import AuthLayout from '@/layout/AuthLayout' | |
import LandingPageLayout from '@/layout/LandingLayout' | |
Vue.use(Router) | |
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 'vue-loading-overlay/dist/vue-loading.css' | |
import 'izitoast/dist/css/iziToast.min.css' | |
import Vue from 'vue' | |
import App from './App.vue' | |
import router from './router' | |
// import './registerServiceWorker' | |
import store from './store/store' | |
import DashboardPlugin from './plugins/dashboard' | |
import utilsMixins from './mixins/utils_mixin' |
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
exports.requiresAuth = (to, from, next, Bacexdata) => { | |
if (to.matched.some(record => record.meta.requiresUserAuth) && Bacexdata.user.is_auth === false) { | |
Bacexdata.user.error = 'You need to log in before you can perform this action.' | |
next({ | |
path:'/login', | |
query: { redirect: to.fullPath } | |
}) | |
} else if (to.matched.some(record => record.meta.requiresAdminAuth) && Bacexdata.admin.is_auth === 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
const { scripts, ConfigManager } = require('@openzeppelin/cli'); | |
const { add, push, create } = scripts; | |
require('dotenv').config(); | |
async function deploy(options, accounts) { | |
console.log('accounts ', accounts) | |
add({ contractsData: [{ name: 'ANO', alias: 'ANO' }] }); | |
await push(options); | |
await create(Object.assign({ contractAlias: 'ANO', methodName: 'initialize', methodArgs: [ | |
"ANO Token", "ANO", 18, `${process.env.METAMASK_ADDRESS}`, `${process.env.METAMASK_ADDRESS}`, 10 |
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
require('dotenv').config(); | |
const { GSNProvider } = require("@openzeppelin/gsn-provider"); | |
module.exports = { | |
// See <http://truffleframework.com/docs/advanced/configuration> | |
// to customize your Truffle configuration! | |
networks: { | |
ganache: { | |
provider() { | |
return new GSNProvider(`${process.env.GANACHE}`, {useGSN: true}) |
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
type User struct { | |
mogo.DocumentModel `bson:",inline" coll:"users"` | |
Username string `json:"username" binding:"required"` | |
Email string `idx:"{email},unique" json:"email" binding:"required"` | |
Password string `json:"password" binding:"required"` | |
FirstName string `json:"firstname"` | |
LastName string `json:"lastname"` | |
// CreatedAt *time.Time | |
// UpdatedAt *time.Time | |
Verified *time.Time `json:"_verified"` |
OlderNewer