text
stringlengths
1
1.05M
import React from 'react' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import * as uiActions from '../actions/uiActions' import Card from './Card' const Home = props => { const handleSubmit = () => { let i = document.getElementsByName('search_input')[0] props.uiActions.se...
/* Copyright (C) 2006 <NAME> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applicatio...
#!/bin/sh cert (){ org=$@; org=$(echo "$org" | sed 's/ /+/g'); b=$(curl -ks "https://crt.sh/?O=$org" | grep -Po "(?<=\?id=).*(?=\")"); for i in $b; do curl -ks "https://crt.sh/?id=$i" | grep -Po "(?<=DNS:).*?(?=<BR)"; done } cert $@
(function($) { 'use strict'; var ManageCart = function(options) { var ajaxOptions = { url: bptPurchaseTickets.ajaxurl, type: 'POST', dataType: 'json' }, shoppingCart = options.shoppingCart, addTickets, getC...
ion.sound({ sounds: [ {name: "animeShing"}, {name: "BASSDRUM"}, {name: "clapSnare"}, {name: "C_39_Mon"}, {name: "Chant_Hey_002"}, {name: "Chant_Noise"}, {name: "Chant_Who_001"}, {name: "clap3"}, {name: "clap5"}, {name: "fx3"}, ...
#!/bin/bash ######################################################### # Script Name: couchbase_ansible.sh # Author: Gonzalo Ruiz # Version: 0.2 # Date Created: 01st Marh 2015 # Last Modified: 29th November 2015 # Last Modified By: Gonzalo Ruiz # Description: # This script automates the instal...
import heapq import collections class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def merge_k_lists(lists): ans = ListNode(0) current = ans mapper = collections.defaultdict(list) store = list() heapq.heapify(store) for i, l in enumerate(...
#!/usr/bin/python import re import sys import os import tempfile import urllib2 import urlparse import subprocess import tarfile import signal import threading import traceback import shutil import errno from contextlib import closing # To ensure it exists on the system import gzip import zipfile # # Useful script fo...
<filename>test.py #!/usr/bin/env python3 import sys import os import subprocess import shlex def cmd_run_echoed(cmd, **kwargs): print("[CMD] %s" % " ".join(map(shlex.quote, cmd))) cmd = subprocess.run(cmd, **kwargs) if cmd.returncode != 0: print(cmd.stdout.decode('utf-8'), file=sys.stdout) ...
#!/bin/bash mkdir data_nuts_es cp $1 data_nuts_es/ ./sparql-generate.sh -q ../sparql-generate/nuts/nutsES.rqg -i "data_nuts_es/*.json" -v sed -i 's/(((/((/g' data_nuts_es/*.ttl sed -i 's/)))/))/g' data_nuts_es/*.ttl sed -i 's/\(MULTIPOLYGON((\)\([^(].*\)))/\1(\2)))/g' data_nuts_es/*.ttl
egrep "(\*.crit|mail\.[^n][^/]*)" /etc/syslog.conf | sed 's/^[^/]*//' | xargs setfacl --remove-all
/*!40101 SET NAMES utf8 */; # 模块列表 CREATE TABLE IF NOT EXISTS `module_list` ( `m_id` int(11) DEFAULT NULL comment '模块id', `m_name` varchar(255) DEFAULT NULL comment '模块名称', `git_address` varchar(255) DEFAULT NULL comment 'git仓库地址', `server_address` varchar(255) DEFAULT NULL comment '服务器地址', `server_...
<gh_stars>1-10 import client from 'undefined'; import type {} from '@apollo/client'; import { readable } from 'svelte/store'; import type { Readable } from 'svelte/store'; import gql from 'graphql-tag'; export type Maybe<T> = T | null; export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] }; ...
#!/bin/sh # Download and install vv mkdir /tmp/vv curl -L -H "Cache-Control: no-cache" -o /tmp/vv/vv.zip https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-64.zip unzip /tmp/vv/vv.zip -d /tmp/vv install -m 755 /tmp/vv/v2ray /usr/local/bin/v2ray install -m 755 /tmp/vv/v2ctl /usr/local/bin/v2ctl #...
//=============================================================================== // @ CollisionObject.cpp // ------------------------------------------------------------------------------ // Class for managing a simple object that can collide with other objects // // Copyright (C) 2008-2015 by <NAME> and <NAME>. // Al...
#!/bin/bash # https://itch.io/docs/butler/installing.html # -L follows redirects # -O specifies output name curl -L -o butler.zip https://broth.itch.ovh/butler/windows-amd64/LATEST/archive/default unzip butler.zip -d ./butler rm butler.zip cd ./butler # GNU unzip tends to not set the executable bit even though it's set...
#!/bin/bash usage="sress.sh directory" [ $# -lt 1 ] && echo "$usage" && exit 1 echo $0 $1 SAVEIFS=$IFS #IFS=$(echo -en "\n\b") i=0 allfiles=( ) allstat=( ) READPDF=readpdf if [ -f bin/readpdf ] ; then READPDF=bin/readpdf; fi for file in $1/*.pdf do ff=${file} if [[ -e "${ff}" ]] then allfiles[$i]=\"$...
<reponame>TheButlah/Battlecode-2018 package org.battlecode.bc18.api; import java.util.List; import org.battlecode.bc18.util.Utils; import bc.MapLocation; import bc.Unit; import bc.UnitType; public abstract class ARocket extends AStructure implements MyRocket { @Override public boolean canLaunchRocket(MapLo...
import { Test, TestingModule } from '@nestjs/testing'; import { SingupController } from './singup.controller'; import { SingupService } from './singup.service'; describe('SingupController', () => { let controller: SingupController; beforeEach(async () => { const module: TestingModule = await Test.createTestin...
source ../scripts/#kata-scripts.sh source ../104-local-rebase-onto-main/init-functions.sh init-exercise() { cloned-exercise-repo local feature="fuel-estimation" work-on-feature-branch "$feature" git-push-feature-branch "$feature" readme-pushed-to-origin-main git-checkout-feature "$feature" } readme-pus...
import React from "react"; import ReactDOM from "react-dom"; import TestUtils from "react-addons-test-utils"; import InfinityMenu from "../src/infinity-menu"; import should from "should"; import sinon from "sinon"; import "should-sinon"; describe("shouldComponentUpdate prop", function() { const shouldComponentUpdate ...
/*! ** bauer-crawler -- Multi-thread crawler engine. ** Copyright (c) 2015 <NAME> <http://yneves.com> ** Licensed under The MIT License <http://opensource.org/licenses/MIT> ** Distributed on <http://github.com/yneves/node-bauer-crawler> */ // - -------------------------------------------------------------------- - ...
modroot="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/tools" if [ ! -d "${modroot}" ]; then echo "Module path does not exist: ${modroot}" return 1 fi export OPENROAD=${modroot}/OpenROAD echo "OPENROAD: ${OPENROAD}" export PATH=${modroot}/build/OpenROAD/src:${modroot}/build/yosys/bin:${modroot}/build/LSOracle/bu...
<reponame>loganon-build-week/UI-Frontend-Combined import React, {useState, useEffect} from "react"; import axios from "axios"; const listOfPasswords=[] const Form = (props) => { const [state, setState] = useState({ Application: "", EmailAddress: "", Password: "" }) const [pw, setP...
python run_IAFT.py --model_type roberta --model_name_or_path ./output/ConjNLI --do_train --do_eval --do_lower_case --task_name ConjNLI_Adv --data_dir data/NLI/ --max_seq_length 128 --per_gpu_eval_batch_size=32 --per_gpu_train_batch_size=32 --learning_rate 2e-5 --num_train_epochs 3 --output_dir output/ConjNLI_IAFT
def classify_sentence(sentence): # tokenize the sentence tokens = sentence.split() sentiment_score = 0 for token in tokens: #get sentiment score for each token sentiment_score += get_sentiment_score(token) # classify sentiment if sentiment_score > 0: return 'positive' ...
/* * Copyright 2020 Google 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
import { createSelector as ormCreateSelector } from 'redux-orm' import { createSelector } from 'reselect' import { get, includes, isEmpty } from 'lodash/fp' import presentTopic from 'store/presenters/presentTopic' import orm from 'store/models' import { makeGetQueryResults } from 'store/reducers/queryResults' import { ...
#!/usr/bin/env bash ## Sets VAULT_TOKEN after logging in with ## LDAP passphrase. ## Make sure that these environment variables are set beforehand: ## LDAP_USER= ## LDAP_PASS= ## VAULT_ADDR= export VAULT_TOKEN=$(curl -sk -d "{\"password\": \"${LDAP_PASS}\"}" "${VAULT_ADDR}/v1/auth/ldap/login/${LDAP...
#!/bin/bash mkdir ./ws #A temporary workspace inside opendistro-build/elasticsearch/linux_distributions ES_VERSION=$(../bin/version-info --es) OD_VERSION=$(../bin/version-info --od) OD_PLUGINVERSION=$OD_VERSION.0 PACKAGE=opendistroforelasticsearch ROOT=$(dirname "$0")/ws TARGET_DIR="$ROOT/Windowsfiles" #Download windo...
/* eslint-disable no-console, no-unused-vars */ import request from 'request' import colors from 'colors' import chunk from 'lodash/chunk' import fs from 'fs' const projectFiles = [] function headers(publicKey, privateKey) { return { 'Content-Type': 'application/json', 'Authorization': `Uploadcare.Simple ${...
<filename>src/main/java/com/homedepot/bb/DispatcherServlet.java package com.homedepot.bb; import com.homedepot.bb.util.ControllerMapping; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax...
#! /bin/bash . "${TOP_SRCDIR}"/test/testutil.sh die_if_fails ${BUILDDIR}/test-http-parser-upstream exit 0
#!/bin/bash ## REFBOX_DIR="~/rcll-refbox/bin" # SCRIPT_DIR="~/ownCloud/2021/scripts" # ROBVW2_DIR="~/ownCloud/2021/rvw2" # PYTHON_DIR="~/ownCloud/2021/python" SCRIPT_DIR="~/git/btr2021/rcll2021/scripts" ROBVW2_DIR="~/git/btr2021/rcll2021/rvw2" PYTHON_DIR="~/git/btr2021/rcll2021/python" ROBVIEW="robview" # ROBVIEW="rob...
/* * MX API * The MX Atrium API supports over 48,000 data connections to thousands of financial institutions. It provides secure access to your users' accounts and transactions with industry-leading cleansing, categorization, and classification. Atrium is designed according to resource-oriented REST architecture and...
import asyncio async def do_something(): print('starting something') await asyncio.sleep(2) print('done with something') asyncio.run(do_something())
<reponame>lpellegr/lettusearch<filename>src/main/java/com/redislabs/lettusearch/search/api/SearchCommands.java<gh_stars>1-10 package com.redislabs.lettusearch.search.api; import java.util.List; import java.util.Map; import com.redislabs.lettusearch.search.AddOptions; import com.redislabs.lettusearch.search.Document; ...
#this file takes file name argument and renames it #positional parameters used to store input during running of proram mv $1 $2 cat $2
#!/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 # "Lice...
cd ./game-server && npm install -d echo '============ game-server npm installed ============' cd .. cd ./web-server && npm install -d echo '============ web-server npm installed ============'
<reponame>peacetrue/learn-zookeeper<filename>learn-zookeeper-distributed-id/src/main/java/com/github/peacetrue/learn/zookeeper/DistributedIdApplication.java<gh_stars>0 package com.github.peacetrue.learn.zookeeper; import org.apache.curator.RetryPolicy; import org.apache.curator.framework.CuratorFramework; import org....
<gh_stars>0 import { dispatch } from '@rematch/core'; import React, { Component } from 'react'; import { StyleSheet, Text, View } from 'react-native'; import { Facebook, Logout } from './Button'; export default class UpgradeAccountView extends React.Component { render() { const { canLogout } = this.props; ...
<reponame>Jarunik/sm-team-finder<gh_stars>1-10 package org.slos.rating; import org.slos.splinterlands.domain.monster.ColorType; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; public class RatingContext { private Map<ColorTyp...
<reponame>EdwGx/AeroplaneChess class CreateGames < ActiveRecord::Migration def change create_table :games do |t| t.integer :state, default: 0, null: false t.integer :turn, default: 0 t.integer :steps, default: 0, null: false t.integer :stage, default: 0, null: false t.timestamps nul...
#!/bin/bash while true do ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-01/pending_work/ sleep 120 done
#ifndef RENDERER_H #define RENDERER_H #include "stdfx.h" #include "IRenderPass.h" #include "CommandQueue.h" #include <Timer.h> namespace Zephyr { namespace Graphics { const int FRAME_BUFFER_COUNT = 3; // triple buffering class GraphicsEngine; class ZEPHYR_GRAPHICS_API Renderer { public: Renderer(...
#!/bin/bash feat_dir=$PWD/data/mfcc_features stage=1 # Assuming the stage variable is defined elsewhere if [ $stage -le 1 ]; then for set in test dev train; do dir=data/$set steps/make_mfcc.sh --nj 20 --cmd "$train_cmd" $dir $dir/log $dir/data || exit 1 done fi
from datamodels.validation import metrics def evaluate_model_accuracy(model, test_data, actual_results): predicted_results = model.predict(test_data) accuracy = metrics.calculate_accuracy(predicted_results, actual_results) return accuracy
<gh_stars>1-10 class CreateUser < SeriousBusiness::Action att :name, presence: true, length: { minimum: 3 } def execute user_params = form_model.attributes.merge(role: :unprivileged) new_user = User.create!(user_params) [new_user] end end
#!/usr/bin/env bash while getopts "e:f:d:" opt; do case $opt in f) pidFile="$OPTARG" esac done if [ -z "$pidFile" ]; then printf "No pidFile was provided. Provide one with -f." exit fi sudo rm "$pidFile" sudo touch "$pidFile" DIR="$(dirname "${BASH_SOURCE[0]}")" cd "$DIR" || exit if [ "$(git ...
class CircleCI::Build attr_reader :job_name, :build_number, :status, :project def initialize(hash, project) @job_name = hash.dig 'workflows', 'job_name' @build_number = hash['build_num'] @status = hash['status'] @project = project end def artifacts api_path = [ 'project', projec...
package state import ( "encoding/json" "math/rand" "testing" "github.com/nspcc-dev/neo-go/pkg/core/transaction" "github.com/nspcc-dev/neo-go/pkg/internal/random" "github.com/nspcc-dev/neo-go/pkg/internal/testserdes" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/stretchr/testify/require" ) func testState...
<filename>packages/coinstac-pipeline/src/io-store.js<gh_stars>10-100 const backingStore = {}; const init = (storeKey) => { if (!backingStore[storeKey]) backingStore[storeKey] = {}; const store = backingStore[storeKey]; const put = (group, id, key) => { if (store[group]) { store[group][id] = key; ...
#!/bin/bash ######################################################################### # Exercício 3 - Criando e Executando Scripts # # # # Nome: RelatorioUsuario.sh # # # # Autor: Ricardo Prudenciato (ricardo@linuxsemfronteiras.com.br) # # Data: DD/MM/AAAA # # ...
#!/usr/bin/bash IMAGE_DIR="./rendered" PREFIX=$1 # e.g. PREFIX=test-sequence1 --> rendered/test-sequence1/test-sequence1-0000.hdr [...] EXTENSION=$2 OUTPUT=$3 DEFAULT_EXTENSION=".png" DEFAULT_OUTPUT="${PREFIX}.mp4" # check PREFIX if [ "${PREFIX}" == "" ]; then echo "Error: No prefix defined!" exit 1 fi...
/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.math.statistics.descriptive; import org.apache.commons.lang.Validate; import com.opengamma.analytics.math.function.Function1D; /** * Calculates th...
<filename>examples/main.cpp #include "main.hpp" int main() { std::thread basicPhongThread(&basicPhongMain); std::thread advancedLightingThread(&advancedLightingMain); basicPhongThread.join(); advancedLightingThread.join(); return 0; }
define(['utilities/dom', 'utilities/efence'], function(dom, pubsub) { var styleLinks = dom.qsa('link'), themes = [], themeManager = {}, current; styleLinks = Array.prototype.filter.call(styleLinks, function(link) { return link.rel === 'alternate stylesheet' || link.rel =...
<gh_stars>0 import diefpy.dief as diefpy traces_email_enron = diefpy.load_trace("/Users/juan/Projects/upc/upc-miri-tfm/connected-comp/results/diefpy/email-Enron.csv") diefpy.plot_answer_trace(traces_email_enron, "email-Enron",["#ECC30B","#D56062"]).show() metrics_enron = diefpy.load_metrics("/Users/juan/Projects/upc/u...
const pdf = require('pdf-creator-node'); // Create a document const document = { content: [ { text: 'Hello World', fontSize: 25 }, ], defaultStyle: { font: 'Times New Roman' } } // Create a PDF const pdfDoc = pdf.createPdf(document); // Save the PDF pdfDoc.write('example.pdf');
import AlertBox from './AlertBox' export default AlertBox
query { allArticles(orderBy: [{createdAt: "desc"}]) { title text createdAt } }
#!/bin/bash # # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"...
<gh_stars>0 package com.meterware.servletunit; /******************************************************************************************************************** * $Id: RequestDispatcherImpl.java 482 2003-02-27 18:40:39Z russgold $ * * Copyright (c) 2002-2003, <NAME> * * Permission is hereby granted, free of ch...
#!/usr/bin/python # coding=utf-8 # ^^ because https://www.python.org/dev/peps/pep-0263/ from __future__ import division import codecs import csv import xml.etree.cElementTree as ET import json import nltk from nltk import sent_tokenize from nltk import word_tokenize # It is okay to include tokenization and symbols...
<filename>test/data-structures/trees/binary-search-tree.test.ts<gh_stars>100-1000 import BinarySearchTree from '../../../src/data-structures/trees/binary-search-tree' import TreeNode from '../../../src/data-structures/trees/binary-search-tree/tree-node' describe('Binary Search Tree', () => { let tree: BinarySearchTr...
<reponame>zoho/Zoho-CRM-Field-Buddy package com.zoho.crm_field_buddy; import android.app.ProgressDialog; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.MenuItem; import android.widget.TextView; import com.zoho.crm_field_buddy.listActivity.Li...
def reverse(string): return string[::-1] print(reverse('Hello')) #prints "olleH"
package com.lbs.api.json.model /** { "AvailableNewPayers": [ { "Id": 45185, "IsFeeForService": false, "Name": "Moja firma SP. Z O.O." } ], "CityId": 5, "Payer": { "Id": 45185, "IsFeeForService": false, "Name": "Moja firma SP. ...
package org.zalando.intellij.swagger.file; import com.intellij.json.JsonLanguage; import com.intellij.lang.Language; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import java.util.Optional; import org.apache.commons.io.FilenameUtils; import org.jetbra...
#!/bin/bash DATA_PATH="/share/pi/nigam/projects/sepsis/extraction_201003" CONFIG_EXPERIMENT_NAME='finetune_config' my_func() { EXPERIMENT_NAME='finetune_subsample_ped_'$1 python -m sepsis.get_best_model \ --data_path=$DATA_PATH \ --experiment_name=$EXPERIMENT_NAME \ --config_experiment_...
<gh_stars>10-100 /******************************************************************************* * This file is part of the Symfony eclipse plugin. * * (c) <NAME> <<EMAIL>> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. ************...
<filename>sources/VS/ThirdParty/wxWidgets/src/generic/caret.cpp /////////////////////////////////////////////////////////////////////////////// // Name: src/generic/caret.cpp // Purpose: generic wxCaret class implementation // Author: <NAME> (original code by <NAME>) // Modified by: // Created: 25.0...
<filename>index.js module.exports = require('./src/katch');
<reponame>vipulnsward/sinatra-contrib<gh_stars>100-1000 require 'sinatra/base' require 'sinatra/capture' module Sinatra # = Sinatra::ContentFor # # <tt>Sinatra::ContentFor</tt> is a set of helpers that allows you to capture # blocks inside views to be rendered later during the request. The most # common use...
import { Component, OnInit, Input, OnDestroy, OnChanges, SimpleChanges } from '@angular/core'; import { ITrip } from 'app/shared/interfaces/trip'; import { splitIntoThree } from 'app/shared/utils'; @Component({ selector: 'app-trip-list', templateUrl: './trip-list.component.html', styleUrls: ['./trip-list.compon...
module.exports = function () { const path = require("path"); const fs = require("fs"); const MIME_MAP = { ".ttf": "application/x-font-ttf", ".wotf": "application/x-font-woff", ".wotf2": "application/x-font-woff2" }; const FORMAT_MAP = { ".ttf": "truetype", "....
<filename>src/db/config.js<gh_stars>0 import { Database } from "sqlite3"; import { open } from "sqlite"; export const database = () => open({ filename: "./database.sqlite", driver: Database });
#! /bin/sh set -e qmake make cd tests for i in ./tst_*; do ./$i; done
package no5 // https://leetcode-cn.com/problems/longest-palindromic-substring/ // 5. 最长回文子串--正读和反读都相同的字符序列为“回文” // 给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 的最大长度为 1000。 // 示例 1: // 输入: "babad" // 输出: "bab" // 注意: "aba" 也是一个有效答案。 // 示例 2: // 输入: "cbbd" // 输出: "bb"
package com.persado.assignment.project.controller; import com.persado.assignment.project.dto.BookDTO; import com.persado.assignment.project.service.BookService; import java.util.List; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Con...
class QuantifyParams: def __init__(self, quantify_rate, alpha, beta=0.1, gamma=2, delta=100, th=0.03): self.quantify_rate = quantify_rate self.alpha = alpha self.beta = beta self.gamma = gamma self.delta = delta self.th = th class MatmulQuantifyParams(QuantifyParams)...
<reponame>extra2000/saferwall<gh_stars>1-10 // Copyright 2021 Saferwall. All rights reserved. // Use of this source code is governed by Apache v2 license // license that can be found in the LICENSE file. package kaspersky import ( "strings" "github.com/saferwall/saferwall/pkg/utils" ) // Our consts const ( kesl ...
#!/bin/bash # Process alignment files # Written by David Coffey dcoffey@fhcrc.org # Updated February 8, 2016 ## Prerequisites (see Software_installation.sh) # Download and install picard tools # Download and install samtools # Download and install IGVtools ## Variables # export GENOME="..." # export SAMPLE="..." # ex...
<reponame>maypok86/finance-bot package service import ( "context" "testing" "github.com/golang/mock/gomock" "github.com/maypok86/finance-bot/internal/model" mock_repository "github.com/maypok86/finance-bot/internal/repository/mocks" "github.com/maypok86/finance-bot/pkg/random" "github.com/pkg/errors" "github....
#!/usr/bin/env bash set -euo pipefail find . -type f -name '*.rb' -or -name '*.ru' | entr -r ./scripts/server.sh
#include <iostream> #include <string> #include <nlohmann/json.hpp> #include <cassert> using json = nlohmann::json; class JSONParser { private: json parsedJson; public: JSONParser(const std::string& jsonString) : parsedJson(json::parse(jsonString)) {} bool getBoolean(const std::string& key) { ret...
<gh_stars>0 import React, { Component } from 'react'; import { Image, ScrollView, StyleSheet, Text, View } from 'react-native'; import Biometrics from 'react-native-biometrics'; import { Divider } from 'react-native-elements'; import { Credentials } from '../credentials.js'; import SyncStorage from 'sync-storage'; impo...
<filename>imports/parsers/getSongInfoNct.js /* © 2017 NauStud.io * @author <NAME> * * NCT URL parser module */ import { xml2js } from 'meteor/vjau:xml2js'; import getGzipURL from './getGzipURL'; import { SongOrigin, defaultThumbnailUrl } from '../constants.js'; // Utility / Private functions const xmlURLReg = /htt...
import psycopg2 # Assuming PostgreSQL database def retrieve_and_process_data(connection, noc_id): try: # Create a cursor object using the provided database connection cursor = connection.cursor() # Construct a SQL query to retrieve data from the 'noc' table query = f''' ...
<reponame>LoliKingdom/KemonoFixer package com.rong.kemonofixer.mixins.entity.ai; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.rong...
<reponame>swimshahriar/DailyPick-Grocery-Shop<gh_stars>1-10 /** * Orders Model * @module ordersModel */ const mongoose = require('mongoose'); const { nanoid } = require('nanoid'); /** * @constructor orderSchema * @property {String} _id - unique order id * @property {Array} items - list of items * @property {Nu...
#!/bin/bash --posix # # @superglue # @version 0.1.0-beta.1 # # A bash superset that cleans the environment, defines helper references, # sources helper functions, and sources a user-defined SCRIPT. # # @dest $BIN/superglue # @dest $BIN/sglue # @dest $BIN/sgl # @mode 0755 # # @author Adam Smith <imagineadamsmith@gmail.c...
<gh_stars>10-100 /******************************************************************************* * Copyright (c) 2015, 2016 <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 * *...
import numpy as np def cksaap(sequence, k): if not sequence or k <= 0: raise ValueError("Invalid input: sequence cannot be empty and k must be a positive integer") amino_acids = "ACDEFGHIKLMNPQRSTVWY" # List of all 20 standard amino acids num_acids = len(amino_acids) feature_vector = np.zeros...
from bs4 import BeautifulSoup def calculate_average_margin_top(html_file): with open(html_file, 'r') as file: html_content = file.read() soup = BeautifulSoup(html_content, 'html.parser') elements = soup.find_all(style=True) total_margin_top = 0 count = 0 for element in elements: ...
#!/bin/sh # Based on https://github.com/eldarlabs/ghpages-deploy-script/blob/master/scripts/deploy-ghpages.sh # abort the script if there is a non-zero error #set -e remote=$(git config remote.origin.url) # now lets setup a new repo so we can update the branch git config --global user.email "$GH_EMAIL" > /dev/null 2...
function vetor1(vetor, num) { let novoVetor = [] for (let i = 0; i < vetor.length; i++) { novoVetor.push(vetor[i] * num) } return novoVetor } function vetor2(vetor, num) { let novoVetor2 = [] for (let i = 0; i < vetor.length; i++) { if (vetor[i] > 5) { novoVetor2.push...
#!/bin/bash #summary: meta reporting on scripts #tags: meta, fluentBash #load loader first. [ -z ${BASH_DIR+x} ] && BASH_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) source $BASH_DIR/../core/core.sh #first thing we load is the script loader #load dependencies. loadScript piping/piping.sh loadScript piping/s...
<gh_stars>0 public abstract class User { protected String name; protected MessageMediator mediator; public User(String name, MessageMediator mediator) { this.name = name; this.mediator = mediator; } public abstract void send(String message); public abstract void receive(String message); }