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
TypeScript
UTF-8
2,701
2.515625
3
[]
no_license
const clusterMaker = require("clusters"); const hash = require("object-hash"); import { ICluster } from "./cluster"; import {extractUserFeatures} from "./dataTransformers/extractUserFeatures"; import { getDistance } from "./getDistance"; import { IDriver } from "./models/driver"; import { IRequest } from "./models/requ...
Java
UTF-8
992
2.09375
2
[]
no_license
package bananaplan.controller; import bananaplan.domain.request.CaseRequest; import bananaplan.service.CaseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * Created by paulou on 10/5/15. * All rights are reserved by BPT */ @RestControll...
Markdown
UTF-8
738
3.015625
3
[]
no_license
# Dummy example with grpc This project has to purpose for learning how to implement grpc (in a bad way maybe?), ### How to run You need to install dependencies with `npm i` Then you need to run the "microservice" that sum numbers with: `node src/server/sum.js` And run the "microservice" that subtracts numbers with...
Java
UTF-8
1,233
2.25
2
[]
no_license
package com.phihung.springmvc.service; import java.util.List; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.phihung.springmvc.dao.CourseDao; import com.phihung.springmvc.entities.Course; import com.phi...
Swift
UTF-8
21,172
2.84375
3
[]
no_license
// // Bluetooth.swift // BluetoothTestDemo // // Created by Myron on 2017/10/19. // Copyright © 2017年 Myron. All rights reserved. // import Foundation import CoreBluetooth // MARK: - 基类 class Bluetooth: NSObject { /** 外设服务 */ var services: [String: CBService] = [:] /** 外设字符 */ var chara...
C++
UTF-8
4,191
2.671875
3
[ "MIT" ]
permissive
#include "opencv2/core/core.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include <iostream> #include <cmath> using namespace std; using namespace cv; int main() { string imgname = "lena.png"; int arr[256] = { 0 }; Mat original = imread(imgname, CV_LOAD_IMAGE_GRAYSCALE); Ma...
C
UTF-8
714
4.03125
4
[]
no_license
#include "lists.h" /** *check_cycle - Checks if the single linkedlist contains a cycle. *@list: pointer to the head of the list. *Return: 0 if there is no loop. Otherwise 1 */ int check_cycle(listint_t *list) { /*we will use the algorithm turtle and rabbit*/ listint_t *turtle; listint_t *rabbit; turtle = list...
PHP
UTF-8
5,984
2.828125
3
[]
no_license
<?php function testDescr($d) { return (strlen(trim($d))>2); } function testNum($id0) { $id0 = trim($id0); $strl=strlen($id0); $ctr = 0; for ($i=0; $i<$strl; $i++) { $c=substr($id0,$i,1); $ctr+=($c>="0" && $c<="9"); } return (($strl>0) && ($ctr==strlen($id0) ) ); } function testId(...
C
UTF-8
1,408
3.046875
3
[]
no_license
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdint.h> #include <stdbool.h> #include <unistd.h> // getpagesize #include <assert.h> #include "common.h" #include "shm.h" #define FILENAME "/mnt/hugetlbfs/test_mem_alloc" #define MM_SIZE (256UL*1024*1024) void write_data(mem_allocator* allocator) ...
Markdown
UTF-8
2,238
3.4375
3
[]
no_license
# 436. Find Right Interval ## My submission ```java /** * Definition for an interval. * public class Interval { * int start; * int end; * Interval() { start = 0; end = 0; } * Interval(int s, int e) { start = s; end = e; } * } */ public class Solution { public int[] findRightInterval(In...
Java
UTF-8
7,069
2.921875
3
[]
no_license
import java.lang.ref.SoftReference; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List...
C++
UTF-8
1,421
2.9375
3
[]
no_license
#include <reader.hpp> #define NUM_LINES 1000 std::vector<workItem> createWorkItems(std::vector<std::string> lines) { std::vector<workItem> lineWorkItems; for(std::vector<std::string>::iterator it = lines.begin(); it != lines.end(); ++it) { std::istringstream iss(*it); do { std::string subs; iss >> sub...
Ruby
UTF-8
441
3.109375
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
def new_hash this_hash = Hash.new end def my_hash that_hash = { green: "hair" } end def pioneer grace_hash = { name: 'Grace Hopper' } end def id_generator id_hash = { id: 6 } end def my_hash_creator(key, value) created_hash = { key => value } end def read_from_hash(hash, key) ha...
C++
UTF-8
1,381
2.59375
3
[]
no_license
#include "doortile.hpp" #include "engine.hpp" DoorTile::DoorTile(SDL_Renderer* renderer, const std::string& filePath, int size, int x, int y) { script.doFile("assets/scripts/doortile.lua").openLibs(); script.push(x).setGlobal("posX"); script.push(y).setGlobal("posY"); posX = x; posY = y; source.x = 0; source.y...
Java
UTF-8
7,650
1.929688
2
[ "Apache-2.0" ]
permissive
package com.github.zuihou.admin.rest.authority; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.github.zuihou.admin.entity.authority.po.AdminRole; import com.github.zuihou.admin.repository.authority.example.AdminRoleExample; import com.github.zuihou.admin.repository.authority...
Python
UTF-8
183
3.71875
4
[]
no_license
''' Write a program to print the first 14 odd numbers starting from 3 Output: 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ''' a = 14 odd = 3 for i in range(1,a+1): print(odd) odd+=2
PHP
UTF-8
3,279
2.796875
3
[]
no_license
<?php //include kan koneksi ke database disini include "config.php"; //jika form pencarian mengandung isi maka akan di proses if ((isset($_POST['submit'])) AND ($_POST['search'] <> "")) { //menerima dan membaca data yang di terima via form metode POST $search = $_POST['search']; //memilih table ke satu dari ...
Java
UTF-8
801
2.109375
2
[]
no_license
package com.qpf.manage.web.controller; import com.qpf.manage.entity.User; import com.qpf.manage.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web...
Java
UTF-8
8,529
2.0625
2
[ "Apache-2.0", "LicenseRef-scancode-gutenberg-2020", "CC0-1.0", "BSD-3-Clause" ]
permissive
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
Java
UTF-8
969
3.3125
3
[]
no_license
package model; import javafx.scene.image.Image; /** * This class is responsible for setting the parameters of the model Long_truck and display of the model Long_truck. * @author Wang * */ public class Long_truck extends Obstacle { /** * This method is to set the parameters. * @param x indicate x-axis posit...
Python
UTF-8
211
3.140625
3
[]
no_license
def fib(n): if n == 1: return [0] elif n == 2: return [0,1] else: lista = [0,1] while len(lista) != n: lista.append(lista[-2] + lista[-1]) return lista
Markdown
UTF-8
1,904
3.234375
3
[]
no_license
# Deliveries: An Overview >[Deliveries](../appendix/glossary.md#delivery) provide the means of publishing and administering [Tests](../appendix/glossary.md#test). These govern when a test is taken, by whom, and how long it is. This section provides an overview of how to manage your deliveries, including what you ne...
Java
UTF-8
236
1.867188
2
[]
no_license
package org.library.services; import org.library.models.User; import org.springframework.security.core.userdetails.UserDetailsService; public interface UserService extends UserDetailsService { User createUser(User userDetails); }
C++
UTF-8
3,015
2.6875
3
[]
no_license
// BEGIN CUT HERE /* */ // END CUT HERE #line 7 "PalindromeEncoding.cpp" #include <cstdlib> #include <cctype> #include <cstring> #include <cstdio> #include <cmath> #include <algorithm> #include <vector> #include <string> ...
JavaScript
UTF-8
1,006
2.578125
3
[]
no_license
const express = require('express'); // We require and instantiate an Express Router to define the path to our resources const router = express.Router(); // We require the model const resources = require('./../resources/model'); // Create a new route for a GET request on all sensors and attach a callback function rou...
Markdown
UTF-8
1,034
2.984375
3
[]
no_license
# Sort People List Using standard java libraries to implement `sort` method. ```java static List<Person> sort(Iterable<Person> people, String sortField, String ascending) { //TODO: implement sort } class Person{ String ssn; Date dateOfBirth; String firstName; String lastName; Double heightIn; Doubl...
C
UTF-8
2,445
2.84375
3
[]
no_license
#include<stdio.h> #include<stdlib.h> #include<math.h> #define temperature 0.5 #define InitialMagnetization 1.0 double RightHandSide(double mag,double c); double factorial(int k); int main(void){ int i,j,k; double mag; double k1,k2,k3,k4; double h,a,b,n; double time; doub...
Python
UTF-8
2,907
2.75
3
[]
no_license
import sys import math as m import numpy as np num_pins = 150 circle_diam = 180 inner_radius = (circle_diam-4) / 2 outer_radius = (circle_diam+4) / 2 length = 220 angle_step = np.radians(360 / num_pins) center = length / 2 volume = (length, length, 250) travel_z = 10 push_down_z = 3 def main(): pin_sequence = read...
C++
UTF-8
2,140
3.265625
3
[]
no_license
#include <iostream> #include <random> #include <algorithm> #include <functional> #include <vector> using namespace std; int getRandomInteger(){ std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_distribution<> dst(10, 100); return dst( gen ); } void generate_random_seq( vector<int> &arr ){ io...
C
UTF-8
2,187
2.609375
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* check_color5.c :+: :+: :+: ...
JavaScript
UTF-8
558
2.9375
3
[]
no_license
var input = require('../lib/console').getConsole(process); input.on('get',function(data) { var score = parseFloat(data); if ( score >= 90 && score <= 100 ) { console.log('A'); } else if ( score >= 80 && score <= 89.99 ) { console.log('B'); } else if ( score >= 70 && score <= 79.99 ) { console.log('C'); }...
Java
UTF-8
4,280
3.1875
3
[]
no_license
package nicolay.wk1; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.List; import java.util.Scanner; public class Main { /** * Main method to handle user input and run ...
JavaScript
UTF-8
3,239
2.984375
3
[]
no_license
var BBGrade = class BBGrade{ constructor(date, grade, type, name){ this.date = date; this.type = type; this.name = name; var splitScore = grade.split("/"); var gotten; var outOf; if(splitScore[0] == "" || splitScore[0] == "Excluded"){ gotten = 0; outOf = 0; } else if(splitScore[0]...
Java
UTF-8
22,978
2.53125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
package ca.cgjennings.apps.arkham.deck; import ca.cgjennings.apps.arkham.BusyDialog; import ca.cgjennings.apps.arkham.StrangeEons; import ca.cgjennings.apps.arkham.dialog.ErrorDialog; import ca.cgjennings.apps.arkham.plugins.BundleInstaller; import java.awt.Color; import java.awt.Graphics2D; import java.awt.RenderingH...
C
UTF-8
42,568
3.265625
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> typedef struct ARRAY { //structure for entering the table and working with it char*** rows; //variable for storing cells int** cells; //variable for the number of cells in a ro...
PHP
UTF-8
702
2.515625
3
[ "MIT" ]
permissive
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Cart extends Model { use HasFactory, SoftDeletes; public $timestamps = true; protected $fillable = [ 'customer_id', ...
C#
UTF-8
1,458
2.84375
3
[ "BSD-3-Clause", "MIT" ]
permissive
using System.ComponentModel; using System.Xml.Serialization; namespace Mercurial.XmlSerializationTypes { /// <summary> /// This class encapsulates a &lt;copy...&gt; node in the log output. /// </summary> [XmlType("copy")] [EditorBrowsable(EditorBrowsableState.Never)] public class LogE...
Markdown
UTF-8
2,245
3.890625
4
[]
no_license
### Introduction This second programming assignment is an R function that is able to cache potentially time-consuming computations. For example, taking the inverse of a numeric matrix is typically a fast operation. However, for a very long matrix, it may take too long to compute the inverse, especially if it has to be...
Java
UTF-8
2,763
2.296875
2
[]
no_license
package thebetweenlands.manual.widgets; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import thebetweenlands.herblore.aspects.Aspect; import thebetweenlands.herblore.aspects.AspectManager; import thebetweenlands...
C++
WINDOWS-1252
7,078
2.875
3
[]
no_license
// sherlock-game.cpp : Defines the entry point for the console application. // This is the console executable, that make use of the class fSherlock. // It is responsible for all user interaction: for game logic, please see the fSherlock class. #include "stdafx.h" // to comply with Unreal coding standards using FText ...
C
UTF-8
1,600
4.125
4
[]
no_license
#include<stdio.h> #include<stdlib.h> struct node { int value; struct node *next,*prev; }; struct node *head,*tail; //en-queue th value void enqueue(int value) { struct node *newnode; newnode=(struct node *)malloc(sizeof(struct node)); newnode->value=value; newnode->next=NULL; newnode->prev=NULL; if(!he...
Python
UTF-8
11,228
2.703125
3
[ "BSD-3-Clause" ]
permissive
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 29 17:34:01 2018 @author: mauro """ from silx.gui import qt from sloth.gui.models.datanode import DataNode class DataModel(qt.QAbstractItemModel): sortRole = qt.Qt.UserRole filterRole = qt.Qt.UserRole + 1 """INPUTS: Node, QObject""" ...
Java
UTF-8
4,922
2.03125
2
[ "CC0-1.0" ]
permissive
package com.intro.client.render.drawables; import com.google.common.collect.Ordering; import com.intro.client.OsmiumClient; import com.intro.client.render.RenderManager; import com.intro.client.render.color.Colors; import com.intro.client.util.ElementPosition; import com.intro.common.config.Options; import com.intro.c...
Markdown
UTF-8
631
3.734375
4
[]
no_license
**coordinate matrix** # Chapter 7 ||v|| = sqrt(v1^2 + v2^2 ..) //length of a vector Every vector in a standard basis for R^n has a unit vector that has length 1 {i,j} = {(1,0),(0,1)} vectors `u` and `v` are parallel if `u = cv` - if c > 0 then same direction if c < 0 then opposite if v is a nonzero vector...
Python
UTF-8
280
3.84375
4
[]
no_license
def cube_c(x): return 12 * x def cube_a(x): return 6 * x ** 2 def cube_v(x): return x ** 3 x = int(input('enter the distance of the edge:')) print(f" the edge {x}, circumference of the cube {cube_c(x)}, area of the cube {cube_a(x)}, volume of the cube {cube_v(x)} ")
Java
UTF-8
3,110
2.234375
2
[ "MIT" ]
permissive
package com.resms.ssm.meta.mybatis.domain; import com.resms.ssm.common.AbstractDomain; import java.io.Serializable; import javax.annotation.Generated; /** * * table t_role * * @date 2020-02-19 01:28:25 */ public class Role extends AbstractDomain implements Serializable { @Generated(value="org.mybatis.genera...
C
UTF-8
3,812
3.265625
3
[]
no_license
/* * ---------------- www.spacesimulator.net -------------- * ---- Space simulators and 3d engine tutorials ---- * * Author: Damiano Vitulli * * This program is released under the BSD licence * By using this program you agree to licence terms on spacesimulator.net copyright page * * * Tutorial 4: 3d engine ...
Java
UTF-8
2,289
2.359375
2
[]
no_license
package com.DAO; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.Query; import javax.persistence.TypedQuery; import org.hibernate.Session; import com.entity.Favorite; import com.entity.FavoriteReport; import com.entity.FavoriteUserReport; import com.entity.User; import com.en...
Markdown
UTF-8
6,437
3.171875
3
[]
no_license
# 1 网络编程 ## 1.1 概述 - java是Internet上的语言,它从语言级上提供了对网络应用程序的支持,程序员能够很容易开发常见的网络应用程序 - java提供的网络类库,可以实现无痛的网络连接,联网的底层细节被隐藏在java的本机安装系统里,由JVM进行控制,并且java实现了跨平台的网络库,程序员面对的是一个统一的网络编程环境。 - 计算机网络:把分布在不同地理区域的计算机与专门的外部设备通信线路互连成一个规模大、功能强的网络系统,从面使众多的计算机可以方便地互相传递信息、共享硬件、软件、数据信息等资源。 - 网络编程的目的:直接或间接地通过网络协议与其它计算机进行通讯。 - 网络编程中的两个主要问题:...
C++
UTF-8
849
2.84375
3
[]
no_license
#pragma once #include "Image.h" struct itemMap { std::vector<Image*> vecImage; int x; int y; itemMap():x(0),y(0) { data(); } void data(void) { vecImage.reserve(1); Image* img = new Image; vecImage.push_back(img); } void load(sf::String filename) { Image* img = new Image; img->load(filename); i...
Python
UTF-8
3,303
2.921875
3
[ "MIT" ]
permissive
# -*- coding: utf8 -*- from __future__ import unicode_literals class ModelException(Exception): pass class Service(object): """ Base class of any service, provide some abstraction of common functions """ def __init__(self, connection, tableName): super(Service, self).__init_...
Ruby
UTF-8
3,432
2.90625
3
[]
no_license
module News def News.fetch_news(slack_response) case slack_response[0] when 'hacker-news' resp = News.get_json("https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty") resp = resp[0..9] message = "Here are the top 10 HN stories: \n" resp.each do |story_id|...
Markdown
UTF-8
39,723
4.3125
4
[]
no_license
**What exactly is a block of code?** * Syntactically, a block of code is a set of statements, which could be one statement,or as many as you like, grouped togetherbetween curly braces. * Once you’ve got a block of code, all the statements in that block are treated as a group to be executed together. * For instance, ...
Markdown
UTF-8
4,495
2.53125
3
[ "MIT" ]
permissive
# Summary ![This Shrine is very fancy](https://github.com/MoyTW/MTW_AncestorSpirits/blob/master/About/Preview.png) You Ancestors are watching you, and they are hard to impress. To ignore them would be foolish, though - they're the foundation of your tribal magic, and if they're displeased are more than capable of cal...
Java
UTF-8
2,919
2.796875
3
[ "MIT" ]
permissive
package org.shapelogic.scripting; import java.util.Map; import java.util.TreeMap; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; /** ScriptEngineFactory get ScriptEngine by name. * <br /> * Create script and evaluate. * * @author Sami Badawi * */ public class ScriptEngineCache { p...
Java
UTF-8
646
2.1875
2
[]
no_license
package com.ibm.watson.developer_cloud.natural_language_classifier.v1.model; import com.google.gson.annotations.SerializedName; import com.ibm.watson.developer_cloud.service.model.GenericModel; public class ClassifiedClass extends GenericModel { private Double confidence; @SerializedName("class_name") pri...
Python
UTF-8
140
3.09375
3
[]
no_license
#!/usr/bin/python3 x = 0 for i in range(ord('z'), ord('a') - 1, -1): print("{}".format(chr(i - x)), end="") x = 32 if x == 0 else 0
C++
UTF-8
427
2.859375
3
[]
no_license
// kth smallest element in c++ #include <bits/stdc++.h> using namespace std ; int main(){ int n ; cin>>n; int k; cin>> k ; priority_queue<int> p ; for(int i= 0 ;i<n;i++){ int n ; cin>>n; p.push(n); if(p.size()>k) { p...
JavaScript
UTF-8
4,676
2.953125
3
[]
no_license
var canvas = document.getElementById("GameScreen"); var ctx = canvas.getContext("2d"); var pellet_hdl = new Image() pellet_hdl.src = "pellet.png" var pac_hdl = new Image() pac_hdl.src = "capman.png" var rgho_hdl = new Image() rgho_hdl.src = "RedGhost.png" var bgho_hdl = new Image() bgho_hdl.src = "BlueGhost.png" va...
C++
UTF-8
517
2.5625
3
[]
no_license
#include <iostream> #include "global.h" #include "Problem.h" #include "Search.h" #include "FileUtil.h" /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { vector<string> fileStr; FileUtil file; fileStr = file.loadFile("input.txt"); ...
C#
UTF-8
647
3.09375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HackathonMFClever { public class Way { public string Address; public uint Time;//время в пути в минутах public uint Distance; public Way(...
PHP
UTF-8
2,037
2.5625
3
[]
no_license
<?php /** * Created by PhpStorm. * User: EZ * Date: 2020/4/2 * Time: 21:16 */ namespace EasySwoole\WeChat\Bean\OfficialAccount\ServiceMessage; use EasySwoole\Spl\SplArray; use EasySwoole\WeChat\Bean\OfficialAccount\RequestConst; class Video extends RequestedReplyMsg { protected $video = []; protected...
Python
UTF-8
565
2.625
3
[]
no_license
import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import tensorflow as tf import pandas as pd import xlrd DATA_FILE = 'data/USA_Housing.xls' # Step 1: read in data from the .xls file book = xlrd.open_workbook(DATA_FILE, encoding_override="utf-8") sheet = book.sheet_b...
Ruby
UTF-8
7,333
2.578125
3
[]
no_license
# frozen_string_literal: true module PushKit module APNS # The PushClient class provides an interface for delivering push notifications using HTTP/2. # class PushClient # @return [Hash] The default hosts for each of the environments supported by APNS. # HOSTS = { production: 'ap...
Java
UTF-8
3,035
2.421875
2
[]
no_license
package ru.zvezdov.webApp.controllers; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.*; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; impor...
Markdown
UTF-8
1,295
3.671875
4
[]
no_license
# jen jen is an extension to jQuery which adds a family of functions to generate html from objects #### The object spec: * tag - the name of the tag, i.e. div. * children - objects which represent child nodes which will also be jenned. - can be an object or an array of objects * on_* - an event handler to be register...
Java
UTF-8
283
2.046875
2
[]
no_license
package project.demo.model; import lombok.Data; @Data public class AuthenticationResponse { private final String jwt; private String isAdmin; public AuthenticationResponse(String jwt, String isAdmin){ this.jwt = jwt; this.isAdmin = isAdmin; } }
Java
UTF-8
3,694
1.828125
2
[ "Apache-2.0" ]
permissive
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.daemon.impl; import com.intellij.openapi.editor.RangeMarker; import com.intellij.openapi.util.NlsSafe; import com.intellij.openapi.util.Pair; import com.intellij.op...
Java
UTF-8
1,432
2.71875
3
[]
no_license
import instruments.Piano; import instruments.Saxophone; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; public class TestSaxophone { Saxophone saxophone; @Before public void before() { saxophone = new Saxophone("Mendini", "Wood", "Gold", "Brass", 99.9...
PHP
UTF-8
2,833
2.609375
3
[]
no_license
<?php class clientepotencial extends EntidadBase { private $cp_nit; private $cp_nombre; private $cp_ciudad; private $cp_direccion; private $cp_telefono; private $cp_observaciones; public function __construct($adapter) { $table = "clientepotencial"; parent::__construct($table, ...
C++
SHIFT_JIS
1,143
2.9375
3
[]
no_license
#ifndef CONSTANT_BUFFER_H_ #define CONSTANT_BUFFER_H_ #include"../../Device/Device.h" /** * @brief 萔VF[_[obt@ */ class ConstBuffer { public: /** * @brief RXgN^ */ ConstBuffer(); /** * @brief fXgN^ */ ~ConstBuffer(); // Rs[RXgN^iÖٓIRs[j ConstBuffer(const ConstBuffer&src) { src.mp_buffer->AddRef()...
JavaScript
UTF-8
2,903
2.625
3
[ "MIT" ]
permissive
const LocalObjectStore = require('../'); const temp = require('temp'); const fs = require('graceful-fs'); const path = require('path'); const async = require('async'); const assert = require('chai').assert; // Automatically track and cleanup files at exit temp.track(); env = { test: true }; describe("LocalObjectSt...
C++
UTF-8
413
2.71875
3
[]
no_license
#ifndef CLIENTE_HPP #define CLIENTE_HPP #include <string> using namespace std; class Cliente { public: void set_cliente(string nome, string endereco, string cidade, string uf, string cep, string telefone); void print(); private: string nome_; string endereco_; ...
Java
UTF-8
551
2.453125
2
[]
no_license
package ch03.classfile; import org.joou.ULong; public class ConstantLongInfo extends ConstantInfo { /* type ConstantLongInfo struct { val int64 } func (self *ConstantLongInfo) readInfo(reader *ClassReader) { bytes := reader.readUint64() self.val = int64(bytes)*/ long val; @...
Python
UTF-8
813
2.9375
3
[]
no_license
import urllib.request, json from jinja2 import Environment, FileSystemLoader tickers = '' # Fetch all the tickers from CoinGecko and append to add to tickers string for i in range(1, 11): api = f"https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=250&page={i}&sparkline=fals...
Java
UTF-8
695
2.5625
3
[]
no_license
package Cookie; public class contact { private String Uname,email,sub,msg; public contact(String uname, String email, String sub, String msg) { super(); Uname = uname; this.email = email; this.sub = sub; this.msg = msg; } public String getUname() { return Uname; } public void setUna...
TypeScript
UTF-8
3,489
3.546875
4
[ "CC0-1.0", "LicenseRef-scancode-public-domain" ]
permissive
interface PluralizedEntry { one: string; other: string; } type Entry = string | string[] | PluralizedEntry; type Entries = Record<string, Entry>; type Variables = Record<string, any>; interface I18nOptions { strings?: Entries; } const hasOwn = (object: object, key: string): boolean => Object.prototype.hasOwn...
PHP
UTF-8
2,887
2.96875
3
[]
no_license
<?php //very nice --> https://www.sitepoint.com/counting-the-ago-time-how-to-keep-publish-dates-fresh/ define( 'TIMEBEFORE_NOW', 'just now' ); define( 'TIMEBEFORE_MINUTE', '{num} minute ago' ); define( 'TIMEBEFORE_MINUTES', '{num} minutes ago' ); define( 'TIMEBEFORE_HOUR', '{num} hour ago' ); d...
C++
UTF-8
7,110
2.5625
3
[]
no_license
/* * SerialNodeNet.h * * Created on: 02.01.2018 * Author: rea */ #ifndef SERIALNODENET_H_ #define SERIALNODENET_H_ #include <stddef.h> #include "SerialNode.h" #include "OnMessageHandler.h" #include "OnPreConnectHandler.h" namespace SerialMsgLib{ class SerialNodeNet { public: v...
JavaScript
UTF-8
409
2.78125
3
[]
no_license
var express = require('express') var axios = require('axios') var app = express() app.get('/', function(req, res) { axios.get('http://localhost:5000/message') .then(apiResp => { res.contentType = "text/html" res.status = 200 res.send("<h1>" + apiResp.data.message + "</h1...
Java
UTF-8
952
2.171875
2
[]
no_license
package com.gaejangmo.apiserver.model.like.domain; import com.gaejangmo.apiserver.model.common.domain.BaseTimeEntity; import com.gaejangmo.apiserver.model.user.domain.User; import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import javax.persistence.*; @Enti...
JavaScript
UTF-8
6,038
2.703125
3
[ "MIT" ]
permissive
HTMLDecorators.StdDecorators.Navigation = (function (document, window) { /** * Handles navigation * * @decorator Navigation * @decNamespace std * @decParam string id The id of the decorator * @decParam string activeClass The active classname for the links * @decParam string hashH...
TypeScript
UTF-8
20,228
2.625
3
[ "MIT" ]
permissive
/// <reference path="./Android/Android.d.ts" /> declare namespace Titanium { /** * The top level Geolocation module. The Geolocation module is used for accessing device location based information. */ namespace Geolocation { /** * The user authorized the app to access location data with full accuracy. */ ...
Python
UTF-8
1,008
3.015625
3
[]
no_license
import wget,os import pandas as pd def url(expert): if expert.lower() in ["a", "b", "c", "d", "e"]: return "https://data.csail.mit.edu/graphics/fivek/img/tiff16_" + expert.lower() + "/" return -1 def images_names(): categories = pd.read_csv("categories.txt") names = categories["names"] ima...
C#
UTF-8
4,457
3.15625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections.Specialized; namespace Views.Util { /// <summary> /// Applies an index offset into a source view, with modulus. /// </summary> /// <typeparam name="T">The type of element observed ...
Markdown
UTF-8
7,588
2.9375
3
[ "MIT" ]
permissive
--- layout: post title: iOS中的机器学习 date: 2017-04-26 categories: iOS cover: /img/iOS_ML/apple-ml.png author: 永超 --- 随着iOS 11的发布,苹果公司也正是加入到了机器学习的战场。在新的iOS 11中,苹果内置了CoreML机器学习框架,并完全支持iOS、watchOS、macOS和tvOS。苹果希望开发者使用这些框架来整合机器学习到他们的应用程序中,而不用去考虑框架是如何工作的。苹果还表示,开发者不必一定是机器学习工作者,相反,开发者只需要将训练好的模型使用其提供的工具转化为所支持的文件格式即可,不必考虑机器...
Shell
UTF-8
471
3.125
3
[]
no_license
#!/bin/bash PROTOCOL=http # or https FRONTEND_IP=$(dig +short @${CONSUL_ADDR} -p 8600 frontend.service.consul) PUBLIC_IP=$(aws ec2 describe-instances --filter Name=private-ip-address,Values=${FRONTEND_IP} Name=instance-state-name,Values=running --query Reservations[*].Instances[*].PublicIpAddress[][] --output text...
Java
UTF-8
1,739
2.796875
3
[]
no_license
import java.awt.*; import java.util.LinkedList; import java.util.List; import java.util.Random; public class Enemy extends GameObject { private Maze maze; int vv=1; int yy=0; Coordinate start; LinkedList<Vertex> pathVertex; public Enemy(float x, float y, int width, int height, ID id, Maze maz...
Java
UTF-8
2,931
2.453125
2
[]
no_license
package com.example.demo; import com.auth0.jwt.JWT; import com.auth0.jwt.JWTVerifier; import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.exceptions.JWTDecodeException; import com.auth0.jwt.interfaces.DecodedJWT; import com.google.gson.Gson; import com.google.gson.JsonObject; import org.apache.tomcat.util....
PHP
UTF-8
1,094
2.578125
3
[ "MIT" ]
permissive
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateElementsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('elements', fun...
PHP
UTF-8
3,431
2.578125
3
[ "MIT" ]
permissive
<?php namespace App\Http\Livewire; use App\Helpers\Tools; use Livewire\Component; class TextTools extends Component { public $string = ''; public $charCount = 0; public $wordCount = 0; public $lineCount = 0; public $paraCount = 0; public function updatedString() { $this->stri...
Ruby
UTF-8
1,287
3.359375
3
[]
no_license
def lattice_path(array) temp = [] sum = 0 count = 0 while count < array.length - 1 sum = sum + array[count] puts sum temp.push(sum) count += 1 end temp.push(array.last) sum = 0 sum = temp.inject(:+) * 2 temp.push(sum) return temp end # below works, just not dynamic arr = [1, 3, 6,...
JavaScript
UTF-8
287
3.0625
3
[]
no_license
// ES6 允许为函数的参数设置默认值, 即直接写在参数定义的后面 function loglog(x,y='world'){ console.log(x,y) } loglog('hello') function fetch(url,{body = '', method = 'GET' , headers={}}){ console.log(method); } //GET fetch('http://wanglinzhizhi.me',{});
Python
UTF-8
1,114
2.84375
3
[ "MIT" ]
permissive
from django.test import TestCase from django.urls import reverse from .models import Post class TestingPosts(TestCase): def setUp(self): """Setting up common variables in this method""" Post.objects.create(text='This is a test post') def test_post_name(self): """Test that the post name is correct""...
SQL
UTF-8
397
2.765625
3
[]
no_license
------------------------------------------------------------------ -- 삭제(Delete) : 존재하는 데이터를 제거하는 것 ------------------------------------------------------------------ SELECT * FROM PRODUCT p; -- [1] 유통기한이 지난 상품의 정보를 삭제 DELETE product WHERE expire < sysdate; -- [2] 상품번호가 5번인 상품을 삭제 DELETE product WHERE NO = 5;
PHP
UTF-8
1,120
2.578125
3
[ "BSD-3-Clause" ]
permissive
<?php namespace backend\models; use Yii; /** * This is the model class for table "taxonomy_items". * * @property integer $id * @property integer $vid * @property string $name */ class TaxonomyItems extends \yii\db\ActiveRecord { public $_parent; /** * @inheritdoc */ public static functi...
PHP
UTF-8
2,153
2.578125
3
[]
no_license
<?php namespace Main\Command; use Main\Command\Command; use \Main\Misc\Registry; use \Main\Misc\Request; use \Main\Misc\Response; use \Main\EventCheck; use Main\db; use \Main\Events; require_once 'Command.php'; require_once 'Request.php'; require_once 'Response.php'; require_once 'db.php'; require_once...
Java
UTF-8
570
2.640625
3
[]
no_license
package com.kimhong.thymeleaf.model; import javax.validation.constraints.NotBlank; public class Testing { @NotBlank String firstName; public Testing() { } public Testing(String firstName) { this.firstName = firstName; } public String getFirstName() { return firstName; ...
Python
UTF-8
1,041
3.1875
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sun May 3 14:34:42 2020 @title: toyrobot.py @author: Petelin """ import mypy import unittest class Table(): def __init__(self, xsize=0, ysize=0): self.xmax=xsize self.ymax=ysize self.robot = None class Robot(): def __init__(...
JavaScript
UTF-8
116
3.203125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
function sumArray(arr) { var sum = 0; for( i = 0; i < arr.length; i++) { sum+=arr[i] } return sum; }