text stringlengths 1 1.05M |
|---|
package com.fantasy.smallweather.util;
import android.app.Activity;
import android.os.Bundle;
/**
* 自定义活动类,重载了onCreate()和onDestroy()
* @author Fantasy
* @version 1.0, 2016/8/31
*/
public class BaseActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
... |
<reponame>daffupman/rabbitmq-guide
package io.daff.rabbit._03_advanced_feature.limitstream;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.QueueingConsumer;
import com.rabbitmq.client.QueueingConsumer.Delivery;
import ... |
#!/bin/sh
#Regenerate the CRL to avoid the expired CRL error
openssl ca -config CA/estExampleCA.cnf -gencrl -out CA/estCA/crl.pem
cat CA/trustedcerts.crt CA/estCA/crl.pem > US901/trustedcertsandcrl.crt
#Setup the trust anchor
export EST_TRUSTED_CERTS=US901/trustedcertsandcrl.crt
export EST_CACERTS_RESP=CA/estCA/cacer... |
#!/bin/bash
dconf load /org/pantheon/terminal/settings/ <<COLORS
[/]
name='GitHub Dark'
cursor-color='#c9d1d9'
foreground='#8b949e'
background='rgba(16,18,22,.95)'
palette='#000000:#f78166:#56d364:#e3b341:#6ca4f8:#db61a2:#2b7489:#ffffff:#4d4d4d:#f78166:#56d364:#e3b341:#6ca4f8:#db61a2:#2b7489:#ffffff'
COLORS
|
func drawText(_ text: String, in rect: CGRect) {
let textInsets = UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5) // Example insets, you can adjust these values as needed
let textRect = rect.inset(by: textInsets)
let textAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(... |
package keeper_test
import (
"fmt"
"time"
"github.com/tendermint/farming/x/farming"
)
func (suite *KeeperTestSuite) TestLastEpochTime() {
_, found := suite.keeper.GetLastEpochTime(suite.ctx)
suite.Require().False(found)
t := mustParseRFC3339("2021-07-23T05:01:02Z")
suite.keeper.SetLastEpochTime(suite.ctx, t)... |
<reponame>pedroalbanese/gostpass
// Copyright 2016 The Sandpass 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 r... |
import React, { useState,useMemo } from "react";
import { makeStyles } from "@material-ui/core/styles";
import { IoMdAddCircleOutline } from "react-icons/io";
import {
Grid,
Button,
Paper,
TextField,
IconButton,
Table,
TableHead,
TableRow,
TableCell,
TableBody
} from "@material-ui/core";
import { Ci... |
#!/bin/bash
# Copyright 2020 The gVisor 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 applicable law or a... |
#!/bin/bash
scrot -s '%Y-%m-%d_$wx$h_scrot.png' -e 'curl --location --request POST https://screenshots.local.setkeh.com/image --form file=@$f && mv $f /home/setkeh/storage/screenshots/' | jq -r '.url' | xclip -selection c |
const { logger } = require('../helpers');
const { UserModel, AdvertModel } = require('../models');
/**
* Create and save User object
*
* @async
* @param {Number} _id - telegram ID
* @param {Object} location - object with properties latitude and longitude
* @param {Number} searchRadius - in metres
*/
const creat... |
/*
* Copyright (C) 2020 Open Source Robotics 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 at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... |
<reponame>permanentCH5/GeoInfoNet<filename>train/train_gin.py<gh_stars>10-100
import sys
sys.path.append('../dataset')
sys.path.append('../datatransfer')
sys.path.append('../network')
sys.path.append('../test')
sys.path.append('../util')
import dataset_si as LevirCS
import torch
import torch.nn as nn
import torch.opti... |
#!/usr/bin/env bash
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color)... |
#!/bin/bash
DIR=${PWD}
USER_ID=$(stat -c "%u" ${PWD})
echo "Using uid=${USER_ID} from owner of dir ${DIR}"
# verify if user exists
id "${USER_NAME?}"
if [[ $? -ne 0 ]]; then
echo "Creating user ${USER_NAME} with UID ${USER_ID}"
# create a new user, without home directory and without a password
adduser -u ${USER_... |
<reponame>wmn7/Traffic-Classification
'''
@Author: <NAME>
@Date: 2021-01-05 11:08:45
@Description: 将原始的数据划分训练集与测试集, 返回训练集和测试集的路径地址
@LastEditTime: 2021-01-05 18:02:58
'''
import os
from sklearn.model_selection import train_test_split
from TrafficFlowClassification.TrafficLog.setLog import logger
def get_file_path(fold... |
import './add-stuff-page.html';
import './add-stuff-page.js';
import './edit-stuff-page.html';
import './edit-stuff-page.js';
import './home-page.html';
import './list-stuff-page.html';
import './list-stuff-page.js';
import './sign-up-page.html';
import './sign-up-page.js';
import './login-page.html';
import './lo... |
FLUME_CLASSPATH="/opt/hadoop/libs/*"
|
#ifdef __cplusplus
extern "C" {
#endif
#include "qcloud.h"
__QCLOUD_STATIC__ mqtt_event_type_t mqtt_glue_event_type_get(qcloud_mqtt_ack_type_t ack_type, int is_nack, int is_timer_expired)
{
mqtt_event_type_t event_type;
if (is_nack) {
switch (ack_type) {
case QCLOUD_MQTT_ACK_TYPE_PUBACK:
... |
<gh_stars>10-100
package io.opensphere.mantle.transformer.util;
import java.util.List;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;
import gnu.trove.map.hash.TLongObjectHashMap;
import io.opensphere.core.geometry.AbstractRenderableGeometry;
import io.opensphere.core.geometry.Geometry... |
<filename>src/site/components/QuestItemPrecondition.tsx
import React from 'react';
import { ItemWithCount } from '../../../typings/custom';
import { ItemData } from '../../items/itemData';
import { Input } from './Input';
import {
CloseButton,
ItemIdContainer,
ItemsContainer,
LargeDropdown,
ScriptBlockContainer,
... |
use base64;
pub enum Encoding {
ASCII,
Base64,
}
impl Encoding {
fn encode(&self, input: &str) -> String {
match self {
Encoding::ASCII => {
input.chars().map(|c| c as u8).collect()
}
Encoding::Base64 => {
base64::encode(input)
... |
import pyspark
from pyspark.ml import Pipeline
from pyspark.ml.feature import StringIndexer, CountVectorizer
from pyspark.ml.classification import LogisticRegression
# Set up the pipeline stages
indexer = StringIndexer(inputCol="document", outputCol="document_index")
vectorizer = CountVectorizer(inputCol="document_ind... |
import matplotlib.pyplot as plt
# Read data from file
data = []
with open('cluster_results.txt', 'r') as file:
for line in file:
x, y, cluster = map(float, line.split())
data.append((x, y, cluster))
# Separate data by cluster
clusters = {}
for x, y, cluster in data:
if cluster not in clusters:... |
//给你一份旅游线路图,该线路图中的旅行线路用数组 paths 表示,其中 paths[i] = [cityAi, cityBi] 表示该线路将会从
//cityAi 直接前往 cityBi 。请你找出这次旅行的终点站,即没有任何可以通往其他城市的线路的城市。
//
// 题目数据保证线路图会形成一条不存在循环的线路,因此恰有一个旅行终点站。
//
//
//
// 示例 1:
//
//
//输入:paths = [["London","New York"],["New York","Lima"],["Lima","Sao Paulo"]]
//输出:"Sao Paulo"
//解释:从 "London" 出发,最后抵达终点站 "... |
<reponame>ops-class/test161<filename>version.go
package test161
import (
"fmt"
)
type ProgramVersion struct {
Major uint `yaml:"major"`
Minor uint `yaml:"minor"`
Revision uint `yaml:"revision"`
}
var Version = ProgramVersion{
Major: 1,
Minor: 3,
Revision: 2,
}
func (v ProgramVersion) String() str... |
// Copyright 2021 99cloud
//
// 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 writ... |
void SetupCharacterMovementAndCamera(USpringArmComponent* CameraBoom, USceneComponent* RootComponent, UCharacterMovementComponent* CharacterMovement) {
// Set character movement properties
CharacterMovement->bOrientRotationToMovement = true; // Rotate character to moving direction
CharacterMovement->Rotatio... |
treevalue -v |
package com.youngki.memory_project;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.vie... |
package crawler
import (
"encoding/json"
"log"
"net/http"
"github.com/gocolly/colly/v2"
)
// Ping to test server status
func Ping(w http.ResponseWriter, r *http.Request) {
log.Println("Pong")
w.Write([]byte("Pong"))
}
// GetUrls to get all urls in a page
func GetUrls(w http.ResponseWriter, r *http.Request) {
... |
<gh_stars>0
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Album } from '../model';
@Component({
selector: 'app-song-list',
templateUrl: './song-list.component.html',
styleUrls: ['./song-list.component.css']
})
export class SongListComponent implemen... |
#!/bin/bash
#
# This script starts the RayMaze
####
# VARIABLES
####
STARTER_CLASS="de.tarent.mica.maze.Starter"
SCRIPT_NAME=`basename $0`
UNIX_STYLE_HOME=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)/`basename "${BASH_SOURCE[0]}"`
UNIX_STYLE_HOME=`echo $UNIX_STYLE_HOME | sed "s/$SCRIPT_NAME//g"`
####
# MAIN
####
CP=... |
import numpy as np
class MarkerMeasurement:
# Measurements are of landmarks in 2D and have a position as well as tag id.
def __init__(self, position, tag, initial_covariance=(0.2 * np.eye(2))):
self.position = position
self.tag = tag
self.covariance = initial_covariance
cl... |
#! @RCD_SCRIPTS_SHELL@
#
# $NetBSD: pgbouncer.sh,v 1.3 2016/03/15 11:29:35 fhajny Exp $
#
# PROVIDE: pgbouncer
# REQUIRE: DAEMON
#
if [ -r /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="pgbouncer"
rcvar=${name}
command="@PREFIX@/bin/${name}"
pgbouncer_conf="@PKG_SYSCONFDIR@/${name}.ini"
required_files="${pgbouncer_conf... |
def sum_of_even_numbers(numbers):
# Initialize the sum of even numbers to 0
even_sum = 0
# Iterate through the list of numbers
for num in numbers:
# Check if the number is even
if num % 2 == 0:
# Add the even number to the sum
even_sum += num
# Return the sum ... |
/*
Jameleon - An automation testing tool..
Copyright (C) 2006 <NAME> (<EMAIL>)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or... |
// Create a 2D array to store the marks
int[][] marks = {{85,90,95},{75,80,90},{95,100,105}};
// Create a variable to store total for each student
int totals[] = new int[marks.length];
// Iterate through the loop and calculate total for each student
for(int i=0; i<marks.length; i++){
int total = 0;
for(int j=0; j... |
#Powerline from @powerline/powerline
local _POWERLINE_SOURCED="$0:A"
_powerline_columns_fallback() {
if which stty &>/dev/null ; then
local cols="$(stty size 2>/dev/null)"
if ! test -z "$cols" ; then
echo "${cols#* }"
return 0
fi
fi
echo 0
return 0
}
_powerline_append_precmd_function() {
if test -z "... |
<filename>node_modules/react-icons-kit/fa/videoCamera.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.videoCamera = void 0;
var videoCamera = {
"viewBox": "0 0 1792 1792",
"children": [{
"name": "path",
"attribs": {
"d": "M1792 352v1088q0 42-39 59-13 5-25 5-2... |
<filename>packages/axyz-react/src/logos/Walletconnect.tsx
import React from 'react';
interface Props {
width?: number | string;
height?: number | string;
}
const Walletconnect: React.FC<Props> = ({ width = 40, height = 40 }) => (
<svg width={width} height={height} viewBox="0 0 512 512" xmlns="http://www.w3.org/... |
#!/usr/bin/env bash
# ENVIRONMENT SETUP
initEnv() {
echo -e "\e[36m \e[1m [01] Installing Miniconda \e[0m"
apt-get install wget
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p ~/miniconda
rm ~/miniconda.sh
export PAT... |
TERMUX_PKG_HOMEPAGE=https://tukaani.org/xz/
TERMUX_PKG_DESCRIPTION="XZ-format compression library"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=5.2.4
TERMUX_PKG_REVISION=4
TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/xz-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=9717ae363760dedf573dad241420c5fea86256b65bc21d... |
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR
from sklearn.model_selection import train_test_split
# Load the data
df = pd.read_csv("stock_data.csv")
# Split the data
X = df.iloc[:, :-1].values
y = df.iloc[:, -1].values
X_train, X_test,... |
<reponame>valenpo/postfix-jilter
/*
* Copyright (c) 2001-2004 Sendmail, Inc. All Rights Reserved
*/
package com.sendmail.jilter;
import com.sendmail.jilter.internal.JilterConstants;
import java.io.IOException;
import java.nio.channels.WritableByteChannel;
/**
* Status class for methods in {@link JilterHandler}.... |
//
// Created by eduardo on 20/03/2021.
//
#include "ohlc_prices.h"
#include "portfolio/common/algorithm.h"
#include <iomanip>
#include <string>
#include <vector>
namespace portfolio {
double ohlc_prices::open() const { return open_price_; }
double ohlc_prices::high() const { return high_price_; }
double o... |
import java.util.*;
class User {
private int id;
private String name;
private int age;
public User(int id, String name, int age) {
this.id = id;
this.name = name;
this.age = age;
}
public int getId() {
return id;
}
public void setId(int id) {
th... |
#!/bin/sh
echo "Starting Elasticsearch ${ES_VERSION}"
BASE=/usr/share/elasticsearch
# Allow for memlock if enabled
# if [ "${MEMORY_LOCK}" == "true" ]; then
# if [[ $(whoami) == "root" ]]; then
# # ulimit -l unlimited
# echo "Adding Memory Lock"
# mkdir /etc/systemd/system/elasticsearch.s... |
#!/usr/bin/env bash
set -e
chown -R www-data:www-data storage bootstrap/cache
chmod -R 755 storage bootstrap/cache
composer install --no-scripts --no-autoloader --ansi --no-interaction -d /var/www/back
composer dump-autoload -d /var/www/back
if [ ! -f ".env" ]
then
cp .env.example .env
fi
cd /var/www/back && php... |
<gh_stars>0
import { useFormikContext } from 'formik';
import React, { useCallback } from 'react';
import Button, { ButtonProps } from 'shared/view/components/Button';
const SubmitButton: React.FC<ButtonProps> = ({ onPress, ...props }) => {
const formik = useFormikContext();
const handlePress = useCallback(() => ... |
<filename>src/reducers/application.js
import { buildActions } from 'utils';
export const types = buildActions('application', [
'INIT_APP',
'LOGIN_USER',
'REQUEST_TOKEN',
'REQUEST_TOKEN_SUCCESS',
'REQUEST_TOKEN_FAILURE',
'REQUEST_CURRENT_USER',
'REQUEST_CURRENT_USER_SUCCESS',
'REQUEST_CURRENT_USER_FAILU... |
def longest_increasing_sequence(arr):
n = len(arr)
dp = [1] * n
max_lis = -float('inf')
for i in range(1, n):
for j in range(i):
if arr[i] > arr[j]:
dp[i] = max(dp[i], dp[j] + 1)
max_lis = max(max_lis, dp[i])
return max_lis
print(longest_increasing_sequence(array)) # Output... |
<filename>src/viewBuilder.tsx
import React from 'react';
import { IOutlet } from './@types/outlet.type';
import { ViewBuilder } from './component.service';
import { Outlet } from './components/outlet.component';
export const viewBuilder: ViewBuilder = (view, params) => {
let outlet: JSX.Element;
if (typeof view !=... |
<reponame>danielavellar15/ckeditor5
/**
* @license Copyright (c) 2003-2021, CKSource - <NAME>. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/**
* @module ui/bindings/injectcsstransitiondisabler
*/
/**
* A decorator that brings the possibility to temp... |
import flask
from flask import Flask, request, jsonify
import json
app = Flask(name)
@app.route('/countries', methods=['GET'])
def get_countries():
with open('data.json', 'r') as f:
countries = json.load(f)
return jsonify(countries)
if name == 'main':
app.run() |
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob
# Check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
#export GREP_OPTIONS='--color=auto'
# Prevent less from clearing the screen while still showing colors.
export LES... |
import { createSelector } from "reselect";
export const getUsers = state => state.users.users;
export const getCurrentUserKey = state => state.users.currentUserKey;
export const getHasUsers = createSelector(getUsers, users => users.length > 0);
export const getCurrentUser = createSelector(
[getUsers, getCurrentUser... |
#!/usr/bin/env bash
set -e
help() {
cat <<EOF
Manage GitHub Projects(beta) seamlessly from the command line.
USAGE
gh project-manager add issues <command> <subcommand> [flags]
FLAGS
--help, -h Show help for command
--path Set json file path
--project-num Set project number
--project... |
def drop_cap(string: str) -> str:
words = string.split()
modified_words = [word.capitalize() if len(word) > 2 else word for word in words]
modified_words[0] = modified_words[0].capitalize()
return ' '.join(modified_words) |
<reponame>HargurBedi/LSDP_Lab
import java.io.*;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.input.*;
import org.apache.hadoop.mapreduce.lib.output.*;
public class student{
public static... |
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
const state = {
count: 0
};
const mutations = {
INCREMENT(state) {
state.count++
}
};
export default new Vuex.Store({
state,
mutations
});
|
<reponame>jumbo4213/nest-serve-template
export * from './device.entity';
export * from './user.entity';
export * from './session.entity';
export * from './wx-account.entity';
|
import config from '@config/index'
import Ipfs from 'ipfs-mini' // https://github.com/silentcicero/ipfs-mini
const IPFS = new Ipfs(config.ipfsGateway)
IPFS.getLink = function (CID) {
return IPFS.provider.protocol + '://' + IPFS.provider.host + '/ipfs/' + CID
}
IPFS.uploadImageAsSvg = async function (dataURI:string... |
<filename>app/library/actors/RefreshActor.scala
package library.actors
import akka.actor.{Actor, Props}
import library.Engine
import library.utils.dateTimeNow
import repositories.StateRepository
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.{Failure, Success}
object RefreshActor {
def... |
#!/bin/bash
if [ -z "$DIR" ]
then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
fi
mkdir -p $WORKDIR
$SUDO apt update
$SUDO bash -c "apt install --allow-unauthenticated -y wget gnupg2 software-properties-common"
# Release in which has been natively introduced support for golang-go (Ubuntu >= 20.04)
os_l... |
<reponame>eengineergz/Lambda
"use strict";
exports.__esModule = true;
/**
* ES6 Number.isNaN
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
*/
function isNaN(val) {
return typeof val === 'number' && val != val;
}
exports["default"] = isNaN;
|
public class SpiralTraverse {
public static List<Integer> traverse(int[][] arr) {
List<Integer> list = new ArrayList<>();
// Set up the four boundaries
int top = 0;
int bottom = arr.length - 1;
int left = 0;
int right = arr[0].length - 1;
// Traverse until all of the cells have been visited
while (top <= b... |
#!/bin/bash -e
#
# Copyright 2018-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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
#!/bin/bash
sudo rm -f /usr/local/bin/apktool
sudo rm -rf /usr/local/apktool
sudo pkgutil --forget {replace}
|
<reponame>mwkrentel/libmonitor<filename>src/mpi_comm_c.c<gh_stars>10-100
/*
* Override MPI_Comm_rank in C/C++.
*
* Copyright (c) 2007-2021, Rice University.
* See the file LICENSE for details.
*
* $Id$
*/
#include "config.h"
#include "common.h"
#include "monitor.h"
typedef int mpi_comm_fcn_t(void *, int *)... |
<reponame>xeon225/CyanMD
import '../../src/pageComponent/head/index.js'
var count=0
window.vm=new Vue({
el:'#main',
data:{
tabbarData:_.times(5,index=>{
return {
title:'tab'+index
}
}),
tabPosition:'top',
tabNav:[false,false],
tabCol:'auto'
},
methods:{
add(){
this.tabbarData.push({
tit... |
<filename>hybrid_robot/src/coordinate_transform.cpp
#include <ros/ros.h>
#include <stdio.h>
#include <tf/transform_listener.h>
#include <Eigen/Dense>
int main(int argc, char** argv)
{
ros::init(argc, argv, "my_tf_listener");
ros::NodeHandle node("~");
//ros::NodeHandle node;
tf::TransformListener listener;... |
<gh_stars>0
package com.nortal.spring.cw.core.web.component.list;
/**
* @author <NAME>
*/
public class ListPagination {
private int pageNr;
public int getPageNr() {
return pageNr;
}
public void setPageNr(int pageNr) {
this.pageNr = pageNr;
}
}
|
<gh_stars>10-100
import { Injectable } from '@angular/core';
import { ButtonLayoutDisplay, DialogLayoutDisplay } from './enums';
@Injectable({
providedIn: 'root'
})
export class LayoutHelperService {
getIconClasses(layoutType: DialogLayoutDisplay, iconStyleClass: string): string {
let returnString = '';
if... |
// (C) 2019-2020 GoodData Corporation
import { IWorkspaceDatasetsService, IDataset } from "@gooddata/sdk-backend-spi";
import { TigerAuthenticatedCallGuard } from "../../../types";
export class TigerWorkspaceDataSets implements IWorkspaceDatasetsService {
constructor(private readonly authCall: TigerAuthenticatedCa... |
def _histogram_plot_transf(self):
# Assuming the necessary data and transformations are available
transformed_data = perform_transformations(self.data) # Perform necessary transformations
plot = HistogramPlotTransf(ax=None, path=self.path, data=transformed_data) # Create histogram plot with transformed da... |
#!/bin/bash
#
# Description : Arx Libertatis (AKA Arx Fatalis)
# Author : Jose Cerrejon Gonzalez (ulysess@gmail_dot._com)
# Version : 1.0.2 (17/Aug/20)
# Compatible : Raspberry Pi 4 (fail)
#
# Help : https://wiki.arx-libertatis.org/Downloading_and_Compiling_under_Linux
# For fans : https://www.reddit.com... |
<filename>policy/src/main/java/brooklyn/enricher/DeltaEnricher.java
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* t... |
<gh_stars>0
function check_car_number(str){
var Expression=/^[\u4E00-\u9FA5]?[a-zA-Z]-\w{5}$/;
var objExp=new RegExp(Expression);
return objExp.test(str)
}
function check_car(){
if (form1.username.value == ""){
alert("用户名不能为空!");
form1.username.focus();
return (false);
}
//验证车牌号码
if (form1.car_number.v... |
#!/usr/bin/env bash
# run the command and capture the stdout
out=$(command $@)
echo "$out"
if [[ $(echo "$out" | grep -c reduce) -gt 0 ]]; then
echo ""
echo "Original Rscript failed, try reduce = 0 ..."
echo "Modifying vj_pairing_plot.r ..."
sed -i 's/mat, annotationTrack/mat, reduce = 0, annotationT... |
class Api::V3::Games::Categories::RunsController < Api::V3::ApplicationController
before_action :set_game, only: [:index]
before_action :set_category, only: [:index]
before_action :set_runs, only: [:index]
def index
runs = paginate @runs
render json: Api::V3::RunBlueprint.render(runs, root: :runs)
en... |
<gh_stars>0
import React, { useState, useEffect, useRef } from 'react';
import { Platform, StyleSheet, View, Text, TextInput, TouchableOpacity, SafeAreaView, KeyboardAvoidingView, Image, Alert, ActivityIndicator } from 'react-native';
import { AntDesign, Ionicons } from '@expo/vector-icons';
import Colors from '../cons... |
<filename>sha256x4-neon/sha256_neon.h
#ifndef SHA256_NEON_H
#define SHA256_NEON_H
#include <stddef.h>
#include <stdint.h>
#include <arm_neon.h>
/* The incremental API allows hashing of individual input blocks; these blocks
must be exactly 64 bytes each.
Use the 'finalize' functions for any remaining... |
module.exports = {
up: (queryInterface, Sequelize) =>
queryInterface.bulkInsert(
'Users',
[
{
name: '<NAME>',
email: '<EMAIL>',
createdAt: new Date(),
updatedAt: new Date()
},
{
name: '<NAME>',
email: '<EMAIL>',
... |
package academy.devonline.java.section001_classes;
import java.util.Arrays;
public class DynaArrayTestVer3 {
public static void main(String[] args) {
DynaArrayVer3 dynaArray1 = new DynaArrayVer3();
DynaArrayVer3 dynaArray2 = new DynaArrayVer3();
System.out.print("dynaArray1: ");
S... |
<gh_stars>1-10
from django.db import models
from cms.models.pluginmodel import CMSPlugin
from thewall.models import Unconference
class SponsorPlugin(CMSPlugin):
"""
Allows the unconference to use when displaying sponsorships
"""
unconference = models.ForeignKey(Unconference)
|
<reponame>seangreathouse/inventory-hunter
import scraper.amazon
import scraper.bestbuy
import scraper.bhphotovideo
import scraper.microcenter
import scraper.newegg
from scraper.common import ScraperFactory
def init_scrapers(driver, urls: list):
return [ScraperFactory.create(driver, url) for url in urls]
|
/*
* Bulldozer Framework
* Copyright (C) DesertBit
*/
package tr
import (
"bufio"
"encoding/json"
"fmt"
"github.com/desertbit/bulldozer/log"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync"
"time"
)
const (
Suffix = ".tr"
defaultLocale = "en"
reloadTimerTimeout = 1 * time.Second
)
var... |
fn process_option(input: Option<char>) -> (char, bool) {
match input {
Some(c) => (c, true),
None => ('child', false),
}
} |
package org.hisp.dhis.mapgenerator;
import static org.junit.Assert.assertEquals;
import java.awt.Color;
import org.hisp.dhis.DhisSpringTest;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.indic... |
<gh_stars>1-10
package io.github.hotspacode.neeza.test.source;
import io.github.hotspacode.neeza.base.core.MockSpy;
import io.github.hotspacode.neeza.base.dto.MockTransport;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ObjectSource3 {
public Map createSource2(String a, S... |
#!/bin/sh
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2018 Datadog, Inc.
##### Core config #####
if [ -z $DD_API_KEY ]; then
echo "You must set D... |
class Component {
// Common properties and methods for all components
}
class TargetTableComponent extends Component {
// Properties and methods specific to TargetTableComponent
}
class TargetCardComponent extends Component {
// Properties and methods specific to TargetCardComponent
}
class LongTargetCardCompo... |
<reponame>jinahya/datagokr-api-b090041-lunphinfoservice-client-spring
package com.github.jinahya.datagokr.api.b090041_.lunphinfoservice.client;
public class _NoOpTest {
} |
<filename>blingfireclient.library/inc/FAState2Ow_pack_triv.h
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
#ifndef _FA_STATE2OW_PACK_TRIV_H_
#define _FA_STATE2OW_PACK_TRIV_H_
#include "FAConfig.h"
#include "FASetImageA.h"
#include "FAState2OwCA.h"
... |
#!/bin/sh
# ** AUTO GENERATED **
# 4.1.14 - Ensure changes to system administration scope (sudoers) is collected (Automated)
echo "-w /etc/sudoers -p wa -k scope" >> /etc/audit/rules.d/audit.rules
echo "-w /etc/sudoers.d/ -p wa -k scope" >> /etc/audit/rules.d/audit.rules
service auditd restart
|
<reponame>mothguib/pytrol
# -*- coding: utf-8 -*-
import numpy as np
from pytrol.control.agent.HPMEstimator import HPMEstimator
from pytrol.model.knowledge.EnvironmentKnowledge import EnvironmentKnowledge
from pytrol.util.net.Connection import Connection
from pytrol.util.randidlenest import draw_rand_idls
# Random ... |
#pragma once
#include "json/json.h"
//stl
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <unordered_map>
#include <set>
#include <algorithm>
#include <cassert>
#include <chrono>
#include <memory>
#include <thread>
#include <tuple>
#include <string>
|
import functools
@functools.lru_cache(maxsize=None)
def add_two_numbers(n1, n2):
return n1 + n2 |
package main
import (
"fmt"
"path/filepath"
"encoding/json"
"os"
)
func main() {
testRemoveFiles()
}
func testRemoveFiles(){
list:= listFiles("D:\\data\\tmp\\img")
for _, v := range list {
if deleteFile(v){
fmt.Println("delete "+ v)
}else{
fmt.Println("fail to delete "+ v)
}
}
}
func deleteFi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.