content
stringlengths
10
4.9M
// resourceCalicoIpPoolUpdate update an ippool in Calico func resourceCalicoIpPoolUpdate(d *schema.ResourceData, m interface{}) error { d.Partial(false) calicoClient := m.(config).Client ipPoolInterface := calicoClient.IPPools() ipPool, err := createIpPoolApiRequest(d) if err != nil { return err } _, err = ipP...
<gh_stars>0 /****************************************************************** * muensterTPCsim * * Simulations of the Muenster TPC * * @author <NAME>, based on muensterTPC (Levy) and Xenon100 * @date 2015-04-14 * * @comment ******************************************************************/ #include <G4...
// Fake wrapper to force AMD loading interface Hammer { } export = Hammer;
// Tests mapping of an action profile with group type. TEST_F(P4TableMapperTest, TestActionProfileGroup) { ASSERT_OK(p4_table_mapper_->PushForwardingPipelineConfig( forwarding_pipeline_config_)); SetUpActionProfileTest(); action_profile_group_.set_group_id(1); action_profile_group_.add_members()->set_memb...
Estimating LAI and mapping canopy storage capacity for hydrological applications in wattle infested ecosystems using Sentinel-2 MSI derived red edge bands This study assessed the strength of Sentinel-2 multispectral instrument (MSI) derived Red Edge (RE) bands in estimating Leaf Area Index (LAI) and mapping canopy sto...
// NewProposalIDReimbursementPair returns a new ProposalIDReimbursementPair instance. func NewProposalIDReimbursementPair(proposalID uint64, reimbursement Reimbursement) ProposalIDReimbursementPair { return ProposalIDReimbursementPair{ ProposalID: proposalID, Reimbursement: reimbursement, } }
Don't mess with this monkey. Footage from a security camera is said to show a young man in Shimla, India, giving the finger to one of the area's famously belligerent monkeys. And as you might expect, the monkey is having none of it. It drop kicks the man right in the head, knocking him to the ground. The man, howeve...
<reponame>mlandefeld/daffodil import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { DaffLinkSetHeadingDirective } from './link-set-heading/link-set-heading.directive'; import { DaffLinkSetItemComponent } from './link-set-item/link-set-item.component'; import { DaffLinkSetSu...
Matt woke up Thursday morning to a nagging migraine. While he had experienced headaches before, this one seemed different. It lasted all day, and by evening he grew nauseous. I left to go to a meeting, and by the time I returned Matt was very sick. He had vomited several times while I was gone, and felt terrible. As ...
import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np from subprocess import call from pf.pfasst import PFASST, Experiment, Params def init(): lines[0].set_data([], []) lines[1].set_data([], []) lines[2].set_data([], []) return lines def animate(i): # for j, l...
{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} module Telegram.API.Updates ( TelegramUpdatesAPI, getUpdates ) where import Data.Proxy import Network.HTTP.Client (newManager) import Network.HTTP.Client.TLS (tlsManagerSettings) import Servant.API import ...
// EnsureDefaults will ensure that if a user omits and fields in the // spec that are required, we set some sensible defaults. // For example a user can choose to omit the version // and number of members. func (t *Tenant) EnsureDefaults() *Tenant { if t.Spec.PodManagementPolicy == "" || (t.Spec.PodManagementPolicy !=...
<filename>app/core/tools/utils.ts export const asType = <T>(value: T): T => value /** * 格式化日期 * @param d * @param format 'YYYY-MM-DD H:I:S.MS' */ export function formatDate(date: Date = new Date(), format = 'YYYY-MM-DD H:I:S.MS') { const obj = { YYYY: date.getFullYear().toString().padStart(4, '0'), MM: (d...
Arkham Asylum is a home for the 'criminally insane'. The prisoners there are the most dangerous people in the Batman universe. It makes Gotham's plan to let them loose in their own neighbourhood beyond dumb. But dumb ideas make for interesting games. Arkham City expands everything that made 2009's third-person action ...
GIRK Channel Activation Contributes to the Muscarinic Modulation of XII Motoneuron Excitability in Neonatal Mice in Vitro Sleep specific decreases in airway muscle tone, and particularly the genioglossus muscle of the tongue (primary tongue protruder), have been causally implicated in obstructive sleep apnea. During R...
<gh_stars>0 import { useState } from "react"; import { CameraIcon } from "@heroicons/react/solid"; import getBearerToken from "../util/getBearerToken"; const InputBox: React.FC = () => { const [postContent, setPostContent] = useState(""); const submitPost = async (e: React.FormEvent<HTMLFormElement>) => { ...
import { browser } from 'webextension-polyfill-ts' import { IGNORE_CLICK_OUTSIDE_CLASS } from '../constants' import { ContentScriptRegistry, SidebarScriptMain } from './types' import { createInPageUI, destroyInPageUI } from 'src/in-page-ui/utils' import { setupInPageSidebarUI, destroyInPageSidebarUI, } from 's...
/* G N O K I I A Linux/Unix toolset and driver for the mobile phones. This file is part of gnokii. Copyright (C) 2000 <NAME> & <NAME>. Copyright (C) 2001-2003 <NAME>, <NAME> This file provides functions specific to the Nokia 6100/5100 series. See README for more details on supported mobile phone...
/** * Clicks at the coordinates of the given {@link IDomNode}. * <p> * Does <b>not</b> click the associated {@link WebElement} directly, in * order to support click-intercepting overlay elements. * <p> * If there is a click-intercepting overlay above the {@link WebElement} to * click, an attempt to click ...
def search(self, task, entry, config=None): self.rss_key = config['rss_key'] username = config['username'] password = hashlib.md5(config['password'].encode('utf-8')).hexdigest() data = {'cookieuser': '1', 'do': 'login', 's': '', 'securityto...
<filename>channels/core/clientHelper.go package core import ( "fmt" "os" ) // GetClient - Get client from cache first, then try database and update cache if found func GetClient(appID string, clientID string) (*Client, error) { client := GetEngine().GetCacheStorage().GetClient(appID, clientID) if client != nil ...
<filename>data/db/src/main/java/leap/db/model/DbTable.java<gh_stars>10-100 /* * Copyright 2013 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 * * ...
import typing # import urllib # expected_value = urllib.parse.unquote(expected_value) # mypy: error: Module has no attribute "parse" from urllib.parse import unquote as urllib__parse__unquote # ****************************************************************************** # *********************************************...
// NOTE tests for individual tag values exist in JpegReaderTest.java @Test public void testGetImageWidth() throws Exception { _directory.setInt(JpegDirectory.TAG_IMAGE_WIDTH, 123); assertEquals(123, _directory.getImageWidth()); }
Adidas-owned GPS fitness app Runtastic is introducing a new integration with Google Play Music today, one that promises “free” access to an array of music playlists directly within the Runtastic app. Available only on Android from today, Runtastic’s millions of users will be able to access a selection of playlists, ac...
<gh_stars>0 /// <reference path="../../typings/tsd.d.ts" /> import ChatMessageUtil from "../utils/ChatMessageUtil"; import {ChatAction} from "../actions/ChatAction"; import {MessageData, RawMessage} from "./MessageStore"; import {ChatActionID} from "../actions/ChatActionID"; import {ChatAppDispatcher} from "../dispatc...
# Nessa aula, vamos continuar nossos estudos de funções em Python, aprendendo mais sobre Interactive Help em Python, # o uso de docstrings para documentar nossas funções, argumentos opcionais para dar mais dinamismo em funções Python, # escopo de variáveis e retorno de resultados. print(f'{"Parâmetros Opcionais":=^...
/** * Recursive function to read objects from a specific level in the xml. * * Nowadays there are quite a few of them : * - Layers : a diagram may have different layers, but this function does *not* * add the created objects to them as it does not know on which nesting level it * is called. So the topmost cal...
/** * Data Transfer object (DTO) for Protocol. A project may represent a Protcol for scheduling * questionnaires. * * @see <a href="https://github.com/RADAR-base/RADAR-aRMT-protocols">aRMT Protocols</a> * @author yatharthranjan */ @Data public class Protocol { private String version; private String schemaVe...
This article is over 1 year old Defectors now being offered $860,000 cash reward for sensitive information about Kim Jong-un regime South Korea will quadruple the cash reward it offers to defectors from North Korea who pass over classified information about the reclusive state, reports said on Sunday. The government...
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2019.06.12 at 09:...
Okay so that may seem an obvious statement to make, but it was only when I went behind the camera and made my first short film did I truly understand how different it is. As a theatre director I am used to allowing plenty of rehearsal time to allow an actor to build his part, improvise, connect to her partner, find the...
/** * A class to manage the location of horses in a barn. */ public class HorseBarn { // The stalls or spaces in the barn. Each array element holds a reference to the horse // that is currently occupying the space. A null value indicates an empty space. private ArrayList<Horse> spaces = new ArrayList<Horse>()...
// argument. Delete all edges to all other towns before deleting this town public void deleteTown(String town){ Node townNd = null; for (Node nd : graph) { if(nd.label.equals(town)) townNd = nd; } if(townNd == null){ System.out.print("Town not found"); }el...
President Ram Nath Kovind meeting ministers and other leaders after the oath taking ceremony. (Photo: Doordarshan) A section of BJP MPs shouted Jai Shri Ram after Ram Nath Kovind was sworn in as India's 14th President in a ceremony in Parliament's Central Hall today. Full text: President Ram Nath Kovind's speech in P...
// deleteNode deletes node from sc.Nodes. func (sc *SchedulerCache) deleteNode(node *corev1.Node) error { if _, ok := sc.Nodes[node.Name]; !ok { return fmt.Errorf("node <%s> does not exist", node.Name) } numaInfo := sc.Nodes[node.Name].NumaInfo if numaInfo != nil { klog.V(3).Infof("delete numatopo <%s/%s>", num...
<reponame>iamdual/whois-parser package com.github.iamdual.whoisparser.templates.tld; import com.github.iamdual.whoisparser.templates.DefaultTemplate; /** * A WHOIS pattern of .br TLD. * * @author: <NAME> <<EMAIL>> * @license: Apache-2.0 License */ public class DotBr extends DefaultTemplate { @Override ...
<gh_stars>0 import * as dotenv from 'dotenv' dotenv.config() import { HardhatUserConfig } from 'hardhat/types' import { task } from 'hardhat/config' // Plugins import '@nomiclabs/hardhat-ethers' import '@nomiclabs/hardhat-etherscan' import '@nomiclabs/hardhat-waffle' import 'hardhat-abi-exporter' import 'hardhat-gas...
/** * Created by Yuriy Chernyshov * At Android Studio * On 12/14/14 * E-Mail: chernyshov.yuriy@gmail.com * * Utility class to help on queue related tasks. * Media IDs used on browseable items of {@link android.media.browse.MediaBrowser}. */ public final class MediaIDHelper { public static final String MEDI...
""" Draw samples and apply KDSD and MMD tests to the Bernoulli RBM. """ from __future__ import division from util import * from kernels import * from ksd import * from ksd_utils import * from mmd import * from rbm import * if __name__ == "__main__": n, sigma, seed, res_dir = sys.argv[1:] n = int(n) # Sample...
def _init_config_parser(common, subparsers): config_parser = subparsers.add_parser( ACTION_CONFIG, parents=[common], description='Config related actions', add_help=False) config_subparsers = config_parser.add_subparsers(dest='config_action') show_config_parser = config_subparsers.add_parser( ...
package cn.edu.seu.alumni_server.dao.mapper; import cn.edu.seu.alumni_server.controller.dto.MessageDTO; import cn.edu.seu.alumni_server.dao.entity.Message; import org.springframework.stereotype.Repository; import tk.mybatis.mapper.common.Mapper; import java.util.List; @Repository public interface MessageMapper exten...
#!/usr/bin/env python # pylint: disable=W0212 def having(self, aggregations, test): """ Create a new :class:`.TableSet` with only those tables that pass a test. This works by applying a sequence of :class:`Aggregation` instances to each table. The resulting dictionary of properties is then passed to ...
package com.yarolegovich.materialprefsample; import android.os.Bundle; import com.yarolegovich.mp.MaterialChoicePreference; import com.yarolegovich.mp.MaterialPreferenceScreen; import com.yarolegovich.mp.view.ListEntry; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Created by ya...
/** * A simple implementation of {@link StephenerializationService}. * @author Stephen Hopper * */ public class SimpleStephenerializationService implements StephenerializationService { private Stephenerializer stephenerializer; private Destephenerializer destephenerializer; /** * {@inheritDoc} */ pub...
<gh_stars>1-10 // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.1 // protoc v3.17.3 // source: ras/messages/v1/working_servers_messages.proto package messagesv1 import ( _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" _ "github.com/v8platform/p...
On a fall day in 2010, half a dozen wealthy investors and portfolio managers converged on an office in midtown Manhattan. These were serious Wall Street moneymen; in aggregate, they handled more than a billion dollars. They had access to the most exclusive hedge funds and investment partnerships and often rubbed should...
import AMQPMessageBroker from "./MessageBrokers/AMQP"; import EnvironmentVariableConfigurationSource from "./ConfigurationSources/EnvironmentVariables"; const mb : AMQPMessageBroker = new AMQPMessageBroker( new EnvironmentVariableConfigurationSource() );
def testListReference(self): r = S3Represent(lookup="org_organisation", multiple=True, show_link=True) a = current.request.application result = r(self.id1) self.assertTrue(isinstance(result, DIV)) self.assertEqual(len(result), 1) ...
def testRegistryAPI(self): url = ADMIN_CLIENT["endpoint"] user_common_password = "Aa123456" TestProjects.user_Alice_id, user_Alice_name = self.user.create_user(user_password = user_common_password, **ADMIN_CLIENT) USER_ALICE_CLIENT=dict(endpoint = url, username = user_Alice_name, passwor...
<gh_stars>10-100 //! @file //! //! Copyright (c) Memfault, Inc. //! See License.txt for details //! @brief //! Example MBed specific routines for populating version data. #include "memfault/core/platform/device_info.h" #include <stdio.h> #include <string.h> #include "memfault/core/math.h" #ifndef MEMFAULT_MBED_MAIN_...
// Create a new node which has the specified `key' and `userdata' // Return NULL if failed static avlbst_p avlbst_new_node(const size_t key, void *userdata) { avlbst_p n = calloc(1, sizeof *n); if(!n) return n; n->key = key; n->userdata = userdata; return n; }
A recent road trip took me through five Canadian provinces — Ontario, Quebec, New Brunswick, Nova Scotia and P.E.I. It turned out to be an eye-opening education in how Canada’s political culture changes completely the moment you step away from Parliament Hill. While official Ottawa is consumed with all things Duffy, H...
package wcs.java.model.editors; /** * Created by jelerak on 3/11/2015. */ public class RichTextEditor extends AbstractAttributeEditor { //Default Values private String widthValue = "400"; private String heightValue = "600"; private String allowedAssetTypesValue; private String toolbarValue; ...
//! Box id type use std::convert::TryFrom; use crate::serialization::SigmaSerializeResult; use sigma_ser::ScorexSerializable; use crate::serialization::{ sigma_byte_reader::SigmaByteRead, sigma_byte_writer::SigmaByteWrite, SigmaParsingError, SigmaSerializable, }; use derive_more::From; use derive_more::Into; ...
#include <stdio.h> #include <stdlib.h> #include <assert.h> #include <jni.h> #include <pthread.h> #include <string.h> #include <android/log.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <SLES/OpenSLES.h> #include <SLES/OpenSLES_Android.h> #define TAG "Noizer" #define SI...
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject, QVariant from py.common.FramListModel import FramListModel import logging import unittest import arrow import os import glob import ntpath from pathlib import Path class Notes(QObject): notesPathChanged = pyqtSignal() noteSaved = pyqtSigna...
In August, 1966, the Beatles played their final concert at Candlestick Park near San Francisco. They had decided to stop touring — and no one knew how to be a band without playing gigs. After that last show, George Harrison said, “Well, I guess I’m not a Beatle anymore.” When they gathered at EMI Studios in November 19...
package controllers import ( "github.com/gin-gonic/gin" "gnt-cc/config" "gnt-cc/model" ) type ClusterController struct{} // GetAll godoc // @Summary Get all clusters // @Description Get all clusters configured in the config file. Sensitive values will be omitted // @Produce json // @Success 200 {object} model.All...
. According to the author there are five possible kinds of relationship between visceral neoplasmas and diseases of the skin. 1. Instances in which neoplasma induces dermatosis (the so-called paraneoplastic diseases). 2. Instances in which defective immune mechanism or long-lasting immune suppression promote the devel...
<filename>src/test/java/com/swime/mapper/StudySurveyMapperTests.java package com.swime.mapper; import com.swime.domain.StudyListVO; import com.swime.domain.StudySurveyVO; import lombok.Setter; import lombok.extern.log4j.Log4j; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.fac...
<filename>LStgEngine/gameobj/shooter/LShooters.cpp<gh_stars>1-10 #include "stdafx.h" #include "LShooters.h" #include "LSegShooter.h" #include "LRayShooter.h" LShooters::LShooters() { } LShooters::~LShooters() { } LShooter* LShooters::Add(ShooterType type, IGameObject* pParent) { LShooter* pShooter = nullptr; swit...
/** * \file Stack.h * * \brief content: class declaration of the stack class, providing stack-functionality */ #ifndef STACK_H_ #define STACK_H_ #include <iostream> #include "ListElem.h" /** * \brief This class provides a stack-like data-structure */ class Stack { private: // member /** * \brief pointe...
/* an edit menu handler for TextEdit */ short NATEmenup(na_win *winp, WORD menuid, WORD itemno) { MenuHandle mh = NAmenuh(mEdit); TEHandle hTE = teinfo->hTE; TEPtr pte; short status = NA_NOTPROCESSED; switch (menuid) { case 0: pte = *hTE; if (pte->selStart != pte->selEnd) { EnableItem(mh, iCopy); ...
/** * Creates a new instance of a given class, without invoking any constructor. * If the given class is <tt>abstract</tt> or an <tt>interface</tt>, then a concrete class is created, with empty * implementations for the <tt>abstract</tt>/<tt>interface</tt> methods. * * @param classToInstantiate the ...
import { program } from 'commander' import { execSync } from 'child_process' program .option('-p, --project <name>', 'specified project name') .option('--list', 'print affected projects', false) .option('--base <commit>', 'base commit to compare', 'HEAD~1') .option('--head <commit>', 'head commit to compare', ...
package icu.d4peng.cloud.common.log.web; import com.dtflys.forest.http.ForestRequest; import com.dtflys.forest.interceptor.Interceptor; import icu.d4peng.cloud.common.core.util.NetUtils; import icu.d4peng.cloud.common.core.util.SpringAware; import icu.d4peng.cloud.common.log.constant.LogConstant; import icu.d4peng.clo...
/** * A JLabel with a built-in SimpleObjectFormat. The component has the concept of an active object which is passed * through the ObjectFormat to create the JLabel text. * * @author * @version $Revision: 1.3 $ */ public class ObjectRenderLabel extends JLabel { private static final String DEFAULT_NULL_STRING...
def func_wrap(self, *args): if self.db_mutex: self.db_mutex.acquire() result = func(self, *args) self.db_conn.commit() if self.db_mutex: self.db_mutex.release() return result
// NewMockVirtualRouterStatusWriter creates a new mock instance. func NewMockVirtualRouterStatusWriter(ctrl *gomock.Controller) *MockVirtualRouterStatusWriter { mock := &MockVirtualRouterStatusWriter{ctrl: ctrl} mock.recorder = &MockVirtualRouterStatusWriterMockRecorder{mock} return mock }
<filename>src/music/BasicGUIManager.java /* * Music Visualizations: http:/github.com/michaelbrooks/music-visualization * Copyright 2012, <NAME>. BSD License. */ package music; import graphics.AnimatedNGraph; import graphics.AnimatedNGraphPanel; import graphics.ArrayLineGraphPanel; import graphics.GraphPanel; impor...
/// Removes the provided token/path pair from the watch list. /// Does not stop watching this path, if it is associated with /// other tokens. pub fn unwatch(&mut self, path: &Path, token: WatchToken) { let mut state = self.state.lock().unwrap(); let idx = state.watchees.iter().position(|w| w.token == t...
// IsPartitionAvailable checks whether the partition table replica was available. func (tr *TiFlashReplicaInfo) IsPartitionAvailable(pid int64) bool { for _, id := range tr.AvailablePartitionIDs { if id == pid { return true } } return false }
<reponame>worldiety/gapt /* * MinIO Cloud Storage, (C) 2015, 2016 MinIO, 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 * * U...
Species Mention Entity Recognition, Linking and Classification Using RoBERTa in Combination with Spanish Medical Embeddings This paper introduces the solution submitted by puma’s team to the LivingNER 2022 shared task. The proposed system finds species mentions inside clinical case reports, links the mentions to the N...
pub mod definitions; pub mod mesh; pub mod pipeline; pub mod prelude; pub mod system; pub mod utils; pub use system::System; use crate::utils::Event; use winit::{ event::{self, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::WindowBuilder, }; /////////////////////////////////////////////////...
/* Routine to determine the base address of the BroadSync Register cache on KT2 */ uint32 soc_cmic_bs_reg_cache(int unit, int bs_num) { uint32 msg_end = MSG_AREA_END(_soc_cmic_uc_msg_base(unit)); return msg_end + bs_num * sizeof(mos_msg_bs_reg_cache_t); }
<reponame>jfass/scythe #ifndef SCYTHE_H #define SCYTHE_H #include <zlib.h> #include "kseq.h" /* KSEQ_INIT() cannot be called here, because we only need the types defined. Calling KSEQ_INIT() would also define functions, leading to an unused function warning with GCC. So, the basic typedefs kseq.h has are inc...
<reponame>guochunhe/Vitis-AI # Copyright 2019 Xilinx 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 ...
//============================================================================== /// Representation of a player in the game. This player could be local or /// remote. //============================================================================== class PlayerController: public ObjectBase { public: DEFINE_T...
THE BARYONIC ACOUSTIC FEATURE AND LARGE-SCALE CLUSTERING IN THE SLOAN DIGITAL SKY SURVEY LUMINOUS RED GALAXY SAMPLE We examine the correlation function ξ of the Sloan Digital Sky Survey Luminous Red Galaxy sample at large scales (60 h−1 Mpc < s < 400 h−1 Mpc) using the final data release (DR7). Focusing on a quasi-vol...
<filename>lib/src/layers/LayerVideo.ts import Layer from './Layer'; import { fileName } from '../utils'; /** * A video element. */ export default class LayerVideo extends Layer { constructor(json: any, assets: any) { super(json, assets); this.fileID = fileName(json.content.source); this.file = assets....
/** * Absolute bounds always same to relative bounds, because diagrams can't have a parent! */ @Override public void testGetAbsoluteBounds() { BasicDiagram d = new BasicDiagram("diagram"); BasicShape grandfather = getBasicShapeToTest("Grandfather"); BasicShape father = getBasicShapeToTest("Father"); Basi...
// appendFilterForTask will create a new filter for a task and append // that filter at the end of the pipeline. If processing has not // been started yet, it will be started. func (w *Walker) appendFilterForTask(task workerTask, udata interface{}, buflen int) error { if w.promising { return ErrNoMoreFiltersAccepted...
#include <stdio.h> #include <stdlib.h> #include <string.h> void send_data(unsigned char *data, int len) { printf("[Sent data]\n"); for (int i=0; i < len; i++) { printf("%2x ", data[i]); } printf("\n"); } unsigned char* bar() { // Array data[8] is deallocated immediately on function return as it falls ...
/* * Check whether request parameters has specified parameter fields * @param form is a url.Values point which will be checked * @param args are checking field names * @return nil if check successfully, otherwise a ChatError indicates first unfound parameter */ func CheckChatParameter(form *url.Values, args ...str...
from torch_scope import basic_wrapper as bw import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import os import argparse import logging import functools import codecs import json from abnlp.model import seqLabel, ensembledSeqLabel from abnlp.encoder import strFromFileEncod...
// #include<bits/stdc++.h> using namespace std; #define ll long long #define itn int #define endl "\n" #define h printf("\n") #define MAXN 111111 inline int read(){ int x=0,y=1;char c=getchar(); while (c<'0'||c>'9') {if (c=='-') y=-1;c=getchar();} while (c>='0'&&c<='9') x=(x<<3)+(x<<1)+c-'0',...
1 of 1 2 of 1 John Kerry has been U.S. Secretary of State for precisely one year, and he has already 1) rescued President Obama from his ill-considered promise to bomb Syria if it crossed the “red line” and used poison gas; 2) opened serious negotiations with Iran on its alleged attempt to build nuclear weapons; and 3...
def search_services(query, services, quiet): cards = set() for svc in services: if (svc.uses_feature(query) or svc.uses_database(query) or query.upper() in svc.mxd.upper() or query.upper() in svc.name.upper()): if quiet >= 2: cards.add(svc.veryquiet_repr()) ...
By Richard Black Environment correspondent, BBC News website Lake sediments contain a record of Arctic temperatures Arctic temperatures are now higher than at any time in the last 2,000 years, research reveals. Changes to the Earth's orbit drove centuries of cooling, but temperatures rose fast in the last 100 years ...
package rpc import ( "context" ) // GetFeeRateGovernor returns the fee rate governor information from the root bank. func (cl *Client) GetFeeRateGovernor(ctx context.Context) (out *GetFeeRateGovernorResult, err error) { err = cl.rpcClient.CallForInto(ctx, &out, "getFeeRateGovernor", nil) return } type GetFeeRateG...
A new report commissioned by the Swiss Jewish Community Federation (SIG) and the Foundation against Racism and Anti-Semitism (GRA) found that anti-Semitic attitudes persist in Switzerland.According to the study, anti-Semitic attitudes are encountered in 10 to 25 percent of the country's German-speaking population. In ...
// detect user can update the mirror func detectCanUpdateMirror(ctx context.Context, m *repo_model.Mirror, gitArgs []string) (bool, error) { repoPath := m.Repo.RepoPath() newRepoPath := fmt.Sprintf("%s_update", repoPath) err := util.CopyDir(repoPath, newRepoPath) defer func() { errDelete := util.RemoveAll(newRepo...
<gh_stars>1-10 package dynamic import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" "k8s.io/client-go/dynamic" "k8s.io/client-go/rest" "k8s...
/* Routine to initialize the style cache */ Boolean StyleInit(void) { ushort *pistd; int i; hStyles = MemAllocLMem(LMEM_TYPE_GENERAL, sizeof(StyleHeader)); if (hStyles == NullHandle) { SetError(TE_OUT_OF_MEMORY); return FALSE; } MemLock(hStyles); cStyleIndexArray = LMemAlloc(hStyles...
/* overwrites an existing value . Adds a new entry if not. * returns * 1 OK * 0 Memory problems */ int pair_set(pair p, const char* name, const char* value) { size_t i, cbAvailable, cbRequired; if(!pair_find(p, name, &i)) return pair_add(p, name, value); cbAvailable = strlen(p->element[i].value) + 1; cbRequ...
<reponame>JeffyLu/gormqy package gormqy import ( "strings" ) type Query struct { exprs []string vals []interface{} orders []string limit uint64 } func New() *Query { return &Query{} } func (q *Query) Condition() *Condition { return NewCondition(q) } func (q *Query) AndCondition() *Condition { return q....
// A has enough buffer for B void merge(int A[], int n, int B[], int m) { int x = n - 1; int y = m - 1; for (int i = m + n - 1; i >= 0 && y >= 0; --i) { if (A[x] > B[y]) A[i] = A[x--]; else A[i] = B[y--]; } }
package rule import ( "strings" ) // variable encodes a variable for interpolation, eg. ${foo.bar.baz}, or a // segment of one, e.g. ${foo.bar} of ${foo.bar.baz} type variable struct { segment string // e.g. "bar" from ${foo.bar.baz} segmentName string // e.g. "foo.bar" from ${foo.bar.baz} fullName string ...