content stringlengths 10 4.9M |
|---|
package main
func main() {
a:=10
for a:=0; a<=3;a = a + 1 {
a:=1
print(a,"\n")
}
print(a, "Mimo for\n")
}
|
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# ## DS/CMPSC 410 Sparing 2021
# ## Instructor: Professor <NAME>
# ## TA: <NAME> and <NAME>
# ## Lab 7 Part A: Data Partitioning
# ## The goals of this lab are for you to be able to
# ## - Use data partitioning to improve scalability
# ## - Make decisions regardin... |
package memory
import (
"hex-microservice/adder"
"hex-microservice/invalidator"
"hex-microservice/lookup"
)
// Hey, this code is generated. You know the drill: DO NOT EDIT
func fromRedirectToLookupRedirectStorage(i redirect) lookup.RedirectStorage {
return lookup.RedirectStorage{
Code: i.Code,
URL: ... |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from geopy.distance import distance
import xgboost
class ProjectDataExploration:
data = None
data_train = None
data_test = None
def __init__(self, data_path='LocTreino_Equipe_3.csv', log_dir='log_mlp/'):
self.da... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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 or... |
H = int(input())
W = int(input())
N = int(input())
if H > W:
if N % H == 0:
print(N // H)
else:
print(N // H + 1)
else:
if N % W == 0:
print(N // W)
else:
print(N // W + 1) |
<filename>dilution/src/main.rs
use rustybeer::calculators::diluting;
use lambda::{handler_fn, Context};
use lambda_gateway::{LambdaRequest, LambdaResponse, LambdaResponseBuilder};
use serde::{Deserialize, Serialize};
use simple_logger::SimpleLogger;
type Error = Box<dyn std::error::Error + Sync + Send + 'static>;
#[... |
//
// Queries the media format field for a title or collection cookie. This
// is very simple. Just a cookie in and a string out.
//
tCIDLib::TVoid
TCQCStdMediaRepoEng::QueryMediaFormat(const TString& strCookie, TString& strToFill)
{
tCIDLib::TCard2 c2CatId;
tCIDLib::TCard2 c2ColId;
tCIDLi... |
/**
* Advanced example to demonstrate custom nearest marker test.
*
* getNearestMarker(x,y) returns the closest marker to the given screen position. Using
* DistancePerLocationPolygonMarker, i.e. instead of the default implementation of using the centroid of the polygon,
* this tests all vertices of the polygon.
... |
<reponame>dexa187/splunkpersist<gh_stars>0
package splunkpersist
import (
"encoding/json"
"fmt"
)
func LogError(err error) {
out := Response{Payload{Entry: []Entry{Entry{Content: fmt.Sprintf(err.Error())}}}}
outString, _ := json.Marshal(out)
fmt.Println("0")
fmt.Printf("%v\n", len(string(outString)))
fmt.Print... |
import os
import math
import numpy as np
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
from src.utils import args
from .datasets import CIFAR10, CelebA, Imagenette, ImageNet32, ImageNet64
ROOT = './data_root/'
# ----- Dataset Sp... |
<reponame>uswitch/trustyle<filename>src/elements/drop-down/src/index.tsx
/** @jsx jsx */
import { forwardRef, useImperativeHandle, useRef, useState } from 'react'
import { jsx, useThemeUI } from 'theme-ui'
import { Icon } from '@uswitch/trustyle.icon'
import { FrozenInput } from '@uswitch/trustyle.frozen-input'
import... |
<gh_stars>0
package org.test.stat.builder;
import org.junit.Test;
import org.test.input.pojo.Line;
import org.test.stat.builder.LineStatisticsBuilder;
import org.test.stat.pojo.LineStatistics;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class LineStatisticsBuilderTes... |
/**
* Returns an {@code Enumeration} on the specified collection.
*
* @param collection
* the collection to enumerate.
* @return an Enumeration.
*/
public static <T> Enumeration<T> enumeration(Collection<T> collection) {
final Collection<T> c = collection;
return... |
import argparse
import os
import logging
import numpy as np
import random
import sys
import torch
import matplotlib.pyplot as plt
from datetime import datetime
from torch.serialization import default_restore_location
# TODO Update this for new parameters
def add_logging_arguments(parser):
parser.add_argument("--seed... |
<gh_stars>1-10
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
type AssignPublicIp string
// Enum values for AssignPublicIp
const (
AssignPublicIpEnabled AssignPublicIp = "ENABLED"
AssignPublicIpDisabled AssignPublicIp = "DISABLED"
)
// Values returns all known values for AssignPublicIp. Note t... |
<gh_stars>0
import { combineReducers } from 'redux-immutable'
import form from './form'
export default combineReducers({
form,
})
|
/* Lets libdwarf reflect a command line option, so we can get details
of some errors printed using libdwarf-internal information. */
void
dwarf_record_cmdline_options(Dwarf_Cmdline_Options options)
{
dwarf_cmdline_options = options;
} |
def merge_history_and_block_events(settings, emit_events_after=True):
history = settings.get("history")
if history:
with history.merge_changes():
with settings.blocked_events(history.subscribed_events, emit_after=emit_events_after):
yield
else:
yield |
<filename>core.py
from __future__ import print_function
import numpy as np
LA = np.linalg
import cv2
from scipy.sparse import linalg as spla
import vtk
from util import kinect, format
def genPoints(ptArray):
points = vtk.vtkPoints()
points.SetNumberOfPoints(len(ptArray))
for i in range(len(ptArr... |
/**
* @see "OFX Spec, Section 192.168.3.11"
*/
export enum AccountType {
CHECKING,
SAVINGS,
MONEYMRKT,
CREDITLINE
}
|
def gaussian_psf(x, c, r):
return torch.maximum((1 + gaussian(r, 0, r / 2.)) * gaussian(x, c, r / 2.) - gaussian(r, 0, r / 2.),
torch.zeros_like(x)) |
<filename>app/monitor/cpu.go
package monitor
import (
"fmt"
"log"
"sort"
"strings"
"github.com/chzyer/readline"
"github.com/blackchip-org/retro-cs/rcs"
"github.com/blackchip-org/retro-cs/rcs/m6502"
"github.com/blackchip-org/retro-cs/rcs/z80"
)
type modCPU struct {
name string
mon *Monitor
out *lo... |
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS... |
package util
//goland:noinspection ALL
import (
"fmt"
"github.com/bramvdbogaerde/go-scp"
"github.com/bramvdbogaerde/go-scp/auth"
certwatchv1 "github.com/jhmorimoto/cert-watch/apis/certwatch/v1"
"golang.org/x/crypto/ssh"
"io/ioutil"
v1 "k8s.io/api/core/v1"
"os"
"path/filepath"
)
func ProcessScp(cw *certwatchv... |
// Copyright 2019 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License included
// in the file licenses/BSL.txt and at www.mariadb.com/bsl11.
//
// Change Date: 2022-10-01
//
// On the date above, in accordance with the Business Source License, use
// of this software will be gov... |
<filename>java_old/sanandreasp/mods/TurretMod3/client/render/turret/RenderTurretForcefield.java
package sanandreasp.mods.TurretMod3.client.render.turret;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.rendere... |
Extraction of thorium (IV) ions from aqueous sulfate media by amino bromo phenyl diazenyl pyrazolo pyrimidinyl cyclohexanone
ABSTRACT In the present study, 2-(2-Amino-3-((4-bromophenyl) diazenyl)pyrazolo pyrimidin-7-yl) cyclohexanone (PPC) as an organic ligand was evaluated in the liquid-liquid (water-chloroform) ext... |
Attractor-Repeller Collision and Eyelet Intermittency at the Transition to Phase Synchronization
The chaotically driven circle map is considered as the simplest model of phase synchronization of a chaotic continuous-time oscillator by external periodic force. The phase dynamics is analyzed via phase-locking regions of... |
def LINE():
r = ""
frame = inspect.currentframe()
ff = inspect.getouterframes(frame)[1]
if (ff[4] != None) :
loc = str(ff[1]) + ':' + str(ff[2])
r += loc + ' line ' + tt(loc) + '.'
return r |
def wczytywanie():
n = int(input())
graf = {}
for i in range(2, n+1):
tata = int(input())
if tata not in graf:
graf[tata] = []
graf[tata].append(i)
return graf
def czy_swierk(graf):
for w in graf:
ile_lisci = 0
for d in graf[w]:
... |
async def beatmapset_from_url(url: str, force_redownload: bool = False):
beatmap_info = parse_beatmap_url(url)
if beatmap_info.beatmapset_id is not None:
beatmapset_id = beatmap_info.beatmapset_id
beatmapset = await get_beatmapset(beatmapset_id, force_redownload=force_redownload)
else:
... |
class ModMapper:
"""Converts Mod Map codes into names and strings."""
def __init__(self):
self.map = {}
self.alt_map = {}
self.name_to_code = {}
#end __init__
def done(self):
"""done setup, now create alt_map and name_to_code."""
for key in self.map:
... |
# Create your tests here.
from django.test import TestCase
from django.urls import reverse
from django.utils.http import urlencode
from datetime import date, timedelta
import json, re
#
# Test Helpers
#
# https://stackoverflow.com/questions/4995279/including-a-querystring-in-a-django-core-urlresolvers-re... |
- Marci Solway got up to a horrible sight. She looked out her window to see a lifeless body in the field across the way from her town home where they are building Habitat for Humanity homes.
Authorities say the man in the field had jumped from the Colorado Street Bridge. Solway says she was "beyond shocked because the... |
/*
* XXX: replace with a useful constructor.
*/
FunctionInvocationBinary::FunctionInvocationBinary(eBinaryOps op, const SafeOpFlags *flags)
: FunctionInvocation(eBinaryPrim, flags),
eFunc(op),
tmp_var1(""),
tmp_var2("")
{
} |
Calculating the Statistical Power of the Univariate and the Multivariate Repeated Measures Analyses of Variance for the Single Group Case Under Various Conditions
Repeated measures designs find frequent application in behavioral research. Researchers using such designs must choose between the univariate approach and t... |
package main
import "fmt"
var M int
func main() {
fmt.Scanf("%d", &M)
fmt.Println(24*2 - M)
}
|
<filename>test/Manager/TypesSpec.hs
module Manager.TypesSpec (spec) where
import Foundation
import Test.Hspec
import Test.QuickCheck
import Types
spec :: Spec
spec = do
it "dry run" $ do
pending |
def _as_constant_array(t: Union["Tensor", np.ndarray]) -> np.ndarray:
if isinstance(t, Tensor):
if t.constant is False:
raise _ConstantOnly()
return t.data
return t |
package slice
import (
"fmt"
"testing"
)
func ExampleIsEqualStringSlice() {
s1 := []string{"foo", "bar", "baz"}
s2 := []string{"foo", "bar", "baz"}
s3 := []string{"foobar", "foo"}
fmt.Println(IsEqualStringSlice(s1, s2))
fmt.Println(IsEqualStringSlice(s1, s3))
fmt.Println(IsEqualStringSlice(s1, s1))
fmt.Print... |
/**
* @brief Process utility statement.
* @param parsetree Parse tree
*/
void DDL::ProcessUtility(Node *parsetree) {
assert(parsetree != nullptr);
LOG_TRACE("Process Utility");
static std::vector<Node *> parsetree_stack;
set_stack_base();
switch (nodeTag(parsetree)) {
case T_CreatedbStmt: {
DDLDa... |
// NewLineBuffer creates a new LineBuffer with a given line length limit and
// callback.
func NewLineBuffer(maxLineLength int, cb LineBufferCallback) *LineBuffer {
return &LineBuffer{
maxLineLength: maxLineLength,
cb: cb,
}
} |
/**
* Shuts down the registration manager.
*/
public void shutdown() {
if (instance != null) {
instance = null;
}
} |
Visitors of The Valentine and downtown residents will soon get the chance to enjoy the sandwiches and other goodies from Garnett’s Cafe when Garnett’s at the Valentine opens this spring.
A sister restaurant to the Fan’s Garnett’s Cafe on Park Avenue, Garnett’s at the Valentine will go in the museum’s garden cafe servi... |
// Get retrieves the pointer from the given handle
func (v *HandleList) Get(handle unsafe.Pointer) interface{} {
v.RLock()
defer v.RUnlock()
ptr, ok := v.handles[handle]
if !ok {
panic(fmt.Sprintf("invalid pointer handle: %p", handle))
}
return ptr
} |
/**
* of_release_dev - free an of device structure when all users of it are finished.
* @dev: device that's been disconnected
*
* Will be called only by the device core when all users of this of device are
* done.
*/
void of_release_dev(struct device *dev)
{
struct of_device *ofdev;
ofdev = to_of_device(dev);
... |
/**
* Data source for MySql.
*/
@IoOpAnnotation(name = "my_sql_batch_source", ioType = IOType.SourceBatch)
public final class MySqlSourceBatchOp extends BaseSourceBatchOp <MySqlSourceBatchOp>
implements MySqlSourceParams <MySqlSourceBatchOp> {
public MySqlSourceBatchOp() {
this(new Params());
}
public MySqlSo... |
/**
* Exports the given {@link EsbServer} visual model into specified
* destination.
*
* @param serverModel
* {@link EsbServer} visual model instance.
* @param destination
* target file.
* @throws Exception
* if an error occurs during expor... |
#! /usr/bin/env python
import sys, os, glob
import re
import argparse
import json
_PLAN_INFO_REGEX = re.compile(r"; cost = (\d+) \((unit cost|general cost)\)\n")
class Plan(object):
def __init__(self, path):
self._path = path
self._plan_cost = None
self._actions = []
with open(pa... |
/**
* Reads all referral URLs associated with this exception by invoking the search operation on the referral context
* until all referrals have been read. JNDI does not distinguish the URLs contained in specific references. So each
* URL must be treated as a separate search reference.
*
* @par... |
Asymmetric suppression of components in binary aldehyde mixtures: behavioral studies in the laboratory rat.
The aim of the present study was to assess component interaction in the perception of the 2 aldehydes butanal and heptanal when presented in binary mixtures to rats. A further aim was to develop a behavioral par... |
class PDP:
"Partial dependence plot class"
def __init__(self, model, X: pd.DataFrame):
"""
Args:
model (sklearn model): Trained scikit-learn model. Must have either a `predict` method
(if a regression model) or `predict_proba` method (if a classifier).
X ... |
<reponame>bytecodealliance/wasm-tools
//! This mutator applies a random peephole transformation to the input Wasm module
use crate::error::EitherType;
use crate::module::PrimitiveTypeInfo;
use crate::mutators::peephole::eggsy::analysis::PeepholeMutationAnalysis;
use crate::mutators::peephole::eggsy::encoder::Encoder;
u... |
import sys
N,K=map(int,input().split())
v=list(map(int,input().split()))
ans=0
for i in range(1,min(K,N)+1):
for j in range(i+1):
x=[v[k] for k in range(j)]+[v[k] for k in range(N-i+j,N)]
tmp=sum(x)
x.sort()
for k in range(min(i,K-i)):
if x[k]<0: tmp-=x[k]
... |
/**
* Apply this generic to the given line and use the RealtimeValues object store the values
* @param line The raw data line
* @param rtvals The realtimevalues to add the data to
* @return an array with the data
*/
public Object[] apply( String line, RealtimeValues rtvals ){
for( Filte... |
// nextGUID returns the next free group id to use, according to whether it is a
// system's group.
func nextGUID(isSystem bool) (db *dbfile, gid int, err error) {
loadConfig()
db, err = openDBFile(_GROUP_FILE, os.O_RDWR)
if err != nil {
return
}
info, err := db.file.Stat()
if err != nil {
db.close()
return ... |
/**
* @param atomicityMode Atomicity mode.
* @param cacheMode Cache mode.
* @throws Exception If failed.
*/
private void testTouchOrderWithFairFifoEviction(CacheAtomicityMode atomicityMode, CacheMode cacheMode)
throws Exception {
startGrid(0);
CacheConfiguration<Object, Objec... |
A conspiracy theory subreddit devoted to President Donald Trump is apparently writing our legislation now.
According to Wired , a Republican staffer actively asked r/The_Donald—widely known for being home to racism, xenophobia, and Islamophobia—for advice in crafting an amendment.
H.Res.477 , which was proposed on We... |
The transformation of open source projects into business ventures doesn’t always proceed smoothly: Witness Mandriva Linux and OpenOffice.org, to name just a couple examples. But ownCloud, which began the launch of a commercial entity in December 2011, seems to be off to a decidedly successful start, with the release of... |
Three-component Ag-catalyzed enantioselective vinylogous mannich and Aza-Diels-Alder reactions with alkyl-substituted aldehydes.
Efficient protocols for three-component catalytic enantioselective vinylogous Mannich (VM) reactions of alkyl-substituted aldimines (including those bearing heteroatom-containing substituent... |
/**
* Helper class for processing and handling media files, mostly handler code best
* kept out of the controller and model beans.
*
*/
@ManagedBean(eager=true)
@ApplicationScoped
public class MediaHelper implements Serializable{
private static final Logger logger = Logger.getLogger(MediaHelper.class
.toStrin... |
<reponame>TTitcombe/tfShell2
import numpy as np
import tensorflow as tf
from types import MethodType
class TestCase:
def __init__(self, model):
self._model = model
class BaseTester:
"""
This class forms a base for testing Tensorflow 2.0 models.
In this class you can add basic test cases, suc... |
declare namespace javax {
namespace sound {
namespace midi {
namespace spi {
abstract class MidiFileWriter {
public constructor()
public abstract getMidiFileTypes(): number[]
public abstract getMidiFileTypes(arg0: javax.sound.midi.Sequence): number[]
public i... |
// startAllocatingFromBlock resets the counters used to determine from
// which "new" block to allocate data. This function is called whenever
// the list of "new" blocks changes.
func (lbm *OldCurrentNewLocationBlobMap) startAllocatingFromBlock(i int) {
lbm.allocationBlockIndex = i
if i >= lbm.newBlocks-lbm.desiredN... |
/**
* REST controller for managing FileUploadAssessment.
*/
@RestController
@RequestMapping("/api")
public class FileUploadAssessmentResource extends AssessmentResource {
private final Logger log = LoggerFactory.getLogger(FileUploadAssessmentResource.class);
private static final String ENTITY_NAME = "fileUp... |
/**
* Handles state messages for a particular task object
* @param processingTask A task object
* @param state The state of the task
*/
public void handleState(ProcessingTask processingTask, int state) {
switch (state) {
case TASK_COMPLETE:
Message completeMessage... |
def calc_ave_coord(grp: pd.DataFrame) -> pd.Series:
d = {}
grp = grp.sort_values(by='datetime')
d['img_list'] = grp['image'].values.tolist()
d['epoch_list'] = grp['epoch'].values.tolist()
d['wavg_ra'] = grp['interim_ew'].sum() / grp['weight_ew'].sum()
d['wavg_dec'] = grp['interim_ns'].sum() / gr... |
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
int n;
cin >> n;
vector<ll> arr(n);
ll total_sum = 0;
for(int i=0; i<n; i++) {
cin >> arr[i];
total_sum += arr[i];
}
ll res = 0;
if(total_sum%3 == 0) {
ll num1 = total_sum/3;
ll num2 = 2*num1;
ll sum = 0, cnt1 =... |
def sendData():
content = request.get_json()
print(content)
if content["imit"] == 1:
content["vSeti"] = random.randint(219, 223)
content["vAkk"] = random.randint(4, 5)
content["temp"] = random.randint(10,30)
else:
state = Point.query.filter_by(id=content["id"]).first()
... |
/**
* The type App main builder.
* Director constructs an object using the Builder interface.
*/
public class AppMainBuilder {
public static void main(String[] args) {
final OrderService service = new OrderService();
final List<Item> itemList = service.order(Arrays.asList(new HappyMeal(), new Ro... |
def _load_file(self):
try:
with open(self._filepath) as fp:
try:
data = yaml.load(fp, Loader=yamlloader.ordereddict.Loader)
except (yaml.parser.ParserError,
yaml.scanner.ScannerError) as exc:
new_exc = HM... |
package config
import (
"context"
"io/ioutil"
"net"
"net/http"
"strings"
"github.com/juju/errors"
)
const ifconfigAddress = "https://ifconfig.co/ip"
func getGlobalIPv4() (net.IP, error) {
return fetchIP("tcp4")
}
func getGlobalIPv6() (net.IP, error) {
return fetchIP("tcp6")
}
func fetchIP(network string) ... |
sh = {}
for i in range(1, 100):
for j in range(1, 100):
if i ** j > 10 ** 10:
break
k = i ** j
v = str(i) + '^' + str(j)
if len(str(k)) < len(v):
v = str(k)
if k not in sh or len(sh[k]) > len(v):
sh[k] = v
n = input()
ans = st... |
/**
* Establishes and returns a new connection to the given node. The connection is NOT maintained by this service, it's the callers
* responsibility to close the connection once it goes out of scope.
* @param node the node to connect to
* @param connectionProfile the connection profile to use
... |
/**
* A representation of a Vault Package with reasonable defaults for testing.
*/
@SuppressWarnings("unused")
public class PackageFixture {
@Nonnull
private final PackageId _packageId;
private String _description;
private String _thumbnail;
private int _buildCount;
private long _created = new... |
<gh_stars>1-10
package main
import "fmt"
func f5() (s3 []int) {
s3 = []int{1, 1}
defer func() {
s3[1] = 10
}()
return []int{3, 3}
}
//改造这个函数
//1. 先给返回值赋值
//2.把defer改造成正常的函数
//3.空洞的return返回
//改造
func f55() (s1 []int) {
s1 = []int{1, 1}
s1 = []int{3, 3}
func() {
s1[1] = 10 //闭包 s1 [3, 10]
}()
return
}
f... |
/************************************************************************/
/* */
/* Main routine, AlgoC45 */
/* ------------------ */
/* */
/************************************************************************/
#include "header.h"
#include "besttree.h"
#incl... |
"""
Copyright 2014 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 or ... |
# Copyright (c) 2008-2009 <NAME> <<EMAIL>>
#
# 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... |
<reponame>naparuba/opsbro
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014:
# <NAME>, <EMAIL>
import sys
import time
from math import ceil
from opsbro.characters import CHARACTERS
from opsbro.log import cprint, sprintf, logger
from opsbro.cli_display import print_h1
from opsbro.packer import pa... |
// GetNetworkPolicyAttachment gets an existing NetworkPolicyAttachment resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetNetworkPolicyAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NetworkPolicy... |
/**
* A container filter class responsible for automatic authentication of REST endpoints. Any rest endpoints annotated
* with {@link Authenticate} annotation, will go through authentication.
*/
@javax.ws.rs.ext.Provider
public class AuthenticationFilter implements ContainerRequestFilter {
private static final Set... |
<gh_stars>1-10
import { Filter } from '@/types/typesLex';
import { BIO_EDGE_TYPE_OPTIONS } from '@/utils/ModelTypeUtil';
import { QUERY_FIELDS_MAP } from '@/utils/QueryFieldsUtil';
// BIO PATH QUERIES
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
const bioPathPre = (bgraphPathQuery, cla... |
/*
* object_to_string() - convert object to string
* return: formatted string
* object(in): object value to convert
* format(in): conversion format type
*/
static char *
object_to_string (DB_OBJECT * object, int format)
{
if (object == NULL)
return NULL;
if (format == OBJECT_FORMAT_OID)
{
c... |
// CSV returns a CSV representation of the Dataset an Export.
func (d *Dataset) CSV() (*Export, error) {
records := d.Records()
b := newBuffer()
w := csv.NewWriter(b)
w.WriteAll(records)
if err := w.Error(); err != nil {
return nil, err
}
return newExport(b), nil
} |
Choi “Polt” Seong Hun is one of competitive StarCraft’s biggest names. Having taking the WCS championship title three times in a row already, this year’s WCS Winter Championship in Katowice brings with it the opportunity to lift the trophy for the fourth time as well as secure a seed at BlizzCon. Here we speak with Pol... |
/**
* Initializes the environment.
*/
public class Initializer {
private static final Logger logger = LoggerFactory.getLogger(Initializer.class);
@Autowired
private transient SatelliteService satService;
public Initializer()
throws Exception {
logger.info("Initializing application e... |
class PdfPage:
""" Page helper class. """
def __init__(self, page, pdf):
self._page = page
self._pdf = pdf
@property
def raw(self):
""" FPDF_PAGE: The raw PDFium page object handle. """
return self._page
@property
def pdf(self):
""" PdfDocum... |
package org.apache.mesos.selenium.model;
/**
* Created by waseemh on 15/09/2015.
*/
public abstract class SeleniumGridResource {
private int cpus;
private int mem;
private int disk;
public int getCpus() {
return cpus;
}
public void setCpus(int cpus) {
this.cpus = cpus;
... |
<reponame>light4/heph
//! Logging related types.
//!
//! Logging in Heph is done via the [`log`] crate, much like the entire Rust
//! ecosystem does (or should). However the log crate doesn't provide an actual
//! logging implementation, it only defines macros for logging.
//!
//! Heph doesn't provide a logging impleme... |
// errorcheck
// Copyright 2009 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.
// Test case for issue 471. This file shouldn't compile.
package main
const a *int = 1 // ERROR "convert|wrong|invalid"
const b [2]int =... |
//======================================================================================================================
// lst file parser
//======================================================================================================================
class line_reader_t
{
public:
line_reader_t(ifstream& i... |
// GetDiskSize returns the disk size on the Settings app.
func (s *Settings) GetDiskSize(ctx context.Context) (string, error) {
diskSizeFindParams := ui.FindParams{
Role: ui.RoleTypeStaticText,
Attributes: map[string]interface{}{"name": regexp.MustCompile(`[0-9]+.[0-9]+ GB`)},
}
node, err := ui.FindWithTim... |
export function getURL(os: string, version: string): string {
const ext = (os: string) => {
if (os === 'pc-windows-msvc') {
return 'zip';
} else {
return 'tar.gz';
}
};
const mdbookName: string = `mdbook-v${version}-x86_64-${os}`;
const baseURL: string =
'https://github.com/rust-lan... |
<reponame>sven09/expo-uikitten-typescript-navigation-rematch-boilerplate
import { init, RematchRootState } from '@rematch/core';
import createLoadingPlugin from '@rematch/loading';
import { useDispatch } from 'react-redux';
import * as models from './models';
const loading = createLoadingPlugin({});
export const sto... |
<gh_stars>100-1000
#!/usr/bin/env python3
# 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 at
#
# http://www.apache.org/licenses/LICENSE-2.0... |
/**
* Copy the collected ApplicationUser objects to a target array, in sorted
* order.
*
* @param array The target array (must be large enough to hold the Count of
* items starting at arrayIndex).
* @param arrayIndex The starting index in the target array at which to begin
* ... |
while True:
s = ''
try:
s = input()
except:
break
slen = len(s)
st = '0'
if s[0] == '9':
st = '1'
else:
st = chr(ord(s[0]) + 1)
slen = slen - 1
nex = int(st + '0' * slen)
print(nex - int(s))
|
/**
* Draws the arrow-head for its current size and position values.
*/
public void draw()
{
getElements().clear();
getElements().add(new MoveTo(x, y + length / 2));
getElements().add(new LineTo(x + width / 2, y - length / 2));
if (radius > 0)
{
final Ar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.