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
C++
UTF-8
654
3.09375
3
[]
no_license
#include "Motorcycle.h" Motorcycle::Motorcycle(const std::string& n) : Vehicle(n) {} void Motorcycle::lanesplitAndRace( int topSpeed ) { setSpeed(topSpeed); std::cout << name << (topSpeed > 90 ? ": yeeehawwww" : ": zzzzzzzz") << std::endl; } void Motorcycle::tryToEvade() { std::cout << name << ": you'll n...
Shell
UTF-8
499
3.046875
3
[]
no_license
#!/bin/sh g++ -O2 main.cpp -o main g++ -O2 generator.cpp -o generator g++ -O2 simple.cpp -o simple random="test/random.txt" for i in `seq -w 60` do echo "testing case${i}" input="test/case${i}/testcase_${i}.txt" simple_output="test/case${i}/simple_output_${i}.txt" main_output="test/case${i}/main_output_${i}.txt"...
Go
UTF-8
945
2.75
3
[ "MIT", "BSD-3-Clause" ]
permissive
package jose import ( "crypto/rsa" "crypto/x509" "encoding/pem" ) // RSAPrivateKey parses data as *rsa.PrivateKey func RSAPrivateKey(data []byte) (*rsa.PrivateKey, error) { input := pemDecode(data) var err error var key interface{} if key, err = x509.ParsePKCS1PrivateKey(input); err != nil { if key, err = ...
Python
UTF-8
4,361
2.703125
3
[]
no_license
import logging import random import os import json import time import sys from bs4 import BeautifulSoup from urllib.request import urlopen from flask import Flask, Response, request # Grabber class StaffbotGrabber(): __STAFF_URL = "https://www.lancaster.ac.uk/scc/about-us/people/" def __init__(self, logger):...
Python
UTF-8
1,508
4.21875
4
[]
no_license
import random # Create a deck of Cards and assign hands to players class Deck(object): def __init__(self): self.reset() def reset(self): self.deck = [] suits =['Hearts','Clubs','Diamonds','Spades'] values =[2,3,4,5,6,7,8,9,10,'Jack', 'Queen','King','Ace'] for suit in sui...
C
UTF-8
4,741
2.8125
3
[ "Unlicense", "LicenseRef-scancode-public-domain" ]
permissive
/* 3D random walker animation * $ cc -Ofast -o walk3d walk3d.c -lm * $ ./walk3d | mpv --no-correct-pts --fps=60 - * $ ./walk3d | x264 --fps 60 --frames 3600 -o walk3d.mp4 /dev/stdin * https://redd.it/geka1q * https://nullprogram.com/video/?v=walk3d * This is free and unencumbered software released into the public...
Java
UTF-8
493
1.953125
2
[ "Apache-2.0" ]
permissive
package com.example.weatherforecast.receive; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.example.weatherforecast.service.AutoUpdateService; /** * Created by misaki on 2016/7/4. */ public class AutoUpdateReceive extends BroadcastReceiver { @...
Java
UTF-8
806
2.296875
2
[]
no_license
package journey.android.backgroundlicker; import android.app.IntentService; import android.content.Context; import android.content.Intent; import android.widget.Toast; /** * Created by Machinatron on 2017-07-14. */ public class ExampleService extends IntentService { private static final String TAG = "EXAMPLESE...
TypeScript
UTF-8
2,110
2.53125
3
[ "Apache-2.0" ]
permissive
class LunrIndexResource extends IndexResource { constructor(name ? : string, base ? : string, index?: any) { super(name, base, index); } protected restoreIndex(elasticlunr: any, callback) { callback(); } protected makeIndex(elasticlunr: any, callback) { elasticlunr.tokenizer.setSeperator(/[\W]+/...
Python
UTF-8
6,144
2.71875
3
[]
no_license
import json class Architecture: def __init__(self, archJson, patterns): # initialize the architectures with open(archJson, "r") as f: arch = json.load(f) self.services = [] for ms in arch["microservices"]: self.services.append(Microservice(ms)) ...
Python
UTF-8
5,451
2.90625
3
[ "BSD-3-Clause" ]
permissive
"""Interface to Baxter-King bandpass filter from `statsmodels`. Interfaces `bk_filter` from `statsmodels.tsa.filters`. """ # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) __author__ = ["klam-data", "pyyim", "mgorlin"] __all__ = ["BKFilter"] import pandas as pd from sktime.transformations.ba...
Java
UTF-8
7,021
3.03125
3
[]
no_license
package com.hotstar.fastival; /* IMPORTANT: Multiple classes and nested static classes are supported */ /* * uncomment this if you want to read input. //imports for BufferedReader import java.io.BufferedReader; import java.io.InputStreamReader; //import for Scanner and other utility classes import java.util.*; */ ...
C#
UTF-8
1,507
2.953125
3
[]
no_license
using System; namespace TextToSeqDiag { public sealed class Position { public PositionKind Kind { get; private set; } public int Column { get; private set; } public int Column2 { get; private set; } public int Row { get; private set; } public static Position ...
C#
UTF-8
8,034
2.875
3
[]
no_license
using UnityEngine; using System.Collections; using Mirror; /** * Manages trading between players. * Player who is currently having a turn may be able to ask for a certain resouce. * Other players may send offers in exchange for that resource (one at a time for networking ease). * * Process: * - A player sends ...
C++
UTF-8
12,534
3.40625
3
[]
no_license
// // Created by Sohini Roy on 5/29/20. // #ifndef TREES_BST_H #define TREES_BST_H #include <iostream> #include <vector> #include <queue> #include "BSTNode.h" using namespace std; namespace trees { enum Direction { Left, Right, }; template<class T> class BST { private: voi...
Markdown
UTF-8
1,106
2.578125
3
[ "Apache-2.0" ]
permissive
# Prometheus in a Container Source code for [hiveco/prometheus](https://hub.docker.com/r/hiveco/prometheus). This image is designed to be an extremely thin wrapper around the official `prom/prometheus` image, providing support for supplying command line arguments in environment variables. See [#504](https://github.com...
Markdown
UTF-8
647
3.328125
3
[ "MIT" ]
permissive
# has-trailing-slash ![Build Status](https://travis-ci.org/Javirln/has-trailing-slash.svg?branch=master) [![npm version](https://badge.fury.io/js/has-trailing-slash.svg)](https://badge.fury.io/js/has-trailing-slash) ![Dependency Status](https://david-dm.org/javirln/has-trailing-slash.svg) Checks if a string has a trai...
JavaScript
UTF-8
293
2.65625
3
[]
no_license
var inputField = document.querySelector('.post-content'), form = document.querySelector('#post-form') inputField.addEventListener('keydown', function (e) { if (e.key == 'Enter') { if (!e.shiftKey) { e.preventDefault(); form.submit(); } } })
Java
UTF-8
1,506
2.125
2
[]
no_license
/* * Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com> */ package play.db.ebean; import com.avaje.ebean.Ebean; import com.avaje.ebean.TxCallable; import play.libs.F; import play.mvc.Action; import play.mvc.Http.Context; import play.mvc.Result; /** * Wraps an action in an Ebean transaction. */ public...
Markdown
UTF-8
683
3.03125
3
[ "CC0-1.0" ]
permissive
# prepend Edit a file to insert lines on head. See [help.txt](./src/help.txt). ## Installation You need cargo (Rust build tool). ```sh cargo install --git https://github.com/vain0x/prepend ``` ## Motivation Since pipe-like works concurrently, this doesn't work as you expected: ```sh # a.txt has some data. echo ...
Python
UTF-8
426
2.703125
3
[ "MIT" ]
permissive
from Biscuit.utils.version import Version def test_version(): v1 = Version(0, 1, 2, 0) v2 = Version(1, 2, 1, 1) v3 = Version(1, 11, 2, 3) v4 = Version.from_repr('1.3') v5 = Version.from_repr('v2.9.31') v6 = Version.from_repr('1.11.2-b3') assert str(v1) == '0.1.2' assert str(v2) == '1....
C#
UTF-8
900
2.625
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; /// <summary> /// Enemy type: Skeleton archer /// </summary> public class Archer : Enemy { public float arrowCooldown; public GameObject arrowPrefab; bool canFire = false; void Start() { StartCoroutine (ArrowCooldownCoroutine (Ran...
Python
UTF-8
770
3.28125
3
[]
no_license
print("Starting") import math MAX = 10**15 def D(x): return 3*x def U(x): return (3*x-2)/4 def d(x): return (3*x+1)/2 def string(code): x = 1 for i in range(len(code)-1,-1,-1): while True: temp = x if code[i] == 'D': temp = D(x) ...
C
GB18030
805
3.09375
3
[]
no_license
#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<stdlib.h> #include<assert.h> #if 0 int Mystrncmp(const char *string1, const char *string2, size_t count) { int i = 0; assert(string1 != NULL); assert(string2 != NULL); for (i = 0; i < count; i++) { if ((*string1 == *string2) && (i = count-1)) { r...
Java
UTF-8
1,181
2.078125
2
[ "Apache-2.0" ]
permissive
/** * 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 in writing, software * ...
Java
UTF-8
5,463
2.09375
2
[ "Apache-2.0" ]
permissive
package net.floodlightcontroller.baadal; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import org.projectfloodlight.openflow.types.IPv4Address; import org.projectfloodlight.openflow.types.VlanVid; import org.restlet.data.Status; import or...
Python
UTF-8
519
3.640625
4
[]
no_license
cars = ['mazda', 'renault', 'kia', 'chevrolet'] for car in cars: print(car) pet = { "name": "davor", "age": 31, "country": "Colombia" } for key in pet: print(f"key: {key} value: {pet[key]}") for key, value in pet.items(): print(f"key: {key} value: {value}") for n in [1, 2, 3, 4, 5, 6, 7, 8]...
Swift
UTF-8
1,243
2.65625
3
[]
no_license
// // ViewController.swift // MyFirstApp // // Created by Ben Liong on 24/3/15. // Copyright (c) 2015 General Assembly. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet weak var temperatureLabel: UILabel? @IBOutlet weak var getTemperatureButton: UIButton? ov...
JavaScript
UTF-8
4,210
2.578125
3
[]
no_license
/* * Copyright IBM Corp. All Rights Reserved. * * SPDX-License-Identifier: Apache-2.0 */ 'use strict'; const { Contract } = require('fabric-contract-api'); class Insurance extends Contract { var currentClaimNum = 0; async initLedger(ctx) { console.info('START: Initialize Ledger'); consol...
JavaScript
UTF-8
1,407
3.03125
3
[]
no_license
$(document).ready(function(){ var maxField = 10; //Input fields increment limitation var addButton = $('.add_button'); //Add button selector var wrapper = $('.field_wrapper'); //Input field wrapper var fieldHTML = '<div><hr><input type="text" name="sku[]" id="sku[]" style="height: 30px" placeholder="sku...
Java
UTF-8
1,679
3
3
[]
no_license
package inheritanceExample05; public class StarCraft { public static void main(String[] args) { Marine my = new Marine(); Marine com = new Marine(); //��ü�� ��ü�� //ü�� : 100 ü�� : 100 System.out.println(my + "\t" + com); System.out.println("���� ���� 2ȸ ����!!!!"); for(int i=0;i<2;i++) ...
Python
UTF-8
1,351
2.65625
3
[ "Apache-2.0" ]
permissive
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # http://www.apache.org/licenses/LICENSE-2.0 # or in the "license" file...
Markdown
UTF-8
10,823
3.09375
3
[ "MIT" ]
permissive
--- title: network 1 author: CYM date: 2020-12-25 22:00:00 categories: [network] tags: [network] --- **(1) an IP address**<br> IP주소는 네트워크 계층에서 사용하는 주소이며, IP 헤더에 포함된 데이터 주소.<br> | |IPv4주소|IPv6주소| |-|--------|--------| |주소 체계|32bit(2^32개)|128bit(2^128개)| |주소 표기|10진수|16진수| |주소 구성|8bit씩 4개의 옥텟|16bit씩 8개의 필드| |주소 예제|192.1...
C++
UTF-8
549
2.734375
3
[]
no_license
#include <stdlib.h> #include <stdio.h> #include <string.h> #define StrLength 100 int main(){ char buf[StrLength]; int i=0,count=0; scanf("%s",buf); while(strcmp(buf,"end")!=0){ count=0; for(i=0;i<strlen(buf);i++){ if(buf[i]=='(') ...
PHP
UTF-8
369
2.78125
3
[]
no_license
<?php namespace App\Model\Fisica; class Dvd extends \App\Model\Produto{ private $preco; function __construct($nome, $ator, $preco){ parent::__construct($nome, $ator); $this->preco = $preco; } function getPreco(){ return $this->preco; } function setPreco($prec...
Java
UTF-8
5,327
2.6875
3
[]
no_license
package com.sundy.simple.annotation.db; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import java.lang.reflect.Field; import java.util.ArrayList; /** * 项目名称:AnnotationStudy * * @Author...
Java
UTF-8
31,791
1.609375
2
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. * @author ehtesham, Arpan, Tanvir */ package PrePurchase; import org.apache.struts2.ServletActionContext; import pojo.hibernate.ErpmTenderMasterDAO; import java.io.*; import org.apache.commons.io.FileUtils; import java.i...
Python
UTF-8
3,419
2.8125
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thu Jul 5 16:18:48 2018 @author: SRanganath """ import re import pandas as pd import datetime # Time calculations # current_year = datetime.datetime.now().year # ts_years = list(pd.Series(range((current_year-3), (1+current_year)))) # Function to check wether rows a...
Markdown
UTF-8
4,793
3.21875
3
[]
no_license
# vue 当我们需要进行数值计算,并且依赖于其它数据时,应该使用 computed,因为可以利用 computed 的缓存特性,避免每次获取值时,都要重新计算; 当我们需要在数据变化时执行异步或开销较大的操作时,应该使用 watch,使用  watch  选项允许我们执行异步操作 ( 访问一个 API ),限制我们执行该操作的频率,并在我们得到最终结果前,设置中间状态。这些都是计算属性无法做到的。 ## Vue 组件间通信有哪几种方式? props / \$emit 适用 父子组件通信 ref 与 $parent / $children 适用 父子组件通信 EventBus ($emit / $on) 适用于 父子、隔代、...
Markdown
UTF-8
2,099
2.765625
3
[]
no_license
# Response utils A set of utitilties for response: 1. `topicUrl.fromConfig()` returns a topic url for a given response config 1. `EmbedTagParser` Parses a response embed tag and returns a config object. ## Response embed tag parser ## Response embed tag parser Read and validate response embed config from differen...
Swift
UTF-8
1,347
3.03125
3
[]
no_license
// // RunToVentView.swift // Aperture Escape // // Created by Xia He on 2021/7/26. // import SwiftUI struct RunToVentView: View { let gameState: GameState var body: some View { GeometryReader { metric in ScrollView { VStack { HeaderImage(imageName: "v...
Java
UTF-8
1,037
3.453125
3
[]
no_license
//Figure / Sculpture import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int r, c; r = sc.nextInt(); c = sc.nextInt(); int[][] input = new int[r][c]; //Leer todo el input for (int i = 0; i < r; i++) { for (int j ...
Java
UTF-8
535
1.976563
2
[]
no_license
package com.service; import com.POJO.User; /** * @author: 曹樾 * @program: task5-module * @description: 登录 * @create: 2018/5/8 下午3:17 */ public interface LoginService { int deleteByPrimaryKey(Integer id); int insert(User record); int insertSelective(User record); User selectByPrimar...
C
UTF-8
1,266
2.640625
3
[]
no_license
#include "TPO.h" int BorrarPost (int fd, NodePost *PRoot, int id) { char* buffer[BUFFER]; POST *find; NodePost *Aux=PRoot; int sel,i; buffer[BUFFER]=NULL; //pongo el ultimo puntero a NULL para saber que termino for(i=0; Aux!=NULL; i++) //Creo vector de Titulos { buffer[i]=(char *)mal...
PHP
UTF-8
1,357
2.53125
3
[ "MIT" ]
permissive
<?php namespace TheArKaID\LaravelFaspay\Debit\Entity; class FaspayPaymentChannelResponse { private $response_code; private $response_desc; private $response; private $merchant_id; private $merchant; private $payment_channel; function getResponse() { return $...
Java
UTF-8
597
1.664063
2
[]
no_license
package ir.ssa.parkban.repository; import ir.ssa.parkban.domain.entities.MessageReceiverEntity; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.querydsl.QueryDslPredicateExecutor; import org.springframework.data.repository.PagingAndSortingRepository; import org....
Java
UTF-8
2,006
3.25
3
[]
no_license
package com.example.abhishek.jokeprovider; import java.util.Random; public class JokeProvider { private final Random random = new Random(); private String[] jokes = { "The more I C.... the less I see.", "July 4th is Independence day. And the day Chuck Norris was born. Coincidence? I th...
Java
UTF-8
2,319
3.703125
4
[]
no_license
package lxl.y2020.DEC; import java.util.PriorityQueue; /** * @program: leetcode-hz * @description: 915. 分割数组 * 给定一个数组 A,将其划分为两个不相交(没有公共元素)的连续子数组 left 和 right, 使得: * <p> * left 中的每个元素都小于或等于 right 中的每个元素。 * left 和 right 都是非空的。 * left 要尽可能小。 * <p> * 在完成这样的分组后返回 left 的长度。可以保证存在这样的划分方法。 * <p> * <p> * <p> * 示例...
C++
UTF-8
815
2.6875
3
[]
no_license
#include <iostream> #include <stdio.h> #include <map> #include <string> #include <string.h> #include <set> #include <math.h> using namespace std; double check(double x){ return 6*x*x*x+5*x*x+7*x+9; } int main() { double n; while(scanf("%lf",&n)!=EOF){ double l=-0.000000001,r=10.00000000001; ...
Python
UTF-8
1,159
2.796875
3
[]
no_license
import os.path import pickle from conui import Contact _path_ = "data.dat" def load() -> dict: if os.path.exists(_path_): with open(_path_, "rb") as file: data = pickle.load(file) return data else: return {} def save(db:dict): with open(_path_, "wb") as file: ...
Java
UTF-8
1,817
2.4375
2
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
/** * * * @author WILEDION */ package kani.monde; import kani.utils.KaniMap; import org.newdawn.slick.Animation; import org.newdawn.slick.SlickException; import org.newdawn.slick.geom.Polygon; import org.newdawn.slick.geom.Shape; /** * Classe personnage de jeu */ public class Perso extends Chose { Animatio...
Python
UTF-8
1,751
3.046875
3
[]
no_license
## Downsampling import pandas as pd #detail def detailDownsampled(): data=pd.read_csv("detail.csv",parse_dates =['Absolute Time'], index_col ='Absolute Time') #reading the csv file that was saved in task 1 and setting Absolute time as index column data.drop(['Record Index'], axis='columns', inplace=True) ...
JavaScript
UTF-8
1,619
3.328125
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
const DOG_URL = 'http://localhost:3000/pups' const dogBarEl = document.getElementById('dog-bar') const dogInfoEl = document.getElementById('dog-info') const dogFilterBtn = document.getElementById('good-dog-filter') let toggle = false const getDogs = () => { return fetch(DOG_URL) .then(resp => resp.json()) ....
Java
UTF-8
3,300
1.953125
2
[]
no_license
package com.vf.ana; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.t...
JavaScript
UTF-8
1,871
2.75
3
[ "Apache-2.0" ]
permissive
'use strict' const { expect } = require('chai') const fs = require('fs') const path = require('path') const programmeChangeWatcher = require('./../ProgrammeChangeWatcher') const PATH = '.' const FILE_NAME = 'programme.json' const FILE_PATH = path.join(PATH, '/', FILE_NAME) describe('ProgrammeFileWatcher', function (...
Java
UTF-8
452
1.703125
2
[]
no_license
package com.xiangyu.web.controller.test; import com.xiangyu.ext.base.BaseController; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** * Created by xiangyu on 2016/11/4. */ @SuppressWarnings("unused") @Controller @RequestMapping("/test") public clas...
Markdown
UTF-8
133
2.5625
3
[]
no_license
# Capstone project deals in analysing the hotel's reviews and predicting a score to the hotel based on its positive/negative reviews
Markdown
UTF-8
13,144
3.5
4
[]
no_license
#Getting and Cleaning Data Course Project (Coursera) >Codebook for the project of Getting and Cleaning Data Course, available in Coursera. >This codebook describes the analysis performed by the `run_analysis.R` script, describing the >variables, the data and the transformations performed to clean up the raw data in o...
C++
UTF-8
813
3.59375
4
[]
no_license
#include <iostream> using namespace std; const int longi = 0; int tama_cade_itera(const char cadena[], int longi); void concate(char cadena1[], char cadena2[]); int main(){ char cadena1[] = "Pepe"; char cadena2[20] = "Lucho"; concate(cadena1, cadena2); cout<<cadena2; return 0; }...
Markdown
UTF-8
13,386
2.703125
3
[ "MIT", "CC-BY-4.0" ]
permissive
--- title: Understanding and using Hyper-V hypervisor scheduler types description: Provides information for Hyper-V host administrators on the use of Hyper-V's scheduler modes author: allenma ms.author: allenma ms.date: 04/26/2018 ms.topic: article ms.prod: windows-server-hyper-v ms.technology: virtualization ms.locali...
Go
UTF-8
4,346
2.765625
3
[ "MIT" ]
permissive
package vc import ( "bytes" "fmt" "os" "runtime" "strconv" "sync" "time" ) import "./cmap" func max(a, b int) int { if a < b { return b } return a } func GetGID() uint64 { b := make([]byte, 64) b = b[:runtime.Stack(b, false)] b = bytes.TrimPrefix(b, []byte("goroutine ")) b = b[:bytes.IndexByte(b, ' ...
C++
UTF-8
853
2.8125
3
[]
no_license
#include <vector> #include <iostream> #include <algorithm> #include <time.h> #include <cassert> using namespace std; class Solution { public: vector<vector<int>> combinationSum(vector<int>& candidates, int target) { vector<vector<int>> vec_ret; return vec_ret; } }; int main() { //int nums_1[] = {}; int nums...
Python
UTF-8
2,700
3.015625
3
[]
no_license
import sys import typing import argparse import logging parser = argparse.ArgumentParser() parser.add_argument("-v", "--verbose", action="store_true", help="enable verbose logging") parser.add_argument("-n", "--files", type=int, default=5, help="optional: number of ranks") parser.add_argument("-m", "--ranks", type=int...
Python
UTF-8
351
3.3125
3
[]
no_license
class Solution: def findNumbers(self, nums: List[int]) -> int: return len([ele for ele in nums if len(str(ele)) % 2 == 0]) class Solution: def findNumbers(self, nums: List[int]) -> int: count = 0 for ele in nums: if len(str(ele)) % 2 == 0: count += 1 ...
C
UTF-8
350
3.46875
3
[]
no_license
#include <stdio.h> #include <stdlib.h> int main() { int sex; double age,height,w,m; printf("Give sex: 1-male 2-female "); scanf("%d",&sex); printf("Give age and height "); scanf("%lf %lf",&age,&height); m=50+0.75*(height-150)+(age-20)/4; w=m-10; if(sex==1) printf("%f",m); else pr...
Python
UTF-8
2,295
3.078125
3
[]
no_license
#!/usr/bin/python """ Starter code for exploring the Enron dataset (emails + finances); loads up the dataset (pickled dict of dicts). The dataset has the form: enron_data["LASTNAME FIRSTNAME MIDDLEINITIAL"] = { features_dict } {features_dict} is a dictionary of features associated with that pers...
C++
UTF-8
1,141
3.78125
4
[]
no_license
/*Given a list arr of N integers, print sums of all subsets in it. Output should be printed in increasing order of sums. Input: N = 2 arr[] = {2, 3} Output: [0, 2, 3, 5] Explanation: When no elements is taken then Sum = 0. When only 2 is taken then Sum = 2. When only 3 is taken then Sum = 3. When element 2 and 3 a...
Java
UTF-8
2,295
3.71875
4
[]
no_license
package com.zjj.nowcoder.aiqiyi0822.ex4; import java.util.Scanner; import java.util.concurrent.Semaphore; import java.util.function.IntConsumer; public class Main { public static void main(String[] args) { final Scanner reader = new Scanner(System.in); int n = reader.nextInt(); ZeroEvenOdd...
Java
UTF-8
217
1.820313
2
[]
no_license
/* CS 5004 - Easy Animator - Model * Vandita Attal & Swapnil Mittal */ package cs5004.animator.animation; /** * This is an enum class representing types of animations. */ public enum TypeOfAnimation { MOVE, SCALE, COLOR }
Python
UTF-8
695
3.734375
4
[]
no_license
# 1. Read input data width = int(input()) length = int(input()) height = int(input()) volume_home = width * length * height number_boxes = 0 free_space = volume_home - (number_boxes * 1) command = "" done_command = False while free_space > 0: command = input() if command != "Done": boxes = int(command) ...
Python
UTF-8
617
3.296875
3
[]
no_license
""" 矩形覆盖 Q: 我们可以用2 1的小矩形横着或者竖着去覆盖更大的矩形。请问用n个2 1的小矩形无重叠地覆盖一个2 * n的大矩形,总共有多少种方法? A: 依然是斐波那契数列的变形。代码参考跳台阶。 """ # -*- coding:utf-8 -*- class Solution: def rectCover(self, number): # write code here if number == 0: return 0 tempArray = [1, 2] if number >= 3: for ...
Python
UTF-8
3,734
3.40625
3
[]
no_license
from collections import defaultdict import copy import time start = time.time() def read_content_into_rules_and_strings(lines): rules = defaultdict(list) strings_to_attempt_to_match = [] rules_done = False for line in lines: if rules_done: strings_to_attempt_to_match.append(line) ...
Python
UTF-8
13,016
2.875
3
[]
no_license
import string from operator import itemgetter from couple import Couple from dancer import Dancer from heat import Heat, Heat_Report from heatlist import Heatlist # this module processes a ballroom competition heatlist file in HTML format generated by the CompMngr program. class CompMngrHeat(Heat): '''The CompM...
Java
UTF-8
19,880
2.578125
3
[]
no_license
package common.jsp; import common.databean.GenericSortableTable; import common.databean.GenericTable; import common.jsp.databean.GenericStringData; import java.util.Hashtable; import java.util.Vector; public class HTMLGenerator { public static final int iJAVASCRIPT_IN_CATEGORY_SUBCATEGORY_DEPENDENCY = 0; publi...
C
UTF-8
606
3.453125
3
[]
no_license
/* * David Rubý * fakulta informačních technologií Vysokého učení technického v Brně * příklad 2 *25. 04. 2019 */ #include"io.h" int get_word(char *str, int max, FILE *file) { int return_value; //reading one word return_value = fscanf(file, "%s", str); //if the word is too long, the length will...
JavaScript
UTF-8
1,601
3.0625
3
[]
no_license
function setup() { //create a canvas to draw on createCanvas( 700, 700 ); } // starting to draw the portrait function draw() { //background background( 'rgb(137, 247, 201)' ); //arm1 push(); fill( 'rgb(231, 127, 198)' ); rotate( radians(-40) ); rect( -35, 375, 30, 110); pop(); //arm2 push...
C++
UTF-8
2,872
3.359375
3
[]
no_license
/* 2. Да се направи програма која ќе ја користи класата Штедач и ќе овозможи: a) Внесување на нов штедач во системот b) Приказ на податоците c) Уплата на средства d) Исплата на средства (со контрола дали е можна таква исплата) e) Приказ на салдото за даден штедач */ #include <iostream> using namespace std; ...
Markdown
UTF-8
5,150
3.140625
3
[]
no_license
--- title: "正規表現の例: 日付形式の変更" description: "正規表現の例: 日付形式の変更" keywords: .NET, .NET Core author: stevehoag ms.author: shoag ms.date: 07/28/2016 ms.topic: article ms.prod: .net ms.technology: dotnet-standard ms.devlang: dotnet ms.assetid: 3e196697-981c-4c1d-93dd-c3b236ef36dd translationtype: Human Translation ...
Python
UTF-8
481
3.328125
3
[ "MIT" ]
permissive
import urllib.request, urllib.parse, urllib.error import xml.etree.ElementTree as ET while True: url = input('Enter location: ') if len(url) < 1: break print('Retrieving', url) uh = urllib.request.urlopen(url) data = uh.read() print('Retrieved', len(data), 'characters') tree = ET.fromstrin...
C#
UTF-8
2,018
2.625
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Shadows { public partial class FormPrizma : Form { /// <summary> /// Положение объекта...
JavaScript
UTF-8
437
2.921875
3
[]
no_license
'use strict'; var number_map_to_word_over_26 = function(collection){ return collection.map(a=>convert(a)); function convert(number){ if (number <= 26){ return String.fromCharCode(96 + number); } else if(number % 26 == 0){ return convert((number / 26) - 1) + convert(26); } else { ...
Shell
UTF-8
3,308
4.03125
4
[ "BSD-3-Clause" ]
permissive
#!/bin/bash # Copyright 2020 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Specify the version of the tools to download if [[ "$1" == "" ]]; then VER_FUCHSIA_SDK="latest" else VER_FUCHSIA_SDK="$1" fi set -eu # Erro...
Java
UTF-8
843
2.84375
3
[]
no_license
import java.sql.*; public class PreparedStatement{ public static void main(String args[]){ try{ Connection con = null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String path = "D:\\person.mdb"; con =DriverManager.getConnection("jdbc:odbc:Dri...
PHP
UTF-8
17,332
2.53125
3
[]
no_license
<?php /** * <p>Survey endpoiints</p> * * @package Ssmart * @subpackage endpoint */ class Ssmart_Panelist_SurveyEndpoint extends Ssmart_GlobalController { /** * Gets survey data * * <p><b>required params: </b> * survey_id * send_questions * send_question_choices</p> * * @param Ssmart_EndpointReques...
Java
UTF-8
1,051
2.25
2
[ "Apache-2.0" ]
permissive
package me.zuichu.staticlib.core; import android.app.Activity; import me.zuichu.staticlib.manager.StaticEvent; /** * Created by office on 2018/4/16. * 数据统计核心类 */ public class StaticCore { /** * 统计页面浏览时长:开始 * * @param activity */ public static void resume(Activity activity) { } ...
Java
UTF-8
1,644
3.078125
3
[]
no_license
/** * @author chaycao * @description * @date 2018-05-22 19:25. */ public class Solution_304 { static class NumMatrix { private int[][] temp; private int n = 0; private int m = 0; public NumMatrix(int[][] matrix) { if (matrix == null || matrix.length == 0) ...
Python
UTF-8
313
3.21875
3
[]
no_license
if __name__ == '__main__': i = 10 while i <= 10000000: n = len(str(i)) j = 1 sumValue = 0 while j <= n: cell = (i % (10 ** j)) // (10 ** (j - 1)) sumValue += cell ** n j += 1 if sumValue == i: print(i) i += 1
JavaScript
UTF-8
6,791
2.515625
3
[ "MIT" ]
permissive
function changebegindate(date) { var datef = $.cookie("EZDATE1"); var datet = $.cookie("EZDATE2"); if (datef && datef != '') { var hayfechas = 1; var newdate = date; } else { var datef = date; var datet = ''; var newdate = ''; var hayfechas = 0; } if (window.appmobile && window.appmobile == "yes") { ...
PHP
UTF-8
4,049
2.90625
3
[]
no_license
<?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ /** * Easy Web Service creation * * PHP 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy o...
Markdown
UTF-8
8,572
2.53125
3
[]
permissive
# Streaming replication protocol EPGSQL supports PostgreSQL streaming replication protocol. See https://www.postgresql.org/docs/current/static/protocol-replication.html ## Use cases ***Consistent cache*** Erlang application uses in read-only mode data from PostgreSql DB tables (e.g. some configuration, rate/price p...
Python
UTF-8
332
3.359375
3
[]
no_license
a=int(input("enter 1st num:")) b=int(input("enter 2nd num:")) c=int(input("enter 3rd num:")) sum=a+b+c avg=(a+b+c)/3 print("sum:",sum) print("average:",avg) ''' expected out put enter 1st num:1 enter 2nd num:2 enter 3rd num:3 sum:6 average:2 ''' #output #enter 1st num:1 #enter 2nd num:2 #enter 3rd num:3 #sum:6 #aver...
C++
UTF-8
3,675
2.703125
3
[]
no_license
#include <stdexcept> #include <vector> #include <random> #include "andres/marray.hxx" #include "andres/ml/decision-trees.hxx" inline void test(const bool& x) { if(!x) throw std::logic_error("test failed."); } template<class T> void printLiteral2D(andres::Marray<T> arr, const size_t shape[]) { std::cout << "{...
Java
UTF-8
4,097
2.703125
3
[]
no_license
package com.example.eunoia.user_profile3.healthyfoodsuggestion.course.aa; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.example.eunoia.user_profile3.R; public class aa1 extends AppCompatActi...
Python
UTF-8
2,635
3.0625
3
[ "MIT" ]
permissive
import unittest import gdalhelpers.checks.values_checks as values_check import math class ValuesCheckTests(unittest.TestCase): def test_check_value_is_zero_or_positive(self): with self.assertRaisesRegex(TypeError, "must be either `int` or `float`"): values_check.check_value_is_zero_or_positiv...
Python
UTF-8
679
3.375
3
[]
no_license
class Solution: # @param {int[]} nums an integer array # @param {int} target an integer # @return {int} the difference between the sum and the target def twoSumClosest(self, nums, target): if not nums or len(nums) < 2: return -1 nums.sort() min_diff = sys.maxint ...
Java
UTF-8
1,105
2.4375
2
[]
no_license
package dev.feldmann.redstonegang.wire.game.base.addons.both.shopintegration.cmds; import dev.feldmann.redstonegang.common.RedstoneGang; import dev.feldmann.redstonegang.common.utils.Cooldown; import dev.feldmann.redstonegang.wire.base.cmds.arguments.Arguments; import dev.feldmann.redstonegang.wire.base.cmds.arguments...
C#
UTF-8
1,308
3.40625
3
[]
no_license
using System; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; namespace TaskParallel { class Program { static void Main(string[] args) { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); Parallel.Invoke( ...
Go
UTF-8
512
3.28125
3
[]
no_license
package main import ( "fmt" "net/http" "os" ) func main() { links := []string{ "https://www.google.com", "https://www.facebook.com", "https://www.stackoverflow.com", "https://golang.org", } c := 0 for _, link := range links { go checkLink(link, &c) } } func checkLink(link string, c *int) { res, ...
Java
UTF-8
7,760
2.03125
2
[]
no_license
package mitrais.com.clinicapp.activities.mainmenu; import android.app.Dialog; import android.app.ProgressDialog; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import andr...
C++
UTF-8
1,842
2.75
3
[]
no_license
/** * Number:uva156 * Title:Ananagrams * Status:AC * Tag:[模拟, map] **/ #include <cstdio> #include <iostream> #include <cstring> #include <cmath> #include <algorithm> #include <numeric> #include <vector> #include <string> #include <map> using namespace std; #define INF 0x3f3f3f3f typedef long long ll; typedef unsigned...