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 | 320 | 2.375 | 2 | [
"MIT"
] | permissive | package de.henningBrinkmann.mybatisSample.util;
public class SurroundingClassnameLogger extends LoggerAdapter {
private String name;
public SurroundingClassnameLogger() {
this.name = "???";
}
public void setName(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
}
|
Java | UTF-8 | 946 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | package com.steven.common.valid;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.HashSet;
import java.util.Set;
/**
* @author steven
* @desc 自定义校验器的处理方法
* @date 2021/2/8 10:51
*/
public class ShowStatusValidator implements ConstraintValidator<ShowS... |
PHP | UTF-8 | 3,710 | 2.515625 | 3 | [] | no_license | <?php
/*
* 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.
*/
include_once '../DAO/daoUsuarios.php';
include_once '../Controladores/UsuarioController.php';
include_once '../Modelos/UsuarioM... |
Python | UTF-8 | 56 | 2.734375 | 3 | [] | no_license | import math
def square_root(a):
return math.sqrt(a) |
C# | UTF-8 | 9,344 | 2.625 | 3 | [
"MIT"
] | permissive | namespace Ren.CMS.CORE.Language
{
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Security;
using Ren.CMS.CORE.SettingsHelper;
using Ren.CMS.CORE.... |
Java | UTF-8 | 1,036 | 3.828125 | 4 | [] | no_license | package ch06_Sorting;
import java.util.Scanner;
public class ShellSort2 {
//셀 정렬
static void shellSort(int[] a,int n){
int h;
for(h=1; h<n/9; h=h*3+1);
for(; h>0; h/=3)
for(int i=h; i<n; i++){
int j;
int tmp = a[i];
for (j=i-... |
Java | UTF-8 | 2,594 | 2.46875 | 2 | [] | no_license | package com.stockbit.AnswerNo2.listener;
import com.stockbit.AnswerNo2.model.MappingData;
import com.stockbit.AnswerNo2.model.Data;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;
import java.time.Durati... |
JavaScript | UTF-8 | 2,747 | 3.03125 | 3 | [] | no_license |
$("#error").hide();
$("#tipo").change(function(e){
var opcion = $("select option").filter(":selected").val();
if (opcion === "1"){
$("#rut-label").html("Rut");
}
else if (opcion === "2"){
$("#rut-label").html("Pasaporte");
}
}
);
$("#formulario").submit(function(e){
var me... |
Markdown | UTF-8 | 4,494 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | ---
title: Control de Acceso
linktitle: Control de Acceso
description: Gestionar el Control de Acceso
weight: 10
---
Jenkins X utiliza políticas de control de acceso basado en roles - en inglés Role-Based Access Control (RBAC) - para controlar el acceso a sus diversos recursos. La aplicación de las políticas es propor... |
PHP | UTF-8 | 1,818 | 2.65625 | 3 | [] | no_license | <?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"^M# HTTP="true"
$hostname = "localhost";
$database = "polywords";
$username = "root";
$password = "cire1069";
$table = "scores";
$mysql = mysql_pconnect($hostname, $username, $password) or die(mysql_error());
mysql_select_db($database, $mysql);
//print_r($_POST)... |
Python | UTF-8 | 1,051 | 2.8125 | 3 | [] | no_license | from Myro import *
init("sim")
def forwardback (x):
for i in range(0,x):
forward(3, 0.5)
backward(3, 0.5)
stop
forwardback(14)
turnRight(10, 4.5)
turnLeft(10, 4.5)
def cross (x):
for i in range(0,x):
forward(5, 0.25)
backward(5, 0.25)
turnLeft(9, .2)
wait... |
Java | UTF-8 | 572 | 2.90625 | 3 | [] | no_license | package inJava.chapter2;
import inJava.chapter0.LinkedListNode;
public class Q8 {
public LinkedListNode loopDetection(LinkedListNode l1) {
if (l1 == null || l1.next == null)
return null;
LinkedListNode dummy = new LinkedListNode(0);
dummy.next = l1;
LinkedListNode fast = l1.next, slow = l1;
while (fast.... |
Python | UTF-8 | 1,897 | 3.171875 | 3 | [] | no_license | # Unsolved
with open('p059_cipher.txt') as f:
nums = f.readlines()
nums = [int(x) for x in nums[0].strip().split(',')]
print len(nums), len(nums) / 3
perms = []
validPerms = []
def populatePerms(perms):
for first in xrange(97, 122 + 1):
for second in xrange(97, 122 + 1):
for third in xrange(97, 122 + 1):
... |
C | UTF-8 | 746 | 2.9375 | 3 | [] | no_license | #include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "math.h"
int main(int argc, char *argv[]) {
int d, s, i, m[32], n[32], a = 0, b = 0, c;
scanf("%d %d", &d, &s);
for (i = 0; i < d; i++) {
scanf("%d %d", &m[i], &n[i]);
a += m[i];
b += n[i];
}
if (s < a || s >... |
Markdown | UTF-8 | 2,015 | 2.96875 | 3 | [
"MIT"
] | permissive | # AttrArray
A high performance ActiveRecord concern for Rails using the PostgreSQL array type.
## Installation
To install add the line to your Gemfile:
```ruby
gem 'attr_array'
```
And `bundle install`.
## Dependencies
AttrArray is developed as a ActiveRecord model concern, therefore it is dependent upon ActiveS... |
C++ | GB18030 | 1,919 | 2.953125 | 3 | [] | no_license | #include "EnemyBase.h"
EnemyBase::EnemyBase()
:sprite(NULL)
, hpBgSprite(NULL)
, animationRight(NULL)
, animationLeft(NULL)
, animationExplode(NULL)
, runSpeed(0)
, maxHp(0)
, currHp(0)
, hpPercentage(100)
, hpBar(NULL)
, enemySuccessful(false)
{
}
EnemyBase::~EnemyBase()
{
}
bool EnemyBase::init()
{
if (!Sprite::i... |
Python | UTF-8 | 2,707 | 2.828125 | 3 | [] | no_license | import numpy as np
import struct
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import pylab
import read_mnist
from sklearn.decomposition import PCA
def display_reduced(data, labels):
plt.figure(figsize=(12, 10))
axes = plt.subplot(111)
type0_x = []
type0_y = []
type1_x = []
type1_... |
C# | UTF-8 | 520 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace xave.web.generator.helper.Util
{
public static class ArrayHandler
{
public static T[] Add<T>(this T[] target, T item)
{
if (item == null) return target;
if (target == null) t... |
Java | UTF-8 | 1,361 | 2.265625 | 2 | [] | no_license | package compasso.estagio.grupo.projeto5.Telas.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
@Entity
public class Aula imple... |
C# | UTF-8 | 2,035 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
namespace AutoRenamer.BOL.Utils
{
public static class XmlSerializationHelper
{
public static string SerializeObject<T>(... |
Markdown | UTF-8 | 2,792 | 3.453125 | 3 | [
"MIT"
] | permissive | ##Project
###Write a program to list out local shoe stores and the brands of shoes they carry. Make a Store class and a Brand class.
* _Create a database called shoes and a testing database called shoes_test, and remember to follow proper naming conventions for your tables and columns. As you create your tables, ... |
Markdown | UTF-8 | 1,092 | 3.375 | 3 | [] | no_license | # Actividad de ensamble
En esta parte se invita a la discusión y se proponen los siguiente
ejercicios de programaci\'on. Los puede realizar en papel.
Puedes usar el repositorio que está en el la siguiente liga [:link:](https://github.com/UNAM-FESAc/c-prgrmmng-I-FESAc)
- Realice un programa en C que imprima en pantal... |
Markdown | UTF-8 | 1,869 | 2.59375 | 3 | [
"MIT"
] | permissive | ## PIG DICE GAME
### Description
This is a dice rolling game referred to as pig dice. Minimum number of players is 2.
### Requirements
* Atom or Visual studio
### Technologies Used
HTML
CSS
JAVASCRIPT
JQUERY
### BDD
| BEHAVIOR. This program should handle | INPUT. When it receives | OUTPUT. It should retu... |
Markdown | UTF-8 | 907 | 2.953125 | 3 | [] | no_license | ## 凯利公式
当前讨论凯利公式是按照最完美的情况,且投资的金额为单位1
| 结果 | 概率 | 盈利(元) |
| ---- | ---- | -------- |
| 成功 | P | b |
| 失败 | 1-P | 0(亏光) |
那么得到重复多次最优的投资比例为:
```
f=(Pb-(1-P))/b
```
从上述公式中我们可以得出:
```
1. 当Pb-(1-P)<=0的时没有必要投资
2. 当Pb-(1-P)=1时可以all in
3. 其他任何时候都必须按照公式按照一定比例投资
```
**注意事项:**
介于市场上的概率不好预测并且概率也是在不断变化,你的盈利也在不断变化... |
C | UTF-8 | 558 | 2.9375 | 3 | [] | no_license | #include <stdio.h>
#define LOCAL
int main(void)
{
#ifdef LOCAL
freopen("data2-5.in","r",stdin);
freopen("data2-5.out","w",stdout);
#endif
int a,b,c,tmp;
while(scanf("%d%d%d",&a,&b,&c) != EOF)
{
if (a==0 || b==0 ||c==0)
{break;}
printf("%d.",a/b);
a = a%b*10;
whi... |
JavaScript | UTF-8 | 2,438 | 2.5625 | 3 | [
"MIT"
] | permissive | import nextID from "makeup-next-id";
const focusExitEmitters = {};
function doFocusExit(el, fromElement, toElement) {
el.dispatchEvent(
new CustomEvent("focusExit", {
detail: { fromElement, toElement },
bubbles: false, // mirror the native mouseleave event
}),
);
}
function onDocumentFocusIn(e... |
Java | UTF-8 | 2,460 | 2.484375 | 2 | [] | no_license | package com.nambar.schoolbuslocator;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.util.Log;
public class PreferencesStore {
private static PreferencesStore _instance = new PreferencesStore(... |
Python | UTF-8 | 2,308 | 2.78125 | 3 | [] | no_license | import sqlite3
import pygal
def getAdminData():
conn = sqlite3.connect("C:/Users/Administrator/Desktop/rollerorange.github.io-master/sportschoolDatabase.db")
c = conn.cursor()
cursor = c.execute('SELECT klantID FROM KLANT_SPORTSCHOOL')
klanten = c.fetchall()
klantenAantal = len(klanten)
curso... |
C# | UTF-8 | 3,478 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using nilnul.num.natural;
namespace nilnul.num.rational
{
/// <summary>
/// guratee that denominator is positive.
/// </summary>
public partial class Fraction_natural
:
... |
Java | UTF-8 | 559 | 1.617188 | 2 | [
"LGPL-2.1-or-later",
"EPL-1.0",
"Apache-2.0",
"LGPL-2.0-or-later"
] | permissive | package org.strategoxt.lang.parallel.stratego_parallel;
import org.spoofax.interpreter.core.IContext;
import org.strategoxt.lang.Context;
/**
* @author Lennart Kats <lennart add lclnet.nl>
*/
public class InteropRegisterer extends org.strategoxt.lang.InteropRegisterer {
@Override
public void register(IContext co... |
Python | UTF-8 | 4,266 | 2.71875 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | #!/usr/bin/python2
import os
import pygame
import pycurl
import StringIO
import time
import signal
import logging
import RPi.GPIO as GPIO
WEBCAM_URL = 'http://user:password@10.13.37.128/snapshot.cgi'
class ImageViewer(object):
def __init__(self):
self._running = False
self._image_surf = None
... |
SQL | UTF-8 | 896 | 3.5 | 4 | [] | no_license | -- Drop existing tables
DROP TABLE original_terms;
DROP TABLE ontology_terms;
DROP TABLE symbols;
DROP TABLE synonyms;
-- create metis tables
CREATE TABLE ontology_terms (
id serial,
ontology_uri text,
ontology_term text,
source_uri text,
short_name text,
PRIMARY KEY (i... |
Rust | UTF-8 | 978 | 3.46875 | 3 | [
"Apache-2.0"
] | permissive | fn main() {
let _v: Vec<i32> = Vec::new();
let _v2 = vec![1, 2, 3];
let mut v3 = Vec::new();
v3.push(5);
v3.push(6);
v3.push(7);
v3.push(8);
let v4 = vec![1, 2, 3, 4, 5];
let third: &i32 = &v4[2];
println!("The third element is {}", third);
match v4.get(2) {
Some(t... |
C | UTF-8 | 657 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
// Ejemplo aprenderaprogramar.com
int main() {
FILE* fichero;
char *uno="Espero se pueda esta mierda";
fichero = fopen("cursoAF1.txt", "w");
fputs(uno, fichero);
fclose(fichero);
printf("Proceso completado");
FILE *archivo;
char caracteres[20... |
Java | UTF-8 | 12,505 | 1.5 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2021 Google LLC
*
* 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 agreed to... |
Markdown | UTF-8 | 1,634 | 3.25 | 3 | [] | no_license | # Setting up my SCSS Environment
- This Readme is to help me remember how to setup my SCSS environment.
Install Sass with Ruby:
```
gem install sass
```
#### Compile CSS to SCSS:
To compile your SCSS into CSS you need to let your Sass know where you are writing your code and give it a place to precompile the CSS into... |
JavaScript | UTF-8 | 3,531 | 2.5625 | 3 | [] | no_license | var N3 = require('n3'),
fs = require('fs'),
byline = require('byline'),
request = require('superagent'),
zlib = require('zlib');
if (process.stdin.isTTY) {
console.error("This node script only works with a stream (via bash pipe) of n-quads");
process.exit(1);
}
var prefixCcList = require('./pr... |
PHP | UTF-8 | 653 | 3.0625 | 3 | [] | no_license | <?php
namespace Lib;
/**
* Input Class
*/
class Input
{
/**
* Protect from xss attack
*
* @param mixed $dirty
* @return void
*/
public static function sanitize($dirty)
{
return htmlentities($dirty, ENT_QUOTES, "UTF-8");
}
/**
* getter for data from... |
C# | UTF-8 | 672 | 2.828125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ploeh.Study.ExtensibilityForMasses
{
public class Debug : Combine<IExp, IPrint>
{
public Debug() : base(new IntFactory(), new IntPrint())
{
}
public ov... |
C# | UTF-8 | 2,075 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EverLight.TreeStructure.Core.BusinessLogic;
using EverLight.TreeStructure.Core.Utility;
namespace EverLight.TreeStructure.Core
{
public class Application
{
public string PredictedContainerName { get; set; }
... |
Java | UTF-8 | 575 | 3.125 | 3 | [] | no_license | public class LongestCommonPrefix{
public String longestCommonPrefix(String[] strs){
String res = "";
if(strs==null || strs.length==0) return res;
int minLength = Integer.MAX_VALUE;
for(int i=0;i<strs.length;++i){
if(strs[i].length()<minLength) minLength = strs[i].length();
}
for(int i=0;i<minLength;++i)... |
Markdown | UTF-8 | 962 | 2.671875 | 3 | [] | no_license | # Exercise-Files-for-Dart-Course-DSCKIIT

## Short Description
* I teach Dart in DSCKIIT's Youtube channel. So the code, I write are uploaded here.
### 👉 If you like this repo then please give it a ⭐️
<br>
## Tutorial Link
* Youtube link - [Link](h... |
Python | UTF-8 | 4,736 | 3.03125 | 3 | [] | no_license | import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
class get_metrics:
def __init__(self, dt_range):
self.dt_range = dt_range
def graph_output(self, y, name):
fig = plt.figure()
ts = pd.Series(y,name=name)
ts.plot(x = "Time", y = name, title = "{} for Te... |
Shell | UTF-8 | 274 | 3.171875 | 3 | [] | no_license | #!/usr/bin/env bash
for((a=0;a<5;a++)); do
echo "Interation $i:"
for((b=1;b<3;b++))
do
if [$a -gt 2 ] && [ $a -lt 4 ]
then
continue 2
fi
var3=$[ $a * $b]
echo " The result of $a * $b is $var3"
done
done
|
PHP | UTF-8 | 1,140 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Omnipay\GoCardlessV2Tests\Message;
use Omnipay\GoCardlessV2\Message\CreateCustomerBankAccountRequest;
use Omnipay\GoCardlessV2\Message\BankAccountResponse;
use Omnipay\Tests\TestCase;
class CustomerBankAccountResponseTest extends TestCase
{
/**
* @var CreateCustomerBankAccountRequest|\Mocker... |
Markdown | UTF-8 | 7,949 | 2.828125 | 3 | [] | no_license | +++
title = "Как смартфон тебя подслушивает"
date = 2020-03-07T22:39:01+05:00
author = "Rustam Safin"
cover = "img/assistant.jpg"
tags = ["безопасность"]
description = "Спросили, может ли быть такое, что телефон не такой конфиденциальный, как хотелось бы. Рассказываю."
showFullContent = false
+++
Анна спроси... |
Rust | UTF-8 | 1,132 | 3.515625 | 4 | [
"MIT"
] | permissive | // Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
// pub struct TreeNode {
// pub val: i32,
// pub left: Option<Rc<RefCell<TreeNode>>>,
// pub right: Option<Rc<RefCell<TreeNode>>>,
// }
//
// impl TreeNode {
// #[inline]
// pub fn new(val: i32) -> Self {
// TreeNode {
// val,
... |
TypeScript | UTF-8 | 1,666 | 2.765625 | 3 | [
"MIT"
] | permissive | import { FormGroup, FormControl, ValidatorFn } from '@angular/forms';
export function emailValidator(control: FormControl): {[key: string]: any} {
var emailRegexp = /[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$/;
if (control.value && !emailRegexp.test(control.value)) {
return {invalidEmail: true};
}... |
PHP | GB18030 | 3,646 | 2.90625 | 3 | [] | no_license | <?php
namespace Framework\Core;
class Base{
public $_filter;
/*
* Cache Base ------------------------------------------------------
*/
public function Cache( $type = 'file' ){
$cache = LC("Cache");
$cache->type = $type;
return $cache;
}
/*
* ֵ -------------------... |
JavaScript | UTF-8 | 481 | 2.625 | 3 | [] | no_license | $("#learn-more a").click(function(e) {
e.preventDefault();
var container = $('body');
var scrollTo = $('#section-2');
container.animate({
scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop()
})
});
$("#go-down a").click(function(e) {
e.preventDefault();
var container = $... |
Java | UTF-8 | 5,640 | 1.898438 | 2 | [
"MIT"
] | permissive | /*
* Phrase API Reference
*
* The version of the OpenAPI document: 2.0.0
* Contact: support@phrase.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.phrase.client.model;
import j... |
C# | UTF-8 | 2,075 | 2.6875 | 3 | [] | no_license | using System.Collections.Generic;
using System.Dynamic;
using System.Threading.Tasks;
namespace Common.DynamicModel.Expandos
{
/// <summary>
/// 动态属性的上下文
/// </summary>
public class ExpandoPropertyContext<TResult>// where TResult : Expando
{
public ExpandoPropertyContext(TResult data)
... |
Java | UTF-8 | 4,117 | 3.703125 | 4 | [] | no_license | package com.company;
import java.sql.Array;
import java.util.*;
public class TicTacToe {
static ArrayList<Integer> playerPosition = new ArrayList<>(); //Array list for player position.
static ArrayList<Integer> cpuPosition = new ArrayList<>(); //Array list for cpu position.
public static void main(St... |
C# | UTF-8 | 1,765 | 2.859375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using MongoDB.Bson;
namespace OneTimeUses2
{
public class PaperFormatted //public for web app
{
public ObjectId Id { get; set; }
public string Fields { get; set; } //I would prefer Enums for most, but get it working f... |
Java | UTF-8 | 7,616 | 1.890625 | 2 | [
"Apache-2.0",
"CC-BY-SA-4.0",
"CC-BY-4.0",
"CC-BY-NC-SA-4.0"
] | permissive | /*
* Copyright 2017 NEOautus Ltd. (http://neoautus.com)
*
* 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 applicab... |
C# | UTF-8 | 2,579 | 3.40625 | 3 | [] | no_license | using System;
namespace Graupel.Util
{
public static class Expect
{
public static T CanCast<T>(object value)
{
if (value.GetType() != typeof(T))
throw new InvalidOperationException("Value must be of type " + typeof(T));
return (T) value;
}
... |
Go | UTF-8 | 3,694 | 2.890625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | //
// Copyright (c) 2016-2023 Snowplow Analytics Ltd. All rights reserved.
//
// This program is licensed to you under the Apache License Version 2.0,
// and you may not use this file except in compliance with the Apache License Version 2.0.
// You may obtain a copy of the Apache License Version 2.0 at http://www.apach... |
Markdown | UTF-8 | 9,204 | 2.65625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | > *The following text is extracted and transformed from the kalahariresorts.com privacy policy that was archived on 2019-06-15. Please check the [original snapshot on the Wayback Machine](https://web.archive.org/web/20190615131127id_/https%3A//www.kalahariresorts.com/legal) for the most accurate reproduction.*
# Legal... |
C++ | UTF-8 | 561 | 2.96875 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n,x,y,flag=1,i;
cin >> n;
int arr2[n]={0};
cin >> x;
int arr[x];
for(i=0;i<x;i++)
{
cin >> arr[i];
arr2[arr[i]-1]++;
}
cin >> y;
int arr1[y];
for(i=0;i<y;i++)
{
cin >> ar... |
Python | UTF-8 | 313 | 2.796875 | 3 | [] | no_license | from sklearn.neighbors import NearestNeighbors
import numpy as np
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
nbrs = NearestNeighbors(n_neighbors=2, algorithm='ball_tree').fit(X)
distances, indices = nbrs.kneighbors(X)
indices=array([[0, 1],
[1, 0],
[2, 1],
[3, 4],
[4, 3],
[5, 4]])
|
JavaScript | UTF-8 | 931 | 2.734375 | 3 | [
"MIT"
] | permissive | /*
* 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.
*/
function check(form)/*function to check userid & password*/
{
/*the following code checkes whether the entered userid and passwo... |
Markdown | UTF-8 | 7,008 | 2.828125 | 3 | [] | no_license | ---
layout: post
title: "Android的ViewPager学习笔记!"
date: 2014-07-30 07:30:00
categories: android
type: android
---
viewpager可以实现屏幕滑动的效果,用来做画廊,启动界面这些都不错,而且比Flipper,Gallery都快,顺畅。可以考虑把tongli的那个图片换成viewpager。
**官方的viewpager使用很简单:**
首先在布局设置viewpager控件,然后重写PagerAdapter,里面的data是List<View>即可,主要重载两个方法:
{% highlight jav... |
Java | UTF-8 | 2,369 | 2.734375 | 3 | [] | no_license | package model;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public class ScheduleDetails {
private final StringProperty Team1;
private final StringProperty ... |
Java | UTF-8 | 1,274 | 1.726563 | 2 | [] | no_license | package com.dk.service;
import com.dk.data.dto.SearchCommentDto;
import com.dk.data.entity.Comment;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 评论 Service
*
* @author ban
* @date 2018/12/12
*/
public interface CommentS... |
Python | UTF-8 | 298 | 3.390625 | 3 | [] | no_license | class MyError(Exception):
def __init__(self,message=""):
self.message=message
def __str__(self):
return "MyError"
def fun():
raise MyError("My test error message")
try:
fun()
except MyError as e:
print("MyError",e.message)
print("*"*100)
raise MyError()
|
Markdown | UTF-8 | 781 | 2.671875 | 3 | [] | no_license | # threejs-examples-dae-tools-sphere-normals-invert
The idea here is to start a project in which I am [creating a sphere in blender with inverted normals so that when I load a DAE file export into a threejs project](https://dustinpfister.github.io/2022/05/31/threejs-examples-dae-tools-sphere-normals-invert/) the 'front... |
SQL | UTF-8 | 5,194 | 3.015625 | 3 | [] | no_license | SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
CREATE TABLE IF NOT EXISTS `waste_total` (
`id` s... |
Java | UTF-8 | 1,977 | 2.234375 | 2 | [] | no_license | package com.dimple.project.blog.blog.service;
import com.dimple.project.blog.blog.domain.Blog;
import java.util.List;
/**
* @className: BlogService
* @description:
* @auther: Dimple
* @Date: 2019/3/16
* @Version: 1.0
*/
public interface BlogService {
/**
* 根据条件查询所有的blog
*
* @param blog 带有条件信... |
Ruby | UTF-8 | 129 | 2.953125 | 3 | [] | no_license | puts "Hey, donne-moi un nombre"
user_number = gets.chomp.to_i
i = user_number
i.times do
puts "Salut, ça farte?"
end
|
Java | UTF-8 | 3,758 | 2.3125 | 2 | [] | no_license | package user.model.service;
import static common.JDBCTemplate.*;
import java.sql.Connection;
import java.util.ArrayList;
import petSitter.model.vo.PetSitter;
import user.model.dao.MyMatchingDao;
import matching.model.vo.Matching;
public class MyMatchingService {
MyMatchingDao mmd = new MyMatchingDao();
... |
Java | UTF-8 | 1,489 | 2.1875 | 2 | [] | no_license | package com.quizwish.quiz.component;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import com.quizwish.quiz.services.QuizService;... |
PHP | UTF-8 | 2,268 | 2.875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: alonso
* Date: 2019-05-18
* Time: 14:27
*/
namespace Project\Posts;
use Project\Utils\ProjectDao;
use Firebase\JWT\JWT;
class PostsDao
{
private $dbConnection;
public function getAll()
{
$sql = "SELECT * FROM Posts ORDER BY ID DESC";
return $t... |
Java | UTF-8 | 126 | 1.640625 | 2 | [] | no_license | package ca.customer.dao.models;
/**
* Created by Vivek on 25-02-2017.
*/
public enum Status {
DRAFT,ACTIVE,INACTIVE
}
|
Rust | UTF-8 | 2,487 | 2.71875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | // Copyright 2019-2023 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use std::convert::TryFrom;
use libipld::cid::{
multihash::{Code, MultihashDigest},
Version,
};
use unsigned_varint::{decode as varint_decode, encode as varint_encode};
use crate::libp2p_bitswap::*;
/// Prefix represents all... |
C++ | UTF-8 | 1,178 | 2.640625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <windows.h>
#include <vector>
enum class AutoMovementDirection
{
UP,
DOWN,
LEFT,
RIGHT,
IDLE
};
struct Coordinates
{
int x;
int y;
};
class Map {
public:
Map();
void GenerateMap() const;
void Control();
void Bounderies();
void Automa... |
PHP | UTF-8 | 1,372 | 2.609375 | 3 | [] | no_license | <?php
/**
* 159339Assignment3
* XIN WANG 15397438
* Tianxiang Han 13064237
* Zhen Cheng 13040788
*/
class BadTransException extends Exception
{
/**
* BadTransException constructor.
* @param null $message message to throw
* @param int $code exception code
*/
public function __construct($... |
Markdown | UTF-8 | 2,104 | 3.5625 | 4 | [] | no_license | ## 题解:[20191209]#0056 Merge Intervals
- **题干**
输入一组区间,合并有交叠的区间并返回。
示例:
```
// e.g.1
Input: [[1,3],[2,6],[8,10],[15,18]]
Output: [[1,6],[8,10],[15,18]]
Explanation: [1,3]和[2,6]有交叠,合并区间为[1,6]
// e.g.2
Input: [[1,4],[4,5]]
Output: [[1,5]]
Explanation: 区间[1,4]和[4,5]可以看做是有重叠的
```
- **第一思路** ... |
Python | UTF-8 | 113 | 2.734375 | 3 | [] | no_license | input_file = 'ml-latest/movies.csv'
with open(input_file, 'rb') as file:
for row in file:
print(row) |
JavaScript | UTF-8 | 1,074 | 4.4375 | 4 | [] | no_license | // Exercise 2.1
// ------------
// Create a Book class and then intantiate it 5 times with various books
// include the following properties in the constructor
// - title (string)
// - genre (string)
// - author (string)
// - isRead (boolean - whether or not you've read the book)
//
// Declare the books as... |
Markdown | UTF-8 | 30,395 | 3.046875 | 3 | [] | no_license |
## 我在创意阶段所做的贡献
>我们小组的创意来源于我的一门期末作业,因此主要是我提出的。之后我们小组一起对功能进行完善。
我的贡献主要是:1,提出主题;2.对项目的模块和功能进行完善。
## 针对人群
>ECNU作业评价小工具的针对人群 ,就是华东师范大学的学生和老师们,可以通过我们的小工具进行作业的发布、提交、评价和交流。
## ECNU作业评价小工具的功能
>1.注册和登录功能。学生在注册页面填写信息之后,数据会记录到数据库中,之后学生在登陆的时候,学生所填写的身份信息会自动与数据库中的数据进行比对。
2.教师发布作业的功能。教师可以在对应科目发布作业,所有选修这门课的同学都能看到这项作业。
3.学生查看、提交作业的功... |
C++ | UTF-8 | 2,634 | 3.96875 | 4 | [] | no_license | /*
Branden Lee
CIS 22B
Fall 2017
Assignment B
Problem B1
Used Microsoft Visual Studio 2017
Prompts user for the height and radius to return the volume of a cone.
Demonstrates the use of data structures.
*/
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;
/**************... |
Java | UTF-8 | 520 | 3.375 | 3 | [] | no_license | package exception.throw_;
public class ThrowEx01 {
public static void main(String[] args) {
try {
System.out.println("결과: " + calc(10));
System.out.println("결과: " + calc(-10));
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e);
System.out.println(e.getMessage());
}
... |
C++ | UTF-8 | 468 | 2.625 | 3 | [] | no_license | #include "SDLManager.h"
SDLManager::SDLManager()
{
if (SDL_Init(SDL_INIT_EVERYTHING))
std::cout << "failed to init SDL" << std::endl << SDL_GetError() << std::endl;
if (!IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG))
std::cout << "failed to init IMG" << std::endl << IMG_GetError() << std::endl;
if (TTF_Init())
std:... |
C++ | UTF-8 | 3,498 | 2.640625 | 3 | [] | no_license | #include "Client.h"
#include "SingleBufferedConsole.h"
#include <thread>
static CClient Client{ "192.168.219.200", 9999, timeval{ 2, 0 } };
static BOOL ConsoleEventHandler(DWORD event) {
switch (event) {
case CTRL_C_EVENT:
case CTRL_CLOSE_EVENT:
Client.Leave();
break;
}
return TRUE;
}
int main()
{
SetCons... |
C | UTF-8 | 5,145 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive |
/************************************************************************
** Pragmas
*************************************************************************/
/************************************************************************
** Includes
************************************************************************... |
Python | UTF-8 | 513 | 3.140625 | 3 | [] | no_license | class Solution(object):
def findKthLargest(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: int
"""
for i in xrange(k):
cur_max = 0
for j in xrange(1, len(nums) - i):
if nums[j] > nums[cur_max]:
... |
Java | UTF-8 | 345 | 2.078125 | 2 | [] | no_license | package document;
import document.documentItem.ItemsCollection.IDocumentItemCollection;
import document.documentItem.image.IMutableImage;
import document.documentItem.title.IDocumentTitle;
import document.documentItem.title.IMutableDocumentTitle;
public interface IDocument {
IDocumentTitle Title();
IDocumentI... |
C++ | UTF-8 | 527 | 2.734375 | 3 | [] | no_license | class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
n = nums.size();
dfs(nums,0, vector<int>());
return set;
}
private:
vector<vector<int>> set;
int n;
void dfs(vector<int>& nums, int step, vector<int> subset){
if (step==n){
set.... |
Python | UTF-8 | 258 | 3.421875 | 3 | [] | no_license | def try_me(word1, word2):
if len(word1) > len(word2):
return f"{word1} is longer than {word2}"
elif len(word1) < len(word2):
return f"{word1} is longer than {word2}"
else:
return f"{word1} and {word2} have the same length" |
Markdown | UTF-8 | 1,473 | 2.84375 | 3 | [] | no_license | # Article R6212-83
Dans une société d'exercice libéral mentionnée à l'article R. 6212-72, la détention directe ou indirecte de parts ou
d'actions représentant tout ou partie du capital social non détenu par des personnes mentionnées au premier alinéa ou aux 1°
à 4° de l'article 5 de la loi n° 90-1258 du 31 décembre 19... |
C++ | UTF-8 | 12,177 | 2.609375 | 3 | [] | no_license | #ifndef __GLFRAME__
#define __GLFRAME__
#ifdef WIN32
#undef APIENTRY // This is to stop Windows from complaining about APIENTRY already being defined.
#endif
// These are here to make GLFW expose the right functionality //
#ifdef WIN32
#define GLFW_EXPOSE_NATIVE_WIN32
#define GLFW_EXPOSE_NATIVE_WGL
#elif defi... |
Markdown | UTF-8 | 8,410 | 3.078125 | 3 | [] | no_license | ---
layout: post
title: "Embrangler: Moving to Jekyll"
summary: The migration process of <a href="http://embrangler.com">this blog</a>, from Wordpress 2.9 to Jekyll 0.5.7
tags: [blog, migration, jekyll, wordpress]
---
It took only three days to migrate my blog from [Wordpress](http://wordpress.org) to [Jekyll](http:/... |
Markdown | UTF-8 | 944 | 2.6875 | 3 | [] | no_license | # Bid or Bullsh!t
### A game of wit and deception for the iPad with a built-in ACT-R opponent.
Created for the course Cognitive Modelling: Complex Behaviour (April 2017) together with Pim van der Meulen and Kim van Prooijen.

... |
Rust | UTF-8 | 1,370 | 3.484375 | 3 | [] | no_license | /*
.. default-role:: math
计算H因子
H因子是一个衡量科学家影响力的东西,主要看这个科学家发的文章的被引数。如果一个科学家有至少 `h` 篇文章的被引数大于等于 `h` ,那么这个科学家的H因子就不小于 `h` 。
这样说还是很模糊、很难算。维基百科 <https://en.wikipedia.org/wiki/H-index> 上面有一张图非常清晰,下面就是用这张图算的
1. 先把所有的文章按被引数从高到低排序
2. 被引数最高的文章的下标从1开始,x轴是文章的下标,y轴是被引数,数有多少篇文章在 `y = x` 这条线上、或者左上方
*/
struct Solution;
use std... |
Python | UTF-8 | 1,217 | 3.546875 | 4 | [] | no_license |
'''
基本的绘图:
平面直接坐标系
'''
import numpy as np
import matplotlib.pyplot as plt
#使用线性拆分
x = np.linspace(-np.pi, np.pi, 200)
sinx = np.sin(x)
cosx = np.cos(x)
plt.plot(x, sinx, linestyle='--',linewidth=3,color='green',alpha=0.2)
plt.plot(x, cosx, linestyle='-.',linewidth=6,color='red',alpha=0.8)
# 设置刻度
... |
Python | UTF-8 | 222 | 2.921875 | 3 | [] | no_license | import pygame
from pygame.locals import *
class ClockController(object):
def __init__(self):
self.clock = pygame.time.Clock()
def tick(self, fps):
self.clock.tick(fps)
def dt(self):
return self.clock.get_time() |
Java | UTF-8 | 1,842 | 2.703125 | 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 amm.milestone3;
import java.util.ArrayList;
/**
*
* @author medas
*/
public class VenditoreFactory {
p... |
Shell | UTF-8 | 1,647 | 3.1875 | 3 | [] | no_license | #!/bin/bash
#
# COMAND LINE INTERFACE WIKI
#
# Criado por: Edegard Santos.
# 06/10/2016
#
#
## BASHCSS
trap 'menu' 1 2 3 15 20
BLACK='\E[0;30m' # PRETO
BOLD='\033[37;4;1m' # NEGRITO
UND='\033[37;4m' # SUBLINHADO
RED='\033[00;31m' # VERMELHO
GREEN='\033[01;32m' # VERDE
YELLOW='\033[01;33m' # AMARELO
BLUE='\033[01;34m... |
C++ | UTF-8 | 1,157 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "transform.h"
#include <memory.h>
#if defined(CXX_GNU) || defined(BUILD_ANDROID)
#include <GLES/gl.h>
#elif defined(CXX_MSVC)
#include <Windows.h>
#include <GL/gl.h>
#endif
namespace c4g{
namespace render {
namespace gles {
CTransform& CTransform::Instance(float* const& rpfVertexData)
{
static CTransform... |
Java | UTF-8 | 1,657 | 3.125 | 3 | [] | no_license | package test;
import static org.junit.Assert.*;
import org.junit.Test;
import com.exceedvote.DatebaseManager;
import com.exceedvote.Statement;
import com.exceedvote.StatementList;
/**
* StatementSeparateTest tests for a Statment class and a StatementList class.
* @author Tanachot Teachajarupan
* @version 2012.10.2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.