text
stringlengths
1
1.05M
#!/usr/bin/env sh set -evx # Install mongod of specified version, unpack and create a link to the bin # directory: ${TRAVIS_BUILD_DIR}/t/Travis-ci/MongoDB version=$1 if [ ! $version ] then echo "No version given to go for" exit 1 fi echo Installing MongoDB version $1 if [ "${TRAVIS_BUILD_DIR}x" == "x" ] then ...
import sys import tensorflow as tf import tensorflow_addons as tfa from encoder import Encoder from decoder import Decoder import utils class QG(tf.keras.Model): PAD = 0 GO = 1 EOS = 2 UNK = 3 def __init__(self, params): super(QG, self).__init__() self.vocab_size = params['voca_...
#!/bin/bash -eu # Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
import { customElement } from '../../../../../../runtime'; @customElement({ name: 'beta', template: `<template>BETA <input> <a href="alpha">Alpha</a></template>` }) export class Beta { }
const OPEN_ADD_SYSTEM_MODAL = 'OPEN_ADD_SYSTEM_MODAL'; const SELECT_ACTIVE_TAB = 'SELECT_ACTIVE_TAB'; const SET_SELECTED_SYSTEMS_COMPARISON = 'SET_SELECTED_SYSTEMS_COMPARISON'; const HANDLE_SYSTEM_SELECTION = 'HANDLE_SYSTEM_SELECTION'; const HANDLE_BASELINE_SELECTION = 'HANDLE_BASELINE_SELECTION'; const HANDLE_HSP_SELE...
import Dialog from '@material-ui/core/Dialog'; import Box from '@material-ui/core/Box'; import Button from '@material-ui/core/Button'; function UserDeleteDialog(props) { if (!props.open) { return null; } return <Dialog PaperProps={{className: props.classes.dialogPaper}} open={props.open} onClose={p...
#!/bin/bash # # CIS Debian 7 Hardening # # # 6.14 Ensure SNMP Server is not enabled (Not Scored) # set -e # One error, it's over set -u # One variable unset, it's over PACKAGES='snmpd' # This function will be called if the script status is on enabled / audit mode audit () { for PACKAGE in $PACKAGES; do ...
const db = require('../../data/db-config'); const findAll = async () => { return await db('books'); }; const findBy = (filter) => { return db('books').where(filter); }; const findById = (id) => { return db('books').where({ id }).first(); }; const create = async (book) => { const [id] = await db('books').ins...
#!/bin/bash # Simple script just to generate the initial template, which # 1. creates IAM Users # 2. assigns IAM User to the same existing IAM Group(s) # 3. creates IAM Access Key and Secret for each IAM User OUTPUT_FILE=tmp_users.template declare -a USERS=( "Firstname Lastname" ) # Add Header cat > ${OUTPUT_FILE...
<reponame>diegosiqueir4/wmss package de.wwu.wmss.core; public class Resource { private String resourceURL = ""; private String resourceLabel = ""; private String action = ""; private String resourceType = ""; public Resource() { super(); } public Resource(String url, String label) { super(); this.resou...
<filename>AP2/src/teorica/thread/BarraProgresso.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package teorica.thread; import java.util.logging.Level; import java.util.logging...
package restauthserver; import fontysmultipurposelibrary.logging.Logger; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class PropertyFileHelper { private PropertyFileHelper() {} public static String getDbConnectionString() { Properties properties = new Properties()...
<filename>FEBioXML/FEBModel.cpp /*This file is part of the FEBio source code and is licensed under the MIT license listed below. See Copyright-FEBio.txt for details. Copyright (c) 2020 University of Utah, The Trustees of Columbia University in the City of New York, and others. Permission is hereby granted, free of ...
#!/usr/bin/env sh # This script is used for testing using Travis # It is intended to work on their VM set up: Ubuntu 12.04 LTS # A minimal current TL is installed adding only the packages that are # required # See if there is a cached version of TL available export PATH=/tmp/texlive/bin/x86_64-linux:$PATH if ! comman...
<filename>shaders/blurbycoch.c #include "blurbycoc.c" #ifdef FRAGMENT_SHADER void main(void) { vec2 d=vec2(1.0/scrnsz.x, 0.0) gl_FragColor=vec4(gaussblur(g_texcoord).rgb,1.0); } #endif
<reponame>wujia28762/Tmate package com.honyum.elevatorMan.adapter; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.honyum.elevatorMan.R; import com.honyum.elevatorMan.data.RepairTaskInfo; import java.util.List; /** * Created by 李有...
#!/usr/bin/env bash # Copyright 2017 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # # This script will build perfops-cli and calculate hash for each # (PERFOPS_BUILD_PLATFORMS, PERFOPS_BUILD_ARCHS) pair. # PERFOPS_BUILD_PLATFO...
// message.model.ts import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; @Schema() export class Message extends Document { @Prop({ required: true }) sender: string; @Prop({ required: true }) recipient: string; @Prop({ required: true }) content: string; @...
A hash table might be a suitable data structure for efficient look up of objects with one to many relationship. A hash table is a type of data structure, in which data is stored in a searchable key-value store. The keys are generated by a hash function, which maps the data items to integers. To look up an object, the h...
python selection.py \ --data_root=data/DAVIS-2017-trainval/ \ --data_list=data/list/DAVIS_2017_val.txt \ --resize_h=448 \ --resize_w=832 \ --gpu='0' \ --select_file=select_files/davis17.txt \ --restore_select=pretrained_models/davis17.pth
import Airtable from 'airtable' // @ts-ignore const airtable = new Airtable({ apiKey: '<KEY>' }) const base = airtable.base('appjycbdxoV3Nsovw'); // The table names in airtable export type TableName = 'Technology Type' | 'Purpose' | 'Data Type' | 'Data Process' | 'Access' | 'Storage' | 'Accountability' ...
package com.honyum.elevatorMan.net; import com.honyum.elevatorMan.net.base.RequestBean; import com.honyum.elevatorMan.net.base.RequestHead; import java.io.Serializable; public class UploadVideoRequest extends RequestBean { private RequestHead head; private RequestBody body; public RequestHead getHead...
#!/bin/sh # CYBERWATCH SAS - 2017 # # Security fix for USN-2865-1 # # Security announcement date: 2016-01-08 00:00:00 UTC # Script generation date: 2017-02-01 21:03:30 UTC # # Operating System: Ubuntu 12.04 LTS # Architecture: i386 # # Vulnerable packages fix on version: # - libgnutlsxx27:2.12.14-5ubuntu3.11 # ...
#!/bin/sh set -eu docker run -v "$(pwd):/var/task" -w /var/task mhart/alpine-node:12 /bin/sh -c \ 'yarn lint && yarn test --coverage'
package com.prisma.integration import com.prisma.IgnoreSQLite import org.scalatest.{FlatSpec, Matchers} class ChangingFromRelationToScalarOrBackSpec extends FlatSpec with Matchers with IntegrationBaseSpec { "Changing a field from scalar to relation" should "work when there is no data yet" taggedAs (IgnoreSQLite) i...
#/bin/sh # Generate test result data for xstormy16 GAS testing. # This script is machine generated. # It is intended to be run in the testsuite source directory. # # Syntax: build.sh /path/to/build/gas if [ $# = 0 ] ; then if [ ! -x ../gas/as-new ] ; then echo "Usage: $0 [/path/to/gas/build]" else BUILD=`p...
<gh_stars>10-100 #include "filelist.hpp" static std::string ToLowercase (const std::string& str) { std::string res = str; for (char& c : res) { c = std::tolower (c); } return res; } File::File () : path (), content () { } File::File (const std::string& path, const Buffer& content) : path (path), content (c...
<reponame>rcarlosdasilva/weixin<gh_stars>1-10 package io.github.rcarlosdasilva.weixin.core.exception; public class CanNotFetchOpenPlatformLicensorAccessTokenException extends RuntimeException { private static final long serialVersionUID = 2813748303142990709L; }
package edu.ncsu.csc316.hub_manager.ui; import java.util.Scanner; import edu.ncsu.csc316.hub_manager.manager.AirlineHubManager; /** * Allows the user to interact with the program AirlineHubManager * @author <NAME> * */ public class AirlineHubManagerUI { /** * The main method which starts interaction between...
using System; using System.Collections.Generic; public class Product { public string Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } } public class AlternateRepository { private Dictionary<string, Product> products; public AlternateRepository() { p...
def replaceVowels(string) vowels = ["a", "e", "i", "o", "u"] new_string = "" string.each_char do |char| if vowels.include? char new_string += "-" else new_string += char end end return new_string end puts replaceVowels("Hello World!")
#!/usr/bin/env bash set -e -o pipefail cd `dirname $0` # Track payload size functions source ../scripts/ci/payload-size.sh source ./_payload-limits.sh # Workaround https://github.com/yarnpkg/yarn/issues/2165 # Yarn will cache file://dist URIs and not update Angular code readonly cache=.yarn_local_cache function rm_...
<reponame>mikrowelt/tmc24-components import Sidebar from './src/sidebar'; export default Sidebar;
def find_min_max(a, b, c): max_num = max(a, b, c) min_num = min(a, b, c) return min_num, max_num if __name__ == '__main__': a = 4 b = 3 c = 7 min_num, max_num = find_min_max(a, b, c) print(f"Minimum number is {min_num} and maximum number is {max_num}")
<filename>app/controllers/menu/iosNavBar.js var args = arguments[0] || {}; var parentWindow = args.parentWindow; function closeWindow(){ Alloy.Globals.navigationWindow = null; parentWindow.close(); }
#pragma once #include <thread> #include "../handles.h" #include "../repositories/system_status_repository.h" #include "basic_command.h" /** * @file fan_command.h * @author Group 7 - Informatica */ namespace goliath::commands { class SynchronizeSystemStatusCommand : public BasicCommand { public: S...
<filename>tests/pipeline_test.py<gh_stars>0 import math import os import unittest from pipeline import Pipeline import pandas as pd from spacy.tokens.doc import Doc as sp_Doc from utilities.spacy_utilities import Spacy_Manager class PipelineTests(unittest.TestCase): # Set up and helper functions def setUp(self...
<gh_stars>0 function getAllFeedback() { $.get("/feedback/all", function (data) { if (data) { data.forEach(feedback => { var radio_resolved_checked = ""; var radio_unresolved_checked = ""; if (feedback.status) { radio_resolv...
class PointerEventHandler { func handle(event: PointerEvent) { switch event { case .Mouse(.Button(let buttonEvent)): switch buttonEvent { case .Left: print("Left mouse button clicked") case .Right: print("Right mouse button clicked"...
#!/bin/bash . ./scripts/utils/utils.sh function print_usage { usage_header ${0} usage_option " -n <network> : Network to use (localhost, yeouido, euljiro or mainnet)" usage_option " -r : Name of the address" usage_option " -a : Address value" usage_footer exit 1 } function process { if [...
/* * Copyright 1999-2018 Alibaba Group Holding 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
<reponame>zouvier/BlockChain-Voting import type { ProjectPathsConfig, SolcConfig } from "../../types"; export interface CacheEntry { lastModificationDate: number; contentHash: string; sourceName: string; solcConfig: SolcConfig; imports: string[]; versionPragmas: string[]; artifacts: string[]...
var mongoose = require("mongoose"); var Schema = mongoose.Schema; var MovieSchema = new Schema({ id: Number, moviename: { type: String, unique: true }, year: String, plot: String, poster: String, date: { type: Date, default: Date.now } }); module.exports = mongoose.model("Movie", MovieSchema);
#!/bin/sh framework_version="$1" podspec_path="PhyKitCocoapod.podspec" echo "$framework_version" function updatePodspec { i_podspec_path="$1" i_version="$2" version_string="automaticVersion = '$i_version'" echo "Updating podspec version to $i_version" sed -i '' "1s/.*/${version_string}/" "$i_podspec_pat...
<gh_stars>0 import React, {PropTypes} from "react"; import {bindActionCreators} from "redux"; import {connect} from "react-redux"; import * as dialogActions from "../../actions/dialogActions"; import { Button, ButtonType, Dialog, DialogType } from "office-ui-fabric-react"; /** * Dialog Demo */ const DialogDe...
<gh_stars>0 'use strict'; const util = require('util'); const path = require('path'); const fs = require('fs'); const flatten = require('uvwlib/lib/utils/flatten'); function resolve () { return path.resolve.apply(null, flatten(arguments)); } const utils = { inspect: function (obj, opts = { showHidden: false, dep...
package com.ur.urcap.examples.idletime.impl; import com.ur.urcap.api.contribution.ProgramNodeContribution; import com.ur.urcap.api.contribution.ProgramNodeService; import com.ur.urcap.api.domain.URCapAPI; import com.ur.urcap.api.domain.data.DataModel; import java.io.InputStream; public class IdleTimeProgramNodeServi...
export DOWNLOAD_PATH="data/" #wget https://www.mpi-inf.mpg.de/departments/computer-vision-and-multimodal-computing/research/gaze-based-human-computer-interaction/appearance-based-gaze-estimation-in-the-wild-mpiigaze/ -P $download_path # test download path wget https://www.mpi-inf.mpg.de/fileadmin/inf/d2/xucong/MPIIGa...
package com.twu.biblioteca; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import java.io.ByteArrayInputStream; import java.util.Scanner; import static com.twu.biblioteca.Library.*; import static org.hamcrest.core.Is.is; import static org.hamcrest.cor...
#!/bin/bash CORE=`lscpu | grep socket | grep -o "[0-9]*"` HYPER=`lscpu | grep core | grep -o "[0-9]*"` MAX_THREAD=`expr $(($CORE*$HYPER))` SELECT_GRAPH=$1 SAMPLE_RATIO=$2 PARALLEL=$3 MINIMUM_RATIO=$4 AVERAGE=$5 rm *.txt rm *.ans rm *.exectime rm *.rwtime if [ "$(($3+1))" -gt "$MAX_THREAD" ] then echo "Exceed Max Thre...
"""A DLite storage plugin for BSON written in Python.""" import os import bson as pybson # Must be pymongo.bson import dlite from dlite.options import Options from dlite.utils import instance_from_dict class bson(DLiteStorageBase): """DLite storage plugin for BSON.""" def open(self, uri, options=None): ...
#!/usr/bin/env 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 "Licens...
from bs4 import BeautifulSoup # Given HTML code snippet html_code = ''' </div> </div> </div> </div> </t...
<gh_stars>1-10 package im.status.keycard.applet; import java.util.Arrays; /** * Tiny BER-TLV implementation. Not for general usage, but fast and easy to use for this project. */ public class TinyBERTLV { public static final byte TLV_BOOL = (byte) 0x01; public static final byte TLV_INT = (byte) 0x02; public s...
def sort_list(List): for i in range(len(List)-1, 0, -1): for j in range(i): if List[j] < List[j+1]: List[j], List[j+1] = List[j+1], List[j] return List List = [3, 4, 1, 2] sorted_list = sort_list(List) print(sorted_list) # [4, 3, 2, 1]
<gh_stars>1-10 class ApplicationController < ActionController::Base before_action :authenticate_user! before_action :configure_permitted_parameters, if: :devise_controller? private def configure_permitted_parameters devise_parameter_sanitizer.permit(:sign_up, keys: [:role]) end def after_sign_in_path...
#!/bin/bash function help() { echo "USAGE: scripts/startLocalCluster.sh [options]" echo "" echo "OPTIONS:" echo " -a/--nagents # agents (odd integer default: 1))" echo " -c/--ncoordinators # coordinators (odd integer default: 1))" echo " -d/--ndbservers # db servers ...
/* * * Copyright © ${year} ${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 agreed...
import random # Create an empty list data = [] # Generate 20 names and ages for i in range(20): name = 'Name ' + str(i) age = random.randint(18, 70) # Append the data to the list data.append([name, age]) # Print out the list print(data) # [['Name 0', 64], # ['Name 1', 18], # ['Name 2', 24], # ['Name 3', 36],...
const Discord = require("discord.js"); const client = new Discord.Client(); const DiscordAntiSpam = require("discord-anti-spam"); const AntiSpam = new DiscordAntiSpam({ warnThreshold: 3, // Amount of messages sent in a row that will cause a warning. banThreshold: 7, // Amount of messages sent in a row that will cau...
<filename>src/js/sharedMethods.js const shared = (() => { const setIcon = (main, description, iconId) => { const otherConditions = 'mist smoke haze dust fog sand ash squall'; let icon; if (iconId.includes('d')) { if (main === 'Clear' && description === 'clear sky') { icon = 'fas fa-sun'; } if ...
<gh_stars>1-10 package main import ( "encoding/json" "fmt" "os" "gstack.io/concourse/keyval-resource/models" ) func main() { var request models.CheckRequest err := json.NewDecoder(os.Stdin).Decode(&request) if err != nil { fmt.Fprintln(os.Stderr, "parse error:", err.Error()) os.Exit(1) } response := mo...
<gh_stars>0 // Add this line to your host manifest.js for Sprockets 4 //= link_directory ../javascripts .js //= link_directory ../stylesheets .css //= link dfm_web/manifest.js
import * as React from 'react'; import glamorous , {ThemeProvider, /* Div */} from 'glamorous'; import * as Palettes from '../globals/palette'; import {items, farItems} from '../globals/header'; import { loadTheme } from 'office-ui-fabric-react/lib/Styling'; import { Nav, INavProps } from 'office-ui-fabric-react/lib/Na...
#!/usr/bin/env bash # # Copyright (c) 2018 The Widecoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Check the test suite naming conventions export LC_ALL=C EXIT_CODE=0 NAMING_INCONSISTENCIES=$(git grep -E ...
package com.acxiom.pipeline.streaming import com.acxiom.pipeline.utils.StreamingUtils import com.acxiom.pipeline.{Constants, PipelineContext, PipelineException} import org.apache.log4j.Logger import org.apache.spark.sql.streaming.StreamingQuery import java.text.SimpleDateFormat import java.util.Date trait StreamingQ...
<reponame>padunlap/homework<filename>Develop/script.js // Assignment Code var generateBtn = document.querySelector("#generate"); function isNumeric(str) { if (typeof str != "string") return false // we only process strings! return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseF...
const { whitespaceNormalize, replaceDisallowedChars } = require('../index') test('whitespaceNormalize', () => { expect(whitespaceNormalize('\n\r\t a \t\n\rb\r\t\n')).toBe('a b') }) test('replaceDisallowedChars', () => { const chars = (from, to) => { function * codepoints (start, stop) { while (start <= ...
const { isTagNode } = require("../../knife/tag_utils"); const knife = require("../../knife"); module.exports = { name: "img-req-alt", on: ["dom"], need: "dom", validateConfig(option) { if (typeof option === "string" && option !== "allownull") { throw new Error(`Configuration for rule "${this.name}" i...
#!/bin/sh set -v -x export BLDBASE="`pwd`" export INC_DIR="$BLDBASE/base/include" export FEZLYNX_INCLUDE_PATH="-I $INC_DIR -I $INC_DIR/Mainboards -I $INC_DIR/Core -I $INC_DIR/Modules" jdo() { cd $BLDBASE/base/src/$1 #-m32 -march=i486 g++ -g -O1 -c $FEZLYNX_INCLUDE_PATH $BLDBASE/base/src/$1/*.cpp ar -...
export * from 'src/javascript/ContentEditorExtensions/SelectorTypes/StringWidenPicker/components/ViewerJsx/ReferenceCard';
/** * Spring Data JPA Repositories */ package com.test.sampleapp.repository;
<reponame>klaasg/medgen-mysql<gh_stars>1-10 call log('create_index.sql','NCBI PubTator'); call log('mutation2pubtator', 'create index'); call create_index('mutation2pubtator','PMID'); call create_index('mutation2pubtator','Components'); -- ################################################################# call l...
widget.SplitView = function () { var currentSplitView = null; function getSplitView(target) { var container = Dom.findParentWithProperty(target, "_splitView"); if (!container) return null; return container._splitView; } function handleMouseDown(event) { Dom.cancelEvent(ev...
#!/bin/bash #======================================================== # Filename: install.sh # # Description: # Install script for the Reverseproxy module. # #======================================================== # add installed file and inform user modulename="Reverseproxy" #let user add domains $UTILS/domain...
#!/bin/sh hostname
<reponame>spadaal/p5-asteroids class Asteroid { constructor(pos, vel, r) { this.pos = pos ? pos : createVector(random(width), random(height)); this.r = r; this.vel = vel ? vel : createVector(random(5) - 2.5, random(5) - 2.5); this.offsets = []; for (var i=0;i<16;i++) this.off...
from tensorflow.keras.layers import * from tensorflow.keras.models import * modelnames = {"3ds":"3D_SingleStream", "3dm":"3D_MultiStream", "3dmorig":"3D_MultiStreamOriginal", "3ddropout":"3D_UsingDropout" } def readProperModel(model_name, img_size): if model_name == "3dm": model = getModel_3D_Multi([img_...
# Flag indicating if we've previously jumped to last directory typeset -g ZSH_LAST_WORKING_DIRECTORY # Updates the last directory once directory is changed chpwd_functions+=(chpwd_last_working_dir) chpwd_last_working_dir() { local cache_file="$ZSH_CACHE_DIR/last-working-dir" pwd >| "$cache_file" } # Changes directo...
#!/bin/bash snap install bitwarden
#!/bin/bash #PBS -l nodes=4:ppn=16 #PBS -l walltime=40:00:00 module load gcc/5.3.1 module load openmpi/1.10.1 module load netcdf/4.4.1 #rm log-fix-size-prog.txt || true #rm log-fix-size-time.txt || true cd /storage/home/w/wuh20/github/LinearSystemSolvers/scripts/final/profile3 { time mpirun -np 1 ../../../output/...
#!/bin/bash # Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation # # 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 # ...
/* * ==================================================================== * 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 ...
#!/bin/bash source $HOME/.deploy/.env source $HOME/.deploy/.formatting source $HOME/.deploy/functions.sh setMysqlParams prod="" clear header maestroInstall menuProd
#!/bin/bash set -euo pipefail pip install setuptools_scm # The environment variable AEDGE_INSTALLER_VERSION needs to be defined. # If the env variable NOTARIZE and the username and password variables are # set, this will attempt to Notarize the signed DMG. AEDGE_INSTALLER_VERSION=$(python installer-version.py) if [ ...
# This hook applies patches from "patches" directory. _process_patch() { local _args= _patch= i=$1 _args="-Np0" _patch=${i##*/} if [ -f $PATCHESDIR/${_patch}.args ]; then _args=$(cat $PATCHESDIR/${_patch}.args) elif [ -n "$patch_args" ]; then _args=$patch_args fi cp -f $i "$wrksrc" # Try to guess if its...
// 1. Creating Arrays let firstArray = [ "a", "b", "c" ]; let secondArray = [ "d", "e", "f" ]; // 2. Access an Array Item console.log( firstArray[ 0 ] ); // Results: "a" // 3. Loop over an Array firstArray.forEach( (item, index, array) => { console.log( item, index ); } ); // Results: // a 0 // b 1 // c 2 // 4. Ad...
<gh_stars>0 """ speakstatus.py - 2016 <NAME> This is a script designed to speak "status" info such as the time/public transport/appointments/etc etc. It is intended to be periodically run from cron or similarly triggered such as at login and uses espeak in a subprocess to do the actual speaking. CONFIGURATION: There ...
module.exports = { extends: ['@bigcommerce/eslint-config'], };
<filename>misc/impl/service/im_member_service.go /* * Copyright © 2019 <NAME>. */ package service import ( "context" "github.com/hedzr/voxr-api/api/v10" "github.com/hedzr/voxr-lite/internal/exception" ) type ImMemberService struct { } func (s *ImMemberService) AddMember(ctx context.Context, req *v10.AddMemberR...
# (User's) Problem # We Have: # int # We Need: # from 1 to int as string # We Must: # function name (unclear) # str output # # Solution (Product) # use recusive function to get n factorial def recursive_factorial(n): n = int(n) # base case if n == 1: return print(n, end="") ...
echo "******************************************************************************" echo "Check if this is the first run." `date` echo "******************************************************************************" FIRST_RUN="false" if [ ! -f ~/CONTAINER_ALREADY_STARTED_FLAG ]; then echo "First run." FIRST_RUN="...
""" Creating a Database in MySQL to Store Information About Employees """ CREATE DATABASE employee_db; USE employee_db; CREATE TABLE employees ( employee_id INT AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(50), last_name VARCHAR(50), job_title VARCHAR(50), date_of_birth DATE, date_of_hire D...
# ocr.py from PIL import Image, ImageEnhance def process_image(input_image_path, output_image_path): # Open the input image input_image = Image.open(input_image_path) # Enhance the image for improved contrast and sharpness enhanced_image = ImageEnhance.Contrast(input_image).enhance(1.5) enhanc...
/** * PAGE USER AGENT */ export const DEFAULT_DESKTOP_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0'; export const DEFAULT_MOBILE_USER_AGENT = 'Mozilla/5.0 (Linux; U; Android 2.2; en-us; DROID2 GLOBAL Build/S273) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 M...
#!/bin/bash : ${HADOOP_PREFIX:=/usr/local/hadoop} $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh rm /tmp/*.pid # installing libraries if any - (resource urls added comma separated to the ACP system variable) cd $HADOOP_PREFIX/share/hadoop/common ; for cp in ${ACP//,/ }; do echo == $cp; curl -LO $cp ; done; cd - # alteri...
<reponame>creative-gestalt/niklib-backend import * as path from 'path'; import { v4 as uuidv4 } from 'uuid'; export const readerFileFilter = (req, file, callback) => { if (!file.originalname.match(/\.(pdf|epub|png|jpg)$/)) { return callback( new Error('Only images and readable files are allowed!'), f...
#!/bin/sh # https://github.com/kubernetes/kubernetes/issues/39557 # "Failed to setup network for pod \ using network plugins \"cni\": no IP addresses available in network: podnet; Skipping pod" kubeadm reset -f systemctl stop kubelet systemctl stop docker rm -rf /var/lib/cni/ rm -rf /var/lib/kubelet/* rm -rf /etc/cni/ ...
// Input: 1->2->4, 1->3->4 // Output: 1->1->2->3->4->4 function solution(l1, l2) { let head = new ListNode(1); let dummy = head; while (l1 !== null && l2 !== null) { if (l1.val <= l2.val) { dummy.next = l1; l1 = l1.next; } else { dummy.next = l2; l2 = l2.next; } dummy =...
def get_first_element(result): if result: return result[0] return ''