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
2,236
3.21875
3
[]
no_license
import java.math.BigDecimal; /** * Created by jarockja on 24.01.2017. */ public class DecimalTestClass { public static void main(String[] argv){ // octal int int intValue = 034; // 28 in decimal int six = 06; // Equal to decimal 6 int seven = 07; // Equal to decimal 7 int eight =...
Java
UTF-8
385
2.046875
2
[]
no_license
package be.matthieu.mybasicsyncadapter.contracts; /** * Created by Matthieu on 10/02/2016. */ public class BaseContract { /*Definition des requets de base*/ protected static final String DEFAULT = " DEFAULT"; protected static final String TEXT_TYPE = " TEXT"; protected static final String INT_TYPE = ...
TypeScript
UTF-8
354
2.609375
3
[]
no_license
import styled from "styled-components"; import { number } from "prop-types"; interface TextProps { weight?: number; size?: number; } function getTextSize({ size = 16 }: TextProps) { return `${size}px`; } export const Text = styled.p<TextProps>` margin: 0; padding: 0; font-size: ${getTextSize}; font-wei...
JavaScript
UTF-8
411
4.125
4
[]
no_license
let array1 = Array.of(5, 3, 5, 6, 8); let array2 = [5, 3, 5, 6, 8]; console.log(array1, array2, array1 == array2); let newArray = Array.from(array2, val => val * 2); console.log(newArray); let array3 = Array(10); array3.fill(100); console.log(array3); let array4 = Array(10); array4.fill(100, 3, 8); console.log(a...
SQL
UTF-8
1,297
4.25
4
[]
no_license
--Age CREATE PROCEDURE EmployeeAge AS BEGIN SELECT name, count(*) AS value FROM ( select case WHEN datediff(YY,DateOfBirth,getdate())<20 THEN 'Below 20' WHEN datediff(YY,DateOfBirth,getdate())<20 THEN 'Below 20' WHEN datediff(YY,DateOfBirth,getdate()) BETWEEN 20 AND 30 THEN '20+' WHEN datediff(...
PHP
UTF-8
2,986
2.609375
3
[]
no_license
<?php $ename=$_POST ['ename']; $ecode=$_POST ['ecode']; $loc=$_POST ['loc']; $dep=$_POST ['dep']; $rh=$_POST ['rh']; $hd=$_POST ['hd']; $nd=$_POST ['nd']; $ph=$_POST ['ph']; $gs=$rh*$hd*$nd; $tax=$gs*0.1; $healthIns=$gs*0.05; $EPF=1800; $Total_Deduction=$tax+$healthIns+$EPF; $ns=$gs-$Total_Deduction; ?> <!DOCTYPE h...
Shell
UTF-8
7,935
3.65625
4
[]
no_license
#!/bin/bash # # Program : EvoCyclone LCD Service # : RESISTANCECOVID.COM # : https://github.com/libre/resistancecovid/evocyclo/ # Author : Deraoui Said <said.deraoui@gmail.com> # Purpose : # Parameters : --help # : --version # # Notes : See --help for detail...
Java
UTF-8
997
2.484375
2
[]
no_license
package nhn.cistory.util; import java.util.ArrayList; import java.util.HashMap; import nhn.cistory.vo.Qobtr; public class CalcScore { public CalcScore(){} public int calculate(ArrayList<Qobtr> list){ int score = 0; Qobtr qt = null; for(int i = 0 ; i < list.size() ; i ++){ qt = new Qobtr(); qt = list...
Java
UTF-8
4,552
2.1875
2
[]
no_license
package adam.mathandnumbers; import android.app.FragmentTransaction; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import java.io.File; import java.util.HashMap; import java.util.Map; import adam.mathandnumber...
C#
UTF-8
3,186
3.265625
3
[ "MIT" ]
permissive
using System; using System.ComponentModel; using System.Globalization; namespace sabatex.Extensions.ClassExtensions { public static class DateTimeExtension { public static DateTime BeginOfDay(this DateTime dt) { return new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0); } ...
JavaScript
UTF-8
1,348
3.8125
4
[]
no_license
/* Team BigFish - Jeffrey Wu and Dennis Chen SoftDev1 pd6 K29 -- Sequential Progression II: Electric Boogaloo... 2018-12-19*/ var fibonacci = function(n) { var sum = [0,1] for (var i = 2; i <= n; i++) { sum.push(sum[i-2] + sum[i-1]); } return sum[sum.length - 1] }; var gcd = function(a,b) { if (a > b) {...
JavaScript
UTF-8
1,998
3.0625
3
[]
no_license
// browser-sync start --server --directory --files "**/*" let mediator = ( function () { const subscribe = function( channel, fn ) { if ( typeof mediator.channels[ channel ] === 'undefined' ){ mediator.channels[ channel ] = []; } mediator.channels[ channel ].push({ context: this, callback: fn });...
Java
UTF-8
493
2.0625
2
[]
no_license
package com.syndhacathon.awsomecoders.repository; import com.syndhacathon.awsomecoders.entity.Agent; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; @Repository public interface AgentRepositor...
TypeScript
UTF-8
197
2.96875
3
[]
no_license
function clone<T>(data:T):T { //声明 T 类型(自定义),传入T类型则返回也是T类型 ;三者必须相同 return JSON.parse(JSON.stringify(data)) } export default clone;
Shell
UTF-8
11,831
3.671875
4
[]
no_license
#!/bin/bash banner() { echo "+------------------------------------------+" printf "| %-40s |\n" "`date`" echo "| |" printf "|`tput bold` %-40s `tput sgr0`|\n" "$@" echo "+------------------------------------------+" } #--- apache --- banner "Installing Apache2" sudo ap...
Python
UTF-8
6,306
3.890625
4
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- import math class MathOperations: """Различные математические операции""" @staticmethod def sma(points: list, cur_position: int, diff: int) -> float: """SMA: Простое скользящее среднее Это тоже самое, что и среднее арифметическое :...
Go
UTF-8
6,390
3.15625
3
[]
no_license
package claquete import ( "errors" "fmt" "math/rand" "regexp" "strconv" "strings" "time" "github.com/PuerkitoBio/goquery" "github.com/dsbezerra/claqueteapi/util" "github.com/gocolly/colly" ) // SearchFilterFlag is used to filter search results type SearchFilterFlag uint8 const ( // SearchFilterCinema res...
C#
UTF-8
3,500
2.515625
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using System.Web; using System.Web.Http; using System.Web.Http.Controllers; using System.Web.Http.Filters; using System.Web.Mvc; //...
Python
UTF-8
1,765
2.859375
3
[ "BSD-3-Clause" ]
permissive
# -*- coding: utf-8 -*- '''Helper utilities and decorators.''' import time from flask import flash def flash_errors(form, category="warning"): '''Flash all errors for a form.''' for field, errors in form.errors.items(): for error in errors: flash("{0} - {1}" .format(get...
JavaScript
UTF-8
2,978
4.375
4
[]
no_license
// Tableau Array // - Une variable povant avoir simultanément en ensemble de valeurs // // - Le premier indice du tableau est 0 function fun() { var tab = [2, 3, 4, 5]; // // Recuperer la taille du tableau console.log(tab.length) // //Afficher 1er élément du tableau console.log(tab[0]) // //...
Java
UTF-8
956
1.78125
2
[]
no_license
package com.zhss.eshop.promotion.service.Impl; import com.zhss.eshop.promotion.domain.dto.CouponDTO; import com.zhss.eshop.promotion.domain.dto.PromotionActivityDTO; import com.zhss.eshop.promotion.service.PromotionService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype....
Java
ISO-8859-1
6,220
2.515625
3
[ "MIT" ]
permissive
package presentacion.vistas.menu; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFra...
JavaScript
UTF-8
165
2.640625
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
var n = 0; (function() { function o() { while(i()); } var c; function i() { c && c[n++]; } i((c = 1)); })(); console.log(n);
Java
UTF-8
2,040
2.484375
2
[]
no_license
package objects; import java.util.LinkedList; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.utils.Pool.Poolable; import framework.Assets; import framework.Handler; import framework.ObjectId; import framewo...
PHP
UTF-8
773
2.765625
3
[]
no_license
<?php ini_set('error_reporting', E_ALL ^ E_NOTICE); define(RUTA, __DIR__ . DIRECTORY_SEPARATOR); $idHotel = 1; //vendrá via POST $fecha = '2017-03-21'; //vendrá via POST $reserva = 3; $doc = new DOMDocument(); $doc->load(RUTA . 'datos.xml'); $xpath = new DOMXPath($doc); $guardar = false; if ($result...
C#
UTF-8
2,034
2.953125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using StateLib.Infrastructure.State; namespace StateLib.Infrastructure { public class ClockSetup { private IClockSetup yearState; private IClockSetup monthState; private ...
C++
UTF-8
1,684
3.296875
3
[]
no_license
#include <iostream> using namespace std; // kelompok 8 : // Program pengisian data nilai-nilai // mahasiswa lengkap dari nilai absen, kuis, uts, // uas, dan akumulasi nilai dalam bentuk angka dan // pengelompokkan nilai berdasarkan huruf int main() { char nilai_huruf; int nilai_uas[10], absen[10], kuis[10...
C
UTF-8
264
2.65625
3
[]
no_license
#include <string.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int var = 15; void func(int *p) { p = &b; printf("inside : %d adress %d\n", *p, p); } int main() { int b = 100, *ptr = &b; func(ptr); printf("%d %d ", *ptr, ptr); }
Python
UTF-8
1,442
3.34375
3
[ "CC-BY-4.0", "MIT" ]
permissive
import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set() # Specify Parameters n_gen = 16 # Chance of having beneficial mutation r = 1e-5 # Total Number of Cells n_cells = 2**(n_gen-1) ai_samples = np.random.binomial(n_cells,r,size=100000) # print('AI mean:',np.mean(ai_samples)) # pr...
Markdown
UTF-8
2,763
2.640625
3
[]
no_license
# El mito de la alimentación “natural” Tal como afirmaba el maestro de la nutrición en nuestro país, el Profesor Grande Covián_,_ la adición del adjetivo _natural_ al nombre de un producto basta para convertirlo automáticamente en un alimento dotado de extraordinarias propiedades nutritivas, de las que el mismo produc...
Swift
UTF-8
2,546
2.78125
3
[]
no_license
// // HomeTrips.swift // HomeTrips // // Created by Ronan Furuta on 8/29/21. // import SwiftUI import ArrivalUI import ArrivalCore struct HomeTrips: View { @ObservedObject var appState: AppState @State var timeDisplayMode = TimeDisplayType.etd var body: some View { VStack { if (...
Python
UTF-8
19,194
2.515625
3
[]
no_license
import data_distributions as data_dist import DateFunctions.date_functions as dates import data_dist_database as db analytics_file_path = '\\\\filer01\\public\\Data_Analytics\\Data_Distributions\\temporary_files\\in_files\\' #Find the most recent sunday. This is for the week by week data pulls #since the weeks end on ...
C
UTF-8
6,103
3.046875
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <semaphore.h> #include "fifo.h" #include <signal.h> //#define SEMAPHORE 1 //Konstanten #define ALPHABET_LAENGE 26 #define SLEEP_CONSUMER 2 #define SLEEP_PRODUCER 3 //Mutex für den Zugriff auf den FIFO Puffer static pthread_mutex_t fifo_mutex = PTHR...
Java
UTF-8
2,245
3.25
3
[]
no_license
package contest.contest102; import java.util.HashSet; import java.util.Set; public class Problem906_3 { private static final Set<Integer> set = new HashSet<>(); private boolean isPalindrome(long num) { long right = 0; while (num > right) { right = right * 10 + num % 10; ...
JavaScript
UTF-8
3,877
3.46875
3
[]
no_license
//Функция обновления содержимого массива function UpdatePanel() { //Сначала очищается содержимое панели let panel = document.getElementById("conveyor_panel"); panel.innerHTML = ""; //Запрос, на получение нового содержимого var xhr = new XMLHttpRequest(); xhr.open('POST', "https://localhost...
C#
UTF-8
339
2.578125
3
[]
no_license
using System; using MicrosoftDI.Contracts; namespace MicrosoftDI { public class GameMovement : IMovement { private ILogger logger; public GameMovement(ILogger logger) { this.logger = logger; } public void Move() { logger.Log("Moving"); ...
C#
UTF-8
6,269
2.90625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Console2048 { /// <summary> /// 游戏核心类,负责处理游戏核心算法,与界面无关 /// </summary> class GameCore { //字段 属性 构造函数 private int[,] map; private int[] mergeArray; ...
Java
UTF-8
696
2.234375
2
[]
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 semestralnipracedbs; /** * * @author linvo */ public class Table { public static class DataRequest { ...
C#
UTF-8
8,282
2.765625
3
[]
no_license
using MVVMSample.Infrastructure.Interfaces; using MVVMSample.Infrastructure.Wizard; using MVVMSample.Model; using MVVMSample.Model.Interfaces; using Products = MVVMSample.Model.Products; namespace MVVMSample.ViewModels.Wizards.Product { /// <summary> /// Parent Wizard that handles adding the steps and coordin...
Java
UTF-8
1,120
2.03125
2
[]
no_license
package com.rxjava.nan.rxjava_demo01.network; import com.rxjava.nan.rxjava_demo01.request.UserBaseInfoResponse; import com.rxjava.nan.rxjava_demo01.request.UserExtraInfoResponse; import com.rxjava.nan.rxjava_demo01.response.LoginResponse; import com.rxjava.nan.rxjava_demo01.response.RegisterResponse; import java.util...
C++
UTF-8
1,805
2.859375
3
[]
no_license
#include <ArduinoRS485.h> #define LEDpinA 13 //PB5 #define LEDpinB 12 //PB4 #define LEDpinC 11 //PB3 #define LEDpinD 10 //PB2 boolean LEDpinA_state; boolean LEDpinB_state; boolean LEDpinC_state; boolean LEDpinD_state; int key = 0; int temp; int sensor = 0; void setup() { Serial.begin(9600); while (!Serial); RS...
C#
UTF-8
810
3.09375
3
[ "MIT" ]
permissive
using System; using EPubLibraryContracts; namespace EPubLibrary.PathUtils { public class PathElement : IPathElement { private readonly PathType _pathType; private readonly string _name; public PathElement(string name, PathType type) { if (string.IsNullOrEmpty(name...
Markdown
UTF-8
5,476
2.703125
3
[]
no_license
## Global Temperature Anomaly: Time Series Modeling #### Lucas Dwyer ##### https://github.com/AuraSinis/global_temperature_anomaly_forecasting ## Executive Summary #### Problem Statement - The potential impacts of climate change affect many facets of our everyday lives. - One important metric one can us...
Python
UTF-8
707
3.375
3
[]
no_license
# encoding: utf-8 """ @project:data_structure_and_algorithm @author: Jiang Hui @language:Python 3.7.2 [GCC 7.3.0] :: Anaconda, Inc. on linux @time: 2019/8/6 20:30 @desc: """ class Solution(object): def printMinNumber(self, nums): """ :type nums: List[int] :rtype: str """ ...
Java
UTF-8
2,284
3.6875
4
[]
no_license
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class Hop { public static void main(String[] args) { if (0 < args.length) { String filename = args[0]; Fi...
Python
UTF-8
439
3.34375
3
[]
no_license
from tkinter import* import random tk = Tk() canvas = Canvas(tk, width=400, height=400) canvas.pack() def rectangulo_aleatorio(ancho,alto, relleno): x1 = random.randrange(ancho) y1 = random.randrange(alto) x2 = x1 + random.randrange(ancho) y2 = y1 + random.randrange(alto) canvas.create_recta...
JavaScript
UTF-8
313
2.859375
3
[]
no_license
function treeHeight(root) { if ( !root ) return -1; if ( !root.left && !root.right ) return 0; let left = 0; let right = 0; if (root.left) left = treeHeight(root.left) + 1; if (root.right) right = treeHeight(root.right) + 1; return Math.max(left, right); } module.exports = { treeHeight };
C#
UTF-8
4,004
3.46875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using TrainingModel.Models; namespace TrainingSolution { class Program { static void Main(string[] args) { Console.WriteLine("************** Course Name [Course ID]************************"); var courses...
SQL
UTF-8
1,946
3.359375
3
[]
no_license
CREATE TABLE purchase ( pur_num NUMERIC(8,0), sup_id VARCHAR(8), complete_date VARCHAR(8), item_num NUMERIC(8,0), quantity NUMERIC(8,0), unit_cost NUMERIC(8,0), note VARCHAR(20), PRIMARY KEY (pur_num, complete_date) ); CREATE TABLE factory ( fac_id VARCHAR(8), fac_name VARCHAR(15), address VARCH...
Rust
UTF-8
2,638
2.96875
3
[ "MIT" ]
permissive
use std::marker::PhantomData; use macroquad::prelude::{is_key_down, KeyCode, Vec2}; use rand::{rngs::ThreadRng, Rng}; use crate::entity::creature::Creature; use crate::entity::{Object, Physics}; pub trait Controller<A> { /// Update the controller /// # Arguments /// `object` - The object to control ...
Java
UTF-8
586
1.882813
2
[]
no_license
package com.example.after; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * Created by after on 2020/5/29. */ @RestController public class ConfigController { @Value("${...
JavaScript
UTF-8
2,593
3.734375
4
[]
no_license
// Soldier function Soldier(health, strength) { this.health = health; this.strength = strength; this.attack = function() { return this.strength; } this.receiveDamage = function(demage) { this.health -= demage; } } // Viking function Viking(name, health, strength) { this.name = name; Soldier.c...
Ruby
UTF-8
235
3.1875
3
[ "MIT" ]
permissive
#!/usr/bin/env ruby # This is only a sample file used in the tests. class Sample attr_reader :x, :y def initialize @x = 1 @y = 2 end def inspection x.inspect y.inspect end end s = Sample.new s.inspection
Shell
UTF-8
616
3.375
3
[]
no_license
#! /bin/bash prepare_list_grobner() { cat tmp/grobner-$d1-$d2-$d3-$d4-$d \ | grep -v Coefficient \ | grep -v Allocate \ > tmp/list_grobner } run_gp() { cat tmp/list_grobner | while read lijn do naam=$(echo "$lijn" | sed "s/ /-/g") gp -f -q tmp/$d1-$d2-$d3-$d4-$d/$naam do_it.gp >> tmp/$d1-$d2-$d3-$d4-$d/$...
JavaScript
UTF-8
832
3.078125
3
[ "Apache-2.0" ]
permissive
const BUFFER_SIZE = 4096; function createWhiteNoiseNode(audioContext, level = 0.1) { const inputChannels = 1; const outputChannels = 1; const node = audioContext .createScriptProcessor(BUFFER_SIZE, inputChannels, outputChannels); node.addEventListener('audioprocess', (e) => { for (let channelIndex = 0...
Markdown
UTF-8
61,964
2.5625
3
[ "Apache-2.0" ]
permissive
--- title: Maintaining high availability during network partitions for virtual machines stored on distributed object-based storage abstract: Techniques are disclosed for maintaining high availability (HA) for virtual machines (VMs) running on host systems of a host cluster, where each host system executes a HA module...
Markdown
UTF-8
751
2.53125
3
[]
no_license
--- date: w01d03 duration: 60 maintainer: RobertoReif order: 1 title: Presentation Guide --- # Sample Lesson Plan * (60m) [Presentation Tips](PresentationGuide.pptx) # Learning Objectives At the end of this lecture the students should: * Understand how to create and deliver effective presentations * Have a clear u...
Markdown
UTF-8
2,457
3.3125
3
[]
no_license
# GettingAndCleaningData This file explains all the variables, features, calculations performed as part of the Week4 Assignment of the Getting and Cleaning Data assignment There are two sets of data: training and test data. We can see that the main data captured from devices are under InertialSignals folder. This fold...
Markdown
UTF-8
917
3.296875
3
[]
no_license
<!-- https://developers.weixin.qq.com/miniprogram/dev/api/canvas/scale.html --> canvasContext.scale =================== ### 定义 在调用`scale`方法后,之后创建的路径其横纵坐标会被缩放。多次调用`scale`,倍数会相乘。 ### 参数 参数 | 类型 | 说明 ----------------|-----------|----------------------------------...
Python
UTF-8
663
4.03125
4
[]
no_license
#!/usr/bin/python # demo function passing parameters by name and returning values def print_total(customer_name, items): print "Total for {0}:".format(customer_name) total = 0 for item in items: total = total + item print "${0}".format(total) print_total(items=[5.0, 5.5, 5.0], customer_name="A...
Ruby
UTF-8
753
3.203125
3
[]
no_license
class TestObserver attr_reader :values, :errors def initialize @values = [] @errors = [] @complete = false end def do_on_next(value) @values << value end def do_on_complete @complete = true end def do_on_error(error) @errors << error end def empty? @values.empty? e...
C++
UTF-8
6,167
2.71875
3
[ "BSD-2-Clause", "LicenseRef-scancode-free-unknown", "MIT" ]
permissive
#include "driver.h" #include "assert.h" #include "mm.h" #include "mp.h" #include "object.h" #include "log.h" #include <cinttypes> namespace driver::common { static driver_initialize_fn driver_initialize_; static driver_destroy_fn driver_destroy_; static object_t<mm::system_memory_allocator> system_memory_a...
Python
UTF-8
4,460
3.234375
3
[]
no_license
# -*- coding:utf-8 -*- import json import shlex import copy import re from collections import OrderedDict class Control(object): def __init__(self, root): self.stack = [root] self.root = root self.path = [] def push(self, name): self.stack.append(self.stack[-1][name]) ...
Markdown
UTF-8
8,617
3.03125
3
[]
no_license
# Redux w/ ReactJS Tutorial `Redux` provides a predictable state container for JavScript applications. The app state is centralized. `react-redux` is the official React binding for Redux. ## Installing `redux` and `react-redux` ```bash npm install --save redux react-redux ``` > `--save` to include 'redux' and 'react...
Markdown
UTF-8
844
2.875
3
[ "MIT" ]
permissive
# Orientation <div class="aside"> <h3>To-Do List</h3> <ul> <li><b>Sign Up</b> for a free Cloudinary Account.</li> <li><b>Configure</b> your environment.</li> </ul> </div> There are few things to do before we can really get started. ## Sign Up Go to [cloudinary.com/signup](https://cloudinary.com/signup) to regis...
JavaScript
UTF-8
3,201
2.53125
3
[]
no_license
"use strict" import React, {Component} from 'react'; import {render} from 'react-dom'; import ApiService from './apiService'; import CatalogBooks from './catalog-books'; import Header from './header'; import Footer from './footer'; import styles from './register-book.css'; class RegisterBook extends Component { c...
Python
UTF-8
1,443
2.890625
3
[]
no_license
import pandas as pd import cPickle as pkl import numpy as np f = open('pkl_files/train_df_1.pkl','rb') train_df = pkl.load(f) f.close() image_date = pd.read_csv("input/listing_image_time.csv") # rename columns so you can join tables later on image_date.columns = ["listing_id", "time_stamp"] # reassign the only one...
Java
UTF-8
656
3.390625
3
[]
no_license
import javax.swing.*; public class InputCharacterInfo { public static void main(String[] args) { char aChar; String input; input = JOptionPane.showInputDialog("Please enter a character0."); aChar = input.charAt(0); if (Character.isUpperCase(aChar)){ System.out.pr...
JavaScript
UTF-8
2,421
3.203125
3
[]
no_license
const singlePost = document.querySelector(".singlePostResult"); const queryString = document.location.search; const params = new URLSearchParams(queryString); const id = params.get("id"); const url = "https://project-exam1-cms.svanevik.one/wp-json/wc/store/products/" + id; // Calling the API async function fetchS...
C#
UTF-8
1,070
2.65625
3
[ "BSD-3-Clause" ]
permissive
using System; using System.Collections.Generic; using System.Text; namespace SteamCondenser.Steam.Packets { public class ServerRulesResponsePacket : SteamPacket { public ServerRule[] ServerRules { get; protected set; } public ServerRulesResponsePacket(ServerRule[] rules) : base(SteamPacketTypes.S2A_RULES) ...
Python
UTF-8
347
2.609375
3
[]
no_license
from unittest import TestCase from src.DeliveryProblem.AverageWeight import average from src.DeliveryProblem.Utils import DeliveryUtils class TestDaysToWinCash(TestCase): def test_average_weight(self): graph = DeliveryUtils.get_graph([(178, 212), (287, 131), (98, 156)]) self.assertEqual(424.1000...
Java
UTF-8
1,114
2.796875
3
[]
no_license
public class LogicaVenda { private Custo iv = new ImpostoSobreVenda(); private Custo seguro; public Custo getSeguro() { return seguro; } public void setSeguro(Custo seguro) { this.seguro = seguro; } public double calcularTotal(Venda venda) { venda.setTotal(0.0...
Java
UTF-8
1,783
2.25
2
[]
no_license
/** * */ package ar.com.tellapic.sumi.treetable; import javax.swing.AbstractAction; /** * Copyright (c) 2010 Sebastián Treu. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation;...
C#
UTF-8
2,684
3.15625
3
[ "MIT" ]
permissive
using System.Collections; using System.Collections.Generic; namespace PortableTestApp.Test { static class FlowControlAndEnumerators { public static bool RunTest() { var valuesList = new List<int>(); valuesList.Add(4); valuesList.Add(5); valuesList.Add(6); var values = new int[3] { 1, 2, 3...
C#
UTF-8
1,113
2.984375
3
[]
no_license
using System.Text; namespace Buttercup.Control.Common.IO { public class Utility { #region Methods (1)  /// <summary> /// Converts the given wildcard to a regex string. Used by In Memory directory implementation. /// </summary> /// <param name="wildcard">The wildcard expression.</param> //...
Markdown
UTF-8
3,169
2.71875
3
[]
no_license
# NLP ### Setup As usual, you'll need to sign up. It's free. And you'll need a Google/Gmail account. - Click "Sign up for Free" - Log in with Google - Choose "Create Agent" (an agent is like a dialogflow bot) - Name it "Blank agent" - In the sidebar, chose "Prebuilt Agents" - Then in the main area, find the logo for...
C++
UTF-8
525
2.734375
3
[]
no_license
class Solution { public: int uniquePaths(int m, int n) { vector<vector<int> > ans; ans.resize(m); for (int i=0;i<m;i++) { ans[i].resize(n); } for (int i=0;i<m;i++) { ans[i][0]=1; } for (int i=0;i<n;i++) { ans[...
C++
WINDOWS-1251
744
2.9375
3
[]
no_license
#include "FieldCommandArgument.h" #include "../../exceptions/BadBookFieldException.h" FieldCommandArgument::FieldCommandArgument() { name = "field"; description = " (author, title, publisher, year, storePlace)"; regexString = "author|title|publisher|year|storePlace"; } Book::field FieldCommandArgument::...
Java
UTF-8
1,375
2.6875
3
[]
no_license
package com.recsys.similarity; import java.util.Iterator; import java.util.List; import com.recsys.recommendation.Mathematics; public class AdjustedCosineSimilarity<Double> extends NumbersSimilarityMeasure<java.lang.Double> { public java.lang.Double measureSimilarity(List<java.lang.Double> activeRating...
C#
UTF-8
898
2.71875
3
[]
no_license
using System; using System.Linq; using System.Security.Claims; namespace Ayatta.Web.Extensions { public static class ClaimsPrincipalExtensions { public static Identity AsIdentity(this ClaimsPrincipal principal) { if (principal != null && principal.Identity.IsAuthenticated) ...
Python
UTF-8
1,576
3.90625
4
[]
no_license
# 3-11. Intentional Error: If you haven’t received an index error in one of your programs yet, try to make one happen. Change an index in one of your programs to produce an index error. Make sure you correct the error before closing the program. # Exercise 3-10 presidents = ["Lula", "Bolsonaro", "Putin"] print("hey "+...
Java
UTF-8
2,245
2.359375
2
[]
no_license
package com.geekyants.ads.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.CrossOrigin; import org.spr...
JavaScript
UTF-8
1,613
4.25
4
[]
no_license
/* 给定一个二叉树,返回它的 前序 遍历。  示例: 输入: [1,null,2,3] 1 \ 2 / 3 输出: [1,2,3] 进阶: 递归算法很简单,你可以通过迭代算法完成吗? */ /** * Definition for a binary tree node. * function TreeNode(val) { * this.val = val; * this.left = this.right = null; * } */ /** * Definition for a binary tree node. * ...
C#
UTF-8
1,450
2.5625
3
[]
no_license
using FontAwesome.Sharp; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace CrewmanSystem { public class CrewPantalla { IconButton _boton; CrewPantalla _padre; Panel _panel; Color _co...
Python
UTF-8
373
2.9375
3
[]
no_license
#Tempo: O(n) #Memória: O(n). from typing import List class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: hash_nums = {} for i in range(len(nums)): complement = target - nums[i] if hash_nums.get(complement) != None: return [hash_nums.ge...
Java
UTF-8
3,496
2.109375
2
[]
no_license
package com.caipiao.game.cacher.match; import java.io.File; import java.util.Arrays; import java.util.HashMap; import com.mina.rbc.thread.RbcAbstractThread; import com.mina.rbc.util.CheckUtil; import com.mina.rbc.util.xml.JXmlWapper; public class MatchCacheEngine extends RbcAbstractThread { private Str...
C++
UTF-8
359
2.96875
3
[]
no_license
#include <iostream> #include <string.h> using std::cin; using std::cout; using std::endl; using std::string; int main() { string input; string total; while (cin >> input) { if (total.empty() == false) total = total + ' ' + input; else total = input; } c...
PHP
UTF-8
5,207
2.53125
3
[]
no_license
<?php App::uses('AppModel', 'Model'); /** * Job Model * * @property User $User * @property Account $Account * @property Customer $Customer */ class Job extends AppModel { /** * Validation rules * * @var array */ public $contain=array( 'User'=>array( 'fields'=>array( 'first_name', ...
Java
UTF-8
11,602
2.078125
2
[]
no_license
package com.hzaihua.jfoenix.entity; import com.jfoenix.controls.datamodels.treetable.RecursiveTreeObject; import javafx.beans.property.SimpleDoubleProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; public class ...
Java
UTF-8
834
2.140625
2
[]
no_license
package com.buzz.jwtdemo.service; import java.util.HashMap; import com.buzz.jwtdemo.common.JwtMessageKey; import com.buzz.jwtdemo.common.MessageUtil; import com.buzz.jwtdemo.common.ResponseConstants; /**************************************************************************************************** * Ser...
C#
UTF-8
449
2.671875
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace TDDMicroExercises.TirePressureMonitoringSystem { class SensorMock : ISensor { Queue<double> _queue =new Queue<double>(); public void PushNextPressurePsiValue(double value) { _queue.Enqueue(value)...
JavaScript
UTF-8
21,768
2.875
3
[]
no_license
// ================================================================================================ // // wayfarer.js // // Author: Thomas Norman (with thanks to Isabel Broome-Nicholson!) // Created: 10/08/2013 // // This is the entry point for the Wayfarer web service. // // Uses: // - Express: A web appl...
Python
UTF-8
2,057
2.546875
3
[ "WTFPL" ]
permissive
#!/usr/bin/env python # coding:utf-8 import urllib from bs4 import BeautifulSoup import re import json import os import functools def cache(func): """cache the value in memory """ table = func.cache = {} @functools.wraps(func) def wrapper(*args, **kwargs): key = '{0}{1}'.format(args, kwa...
SQL
UTF-8
2,605
4.125
4
[]
no_license
CREATE TABLE room ( room_id int PRIMARY KEY, rate numeric(5,2), bed_type varchar(15), bed_qty int ); CREATE TABLE guest ( guest_id int PRIMARY KEY, first_name varchar(35), last_name varchar(35), phone_number varchar(10), email varchar(62) ); CREATE TABLE booking ( room_id int REFERENCES room(room_...
Markdown
UTF-8
1,465
2.65625
3
[]
no_license
# xrope [![Build Status](https://travis-ci.org/wasabiz/xrope.png)](https://travis-ci.org/wasabiz/xrope) rope data structre ## Usage Just include "xrope.h" anywhere you want to use xrope! ## API ```c typedef struct xrope xrope; /** * | name | frees buffer? | end with NULL? | complexity | misc * | ---- ...
Markdown
UTF-8
6,966
3.296875
3
[]
no_license
--- layout: post title: "How-to-debug-mobile-web-app" date: 2018-04-22 1:38:28 +0800 categories: jekyll update --- Today Mobile Web Hybrid Apps are popular and the fornt end develpers are facing the difficult problems. The mobile web app needs more careful looking care of. The adaptive, the code debugging etc. The ...
TypeScript
UTF-8
1,537
2.703125
3
[]
no_license
import md5 from "md5"; import Admin, { IAdmin, IAdminCreation } from "../modules/Admin"; function filter(result: any) { let data: any = null; if (result) { const { id, loginId } = result; data = { id, loginId, }; } return data; } export default class AdminService { static async addAd...
Java
UTF-8
675
2
2
[]
no_license
package com.guru99.banking.webelements; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.Select; public class Ministatement { WebDriver driver; By ministatement=By.linkText("Mini Statement"); By accountno=By.name("accountno"); By submit=By.name("AccSu...
Java
UTF-8
904
2.234375
2
[]
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 OmarEntite; /** * * @author user */ public class enfantETactivite { private int id_e; private int id_ac; privat...
C
UTF-8
1,533
3.546875
4
[]
no_license
#include <stdio.h> #include <stdlib.h> typedef struct Node Node; struct Node{ long long key; int cnt; Node *leftChild, *rightChild; }; Node* createNode(long long key){ Node* ret = (Node*) malloc(sizeof(Node)); ret->key = key; ret->cnt = 1; ret->leftChild = ret->rightChild = NULL; return ...