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
Markdown
UTF-8
2,173
2.53125
3
[ "Apache-2.0" ]
permissive
# SbConstant #### 介绍 **SBConstant**,常量抽取工具,主要是为了满足公司编码规范,做的抽取工具,希望大家喜欢。 基于Antlr4开发了,SBConstant。 各种开发规范,都有要求不能在代码里出现魔数,在实际落实的时候会出现不能出现任何字符串的要求,虽说有道理但是依然是一个重复性很高的操作。 所以开发SBConstant,自动对代码进行改造。 目前**SBConstant**可以实现两种命令: **默认命令** - mybatis实体,抽取数据库字段 - 普通类,方法内部,魔法数提成常量 ##### 实体抽取 使用场景,**mybatis plus**插件,支持**Q...
SQL
UTF-8
6,314
4.3125
4
[]
no_license
SELECT * FROM emp; /* # BETWEEN 구문 1. 컬럼명 between A and B 동일한 결과 내용으로 컬럼명 >= A and 컬럼명 <=B **/ -- sal가 1000에서 2000사이 데이터 출력 SELECT * FROM emp WHERE sal BETWEEN 1000 AND 2000; -- ex) empno가 7600~7900 사이의 데이터를 출력하세요. SELECT * FROM emp WHERE empno BETWEEN 7600 AND 7900; /* # null 데이터 처리. 1. 데이터가 할당되지 않는...
C++
GB18030
2,947
2.609375
3
[]
no_license
// HexView.cpp : implementation file // #include "stdafx.h" #include "SimpleSniffer.h" #include "HexView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CHexView IMPLEM...
Python
UTF-8
712
2.546875
3
[]
no_license
from tkinter import * from selection import * root=Tk() root.title("SECRET_CODE") def nextpage(): root.destroy() selections() L1=Label(root,text="2 WAY SECRET CODE",font=("bold",40,),bg="green",fg="white") L1.pack() l0=Label(root) l0.pack() l2=Label(root,text="MESSAGING",font=("bold",40,),bg="g...
Markdown
UTF-8
1,871
2.859375
3
[]
no_license
# bin Scripts This repo contains various bin scripts that I use. Nothing here is explicitly personal, so the repo is public. If you find some use in it let me know. Don't expect things to be well commented or even well written. It's quick. It's dirty. It makes my life easier. ## airdrop Broadcasts a file over `nc` s...
Markdown
UTF-8
753
2.578125
3
[]
no_license
--- title: "Detectors" --- Multiple flows can be detected by a single detector within a certain facility of a segment area. Additionally, detectors are decoupled from a segment area to allow for detector devices to move multiple times in multiple areas. Required parameters for _Detectors_ are: * Jurisdiction * Descri...
Java
UTF-8
669
3.359375
3
[]
no_license
import java.util.Scanner; /** * @author Branium Academy * @address https://braniumacademy.net/ */ public class L21Ex4 { public static void main(String[] args) { var input = new Scanner(System.in); System.out.println("Nhập số nguyên dương n: "); var n = input.nextInt(); printReve...
Python
UTF-8
663
3.59375
4
[]
no_license
import math def is_palindrome(x): s = str(x) n = len(s) for i in range(n): if s[i] != s[n - i - 1]: return False return True def count(a, b): res = 0 for x in range(a, b + 1): sq = int(math.sqrt(x)) if sq * sq == x and is_palindrome(x) and is_palindrome(sq): res = res + 1 return ...
C#
UTF-8
599
3.3125
3
[]
no_license
using System.Linq; namespace AlternatingSplit { internal class Program { public static void Main(string[] args) { } } public class Kata { public static string Encrypt(string text, int n) { for (var index = 0; index < n; index++) ...
C
UTF-8
6,616
4.125
4
[]
no_license
/* Number converter Menu Convert between integer, binary, octal and hexadecimal This program should accept numeric values in hexadecimal, decimal, octal and binary formats as: Hex 0x0 to 0xFFFFFFFF Dec 0 to 4294967295 Oct o0 to o37777777777 Bin b0 to ...
Java
UTF-8
758
1.875
2
[]
no_license
package com.appnews.jjs.appnews.base; import android.app.Application; import com.appnews.jjs.appnews.utils.okhttp.OkHttpUtils; import java.util.concurrent.TimeUnit; import okhttp3.OkHttpClient; /** * Created by 15596 on 2016/11/23. */ public class AppBaseApplication extends Application { @Ove...
Shell
UTF-8
485
3.171875
3
[ "Apache-2.0" ]
permissive
#!/bin/bash if [[ "${0}" = /* ]]; then ME="${0}"; else ME="${PWD}/${0}"; fi while [ -h ${ME} ]; do ME=$(readlink $ME); done source `dirname ${ME}`/../shell_base.sh echo "Usage: ${progName} --device=<device_name>" echo " [--dist=<android-5.1.1_r1|cm-12.0>]: Android distribution." echo " [--numrows=<n>]: Items to ret...
Java
UTF-8
884
2.078125
2
[]
no_license
package com.shencode.ownwebplatform.controller; import com.shencode.ownwebplatform.model.Message; import com.shencode.ownwebplatform.service.UserService; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMappi...
C++
UTF-8
987
3.453125
3
[]
no_license
#include "currency.h" #include <gtest/gtest.h> using namespace std; TEST(Currency, EmptyConnstructor) { Currency C1; Currency C2; Currency C3 = (C1 + C2); EXPECT_EQ(0, C3.getrupees()); EXPECT_EQ(0, C3.getpaise()); } TEST(Currency, plus_with_without) { Currency C1(7,22); Currency C2(...
JavaScript
UTF-8
16,152
2.53125
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "MIT", "CC-BY-4.0", "LicenseRef-scancode-other-permissive", "BSD-3-Clause", "Python-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
/** * @fileoverview Translation file for Japanese. * * @license Copyright 2016 The Coding with Chrome Authors. * * 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...
C++
UTF-8
1,707
2.6875
3
[]
no_license
#include "scoremanager.hpp" SReg ScoreManager::Sreg = SReg(SC_SREG_DATA, SC_SREG_LATCH, SC_SREG_CLOCK); PlayerScoreIndicator ScoreManager::_indicators[SC_MAX_PLAYERS]; void ScoreManager::Configure() { ScoreManager::Sreg.Init(); int offset = 0; for (int i = 0; i < SC_MAX_PLAYERS; i++) { ...
C#
UTF-8
4,568
2.609375
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Library2 { public partial class Book : Form { public Book() { ...
JavaScript
UTF-8
1,542
3.0625
3
[]
no_license
'use strict'; function Article(rawDataObj) { this.author = rawDataObj.author; this.authorUrl = rawDataObj.authorUrl; this.title = rawDataObj.title; this.category = rawDataObj.category; this.body = rawDataObj.body; this.publishedOn = rawDataObj.publishedOn; } Article.all = []; Article.prototype.toHtml = fu...
Python
UTF-8
323
3.3125
3
[]
no_license
import math c=50 h=30 numbers = input("Enter numbers separating with comma:") my_list= numbers.split(",") my_list = list(my_list) final_list=[] for d in my_list: a = (2*c*int(d))%h q = math.sqrt(a) final_list.append(str(q)) print(','.join(final_list)) # with this program not getting required res...
JavaScript
UTF-8
2,200
3.078125
3
[]
no_license
/* Created by Palette in 2017/12/04 */ var is_alive = [1, 1, 1, 1, 1, 0]; var turn_num = 0; window.onload = function(){ $(".button").click(get_random); $("#button").hover(start_cal, end_cal); $("#info-bar").click(get_result); } function get_random(){ var ID = this.id, btn = $('.button'); var turn...
Ruby
UTF-8
488
3.46875
3
[]
no_license
#Loops i=1 #while : sampai kondisinya benar while i <= 5 puts "#{i}" i += 1 end puts "#################################" #until sampai kondisinya salah until i < 1 puts "nilai i : #{i}" i -= 1 end #for in puts "###############angka####################" for angka in (0..3) puts "Nilai angka : ...
Markdown
UTF-8
3,963
2.828125
3
[ "MIT" ]
permissive
--- title: "Prediction of Taxi Demand Using Random Forest" date: 2019-12-14 published: true tags: [dataviz, hvplot, seaborn, matplotlib, randomForest] excerpt: "This is the introduction of the prediction model." hv-loader: hv-chart-1: "charts/importance.html" toc: true toc_sticky: true --- ## Introduction Random fo...
Java
UTF-8
15,466
2.109375
2
[]
no_license
package jango; import android.content.Context; import android.widget.Toast; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.TimeZone; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; import r...
C#
UTF-8
6,594
2.78125
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Web; using System.Data.Entity; using WestBlueGolfLeagueWeb.Models.Entities; using WestBlueGolfLeagueWeb.Models.Extensions; using log4net; namespace WestBlueGolfLeagueWeb.Models.ScoreEntry.LeaderBoard { pu...
Python
UTF-8
845
3.421875
3
[]
no_license
from collections import defaultdict def solution(tickets): answer = [] graph = defaultdict(list) for t in tickets: graph[t[0]].append(t[1]) for key in graph: # 이렇게 해야 알파벳 순으로 간다. graph[key].sort() print(graph) def dfs(node, path): if len(path) == len(tickets) ...
Java
UTF-8
637
2.25
2
[]
no_license
package net.nowtryz.mcutils.command.contexts; import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.SuperBuilder; import net.nowtryz.mcutils.api.Translation; import org.bukkit.command.CommandSender; @Getter @ToString @SuperBuilder @EqualsAndHashCode @FieldDefaults(makeFinal=true, level...
Java
UTF-8
1,991
1.976563
2
[]
no_license
package com.java.springboot.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.java.springboot.utilities.ConfigurationsImpl; import springfox.documentation.builders.PathSel...
Java
UTF-8
4,591
2.75
3
[ "MIT" ]
permissive
package uk.co.caeldev.builder4test; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import uk.co.caeldev.builder4test.impl.Pojo; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static uk.co.caeldev.builder4test.impl.PojoBuilder.creator; import stat...
C#
UTF-8
1,259
2.875
3
[]
no_license
using System; using System.Net.Mime; namespace Microservices { public static class MessageBodyInfoExtensions { /// <summary> /// /// </summary> /// <param name="bodyInfo"></param> /// <returns></returns> public static ContentType ContentType(this MessageBodyInfo bodyInfo) { #region Validate parame...
C++
UTF-8
1,803
3.09375
3
[]
no_license
#include <iostream> #include "circle.hpp" #include "rectangle.hpp" #include "composite-shape.hpp" using namespace vlasov; int getRectInfo(Rectangle objrect) { std::cout << "Rectangle height: " << objrect.getFrameRect().height << " "; std::cout << " , Width: " << objrect.getFrameRect().width << " "; std::cout <<...
PHP
UTF-8
1,134
2.984375
3
[]
no_license
<?php $msg = ""; if(isset($_GET["msg"])){ $msg = $_GET["msg"]; } require '../dbConnect.php'; //access and run this external file //prepared statement try{ $content = ""; $sql = 'SELECT * FROM wdv341_events'; $stmt = $pdo->prepare($sql); $stmt->execute(); while ($row = $stmt->fetch()){ $id = $row["event...
Swift
UTF-8
10,220
2.609375
3
[]
no_license
// // ViewController.swift // CapitalOneATMBranchLocator // // Created by Rajesh kumar Subbiah on 7/14/16. // Copyright © 2016 Rajesh kumar Subbiah. All rights reserved. // import UIKit import MapKit import Contacts class ViewController: UIViewController { var currentAnnotation = Annotation() var atm...
Markdown
UTF-8
3,074
3.59375
4
[]
no_license
# intrusive_ptr intrusive_ptr也是一种引用计数型智能指针,摘要如下: ```c++ template<class T> class intrusive_ptr { public: typedef T element_type; // 被代理的对象 intrusive_ptr(); // 构造函数 intrusive_ptr(T *p, bool add_ref = true); intrusive_ptr(intrusive_ptr const & r); template<class Y> intrusive_ptr(intrusive_ptr<...
Java
UTF-8
4,852
3.421875
3
[]
no_license
package Algorithms; import java.util.*; import Wifi_Data.*; /** * This class is responsible for calculating user location, given the wifi scan that the user inputs. * @author Hodaya_Tamano * @author Shir_Bentabou * @version 27.12.2017 */ public class Algorithm2 { //these are all variables th...
Java
UTF-8
1,385
3.25
3
[]
no_license
import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; public class LargestNumber { public String largestNumber(int[] nums) { int length = nums.length; List<Integer> list = new ArrayList<>(); for(int i = 0;i<length;i++) list...
Markdown
UTF-8
539
2.890625
3
[]
no_license
# Lifting Tracker The goal of this project is to analyse the path of a bar in a video recording of a lifting movement (e.g. deadlift, squat, bench press) with the results then visualised as charts and key values. ## Implementation The video processing is done using OpenCV in Python and uses colour detection to track t...
C++
UTF-8
937
3.234375
3
[]
no_license
#include <iostream> using namespace std; void exchange(int *x,int *y) { int temp; temp=*x; *x=*y; *y=temp; } void exchangeC(char *x,char *y) { char temp; temp=*x; *x=*y; *y=temp; } int Part(int A[],char B[] , int p, int r) { int x=A[r]; int i=p-1; for(int j = p;j<=r-1;...
Markdown
UTF-8
4,915
3.21875
3
[ "MIT" ]
permissive
## 一 Electron简介 Electron 是一款基于Node.js的跨平台桌面应用开发框架,由Github开发,通过该框架可以利用 HTML、CSS、JavaScript 等web前端技术来开发跨平台桌面应用。 Electron的著名实现案例是VSCode。 Electron内部集成了`Chromium Content Module`与Node.js运行时,前者无法访问本地数据,但是可以创建GUI界面,后者能够访问本地数据,但是不能创建GUI界面。Electron结合二者后,开发者无需关心底层,直接使用原生操作系统的功能,创建桌面应用: - Chromium Content Module:Chromium的核...
Java
UTF-8
3,215
2.1875
2
[]
no_license
package com.example.admin.bookaholicfam; import android.content.ContentValues; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import static android.provider.Telephony.Carriers.PASSWORD; import static java.util.ja...
C++
UTF-8
2,242
3.171875
3
[]
no_license
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <sstream> #include <fstream> #include <time.h> #include <map> using namespace std; class Solution { public: bool isPalindrome(string s) { const char* sin = s.c_str(); bool bRet ...
C++
UTF-8
794
2.640625
3
[]
no_license
// TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION // 0. You just DO WHAT THE FUCK YOU WANT TO. #pragma once #include <string> #include <vector> #include "UTF8.h" class StringParser { public: StringParser(const std::string& toParse, int start = 0); template<typename Condition> std::string advanceT...
TypeScript
UTF-8
387
2.71875
3
[]
no_license
//javascript export const fetch1 = function (url, params) { // dosomething return new Promise((resolve, reject) => { }) } //typescript interface RES { code: number, msg: string, data?: any } export const fetch2 = function (url:string, params?:any): Promise<RES> { // doso...
Markdown
UTF-8
2,633
3.703125
4
[]
no_license
Tennis game scoring system ------------------------------- ## Problem Statement Implement tennis game scoring system. The scoring system for tennis works like this. * A match has one set and a set has many games * A game is won by the first player to have won at least 4 points in total and at least 2 points more t...
Java
UTF-8
927
2.578125
3
[]
no_license
package com.apvintern.domain.utils; import com.apvintern.data.entities.UserResponse; import com.apvintern.domain.entities.User; import java.util.ArrayList; import java.util.List; public final class UserMapper { public UserMapper() { } public User toUser(UserResponse userResponse) { User user = n...
PHP
UTF-8
1,333
2.578125
3
[ "MIT" ]
permissive
<?php /** * Created by Reliese Model. */ namespace App\Models; use Carbon\Carbon; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; /** * Class Woreda * * @property int $id * @property string $woreda_name * @property string $population * @property string $area * @propert...
C#
UTF-8
2,080
2.671875
3
[]
no_license
using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HelpdeskSystem { class MyPublic { public static SqlConnection conn; private static string serverName = "DESKTOP-KAGK96M\...
TypeScript
UTF-8
280
3.265625
3
[ "MIT" ]
permissive
export class Utils { public static clamp(val: number, low: number, high: number): number { return val < low ? low : val > high ? high : val; } public static getTime(hour: number, min: number, sec: number): number { return hour * 3600 + min * 60 + sec; } }
Java
UTF-8
326
1.820313
2
[ "Apache-2.0" ]
permissive
package com.bstek.bdf2.core.exception; import org.springframework.security.web.context.HttpRequestResponseHolder; /** * @since 2013-1-27 * @author Jacky.gao */ public interface IExceptionHandler { void handle(HttpRequestResponseHolder requestResponseHolder,Throwable exception); boolean support(Throwable exceptio...
Java
UTF-8
641
1.890625
2
[ "MIT" ]
permissive
//Deobfuscated with https://github.com/SimplyProgrammer/Minecraft-Deobfuscator3000 using mappings "C:\Users\Admin\Desktop\Minecraft-Deobfuscator3000-1.2.2\1.12 stable mappings"! //Decompiled by Procyon! package me.shatteredhej.railhack.railhackmod.event.events; import net.minecraft.network.*; public class EventNetw...
Markdown
UTF-8
1,433
3.609375
4
[]
no_license
--- title: 228. Summary Ranges parent: data_structure has_children: false nav_order: 100 permalink: /docs/228 --- # 228. Summary Ranges [leetcode link](https://leetcode.com/problems/summary-ranges/) **difficulty(1-5)** 2 easy **notes** ## Description Given a sorted integer array without duplicates, return the s...
Shell
UTF-8
1,737
3.859375
4
[]
no_license
#!/bin/sh HOME_DB_FOLDER="$HOME/.cache" DB_FILE="locate.db" if [ "$1" = "-h" ]; then cat <<EOF>&2 Usage: ${0##*/} [FOLDERS] Update the 'locate' databases for the home folder, external drives and the FOLDERS arguments. For external drives, databases are only updated if found, they are not automatically created (unl...
TypeScript
UTF-8
1,557
2.53125
3
[ "MIT" ]
permissive
import { A } from '@ember/array'; import { KeyEvent } from '@ember/test-helpers/dom/trigger-key-event'; import { KeyMacroModifierCallback } from './callback'; export interface MacroOptions { callback: KeyMacroModifierCallback; executionKey: string; modifierKeys?: string[], keyEvent?: KeyEvent; element?: HTML...
Markdown
UTF-8
5,954
2.640625
3
[]
no_license
# css兼容性 1. h5标签兼容 1. 使用document.createElement()创建元素,然后设置样式; 2. 引入成熟的库; 2. 元素浮动之后,能设置宽度的话就给元素加宽度.如果需要宽度是内容撑开,就给它里边的块元素加上浮动;(浮动元素内有块级元素会出现把浮动元素给撑大)-ie6下,为块级元素设置高度后触发; 1. 给里面的块级元素加宽度; 2. 为里面的块级元素添加浮动 3. 第一块元素浮动,第二块元素加margin值等于第一块元素,在IE6下会有间隙问题; 1. 第二块元素也采用浮动 4. IE6下子元素超出父级宽高,会把父级的宽高撑开 1. 不能这么写 5. p/td/h不包含快级元素 6. ...
Java
UTF-8
393
1.734375
2
[]
no_license
package com.warehouse.inventorymanagement.service; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.web.multipart.MultipartFile; import com.productcatalogservice.data.Product; public interface ProductService { boolean loadProductsHandler(MultipartFile file, HttpServl...
Java
UTF-8
1,919
2.328125
2
[]
no_license
package com.chshru.music.ui.main.list; import com.chshru.music.data.model.OnlineList; import com.chshru.music.data.model.Song; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class ListData { public static final int PLAY_LIST = 0; public static fina...
Java
UTF-8
3,660
2.234375
2
[]
no_license
package com.mwdev.sxsmcardpay.database; import android.content.Context; import android.content.res.Resources; import com.mwdev.sxsmcardpay.PosApplication; import com.mwdev.sxsmcardpay.R; import com.mwdev.sxsmcardpay.util.PosLog; import com.ta.TAApplication; import com.ta.util.db.TASQLiteDatabase; import com.ta.util.d...
Java
UTF-8
390
2.453125
2
[]
no_license
package ua.kiev.home.prog_it.graduate_work.project1; public class Helper { public static void main(String[] args) { StrategyUnit str = new StrategyUnit(StrategyTypes.TotalGoalScored); System.out.println(str.getStrategyName()); StrategyUnit str1 = new StrategyUnit(StrategyTypes.Winne...
JavaScript
UTF-8
3,974
2.71875
3
[]
no_license
import {lab} from 'd3-color'; import {scaleLinear} from 'd3-scale'; const power = 2; const incomeScale = scaleLinear() .domain([175, 3384]) .range([0, Math.pow(100, power)]); const supportScale = scaleLinear() .domain([5, 85]) .range(...
PHP
UTF-8
1,623
2.5625
3
[ "MIT" ]
permissive
<?php namespace App\Http\Controllers\API; use App\Http\Controllers\Controller; use Illuminate\Http\Request; Use App\Models\Computer; Use Log; class ComputerController extends Controller { // public function getAll(){ $data = Computer::get(); return response()->json($data, 200); ...
C
UTF-8
1,078
3.359375
3
[]
no_license
#include<stdio.h> #include<stdlib.h> void compare(int **pp,int r,int c) { int i,j; int min=pp[0][0]; for(i=0;i<r;i++) for(j=0;j<c;j++) min = min<pp[i][j]?min:pp[i][j]; printf("min=%d\n",min); for(i=0;i<r;i++) for(j=0;j<c-1;j++) if(pp[i][j]==min) { pp[i][j]=pp[i][j+1]; } int min_two=pp[0][0];...
Python
UTF-8
1,816
2.859375
3
[]
no_license
from __future__ import annotations from typing import TypeVar, Generic, Any from git import Repo import os import stat from shutil import rmtree from pickle import dump, load from uuid import uuid4 as uuid def delFolder(path: str) -> None: for root, dirs, files in os.walk(path): for d in dirs: ...
Python
UTF-8
113
3.125
3
[]
no_license
def sum_of_multiples(maxnum, numbers=[3,5]): return sum(sum(range(0, maxnum, n)) for n in numbers if n != 0)
Java
UTF-8
406
1.609375
2
[]
no_license
package pl.mslawin.notes.app.constants; import android.util.Patterns; import java.util.regex.Pattern; /** * Created by maciej on 10/11/15. */ public final class NotesConstants { public static final String TASKS_LIST_ID_PARAM = "TASKS_LIST_ID_PARAM"; public static final String TASKS_LIST_NAME_PARAM = "TASK...
Go
UTF-8
112
2.640625
3
[ "MIT" ]
permissive
package entities // Entity represents a P4 Entity type Entity interface { Type() EntityType GetID() uint32 }
Ruby
UTF-8
464
3.609375
4
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
# prereqs: iterators, hashes, conditional logic # Given a hash with numeric values, return the key for the smallest value require 'pry' def key_for_min_value(name_hash) if name_hash.size != 0 smallest = 0 name = {} counter = true name_hash.collect do |key, value| if counter == true smallest = value ...
SQL
UTF-8
283
2.765625
3
[]
no_license
DROP TABLE IF EXISTS EMPLOYEE; CREATE TABLE EMPLOYEE( ID INT NOT NULL AUTO_INCREMENT , FIRST_NAME VARCHAR(60) NOT NULL , LAST_NAME VARCHAR(40) NOT NULL , BIRTH_DATE DATE , NATIONALITY VARCHAR(30) NOT NULL , RATING INT , DESCRIPTION VARCHAR(200) , PRIMARY KEY (ID) );
Python
UTF-8
1,572
3.515625
4
[]
no_license
import copy test = [[1,2,-1], [3,-1,0], [2,3,-1]] def print_mtx(mtx): for x in mtx: print(x) def minors(i, j, matrix): matrix_copy = copy.deepcopy(matrix) # removes row with index j and column with index i for row in range(len(matrix_copy)): selected_row = matrix_copy[ro...
TypeScript
UTF-8
606
2.53125
3
[ "MIT" ]
permissive
import { from } from 'rxjs'; import { toString } from './to-string'; import { take } from 'rxjs/operators'; describe('toString', () => { it('should convert a number to a default base 10 string', done => { from([10]) .pipe(toString(), take(1)) .subscribe({ next: value => expect(value).toBe('10...
PHP
UTF-8
691
3.15625
3
[]
no_license
<?php class User { public $id; public $name; public $email; public $oauthProvider = 'facebook'; public $oauthId = ''; function __construct($values) { if (!is_null($values) && !empty($values)) { $this->id = $values['id']; $this->email = $values['email']; $this->name = $values['name']; } } fu...
Markdown
UTF-8
6,576
2.671875
3
[ "MIT" ]
permissive
Format-Markdown --------------- ### Synopsis Formats an object as Markdown --- ### Description Formats an object as Markdown, with many options to work with --- ### Examples #### EXAMPLE 1 ```PowerShell Format-Markdown -ScriptBlock { Get-Process } ``` #### EXAMPLE 2 ```PowerShell 1..6 | Format-Markd...
Java
UTF-8
614
2.59375
3
[]
no_license
package sync; /** * Created by liudap on 2018/1/26. */ public class Thread2 implements Runnable{ private SynchronizedTest getS1; public Thread2(SynchronizedTest s1){ this.getS1 = s1; } public void run() { // SynchronizedTest s = new SynchronizedTest(); // s.method1(...
Markdown
UTF-8
557
2.71875
3
[]
no_license
# Elm Text Viewer ## Overview Uses [Prism.js](https://prismjs.com/) and [Elm](https://elm-lang.org/) to create a basic text viewer application. Can set language and requested URL as flags: ``` <script> var app = Elm.Main.init({ node: document.getElementById('app'), flags: { language: 'text', url:...
PHP
UTF-8
850
2.6875
3
[]
no_license
<?php try { $pdo = new PDO( 'mysql:host=localhost;dbname=centralized;charset=utf8;', 'root', 'admin' ); $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $stmt = $pdo->prepare( "select * from item_category"); $stmt->execute(); $option = ''; while( $row = $stmt->fetch(PDO::FETCH_ASSOC) ){ ...
Python
UTF-8
294
2.515625
3
[]
no_license
from django.test import SimpleTestCase from bank.helper_functions import get_perm_name class TestPermName(SimpleTestCase): def test_one_arg(self): self.assertEqual('bank.a', get_perm_name('a')) def test_multiple_args(self): self.assertEqual('bank.a_b', get_perm_name('a', 'b'))
Shell
UTF-8
2,097
3.828125
4
[]
no_license
#!/bin/bash has_error() { [ ! -f "$PWD/builder_error.log" ]; touch "$PWD/builder_error.log"; while getopts "m:" opt; do case $opt in m) multi+=("$OPTARG");; *) echo "Error: -m";; esac done shift $((OPTIND -1)) for val in "${multi[@]}"; do printf "***E...
Java
UTF-8
321
2.578125
3
[]
no_license
package problem; public class Line { public Vector2 a; public Vector2 b; public double A; public double B; public double C; public Line(Vector2 a, Vector2 b) { this.a = a; this.b = b; } public Vector2 getIntersection(Line l) { return new Vector2(0, 0); } }...
Java
UTF-8
656
3.171875
3
[]
no_license
public class AssignmentEight { public static void main(String[] args) { A8Utils utils = new A8Utils(); utils.printStars(0); utils.printStars(5); int[] numbers = { 41, 0, 74, -1, 8, -17, 79, 5, 22, -17 }; System.out.println("Minumum is " + utils.min(numbers)); String[] patterns = { "al ",...
Shell
UTF-8
593
3.4375
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
load 'lib' function setup() { TMPFILE="$(mktemp /tmp/terraform-modules-XXXXXXXXXXX.txt)" } function teardown() { #rm -f $TMPFILE : } @test "check if terraform modules are properly pinned" { skip_unless_terraform grep -Eo '^\s*source\s*=\s*"(.*?)"' *.tf | cut -d'"' -f2 | sort -u > $TMPFILE if [ -s $TMPFILE ...
JavaScript
UTF-8
548
3.03125
3
[ "MIT" ]
permissive
//Credits to: https://stackoverflow.com/questions/149055/how-to-format-numbers-as-currency-string /** * Formats a integer price into a price with decimals with a preceding $ sign * @parmas {string} - priceWithDecimals representation of price */ export const formatPrice = (priceWithDecimals) => { if(!priceWithDe...
Java
UTF-8
3,867
2.15625
2
[ "LicenseRef-scancode-warranty-disclaimer", "ANTLR-PD", "CDDL-1.0", "bzip2-1.0.6", "Zlib", "BSD-3-Clause", "MIT", "EPL-1.0", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-jdbm-1.00", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
package com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.image; import java.util.List; import java.util.Objects; public class ImageComponentVersions implements Comparable<ImageComponentVersions> { private String cm; private String cmGBN; private String cdp; private String cdpGBN; pri...
Python
UTF-8
1,505
3.828125
4
[]
no_license
import nltk import sys import os from nltk.tokenize import TweetTokenizer class Analyzer(): """Implements sentiment analysis.""" def __init__(self, positives, negatives): """Initialize Analyzer.""" #declare new lists self.positives = [] self.negatives = [] ...
Java
UTF-8
932
3.921875
4
[]
no_license
给定n个正整数ai,判定每个数是否是质数。 输入格式 第一行包含整数n。 接下来n行,每行包含一个正整数ai。 输出格式 共n行,其中第 i 行输出第 i 个正整数ai是否为质数,是则输出“Yes”,否则输出“No”。 数据范围 1≤n≤100, 1≤ai≤231−1 输入样例: 2 2 6 输出样例: Yes No import java.util.*; public class Main{ static boolean isPrime(int n){ if(n < 2) return false; for(int i = 2;i ...
Java
UTF-8
140
1.664063
2
[ "BSD-3-Clause" ]
permissive
/** * These are tests relating to how Moo uses MVEL, but essentially they are tests of MVEL, not of Moo. */ package com.codiform.moo.mvel;
PHP
UTF-8
1,403
3.21875
3
[ "MIT" ]
permissive
<?php /** * CrawlQueueInterface.php * * PHP version 7.2 * * @category Interface * @package Mjorgens\Crawler\CrawlQueue * @author Marc Jorgensen <marcjorgensen@gmail.com> * @license MIT https://opensource.org/licenses/MIT * @link https://github.com/mjorgens/web-crawler */ namespace Mjorgens\Crawler\Cr...
JavaScript
UTF-8
310
2.78125
3
[]
no_license
function show() { document.getElementById("popup").style.display = "block"; } function hide() { document.getElementById("popup").style.display = "none"; document.getElementById("name").value = ""; document.getElementById("age").value = ""; document.getElementById("country").value = ""; }
C++
UTF-8
780
3.46875
3
[]
no_license
// 75. 颜色分类 #include <iostream> #include <vector> #include <string> using namespace std; class Solution { public: void sortColors(vector<int>& nums) { int begin = 0, end = nums.size() - 1, cur = 0; while (cur < end) { // 如果当前的数字是0,移动到前边 if (nums[cur] == 0) ...
C#
UTF-8
3,327
2.78125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Auxiliary.MathTools; using Tao.OpenGl; namespace GraphicsObjects.Scene_s_Objects { public class Box:SceneObject { private Vector3D _center; private Vector3D _sizes; ...
Python
UTF-8
695
2.9375
3
[]
no_license
class Solution: def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]: #consider boundary case: res =[] if len(candidates)==0: return [] self.dfs(candidates,target,0,[],res) return res def dfs(self, nums, target, index, path, re...
Python
UTF-8
1,672
2.609375
3
[]
no_license
from keras.models import load_model from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D from keras.layers import Activation, Dropout, Flatten, Dense from keras.preprocessing.image import img_to_array, load_img import numpy as np import tensorflow as tf # dimensions of our images. img_wid...
Markdown
UTF-8
1,998
2.53125
3
[]
no_license
# Threading Concepts (OS/Python) | Topic   | Links | |------------------------------------------------------------|-----------------------------------------------------------------------------------------------------| | <b>Program / Process / Threads Discussion </b>| [View](https://www.backblaze.com/blog/whats-the-dif...
Python
UTF-8
260
3.25
3
[ "Apache-2.0" ]
permissive
from functools import reduce def sum(x,y): return x * y def zero(x): if x %10 ==0: return 1+zero(x//10) return 0 def num_zeroes(L): #YOUR CODE GOES HERE S=reduce(sum, L) ans=zero(S) return ans L=[2, 5, 6, 100] ans=num_zeroes(L) print(ans)
Java
UTF-8
473
2.046875
2
[ "Apache-2.0" ]
permissive
package com.linkb.jstx.adapter.viewholder; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.TextView; import com.linkb.R; public class OrganizationViewHolder extends RecyclerView.ViewHolder { public TextView name; public View icon; public OrganizationViewHo...
Java
UTF-8
497
2.140625
2
[]
no_license
// // Decompiled by Procyon v0.5.36 // package Output; public enum BaudRate { B_115200("B_115200"), B_230400("B_230400"), B_250000("B_250000"), B_500000("B_500000"), B_921600("B_921600"), B_1000000("B_1000000"), B_1250000("B_1250000"); private final String displayed_text; ...
PHP
UTF-8
391
2.859375
3
[]
no_license
<?php /* * 可变长度参数列表 * */ function test(){ var_dump(func_get_args());//然后做一些其他的操作 var_dump(func_get_arg(4));//调用这个函数的时候可以传入一个值表示获取第几个实际参数(重0开始) var_dump(func_num_args());//返回传入所在自定义函数的参数的个数! } test(21,323232,4343,'单位取得完全','dwqdwqdqw'); ?>
JavaScript
UTF-8
616
2.8125
3
[ "MIT" ]
permissive
var expect = require('chai').expect; var remove = require('./index.js'); describe('tests for checkign removal of index from orderd array', function() { it('should return array without element 3 in orderd form', function() { expect(remove([1, 2, 3, 4, 5], 3)).to.eql([1, 2, 4, 5]); }); it('should return array...
Markdown
UTF-8
687
3.125
3
[ "MIT" ]
permissive
# apply-classes [![NPM Version](https://img.shields.io/npm/v/apply-classes.svg)](https://www.npmjs.com/package/apply-classes) [![NPM Downloads](https://img.shields.io/npm/dm/apply-classes.svg)](https://www.npmjs.com/package/apply-classes) A small utility to apply classes, the use case to use it is in React. ## Inst...
Java
UTF-8
422
1.882813
2
[]
no_license
package com.lisasmith.findAGig.repository; import org.springframework.data.repository.CrudRepository; import com.lisasmith.findAGig.entity.GigStatus; public interface GigStatusRepository extends CrudRepository<GigStatus, Long> { public Iterable<GigStatus> findByGigId(Long gigId); public Iterable<GigStatus> find...
Markdown
UTF-8
725
2.515625
3
[]
no_license
--- title: plot()に凡例を追加する date: 2013-07-29T22:12:15+09:00 draft: false tags: [R言語] aliases: - /archives/44 --- サンプルコードを載せておく。 <pre> plot(1:10,1:10, type="l", lty=1) lines(1:10,seq(1,5.5,by=0.5),lty=2) legend(locator(1), c("実線","点線"),lty=1:2) </pre> 出力は、下のようになる。 <img src="http://img.gepuro.ne...
Python
UTF-8
640
2.9375
3
[]
no_license
class Solution(object): def findPairs(self, nums, k): """ :type nums: List[int] :type k: int :rtype: int """ count = 0 s = set(nums) k = abs(k) lst = sorted(list(s)) if k == 0: for i in s: if nums.count(i) > ...
Markdown
UTF-8
6,255
3.046875
3
[ "LicenseRef-scancode-generic-cla", "CC-BY-3.0" ]
permissive
--- title: Dependencies in Resource Manager templates | Microsoft Docs description: Describes how to set one resource as dependent on another resource during deployment to ensure resources are deployed in the correct order. services: azure-resource-manager documentationcenter: na author: tfitzmac manager: timlt editor:...