text stringlengths 1 1.05M |
|---|
<reponame>yicone/steedos-platform
const path = require("path");
const dotenv = require("dotenv-flow");
delete process.env.MONGO_URL
delete process.env.MONGO_OPLOG_URL
delete process.env.ROOT_URL
delete process.env.PORT
let projectPath = process.cwd()
dotenv.config({path: projectPath, debug: true, purge_dotenv: true}... |
/*
* Copyright (c) 2007-2013 Concurrent, Inc. All Rights Reserved.
*
* Project and contact information: http://www.cascading.org/
*
* This file is part of the Cascading project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.... |
<reponame>JasonLiu798/javautil
package com.atjl.util.collection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
/**
* Created by JasonLiu798 on 16/6/3.
*/
public class SearchUtil {
private SearchUtil(){
throw new UnsupportedOperationException();
}... |
# -*- coding: utf-8 -*-
"""
Kay miscellanea.
:Copyright: (c) 2009 Accense Technology, Inc. All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import os, sys
def get_appid():
from google.appengine.api import apiproxy_stub_map
have_appserver = bool(apiproxy_stub_map.apiproxy.GetStub('datastore_... |
<reponame>davepacheco/node-manta
/*
* Copyright 2016 Joyent, Inc.
*/
/*
* A common logger setup for test files.
*/
var assert = require('assert-plus');
var bunyan = require('bunyan');
var path = require('path');
var restifyClients = require('restify-clients');
function createLogger() {
return (bunyan.createL... |
import { should } from 'chai';
import { HierarchyInstance } from '../../types/truffle-contracts';
// tslint:disable:no-var-requires
const { expectEvent, expectRevert } = require('@openzeppelin/test-helpers');
const Hierarchy = artifacts.require('Hierarchy') as Truffle.Contract<HierarchyInstance>;
should();
/** @test ... |
import random
def shuffleArray(arr):
random.shuffle(arr)
return arr
array = [1, 2, 3, 4, 5, 6]
shuffledArray = shuffleArray(array)
print(shuffledArray) |
#!/bin/bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
export PT_DATA_DIR=../../../data
export PT_OUTPUT_DIR=output
|
<gh_stars>0
package controllers
import base.Logging
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import play.api.libs.json._
import play.api.mvc._
import play.modules.reactivemongo.MongoController
import play.modules.reactivemongo.json.collection.JSONCollection
import reactivemongo.api.Cursor
im... |
<filename>src/main/java/com/dashradar/privatesendanalysis/GraphLoader.java
package com.dashradar.privatesendanalysis;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Unsupport... |
<filename>src/vuexStore/commonModule/mutations.ts
import * as types from '@/vuexStore/commonModule/mutations_types';
export default {
[types.SETTOKEN](state: any, d: any) {
state.token = d;
},
[types.SETUSERINFO](state: any, d: any) {
state.userInfo = d;
},
[types.SETWXINFO](state: any, d: any) {
... |
<filename>src/main/java/org/n3r/eql/trans/spring/EqlTransactionInterceptor.java<gh_stars>1-10
package org.n3r.eql.trans.spring;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
public class EqlTransactionInterceptor implements MethodInterceptor {
@Override
... |
package astrionic.adventofcode2020.framework
private[adventofcode2020] object AdventConfig {
/**
* Path to the resource directory which contains files like input, solutions and templates.
*/
val resourceDirectory = "./src/main/resources"
/**
* Path to the directory containing the input files.
*/
... |
gh completion -s zsh > /usr/local/share/zsh/site-functions/_gh |
#!/bin/bash
../../../CleanUpGerbers/renamegerbers.sh -o -c -z -n APC1
|
#!/bin/sh
# CREATE ROLE vagrant SUPERUSER LOGIN PASSWORD $2;
cat << EOF | sudo -u postgres psql
-- uncomment to reset your DB
DROP DATABASE $1;
CREATE DATABASE $1;
\connect $1
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
EOF
|
#!/usr/bin/env bash
cd $(dirname $0)
SESSION='meshblu'
. ./_defaults.sh
tmux new-window -t $SESSION:1 -n proxy
tmux new-window -t $SESSION:2 -n frontends
tmux new-window -t $SESSION:3 -n core
tmux new-window -t $SESSION:4 -n firehose
tmux new-window -t $SESSION:5 -n obscure-frontends
tmux new-window -t $SESSION:6 -n ... |
#!/bin/bash
# ----------
# SPDX-License-Identifier: Apache-2.0
# ----------
#
echo "NodeOUs:
Enable: true
ClientOUIdentifier:
Certificate: cacerts/rca-trading-blockchain-biz-6005.pem
OrganizationalUnitIdentifier: client
MemberOUIdentifier:
Certificate: cacerts/rca-trading-blockchain-biz-6005.pem
... |
function intersection(arr1, arr2) {
const intersection = [];
for (let i=0; i<arr1.length; i++) {
if (arr2.includes(arr1[i])) {
intersection.push(arr1[i]);
}
}
return intersection;
}
console.log(intersection([2, 3, 5, 6, 8], [3, 4, 5, 10]));
// Output: [3, 5] |
const gulp = require('gulp');
const concat = require('gulp-concat');
gulp.task('build-script', function () {
return gulp
.src('./build/static/js/*.js')
.pipe(concat('vdr.js'))
.pipe(
gulp.dest('./dist/VirtualDocumentRoomModules/Files/SiteAssets/js')
)
.pipe(gulp.dest('a:/VDRoom/SiteAssets/js')) //dev
.... |
#!/usr/bin/env bash
set -ex
# Incorporate TARGET env var to the build and test process
cargo build --target "$TARGET" --verbose
# We cannot run arm executables on linux
if [[ $TARGET != arm-unknown-linux-gnueabihf ]]; then
cargo test --target "$TARGET" --verbose
fi
|
<reponame>deokgoo/project-2021_mandala_plan<gh_stars>0
import { useStore } from 'react-redux';
import { useEffect, useState } from 'react';
import {
dreamType,
mandalaDreamType,
mandalaStatusType,
mandalaUnitType,
stateType as mandalaStoreState
} from '../reducer/type';
const useMandalaDreamSelector = ({isCo... |
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $SCRIPT_DIR/../lambda/custom
yarn build
yarn zip
yarn copy-build
|
#!/bin/env bash
set -e
export BINUTILSVERSION="2.33.1"
export GCCVERSION="10.1.0"
dirname=$(pwd)
result="${dirname%"${dirname##*[!/]}"}" # extglob-free multi-trailing-/ trim
result="${result##*/}" # remove everything before the last /
echo "Current directory: $(pwd)"
if [ $result != "toolchain" ]; th... |
<filename>app/models/comfy/cms/site.rb
class Comfy::Cms::Site < ActiveRecord::Base
self.table_name = 'comfy_cms_sites'
# -- Relationships --------------------------------------------------------
with_options :dependent => :destroy do |site|
site.has_many :layouts
site.has_many :pages
site.has_many :s... |
/* **** Notes
Open.
//*/
# define CAR
# include <io.h>
# include <conio.h>
# include <stdio.h>
# include <stdlib.h>
# include <time.h>
# include <fcntl.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <errno.h>
# include "../../../incl/config.h"
signed(__cdecl openf(signed short(arg),signed char(*path),s... |
class Categ < ActiveRecord::Base
CAT_1 = 0
CAT_2 = 1
self.primary_key = :cat_id
has_many :subcategs, :foreign_key => :fk_subcat_id
def cat_id
# required for Rails 3.2 compatibility
read_attribute(:cat_id)
end
end
|
#!/bin/bash
# __BEGIN_LICENSE__
# Copyright (c) 2009-2012, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NGT platform is licensed under the Apache License, Version 2.0 (the
# "License"); you may not use this file ... |
/**
* @class RR
*
* @brief Round Robin algorithm simulation class
*
* This Class is responsible for receiving a std::vector of Processes
* and run the RR algorithm over the input. The user can request the
* average response time, the average return time and the average wait
* time using getters or the toString ... |
package testclasses;
import array.Vector;
import array.vector.VectorImplementation;
import heap.Heap;
import heap.implementation.ArrayHeap;
public class HeapTest {
public static void main(String[] args) {
try{
Heap<Integer> heap = new ArrayHeap<>();
System.out.println("IsEmpty: "... |
#!/bin/bash
# Create necessary directories
mkdir -p /var/lib/mysql
mkdir -p /var/run/mysqld
mkdir -p /var/log/mysql
# Add configuration entries to my.cnf
cat <<EOT >> /etc/mysql/my.cnf
[client]
[mysql]
[mysqld]
EOT |
for lr in 1e-4 ; do
for num_lstms in 1; do
for hidden_size in 128; do
for bidirectional in --bidirectional ""; do
for end_mask in --end_mask ""; do
for dataset_ver in 0 25 50 75; do
echo lr = $lr
echo num_lstms =... |
#!/bin/bash
set -o pipefail
set -eu
location=$(dirname $0)
PACKAGE=knative-camel-operator-dev
BASE_VERSION=0.15.0
update_manifest() {
local version=$1
local manifest_dir=$location/deploy/olm-catalog/knative-camel-operator-dev
echo "Renaming manifest dir"
old_version=""
for dir in $manifest_d... |
#!/bin/bash
# Only update permissions if permissions need to be updated
if [[ $(stat -c %U:%G /var/lib/elasticsearch/data) != "elasticsearch:elasticsearch" ]]; then
sudo chown elasticsearch: /var/lib/elasticsearch/data
fi
|
function check_brackets(){
let count = 0;
let res = count + ' ' + (count > 0)? 'Bet': 'Hold';
console.log(res);
return res;
}
check_brackets(); |
package heist
import com.google.api.client.googleapis.auth.oauth2.{GoogleAuthorizationCodeFlow, GoogleCredential}
import com.google.api.client.auth.oauth2.{TokenResponse, Credential}
import com.google.api.client.http.HttpTransport
import com.google.api.client.http.javanet.NetHttpTransport
import com.google.api.client.... |
//Create an index.html file and include the necessary files
<html>
<head>
<title>Current Weather Information</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<li... |
chrome.runtime.onInstalled.addListener(function (object) {
chrome.tabs.create({url: "http://jrod.in/workbench-enhancer"}, function (tab) {
console.log("New tab launched with http://yoursite.com/");
});
}); |
<filename>src/store/note/actions.ts<gh_stars>0
import { ActionTree } from "vuex"
import { StateInterface } from "../index"
import { NoteStateInterface } from "./state"
import { api } from "boot/axios"
import { Notify } from "quasar"
const actions: ActionTree<NoteStateInterface, StateInterface> = {
getNotes({ commit ... |
// Generated by script, don't edit it please.
import createSvgIcon from '../../createSvgIcon';
import SoundcloudSvg from '@rsuite/icon-font/lib/legacy/Soundcloud';
const Soundcloud = createSvgIcon({
as: SoundcloudSvg,
ariaLabel: 'soundcloud',
category: 'legacy',
displayName: 'Soundcloud'
});
export default So... |
<filename>sitewhere-java-model/src/main/java/com/sitewhere/rest/model/microservice/MicroserviceSummary.java
/**
* Copyright © 2014-2021 The SiteWhere 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 cop... |
<gh_stars>0
#ifndef __TFTP_EEPROM_H__
#define __TFTP_EEPROM_H__
void dut_tftp_eeprom(void);
#endif // __TFTP_EEPROM_H__
|
<gh_stars>1-10
package myimagej;
import java.io.File;
import java.io.FilenameFilter;
public class MyFileNameFilter implements FilenameFilter {
private String[] condition;
public MyFileNameFilter()
{
this.condition=new
String[]{".jpg",".JPG",".BMP",".bmp",".png",".PNG",".TIF","
.tif"};
}
public boolean accept(File dir, ... |
import java.util.HashMap;
import java.util.Map;
import java.util.Arrays;
public class FreqSort {
// Function to sort an array arr[] of size n
// in decreasing order of frequency
public static void sortByFreq(int[] arr)
{
// get the frequency of elements in arr
Map<Integer, Integer> freq = new HashMap<... |
#!/bin/bash
# Set your own EuRoC_PATH path to run ice-ba. Use './bin/ice_ba --help' to get the explanation for all of the flags. Flags [imgs_folder] and [iba_param_path] are necessary.
# Add flag '--save_feature' to save feature message and calibration file for back-end only mode
EuRoC_PATH=/home/nikolausmitchell/nod... |
var nameVar = 'John';
var nameVar = 'Mike';
console.log('nameVar', nameVar);
let nameLet = 'Jen';
// error cannot redefine
//let nameLet = 'Mike';
nameLet = 'Julie'
console.log('nameLet', nameLet)
const nameConst = 'Frank';
console.log('nameConst', nameConst)
function getPetName() {
var petName = 'Hal';
return ... |
'use strict';
module.exports = (sequelize, DataTypes) => {
const Role = sequelize.define('Role', {
name: DataTypes.STRING,
description: DataTypes.STRING
});
Role.associate = models => {
models.Role.belongsToMany(models.Privilege, {
through: 'RolePrivilege'
});
models.Role.belongsToMany... |
package codecheck.github.models
import org.json4s.JValue
case class ReviewRequest(value: JValue) extends AbstractJson(value) {
def id = get("id").toLong
def number = get("number").toLong
}
|
KUBEVIRT_VERSION=$(curl -s https://github.com/kubevirt/kubevirt/releases/latest | grep -o "v[0-9]\.[0-9]*\.[0-9]*")
#CDI_VERSION=$(curl -s https://github.com/kubevirt/containerized-data-importer/releases/latest | grep -o "v[0-9]\.[0-9]*\.[0-9]*")
CDI_VERSION="v1.29.0"
VIRTCTL_DOWNLOAD_URL="https://github.com/kubevirt/... |
<filename>controllers/api/index.js
// required modules
const router = require("express").Router();
const userRoutes = require("./user-routes");
const propertyRoutes = require("./property-routes");
//routes to use
router.use("/users", userRoutes);
router.use("/property", propertyRoutes);
module.exports = router;
|
#!/bin/bash
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distri... |
<gh_stars>1-10
package btc
const (
MaxTimeStamp = 4762368000
TIMESTAMP = "timestamp"
)
|
# Copyright 2015 Alexey Baranov <me@kotiki.cc>. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
#!/usr/bin/env bats
help() {
bash "${BATS_TEST_DIRNAME}"/../dotbare -h
}
addall() {
bash "${BATS_TEST_DIRNAME}"/../dotbare add --all
}
routing() {
"${BATS_TEST_DIRNAME}"/../dotbare fadd -h
}
routing2() {
"${BATS_TEST_DIRNAME}"/../dotbare flog -h
}
normal_git() {
export PATH="${BATS_TEST_DIRNAME}:$PATH"
... |
import React from "react"
import Seo from "../components/seo"
function SermonPage () {
return (
<>
<Seo title="Sermon" />
<div>설교</div>
</>
);
}
export default SermonPage; |
<reponame>Igorocky/jfxutils
package org.igye.jfxutils.exceptions
class JfxUtilsException(msg: String) extends Exception(msg) |
def processImageURLs(categories):
image_urls = []
for cat in categories:
if 'picture' in cat and cat['picture']:
image_urls.append(f"{cat['user_id']}/s_{cat['picture']}")
return image_urls |
#!/bin/sh
FLOW=$1
cp lib/lib.js lib/lib.js.orig
# This should not cause the Flow server to die
$FLOW force-recheck --no-auto-start lib/lib/js
echo "first status, after recheck"
$FLOW status --no-auto-start 2>/dev/null
# This also should not cause the Flow server to die
touch lib/lib.js
echo "second status, after to... |
<filename>main/plugins/org.talend.repository/src/main/java/org/talend/repository/MigrationDIMetadataItemService.java
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement availabl... |
#!/bin/sh
# Do an automated release to NPM.
#
# Due to some weirdnesses with npm pathes, be sure to call this script from the
# root directory of the project (e.g. via ./scripts/release.sh).
NPM_REGISTRY="registry.npmjs.org"
# Are we logged in to NPM? Check for a *repo-scoped* .npmrc file (e.g. in the
# project direct... |
<gh_stars>100-1000
/* spread.h -- Spread an array into an additional dimension
Copyright (C) 2017 European Centre for Medium-Range Weather Forecasts
Author: <NAME> <<EMAIL>>
This file is part of the Adept library.
*/
#ifndef AdeptSpread_H
#define AdeptSpread_H
#include <adept/Array.h... |
<reponame>seawindnick/javaFamily<filename>offer/src/main/java/com/java/study/algorithm/zuo/bbasic/class_03/Code_13_CopyListWithRandom.java
package com.java.study.algorithm.zuo.bbasic.class_03;
public class Code_13_CopyListWithRandom{
} |
# Clean up the old resources
rm -f design.*
rm -f design_resources.*
pyrcc4 -py3 ../designer/design_resources.qrc -o design_resources.py
pyuic4 ../designer/design.ui -o design_temp.py
# Can't figure out how to force pyuic to correctly link design_resources
sed 's/design_resources_rc/design_resources/' design_temp.py ... |
#!/bin/bash
# 本脚本的作用是
# 1. 项目打包
# 2. 上传云主机
# 3. 远程登录云主机并执行reset脚本
# 请设置云主机的IP地址和账户
# 例如 ubuntu@118.24.0.153
REMOTE=weblogic@148.70.134.173
# 请设置本地SSH私钥文件id_rsa路径
# 例如 /home/litemall/id_rsa
ID_RSA=
if test -z "$REMOTE"
then
echo "weblogic@148.70.134.173"
exit -1
fi
if test -z "$ID_RSA"
then
echo "weblogic@148.... |
<gh_stars>1-10
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
import { t } from '../../../utils';
import toastr from 'toastr';
Accounts.onEmailVerificationLink(function(token, done) {
Accounts.verifyEmail(token, function(error) {
if (error == null) {
toastr.success(t('Em... |
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import '@testing-library/jest-dom/extend-expect';
import { render } from '@testing-library/react';
import * as fs from 'fs';
import * as path from 'path';
import Sandbox, { SandboxContructor } from '@ice/sandbox';
import renderModules, {
getModul... |
#!/bin/bash
# Run WordPress docker entrypoint.
. docker-entrypoint.sh 'apache2'
set +u
# Ensure mysql is loaded
dockerize -wait tcp://${DB_HOST}:${DB_HOST_PORT:-3306} -timeout 1m
# Config WordPress
if [ ! -f "${WP_ROOT_FOLDER}/wp-config.php" ]; then
wp config create \
--path="${WP_ROOT_FOLDER}" \
... |
<reponame>uscope-platform/makefile_gen<gh_stars>0
// Generated from /home/fils/git/makefilegen_v2/grammars/sv2017.g4 by ANTLR 4.9.2
#include "sv2017BaseListener.h"
using namespace mgp_sv;
|
#!/bin/bash
for f in `grep -l "Tactic call ran for .* (success)" logs$1/*.log`; do basename $f; done > successes$1.log
|
<filename>src/app/upload-files-example/upload-files-example.component.ts
import { Component, OnInit } from '@angular/core';
import { MediaObserver } from '@angular/flex-layout';
import { PipFileUploadService } from 'pip-webui2-files';
@Component({
selector: 'app-upload-files-example',
templateUrl: './upload-files-... |
window._ = require('lodash')
window.Vue = require('vue').default;
import VuetifyToast from 'vuetify-toast-snackbar-ng'
import setup from './interceptors/interceptors.js'
setup()
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import Loader from './core/base/Loader.vue'
Vue.component('loader', Loader)
// impo... |
#!/bin/bash
#
# 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 file
# to you under the Apache License, Version 2.0 (the
# "License");... |
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
import { User } from '../../users/schemas/user.schema';
import { Payment, PaymentSchema } from '../schemas/payment.schema';
import { LiftBooking, LiftBookingSchema } from '../../lift/schemas/liftBooking.schema';
import ... |
const express = require("express");
const app = express();
const data = [
{ id: 1, name: "Alice", age: 25 },
{ id: 2, name: "Bob", age: 30 },
{ id: 3, name: "Charlie", age: 28 }
];
app.get("/", function (request, response) {
response.json(data);
});
app.listen(3000, () => {
console.log("Server running on p... |
"""
We want... a shrubbery!
"""
print "We want... a shrubbery!"
|
import React, {
Component,
PropTypes,
} from 'react';
import ReactDOM from 'react-dom';
let _MediumEditor;
if (typeof document !== 'undefined') {
_MediumEditor = require('medium-editor');
}
export default class MediumEditor extends Component {
static propTypes = {
tag: PropTypes.string,
... |
#!/bin/bash
cp -r ~/nfra/sync-browser-mocks/src/* node_modules/sync-browser-mocks/src/ \
&& cp -r ~/nfra/post-robot/src/* node_modules/post-robot/src/ \
&& cp -r ~/nfra/zoid/src/* node_modules/zoid/src/ \
&& cp -r ~/nfra/beaver-logger/src/* node_modules/beaver-logger/src/ \
&& cp -r ~/nfra/cross-domain-utils/s... |
class EnemyTrackingSystem {
constructor() {
this.enemyActors = new Map();
}
addEnemyActor(actor) {
this.enemyActors.set(actor.getID(), actor);
}
getEnemyActors() {
return Array.from(this.enemyActors.values());
}
hasEnemyActor(actorID) {
return this.enemyActors.has(actorID);
}
}
// Us... |
import request from 'supertest';
import { before, after } from 'mocha';
import { auth } from './auth';
/**
* Navigates to the STAC catalog route for the given job ID
*
* @param app - The express application (typically this.frontend)
* @param jobId - The job ID
* @returns An awaitable object that resolves to the r... |
import styled from "styled-components"
export const CommentsWrapper = styled.section`
margin: auto;
max-width: 70rem;
padding: 3rem 6.4rem 3rem;
iframe[src*="ads-iframe"] {
display: none;
}
#disqus_thread {
a {
color: --highlight !important;
}
}
`
export const CommentsTitle = styled.h2... |
func applyConfiguration(configuration: Configuration) -> Sublayout {
var modifiedSublayout: Sublayout = configuration.sublayout
for property in configuration.properties {
switch property {
case .backgroundColor(let color):
// Apply background color to the sublayout
// (I... |
#!/bin/bash
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
echo $timestamp ": Start script." >> /tmp/blackvue.log
pid_file="/tmp/blackvue.pid"
/opt/bin/find $pid_file -type f -mtime +2 -exec rm {} \;
if [ -f $pid_file ]; then
echo $timestamp ": PID file exists." >> /tmp/blackvue.log
exit 0
fi
touch $pid_file
cd /s... |
/**
* Update the teacher's information in the database.
*
* @param int $id The ID of the teacher to be updated.
* @param string $name The updated name of the teacher.
* @param string $email The updated email of the teacher.
* @return string A success message if the update is successful, or an error message if the... |
def should_install(instance):
generated_sources = instance.get_generated_sources()
sources = instance.get_sources()
return bool(generated_sources or sources) |
<filename>u-boot/drivers/video/sunxi/disp2/tv/de_tve_sun8iw11.h
#ifndef __DE_TVE_SUN8IW11_H__
#define __DE_TVE_SUN8IW11_H__
#define TVE_GET_REG_BASE(sel) (tve_reg_base[sel])
#define TVE_WUINT32(sel,offset,value) (*((volatile u32 *)( TVE_GET_REG_BASE(sel) + (offset) ))=(value))
#define TVE_R... |
var peer = null,
comp = null,
player,
ship={type:"Sub",
btn:null,
col:"gray"},
config={size:0,
vcalc:0,
gameon:true,
plyrone:false,
p2ready:false,
opp:"Player 2"
};
document.getElementById("plselect").onclick = function(evt) {
//get user's name
if (ev... |
/******************************************************************************
* Copyright 2011 Kitware 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.... |
# -----------------------------------------------------------------------------
# This file is part of the xPack distribution.
# (https://xpack.github.io)
# Copyright (c) 2020 Liviu Ionescu.
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose is hereby granted, under the terms of t... |
import requests
# Leitura de um campo do canal(temperatura e umidade) em JSON - Requisição de visualização de dados
r = requests.get('https://api.thingspeak.com/channels/1226973/fields/1.json?api_key=RTLY3MGRNANNANTQ&results=2')
# Atualização - Requisição de envio de dados
# r = requests.get('https://api.thingspeak.c... |
const errorHandling = require('../../utils/errorHandling')
const { requiredFields } = require('../../config/errors')
const formatNumberResult = require('../secondary/formatNumberResult')
/**
* @description Calcule les counter premiers nombres de la suite de fibonacci.
* @param {number} counter
*/
function fibonacci... |
<reponame>ritaswc/wechat_app_template
// pages/shenghuo/GoodLife/LifeSearchList/LifeSearchList.js
const config = require('../../../../config')
var util = require('../../../../utils/util.js')
var longt = ""
var lati = ""
var CategoryId = ""
var CtiyName = ""
var pageNo = 0;
Page({
/**
* 页面的初始数据
*/
data: {
... |
public class Calculator {
public Calculator() { }
public int add(int a, int b) {
return a + b;
}
public int sub(int a, int b) {
return a - b;
}
public int mul(int a, int b) {
return a * b;
}
public int div(int a, int b) {
return a / b;
}
} |
import random
import string
def random_password(length):
characters = string.ascii_letters + string.digits + '!@#$%^&*()'
password = ''.join(random.choice(characters) for i in range(length))
return password
if __name__ == '__main__':
print(random_password(8)) |
require_relative '../classes/person'
describe Person do
context 'check person class' do
age = 20
name = 'John'
parent_permission = false
person = Person.new(age, name, parent_permission)
it 'should be the class person' do
expect(person.class).to eq Person
end
it 'should have an ag... |
package main
import (
"database/sql"
"io/ioutil"
"log"
"net/http"
"net/url"
"regexp"
_ "github.com/go-sql-driver/mysql"
)
func main() {
// Connecting to the database.
db, err := sql.Open("mysql", "root:@/crawler")
if err != nil {
log.Fatal(err)
}
defer db.Close()
// Querying data from the website.
r... |
package cache
import "srcd.works/go-git.v4/plumbing"
const (
initialQueueSize = 20
MaxSize = 10 * MiByte
)
type ObjectFIFO struct {
objects map[plumbing.Hash]plumbing.EncodedObject
order *queue
maxSize int64
actualSize int64
}
// NewObjectFIFO returns an Object cache that keeps the newest objec... |
#!/bin/bash
#SBATCH --account=project_2001659
#SBATCH --cores=10
#SBATCH --partition=test
#SBATCH --time=00:15:00
export PERMEDCOE_IMAGES=$(readlink -f $(pwd)/../../../BuildingBlocks/Resources/images/)/
export PERMEDCOE_ASSETS=$(readlink -f $(pwd)/../../../BuildingBlocks/Resources/assets/)/
export _DATA_DIR=$(readlin... |
<filename>src/components/CreatePost.js
import React from "react"
import "./CreatePost.css"
import {
Row,
Col,
Image,
Button,
Form,
Card,
FloatingLabel,
} from "react-bootstrap"
import * as Yup from "yup"
import { useForm } from "react-hook-form"
import ReactCommonmark from "react-commonmark"
import { yupR... |
import Navbar from '../components/Navbar.vue';
export default {
title: 'Navbar',
component: Navbar,
};
export const DefaultState = () => ({
components: {
navbar: Navbar
},
template: `<navbar> </navbar>`
}); |
#!/bin/bash
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.