content stringlengths 10 4.9M |
|---|
// Flatten a quadratic statement, writing explicitly the generators
// (and optionally the witnesses) in simple vectors.
FlatQuadStmt::FlatQuadStmt(const PedersenContext& ped,
const QuadConstraint& cnstr, const PtxtVec& xes, const PtxtVec& ys) {
size_t n = cnstr.indexes.size();
size_t n2 = xes.size(); ... |
def simplify(self):
for component in list(nx.connected_components(self.G)):
counted = [s for s in component if self.counts[s]]
keep = set(counted)
for s0,s1 in combinations(counted,2):
for path in nx.all_shortest_paths(self.G,s0,s1):
keep.u... |
#include "PowerUpState.h"
#include <memory>
#include "Core/src/Exception.h"
#include "Communication/GeneralParams.h"
#include "ConfigParams.h"
#include "ClusterManager.h"
#include "ProcessingState.h"
using namespace std;
void PowerUpState::HandleState(StateContext &stateContext, CommandType commandType, const General... |
package search.binary;
class AllocateBooks {
public static void main(String[] args) {
}
}
|
def construct_circuit(self, mode='circuit', register=None):
dim = (self._num_qubits + 1)//2
if mode == 'vector':
state = np.zeros((2**(2*dim - 1)), dtype=np.complex)
for i in range(2**(dim-1)):
j1 = i << dim
j2 = i
state[j1 + j2] = ... |
import React from "react";
import { Job } from "../types";
type Props = {
item: Job;
};
const JobItem = (props: Props) => {
const { item } = props;
return (
<div style={{ marginBottom: "60px" }}>
<p className="about-text">{item.employer}</p>
{item.department && (
<>
{" "}
... |
<reponame>zzApotheosis/Personal-Projects
#include <xc.h>
#include "LCD.h"
//Functions below must be defined for the interface
void LCDWriteByte(char c, char rs);
char LCDReadByte(char rs);
void LCDInitPort(void);
void LCDWrite8(char c, char rs); //Only needed if 4 bit mode is supported
//Private LCD Functions
void LC... |
/*
!==========================================================================
elemental function gsw_t_deriv_chem_potential_water_t_exact (sa, t, p)
!==========================================================================
!
! Calculates the temperature derivative of the chemical potential of water
! in seawater s... |
package com.example.demo.controller;
import com.example.demo.domain.Singer;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface SingerR... |
/**
* This class handles communication with clients using NIO. There is one per
* client, but only one thread doing the communication.
*/
public class NIOServerCnxn implements Watcher, ServerCnxn {
private static final Logger LOG = Logger.getLogger(NIOServerCnxn.class);
private ConnectionBean jmxConnectionB... |
<filename>cmd/snps.go
package cmd
import (
"github.com/spf13/cobra"
"github.com/cov-ert/gofasta/pkg/snps"
)
var snpsReference string
var snpsQuery string
var snpsOutfile string
func init() {
rootCmd.AddCommand(snpCmd)
snpCmd.Flags().StringVarP(&snpsReference, "reference", "r", "", "Reference sequence, in fasta... |
#include <graphic_syscalls.h>
#include <utils/string.h>
#include <renderer/renderer.h>
using namespace syscall;
void syscall::sys_fb_info(interrupts::s_registers* regs) {
renderer::framebuffer_t* user_address = (renderer::framebuffer_t*) regs->rbx;
*user_address = renderer::default_framebuffer;
} |
/*
* Copyright (c) 2011-2015, <NAME>. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* 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.apach... |
<filename>Mage/src/main/java/mage/abilities/dynamicvalue/common/SubTypeAssignment.java
package mage.abilities.dynamicvalue.common;
import mage.abilities.dynamicvalue.RoleAssignment;
import mage.cards.Card;
import mage.constants.SubType;
import mage.game.Game;
import java.util.Set;
import java.util.stream.Collectors;
... |
pub mod progressbar;
pub mod table;
pub mod text;
|
/**
* Try to perform the actual model enhancing.
*/
private static CtClass doModelModifications(byte[] byteCode, Version modelVersion, ClassLoader... loaders) {
if (!initiated) {
initiate();
}
CtClass cc = null;
LoaderClassPath[] classloaders = new LoaderClassPath[l... |
Oversaturating synchronous CDMA systems using collaborative coding
Oversaturated synchronous CDMA system is proposed based on collaborative coding, where data bits of group of L + s users are jointly one-to-one mapped onto 2/sup L+s/ L-dimensional signal vectors. Instead of the unique signature per each user, the L-di... |
/*
* 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 m... |
/**
* Convert the input argument into a string describing the time span.
*
* @param interv the time interval, in milliseconds
* @return a String describing the time span
*/
public static String millisToTimeSpan(final long interv)
{
StringBuffer buf = new StringBuffer(100);
long lMillis = ... |
def isolated_labels(
self,
adata: AnnData,
adata_id: str,
batch_key: str,
group_key: str,
embed: str,
) -> None:
self.__check_key(adata_id)
self.metrics[adata_id]['il_sil'] = metrics.isolated_labels(adata,
... |
def manage_rundir(request, clean_up):
global STARTUP
if STARTUP:
if os.path.exists(run_dir):
shutil.rmtree(run_dir)
STARTUP = False
os.mkdir(run_dir)
def finalize_rundir():
if os.path.exists(run_dir) and clean_up:
shutil.rmtree(run_dir)
request.add... |
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
ArrayList<String> VariableA = new ArrayList<String>(Arrays.asList("red", "green"));
ArrayList<String> VariableB = new ArrayList<String>(Arrays.asList("A", "B", "C"));
ArrayList<String> VariableC = ... |
.
We report 2 cases of portal vein thrombosis associated with a single point mutation in the factor V gene that replaces arginine in residue 506 with glutamine. This mutation induces abnormal resistance to anticoagulant activity of activated protein C and increases the risk of deep vein thrombosis. Both patients had a... |
<gh_stars>0
#include <string>
#include <iostream>
#include <set>
#include <AMReX_ParmParse.H>
#include <AMReX_MultiFab.H>
#include <AMReX_DataServices.H>
#include <AMReX_BCRec.H>
#include <AMReX_Interpolater.H>
#include <WritePlotFile.H>
#include <AMReX_BLFort.H>
#include <mechanism.h>
#include <chemistry_file.H>
#in... |
The structure of schizotypy, its relation to subdiagnoses of schizophrenia and to sex and age.
A growing amount of evidence suggests that the generally accepted division of schizophrenic symptomatology into positive and negative aspects should be extended to include a third major aspect, namely 'disorganization/social... |
South Africa's involvement in the battle that toppled the former president of the Central African Republic (CAR), François Bozizé, has laid bare the country's cold war with France for control of Francophone Africa.
And fallout from the battle of the CAR capital, Bangui, now the subject of official enquiries, may resu... |
In order to reduce pollution level in the capital, the Delhi government has asked the Centre to make a provision in the law to impose a hefty fines on vehicles more than 15 years old entering the city.
Concerned over the increasing pollution levels, Union Environment Minister Prakash Javadekar on Monday called a meeti... |
/**
* nfexp_callback_register - register a callback
* @h: library handler
* @cb: callback used to process expect received
* @data: data used by the callback, if any.
*
* This function register a callback to handle the expect received,
* in case of error -1 is returned and errno is set appropiately, otherwise
*... |
def decode_subst(msg, steps=4000, restarts=90):
msg = cat(allwords(msg))
candidates = [
hillclimb(encode(msg, key=cat(shuffled(alphabet))), logP3letters,
neighboring_msgs, steps) for _ in range(restarts)
]
p, words = max(segment2(c) for c in candidates)
return ' '.join(word... |
<gh_stars>0
#include <gtest/gtest.h>
#include <string>
#include "max_substring.h"
using namespace std;
TEST(NormalCase, SameLength)
{
string str1 = {"abcdef"}, str2 = {"defabc"};
string res = get_max_substring(str1, str2);
ASSERT_TRUE((res == "abc") || (res == "def"));
}
TEST(NormalCase, DifferentLength)... |
/**
* Represents a region where an experiment takes place
*/
public class Region implements Serializable {
private String regionText;
private Location geoLocation;
private Double kmRadius;
public Region() {
this.regionText = "";
this.geoLocation = new Location();
this.kmRadiu... |
#include<stdio.h>
int main()
{
long long int T,N,K,i,j,k,l,c,b;
scanf("%lld",&T);
for(i=0;i<T;i++)
{
c=0;
scanf("%lld",&N);
scanf("%lld",&K);
while(N!=0)
{
if(N%K==0)
{
N=N/K;
c++;
}
else
{
b=N/K;
c=c+N-(b*K);
N=b*K;
}
... |
import { ArraySchema, MapSchema } from "@colyseus/schema";
import { GamePlayState } from "./GamePlayState";
import { CardSuit, ICard } from "./ICard";
import { IChatMessage } from "./IChatMessage";
import { IPlayer } from "./IPlayer";
export interface ICourtPieceState {
players: MapSchema<IPlayer>;
currentPlayer: ... |
package chat_test
import (
"reflect"
"testing"
"github.com/PacktPublishing/Hands-On-Software-Engineering-with-Golang/Chapter04/chat"
)
func TestChatRoomBroadcast(t *testing.T) {
pub := new(spyPublisher)
room := chat.NewRoom(pub)
room.AddUser("bob")
room.AddUser("alice")
_ = room.Broadcast("hi")
// Check pu... |
<filename>backend/src/factories/upload-controller-factory.ts
import { UploadHelper } from '../helpers/upload-helper'
import { UploadController } from '../controllers/upload-controller'
import { LocalStorage } from '../adapters/local-storage-adapter'
export const makeUploadController = (): UploadController => {
const... |
<gh_stars>0
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
struct Vertex
{
struct Edge *edgeList[100];
int edgeCount;
int id;
int status;
};
struct Edge
{
struct Vertex *end[2];
int w;
};
//判斷傳入的 v 是否為樹林
void DFS(struct Vertex *v)
{
if (v->status != 0)
return;
printf("%d ", v->id);
... |
def extract_assets(html):
soup = BeautifulSoup(html, 'html.parser')
tags_and_attributes = (
('a', 'href'),
('link', 'href'),
('img', 'src'),
('script', 'src'),
)
assets = []
for tag, attribute in tags_and_attributes:
asset_elements = soup.find_all(tag)
... |
//Read and Display array elements
#include <stdio.h>
void main()
{
int a[20], n, i, *p;
p = a; //Pointer Initialization
printf("Enter the number of elements:\n");
scanf("%d", &n);
//Address of (ptr+i)
//Value stored at the address *(ptr+i)
printf("Enter the elements:\n");
... |
Islamic State (Isis) has released a propaganda song in Mandarin, aimed at recruiting Chinese Muslims, just two weeks after executing a hostage from the country. The recording is in the form of a 'nasheeds' – an Islamic chant sung a cappella.
The four-minute song found its way to the internet via jihadist channels. Uig... |
/**
* Modify dataset in catalog.
*
* @param dataset
* @return HTTP 200 OK if dataset could be could be created.
*/
@PreAuthorize("hasPermission(#catalogId, 'write')")
@CrossOrigin
@RequestMapping(value = "/{id}", method = PUT, consumes = APPLICATION_JSON_VALUE, produces = MediaType.APPL... |
<filename>openapi_core/testing/requests.py<gh_stars>100-1000
"""OpenAPI core testing requests module"""
from urllib.parse import urljoin
from werkzeug.datastructures import Headers
from werkzeug.datastructures import ImmutableMultiDict
from openapi_core.validation.request.datatypes import OpenAPIRequest
from openapi_... |
A Method for Alternatives Ranking Using an OWA Operator Based on the Laplace Distribution
We consider the problem of representing a multiple-criteria (i.e., multiple heterogeneous measurements) object by a single value that we can use to compare and rank different objects. An intrinsic characteristic of the multiple-c... |
<gh_stars>0
import { expect } from "chai";
import { stub } from "sinon";
import * as React from "react";
import { shallow } from "enzyme";
import { Stats } from "../Stats";
import ErrorMessage from "../ErrorMessage";
import LoadingIndicator from "opds-web-client/lib/components/LoadingIndicator";
import LibraryStats f... |
// -*-c++-*- osgWidget - Code by: <NAME> (cubicool) 2007-2008
// $Id: Box.cpp 50 2008-05-06 05:06:36Z cubicool $
#include <osgDB/Registry>
#include <osgDB/Input>
#include <osgDB/Output>
#include <osgDB/FileUtils>
#include <osgWidget/Box>
bool osgWidget_Box_readData(osg::Object& /*obj*/, osgDB::Input& fr)
{
/*
osgW... |
/**
*
* RadialDFTLib
*
* RadialSrelSolver.cpp
*
* Created by Franco Moitzi on 3/3/23.
*
* Copyright (c) 2023 University of Leoben. All rights reserved.
*
*/
#include "RadialSrelSolver.hpp"
void lsms::RadialSrelOut(std::complex<double> E, int kappa,
std::complex<double> *P, std::co... |
<filename>lang/py/pylib/06/mmap/mmap_write_copy.py
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
import mmap
import shutil
import contextlib
#Copy the example file
shutil.copyfile('lorem.txt','lorem_copy.txt')
word='consectetuer'
reversed1=word[::-1]
with open('lorem_copy.txt','r+') as f:
with contextlib.closing... |
/* Cydia - iPhone UIKit Front-End for Debian APT
* Copyright (C) 2008-2015 <NAME> (saurik)
*/
/* GNU General Public License, Version 3 {{{ */
/*
* Cydia is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, ei... |
/**
* Clears a value stored at the given index in this storage.
*
* @param index the index to clear a value at.
* @return {@code true} if this storage array is emptied, {@code false}
* otherwise.
*/
public boolean clear(short index) {
if (indexes == null... |
<filename>tests/column_test.py
import pytest
from dbjudge.structures.column import Column
from dbjudge import exceptions
def test_unsupported_ctype():
with pytest.raises(exceptions.InvalidColumnTypeError) as expected_exception:
Column('randomname', 'nosupptype')
assert 'Unsupported column type: nosu... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Controle;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util... |
<gh_stars>0
package client;
import java.net.URL;
import java.util.ArrayList;
import java.util.ResourceBundle;
import javafx.scene.Node;
import entites.Book;
import entites.LibrarianNew;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import... |
ADVERTISEMENT
“Who are all these people interested in this?"
The question, asked by Shilpi Kumar, head of product commercialization at Filament, summed up the reaction to a Trusted IoT Alliance event sponsored by Cisco in San Jose last week. As the event showcased, the intersection of the Internet of Things (IoT) and... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
TH = raw_input()
TA = raw_input()
TEAMS = dict(h=TH, a=TA)
N = int(raw_input())
counts = {}
for i in xrange(N):
minute, team, player, card = raw_input().split()
k = (team, player)
counts.setdefault(k, 0)
if counts[k] >= 10:
continue
counts[k] += ... |
def sort_docs(self, sort_field):
for doc in self.doc_list:
if not hasattr(doc, "doc_metadata"):
print "A doc in doc_list doesn't have metadata, "\
"so we can't sort on a metadata field!"
raise Exception
if not hasattr(doc.doc_metadata, sort... |
<filename>bower_components/ocrad-bower/ocrad-0.23-pre1/ucs.cc
/* GNU Ocrad - Optical Character Recognition program
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
2012, 2013 <NAME>.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU G... |
def initialize(self):
if getattr(self, '_initialized', False):
return
out = getattr(self, '_output_layers', None)
if out is None:
self.initialize_layers()
self._check_for_unused_kwargs()
iter_funcs = self._create_iter_funcs(
self.layers_, self.... |
s=list(input())
n=len(s)
l=[-1 for i in range(n+1)]
ct=0
ans=0
if s[0]=='<':l[0]=0
if s[n-1]=='>':l[n]=0
for i in range(n-1):
if s[i]=='>' and s[i+1]=='<':
l[i+1]=0
for i in range(n):
if s[i]=='<':
l[i+1]=l[i]+1
for i in range(n-1,-1,-1):
if s[i]=='>':
l[i]=l[i+1]+1
for i in range(n-1):
if s[i]=='<... |
<gh_stars>1-10
/*------------------------------------------------------------------------------
* 2048.c
*
* File: main.c
* Author: <NAME>
* Date: 2021/04/28
*
* MIT License - Copyright (c) 2021 <NAME>
*----------------------------------------------------------------------------*/
#include "../includes/main.h"... |
use crate::errors::CollectionError;
use solana_program::{
account_info::AccountInfo,
entrypoint::ProgramResult,
msg,
program::{invoke, invoke_signed},
program_error::ProgramError,
pubkey::Pubkey,
system_instruction,
sysvar::{rent::Rent, Sysvar},
};
use std::convert::TryInto;
pub fn asse... |
/**
* List all the steps of the target BMR cluster.
*
* @param request The request containing the ID of target BMR cluster.
*
* @return The response containing the list of steps owned by the cluster.
*/
public ListStepsResponse listSteps(ListStepsRequest request) {
checkNotNull(req... |
TL;DR
Hello Particle community,
I’m here to present some of the recent work I’ve been doing to add Rust support to the photon.
(Full disclaimer: I’m under contract to improve Rust’s embedded development story and one of the tasks involves adding Rust support to well known development boards and I picked the photon. ... |
import { EventEmitter } from "events";
import { Task } from "./types/rabbitmq";
class UserDataListener extends EventEmitter {
constructor() {
super();
}
genKey(addr: string, cmd: Task) {
return addr + "+" + cmd;
}
}
export default UserDataListener;
|
// This callback function continuously executes and reads the image data
void process_image_callback(const sensor_msgs::Image img)
{
enum Pos {LEFT, MIDDLE, RIGHT, NOTSEEN};
int white_pixel = 255;
int scanned_pixel = 0;
int detected_pixel = 0;
int ball_volume = 0;
int ball_position = 0;
int ... |
<filename>src/main/java/com/objectspace/coorperation/util/SerializeUtil.java
package com.objectspace.coorperation.util;
import java.io.*;
/**
* @Description: 序列化工具类,必须实现了Serializable接口的对象才可以进行序列化
* @Author: NoCortY
* @Date: 2019/10/4
*/
public class SerializeUtil {
/**
* @Description: 序列化对象
* @Param: ... |
/* crossTalksAndMerge() - merges the sorted segments arr[bIndex..mIndex] (left) and arr[mIndex+1..eIndex] (right) into a single sorted arr[bIndex..eIndex]
and returns the number of cross quality talks which is found simulataneously as the merging is done. To do this, we note that
... |
///
/// For a given world <world> and a hypothetical robot position <position>
/// and a list of current real sensor values <real_sensor_values>
/// we compute the sensor values we would get (without any noise)
/// at the robot position <position>.
///
/// Already DURING the computation of these sensor values
/// we co... |
<gh_stars>1-10
/*-
* ============LICENSE_START=======================================================
* ONAP Policy Engine
* ================================================================================
* Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
* ================================... |
def on_enter(event_data):
pocs = event_data.model
pocs.next_state = 'scheduling'
try:
pocs.observatory.take_flat_fields()
except NotTwilightError:
pocs.logger.info("No longer twilight. Moving to next state.")
except NotSafeError:
pocs.logger.warning("Safety failed while takin... |
/**
* Tests the command-line arguments of the starter classes.
*
* @author BaseX Team 2005-12, BSD License
* @author Christian Gruen
*/
public abstract class MainTest {
/** Null output stream. */
static final PrintStream NULL = new PrintStream(new NullOutput());
/** Test database name. */
static final Stri... |
The first trip from Tel Aviv to Eilat is scheduled to take place in July 2015, and is anticipated to take exactly 7:06 minutes. Israeli entrepreneur Shai Agassi is leading the project together with Elon Musk in collaboration with a Japanese team.
Is the public transportation problem in Israel solved once and for all? ... |
<filename>solutions/practice/rps_randomnumber.py
# RPS game with random numbers
# import
from random import randint
# input
print('Welcome to RPS game!!')
player_choice = int(input('Enter your choice (0 - Rock | 1 - Scissors | 2 - Paper): '))
# processing & output
cpu_choice = randint(0,2)
if cpu_choice == 0:
pr... |
// -*- C++ -*-
//
// <NAME>, <NAME>
// orthologue
// (c) 1998-2020 all rights reserved
//
// configuration
#include <portinfo>
// externals
#include <iostream>
#include <pyre/journal.h>
#include <pyre/memory.h>
#include <pyre/grid.h>
// main
int main() {
// journal control
pyre::journal::debug_t debug("pyre.m... |
<reponame>m-moris/waf-java-samples
package org.pnop.waf.sample.act.sb.indicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Component("MyApplication2"... |
export const urlRegex = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?$/;
export function isValidUrl(value: string) {
return urlRegex.test(value);
}
|
By the summer of 1966 it had already been five years since the late President John F. Kennedy had committed the United States to a manned lunar landing by the end of the decade. While the US seemed to have had a slow start as the Soviet Union chalked up one important space first after another, by the summer of 1966 the... |
/**
* Sends a custom message and informs {@link WebSocketObserver} instances of this new message.
*
* @param msg
* @throws IOException
*/
@Deprecated
public void sendAndNotify(WebSocketMessageDTO msg) throws IOException {
logger.debug("sending custom message");
WebSocketMess... |
class DataSource:
'''The base class of data sources. The class defines the defaulkt behavior for data sources.'''
def getUpdateItems(self):
'''Returns a dictionary of items determined by the source for updates as opposed to add (to sinks)'''
'''The dictionary contains key/values that represent t... |
Wrath & Glory FAQ
What is Warhammer 40,000 Roleplay: Wrath & Glory?
Wrath & Glory is an officially licensed, brand-new roleplaying game set in the universe of Warhammer 40,000.
How is it related to the 8th edition of the tabletop miniatures game Warhammer 40,000?
The events that are occurring in the Dark Imperium o... |
Indiana Secretary of State Connie Lawson says an array of steps have been taken to ensure the integrity of Indiana's election system spread out over 92 jurisdictions.
By BRIAN A. HOWEY
INDIANAPOLIS - Indiana Secretary of State Connie Lawson reassured Hoosier voters that Indiana’s election system has not been compromi... |
export interface DeleteRecurrence {
OrderID: string;
}
export interface Recurrence {
orderID: string;
paymentInfo: PaymentInfo;
recurring: Recurring;
billingInfo: BillingInfo;
shippingInfo: ShippingInfo;
}
interface PaymentInfo {
cardInfo: string;
creditCardNumber: string;
expirationMonth: string;
... |
/*******************************************************************
MIT License
Copyright (c) 2016 BobbyAnguelov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including w... |
/**
* Checks if a tzhaar npc has been killed, if so then it checks if it needs
* to do the tz-kek effect. If tzKek spawn has been killed twice or didn't
* need to be killed it calls killedTzhaar.
*
* @param i
* The npc.
*/
private void tzhaarDeathHandler(int i) {
if (isFightCaveNpc(i) && npc... |
// Run is used to run a watch plan
func (p *Plan) RunWithConfig(address string, conf *consulapi.Config) error {
logger := p.Logger
if logger == nil {
logger = newWatchLogger(p.LogOutput)
}
p.address = address
if conf == nil {
conf = consulapi.DefaultConfigWithLogger(logger)
}
conf.Address = address
conf.Dat... |
TRIM21 causes abnormal expression of IL-6 in oral lichen planus via the TRIB2-MAPK signal axis.
Oral lichen planus (OLP) is a common chronic inflammatory disease in the oral cavity, and has the risk of developing into oral squamous cell carcinoma (OSCC). It is necessary to discover the role of TRIM21 in the pathogenes... |
use crate::pre_tokenizers::unicode_scripts::scripts::{get_script, Script};
use crate::tokenizer::{normalizer::Range, PreTokenizedString, PreTokenizer, Result};
use crate::utils::macro_rules_attribute;
#[derive(Clone, Debug, PartialEq)]
#[macro_rules_attribute(impl_serde_type!)]
pub struct UnicodeScripts;
impl Unicode... |
import numpy as np
import tensorflow as tf
import os
import deepdish as dd
import struct
from array import array
from tensorflow.python.framework import ops
from tensorflow.contrib.framework.python.framework import is_tensor
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import clip_ops
from te... |
<filename>asts/asts.go
// Packages asts contains utilities for constructing and manipulating ASTs.
package asts
import (
"fmt"
"github.com/jschaf/bibtex/ast"
"github.com/jschaf/bibtex/token"
"strconv"
"strings"
)
func UnparsedBraceText(s string) *ast.UnparsedText {
return &ast.UnparsedText{
Kind: token.Brace... |
const { DropkiqEngine } = require('dropkiq')
import { BoundElement } from './BoundElement'
import tippy from 'tippy.js';
import { v4 as uuidv4 } from 'uuid';
const createDOMPurify = require('dompurify');
const DOMPurify = createDOMPurify(window);
enum ColumnType {
Boolean = 'ColumnTypes::Boolean',
DateTime = 'Co... |
/**
* The type Provider metamodel generator.
*
* @author Christos Tsakostas
*/
public class ProviderMetamodelGenerator extends AbstractMetamodelGenerator {
// ===============================================================================================
// DEPENDENCIES
// ===================================... |
/**
* Take the waste pile and turn it into the deck for the next round.
*
* @return {@code false} iff the game is over, otherwise {@code true}
*/
public boolean restartDeck() {
Preconditions.checkState(deck.isEmpty());
++passes;
if (isGameOver()) {
return doGameOv... |
/**
* Represents a highlight draped over the terrain.
*/
public class Highlight extends TriMesh
{
/** The position of the center of the highlight. */
public float x, y;
/** The layer of the highlight. */
public byte layer = 2;
/** If true, the highlight will be ov... |
def _pyt_train(self, datatype):
defaults = integration_test_parser_defaults.copy()
defaults['datatype'] = datatype
defaults['shuffle'] = True
str_output, valid, test = testing_utils.train_model(defaults)
self.assertTrue(
solved_task(str_output, valid, test),
... |
/*
* Called via glDeleteTexture to delete a texture object.
*/
void
tdfxTMFreeTexture(tdfxContextPtr fxMesa, struct gl_texture_object *tObj)
{
tdfxTexInfo *ti = TDFX_TEXTURE_DATA(tObj);
if (ti) {
tdfxTMMoveOutTM(fxMesa, tObj);
FREE(ti);
tObj->DriverData = NULL;
}
} |
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
from jinja2 import E... |
/*
This might seems as under-tested, I copied it from another project of myne where it was perfectly tested.
Just for the sake of saving time did not move the tests.
TODO test
*/
@Slf4j
public class CassandraRepository<T> {
static final String MY_POD_NAMESPACE_ENV_VARIABLE = "MY_POD_NAMESPACE";
static final... |
/*
* nfs_async_stop_sig:
* Wait for all outstanding putpage operation to complete. If a signal
* is deliver we will abort and return non-zero. If we can put all the
* pages we will return 0. This routine is called from nfs_unmount and
* nfs3_unmount to make these operations interruptible.
*/
int
nfs_async_stop_si... |
What is middleware?
What exactly is middleware? In real application when the request comes to the server it has to go through the different request handlers. For example, it could be authentication, validation, ACL, logging, caching and so on. Consider the request-response circle as an onion and when a request comes i... |
/**
* Start the ProfileActivity to display information of the specified user
* @param userId user to display
*/
private void visitProfile(String userId) {
Intent profileIntent = new Intent(getContext(), ProfileActivity.class);
profileIntent.putExtra(ProfileActivity.PROFILE_VISIT_CODE, Pro... |
// MarshalJSON implements the json.Marshaller interface for type JobResponse.
func (j JobResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
populateTimeRFC1123(objectMap, "endTimeUtc", j.EndTimeUTC)
populate(objectMap, "failureReason", j.FailureReason)
populate(objectMap, "jobId", j... |
<reponame>pozi/PoziConnect
"""
This module contains some common functions used by wxPython-AUI to
manipulate colours, bitmaps, text, gradient shadings and custom
dragging images for AuiNotebook tabs.
"""
__author__ = "<NAME> <<EMAIL>>"
__date__ = "31 March 2009"
import wx
from aui_constants import *
if wx.Platfor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.