content stringlengths 10 4.9M |
|---|
<gh_stars>0
#!/usr/bin/env python3
"""
分配与释放IP地址
"""
import socket
class IpaddrNoEnoughErr(Exception):
"""IP地址资源不够
"""
pass
class ip4addr(object):
__base_ipaddr = 0
__mask = 0
__recycle_ips = None
# 当前最大IP地址
__current_max_ipaddr = 0
def __init__(self, ipaddr, mask_size):
... |
<reponame>Rayman2200/cryptobox<gh_stars>1-10
/*
* 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 Lice... |
/**
* registers the service under the given interfaces and sets it's location in the root-context
*/
protected void registerServiceAtRootLocation(Object service, String location, Class<?>... interfazes) {
Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put("location.r... |
def node_controller(message):
mqtt_client.reconnect()
d: dict = parse_line(message + b" 0")
tag: str = d["tags"]["tag"]
Device.objects.update_or_create(tag=tag)
Sensor.objects.update_or_create(
tag=Device.objects.get(tag=tag),
defaults={
"ph_voltage": d["fields"]["ph_volt... |
def quit_and_restart_maestral():
pid = os.getpid()
config_name = os.getenv("MAESTRAL_CONFIG", "maestral")
if is_macos_bundle:
launch_command = os.path.join(sys._MEIPASS, "main")
Popen("lsof -p {0} +r 1 &>/dev/null; {0}".format(launch_command), shell=True)
if platform.system() == "Darwi... |
<reponame>georgeclaghorn/georgix
#[inline(always)]
pub unsafe fn inb(port: u16) -> u8 {
let value: u8;
asm!("in al, dx", in("dx") port, out("al") value, options(nomem, nostack));
value
}
#[inline(always)]
pub unsafe fn outb(port: u16, value: u8) {
asm!("out dx, al", in("dx") port, in("al") value, optio... |
Pebble couldn’t have been pleased with the smartwatch portion of Apple’s Worldwide Developers Conference keynote last week.
Apple seemed to have taken a page straight out of Pebble’s playbook with an Apple Watch feature called Time Travel. Coming this fall in watchOS 2, Time Travel will let users scroll the Watch’s Di... |
// This suite tests the following:
// * That the generated event is consumed by consumer-topic
// * That the consumed event is processed, and an adequate response is generated
// on Kafka response-topic
// * That the aggregate-version is read and applied from event-meta table
// * That the processed event gets stored i... |
But now there are folks in the Brewers' camp who are disappointed right-hander Zack Greinke wasn't chosen and surprised that La Russa said the Milwaukee ace wasn't considered because of his pitching schedule.
The 2009 Cy Young Award winner with the Kansas City Royals is in fact lined up to pitch Saturday, a decision m... |
<reponame>tmunsch/InfoProxy<gh_stars>1-10
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE DeriveGeneric #-}
module ServerPing where
import qualified Data.Text as T
import Data.Aeson
import Data.Maybe (catMaybes)
import Control.Exception
import GHC.Generics
import ... |
<reponame>yandixuan/mybatis-plus
/*
* Copyright (c) 2011-2020, baomidou (<EMAIL>).
* <p>
* 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
* <p>
* https://www.apache.org/licenses/LICENSE-2... |
<gh_stars>0
package com.textrazor;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author GRV
*/
import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.ne... |
<reponame>cyliustack/scout<filename>dt-bench/dist-dnn.py<gh_stars>0
#!/usr/bin/python
import numpy as np
import csv
import json
import sys
import argparse
import multiprocessing as mp
import subprocess
import glob, os
from functools import partial
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OK... |
/// Split the value of an `$interface` reference into a base name and a
/// fragment.
pub fn split_interface_ref(interface_ref: &str) -> (&str, Option<&str>) {
let fragment_pos = interface_ref.find('#');
if let Some(fragment_pos) = fragment_pos {
(
&interface_ref[..fragment_pos],
... |
import I8 from 'i18next';
import en from './en-US.json';
import mn from './mn-MN.json';
const translationGetters = {
// lazy requires (metro bundler does not support symlinks)
'en-US': () => en,
'mn-MN': () => mn,
};
const defaultLocale = 'mn-MN';
const changeLanguage = (languageTag: string = defaultLocale) => ... |
import { ResponsiveValue, ResponsiveValueArray } from '../types';
function normalizeResponsiveValue<T>(
responsiveValue: ReadonlyArray<T>
): ResponsiveValue<T> {
const normalizedResult: ResponsiveValueArray<T | null> = [responsiveValue[0]];
for (let index = 1; index < responsiveValue.length; index++) {
cons... |
At the completion of Boston's season in April, Bruins centerman Patrice Bergeron revealed that he played through the 2016-17 campaign with a sports hernia issue that ended up requiring offseason surgery.
Despite the injury, Bergeron produced respectable offensive numbers (21 goals, 32 assists) while earning his fourth... |
/**
* Tests equals() if the expected result is true.
*/
@Test
public void testEqualsTrue()
{
FileExtensionFilter filter = new FileExtensionFilter(DESC, "tst", "eq");
FileExtensionFilter c = new FileExtensionFilter(
TextResource.fromText(DESC.getPlainText()),
... |
<filename>src/main/java/nl/mvdr/adventofcode/adventofcode2018/day03/SlicePart1.java
package nl.mvdr.adventofcode.adventofcode2018.day03;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Solution to the day 3 puzzle of 2018's Advent of ... |
# coding: utf-8
# ------Matheus Barbosa de Freitas-----
#30/11/2016
integers = map(int, raw_input().split())
shovel_price = integers[0]
r = integers[1]
a = shovel_price % 10
shovel_qnt = 0
if a == r:
shovel_qnt = 1
elif a == 5:
shovel_qnt = 2
else:
b = a
shovel_qnt = 0
while (... |
/**
* bnx2i_show_ccell_info - returns command cell (HQ) size
* @dev: device pointer
* @buf: buffer to return current SQ size parameter
*
* returns per-connection TCP history queue size parameter
*/
static ssize_t bnx2i_show_ccell_info(struct device *dev,
struct device_attribute *attr, char *buf)
{
struc... |
<filename>aoc-2021/day10.py
import aoc
import numpy as np
data = "[({(<(())[]>[[{[]{<()<>> [(()[<>])]({[<{<<[]>>( {([(<{}[<>[]}>{[]{[(<()> (((({<>}<{<{<>}{[]{[]{} [[<[([]))<([[{}[[()]]] [{[{({}]{}}([{[{{{}}([] {<[[]]>}<{[{[{[]{()[[[] [<(<(<(<{}))><([]([]() <{([([[(<>()){}]>(<<{{ <{([{{}}[<[[[<>{}]]]>[]]".split()
data... |
<filename>com.yasoon.jira/dialogs/renderer/fields/SingleTextField.ts<gh_stars>1-10
/// <reference path="../Field.ts" />
/// <reference path="../getter/GetTextValue.ts" />
/// <reference path="../setter/SetValue.ts" />
@getter(GetterType.Text)
@setter(SetterType.Text)
class SingleTextField extends Field {
get... |
package service_test
import (
"errors"
"github.com/containerssh/service"
)
type testService struct {
crash chan bool
name string
crashStartup bool
}
func (t *testService) String() string {
return t.name
}
func (t *testService) RunWithLifecycle(lifecycle service.Lifecycle) error {
if t.crashSt... |
import _ from "lodash";
import { ActionType, PendingDecisionType } from "../../../dto/enums";
import { ActionDto, PendingDecisionDto, SortableIncomeDto } from "../../../dto/interfaces";
import { ActionWorkflow } from "../action-workflow.base";
import { ActiveView, Command, CommonWorkflowStates } from "../types";
const... |
Rep. Joe Walsh (R-Ill.) held another lively town hall meeting this weekend, playing host to a constituent who accused President Barack Obama of "sedition" because he had allegedly lied to voters about his true political allegiances to "socialism, communism and Nazism."
In a discussion about health care reform, a woman... |
// FetchLastTxUntilHeight returns the last tx before a height, inclusive, of specified hash
func (c *chainFetcher) FetchLastTxUntilHeight(txsha *wire.Hash, height uint64) (*wire.MsgTx, error) {
rep, err := c.db.FetchTxBySha(txsha)
if err != nil && err != storage.ErrNotFound && err != database.ErrTxShaMissing {
retu... |
const tdistribution = {
'5': [12.71, 4.303, 3.182, 2.776, 2.571, 2.447, 2.365, 2.306, 2.262, 2.228, 2.201, 2.179, 2.160, 2.145, 2.131, 2.120, 2.110, 2.101, 2.093, 2.086, 2.080, 2.074, 2.069, 2.064, 2.060, 2.056, 2.052, 2.048, 2.045, 2.042, 2.042, 2.042, 2.042, 2.042, 2.042, 2.042, 2.042, 2.042, 2.042, 2.021, 2.021, 2... |
FinTech FinTech Impact on Consumer Behavior – Mobile Payments
Understanding the concept of FinTech and its importance to the entire world is just the first step along the way. For businesses, innovations in the FinTech world will change the way they do business forever. From a consumer point of view, new and innovativ... |
/**
* Resource builder responsible for creating and opening an AmqpConnection instance.
*/
public class AmqpConnectionBuilder extends AmqpResourceBuilder<AmqpConnection, AmqpProvider, JmsConnectionInfo, Connection> {
private static final Logger LOG = LoggerFactory.getLogger(AmqpConnectionBuilder.class);
pub... |
##__________________________________________________________________
##
## Author: GogolGrind
##__________________________________________________________________
from sys import *
from math import *
def solve():
n = int(input())
f = []
for i in range(n):
f.append([e for e in inpu... |
def evaluate_p(self, X, best_p, p_range=(0, 1), sample_density=100):
return np.mean((best_p - self.estimate_best_p(X, p_range, sample_density)) ** 2) |
<filename>3.JavaCollections/task26/task2613/exception/NotEnoughMoneyException.java
package com.javarush.task.task26.task2613.exception;
public class NotEnoughMoneyException extends Exception {
}
|
#pragma once
#include <string>
#include <vector>
#include <typeindex>
#include <variant>
#include "Export.h"
namespace drea::core {
using OptionValue = std::variant<std::monostate,bool,int,double,std::string>;
struct DREA_CORE_API Option
{
enum class Scope {
Both,
File,
Line,
None
};
std::string mN... |
// Search searches and update lights for some time using SSDP and
// fills the map with new lights found indexed by its ID. lightfound
// is called with the newly found light, usually to start listening it
func Search(time int, localAddr string, lights map[string]*Light, lightfound func(light *Light)) error {
err := s... |
/* unsigned int HashTable::KeyToIndex(register char * string)
**
** Creates an index from <string> which is the url to be used in the hash table
** Used before lookup(), insert() and remove()
**
*/
unsigned int
HashTable::KeyToIndex(register char *string)
{
register unsigned int result;
register int c;
result =... |
Very compact connector for coupling optical fibers to high-power laser
This work presents the description of a very compact optical connector for coupling high-power laser radiation (Nd:YAG) to optical fibers. GRIN-rod lenses have been used because they have several characteristics (such as small dimensions, plane and... |
import { autoinject } from 'aurelia-framework';
import { App } from '../../app';
import { IPrinter } from '../../printer';
@autoinject
export class ScreenEditBed {
isHidden: boolean = true;
private state: number;
private tempActive: number;
private tempStandby: number;
private autoBedLevelingEna... |
#ifndef INTROSORT_HPP
#define INTROSORT_HPP 1
#include <algorithm>
#include <cmath>
#include <iterator>
#include "heapsort.hpp"
#include "insertionSort.hpp"
#include "quicksort.hpp"
namespace Introsort {
const size_t SORT_THRESHOLD = 16;
template<class BidirIt, class Compare, typename = std::enable_if_t<std::is_b... |
TEL AVIV – The sister of a Palestinian terrorist who plowed his truck into a group of soldiers in Jerusalem on Sunday, killing four and wounding 16, said the family was “thankful” for his “most beautiful martyrdom.”
“Praise be to Allah that he became a martyr. It is the most beautiful kind of saintly death,” Fadi al Q... |
/// Converts the RunnerArgs to a run.py command line invocation.
fn as_cmd(&'a self) -> Vec<String> {
use std::ops::Add;
// Add features for build
let kernel_features = String::from(self.kernel_features.join(","));
let user_features = String::from(self.user_features.join(","));
l... |
/**
* Table renderer based on the core PagedTable widget.
*/
@ApplicationScoped
@Named(SelectorRenderer.UUID + "_renderer")
public class SelectorRenderer extends AbstractRendererLibrary {
public static final String UUID = "Standard";
@PostConstruct
private void init() {
RendererLibLocator.get().... |
<filename>kalmfl/disambiguation/main/java/edu/stonybrook/cs/frame/Role.java
package main.java.edu.stonybrook.cs.frame;
import java.util.*;
import it.uniroma1.lcl.babelnet.BabelSynset;
import main.java.edu.stonybrook.cs.correction.SynsetOverride;
import main.java.edu.stonybrook.cs.utils.BabelNetConnector;
import main.... |
<filename>src/main/java/ru/sosnov/projectmanagement/controller/LoginController.java
package ru.sosnov.projectmanagement.controller;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PostMapping... |
Involvement of sigma 54 in exponential silencing of the Pseudomonas putida TOL plasmid Pu promoter.
The sigma 54-dependent Pu promoter of the TOL plasmid pWW0 of Pseudomonas putida becomes activated by the prokaryotic enhancer-binding XyIR protein when cells encounter m-xylene in the medium. However, even in the prese... |
<reponame>denysvitali/blurz
use dbus::{Connection, BusType, Message, MessageItem, Props};
use std::error::Error;
static ADAPTER_INTERFACE: &'static str = "org.bluez.Adapter1";
static DEVICE_INTERFACE: &'static str = "org.bluez.Device1";
static SERVICE_INTERFACE: &'static str = "org.bluez.GattService1";
static CHARACTE... |
def sections(row):
text = row.get("title")
abstract = row.get("abstract")
if abstract:
text += " " + abstract
return [(None, text)] |
<filename>src/csic/iiia/ftl/learning/lazymethods/similarity/Debug.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Copyright (c) 2013, <NAME> All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are p... |
package com.ctrip.hermes.metaserver.event;
import java.util.concurrent.ExecutorService;
import com.ctrip.hermes.metaserver.cluster.ClusterStateHolder;
/**
* @author <NAME>(<EMAIL>)
*
*/
public interface EventBus {
void pubEvent(Event event);
ExecutorService getExecutor();
void start(ClusterStateHolder clust... |
/// Enqueue a single packet with the given header into the buffer, and
/// return a reference to its payload, or return `Err(Error::Exhausted)`
/// if the buffer is full, or return `Err(Error::Truncated)` if the buffer
/// does not have enough spare payload space.
pub fn enqueue(&mut self, size: usize, header: H) -> Re... |
def extract(filing_json):
filing_contents = {}
if not os.path.exists(filing_json['extracted_filing_directory']) and not os.path.exists(filing_json['extracted_filing_directory'] + ".zip"):
logger.info("\n\n\n\n\tExtracting Filing Documents:\n")
try:
filing_contents = extract_complete_... |
export function assertRequiredType(config: any, property: string, type: 'string' | 'number' | 'boolean') {
if (typeof config[property] !== type) {
throw new Error(`The required "${property}" property needs to be a ${type}.`);
}
}
export function assertOptionalType(config: any, property: string, type: 'string' ... |
#pragma once
#include "Json2Settings.h"
class Settings
{
public:
using bSetting = Json2Settings::bSetting;
Settings() = delete;
static bool LoadSettings(bool a_dumpParse = false);
static bSetting disableDialogueCollision;
static bSetting disableAllyCollision;
private:
static constexpr char FILE_NAME[] = ... |
Bakunin vs. Marx By Ulli Diemer
I propose in this article to examine some of the most common anarchist objections to "Marxism". The issues I shall single out are all raised in the recent works cited in the preceding article ( Anarchism vs. Marxism ). All of them were raised, often for the first time, by Bakunin at the... |
<gh_stars>0
#[doc = "Writer for register INTCLR"]
pub type W = crate::W<u32, super::INTCLR>;
#[doc = "Register INTCLR `reset()`'s with value 0"]
impl crate::ResetValue for super::INTCLR {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Write proxy for field `FU... |
/**
* @author Santhosh Kumar Tekuri
*/
class BlockingCallListener implements CallListener{
public ResultMessage result;
public WAMPException error;
@Override
public void onResult(WAMPClient client, ResultMessage result){
synchronized(this){
this.result = result;
notify... |
// queryJSON executes the query in builder and loads the resulting JSON into
// a bytes slice compatible.
//
// Returns ErrNotFound if nothing was found
func (ex *Execer) queryJSONFn() ([]byte, error) {
fullSQL, args, blob, err := ex.cacheOrSQL()
if err != nil {
return nil, err
}
if blob != nil {
return blob, n... |
Low dissolved oxygen levels increase stress in piava (Megaleporinus obtusidens): iono-regulatory, metabolic and oxidative responses.
The aquatic environment presents daily and/or seasonal variations in dissolved oxygen (DO) levels. Piava faces different DO levels in the water due to its distributional characteristics.... |
Localized variation in the ocean's transmission properties: Its drastic effect on a sonar display
A ship-positioning sonar system repeatedly experienced severe problems while operating in rough seas. The visual display for this system is a CRT screen with a bright spot that represents the position of an undersea beaco... |
Controversial tycoons' turbulent Kop years
With their ill-fated tenure at Anfield set to end - and not without a fight -charts the disastrous reign of 'Uncle George and Tom'...Dubai International Capital (DIC) pull out of a takeover bid after they try in vain to force Liverpool to come to a decision while the club's b... |
// preloadBootstrapFromRuntime tries to load the runtime image from tarballs, using both the
// default registry, and the user-configured registry (on the off chance they've retagged the
// images in the tarball to match their private registry).
func preloadBootstrapFromRuntime(imagesDir string, resolver *images.Resolv... |
/**
* abstract class to be used by every technology-specific implementation
*/
@Slf4j
public abstract class Adapter extends TestAbstractHandler {
private static final String CHECKFAILED = "check failed:\n";
@Autowired
protected OpenTestingConfig openTestingConfig;
@Autowired
private JwtReceiver... |
// Code generated by MockGen. DO NOT EDIT.
// Source: txnotice.go
// Package p2pmock is a generated GoMock package.
package p2pmock
import (
types "github.com/Cofresi/aergo/types"
gomock "github.com/golang/mock/gomock"
reflect "reflect"
)
// MockTxNoticeTracer is a mock of TxNoticeTracer interface
type MockTxNoti... |
<gh_stars>1-10
// type C only
export interface AmedasDataMini {
temp: [number, number];
snow1h: [number, number];
snow6h: [number, number];
snow12h: [number, number];
snow24h: [number, number];
sun10m: [number, number];
sun1h: [number, number];
precipitation10m: [number, number];
precipitation1h: [nu... |
On a Study of Magnetic Force Evaluation by Double-Layer Approach
The double-layer approach (DLA) possesses superior features for the analysis of static electromagnetic problems. In this article, dealing with the magnetostatic analysis, we introduce two kinds of double layers: the first one on the surface of the magnet... |
/**
* Return true if the stream looks like the contents of a zip file.
* Checks only the magic number, not the whole file for validity. The
* stream will be marked and reset to its current position.
* @param in a stream open on possible zip file content
* @throws IOException
*/
public static boolean ... |
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vii vector<vi >
#define foi(x) for(int i=0;i<x;i++)
vii vec;
vi cnt;
vector<double> res;
void calc_child(int x)
{
int ans=0;
foi(vec[x].si... |
package main
import (
"io/ioutil"
"log"
"os"
"github.com/james-lawrence/bw/agent/acme"
"github.com/james-lawrence/bw/internal/x/protox"
)
func main() {
var (
challenge *acme.ChallengeResponse
)
log.Println("args", os.Args)
priv, err := ioutil.ReadFile(os.Args[1])
if err != nil {
log.Fatalln("failed to... |
<filename>FormularServer/src/main/java/io/github/formular_team/formular/core/geom/FrenetFrames.java
/*
* Copyright 2012 <NAME>, <EMAIL>
*
* This file is part of Parallax project.
*
* Parallax is free software: you can redistribute it and/or modify it
* under the terms of the Creative Commons Attribution 3.0 Unpor... |
<gh_stars>1-10
package geodbtools
import (
"bytes"
"testing"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
)
//go:generate mockgen -package geodbtools -self_package github.com/anexia-it/geodbtools -destination mock_format_test.go github.com/anexia-it/geodbtools Format
func TestRegisterFor... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,arr[101];
cin>>n;
for(int i=0;i<n;i++)cin>>arr[i];
int even=0,odd=0;
for(int i=0;i<n;i++){
if(arr[i]%2==0){
even++;
}
else{
odd++;
}
}
bool che=false,cho=... |
# Little Petya very much likes gifts. Recently he has received a new laptop as a New Year gift from his mother. He immediately decided to give it to somebody else as what can be more pleasant than giving somebody gifts. And on this occasion he organized a New Year party at his place and invited n his friends there.
... |
The row over housing benefit has led to warnings of "social cleansing". But can those on low incomes really have an entitlement to stay in expensive localities?
They are postcodes synonymous with wealth and aspiration; the kind of districts that attract estate agents, upmarket retail chains and endless TV property sho... |
Sorafenib-Related Adverse Events in Predicting the Early Radiologic Responses of Hepatocellular Carcinoma
Background Hepatocellular carcinoma (HCC) has a poor prognosis with low chemotherapeutic efficiency to medications except to sorafenib. Previous studies showed that adverse events (AEs) of sorafenib can predict th... |
<reponame>vecin2/em-dev-tools
from jinja2 import Environment, meta, Template, nodes, FileSystemLoader, select_autoescape
import pytest
import sys
from anytree import Node
from sql_gen.sql_gen.filter_loader import load_filters
import os
templates_path =os.environ['SQL_TEMPLATES_PATH']
env = Environment()
load_filters(e... |
// Extracts input/output sharding configuration of `cluster_func` by parsing
// XlaSharding ops inside the `cluster_func`.
void IdentifyXlaShardingForTPUComputation(
Builder* builder, tf_device::ClusterFuncOp cluster_func) {
FuncOp func = cluster_func.getParentOfType<ModuleOp>().lookupSymbol<FuncOp>(
cluste... |
<reponame>Beliaar/bGrease<gh_stars>1-10
import unittest
class TestCollisionComp(dict):
def __init__(self):
self.new_entities = set()
self.deleted_entities = set()
def set(self, entity, left=0, bottom=0, right=0, top=0, radius=0,
from_mask=0xffffffff, into_mask=0xffffffff,):
if entity in self:
data = sel... |
<gh_stars>0
# Main file for my mac changer
# So we can run command line processes in our python code
import subprocess
# To take inpout from the user
import optparse
# Used so we can work with regular expressions
import re
#----------------------------------------------------------------------------------------------... |
def findSum(n, r,c, lim, grid):
for i in range(lim):
for j in range(lim):
if grid[r][i] + grid[j][c] == n: return True
return False
def main():
n = int(input())
grid = []
for i in range(n):
grid.append([ int(n) for n in input().split()])
... |
/**
* @return the Unity Editor version resolved from String resources, or <code>null</code> if the
* value was not present. This method can be invoked directly; access via the instance method
* from UnityVersionProvider is provided to support mocking while testing.
*/
@Nullable
public static synch... |
<reponame>vcubells/tc1031
//
// Persona.hpp
// ordenamiento_generico
//
// Created by <NAME> on 04/09/20.
// Copyright © 2020 <NAME>. All rights reserved.
//
#ifndef Persona_hpp
#define Persona_hpp
#include <iostream>
class Persona {
private:
std::string nombre;
int edad;
public:
Persona():P... |
package insider_test
import (
"context"
"testing"
"github.com/insidersec/insider"
"github.com/insidersec/insider/engine"
"github.com/insidersec/insider/report"
"github.com/insidersec/insider/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type fakeEngine struct {
resul... |
<filename>src/devices/uart/device.rs
use std::collections::VecDeque;
use std::sync::{Arc, Mutex};
use std::thread::{self, JoinHandle};
use std::time::Duration;
use crossbeam_channel::{self as chan, select};
use crate::devices::{vic::Interrupt, Device, Probe};
use crate::memory::{MemException::*, MemResult, Memory};
... |
def update_progress(progress, target):
progress_percent = 100.0 * float(progress) / target
sys.stdout.write("\rProgress: {:.2f}% ({}/{} tasks finished)".format(progress_percent, progress, target))
sys.stdout.flush() |
/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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 app... |
def run_with_config(self, config):
task = Task(
self.train_fn,
{'args': self.args, 'config': config},
DistributedResource(**self.resource)
)
reporter = FakeReporter()
task.args['reporter'] = reporter
return self.run_job(task) |
// PendingManaOnOutput predicts how much mana (bm2) will be pledged to a node if the output specified is spent.
func PendingManaOnOutput(outputID ledgerstate.OutputID) (float64, time.Time) {
cachedOutputMetadata := Tangle().LedgerState.OutputMetadata(outputID)
defer cachedOutputMetadata.Release()
outputMetadata := c... |
<filename>src/services/translations/index.ts
import { Platform, NativeModules } from 'react-native';
import I18n from 'i18n-js';
import pt_BR from './pt_BR';
import en from './en';
const deviceLanguage: string =
Platform.OS === 'ios'
? NativeModules.SettingsManager.settings.AppleLocale ||
NativeM... |
import Avatar from 'components/post-avatar';
import Date from 'components/date-formatter';
import CoverImage from 'components/post-cover-image';
import PostTitle from 'components/post-title';
import CardIcons from 'components/card-icons';
import Author from 'types/author';
import TechIcons from 'types/tech-icons';
typ... |
According to boxer Mike Tyson, “Everybody has a plan until they get punched in the face.”
Industrial civilization punched the planet in the face, repeatedly. We wonder why Earth isn’t the same planet with which we grew up. We offer apologies, including recycling and hybrid automobiles, but we’re unwilling — as a socie... |
<reponame>mateuszwwwrobel/Expense_Tracker_Django
from datetime import datetime
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models import Sum
categories = (
('Food', 'Food'),
('Takeaway', 'Takeaway'),
('Entert... |
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature((int) Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_select_building);
app = (AnyplaceApp) getApplication();
mAnyplaceC... |
/// Control 1 Register
pub mod CTRL1 {
/// This 3-bit field defines the length of the Propagation Segment in the bit time
pub mod PROPSEG {
/// Offset (0 bits)
pub const offset: u32 = 0;
/// Mask (3 bits: 0b111 << 0)
pub const mask: u32 = 0b111 << offset;
/// Read-only v... |
<filename>lib/googlecloudsdk/command_lib/sql/import_util.py<gh_stars>0
# -*- coding: utf-8 -*- #
# Copyright 2017 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... |
def send_data(self, **kwargs):
request_type = "input/"
url = self.base_url + request_type + self.public_key + '?' + 'private_key=' + self.private_key
response = requests.post(url, kwargs)
if response.status_code != 200:
print ("Request was not successful:\n" + response.text)
... |
<filename>aidos/node_emulation_test.go<gh_stars>1-10
// Copyright (c) 2017 Aidos Developer
// 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... |
While the US and UK stand by Israel over its military offensive in Gaza, governments across Latin America have moved to cut their links.
In a series of coordinated diplomatic and financial measures, Latin America is making a stand, heavily criticising Israel and cutting ties with the Jewish state, writes Channel 4 New... |
// AI_Character.h
//
//////////////////////////////////////////////////////
#ifndef __AI_CHARACTER_H__
#define __AI_CHARACTER_H__
#include "Type.h"
#include "State.h"
#include "OResultDef.h"
class Obj;
class Obj_Character;
class AI_Character
{
friend class State;
friend class AIScript;
public:
AI_Chara... |
/**
* Create an instance of the SQLiteStorageAdapter using a specific database name.
* For testing purposes only.
* @param schemaRegistry The schema registry for the adapter.
* @param modelProvider The model provider with the desired models.
* @param databaseName The name of the database file.
... |
package com.tybob12.xycraft.tileentity;
import com.tybob12.xycraft.block.BlockEnergyNodeCore;
import com.tybob12.xycraft.init.HexBlocks;
import com.tybob12.xycraft.init.HexConfig;
import com.tybob12.xycraft.util.HexDevice;
import com.tybob12.xycraft.util.HexEnergyNode;
import com.tybob12.xycraft.util.HexUtils;
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.