content stringlengths 10 4.9M |
|---|
class BaseRelationalModel:
"""Base class for all the relational models.
The ``BaseRelationalModel`` class defines the common API that all the
relational models need to implement, as well as common functionality.
Args:
metadata (dict, str or Metadata):
Metadata dict, path to the met... |
<filename>pages/migrations/__init__.py
# Ignore everything in this directory |
// NewMockRESTClientGetter creates a new mock instance.
func NewMockRESTClientGetter(ctrl *gomock.Controller) *MockRESTClientGetter {
mock := &MockRESTClientGetter{ctrl: ctrl}
mock.recorder = &MockRESTClientGetterMockRecorder{mock}
return mock
} |
package main
import (
"fmt"
"log"
"regexp"
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"github.com/totsukapoker/totsuka-ps-bot/models"
)
// ConnectDB - Provide connection to database with gorm
func ConnectDB(url string) *gorm.DB {
db, err := gorm.Open... |
// FindBetween returns timestamps falling between start inclusive and
// end exclusive.
func (t *timestampSeriesType) FindBetween(
start, end float64) (result []float64) {
var record Record
t.lock.Lock()
defer t.lock.Unlock()
appender := AppenderFilterFunc(
(*tsAppenderType)(&result),
func(r *Record) bool {
... |
Detection of a diffuse extended halo-like structure around 47 Tuc
We constructed for the first time a stellar density profile of 47 Tucanae (47 Tuc) out of $\sim$ 5.5 times its tidal radius ($r_t$) using high-quality deep $BV$ photometry. After carefully considering the influence of photometric errors, and Milky Way a... |
// Set edits and saves a setting within a configuration file.
func Set(name string) error {
if viper.ConfigFileUsed() == "" {
configMissing("set")
}
keys := viper.AllKeys()
sort.Strings(keys)
if strings.HasPrefix(name, "directories.") {
name = strings.Replace(name, "directories.", "directory.", 1)
}
for i, k... |
<reponame>kirbycool/baseweb
import React from 'react';
import {useStyletron} from 'baseui';
import {FormControl} from 'baseui/form-control';
import {FlexGrid} from 'baseui/flex-grid';
import {StatefulDatepicker} from 'baseui/datepicker';
import {TimezonePicker} from 'baseui/timezonepicker';
import {TimePicker} from 'b... |
from django.db import models
from datetime import datetime
class Payer(models.Model):
name = models.CharField(max_length=255, unique=True)
total_points = models.PositiveIntegerField(default=0)
def __str__(self):
return self.name
class Transaction(models.Model):
payer = models.ForeignKey... |
// MasterMessage handles messages from master
func MasterMessage(update *tgbotapi.Update) {
if update.Message.Chat.ID == connection.MasterTelegramID {
var msg tgbotapi.MessageConfig
if update.Message.ForwardFrom != nil {
msg = tgbotapi.NewMessage(connection.MasterTelegramID, strconv.Itoa(update.Message.ForwardF... |
/**
* Generates an unbounded sequence of {@link java.lang.String}.
*
* @author Christophe Pollet
*/
public class StringIndexSequence extends BaseFieldGenerator<String> {
private final String format;
private final Long start;
private Long next;
/**
* Generates a @{code String} based on a format and a ever gro... |
//
// MCTipsUtils.h
// MotionCamera
//
// Created by 原鹏飞 on 2019/8/10.
// Copyright © 2019 Apeman. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, MCTipsOrientation) {
MCTipsOrientationPortrait = 0, // 竖屏(默认)
MCTipsOrientation... |
/**
* The web3j producer.
*/
public class Web3jProducer extends HeaderSelectorProducer {
private static final Logger LOG = LoggerFactory.getLogger(Web3jProducer.class);
private Web3j web3j;
private Quorum quorum;
private Web3jConfiguration configuration;
public Web3jProducer(Web3jEndpoint endpoin... |
/**
* Check the validity of an annotated query based on 3 rules:
* 1. The last keyword cannot be an OperatorTerm
* 2. For each term matching an AggregateFunction the next
* should match an attribute name or an Aggregate Function.
* 3. For each term matching an GroupBy or Count the next ... |
// Comp_04_0386
import React from 'react';
import { incModCount } from '../modCount';
import Comp_05_1930 from './Comp_05_1930';
import Comp_05_1931 from './Comp_05_1931';
import Comp_05_1932 from './Comp_05_1932';
import Comp_05_1933 from './Comp_05_1933';
import Comp_05_1934 from './Comp_05_1934';
const Comp_04_0386... |
class Int2Printer:
def __init__(self, val):
self.val = val
def to_string(self):
return "{%d,%d}" % (self.val['x'], self.val['y'])
class RangePrinter:
def __init__(self, val):
self.val = val
def to_string(self):
return "{%s...%s}" % (self.val['start'], self.val['end'])... |
<filename>src/main/java/com/robidium/demo/compiler/transformation/synthetic/DataTransformer.java
package com.robidium.demo.compiler.transformation.synthetic;
import org.json.simple.JSONArray;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.io.FileReader;
import java... |
<reponame>comprakt/comprakt-fuzz-tests
class Ed {
}
class QUhs9Z4 {
public static void P9p_wAxUxG (String[] NXSQc0) {
{
int a;
-null.C_MjCdC4BtD();
!!241186.yKRFtF9dzVA;
XhiKRwLkjlor zjEUy;
;
return;
void FggkBD;
... |
#
# Pyserini: Reproducible IR research with sparse and dense representations
#
# 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... |
<filename>server/src/modules/files/services/CreateFileService.ts
import { injectable, inject } from 'tsyringe';
import AppError from '@shared/errors/AppError';
import File from '@modules/files/infra/typeorm/entities/File';
import IUsersRepository from '@modules/users/repositories/IUsersRepository';
import IFilesRepo... |
/**
* Implements the generated visitor class to do the mapping to criteria api.
*/
public class EvalVisitor<T extends ResourceEntity> extends LogicalOperatorRulesBaseVisitor<Predicate> {
private final FilterParser<T> filterParser;
private final Root<T> root;
public EvalVisitor(FilterParser<T> filterPars... |
#ifndef NUMBER_H
#define NUMBER_H
#include <regex>
#include "Utils/string.h"
#include "Exceptions/compilerexception.h"
class Number
{
private:
static std::regex binPrefix; // finds 0b00000 or 0B00000 numbers
static std::regex binPostfix; // finds 00000b or 00000B numbers
static std::regex dec;
... |
package main
import (
"fmt"
"math"
"unicode/utf8"
)
func main() {
//name := "张鑫qq"
//hobby := "睡觉"
// 字符串拼接
//ss := name + hobby
//fmt.Println(ss)
//ss1 := fmt.Sprintf("%s%s", name, hobby)
//fmt.Println(ss1)
// 字符串分割
//s1 := strings.Split(ss1, "")
//fmt.Println(s1)
// 包含
//fmt.Println(strings.Contain... |
import numpy as np
import torch
import gym
import argparse
import os
import utils
import datetime
from torch.utils.tensorboard import SummaryWriter
from sliding_window import SlidingMin
# Runs policy for X episodes and returns average reward
# A fixed seed is used for the eval environment
def eval_policy(policy, en... |
Triggering and guiding high-voltage discharge in air by single and multiple femtosecond filaments.
The abilities to trigger and guide high-voltage discharge by using single and <em>multiple filaments</em> (MFs) are experimentally studied. It is shown that the discharge voltage threshold... |
// url: POST /uploadstrings?app=$appName&secret=$uploadSecret
// POST data is in the format:
/*
AppTranslator strings
string to translate 1
string to translate 2
...
*/
func handleUploadStrings(w http.ResponseWriter, r *http.Request) {
appName := strings.TrimSpace(r.FormValue("app"))
app := findApp(appName)
if app =... |
import java.io.*;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new FileReader("input.txt"));
int n = Integer.parseInt(br.readLine());
int[]P = new int[n];
for(int i = 0... |
<reponame>BuildJet/open-banking-gateway
package de.adorsys.opba.protocol.facade.services.scoped.consentaccess;
import de.adorsys.opba.db.domain.entity.Bank;
import de.adorsys.opba.db.domain.entity.Consent;
import de.adorsys.opba.db.domain.entity.psu.Psu;
import de.adorsys.opba.db.domain.entity.sessions.ServiceSession;... |
import { render } from '@testing-library/react-native'
import { TotalValueLocked } from './TotalValueLocked'
jest.mock('@shared-contexts/ThemeProvider')
jest.mock('@react-navigation/native', () => ({
useNavigation: jest.fn()
}))
describe('Total Value Locked', () => {
it('should match snapshot', async () => {
... |
#!/usr/bin/env node
import * as fs from "fs"
import * as path from "path"
import Arguments from "yargs"
/**
* Array of Regex to match valid paths for renaming
*/
export const DIRECTORY_MATCH = "How to"
/**
* Filename put beside original file to track action history
*/
export const NFO_NAME = "original.json"
/**
... |
Mental health, self-esteem, and influences on sexual values and attitudes among black South African adolescent males
This study investigated the relationships between sexual values and attitudes, self-esteem, and mental health among black South African adolescents. Adolescent males (n = 522) aged between 13 and 21 yea... |
In vitro and in vivo evaluation of benzathine foscarnet microcrystals as a potential intravitreal drug depot
Sodium foscarnet is an antiviral drug against cytomegalovirus retinitis, and clinically it is used via frequent intravitreal injection which causes various ocular complications. Here we propose to use benzathin... |
package etcfs
import "bazil.org/fuse/fs"
type FS struct{}
func (_ FS) Root() (fs.Node, error) {
return Dir{}, nil
}
|
def linear_problem(A,optimize_alpha,alpha):
if optimize_alpha:
alpha = dl.selregparam(y, A, ax, regtype, regparam, regorder=regorder)
AtA, Aty = dl.lsqcomponents(y, A, L, alpha, weights, regtype=regtype)
result = linSolver(AtA, Aty)
linfit = parseResult(result)
linfit... |
<reponame>roopansh/Graphics-Lab<gh_stars>1-10
const double PI = 3.142857;
typedef struct
{
double x;
double y;
double z;
} POINT3D;
typedef struct
{
double x;
double y;
} POINT2D;
typedef struct
{
int r, g, b;
} COLOR;
typedef struct
{
HDC hdcMem;
HBITMAP hbmp;
SIZE windowSize;
POINT origin;... |
import os
import sys
from emscripten_helpers import (
run_closure_compiler,
create_engine_file,
add_js_libraries,
add_js_pre,
add_js_externs,
create_template_zip,
)
from methods import get_compiler_version
from SCons.Util import WhereIs
from typing import TYPE_CHECKING
if TYPE_CHECKING:
fr... |
/* Clear AUX pointers of all edges. */
void
clear_aux_for_edges (void)
{
basic_block bb;
edge e;
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
{
for (e = bb->succ; e; e = e->succ_next)
e->aux = NULL;
}
} |
/**
* A wrapper class; this selection model allows only a single selection,
* and does not allow the user to deselect. This model is useful when
* the user should be required to have exactly one selection.
*
* @author Robert Futrell
*
* @version 1.0
*/
public class RTreeSelectionModel extends DefaultTr... |
Plasmid Copy Number of pTRKH3 in Lactococcus lactis is Increased by Modification of the repDE Ribosome-Binding Site.
Plasmids for DNA vaccination are exclusively produced in the Gram-negative Escherichia coli. One important drawback of this system is the presence of lipopolysaccharides. The generally recognized as saf... |
Role of winds and tides in timing of beach strandings, occurrence, and significance of swarms of the jellyfish Crambione mastigophora Mass 1903 (Scyphozoa: Rhizostomeae: Catostylidae) in north-western Australia
Very large swarms of the red jellyfish Crambione mastigophora in north-western Australia disrupt swimming on... |
<filename>GoExamplesReadOnly/go_pointer.go
/*
Go 语言中指针是很容易学习的,Go 语言中使用指针可以更简单的执行一些任务。
接下来让我们来一步步学习 Go 语言指针。
我们都知道,变量是一种使用方便的占位符,用于引用计算机内存地址。
Go 语言的取地址符是 &,放到一个变量前使用就会返回相应变量的内存地址。
以下实例演示了变量在内存中地址:
*/
package GoExamplesReadOnly
import "fmt"
func main() {
var a int = 10 /* 声明实际变量 */
fmt.Printf("a变量的地址: %x\n", &a)
v... |
There's a lot of debate surrounding Christopher Nolan's Interstellar, and one particular point isn't just about this film, but about the way we see storytelling.
SPOILERS for Interstellar follow.
I know, I know, another Interstellar think piece. You're sick of these by now, right? Well, I promise, I'm largely using C... |
/**
* Register a new subscription to consume events.
* @param subscription the subscription to register; must not be null;
*/
public void register(Subscription subscription) {
if (subscription == null) {
throw new IllegalArgumentException("subscription must not be null");
}
... |
/**
* The persistent class for the "WEIGHT" database table.
*
*/
@Entity
@IdClass(WeightId.class)
public class Weight implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@ManyToOne
private Food food;
@Id
private Integer seq;
@Column(nullable = false, precision = 7, scale = 3)
pr... |
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
COLUMBUS, Ohio -- Already crossed out on signs around Ohio State's campus, citizens around the rest of the state are being asked to follow suit and boycott a certain letter of the alphabet in honor of the intense rivalry with Michigan.
Ohio governor John Kasich posted a resolution on his Twitter account on Friday that... |
package cn.z201.delayed;
import java.util.List;
/**
* @author <EMAIL>
**/
public interface DelayOrderI<T> {
/**
* 添加延迟对象到延时队列
*
* @param itemDelayed 延迟对象
* @return boolean
*/
boolean addToOrderDelayQueue(ItemDelayedI<T> itemDelayed);
/**
* 根据对象添加到指定延时队列
*
* @par... |
/**
* Attempts to edit the account specified by the login form.
* If there are form errors (invalid password, missing fields, etc.), the
* errors are presented and no actual edit attempt is made.
*/
private void attemptEdit() {
passwordView1.setError(null);
passwordView2.setError(nul... |
/**
* Return a string representation of this length using its short label.
*
* @param width The width for the label.
* @param precision The precision for the label, if the length were in
* meters. If the length is not in meters, this value will be
* adjusted acc... |
def mkTruth(i=-1, flatHMF=False):
truthPath = './../data/buzzard_v1.0/allbands/truth/'
if not i == -1:
with hdf.File('{}truth{}_Oii.hdf5'.format(truthPath,
str(i).zfill(2)), 'r') as f:
dset = f['truth' + str(i).zfill(2) + '_Oii']
pr... |
package main
import (
"fmt"
"os"
"path"
"path/filepath"
"strings"
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
"github.com/crowdsecurity/crowdsec/pkg/cwversion"
"github.com/crowdsecurity/crowdsec/pkg/database"
log "github.com/sirupsen/logrus"
"github.com/s... |
/**
* Static helper methods and classes for sets.
*/
public abstract class Sets
{
private Sets() {}
public static ColumnSpecification valueSpecOf(ColumnSpecification column)
{
return new ColumnSpecification(column.ksName, column.cfName, new ColumnIdentifier("value(" + column.name + ")", true), el... |
package me.sumwu.heartbeat;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.RequestParams;
import com.loopj.android.http.ResponseHandlerInterface;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by justin on 10/18/14.
*/
public class MisfitApi {
private s... |
use std::{collections::HashMap, str::Split};
use crate::input;
pub fn run() {
let contents = input::get_lines("day05");
let part1 = h_v_overlaps(&contents);
println!("part1: {:?}", part1);
let part2 = h_v_d_overlaps(&contents);
println!("part2: {:?}", part2);
}
type Coordinates = HashMap<(u32... |
<gh_stars>0
export default class Checksum {
static calculate(input: string, part: number): number {
var nextDigit = (i: number) => i % input.length,
next = part === 1
? (i: number) => nextDigit(i + 1)
: (i: number) => nextDigit(i + input.length / 2);
retu... |
def del_strings(df: pd.DataFrame, cols: List[str] = "Value") -> pd.DataFrame:
drop_cl = list()
for title in cols:
if title in list(df):
df[title] = pd.to_numeric(df[title], errors="coerce")
drop_cl.append(title)
return df.dropna(subset=drop_cl) |
#! /usr/bin/env -S stack runhaskell
import Data.List
part1 :: [Int] -> Int
part1 [] = 0
part1 [_] = 0
part1 (x:y:xs) = (if y > x then 1 else 0) + part1 (y:xs)
part2 :: [Int] -> Int
part2 = part1 . slide
where
slide [] = []
slide [_] = []
slide [_, _] = []
slide (x:y:z:xs) = (x + y... |
<gh_stars>0
# -*- coding:utf-8 -*-
import json
import time
from flask import current_app
import api.lib.cmdb.ci
from api.extensions import celery
from api.extensions import db
from api.extensions import es
from api.extensions import rd
from api.lib.cmdb.const import CMDB_QUEUE
from api.lib.cmdb.const import REDIS_... |
MOSCOW, Aug. 29 -- Russian Prime Minister Vladimir Putin said Thursday that he had reason to think U.S. personnel were in the combat zone during the recent war in Georgia, adding that if confirmed, their presence suggested "someone in the United States" provoked the conflict to help one of the candidates in the America... |
<gh_stars>100-1000
/*
* 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
*... |
<filename>src/goStatus.ts
import * as vscode from "vscode";
export const outputChannel = vscode.window.createOutputChannel("Go Coverage");
|
/**
* if either table lacks a name, do not compare them
*/
@Override
public boolean different() {
DatabaseTable table1 = (DatabaseTable) this.getObject1();
DatabaseTable table2 = (DatabaseTable) this.getObject2();
if ((table1.getName().length() == 0) || (tab... |
/**
* Create a SyncMapPermissionFetcher to execute fetch.
*
* @param pathServiceSid The SID of the Sync Service with the Sync Map
* Permission resource to fetch
* @param pathMapSid The SID of the Sync Map with the Sync Map Permission
* resource to fe... |
<gh_stars>1-10
/// <reference path="../typescript/boilerplate.d.ts" />
declare namespace Magicspace {
interface BoilerplateOptions {
powerApp: BoilerplateOptions.PowerAppOptions;
}
namespace BoilerplateOptions {
interface PowerAppOptions {
port: number;
images?: string[];
/**
* ... |
#include<stdio.h>
int main()
{
int n, m, i, j;
int s[101][3];
scanf("%d%d", &n, &m);
for(i=0; i<n; i++)
{
for(j=0; j<2; j++)
{
scanf("%d", &s[i][j]);
}
}
int found=0, t1, t2, sum;
if((s[0][0]*60+s[0][1]) >= (m+1) )
{
sum = 0... |
/*
Dump a buffer which includes all operations, qbits states and a print buffer to a json format file.
*/
func (q *QBitsCircuit) FileDumpAll(path string) {
s := q.DumpAll()
file, err := os.Create(path)
if err != nil {
log.Fatal(err)
}
defer file.Close()
file.Write(([]byte)(s))
} |
// Add used to add an EnvVar to the EnvVarBuilder.
func (b *EnvVarBuilder) Add(iEnvVar *corev1.EnvVar) *EnvVarBuilder {
found := false
for id, envVar := range b.envVars {
if envVar.Name == iEnvVar.Name {
found = true
if b.options.AllowOverride {
b.envVars[id] = *iEnvVar
}
}
}
if !found {
b.envVar... |
package edu.uc.action;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.liuvei.common.PagerItem;
import com.liuvei.common.SysFun;
import edu.uc.bean.Manage... |
<reponame>pgollucci/p6-casino-craps<gh_stars>0
import { BetStateType } from '../../src/bet';
import { PassLineBet } from '../../src/bet/line';
import * as roll from '../../src/dice/roll';
// XXX: Missing odds, oddsPayout in constructor setting
test('PassLineBet create', () => {
// GIVEN
const passLineBet = new Pa... |
import flask
import json
import argparse
import base64
import sqlite3
import sys
TEST_DB = 'example_app_test_db.db'
TEST_DB_SCHEMA = '''\
create table if not exists events (
_id integer primary key autoincrement,
date_created datetime default current_timestamp,
token varchar,
data blob
);'''
INSERT_EVENT_QUER... |
/**
* This method provides object parsing from String and validation.
*/
private <T extends ObjectType> PrismObject<T> updateLoadedObject(GetObjectResult result, Class<T> type,
String oid, Collection<SelectorOptions<GetOperationOptions>> options,
Holder<PrismObject<T>> partialValueHolder,
Session ... |
/**
* Issue.Smart can find the latest event.
* @throws Exception If some problem inside
*/
@Test
public void findsLatestEvent() throws Exception {
final Issue.Smart issue = new Issue.Smart(RtIssueITCase.issue());
issue.close();
MatcherAssert.assertThat(
new Event.S... |
def generic_schedule_email(request, pk):
template_slug = request.POST.get("slug", "")
original_template = get_object_or_404(EmailTemplate, slug=template_slug)
trigger = get_object_or_404(
Trigger,
action__startswith="workshop-request-response",
template__slug=template_slug,
a... |
/*
dialogWait() method
This method is called by the inner dialog box while waiting for the user to
decide whether or not to delete a duplicate file.
*/
static void dialogWait()
{
synchronized (dialogLock)
{
try { dialogLock.wait(); } catch (InterruptedException ie) { }
}
} |
Two debut novels – one freshly published, the other on its way to becoming a classic – have reminded me that for the past century American writers and artists have been obsessed with that shimmering, sexy, liberating, lethal contraption known as the automobile. Small wonder. Is there a more potent metaphor for American... |
import {Entity, property, model} from '@loopback/repository';
@model()
export class MockModel extends Entity {
@property({
type: 'string',
id: true,
generated: false,
})
id: string;
@property({
type: 'string',
id: true,
generated: false,
})
itemName: string;
@property({
type: '... |
<gh_stars>0
import events
import io
import json
import os
from executors.python import run as python_run
from executors.workflow import run as workflow_run
from . import utils
from girder_worker.utils import JobStatus, StateTransitionException
from girder_worker import config, PACKAGE_DIR
# Maps task modes to their ... |
//=========================================================================
// Copyright (C) 2012 The Elastos 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
//
// ... |
So what is the biggest challenge that many of us face when it comes to decorating our homes? Undoubtedly ‘space’ is the answer that tops the list almost every single time. We try our very best to make the most of every inch of available space in our homes and often dream about how that one extra room could solve all ou... |
/*Sign in if user has already
* been created*/
private void signIn(String email, String password) {
Log.d(TAG, "signIn:" + email);
showProgressDialog();
firebaseAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() ... |
/**
* \brief Get info about channels of playback stream of a mixer simple element
* \param elem Mixer simple element handle
* \param channel Mixer simple element channel identifier
* \return 0 if channel is not present, 1 if present
*/
int snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *elem, snd_mixer_sele... |
#pragma once
#ifndef DRAKE_COMMON_SYMBOLIC_HEADER
#error Do not directly include this file. Include "drake/common/symbolic.h".
#endif
#include <ostream>
#include "drake/common/symbolic.h"
namespace drake {
namespace symbolic {
/**
* Represents symbolic rational function. A function f(x) is a rational
* function, ... |
The terrorist organization Boko Haram made news this week following their kidnapping of over 200 Nigerian schoolgirls. The kidnappings occurred weeks ago, but outcry from the families finally hit the international stage.
Boko Haram is an Islamist group opposed to Western society. They attack schools in particular as a... |
import {Component, ViewChild, EventEmitter, Output} from 'angular2/core';
import {NgForm} from 'angular2/common';
import {MODAL_DIRECTIVES, ModalComponent} from 'ng2-bs3-modal/ng2-bs3-modal';
import {Project} from './project';
@Component({
selector: 'project-creator',
directives: [MODAL_DIRECTIVES],
templa... |
// LineIntersect finds the intersection of the lines (infinite) through p,q and a,b,
// or returns false if they are parallel.
func LineIntersect(p, q, a, b F2) (F2, bool) {
dx1, dx2, dy1, dy2 := p.X-q.X, a.X-b.X, p.Y-q.Y, a.Y-b.Y
det := dx2*dy1 - dx1*dy2
if -Epsilon < det && det < Epsilon {
return F2{}, false
}
... |
use proconio::input;
fn main() {
input! {
n: usize,
a: [usize; n]
};
println!("{}", a.iter().step_by(2).fold(0, |x, y| x + y%2));
}
|
<reponame>TimJSwan89/Java-Programs
import java.util.concurrent.*;
import java.util.*;
class Parallel2048
{
int poolSize = 2;
int maxPoolSize = 2;
long keepAliveTime = 10;
ThreadPoolExecutor threadPool = null;
final ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(
... |
International experts want a fully tested and licensed Ebola vaccine scaled up for mass use in the near future, according to a recent World Health Organization (WHO) meeting.
WHO organized a panel of more than 70 experts, from scientists to medical ethicists, to reach consensus over the status of Ebola vaccines curren... |
<reponame>cojomojo/opengl_skybox_game
//ACKNOWLEDGEMENT: This is Example 7.7 discussed in the OpenGL Programming Guide (8th edition) on
//page 376 with some tweaks to match better with the Phong Reflectance model we discussed in class.
//I am also requiring that the programmer use the w value of position to indicate... |
<reponame>the-art-of-dev/tortue-js
export { Component } from "./component";
export { ComponentBuilder } from "./componentBuilder";
export {
ComponentRegistryRenderer,
ComponentRegisterRendererJSDOM,
} from "./componentRegistryRenderer";
export { ComponentRegistry, MapComponentRegistry } from "./componentRegistry";
|
<filename>examples/maze.py
#!/usr/bin/env python
#
# Maze generator example for RPi-SSD1306
#
# Adapted from:
# https://github.com/rm-hull/maze/blob/master/src/maze/generator.clj
import time
from demo_opts import device
from oled.render import canvas
from random import randrange
NORTH = 1
WEST = 2
class Maze(obj... |
// Funcion que agrega una carta a la baraja especificada
// de este modo solo se puede usar la misma funcion para
// ingresar cartas a distintas barajas
void agrega_carta(Baraja *baraja1, Carta a_carta) {
baraja1->puntaje_total += a_carta.puntaje;
baraja1->cartas[baraja1->index] = a_carta;
baraja1->index++;... |
/**
* Convenience for {@link #remoteMapJournal(String, ClientConfig,
* DistributedPredicate, DistributedFunction, JournalInitialPosition)}
* which will pass only {@link EntryEventType#ADDED ADDED}
* and {@link EntryEventType#UPDATED UPDATED} events and will
* project the event's key and new val... |
m,n = map(int,input().split())
lister = input().split()
count = 0
key = int(lister[n-1])
for x in lister:
if int(x) >0 and int(x) >= key:
count = count+1
print(count) |
def scrape_reports(options):
REPORTS_URL = 'http://www.gao.gov/browse/date/custom?adv_begin_date=01/01/' +\
'%s&adv_end_date=12/31/%s&rows=50&o=%s'
archive = 1970
year_range = inspector.year_range(options, archive)
for year in year_range:
is_next_page = True
offset = 0
while is_next_page:
... |
def tetrahedron(draw, r, im, theta = np.pi/12, shift = np.array([1000,1000,0]), scale = 150, rgb = (216,52,52), ind = 0):
im_sun = Image.open('C:\\Users\\rohit\\Documents\\GitHub\\base\\numerical\\python\\visualization\\Animation\\Images\\Misc\\Sun' + str(ind%2) + '.jpg')
im_sun.thumbnail((150,150), Image.ANTIA... |
Comparative Yield of Different Diagnostic Tests for Tuberculosis among People Living with HIV in Western Kenya
Background Diagnosis followed by effective treatment of tuberculosis (TB) reduces transmission and saves lives in persons living with HIV (PLHIV). Sputum smear microscopy is widely used for diagnosis, despite... |
// Shutdown (uv_shutdown) shutdown the outgoing (write) side of a duplex stream. It waits for pending write requests to complete. The handle should refer to a initialized stream. req should be an uninitialized shutdown request struct. The cb is called after shutdown is complete.
func (s *UvStream) Shutdown(req *C.uv_sh... |
Penetrating gazes: The poetics of sight and visual display in popular Indian cinema
Following a sequence of visually stunning dance routines accompanied by sounds of sung poetry, the climax for most popular Indian films is the intense exchange of gazes between the lover and beloved. This exchange of penetrating gazes ... |
We at Gunaxin have been profiling some of the best young actresses working in entertainment today. We started with the Top Ten Young Actresses, examining the best under thirty talent in the industry. People were familiar with many of the names on that list, as to be expected with great young talent. So to complement th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.