language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
C++ | UTF-8 | 989 | 2.65625 | 3 | [] | no_license | #pragma once
#include <BasicFormater.hpp>
#include <UITextField.hpp>
#include <UITextInput.hpp>
#include <optional>
#include <Renderer.hpp>
//debug
#include <string>
class UserInputView
{
public:
UITextInput& get() { return userInputBuffer; }
std::optional<UITextField> popInput()
{
if(not hasUncon... |
C# | UTF-8 | 2,929 | 2.53125 | 3 | [] | no_license | using OutlierProtege.Database;
using OutlierProtege.Models;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Description;
namespace OutlierProtege.Controllers.Api
{
public class Source... |
Markdown | UTF-8 | 3,683 | 3.0625 | 3 | [] | no_license | # sql
* 表操作:
drop table tableName; 删除表
create table tableName(clomnkey...) engine=InnoDB; // 创建表,并指定工作引擎
alter table add clomnKey; 新增表字段
alter table drop clomnKey; 删除表字段
rename table a to b; 重命名表
show index from table; 查看索引
show columns from tabel; 查看表信息
... |
Java | UTF-8 | 556 | 3.109375 | 3 | [] | no_license | import java.util.HashSet;
import java.util.Set;
class Solution {
public int maxNonOverlapping(int[] nums, int target) {
Set<Integer> sums = new HashSet<>();
sums.add(0);
int result = 0;
int sum = 0;
for (int num : nums) {
sum += num;
if (sums.contain... |
Python | UTF-8 | 4,548 | 3.15625 | 3 | [] | no_license | """
class implementation of a 2D rotation class
creator: Peter Mackenzie-Helnwein
date: Oct 29, 2019
revised: April 5, 2020
"""
# import libraries
import sys
import numpy as np
# the element master class
from Element import *
# class definition
class PlateElement(Element):
"""
!class: PlateElement
thi... |
JavaScript | UTF-8 | 4,490 | 2.609375 | 3 | [] | no_license | // create our angular app and inject ngAnimate and ui-router
// =============================================================================
angular.module('formApp', ['ngAnimate', 'ngMessages', 'ui.router'])
// configuring our routes
// =============================================================================
... |
Java | UTF-8 | 1,017 | 3.6875 | 4 | [] | no_license | package info;
import infoInterface.IInfo;
/**
* 一个最基本的Info类型,
* 包含一个成员变量container来存储实际的信息。
*/
public class InfoWithContainer implements IInfo{
/**
* 存储信息的对象,
* 之所以创建这么一个对象是为了使得多个Info对象能够操作同一个信息
*/
public Object container;
/**
* @param container 信息的承载体,可以是任何对象。
*/
public InfoWithContainer(Object con... |
Java | UTF-8 | 3,368 | 3.390625 | 3 | [] | no_license | package payloadGeneration.hashTable;
import java.io.*;
import java.util.*;
public class HashTableMain {
public static class HashOrder implements Comparator<String>{
public HashOrder() {
}
public int compare(String str1, String str2) {
int hash1 = str1.hashCode();
int hash2 = str2.hashCode();
return h... |
Python | UTF-8 | 2,468 | 2.53125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import argparse
import os
import socket
import gym
import numpy as np
import gym_uds_pb2
import utils
class Environment:
def __init__(self, env_id, sock):
self.env = gym.make(env_id)
self.sock = sock
self.sock.settimeout(1)
def run(self):
while True:
... |
C++ | UTF-8 | 9,215 | 2.609375 | 3 | [] | no_license | //
// jnidictionry.cpp
// vntoeic
//
// Created by dai nguyen on 5/15/17.
// Copyright © 2017 dai nguyen. All rights reserved.
//
#include <stdio.h>
#include "jni.h"
#include "model.cpp"
#include "SqliteDictionary.hpp"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// select all dic... |
Java | UTF-8 | 77 | 2.046875 | 2 | [] | no_license | package code.microsystem;
public interface Vehical {
void move();
}
|
C++ | UTF-8 | 7,107 | 3.421875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <utility>
#include <cstdio>
const int ALPHABET = 128;
struct Node {
// Bounds of a substring that correspont to the edge from parent
int start;
int end;
int suff_link;
std::vector<int> children;
Node(int start,... |
Markdown | UTF-8 | 1,406 | 2.828125 | 3 | [] | no_license | # Packer Templates
This is a repository of available Packer templates. One day, hopefully,
there will be a website that makes it easier to discover these templates,
but for now a central repository helps quite a bit.
If you want to contribute a template, please make a pull request!
Note that these templates are not ... |
PHP | UTF-8 | 4,431 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
use Fuel\Core\DB;
/**
* Any query in Model Version
*
* @package Model
* @created 2017-10-22
* @version 1.0
* @author AnhMH
*/
class Model_Atvn_Product extends Model_Abstract {
/** @var array $_properties field of table */
protected static $_properties = array(
'id',
'aff_link... |
Java | UTF-8 | 81 | 1.742188 | 2 | [] | no_license | package com.msus.GameOfLifeView;
public enum Actions {
STEP,START,STOP;
}
|
C | UTF-8 | 1,162 | 3.71875 | 4 | [] | no_license | #include <stdio.h>
typedef struct
{
int c[20];
int front;
int rear;
}queue;
void enqueue(queue *q,int n)
{
if (q->rear==20)
printf("Queue Full\n");
else
{
int i,j,t;
q->c[(q->rear)++]=n;
for (i=0;i<q->rear-1;i++)
{
for (j=0;j<q->rear-i-1;j++)
{
if (q->c[j]>q->c[j+1])
{
... |
SQL | UTF-8 | 381 | 2.671875 | 3 | [] | no_license | QUERYVALIDACAO select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F') where r.fkeyid = object_id('INFM_ITEMPROCESSO') and o.name = 'FK_INFM_ITEMPROCESSO_INFM_PROCESSO'
BANCODEDADOS IGERENCE
alter table INFM_ITEMPROCESSO
add constraint FK_INFM_ITEMPROCESSO_INFM_PROCESSO foreign... |
Java | UTF-8 | 453 | 2.015625 | 2 | [] | no_license | package com.cangli.tech.intersect.internet;
import android.os.Build;
/**
* Created by Alienware on 2016/8/10.
*/
public class DeviceId {
private String DEVICE_ID;
public DeviceId(){
generateDeviceId();
}
private void generateDeviceId() {
DEVICE_ID = new String();
String Seri... |
Java | UTF-8 | 641 | 3.59375 | 4 | [] | no_license | package arthmetic;
import java.util.Scanner;
public class Threechar {
/**
*题目描述
* 给定一个英文字符串,请写一段代码找出这个字符串中首先出现三次的那个英文字符(需要区分大小写)。
* 输入描述:
* 输入数据一个字符串,包括字母,数字等。
* 输出描述:
* 输出首先出现三次的那个英文字符
* */
public static void main(String[] args) {
Scanner in = new Scanner(System.in... |
Java | UTF-8 | 1,064 | 4.15625 | 4 | [] | no_license | package com.algorithm.dynamic_programming;
public class IntegerBreak {
/**
* 给定一个正整数 n,将其拆分为至少两个正整数的和,并使这些整数的乘积最大化。 返回你可以获得的最大乘积。
*
* 例如,给定 n = 2,返回1(2 = 1 + 1);给定 n = 10,返回36(10 = 3 + 3 + 4)。
*
* 注意:你可以假设 n 不小于2且不大于58。
*/
public static void main(String[] args)
{
int... |
JavaScript | UTF-8 | 481 | 3.171875 | 3 | [] | no_license | const RIGHT_WALL = 220;
const FALL_SPEED = 0.5;
class FallingObject {
constructor(img, canvasContext, itemType) {
this.img = img;
this.canvasContext = canvasContext;
this.itemType = itemType;
this.posX = Math.floor(Math.random() * RIGHT_WALL);
this.posY = 0;
}
updatePos() {
this.canvasC... |
Python | UTF-8 | 781 | 2.796875 | 3 | [] | no_license | from flask import Flask, render_template, request, redirect, url_for
import os
app = Flask(__name__)
# view function
# represents a html page
# single forward slash --> root url
@app.route('/')
def hello():
return "Hello World"
@app.route('/about-our-company')
def about():
return "About Me"
@app.route('/c... |
JavaScript | UTF-8 | 348 | 3.515625 | 4 | [] | no_license | 'use strict';
// function now(){
// return 21;
// }
//
// function later(){
// console.log(`meaning of life is ${answer*2}`);
// }
//
// let answer = now();
// setTimeout(later,10); //NOW we set up an action for LATER
console.log('A');
setTimeout(function fc(){
console.log('C');
},100);
// console.log(`B ${fc.... |
C# | UTF-8 | 3,226 | 2.96875 | 3 | [] | no_license | using System;
using System.Linq;
namespace TeamEeyore.SpaceShip
{
class HelpMenu
{
static byte curX = (byte)(Console.WindowWidth - 10);
static byte curY = 0;
static byte tempX = curX;
static byte tempY = curY;
public static void Help()
{
Page1();
... |
Markdown | UTF-8 | 2,567 | 2.921875 | 3 | [
"MIT"
] | permissive | # 软件项目管理 - 综述
## 介绍
本文主要描述以下几个方面:
- [产出物](#产出物)
- [角色和他们的职责](#角色和他们的职责)
- [项目管理流程](#项目管理流程)
## 产出物
一个项目的会产出什么?
### 发布的内容
- 用户手册
负责人: `Information Developer`
- Installers
负责人: `DevOps Developer`
### 规范文档
规范文档应该有公司一个技术委员会来负责。
- 项目流程定义
负责人: `Project Manager`
- 文档规范
- 代码规范
### 内部
- 需求文档
负责人: `Product Manager`... |
Markdown | UTF-8 | 5,053 | 3.0625 | 3 | [
"CC-BY-SA-4.0",
"CC-BY-SA-3.0",
"MIT"
] | permissive | # Azure App Services and Subdomain Takeovers
## Introduction
Azure Web Apps enables you to build and host web applications in the programming language of your choice without managing infrastructure. It offers auto-scaling and high availability, supports both Windows and Linux, and enables automated deployments from G... |
C | UTF-8 | 35,020 | 2.703125 | 3 | [
"BSD-2-Clause",
"BSD-2-Clause-Patent"
] | permissive | /*
* (C) Copyright 2016-2022 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
/**
* This file is part of cart, it implements the hash table functions.
*/
#define D_LOGFAC DD_FAC(mem)
#include <pthread.h>
#include <gurt/common.h>
#include <gurt/list.h>
#include <gurt/hash.h>
enum d_hash_lru... |
C++ | UTF-8 | 1,262 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright Regents of the University of Minnesota, 2017. This software is released under the following license: http://opensource.org/licenses/
* Source code originally developed at the University of Minnesota Interactive Visualization Lab (http://ivlab.cs.umn.edu).
*
* Code author(s):
* Dan Orban (dtorban)... |
Python | UTF-8 | 1,284 | 2.5625 | 3 | [] | no_license | from celery import Celery
import time
from urllib.request import urlopen
import uuid
app = Celery('tasks', broker='redis://35.165.238.44', backend='redis://35.165.238.44')
@app.task
def check_input_file(file_path):
return file_path
@app.task
def move_input_file(file_path_start, file_path_end):
return (file_p... |
Markdown | UTF-8 | 1,084 | 2.578125 | 3 | [
"MIT"
] | permissive | +++
# A Skills section created with the Featurette widget.
widget = "featurette" # See https://sourcethemes.com/academic/docs/page-builder/
headless = true # This file represents a page section.
active = true # Activate this widget? true/false
weight = 30 # Order that this section will appear.
title = "Skills"
sub... |
PHP | UTF-8 | 5,349 | 2.71875 | 3 | [] | no_license | <?php
class Categories {
// constructor
public function __construct() {}
// get list of categories
public static function get_categories($id_parent=0)
{
return self::list_categories($id_parent);
}
private function list_categories($id_parent)
{
global $mysqli;
$current_datetime = date('Y-m-d H:i:... |
Shell | UTF-8 | 1,274 | 2.84375 | 3 | [] | no_license | #!/bin/bash
set -e
jekyll build
if [ ! -d _jack1 ]; then
git clone --recursive git@github.com:jackaudio/jack1 _jack1
fi
# if [ ! -d _jack2 ]; then
# git clone --recursive git@github.com:jackaudio/jack2 _jack2
# fi
pushd _jack1
if [ ! -f configure ]; then
./autogen.sh
fi
if [ ! -f Makefile ]; then
./configur... |
JavaScript | UTF-8 | 2,857 | 4.375 | 4 | [] | no_license | // What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( 15 );
//Return type is "number". All types of numerical values are
//Return type is "Number". All objects that represent numbers are of type "Number"
// What is the return value of the below code sample? Provide a s... |
C# | UTF-8 | 3,364 | 2.53125 | 3 | [] | no_license | using RevivalWebSite.Models;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
namespace RevivalWebSite.DAL
{
public class RevivalDbInitializer : DropCreateDatabaseIfModelChanges<RevivalContext>
{
protected override void Seed(RevivalContext ... |
Python | UTF-8 | 4,431 | 2.59375 | 3 | [] | no_license | ''' Created on 04 Oct. 2018, last edited 23 Oct. 2018
Module to simplify interfacing with the processing scripts
@author: James Moran [jpmoran.pac@gmail.com]
'''
from . import file_io_thermal
from . import process_image as process_image_file # Must be aliased, as the function matches the filename
from server.messages ... |
Ruby | UTF-8 | 1,417 | 3.75 | 4 | [] | no_license | ############################################
#
# Class Bob
#
class Bob
def hey(input)
respond(input)
end
private
def respond(input)
Response.new(input).respond
end
end
############################################
#
# Class Response
#
class Response
attr_reader :input
SENTENCE_SUFFIXES... |
JavaScript | UTF-8 | 1,081 | 2.796875 | 3 | [
"MIT"
] | permissive | define(['jquery','helper'],function($,helper){
//北美
var usBox = {
init: function(){
this.$element = $('#beimei')
this.$container = this.$element.find('.container')
this.start()
},
start: function(){
var _this = this
this.getData(function(data){
_this.render(data)
... |
C++ | UTF-8 | 675 | 3.125 | 3 | [] | no_license | /************************** GameItem *****************************
** The GameItem class represents items in the game the player can
** collect and use. There is a special type, known as food that the
** player can consume. This is defined by isEdible bool variable.
************************************************... |
JavaScript | UTF-8 | 1,022 | 2.625 | 3 | [] | no_license | import { Command, Option, InvalidOptionArgumentError } from 'commander/esm.mjs';
function checkInt(value) {
if (isNaN(+value)) {
throw new InvalidOptionArgumentError('Shift value must be a number.');
}
return +value;
}
export default () => {
const program = new Command();
program
.addHelpText('befo... |
Swift | UTF-8 | 3,226 | 2.53125 | 3 | [] | no_license | //
// Keychain.swift
// Combine-MVVM
//
// Created by Glenn Posadas on 4/30/21.
// Copyright © 2021 clarknt. All rights reserved.
//
import Foundation
public enum KeychainKey: String {
case userId = "KEY_USER_ID"
}
// Arguments for the keychain queries
private let kSecClassValue = NSString(format: kSecClass)
p... |
C++ | UTF-8 | 854 | 2.609375 | 3 | [] | no_license | #pragma once
#include "../defines.h"
#include "vector.h"
class Bsdf {
public:
HOST_DEVICE virtual Vec3f sample(Vec3f n, float u[2]) = 0;
HOST_DEVICE virtual float f(Vec3f n, Vec3f wi) = 0;
HOST_DEVICE virtual float pdf(Vec3f n, Vec3f wi) = 0;
};
using BsdfPtr = Bsdf *;
class NullBsdf : public Bsdf {
public:
... |
Java | UTF-8 | 520 | 2.28125 | 2 | [] | no_license | package com.example.interseptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SimpleWebController {
private static final Logger log = LoggerFactor... |
Java | UTF-8 | 1,996 | 2.046875 | 2 | [] | no_license | package com.xuqm.frame.ui.fragment;
import android.view.View;
import com.xuqm.base.adapter.BasePagedAdapter;
import com.xuqm.base.common.LogHelper;
import com.xuqm.base.common.ToolsHelper;
import com.xuqm.base.ui.BaseListAppBarFragment;
import com.xuqm.frame.R;
import com.xuqm.frame.model.AD;
import com.xuqm.frame.mo... |
Python | UTF-8 | 642 | 2.890625 | 3 | [
"MIT"
] | permissive | import numpy as np
class Relu(object):
def __call__(self, a):
return np.maximum(0, a)
def gradient(self, a):
return np.heaviside(a, 0)
class Tanh(object):
def __call__(self,x):
return np.tanh(x)
def gradient(self, x):
return 1.0 - np.tanh(x)**2
class Sigmoid(object):... |
Swift | UTF-8 | 713 | 2.625 | 3 | [
"MIT"
] | permissive | //
// P00Test.swift
// NintyNineTests
//
// Created by Gordon Tucker on 11/14/18.
// Copyright © 2018 Gordon Tucker. All rights reserved.
//
import XCTest
import NintyNine
class P00Test: XCTestCase {
func testConvienceInit() {
let list = List(1, 2, 3)
XCTAssertEqual(1, list.value)
... |
Python | UTF-8 | 693 | 3.75 | 4 | [] | no_license | # Представлен список чисел. Необходимо вывести элементы исходного списка,
# значения которых больше предыдущего элемента. Элементы, удовлетворяющие
# условию, оформить в виде списка. Для формирования списка использовать генератор.
import random
list_numbers = [round(random.random() * 10, 5) for i in range(rando... |
TypeScript | UTF-8 | 1,834 | 2.515625 | 3 | [] | no_license | import axios, { AxiosPromise, AxiosResponse } from "axios";
import { io } from "../..";
import { FunctionRequest } from "../../types";
const db = require('../../../db')
const infoDataClients = async () => {
const response: AxiosResponse = await axios.get('http://localhost:3030/clients')
return io.emit('clients', r... |
Python | UTF-8 | 111 | 3.0625 | 3 | [] | no_license | numbers = (10,20,10,20,30,40,60,70)
n = set(numbers)
print("Tuple after removing all duplicates: ", tuple(n)) |
Java | UTF-8 | 2,228 | 2.953125 | 3 | [] | no_license | package logic;
import business.AdministradorBusiness;
import business.NombresDeArchivosBusiness;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JList;
/**
* Clase que permite llevar un control de los administradores y encuestas
* creadas en el sistema
*
* @author adriansb3105
... |
C++ | UTF-8 | 668 | 2.609375 | 3 | [] | no_license | //https://codeforces.com/contest/1474/problem/A
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;cin>>t;
while(t--)
{
int n;cin>>n;
string b;
cin>>b;
int prev;
if(b[0]=='1'){cout<<1;prev=2;}
else if(b[0]=='0'){cout<<1;prev=1;}
for(int i=... |
Java | UTF-8 | 1,285 | 3.609375 | 4 | [] | no_license | package cn.laoma.thread2.t2_003;
import lombok.SneakyThrows;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
/**
* @program: ThreadDemos
* @description: 可重入锁比synchronized厉害的点
* 可以设置公平锁和非公平锁
* 公平锁:线程先进入等待队列FIFO执行。
* 非公平锁:就是抢锁
* @author: 老马
* @create: 2021-01-... |
Java | UTF-8 | 579 | 2.421875 | 2 | [] | no_license | package org.ternlang.compile;
import junit.framework.TestCase;
public class PackageTest extends TestCase {
public void testPackage() throws Exception {
// create a package object for java.lang package
Package pack1 = Package.getPackage("java.lang");
Package pack2 = Package.getPacka... |
Java | UTF-8 | 2,468 | 2.078125 | 2 | [] | no_license | package com.ex.controller.core_controller.CoremutualReferringController;
import com.ex.service.MerchantElectService;
import com.ex.util.JsonView;
import com.ex.util.PageRequest;
import com.ex.vo.MerchantCoreVo;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import... |
JavaScript | UTF-8 | 49,389 | 2.78125 | 3 | [] | no_license | describe("The 6502 CPU", function(){
var regPC = 0, regA = 0, regX = 1, regY = 2, regP = 3,
regSP = 4;
var INTERRUPT_NONE = 0, INTERRUPT_IRQ = 1,
INTERRUPT_NMI = 2, INTERRUPT_RESET = 3;
var cpu = new NEScript.CPU();
describe("with basic functionality", function(){
it("can report its internal state", fu... |
C# | UTF-8 | 1,952 | 3.078125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
namespace Bearded.TD.Game.Generation.Semantic.Fitness;
static partial class FitnessFunction
{
public static FitnessFunction<T> From<T>(params FitnessFunction<T>[] functions)
{
retu... |
Ruby | UTF-8 | 220 | 3.171875 | 3 | [] | no_license | require "movie"
class RegularMovie < Movie
def price(days_rented)
amount = 2
if days_rented > 2
amount += (days_rented - 2) * 1.5
end
amount
end
def points(days_rented)
1
end
end |
Java | UTF-8 | 1,544 | 3.421875 | 3 | [] | no_license | package com.javarush.task.task30.task3009;
import java.math.BigInteger;
import java.util.*;
/*
Палиндром?
*/
public class Solution {
public static void main(String[] args) {
System.out.println(getRadix("112")); //expected output: [3, 27, 13, 15]
System.out.println(getRadix("123")); ... |
Markdown | UTF-8 | 8,056 | 2.9375 | 3 | [] | no_license | # Configure Pydantic schemas and User model
Now it is time to get more serious stuff.
We need proper User model, proper Pydantic schemas and simple endpoint to test our work.
I have adopted, changed the code from [Designing a robust User Model](https://www.jeffastor.com/blog/designing-a-robust-user-model-in-a-fastapi... |
JavaScript | UTF-8 | 1,300 | 2.625 | 3 | [] | no_license | import {createSlice} from "@reduxjs/toolkit";
const slice = createSlice({
name: 'degree',
initialState: {
degrees: [
{id: 1, name: 'Junior', bonus: 10},
{id: 2, name: 'Middle', bonus: 15},
{id: 3, name: 'Senior', bonus: 30}
]
},
reducers: {
ad... |
TypeScript | UTF-8 | 278 | 2.90625 | 3 | [] | no_license | export class Meeting {
title: string;
speaker: string;
date: Date;
active: boolean;
constructor({title = '', speaker = '', date = new Date(), active = true}) {
this.title = title;
this.speaker = speaker;
this.date = date;
this.active = active;
}
}
|
Python | UTF-8 | 1,876 | 3.359375 | 3 | [] | no_license | from selenium import webdriver
from collections import namedtuple
from pprint import pprint
class Cult:
def __init__(self, driver):
self.driver = driver
self.url = 'http://www.cultcampinas.com.br'
self.box = 'eventbox' #class
self.type ='typeEventBox'#class
self.title_box = ... |
C | UTF-8 | 1,977 | 2.671875 | 3 | [] | no_license | #include"oddEven.decl.h"
int numelements;
CProxy_Main mainproxy;
CProxy_Worker workerarray;
class myMsg: public CMessage_myMsg {
public:
int val;
};
class Main: public CBase_Main {
public:
Main(CkArgMsg* msg) {
if(msg->argc !=2 ) {
CkExit();
}
numelements = atoi(msg->argv[1])... |
Java | UTF-8 | 25,912 | 1.898438 | 2 | [
"Apache-2.0"
] | permissive | /*
* 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
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
SQL | UTF-8 | 177 | 2.890625 | 3 | [] | no_license | SELECT
Citizenship, Alignment,
COUNT(*) AS `Frequency`
FROM
Heros
WHERE
Citizenship != "" AND Alignment != ""
GROUP BY
Citizenship, Alignment
ORDER BY
Frequency DESC |
Java | UTF-8 | 4,927 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | package lang.celadon;
import squidpony.squidmath.CrossHash;
import java.util.Objects;
/**
* Indirection cell; has a name that may be used to look it up, and any Object for a value.
* Created by Tommy Ettinger on 8/20/2017.
*/
public class Cel {
public String title;
public Object ref;
public Cel() {
... |
JavaScript | UTF-8 | 1,244 | 2.578125 | 3 | [] | no_license | const Todo = require('../models/todo');
const todoController = {};
// to show all todo items
todoController.index = function (req, res) {
Todo.findAll()
.then(function(todos) {
res.render('todo/index', {
message: 'ok',
data: todos,
});
}).catch(function(err){
console.log(err);
res.stat... |
Markdown | UTF-8 | 1,150 | 2.96875 | 3 | [] | no_license | # tictactoe-console
C++ Console Tictactoe
Xây dựng game cờ caro với những chức năng cơ bản trên giao diện Console.
Luật chơi: Hai bên lần lượt thay phiên nhau đặt những nước đi bằng các dấu X, O trên bàn cờ. Bên nào có năm quân liền nhau mà không có quân khác chặn liền hai đầu trên một trong các hàng dọc, hàng ... |
Java | UTF-8 | 3,574 | 1.867188 | 2 | [
"Apache-2.0"
] | permissive | package sk.henrichg.phoneprofilesplus;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.nfc.NfcAdapter;
public class NFCStateChangedBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent inte... |
JavaScript | UTF-8 | 915 | 2.640625 | 3 | [] | no_license | $(document).ready(function(){
$("#form").on('submit', function(event){
var text = $("#content").val();
event.preventDefault();
$(".list").prepend(
'<div class="tweet">'
+'<div class="cross">'
+'<a href="#" class="remove"><span class="glyphicon glyphicon-remove"></span></a>'
+'</div>'
+'<div class=... |
Markdown | UTF-8 | 1,995 | 2.609375 | 3 | [
"MIT"
] | permissive | 'openEyeTrack - An open source high-speed eyetracker'. https://open-neuroscience.com/post/openeyetrack_an_open_source_high_speed_eyetracker/
Vision is one of the primary senses, and tracking eye gaze can offer insight into the cue #Software#Hardware#Behaviour#Computers ...
s that affect decision-making behavior. Thus, ... |
Markdown | UTF-8 | 779 | 2.515625 | 3 | [] | no_license | # FreshAir 🌬️
A simple React Native application integrating the [Breezeometer](https://breezometer.com/) api.
## Usage
To run this app on your own machine (assuming macOS):
_note: you must have cocoapods and npm installed on your machine to install FreshAir's dependencies_
### Clone the Repo
```
$ git clone http... |
PHP | UTF-8 | 868 | 2.578125 | 3 | [] | no_license | <?php
namespace Landers\Wechat;
/*二维码接口*/
class WechatQRCode {
use WechatToken;
/*实例化构造方法*/
function __construct($appid, $appsecret) {
$this->appid = $appid;
$this->appsecret = $appsecret;
}
public function getTicket($scene_id, $action_name = 'QR_LIMIT_SCENE', $expire_seconds = 0... |
Rust | UTF-8 | 6,170 | 2.71875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | use alloc::Vec;
use lcd::{HEIGHT, WIDTH};
use racket::RACKET_WIDTH;
const BALL_MAX_SPEED: i16 = 20;
const BALL_MIN_SPEED: i16 = 10;
pub const STATE_RUNNING: u8 = 0;
pub const STATE_WON_PLAYER_1: u8 = 100;
pub const STATE_WON_PLAYER_2: u8 = 101;
#[derive(Debug, Copy, Clone)]
pub struct GamestatePacket {
pub racke... |
JavaScript | UTF-8 | 1,276 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
class Counter extends Component {
styles = {
fontSize: 15,
fontStyle: 'bold',
}
componentWillUnmount() {
console.log('Counter - Unmount');
}
renderTags() {
const { tags } = this.state;
if (!tags.length) return <p>Th... |
JavaScript | UTF-8 | 371 | 4.09375 | 4 | [] | no_license | // const getRandomNumber = function (limit) {
// let random = Math.random() * limit;
// return Math.ceil(random)
// }
// console.log(getRandomNumber(100));
//Arrow Funtion = () => {}
const getRandomNumber = limit =>
Math.ceil(Math.random() * limit);
console.log(getRandomNumber(100));
//ES5
// function(ar... |
JavaScript | UTF-8 | 709 | 3.1875 | 3 | [] | no_license | function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(12);
}
function draw() {
background(0, 25);
rectMode(CENTER);
// Red Rectangle: Translate then rotate
push();
translate(width / 2, height / 2);
// TODO: Translate to the center of canvas
rotate(radians(frameCount));
// TODO: Ro... |
Markdown | UTF-8 | 1,229 | 4.03125 | 4 | [] | no_license | ## 700. Search in a Binary Search Tree
### Information
* TIME: 2019/10/03
* LINK: [Click Here](https://leetcode-cn.com/problems/search-in-a-binary-search-tree/)
* TAG: `BST`
### Description
> 给定二叉搜索树(BST)的根节点和一个值。 你需要在BST中找到节点值等于给定值的节点。 返回以该节点为根的子树。 如果节点不存在,则返回 NULL。
### Example
```text
给定二叉搜索树:
4
/ ... |
C++ | UTF-8 | 1,984 | 3.03125 | 3 | [] | no_license | /*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
Rust | UTF-8 | 16,844 | 2.78125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | use crate::common::{
OutputFormat, ProfanityOption, PropertyCollection, PropertyId, ServicePropertyChannel,
};
use crate::error::{convert_err, Result};
use crate::ffi::{
speech_config_from_authorization_token, speech_config_from_endpoint, speech_config_from_host,
speech_config_from_subscription, speech_conf... |
C++ | SHIFT_JIS | 1,171 | 2.796875 | 3 | [
"MIT"
] | permissive | /*
360 == IDENOM * 4
*/
#include "all.h"
/*
Sine90.txt
0 ` 90 (IDENOM + 1) -> sin(0 ` IDENOM) * IMAX
*/
static autoList<int> *GetSine90(void)
{
static autoList<int> *sine90;
if(!sine90)
{
autoList<uchar> *fileData = GetEtcRes()->GetHandle(ETC_SINE90TXT);
int rIndex = 0;
sine90 = new autoList<int>();
... |
Markdown | UTF-8 | 729 | 2.984375 | 3 | [] | no_license | # 服务器的安全问题
## ssh登录
黑客会通过扫描服务器常见的ssh端口(22),并试图以一些常见的帐号名登录如:root, alex, user等等,然后通过暴力破解密码的方式入侵系统。
了解了这一点之后,我们就可以从以下几个方面防范这种攻击方式
1. 更改ssh默认端口,可以改为不常见的端口,使得黑客更难扫描到
2. 禁止root通过ssh登录,这样黑客只能通过普通用户身份登录,权限更小
3. 设置复杂的用户名,更难尝试到
4. 设置复杂的密码
5. 使用私钥-公钥方式免密登录,这时就可以禁止ssh密码登录,更加安全。
## 查看日志
/var/log/auth.lo... |
Java | UTF-8 | 714 | 2.84375 | 3 | [] | no_license |
public class RecordLabel{
private String labelName;
private float established;
public RecordLabel(String initName, float initEstablished){
labelName = initName;
established = initEstablished;
}
/**
* @return the labelName
*/
public String getLabelName() {
return labelName;
}
... |
C# | UTF-8 | 1,226 | 2.59375 | 3 | [
"MIT"
] | permissive | using MiniBus.Contracts;
using System;
using System.Collections.Generic;
using System.Messaging;
namespace MiniBus.Tests.Fakes
{
public sealed class FakeValidMessageQueue : IMessageQueue
{
public void Add(Message message)
{
_messages.Add(message);
}
p... |
Java | UTF-8 | 1,213 | 2.84375 | 3 | [] | no_license | import java.io.*;
import java.util.*;
import java.net.*;
import java.sql.*;
public class ServerThreads extends Thread{
private Socket socket;
public ServerThreads(Socket socket){
this.socket=socket;
}
public void run(){
try{
ObjectOutputStream outStream = new ObjectOutputStr... |
Shell | UTF-8 | 344 | 2.65625 | 3 | [] | no_license | #!/bin/sh
if test -x "runtime/jre1.8.0_172/bin/java"; then
JAVA="runtime/jre1.8.0_172/bin/java"
elif test -x "../runtime/jre1.8.0_172/bin/java"; then
JAVA="../runtime/jre1.8.0_172/bin/java"
else
JAVA="java"
fi
"$JAVA" -classpath patcher.jar:javassist.jar org.gotti.wurmunlimited.patcher.PatchServerJar
chmod a+x Wur... |
JavaScript | UTF-8 | 11,966 | 2.546875 | 3 | [] | no_license | $(document).ready(function () {
if ($("#observacaoAluno").val() != "" && $("#observacaoAluno").val() != undefined) {
$("#observacaoAluno").val(unescape($("#observacaoAluno").val()));
}
});
function deletarAluno(idAluno) {
swal({
title: "Excluir Aluno",
text: "Confirma a exclusão do aluno?",
icon: "warnin... |
C++ | GB18030 | 1,606 | 3.390625 | 3 | [] | no_license | //#define Zconvert
#ifdef Zconvert
/*
* @lc app=leetcode.cn id=6 lang=cpp
*
* һַݸԴ¡ҽ Z С
* ַΪ "LEETCODEISHIRING" Ϊ 3 ʱ£
L C I R
E T O E S I I G
E D H N
֮Ҫжȡһµַ磺"LCIRETOESIIGEDHN"
ʵַָ任ĺ
* [6] Z α任
*/
/*
1158/1158 cases passed (16 ms)
Your runtime beats 72.09 % of cpp submissions
Your me... |
C# | UTF-8 | 2,857 | 3.265625 | 3 | [
"MIT"
] | permissive | using System.Net;
namespace VisualTraceRoute.Net
{
/// <summary>
/// Trace route hop.
/// </summary>
public class Hop
{
private IPAddress _address;
private int _hop;
private long _roundTrip;
/// <summary>
/// Gets the Internet address in stand... |
C++ | UTF-8 | 2,806 | 3.984375 | 4 | [] | no_license | //============================================================================
// Name : Red_Yellow_GreenGame.cpp
// Author : Christian Aguilar
// Version :
// Copyright : Feb 2015
// Description : Red Yellow Green Game, The color game that uses vectors
//classes and operator digit spits. Function... |
Java | UTF-8 | 1,033 | 1.882813 | 2 | [] | no_license | package com.cloud.service;
import com.cloud.service.impl.PaymentServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.spring... |
C# | UTF-8 | 1,054 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Temporizador
{
public partial class Form1 : Form
{
public Form1()
{
... |
Java | ISO-8859-1 | 611 | 2.03125 | 2 | [] | no_license | package com.haylton.estudo.dao;
import java.io.Serializable;
import com.haylton.estudo.model.Item;
public class ItemDAO<T> extends DAOGenerico<Item> implements Serializable {
public ItemDAO() {
super();//chamo o construtor de DAOGenerico para inicializar a entityManager EM
classePersistente = Item.class;//cla... |
Java | UTF-8 | 8,156 | 1.929688 | 2 | [] | no_license | package grl.com.adapters.donate;
import android.app.Activity;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.koushikdutta.async.http.BasicNameValuePair;... |
C++ | ISO-8859-1 | 2,417 | 3.515625 | 4 | [] | no_license | //Uma empresa de fornecimento de energia eltrica faz a leitura mensal dos medidores de consumo. Para cada consumidor so digitados os seguintes dados:
//nmero do consumidor, quantidade de kwh consumidos durante o ms e o tipo (cdigo) do consumidor (1residencial, 2-comercial, 3-industrial)
//Residencial - preo em reais... |
Python | UTF-8 | 123 | 3.15625 | 3 | [] | no_license | def t(x):
y=list(x)
y.reverse()
x=tuple(y)
return x
print(t((5, 3, 2)))
print(t(('Hi', 'Ola', 'xD'))) |
C++ | UTF-8 | 822 | 2.90625 | 3 | [] | no_license | //Giả sử lãi suất mỗi tháng của ngân hàng là q (ví dụ nếu lãi suất 1% thì q = 0.01) với hình thức gửi tiết kiệm lãi nhập vốn (lãi kép).
//Hãy nhập vào số tiền gửi M, số tháng gửi n và lãi suất q, tính số tiền lãi.
#include <iostream>
using namespace std;
#include <math.h>
int main()
{
double laiSuat;
double ti... |
C++ | UTF-8 | 1,614 | 3.375 | 3 | [] | no_license | /*!< UVA 10664 */
/*!< Programacao Dinamica */
#include <stdio.h>
#include <iostream>
using namespace std;
#define MAX_AMOUNT_SUITCASES 20
/*!< Returns true if there is a subet o set[] of size n with sum equal to given sum */
bool weighted_subset_sum(int set[], int n, int sum) {
bool MEMO[n + 1][sum + 1];
... |
Java | UTF-8 | 1,691 | 3.390625 | 3 | [] | no_license | package H10;
//opdracht 10.1 en 10.2
/**
* Created by HP on 28-9-2016.
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Groter_Kleiner extends Applet {
TextField tekstvak;
TextField tekstvak1;
Label label;
Button o... |
PHP | UTF-8 | 2,197 | 2.546875 | 3 | [] | no_license | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LİSTE</title>
</head>
<body>
<table border="1" align="center">
<tr><t... |
Python | UTF-8 | 444 | 3.34375 | 3 | [] | no_license | #!/usr/bin/env python3
def sheep(n):
if n == 0:
return "INSOMNIA"
k = n
digits = set(str(n))
while len(digits) != 10:
k += n
digits = digits.union(str(k))
return k
with open('A-large.in', 'r') as infile:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.