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 | 712 | 2.15625 | 2 | [] | no_license | package com.app.services;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.app.daos.BlogRepo;
import com.app.pojos.Blog;
import com.app.pojos.Tags;
@Service
@Transactional
public ... |
Java | UTF-8 | 335 | 1.9375 | 2 | [] | no_license | package co.edu.uniajc.service;
import java.util.List;
import co.edu.uniajc.model.Tarjeta;
public interface TarjetaService {
public Tarjeta findById(int id);
public void save(Tarjeta Tarjeta);
public void update(Tarjeta Tarjeta);
public List<Tarjeta> listaTarjeta();
public void delete(Tarjeta Tar... |
PHP | UTF-8 | 2,444 | 2.578125 | 3 | [] | no_license | <?php
// Headers
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
header('Access-Control-Allow-Methods: GET');
header('Access-Control-Allow-Headers: Access-Control-Allow-Headers, Content-Type, Access-Control-Allow-Methods, Authorization, X-Requested-With');
in... |
Markdown | UTF-8 | 12,042 | 2.609375 | 3 | [] | no_license |
**In order to use the Tencent Integration Platform Service(the “Service”), you shall read and comply with this Tencent Integration Platform Service Level Agreement (this “Agreement”) and the [ Tencent Cloud Service Agreement ](https://intl.cloud.tencent.com/document/product/301/9248) . This Agreement contains, among... |
Python | UTF-8 | 3,073 | 2.640625 | 3 | [] | no_license |
import numpy as np
import pdb
import json
from sklearn.linear_model import LogisticRegression
from sklearn.svm import LinearSVC as svc
from sklearn.ensemble import RandomForestClassifier as rfc
from sklearn.ensemble import GradientBoostingClassifier as gbc
import xgboost as xgb
from sklearn.metrics import accuracy_sco... |
Markdown | UTF-8 | 4,248 | 3.875 | 4 | [] | no_license |
# JavaScript's expressions and operators
JavaScript has both binary and unary operators, and one special ternary operator, the conditional operator. A binary operator requires two operands, one before the operator and one after the operator
For example, 3+4 or x*y
For example, x++ or ++x
### Assignment operators
An ... |
C++ | GB18030 | 19,479 | 2.796875 | 3 | [] | no_license | /*****************************************************************************************
ģ Wave.cpp
˵ ˮЧʵֺ
ˣħ
Wave VC汾ƱĻд,
ʵˮЧĴӣο˲ϴ룬رοְ
VB汾
V1.0.0
*****************************************************************************************/
/**************************************************************... |
Java | UTF-8 | 791 | 2.765625 | 3 | [] | no_license | package MyPlayer;
import java.lang.reflect.Array;
import java.util.ArrayList;
/**
* Created by kiel on 29/05/17.
*/
public class Artist {
protected int id_Artist ;
protected String name ;
protected static ArrayList<String> listArtist = new ArrayList<String>();
public Artist(Strin... |
Java | UTF-8 | 753 | 2.15625 | 2 | [] | no_license | package com.example.rsocketclient.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.rsocket.RSocketRequester;
import org.springframework.messaging.rsocket.RSocketStrategies;
import reactor.core.publisher.Mono;
... |
TypeScript | UTF-8 | 868 | 2.734375 | 3 | [] | no_license | import { User } from '../../entities/user/UserModel';
import { HttpService } from 'src/utils/services/HttpService';
const URLS = {
SIGNUP: '/auth/signup',
SIGNIN: '/auth/signin',
SIGNOUT: '/auth/signout'
};
export class UserService {
public constructor(private readonly httpService: HttpService) {}
public s... |
C++ | UTF-8 | 2,510 | 2.625 | 3 | [] | no_license | /*
*
* Project Astraeus
* By: Darren Kent
*
*/
#include "Astroid.h"
Astroid::Astroid( Node* node ) {
mActive = false;
mAstraeusCollisionPlaying = false;
mOre = false;
mPlayerCollisionPlaying = false;
mDYaw = 0.0f;
mDPitch = 0.0f;
mDRoll = 0.0f;
mDX = 0.0f;
mDY = 0.0f;
m... |
Markdown | UTF-8 | 8,097 | 2.609375 | 3 | [
"MIT"
] | permissive | <h1 align="center">
<img alt="LaunchBase" src="https://storage.googleapis.com/golden-wind/bootcamp-launchbase/logo.png" width="400px" />
</h1>
<p align="center">
<a href="https://rocketseat.com.br">
<img alt="Made by Rocketseat" src="https://img.shields.io/badge/made%20by-Rocketseat-%23F8952D">
</a>
<a hre... |
Java | UTF-8 | 1,075 | 1.570313 | 2 | [] | no_license | /**
* <copyright>
* </copyright>
*
* $Id: VMwareVirtualEthernetNICDefImpl.java,v 1.2 2008/04/17 15:47:25 barnold Exp $
*/
package com.ibm.ccl.soa.deploy.virtualization.impl;
import org.eclipse.emf.ecore.EClass;
import com.ibm.ccl.soa.deploy.virtualization.VMwareVirtualEthernetNICDef;
import com.ibm.cc... |
TypeScript | UTF-8 | 466 | 2.90625 | 3 | [
"MIT"
] | permissive | // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
export default class MockCollection {
constructor(collection = []) {
this.collection = collection;
this.add = jest.fn(this.add.bind(this));
this.remove = jest.fn(this.remove.bind(this));
}
add(item) {
this.collection.pu... |
JavaScript | UTF-8 | 1,249 | 3.34375 | 3 | [] | no_license |
// const store = {
// name: 'hadi',
// properties: {
// hobby: 'programming',
// age: 20,
// },
// friends: ['ali'],
// girlFriends: ['Anna', 'Tania', 'Sara', 'Sanaz', 'Elmira', 'Negin', 'Mahsa']
// };
import { createStore, combineReducers } from 'redux';
const reducerOne = ... |
JavaScript | UTF-8 | 689 | 2.578125 | 3 | [] | no_license | /**
* Created by eden_liu on 2017/6/28.
*/
const express = require('express');
const path = require('path');
const app = express();
const filePath = path.join(__dirname, 'celine.jpg');
app.use((req, res, next) => {
res.sendFile(filePath, (err) => {
if (err) {
next(new Error('Error sending f... |
Swift | UTF-8 | 3,209 | 3.109375 | 3 | [] | no_license | //
// FridgeAPI.swift
// FridgeNotes
//
// Created by Chris Woodard on 10/8/16.
// Copyright © 2016 Minimal. All rights reserved.
//
import Foundation
/************************************************************************
* Really simplified NSURLSession-based REST client.
***********************************... |
Java | UTF-8 | 1,566 | 2.0625 | 2 | [] | no_license | package com.summer.dt.mq.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.summer.common.idgenerate.SnowflakeIdWorker;
import com.summer.common.utils.GsonUtils;
import com.summer.dt.mq.common.constant.OrderConstant;
import com.summer.dt.mq.dao.OrderMapper;
import com.summer.dt.mq.dao.T... |
C++ | UTF-8 | 1,243 | 2.796875 | 3 | [] | no_license | #include<bits/stdc++.h>
#include "StudentLoginController.h"
#include "StudentHomePageController.h"
//#include "StudentHomePageController.cpp"
#include "Student.h"
using namespace std;
bool StudentLoginController::open(Student student) {
system("clear");
string studentUserName;
string studen... |
Ruby | UTF-8 | 1,430 | 2.578125 | 3 | [] | no_license | #Story 1 of 3
require 'rails_helper'
describe 'As a visitor' do
before(:each) do
@chef = Chef.create!(name: "boyardee")
@dish = Dish.create!(name: 'cornbread',
description: 'bread',
chef_id: @chef.id)
@ingredient1 = Ingredient.create!(name: 'corn',
... |
SQL | UTF-8 | 3,433 | 3.5625 | 4 | [] | no_license | CREATE SEQUENCE receipt.receipt_id_seq;
CREATE TABLE receipt.receipt (
id integer not null default nextval('receipt.receipt_id_seq'),
clinic_id INTEGER NOT NULL,
type_id INTEGER NOT NULL,
series VARCHAR,
num VARCHAR,
issue_dt DATE NOT NULL,
employee_position_id INTEGER NOT NULL,
patient_id INTEGER NOT ... |
SQL | UTF-8 | 3,689 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 02, 2020 at 05:28 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
Markdown | UTF-8 | 1,352 | 3.265625 | 3 | [] | no_license | ---
group: graphql
title: createEmptyCart mutation
---
The `createEmptyCart` mutation creates an empty shopping cart for a guest or logged in customer. You can allow the system to generate a cart ID, or assign a specific ID.
If you are creating a cart for a logged in customer, you must include the customer's authoriz... |
Markdown | UTF-8 | 789 | 2.796875 | 3 | [] | no_license | ---
layout: page
title: What's the address of my website?
permalink: /help/address-of-booking-page/
description: The address or URL of your website
keywords: booking page, website, address, domain
---
# What's the address of my website?
You'll find the address of your website on the Settings page of your AppointmentG... |
Java | UTF-8 | 3,007 | 2.15625 | 2 | [] | no_license | package com.ubtechinc.bluetoothrobot.old;
import android.util.Log;
import com.ubtrobot.commons.Priority;
import com.ubtrobot.mini.voice.VoiceListener;
import com.ubtrobot.mini.voice.VoicePool;
import com.ubtrobot.speech.listener.TTsListener;
/**
* @desc : 本地语音播报助手类
* @author: zach.zhang
* @email : Zach.zhang@ubtr... |
Markdown | UTF-8 | 1,130 | 2.78125 | 3 | [] | no_license | Vous n'avez pas le temps de faire vos courses après le boulot ?
Vous êtes actuellement en mobilité réduite et vous souhaitez quelqu'un qui fasse les courses à votre place ?
Vous cherchez une personne pouvant faire vos courses lorsque vous êtes surbooké ?!
Vous êtes producteur et vous souhaitez vous faire connaitre sur... |
Python | UTF-8 | 2,478 | 3.65625 | 4 | [] | no_license | from random import choice
class Node:
def __init__(self,x,y,num):
self.x = x
self.y = y
self.num = num
def display(self):
fill(0)
ellipse(self.x,self.y,10,10)
def connect(self,other):
strokeWeight(1)
line(self.x,sel... |
Java | UTF-8 | 637 | 3.734375 | 4 | [] | no_license | package scanner;
import java.util.Scanner;
public class Ascending {
public static void main(String[] args)
{
int[] a=new int[10];
int temp;
Scanner scan=new Scanner(System.in);
System.out.println("Enter the values");
for(int i=0;i<10;i++)
{
a[i]=scan.nextInt();
}
temp=a[0];
for(int i=0;i<10;i++)
{
... |
Python | UTF-8 | 187 | 3.859375 | 4 | [] | no_license | soma = 0
for c in range(1, 7):
num = int(input('Digite [{}] valor:'.format(c)))
if num % 2 == 0:
soma += num
print('A soma dos numeros pares é: {}'.format(soma)) |
C | UTF-8 | 1,007 | 3.53125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
void fnPush(int [],int *,int);
int fnPop(int [],int *);
int main()
{
int iOp1,iOp2,iRes=0;
int i,iaStack[10],iTop=-1;
char acPrefix[10],cSymb;
printf("\nEnter a valid prefix expression\n");
scanf("%s",acPrefix);
for(i=strlen(acPre... |
Java | UTF-8 | 1,241 | 2.40625 | 2 | [] | no_license | package com.valentsolutions.stxt.dom;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import com.valentsolutions.stxt.StxtException;
import org.w3c.dom.Document;
/**
* Fragment for holding small pieces of structured t... |
Java | UTF-8 | 8,152 | 2.109375 | 2 | [] | no_license | package com.kanjian.star.search.services;
import java.util.HashMap;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.IntField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.document.Strin... |
C# | UTF-8 | 1,778 | 2.515625 | 3 | [
"MIT"
] | permissive | using System;
namespace Rafy.Serialization.Mobile
{
/// <summary>
/// Interface to be implemented by any object
/// that supports serialization by the
/// MobileFormatter.
/// </summary>
public interface IMobileObject
{
/// <summary>
/// Method called by MobileFormatter whe... |
Markdown | UTF-8 | 1,278 | 3.265625 | 3 | [] | no_license | ## 题目位置
[https://leetcode-cn.com/problems/er-cha-shu-de-zui-jin-gong-gong-zu-xian-lcof/](https://leetcode-cn.com/problems/er-cha-shu-de-zui-jin-gong-gong-zu-xian-lcof/)
<br/>
## 题解
```java
/**
* 以每一个节点为根节点进行便利,看看能否找到 p、q,返回最后一个条件成立的可能
*
* @author 小道仙
* @date 2020/9/1
*/
TreeNode re... |
Java | UTF-8 | 4,094 | 2.59375 | 3 | [
"MIT"
] | permissive | package dslab;
import java.io.InputStream;
import java.io.PrintStream;
import dslab.client.IMessageClient;
import dslab.client.MessageClient;
import dslab.mailbox.IMailboxServer;
import dslab.mailbox.MailboxServer;
import dslab.monitoring.IMonitoringServer;
import dslab.monitoring.MonitoringServer;
import dslab.names... |
Python | UTF-8 | 122 | 3.625 | 4 | [] | no_license | for i in range(10):
if(i == 6):
break # it can terminate the loop even the condition is true
print i
|
C# | UTF-8 | 3,709 | 2.609375 | 3 | [] | no_license | using CarSellersClasses;
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class OrderList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// if first time page is displayed
if (I... |
Java | UTF-8 | 536 | 1.960938 | 2 | [
"MIT"
] | permissive | package org.jzp.code.solr.client.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 分页参数注解
*
* @author jiazhipeng
* @version 1.0
* @date 2016-06-23
*/
@Target(ElementType.FIELD)
@Reten... |
C++ | UTF-8 | 1,014 | 2.875 | 3 | [] | no_license | /*
* @lc app=leetcode id=902 lang=cpp
*
* [902] Numbers At Most N Given Digit Set
*/
// @lc code=start
class Solution {
public:
int atMostNGivenDigitSet(vector<string>& D, int N) {
const string strN(to_string(N));
int i(0);
string strD(D.size(), ' ');
for ... |
Java | UTF-8 | 1,138 | 2.0625 | 2 | [
"Apache-2.0"
] | permissive | package com.kuliginstepan.mongration.service.impl;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import com.kuliginstepan.mongration.MongrationException;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono;
cla... |
C++ | UTF-8 | 381 | 2.546875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,m;
cin>>n>>m;
if(n>m)
swap(n,m);
if(n%2)
{
if(m%2)
{
cout<<(n)*(m/2) + n-n/2;
}
else
{
cout<<(n)*(m/2);
}
}
else
{
if(m%2)
{
cout<<(n)*(m/2) + n/2;
}
else
... |
C# | UTF-8 | 721 | 2.734375 | 3 | [] | no_license | using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;
namespace WPF_Data_Binding
{
public partial class BindingList : Window
{
ObservableCollection<Person> liste = new ObservableCollection<Person>();
public ObservableCollection<Person> GetPerson()
... |
Java | UTF-8 | 346 | 2.0625 | 2 | [] | no_license | package com.zhongcheng.jenkins.javajenkins.dao.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
@Data
@AllArgsConstructor //全参构造函数
public class Pages<T> {
public Pages(int count, List<T> rows) {
this((long)count, rows);
}
private Long count;
private Lis... |
Python | UTF-8 | 343 | 3.34375 | 3 | [] | no_license | from concurrent.futures import ThreadPoolExecutor
class S:
def __init__(self):
self.L = []
def plus(self, n):
for i in range(n):
self.L.append(i)
s = S()
N = 1000000
with ThreadPoolExecutor() as ex:
for i in range(3):
ex.submit(s.plus, N)
print(len(s.L)) # 3000000
p... |
JavaScript | UTF-8 | 252 | 3.234375 | 3 | [
"MIT"
] | permissive | function printElementFromArray(arr){
let stepSize = Number(arr[arr.length - 1]);
arr.pop();
for (let i = 0; i < arr.length; i+= stepSize) {
console.log(arr[i]);
}
}
printElementFromArray(['dsa',
'asd',
'test',
'tset',
'2']); |
PHP | UTF-8 | 354 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace Tyler36\SocialAuth\Helpers;
use Route;
class ProviderRoute
{
/**
* Get the Socialite provider from route.
*
* @return mixed
*/
public static function get()
{
if (null === Route::current()) {
return false;
}
return Route::current()->... |
Java | UTF-8 | 20,402 | 1.90625 | 2 | [] | no_license | package com.example.tfg.Sistems.SistemaPerfil.Fragments;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widg... |
Java | UTF-8 | 2,051 | 2.421875 | 2 | [
"MIT"
] | permissive | package br.com.compasso.uol.backend.services.implementation;
import br.com.compasso.uol.backend.dtos.NovaCidadeDto;
import br.com.compasso.uol.backend.enums.EstadoEnum;
import br.com.compasso.uol.backend.exceptions.ResourceNotFoundException;
import br.com.compasso.uol.backend.models.Cidade;
import br.com.compasso.uol.... |
PHP | UTF-8 | 2,061 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace think
{
class Process
{
private $processPipes;
private $status = 3;
private $processInformation = ['running' => true];
public function __construct($path,$data)
{
$this->processPipes = new \think\model\Relation($path, $data);
}
}
... |
Go | UTF-8 | 4,448 | 2.75 | 3 | [
"MIT"
] | permissive | // Package pgstatus converts postgres errors to gRPC statuses.
package pgstatus
import (
"database/sql"
"fmt"
"strings"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// SQLState error code interface.
type SQLState interface {
SQLState() string
}
// FromError returns a gRPC status.Status rep... |
Python | UTF-8 | 929 | 3.21875 | 3 | [
"BSD-2-Clause"
] | permissive | """Cast polynomial to numpy.ndarray, if possible."""
from __future__ import annotations
import numpy
import numpoly
from ..baseclass import PolyLike
def tonumpy(poly: PolyLike) -> numpy.ndarray:
"""
Cast polynomial to numpy.ndarray, if possible.
Args:
poly:
polynomial to cast.
... |
Rust | UTF-8 | 8,531 | 3.015625 | 3 | [
"MIT"
] | permissive | use std::mem;
extern crate rlang;
use rlang::*;
#[test]
fn simple_unsigned_addition() {
let ins = vec![
Instruction::LiteralUnsigned(1),
Instruction::LiteralUnsigned(2),
Instruction::AddUnsigned,
];
let mut x = Process::new(&ins);
let ret = x.run(64);
assert_eq!(x.stack(... |
PHP | UTF-8 | 1,200 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
/**
* File containing the {@see Mailcode_Traits_Commands_Validation_URLEncode} trait.
*
* @package Mailcode
* @subpackage Validation
* @see Mailcode_Traits_Commands_Validation_URLEncode
*/
declare(strict_types=1);
namespace Mailcode;
use Mailcode\Commands\ParamsException;
/**
* Command validation drop-... |
Markdown | UTF-8 | 4,688 | 2.5625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: Hibernate
date: 2017-10-18 09:29:52 +0800
categories: [Tech]
excerpt: 学习Hibernate方法
tags:
- CN
- java
- 框架
---
![enter description here][1]
![enter description here][2]
![enter description here][3]
![enter description here][4]
![enter description here][5]
![enter description here][6... |
C | UTF-8 | 5,211 | 3.453125 | 3 | [] | no_license | #include <stdio.h>
// TP3 Mabille Thomas
int exercice1() {
int a=0, b=0;
printf("Saisir deux entier\n");
scanf(" %d%d",&a,&b);
if(a<=b) {
printf("%d est le plus grand", b);
}
else if(a>b) {
printf("%d est le plus grand", a);
}
}
int exercice2() {
int longueur=0, largeur... |
Python | UTF-8 | 4,167 | 2.578125 | 3 | [] | no_license | import numpy as np
import pandas as pd
import torch
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
class NN_Model(torch.nn.Module):
def __init__(self, input_size, hidden_layers, device):
super(NN_Model, self).__init__()
self.device = device
self.relu ... |
Shell | UTF-8 | 663 | 3.8125 | 4 | [] | no_license | #!/bin/sh
make() {
for dep in 'cc' 'rgbgfx'; do
if [ -z `which $dep` ]; then
echo "Could not find $dep in path"
exit 1
fi
done
set -x
cc -o tools/pkmncompress tools/pkmncompress.c
for file in `find . -name '*.png'`; do
rgbgfx -o "`dirname $file`/`basename $file .png`.2bpp" $file
done
for file in... |
Ruby | UTF-8 | 179 | 2.828125 | 3 | [
"MIT"
] | permissive | # Sample code from Programing Ruby, page 399
require 'drb'
DRb.start_service()
obj = DRbObject.new(nil, 'druby://localhost:9000')
# Now use obj
puts "Sum is: #{obj.add(1, 2, 3)}"
|
Go | UTF-8 | 2,064 | 2.65625 | 3 | [
"MIT"
] | permissive | package main
import (
"reflect"
"testing"
)
func Test_Parseini(t *testing.T) {
playbooks, err := parseini("./test/playbook.ini")
if err != nil {
t.Error("parseini error: ", err)
}
my_playbook_1 := playbooks[0]
my_playbook_2 := playbooks[1]
if my_playbook_1.playbook_type == "scp" && my_playbook_2.playbook_ty... |
Java | UTF-8 | 10,540 | 2.53125 | 3 | [] | no_license | package com.wsf.source;
import com.wsf.config.Configure;
import org.apache.log4j.Logger;
import java.io.*;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
* 资源池
*/
@SuppressWarnings("all")
public class Source {
//url池
private stat... |
Java | UTF-8 | 602 | 3.09375 | 3 | [] | no_license | package xsf.design.observer.normal;
import java.util.Vector;
/**
* Author: xushangfei
* Time: created at 2017/5/2.
* Description: 被观察者
*/
public abstract class Subject {
private Vector<Observer> observers;
//增加一个观察者
public void registerObserver(Observer o) {
observers.add(o);
}
//删除一... |
Python | UTF-8 | 3,339 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | import os
import pathlib
import pytest
from mopidy_local import translator
@pytest.mark.parametrize(
"local_uri,file_uri",
[
("local:directory:A/B", "file:///home/alice/Music/A/B"),
("local:directory:A%20B", "file:///home/alice/Music/A%20B"),
("local:directory:A+B", "file:///home/alic... |
Java | UTF-8 | 3,646 | 2.109375 | 2 | [] | no_license | package com.example.telkomsel.myshoppingmall;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.... |
Markdown | UTF-8 | 3,533 | 2.875 | 3 | [] | no_license | ---
wordpress_id: 336
layout: post
title: Chicago -or- Erin missed me
excerpt: |-
I decided I'd meet my brother in Chicago. Thanks to Hiro who knows how to get anywhere, I was able to take the Greyhound to Chicago and back.
<P>It was a good 3 hour bus ride, but I wasn't wasting too much time since it was early i... |
Python | UTF-8 | 167 | 3.15625 | 3 | [] | no_license | x = int(input())
alfabeto = chr(65)
for _ in range(1,x+1):
temp ='';
for i in range(0, _):
temp+=alfabeto
print(temp)
alfabeto=chr(65+_)
|
Java | UTF-8 | 1,092 | 3.75 | 4 | [] | no_license | package com.leetcode.tenToEleven;
/**
* Created by LiuLiHao on 2020/3/20 0020 下午 04:14
* @author : LiuLiHao
* 描述:
* 爱丽丝和鲍勃一起玩游戏,他们轮流行动。爱丽丝先手开局。
*
* 最初,黑板上有一个数字 N 。在每个玩家的回合,玩家需要执行以下操作:
*
* 选出任一 x,满足 0 < x < N 且 N % x == 0 。
* 用 N - x 替换黑板上的数字 N 。
* 如果玩家无法执行这些操作,就会输掉游戏。
*
* 只有在爱丽丝在游戏中取得胜利时才返回 True,否则返回 false... |
TypeScript | UTF-8 | 1,019 | 3.171875 | 3 | [] | no_license | /*
This class is supose to hold the current weather Json.
*/
export class CityWeather{
weather: Weather[]; //contains the weather
main: Main; //contains the main onformation about the weather
name: string; //name of the city
}
class Weather{
main: string;
description: string; /... |
C# | UTF-8 | 1,351 | 2.53125 | 3 | [] | no_license | using System;
using System.Net.Http;
using System.Threading.Tasks;
using IdentityModel;
using IdentityModel.Client;
namespace Client
{
class Program
{
static async Task Main(string[] args)
{
var httpClient = new HttpClient();
var discoveryDocument = await httpClient.Ge... |
Python | UTF-8 | 927 | 2.6875 | 3 | [
"MIT"
] | permissive | from tensorflow.keras import Model
from tensorflow.keras.layers import Conv2D, Flatten, Dense, Input
import tensorflow as tf
class TCNNNet(Model):
def __init__(self, output_dim):
"""
Args:
output_dim: 网络需要n个输出,对应n个动作的累积回报
"""
super(TCNNNet, self).__init__()
sel... |
C | UTF-8 | 432 | 3.34375 | 3 | [] | no_license | #include "holberton.h"
/**
* *_strncat - check the code for Holberton School students.
* @dest: this is the first accountant.
* @src: this is the second accountant.
* @n: this is the third accountant.
* Return: Always 0.
*/
char *_strncat(char *dest, char *src, int n)
{
int i;
int c;
for (i = 0; *(dest + i) ... |
Java | UTF-8 | 252 | 1.835938 | 2 | [] | no_license | package br.mack.modeloEntidade;
import java.util.GregorianCalendar;
/**
*
* @author Grupo 01 - Tema: Loja virtual
*/
public class Pagamento {
public int identificador;
public GregorianCalendar data;
public double valor;
}
|
C# | UTF-8 | 1,583 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BW.GateWay.Lottery.X5
{
/// <summary>
/// 胆码 不位胆 后三二码
/// </summary>
public class Player78 : IX5
{
protected override IX5.NumberRange NumberType
{
get
{
... |
Markdown | UTF-8 | 4,387 | 3.203125 | 3 | [
"MIT"
] | permissive | +++
title = "Mocking functions in Go"
date = 2014-04-10T11:35:00Z
updated = 2014-05-06T09:54:05Z
tags = ["Go", "testing", "programming", "golang"]
blogimport = true
type = "post"
[author]
name = "Nate Finch"
uri = "https://plus.google.com/115818189328363361527"
+++
Functions in Go are first class citizens, that mea... |
C# | UTF-8 | 322 | 2.9375 | 3 | [
"MIT"
] | permissive | namespace PietDotNet;
public enum DirectionPointer
{
right = 0,
down = 1,
left = 2,
top = 3,
}
public static class DirectionPointerExtensions
{
public static DirectionPointer Rotate(this DirectionPointer dp, long steps)
{
return (DirectionPointer)((long)dp + steps).Modulo(4);
}
}
|
Markdown | UTF-8 | 165 | 2.546875 | 3 | [] | no_license | # Cheap-Best-Information-Retrieval-
An AI application that returns list of products as per the query after reviewing their price and reviews by several customers.
|
Shell | UTF-8 | 1,262 | 2.546875 | 3 | [] | no_license | #echo -e "\n\nExecuting ~/.zshenv\n\n"
###########################################################
# Setting local gtest
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
###########################################################
# Export vars
#export JAVA_HOME=/usr/lib/jvm/java-6-sun
#export JA... |
C++ | UTF-8 | 974 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "istream_archive.h"
#include <archive.h>
#include <archive_entry.h>
using namespace nano;
archive_istream_t::archive_istream_t(archive* ar) :
m_archive(ar)
{
}
io_status archive_istream_t::advance(const std::streamsize num_bytes, buffer_t& buffer)
{
while (static_cast<std::streamsize>(buffer... |
Java | UTF-8 | 5,498 | 1.632813 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... |
C# | UTF-8 | 12,727 | 2.9375 | 3 | [
"MIT"
] | permissive | using System;
using Xunit;
namespace Pylypeiev.Extensions.Tests
{
public class StringSearchingExtensionsTests
{
[Fact]
public void EndsWithIgnoreCaseTest()
{
//Arrange
string str = "abC";
//Act
var result = str.EndsWithIgnoreCase("c");
... |
Markdown | UTF-8 | 684 | 2.84375 | 3 | [] | no_license | ## Velkommen til denne hjemmeside
Dette er en hjemmeside for en opgave, som skulle være lavet for 100 år siden, men nu er den da nogenlunde lavet. Ellers handler der her ikke rigtig om noget.For jeg kan ikke helt se hvad jeg skulle skrive her, men det finder man måske ud af på et senere tidspunkt.
### UFC - Copenhage... |
Python | UTF-8 | 1,605 | 3.453125 | 3 | [] | no_license | from turtle import Turtle
POSITIONS = [(0, 0), (-20, 0), (-40, 0)]
class Snake:
def __init__(self):
self.turtle_obj = []
self.snake_body()
def snake_body(self):
for postion in POSITIONS:
tim = Turtle("square")
tim.color("deeppink3")
tim.p... |
Python | UTF-8 | 1,811 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | """Detail Yeti's regular expression indicator structure."""
import re
from marshmallow import fields, post_load
from yeti.core.errors import ValidationError
from .indicator import Indicator, IndicatorSchema
class RegexSchema(IndicatorSchema):
"""(De)serialization marshmallow.Schema for Malware objects."""
... |
C# | UTF-8 | 3,556 | 2.84375 | 3 | [
"MIT"
] | permissive | using System.Linq;
using Microsoft.AspNetCore.Mvc;
using PacktContactsCore.Model;
using PacktContactsCore.Context;
namespace PacktContactsCore.Controllers
{
[Route("api/[controller]")]
public class ContactsController : Controller
{
private readonly ContactsContext _context;
public Contacts... |
C++ | UTF-8 | 4,940 | 3.15625 | 3 | [
"CC0-1.0",
"ISC",
"BSL-1.0"
] | permissive | // Honeycomb, Copyright (C) 2015 NewGamePlus Inc. Distributed under the Boost Software License v1.0.
#pragma once
#include "Honey/Math/Alge/Alge.h"
#include "Honey/Misc/Optional.h"
namespace honey
{
/// A contiguous region of referenced (not owned by object) memory
/**
* A buffer is a light wrapper aro... |
C# | UTF-8 | 549 | 2.65625 | 3 | [
"MIT"
] | permissive | using System.IO;
using System.Windows.Media.Imaging;
namespace DrumbleApp.Shared.Infrastructure.Helpers
{
public abstract class Imagable
{
protected static BitmapImage GetImage(byte[] imageBinary)
{
BitmapImage bitmapImage = new BitmapImage();
using (MemoryStream ms = n... |
Python | UTF-8 | 4,667 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | import json
from random import randint
from secp256k1 import FLAG_ALL
from secp256k1.key import SecretKey
from secp256k1.pedersen import Secp256k1, RangeProof
from grin.keychain import ChildKey, Identifier
from grin.proof import MultiPartyBulletProof, TwoPartyBulletProof
def test_proofs(create=False):
secp = Secp... |
C# | UTF-8 | 7,819 | 3.125 | 3 | [] | no_license | using System;
namespace ConsoleApplication1
{
class Program
{
static int num_k = 6;
static int num_alt = 6;
static void Domin(int[,,] bo, int[,] result)
{
for (int i = 0; i < num_k; i++)
for (int j = 0; j < num_alt; j++)
... |
Python | UTF-8 | 3,408 | 3.765625 | 4 | [] | no_license | class Board(object):
def __init__(self, text=None):
self._data = list(text.replace('\n', '')) if text else [' '] * 9
def corners(self):
return {(x, y): self[(x, y)]
for (x, y) in [(0, 0), (2, 0), (0, 2), (2, 2)]}
def sides(self):
return {(x, y): self[(x, y)]
... |
Markdown | UTF-8 | 1,133 | 2.890625 | 3 | [] | no_license | # JS13K 2020
This repository allow you to quick start your JS13K project to develop, compile, minify and zip you JS13K project.
Uses adfab-gulp-boilerplate to compile sass or less, concat you JS, minify your assets...with additional tasks to zip and improve minification
[You can play the game here thanks to the GitH... |
Python | UTF-8 | 752 | 3.546875 | 4 | [] | no_license | # Hint: use Google to find python function
####a)
from dateutil import parser
from datetime import datetime
date_start = '01-02-2013'
date_stop = '07-28-2015'
date_start_object_1 = parser.parse(date_start)
date_stop_object_1 = parser.parse(date_stop)
print (date_stop_object_1 - date_start_object_1)
####b) ... |
C# | UTF-8 | 1,380 | 3.109375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace TechFestXmlSolution
{
/// <summary>
/// class CounterClass is used to get Cpu usage and timing calculations
/// </summary>
class CounterClass
{
public CounterClass()
{
... |
Java | UTF-8 | 1,302 | 2.921875 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package visitorpattern;
import abstracao.AbstractElement;
import abstracao.IElement;
import abstracao.IVisitor;
/**
*
... |
JavaScript | UTF-8 | 5,245 | 2.65625 | 3 | [] | no_license | import DomRegisteredProperty from "../Classes/domRegisteredProperty"
import DomRegisteredModule from "../Classes/domRegisteredModule"
import DOM from "../Classes/dom"
export default class DOMController {
static #settings = {
modules: [
],
properties: [
],
modificators: [
... |
Python | UTF-8 | 4,448 | 4.375 | 4 | [
"MIT"
] | permissive | #!/usr/local/bin/python3
# encoding:utf-8
"""
python3 面向对象
类(Class): 用来描述具有相同的属性和方法的对象的集合。它定义了该集合中每个对象所共有的属性和方法。对象是类的实例。
类变量:类变量在整个实例化的对象中是公用的。类变量定义在类中且在函数体之外。类变量通常不作为实例变量使用。
数据成员:类变量或者实例变量用于处理类及其实例对象的相关的数据。
方法重写:如果从父类继承的方法不能满足子类的需求,可以对其进行改写,这个过程叫方法的覆盖(override),也称为方法的重写。
实例变量:定义在方法中的变量,只作用于当前实例的类。
继承:即一个派生类(derived c... |
Markdown | UTF-8 | 4,927 | 2.578125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Azure CLI skriptexempel - omstart VMs | Microsoft Docs
description: 'Skriptexempel Azure CLI - omstart av virtuella datorer efter tagg och -ID: t'
services: virtual-machines-linux
documentationcenter: virtual-machines
author: allclark
manager: douge
editor: tysonn
tags: azure-service-management
ms.as... |
Go | UTF-8 | 2,971 | 3.140625 | 3 | [
"MIT"
] | permissive | package examples
import (
"fmt"
"strconv"
"strings"
"github.com/go-color-term/go-color-term/coloring"
)
const innerBoxSize = 182
type ColorMatrixExample struct{}
func (example *ColorMatrixExample) GetTitle() string {
return "8-bit color matrix"
}
func (example *ColorMatrixExample) GetDescription() string {
... |
Java | UTF-8 | 2,678 | 1.875 | 2 | [] | no_license | package com.gudeng.commerce.gd.admin.service.impl;
import java.net.MalformedURLException;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.caucho.hessian.client.HessianProxyFactory;
import com.gudeng.... |
Java | UTF-8 | 1,141 | 2.765625 | 3 | [] | no_license | package com.example.rest.models;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.List;
/**
*
* This Interface describe all the interaction with the database
*
*/
public interface IUserrepository {
/**
*
* Add a new user
* @par... |
Python | UTF-8 | 4,162 | 2.546875 | 3 | [] | no_license | import numpy as np
import math
import random
import string
import os
import sys
import cPickle as pickle
from threading import Thread, RLock
import sketch
import opti
import results
lock = RLock()
if len(sys.argv) < 2:
print "Missing argument"
print "Usage: python run_random_cos.py <datasetFolder>"
exit(1)
da... |
PHP | UTF-8 | 741 | 3.296875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0"
] | permissive | <?php
function print_resultado($array) {
$n = count($array);
if ($n == 0) {
echo "<p>Nenhum registro foi encontrado pela consulta.</p>";
return;
}
$cabecalho = array();
foreach ($array[0] as $chave => $value)
$cabecalho[] = $chave;
echo '<table class="table table-striped"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.