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
Python
UTF-8
8,902
2.859375
3
[]
no_license
import sys import datetime as dt import pandas as pd import numpy as np from collections import defaultdict years = [2008, 2009, 2010, 2011, 2012, 2013] weatherDFs = [] fireDFs = [] OUTPUT_FILE = "bakedData/fireWeatherData.csv" for y in years: weatherDFs.append(pd.read_csv(f"cleanedData/weather{y}.csv")) fire...
JavaScript
UTF-8
2,067
2.546875
3
[]
no_license
( function() { "use strict"; /** * 마우스 드래그 줌아웃 객체. * * 마우스로 드래깅하여 해당 영역으로 축소하는 컨트롤 객체. * * @constructor * * @example * * <pre> * var ugDragZoomOut = new ugmp.control.uGisDragZoomOut( { * uGisMap : new ugmp.uGisMap({...}), * useSnap : true, * useDragPan : true, * c...
C++
UTF-8
641
2.921875
3
[]
no_license
/*乘客类,原理和card类相似,也是主要以存放信息、显示信息为主。特别的是takeon方法用于人车交互*/ #ifndef PERSON_H_ #define PERSON_H_ #include <string> #include <iostream> #include "card.h" using namespace std; enum sex{male, female}; class Person{ private: string Name; sex Gender; string Job; string Workplace; string...
PHP
UTF-8
2,674
2.8125
3
[]
no_license
<?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Faker; class UsergenController extends Controller { public function __construct() { # Not in use but here for future enhancement } public function getPage(Request $request) { ...
PHP
UTF-8
5,675
2.53125
3
[]
no_license
<?php namespace Chibi; use Chibi\Hurdle\ShouldRedirect; use Chibi\Router\Router; use Chibi\Exceptions\ControllerNotFound; use Chibi\Exceptions\ControllersMethodNotFound; use Whoops\Handler\PrettyPageHandler; use Whoops\Handler\JsonResponseHandler; class App { /** * @var App */ prot...
Java
UTF-8
5,954
2.34375
2
[]
no_license
package com.nanalog.api.user.service; import com.nanalog.api.user.model.entity.User; import com.nanalog.api.user.model.entity.UserDeleteQueue; import com.nanalog.api.user.model.request.UserCreateRequest; import com.nanalog.api.user.model.request.UserDeleteRequest; import com.nanalog.api.user.model.request.UserUpdateRe...
Java
ISO-8859-1
2,250
2.921875
3
[]
no_license
package control; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import javax.swing.JOptionPane; import entities.Candidato; public class RetornaAgendaEntrevistaContr...
C++
UTF-8
221
2.640625
3
[]
no_license
#include <iostream> using namespace std; int a[1010]; int main(){ int a1, a2, n; cin>>a1>>a2>>n; a[0] = a1; a[1] = a2; for(int i=2; i<n; i++){ a[i] = a[i-1] + a[i-1] - a[i-2]; } cout<<a[n-1]; return 0; }
C++
GB18030
1,670
2.5625
3
[ "MIT" ]
permissive
/*------------------------------------------------------------------------------ * FileName : gsafemem.h * Author : lbh * Create Time : 2018-08-26 * Description : ȫڴ * CopyRight : from gservers_engine @loboho * ----------------------------------------------------------------------------*/ #ifndef __GBASE__GSA...
Python
UTF-8
360
3.78125
4
[]
no_license
#22.インデックス付きループ #インデックスと値を同時に取り出す test_list=['python','-','izm','.','com'] for idx,val in enumerate(test_list): print(idx,':',val) print('-------------------') #開始値を指定する場合 test_list2=['python','-','izm','.','com'] for idx,val in enumerate(test_list,1): print(idx,':',val)
Java
UTF-8
841
3.578125
4
[ "MIT" ]
permissive
import edu.princeton.cs.algs4.StdIn; import edu.princeton.cs.algs4.StdOut; //import edu.princeton.cs.algs4.Stopwatch; /** * Created by Katyana on 4/15/2016. * * Takes an integer argument k and reads in N strings from StdInput. * It then prints out exactly k of the strings in uniformly random order. * * We're ass...
Java
UTF-8
2,104
2.234375
2
[ "MIT" ]
permissive
package com.KND.chequera.model; import java.sql.Date; import com.KND.chequera.entity.Chequera; import com.KND.chequera.entity.Tipo_Movimiento; public class MovimientosModel { private int idmovimientos; private String m_concepto; private Double m_monto; private Date mFecha; private Boolean m_status; private ...
Java
UTF-8
765
3.546875
4
[]
no_license
package chapter_4; /** * Implement a function to check if a tree is balanced * For the purposes of this question, a balanced tree is * defined to be a tree such that no two leaf nodes differ * in distance from the root by more than one * @author Andy * */ public class question4_1 { public static boolean che...
Python
UTF-8
1,759
3.078125
3
[]
no_license
from SciStreams.interfaces.streams import Stream from SciStreams.interfaces.StreamDoc import StreamDoc from SciStreams.interfaces.StreamDoc import merge, psdm, psda def test_stream_map(): ''' Make sure that stream mapping still works with StreamDoc ''' def addfunc(arg, **kwargs): return a...
TypeScript
UTF-8
6,056
2.609375
3
[]
no_license
jest.unmock("eventsource"); import EventSource from "eventsource"; import IntegrationTestEnvironment from "./helpers/integrationTestEnvironment"; interface IEventListener { cb: (evt: MessageEvent) => void; type: string; } interface ICallbacks { onmessage?: (evt: MessageEvent, resolve: (...any) => void) => void;...
Markdown
UTF-8
24
2.640625
3
[]
no_license
# ios-training-travelers
Java
UTF-8
7,180
1.90625
2
[]
no_license
package com.labs.client.generated; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; /** * This object contains factory methods for each * Java content interface and Java element interface...
PHP
UTF-8
1,450
2.71875
3
[]
no_license
<?php use CleanPhp\Invoicer\Domain\Entity\Invoice; use CleanPhp\Invoicer\Domain\Entity\Order; use CleanPhp\Invoicer\Domain\Factory\InvoiceFactory; describe( "InvoiceFactory", function () { describe( "->createFromOrder()", function () { it( "should return an order object", function () { $order ...
Java
UTF-8
1,044
3.34375
3
[]
no_license
/*** * Runtime: 2 ms 99.87% * Memory Usage: 40 MB */ public class Q6_ZigZag { public String convert(String s, int numRows) { if(numRows == 1) { return s; } StringBuilder sb = new StringBuilder(); int iteration = numRows * 2 - 2; int counter = 0; while(...
Java
UTF-8
272
2.390625
2
[]
no_license
package replit; public class html { public static void main(String[] args) { String html= "the whole time was raining"; do{ System.out.println(html.charAt(0)); html=html.substring(5); }while (!html.isEmpty()); } }
Java
UTF-8
581
1.585938
2
[]
no_license
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.St...
Java
UTF-8
367
2.109375
2
[]
no_license
package com.oops.interfacess; public class TestAnnn { public static void main(String[] args) { FuncInter funcInter=new FuncInter() { @Override public void testAdd() { System.out.println("testing"); } }; funcInter.testAdd(); funcInt...
Java
UTF-8
1,004
2.59375
3
[]
no_license
package edu.northeastern.ccs.im; import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.ArrayList; import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import edu.northeastern.ccs.im.dao.Group; import edu.northeastern.ccs.im.dao.User; /** * This...
Markdown
UTF-8
33,961
2.609375
3
[]
no_license
# ゴール Kubernetes環境をローカルで構築し、アプリケーションのデプロイ方法の一種である「ローリングアップデート」と「Blue/Greenデプロイ」を簡単な例で体験する。 (参考) [アプリケーションのデプロイとテストの戦略](https://cloud.google.com/solutions/application-deployment-and-testing-strategies?hl=ja) # 目次 - [ゴール](#ゴール) - [目次](#目次) - [kubernetes環境構築](#kubernetes環境構築) - [kubernetesのインストール](#kubernet...
Ruby
UTF-8
2,244
3.140625
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
class Song extend Concerns::Findable attr_accessor :name attr_reader :artist, :genre @@all = [] def initialize(name, artist = nil, genre = nil) @name = name self.artist=(artist) unless artist == nil self.genre=(genre) unless genre == nil end def self.all @@all @@all.dup.freeze en...
Python
UTF-8
3,809
3.09375
3
[]
no_license
import unittest import math from openmm import Vec3 from openmm.unit import * from openmm.app.internal.unitcell import computePeriodicBoxVectors from openmm.app.internal.unitcell import computeLengthsAndAngles from openmm.app.internal.unitcell import reducePeriodicBoxVectors def strip_units(x): if is_quantity(x): ...
C#
UTF-8
9,646
2.796875
3
[]
no_license
using UnityEngine; static public class ColliderExtensions { #region Volume static public float ComputeVolume(this Collider that) { if(that is BoxCollider) return (that as BoxCollider).ComputeVolume(); else if(that is SphereCollider) return (that as SphereCollider).ComputeVolume(); else if(that is MeshC...
JavaScript
UTF-8
1,702
2.859375
3
[]
no_license
import React from 'react'; import PokemonSelector from '../components/pokemonSelector'; import PokemonDetail from '../components/pokemonDetails'; class PokemonContainer extends React.Component { constructor() { super(); this.state = { pokemons: [], selectedPokemon: '', ...
Java
UTF-8
704
2.203125
2
[]
no_license
package com.spring.core; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.spring.model.Triangle; public class AOPMain { public static void main(String[] args) { AbstractApplicationContext ctx = new Clas...
Java
UTF-8
2,226
4.1875
4
[]
no_license
package lessons.week3.pratice.queue.pratice1; import java.util.Stack; /** * @version 1.0 剑指 Offer 09. 用两个栈实现队列 * @Description: 用两个栈实现一个队列。队列的声明如下,请实现它的两个函数 appendTail 和 deleteHead , * 分别完成在队列尾部插入整数和在队列头部删除整数的功能。(若队列中没有元素,deleteHead操作返回 -1 ) * * 示例 1: * 输入: * ["CQueue","appendTail","deleteHead","deleteHead"] *...
Java
UTF-8
1,031
2.015625
2
[]
no_license
package com.duheng.gmall.pms.config; import com.alibaba.druid.pool.DruidDataSource; import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context...
Java
UTF-8
718
3.359375
3
[]
no_license
import java.util.UUID; /** * superclass of Triangle and Rectangle * having a abstract method */ public abstract class Shape implements Comparable { UUID id; /** * Get the ID of the property * * @return the UUID of the property */ public UUID getId() { return id; } /...
Shell
UTF-8
4,002
3.109375
3
[ "BSD-3-Clause" ]
permissive
#!/bin/bash export IPT="iptables" # Внешний интерфейс export WAN={{ nat_router_wan_interface }} # Локальная сеть export LAN1={{ nat_router_lan_interface }} export LAN1_IP_RANGE={{ nat_router_lan_ip_range }} # Очищаем правила $IPT -F $IPT -F -t nat $IPT -F -t mangle $IPT -X $IPT -t nat -X $IPT -t mangle -X # Запре...
Python
UTF-8
3,213
2.671875
3
[]
no_license
#!/usr/bin/env python """Chainer example: train a multi-layer perceptron on MNIST This is a minimal example to write a feed-forward net. It requires scikit-learn to load MNIST dataset. """ import argparse import numpy as np import six import chainer from chainer import computational_graph as c from chainer import c...
Python
UTF-8
6,508
2.84375
3
[]
no_license
# Modelo de detección de SPAM usando la base de datos CSDMC2010_SPAM import os import gensim from pyspark import SparkContext sc = SparkContext() sc.setCheckpointDir('/user/cloudera/checkpoiting') rejectedChars = ['<>\'\"?+=\r\n'] # Carga de los datos mailFiles = sc.wholeTextFiles('/user/cloudera/lab-spark-2/TRAI...
Java
UTF-8
8,716
3.578125
4
[]
no_license
import java.util.Random; import java.util.Scanner; /*работает на поле любого размера с любим выигрышным числом*/ public class homeWork3 { private static char[][] field; private static int fieldSizeX = 9; private static int fieldSizeY = 6; private static int winNumber = 3; //выигрышное число pr...
Shell
UTF-8
605
3.15625
3
[]
no_license
# Build container echo "Building docker container" docker build -t todo-frontend . # Update local registry echo "Tagging container for update to registry" docker tag todo-frontend 192.168.1.41:25129/todo-frontend:latest echo "Pushing container to registry" docker push 192.168.1.41:25129/todo-frontend:latest if [ -z $...
C++
UTF-8
387
3.765625
4
[]
no_license
#include <iostream> int max (int a, int b) { std::cout<<"int function"<< std::endl; if(a>b) return a; else return b; } short max (short a, short b) { std::cout<<"short function"<< std::endl; if(a>b) return a; else return b; } int main(int argc, char const *argv[]) { short a = 1, b ...
C
UTF-8
2,488
2.71875
3
[]
no_license
/****************************************************************************** * @File: main.c * @Author: Milandr, L. * @Project: #15.1_CAN_[Simple_Exchange] * @Version: 1.0.1 * @Compiler: ARM Compiler V5.06 (build 750) * @Microcontroller: К1986ВЕ92QI * @Device: Отладочная плата «МилКиТЭС» * @Date: 07...
Markdown
UTF-8
8,438
3.234375
3
[ "MIT" ]
permissive
--- lang: zh title: "控制器(Controllers)" keywords: LoopBack 4.0, LoopBack 4 sidebar: zh_lb4_sidebar permalink: /doc/zh/lb4/Controllers.html layout: translation --- ## 总览 控制器(`Controller`)是一个用于实现应用 API 定义的操作的类。它实现一个应用的业务逻辑, 它实现了一个应用的业务逻辑,并作为“HTTP / REST API”和“域 / 数据库模型”之间的桥梁。 添加修饰符到`Controller`类及其成员,可以映射应用的 API 操作到对应的 ...
Markdown
UTF-8
1,827
3.96875
4
[ "MIT" ]
permissive
# 80. Median **Description** Given a unsorted array with integers, find the `median` of it. A median is the middle number of the array after it is sorted. If there are even numbers in the array, return the `N/2-th` number after sorted. > The size of array is not exceed `10000` **Example** Example 1: ``` Input: ...
TypeScript
UTF-8
2,096
2.53125
3
[]
no_license
import { Component, OnInit } from '@angular/core'; import { UserCommonService } from '../user-common.service'; import * as $ from "jquery"; /** * @desc 修改用户个人密码 * @author lilong * @date 2018-12-29 */ @Component({ selector: 'app-user-repass', templateUrl: './user-repass.component.html', styleUrls: ['./user-re...
Java
UTF-8
2,787
2.6875
3
[]
no_license
package com.frca.passmgr.Database; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import java.util.HashMap; import java.util.Map; public class DbVariables { // Database fie...
TypeScript
UTF-8
331
2.59375
3
[]
no_license
export default class Communicator { private ws: WebSocket; constructor(destination: string, port: number) { this.ws = new WebSocket(`ws://${destination}:${port}`) } send(data: any) { this.ws.send(JSON.stringify(data)) } onRecieve(lambda: any) { this.ws.onmessage = lam...
Python
UTF-8
5,551
2.984375
3
[]
no_license
class BaseStream: """ The parent class for all Streams. Describes attributes about Stream such as size, resolution, and type """ def __init__(self, original_size=None, resolution=None, series_type=None): """ :param original_size: The number of data points in the stream :ty...
Java
UTF-8
1,270
2.234375
2
[]
no_license
package com.quiz.resources; import com.quiz.model.WordList; import com.quiz.model.beans.RestDataMessage; import com.quiz.model.beans.RestMessage; import com.quiz.service.WordListService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import or...
Java
UTF-8
637
1.851563
2
[]
no_license
package cloud.servicefeign.feign; import cloud.servicefeign.HelloWorldServiceFailure; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.ann...
Ruby
UTF-8
128
3.09375
3
[]
no_license
arr = [ 1, 2, 3, "Hello", true, [], 0.5, 4 ] arr.each do |num| if num.is_a?(Integer) p num ** 2 else next end end
Python
UTF-8
2,536
3.171875
3
[]
no_license
import math from collections import deque ''' 다시 풀어보기 ''' def solution(board): def bfs(start): # table[y][x] = 해당 위치에 도달하는 최솟값. table = [[math.inf for _ in range(len(board))] for _ in range(len(board))] # 진행 방향. 위 - 0, 왼쪽 - 1, 아래 = 2, 오른쪽 = 3 dirs = [(-1, 0), (0, -1), (1, 0), (0...
Markdown
UTF-8
2,213
2.59375
3
[]
no_license
--- layout: listing title: Department of History, University of Chicago - Postdoc Fellowship in Digital History link: country: United States subrEmail: jts@uchicago.edu organization: Department of History, University of Chicago date: 2008-02-15 closingDate: jobTitle: Postdoc Fellowship in Digital History published:...
Python
UTF-8
569
2.859375
3
[]
no_license
from functools import reduce def solve(): N = int(input()) A = list(map(int,input().split())) diffs_perm = [] dfs(list(),N,diffs_perm) cnt = 0 for p in diffs_perm: B = A[:] for i in range(N): B[i] += p[i] if reduce(lambda a,b:a*b, B) % 2 == 0: ...
Java
UTF-8
3,267
2.125
2
[ "Apache-2.0" ]
permissive
package com.bytedance.boost_multidex; import android.os.Looper; import android.os.MessageQueue; import android.util.Log; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; /** * Created by Xiaolin(x...
Java
UTF-8
8,367
1.9375
2
[]
no_license
package YouTube.MailNotify; import DiscordBot.Settings.Settings; import DiscordBot.Settings.YouTubeSubscribeItem; import com.sun.mail.imap.IMAPFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sx.blah.discord.handle.obj.IGuild; import javax.mail.*; import java.util.*; import java.util.regex.Matc...
Java
UTF-8
434
3.203125
3
[]
no_license
public class MathObjectExamples { public static void main(String[] args) { Integer y = new Integer(2); Double d = new Double(-101.1); double z = 25; System.out.println(y.MAX_VALUE); System.out.println(y); System.out.println(Math.abs(d)); System.out.println(Math.pow(y, 3)); System....
Swift
UTF-8
5,833
3.484375
3
[ "BSD-3-Clause" ]
permissive
import RegexBuilder public struct Predicate<Value> { private let predicate: (Value) -> Bool public init(_ predicate: @escaping (Value) -> Bool) { self.predicate = predicate } public func callAsFunction(_ value: Value) -> Bool { predicate(value) } } extension Predicate { pub...
Markdown
UTF-8
9,264
3.046875
3
[]
no_license
#Google Java Style [参考文献](http://google-styleguide.googlecode.com/svn/trunk/javaguide.html) ##源文件 文件名为它所包含的大小写敏感的顶级类名,后缀为.java,采用UTF-8编码。 - 空格:除了行结束符,空格字符只用0x20代表,这意味着: 1. 所有字符串中的空格符需要转义。 2. 制表符不用于缩进。 - 对特殊字符,采用转义字符(如\b, \t, \n, \f, \r, \", \' and \\),而不是相应的八进制(\012)或Unicode(\u000a)编码。 - 对非ASCII字符,是采用Unicode字符还...
C#
UTF-8
1,341
2.671875
3
[]
no_license
using Microsoft.Xna.Framework.Graphics; using MonoGameFrogger.Controllers; using MonoGameFrogger.FSM; using MonoGameFrogger.Models; using MonoGameFrogger.Views; namespace MonoGameFrogger.States { class GameOverState : BaseState { private SpriteBatch _spriteBatch; private GameOverView _view; ...
Java
UTF-8
502
1.84375
2
[]
no_license
package com.zcpure.foreign.trade; /** * @author ethan * @create_time 2018/10/23 16:29 */ public class RequestThroughInfoContext { private static ThreadLocal<RequestThroughInfo> threadInfo = new ThreadLocal<>(); public static String KEY_INFO_IN_HTTP_HEADER = "X-AUTO-FP-INFO"; public static RequestThroughInfo get...
Java
UTF-8
2,109
2.25
2
[ "Apache-2.0" ]
permissive
package com.estiasi.restaurant.controller; import com.estiasi.restaurant.model.Restaurant; import com.estiasi.restaurant.service.RestaurantService; import com.estiasi.restaurant.vo.RestaurantVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.spring...
JavaScript
UTF-8
560
2.828125
3
[]
no_license
import { Coords } from "../world/Coords.js"; import { Grid } from "../world/Grid.js"; export class GridElement { constructor(coords, grid) { if(!(grid instanceof Grid)) throw new Error(`${grid} is not of type Grid`); this.grid = grid; this.setCoordinates(coords); } setCoordinates(co...
Java
UTF-8
337
2.140625
2
[]
no_license
package com.nahidstudio.cashmafia.Models; public class DailyChecking { private String date; public DailyChecking() { } public DailyChecking(String date) { this.date = date; } public String getDate() { return date; } public void setDate(String date) { this.dat...
Java
UTF-8
1,860
1.726563
2
[ "Apache-2.0" ]
permissive
/* * * Copyright (c) 2013-2021, Alibaba Group Holding Limited; * 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 ...
Python
UTF-8
961
3.078125
3
[ "MIT" ]
permissive
import os from PIL import Image im=Image.open("nb.png","r") pix=im.load() column,line=im.size big_array=[[] for b in range(line)] for i in range(line): for j in range(column): value=pix[j,i] if value[:3]==(0,255,0): big_array[i].append("grass") elif value[:3]==(150,75,0): ...
Java
UTF-8
735
2.40625
2
[ "BSD-2-Clause" ]
permissive
package com.weisong.common.vodo; abstract public class WithVocoLevel { final protected VoDoUtil voDoUtil; final protected int vocoLevel; abstract public void doExecute() throws Exception; public WithVocoLevel(VoDoUtil voDoUtil, int vocoLevel) throws Exception { this.voDoUtil = v...
Markdown
UTF-8
13,493
2.875
3
[ "Apache-2.0" ]
permissive
# Selections A selection, or a selection folder, allows a [user](#users) to select and organize artworks found on the API. There is no limit to the number of selections created for a particular user, and there is no limit to the number of artworks that a selection may contain. <aside class="notice">Note that a selec...
TypeScript
UTF-8
3,526
2.90625
3
[ "MIT" ]
permissive
import { KeyValueObject } from "./utilities"; export declare type FormErrors<Values> = { [K in keyof Values]?: Values[K] extends object ? FormErrors<Values[K]> : string; }; export declare type FormTouched<Values> = { [K in keyof Values]?: Values[K] extends object ? FormTouched<Values[K]> : boolean; }; export...
Python
UTF-8
604
3.765625
4
[]
no_license
''' Can Python handle everything? Now that you know something more about combining different sources of information, have a look at the four Python expressions below. Which one of these will throw an error? You can always copy and paste this code in the IPython Shell to find out! Instructions 50 XP Possible Answers ...
Shell
UTF-8
1,205
3.109375
3
[ "Apache-2.0" ]
permissive
# ---------------------------------------------------------------------------- # # Package : ua-parser-js # Version : master # Source repo : https://github.com/faisalman/ua-parser-js # Tested on : UBI 8 # Script License: Apache-2.0 License # Maintainer : Vaibhav Nazare <vaibhav_nazare@persis...
Markdown
UTF-8
604
3.09375
3
[ "MIT", "CC-BY-4.0" ]
permissive
--- author: Nathan Carter (ncarter@bentley.edu) --- This solution uses fake example data. When using this code, replace our fake data with your real data. ```R # Here is the fake data you should replace with your real data. xs <- c( 393, 453, 553, 679, 729, 748, 817 ) ys <- c( 24, 25, 27, 36, 55, 68, 84 ) # I...
PHP
UTF-8
3,422
2.640625
3
[]
no_license
<?php include("db_connect.php"); if(isset($_POST['submit'])){ if (!empty($patientid) || !empty($name) || !empty($icnumber) || !empty($phonenumber) || !empty($address) || !empty($gender) || !empty($races) || !empty($birthdate)) { $patientid = $_POST['patientid']; $name = $_POST['name']; ...
Rust
UTF-8
3,363
2.625
3
[ "Apache-2.0" ]
permissive
use crate::conversion::{BorrowFromGValue, FromGValue}; use crate::structure::{Edge, Path, Property, Vertex, VertexProperty}; use crate::GremlinResult; use chrono; use std::collections::{HashMap, VecDeque}; pub type Map = HashMap<String, GValue>; pub type List = Vec<GValue>; pub type Set = Vec<GValue>; pub type Date = ...
Python
UTF-8
9,237
2.5625
3
[]
no_license
import sys,os from optparse import OptionParser from subprocess import call,check_output usage=''' Compute and compare ratio with combine and C-P intervals. * python compare.py * python compare.py -n 3000 -d 5000 --muD='4500,5500' --rmin=0.55 --rmax=0.75 ''' parser=OptionParser(usage=usage) par...
JavaScript
UTF-8
402
2.734375
3
[]
no_license
var fs = require('fs') module.exports = function(directory, extension, callback) { var filteredList = new Array fs.readdir(directory, function(err, list) { if (err) { return callback(err) } for(var i = 0; i < list.length; i++) { if(list[i].indexOf('.' + extension) > 0) { filteredL...
Markdown
UTF-8
1,483
2.71875
3
[]
no_license
# Efeito Magnus Código para a matéria de Física Básica I (7600105) do curso de Ciências de Computação da USP São Carlos. O objetivo do código é dado uma velocidade, thetha e phi de chute, verificar se através do Efeito Magnus o jogador conseguiu acertar o gol. Além disso, plotar o chute. Observação: A acurâcia dos ...
C#
UTF-8
1,153
2.84375
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Underwater.VRHome { /// <summary> /// Manages all the items protected by the FailSafe script. /// </summary> public class FallSafeManager : MonoBehaviour { /// <summary> /// Height under which ...
Python
UTF-8
6,740
2.71875
3
[]
no_license
from flask import render_template, flash, redirect, url_for from app import app, db from app.forms import LoginForm, BasriForm, BasriForm2, RandommealForm, BasriDiceForm, BasriSuggestionsForm from app.models import Suggestion import lib.BasriFunctions as h import config as c import numpy as np import base64 from io imp...
Java
UTF-8
9,554
1.765625
2
[]
no_license
package com.ipmph.v.fragment; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; import android.content.Intent; import android.graphics.Bitmap; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import ...
C++
UTF-8
8,297
2.578125
3
[ "MIT" ]
permissive
/*------------------------------------------------------------------------------ LIDARLite Arduino Library v4LED/v4LED_fast This example shows how to take multiple distance measurements with a LIDAR-Lite v4 LED with a high rep rate using the optional GPIO pins or the I2C port to trigger measurements. ***...
Java
UTF-8
1,063
2.1875
2
[]
no_license
/** * */ package com.meikai.listener; import java.util.Map; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import com.meikai.util.PropertiesUtil; /** * 设值全局变量 * @author meikai * @version 2017年10月23日 下午2:15:19 */ public class Propertie...
Markdown
UTF-8
1,162
2.875
3
[]
no_license
Summary ======= In the end, this internship made me discover the world of research by working on a thesis project. This project, melange, taught me the basics of model engineering, an IT field I barely knew. Shoutout to Thomas Degueule for having spend a lot of time explaining me what a language is and how melange is...
Java
UHC
12,969
2.1875
2
[]
no_license
package sample; import java.text.DateFormat; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.concurrent.ConcurrentHashMap; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import annotation.Autowired; import annotation.Controller; import an...
PHP
UTF-8
1,167
2.625
3
[]
no_license
<?php function save_php_file($file,$arr,$content) { $f = fopen($file,"w"); fwrite($f,'<?php'."\n"); foreach ($content as $k => $v) { fwrite($f,"\t".'$'.$k.' = '); if ($v == 'string') fwrite($f,"'".addcslashes($arr[$k],"'")."'"); elseif ($v == 'bool') fwrite($f,$arr[$k]?'true':'false'); else fwrite($...
JavaScript
UTF-8
366
3.8125
4
[]
no_license
function weekendOrWorkingDay(arg) { let days = {'Monday': 1, 'Tuesday' : 1, 'Wednesday' : 1, 'Thursday' : 1, 'Friday' : 1, 'Saturday':2 ,'Sunday':2} if (days[arg] === 1) { console.log('Working day'); } else if( days[arg] === 2){ console.log('Weekend'); } else{ console.log('Error'); } } // weekendOrWorkin...
C++
UTF-8
1,754
2.96875
3
[]
no_license
// Module: BallBase.cpp // Author: Miguel Antonio Logarta // Date: February 28, 2020 // Purpose: Implementation file for base class BallBase // Responsible for drawing balls #include "CIS023_S2020_HW11 Miguel Antonio Logarta.h" void BallBase::Initialize(HWND hWnd) { // Make GDI graphic a random size of 20 to 5...
Java
UTF-8
1,026
2.40625
2
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
package com.dianping.phoenix.agent; import java.io.File; import org.apache.log4j.Logger; import org.mortbay.jetty.Server; import org.mortbay.jetty.webapp.WebAppContext; public class StandaloneServer { private final static Logger logger = Logger.getLogger(StandaloneServer.class); public static void main(String[] ...
Python
UTF-8
1,894
2.890625
3
[]
no_license
from types import TracebackType from typing import IO, AnyStr, Iterable, Iterator, Optional, Type import pyte class PyteStreamWrapper(IO): """ A simple wrapper around pyte's stream to be usable from blessed's terminal. """ FILE_NO = 999999 def __init__(self, stream: pyte.streams.Stream): ...
Java
UTF-8
26,084
1.757813
2
[]
no_license
package com.eostek.sciflyui.thememanager; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; import sci...
Java
UTF-8
14,578
2.25
2
[ "MIT" ]
permissive
/* *************************************************************************** * Mica - the Java(tm) Graphics Framework * *************************************************************************** * NOTICE: Permission to use, copy, and modify this software and its * * docum...
C++
UTF-8
559
2.53125
3
[ "MIT" ]
permissive
#ifndef MOUNTAIN #define MOUNTAIN #include "Entity/Tiles/Static/StaticTile.h" using namespace sf; class Mountain : public StaticTile { private: Vector2i type; //Get the correct type of a given mountain static Parts* getParts(const Vector2i& gridPos); protected: public: Mountain(Vector2f pos, Vector2i type); v...
Python
UTF-8
1,296
3.171875
3
[]
no_license
from functools import reduce def rev(arr, mov, pos): """ (0 1 2) 3 4, mov = 3, pos = 0 -> (2 1 0) 3 4 2 1) 0 (3 4, mov = 3, pos = 3 -> 4 3) 0 (1 2 """ r = list(arr) for i in range(mov): r[(pos + i) % len(arr)] = arr[(pos + mov - i - 1) % len(arr)] return r def tie(lenghts, ...
C++
UTF-8
1,180
3.421875
3
[]
no_license
#include <iostream> #include <map> #include <algorithm> #include <string> #include <iterator> #include <ranges> void printMap(const std::map <int, std::string, std::less<int>> &); int main(){ std::map <int, std::string, std::less<int>> mapCont{{10, "Chris"}, {11, "Melod"}, {-2, "mcMac"}, {-2, "mcNuts"}}; ...
C++
UTF-8
1,065
2.828125
3
[ "MIT" ]
permissive
// DP. O(N^2) time, O(N) space. class Solution { public: int f[502]; int minRefuelStops(int target, int startFuel, vector<vector<int>>& stations) { int n = stations.size(); if (n == 0) { if (startFuel >= target) return 0; else return -1; } if (...
Python
UTF-8
1,006
3.703125
4
[]
no_license
import random possible = ["rock", "paper", "scissors"] score = 0 computerScore = 0 while score < 11 and computerScore < 10: integer = random.randint(0,2) computer = possible[integer] humanPlayer = input("Pick rock, paper, or scissors: ") if humanPlayer not in possible: print("Invalid entry") elif humanP...
TypeScript
UTF-8
993
2.984375
3
[]
no_license
namespace net.user1.orbiter.snapshot { /** * The BannedListSnapshot class is used to load the server's current list of banned client * addresses. The list of banned addresses retrieved by BannedListSnapshot is a one-time * snapshot of the state of the server, and is not kept up to date after it is loaded. * To...
C++
UTF-8
1,003
3.015625
3
[ "MIT" ]
permissive
#include "memory.hpp" #include <memory> #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN #define BOOST_TEST_ALTERNATIVE_INIT_API #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_CASE(unique_ptr_construction_destruction) { auto lambda = [](int* pointer) { BOOST_CHECK_EQUAL(pointer, static_cast<int*>(0x0)); ...
Java
UTF-8
161
1.710938
2
[]
no_license
package com.garbagebinserver.allocator; public interface SolutionModel { public double computeCost(); public SolutionModel generateNeighboringSolution(); }
PHP
UTF-8
1,132
2.578125
3
[]
no_license
<?php /** * Created by PhpStorm. * 会费信息 * User: huiyong.yu * Date: 2018/5/21 * Time: 15:06 */ class DuesConfigModel{ private $filepath = 'dues_config'; private $fields = 'id, name, days, price, create_time, update_time, status '; public function ModelInfoById($id){ $dataval = array(); ...
JavaScript
UTF-8
303
2.96875
3
[]
no_license
function solve(arr1,arr2){ for(let i=0;i<arr1.length;i++){ for(let j=0;j<arr2.length;j++) { if(arr1[i]===arr2[j]){ console.log(arr1[i]) } } } } solve(['S', 'o', 'f', 't', 'U', 'n', 'i', ' '], ['s', 'o', 'c', 'i', 'a', 'l'] )
C
UTF-8
572
3.25
3
[]
no_license
/* Los calcetines de Ian Malcolm */ #include <stdio.h> int main() { char caracter; int numN, numG; while(1) { numN = 0, numG = 0; scanf("%c", &caracter); if(caracter == '.') break; if(caracter == 'N' || caracter == 'G') { while(1) { if(caracter == 'N') { numN++; } else if(caracter == 'G') { ...
JavaScript
UTF-8
40,275
2.5625
3
[]
no_license
"use strict"; // 二分查找 function binarySearch(vlss, vl) { var low = 0; var high = vlss.length - 1; while (low <= high) { var mid = (low + high) >> 1; if (vlss[mid][0] < vl) { low = mid + 1; } else if (vlss[mid][0] > vl) { high = mid - 1; } else { return mid; } ...