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
JavaScript
UTF-8
1,987
2.921875
3
[]
no_license
import { useState } from "react"; import FormInput from "./formInput.js" const ExpenseForm = (props) => { const [formValue, setFormValue] = useState({ description: "", price: 0, date: null, }) const [description, setDescription] = useState(""); //description là 1 biến còn setDescription là 1 function...
PHP
UTF-8
1,077
2.921875
3
[ "MIT" ]
permissive
<?php namespace App\Api\Controller; use App\Api\Formatter\UnitFormatter; use App\Game\ManagerInterface; use Symfony\Component\HttpFoundation\Response; class GameController { /** * @var ManagerInterface */ private $manager; /** * GameController constructor. * @param ManagerInterface $m...
Python
UTF-8
243
3.640625
4
[]
no_license
def busca(sequencia, item_procurado): for i in range(len(sequencia)): if sequencia[i] == item_procurado: return True sequencia = ['leo','joao','geracy'] if busca(sequencia,'leo') == True: print("Encontrado")
Python
UTF-8
158
2.78125
3
[]
no_license
"""Draw square""" from turtle import * def task_2(): for _ in range(4): forward(90) left(90) if __name__ == '__main__': task_2()
Python
UTF-8
788
2.71875
3
[]
no_license
import json from soup_helpers import get_soup_for_url def fetch_name_for_id(id): url = 'https://www.elitegsp.com/posts/?id={}'.format(id) soup = get_soup_for_url(url) title = soup.find(id='posts_title') if title: character_name = title.text.split("'")[0] return character_name name_to_id = {} id_to_name ...
Java
UTF-8
822
2.46875
2
[]
no_license
package edu.uga.cs.evote.logic.impl; import java.util.List; import edu.uga.cs.evote.EVException; import edu.uga.cs.evote.entity.Voter; import edu.uga.cs.evote.object.ObjectLayer; public class DeleteVoterAccountCtrl{ private ObjectLayer objectLayer = null; private String userName = null; public DeleteV...
Markdown
UTF-8
89
2.671875
3
[]
no_license
# Basic-Portfolio Week 1 Homework Assignment whereupon I create my own portfolio website
Markdown
UTF-8
922
3.203125
3
[]
no_license
# Navigation - [Navigation](#navigation) - [Links](#links) - [Solution 1 贪心,模拟入栈和出栈操作](#solution-1-%e8%b4%aa%e5%bf%83%e6%a8%a1%e6%8b%9f%e5%85%a5%e6%a0%88%e5%92%8c%e5%87%ba%e6%a0%88%e6%93%8d%e4%bd%9c) # Links 1. https://leetcode-cn.com/problems/zhan-de-ya-ru-dan-chu-xu-lie-lcof/ # Solution 1 贪心,模拟入栈和出栈操作 1. 设置一个辅助栈sta...
C#
UTF-8
4,464
3
3
[]
no_license
using System; using System.Globalization; namespace HSMSDriver { internal class Str2SecsItem { internal static byte[] GetBinary(string data) { string[] strArray = data.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); byte[] buffer = new byte[strArray.Length]; for...
Java
UTF-8
118
1.882813
2
[]
no_license
package uni.dao; import uni.model.Payment; public interface PaymentDAO { void addPayment(Payment p); }
Java
UTF-8
209
1.804688
2
[]
no_license
package Entities; import java.util.ArrayList; import java.util.List; public class SupProcessActivity { public int SupProcessID; public List<Activity> ActivitiesDBList = new ArrayList<Activity>(); }
Markdown
UTF-8
2,702
3.3125
3
[]
no_license
# 06.橋接模式 Bridge ## 講解 ### 橋接模式 橋接模式,是讓兩個"介面"接再一起,實現已組合代替繼承的作法 例子:手機品牌與手機軟體 這兩個是分開的項目,若是用繼承方式,會變成過多的類別,所以用組合方式實現 ```puml @startuml scale 1.5 skinparam classAttributeIconSize 0 abstract class 手機軟體{ } abstract class 通訊錄{ } abstract class 遊戲{ } 手機軟體 <|-- 通訊錄 手機軟體 <|-- 遊戲 遊戲 <|-- A品牌遊戲 遊戲 <|-- B品牌遊戲 遊戲 <|-- C品牌遊戲 ...
Java
UTF-8
1,658
2.9375
3
[]
no_license
package advanced; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util....
TypeScript
UTF-8
1,844
2.734375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
import Matter from './matter'; import {PhysicsType} from './Physics'; import {GameObject} from '@eva/eva.js'; declare interface BodyOptions { chamfer?: number; // 斜切角 angle?: number; // 旋转角 isStatic?: boolean; density?: number; // 密度; restitution?: number; // 回弹系数 velocity?: number; // 速率 speed?: number; ...
Java
UTF-8
2,994
2.03125
2
[]
no_license
package com.yaytech.MesProject.config; import com.zaxxer.hikari.HikariDataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.boot.contex...
Markdown
UTF-8
1,133
2.796875
3
[]
no_license
--- title: "Paper notes: Type-based memory allocator hardening notes" layout: post tags: - paper notes - isolated heap - memory allocator hardening - type-safety --- Internet Explorer's new `g_hIsolatedHeap` mitigation is like a poor man's type-safe memory reuse implementation. "Poor man's" since instead of rea...
C++
GB18030
369
3.296875
3
[]
no_license
#include <iostream> #include<string.h> #pragma warning(disable:4996) using namespace std; class student { private: char name[20]; int age; public: student(const char n[], int a) { strcpy(name, n); age = a; } void show() { cout << "ѧΪ" << name << "ǣ" << age << endl; } }; int main() { student AA("", 20); ...
Ruby
UTF-8
1,793
3.390625
3
[]
no_license
require_relative 'deck' require_relative 'player' require_relative 'dealer' require_relative 'interface' class Game include Interface INITIAL_BALANCE = 100 RATE = 10 attr_accessor :bets attr_reader :deck, :player, :dealer def initialize @deck = Deck.new @player = Player.new(ask_the_name) @dea...
C
UTF-8
10,205
2.796875
3
[ "MIT" ]
permissive
#include "pass.h" int _pass_log_dom = -1; Clipboard_Set_Func clipboard_set = NULL; Output_Func output = NULL; /*============================================================================* * Logging Callbacks * *==============================================...
TypeScript
UTF-8
824
2.859375
3
[]
no_license
import moment = require("moment-timezone") import { IBusinessDayConstraint } from "." import { RangeConstraint } from "./RangeConstraint" export class BetweenDates extends RangeConstraint implements IBusinessDayConstraint { static readonly FORMAT = "YYYY-MM-DD" constructor(minDate: string, maxDate: string...
Go
UTF-8
18,995
2.6875
3
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
package lr import ( "bytes" "fmt" "io" "os" "sort" "text/scanner" "github.com/emirpasic/gods/lists/arraylist" "github.com/emirpasic/gods/sets/treeset" "github.com/emirpasic/gods/utils" "github.com/npillmayer/gotype/syntax/lr/iteratable" "github.com/npillmayer/gotype/syntax/lr/sparse" ) // TODO: Improve do...
C
UTF-8
3,124
2.5625
3
[ "BSD-3-Clause-LBNL" ]
permissive
/** * A struct storing the configuration of the indexing procedure. */ typedef struct { int parallelism; /** < parallelism of metadata index */ // index_anchor_t *_idx_anchor; /** < an internal instance of root index_anchor */ int rank; /**...
Markdown
UTF-8
1,254
3.3125
3
[]
no_license
# Utilizando estilos Globais Diferente do estilo escopado para o componente, o Estilo Global como o próprio nome diz, faz referência a todo o projeto. Podendo ser utilizado dentro de qualquer componente do REACT. Dentro da pasta _**src**_, crie uma pasta _**styles**_.Nesta pasta crie o arquivo _**global.js**_ e adici...
C#
UTF-8
1,314
2.828125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using MongoDB.Driver; using MOKJU_API.Models; using Microsoft.Extensions.Configuration; namespace MOKJU_API.Services { public class ShopService { private readonly IMongoCollection<Shop> _shop; pub...
SQL
UTF-8
768
2.703125
3
[]
no_license
--liquibase formatted sql --changeset converter:baseline dbms:mysql,mariadb runOnChange:true ALTER TABLE ArtistInstance ADD FOREIGN KEY (ArtistId) REFERENCES Artist(ArtistId); ALTER TABLE GenreAssign ADD FOREIGN KEY (GenreId) REFERENCES Genre(GenreId); ALTER TABLE GenreAssign ADD FOREIGN KEY (ArtistInstanceId) REFE...
TypeScript
UTF-8
3,190
2.8125
3
[]
no_license
/* eslint-disable @typescript-eslint/camelcase */ import { Definition } from '../../shared/models/define/define-models'; import { DefineService } from './define.service'; const testArray: Definition[] = [ { definition: 'one', permalink: 'https://urbandictionary.com/whatever', thumbs_up: 12, author: 'j...
Python
UTF-8
2,988
2.53125
3
[ "Apache-2.0" ]
permissive
import torch import torch.nn as nn import torch.distributions as dist import torch.nn.functional as F import numpy as np import math def loss_function(recon_x,x,mu,logstd,rec_log_std=0,sum_samplewise=True): """ recon_x : reconstructed sample x : sample mu: mean of sample logstd: log of std deviat...
Java
UTF-8
264
2.296875
2
[]
no_license
public class RmvFdLCh { public static void main(String[] args) { String str="maybe"; String s=""; //for(int i=0;i<str.length();i++){ s=str.substring(1,str.length()-1); System.out.println(s); } }
Java
UTF-8
732
2.4375
2
[]
no_license
package com.kgc.xml; import org.aspectj.lang.ProceedingJoinPoint; public class Handler { //切面 公共的代码 增强类 public void login(){ System.out.println("验证登录通过!!!"); } public void afterReturn(){ System.out.println("后置增强"); } //ProceedingJoinPoint执行连接点 public void around(Proce...
Markdown
UTF-8
8,153
2.546875
3
[]
no_license
--- description: "Simple Way to Prepare Quick Beef short ribs" title: "Simple Way to Prepare Quick Beef short ribs" slug: 2182-simple-way-to-prepare-quick-beef-short-ribs date: 2021-01-16T04:25:04.631Z image: https://img-global.cpcdn.com/recipes/00d709441d6b005e/751x532cq70/beef-short-ribs-recipe-main-photo.jpg thumbna...
Shell
UTF-8
3,622
2.6875
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
#!/bin/sh # # (c) 2019 Copyright, Real-Time Innovations, Inc. All rights reserved. # # RTI grants Licensee a license to use, modify, compile, and create derivative # works of the Software. Licensee has the right to distribute object form # only for use with RTI products. The Software is provided "as is", with no # w...
Java
UTF-8
380
2.53125
3
[]
no_license
import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.util.NoSuchElementException; import java.io.FileNotFoundException; public abstract class Plan{ private String name; protected Plan(String name){ this.name=name; } public String getName(){return na...
JavaScript
UTF-8
1,351
2.796875
3
[]
no_license
//1-require express validator const {body, validationResult} = require('express-validator') const registerValidators = () => [ body('firstName', "The first name is required").notEmpty(), body('lastName', "The last name is required").notEmpty(), body('email', "Invalid email").isEmail(), body('password'...
C++
UTF-8
1,484
3.265625
3
[ "MIT" ]
permissive
#include <vector> using std::vector; using std::max; using std::min; class Solution { public: int maximalRectangle(vector<vector<char>>& matrix) { int ret = 0, row = matrix.size(); if (row == 0) return ret; int column = matrix[0].size(); vector<int> left(col...
Shell
UTF-8
248
3.0625
3
[]
no_license
#!/bin/bash # How to use variables a=123 HELLO=$a echo HELLO # HELLO echo "HELLO" # HELLO echo $HELLO # 123 echo ${HELLO} # 123 echo '$HELLO' # $HELLO echo HELLO="A B CDE" echo $HELLO # A B CDE echo "$HELLO" # A B CDE
Markdown
UTF-8
5,060
3.9375
4
[]
no_license
# prop 装饰器 Props是在元素上公开的自定义属性/属性,开发人员可以为其提供值。子组件不应该知道或引用父组件,因此应该使用道具将数据从父组件传递到子组件。组件需要使用@Prop()decorator显式声明它们希望接收的道具。道具可以是数字、字符串、布尔值,甚至是对象或数组。默认情况下,当设置了用@Prop()装饰器装饰的成员时,该组件将有效地重新呈现 ``` import { Prop } from '@stencil/core'; ... export class TodoList { @Prop() color: string; @Prop() favoriteNumber: number; @Prop...
Markdown
UTF-8
1,027
2.96875
3
[]
no_license
# Project Overview This is a web application to demonstrate accessibility, service workers and responsive design and is part of the [Udacity front end web developer nanodegree course][1]. ## Running the application 1. Ensure you have [node and npm][2] installed, and execute the below command to install [live-server...
C
UTF-8
12,743
2.75
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <errno.h> #include <llvm-c/Core.h> #include <llvm-c/TargetMachine.h> #include <llvm-c/Analysis.h> fn read_file(path: *const char) -> *char: var file = fopen(path, "rb") if !file: printf("unable to open '%s': %s\n", ...
C#
UTF-8
3,223
2.640625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Novacode; namespace PSWord { using System.Drawing; using System.Management.Automation; [Cmdlet(VerbsCommon.New, "WordFormatting")] class NewWordFormatting : PSCmdlet { ...
Python
UTF-8
8,090
2.515625
3
[]
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # Copyright (c) 2017 SenseDeal AI, Inc. All Rights Reserved # ################################################################################ """ Author: Tony Qin (tony@sensedeal.ai) Date:2...
Swift
UTF-8
749
2.9375
3
[ "MIT" ]
permissive
import Foundation struct BasketAddResponse: Decodable, Equatable { let message: String } enum BasketAddError: Error, Equatable { case notInStock, noProductWithProductId, unknown case authorizedError(AuthorizedServiceError) } typealias BasketAddResult = Result<Void, BasketAddError> typealias BasketAddComple...
C#
UTF-8
4,559
3.078125
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class MazeGenerator : MonoBehaviour { // display private variables in inspector (materials for the maze) [SerializeField] private Material mazeFloor; [SerializeField] private Material mazeWall; [SerializeField] private ...
JavaScript
UTF-8
3,147
2.59375
3
[]
no_license
$(document).ready(function() { let jpgBtn = new Btn("jpg"); let pngBtn = new Btn("png"); jpgBtn.disable(); pngBtn.disable(); $('#file-btn').on('change', function(e) { const file = e.target.files[0] if (file.length === 0) { alert('出错了, 文件不能为空') return } let reader = new FileRea...
Markdown
UTF-8
3,076
3.125
3
[]
no_license
> 在CTF各大类别的题型中,都会有爆破的需求,那么如何优雅的爆破一个32位整数呢?这里分享一个多线程爆破32位整数的一个方法。 --- # 1.脚本与使用须知 - 正常情况下,修改check函数就可以使用。 - thread_num为线程数,默认为cpu核心数,建议不修改,线程远超cpu核心数,多线程反而会变慢。一定要为2的整数次幂。 - print_threshold 为输出枚举中间状态的阈值,凡是遍历到能整除该数的 都将打印出信息,相当于给爆破过程一些反馈。 - bit_num 数字的比特位,默认为32位整数。 - check函数是校验num的正确性的,此处一定要修改。 - 脚本运行结束后,结果会在enumeration_...
C
UTF-8
1,619
3.59375
4
[]
no_license
#include "complex.h" #include <math.h> #include <stdio.h> //Implementation of complex_t functions void print_greeting(){ printf("hello\n"); } complex_t c_zero(){ return c_make(0.0, 0.0); } complex_t c_make(double r, double i){ complex_t result; result.r = sqrt(r*r + i*i); ...
JavaScript
UTF-8
424
3.15625
3
[]
no_license
function staircase(n){ for(var i=0;i<n;i++){ for(var q=0;q<=i;q++){ process.stdout.write("#") } console.log('\n') } } function pyramid(n){ for(var i=0;i<=n;i++){ for(var k=i;k<n;k++){ process.stdout.write(" ") } for(var j=0;j<(2*i-1);j...
Markdown
UTF-8
911
2.609375
3
[]
no_license
# MEMORY CORRUPTION EXPLOITS This repository contains exploits written while going through [opensecuritytraining's] course on [Introduction_To_Software_Exploits]. The course instructor introduces the memory corruption vulnerabilities and concepts in step-by-step manner. An awesome course that adding a lot to knowledge...
Markdown
UTF-8
3,483
2.96875
3
[]
no_license
title=Jakarta EE application multi module gradle template date=2019-08-08 type=post tags=jakartaee, gradle status=published ~~~~~~ In this post i will share simple and useful **gradle** template to organize multi module Jakarta EE application. We will implement typical one which consists from REST controller (**module1...
Ruby
UTF-8
5,895
2.90625
3
[]
no_license
require 'java' require 'yaml' OTTO_VERSION = "0.6.0" # distance between fields at minimum zoom, # and between animals or trees at maximum zoom. STEP_X = 25 STEP_Y = 12 ROBOT = java.awt.Robot.new class Field attr_reader :plots def initialize(x, y, rows, columns, color="none") @plots = generate_plot_list(x...
Java
UTF-8
349
3.28125
3
[]
no_license
package generics; import java.util.Iterator; import java.util.Vector; public class IteratorEx { public static void main(String[] args) { Vector<Integer> v = new Vector<Integer>(); v.add(5); v.add(15); v.add(52); v.add(512); Iterator<Integer> it = v.iterator(); while(it.hasNext()) { System.out.pri...
Java
UTF-8
1,088
2.171875
2
[]
no_license
package ru.dmrval.kafkaconsumer.topologyConfig; import org.apache.kafka.streams.KeyValue; import org.apache.kafka.streams.kstream.Transformer; import org.apache.kafka.streams.kstream.TransformerSupplier; import org.apache.kafka.streams.processor.ProcessorContext; import ru.dmrval.kafkaconsumer.model.Address; import ru...
C++
UTF-8
20,855
2.71875
3
[]
no_license
#include "MyGLImageViewer.h" MyGLImageViewer::MyGLImageViewer() { auxDepthBuffer = (float*) malloc(640 * 480 * sizeof(float)); depthBuffer = (unsigned char*) malloc(640 * 480 * 3 * sizeof(unsigned char)); } MyGLImageViewer::~MyGLImageViewer() { delete [] auxDepthBuffer; delete [] depthBuffer; } void MyGLImageV...
PHP
UTF-8
2,423
3.4375
3
[]
no_license
<?php /** * Created by PhpStorm. * User: susucool(527237808@qq.com) * Date: 2018/9/6 * Time: 15:27 */ // 可变标识符 $i = 3; $k = 'i'; echo $$k.'<br>'; function func(){ echo 'hello<br>'; } // 可变函数 $i = 'func'; $i(); // 可变类 可变属性 class CLS { public $k = 'variable value<br>'; } $i = 'CLS'; $j = 'k'; $l = new $...
Go
UTF-8
577
2.734375
3
[]
no_license
package main import ( "flag" "fmt" "github.com/goplog/run" "log" "os" "strings" ) func main() { var cfg string fs := flag.NewFlagSet("goplog", flag.ExitOnError) fs.Usage = func() { fmt.Println(Help()) os.Exit(0) } fs.StringVar(&cfg, "c", "cfg.confg", "configuration file") fs.Parse(os.Args[1:]) f, e...
C#
UTF-8
1,448
3.09375
3
[]
no_license
using System; using System.IO; using Sokoban.Core; namespace Sokoban.ToyApp { class Program { public static void Main(string[] args) { if (args.Length != 1) { Console.WriteLine("Usage: ToyApp <puzzle_file>"); return; } var puzzleFilePath = args[0]; Puzzle puzzle; using (var reade...
Java
UTF-8
1,371
2.03125
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 mx.edu.um.dii.labinterfaces.diasetproject.service.impl; import java.util.List; import mx.edu.um.dii.labinterfaces.diasetprojec...
Python
UTF-8
2,637
3.9375
4
[]
no_license
# flows are used to describe the dependencies between tasks # if tasks are like functions, we can think of a flow as a script that combines them # when you build a flow in Prefect, you're defining a computational graph that can be executed in the future # the pattern is always the same: step 1 is to build a flow, step...
C#
UTF-8
1,829
3.21875
3
[]
no_license
using ExceptionCore; using ExceptionCore.Bussiness; using ExceptionCore.Critical; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ExceptionHandler { class Program { static void Main(string[] args) { int o...
Python
UTF-8
4,140
2.640625
3
[ "MIT" ]
permissive
"""test_example .. codeauthor:: John Lane <john.lane93@gmail.com> """ from flask import url_for from eve import Eve import pytest from mockerena.format import generate_xml_template @pytest.mark.file_format def test_generate_xml_template_flat(): """Generate xml template should accept flat structure :raise...
Swift
UTF-8
4,768
2.875
3
[ "MIT" ]
permissive
// // AdmitadTrackingType.swift // AdmitadSDK // // Created by Dmitry Cherednikov on 28.09.17. // Copyright © 2017 tachos. All rights reserved. // import Foundation /** Represents type of an event and also contains additional information depending on the exact type. - *installed*: Installed event. - *confirmed...
Java
UTF-8
5,411
2.828125
3
[]
no_license
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class Rename { public static void main(String[] args) { String cm = args[0]; ...
Java
UTF-8
2,518
2.6875
3
[ "MIT" ]
permissive
package test.udp; import com.alibaba.fastjson.JSONObject; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; public class UdpTest { public static void main(String[] args) { // ipAddressIsable(); udpGB(); } public static void ipAddressIsable(){ ...
Python
UTF-8
1,945
2.59375
3
[]
no_license
from datetime import date from geopy import Nominatim import datetime import wolframalpha def get_details(lat,lon): coord=[] coord.append(lat) coord.append(lon) geolocator=Nominatim(user_agent="test/1") #print('{coord[0]},{coord[1]}') coord1="{},{}".format(lat,lon) location =geolocator.reverse(coord1) s=locatio...
Markdown
UTF-8
20,381
2.765625
3
[]
no_license
--- layout: git title: Denoising with Generative Models published: true description: Semester Project - EPFL github: 'https://github.com/Billotais/Denoising-with-Generative-Models' --- Semester Project by [Loïs Bilat](mailto:lois@bilat.xyz) at VITA Lab - EPFL - Fall 2019 Supervised by [Alexandre Alahi](mailto:alexand...
JavaScript
UTF-8
1,316
2.875
3
[]
no_license
/** * 一覧表示領域(1行分の表示を含む) * Created by tetsuya.matsuura on 2015/11/10. */ define([ 'backbone', '..//views/ItemView' ], function (Backbone, ItemView) { var ListView = Backbone.View.extend({ // インスタンス生成時に実行 initialize: function () { console.log("[View]ListView::initialize()"); ...
SQL
UTF-8
6,840
3.15625
3
[]
no_license
CREATE TABLE IF NOT EXISTS `department` ( `id` int(50) NOT NULL AUTO_INCREMENT, `depart_code` varchar(4) collate utf8_general_ci NOT NULL, `depart_name` varchar(100) collate utf8_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 ; CR...
Java
UTF-8
136
1.585938
2
[ "Apache-2.0" ]
permissive
package org.tain.mybatis.service; import org.tain.mybatis.vo.UsrVo; public interface MainService { public UsrVo getUsr(); }
Python
UTF-8
515
2.65625
3
[]
no_license
import unittest from time import sleep from Eternal_Utils.Timer import Timer class TestTimer(unittest.TestCase): def test___enter__(self): timer = Timer() self.assertIsNotNone(timer.__enter__().start) def test___exit__(self): timer = Timer(True) timer.__enter__() slee...
Java
UTF-8
2,878
2.5625
3
[]
no_license
package com.example.spreadtrumshitaoli.threaddemo; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.View; import android.widget.Button; import static com.example.spreadtrumshitaoli.threaddemo.MainActivity.TAG; /** * Created by SPREADTRU...
JavaScript
UTF-8
4,486
2.640625
3
[ "MIT" ]
permissive
'use strict'; const knex = require('../db'); const moment = require('moment'); const tableName = 'journalentries'; const entryTypes = [ 'note', // User created 'warning', // System created warning 'chore', // System created info message ]; const Journal = { createEntry: function(user_id, type, entr...
C++
UTF-8
1,345
3.140625
3
[]
no_license
#ifndef NODODOBLE_H #define NODODOBLE_H #include <iostream> using namespace std; template <class T> class NodoDoble{ private: T elemento; NodoDoble<T>* izq; NodoDoble<T>* der; int FE; public: NodoDoble(T elemento); NodoDoble(NodoDoble<T>* a,T elemento,NodoDoble<T>* d); void setDato(T a); vo...
Java
UTF-8
1,849
2.734375
3
[]
no_license
package lp.model.pathfinder.a_star; import lp.model.position.Apex; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import static java.lang.String.format; public class AStarNode implements Comparable<AStarNode> { @NotNull private final Integer heuristicValue; @NotNull pr...
Markdown
UTF-8
6,232
2.765625
3
[ "MulanPSL-2.0", "LicenseRef-scancode-mulanpsl-2.0-en", "LicenseRef-scancode-unknown-license-reference" ]
permissive
--- --- --- title: 第九百一十八夜 --- 夜幕降临,莎赫札德接着讲故事: 幸福的国王陛下,当宫仆刚抬脚进御膳房门时,舍马斯宰相走上前去对宫仆说:“孩子,老夫我想见国王一面,有要事向国王禀报。等国王吃罢午饭,心情好时,劳你代我求见国王,但愿国王允许我晋见,以便当面禀报要事。” “我一定照办!”宫仆说。宫仆端着午膳给国王送去。 沃尔德汗国王用过午饭,情绪甚好,宫仆说:“国王陛下,舍马斯宰相在门外站着求见,说有要事禀报。” 国王听后一惊,不知禀报何事,随口对宫仆说:“让他进来吧!” 舍马斯宰相听说国王让他进来,心中甚为高兴,遂迈步朝国王的后宫走去。舍马斯宰相来到国王面前,行过礼,亲吻国王的...
TypeScript
UTF-8
1,018
3.703125
4
[ "MIT" ]
permissive
interface People { [name: string]: string; } function range(num: number): number[] { return [...Array(num).keys()]; } function shuffle(array: any[]): void { let m = array.length; let i: number; let t: any; while (m) { i = Math.floor(Math.random() * m--); t = array[m]; a...
C++
UTF-8
4,468
2.84375
3
[]
no_license
#include "obstacle.hpp" #include <iostream> using namespace std; Obstacle::Obstacle(const sf::Vector2u &windowSize) : mWindowSize(windowSize) { if (!mObsTextureMap[NINV].loadFromFile("./Assets/sprites/pipe-green.png")) { //error exit(0); } if (!mObsTextureMap[INV].loadFromFile("./Asset...
Markdown
UTF-8
15,859
2.5625
3
[]
no_license
[![Release](https://jitpack.io/v/Jagerfield/Android-Utilities-Library.svg)](https://jitpack.io/#Jagerfield/Android-Utilities-Library) [![Downloads](https://jitpack.io/v/Jagerfield/Android-Utilities-Library.svg/month.svg)](#download) # Android Utilities Library While developing Andorid apps, I gathered the functions t...
Java
UTF-8
425
1.6875
2
[]
no_license
package com.dalyTools.dalyTools.DAO.Repository.taskRepo; import com.dalyTools.dalyTools.DAO.Entity.task.DayTask; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; import javax.swing.tex...
JavaScript
UTF-8
194
2.828125
3
[]
no_license
let started = false; function setup() { createCanvas(700, 400); noLoop(); } function draw() { if (started) { background(256); } } function start() { started = true; loop(); }
PHP
UTF-8
4,085
2.65625
3
[]
no_license
<?php //This script for the smiley thing function smiley($text){ $text =stripcslashes(" ".$text." "); //$text= preg_replace('@((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)@', '<a href="$1" class="linkTe" target="_blank">$1</a>', $text); $text = preg_replace("# :D #siU","<div class='smileyp...
C#
UTF-8
3,540
2.59375
3
[]
no_license
using EvaluationAssistt.Data.Interface; using EvaluationAssistt.Domain.Entity; using EvaluationAssistt.Infrastructure.Helpers; using System; using System.Collections.Generic; using System.Linq; using EvaluationAssistt.Domain.Dto; namespace EvaluationAssistt.Service.Services { public class GroupsService { ...
PHP
UTF-8
4,030
2.5625
3
[]
no_license
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <title>Table</title> <link rel="stylesheet" href="css/style.css"> <style> #below { height:600px; width:100%; } img { ...
Markdown
UTF-8
4,727
2.796875
3
[]
no_license
# 华为2019软件精英挑战赛--初赛33名 ### <a href = "https://codecraft.huawei.com/Generaldetail">赛题介绍</a> ### 队伍名称:TestNWPU ### 队员:高轶群,曹悦 ./src/CodeCraft-2019.py 是调度代码 ./data/ 存放着数据 运行方式:python3 CodeCraft-2019.py ../data/1-map-exam-1/car.txt ../data/1-map-exam-1/road.txt ../data/1-map-exam-1/cross.txt ../data/...
C
UTF-8
13,988
2.734375
3
[ "MIT" ]
permissive
/************************************************************************** ** ** svd3 ** ** Quick singular value decomposition as described by: ** A. McAdams, A. Selle, R. Tamstorf, J. Teran and E. Sifakis, ** Computing the Singular Value Decomposition of 3x3 matrices ** with minimal branching and elementary floating...
Python
UTF-8
264
2.875
3
[]
no_license
import sys lst = [] for k in range(10): n = int(input()) lst.append(n) per = {} for x in lst: if x not in per: per[x] = 1 else: per[x] += 1 max_key = max(per, key=per.get) avg = int(sum(lst) / len(lst)) print(avg) print(max_key)
Java
UTF-8
4,130
2.21875
2
[]
no_license
package com.example.amit.viewpagerexample; import android.content.Context; import android.media.AudioManager; import android.media.MediaPlayer; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; imp...
Shell
UTF-8
857
2.75
3
[]
no_license
#!/bind/bash #Code Review 01-27-17 Rance Nault, Daria Tarasova echo $1 >> Monitoring/delete.log if [ -d public/cors_demo/$1 ]; then echo $1 exists >> Monitoring/delete.log fi echo '-x '$1 > public/services/manta-sync-ignore.txt # Remove from manta and local rm -r public/cors_demo/$1 mrm -r ~~/stor/cors_demo/$1 rm...
Java
UTF-8
1,352
1.84375
2
[]
no_license
package edu.kalum.notas.core.models.entities; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.*; import java.io.Serializable; import java.ut...
Java
UTF-8
827
2.15625
2
[]
no_license
package braxtion.io.athent.controllers; import braxtion.io.athent.models.Secret; import braxtion.io.athent.repositiory.SecretRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; impor...
PHP
UTF-8
938
2.84375
3
[ "BSD-3-Clause" ]
permissive
<?php namespace common\helpers; use Yii; /** * Created by PhpStorm. * User: hu yang * Date: 2018/2/8 * Time: 上午10:29 */ final class RedisHelper { final static function getKey($key) { return md5($key.__CLASS__); } /** * redis 计数器 +1 * * @param $key * @param int $e...
C
UTF-8
17,168
3.0625
3
[]
no_license
/*! @file Button.c @author Noel Ho Sing Nam (s.ho) @course CSD1400 @section A @brief Handles button display properties and their functions *//*__________________________________________________________________________ _*/ #include "Button.h" #include "Scene.h" #include "TestScene1.h" #include <std...
Java
UTF-8
201
1.960938
2
[ "Apache-2.0" ]
permissive
package pro.alexzaitsev.freepager.library.view.infinite; import android.view.View; /** * * @author A.Zaitsev * */ public interface ViewFactory { View makeView(int vertical, int horizontal); }
Swift
UTF-8
943
2.734375
3
[]
no_license
// // Deposits.swift // Coke // // Created by Deepak on 21/02/17. // Copyright © 2017 IOS Development. All rights reserved. // import Foundation struct Deposit { let depositAmount : Int let productId : Int let productName : String let productQty : Int init(dictionary : [String : AnyObject...
C++
UHC
4,011
3.3125
3
[]
no_license
#include<iostream> #include<string> #include<algorithm> #include<map> #include<tuple> using namespace std; int n, k; string w[2][55]; //Է ־ ܾ . w[0] ״ , w[1]  . const int MOD = 835454957; struct State{ int len; //߰ؾ ϴ ڿ string stick; //Ƣ ڿ int dir; //, ̸ 0, ̸ 1 State(int _len, string _stick, int _dir) :...
Java
UTF-8
632
2.609375
3
[]
no_license
package BidInfoData; import Client.ClientInfo; import java.util.Date; /** * Created by Namila on 10/6/2017. */ public class BidInfo { private ClientInfo clientInfo; private double bidValue; private Date date; public BidInfo(ClientInfo clientInfo,double bidvalue){ this.client...
Markdown
UTF-8
2,142
3.21875
3
[]
no_license
--- layout: post title: mimno给的机器学习建议 category: 资源帖 tags: [数据科学, 资源合集] description: mimno的机器学习建议 --- written by david mimno One of my students recently asked me for advice on learning ML. Here’s what I wrote. It’s biased toward my own experience, but should generalize. > 推荐三本书 My current favorite introduction is K...
Python
UTF-8
1,499
4.375
4
[]
no_license
#!/usr/bin/python # Env: python3 # Rewrite by afei_0and1 ''' 34、罗马数字转整数 罗马数字表示: I #表示数值:1 V #表示数值:5 X #表示数值:10 L #表示数值:50 C #表示数值:100 D #表示数值:500 M #表示数值:1000 罗马数字书写规则: 一般情况下罗马数字在编写时,如果小的数字出现在大的数字的右边,则它们是相加关系。例如数值2 会写作II;当小的数字出现在大的数字左边时,它们是相减关系。例如:数值4会写作IV。对于小的数字出现 在大的数字左边...
Python
UTF-8
2,255
2.90625
3
[]
no_license
import numpy as np from music21 import * def load_midi_file(path): mf = midi.MidiFile() mf.open(path, 'rb') # read in the midi file mf.read() mf.close() return mf def lowest_highest_octave(stream): # octaves = [note.pitch.octave for note in stream.flat.notes] # return min(octaves), ...
Markdown
UTF-8
1,122
3.046875
3
[]
no_license
# 第1章 IPv6 IPv6 是指第 6 版因特网协议(Internet Protocol version 6),在它的名字中已经表明了它的重要性 —— 与因特网一样重要!因特网协议(Internet Protocol,简称 IP)是解决不同网络间互联需求的解决方案,并且已经成为了各种数字通信的“事实标准”。现在,大多数能够收发数字信息的设备都存在因特网协议。 IETF(Internet Engineering Task Force)组织负责对因特网协议进行标准化工作。通过标准化,可以保证不同厂商的软件具有通用性。因特网协议是一个至关重要的标准,因为现在几乎所有的东西都使用因特网协议连接到互联网中。所有的通用操作系统和网络库都...
C++
UTF-8
2,349
3.578125
4
[]
no_license
#include <iostream> using namespace std; class PersonaV4 { /* - MODIFICADORES DE ACCESO - +------------------------------------------------------------------+ | Modificador | Clase | SubClase | Paquete | Todos | +------------------+-----------+-----------+-----------+-----------...
JavaScript
UTF-8
2,457
2.875
3
[ "MIT" ]
permissive
const http = require('http'); const net = require('net'); module.exports = (function() { function Howru(options) { this.type = options.type || 'http'; if (this.type == 'http') { this.route = options.route || '/health'; this.port = options.port || 6999; } else if (th...