text stringlengths 3 1.05M |
|---|
import React, {
useCallback,
useEffect,
useMemo,
useState,
useRef,
} from 'react';
import { useWallet, useWalletPublicKeys } from '../utils/wallet';
import { decodeMessage } from '../utils/transactions';
import { useConnection, useSolanaExplorerUrlSuffix } from '../utils/connection';
import {
Typography,
... |
import torch
import os
import time
import json
import numpy as np
from collections import defaultdict
from speaker import Speaker
from utils import read_vocab,write_vocab,build_vocab,Tokenizer,padding_idx,timeSince, read_img_features
import utils
from env import R2RBatch
from agent import Seq2SeqAgent
from eval impo... |
/*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 12:32:51 PM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /usr/lib/libAWDSupportFramework.dylib
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
#import <l... |
#include "vertexbuffer.h"
#include <kinc/graphics5/vertexbuffer.h>
#include <kinc/backend/SystemMicrosoft.h>
#include <kinc/graphics4/graphics.h>
kinc_g5_vertex_buffer_t *_current_vertex_buffer = NULL;
void kinc_g5_vertex_buffer_init(kinc_g5_vertex_buffer_t *buffer, int count, kinc_g5_vertex_structure_t *structure,... |
from django.db import migrations
FILENAME = 'api/migrations/create_audit_trigger.sql'
def create_trigger(apps, schema_editor):
if schema_editor.connection.vendor != 'postgresql':
return
with open(FILENAME, 'r') as file:
sql = file.read()
with schema_editor.connection.cursor() as cu... |
'use strict';
const express = require('express');
const nodeRandom = require('node-random');
const request = require('request');
function random() {
return new Promise((resolve, reject) => {
request({
url: 'https://www.random.org/integers/',
method: 'get',
qs: {
num: 3,
min: 1,
max: 10,
ba... |
# Generated by Django 3.0.7 on 2021-09-18 12:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blogs', '0041_auto_20210808_2118'),
]
operations = [
migrations.CreateModel(
name='Image',
... |
import tempfile
from pygromos.files.simulation_parameters import imd
from pygromos.files.qmmm import qmmm
from pygromos.tests.test_files.general_file_functions import general_file_tests
from pygromos.tests.in_testfiles import in_test_file_path
root_in = in_test_file_path+"/qmmm"
in_path_imd = root_in+"/md.imd"
in_pat... |
"""Contains the base class for ball devices."""
import asyncio
from collections import deque
from mpf.core.events import QueuedEvent, event_handler
from mpf.devices.ball_device.ball_count_handler import BallCountHandler
from mpf.devices.ball_device.ball_device_ejector import BallDeviceEjector
from mpf.core.delays imp... |
/* */
"use strict";
module.exports = function(Promise, INTERNAL, tryConvertToPromise, apiRejection) {
var util = require('./util');
var raceLater = function(promise) {
return promise.then(function(array) {
return race(array, promise);
});
};
function race(promises, parent) {
var maybePromise ... |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
import torch
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.distributions import Categorical, constraints
from pyro.distributions.torch_distribution import Torch... |
"""
ASGI config for sudokucreator project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO... |
"""Common get info functions for OSPF"""
# Python
import logging
import datetime
import re
# Genie
from genie.metaparser.util.exceptions import SchemaEmptyParserError
from genie.utils.timeout import Timeout
log = logging.getLogger(__name__)
def get_ospf_interface_and_area(device):
""" Retrieve interface for os... |
from __future__ import division, print_function
def mask_nii_2_hdf5(in_files, mask_files, hdf5_file, folder_alias):
"""masks data in in_files with masks in mask_files,
to be stored in an hdf5 file
Takes a list of 3D or 4D fMRI nifti-files and masks the
data with all masks in the list of nifti-files ma... |
/*
* Copyright 2020 u-blox Ltd
*
* 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 w... |
# Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#!/usr/bin/env python
from cltree import basic,symbol,constant,variable
b = basic()
c = constant()
s = symbol()
v = variable... |
#this code write by Afshin Zolfaghari
#https://github.com/AfshinZlfgh/
#24 nov 2018
#19:35 (Tehran time)
import sys
import os
key = bytearray(open(sys.argv[1], 'rb').read())
outputPath = sys.argv[2]
inputFiles = []
for(dirpath, dirnames, filenames) in os.walk("./"):
inputFiles.extend(filenames)
break
for ... |
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
/**
* Database schema for fridge
* @module cricket/fridge.server.model
* @name Cricket Fridge Model
* @type Model
*/
/**
* @external USER
* @see {@link user-model.html}
*/
/**
* @external SCENARIO
* @see {@link scenario-model.html}
*/
/*... |
#!/usr/bin/env python
"""Simple parsers for OS X files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import datetime
import io
import os
import stat
import biplist
from future.utils import string_types
from grr_response_core.lib import parser
from... |
import torch
import torch.nn as nn
import torchvision
import torchvision.datasets as datasets
import torchvision.transforms as transforms
import torchvision.models as torch_models
import torch.nn.functional as F
import torch.optim as optim
class ConvNetMaker(nn.Module):
"""
Creates a simple (plane) convolutional ne... |
import Axios from '@/utils/interceptor'
const BASE_URL = '/system/config'
export function getSystemConfig() {
return Axios({
method: 'get',
baseURL: BASE_URL,
url: '/getSystemConfig'
})
}
export function updateSystemConfig(systemConfig) {
return Axios({
method: 'put',
... |
#
# Autogenerated by Thrift Compiler (0.9.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:twisted
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import _thrift.services.ttypes
from thrift.transport import TTransport
from thrift.proto... |
import * as Constants from '../../common/constants'
import s from '../../common/locales/strings'
export default function (state = null, action) {
switch (action.type) {
case Constants.AUTH_UPDATE_PASSWORD:
// action.data.passwordStatus
const status = action.data.passwordStatus
const array = [
... |
'''
XXX:
Author: Pontus Stenetorp <pontus stenetorp se>
Version: 2011-04-09
'''
from sys import path as sys_path
from os.path import join as path_join
from os.path import dirname
from itertools import chain
from liblinear import LibLinearClassifier
sys_path.append(path_join(dirname(__file__), '..'))
from... |
import StreamSplitter from 'stream-splitter';
// Download operations
const downloadOperations = [
{
type: 'start',
pattern: /Starting download/,
props: []
},
{
type: 'progress',
pattern: /\[\s+(\d+)%][\s.]+\[\s*(\d+\.?\d)KB\/s]/,
props: [
'progress',
'speed'
]
},
{
... |
import React from 'react'
import { FormattedMessage } from 'react-intl'
import {NavLink,Link} from 'react-router-dom'
import FA from 'react-fontawesome'
const Header = () => {
return (
<nav className="navbar navbar-expand-lg navbar-dark bg-dark">
<a className="navbar-brand" href="/"><Fo... |
#!/usr/bin/env python3
import argparse
import json
import os
from PIL import Image
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("input")
args = parser.parse_args()
img = Image.open(args.input)
base_name = os.path.splitext(args.input)[0]
print(f"size: {img.size... |
#!/usr/bin/env python3
# Copyright (c) 2014-2020 The Vadercoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import unhexl... |
export default function(nodes, v) {
nodes.forEach(function(n) {
n[v.__x] = n[v.__x] || 0;
n[v.__y] = n[v.__y] || 0;
n[v.__width] = n[v.__width] || v.size[0];
n[v.__height] = n[v.__height] || v.size[1];
n[v.__cx] = n[v.__cx] || n[v.__x] + n[v.__width] / 2;
n[v.__cy] = n[v.__cy] || n[v.__y] ... |
import React from 'react';
import {Flex} from '@rebass/grid/emotion';
import {NavBox, SEO, Header} from '../components';
import {BlockText, CenteredFlex} from '../components/ui';
// TODO: could these be autogenerated from the set of product types/associated images?
import XboxOne from '../images/xbox-one.png';
import... |
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* The Crop component provides the ability to crop a texture based Game Object to a defined rectangle,
* which... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django_extensions.db.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("meupet", "0025_auto_20161106_1143")]
operations = [
migrations.AddField(model_name="pet", name="activ... |
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
import math
import os
import pathlib
import shutil
import time
from typing import Any, Callable, Dict, List, Tuple
import numpy as np
import pytest
from torch.utils.data import DataLoader
from composer.datasets.streaming import Streamin... |
/*
FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of... |
# Copyright 2017-2018 Google Inc. All Rights Reserved.
#
# 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... |
import enum
import typing
from uecp.commands.base import (
UECPCommand,
UECPCommandDecodeElementCodeMismatchError,
UECPCommandDecodeNotEnoughData,
)
from uecp.commands.mixins import InvalidDataSetNumber
class SiteEncoderAddressSetCommandMode(enum.IntEnum):
REMOVE_SINGLE = 0b00
ADD_SINGLE = 0b01
... |
from django.contrib import admin
from .models import Organization, Request
# Register your models here.
class OrganizationAdmin(admin.ModelAdmin):
list_display = ('name', 'owner')
admin.site.register(Organization, OrganizationAdmin)
admin.site.register(Request) |
function townsToJSON(input){
let towns =[];
for (const line of input.slice(1)) {
let slicedLine = line.slice(2,-2);
let [town,latitude,longtitude] = slicedLine.split(' | ');
let townObj = { Town: town, Latitude:
JSON.parse(Number(latitude).toFixed(2)), Longitude: JSON.parse(... |
/** PURE_IMPORTS_START .._Subject,.._util_tryCatch,.._util_errorObject,.._OuterSubscriber,.._util_subscribeToResult PURE_IMPORTS_END */
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
function __() { this.constructor = d; }... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
/**
* 通过 webpack require.context 来动态载入vuex store
* modules目录中的文件名称必须和导出对象名称保持一致
*/
const requireModule = require.context('./modules/', false, /\.js$/)
let modules = {}
requireModule.keys().forEach(fileName => {
const moduleName = fileName.replace(/(\.\/|\.js)/g, '')
modules[moduleName] = requireModule(fileNam... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import actions_pb2 as actions__pb2
class OnlineActionHandlerStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
... |
/* Solution1
exercise
[1,0,2,3,0,4,5,0] , len = 8
0 2 3 4 6 7
in = [1,0,2,3,4,5,0,8] , len = 8
0 2 3 4 5 6 8
out = [1,0,0,2,3,4,5,0]
in = [1,2,3]
0 1 2
algo:
s1. iter from left to right, count 1 while non-0, count 2 while 0, stop while cnt to n-1
s2. set wr_idx to n-1, rd_idx = where we stop... |
#!/usr/bin/env python
# Threat Wrangler
# Created by: nkphysics https://github.com/nkphysics
# License: Apache 2.0
# Dependent libraries
import pandas as pd
import argparse as ap
import os
import pathlib as pl
import requests
import json
import datetime as dt
class Threat_Wrangler(object):
def __init__(self):
st... |
define({"topics":[{"title":"Edition-Section System","shortdesc":"<p class=\"shortdesc\">File organization depends on two basic folder types<\/p>","href":"source\/t_edition_section_system.html","attributes":{"data-id":"t_edition_section_system"},"menu":{"hasChildren":true},"tocID":"t_edition_section_system-d909e2372","n... |
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Controller | events/view/tickets/add order', function(hooks) {
setupTest(hooks);
test('it exists', function(assert) {
let controller = this.owner.lookup('controller:events/view/tickets/add-order');
assert.ok(cont... |
import { logSms, logError } from '../../../shared/logger';
import ApigError from '../ApigError';
import createMessage from '../dynamodb/operations/createMessage';
import invokePusher from './invokePusher';
// Processes an inbound message
export default function processMessage({ id, sender, receiver, content, timestamp... |
from unittest.mock import Mock
import asyncio
import websockets
from interactive_python import Connection, GzipEncoding
from ._util import AsyncTestCase, async_test, resolve, fixture
sample_method = '{"id":0,"type":"method","method":"some_method",' \
'"params":{"foo": 42}}'
class TestInteractiveCon... |
from django.contrib.auth.models import User
from rest_framework import serializers
from .models import CardsList, PackProfile, PDF, RenderSpec
class UserSerializer(serializers.HyperlinkedModelSerializer):
packprofiles = serializers.HyperlinkedRelatedField(many=True,
... |
// Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOINNOOMY_QT_ADDRESSTABLEMODEL_H
#define BITCOINNOOMY_QT_ADDRESSTABLEMODEL_H
#include <QAbstractTableModel>
#incl... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
import React, { Component } from 'react';
// import { connect } from 'react-redux'
import { Button, Layout, message } from 'antd';
// import { hashHistory } from 'react-router'
import {
fetchModuleList, // 获取模块列表
fetchModuleDelete, // 删除模块
fetchModuleDetail, // 获取模块详情
fetchChangeModuleStatus, // 修改模块详情
fetchM... |
const http = require('http');
const express = require('express');
const path = require('path');
const app = express();
const server = require('http').Server(app);
app.use(express.static('./'));
app.use(express.json());
server.listen(9000, function() {
console.log("Server running at: http://localhost:" + 9000)
});... |
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-%typedarray%.prototype.slice
description: >
_TypedArray_.prototype has no own property "slice"
includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
--... |
#include <stdio.h>
int main(){
//do while
do
{
/* code */
} while (/* condition */);
return 0;
}
|
"""
Copyright 2013 Rackspace
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
dist... |
var express = require("express");
var router = express.Router();
var mongoose = require("mongoose");
var Post = mongoose.model("Post");
// if user is authenticated in the session, call the next() to call the next request handler
function isAuthenticated(req, res, next) {
//allow all get request methods
if (req.met... |
# Copyright 2020 Google LLC
#
# 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, ... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from django_orghierarchy.models import Organization
from ..models import DataSource, Event, Image, PublicationStatus
class TestImage(TestCase):
def setUp(self):
user_model = get_user_model()
self.user = user_model.ob... |
# SPDX-FileCopyrightText: 2020 The Magma Authors.
# SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org>
#
# SPDX-License-Identifier: BSD-3-Clause
from typing import Any, Callable, Dict, List, Optional, Type
from common.service import MagmaService
from data_models import transform_for_... |
from irekua_database.models import Role
from .utils import BaseFilter
search_fields = (
'name',
)
class Filter(BaseFilter):
class Meta:
model = Role
fields = (
'name',
)
|
from abc import ABC
from discord.ext import commands
import discord
intents = discord.Intents.default()
startup_extensions = ["Moderation", "Help"]
guild_ids_list = ["ID HERE"] # integer Only
class ScamBot(commands.Bot, ABC):
def __init__(self):
super().__init__(intents=intents, command_prefix=command... |
export default {
html: `
<input>
`,
ssrHtml: `
<input>
`,
async test({ assert, component, target }) {
const input = target.querySelector('input');
assert.equal(input.value, '');
component.x = null;
assert.equal(input.value, '');
component.x = undefined;
assert.equal(input.value, '');
compone... |
from dagster.core.decorator_utils import (
InvalidDecoratedFunctionInfo,
split_function_parameters,
validate_decorated_fn_non_positionals,
validate_decorated_fn_positionals,
)
def decorated_function_one_positional():
def foo(bar):
return bar
return foo
def decorated_function_two_pos... |
import os
import re
import sys
import time
import signal
import traceback
import logging
import boto3
import subprocess
import six
import warnings
import pkgutil
from localstack import constants, config
from localstack.constants import (ENV_DEV, DEFAULT_REGION, LOCALSTACK_VENV_FOLDER,
DEFAULT_PORT_S3_BACKEND, DEFAU... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for the FileFinder flow."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import glob
import hashlib
import io
import os
from absl import app
from future.utils import itervalues... |
# changelog.py - changelog class for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
from .i18n import _
from .node import (
... |
import numpy as np
import rasterio as rio
import skimage as ski
import glob
import os
import click
from rasterio.plot import reshape_as_raster
@click.group()
def cli():
pass
@click.command()
@click.argument('--path', help='path to the ')
def get_sun_elevation_azimuth(path):
with open(path) as f:
metad... |
/*
* Copyright 2010 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrContext_DEFINED
#define GrContext_DEFINED
#include "GrClip.h"
#include "GrColor.h"
#include "GrPaint.h"
#include "GrPathRendererChain.h"
#include "GrRenderTarget.h"... |
#!/usr/bin/env python3
import unittest
import events
class FakeMaterials():
def __init__(self, system_name, body_name = None, lat = None, lon = None, mats = []):
self.system_name = system_name
self.body_name = body_name
self.lat = lat
self.lon = lon
self.mats = mats
... |
// FIXME This is a workaround.
// @see https://github.com/facebook/react/issues/7386
jest.mock('react-dom');
import React from 'react';
import {ConnectedRevertedForm} from './RevertNotification';
import renderer from 'react-test-renderer';
import createStore from '../../redux/create';
const sampleState = './RevertNot... |
import { h } from 'vue'
export default {
name: "SkipForwardCircleFill",
vendor: "Ph",
type: "",
tags: ["skip","forward","circle","fill"],
render() {
return h(
"svg",
{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 256 256","class":"v-icon","fill":"currentColor","data-name":"ph-skip-forwar... |
import { __assign } from "tslib";
import * as React from 'react';
import { StyledIconBase } from '../../StyledIconBase';
export var ArrowRightDown = React.forwardRef(function (props, ref) {
var attrs = {
"fill": "currentColor",
"xmlns": "http://www.w3.org/2000/svg",
};
return (React.createEl... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... |
// @flow
import path from 'path';
import format from 'string-format';
import fs from 'fs-extra';
import R from 'ramda';
import json from 'comment-json';
import logger from '../../logger/logger';
import {
BIT_MAP,
OLD_BIT_MAP,
DEFAULT_INDEX_NAME,
COMPONENT_ORIGINS,
DEFAULT_SEPARATOR,
DEFAULT_INDEX_EXTS,
BI... |
# Copyright (c) 2019 Markus Ressel
# .
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publis... |
"""Init file for Supervisor Docker object."""
from ipaddress import IPv4Address
import logging
import os
from typing import Awaitable
from awesomeversion.awesomeversion import AwesomeVersion
import docker
import requests
from ..coresys import CoreSysAttributes
from ..exceptions import DockerError
from .interface impo... |
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"... |
def run_fancy_dti_analyzes():
# Enables/disables interactive visualization
interactive = False
from dipy.core.gradients import gradient_table
from dipy.data import get_fnames
from dipy.io.gradients import read_bvals_bvecs
from dipy.io.image impo... |
'use strict';
import { Dispatcher } from 'flux';
/** Creates a singlar instance of Facebook's Dispatcher */
const appDispatcher = new Dispatcher();
export default appDispatcher;
|
module.exports = {
entry: "./src/index.tsx",
mode: "development",
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js", ".jsx"],
},
};
|
// @flow
import React, { Component } from 'react';
import { groupBy } from 'ramda';
import { reduxForm, Field, FieldArray, change } from 'redux-form';
import styles from './ServiceDetails.css';
import { ServiceType } from '../../types/service';
import { buildService } from '../../utils/service.utils';
import DockerTask... |
import pyautogui as pag
import time
def Mayo():
time.sleep(.75)
mayoBottleLocation = pag.locateOnScreen('mayoBottle.PNG')
mayoX, mayoY = pag.center(mayoBottleLocation)
pag.moveTo(mayoX, mayoY)
pag.dragTo(859, 241, button = 'left')
while True:
Mayo()
|
#!/usr/bin/env python
import pika
from mist.api import config
QUEUES = ['command', 'machines', 'scripts', 'probe', 'ping',
'rules', 'deployments', 'mappings', 'networks', 'volumes',
'zones', 'buckets', 'default']
def delete_queues():
print('Deleting rabbitmq queues')
host, port = config... |
#!/usr/bin/python
#
# Copyright (C) 2009 Google Inc.
#
# 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 ... |
var path = require('path');
var apos = require('apostrophe')({
shortName: 'apostrophe-test',
// See lib/modules for basic project-level configuration of our modules
// responsible for serving static assets, managing page templates and
// configuring user acounts.
modules: {
// Apostrophe module configu... |
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//
//------------------------------------------------------------------------------
module.exports = function(elem, vars) {
elem
.style("position", "relative")
.style("margin", vars.ui.margin.css)
.style("displ... |
#Escreva um programa em Python que leia um número inteiro qualquer e peça para o usuário escolher qual será a base de conversão:
# para binário, 2 para octal e 3 para hexadecimal.
n = int(input('Escreva um número inteiro: '))
e = int(input('Escolha a base de conversão: \n digite 1 para binário \n digite 2 para octal ... |
__version__ = """1.12.0""" |
import requests
import json
re = requests.get("http://www.fateclins.edu.br/v4.0/vagasEstagioEmprego.php")
html = re.text
htmlFind = html.find('Emprego')
print(re.headers['content-type']) |
//
// MBMrtdDetectorResult.h
// MicroblinkDev
//
// Created by Jura Skrlec on 20/03/2018.
//
#import <Foundation/Foundation.h>
#import "MBMicroblinkDefines.h"
#import "MBQuadWithSizeDetectorResult.h"
#import "MBQuadrangle.h"
NS_ASSUME_NONNULL_BEGIN
/**
* Detector that can perform detection of Machine Readable Tr... |
define([], function()
{
var Button = function (text, callback, url)
{
this.DOM = document.createElement("button")
this.DOM.innerHTML = text
this.DOM.onclick = callback
this.DOM.style.position = 'relative';
this.DOM.style.padding = '4px';
this.DOM.style.margin = '4px';
this.DOM.style.cursor = 'pointer';... |
module.exports={A:{A:{"1":"E B A","2":"J C G TB"},B:{"1":"D X g H L"},C:{"1":"0 2 4 H L M N O P Q R S T U V W u Y Z a b c d e f K h i j k l m n o p q r w x v z t s","2":"1 RB F I J C G E B A D X g PB OB"},D:{"1":"0 2 4 8 x v z t s DB AB SB BB","2":"F I J C G E B A D X g H L M N O P Q R S T U V W u Y Z a b c d e","132":... |
# Copyright (C) 2015-2021 Virgil Security, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistributions of source code must retain the above copyright
# notice, this li... |
#!/usr/bin/env python3
# pylint: disable=no-self-use, too-few-public-methods
"""Test"""
import json
import unittest
from configparser import ConfigParser
import requests
from library.config_parser import config_section_parser
CONFIG = ConfigParser()
CONFIG.read("config/config.cfg")
# HEADERS = {}
# HEADERS['Conten... |
from django import forms
from supplier.models import *
class SupplierForm(forms.ModelForm):
class Meta:
model = Supplier
exclude = ['date','materials'] |
# api/urls.py
from django.conf.urls import url, include
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework.authtoken.views import obtain_auth_token
from .views import CreateView
from .views import DetailsView
urlpatterns = {
url(r'^auth/', include('rest_framework.urls', namespace='r... |
#ifndef SHADER_H
#define SHADER_H
#include <GL/glew.h>
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
class Shader {
public:
unsigned int ID;
Shader(const char *vertexPath, const char *fragmentPath) {
std::string vertexCode;
std::string fragmentCode;
std:... |
/*
* 153. Find Minimum in Rotated Sorted Array
*
* Q: https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/
* A: https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/discuss/716821/Javascript-and-C%2B%2B-solutions
*/
// verbose
let findMin = A => {
let N = A.length,
i = 0,
... |
#include <stdbool.h>
#include <stdlib.h>
#include "serialcon/serialcon.h"
bool add_command(serialcon_connection *conn, const char *cmd) {
list_of_cmds_t *new_elem = (list_of_cmds_t *)malloc(sizeof(list_of_cmds_t));
if (!new_elem)
return false;
new_elem->cmd.cmdline = cmd;
new_elem->cmd.exitcode = -1;
n... |