content stringlengths 10 4.9M |
|---|
<gh_stars>10-100
#pragma once
#include <exceptxx/Util.h>
#include <exceptxx/BaseExceptionImpl.h>
#include <exceptxx/ThrowHelper.h>
#include <cassert>
namespace exceptxx
{
class AssertException : public BaseExceptionImpl<AssertException>
{
public:
using Error = string;
AssertException(Error... |
/**
* defines how a selected item is edited
*/
public class SurfaceItemEditor implements Syncable {
private final EditBinding binding;
private final SurfaceData data;
private final EditableSelect selector;
private boolean skip = false;
private final Surface surface;
private fina... |
/**
* Test various multiput operations.
* @throws Exception
*/
@Test
public void testMulti() throws Exception {
createTable(TestMultiMutationCoprocessor.class.getName());
try (Table t = util.getConnection().getTable(tableName)) {
t.put(new Put(row1).addColumn(test, dummy, dummy));
assertR... |
// Checks that prerenderers will terminate when an audio tag is encountered.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderHTML5Audio) {
PrerenderTestURL("files/prerender/prerender_html5_audio.html",
FINAL_STATUS_HTML5_MEDIA,
1);
} |
/*
* $Id$
*
* 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
* "Lice... |
import { setupDomTests } from '../util';
describe('custom-elements-delegates-focus', () => {
const { setupDom, tearDownDom } = setupDomTests(document);
let app: HTMLElement;
beforeEach(async () => {
app = await setupDom('/custom-elements-delegates-focus/index.html');
});
afterEach(tearDownDom);
it('s... |
<filename>StarExec/src/z3/src/util/bit_util.cpp
/*++
Copyright (c) 2012 Microsoft Corporation
Module Name:
bit_util.cpp
Abstract:
Bit hacking utilities.
Author:
<NAME> (leonardo) 2012-09-11.
Revision History:
--*/
#include "util/bit_util.h"
#include "util/util.h"
#include "util/debug.h"
#include <cs... |
from typing import Optional, Dict, Any, Type, Union, TextIO
from pyjsg.jsglib.jsg_object import JSGObject
from pyjsg.jsglib.conformance import conforms
from pyjsg.jsglib.jsg_strings import JSGString
from pyjsg.jsglib.jsg_validateable import JSGValidateable
from pyjsg.jsglib.jsg_anytype import AnyType
from pyjsg.jsglib... |
module.exports = [
{
title: '需求占位',
screenshot: 'https://img.alicdn.com/tfs/TB160cKkP39YK4jSZPcXXXrUFXa-112-64.png',
schema: {
title: '需求占位',
componentName: 'RichText',
props: {
title: '需求占位描述',
content: {
subject: '需求标题',
hideTitle: false,
d... |
def _parse_response(xml):
try:
soap_response = xmltodict.parse(xml, process_namespaces=True, namespaces=Service.Namespaces)
except Exception:
logging.debug('unable to parse the xml response: %s', xml)
raise WSManException("the remote host returned an invalid soap resp... |
/**
* @author jrebula
* </p>
* <p>
* LittleDogVersion06:
* us.ihmc.LearningLocomotion.Version06.util.YoAlphaFilteredVariable,
* 9:34:00 AM, Aug 29, 2006
* </p>=
* <p>
* A YoAlphaFilteredVariable is a filtered version of an input YoVar.
* ... |
/* Print the command type menu and setup response catch. */
static void zedit_disp_comtype(struct descriptor_data *d)
{
get_char_colors(d->character);
clear_screen(d);
write_to_output(d,
"\r\n"
"%sM%s) Load Mobile to room %sO%s) Load Object to room\r\n"
... |
<gh_stars>10-100
package com.learning.java.algorithm;
import java.util.Arrays;
public class Quadruplets {
public static void main(String args[]) {
int[] a1 = {2, 7, 4, 0, 9, 5, 1, 3};
Arrays.sort(a1);
String res = "";
int n = 4;
int sum = 20;
quadruplets(a1, res, n,... |
import { IUser } from './user';
export enum studyType {
SENSOR = 'SENSOR',
CLINICAL = 'CLINICAL',
ANY = 'ANY'
}
export interface IStudy {
id: string;
name: string;
createdBy: string;
lastModified: number;
deleted: number | null;
currentDataVersion: number; // index; dataVersions[cu... |
def init_dets(globs):
di = Database.getDetectorsInt()
tmp = []
for ep in Database.getCurrentProbes():
for det in Database.getCurrentEDSDetectors(ep):
dp = det.getDetectorProperties()
if dp in di:
ii = di[dp]
globs['d%d' % ii] = det
tmp.append(det)
... |
<filename>src/app/app.component.ts
import { Component, OnInit } from '@angular/core';
import { SettingsService } from './settings.service';
import { TtrssClientService } from './ttrss-client.service';
import { TranslateService } from '@ngx-translate/core';
import { Title } from '@angular/platform-browser';
import { Lan... |
<gh_stars>1-10
# Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Util to get objects from flask.g.referenced_objects or DB if not present."""
import collections
import flask
from sqlalchemy import orm
from ggrc import db
from ggrc.models import inflect... |
<reponame>waneon/windows-magnifier-rs
use bindings::Windows::Win32::{
Foundation::POINT, System::Console::FreeConsole, UI::KeyboardAndMouseInput::*,
UI::Magnification::*, UI::WindowsAndMessaging::*,
};
static MOD: HOT_KEY_MODIFIERS = MOD_ALT;
static KEY: u32 = b'1' as u32;
static MAGNIFYING_FACTOR: f32 = 1.8;
... |
<gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = 'model.py'
norm_cfg = dict(type='BN')
mutator = dict(
type='OneShotMutator',
placeholder_mapping=dict(
all_blocks=dict(
type='OneShotOP',
choices=dict(
shuffle_3x3=dict(
... |
Welcome to TrumpBeat, FiveThirtyEight’s weekly feature looking at how developments in Washington affect people in the real world. Want to get TrumpBeat in your inbox each week? Sign up for our newsletter. Comments, criticism or suggestions for future columns? Email us or drop a note in the comments.
President Trump’s ... |
def _add_include(self, include, local_env):
self._add_include_dir(include, local_env) |
/*
Copyright (c) Microsoft Corporation
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.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED *AS IS* BASIS, W... |
<reponame>CEPFU/dwd-importer
package de.fu_berlin.agdb.dwd_importer.core;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.sql.Date;
import java.util.StringTokenizer;
import org.apache.log4j.LogManager;
import org.apache.log4j.Log... |
// GetConfigInt returns a configuration integer value for a given identifier.
// Environment variables have preference over entries in the yaml file, whereby 'name' is
// converted to
//
// "OBCCA_" + strings.Replace(strings.ToUpper('name'), ".", "_")
//
// for environment variables.
//
func GetConfigInt(name strin... |
/**
* Overloads the appends method of StringBuffer
*
*/
public class DebugStringBuffer
{
private StringBuffer buffer = new StringBuffer();
public DebugStringBuffer()
{
}
public DebugStringBuffer(String str)
{
buffer= new StringBuffer(str);
}
public DebugStringBuffer append(String str)
{... |
<gh_stars>1-10
#include "CorePch.h"
#include <rtp++/mediasession/SimpleMediaSessionV2.h>
#include <rtp++/IRtpSessionManager.h>
#include <rtp++/RtpSessionManager.h>
namespace rtp_plus_plus
{
using media::MediaSample;
SimpleMediaSessionV2::SimpleMediaSessionV2(boost::asio::io_service& ioService)
:m_rIoService(ioServ... |
<filename>tests/test_exception_utils.py
from approvaltests import verify_exception
from approvaltests.utilities.exceptions.exception_collector import ExceptionCollector, gather_all_exceptions
def is_odd(integer):
if integer % 2 != 0:
raise ValueError(f"{integer} is not odd!")
def test_gather_all_excepti... |
<reponame>thoughtworks/GilgaMesh
#include <nrf_nvic.h>
uint32_t sys_ClearPendingIRQ(IRQn_Type irqN) {
return sd_nvic_ClearPendingIRQ(irqN);
} |
def monp_fromdic(self, monp_s):
monp = []
for mong_s in monp_s:
mong = Monstergrp(game, mong_s['name'])
mong.monsters = []
mong.identified = mong_s['identified']
for mon_s in mong_s:
mon = Monster(game, mon_s['name'])
mon.hp... |
/// Combines the accumulation input instances into a single input instance.
fn compute_combined_hp_commitments(
input_instances: &[&InputInstance<G>],
proof: &Proof<G>,
mu_challenges: &[G::ScalarField],
nu_challenges: &[G::ScalarField],
combined_challenges: &[G::ScalarField],
... |
According to research by online magazine Spiked 80% of universities have restrictions on free speech – from banning sombreros to excluding the Sun
When Professor Thomas Scotto, of Essex University’s department of government, invited Israel’s deputy ambassador to give a talk to political science students, he hoped for ... |
/** Abstract class for thread which searches for documentation
*
* @author Petr Hrebejk, Petr Suchomel
*/
public abstract class IndexSearchThread implements Runnable {
private static final RequestProcessor RP = new RequestProcessor(IndexSearchThread.class.getName(), 1, false, false);
// PENDING: Add some ... |
package com.jreframeworker.atlas.analysis;
import com.ensoftcorp.atlas.core.db.graph.Node;
import com.ensoftcorp.atlas.core.db.set.AtlasSet;
import com.ensoftcorp.atlas.core.script.Common;
import com.ensoftcorp.atlas.core.xcsg.XCSG;
public class ClassAnalysis {
/**
* Returns true if the given class is marked fina... |
Schnelle parallele Fehlererholung in verteilten In-Memory Key-Value Systemen
Big data analytics and large-scale interactive graph applications require low-latency data access and high throughput for billions to trillions of mostly small data objects. Distributed in-memory systems address these challenges by storing al... |
/**
* we store all property to remove for very last moment (in order to potentially reuse their value)
* @param property property resource that should be removed
*/
private void addPropertyToRemove(Resource property){
if (property != null) {
if (propertiesToRemove == null) {
... |
/// Updates acceleration structures required for tests to pass.
fn update_structures(&mut self, entity: Entity, old: Option<Position>, new: Position) {
let cross = ChunkCrossEvent {
old: old.map(Position::chunk),
new: new.chunk(),
entity,
};
self.handle(cross,... |
Nuclear magnetic resonance studies of antibody-antigen interactions.
NMR is a useful method for studying antibody-antigen interactions in solution but the large size of the molecules makes interpretation of the data difficult. Multinuclear NMR and a family of switch variant antibodies and their proteolytic fragments a... |
def ClearBuildRoot(buildroot, preserve_paths=()):
if os.path.exists(buildroot):
cmd = ['find', buildroot, '-mindepth', '1', '-maxdepth', '1']
ignores = []
for path in preserve_paths:
if ignores:
ignores.append('-a')
ignores += ['!', '-name', path]
cmd.extend(ignores)
cmd += ['-... |
import java.util.Scanner;
public class Task876A {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
byte n = scanner.nextByte();
byte a = scanner.nextByte();
byte b = scanner.nextByte();
byte c = scanner.nextByte();
scanner.close();
int path = 0;
... |
// init registers ingress usage metrics.
func init() {
klog.V(3).Infof("Registering Ingress usage metrics %v and %v, NEG usage metrics %v", ingressCount, servicePortCount, networkEndpointGroupCount)
prometheus.MustRegister(ingressCount, servicePortCount, networkEndpointGroupCount)
klog.V(3).Infof("Registering L4 ILB... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl... |
#include "precompiled.h"
#pragma hdrstop
#include "BulletPhysicsSystemBackend.h"
#include <utility>
#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include "Modules/Graphics/GraphicsSystem/TransformComponent.h"
#include "Modules/Graphics/GraphicsSystem/MeshRendererComponent.h"
#include "BulletRigidBo... |
<reponame>MichaelS11/go-scheduler<gh_stars>1-10
package scheduler_test
import (
"fmt"
"log"
"time"
"github.com/MichaelS11/go-scheduler"
)
func Example_basic() {
// This is for testing, to know when myFunction has been called by the scheduler job.
chanStart := make(chan struct{}, 1)
// Create a function for ... |
package server
import (
"math"
"os"
"strconv"
"strings"
"time"
"github.com/tidwall/btree"
"github.com/tidwall/tile38/internal/collection"
"github.com/tidwall/tile38/internal/field"
"github.com/tidwall/tile38/internal/log"
"github.com/tidwall/tile38/internal/object"
)
const maxkeys = 8
const maxids = 32
con... |
def check_for_overlap(pokemino1, pokemino2):
distance_between_centres_of_mass = np.sqrt(np.sum(np.square(pokemino1.positioning - pokemino2.positioning)))
sum_of_max_radii = (
np.sqrt(np.sum(np.square(pokemino1.max_radius))) + np.sqrt(np.sum(np.square(pokemino2.max_radius))))
if s... |
def stream(self):
if self.package is not None:
return pkg_resources.resource_stream(self.package.__name__, self.resource)
elif isinstance(self.resource, str):
if os.path.isabs(self.resource) and os.path.exists(self.resource):
return open(self.resource, "rb")
... |
// Tests that GetKey returns the dll path.
TEST(GetBlacklistLoadIncidentKey, KeyIsPath) {
safe_browsing::ClientIncidentReport_IncidentData incident;
incident.mutable_blacklist_load()->set_path("foo");
ASSERT_EQ(std::string("foo"),
safe_browsing::GetBlacklistLoadIncidentKey(incident));
} |
import sys
from collections import deque
n,m=map(int,input().split())
arr=[[]*n for _ in range(n)]
for i in range(m):
a,b=map(int,input().split())
arr[a-1].append(b-1)
arr[b-1].append(a-1)
for i in range(n):
if len(arr[i])==0:
print('No')
sys.exit()
def bfs(d):
que=deque()
que... |
Topsy, an Apple-owned service that searched and analysed data from Twitter, is no more. As noted by 9to5Mac, the company's website now redirects to an Apple support page about how to use the new proactive Search functionality (above) in iOS 9. Topsy posted a message to Twitter saying "We've searched our last tweet," an... |
<filename>backend/src/plano/models/plano.model.ts<gh_stars>0
export class Plano {
nome: string;
consumoTotalPermitidoEmMinutos: string;
} |
<reponame>paytomat/ScatterAndroid<gh_stars>1-10
package com.mariabeyrak.scatter.models.requests.transaction.response;
import java.util.Arrays;
public class TransactionResponse {
private String[] signatures;
private ReturnedFields returnedFields;
public TransactionResponse(String[] signatures, ReturnedFie... |
//automated action, button analysis, deviceadmin check
public void automatedAction() throws Exception {
String packname = getParams().getString("packname");
enableDeviceAdmin();
try {
UiObject anyBtn = new UiObject(new UiSelector().className("android.widget.Button"));
if(anyBtn.exists()) {
anyBtn.clic... |
<filename>release/src-rt-6.x.4708/router/iptables-1.4.x/extensions/libip6t_eui64.c
/* Shared library add-on to ip6tables to add EUI64 address checking support. */
#include <xtables.h>
static struct xtables_match eui64_mt6_reg = {
.name = "eui64",
.version = XTABLES_VERSION,
.family = NFPROTO_IPV6,
.size = XT_A... |
def _determine_stopping_criteria(args):
args.stopping_crit = None
if args.num_epochs > 0:
args.stopping_crit = "Epochs"
elif args.num_episodes > 0:
args.stopping_crit = "Episodes"
elif args.num_timesteps > 0:
args.stopping_crit = "Timesteps"
assert args.stopping_crit,\
... |
/**
* Extract info about a content part form a given part of an email.
*/
private MailPartData extractContent(Part part, String mimeType) throws Exception {
MailPartData result = new MailPartData();
result.setContentType(mimeType);
Charset charset = getCharsetFromHeader(part.getContent... |
// check that state and mode are kept
void tst_QLocalSocket::setSocketDescriptor()
{
LocalSocket socket;
qintptr minusOne = -1;
socket.setSocketDescriptor(minusOne, QLocalSocket::ConnectingState, QIODevice::Append);
QCOMPARE(socket.socketDescriptor(), minusOne);
QCOMPARE(socket.state(), QLocalSocket... |
def execute_script_file_obj(self, file_object):
self.create_cur()
self.cursor.execute(file_object.read())
if commit or self.autocommit:
self.commit() |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
// Problem :
// https://onlinejudge.org/in... |
#define COMMA_VERSION "0.7.4-VW1.3"
|
import { DIDTypes } from "@uns/crypto";
export const defaults = {};
export interface IProperyInfo {
default?: string;
defaultByType?: { [Didtype: string]: string };
}
export const systemProperties: Record<string, IProperyInfo> = {
"Badges/Security/SecondPassphrase": {},
"Badges/Security/Multisig": {
... |
def describe(self):
description = super().describe()
description = description.replace("model", "view model")
return description |
def _thread_progress(self, prm_id, name, progress):
self._window.set_progress(prm_id=prm_id, name=name, perc=progress) |
/**
* cr_doc_handler_get_ctxt:
*@a_this: the current instance of #CRDocHandler.
*@a_ctxt: out parameter. The new parsing context.
*
*Gets the private parsing context associated to the document handler
*The private parsing context is used by libcroco only.
*
*Returns CR_OK upon successfull completion, an error c... |
<filename>tests/Trivial.hs
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Trivial (tests) where
import Algebra.Lattice
import Datafix
import Datafix.Worklist (Density (..), IterationBound (..),
... |
From Bulbapedia, tha hood-driven Pokémon encyclopedia.
Pikachu (Japanese: �"カチュウ Pikachu) be a Electric-type Pokémon introduced up in Generation I.
It evolves from Pichu when leveled up wit high friendship n' evolves tha fuck into Raichu when exposed ta a Thunder Stone. But fuck dat shiznit yo, tha word on tha street... |
// Validate returns a TypedError if an Followers struct is incorrect.
func (followers Followers) Validate() apierrors.TypedError {
if !spotifygo.Debug {
return nil
}
if followers.Href != "" {
return apierrors.NewBasicErrorFromString("Href is not empty in Followers")
}
if followers.Total < 0 {
return apierror... |
/**
* Called whenever a players wants to specify a theme
*
* @param player the player
* @param theme the theme
* @since 5.8.0
*/
@Subcommand("forcetheme")
@Description("Force a them to be chosen")
@CommandPermission("bg.forcetheme")
@CommandCompletion("@arenas @nothing")
pu... |
from collections import OrderedDict
import torch
from torch import nn, nn as nn
from torch.nn import functional as F
def default_norm_layer(planes, groups=16):
groups_ = min(groups, planes)
if planes % groups_ > 0:
divisor = 16
while planes % divisor > 0:
divisor /= 2
... |
Prevalence of human T-lymphotropic virus in civilian applicants for the United States Armed Forces.
BACKGROUND
The wide range in human T-lymphotropic virus (HTLV) seroprevalences reported worldwide has made estimates of seroprevalence difficult in unique populations. In this study, the seropositivity of young adult ci... |
<filename>7_kyu/Peak_array_index.py
from typing import List
def peak(arr: List[int]) -> int:
delta_sum = 0
left_index = 0
right_index = len(arr) - 1
while left_index < right_index:
if delta_sum <= 0:
delta_sum += arr[right_index]
right_index -= 1
else:
... |
import {
NullableKeys,
NegativeTypes,
ExtractParams,
ExtractRequest,
HttpMethodsType,
ExtractQueryParams,
ExtractClientOptions,
} from "types";
import { Command } from "command";
import { ClientResponseType, ClientQueryParamsType } from "client";
// Progress
export type ClientProgressEvent = { total: num... |
//+----------------------------------------------------------------------------
//
// Member: GetWigglyFromRange
//
// Synopsis: Gets rectangles to use for focus rects. This
// element or range.
//
//-----------------------------------------------------------------------------
HRESULT
CDisp... |
def _init_vars(self):
self._chassis_kf = None
self._chassis_D = 12
self._chassis_M = 4
self.GEAR_RATIO = 19.0
self.WHEEL_RADIUS = 0.075
self.L = None
self.W = None
self.MECANUM_M = None
self._imu_kf = None
self._imu_D = 9
self._imu... |
import { AppEventServiceProxy } from './../../shared/service-proxies/service-proxies';
import { Component, Injector, ViewChild } from '@angular/core';
import { appModuleAnimation } from '@shared/animations/routerTransition';
import { EventListDto, EventListDtoListResultDto, GuidEntityDto } from '@shared/service-proxie... |
/**
* Testing how auto resizing affects collection performance
* @param bh blackhole
*/
@Benchmark
public void addToCollection(Blackhole bh) {
List<Integer> list = new ArrayList<>(size);
for(Integer i:ints) {
list.add(i);
}
bh.consume(list);
} |
/**
* Call this method when all facts have been gathered.
* @param debug debugging mode (diagnostics)
*/
public void writeFacts(boolean debug) {
if (!outDir.mkdirs() && debug)
System.out.println("WARNING: directory already exists: " + outDir);
for (Map.Entry<String, List<St... |
/**
* <p>
* Integration tests to verify that our FHIR server supports
* {@link CapabilityStatement}s via the <code>GET [base]/_metadata</code>
* endpoint. This is required by the FHIR STU3 specification, as detailed here:
* <a href="https://www.hl7.org/fhir/http.html#capabilities">FHIR RESTful API:
* capabilities... |
/// SinkParsedHLSUnrollPragmas - Sink parsed HLS region unroll pragmas from
/// parent scope to subloops
void Parser::SinkParsedHLSUnrollPragmas(ParsedAttributesWithRange &To,
Scope *P) {
auto *RegionUnrollAttr = IsRegionUnrollScope(P->getParsedHLSPragmas());
if (RegionUnroll... |
package ethos.model.players.packets.commands.owner;
import ethos.model.players.Player;
import ethos.model.players.packets.commands.Command;
/**
* Show the current position.
*
* @author Emiel
*
*/
public class Pos extends Command {
@Override
public void execute(Player player, String input) {
player.sendMess... |
package task
import (
"testing"
"github.com/stretchr/testify/assert"
)
// Fibonacci is the sum of the two preceding ones, starting from 0 and 1.
// https://en.wikipedia.org/wiki/Fibonacci_number
func Fibonacci(n int) int {
if n <= 1 {
return n
}
return Fibonacci(n-1) + Fibonacci(n-2)
}
func TestFibonacci(t *... |
import logging
from dags.grobid_build_image import (
create_dag,
create_build_grobid_image_operator
)
from .test_utils import (
parse_command_arg,
create_and_render_command
)
from .grobid_train_test_utils import (
DEFAULT_CONF
)
LOGGER = logging.getLogger(__name__)
def _create_and_render_buil... |
def check_unbatched_time_step_spec(time_step, time_step_spec, batch_size):
if batch_size is None:
return array_spec.check_arrays_nest(time_step, time_step_spec)
return array_spec.check_arrays_nest(
time_step, array_spec.add_outer_dims_nest(time_step_spec, (batch_size,))) |
package com.peterica.swagger.config;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.... |
<reponame>Pavel-Petkov03/Petstagram
from django import forms
from Petstagram.main.models.profile import ProfileModel
class CreateProfileForm(forms.ModelForm):
FIRST_NAME_MIN_LENGTH = 2
SECOND_NAME_MIN_LENGTH = 2
FIRST_NAME_MAX_LENGTH = 30
SECOND_NAME_MAX_LENGTH = 30
first_name = forms.Cha... |
package com.watson.pureenjoy.music.http.entity.rank;
public class RankSongInfo {
private String title;
private String author;
private String song_id;
private String album_id;
private String album_title;
private String rank_change;
private String all_rate;
private String biaoshi;
pri... |
Welcome to the Sunday Giveaway, the place where we giveaway a new Android phone each and every Sunday!
Congratulations to last week’s Samsung Galaxy S8 Plus Giveaway winner: Jorge V. (Portugal)
This week we’re giving away a brand new Samsung Galaxy S8!
Samsung’s new Galaxy S8 features a beautiful 18.5:9 Infinity dis... |
# Palindrome Partitioning
# 1. seach all possible substrings
# 2. stop early when a substring is not a palindrome
def partition(s):
def dfs(sub_str, path):
if not sub_str:
result.append(path)
return
for i in range(1, len(sub_str) + 1):
if is_palindrome(sub_str[:i]... |
module Ptr where
import Rdg
import qualified RdgZipper as Z
data Ptr a = Ptr [a] a [a]
deriving (Eq, Show)
mkPtr :: [a] -> Ptr a
mkPtr (x:xs) = Ptr [] x xs
forward :: Ptr a -> Ptr a
forward (Ptr bs x (a:as)) = Ptr (x:bs) a as
backward :: Ptr a -> Ptr a
backward (Ptr (b:bs) x as) = Ptr bs b (x:as)
modify :: a ->... |
package com.example.tour;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os... |
/// Get the author key field of the header.
pub fn author_key_id(&self) -> &u64 {
match &self.ton_block {
TONBlock::Signed(x) => match x.signatures().keys().last() {
Some(key) => key,
None => unimplemented!()
},
TONBloc... |
Age-related skeletal muscle decline is similar in HIV-infected and uninfected individuals.
BACKGROUND
Skeletal muscle (SM) mass decreases with advanced age and with disease in HIV infection. It is unknown whether age-related muscle loss is accelerated in the current era of antiretroviral therapy and which factors migh... |
//This version of RegQueryValueEx always calls the Unicode version of the appropriate
//functions if it's running on an Unicode-enabled system. This helps in cases where
//we're reading data from the registry that may not translate properly through the
//WideCharToMultiByte/MultiByteToWideChar round-trip. The cann... |
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { budjetType } from '../budjetType';
@Injectable({
providedIn: 'root'
})
export class BudjetTypeService {
url:string = "http://127.0.0.1:8000/api/";
constructor( private http:Ht... |
/* objects like player_ship, enemy ships, bullets etc. reused in reset */
void stall_objects_init()
{
stall_objects_clear();
stall_player_ship_creator();
global.state = STATE_MENU;
global.focus = FOCUS_START;
global.wave = 0;
global.phase = 0;
global.enemies_alive = 0;
global.enemy_bullets = 0;
global.score =... |
<gh_stars>1-10
use mq::{
camera::{set_camera, Camera2D},
color::{RED, WHITE},
math::Rect,
};
use zgui as ui;
mod common;
#[derive(Clone, Copy, Debug)]
enum Message {
Command,
}
pub fn make_and_set_camera(_aspect_ratio: f32) -> Camera2D {
let display_rect = Rect {
x: 0.0,
y: 0.0,
... |
/**
* Verifies the availability and status of the RdRand instruction
* on the host.
* @return Status of the RdRand instruction on the host.
*/
public static RdRandStatus verify() {
if (!LOADED) {
return RdRandStatus.NOT_LOADED;
}
int result = verifyNative();
return RdRandStatus.getStatusByCode(result... |
<reponame>chromium/chromium<filename>chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantVerticalExpander.java<gh_stars>1000+
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that ... |
Bitwala, a Europe-based bitcoin payment service, has announced the addition of 9 new local currencies to its roster.
The announcement follows the platform’s support for the Japanese Yen and Mexican Peso. Bitwala said that with the support for 9 new local currencies, users will be able to make international money trans... |
#include "cpushersession.h"
#include "../../core/csyslog.h"
#include "../cmessage.h"
#include "../ccredentials.h"
#include "../cchannels.h"
#include "../channels/cchannel.h"
#include <chrono>
void cpushersession::OnPusherSubscribe(const message_t& message) {
if ((*message)["data"].is_object() and (*message)["data"]["... |
export class RegistrationPage {
fillRegistrationDetails(data: {
firstName: string;
lastName: string;
email: string;
phone: string;
password: string;
}) {
const firstName = $("#input-firstname");
expect(firstName).toBeDisplayed({
wait: 4000,
message: "Fields are not loaded",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.