content stringlengths 10 4.9M |
|---|
import { Request, Response } from "express";
import Controller from "./Controller";
import Project from '../classes/Project'
import Organization from "../classes/Organization";
export default class ProjectController implements Controller {
public static getAll = async (req: Request, res: Response) => {
... |
def permute_graph(G):
G1 = nx.copy.deepcopy(G)
d = nx.density(G1)
r = random.random()
if (r < 0.5 or d == 0) and d != 1:
nodes = G.nodes()
n1 = random.choice(nodes)
n2 = random.choice(nodes)
G1.add_edge(n1, n2)
else:
n1, n2 = random.choice(G1.edges())
... |
// InitCCentralService returns service struct for easier configuration access
func InitCCentralService(cc CCApi, serviceID string) *CCentralService {
service := CCentralService{
servideID: serviceID,
schema: make(map[string]SchemaItem),
config: make(map[string]ConfigItem),
cc: cc}
return &service... |
#line 10 "headerlexer.l"
/*
* This file is part of Wireless Display Software for Linux OS
*
* Copyright (C) 2015 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation... |
Smartphone photography for smart assessment of post-surgical wounds - an experience during the COVID-19 pandemic.
Aim: This study was undertaken with an aim to assess the feasibility of monitoring of wound healing by replacement of the traditional real-life clinical follow-up with a review of smartphone-captured digit... |
Сomparison of Au, Au-Pt, and Au-Ag nanoparticles as markers for immunochromatographic determination of nonylphenol
Gold spherical nanoparticles, gold-platinum nanoflowers, and gold-silver nanostars were obtained and compared as labels for immunochromatographic analysis. The nanoparticles were synthesized by chemical r... |
// acm.timus.ru 1108. Heritage
//1) 1/a[1] >= 1/a[2] >= 1/a[3] >= ... >= 1/a[n]
// a[1] <= a[2] <= a[3] <= ... <= a[n]
//2) sum(1/a[i]) < 1
//3) 1 - sum(1/a[i]) -- minimal
// example: n = 1 . a[1] = 2
// n = 2 . a[1] = 2, a[2] = 3
// n = 3 2 3 7
// SOLUTION:
// a[1] = 2. a[i] = a[i... |
import { IStyleDefinition } from '..';
/**
* Interface that defines a text reference
*/
export interface IToc extends IStyleDefinition {
readonly title: any;
readonly numberStyle?: IStyleDefinition;
readonly textStyle?: IStyleDefinition;
readonly textMargin?: number | [number, number] | [number, nu... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
import logging
import threading
from six.moves import queue
import copy
import time
from concurrent.futures import ThreadPoolExecutor
from azure.iot.hub import IoTHubReg... |
Although Maryland legislatures last week weren't able to overturn an outdated law that required rape victims to share custody with their rapist who did not receive a conviction, they did manage to pass through some positive legislation before the end of the 2017 Assembly session. On Tuesday, Gov. Larry Hogan signed int... |
They found that Australia continues to grant skilled migration visas to thousands of foreign cooks and accountants. This is despite an excess of local candidates suitable for those jobs, and government claims the migration program is attracting workers who have skills required by Australia. Confidential Immigration Dep... |
/**
* yzhang Comment method "updateCodeText".
*/
private void updateCodeText() {
Display.getDefault().syncExec(new Runnable() {
/*
* (non-Javadoc)
*
* @see java.lang.Runnable#run()
*/
@Override
public void run() ... |
/*
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
distributed under the License i... |
import collections
n = int(input())
S = [input() for _ in range(n)]
abc = list("abcdefghijklmnopqrstuvwxyz")
dic = dict(zip(abc,[10**9]*26))
for i in range(n):
tmp = collections.Counter(list(S[i]))
for j in abc:
if dic[j] > tmp[j]:
dic[j] = tmp[j]
ans = []
for k in abc:
for l in range(di... |
def initializePage(self):
SempyWizard.settings.setValue("interval", 5)
for i in FilterPage.box_group.buttons():
SempyWizard.settings.beginGroup("Repositories")
if i.isChecked() is True:
SempyWizard.settings.setValue(i.text(), "True")
else:
... |
<gh_stars>1-10
# flake8: noqa
import sys
import numpy as np
def get_bound_method_class(m):
"""Return the class for a bound method.
"""
return m.im_class if sys.version < '3' else m.__self__.__class__
def safe_as_int(val, atol=1e-3):
"""
Attempt to safely cast values to integer format.
Par... |
/*+__+ zhopa:skoro respa(*/
/*sps bfsu za rabotu-pishi bfs s used i obnovlyai v nem srazu*/
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define f first
#define s second
#define vi_a vector<int>a;
#define p_b push_back
#define ll long long... |
// GetCSR gets a certificate signing request.
func (c *CryptoContext) GetCSR(name string, subjectCountry string, subjectOrganization string) ([]byte, error) {
uid, err := c.GetUUID(name)
if err != nil {
return nil, err
}
template := &x509.CertificateRequest{
SignatureAlgorithm: x509.ECDSAWithSHA256,
Subject: ... |
A large mural to honor the late Montreal singer, songwriter and poet Leonard Cohen is expected to go up on Crescent St. by the end of the summer.
Mayor Denis Coderre confirmed that bit of news on Twitter on Tuesday morning.
"This magnificent wall in downtown will become, by next September, a magnificent 8500 square f... |
<gh_stars>1-10
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime
import (
"runtime/internal/atomic"
"unsafe"
)
type mOS struct {
waitsemacount uint32
notesig *int8
errstr *by... |
<filename>flash_briefing_test.go
package golexa
import (
"encoding/json"
"net/url"
"testing"
)
func testBriefing() *FlashBriefing {
return NewFlashBriefing("test", "Beer is yum")
}
func TestNewFlashBriefing(t *testing.T) {
fb := testBriefing()
if fb.Title != "test" {
t.Errorf("Expected title to be test, got ... |
/**
* This is the main menu for the client
* @throws IOException
*/
public void clientScreen() throws IOException {
boolean showMenu = true;
while(showMenu){
System.out.print("Welcome to the client screen\n"
+ "There are 3 Lotteries (Lotto, Jackpot and Nation... |
“All you needed was a cup of tea, a light, and your stereo, you know, and that’s what I had.” - Steve Jobs
It is a rare sort of person that will spend $149,995 on a vinyl-record player, but that person exists. Welcome to the agony and ecstasy of being an audiophile. Their goal is to listen to music that is reproduced ... |
<gh_stars>0
from django.contrib import admin
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
from adminsortable2.admin import SortableAdminMixin
from ..models import Status
@admin.register(Status)
class StatusAdmin(SortableAdminMixin, admin.ModelAdmin):
list_displ... |
<filename>2-Data_Cut_mooring_npp_timeseries.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 9 14:56:43 2020
Cut out the NPP for each mooring
Has been updated to include the TPCA chlorophyll. Downloadable
from http://dx.doi.org/10.25914/5dccbd3b64bdc (Pittman et al., 2019. JGR Oce... |
<filename>node/node.py
import socket
import sys
import time
import threading
import random
import hashlib
import json
import pickle
class NodeConnection(threading.Thread):
"""The class NodeConnection is used by the class Node and represent the TCP/IP socket connection with another node.
Both inbound... |
This article originally appeared at the Clarion Project:
Almost 80 senators and representatives now support the Muslim Brotherhood Terrorist Designation Act, with three more congressmen coming onboard since the last update. Twenty-three have chosen to back the legislation since the Clarion Project letter campaign was ... |
<reponame>cheolgiseo/cheolgi<filename>tez-runtime-library/src/main/java/org/apache/tez/runtime/library/cartesianproduct/CartesianProductVertexManagerUnpartitioned.java
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with th... |
// NewMockServerVersionClient creates a new mock instance.
func NewMockServerVersionClient(ctrl *gomock.Controller) *MockServerVersionClient {
mock := &MockServerVersionClient{ctrl: ctrl}
mock.recorder = &MockServerVersionClientMockRecorder{mock}
return mock
} |
/**
* <pre>
* Set to true to fetch events for the transaction at this version
* </pre>
*
* <code>bool fetch_events = 3;</code>
*/
public Builder clearFetchEvents() {
fetchEvents_ = false;
onChanged();
return this;
} |
/**
* this method only dispatch btnClicked action, don't write another
* logic in this method. all method should be use Action as suffix w/o
* or with btnClick as parameter as neccersy.
*
* @param btnClicked
* @return
*/
public String createAction (String btnClicked) {
if (btn... |
package t;
/**
* Created by hanzhihua on 2016/12/2.
*/
public enum UserType {
A;
}
|
<reponame>AlphaGoMK/SEP
package sep.Entity;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.query.Query;
import javax.persistence.criteria.CriteriaBuilder;
import java.util.Date;
import java.util.List;
public class TeacherDAO {
public ... |
#include <stdio.h>
#define MAX 100000
main (){
int n;
long long num[MAX]={0};
int i,j;
long long minodd=99999999999LL
;
long long sum=0;
long long ans;
scanf ("%d",&n);
for (i=0;i<n;i++){
scanf("%lld",&num[i]);
}
for (i=0;i<n;++i)
sum=sum+num[i];
if (sum%2==0)
ans=sum;
else{
for (i=0... |
<filename>timus/vol8/1785.go
package main
import "fmt"
func main() {
var n int
fmt.Scanf("%d", &n)
var s string
switch {
case n < 5: s = "few"
case n < 10: s = "several"
case n < 20: s = "pack"
case n < 50: s = "lots"
case n < 100: s = "horde"
case n < 250: s = "throng"
case n < 500: s = "swarm"
c... |
module Lib
( factor
, fibs
, primes
, triangulars
, factorials
, arithmeticProgressionSum
, squareNumbersSum
, digits
, number
, slices
, divisors
, properDivisors
, perfect
, abundant
, deficient
, words'
, shuffle
) where
import Data.List as L
... |
def limit_column_characters(df, column_length: int, col_separator: str = "_"):
check("column_length", column_length, [int])
check("col_separator", col_separator, [str])
col_names = df.columns
col_names = [col_name[:column_length] for col_name in col_names]
col_name_set = set(col_names)
col_name_... |
<reponame>alimy/gin
// Copyright 2018 Gin Core Team. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
// +build go1.7
package gin
import (
"time"
"github.com/alimy/gin/render"
)
// PureJSON serializes the given struct as JSON into the r... |
/**
* Computes the correct dialog size for the given page and resizes its shell
* if nessessary.
*
* @param page
* the wizard page
*/
private void updateSizeForPage(IWizardPage page) {
Point delta = calculatePageSizeDelta(page);
if (delta.x > 0 || delta.y > 0) {
Shell shell = getShell();
... |
<gh_stars>0
export * from './models/index';
export * from './services/index';
export * from './store/index';
export * from './sites.module';
|
<filename>src/build/prepareElectronApp.ts
import * as crypto from 'crypto';
import * as fs from 'fs-extra';
import * as path from 'path';
import * as log from 'loglevel';
import { copyFileOrDir, generateRandomSuffix } from '../helpers/helpers';
import {
AppOptions,
OutputOptions,
PackageJSON,
} from '../../shar... |
/**
* For processing the countAll method using an all neighbour cell comparison. This doubles the
* number of distance comparisons but does not require synchronisation.
*/
private class CountWorker2 implements Runnable {
final int[][] results;
final int[] process;
final int from;
final int to;
... |
<filename>src/api/x11/ffi.rs
pub use x11_dl::keysym::*;
pub use x11_dl::xcursor::*;
pub use x11_dl::xf86vmode::*;
pub use x11_dl::xlib::*;
pub use x11_dl::xinput::*;
pub use x11_dl::xinput2::*;
pub use x11_dl::error::OpenError;
pub use self::glx::types::GLXContext;
/// GLX bindings
pub mod glx {
include!(concat!... |
/**
* Test class for the {@link ProxyController}.
*
* @author Cyrille Chopelet
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ProxyControllerTestConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@AutoConfigureMockMvc
public class ProxyControllerTest {
@Autowired
p... |
<reponame>g-logunov/polars<filename>polars/polars-lazy/src/physical_plan/expressions/literal.rs<gh_stars>1-10
use crate::physical_plan::state::ExecutionState;
use crate::physical_plan::PhysicalAggregation;
use crate::prelude::*;
use polars_core::frame::groupby::GroupTuples;
use polars_core::prelude::*;
use polars_core:... |
from PIL import Image, ImageDraw
s=72
images = []
for i in range(0,360,5):
im = Image.open('k-means/pca_example/tran_pca6d/pca3_PCA3d_angle_'+str(i)+'.jpg')
im =im.resize(size=(512, 512), resample=Image.NEAREST) #- NEAREST - BOX - BILINEAR - HAMMING - BICUBIC - LANCZOS
images.append(im)
images[0].s... |
use std::fmt;
use bitflags::bitflags;
use crate::error::{PageMapError, Result};
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// VirtualMemoryArea
//
///////////////////////////////////////////////////////////////////////////////////////////////////
/// A reg... |
In 1964, Ducati dipped a toe into the large cruiser market with the mighty Apollo, a 1,256cc vee-four heavyweight designed to take on Harley-Davidson in the police market.
The Apollo never made it into production, but 46 years later, its spiritual successor has appeared.
First, the stats: the power output of the Duca... |
/**
* A protocol definition and call dispatcher.
*
* Encapsulates the state of a protocol definition (registered implementations) and provides type dispatch
* utilities. A subclass of this class is generated and instantiated for each registered protocol. The methods in
* the protocol's interfac... |
package socket
func (c *client) handleChatbotRequest(request string) string {
return "you just said " + request
}
|
<reponame>trussworks/mymove
package ghcrateengine
import (
"fmt"
"testing"
"github.com/gofrs/uuid"
"github.com/transcom/mymove/pkg/models"
"github.com/transcom/mymove/pkg/services"
"github.com/transcom/mymove/pkg/testdatagen"
"github.com/transcom/mymove/pkg/unit"
)
func (suite *GHCRateEngineServiceSuite) Tes... |
<filename>parking/parking.go
package parking
import (
"errors"
"fmt"
"github.com/ManojChandran/parking-lot/slot"
"github.com/google/uuid"
)
// Ticket delivers the parking ticket for vehicle
type Ticket struct {
ID string
}
type pEntrance struct {
gateLocation string
gateNumber string
}
type parking struct... |
/**
* Test getGetColumnPrivileges; does not modify database
* For further testing see test lang.grantRevokeTest
* @throws SQLException
*/
public void testGetColumnPrivileges() throws SQLException
{
try {
getColumnPrivileges(null,null,null,null);
fail ("exp... |
public void testAdd() throws Exception {
byte[] bytes=Bytes.toBytes(getName());
KeyValue kv=new KeyValue(bytes,bytes,bytes,bytes);
this.kvsls.add(kv);
assertTrue(this.kvsls.contains(kv));
assertEquals(1,this.kvsls.size());
KeyValue first=this.kvsls.first();
assertTrue(kv.equals(first));
assertTrue(Bytes... |
def reconstruction(rec_times, alpha_1, alpha_2, alpha_3, alpha_4):
fname = 'projections.npy'
print('Reading:', fname)
projections = np.load(fname)
print('projections:', projections.shape, projections.dtype)
P = projections.reshape((projections.shape[0], -1))
print('P:', P.shape, P.dtype)
fna... |
/**
* insere o Vendas 'vendas' no banco de dados
*
* @param o
* objeto a ser inserido
* @return a chave primaria gerada
* @author marcos
*
*/
public class VendasDAO {
public static int create(Vendas vendas) {
if (vendas.getPk_Vendas() != 0) {
throw new RuntimeException("Objeto ja existente");
... |
The current scientific theory outlining the major events during the development of life
Not to be confused with history of evolutionary thought
This article is about the evolution of all life on Earth. For more detailed and comprehensive coverage, see evolutionary history of life
This timeline of the evolutionary hi... |
// Embedded Framework Generated File:
// Date:20/04/2009
// Time:10:32:37 AM
//
#ifndef _DEVICES_H
#define _DEVICES_H
// instance devices ids macro definitions
#define DRV_CAN_0 0
#define SERVER 0
#define CANOPEN_0 0
#endif
|
/// Raises a floating point number to the complex power `self`.
pub fn expf(self, base: T) -> Complex<T> {
// formula: x^(a+bi) = x^a x^bi = x^a e^(b ln(x) i)
// = from_polar(x^a, b ln(x))
Complex::from_polar(base.pow(self.re), self.im * base.ln())
} |
// finishWithError notifies discovery service about an error.
func (c *Callbacker) finishWithError(id string) func(e interface{}) error {
return func(e interface{}) error {
c.sendEvent(GameFinishedWithError, DiscoveryTopic, e)
c.sendEvent(PlayerDone, id, e)
return nil
}
} |
Effect of Nanoparticle Synthetic Conditions on Ligand Coating Integrity and Subsequent Nano-Biointeractions.
Most current nanoparticle formulations have relatively low clearance efficiency, which may hamper their likelihood for clinical translation. Herein, we sought to compare the clearance and cellular distribution ... |
Urinary stones, active component, U.S. Armed Forces, 2001-2010.
Urinary stones can cause debilitating morbidity that impairs the operational effectiveness of affected members of the U.S. Armed Forces. This report describes a "gender shift," i.e., the narrowing of prevalence differences between men and women, similar t... |
package info.jerrinot.subzero.it.hz38;
import info.jerrinot.subzero.it.BaseSmokeTests;
public class Hazelcast38_SmokeTest extends BaseSmokeTests {
}
|
package alluxio
import (
datav1alpha1 "github.com/fluid-cloudnative/fluid/api/v1alpha1"
"github.com/fluid-cloudnative/fluid/pkg/ddc/base"
v1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client... |
import { Stream } from 'xstream';
export declare type Predicate = (ev: any) => boolean;
export declare type PreventDefaultOpt = boolean | Predicate | Comparator;
export declare type Comparator = {
[key: string]: any;
};
export declare function fromEvent(element: Element | Document, eventName: string, useCapture?: b... |
<reponame>Ingenieur2/2020-06-otus-java-korolev<gh_stars>0
package ru.package01;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface EchoInterface extends Remote {
String echo(String data) throws RemoteException;
}
|
/* Appends to 'b' the OXM formats that expresses 'match', without header or
* padding.
*
* OXM differs slightly among versions of OpenFlow. Specify the OpenFlow
* version in use as 'version'.
*
* This function can cause 'b''s data to be reallocated. */
void
oxm_put_raw(struct ofpbuf *b, const struct match *match... |
/**
* Tests to make sure we get a properly constructed map of samples to sequencing objects.
*/
@Test
@WithMockUser(username = "admin", roles = "ADMIN")
public void testGetUniqueSamplesForSequencingObjectsSuccess() {
SequencingObject s1 = objectService.read(1L);
SequencingObject s2 = objectService.read(2L);
... |
// New creates a new default seccomp configuration instance
func New() *Config {
return &Config{
enabled: seccomp.IsEnabled(),
profile: seccomp.DefaultProfile(),
}
} |
/**
* abstract class Figure.
*
* @author Sergei Shangraeev (sezhaekb@gmail.com).
* @version 1.0.
*/
public abstract class Figure {
final static int LENGHTDESK = 8;
/* final Cell position[][] = (int x, int y);
public abstract Cell[] way(Cell source, Cell dest) throw ImpossibleMoveException {
}*/
... |
Performance of Tikhonov Regularization with Different Constraints in Electrocardiographic Imaging
The purpose of electrocardiographic imaging (ECGI) is to obtain high-resolution information about the electrical activity of the heart. ECGI is the estimation of heart’s electrical activity using body surface potentials a... |
A unique population in northern Finland has helped reveal that schizophrenia, some autism spectrum disorders and other forms of cognitive impairment may all share a common genetic pathway.
In Finland, there exist several small communities that used to live for years in isolation. Amongst the descendants of these group... |
<reponame>jwillemsen/ciaox11
// -*- C++ -*-
/**
* @file zmq_psdd_data_i.cpp
* @author <NAME>
*
* @brief ZMQ Message data for PSDD implementation
*
* @copyright Copyright (c) Remedy IT Expertise BV
*/
#include "psdd4ccm/logger/psdd4ccm_log.h"
#include <stdexcept>
#include "zmq_psdd_data_i.h"
#include "ac... |
/** Add a new label to the list.
You should call validateLabels() after calling this. */
public void addLabel(GUILabel lab)
{
lab.parse();
labels.add(lab);
fireTableRowsInserted(labels.size()-1, labels.size()-1);
parent.labelListChanged();
} |
<gh_stars>1-10
package com.gmail.jakekinsella.robot;
/**
* Created by jakekinsella on 1/6/17.
*/
public class Angle {
private double degrees;
public Angle(double degrees) {
this.degrees = degrees;
}
public Angle(double x1, double y1, double x2, double y2) {
this.degrees = Math.toDe... |
def chr_comp(keys):
if isinstance(keys, (list, tuple)):
key = keys[0]
elif isinstance(keys, compare_snps_to_genome.Chromosome):
key = keys.number
else:
key = keys
key = key.lower().replace("_", "")
chr_num = key[3:] if key.startswith("chr") else key
if chr_num == 'x':
... |
On Quantifying the Complexity of IoT Traffic
A single quantitative measure for characterizing the complexity of Internet-of-Things (IoT) network traffic remains elusive. Such a quantifier holds value in distinguishing the relative complexities of IoT network traffic in an increasingly heterogeneous IoT device landscap... |
#include <bits/stdc++.h>
#define ll long long
#define re return
using namespace std;
int main(){
ll n,k;
cin >> n >> k;
ll a[n+10];
ll sum1=0;
ll sum2=0;
for (int i=1;i<=n;++i){ cin >> a[i]; if (a[i]==1) sum1++; else sum2++;}
ll mx=0;
for (int i=1;i<=k;++i){
ll ts1=0... |
import { VoidFunctionComponent } from 'react';
import Example from '../../../components/Example';
import CodeHighlight from '../../../components/CodeHighlight';
import FixedWidthExample from './FixedWidthExample';
import FixedWidthExampleRaw from './FixedWidthExample?raw';
const FixedWidth: VoidFunctionComponent = () ... |
<filename>OOP With C++/Chapter 16 'New Features of ANSI C++ Standard'/Example/16.2 Use of keyword mutable/main.cpp
#include<iostream>
#include<string>
using namespace std;
class ABC{
private :
mutable int m;
public:
explicit ABC(int x=0){
m=x;
}
void change() const{ // constant function
... |
/**
* Created by George Cimpoies on 11/4/2016.
*/
public class InsectFactory extends SpeciesFactory {
@Override
public Animal getAnimal(String type) {
if (Constants.Animals.Insects.Butterfly.equals(type)) {
return new Butterfly();
} else if (Constants.Animals.Insects.Cockroach.equa... |
package io.choerodon.kb.app.service.impl;
import com.vladsch.flexmark.convert.html.FlexmarkHtmlParser;
import io.choerodon.core.exception.CommonException;
import io.choerodon.core.oauth.CustomUserDetails;
import io.choerodon.core.oauth.DetailsHelper;
import io.choerodon.kb.api.dao.*;
import io.choerodon.kb.app.service... |
<gh_stars>0
import utils
import matplotlib.pyplot as plt
from workspace_utils import keep_awake
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
import json
from collections import OrderedDict
device = None
args = utils.get_i... |
/**
* Adapter for displaying list of quests
*
* TODO ViewHandler for better performance
* TODO ClickHandler on title
* TODO Click handling on quest item
*/
public class QuestArrayAdapter extends ArrayAdapter<Quest> {
private final String TAG = QuestArrayAdapter.class.getSimpleName();
/**
*
* @... |
def sum_juvenile(self):
return (
self.no_juvenile_male or 0
) + (
self.no_juvenile_female or 0
) + (
self.no_juvenile_unknown or 0
) or 0 |
def _match_unfinished_file_if_possible(
self,
bucket_id,
file_name,
file_info,
emerge_parts_dict,
encryption: EncryptionSetting,
file_retention: Optional[FileRetentionSetting] = None,
legal_hold: Optional[LegalHold] = None,
):
file_retention = ... |
def execute(self):
if self.active:
should_publish = self.check_whether_to_publish()
if should_publish:
self.publish()
if self.has_errors:
self.send_failure_notification()
self.cleanup() |
package in.mahabhujal.mahabhujal;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import... |
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int n, b[500005], id[500005];
long long a[500005], fl[500005], fr[500005];
struct BIT {
int n;
vector<long long> t;
void init(int m) { n = m; t.clear(); t.resize(m + 2); }
void update(int p, long long x)... |
<reponame>AlpacaTravel/react-maki-icons
import React from 'react';
import createSvgIcon from '../utils/create-svg-icon';
export const paths:string[] = ['M616 791l290 145-42 82-352-175-352 176-42-83 290-145-289-144 42-83 351 175 352-176 41 84-289 144z m175-492v27l-93 93v93l-186 93-186-93v-93l-93-93v-47c-6-149 111-274 ... |
/**
* Contains some methods for string manipulation.
*/
public class StringUtilities {
/** Default rounding precision (digits after decimal point) */
public static final int DEFAULT_ROUND_PRECISION = 16;
private static DecimalFormat df;
private static DateFormat dateFormat = new SimpleDateFormat("EEE MMM dd H... |
import { IdentifierReference } from './identifierreference';
import { Node } from '../node';
import { Expression, PropertyKey } from '.';
import { AssignmentExpression } from './assignment-expr';
import { BindingElement } from './binding-element';
import { BindingIdentifier } from './binding-identifier';
import { Assig... |
Special Collections Roadshow — Episode Seven: Housewife
Special Collections Roadshow was created by the Civil War Institute at Gettysburg College in the Spring of 2014. It showcases various artifacts from Special Collections at Gettysburg College. The seventh episode features Megan McNish ’16 comparing the housewife f... |
/// Initialises a new Timer with the command
/// line arguments passed in the argument `args`.
pub fn init(args: Vec<String>) -> Self {
let mut tmr = Tima::new();
args.into_iter()
.map(Tima::convert_arguments)
.for_each(Tima::create_tima(&mut tmr));
tmr
} |
//===-- circt-c/Dialect/HW.h - C API for HW dialect ---------------*- C -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
/**
* Calls reconfig on the client corresponding to id to add or remove
* the given servers. Tests appropriately to make sure the
* reconfig succeeded.
*/
private void testReconfig(int id, boolean adding,
ArrayList<String> servers) throws Exception {
if (adding)... |
def smart_extend(dict_inst, *dict_arr):
for item in dict_arr:
dict_inst.update(item)
return dict_inst |
<gh_stars>0
/*
* Created on Dec 28, 2004
*
*/
package aima.probability;
import java.util.Hashtable;
/**
* @author <NAME>
*
*/
public class Query {
private String queryVariable;
private Hashtable<String, Boolean> evidenceVariables;
public Query(String queryVariable, String[] evidenceVariables,
boolean... |
/* Display name of executing routine. */
static void TraceNames( ExecToken Token, cell_t Level )
{
char *DebugName;
cell_t i;
if( ffTokenToName( Token, &DebugName ) )
{
cell_t NumSpaces;
if( gCurrentTask->td_OUT > 0 ) EMIT_CR;
EMIT( '>' );
for( i=0; i<Level; i++ )
{
MSG( " " );
}
TypeName( DebugNa... |
<gh_stars>1-10
"""Caching and History API test for KAOS."""
from collections import namedtuple
import re
import logging
from ddt import ddt, data, file_data
from kaos.algorithm.visibility_finder import VisibilityFinder
from kaos.models import Satellite
from kaos.models.parser import parse_ephemeris_file
from kaos.u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.