text
stringlengths
1
1.05M
var rnd = Math.random(); var s = document.createElement('script'); s.setAttribute('data-rnd', rnd); s.innerText = "$('.act-bar > .inner > .form-group > .input-select-a.gift-num-select > .input-text > .value').trigger('change'); document.querySelector('head > script[data-rnd=\"" + rnd + "\"]').remove(); "; (document.hea...
const merchantList = () => import(/* webpackChunkName: "merchant" */ '@/views/merchant/merchantList/index.vue') export default [ { path: "/merchantList", name: 'merchantList', component: merchantList // 商户列表 }, { path: "/merchantList/merchantDetail", name: 'merchant...
// Define the ProblemDifficulty enum enum ProblemDifficulty { case easy, medium, hard } // Define the MathSymbols enum enum MathSymbols: String { case times = "×" func padded(with padding: String) -> String { return padding + self.rawValue + padding } } // Define the Problem struct struct...
package com.jensen.draculadaybyday.notification; import android.app.job.JobInfo; import android.app.job.JobScheduler; import android.content.ComponentName; import android.content.Context; import android.util.Log; public class Schedule { private final JobScheduler mJobScheduler; private static Schedule mSched...
// Copyright (C) 2019-2021 Intel Corporation // // SPDX-License-Identifier: MIT // Setup mock for a server jest.mock('../../src/server-proxy', () => { const mock = require('../mocks/server-proxy.mock'); return mock; }); // Initialize api window.cvat = require('../../src/api'); const { Project } = require('.....
# The Book of Ruby - http://www.sapphiresteel.com h1 = { 'room1'=>'The Treasure Room', 'room2'=>'The Throne Room', 'loc1'=>'A Forest Glade', 'loc2'=>'A Mountain Stream' } h2 = {1=>'one', 2=>'two', 3=> 'three'} h3 = {6=>'six', 5=>'five', 4=> 'four'} # a complicated hash! multihash = { 'name...
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
package tracer import ( cryptorand "crypto/rand" "encoding/hex" "math" "math/big" "math/rand" "sync" "time" "github.com/google/uuid" "go.undefinedlabs.com/scopeagent/instrumentation" ) var ( random *rand.Rand mu sync.Mutex ) func getRandomId() uint64 { mu.Lock() defer mu.Unlock() ensureRandom() r...
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next'; import NextAuth, { Session } from 'next-auth'; import getConfig from 'next/config'; import GoogleProvider from 'next-auth/providers/google'; import FacebookProvider from 'next-auth/providers/facebook'; import CredentialsProvider from 'next-auth/pro...
#!/bin/sh #These commands set up the Grid Environment for your job: #PBS -N LandscapeEvaluation #PBS -l nodes=1:ppn=2,walltime=5:00:00 # Move to the desired working directory e.g. /home/<ldap-user> or /home/<ldap-user>/my/work/directory cd /home/awolniakowski/current/gripper-landscape ulimit -s 80000 cp in/${GRIPPER...
<filename>web/cashtab/src/hooks/__mocks__/mockReturnGetSlpBalancesAndUtxosNoZeroBalance.js import BigNumber from 'bignumber.js'; export default { tokens: [ { info: { height: 660869, tx_hash: '16b624b60de4a1d8a06baa129e3a88a4becd499e1d5d0d40b9f...
<reponame>myamout/RequestNetworkDemo<gh_stars>1-10 export enum State { Created, Accepted, Canceled } export enum EscrowState { Created, Refunded, Released } export type CallbackTransactionHash = (transactionHash: string) => void; export type CallbackTransactionReceipt = (receipt: any) => void; export type CallbackTran...
<reponame>Wlisfes/lisfes-service import { Module, Global } from '@nestjs/common' import { JwtModule } from '@nestjs/jwt' import { JwtAuthService } from './jwt.service' @Global() @Module({ imports: [ JwtModule.registerAsync({ useFactory: () => ({ secret: process.env.JWT_SECRET, signOptions: { expires...
<reponame>albinsony/foam2 foam.CLASS({ name: 'TestApp', swiftImports: [ 'UIKit', ], requires: [ 'Test', 'foam.swift.dao.ArrayDAO', 'foam.swift.ui.DAOTableViewSource', 'foam.swift.ui.DAOViewController', 'foam.swift.ui.DetailView', 'foam.swift.ui.ScrollingViewController', ], export...
<filename>trikNetwork/src/gamepadConnection.h /* Copyright 2015 CyberTech Labs 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 *...
/** * This program and the accompanying materials * are made available under the terms of the License * which accompanies this distribution in the file LICENSE.txt */ package com.archimatetool.hammer.validation.issues; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.swt.graphics.Image; import com.a...
package malware.feature; import java.util.LinkedList; import java.util.List; import java.util.Queue; import java.util.Random; import malware.parse.AsmParser; import malware.parse.Function; import malware.parse.AsmParser.AsmMode; import malware.parse.AsmParser.Instruction; import ml.lsh.MinHash; public class MinHashF...
package org.glamey.training.codes.leetcode; /** * 算出数组中,两两相减最小的数字 * * @author zhouyang.zhou. 2017.08.18.22. */ public class MinDiffer { public static int minDiff(int[] nums) { if (nums == null) { return -1; } int len = nums.length; if (len < 2) { retur...
# shellcheck shell=ksh # Copyright 2022 Rawiri Blundell # # 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 l...
import {Pipe, PipeTransform} from '@angular/core'; import * as _ from 'lodash'; @Pipe({ name: 'capacityToString' }) export class CapacityToStringPipe implements PipeTransform { transform(capacity: { [key in string]: string }): string { return _.keys(capacity).map(key => `${key}=${capacity[key]}`).join(', '); ...
<reponame>ddallaire/Adaptone-app import Component from '@ember/component'; import {inject as service} from '@ember/service'; import Configuration from 'adaptone-front/models/configuration'; import steps from 'adaptone-front/models/steps'; import SequenceIds from 'adaptone-front/constants/sequence-ids'; import Channels ...
<reponame>GeekerHuang/GKHWebImage<gh_stars>1-10 // // UIView+GKHWebCacheOperation.h // GKHWebImage // // Created by huangshuai on 16/8/21. // Copyright © 2016年 GKH. All rights reserved. // #import <UIKit/UIKit.h> @interface UIView (GKHWebCacheOperation) @end
#!/bin/sh source ~/.dwm/dwm-statusbar.sh ~/.dwm/dwm-bar/dwm_bar.sh &
function remainder(a, b) { let result = a % b; console.log(`The remainder of ${a} divided by ${b} is ${result}`); } remainder(20, 10); // Output: The remainder of 20 divided by 10 is 0
<filename>gatsby-browser.js<gh_stars>0 /** * Implement Gatsby's Browser APIs in this file. * * See: https://www.gatsbyjs.com/docs/browser-apis/ */ // You can delete this file if you're not using it import React from 'react'; import GlobalStyle from './src/globalStyles'; export const wrapPageElement = ({element}) ...
<filename>src/main/java/br/inatel/CorretoraDB.java package br.inatel; import java.sql.SQLException; public class CorretoraDB extends Database { public boolean adicionarCorretoraAoBanco(Corretora novaCorretora) { connect(); String sql = "INSERT INTO corretora(nome, uf) VALUES (?, ?)"; try { pst =...
#!/bin/bash # environment PATH=/bin:/usr/bin:$PATH HOSTNAME=$(uname -n) TS=`date +%Y%m%d-%T` #DIR WEBDIR=/usr/share/pcp/webapps/jstack WDIR=/var/log/pcp/vector/JSTACK BDIR=/var/lib/pcp/pmdas/vector/BINFlameGraph THDIR=/apps/tomcat/logs/cores #FILE THSVG=$WEBDIR/threadump-history.svg S3THSVG=threadump-history DEMOSVG=$...
#!/usr/bin/env bash # Root path of this script readonly ROOT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" readonly ROOT_PATH_PROJECT="$ROOT_PATH/../.." readonly PUMPOS_SCRIPT="$ROOT_PATH_PROJECT/pumpos.sh" if [ $# -lt 1 ]; then echo "Pipeline to configure games for an ITG cabinet to a pumpos target" ...
<reponame>emresr/prisma-graphql-backends function group(parent, args, context) { return context.prisma.competator .findUnique({ where: { id: parent.id } }) .group(); } function tournament(parent, args, context) { return context.prisma.competator .findUnique({ where: { id: parent.id } }) .tournament(...
<reponame>pukuba/EZ-Stress-Test const fetch = require('node-fetch') const assert = require('assert') const request = require('supertest') const app = require('../server') describe(`/artillery Test`, () => { it(`Test Success Case - 1`, async () => { const data = { address: 'https://pukuba.ga:200...
import { Component, OnInit } from '@angular/core'; import { Jogador } from 'src/entidades/jogador'; import { DBService } from '../servicos/db.service'; @Component({ selector: 'app-lista-dejogadores', templateUrl: './lista-dejogadores.component.html', styleUrls: ['./lista-dejogadores.component.css'], providers:...
<filename>modules/caas/auth/src/main/java/io/cattle/platform/iaas/api/auth/projects/ProjectResourceManager.java package io.cattle.platform.iaas.api.auth.projects; import io.cattle.platform.api.auth.Identity; import io.cattle.platform.api.auth.Policy; import io.cattle.platform.api.resource.DefaultResourceManager; impor...
 window.addEventListener('DOMContentLoaded', function() { //用于实现删除的数据提示与实际的删除功能 $('#deleteModal').on('show.bs.modal', function(e) { //get data-id attribute of the clicked element var ItemID = $(e.relatedTarget).data('delete-id'); var ItemName = $(e.relatedTarget).data('name');...
<filename>chess_engine/src/ChessEngine.cpp #include "ChessEngine.h" ceg::ChessEngine::ChessEngine() { move_generator = std::make_unique<ceg::MoveGenerator>(); ai = std::make_unique<ceg::NegamaxAI>(move_generator.get()); } ceg::BitBoard ceg::ChessEngine::get_initial_board() const { return get_board_by_FEN_str(initi...
<filename>mall-product/src/main/java/com/touch/air/mall/product/service/SpuImagesService.java package com.touch.air.mall.product.service; import com.baomidou.mybatisplus.extension.service.IService; import com.touch.air.common.utils.PageUtils; import com.touch.air.mall.product.entity.SpuImagesEntity; import java.util....
#ifndef _FILES_H_ #define _FILES_H_ #include <stdio.h> #include "dataTypes.h" #define CLIENTE "data/Clientes.dat" #define VENDEDOR "data/Vendedores.dat" #define FORNECEDOR "data/Fornecedores.dat" #define PRODUTO "data/Produtos.dat" #define NOTA_FISCAL "data/NotasFiscais.dat" #define ITEM_NOTA_FISCAL "data/ItensNotaFi...
export interface IUser { id: string; email: string; } export interface SignUpUserResponse { user: IUser; isSuccess: boolean; } export interface RegisterUserResponse { id: string; email: string; }
<filename>project/Dependencies.scala<gh_stars>0 import sbt._ object Dependencies { val slf4jVersion = "1.7.20" val logbackVersion = "1.2.3" val scalaTestVersion = "3.0.5" val betterFilesVersion = "3.8.0" val sparkVersion = "2.4.4" val sparkNlpVersion = "2.2.2" val sparkFastTestVersion = "0...
<filename>console/src/boost_1_78_0/libs/system/test/result_error_access.cpp // Copyright 2017, 2021 <NAME>. // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include <boost/system/result.hpp> #include <boost/core/lightweight_test.hpp> #include <boost/core/lightweig...
<filename>src/sockets/NextSocketRouter.ts import WebSocket from 'ws'; import fs from 'fs' import path from 'path' import { NextContextBase } from "../NextContext"; import { checkPathsByNormalization } from "../utils"; import { NextSocketMessageBase } from "./NextSocketMessageBase"; import { NextSocketContext } from "./...
export default { address:"http://localhost:5000", url:"/api" }
""" Build a program to return the top N most frequent words in a string """ from collections import Counter def top_n_words(string, n): words = string.split() counts = Counter(words).most_common(n) return [c[0] for c in counts] if __name__ == '__main__': string = "The quick brown fox jumps over the la...
<filename>src/components/horse/HorseDetails/index.js<gh_stars>1-10 import React from 'react' import PropTypes from 'prop-types' import classNames from 'utils/classnames' import capitalize from 'utils/capitalize' const HorseDetails = props => { const { data } = props const constructClassName = className => classN...
BACKUP_FOLDER='collect_info/backup_files' mkdir -p ${BACKUP_FOLDER} # network files cp -a /etc/sysconfig/network-scripts/ifcfg-* ${BACKUP_FOLDER}/etc/sysconfig/network-scripts
package facade.amazonaws.credentials import facade.amazonaws.AWSCredentials import scala.scalajs.js import scala.scalajs.js.annotation.JSImport @js.native @JSImport("aws-sdk/lib/node_loader", "EnvironmentCredentials", "AWS.EnvironmentCredentials") class EnvironmentCredentials(envPrefix: String) extends AWSCredential...
<reponame>cocdeshijie/discord-antmap<gh_stars>0 import discord import ast from discord.ext import commands from discord.ext.commands import MissingRequiredArgument from fuzzywuzzy import process from config import Config config = Config() bot = commands.Bot(command_prefix='.') bot.remove_command('help') fi...
package patron.events.respositories; import com.appscharles.libs.databaser.exceptions.DatabaserException; import com.appscharles.libs.databaser.managers.SFManager; import com.appscharles.libs.databaser.operators.DBOperator; import org.hibernate.Session; import org.hibernate.query.Query; import patron.events.enu...
<filename>src/main/java/org/olat/course/reminder/ui/CourseReminderSendTableModel.java /** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the Lic...
/* * Copyright (c) 2015. Seagate Technology PLC. All rights reserved. */ package com.seagate.alto.provider.lyve.response; import com.google.gson.Gson; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.seagate.alto.provider.lyve.LyveCloudProvider; import com.se...
<reponame>pirao/compare_FRA_irregularities import pandas as pd import seaborn as sns import numpy as np from numpy import load import scipy as sp import matplotlib.pyplot as plt from scipy import signal from scipy.signal import welch class FRA_irregularities(): def __init__(self,L_min=1.524,L_max=304.8,N=3000,k=...
#!/usr/bin/env bash set -euo pipefail; shopt -s nullglob [ "$(whoami)" = root ] || exec sudo -p "$(printf "This command needs to run as root.\nPassword: ")" $0 "$@" cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 pacman -Syu --needed nvidia-prime sudo systemctl enable nvidia-persistenced echo -n "Configuring NVID...
#!/bin/bash : ${DOCKER_REGISTRY:="vmware"} PACKAGE=${1} BUILD=${2} TAG=dev-${BUILD} if [ -n "$CI" ]; then TAG=$IMAGE_TAG fi image=${DOCKER_REGISTRY}/dispatch-${PACKAGE}:${TAG} echo $image docker build -t $image -f images/${PACKAGE}/Dockerfile . if [ -n "$PUSH_IMAGES" ]; then docker push $image fi
<reponame>DPechetti/node_base_project const ListBatatinhaOperation = require('../../../src/app/operations/ListBatatinhaOperation'); const generateBatatinhaRequest = require('../../mocks/batatinha/generateBatatinhaRequest'); describe('GetBatatinhaOperation', () => { test('Should call batatinha service and return foun...
<reponame>zhaort2009/easypoi-test<gh_stars>0 package cn.afterturn.easypoi.test.excel.export; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn....
def hourglass_sum(arr): max_sum = float("-inf") for row in range(4): for col in range(4): top = arr[row][col] + arr[row][col+1] + arr[row][col+2] middle = arr[row+1][col+1] bottom = arr[row+2][col] + arr[row+2][col+1] + arr[row+2][col+2] curr_sum = top + m...
#!/bin/bash # # Copyright (c) Dell Inc., or its subsidiaries. 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 # aws_acc...
export const DRAFT_BLOCKS = { '#': 'header-one', '##': 'header-two', '###': 'header-three', '####': 'header-four', '#####': 'header-five', '######': 'header-six', '*': 'unordered-list-item', '+': 'unordered-list-item', '-': 'unordered-list-item', 'n.': 'ordered-list-item', '>': 'blockquote', }; e...
#!/bin/bash echo "Install system requirements" apt-get --quiet update apt-get install -y --no-install-recommends \ curl \ git echo "Install pyenv" curl -# -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash echo "Setup home directory" ln -s /vagrant/ /home/vagrant/data chown vagrant.v...
package service import ( "shippo-server/internal/model" "shippo-server/utils" ) type PermissionPolicyService struct { *Service } func NewPermissionPolicyService(s *Service) *PermissionPolicyService { return &PermissionPolicyService{s} } // 按照策略ID查询某个策略信息 func (t *PermissionPolicyService) FindByID(id uint) (p mo...
#!/bin/bash # Please make sure your VNC resolution is 1920x1080 for figure utilities unit tests to pass # # Written by Nanbo Sun,Yang Qing and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md ########################## # Set parameters and paths ########################## # output f...
import {getRepository} from "typeorm"; import * as express from "express"; import {Request, Response} from "express"; import {Player} from "../entity/Player"; import {Position} from "../entity/Position"; import {validate} from "class-validator"; import {auth} from '../middleware/auth'; import {admin} from '../middlewa...
def permutations(str): if len(str) <= 1: return [str] perms = [] for i in range(len(str)): rest_strings = str[:i] + str[i+1:] for perm in permutations(rest_strings): perms.append(str[i:i+1] + perm) return perms str = "abc" perms = permutations(str) print(perms) # ['abc', 'acb', 'bac', 'bca', 'cab', 'c...
#!/bin/sh set -e echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then local source="${BUILT_PRO...
<filename>src/Schemas/UserSchema/index.js<gh_stars>0 export { UserSchema } from './UserSchema';
<reponame>Hannah-Abi/python-pro-21 import unittest from unittest.mock import patch from tmc import points, reflect from tmc.utils import load, load_module, reload_module, get_stdout, check_source from functools import reduce import os import os.path import textwrap import inspect, re import types from random import ch...
<reponame>benoitc/pypy from pypy.rpython.lltypesystem import lltype, rffi from pypy.rlib.rsdl import RMix, RSDL from pypy.rpython.tool import rffi_platform as platform def malloc_buffer_chunk(has_own_allocated_buffer, length_bytes, volume): buffer_pointer = lltype.malloc(RMix.Buffer, length_bytes, flavor='raw') ...
#!/usr/bin/env bash # Copyright (c) 2020 The Samcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Linter to check that commit messages have a new line before the body # or no body at all export LC_ALL=C EXI...
package simulator.model; import java.util.List; import simulator.model.Body; public class NoGravity implements GravityLaws{ @Override public void apply(List<Body> bodies) { // TODO Auto-generated method stub } //////////////////////////////////////////// /////////////// Practica 5 ///////...
""" You're given a number n. Can you write a method sumOfAllPrimes that finds all prime numbers smaller than or equal to n, and returns a sum of them? For example, we're given the number 15. All prime numbers smaller than 15 are: 2, 3, 5, 7, 11, 13 They sum up to 41, so sumOfAllPrimes(15) would return 41. """ def i...
<filename>pkg/controller/add_searchheadcluster.go package controller import ( "github.com/splunk/splunk-operator/pkg/controller/searchheadcluster" ) func init() { // AddToManagerFuncs is a list of functions to create controllers and add them to a manager. AddToManagerFuncs = append(AddToManagerFuncs, searchheadclu...
<filename>client-common/src/test/java/org/apache/livy/client/common/TestHttpMessages.java /* * 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 li...
const partition = async (array, left, right) => { let pivot = array[right]; let i = left - 1; // console.log(pivot) let bar = document.getElementById(`bar-${right}`); bar.style.background = "red"; for (let j = left; j < right; j++) { if (array[j] < pivot) { i += 1; let bar1 = document.getE...
const CognitoValidator = require('./services/cognito') const jwtValidator = require('./jwtValidator') const FirebaseValidator = require('./services/firebase') // module.default = jwtValidator // module.exports = jwtValidator module.exports = { jwtValidator, CognitoValidator, FirebaseValidator }
#! /bin/bash curl https://sdk.cloud.google.com | bash gcloud init
<gh_stars>1-10 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var util_1 = require("@antv/util"); var base_1 = require("./base"); var Line = /** @class */ (function (_super) { tslib_1.__extends(Line, _super); function Line() { return _super !...
#!/usr/bin/env bash #Author: Jiri Brejcha, jirka@jiribrejcha.net #Sends current WLAN Pi IP address and other useful details to you in a Telegram message. Requires internet connection. #Collect all data ETH0SPEED=$(ethtool eth0 2>/dev/null | grep -q "Link detected: yes" && ethtool eth0 2>/dev/null | grep "Speed" | sed...
#!/tools/bin/bash -ev set +h # Linux From Scratch - 7.7 # Chapter 6: Installing Basic System Software # Section 2: Preparing Virtual Kernel File Systems # Part 2: Mount Virtual Filesystems ##################################################################### source ../lfs_profile mount -v --bind /dev $LFS/dev mount -vt...
<?php $arr = [4, 3, 5, 1, 7, 10]; function maxVal($arr){ $max = $arr[0]; for ($i = 1; $i < count($arr); $i++){ if ($arr[$i] > $max){ $max = $arr[$i]; } } return $max; } echo maxVal($arr); ?>
EVAL_FOLDER=$1 MODEL=$2 NAME=$3 if [ "$#" -ne 3 ]; then echo "Wrong number of parameters. Expected: EVAL_FOLDER MODEL_FOLDER MODEL_NAME " exit 1; fi if [ -z "$CANDC" ]; then echo "Need to set CANDC variable to point at the C&C parser folder" exit 1 fi java -jar easyccg.jar -m $MODEL -f $EVAL_FOLDER/g...
<gh_stars>0 /************************************************************* ** Program name: randomOrderUniqueElementGenerator.hpp ** Author: <NAME> ** Date: 6/1/2017 ** Description: Function prototype for randomOrderUniqueElementGenerator (final project CS 162). *****************************************...
#include <stdio.h> // Function prototypes void displayMenu(); int main() { char selection; // Display the main menu displayMenu(); // Get the user selection printf("Enter your selection: "); scanf("%c", &selection); // Loop until user quits while(selection != 'q') { ...
#!/bin/bash if [ "$1" = "--clean" ]; then echo "Cleaning build directory..." rm -rf build fi echo "Starting build process..." mkdir -p dist build cd build cmake -DCMAKE_INSTALL_PREFIX="../dist" .. make
import java.time.LocalDateTime; import java.util.Map; public class GameManagementSystem { public void removeInactiveGames(Map<String, Game> activeGames, int gameExpiryTimeInHours) { LocalDateTime currentTime = LocalDateTime.now(); // Create a list to store the IDs of inactive games List<Str...
package com.packagename.myapp.spring.menu.item.component; import java.util.Optional; import com.vaadin.flow.component.icon.Icon; public class TogglableActionIcon extends TogglableActionComponent<Icon> { private static final long serialVersionUID = 9058607056242901365L; private String toggleEnableClassName; privat...
import random for _ in range(10): print(random.randint(0, 50))
<filename>models/xmlTypes.go package models import ( "encoding/xml" //"reflect" //"fmt" //"strconv" ) type Terminal struct { Name string `xml:"name,attr"` Class string `xml:"class,attr"` Value string `xml:",chardata"` } //todo move to XML processing, make private //-------------------------------------------...
#!/bin/sh # # Jailhouse, a Linux-based partitioning hypervisor # # Copyright (c) Siemens AG, 2018 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # SPDX-License-Identifier: MIT # usage() { echo "Usage: $0 ARCHITECTURE [QEMU_OPTIONS]" echo -e "\nSet QEMU_PATH environment variable to use a locally " \ "built Q...
for i in range(1, 11): for j in range(1, 11): print(i*j, end='\t') print()
XBPS_TARGET_CFLAGS="-mtune=G4" XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS" XBPS_TARGET_FFLAGS="$XBPS_TARGET_CFLAGS" XBPS_TRIPLET="powerpc-linux-gnu" XBPS_RUST_TARGET="powerpc-unknown-linux-gnu"
source ~/annoy_cpu/bin/activate #!/bin/zsh #$ -cwd #$ -N TopGuNN_create_word_index #$ -l h=nlpgrid10 #$ -l h_vmem=50G python3 -u code/create_word_index.py \ -outDir 'betatest/out/' \ > betatest/out/create_word_index.stdout 2>&1
/* * 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 ...
#!/bin/bash set -e eu -x DEST="/tmp/portage-root" source /lib/gentoo/functions.sh source /etc/portage/make.conf GCC_LDPATH="$(gcc-config -L)" # Build Erlang echo dev-lang/erlang::rbkmoney ~amd64 >> /etc/portage/package.accept_keywords/erlang emerge -t =dev-lang/erlang-22.3.4.21::rbkmoney quickpkg --include-config=y...
Advanced Bash-Scripting Guide: Prev Next Chapter 21. Subshells Running a shell script launches a new process, a subshell. Definition: A subshell is a child process launched by a shell (or shell script). A subshell is a separate instance of the command processor -- the shell that gives you the prompt at the console ...
/** * Gets the primary key column for the provided model. * @param Model * @returns {*} */ exports.getPrimaryKeyColumn = function getPrimaryKeyColumn (Model) { var pk = Model.getMeta('primarykey') if (pk) { return pk } var name = this.getTableName(Model) var tableSchema = this.getTableSchema(Model) ...
toolbox /google-cloud-sdk/bin/gsutil -m cp -r gs://spacemesh/sm/* . cd /var/lib/toolbox/*/ docker rm $(docker ps -a -q) ; docker volume prune -f ; docker network prune -f docker run -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:$PWD -w $PWD docker/compose -f docker-compose-metrics.yml up -d until $(curl --outpu...
def findPerfectNumbers(): perfect_numbers = [] for num in range(2, 21): temp_sum = 0 for factor in range(1, num): if (num % factor == 0): temp_sum += factor if (temp_sum == num): perfect_numbers.append(num) return perfect_numbers
/* * 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 com.baeldung.hexagon.service; import com.baeldung.hexagon.model.Student; import com.baeldung.hexagon.repository.StudentReposit...
<filename>models/module.py from backend.database import db class Module(db.Model): __tablename__ = "Module" Id = db.Column(db.Integer, primary_key=True) Name = db.Column(db.String) Description = db.Column(db.String) BuildCommand = db.Column(db.String) BuildLocation = db.Column(db.String) L...
SELECT * FROM orders ORDER BY date DESC LIMIT 3;
<filename>code/iaas/auth-logic/src/main/java/io/cattle/platform/iaas/api/auth/integration/internal/rancher/RancherIdentitySearchProvider.java package io.cattle.platform.iaas.api.auth.integration.internal.rancher; import io.cattle.platform.api.auth.Identity; import io.cattle.platform.core.constants.ProjectConstants; im...