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 |
|---|---|---|---|---|---|---|---|
TypeScript | UTF-8 | 2,908 | 2.8125 | 3 | [
"MIT"
] | permissive | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { JSONSchema7 } from 'json-schema'
import { compare, applyPatch } from 'fast-json-patch'
import toJSONSchema from 'to-json-schema'
import { defaultObjectForSchema } from './defaults'
import { Patch, applyLensToPatch } from './patch'
import {... |
Python | UTF-8 | 289 | 3.609375 | 4 | [] | no_license | num1=int(input("enter num1"))
num2=int(input("enter num2"))
num3=int(input("enter num3"))
if(num1>num2) & (num1>num3):
print("num1 is max")
elif(num2>num3)& (num2>num1):
print("num2 is max")
elif(num3>num1) &(num3>num2):
print("num3 is max")
else:
print("numbers are same") |
Python | UTF-8 | 1,106 | 3.15625 | 3 | [] | no_license | from bs4 import BeautifulSoup
import os
def text_to_html(folder):
filenames = os.listdir(folder)
for file in filenames:
if file.endswith('.html'):
file_in = open("./"+folder+ "/" + file, 'rb')
# Pasamos el contenido HTML a un objeto BeautifulSoup
html = Beautifu... |
C# | UTF-8 | 1,322 | 3.6875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
namespace Applied_Arithmetics
{
class Program
{
static void Main(string[] args)
{
int[] numbers = Console.ReadLine()
.Split()
.Se... |
C | UTF-8 | 7,175 | 3.28125 | 3 | [] | no_license |
#include<stdio.h>
#include<stdlib.h>
typedef struct Node SLL;
struct Node
{
int coff;
int expo;
SLL *next;
};
SLL *head1=NULL;
SLL *head2=NULL;
SLL *head3=NULL;
SLL *head4=NULL;
SLL *head5=NULL;
int n1;
int n2;
int Read_No_Nodes();
void Traverse_SLL(SLL **);
void Insert_End(SLL **, int... |
TypeScript | UTF-8 | 1,036 | 2.859375 | 3 | [
"MIT"
] | permissive | import type Store from '../store';
import { Family, FamilyType } from '../types';
import { min, prop } from './index';
import { withType } from './family';
import { getUnitX } from './units';
const alignGenerations = (families: readonly Family[], root: Family): void => {
const parents = families.find(family => famil... |
Python | UTF-8 | 2,708 | 2.796875 | 3 | [] | no_license | #encoding=utf-8
#处理抽取出来的乐谱,删除太短和单一的部分,进行分段
import os
import shutil
def ext(root, dist, filename):
f = open(root + filename, 'r')
c = 0
b = False
strr = ''
n = 0
for line in f:
if '-' not in line and b == False:
fw = open(dist+str(c)+filename, 'w')
b = True
... |
Python | UTF-8 | 1,250 | 3.0625 | 3 | [] | no_license | # coding=utf-8
import io
import os
import random
import base64
from PIL import Image, ImageDraw, ImageFont
class Captcha(object):
@classmethod
def get_captcha(cls):
width = 90
height = 32
img1 = Image.new(mode="RGB", size=(width, height), color=(202, 202, 202))
draw1 = ImageD... |
Java | UTF-8 | 9,726 | 1.640625 | 2 | [
"Apache-2.0"
] | permissive | package org.ovirt.engine.ui.userportal.client.protocols;
import org.ovirt.engine.core.compat.Event;
import org.ovirt.engine.ui.frontend.Frontend;
import com.google.gwt.core.client.GWT;
public class RdpConnector {
private String server;
private Boolean fullScreen = true;
private String fullScree... |
Python | UTF-8 | 2,770 | 2.65625 | 3 | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | '''
#
# Run with python3
# Script that generates the Logos xclangspec
#
# xclangspec_generator is a script created by pr0crustes (https://github.com/pr0crustes)
# that is provided as it is, without any warranty.
# pr0crustes @ 2018 - all rights reserved.
#
'''
import os
global_new_keywords = [
"// Start Logos Key... |
C# | UTF-8 | 3,660 | 3.125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace C_SharpNote.Helper
{
public static class HolidayHelper
{
public static bool IsHolidays(DateTime date)
{
// 週休二日
if (... |
Markdown | UTF-8 | 642 | 2.796875 | 3 | [] | no_license | ---
layout: blog
title: How to mock localhost IP address for geocoding in Rails
---
# {{ page.title }}
This took me a while to figure out, so I figured I'd write down my solution in case someone else is trying to do the same thing.
I'm using the Geocoder gem for [Townstage](http://townstage.com), and when testing lo... |
Markdown | UTF-8 | 821 | 2.625 | 3 | [] | no_license | # toyexample
An MVC-inspired multiplayer "game" for educational purposes. Part of the Web Development course at Harokopio University in Athens (http://www.dit.hua.gr)
Essentially it is only an attempt to have a server managing client connections and user actions by calculating the state of the model, i.e. one squar... |
Java | UTF-8 | 211 | 1.734375 | 2 | [] | no_license | package behavioral.State;
public final class StateSet {
public static int NEW = 1;
public static int RUNNABLE = 1;
public static int RUNNING = 1;
public static int BLOCK = 1;
public static int DEAD = 1;
}
|
C | UTF-8 | 573 | 3.1875 | 3 | [] | no_license | struct Node{
{
int data;
Node* left;
Node* right;
};
/*Your code here*/
#include<vector>
void func1(Node *root,vector<int> &v)
{
if(root==NULL)
return;
v.push_back(root->data);
func1(root->left,v);
func1(root->right,v);
}
void func2(Node *root,vector<int> &v,int &c)
{
if(root==NULL)... |
Shell | UTF-8 | 1,122 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
set -e
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ -z ${VM_DRIVER+x} ]]; then
VM_DRIVER=hyperkit
fi
fi
if [[ ! -z ${VM_DRIVER+x} ]]; then
VM_DRIVER_SWITCH="--vm-driver=${VM_DRIVER}"
fi
if [[ -n "${KUBE_VER}" ]]; then
MINIKUBE_KUBE_VERSION="--kubernetes-version=${KUBE_VER}"
... |
Python | UTF-8 | 2,046 | 2.75 | 3 | [] | no_license | import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Conv1D, MaxPooling1D, Dropout, LSTM
from keras.layers.embeddings import Embedding
from keras.preprocessing import sequence
from keras.datasets import imdb
top_words = 20000
(training_data, training_targets), (testing_data, testing_... |
Python | UTF-8 | 5,490 | 2.53125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pickle
from collections import OrderedDict
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
from astropy.cosmology import WMAP9 as cosmo
from scipy.ndimage.filters import gaussian_filter1d
from matp... |
Python | UTF-8 | 3,287 | 2.546875 | 3 | [] | no_license | import locale
import requests
from django import template
from requests.auth import HTTPBasicAuth
import ast
register = template.Library()
@register.filter(name='multiply')
def multiply(value, arg):
return value * arg
@register.filter(name='thousand')
def thousand(number):
locale.setlocale(locale.LC_NUMERI... |
Java | UTF-8 | 4,382 | 2.25 | 2 | [] | no_license | package com.szc.netty.learn.rpc.remoting.client;
import static com.szc.netty.learn.rpc.utils.GloabalConstants.DEFAULT_IO_THREADS;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import com.szc.netty.learn.rpc.codec.Request;
import com.szc.netty.learn.rpc.codec.RpcDecoder;
import com.szc.netty.learn.rpc.code... |
Java | UTF-8 | 691 | 3.53125 | 4 | [] | no_license | package com.fastdata.algorithm.easy.tree;
/**
* @Author: Lucky
* @Description: https://leetcode.com/problems/trim-a-binary-search-tree/
* @Date: create in 1/13/21 - 12:47 PM
*/
public class TrimABinarySearchTree {
public TreeNode trimBST(TreeNode root, int low, int high) {
// base case
if (root... |
C | UTF-8 | 1,090 | 3.546875 | 4 | [] | no_license | //Merge sort is better for larger size arrays than quick sort
#include <stdio.h>
#include <stdlib.h>
void merge(long *arr,int l,int mid,int r)
{
long *temp=(long *)malloc(sizeof(long)*(r-l+1));
int l1=l,r1=mid+1,i=0;
while(l1<=mid&&r1<=r)
{
if(arr[l1]>arr[r1]){
temp[i]=arr[r1];
... |
SQL | UTF-8 | 689 | 4.65625 | 5 | [] | no_license | SELECT CONCAT(to_char(weeks.week_start, 'YYYY-MM-DD'), ' - ', to_char(weeks.week_end, 'YYYY-MM-DD')) AS week,
coffeeshops.name,
employees.name,
max_revenue.revenue
FROM (
SELECT DISTINCT ON(week_id)
week_id, employee_id, revenue
FROM (
SELECT t.week_id,
t.employee_id,
... |
Python | UTF-8 | 21,684 | 2.625 | 3 | [] | no_license | import util
import string
from emptyContainer import EmptyContainer
from tkinter import *
from tkinter import messagebox
class AnamneseContainer(EmptyContainer):
def __init__(self, father, nome, dir):
super().__init__()
self.father = father
self.nome = nome
self.dir = dir
... |
C++ | UTF-8 | 421 | 3.09375 | 3 | [] | no_license | /// LCM = (multiplication of 2 number) / gcd;
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,t;
while(cin>>a>>b)
{
int multi = a*b;
while(b)
{
t = a;
b = b%a;
if(!b) break;
a = b;
b = t;
}
... |
C++ | UTF-8 | 1,417 | 3.03125 | 3 | [] | no_license | // errors.hpp
/**\file
*/
#pragma once
#include <boost/system/error_code.hpp>
namespace ss {
using error_code = boost::system::error_code;
namespace error {
enum SessionError {
Success = 0,
PartialData, // in buffer contains partial request
Size,
};
class SessionErrorCategory final : public boost::system::e... |
C | UHC | 256 | 4.0625 | 4 | [] | no_license | // i -5 ʱȭ , Ʈ Ͽ i 0 α ۼϼ.
#include <stdio.h>
void main(void) {
int i = -5;
printf("i = %d\n", i);
i = i ^ i;
printf("i = %d\n", i);
} |
PHP | UTF-8 | 869 | 2.84375 | 3 | [] | no_license | <?php
namespace PiotrJaworski\InternalLinking\Helper;
/**
* LinkBuilder class
*
* @author Piotr Jaworski
*/
class LinkBuilder implements \PiotrJaworski\InternalLinking\Helper\LinkBuilderInterface
{
/**
* Build a link HTML
*
* @param array $link
* @return string
*/
public function ... |
Java | UTF-8 | 2,203 | 1.8125 | 2 | [] | no_license | package com.dz.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.dz.dao.IEvaluateDao;
import com.dz.entity.Evaluate;
import com.dz.service.IEval... |
Java | UTF-8 | 1,429 | 2.484375 | 2 | [] | no_license | package com.pawan.oauth2authorizationserver.security;
/*package com.pawan.jsonwebtokensecurity.security;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.pawan.jsonwebtokensecurity.model.Role;
import com.pawan.jsonwebtoke... |
PHP | UTF-8 | 3,556 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
/*
* Modificata da Angelo Caputo
* 26/11/16 00:40
*/
class StatoAnnuncio{
const REVISIONE = "revisione";
const ATTIVO = "attivo";
const SEGNALATO = "segnalato";
const DISATTIVATO = "disattivato";
const RICORSO = "ricorso";
const ELIMINATO = "eliminato";
const AMMIN... |
Markdown | UTF-8 | 1,117 | 3.046875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "영지(territory) 선택 : (large)"
date: 2020-11-07 13:31:29 +0900
categories: Algorithm
tags: [Implement]
---
# 영지(territory) 선택 : (large)
### 코드
```c
#include <stdio.h>
#include <vector>
using namespace std;
int a[701][701], dy[701][701];
int main()
{
int h, w, i, j, n, m, tmp, max = -2147... |
Java | UTF-8 | 5,168 | 2 | 2 | [
"MIT"
] | permissive | package com.auth.service.impl;
import com.auth.model.AccountRegisterRequest;
import com.auth.model.Customer;
import com.auth.model.User;
import com.auth.repository.AccountRegisterRequestRepository;
import com.auth.repository.CustomerRepository;
import com.auth.repository.UserRepository;
import com.auth.service.Account... |
Python | UTF-8 | 480 | 3.09375 | 3 | [] | no_license | # -*- coding:utf-8 -*-
def solve():
N = int(input())
As = list(map(int, input().split()))
total = 0 # 踏み台の高さ
pre_a = As[0]
for i in range(1, N):
diff = pre_a - As[i]
if diff > 0:
# 前の人のほうが高い
total += diff
As[i] += diff
else:
#... |
Markdown | UTF-8 | 5,430 | 2.78125 | 3 | [] | no_license | ---
description: You've got questions - we have answers
---
# FAQs
## What is LiDAR?
LiDAR stands for Light Detection And Ranging. LiDAR is a method for measuring distances using a laser and optical sensor combination device. A LiDAR device functions by measuring the time between shining the laser on an object and... |
Rust | UTF-8 | 784 | 3.5 | 4 | [] | no_license | use std::ops::Not;
type StockId = String;
#[derive(Debug)]
pub enum Command {
Create { id: StockId },
Update { id: StockId, qty: u32 },
}
#[derive(Debug, Default, Clone)]
pub struct Stock {
pub id: StockId,
pub qty: u32,
}
impl Stock {
pub fn handle(self, cmd: &Command) -> Stock {
match ... |
Shell | UTF-8 | 459 | 2.6875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive |
set -e
shopt -s extglob
TEMP_PATH="docs/.temp"
# build docs
yarn doc:build
# prepare deploy
mkdir $TEMP_PATH
cd $TEMP_PATH
git init
git pull git@github.com:ddnlink/ddn.git gh-pages
# rm -rf *
cp -r ../../dist/* .
# git config
git config user.email "limsbase@163.com"
git config user.name "limsbase"
# commit and pu... |
Python | UTF-8 | 2,083 | 2.734375 | 3 | [
"MIT"
] | permissive | import seaborn as sns; sns.set()
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
sns.set_context("poster",font_scale=1.2,rc={"font":"helvetica"});
sns.set_style("white");
cp = sns.color_palette("colorblind")
cp = sns.color_palette()
rcParams["savefig.dpi"] = 200
rcParams['mathtext.f... |
Java | UTF-8 | 242 | 2.765625 | 3 | [] | no_license | package enumeration;
public enum Category {
PUPPY,
ADULT,
OLD;
public static Category getCategoryByAge(double age) {
if (age<1.0) return PUPPY;
else if (age<8.0) return ADULT;
else return OLD;
}
}
|
JavaScript | UTF-8 | 3,329 | 2.765625 | 3 | [
"MIT"
] | permissive | function colorinvert(){
if (document.body.style.getPropertyValue('--bg-color') != "black"){
document.body.style.setProperty('--bg-color' , "black" );
document.body.style.setProperty('--element-color' , "white" );
} else {
document.body.style.setProperty('--bg-color' , "white" );
document.body.style.... |
Java | UTF-8 | 6,236 | 3.359375 | 3 | [] | no_license |
// Creators: Sadiq Hussain, Nathan Chung
// This is the champion class used to define the traits of a champion
package League;
import java.util.*;
public class Champion {
// Initialize protected int fields (stats):
protected String name;
protected String tribe;
protected String type;
//A... |
Swift | UTF-8 | 2,403 | 3.03125 | 3 | [] | no_license | //
// FirstViewController.swift
// FoodApp
//
// Created by Connor Donegan on 1/29/20.
// Copyright © 2020 Connor Donegan. All rights reserved.
//
import UIKit
class FirstViewController: UIViewController {
@IBOutlet weak var Numberfood: UILabel!
@IBOutlet weak var Image: UIImageView!
@IBOutl... |
Java | UTF-8 | 1,603 | 2.59375 | 3 | [
"MIT"
] | permissive | package com.plooh.adssi.dial.twindow;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import com.plooh.adssi.dial.data.Twindow;
import com.plooh.adssi.dial.parser.TimeFormat;
public class TwindowUtils {
public static final Twindow twindow(Instant now, String antecedentHash, String antecedentClos... |
Java | UTF-8 | 1,948 | 2.75 | 3 | [] | no_license | package fr.fresnel.fourPolar.algorithm.preprocess.fov;
import fr.fresnel.fourPolar.core.imagingSetup.imageFormation.fov.IFieldOfView;
import fr.fresnel.fourPolar.core.physics.polarization.Polarization;
/**
* An interface for calculating the {@link IFieldOfView} of a particular
* {@link Camera},
*/
public interface... |
Java | UTF-8 | 3,142 | 3.46875 | 3 | [] | no_license | package string;
import java.util.*;
/**
* Date 09/08/17
*
* @author Ankit Jain
*/
public class LongestUncommonSubsequenceII {
public static void main(String[] args) {
LongestUncommonSubsequenceII longestUncommonSubsequenceII = new LongestUncommonSubsequenceII();
System.out.println(longestUncom... |
Java | UTF-8 | 7,210 | 1.953125 | 2 | [] | no_license | package stealme.client.location;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.location.Location;
imp... |
C++ | UTF-8 | 1,097 | 2.84375 | 3 | [] | no_license | #include<cstdio>
#include<cstdlib>
#include<iostream>
using namespace std;
char place;
int n,k,temp=0,remain;
int num[26];
struct node{
char c;
node *nex,*rev;
node() {c=0;nex=rev=NULL;}
}*head,*tail;
inline void ins(char key){
node *p=new(node);
p->c=key;
p->nex=tail;p->rev=tail->rev;
tail->rev->nex=p;tail->rev... |
C# | UTF-8 | 4,008 | 2.71875 | 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 Proyecto_algoritmos
{
public partial class Form3 : Form
{
public Form1 f1;
... |
C++ | UTF-8 | 8,174 | 3.03125 | 3 | [] | no_license | #include <string>
#include <fstream>
#include <iostream>
#include "Household.h"
#include "ZipCodeList.h"
#include "BSTree.h"
#include "List.h"
using namespace std;
Household::Household()
{
lastName="";
streetAddress="";
stateInitials="";
zipCode="";
numOccupants=0;
}
void Househo... |
JavaScript | UTF-8 | 14,189 | 2.609375 | 3 | [] | no_license | var lists = document.querySelectorAll("li .attribute1-unclick");
for (list in lists) {
lists[list].onclick = function () {
var clicked = document.querySelectorAll(".attribute1-click")[0];
if (this.className == "attribute1-unclick") {
if (clicked) clicked.className = "attribute1-unclick";... |
Java | UTF-8 | 838 | 2.078125 | 2 | [
"Unlicense"
] | permissive | package code.example;
import com.google.inject.ProvisionException;
import com.google.inject.servlet.ServletModule;
import com.philips.app.boot.PhilipsInjector;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by aweise on 30/12/16.
*/
public class GuiceModuleTest extends ServletModule {
@... |
C# | UTF-8 | 1,723 | 2.65625 | 3 | [
"MIT"
] | permissive | namespace ClicksAndDrive.Services.Data
{
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using ClicksAndDrive.Data;
using ClicksAndDrive.Data.Models;
using ClicksAndDrive.Services.Data.Contracts;
using Microsoft.AspNetCore.Http;
public class ImageServi... |
Python | UTF-8 | 698 | 3.5 | 4 | [] | no_license |
class Solution:
def findTotalFruit(self, tree):
"""
:type tree: List[int]
:rtypr: int
"""
j = 0
m = {}
for i in range(0, len(tree)):
if tree[i] in m:
m[tree[i]]+=1
else:
m[tree[i]]=1
... |
Python | UTF-8 | 935 | 2.84375 | 3 | [] | no_license | #!/bin/python3
import math
import os
import random
import re
import sys
from itertools import combinations
# Complete the maxMin function below.
def maxMin(k, arr):
arr.sort()
'''mini = 999999999
arr.sort()
li = list(combinations(arr,k))
for i in li:
mins = max(i)-min(i)
if(mins<m... |
Java | UTF-8 | 11,481 | 2.109375 | 2 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /*
* AllBinary Open License Version 1
* Copyright (c) 2011 AllBinary
*
* By agreeing to this license you and any business entity you represent are
* legally bound to the AllBinary Open License Version 1 legal agreement.
*
* You may obtain the AllBinary Open License Version 1 legal agreement from
* AllBinary or the ro... |
C | UTF-8 | 192 | 3 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
int main()
{
char a[]="hello";
a[0]='X';
printf("1");
printf("a[]= %s\n",a);
char *p="world";
printf("1");
// p[0]='X';
printf("*p= %s\n",p);
return 0;
}
|
Python | UTF-8 | 1,616 | 3.015625 | 3 | [] | no_license | """
It loads the npz file, not the corpus
"""
import numpy as np
import json
def load_data(path_to_npz, vocab_file_path):
"""
Solver will take this object
and work it out inside
"""
# ['train_sentences', 'W_embed', 'dev_sentences', 'test_sentences',
# 'y_dev', 'y_train', 'word_idx_map', 'y_te... |
PHP | UTF-8 | 654 | 2.796875 | 3 | [] | no_license | <?php
class Forum{
private $_id;
private $_idCat;
private $_name;
private $_description;
private $_ordre;
private $_lastPost;
private $_nbTopic;
private $_nbPost;
public function id(){return $this->_id;}
public function idCat(){return $this->_idcat;}
public function name(){return $this->_na... |
Markdown | UTF-8 | 2,172 | 2.71875 | 3 | [] | no_license | # AJAXistic => AJAX + fantaSTIC
<p align="center">
<img src="https://i.imgur.com/13792LE.png" align="center" width="800" height="500"></img>
</p>
<p align="center"> Live Link: <a href="http://ajaxistic.co.uk" alt="Ajaxistic"/>Ajaxistic</a></p>
## AJAX ✏️
- stands for Aysnchronus Javascript And XML
- is a new t... |
Java | UTF-8 | 1,999 | 2.265625 | 2 | [] | no_license | package dataservice.orderdataservice;
import dataservice.DataServiceParent;
import po.order.ReviewPO;
import po.order.OrderPO;
import util.OrderType;
import util.ResultMessage;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
/**
* Created by Hiki on 2016/10/16.
*/
public interf... |
Python | UTF-8 | 852 | 2.953125 | 3 | [] | no_license | import unittest
from .disjoint_set import DisjointSetNode
class TestCase(unittest.TestCase):
def setUp(self) -> None:
self.set_a = DisjointSetNode("Set A")
self.set_c = DisjointSetNode("Set C")
self.set_d = DisjointSetNode("Set D")
self.set_b = DisjointSetNode("Set B")
def te... |
Java | UTF-8 | 542 | 2.15625 | 2 | [] | no_license | package com.github.zhuangzhao.distributeduniqueid.zookeeper;
import lombok.Data;
import java.io.File;
/**
* @author zhuangzhao.zhu, <zhuangzhao2726@gmail.com>
* @date 2019-05-26.
*/
@Data
public class ZookeeperNode {
private String nameSpace;
private String relativePath;
private String zkPath;
publi... |
Java | UTF-8 | 2,554 | 2.578125 | 3 | [] | no_license | package sample.ejb;
import javax.annotation.Resource;
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.jms.*;
@Local
@Stateless
public class MessageConsumerBean implements MessageConsumer {
// TODO: SLSB should not have state
private static QueueConnection conn;
private static QueueSessio... |
TypeScript | UTF-8 | 416 | 2.546875 | 3 | [] | no_license | import {
IGameUserRoundInfo,
getNullGameUserRoundInfo
} from "./game-user-round-info";
import { IUser } from "./user";
export interface IGameUser {
user: IUser;
points: number;
roundInfo: IGameUserRoundInfo;
}
export class GameUser implements IGameUser {
constructor(
public user: IUser,
public poi... |
Markdown | UTF-8 | 3,135 | 2.96875 | 3 | [] | no_license | ## 42장
### 사제들의 방
1 그는 나를 북쪽의 바깥뜰로 데리고 나가서, 마당으로 난, 곧 북쪽 건물을 비스듬히 마주한 방들이 있는 곳으로 갔다.
2 그 방들은 북쪽 면의 길이가 백 암마이고 너비는 쉰 암마였다.
3 안뜰에서 스무 암마 되는 지점, 바깥뜰의 돌을 깐 바닥 맞은쪽에 삼 층으로 얹은 회랑이 있었다.
4 그리고 그 방들 앞에는 안쪽으로 복도가 있었는데, 너비가 열 암마, 길이가 백 암마였으며, 입구들은 북쪽에 나 있었다.
5 위층의 방들이 가장 좁았는데, 그것은 회랑이 건물의 아래층과 가운데 층에서보다 자리를 더 차지하였기 때문이다.
6 이 방들은 삼... |
Java | UTF-8 | 823 | 3.40625 | 3 | [] | no_license | package thread;
public class MainClass {
public static void main(String[] args) {
// TODO Auto-generated method stub
CounterThread t =new CounterThread();
t.start();
//after this run() method is executing its task
try {
Thread.sleep(2000);
} catch (InterruptedException e) {}
// t.stopped=true;
t.in... |
Java | UTF-8 | 821 | 2.75 | 3 | [] | no_license | package learnrxjava.types;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
public interface ComposableList<T> extends Iterable<T> {
<R> ComposableList<R> map(Function<T, R> projectionFunction);
ComposableList<... |
Java | UTF-8 | 8,635 | 2.25 | 2 | [] | no_license | package dji.midware.aoabridge;
import dji.fieldAnnotation.EXClassNullAway;
import dji.midware.aoabridge.AoaController;
import dji.midware.aoabridge.DJIBaseCommData;
import dji.midware.data.manager.P3.DataEvent;
import dji.midware.data.manager.P3.ServiceManager;
import dji.midware.util.DJIEventBusUtil;
import java.io.I... |
Java | UTF-8 | 962 | 2.109375 | 2 | [] | no_license | package com.way2invoice.bms.service.dto;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import com.way2invoice.bms.web.rest.TestUtil;
public class AccountTaxInfoDTOTest {
@Test
public void dtoEqualsVerifier() throws Exception {
TestUtil.equalsVerifier(Acc... |
C++ | UTF-8 | 1,045 | 2.78125 | 3 | [
"MIT"
] | permissive | /****************************************************************************
**
** Copyright (C) 2019 Xiaohai <xiaohaidotpro@outlook.com>.
** Contact: http://xiaohai.pro
**
** This file is part of cplusplus-general-programming
**
**
****************************************************************************/
#inclu... |
Python | UTF-8 | 1,824 | 4.125 | 4 | [] | no_license | from random import *
from math import *
def multiplication_grille(x):
b = ""
if x==0:
return
else:
for i in range(1,11):
a = i * x
b = b + str(a) + " | "
print(b)
return multiplication(x-1)
def justePrix():
x = randint(0,1000)
guess = ... |
Python | UTF-8 | 610 | 2.859375 | 3 | [] | no_license | import os
import time
print("let's make some clocks")
for i in range(10):
lastClock = os.fork()
if lastClock == 0:
os.execlp("/usr/bin/xclock", "xclock")
else:
print("i made one clock!")
time.sleep(1)
print("i wanna kill time!")
def isInt(s):
try:
int(s)
return True
except ValueError:
return False
... |
JavaScript | UTF-8 | 1,796 | 3.484375 | 3 | [] | no_license | let val;
const list = document.querySelector('ul.collection');
const listItem = document.querySelector('li.collection-item:first-child');
val = listItem;
val = list;
//Properties attached to these nodes
//get child nodes
val = list.childNodes; //returns NodeList
// val = list.childNodes[0];
// val = list.childNodes... |
C++ | UTF-8 | 673 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
// This is a PASS BY VALUE function in which a copy of the function argument is made inside the function;
void f (int a){
cout << "a = " << a << endl;
a = 5;
cout << "a = " << a << endl;
}
// This is a PASS BY REFERENCE function, the argument is a pin... |
Java | UTF-8 | 472 | 2.703125 | 3 | [] | no_license | package web.model;
import java.util.*;
public class BeerExpert
{
public List getBrands(String color)
{
List brands=new ArrayList();
if(color.equals("light"))
{
brands.add("Pale");
brands.add("KingFisher");
}
else if(color.equals("amber"))
{
brands.add("5000");
brands.add("Knockout");
}
... |
Java | UTF-8 | 4,372 | 1.765625 | 2 | [] | no_license | package ar.uba.fi.nicodiaz.mascota.mismascotas;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import... |
Markdown | UTF-8 | 1,688 | 2.625 | 3 | [] | no_license | ---
title: "Manufatti - Potenza del Padre dei Draghi - Schinieri di Ossa di Drago"
permalink: /artifacts/Dragonbone Greaves/
excerpt: "Era of Chaos Potenza del Padre dei Draghi - Schinieri di Ossa di Drago. Schinieri realizzati con le tibie del Re dei Draghi. Uno dei componenti della Potenza del Padre dei Draghi."
las... |
C++ | UTF-8 | 3,483 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <queue>
#include <vector>
using namespace std;
typedef struct Cell
{
int X,Y;
Cell* parent;
}Cell;
Cell* newCell(int x, int y)
{
Cell* newCell = (Cell*)malloc(sizeof(Cell));
newCell->X = x;
newCell->Y = y;
return newCell;
}
i... |
Java | UTF-8 | 10,742 | 3.03125 | 3 | [] | no_license | /************************************************************************
* Alice Chang (avc2120), Phillip Godzin (pgg2105), Martin Ong (mo2454)
* Computational Aspects of Robotics
* FALL 2015
**************************************************************************/
import javax.swing.*;
import java.awt.*;
import ... |
Rust | UTF-8 | 2,961 | 2.921875 | 3 | [
"BSD-3-Clause"
] | permissive | use super::*;
use alloc::sync::{Arc, Weak};
use fs::channel::{Channel, Consumer, Producer};
pub type Endpoint = Arc<Inner>;
/// Constructor of two connected Endpoints
pub fn end_pair(nonblocking: bool) -> Result<(Endpoint, Endpoint)> {
let (pro_a, con_a) = Channel::new(DEFAULT_BUF_SIZE)?.split();
let (pro_b, ... |
Java | UTF-8 | 439 | 3.46875 | 3 | [] | no_license | import java.util.Scanner;
public class task3 {
public static void main() {
int my = 60 * 24 * 365;
Scanner input = new Scanner(System.in);
System.out.print("Input the number of minutes: ");
int min = input.nextInt();
long years =(min / my);
int days =(min / 60 / 24) ... |
Python | UTF-8 | 860 | 3.46875 | 3 | [] | no_license | import sqlite3
# conexion y se creara si no existe la BBDD
conexion = sqlite3.connect("ejemplo.db")
cursor = conexion.cursor()
# cursor.execute("CREATE TABLE usuarios (nombre VARCHAR(100), edad INT, email VARCHAR(100))")
# cursor.execute( "INSERT INTO usuarios VALUES ('Pablo',34,'myemail@gmail.com')" )
# cursor.exec... |
C# | UTF-8 | 1,028 | 2.921875 | 3 | [] | no_license | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="FadeInOut.cs">
// Copyright (c) Yifei Xu . All rights reserved.
// </copyright>
// ----------------------------------------------------------------------------------------... |
Markdown | UTF-8 | 536 | 2.578125 | 3 | [] | no_license | # liri-node-app
This application takes in the following node commands and prints out to the console as well as to the file log.txt information about the subject searched.
**The commands are:**
**spotify-this-song** {choose a song name here}
**movie-this** {choose a movie name here}
**concert-this** {choose a band... |
PHP | UTF-8 | 4,571 | 3.234375 | 3 | [
"MIT"
] | permissive | <?php
require_once('includes.php');
class sudokuTest extends PHPUnit_Framework_TestCase {
public function testSudokuConstruct () {
$s = new sudoku();
//Ensure data has 9 elements and all are instances of grid
for ($i = 1; $i <= 9; $i++) {
$test = FALSE;
if (isset($... |
Java | UTF-8 | 4,159 | 3.671875 | 4 | [] | no_license | //***********************
//NAME: <Dennis Vo>
//ID: <A12347682>
//LOGIN: <cs12srk>
//***********************
package hw7;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
/**
* This tester file tests the methods of BSTree.java
* @version 1.0
* @author Dennis Vo
* @since 2016-05... |
C# | UTF-8 | 363 | 2.78125 | 3 | [] | no_license | var keyHandlers = new Dictionary<Keys, Action>();
keyHandlers.Add(Keys.Back, () => Console.WriteLine("Handler for backspace"));
keyHandlers.Add(Keys.Enter, () => {
//some other statements,
//maybe set some class-level property
Console.WriteLine("Handler for enter ");
});
keyHandlers.Add(3, NameOf... |
C# | UTF-8 | 7,427 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using RoyT.AStar;
using SettlementSimulation.AreaGenerator.Models;
using SettlementSimulation.Engine.Enumerators;
using SettlementSimulation.Engine.Interfaces;
using SettlementSimulation.Engine.Models;
namespace Settlemen... |
Markdown | UTF-8 | 5,705 | 3.515625 | 4 | [] | no_license | # Linear Methods
## Principal Component Analysis \(PCA\)
A way to linearly transform a set of d-dimensional vector $$x\_1, x\_2, ..., x\_n$$ into another set of m-dimensional vectors
The main idea is that high information corresponds to high variance, the direction of max variance is parallel to the eigenvector, cor... |
Java | UTF-8 | 580 | 1.71875 | 2 | [] | no_license | package com.github.yuanluoji.mbye.modules.goods;
import com.github.yuanluoji.mbye.support.AbstractEntity;
import lombok.Data;
import org.springframework.data.relational.core.mapping.Table;
/**
* Copyright (c) 2020. All Rights Reserved.
*
* @author yuanluoji
* @Description TODO
* @date 2020/10/16
*/
@Data
@Table... |
Markdown | UTF-8 | 3,825 | 3.125 | 3 | [] | no_license | @title New in NetNewsWire 6: iCloud Syncing
@pubDate 2021-03-17 17:22:50 -0700
@modDate 2021-03-17 17:24:43 -0700
We’ve added — in addition to support for a bunch of online RSS systems — iCloud syncing in NetNewsWire 6. (Latest beta [6.0b3 is recommended](https://nnw.ranchero.com/2021/03/16/netnewswire-b-for.html) at t... |
Shell | UTF-8 | 2,696 | 3.4375 | 3 | [] | no_license | #!/bin/sh -e
set -e
#set -x
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then
. /usr/share/dbconfig-common/dpkg/postrm.mysql
dbc_go obs-api $@
fi
pathfind() {
OLDIFS="$IFS"
IFS=:
for p in $PATH; do
... |
Java | UTF-8 | 1,266 | 2.96875 | 3 | [] | no_license | package battleships.domain;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
public class ShipTest {
Ship ship;
@BeforeClass
public static void setUpClass() {
}
@After... |
PHP | UTF-8 | 338 | 3.28125 | 3 | [] | no_license | <?php
$t = 5;
if ($t == 1) {
echo 1;
} elseif ($t == 2) {
echo 2;
} elseif ($t == 3) {
echo 3;
} else {
echo 'undefined';
}
echo '<br>';
$t = 2;
switch ($t) {
case 1:
echo 1;
break;
case 2:
echo 2;
break;
case 3:
echo 3;
break;
default:
... |
Java | UTF-8 | 331 | 2.078125 | 2 | [] | no_license | package com.uday.learning.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.FORBIDDEN)
public class NotAuthorizedException extends RuntimeException {
public NotAuthorizedException(String msg) {
super(msg... |
C# | UTF-8 | 3,430 | 2.734375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections;
using System.Collections.Generic;
namespace CommandLine.Options
{
public class OptionValueCollection : IList, IList<string> {
private readonly List<string> values = new List<string> ();
private readonly OptionContext c;
internal OptionValueCollection (OptionContex... |
Markdown | UTF-8 | 22,797 | 2.6875 | 3 | [] | no_license | # Opinion Poll by Research Affairs for ÖSTERREICH, 16–21 August 2019
<p align="center"><a href="#voting-intentions">Voting Intentions</a> | <a href="#seats">Seats</a> | <a href="#coalitions">Coalitions</a> | <a href="#technical-information">Technical Information</a></p>
## Voting Intentions
![Graph with voting inten... |
Python | UTF-8 | 313 | 4.46875 | 4 | [] | no_license | # Listas
lista = []
print(type(lista))
print(len(lista))
lista.append(1)
lista.append(3)
lista.append(5)
lista.append([7, 9, 11, 13, 15, 17])
print(lista)
new_list = [1, 3, 5, 'Jefferson', 'Luis']
print(new_list)
print(len(new_list))
new_list.remove(5)
print(new_list)
new_list.reverse()
print(new_list)
|
PHP | UTF-8 | 1,673 | 2.8125 | 3 | [] | no_license | <?php
//\Codeception\Subscriber\Console::beforeStep = function(StepEvent $e)
//{
// if (!$this->steps or !$e->getTest() instanceof ScenarioDriven) {
// return;
// }
// $this->output->writeln("* " . $e->getStep());
//};
global $ssI;
$ssI = new AcceptanceTester($scenario);
/**
* This function is to re... |
PHP | UTF-8 | 1,043 | 2.515625 | 3 | [] | no_license | <?php
/****
* Look for users base on name and last_name
****/
require_once("../templates/template.php");
$db = getBD();
$utils = new Utils_datos();
if(isset($_REQUEST["alias"])){
$sql = "SELECT * FROM siq_data WHERE alias = '".$_REQUEST["alias"]."' AND codigoestado='100' ";
$data = $db->GetRow($sql);
} els... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.