text stringlengths 1 1.05M |
|---|
import TokamakTests
import XCTest
var tests = [XCTestCaseEntry]()
tests += TokamakTests.allTests()
XCTMain(tests) |
class Stack:
def __init__(self):
self.items = []
def isEmpty(self):
return self.items == []
def push(self, item):
self.items.append(item)
def pop(self):
return self.items.pop()
def peek(self):
return self.items[len(self.items)-1]
def size(self):
return len... |
<filename>INFO/Books Codes/Oracle Wait Interface A Practical Guide to Performance Diagnostics & Tuning/Chapter6_page177_1.sql
-- Oracle9i Database and above
select *
from v$enqueue_stat
where cum_wait_time > 0
order by inst_id, cum_wait_time;
-- Oracle 7.1.6 to 8.1.7
select inst_id,
ksqsttyp "Lock",
... |
<reponame>joewood/refluxion
import Sequelize = require("sequelize");
var graphqlSeq = require("graphql-sequelize");
let {typeMapper, resolver, attributeFields, defaultListArgs, defaultArgs} = graphqlSeq;
import * as GraphQL from "graphql";
function fromISODate(value) {
try {
if (!value) return null;
... |
<gh_stars>1-10
package com.ensoftcorp.open.dynadoc.core.wrapper;
import java.util.List;
import com.ensoftcorp.open.dynadoc.core.data.Issue;
import com.ensoftcorp.open.dynadoc.core.data.JavaClass;
import com.hp.gagawa.java.elements.A;
import com.hp.gagawa.java.elements.Div;
import com.hp.gagawa.java.elements.Table;
im... |
#!/bin/bash
shopt -s extglob
rm -rf feeds/jell/{diy,mt-drivers,shortcut-fe,luci-app-mtwifi,base-files}
for ipk in $(find feeds/jell/* -maxdepth 0 -type d);
do
[[ "$(grep "KernelPackage" "$ipk/Makefile")" && ! "$(grep "BuildPackage" "$ipk/Makefile")" ]] && rm -rf $ipk || true
done
rm -rf package/{base-files,network/... |
#!/bin/sh
#Detect WiFi port number (en0 or en1)
wifi=`/usr/sbin/networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/,/Ethernet/' | awk 'NR==2' | cut -d " " -f 2`
ethernet=`/usr/sbin/networksetup -listallhardwareports | awk '/Hardware Port: Ethernet/,/Wi-Fi/' | awk 'NR==2' | cut -d " " -f 2`
EthStatus=`/sb... |
// deno-lint-ignore-file camelcase
import { ensureDir } from 'https://deno.land/std@0.97.0/fs/ensure_dir.ts'
import { exists } from 'https://deno.land/std@0.103.0/fs/exists.ts'
import {
AnticipatedHttpError,
cachePath,
external,
getFilePath,
} from './cache.ts'
import * as html from './html-maker.ts'
import { m... |
#!/bin/bash
# Plugin file for enabling manila services
# ----------------------------------------
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set -o xtrace
# Entry Points
# ------------
function _clean_share_group {
local vg=$1
local vg_prefix=$2
# Clean out existing shares
for lv in `sudo l... |
package io.github.marcelbraghetto.sunshinewatch.framework.core.dagger;
import android.content.Context;
import android.support.annotation.NonNull;
/**
* Created by <NAME> on 30/04/16.
*
* Dependency injector - lazily created to also allow Dagger to be available from any Android
* component that has a context.
*/
... |
<reponame>unixing/springboot_chowder<gh_stars>10-100
package com.oven.controller;
import com.oven.utils.FileUtils;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.sprin... |
package kr.co.gardener.admin.controller.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
imp... |
#include<bits/stdc++.h>
using namespace std;
// string convert2Bin(long long int num) {
// if(num == 1) return "1";
// string result = "";
// long long int size = 0;
// long long int n = num;
// while(n) {
// if(n%2 == 0) result = '0' + result;
// else {
// result = '1' ... |
#!/bin/bash
disk_info=$(df -h / | awk '/\//{ printf("%4s/%s \n", $4, $2) }')
echo ${disk_info}
|
#!/usr/bin/env bash
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y --force-yes vim curl python-software-properties
sudo apt-get update --fix... |
#!/bin/bash
# Copyright (c) 2017 Cisco and/or its affiliates.
# 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 applicab... |
package io.opensphere.core.help.data;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.Xml... |
# test uPy ujson behaviour that's not valid in CPy
try:
import ujson
except ImportError:
print("SKIP")
raise SystemExit
print(ujson.dumps(b'1234'))
|
package de.ids_mannheim.korap.web.controller;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
impor... |
#!/bin/sh
fileName=$1
#Create a temporary directory that stores the library files
SCRATCH=$(mktemp -dp /tmp)
tar -xzf "$fileName" -C "$SCRATCH"
#Stores the current directory
here=$(pwd)
cd "$SCRATCH" || exit
name=$(ls)
cd "$name" || exit
#search the current directory for files containing
#"DELETE ME"and remove each ... |
package com.agido.idea.settings.plugins.maven;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Sets;
import com.intellij.openapi.util.Pair;
import org.jetbrains.annotations.NotNull;
import java.util.Set;
import java.util.TreeSet;
public class MavenProfil... |
<filename>src/drivers/mediatek/mt8195/afe-memif.c
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: <NAME> <<EMAIL>>
// <NAME> <<EMAIL>>
#include <sof/common.h>
#include <sof/audio/component.h>
#include <sof/drivers/afe-drv.h>
#include <sof/drivers/afe-dai.h>
#include <sof... |
import request from '@/utils/request'
export function createDeviceAbility(data) {
return request({
url: '/temp/api/deviceAbility/createDeviceAbility',
method: 'post',
data
})
}
export function deleteAbility(id) {
return request({
url: `/temp/api/deviceAbility/deleteAbility/${id}`,
method: 'd... |
#!/bin/sh
cd `dirname $0`
exec erl -sname edc -config $PWD/sys.config \
-pa $PWD/_build/default/lib/*/ebin $PWD/test -boot start_sasl \
-setcookie start-dev -run c erlangrc . |
def solve_csp(constraints, individuals):
roles = {c['role_id']: [] for c in constraints}
for individual in individuals:
for role_id in roles:
if all(constraint['condition'](individual) for constraint in constraints if constraint['role_id'] == role_id):
roles[role_id].append(i... |
<reponame>getevo/monday<filename>format_sv_se.go
package monday
// ============================================================
// Format rules for "sv_SE" locale: Swedish (Sweden)
// ============================================================
var longDayNamesSvSE = map[string]string{
"Sunday": "Söndag",
"Monda... |
echo "> Is Running?"
CURRENT_PID=$(pgrep -f lightcomics)
echo "$CURRENT_PID"
if [ -z $CURRENT_PID ]; then
echo "> Not Running!"
else
echo "> kill -2 $CURRENT_PID"
kill -9 $CURRENT_PID
sleep 1
echo "TURN OFF COMPLETE"
fi
echo "> Is Running?"
CURRENT_PID=$(pgrep -f lightcomics)
echo "$CURRENT_P... |
<gh_stars>0
export * from "./lib/linkedin";
export * from "./lib/configure-auth"
|
#!/bin/bash
#SBATCH -J Act_maxtanh_1
#SBATCH --mail-user=eger@ukp.informatik.tu-darmstadt.de
#SBATCH --mail-type=FAIL
#SBATCH -e /work/scratch/se55gyhe/log/output.err.%j
#SBATCH -o /work/scratch/se55gyhe/log/output.out.%j
#SBATCH -n 1 # Number of cores
#SBATCH --mem-per-cpu=6000
#SBATCH -t 23:59:00 # Hours, minutes ... |
#!/bin/bash
set -x
set -o errexit
set -o nounset
set -o pipefail
PROJECT_ROOT=$(cd $(dirname "$0")/.. ; pwd)
PATH="${PROJECT_ROOT}/dist:${PATH}"
VERSION="v1alpha1"
[ -e ./v2 ] || ln -s . v2
./dist/openapi-gen \
--go-header-file ${PROJECT_ROOT}/hack/custom-boilerplate.go.txt \
--input-dirs github.com/argoproj/arg... |
<reponame>matto1990/Kirin<filename>platforms/android/kirin-for-android/kirin-lib/src/main/java/com/futureplatforms/kirin/helpers/KirinScreenHelper.java<gh_stars>0
package com.futureplatforms.kirin.helpers;
import android.app.Activity;
import android.content.Intent;
import com.futureplatforms.kirin.extensions.IKirinEx... |
<filename>silk-react-components/src/HierarchicalMapping/Mixins/Navigation.js
// import _ from 'lodash';
import hierarchicalMappingChannel from '../store';
const Navigation = {
// jumps to selected rule as new center of view
handleNavigate(id, parent, event) {
hierarchicalMappingChannel
.su... |
<gh_stars>1-10
/*
* Copyright (c) 2011, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this li... |
#!/bin/bash
#= Drop_File_Rename_Proper.sh
#
# Create Automator script Drop_File_Showpath.app using "Run Shell Script" and copy/paste there contents of this .sh file
function do_print {
echo "# Drop_File_Rename_Proper TYPE=$1 FILENAME='$2' "
}
for FILENAME in "$@" ; do
#
if [[ -d "${FILENAME}" ]]; then
do_print... |
'use strict';
module.exports = {
administrative_area_level_1: 'administrative_area_level_1',
administrative_area_level_2: 'administrative_area_level_2',
administrative_area_level_3: 'administrative_area_level_3',
administrative_area_level_4: 'administrative_area_level_4',
administrative_area_level_5: 'admini... |
# Copyright (c) 2019, NVIDIA CORPORATION. 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
#
# Unless required by appli... |
package libs.trustconnector.scdp.util.tlv.simpletlv;
import libs.trustconnector.scdp.util.tlv.*;
import libs.trustconnector.scdp.util.tlv.Length;
import libs.trustconnector.scdp.util.tlv.Tag;
public class BufferSize extends SimpleTLV
{
public BufferSize(final Tag tag, final Length len, final byte[] v, final int ... |
<reponame>machnicki/healthunlocked<gh_stars>0
import React from 'react';
import { Route } from 'react-router';
import App from './App';
import RepoPage from './pages/RepoPage';
import UserPage from './pages/UserPage';
export default (
<Route name='explore' path='/' handler={App}>
<Route name='repo' path='/:login... |
/*
* Copyright [2020-2030] [https://www.stylefeng.cn]
*
* 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... |
#!/bin/bash
# This script is meant to be called by the "install" step defined in
# .travis.yml. See http://docs.travis-ci.com/ for more details.
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.
# License: 3-clause BSD
# Travis clo... |
<filename>src/state/QueueSummaryState.js
import * as Constants from '../utils/Constants';
const ACTION_SET_FILTERS = "SET_FILTERS"; // Not used
const ACTION_SET_QUEUES = "SET_QUEUES";
const ACTION_SET_QUEUE_TASKS = "SET_QUEUE_TASKS";
const ACTION_HANDLE_TASK_UPDATED = "HANDLE_TASK_UPDATED";
const ACTION_HANDLE_TASK_RE... |
#!/usr/bin/env bash
set -e
set -x
echo "BRANCH_NAME=$BRANCH_NAME"
echo "the downward API labels are:"
cat /etc/podinfo/labels
# fix broken `BUILD_NUMBER` env var
export BUILD_NUMBER="$BUILD_ID"
JX_HOME="/tmp/jxhome"
KUBECONFIG="/tmp/jxhome/config"
# lets avoid the git/credentials causing confusion during the test
... |
#!/bin/bash -e
port="$1"
file="$2"
if [[ ! -w "$port" ]]; then
echo "Waiting for serial port to appear..."
while [[ ! -w "$port" ]]; do
true
done
else
echo "Resetting controller..."
rosrun drc_interface controller_tool --device=$port --reset
fi
avrdude -c avr109 -p atmega2560 -b 115200 -P "$port" -U flash:w:"... |
<gh_stars>1-10
// Copyright © 2019 The Things Network Foundation, The Things Industries B.V.
//
// 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/LICEN... |
#!/bin/bash
USERNAME=$1
PASSWORD=$2
htpasswd -b -c /etc/nginx/conf.d/password.htpasswd ${USERNAME} ${PASSWORD} |
<reponame>youaxa/ara-poc-open
package com.decathlon.ara.defect.github;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import... |
"use strict";
const _ = require('lodash');
const getNormalizedAttributeValue = require('../../../dom/attributes').getNormalizedAttributeValue;
const Assertions = require('../../../assertions');
const Types = require('../../../types');
class NgRepeatProcessor {
matches(domElement) {
return !_.isEmpty(getNormali... |
<gh_stars>1-10
# coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# 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
#
# U... |
<filename>spec/views/purchases/new.html.erb_spec.rb
require 'rails_helper'
RSpec.describe "purchases/new", type: :view do
before(:each) do
assign(:purchase, Purchase.new)
end
it "renders new purchase form" do
render
assert_select "form[action=?][method=?]", purchases_path, "post" do
assert_se... |
my_list = [1, 2, 3, 4, 5]
if len(my_list) > 0:
element = my_list[0]
else:
element = None |
<reponame>villelaitila/KantaCDA-API
<!--
Copyright 2020 Kansaneläkelaitos
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 req... |
#!/bin/bash
set -e
MAILCATCHER=$1
DIRPATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../../.. && pwd)"
chmod +x ${DIRPATH}/deploy/ci/travis/run-e2e-tests.sh
# We will install ffmpeg so we can capture a video of the display as the tests run
sudo add-apt-repository -y ppa:mc3man/trusty-media
sudo apt-get -qq update
... |
<reponame>jaden-young/NWR
import { BaseAbility, BaseModifier, BaseModifierMotionHorizontal, registerAbility, registerModifier } from "../../../lib/dota_ts_adapter"
interface kv {
x: number;
y: number;
z: number;
}
@registerAbility()
export class haku_demonic_speed extends BaseAbility
{
lightning_blade_fx... |
#!/bin/bash
# Abort if any command returns != 0
set -e
# NEORV32 project home folder
homedir="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
homedir=$homedir/..
# The directories of the SW source files
srcdir_examples=$homedir/sw/example
srcdir_bootloader=$homedir/sw/bootloader
test_app_dir=$homedir/sw/example/... |
# import necessary packages
import difflib
# define the input
Dict = ['Apple', 'Orange', 'Banana', 'Grape']
word = 'Appel'
# find the closest strings in the dictionary
best_matches = difflib.get_close_matches(word, Dict)
# output
print('Closest matches:', best_matches) |
export class CredentialsModel {
username: string = "";
password: string = "";
constructor(username: string, password: string) {
this.username = username;
this.password = password;
}
toString(): string {
return "{\"username\":\"" + this.username +
"\",\n\"password\":\"" + this.password +... |
export type OtherState = {
depthTestAgainstTerrain: boolean
}
export const defaultState = (): OtherState => {
return {
depthTestAgainstTerrain: true,
}
}
export const state: OtherState = defaultState()
|
#!/bin/sh
#
# This program launch a web browser on the html page
# describing a git command.
#
# Copyright (c) 2007 Christian Couder
# Copyright (c) 2006 Theodore Y. Ts'o
#
# This file is heavily stolen from git-mergetool.sh, by
# Theodore Y. Ts'o (thanks) that is:
#
# Copyright (c) 2006 Theodore Y. Ts'o
#
# This file ... |
<reponame>learnforpractice/micropython-cpp
s = {1, 2, 3, 4}
l = list(s)
l.sort()
print(l)
|
#!/bin/bash
# Copyright 2015-2016 Sarah Flora Juan
# Copyright 2016 Johns Hopkins University (Author: Yenda Trmal)
# Copyright 2017 Radboud University (Author: Emre Yilmaz)
# Apache 2.0
corpus=$1
set -e -o pipefail
if [ -z "$corpus" ] ; then
echo >&2 "The script $0 expects one parameter -- the location of the ... |
<reponame>edgggeTRON/cardano-explorer-app
import React from 'react';
import { ensureContextExists } from '../../lib/react/hooks';
import { ITransactionsFeature } from './index';
/**
* React context used for this feature
*/
export const transactionsContext = React.createContext<ITransactionsFeature | null>(
null
);... |
#!/bin/bash
#
# Copyright 2012 Marco Vermeulen, Jacky Chan
#
# 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 ... |
var Waiter = function(){
var dfd = [],
doneArr = [],
failArr = [],
that = this,
debug = true,
_exec = function(arr){
var i = 0, c;
arr = arr || [];
while(c = arr[i++]){
try{
c && c();
}cat... |
package com.utn;
public class Arma {
private int danio;
public Arma(int danio) {
this.danio = danio;
}
public int getDanio() {
return danio;
}
@Override
public String toString() {
return "danio=" + danio;
}
}
|
<filename>test/Regex.java
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Regex {
private static void expect(boolean v) {
if (! v) throw new RuntimeException();
}
private static Matcher getMatcher(String regex, String string) {
return Pattern.compile(regex).matcher(string);
... |
<filename>INFO/Books Codes/Oracle Wait Interface A Practical Guide to Performance Diagnostics & Tuning/Chapter5_page130_1.sql
select event, time_waited, average_wait
from v$system_event
where event in ('db file parallel write','free buffer waits',
'write complete waits');
|
/*
*
*/
package net.community.chest.win32.core.serial;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StreamCorruptedException;
import net.community.chest.CoVariantReturn;
import net.community.chest.io.encode.ElementEncoder;
import net.community.chest.lang.Public... |
#!/bin/sh
sed \
-e '/^[OLQ[A-Z]*(/!d' \
-e 's,^[OLQ[A-Z]*(,,' \
-e 's/,.*//' \
../src/options.hpp | \
while read option
do
grep -q opts.$option ../src/*.hpp ../src/*.cpp && continue
echo "option '$option' not found"
done
|
<filename>quizzer-server/routes/rooms.js
const mongoose = require("mongoose");
const express = require("express");
const router = express.Router();
const rooms = require("../models/rooms.js");
const { Router } = require("express");
const Rooms = mongoose.model("Rooms");
// middleware that is specific to this router
r... |
package mainclient.unstablePkg.methodRemoved;
import main.unstablePkg.methodRemoved.MethodRemoved;
public class MethodRemovedExt extends MethodRemoved {
public int methodRemovedClientExt() {
return methodRemoved();
}
public int methodRemovedClientSuper() {
return super.methodRemoved();
}
}
|
<gh_stars>100-1000
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* 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-... |
<gh_stars>0
package com.acgist.snail.context.exception;
/**
* <p>下载异常</p>
* <p>任务创建和下载过程中出现的异常</p>
*
* @author acgist
*/
public class DownloadException extends Exception {
private static final long serialVersionUID = 1L;
public DownloadException() {
super("下载异常");
}
/**
* @param message 错误信息
*/
pub... |
from decimal import Decimal
from typing import Any, Optional
import json
def _dump_dynamodb_table(table: Any) -> Optional[str]:
if not table:
return None
items = []
for item in table.scan()['Items']:
formatted_item = {}
for key, value in item.items():
if isinstance(valu... |
#!/bin/sh
set -eu
cd "$(dirname "$0")/../.."
main() {
if ! command -v jpackage >/dev/null 2>&1; then
>&2 echo "jpackage: command not found"
exit 1
fi
artifact_file="${project.build.directory}/${project.build.finalName}.jar"
if [ ! -f "$artifact_file" ]; then
>&2 echo "$artifact_file: no such fi... |
#!/bin/bash
# daxul.sh
# Program to upgrade the APEX schema in the database. This is useful when
# access to the patchsets is not available (when you're not a paying Oracle
# customer).
#
# Relies on the apex installation files which comes with a java program to export
# the required workspace/app export files; Also, a... |
install_node_modules() {
local build_dir=${1:-}
if [ -e $build_dir/package.json ]; then
cd $build_dir
echo "Pruning any extraneous modules"
npm prune --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
if [ -e $build_dir/npm-shrinkwrap.json ]; then
echo "Installing node modules (package.json + ... |
var safeEval = require('notevil')
var input = "" +
"function fn() {};" +
"var constructorProperty = Object.getOwnPropertyDescriptors(fn.__proto__).constructor;" +
"var properties = Object.values(constructorProperty);" +
"properties.pop();" +
"properties.pop();" +
"properties.pop();" +
"var Function... |
python3 exps/node2vec_exp.py --config-file './configs/yamls/node2vec_baseline.yaml' |
#!/bin/bash
# Script that builds androidx SNAPSHOT and runs the androidx integration
# tests from the Studio branch.
set -e
readonly SCRIPT_PATH="$(dirname $(realpath "$0"))"
readonly BASE_PATH="$(realpath "$SCRIPT_PATH/../../..")"
readonly PREBUILTS_DIR="$BASE_PATH/prebuilts"
readonly OUT_DIR="$BASE_PATH/out"
reado... |
<?php
class HttpResponse {
public function isOk() {
// Assuming $this->statusCode contains the HTTP status code
return $this->statusCode === 200;
}
public function formatTaskData($data) {
$formattedStatus = $data['status'] == 1 ? ' (Active)' : '';
return "Task: {$data['title']}, Status: {$data['... |
/*=========================================================================
Program: ParaView
Module: PrismScaleViewDialog.h
=========================================================================*/
#ifndef __PrismScaleViewDialog_h
#define __PrismScaleViewDialog_h
#include <QDialog>
#include <QString>
class P... |
<filename>pycval/__main__.py
import hashlib
import logging
import sys
from .pycval import checksum, validate
base_logger = logging.getLogger(__name__)
stream_handler = logging.StreamHandler()
stream_formatter = logging.Formatter(
'%(asctime)s - %(levelname)s: %(name)s - %(message)s'
)
stream_handler.setFormatte... |
import numpy as np
from deepthought.experiments.encoding.experiment_templates.base import NestedCVExperimentTemplate
class SVCBaseline(NestedCVExperimentTemplate):
def pretrain_encoder(self, *args, **kwargs):
def dummy_encoder_fn(indices):
if type(indices) == np.ndarray:
ind... |
<gh_stars>0
import React, {Component} from "react"
import logoFuji from '../../include/img/fujioka-logo.png';
class NavBar extends Component{
render(){
return (
<nav className="navbar navbar-expand-lg navbar-light bg-light">
<a className="navbar-brand"
hr... |
#!/bin/bash
hidraw=$(P4wnP1_cli usb get device raw)
if [ "$hidraw" = "" ]; then
echo "[!] No raw HID device found, aborting";
exit
fi
if [ ! -f /usr/local/P4wnP1/legacy/Stage2.ps1 ]; then
echo "[!] Stage2.ps1 not found, Use StageGenerator.py to generate it!"
exit
fi
echo "[*] Kill old hidsta... |
##############################################################################
# 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... |
#!/bin/sh
#
# Command line helper for https://github.com/rycus86/githooks
#
# This tool provides a convenience utility to manage
# Githooks configuration, hook files and other
# related functionality.
# This script should be an alias for `git hooks`, done by
# git config --global alias.hooks "!${SCRIPT_DIR}/githo... |
import {Component, OnInit, ViewChild} from '@angular/core';
import {FormGroup, FormControl} from '@angular/forms';
import {ComponentViewer, ComponentApi} from '../../shared/component-viewer';
import {MdcChipSetChange, MdcChipSelectionEvent, MdcChipRemovalEvent, MdcChipInteractionEvent} from '@angular-mdc/web/chips';
... |
XBPS_TARGET_CFLAGS="-march=armv8-a"
XBPS_TARGET_CXXFLAGS="$XBPS_TARGET_CFLAGS"
XBPS_TARGET_FFLAGS=""
XBPS_TRIPLET="aarch64-unknown-linux-musl"
|
#! /bin/bash
read -p "Enter instance name: " INAME
if [ -z "$INAME" ]; then
printf '%s\n' "An instance name is needed"
exit 1
fi
IID=`aws ec2 describe-instances --filters 'Name=tag:Name,Values='"$INAME"'' \
--output text --query 'Reservations[*].Instances[*].InstanceId'`
echo Stopping instance named $... |
<filename>src/pages/.umi/router.js
import React from 'react';
import { Router as DefaultRouter, Route, Switch } from 'react-router-dom';
import dynamic from 'umi/dynamic';
import renderRoutes from 'umi/lib/renderRoutes';
import history from '@tmp/history';
import RendererWrapper0 from '/Users/mac/Desktop/WebUI/briup/da... |
def HOURGLASS(x, shorten_factors):
# Sort the shorten_factors list in descending order
shorten_factors.sort(reverse=True)
# Apply the shorten_factors to the input value x
for factor in shorten_factors:
if x % factor == 0:
x = x // factor
return x
# Example usage
x = 24... |
<reponame>weltam/idylfin
/**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.maths.lowlevelapi.linearalgebra.blas.blas2kernelimplementations;
import java.util.Arrays;
import com.opengamma.maths.lowlevelapi.data... |
/**
* <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... |
<reponame>Antoveravip/Software-University
/*
Info: JavaScript for JavaScript Basics Lesson 3, JavaScript Loops, Arrays, Strings, Task 2, Find Min and Max Number
Author: Removed for reasons of anonymity
Successfully checked as valid in JSLint Validator at: http://www.jslint.com/ and JSHint Validator at: http://www.jshin... |
#!/bin/bash
dieharder -d 101 -g 31 -S 1571643931
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Using standard optimizer, for comparing."""
import numpy as np
import tensorflow as tf
import time
from raw_implement import make_loss_and_gradients, n_dims, n_iters
tf.reset_default_graph()
def main(make_loss_and_gradients=make_loss_and_gradients,
n_dims... |
VERSION='master' #Repository version
REPO='FriendsOfFlarum/gamification' #Repository name
LOCALE='resources/locale' #Locale folder path
YAML1='en.yml' #Original yaml file
YAML2='fof-gamification.yml' #Translated yaml file
TEMP_DIR=`mktemp -d`
WORK_DIR=`pwd`
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
if ! [ -x... |
<filename>intro/part02-20_next_leap_year/src/next_leap_year.py<gh_stars>0
# Write your solution here
year = int(input("YEAR: "))
t = 0
while True:
t += 1
if ((year + t)%4 == 0):
if (year + t)%100 != 0:
print(f"The next leap year after {year} is {year+t}")
break
else:
... |
// @noflow
module.exports = {
presets: [
[require.resolve("@babel/preset-env"), { bugfixes: true }],
[require.resolve("@babel/preset-react"), { runtime: "classic" }],
require.resolve("@babel/preset-flow"),
],
plugins: [
require.resolve("babel-plugin-styled-components"),
require.resolve("@babe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.