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
Go
UTF-8
8,738
2.6875
3
[ "Apache-2.0", "CC-BY-4.0" ]
permissive
/* * * Copyright SecureKey Technologies Inc. All Rights Reserved. * * SPDX-License-Identifier: Apache-2.0 * / * */ package http import ( "encoding/json" "fmt" "net/http" "testing" "time" "github.com/stretchr/testify/require" "github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service" ) fun...
Java
UTF-8
10,698
1.78125
2
[]
no_license
/* * This file is part of the RUNA WFE project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; version 2.1 * of the License. * * This program is distributed in th...
Python
UTF-8
3,901
3.015625
3
[]
no_license
#!/usr/bin/env python3 """ Author: Tri Doan Project: predict echange rate with regression with Exchange rate US/EUR data is downloaded from investing.com Using Multi-Layer Perceptron with Keras """ import conf from keras.models import Sequential, load_model from keras.layers import Dense import math import os im...
C++
UTF-8
5,571
3.484375
3
[]
no_license
// Program to find Dijkstra's shortest path using STL set #include <iostream> #include <string> #include <vector> #include <unordered_map> #include <queue> #include <climits> #include <cmath> #include <list> #include <set> #define FOR(i, j, k, in) for (long i=j ; i<k ; i+=in) #define RFOR(i, j, k, in) for (long i=j ; i...
Markdown
UTF-8
3,008
2.640625
3
[]
no_license
--- layout: post title: "Week 1: Language Modeling" date: 2018-05-14 00:00:00 +0200 categories: jekyll update tags: speech arabic gsoc redhenlab language-model varikn published: True --- This is my first week coding my Google Summer of Code [project](https://summerofcode.withgoogle.com/projects/#5542722241...
Python
UTF-8
1,329
2.625
3
[]
no_license
import os import re import sys from os import walk def main(pattern:str): for filePath,dirName,files in walk('.'): for file in files: file = os.path.join(filePath,file) text = open_file(file) try: match = search(pattern,text) except TypeErro...
Python
UTF-8
1,416
3.984375
4
[]
no_license
# trip planner, code will be updating... # 350 is the price per night. You can change this value according to your needs. def cost_per_night(nights): return 350 * nights # the value after "return" is a price per one-way flight. I've given you random values. You can change this value according to your needs....
JavaScript
UTF-8
1,424
2.546875
3
[]
no_license
import React from 'react' import { voteFor } from '../reducers/anecdoteReducer' import { showMessage } from '../reducers/notificationReducer' import { connect } from 'react-redux' const Anecdote = ({anecdote, handleClick}) => { return ( <div key={anecdote.id}> <div> {anecdote.conten...
Markdown
UTF-8
2,405
3.21875
3
[]
no_license
# HTML Notes HTML, in a way, is the building block of your site. You're pretty much structuring the layout of it before you stylize it with CSS. However, people did stylize their content in the past without using CSS, which is now not recommended or common practice anymore. Over the years there have been differen...
Python
UTF-8
919
2.609375
3
[]
no_license
import operator import numpy as np import pysam def fetch(bam_file, chrom, start, end): with pysam.Samfile(bam_file, "rb") as samfile: #TODO - Seems a shame to make a python list - must be a way to stream reads = samfile.fetch(chrom, start, end) positions = [] lengths = [] ...
TypeScript
UTF-8
1,259
3.015625
3
[]
no_license
import { input } from "./inputs/input" import { getSteps, Steps, getNextSteps, applyStep, orderStepsByCount } from "./common" // const MAX_WORKERS = 2 // const BASETIME = 0 const MAX_WORKERS = 5 const BASETIME = 60 interface Worker { stepName: string timeCompleted: number } type Workers = ReadonlyArray<Worker> c...
Java
UTF-8
5,092
2.109375
2
[]
no_license
package com.laxminarayan.sgpacalculator; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; public class Sem2...
C++
UTF-8
2,481
2.578125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<double, double> pii; #define x first #define y second #define all(v) v.begin(), v.end() #define ms(v) memset(v, 0, sizeof(v)) #define mss(v) memset(v, -1, sizeof(v)) #define zz(v) int(v.size()) #define ii (i + 1) % n // 打字加速! inline pii ...
Java
UTF-8
2,226
2.25
2
[]
no_license
package com.example.toronto.mystudyapp.view; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import com.example.toronto.mystudyapp.R; import java.util.ArrayList; import java.util....
Java
UTF-8
2,258
2.390625
2
[]
no_license
/** * DynamicReports - Free Java reporting library for creating reports dynamically * * Copyright (C) 2010 - 2016 Ricardo Mariaca * http://www.dynamicreports.org * * This file is part of DynamicReports. * * DynamicReports is free software: you can redistribute it and/or modify * it under the terms of the GNU L...
JavaScript
UTF-8
466
3.015625
3
[ "MIT" ]
permissive
/* * List of useful Math hlpers * */ //convert a range to another range const map = (n, start1, stop1, start2, stop2) => ((n-start1)/(stop1-start1))*(stop2-start2)+start2 //avoid escaping values const clamp = (n,min,max) => Math.min(Math.max(n, min), max) const toFixedFloat = (float,num) => parseFloat(float.toFix...
C++
UTF-8
890
3.171875
3
[]
no_license
#include <iostream> #include <string> int main() { std::string sval, curr_str, res_str; size_t curr_cnt = 0, res_cnt = 0; if (std::cin >> sval) { curr_str = sval; curr_cnt = 1; while (std::cin >> sval) { if (sval == curr_str) { ++curr_cnt; ...
SQL
UTF-8
2,672
4.75
5
[]
no_license
#select 연습 desc employees; select * from departments; select dept_no, dept_name from departments; # alias(as 생략가능) #예제1 : employees table 에서 직원의 이름, 성별, 입사일을 출력. select first_name as '이름' , gender as '성별', hire_date as '입사일' from employees; #예제2 : employees 테이블에서 직원의 이름, 성별, 입사일을 출력 + concat 함수(칼럼 두개를 연결...
C++
UTF-8
740
3.28125
3
[]
no_license
// Question 1: Rat Count House #include<bits/stdc++.h> using namespace std; int calculate (int r, int unit, int arr[], int n) { if (n == 0) return -1; int totalFoodRequired = r * unit; int foodTillNow = 0; int house = 0; for (house = 0; house < n; ++house) { foodTillN...
Java
UTF-8
1,592
2.203125
2
[]
no_license
/** * filename:TagController.java * * date:2017年3月22日 * Copyright reey Corporation 2017 * */ package lol.mifan.myblog.controller; import lol.mifan.myblog.po.Article; import lol.mifan.myblog.po.Tag; import lol.mifan.myblog.service.ArticleService; import lol.mifan.myblog.service.TagService; import org.apache.shiro...
JavaScript
UTF-8
3,855
2.578125
3
[ "MIT" ]
permissive
addEventListener('message', function(e) { var data = e.data; switch (data.cmd) { case 'draw_image': var imageData = data.data, imageBlockSize = data.imageBlockSize, width = data.width, height = data.height, colorFunc = data.colorFunc, imageColor = data.imageColor, _data = imageData.da...
JavaScript
UTF-8
2,006
2.546875
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
import React, { Component } from 'react'; import { View, Text, StyleSheet, TextInput, Button } from 'react-native'; import firebase from 'firebase'; export default class App extends Component { constructor(props) { super(props); this.state = { email:'', senha:'', novaSenha:'' }; t...
Shell
UTF-8
868
3.34375
3
[]
no_license
#!/bin/bash -x name=opof FILE_DIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" ROOT_DIR="$(dirname "$FILE_DIR")" cd $ROOT_DIR set -e # create dist tarball in current directory VER=$(grep NV_OPOF_VERSION include/nv_opof.h | cut -d'"' -f2) TARBALL="$name-$VER.tar.gz" if [ -e $TARBALL ] ; then rm -f $TARBALL; fi...
Python
UTF-8
92
3.21875
3
[]
no_license
a = float(input()) rub = int(a // 1) kop = round((a % 1) * 100) print(rub, kop, end='')
Python
UTF-8
817
2.59375
3
[]
no_license
#官方文档https://pyecharts.org from pyecharts.charts import Bar #柱状图 from pyecharts import options as opts from pyecharts.globals import ThemeType #主题 from pyecharts.options import ToolboxOpts #工具条 bar = ( Bar(init_opts=opts.InitOpts(theme=ThemeType.DARK,width="1200px",height="700px")) .set_global_o...
Markdown
UTF-8
17,686
3.515625
4
[]
no_license
#### 变量定义 ```go 变量需要先声明,再赋值 // 声明: var a int // 声明int类型的变量 var b [10]int // 声明int类型的数组 var c []int // 声明int类型的切片 var d *int // 声明int类型的指针 // 赋值 a = 10 b[0] = 10 // 同时声明与赋值 var a = 10 a := 10 a,b,c,d := 1,2,true,"xxx" ``` #### 常量定义 ```go // const是用来定义常量的 const filename = "abc.txt" const a,b = 3,4 const ( ...
C
UTF-8
3,573
3.03125
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <winsock2.h> #define MAX_CONNECTION_NUM 64 SOCKADDR_IN known_connections[MAX_CONNECTION_NUM]; int connections = 0; void handleSetup(WSADATA *wsadata, SOCKET *main_socket, SOCKADDR_IN *addr){ int error_code = WSAStartup(MAKEWORD(2, 2), wsadata); if( error_code !...
C
UTF-8
260
2.859375
3
[]
no_license
#include "holberton.h" #include <stdlib.h> /** * malloc_checked- Allocates memory using malloc * @b: unsigned int * Return: Pointer to allocated memory */ void *malloc_checked(unsigned int b) { void *n; n = malloc(b); if (n == NULL) exit(98); return (n); }
Java
UTF-8
1,003
3.953125
4
[]
no_license
// Quick sort implementation import java.util.*; public class QuickSort { public static void quickSort(int [] nums, int start, int end) { if (start < end) { int partitionIndex = partition(nums, start, end); quickSort(nums, start, partitionIndex - 1); quickSort(nums, partitionIndex + 1, end); } } pu...
C
UTF-8
218
2.921875
3
[]
no_license
#include <unistd.h> #include <stdlib.h> int main(int argc, char**argv) { char buf[10]; while(1) { printf(">"); memset(buf, 0, sizeof(buf)); scanf("%s", buf); system(buf); printf("\n"); } return 0; }
Java
UTF-8
17,405
2.359375
2
[ "MIT" ]
permissive
import com.google.gson.JsonArray; import com.google.gson.JsonObject; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.junit.jupiter.api.*; import spark.Spark; import java.text...
PHP
UTF-8
3,357
2.578125
3
[]
no_license
#!/usr/bin/env php <?php require 'vendor/autoload.php'; use \Us\Crawler\Storage\RDBStorage; use \Us\Crawler\Storage\DummyStorage; use \Us\Crawler\Engine\PttCrawler; $board_name = null; $shortopts = ""; $longopts = array( "board:", "sleep-between-list:", "sleep-between-article:", "sleep-between-retry:", "timeo...
Java
UTF-8
967
3.03125
3
[]
no_license
package com.xq.live.common; /** * 位置 */ public class LocationUtils { /** * 定义赤道的半径(千米) */ public static double EARTH_RADIUS = 6378.138; /** * 根据两个点的经纬度计算两个点之间的距离(单位:米) * @param locationX1 经度 * @param locationY1 纬度 * @param locationX2 * @param locationY2 * @return...
Java
UTF-8
1,971
2.265625
2
[ "MIT" ]
permissive
package fr.formation.toastdemo; import android.app.Activity; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Context; import android.content.Intent; import android.os.Build; import android.view.LayoutInflater; import android.view.V...
C++
GB18030
398
2.96875
3
[]
no_license
#ifndef _COMPANY_H__ #define _COMPANY_H__ #pragma once using namespace std; class Company { public: Company(); ~Company(); void setId(const long & id) {id_ = id;} const long & id() {return id_;} void setName(const string & name) {name_ = name;} const string & name() {return name_;} private: long id_; //ʹ...
Java
UTF-8
1,962
2.40625
2
[]
no_license
package ee.playtech.trial.common.configuration; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public enum ConfigurationProperty { SERVER_HOST("trial.server.host"), SERVER_PORT("trial.server.port"), MAX_BALANCE_CHANGE( "trial.client.balance.ch...
Java
UTF-8
2,551
2.234375
2
[]
no_license
package org.openmf.mifos.dataimport.handler; import java.io.IOException; import java.io.InputStream; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mock...
C++
UTF-8
267
2.875
3
[]
no_license
#pragma once #include <string> class Order { public: Order(); Order(double x, double y); std::pair<double, double> getCoordinates() const; double distance(const Order& other) const; private: double coordinateX = 0; double coordinateY = 0; };
Java
UTF-8
2,260
2.09375
2
[]
no_license
package io.github.palexdev.addressapp; import io.github.palexdev.addressapp.events.SpringAppEvents; import io.github.palexdev.addressapp.events.base.IEnumNotificationCentre; import io.github.palexdev.addressapp.view.MainView; import javafx.application.Application; import javafx.application.HostServices; import javafx....
SQL
UTF-8
631
3.390625
3
[ "CC0-1.0" ]
permissive
-- BOM schema -- !Ups CREATE TABLE `assembly_part` ( `assembly_id` varchar(36) NOT NULL, `part_id` varchar(36) NOT NULL, UNIQUE KEY `assembly_part_assembly_id_IDX` (`assembly_id`,`part_id`) USING BTREE, KEY `assembly_part_part_FK` (`assembly_id`), KEY `assembly_part_part_FK_1` (`part_id`), CONSTRAINT `ass...
Go
UTF-8
2,010
3.578125
4
[]
no_license
package main import ( "bufio" "fmt" "log" "os" "strings" "strconv" ) func read_ints_from_file(filename string) ([]int, error) { f, err := os.Open(filename) if (err != nil) { return nil, err } b := bufio.NewReader(f) int_array := []int{} for { line, er...
PHP
UTF-8
1,386
3.0625
3
[]
no_license
<?php /** * @file * Glue code . */ // Autoloading. require __DIR__ . '/../vendor/autoload.php'; use Webham\DesignPatterns\DecoratorExample\Book; use Webham\DesignPatterns\DecoratorExample\BookTitleExclaimDecorator; use Webham\DesignPatterns\DecoratorExample\BookTitleStarDecorator; /** * The client code. */ pri...
Java
UTF-8
456
2.9375
3
[]
no_license
package rlnitsua.math; import java.util.PriorityQueue; public class MinimumCosttoConnectSticks { public int connectSticks(int[] sticks) { int res = 0; PriorityQueue<Integer> pq = new PriorityQueue<>(); for (int s : sticks) { pq.add(s); } while (pq.size() > 1) ...
Markdown
UTF-8
1,697
3.296875
3
[]
no_license
# TrackBook # #### An iOS app that helps you keep track of the books you've read. #### Built with React Native. This was a two-day solo MVP project. [![Watch demo on YouTube](/screenshots/youtube.png?raw=true "Watch demo on YouTube")](https://youtu.be/xsaB9li1Bac) ### What does it do for me? ### If you have a boo...
Python
UTF-8
199
2.890625
3
[]
no_license
import random import numpy as np np.random.seed(1337) coordinates = np.random.randint(0, 100, size=(2, 5, 4)) print(coordinates) print(coordinates.max(axis=(0,1))) print(coordinates.min(axis=(0,1)))
JavaScript
UTF-8
1,772
3.375
3
[]
no_license
"use strict"; var quoteGroup = ["Love For All, Hatred For None. – Khalifatul Masih", "Change the world by being yourself. – Amy Poehler", "Every moment is a fresh beginning. – T.S Eliot", "Never regret anything that made you smile. – Mark Twain", "Die with memories, not dreams. – Unknown", "Aspire to inspire before we ...
Python
UTF-8
674
2.578125
3
[]
no_license
#%% import pandas as pd #%% import os #%% #dataFile = os.path.join(os.getcwd(), 'FlexSession_12102019/dataSet.csv') dataFile = 'a:\\DataVizRepo\\FlexSession_12102019\\dataSet.csv' #%% dataFilePD = pd.read_csv(dataFile) # %% dataFilePD.head(100) # %% dataFilePD.describe() # %% dataFilePD["Amount"].head(100) # %% da...
Java
UTF-8
809
1.976563
2
[]
no_license
package com.shopping.mall.service; import java.util.List; import com.shopping.mall.model.Product; public interface ProductService { /** * 新增用户 * @param Product * @return */ boolean addProduct(Product product); /** * 修改用户 * @param Product * @return */ boolean updateProduct(Pro...
Java
UTF-8
1,320
2.6875
3
[]
no_license
package bookshop.utilities; import bookshop.entities.Category; import org.springframework.stereotype.Component; import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; impor...
PHP
UTF-8
5,480
3.203125
3
[]
no_license
<?php //echo '<br />started.'; //-------------------------------------------------------------------------------------------------- // This script reads event data from a JSON file and outputs those events which are within the range // supplied by the "start" and "end" GET parameters. // // An optional "timezone" GET p...
C++
UTF-8
2,806
2.59375
3
[]
no_license
/* * input.hpp * * Created on: 25-06-2013 * Author: lucck */ #pragma once #include <cstring> #include <memory> #include <array> #include <functional> #include "event_info.hpp" namespace gfx::input { class input_class { public: typedef std::function<void( const event_info& )> input_evt_t; enum led_ctl...
Python
UTF-8
1,283
3.234375
3
[]
no_license
import requests import json # YelpAPI # businessId def get_restaurants(protein_food, type_food, price_food): # key should be hidden api_key = 'zJAj4o-JYOnTfrbVIrTeO9HM4S9KaEt71QTyt5Ud-EShBRcH_twkMEjSGTVfJXgHOCVxYEEP92xqS0pQOhhOSIzh2IXZ8bs4Q-bJzp76yMam2xXR4A1FhdOlDJCJYHYx' search_api_url = 'https://api.yelp...
Markdown
UTF-8
13,475
3
3
[ "MIT" ]
permissive
--- title: Resolvers --- In GraphQL resolvers describe the logic that fetches data for a specific field. Field resolvers run independently of each other which allows the execution engine to parallelize their execution. This independent approach to fetch data allows us to build powerful schemas that consists of multi...
Python
UTF-8
3,692
2.625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Mon Jun 29 19:05:34 2020 @author: Radu """ import pandas as pd, numpy as np from matplotlib import pyplot as plt import scipy.stats as stats pd.options.display.max_columns = 50 path = r"C:\Users\Radu\Desktop\ML Projects\M5 Accuracy\Data Evaluation/" path_results =...
Python
UTF-8
172
3.421875
3
[]
no_license
from random import randint def dado(): return randint(1,6) # gera valores ate que um 6 seja sorteado for r in iter(dado, 6): # 6 e' o "sentinela" print r
Markdown
UTF-8
2,566
2.59375
3
[]
no_license
Formats: [HTML](/news/2011/02/4/a-small-plane-crashes-in-sulaimaniya-in-iraq-s-semi-autonomous-northern-kurdish-region-killing-all-seven-people-on-board.html) [JSON](/news/2011/02/4/a-small-plane-crashes-in-sulaimaniya-in-iraq-s-semi-autonomous-northern-kurdish-region-killing-all-seven-people-on-board.json) [XML](/n...
Python
UTF-8
570
2.6875
3
[]
no_license
# Local libs import namespaceCV import utils # Python libs import cv2 import numpy as np from matplotlib import pyplot as plt # Sets namespaceCV.IMG to whatever image name was passed in utils.parseArgs() if namespaceCV.BW: # If black and white img = cv2.imread(namespaceCV.IMG,0) plt.hist(img.ravel(),256,[0,256]);...
Python
UTF-8
1,107
2.640625
3
[]
no_license
#!/usr/local/bin/python3 import cgi import cgitb import json import psycopg2 import psycopg2.extras import hashlib cgitb.enable() form = cgi.FieldStorage() def encrypt(inputString): m = hashlib.sha256() m.update(inputString.encode('utf-8')) return m.hexdigest() def createPlayer(firstname, lastname, grad...
JavaScript
UTF-8
695
3.5
4
[]
no_license
document.getElementById("execute").onclick = function Execute() { var number = document.getElementById("input").value; var arr = document.getElementById("text").value; var index = arr.indexOf(number); if ((index != 0) && (index != arr.length-1)) { for (i in arr) { if (arr[index] > arr[index + 1] && arr[inde...
Java
UTF-8
244
1.703125
2
[]
no_license
package snake; /** * MainClass * @author macrozone * */ public class Main { public static void main(String args[]) { @SuppressWarnings("unused") GameApplication theGame = new GameApplication(); } }
SQL
UTF-8
2,596
3.578125
4
[]
no_license
---- Not currently in LoadTable. We are populating MAP_IepSubGoalAreaDefID in the state specific ETL Prep file. --IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'x_LEGACYGIFT.MAP_IepSubGoalAreaDefID') AND OBJECTPROPERTY(id, N'IsUserTable') = 1) --BEGIN --CREATE TABLE x_LEGACYGIFT.MAP_IepSubGoalArea...
Shell
UTF-8
909
3.109375
3
[]
no_license
#!/bin/bash # chkconfig: 35 85 12 ATA="10.62.150" start () { cd /opt/callpture/server/ nodemon index.js & cd /opt/callpture/client ng server --host 10.62.1.170 & j=1 for ((i=1001; i<=1722; i++)) do echo "UPDATE ramais.ramais SET status = '1' WHERE ramal = '$i' " | mysql -uroot -p123456; do...
Python
UTF-8
1,186
3.34375
3
[ "MIT" ]
permissive
class Vessel: def __init__(self, name: str): """ Initializing class instance with vessel name :param name: """ self.name = name self.fuel = 0.0 # list of dicts with passenger attributes self.passengers = [] def __repr__(self): """ ...
Python
UTF-8
1,830
2.859375
3
[]
no_license
import cv2 import numpy as np class VideoProcessor: def __init__(self, video_path = 'data_debug/10_0_c.avi', height = 256, width = 512, n_channels = 3, max_window_size = 1500): self.cap = cv2.VideoCapture(video_path) self.video_length = self.cap.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT) self.height = height self.w...
Go
UTF-8
1,753
4.78125
5
[]
no_license
package main import ( "fmt" "math" ) /* Go 没有类。不过你可以为结构体类型定义方法。 方法就是一类带特殊的 接收者 参数的函数。 方法接收者在它自己的参数列表内,位于 func 关键字和方法名之间。 在此例中,Abs 方法拥有一个名为 v,类型为 Vertex 的接收者。 */ type Structure struct { X, Y float64 } func (v Structure) Abs() float64 { return math.Sqrt(v.X*v.X + v.Y*v.Y) } // ^ // | -- 比较一下两者的区别 // v func AbsFu...
Java
UTF-8
1,706
3.921875
4
[]
no_license
package leetcode.binarytree; import java.util.ArrayList; import java.util.List; /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(int val) { this.val = val; } * TreeNode(int val, TreeNode left, Tr...
SQL
UTF-8
1,040
3.921875
4
[]
no_license
REM REM Display user UGA memory usage REM PROMPT PROMPT USER UGA MEMORY USAGE PROMPT ACCEPT u PROMPT "User name like (ENTER for all): " DEFINE usr = "NVL(UPPER('&&u'), '%')" ACCEPT min PROMPT "Min UGA memory (ENTER for 0): " NUMBER @_BEGIN @_TITLE "USER UGA MEMORY USAGE" COLUMN username FORMAT A20 COLUMN uga ...
TypeScript
UTF-8
3,593
2.640625
3
[]
no_license
import { Product } from '../schemas/product.schema' import { Types } from 'mongoose' import { generateResponse, randomID } from '../utils/utils' import { create, update } from '../models/product.query.model' import { unlinkSync } from 'fs' import { join } from 'path' export let getProducts = async() => { let produ...
Java
UTF-8
11,944
1.835938
2
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "LicenseRef-scancode-public-domain" ]
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 ...
C#
UTF-8
3,449
2.515625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; namespace IxMilia.Dwg.Objects { public partial class DwgDimStyle { public const string XDataStyleName = "DSTYLE"; public DwgStyle Style { get; set; } internal override IEnumerable<DwgObject> ChildItems { get ...
Python
UTF-8
9,415
2.5625
3
[]
no_license
import argparse import networkx as nx import os import pickle import random import re import subprocess import sys from collections import defaultdict, OrderedDict from itertools import islice from time import sleep, time import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from topology import ge...
Java
UTF-8
137
1.648438
2
[]
no_license
package ro.uvt; public class ConcretStrategyC implements Strategy { @Override public void AlgorithInterace() { } }
C++
UTF-8
4,347
3.15625
3
[]
no_license
#include "MeshLoader.h" #include <iostream> #include <fstream> #include <string> #include <sstream> #include <algorithm> #include <vector> using namespace std; namespace MeshLoader { Mesh* MeshLoader::LoadOBJ(char* path) { ifstream inFile; inFile.open(path); if (!inFile.good()) { cerr << "Can't open obj f...
C++
UTF-8
296
2.71875
3
[]
no_license
int Solution::sqrt(int A) { if(A<=1) return A; long long int low=0,high=A>>1; while(low<=high){ long long int mid=(low+high)>>1; if((mid*mid <A && (mid+1)*(mid+1)>A) || (mid*mid==A)) return mid; else if(mid*mid > A) high=mid-1; else low=mid+1; } }
C
UTF-8
997
2.921875
3
[]
no_license
/* This file is a user program defined for ioctl operation * It is used for transferring a string to wrapfs_unlocked_ioctl * and and then computing the key. */ #include <err.h> #include <sys/ioctl.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <ctype.h> #include <stdlib.h> #inc...
JavaScript
UTF-8
10,243
2.984375
3
[]
no_license
/* ******************************************************************* * URI-Template :RFC6570 Implementations * Version: 0.1 * http://tools.ietf.org/html/rfc6570 * (C) makoto@2ch.to * ******************************************************************* */ var URI_Template = function(){ "use strict"; ...
Python
UTF-8
2,557
4
4
[ "MIT" ]
permissive
# imported modules # time modules for time delays import time # webbrowser module to open conversion webpage import webbrowser # math module for math function import math # random module for randomizing events import random # var representing available exercises exercise_1 = '\t\t\t Running' exercise_2 = '\t\t\t F...
Markdown
UTF-8
2,803
2.578125
3
[ "MIT" ]
permissive
# sales-application A application to manage sales. TO DO -------------------------------------------------------------------------------- SETUP LARAVEL + REACT INTEGRADO 1 - composer require laravel/ui - OK; 2 - php artisan ui react OK; 3 - php artisan ui react --auth - Não é necessário; 4 - npm install && npm ru...
JavaScript
UTF-8
3,548
2.703125
3
[ "MIT" ]
permissive
'use strict' let debug = require('debug')('cache-engines:redis') let bluebird = require('bluebird') let redis = require('redis') // promisfy bluebird.promisifyAll(redis.RedisClient.prototype) bluebird.promisifyAll(redis.Multi.prototype) /** * */ class Redis { constructor (config) { debug(config) this.con...
Java
UTF-8
4,310
2.5625
3
[]
no_license
package com.dcalabrese22.dan.skipassusage; import com.dcalabrese22.dan.skipassusage.database.DbOperations; /** * Created by dan on 12/19/17. */ public class ResortsBuilder { private static String[] resorts = { "Alyeska", "Mt Bachelor", "Belleayre Mountain", "Big...
JavaScript
UTF-8
1,738
2.546875
3
[]
no_license
var lastTime = 0; var deltaTime = 0; var clock = new THREE.Clock(); var stopEverything = false; //Temp for testing var que = []; function animate() { requestAnimationFrame(animate); var delta = clock.getDelta(); moveCamera(); //checking for objects to highlioght on mouse over //callt to render // checkIntersect...
Java
UTF-8
1,487
1.953125
2
[]
no_license
package org.uiautomation.ios.server.command.uiautomation; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.openqa.selenium.remote.Response; import org.uiautomation.ios.IOSCapabilities; import org.uiautomation.ios.communication.WebDriverLikeRequest...
C++
UTF-8
1,171
3.53125
4
[]
no_license
#include<stdio.h> int add(int a,int b){ return a + b; } int subtract(int a,int b){ return a - b; } int multiply(int a,int b){ return a * b; } int main() { char continou; do{ int num1, num2; int option; printf("1:sum of two numbers:\n"); printf("2:diference of two numbers:\n"); printf("3...
Java
UTF-8
8,669
1.898438
2
[]
no_license
/* * Copyright 2013-2014 the original author or authors. * * 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 ap...
Java
UTF-8
871
2.90625
3
[]
no_license
package course.fileAndIO2_1128.serializable1; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; public class Test6 { public static void main(String[] args) throws Exception{ Pet pet1 = new Pet("aa",100,20); ...
PHP
UTF-8
839
2.578125
3
[]
no_license
<?php function user_folder_get($user_id){ //指定ユーザーのフォルダを取得 global $dbh; $user_folder_get = "SELECT * FROM folders WHERE user_id = ?"; $user_folder_get_pdo = $dbh->prepare($user_folder_get); $user_folder_get_pdo->bindValue(1, $user_id, PDO::PARAM_INT); $user_folder_get_pdo->execute(); $user_folder_...
Java
UTF-8
2,028
1.976563
2
[]
no_license
package com.feed_the_beast.ftbl.net; import com.feed_the_beast.ftbl.api.gui.IGuiProvider; import com.feed_the_beast.ftbl.client.FTBLibModClient; import com.feed_the_beast.ftbl.lib.client.ClientUtils; import com.feed_the_beast.ftbl.lib.net.MessageToClient; import com.feed_the_beast.ftbl.lib.net.NetworkWrapper; import c...
C++
UTF-8
2,128
2.578125
3
[]
no_license
#pragma once #include "SpehsEngine/Graphics/ResourceHandle.h" /* LIST OF DEFAULT UNIFORMS -- bgfx ---------------- - u_viewRect vec4(x, y, w, h) View rectangle for current view, in pixels - u_viewTexel vec4(1/w, 1/h, ?, ?) Inverse width and height - u_view mat4 View matrix - u_invView mat...
C++
UTF-8
3,942
3.109375
3
[]
no_license
#include "Joueur.h" #include <regex> Joueur::Joueur() {} Joueur::Joueur(string name, string nomEquipe) { this->setName(name); this->setnomEquipe(nomEquipe); this->setButs(1); } Joueur::Joueur(const Joueur &j) { this->setName(j.getName()); this->setButs(j.getButs()); this->setnomEquipe(j.getnomE...
C
UTF-8
409
3.71875
4
[]
no_license
#include <stdio.h> void swap_ptr(int *p1,int *p2); int main(void) { int p = 11, q = 22; int *ptrp = &p, *ptrq = &q; int **ppp = &ptrp, **ppq = &ptrq; swap_ptr(ppp,ppq); /* &ptrp, &ptrq passed */ printf("first = %d\n",*ptrp); printf("second = %d\n", *ptrq); /* to swap_ptr() */ return 0; ...
Markdown
UTF-8
1,415
3.03125
3
[]
no_license
## 什么是爬虫 爬虫,即网络爬虫,也叫做网络机器人,可以代替人们自动地在互联网中进行数据信息的采集与整理,大家可以理解为在网络上爬行的一只蜘蛛,互联网就比作一张大网,而爬虫便是在这张网上爬来爬去的蜘蛛,如果它遇到自己的猎物(所需要的资源),那么它就会将其抓取下来。 百度搜索引擎的爬虫叫作百度蜘蛛(Baiduspider)。百度蜘蛛每天会在海量的互联网信息中进行爬取,爬取优质信息并收录,当用户在百度搜索引擎上检索对应关键词时,百度将对关键词进行分析处理,从收录的网页中找出相关网页,按照一定的排名规则进行排序并将结果展现给用户。 ### 为什么要用python编写爬虫 Python:语法代码简洁易学、开发效率高、有许多第三方的模块...
Python
UTF-8
1,143
2.984375
3
[]
no_license
import numpy import cv2 ### this function provides end-to-end alignment ### M is homography funcion of last image to first ### start coordinate of first image is (0, 0) ### the result shift image def drift(img, M): ### calculate drift origin = numpy.array([[0], [0], [1]]) origin = numpy.dot(M, origi...
Python
UTF-8
1,848
2.578125
3
[]
no_license
from sys import argv import json import cv2 from . import generate_training_data, find_fit, get_velocities if len(argv) < 3: print("""Error: Expected at least 2 arguments! the first arugment is the video's analysis result json file, the second argument is the input video path, the third argument (optional, defaul...
C
UTF-8
1,294
2.546875
3
[ "Apache-2.0" ]
permissive
#include "../../../test_common.h" #include <arpa/nameser.h> void runSuccess() { u_char buf[10]; u_char s[10]; u_char* ps[5] = {s, NULL, NULL, NULL, NULL}; ns_name_compress(anystring(), buf, 10, ps, ps+5); } void runFailure() { u_char buf[10]; u_char s[10]; u_char* ps[5] = {s, NULL, NULL, N...
JavaScript
UTF-8
5,709
2.765625
3
[ "MIT" ]
permissive
$("#results").hide(); //============================================================== // FIREBASE var config = { apiKey: "AIzaSyDEncMpEGmZB-YzqtxpfuzxkXG1QvXRlGA", authDomain: "click-4bcad.firebaseapp.com", databaseURL: "https://click-4bcad.firebaseio.com", projectId: "click-4bcad", storageBucket: ...
Python
UTF-8
248
3.609375
4
[]
no_license
import turtle window = turtle.Screen() t = turtle.Turtle() t.pencolor(1.0, 0, 0) # RGB values t.forward(100) t.left(120) t.pencolor("red") # Common name t.forward(100) t.left(120) t.pencolor("#ff0000") # Hex code t.forward(100) window.mainloop()
C++
UTF-8
316
3.375
3
[]
no_license
#include <iostream> #include "Sales_item.h" int main() { Sales_item first, second; std::cout << "Enter two books in the example format: 0-201-70353-X 4 24.99" << std::endl; std::cin >> first >> second; std::cout << "The sum is: " << std::endl << first + second << std::endl; return 0; }
Java
UTF-8
1,903
2.90625
3
[]
no_license
package UIElements; /* * 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. */ import javafx.beans.property.SimpleIntegerProperty; import javafx.scene.canvas.GraphicsContext; import ja...
Java
UTF-8
943
3.546875
4
[]
no_license
package prefixSums; public class PassingCars { public int solution(int[] cars) { int sumOfWest = 0; for (int i = 0; i < cars.length; i++) { if (cars[i] == 1) sumOfWest++; } int numberOfPairs = 0; for (int i = 0; i < cars.length; i++) { ...
PHP
UTF-8
560
3.234375
3
[]
no_license
<?php namespace App\Domain\VendingMachine\ValueObjects; class Stock { private $waterItems; private $sodaItems; private $juiceItems; public function __construct(int $waterItems, int $sodaItems, int $juiceItems) { $this->waterItems = $waterItems; $this->sodaItems = $sodaItems; $this->juiceIt...