content stringlengths 10 4.9M |
|---|
// Insert one send/recv event in two nodes
Status StreamAllocator::InsertOneEventInTwoNodes(const NodePtr &cur_node, const NodePtr &next_node) {
GE_CHECK_NOTNULL(cur_node->GetOpDesc());
GE_CHECK_NOTNULL(next_node->GetOpDesc());
int64_t cur_stream_id = cur_node->GetOpDesc()->GetStreamId();
if (cur_stream_id == k... |
def promote_chat_member(self, chat_id, user_id, can_change_info=None,
can_post_messages=None, can_edit_messages=None,
can_delete_messages=None, can_invite_users=None,
can_restrict_members=None, can_pin_messages=None,
... |
/**
* List a user's transactions (where he is a sender or recipient).
* <p>
* Sortable properties are:
* <ul>
* <li>- id</li>
* <li>- amount</li>
* </ul>
*
* @param userId ID of the user to returns transactions
* @param cursorRequest pagination parameters
* ... |
/**
* PostgreSQL data model option.
*
* @author yokochi
*/
public class PgSchemaOption implements Serializable {
/** The default version ID. */
private static final long serialVersionUID = 1L;
/** The root schema location. */
public String root_schema_location = "";
/** The relational model extension. */
p... |
import { CType } from '@kiltprotocol/sdk-js'
const cType = require('./data/ctype.json')
const CONFIG = Object.freeze({
CONNECT: {
BLOCKCHAIN_NODE: 'wss://full-nodes.kilt.io:9944',
MESSAGING_SERVICE_URL_FALLBACK: 'https://services.kilt.io:443/messaging',
CLAIMER_SERVICE_ADDRESS_DEFAULT: 'https://services... |
/*
* hid_create_pm_components:
* Create the pm components required for power management.
* For keyboard/mouse, the components is created only if the device
* supports a remote wakeup.
* For other hid devices they are created unconditionally.
*/
static void
hid_create_pm_components(dev_info_t *dip, hid_state_t *hi... |
/**
* Contains Unicode helpers for parsing StringValue types in the grammar
*/
@Internal
public class UnicodeUtil {
public static int MAX_UNICODE_CODE_POINT = 0x10FFFF;
public static int LEADING_SURROGATE_LOWER_BOUND = 0xD800;
public static int LEADING_SURROGATE_UPPER_BOUND = 0xDBFF;
public static int... |
//package div3;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class k_garlands {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReade... |
def _init_conn(self):
if self._codec.tag:
self._writer.write(self._codec.tag) |
<reponame>suomitek/suomitek-appboard<filename>dashboard/src/components/DeploymentFormBody/DifferentialSelector.test.tsx
import { shallow } from "enzyme";
import * as React from "react";
import Differential from "./Differential";
import DifferentialSelector from "./DifferentialSelector";
it("should use default values w... |
.
We present a case of a 44-year-old woman, with pseudoaneurysm formation at the middle of the prosthetic graft, 60 mm in diameter. She had been diagnosed with atypical coarctation due to aortitis 27 years before, and had undergone a bypass operation with 14 mm-diameter Cooley double velour graft from the ascending ao... |
Tonight, the new Virginia Tech uniforms for the Hokies’ “Battle at Bristol” game against Tennessee were revealed.
The new Virginia Tech uniforms are officially titled “Hokie Stone,” a tribute to the legendary on-campus stone structures. In addition to the heavy use of grays, the uniforms also contain a major black ele... |
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "licen... |
<reponame>WolleDoerr/enhavo<gh_stars>10-100
import AbstractLoader from "@enhavo/form/loader/AbstractLoader";
import WysiwygType from "@enhavo/form/type/WysiwygType";
import * as tinymce from "tinymce";
import FormRegistry from "@enhavo/app/form/FormRegistry";
export default class WysiwygLoader extends AbstractLoader
{... |
/**
* The iterator returned does not invoke the {@code batchValidationStep} for the first batch of calls as it is
* assumed to be prefetched from its caller and the {@code batchValidationStep} can run where this is called.
* <p>
* If a batch returned by the internal iterator is empty or has size sma... |
Third Shade of Simulation
Dear Sir, We would like to thank Jutric and colleagues for their work to our review article titled “Novel Simulation Device for Targeting Tumors in Laparoscopic Ablation: A Learning Curve Study.” There are several unmet training needs in surgery skills and the gaps that simulation training me... |
import { Service, default as ServiceLocator } from "../service_locator";
import { ServerService, Response } from "./server/server";
import { BackRequest, HTMLTemplate } from "./server/back/server_back";
import { createServer, ServerRequest, ServerResponse } from "http";
import { existsSync, statSync, createReadStream }... |
// SendImage Method to encapsulate the processing of the image captcha
// Given a base64 string from the image, it sends to the api and waits until
// the processing is complete to return the evaluated key
func (this *Client) SendImage(imgString string) (string, error) {
taskID, err := this.createTaskImage(imgString)
... |
/*
* Copyright 2021 MeshDynamics.
* 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 writ... |
def fixture_grid_result():
return xr.DataArray(
data=[
[-1800.0, -1800.0, -1800.0, -1800.0],
[-1800.0, -1800.0, -1800.0, -1800.0],
[-656.0, 40.0, -1800.0, -1800.0],
],
coords=dict(lon=[-2.5, -1.5, -0.5, 0.5], lat=[2.5, 3.5, 4.5]),
dims=["lat", "lon... |
<gh_stars>0
/****************************************************************************
*
* Copyright (c) 2012-2022 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
... |
/**
* Provides a default implementation of {@link SzBulkLoadResponse}.
*/
@JsonDeserialize
public class SzBulkLoadResponseImpl extends SzBasicResponseImpl
implements SzBulkLoadResponse
{
/**
* The {@link SzBulkLoadResult} describing the record.
*/
private SzBulkLoadResult bulkLoadResult;
/**
* Prote... |
package public
type AuthRequest struct {
User string `json:"user"`
Password string `json:"password"`
}
type Request struct {
User string `json:"user"`
Password string `json:"password"`
LocationID string `json:"locationId"`
ZID string `json:"zId"`
HistoryLimit int `json:"historyLim... |
/**
* INTERNAL:
* Object to hold onto cache index metadata.
*
* Key notes:
* - any metadata mapped from XML to this class must be compared in the
* equals method.
* - when loading from annotations, the constructor accepts the metadata
* accessor this metadata was loaded from. Used it to look up any... |
/**
* Find the selected material-parameter override in this view's copy of its
* C-G model.
*
* @return the pre-existing instance (not null)
*/
protected MatParamOverride findSelectedMpo() {
Spatial spatial = selectedSpatial();
String parameterName = cgm.getOverride().param... |
import os,io
import sys
input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
n=int(input())
a=list(map(int,input().split()))
b=[-1]*n
failflag=0
visited=set()
visited.add(a[0])
for i in range(1,n):
if a[i-1]!=a[i]:
b[i]=a[i-1]
if a[i]>i+1:
failflag=1
break
visited... |
On Friday, conservative radio host Rush Limbaugh responded to the Wall Street Journal which criticized House Speaker John Boehner (R-OH) for bowing to the GOP’s talk radio constituency when he abandoned a recent push for immigration reform. Limbaugh said that President Barack Obama cannot be trusted to enforce border c... |
package ru.babay.blockquotespan;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.Layout;
import android.text.TextPaint;
import android.text.style.LeadingMarginSpan;
import android.text.style.LineHeightSpan;
import android.text.style.MetricAf... |
/**
* Capitalizes the passed string and removes all '_' for properly printing the Title enum. Furthermore, the method
* can be used to also ensure that all names are actually capitalized when printing
* @param str The {@code String} to capitalize
* @return The {@code String} of the capitalized inp... |
// Wrap interaction with DB and Panopto SOAP services for a particular Blackboard course
public class PanoptoData {
private static final Logger mLog = LoggerFactory.getLogger(PanoptoData.class);
// Keys for Blackboard course registry settings
private static final String hostnameRegistryKey = "CourseCast_Ho... |
import numpy as np
import tensorflow as tf
import keras
from tensorflow.python.ops.parallel_for.gradients import batch_jacobian
from deep_boltzmann.networks import IndexLayer
def log_det_jacobian(outputs, inputs):
from tensorflow.python.ops.parallel_for.gradients import batch_jacobian
J = batch_jacobian(outpu... |
<reponame>obernardovieira/api
import { Sequelize, DataTypes, Model } from 'sequelize';
import {
UbiPromoterSocialMedia,
UbiPromoterSocialMediaCreation,
} from '../../../interfaces/ubi/ubiPromoterSocialMedia';
export class UbiPromoterSocialMediaModel extends Model<
UbiPromoterSocialMedia,
UbiPromoterSo... |
<reponame>fcakyon/insta-assist
import re
import time
import json
import os.path
from random import randint
from datetime import datetime
# from InstagramAPI import InstagramAPI
INSTAGRAM_DEFAULT_PROFIL_PIC_URL = "https://scontent-maa2-1.cdninstagram.com/v/t51.2885-19/44884218_345707102882519_2446069589734326272_n.jpg... |
def plot_pairwise_image_grid(
A: list, B: list, columns: int = 5, savepath: str = None, show: bool = False
) -> None:
num_pictures = len(A)
rows = 2 * int(np.ceil(num_pictures / columns))
fig, axes = plt.subplots(nrows=rows, ncols=columns, figsize=(columns, rows))
for idx in range(num_pictures):
... |
package br.com.satheler.bot.providers;
import java.util.List;
/**
* ICommand
*/
public abstract class CommandProvider {
protected String response;
private boolean isAsynchronous;
/**
* Construtor da classe
*/
public CommandProvider() {
this.isAsynchronous = false;
}
/**... |
import java.util.LinkedList;
import java.util.Scanner;
public class Main {
public static class Player {
int score;
String name;
boolean SamePlayer(String s) {
return name.equals(s);
}
}
public static void main(String[] args) { // New strat: Brute force!
Scanner sc = new Scanner(... |
The effect of Functional Electric Stimulation in stroke patients' motor control – a case report
Functional Electric Stimulation (FES) has been studied as a therapeutic resource to reduce spasticity in hemiplegic patients, however there are no studies about the effects of FES in motor control of these patients during f... |
<gh_stars>10-100
/* libs/pixelflinger/trap.cpp
**
** Copyright 2006, The Android Open Source Project
**
** 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/lic... |
// uses the go test runner "go test" to run a test with an identical name
// in the _supervised_in_test directory and takes expectations regarding output
func executeGoTestRunner(t *testing.T, expectedLogs []string, unexpectedLogs []string) {
out, _ := exec.Command(
path.Join(runtime.GOROOT(), "bin", "go"),
"test"... |
def leave(self, slot):
try:
position = 0
for car in self.occupancy:
if(int(slot) in car):
del self.occupancy[position]
del self.blocked[position]
break
position += 1
if('\n' in str(slo... |
def Alyona(start, end, arr, n):
temp = 0
for i in range(start-1, end):
temp+=arr[i]
return temp
n , s = list(map(int, input().split()))
arr = list(map(int, input().split()))
ans = 0
for i in range(s):
start, end = list(map(int, input().split()))
res = Alyona(st... |
import axios from 'axios';
import type { NextApiRequest, NextApiResponse } from 'next';
export default async (req: NextApiRequest, res: NextApiResponse) => {
try {
await axios.post(
'https://squire-25q7c.ondigitalocean.app/action',
req.body
);
} catch (e) {
console.error('Notification reque... |
def put(self, *args, **kwargs):
self.before_put(*args, **kwargs)
super(DatastoreModel, self).put(*args, **kwargs)
self.after_put(*args, **kwargs) |
package com.github.lihongjie.hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
public class StoreData {
public static void main(String[] args) {
//creating configuration object
Configuration cfg=new Configuration... |
import java.util.*;
/**
* Created by IntelliJ IDEA.
* User: LAPD
* Date: 24.5.2018 г.
* Time: 18:46 ч.
*/
public class _04CountSymbols {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
char[] input = console.nextLine().toCharArray();
Map<Character, ... |
/**
* A test object for jasmine.
*
* @author Roozbeh Farahbod
* @version $Revision: 9 $, Last modified: $Date: 2009-01-28 10:03:22 +0100 (Mi, 28 Jan 2009) $
*/
public class TestObject {
public Date date;
public String str;
public Double dbl;
public List<? extends Object> list;
public TestObject() {
date =... |
std::string kernel_str = R"END(
//
)END";
template <typename T>
NonLinearConvolution<T>::NonLinearConvolution( T& convolution_kernel ) {
static_assert( is_stdlib_container< T >::value, "NonLinearConvolution can only accept pointers or container-like objects." );
static_assert( std::is_arithmetic<typen... |
/**
* Utility to query the database and taking care of exceptions and transactions.
* <p>
* <strong>Requires hibernate, please add it to your project, otherwise using this class will fail
* </strong>
* @author hypfvieh
* @since v11.0.0 - 2020-09-11
*/
public class QueryUtil implements Closeable {
private fin... |
/**
* DataLoadWorker class is used to load data from all kinds of source.
* Its input is data scanner. The output are usually List.
*/
public class DataLoadWorker extends AbstractWorkerActor {
private static Logger log = LoggerFactory.getLogger(DataLoadWorker.class);
/**
* Default splitter used to spl... |
def rank_stations_by_nta(
self,
df_rides: pd.DataFrame,
df_station_geo: pd.DataFrame,
df_stations_per_nta: pd.DataFrame,
) -> pd.DataFrame:
df_rides = df_rides.astype({"start_station_id": str})
df_joined = df_rides.merge(
df_station_geo,
how="l... |
// Geometric Tools, Inc.
// http://www.geometrictools.com
// Copyright (c) 1998-2006. All Rights Reserved
//
// The Wild Magic Version 4 Restricted Libraries source code is supplied
// under the terms of the license agreement
// http://www.geometrictools.com/License/Wm4RestrictedLicense.pdf
// and may not be copie... |
// Remove a NumBox n from an array of NumBox ns of size len
// It removes ALL NumBox that are equal to n, not just one
void remove_numbox(NumBox *ns, int *len, NumBox n)
{
int i;
for (i = 0; i != *len; i++)
{
if (eql(ns[i], n))
{
ns[i--] = ns[--(*len)];
}
}
} |
#games
teams = int(input())
g = 0
t_colors = []
for i in range(teams):
t_colors.append([int(x) for x in input().split()])
for i in t_colors:
g += [x[1] for x in t_colors].count(i[0])
print(g) |
<filename>src/constant/index.ts
export enum PorkerKind {
squade = 'squade',
heart = 'heart',
diamond = 'diamond',
club = 'club'
} |
The latest Associated Press-GfK poll holds bad news for President Barack Obama, but as the November elections draw closer, there are ominous signs for congressional Democrats as well.
A look at the key findings from the March poll on this year’s election and the burgeoning 2016 presidential field.
GOP GAINING GROUND
... |
How Does the Supplemental Nutrition Assistance Program Affect the U.S. Economy?
The impact of the Supplemental Nutrition Assistance Program (SNAP) on the national economy is examined using a general equilibrium model and comparing measures of the economy from 2010 to a simulation of that economy without SNAP. Without ... |
package usecase
import "github.com/lovung/GoCleanArchitecture/app/usecase/dto"
type SampleUseCase interface {
Create(candidate dto.CreateSampleRequest) (created dto.OneSampleResponse, err error)
GetByID(id interface{}) (exist dto.OneSampleResponse, err error)
}
|
// Copyright information can be found in the file named COPYING
// located in the root directory of this distribution.
#ifndef _SFXFMODPROJECT_H_
#define _SFXFMODPROJECT_H_
#ifndef _SIMDATABLOCK_H_
#include "console/simDatablock.h"
#endif
#ifndef _CONSOLETYPES_H_
#include "console/consoleTypes.h"
#endif
#ifndef... |
/**
* @author Tal Shani
*/
final class PromiseNative<T> extends JavaScriptObject implements Promise<T> {
protected PromiseNative() {
}
public final native Promise<T> nativeThen(PromiseHandler<? super T> onFulfilled, PromiseHandler<Throwable> onRejected) /*-{
var onFulfilledFn, onRejectedFn;
... |
Jury acquits Highline teacher accused of child rape Woman cleared after 1 day of jury deliberation
Darcy Smith, pictured in a Office of Superintendent of Public Instruction photo. Darcy Smith, pictured in a Office of Superintendent of Public Instruction photo. Image 1 of / 1 Caption Close Jury acquits Highline teacher... |
<gh_stars>10-100
from Crypto.Cipher import AES
from scapy.layers.bluetooth import *
from scapy.all import hexdump
class SM():
ia = None
ia_type = None
ra = None
ra_type = None
tk = None
prnd = None
rrnd = None
pcnf = None
preq = None
prsp = None
ltk = None
def __init__(... |
/**
* Show the differences between two tables.
*
* @param actualResult the actual result from an operation
* @param expectedResult the expected result from the operation
* @param maxDiffLines the maximum number of lines in the output
* @param itemsToSkip classes of changes to ignore
*... |
<reponame>darkjedi9922/graph-web
import { createStore } from 'redux'
import { AbstractCanvasObject, NodeMap, EdgeMap } from './types';
import * as appAPI from './desktop';
import { textWidth } from './libs/gmath';
interface ProjectData {
nodes: NodeMap,
nodeAutoSize: boolean,
edges: EdgeMap,
oriented: ... |
def to_tokens(self, op_token_table):
raise NotImplementedError |
Sergei Panteleevich Mavrodi (Russian: Серге́й Пантеле́евич Мавро́ди; 11 August 1955 – 26 March 2018) was a Russian financial fraudster, financial criminal and previously a deputy of the State Duma. He was the founder of the МММ, a scheme that defrauded millions of people around the globe.
In 2007 Sergei Mavrodi was co... |
def calc_iou( gt_bbox, pred_bbox):
x_bottomleft_gt, y_bottomleft_gt, x_topright_gt, y_topright_gt= gt_bbox
x_bottomleft_p, y_bottomleft_p, x_topright_p, y_topright_p= pred_bbox
if (x_bottomleft_gt > x_topright_gt) or (y_bottomleft_gt> y_topright_gt):
print(x_bottomleft_gt, y_bottomleft_gt, x_toprigh... |
def do_share_server_migration_get_progress(cs, args):
share_server = _find_share_server(cs, args.share_server_id)
result = share_server.migration_get_progress()
cliutils.print_dict(result) |
<reponame>JinshanMa/fenhuo-renren<filename>src/main/java/io/renren/modules/fenhuo/service/impl/FenhuoProjectfileServiceImpl.java
package io.renren.modules.fenhuo.service.impl;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplu... |
def rxxr(factor: float = 1) -> float:
return 15.875 * factor |
<reponame>BenLubar/weblegends
#include "../helpers_event.h"
#include "df/history_event_hist_figure_travelst.h"
void do_event(std::ostream & s, const event_context & context, df::history_event_hist_figure_travelst *event)
{
list_event_link<df::historical_figure>(s, context, event->group);
std::string prefix = ... |
<reponame>nauee/Algo3-TP2<gh_stars>1-10
package edu.fiuba.algo3.interfaz.botones;
import edu.fiuba.algo3.interfaz.musica.Cancion;
import edu.fiuba.algo3.interfaz.controladores.ControladorMusica;
import javafx.scene.control.RadioMenuItem;
import edu.fiuba.algo3.interfaz.musica.Reproductor;
public class BotonMusica ext... |
WikiLeaks' Assange Wins Bail But Isn't Free Yet
toggle caption Dan Kitwood/Getty Images
A British court granted bail Tuesday to WikiLeaks founder Julian Assange, who will nevertheless remain in custody for at least two more days pending the outcome of an appeal.
Assange has spent a week in prison awaiting possible e... |
package gfsdb
import (
"github.com/Centny/gwf/util"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
const (
ES_RUNNING = "running"
ES_DONE = "done"
ES_ERROR = "error"
ES_IGNORE = "ignore"
ES_NONE = "none"
//
VS_VERIFIED = "verified"
VS_ZERO = "zero"
VS_REDO = "redo"
VS_ERROR = "error"
)
... |
def compare_movies_to_json(self, movies, json_path):
if os.path.exists(json_path):
with open(json_path, 'r') as outfile:
saved_movies = json.load(outfile)
new_movies = []
for i in movies:
if i.title not in saved_movies:
new_... |
.
In spite of the constant development of pharmacotherapy, electroconvulsive therapy (ECT) remains highly efficient form of therapy in psychiatry. Among the interesting aspects connected with ECT we can mention patients' attitude and their psychic comfort. Since many patients undergoing ECT treat the situation as stre... |
package juuxel.loomquiltflower.test;
import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.GradleRunner;
import org.gradle.testkit.runner.TaskOutcome;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class RuntimeClasspathTest extends ProjectTest {... |
<reponame>usenixatc2021/SoftRefresh_Scheduling
/*
* 440SPe's XOR engines support header file
*
* 2006-2009 (C) DENX Software Engineering.
*
* Author: <NAME> <<EMAIL>>
*
* This file is licensed under the term of the GNU General Public License
* version 2. The program licensed "as is" without any warranty of any... |
Work continued in the aftermath of the bridge collapse on Interstate 75 in Cincinnati on Jan. 20, 2015. Highway advocates are urging Congress to approve more funding to repair roads and fix aging bridges. (Photo: Liz Dufour, AP)
WASHINGTON – Damaged big-city roads cost motorists as much as $1,000 a year in added maint... |
package decompress_test
import (
"fmt"
"io"
"net/http"
"net/http/httptest"
"github.com/kei2100/decompress-roundtripper"
)
func ExampleRoundTripper() {
cli := http.Client{
// decompress.RoundTripper is automatically decompresses the response body according to the Content-Encoding header
Transport: &decompre... |
def textile(text, **kwargs):
from django.contrib.markup.templatetags.markup import textile
return textile(text) |
def promise(cls, fn, *args, **kwargs):
task = cls.task(target=fn, args=args, kwargs=kwargs)
task.start()
return task |
/**
* Keep waiting to be override by children classes for different behaviors.
* Timeout is validated here.
*/
void keepWaiting() {
logDebug(String.format("%s runnable waiting, current state is %s.",
actionName, stateHelper.getCurrentOamState()));
isTimeout("keepWaiting");
... |
Three individuals were arrested in Greensboro, North Carolina Thursday on suspicion of robbery. The head of a day center and advocacy group for those experiencing homelessness is calling into question the treatment of one of those individuals, a 25-year-old transgender woman.
Michelle Kennedy, executive director of th... |
<filename>applications/TopologyOptimizationApplication/topology_optimization_application.cpp<gh_stars>1-10
// ==============================================================================
// KratosTopologyOptimizationApplication
//
// License: BSD License
// license: TopologyOptimizationApp... |
Presidential hopeful Ron Paul takes aim at the three candidates getting the most attention in the GOP race, blasting Mitt Romney, Rick Perry and Michele Bachmann as "smooth-talking politicians" in the same company as President Obama.
The Texas congressman, who finished second to Bachmann in last weekend's Iowa straw p... |
WhiteHouse.gov
Future petitions to the White House to build a Death Star, have Piers Morgan deported, or fire Aaron Swartz's prosecutor will have to attract more support to merit the White House's attention.
Beginning today, petitions filed on WhiteHouse.org's We the People platform will need to log 100,000 signature... |
It has been, and still is, one of D-Day’s most recurring hypothetical scenario, for historians and wargamers’ alike: ‘what if’ the Germans had unleashed their Panzers against the Allied beachhead on the very first hours of June 6th?
And in each and every such scenario, the main German protagonist for such a swift coun... |
/**
* Removes a log writer, either global or from a particular <code>logService</code>.
* <p>
* Note that for a writer to be removed global, it had to be added global before.
*
* @param logService name of the log service of which the writer will be removed; to
* remove the writer global, use an empt... |
import factory
class WalletFactory(factory.django.DjangoModelFactory):
owner = factory.SubFactory('users.User', wallet=None)
class Meta:
model = 'users.Wallet'
class UserFactory(factory.django.DjangoModelFactory):
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
email = factory.S... |
/*!
* Copyright (c) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project.
*/
import { Pivot, PivotItem } from '@fluentui/react'
import { FC } from 'react'
import { ColorPalette } from '../ColorPalette'
import { CoolerPicker } from '../CoolerPicker'
import { FluentViewer }... |
z = input().split()
l = int(z[0])
k = int(z[1])
a = [int(x) for x in input().split()]
least = 0
sum = 0
lowest = 0
for i in range(k):
sum += a[i]
least = sum
for i in range(k, l):
sum = sum - a[i-k] + a[i]
if sum < least:
least = sum
lowest = i-k+1
print(lowest+1)
|
/* @(#)steim.c 1.8 02/03/97 */
/*======================================================================
*
* steim.c
*
* Steim 1 compression/decompression. Here we force the output to be
* in big endian byte order, as it looks like many of the big endian
* decompressors out there assume that the data are that... |
package Controllers
import (
"github.com/kataras/iris"
"github.com/kataras/iris/context"
)
func GetIndexHandler(ctx iris.Context) {
ctx.JSON(context.Map{
"code": 200,
"message": "hello Marisa~",
})
} |
/// Computes unordered set of pending hashes.
///
/// Since strict nonce-checking is not required, you may get some false positive future transactions as well.
pub fn pending_hashes<N>(
&self,
nonce: N,
) -> BTreeSet<H256> where
N: Fn(&Address) -> Option<U256>,
{
let ready = ready::OptionalState::new(nonce);
... |
<filename>third_party/blink/renderer/core/animation/animation_utils_test.cc<gh_stars>10-100
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/animation/animation_... |
def raise_403(response):
http_error_msg = f"403 Client Error: Forbidden for url: {response.url}"
raise requests.exceptions.HTTPError(http_error_msg, response=response) |
def parse(self, parser: jinja2_parser.Parser) -> nodes.CallBlock:
next(parser.stream)
lineno = parser.stream.current.lineno
body = parser.parse_statements([f"name:end{tagname}" for tagname in self.tags], True)
method = self.call_method("strip_spaces")
call_block = nodes.CallBlock... |
<filename>default_image_test.go
package brightbox
import (
"github.com/brightbox/gobrightbox"
"testing"
)
func TestEmptyImages(t *testing.T) {
emptyImages := []brightbox.Image{}
if _, err := GetDefaultImage(emptyImages); err == nil {
t.Error("Missing default image not detected in empty list")
}
}
func TestSin... |
<reponame>wonderful666/marx-10.1.0<gh_stars>0
/*
* Hisilicon ISP Sensor Driver
* Name : sensor.c
* Copyright (c) 2018- Hisilicon Technologies CO., Ltd.
*
* 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 Softwa... |
/**
* Defines the slide size (trigger frequency) for the windowed data stream.
* This controls how often the user defined function will be triggered on
* the window. </br></br> For example to get a window of 5 elements with a
* slide of 2 seconds use: </br></br>
* {@code ds.window(Count.of(5)).every(Time.of(2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.