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
951
2.484375
2
[]
no_license
package com.example.home.myapplication.vo; /** * 浏览记录 * * @author liu * */ public class ProdcutHistory extends ProductListVo implements Comparable<ProdcutHistory>{ /** 浏览时间 */ private long time; public ProdcutHistory() { } public ProdcutHistory(int id, String name, String pic, double marketprice, double...
Java
UTF-8
5,375
2.28125
2
[]
no_license
package org.qcri.micromappers.nlp.service; import java.io.File; import java.io.IOException; import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import org.apache.log4j.Logger; import org.deeplearning4j.models.embeddings.loader.WordVectorSerializer; import...
C#
UTF-8
1,061
2.5625
3
[ "MIT" ]
permissive
using Newtonsoft.Json; namespace RiotSharp.Endpoints.StaticDataEndpoint.Champion { /// <summary> /// Basic information for a champion (Static API). /// </summary> public class InfoStatic { internal InfoStatic() { } /// <summary> /// Number between 1 and 10 representing the...
Python
UTF-8
179
2.890625
3
[]
no_license
#!/usr/bin/env python # vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8: s = 'Whereof one cannot speak, thereof one must be silent' print s.upper()
Java
UTF-8
312
3.34375
3
[]
no_license
package week6; public class Engineer extends Person{ String genre; public Engineer(String name, int age, String gender){ this.age = age; this.gender = gender; this.name = name; } public void doJob(){ System.out.println(name+" is " +genre); } }
C#
UTF-8
2,393
2.796875
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.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; namespace _30._10._2019 { public partial class Form1 : Form ...
Markdown
UTF-8
928
2.75
3
[]
no_license
<h1 align="center">Footstep-Lookup</h1> <p align="center"><img src="https://image.freepik.com/free-vector/customer-using-mobile-app-tracking-order-delivery_74855-5229.jpg" /></p> This is an activity tracking application. It lets you to see the name of the window opened, the total time for which the user was on the wi...
Java
UTF-8
4,018
2.046875
2
[]
no_license
package com.example.poliakov.barcodescanner; import android.content.Context; import android.content.DialogInterface; import android.net.Uri; import android.os.Bundle; import android.provider.DocumentsContract; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; imp...
Java
UTF-8
192
1.734375
2
[]
no_license
/** * */ package searchaction; import java.io.File; /** * @author jzero2 * */ public interface FileAction { public int doAction(File sourceFile, String[] matchGroup); }
Markdown
UTF-8
1,131
2.765625
3
[ "MIT" ]
permissive
# diff-generator A Django REST based API to compare a list of filepaths against two different commits. Commits can be specified in the form of branches, tags or specific commit hashes. ### Prerequisites Ensure you have pip and sqlite installed on your machine ### Installation ```bash git clone git@bitbucket.org:3...
Markdown
UTF-8
11,793
2.53125
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: 将自定义任务窗格与功能区按钮同步 ms.date: 02/02/2017 ms.topic: conceptual dev_langs: - VB - CSharp helpviewer_keywords: - custom task panes [Office development in Visual Studio], showing and hiding - showing custom task panes - Ribbon [Office development in Visual Studio], custom task panes - toggle buttons [Office developm...
JavaScript
UTF-8
479
2.5625
3
[]
no_license
//Dependencies var mongoose = require('mongoose'); // Save a reference to the Schema constructor var Schema = mongoose.Schema; // Creating the note schema var NoteSchema = new Schema({ username: { type: String, required: false }, comment: { type: String, required: false }, date: { type: ...
Java
UTF-8
2,001
2.421875
2
[ "ICU", "BSD-3-Clause", "Apache-2.0", "LicenseRef-scancode-jdom", "MIT", "MPL-1.1", "JSON", "LGPL-2.1-or-later", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
/** * Copyright 2007-2016, Kaazing Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
Python
UTF-8
1,853
3.125
3
[]
no_license
import subprocess from os import system def setweb(): system("tput setaf 2") print("\nApache websever has loaded properly") system("tput setaf 7") print("""Tell me from where you want to load the website : 1.download web page from github 2.copy local web page to the webserver 3.back ""...
Java
UTF-8
465
1.960938
2
[]
no_license
package pl.edu.wat.wcy.isi.siecsilowni.events; import javafx.event.Event; import javafx.event.EventType; import lombok.Data; import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) @Data public class SearchSubmitEvent extends Event { public static final EventType<SearchSubmitEvent> SEARCH_SUBMIT_EVE...
JavaScript
UTF-8
633
3.328125
3
[]
no_license
const Heap = require('./collections/heap'); const find_Kth_smallest = function (lists, k) { let currPos = 0, nextSmallNum = -1; const minHeap = new Heap([], null, (a, b) => b[0] - a[0]); lists.forEach((list, i) => { minHeap.push([list.shift(), i]); }); while (currPos < k && minHeap.length) { next...
Java
UTF-8
430
2.15625
2
[]
no_license
package com.hw.common.constant; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; public class LocalCache { public static Map map =new ConcurrentHashMap(); public static Object get(String key) throws ExecutionException { return ma...
Markdown
UTF-8
1,421
2.765625
3
[]
no_license
# API Gateway Suppose a company named XYZ developed the API for its internal purpose. There are two ways in which it exposes that API for external use: - Exposes it using authentication from known clients - Exposes it as an API as a service In the first case, this API is consumed by the other services inside the comp...
Ruby
UTF-8
5,010
2.984375
3
[]
no_license
class Passport def self.from_string(string, field_level_validation: true) new(string.split.map(&:to_field), field_value_validation: field_level_validation) end attr_reader :fields def initialize(fields, field_value_validation:) @fields = fields @field_level_validation = field_value_validation en...
TypeScript
UTF-8
619
2.625
3
[ "MIT" ]
permissive
import styled from 'styled-components'; import { typography } from 'styled-system'; import DEFAULT_THEME, { Theme } from '../../default-theme'; type HeadingProps = { variant?: string; theme?: Theme; children?: React.ReactNode; }; function getSize({ theme, variant }) { return theme.headingFontSizes[var...
Markdown
UTF-8
3,159
4.28125
4
[]
no_license
##面向对象 学习 ###1、学习目标 1.了解面向对象程序的特点 2.学会js模块面向对象的方法 3.理解prototype 4.理解继承 ###2、面向对象程序设计 面向对象的语言有一个标志,那就是他们都有类的概念,通过类可以创建任意 多个具有相同属性和方法的对象,但是ECMAScript中没有类的概念,但是我们可以通过其他方式来模拟面向对象的类。 1.工厂模式,工厂模式是软件工厂领域中一种最广为人知的设计模式。 1.构造函数模式,比如像ECMAScript中的Array,Object,Date等都是通过构造函数来构建的。 2.动...
Java
UTF-8
1,546
1.921875
2
[]
no_license
package com.hlnwl.auction.ui.goods; import androidx.annotation.Nullable; import com.allen.library.SuperTextView; import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseViewHolder; import com.hlnwl.auction.R; import com.hlnwl.auction.bean.goods.OfferBean; import com.hlnwl.aucti...
Markdown
UTF-8
7,039
2.984375
3
[ "MIT" ]
permissive
# API ## Терминология: + **Узел** - любой из двух компьютеров, между которыми установлено соединение. + **Сервер** - узел, занимающий распределением сообщений между пользователями. + **Клиент** - узел, занимающийся передачей сообщений от лица одного пользователя. + **Пользователь** - человек, использующий клиент. + *...
Java
WINDOWS-1252
5,527
2.515625
3
[]
no_license
package com.sevenstar.steward2016.view; import java.util.Calendar; import com.lib.shiguotao.utils.ConvertUtils; import com.lib.shiguotao.utils.DialogUtils; import com.lib.shiguotao.utils.ViewUtils; import com.lib.shiguotao.view.wheel.OnWheelChangedListener; import com.lib.shiguotao.view.wheel.WheelView; import com.li...
TypeScript
UTF-8
3,183
3.15625
3
[]
no_license
import { Bird } from './bird'; fdescribe('Bird', () => { let bird; describe('bird is EUROPEAN', () => { beforeEach(() => { bird = new Bird('EUROPEAN'); }); describe('#getSpeed', () => { it('returns correct bird speed', () => { expect(bird.getSpeed()).toEqual(21); }); });...
TypeScript
UTF-8
3,411
2.53125
3
[]
no_license
import HttpPostClientSpy from '@/Data/Mocks/HttpPostClientSpy'; import { HttpStatusCode } from '@/Data/Protocols/Http/HttpResponse'; import RemoteAuthentication from '@/Data/Usecases/Authentication/RemoteAuthentication'; import { InvalidCredentialsError } from '@/Domain/Errors/InvalidCredentialsError'; import { Unexpec...
TypeScript
UTF-8
193
3.15625
3
[]
no_license
export function removeValueFromArray<T>(array: T[], excludedValue: T): T[] { const index = array.indexOf(excludedValue); if (index > -1) { array.splice(index, 1); } return array; }
Python
UTF-8
1,586
2.828125
3
[ "CC-BY-2.0", "Zlib" ]
permissive
""" Test the functions in the `logger` module """ import datetime from poezio.logger import LogMessage, parse_log_line, parse_log_lines, build_log_message from poezio.common import get_utc_time, get_local_time def test_parse_message(): line = 'MR 20170909T09:09:09Z 000 <nick>  body' assert vars(parse_log_line(...
Java
UTF-8
3,376
2.984375
3
[]
no_license
package com.leetcode.extra; import com.leetcode.TreeNode; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Stack; public class SumPathTree { private static List<Integer> listResult = new ArrayList<>(); public static void main(String args[]){ TreeNod...
Java
UTF-8
662
2.046875
2
[]
no_license
package com.yongq.a_dao; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import org.apache.ibatis.session.SqlSession; import org.springframework.stereotype.Repository; import com.yongq.s_dto.StudentVO; @Repository public class AdminFindPWDAOImpl implements AdminFindPWDAO { @Inject SqlSe...
Markdown
UTF-8
955
3.046875
3
[]
no_license
# CvsCSharp this is a simple project to compare C and C# performances in computational tasks you can test this by your self by running **compile.bat** first then **run.bat** in run.bat you can change how many times you want to run each test you can automate it by someting like ``` for /l %%x in (1,1,%%count) do ```...
Java
UTF-8
4,960
2.671875
3
[]
no_license
import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.util.Comparator; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Random; import java.io.Writer; import java.util.Map; import java.io.IOException; import java.util.Arrays; import java.util.InputMismatchException; impo...
Java
UTF-8
646
2.59375
3
[]
no_license
package org.ozsoft.secs.format; import org.junit.Assert; public abstract class TestUtils { public static void assertEquals(byte[] expected, byte[] actual) { boolean isEqual = (actual.length == expected.length); for (int i = 0; isEqual && (i < actual.length); i++) { if (actual...
JavaScript
UTF-8
923
3.328125
3
[]
no_license
// VISI INPUTAI TURI BUTI UZDAROMI import { useState } from "react"; // CIA NEKONTROLIUOJAMAS KOMPONENTAS, KA NORIU TA RASAU: // function TextInput() { // return( // <div> // <input type="text" /> // </div> // ) // } // export default TextInput; // KONTROLIUOJAMAS KOMPONENTAS:...
PHP
UTF-8
1,229
3.140625
3
[]
no_license
<?php /** The AppInterface describes what it needs to build an application class. * @package App * @author zeropanic <zeropanic@myself.com> * @version 1.0 * @namespace Oz\App */ namespace Oz\App; interface AppInterface { /** * init the application * @access public * @return \Oz\App instan...
C++
UTF-8
751
2.53125
3
[ "MIT" ]
permissive
#pragma once #include "Element.h" #include "Parent.h" #include "Spatial_Source.h" namespace scenery { class Simple_Element : public virtual Element { protected: Parent *parent = nullptr; public: Simple_Element() { // if (parent) // parent->add_child(unique_ptr<Elemen...
Python
UTF-8
3,226
3.296875
3
[]
no_license
""" Created on 23/01/2015 @author: dave """ import csv import getopt import os.path import sys from GLSapp.ReferenceScraper import ReferenceScraper from GLSapp.LinkScraper import LinkScraper # Application handling class class MainApp: def __init__(self): self.scraper = None self.mode = None ...
JavaScript
UTF-8
3,829
3.40625
3
[]
no_license
'use strict'; let arrayO = []; let arrayX = []; var defaults = { backgroundcolor: '#000', color: '#fff', weekdays: ['sun','mon','tue','wed','thu','fri','sat'] }; let winners = [ [0,1,2], [3,4,5], [6,7,8], [0,3,6], [1,4,7], [2,5,8], [0,4,8], [2,4,6] ]; console.log('this is it: ' + winners[1]); do...
Markdown
UTF-8
460
2.734375
3
[]
no_license
<h1>Music App</h1> <p>Tap Music allows you to play sounds like a keyboard.</p> <p>To use just click on a colored square and let the sounds fly; literally. Every time you click a color you will see a bubble style animation of the same color fly on the screen. </p> <p>Check out the video below to see how it works o...
Java
UTF-8
230
1.625
2
[]
no_license
package com.tuncay.credit.domain; import lombok.*; @Data @AllArgsConstructor @NoArgsConstructor @ToString @EqualsAndHashCode public class CreditScoreResult { private String identity_number; private int credit_score; }
Ruby
UTF-8
1,753
3.59375
4
[]
no_license
#!/usr/bin/ ruby # ========= Class Animal ========= class Animal attr_reader :legs, :sound attr_writer :type attr_accessor :name # static Array @@history_name = Array.new # ========= Constructors ========= def initialize(legs = 4, sound = "MmmmKROOOOOO...
Java
UTF-8
406
1.742188
2
[]
no_license
package com.paladin.qos.mapper.address; import com.paladin.qos.model.address.Address; import com.paladin.qos.service.address.vo.AddressVo; import com.paladin.qos.service.analysis.data.*; import org.apache.ibatis.annotations.Param; import java.util.List; public interface AddressMapper { List<Address> getAddr...
Markdown
UTF-8
10,218
2.578125
3
[ "CC-BY-4.0" ]
permissive
# Ciencia libre con drones Desde 2017 hemos venido desarrollando un prototipo de kit de herramientas para hacer ciencia abierta con drones, accesible por igual para comunidades marginales, activistas o investigadores, y útil para estudios o relevamientos de datos en los que esta tecnología ya se utiliza pero está domi...
Python
UTF-8
970
2.5625
3
[]
no_license
''' Created on 20 janv. 2017 @author: Adnene ''' from math import sqrt #from numba import jit def outcome_representation_in_reviews(dataset,position_attribute,vector_of_outcome=None,method_aggregation_outcome='VECTOR_VALUES'): #[vector_of_outcome=['attr1,'attr2]] if vector_of_outcome is None or method_aggregation...
C#
UTF-8
1,478
3.640625
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; namespace JaggedArrayModification { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int[][] jagged = new int[n][]; for (int i = 0; i < n; i++) ...
Python
UTF-8
2,889
3.015625
3
[]
no_license
#!/usr/bin/env python """ Script for summarizing data for statistics generation. Invocation: $ python summarize.py data/enriched/*.json -o summary.csv """ import argparse import csv import json import os import sys from common import write_json_file, progress, read_records def summarize(data): artwork_li...
Python
UTF-8
1,772
3.859375
4
[]
no_license
from random import randint import copy class Player(object): def __init__(self, name, symbol): self.name_str = name self.symbol = symbol def prompt_move(self): return (0, self.symbol) # to string method def __str__(self): return "{0} ({1})".format(self.name_str, self...
Go
UTF-8
1,931
3.609375
4
[ "MIT" ]
permissive
package reader import ( "encoding/binary" "io" ) // LittleEndianReader is a wrapper around `bytes.Reader` with respect towards // handling little endian byte streams type LittleEndianReader struct { base } // CreateLittleEndianReader wraps an io.Reader with logic to read little-endian // byte content. Operations...
Markdown
UTF-8
2,408
4.15625
4
[]
no_license
null是JavaScript语言的关键字,它表示一个特殊值,常用来描述“空值”。对null执行typeof预算,结果返回字符串"object",也就是说,可以将null认为是一个特殊的对象值,含义是“非对象”。但实际上,通常认为null是它自有类型的唯一一个成员,它可以表示数字、字符串和对象是“无值”的。大多数编程语言和JavaScript一样含有null:你可能对null或nil很眼熟。 ```js var res = null; document.write(typeof (res));//object ``` JavaScript还有第二个值来表示值的空缺。用未定义的值表示更深层次的“空值”。它是变量的一种取值...
Java
UTF-8
1,207
2.515625
3
[]
no_license
package nitinka.quartzrest.domain; import org.quartz.JobDetail; import org.quartz.Trigger; import java.util.List; /** * Wrapper Around Job Details exposed by quartz */ public class RunTimeJobDetail { private JobDetail jobDetail; private List<? extends Trigger> triggers; public JobDetail getJobDetail()...
C++
UTF-8
1,724
3.265625
3
[]
no_license
/* * Reference.cpp * * Created on: 26.12.2019 * Author: Marcin */ #include "Reference.h" Reference::Reference(float midValue, float calculationLimit, float referenceDeviationLimit, uint32_t stableSamples) : midValue(midValue), calculationLimit(calculationLimit), referenceDeviationLi...
Markdown
UTF-8
3,558
2.625
3
[]
no_license
GCJ: Java без JVM ====== Да, именно так: Java без JVM. В данной статье рассмотрим работу с Java (компиляция/запуск), не используя такие средства, как JVM/JDK и подобное. Ах да, и никаких on-line инструментов, все только локально :) А воспользуемся мы таким инструментом, как GCJ: > GNU Compiler for Java (GCJ или gcj) ...
C
UTF-8
238
3.09375
3
[]
no_license
#include<stdio.h> void sankaku(int); int main(void) { sankaku(2); sankaku(3); sankaku(4); sankaku(5); return 0; } void sankaku(int M) { int i,j; for(i=1;i<=M;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } }
Java
UTF-8
178
2.046875
2
[]
no_license
package io.github.sweehaw.utils; /** * @author sweehaw */ public class CommUtils { public static String trim(String s) { return s != null ? s.trim() : s; } }
Java
UTF-8
4,096
2.203125
2
[]
no_license
package wdm.tpe; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import wdm.match.Match; import wdm.matcher.MatcherOpt; import wdm.util.Pair; import wdm.xml.XMLNode; import java.io.IOException; import java.util.ArrayList; import java.util.LinkedList; import j...
C++
UTF-8
52,698
2.796875
3
[ "Apache-2.0" ]
permissive
#include "stdafx.h" #include "CppUnitTest.h" #include <util/common/geom/polygon.h> #include <array> using namespace Microsoft::VisualStudio::CppUnitTestFramework; template<> static std::wstring Microsoft::VisualStudio::CppUnitTestFramework::ToString<geom::point2d_t> (const geom::point2d_t & p) { RETURN_WIDE_STRING...
Java
UTF-8
4,124
2.265625
2
[]
no_license
package com.lebien.controller; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util...
SQL
UTF-8
888
4.3125
4
[ "LicenseRef-scancode-public-domain", "Unlicense" ]
permissive
CREATE TABLE "Comment" ( "id" BIGINT NOT NULL UNIQUE, "parentId" BIGINT, "slug" TEXT NOT NULL, "datePublished" NUMERIC NOT NULL, "dateDeleted" NUMERIC, "authorName" TEXT NOT NULL, "authorEmail" TEXT, "authorWebsite" TEXT, "text" TEXT NOT NULL, PRIMARY KEY("id" AUTOINCREMENT) ); ...
Rust
UTF-8
1,181
2.5625
3
[]
no_license
use futures::Future; use http::Uri; use hyper::client::connect::Connect; use hyper::client::connect::Connected; use hyper::client::connect::Destination; use std::io; use tokio::io::AsyncRead; use tokio::io::AsyncWrite; /// A wrapper around `Proxy`s with a connector. #[derive(Clone, Debug)] pub struct ProxyConnector<C>...
Markdown
UTF-8
2,045
3.5
4
[]
no_license
# All devices setup Since we are making websites designed for all devices, we want to setup our HTML and CSS to show it. There are a couple `<meta>` tags and a little bit of CSS to make all devices recognize your website supports the device, whatever it is. ## HTML ```html ⋮ <head> ⋮ <meta name="handheldfriendly"...
Java
UTF-8
695
2.09375
2
[]
no_license
package com.example.beckart.ViewModel; import android.app.Application; import android.arch.lifecycle.AndroidViewModel; import android.arch.lifecycle.LiveData; import android.support.annotation.NonNull; import com.example.beckart.model.CartApiResponse; import com.example.beckart.repository.CartRepository; public class...
Java
UTF-8
1,047
3.734375
4
[]
no_license
package Thejvm.MulitThreads; /** * Created by tangjialiang on 2018/1/23. */ public class DeadLock { /** * 用于对多线程死锁的测试, * 线程的状态变化: blocked * 某个线程占有对象a, * 某个线程占有对象b */ static class SynAddRunalbe implements Runnable { int a, b ; public SynAddRunalbe(int a, int b) { ...
Python
UTF-8
1,581
2.765625
3
[]
no_license
import time import RPi.GPIO as GPIO import subprocess import os TRIG = 21 # Pin for ultrasonic sensor ECHO = 22 # Pin for ultrasonic sensor LED = 18 GPIO.setmode(GPIO.BCM) GPIO.setup(LED,GPIO.OUT) #setup GPIO.setup(23,GPIO.OUT) #setup GPIO.setup(TRIG,GPIO.OUT) #setup GPIO.setup(ECHO,​GPIO.IN​) #setup def main(): # f...
Markdown
UTF-8
597
2.703125
3
[]
no_license
# Frontend ## Getting Started These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. ### Prerequisites - Node.JS - yarn ### Installing 1. Clone this repository. 2. Navigate to the right directory. 3. <b>First, run the backend server!</b> Ty...
PHP
UTF-8
2,865
2.515625
3
[ "MIT" ]
permissive
<?php namespace SimoTod\OmnipaySetefi\Message; use Omnipay\Common\Message\AbstractRequest; class Request extends AbstractRequest { protected $testEndpoint = 'https://test.monetaonline.it/monetaweb/payment/2/xml'; protected $liveEndpoint = 'https://www.monetaonline.it/monetaweb/payment/2/xml'; const OP_T...
JavaScript
UTF-8
2,033
2.53125
3
[]
no_license
import React, { Component } from 'react' import axios from "axios" import Card from "../../components/Card/Card" //引入swiper组件 import Swiper from "../../components/Swiper/Swiper" // 引入购物车组件 import ShoppingCar from "../../components/ShoppingCar/ShoppingCar" // 引入dealFn高阶方法 import { dealFn } from '../../store'; // 处理购物车 ...
JavaScript
UTF-8
1,478
4.25
4
[]
no_license
//1. /* var warmup = new Promise(function (resolve, reject){ resolve('hello promise, yay i resolved') reject('oops i did it again you got rejected') }) warmup.then(function(result){ setTimeout(function(){ console.log(result) }, 1000), function(err) { console.log(err) } }) */ //2. var delay = functio...
Python
UTF-8
1,939
2.59375
3
[]
no_license
import numpy as np from matplotlib import pyplot as plt import scipy.io.wavfile from scipy import signal import analysis as ana import synthesis as syn rate, unnorm_input = scipy.io.wavfile.read('s5.wav') input = unnorm_input/64000 signal_length = len(input) samples_per_frame = int(25/1000*rate) samples_per_skip = int(...
Ruby
UTF-8
1,613
3.4375
3
[]
no_license
class Slots def initialize(player) puts ' /$$$$$$ /$$ /$$ /$$__ $$| $$ | $$ | $$ \__/| $$ /$$$$$$ /$$$$$$ /$$$$$$$ | $$$$$$ | $$ /$$__ $$|_ $$_/ /$$_____/ \____ $$| $$| $$ \ $$ | $$ | $$$$$$ /$$ \ $$| $$| $$ | $$ | $$ /$$\____ $$ | $$$$$$/| $$| $$$$$$/ | $$$$//...
PHP
UTF-8
4,044
2.84375
3
[]
no_license
<?php /** * DataGateway for SQL Db wraps up Zend_Db_Table * * PHP version 5.3 * * @category ZendApp * @package DataGateway * @author Francisco Marcos <fmarcos83@gmail.com> * @license GNU http://www.gnu.org/licenses/lgpl.txt * @link ZendApp\Data\DataGateway * @see Zend_Db_Adapter_Abstract * @see ...
Java
UTF-8
397
2.859375
3
[]
no_license
import java.util.*; public class Prep1 { /* public static void main(String[] args) { int i =20; if(i==20) { int n= 34; } else { System.out.println(n); } } } */ // public class Main { public static void main(String[] args) { for(int i = 0; i < 3; i++) { System....
JavaScript
UTF-8
196
2.78125
3
[ "MIT" ]
permissive
module.exports = function reverse (n) { // let Array = []; //newArray = Array.map(n); //console.log(newArray); return Number(Math.abs(n).toString().split('').reverse().join('')); }
C++
UTF-8
478
2.59375
3
[]
no_license
#ifndef TIMER_H #define TIMER_H #include <QObject> #include <QTimer> class Timer:public QTimer { Q_OBJECT Q_PROPERTY(int second READ second WRITE setSecond NOTIFY secondChanged) public: Timer(QObject *parent=nullptr); Q_INVOKABLE void startTimer(); Q_INVOKABLE void stopTimer(); int second() c...
Python
UTF-8
4,299
2.8125
3
[]
no_license
#!/usr/bin/python import re,os,sys #This file contains the useful functions for interacting with the config files class ConfigFile: def __init__(self, FileName="config.dat"): self.FileName=FileName self.Parameters={} self.infile=open(self.FileName,"r") self.LoadConfigFile() ...
C++
UTF-8
1,394
2.96875
3
[]
no_license
#ifndef PARSER_H #define PARSER_H #include<string> #include<iterator> #include<algorithm> using std::string; typedef string::iterator strIter; // a section has the format: // \section{sectionName}{sectionContent} class Section { public: Section(); const strIter & begin(); const strIter & end(); const st...
Python
UTF-8
223
3.046875
3
[]
no_license
import sys import time if len(sys.argv)>1: filename = sys.argv[1] file = open(filename, 'w') temp=0 while(temp<=100): text = file.write('a') time.sleep(0.1) temp+=1 file.close()
Python
UTF-8
4,149
2.8125
3
[]
no_license
import copy import numpy as np import math from common.game import Board import random class Edge(): def __init__(self, move, parentNode): self.parentNode = parentNode self.move = move self.N = 0 self.W = 0 self.Q = 0 self.P = 0 class Node(): def __init__(self, ...
Markdown
UTF-8
1,039
2.828125
3
[]
no_license
# Article L233-1 Le contrat conclu par un éditeur de services de télévision pour l'acquisition de droits relatifs à la diffusion d'une œuvre cinématographique prévoit le délai au terme duquel cette diffusion peut intervenir. Lorsqu'il existe un accord professionnel portant sur le délai applicable au mode d'exploitat...
C#
UTF-8
1,017
2.515625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace KancolleBgmChenger { /// <summary> /// KanColleViewerからもらうエンドポイントからのセッション通信を管理するクラス /// </summary> public class EndPointPath { private uint id; //ID...
JavaScript
UTF-8
663
3.5
4
[]
no_license
/* AM Warm Up Assignment (11/8/19): 1.) create new file secondServer.js 2.) write, line by line, a new Express server 3.) use port 3000 & console.log() the port 4.) no routes required */ // require Express: const express = require("express"); // instantiate an application via the express() method: const app = express...
Go
UTF-8
3,510
2.796875
3
[]
no_license
package site import ( "dna" "dna/hdv" "dna/sqlpg" "time" ) // UpdateHDViet gets lastest items from hdviet.com. // // The update process goes through 8 steps and 2 parts: // // PART I: FINDING AND UPDATING NEW EPS OF MOVIES IN DB // Step 1: Initalizing db connection, loading site config and state handler. // St...
TypeScript
UTF-8
991
2.765625
3
[ "MIT" ]
permissive
import { workspace } from "vscode"; import ConfigurationError from "./ConfigurationError"; type Content = string[]; type Commands = string[]; const extractCommands = (filePath: string): Promise<Commands> => getFileContent(filePath).then(buildCommands); export default extractCommands; const getFileContent = async ...
C#
UTF-8
1,111
3.90625
4
[]
no_license
using System; namespace FibonacciNumbers { class FibonacciNumbers { static void Main(string[] args) { Console.Write("Какой член ряда Фибоначчи Вы хотите увидеть?: "); int number = Convert.ToInt32(Console.ReadLine()); if (number > 48) { ...
Python
UTF-8
204
2.75
3
[ "Apache-2.0" ]
permissive
from __future__ import print_function import fileinput, hashlib h = hashlib.sha256() for line in fileinput.input(mode='rb'): h.update(line) print(h.hexdigest()[:4], line.decode('utf-8'), end='')
Java
UTF-8
26,495
2.1875
2
[ "Apache-2.0" ]
permissive
package com.vaadin.tests.components; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import c...
C
UTF-8
873
3.09375
3
[]
no_license
#include <stdio.h> int main() { int id; char name[100]; float unit,cost,unitfee,surchage; scanf("%d",&id); fflush(stdin); gets(name); scanf("%f",&unit); if(unit<=199) { cost=unit*1.20; unitfee=1.20; } else if(unit>=200&&unit<400) { cost=unit*1.50;...
Markdown
UTF-8
8,887
3.21875
3
[]
no_license
# HW 2: Grapheme-to-phoneme conversion In this assignment you will use [FairSeq](https://github.com/pytorch/fairseq), a neural network sequence-to-sequence learning tool, to build an [encoder-decoder LSTM](https://fairseq.readthedocs.io/en/latest/models.html#module-fairseq.models.lstm) grapheme-to-phoneme engine for I...
PHP
UTF-8
1,603
2.875
3
[]
no_license
<?php require_once("model/Manager.php"); class PostManager extends Manager{ // Join between commentaires and utilisateurs to solely grab and then display the amount of comments in a given entry function callPosts(){ $bdd = $this->databaseConnect(); $req = $bdd->query('SELECT billets.id,billets.title,billets.conte...
Markdown
UTF-8
202
2.578125
3
[]
no_license
# Keith Taylor Links Here are a few links from my Markdown Portfolio to other pages about me: - [Keith Taylor's Personal Blog](https://keith.1drous.me/) - [Keith Taylor on Twitter](https://twitter.com/KeithTaylor)
Python
UTF-8
537
2.765625
3
[]
no_license
from persistencia import MySqlConnector def crearUsuario(email, nombre, apellido, password): usuarios = MySqlConnector.correr_sql(f"INSERT INTO usuarios VALUES ('{email}','{nombre}','{apellido}','{password}')") return obtenerUsuario(email, password) def obtenerUsuario(email, password): usuarios = MySqlC...
Shell
UTF-8
2,020
2.734375
3
[]
no_license
#!/bin/sh # the files from which this script was run are kept (at the time of # writing) in //oryx/external/codecmaps/. p4 edit *.inc # DOS code pages for a in CP???.TXT ; do tr '[a-f]' '[A-F]' < $a | tr -s ' ' | awk '/^0x[0123456789ABCDEF]/{ print $1, $2 }' | sort | sed -e 's/#UNDEF.*$/0xFFFD/' | cut -c6- | paste ...
PHP
UTF-8
5,349
2.984375
3
[]
no_license
<?php /** * * Stick Object class to make CRUD operations on table. * * @author Hamza Waqas * @since 1st Feb, 2013 * @version v1.0 */ class Stick { private $_table = "table_name"; private $_data = array(); private $_isNew; private $_dataSource; private $_fetchAs = PDO::FE...
JavaScript
UTF-8
147
3.484375
3
[]
no_license
const numeros = [1, 2, 3, 4, 5, 6] for (numero of numeros) console.log(numero) numeros.forEach((numero, indice) => {console.log(numero, indice)})
Swift
UTF-8
21,291
2.578125
3
[]
no_license
// // GameScene.swift // FlappyBird // // Created by 濱田龍輝 on 2019/09/09. // Copyright © 2019 Ryuuki.hamada. All rights reserved. // import SpriteKit import AVFoundation class GameScene: SKScene , SKPhysicsContactDelegate{ var scrollNode:SKNode! var wallNode:SKNode! var pointUpItemNode:SKNode! ...
Java
UTF-8
545
2.9375
3
[]
no_license
package operacija; public class BasicOperacija extends Operacija { public enum BasicOperacije { Addition, Subtraction, InverseSubtraction, Multiplication, Division, InverseDivision, Power, Logarithm, Abs, Min, Max, Invert, Grayscale, BlackAndWhite, Median } public enum BasicOper...
Python
UTF-8
1,233
3.625
4
[]
no_license
# intersection for sorted arrays class Solution: # O(n + m) def intersection(self, nums1, nums2): if nums1 is None or 0 == len(nums1) or nums2 is None or 0 == len(nums2): return [] result, idx1, idx2 = [], 0, 0 while idx1 < len(nums1) and idx2 < len(nums2): ...
PHP
UTF-8
501
2.921875
3
[]
no_license
<?php class Empresa{ private $nome; private $empresa; private $cenario; public function getNome(){ return $this ->nome; } public function setNome($nome){ $this->nome = $nome; } public function getEmpresa(){ return $this ->empresa; } public function setEmpresa($empresa){ $this->empres...
C++
UTF-8
567
2.71875
3
[]
no_license
/* #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <iostream> #include <set> using namespace std; typedef long long ll; class mCmp{ public: bool operator()(const int a, const int b) const{ return a > b; } }; int main() { int N; scanf("%d", &N); char ch[10]; int num; set...
Markdown
UTF-8
2,956
3.71875
4
[]
no_license
## 嵌套类应用 **嵌套类** **• 嵌套类:Nested classes** **–静态嵌套类:Static nested classes,即类前面有class修饰符** **–非静态嵌套类:Non-static nested classes, 又名内部类,Inner classes** **• 普通内部类(又翻译为:成员内部类)** **• 局部内部类(Local classes)** **• 匿名内部类(Anonymous classes)** **– https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html** ...
Shell
UTF-8
1,414
2.609375
3
[]
no_license
# Based on Ubuntu-16.04 # update sudo apt-get update # install vim sudo apt-get install vim # install ipython sudo apt-get install ipython # install pwntools sudo apt-get install python2.7 python-pip python-dev git libssl-dev libffi-dev build-essential sudo pip install --upgrade pip sudo pip install --upgrade pwntools ...