text stringlengths 1 1.05M |
|---|
import re
def categorize_text(text):
"""Categorizes the given text into positive, negative or neutral."""
text = text.lower()
if re.search(r"\b(happy|glad|fun)\b", text):
return "positive"
elif re.search(r"\b(sad|angry|fearful)\b", text):
return "negative"
else:
return "neut... |
<filename>src/test/java/com/chanus/yuntao/weixin/mp/api/test/DataCubeApiTest.java
/*
* Copyright (c) 2020 Chanus
*
* 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.... |
# Generated by Django 3.1.8 on 2021-06-07 17:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_business_rules', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='businessrulemodel',
name=... |
<gh_stars>1-10
export default [
{
"id":"0",
"src":"https://img.alicdn.com/imgextra/i2/912530100/O1CN0151Um611CbqDwX0kGh_!!0-saturn_solar.jpg_468x468q75.jpg_.webp",
"con":"casio卡西欧透明手表女baby g冰川冰韧系列限量运动女表BA-110CR",
"price":"1290",
"nowPrice":"531",
"monthNum":"154",
... |
import { getWasmExport } from "../storage";
import { log } from "../utils/log";
const contractList: any[] = [];
export const getContract = async (moduleName: string, ptr: number, length: number) => {
const wasm_exports = getWasmExport(moduleName);
const buffer = wasm_exports.memory.buffer.slice(ptr, ptr + length)... |
#!/bin/sh
docker build -t ctaggart/golang-vscode . |
# Utility function for golang-using packages to setup a go toolchain.
termux_setup_golang() {
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
local TERMUX_GO_VERSION=go1.17.7
local TERMUX_GO_PLATFORM=linux-amd64
local TERMUX_BUILDGO_FOLDER
if [ "${TERMUX_PACKAGES_OFFLINE-false}" = "true" ]; then
TERMUX_BU... |
<filename>core/src/main/java/com/linecorp/armeria/client/Clients.java
/*
* Copyright 2015 LINE Corporation
*
* LINE Corporation licenses this file to you 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 ... |
package test.base.core;
import java.util.Properties;
import org.junit.Before;
import org.junit.Test;
import com.wpisen.trace.agent.bootstrap.TraceSessionInfo;
import com.wpisen.trace.agent.common.util.Assert;
import com.wpisen.trace.agent.core.AgentFinal;
import com.wpisen.trace.agent.core.DefaultApplication;
/**
... |
from anonboard.jsonapi_test_case import JSONAPITestCase
from core import factories
class TopicAPITests(JSONAPITestCase):
def setUp(self):
super(TopicAPITests, self).setUp()
self.topics = factories.TopicFactory.create_batch(10)
def tearDown(self):
super(TopicAP... |
<gh_stars>0
# !/usr/bin/python
# -*- coding:utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import lda
import lda.datasets
from pprint import pprint
if __name__ == "__main__":
# document-term matrix
X = lda.datasets.load_reuters()
print("type(X): {}".format(type(X)))
... |
package terminal
import (
"image/color"
)
var (
// Maps 256 color terminal codes to color.RGBA
ColorMap = map[ColorCode]color.RGBA{
16: color.RGBA{0, 0, 0, 255},
17: color.RGBA{0, 0, 95, 255},
18: color.RGBA{0, 0, 135, 255},
19: color.RGBA{0, 0, 175, 255},
20: color.RGBA{0, 0, 215, 255},
21: color.RGBA... |
/*
* PMMG - Polícia Militar do Estado de Minas Gerais.
* DTS - Diretoria de Tecnologia e Sistemas.
* CTS - Centro de Tecnologia em Sistemas.
*
* Copyright (c) DTS/CTS.
*
* Este é um software proprietário; não é permitida a distribuição total ou parcial deste código sem a autorização da DTS ou do CTS.
* Se você ... |
class SourceCodeLoader:
def __init__(self):
self.sources = {} # Dictionary to store the source code content
self.source_location_table = {} # Dictionary to store the source location table
def add_source(self, path, text):
self.sources[path] = text
def process_imports(self, path, ... |
<reponame>Kvadeck/basic-js
const CustomError = require("../extensions/custom-error");
module.exports = function createDreamTeam(members) {
if (!Array.isArray(members))
return false
let result = '';
for (const i of members) {
if (typeof (i) == 'string') {
result += i.split(' ').join('')[0];
}
... |
#!/usr/bin/env bash
. ./hack/check-python/prepare-env.sh
# run the pydocstyle for all files that are provided in $1
function check_files() {
for source in $1
do
echo "$source"
$PYTHON_VENV_DIR/bin/pydocstyle --count "$source"
if [ $? -eq 0 ]
then
echo " Pass"
... |
<reponame>OliMoose/kermit
import asyncio, discord
try:
from _command import Command
except:
from coms._command import Command
class Com(Command):
def __init__(self):
self.usage = "!purge [number of messages]"
self.description = "Deletes all the messages!"
self.keys = ["!purge", "... |
def char_count(str):
char_dict={}
for char in str:
if char in char_dict:
char_dict[char]+=1
else:
char_dict[char]=1
return char_dict
print(char_count('Hello World!')) |
sudo service apache2 stop
./stopandremove.sh
docker-compose up -d
|
package ferrari;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
try(BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in))) {
String driverName = bfr.readLine();
... |
#!/bin/bash
#*************************************************************************#
# @param
# src_frame_rate: frame rate for send data
# data_path: Video or image list path
# wait_time: When set to 0, it will automatically exit after the eos signal arrives
# loop = true: loop through video
#
# @notice: other flags... |
# Run at real time priority
chrt --rr 99 ./build/TOZ
|
<gh_stars>10-100
import * as path from 'path';
import * as vscode from 'vscode';
import { ILocalOnlyScript } from '../../models/ILocalOnlyScript';
export class OnlyLocalDirectoryItem extends vscode.TreeItem {
contextValue = "onlyLocalDirectoryItem";
iconPath = new vscode.ThemeIcon("folder-opened");
cons... |
package workspace_th.day06.ex1;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
public class HashMapEx01 {
public static void main(String[] args) {
// //Map<K, V> = map1 = new HashMap();
Map map = new HashM... |
from abc import ABC, abstractmethod
class AbstractGenerator(ABC):
@abstractmethod
def generate(self):
pass
class InfoGANGenerator(AbstractGenerator):
def __init__(self, info_params):
self.info_params = info_params
# Initialize InfoGAN specific parameters and architecture here
... |
import { ftType } from "../lib";
export class LessonParameters {
public samplingRate: number = 1024;
public duration: number = 5;
public stretch: number = 1;
public showWaves: boolean = false;
public type: ftType = ftType.FFT;
public absValues: boolean = false;
constructor(init?: Partial<L... |
<reponame>Datacket/Invado
import numpy as np
import tensorflow as tf
import pandas as pd
import random
import matplotlib.pyplot as plt
class DatasetSplit(object):
def __init__(self, x, y, bs):
self.x = x
self.y = y
self.bs = bs
self.start_split = 0
self.its = 1
... |
package test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import stratego.BoardSetupMessage;
import stratego.Piece;
import stratego.Piece.PieceType;
public class BoardSetupMessageClassTest {
@Test
public... |
#!/bin/bash
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
# Stash uncomitted and untracked changes
git stash --all
# Remove the contents of the current /public folder
rm -rf ./public/*
# Generate the static site in the default /public folder.
hugo
# Add changes to the git submodule.
cd public
git check... |
function add(a, b) {
return a + b;
}
function divide(a, b) {
if (b == 0) {
throw new Error('除数不能为零');
return
}
return a / b;
}
exports.add = add;
exports.divide = divide; |
package org.silentsoft.ui.component.text;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import javax.swing.DefaultComboBoxModel;
... |
<reponame>tlranjan/my-apps
app.controller('all_requests', function($scope, $filter, $http) {
var self = this;
self.getallawsrequestmodel = function(){$http({
method: 'GET',
url: '/admin/user/getallawsrequestmodel',
headers: {'Content-Type': 'application/json'}
}).then(function(response){self.getallawsrequestm... |
<filename>docussandra-domain/src/main/java/com/pearson/docussandra/domain/objects/QueryResponseWrapper.java
package com.pearson.docussandra.domain.objects;
import java.util.ArrayList;
import java.util.List;
/**
* Wrapper for returning queries. Contains metadata about the response in
* addition to the actual respons... |
<reponame>mohamedkhairy/dhis2-android-sdk
/*
* Copyright (c) 2004-2021, University of Oslo
* 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 t... |
import random
import numpy as np
from deap import base
from deap import creator
from deap import tools
# Create a new type with a fitness attribute
creator.create("FitnessMax", base.Fitness, weights=(1.0,))
# Provide a new type, inheriting from the list type
creator.create("Individual", list, fitness=creator.Fitness... |
<gh_stars>0
var core = function() {
this.init()
};
core.prototype = {
init: function() {
this._run()
},
_run: function() {
document.imgSvgReplacer = new imgSvgReplacer, document.intro = new intro, document.slider = new slider, document.odometerInit = new odometerInit, document.tabs = new... |
for i in range(10):
print("Perfect square at position", i+1, "is", (i+1)*(i+1)) |
<filename>back-end/hub-api/src/main/java/io/apicurio/hub/api/github/GitHubCreateReference.java
/*
* Copyright 2018 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ht... |
<gh_stars>0
#Generation of random IP addresses in the subnet
while True:
generate = input("Generate random IP address from this subnet? (y/n)")
if generate == "y":
generated_ip = []
#Obtain available IP address in range, based on the difference between octets in broadcast ad... |
module.exports = function (app) {
const has = require('./has')(app)
return `
<!-- App Scripts -->
${base(app).trim()}
${scripts(app)}
${application(app)}`;
function application(app) {
let polymers = app.polymers
if (has('import') || has('shell', polymers)) {
let href = has('import') ? app.import : polymer... |
#!/bin/bash
# This script provides methods to call custom commands pre/post of starting/stoping the component during launch on the device.
# This script is being executed on the target device where the component is running.
# For example the script can be used to start and stop the morse simulator automatically.
ca... |
package vectorwing.farmersdelight.common.registry;
import net.minecraft.core.particles.ParticleType;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraftforge.registries.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
... |
#!/bin/bash
echo "Setting up env variables"
set -e
PROJECT_ID=$GOOGLE_PROJECT_ID # set by the CI
STAGE=$CI_BRANCH
KUBERNETES_APP_NAME=CLUSTER_NAME-$STAGE
IMAGE=gcr.io/$PROJECT_ID/hapi-api:$CI_REPO_NAME.$CI_COMMIT_ID
echo "Setting up gcloud client"
codeship_google authenticate
gcloud config set compute/zone us-centr... |
import numpy as np
class TicTacToeGame:
def __init__(self):
self.board = np.zeros((3, 3))
self.player_markers = {1: "X", -1: "O", 0: " "}
self.player_marker = 1
def is_gameover(self):
# if any row matches the marker the player wins
for row in range(3):
if np... |
import random
# Generate a random sequence of 0s and 1s
n = 10
random_sequence = "".join([str(random.randint(0, 1)) for x in range(n)])
print (random_sequence) |
#!/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... |
//
// Created by ooooo on 2020/2/25.
//
#ifndef CPP_0337__SOLUTION3_H_
#define CPP_0337__SOLUTION3_H_
#include "TreeNode.h"
#include <unordered_map>
using namespace std;
/**
* max money = max(根节点 + 四个孙子 , 两个儿子)
* A
* / \
* B B
* / \ / \
* C C C C
*
* dp: 0 表示不偷, 1 表示偷
*
* root[0] = max(ro... |
/// <reference types="yoga-layout" />
import Yoga from 'yoga-layout-prebuilt';
interface BuildLayoutOptions {
config: Yoga.YogaConfig;
terminalWidth: number;
skipStaticElements: boolean;
}
export declare const buildLayout: (node: import("./dom").TextNode | import("./dom").DOMElement, options: BuildLayoutOpt... |
<gh_stars>0
"""control_spending URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, nam... |
<reponame>levitnudi/Dala<gh_stars>0
package yali.org.view;
/**
* Created by Abhi on 13 Nov 2017 013.
*/
public class NotificationVO {
private String title;
private String message;
private String iconUrl;
private String action;
private String actionDestination;
public String getTitle() {
... |
#!/bin/bash
usage() { echo "Usage: $0 -t <subscriptionId> -p <resourceGroupName> -q <deploymentName> -l <resourceGroupLocation>" 1>&2; exit 1; }
# Initialize parameters specified from command line
while getopts ":t:p:q:l:" o; do
case "${o}" in
t)
echo "in case t"
subscriptionId=${OPTARG}
;;
p)
resour... |
<reponame>hofmeister/voyager<gh_stars>1-10
package collector
import (
"crypto/tls"
"encoding/csv"
"errors"
"fmt"
"io"
"net"
"net/http"
"net/url"
"sort"
"strconv"
"strings"
"sync"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
)
const (
Namespace = "haproxy"... |
<gh_stars>1-10
package main
import (
"fmt"
"github.com/henrymxu/gomoderator/forum"
"github.com/henrymxu/gomoderator/moderator"
"os"
)
func main() {
githubBuilder := forum.NewGithubBuilder()
githubBuilder.AccessToken = os.Getenv("GITHUB_ACCESS_TOKEN")
githubBuilder.AccountName = "henrymxu"
githubBuilder.Reposi... |
#!/bin/bash
cd "$(dirname "$(which "$0")")"
if [ "$1" = "Update" ]; then
docker build -t fieldboundary Docker
elif [ "$1" = "Launch" ]; then
docker run -v "$(pwd)/..":/workspace --gpus all -u $(id -u):$(id -g) -it --shm-size='256m' --rm fieldboundary
fi
|
#!/bin/bash
# Author: yeho <lj2007331 AT gmail.com>
# BLOG: https://linuxeye.com
#
# Notes: OneinStack for CentOS/RedHat 7+ Debian 8+ and Ubuntu 16+
#
# Project home page:
# https://oneinstack.com
# https://github.com/oneinstack/oneinstack
Install_PHP80() {
pushd ${oneinstack_dir}/src > /dev/null
if ... |
#!/bin/sh
# Script for installing Caffe SSD with cuDNN support on Jetson TX1 Development Kits
# Modified from JetsonHacks file and Dockerfiles:
# https://github.com/jetsonhacks/installCaffeJTX1/blob/master/installCaffeCuDNN.sh
# https://github.com/pool1892/docker/blob/master/caffe_pre/Dockerfile
# https://github.com/po... |
def search(query, text):
n = len(query)
result = []
# Loop through the text
for i in range(len(text)):
# Compare the current n characters of the text
# with the query string
if text[i: i + n] == query:
# If matches, append the current index of text to
# the result
result.appen... |
#!/bin/bash
if [[ "$OSTYPE" == "linux-gnu"* && $EUID != 0 ]]
then
commandPrefix="sudo"
else
commandPrefix=
fi
$commandPrefix docker-compose exec postgres dropdb nhs-virtual-visit-test -U postgres
$commandPrefix docker-compose exec postgres createdb nhs-virtual-visit-test -U postgres
npm run dbmigratetest up
|
package dev.patika.quixotic95.repository;
import dev.patika.quixotic95.model.Course;
import dev.patika.quixotic95.model.Instructor;
import java.util.List;
public interface InstructorRepository {
List<Course> findInstructorCoursesById(int id);
List<Course> findInstructorCourses(Instructor object);
}
|
def compute_std_dev(nums):
mean = sum(nums) / len(nums)
variance = 0
for n in nums:
variance += (n - mean) ** 2
variance /= len(nums)
std_dev = variance ** 0.5
return std_dev |
python -m domainbed.scripts.collect_results --input_dir=../result_domainbed/final/new03/
python -m domainbed.scripts.collect_results --input_dir=../result_domainbed/final/new02/
python -m domainbed.scripts.collect_results --input_dir=../result_domainbed/final/Digits_new01/
python -m domainbed.scripts.collect_resu... |
from ade25.base.utils import register_image_scales, package_image_scales
from ade25.widgets.utils import register_content_widgets
def register_and_package(image_scales):
register_image_scales(image_scales)
packaged_scales = package_image_scales()
register_content_widgets(packaged_scales) |
<filename>userdoc/html/search/classes_9.js<gh_stars>1-10
var searchData=
[
['text2d',['Text2D',['../classText2D.html',1,'']]],
['triangle',['Triangle',['../classTriangle.html',1,'']]]
];
|
from unittest import mock
from lib_kafka import message_segmenter
import unittest
import uuid
import time
class TestMessageSegmenter(unittest.TestCase):
def test_segment_message(self):
msg = '0'*(1000*1024)
all_results = list(message_segmenter.segment_message(msg))
self.assertEqual(len(al... |
#!/bin/bash
echo "Setup mounted directories"
/swtools/init-mounts.sh
/swtools/wait-mysql.sh
echo "Start importing database..."
/swtools/init-db.php
echo "Database imported." |
<reponame>ch1huizong/learning
from distutils.core import setup
import sys, os, py2exe
# the key trick with our arguments and Python's sys.path
name = sys.argv[1]
sys.argv[1] = 'py2exe'
sys.path.append(os.path.dirname(os.path.abspath(name)))
setup(name=name[:-3], scripts=[name])
|
#######################################################################
# Site specific configuration. Override these settings to run on
# your system.
hostname=$(hostname -f)
if [[ "$hostname" == *".fit.vutbr.cz" ]]; then
timit=/mnt/matylda2/data/TIMIT/timit
server=matylda5
parallel_env=sge
parallel_... |
package com.github.nenomm.ks.ktable.stockmarket;
import org.apache.kafka.streams.kstream.KGroupedStream;
import org.apache.kafka.streams.kstream.KStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.a... |
#!/bin/bash
docker stack deploy -c services.yml feeliks |
/**
* @author ooooo
* @date 2021/4/9 13:08
*/
#ifndef CPP_0154__SOLUTION1_H_
#define CPP_0154__SOLUTION1_H_
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int findMin(vector<int> &nums) {
int n = nums.size();
int l = 0, r = n - 1;
if (nums[l] < nums[r]) return nums[l... |
function insertionSort(arr) {
for (let i = 1; i < arr.length; i++) {
let currentVal = arr[i];
for (let j = i-1; j >= 0 && arr[j] > currentVal; j--) {
arr[j+1] = arr[j];
}
arr[j+1] = currentVal;
}
return arr;
}
let result = insertionSort(arr);
console.log(result); // prints [1,3,4,5,6,9] |
<filename>Quicklook/app/src/main/java/cl/uchile/ing/adi/quicklook/MainActivity.java
package cl.uchile.ing.adi.quicklook;
import android.Manifest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.Packa... |
echo "Done: $(pwd)"
date >> /var/rlogs.log
|
<gh_stars>1-10
#ifndef vx_H
#define vx_H
#include <iostream>
#include <vector>
#include <cmath>
#include <fstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
#include <cstdlib>
#include <map>
template <typename T>
class vx
{
// defining class members
private:
std::vector<T> ve... |
#!/bin/bash
set -e
while true; do
read -p "Have you checked that you have updated the version number in package.json?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
echo "Removing node_modules for ensuring dev dependencies..."
rm -rf ... |
#!/usr/bin/env bash
set -e
# test_names returns (via its stdout) a list of test names that match the provided regular expression
test_names () {
docker run --rm \
--workdir="/firecracker-containerd/${FCCD_PACKAGE_DIR}" \
"${FCCD_DOCKER_IMAGE}" \
"go test -list ." | sed '$d' | grep ... |
<reponame>premss79/zignaly-webapp<filename>src/components/Forms/ConfirmDeleteAccountForm/index.js
export { default } from "./ConfirmDeleteAccountForm";
|
from rest_framework import serializers
from contact import models
class MessageSerializer(serializers.ModelSerializer):
class Meta:
model = models.Message
fields = [
"name",
"email",
"phone",
"country",
"city",
"subject",
... |
from django.conf.urls import url
from mainapp.views import IndexView, UploadView
urlpatterns = [
url(r'^$', IndexView.as_view(), name='index'),
url(r'^(?P<key>[a-zA-Z0-9]+)$', UploadView.as_view(), name='upload'),
]
|
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-N-VB-ADJ-ADV/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-N-VB-ADJ-ADV/1024+0+512-only-pad-1 --do_eval -... |
<filename>src/components/MdOutput.js
import React from 'react';
import marked from 'marked';
import PropTypes from 'prop-types';
const MdOutput = (props) => {
const markAll = (values) => {
return values.map(val => marked(val)).join('');
}
const mark = (values) => (values.length !== 0) ? markAll(values) : '<p> ... |
#!/bin/bash
#
# Apache HTTPD & NGINX Access log parsing made easy
# Copyright (C) 2011-2018 Niels Basjes
#
# 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/LIC... |
<reponame>MarcelBraghetto/AndroidNanoDegree2016
package com.lilarcor.popularmovies.testhelpers;
import android.app.Application;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.test.runner.AndroidJUnitRunner;
/**
* Created by <NAME> on 30/07/15.
*
* We need to use a... |
<gh_stars>1-10
#!/usr/bin/env python3
import sys
import argparse
import contextlib
import collections
import binascii
import struct
import json
import hid
"""
Dualshock command-line utility
"""
PairingInfo = collections.namedtuple('PairingInfo', ['addr', 'paired_to'])
IMUCalib = collections.namedtuple('IMUCalib', ... |
class GreetingForm extends React.Component {
constructor(props) {
super(props);
this.state = {
name: ''
};
}
handleChange = (event) => {
this.setState({name: event.target.value});
}
handleSubmit = (event) => {
alert('Hello there, ' + this.state.n... |
/*
* Copyright © 2019 <NAME>.
*/
package apps
import (
"errors"
"github.com/hedzr/voxr-api/api/v10"
"github.com/hedzr/voxr-api/models"
"github.com/hedzr/voxr-api/util"
"github.com/hedzr/voxr-common/tool"
"github.com/hedzr/voxr-lite/misc/impl/dao"
"github.com/hedzr/voxr-lite/misc/impl/mq"
"github.com/sirupse... |
<gh_stars>1-10
/*
* Copyright 2008-2014 MOPAS(Ministry of Public Administration and Security).
*
* 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/L... |
<filename>pecado-uaa/src/main/java/me/batizhao/uaa/controller/AuthController.java
package me.batizhao.uaa.controller;
import io.swagger.annotations.Api;
import me.batizhao.common.core.util.R;
import me.batizhao.ims.api.domain.LoginDTO;
import me.batizhao.uaa.service.AuthService;
import org.springframework.beans.factor... |
<filename>src/option.js
/*
* @Description: 处理option的方法集合
* @Author: MADAO
* @Date: 2020-11-20 09:59:10
* @LastEditors: MADAO
* @LastEditTime: 2020-11-20 12:35:13
*/
const { storagePath } = require('./db')
const log = require('./log')
const inquirer = require('inquirer')
const { read, write } = require('./db')
co... |
#!/bin/bash
#
# Oracle Linux DTrace.
# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
script()
{
$dtrace $dt_flags -wq -o $tmpfile -s /dev/stdin $tmpfile <<EOF
BEGIN
{
i = 0;
}
tic... |
#ifndef CMD_HPP_
#define CMD_HPP_
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// Name : Cmd
// Author : Avi
// Revision : $Revision: #84 $
//
// Copyright 2009-2020 ECMWF.
// This software is licensed under the terms of the Apache Licence version 2.0
// which can be... |
<reponame>Bobobert/RoLas<filename>rofl/functions/torch.py
from .const import *
from .functions import Tdiv, Tmean, Tcat, Tstd, multiplyIter, nn, optim, deepcopy
def getDevice(cudaTry:bool = True):
if torch.cuda.is_available() and cudaTry:
print("Using CUDA")
return Tdevice("cuda")
return... |
__author__ = 'LeoDong'
import socket
import sys
from util import config
from judge.SAEJudge import SAEJudge
from util.logger import log
#TODO unique id in queue, store to file and reload.
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
log.info('start listening on %s' % str(config.... |
<gh_stars>0
//
// JWMaskView.h
// JWBarCharts
//
// Created by wangjun on 2018/11/16.
// Copyright © 2018年 wangjun. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface JWMaskView : UIView
@property (nonatomic, strong) UIFont *maskFont;
@property (nonatomic, strong) UIColor *maskTextColor;
@property (nonat... |
<reponame>jamestiotio/esc
import java.util.Calendar;
import java.util.Date;
public class exercise4 {
public static void main(String[] args) throws InterruptedException {
Calendar cal1 = new CalendarSubclass();
cal1.setTime(new Date());
Thread.sleep(1000);
Calendar cal2 = new Calenda... |
#!/bin/bash
# Figures out what the current version is, echoes that back,
# and also writes a `version.json` file into the package.
set -e
MAJMIN_VERSION="1.5"
pushd $(dirname $0) >/dev/null
working_dir=$PWD
name=$(basename $PWD)
popd >/dev/null
package=$(echo $name | sed 's/-/_/g')
version_json="${working_dir}/${pac... |
'use strict';
class Relationship {
constructor(id, displayName) {
this.id = id;
this.displayName = displayName;
}
getId() {
return this.id;
}
getDisplayName() {
return this.displayName;
}
isPositive() {
return this.id === 'Enhanc... |
/* Page building */
const page = [];
// Configuration
page.config = {
"titleSuffix": " | JSONdb"
}
// Page elements
page.Header = class { // Header
constructor(parent) {
const elements = [];
// Title
const title = document.createElement('h1');
title.setAttribute('class... |
<reponame>ivonildo-lopes/PedidoVenda<gh_stars>1-10
package com.algaworks.pedidovenda.controller;
import java.io.Serializable;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Event;
import javax.inject.Inject;
import javax.inject.Named;
import com.algaworks.pedidovenda.model.FormaPagament... |
/*iweb在线课堂项目必须的数据库结构*/
/*SQL 语句不区分大小写,习惯上: 关键字都大写,非关键字小写*/
#删除数据库iweb,如果它存在的话
DROP DATABASE IF EXISTS iweb;
#重新创建数据库iweb
CREATE DATABASE iweb CHARSET=UTF8;
#进入数据库
USE iweb;
#创建校区表
CREATE TABLE iw_school(
sid INT PRIMARY KEY AUTO_INCREMENT, #校区编号
sname VARCHAR(32), #名称
pic VARCHAR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.