language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
Java
UTF-8
1,648
3.34375
3
[]
no_license
import java.util.Random; /** * Class implementing a bank account. * <p> * Complete and document this class as part of Lab 8. * * @see <a href="https://cs125.cs.illinois.edu/lab/8/">Lab 8 Description</a> */ public class BankAccount { /* * You may want to use this to distinguish between different kinds o...
JavaScript
UTF-8
763
3
3
[]
no_license
//ADD RECIPE //Get the modal elements var modal = document.getElementById('simplemodal'); //Get open modal button var modalBtn = document.getElementById('modalBtn'); //Get close modal butto var closeBtn = document.getElementsByClassName('closeBtn')[0]; //Listen for click modalBtn.addEventListener('click',open...
C++
UTF-8
1,824
3.203125
3
[]
no_license
/* * ===================================================================================== * * Filename: linkedstack.h * * Description: Linked stack * * Version: 1.0 * Created: 10/28/14 13:32:05 * Revision: none * Compiler: gcc * * Author: zhangyi * Organ...
C++
UTF-8
618
3.46875
3
[]
no_license
#include <vector> using namespace std; class ProductOfNumbers { private: vector<int> buf; public: ProductOfNumbers() { } void add(int num) { buf.emplace_back(num); } int getProduct(int k) { int result = 1; for (int i = buf.size()-1; k > 0; --i, --k) { ...
Shell
UTF-8
316
2.90625
3
[]
no_license
#!/bin/bash # external IP of remote vpn device REMOTE_OUTER=10.8.1.42 if [ $1 == tun0 ]; then ip rule delete to 172.16.0.1 table main ip rule delete to 172.16.0.0/16 table remote ip route del default via $REMOTE_OUTER dev tun0 table remote echo "REMOVED policy-based routing per /sbin/ifdown-local" >&2 fi
C++
UTF-8
381
2.71875
3
[]
no_license
/* * Deck.h * * Created on: Feb 28, 2019 * Author: trevt */ #ifndef DECK_H #define DECK_H #include"Cards.h" #include<iostream> #include<vector> using namespace std; class Deck { private: vector<Cards>deck; public: void addCard(Cards powerPlant); void shuffle(); string showDeck(); ...
Java
UTF-8
4,873
2.4375
2
[]
no_license
package Scenes; import Dao.*; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.stage.Stage; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import tables.*...
Markdown
UTF-8
3,047
3.65625
4
[]
no_license
# [139. 单词拆分](https://leetcode-cn.com/problems/word-break/) 给定一个非空字符串 s 和一个包含非空单词列表的字典 wordDict,判定 s 是否可以被空格拆分为一个或多个在字典中出现的单词。 说明: 拆分时可以重复使用字典中的单词。 你可以假设字典中没有重复的单词。 ```python 示例 1: 输入: s = "leetcode", wordDict = ["leet", "code"] 输出: true 解释: 返回 true 因为 "leetcode" 可以被拆分成 "leet code"。 示例 2: 输入: s =...
PHP
UTF-8
1,273
3.046875
3
[ "Apache-2.0" ]
permissive
<?php namespace cin\personalLib\utils; /** * Class HttpUtil http 工具 * @package cin\personalLib\utils */ class HttpUtil { /** * 发送post请求 * @param $url * @param $values * @return string */ public static function post($url, $values) { if (is_array($values) || is_object($value...
Java
UTF-8
663
2.671875
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Persistance; import Domaine.Armee; import Domaine.Visiteur; import Domaine.Joueur; import Domaine.Personne; /** * Committer ...
JavaScript
UTF-8
4,215
2.75
3
[]
no_license
import React, {useEffect, useState} from 'react'; import ProductCard from '../ProductCard/ProductCard'; import './Catalogo.css'; import {Row, Col, Spinner} from 'react-bootstrap'; const Catalogo = ({productos, loading, precio, condicion, currentPage, productsPerPage}) => { const [productosArenderizar, setProd...
Python
UTF-8
7,781
2.65625
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/python """ This script will use DEP Notify to systematically remove all apps based on the tags you set in the tagging script tied to this project """ # import modules from Foundation import NSMetadataQuery, NSPredicate, NSRunLoop, NSDate import sys from SystemConfiguration import SCDynamicStoreCopyConsole...
Python
UTF-8
1,071
3.234375
3
[]
no_license
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) class ServoMotor: def __init__(self, pin, freq): GPIO.setup(pin, GPIO.OUT) self.p = GPIO.PWM(pin, freq) def move(self, distance, speed): ## Move the motor a certain distance #self.p.start(x) #time.sl...
C++
UTF-8
3,206
2.65625
3
[]
no_license
#ifndef __PCIAddressTable #define __PCIAddressTable #include <vector> #include <string> #include <iostream> #include "hal/IllegalOperationException.hh" #include "hal/AddressTable.hh" #include "hal/AddressTableReader.hh" #include "hal/PCIHardwareAddress.hh" #include "hal/AddressSpace.hh" #include "hal/AddressOutOfLimi...
Python
UTF-8
8,829
2.609375
3
[]
no_license
import math import datetime import pysolar import time import threading import enum class Menus(enum.Enum): Home = 0 MoveSafe = 1 RunTime = 2 Setup = 3 DateSet = 4 TimeSet = 5 LattitudeSet = 6 LongitudeSet = 7 class MenuBase: def __init__(self, tracker): self.tracker = trac...
Java
UTF-8
243
2.265625
2
[]
no_license
package com.shelke.Hrishi; /** * Hello world! * */ public class App { public static void main( String[] args ) { Car car = new Car(); car.drive(); Bike x=new Bike(); x.ride(); } }
JavaScript
UTF-8
1,619
4.40625
4
[]
no_license
/* -Implict Binding */ var Person = function (name, age){ return { name: name, age: age, sayName: function (){ console.log(this.name); }, mother: { name:'Stacy', sayName: function (){ console.log(this.name); }...
C#
UTF-8
1,819
3
3
[]
no_license
using PizzaHut.Models.IRepositories; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace PizzaHut.Models.MockRepositories { public class MockUserRepository : IUserRepository { List<User> users; public MockUserRepository() { ...
Python
UTF-8
1,920
2.609375
3
[]
no_license
import json import math import numpy as np import pickle from matplotlib import pyplot as plt import os from utils import CalMu_Sigma def Gauss(x, Mu, Gx): return 1 / (np.sqrt(2 * math.pi) * np.sqrt(Gx)) * \ np.exp(-(x - Mu) * (x - Mu) / (2 * Gx)) if __name__ == '__main__': train_features = np.load...
Java
UTF-8
1,104
3.03125
3
[]
no_license
package bookstore.model; public class NF { private String client; private String book; private double amount; public NF(String client, String book, double amount) { this.client = client; this.book = book; this.amount = amount; } public boolean hasValidAmount() { ...
Java
UTF-8
2,122
2.578125
3
[]
no_license
package entities; import javax.persistence.*; import java.util.Date; /** * Created by maxbacinskiy on 23.01.17. */ @Entity @Table(name = "entities") public class User { @Id @GeneratedValue @Column(name = "id") private long id; @JoinColumn(name = "username", unique = true) private String userN...
Python
UTF-8
1,555
2.703125
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # In[1]: from keras.datasets import fashion_mnist from keras.utils import to_categorical from keras.models import Sequential from keras.layers import Conv2D from keras.layers import MaxPooling2D from keras.layers import Dense from keras.layers import Flatten # load dataset (trai...
C++
UTF-8
1,018
2.609375
3
[]
no_license
#pragma once #include "InfiniteObjectsManager.h" class Obstacles : public InfiniteObjectsManager<physx::PxRigidStatic> // gestiona los obstaculos { private: Vector3 lastPosition = { 0, 0, 0 }; // ultima posicion donde se coloco un obstaculo // posicion de los obstaculos const int minFromPlayer = 200; const int m...
Java
UTF-8
7,325
2.0625
2
[]
no_license
package com.video.aashi.kmdk.Members.activities.activitylist; public class ActResponse { private String IfDeleted; private String Description; private CreatedBy CreatedBy; private String ActivityName; private String ActivityDate; private String CreatedAt; private ActivityType Activity...
Java
UTF-8
126
1.65625
2
[]
no_license
package me.koenn.serverchat.api.util; public interface IConfigManager { String getString(String key, String... path); }
Go
UTF-8
2,943
2.59375
3
[ "Apache-2.0" ]
permissive
// Copyright 2015-2018 trivago N.V. // // 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 ...
TypeScript
UTF-8
1,391
2.703125
3
[]
no_license
import { createSelector } from "reselect"; import { RootState } from "../rootState"; import { TradesState } from "./trades.reducer"; import { Trade, TradeType, FormattedTrade } from "./trades.types"; import { userIdSelector } from "../user/user.selectors"; const tradesStateSelector = (state: RootState): TradesState =>...
C#
UTF-8
4,143
2.84375
3
[]
no_license
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Dynamic; using System.Runtime.Serialization; namespace Core { public class NodeRandom { Random _instance = new Random(); double? nextGaussian; public NodeRandom() {...
C#
UTF-8
545
2.71875
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace MoodAnalyser { public class CustomException : Exception { public enum ExceptionType { NULL_MESSAGE, EMPTY_MESSAGE, NO_SUCH_CLASS, NO_SUCH_METHOD, NO_SUCH_FIELD, OBJECT_CREATION_ISSUE ...
Python
UTF-8
5,351
2.640625
3
[ "Apache-2.0" ]
permissive
######################################################### # # Example of running a simple parallel model where the # sequential domain is partitioned and dumped as files # via sequential_dump and read in via parallel sequential_load # # Note: You can separate the sequential domain creation and dump # in one scri...
Ruby
UTF-8
549
3.90625
4
[]
no_license
class Dog attr_reader :bark, :howl def initialize(initial_bark, initial_howl) if initial_howl.is_a?(String) && initial_bark.is_a?(String) @bark = initial_bark @howl = initial_howl else puts 'invalid data type, forcing data type to string' @bark = initial_bark.to_s @howl = initi...
C++
UTF-8
931
2.609375
3
[ "MIT" ]
permissive
#include "SplashEffect.h" #include "Entities/EntityManager.h" namespace OpenLoco { // 0x004407E0 void Splash::update() { invalidateSprite(); frame += 0x55; if (frame >= 0x1C00) { EntityManager::freeEntity(this); } } // 0x00440C6B Splash* Spla...
C++
UTF-8
2,722
2.9375
3
[]
no_license
#include "stdafx.h" #include <iostream> #include <fstream> #include <vector> #include <set> using namespace std; set<char> FillAlphabet() { set<char> alphabet; alphabet.insert('\n'); alphabet.insert('\r'); alphabet.insert('!'); alphabet.insert('?'); alphabet.insert('.'); alphabet.insert(','); alphabet.insert...
Markdown
UTF-8
1,453
3.34375
3
[ "MIT" ]
permissive
# "Piece a' Pizza" An Exercise in Object-Oriented Javascript #### _Piece a' Pizza_, 01.27.2017 ### By _Sam Kirsch_ ## Description #### A website built as an exercise in object-oriented javascript, using objects and prototypes to allow the user to order a pizza and se the final cost. The user should be able to click...
Java
UTF-8
7,811
3.59375
4
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package practica.pkg7.streams; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import jav...
JavaScript
UTF-8
1,060
2.5625
3
[ "BSD-2-Clause" ]
permissive
import React, { Component, PropTypes } from 'react'; export default class Task extends Component { constructor(props) { super(props); } toggleTask(complete) { this.props.onTaskToggle(this.props.id, complete); } render() { let desc, complete; return ( <div className="task" > ...
JavaScript
UTF-8
703
2.65625
3
[]
no_license
const BASE_URL_API = 'http://127.0.0.1:8000/api/v1'; export const sendRequest = async (url, method, data) => { const response = await fetch(`${BASE_URL_API}${url}`, { method, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body:...
Java
UTF-8
543
2.828125
3
[]
no_license
package com.playtika.javacurse.cmd; public class CommandFactory { public Command getCommand(String input) { String[] str = input.split(" "); switch (str[0]) { case "chdir": return new ChangeDirCommand(str); case "ls": return new ListCommand();...
TypeScript
UTF-8
709
2.875
3
[]
no_license
import React, { ReactFragment, ReactNode } from "react"; //cada modelo coloca uma nova SectionRef export interface CarModel{ modelName: string overlayNode: ReactNode sectionRef: React.RefObject<HTMLElement> } //wrapperRef é uma referencia ao Wrapper //React.RefObject<HTMLElement> é uma referencia ao HTML ...
Python
UTF-8
499
3.90625
4
[]
no_license
amount_loan = float(input("How much did you borrow?")) interest_rate = float(input("Monthly interest rate?")) repayment_per_month = float(input("Monthly repayment?")) months_needed_to_repay = 0 while amount_loan > 0: interest_for_this_month = interest_rate/100 * amount_loan amount_loan += interest_for_this_mon...
Markdown
UTF-8
8,000
3.125
3
[]
no_license
[Kafka文件存储机制那些事](https://tech.meituan.com/kafka-fs-design-theory.html) Kafka是什么 Kafka是最初由Linkedin公司开发,是一个分布式、分区的、多副本的、多订阅者,基于zookeeper协调的分布式日志系统(也可以当做MQ系统),常见可以用于web/nginx日志、访问日志,消息服务等等,Linkedin于2010年贡献给了Apache基金会并成为顶级开源项目。 1.前言 一个商业化消息队列的性能好坏,其**文件存储机制**设计是衡量一个消息队列服务技术水平和最关键指标之一。 下面将从Kafka文件存储机制和物理结构角度,分析Kafka是如何实现...
Java
UTF-8
714
2.296875
2
[ "Apache-2.0" ]
permissive
package com.jolafa.storytrain.model; import java.util.Date; public class StoryContributor { private int storyId; private int authorId; private int entryNumber; private Date added; public int getStoryId() { return storyId; } public int getAuthorId() { return authorId; } public int getE...
Java
GB18030
2,092
3.609375
4
[]
no_license
package wenjing.LeetCode; /* * leetcode 38 facebook Ҫ count and say http://www.cnblogs.com/higerzhang/p/4050290.html ԼˣĿ˱˵ĽͲ Ժ;òô */ public class LeetCode38 { // public String countAndSay(int n) { // // String result = "1"; // String tempString = ""; // int numberShowCount; // ...
TypeScript
UTF-8
1,790
2.515625
3
[]
no_license
import { Component, OnInit } from '@angular/core'; import { DataService } from '../data.service'; import { ThrowStmt } from '@angular/compiler'; @Component({ selector: 'app-task', templateUrl: './task.component.html', styleUrls: ['./task.component.css'] }) export class TaskComponent implements OnInit { taskNam...
PHP
UTF-8
1,558
2.984375
3
[]
no_license
<?php namespace Yakotta; class Render { static public $templateDir = false; // Renders templates static public function template($template_name, $template_parameters=[]) { if(!is_array($template_parameters)) { $template_parameters = []; error_log("Template parameter...
Java
UTF-8
502
2.0625
2
[]
no_license
package com.dcdzsoft.dto.function; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; public class PADictionary implements java.io.Serializable { public int DictTypeID; public String DictTypeName = ""; public String DictID = ""; public String DictName = ""...
TypeScript
UTF-8
364
2.546875
3
[]
no_license
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'searchUser' }) export class SearchUserPipe implements PipeTransform { transform(users: any[], text: string): unknown { return text == '' ? users : users.filter(user => user.name.toLowerCase().includes(text.toLowerCase()) || user.email.toLower...
C#
UTF-8
675
3.1875
3
[]
no_license
using System; namespace HjælpJakob { internal class Program { public static void Main() { //Creating an object of send ass a single message Send sendMessage = new Send("Simone", "Kaj", "I suppose this is a very important message", "important!", "Julie"); ...
C#
UTF-8
359
3.421875
3
[]
no_license
using System; using System.Collections.Generic; class Dictionary { public static Dictionary<string, int> MultiplyBy2(Dictionary<string, int> myDict) { Dictionary<string, int> dic = new Dictionary<string, int>(); foreach (string val in myDict.Keys) dic[val] = myDict[val] ...
C#
UTF-8
1,799
3
3
[]
no_license
using Xenko.Core.Mathematics; using Xenko.Engine; using Xenko.Input; namespace CSharpBasics.Code { /// <summary> /// This script demonstrates how to check for keyboard input. /// </summary> public class KeyboardInput : SyncScript { public Entity blueTheapot; public Entity yellowThea...
C
UTF-8
301
2.71875
3
[]
no_license
#include <stdio.h> int main(void) { puts("Geeksfor"); puts("Geeks"); fputs("Geeksfor", stdout); fputs("Geeks", stdout); // % is intentionally put here to show side effects of using printf(str) //printf("Geek%sforGeek%s"); puts("Geek%sforGeek%s"); //getchar(); return 0; }
Java
UTF-8
1,068
1.859375
2
[]
no_license
package app.otavio.voteRestaurante.presentation; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import ...
Markdown
UTF-8
215
2.8125
3
[]
no_license
Arrays ====== *App Given two arrays, 1,2,3,4,5,8,10,21 and 2,3,1,0,21,4, 5 print which numbers are not present in the second array. *Pair Given an unsorted array of integers, find a pair with given sum to it
Java
UTF-8
1,239
3.640625
4
[]
no_license
package GarageExercise; import java.util.ArrayList; public class Garage { private ArrayList<Vehicle> vehicles = new ArrayList<Vehicle>(); public void addVehicle(Vehicle vehicle) { this.vehicles.add(vehicle); } public void removeVehicle(Vehicle v) { if (this.vehicles.remove(v)) { System.out.println(...
Markdown
UTF-8
1,999
2.890625
3
[]
no_license
## 2015-04-07 First project day Played around with ideas, decided on a game backed by the Bullet physics engine. A realtime 2D multiplayer game where you shoot down the opponents castle with your cannnon. Downloaded and built bullet with examples. Glanced at its architecture. Drew some game sketches. ## 2015-04-08 F...
Java
UTF-8
2,224
2.640625
3
[]
no_license
package tests.homework_solutions.lesson12.task3; import java.io.IOException; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import homework_solution.lesson12.task3.FileHelper; import homework_solution.lesson12.task3.proje...
Markdown
UTF-8
10,709
3.03125
3
[]
no_license
# Join Requests API ## Find Join Requests --- Returns json data about multiple join requests. - **URL** /join-requests - **Method:** `GET` - **Additional Headers** None - **URL Params** **Optional:** `userId: [positive-integer]` `postId: [positive-integer]` `roleId: [positive-integer]` - **...
Markdown
UTF-8
734
2.609375
3
[]
no_license
# ShopAware People who live comfortable lives are often disconnected from the conditions and realities of people living in third world countries. ShopAltruism aims to help online shoppers gain a better sense of how far their dollar actually goes, by replacing dollar prices with more meaningful metrics, such as 'hours ...
Java
UTF-8
674
2.015625
2
[]
no_license
package eu.paasword.rest.semanticauthorizationengine.transferobject; /** * * @author smantzouratos */ public class AuthorizationResponse { // Request Info that will be utilized to enrich the working memory (through the creation of IoCs and KTs ) private String requestid; private String advice;...
C
UTF-8
4,407
2.8125
3
[ "MIT" ]
permissive
/* @url https://github.com/onestraw/epoll-example * @details gcc epoll-echo-server-example.c -o epoll-echo-server-example * Attention: * To keep things simple, do not handle socket/bind/listen/.../epoll_create/epoll_wait API error */ #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <strin...
Java
UTF-8
260
2.5
2
[]
no_license
package com.bezditnyi.homework.lesson1.task2; /** * @author Viktor Bezditnyi */ public class TextContainer { private String text; public TextContainer(String text) { this.text = text; } public String getText() { return text; } }
Java
UTF-8
165
2.46875
2
[]
no_license
public class CheaterPlayerBehaviour implements PlayerBehaviour { @Override public Input getInput(Input inputOfOther) { return Input.CHEAT; } }
Java
UTF-8
8,486
3.078125
3
[]
no_license
package game; import java.util.LinkedList; import java.util.List; /** * Created by sabeehabanubhai on 2016/10/14. */ public class GameState { private GameStyle gameStyle; private BoardState theBoard; protected Player rabbitPlayer; protected Player foxPlayer; private Player activePlayer; pri...
Java
UTF-8
12,371
2.203125
2
[]
no_license
package com.xhl.service.impl; import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Service; import org.springframewor...
TypeScript
UTF-8
291
2.828125
3
[ "MIT" ]
permissive
/** * @function * @description Deep clone of anything. * @param {object} instance The thing instance you want to clone. * @param {number} deep The deep of function * @returns {object} A new cloned instance. */ export declare function clone<T>(instance: T, deep?: number): (T | any[]);
Java
UTF-8
3,748
1.734375
2
[]
no_license
package com.loplat.placeengine.service; import a.b.a.a.a.b; import android.app.job.JobInfo.Builder; import android.app.job.JobParameters; import android.app.job.JobScheduler; import android.app.job.JobService; import android.content.ComponentName; import android.content.Context; import android.os.Build.VERSION; import...
Java
UTF-8
63,810
1.898438
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2018-2023 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://aws.amazon.com/apache2.0 * * or in the "licen...
Java
UTF-8
1,962
2.265625
2
[]
no_license
package com.ankoki.elementals.spells.generic.travel; import com.ankoki.elementals.Elementals; import com.ankoki.elementals.api.GenericSpell; import com.ankoki.elementals.managers.ParticlesManager; import com.ankoki.elementals.managers.Spell; import com.ankoki.elementals.utils.Utils; import lombok.Getter; import lombok...
PHP
UTF-8
656
2.6875
3
[ "MIT" ]
permissive
<?php namespace App\Repositories\Dashboard; use App\Models\Subscription; /** * Subscription entity database query class. * * @author Volodymyr Zhonchuk */ class SubscriptionRepository { /** * Fetch all subscriptions from the database. * * @return \App\Subscription[] */ public static f...
C#
UTF-8
1,334
3.40625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; class Program { static void Main() { int lines = int.Parse(Console.ReadLine()); int[][] field = new int[lines][]; bool[][] visited = new bool[lines][]; for (int i = 0; i < lines; i++) ...
Java
UTF-8
5,669
1.921875
2
[]
no_license
package qerlly.cocktailboost.activities; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteException; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGri...
SQL
UTF-8
227
2.609375
3
[]
no_license
CREATE TABLE IF NOT EXISTS "aggregatedParticleScore" ( "simId" bigint NOT NULL REFERENCES simulations, particle varchar(10) NOT NULL, network int NOT NULL, "USum" float NOT NULL, PRIMARY KEY ("simId", particle, network) )
Python
UTF-8
2,038
2.6875
3
[]
no_license
""" A set of functions for retrieving previous instant message conversations. All functions return an interable whose items are tuples in the form of: (date/time,screenname,message) """ import os,re from datetime import datetime recordre=re.compile(r'^\((\d\d?\:\d\d\:\d\d(\s+[A|P]M)?)\)\s+(.*?)\:\s+(.*)\s*$', re.I|re...
C
UTF-8
2,522
2.703125
3
[]
no_license
/*************************************************************************** *** Fraunhofer IPA *** Robotersysteme *** Projekt: 3D cartography demonstrator **************************************************************************** **************************************************************************** *** ...
Markdown
UTF-8
1,117
2.890625
3
[]
no_license
# SigSysFinal The question I sought to answer for my Signals&amp;Systems Final project is if there's a noticeable auditory response of birds when they hear music. I took many audio recordings of birds in a local forest; I describe this process in my final paper, located in this repository. Then I analyzed the recordin...
Python
UTF-8
1,101
3.390625
3
[]
no_license
def PodzialRGF(n, k, B): F = [] for i in range(0, n + 1): F.append(0) for i in range (0, k+1): for j in B[i]: F[j] = i return F n = [] print("Podaj podzbiory w postaci '{x, y}{z}' tzn. rozdzielając podzbiory nawiasami klamrowymi, a elementy podzbiorów przecinkiem") n = in...
Java
UTF-8
2,354
2.34375
2
[]
no_license
package bln.fin.common; import bln.fin.entity.interfaces.Monitored; import bln.fin.entity.pi.SessionMessage; import bln.fin.ws.server.MessageDto; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; import java.util.List; public class Util { public static Loc...
Python
UTF-8
902
2.546875
3
[ "MIT" ]
permissive
import unittest from charset_normalizer.cli.normalizer import cli_detect class TestCommandLineInterface(unittest.TestCase): def test_single_file(self): self.assertEqual( 0, cli_detect( ['./data/sample.1.ar.srt'] ) ) def test...
Java
UTF-8
677
2.078125
2
[]
no_license
package com.pope.contract.dao.system; import java.util.List; import org.apache.ibatis.annotations.Param; import com.pope.contract.entity.system.Role; public interface RoleMapper { int deleteByPrimaryKey(String wid); int insert(Role record); int insertSelective(Role record); Role se...
Swift
UTF-8
2,898
2.546875
3
[]
no_license
// // UserCommunicator.swift // SimpleDemoAppCycle // // Created by Ky Nguyen on 8/6/16. // Copyright © 2016 phuot. All rights reserved. // import UIKit struct UserCommunicator { static func getUsers(success: (users: [User]) -> Void, fail: (message: String) -> Void) { let url = "users" ...
Java
UTF-8
1,097
2.03125
2
[]
no_license
package ch.eugster.events.zipcode.handlers; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.IHandler; import org.eclipse.core.expressions.EvaluationContext; import org.eclipse...
Python
UTF-8
373
2.84375
3
[]
no_license
class Solution(object): def numWaterBottles(self, numBottles, numExchange): """ :type numBottles: int :type numExchange: int :rtype: int """ res = numBottles while numBottles >= numExchange: a, b = divmod(numBottles, numExchange) res +=...
Markdown
UTF-8
1,112
3.328125
3
[]
no_license
# python_homework ## PyBank For this assignment we were asked to read a csv file into Python and run an analysis on it. In doing so, we not only had to read the different elements of the data, which was simply the profit or loss for a bank from month to month, into lists but also had to iterate through the data to fi...
Java
UTF-8
904
2.609375
3
[]
no_license
package com.example.intentparameter; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.EditText; public class SecondScreen extends AppCompatActivity { //Declaración de controladores EditText inputName; EditText inputAge; @Override protected void onCr...
Java
UTF-8
4,041
1.609375
2
[]
no_license
/** * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved. */ package com.thinkgem.jeesite.modules.mtinvest.web; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.shiro.authz.annotation.RequiresPermissi...
Python
UTF-8
4,087
2.671875
3
[]
no_license
import crystalStructures.coordinateSet as cs import crystalStructures.clustering.clusterHandler as ch import crystalStructures.featureVector as fv import os import numpy as np import matplotlib.pyplot as plt def parseData(): # IF LOCATION OF DATA CHANGES, THIS MUST BE CHANGED path = '../grendelResults/335820....
JavaScript
UTF-8
285
2.984375
3
[]
no_license
var increasingTriplet = function (nums) { if (nums.length < 3) return false; for (let i = 2; i < nums.length; i++) { let first = nums[i - 2]; let second = nums[i - 1]; let third = nums[i]; if (first < second && second < third) return true; } return false; };
Go
UTF-8
1,398
2.703125
3
[ "Apache-2.0" ]
permissive
package backends import ( "context" "crypto/tls" "strconv" "time" "github.com/go-redis/redis" "github.com/prebid/prebid-cache/config" log "github.com/sirupsen/logrus" ) type Redis struct { cfg config.Redis client *redis.Client } func NewRedisBackend(cfg config.Redis) *Redis { constr := cfg.Host + ":" +...
C
UTF-8
773
3.390625
3
[ "MIT" ]
permissive
/* ============================================================================ Name : project1.c Author : ayman Version : Copyright : Your copyright notice Description : Hello World in C, Ansi-style ============================================================================ */ #include <std...
Swift
UTF-8
1,010
2.71875
3
[ "MIT" ]
permissive
import MixboxIpc // Usage: // // let port = handshaker.start() // // launch_child_process_that_will_send_handshake_back(port) // // let client = handshaker.waitForHandshake() // // use_your_client(client) // public final class Handshaker { public let server = BuiltinIpcServer() private var client: IpcClient? ...
TypeScript
UTF-8
529
2.875
3
[ "MIT" ]
permissive
declare interface Result { [version: string]: { [package: string]: string } } /** * Get the globally installed packages for any nvm-selectable version. * @param version The version to get the globally installed packages for. * @example * ``` * const nvmGlobalInstalls = require("nvm-global-installs...
Python
UTF-8
646
2.78125
3
[ "Apache-2.0" ]
permissive
import torch as th def src_dot_dst(src_field, dst_field, out_field): """ This function serves as a surrogate for `src_dot_dst` built-in apply_edge function. """ def func(edges): return { out_field: (edges.src[src_field] * edges.dst[dst_field]).sum( -1, keepdim=True...
Java
UTF-8
867
2.96875
3
[]
no_license
package be.projecttycoon.model.ScoreEngine.util; /** * Created by Jeroen on 19-2-2016. */ public class Between { private int from; private int to; private int score; public Between(int from, int to, int score) { this.from = from; this.to = to; this.score = score; } p...
Python
UTF-8
13,200
2.765625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Fri Sep 11 16:57:37 2020 @author: Wang yidi """ import numpy as np import pandas as pd import os hangye=pd.read_csv('股票所属行业.csv') result=[] for i in hangye['stock_id'].values: result.append('C{}'.format(i.split('.')[0])) hangye['stock_id']=result hangye=hangy...
Python
UTF-8
1,318
2.71875
3
[]
no_license
from google.cloud import language_v1 def analyze(input_text): client = language_v1.LanguageServiceClient() document = language_v1.Document(content=input_text, type_=language_v1.Document.Type.PLAIN_TEXT) annotations = client.analyze_sentiment(request={'document': document}) score = annotations.documen...
Python
UTF-8
302
3.0625
3
[]
no_license
class node: def __init__(self, value = None) self.value = value self.left_chile = None self.right_child = None class binary_serach_tree: def __init__(self) self.root = None def insert(self, value) if self.root == None self.root = value
C#
UTF-8
559
2.609375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace V2 { // The training class doesnt need the weight and OS properties, this introduces tight coupling public class Training : IProduct { public int Price { get; set; } ...
Java
UTF-8
997
3.359375
3
[]
no_license
package lec19.v7; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Playlist extends java.util.Observable { private List<Song> songs; public Playlist() { songs = new ArrayList<Song>(); } public int getSize() { return songs.size(); } public Song[] getSongs()...
Python
UTF-8
2,586
2.8125
3
[]
no_license
""" @author: Payam Dibaeinia """ import torch import torch.nn as nn from collections import OrderedDict class CNN(nn.Module): def __init__(self): super(CNN,self).__init__() self.conv = self._conv_layers() self.fc = self._fc_layers() def _conv_layers(self): ret = nn.Sequenti...
Python
UTF-8
1,708
3.46875
3
[]
no_license
from tkinter import * import pygame import random music = ["song1.mp3", "song2.mp3"] # 注意!这里面是你下载在文件夹里的音乐文件名称。 i = 0 root = Tk() root.title("音乐播放器") def play(): file = music[i] pygame.mixer.init() pygame.mixer.music.load(file) # 加载本地文件 pygame.mixer.music.play() # 播放音乐 print(i) def stop():...