content stringlengths 10 4.9M |
|---|
<filename>exercism/armstrong-numbers/src/lib.rs
pub fn is_armstrong_number(num: u32) -> bool {
let digit_count = (num as f64).log10() as u32 + 1;
let digit_sum: u32 = num.to_string()
.chars()
.map(|x| x.to_digit(10).unwrap().pow(digit_count))
.sum();
digit_sum == num
}
|
<filename>test/Test/Syntax/Parser.hs
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
module Test.Syntax.Parser where
import Preql.QuasiQuoter.Syntax.Name
import Preql.QuasiQuoter.Syntax.Parser
import Preql.QuasiQuoter.Syntax.Syntax
import qualified Preql.QuasiQuoter.Syntax.Lex as L
... |
// fromHeaderColumnValue returns the value from the DoltResultRecord for the given
// header field
func fromHeaderColumnValue(h string, r *MemoryResultRecord) (string, error) {
var val string
switch h {
case "test_file":
val = r.TestFile
case "line_num":
val = fmt.Sprintf("%d", r.LineNum)
case "query_string":
... |
def parse(fmt: str, binary_buffer, repeat: bool = False) -> Any:
result = []
while _len_remaining(binary_buffer) > 0:
i = 0
while i < len(fmt):
c = fmt[i]
if c == "[":
size = struct.calcsize("I")
repeat_next = struct.unpack("I", binary_buff... |
/*
* BSD 2-Clause License
*
* Copyright (c) 2020, <NAME> All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this ... |
Relationship of pionium lifetime with pion scattering lengths in generalized chiral perturbation theory
The pionium lifetime is calculated in the framework of the quasipotential-constraint theory approach, including the sizable electromagnetic corrections. The framework of generalized chiral perturbation theory allows... |
/*
Copyright 2021 The terraform-docs Authors.
Licensed under the MIT license (the "License"); you may not
use this file except in compliance with the License.
You may obtain a copy of the License at the LICENSE file in
the root directory of this source tree.
*/
package reader
import (
"bufio"
"errors"
"fmt"
"io... |
<gh_stars>0
package com.github.bednar.telb.bindings;
import java.util.concurrent.ConcurrentHashMap;
import ognl.Ognl;
import ognl.OgnlException;
import org.apache.tapestry5.Binding;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.ioc.Location;
import org.apache.tapestry5.ioc.internal.util.... |
def list(self, name=None):
try:
if name is None:
inst_types = flavors.get_all_flavors()
else:
inst_types = flavors.get_flavor_by_name(name)
except db_exc.DBError as e:
_db_error(e)
if isinstance(inst_types.values()[0], dict):
... |
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { TimeDatePipe } from '../../../@core/pipe';
import { ChangelogService } from '../change-log.service';
@Component({
selector: 'ngx-get-audit-id... |
<reponame>hankolsen/advent-of-code-1<gh_stars>0
import * as util from '../../../util/util';
import * as test from '../../../util/test';
import chalk from 'chalk';
import { log, logSolution } from '../../../util/log';
import { performance } from 'perf_hooks';
import { getRows } from '../../../util/input';
const YEAR = ... |
package cucumber.runtime.groovy;
import groovy.lang.Closure;
public class Hooks {
public static void World(Closure body) throws Throwable {
GroovyBackend.registerWorld(body);
}
}
|
<reponame>pyxyyy/conv-texpy<filename>texpy/main.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Turk experiment helper.
This utility helps you manage the lifecycle of crowd-work tasks on
Amazon Mechanical Turk (AMT). Here's a simple diagram of a typical
lifecycle:
init†
↓
new ---> view ---> launch --> s... |
<reponame>garf1242/gopass<gh_stars>0
// +build !windows
package action
import (
"context"
"io/ioutil"
"os"
"path/filepath"
"github.com/gopasspw/gopass/pkg/config"
"github.com/gopasspw/gopass/pkg/jsonapi/manifest"
"github.com/gopasspw/gopass/pkg/out"
"github.com/gopasspw/gopass/pkg/termio"
"github.com/fatih... |
A cosmic gas cloud seemingly destined for a deadly encounter with the gigantic black hole at the core of the Milky Way has surprisingly survived a close pass by the monster's maw.
The reason, a team of astronomers now argues, is that it wasn't a gas cloud after all. Instead, they claim the mystery cloud dubbed "G2" wa... |
<filename>PipelinesTasks/PRMetrics/src/task/tests/testCollateral/index.noGitHistory.ts
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import * as path from 'path'
import * as taskLibMockAnswer from 'azure-pipelines-task-lib/mock-answer'
import * as taskLibMockRun from 'azure-pipelines-task-... |
/** A module for transition demo dependencies. */
@Module
public abstract class TransitionDemoModule {
@ActivityScope
@ContributesAndroidInjector
abstract TransitionMusicDemoActivity contributeTransitionMusicDemoActivity();
@FragmentScope
@ContributesAndroidInjector
abstract TransitionMusicAlbumDemoFragme... |
// loads a font and ignores error
// TODO: provide default font if not found
func loadFont(name, style string, size int) font.Face {
size = int(float64(size) * 1.4)
fdb := fonts.GetFontDatabase()
fface, err := fdb.GetFont(name, style, size)
if err != nil {
fmt.Printf("Error: font %s, %s, %d not found.\n", name, s... |
import { ok } from "assert";
import Template from "../../templates/template";
import { getBlock, walk } from "../../traverse";
import {
ArrayExpression,
ArrayPattern,
AssignmentExpression,
BinaryExpression,
BlockStatement,
CallExpression,
ConditionalExpression,
Identifier,
Literal,
MemberExpression,... |
Runt-related Transcription Factor 3 Promoter Hypermethylation and Gastric Cancer Risk: A Meta-analysis
Abstract Objective The aim of this study was to investigate the correlation between runt-related transcription factor 3 (RUNX3) gene promoter hypermethylation and gastric cancer risk by meta-analysis. Methods By sear... |
// send a million string documents
func millionstr(w http.ResponseWriter, r *http.Request) {
for i := 0; i < 10000000; i++ {
docId := i % docs.number
bytes := docs.docMapStr[docs.docList[docId]]
fmt.Fprintf(w, bytes)
fmt.Fprintf(w, "\n\n")
}
} |
Conductivity, Surface Tension, and Comparative Antibacterial Efficacy Study of Different Brands of Soaps of Nepal
-e current study aims to evaluate the solution properties and antibacterial efficacy study of five different brands of toilet soaps of Nepal such as Okhati (OKT), Lifebuoy (LFBY), Lux (LX), Liril (LRL), an... |
/**
* \brief Set the user visible VERT_CS name.
*
* This method is the same as the C function OSRSetVertCS().
* This method will ensure a VERT_CS node is created if needed. If the
* existing coordinate system is GEOGCS or PROJCS rooted, then it will be
* turned into a COMPD_CS.
*
* @param pszVertCSName the us... |
<reponame>symfund/microwindows<filename>src/contrib/TinyWidgets/include/tnButton.h
/*Header file for the Push Button widget
* This file is part of `TinyWidgets', a widget set for the nano-X GUI which is * a part of the Microwindows project (www.microwindows.org).
* Copyright C 2000
* <NAME> <<EMAIL>>
* <NAME> <<E... |
def create_data(self):
times, lats, lons = np.arange(0, 39, 6), np.arange(70, 30, -1), np.arange(-50, 50)
for coordinate, label, levtype, coord_levels, variables in (
("air_pressure", "PRESSURE_LEVELS", "pl",
("atmosphere_pressure_coordinate",
np.array(... |
def _free(self):
self._buffer = None
self._obj_path = None
self._alias_values = None
self._alias_def_template = None
self._alias_def_buffer_index = None |
<gh_stars>0
from cogdl.experiments import check_experiment
from tabulate import tabulate
import json
import os
def load_hyperparameter_config():
path = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + 'configs.json'
with open(path, 'r') as file:
configuration = json.load(file)
return con... |
/*
* call-seq:
* Process::GID.grant_privilege(group) -> integer
* Process::GID.eid = group -> integer
*
* Set the effective group ID, and if possible, the saved group ID of
* the process to the given _group_. Returns the new
* effective group ID. Not available on all platforms.
*
*... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley NV
#
# 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 l... |
mod control;
mod state;
use anyhow::{Context, Result};
use std::error::Error;
use structopt::StructOpt;
use state::State;
#[derive(Debug, StructOpt)]
#[structopt(
name = "g14-perf-control",
about = "A small tool to control performance settings on your Asus G14"
)]
struct G14PerfControl {
#[structopt(shor... |
/**
* This method will return true and break if country got removed and this method
* is common for both commandline and GUI
*
* @param countryName the name of the country you want to check duplicate for
*
* @return false if duplicate not found
*/
public boolean deleteCommonCountry(String countryName) {... |
def build_linux(self):
print(f" > building for linux...")
os.chdir(self.src_folder)
os.system("make -f Makefile.linux")
os.chdir(self.working_dir) |
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
module Data.Aviation.PilotLogbook where
import Data.Aviation.PilotLogbook.Runwa... |
<gh_stars>0
/*
* This file is meant to setup our Interrupt Desccriptor Table with
* - Interrupt Requests (IRQ's) and Interrupt Service Routines (IRS's).
* - This file will also assign functions to use to handle the issued
* - interrupts.
*/
#include "isr.h"
#include "idt.h"
#include "ports.h"
#include "timer.h"
#... |
/**
* Tests for the {@link DefaultClusterClientServiceLoader}.
*/
public class ClusterClientServiceLoaderTest {
private static final String VALID_TARGET = "existing";
private static final String AMBIGUOUS_TARGET = "duplicate";
private static final String NON_EXISTING_TARGET = "non-existing";
private static fina... |
def split(self):
if self.width is None:
port_split = [self.name]
else:
port_split = [f"{self.name}[{i}]" for i in range(int(self.lsb), int(self.msb) + 1)]
return port_split |
def station_bar_plot(summary_csv, layer, out_dir=None, x_label=None,
y_label=None, title=None, subtitle=None, year_subtitle=True):
if not Path(summary_csv).is_file():
err_msg = '\n{} is not a valid path to a summary CSV file!'.\
format(summary_csv)
raise FileNotFoundError(er... |
def _get_percentage(self, date, dynamic_extra_cost_type):
usage_types = dynamic_extra_cost_type.division.all()
assert abs(sum([s.percent for s in usage_types]) - 100) < 0.01
return usage_types |
Long-Term Outlook for World Oil Demand
Population, national and per capita income increase will be reflected in greater energy demand. By 2010 30% larger than in 1990 for OECD countries and 120% for the rest of the world. The share of oil in primary energy demand is expected to decline from the present 39.5% to 37%. N... |
/**
* Execute all the buffered sql commands in the batch.
* @throws SQLException
*/
private void executeBatchAndCommit() throws SQLException {
if (currentBatchSize == 0) {
return;
}
statement.executeBatch();
numBatches++;
connection.commit();
statement.clearBatch();
committedB... |
def pair_uv_to_hf(network, volmesh):
uv_hf_dict = {}
for u, v in network.edges():
u_hfkey, v_hfkey = volmesh.cell_pair_halffaces(u, v)
uv_hf_dict[(u, v)] = u_hfkey
return uv_hf_dict |
def force_unlock():
global timeout_before_override
timeout_backup = timeout_before_override
timeout_before_override = 0
try:
get_lock(min_wait=0, max_wait=0.001)
release_lock()
finally:
timeout_before_override = timeout_backup |
def modify(self, new_rate=None, new_amount=None):
self.api.modify_order(self, new_rate, new_amount) |
<reponame>alexmagwe/eventQ
import type { NextPage } from 'next'
import Head from 'next/head'
import Link from 'next/link'
import styles from '../styles/Home.module.css'
import {useAuthState} from 'react-firebase-hooks/auth'
import Hero from '../components/Hero'
import { auth } from '../firebase/client'
import Login fro... |
import math
K = int(input())
gcdSum = 0
myDict = {}
for iIndx in range(1, K+1):
for jIndx in range(1, iIndx+1):
presGcd = math.gcd(iIndx, jIndx)
if (presGcd in list(myDict.keys())) and (iIndx == jIndx):
myDict[presGcd] += 1
elif (presGcd in list(myDict.keys())) and (iIndx != j... |
.
OBJECTIVE
To discuss treatments of spinal polyostotic fibrous dysplasia (PFD) and their clinical outcomes.
METHODS
A group of spinal PFD patients treated in orthopaedic department of Peking University Third Hospital from January 2005 to December 2010 was retrospectively reviewed. There were 3 males and 1 female. T... |
/**
* Testcases that verify the implementation of {@link ImmutableOntology}
*
* @author Unknowns
* @author <a href="mailto:HyeongSikKim@lbl.gov">HyeongSik Kim</a>
*/
public class ImmutableOntologyTest extends ImmutableOntologyTestBase {
@Test
public void test() {
final DefaultDirectedGraph<TermId, IdLabel... |
Military personnel specialists say that his case is unusual in several other ways too: the long gap since his previous service, his willingness to enlist as an Army sergeant after a career as an Air Force officer and fighter pilot and his willingness to volunteer for infantry duty when the Army is searching for every a... |
/**
* Validate password
* @param password - Password input
* @param errorsDetected - Boolean flag wrapper
*/
public static void validatePassword(PasswordField password, AtomicBoolean errorsDetected) {
List<String> valid = getValidationErrors(password.getValue());
if (!valid.isEmpty()... |
export * from './Facet';
export * from './FacetActions';
export * from './FacetConnected';
export * from './FacetMoreRows';
export * from './FacetMoreRowsConnected';
export * from './FacetMoreToggle';
export * from './FacetMoreToggleConnected';
export * from './FacetReducers';
export * from './FacetRow';
|
While at Brooklyn Brewery for the Wild Horse Porter release I took some time to catch up with brewmaster Garrett Oliver and discuss the beer and the growth of Brooklyn Brewery, NYC craft beer, and American craft beer as a whole. Having known Garrett for five years my interviews with him tend to feel more like friendly ... |
//*****************************************************************************
// Copyright 2017-2019 Intel Corporation
//
// 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://w... |
They're commonly called "deadbeats" — people who refuse to support their families after courts order them to pay — and CBC News has learned they owe more than $3.7 billion across the country for support orders.
Nearly two-thirds of all support orders in Canada are in arrears.
In Ontario, that number jumps to 80 per c... |
def fputs(file : IO,string:str):
file.write(string+"\n") |
from iota import BundleHash, Fragment
from iota.crypto import HASH_LENGTH
from iota.crypto.kerl import Kerl
def finalize(bundle):
sponge = Kerl()
last_index = len(bundle) - 1
for (i, txn) in enumerate(bundle):
txn.current_index = i
txn.last_index = last_index
sponge.absorb(txn.get... |
<filename>backend/codebase/Repository.go
package codebase
import (
"fmt"
"log"
"os"
"strings"
)
type Repository struct {
Modules []*Module
}
func (r Repository) isTarget(path string) bool {
fileInfo, err := os.Stat(path)
if err != nil {
log.Printf("Error when stating %s, %v\n", path, err)
return false
}
... |
/**
* Namespace for an <code>AS t(c1, c2, ...)</code> clause.
*
* <p>A namespace is necessary only if there is a column list, in order to
* re-map column names; a <code>relation AS t</code> clause just uses the same
* namespace as <code>relation</code>.
*/
public class AliasNamespace extends AbstractNamespace {
... |
def _remove_small_components(self):
from skimage.measure import label
labels = label(self._mask)
largestCC = labels == np.argmax(np.bincount(labels.flat)[1:])+1
self._mask = largestCC |
/*
* Copyright 2003-2016 MarkLogic Corporation
*
* 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... |
<gh_stars>0
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/g... |
/**
* Editor scene class, serialized by Kryo
* @author Kotcrab
*/
public class EditorScene extends BaseObservable {
private static final int VERSION_CODE = 2;
public static final int ACTIVE_LAYER_CHANGED = 0;
public static final int LAYER_ADDED = 1;
public static final int LAYER_INSERTED = 2;
public static fin... |
// Authorized is used to check if a user has access to a specified role
func (rdb *RoleDB) Authorized(role, userName string) bool {
rdb.mutex.RLock()
defer rdb.mutex.RUnlock()
role = normaliseField(role)
userName = normaliseField(userName)
_, ok := rdb.roles[role][userName]
return ok
} |
def main(argv):
parser = OptionParser()
parser.add_option("-s", "--species", action="store", type="string", dest="species", help="mm8, hg18, background, etc", metavar="<str>")
parser.add_option("-b", "--summarygraph", action="store",type="string", dest="summarygraph", help="summarygraph", metavar="<file>")
parser.a... |
/**
* {@link KeyManagerFactoryWrapper} serves as a {@link KeyManagerFactory} wrapper class for a {@link KeyManager} instance.
* A {@link KeyManagerFactory} is usually used when transforming a {@link KeyStore} instance into a KeyManager[]. Vert.x core has a
* base {@link KeyCertOptions} which relies on a {@link KeyMa... |
/**
* Delete a notification if the given user ID is equal to the ID in the notification.
*
* @param userId The ID of the user.
* @param notificationId The ID of the notification.
*/
public void deleteUserAndById(UUID userId, int notificationId) {
sql.deleteFrom(NOTIFICATION)
.where(NOTIFICATION.... |
package com.ardovic.weatherappprototype;
import android.annotation.SuppressLint;
import android.app.LoaderManager;
import android.content.ContentValues;
import android.content.Context;
import android.content.CursorLoader;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.sq... |
def _compute_corrections(
self,
) -> dict[str, tuple[float, float]]:
corrections = {}
for excitation in self._excitation_list:
if len(excitation[0]) == 2:
coefficient, energy_correction = self._compute_correction(excitation)
else:
coeff... |
/**
* Viewfinder stream server abstraction which provides interface for communication between
* stream consumer as {@link OnStreamDataReceivedListener} and camera as provider.
*/
public abstract class ViewfinderStreamServer {
private static final String TAG = "VFStreamServer";
protected int mPort;
prot... |
By By Katerina Nikolas Feb 26, 2012 in World Tehran - An Iranian commander has added his voice to the condemnation of the U.S. military actions in burning copies of the Quran in Afghanistan. The commander attributed the real reason for the burning of the Quran to "the heavy slap it (U.S.) has been given by Islam." He a... |
def update_layout(self, component, fig):
fig.update_layout(
title=dict(text=component.title_text,
font=dict(family=component.title_font_family,
size=component.title_font_size,
color=component.title_font_color),
... |
Social Media Use and Political Mobilization
This article describes how political participation is a central component of democracy. Past research has found that a variety of factors drive individual decisions about participation, including the media that citizens use to gain political information. Social media offers ... |
use std::{borrow::Cow, path::Path};
use crate::AuthMethod;
/// Parameters to authenticate with the jump host.
#[derive(Clone, Debug, PartialEq)]
pub struct JumpHostAuthParams<'auth> {
/// User to log in to the jump host as.
pub user_name: Cow<'auth, str>,
/// Authentication method and details.
pub aut... |
<gh_stars>10-100
////////////////////////////////////////////////////////////////////////////////////////////////////
// NoesisGUI - http://www.noesisengine.com
// Copyright (c) Noesis Technologies S.L. All Rights Reserved.
////////////////////////////////////////////////////////////////////////////////////////////////... |
/**
* Returns the common prefix of this MatcherPath and the given other one.
*
* @param that the other path
* @return the common prefix or null
*/
public MatcherPath commonPrefix(MatcherPath that) {
checkArgNotNull(that, "that");
if (element.level > that.element.level) return pa... |
/**
* Provides options for creating master key.
*/
public class GetParametersForImportRequest extends GenericKmsRequest {
/**
* master key id
*/
private String keyId;
/**
* the algorithm for user encrypt local key
*/
private String wrappingAlgorithm;
/**
* the pubkey sp... |
"""Sudoku, by <NAME> <EMAIL>
The classic 9x9 number placement puzzle.
More info at https://en.wikipedia.org/wiki/Sudoku"""
import copy, random, sys
EMPTY_SPACE = '.'
GRID_LENGTH = 9 # also the number of spaces in rows, columns and boxes.
BOX_LENGTH = 3
FULL_GRID_SIZE = GRID_LENGTH * GRID_LENGTH
class SudokuGrid:
... |
THE MANAGEMENT OF DYSPLASIA, CARCINOMA IN SITU AND MICROCARCINOMA OF THE CERVIX
Information about and histological preparations from 728 patients treated between 1955 and 1965 for dysplasia, carcinoma in situ or microcarcinoma (microinvasive carcinoma) were submitted to the Royal College of Obstetricians and Gynae‐col... |
// serialize returns a representation of the City used when formatting the worldMap at the end of the simulation.
func (c *City) serialize() string {
var routes string
if c.North != nil {
routes += "north=" + c.North.Name + " "
}
if c.East != nil {
routes += "east=" + c.East.Name + " "
}
if c.South != nil {
... |
Today more than ever, politicians, engineers, researchers and citizens are actively seeking out ways to reduce our production of waste — everything from industrial byproducts, to old and outdated electronics, to human excrement.
It's no mean task, but it's one that is becoming increasingly possible, in light of recent... |
def extract_model(self, y=None, u=None, models=None, n=None, t=None, x0=None):
dt = 1/self.signal.fs
if models is None:
models = self.models
if n is None:
if y is None or u is None:
raise ValueError('y and u cannot be None when several models'
... |
def render(self, mode='channel_last', img_name=None):
camera_matrix = p.computeViewMatrixFromYawPitchRoll(
cameraTargetPosition=self._jaka.robot_base_pos,
distance=2.,
yaw=145,
pitch=-40,
roll=0,
upAxisIndex=2
)
proj_mat... |
def CellQuality(self):
try:
import pyansys
except:
raise Exception('Install pyansys for this function')
return pyansys.CellQuality(UnstructuredGrid(self)) |
/**
* Stop monitoring the VM with the given moid.
*
* @param vmMoid the moid of the VM to stop monitoring.
*/
public void stopMonitoring(JobMonitorTicket ticket) {
if (ticket != null) {
ScheduledFuture<?> taskHandle = perfTasks.remove(ticket);
if (taskHandle != null) {
... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define PB push_back
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll,ll> pii;
typedef vector<pii> vpii;
typedef pii point;
using namespace std;
int main(){
ll ... |
//
// CoreLib.h
// CoreLib
//
// Created by CoreCode on 12.04.12.
/* Copyright © 2018 CoreCode Limited
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 lim... |
// main entrypoint to all subcommands
func main() {
parts := strings.Split(os.Args[0], "/")
subcommand := parts[len(parts)-1]
var err error
switch subcommand {
case "failed":
args := flag.NewFlagSet("logs:failed", flag.ExitOnError)
allApps := args.Bool("all", false, "--all: restore all apps")
args.Parse(os.A... |
<filename>src/main/java/com/mrbysco/skinnedcarts/entity/ElephantCartEntity.java<gh_stars>0
package com.mrbysco.skinnedcarts.entity;
import com.mrbysco.skinnedcarts.init.CartRegistry;
import net.minecraft.entity.EntityType;
import net.minecraft.network.IPacket;
import net.minecraft.world.World;
import net.minecraftforg... |
<filename>Code/Intelligentlamp/Intelligentlamp/ViewController(控制器)/Mine/Model/UserModel.h
//
// UserModel.h
// Intelligentlamp
//
// Created by L on 16/9/19.
// Copyright © 2016年 L. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UserModel : NSObject
@property (nonatomic ,copy) NSString *us... |
export class ContatoStatus {
contatoId: number;
online: boolean;
data: string;
nome: string;
descricao: string;
ultimoStatus: string;
estaDigitando: boolean;
}
|
/** Test List that implements only Iterator */
public static class MyList1 implements Iterator<MyNode> {
private MyNode head;
public MyList1() {
head = null;
}
@Override
public boolean hasNext() {
return head != null;
}
@Override
public MyNode next() {
if (hasNext())... |
/*
This file is part of the VRender library.
Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr)
Version 1.0.0, released on June 27, 2005.
http://artis.imag.fr/Members/Cyril.Soler/VRender
VRender is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as pub... |
CLOSE A 20-year-old Georgia man, Benjamin Milley, is recovering after he was "savagely" gored and tossed by a large fighting bull in Spain during the festival "Carnaval del Toro." VPC
In this Saturday, Feb. 14 photo, Ole Miss student Benjamin Milley, 20, from Georgia, in the US, is gored by a bull during the "Carnaval... |
<filename>src/whitelist.ts
import { Subject } from 'rxjs'
import { logger } from './lib/logger'
import { db } from './database'
import { ChainGraphContractWhitelist } from './types'
import { config } from './config'
export interface WhitelistReader {
whitelist$: Subject<ChainGraphContractWhitelist[]>
whitelist: Ch... |
<reponame>DeppSRL/open-aid
class TagFilterMixin(object):
model = None
def _get_tag_filter_value(self):
return self.request.GET.get('tag', None)
def _apply_tag_filter(self, qs):
filter_value = self._get_tag_filter_value()
if filter_value is not None:
qs = qs.filter(tagge... |
// New returns a new kubernetes monitor.
func New() *KubernetesMonitor {
kubeMonitor := &KubernetesMonitor{}
kubeMonitor.cache = newCache()
return kubeMonitor
} |
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.java.ast;
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* A "requires" directive of a {@linkplain ASTModuleDeclaration module declaration}.
*
* <pre... |
<reponame>sphinxlogic/shell32
#ifndef __STGENUM_H__
#define __STGENUM_H__
// IEnumSTATSTG for CFSFolder's IStorage implementation.
class CFSFolderEnumSTATSTG : public IEnumSTATSTG
{
public:
// IUnknown
STDMETHOD(QueryInterface)(REFIID riid, void **ppvObj);
STDMETHOD_(ULONG, AddRef)();
STD... |
k=int(input())
m=0
for i in range(k):
m=(m*10+7)%k
if m==0:
break
elif i==k-1:
print(-1)
exit()
print(i + 1)
|
package docker
import (
"fmt"
"io"
"io/ioutil"
"os"
"sort"
"docker.io/go-docker/api/types"
"docker.io/go-docker/api/types/filters"
"docker.io/go-docker/api/types/swarm"
"github.com/appcelerator/amp/docker/cli/cli/command"
"github.com/appcelerator/amp/docker/cli/cli/service/progress"
"github.com/appcelerato... |
def route_split_GLS(estim_param, network, data, dest_flows):
M_rsplits = np.zeros((len(network.routes_dict) * len(estim_param.tint_dict), len(network.routes_dict) * len(estim_param.tint_dict)))
v_rsplits = np.zeros(len(network.routes_dict) * len(estim_param.tint_dict))
route_splits = compute_route_splits(ne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.