content stringlengths 10 4.9M |
|---|
<reponame>marcovit79/vlc_web
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'duration'})
export class DurationPipe implements PipeTransform {
transform(value: number ): string {
let seconds = value % 60;
let minutes = Math.floor( value / 60 ) % 60;
let hours = Math.floor( value / (... |
<gh_stars>0
/*
Derby - Class org.apache.derby.iapi.store.raw.ContainerKey
Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable.
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... |
<filename>client/src/components/editor/SmallEditor.test.tsx
import React from "react";
import { fireEvent, render, waitFor } from "@testing-library/react";
import "mutationobserver-shim";
import userEvent from "@testing-library/user-event";
import SmallEditor from "./SmallEditor";
import SourceType from "../../types/s... |
/**
* <p>Class that stores the attributes of messages as laid out in the
* motd.dat file</p>
*
* @see MOTDService#processFile(boolean) processFile
*/
private class Message
{
/**
* <p>MOTD item id</p>
*/
protected Integer id = null;
/**
* <p>If this MOTD item is active</p>
*/
protected Bo... |
/**
* Generates the certificate required for using SSL.
*/
public class CertificateGeneratorTest {
@Test
public void testGenerateKeyAndTrustStore() throws GeneralSecurityException, IOException, OperatorException {
final File componentsDir = new File("target/test/certificates");
Dele... |
/**
* Sets the minimum boundary for the generated random float. The minimum is inclusive, i.e. the generated value may
* be greater than or equal to the minimum boundary.
* @param minValue The minimum bound for the generated random value.
* @return A reference to the <code>Randomizer</code> instance... |
//Deprecated: Will be removed in a future release and tests in sdlSyncStorageMock_test.go
//should be used instead.
func TestRemoveIfAndPublish(t *testing.T){
var data map[string]interface{}
var channelsAndEvents []string
key := "key"
sdlInstanceMockTest := initSdlInstanceMockTest()
sdl... |
// DecodeProjectConfig Helper to decode Data field type ProjectConfig
func (e *EventMsg) DecodeProjectConfig() (ProjectConfig, error) {
var err error
p := ProjectConfig{}
switch e.Type {
case EVTProjectAdd, EVTProjectChange, EVTProjectDelete:
d := []byte{}
d, err = json.Marshal(e.Data)
if err == nil {
err ... |
<gh_stars>0
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {Router} from '@angular/router';
import { ToastrService } from 'ngx-toastr';
import {AuthenticationServiceService} from '../../../shared/Services/authentication-service.service';
import... |
<filename>src/trace/GLInterceptor/Log.cpp
#include "Log.h"
/* create log file */
#ifdef LOG_MODE_ENABLED
#include "support.h"
#include <sys/timeb.h>
#include <time.h>
using namespace std;
Log* Log::theLog = 0;
Log& Log::log( const char* filename )
{
if ( theLog )
return *theLog;
if ( filename == NULL )
pan... |
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define INF 10000000
int n, m, i, j, a, b, dist = INF;
int distf(int sx, int sy, int ex, int ey, int dx, int dy) {
if (abs(sx - ex) % dx != 0) return INF;
if (abs(sy - ey) % dy != 0) return INF;
if ((((abs(sx - ex) / dx) ^ (ab... |
Get the biggest daily stories by email Subscribe Thank you for subscribing We have more newsletters Show me See our privacy notice Could not subscribe, try again later Invalid Email
A BIRMINGHAM grime star has been convicted of drugs offences including being concerned in supplying cannabis.
Jermaine Alleyne’s music i... |
This article contains advice from other players, and may be subjective and/or outdated. Read at your own risk and alter to fit your play style as necessary!
Version 0.20: This article may not be up to date for the latest stable release of Crawl.
This walk-through assumes that you have downloaded and installed your fi... |
def _sign(self, args):
elements = [self.shared_secret]
for key in sorted(args.keys()):
elements.append(key)
elements.append(args[key].encode('utf-8'))
return md5(''.join(elements)).hexdigest() |
/*
* Used for directly placing blocks (ie saplings) and items (ie sugarcane). Pass in source ID to constructor,
* so one instance per source ID.
*/
public class PlantableStandard implements IFactoryPlantable
{
private int sourceId;
private int plantedBlockId;
public PlantableStandard(int sourceId, int p... |
package app
import (
"errors"
"fmt"
"net/http"
"time"
"github.com/chrisolsen/aetemplate/core"
"golang.org/x/net/context"
"google.golang.org/appengine"
"google.golang.org/appengine/datastore"
"google.golang.org/appengine/log"
"google.golang.org/appengine/memcache"
)
const (
tokensTable = "tokens"
)
// Err... |
/**
* Terminate a partial aggregation and return the state. If the state is a
* primitive, just return primitive Java classes like Integer or String.
*/
public UDAFTopNState terminatePartial() {
if (state.queue.size() > 0) {
return state;
} else {
return null;
}
} |
<gh_stars>0
// Copyright 2020 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package common
import "fmt"
// MT is a PRNG implementing the Mersenne Twister algorithm.
// See https://en.wikipedia.org/wiki/Mersenne_Twister for details... |
//
// LXProgressView.h
// MierMilitaryNews
//
// Created by 李响 on 15/9/11.
// Copyright (c) 2015年 miercn. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, LXProgressIndicatorStyle) {
LXProgressIndicatorStyleNormal = 0,
LXProgressIndicatorStyleLarge = 1,
};
@interface ... |
/**
* Created by jiankuan on 1/27/15.
*/
public class BinaryTreeLevelOrderOutput {
public ArrayList<ArrayList<Integer>> levelOrder(TreeNode root) {
ArrayList<ArrayList<Integer>> res = new ArrayList<>();
int i = 0;
while (true) {
ArrayList<Integer> level = new ArrayList<>();
... |
-- Test instances for tuples up to 15
-- For Read, Show, Eq, Ord, Bounded
module Main where
data T = A | B | C | D | E | F | G | H | I | J | K | L | M | N | O
deriving( Eq, Ord, Show, Read, Bounded )
t15 = (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O)
t14 = (A,B,C,D,E,F,G,H,I,J,K,L,M,N)
t13 = (A,B,C,D,E,F,G,H,I,J,K,L,M)
t1... |
I didn’t grow up in the sticks, but I wasn’t an urban kid, either. I guess edge of the sticks might be an appropriate descriptor for my neighbourhood: the outside rings of cheap housing on the borders of a bedroom community which was itself on the outside of a mid-sized Cascadian burg. No sidewalks defined our roads, o... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package driver;
import java.io.*;
import java.util.Arrays;
/**
*
* @author Admin
*/
public class Test{
public... |
def list_artifacts(self):
response = request('get',
f'{self.base_path}/{self.id}/list-artifacts/')
return response['files'] |
Turkey has decided to downgrade its diplomatic ties with Israel to the lowest possible level, Turkish Foreign Minister Ahmet Davutoglu said on Friday, following Israel's continued refusal to apologize for a 2010 raid on a Gaza-bound aid flotilla.
The findings of a UN probe into Israel's deadly raid on a 2010 flotilla ... |
The premium was meant to account partly for taxes that customers may have paid, said Ashlee Yingling, a McDonald’s spokeswoman.
“We are making sure our customers are fairly compensated for the recall experience,” she said in an e-mail message. While 12 million of the Shrek glasses were intended for distribution in the... |
<reponame>smarterclayton/cluster-kube-controller-manager-operator<gh_stars>0
package operator
import (
"bytes"
"encoding/json"
"fmt"
"reflect"
"time"
"github.com/ghodss/yaml"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg... |
// Check that wildcards are not supported by default
@Test(expected = InternalServerErrorException.class)
public void testSearchUserWildcard() throws Exception {
WebClient wc = WebClient.create("http://localhost:" + PORT);
wc.path("users/search/name==a*").get(User.class);
} |
Here’s a hint: it involved carbon freezing.
As we all know, Rogue One: A Star Wars Story went through innumerable iterations; some of them you saw in trailers and on the big screen, others never made it that far. Recently, Rogue One’s first writer Gary Whitta revealed an alternate, happier ending where Jyn and Cassian... |
Oct. 1, 2012: In space, they say, no one can hear you scream.
Nobody ever said anything about singing, though. A NASA spacecraft has just beamed back a beautiful song sung by our own planet.
"It's called chorus," explains Craig Kletzing of the University of Iowa. "This is one of the clearest examples we've ever heard... |
def save(self, filename="", path=MODEL_SAVE_PATH):
if filename == "":
filename = f"{self.name}"
create_folders(path)
with open(f'{path}/{filename}.pickle', 'wb') as f:
pickle.dump(self, f, pickle.HIGHEST_PROTOCOL) |
Text IQ chief executive Apoorv Agarwal says his software's job is to spot a needle in a haystack – but a costly one. Make a mistake in discovery during litigation, and a company can face sanctions of tens or hundreds of millions of dollars, he says. "It's a high-stakes needle."
Like other startups, Text IQ's raised fu... |
Halogen Nuclear Quadrupole Coupling Constants in Non-axially symmetric Molecules; Ab initio Calculations, which Include Correlation, Compared with Experiment
Abstract Ab initio determination of the electric field gradient (EFG) tensors at halogen and other centres ena-bled determination of the nuclear quadrupole coupl... |
// workspaceExists checks if workspace exists in Kong.
func workspaceExists(config utils.KongClientConfig) (bool, error) {
workspace := config.Workspace
if workspace == "" {
return true, nil
}
if config.SkipWorkspaceCrud {
return true, nil
}
config.Workspace = ""
rootClient, err := utils.GetKongClient(config... |
/**
* Class ReducedCostMatrix
* <p>
* Inherited from GraphMatrix
* </p>
* Created by rayandrew on 3/30/2017.
*/
public class ReducedCostMatrix extends GraphMatrix {
private int[] cost;
private int[][] reduced;
/**
* ReduceCostMatrix constructor.
* @param file file external
* @throws FileNotFoundEx... |
def create(cls, obj):
existing_owner = cls.get_owner(obj)
if not existing_owner:
try:
return cls.objects.create(owner=obj)
except IntegrityError:
return None
return existing_owner |
package rider
import (
"compress/gzip"
"io/ioutil"
"net/http"
"path/filepath"
"strings"
"sync"
)
const (
BestCompression = gzip.BestCompression
BestSpeed = gzip.BestSpeed
DefaultCompression = gzip.DefaultCompression
NoCompression = gzip.NoCompression
)
type gzipWriter struct {
http.Respon... |
Wit.ai, the Y Combinator startup, that has been working on an open and extensible natural language platform all the while helping developers to build applications and devices that turns speech into actionable data, announced earlier this week, its acquisition by Facebook.
“It is an incredible acceleration in the execu... |
import 'remirror/styles/all.css';
import { htmlToProsemirrorNode } from 'remirror';
import { TextHighlightExtension } from 'remirror/extensions';
import { ProsemirrorDevTools } from '@remirror/dev';
import { Remirror, ThemeProvider, useCommands, useRemirror } from '@remirror/react';
export default { title: 'Extension... |
def _run_step(self, commands_0, commands_1):
if commands_1:
commands_team_1 = commands_1
else:
commands_team_1 = Aibehaviour.next_command(self.buster_team1, self.ghosts)
commands_team_0 = commands_0
for i in range(self.buster_number):
buster_team0 = se... |
#include <bits/stdc++.h>
using namespace std;
char maze[110][110];
int n, k;
inline int get(int a, int b){
return max(0, k - (k-1-min(k-1, a)) - (k-1-min(k-1, b)));
}
int main(){
//freopen("in.txt", "r", stdin);
ios::sync_with_stdio(0); cin.tie(0);
int x,y;
while(cin >> n >> k){
for(int i... |
/**
* Invokes a method declared in a target object.
* @param target to call the method.
* @param methodName the method name.
* @param argTypes array of types for the method argument.
* @param args actual arguments.
* @return a value returned from the method.
* @see Class#getDeclaredMethod(String, Class[])... |
Design and development of a sensor for the direct and continuous measurement of inhaled nitric oxide: factors affecting sensitivity
Nitric oxide (NO), in concentrations between 0 and 20 ppm, is currently being used as an inhaled agent to treat patients with post surgical complications and respiratory disorders. Becaus... |
class Meta:
model = Article
"""
List all of the fields that could possibly be included in a request
or response, this includes fields specified explicitly above.
"""
fields = ['id', 'title', 'body', 'description', 'tagList',
'author', 'slug', 'published'... |
def inject(self, field, expr, offset=0):
variables = list(retrieve_function_carriers(expr)) + [field]
idx_subs, eqns = self._interpolation_indices(variables, offset)
eqns.extend([Inc(field.subs(vsub), expr.subs(vsub) * b)
for b, vsub in zip(self._coefficients, idx_subs)])
... |
<reponame>cstom4994/SourceEngineRebuild
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#include "BaseVSShader.h"
#include "commandbuilder.h"
#include "vr_distort_texture_... |
/**
* Block until the job finishes executing
*
* @return final job status
* @throws JobManagerException if there is an error while waiting for the job to finish
*/
public StatusOutputType waitForCompletion()
throws JobManagerException {
logger.info("called");
super.waitForCompletion();
try... |
package suggest
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/antonjah/leif/internal/pkg/constants"
"github.com/sirupsen/logrus"
)
func GetSuggestion(logger *logrus.Logger) string {
var words []string
resp, err := http.Get(constants.RandomWordApiURL)
if err != nil {
logger.E... |
package com.dumblthon.messenger.auth.security;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.jose.jwk.KeyUse;
import com.nimbusds.jose.jwk.RSAKey;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import o... |
/*******************************************************************************
*
* Function avdt_msg_bld_reconfig_cmd
*
* Description This message building function builds a reconfiguration
* command message.
*
*
* Returns void.
*
**************************************... |
// Copyright (c) 2019 Uber 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 applicable law o... |
/**this class creates the central panel in which the game is played.
*
*
*/
class guiPanel extends JPanel implements Runnable{
Main_Deck md;
player_deck pl1,pl2;
compPlay cp;
cardArraylist cal;
Image img;
ImageIcon iic;
Thread t;
boolean gameOn=true,playerturn=true;
... |
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.favicon;
import android.graphics.Bitmap;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.ch... |
package org.fisco.bcos.channel.client;
import static org.fisco.bcos.web3j.abi.Utils.typeMap;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Semaphore;
import org.fisco.bcos.web3j.abi.FunctionReturnDecoder;
import org.fisco.bcos.web3... |
def create_complex_formation(self, verbose=True):
formation_id = "formation_" + self.id
if formation_id in self._model.reactions:
raise ValueError("reaction %s already in model" % formation_id)
formation = ComplexFormation(formation_id)
formation.complex_data_id = self.id
... |
Proposal for a smart city index for municipalities in Argentina
The development of smart cities has yielded into a desirable objective among many cities around the world. International indexes of smart cities focus on large urban cities without interest on intermediate cities of developing countries. This paper preten... |
<filename>TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/Power_Blue_Pos1_Storage.java
package org.firstinspires.ftc.teamcode.autonomous;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.eventloop.opmode.L... |
use std::{
io::{self, Read},
net::SocketAddr,
};
pub use hazel::*;
pub use netobjects::*;
pub use objects::*;
pub use packets::*;
use crate::reader::{Deserialize, PacketRead, PacketReader};
mod hazel;
mod netobjects;
mod objects;
mod packets;
impl Deserialize for SocketAddr {
fn deserialize<T: PacketRea... |
def _rsync(self, sources, dest, key, port=22, login=None):
def generateUniq(name):
import time
epoch = int(time.time())
return "%s__%s" % (epoch, name)
sourcelist = list()
if dest.find(":") != -1:
dest = dest if dest.endswith("/") else dest + "/"
... |
/**
* Created by Administrator on 2014/10/13.
*/
public class VideoMainActivity extends BaseFragmentActivity {
private PagerSlidingTabStrip tabs;
private ViewPager pager;
private TabPagerAdapter adapter;
public List<Fragment> fragments = new ArrayList<Fragment>();
@Override
public ... |
class Receptacle:
'''
A class that stores various ingredients
'''
def __init__(self, name):
self.name = name
self.ingredients = []
def add(self, ingredient):
self.ingredients.append(ingredient)
recipe_maker.add_ingredient(self, ingredient)
def remove_ingred... |
/*
ardubson.h - Library for the BSON (Binary-JSON) format.
Created by <NAME> (argandas), April 6, 2016.
Released into the public domain.
*/
#include "ardubson.h"
// Constructor /////////////////////////////////////////////////////////////////
BSONObject::BSONObject(char *data)
{
uint32_t size = 0;
memcpy... |
Astronomical events are always one of the most fascinating events for everyone. This time a rare lunar eclipse is going to occur on night of 27 September 2015. You must be thinking that lunar eclipse happens many times a year than what is so special about this one. This lunar eclipse is coinciding with one more astrono... |
def dcount(n):
cnt=0;
while n>0:
n=int(n/10)
cnt+=1
return cnt
w,m,k=raw_input().split()
w=int(w)
m=int(m)
k=int(k)
d=dcount(m)
ten=1
for i in range(d):
ten*=10
cnt=0
while w>(ten-m)*d*k:
cnt+=ten-m
w-=(ten-m)*d*k
d+=1
m=ten
ten*=10
cnt+=w... |
Predictions for reverberating spectral line from a newly formed black hole accretion disk: case of tidal disruption flares
Tidal Disruption Events (TDEs) can be perfect probes of dormant SMBHs in normal galaxies. During the rising phase, the accretion luminosity can increase by orders of magnitude in several weeks and... |
/**************************************************************************/
/**
* Free a vNIC Use.
*
* Free off the ::MEASUREMENT_VNIC_USE supplied. Will free all the contained
* allocated memory.
*
* @note It does not free the vNIC Use itself, since that may be part of a
* larger structure.
*****************... |
def logp(value, mu):
lam = at.inv(mu)
return bound(
at.log(lam) - lam * value,
value >= 0,
lam > 0,
) |
/**
* @func Initialize the RFID subsystem
*
* @todo Move this routine into new nfc.c/h module and get rid of extra layers
*/
void initRFID(void) {
#ifdef _15693_1of256
initialize_1outof256();
initialize_15693_protocol();
initialize_hdr();
#else
initialize_14443_B_protocol();
initialize_nfc_wisp_protocol();... |
/*
Attempt1: Lintcode 83% correct, but Does not work for : [9876141516171818818181890001988181700198181778786761256512651653145345143, 55]
my output: 1111111134143
expect: 1111111345143
Not sure where went wrong.
Thoughts:
This seems to be: Pick (N - k) digits and make a smallest number, without changing th... |
<filename>towerapi/towerapi.go
package towerapi
import (
"net/http"
"os"
"github.com/mpeter/go-towerapi/towerapi/authtoken"
"github.com/mpeter/go-towerapi/towerapi/credentials"
"github.com/mpeter/go-towerapi/towerapi/errors"
"github.com/mpeter/go-towerapi/towerapi/groups"
"github.com/mpeter/go-towerapi/towera... |
Fourth Industrial Revolution in Japan: Technology to Address Social Challenges
In Japan, the challenges posed by its low birthrate and aging population expanded rapidly with the collapse of the bubble economy in the early 1990s, and in March 2011, energy and environmental problems such as power supply shortages and nu... |
/* +------------------------------------------------------------------------+
| Mobile Robot Programming Toolkit (MRPT) |
| http://www.mrpt.org/ |
| |
| Cop... |
import _ from 'lodash';
import { getPerfCase } from '../cases';
import { createDIV, getSeq, removeDIV, mock } from '../../helper';
import { ChartType, PerfData, PerfDatum, Data, ChangeOption, DataAttributeType } from '../../types';
import { CHART_TYPES } from '../../common/const';
/**
* 运行一个单测
* @param engine 渲染引擎
... |
/**
* Created by nelson on 28/07/15.
*/
public class SortIgnoreCase implements Comparator<String> {
public int compare(String s1, String s2) {
return s1.compareToIgnoreCase(s2);
}
} |
Update: URL Fixer was acquired and is now hosted at http://urlfixer.org/
Earlier this year, I added a feature to URL Fixer (a browser add-on that fixes errors in URLs that you type in the address bar) that collects anonymous usage stats from users who opt in in order to help improve the ways that URL Fixer corrects ty... |
/**
*
* @author Tomas Zezula
*/
final class ModuleFileManager implements JavaFileManager {
private static final Logger LOG = Logger.getLogger(ModuleFileManager.class.getName());
private final CachingArchiveProvider cap;
private final ClassPath modulePath;
private final Function<URL,Collection<? ext... |
export const mapHTML = (name, co2, meat, electro): string =>
`<div class="map-hoverinfo hoverinfo">
<strong class="map-name mb-1 d-block"> ${name} </strong>
<div class="d-flex flex-between">
<div>
<div class="map-co2 bold"> CO2 Emmision: </div>
<d... |
def _retrieve_singular(method: Callable, *args, **kwargs):
kwargs['limit'] = kwargs.get('limit', 2)
results = method(*args, **kwargs)
criteria = '\nargs: {}\nkwargs: {}'.format(args, kwargs)
if len(results) == 0:
raise NotFoundError("No {} fit criteria:{}".format(method.__nam... |
“Slow” marine animals show their secret life under high magnification. Corals and sponges build coral reefs and play crucial roles in the biosphere, yet we know almost nothing about their daily lives. These animals are actually very mobile creatures, however their motion is only detectable at different time scales comp... |
/**
* Print the usage for a given command.
*
* @param command a command
*/
private void printUsage(String command)
throws RecognitionException, TokenStreamException {
client.printUsage(command);
skip();
} |
<reponame>iron-tech-space/react-tech-design
export default FormTable;
declare const FormTable: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
import React from "react";
|
package dao
import (
"encoding/json"
"github.com/pourer/pikamgr/utils/log"
)
func jsonEncode(flag string, v interface{}) []byte {
data, err := json.MarshalIndent(v, "", " ")
if err != nil {
log.Panicln("encode to json failed. flag:", flag, "err:", err)
}
return data
}
func jsonDecode(flag string, v inter... |
use std::collections::BTreeMap as Map;
use std::env;
use structopt::StructOpt;
use tagsearch::{
filter::Filter,
utility::{get_files, get_tags_for_file},
};
mod budgetitem;
use budgetitem::BudgetItem;
type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
#[derive(Debug, StructOpt... |
Indonesia returned to Mozambique after a lengthy absence and came away with a long list of items to pursue in an effort to reinvigorate a sluggish bilateral partnership across various sectors.
Foreign Minister Retno LP Marsudi ended her first tour of the African continent this year by flying into the Mozambique capita... |
def autostart_pools(cls):
cls.pool_lock.acquire()
try:
for inst in XendAPIStore.get_all(cls.getClass()):
if inst.is_managed() and inst.auto_power_on and \
inst.query_pool_id() == None:
inst.activate()
finally:
cls.poo... |
<filename>third_party/virtualbox/src/VBox/Main/src-client/win/precomp_vcc.h
/* $Id: precomp_vcc.h $ */
/** @file
* VirtualBox COM - Visual C++ precompiled header for VBoxC.
*/
/*
* Copyright (C) 2006-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http:/... |
import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Char8 as C
readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt
main = do
[n] <- readLnInt
s <- getLine
putStr $ solve n s
solve n s
| (length s) <= n = s
| otherwise =... |
package main
import (
"net/http"
"github.com/go-chi/chi"
"github.com/pieterclaerhout/go-log/versioninfo"
"github.com/pieterclaerhout/go-webserver/v2/binder"
"github.com/pieterclaerhout/go-webserver/v2/respond"
"github.com/pkg/errors"
)
// SampleApp defines a sample web application
type SampleApp struct {
}
//... |
<filename>authentication/urls.py<gh_stars>0
from django.urls import path
from .views import CustomObtainTokenPairAPIView, CustomTokenRefreshAPIView
urlpatterns = [
path("", CustomObtainTokenPairAPIView.as_view(), name="token_create"),
path("refresh/", CustomTokenRefreshAPIView.as_view(), name="token_refresh")... |
/**
* Append lines to FTP.
* @param ftp FTP client
* @param lines Lines to append
* @throws IOException If some I/O problem inside
*/
@RetryOnFailure(verbose = false)
private void append(final FTPClient ftp, final Iterable<String> lines)
throws IOException {
final String nam... |
def open(self):
if self._shell_channel is None:
self._debug('connecting to {}'.format(self))
transport = self.ssh_client.get_transport()
if transport is None:
self.ssh_client.connect(self.host, username=self.username, password=self.password)
tr... |
<filename>scripts/migration/migrate_confirmed_user_emails.py
"""Ensure that confirmed users' usernames are included in their emails field.
"""
import logging
import sys
from modularodm import Q
from website import models
from website.app import init_app
from scripts import utils as scripts_utils
logger = logging.g... |
/**
* Adds one or more style names to the suggestion. Multiple styles can be
* specified as a space-separated list of style names. The style name will
* be rendered as a HTML class name, which can be used in a CSS definition.
*
* @param styleName The new style to be added to the suggestion.
... |
// SendDataByDeviceID sends data to specific device id
func (s *Server) SendDataByDeviceID(deviceID string, data []byte) error {
for k := range s.connections {
if s.connections[k].DeviceID == deviceID {
return s.connections[k].Send(data)
}
}
return errors.New(fmt.Sprint("no connection with deviceID ", deviceI... |
RF Electromagnetic Field Treatment of Tetragonal Kesterite CZTSSe Light Absorbers
In this work, we propose a method to improve electro-optical and structural parameters of light-absorbing kesterite materials. It relies on the application of weak power hydrogen plasma discharges using electromagnetic field of radio fre... |
import math
from typing import Dict, List, Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import options, utils
from fairseq.modules import (
# MultiheadAttention,
LayerNorm
)
from torch import Tensor
from .multihead_attention import MultiheadAttention
DEFAULT_MAX_... |
Every day, more than 5,000 people commute to and from Wallacedene, a small settlement on the eastern edge of Cape Town. But you won't find it on official transit maps. It's simply a stop in the South African city's sprawling informal taxi network of more than 7,500 unregulated minibuses that shuttle people between the ... |
// Dependencies
import chalk from './chalk';
import fs from 'fs';
import path from 'path';
import Fuse from 'fuse.js';
import ErrorWithoutStack from './error-without-stack';
import { AppInformation, CommandSpec, InputObject, OrganizedArguments, Settings } from './types';
// Helpful utility functions
export default fun... |
/*!
* \brief Get the current value of a sensor and log it in the xLogsQueue.
*
* \param SensorId The sensor id of the sensor to get the value from.
*/
void v_datalog_AddSensorLog( eLogSourceId SensorId )
{
xLogDef *pxLog;
uxNbMsgsInLogsQueue = uxQueueMessagesWaiting( xLogsQueue );
if( DATA... |
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { DiffPageRoutingModule } from './diff-routing.module';
import { DiffPage } from './diff.page';
@NgModule({
imports: [CommonModule, IonicModule, DiffPageRoutingModule],
decla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.