content stringlengths 10 4.9M |
|---|
/*
* Create iterator to get SID to UID/GID mappings
*
* Output:
* iter - iterator
*/
idmap_stat
idmap_iter_mappings(idmap_iter_t **iter, int flag)
{
idmap_iter_t *tmpiter;
idmap_list_mappings_1_argument *arg = NULL;
__ITER_CREATE(tmpiter, arg, IDMAP_LIST_MAPPINGS);
arg->flag = flag;
*iter = tmpiter;
return... |
package com.mmall.beans;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.Min;
/**
* @author liliang
* @date 2017/11/20.
*/
public class PageQuery {
@Getter
@Setter
@Min(value = 1,message = "当前页码不合法")
private int pageNo = 1;
@Getter
@Setter
@Min(value =... |
The Final Fantasy franchise is one of the most successful video game series in history.
It’s been 30 years since the first game of the series was released, and to celebrate, ‘Distant Worlds: Music From Final Fantasy’ is coming to Australia for the very first time.
The concert event will feature legendary Japanese vid... |
<reponame>Schoyen/advent-of-code-2021<gh_stars>0
use std::{fs, path::Path};
fn mul_sum_directions(dir: &Vec<&str>, amount: &Vec<i64>) -> i64 {
let mut horizontal = 0;
let mut depth = 0;
assert_eq!(dir.len(), amount.len());
for i in 0..dir.len() {
if dir[i] == "forward" {
horizonta... |
<reponame>Jazk-Z/TypeScript_demo
// 基础类型
// Boolean
let isBoolean: boolean = true;
// 特殊
let isBoolean1: boolean = null;
let isBoolean2: boolean = undefined;
console.log(isBoolean);
// 数字类型
let num: number = 1
let num1: number = 0x123
console.log(num, num1)
// 字符串类型
let str: string = '11'
// 数组
let arr: number[] = [1, ... |
/**
* Editor is the base class for things which load and save
* an Obj and provide a changed callback.
*
* @author Brian Frank
* @creation 26 Sept 05
* @version $Revision$ $Date$
*/
public abstract class Editor
extends JPanel
{
/////////////////////////////////////////////////////////... |
/**
* \brief Set undefined length burst type of the specified master.
*
* \param ul_id Master index.
* \param burst_type Undefined length burst type.
*/
void matrix_set_master_burst_type(uint32_t ul_id, burst_type_t burst_type)
{
#if (SAMV70 || SAMS70|| SAME70)
Matrix *p_matrix = MATRIX;
volatile uint32_t *... |
/**
* Produces a variable-order predictor by first-order learning, by tricking the
* modelling into producing multiple first-order representations of states.
*
* @author David Rawlinson
* @copyright David Rawlinson
*/
public class VariableOrderMM extends FirstOrderMM {
public Volume _vif0; // unadulterated... |
Ocular Cyclorotation and Corneal Axial Misalignment in Femtosecond Laser-Assisted Cataract Surgery
ABSTRACT Purpose: To explore ocular cyclorotation and the source of corneal axial misalignment during femtosecond laser-assisted cataract surgery (FLACS). Methods: Forty-five sequential patients (50 eyes) who had undergo... |
<filename>frontend/src/chains/eth/helper.ts
// this function assumes privateKey is validated before call
import {Wallet} from 'ethers';
export const HELPER_MSG_ETH_PUBLIC_KEY = "An Eth Public Key must begin with 0x04 followed by 128 hex characters";
export const signTokenForEthChain = async (privateKey: string, toke... |
/**
* Kinesis Video Producer Callbacks Provider
*/
#define LOG_CLASS "CallbacksProvider"
#include "Include_i.h"
//////////////////////////////////////////////////////////
// Public functions
//////////////////////////////////////////////////////////
/**
* Create the default callbacks provider
*/
STAT... |
DEFECTS AND DAMAGES OF METAL COLUMNS OF INDUSTRIAL BUILDINGS
This article is a continuation of the series of articles by the authors about the characteristic defects and damage to the building structures of industrial buildings. In earlier articles, there were descriptions of defects in ground foundations, damage to f... |
package in.dreamlab.wicm.conf;
import org.apache.giraph.conf.BooleanConfOption;
import org.apache.giraph.conf.IntConfOption;
@SuppressWarnings("rawtypes")
public interface WICMConstants {
IntConfOption BUFFER_SIZE = new IntConfOption("wicm.localBufferSize", 500,
"Local ... |
<gh_stars>1-10
#include "ut.h"
#include <API.hpp>
#include "paths.h"
#include <string>
#include <fstream>
#include <filesystem>
#include <experimental/array>
#include <chrono>
#define make_arr std::experimental::make_array
void print(std::string str){
std::cout << str << std::endl;
}
template<typename T>
bool li... |
AFL CEO Gillon McLachlan earned $1.74 million in 2016, an increase of $20,000 on his 2015 wage package.
The AFL released key details from its 2016 financial accounts on Friday, revealing the League suffered a net loss of $17.8 million last year after grants and distributions.
According to the AFL's media release, the... |
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Player for HL1.
//
// $NoKeywords: $
//=============================================================================//
#ifndef TFC_PLAYER_H
#define TFC_PLAYER_H
#pragma once
#include "player.h"
#include "server_class.h"
#in... |
/**
* It is POJO for the SQLiteUriMatcher. It holds mapping data between uri mPath and SQL.
*/
public class SQLiteMatcherEntry {
private static final String TAG = SQLiteMatcherEntry.class.getSimpleName();
protected static final String TYPE_PREFIX = "vnd.";
private String mAuthority;
private String ... |
CJASN: Turning the Page.
I am privileged to have been given the opportunity to serve as the third Editor-in-Chief for theClinical Journal of the American Society of Nephrology (CJASN), a leading peer-reviewed journal in the field of nephrology. The journal owes its success to the visionary leadership and tireless effo... |
/**
* Compress the content of the message
*/
public class LZ4ContentCompressionStrategy implements ContentCompressionStrategy {
/**
* Used to get configuration values related to compression and used to compress message content
*/
LZ4CompressionHelper lz4CompressionHelper;
public LZ4ContentComp... |
/**
* Returns set based on the given array of {@link MetricTarget}.
* Set objects are returned from a preliminary warmed up cache, so this method has no memory overhead.
*
* @param targets input array
* @return set containing all items from the input array
*/
public static Set<M... |
/****************************************************************************
Author:<NAME>
Project: Computer Vision for Interactive Applications
Version: 1.1 Date:22/02/14 details: Creation of Gestures class
Version: 1.2 Date:26/02/14 details: Creation of Read from XML function
Version: 1.3 Date:26/03/14 details: Cre... |
Design A Mini Operating System Using Open Source System
Abstract: COSMOS (C# Open Source Managed Operating System) Paper provides a framework and tool-chain to develop an OS purely in managed code (C# and VB .NET). Cosmos supports integration with Visual Studio, and therefore is much easier to use. However, the framew... |
<filename>example/scale_example.py
import z5py
from heimdall import view, to_source
# FIXME this fails with out of range
def example():
path = '/home/pape/Work/data/cremi/example/sampleA.n5'
with z5py.File(path) as f:
raw = to_source(f['volumes/raw/s1'], scale=(1, 2, 2))
seg = f['volumes/segm... |
// removeExtraLocked removes all the requests not in ids.
func (r *stmtDiagnosticsRequestRegistry) removeExtraLocked(ids []int) {
valid := func(req stmtDiagRequest) bool {
for _, id := range ids {
if req.id == id {
return true
}
}
return false
}
i := 0
for _, req := range r.mu.requests {
if valid... |
import json
import logging
from flask import Flask, Response
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('flask-app')
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def main_route():
try:
payload = {'output': 'Hello World from Flask'}
return Response(
... |
/**
* AppointmentChangeRecord class to capture the changes in the status of the appointment
*/
@Entity
public class AppointmentChangeRecord {
// external Id of the patient
@Field
private String externalId;
// Appointment id being changed
@Field
private String appointmentId;
// date of t... |
<filename>backend/Backendapi/l_lib/function.py
def get_reply(code,msg):
reply = dict()
reply['error_code'] = code
reply['msg'] = msg
return reply |
/**
* SCAN Cache object
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 06/02/2011 dhladky Initial Creation.
*
* </pre>
*
* @author dhladky
* @version 1.0
*/
public class ScanDataCache {
/** ... |
<filename>src/main/java/com/biubiu/Flyweight/FlyweightFactory.java
package com.biubiu.Flyweight;
import java.util.HashMap;
import java.util.Map;
/**
* @author 张海彪
* @create 2017-10-03 下午2:53
*/
public class FlyweightFactory {
private Map<String, Object> strMap = new HashMap<>();
public IFlyweight getInsta... |
<filename>library/tests/test_edb.c
#include <stdlib.h>
#include "eaarlio/edb.h"
#include "greatest.h"
#include "assert_error.h"
#include "mock_memory.h"
/* Helper to initialize an EDB with data
*/
TEST init_edb(char *msg,
int records,
int files,
int files_0,
int files_1,
struct eaarlio_memory *me... |
inp = input()
counts = {}
for ch in inp:
counts[ch] = counts.get(ch, 0) + 1
if counts.get("4", 0) + counts.get("7", 0) > 7:
break
if counts.get("4", 0) + counts.get("7", 0) in [4,7]:
print("YES")
else:
print("NO") |
/**
* Created by Guest on 1/25/18.
*/
public class Sql2oTourDaoTest {
private Connection fred;
private Sql2oCauseDao causeDao;
private Sql2oBusinessDao businessDao;
private Sql2oAddressDao addressDao;
private Sql2oTourDao tourDao;
public Address setupAddress() {
return new Address("st... |
import React from 'react';
import { IconAlt } from '@veupathdb/wdk-client/lib/Components';
import { cx } from './Utils';
import { Tooltip } from '@material-ui/core';
interface Props {
iconClassName: string;
hoverText: string;
action: () => void;
}
export function ActionIconButton(props: Props) {
const { actio... |
Extending the sequences of HLA class I alleles without full‐length genomic coverage using single molecule real‐time DNA sequencing
The assignment of an HLA allele name to a sequence requires a comparison between the generated target sequence and a reference sequence on the IPD‐IMGT/HLA database. Absence of a full‐leng... |
<reponame>jgraef/vox-format
use nalgebra::{
Scalar,
Vector3,
};
use crate::types::Vector;
impl<T: Scalar> From<Vector<T>> for Vector3<T> {
fn from(v: Vector<T>) -> Self {
<[T; 3]>::from(v).into()
}
}
impl<T: Scalar> From<Vector3<T>> for Vector<T> {
fn from(v: Vector3<T>) -> Self {
... |
# 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/.
from auto_nag.bzcleaner import BzCleaner
class OneTwoWordSummary(BzCleaner):
def description(self):
return... |
<filename>validator-core/src/main/java/com/github/microtweak/validator/conditional/core/internal/AnnotationHelper.java<gh_stars>1-10
package com.github.microtweak.validator.conditional.core.internal;
import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.annotation.Repeatable;
import jav... |
If I were a teacher…: Concepts of People on the Autism Spectrum About the Education System
Assumptions: This article is part of a wider study on adults with autism. The main assumption of the series of studies is concerned with listening to and hearing the voices of those most affected – those with a diagnosis of auti... |
<filename>testdata/k-and-r/Chapter 4 - Functions and Program Structure/exercises/4-6.c
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#define BUFSIZE 100
#define MAXOP 100
#define MAXVAL 100 // maximum depth of val stack
#define NUMBER '0'
#define VARIABLE 'a'
double pop(void);
int getch(void);
int getop(c... |
<gh_stars>1-10
export interface FeatureToggleRules {
features: Feature[];
}
interface Feature {
name: string;
treatments: Treatment[];
}
interface Treatment {
name: string;
includedDifferentiators: string[];
}
|
// NewOptions creates server options.
func (c Configuration) NewOptions(iOpts instrument.Options) Options {
opts := NewOptions().
SetRetryOptions(c.Retry.NewOptions(iOpts.MetricsScope())).
SetInstrumentOptions(iOpts)
if c.KeepAliveEnabled != nil {
opts = opts.SetTCPConnectionKeepAlive(*c.KeepAliveEnabled)
}
i... |
// user returns the user object from the session.
func (a *Auth) user(r *http.Request) *gogithub.User {
s, err := a.sessionStore.Get(r, sessionName)
if err != nil {
logrus.Errorf("Failed getting user: %s", err)
return nil
}
jsonData, ok := s.Values[sessionUserKey].(string)
if !ok {
logrus.Errorf("Failed conv... |
/* SPROP -- Format the value of a parameter into the output string.
*/
void
sprop (register char *outstr, register struct operand *op)
{
register int type;
char *index();
if (opundef (op))
cl_error (E_IERR, "can not print an undefined operand");
if (opindef (op)) {
strcpy (outstr, indefstr);
return... |
#!/usr/bin/python3
sep = ", "
for x in range(0, 100):
if x == 99:
sep = ""
print("{:02d}{}".format(x, sep), end='')
print('')
|
#include <iostream>
using lint = long long;
void solve() {
lint x;
std::cin >> x;
lint ans = x / 500 * 1000;
x %= 500;
ans += x / 5 * 5;
std::cout << ans << std::endl;
}
int main() {
std::cin.tie(nullptr);
std::cout.tie(nullptr);
std::ios::sync_with_stdio(false);
solve();
... |
// CreateTrieFromProto creates a Sparse Merkle Trie from its corresponding merkle trie.
func CreateTrieFromProto(trieObj *protodb.SparseMerkleTrie) *SparseMerkleTrie {
trie := &SparseMerkleTrie{
depth: uint(trieObj.Depth),
originalItems: trieObj.OriginalItems,
}
branches := make([][][]byte, len(trieObj.L... |
<gh_stars>1-10
/*
* Software Name : ATK
*
* Copyright (C) 2007 - 2012 France Télécom
*
* 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... |
def find_team(name):
global session, teams
try:
team = teams.get(name, None)
if team is None:
team = session.find('teams', name)
if team is None:
print("WARNING: team not found: "+name)
teams[name] = False
else:
... |
def verify_and_renew_license(driver, license_num, valid_from_date, valid_to_date):
verify_driver_from_license_number(driver, license_num)
renew_drivers_license(driver, valid_from_date, valid_to_date, license_num) |
/// Constructs a new, empty `BinaryHeap<T>`, with a custom comparator function,
/// this can be used to create a priority queue or other bespoke sorting logic
///
/// # Examples
/// ```rust
/// use data_structures::binary_heap::{BinaryHeap, BinaryHeapType};
///
/// let cmp = |a: &i32, b: &i32| a.cmp(b);
/// let mut hea... |
//
// Created by conor on 31/03/18.
//
#include "Train.h"
|
//! Automatically delete a file when dropped
use std::path::{Path, PathBuf};
use std::fs::remove_file;
/// Removes a path when dropped
pub struct RemoveOnDrop(PathBuf);
impl RemoveOnDrop {
pub fn new<P: AsRef<Path>>(path: P) -> RemoveOnDrop {
RemoveOnDrop(path.as_ref().to_path_buf())
}
}
impl Drop f... |
<gh_stars>1000+
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2019 Intel Corporation. All Rights Reserved.
#include "fw-logs-xml-helper.h"
#include <string.h>
#include <fstream>
#include <iostream>
#include <memory>
using namespace std;
namespace fw_logger
{
fw_logs_xml_helper::fw_lo... |
// Validate that if a message that creates an FT is received the behavior is correct
class TestStateMachine_NullFT
{
public:
template<MessageType::Enum T>
void TestHelperForFMMessage(
wstring const & ftShortName,
wstring const & message,
wstring const & ftExpected)
{
TestHelp... |
Dietary fish-oil supplementation in experimental gram-negative infection and in cerebral malaria in mice.
Dietary fish-oil supplementation interferes with eicosanoid production and appears to decrease production of interleukin-1 (IL-1) and tumor necrosis factor (TNF). The effect of fish oil was investigated in an intr... |
/**
* @author Ryan Heaton
* @author Dave Syer
*/
public class BaseOAuth2ProtectedResourceDetails implements OAuth2ProtectedResourceDetails {
private String id;
private String grantType = "unsupported";
private String clientId;
private String accessTokenUri;
private List<String> scope;
private String clie... |
package ca.mcgill.ecse211.lab3;
import static ca.mcgill.ecse211.lab3.Resources.*;
import static java.lang.Math.*;
public class Navigation extends Thread {
/**
* Navigation class for EV3
* Allows robot to navigate from waypoint to waypoint
*/
/*
* Maps for navigation
*/ ... |
/*
Create multiple threads that compile and execute a query
*/
bool
multithread_example_2(Zorba* aZorba)
{
unsigned int i;
pthread_t* pthreads;
data_2* pdata;
try {
pthreads=(pthread_t *)malloc(NR_THREADS*sizeof(*pthreads));
pdata=(data_2 *)malloc(NR_THREADS*sizeof(data_2));
for(i=0;... |
def zdumps(value):
return zlib.compress(pickle.dumps(value,-1),9) |
Never Give Up: Lesson learned from a severe COVID-19 patient
This is a PDF file of an article that has undergone enhancements after acceptance, such as the addition of a cover page and metadata, and formatting for readability, but it is not yet the definitive version of record. This version will undergo additional cop... |
package de.ifa.arznei.mobil.entities;
import java.util.List;
import javax.persistence.EntityManager;
import org.junit.Ignore;
import org.junit.Test;
public class ArtikelTest extends AbstractDatabaseTest {
@Test
@Ignore
public void testGetId() {
EntityManager em = getEntityManager();
List<Artikel> artikelLis... |
Highly Conductive Nitrogen-Doped Graphene Grown on Glass toward Electrochromic Applications.
The direct synthesis of low sheet resistance graphene on glass can promote the applications of such intriguing hybrid materials in transparent electronics and energy-related fields. Chemical doping is efficient for tailoring t... |
<gh_stars>1-10
{-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving,
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds #-}
module Godot.Core.Material
(Godot.Core.Material._RENDER_PRIORITY_MAX,
Godot.Core.Material._RENDER_PRIORITY_MIN,
Godot.Core.Material.get_next_pass,
God... |
/**
* Author: Kartik Sharma
* Email Id: cr42yh17m4n@gmail.com
* Created: 1/23/2017 5:33 PM
* Description: Unavailable
*/
public class MediaPagerAdapter extends PagerAdapter {
private List<Media> mMedia;
private OnImageClickListener mOnImageClickListener;
public MediaPagerAdapter(List<Medi... |
/* Copyright (C) 1992-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program 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; either version 2, ... |
/*
* Copyright (c) 2017-2018 Globo.com
* All rights reserved.
*
* This source is subject to the Apache License, Version 2.0.
* Please see the LICENSE file for more information.
*
* Authors: See AUTHORS file
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License... |
pub mod app;
pub mod framework;
|
David Shaw has a 54-14 record as Stanford's head coach. (Photo11: Kirby Lee, USA TODAY Sports)
Until 2012, Stanford University never had to disclose the compensation of an athletic coach. As a private school, it isn’t required to reveal its employment contracts — and it hadn’t paid a coach enough money to require that... |
/**
* An expression which stands for a NULL in SQL.
*/
public class DDlogENull extends DDlogExpression {
public DDlogENull(@Nullable Node node) {
super(node, DDlogTUnknown.instance);
}
@Override
public boolean compare(DDlogExpression val, IComparePolicy policy) {
if (!super.compare(va... |
<gh_stars>0
package com.example.command;
import static com.example.service.UserService.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.example.business.Inventory;
import com.example.business.InventoryManager;
import com... |
A bill to deal with legal cannabis will be tabled next spring, said PEI Lieutenant Governor Antoinette Perry on Thursday in her first speech from the throne. The throne speech opened the fall session of the PEI legislature.
While no specific details were offered, Perry said the province will be guided by the principle... |
"""Module for creating ids"""
import hashlib
import time
import uuid
def create_id(
prefix: str,
salt: str = None,
) -> str:
"""
Create an id string.
:param prefix:
The prefix with which to prefix the generated id. This should be used
to identify what the id is being appli... |
import subprocess
import time
import os
import os.path as osp
from rlpyt.utils.launching.affinity import get_n_run_slots, prepend_run_slot, affinity_from_code
from rlpyt.utils.logging.context import get_log_dir
from rlpyt.utils.launching.variant import save_variant
def log_exps_tree(exp_dir, log_dirs, runs_per_sett... |
//! Structures and traits related to pagination.
#![allow(clippy::expect_used)]
#[cfg(not(feature = "std"))]
use alloc::{
collections::btree_map,
string::{String, ToString as _},
vec,
vec::Vec,
};
use core::fmt;
#[cfg(feature = "std")]
use std::collections::btree_map;
use iroha_schema::IntoSchema;
use... |
On This Day
Thursday 16th October 1947
71 years ago
The name "Landrover" was officially approved by Rovers Board of Directors. The first Land Rover made its debut in 1948. It was designed with brilliant simplicity for extraordinary ability and unrivalled strength and durability. In fact, six decades on it is estimat... |
<gh_stars>0
from eventbrite import Eventbrite
def eb_fetch(latitude, longitude, radius):
eventbrite = Eventbrite('LMYQEYROBA7SA3GQA2DR')
user = eventbrite.get_user()
my_id = eventbrite.get_user()['id']
events = eventbrite.event_search(**{'location.latitude': str(latitude), 'location.longitude': str(lon... |
Local remodeling of synthetic extracellular matrix microenvironments by co-cultured endometrial epithelial and stromal cells enables long-term dynamic physiological function.
Mucosal barrier tissues, comprising a layer of tightly-bonded epithelial cells in intimate molecular communication with an underlying matrix-ric... |
#include "rpc_controller.hpp"
#include "rpc_channel.hpp"
#include "rpc_server.hpp"
#include "rpc_client.hpp"
namespace NanoRpc {
void RpcController::Send(const RpcMessage &message) { channel_->Send(message); }
void RpcController::Receive(const RpcMessage &message) {
// TODO: Implement client handling
if (messag... |
/**
* @author Xuewei Huang
* @created 2022-05-03
*/
class BinarySearchLowerTest {
private final int[] nums = new int[]{1, 1, 3, 3, 5, 5};
@Test
void lower() {
assertEquals(-1, BinarySearchLower.lower(nums, 0));
assertEquals(-1, BinarySearchLower.lower(nums, 1));
assertEquals(1, ... |
/**
* The {@link AbstractIndividualFactory} creates {@link Individual}s using a
* given {@link Provider} and sets the registered
* {@link IndividualStateListener}s. The {@link Creator} is used to create the
* problem specific {@link Genotype} with which the created {@link Individual}
* is initialized.
*
... |
mod doc;
mod error;
mod find;
mod kmp;
use std::fs;
use std::string::ToString;
fn main(){
//Parsing json files with kmp
let pattern = "full_name";
let kmp = kmp::KMP::new(pattern);
kmp.request_list("../../get_json/get_json/json.txt");
// introduces a list of Repository
let list... |
package hxw.security.core.security;
import java.io.IOException;
import java.io.Serializable;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.AuthenticationException;
import org.springframework.s... |
import cn from 'classnames'
import Link from 'next/link'
type Props = {
title: string
src: string
slug?: string
}
const CoverImage = ({ title, src, slug }: Props) => {
const image = (
<img
src={src}
alt={`Cover Image for ${title}`}
className={cn('shadow-sm', {
'hover:shadow-lg tr... |
def parse_split_logs(filename, num_days=2):
with tempfile.NamedTemporaryFile(mode='r+') as _temp:
subprocess.call(['appcfg.py',
'-n', str(num_days),
'--include_all',
'--severity=0',
'request_logs',
... |
<reponame>dyle71/death-of-krydort
# ------------------------------------------------------------
# krydort/character.py
#
# This is a Witcher 3 TRPG character.
#
# This file is part of krydort.
#
# (C) Copyright 2020
# <NAME>, <EMAIL>
# headcode.space e.U., https://www.headcode.space
# ---------------------------------... |
// AO&IW() updates the offset and/or index width of a window after addition/removal of elements of memory in that window's variable.
// The offset is affected if the new/deleted memory is below the current window; the index width if affected if it is in the window.
void adjustOffsetAndIW(ccBool sameWindow, ccInt *offse... |
#include "Engine/Actor/Actor.hpp"
#include "Engine/Scene/Scene.hpp"
namespace creamyLib::engine
{
Actor::Actor(const ActorConfiguration& config) : EngineObject(config), transform_(TransformComponent(math::Vector3(0, 0, 0), { {this}, false}))
{
getOwner()->addActor(this);
}
Actor::~Actor()
... |
package asatsuki256.germplasm.core.gene;
import static asatsuki256.germplasm.core.GermplasmCore.NBT_PREFIX;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import asatsuki256.germplasm.api.gene.TraitType;
import asatsuki256.germplasm.api.gene.unit.IChromosome;
imp... |
/**
* Adjust options for retrieval from parent. I.e. consider minVersion or creationTime as
* appropriate. Note that there is some looseness to the semantics for versioning
* that relies on clock synchronization.
* @param options
* @return
*/
private InternalRetrievalOptions makeOptionsFor... |
Talking to yourself is often thought of as something only children or crazy people do, but research shows that engaging in a little self-conversation as an adult isn’t only completely normal — it’s good for you.
Talking to yourself, both in your head and out loud, is quite common, with many people reporting they talk ... |
import {
from,
amount,
fee,
firstRound,
lastRound,
note,
genesisID,
genesisHash,
group,
type,
to,
closeRemainderTo
} from '../src/transactionFieldValidators';
import {
VALID_ALGORAND_ADDRESS,
MAINNET_GENESIS_ID,
TESTNET_GENESIS_ID,
BETANET_GENESIS_ID,
MAINNET_GENESIS_HASH,
TESTNET_GE... |
// Helper class that calls cplus_demangle when needed and takes care of freeing
// the result.
class Lazy_demangler
{
public:
Lazy_demangler(const char* symbol, int options)
: symbol_(symbol), options_(options), demangled_(NULL), did_demangle_(false)
{ }
~Lazy_demangler()
{ free(this->demangled_); }
inli... |
<filename>app/src/main/java/com/medetzhakupov/githublisting/ui/Navigator.java
package com.medetzhakupov.githublisting.ui;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import com.medetzhakupov.githublisting.ui.detail.DetailActivity;
import javax.inject.Inject;
/**
* Created ... |
Click to email this to a friend (Opens in new window)
Click to share on Twitter (Opens in new window)
Click to share on Facebook (Opens in new window)
Concerned fans took to the internet when Howard Stern unexpectedly canceled his radio show to take a “personal day” Wednesday.
The SiriusXM host, who fans claim has ... |
Synthesis of small molecules with high scaffold diversity: exploitation of metathesis cascades in combination with inter- and intramolecular Diels-Alder reactions.
Our knowledge of the biological relevance of regions of chemical space is shaped, in large part, by the synthetic accessibility of small molecules. Histori... |
class rotor_set(object):
# Holds rotors and deals with how they rotate
def __init__(self, rotors, reflector):
from rotor import rotor
# Save arguments
self.rotors = rotors
self.rotors_reversed = self.rotors[::-1]
self.reflector = reflector
def encode_char(self, char... |
<gh_stars>0
export function keyBy<T extends { [key: string]: any }>(
objects: T[],
field: keyof T
): { [key: string]: T } {
return objects.reduce((keyedObjects, object) => {
if (object[field]) keyedObjects[object[field]] = object;
return keyedObjects;
}, {} as { [key: string]: T });
}
|
/* HSV to RGB conversion function with only integer
* math */
void hsvtorgb(unsigned char *r, unsigned char *g, unsigned char *b, unsigned char h, unsigned char s, unsigned char v)
{
unsigned char region, fpart, p, q, t;
if(s == 0) {
*r = *g = *b = v;
return;
}
region = h / 43;
fpar... |
// NewGitDiffer returns a Differ that determines differences using git.
func NewGitDiffer(opts ...GitDifferOption) Differ {
g := &git{
useMergeCommit: false,
baseBranch: "origin/master",
}
for _, opt := range opts {
opt(g)
}
return &differ{
diff: g.diff,
}
} |
/**
* @author Shogo Akiyama
* Solved on 05/24/2020
*
* 48. Rotate Image
* https://leetcode.com/problems/rotate-image/
* Difficulty: Medium
*
* Approach: Two Reverses
* Runtime: 0 ms, faster than 100.00% of Java online submissions for Rotate Image.
* Memory Usage: 39.4 MB, less than 5.77% of Java online sub... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.