text
stringlengths
1
1.05M
/* * */ package net.community.apps.tools.xmlstruct; import java.awt.Component; import java.util.Map; import javax.swing.Icon; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; import net.community.chest.awt.attributes.AttrUtils; import net.community.chest.dom.NodeTypeEnum; import net.commu...
#!/bin/sh PrgName=`basename $0` # Determine absolute path to location from which we are running. export RUN_DIR=`pwd` export PRG_RELPATH=`dirname $0` cd $PRG_RELPATH/. export PRG_PATH=`pwd` cd $RUN_DIR # Create target dir in case not yet created by maven mkdir -p $PRG_PATH/target # Download latest openapi spec from re...
#include "variable.h" namespace Blocks { const string& IntVariable::toString() { if (!updated_) { return to_string_data_; } if (to_string_data_.capacity() < STRMAX_INT32) { to_string_data_.assign('\0', STRMAX_INT32); } snprintf((char *)to_string_data_.mutable_data(), STRMAX_INT32, "%d", data_)...
package org.fabian.csg.scene; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import org.fabian.csg.CSG; import org.fabian.csg.Polygon; import com.jme3.export.InputCapsule; import com.jme3.export.JmeExporter; import com.jme3.export.JmeImp...
<reponame>kellymclaughlin/go-fastly package fastly import "testing" func TestClient_Pools(t *testing.T) { t.Parallel() var err error var tv *Version record(t, "pools/version", func(c *Client) { tv = testVersion(t, c) }) // Create var p *Pool record(t, "pools/create", func(c *Client) { p, err = c.CreateP...
#!/bin/bash ./bin/mp init --provider=gitlab --provider-url=https://git.esoft.tech -f ~/Downloads/repos.txt ./bin/mp clone ./bin/mp plan -b feature/NCRM-10523 -m "Install esoft eslint rules" -- node ~/projects/microplane/t.js ./bin/mp push -a @f.n.makhmudov
<reponame>bpbpublications/Building-Server-side-and-Microservices-with-Go<gh_stars>1-10 package main import "fmt" type Printer interface { Print() } type Point struct { x, y int } func (p Point) Print() { fmt.Printf("(%v, %v)", p.x, p.y) } func main() { p := Point{x: 4, y: 6} p.Print() var i Printer i.Print...
<reponame>jmosro/trazactivo package com.ipec.trazactivo.service; import com.ipec.trazactivo.model.Activo; import com.ipec.trazactivo.model.ActivoPK; import java.util.List; public interface ActivoServiceInterface { public List<Activo> listarTodo(); public void guardar(Activo activo); public void eliminar(A...
<filename>lib/config.js var fs = require('fs'); //assumes the configuration file is one level higher and is called //configuration.json var configurationData = fs.readFileSync(__dirname + "/../configuration.json", 'utf8'); var config = JSON.parse(configurationData); var bunyan = require('bunyan'); var log = bunyan.c...
<reponame>wjtree/wechat-parent package com.app.wechat.domain.receive; import com.thoughtworks.xstream.annotations.XStreamAlias; /** * <p>功 能:自定义菜单跳转url事件数据结构</p> * <p>版 权:Copyright (c) 2017</p> * <p>创建时间:2017年7月7日 下午5:57:25</p> * @author 王建 * @version 1.0 */ public class WxRcvMenuViewEvntDto extends WxRcvMenuEv...
package imagetag import ( "context" "fmt" kapierrors "k8s.io/apimachinery/pkg/api/errors" metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" apirequest "k8s.io/apiserver/pkg/endpoi...
import React from "react" import Layout from "../components/layout" import ArchivePage from "../components/Layouts/ArchivePage" import VideoCard from "../components/Cards/Video/VideoCard.styled" export default ({ pageContext: { allFilms } }) => ( <Layout> <ArchivePage title="Films" items={ (a...
#!/bin/bash # Copyright (C) Microsoft Corporation. All rights reserved.​ # ​ # Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual, # royalty-free right to use, copy, and modify the software code provided by us # ('Software Code'). You may not sublicense the Software Code or any use of it # (exce...
package com.example import akka.actor.{Actor, ActorIdentity, Identify, Props} import akka.event.Logging class MyActor extends Actor { val log = Logging(context.system, this) val identifyId = 1 // 問い合わせ番号 val child = context.actorOf(Props[MyActor2], name = "myChild") var lastSender = context.system.deadLette...
#include <unistd.h> #include <sys/time.h> #include <string.h> #include <stdlib.h> #include <config-core/config_bindings.h> #include <common_utils.h> #include <http-utils/http_client.h> #include "rewrite_core.h" #ifndef __USE_GNU #define __USE_GNU #endif #include <dlfcn.h> #define URI_POSTFIX_AUTOREFRESH_TIMESTAMP "a...
<filename>packages/client/src/features/Events/EventsList/index.ts export * from './EventsList';
#! /usr/bin/env bash deb_ver=4.6.0-beta3 rpm_ver=4.6.0-beta3 wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_${deb_ver}_amd64.deb package_cloud push grafana/testing/debian/jessie grafana_${deb_ver}_amd64.deb package_cloud push grafana/testing/debian/wheezy grafana_${deb_ver}_amd64.deb package...
import { componentTester } from '../../testUtils/componentTester'; const setup = { component: { name: 'viewIntegrations', path: 'sections/view-integrations/macro.njk', }, }; describe('view-integrations', () => { it('should render the integrations section if integrations answer link is provided', compone...
<filename>src/webui/backend/webui/views.py import logbook from flask import Blueprint, send_from_directory, send_file from . import config app_views = Blueprint('app_views', __name__) logger = logbook.Logger(__name__) @app_views.route('/') def index(): return send_file(str(config.BUILD_FOLDER.joinpath('index.h...
<reponame>simplebam/HubRead<gh_stars>10-100 package com.yueyue.readhub.feature.topic.instant; import com.yueyue.readhub.base.BasePresenter; import com.yueyue.readhub.base.mvp.INetworkPresenter; import com.yueyue.readhub.model.InstantReadData; import com.yueyue.readhub.network.ApiService; import com.yueyue.readhub.netw...
<reponame>apulliam/WordAddinAngularTypescript /// <reference path="../typings/tsd.d.ts" /> ((): void => { config.$inject = ["$routeProvider"]; function config($routeProvider: ng.route.IRouteProvider) { // Configure the routes. $routeProvider .when("/home", { templateUrl: "/...
<form> <label>Enter name:</label> <input type="text" name="name" placeholder="Enter your name"> <br><br> <label>Enter last name:</label> <input type="text" name="lname" placeholder="Enter your last name"><br><br> <input type="submit" value="Submit"> </form>
<gh_stars>1-10 /* * stdlib.h -- Standard C library routines. * * by <NAME> * * Copyright 2003-2012 -- See accompanying license * */ #ifndef __cat_stdlib_h #define __cat_stdlib_h #include <cat/cat.h> #include <stdarg.h> /* We use the mem* functions even if we don't use the standard library */ #if !CAT_USE_STDLI...
export function messageToRequest(credentialRequest) { let request if (!credentialRequest || !credentialRequest.message) throw new Error('Invalid request') const message = credentialRequest.message if (message.data.claims.find(c => c.claimType === 'credentialRequest' && c.claimValue === 'cred1')) { const ...
<reponame>toba/goweb // Package content enumerates the HTTP header Content-* keys. package content const ( Encoding = "Content-Encoding" // Length indicates file size in (8-bit) bytes Length = "Content-Length" Type = "Content-Type" )
package club.coding.med.staffpayroll.employees; public abstract class Employee { private String name; private int employeeId; public Employee(String name, int employeeId) { this.name = name; this.employeeId = employeeId; } public abstract double calculatePay(); } public class Ful...
<reponame>extendi/sunspot require 'set' require 'time' require 'date' require 'enumerator' require 'cgi' require 'semantic' begin require 'rsolr' rescue LoadError require 'rubygems' require 'rsolr' end require File.join(File.dirname(__FILE__), 'light_config') %w(util adapters configuration setup composite_setup...
import { Component, OnInit, Input } from '@angular/core'; import { Router } from '@angular/router'; import { AcDataGridModel } from 'svogv'; import { Base } from '../../../viewmodels/base'; /** * A grid component that handles any sort of data decorated with SVOGV decorators. */ @Component({ moduleId: module.id, ...
/* * Copyright 2017 mnn. * * 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 wri...
#!/bin/bash tmp=$(dirname "$0") pushd "$tmp" > /dev/null rm ../compile.js node scripts/cc.js pro && chmod +x ../compile.js popd > /dev/null
# Start docker echo 'Starting docker' sudo docker-compose up -d echo 'Installing dependencies...' sleep 150 # Start Test Cases echo 'Integration test cases:' docker exec -it transport_apis_server_1 npm test test/integrationTest.js echo 'Unit test cases:' docker exec -it transport_apis_server_1 npm test test/unitTes...
const path = require("/shared/path") const guiconsole = require("/src/display/guiconsole") const action = require("/shared/action") module.exports.MouseHandler = function (engine) { this.engine = engine this.dij = undefined this.rate = 160 this.eventParse = (event) => { const [x, y] = engine....
<gh_stars>1-10 // Generated by script, don't edit it please. import createSvgIcon from '../../createSvgIcon'; import ImdbSvg from '@rsuite/icon-font/lib/legacy/Imdb'; const Imdb = createSvgIcon({ as: ImdbSvg, ariaLabel: 'imdb', category: 'legacy', displayName: 'Imdb' }); export default Imdb;
package db import ( "database/sql" "fmt" ) func Connect() { db, err := sql.Open("postgres", getSqlInfo()) if err != nil { panic(err) } defer db.Close() err = db.Ping() if err != nil { panic(err) } fmt.Println("Successfully connected!") createTaskTable := `CREATE TABLE tasks( id SERIAL PRIMARY K...
package com.atjl.retry.eg; public class Cond { private String cond; public Cond(String cond) { this.cond = cond; } public String getCond() { return cond; } public void setCond(String cond) { this.cond = cond; } @Override public Strin...
<reponame>felquis/unit import TextInput from '../../../system/platform/component/value/TextInput/Component' import { Dict } from '../../../types/Dict' import classnames from '../../classnames' import { Element } from '../../element' import parentElement from '../../parentElement' import { NONE } from '../../theme' exp...
def print_odd_numbers(start, end): for i in range(start, end+1): if i % 2 != 0: print(i)
from typing import List from miyu_bot.commands.common.fuzzy_matching import romanize, FuzzyMatcher def find_closest_romanized_match(target: str, string_list: List[str]) -> str: fuzzy_matcher = FuzzyMatcher() target_romanized = romanize(target) closest_match = None min_distance = float('inf') for s...
#!/bin/bash # # This script is run prior to deployment of component Dewey # The working directory of this script is the deployment project folder. # #-------------------------------------------------------------------------- # Code generated by the SmartSoft MDSD Toolchain # The SmartSoft Toolchain has been developed ...
# Use `hub` as our git wrapper: # http://defunkt.github.com/hub/ # # I use JRuby substantially, and we want to make sure hub is run using MRI # regardless of which Ruby you're using or else the `git status` in your prompt # will take seven thousand seconds to run `ls`. # # I'm hardcoding it to an installed rvm (using...
# /bin/sh echo "Building darwin" GOOS=darwin GOARCH=amd64 go build mv "${PWD##*/}" "${PWD##*/}_darwin_amd64" echo "Building linux" GOOS=linux GOARCH=amd64 go build mv "${PWD##*/}" "${PWD##*/}_linux_amd64" GOOS=linux GOARCH=arm go build mv "${PWD##*/}" "${PWD##*/}_linux_arm" GOOS=linux GOARCH=arm64 go build mv "${PWD##...
<filename>src/main/java/io/trillo/example/entity/Task.java package io.trillo.example.entity; /** * This class models a to-do list task. */ public class Task { /* * Represents uid of the task. It is a string in the following format: * <class name>:<uuid>, a random uuid is generated using Java library. *...
var path = require('path'); module.exports = function getResolve(ROOT_PATH) { return { resolve: { modules: [ path.resolve(ROOT_PATH, 'app', 'components'), path.resolve(ROOT_PATH, 'app', 'messages'), path.resolve(ROOT_PATH, '..', 'common'), path.resolve(ROOT_PATH, '...
package edu.washington.cse.instrumentation.analysis; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintStream; import java.io.PrintWriter; import java.util.Collection; import java.util.HashSet; import java.util.Map; import soot.G; import soot.MethodOrMethodContext; import soot.PackManager...
<gh_stars>0 /* * Copyright 2012-2020 the original author or 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
<gh_stars>1-10 package example import ( "fmt" "math/rand" "net" "os" "reflect" "testing" "time" "github.com/stretchr/testify/require" "google.golang.org/grpc" "golang.org/x/net/context" "github.com/arcology-network/consensus-engine/libs/log" tmnet "github.com/arcology-network/consensus-engine/libs/net"...
package GUI.controllers; import GUI.UserHolder; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.ChoiceBox; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import jav...
package main import ( "fmt" "os" "path/filepath" "plugin" ) func check(err error) { if err != nil { panic(err) } } func main() { execPath, err := os.Executable() check(err) pluginPaths, err := filepath.Glob(filepath.Join(filepath.Dir(execPath), "plugins", "*.so")) check(err) for _, pluginPath := range p...
package products.pasta; import java.util.Arrays; public class Carbonara extends Pasta { public Carbonara(){ name = "Carbonara"; price = 23.50; pastaType = PastaType.TAGIATELLE; ingredients = Arrays.asList("bacon", "eggs", "parmesan", "garlic"); } }
const express = require('express'); const cors = require('cors') const helmet = require('helmet'); const userAuthRouter = require('./auth/auth-user-router'); const usersRouter = require('./users/users-router'); const recipeRouter = require('./recipes/recipes-router'); const restricted = require('./middleware/restricted...
function findClosestSum(arr, target) { let minSum = arr[0] + arr[1] + arr[2]; let minSumIndex = [0, 1, 2]; for (let i = 0; i < arr.length; i++) { for (let j = i+1; j < arr.length; j++) { for (let k = j+1; k < arr.length; k++) { const sum = arr[i] + arr[j] + arr[k]; if (Math.abs(target - sum) < Math.abs(target...
#!/bin/bash S3_BUCKET=$1 #Path with trailing / S3_PATH=$2 if [ "${S3_BUCKET}" == "" ]; then echo "Usage: $0 S3_BUCKET [S3_PATH]" echo " where S3_BUCKET is the S3 bucket to upload resources to and S3_PATH is optional path but if specified must have a trailing '/'" exit 1 fi source ./bundle.sh TARGET=s3:...
<reponame>hongdongni/swt-bling<filename>src/test/java/com/readytalk/swt/widgets/notifications/BubbleRegistryTest.java package com.readytalk.swt.widgets.notifications; import org.junit.Assert; import org.junit.Before; import org.eclipse.swt.widgets.Composite; import org.junit.Test; import org.mockito.Mock; import org.m...
export enum MODULES_TYPE { 开关, 开关组, 进度条, 按钮, 按钮组, 图表, }
/* * This file is generated by jOOQ. */ package io.cattle.platform.core.model.tables; import io.cattle.platform.core.model.CattleTable; import io.cattle.platform.core.model.Keys; import io.cattle.platform.core.model.tables.records.StoragePoolRecord; import io.cattle.platform.db.jooq.converter.DataConverter; import i...
#!/usr/bin/env bash # BEGIN subcommand functions VB="virtualbox" VG="vagrant" VM="vagrant-manager" run_vagrant() { echo "[SCIONLabVM] run vagrant" vagrant box add scion/ubuntu-16.04-64-scion vagrant box update vagrant up vagrant ssh } run_osx() { echo "[SCIONLabVM] Given system: OSX" if ...
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var BaseConsoleButton_1 = require("../BaseConsol...
<filename>documentation/manual/javaGuide/main/tests/code/javaguide/tests/MockitoTest.java<gh_stars>1-10 package javaguide.tests; import static org.junit.Assert.*; //#test-mockito-import import static org.mockito.Mockito.*; //#test-mockito-import import java.util.List; import org.junit.Test; public class MockitoTes...
package awx import "fmt" // InventoryUpdateService implements awx inventory_update apis. type InventoryUpdatesService struct { client *Client } // GetInventoryUpdate retrives the inventory_update information from its ID or Name func (i *InventoryUpdatesService) GetInventoryUpdate(id int, params map[string]string) (...
<filename>src/org/sosy_lab/cpachecker/cpa/conditions/path/PathConditionsCPA.java /* * CPAchecker is a tool for configurable software verification. * This file is part of CPAchecker. * * Copyright (C) 2007-2014 <NAME> * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License");...
# SPDX-License-Identifier: Apache-2.0 #set -ev #!/bin/sh function exportVariables(){ # Organization information that you wish to build and deploy export NAME_OF_ORGANIZATION=$NAME_OF_ORGANIZATION export DOMAIN_OF_ORGANIZATION=$DOMAIN_OF_ORGANIZATION export HOST_COMPUTER_IP_ADDRESS=$HOST_COMPUTER_IP_ADDRESS ...
#!/bin/bash # Configuration script for botan 2.15.0 # Library release date: 2020/07/07 export FM_BOTAN_NAME="Botan" export FM_BOTAN_VERSION="2.15.0" export FM_BOTAN_FULL_NAME="${FM_BOTAN_NAME}-${FM_BOTAN_VERSION}" export FM_BOTAN_TARBALL_NAME="${FM_BOTAN_FULL_NAME}.tar.xz" export FM_BOTAN_TARBALL_DOWNLOAD_URL="https:/...
<filename>src/mixins/upload.js export default { methods: { // Allow only if it is a 'File' handleShow (e, allow = () => {}) { if (e.dataTransfer.types.indexOf('Files') < 0) return allow() }, }, }
#!/usr/bin/env python3 #Copyright 2021 <NAME> #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, publish, d...
<filename>plugin/src/com/microsoft/alm/plugin/external/reactive/RdIdeaLoggerFactory.java // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See License.txt in the project root. package com.microsoft.alm.plugin.external.reactive; import com.jetbrains.rd.util.ILoggerFactory; import com....
#!/usr/bin/env bash # prune_daily.sh # Can be run attended or unattended (crontab). # Crontab entry could look like: # 30 0 * * * /path/to/website.com_prune_daily.sh > /dev/null 2>&1 # Ref: https://unix.stackexchange.com/a/678296/501914 # !!! IMPORTANT: Must read through all comments and adjust script as necessary. !...
#!/bin/bash # Always exit on errors. set -e # Run a clean up when we exit if configured to do so. trap cleanup TERM function cleanup { if [ "$MULTUS_CLEANUP_CONFIG_ON_EXIT" == "true" ]; then CONF=$(cat <<-EOF {Multus configuration intentionally invalidated to prevent pods from being scheduled.} EOF ...
$('.navbar-collapse a').click(function(){ $(".navbar-collapse").collapse('hide'); }); $(document).click(function (event) { let clickover = $(event.target); let $navbar = $('.navbar-collapse'); let _opened = $navbar.hasClass('show'); if (_opened === true && !clickover.hasClass('navbar...
import uniq from 'lodash/uniq' import groupBy from 'lodash/groupBy' import flatten from 'lodash/flatten' import filter from 'lodash/filter' export function findDuplicates(array) { return uniq( flatten( filter( groupBy(array), n => n.length > 1))) }
parallel --jobs 5 < ./results/exp_lustre/run-0/lustre_8n_6t_6d_1000f_617m_5i/jobs/jobs_n0.txt
<filename>src/main/scala/esp/Annotations.scala // Copyright 2018-2019 IBM // // 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...
#! /bin/sh ### BEGIN INIT INFO # Provides: Ultra96 power button monitoring script # Required-Start: # Required-Stop: # Default-Start:S # Default-Stop: # Short-Description: Monitors the power button and powers off the board # Description: This script runs a utility that monitors GPIO pin 364 and # ...
public class MyClass { public static void main(String[] args) { for (int i = 0; i < 10; i++) { System.out.println("Square of "+i+" : "+Math.pow(i,2)); } } }
/** * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file * except in co...
package com.example.testng.Annotation.Test; import org.testng.annotations.Test; /** * priority 此测试方法的优先级。将优先安排较低的优先事项。 * 默认值=0 数字越大执行顺序越靠后 */ public class TestAnnotationPriority { @Test(priority = 0) public void Testpriority() { System.out.println("Testpriority"); } @Test(priority = 1) ...
#!/bin/sh if [ ! -z "${COMPOSER_AUTO_INSTALL}" ] && [ "${COMPOSER_AUTO_INSTALL}" = 1 ]; then composer install \ -a \ --prefer-dist \ --no-suggest fi
package com.inner.lovetao.loginregister.di.component; import com.inner.lovetao.loginregister.di.module.TBLoginActivityModule; import com.inner.lovetao.loginregister.mvp.contract.TBLoginActivityContract; import com.inner.lovetao.loginregister.mvp.ui.activity.TBLoginActivity; import com.jess.arms.di.component.AppCompone...
import torch from eerie.nn.functional.bconv import bconv from eerie.bsplines.utils import B_supp from eerie.bsplines.b_1d import B import eerie def gconv_Rd_G( input, weights, centers, size, group, h_grid, n=2, s=1., stride=1, padding=0, ...
<reponame>RaymondJiangkw/screeps_script const Constants = { enemies:["Yoner"], username:"BoosterKevin", emoji:{ redFlag:"🚩", hunt:"🏹", money:"💰", number:"🔟", bigSmile:"😀", slightSmile:"🙂", neutralFace:"😐" }, labFormula:{ "OH":["H...
#!/bin/bash -x -v python3 minimal.py runserver 0.0.0.0:8000
<reponame>Coder-Dilip/HarinNepal<gh_stars>0 // landing page slider var sliderElement = document.getElementById("my-keen-slider") var elements = document.querySelectorAll(".keen-slider__slide") var interval = 0 function autoplay(run) { clearInterval(interval) interval = setInterval(() => { if (run && slider) { ...
#!/bin/sh SUPERUSER=samuelRHadmin SU_PASSWORD=v3ry53cur3 DATABASE=controller_test_db DB_SERVER=rhtestinstance.cux1erificun.us-east-1.rds.amazonaws.com USER=tester USER_PASSWORD=tester # drop database psql "postgresql://${SUPERUSER}:${SU_PASSWORD}@${DB_SERVER}/postgres" -c "DROP DATABASE IF EXISTS ${DATABASE};" p...
from enum import Enum from typing import Dict, List, Tuple import psycopg2 from django.core.exceptions import ValidationError from django.db import models, transaction from django.template.defaultfilters import pluralize from django.urls import reverse from django.utils import timezone from django.utils.translation im...
'use strict'; var path = require('path'); var test = require('ava'); var assert = require('yeoman-assert'); var helpers = require('yeoman-test'); test.before(() => { var pkg = require('../../package.json'); var deps = [ [helpers.createDummyGenerator(), 'statisk:gulp'] ]; return helpers.run(path.join(__di...
package mainclient.methodNewDefault; import main.methodNewDefault.IMethodNewDefault; import main.methodNewDefault.IMethodNewDefaultOther; public abstract class AbsMethodNewDefaultMultiIntOwnDef implements IMethodNewDefault, IMethodNewDefaultOther { public int defaultMethod() { return 11; } }
<reponame>ideacrew/pa_edidb require 'rails_helper' describe EmployerContributions::FederalEmployer do let(:employer_groups) { [] } let(:fed_employer_props) { { :federal_contribution_groups => employer_groups, :contribution_percent => 75.0 } } let(:enrollment) { double(:enrollees => enrollees, :pre_am...
<filename>src/core/middlewares/cors.middleware.ts import { Injectable, NestMiddleware } from '@nestjs/common'; import { Request, Response } from 'express'; import { CROSS_DOMAIN } from '../../app.config'; import { isDevMode } from '../../app.environment'; @Injectable() export class CorsMiddleware implements NestMiddle...
public static int RoundToNearestInteger(double number) { return (int) Math.Round(number); }
package com.alphawallet.app.di; import com.alphawallet.app.repository.CurrencyRepository; import com.alphawallet.app.repository.CurrencyRepositoryType; import com.alphawallet.app.repository.LocaleRepository; import com.alphawallet.app.repository.LocaleRepositoryType; import com.alphawallet.app.repository.PreferenceRep...
#!/bin/bash # port-forward connect server NAMESPACE=${1:-kafka} kubectl port-forward --namespace $NAMESPACE kcontrol 9021:9021
<filename>src/utils.ts /** * Type that can be indexed with TypeName then FieldName. */ export type HasTypeField<TypeName extends string, FieldName extends string> = { [t in TypeName]: { [f in FieldName]: unknown; }; }; /** * Map arg names to corresponding validator functions. */ export type ArgsValidationC...
<filename>spec/mumukit/narrator_spec.rb require 'spec_helper' describe 'narrator' do describe 'random narrator' do let(:narrator) { Mumukit::Assistant::Narrator.random } it { expect(narrator).to be_a Mumukit::Assistant::Narrator } it { expect(narrator.retry_phrase).to be_a String } end describe 'se...
<gh_stars>100-1000 #!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import logging from logging.handlers import RotatingFileHandler from qframer.qt import QtGui from qframer.qt import QtCore from qframer import FMainWindow import json import time #主日志保存在log/QSoftkeyer.log logging.root.se...
<gh_stars>10-100 """ Split German compound words """ from pathlib import Path from typing import List, Tuple import re import sys import json NGRAM_PATH = Path(__file__).parent / "ngram_probs.json" with open(NGRAM_PATH) as f: ngram_probs = json.load(f) class Splitter: """ Wrapper around the split_compo...
pp::VarDictionary CreateVarDictionary(const Value::DictionaryStorage& dictionary_storage) { pp::VarDictionary var_dictionary; for (const auto& pair : dictionary_storage) { const std::string& key = pair.first; const Value& value = pair.second; pp::Var var_value; // Convert Value to pp::Var based...
#!/usr/bin/env bash # Copyright 2016 by Rackspace Hosting, 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 appli...
public class Rectangle { private double width; private double height; public Rectangle(double width, double height) { this.width = width; this.height = height; } public double getArea() { return this.width * this.height; } public double getPerimeter() { return 2 * (this.width + this.height...
#!/bin/sh # # STIG URL: http://www.stigviewer.com/stig/red_hat_enterprise_linux_6/2014-06-11/finding/V-38451 # Finding ID: V-38451 # Version: RHEL-06-000040 # Finding Level: Medium # # The /etc/passwd file must be group-owned by root. The "/etc/passwd" # file contains information about the users that are confi...
#ifndef CORE_UTIL_BINARYDATACOMPRESSOR_H_ #define CORE_UTIL_BINARYDATACOMPRESSOR_H_ #include <core-base/common.h> namespace ml { //! interface to compress data class BinaryDataCompressorInterface { public: virtual void compressStreamToMemory(const BYTE *decompressedStream, UINT64 decompressedStreamLe...
class Solution { public: bool isHappy(int n) { int slow, fast; slow = fast = n; do { slow = squareSum(slow); //same method as checking loop in a linked list fast = squareSum(squareSum(fast)); } while(slow != fast); return (slow == ...