text stringlengths 1 1.05M |
|---|
package com.smallcake.utils;
import android.content.Context;
import java.util.Timer;
import java.util.TimerTask;
/**
* 接受三种类型的msg
* String ,int ,CharSequence
* T改为ToastUtil避免和泛型T冲突
*/
public class ToastUtil {
private ToastUtil() {
/* cannot be instantiated */
throw new UnsupportedOperationEx... |
package com.lilarcor.popularmovies.framework.foundation.network.contracts;
import android.support.annotation.NonNull;
/**
* Created by <NAME> on 12/07/15.
*
* This contract provides methods to do basic network request
* operations, and offers response caching configured on a per
* request basis.
*
*/
public in... |
<filename>src/errors/CXImplicationError.java
package errors;
import tree.TreeNode;
public class CXImplicationError extends CXError {
/**
*
*/
private static final long serialVersionUID = 4960599050470044576L;
public CXImplicationError(String string, TreeNode node) {
super(string, node);
// TODO Auto-gen... |
/*
*
*/
package net.community.chest.javaagent.dumper.ui.tree;
import net.community.chest.javaagent.dumper.ui.data.SelectiblePackageInfo;
/**
* <P>Copyright as per GPLv2</P>
* @author <NAME>.
* @since Aug 14, 2011 1:13:56 PM
*/
public class PackageNode extends AbstractInfoNode<SelectiblePackageInfo> {
privat... |
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UserModule } from './modules/user/user.module';
import { OrmModule } from './modules/orm/orm.module';
import { UserProfileModule } from './modules/user-profile/user-profile.mod... |
<filename>core/c/tests/font_tests.c<gh_stars>1-10
#include <flowi_core/font.h>
#include "../src/atlas.h"
#include "../src/font_private.h"
#include "../src/internal.h"
#include "utest.h"
struct FlContext;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////... |
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
int max;
scanf("%d", &max);
for (int i = 2; i <= max; i++) {
bool prime = true;
for (int j = 2; j < i; j++) {
if (i % j == 0) {
prime = false;
break;
}
}
if (prime) {
NSLog(@"%d", i)... |
<gh_stars>0
import Cesium from "cesium";
import createCesiumComponent, { EventkeyMap } from "./core/CesiumComponent";
export interface CzmlDataSourceCesiumProps {
clustering?: Cesium.EntityCluster;
}
export interface CzmlDataSourceCesiumReadonlyProps {
name?: string;
}
export interface CzmlDataSourceCesiumEvent... |
import { withIcon } from "../withIcon";
import { ReactComponent as Icon } from "./chevron-left.svg";
export const IconChevronLeft = withIcon(Icon);
|
package com.home.demo.config;
import javax.sql.DataSource;
import org.flowable.engine.HistoryService;
import org.flowable.engine.IdentityService;
import org.flowable.engine.ManagementService;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.Re... |
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
# just open four new windows and set name to each
require 'screen'
Screen('Beatles') {
['John', 'Paul', 'George', 'Ringo'].each {|member|
window(member)
}
}
|
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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... |
#!/bin/bash
set -e
set -x
#
# Copyright 2017 Goldman Sachs.
# 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... |
package com.professorvennie.bronzeage.client.gui;
import com.professorvennie.bronzeage.BronzeAge;
import com.professorvennie.bronzeage.api.enums.RedstoneMode;
import com.professorvennie.bronzeage.client.gui.buttons.GuiButtonRedStone;
import com.professorvennie.bronzeage.core.network.MessageButton;
import com.professor... |
<gh_stars>0
class CapaMapaTiles {
constructor(datosCapa, indiceZ, anchoTiles, altoTiles, paletasSprites) {
this.anchoEnTiles = parseInt(datosCapa.width);
this.altoEnTiles = parseInt(datosCapa.height);
this.x = parseInt(datosCapa.x)
this.y = parseInt(datosCapa.y)
this.z = indi... |
<gh_stars>0
package HexaGhost;
import java.util.concurrent.ThreadLocalRandom;
import Model.Cell;
public class HGDefense implements HGStrategy{
private HexaGhost hexaghost;
public HGDefense(HexaGhost hexaghost) {
this.hexaghost = hexaghost;
}
@Override
public Cell play() {
Cell cell = null;
int cValue ... |
sudo gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/home/ixiaadmin/git/kiflashcore/src -c /home/ixiaadmin/git/kiflash/kiflashcore/src/pcimem.c -o build/pcimem.o
sudo gcc -pthread -fPIC -fn... |
<reponame>billionare/FPSLighting
//--------------------------------------------------------------------------------------
// File: DDSWithoutD3DX9.cpp
//
// Illustrates loading a DDS file without using D3DX
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------... |
<reponame>seidu626/vumi
from twisted.internet.defer import inlineCallbacks
from vumi.tests.helpers import VumiTestCase
from vumi.application.tests.helpers import ApplicationHelper
from vumi.demos.calculator import CalculatorApp
from vumi.message import TransportUserMessage
class TestCalculatorApp(VumiTestCase):
... |
#!/bin/bash
dieharder -d 11 -g 203 -S 2328956153
|
#!/usr/bin/env bash
# nbdkit
# Copyright (C) 2017 Red Hat Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... |
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
#!/bin/bash
python -c "from optimade.server.main import app, update_schema; update_schema(app)"
python -c "from optimade.server.main_index import app, update_schema; update_schema(app)"
diff=$(jsondiff ./openapi/openapi.json ./openapi/local_openapi.json);
index_diff=$(jsondiff ./openapi/index_openapi.json ./openapi/lo... |
#!/bin/sh
set -ex
git init
git remote add origin git@github.com:{{ cookiecutter.github_org }}/{{ cookiecutter.github_project }}.git
git config user.name "{{ cookiecutter.full_name }}"
git config user.email "{{ cookiecutter.email }}"
|
<filename>src/SplayLibrary/Core/DefaultFramebuffer.cpp<gh_stars>1-10
#include <SplayLibrary/SplayLibrary.hpp>
#include <SplayLibrary/Private/Private.hpp>
namespace spl
{
DefaultFramebuffer::DefaultFramebuffer(Window* window) : Framebuffer(window)
{
}
}
|
<gh_stars>0
package com.biachacon.tasks.resources;
import com.biachacon.tasks.domains.Task;
import com.biachacon.tasks.services.TaskService;
import java.util.List;
import java.net.URI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframew... |
var structarm__cfft__instance__q15 =
[
[ "bitRevLength", "structarm__cfft__instance__q15.html#a738907cf34bdbbaf724414ac2decbc3c", null ],
[ "fftLen", "structarm__cfft__instance__q15.html#a5f9e1d3a8c127ee323b5e6929aeb90df", null ],
[ "pBitRevTable", "structarm__cfft__instance__q15.html#ac9160b80243b99a0b6e2f... |
<reponame>mrako/simple-weather-frontend
module.exports = require('babel-jest').createTransformer({
presets: [
'@babel/preset-react',
['@babel/env', { targets: { node: 'current' } }],
],
});
|
python3 predict.py --input_file data/viatis/test/seq.in \
--output_file predictions.txt \
--model_dir viatis_phobert_crf_attn/4e-5/0.15
|
require 'httparty'
require_relative 'amplitude/errors/amplitude_error'
require_relative 'amplitude/errors/action_error'
require_relative 'amplitude/errors/authentication_error'
require_relative 'amplitude/client'
module Amplitude
DEFAULT_FIELDS = %w(id name totalSize)
PRIORITIZATION_ACTIONS = %w(up down top bottom... |
ICON=$HOME/.config/i3/images/icon.png
TMPBG=/tmp/screen.png
scrot /tmp/screen.png
convert $TMPBG -scale 10% -scale 1000% $TMPBG
convert $TMPBG $ICON -gravity center -composite -matte $TMPBG
i3lock -u -i $TMPBG
rm $TMPBG
|
<reponame>a-type/react-layout
export { default as Content } from './Content';
export { Provider, Consumer } from './Context';
export { default as Grid } from './Grid';
|
#!/bin/bash
set -e
aflVersion=2.52b
# Download and extract the afl-fuzz source package
wget https://lcamtuf.coredump.cx/afl/releases/afl-"$aflVersion".tgz
tar -xvf afl-"$aflVersion".tgz
rm afl-"$aflVersion".tgz
cd afl-"$aflVersion"/
# Patch afl-fuzz so that it doesn't check whether the binary
# being fuzzed is ins... |
<filename>word-level-language-id/train.py
# -*- coding: utf-8 -*-
from LanguageModel import LanguageModel
ngram = 2
# Language codes
fr = 'ga'
en = 'en'
# Language model files.
fr_lm_fn = 'word-level-language-id/models/ga.lm'
en_lm_fn = 'word-level-language-id/models/en.lm'
# Unigram frequency lexicons.
fr_lex = '... |
def calculate_expected_shape(input_dims, group_size):
grouped_points_shape = {
'features': (8, 256, group_size, input_dims),
'points': (8, 256, group_size, 3),
'padding': (8, 256, group_size)
}
query_points_shape = {
'points': (8, 256, 3),
'padding': (8, 256)
}
... |
#!/bin/bash
#
# Minimal example for deploying latest built 'Ansible Service Broker'
# on oc cluster up
#
#
# We deploy oc cluster up with an explicit hostname and routing suffix
# so that pods can access routes internally.
#
# For example, we need to register the ansible service broker route to
# the service catalog... |
import {shouldLockSubmitBtnByControl} from '@control-handlers/submit-btn-lock-handler'
import {getInitFormDataSingleControl} from "@mock-functions/get-initialized-full-form";
import {ControlProps, CurrentControlData} from "@common-types";
describe('set-lock-submit-validator-result find, should lock submit btn', () =... |
#!/usr/bin/env bash
python -m batch_runner.plot_batch \
--root_dir ~/tlio_data/CoyoteDataset \
--data_list ~/tlio_data/CoyoteDataset/test.txt \
--runname_globbing "*" \
--filter_dir ../../../tlio_data/CoyoteDataset \
--ronin_dir ../../../tlio_data/CoyoteDataset \ |
import nibabel as nib
import numpy as np
def process_and_save_nifti_image(img, new_file_name):
# Extract the image data from the input NIfTI image
img_data = np.squeeze(img.dataobj)
affine_matrix = img.affine
# Create a new NIfTI image using the extracted data and the affine transformation matrix
... |
class ProjectCreationRequest {
constructor(projectName, requester, creationDate) {
this.projectName = projectName;
this.requester = requester;
this.creationDate = creationDate;
this.status = "pending";
}
approveRequest() {
this.status = "approved";
}
rejectRequest() {
this.status = "... |
import { renderFile } from 'ejs';
import { promises as fs } from 'fs';
import { resolve } from 'path';
import { Schema, SchemaValue, SchemaValueProperties } from './builder';
import logger from './logger';
export enum FORMAT_TYPE {
FLOW = 'flow',
TS = 'ts'
}
interface AccumulatedExtras {
exportTypes: Array<{ n... |
require('habitat').load();
require('newrelic');
var Hoek = require('hoek');
var options = {
host: process.env.HOST,
port: process.env.PORT,
loginAPI: process.env.LOGINAPI,
oauth_clients: process.env.OAUTH_DB ? JSON.parse(process.env.OAUTH_DB) : [],
authCodes: process.env.AUTH_CODES ? JSON.parse(process.env.... |
def factorial(num):
product = 1
for i in range(1,num+1):
product *= i
return product |
<filename>PC4problemasdiversos-problema2.py<gh_stars>0
#1
n = int(input('Introduce un numero entero entre el 1 y el 10: '))
file_name = 'tabla-' + str(n) + '.txt'
f = open(file_name, 'w')
for i in range(1,11):
f.write(str(n) + 'x' + str(i) + ' = ' + str(n * i) + '\n')
f.close()
#2
n = int(input('Introduce... |
<reponame>stevengreens10/x86Disassembler
#include <iostream>
#include "InstructionStream.h"
#include "Disassembler.h"
Instruction InstructionStream::next() {
auto stream = m_stream + m_numBytesConsumed;
uint8_t opcode = stream[0];
uint8_t modrm = stream[1];
int numBytesConsumed = 1;
Instruction in... |
<reponame>tm3cheun/tm3cheun
'use strict';
// Declare app level module which depends on views, and components
var app = angular.module('myApp', [
'ngRoute',
'myApp.home',
'myApp.photography',
'myApp.gallery',
'myApp.project',
'myApp.projects',
'myApp.version'
]);
app.config(['$locationProvider', '$route... |
#! /bin/bash
set -e #abort on first command returning a failure
source_net=10.0.0.0/24
source_bridge=bridge43
dest_net=10.42.42.0/24
dest_bridge=bridge44
dest_gateway=10.42.42.2
if1=tap0
if2=tap1
export NSNAME="server1"
shopt -s expand_aliases
alias server1="sudo ip netns exec $NSNAME"
setup() {
# Create veth lin... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Field, change, touch, formValueSelector } from 'redux-form';
import { connect } from 'react-redux';
import { toDatePrettyPrint } from '@navikt/digisyfo-npm';
import cn from 'classnames';
import MaskedInput from 'react-maskedinput';
i... |
<filename>src/components/Search/index.tsx
import { useState } from "react";
import { useSearch} from "../../hooks/useSearch"
import { SearchBar, SwitchButton, Container} from "./styles";
export function Search() {
const search = useSearch();
const [content, setContent] = useState("");
return(
... |
/* GENERATED FILE */
import { html, svg, define } from "hybrids";
const PhDiceTwo = {
color: "currentColor",
size: "1em",
weight: "regular",
mirrored: false,
render: ({ color, size, weight, mirrored }) => html`
<svg
xmlns="http://www.w3.org/2000/svg"
width="${size}"
height="${size}"
... |
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the... |
#!/usr/bin/env bash
set -x
# outputs
output_dir="s3.bcf-base-image-ubuntu-version"
mkdir -p ${output_dir}
BASE_IMAGE_VERSION=`cat git.bosh-linux-stemcell-builder/bosh-stemcell/image-metalinks/ubuntu-${UBUNTU_REL}.meta4 | grep -E "<url>|versionId=" | sed -e "s/.*versionId=//;s/<\/url>.*//"`
BASE_IMAGE_VERSION_SHORT=${... |
package sentry
import "strings"
// ErrType represents an error which may contain hierarchical error information.
type ErrType string
// IsInstance will tell you whether a given error is an instance
// of this ErrType
func (e ErrType) IsInstance(err error) bool {
return strings.Contains(err.Error(), string... |
'use strict';
exports.__esModule = true;
exports.xcodeprojLoader = exports.nibLoader = exports.commandResourceLoader = undefined;
var _path = require('path');
var _path2 = _interopRequireDefault(_path);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const WEBPACK_DI... |
#!/bin/bash
dieharder -d 203 -g 7 -S 2493541151
|
#!/bin/bash
if [ $# != 1 ]
then
echo "Arg 1 must be an environment (host list etc.....)"
exit
else
SERVER=$1
echo "$SERVER"
fi
for i in `cat $SERVER`
do
echo $i
echo
scp -rp dis_rservices.sh dis_services $i:
ssh $i -C " sh dis_rservices.sh "
ssh $i -C " chkconfig | grep 3:on "
ssh $i -C... |
<reponame>JLLeitschuh/datasift-java<gh_stars>10-100
package com.datasift.client.pylon;
import com.datasift.client.DataSiftApiClient;
import com.datasift.client.DataSiftConfig;
import com.datasift.client.FutureData;
import com.datasift.client.ParamBuilder;
import com.fasterxml.jackson.core.JsonProcessingException;
impo... |
package com.cupshe.restclient.lang;
import java.lang.annotation.*;
/**
* HttpsSupported
* <p>Marking this annotation will send an HTTPS request.
*
* @author zxy
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface HttpsSupported {
//------------... |
<reponame>RiyaGupta89/project-zone
import React,{useState} from 'react';
import { useDataLayerValues } from "../../datalayer";
import { ToastContainer, toast } from 'react-toastify';
import { sendmessage } from './../../axios/instance';
import ParticlesBg from 'particles-bg';
import './contactus.css';
export default f... |
<filename>spec/specs.js
describe("Ticket",function(){
it("creates a ticket that specifies movie title, time, and user's age based on input", function() {
var testTicket = new Ticket("Trainspotting", "5:00", 34, 1)
expect(testTicket.titlee).to.equal("Trainspotting");
expect(testTicket.time).to.equal("5:00"... |
package junit;
import static org.junit.jupiter.api.Assertions.*;
import java.util.Random;
import org.junit.jupiter.api.Test;
import main.MyString1;
/**
* @author <NAME>
*
*/
public class MyString1Test
{
Random random = new Random();
final char[] myString = {'J', 'a', 'v', 'a'};
final MyString1 myString1 = ne... |
package data.objects;
import engine.CONST;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
public class Activity {
/* Highest ID loaded in the memory */
private static int highestID = -1;
private static boolean highestIDEnabled = false;
private int id;
p... |
SELECT jobtitle, AVG(salary)
FROM table
GROUP BY jobtitle; |
import cPickle
model=cPickle.load(open('lstm_tanh_relu_[1468202263.38]_2_0.610.p'))
cPickle.dump(model,open('model.bin.nlg','wb')) |
#!/bin/bash
# this script is ment to run all possible modes of SPM/SPMT with the
# interpreter passed to this script to check if they (at least) do not trow
# some runtime exception, poor man test-suite. SPM/SPMT do not have to be
# installed but their runtime dependencies must be. if it fails it does no
# cleanup! al... |
#!/bin/bash
if [[ $# -lt 2 ]]; then
echo "Usage ./sshbrute.sh <IP> <ETHSPLOITER_PATH>"
exit 1
fi
VICTIM_IP=$1
ETHSPLOITER_PATH=$2
HYDRA_OUT=/tmp/hydra_out
hydra -L $ETHSPLOITER_PATH/exploits/multi/ssh/login/user -P $ETHSPLOITER_PATH/exploits/multi/ssh/login/pass ssh://$VICTIM_IP -o $HYDRA_OUT
PASS_FOUND=`cat $H... |
/**
* Copyright 2014 Transmode 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 required by applicable law or agreed t... |
#!/usr/bin/env bash
#
# This script builds the application from source for multiple platforms.
set -e
export CGO_ENABLED=0
# Determine the Arch/OS combos we're building for
echo "==> Determining Arch/OS Info..."
XC_ARCH=${XC_ARCH:-"386 amd64 arm"}
XC_OS=${XC_OS:-"darwin freebsd linux"}
# Get Git Commit information
e... |
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Generate route injection code.
OUTPUT_PKG="github.com/openshift-knative/knative-serving-networking-openshift/pkg/client/openshift/injection" \
VERSIONED_CLIENTSET_PKG="github.com/openshift/client-go/route/clientset/versioned" \
EXTERNAL_INFORMER_PKG=... |
function findMedian($arr_numbers)
{
sort($arr_numbers);
$totalElements = count($arr_numbers);
if ($totalElements % 2 == 0)
{
return ($arr_numbers[$totalElements / 2] +
$arr_numbers[$totalElements / 2 - 1]) / 2;
}
else
{
return $arr_numbers[$total... |
#!/bin/sh -l
set -e
module purge
source /etc/profile
source /etc/profile.d/modules.sh
module unload mpi.intel
module load gcc/7
module load mpi.ompi/2.0/gcc
#module load hdf5/mpi/1.8.17_gcc
# OMPI="/opt/rrzk/lib/openmpi/2.1.1/gcc/bin"
#
# export CC="${OMPI}/mpicc"
# export CXX="${OMPI}/mpicc"
# export FC="${OMPI}... |
class PhotoInAlbum < ApplicationRecord
self.table_name = 'photos_in_albums'
belongs_to :photo, inverse_of: :photo_in_albums
belongs_to :album, inverse_of: :photo_in_albums
validates :photo, :album, presence: true
validates :photo, uniqueness: {scope: :album, message: "is already in this album"}
validates :... |
def normalize_lines(response_list):
# Normalize Lines - return (int)
lines = [s for s in response_list if "line" in s]
lines = [int(s) for s in str(lines).split() if s.isdigit()]
try:
lines = int(lines[0])
except IndexError:
lines = 0
return lines
def convert_to_bytes(size, siz... |
<gh_stars>1-10
//https://www.hackerrank.com/challenges/candies
long d[100001];
long candies(int n, vector<int> arr)
{
d[0] = 1;
long sum = 0;
int count = 1;
//왼쪽 -> 오른쪽
for (int i = 1; i < n; i++)
{
if (arr[i] > arr[i - 1])
{
count++;
}
else if (arr[i] <= arr[i - 1])
{
count = 1;
}
d[i] = coun... |
<gh_stars>10-100
package com.ulfy.master.ui.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import com.ulfy.android.mvvm.IViewModel;
import com.ulfy.android.ui_injection.Layout;
import com.ulfy.android.ui_injection.ViewById;
import com.... |
const terminalConfiguration = {
terminalCheckInterval:100,
terminalSendInterval:200,
baseReservedEnergy:30000,
baseReservedMineral:10000,
mineralDistributeMinAmount:2500,
sellingEnergy:{
"W22N25":0,
"W23N25":0,
"W21N24":0,
"W19N22":0,
"W18N22":0
},
... |
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
./configure \
"--prefix=${PREFIX}" \
"--with-systemdsystemunitdir=${PREFIX}/lib/systemd/system" \
--disable-python \
--disable-perl \
--disable-ruby \
--disable-lua \
--disable-tcl \
--disable-docs
make "-j${CPU_COUNT}"
XFAIL_TESTS=""
... |
from LightPipes import *
wavelength = 500*nm
size = 25*mm
N = 500
F = Begin(size, wavelength, N)
F = CircAperture(F, 2*mm, x_shift = 5*mm, y_shift = 3*mm)
F = Fresnel(F, 10*m)
Xc,Yc, NXc, NYc = Centroid(F)
print("Xc = {:4.2f} mm, Yc = {:4.2f} mm".format(Xc/mm, Yc/mm))
|
<reponame>sillyhong/whongjiagou-learn<filename>50.safe/src/server.js
const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
var svgCaptcha = require('svg-captcha');
const app = express();
app.use(bodyParser.json());
app... |
# To allow update OS version
kubectl drain <Node name>
# To allow non-scheduling
kubectl cordon <Node name>
# To allow uncordon
kubectl uncordon <Node name>
Version 1.10 1.11 1.12
=> api-server: 1.11
=> scheduler + controler: 1.10 1.11
=> kube proxy + kubelet: 1.10 1.11
=> kubectl: 1.11 1.12 |
/*
* Copyright (C) 2012-2014 <NAME>
*
* 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 agree... |
TERMUX_PKG_HOMEPAGE=https://github.com/jtyr/gbt
TERMUX_PKG_DESCRIPTION="Highly configurable prompt builder for Bash and ZSH written in Go"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.0.0
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/jtyr/gbt/archive/v${TERMUX_PKG_VERSION}.... |
<reponame>fr1t2/docusign-node-client
/**
* DocuSign REST API
* The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
*
* OpenAPI spec version: v2.1
* Contact: <EMAIL>
*
* NOTE: This class is auto generated. Do not edit the class manually and su... |
/*
* dbtype_PropertyDataSerializer.cpp
*/
#include "dbtypes/dbtype_PropertyDataSerializer.h"
namespace mutgos
{
namespace dbtype
{
// ----------------------------------------------------------------------
PropertyDataSerializer::PropertyDataSerializer()
{
}
// ----------------------------------... |
#!/bin/bash
# Use https://developers.google.com/closure/compiler/ to compile this code.
# Compiler should be available at ../../closure/compiler.jar relative to this build script.
rm -rf WMJS.min.js
java -jar ../../closure/compiler.jar --language_in=ECMASCRIPT6 --language_out ES5_STRICT --process_common_js_modules \
... |
import Typography from "@mui/material/Typography";
import Link from "@mui/material/Link";
import * as React from "react";
export default function Copyright(props) {
return (
<Typography variant="body2" color="text.secondary" align="center" {...props}>
{'Copyright © '}
<Link color="i... |
/*
* %CopyrightBegin%
*
* Copyright Ericsson AB 1999-2009. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
* compliance with the License. You should have received a copy of the
* Erlang Public Lice... |
sed -i '/^<\/body>/e cat ./analytics/analytics-fragment.txt' ./build/index.html |
An array can provide fast search operation, but not fast add/delete operation. A binary search tree provides fast search operation and the add/delete operations are also quite fast. |
<reponame>thushanperera95/Find-My-Phone<gh_stars>1-10
package com.thunderboltsoft.findmyphone.receivers;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import com.thunderboltsoft.findmyphone.activites.FindMyPhoneDialogActivity;
pu... |
package me.mrdaniel.adventuremmo.utils;
import org.spongepowered.api.Server;
import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.util.blockray.BlockRay;
import org.spongepowered.api.util.blockray.B... |
=begin
#RadioManager
#RadioManager
OpenAPI spec version: 2.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.3.0
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for RadioManagerClient::UserResultSettings
# Automatically generated by... |
#!/usr/bin/env bash
port="$1"
echo -n "Waiting for Port: $port "
while ! nc -vz localhost "$port" ; do
echo -n "."
sleep 0.1
done
echo ""
echo "Done!"
|
import { BadRequestException, Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { AddressDto } from './address.dto';
import { Address } from './address.entity';
import * as CeepCoords from 'coordenadas-do-cep';
@Injectable()
export clas... |
import { Component, Input } from '@angular/core';
import { InheritedEnvVarFormElement } from './inherited-env-var-form-element';
@Component({
selector: 'app-inherited-env-vars-form-element',
templateUrl: './inherited-env-vars-form-element.component.html',
styles: [],
})
export class InheritedEnvVarsFormEle... |
import logging
class TextSearchApp:
def __init__(self, timedivider=1000, loglevel='INFO'):
self.timedivider = timedivider
self.loglevel = loglevel
self.logger = None
def setup_logger(self):
log_format = '{relativeCreated:8.2f} s {warningname}| {message}'
logging.basicCo... |
package main
import (
"fmt"
"log"
"os"
"os/signal"
"runtime/debug"
"syscall"
srv "github.com/moooofly/dms-detector/pkg/servitization"
"github.com/moooofly/dms-detector/probe"
"github.com/moooofly/dms-detector/router"
)
func main() {
if err := srv.Init(); err != nil {
log.Fatalf("err : %s", err)
}
go fu... |
class DcTimePresenter
include ActionView::Helpers::TextHelper
NULL = " ".html_safe.freeze
FORMAT = "%B %d, %Y %r".freeze
TIME_ZONE_NAME = 'Eastern Time (US & Canada)'.freeze
attr_reader :time
def initialize(time)
@time = time
end
def self.convert(time)
new(time).convert
end
def sel... |
import React from 'react'
import styled from "styled-components"
import Section from './Section'
function Home() {
return (
<Container>
<Section
title="Model S"
description="Order Online for Touchless Delivery"
backgroundImg="model-s.jpg"
... |
package engine.visualization;
import engine.entities.Entity;
import javafx.scene.Group;
import javafx.scene.control.ChoiceBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Line;
import javafx.scene.text.Text;
import javafx.scene.text.TextBoundsType;
import java.util.Arr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.