content stringlengths 10 4.9M |
|---|
But the moment where we learned most about Zuckerberg and his relationship with the casual garment came at the infamous AllThingsD conference, when the CEO got all sweaty and awkward on camera. In an already painful interview, Kara Swisher asks a very steamy (in the not sexy way) Zuckerberg to remove his hoodie. In a m... |
<filename>kvdb/utils.go
package kvdb
// Move data from src to dst.
func Move(src, dst KeyValueStore, prefix []byte) (err error) {
keys := make([][]byte, 0, 5000) // don't write during iteration
it := src.NewIteratorWithPrefix(prefix)
defer it.Release()
for it.Next() {
err = dst.Put(it.Key(), it.Value())
if e... |
export interface Contact {
id: string;
/** name of the contact, you have saved on your WA */
name?: string;
/** name of the contact, the contact has set on their own on WA */
notify?: string;
/** I have no idea */
verifiedName?: string;
imgUrl?: string;
status?: string;
}
|
/*
* Copyright 2010 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
def _do_sde_query(self, query, *args) -> list:
connection = sqlite3.connect('sde.db')
cursor = connection.cursor()
cursor.execute(query, *args)
data = cursor.fetchall()
cursor.close()
connection.close()
return data |
package ghttp
import (
"context"
"net/http"
neturl "net/url"
"testing"
"github.com/stretchr/testify/assert"
"golang.org/x/time/rate"
)
func TestRateLimiter_Enter(t *testing.T) {
dummyRequest := &Request{Request: &http.Request{
URL: &neturl.URL{
Scheme: "https",
Host: "httpbin.org",
Path: "/get"... |
package main
import "github.com/fogleman/gg"
import "math/rand"
import "time"
//import "fmt"
const (
imW = 2000
imH = 2000
w = 100
h = 10
lambda = 1500
fill = 0.6
bgR = 126
bgG = 163
bgB = 204
r = 0
g = 7
b = 45
)
var s1 = rand.NewSource(time.Now().UnixNano())
v... |
/**
* This class holds constants for the entity <code>ExternalSystemConfiguration</code> attributes and
* association.
*
* @author Communote GmbH - <a href="http://www.communote.com/">http://www.communote.com/</a>
*/
public class ExternalSystemConfigurationConstants {
public final static String CLASS_N... |
Neuromuscular diseases and disorders of the alimentary system
This review outlines the relationship and interaction between neuromuscular diseases and disorders of the alimentary system. Neuromuscular manifestations of gastrointestinal and hepatobiliary diseases are first considered. Such diseases may cause neuromuscu... |
def cv_predictiveness_precomputed(x, y, S, measure, f, V = 5, stratified = True, folds = None, na_rm = False, ensemble = False):
import numpy as np
from .vimpy_utils import make_folds
if na_rm:
xs = x[:, S]
cc = np.sum(np.isnan(xs), axis = 1) == 0
newy = y[cc]
else:
cc = ... |
package cage.glfw.input;
import cage.core.input.InputManager;
import cage.core.input.controller.JoystickController;
import cage.core.input.controller.KeyboardController;
import cage.core.input.controller.MouseController;
import cage.glfw.input.controller.GLFWJoystickController;
import cage.glfw.input.controller... |
<filename>sparse_threshold_jointEB.py
import os.path as osp
import argparse
import torch
import torch.nn.functional as F
import torch_geometric.utils.num_nodes as geo_num_nodes
from torch_geometric.datasets import Planetoid
import torch_geometric.transforms as T
from torch_geometric.nn import GCNConv # noga
from uti... |
def enrichment(id,a, b,background, organism,name=None, score=None, strand=None, n=10, run=[]):
write_debug("START",True)
r = {}
e = Enrichment_Par(a=a,b=b,organism=organism,n=n,background=background)
if os.path.exists(e.background):
e = e.replace(Background = BedTool(e.background))
e = e._replace(A = BedTool(str... |
def clean_session(self):
sid = flask.request.form.get('sid', None)
if sid is None:
return make_response_json("No session id (sid) provided"), 400
with self.controller:
if not self.controller.has_session_uuid(sid):
return make_response_json("session id '%s'... |
<gh_stars>0
import { EventEmitter } from 'betsy'
import { IS_PROXY, ProxyStateTree, TTree } from 'proxy-state-tree'
import { Derived } from './derived'
import { Devtools, Message, safeValue } from './Devtools'
import {
Events,
EventType,
Options,
ResolveActions,
ResolveState,
} from './internalTypes'
import {... |
/// Set new size for a memfile. Used when block 0 of a swapfile has been read
/// and the size it indicates differs from what was guessed.
void mf_new_page_size(memfile_T *mfp, unsigned new_size)
{
if (new_size >= mfp->mf_page_size) {
total_mem_used += new_size - mfp->mf_page_size;
} else {
total_mem_used -... |
/**
* Handles the transformation of objects from the <code>TLContextualFacet</code> type to the
* <code>FacetContextual</code> type.
*
* @author S. Livezey
*/
public class TLContextualFacetTransformer extends TLComplexTypeTransformer<TLContextualFacet,FacetContextual> {
/**
* @see org.opentravel.schemac... |
/**
* This class will take care of applying the filter based on the indexes.
* @author: Biju Joseph
*/
public class QuerySecurityFilterer {
protected final Log log = LogFactory.getLog(QuerySecurityFilterer.class);
private String indexName;
private String indexAlias;
private String entityName;
... |
// Draws the block, by getting the pixel position of the block relative to the screen on the graph
public void draw(Graphics2D g2d, int x, int y, int size, ImageObserver imageObserver){
for(Square i : TETROMINOES[tetrominoNum][rotate]){
i.draw(g2d,x + this.x * size, y + (int)(this.y) * size, size,... |
/**
* Created by Catherine on 2016/11/10.
* Soft-World Inc.
* catherine919@soft-world.com.tw
*/
public class VirusDao implements BaseDao {
private final static String TAG = "VirusDao";
private SQLiteDatabase sqLiteDatabase;
private Context ctx;
public VirusDao(Context ctx) {
this.ctx = ctx;... |
package pythagoras
import (
"math"
"testing"
)
// TableDrivenTest for checking multiple values against our Test Function
var distanceTest = []struct {
name string
v1 Vector
v2 Vector
res float64
}{
{"random negative vector", Vector{2, -1, 7}, Vector{1, -3, 5}, 3.0},
{"random wide vectors", Vector{4, 10, ... |
/* Find position of character in string str. Searches up to len length or when \0 is encountered */
int strpos(const char c, const char *str, int len) {
int pos = 0;
while (*(str + pos)) {
if ( *(str + pos) == c)
return pos;
pos++;
}
return -1;
} |
// Calculate nth number of the fibonacci number sequence
#include <stdio.h>
int main(void){
int n = 100; // fib(n)
int i = 0;
double a = 1;
double b = 1;
double fib_n = 0;
// First two fib numbers
switch(n) {
case 1 :
fib_n = 1;
break;
case 2 :
fib_n = 1;
... |
Johann Maria Philipp Frimont.
Johann Maria Philipp Frimont, Count of Palota, Prince of Antrodoco (3 February 1759 – 26 December 1831) was an Austrian general.
Frimont was born at Fénétrange, in what is now French Lorraine. He entered the Austrian cavalry as a trooper in 1776, won his commission in the War of the Bava... |
Immunologic escape after prolonged progression-free survival with epidermal growth factor receptor variant III peptide vaccination in patients with newly diagnosed glioblastoma.
PURPOSE
Immunologic targeting of tumor-specific gene mutations may allow precise eradication of neoplastic cells without toxicity. Epidermal ... |
Eight-year variations in atmospheric radiocesium in Fukushima city
. After the Fukushima nuclear accident, atmospheric 134 Cs and 137 Cs measurements were taken in Fukushima city for 8 years, from March 2011 to March 2019. The airborne surface concentrations and deposition of radiocesium (radio-Cs) were high in winter... |
<gh_stars>10-100
import { throttle } from './throttle';
type Direction = 'up' | 'down' | 'left' | 'right';
type Line = {
initialDirection: Direction;
currentDirection: Direction;
currentColor: string;
coordinates: [number, number][];
};
type Config = {
colors: string[];
speed: number;
squareSize: number;... |
Polytopes, a novel approach to tracking
Standard target tracking techniques such as Kalman filters or maximum liklihood estimators approach nonlinearities from an essentially local point of view; that is, they determine a single solution even though the problem may admit more than one. This lack of uniqueness may be d... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
from gym import spaces
from gym_brt.envs.qube_base_env import \
QubeBaseEnv, \
normalize_angle, \
ACTION_HIGH, \
ACTION_LOW
class QubeBeginUprightReward(object):
def __i... |
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
using namespace std;
bool prime[1000005];
void Sieve(int n)
{
memset(prime, true, sizeof(prime));
prime[0]=prime[1]=false;
for (int p=2; p*p<=n; p++)
{
if (prime[p] == true... |
Poor research design and data analysis encourage false-positive findings. Such poor methods persist despite perennial calls for improvement, suggesting that they result from something more than just misunderstanding. The persistence of poor methods results partly from incentives that favour them, leading to the natural... |
Leftist and rightist demonstrators clashed Saturday night in Tel Aviv as more than 6,000 Israelis gathered to protest the Israeli raid on a Gaza-bound aid ship earlier this week, in which nine pro-Palestinian activists were killed.
Leftist protesters in Tel Aviv on Saturday, June 5, 2010. Nir Keidar
The protest was o... |
// This example shows how to use a simple mesh
//
class ExampleController : public ConnectionTracker
{
public:
ExampleController( Application& application )
: mApplication( application ),
mZMode(0)
{
mApplication.InitSignal().Connect( this, &ExampleController::Create );
memset(mDepthIndices, 0, sizeof... |
def flatten_list(x: List[list]) -> list:
return [z for y in x for z in y] |
import spline_model
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
years = np.array([y for y in range(1996, 2016 + 1)])
ages = np.array([a for a in range(0, 90, 5)])
# covariates = {'year': years}
# exp = [2 * np.log(y - min(years) + 1) + np.random.normal(0, 0.5) for y in years]
covariates =... |
// Copyright (c) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
// Solution 2: Union Find, Beats 100% (4ms)
class Solution {
public:
vector<int> findRedundantConnection(vector<vector<int>>& edges) {
int n = 0;
for (auto& edge: edges) n = max(n, max(edge[0], edge[1]));
vector<int> f (n+1, 0);
for (int i = 1; i <= n; ++i) f[i] = i;
vector<i... |
<commit_msg>Update bluesky's API to the qt_kicker.
<commit_before>import logging
session_mgr._logger.setLevel(logging.INFO)
from dataportal import (DataBroker as db,
StepScan as ss, DataBroker,
StepScan, DataMuxer)
from bluesky.standard_config import *
from ophyd.comman... |
#include "../public/VHACD.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <thread>
#include <atomic>
#include <mutex>
#include <string>
#include <float.h>
#define ENABLE_ASYNC 1
#define HACD_ALLOC(x) malloc(x)
#define HACD_FREE(x) free(x)
#define HACD_ASSERT(x) assert(x)
namespace VHACD
{
cl... |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define endl '\n'
#define F first
#define S second
#define test ll cases; cin>>cases; for(ll testCase = 1; testCase <= cases; testCase++)
#define f... |
S = input()
length = len(S)
S_odd = []
S_even = []
for i in range(0, length, 2):
S_odd.append(S[i])
for i in range(1, length, 2):
S_even.append(S[i])
if ("L" in S_odd) or ("R" in S_even):
print("No")
else:
print("Yes")
|
// Prompt shows the given prompt in the status bar and get user input
// until to user presses the Enter key to confirm the input or until the user
// presses the Escape key to cancel the input. Returns the user input and nil
// if the user enters the input. Returns an empty string and ErrPromptCancel
// if the user ca... |
/** Returns the size of a V3D packet. */
int
v3d_group_get_length(struct v3d_group *group)
{
int last_bit = 0;
for (int i = 0; i < group->nfields; i++) {
struct v3d_field *field = group->fields[i];
last_bit = MAX2(last_bit, field->end);
}
return last_bit /... |
/// Resize the memory_region at the given index
pub fn resize_region<E: UserDefinedError>(
&mut self,
index: usize,
new_len: u64,
) -> Result<(), EbpfError<E>> {
if index >= self.regions.len()
|| (new_len > 0
&& ((self.regions[index].vm_addr + new_len - 1)... |
#include<stdio.h>
#include<string.h>
#include<algorithm>
#define ll long long
#define mmset(a,b) memset(a,b,sizeof(a))
using namespace std;
const int N = 5005;
int data[N][2];
int mark[N];
int n,m;
int main()
{
scanf("%d %d",&n,&m);
for(int i = 1; i <= m; i++)
{
int a,b;
scanf("%d %d",&a, &b);
for(int i = a; ... |
<filename>notebooks/process.py
import h5py
import numpy as np
import os
import random
import progressbar
def open_raw(filepath):
with h5py.File(filepath,'r') as f:
x1 = list(f["x1"])
x2 = list(f["x2"])
p1 = list(f["p1"])
p2 = list(f["p2"])
p3 = list(f["p3"])
tags = l... |
/**
* omap_device_idle - idle an omap_device
* @od: struct omap_device * to idle
*
* Idle omap_device @od by calling as many .deactivate_func() entries
* in the omap_device's pm_lats table as is possible without exceeding
* the device's maximum wakeup latency limit, pm_lat_limit. Device
* drivers should call th... |
<reponame>bTest2018/AnimeTaste<gh_stars>1000+
package com.zhan_dui.download.alfred.missions;
import com.zhan_dui.download.alfred.utils.AlfredUtils;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.U... |
def maximize_residuals(self):
res = opt.minimize_scalar(self._R, bounds=self.alim, method='bounded')
if not res.success:
log('Error: {}', res.message, error=True)
self.a_hat = 0.0
return
self.a_hat = res.x / self.x.ptp() |
/**
* List the files (png and jpg) in the resource folder.
*
* @param folder The name of the folder inside the resources folder.
* @return The list of files.
*
* @throws IllegalArgumentException If folder does not exists.
*/
public static File[] listFiles(String folder) {
File[] content = new File("src/... |
Optimal-Delay-Guaranteed Energy Efficient Cooperative Offloading in VEC Networks
Taking into consideration of vehicle mobility and fairness, in this paper we provide a cooperative offloading algorithm maximizing the energy efficiency for a vehicular edge computing network, while guaranteeing the shortest delay of the ... |
/*
Copyright 2019 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
import java.util.*; // import the util package
public class Watermelon
{
// Define a scanner
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
{
double Kilos; // define a variable for the weight
// System.o... |
It is no secret that the Obama administration’s Syria policy, to the extent that one exists, is failing.
Now the man with the unenviable task of implementing that policy, Secretary of State John F. Kerry, has acknowledged as much, according to two U.S. senators who spoke with him Sunday, John McCain (R-Ariz.) and Lind... |
def map_macros(macros: MacroFile, options: OptionsList, seen: Optional[List[str]] = None) -> List[OptionsList]:
result = []
for option in options:
if not macros.has_property(option):
result.append([option])
else:
new_seen = [option] if seen is None else seen + [option]
... |
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define linf LONG_LONG_MAX
#define inf INT_MAX
#define nn '\n'
#define fpi(i, start, end, increment) for (int i = start; i < end; ... |
/**
* Right now, this class abstracts the following execution scopes:
* Method, Closure, Module, Class, MetaClass
* Top-level Script, and Eval Script
*
* In the compiler-land, IR versions of these scopes encapsulate only as much
* information as is required to convert Ruby code into equivalent Java code.
*
* Bu... |
Immunotherapies for Type 1 Diabetes
That immunotherapy is an appropriate approach in T1D is convincingly supported by findings that point to a pathogenesis with close involvement of the immune system. Autoantibodies and T-cells reactive to islet-derived self-antigens in humans and in animal models, HLA alleles that ar... |
<filename>app/src/main/java/com/yobin/stee/tassel/utils/NetWorkUtils.java
package com.yobin.stee.tassel.utils;
import com.yobin.stee.tassel.utils.api.GalleryApi;
import okhttp3.OkHttpClient;
import retrofit2.CallAdapter;
import retrofit2.Converter;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCall... |
// Copyright 2020, OpenTelemetry Authors
//
// 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 ag... |
import os
def replace_temp(inputfile_folder):
os.chdir(inputfile_folder)
home_dir = os.getcwd()
for i in os.listdir(os.getcwd()):
if os.path.isdir(i):
os.chdir(i)
print("In folder: {}".format(os.getcwd()))
for z in os.listdir(os.getcwd()):
if... |
module PE7 where
sieve a b -- nobody cares about time complexity!
|b==[] = []
|(head b)>a = sieve (a+1) b -- a can't be prime
|(head b)==a = (head b):(sieve (a+1) (filter (\e->(e`mod`a)/=0) (tail b)))
|otherwise = sieve (a+1) (filter (\e->(e`mod`a)/=0) b)
primes=sieve 2 [2..]
... |
In a visit to the Arabian Kingdom on Saturday, Kerry met Salman at al-Oja palace in Dareya district on the outskirts of Riyadh, where they both called for the “importance of mobilizing the international community” to what they called restoring stability to the Middle Eastern country and “the need for a transition away ... |
// CodeOnly creates UserAuthenticator with constant phone and no password.
func CodeOnly(phone string, code CodeAuthenticator) UserAuthenticator {
return codeOnlyAuth{
phone: phone,
CodeAuthenticator: code,
}
} |
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#define const int ci
#define register int ri
#define maxn 100005
#define ll long long
#define itn int
#define INF 2147483647
using namespace std;
inl... |
<gh_stars>0
// Copyright 2016-2017 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... |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
import { MessageAttachment } from 'discord.js';
import { Time } from 'e';
import { CommandStore, KlasaMessage } from 'klasa';
import { table } from 'table';
import { Activity } from '../../lib/constants';
import { minionNotBusy, requiresMinion } from '../../lib/minions/decorators';
import { UserSettings } from '../../... |
/****************************************************************************
Function
ES_IsQueueEmpty
Parameters
unsigned char * pBlock : pointer to the block of memory in use as the Queue
Returns
bool : true if Queue is empty
Description
see above
Notes
Author
J. Edward Carryer, 08/1... |
// TestFactory doesn't play nice with support for parallel tests yet, so forcing same thread execution
@Execution(ExecutionMode.SAME_THREAD)
public class MappingE2E extends AbstractHubCoreTest {
private static final String ENTITY = "e2eentity";
private static final int TEST_SIZE = 20;
private static final ... |
<gh_stars>1-10
"""
base_info holds classes that define the information
needed for building C++ extension modules for Python that
handle different data types. The information includes
such as include files, libraries, and even code snippets.
base_info -- base class for cxx_info, blitz_info, etc.
... |
def windows_check_process_running(self, process_name):
call = 'TASKLIST', '/FI', 'imagename eq %s' % process_name
output = subprocess.check_output(call).decode()
last_line = output.strip().split('\r\n')[-1]
return last_line.lower().startswith(process_name.lower()) |
Nuclear Magnetic Resonance Measurements in Oil-Nitrogen Two-Phase Flow
Abstract NMR measurements of the oil mass flow have been carried out in all-oil flow as well as in oil-nitrogen two-phase flow. For the calibration a simplified method was used which circumvents spin-lattice relaxation calculations due to the short... |
Nestled in Pines of Prescott, Arizona, SSmokin is the premier smoke shop in Northern Arizona. We are at 5,200’ elevation and known for our historic Whiskey Row in the heart of our downtown- filled with bars and live music. At SSmokin we offer our customers the best products at the lowest prices. Two years ago we set ou... |
<reponame>Andrefty/lab-5
#pragma once
#include <iostream>
#include <string>
#include <math.h>
#include <cstdbool>
#include <fstream>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include "utils.h"
#include "catch.hpp"
#include "tree.h"
#define TASK1_TEST_FILENAME "../data/test-createbalanced... |
/**
* Parses a file with four tnsdl warnings.
*
* @throws IOException
* if the file could not be read
*/
@Test
public void testWarningsParser() throws IOException {
Collection<FileAnnotation> warnings = new TnsdlParser().parse(openFile());
assertEquals(WRONG_NUMBER_OF_W... |
Abstract theories and principles are important to build a foundational knowledge, but translating the textbook lessons into practice can be extremely complicated. For example, the chemicals that make up a pharmaceutical product behave differently in a glass beaker than they do when they are ingested by a human. Why? We... |
//opens info scrim and populates views with relevant data
private void openInfoScrim() {
mDetailsBinding.detailsScrim.setVisibility(View.VISIBLE);
mDetailsBinding.scrimIngredientsTextView.setText(mViewModel.getIngredients());
mDetailsBinding.scrimPortionsTextView.setText(getString(R.string.porti... |
/**
* 代理模式
* - 静态代理
* - jdk,cglib 动态代理
* @author pleuvoir
*
*/
package io.github.pleuvoir.proxy; |
// Run the actual check
// if error != nil the check result will be nil
// ctx can be canceled and runs the timeout
// CheckResult will be serialized after the return and should not change until the next call to Run
func (c *CheckDisk) Run(ctx context.Context) (interface{}, error) {
disks, err := disk.PartitionsWithCo... |
#include<bits/stdc++.h>
using namespace std;
int x[300] , y[300];
char col[4] = {0 , 'A' , 'B' , 'C'};
void check(int t1 , int t2 , int t3)
{
if(x[t1] == x[t2] + x[t3] && y[t1] + y[t2] == x[t1] && y[t2] == y[t3])
{
cout << x[t1] << endl;
for(int i = 1;i <= y[t1];i ++)
{
for(int j = 1;j <= x[t1];j ... |
LeBron James plays Goliath to Isaiah Thomas’ David. (Getty Images)
Game 1 of the Eastern Conference finals got ugly quickly for the Boston Celtics on Wednesday night as they faced off against the defending champion Cleveland Cavaliers. The well-rested Cavs built a 26-point lead in the first half and never looked back,... |
// 指针特别灵活
// 两部分内容
export default class Node<T> {
element: any;
next: any;
constructor(element: T, next?: any) {
this.element = element
this.next = next
}
}
|
<gh_stars>0
#include "foto.h"
#include <algorithm>
foto::foto(): inFile("data.txt"), outFile("mark.txt") {
if (!inFile.is_open() | !outFile.is_open()) {
cerr << "Файл не может быть открыт." << endl;
}
while (getline(inFile, buffer)) {
rows.push_back(buffer);
}
inFile.close();
}
... |
Combustion synthesis of Na2Sr(PO4)F:Dy3+ white light emitting phosphor.
The synthesis, X-ray diffraction, photoluminescence, TGA/DTA and FTIR techniques in Dy(3+) activated Na(2)Sr(PO(4))F phosphor are reported in this paper. The prepared phosphor gave blue, yellow and red emission in the visible region of the spectru... |
def parse_duration(s):
if s is None:
return None
tokens = s.split(':')
if len(tokens) < 2 or len(tokens) > 3:
return None
h = int(tokens[0])
m = int(tokens[1])
s = int(tokens[2]) if len(tokens) == 3 else 0
return datetime.timedelta(hours=h, minutes=m, seconds=s) |
/**
* Extracts the extension of a file path.
*
* @param file is a path that should contain an extension
* @return the extension of the path or {@code null} if no extension was found
*/
public static String extractExtension(final Path file) {
String name = file.getName();
int sto... |
/**
* Constructs the prejob that fetches sls file, and then invokes transfer again.
*
* @param constituentJob the constituentJob for which the prejob is being created
* @param headNodeURLPrefix String
* @param headNodeDirectory String
* @param workerNodeDirectory String
* @param slsFi... |
/* eslint-disable react/jsx-no-useless-fragment */
import * as React from 'react';
import * as fs from 'fs-extra';
import * as path from 'path';
const AwardScript = (props: any) => {
const {
dev,
map,
error,
manifest,
assetPrefixs,
cache,
mode,
hashName,
router,
crossOrigin,
... |
import { HeaderBlockContainer } from '@components/headers/headerBlockOne'
import SupportBreadCrumb from '@components/support/supportBreadCrumb'
import { device } from '@styles/global/breakpoints'
import React from 'react'
import styled from 'styled-components'
interface IProps {
headline: string
}
const HeaderBlockO... |
<gh_stars>0
#include <bits/stdc++.h>
#define pb push_back
#define lp(i,n) for(int i=0; i<n; i++)
#define lli long long int
using namespace std;
int visited[20];
int gcd(int a,int b){
return b==0? a: gcd(b, a%b);
}
void gen_perm(int n, vector <int> curr={}, int curr_len=0){
if(curr_len==n){
... |
# -*- coding: utf-8 -*-
from math import ceil, sqrt, atan, degrees
def solve():
a,b,x = map(int, input().split())
if a*a*b == x:
return '0'
elif 1/2*a*a*b >= x:
t = atan(2*x/a/b/b)
else:
t = atan(a*a*a/2/(a*a*b-x))
return str(90-degrees(t))
if __name__ == '__main__... |
/**
* tiglIntersectComponents computes the intersection line(s) between two shapes
* specified by their CPACS uid. It returns an intersection ID for further computations
* on the result. To query points on the intersection line, ::tiglIntersectGetPoint has
* to be called.
*
* @param compo... |
#ifndef __BOGDANOV_IMPL_H__
#define __BOGDANOV_IMPL_H__
#ifdef __cplusplus
extern "C" {
#endif
void c_bogdanov_4x (uint8_t* keys, uint8_t*data, uint8_t *dataOut);
#ifdef __cplusplus
}
#endif
#endif /*__BOGDANOV_IMPL_H__*/ |
/**
* @param input The coded input
* @return The key to be used in the {@link io.github.vkb24312.IPA.IPAConverter#keyConvert} method
*/
private static int[] toConsonantKey(String input){
int voicing;
int place = -1;
int manner = -1;
String[] parts = input.toLowerCase().... |
<reponame>musteka-la/kitsunet-js
'use strict'
import PeerInfo from 'peer-info'
import { NetworkPeer } from '../../network-peer'
import { ExtractFromLibp2pPeer } from '../../helper-types'
export class Libp2pPeer extends NetworkPeer<PeerInfo, Libp2pPeer> {
node?: ExtractFromLibp2pPeer
peer: PeerInfo
get id (): st... |
def _fetch_token(self):
return self._fetch_token_via_browser() |
/**
* Called after a new process is added to the process list
*/
@Override public void intervalAdded( ListDataEvent e ) {
DefaultListModel listModel = (DefaultListModel)e.getSource();
ActiveProcess process = (ActiveProcess)listModel.get(listModel.getSize() - 1);
addProcessTab(process, outputPanel);
} |
/**
* Retreives checkpoint history form specified {@code dir}.
*
* @return List of checkpoints.
*/
private List<CheckpointEntry> retrieveHistory() throws IgniteCheckedException {
if (!cpDir.exists())
return Collections.emptyList();
try (DirectoryStream<Path> cpFiles = Fil... |
package com.geng.springbootexceptionandandjunit.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.sprin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.