text stringlengths 1 1.05M |
|---|
package com.creadigol.inshort.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.wi... |
import * as t from "io-ts";
export const rpcCompilerInput = t.type(
{
language: t.string,
sources: t.any,
settings: t.any,
},
"RpcCompilerInput"
);
export type RpcCompilerInput = t.TypeOf<typeof rpcCompilerInput>;
export const rpcCompilerOutput = t.type(
{
sources: t.any,
contracts: t.any... |
<reponame>kostovmichael/react-examples<filename>v16/examples/sentry-get-started/webpack.config.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
const SentryCliPlugin = require('@sentry/webpack-plugin');
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, './src/index'),
outp... |
def find_max(arr):
# set initial max as the first value in the array
max_val = arr[0]
# iterate over all values in the array
for val in arr:
# if current value is greater than max, update max
if val > max_val:
max_val = val
return max_val |
import { TestBed } from '@angular/core/testing';
import { FonctionnaliteService } from './fonctionnalite.service';
describe('FonctionnaliteService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: FonctionnaliteService = TestBed.get(FonctionnaliteS... |
#!/usr/bin/env bash
for CMD in 'dev-server' 'chrome' 'watch'
do
sleep 2s
osascript -e "tell application \"Terminal\" to do script \"cd ${PWD};npm run ${CMD}\""
done
|
import jmespath
def create_cluster(_body, kwargs):
# Implementation for creating a cluster
return {"id": "cluster-123", "status": "created"}
def delete_cluster(_body, kwargs):
# Implementation for deleting a cluster
return {"id": "cluster-123", "status": "deleted"}
def update_cluster(_body, kwargs):
... |
import os
from dotenv import load_dotenv
from os.path import dirname, join
def get_env_variable(variable_name):
dotenv_path = join(dirname(__file__), ".env")
load_dotenv(dotenv_path=dotenv_path, verbose=True)
try:
return os.getenv(variable_name)
except KeyError:
message = "Expected en... |
/*
* Copyright 2017-2019 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
#!/bin/sh
ARGS=$1
if [ $# -lt 1 ]; then
ARGS="help"
fi
BASEPATH=$(cd `dirname $0`; pwd)
case $ARGS in
all)
cd $BASEPATH; cp CMakeLists.txt ../; cmake ..; make
;;
cleanall)
cd $BASEPATH; make clean; rm -rf CMakeFiles/ CMakeCache.txt Makefile util/ tools/ servant/ framework/ test/ cmake... |
<html>
<head>
<title>Welcome Message</title>
</head>
<body>
<h1>Welcome Message</h1>
<form action="/welcome" method="post">
<label for="email">Email:</label>
<input type="email" name="email" required>
<input type="submit" value="Submit">
</form>
</body>
</html>
<!-- controller c... |
<filename>app/templates/tests/specs/framework/MessageBus.js
/*global describe:true, expect:true, it:true, sinon:true */
/*jshint expr:true */
define([
'MessageBus'
], function(MessageBus) {
'use strict';
describe('MessageBus', function() {
describe('#on()', function() {
it('should f... |
<filename>src/components/hooks/Nonsense.js
import React, { createContext, useContext, useCallback } from 'react'
import { useLocalStorage } from './useLocalStorage'
export const NonsenseContext = createContext([])
export const NonsenseProvider = props => {
const [nonsense, setNonsense] = useLocalStorage('nonsense', ... |
#!/bin/bash
kubectl create ns argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
#!/usr/bin/env bash
# $1 sudu password
# requre sudo password
if [ "$1" == "" ]; then
echo "[warning] require sudo password parameter."
exit 1
fi
SUDO_PW=$1
# MySQL
# usage: $ mysql -u user -h 127.0.0.1 -p
echo $SUDO_PW | sudo -S docker run -d --name mysql -p 0.0.0.0:3306:3306 \
-e MYSQL_ROOT_PASSWORD=ro... |
<gh_stars>0
import {useState} from 'react'
function Counter() {
const [count,setCount]=useState(0);
const increase=()=>{
setCount(count+1)
}
const decrease=()=>{
setCount(count-1)
}
return (
<div>
<h1>{count}</h1>
<button onClick={increase} >Artır... |
/*------------------------------------------------------------------
* us1060.c - Unit Tests for User Story 1060 - TLS SRP support (Server/Proxy)
*
* May, 2014
*
* Copyright (c) 2014-2016 by cisco Systems, Inc.
* All rights reserved.
*------------------------------------------------------------------
*/
#includ... |
package cm.xxx.minos.leetcode;
/**
* Description:
* Author: lishangmin
* Created: 2018-09-04 00:27
*/
public class DoublyListNode {
int val;
DoublyListNode next, prev;
DoublyListNode(int x) {val = x;}
public DoublyListNode(int val, DoublyListNode next, DoublyListNode prev) {
this.val = val... |
<filename>velocloud/provider.go<gh_stars>0
package velocloud
import (
"context"
//"fmt"
"log"
//"github.com/hashicorp-demoapp/hashicups-client-go"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"terraform-provider-velocloud/velocloud/vcoclient"
... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ic_euro_symbol = void 0;
var ic_euro_symbol = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M0 0h24v24H0z",
"fill": "none"
},
"children": []
}, {
"name": "path",
... |
#!/bin/bash
#
# Copyright 2013 Bagher BabaAli,
# 2014 Brno University of Technology (Author: Karel Vesely)
#
# TIMIT, description of the database:
# http://perso.limsi.fr/lamel/TIMIT_NISTIR4930.pdf
#
# Hon and Lee paper on TIMIT, 1988, introduces mapping to 48 training phonemes,
# then re-mapping to 39 phon... |
/*
* Copyright 2017 Danish Maritime Authority.
*
* 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 applicab... |
<gh_stars>1-10
package io.github.rcarlosdasilva.weixin.common.dictionary;
import com.google.gson.annotations.SerializedName;
/**
* 语言
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
*/
public enum Language {
/** 简体中文. */
@SerializedName("zh_CN")
ZH_CN("zh_CN"),
/** 繁体中文TW. */
@Serialize... |
<reponame>ShaolinDeng/SDK-Android<filename>platform/src/com/iflytek/cyber/platform/CyberCore.java
/*
* Copyright (C) 2018 iFLYTEK CO.,LTD.
*
* 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... |
import React from "react"
import InfoNotice from "./InfoNotice"
import XButton from "./XButton"
type Props = {onClick: Function}
export default function IngestUpdateNotice({onClick}: Props) {
return (
<InfoNotice>
<p>More data is now available.</p>
<p>
<button className="bevel-button" onCli... |
import cupy
import numpy as np
import time
square_diff_kernel = cupy.ElementwiseKernel(
'T x, T y',
'T z',
'z = x*x - y*y',
'square_diff'
)
def square_diff(in1, in2):
return in1*in1 - in2*in2
def test_cupy_kernel():
# Generate random CuPy arrays
a = cupy.random.randint(1, 101, 10**6)
... |
var SOBA = artifacts.require("./SOBA.sol");
module.exports = function(deployer) {
deployer.deploy(SOBA);
};
|
#!/bin/sh
java -DJNIEASY_LICENSE_DIR=.. -Djava.library.path=. -jar ../JNIEasyExamples.jar
|
// Based on https://www.typescriptlang.org/docs/handbook/advanced-types.html
function padLeft(value, padding) {
if (typeof padding === "number") {
return Array(padding + 1).join(" ") + value;
}
if (typeof padding === "string") {
return padding + value;
}
throw new Error("Expected str... |
import { DefinitionIdentifier as IDefinitionIdentifier, DefinitionIdentifierPOJO, UUID } from "../../public";
import { Identifiers } from "./identifiers";
import { _internal } from "./utils";
import { Joi } from "./validation";
export abstract class DefinitionIdentifier implements IDefinitionIdentifier {
public stat... |
#!/bin/bash
rm -rf mos
cp -r /opt/mos-components-ci mos
pushd mos
cp etc/lxc/ha/neutron_vlan_ubuntu/* .
ln -s ~/images iso
sed -i 's|./actions/prepare-environment.sh|#./actions/prepare-environment.sh|' launch.sh
./launch.sh
popd
|
package org.terracottamc.network.packet.type;
/**
* Copyright (c) 2021, TerracottaMC
* All rights reserved.
*
* <p>
* This project is licensed under the BSD 3-Clause License which
* can be found in the root directory of this source tree
*
* @author Kaooot
* @version 1.0
*/
public enum ResourcePackDataInfoTyp... |
<gh_stars>1-10
package de.lmu.cis.ocrd;
public interface Line {
int getLineId();
int getPageId();
String getNormalized();
}
|
<gh_stars>0
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :set_logged_user, :cors_preflight_check
after_filter :cors_set_access_control_headers
# F... |
def remove_duplicates(string):
output = ""
for char in string:
if char not in output:
output += char
return output |
func configure(with viewModel: AlbumViewModel) {
map(old: self.viewModel, new: viewModel)
coverImageView.image = UIImage(named: viewModel.coverName)
nameLabel.text = viewModel.name
artistLabel.text = viewModel.artiste
favoriteIcon.isHidden = !viewModel.isFavorite
self.viewModel = viewModel
}
pr... |
package org.multibit.hd.core.services;
import org.multibit.hd.core.config.Configurations;
import org.multibit.hd.core.events.ShutdownEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* <p>Service to provide the following to application API:</p>
* <ul>
* <li>Configuration persistence after a shutd... |
cat ../Data/tmdb_5000_movies.csv | python ETL_mapper.py | sort -k1 | python ETL_reducer.py > ../Data/processed_movie_data.dat
|
<filename>offer/src/main/java/com/java/study/answer/zuo/fsenior/class01/Code04_DistinctSubseq.java
package com.java.study.answer.zuo.fsenior.class01;
import java.util.Arrays;
public class Code04_DistinctSubseq {
public static int distinctSubseq1(String s) {
char[] str = s.toCharArray();
int result = 0;
int[] ... |
<filename>example/react/screens/PlaylistScreen.js<gh_stars>0
import React, { useEffect } from 'react'
import { StyleSheet, Text, View } from 'react-native'
import TrackPlayer, { Capability, State, usePlaybackState, RepeatMode } from 'react-native-track-player'
import Player from '../components/Player'
import playlistD... |
<gh_stars>10-100
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'dalli/elasticache/version'
Gem::Specification.new do |s|
s.name = 'dalli-elasticache'
s.version = Dalli::ElastiCache::VERSION
s.licenses = ['MIT']
s.summary = "Con... |
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this... |
<reponame>weikwer/spring-boot-market
package com.weikwer.market.controller;
import java.util.Map;
public abstract class BaseController {
/**
* 通过返回true,否则返回false
* @param strs
* @param map
* @return
*/
public boolean mapfilter(String[] strs, Map<String, String> map){
for(Strin... |
#!/bin/sh
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2018 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may ... |
import { spawn } from 'child_process';
import { Injectable } from '@nestjs/common';
import { SimpleCommandExecutorComponentInterface } from '../../../executor/simple-command-executor-component.interface';
import { EnvVariablesSet } from '../../../sets/env-variables-set';
import { SimpleCommand } from '../../../executor... |
<filename>src/main/java/com/github/thomasj/springcache/ext/memcached/MemcachedCache.java
package com.github.thomasj.springcache.ext.memcached;
import java.util.Date;
import java.util.concurrent.*;
import com.github.thomasj.springcache.ext.key.ExpiryKey;
import com.github.thomasj.springcache.ext.util.NoSqlUtil;
import... |
/* eslint-disable-next-line no-var, no-use-before-define */
var SharkGame = SharkGame || {};
// CORE VARIABLES AND HELPER FUNCTIONS
$.extend(SharkGame, {
GAME_NAMES: [
"Five Seconds A Shark",
"Next Shark Game",
"Next Shark Game: Barkfest",
"Sharky Clicker",
"Weird Oceans",
... |
import javax.swing.*;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class CalculatorApp extends JFrame {
private JTextField input;
private JTextField output;
public CalculatorApp() {
// GUI initialization code
}
publ... |
import React, {useEffect, useRef} from 'react'
import { animated, useSpring } from 'react-spring'
import {useSelector} from 'react-redux'
const AppearContainer = ({children, getSpring, className, tspan, ...rest}) => {
const container = useRef()
const pageLoaded = useSelector(state => state.pageLoaded)
const pa... |
import styled from 'styled-components';
import Image from '@crystallize/react-image';
import { H2 as H, responsive } from 'ui';
export const Outer = styled.article`
max-width: 600px;
margin: 0 auto;
`;
export const HeroImage = styled.div`
margin-bottom: 100px;
`;
export const Img = styled(Image)`
> img {
... |
<gh_stars>0
import os
import string # clean_string
import json # config
from difflib import SequenceMatcher # similar
# slugify
import re
import unicodedata
import text_unidecode as unidecode
_unicode = str
_unicode_type = str
unichr = chr
QUOTE_PATTERN = re.compile(r'[\']+')
ALLOWED_CHARS_PATTERN = re.compile(r'[... |
// Copyright 2008 The Apache Software Foundation
//
// 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
chown shib.shib /opt/shib -R
su - shib -c "cd /opt/shib && npm start"
|
<filename>mobile/src/pages/Main.js
import React, { useState, useEffect } from 'react'
import { StyleSheet, Image } from 'react-native'
import MapView, { Marker } from 'react-native-maps'
import { requestPermissionsAsync, getCurrentPositionAsync } from 'expo-location'
function Main() {
const [currentRegion, setCurr... |
#!/usr/bin/env bash
FOLDER_PATH=$PWD
echo "START \"set path variables\"" \
&& echo "" \
&& php -v \
&& echo "" \
&& echo "prepare php.ini and set include path" \
&& sudo cp -f /etc/php.ini.default /etc/php.ini \
&& sudo chmod u+w /etc/php.ini \
&& echo "include_path = \".:/php/includes:${FOLDER_PATH}\"" | sudo tee -a... |
#include "main.h"
static boolean_t is_empty_command(job_data_t* job_data, int index)
{
int i;
i = 0;
while(job_data->children_data[index].command[i] != '\0')
{
if(isspace(job_data->children_data[index].command[i]) == 0)
return FALSE;
}
return TRUE;
}
boolean_t read_next_command(job_data_t* job_... |
<reponame>SenaiCIC/jhean
package aula08;
public class EscopoInicializazao {
public static void main(String[] args) {
int global= 6;
String nome;
if(global>5){
nome="xuxu";
}else{
nome="adailton";
}
System.out.println(... |
#!/usr/bin/env bash
source "../../config.sh"
curl -X "POST" "https://rest.nexmo.com/sms/json" \
-d "from=$FROM_NUMBER" \
-d "text=A text message sent using the Nexmo SMS API" \
-d "to=$TO_NUMBER" \
-d "api_key=$NEXMO_API_KEY" \
-d "sig=$NEXMO_SIGNATURE_SECRET"
|
#!/bin/bash
# ========== Experiment Seq. Idx. 2692 / 52.0.4.0 / N. 0 - _S=52.0.4.0 D1_N=39 a=-1 b=1 c=1 d=1 e=-1 f=-1 D3_N=7 g=1 h=1 i=1 D4_N=2 j=2 D5_N=0 ==========
set -u
# Prints header
echo -e '\n\n========== Experiment Seq. Idx. 2692 / 52.0.4.0 / N. 0 - _S=52.0.4.0 D1_N=39 a=-1 b=1 c=1 d=1 e=-1 f=-1 D3_N=7 g=1 h=... |
#!/bin/sh
libtoolize -c -f || exit 1
aclocal --force --verbose || exit 1
autoheader -fv || exit 1
automake -acfv || exit 1
autoreconf -ifv || exit 1
# ./configure
|
#!/bin/bash
# Generate test certificates:
#
# ca.{crt,key} Self signed CA certificate.
# redis.{crt,key} A certificate with no key usage/policy restrictions.
dir=`dirname $0`
# Generate CA
openssl genrsa -out ${dir}/ca.key 4096
openssl req \
-x509 -new -nodes -sha256 \
-key ${dir}/ca.key \... |
<reponame>openfirmware/ccadi_geoserver<gh_stars>0
# zfs.rb
# Install ZFS tools alongside GeoServer installation.
# Sets up kABI installation (no DKMS required), but does not create
# any ZFS pools.
#
# For more information on the Policyfile feature, visit
# https://docs.chef.io/policyfile/
# A name that describes what... |
from dagster import graph, op, resource
@resource
def external_service():
...
@op(required_resource_keys={"external_service"})
def do_something():
...
@graph
def do_it_all():
do_something()
do_it_all_job = do_it_all.to_job(resource_defs={"external_service": external_service})
|
int[] arr = new int[10];
for (int i=0; i<10; i++){
arr[i] = i+1;
} |
<filename>server/app/state/config_dep_map.go<gh_stars>1-10
package state
const ConfigDepMapKey = "ConfigDepMap"
|
<reponame>KimJeongYeon/jack2_android<gh_stars>10-100
/*
Copyright (C) 2010 <NAME>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any lat... |
package plugin.album;
import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import plugin.album.data.MediaItem;
public class MediaMgr {
private static final MediaMgr sInstance = new MediaMgr();
private MediaMgr() {}
public static Medi... |
import { combineReducers } from "redux";
import game from "./game";
const reducers = combineReducers({ game });
export default reducers;
|
from django.contrib import admin
from django.http.response import HttpResponseRedirect
from hoodalert.models import HealthDep, Neighbourhood, PoliceDep
# Register your models here.
admin.site.register(HealthDep)
admin.site.register(PoliceDep)
admin.site.register(Neighbourhood)
|
var this_js_script = $("script[src*=apppagos]");
var my_var_1 = this_js_script.attr("data-my_var_1");
if (typeof my_var_1 === "undefined") {
var my_var_1 = "some_default_value";
}
Vue.config.devtools = true;
Vue.component("v-select", VueSelect.VueSelect);
//Vue.use(VeeValidate);
Vue.use(VeeValidate, {
classes: true... |
<reponame>bryanvillamil/proyect-Gatbsy
import styled from 'styled-components';
import breakpoint from 'styled-components-breakpoint';
export const ContentGetaQuote = styled.div`
background: red;
padding: 1em;
`;
export const Container = styled.div`
width: 100%;
margin: 0 auto;
${breakpoint('tablet')`
wid... |
#!/bin/bash -xe
# Validations
MANDATORY_ENVS="IMAGE_VERSION BUILD_NUMBER DOCKER_REGISTRY OPERATOR_IMAGE GIT_BRANCH"
for envi in $MANDATORY_ENVS; do
[ -z "${!envi}" ] && { echo "Error - Env $envi is mandatory for the script."; exit 1; } || :
done
# Prepare specific tag for the image
tags=`build/ci/get_image_tags_... |
curl -X POST -H "DD-API-KEY: [[apiKey]]" -H "DD-APPLICATION-KEY: [[apiKey]]" "https://api.datadoghq.com/v1/monitor/mute_all" |
def get_validation_rules(config_settings: dict, setting_name: str) -> list:
if setting_name in config_settings:
return [config_settings[setting_name]]
else:
return [] |
#!/bin/sh
#
# Wrapper script to nosetests
#
# Usage: run_nose_tests.sh [nose options] test_modules...
#
# Wrapper script to run tests using nose.
#
# To run tests:
# [cd to minipylib package directory]
# ./bin/run_nose_tests.sh minipylib
#
# To print diagnostic info when running tests:
# ./bin/run_nose_tests.sh -D mini... |
def solveTSP(cities):
# Get the number of cities
num_cities = len(cities)
# Set the initial conditions including
# the default distance matrix, visited set,
# and an empty tour
# distance matrix
distance_matrix = [[0 for x in range(num_cities)]
for y i... |
from rest_framework import generics, permissions
from django.contrib.auth.models import Group
from .models import Status, Criticality
from .serializers import StatusSerializer, CriticalitySerializer, GroupSerializer
class StatusView(generics.ListAPIView):
"""."""
permission_classes = [permissions.IsAuthenti... |
#!/usr/local/bin/bash
set -e
set -x
# pull latest changes
ssh roa@95.217.177.163 'cd mataroa && git pull'
# sync requirements
ssh roa@95.217.177.163 'cd mataroa && source venv/bin/activate && pip install -r requirements.txt'
# collect static
ssh roa@95.217.177.163 'cd mataroa && source venv/bin/activate && python m... |
var app = {
findMinMax: function(numbers) {
maximum = numbers[0];
minimum = numbers[0];
for (i = 0; i <= numbers.length - 1; i++) {
if (maximum < numbers[i]) {
maximum = numbers[i];
}
// return large;
}
for (i = 0; i <= numbers.length - 1; i++) {
if (minimum > numb... |
#!/bin/sh
#Make appropriate directories
mkdir /usr/share/python-daemon
mkdir /var/log/python-daemon
mkdir /var/run/python-daemon
#move the init script
cp fsmetrics /etc/init.d/
#copy all other files to home directory
cp * /usr/share/python-daemon/
|
from pytube import YouTube
from tkinter import *
def main_program(url):
x = YouTube(url)
print(x)
for i in x.streams.first().download():
print(i)
class Main():
def __init__(self):
self.win = Tk()
#config
self.config_title = 'youtube downloader'
self.config_wid... |
#!/usr/bin/env bash
set -e
# Ethos Repl database
if [ -z "$ETHOS_REPL_DB_PASSWORD" ]; then
echo "ERROR: Missing environment variables. Set value for 'ETHOS_REPL_DB_PASSWORD'."
exit 1
fi
psql -v ON_ERROR_STOP=1 --username postgres --set USERNAME=ethos --set PASSWORD=${ETHOS_REPL_DB_PASSWORD} <<-EOSQL
CREATE USE... |
import { Disposable } from '../Disposable';
import { Listener } from './Listener';
import { Key, ListenableType, listen, listenOnce, getListener, unlistenByKey } from './index';
import { EventTarget as LEventTarget } from './EventTarget';
import { ListenableKey } from './ListenableKey';
export class EventHandler exten... |
#Turning Xcompmgr composite effects ON
if pgrep xcompmgr &>/dev/null; then
pkill xcompmgr &
fi
if pgrep compton &>/dev/null; then
pkill compton &
fi
notify-send -t 2500 "Turning COMPTON effects ON"
compton &
|
#!/bin/bash
# If
# (not within Vagrant Guest OS) and (not within Travis)
# then
# exit 1
if [ `whoami` != "vagrant" ] && [ `whoami` != "travis" ];
then
echo The command should be executed within the guest OS!
exit 1
fi
php app/console cache:clear --env=prod
php app/console cache:warmup --env=prod
mysql... |
package ca.tetchel.shexter.sms.util;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import android.telephony.SmsMessage;
import android.util.Log;
import ... |
def mergeSortedList(list1, list2):
i = j = 0
merged_list = []
while i < len(list1) and j < len(list2):
if list1[i] < list2[j]:
merged_list.append(list1[i])
i += 1
else:
merged_list.append(list2[j])
j += 1
merged_list += list1[i:]
mer... |
import Quick
import Nimble
class AuthManagerSpec: QuickSpec {
override func spec() {
describe("Auth Manager") {
context("when logging out") {
it("should call the completion handler with success") {
let manager = Manager.auth
waitUntil { do... |
#!/bin/sh
SCRIPT_ABS_PATH=$(cd "$(dirname "$0")" && pwd)
. ${SCRIPT_ABS_PATH}/common-env.sh
echo .
${KAFKA_BIN_PATH}/kafka-topics.sh --delete --zookeeper localhost:2181 --topic contextmodel
${KAFKA_BIN_PATH}/kafka-topics.sh --delete --zookeeper localhost:2181 --topic orchestrationservice
${KAFKA_BIN_PATH}/kafka-topic... |
#!/usr/bin/dash -e
# Copyright (c) 2019-2020, Firas Khalil Khana
# Distributed under the terms of the ISC License
. /home/glaucus/scripts/toolchain/variables
. $TSCR/prepare
. $TSCR/cross/run
. $TSCR/native/run
. $TSCR/backup
|
<reponame>melkishengue/cpachecker
/*
* 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");
* you may not use this file except in compli... |
<reponame>yjfnypeu/Router-RePlugin<gh_stars>10-100
package com.lzh.router.replugin.core;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.lzh.nonview.router.Router;
import com.lzh.nonview.router.extras.RouteBundleExtras;
/**
* 插件间跳转的中间桥接页面。当Rou... |
import click
import os
@click.command()
@click.argument('filename')
def create_file(filename):
with open(filename, 'w') as file:
file.write('Hello, World!')
def test_create_file(runner_):
with runner_.isolated_filesystem():
result = runner_.invoke(create_file, ['test.txt'])
assert resu... |
import os.path as osp
from .recognition_dataset import RecognitionDataset
from .registry import DATASETS
@DATASETS.register_module()
class RawframeDataset(RecognitionDataset):
"""RawframeDataset dataset for action recognition.
The dataset loads raw frames and apply specified transforms to return a
dict ... |
package ordt.output.systemverilog.common;
public class SystemVerilogInstance {
private SystemVerilogModule mod;
private String name;
private RemapRuleList rules = null;
public SystemVerilogInstance(SystemVerilogModule mod, String name) {
this.mod=mod;
this.name=name;
//System.out.println("SystemVerilogModu... |
<reponame>msnraju/al-productivity-tools
import _ = require("lodash");
import DATATYPE_KEYWORDS from "../maps/data-type-keywords";
import ITokenReader from "../../tokenizers/models/token-reader.model";
import IVariable from "../models/variable.model";
import VARIABLE_KEYWORDS from "../maps/variable-keywords";
import DAT... |
package com.acmvit.acm_app.util.reactive;
import android.util.Log;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import java.util.concurrent.atomic.AtomicBoolean;
publi... |
def ai_strategy_tree(state):
if is_goal(state):
return "Goal"
successors = get_successors(state)
best_solution = INF
for successor in successors:
score = max(ai_strategy_tree(successor))
best_solution = min(best_solution, score)
return best_solution |
<gh_stars>10-100
package io.opensphere.mantle.data.dynmeta.impl;
import io.opensphere.core.Toolbox;
import io.opensphere.mantle.data.DataTypeInfo;
/**
* The Class DynamicColumnObjectController.
*/
public class DynamicMetadataObjectController extends AbstractDynamicMetadataController<Object>
{
/**
... |
<gh_stars>1-10
require "test/test_helper"
class Admin::PostsControllerTest < ActionController::TestCase
context "Index" do
setup do
get :index
end
should "render index and validates_presence_of_custom_partials" do
assert_match "posts#_index.html.erb", @response.body
end
should "re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.