text
stringlengths
1
1.05M
#!/bin/bash ############################################################################################################## quick_install=${1:-"N"} docker_network=${2:-'oracle_network'} db_file_name=${3:-'oracle-database-xe-18c-1.0-1.x86_64.rpm'} db_version=${4:-'18c'} db_sys_pwd=${5:-'oracle'} db_port=${6:-31521} em...
from converters.models import TuBlog, TuBlogUser, TuUser from src import create_app from converters import content from src.model.models import Blog, User, BlogParticipiation def convert(): create_app() def get_blog_type(blog): if blog.blog_type == "open": return 1 elif blog.blog_...
const express = require('express'); const router = express.Router(); const Book = require('../models/book'); // GET route: list all books router.get('/', async (req, res) => { try { const books = await Book.find(); res.json(books); } catch (err) { res.status(500).json({ message: err.message }); } }); // GET ...
import os def terminate_long_running_processes(processes, threshold): terminated_processes = [] for pid, running_time in processes: if running_time > threshold: os.system(f"kill -9 {pid}") terminated_processes.append(pid) return terminated_processes # Test the function proc...
#!/bin/bash -u # Copyright 2018 ConsenSys AG. # # 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 ...
$(document).ready(function () { refreshCharts() }); function refreshCharts() { $.getJSON("api/getBultPrice/", function (data) { var dailyPrice = []; $.each(data, function (key, val) { //var innerArr = [val[0], parseFloat(val[1]).toFixed(4)]; var innerArr = [val["Item1"...
<gh_stars>1-10 'use strict'; /* global MockSaveBookmarkHtml, BookmarkEditor, Bookmark, GridItemsFactory */ requireApp('homescreen/test/unit/mock_save_bookmark.html.js'); requireApp('homescreen/js/grid_components.js'); requireApp('homescreen/js/bookmark.js'); requireApp('homescreen/js/bookmark_editor.js'); require('/s...
<gh_stars>0 import renderToString from 'next-mdx-remote/render-to-string'; import { lunaComponents } from './luna/components'; import remarkLuna from './luna/remark'; import rehypeLuna from './luna/rehype'; import { fetcher } from './contentImportsFetcher'; import { getCustomComponents } from './customLunaComponents';...
#!/bin/bash # This script installs MongoDB 4.4 release candidate 2 echo "*********************************************" echo "* Usage: install_mongodb_4_4.sh <VERSION> *" echo "* (<VERSION> defaults to 4.4.0~rc3) *" echo "*********************************************" # set vars VERS="4.4.0~rc3" USER=`id -u...
#!/bin/sh swift build && exit ${PIPESTATUS[0]}
<filename>src/java/org/opentele/server/dgks/monitoringdataset/version1_0_1/generated/KramPredictorType.java package org.opentele.server.dgks.monitoringdataset.version1_0_1.generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlE...
<reponame>lizij/Leetcode package Game_of_Life; import java.util.Arrays; public class Solution { private int[][] board; public void gameOfLife(int[][] board) { if (board == null || board.length == 0 || board[0].length == 0) { return; } // link to board this.board = ...
<reponame>coussej/calc<filename>calc.go package calc import "math" // Abs return the absolute value of x func Abs(x int) int { if x < 0 { return -x } return x } // Ceil returns the first integer higher than the given float64. func Ceil(x float64) int { return int(math.Ceil(x)) } // Copysign returns a value wi...
const mongoose = require('mongoose'); const User = mongoose.model('User'); const uuid = require('uuid'); const bcrypt = require('bcrypt'); exports.validateRegister = (req, res, next) => { req.sanitizeBody('name'); req.checkBody('name', 'You must supply a name!').notEmpty(); req.sanitizeBody('username'); req.checkB...
class Scheduler: def __init__(self, scheduler): self.scheduler = scheduler self.lr_history = [] self.name = self.scheduler.__class__.__name__ def get_lr(self): return self.scheduler.optimizer.state_dict()['param_groups'][0]['lr'] def iterate(self, iterations): self....
<filename>src/bu_shapes.c<gh_stars>0 #include "bu_shapes.h" #include "gf2d_draw.h" #include "simple_logger.h" Rect gf2d_rect(float x, float y, float w, float h) { Rect r; gf2d_rect_set(r, x, y, w, h); return r; } void gf2d_rect_draw(Rect r, Color color) { gf2d_draw_rect(gf2d_rect_to_sdl_rect(r), gfc_c...
import test from 'ava'; import { RedBlackTreeEntry, emptyWithNumericKeys, first } from '../../src'; import { RedBlackTreeStructure } from '../../src/internals'; import { createTree, sortedValues } from '../test-utils'; var tree: RedBlackTreeStructure<any, any>, emptyTree: RedBlackTreeStructure<any, any>; test.beforeE...
<reponame>peshos/peshos.poll "use strict"; var PeshOS = PeshOS || {}; PeshOS.Poll = PeshOS.Poll || {}; PeshOS.Poll.Configuration = (function () { var isConfigured = false, defaultPoll = { name: '<NAME>', description: 'This is my first poll', width: 400, ...
function validateUserProfile(userProfile) { if ( typeof userProfile.userName === 'string' && typeof userProfile.email === 'string' && userProfile.age === undefined && userProfile.tags === undefined && userProfile.birthday === undefined ) { return true; } if ( typeof userProfile.user...
<filename>src/icons/legacy/AngleDown.tsx // Generated by script, don't edit it please. import createSvgIcon from '../../createSvgIcon'; import AngleDownSvg from '@rsuite/icon-font/lib/legacy/AngleDown'; const AngleDown = createSvgIcon({ as: AngleDownSvg, ariaLabel: 'angle down', category: 'legacy', displayName...
<filename>my-bonsai-corner/src/main/java/com/ratz/mybonsaicorner/services/UserService.java package com.ratz.mybonsaicorner.services; public interface UserService { }
<filename>src/app/store/index.js import Vue from 'vue'; import Vuex from 'vuex'; import Observer from 'mutation-observer'; import debounce from 'tiny-debounce'; import {hasElement} from 'Resources/helpers'; Vue.use(Vuex); import state from './state'; import actions from './actions'; import mutations from './mutation...
const Boom = require('@hapi/boom'); const get = require('lodash/get'); const Company = require('../../models/Company'); const translate = require('../../helpers/translate'); const UtilsHelper = require('../../helpers/utils'); const { TRAINING_ORGANISATION_MANAGER, VENDOR_ADMIN } = require('../../helpers/constants'); c...
import { Command } from 'commander'; import * as Inquirer from 'inquirer'; import { SimpleGit } from 'simple-git/promise'; import { exec } from 'child_process'; import * as util from 'util'; import { Container } from 'typedi'; import { OptionsService } from '../../service/Options'; export interface DiffQuery { from?:...
const validateEmail = (email) => { const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); }
from sklearn.cluster import KMeans def KMeans_clustering(dataset, k): kmeans_model = KMeans(n_clusters=k).fit(dataset) clusters = kmeans_model.cluster_centers_ labels = kmeans_model.labels_ return clusters, labels clusters, labels = KMeans_clustering(dataset, k=2)
#!/bin/bash script client.txt gcc main.c client.c interfaces.c ip_validator.c -o client
package com.linkedin.datahub.graphql.resolvers.type; import com.google.common.collect.Iterables; import com.linkedin.datahub.graphql.types.EntityType; import com.linkedin.datahub.graphql.types.LoadableType; import graphql.TypeResolutionEnvironment; import graphql.schema.GraphQLObjectType; import graphql.schema.TypeRes...
#include "stdio.h" #include "string.h" #include "stdlib.h" #include <stdio.h> #include <string.h> typedef struct node { char *key; int data[8]; }node; void addNewNode(char* inputString){ char *prtH = inputString; char *key; int val [8]; int i=0; printf("%s--\n",(prtH)); while (*prtH !=' '&& *prtH !='\n...
<reponame>saucelabs/travis-core<gh_stars>100-1000 module Travis module Addons module Archive require 'travis/addons/archive/event_handler' require 'travis/addons/archive/task' end end end
# Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # What to do sign=false verify=false build=false setupenv=false # Systems to build linux=true windows=true osx=true # Other Basic v...
class IndexCounter { // singleton to count the indices for constructor() { this._counter = -1; } count() { this._counter++; return this._counter; } reset() { this._counter = -1; } setCounter(value) { this._counter = value; } getCounter...
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis...
<gh_stars>0 /* * Run.sql * Chapter 17, Oracle10g PL/SQL Programming * by <NAME>, <NAME>, <NAME> * * This script tests the DBMS_JOB.RUN procedure */ SET VERIFY OFF SET VERIFY OFF UNDEFINE job_number exec CLEAN_SCHEMA.jobs exec CLEAN_SCHEMA.procs exec CLEAN_SCHEMA.tables PROMPT PROMPT Create email_tbl to hold e-...
import React from "react" import Layout from "../components/layout" // import Image from "../components/image" import HomepageHero from "../components/homepageHero" import CurrentWork from "../components/home/currentWork" import CaseStudyLinks from "../components/home/caseStudyLinks" import SEO from "../components/seo...
<filename>test/test-markdown.js const Markdown = require("../lib/copy-as-markdown"); exports["test link"] = function(assert) { var actual; actual = Markdown.link("http://example.com", "text"); assert.equal(actual, "[text](http://example.com)", "normal input"); actual = Markdown.link("http://example.com", "")...
/* Copyright (c) 2017-2020 <NAME>. */ package com.epion_t3.devtools.component; import com.epion_t3.devtools.bean.DevGeneratorContext; public interface Component { void execute(DevGeneratorContext context); }
<filename>src/scenes/NftDetailPage/NftDetailModel.tsx import { useSetContentIsLoaded } from 'contexts/shimmer/ShimmerContext'; import styled from 'styled-components'; import { Nft } from 'types/Nft'; import { useEffect } from 'react'; type Props = { nft: Nft; }; // TODO: Clean this up once fixed // https://github.c...
def countOccurrences(list_words): result = {} for word in list_words: if word not in result: result[word] = 1 else: result[word] += 1 return result
<filename>api/src/models/creature_types.js const creature_types = (sequelize, DataTypes) => { const Creature_types = sequelize.define('creature_types', { }); return Creature_types; }; export default creature_types;
/*ckwg +29 * Copyright 2017 by Kitware, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of...
#!/usr/bin/env bash build_version=v1.11.1 build_docker_image_name=golang build_docker_os=alpine build_docker_tag=1.13.8-${build_docker_os} build_docker_set=${build_docker_image_name}:${build_docker_tag} build_docker_image_set_name=${build_docker_os} build_docker_image_set_tag=3.10 build_docker_image_set=${build_docke...
#! /bin/bash -e : "${JENKINS_WAR:="/usr/share/jenkins/jenkins.war"}" : "${JENKINS_HOME:="/var/lib/jenkins"}" touch "${COPY_REFERENCE_FILE_LOG}" || { echo "Can not write to ${COPY_REFERENCE_FILE_LOG}. Wrong volume permissions?"; exit 1; } echo "--- Copying files at $(date)" >> "$COPY_REFERENCE_FILE_LOG" find /usr/share...
#!/bin/bash -u set -e if [ $# -ne 1 ]; then echo "Usage: `basename $0` <src rpm filename>" exit 1 fi echo "Extracting information from src rpm..." PKGNAME=`rpmquery -qp --queryformat '%{NAME}' $1 2>/dev/null` # We've seen cases from, e.g., rpmforge, where the src.rpm ver/release # don't match the contained package...
@register.filter def to_percent(obj, significant_digits): if obj is None: return "" try: value = float(obj) * 100 # Convert to percentage format_str = "{:.%df}%%" % significant_digits # Create format string with specified significant digits return format_str.format(value) # Fo...
#!/usr/bin/env bash # Convenience script to build Infer when using opam # Copyright (c) 2015 - present Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be...
def find_max_min(lst): max_element = lst[0] min_element = lst[0] for i in range(len(lst)): if max_element < lst[i]: max_element = lst[i] if min_element > lst[i]: min_element = lst[i] return max_element, min_element # Driver Code lst = [10, 11, 2, 7, 1...
<filename>node_modules/@formatjs/intl-numberformat/lib/src/core.js import { defineProperty, invariant, SupportedLocales, unpackData, InitializeNumberFormat, FormatNumericToParts, ToNumber, CanonicalizeLocaleList, } from '@formatjs/ecma402-abstract'; import * as currencyDigitsData from './data/currency-digits.json'; imp...
/* * insertAcademicRecords.sql * Chapter 10, Oracle10g PL/SQL Programming * by <NAME>, <NAME> and <NAME> * * This script inserts values into STUDENTS and CLASSES tables. */ INSERT INTO students VALUES (1,3,'Political Science','Boxer','Barbara',''); INSERT INTO students VALUES (2,3,'History','MacDermott','Donal'...
sudo docker run -d --name onlinecompiler --net=host --restart=always \ -v /storage/g/OnlineCompiler/frontend/build:/app/dist \ -v /storage/docker/OnlineCompiler/data:/app/data \ jansora/onlinecompiler:v2
var mongoose = require('mongoose') var autopopulate = require('mongoose-autopopulate') var Schema = mongoose.Schema var schema = new Schema({ _org: { type: Schema.Types.ObjectId, ref: 'Organisation', required: true, autopopulate: true }, contextType: { type: String, required: true }, ...
<filename>src/main/java/actions/IAction.java package actions; /* */ public interface IAction { void run(); }
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-signin-oidc', templateUrl: './signin-oidc.component.html', styleUrls: ['./signin-oidc.component.css'] }) export class SigninOidcComponent implements OnInit { constructor() { } ngOnInit() { } }
class ConfigParser: def parse(self, file_path): try: with open(file_path, 'r') as file: config_data = {} for line in file: line = line.strip() if line and not line.startswith('#'): key, value = line.s...
<filename>apps/service-notification/src/email/sagas/auth.sagas.ts<gh_stars>1-10 import { Injectable, Logger } from '@nestjs/common'; import { ICommand, ofType, Saga } from '@nestjs/cqrs'; import { Observable } from 'rxjs'; import { delay, map } from 'rxjs/operators'; import { InjectQueue } from '@nestjs/bull'; import {...
<filename>src/examples/java/com/globalcollect/gateway/sdk/java/payouts/ApprovePayoutExample.java package com.globalcollect.gateway.sdk.java.payouts; import java.net.URISyntaxException; import com.globalcollect.gateway.sdk.java.ExampleBase; import com.globalcollect.gateway.sdk.java.gc.GcClient; import com.globalcollec...
# Sum of list list_length = len(input_list) sum = 0 for i in range(list_length): sum += input_list[i] print(sum)
package br.indie.fiscal4j.nfe310.utils; import org.apache.commons.lang3.StringUtils; import java.util.Objects; /** * @Author <NAME> on 01/06/17. * <p> * Classe que verifica se uma chave passada como parâmetro é valida. * Pode ser chamada por new {@link #NFVerificaChave(String)} e depois {@link #isChaveValida()} ...
<gh_stars>0 export declare function useUrl(): { withBase: (path: string) => string; };
<reponame>nightskylark/DevExtreme<filename>testing/tests/DevExpress.ui.widgets/slideOut.markup.tests.js "use strict"; var $ = require("jquery"); require("ui/slide_out"); require("common.css!"); var SLIDEOUT_CLASS = "dx-slideout", SLIDEOUT_ITEM_CONTAINER_CLASS = "dx-slideout-item-container", SLIDEOUT_ITEM_CL...
TERMUX_PKG_HOMEPAGE=http://libical.github.io/libical/ TERMUX_PKG_DESCRIPTION="Libical is an Open Source implementation of the iCalendar protocols and protocol data units" TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=3.0.10 TERMUX_PKG_SRCURL=https://github.com/libical/libical/releases...
#!/usr/bin/env bash set -e cd "$(dirname "$0")" dotnet restore dotnet tool restore codegen() { dest="$1" printf "Generating extensions wrappers (%s)..." "$1" shift dotnet run -p bld/ExtensionsGenerator/MoreLinq.ExtensionsGenerator.csproj -c Release -- "$@" > "$dest" printf "Done.\n" } codegen MoreLi...
#!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh check() { return 0 } depends() { echo systemd network } install() { inst_multiple afterburn inst_simple "$moddir/afterburn-hostname.service" \ "$systemdutildir/system/aft...
package mezz.jei.input; public interface ICloseable { void close(); boolean isOpen(); }
<gh_stars>0 /* * 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 * "Lic...
<gh_stars>10-100 import PageNotFound from './PageNotFound.js' import './PageNotFound.scss' export default PageNotFound
/** * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 <NAME>, Medical Physics * Department, University Hospital of Liege, Belgium * Copyright (C) 2017-2020 <NAME>., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser Gener...
const Sequelize = require('sequelize') const sequelize = require('../database') const Legends = sequelize.define( 'legend', { legend_id: { primaryKey: true, type: Sequelize.INTEGER.UNSIGNED, }, legend_name_key: Sequelize.STRING, bio_name: Sequelize.STRING, weapon_one: Sequelize.STRI...
// Autogenerated from library/elements.i package ideal.library.elements; public interface readonly_entity extends any_entity { }
#!/bin/sh #SCHEMES="b f a c t x e 8" SCHEMES="b a c t x e 8" DMTXWRITE="$(which dmtxwrite)" DMTXREAD="$(which dmtxread)" MOGRIFY=$(which mogrify) COMPARE_DIR="compare_generated" if [[ ! -x "$DMTXWRITE" ]]; then echo "Unable to execute \"$DMTXWRITE\"" exit 1 fi if [[ ! -x "$DMTXREAD" ]]; then echo "Unable to...
#include <iostream> int main() { int a = 3; int b = 5; int sum = a + b; std::cout << sum << std::endl; return 0; }
/* * 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 writing, software * distribut...
''' Pytorch implementation for pre-activation ResNet. Original paper: https://arxiv.org/abs/1603.05027 ''' import torch import torch.nn as nn from torch.autograd import Variable __all__ = ['PreActResNet', 'preact_resnet18', 'preact_resnet34', 'preact_resnet50', 'preact_resnet101', 'preact_resnet152'] ...
<gh_stars>1-10 var transformApply = require('../../../alg/permutation/transform-apply'); var expect = require('chai').expect; describe('Transform-apply', () => { var T = (array, transforms, transformed) => expect(transformApply(array, transforms)).to.eql(transformed); it('applies a transformation on an array', () ...
'''Dump the data from the database into CSV files.''' import dbm import csv def main(): video_2_user_db = dbm.open('video_2_user.dbm', 'r') video_2_server_db = dbm.open('video_2_server.dbm', 'r') with open('video_2_user.csv', 'w', newline='') as video_2_user_file: writer = csv.writer(video_2_user...
<filename>resources/assets/js/router/index.js import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) export default new Router({ routes: [ { path: '/', component: require('../components/Home/HomeComponent.vue'), name: 'home', meta: { }, }, { ...
<gh_stars>0 'use strict'; module.exports = function(app) { var Validator = require('../models/shallow-validator'); var Marker = require('../models/markers'); function fetchMap(req, res) { Marker.getAll(function(err, markers) { if (err) { res.send(err); } else { res.send({ ...
package com.cgfy.oauth.bussApi.controller; import com.cgfy.oauth.base.bean.AjaxResponse; import com.cgfy.oauth.bussApi.feign.UserFeignClient; import com.cgfy.oauth.bussApi.feign.bean.UserInfoOutputBean; import com.cgfy.oauth.base.config.AuthLoginLimitProperties; import io.swagger.annotations.Api; import io.swagger.ann...
<reponame>msnraju/al-productivity-tools import IDataItem from "./data-item.model"; export default interface IDataSet { dataItems: Array<IDataItem>; postLabelComments: string[]; comments: string[]; }
package com.example.xty.helloagain.MyDataBase; import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Generated; import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Property; /** * Created by xty on 2018/6/21. */ @Entity public class Settings ...
<reponame>ebdavison/papermerge # coding: utf-8 from __future__ import unicode_literals import datetime import warnings from django.template import Library from django.contrib.admin.templatetags.admin_list import result_headers from django.conf import settings from django.contrib.admin.templatetags.admin_urls import ...
# Optimized Python code to find prime numbers in a range # using primality tests def is_prime(num): if num <= 1: return False for i in range(2, num): if (num % i) == 0: return False return True # Generate a range of consecutive numbers # and check for each if it is prime de...
#!/bin/sh echo "Creating directories..." mkdir cg_checkpoints echo "Downloading preprocessed data..." gdown https://drive.google.com/uc?id=18fSwjw_F2aL-nDpQouEJ9Mh_cC12SyW9 echo "Unpacking preprocessed data..." unzip -q data.zip echo "Finished setup!"
<gh_stars>10-100 package io.opensphere.csvcommon.detect.location.model; import io.opensphere.importer.config.ColumnType; /** * The LatLonColumnResults class stores a set of potential latitude and * longitude columns. */ public final class LatLonColumnResults { /** The Potential column1. */ priva...
import PropTypes from 'prop-types' import React from 'react' const Column = (props) => { const { children, width = 'full', className = '', renderFeatures } = props const classes = [className] if (width === 'full') classes.push('govuk-grid-column-full') if (width === 'one-half') classes.push('govuk-grid-column...
package main import ( "errors" "github.com/go-martini/martini" "github.com/martini-contrib/render" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "strconv" "time" ) type TorrentDB struct { session *mgo.Session collection *mgo.Collection } type Torrent struct { Btih string `bson:"_id,omitempty"` Title ...
<filename>benchmarks/statcalc/addValue/Eq/oldV.java<gh_stars>1-10 package benchmarks.statcalc.addValue.Eq; public class oldV { static double sum = 0; static double sumOfSquares = 0; static double mean = 0; static double deviation = 0; static int count = 0; public static void addValue(double val) ...
// Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #define _SILENCE_CXX20_IS_ALWAYS_EQUAL_DEPRECATION_WARNING #include <memory> #include <type_traits> #include <utility> #define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) using namespace std...
function getWarehouseNames($almacenes) { $warehouseNames = []; foreach ($almacenes as $almacen) { $warehouseNames[] = $almacen['nombre']; } return $warehouseNames; }
<reponame>KiharaTakahiro/share-media import { PAGE_END_POINT } from '../common/const' import { parseCookies, destroyCookie, setCookie} from 'nookies'; import { NextPageContext } from 'next'; import Router from 'next/router' /** * トークンのインターフェース */ interface Token { access_token: string, refresh_token: string } /...
/* * 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"); you may ...
// Create an Express router const express = require('express'); const router = express.Router(); //Bring in the token validation method const {validateToken} = require('../middleware/auth'); //Create the endpoint router.post('/validate-token', validateToken, (req, res) => { //Send a success response if token va...
// Define the modules and their exported functions/objects const modules = { operations: { rollMin: () => {}, rollMax: () => {} }, parser: { evaluate: () => {} }, diceforge: { forgeDice: () => {} } }; // Implement the loadModule function function loadModule(moduleName) { if (modules[modul...
#!/bin/bash usage() { echo "Usage: $0 [-c <channelname>] -n [chaincodename]" 1>&2; exit 1; } while getopts ":c:n:" o; do case "${o}" in c) c=${OPTARG} ;; n) n=${OPTARG} ;; *) usage ;; esac done shift $((OPTIND-1)) if...
#!/bin/bash # Dependency: requires swiftformat (https://github.com/nicklockwood/SwiftFormat). # Install via homebrew: `brew install swiftformat` # @raycast.title Format Swift # @raycast.author Dean Moore # @raycast.authorURL https://github.com/moored # @raycast.description Use [swiftformat](https://github.com/nickloc...
// Copyright © 2019 <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 to in wri...
import re def extract_authors_and_copyright(code_snippet): pattern = r'#\s*(.*?)\s*,\s*(.*?)\s*' match = re.search(pattern, code_snippet) authors = f"{match.group(1)}, {match.group(2)}" if match else "Unknown" year_pattern = r'\b\d{4}\b' years = re.findall(year_pattern, code_snippet) copyr...
# Reclaim disk space, otherwise we have too little free space at the start of a job # # Numbers as of 2022-01-26: # # $ df -h # Filesystem Size Used Avail Use% Mounted on # /dev/root 84G 52G 32G 63% / # devtmpfs 3.4G 0 3.4G 0% /dev # tmpfs 3.4G 4.0K 3.4G 1% /dev/shm # tmpfs...
prune_retrain_resnet56(){ # train python train_test_split_main.py --dataset cifar10 \ --arch resnet \ --depth 56 \ --save prune_retrain_checkpoints/resnet56_$2 \ --seed $2 \ --wandb resnet_56_standard_train_test_split && # prune A python res56prune.py \ --dataset cifar10 \ ...
def analyze_target_apps(target_apps): analyze_android_max_version = target_apps.get('android', {}).get('max', '').isdigit() is_extension_or_theme = target_apps.get('detected_type') in ('theme', 'extension') is_targeting_firefoxes_only = set(target_apps.keys()).intersection(('firefox', 'android')) == {'firef...