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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 623 | 1.992188 | 2 | [] | no_license | package net.furikuri.web;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class BookController {
... |
Java | UTF-8 | 2,294 | 2.546875 | 3 | [] | no_license | package com.hsmdata.springTest.common.framework.filter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.NamedThreadLocal;
import org.springframework.web.servlet.HandlerIntercep... |
Shell | UTF-8 | 609 | 3.46875 | 3 | [] | no_license | #!/bin/bash
mkdir -p Database;
if [ $# -eq 0 ]; then
echo "Expected argument: Path to the database.";
echo "Optional argument: 1 for demo. 0 for default ie no demo"
elif [ $# -eq 1 ]; then
find $1/ -iname '*.mp4' -exec ./FaceDetector {} 0 \;
elif [ $# -eq 2 ]; then
find $1/ -iname '*.mp4' -exec ./FaceDetector {} $... |
Python | UTF-8 | 1,991 | 3 | 3 | [] | no_license | import gym
import os
from DQN import Deep_Q_Network
import numpy as np
env = gym.make('CartPole-v0')
state_size = env.observation_space.shape[0]
action_size = env.action_space.n
print(state_size)
batch_size = 32
n_episode = 100
OP_dir = 'cartpole_output/'
if not os.path.exists(OP_dir):
os.mkdir(OP_dir)
agent... |
C# | UTF-8 | 1,198 | 3.734375 | 4 | [] | no_license | using System;
namespace _05_chain_of_responsibility
{
class Handler
{
Handler next;
int id;
public int Limit { get; set; }
public Handler(int id, Handler handler)
{
this.id = id;
this.Limit = id * 1000;
this.next = handler;
}... |
JavaScript | UTF-8 | 90 | 2.671875 | 3 | [] | no_license | var a = "Amigo";
alert(a.toLowerCase());
alert(a.replace("A","a"));
alert(a-("A")); |
Java | UTF-8 | 4,319 | 1.8125 | 2 | [] | no_license | package com.paladin.hf.controller.assess.quantificate;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
imp... |
Rust | UTF-8 | 13,693 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2018-2022 Cargill Incorporated
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
Java | UTF-8 | 543 | 1.96875 | 2 | [] | no_license | package com.longchang.www.entity;
public class UserMinemachine {
private Integer id;
private Integer userid;
private Integer mmid;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserid() {
return useri... |
Java | UTF-8 | 561 | 2.109375 | 2 | [] | no_license | package Test.Const;
import java.awt.*;
public class Const {
public static String gameTitle="坦克大战";
public static int frameWidth= (int)(Toolkit.getDefaultToolkit().getScreenSize().getWidth()/2);
public static int frameHeight=(int)(Toolkit.getDefaultToolkit().getScreenSize().getHeight()/2);
public stati... |
Python | UTF-8 | 1,022 | 4.4375 | 4 | [
"MIT"
] | permissive | def selection_sort(arr):
for x in range(len(arr)):
min_index = find_min(arr, x)
arr[x], arr[min_index] = arr[min_index], arr[x]
return arr
def find_min(arr, start):
min = arr[start]
index = start
for x in range(start + 1, len(arr)):
if arr[x] < min:
min = ar... |
Python | UTF-8 | 432 | 3.234375 | 3 | [] | no_license | x1, y1, r = [int(n) for n in input().split()]
x2, y2, x3, y3 = [int(n) for n in input().split()]
def sqdist(x1,y1,x2,y2):
return (x1-x2)**2 + (y1-y2)**2
if x1 - x2 >= r and x3 - x1 >= r and y3 - y1 >= r and y1 - y2 >= r:
print('NO')
else:
print('YES')
if sqdist(x1,y1,x2,y2) <= r**2 and sqdist(x1,y1,x3,y3)... |
Java | UTF-8 | 306 | 2.71875 | 3 | [] | no_license | package com.innovaccer.assignment.Interface;
public class Implementation implements Int1,Int2 {
public void show() {
/*Int1.super.show();
Int2.super.show();*/
}
public static void main(String arg[]) {
Implementation ob=new Implementation();
ob.show();
Int1 o=new Implementation();
}
}
|
Python | UTF-8 | 5,390 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | import subprocess
def numLinesInFile(fname):
""" Counts the number of lines in the given file.
"""
with open(fname) as f:
for i, l in enumerate(f):
pass
return i + 1
def lineIntoMap(ln):
"""id=1715 : name=March 7 2013\n"""
pairs = ln.split(':')
m = dict()
for p in p... |
Markdown | UTF-8 | 9,088 | 2.609375 | 3 | [] | no_license | ##Sodocan Modules for Angular
Your Angular application can be constructed however you wish! Inside this
directory there is a `sodocan.js` file you may want to include to get access to
some helpful functions -- all you need to do is include 'sodocan' as a
dependency to your app module, and pass-as-a-global `window.sodo... |
C | UTF-8 | 3,847 | 3.328125 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=1340 lang=c
*
* [1340] 跳跃游戏 V
*
* https://leetcode-cn.com/problems/jump-game-v/description/
*
* algorithms
* Hard (55.36%)
* Likes: 67
* Dislikes: 0
* Total Accepted: 4.2K
* Total Submissions: 7.3K
* Testcase Example: '[6,4,14,6,8,13,9,7,10,6,12]\n2'
*
* 给你一个整数数组 arr 和一... |
PHP | UTF-8 | 449 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace sndsgd\field\rule;
use \sndsgd\Field;
use \sndsgd\field\Collection;
use \sndsgd\field\Error;
/**
* Ensure a value only contains alphabetical characters
*/
class AlphaRule extends \sndsgd\field\Rule
{
/**
* {@inheritdoc}
*/
protected $message = 'contains non alphabetical character... |
C# | UTF-8 | 1,316 | 3.5625 | 4 | [] | no_license | using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static Core.ConsoleHelper;
namespace Collections.Lists.ArrayLists
{
static class Demo
{
/// <summary>
/// Demonstrates usage of <see cref="ArrayList"/>.
///... |
PHP | UTF-8 | 4,384 | 2.75 | 3 | [] | no_license | <?php
$dates = getDateArray($G, TRUE);
$currentYear = session('year');
$currentMonth = session('month');
$hasYears = TRUE;
$yearDropdown = FALSE;
$monthDropdown = TRUE;
$monthsList = array(
1 => 'January',
2 => 'February',
3 => 'March',
4 => 'April',
5 => 'May',
6 => 'June',
7 => 'July',
8 => 'August',
9 => 'S... |
Ruby | UTF-8 | 657 | 3.953125 | 4 | [] | no_license | #Hey! if you are trying to solve this excercise don't read on!!
"Find the sum of all the multiples of 3 or 5 below 1000"
multiples_3 = []
multiples_5 = []
multiples_addition = 0
counter = 0
while counter < 1000
multiple_5 = 5 * counter
if multiple_5 < 1000
multiples_5 << multiple_5
end
multiple_3 = 3 * cou... |
PHP | UTF-8 | 2,074 | 2.5625 | 3 | [] | no_license | <?php
namespace Snake\Package\Qzone\Channel;
Use \Snake\Package\Cms\CmsType;
Use \Snake\Package\Cms\CmsManage;
class QzoneAttribute {
private $attrInfo = array();
private $typeInfo = array();
private $infos = array();
public function setQzoneType($selectFields = 'id, type_name, imgurl', $pageTpye = 501, $lim... |
PHP | UTF-8 | 1,943 | 2.78125 | 3 | [] | no_license | <?php
namespace App\Services;
use App\DTO\IndexDTO;
use App\DTO\ListItemsDTO;
use App\Entity\Product;
use App\Repository\ProductRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException;
/**
* Class ProductService
* @package App\Services
*... |
PHP | UTF-8 | 660 | 3.25 | 3 | [] | no_license | <?php
class DatabaseUtil {
private static $conn = null;
public static function openConnection($dbName) {
// Is a connection already open?
if (self::$conn != null) {
// Close it.
self::closeConnection();
}
$username = "fake username";
$password... |
Python | UTF-8 | 590 | 2.953125 | 3 | [] | no_license | products = ["mobile","mouse","moneypot","monitor","mousepad"]
searchWord = "mouse"
products = ["havana"]
searchWord = "tatiana"
temp_arr = []
final_arr =[]
if len(products)==1 and products[0][0]!=searchWord[0]:
for _ in range(len(searchWord)):
final_arr.append([])
else:
for id, _ in enumerate(ra... |
C++ | UTF-8 | 994 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
struct Node{
int value;
Node* left;
Node* right;
Node* parent;
Node(){
left=NULL;
right=NULL;
parent=NULL;
}
};
void insert( Node* root, int key){
if(key<root->value) {if(!root->left){ Node*p=new Node;
p->parent=root;
root->left=p;
p->value=key;}
else
insert(root->left, key);}
... |
Python | UTF-8 | 572 | 2.984375 | 3 | [] | no_license | matriz = []
for x in range(3):
matriz.append([int(input()), int(input()), int(input())])
soma = 0
delta = 0
somaNaoDiag = 0
qtdPost = 0
menor = matriz[0][0]
for i in range(3):
for j in range(3):
if matriz[i][j] > 0:
qtdPost +=1
soma += matriz[i][j]
if matriz[i][j] < meno... |
C | UTF-8 | 4,240 | 3.015625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#define SIZE 60
int a[SIZE][SIZE];
int row[SIZE], used_row[SIZE], row2[SIZE];
int column[SIZE], column2[SIZE];
int main( )
{
int t, n, m, i, j, k, flag, row_sum, column_sum, tipu, row_max, r, l, counter = 1;
scanf("%d",&t);
while ( t-- )
{
flag = row_sum = column_sum = 0;
... |
Markdown | UTF-8 | 4,768 | 2.515625 | 3 | [] | no_license | ---
title: "Teningen - Splügenpass"
slug: teningen-spluegenpass
date: 2002-10-01
taxonomies:
tags: ["Alpen", "Bad Bellingen", "Deutschland", "Kaiserstuhl", "Kreuzlingen", "Liechtenstein", "Passstraße", "Schaan", "Schweiz", "Teningen", "Vaduz", "Reisen"]
categories:
---
<em>Teningen – 82km – Bad Bellingen – 108km ... |
Swift | UTF-8 | 3,224 | 2.65625 | 3 | [] | no_license | //
// FriendsViewController.swift
// MyFriends
//
// Created by Anna on 12/27/19.
// Copyright © 2019 Anna. All rights reserved.
//
import UIKit
class FriendsViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
var friends = [User]()
override func viewDidLoad() {
... |
Java | UTF-8 | 2,066 | 2.109375 | 2 | [] | no_license | package com.example.michelle.littleprincesses.ui.seller;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import com.example.michelle.littleprincesses.R;
public class ... |
C++ | UTF-8 | 1,079 | 2.828125 | 3 | [] | no_license | #ifndef _MENU_HPP_
#define _MENU_HPP_
#include "rectangle.hpp"
#include "list.hpp"
class Menu : public Rectangle {
private:
//members
List list;
float spacing;
//functions
void calculateListPosition();
void calculateListParameters();
public:
//ctor
... |
Python | UTF-8 | 23,699 | 2.71875 | 3 | [] | no_license | '''
>>> This file creates modules that can do forward, backward pass as well as bound propagation
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from abc import ABCMeta, abstractmethod
import math
import numpy as np
from .linearize import linearize_relu... |
Python | UTF-8 | 266 | 2.90625 | 3 | [] | no_license | from colorama import init
init()
ok = '\033[92m'
fail = '\033[91m'
close = '\033[0m'
print(ok + '☑' + close, end=' ')
# https://stackoverflow.com/questions/48445616/why-printing-in-color-in-a-windows-terminal-in-python-does-not-work
# pip install colorama |
Markdown | UTF-8 | 18,145 | 2.578125 | 3 | [] | no_license | # Setup
While programming, it is important to be aware of good pratices in order
to avoid security issues down the line. To make this process easier,
we will setup an environment for a C/C++ project with:
* __Valgrind__ - to notify us of memory-related errors.
* __CppCheck__ - to notify us of any security guidelines... |
Markdown | UTF-8 | 8,838 | 3.65625 | 4 | [
"BSD-2-Clause"
] | permissive | ---
title: "特征和接口(Traits and Interfaces)"
section: "类型系统(Types)"
menu:
toc:
parent: "types"
weight: 50
toc: true
---
<!-- Like other object-oriented languages, Pony has __subtyping__. That is, some types serve as _categories_ that other types can be members of. -->
与其他面向对象的语言一样,Pony具有 __多态性(subtyping)__ 。也就是... |
C++ | UTF-8 | 1,542 | 3.921875 | 4 | [] | no_license | // 19_RemoveNthNodeFromEndOfList.cpp : Defines the entry point for the console application.
//
/*
Given a linked list, remove the n-th node from the end of list and return its head.
Example:
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the linked list becomes 1->2->3->5.... |
Java | UTF-8 | 495 | 2.296875 | 2 | [] | no_license | package OODay07;
/**
* @author afeng
* @date 2018/7/25 20:08
**/
public class CommonHandset extends HandSet implements PlayVideo
{
public CommonHandset(String brand, String type)
{
super(brand, type);
}
@Override
public void playing()
{
System.out.println("开始播放音乐<<热雪>>");
... |
Java | UTF-8 | 1,930 | 3.71875 | 4 | [] | no_license | package assignment05;
public class Pizza {
private String pizzaSize;
private int cheese;
private int pepperoni;
private int bacon;
public Pizza()
{
this.pizzaSize = "";
this.cheese = 0;
this.pepperoni = 0;
this.bacon = 0;
}
public ... |
C | UTF-8 | 1,636 | 3.4375 | 3 | [] | no_license | #ifndef SEQUENCESTACK_H_INCLUDED
#define SEQUENCESTACK_H_INCLUDED
#include "./Status.h"
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
typedef int ElemType;
typedef struct{
ElemType *base;
ElemType *top;
int stacksize;
}SqStack;
Status InitStack_Sq(SqStack *S){
S ->base = (ElemType *... |
JavaScript | UTF-8 | 1,049 | 4.96875 | 5 | [] | no_license | /*
피보나치 수
피보나치 수는 0과 1로 시작하며, 다음 피보나치 수는 바로 앞의 두 피보나치 수의 합이 된다.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946…
2 이상의 n이 입력되었을 때, n번째 피보나치 수를 반환하는 fibonacci 함수를 작성하라.
예를 들어 n = 3이라면 2를 반환한다.
*/
function fibonacci(n) {
// const res = Array.from({ length: n + 1});
... |
Java | UTF-8 | 1,657 | 3.734375 | 4 | [] | no_license | package CodingInterviewGuide.demo.Chapter8;
/**
* 转圈打印矩阵
* 给定一个整数矩阵 matrix,请按照转圈的方式打印它。
*/
public class SpiralOrderPrint {
public void spiralOrderPrint(int[][] maxtrix) {
int tR = 0;
int tC = 0;
int dR = maxtrix.length-1;
int dC = maxtrix[0].length -1;
while (tR <= dR &... |
JavaScript | UTF-8 | 423 | 2.5625 | 3 | [] | no_license | $().ready(function(){
$('.recommend-tag').click(function(){
var label = $(this).text();
$('#tag-input').val( $('#tag-input').val() + ' ' + label );
return false;
});
$('#profile-delete').click(function(){
var ret = confirm('プロフィールを削除します。よろしいですか?');
if(ret == true) {
... |
C++ | UTF-8 | 3,619 | 2.5625 | 3 | [] | no_license | #include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 7
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
float tempC = 0;
#define NOTE_D0 -1
#define NOTE_D1 262
#define NOTE_D2 293
#define NOTE_D3 329
#define NOTE_D4 349
#define NOTE_D5 392
#define NOTE_D6 440... |
Java | UTF-8 | 10,290 | 2.140625 | 2 | [
"Apache-2.0"
] | permissive | package com.aliyuncs.policy.retry;
import com.aliyuncs.exceptions.ThrottlingException;
import com.aliyuncs.policy.cache.ThrottlingPool;
import com.aliyuncs.policy.retry.backoff.BackoffStrategy;
import com.aliyuncs.policy.retry.backoff.EqualJitterBackoffStrategy;
import com.aliyuncs.policy.retry.conditions.ExceptionsCo... |
Java | UTF-8 | 7,992 | 1.5625 | 2 | [] | no_license | package com.p280ss.android.ugc.aweme.music.adapter;
import android.content.Context;
import android.support.p029v7.widget.RecyclerView.C1262a;
import android.support.p029v7.widget.RecyclerView.C1293v;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.... |
Rust | UTF-8 | 3,668 | 2.75 | 3 | [] | no_license | use crate::{
accelerator::Accelerator,
bsdf::{builder::Builder as BSDFBuilder, BSDFImpl},
camera::{builder::Builder as CameraBuilder, Cameras},
integrator::Integrator,
interaction::SurfaceInteraction,
light::Lights,
shapes::{Builder as ShapeBuilder, Shapes},
spectrum::from_rgb,
transform::Builder as T... |
Python | UTF-8 | 1,725 | 2.9375 | 3 | [] | no_license | from review import Review
class Recipe:
_all = []
def __init__(self, recipe):
self._recipe = recipe
Recipe._all.append(self)
@classmethod
def all(cls):
return cls._all
@classmethod
def top_three(cls):
recipe_rating_dict = {review._recipe:[] for review in Revi... |
PHP | UTF-8 | 1,579 | 2.53125 | 3 | [] | no_license | <?php
namespace Work\Controller\Admin;
use CoreWine\Http\Request;
class ProfileController extends AdminController{
/**
* ORM\Model
*
* @var
*/
public $model = 'Work\Model\Profile';
/**
* Url
*
* @var
*/
public $url = 'admin/work/profiles';
/**
* Url
*
* @var
*/
public $url_alias = '... |
Java | UTF-8 | 17,651 | 1.859375 | 2 | [] | no_license | /*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the ter... |
Java | UTF-8 | 963 | 2.8125 | 3 | [] | no_license | package frc.robot.drive.motorcontrol.pathplanning;
public class SplineCourseData {
public double x;
public double y;
public double yaw;
public double k;
public double s;
public static double[] vectorize(SplineCourseData[] course, String variable) {
double[] vector = new double[course.l... |
Java | UTF-8 | 1,159 | 3.21875 | 3 | [] | no_license | package com.ctk0327.B1162;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {
static int N, M, K;
static int[][] dp;
static int[][] input;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt()... |
Ruby | UTF-8 | 3,524 | 2.765625 | 3 | [] | no_license | require 'birbl'
describe Birbl::Client do
let(:response) { stub('Response', body: '{"data": "{\"id\":1}"}') }
let(:error_response) { stub('Response', body: '{"error_type": "badrequest"}') }
context 'without initialization' do
context '.instance' do
it 'raises an error' do
expect {
Bi... |
Shell | UTF-8 | 1,500 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
set -e
cd $TRAVIS_BUILD_DIR
./tools/travis/scancode.sh
make lint
make build
make test
export PATH=$PATH:$TRAVIS_BUILD_DIR;
make native_test;
export OPENWHISK_HOME="$(dirname "$TRAVIS_BUILD_DIR")/incubator-openwhisk";
HOMEDIR="$(dirname "$TRAVIS_BUILD_DIR")"
cd $HOMEDIR
# Clone the OpenWhisk code... |
Ruby | UTF-8 | 1,836 | 2.640625 | 3 | [] | no_license | #
# Authentication helpers can be used anywhere in the site
# Usually they'll be at the beginning of a method, or used as a before filter
#
helpers do
# User must be signed in
def auth_slicker
unless session[:user]
session[:flash] = 'You must be signed in to see that page.'
... |
Java | UTF-8 | 1,329 | 2.21875 | 2 | [] | no_license | package com.dakim.collegeevent.model;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "requests")
public class Request {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@NotBlank
p... |
Markdown | UTF-8 | 2,616 | 2.53125 | 3 | [] | no_license | ---
copyright:
years: 2017
lastupdated: "2018-11-12"
---
{:shortdesc: .shortdesc}
{:new_window: target="_blank"}
{:codeblock: .codeblock}
{:pre: .pre}
{:screen: .screen}
{:tip: .tip}
{:download: .download}
# Getting Started
The Hardware Firewall (Shared) provides customers with an essential layer of security that... |
Java | WINDOWS-1258 | 2,749 | 4.28125 | 4 | [
"MIT"
] | permissive | /*
3. Sentence Capitalizer
Write a method that accepts a String object as an argument and returns a copy of the string
with the first character of each sentence capitalized. For instance, if the argument is hello.
my name is Joe. what is your name? the method should return the string Hello. My name
is Joe. What is... |
Markdown | UTF-8 | 1,813 | 2.859375 | 3 | [] | no_license | ## Mock Server
End points:
1. All users: http://localhost:3000/users
2. All habits: http://localhost:3000/habits
3. User habits: http://localhost:3000/users/{userId}/habits
4. Habits trackers: http://localhost:3000/habits/{habitId}/trackers
### How to create a multi-dimensional table: a note to myself
- Add `<tr></t... |
C# | UTF-8 | 3,922 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using Sys... |
Java | UTF-8 | 481 | 2.15625 | 2 | [] | no_license | package com.mx.atrium.androidatriumexample.models;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* Created by robmontgomery on 10/7/16.
*/
public class Institutions {
@SerializedName(value="institutions")
public List<Institution> Institution;
public void setAccounts(L... |
Java | UTF-8 | 2,681 | 1.984375 | 2 | [] | no_license | package co.jp.aoyama.macchinetta.app.maker;
import java.io.Serializable;
import java.util.Date;
public class MakerForm implements Serializable {
private static final long serialVersionUID = -6090284908261677467L;
private String makerCode;
private String makerName;
private String makerId;
private Da... |
Java | UTF-8 | 4,004 | 2.078125 | 2 | [] | no_license | package com.Flanaria;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import twitter4j.DirectMessage;
import twitter4j.Status;
import twitter4j.URLEntity;
public class Utils_TwitterElement
{
public static int getColor(Twitter... |
TypeScript | UTF-8 | 1,252 | 2.640625 | 3 | [] | no_license | import { PrismaClient } from '@prisma/client'
import { Schema } from '../schema'
export const sleep = (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms))
export class Seeder {
private prisma: PrismaClient
constructor(private readonly schema: Schema) {
if (process.env.DATABASE_URL) {
this.pr... |
Python | UTF-8 | 442 | 3.90625 | 4 | [] | no_license | import random
def coinflip():
heads = 0
tails = 0
unknown = 0
userinput = int(input("How times would you like to flip the coin? "))
for i in range(0,userinput):
x = random.randrange(0, 3)
if x == 0:
heads = heads + 1
elif x == 1: tails = tails + 1
elif... |
TypeScript | UTF-8 | 1,281 | 2.625 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
//Este import regresa 2 subcarpetas atras ../ donde está app
//y sirve para importar la clase creada en el archivo hero.ts
//El Hero es el que se definió abajo en el export
import {Hero} from '../hero';
//Se elimina esta línea xq ahora se inyectará a través de un "ser... |
JavaScript | UTF-8 | 295 | 3.1875 | 3 | [] | no_license | const button=document.querySelector(".like-btn")
const buttonText=button.querySelector(".like-text")
let isLiked=false;
button.addEventListener('click',()=>{
isLiked=!isLiked;
if(isLiked){
buttonText.innerHTML="取消";
}else{
buttonText.innerHTML="点赞";
}
})
|
Python | UTF-8 | 2,787 | 3.578125 | 4 | [
"MIT"
] | permissive | import pandas_flavor as pf
import pandas as pd
from typing import Union
@pf.register_dataframe_method
def move(
df: pd.DataFrame,
source: Union[int, str],
target: Union[int, str],
position: str = "before",
axis: int = 0,
) -> pd.DataFrame:
"""
Move column or row to a position adjacent to ... |
C# | UTF-8 | 13,008 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Globalization;
using System.Threading.Tasks;
namespace App4
{
public class Puissance4
{
#region Propriétés
public Jeu jeu { get; set; }
public int?[,] matrice; // [x,y] : x => ligne et y... |
SQL | UTF-8 | 28,530 | 2.84375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 26-02-2015 a las 09:36:36
-- Versión del servidor: 5.6.21
-- Versión de PHP: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
Java | UTF-8 | 1,318 | 2.296875 | 2 | [] | no_license | package dental_clinic;
import dental_clinic.console_ui.ProgramMenu.ProgramMenu;
import web_ui.config.SpringWebConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConf... |
Java | UTF-8 | 2,979 | 2.953125 | 3 | [] | no_license | package project;
import java.io.*;
import java.math.RoundingMode;
import java.net.*;
import java.text.DecimalFormat;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
import org.json.JSONObject;
/**
* This class defines the player object that is used in LiveGameData class.
* NOTE: This class wil... |
C | UTF-8 | 1,485 | 3.859375 | 4 | [] | no_license | //
// main.c
// Frazione ridotta ai minimi termini
//
// Created by Simone Cavicchioli on 22/11/15.
// Copyright © 2015 Simone Cavicchioli. All rights reserved.
//
// Riempire la prima colonna di una tabella di 10 righe con interi pseudo-casuali compresi tra 10 e 100 e la seconda colonna della tabella con interi p... |
TypeScript | UTF-8 | 1,979 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | /**
* Declares new "kinds" within TypeDoc.
*
* A "kind" is a way for TypeDoc to understand how to document something. Mostly, these have a 1:1 relationship with some sort of TypeScript concept. This is unsuitable for our purposes, since there's no notion of a "command" or "execute method" in TypeScript. To that e... |
Java | UTF-8 | 1,407 | 2.0625 | 2 | [] | no_license | package serviscepde.com.tr.Dialogs;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.EditText;
import android.widget.TextView;
import androidx.ann... |
PHP | UTF-8 | 2,484 | 2.640625 | 3 | [] | no_license | <?php
namespace red\addressbook\controls
{
use \red\EventArgument;
use \red\web\ui\controls\Repeater;
use \red\web\ui\controls\TemplateControl;
use red\web\ui\controls\Button;
use \red\web\ui\IThemable;
/**
* TemplateControl
*/
class AddressbookControl extends TemplateControl implements IThemable
{
/**
... |
Java | UTF-8 | 345 | 2.375 | 2 | [] | no_license | package propias.dominio.clases;
/** Un usuari convidat. Es un tipus especial d'usuari. Aquest usuari té com a nom
* convidat i no té contrasenya.
*
* @author Petru Rares Sincraian
*
*/
public class UsuariConvidat extends UsuariGeneral {
/** La constructora per defecte
*
*/
public UsuariConvi... |
TypeScript | UTF-8 | 1,298 | 2.84375 | 3 | [] | no_license | class InstagramFollow {
private ulList: HTMLElement;
private scrollContainer: HTMLElement;
private allButtons: HTMLElement[];
private followButtons: HTMLElement[];
constructor(private maxFollows: number = 0){
this.ulList = document.querySelector("div[role='dialog'] ul");
this.scrollContainer = this.ulList.par... |
C++ | UTF-8 | 4,284 | 3 | 3 | [] | no_license | #include "classes.h"
#include <bits/stdc++.h>
using namespace std;
product::product()
{
name="unknown";
id=-1;
}
product::product(string s,int ID,int q,char b,int sh,bool t)
{
name=s;
id=ID;
quantity=q;
block=b;
shelf=sh;
type=t;
}
string product::getname() const {return name;}
int p... |
PHP | UTF-8 | 2,541 | 2.9375 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
$connect = mysqli_connect("localhost", "root", "", "phpprojectbase");
if(isset($_POST['edit'])){
$query = " UPDATE persons SET First_name='$_POST[First_name]',Last_name='$_P... |
Java | UTF-8 | 354 | 2.921875 | 3 | [] | no_license | package clases;
public class Contenedor<T> {
private T dato;
synchronized public T get() {
T result = this.dato;
this.dato = null;
return result;
}
synchronized public void put(T valor) {
this.dato = valor;
}
synchronized boolean datoDisponible() {
ret... |
C++ | UTF-8 | 3,213 | 2.5625 | 3 | [
"MIT"
] | permissive | #include <PubSubClient.h> //mqtt
#include "DHT.h"
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
const char* mqtt_server = "192.168.0.5";
int val = ... |
JavaScript | UTF-8 | 1,250 | 3.015625 | 3 | [] | no_license | const validUrlUtf8 = require('valid-url-utf8')
const { BASE_URL } = require('./config')
class UrlShortener {
constructor () {
this.alphabet = '0123456789abcdefghijklmnopqrstuvwxyz'
this.size = 1
this.generatedEntries = 0
this.shortenedUrls = {}
this.shortUrls = {}
}
shorten(url) {
if (!v... |
C++ | UTF-8 | 1,993 | 2.734375 | 3 | [] | no_license | #include "../include/imageLoader.h"
#include "../include/picoPNG.h"
#include "../include/IOManager.h"
#include "../include/Errors.h"
namespace gameEngine{
GLtexture imageLoader::loadPNG(std::string filepath){
GLtexture texture = {};
std::vector<unsigned char> in;
std::vector<unsigned char... |
C++ | UTF-8 | 718 | 3.21875 | 3 | [] | no_license | // Convert a given std::string (containing UTF-8 chars) to a unicode string and vice versa.
#pragma once
#include <iostream>
#include <boost/noncopyable.hpp>
namespace uberstealth {
class StringToUnicode : public boost::noncopyable {
public:
StringToUnicode(const std::string& str) :
s_(str),
ws_(NULL) {}
~S... |
C++ | UTF-8 | 177 | 2.578125 | 3 | [] | no_license | #ifndef CITY_H
#define CITY_H
class City
{
public:
City(double x, double y);
double distance(const City& src) const;
private:
double _x, _y;
};
#endif // CITY_H
|
C# | UTF-8 | 974 | 2.859375 | 3 | [] | no_license | using Base.Architecture.UserManagement;
using System;
using Base.Architecture.DatabaseManager;
using Base.Architecture.UserManagement.Models;
namespace LibraryManagementCore
{
public class Core
{
private User _currentUser;
private readonly UserManagementCore _userManagement;
public Co... |
JavaScript | UTF-8 | 1,377 | 2.71875 | 3 | [] | no_license | var randomStuff = require('../helper_routines/getRandomLineOfFile');
var createTopic = require('../domain/CreateTopic');
function generateTopic() {
let mainTopic = randomStuff.getRandomLine('./public/resources/MainTopics.txt').trim();
let secondaryTopic = randomStuff.getRandomLine('./public/resources/Seconda... |
Swift | UTF-8 | 2,662 | 2.8125 | 3 | [
"MIT"
] | permissive | //
// BasicTestScene.swift
// SwiftSpriterExample
//
// Created by Matt on 8/28/16.
// Copyright © 2016 BiminiRoad. All rights reserved.
//
import UIKit
import SpriteKit
import SwiftSpriter
class BasicTestScene: SKScene, TextureLoader, AnimationNodeDelegate {
var animationManager: AnimationManager!
var an... |
Java | UTF-8 | 1,929 | 1.726563 | 2 | [] | no_license | package com.luckyun.base.user.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import com... |
Ruby | UTF-8 | 889 | 3.5625 | 4 | [] | no_license | class LinkedList
attr_accessor :head, :tail, :size
def initialize(items = [])
@size = 0
append_nodes(items)
end
def append_nodes(items)
items.each { |item| append_node(item) }
end
def append_node(item)
if @head.item.nil?
@head.item
end
tail_node = Node.new(item: item, _next... |
Java | UTF-8 | 656 | 3.078125 | 3 | [] | no_license | public class TreeIntSet implements IntSet {
IntegerTreeNode root;
public void add(int n) {
if(root == null) {
root = new IntegerTreeNode(n);
} else {
root.add(n);
}
}
public boolean contains(int n) {
if(root == null) {
return false;
... |
Python | UTF-8 | 2,135 | 3.78125 | 4 | [] | no_license | import unittest
import random
import Homework
class HomeworkSequenceFunctions(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_exponentiate(self):
expected = [1,2,4,8,16,32,64,128,256]
actual = Homework.power_of_two(9)
self.assertEqual(e... |
C++ | UTF-8 | 790 | 3.703125 | 4 | [] | no_license | Write a smart pointer class. A smart pointer is a data type, usually implemented with templates, that simulates a pointer while also providing automatic garbage collec- tion.
It automatically counts the number of references to a SmartPointer<T*> object and frees the object of type T when the reference count hits zero.... |
Python | UTF-8 | 988 | 2.8125 | 3 | [] | no_license | class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
start = i = 0
while i<len(nums):
nums[start] = nums[i]
start +=1
i+=1
if i<len(nums):
if nums[i] == nums... |
Java | UTF-8 | 8,984 | 3.125 | 3 | [] | no_license | package fall2018.csc2017.gameCentre.slidingtiles;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import fall2018.csc2017.gameCentre.LoginActivityController;
import fall2018.csc2017.gameCentre.ScoreTuple;
/**
* Manage a board, including swapping tiles, checkin... |
Python | UTF-8 | 2,777 | 2.96875 | 3 | [] | no_license | #!/usr/bin/env python
import json
from kafka import KafkaProducer
from flask import Flask, request
app = Flask(__name__)
producer = KafkaProducer(bootstrap_servers='kafka:29092')
# * Adds metadata such as Host/IP address, User-Agent to all generated events
# * Encodes it (default: encoding='utf-8', #errors='stri... |
Markdown | UTF-8 | 656 | 2.640625 | 3 | [] | no_license | # HARPG-Pheno-Generator
HARPG Pheno Generator used for ARPG (art role play game) on the platform DeviantArt. It is used to generate new foals (babies) based on the perferred colours of the user.
Users can input and limit the number of genes included to be randomized, and choose to include or omit certain genes. The ge... |
Python | UTF-8 | 483 | 3.546875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 7 13:35:19 2018
@author: DS-Tm
"""
# -*- coding: utf-8 -*-
def addition(a, b):
c = a + b
print(c)
def soustraction(a, b):
c = a - b
print(c)
def division(a, b):
if (a == 0 and b == 0):
print("Indermination")
if b == 0:
... |
Java | UTF-8 | 804 | 2.453125 | 2 | [] | no_license | package rest.dtos.productlists;
import java.util.List;
import java.util.stream.Collectors;
import model.products.ProductList;
import rest.dtos.offers.OfferDTO;
import util.Money;
public class ProductListDTO {
public int id;
public String name;
public Money totalAmount;
public List<SelectedProductDTO> selectedPr... |
Java | UTF-8 | 15,942 | 2.109375 | 2 | [] | no_license | /**
* 项目名: eyah
* 包名: com.sttri.eyah.controls.dialog
* 版本信息: 1.0.0
* Copyright (c) -版权所有
*/
package com.xiaoma.beiji.controls.dialog;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.view.Window;
import android.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.