content stringlengths 10 4.9M |
|---|
package com.bastiaanjansen.otp;
import com.bastiaanjansen.otp.helpers.URIHelper;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
imp... |
<reponame>elcoloo/plugins-geoladris
package org.geoladris.auth;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;... |
<reponame>pwightman/BBGroover
//
// BBViewController.h
// BeatBuilder
//
// Created by <NAME> on 7/21/12.
// Copyright (c) 2012 <NAME>. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BBGroover.h"
#import "BBGridView.h"
#import "BBTickView.h"
@interface BBViewController : UIViewController <BBGrooverDeleg... |
A Texas preschool teacher is out of a job after an anti-Semitism watchdog group uncovered a tweet she wrote encouraging her friend to “Kill some Jews.”
On February 19, Canary Mission posted a number of tweets that Nancy Salem and her friends wrote between 2012 and 2016 when she was part of the University of Texas, Arl... |
<reponame>jaroslaw-weber/imgui_calculator
extern crate glium;
#[macro_use]
extern crate imgui;
extern crate imgui_glium_renderer;
extern crate meval;
use imgui::*;
mod support;
const CLEAR_COLOR: [f32; 4] = [114.0 / 255.0, 144.0 / 255.0, 154.0 / 255.0, 1.0];
fn main() {
let mut state = CalculatorState::default();... |
<gh_stars>10-100
package vultr
// The Vultr VMI is deprecated.
// Please use the Cloug provider for Vultr instead.
import "github.com/LunaNode/lobster"
import "github.com/LunaNode/lobster/utils"
import vultr "github.com/LunaNode/vultr/lib"
import "errors"
import "fmt"
import "strconv"
import "strings"
type Vultr st... |
“As it is, today’s protesters often act like they are starting from square one. This disconnect cannot be dismissed as the hubris of youth; it is a symptom of our failure to teach this generation about black history and the way our economic and social systems actually function.” (Ilyasah Shabazz, 2015)
Not much longer... |
Becoming a Single Teenage Mother: A Vicious Cycle
Abstract The aim of the study was to investigate the psycho-social impact of single parenthood on teenage mothers. A phenomenological study was conducted. Nine participants were purposefully selected for the study. Semi-structured interviews were conducted to collect d... |
def ranges_to_singletons(
ranges: List[range],
) -> List[range]:
assert all(
r.step == 1 and r.start >= 0 and r.stop >= 0 for r in ranges
), "Ranges should be consecutive and contain non-negative indices."
return [range(i, i + 1) for r in ranges for i in r] |
Today is a good day for T-Mobile customers because they’re getting free T-Mobile Tuesdays gifts. For T-Mobile itself, though, this Tuesday isn’t quite as nice.
T-Mobile has been hit with a complaint from Huawei. The company alleges that T-Mobile has been using patents related to 4G wireless networking while refusing H... |
package types
import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
)
func TestParams_Equal(t *testing.T) {
p1 := DefaultParams()
p2 := DefaultParams()
p3 := DefaultParams()
p3.SessionNodeCount = 1
assert.True(t, p1.Equal(p2))
assert.False(t, p2.Equal(p3))
}
func TestParams_Validate(t *testing.T) {
... |
package com.gakshintala.parkmycar.usecases.lotqueries;
import com.gakshintala.parkmycar.domain.Car;
import com.gakshintala.parkmycar.ports.persistence.QueryLotStatus;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
class... |
Radiation-induced chromosomal instability in human fibroblasts: temporal effects and the influence of radiation quality.
PURPOSE
To determine whether chromosomal instability is induced in human diploid fibroblasts by ionizing radiation and to investigate the effects of radiation quality by comparing X-rays, neutrons a... |
// New returns the docker default configuration for libcontainer
func New() *libcontainer.Container {
container := &libcontainer.Container{
CapabilitiesMask: map[string]bool{
"SETPCAP": false,
"SYS_MODULE": false,
"SYS_RAWIO": false,
"SYS_PACCT": false,
"SYS_ADMIN": false,
... |
<reponame>AndreyZlobin/testForBro
import { AppStoreService } from './neosound/shared/app.store';
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { APP_INITIALIZER, NgModule } from "@angular/core";
import { HttpClientModule... |
<reponame>shiyuan2he/code-generator
package me.hsy.mybatis.generator.enhance.task;
import me.hsy.mybatis.generator.enhance.common.Constants;
import me.hsy.mybatis.generator.enhance.config.Configuration;
import me.hsy.mybatis.generator.enhance.framework.AbstractApplicationTask;
import me.hsy.mybatis.generator.enhance.f... |
def eh_tabuleiro(tab):
if not type(tab) == tuple:
return False
if len(tab) != 3:
return False
for linha in tab:
if not isinstance(linha, tuple):
return False
if len(linha) != 3:
return False
for i in (linha):
if not type(i) == int:
... |
<reponame>lilo2s/Typescriptpractice<filename>object_example.ts<gh_stars>0
class Animal {
// Fields
breed: string;
weight: number;
has_fur: boolean;
speed: number;
companion: Animal;
// Special method *NEW*
constructor(breed: string, weight: number, has_fur: boolean, speed: number){
... |
def load_model(directory,is_csv=False):
start_dir = os.getcwd()
os.chdir(directory)
config_file = keys._config_file
with open(config_file,'r') as f:
parameters = yaml.load(f)
weights_file = parameters[keys._weights_file]
weights_dict = None
if is_csv:
pass
else:
... |
<reponame>python-feladatok-tesztekkel/07-01-05-osszefoglalas<gh_stars>0
from unittest import TestCase
import os,sys,inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import feladatok
class TestLegnag... |
<reponame>CaelestisZ/IrisCore
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This... |
Potassium limitation promotes the Sweetgum-Clitopilus symbiosis
Several species of soil free-living saprotrophs can sometimes establish
biotrophic symbiosis with plants, but the basic biology of this
association remains largely unknown. Here, we investigate the symbiotic
interaction between a common soil saprotroph, C... |
/**
* This method gives the guess of given input values
*
* @param input_array double array
* @return output guess values
*/
public double[] feedforward(double[] input_array) {
Matrix input = Matrix.ArrayToMatrix(input_array);
Matrix[] hidden_vals = new Matrix[this.hidden_l... |
#!/usr/bin/env python
# Copyright Jim Bosch & Ankit Daftery 2010-2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import dtype_mod
import unittest
import numpy
class DtypeTestCase(unittest.TestCa... |
<gh_stars>1-10
#include "ws.h"
websocket::connection_sptr ws_conn;
void on_receive(websocket::connection_ptr conn,
const block_t *b,
int32_t size,
bool msg_end) {
std::string data(b, size);
std::string gbk = pump::utf8_to_gbk(data);
printf("received: %s\n", ... |
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main {
private static final double FLOATING_POINT_EPSILON = 1E-10;
static class FlowEdge {
final int v;
final int w;
final double capacity;
double flow;
FlowEdge(int v, int w, ... |
<filename>adventofcode/2021/21.py
# Python Standard Library Imports
from dataclasses import dataclass
from functools import cache
from utils import (
BaseSolution,
InputConfig,
)
PROBLEM_NUM = '21'
TEST_MODE = False
TEST_MODE = True
EXPECTED_ANSWERS = (1006866, 273042027784929, )
TEST_EXPECTED_ANSWERS = (7... |
import java.util.List;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.HashMap;
public final class ProblemA
{
public static void main(String[] args) throws IOException
{
BufferedReader bi = new BufferedRea... |
The Redskins during training camp. (Steve Helber/Associated Press)
There has been plenty of talk this month about media blind spots and coastal elitism, about Twitter echo chambers and what happens when America pulls a big ol’ surprise on its pundit class. I know, I know, stick to sports. But after years of immersing ... |
Fantastic Mr. Fox may have been a work of fiction, but as you can see from these pictures, this man from County Kilkenny, Ireland is most definitely the real thing.
The man is Patsy Gibbons and his two adorable sidekicks are Grainne and Minnie. Gibbons nursed the foxes back to health after they were found abandoned as... |
//<NAME> AM:141291
#include <iostream>
#include <string>
using namespace std;
int calculation (int a, int b);
void change_variables(int &a,int &b);
int main (int argc, char **argv)
{
int a = 5;
int b = 8;
//<NAME>
int *grades = new int[3];
//Allagh timhs const metablhths
volatile cons... |
/**
* Updates the specified metadata for a version. Note that this method will fail with
* `FAILED_PRECONDITION` in the event of an invalid state transition. The only valid transition for
* a version is currently from a `CREATED` status to a `FINALIZED` status. Use
* [`DeleteVersion`](../sit... |
/**
* @author Frank Shaka
* @deprecated Use {@link IEntryStreamNormalizer}
*/
public class Crypto {
private static ISecurityProvider provider = null;
public static void setProvider(ISecurityProvider provider) {
if (Crypto.provider != null)
return;
Crypto.provider = pro... |
// Copyright (c) 2002 Utrecht University (The Netherlands).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// 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 3 of the License, or (at y... |
***
Jordan has a reputation for being the Middle East’s island of peace. Geopolitically, it is—amid ISIS’s spread across Iraq, Syria’s devastation, and the escalating Israeli-Palestinian conflict, the Hashemite Kingdom feels quiet. Crises don’t happen in Jordan, the narrative goes—that’s why it’s home to more than a m... |
def assoc_rgx_with_types(self, index=None):
if index is not None:
index = int(index)
regex = sorted(self.game_state['regexes'], key=hash)[index]
else:
regex = self.game_state['current_rgx']
self.categories()
types = raw_input('Type numbers of categorie... |
The restored sign of the Toll House Inn, with a commemorative plaque underneath
The Toll House Inn of Whitman, Massachusetts was established in 1930 by Kenneth and Ruth Graves Wakefield. Toll House chocolate chip cookies are named after the inn.
History [ edit ]
Contrary to its name and the sign, which still stands ... |
// This API only works for non-Open-Drain pin
void gpio_direct_write(gpio_t *obj, BOOL value)
{
uint8_t port_num;
uint8_t pin_num;
uint32_t reg_value;
port_num = obj->hal_port_num;
pin_num = obj->hal_pin_num;
reg_value = HAL_READ32(GPIO_REG_BASE, GPIO_SWPORT_DR_TBL[port_num]);
reg_value &=... |
// BeforeRefreshDoc method is interceptor.
func (c *DocController) BeforeRefreshDoc() {
if !aah.App().IsEnvProfile("prod") {
return
}
githubEvent := strings.TrimSpace(c.Req.Header.Get("X-Github-Event"))
githubDeliveryID := strings.TrimSpace(c.Req.Header.Get("X-Github-Delivery"))
if githubEvent != "push" || ess.I... |
package com.example.tefservices;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle... |
<gh_stars>1-10
#pragma once
#include "../node/GraphicsNode.h"
#include <vector>
#include <glm/glm.hpp>
#include "iostream"
namespace Graphics3D {
class QuadTree {
public:
virtual void drawNodes(glm::vec2 pCloseLeft, glm::vec2 pCloseRight,
glm::vec2 pFarLeft, glm::vec2 pFarRight, uint... |
<filename>src/utils/isJSON.ts
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default function isJSON(json: any) {
try {
const jsonStr = JSON.stringify(json);
JSON.parse(jsonStr);
return true;
} catch (error) {
return false;
}
}
|
Capturing the passenger leukocyte
T ransfusion-associated leukocyte microchimerism (TA-MC) refers to the long-term persistence of allogeneic (i.e., donor derived) leukocytes following transfusion. In this issue of TRANSFUSION, Jackman and colleagues provide compelling evidence suggesting that TA-MC, one of the most fa... |
def filter_outliers(self, n):
reanal = self._run.reanalysis_product
if (reanal, self._run.loss_threshold) in self.outlier_filtering:
valid_data = self.outlier_filtering[(reanal, self._run.loss_threshold)]
return valid_data
df = self._aggregate.df
df_sub = df.loc[
... |
// [comment]
// Implementation of the Whitted-syle light transport algorithm (E [S*] (D|G) L)
//
// This function is the function that compute the color at the intersection point
// of a ray defined by a position and a direction. Note that thus function is recursive (it calls itself).
//
// If the material of the inter... |
<reponame>kaola526/lotus
package actors
import (
"context"
"strings"
"sync"
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/lotus/chain/actors/adt"
)
var manifestCids map[Version]cid.Cid =... |
import {isProduction} from "../env";
import {$log} from "@tsed/common";
import "@tsed/logger-logentries";
$log.name = process.env.LOG_NAME || "API";
export const loggerConfig = {
level: (process.env.LOG_LEVEL || "info") as any,
disableRoutesSummary: isProduction
};
if (isProduction) {
$log.appenders.set("stdou... |
<gh_stars>0
import createMuiTheme from '@material-ui/core/styles/createMuiTheme';
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider'
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
import './index.css';
import registerServiceWorker from './registerS... |
<reponame>lqf96/mltk<filename>mltk/types/gym.py
from typing import TYPE_CHECKING, Protocol, Tuple, TypeVar
import numpy as np
from .core import StrDict, T
__all__ = [
"O",
"A",
"R",
"Space",
"Box",
"StepResult",
"MAReward",
"Env",
"MAEnv"
]
# Observation type
O = TypeVar("O")
# A... |
def delete(self, root_path, username=''):
owner = auth.username()
if not self._is_shared(root_path, owner):
abort(HTTP_NOT_FOUND)
if username == '':
users = userdata[owner]['shared_with_others'][root_path]
for user in users:
self._remove_share_... |
/*
* Created on 08.05.2008
*
*/
package org.jdesktop.swingx.binding;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JTable;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.TableModel;
import org.jd... |
World War II is having a moment, at least in the minds of people doing Google searches. Google Trends, a tool that measures the popularity of search terms over time, shows that there have been dramatic spikes in searches for topics related to the war, including: Reichstag fire, Pearl Harbor, fascism, Kristallnacht, and... |
<filename>regression-tests/horn-hcc-heap/free-2-nondet-unsafe.c<gh_stars>10-100
int nondet();
void main() {
int *a = malloc(sizeof(int));
if(nondet())
free(a);
*a = 42; // unsafe - possible use after free
}
|
Los Angeles Police Department SWAT officers walk toward their vehicles after one officer was wounded and a suspect killed in 2014. (Photo by Mark Boster/Los Angeles Times via Getty Images)
"Every second counts, and hesitation will kill you," Jamie McBride told the Los Angeles Police Commission last month.
McBride, a ... |
def backoff_time(self, response: requests.Response) -> Optional[float]:
if "Retry-After" in response.headers:
return int(response.headers["Retry-After"])
else:
self.logger.info("Retry-after header not found. Using default backoff value")
return 5 |
/*
Copyright 2019 Cisco Systems
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 law or agreed to in writing, software
d... |
<gh_stars>0
import { asText } from '@prismicio/helpers'
import type {
PrismicDocument,
RichTextField,
TitleField,
} from '@prismicio/types'
import type { PromisedType, Return } from 'tsdef'
import { client } from './client'
import { LANG, Lang } from './constants'
type Homepage = PrismicDocument<{
title: Title... |
<reponame>sirAgg/nebula
//------------------------------------------------------------------------------
// (C) 2019 Individual contributors, see AUTHORS file
//------------------------------------------------------------------------------
#include "stdneb.h"
#include "scenes.h"
namespace SponzaSceneData
{
// Global ... |
<reponame>illucIT/instatrie
package com.illucit.instatrie;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.TreeSet;
import org.junit.Assert;
import org.junit.Test;
import com.illucit.instatrie.trie.Trie;
import com.illucit.instatrie.trie.TrieNode;
/**
... |
/*
* This file is part of the source code of the software program
* Vampire. It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*/
/**
* @file TPTPPrinter.cpp
* Implements class... |
/** @file compiler.h
*
* @brief Define the interface to the compiler module.
*
* Only a single function here for now. Simply call `compile` to kick
* off the scanning and compiling stage.
*
* @author <NAME> (dlains)
* @bug No Known Bugs
*/
#ifndef COMPILER_H
#define COMPILER_H
#include "object.h"
#include "v... |
package util
import (
"errors"
"testing"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
)
func Test_MultiString_Set_and_Reset(t *testing.T) {
assert := require.New(t)
target := &MultiStringT{}
target.Set("A")
assert.Equal("A", target.Text)
assert.Equal(1, len(target.LowercasedValues))
assert.Tr... |
def mean_true(y_true, y_pred):
with K.name_scope(name='mean_true') as scope:
if len(K.int_shape(y_true)) == 2 and K.int_shape(y_true)[1] == 3:
y_true = K.cast(y_true[:, :1], 'float32')
return K.mean(y_true) |
/**
* Setup motion paths for the given data.
* \note Only used when explicitly calculating paths on bones which may/may not be consider already
*
* \param scene Current scene (for frame ranges, etc.)
* \param ob Object to add paths for (must be provided)
* \param pchan Posechannel to add paths for (optional; if n... |
/**
* The KeyPass2 class helps you to get to the next level once you collect all 3 objects from the Level2 class.
* @author (Chilka, Madalina, Nicolas, Jose)
* @version Gold Master(December 14, 2020)
*/
public class KeyPass2 extends Actor
{
/**
* Act - do whatever the KeyPass2 wants to do. This method is ... |
from django.shortcuts import render
import pandas as pd
import json
# Create your views here.
def Search(request):
d = {}
query = request.GET.get('search')
query1 = request.GET.get('searchbank')
query2 = request.GET.get('searchcity')
df = pd.read_csv('https://raw.githubusercontent.com/snarayanank2... |
<filename>packages/react-renderer/src/elements/Link.tsx<gh_stars>10-100
import React from 'react';
import escapeHtml from 'escape-html';
import { LinkElement, LinkRendererProps } from '@graphcms/rich-text-types';
export function Link({ children, ...rest }: LinkRendererProps) {
const { href, rel, id, title, openInNew... |
/// Send data back to subscribers.
/// If a send fails (likely a broken connection) the subscriber is removed from the sink.
/// O(n) in the number of subscribers.
pub fn send<T>(&mut self, result: &T) -> anyhow::Result<()>
where
T: Serialize,
{
let result = to_raw_value(result)?;
let mut errored = Vec::new();
... |
/**
* Creates a new extended item.
*
* @param name
* the optional extended item name. Can be <code>null</code>.
* @param extensionName
* the required extension name
* @return a handle to extended item, return <code>null</code> if the
* definition with the given extension n... |
import { FC, memo } from 'react';
import { SVG } from './SVG';
import { Box } from './Box';
import { SVGIcon } from './SVG.Icons';
import { Anchor } from './Link';
const _Logo: FC<{
variant?: 'on-white' | 'on-black' | 'on-blue';
className?: string;
preserveText?: boolean;
}> = ({ className, preserveText }): JSX... |
// ConnectDb connects the env to the sql database with the sqlOpt and the redis
// database with redisOpt
func (env *Env) ConnectDb(sqlOpt SQLOptions, redisOpt RedisOptions) {
loggerDb := log.New(os.Stdout, "db: ", log.Lshortfile)
lk := &sync.Mutex{}
ra := rand.New(rand.NewSource(time.Now().UnixNano()))
d, err := s... |
<reponame>eibens/surv_demo_preact
import { cli } from "https://deno.land/x/surv@v0.2.5/cli.ts";
const html = (options: {
module: string;
title: string;
}) => `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=... |
<gh_stars>0
import { NextSeo } from 'next-seo';
import Page from '@/components/page';
import Header from '@/components/header-empezar';
import Footer from '@/components/footer';
export default function Empezar() {
return (
<Page>
<NextSeo
title="GABO | Educando Offline "
description="Logíst... |
#!/usr/bin/env python3.6
import re, argparse, numpy as np, glob
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from extractTargetFilesNonDim import getAllData
from extractTargetFilesNonDim import epsNuFromRe
from computeMeanIntegralQuantitiesNonDim import findAllParams
from computeMeanIntegralQuan... |
def processPhrases(inFile):
global new_trie
global rulesSet
phrasesSet = set([])
print 'Processing phrases from file : %s' % inFile
with codecs.open(inFile, 'r', 'utf-8') as iF:
for line in iF:
line = line.strip()
wLst = line.split()
for i in range( len(wL... |
/**
* A superclass for System requests.
*/
public class SystemRequest extends SpeechletRequest {
protected SystemRequest(SpeechletRequestBuilder builder) {
super(builder);
}
protected SystemRequest(final String requestId, final Date timestamp, final Locale locale) {
super(requestId, times... |
<gh_stars>0
import { Component, Input } from '@angular/core';
@Component({
selector: 'linear-progress-bar',
template: `<div *ngIf="showLabel" class="d-flex justify-content-between mt-2">
<small>{{label}}</small>
<small>{{percent}}%</small>
</div>
<div class="progress progress-md mt-2">
<di... |
def find_character_with_name(self, name) -> Entity:
for char in self.problem.find_objects_with_type(shared_variables.supported_types['character']):
if char.name == name:
return char
return None |
/**
*
*/
package com.sqli.echallenge.formation.metier;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.sqli.echallenge.format... |
/**
* Created by koush on 5/22/13.
*/
public class ContentLoader extends SimpleLoader {
private static final class InputStreamDataEmitterFuture extends SimpleFuture<DataEmitter> {
}
@Override
public Future<DataEmitter> load(final Ion ion, final AsyncHttpRequest request, final FutureCallback<LoaderEmi... |
/**
* Classe d'utilitaires pour les fichiers de type ODT.
*
* @author pforhan
*/
final class ODTUtil {
/**
* Nom du fichier XML gérant les contenus.
*/
static final String CONTENT_XML = "content.xml";
/**
* Nom du fichier XML gérant les styles.
*/
static final String STYLES_XML = "styles.xml";
/** P... |
<reponame>MarkJenniskens/OTGW-firmware<filename>OTGW-Core.h
/*
***************************************************************************
** Program : Header file: OTGWStuff.h
** Version : v0.7.1
**
** Copyright (c) 2021 <NAME>
** Borrowed from OpenTherm library from:
** https://github.com/jpraus/arduin... |
/**
*
* Title 44 :
*
* Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).
Note:
... |
export default {
primary: "#ff3860",
secondary: "#209cee",
active: "white",
background: "black",
foreground: "white",
};
|
def request(self, request_type, api, params=None, data=None, files=None, is_binary=False):
url = '{}{}'.format(self.base_url, api)
s = requests.Session()
s.mount('https://', SSLAdapter(ssl_version=ssl.PROTOCOL_TLSv1_2))
r = s.request(request_type, url, params=params, data=data, files=fil... |
def voltage_plot(data, sfreq, toffset, log_scale, title):
print("voltage")
t_axis = np.arange(0, len(data)) / sfreq + toffset
fig = plt.figure()
ax0 = fig.add_subplot(2, 1, 1)
ax0.plot(t_axis, data.real)
ax0.grid(True)
maxr = np.nanmax(data.real)
minr = np.nanmin(data.real)
if minr =... |
A one-star Marine general might not be the only attorney for Guantanamo Bay detainees taken into custody for defending the principle of a fair military commissions trial.
Two Pentagon civilians who recently quit defending Guantanamo detainee and accused U.S.S. Cole bomber Abd al-Rahim al-Nashiri, have been ordered to ... |
<reponame>engimaxp/sketch_coding
import { SET, CLEAR } from './action_type';
import AccountData from '../../types/Account';
export type accountActions = Set | Clear;
interface Set {
type: SET;
account: AccountData;
}
export const set = (account: AccountData): Set => ({
type: SET,
account
});
interface Clear... |
<gh_stars>0
""" Calculate LCM """
class Solution_1:
"""Naive solution."""
def getLCM(self, a, b):
largest = max(a, b)
while True:
if largest % a == 0 and largest % b == 0:
break
largest += 1
return largest
class Solution_2:
""" Euclid solu... |
The potential for complete and durable response in nonglial primary brain tumors in children and young adults with enhanced chemotherapy delivery.
PURPOSE
Radiographic tumor response and survival were evaluated in the pediatric and young adult population with germ cell tumor, primary CNS lymphoma, or primitive neuroec... |
/**
* Prints in the returned string the elements contained in the given string
* array.
*
* @param arr
* The array.
* @return A string representing the supplied array contents.
*/
private static String listStrings(String[] arr) {
if (arr == null) {
return "null";
} else {
StringBuffe... |
/**
* prefilters a string to be formated for generics .*
* @param string
* @return
*/
public static String preFilterVariablesForGenerics(String string) {
if (string != null && !string.isEmpty()) {
int index = 0;
boolean done = false;
do {
i... |
<gh_stars>0
/* This is a mst-gql generated file, don't modify it manually */
/* eslint-disable */
/* tslint:disable */
import { types } from "mobx-state-tree"
import { QueryBuilder } from "mst-gql"
import { ModelBase } from "./ModelBase"
import { RootStoreType } from "./index"
/**
* GustoCompanyLocationBase
* auto ... |
#![allow(clippy::manual_strip)]
#[allow(unused_imports)]
use std::fs;
use std::{error::Error, fmt, path::Path, str::FromStr};
/// Translate shaders to different formats
#[derive(argh::FromArgs, Debug, Clone)]
struct Args {
/// bitmask of the ValidationFlags to be used, use 0 to disable validation
#[argh(option... |
// GenPodNameFromSts returns the name of a specific pod in a statefulset
func GenPodNameFromSts(vdb *vapi.VerticaDB, sts *appsv1.StatefulSet, podIndex int32) types.NamespacedName {
return types.NamespacedName{
Name: fmt.Sprintf("%s-%d", sts.GetObjectMeta().GetName(), podIndex),
Namespace: vdb.Namespace,
}
} |
// Copyright 2017 Xiaomi, 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 law or agreed to in... |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
#define SCRSIZE 7 // screen size factor
#define NUMP 20 // number of balls points
#define NUMS (NUMP+1) // number of springs
#define MASS 1.0f // default point mass
#define BALLRADIUS 0.516f ... |
package control
import (
"github.com/mandelsoft/spiff/dynaml"
"github.com/mandelsoft/spiff/yaml"
)
func init() {
dynaml.RegisterControl("if", flowIf, "then", "else")
}
func flowIf(ctx *dynaml.ControlContext) (yaml.Node, bool) {
if node, ok := dynaml.ControlReady(ctx, false); !ok {
return node, false
}
if ctx... |
<reponame>smacke/xterm.js
export enum MessageType {
REQUEST_ANIMATION_FRAME,
ANIMATION_SUCCESSFUL,
POPUP_OPENED
}
export interface ChromeMessage {
type: MessageType,
payload?: any
}
|
def read_single_image(self, path):
with Image.open(path) as i:
i.load()
return i |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.