content stringlengths 10 4.9M |
|---|
/**
* A simple test to check that random combination of operations can coexist in segments and be lookup.
* This is needed as some fields in Lucene may not exist if a segment misses operation types and this code is to check for that.
* For example, a segment containing only no-ops does not have neither _... |
Prime Minister Shinzo Abe’s government has removed most of the antinuclear researchers appointed to a post-Fukushima energy policy board that was advising the state, it was learned Friday.
After his Liberal Democratic Party won a landslide victory in December’s Lower House election, Abe said the ousted Democratic Part... |
package types
type WeaponInfo struct {
WeaponId int32 `json:"weaponId"`
Level int32 `json:"level"`
CulLevel int32 `json:"culLevel"`
CulPro int32 `jsom:"culPro"`
State int32 `json:"state"`
}
type AllWeaponInfo struct {
Wear int32 `json:"wear"`
WeaponList []*WeaponInfo `json:"weaponList"`
}... |
import unittest
import tempfile
import os
import numpy
import caffe
#import h5py
class simplified_message_out(caffe.Layer):
"""A layer that take Messages in and output Q (Q=5) type of messages for prediction"""
def setup(self, bottom, top):
self.nScene = 5
self.nAction = 7
self.nPeople ... |
/* -*- c++ -*-
* Copyright (c) 2012-2022 by the GalSim developers team on GitHub
* https://github.com/GalSim-developers
*
* This file is part of GalSim: The modular galaxy image simulation toolkit.
* https://github.com/GalSim-developers/GalSim
*
* GalSim is free software: redistribution and use in source and bin... |
/// Decode a bech32 string into the raw HRP and the data bytes.
///
/// Returns the HRP in lowercase..
pub fn decode(s: &str) -> Result<(String, Vec<u5>, Variant), Error> {
// Ensure overall length is within bounds
if s.len() < 8 {
return Err(Error::InvalidLength);
}
// Split at separator and ch... |
<gh_stars>0
#pragma once
#include<vector>
class Tile {
private:
bool isWalkable;
unsigned long sprite[16][16];
public:
unsigned long getSpritePixel(int const x, int const y) const;
bool isTileWalkable() const;
Tile(std::vector<std::vector<int>> const rawTile, bool const isWalkable);
~Tile()... |
def dice_data(dice_string: str) -> Tuple[types.DiceList, types.DiceDict]:
if dice_string in positive_dice:
processed_string = positive_dice_parse(dice_string)
elif dice_string in negative_dice:
processed_string = negative_dice_parse(dice_string)
else:
raise ValueError(f"Cannot find d... |
/*-----------------------------------------------------------------------------*/
/*Export CSV file of the DCA frequency data*/
/*------------------------------------------------------------------------------*/
int write_freq_data(char DCAfreqDataFile[],int **FreqTestArea, int num_simu, int dca_combination)
{
FILE *DC... |
/**
* Checks if is resizable.
*
* @return {@code true}, if is resizable
*/
@JsonInclude(Include.NON_DEFAULT)
public boolean isResizable() {
Boolean tResizable = getValues().getBooleanProperty(ATTR_RESIZABLE);
return tResizable != null ? tResizable : true;
} |
#include<stdio.h>
int main()
{
int i,N,A,B,C,X,n;
int Y[101];
while(1){
scanf("%d%d%d%d%d",&N,&A,&B,&C,&X);
if(N==0&&A==0&&B==0&&C==0&&X==0)break;
for(i=0;i<N;i++)scanf("%d",&Y[i]);
n=0;
for(i=0;i<10001;i++){
if(X==Y[n])n++;
if(n==N)break;
X=(A*X+B)%C;
}
if(... |
package com.sunchaser.sparrow.javase.base.xml.digester;
import lombok.Data;
/**
* @author sunchaser <EMAIL>
* @since JDK8 2021/8/23
*/
@Data
public class MyHost {
private String name;
private String appBase;
private String unpackWARs;
private String autoDeploy;
}
|
/**
* Handles all cleanup required after {@link #show()} has returned.
*/
private void cleanup() {
cleanupBuffers();
Display.destroy();
Keyboard.destroy();
Mouse.destroy();
} |
<gh_stars>1-10
package mil.nga.giat.geowave.adapter.vector;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.geotools.data.DataUtilities;
import org.geotools.feature.SchemaException;
import org.geotools.feature.simple... |
def _execute(_cmd, shell=False, stdout=None, stderr=None, dry_run=False):
__cmd = ' '.join(_cmd)
log.debug("Executing shell command: '{}'...".format(__cmd))
_shell = ''
if shell:
_shell = ' through the shell'
retcode = None
try:
if dry_run:
print("[Dry-Run-Mode] Exe... |
def compute_post_dominator_tree(graph: cfg.CFG) -> DominatorTree:
reversed_cfg = graph.reversed()
return DominatorTree.compute(reversed_cfg) |
/**
* Contains edited information for EntryReminder
*/
public static class EditEntryReminderDescriptor extends EditReminderDescriptor {
private Period period;
private Frequency frequency;
public EditEntryReminderDescriptor() {}
/**
* Copy constructor.
* A de... |
/**
* This class is used as debugee application for the methods001 JDI test.
*/
public class methods001a {
static boolean verbose_mode = false; // debugger may switch to true
// - for more easy failure evaluation
private final static String
package_prefix = ... |
<reponame>tanlentboy/botcasino<gh_stars>1-10
package storage
var (
// BitUSD 美元
BitUSD = "bitUSD"
// BitCNY 人民币
BitCNY = "bitCNY"
)
var (
// BitUSDSymbol 美元符号
BitUSDSymbol = "USD"
// BitCNYSymbol 人民币符号
BitCNYSymbol = "CNY"
)
// GetAsset 获取资产名
func GetAsset(symbol string) string {
switch symbol {
case BitUS... |
/**
* Busca una sede en la persistencia basandose en la direccion de SedeEntity
* @param pDireccion
* @return
*/
public SedeEntity findByDireccion(String pDireccion)
{
LOGGER.log(Level.INFO, "Consultando el sede con direccion={0}", pDireccion);
TypedQuery q = em.createQuery("... |
/**
* The BceLeaveRoomHandler is used for protocol LeaveRoom
* @author wangqi
*
*/
public class BceLeaveRoomHandler extends SimpleChannelHandler {
private Logger logger = LoggerFactory.getLogger(BceLeaveRoomHandler.class);
private static final BceLeaveRoomHandler instance = new BceLeaveRoomHandler();
priv... |
/**
* Remove an available device from the discovered devices list.
* @param device The available device to remove
* @return Returns true if a device was removed; false otherwise
*/
public boolean removeAvailableDevice(RigAvailableDeviceData device) {
RigLog.d("__RigLeDiscoveryManager.removeA... |
class Server:
"""
Based server class
"""
def __init__(self, config: "Config", callbacks: "Callbacks",
account_list: "AccountList", queue: asyncio.Queue) -> None:
self.server: Optional[asyncio.AbstractServer] = None
self.config = config
self.callbacks = callbacks... |
/**
* This shows a list of scenarios in a package.
* And allows them to be run in bulk.
*/
public class ScenarioPackageView extends Composite {
private Constants constants = ((Constants) GWT.create( Constants.class ));
private static Images images = GWT.create( Images.class );
private VerticalPa... |
class Tweetshot:
"""Class to take a screenshot of a tweet.
Attributes:
url (str): tweet URL.
type_driver (str): Type of driver to use. Either 'chrome' or 'firefox'.
executable_path (str, optional): Path to the executable drive.
timeout (int, optional): Number of seconds before t... |
<filename>Code/Network.py
import torch
import torch.nn as nn
class AutoEncoder(nn.Module):
def __init__(self):
super(AutoEncoder, self).__init__()
l = [32, 64, 128]
self.l = l
self.inplanes = l[0] # 64
self.dilation = 1
self.conv1 = nn.Conv2d(1, self... |
async def lookup(self, shortname):
return await self.cache.lookup(shortname) |
/**
* Copyright 2008 the original author or authors.
*
* 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 ... |
<filename>packages/glitter/src/index.ts
import '@glitter/core'
import './tsxDeclare'
export * from '@glitter/reactive'
export * from '@glitter/render-core'
export * from './tsx'
export * from './compositionApi/useUpdater'
export * from './compositionApi/lifecycle'
export * from './compositionApi/glitterReactive'
export... |
def to_pddf(self, **kwargs):
return tools.naDict_2_pddf(self.__dict__, **kwargs) |
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link OnPickPowerInteractionListener} interface
* to handle interaction events.
* Use the {@link PickPowerFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class PickPowe... |
<reponame>mbark/advent-of-code-2020
package main
import (
"fmt"
"strconv"
"strings"
)
var input = `
light chartreuse bags contain 1 mirrored yellow bag, 2 vibrant violet bags.
dotted silver bags contain 2 dotted orange bags, 3 bright fuchsia bags, 5 bright tomato bags, 3 faded turquoise bags.
plaid indigo bags con... |
<filename>spring-batch-lightmin-core/spring-batch-lightmin-core-configuration/src/main/java/org/tuxdevelop/spring/batch/lightmin/util/BeanRegistrar.java<gh_stars>100-1000
package org.tuxdevelop.spring.batch.lightmin.util;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframewor... |
<filename>src/main/java/csebank_objectmodel/asu/edu/KYCRequest.java
package csebank_objectmodel.asu.edu;
public class KYCRequest {
private String userFieldId;
private String userId;
private String fieldValue;
private String status;
private String kycid;
public String getUserFieldId() {
return userFieldId;
}
... |
/*
This class contains methods that wrap the Vault API in a convenient way.
Methods in this class do not throw exceptions. Successful completion of
a method is determined by calling the failed() method.
Example usage:
VAPI vapi = new VAPI("local_connection__c");
vapi
.setJobLogger(... |
import { STO_TOKEN } from './contants'
import { request } from './request'
import { getCode } from './wxp'
/** 登录接口响应数据 */
export interface LoginResponse {
/** 有效时长,单位:秒 */
expiration: number
/** 登录凭证 */
token: string
}
/**
* 登录
*
* @returns 登录凭证
*/
export async function login(): Promise<string> {
cons... |
In-line Fraunhofer holographic system for measuring particle distribution of fast-moving particles
An in-line Fraunhofer holographic system which can measure the size distribution and the mass of particles ejected from a target surface at speeds up to 5.0 km/s is described. Observed particle diameters range from 4μm t... |
def aquire_camera_worker(camera, image_handle, cam_name, sync_queue, save_queue, save_dir, stop_collecting_event, currently_recording, g_pool, logger):
try:
sync_str = get_sync_string(cam_name + "_pre", camera, save_dir, g_pool)
sync_queue.put(sync_str)
logger.info(f'Begin Recording..')
... |
#!/usr/bin/env node
import { log } from './utils'
import { help } from './commands/help'
import { getStdin } from './stdin'
import { getCommandHandler } from './commands'
async function AuraCLI() {
const { command, args } = getStdin()
const handler = await getCommandHandler(command)
if (!command) {
return ... |
The world’s largest and most advanced “fortified hospital” was unveiled this week at Rambam Medical Center in Haifa. The 2,000 bed underground hospital is designed to keep patients and staff safe dozens of meters below ground even if missiles and rockets are falling above ground – in case the city ever faces the kind o... |
def process_msg(msg, prev_msg=None) -> None:
if False and kwargs["long_format"]:
print(
f'{msg.dtm.isoformat(timespec="microseconds")} ... {msg!r} # {msg.payload}'
)
return
if kwargs["long_format"]:
dtm = msg.dtm.isoformat(timespec="micr... |
import sf, { IOptionToGrab, ISpiralFramework } from '@spiral-toolkit/core';
import { autobind } from '../autobind';
import { FILTER_TOGGLE_CLASS_NAME } from '../constants';
import type Datagrid from '../datagrid/Datagrid';
const { assert } = sf.helpers;
const BUTTON_CLASS = '.sf-filter-toggle-button';
const PANEL_CLA... |
/** Event-interpreter for directional navigation. */
public class DirectionNavigationInterpreter
implements AccessibilityEventListener, KeyComboManager.KeyComboListener {
private static final String TAG = "DirectionNavigationInterpreter";
private final Context context;
private ActorState actorState;
priva... |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
package simsigGatewayInterface;
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/**
* <code>Harness</code> is an interface that collects
* SimSig messages from the SimSig server. Project-specific imple... |
<gh_stars>0
package com.chua.utils.tools.strategy.handler;
/**
* 策略动作
*
* @author CH
*/
public interface IAsyncStrategyPolicy<T> {
/**
* 尝试
*
* <table border=1 cellpadding=5 summary="implements,desc">
* <tr>
* <th>index</th>
* <th>implements</th>
* ... |
President Barack Obama, right, is greeted by Texas Gov. Rick Perry, left, during his arrival on Air Force One at Austin-Bergstrom International Airport, Thursday, May 9, 2013 in Austin, Texas. (AP Photo/Pablo Martinez Monsivais)
AUSTIN, Texas (AP) — Aiming to show he's still focused on creating jobs, President Barack ... |
/*
* Gets the affine coordinates of an EC_POINT. Note that the simple
* implementation only uses affine coordinates.
*/
int ec_GF2m_simple_point_get_affine_coordinates(const EC_GROUP *group,
const EC_POINT *point,
BIGNUM ... |
<gh_stars>0
package models.utility;
import java.util.*;
import java.text.*;
import play.Logger;
public class Utilities{
public static int ORDER_UNITS = 200;
public static int PAGE_WORD_COUNT = 280;//double spaced
public static int NUMBER_OF_EFERENCES = 100;
public static String STYLES [] = {"APA", "MLA", "Harvard... |
A CHOLERA METAPOPULATION MODEL INTERLINKING MIGRATION WITH INTERVENTION STRATEGIES — A CASE STUDY OF ZIMBABWE (2008–2009)
Cholera is a water-borne disease and a major threat to human society affecting about 3–5 million people annually. A considerable number of research works have already been done to understand the di... |
package kkapp
import (
"errors"
"github.com/kkserver/kk-lib/app"
"github.com/kkserver/kk-lib/kk"
"github.com/kkserver/kk-lib/kk/json"
"time"
)
type KKRemoteService struct {
app.Service
request func(message *kk.Message, trackId string, timeout time.Duration) *kk.Message
getName func() string
}
func (S *KKRemo... |
<commit_msg>Allow early ack on non-zero visibility delay.
<commit_before>// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "lid_reuse_delayer_config.h"
#include <vespa/searchcore/proton/server/documentdbconfig.h>
namespace proton::documentm... |
package com.jam.util;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import org.joml.Matrix4f;
import org.joml.Vector2f;
import org.joml.Vector3f;
import org.joml.Vector4f;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
public class Util... |
Healthy Eating Index Scores, Body Mass Index and Abdominal Obesity Among Asian Americans: NHANES 2011–2018
Objective Obesity rates are increasing among Asian Americans so, the objective of this study was to examine associations between Healthy Eating Index scores (a measure of adherence to the Dietary Guidelines for A... |
Purpose and Audience: This role-play is intended for adult intermediate to advanced students. Warm-up: Teacher writes 'Juicy Baek' on the board and asks the class if they have heard of Juicy Baek. When the class says no, the teacher explains that Juicy Baek is a new drug that many young people are using. Juicy Baek is ... |
Efficient traveltime solution of the acoustic TI eikonal equation
Numerical solutions of the eikonal (Hamilton-Jacobi) equation for transversely isotropic (TI) media are essential for imaging and traveltime tomography applications. Such solutions, however, suffer from the inherent higher-order nonlinearity of the TI e... |
async def download(self, location):
response = await self._requester.request("GET", _url=self.url)
with open(location, "wb") as file_out:
file_out.write(await response.read()) |
## DEDICATION
FOR SCOTT, WHO MAKES MY WORLD MAGENTA
## CONTENTS
1. Dedication
2. Contents
3. Prologue
4. Chapter 1
5. Chapter 2
6. Chapter 3
7. Chapter 4
8. Chapter 5
9. Chapter 6
10. Chapter 7
11. Chapter 8
12. Chapter 9
13. Chapter 10
14. Chapter 11
15. Chapter 12
16. Chapter 13
... |
def filename(self, trans):
filename = getattr(self, '_serverSideFilename', None)
if filename is None:
filename = trans.request().serverSidePath()
self._serverSideFilename = filename
return filename |
/**
* The <code>LoggingWorkflowOperationHandlerTest</code> will log the current state of a workflow instance and its media
* package at a given point of a workflow.
*/
@Component(
property = {
"service.description=Logging Workflow Operation Handler",
"workflow.operation=log"
},
immediate = true,
serv... |
function bunny() {
console.log('[logitall] __testfixtures__/function-return.input.ts:1:bunny()');
console.log('[logitall] __testfixtures__/function-return.input.ts:2');
return 'bubba';
} |
import numpy as np
import os
import re
from importer import _VecImporter
class MSLImporter(_VecImporter):
driver = 'family'
file_ext = '.csv'
pkey_field = 'ids'
n_chans = 6144
def get_processed_ids(self, file_prefix):
raw_ids = super(MSLImporter, self).get_processed_ids(file_prefix)
... |
/**
* Checks whether the BioPAX element is generic physical entity or entity reference.
*
* @param e biopax object
* @return true when the object is generic physical entity or entity reference
*/
public static boolean isGeneric(BioPAXElement e) {
return (
(e instanceof EntityReference && !((EntityReferen... |
def MaskedMSE(targets, outputs, targets_lengths, hparams, mask=None):
if mask is None:
mask = sequence_mask(targets_lengths, hparams.outputs_per_step, True)
ones = tf.ones(shape=[tf.shape(mask)[0], tf.shape(mask)[1], tf.shape(targets)[-1]], dtype=tf.float32)
mask_ = mask * ones
with tf.control_d... |
<filename>src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/gui/GT_Container_Uncertainty.java
package com.github.technus.tectech.thing.metaTileEntity.hatch.gui;
import com.github.technus.tectech.TecTech;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_Uncertainty;... |
<gh_stars>10-100
package api
import (
"os"
"testing"
"time"
)
const TEST_REGION = "toronto"
const TEST_OBJECT_LABEL = "test"
const TEST_PLAN_ID = 1
const TEST_IMAGE_ID = 26
const TEST_VOLUME_SIZE_GB = 50
func getTestAPI(t *testing.T) *API {
apiID := os.Getenv("LUNANODE_TEST_ID")
apiKey := os.Getenv("LUNANODE_TE... |
<filename>dist/commons/public_api.d.ts
export * from './src/advices';
export * from './src/annotation/annotation.types';
export * from './src/annotation/context/annotation.context';
export * from './src/annotation/registry/annotation.registry';
export * from './src/annotation/target/annotation-target.factory';
export *... |
def zero_grad(self, set_to_none: bool = False):
for param_group in self.param_groups:
for param in param_group.parameters:
if param.grad is not None:
if set_to_none:
param.grad = None
else:
param.... |
<gh_stars>1-10
package rand_test
import (
"testing"
"github.com/itsubaki/q/pkg/math/rand"
)
func TestCrypto(t *testing.T) {
r := rand.Crypto()
if r < 0 && r > 1 {
t.Fail()
}
}
func TestCryptoInt(t *testing.T) {
r := rand.CryptoInt(2, 14)
found := false
for _, e := range []int{2, 3, 4, 5, 6, 7, 8, 9, 10, ... |
<reponame>Msimoneau/wyldcard
package com.defano.wyldcard.parts.button.styles;
import com.defano.wyldcard.border.PartBorderFactory;
import com.defano.wyldcard.fonts.FontUtils;
import com.defano.wyldcard.icons.ButtonIcon;
import com.defano.wyldcard.icons.IconFactory;
import com.defano.wyldcard.parts.ContainerWrappedPart... |
<reponame>rmathis/openEQUELLA
package com.tle.webtests.test.admin.multidb;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.tle.common.util.ExecUtils;
import com.tle.common.util.ExecUtils.ExecResult;
import java.io.File;
import java.util.List;
import java.util.Map;
public clas... |
// Returns the offset of the first byte that pertains to the value on which the reader is
// currently parked.
fn first_value_byte_offset(&self) -> usize {
if let Some(offset) = self.reader.field_id_offset() {
return offset;
}
if let Some(offset) = self.reader.annotations_offset() {
... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
<filename>models/profile.go
package models
import (
"encoding/json"
"errors"
"fmt"
"net/url"
"os"
"regexp"
"github.com/jordan-wright/email"
fuzzymatcher "github.com/mjarkk/fuzzy-matcher"
"github.com/script-development/RT-CV/db"
"github.com/script-development/RT-CV/helpers/emailservice"
"github.com/script-d... |
<reponame>yxbook/tx-lcn-new<filename>springcloud-lcn-demo/springcloud-mybatis-demo1/src/main/java/com/example/demo/controller/DemoController.java
package com.example.demo.controller;
import com.alibaba.fastjson.JSONObject;
import com.codingapi.tx.framework.utils.SerializerUtils;
import com.codingapi.tx.model.Transact... |
import * as React from 'react'
import Seatmap from './components/Seatmap.jsx'
import './style/style.css'
import {
MessageComponentProps,
MessagePlugin,
MessagePluginFactory,
} from '../../../common/interfaces/message-plugin'
import { createMessagePlugin, registerMessagePlugin } from '../../helper'
interfac... |
Image copyright Russia Today Image caption A shot that seemed to show a soldier standing next to RBK-500 cluster bomb canisters was later edited out of a news package
Just a few days ago Russian warplanes, allegedly using cluster munitions, attacked a US-backed Syrian opposition group based near al-Tanf - a small town... |
// Internal UDP listener for low-latency touch events
class UDPTouchEventListener implements Runnable {
/* This number is a bit arbitrary, but it should be able to allow for
* about 1600 panels per packet */
private final int MAX_PACKET_LEN = 8192;
private byte[] data;
private boolean listening;
private Li... |
/*
*----------------------------------------------------------------------
*
* Tk_DitherPhoto --
*
* This function is called to update an area of each instance's pixmap by
* dithering the corresponding area of the image master.
*
* Results:
* None.
*
* Side effects:
* The pixmap of each instance of this ima... |
def minify_css_files():
for k, v in CSS_FILE_MAPPING.items():
input_files = " ".join(v["input_files"])
output_file = v["output_file"]
uglifyjs_command = "uglifycss {input_files} > {output_file}".format(
input_files=input_files,
output_file=output_file
)
... |
def deepcopy(self, exterior=None, label=None):
return Polygon(
exterior=np.copy(self.exterior) if exterior is None else exterior,
label=self.label if label is None else label
) |
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
if (Robot.useDrive) {
double distance = Robot.pixyVision.getDockDistance();
double joy_vals[] = Robot.oi.getJoyXYZ(joy);
double x = joy_vals[0];
double y = joy_vals... |
/**
* Updates file map to include not hyphenated names so that it matches Aura names during BundleSource lookup
*/
private void updateFileMap() {
Map<String, FileEntry> temp = Maps.newConcurrentMap();
this.fileMap.forEach( (qualified, entry) -> {
if (qualified.contains("-")) {
... |
#include<bits/stdc++.h>
#define fi first
#define se second
#define ls rt*2
#define rs rt*2+1
#define pb push_back
#define sc(x) scanf("%d",&x)
#define scc(x,y) scanf("%d%d",&x,&y)
#define sccc(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pln(x) printf("%d\n",x)
#define CLR(x,y) memset((x),y,sizeof(x))
#define re... |
/**
* Checks the current controller file for the photo name. If found indicates photo was uploaded.
* @return TRUE if photo was uploaded. FALSE otherwise.
*/
public static boolean isUploaded(final File photo) {
final File controllerFile = new File(photo.getParentFile(), Constant.DIR_CONTROLLER_FILE_NAME);
... |
//
// main.cpp
// AntonAndTheCurrencyYouAllKnow
//
// Created by Aditya Rai on 05/07/21.
//
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
ll intstr( char ch){
switch (ch) {
case '1': return 1;
case '2': return 2;
case '3': return 3;
case '4': ... |
def permute(self, order):
if (order.__class__ == list):
order = numpy.array(order);
if(self.ndims() != len(order)):
raise ValueError("invalid permutation order")
sortedorder = order.copy();
sortedorder.sort();
if not ((sortedorder == numpy.arange(len(self.... |
def retrieve_sender_info(self, message_id):
message = self.service.users().messages().get(userId=self.user_id,
id=message_id,
format="metadata",
metad... |
The 27-story Antilla is seen in Mumbai. (Indranil Mukherjee/AFP/Getty Images)
India’s richest man is enjoying his 27-story Mumbai home, from afar. The world’s most expensive home, which cost $1 billion to build, is reportedly empty because the owner believes it would be bad luck to move in, according to the Daily Mail... |
def split_key(key: str) -> List[str]:
first = KEY_PATH_HEAD.match(key)
assert first is not None
first_stop = first.span()[1]
tokens = key[0:first_stop].split(".")
if first_stop == len(key):
return tokens
if key[first_stop] == "[" and not tokens[-1]:
tokens.pop()
others = KEY_... |
<reponame>ronaldseoh/ronald_bdl<filename>ronald_bdl/__init__.py
__all__ = ['models', 'datasets']
from ronald_bdl import models
from ronald_bdl import datasets
|
<reponame>Daandelange/ofxSurfingImGui
#pragma once
#include "ofMain.h"
#include "ofxSurfingImGui.h" // -> This header includes ALL the classes.
using namespace ofxImGuiSurfing;
#include "SurfingRangeSlider.h"
class ofApp : public ofBaseApp{
public:
void setup();
void draw();
void setup_ImGui();... |
// Copies other into p and returns p.
func (p *Polynomial) Set(other *Polynomial) *Polynomial {
if p == other {
return p
}
p.degree = other.degree
p.coeffs.Set(&other.coeffs)
return p
} |
/// Value from asset.
impl<T> From<Box<IAsset<T>>> for Value {
fn from(ptr: Box<IAsset<T>>) -> Value {
let ptr = Box::into_raw(ptr);
let mut me = Value::new();
(_API.ValueInt64DataSet)(me.as_ptr(), ptr as usize as i64, VALUE_TYPE::T_ASSET as u32, 0);
return me;
}
} |
...
Mama Mua was in the Exclusion. Mizumi saw the shaman across the street at the same moment Ayika did and the two girls shared a silent conversation of panicked confusion. There was no mistake. No one else wore robes of black and blue and white under that dark red cloth wrapped headboard whose edge dangled with a cu... |
<reponame>suijingfeng/VulkanTutorials
#include "VulkanGenericPlatform.h" |
/**
* check whether the password list contains the number
*
* @param num
* @return
*/
private boolean arrContainsInt(int num) {
for (Integer value : passList) {
if (num == value) {
return true;
}
}
return false;
} |
/**
* Rename an old file name to a new file name under the current storage directory.
*
* @param sourcepath Old file path as a full path to the storage directory.
* @param destpath New file path as a full path to the storage directory.
*/
public void moveFile(@NonNull String sourcepath,
... |
import { ServiceException as __ServiceException__ } from "@aws-sdk/types";
/**
* <p>The state of the specified AWS KMS resource isn't valid for this request.</p>
*/
export interface KMSInvalidStateFault
extends __ServiceException__<_KMSInvalidStateFaultDetails> {
name: "KMSInvalidStateFault";
}
export interface... |
package stk
/*
Copyright (C) <NAME>, 2016.
MIT Licensed.
*/
import (
"errors"
"fmt"
)
type NameStackElement struct {
S_LineNo int
C_LineNo int
TF bool
Tag string // name of the item
Nested bool
}
type NameStackType struct {
Stack []NameStackElement
Top int
}
func NewNameStackType() (rv *Nam... |
def rstrip(self):
original_text = self.text
if not original_text.endswith(' '*2): return False
num_blanks = len(original_text) - len(original_text.rstrip())
self.chars = self.chars[:1-num_blanks]
self.update_bbox(rect=self.cal_bbox())
return True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.