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
3,686
2.3125
2
[]
no_license
package com.example.myapplication2; import android.app.DatePickerDialog; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import a...
TypeScript
UTF-8
1,388
2.53125
3
[]
no_license
import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable, of } from 'rxjs'; import { catchError, map, tap } from 'rxjs/operators'; import { Application } from './application'; @Injectable({ providedIn: 'root' }) export class ApplicationsService {...
Markdown
UTF-8
2,928
2.703125
3
[ "Apache-2.0" ]
permissive
# Development Workflow The following graph shows the workflow how to develop KubeSphere backend. For the frontend part please refer to [KubeSphere console](https://github.com/kubesphere/console) ![ks-workflow](/images/ks-workflow.png) ## Step 1. Fork 1. Visit https://github.com/kubesphere/kubesphere 2. Click `Fork`...
JavaScript
UTF-8
1,972
3.734375
4
[]
no_license
/*let facto = function findFactorial(x) { let fact = 1; if(x<0) fact = null; else if(x==1||x==0) fact = 1; else { //for(let i=x;i>=1;i--) // fact = fact*i; for(let i=1;i<=x;i++) fact = fact*i; } return fact; }; console.log(facto(-1));*/ /*let removeVowelsAndSpaces = function(givenString){ ...
Java
GB18030
305
2.390625
2
[]
no_license
package com.leetcode; import java.util.List; public class Exercise54 { public static void main(String[] args) { } public List<Integer> spiralOrder(int[][] matrix) { //һ˱߽磬˳ʱתһ //ͬʱҲҪʹñ return null; } }
Python
UTF-8
540
3.03125
3
[]
no_license
# VSCraft ''' задача: https://projecteuler.net/problem=1 перевод: http://euler.jakumo.org/problems/view/1.html Если выписать все натуральные числа меньше 10, кратные 3 или 5, то получим 3, 5, 6 и 9. Сумма этих чисел равна 23. Найдите сумму всех чисел меньше 1000, кратных 3 или 5 ''' # solved 07.05.2019 13:48 (233168)...
JavaScript
UTF-8
1,134
3.671875
4
[ "Unlicense" ]
permissive
// DESAFIO 2 console.log('--- \nDesafio 2'); const usuarios = [ { nome: 'Diego', idade: 23, empresa: 'Rocketseat' }, { nome: 'Gabriel', idade: 15, empresa: 'Rocketseat' }, { nome: 'Lucas', idade: 30, empresa: 'Facebook' }, ]; const idades = []; const rockets = []; let googles; usuarios.map( usuario => { const ...
Java
UTF-8
1,955
2.375
2
[]
no_license
package com.test; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; public class JavaS...
Markdown
UTF-8
1,066
2.796875
3
[ "MIT" ]
permissive
## 注册接口 #### 1. URL /api/v1/auth/register #### 2. 请求方式 POST #### 3. 请求头 - nickname,必须有,昵称 - email,必须有,邮箱 - password,必须有,密码 - X-Deviceid,必须有 - timestamp, 时间戳 - nonce, 随机数 - signature, 加密签名, signature=SHA1(timestamp+nonce+token) > 这里是第一次请求,所以不带token,使用默认的token--32位的1 > 后端需对timestamp进行校验,防止重放攻击(Replay attack) > 此处直...
Java
UTF-8
529
2.15625
2
[]
no_license
package com.justfriend.suratuin.Model.Login; public class LoginUser { private String nim; private String password; public LoginUser(String nim, String password) { this.nim = nim; this.password = password; } public String getNim() { return nim; } public void setNa...
Python
UTF-8
1,109
2.953125
3
[]
no_license
import argparse import matplotlib.pyplot as plt import numpy as np if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('file', help='The log file to generate a graph on') args = parser.parse_args() graph = [] lst = open(args.file, 'r').readlines() for i, line in en...
Java
UTF-8
5,211
2.953125
3
[]
no_license
package dtsoft.main.util; import java.util.Random; import dtsoft.main.view.BoardGamePiece; import dtsoft.main.view.adapter.BoardGameAdapter; public class GameUtils { private final int mGameCols = 5; private static GameUtils mThis = null; public static GameUtils getInstance() { if (mThis == nu...
Swift
UTF-8
2,589
2.5625
3
[ "Apache-2.0" ]
permissive
//routes import PerfectHTTP import PerfectHTTPServer import Foundation public func routes() -> Routes { Config() //AutoLogin Routine to save time let autoUser = UserDefaults.standard.string(forKey: "user") ?? "" let autoPass = UserDefaults.standard.string(forKey: "pass") ?? "" //Aut...
Java
UTF-8
3,022
2.3125
2
[]
no_license
package com.aapeli.settingsgui; import java.awt.Color; import java.awt.Component; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; ...
Python
UTF-8
137
2.765625
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thu May 30 21:51:43 2019 @author: Lawrence """ for steps in range (4): print (steps)
C++
UTF-8
714
2.703125
3
[]
no_license
// // Created by Onat Bas on 02/01/17. // #include "AdjacentNeighbourCounter.hxx" #include "AdjacentPopper.hxx" AdjacentPopperResult AdjacentPopper::pop(const StackSet &set, const BoxPosition &position) const { NeighboursInVicinityCounter vicinity; const bool hasEnoughNeighbours = vicinity.hasEnoughNeighbour...
Java
UTF-8
6,247
2.0625
2
[]
no_license
/* * Copyright 2014 Florian Vogelpohl <floriantobias@gmail.com>. * * 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 requir...
Java
UTF-8
1,070
3.28125
3
[]
no_license
package com.my.concurrent.SynchronizedStudy; import java.util.concurrent.TimeUnit; public class MySynchronized { private int id; public synchronized int getId() { /*try { System.out.println("---getId()------- working"); TimeUnit.SECONDS.sleep(2); } catch (InterruptedEx...
Java
UTF-8
1,483
2.359375
2
[]
no_license
package tt.helpsys.dao; import java.util.Date; import tt.helpsys.entity.Message; import tt.helpsys.entity.MessageCriteria; import tt.helpsys.entity.MessageInfo; import tt.helpsys.util.Page; /** * 帖子信息数据访问接口 * @author TRY * */ public interface IMessageDao { /** * 添加帖子 * @param msg 帖子信息 * @return */ int add(...
Java
UTF-8
4,679
2.046875
2
[]
no_license
package git.gitrest.api.services; import git.gitrest.api.dto.NotificationDTO; import git.gitrest.api.model.Notification; import git.gitrest.api.repository.ConfirmationTokenRepository; import git.gitrest.api.repository.NotificationRepository; import git.gitrest.api.repository.ProfileRepository; import git.gitrest.api.r...
Markdown
UTF-8
1,267
2.890625
3
[]
no_license
# 未决信号、阻塞信号、信号处理函数表 > - 实际执行信号的处理动作称为信号递达(Delivery)。 > - 信号从产生到递达之间的状态,称为信号未决(Pending)。 > - 进程可以选择阻塞 (Block )某个信号。 > - 被阻塞的信号产生时将保持在未决状态,直到进程解除对此信号的阻塞,才执行递达的动作。 > - 注意,阻塞和忽略是不同的,只要信号被阻塞就不会递达,而忽略是在递达之后可选的一种处理动作。 ![在这里插入图片描述](https://img-blog.csdnimg.cn/20190528103624308.png?x-oss-process=image/watermark,type_ZmFuZ3poZ...
Java
UTF-8
3,463
2.3125
2
[]
no_license
package cn.zalezone.ui.adapter; import java.util.ArrayList; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.widget.BaseAdapter; import android.widget.But...
Python
UTF-8
251
3.78125
4
[]
no_license
def pattern1(n): m = 2 * n - 2 for i in range(0, n): for j in range(0, m): print(end=" ") m = m - 2 for j in range(0, i + 1): print("* ", end="") print("\r") n = 5 pattern1(n)
Shell
UTF-8
2,513
3.09375
3
[]
no_license
# Maintainer: Muflone http://www.muflone.com/contacts/english/ pkgname=vmware-ovftool pkgver=4.2.0.4586971 pkgrel=1 pkgdesc="VMware Open Virtualization Format tool" arch=('i686' 'x86_64') url="https://www.vmware.com/support/developer/ovf/" license=('custom:vmware') makedepends=('xorg-server-xvfb') depends=('curl' 'exp...
Swift
UTF-8
871
3.46875
3
[]
no_license
// // PetController.swift // Pets // // Created by Ilgar Ilyasov on 8/28/18. // Copyright © 2018 Lambda School. All rights reserved. // import Foundation class PetController { // Create an array to store the Pets. And set it empty private(set) var pets: [Pet] = [] // Create a function to sav...
TypeScript
UTF-8
1,054
2.734375
3
[ "MIT" ]
permissive
import { coinsConfig } from '../utils/configs'; import { Network_type } from '../utils/constants'; import BitcoinChecker from './bitcoin'; class LitecoinChecker extends BitcoinChecker { protected prefix: string = ''; protected type: string = ''; protected hash: Uint8Array = new Uint8Array(); constructor(networ...
Java
UTF-8
2,750
2.25
2
[]
no_license
package uta.mav.appoint.db; import java.sql.SQLException; import java.util.ArrayList; import uta.mav.appoint.TimeSlotComponent; import uta.mav.appoint.beans.*; import uta.mav.appoint.login.*; public class DatabaseManager { private DBImplInterface imp = new RDBImpl(); public Integer createUser(String email, Stri...
Java
UTF-8
1,117
2.953125
3
[]
no_license
package com.training.etiya.java.multithread; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; public class Concurrent2 { public static void main(final String[] args) { ExecutorService newFixedThre...
C++
UTF-8
4,783
2.84375
3
[]
no_license
// Rotary Encoder Inputs #define Rot_1_CLK 31 #define Rot_1_SW 30 #define Rot_1_DT 29 #define Rot_2_CLK 35 #define Rot_2_SW 34 #define Rot_2_DT 33 #define Rot_3_CLK 39 #define Rot_3_SW 38 #define Rot_3_DT 37 #define Brightness 49 #define LCD_Contrast_pin 3 #include <LiquidCrystal.h> #include "Rotary.h"; Rotary ro...
Python
UTF-8
3,408
3.84375
4
[]
no_license
from collections import deque class Tree(object): class TreeNode(object): def __init__(self, key, children=None): self.key = key if children is None: self.children = [] else: self.children = children def is_leaf(self): ...
JavaScript
UTF-8
1,243
3.1875
3
[]
no_license
function scroll() { let h2 = document.querySelector('#slidein'); console.log(window.scrollY); if (0 <= window.scrollY){ h2.className = "animated slideLeft"; } else { h2.className = ""; } } window.addEventListener("scroll", scroll); function scroll2() { let p = document.querySelector('#slidein2'); ...
Java
UTF-8
1,906
2.296875
2
[]
no_license
package com.smart.musicplayer.listener; /** * @date : 2018/11/29 下午5:00 * @author: lichen * @email : 1960003945@qq.com * @description : */ public interface MusicAllCallBack { //开始加载,objects[0]是title,object[1]是当前所处播放器(全屏或非全屏) void onStartPrepared(String url, Object... objects); //加载成功,objects[0]是titl...
Java
UTF-8
3,050
2.546875
3
[ "Apache-2.0" ]
permissive
package com.axway.apim.api.export.lib; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.ParseException; import com.axway.apim.lib.APIMCoreCLIOptions; public class APIExportCLIOptions extends APIMCoreCLIOptions { CommandLine cmd; public APIExportCLIOpt...
Java
UTF-8
2,418
2.078125
2
[ "MIT" ]
permissive
package info.spicyclient.modules.player; import org.lwjgl.input.Keyboard; import info.spicyclient.SpicyClient; import info.spicyclient.events.Event; import info.spicyclient.events.listeners.EventReceivePacket; import info.spicyclient.events.listeners.EventUpdate; import info.spicyclient.modules.Module; import info.sp...
Java
UTF-8
543
2.125
2
[]
no_license
package com.sam.delayorderforjava.entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor public class OrderEntity { private String orderNo; private String orderNote; private String status; @Override public Strin...
Java
UTF-8
411
1.835938
2
[]
no_license
package com.example.soldrec.web.dto; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor public class TrackingNumberDTO { /** * 卖出时间 */ private Long soldTime; /** * 商品名称 */ private String productName;...
Markdown
UTF-8
2,092
3.4375
3
[]
no_license
## 문제 방향 없는 그래프가 주어졌을 때, 연결 요소 (Connected Component)의 개수를 구하는 프로그램을 작성하시오. ## 입력 첫째 줄에 정점의 개수 N과 간선의 개수 M이 주어진다. (1 ≤ N ≤ 1,000, 0 ≤ M ≤ N×(N-1)/2) 둘째 줄부터 M개의 줄에 간선의 양 끝점 u와 v가 주어진다. (1 ≤ u, v ≤ N, u ≠ v) 같은 간선은 한 번만 주어진다. ## 출력 첫째 줄에 연결 요소의 개수를 출력한다. ## 예제 입력 1 ``` 6 5 1 2 2 5 5 1 3 4 4 6 ``` ## 예제 출력 1 ``` 2...
C++
UTF-8
1,303
2.875
3
[]
no_license
#include <iostream> #include <vector> #include <queue> using namespace std; vector<int> R; vector<int> parking; vector<int> W; queue<int> delay; int n, m, cash; int empty_index() { for (int i = 0; i < n; i++) { if (parking[i] == 0) { return i; } } return -1; } int find_index(int x) { x = x * -1; for ...
JavaScript
UTF-8
434
3.03125
3
[]
no_license
'use strict'; var product = { name: 'laptop', price: 234.44 }; var product2 = { name: 'Peanut Butter', price: 5.99 }; product['description'] = 'A fast laptop'; function calculateTax2() { return this.price * .08; } product.calculateTax = calculateTax2; product2.calculateTax = calculateTax2; console.l...
Java
UTF-8
1,083
2.5
2
[]
no_license
package com.example.thelabit.modelo; public class FeedBack { private Integer Freshness; private Integer Dureza; private Integer Recuperacion; private String Comentario; public Integer getFreshness() { return Freshness; } public void setFreshness(Integer freshness) { Fresh...
Markdown
UTF-8
23
2.515625
3
[ "MIT" ]
permissive
# Global-Game-Game-2021
Java
UTF-8
298
1.671875
2
[]
no_license
package com.cnit.yoyo.spider.autohome.service; import java.util.List; import com.cnit.yoyo.spider.common.dto.autohome.pojo.CarColor; /** * 车颜色 * @Author:yangyi * @Date:2015年6月8日 * @Version:1.0.0 */ public interface CarColorService { void addOrUpd(List<CarColor> eList); }
Java
UTF-8
3,707
2.5625
3
[]
no_license
package dao; import java.util.ArrayList; import java.util.List; import model.Avaliacao; import model.Desenvolvedor; import model.Empresario; import model.Lance; import model.Projeto; import model.Usuario; import org.hibernate.Query; import org.hibernate.Session; public class ProjetoDAO extends GenericDAO { public ...
PHP
UTF-8
749
2.5625
3
[]
no_license
<?php /** * Created by PhpStorm. * User: bond * Date: 23/11/2016 * Time: 22:37 */ namespace pamel\core\messages; use pamel\api\core\messages\Exchange as ApiExchange; class Exchange extends ApiExchange { public function getMessage() { return $this->message; } public function getOriginalMe...
Java
UTF-8
18,672
2.390625
2
[]
no_license
package com.ibm.watson.developer_cloud.personality_insights.v2; import java.util.List; import com.ibm.watson.developer_cloud.personality_insights.v2.model.Profile; import com.ibm.watson.developer_cloud.personality_insights.v2.model.Trait; public class PersonalityInsightsExample { public static void main(String[...
Java
SHIFT_JIS
22,820
1.734375
2
[]
no_license
package com.lab.jti.thai; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.location.Criteria; import android.location.Location; import android.location.Locatio...
C#
UTF-8
5,917
2.640625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Net.Http; using System.Runtime.Serialization; using System.Runtime.Serialization.Json; using System.Threading; using System.Threading.Tasks; using C1.DataCollection; namespace C1DataCollection101 { public class YouTubeDataCollection : C1CursorDataCollec...
PHP
ISO-8859-1
1,893
3.171875
3
[]
no_license
<?php /** * @package FormInput * @class FormInputConfiguration * @author Jimmy CHARLEBOIS * @date 25-01-2007 * @brief Classe d'encapsulation des proprits de configuration d'un lment de formulaire */ System::import( 'System.Interfaces.FormInput.IFormInputConfigurati...
PHP
UTF-8
2,094
2.75
3
[]
no_license
<?php require 'menu.html'; require 'database.php'; session_start(); $id = $_SESSION['id']; $usuario = $_SESSION['usuario']; $nombre = $_SESSION['nombre']; $correo = $_SESSION['correo']; $telefono = $_SESSION['telefono']; $password = $_SESSION['password']; ?> <html> <head> <title>Modificar</title> <m...
C#
UTF-8
347
2.59375
3
[ "Apache-2.0" ]
permissive
using System; using System.Collections.Generic; using System.Text; namespace ObserverPattern.Contracts { public interface IWeatherData { double Temperature { get; } double Humidity { get; } double Pressure { get; } void ChangeMeasurements(double temperature, double humidity, d...
TypeScript
UTF-8
219
2.65625
3
[]
no_license
class LogOutCommand{ private token: string; public constructor(token: string){ this.token = token; } public GetToken(): string{ return this.token; } } export default LogOutCommand;
JavaScript
UTF-8
783
3.40625
3
[ "MIT" ]
permissive
const Graph = require('../breadth-first.js') describe('our graph works?', () => { it('can add a node to the graph and can give me all the nodes', () => { let graph = new Graph(); graph.addNode('A'); graph.addNode('B'); graph.addNode('C'); graph.addNode('D'); let no...
Ruby
UTF-8
11,768
2.90625
3
[]
no_license
#!/usr/bin/env ruby # ----------------------------------------------------------------------------- # # File: meds.rb # Description: prints when a medicine will be finishing and sends alert # Also, allow input and update of meds. # Author: j kepler # Date: 2018-02-28 - 23:13 # Las...
Java
UTF-8
2,329
3.171875
3
[]
no_license
/** * Initially created by Roman Gaev * 26.02.2018 * Protocol for communication * <p> * May the force be with you. */ public class Protocol { NewServerThread thread; private static final int AUTH = 0; private static final int PROFILE = 1; private int state = AUTH; public Prot...
Markdown
UTF-8
3,071
2.8125
3
[ "Apache-2.0" ]
permissive
# Contributing to python-sparkpost Transparency is one of our core values, and we encourage developers to contribute and become part of the SparkPost developer community. The following is a set of guidelines for contributing to python-sparkpost, which is hosted in the [SparkPost Organization](https://github.com/spark...
JavaScript
UTF-8
940
2.734375
3
[]
no_license
var games = ['Gears of War', 'Bloodbourne', 'Dark Souls', 'Total War: Warhammer', 'Battlefield 4', 'Crysis 2: Maximum Edition', 'Killing Floor', 'Halo', 'Splinter Cell', 'Metal Gear Solid']; function showGameDetails() { var game = $(this).attr('data-name'); var queryURL = "http://api.giphy.com/v1/gifs/search?q=...
JavaScript
UTF-8
2,345
3.09375
3
[]
no_license
// make http request const request = require('request'); const urlAddress = require('./questAPI'); var geocodeAddress = (address, callback) => { console.log(address); let encodeA = encodeURIComponent(address) // encodeURIComponenet('1301 lombard street') turns it into URL readable console.log(enco...
C++
UTF-8
1,197
3.65625
4
[]
no_license
#include <iostream> #include "token.h" /* value stack priority: * = - 1 * | - 2 * & - 3 * operand - -1 */ Token::Token(std::string s) { name = s; char c = s[0]; switch (c) { case '=': { stack_priority = 1; token_type = kTokenAssign; brea...
PHP
UTF-8
2,727
2.5625
3
[ "BSD-3-Clause" ]
permissive
<?php /** * Created by PhpStorm. * User: denisov * Date: 27.09.2017 * Time: 10:51 */ namespace frontend\widgets; use common\models\Category; use common\models\Subcategory; use yii\base\Widget; use Yii; class LeftMenu extends Widget { public $categories; public $lang; public $selected_subcategories; ...
Ruby
UTF-8
264
3.015625
3
[]
no_license
# builds sentence based on the specific cycle of the recursive function def build(cycle, level, root, path, str) if cycle == 1 && level > 1 str = root + ' ' + path + ' ' elsif path == root str = root + ' ' else str += path + ' ' end str end
Java
UTF-8
2,698
2.53125
3
[]
no_license
package com.example.pc002.labactivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.Toast; public class LabActivity extends AppCompatActivity implements View.OnClickListener {...
Markdown
UTF-8
4,303
2.625
3
[]
no_license
# Banking System ## Description This is an Windows Desktop Application which is intended to be used for internal working of banks and all bank related transaction. This approach replaces the traditional way of paper record keeping to an modern and efficient computerised approach to manage and handle the data of the cu...
SQL
UTF-8
221
3.859375
4
[]
no_license
-- Return the name of the gallery with the most images. SELECT galleries.name, COUNT(*) as count FROM galleries JOIN images ON galleries.id = images.gallery_id GROUP BY galleries.id ORDER BY count DESC LIMIT 1;
Java
UTF-8
2,847
2.125
2
[]
no_license
package com.appabilities.complainmanagementsystem.base; import android.annotation.TargetApi; import android.app.ProgressDialog; import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.View; import com.appabilities.com...
PHP
UTF-8
2,104
2.828125
3
[]
no_license
<?php namespace App\Models\DAO; use App\Models\Entidades\Cliente; class ClienteDAO extends BaseDAO { public function listar($cpf = null) { if ($cpf) { $resultado = $this->select( "SELECT * FROM cliente WHERE cpf = $cpf" ); return $resultado->fetchO...
Swift
UTF-8
1,324
2.796875
3
[]
no_license
// // NetworkingService.swift // EyesTest // // Created by Reiss Zurbyk on 2019-07-20. // Copyright © 2019 Reiss Zurbyk. All rights reserved. // import Foundation class NetworkingService { static let shared = NetworkingService() private init() {} let session = URLSession.shared lazy...
JavaScript
UTF-8
522
3.109375
3
[]
no_license
const addBrush = name => document.getElementById(name).onclick = () => brush.mode = name const brush = { size: 5, color: '#007700', x: 1e5, y: 1e5, mode: 'fill' } for (m of ['oval', 'line', 'pencil', 'fill', 'getColor','soval','rect','srect']) addBrush(m) const colorPick...
Java
UTF-8
1,703
2.109375
2
[]
no_license
package se.jensim.chargen.view; import com.vaadin.cdi.CDIView; import com.vaadin.cdi.access.JaasAccessControl; import com.vaadin.navigator.View; import com.vaadin.navigator.ViewChangeListener; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.ui.Button; import com.vaadin.ui.Label; import com.vaadin.ui.V...
C#
UTF-8
607
2.578125
3
[]
no_license
using System; namespace Clock { class Program { static void Main(string[] args) { ReverseWatch reverseWatch = new ReverseWatch(); RWSubscriber subscriber = new RWSubscriber(); subscriber.Subscribe(reverseWatch); Console.WriteLine("Ente...
Ruby
UTF-8
1,930
3.078125
3
[ "MIT" ]
permissive
require 'rspec' require 'car_store' require 'car_options' describe Vehicle do before do Vehicle.clear end it 'initializes a Vehicle class with its properties' do test_vehicle = Vehicle.new("Toyota","Prius","2014","23999") test_vehicle.should be_an_instance_of Vehicle end it 'will provide proper...
Markdown
UTF-8
5,635
3.03125
3
[]
no_license
--- layout: post title: "Disposing" date: 2019-07-14 09:45:19 +0900 categories: RxSwift tags: Rx RxSwift 번역 Disposing author: Juhee Kim mathjax: true --- * content {:toc} ## Dispose? 구독 후 Observable Sequence 항목 생성을 취소하고 resource를 반환하려면, `dispose`를 호출하세요. Sequence가 유한 시간 내에 종료되면, dispose를 호출하지 않거나 disposeBag으로 dis...
C
UTF-8
2,275
2.890625
3
[]
no_license
#include<stdio.h> #include<stdlib.h> struct process{ int burst,wt,tat; int start_time,end_time; } proc[20]={0,0}; int p; void input() { int i; for(i=0;i<p;i++) { printf("Enter the burst time of process %d:",i+1); scanf("%d",&proc[i].burst); } for(i=0;i<p;i++) { printf("Process %d\t",i+1); } printf("\n"); for(i=0;i<p;i...
PHP
UTF-8
1,058
3.203125
3
[]
no_license
<?php require_once('task26.php'); class Registration{ protected $name; protected $lastname; protected $email; protected $pass1; protected $pass2; protected $md5email; public function __construct($name,$lastname,$email, $pass1, $pass2, $md5email) { $this->name = $_POST["name"]; $this->lastname = $_POST["lastna...
Java
UTF-8
8,844
1.664063
2
[]
no_license
/* * Copyright (c) 2004, 2005 Polarion Software, All rights reserved. * Email: community@polarion.org * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License...
Go
UTF-8
3,252
2.96875
3
[]
no_license
package DB import ( "RMQ_Project/common" "RMQ_Project/model" "database/sql" "fmt" "log" "strconv" ) type MyProduct interface { Conn() error Inset(*model.Product) (int64, error) Delete(int64) bool Update(*model.Product) error SelectByKey(int64) (*model.Product, error) SelectAll() ([]*model.Product, error) ...
Java
UTF-8
22,491
1.890625
2
[]
no_license
package com.zzz.wc.strawberrycount.activity; import android.app.AlertDialog; import android.app.DatePickerDialog; import android.app.TimePickerDialog; import android.content.DialogInterface; import android.os.Build; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import ...
Python
UTF-8
1,458
4.125
4
[]
no_license
def enterWord(): counter = 0 word = input("Please enter a word.\n") display = input("How would you like me to display this?\n") if display == "Display in a box": counter = counter + 1 print("You've selected option", counter) displayInBox(word) elif display == "Display lower...
JavaScript
UTF-8
2,546
4.625
5
[]
no_license
/* Given an array of integers return the index where the smallest integer is located return -1 if there is no smallest integer (array is empty) since -1 is not a valid index, this indicates it couldn't be found If the smallest integer occurs more than once, return the index of the first one. */ // const nums...
C#
UTF-8
1,536
2.921875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using AcmeCorpDomainObjects; using AcmeCorpEF; namespace AcmeCorpServices { public class PurchaseOrderService : AcmeCorpServices.IPurchaseOrderService { private readonly IUnitOfWorkFactory uwf; public Purcha...
Ruby
UTF-8
184
3.1875
3
[]
no_license
class Hamming def self.compute(dna_a, dna_b) hamming = 0 [dna_a.size, dna_b.size].min.times do |i| hamming += 1 if dna_a[i] != dna_b[i] end hamming end end
Markdown
UTF-8
1,043
2.796875
3
[]
no_license
### cookie 1. 大小限制在4kb左右 2. 一般在服务端生成,可设置失效时间 3. 每次会携带到请求头中 4. 参数 1. httponly:不要在除http/https之外的方式请求cookie如JavaScript,document.cookie 2. secure:仅在加密传输,指示浏览器仅仅在通过安全/加密连接才能使用该cookie。 3. sameSite:Strict-完全禁止第三方Cookie,跨域不携带;Lax-大部分情况下不发送第三方Cookie,但是在导航到目标网址的Get请求除外;None-默认值,自动携带cookie。 ### session 1. session是保存在...
Java
UTF-8
18,193
1.960938
2
[]
no_license
package pe.gob.sunafil.denunciavirtual.siit.persistence.model; import java.util.ArrayList; import java.util.List; public class VstIntendenRegionalesExample { /** * This field was generated by MyBatis Generator. * This field corresponds to the database table SIIT.VST_INTENDEN_REGIONALES * * @mb...
Shell
UTF-8
2,120
4.09375
4
[ "MIT" ]
permissive
#!/bin/bash usage="Graph-based Image Classification Install Script ----------------------------------------------- Usage: $(basename "$0") [options...] <name> Installs all requirements in a new conda environment with name <name>. Miniconda needs to be installed. Options: -h, --help This help text. -p, --pyt...
Java
UTF-8
4,950
1.867188
2
[ "Apache-2.0", "LicenseRef-scancode-gutenberg-2020", "CC0-1.0", "BSD-3-Clause" ]
permissive
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
PHP
UTF-8
382
3.484375
3
[]
no_license
<?php $jam = 10; if($jam < "10") { echo "Havve a good morning!"; } elseif ($jam < "20") { echo "Have a good day!"; }else { echo "Have a good night!"; } echo"\n"; $favcolor = "red"; switch ($favcolor) { case "red": echo "Your favorite color color is red"; break; case "blue": ...
Python
UTF-8
2,704
3.78125
4
[]
no_license
# Scheme primitive procedures cons = lambda x, y: lambda m: m(x, y) car = lambda z: z(lambda p, q: p) cdr = lambda z: z(lambda p, q: q) cadr = lambda x: car(cdr(x)) caddr = lambda x: car(cdr(cdr(x))) makeList = lambda *items: None if items == () else cons(items[0], makeList(*items[1:])) appendList = lambda list1, list2...
SQL
UTF-8
454
3.28125
3
[]
no_license
SELECT * FROM KOPO_STUDENT_2018; SELECT TEAM_ID , ROUND(AVG(SCORE_MATH),1) FROM KOPO_STUDENT_2018 GROUP BY TEAM_ID; SELECT A.STUDENT_ID ,A.TEAM_ID ,A.SCORE_MATH ,B.AVG_MATH FROM KOPO_STUDENT_2018 A, (SELECT TEAM_ID , ROUND(AVG(SCORE_MATH)...
C++
UTF-8
1,025
2.546875
3
[]
no_license
#include "flatfilesystemmodel.h" #include <QDir> #include <QHash> #include <QDebug> FlatFilesystemModel::FlatFilesystemModel(const QString& path, const QStringList& filters) : m_path(path) { QHash<int, QByteArray> names = roleNames(); names.insert(Qt::UserRole, "index"); names.insert(Qt::UserRole+1, "fileP...
C
UTF-8
4,959
3.0625
3
[]
no_license
#include <stdio.h> #include <stdint.h> #include <malloc.h> #include "../include/cbuffer.h" #include "../include/cbuffertest.h" static uint8_t test_count = 0; static uint8_t init_test_count = 0; static uint8_t add_test_count = 0; static uint8_t remove_test_count = 0; static uint8_t free_test_count = 0; int main() { ...
Markdown
UTF-8
3,442
3.203125
3
[]
no_license
성별에 따른 월급 차이 ================ 정현진 July 30, 2020 ## 2\. 성별에 따른 월급 차이 ### 분석 절차 성별과 월급 두 변소를 검토 후 전처리, 변수간의 관계 분석(성별 월급 평균표 만들기&그래프 만들기) ### 성별 변수 검토 및 전처리 #### 1\. 변수 검토하기 시작점과 끝점에 \`\`\`입력하고 그 사이에 r코드 작성해주기 ``` r class(welfare$sex) table(welfare$sex) ``` #### 2\. 전처리 성별 변수1= 남자 2=여자 9=모...
Markdown
UTF-8
1,488
4.03125
4
[ "MIT" ]
permissive
# 1449. Form Largest Integer With Digits That Add up to Target Difficulty: Hard https://leetcode.com/problems/form-largest-integer-with-digits-that-add-up-to-target/ Given an array of integers cost and an integer target. Return the maximum integer you can paint under the following rules: * The cost of painting a di...
C++
UTF-8
1,297
2.78125
3
[ "NCSA" ]
permissive
/* Create 1 buffer per tile and work on it with an accessor RUN: %{execute}%s */ //#define TRISYCL_XILINX_AIE_TILE_CODE_ON_FIBER 1 #include <iostream> #include <sycl/sycl.hpp> using namespace sycl::vendor::xilinx; int main() { // Define an AIE CGRA with all the tiles of a VC1902 acap::aie::device<acap::aie::...
C++
UTF-8
1,132
3.078125
3
[]
no_license
#include <iostream> #include <vector> #include <math.h> #include "gnuplot_i.hpp" template<typename T> T myFun(T x) { return sin(x); } template<typename T> T derivativeCentralMeth(T x, T h) { return (myFun<T>(x+h) - myFun<T>(x-h))/(2.*h); } template<typename T> T derivative(T x) { return cos(...
JavaScript
UTF-8
307
2.765625
3
[ "MIT" ]
permissive
(function(){ 'use strict'; var through = require('through2'); var write = function(buffer,encoding,callback){ var info = buffer.toString().toLocaleUpperCase(); this.push(info); callback(); }; var stream = through(write); process.stdin.pipe(stream).pipe(process.stdout); })();
C
UTF-8
935
2.703125
3
[]
no_license
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward d...
C++
UTF-8
935
3
3
[ "Apache-2.0" ]
permissive
class Solution { private: using citer = vector<int>::const_iterator; int maxSubArrayDo(citer begin, citer end) { if (begin + 1 == end) { return *begin; } auto half = (end - begin)>>1; int maxPre = maxSubArrayDo(begin, begin + half), maxPost = maxSubArrayDo(begin + hal...
C#
UTF-8
550
3
3
[]
no_license
using System; namespace Demo_Project1.Variables_Examples { public class Var_Ex2 { static void Mains(string[] args) { var Name = "Girish"; var _Intail = 'M'; var age = 30; var salary = 50400.36; Console.WriteLine(" Emp_Name : " ...
Python
UTF-8
335
2.96875
3
[]
no_license
from linked_list import LinkedListNode, LinkedList, makeN list = makeN(15) list.print_all() # one = LinkedListNode(1) # cycle = LinkedList(LinkedListNode(0)) # cycle.add(one) # for n in range(2, 11): # cycle.add(LinkedListNode(n)) # cycle.print_all() # cycle.remove(4) # cycle.print_all() # cycle.remove(0) # cyc...
JavaScript
UTF-8
456
2.875
3
[]
no_license
var fiveMinutes = 5 * 60 * 1000; module.exports = function(){ memwatch(); setInterval(memwatch, fiveMinutes); }; function memwatch(){ var memory = process.memoryUsage(); var rss = Math.round(memory.rss / 1024 / 1024); var used = Math.round(memory.heapUsed / 1024 / 1024); var total = Math.round...
Java
UTF-8
7,674
2.015625
2
[]
no_license
package com.example.dheoclaveria.projectos; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.view.LayoutInflater; import android.view.View; import...