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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 1,296 | 3.046875 | 3 | [] | no_license | # BAMBU Backend Engineer Test
The People-Like-You API sends 10 potential investors similar with the person described in the query parameters.
- the endpoint is exposed at `people-like-you`
- each of the terms in the query parameters is optional
- the endpoint returns a JSON response with an array of scored suggested ... |
Python | UTF-8 | 456 | 2.59375 | 3 | [] | no_license | from django import template
register = template.Library()
@register.filter(name='is_in_cart')
def is_in_cart(product,cart):
keys = cart.keys()
for productid in keys:
if int(productid) == product.id:
return True;
return False
@register.filter(name='cart_count')
def cart_count(product,cart):
keys = cart.keys... |
Markdown | UTF-8 | 389 | 2.546875 | 3 | [] | no_license | # Kyle-Biblio
# Description
C'est une bibliothèque de plusieurs exemple de code pour l'exercise.
# Dossier
Google Font contient : Html, css
Velveytyne contient : Html, css, webfont
Images contient : Html, css, img
# Sources
code : W3Schools.com
1.Css Image gallery
Font : Google font : Inide Flower
Ve... |
JavaScript | UTF-8 | 955 | 2.5625 | 3 | [] | no_license | import * as C from './constant'
const defaultState = {
onFocus: false,
list: [],
pageNumber: 0,
mouseEnter: false,
}
export default (state = defaultState, action) => {
const newState = JSON.parse(JSON.stringify(state))
switch (action.type) {
case C.ON_FOCUS:
newState.onFocus = true
return ... |
C++ | UTF-8 | 1,763 | 2.53125 | 3 | [] | no_license | //#define _CRT_SECURE_NO_WARNINGS
//
//#include <windows.h>
//#include <stdio.h>
//#include <conio.h>
//#include <tchar.h>
//#include <iostream>
//#include "atlstr.h"
//#define bufSize 256
//using namespace std;
//
//
//
//void main(int argc, char *argv[]) {
//
// if (argc < 3) {
// cout << "Incorrect count of argumen... |
JavaScript | UTF-8 | 1,155 | 2.75 | 3 | [] | no_license | import { displayResult } from '../../utils/displayResult'
/**
* Moves folder to a new location.
* @param {string} paths - folder paths (source path and destination path separated by space).
* @param {object} sasjs - configuration object of SAS adapter.
* @param {string} accessToken - an access token for an authori... |
C++ | UTF-8 | 866 | 3.265625 | 3 | [] | no_license | /*
* author : mike2ox
* BJO : 좌표 정렬하기2
* descript : https://www.acmicpc.net/problem/11651
* type : sort
*/
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<pair<int, int>> xy;
int N;
int x, y;
void swap(int* a, int* b) {
int t = *a;
*a = *b;
*b = t;
}
bool compare(pair<int, int... |
Java | UTF-8 | 3,934 | 2.265625 | 2 | [] | no_license | package br.com.sococo.resumo.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
@Entity
@Table(name = "usuario")
public class Usuario implements Serializable... |
C | UTF-8 | 272 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
int sub(int x, int y) {
return x - y;
}
int main( ) {
int a = 5; int b = 10;
int diff1, diff2, diff3;
diff1 = sub(a,b);
diff2 = sub(100, b);
diff3 = sub(24, 25);
printf("diff1 = %d, diff2 = %d, diff3 = %d\n", diff1, diff2, diff3);
return 0;
}
|
Markdown | UTF-8 | 1,382 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | ---
title: DebugServerNativeMethods.debugserver_client_receive_response method (1 of 2)
---
Receives and parses response of debugserver service.
```csharp
public static DebugServerError debugserver_client_receive_response(DebugServerClientHandle client,
out IntPtr response)
```
| parameter | description |
| ---... |
Shell | UTF-8 | 358 | 2.640625 | 3 | [] | no_license | #!/bin/bash
HOST="ipnp29"
echo "Sending files to ${HOST}..."
cd ../hbook/D0Kpi
for CHANNEL in "D0Kpi" "D0Kpipi0" "D0K3pi"; do
cd ../${CHANNEL}
for STREAM in `seq 0 5`; do
HOSTDIR="bin/belle/DSRhoYield/data/${CHANNEL}/stream${STREAM}"
rsync DSRhoSkim_svd{1,2}_on_resonance_evtgen-*_s*${STREAM}.root ${HOST}:${HOS... |
Java | UTF-8 | 363 | 2.125 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ucuenca.edu.optii.ecu911.negocio.excepciones;
public class ValidacionPermisosAsignados_RolExcepcion
extends RuntimeException{
public ValidacionPermisosAsignados_RolExcepcion(String message) {
... |
Shell | UTF-8 | 316 | 3.109375 | 3 | [] | no_license | #!/bin/sh
if [ "$1" = "remove" -o "$1" = "deconfigure" ]; then
PKILL=$(which pkill)
PGREP=$(which pgrep)
FLAG=`$PGREP -f /usr/share/rootrun/rootrun-daemon/startrootrundbusdaemon.py`
if [ -n "$FLAG" ] ; then
$PKILL -f -9 /usr/share/rootrun/rootrun-daemon/startrootrundbusdaemon.py
fi
fi
|
C# | UTF-8 | 1,854 | 2.515625 | 3 | [] | no_license | using AutoMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TheWorld.Models;
using TheWorld.ViewModels;
namespace Th... |
Java | UTF-8 | 3,097 | 2.640625 | 3 | [] | no_license | package com.csd.activitybase.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Sober_philer on 2017/3/3 09:09
* 网络链接状态的类
*/
public class NetWorkUtils {
private static NetWorkUtils... |
TypeScript | UTF-8 | 1,846 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | import { inject, InjectionKey, provide, reactive, Ref } from 'vue'
import {
createTemplateRefList,
useFocusGroup,
useRovingTabIndex,
useIdGenerator,
} from 'vue-aria-composables'
interface AccordionOptions {
multiple?: boolean
orientation?: 'horizontal' | 'vertical'
}
export type AccordionState = Record<s... |
TypeScript | UTF-8 | 881 | 2.84375 | 3 | [] | no_license | import path from 'path'
import fs, { Dirent } from 'fs'
import logger from '../../utils/logger'
type DirTuple = [string, string]
export type ModuleBooter = () => Module | Promise<Module>
export interface Module {
name: string
close: () => Promise<void>
context: object
}
export type ModulesLoader = () => Promis... |
C | UTF-8 | 1,859 | 3.734375 | 4 | [] | no_license | //习题10-4 递归求简单交错幂级数的部分和(15 分)
//本题要求实现一个函数,计算下列简单交错幂级数的部分和:
//f(x,n)=x−x
//2
//+x
//3
//−x
//4
//+⋯+(−1)
//n−1
//x
//n
//
//函数接口定义:
//double fn( double x, int n );
//其中题目保证传入的n是正整数,并且输入输出都在双精度范围内。函数fn应返回上述级数的部分和。建议尝试用递归实现。
//裁判测试程序样例:
//#include <stdio.h>
//
//double fn( double x, int n );
//
//int main(... |
Java | UTF-8 | 372 | 1.890625 | 2 | [] | no_license | package ollitos.platform;
import ollitos.geom.IBRectangle;
import ollitos.geom.IBTransformHolder;
import ollitos.gui.basic.IBDrawable;
import ollitos.gui.event.IBEventSource;
public interface IBScreen extends IBEventSource, IBTransformHolder{
void refresh();
IBRectangle originalSize();
void setDrawable( IBDrawable... |
Java | UTF-8 | 3,081 | 2.140625 | 2 | [] | no_license | package com.example.kila.myapplication;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
import com.flyco.tablayout.CommonTabLayo... |
Java | UTF-8 | 6,658 | 2.203125 | 2 | [] | no_license | package app;
import java.net.URL;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.naming.Context;
import javax.naming.InitialContext;
im... |
Python | UTF-8 | 2,847 | 2.671875 | 3 | [] | no_license | import time
import datetime
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
# driver = webdriver.Chrome(executable_path='C:\\_teach\\Silenium\\c... |
C | UTF-8 | 2,637 | 3.421875 | 3 | [] | no_license | //
// Created by asus on 2017/10/16.
//
#ifndef DATASTRUCTURE_TSMATRIX_H
#define DATASTRUCTURE_TSMATRIX_H
#include <stdio.h>
#define MAX_SIZE 100
#define N 10
#define T int
typedef struct {
int row , col;
T elem;
}Triple;
typedef struct{
Triple data[MAX_SIZE];
int rowNum , colNum , len;
}TSMatrix;... |
Markdown | UTF-8 | 1,250 | 3.8125 | 4 | [
"MIT"
] | permissive | # Bubble Sort

## 시간복잡도
( n - 1 ) + ( n - 2 ) + ... + 2 + 1 ---------> n ( n - 1 ) / 2
**O(n^2)**
느린편이지만 구현이 간단해서 자주 쓰인다고 한다.
## Code
```java
public class BubbleSort {
private static int[] arr = {5, 6, 2, 8, 7, 23,... |
Rust | UTF-8 | 908 | 2.78125 | 3 | [] | no_license | /*
* @Author: otae
* @Date: 2017-07-20 21:05:47
* @Last Modified by: otae
* @Last Modified time: 2017-07-25 01:32:28
*/
use color::*;
use float3::*;
pub struct FrameBuffer {
pub frame: Vec<Vec<char>>,
pub depth: Vec<Vec<f32>>,
pub colors: Vec<Vec<Color>>
}
impl FrameBuffer {
pub fn allocate(&mut self, width... |
Java | UTF-8 | 866 | 3.71875 | 4 | [] | no_license | public class IsBST {
Node root;
Node prev;
boolean isBST() {
prev = null;
return isBST(root);
}
boolean isBST(Node node) {
if (node != null) {
if (!isBST(node.left)) {
return false;
}
if (prev != null && node.key <= prev.... |
Markdown | UTF-8 | 795 | 2.875 | 3 | [] | no_license | ---
title: "Adding Audio Output to an Alexa Skill"
tags: [aws]
excerpt_separator: <!--more-->
---
It's pretty easy to add audio to an existing Alexa skill. The biggest trick is probably getting the audio converted into an Alexa-Friendly format. Here's how I did this:
<!--more-->
1. Exported my audio from Adobe Premie... |
C++ | UTF-8 | 2,242 | 3.765625 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main(){
//Initializing
char choice;
char i, j, record=0, totalrecord;
int id[record];
string name[record];
int price[record];
bool back=true;
string none;
//Menu
while(back=true){
cout<<"*******************************"<... |
Java | UTF-8 | 6,321 | 1.914063 | 2 | [] | no_license | package com.gon.test;
import com.gon.RuntimeTaskHelper;
import org.activiti.engine.history.HistoricVariableInstance;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntity;
import org.activiti.engine.management.TablePage;
... |
Java | UTF-8 | 2,301 | 1.992188 | 2 | [] | no_license | package com.helfarre.BankApi.Controllers;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import ... |
Java | UTF-8 | 3,940 | 2.28125 | 2 | [] | no_license | package dai.server.servlets;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import java.util.Vector;
import dai.shared.cmnSvcs.Logger;
import dai.shared.cmnSvcs.SessionMetaData;
import dai.shared.cmnSvcs.csSecurity;
import dai.shared.csAdapters.csDBAdapter;
import dai.shared.csAdapters.csDBAdapterF... |
Java | UTF-8 | 333 | 1.71875 | 2 | [] | no_license | package com.core.service;
import java.util.List;
import com.core.mongo.data.entity.User;
public interface UserService {
public User findUserData(String id);
public void resetUserData(User user);
public User saveUserData(User user, List<String> emailList);
public User validateUserData(User use... |
Java | UTF-8 | 3,028 | 1.882813 | 2 | [] | no_license | package com.sinitek.sirm.org.web;
import com.sinitek.sirm.common.CommonServiceFactory;
import com.sinitek.sirm.common.support.LocalSetting;
import com.sinitek.sirm.common.sysmenu.service.ISysMenuService;
import com.sinitek.sirm.common.utils.NumberTool;
import com.sinitek.sirm.common.utils.StringUtil;
import com.sinite... |
SQL | UTF-8 | 1,202 | 3.5625 | 4 | [] | no_license | {{
config(
materialized = 'incremental',
cluster_by = 'user_id',
partition_by = {'field': 'created_at', 'data_type': 'timestamp'}
)
}}
WITH source_tbl AS (
SELECT
id AS user_id
, postcode,
, created_at,
, updated_at,
, loader_ingestion_t... |
Java | GB18030 | 4,672 | 2.640625 | 3 | [] | no_license | package com.sl.v0.buglocation;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util... |
Ruby | UTF-8 | 120 | 3.296875 | 3 | [] | no_license | # n = 1
# if !n.zero?
# puts 'Not zero.'
# end
n = 1
unless n.zero?
puts 'Not zero'
else
puts 'This is zero.'
end |
Shell | UTF-8 | 2,132 | 3.46875 | 3 | [
"MIT"
] | permissive | #!/bin/bash -e
if [ "$#" -ne 3 ]; then
cat <<-ENDOFMESSAGE
Please specify the base result file and the result file, as well as the output file as arguments.
Usage: ./parse.sh <base result file> <result file> <output file>
ENDOFMESSAGE
exit
fi
mkdir -p $(dirname $3)
header="machine,limits,benchmark,base_resul... |
Java | UTF-8 | 398 | 1.929688 | 2 | [] | no_license | package DAO;
import java.util.ArrayList;
import Bean.BeanAlumno;
import util.ToolLista;
public interface DaoAlumno
{
public void ingresar (BeanAlumno al) throws Exception;
public void modificar (BeanAlumno al) throws Exception;
public void eliminar(BeanAlumno al) throws Exception;
public ArrayList<BeanAlumno> lis... |
Markdown | UTF-8 | 2,363 | 2.921875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ---
id: hellomilvus.md
title: Hello Milvus
---
# Run Milvus using Python
After the Milvus server boots successfully, test the platform using our Python sample code.
1. Install pymilvus_orm and its dependencies:
```
pip install pymilvus-orm==2.0.0rc1
```
<div class="alert note">
Python version 3.6 or higher is requi... |
Java | UTF-8 | 133 | 1.632813 | 2 | [] | no_license | package com.inter;
/**
* Created by Administrator on 2017/12/13.
*/
public interface RmiTest {
public String test(String s);
}
|
PHP | UTF-8 | 3,681 | 2.984375 | 3 | [] | no_license | <?php
include('utils/databaseSetup.php');
// This page won't work without a suitable PHP email setup
function genPassword($len)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $len; $i++)
{
$randomString .= $characters[ra... |
C# | UTF-8 | 383 | 3.25 | 3 | [
"MIT"
] | permissive | using System;
namespace Chars_to_String
{
class Program
{
static void Main(string[] args)
{
string word = string.Empty;
for (int i = 0; i < 3; i++)
{
char character = char.Parse(Console.ReadLine());
word += character;
... |
Markdown | UTF-8 | 1,656 | 2.96875 | 3 | [] | no_license | 1,完成一个商城购物车的程序。
商品信息在文件存储的,存储形式:
name price
电脑 1999
鼠标 10
游艇 20
.......
要求:
1,用户先给自己的账户充钱:比如先充3000元。
2,读取商品信息文件将文件中的数据转化成下面的格式:
goods = [{"name": "电脑", "price": 1999},
{"name": "鼠标", "price": 10},
{"name": "游艇", "price": 20},
...... ... |
JavaScript | UTF-8 | 1,441 | 2.890625 | 3 | [] | no_license | /*eslint-disable*/
import axios from 'axios';
import { showAlert } from './alerts';
export const login = async (email, password) => {
try {
const res = await axios({
method: 'POST',
url: 'http://127.0.0.1:3000/api/v1/users/login', // it will go to directly to user routes
data: {
email,... |
Markdown | UTF-8 | 1,164 | 3.71875 | 4 | [] | no_license | Why does FixedArrayQueue require an explicit constructor?
Answer:
-------
FixedArrayQueue has an uninitialized array named data.
But, If we want to use the array in FixedArrayQueue, then we have to allocate memory for it.
For this we need the capacity of the array.
To pass this capacity as argument(Input to the constru... |
Markdown | UTF-8 | 3,675 | 2.90625 | 3 | [] | no_license | Reproducible Research - Peer Assessment 1
========================================================
This document processes and summarizes the dataset 'Activity monitoring data'. The dataset contains the number of **steps** taken in a 5-minute interval, the **date** the activity measurement was recorded, and an identif... |
Java | UTF-8 | 3,406 | 2.484375 | 2 | [] | no_license | package fr.pagelib.termapp;
import fr.pagelib.termapp.wsc.Configuration;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import java.io.FileNotFoundException;
import j... |
Python | UTF-8 | 1,224 | 3.046875 | 3 | [] | no_license | class Solution:
def countVowelPermutation(self, n: int) -> int:
a_vowel_permutation_count = [1] * n
e_vowel_permutation_count = [1] * n
i_vowel_permutation_count = [1] * n
o_vowel_permutation_count = [1] * n
u_vowel_permutation_count = [1] * n
MOD = 10 ** 9 + 7
... |
JavaScript | UTF-8 | 1,608 | 2.609375 | 3 | [] | no_license | const mongoose = require('mongoose');
const crypto = require('crypto');
const jwt = require('jsonwebtoken');
const { secret } = require('../../../../config')[process.env.NODE_ENV];
const UserSchema = new mongoose.Schema(
{
email: {
type: String,
lowercase: true,
required: true
},
auth: ... |
PHP | UTF-8 | 2,972 | 2.78125 | 3 | [] | no_license | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Format class
* Return API Response object
*
* @author Wonder Jung, @cafeclass
* @license MIT
*/
class MY_Response
{
public static $EVENT_UNKNOWN_ERROR_OCCURED = "Unknown error has occured!";
private $CI=null;
public... |
Java | UTF-8 | 5,504 | 2.15625 | 2 | [] | no_license | package org.ivdnt.util;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.StringReader;
import java.io.Writer;
import java.nio.charset.Charset;
import java.nio.charset.Standard... |
C++ | UTF-8 | 6,651 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /**
* \file SpectrumCollection.cpp
* AUTHOR: Barbara Frewen
* CREATE DATE: 11 April 2011
* \brief Abstract class for accessing spectra from a file.
*/
#include "SpectrumCollection.h"
#include "model/ProteinIndex.h"
#include "model/Peak.h"
#include "util/utils.h"
#ifndef _MSC_VER
#include "unistd.h"
#endif
#inclu... |
Java | UTF-8 | 426 | 1.6875 | 2 | [] | no_license | package com.gmail.neooxpro.di.app;
import com.gmail.neooxpro.di.module.ContactDetailsModule;
import com.gmail.neooxpro.lib.di.containers.NotificationReceiverContainer;
import com.gmail.neooxpro.lib.di.scope.ContactsDetailsScope;
import dagger.Subcomponent;
@ContactsDetailsScope
@Subcomponent(modules = {ContactDetail... |
Python | UTF-8 | 2,669 | 2.625 | 3 | [
"MIT"
] | permissive | import unittest
from caes import ICAES
class TestICAES(unittest.TestCase):
def setUp(self):
# calculate stage pressures
cmp_p0 = 101.3 # kPa
cmp_p2 = 10.0e3 # kPa
cmp_p1 = (1.43 * cmp_p0 * cmp_p2) ** 0.5 # kPa
exp_p0 = 7.0e3 # kPa
exp_p2 = 101.3 # kPa
... |
C | UTF-8 | 974 | 3.890625 | 4 | [] | no_license | #include "stdio.h"
int main(void)
{
int st,ed;
printf("从哪一个数开始:");scanf("%d",&st);
printf("到哪一个数结束:");scanf("%d",&ed);
int n = 0;/*记录输出了几次*/
int i,j;
for(i = st; i <= ed; i++){
/*如果i的值是2或三输出i*/
if (2 == i || 3 == i){
printf("%4d", i);
n++;
}
... |
Python | UTF-8 | 586 | 2.78125 | 3 | [] | no_license | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# import seaborn as sns
# sns.set_style('whitegrid')
import pandas_datareader.data as web
import datetime
start_date = datetime.datetime(2010, 1, 1)
end_date = datetime.datetime.today()
APPL = pd.DataFrame(web.DataReader('AAPL', 'google', start_d... |
TypeScript | UTF-8 | 323 | 2.84375 | 3 | [] | no_license | import deepReadOnly from './deepReadOnly'
export default function deepFreeze<T extends any>(obj: T): deepReadOnly<T> {
Object.getOwnPropertyNames(obj).forEach(name => {
const v = obj[name]
obj[name] = v && typeof v === 'object' ? deepFreeze(obj[name]) : v
})
return Object.freeze(obj) as deepReadOnly<T>... |
Markdown | UTF-8 | 4,187 | 3.0625 | 3 | [] | no_license | ---
layout: post
title: Validation in Windows Forms DateTimePicker Control | Syncfusion
description: SfDateTimeEdit control provides an support to validation of date and time value when the enter key is pressed.
platform: WindowsForms
control: SfDateTimeEdit
documentation: ug
---
# Validation in Windows Forms DateTime... |
Java | UTF-8 | 474 | 1.890625 | 2 | [
"Apache-2.0"
] | permissive | package edu.drexel.cis.dragon.nlp.tool.xtract;
import edu.drexel.cis.dragon.nlp.Sentence;
public abstract interface WordPairGenerator
{
public abstract int generate(Sentence paramSentence);
public abstract WordPairStat getWordPairs(int paramInt);
public abstract void setMaxSpan(int paramInt);
}
... |
Python | UTF-8 | 572 | 3.34375 | 3 | [] | no_license | class Solution:
# @param {integer[]} nums
# @return {string}
# sort by n/(pow(10,len)-1)
# edge case: all are "0"s
def largestNumber(self, nums):
if nums == []:
return 0
lis = []
for i in range(0, len(nums)):
n = nums[i]
n_len = len(str(n))... |
Swift | UTF-8 | 1,131 | 3.65625 | 4 | [] | no_license |
class Node {
var value: Int
var leftChildren: Node?
var rightChildren: Node?
init(value: Int) {
self.value = value
}
}
class BinarySearchTree {
var root: Node?
func append(value: Int, node: inout Node?) -> Void {
let newNode = Node(value: value)
if let nod... |
Markdown | UTF-8 | 471 | 2.625 | 3 | [] | no_license | # Scenario 8
- **Titre** : Connection
- **Objectif**: Connection d'un utilisateur
- **Précondition(s)**:
- Avoir installé l'application en local
## Etapes
- D1 : L'internaute ouvre l'application en cliquant sur l'exécutable de l'application
- D2 : L'application affiche un écran de connexion
- D3 : L'internaute en... |
Java | UTF-8 | 3,231 | 2.203125 | 2 | [] | no_license | package de.eschoenawa.wifiar.activities;
import android.Manifest;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatA... |
PHP | UTF-8 | 1,456 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Alexeenko Sergey Aleksandrovich
* Email: sergei_alekseenk@list.ru
* Company: http://machineheads.ru
* @see https://github.com/mheads-dev/yii2-dbfiles
* Date: 19.03.2019
* Time: 12:08
*/
namespace mheads\dbfiles;
class ImageFile extends File
{
/** @var int */
protecte... |
PHP | UTF-8 | 979 | 3.09375 | 3 | [] | no_license | <?php
require_once("db_obj.php");
class category_list {
public $cat_list;
public $cat_main_list;
public function __construct() {
}
public function load() {
$sql_str = "SELECT id, parent_id, name FROM category";
$result = sqlite_query($db, $sql_str);
while($row = $result->fetchArray()) {
$cat = new ... |
C++ | UHC | 1,096 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
// 14391
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int N, M;
int arr[5][5];
cin >> N >> M;
for(int i = 0; i < N; i++){
string s; cin >> s;
for(int j = 0; j < M; j++) arr[i][j] = s[j] - '0';
}
int ans = 0... |
Ruby | UTF-8 | 319 | 3.453125 | 3 | [] | no_license | puts "this program keeps track of how much you worked out"
puts "please enter the number of minutes you worked out today"
minWorkOut = gets.to_i
puts "OK, you worked out #{minWorkOut} minutes today"
f = File.open("my_exercise_history", "a")
f.write(minWorkOut)
f.close
f = File.open("my_exercise_history.txt", "w")
|
C++ | UTF-8 | 2,499 | 3.453125 | 3 | [] | no_license | #include "Vector2.h"
vec2::vec2()
{
xpos = 0;
ypos = 0;
}
vec2::vec2(float x, float y)
{
this->xpos = x;
this->ypos = y;
}
vec2 vec2::operator+(const vec2 & rhs) const
{
vec2 vec;
vec.xpos = xpos + rhs.xpos;
vec.ypos = ypos + rhs.ypos;
return vec;
}
vec2 vec2::operator-(const vec2 & ... |
Java | UTF-8 | 3,280 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | /**
* @author Sogrey
* @date 2015-11-27上午10:44:04
*/
package com.sogrey.frame.utils;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
/**
* @author Sogrey
* @da... |
JavaScript | UTF-8 | 444 | 2.640625 | 3 | [] | no_license | import React from 'react';
const Cart = (props) => {
const cart = props.cart;
//console.log(cart);
let total=0;
for(let i=0;i<cart.length;i++){
const product = cart[i];
total=total+product.price;
}
return (
<div>
<h4>Order Summary</h4>
<p>Items Or... |
Markdown | UTF-8 | 2,163 | 2.859375 | 3 | [
"MIT",
"CC-BY-SA-3.0"
] | permissive | ## Examples
Welcome to the code examples section!
Here you'll find usage examples and recipes. For a full list of examples, take a look in our
[storybook page](https://researchgate.github.io/react-intersection-observer/?selectedKind=Examples).
* [Basic usage on Window](https://researchgate.github.io/react-intersecti... |
Python | UTF-8 | 859 | 2.640625 | 3 | [] | no_license | import enum_val as e_val
from SodukoClass import Soduko
import get
def update_rigt_arr(soduko):
key = e_val.Direction.Right
for n in range(0, len(soduko.S)):
soduko.pos_val[key].append(get.zero_right_line(n, soduko))
def update_down_arr(soduko):
key = e_val.Direction.Down
for n in range(0, le... |
Swift | UTF-8 | 578 | 2.609375 | 3 | [] | no_license | //
// PlayerViewCell.swift
// foostourney
//
// Created by Mahesh Chauhan on 14/10/19.
// Copyright © 2019 Mahesh Chauhan. All rights reserved.
//
import UIKit
// UITableViewCell to hold the content of a single player cell on SelectPlayersViewController.
class PlayerViewCell: UITableViewCell {
@IBOutlet weak... |
C# | UTF-8 | 3,878 | 2.640625 | 3 | [] | no_license | using System;
using System.Linq;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace MoveAppSettingsBetweenComputers
{
public partial class Form1 : Form
{
string sourceComputer;
string destinationComputer;
string userAccountToCopy;
int appSettingsL... |
C# | UTF-8 | 650 | 2.625 | 3 | [] | no_license | public class MainAbstractFactory{
public static void Main(string[] args){
AbstractFactory factoryWhite = FactoryCreator.createFactoryWhite();
AbstractFactory factoryBlack = FactoryCreator.createFactoryBlack();
Apartment whiteApartment = factoryWhite.createApartment();
Apartment bl... |
C# | UTF-8 | 5,006 | 2.8125 | 3 | [
"MIT"
] | permissive | using Microsoft.Toolkit.Uwp.Notifications;
using Quickstart_Alarms.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Notifications;
namespace Quickstart_Alarms
{
public static class AlarmHelper
{
private const in... |
Java | UTF-8 | 113 | 1.632813 | 2 | [
"MIT"
] | permissive | package com.codingblocks.lecture_9.interfeace_example;
public interface TA extends Teacher, Student {
}
|
Markdown | UTF-8 | 528 | 2.71875 | 3 | [
"MIT"
] | permissive | # Projetos Python
Alguns projetos criados em Python
## Ping-Pong
Jogo que simula uma mesa de Ping-Pong 2D. Para executar é necessário ter instalado a boblioteca Pygame.
- Possíveis configurações no jogo
- Tamanho dos blocos
- Máximo de tentativas
- Escrevi um algoritmo que joga sozinho, para liga-lo deve t... |
C++ | UTF-8 | 1,461 | 2.796875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #pragma once
#include <list>
#include <string>
#include "math/Vector2.h"
namespace gfx
{
namespace gui
{
class Gui;
class GuiElement
{
public:
GuiElement(Gui & gui, GuiElement * parent, math::Vector2i position = math::Vector2i(0, 0));
virtual ~GuiElement();
virtual void animate(double deltaTime);
virtual voi... |
Python | UTF-8 | 316 | 3.21875 | 3 | [] | no_license | import os
import glob
# Function to rename multiple files
def main():
for file in glob.glob('*-&-*'):
src = os.path.basename(file)
dest = src.replace("-&-", "-")
os.rename(src, dest)
print(dest)
# Driver Code
if __name__ == '__main__':
# Calling main() function
main() |
C++ | UTF-8 | 247 | 2.578125 | 3 | [] | no_license | #ifndef PLANET_
#define PLANET_
#include <string>
#include <iostream>
class Planet{
private:
int time_s;
std::string _name;
public:
void set_time(int);
void set_name(std::string);
int get_time();
std::string get_name();
};
#endif |
C | UTF-8 | 1,241 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
#include "another.h"
#include <stdlib.h>
int main(){
tryGess();
printf("\nNext task is about matrix from thierd lab\n");
matrixShort();
return 0;
}
void matrixShort(){
int n,m,i,j;
int *a = NULL;
printf("Input rows: ");
scanf("%d", &n);
printf("Input colons: ");
scanf("%d", &m);
a =... |
Java | UTF-8 | 6,842 | 2.40625 | 2 | [] | no_license | /*
* @(#)MailboxConnection.java 1.00 2005/02/05
*
* Copyright (c) 2005, Stephan Sann
*
* 05.02.2005 ssann Vers. 1.0 created
*/
package de.lotk.yawebmail.business;
import java.io.Serializable;
import java.util.TreeSet;
import javax.mail.Folder;
import javax.mail.Message;
import de.lotk.yawebmail.appl... |
PHP | UTF-8 | 2,630 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace execut\widget\dropdownContent;
use yii\helpers\Html;
use yii\jui\InputWidget;
/**
* Widget for render custom dropdown
*
* @author eXeCUT
*/
class DropdownContent extends InputWidget
{
/**
* Flag for use less compiler
*
* @var bool
*/
public $isDebugMode = false;
/... |
Java | UTF-8 | 1,048 | 2.359375 | 2 | [] | no_license | package com.example.RedditClone.users;
import com.example.RedditClone.helpers.Parameters;
import com.example.RedditClone.helpers.Redirects;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
@WebServlet(name = "UserLogoutServlet", value = "/user-logout... |
C++ | UTF-8 | 448 | 2.546875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
long long int t;
cin>>t;cout<<endl;
for(int i=0;i<t;i++)
{
long long int n,sum=0;
cin>>n;
long long int a[n];
for(int j=0;j<n;j++)
cin>>a[j];
cout<<endl;
for(int j=0;j<n;j++)
sum... |
Markdown | UTF-8 | 4,457 | 4.03125 | 4 | [] | no_license | # 解析式:
问题引入:
对一个列表里所有数值求平方;
lst = list(range(10))
## 列表解析:
之所以叫列表解析是因为得到的结果是list,迭代的对象可以是任意可迭代对象;
列表解析中,不支持break语句,自然也不支持for...else语句;
[ expression for e in iterator]
```python
lst = list(range(10))
ret = []
for x in lst:
ret.append(x ** 2)
ret = [ x ** 2 for x in lst]
```
* 代码简介,可读性强;
*... |
C# | UTF-8 | 687 | 3.71875 | 4 | [] | no_license | using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class Test
{
public static void Main()
{
var lists = new List<List<int>>
{
new List<int> { 1, 2, 3 }, // 6
new List<int> { 3 }, // 3
new List<int> { 3, 3... |
C# | UTF-8 | 1,493 | 2.921875 | 3 | [] | no_license | using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace Assets
{
[Serializable()]
public class RespondMovement
{
private int dice;
private int tokenID;
public int Dice
{
get
{
return dice;
... |
Python | UTF-8 | 256 | 2.71875 | 3 | [] | no_license | N = int(input())
P = [int(input()) for _ in range(N)]
V = [-1] * (N+1)
for i in range(N):
V[P[i]] = i+1
# print(V)
c = 0
ans = 0
for i in range(1, N+1):
if V[i-1] > V[i]:
c = 1
else:
c += 1
ans = max(c, ans)
print(N-ans)
|
Java | UTF-8 | 3,818 | 2.734375 | 3 | [] | no_license | package com.alex.gl.shape;
import static org.lwjgl.opengl.GL11.*;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.ARBMultisample;
import org.lwjgl.opengl.Display;
import org.lwjgl.util.Point;
import java.util.List;
/**
* Created with IntelliJ IDEA.
* User: elenaliux
* Date: 8/18/13
* Time: 7:20 PM
*/
... |
Python | UTF-8 | 651 | 3.046875 | 3 | [] | no_license | from datetime import datetime, timedelta
from time import sleep
def runAndWait(function, duration):
'''run a function and wait until its given quota runs out
@param function:function function to be called
@param duration:int duration of quota in milliseconds
'''
stop = datetime.now() + \
... |
Java | UTF-8 | 4,075 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | package org.spiderland.Psh.BitstringGA;
import java.util.ArrayList;
import org.spiderland.Psh.GA;
import org.spiderland.Psh.GAIndividual;
abstract public class BitstringGA extends GA {
private static final long serialVersionUID = 1L;
protected int _size;
protected String _GAMutationMode;
protecte... |
C++ | UHC | 523 | 2.78125 | 3 | [] | no_license | #include <string>
#include <vector>
#include <queue>
using namespace std;
int solution(vector<int> scoville, int K) {
int answer = 0;
int n, m;
priority_queue<int,vector<int>,greater<int>> q;
for(int i = 0; i<scoville.size(); i++){
q.push(scoville[i]);
}
while(q.top() < K && q.siz... |
Java | UTF-8 | 17,423 | 1.882813 | 2 | [] | no_license | package me.firerising.campmc.claim;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.compatibility.CompatibleSound;
import com.songoda.core.compatibility.ServerVersion;
import com.songoda.core.utils.PlayerUtils;
import me.firerising.campmc.Main;
import me.firerising.campmc.events.Cla... |
Java | UTF-8 | 2,117 | 2.34375 | 2 | [] | no_license | package com.ntgclarity.smartcompound.dataaccess.daoimpl;
import java.util.List;
import java.util.Map;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import com.ntgclarity.smartcompound.common.entity.Compound;
import com.ntgclarity.smartcompound.common.entity.Service;
import com.ntgclar... |
Java | UTF-8 | 2,722 | 2.578125 | 3 | [] | no_license | package com.github.prypurity.xiaviccore.Utils.Listeners;
import com.github.prypurity.xiaviccore.Main;
import com.github.prypurity.xiaviccore.Utils.Utils;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.P... |
Java | UTF-8 | 360 | 1.578125 | 2 | [] | no_license | package org.esupportail.helpdesk.data.dao.repositories;
import org.esupportail.helpdesk.data.dao.entities.HTicket;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
public interface HTicketRepository extends JpaRepository<HTicket, Long>, ... |
Java | UTF-8 | 5,095 | 2.171875 | 2 | [
"MIT"
] | permissive | /*
* The MIT License (MIT)
*
* Copyright (c) 2014 Andreas Alanko, Emil Nilsson, Sony Mobile Communications AB.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software... |
Java | UTF-8 | 687 | 2.859375 | 3 | [] | no_license | package com.prashant;
public class Main {
public static void main(String[] args) {
Bank bank = new Bank("State Bank of India");
bank.addBranch("Patna");
bank.addCustomer("Patna","Prashant",10000.00);
bank.addCustomer("patna","Viresh",20000.00);
bank.addCu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.