content stringlengths 10 4.9M |
|---|
package main
import (
"fmt"
"log"
c "github.com/ostafen/clover"
)
func main() {
db, _ := c.Open("clover-db")
defer db.Close()
// Check if collection already exists
collectionExists, _ := db.HasCollection("todos")
if !collectionExists {
// Create a collection named 'todos'
db.CreateCollection("todos")
... |
A Second-Order Markov Random Walk Approach for Collaborative Filtering
Collaborative filtering is the most widely used technique to generate recommendations for an active user by the opinions of the others. However, the challenge is that sometimes the data set is too sparse to identify the similarities of user interes... |
/*
* Network Configuration Module
*
* Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. 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.
* You may obtain a copy of the License at
*
* http://www.apac... |
/**
* The helper base of an interpreter of JEXL syntax.
* @since 3.0
*/
public abstract class InterpreterBase extends ParserVisitor {
/** The JEXL engine. */
protected final Engine jexl;
/** The logger. */
protected final Log logger;
/** The uberspect. */
protected final JexlUberspect uberspe... |
package com.zmops.iot.web.analyse.enums;
import lombok.Getter;
/**
* @author yefei
**/
public enum ProcessEnum {
num("proc.num", "num"),
run("proc.num[,,run]", "run"),
max("kernel.maxproc", "max");
@Getter
String code;
@Getter
String message;
ProcessEnum(String code, String message... |
Blood Gas Analysis of Mixed Venous Blood During Normoxic Acute Isovolemic Hemodilution in Pigs
Mixed venous oxygen saturation of hemoglobin (Svo2) and mixed venous oxygen tension (Pvo2) may reflect the overall balance between oxygen consumption and delivery. Because of the potential value of monitoring Svo2 and Pvo2 a... |
/**
* UserCreatedArchiveGenerator
*
* @author <a href="mailto:aslak@conduct.no">Aslak Knutsen</a>
* @version $Revision: $
*/
public class DeploymentAnnotationArchiveGenerator implements ApplicationArchiveGenerator
{
public Archive<?> generateApplicationArchive(TestClass testCase)
{
Validate.notNull(te... |
def find_file(self, tid, path, fid):
if sys.version_info < (3, 0):
if tid:
tid = tid.decode("utf-8")
path = path.decode("utf-8")
fid = fid.decode("utf-8")
splitted = fid.split("|")
_time = time_str(split... |
<reponame>sylwow/angular-security-course
import {Request, Response, NextFunction} from 'express';
import * as _ from 'lodash';
export function checkIfAuthorized(
allowedRoles: string[],
req: Request,
res: Response,
next: NextFunction) {
const userInfo = req['user'];
const roles = _.intersec... |
Yoruba ethnic nationalism, power elite politics and the Nigerian state, 1948–2007
Abstract Known for its political sophistication, the Yoruba remain a force in Nigerian Politics. But its political peculiarities have remained more of an albatross driving a wedge within the group and limiting its political influence in ... |
/**
* Human interface device driver
*
* <NAME>
*/
#include "usb_hid.h"
#define HID_IN_ENDPOINT 1
#define HID_OUT_ENDPOINT 2
void __attribute__((weak)) hook_usb_hid_configured(void) { }
void __attribute__((weak)) hook_usb_hid_out_report(const USBTransferData *report) { }
void __attribute__((weak)) hook_usb_hid_in... |
/**
* A {@link javax.servlet.Servlet} or {@link Filter} for deploying root resource
* classes.
* <p />
* The following sections make reference to initialization parameters. Unless
* otherwise specified the initialization parameters apply to both server and
* filter initialization parameters.
* <p />
* T... |
// GetArticleByID - get single article by id
func GetArticleByID(id int) (Article, errors.DatabaseError) {
row := database.Db.QueryRow(articleStatements["GetArticleByID"], id)
var ret Article
switch err := row.Scan(
&ret.ID, &ret.Title,
&ret.ImageURL, &ret.Text,
&ret.AuthorID, &ret.Date,
&ret.EventID, &ret.A... |
//This function encrypts the user code, compares it to the access code and outputs if it is correct or incorrect, and returns enteredEncrypted when completed successfully
//will return the current code status if an error occurs
//NOTE: this function will update the contents of the pointers passed into this array
enum s... |
/**
* Exception event as a NetworkMonitorEventListener
*
* @param ex Exception
*/
public void networkException (DeviceMonitorException ex)
{
if (ex.getException() instanceof OneWireIOException)
System.out.print(".IO.");
else
System.out.print(ex);
ex.getExceptio... |
/**
* This class is the glue that binds the controls on the physical operator
* interface to the commands and command groups that allow control of the robot.
*/
public class OI {
// make 2 joysticks for the robot driving & operation
public static XboxOne driverStick;
public static XboxOne manipStick;
//... |
import java.util.Scanner;
public class CF_Pangram {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int size=0,i;
char ch;
String s="";
StringBuilder ch_pool = new StringBuilder();
size=input.nextInt();
s=input.next();... |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
struct PP{
string name;
int b;
int a;
}node[100005];
int ans[20002];
bool cmp(PP x,PP y)
{
if(x.b!=y.b) return x.b<y.b;
return x.a>y.a;
}
int main(){
int n,m;
cin>>n>>m;
fo... |
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table nfjd502.dbo.CModel
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCr... |
//
// ABUCustomNativeAdapter.h
// ABUAdSDK
//
// Created by bytedance on 2021/6/8.
//
#import <Foundation/Foundation.h>
#import "ABUCustomAdapter.h"
#import "ABUCustomNativeAdapterBridge.h"
NS_ASSUME_NONNULL_BEGIN
/// 自定义Native广告的adapter广告协议
@protocol ABUCustomNativeAdapter <ABUCustomAdapter>
/// 加载广告的方法
/// @pa... |
<reponame>tonlabs/tor-service
from functools import wraps, partial
import asyncio
import os
import logging
from unittest import IsolatedAsyncioTestCase
from torauth.mocks.debot import debot
logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO'))
debot_address = '0:a4543b20e0b169a7d3edb354d0aa45bc0ada23d357104a... |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <assert.h>
#include <cmr/matrix.h>
#include <cmr/k_modular.h>
typedef enum
{
FILEFORMAT_UNDEFINED = 0, /**< Whether the file format of input/output was defined by the user. */
FILEFORMAT_MATRIX_DENSE = 1, /**< Dense mat... |
<reponame>Uniandes-isis2603/habitaciones_01<gh_stars>0
/*
* Copyright (C) 2017 c.penaloza.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the Licen... |
// Combines two compatibles meshes into one. The two meshes must have the same vertex stride.
bool ConcatMeshes( CMesh *pMeshOut, CMesh **ppMeshIn, int nInputMeshes,
CMeshVertexAttribute *pAttributeOverride, int nAttributeOverrideCount, int nStrideOverride )
{
Assert( pMeshOut && ppMeshIn && nInputMeshes > 1 ... |
/**
* @author <a href="mailto:ivan_budayeu@epam.com">Ivan Budayeu</a>
*/
@Listeners(ReportPortalTestNGListener.class)
public class TestCaseIdTest {
@TestCaseId("TNG.1.0.1")
@Test
public void simpleTest() {
Assert.assertEquals(1, 1);
}
@DataProvider(name = "numbersProvider")
public static Object[][] data() {... |
It was always going to be tough for Giants center Weston Richburg to play at the Washington Redskins, just two weeks removed from a high ankle sprain. But there was some optimism when Richburg was able to be a limited participant in Wednesday's practice.
But Richburg did not practice on Thursday, according to the offi... |
MIMS: Web-based micro machining service
Presented in this paper is a Micro Machining Service (MIMS) based on the World Wide Web (WWW) technologies. Taking advantage of the bi-directional communications of the WWW, the fabrication process of micro machining can be expedited and becomes more viable for students or resea... |
<reponame>telwertowski/Books-Mac-OS-X
/* TemplateExporter */
#import <Cocoa/Cocoa.h>
@interface TemplateExporter : NSObject
{
IBOutlet id menu;
IBOutlet id progressIndicator;
IBOutlet id progressWindow;
IBOutlet id quitMenuItem;
}
- (void) applicationDidFinishLaunching: (NSNotification *) aNotificati... |
/**
* Copyright 2011,2012 Callista Enterprise AB
*
* 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 requi... |
package google
import (
"context"
"io/ioutil"
"golang.org/x/oauth2/google"
"google.golang.org/api/indexing/v3"
"google.golang.org/api/option"
)
// AuthorizeServerToServer is an example of the authorization flow between servers (no consent screen)
// e.g. Indexing v3 API
func AuthorizeServerToServer() (err err... |
The late-September disappearance, and likely massacre, of forty-three students in the southern Mexican state of Guerrero has stripped bare the symbiosis between Mexico’s political establishment and its criminal underworld. Based on what prosecutors have learned so far, a mayor and his wife, the local police force, and ... |
<reponame>Aiky30/djangocms-references
from django.db import models
class Parent(models.Model):
pass
class Child(models.Model):
parent = models.ForeignKey(Parent, on_delete=models.CASCADE)
class UnknownChild(models.Model):
parent = models.ForeignKey(Parent, on_delete=models.CASCADE)
|
/**
* Load a local geodatabase file and add it to the map
*/
private void loadGeodatabase() {
String path =
Environment.getExternalStorageDirectory() + getString(R.string.config_data_sdcard_offline_dir)
+ getString(R.string.config_geodb_name);
final Geodatabase geodatabase = new Geodat... |
async def xp(self, ctx, *, member: discord.Member = None):
member = ctx.author if member is None else member
await self.reward(ctx.author.id, 1)
await self.reward(member.id, 0, True)
user = await self.bot.pg_con.fetch("SELECT * FROM users WHERE id = $1", member.id)
tcg = await se... |
Laminar organization and ultrastructure of GABA-immunoreactive neurons and processes in the dorsal lateral geniculate nucleus of the tree shrew (Tupaia belangeri)
Abstract The distribution and ultrastructure of neurons and neuropil labeled by an antiserum to gamma-aminobutyric acid (GABA) were examined in the lateral ... |
// Describe sends the super-set of all possible descriptors of metrics
// collected by this Collector.
func (nsac KubeNodeCollector) Describe(ch chan<- *prometheus.Desc) {
disabledMetrics := nsac.metricsConfig.GetDisabledMetricsMap()
if _, disabled := disabledMetrics["kube_node_status_capacity"]; !disabled {
ch <- ... |
import React, { useState } from 'react'
import { connect } from 'react-redux'
import { ApiTypes, StoreTypes } from 'src/types'
import IconButton from '@material-ui/core/IconButton'
import selectors from '@selectors/index'
import {
ReactionNavItem,
} from './styles'
interface Props extends ApiTypes.Feed.Comment {
u... |
/**
* Parses the supplied OID string and returns it's contents as a string array. If the string contains a dollar sign it
* is assumed to be a multivalue OID of the form "value1 $ value2 $ value3". Otherwise it is treated as a single value
* OID.
*
* @param oids string to parse
*
* @return array... |
<gh_stars>1-10
package line
import (
"errors"
)
// Embed runs the whole pipeline as a transformer of a parent pipeline.
func (l *Line) Embed(parentIn <-chan interface{}, parentOut chan<- interface{}, parentErrs chan<- error) {
l.embedInMut.Lock()
// if not embedded yet
if l.embedIn == nil {
l.embedIn = parentI... |
// ====================================================================
// The coderep is an operand of a chi, so see if any of the defs are
// direct defs that we want to say do not have complete use lists.
//
void
EMITTER::Compute_incomplete_defs( DU_MANAGER *du_mgr, CODEREP *cr )
{
if (cr->Kind() != CK_VAR)
r... |
<gh_stars>0
import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { NotebookService } from '../../services/notebook/notebook.service';
import { ErrorService } from '../../services/error/error.service';
import {
DecryptedNotebook,
Notebook... |
/** Sub menu bridge.
*/
private static final class SubMenuBridge extends MenuBridge
implements ChangeListener, Runnable {
/** model to obtain subitems from */
private SubMenuModel model;
/** submenu */
private SubMenu menu;
/** Constructor.
*/
public SubM... |
Growth and actual leaf temperature modulate CO2 responsiveness of monoterpene emissions from holm oak in opposite ways
Abstract. Climate change can profoundly alter volatile organic compound (VOC) emissions from
vegetation and thus influence climate evolution. Yet, the short- and
long-term effects of elevated CO2 conc... |
import {
DEFAULT_REQUEST_PREFIX,
createInterfaceName,
createTypingMethodName,
assembleComment,
ProtoInfo,
LINE_FEED,
} from '../utils'
const createServiceMethodType = (method: protobuf.Method) => {
const { comment, requestType, responseType } = method
const parsedComment = assembleComment({ comment, in... |
/**
* Tests for the BackgroundCachingHostResolver class.
*
* @author Ville Koskela (ville dot koskela at inscopemetrics dot io)
*/
@RunWith(Parameterized.class)
public class BackgroundCachingHostResolverTest {
@Parameterized.Parameters
public static Collection<Object[]> data() {
final Function<Host... |
Camouflaged target detection using real-time video fusion algorithm based on multi-scale transforms
In this paper, we propose a novel video fusion algorithm for real-time detection of camouflaged targets. Initially, the targets are detected by using a novel target detection method by applying conventional image thresh... |
'use strict';
import * as Promise from 'bluebird';
import * as chai from 'chai';
import * as sinon from 'sinon';
import DataTypes from '../../../lib/data-types';
import Support from '../../support';
const expect = chai.expect;
const current = Support.sequelize;
describe(Support.getTestDialectTeaser('Model'), () => {
... |
<reponame>min33sky/gatsby_prac_real<gh_stars>0
import React from 'react';
import RecipesList from './RecipesList';
import TagsList from './TagsList';
import { graphql, useStaticQuery } from 'gatsby';
import { GatsbyImageProps, IGatsbyImageData } from 'gatsby-plugin-image';
export type RecipeType = {
content: {
t... |
class DualKalmanFilter:
'''
More of an assortment of initiated classes than an inherited object.
In fact, initial parameters require one state and one parameter filter
pre-initialized.
The code is meant to be filter agnostic. As such, one can use the this
for a variety of filters pre-initialized... |
/**
* <pre>
* The Google Compute Engine zones that are supported by this version in the
* App Engine flexible environment. Deprecated.
* </pre>
*
* <code>repeated string zones = 118;</code>
* @return This builder for chaining.
*/
public Builder clearZones() {
zones_ = com.g... |
Bentley
Bentley is a minimal and responsive Ghost theme focusing on your content. With smooth and slick javascripts transitions, the experience is elegant and simple - just like the Ghost blogging platform.
Demo
See for yourself at http://alson.caffein8.com.
Expect updates - this theme is maturing along with Ghost.... |
An e-health intervention designed to increase workday energy expenditure by reducing prolonged occupational sitting habits.
BACKGROUND
Desk-based employees face multiple workplace health hazards such as insufficient physical activity and prolonged sitting.
OBJECTIVE
The objective of this study was to increase workda... |
Huawei became the biggest smartphone vendor in China in the third quarter, according to estimates from research firm Canalys, unseating the dominant Xiaomi from the top spot.
It’s the first time Huawei has taken the No. 1 position and comes at a challenging time for vendors targeting Chinese consumers. The country is ... |
<filename>vendor/github.com/Juniper/asf/pkg/models/network_ipam_test.go
package models
import (
"net"
"reflect"
"testing"
"github.com/stretchr/testify/assert"
uuid "github.com/satori/go.uuid"
)
type testNetworkIpamParams struct {
allocPools []*AllocationPoolType
subnet *SubnetType
defaultGateway... |
Health care workers treating Thomas Eric Duncan in a hospital isolation unit didn’t wear protective hazardous-material suits for two days until tests confirmed the Liberian man had Ebola — a delay that potentially exposed perhaps dozens of hospital workers to the virus, according to medical records.
The 3-day window o... |
// Gets a GCP project name from FindDefaultCredentials() (from
// golang.org/x/oauth2/google). Though, if a project ID was previously
// obtained such as via GcloudDefaultProject(), then that is just returned.
func DefaultProjectId() string {
if "" == projectID {
creds, err := google.FindDefaultCredentials(
cont... |
<reponame>emadghaffari/virgool
package http
import (
"bytes"
"context"
"encoding/json"
endpoint1 "github.com/emadghaffari/virgool/auth/pkg/endpoint"
http2 "github.com/emadghaffari/virgool/auth/pkg/http"
service "github.com/emadghaffari/virgool/auth/pkg/service"
endpoint "github.com/go-kit/kit/endpoint"
http "g... |
#ifndef DATASTRUCTURES_BWT_OCC_H_
#define DATASTRUCTURES_BWT_OCC_H_
#include "../../DNASequence.h"
#include "../../NucConversion.h"
#include "../../utils.h"
#include "../matrix/Matrix.h"
#include "../matrix/FlatMatrix.h"
template<typename T_BWTSequence, typename T_Major, typename T_Minor>
class Occ {
public:
int ma... |
<gh_stars>0
import { ProfileProps } from "../interface/Profile.interface";
export interface AppState {
login: boolean;
profile: ProfileProps;
actions: AppAction;
logoURL: string;
}
export interface AppAction {}
export interface AppProps {
logoURL: string;
}
|
#include "PXpch.h"
#include "AssetRegistry.h"
#include <yaml-cpp/yaml.h>
#include "AssetTypes.h"
#include <fstream>
#include "Pixelate/Utility/FileSystem.h"
#include "AssetManager.h"
#include "Pixelate/Debug/Instrumentor.h"
namespace Pixelate {
static std::string s_AssetRegistryPath = "assets/AssetRegistry.pxar... |
/**
* A visitor to visit a Java annotation. The methods of this class must be called in the following order:
* ( <tt>visit</tt> | <tt>visitEnum</tt> | <tt>visitAnnotation</tt> | <tt>visitArray</tt> )* <tt>visitEnd</tt>.
*/
public abstract class AnnotationVisitor
{
/**
* Next annotation visitor. This field is ... |
// Get class will return an array contain all of the classes
// that are defined within this Module.
FCIMPL1(Object*, COMModule::GetTypes, ReflectModuleBaseObject* pModuleUNSAFE)
{
FCALL_CONTRACT;
OBJECTREF refRetVal = NULL;
REFLECTMODULEBASEREF refModule = (REFLECTMODULEBASEREF)ObjectToOBJECTREF(p... |
def apply_all_steps(self, spim):
minstage = min(self.process_stage_dict.keys())
maxstage = self._maxstage()
return self.apply_from_stage_to_stage(spim, minstage, maxstage) |
// Add a Button to the device configuration
func (device *Device) NewButton(config *io.Config) *io.IODevice {
button := io.NewButton(config)
device.AddIODevice(button)
return button
} |
//function for merging the singleton arrays together.
public void mergeArray(int lowerIndex,int middle, int higherIndex)
{
for(int i = lowerIndex ; i <= higherIndex ; i++)
{
temparr[i]= array[i];
}
int i = lowerIndex;
int j = middle+1;
int k = lowerIndex;
while(i<=middle && j<=higherIndex)
{
if(t... |
/**
* Copyright (c) 2012-2021 Holger Schneider
* All rights reserved.
*
* This source code is licensed under the MIT License (MIT) found in the
* LICENSE file in the root directory of this source tree.
*
*
* Optimization procedure for iterative local search
*
* Three local search procedures with adaptive ra... |
Synthetic Patient Data Generation and Evaluation in Disease Prediction Using Small and Imbalanced Datasets.
The increasing prevalence of chronic non-communicable diseases makes it a priority to develop tools for enhancing their management. On this matter, Artificial Intelligence algorithms have proven to be successful... |
<reponame>fahimfarhan/cancer-web-app
from django import forms
from followup.models import FollowUp
class DateInput(forms.DateInput):
input_type = 'date'
class FollowUpForm(forms.ModelForm):
class Meta:
model = FollowUp
fields = ('date', 'details',)
widgets = {
'date': Dat... |
package org.firstinspires.ftc.teamcode.commands;
import com.arcrobotics.ftclib.command.CommandBase;
import org.firstinspires.ftc.teamcode.utils.PIDF;
import org.firstinspires.ftc.teamcode.utils.Utils;
import org.firstinspires.ftc.teamcode.subsystems.Drive;
public class DriveToDistance extends CommandBase {
priv... |
async def upload_file(response: Response, file: UploadFile = File(...)):
await file.seek(0)
logging.info(f'opening {file.filename} for writing...')
async with aiofiles.open(settings.folder + file.filename, 'wb') as target:
chunk = await file.read(settings.chunksize)
while chunk:
... |
// New creates a new node for use in the k8s cluster. Configure will push the node to
// the cluster.
func New(namespace string, pb *topopb.Node, kClient kubernetes.Interface, rCfg *rest.Config) (*Node, error) {
impl, err := getImpl(pb)
if err != nil {
return nil, err
}
return &Node{
namespace: namespace,
i... |
package com.example.wahaha.databasetest;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Butt... |
class RoadMap:
"""Collection of tiles that makes a map. tiles argument is a 2d numpy array of tiles"""
def __init__(self, tiles):
self.tiles = tiles
def distance_angle_deg(self, x, y, theta_deg):
tile = self.get_tile(x, y)
rx, ry = self.tile_relative(x, y)
theta_rad = theta_deg*pi/180
d,... |
<reponame>kinarashah/rke
package services
import (
"context"
"fmt"
"github.com/docker/docker/api/types/container"
"github.com/rancher/rke/docker"
"github.com/rancher/rke/hosts"
"github.com/rancher/types/apis/management.cattle.io/v3"
)
const (
NginxProxyImage = "rancher/rke-nginx-proxy:0.1.0"
NginxProxyEnvN... |
///////////////////////////////////////////////////////////////////////////////
// Incorrect groups
// Purpose: to confirm that malformed groups are not parsed.
///////////////////////////////////////////////////////////////////////////////
TEST(LowMidHighCloudGroup, parseWrongReportPart) {
EXPECT_FALSE(metaf::Low... |
The First Jewish–Roman War (66–73 CE), sometimes called the Great Revolt (Hebrew: המרד הגדול ha-Mered Ha-Gadol), or The Jewish War, was the first of three major rebellions by the Jews against the Roman Empire, fought in Roman-controlled Judea, resulting in the destruction of Jewish towns, the displacement of its peopl... |
The Association between Absence of Abdominal Pain and Mortality in Lower Intestinal Perforation in Patients with Autoimmune Rheumatic Diseases
Objective To determine mortality and predictive factors for lower intestinal perforation (LIP) among patients with autoimmune rheumatic diseases. Methods This retrospective, si... |
<filename>omp_dbg.cpp<gh_stars>0
#include "debug.h"
#if !BUILD_WITH_LLVM_INTERFACE
#include "omp_dbg.h"
#include "DynamicAnalyser.h"
DynamicAnalyser da;
long DBG_Get_Addr(void *VarPtr)
{
return (long)VarPtr;
}
void DBG_Type_Control()
{
}
void DBG_Init()
{
}
void DBG_Finalize()
{
}
void DBG_Get_Handle(long *St... |
<reponame>AshleyYakeley/open-witness<filename>src/Data/OpenWitness/ST.hs
-- | This is an approximate re-implementation of "Control.Monad.ST" and "Data.STRef" using open witnesses.
module Data.OpenWitness.ST
(
-- * The @ST@ Monad
ST
, runST
, fixST
-- * Converting @ST@ to @OW@ and @IO@
, st... |
n, m = map(int, input().split())
end = m - 1
MAX = float('inf')
arr = set()
for i in range(n):
inp = input()
# last G, S if they exists
last_g = inp.rfind('G')
if last_g == -1:
last_g = MAX
last_s = inp.rfind('S')
if last_s == -1:
last_s = MAX
if last_s != MAX an... |
/**
* Entry point for the dummy workload used to demo the threadprofiler
*/
public class Main {
private static double blackhole = 0;
public static void main(String[] args) {
ThreadProfilerNode mainElement = ThreadProfiler.node("main", "Main method started");
int numberOfJobsToSimulate = 1;
... |
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#define ll long long
using namespace std;
const int maxn=1e5+5;
struct node{
int a,b;
bool operator<(const node &x)const{
return a<x.a;
}
}f[maxn];
ll c[maxn],s[maxn];
int main()
{
int t;
cin>>t;... |
def checkPVals(DataFrame, CutOff):
for Cols in DataFrame.columns.values:
if Cols % 3 == 0:
if float(DataFrame[Cols][0]) < CutOff:
DataFrame.loc[0, Cols] = 1.0
Cols = 3
while Cols <= max(DataFrame.columns.values):
Query = [i for i in range(Cols-2, Cols+1)]
... |
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
long long a[1000];
int n;
int main(){
long long cnt=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
cnt+=a[i];
}
cnt=cnt/2;
sort(a+1,a+n+1);
for(int i=n;i>=1;i--){
cnt-=a[i];
if(cnt<0){
cout<<n-i+1;
break;
}
}
return 0;
... |
/**
* This class catalogs a set of images available only on Mac.
* <p>
* If you are not scaling these images: these are already accessible on Mac by
* calling:
* <code>Toolkit.getDefaultToolkit().getImage("NSImage://NSComputer")</code>
* <p>
* The scaling logic uses reflection to help guarantee a high-resolution... |
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _IPV4_NF_REJECT_H
#define _IPV4_NF_REJECT_H
#include <linux/skbuff.h>
#include <net/ip.h>
#include <net/icmp.h>
void nf_send_unreach(struct sk_buff *skb_in, int code, int hook);
void nf_send_reset(struct net *net, struct sk_buff *oldskb, int hook);
const struct tcphdr *... |
Effect of partial outlet obstruction on 14C‐adenine incorporation in the rabbit urinary bladder
Bladder outlet obstruction induces severe changes in urinary bladder function and metabolism. These changes are characterized by significant reductions in the ability of the in vitro whole bladder to generate pressure and t... |
Identification of a Putative Network of Actin-Associated Cytoskeletal Proteins in Glomerular Podocytes Defined by Co-Purified mRNAs
The glomerular podocyte is a highly specialized and polarized kidney cell type that contains major processes and foot processes that extend from the cell body. Foot processes from adjacen... |
<gh_stars>0
nome = input("Qual seu nome: ")
idade = int(input("Qual sua idade: "))
altura = float(input("Qual sua altura: "))
peso = float(input("Qual seu peso: "))
op= int(input("Estado civil:\n1.Casado\n2.Solteiro\n"))
if op==1:
op = True
else:
op = False
eu = [nome, idade, altura, peso, op]
for c in eu:
... |
/**
* @description In place rotation of a vector
* @param angle angle in degrees
* @return the calling vector
*/
public Vector2f rotateEq(float angle) {
double radians = Math.toRadians(angle);
double cosine = Math.cos(radians);
double sine = Math.sin(radians);
this.x ... |
/**
* Unit test for {@link FileBasedJobLock}.
*
* @author ynli
*/
@Test(groups = {"gobblin.runtime"})
public class FileBasedJobLockTest {
private FileSystem fs;
private Path path;
@BeforeClass
public void setUp() throws IOException {
BasicConfigurator.configure();
this.fs = FileSystem.getLocal(new... |
<reponame>christallinqq/snowhack<gh_stars>1-10
package javassist.bytecode.analysis;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.NotFoundException;
public class MultiArrayType extends Type {
private MultiType component;
private int dims;
public MultiArrayType(MultiType component, i... |
/**
* The u-based z-approximation from the Mann-Whitney Rank Sum Test for the distance from the end of the read for reads with the alternate allele; if the alternate allele is only seen near the ends of reads this is indicative of error).
* Note that the read position rank sum test can not be calculated for sites wit... |
/**
* Prueba para actualizar una queja.
*
*
*/
@Test
public void updateQuejasyReclamoTest() {
QuejasyReclamosEntity entity = data.get(0);
PodamFactory factory = new PodamFactoryImpl();
QuejasyReclamosEntity newEntity = factory.manufacturePojo(QuejasyReclamosEntity.class);... |
Saugatuck Brewing Company is responding to Anheuser-Busch's new name for Budweiser.
On Tuesday, A-B announced they are replacing the Budweiser logo with “America” on its 12-oz. cans and bottles this summer.
Now, Saugatuck Brewing Company says, "We're here to make beer named after America great again."
On the company... |
Motivations for Luxury Consumption: Insights from Tunisia’s Emerging Market
Luxury consumption and the desire for luxury are well-accepted phenomena. Myriad studies have documented the pervasiveness of the luxury market in the West and the high growth and strong potential of Asian luxury markets. It is also evident th... |
/**
* Check and expand one item - recursive
* @param elem Tree item
* @param checked Flag set true if item is checked
* @param fixChildren Flag set true if children to be processed
* @param fixParent Flag set true if parent to be proecessed
*/
private void checkAndExpandItem(
... |
import java.util.Scanner;
public class Main {
public static void main(String args[]){
Scanner cin = new Scanner(System.in);
while (cin.hasNext()){
String sa = cin.next();
String sb = cin.next();
int a = Integer.parseInt(sa);
int b = Integer.p... |
<gh_stars>0
package usecase
import (
"context"
)
type ServiceType string
type UcAddParams struct {
Name string
Domain string
ServiceType ServiceType
}
type UcAdd interface {
Execute(ctx context.Context, params *UcAddParams) Error
}
var (
ServiceTypeBlog = ServiceType("blog")
ServiceTypeCustom ... |
Sperm motility in fertile men and males in infertile units: in vitro test.
An in vitro test evaluating spermatozooan motility was used to compare percentage of forward progressive spermatozooa at initial observation, within 1 h of obtaining samples, with forward progression after 8 h in Petri dishes (humid chambers). ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.