content stringlengths 10 4.9M |
|---|
/*****************************************************************************/
/**
*
* XLlFifo_iRxGetLen notifies the hardware that the program is ready to receive the
* next frame from the receive channel of the FIFO specified by <i>InstancePtr</i>.
*
* Note that the program must first call XLlFifo_iRxGetLen before p... |
/**
* Created by IntelliJ IDEA.
* User: lloix
* Date: Sep 20, 2006
* Time: 4:06:50 PM
* To change this template use File | Settings | File Templates.
*/
public class UpdateStatusAction extends BasicAction
{
protected String getActionName() { return "UpdateStatus"; }
protected boolean isEnabled(Pr... |
/**
* Creates a DriverManager-based ConnectionFactory for creating the Connection
* instances to feed into the object pool of the specified jcd-alias.
* <p>
* <b>NB!</b> If you override this method to specify your own ConnectionFactory
* you <em>must</em> make sure that you follow OJB's li... |
def greater_than_equal(self, valueThunk):
if self.min is not None and self.min() < float(valueThunk()) and self.base_min > float(valueThunk()):
if (type(valueThunk()) is str):
self.min = lambda: float(valueThunk())
else:
self.min = valueThunk |
def build_input_node(self):
import nipype.interfaces.utility as nutil
import nipype.pipeline.engine as npe
import clinica.pipelines.dwi_processing_noddi.dwi_processing_noddi_utils as utils
subject_id_list, noddi_preprocessed_dwi, noddi_preprocessed_bvec, noddi_preprocessed_bval, noddi_pr... |
import Complete from './model/complete'
import { CompleteOption, ISource, RecentScore, VimCompleteItem } from './types'
import { fuzzyMatch, getCharCodes } from './util/fuzzy'
const logger = require('./util/logger')('completes')
export class Completes {
public complete: Complete | null
public recentScores: RecentS... |
Estimation of Input of Unintentionally Produced Persistent Organic Pollutants into the Air Basin of the Odessa Industrial-and-Urban Agglomeration
The environmental legislation in Ukraine is changing rapidly. These changes are related to the adaptation of Ukrainian laws to the requirements of the European Union. In thi... |
export interface Resolver {
resolve(instance, basePath: string);
}
|
def connect(self, event, callback):
listener_id = self.events.connect(event, callback)
logger.debug('[app] connecting event %r: %r [id=%s]', event, callback, listener_id)
return listener_id |
<reponame>ljk662/oracle-feeder<filename>price-server/src/provider/fiat/quoter/index.ts
export * from './CurrencyLayer'
export * from './AlphaVantage'
export * from './Fixer'
|
#ifndef BABYLON_RENDERING_EDGES_RENDERER_H
#define BABYLON_RENDERING_EDGES_RENDERER_H
#include <unordered_map>
#include <babylon/babylon_api.h>
#include <babylon/babylon_fwd.h>
#include <babylon/maths/vector3.h>
#include <babylon/misc/observer.h>
#include <babylon/rendering/iedges_renderer.h>
#include <bab... |
package service;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import vo.Eventbrite;
public class EventbriteService extends AbstractService{
public Eventbrite possibleEvents() {
try {
String urlString = "https://www.eventbrite.de/directory/js... |
import { ToastController } from "@ionic/angular";
import { HttpResponseMessageSeverity } from "serious-game-library/dist/utils/http/HttpResponse";
export class ToastWrapper {
private _header: string;
private _position: ToastPosition;
private _message: string;
private _buttons: ToastButton[];
privat... |
<gh_stars>0
/*
* This file is part of the Yildiz-Engine project, licenced under the MIT License (MIT)
*
* Copyright (c) 2019 <NAME>
*
* More infos available: https://engine.yildiz-games.be
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* doc... |
In this guide we're going to discuss the major components of AWS EC2 Container Service (ECS), what they are conceptually and how they work together.
The prime directive - understanding how hosting, scaling and load balancing an application with Docker and ECS works. What are the primary pieces? How do we put the puzzl... |
Image credit: liberationnews
On April 5th, 2017, Civil Rights figure and Congressman John Lewis (D-GA-5) proposed H.R. 1947, or the Religious Freedom Peace Tax Fund Act of 2017. The purpose of this bill is “to affirm the religious freedom of taxpayers who are conscientiously opposed to participation in war, to provide... |
package com.joymain.jecs.sys.webapp.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import... |
<filename>src/app/gui/selection-view/selection-view.component.ts<gh_stars>0
import { Component, OnInit } from '@angular/core';
import { Conveyor } from '../../conveyor.service';
// import { CategorySpec } from 'src/app/ehr/datatype';
import { DataList } from '../../ehr/datalist';
import { Router } from '@angular/router... |
/**
* Controller for Punch Out Inspect operation.
*/
@Component
@RequestMapping(value = "/punchout/cxml/inspect")
public class DefaultInspectCartController extends AbstractCartPageController implements PunchOutController
{
private static final String INSPECT_PAGE = "/pages/cart/inspect";
@Resource(name = "cartFac... |
/*
* Copyright (C) 2015 iChano incorporation's 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 requ... |
// Find an action for the method call, updating expectation match state in the
// process. Return either an action that should be invoked or a set of zero
// values to return immediately.
//
// This is split out from HandleMethodCall in order to more easily avoid
// invoking the action with locks held.
func (c *control... |
def proxy_property(attribute: str, proxy: str) -> Any:
Typing note
There is no real way to type properties returned by a function,
not to speak about the arbitrary getattr/setattr.
This explains the use of Any everywhere
not_proxied_value: Any = None
def getter(obj: Any) -> Any:
dest... |
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link route.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link route#newInstance} factory method to
* create an instance of this fragment.
*/
public class route extends F... |
/**
* @author wangcc
* @date 2018/2/9
* @describe
*/
public class VoiceManagerConstant {
//------Play
public static final int VM_PLAY_PREPARED = 8;
public static final int VM_PLAY_FAIL = 9;
public static final int VM_PLAY_COMPLETE = 10;
public static final int VM_PRE_PLAY_COMPLETE = 11;
//... |
// extractSkipCount returns number of lines to skip
func extractSkipCount(text string) int {
count := strutil.ReadField(text, 2, true)
if count == "" {
return 1
}
countInt, err := strconv.Atoi(count)
if err != nil || countInt <= 0 {
return 0
}
return countInt
} |
class User:
'''
class User generates a user, stores data with the help of encryption.
'''
def __init__(self, new_usr:bool, usrname:str, passwd:str)->None:
'''
create User
takes new_user (bool) as parameter
'''
self.usrname = usrname
self.__password = pas... |
#include <ncursesw/curses.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <wchar.h>
using namespace std;
bool gameOver;
int width = 0;
int height = 0;
int x, y, fruitX, fruitY, score;
int * tailX, * tailY;
int nTail;
enum eDirecton { STOP = 0, LEFT, RIGHT, UP, DOWN};
eDirecto... |
def overlap_set(self):
self.v_overlap = float(random.randint(1,5)/10)
self.h_overlap = float(random.randint(1,5)/10) |
/**
* gtk_editable_install_properties:
* @object_class: a `GObjectClass`
* @first_prop: property ID to use for the first property
*
* Installs the `GtkEditable` properties for @class.
*
* This is a helper function that should be called in class_init,
* after installing your own properties.
*
* To handle the p... |
<filename>src/resultview/html/src/components/Base/Table.tsx
import * as React from "react";
interface Props {
columns: string[];
rows: (string | number)[][];
}
const Table: React.FunctionComponent<Props> = (props) => {
return (
<table style={styles.table}>
<thead>
<tr>
... |
import { Component, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-button',
template: `
<button (click)="raise.emit()">{{ name }}</button>
`,
})
export class NestedButtonComponent {
@Input() name: string;
@Output() raise = new EventEmitter<void>();
}
@Component({
selec... |
Join Game Create Game Error: Create a New Game game setup more options Game Name:
The game's name is searchable from the Join section Game Password:
This password is needed to join the game Player Name:
Your name, be creative! Player Password:
If your browser closes, use this password to rejoin the game Gameplay Op... |
def graph_3d_embedding(d_ij, verbose = False):
N = numpy.size(d_ij, 0)
N2 = N * 2
def f(xyz):
x = xyz[:N]
y = xyz[N:N2]
z = xyz[N2:]
result = 0.0
for i in range(1, N):
for j in range(i):
dr2 = (x[i] -... |
<reponame>commitd/krill
package io.committed.krill.extraction.pdfbox.text;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import io.committed.krill.extraction.pdfbox.PdfStripper;
import io.committed.krill.extraction.pdfbox.physical.Style;
import io.committed.krill.extraction.pdfbox.... |
import sys
sys.path.insert(0, "../../bindings/python/")
from numpy import array as arr_t # ndarray dtype default to float64, while array's is int64!
from numpy import arange
from numpy import frombuffer
from math import exp, log, sqrt, pi
from libcloudphxx import lgrngn
from libcloudphxx import common
def lognormal(... |
def selection_enabled(self, selection_enabled):
self.__selection_enabled = selection_enabled
self.x_selection.enabled = selection_enabled
self.xerr_selection.enabled = selection_enabled
self.y_selection.enabled = selection_enabled
self.yerr_selection.enabled = selection_enabled |
<reponame>vert-x3/vertx-lang-ceylon
package io.vertx.ceylon.auth.common;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.TypeInfo;
import com.redhat.ceylon.compiler.java.metadata.TypeParameter;
import com.redhat.ceylon.compiler.java.metadata.TypeParameters;
impor... |
// CommerceCheckoutCurrentContext returns the last saved context
func (r *CommerceCheckoutQueryResolver) CommerceCheckoutCurrentContext(ctx context.Context) (*dto.PlaceOrderContext, error) {
pctx, err := r.placeOrderHandler.CurrentContext(ctx)
if err != nil {
return nil, err
}
dc := graphqlDto.NewDecoratedCart(r.... |
//------------------------------PhaseConservativeCoalesce----------------------
// Conservatively, pessimistic coalesce copies. Conservative means do not
// coalesce if the resultant live range will be uncolorable. Pessimistic
// means we cannot coalesce if 2 live ranges interfere. This implies we do
// not hit a fi... |
Migrants wait in a raft as an Italian navy ship prepares to rescue them on Wednesday. Italian Marina Militare / Reuters
The Italian navy rescued more than 1,100 migrants from nine large rafts in the waters south of Sicily late Wednesday night and Thursday morning. The rescues are part of a crackdown on the increasingl... |
import { registerEnumType } from '@nestjs/graphql';
import { StatusEnum } from '../user/user.enum';
export enum SchoolTypeEnum {
PRIVATE = 'PRIVATE',
INTERNATIONAL = 'INTERNATIONAL',
GOVERNMENT = 'GOVERNMENT'
}
registerEnumType(SchoolTypeEnum, { name: 'SchoolTypeEnum' });
export enum SchoolAttachmentTypeEnum {
... |
<filename>app/goods/service/internal/biz/order.go
package biz
import (
"context"
"github.com/go-kratos/kratos/v2/log"
)
// 定义表结构体
type Orders struct {
Id int64
Sn string
Uid int64
}
type OrderGoods struct {
Id int64
OrderId int64
GoodsTitle string
}
type OrdersUsecase struct {
repo OrdersRepo... |
/* G - N M G . C
* BRL-CAD
*
* Copyright (c) 1993-2014 United States Government as represented by
* the U.S. Army Research Laboratory.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as p... |
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N, K = mapint()
from collections import Counter
As = list(mapint())
count = Counter(As)
mod = 10**9+7
maxi = 0
cum = 0
pos = {}
neg = {}
pos[0] = 1
neg[0] = 1
As = sorted(list(set(As)... |
def deploy(self, instance_type: str, container_image: str, machine_image="UbuntuServer"):
try:
utils.check_config_exists(config)
credential = self._get_stored_session()
subscription_client = SubscriptionClient(credential)
Azure._get_subscription_id(subscription_cl... |
"""Methods to provide code linting."""
from invoke import task, Context
from tasks.utils import get_project_files
@task
def lint(context):
# type: (Context) -> None
"""Run various linters against the code base."""
files_space_separated = " ".join(get_project_files())
context.run("flake8 {}".format(f... |
<gh_stars>0
import { getPairingUri } from 'src/logic/wallets/pairing/utils'
import { useEffect, useState } from 'react'
export const useGetPairingUri = (): string | undefined => {
const onboardUri = getPairingUri()
const [uri, setUri] = useState<string>()
useEffect(() => {
setUri(onboardUri)
}, [onboardUr... |
package main
import (
"database/sql"
"flag"
"fmt"
"log"
"repo.inplayer.com/workshop/Unsolved_Problems/ClashRoyal/cmd/dailyupdates/pkg/workers"
"repo.inplayer.com/workshop/Unsolved_Problems/ClashRoyal/pkg/errors"
"repo.inplayer.com/workshop/Unsolved_Problems/ClashRoyal/pkg/queries"
)
func handleErr(err error){
... |
/**
* A value object containing the information needed to create a Jndi object.
*/
public class JndiConfig {
private String connectionName, connectionPassword, connectionUrl,
roleBase, roleNameRDN, roleMemberRDN,
userBase, userNameRDN;
public JndiConfig(final String connectionName, final String conne... |
/**
* AWS implementation of Secret Manager.
*
* @author Bruce Skingle
*
*/
public class AwsSecretManager implements ISecretManager
{
private static final Logger log_ = LoggerFactory.getLogger(AwsSecretManager.class);
private static final ObjectMapper MAPPER = new ObjectMapper();
private AWSSecrets... |
// ConfirmValues confirms to the user the values to be used to create the new git repository
// if using batch mode lets just validate the values are supplied or fail
func (r *CreateRepository) ConfirmValues(i input.Interface, batch bool) error {
if batch {
if r.GitServer == "" {
return options.MissingOption("git... |
def _async_update_config_entry_from_yaml(hass: HomeAssistant, entry: ConfigEntry, yaml_config: ConfigType):
data = entry.data.copy()
data.setdefault(const.CONF_CONNECTION_TYPE, const.CONNECTION_TYPE_DIRECT)
if const.CONF_DEVICES_DISCOVERED not in data:
data.setdefault(const.CONF_DEVICES_DISCOVERED... |
<reponame>mjhoy/ybapp
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Applicant ( ApplicantSheet
, sheetName
, applicants
, Applicant
, downloadURLs
, name
, rowToApplicant
... |
/*
* out_fini -- close the log file
*
* This is called to close log file before process stop.
*/
void
out_fini()
{
if (Out_fp != NULL && Out_fp != stderr) {
fclose(Out_fp);
Out_fp = stderr;
}
void *p = pthread_getspecific(Last_errormsg_key);
if (p) {
free(p);
pthread_setspecific(Last_errormsg_key, NULL)... |
/**
* Transfer data of a tsfile to the receiver.
*/
private void syncSingleFile(File snapshotFile)
throws SyncConnectionException, SyncDeviceOwnerConflictException {
try {
int retryCount = 0;
MessageDigest md = MessageDigest.getInstance(SyncConstant.MESSAGE_DIGIT_NAME);
serviceClient.i... |
package fs
import (
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"github.com/philips-labs/fatt/pkg/attestation"
)
// Discoverer discovers an attestations.txt from the filesystem
type Discoverer struct{}
var _ attestation.Discoverer = (*Discoverer)(nil)
// Discover discovers an attestations.txt
func (r *Discoverer... |
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
int a[4],flag=0;
while (~scanf("%d%d%d%d",&a[0],&a[1],&a[2],&a[3]))
{
if(a[0]==0&&a[1]==0&&a[2]==0&&a[3]==0)break;
if (flag!=0)
{
printf("\n");
}
flag=1;
int sum=0,b[24];
sort(a,a+4);
do {
... |
<reponame>scotts/torcharrow
# Copyright (c) Facebook, Inc. and its affiliates.
import json
import typing as ty
import warnings
import torcharrow as ta
import torcharrow.dtypes as dt
from .dispatcher import Dispatcher, Device
from .trace import Trace, trace
# ----------------------------------------------------------... |
// newSplitQueue returns a new instance of splitQueue.
func newSplitQueue(store *Store, db *client.DB, gossip *gossip.Gossip) *splitQueue {
var purgChan <-chan time.Time
if c := store.TestingKnobs().SplitQueuePurgatoryChan; c != nil {
purgChan = c
} else {
purgTicker := time.NewTicker(splitQueuePurgatoryCheckInt... |
//
// VIPEvent.h
// viper
//
// Created by zlpro on 2020/3/7.
// Copyright © 2020 VIPER. All rights reserved.
//
#import "Event.h"
@interface Event : NSObject <Event>
@property (strong , nonatomic) NSString *name; //事件名称
@property (strong , nonatomic) id data; //事件参数
+ (instancetype) eventWithName:(NSString*)... |
/*******************************************************************************
* Function Name : CAN_InvalidateAllMsgObj
* Description : Configures all the message objects as unused.
* Input : None
* Output : None ... |
<gh_stars>0
from apps.export.impl.base import FieldSpecificExporter
import os
class TextExporter(FieldSpecificExporter):
fmt = 'txt'
description = "Plain unformatted text format"
priority = 20
@property
def headers(self):
return {
'Content-Type': 'text/plain; charset=utf-8',
... |
Nonparametric Mean Estimation with Missing Data
Abstract Missing data occur in most applied statistical analysis. The need to estimate the conditional or unconditional mean of a variable when some of its observations are missing is very frequent. In this article we study the effect of missing observations on the respo... |
use std::convert::TryFrom;
use std::fs;
fn main() {
let input = fs::read_to_string("input").expect("couldn't read input file");
let codes = parse_codes(&input);
let max_thruster = find_max(&codes, 0);
println!("Part one: {}", max_thruster);
let max_thruster = find_max(&codes, 5);
println!("Pa... |
//--------------------------------------------------------------------------
/// Returns the full path to this item in the command tree.
/// \return The full comamnd path to this item.
//--------------------------------------------------------------------------
gtASCIIString CommandProcessor::GetFullPathString() const
... |
def testUsingTestData(self):
subject_locality = saml.subject_locality_from_string(
saml2_data.TEST_SUBJECT_LOCALITY)
assert subject_locality.address == "127.0.0.1"
assert subject_locality.dns_name == "localhost"
new_subject_locality = saml.subject_locality_from_string(
... |
<filename>storage/driver/inmemory/claims.go
package inmemory
import (
"sync"
"github.com/danielkrainas/tinkersnest/api/v1"
"github.com/danielkrainas/tinkersnest/storage"
)
type claimStore struct {
m sync.Mutex
claims []*v1.Claim
}
func (s *claimStore) Store(c *v1.Claim, isNew bool) error {
s.m.Lock()
de... |
<filename>src/app/contracts/allmodules.ts
export { AeForUsers } from '../contracts/AeForUsers';
export { AeUnlockOnTime } from '../contracts/AeUnlockOnTime';
export { FungibleToken } from '../contracts/FungibleToken';
|
<reponame>HughJass/polybar<filename>include/x11/xresources.hpp
#pragma once
#include "settings.hpp"
#if not WITH_XRM
#error "Not built with support for xcb-xrm..."
#endif
#include <xcb/xcb_xrm.h>
#include "common.hpp"
#include "errors.hpp"
#include "utils/string.hpp"
#include "x11/connection.hpp"
POLYBAR_NS
DEFIN... |
/// A "text box" that allows searching of resource types. This wraps itself up
/// to still pretend (slightly) that it's a text box, however when edited it
/// will make a search view so the user can pick from the resources.
class SearchableResourceTextBox : public Composite
{
public:
typedef SearchableResourceTextBo... |
<gh_stars>1-10
export type Document = {
id: string,
name: string,
document_type: string,
document_content: DocumentContent,
tenant: string,
key: string
}
export type DocumentContent = {
created_at: string,
doc_object: DocObject[],
tenant: string,
image_path: string,
document_path: string,
key: ... |
package transport
import (
"crypto/tls"
"fmt"
"github.com/lucas-clemente/quic-go"
"github.com/tobyxdd/hysteria/pkg/conns/faketcp"
"github.com/tobyxdd/hysteria/pkg/conns/udp"
"github.com/tobyxdd/hysteria/pkg/conns/wechat"
"github.com/tobyxdd/hysteria/pkg/obfs"
"net"
"time"
)
type ClientTransport struct {
Dia... |
/**
* Created by chengzhiliang on 2018/12/6.
*/
public class ArchiveManager extends Service {
private static final Logger logger = LoggerFactory.getLogger(ArchiveManager.class);
// 集群管理
private BrokerContext context;
// 发送归档服务
private ProduceArchiveService sendArchiveService;
// 消费归档服务
p... |
def flip_buffered_to_active_captions(self, time_code: Optional[SmpteTimeCode] = None):
temporary_caption = None
if self.has_active_caption():
temporary_caption = self.active_caption
if time_code is not None:
if self.has_active_caption():
self.push_active_caption_to_model(time_code)... |
def _update_connections(self,event=None,*args,**kwargs):
for row,item in enumerate(self.panels):
self.list_connections[row][0] = item[2].GetValue()
self.list_connections[row][1] = item[0].connection
self.list_connections[row][2] = item[1].retrieve[0]
self.list_con... |
Graça Santos has never been one to mince her words. Politicians in Portugal are all corrupt, incompetent and lazy, complains the fish seller at the historic market Bolhão in the northern commercial center of Porto. Their stupidity and self-interest ruined the country and forced it into the EU bailout program, which it ... |
def column_selected(self, event):
selected_column_x = self.column_x.GetStringSelection()
selected_column_y = self.column_y.GetStringSelection()
selected_column_hue = self.column_hue.GetStringSelection()
if selected_column_x and selected_column_y and selected_column_hue:
self.... |
<reponame>ornata/llvm-project
//===----------------------------------------------------------------------===//
//
// 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
//
//... |
def verifyToken(token):
successCode = int(token["successCode"])
pinError = int(token["pinError"])
expiresStr = token["expires"].replace(" ", "T").replace("Z", "")
expiresTime = datetime.datetime.strptime(expiresStr, '%Y-%m-%dT%H:%M:%S')
syncedTime = Time.syncedNow()
if syncedTime > expiresTime:
... |
/**
* Create a content type instance. {@code ContentType} instance must be created only by this method.
* @param contentTypeString string which may contains a content type. This parameter must not be null.
* @return {@code ContentType} instance
*/
public static ContentType createContentType(String contentTypeSt... |
<gh_stars>1-10
#include <QtCore/QDebug>
#include <QtCore/QSettings>
#include <QtCore/QFile>
#include <QtCore/QUrl>
#include <QtCore/QList>
#include <QtCore/QXmlStreamReader>
#include <QtCore/QProcess>
#include <QtCore/QStringList>
#include <QtCore/QSocketNotifier>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/... |
package com.nitya.accounter.web.client.ui.vat;
import java.util.ArrayList;
import java.util.List;
import com.google.gwt.user.client.ui.Label;
import com.nitya.accounter.web.client.AccounterAsyncCallback;
import com.nitya.accounter.web.client.core.AccounterCoreType;
import com.nitya.accounter.web.client.core.ClientTAX... |
package rule
import (
"hash/crc64"
"github.com/dlclark/regexp2"
"github.com/ory/ladon/compiler"
)
type regexpMatchingEngine struct {
compiled *regexp2.Regexp
checksum uint64
table *crc64.Table
}
func (re *regexpMatchingEngine) compile(pattern string) error {
if re.table == nil {
re.table = crc64.MakeTa... |
/*
Removing an element changes the parity of the sum.
New sum = (sum - a[k]) - 2*suff[k+1]
= pref[k-1] - suff[k+1]
Discrete analogue of IVT.
If sum is x
We start from 0 and ends at x with +-1 jump. Then there must be a point where sum = ceil(x/2).
E.g. x = 5, then if we start from... |
#include"define.h"
static GENE ** Offspring_allocator(int size_of_element[]) //为子代申请内存空间 [island][size of island]
{
GENE **temp = NULL;
temp = (GENE **)malloc((ISLAND) * sizeof(GENE *));
if (temp != NULL)
{
for (int i = 0; i < ISLAND; i++)
temp[i] = (GENE*)malloc((size_of_element[i] + 1) * sizeof(GENE));
}
... |
package cn.micro.biz.pubsrv.im.model.msg;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
/**
* YunXin Msg Send Batch Attach Msg
*
* @author lry
*/
@Data
@ToString
public class YunXinMsgSendBatchAttachMsg implements Serializable {
private String fromAccid;
private String toAccid... |
n, s = input(), set()
for _ in [0, 0]:
a = map(int, raw_input().split())
for x in a[1:]:
s.add(x)
print ['Oh, my keyboard!', 'I become the guy.'][len(s) == n] |
def work(self, input_items, output_items):
out = output_items[0]
num_sample_bytes = self.gf.comms.device.read(self.pipe_id, self.buffer, self.WORK_TIMEOUT)
samples = self.buffer[0:num_sample_bytes]
if self.pending_samples:
samples = self.pending_samples + samples
if n... |
/// Transforms a marshalled RTP packet into a parsed representation which can be used
/// with the library. If the unmarshalling process fails, an error will be returned.
pub fn from_raw(raw_packet: &[u8]) -> Result<Self, RtpPacketError> {
// If the packet lenght is lesser than the header's length, we return an... |
<gh_stars>0
import traceback
import boto3
import structlog
from crhelper import CfnResource
from schema import Optional
import codesmith.common.cfn as cfn
import codesmith.common.naming as naming
import codesmith.common.ssm as cssm
from codesmith.common.cfn import resource_properties, old_resource_properties
from cod... |
/**
* Fill select drive.
* @author atrifonov.
* @since 06.03.2018.
*/
@Controller
public class DriveController {
@Autowired
DriveRepository driveRepository;
@RequestMapping(value = "/drive", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public List<Drive> getBodies() ... |
package com.me.harris.textviewtest.pattern;
import android.util.Log;
import org.reactivestreams.Subscription;
import io.reactivex.Flowable;
import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.ObservableTransformer;
import io.reactivex.disposables.CompositeDisposable;
import io.r... |
One of the wonderful things about the internet is that you can find just about anything if you know where to look. This can also be one of the worst things about it. When I'm on Twitter, I have pleasant, interesting conversations with pleasant, interesting people – but the misogyny, homophobia, transphobia and racism o... |
// Given a list of heaps that are pending usage, this function will estimate memory needed,
// evict resources until enough space is available, then make resident any heaps scheduled for
// usage.
MaybeError ResidencyManager::EnsureHeapsAreResident(Heap** heaps, size_t heapCount) {
if (!mResidencyManagementEnab... |
// Initialize a uv_handle_t with give type, return NULL on fail.
// the returned handle's data field is a new allocated slot
uv_handle_t* hs_uv_handle_alloc(uv_handle_type typ, uv_loop_t* loop){
uv_handle_t* handle = malloc(uv_handle_size(typ));
if (handle == NULL) { return NULL; }
else {
handle->lo... |
def load(self) -> FileGeneratingJob:
def __dump():
download_file(self.url, self.input_file.open("wb"))
return ppg.FileGeneratingJob(self.input_file, __dump).depends_on(self.dependencies) |
package io.github.jmcleodfoss.explorer;
import java.awt.Dimension;
import javax.swing.JSplitPane;
import javax.swing.JTable;
import io.github.jmcleodfoss.pst.PST;
import io.github.jmcleodfoss.swingutil.HexAndTextDisplay;
/** Display information about the PST header. */
@SuppressWarnings("serial")
class Header extend... |
// enumeration-all method in var enumeration algorithm
double enum_all(vector<char> vars, map<char,char> e)
{
vector<char> vars_old = vars;
map<char,char> e_old = e;
if(vars.size() == 0)
return 1.0;
char next;
int x;
map<char, int> avail;
bool flag;
for(int i = 0; i < vars.size(); i++)
{
flag = true;
f... |
/**
* Read the given member and value, applying conversions if necessary, and place the data in the given map.
*
* @param originatingElement The originating element
* @param annotationName The annotation name
* @param member The member being read from
* @param memberName ... |
/* count the number of used FDs */
static int
CountFDs(int amax)
{
struct stat tstat;
int i, code;
int count;
count = 0;
for (i = 0; i < amax; i++) {
code = fstat(i, &tstat);
if (code == 0)
count++;
}
return count;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.