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
168
2.0625
2
[]
no_license
package com.ipl.dao; import com.ipl.model.User; public interface UserDao { public void addUser(User user) ; public User authUser(String email,String password); }
JavaScript
UTF-8
4,384
2.75
3
[]
no_license
/** * @module Ink.Dom.Loaded_1 * @author inkdev AT sapo.pt * @version 1 */ Ink.createModule('Ink.Dom.Loaded', 1, [], function() { 'use strict'; /** * The Loaded class provides a method that allows developers to queue functions to run when * the page is loaded (document is ready). * * @...
C
UTF-8
2,306
3.6875
4
[]
no_license
#include<stdlib.h> #include<stdio.h> #include<string.h> #define MAX 100 typedef struct{ char nome[50]; int id; } tipoDados; typedef struct{ tipoDados vet[MAX]; int nelem; } tipoLista; void iniciar_lista(tipoLista *L){ (*L).nelem = 0; //ou L->nelem } void inserir_lista(tipoLista *L){ register int i...
C++
UTF-8
804
3.8125
4
[]
no_license
#include <iostream> #include <conio.h> #define pi 3.14 using namespace std; class area{ float areas; public: void area_51(int a , int b); void area_51(double l, double c); void area_51(double r); }; void area :: area_51(int a, int b) { areas=a*b; cout<<"area of rectangle="<<areas<<endl; } void area :: area_51...
Python
UTF-8
6,136
2.921875
3
[ "MIT" ]
permissive
from ground.base import (Context, Relation) from ground.hints import Point from prioq.base import PriorityQueue from reprit.base import generate_repr from .event import Event class EventsQueueKey: __slots__ = 'event', def __init__(self, event: Event) -> None: self.event = ev...
C#
UTF-8
5,524
2.90625
3
[]
no_license
using System.Collections.Generic; using System.Text; using DataCreator.Utility; using DataCreator.Shared; using DataCreator.Enemies; namespace DataCreator.Encounters { /// <summary> /// An object for a single encounter. Contains related tactics and media files. /// </summary> public class Encounter ...
Java
UTF-8
1,288
2.390625
2
[]
no_license
package admin; import entities.User; import qualifiers.Users; import javax.inject.Inject; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet...
Java
UTF-8
2,765
2.359375
2
[]
no_license
package it.polito.tdp.spellchecker; import java.net.URL; import java.util.LinkedList; import java.util.List; //import java.util.Dictionary; import java.util.ResourceBundle; import it.polito.tdp.spellchecker.model.*; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import j...
Java
UTF-8
733
2.453125
2
[]
no_license
package flickster.com.flickster.model; import android.arch.lifecycle.ViewModel; import android.arch.lifecycle.ViewModelProvider; import android.support.annotation.NonNull; import flickster.com.flickster.database.MovieDatabase; public class AddMovieViewModelFactory extends ViewModelProvider.NewInstanceFactory{ ...
Python
UTF-8
380
3.390625
3
[]
no_license
# Link: https://uva.onlinejudge.org/external/15/1584.pdf import re def get_smallest_lex_dna(dna): for nucleotide in 'ACGT': all_indices = [m.start() for m in re.finditer(nucleotide, dna)] if all_indices: return sorted([dna[index:] + dna[:index] for index in all_indices])[0] for _ in ra...
SQL
UTF-8
969
2.9375
3
[]
no_license
CREATE TABLE sa.table_part_class ( objid NUMBER, "NAME" VARCHAR2(40 BYTE), description VARCHAR2(255 BYTE), dev NUMBER, x_model_number VARCHAR2(30 BYTE), x_psms_inquiry VARCHAR2(150 BYTE) ); ALTER TABLE sa.table_part_class ADD SUPPLEMENTAL LOG GROUP dmtsora577323333_0 (description, dev, "NAME", objid...
Java
UTF-8
1,997
2.5625
3
[ "Apache-2.0" ]
permissive
package xworker.javafx.control.cell; import javafx.scene.control.cell.ComboBoxTreeTableCell; import javafx.util.StringConverter; import org.xmeta.ActionContext; import org.xmeta.Thing; import xworker.javafx.control.TableCellActions; import xworker.javafx.control.TreeTableCellActions; import xworker.javafx.util.JavaFXU...
C
UTF-8
5,504
3.125
3
[ "MIT" ]
permissive
#ifndef _KS_TREESET_H_ #define _KS_TREESET_H_ /* --------------------- * ks_treeset_new(): * Creates a new empty ks_treeset. * * Inputs: * void * * Returns: * ks_treeset* ts - an empty ks_treeset. */ ks_treeset* ks_treeset_new(); /* ---------------------- * ks_treeset_delete(): * Deletes a ks_treeset and...
Python
UTF-8
2,912
3.765625
4
[]
no_license
#1st Dictionary Exercise. I went ahead and modified it to do the Phonebook App exercise too. import pickle phonebook_dict = { 'Alice': '703-493-1834', 'Bob': '857-384-1234', 'Elizabeth': '484-584-2923' } def retrieveNum(): nameNum = input("Whose number? (Enter Name) ") print("Found entry for {}: {}".fo...
C#
UTF-8
705
2.53125
3
[ "Apache-2.0" ]
permissive
namespace CrypTool.Plugins.ChaCha.ViewModel.Components { internal interface IActionTag { /// <summary> /// Saves action indices under a "tag" for later retrieval. /// This implements "action tagging". We can mark actions with a string /// and then retrieve their action index usi...
C#
UTF-8
1,803
2.59375
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class DiceScript : MonoBehaviour { public GameObject Plane; public GameObject TextGB; private GameObject Dice1; private GameObject Dice2; private GameObject Dice3; private GameObject Dice4; private Gam...
Java
UTF-8
580
2.375
2
[]
no_license
/** * */ package net.skyebook.padloader.test; import java.io.File; import java.io.IOException; import java.util.List; import net.skyebook.padloader.read.BBLReader; import net.skyebook.padloader.record.Record; /** * @author Skye Book * */ public class TestBBLReader { /** * @param args * @throws IOExceptio...
C++
UTF-8
1,148
2.921875
3
[ "MIT" ]
permissive
#pragma once namespace Playground { namespace Com { template <typename T> struct Box { T* ptr_ = nullptr; Box() = default; Box(Box const&) = delete; Box& operator=(Box const&) = delete; Box(Box&& other) { ptr_ = other.ptr_; other.ptr_ =...
C++
UTF-8
1,066
2.59375
3
[]
no_license
#include<Wire.h> #include<LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x3F,16,2); //first parameter address , and 16 x 2 lcd #include "DHT.h" #define DHTTYPE DHT11 #define dht_pin 0 DHT dht(dht_pin , DHTTYPE); //---------------------------------------------------------------------------------------- void setup() { /...
Markdown
UTF-8
1,322
3.203125
3
[]
no_license
## Ruby Refresher #### A series of rspec tests to pass. This challenge was set on week 7 at Makers Academy. We had spent the previous two weeks on Javascript so this refresher challenge was set before we revisited Ruby. - [x] Questions 1-10 complete - [x] Questions 11-20 complete - [x] Questions 21-30 complete - [ ]...
TypeScript
UTF-8
1,353
2.6875
3
[]
no_license
import { AllianceFleet } from "../domain/AllianceFleet"; import { Satellite } from "../domain/Satellite"; import { IRepository } from "../repository/IRepository"; export class TopSecretController { private repository: IRepository constructor(repository: IRepository) { this.repository = repository; ...
Java
UTF-8
23,809
3.265625
3
[]
no_license
package IC.Visitors; import java.util.*; import IC.AST.*; import IC.SymbolTable.*; import IC.TypeTable.*; /** * Visitor for building all Symbol tables (Global, class, method and block), and check: * - illegal symbol redefinitions * - illegal shadowing * - illegal methods overriding * - existence and uniqueness ...
Python
UTF-8
331
4.3125
4
[]
no_license
#Name: Dante Rivera #Date: August 27th, 2018 #This program draws an octagon using the turtle module when run #Importing turtle module import turtle #Creating a turtle and naming it dat_t = turtle.Turtle() # Move turtle 5 times forward 150 units, and 144deg to the right for i in range(5): dat_t.forward(150) ...
C#
UTF-8
944
2.8125
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace PruebaSuma { public partial class Form1 : Form { public Form1() { ...
Java
UTF-8
2,116
3.40625
3
[]
no_license
package com.nexusy.algorithms.string; /** * @author lanhuidong * @since 2019-04-02 */ public class Msd { private static final int radix = 256; private static final int m = 15; private static String[] aux; private static int charAt(String s, int d) { return d < s.length() ? s.charAt(d) : -1...
Python
UTF-8
612
3.109375
3
[]
no_license
# coding : utf-8 from selenium import webdriver # 导入 webdriver ,相当于加载了 webdriver 里面所有的方法 import time # 导入 time 包 driver = webdriver.Chrome() # 创建 chrome 对象 driver.get("https://www.csdn.net/") time.sleep(3) # 网页打开后等待停止3秒 driver.set_window_size(800,600) # 固定大小显示 dri...
Java
UTF-8
6,043
2.5625
3
[]
no_license
package paneles; import javax.swing.JPanel; import java.awt.Color; import javax.swing.JLabel; import javax.swing.JOptionPane; import java.awt.Font; import java.awt.SystemColor; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import javax.swing.JTextField; import javax.swing.JBut...
JavaScript
UTF-8
9,096
2.625
3
[ "Apache-2.0" ]
permissive
var SamsungRemote = require('samsung-remote'); var inherits = require('util').inherits; var Service, Characteristic, VolumeCharacteristic, ChannelCharacteristic, KeyCharacteristic; module.exports = function(homebridge) { Service = homebridge.hap.Service; Characteristic = homebridge.hap.Characteristic; // we can on...
Swift
UTF-8
7,552
2.703125
3
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// // SweetHMAC.swift // SweetHMAC // // Copyright (c) 2014 Jan Cassio. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without...
PHP
UTF-8
378
2.78125
3
[]
no_license
<?php $wage = (10); $regular_hours = (40); $overtime = (2); $overtime = (2); $pay += ($overtime * $wage * 1.5); $pay += ($regular_hours + $overtime) * $wage; echo "hours worked: " . $regular_hours . "<br>"; echo "pay rate: $" . number_format($wage, 2) . "<br>"; echo "overtime hours: " . $overtime . "<br>"; echo "...
Java
UTF-8
3,248
1.851563
2
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
package io.jenkins.plugins.opentelemetry.job; import hudson.EnvVars; import hudson.Extension; import hudson.model.Run; import io.jenkins.plugins.opentelemetry.JenkinsOpenTelemetryPluginConfiguration; import io.jenkins.plugins.opentelemetry.semconv.OTelEnvironmentVariablesConventions; import io.opentelemetry.api.trace....
Markdown
UTF-8
3,646
2.921875
3
[]
no_license
#0x00. AirBnB clone - The console# Welcome to the AirBnB clone project! (The Holberton B&B) In this project we are going to create the first part of the Airbnb clone, for this you want to create a console where you can manage Airbnb objects or instances. #CONSOLE FUNCTIONALITIES# Create a new object (ex: a new User...
Shell
UTF-8
1,805
3.890625
4
[]
no_license
#!/bin/sh # # Music Box boot script # # (c) 2021 Yoichi Tanibayashi # MYNAME=`basename $0` MUSICBOX_CMD=$HOME/bin/MusicBox ENV_FILE=$HOME/musicbox-env . $ENV_FILE LOGDIR=$MUSICBOX_LOG_DIR BOOT_FLAG=1 DEBUG_FLAG= # # functions # echo_do() { _TS=`date +'%F %T'` echo "$_TS $*" eval "$*" return $? } u...
Java
UTF-8
2,262
2.890625
3
[]
no_license
package com.example.spinnercalculator; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; public class Main...
C++
UTF-8
1,417
3.25
3
[]
no_license
#pragma once #include "SFML\Graphics.hpp" #include <iostream> #include <vector> using namespace std; class Tooltip { public: Tooltip(sf::Vector2f pos, std::string message, float zoom) { arialFont.loadFromFile("Textures/Fonts/arial.ttf"); string.setString(message); string.setCharacterSize(20 * zoom); strin...
Markdown
UTF-8
1,977
2.59375
3
[]
no_license
# Bug de Hadoop sous Windows L'utilisation de Hadoop sous Windows entraîne la levée d'une exception de type IOException (Failed to set permissions of path: ```diff -\tmp\hadoop-user\mapred\staging\user722309568\.staging to 0700). ``` C'est un bug connu de Hadoop (cf. https://issues.apache.org/jira/browse/HADOOP-...
Java
UTF-8
5,627
2.484375
2
[]
no_license
package com.whut.util; import java.io.File; import java.io.FileNotFoundException; import android.app.Activity; import android.app.AlertDialog; import android.content.ContentResolver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.conten...
C
UTF-8
995
3.5625
4
[]
no_license
#include<stdio.h> #include<stdlib.h> typedef struct{} Key; typedef struct { int number; Key k; }Element; typedef struct Node{ int e; struct Node* next; }Node; typedef struct{ Node* head; Node* tail; int size; }SeqList; SeqList newList(); // creates an empty list SeqList insertInOrder(SeqList sl, int e); /...
Python
UTF-8
361
2.828125
3
[]
no_license
file = open("core_java1.txt") flag = True lines = file.readlines() f = "" for line in lines: f = f + line file.close() ending = f.find("}") while(ending != -1): starting = f[:ending].rfind("{") if ending - starting > 50: print ending - starting print f[starting: ending] f = f[:starting] + f[ending + 1:] # p...
JavaScript
UTF-8
347
2.515625
3
[]
no_license
class Menu extends Phaser.Scene { constructor() { super("start_menu"); } create() { this.add.text(300, 300, "Press SPACE to start"); gameStartButton = this.input.keyboard.addKey('SPACE'); } update() { if (gameStartButton.isDown) { this.scene.start("main...
Markdown
UTF-8
1,269
2.890625
3
[]
no_license
# 发起GET/POST/PUT/DELETE请求 # ## 注意 ## - GET方法参数通过Query传递 - POST方法参数通过Body传递 - PUT方法参数通过Body传递 - DELETE方法参数通过Query传递 - 能够携带自定义Header - (path中的query会被合并到Query或者Body里) ## 发起请求 ## 准备一些自定义Header信息 $headers = array( 'X_API_TEST1' => 'A', 'X_API_TEST2' => 'B' ); 通过category获取Apple...
Python
UTF-8
8,400
2.546875
3
[]
no_license
# -*- coding: utf-8 -*- import os import sys import json import pandas as pd import numpy as np from category.categoryManager import categoryManager from spider.common.dealRecordModel import * # NOTE:取值是 “历史成交” global_name = '华宝证券' # 0. 定义预期数据。所有 suppose 开头的变量都是需要验证的内容。当与预期不符时,程序应该报错并终止 # # 预期文件的全部列名(第一次是从 xlsx 中复...
Python
UTF-8
98
3.578125
4
[]
no_license
# 常用函数 numbers = [100,200,300] print(len(numbers)) print(max(numbers)) print(min(numbers))
C++
UTF-8
1,326
3.109375
3
[]
no_license
const int pin = 2; // 开关引脚 const int pin2 = 13; // 电路部分正向电压引脚 const float V_all = 5.0; // 最大电压 int flag = 1; // 控制系统开关 void setup() { Serial.begin(9600); pinMode(pin, INPUT_PULLUP); //设置引脚为内部上拉输入模式 pinMode(pin2, OUTPUT); // 控制电压 } void loop() { /* 开关部分,控制开关 */ float time= pulseIn(pin, LOW,60000000)...
Java
UTF-8
1,612
2.8125
3
[]
no_license
package tyu.common.utils; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; public class TyuObjectSerilizer { static Object tmpValue = new Object(); /** * @param aObj * @param...
Java
UTF-8
432
2.75
3
[]
no_license
package service.validator.impl; import model.User; import service.validator.Validator; public class UsernameValidator implements Validator<User> { private static final int MIN_LENGTH = 5; @Override public void validate(User user) { if(user.getUsername().length() < MIN_LENGTH) throw new...
Markdown
UTF-8
29,086
2.90625
3
[]
no_license
请求和响应 Requests and Responses ====================== Scrapy 使用 `Request` 和 `Response` 对象来爬取网页。 Typically, :class:`Request` objects are generated in the spiders and pass across the system until they reach the Downloader, which executes the request and returns a :class:`Response` object which travels back to the spider...
C#
UTF-8
1,455
2.546875
3
[ "WTFPL" ]
permissive
using System.Collections.Generic; using System.Threading.Tasks; using SharpExchange.Api.V22.Types; namespace SharpExchange.Api.V22.Endpoints { public static class Posts { /// <summary> /// Gets all posts on a site. /// </summary> public static Task<Result<Post[]>> GetAllAsync(QueryOptions options = null) ...
Python
UTF-8
1,049
2.671875
3
[ "Apache-2.0" ]
permissive
from sklearn.metrics import confusion_matrix def cohen_kappa_score(y1, y2, labels=None, weights=None): confusion = confusion_matrix(y1, y2, labels=labels) n_classes = confusion.shape[0] sum0 = np.sum(confusion, axis=0) sum1 = np.sum(confusion, axis=1) expected = np.outer(sum0, sum1).astype(np.doubl...
Java
UTF-8
819
3.40625
3
[]
no_license
package LeetCode_728; import java.util.LinkedList; import java.util.List; public class Solution { public List<Integer> selfDividingNumbers(int left, int right) { List<Integer> result = new LinkedList<>(); for (int i = left; i <= right; i++) { if (isDiviedNum(i)) { resul...
Markdown
UTF-8
2,384
2.8125
3
[]
no_license
# Article R6323-1 I.-Pour les salariés dont la durée de travail à temps plein est fixée en application d'un accord d'entreprise ou de branche, le nombre d'heures de travail de référence pour le calcul de l'alimentation du compte personnel de formation est égal à la durée conventionnelle de travail. II.-Pour les sala...
JavaScript
UTF-8
2,041
3.734375
4
[]
no_license
//****************************************************************** // almanzas.js //****************************************************************** var counter = 1; var driveup = 1; setTimeout(counterOrder, 1000);//Counter customer at second 1 setTimeout(counterOrder, 2000);//Counter customer at second 2 setTime...
Python
UTF-8
586
2.515625
3
[]
no_license
from pynput import keyboard, mouse from pynput.keyboard import Key import time keyboard = keyboard.Controller() mouse = mouse.Controller() wait = 0.1 keyboard.press(Key.cmd) keyboard.press(Key.space) keyboard.release(Key.cmd) keyboard.release(Key.space) time.sleep(wait) keyboard.type("terminal") time.sleep(wait) k...
Python
UTF-8
553
3.078125
3
[]
no_license
class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class CheckBalance: def __init__(self): self.res = True def check(self, root): t = self.getHeight(root, 1) return self.res def getHeight(self, root, level=1): ...
Java
UTF-8
691
2.828125
3
[]
no_license
package pass; import java.util.Arrays; import pass.TreeNode; public class lc108 { public TreeNode sortedArrayToBST(int[] nums) { int length = nums.length; if (length == 0) return null; if (length == 1) return new TreeNode(nums[0]); int start = 0; int end = length - 1; ...
Markdown
UTF-8
6,938
2.84375
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: Ställ en fråga data kan svara titleSuffix: ML Studio (classic) - Azure description: Lär dig att formulera en skarp datavetenskap fråga i Data Science för nybörjare video 3. Inkluderar en jämförelse av klassificerings- och regressionsfrågor. services: machine-learning ms.service: machine-learning ms.subservic...
C#
UTF-8
12,267
2.84375
3
[]
no_license
using System; using System.Collections.Generic; using System.Data; using System.Linq; namespace YiTui.DAL { /// <summary> /// 貌似这玩意不好用??排不出结果??? /// </summary> class scoreComparer : IComparer<double> { public int Compare(double x, double y) { return x < y ? 1 : (x == y ?...
Java
UTF-8
1,193
2.984375
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 Figuras; import java.awt.Color; /** * * @author eduardobaldivieso */ public class Empty extends Block{ private boolean...
C
UTF-8
553
3.59375
4
[]
no_license
/* * Program to print the matrix in spiral form * */ #include<stdio.h> int main() { int arr[100][100],i,j,m,n; printf("Enter the dimensions : "); scanf("%d %d",&m,&n); for(i=0;i<m;i++) { for(j=0;j<n;j++) { scanf("%d",&arr[i][j]); } } for(i=0;i<m;i++) { /* if(i%2) { ...
Shell
UTF-8
1,625
3.390625
3
[]
no_license
function git_url() { if [ -d ".git" ] || git rev-parse --git-dir > /dev/null 2>&1; then url=`git config --get remote.origin.url` echo " * $url" fi } function git_branch() { if [ -d ".git" ] || git rev-parse --git-dir > /dev/null 2>&1 ; then branch...
JavaScript
UTF-8
1,930
2.5625
3
[ "MIT" ]
permissive
"use strict"; var fs = require("fs"); var utils = require('./utils'); var tasklogic = { getPrefix: function (mode) { return mode === 'repeat' ? 'repeatTask' : 'dailyTask'; }, writeTypeToFile: function (obj) { fs.writeFileSync('conf/tasksTypelist.json', obj, 'utf-8'); }, readTypeFromFile: function () {...
Markdown
UTF-8
11,935
2.953125
3
[]
no_license
# Devcards Devcards aims to provide ClojureScript developers with an interactive visual REPL. Devcards makes it simple to interactively surface code examples that have a visual aspect into a browser interface. Devcards is **not** a REPL, as it is driven by code that exists in your source files, but it attempts to pr...
Shell
UTF-8
1,855
2.71875
3
[]
no_license
#!/bin/bash # variables TITLE1=$1 TITLE2=$2 TITLE3=$3 TITLE4=$4 Release=$5 CODE=$6 YEAR=$(date +"%Y") DATE=$(date +"%x") # cover # make images # screenshots ORDER="ffmpeg -ss 00:03:00 -i "$TITLE1".avi -q:v 0 -vframes 1 "$TITLE1".jpg" $ORDER ORDER="ffmpeg -ss 00:03:00 -i "$TITLE2".avi -q:v 0 -vframes 1 "$TITLE2"...
Python
UTF-8
799
3.703125
4
[]
no_license
import cv2 # path path = './Babol/1071.jpg' # Reading an image in grayscale mode image = cv2.imread(path, 1) # Window name in which image is displayed window_name = 'Image' # Start coordinate, here (100, 50) # represents the top left corner of rectangle start_point = (658, 413) # Ending...
C
UTF-8
351
3.03125
3
[]
no_license
#include "../include/cthread.h" #include <stddef.h> #include <stdio.h> void* mythread(void*); int main() { int thread1 = ccreate(mythread, (void*)1, 2); int thread2 = ccreate(mythread, (void*)2, 1); printf("main: i'm back!!!\n"); return 0; } void* mythread(void* arg) { printf("mytrhead: hello world (%d)\n...
SQL
UTF-8
102
2.875
3
[]
no_license
SELECT DISTINCT 'laptop' AS type, model, speed FROM laptop WHERE speed < ALL(SELECT speed FROM pc)
Python
UTF-8
2,870
2.859375
3
[]
no_license
#!/usr/bin/env python3 import os import random import imageio import time import numpy as np # For visualization and stuff import cv2 def LCD_ShowImageAsArray(Image,Xstart,Ystart): if (Image.all() == None): return imwidth = Image.shape[0] # width imheight = Image.shape[1] # height if imwidth !=...
JavaScript
UTF-8
3,934
2.96875
3
[]
no_license
function makeReservation(selector) { $("#submit").on('click', submitInformation); $("#continue").on("click", continueReservation) let fullName = $("#fullName"); let email = $("#email"); let phoneNumber = $("#phoneNumber"); let address = $("#address"); let postalCode = $("#postalCode") f...
Python
UTF-8
1,418
3.53125
4
[ "Apache-2.0" ]
permissive
import os from IOC import * class Component(object): """ Symbolic base class for components """ class Bar(Component): con = RequiredFeature('Console', hasMethods('WriteLine')) title = RequiredFeature('AppTitle', isInstanceOf(str)) user = RequiredFeature('CurrentUser', isInstanceOf(str)) def ...
Go
UTF-8
1,641
2.9375
3
[ "BSD-3-Clause" ]
permissive
package main import ( "bytes" "encoding/base64" "fmt" "log" "github.com/buaazp/fasthttprouter" "github.com/ikozinov/fasthttp" ) var basicAuthPrefix = []byte("Basic ") // BasicAuth is the basic auth handler func BasicAuth(h fasthttprouter.Handle, user, pass []byte) fasthttprouter.Handle { return fasthttproute...
Ruby
UTF-8
397
2.625
3
[]
no_license
module Memory class Base attr_accessor :errors def validate_presence_of(params, *required_attributes) @errors = {} required_attributes.each do |attr| @errors[attr] = "#{attr.to_s.capitalize} is required" if blank(params[attr]) end end def valid? @errors.empty? en...
Python
UTF-8
443
2.71875
3
[ "MIT" ]
permissive
#!/usr/bin/env python3.6 import uuid from pykeepass import PyKeePass # load database kp = PyKeePass('./test.kdbx', password='test') # find by title entry = kp.find_entries(title='id_rsa', first=True) print(entry.title) # find by path entry = kp.find_entries(path='dir1/dir2/id_rsa', first=True) print(entry.path) # f...
C
UTF-8
1,172
3.53125
4
[]
no_license
#include <avr/io.h> #include <util/delay.h> //Defining constants: #define SET_DDG1 0x02 // Set bit 1 to output in DDRG #define SET_PORTG1 0x02 // Set bit 1 to output in PORTG #define TRUE 1 #define FREQUENCY 16000000 // Microprocessor frequency 16MHz #define CYCLES 7 // Nu...
Python
UTF-8
360
3.609375
4
[]
no_license
def getVolumeOfCubiod(length, width, height): return length * width * height print(getVolumeOfCubiod(1, 2, 2), 4) print(getVolumeOfCubiod(6.3, 2, 5), 63) ''' # Details Bob needs a fast way to calculate the volume of a cuboid with three values: length, width and the height of the cuboid. Write a function...
JavaScript
UTF-8
1,914
2.5625
3
[]
no_license
const express = require('express'); const router = express.Router(); const Company = require('../models/Company'); // @route GET api/company/showcompanies // @description Get all companies // @access Public const getAllCompanies = async (req, res) => { //console.log(rech) Company.find() .populate('company_id'...
Java
UTF-8
1,005
2.078125
2
[]
no_license
package com.java.mapper; import com.github.pagehelper.Page; import com.java.bean.Student; import com.java.bean.StudentSO; import com.java.bean.base.Query; import java.util.List; /** * 学生管理Mapper * * @author yupan@yijiupi.cn * @date 2018/8/29 20:57 */ public interface StudentMapper { /** * 查询学生信息列表 ...
Python
UTF-8
705
4.25
4
[]
no_license
def binary_search(arr, start, end, num): if(end > start): mid = int((start + end) / 2) if (arr[mid] < num): new_start = mid + 1 binary_search(arr, new_start, end, num) elif (arr[mid] > num): new_end = mid - 1 binary_search(arr, st...
Java
UTF-8
582
2.109375
2
[]
no_license
package data; /** * Created by Olga Pavlova on 10/22/2015. */ public class Factory { /* private static TesttableDAO testtableDAO = null; private static Factory instance = null; public static synchronized Factory getInstance(){ if (instance == null){ instance = ne...
SQL
UTF-8
2,065
3.625
4
[]
no_license
/* 用root用户登录系统,执行脚本*/ /*root pwd:123456*/ /*创建数据库*/ create database chat; /*选择数据库*/ use chat; /*增加用户chat_root*/ /*创建用户'chat_root'密码为'asdzxc123' 拥有操作数据库chat的所有权限*/ create user char_root@"%" identified by 'asdzxc123'; grant all privileges on chat.* to char_root@"%"; flush privileges; /* grant select,i...
JavaScript
UTF-8
1,484
2.71875
3
[ "Apache-2.0" ]
permissive
function getFAQs() { fetch('http://localhost:3001/faqs') .then(response => { return response.text(); }) .then(data => { console.log(JSON.parse(data)); }); } function createMerchant() { let name = prompt('Enter merchant name'); let email = prompt('Ente...
Markdown
UTF-8
1,555
3.34375
3
[]
no_license
# FileSystem 延伸:支援隨機存取 <br> --- <br> FileSystem 的 `open()` 方法回傳的是`FSDataInputStream` 這個類別支援隨機存,所以可以讀取資料中的任一位置。 <br> ```java public class FileSystemDoubleCat { public static void main(String[] args) throws IOException { String url = "hdfs://localhost:9000/user/johnny/test.txt"; Configuration...
Python
UTF-8
949
2.9375
3
[ "MIT", "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
from typing import Text class RasaException(Exception): """Base exception class for all errors raised by Rasa Open Source.""" class RasaCoreException(RasaException): """Basic exception for errors raised by Rasa Core.""" class RasaXTermsError(RasaException): """Error in case the user didn't accept the ...
SQL
UTF-8
916
3.59375
4
[]
no_license
-- // create_users -- Migration SQL that makes the change goes here. CREATE TABLE users ( id INT(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, account_id INT(20) UNSIGNED, username VARCHAR(25) NOT NULL UNIQUE, nick_name VARCHAR(25), email VARCHAR(255)...
Java
UTF-8
476
2.265625
2
[]
no_license
package com.huatec.hiot_cloud.test.mvptest.model; import java.io.Serializable; public class Guess implements Serializable { private int realNum; private int yourGuess; public int getRealNum() { return realNum; } public void setRealNum(int realNum) { this.realNum = realNum; } ...
Python
UTF-8
1,516
3.421875
3
[]
no_license
def sock_merchant(unpaired_socks): pairs = 0 for sock in set(unpaired_socks): total_count_of_current_sock = unpaired_socks.count(sock) pairs += total_count_of_current_sock//2 print(pairs) # sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20]) # sock_merchant([50, 20, 30, 90, 30, 20, ...
Java
UTF-8
537
1.53125
2
[ "MIT" ]
permissive
package com.jtbdevelopment.games.mongo.dao; import com.jtbdevelopment.games.dao.AbstractMultiPlayerGameRepository; import com.jtbdevelopment.games.mongo.state.AbstractMongoMultiPlayerGame; import org.bson.types.ObjectId; import org.springframework.data.repository.NoRepositoryBean; /** * Date: 1/9/15 Time: 10:51 PM ...
Markdown
UTF-8
2,943
2.671875
3
[]
no_license
## CoordinatorLayout 及其控件属性 ### 基本结构 ```xml <CoordinatorLayout> <AppbarLayout> <CollapsingToolbarLayout>            <!--可自定义的expendedView,一般用FrameLayout包裹,需要设置固定高度--> <FrameLayout/> <Toolbar/> </CollapsingToolbarLayout> </AppbarLayout> <ScrollView/> </...
Java
UTF-8
375
2.171875
2
[]
no_license
package com.learning.animaldb.animal.db; import java.util.List; import com.learning.animaldb.animal.Animal; /** * Created by Тичер on 08.06.2017. */ public interface AnimalsDao { long insertAnimal(Animal animal); List<Animal> getmAnimals(); Animal getAnimalById(long id); int updateAnimal(Animal...
Markdown
UTF-8
16,380
2.9375
3
[]
no_license
--- title: 超全面详细一条龙教程!从零搭建 React 项目全家桶(下篇) date: 2020-02-09 description: React 是近几年来前端项目开发非常火的一个框架,其背景是 Facebook 团队的技术支持,市场占有率也很高。很多初学者纠结一开始是学 react 还是 vue。个人觉得,有时间的话,最好两个都掌握一下。从学习难度上来说,react 要比 vue 稍难一些。万事开头难,但是掌握了 react 对于大幅提高前端技能还是非常有帮助的。本文一步步详细梳理了从创建 react、精简项目、集成插件、初步优化等过程。对于 react 开发者来说,能够节省很多探索的时间。下面请跟着我来一步步操作。 ...
TypeScript
UTF-8
1,274
2.796875
3
[ "MIT", "OFL-1.1" ]
permissive
import { promises } from 'fs'; import { PathLike, constants } from 'fs'; import { dirname, resolve, join, basename } from 'path'; const { readFile, writeFile, readdir, copyFile, access, mkdir, stat, unlink, rmdir } = promises; export { readFile, writeFile, readdir, copyFile }; export { PathLike }; export { jo...
C++
UTF-8
1,370
3.15625
3
[]
no_license
#include <iostream> using namespace std; bool safetoplace(int board[][9], int r, int c, int num){ for(int i=0; i<9; i++){ if(board[i][c]==num || board[r][i]==num){ return false; } } int sx= r-r%3; int sy= c-c%3; for(int x=sx; x<sx+3; x++){ for (in...
C#
UTF-8
768
3.421875
3
[]
no_license
//using System; //using System.Collections.Generic; //using System.Linq; //using System.Text; //using System.Threading.Tasks; //using static System.Console; //namespace ConsoleApp7 //{ // class String_Slice // { // static void Main(string[] args) // { // string greeting =...
TypeScript
UTF-8
561
2.71875
3
[]
no_license
import Texture from "./Texture"; enum MaterialTexture { DIFFUSE, SPECULAR, NORMAL, DISPLACEMENT }; export interface MaterialInitializer { diffuse: Texture; specularIntentisy? : number; specularPower? : number; normal?: Texture; displacement?: Texture; displacementMapScale?: number; displacementMapBias?: ...
Shell
UTF-8
922
3.328125
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "OpenSSL" ]
permissive
#!/usr/bin/env bash # # Copyright 2019 YugaByte, Inc. and Contributors # # Licensed under the Polyform Free Trial License 1.0.0 (the "License"); you # may not use this file except in compliance with the License. You # may obtain a copy of the License at # # https://github.com/YugaByte/yugabyte-db/blob/master/licenses/P...
Markdown
UTF-8
2,735
2.59375
3
[ "MIT" ]
permissive
--- layout: post #event information title: "Global CFP Diversity Day - Feb, 2018" cover: "../assets/index.jpg" date: 2018-02-03 start_time: "14:00" end_time: "17:00" #event organiser details organiser: "Sriram" categories: "event" --- Hello World! In collaboration with Mozilla TN Community members, we conducte...
TypeScript
UTF-8
1,783
2.640625
3
[ "MIT" ]
permissive
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; import * as WebSocketWS from 'ws'; import { traceInfo } from '../../common/logger'; // We need to override the websocket that jupyter lab services uses to put in our cookie information // Do this as a function...
Shell
UTF-8
3,244
3.953125
4
[]
no_license
#!/bin/sh ## User name ################################################################################ ## If $USER is some long.username@institution.edu, define $SUSER to be the part ## before the '@' (or leave it unchanged if there is no '@'). export SUSER="${USER%@*}" ## Temporary directory ######################...
C++
UTF-8
732
2.8125
3
[]
no_license
#include <vector> #include <iostream> #include <deque> using namespace std; int compute(const vector<int> &a, const int d) { deque<int> q; int n = a.size(); int kq = 10000000; for (int i=0; i<n; i++) { if (!q.empty() && q.front() <= i - d) q.pop_front(); while (!q.empty() && a[q.back()]...
C++
UTF-8
3,998
3.015625
3
[ "MIT" ]
permissive
#ifndef _REACTIVE_VARIABLE_H_ #define _REACTIVE_VARIABLE_H_ #include "Reactable.h" namespace Reactivity { template<typename T> class ReactiveVariable : public Reactable<T> { public: //Default contructor for T ReactiveVariable() {} //Contructor with initial value for T ReactiveVariable(T initialValue) ...
Python
UTF-8
571
3.046875
3
[]
no_license
import numpy as np A=np.array([[2.0,-1.0,0.0],[1.0,6.0,-2.0],[4.0,-3.0,8.0]]).reshape(3,3) b=np.reshape(np.array([2.0,-4.0,5.0]),(3,1)) n=np.shape(A)[0] print("Matriz inicial: ") print(A) print("***********") for k in range(0,n-1): for i in range(k+1,n): if A[i,k] != 0.0 : lam = A[i,k]/A[k,k] print("lam= "+s...