text
stringlengths
1
1.05M
/* Copyright (c) 1997-2004 <NAME>. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ /* * this file implements a mechanism for storing and retrieving preferences. * Should later be renamed "preferences.c" or something. * ...
import math def hypotenuse_length(a, b): """ Calculates the hypotenuse of a right triangle given its side lengths """ return math.sqrt(a**2 + b**2) length = hypotenuse_length(3, 4) print(length)
class RequestError(Exception): pass class Timeout(Exception): pass class TorrentDetailsHandler: def __init__(self, provider, data): self.provider = provider self.data = data def fetch_details_data(self, timeout): try: details_data = self.provider.fetch_details_data...
#!/bin/bash # Copyright 2017 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
<filename>local-tasks/upgrade-tempdb-runner.js const rimraf = requireModule("rimraf"), writeTextFile = requireModule("write-text-file"), { run } = require("./modules/run"), { NugetClient } = require("node-nuget-client"), { updatePackageFiles, tempDbPackageName } = require("./modules/update-package-files"), ...
package be.kwakeroni.parameters.client.api.model; /** * Represents a Business Parameter. */ public interface Parameter<T> { public String getName(); public T fromString(String value); public String toString(T value); }
package com.ibm.socialcrm.notesintegration.core; /**************************************************************** * IBM OpenSource * * (C) Copyright IBM Corp. 2012 * * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * *******************************************************...
<filename>libs/Util.py<gh_stars>10-100 import os import tkinter as tk # 支持的图片格式后缀 IMG_EXT_LIST = ['bmp', 'dib', 'rle', 'emf', 'gif', 'jpg', 'jpeg', 'jpe', 'jif', 'pcx', 'dcx', 'pic', 'png', 'tga', 'tif', 'tiff', 'xif', 'wmf', 'jfif', 'ico'] # 计算文件夹内的文件个数 def count_file...
/* * Copyright(C) 2020 The Android Open Source Project * * 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 appl...
/* ound\soc\sunxi\sunxi_daudio.c * (C) Copyright 2015-2017 * Allwinner Technology Co., Ltd. <www.allwinnertech.com> * <NAME> <<EMAIL>> * * some simple description for this code * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * p...
package com.linkedin.gms.factory.common; import com.linkedin.datahub.graphql.generated.VisualConfiguration; import javax.annotation.Nonnull; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Co...
#!/bin/bash DIR="$1" InputFile="$(pwd)/$DIR/$DIR.svg" OutputBaseFile="$(pwd)/$DIR/$DIR" pngSizes=("128x128" "16x16" "192x192" "24x24" "256x256" "32x32" "48x48" "512x512" "64x64" "96x96") for size in ${pngSizes[*]} do echo Generating "$OutputBaseFile"_$size.png /usr/bin/convert -density 1536 -background non...
#!/bin/bash # set -ex ## Sets the following environment variables: ## ## XBV_PROJECT_VERSION -> CFBundleShortVersionString ## XBV_PROJECT_BUILD -> CFBundleVersion ## Code based on ## https://github.com/denys-meloshyn/bitrise-step-git-tag-project-version-and-build-number ## by Denys Meloshyn. read_dom() { local IFS...
#!/bin/bash cd $(dirname $0) INSTALL=0 if [ ! -d .env ]; then INSTALL=1 python3 -m venv .env fi . ./.env/bin/activate if [ "${INSTALL}" = "1" ]; then pip install -r requirements.txt fi python3 ./code-cracker.py deactivate
<reponame>bopopescu/drawquest-web feature_funcs = set() def feature(func): """ Feature functions take a request as their single argument. """ feature_funcs.add(func) return func @feature def requirejs(request): return 'requirejs' in request.GET @feature def thread_new(request): return True @feat...
#!/bin/bash #zlib headers for minimap sed -i.bak 's/CFLAGS=/CFLAGS+=/' lib/minimap2/Makefile sed -i.bak 's/INCLUDES=/INCLUDES+=/' lib/minimap2/Makefile export CFLAGS="-L$PREFIX/lib" export INCLUDES="-I$PREFIX/include" #zlib headers for flye binaries export CXXFLAGS="-I$PREFIX/include" export LDFLAGS="-L$PREFIX/lib" ...
/*************************************************************************** * * Project _____ __ ____ _ _ * ( _ ) /__\ (_ _)_| |_ _| |_ * )(_)( /(__)\ )( (_ _)(_ _) * (_____)(__)(__)(__) |_| |_| * * * Copyright 2018-present, <NAME...
#!/bin/bash wget https://download.sublimetext.com/latest/stable/linux/x64/deb sudo dpkg -i deb rm deb
import { Injectable } from '@nestjs/common'; import { CreateTestcaseDto } from './dto/create-testcase.dto'; import { UpdateTestcaseDto } from './dto/update-testcase.dto'; @Injectable() export class TestcasesService { create(createTestcaseDto: CreateTestcaseDto) { return 'This action adds a new testcase'; } ...
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 openssl rsa -passin pass:x -in server.pass.key -out server.key rm server.pass.key openssl req -new -key server.key -out server.csr -subj "/C=US/ST=State/L=City/O=Org/OU=Unit/CN=example.com" openssl x509 -req -days 365 -in server.csr -signkey server.key -out...
/** * Copyright 2018 Red Hat, Inc, and individual contributors. * * 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 ...
import numpy as np from rdkit import Chem from rdkit.Chem import AllChem def optimize_molecular_structure(mol, angles, dihedrals): conformer = mol.GetConformer() torsions = [(d[0], d[1], d[2], d[3]) for d in conformer.GetOwningMol().GetDihedrals()] ffc = AllChem.MMFFGetMoleculeForceField(mol, AllChem.MMFFG...
<gh_stars>10-100 user.send('Saving...'); objectManager.save(); user.send('Done.');
<filename>src/main/java/org/olat/modules/openmeetings/manager/OpenMeetingsLanguages.java<gh_stars>1-10 /** * <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 compli...
# Bash Script for Hide Phishing URL Created by KP url_checker() { if [ ! "${1//:*}" = http ]; then if [ ! "${1//:*}" = https ]; then echo -e "\e[31m[!] Invalid URL. Please use http or https.\e[0m" exit 1 fi fi } echo -e "\n\e[1;31;42m######┌──────────────────────────┐##...
<gh_stars>10-100 package bridge /* Copyright 2018-2021 Crunchy Data Solutions, 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 ap...
<gh_stars>0 // // RMUtilsFramework.h // RMUtilsFramework // // Created by JianRongCao on 15/12/14. // Copyright © 2015年 JianRongCao. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for RMUtilsFramework. FOUNDATION_EXPORT double RMUtilsFrameworkVersionNumber; //! Project version string ...
from ..layers.Layer import * class CustomLayer(Layer): def __init__(self): super(CustomLayer, self).__init__() def forward(self, input_tensor, axis): squared_input = input_tensor ** 2 sum_squared = squared_input.sum(axis=axis) return sum_squared
#!/usr/bin/env bash MODULE_NAME='TTF fonts' log_module_start distro_has_gui || log_no_changes typeset -a FONT_URLS FONT_URLS=( 'http://www.gringod.com/wp-upload/software/Fonts/Monaco_Linux.ttf' ) did_install=false for url in ${FONT_URLS[@]} do if ! font_ttf_is_installed "$(basename $url)" then log_...
<filename>packages/store-path/__mocks__/can-link.js const CAN_LINK = new Set([ '/can-link-to-homedir/tmp=>/home/user/tmp', '/mnt/project/tmp=>/mnt/tmp/tmp', ]) module.exports = function (existingPath, newPath) { return CAN_LINK.has(`${existingPath}=>${newPath}`) }
#!/bin/ash SS_MERLIN_HOME=/opt/share/ss-merlin DNSMASQ_CONFIG_DIR=${SS_MERLIN_HOME}/etc/dnsmasq.d if [[ ! -f ${SS_MERLIN_HOME}/etc/ss-merlin.conf ]]; then cp ${SS_MERLIN_HOME}/etc/ss-merlin.sample.conf ${SS_MERLIN_HOME}/etc/ss-merlin.conf fi if [[ ! -f ${SS_MERLIN_HOME}/etc/shadowsocks/config.json ]]; then cp ${S...
package unstructured import ( "github.com/ghodss/yaml" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) func StrToUnstructuredUnsafe(jsonStr string) *unstructured.Unstructured { obj := make(map[string]interface{}) err := yaml.Unmarshal([]byte(jsonStr), &obj) if err != nil { panic(err) } return &unstruct...
<filename>file_reader.go package goparquet import ( "context" "fmt" "io" "github.com/fraugster/parquet-go/parquet" "github.com/fraugster/parquet-go/parquetschema" ) // FileReader is used to read data from a parquet file. Always use NewFileReader or a related // function to create such an object. type FileReade...
#!/usr/bin/env bash # exit script when any command ran here returns with non-zero exit code set -e echo "$STAGING_KUBERNETES_KUBECONFIG" | base64 --decode > kubeconfig.yml envsubst < deploy/deployment.yml.template | tee deploy/deployment.yml kubectl --kubeconfig=kubeconfig.yml get nodes kubectl --kubeconfig=kubeconfi...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by <NAME>, <EMAIL>, All rights reserved. # LLNL-CODE-647188 # # For det...
<reponame>Jakobis/OrderedSequences import pathlib import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mtick from matplotlib.ticker import ScalarFormatter import math import pandas as pd markers=['o', '^', 's', 'D', 'x', '1', '|'] def createplotforoperation(op, data, inter): plt...
<gh_stars>1-10 import type { StaticTestProps } from '../types'; export const staticTestProps: StaticTestProps = { expect, describe, it }
var express = require('express'); var router = express.Router(); var users = require('./users'); /* GET home page. */ router.get('/', function(req, res, next) { //res.render('index', { title: 'Express' }); res.sendfile('views/index.html') }); //登录 router.get('/users/login', function(req, res, next) { //res.rend...
<filename>frontend/src/components/gamePlay/DrawerLeft.js import React from 'react' class DrawerLeft extends React.Component { render() { return ( <div className='wrapper'> <h2> Hi there, {this.props.currentUser.name} </h2> <h3> The drawer left the game. So it ...
function isValid(card_number) { // 1. Reverse the order of the digits in the number. card_number = card_number.split("").reverse().join(""); // 2. Take the first, third, fifth, etc. digits of the reversed digits and sum them. var sum_odd_digits = 0; for (var i=0; i < card_number.length; i+=2) { ...
app.factory("authFactory", function($http, $cookies, $q){ const object = { login (email, password) { let defered = $q.defer(); $http.post('user/login', { "email": email, "password": password }).then(data => { if(data.status...
package evilcraft.blocks; import evilcraft.api.config.BlockConfig; /** * Config for the {@link DarkBlock}. * @author rubensworks * */ public class DarkBlockConfig extends BlockConfig { /** * The unique instance. */ public static DarkBlockConfig _instance; /** * Make a new instance...
#!/bin/sh # # STIG URL: http://www.stigviewer.com/stig/red_hat_enterprise_linux_6/2014-06-11/finding/V-38575 # Finding ID: V-38575 # Version: RHEL-06-000200 # Finding Level: Low # # The audit system must be configured to audit user deletions of files # and programs. Auditing file deletions will create an audit...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function elementWidth(node, region, cfg) { if (cfg === void 0) { cfg = { ratio: 0.15 }; } return node.width < region.width * cfg.ratio; } exports.default = { type: 'padding', usage: 'compare', expression: elementWidth, }; /...
#!/bin/bash # Archived program command-line for experiment # Copyright 2021 ServiceNow All Rights Reserved # # Usage: bash {this_file} [additional_options] set -x; set -e; ../bytesteady/bytesteady -driver_location models/index/doublefnvnllgram1a2a4a8a16a32a64a128a256a512a1024size16777216dimension16a0.1b0alpha0lambda...
#!/bin/bash -e # 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")...
#!/bin/bash unset AMBERHOME
#!/bin/bash # [CTCGFW]Project-OpenWrt # Use it under GPLv3, please. # -------------------------------------------------------- # Convert translation files zh-cn to zh_Hans # The script is still in testing, welcome to report bugs. po_file="$({ find |grep -E "[a-z0-9]+\.zh\-cn.+po"; } 2>"/dev/null")" for a in ${po_file}...
<reponame>xiuhuang/supermarket-admin export default { list: [ { key: 0, no: 'DJ00000001', name: '上海高重信息科技有限公司', jg: '江苏银行股份有限公司', cp: '快易贷', status: 0, pushstatus: '0', sj: '2019-01-01 12:00:00', }, { key: 1, no: 'DJ00000002', name: '上海高重信息...
#!/bin/sh # Download the netrace trace files mkdir -p traces cd traces URL=http://www.cs.utexas.edu/~netrace/download wget ${URL}/blackscholes_64c_simlarge.tra.bz2 \ ${URL}/blackscholes_64c_simmedium.tra.bz2 \ ${URL}/blackscholes_64c_simsmall.tra.bz2 \ ${URL}/bodytrack_64c_simlarge.tra.bz2 \ ${URL}/canneal_6...
package commit import ( "fmt" "io" "sort" "gitlab.com/gitlab-org/gitaly/v14/internal/command" "gitlab.com/gitlab-org/gitaly/v14/internal/git" "gitlab.com/gitlab-org/gitaly/v14/internal/git/log" "gitlab.com/gitlab-org/gitaly/v14/internal/git/lstree" "gitlab.com/gitlab-org/gitaly/v14/internal/helper" "gitlab.c...
# Implement Newton's method import gurobipy as gp import numpy as np import matplotlib.pyplot as plt from gurobipy import * id = 903515184 # Invoke Newton's method to solve the system of equations def newton(id, epsilon_1 = 1e-10, secant=False): profit = 0.0 c, L, U, alpha, beta, a, b = get_data(...
import random def shuffle_array(array): for i in range(len(array)): random_idx = random.randint(i, len(array) - 1) array[i], array[random_idx] = array[random_idx], array[i] return array print(shuffle_array([1,2,3,4,5]))
<filename>elasta-orm/src/main/java/elasta/orm/query/iml/QueryExecutorImpl.java package elasta.orm.query.iml; import elasta.core.promise.intfs.Promise; import elasta.criteria.json.mapping.GenericJsonToFuncConverter; import elasta.criteria.json.mapping.JsonToFuncConverterMap; import elasta.orm.entity.EntityMappingHelper...
import { ParsedIR } from "./ParsedIR"; import { SPIRType } from "../common/SPIRType"; import { IVariant, IVariantType } from "../common/IVariant"; export declare class Parser { private ir; private current_function; private current_block; private global_struct_cache; private forward_pointer_fixups; ...
/* * Copyright 2018 Comcast Cable Communications Management, LLC * * 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 require...
<filename>pake.go package pake import ( "crypto/elliptic" "crypto/rand" "crypto/sha256" "encoding/json" "errors" "fmt" "math/big" "github.com/tscholl2/siec" ) // EllipticCurve is a general curve which allows other // elliptic curves to be used with PAKE. type EllipticCurve interface { Add(x1, y1, x2, y2 *bi...
#!/bin/sh # ---------------------------------------------------------------------------- # Copyright 2001-2006 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
from typing import List, Dict, Set def process_commands(commands: List[str]) -> Dict[str, Set[str]]: config_tags_map = {} for command in commands: parts = command.split() config_index = parts.index('--config') tags_index = parts.index('--tags') config = parts[config_index + 1] ...
<reponame>joe-sky/flarej-jquery /********************************************************** *-----------------------------------* * flareJ *-----------------------------------* * base on jQuery * Copyright 2015 Joe_Sky * Licensed under the MIT license *-----*-----*-----*-----*-----*-----* * author:Joe_Sky * mail:<EMAI...
#!/bin/bash set -e dest_path="$HOME/admin.conf" if [[ "${DEPLOY_SCENARIO:0:2}" == "k8" ]];then juju scp kubernetes-master/0:config "${dest_path}" fi
#!/bin/bash # Run_Dhrystone.sh # Check Environment if [ -z ${IMPERAS_HOME} ]; then echo "IMPERAS_HOME not set. Please check environment setup." exit fi ${IMPERAS_ISS} --verbose --output imperas.log \ --program ../../../Applications/dhrystone/dhrystone.RISCV64-O0-g.elf \ --processorvendor sifive.ovpworld.o...
<filename>src/directives/index.ts<gh_stars>0 export const FLEX_LAYOUT_DIRECTIVES: any[] = [ ];
#!/bin/bash #SBATCH --job-name=rotXY #SBATCH --output=job_%j.log # Standard output and error log #SBATCH --nodes=1 # Run all processes on a single node #SBATCH --ntasks=1 #SBATCH --cpus-per-task=40 #SBATCH --time=10:00:00 module load gcc/devtoolset/9 module load cmake/3.18.0 module load anaconda...
import React, { useEffect, useState, Component } from 'react'; import { StatusBar } from 'expo-status-bar'; import { View } from 'react-native'; import { useSelector, useDispatch } from 'react-redux'; import { Header } from '../../components/blocks/Header/Header'; import { Loaction } from '../../components/blocks/Loac...
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+0+512-FW/model --tokenizer_name model-configs/1024-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+0+512-FW/512+0+512-N-VB-FILL-first-256 --do_eval --per_device_ev...
<filename>src/page-js.js /** Extracted from [page.js] Source: https://github.com/visionmedia/page.js -------------------------------------------------------------------- (The MIT License) Copyright (c) 2012 <NAME> <<EMAIL>> Permission is hereby granted, free of charge, to any person obtaining a copy of this softwa...
// // Copyright (c) 2015-2020 Microsoft Corporation and Contributors. // SPDX-License-Identifier: Apache-2.0 // #ifndef STORAGEOBSERVER_HPP #define STORAGEOBSERVER_HPP #include "IOfflineStorage.hpp" #include "system/Contexts.hpp" #include "system/Route.hpp" #include "system/ITelemetrySystem.hpp" namespace MAT_NS_BEG...
import matplotlib.pyplot as plt data = {'name': ['Sara', 'Mark', 'Simon', 'Kelly'], 'age': [25, 22, 34, 21], 'gender': ['F', 'M', 'M', 'F']} df = pd.DataFrame(data) ax = df.plot.bar(x='name', y='age', rot=0) plt.show()
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ed.biodare2.backend.util.concurrent.id; import java.util.List; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import org.springframework.dao.ConcurrencyFailureException; /...
'use strict'; const internals = {}; exports.Team = internals.Team = class { #meetings = null; #count = null; #notes = null; constructor(options) { this._init(options); } _init(options = {}) { this.work = new Promise((resolve, reject) => { this._resolve = reso...
// UI CONTROLLER const UIController = (() => { // DOM elements const elements = { colorControls: document.querySelector(".color-controls"), colorInput: document.querySelector(".color-input"), hslCopyValue: document.querySelector(".hsl-copy-text"), hexCopyValue: document.querySelector(".hex-copy-tex...
class BankAccount: def __init__(self, account_name, initial_balance): self.account_name = account_name self.balance = initial_balance def deposit(self, amount): self.balance += amount def withdraw(self, amount): if amount <= self.balance: self.balance -= amount ...
function isPalindrome(str) { let start = 0; let end = str.length - 1; while (start < end) { if (str[start] !== str[end]) { return false; } start++; end--; } return true; } const result = isPalindrome("racecar"); console.log(result);
package com.vaadin.fusion.parser.plugins.backbone.datetime; import java.time.Instant; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.Date; import java.util.List; import java.util.Map; @Endpoint public class DateTimeEndpoint { public CustomDate echoCustomDa...
<reponame>laxika/mixnode-warcreader-java package com.morethanheroic.warc.test; import com.morethanheroic.warc.service.WarcParsingException; import com.morethanheroic.warc.service.WarcReader; import com.morethanheroic.warc.service.content.response.domain.ResponseContentBlock; import com.morethanheroic.warc.service.reco...
import {HttpClient} from '@angular/common/http'; import {Injectable} from '@angular/core'; import {map} from 'rxjs/operators'; import {Observable} from 'rxjs'; import {ILog} from '../../models'; @Injectable() export class LogTailService { http: HttpClient; constructor(http: HttpClient) { this.http = http; }...
<reponame>reiver/go-strlit<gh_stars>0 package strlit import ( "fmt" ) // SyntaxError is an error that is used to represent a syntax error in a // string literal. // // SyntaxError allows one to respond to errors returned from strlit.Compile() // in a more precise way. For example: // // compiled, err := strlit.Compi...
<filename>javascript/extractor/src/com/semmle/js/extractor/trapcache/CachingTrapWriter.java package com.semmle.js.extractor.trapcache; import com.semmle.util.exception.Exceptions; import com.semmle.util.files.FileUtil; import com.semmle.util.trap.TrapWriter; import java.io.File; import java.io.IOException; import java...
# -*- coding: utf-8 -*- # Copyright: (c) 2021, <NAME> # MIT License #   # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, ...
<reponame>zhibirc/mtvplayer 'use strict'; var videojsLib = require('video.js'); //https://www.youtube.com/watch?v=twSn58BPgWM
import { combineReducers } from 'redux' import repos from './repos' export default combineReducers({ repos })
""" A genetic algorithm to find the maximum global maximum in a given two-dimensional array. """ import random def fitness(arr): fitness_value = 0 for i in range(len(arr)): for j in range(len(arr[i])): fitness_value += arr[i][j] return fitness_value def max_global_maximum(arr): pop...
module.exports = { title: '🌈 Vuex Dispatcher', description: 'An easy-to-use payload builder for your dispatch actions', themeConfig: { nav: [ { text: 'Github Repo', link: 'https://github.com/undervane/vuex-dispatcher' }, { text: 'Author', link: 'https://mipigu.com' } ], sidebar: [ '...
/** * <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...
use std::io::{self, Read, Write}; use std::time::Duration; #[derive(Debug)] enum CommunicationError { Timeout, IoError(io::Error), } struct CommunicationDevice { // Add any necessary fields here } impl CommunicationDevice { fn flush(&mut self) { let mut buf = Vec::new(); let _res = se...
<reponame>MauricioGR15/Topicos-Avanzados-de-Programcion<filename>src/AppContabilidad/App.java package AppContabilidad; public class App { public static void main(String[] args) { Modelo modelo = new Modelo(); Vista vista = new Vista(); Controlador controlador= new Controlador(modelo, vista); controlador.v...
var armnn_tf_parser_2test_2_sub_8cpp = [ [ "BOOST_FIXTURE_TEST_CASE", "armnn_tf_parser_2test_2_sub_8cpp.xhtml#a5412a63bc943a5f5357948cd8a6cc8c3", null ], [ "BOOST_FIXTURE_TEST_CASE", "armnn_tf_parser_2test_2_sub_8cpp.xhtml#a44db723ca45599b52099e39ee997207e", null ], [ "BOOST_FIXTURE_TEST_CASE", "armnn_tf_pa...
<reponame>WSimacek/rubygrade<filename>db/migrate/20081109023740_create_assignments.rb class CreateAssignments < ActiveRecord::Migration def self.up create_table :assignments do |t| t.string :name t.integer :course_id t.integer :category_id t.float :max_grade t.float :grade_boundary1,...
def remove_duplicates(lst): new_lst = [] for item in lst: if item not in new_lst: new_lst.append(item) return new_lst result = remove_duplicates(["a", "b", "c", "a", "b", "d"]) print(result)
<filename>src/include/vec_d4.hpp //! 4次元ベクトル特有の関数など定義 //! (vector.hppからインクルード) #pragma once namespace frea { template <class W, class D> struct VecT_spec<W, D, 4> : VecT<W,D, VecT_spec<W,D,4>> { using base_t = VecT<W,D, VecT_spec<W,D,4>>; using base_t::base_t; using wrap_t = typename base_t::wrap_t; using t...
try: import micropython except: pass def mandelbrot(): # returns True if c, complex, is in the Mandelbrot set <EMAIL> def in_set(c): z = 0 for i in range(40): z = z*z + c if abs(z) > 60: return False return True lcd.clear() fo...
#!/usr/bin/bash export LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib export HOME=/data/data/com.termux/files/home export PATH=/usr/local/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/sbin:/data/data/com.termux/files/usr/bin/applets:/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system...
<filename>KCenter-Core/src/main/java/org/nesc/ec/bigdata/controller/ClusterController.java package org.nesc.ec.bigdata.controller; import com.alibaba.fastjson.JSONObject; import org.nesc.ec.bigdata.common.BaseController; import org.nesc.ec.bigdata.common.RestResponse; import org.nesc.ec.bigdata.config.InitConfig; impo...
import {Component, OnInit, AfterViewInit, Input, ViewChild, ElementRef} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; import {screen} from 'platform'; import {SwipeGestureEventData, SwipeDirection} from 'ui/gestures'; import {SlideContainer, Slide} from 'nativescript-slides'; import {VideoServi...
#!/usr/bin/env bash set -e # Get all server logs export CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL="trace" CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) . $CURDIR/../shell_config.sh cur_name=${BASH_SOURCE[0]} server_logs_file=$cur_name"_server.logs" server_logs="--server_logs_file=$server_logs_file" rm -f "$server_l...
def count_occurances(list, target): count = 0 for element in list: if element == target: count += 1 return count
#!/bin/zsh # # Set macOS defaults. Tested on Monterey, i.e. macOS 12.0. # # Must logout (or restart) for some changes to take effect. # # Resources: # # - https://github.com/boochtek/mac_config # - https://github.com/mathiasbynens/dotfiles # - https://github.com/yannbertrand/macos-defaults # --------------------------...
#!/bin/zsh # ------------------------------------------------------------------------------ # init params # ------------------------------------------------------------------------------ DOTFILES_ROOT="$(dirname $(cd $(dirname $0) >/dev/null 2>&1; pwd -P;))" DOTFILES_SCRIPTS="$DOTFILES_ROOT/scripts" DOTFILES_CONFI...
var form; var tableSelect; layui.config({ base: '/static/plugins/layui-extend' }).extend({ tableSelect:'/tableSelect/tableSelect', iconPicker: '/iconPicker/iconPicker', }).use(['form','layer','tableSelect','iconPicker'],function(){ form = layui.form; $ = layui.jquery; var iconPicker = layui.icon...