text stringlengths 1 1.05M |
|---|
package org.slos.battle.abilities.rule;
import org.hibernate.validator.internal.util.CollectionHelper;
import org.slos.battle.GameContext;
import org.slos.battle.abilities.rule.attack.DamageRule;
import org.slos.battle.attack.AttackContext;
import org.slos.splinterlands.domain.monster.DamageType;
import java.util.Set... |
import { Link } from "@linkto/core";
export const getLinksWithOrder = (list: Link[]) => {
/**
* When inserted in the DB the order defaults to 9999
* we sort items on the order in case there was any
* updates after they were inserted, and re-assign the order
*
* NOTE: We can assume that no user will ha... |
// app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<div *ngIf="showMainComponent">
<app-main></app-main>
</div>
<div *ngIf="!showMainComponent">
<app-login (loggedIn)="showMainComponent = true"></app-login>
</div>
`,
styleUrls: ['./app.com... |
<reponame>buidler-labs/hedera-mirror-node
package com.hedera.mirror.importer.repository;
/*-
*
* Hedera Mirror Node
*
* Copyright (C) 2019 - 2022 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ... |
<reponame>saucelabs/travis-core<filename>lib/travis/api/formats.rb<gh_stars>100-1000
module Travis
module Api
module Formats
def format_date(date)
date && date.strftime('%Y-%m-%dT%H:%M:%SZ')
end
end
end
end
|
angular.module('app.controllers', [])
.controller('daianeEventosMenuCtrl', function($scope, $rootScope, $ionicLoading, $http) {
$scope.fworkEscopo = {};
$scope.fworkEscopo.codEmpresa = 1;
$scope.eventoRotina = function(fworkEvento) {
$ionicLoading.show({content: 'Loading', animation... |
A typical PHP web framework would have the following components:
- A core class that sets up the framework by defining its file structure, the modules, objects and classes used within the framework.
- A routing mechanism that determines which page of the website should be served when a URL is requested.
- A controll... |
<reponame>infinitiessoft/skyport-api<filename>src/test/java/com/infinities/skyport/timeout/service/TimedPlatformServicesTest.java
/*******************************************************************************
* Copyright 2015 InfinitiesSoft Solutions Inc.
*
* Licensed under the Apache License, Version 2.0 (the "Li... |
package edu.uw.tacoma.piggy.view.table;
import java.util.List;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import edu.uw.tacoma.piggy.model.dao.UserDAO;
import edu.uw.tacoma.piggy.model.entity.UserEntity;
@SuppressWarnings("serial")
public class UserTable
extends JTable
{
p... |
#!/usr/bin/env bash
#SBATCH --ntasks-per-node=1+1166665
#SBATCH --time=00:30:00
em="\"\""
cp=""
if [ $em != $2 ]; then
cp = $2
fi
echo $9 -np $1 --hostfile $8 java -Djava.util.loggi.config.file=conf/logger.properties $cp -cp $3 edu.iu.dsc.tws.rsched.schedulers.standalone.MPIWorker --container_class $4 --job_name... |
# Generated by Django 3.1 on 2020-08-19 16:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('authentication', '0007_workspace_beacon_consent'),
('defini... |
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,uselessCode} checked by tsc
*/
/**
* @record
*/
export function ResultAndError() { }
if (false) {
/** @type {?|undefined} */
ResultAndError.prototype.result;
/** @type {?|undefined} */
ResultAndError.prototype.e... |
<reponame>Ancora/websiteancora
import { Twitter } from "styled-icons/icomoon/Twitter"
import { Instagram } from "styled-icons/icomoon/Instagram"
import { Facebook } from "styled-icons/icomoon/Facebook"
const Icons = {
Twitter,
Instagram,
Facebook,
}
export default Icons
|
<reponame>estebanmarichal70/VeMec
package com.vemec.api.controllers;
import com.vemec.api.services.SalaService;
import com.vemec.api.utils.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springf... |
class Queue {
constructor() {
this.items = [];
}
insert(element) {
this.items.push(element);
}
remove() {
if (this.isEmpty()) return null;
return this.items.shift();
}
isEmpty() {
return this.items.length === 0;
}
} |
from sklearn.linear_model import LogisticRegression
from sklearn.feature_extraction.text import CountVectorizer
# Define feature vectors and labels
true_statements = ['The earth is round']
false_statements = ['The earth is flat']
labels = [1, 0]
# Create a count vectorizer to generate the feature vectors
vectorizer =... |
<gh_stars>1-10
export const CHANGE_NAME_FILTER = 'CHANGE_NAME_FILTER';
export const CHANGE_TAG_FILTER = 'CHANGE_TAG_FILTER';
export const CHANGE_SELECTED_CHAMPION = 'CHANGE_SELECTED_CHAMPION';
export const FETCH_CHAMPIONS = 'FETCH_CHAMPIONS';
export const FETCH_CHAMPIONS_SUCCESS = 'FETCH_CHAMPIONS_SUCCESS';
export cons... |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkPCLOpenNISource.cxx
Copyright (c) <NAME>, <NAME>, <NAME>
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed W... |
<reponame>carlos-sancho-ramirez/android-java-langbook<filename>dbManager/src/main/java/sword/langbook3/android/models/DefinitionDetails.java
package sword.langbook3.android.models;
import sword.collections.ImmutableHashSet;
import sword.collections.ImmutableSet;
public final class DefinitionDetails<ConceptId> {
... |
#include <iostream>
#include <vector>
void printSubsets(std::vector<int> set) {
unsigned int n = set.size();
// Run a loop for printing all 2^n
// subsets one by one
for (unsigned int i = 0; i < (1<<n); i++) {
std::cout << "{ ";
// Print current subset
for (unsigned int j = 0;... |
import spacy
from spacy.matcher import Matcher
from spacy.lang.en import English
nlp = English()
matcher = Matcher(nlp.vocab)
# define the pattern
pattern = [{"ENT_TYPE": "INTENT", "OP": "+"}]
# add the pattern to the matcher
matcher.add("matching_1", None, pattern)
# create a function to find the intent
def find... |
#!/bin/bash
# Copyright 2015 The Bazel Authors. 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 ... |
/** */
package org.sunbird.learner.util;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.com... |
ActiveRecord::Base.connection.create_table(:catalogs, force: true) do |t|
t.string :name
t.timestamps
end
class Catalog < ActiveRecord::Base
end
|
<gh_stars>10-100
package io.opensphere.core.control.action.context;
import io.opensphere.core.model.ScreenPosition;
/** The context key for actions with only a screen position. */
public class ScreenPositionContextKey
{
/** The position of the action on-screen. */
private final ScreenPosition myPosition;
... |
library(ggplot2)
# Clustering results
cluster_labels <- c(1,2,2,3,1,2,3,1,3,2)
# Data used for clustering
data <- c(76,44,48,80,78,47,85,75,81,46)
# Create data frame
df <- data.frame(cluster_labels,data)
# Plot data using ggplot
ggplot(data=df, aes(x=cluster_labels, y=data)) +
geom_boxplot() +
xlab("Number... |
#!/bin/bash
# Default resolver, distro-specific solutions should override this
RESOLVE_DEPS() {
echo
error "No dependency resolver was found for your distro."
error "Please install the libraries and/or tools listed above as missing before continuing."
echo
exit 1
}
if [[ -e "/etc/gentoo-release" ]... |
/**
* Boilerplate code for Higher Order Components
*/
import React, { Component } from 'react';
export default function(ComposedComponent) {
class SomeComponent extends Component {
render() {
return <ComposedComponent {...this.props} />
}
}
return SomeComponent;
}
|
class RangeCheck:
def __init__(self, min, max, includemin = True, includemax = True):
self.min = min
self.max = max
self.includemin = includemin
self.includemax = includemax
self.errstr = "Value must be in the range {}{},{}{}".format("[" if self.includemin else "(",
... |
import VideoCapture from '../containers/Lounge/VideoCapture';
import mainEvent from '../containers/Lounge/mainFunctions/mainEvent';
export default function mainEvents(e, arg) {
const { videoFilePath, start, end } = arg;
const vCap = new VideoCapture({ path: videoFilePath });
return mainEvent({ vCap, start, end }... |
function randomString(n) {
const characterSet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
let randomString = '';
// Generate a random string
for (let i = 0; i < n; i++) {
// Get a random character from the set
const randomCharacter = characterSet[Math.floor(Math.random() * characterSet.len... |
#!/bin/bash
RELEASE='kube-ambassador-r1'
# reference: https://github.com/datawire/ambassador
# reference: https://hub.helm.sh/charts/stable/ambassador
# reference: https://www.getambassador.io/
echo "#"
echo "# Create namespace, service-accounts and role-bindings"
echo "#"
kubectl apply -f ~/devenv/config/kube-manif... |
class Admin::Mailer < ActionMailer::Base
default :from => Typus.mailer_sender
def reset_password_link(user, url)
@user = user
@url = url
mail :to => user.email,
:subject => "[#{Typus.admin_title}] #{_("Reset password")}"
end
end
|
$(document).ready(function () {
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
... |
/**
* Ensure that a value is a collection.
*
* @param collection A value that might be a collection.
*/
export function getCollection<T extends any>(collection: T[] | null | undefined): T[] {
return Array.isArray(collection) ? collection : [];
}
/**
* Ensure that a value is a collection that has items in it.
*... |
#!/bin/bash
/opt/zookeeper/bin/zkServer.sh start
until /opt/zookeeper/bin/zkServer.sh status; do sleep 0.1; done
/opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties
|
/*
* Copyright 2002, 2003 <NAME>, <NAME>. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#include "DefaultManager.h"
#include <Application.h>
#include <Directory.h>
#include <File.h>
#include <FindDirectory.h>
#include <MediaNode.h>
#include <OS.h>
#include <Path.h>
#include <TimeSource... |
docker run -it --rm --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze
|
/**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.analytics.financial.interestrate;
import java.util.List;
import java.util.Map;
import com.opengamma.analytics.financial.interestrate.future.derivative.BondFu... |
<reponame>YijiangWang/good-good-study
import React from 'react';
import ReduxTest from './reduxTest';
import {Provider} from 'react-redux';
import store from './store';
import RouterTest from './routerTest';
import { CompFunc, CompClass } from './components/CompType';
import Clock from './components/Clock';
function A... |
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
var fs = require('fs');
var path = require('path');
var child_process = require('child_process');
var version = child_process.execFileSync('/usr/libexec/PlistBuddy', [
'-c', 'Print :CFBundleShortVersionString', path.join(__dirname, '..', '..', 'KinveyKit', 'KinveyK... |
<reponame>qbancoffee/winfile<gh_stars>1000+
//*************************************************************
// File name: exehdr.c
//
// Description:
// Routines for reading the exe headers and resources
//
// History: Date Author Comment
// 1/16/92 MSM Created
//
// Written... |
/**
* Orthanc - A Lightweight, RESTful DICOM Store
* Copyright (C) 2012-2016 <NAME>, Medical Physics
* Department, University Hospital of Liege, Belgium
* Copyright (C) 2017-2020 <NAME>., Belgium
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser Gener... |
<filename>activity/mashtoken/activity.go<gh_stars>10-100
// Package mashtoken implements getting a token from TIBCO Cloud Mashery
package mashtoken
import (
b64 "encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/TIBCOSoftware/flogo-lib/core/activity"
"github.com/TIBCOSoftware... |
<gh_stars>0
# ensure we use the best available 'set' type with name 'set'
try:
set
except NameError:
from sets import Set as set
# a custom exception class that we raise to signal violations
class InterfaceOmission(TypeError):
pass
class MetaInterfaceChecker(type):
''' the interface-checking custom meta... |
#!/usr/bin/env python3
import os
import sys
thispath = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(os.path.dirname(thispath),"helper"))
from MiscFxns import *
from StandardModules import *
def CompareEgy(EgyIn):
return EgyIn+228.99856104845924<0.00001
def CompareGrad(GradIn):
C... |
#!/bin/sh -l
set -eu
apt-get update && apt-get install -y \
ant \
git \
openjdk-8-jdk
git clone $1
git checkout $2
git submodule update --init
cp -r src/** appinventor-sources/appinventor/components/src
cd appinventor-sources/appinventor/
ant clean
ant extensions
cd ../..
cd appinventor-sources/appinventor... |
# Mar 17, 2021
# python3 train_wbc_cv.py --docker --snapshot imagenet --dataset wbc_1024x1024 --cls 4 --phi 0 --gpu 2 --batch-size 8 --steps 100 --epoch 200 --valid False --cross 1
# python3 train_wbc_cv.py --docker --snapshot imagenet --dataset wbc_1024x1024 --cls 4 --phi 0 --gpu 2 --batch-size 8 --steps 100 --epoch 2... |
<reponame>Darksecond/libcore
#pragma once
namespace core
{
namespace fs_modes
{
static const int in = 1;
static const int out = 2;
static const int append = 4;
};
};
|
function parseGalleryTemplate($html_template, $page) {
$parsed_data = [];
// Extract intro content
$parsed_data['intro'] = nl2br(get_gallery_intro($page));
// Extract paging links
preg_match("~\{\{paging_start\}\}(.*)\{\{paging_previous_start\}\}(.+)\{\{paging_previous_end\}\}(.*)\{\{paging_next_s... |
from typing import List
def find_matching_indices(prefixes: List[int], mask: int, index: int) -> List[int]:
output = []
for prefix in prefixes:
if (index & mask) == prefix:
output.append(prefix)
return output |
<reponame>quipex-binary-studio/github-snurse-cred<filename>src/event_handlers/pr-edited.ts
import { WebhookContext } from '../types';
import { managePrBaseLabels } from './helpers';
const handlePrEdited = async (context: WebhookContext) => {
console.log('pr edited');
await managePrBaseLabels(context);
... |
import requests
from bs4 import BeautifulSoup
URL = "www.example.com/articles"
r = requests.get(URL)
soup = BeautifulSoup(r.content, 'html5lib')
articles = soup.findAll('h2', attrs = {'class':'article-title'})
for article in articles:
print(article.text)
print(article.a['href']) |
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
from __future__ import division
import re
import itertools
import string
import sets
import struct
def isString_v1(obj): #除了UserString
return isinstance(obj,basestring)
def isString_v2(obj): #鸭子方法
try:
obj + ''
except:
return False
el... |
import React, { Component, PropTypes } from "react";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import { fetchPage } from "../actions/fetchActions";
import Banner from "../components/Banner";
import Section from "../components/Section";
import Loading from "../components/Loading"... |
<gh_stars>0
var server = require('net').createServer();
//var postcss = require('gulp-postcss');
var print = require('gulp-print');
var gulp = require('gulp');
var autoprefixer = require('autoprefixer');
var gutil = require('gulp-util');
var map = require('map-stream');
var vfs = require('vinyl-fs');
var streamify = re... |
import React from 'react';
const UserInfo = (props) => {
return (
<div>
<h2>User Info</h2>
<div>Name: {props.user[0]}</div>
<div>Age: {props.user[1]}</div>
<div>City: {props.user[2]}</div>
</div>
);
};
export default UserInfo; |
import React, { Component } from "react";
import { View, Text, TouchableWithoutFeedback, Modal, ScrollView } from "react-native";
export default class PlanetDescription extends Component {
constructor(props) {
super(props);
this.state = {
stationDescription: props.stationDescription,
... |
import numpy as np
class QuantumCircuit:
def __init__(self, num_qubits):
self.num_qubits = num_qubits
self.state_vector = np.zeros(2 ** num_qubits, dtype=complex)
self.state_vector[0] = 1 # Initialize with |0...0> state
def apply_gate(self, gate, target_qubits):
# Implement ap... |
#!/usr/bin/env zsh
VERSION="1.0.0"
HISTORIAN_SRC=${HISTORIAN_SRC:-"$HOME/.zsh_history"}
HISTORIAN_DB=${HISTORIAN_DB:-"$ZSHRC_DIR/zsh.historian.db"}
HISTORIAN_SQLITE3=${HISTORIAN_SQLITE3:-"$(builtin command -v sqlite3)"}
usage() {
echo "Usage: hist <subcommand>" >&2
echo "subcommands:" >&2
echo " config ... |
#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dist... |
import psutil
def high_usage_check():
cpu_usage = psutil.cpu_percent()
if cpu_usage > 75:
return "high_cpu"
memory_usage = psutil.virtual_memory()
memory_usage_percentage = memory_usage.percent
if memory_usage_percentage > 75:
return "high_memory"
disk_usage_percentage = psuti... |
<reponame>Bellian/GGJ2020
import LevelObject from "./levelObject";
import { vec2 } from "gl-matrix";
import { Bodies, World } from "matter-js";
import PhysicsEngine from "../physicsEngine";
interface WallMeta {
size: vec2;
class: string[];
}
export class Floor extends LevelObject {
meta!: WallMeta;
r... |
<reponame>thomaszdxsn/zoom-meeting-api<gh_stars>1-10
export enum ApprovalTypes {
Automatically = 0,
Manually = 1,
NoRegistartion = 2,
}
|
/* Copyright (c) 2012-2014 University of Cape Town
* Copyright (c) 2014 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rig... |
<gh_stars>1-10
import React, { useState, useEffect } from 'react';
import { useHistory, useParams } from 'react-router-dom';
import { Button } from '../../components/button/button';
import { ButtonGroup } from '../../components/button/button.group';
import { DescriptionList } from '../../components/description-list/de... |
export default `
\`\`\`jsx
import React from 'react';
import AdminBadge from 'anchor-ui/admin-badge';
const AdminBadgeExample = () => (
<section>
<AdminBadge />
<AdminBadge text="Custom Text" />
<AdminBadge text="Inverted" inverted />
</section>
);
export default AdminBadgeExampl... |
<reponame>Urvashi2707/npi<filename>src/app/pages/services/addServicing.service 2.ts
import { Injectable } from '@angular/core';
import { HttpClient,HttpHeaders } from '@angular/common/http';
import { Router } from '@angular/router';
import 'rxjs/add/operator/map';
import { Observable,Subject,BehaviorSubject } from 'rxj... |
<reponame>jiangjing1994/process-designer
import AppButton from './Button'
const components = [AppButton]
const install = function (Vue, opts = {}) {
if (install.installed) return
components.map((component) => Vue.component(component.name, component))
}
if (typeof window !== 'undefined' && window.Vue) {
instal... |
<filename>src/framework/Factory.ts
import type { IFactory, FactoryTypeRecord, ParamsOf, IApplication } from '../interfaces'
import type * as types from '../types'
export class ObjectFactory<Types extends FactoryTypeRecord = any> implements IFactory<Types>
{
constructor(
private application: IApplication<any>,
... |
#!/bin/bash
. ./cmd.sh
# This is as run_sgmm2.sh but uses the "SGMM2" version of the code and
# scripts, with various improvements.
# Build a SGMM2 system on just the 100k_nodup data, on top of LDA+MLLT+SAT.
if [ ! -f exp/ubm5a/final.ubm ]; then
steps/train_ubm.sh --cmd "$train_cmd" 700 data/train_100k_nodup data/... |
/*
* Copyright (C) 2005-2015 <NAME> (<EMAIL>).
*
* 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 la... |
#!/usr/bin/python3
"""An improved version of PswdProtHello3 that reads a list of users from a file.
"""
#Classes
#===============================================================================
class User(object):
"""A user."""
@staticmethod
def load_from_file(f):
"""Load a user from a config file... |
#!/bin/sh
gst-launch-1.0 -v videotestsrc pattern=snow ! video/x-raw,width=1280,heigh=720 ! kmssink
|
#!/bin/bash
_FILE=~/Workspace/apps/polymer-toolkit/polymer-web-components.txt
_ITEMS=$(awk '{printf("%s ",$1)}' $_FILE);
complete -W "${_ITEMS}" plmr-src plmr-doc plmr-npm
unset _FILE;
unset _ITEMS;
|
/* eslint-disable no-throw-literal */
/* eslint-disable camelcase */
import express, { Request, Response } from 'express';
import path from 'path';
import http from 'http';
// routers
import userRouter from './router/user';
import postRouter from './router/posts';
import miscRouter from './router/misc';
import settin... |
<filename>src/components/ServicesPage/ServiceItem/ServiceItem.js
import React from 'react';
import PropTypes from 'prop-types';
import './ServiceItem.css';
import IsotipoBitlogic from '../../../images/isotipo.png';
const ServiceItem = ({ title, children }) => (
<section className="ServiceItem">
<h2 className="Se... |
python preprocess.py -i static/edge/graph -o static/edge -n edge_prediction -b edge
python preprocess.py -i static/node/graph -o static/node -n node_classification -b node
|
#!/bin/bash
export DOCKER_REGISTRY=${DOCKER_REGISTRY:-kubeci}
source $(dirname "${BASH_SOURCE}")/lib.sh
# override this one if you need to change push & pull
docker_push() {
hub_canary
}
docker_pull() {
hub_pull
}
source_repo() {
RETVAL=0
if [ $# -eq 0 ]; then
cmd=${DEFAULT_COMMAND:-build}
$cmd
... |
<filename>beken378/func/include/bk7011_cal_pub.h
#ifndef _BK7011_CAL_PUB_H_
#define _BK7011_CAL_PUB_H_
#include "typedef.h"
typedef struct tmp_pwr_st {
UINT8 mod;
UINT8 pa;
UINT16 pwr_idx_shift;
} TMP_PWR_ST, *TMP_PWR_PTR;
extern void calibration_main(void);
extern INT32 rwnx_cal_load_trx_rcbekn_reg_val(voi... |
<filename>frontend/src/views/index.js<gh_stars>0
import React from 'react';
import Form from './Form';
import List from './List';
const Home = (props) => {
const [state, setState] = React.useState({
username: '',
token: '',
});
const setToken = (username, token) => {
setState({ username: username, to... |
<!DOCTYPE html>
<html>
<head>
<title>User Information</title>
</head>
<body>
<h1>User Information</h1>
<p>Name: <?php echo $name; ?></p>
<p>Age: <?php echo $age; ?></p>
</body>
</html> |
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2020, Linaro Limited
# Author: <NAME> <<EMAIL>>
#
# U-Boot UEFI: Image Authentication Test (signature with certificates chain)
"""
This test verifies image authentication for a signed image which is signed
by user certificate and contains additional intermediate... |
<filename>21.process/5.fork.js
// fork exec execFile 它们其实都是基于spwan的改进方法
let { spawn } = require('child_process');
/**
* fork可以直接运行一个node模块
* silent 可以快速 设置stdio
*/
function fork(modulepath, args, options) {
let { silent } = options;
let opts = Object.assign({}, options);
if (silent) {
opts.stdi... |
<gh_stars>1-10
#pragma once
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdint>
#include <drogon/HttpAppFramework.h>
#include <drogon/orm/Mapper.h>
#include "../../models/models.hpp"
#include "../../main.hpp"
namespace quiz {
class Option {
public:
int id;
std::string text;
Option(d... |
func Fibonacci(n: Int) -> Int {
if n == 0 {
return 0
} else if n == 1 {
return 1
} else {
return Fibonacci(n - 1) + Fibonacci(n - 2)
}
}
print(Fibonacci(5)) // Output: 5 |
import React from 'react';
const AlertContext = React.createContext();
export const AlertConsumer = AlertContext.Consumer;
export class AlertProvider extends React.Component {
constructor(props) {
super(props);
this.state = {
message: '',
variant: '',
};
}
newAlert = (message, varian... |
<reponame>twillouer/lombok-intellij-plugin-1
package de.plushnikov.lombok.tests;
import de.plushnikov.lombok.LombokParsingTestCase;
import org.junit.Ignore;
import java.io.IOException;
/**
* Unit tests for IntelliJPlugin for Lombok, based on lombok test classes
* For this to work, the correct system property idea.... |
package com.yntx.service.edu.listener;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yntx.service.edu.entity.Subject;
import com.yntx.service.edu.entity.excel.ExcelSubjectData;
impor... |
// Define a data structure to store the exported items
type ExportedItem = {
name: string;
value: any;
};
export class CommonModule {
private exports: ExportedItem[] = [];
// Method to export a class, function, or variable
export(name: string, value: any) {
this.exports.push({ name, value });
}
// ... |
const form = document.querySelector('form');
const textArea = document.querySelector('#content');
const fromInput = document.querySelector('#from');
const toInput = document.querySelector('#to');
form.addEventListener('submit', (e) => {
e.preventDefault();
const content = textArea.value;
const from = fromInput.... |
<reponame>sintefneodroid/droid
var searchData=
[
['listitemprefab',['ListItemPrefab',['../classdroid_1_1_runtime_1_1_utilities_1_1_game_objects_1_1_status_displayer_1_1_render_texture_list.html#a4af7e34230a6993a753c44af62d51242',1,'droid::Runtime::Utilities::GameObjects::StatusDisplayer::RenderTextureList']]]
];
|
if (
typeof require !== "undefined" &&
(typeof window === "undefined" ||
// eslint-disable-next-line camelcase
typeof __webpack_require__ !== "undefined" ||
(typeof navigator !== "undefined" && navigator.product === "ReactNative"))
) {
// eslint-disable-next-line no-redeclare,... |
<reponame>tsbohc/ProjectE
package moze_intel.projecte.gameObjs.tiles;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import moze_intel.projecte.capability.managing.ICapabilityResolver;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
import net.minecraftforge.com... |
package cn.shiyanjun.platform.scheduled.api;
import cn.shiyanjun.platform.api.LifecycleAware;
public interface SchedulingManager extends LifecycleAware {
ComponentManager getComponentManager();
RecoveryManager getRecoveryManager();
}
|
def execute_moves(cube, moves):
# Executes a specified set of moves on a rubik's cube
# cube: list representing a rubik's cube
# move: list of moves, each move specifying a set of slices to rotate
for move in moves:
rotate_cube(cube, move)
def rotate_cube(cube, move):
# Rotates the sides of a rubik's cube accordin... |
#!/bin/bash
echo T1009 Binary Padding
echo Atomic Test #1 - Pad Binary to Change Hash - Linux/macOS dd
dd if=/dev/zero bs=1 count=1 >> /tmp/evil-binary
|
number_list = list(range(10))
print(number_list) # Output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
<reponame>CSCfi/pebbles
"""empty message
Revision ID: he536vdwh29f
Revises: <PASSWORD>
Create Date: 2019-07-18 11:50:00.78215
"""
# revision identifiers, used by Alembic.
revision = 'he<PASSWORD>'
down_revision = '<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gener... |
#!/bin/bash
[[ -f sqlite3.db ]] && echo "sqlite3.db already exists!" && exit 1
./manage.py syncdb --noinput
./manage.py migrate
./manage.py createsuperuser --username=anytask --email=webmaster@anytask-klg.tk --noinput
echo 'from django.contrib.auth.models import User ; user=User.objects.get(username="anytask") ; user... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.