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 | 1,595 | 3.03125 | 3 | [] | no_license | //利用并查集来实现判断鸟是否在同一棵树上
//利用exist[MAX_N]来存储家鸟是否存在
//利用cnt[MAX_N]来进行计数的操作
#include<cstdio>
using namespace std;
#define MAX_N 10010
int par[MAX_N]={0};
int exist[MAX_N]={0};
int cnt[MAX_N]={0};
int findfather(int x)
{
int a=x;
//进行查找
while(x!=par[x])
x=par[x];
//路径压缩
while(a!=par[a])
{
... |
C++ | UTF-8 | 5,658 | 3.234375 | 3 | [] | no_license | //
// Created by maria on 12.10.16.
//
#ifndef PERSISTENT_SET_PERSISTENT_SET_H
#define PERSISTENT_SET_PERSISTENT_SET_H
#include <sys/param.h>
#include <cstdint>
#include <utility>
#include <cstdlib>
#include <stack>
#include <memory>
struct persistent_set
{
// Вы можете определить этот тайпдеф по вашему усмотрен... |
JavaScript | UTF-8 | 3,368 | 2.78125 | 3 | [] | no_license | function Matrix4x4(cells)
{
this.m = cells;
}
Matrix4x4.identity = function()
{
return new Matrix4x4(
[
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
]);
}
Matrix4x4.translation = function(x, y, z)
{
return new Matrix4x4(
[
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[x, y, z, 1]
]);
}... |
Java | UTF-8 | 571 | 1.867188 | 2 | [] | no_license | package com.kevin.mvc.dto;
import java.math.BigDecimal;
import java.util.List;
import javax.validation.constraints.NotBlank;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class ProjectDto {
private Long id;
private String name;
private String type;
private Sponsor sponsor;
priva... |
Python | UTF-8 | 1,141 | 2.65625 | 3 | [] | no_license | __author__ = 'ebrecht'
try:
import ujson as json
except:
import json
try:
import utime as time
except:
import time
try:
import urllib.urequest as urllibreq
except:
import urllib.request as urllibreq
def get_time_zone(time_s, longitude=10.900556, latitude=48.338056):
try:
url = 'ht... |
TypeScript | UTF-8 | 1,946 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | import { Comparer, momentAscComparer } from "common";
import { Moment } from "moment-timezone";
import { IEvent } from "./IEvent";
import { Event } from "./Event";
export class EventOccurrence implements IEvent {
public static readonly StartAscComparer: Comparer<EventOccurrence> = (a, b) => momentAscComparer(a.sta... |
C++ | UTF-8 | 353 | 2.6875 | 3 | [] | no_license |
#ifndef QUADRILATERAL_H
#define QUADRILATERAL_H
#include <iostream>
using namespace std;
class Quadrilateral {
public:
Quadrilateral();
Quadrilateral(const Quadrilateral& orig);
virtual ~Quadrilateral();
virtual float getArea() = 0;
virtual float getPerimetre() = 0;
virtual void print();... |
Java | UTF-8 | 9,912 | 2.65625 | 3 | [] | no_license | package handin.sequencer;
import handin.events.*;
import javax.swing.*;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.SocketException;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.concurrent.BlockingQueue;
import java.util.concurre... |
Markdown | UTF-8 | 6,059 | 3.34375 | 3 | [
"MIT"
] | permissive | ---
sidebarDepth: 3
---
# Typo tolerance
Typo tolerance helps users find relevant results even when their search queries contain spelling mistakes or typos, for example, typing `phnoe` instead of `phone`. You can [configure the typo tolerance feature for each index](/reference/api/settings#update-typo-tolerance-setti... |
C# | UTF-8 | 1,260 | 2.578125 | 3 | [] | no_license | using Microsoft.AspNetCore.Components;
using RazorComponentsTest.App.Services;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace RazorComponentsTest.App.Pages
{
public class FetchDataComponent : ComponentBase, IDisposable
{
internal List<Weather... |
C++ | UTF-8 | 2,648 | 3 | 3 | [
"Apache-2.0"
] | permissive | #include "Graph.h"
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE GraphTestSuite
#include <boost/test/unit_test.hpp>
#include <boost/assign/std/vector.hpp>
#include <boost/assign/list_of.hpp>
#include <ctime>
BOOST_AUTO_TEST_SUITE(GraphTestSuite)
void checkForValidSequence()
{
AlfaTest::Graph graph;
... |
Java | UTF-8 | 1,120 | 3.265625 | 3 | [] | no_license | package references.socialnetwork;
import java.util.ArrayList;
import java.util.List;
public class SocialNetwork {
private List<Member> members = new ArrayList<>();
public void addMember(String name) {
members.add(new Member(name));
}
private Member findByName(String name) {
Member me... |
Python | UTF-8 | 900 | 2.625 | 3 | [] | no_license | def getting_list_undo(l, l_back):
l_back.append("sep")
l_back.extend(l)
return l_back
def del_sep(l_back):
i = len(l_back) - 1
j = i
ok = 0
while i >= 0:
if l_back[i] == "sep":
ok = 1
break
i -= 1
k = j - i
while k >= 0 and len(... |
Java | UTF-8 | 1,596 | 2.25 | 2 | [] | no_license | package com.bosha.common.api.dto.market;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsCons... |
Markdown | UTF-8 | 2,988 | 2.953125 | 3 | [
"MIT"
] | permissive | # Eau Claire's Salon
#### A website to track salon stylists and their clients, 18-Oct-2019
#### By **Christine Frank**
## Description
This is a MVC website created to allow a business owner to track stylists and their clients. The user can add new stylists, view existing stylists, and see their clients. The user ca... |
Java | UTF-8 | 2,253 | 2.359375 | 2 | [] | no_license | package bussy.ui.controller.test;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.List;
import java.util.Map;
import bussy.model.Linea;
import bussy.persistence.BadF... |
C++ | GB18030 | 1,073 | 2.75 | 3 | [] | no_license | #include "stdafx.h"
#include "Commander.h"
#include <string>
#include <map>
#include <fstream>
using namespace std;
int Commander::load_setting()
{
char buf[1024]; //ʱȡļ
string message;
ifstream infile;
infile.open(".//trmlt.txt");
if (infile.is_open()) //ļɹ,˵д
{
... |
JavaScript | UTF-8 | 139 | 2.515625 | 3 | [] | no_license | function Ordenarpalavra(palavra){
return palavra.toString().split('').sort().join('');
}
console.log(Ordenarpalavra("camila")); |
Markdown | UTF-8 | 900 | 2.65625 | 3 | [
"MIT"
] | permissive | # Employee Tracker
[](https://opensource.org/licenses/MIT)
## Description
This app allows the user to track employees within an organization. Employees can be added and assigned to roles. Roles can be updated and are organized within departments.
#... |
PHP | UTF-8 | 565 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
/**
* @package REServe
*/
class REServeBasicType extends Object {
public function needsReServeConnection (){
return FALSE;
}
public function asSqlValueStringFor($aThing){
//$this->error("\"$aThing\"");
return "\"".addslashes($aThing)."\"";
}
public function fromSqlValueString($aString){
retur... |
C++ | UTF-8 | 280 | 2.84375 | 3 | [] | no_license | /* Your code here! */
#ifndef DSETS
#define DSETS
#include <vector>
using namespace std;
class DisjointSets
{
public:
void addelements(int num);
int find(int elem);
void setunion(int a, int b);
int operator[](int elem);
private:
vector<int> nodes;
};
#endif
|
PHP | UTF-8 | 1,410 | 2.546875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | <?php
require_once("../scripts/config.php");
require_once("../scripts/functions.php");
if(connection());
$today = date("Y-m-d");
$categories = MysqlSelectQuery("select * from categories order by category_name");
$total_item = NUM_ROWS($categories);
$colSize = 11;
$column ... |
Java | UTF-8 | 441 | 2.703125 | 3 | [] | no_license | package vaportree;
import vaporprintvisitor.PrinterVisitor;
public class VaporIntegerLiteral extends Operand {
public String int_string;
public VaporIntegerLiteral(){}
public VaporIntegerLiteral(String string)
{
int_string = string;
}
public Integer toInt()
{
return Intege... |
PHP | UTF-8 | 4,388 | 2.796875 | 3 | [] | no_license | <?php
namespace SkoobyBot\Commands;
use SkoobyBot\Database;
use SkoobyBot\Languages\Language;
use Telegram\Bot\Exceptions\TelegramSDKException;
abstract class BaseCommand
{
private $logger = null;
private $api = null;
private $database = null;
private $language = null;
private $isCron = false;
... |
TypeScript | UTF-8 | 1,513 | 3.21875 | 3 | [
"MIT"
] | permissive | import type { PromiseFN } from './interfaces';
export interface AsyncPoolOption {
/**
* 最大同时执行异步任务
*/
maxConcurrency: number;
}
export interface AsyncPoolExecutorOpts {
/**
* 下一次优先执行
* @default false
*/
isPriority?: boolean;
}
/**
* 异步池,放入需要执行的异步任务,总并行执行任务不超过设置的最大并发数量
* @param option
* @cat... |
Python | UTF-8 | 1,122 | 3.5625 | 4 | [] | no_license | class Solution:
# @param A : tuple of integers
# @param B : integer
# @return a list of integers
def searchRange(self, A, B):
index1 = -1
index2 = -1
start = 0
final = len(A)-1
mid = (start + final) // 2
while start <= final:
if A[mid] == ... |
C# | UTF-8 | 2,507 | 2.734375 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public struct DoorStruct
{
public string m_DoorName;
public bool m_Open;
public GameObject m_Door;
public Transform m_DoorClosed;
public Transform m_DoorOpen;
}
public class DoorController : Mono... |
Markdown | UTF-8 | 2,404 | 2.5625 | 3 | [
"MIT"
] | permissive | ---
title: 'Aktualizacja AFE T5 z wersji 2.0.x do 2.2.x'
recaptchacontact:
enabled: false
---
AFE Firmware T5 2.2.x dostępne jest w dwóch wersjach jeśli chodzi o rozmiar pamięci Flash ESP8266
* 1Mb
* 4Mb
AFE Firmware T5 4Mb dodatkowo zawiera obsługę czujników
* Bosch z serii BMx80 oraz
* czujnika natężenia światł... |
C++ | UTF-8 | 952 | 2.75 | 3 | [] | no_license |
int main(void)
{
int n;
double a, b, c, delta, x1, x2, img, rl;
cin >>n;
for (int i = 1; i <= n; i++)
{
cin >> a >> b >> c;
delta = b * b - 4 * a * c;
if (delta > 0)
{
x1 = (-b + sqrt(delta))/(2 * a);
x2 = (-b - sqrt(delta))/(2 * a);
cout << fixed << setprecision(5) << "x1=" << x1 <... |
C++ | UTF-8 | 282 | 3.125 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
int M(int, int);
int main()
{
int a, b;
scanf("%d,%d", &a, &b);
printf("%d", M(a, b));
return 0;
}
int M(int x, int y)
{
if (x == 0 || y == 0)
return 0;
else if (x > 0)
return M(x - 1, y) + y;
else if (y > 0)
return M(x, y - 1) + x;
} |
Java | UTF-8 | 4,472 | 2.03125 | 2 | [] | no_license | package xyz.android.amrro.recipes;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.OnLifecycleEvent;
import android.content.Context;
import android.net.Uri;
import android.support.annotation.NonNull;
import com.google.android.exoplayer2.DefaultLo... |
Markdown | UTF-8 | 3,220 | 3.546875 | 4 | [] | no_license | # Pewlett-Hackard-Analysis
## Overview of the Analysis
### Basic Tools
This project uses PostgreSQL server and pgAdmin management platform to create schema and run queries. When there are large amount of data that excel or python fails to process, databases come in handy. With relationship database, tables of data ca... |
Java | UTF-8 | 759 | 1.609375 | 2 | [] | no_license | package Tests;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import BaseTester.BaseTesterClass;
import Pages.FileManagerPage;
import Pages.FileManagerViewPage;... |
C# | UTF-8 | 4,491 | 3.46875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace ChallengesWithTestsMark8
{
public class ChallengesSet04
{
public int AddEvenSubtractOdd(int[] numbers)
{
var odds = new List<int>();
var evens = new List<int>();
... |
Java | UTF-8 | 6,340 | 1.992188 | 2 | [] | no_license | package com.example.ferreteriaapp.principal.listelos;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.lifecycle... |
PHP | UTF-8 | 9,605 | 2.578125 | 3 | [] | no_license | <?php
namespace C\Controller;
use C\Model\Chiller;
use C\Model\Chiller\Friends;
use Doctrine\DBAL\Connection;
use Pimple\Container;
use Silex\Application;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception;
use Symfony\Component\Routin... |
JavaScript | UTF-8 | 4,934 | 3.75 | 4 | [] | no_license | function init() {
console.log("in init function");
canvas = document.getElementById('mycanvas');
W = canvas.width = 700;
H = canvas.height = 700;
//current size of the array(snake)
pen = canvas.getContext('2d');
cs = 40;
score = 5;
gameover = false;
//create an image object... |
SQL | UTF-8 | 627 | 3.984375 | 4 | [] | no_license | CREATE DATABASE pokemon_go;
USE pokemon_go;
CREATE TABLE pokemon (
id INT NOT NULL AUTO_INCREMENT,
nome VARCHAR(255) NOT NULL,
PRIMARY KEY(id)
);
ALTER TABLE pokemon
ADD UNIQUE INDEX `ui_pokemon` (nome);
CREATE TABLE pokemon_color (
id INT NOT NULL AUTO_INCREMENT,
rgb VARCHAR... |
Java | UTF-8 | 14,758 | 1.890625 | 2 | [] | no_license | package com.apptech.first.server.service;
import java.io.FileInputStream;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import javax.jw... |
Markdown | UTF-8 | 2,062 | 2.859375 | 3 | [] | no_license |
# THome
THome is a static minimal personal dashboard made for local use, except its a bit easier to maintain and update it using python
I just wanted to make my own dashboard for my homelab and used the things i know to put it together as simple as i can
# Features
- simple design
- responsive, works great on PC, ta... |
Java | UTF-8 | 179 | 2.4375 | 2 | [] | no_license | package MidtermProblems;
public class Staff extends Employee {
String title;
@Override
public String toString() {
return this.getClass().getName() + name;
}
}
|
Java | UTF-8 | 395 | 1.773438 | 2 | [] | no_license | package com.example.csv.service;
import com.example.csv.service.dto.SalesOrderDTO;
import com.example.csv.utils.ResultList;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@Service
public interface SalesOrderService {
void save(MultipartFile file);
Resu... |
Ruby | UTF-8 | 1,341 | 2.6875 | 3 | [
"MIT"
] | permissive | module HrrRbSftp
class Protocol
module Common
module DataTypes
#
# This module provides methods to convert ::Integer value and 64-bit unsigned binary string each other.
#
module Uint64
#
# Convert ::Integer value into 64-bit unsigned binary string.
... |
JavaScript | UTF-8 | 781 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | /**
* Define jQuery plugins within this scope.
*/
(function ($) {
/**
* This should be used instead of calling bootstrap's modal() jQuery
* method directly. This unbinds all previous events from the dialog,
* then calls modal on it and binds the bootstrap close events.
* @param view The view ... |
Java | UTF-8 | 672 | 1.867188 | 2 | [] | no_license | package com.example.gatewaydemo.feigh;
import feign.Param;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;
/**
* @author 刘亚林
* @description
* @create 2020/4/8 11:15
**/
@FeignClient(name = "ws-service",fallback = TestFeignFallBack.class)
public interface TestlFeignClient {
/... |
Python | UTF-8 | 1,550 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | import rospy
import socket
from tcp_endpoint.RosTCPClientThread import ClientThread
from tcp_endpoint.msg import RosUnityError
class UnityTCPSender:
"""
Connects and sends messages to the server on the Unity side.
"""
def __init__(self, unity_ip, unity_port):
self.unity_ip = unity_ip
se... |
Markdown | UTF-8 | 3,675 | 3.09375 | 3 | [
"MIT",
"CC-BY-NC-ND-4.0",
"CC-BY-NC-SA-4.0",
"LicenseRef-scancode-proprietary-license",
"CC-BY-NC-4.0",
"LicenseRef-scancode-other-copyleft",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # Druid
Druid 单词来源于西方古罗马的神话人物,中文常常翻译成德鲁伊。Druid 是一个分布式的支持实时分析的数据存储系统(Data Store)。美国广告技术公司 MetaMarkets 于 2011 年创建了 Druid 项目,并且于 2012 年晚期开源了 Druid 项目。Druid 设计之初的想法就是为分析而生,它在处理数据的规模、数据处理的实时性方面,比传统的 OLAP 系统有了显著的性能改进,而且拥抱主流的开源生态,包括 Hadoop 等。多年以来,Druid 一直是非常活跃的开源项目。
# 背景分析
## 设计原则
在设计之初,开发人员确定了三个设计原则(Design Principle)。
-... |
Java | UTF-8 | 384 | 3.203125 | 3 | [] | no_license | import java.util.Locale;
import java.util.Scanner;
public class Main4 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Locale.setDefault(Locale.US);
double x, y, z, med;
x = sc.nextDouble();
y = sc.nextDouble();
z = sc.nextDouble();
med = (x*2+y*3+z*5)/10;
S... |
Java | UTF-8 | 1,296 | 2.09375 | 2 | [] | no_license | package com.bohua.bianlidian.model;
import java.util.Date;
public class ItemsCategory {
private Integer id;
private String name;
private String description;
private String imgUrl;
private String createBy;
private Date createDate;
private String updateBy;
private Date updateDate;
public Integer getId() {
r... |
Python | UTF-8 | 2,013 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python
from optparse import OptionParser
import sys
import os
if __name__ == '__main__':
parser = OptionParser(usage='%(prog)s <image pattern>')
opt, args = parser.parse_args()
if len(args) != 1:
parser.print_help()
print('Need image filename pattern (including %(raft)s an... |
Java | UTF-8 | 3,868 | 3.53125 | 4 | [] | no_license | import java.util.Iterator;
import java.util.NoSuchElementException;
public class RandomizedQueue<Item> implements Iterable<Item> {
private int count = 0;
private Item[] Bag;
public RandomizedQueue() // construct an empty randomized queue
{
Bag = (Item[]) new Object[2];
}
private void e... |
Python | UTF-8 | 23,204 | 3.515625 | 4 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import random
import seaborn as sns
import sklearn
from sklearn.model_selection import train_test_split
import math
import scipy as stats
#######################################################################... |
Markdown | UTF-8 | 1,751 | 3.765625 | 4 | [] | no_license | # The andela-labs2 repository
This contains two files the following files.
### The car_oop.py
This contains a class Car with different attributes like:
* name of car
* model of car
* type of car
* number of wheels that a car has
* number of doors that a car has
... |
Java | UTF-8 | 1,580 | 2.078125 | 2 | [] | no_license | package com.cn.goldenjobs.ui.activity.tabhost;
import com.cn.goldenjobs.R;
import com.cn.goldenjobs.ui.fragment.ExampleFragment;
/**
* 地步导航条的Item
* Created by liu-feng on 2016/7/13.
* 邮箱:w710989327@foxmail.com
* https://github.com/Unlm
*/
public enum Table {
MODULE(0, R.string.tab_name_module, R.drawable.se... |
JavaScript | UTF-8 | 3,327 | 3.359375 | 3 | [] | no_license | // Input data should look like:
// {
// tweets: [
// {
// id: "asdasd",
// text: "i love israel"
// },
// {
// id: "asdcascasv",
// text: "bomb israel"
// }
// ]
// }
// Output data should look like:
// {
// tweets: [
// {
// id: "asdasd",
// tag: "1.0"
// ... |
JavaScript | UTF-8 | 16,956 | 2.546875 | 3 | [
"MIT"
] | permissive | "use strict";
/*global alert: true, console: true, warn: true, getModuleName */
// getModuleName() is defined in this file, but it is listed as a global so it can be used
// to initialize moduleName at the top, to keep all global vars together
// Define the console object if it doesn't exist to support IE witho... |
TypeScript | UTF-8 | 3,593 | 3 | 3 | [
"LicenseRef-scancode-generic-cla",
"MIT"
] | permissive | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import {
AccessToken,
NamedKeyCredential,
SASCredential,
isNamedKeyCredential,
isSASCredential,
} from "@azure/core-auth";
import { signString } from "../util/hmacSha256";
/**
* A SasTokenProvider provides an alternative to TokenCre... |
Markdown | UTF-8 | 907 | 2.828125 | 3 | [] | no_license | # singtel-java-test
Answewrs and explanation
1. Can you implement the sing() method for the bird?
a. How did you unit test it?
b. How did you optimize the code for maintainability?
Answers :
Junit with we will verify the Method Executing the
code coverage and main the feature branches for feature w... |
Java | UTF-8 | 2,471 | 2.15625 | 2 | [] | no_license | package com.dci.intellij.dbn.execution.common.message.ui.tree.node;
import com.dci.intellij.dbn.common.ui.tree.TreeEventType;
import com.dci.intellij.dbn.common.ui.tree.TreeUtil;
import com.dci.intellij.dbn.execution.common.message.ui.tree.MessagesTreeBundleNode;
import com.dci.intellij.dbn.execution.compiler.Compiler... |
Python | UTF-8 | 717 | 2.71875 | 3 | [] | no_license | # -*- coding:utf-8 -*-
import hmac
import hashlib
import base64
class six: # or `pip install six` and `import six`
import sys
text_type = str if sys.version_info[0] == 3 else unicode
binary_type = bytes if sys.version_info[0] == 3 else str
def ensure_binary(value):
if isinstance(value, six.text_ty... |
Java | UTF-8 | 1,563 | 2.53125 | 3 | [
"MIT"
] | permissive | package org.xmlet.regexapi;
import java.util.function.Consumer;
public final class ElseExpression<Z extends Element> implements CustomAttributeGroup<ElseExpression<Z>, Z>, TextGroup<ElseExpression<Z>, Z> {
protected final Z parent;
protected final ElementVisitor visitor;
public ElseExpression(ElementVisitor... |
Markdown | UTF-8 | 7,222 | 3.125 | 3 | [] | no_license | ---
title: Are we human?
tags:
- law
- corporations
date: 2017-03-21 06:43:09
categories:
- ethics
layout: post
---
Well, more like, "are *they* human?" This post will be an exploration of corporate personhood.
<!-- MORE -->
The way I see it, corporate personhood or "corporations as people" is the concept tre... |
TypeScript | UTF-8 | 15,463 | 2.546875 | 3 | [
"MIT"
] | permissive | import { TestBed } from '@angular/core/testing';
import { CookieService } from './cookie.service';
import { PLATFORM_ID } from '@angular/core';
import { DOCUMENT, ɵPLATFORM_BROWSER_ID, ɵPLATFORM_SERVER_ID } from '@angular/common';
import SpyInstance = jest.SpyInstance;
describe('NgxCookieServiceService', () => {
let... |
PHP | UTF-8 | 5,756 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Auth;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;
use Laravel\Passport\Client as OClient;
use App\Notifications\VerifyEmail;
class AuthController extends Controller
{
/**
* Log to the system.... |
TypeScript | UTF-8 | 558 | 2.59375 | 3 | [] | no_license | export class User {
userId: number;
name: string;
email: string;
contactNumber: string;
password: string;
accCreatedDate: Date;
constructor(userId?: number, name?: string, email?: string, contactNumber?: string, password?: string,
accCreatedDate?: Date) {
th... |
Markdown | UTF-8 | 1,030 | 2.546875 | 3 | [] | no_license | # Week 6A - Look at Audio Visualizer Prototypes
## I. Overview
- Catch up: the last version of the *Revealing Module Pattern* work we did last time on 5B --> [Demo - Revealing Module Pattern](https://github.com/tonethar/IGME-330-Master/blob/master/notes/demo-revealing-module-pattern.md)
- Look at [Project 1 - Audio Vi... |
TypeScript | UTF-8 | 7,441 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | import { module, test } from 'qunit';
import { createGraph } from 'wherehows-web/tests/helpers/graph-db';
import { set } from '@ember/object';
import GraphDb, { INode } from 'wherehows-web/utils/graph-db';
interface IMockPayload {
someField1: string;
}
const createGraphWithMockPayload = (): {
graphDb: GraphDb<IMo... |
C++ | UTF-8 | 572 | 3.9375 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Arith
{
int a;
int b;
public:
Arith(int x, int y)
{
a = x;
b = y;
}
inline int add()
{
return a + b;
}
inline int sub()
{
return a - b;
}
inline int mul()
{
return a*b;
}
inline int div()
{
return a / b;
}
inline int mod()
{
return a%b;
}
... |
Go | UTF-8 | 1,326 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | package mid
import (
"context"
"expvar"
"log"
"net/http"
"runtime"
"github.com/ardanlabs/service/internal/platform/web"
"go.opencensus.io/trace"
)
// m contains the global program counters for the application.
var m = struct {
gr *expvar.Int
req *expvar.Int
err *expvar.Int
}{
gr: expvar.NewInt("goroutin... |
C++ | UTF-8 | 332 | 2.5625 | 3 | [] | no_license | #pragma once
#include "Record.h"
class IStage
{
private:
Record mRecord;
public:
IStage(void);
~IStage(void);
virtual void Initialize(){}
virtual void Finalize(){}
virtual void Update() =0;
virtual void Draw() =0;
virtual bool IsCleared()=0;
virtual bool IsFailured()=0;
Record* GetRecord() { return &mRe... |
Java | UTF-8 | 1,786 | 2.140625 | 2 | [
"MIT"
] | permissive | package ru.xander.replicator.application.entity;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.scene.image.Image;
import lombok.Data;
import lombok.NoArgsConst... |
Rust | UTF-8 | 1,945 | 3.09375 | 3 | [] | no_license | #[path = "../intcode/mod.rs"]
mod intcode;
use std::cmp::Ordering;
pub fn raw_input() -> String {
include_str!("input.txt").to_string()
}
#[derive(PartialEq)]
pub enum Tile {
Empty,
Wall,
Block,
HorizPaddle,
Ball,
}
pub fn parse_input(input: &str) -> intcode::Intcode {
let insts = input
.split(","... |
Java | UTF-8 | 731 | 1.953125 | 2 | [] | no_license | package com.pgz.utils.translate.annotation;
import com.pgz.utils.translate.constant.IConfig;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.... |
Markdown | UTF-8 | 10,034 | 3.046875 | 3 | [] | no_license | ## 第九章 枫林
真的想不到,在这个等级如此普通的小子身上,居然会有神级套装。虽然无限世界的神和魔神什么的至少有几万个,不过现在套装排行榜上,神级套装可是仅有十几套啊。
可惜,自己虽然有牧神套装,却至今没找到过放牧方面的方法书,不能试试这个新BUG。
不过也不能算BUG吧,因为看无限世界的帮助,好象有这样一条,就是当战斗技能和生活技能都达到最高时,可以形成合技。跳舞杀人的舞神套装,只是帮助他提前领会这一能力而已。
继续前行,这一次并不是表演,而是紫风铃“吟诵术”升级的任务:收集一套名为《六国战争》的史诗。
按照紫风铃所接职业任务的提示,要到巫神国“枫叶之村”酒馆打听线索。
来到酒馆,很容易地找到一个落魄的游吟诗人,他告... |
JavaScript | UTF-8 | 5,244 | 2.5625 | 3 | [] | no_license | function updateStudent (req, res, con){
console.log(req.body);
let check = "SELECT EXISTS(SELECT * FROM Student WHERE id_Student = " +req.body.updateThisStudent +");";
let nameRegex = /^([a-zA-Z]){2,30}$/;
con.query(check, function (err, ifExists, fields) {
console.log(ifExists[0]);
... |
PHP | UTF-8 | 2,399 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file belongs to Kreta.
* The source code of application includes a LICENSE file
* with all information about license.
*
* @author benatespina <benatespina@gmail.com>
* @author gorkalaucirica <gorka.lauzirika@gmail.com>
*/
namespace Kreta\Component\VCS\Model;
use Doctrine\Common\Collections\Ar... |
Java | UTF-8 | 1,090 | 1.773438 | 2 | [] | no_license | package com.sergey.root.orderkkt.Fragment;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.supp... |
C# | UTF-8 | 11,746 | 2.609375 | 3 | [] | no_license | using System;
using StackExchange.Redis;
using System.Collections.Generic;
using System.Linq;
namespace Redis.Workflow.Common
{
public class WorkflowManagement : IDisposable
{
public void Dispose()
{
// Interesting behaviour in tests. If we don't Unsubscribe all at end of test then... |
Shell | UTF-8 | 214 | 2.953125 | 3 | [] | no_license | #!/bin/bash
sig_player()
{
echo "Envoir de kill (sig1) de joueur $$ vers $PPID"
kill -10 $1
}
trap 'sig_player' 10
while true
do
echo "$$ Je suis stressé mon père est $1"
sleep 5
wait $!
done
|
C# | UTF-8 | 890 | 3.015625 | 3 | [] | no_license | using System;
using System.Collections.Concurrent;
using Employees_Test.Models;
namespace Employees_Test.DAL
{
public class EmployeesDatabaseContext
{
private ConcurrentDictionary<string, Employee> Values { get; } = new ConcurrentDictionary<string, Employee>();
private readonly string _connec... |
Java | UTF-8 | 2,816 | 2.265625 | 2 | [] | no_license | package gmerg.beans;
import java.util.HashMap;
import gmerg.assemblers.FocusBrowseAssembler;
import gmerg.utils.table.*;
import gmerg.utils.Visit;
import gmerg.utils.Utility;
public class ArrayFocusBrowseBean {
private boolean debug = false;
private String organ;
private String stage;
private String archiveI... |
Markdown | UTF-8 | 3,204 | 2.625 | 3 | [] | no_license | 创建更新的3种方式:
一、ReactDOM.render:
1、执行步骤:
1)创建顶层的一个点,ReactRoot
2)创建FiberRoot 和 RootFiber
3)创建更新
2、ReactDOM.render()源码分析:

1)可以看到,render方法接收必须的有两个参数,第一个是React节点对象,第二个是要挂载到的容器,第三个是React节点对象渲染完成后的回调,可不传。
2)后边返回一个函数 legacyRenderSubtreeIntoContainer ,其他三个参数能看明白,着重看第一个... |
TypeScript | UTF-8 | 530 | 2.515625 | 3 | [] | no_license | import { _decorator, Component, Node } from 'cc';
import { UpgradeSystem } from './UpgradeSystem';
const { ccclass, property } = _decorator;
@ccclass('PlayerUpgrade')
export class PlayerUpgrade extends UpgradeSystem {
private static playerUpgrade: PlayerUpgrade
public static getInstance(): PlayerUpgrade {
... |
Java | UTF-8 | 1,379 | 3.453125 | 3 | [] | no_license | package it;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
//echo(System.in);
File file = new File("temp.txt");
writeToFile(file, "Hello, writing to file");
readFromFile(file);
}
public static void echo(InputStream is)... |
Java | UTF-8 | 521 | 1.789063 | 2 | [
"Apache-2.0"
] | permissive | package com.netshoes.athena.gateways;
import com.netshoes.athena.domains.DependencyManagementDescriptorAnalyzeResult;
import com.netshoes.athena.domains.ProjectCollectDependenciesRequest;
import reactor.core.publisher.Flux;
public interface DependencyManagerGateway {
Flux<DependencyManagementDescriptorAnalyzeResul... |
Java | UTF-8 | 646 | 2.3125 | 2 | [] | no_license | import org.eclipse.jetty.websocket.api.*;
import org.eclipse.jetty.websocket.api.annotations.*;
@WebSocket
public class WebSocketHandler {
private Session session;
@OnWebSocketConnect
public void onConnect(Session session) throws Exception {
this.session = session;
WebSocketBroadcaster.ge... |
PHP | UTF-8 | 3,335 | 2.625 | 3 | [
"CC-BY-4.0"
] | permissive | <?php
class Laakkeenosa extends BaseModel {
public $id, $laake, $ainesosa, $vahvuus;
public function __construct($attributes) {
parent::__construct($attributes);
}
public static function hae_kaikki() {
$query = DB::connection()->prepare('SELECT *
... |
Java | UTF-8 | 3,180 | 2.21875 | 2 | [
"Apache-2.0",
"MIT"
] | permissive | package com.codepath.apps.tweetpath.fragments;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import androi... |
C# | UTF-8 | 1,956 | 2.640625 | 3 | [] | no_license | using System;
namespace OOPClass1
{
class Program
{
static void Main(string[] args)
{
/*StudentRepository studentRepository = new StudentRepository();
studentRepository.AddStudent("Yunus", "Olalekan", "07062539241", "QTS/2009/034", 20, "2, Ayeloja street, Oke-Gada Ede")... |
Java | UTF-8 | 1,551 | 3.234375 | 3 | [] | no_license | package application;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import model.entities.Reservation;
public class Program {
public static void main(String[] args) throws ParseException {
Scanner sc = new Scanner(System.in);
SimpleDateFo... |
Markdown | UTF-8 | 2,077 | 2.921875 | 3 | [
"MIT"
] | permissive | # OSMBuildings Source
This enables simple access to OSM Buildings (https://osmbuildings.org/) data by given bounding box.
The area is split into tiles and downloaded in parallel.
*Sign up four your personal key:* https://osmbuildings.org/account/register/
## API
### Class OSMBuildings.Source({ options })
*Paramete... |
Java | UTF-8 | 2,825 | 2.296875 | 2 | [
"Apache-2.0"
] | permissive | package clan.customeview.database;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class DbHelper extends SQLiteOpenHelper {
private static final String TAG = DbHelper.class.getSimpleName()... |
Java | UTF-8 | 205 | 1.929688 | 2 | [] | no_license | package com.samilcts.media;
/**
* Created by mskim on 2016-07-11.
* mskim@31cts.com
*/
public interface State {
int DISCONNECTED = 0;
int CONNECTING = 1;
int CONNECTED = 2;
int getValue();
}
|
Markdown | UTF-8 | 1,328 | 2.9375 | 3 | [
"MIT"
] | permissive | #### Install Plugins in Jenkins
The Nautilus DevOps team has recently setup a Jenkins server, which they want to use for some CI/CD jobs. Before that they want to install some plugins which will be used in most of the jobs. Please find below more details about the task:
Click on the + button in the top left corner a... |
Java | UTF-8 | 4,714 | 2.546875 | 3 | [] | no_license | package application.dao;
import application.model.IModel;
import application.model.Perfil;
import application.model.Usuario;
import com.mysql.jdbc.Statement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.... |
Python | UTF-8 | 106 | 2.609375 | 3 | [] | no_license | import math
resultado = (math.sqrt(81) + 9 / 3 ==9) and (10 > 1)
print("La respuesta es: %s " % resultado) |
Ruby | UTF-8 | 545 | 3.640625 | 4 | [] | no_license | # The Cart class holds the user's items.
#
# The user's cart is intended to interact with the till,
# because the till will look at the items in the cart,
# and provide the total cost of the items in the cart.
#
# This approach provides a deliberate separate of concerns,
# where the cart concern is managing the state ... |
C# | UTF-8 | 1,060 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ProjectAlgorithm
{
public partial class ExFunction : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
... |
JavaScript | UTF-8 | 1,111 | 2.65625 | 3 | [] | no_license | //context menu javascript
if (document.addEventListener)
{ // IE >= 9; other browsers
document.addEventListener('contextmenu', function (e){
// alert("You've tried to open context menu" + e.target); //here you draw your own menu
e.preventDefault();
showAlert();
$(".altContextMenu").... |
Java | UTF-8 | 2,031 | 2.53125 | 3 | [] | no_license | package com.gabik.metro.view.drawElements;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import com.gabik.metro.model.param.DrawParamBendCommunication;
import com.gabik.metro.model.param.DrawParamCommunication;
import com.gabik.metro.model.p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.