text
stringlengths
1
1.05M
public static int[] reverseArray(int[] arr) { int[] reversed = new int[arr.length]; int j = 0; for (int i = arr.length - 1; i >= 0; i--){ reversed[j] = arr[i]; j += 1; } return reversed; }
def sort_list(words): return sorted(words) sorted_list = sort_list(['Elephant', 'Cat', 'Dog']) print(sorted_list)
import { join } from 'path'; // @ts-ignore import reduceCalc from 'reduce-css-calc'; import classnames from './config/classnames'; import defaultScreens from './config/screens'; import defaultTokens from './config/tokens'; import { IClasses, IClassesByType, IConfig, IEvaluatedClassnames, IEvaluatedConfig, ...
package com.nameless.bank.web.forms; import java.util.Collection; /** * Created by Глеб on 06.04.2016. */ public class TransactFrameForm { private int fromId; private String fromName; private Collection to; private int sum; public int getFromId() { return fromId; } ...
#!/bin/sh set -e set -u set -o pipefail function on_error { echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" } trap 'on_error $LINENO' ERR if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy # resources to, so e...
<gh_stars>10-100 var namespacedroid_1_1_runtime_1_1_prototyping_1_1_sensors_1_1_occupancy = [ [ "Occupancy3dSensor", "classdroid_1_1_runtime_1_1_prototyping_1_1_sensors_1_1_occupancy_1_1_occupancy3d_sensor.html", "classdroid_1_1_runtime_1_1_prototyping_1_1_sensors_1_1_occupancy_1_1_occupancy3d_sensor" ] ];
# store the array nums = [2, 4, 5, 7, 8, 9, 10] # initialize a new array to store the odd numbers odd_nums = [] # loop through the array for num in nums: # if the number is odd if num % 2 == 1: # add it to the new array odd_nums.append(num) # print the new array print("Odd numbers array:", od...
package com.bypassmobile.octo.model; import java.util.ArrayList; import java.util.List; public class DataWrapper <T> { public enum Status { NONE, LOADING, ERROR } private Status status; private List<T> dataList; public DataWrapper () { status = Status.NONE; dataList = new ArrayList<>(); } ...
<filename>apkanalyser/src/andreflect/gui/action/injection/DalvikMethodFieldReadAction.java /* * Copyright (C) 2012 Sony Mobile Communications AB * * This file is part of ApkAnalyser. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Licen...
#!/usr/bin/bash VERSION=`cat version` echo "preparing pwa-admin version $VERSION" rm -rf pwa-admin/tmp mkdir pwa-admin/tmp cp -r ../../api pwa-admin/tmp rm -f pwa-admin/tmp/api/config.js rm -f pwa-admin/tmp/api/auth.pub rm -f pwa-admin/tmp/api/auth.key rm -f pwa-admin/tmp/api/user.jwt cp -r ../../ui pwa-admin/tmp cp ...
<?php $weekday = date('w'); if($weekday == '0' || $weekday == '6') { echo 'It\'s the weekend, go and have fun!'; } else { echo 'It\'s a weekday, time to work!'; } ?>
import React from "react"; import _ from "lodash"; import countries from "../../Config/countries"; import ReactCountryFlag from "react-country-flag"; import { isWindows } from "../../Utils/device"; const emojiSupport = require("../../Helpers/detectEmojiSupport"); const emojiSupported = emojiSupport(); expo...
package Chapter3_2Low; import edu.princeton.cs.algs4.BST; import edu.princeton.cs.algs4.StdIn; public class TestBST { //Exercise 3.2.10 public static void main(String[] args) { BST<String, Integer> bst = new BST<>(); for (int i = 0; !StdIn.isEmpty(); i++) { String key = StdIn.readS...
/** * resolve to absolute for external urls, relative for same domain * @param {string} path * @param {string} from * @returns {string} */ export function resolve(path, from) { if (path.match(/^['"]?data:/)) { return path; } const baseURL = new URL(from, window.location); const pathURL =...
<filename>mcu_source/Libraries/utilities/chusb/inc/usbd_cp210x.h<gh_stars>1-10 #ifndef __USBD_CP210X_SERIAL_H_ #define __USBD_CP210X_SERIAL_H_ #include <stdint.h> #include <usbd.h> #include <usb_common.h> /* Config request codes */ #define CP210X_IFC_ENABLE 0x00 #define CP210X_SET_BAUDDIV 0x01 #define CP210X_GET_BAUD...
package types type ReviewDTO struct{ Info string `json:"info"` Stars string `json:"stars"` }
. "${BASH_LIB_DIR}/test-utils/bats-support/load.bash" . "${BASH_LIB_DIR}/test-utils/bats-assert-1/load.bash" . "${BASH_LIB_DIR}/init" docker_safe_tmp(){ # neither mktemp -d not $BATS_TMPDIR # produce dirs that docker can mount from # in macos. local -r tmp_dir="/tmp/${RANDOM}/spgs" ( rm -rf...
<reponame>thelegendoflinas/ImageEditor package com.createchance.imageeditor.shaders; import android.opengl.GLES20; /** * Color phase transition shader. * * @author createchance * @date 2018/12/31 */ public class ColorPhaseTransShader extends TransitionMainFragmentShader { private final String TRANS_SHADER = ...
def longest_increasing_sequence(arr): # Initialize longest sequence length to 1 longest_sequence_length = 1 # Initialize current sequence length to 1 current_sequence_length = 1 # Traverse the array for i in range(len(arr) - 1): if (arr[i] < arr[i + 1]): # Increment th...
package ethanjones.mc.inventorybook.handler; import baubles.api.BaublesApi; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.text.ITextComponent...
<gh_stars>0 #include<iostream.h> #include<conio.h> #include<iomanip.h> int main() { const double a = 789.1234; cout.setf(ios::showpos); cout.setf(ios::fixed); cout<<setprecision(1)<<a<<"\n"; cout<<setprecision(2)<<a<<"\n"; cout<<setprecision(3)<<a<<"\n"; cout<<setprecision(4)<<a<<"\n"; c...
<reponame>Nedson202/Harvard-arts import { Request, Response, NextFunction } from 'express'; import { stackLogger } from 'info-logger'; const errorHandler = (error, req: Request, res: Response, next: NextFunction) => { stackLogger(error); return res.sendStatus(error.httpStatusCode).json({ error: true, messa...
#!/bin/sh g++ -g -O0 vector_add.cpp -lOpenCL
# Copyright 2017 BBVA # # 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, softwar...
def get_maximum_value(lst): return max(lst) print(get_maximum_value([1, 5, 2, 9, -2]))
#!/bin/bash set -euo pipefail echo "NOTE: Expected first time run time is under 5 minutes," echo "repeat runs under a minute to just to regenerate reports." echo mkdir -p intermediate/ summary/ # Takes arguments via variable names function import_marker { echo "Trimming $GENE sequences for $MARKER" export RI...
<gh_stars>1-10 "use strict"; exports.id = 829; exports.ids = [829]; exports.modules = { /***/ 4829: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () =>...
<filename>lib/ayeaye/pinnate.py import json class Pinnate: """ Dictionary or attribute access to variables loaded either from a JSON string or supplied as a dictionary. >>> a = Pinnate({'my_string':'abcdef'}) >>> a.my_string 'abcdef' >>> a['my_string'] 'abcdef' >>> a.as_dict() ...
#!/bin/bash #if [ "$use_service" = "knative" ]; #then # dir=`dirname $0` # ca_file_name=${dir}/ca.yaml # kubectl --namespace knative-serving create secret generic customca --from-file=customca.crt=/etc/docker/certs.d/harbor.sigsus.cn:8443/ca.crt --dry-run -o yaml > $ca_file_name #fi
/********************************************************************************* * * Copyright (c) 2016, <NAME> * All rights reserved. * * This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. * http://creativecommons.org/licenses/by-nc/4.0/ * * You are free to:...
class Site: def __init__(self, name, slug): self.name = name self.slug = slug def create_and_log_site(name, slug): try: site = Site(name, slug) # Simulate the site creation process # Log the success of site creation return f"Successfully created a new site: {name...
const path = require('path'); const webpack = require('webpack'); module.exports = { plugins: [new webpack.DefinePlugin({ // Definitions... }) ], resolve: { alias: { '@': path.resolve('resources/js'), }, }, };
#!/bin/bash SGX=1 ./pal_loader bash -c "/opt/jdk8/bin/java \ -cp '/ppml/trusted-big-data-ml/work/spark-2.4.3/conf/:/ppml/trusted-big-data-ml/work/spark-2.4.3/jars/*' \ -Xmx1g org.apache.spark.deploy.SparkSubmit \ --master 'local[4]' \ /ppml/trusted-big-data-ml/work/spark-2.4.3/examples/src/main/python/s...
<reponame>PranavKhadpe/Detecting-usefulness-of-Yelp-Reviews ''' Takes as input a CSV File with the bin value in the first column and the remaining features in the next column. Headers have to be removed Improvements: Instead of feature selection techniques used here, a correlation based feature reduction technique can ...
module MurmurHash # the 64-bit version of MurmurHash2, supposedly. I have doubts about either this # java implementation or the digest-murmurhash gem's implementation. I don't # get equivalent results when passing in a String into them so I'm wondering # which one is most similar to the original C++ implementat...
<gh_stars>0 var relativeHRefHook = { missedFilePaths: [], badImageDataFound: false, onDomSerialization: function (dom) { var thiz = this; Dom.workOn("//@xlink:href", dom, function (href) { var hrefValue = href.nodeValue; if (!hrefValue.match(/^file:\/\/.*$/)) return;...
let list = ['Apples', 'Oranges', 'Grapes']; function add(item) { list.push(item); console.log(`${item} has been added to the list!`); } function remove(item) { const index = list.indexOf(item); if (index === -1) { console.log(`${item} is not on the list!`); } else { list.splice(index, 1); console.log(`${item}...
#!/usr/bin/env bash docker exec broker bash -c "kafka-console-producer --broker-list broker:9092 --topic oltp.dbo.tablea" docker exec -it schema-registry /bin/bash kafka-avro-console-producer --topic oltp.dbo.tablea \ --bootstrap-server broker:9092 \ --property...
var searchData= [ ['hash',['Hash',['../classHash.html',1,'']]] ];
import requests import lxml.html as lh # Link of the website to get cities url = 'http://example.com/cities' # Create list of cities cities = [] # Get web page response = requests.get(url) # Parse the web page to get the table doc = lh.fromstring(response.content) tr_elements = doc.xpath('//tr') # Loop through eac...
OS_VER=$( grep VERSION_ID /etc/os-release | cut -d'=' -f2 | sed 's/[^0-9\.]//gI' ) OS_MAJ=$(echo "${OS_VER}" | cut -d'.' -f1) OS_MIN=$(echo "${OS_VER}" | cut -d'.' -f2) MEM_MEG=$( free -m | sed -n 2p | tr -s ' ' | cut -d\ -f2 || cut -d' ' -f2 ) CPU_SPEED=$( lscpu | grep -m1 "MHz" | tr -s ' ' | cut -d\ -f3 || cu...
<gh_stars>1-10 // // ReservationInputViewController.h // CinemaCity // // Created by <NAME> on 29/03/14. // Copyright (c) 2014 <NAME>. All rights reserved. // #import <UIKit/UIKit.h> @interface ReservationInputViewController : UITableViewController @property (nonatomic, strong) NSString *cinemaID; @property (non...
package com.dimafeng.testcontainers.integration import java.net.InetSocketAddress import com.datastax.oss.driver.api.core.CqlSession import com.datastax.oss.driver.internal.core.metadata.DefaultEndPoint import com.dimafeng.testcontainers.{CassandraContainer, ForAllTestContainer} import org.scalatest.flatspec.AnyFlatSp...
images=('00761_00761_00018' '00761_00761_00289' '01012_00018_01012' '01012_00841_01012' '00761_00761_00059' '00761_00761_00314' '01012_00059_01012' '01012_01037_01012' '00761_00761_00079' '00761_00761_00427' '01012_00421_01012' '00761_00761_00171' '00761_00761_00736' '01012_00623_01012' '67172_00018_67172' '67172_00...
//Aditya’s code for recursive list reverse #include<stdio.h> #include<stdlib.h> #include"ll.h" node *reverse(node *head,node *temp){ //Reversing node *final; if(head->next==NULL){ final = head; } else if(head->next!=NULL){ temp = head; head = head->next; reve...
for FILE in out_*; do echo $FILE; done
require File.expand_path('../../../test_helper', __FILE__) module Etsy class ShopTest < Test::Unit::TestCase context "The Shop class" do should "be able to find a single shop" do shops = mock_request('/shops/littletjane', {}, 'Shop', 'getShop.single.json') Shop.find('littletjane').should ...
import { Address, BigDecimal, BigInt, log} from '@graphprotocol/graph-ts' import { BondDiscount } from '../../generated/schema' import { } from './Constants'; import { hourFromTimestamp } from './Dates'; import { toDecimal } from './Decimals'; import { getRIPUSDRate } from './Price'; export function loadOrCreateBondD...
<filename>cspBackEnd/src/pythagorean_triples.cpp #include "pch.h" #include "pythagorean_triples.h" using json = nlohmann::json; csp::ConstraintProblem<int> constructPythagoreanTriplesProblem(int n, std::vector<csp::Variable<int>>& variables, std::vector<csp::Constraint<int>>& constraints) { std::unordered_s...
<gh_stars>1000+ package com.novoda.gradle.release.sample.android; public class AndroidSample { public static void hello() { System.out.println("Hello world from AndroidSample"); } }
import React from 'react'; import { StyleSheet, Text, View, TextInput, Button } from 'react-native'; export default class App extends React.Component { constructor(props) { super(props); this.state = { people: [{ name: 'John', age: 34, occupation: 'Developer' }, { name: 'Mary', age: 28, occupation: 'Designer' }], ...
/* * Copyright © 2020 Lisk Foundation * * See the LICENSE file at the top-level directory of this distribution * for licensing information. * * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation, * no part of this software, including this file, may be copied, modified, * propagated...
package lister import ( "github.com/trek10inc/awsets/context" "github.com/trek10inc/awsets/resource" "github.com/aws/aws-sdk-go-v2/service/elasticache" "github.com/aws/aws-sdk-go-v2/aws" ) type AWSElasticacheSnapshot struct { } func init() { i := AWSElasticacheSnapshot{} listers = append(listers, i) } func ...
<filename>src/main/java/voot/ErrorController.java package voot; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.ErrorAttributes; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.util.A...
def count_characters(string, char): count = 0 for c in string: if c== char: count += 1 return count print(count_characters('Hello world', 'l')) # 3
import datetime def display_current_date_time(): current_date_time = datetime.datetime.now() formatted_date_time = current_date_time.strftime("%Y-%m-%d %H:%M:%S") print("Current Date and Time:", formatted_date_time) def add_days_to_current_date(days): current_date = datetime.date.today() future_da...
#!/bin/sh #BHEADER********************************************************************** # Copyright (c) 2008, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # This file is part of HYPRE. See file COPYRIGHT for details. # # HYPRE is free software; you can redistri...
<html> <head> <title>Colors Table</title> </head> <body> <h1>Colors Table in Alphabetical Order</h1> <table> <tr> <th>Color</th> <th>Hex Code</th> </tr> <tr> <td>Blue</td> <td>#0000FF</td> </tr> <tr> <td>Green</td> <td>#00FF00</td> </tr> <tr> <td>Red</td> <t...
#!/usr/bin/env bash # Detect and format/mount extra disk to /etc/lego for storing certs # If FS is already formatted, don't reformat # If script has already been executed, do not execute again set -e WITNESS_FILE=/usr/local/startup-script-ok [ -e ${WITNESS_FILE} ] && exit 0 if DISK_NAME=$(curl -H 'Metadata-Flavor:...
// Code generated by MockGen. DO NOT EDIT. // Source: interface.go package httperr import ( gomock "github.com/golang/mock/gomock" reflect "reflect" ) // MockError is a mock of Error interface type MockError struct { ctrl *gomock.Controller recorder *MockErrorMockRecorder } // MockErrorMockRecorder is the m...
<filename>alg_geometric_series.py from __future__ import absolute_import from __future__ import division from __future__ import print_function """Geometric series: 1 + r + r^2 + ... + r^(n+1).""" def geometric_series_recur(n, r): """Geometric series by recursion. Time complexity: O(n). Space complexity: ...
#!/bin/bash dieharder -d 15 -g 22 -S 3000572670
#!/bin/sh set -u subjectName=$1 scanNum=$2 longScanNum=$(seq -f "%02g" $scanNum $scanNum) imgDir='/mnt/Data01/'`date +%Y%m%d`'.'$subjectName'.'$subjectName'' #imgDir='/mnt/Data01/20161018.1018162_phantom01.1018162_phantom02' delta=0.0001 #seconds stamp=`date +%Y%m%d%H%M%S` echo $imgDir regFile=${imgDir}/reg/f2mn...
#!/bin/bash echo [x] Adding $USER to 'docker' group sudo adduser $USER docker echo Now you can command docker daemon. echo [x] Adding $USER to 'cyber' group sudo adduser $USER cyber echo Now you can run cybernode components. echo Please relogin to make new powers effective.
#!/bin/bash # #check if /appdata/space-engineers/config/World is a folder if [ ! -d "/appdata/space-engineers/World" ]; then echo "World folder does not exist, exiting" exit 129 fi # #check if /appdata/space-engineers/config/World/Sandbox.sbc exists and is a file if [ ! -f "/appdata/space-engineers/World/Sandbox....
import React, { useState} from 'react'; import './style.scss'; const Card = ({ children }) => { const [flipped, setFlipped] = useState(false); return ( <div className="flip-card" onClick={()=> {setFlipped(!flipped)}} > <div className={flipped ? "card-front card-front-rotate" : "card-front"}> ...
import React from 'react'; import { Link } from 'react-router-dom'; const DiscoverArea = () => { return ( <div className="discover-area ptb-80"> <div className="container"> <div className="row align-items-center"> <div className="col-lg-6 col-md-12"> <div className="discover-...
<gh_stars>10-100 # coding: utf-8 # # FVCOM horizontal slice at fixed depth # In[1]: get_ipython().magic('matplotlib inline') import numpy as np import numpy.ma as ma import matplotlib.pyplot as plt import matplotlib.tri as tri import cartopy.crs as ccrs from cartopy.io import shapereader from cartopy.mpl.gridlin...
/* * Copyright (c) 2013-2015 <EMAIL> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. */ #include <linux/input.h> #include <linux/i2c.h> #include <linux/delay.h> #include <linux...
<filename>app/src/main/java/me/androidbox/enershared/home/HomeActivity.java package me.androidbox.enershared.home; import android.content.res.Configuration; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.NavigationView; import android.support.v4.app.Fragment;...
<filename>applications/physbam/physbam-lib/Public_Library/PhysBAM_Solids/PhysBAM_Deformables/Constitutive_Models/CONSTITUTIVE_MODEL.cpp //##################################################################### // Copyright 2003-2007, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. // This file is part of PhysBAM whose di...
def is_prime?(n) if n <= 1 return false end i = 2 while i*i <= n if n % i == 0 return false end i += 1 end return true end
import { DataType, FieldType } from "../../../Constants/Form" import { ChartType, ChartTypeOptions } from "../../../Constants/Widgets/UtilizationPanel" import { getValue } from "../../../Util/Util" import { getCircleItems } from "./Circle/Edit" import { getSparkItems } from "./Spark/Edit" import { getTableItems } from ...
<reponame>Thaslim/Splitwise-Lab2<gh_stars>0 import mongoose from 'mongoose'; const MemberSchema = new mongoose.Schema({ groupID: { type: mongoose.Schema.Types.ObjectId, ref: 'group', }, memberID: { type: mongoose.Schema.Types.ObjectId, ref: 'user', }, getBack: { type: Number, default: 0.0 }, ...
<!DOCTYPE html> <html> <head> <title>Student Registration Form</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <h1>Student Registration</h1> <form action="submit.php" method="post"> <div class="form-group"> <label for="name">Name</label> <input type="text" class="fo...
#!/usr/bin/env bash # Set environment variables for dev export APP_NAME=${APP_NAME:-test.com} export APP_ENV=${APP_ENV:-dev} export APP_PORT=${APP_PORT:-8888} export DB_PORT=${DB_PORT:-3399} export DB_ROOT_PASS=${DB_ROOT_PASS:-root} export DB_NAME=${DB_NAME:-} export DB_USER=${DB_USER:-root} export DB_PASS=${DB_PASS:-...
#!/usr/bin/env bash set -eu PROTO_SRC=./proto PROTO_DEST=./src/generated mkdir -p ${PROTO_DEST} protoc \ -I ${PROTO_SRC} $(find ${PROTO_SRC} -name "*.proto") \ --js_out="import_style=commonjs,binary:${PROTO_DEST}" \ --grpc-web_out="import_style=commonjs+dts,mode=grpcwebtext:${PROTO_DEST}"
<gh_stars>0 import React, { Component } from 'react'; import { connect } from 'react-redux'; import classNames from 'classnames'; import withStyles from '@material-ui/core/styles/withStyles'; import SnackbarContent from '@material-ui/core/SnackbarContent'; import Snackbar from '@material-ui/core/Snackbar'; import { c...
import legend from '@src/store/legend'; import { InitStoreState, Scale, StateFunc } from '@t/store/store'; import { deepMergedCopy } from '@src/helpers/utils'; import { LineChartOptions, NestedPieChartOptions } from '@t/options'; import Store from '@src/store/store'; describe('Legend Store', () => { it('should apply...
<reponame>multiplex/multiplex.js<gh_stars>10-100 export var OBJECT_PROTOTYPE = Object.prototype; export var ARRAY_PROTOTYPE = Array.prototype;
#!/bin/bash SSID="" PASSWORD="" CURDATE=$(date +%s) echo "Updating Wallaby to connect to a wireless network..." echo "(NOTE: Will no longer function as a Wireless Access Point (WAP), but will continue to connect over USB)." sleep 4 if [ -z "${SSID}" ]; then echo "SSID not set in the script." echo ...
package com.leetcode; import org.testng.annotations.Test; import static org.testng.Assert.*; public class Solution_1185Test { @Test public void testDayOfTheWeek() { Solution_1185 solution_1185 = new Solution_1185(); System.out.println(solution_1185.dayOfTheWeek(31,8,2019)); } }
use fontconfig_sys as sys; use std::ptr; pub struct Fontconfig; pub struct ObjectSet { // Define the fields and methods for the ObjectSet struct } impl Fontconfig { /// The `FcObjectSet` must not be null. This method assumes ownership of the `FcObjectSet`. pub fn from_raw(_: &Fontconfig, raw_set: *mut sy...
#! /bin/bash # The bird config file path is different for Red Hat and Debian/Ubuntu. if [ -f /etc/bird.conf ]; then BIRD_CONF=/etc/bird.conf else BIRD_CONF=/etc/bird/bird.conf fi BIRD_CONF_TEMPLATE=/usr/share/calico/bird/calico-bird.conf.template # Require 3 arguments. [ $# -eq 3 ] || cat <<EOF Usage: $0 <m...
<filename>test/unit/word.spec.js<gh_stars>10-100 var chai = require('chai'); var sinon = require('sinon'); chai.use(require('sinon-chai')); var expect = chai.expect; var Word = require('../../src/js/word'); var Char = require('../../src/js/char'); describe('Word', function () { describe('constructor', function () { ...
<filename>generator/src/main/java/net/synqg/qg/implicative/ImplicativeType.java package net.synqg.qg.implicative; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.experimental.Accessors; /** * Types of implications used by verbs as well as phrases (verb-noun collocations) * * @author kaustubh...
#! /usr/bin/env bash # # Given a commit, update all the Copyrights of the changed files. # # Copyright 2021, Verizon Media # SPDX-License-Identifier: Apache-2.0 # usage="$(basename $0) <git_commit>" fail() { echo -e $1 exit 1 } [ $# -eq 1 ] || fail "Provide a git commit to check changed files for.\n\n${usage}" co...
eval(loadFile("src/main/webapp/factorial.js")); testCases(test, function test15() { assert.that(factorial(15), eq(1307674368000)); }, function testRegEx() { var actual = "JUnit in Action"; assert.that(actual, matches(/in/)); assert.that(actual, not(matches(/out/))); } );
#!/usr/bin/env bash set -o pipefail set -o nounset set -m if [[ $# -lt 1 ]]; then echo "Usage :" echo ' $1: hub|spoke' echo "Sample: " echo " ${0} hub|spoke" exit 1 fi # variables # ######### # Load common vars source ${WORKDIR}/shared-utils/common.sh echo ">>>> Get the pull secret from hub t...
// <NAME>, Geometric Tools, Redmond WA 98052 // Copyright (c) 1998-2016 // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt // File Version: 3.0.0 (2016/06/19) #include "SphereMapEffect.h" using namespace g...
import React, { forwardRef } from 'react' import PropTypes from 'prop-types' import { pathStrOr } from 'utils/fp' import { uniq } from 'ramda' import { ValidatedFormInputPropTypes } from 'core/components/validatedForm/withFormContext' import useDataLoader from 'core/hooks/useDataLoader' import Picklist from 'core/compo...
#!/bin/sh # # After a PR merge, Chef Expeditor will bump the PATCH version in the VERSION file. # It then executes this file to update any other files/components with that new version. # set -evx sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"$(cat VERSION)\"/" lib/dep-selector-libgecode/version.rb # Once Expedit...
<html> <head> <title>Upload Photos</title> </head> <body> <h1>Upload Photos</h1> <form action="upload.php" method="post" enctype="multipart/form-data"> Select images to upload: <input type="file" name="photos[]" multiple> <input type="submit" value="Upload files" name="submit"> </form...
#!/bin/bash #SBATCH --job-name=songbird # Job name #SBATCH -p normal # priority #SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) #SBATCH --mail-user=mcalgaro93@gmail.com # Where to send mail #SBATCH --nodes=1 # Use one node #SBATCH --ntasks=1 ...
class Gallery: def ordered_images(self): # Returns a list of image objects in the gallery pass class GalleryView: def __init__(self, gallery): self.gallery = gallery def render(self, **kwargs): request = kwargs.get('request') objects = self.gallery.ordered_images() ...
#!/bin/bash # # This test is for basic NAT functionality: snat, dnat, redirect, masquerade. # # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 ret=0 test_inet_nat=true sfx=$(mktemp -u "XXXXXXXX") ns0="ns0-$sfx" ns1="ns1-$sfx" ns2="ns2-$sfx" cleanup() { for i in 0 1 2; do ip netns del ns$i-"$sfx";done...
package dbis.piglet.codegen.flink.emitter import dbis.piglet.codegen.{ CodeEmitter, CodeGenContext, CodeGenException } import dbis.piglet.expr._ import dbis.piglet.op._ import dbis.piglet.plan.DataflowPlan import dbis.piglet.schema.Schema import dbis.piglet.codegen.scala_lang.ScalaEmitter import dbis.piglet.udf.UDFTab...
package io.opensphere.heatmap; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Polygon; import java.awt.RadialGradientPaint; import java.awt.image.BufferedImage; import org.jdesktop.swingx.image.AbstractFilter; import org.jdesktop.swingx.image.Gau...
<?php // Declaring variables $name = $_POST['name']; $email = $_POST['email']; // Establishing a connection to the database $conn = mysqli_connect("localhost", "username", "password", "dbname"); if($conn === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } // Attempt insert query ...
from typing import Dict import re def count_word_occurrences(file_path: str) -> Dict[str, int]: stop_words = {"the", "and", "is", "it", "a", "an", "in", "on", "at", "to", "of", "for", "with", "as"} word_counts = {} with open(file_path, 'r') as file: text = file.read().lower() words = re.fi...