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 |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 2,164 | 2.53125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Diagnostics;
//using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace File_Manager_ver_2
{
public class FindInfoThread : FindInfo_Abstract
{
string FileForRegex;
public FindInfoThr... |
JavaScript | UTF-8 | 5,231 | 3.875 | 4 | [] | no_license |
function init() {
//Initialize event listener for Basic Calculator
var basicCalcBtn = document.getElementById('basic-calc');
basicCalcBtn.addEventListener('click', function(){
//get values from the fields after the button is clicked
var basicOperation = document.getElementById('basic-operat... |
Markdown | UTF-8 | 3,639 | 2.765625 | 3 | [] | no_license | Modified to work with DEBIAN 11 bullseye and PHP 8.1
### TuxLite Readme
TuxLite is a free collection of shell scripts for rapid deployment of
LAMP and LNMP stacks (Linux, Apache/Nginx, MySQL and PHP) for Debian and
Ubuntu.
Have you considered upgrading from shared hosting to a VPS or dedicated
server but held off b... |
Markdown | UTF-8 | 4,386 | 3.140625 | 3 | [] | no_license | ## 請說明雜湊跟加密的差別在哪裡,為什麼密碼要雜湊過後才存入資料庫
### 雜湊
* 雜湊無論原文長短,輸出後都會是固定的長度,輸出長度不受原文長度影響
* 雜湊是單向的,無法從輸出推斷出原文
* 不同的原文可能產出相同的雜湊值(雜湊碰撞),但機率極低
* 可能會被暴力破解法、彩虹表查表法破解
### 加密
* 過程透過加密、解密演算法處理,並使用金鑰進行加密、解密
* 一旦金鑰被盜取,便可以破解原文
* 非對稱式加密(透過公鑰加密內容,私鑰解密)可增強安全性
因為密碼屬於高安全性且僅需個人知道即可,因此不需要具有可逆性,最適合使用雜湊。
若密碼沒有經過雜湊變存入資料庫,即為明碼儲存,一旦被駭客盜取就可以成功駭入使用者的帳戶。如... |
Ruby | UTF-8 | 1,919 | 2.96875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #!/usr/bin/env ruby
Signal.trap("INT") { exit 1 }
require "pastel"
require "optparse"
# Return an unescaped version of delimiter
#
# @example
# unescape("foo\\nbar") => "foo\nbar"
#
def unescape(str)
escable = {
'\n' => "\n",
'\r' => "\r",
'\t' => "\t",
'\f' => "\f",
'\v' => "\v"
}
str.gs... |
C# | UTF-8 | 1,253 | 2.921875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
namespace USG_tablet_UI
{
class TCPconnection
{
private String IPaddr;
private int port;
Socket s = null;
public TCP... |
JavaScript | UTF-8 | 3,567 | 2.578125 | 3 | [] | no_license | import React, {Component} from 'react';
import nextId from "react-id-generator";
import styled from 'styled-components';
import AppHeader from '../app-header/';
import AppSearch from '../app-search/';
import AppFilter from '../app-filter/';
import AppForm from '../app-form/';
import AppAdd from '../app-add/'
const Ap... |
Python | UTF-8 | 18,622 | 2.671875 | 3 | [
"MIT"
] | permissive | from os import listdir
import cv2 as cv
import numpy as np
from os import path, makedirs
import math
import matplotlib.pyplot as plt
import argparse
import tqdm
import tensorflow as tf
import time
import threading
from guided_filter import guided_filter_cv as guided_filter
class bbox:
def __init__(self, lt, rb):
... |
Java | UTF-8 | 387 | 1.804688 | 2 | [] | no_license | package com.personnal.rhumrating.controller.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Wither;
import java.io.Serializable;
@Data
@Wither
@AllArgsConstructor
@NoArgsConstructor
public class TastingDTO implements Serializable{
private St... |
Java | UTF-8 | 5,505 | 2.5 | 2 | [] | no_license | package Steps;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import io.cucumber.datatable.DataTable;
import io.cucumber.java.After;
import io.cucum... |
PHP | UTF-8 | 435 | 2.828125 | 3 | [] | permissive | <?php
declare(strict_types=1);
namespace Linio\Component\Util;
class Inflector
{
public static function pascalize(string $string, string $separator = '_-'): string
{
return ucfirst(str_replace(' ', '', ucwords(strtr($string, $separator, ' '))));
}
public static function camelize(string $str... |
Java | UTF-8 | 1,599 | 2.125 | 2 | [] | no_license | package com.skkj.bcw.blockchainwallet.ui.lead_wallet;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.skkj.bcw.blockchainwallet.inject.Components;
import com.yejunsui.bcw.b... |
Python | UTF-8 | 1,129 | 3.140625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 9 23:02:57 2019
@author: Hesam
"""
def whoIsNext(names, r):
Next = r+1
ind_name = 0
name = ''
counter = 0
while counter < Next:
if ind_name+1 >= len(names):
ind_name = 0
name=names[ind_name]
c... |
C++ | UTF-8 | 727 | 2.8125 | 3 | [] | no_license | class Solution {
public:
vector<int> addToArrayForm(vector<int>& A, int K) {
vector<int> ret;
int n = A.size()-1;
int t = 0;
while (K)
{
if (n >=0)
{
t = A[n] + K%10;
}
else
{
t = K%10;
... |
Java | UTF-8 | 347 | 3.171875 | 3 | [] | no_license | // Car 클래스를 상속받는 서브클래스(subclass) Automobile
public class Automobile extends Car {
int seatNum;
int getSeatNum() {
return seatNum;
}
// Car 클래스의 upSpeed() 메소드를 오버라이딩
void upSpeed(int value) {
if (speed + value >= 300) {
speed = 300;
}
else
speed = speed + (int)value;
}
}
|
Java | UTF-8 | 3,898 | 2.46875 | 2 | [] | no_license | package thinhluffy.com.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import thinhluffy.com.model.*;
import... |
Python | UTF-8 | 434 | 2.96875 | 3 | [] | no_license | import pytest
import arrays.even_num_digits as prob
class TestEvenNumDigits:
def test_case1(self):
assert prob.find_numbers([12,345,2,6,7896]) == 2
def test_case2(self):
assert prob.find_numbers([555,901,482,1771]) == 1
def test_empty(self):
assert prob.find_numbers([]) == 0
def test_case... |
Swift | UTF-8 | 1,389 | 2.75 | 3 | [] | no_license | //
// ContentView.swift
// Graphics Simulator
//
// Created by Denis Bohm on 10/12/21.
//
import SwiftUI
struct ContentView: View {
@EnvironmentObject var deviceModel: DeviceModel
static let interval: Float = 0.02
let timer = Timer.publish(every: Double(interval), on: .main, in: .common)... |
Python | UTF-8 | 6,056 | 2.59375 | 3 | [
"MIT"
] | permissive | import sys
import copy
import unittest
import numpy as np
import networkx as nx
sys.path.append("..")
from contagion import contagion
class TestContagion(unittest.TestCase):
def test_init_In(self):
"""
Tests initialization of Infected compartment.
"""
G = nx.barabasi_albert_graph(... |
Go | UTF-8 | 1,937 | 4.03125 | 4 | [] | no_license | /*
Suppose you're given a binary tree represented as an array. For example, [3,6,2,9,-1,10] represents the following binary tree (where -1 is a non-existent node):
enter image description here
Write a function that determines whether the left or right branch of the tree is larger. The size of each branch is the sum o... |
PHP | UTF-8 | 1,349 | 2.65625 | 3 | [] | no_license | <?php
class OInstaller implements Operation{
public function doOp($data = null){
global $PATH;
if($_POST['userDB'] == $PATH['mysql']['user'] && $_POST['pwdDB'] == $PATH['mysql']['password'] ){
//creo la connessione al db
mysql_connect(
$PATH['mysql']['host'],
$PATH['mysql']['user'],
... |
Markdown | UTF-8 | 1,113 | 2.75 | 3 | [] | no_license | ---
title: 'Elven Trade'
taxonomy:
category:
- docs
twittercardoptions: summary
articleenabled: false
musiceventenabled: false
orgaenabled: false
orga:
ratingValue: 2.5
orgaratingenabled: false
eventenabled: false
personenabled: false
restaurantenabled: false
restaurant:
acceptsReservations: 'yes'
... |
Java | UTF-8 | 1,179 | 2.203125 | 2 | [] | no_license | package com.example.ISABackend.repository;
import com.example.ISABackend.model.DermatologistAppointment;
import com.example.ISABackend.model.MedicineReservation;
import com.example.ISABackend.model.Pharmacy;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Lo... |
C++ | UTF-8 | 547 | 2.75 | 3 | [] | no_license | #include<cstdio>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
if (n % 3 == 0 && n % 5 == 0 && n % 7 == 0)
{
printf("%d %d %d", 3, 5, 7);
}
else if (n % 3 == 0 && n % 5 == 0)
{
printf("%d %d", 3, 5);
}
else if (n % 3 == 0 && n % 7 == 0)
{
printf("%d %d", 3, 7);
}
else if (n % 5 == 0 && n %... |
Java | UTF-8 | 1,091 | 2.453125 | 2 | [] | no_license | package Cube.GameObjects;
import Cube.Draw;
import Cube.GO;
import Cube.Draw;
import Cube.GO;
import org.lwjgl.opengl.Display;
import java.util.Random;
public class GOBonus extends GO {
public GOBonus() {
this.sx = 25;
this.sy = 25;
this.figure = 1;
Random random = new Random();... |
Markdown | UTF-8 | 1,927 | 3.203125 | 3 | [] | no_license | # 11657번 타임머신
> 문제
https://www.acmicpc.net/problem/11657
> 조건
도시의 개수 N (1 ≤ N ≤ 500), 버스 노선의 개수 M (1 ≤ M ≤ 6,000)이 주어지고 M개의 버스 노선의 정보 A, B, C (1 ≤ A, B ≤ N, -10,000 ≤ C ≤ 10,000)가 주어질 때 1번 도시에서 나머지 도시로 가는 가장 빠른 시간을 나타내라
> 접근법
도시와 버스라는 점에서 그래프, 노선의 정보가 음수를 포함하고 있다는 것에서 **벨만포드**를 떠올리고 탐색하면 된다.
> 코드
``` c++
#incl... |
C++ | GB18030 | 696 | 3.4375 | 3 | [] | no_license | //Ŀ
//nȡɸ1n͵mϵĸ
//統n = 6m = 8ʱϣ[2, 6], [3, 5], [1, 2, 5], [1, 3, 4]nmС120
#include<iostream>
#include<math.h>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
int a, b;
while (cin >> a >> b)
{
if (a > b || a < 1 || b < 1 || a>1000000000 || b> 1000000000)
cout << -1 << endl;
string a1, ... |
C | UTF-8 | 2,210 | 3.125 | 3 | [] | no_license | #include "hw6.h"
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
typedef struct elevator {
pthread_mutex_t sword;
pthread_barrier_t shield;
int current_floor;
int dest;
int is_locked;
enum {ELEVATOR_ARRIVED=1, ELEVATOR_OPEN=2, ELEVATOR_CLOSED=3} state;
} elevator;
elevator E[ELEVATORS];
int is_locke... |
C++ | UTF-8 | 1,498 | 2.5625 | 3 | [] | no_license | /*******************************************************************************\
* *
* Utilities : SmartPointerDeclarations *
* Purpose : Some utility macros to define smart pointer type n... |
PHP | UTF-8 | 1,044 | 3.03125 | 3 | [] | no_license | <?php
class Upload{
public static function to_folder($folder){
$file = $_FILES['file']['name'];
$tmp = $_FILES['file']['tmp_name'];
$error = $_FILES['file']['error'];
if($error == 0){
move_uploaded_file($tmp, $folder.$file);
return $folder.$file;
}else if($error == 1 || $error == 2){
echo ... |
Java | UTF-8 | 4,608 | 2.0625 | 2 | [] | no_license | package com.zx.zsmarketmobile.ui.system;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.InputType;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import a... |
C | UTF-8 | 1,490 | 3.828125 | 4 | [] | no_license | /*
Задача 8.
Напишете обединение от число и низ, както и описател с изброим тип за съдържанието
на обединението. Напишете функция, която получава указател към обединението и изброимия
тип и извежда съответно низ или число.
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
union MyUn... |
Go | UTF-8 | 700 | 2.640625 | 3 | [] | no_license | package Binding
import (
"minsk/CodeAnalysis/Binding/Kind/BoundNodeKind"
"minsk/Util"
)
type BoundWhileStatement struct {
*Util.ChildrenProvider
Condition BoundExpression
Body BoundStatement
}
func NewBoundWhileStatement(condition BoundExpression, body BoundStatement) *BoundWhileStatement {
... |
Go | UTF-8 | 589 | 2.796875 | 3 | [
"MIT"
] | permissive | /*
* @lc app=leetcode.cn id=503 lang=golang
*
* [503] 下一个更大元素 II
*/
// @lc code=start
func nextGreaterElements(nums []int) []int {
res:=[]int{}
i:=0
num2:=make([]int,len(nums))
copy(num2,nums)
num2=append(num2,nums...)
// fmt.Println(num2)
// fmt.Println(len(nums))
for index,value:=... |
Swift | UTF-8 | 205 | 2.953125 | 3 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | import Foundation
public class KeyValue: NSObject {
public let key: String?
public let value: Any?
init(key: String?, value: Any?) {
self.key = key
self.value = value
}
}
|
Java | UTF-8 | 3,383 | 2.3125 | 2 | [] | no_license | package br.com.rsi.exercicios.projetoExercicios.steps.definition;
import java.util.UUID;
import org.springframework.test.context.ContextConfiguration;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import br.com.rsi.exercicios.projetoExercicios.steps.b... |
Markdown | UTF-8 | 1,144 | 3.328125 | 3 | [] | no_license | # Progress 对象
使用 Progress 对象可以为 CodeSmith 生成代码的过程显示一个进度条,这对于生成比较费时的模板操作是非常有用的,如果你使用 Visual Studio,可以在状态栏中显示一进度条:

使用进度条的方法是通过 CodeTemplate 对象的 Progress 属性对象,首先是设置 Progress 对象的最大值和步长,本例通过一个简单的循环来模拟一个费时的操作:
```
<%@ Template Language="C#" TargetLanguage="Text" Debug="False" %>
<%@ Import Namespa... |
C++ | UTF-8 | 808 | 2.875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
string s;
bool check=true;
vector<string>v;
do{
cin>>s;
v.push_back(s);
if(cin.get()=='\n')
check=false;
} while(check);
int n=v.size();
if(n==1)
{v[0][0]=toupper(v[0... |
Java | UTF-8 | 1,074 | 2.421875 | 2 | [] | no_license | package com.joshcummings.codeplay.terracotta.security;
import org.zaproxy.clientapi.core.ApiResponse;
import org.zaproxy.clientapi.core.ApiResponseList;
import org.zaproxy.clientapi.core.ApiResponseSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ScanResponse {
... |
Python | UTF-8 | 474 | 2.875 | 3 | [] | no_license | import numpy as np
def calc_distance_squared(src, dst):
return np.sum((src - dst)**2)
def calc_rotation(src, dst):
A = np.dot(dst.T, src)
V, S, W = np.linalg.svd(A)
U = np.dot(V, W)
return U
def rmsd_kabsch(src, dst, return_rotated=False):
U = calc_rotation(src, dst)
rotated = np.do... |
C | UTF-8 | 105 | 2.625 | 3 | [] | no_license | #include <stdio.h>
int main(){
int val1 = 5;
int *pt1;
pt1=&val1;
printf("%d", *pt1);
return 0;
}
|
Java | UTF-8 | 6,469 | 1.9375 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2012 Comcast Corporation
*
* 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 required by applicabl... |
Java | UTF-8 | 796 | 2.953125 | 3 | [] | no_license | package soort;
/**
* @author Bryan de Ridder
* @version 1.0 26/11/2016 14:55
*/
public class Leden {
public static final int MAX_AANTAL = 100;
private int aantal = 0;
Lid[] leden = new Lid[MAX_AANTAL];
public Leden() {
}
public void voegLidToe(Lid lid) {
this.leden[aantal] = lid;
... |
Java | UTF-8 | 268 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | void abc(int b) {
x:
while (b > 0) {
try {
continue x;
} finally {
a++;
}
}
a++;
}
/* expected:
1 START -> 3
3 CHOICE -> 10 or 5 (cond: 3:12)
10 STEP -> end
5 CONTIN -> 7
7 STEP -> 3
*/ |
SQL | UTF-8 | 17,332 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 01, 2020 at 04:05 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
Java | UTF-8 | 332 | 2.546875 | 3 | [] | no_license | package expression;
/**
* Created by 808648 on 04.04.2016.
*/
public class CheckedSqrt extends CheckedAbstractUnaryExpression {
public CheckedSqrt(TripleExpression expression) {
super(expression);
}
protected int action(int value) {
return (int)(Math.sqrt((double) value));
... |
C++ | UTF-8 | 1,166 | 3.046875 | 3 | [] | no_license | #include <string.h>
#include <stdlib.h>
#include "VarTable.h"
VarTableRow::VarTableRow(const char *str, int i)
: name(0),
value(i),
next(0)
{
if (str)
name = strdup(str);
#if 0
var_addr = new int;
*var_addr = i;
#endif
}
VarTableRow::~VarTableRow()
{
if (name)
free(name);
#if 0
if (var_addr)
delete v... |
Markdown | UTF-8 | 2,670 | 2.546875 | 3 | [] | no_license | ---
title: NodeJS
category: languages
date: 09/02/2015
tags: programming, dev, nodejs, language
---
# Support
NodeJS is supported by Scalingo, furthermore, custom support has been added
to manage the [__meteor__](/languages/javascript/nodejs/meteor.html) framework.
* [Getting Started with NodeJS](/languages/javascri... |
PHP | UTF-8 | 993 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
function query($conn, $sql, $paramTypes, $params) //Used for select statements
{
$stmt = mysqli_prepare($conn, $sql) or die(mysqli_error($conn));
if (isset($paramTypes) and isset($params))
mysqli_stmt_bind_param($stmt, $paramTypes, ...$params) or die(mysqli_error($conn)); //insert params
my... |
Shell | UTF-8 | 1,377 | 3.765625 | 4 | [] | no_license | #!/bin/bash
# Install latest version of git
brew install git
# Install gpg-suite to be able to store gpg keys passphrases into OSX Keychain
brew install --cask gpg-suite
# Get full name of the OSX user (cheers @juandebravo!)
username=`whoami`
default_git_name="`finger $USER | head -n1 | cut -d ":" -f 3 | cut -c 2-`"... |
Python | UTF-8 | 1,463 | 4.25 | 4 | [] | no_license | # class Employee:
# pass
#
# #Instance variables contain data that are unique for that instance
# emp_1 = Employee()
# emp_2 = Employee()
#
# print(emp_1)
# print(emp_2)
#
# emp_1.first = 'Corey'
# emp_1.last = 'Schafer'
# emp_1.email = 'Corey.Schafer@company.com'
# emp_1.pay = 50000
#
# emp_2.first = 'Test'
# emp_... |
Markdown | UTF-8 | 1,370 | 2.6875 | 3 | [
"MIT"
] | permissive | # PlayerPickupXp
PlayerPickupXp イベントは、プレイヤーが経験値オーブを拾うたびに発生します。
## イベントクラス
関数ヘッダーのイベントをこのクラスとしてキャストする必要があります:
`crafttweaker.event. layerPickupXpEvent <br />
<code>`
もちろん、 [インポート](/AdvancedFunctions/Import/) 前にそのクラスをインポートして、その名前を使用することもできます。
## イベントインターフェースの拡張
PlayerPickupXp Eventsは以下のインターフェイスを実装しており、それらのメソッド/... |
Java | UTF-8 | 293 | 1.859375 | 2 | [] | no_license | package com.sqool.connector.api.cassandra.model;
@Data
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("posts")
class Post {
@PrimaryKey()
@Builder.Default
private String id = UUID.randomUUID().toString();
private String title;
private String content;
} |
Java | UTF-8 | 6,259 | 1.90625 | 2 | [] | no_license | package com.software.ttsl.Fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.software.ttsl.AccountDetailsActivity;
impor... |
PHP | UTF-8 | 3,334 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
/**
* A service to create and populate CSV files used for logs and other exports.
*
* @package Helpful
* @subpackage Core\Services
* @version 4.4.59
* @since 4.4.49
*/
namespace Helpful\Core\Services;
use Helpful\Core\Helper;
use Helpful\Core\Helpers as Helpers;
use Helpful\Core\Services as Services;
/*... |
PHP | UTF-8 | 2,897 | 2.65625 | 3 | [] | no_license | <?php
//$root = realpath($_SERVER["DOCUMENT_ROOT"]);
//require_once($root.'\jomon\private\initialize.php');
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
}
set_error_handler("exception_error_handler");
try
{
include_... |
Go | UTF-8 | 487 | 2.53125 | 3 | [
"BSD-3-Clause",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | package model
import (
"encoding/json"
"strings"
)
// Request Object
type BatchDeleteIterationsV4Request struct {
// 项目id
ProjectId string `json:"project_id"`
Body *BatchDeleteIterationsV4RequestBody `json:"body,omitempty"`
}
func (o BatchDeleteIterationsV4Request) String() string {
data, err := json.Marsha... |
Java | UTF-8 | 1,128 | 2.203125 | 2 | [] | no_license | package stepDefinations.examPortalSteps;
import cucumber.api.Scenario;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.openqa.selenium.WebDriver;
import pageBucket.PageReferences;
import pages.ExamPortal.HomePage;
import stepDefin... |
Java | UTF-8 | 3,144 | 3.296875 | 3 | [] | no_license | package com.simplilearn.locker.java.main;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util... |
PHP | UTF-8 | 2,178 | 2.75 | 3 | [] | no_license | <?php
namespace MagaMarketplace\Domain\Order;
/**
* Description of TrackingResponse
*
* @author Maicon Sasse
*/
class TrackingResponse extends Tracking
{
/**
* Status. (new, approved, shipped, delivered, canceled)
* @var string
*/
protected $status;
/**
* Transportadora
* @v... |
Java | UTF-8 | 3,715 | 2.78125 | 3 | [] | no_license | package ru.opa.pack.net;
import java.io.*;
/**
* Created by Vladimir_Levin on 05.12.2015.
*/
public final class HttpResponse {
public static void writeResponse(String message, OutputStream outputStream) throws IOException {
String response = "HTTP/1.1 200 OK\r\n" +
"Server: YarServer/200... |
C# | UTF-8 | 5,665 | 2.765625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | using System;
using System.Collections.Generic;
using CSF.Validation.Manifest;
namespace CSF.Validation.Rules
{
/// <summary>
/// A read-only model for contextual information related to the execution of a validation rule.
/// </summary>
public class RuleContext : ValueContext
{
/// <summary... |
Python | UTF-8 | 1,552 | 2.78125 | 3 | [] | no_license | #!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
"""
Mixing multiple inputs to multiple outputs with fade time.
"""
from pyo import *
s = Server(sr=44100, nchnls=2, buffersize=512, duplex=0).boot()
# Inputs
a = SfPlayer("../snds/ounkmaster.aif", loop=True, mul=.3)
b = SfPlayer("../snds/f... |
Java | UTF-8 | 4,107 | 2.203125 | 2 | [] | no_license | package com.cfranking.parser;
import com.cfranking.client.CfClient;
import com.cfranking.dto.ContestMeta;
import com.cfranking.dto.Problem;
import com.cfranking.dto.RankRow;
import com.cfranking.dto.Standings;
import com.cfranking.entity.CfContest;
import com.cfranking.model.CfContestList;
import com.cfranking.model.C... |
C# | UTF-8 | 2,504 | 2.578125 | 3 | [] | no_license | using ApplicationLibrary;
using ApplicationLibrary.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Applica... |
Java | UTF-8 | 10,504 | 1.9375 | 2 | [] | no_license | package com.crypto.velis.cryptorates;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;... |
Shell | UTF-8 | 310 | 3.34375 | 3 | [] | no_license | #!/bin/bash
set -e
# have to set some permissions
# https://stackoverflow.com/a/39230095
FILE="/sys/class/backlight/intel_backlight/brightness"
CURRENT=$(cat "$FILE")
if [ "$1" = "-inc" ]
then
NEW=$(( CURRENT + $2 ))
elif [ "$1" = "-dec" ]
then
NEW=$(( CURRENT - $2 ))
fi
echo "$NEW" | tee "$FILE"
|
Java | UTF-8 | 2,947 | 3.671875 | 4 | [] | no_license | package 待分类;
import java.util.Stack;
/**
* @ClassName: 待分类._42_接雨水
* @Author: whc
* @Date: 2021/03/17/22:16
*/
public class _42_接雨水 {
// 双指针法 时间复杂度O(n^2)
/*public int trap(int[] height) {
int sum = 0;
for (int i = 0; i < height.length; i++) {
// 第一个柱子和最后一个柱子不接雨水
if(i == 0 || i == height.length - 1)
... |
Java | UTF-8 | 1,222 | 3.59375 | 4 | [] | no_license | package com.bupt.thinkinjava.c7;
import static com.bupt.utils.Print.print;
/**
* 使用代理;
*/
class Cleanser {
private String s = "Cleanser";
public void append(String a) { s += a; }
public void dilute() { append(" dilute()"); }
public void apply() { append(" apply()"); }
public void scrub() { app... |
Java | UTF-8 | 1,961 | 2.390625 | 2 | [] | no_license | package com.wyd.resource;
import java.util.Date;
import java.util.List;
import java.util.Random;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.glassfish.jersey.media.multipart.Form... |
SQL | UTF-8 | 221 | 3 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS contribuinte (
id INT AUTO_INCREMENT,
pessoa_id INT NOT NULL,
PRIMARY KEY(id),
CONSTRAINT fk_pessoa_contribuinte FOREIGN KEY (pessoa_id) REFERENCES pessoa(id)
) ENGINE=INNODB;
|
Python | UTF-8 | 961 | 4.3125 | 4 | [] | no_license | # Exercise 15 - Reading Files
from sys import argv
script, filename = argv
# Explanation below
txt = open(filename)
# txt = open(filename, 'w')
# txt.close()
# txt.write('test')
# format prints filename from user input in argv
print(f"Here's your file {filename}: ")
# reads the text file to end of file
# .read is w... |
Java | UTF-8 | 1,696 | 2.25 | 2 | [] | no_license | package Nurse_reg;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletReq... |
Java | UTF-8 | 858 | 2.53125 | 3 | [] | no_license |
package com.usky.sms.permission;
import java.util.HashMap;
import java.util.Map;
import com.usky.sms.core.AbstractCache;
public class PermissionSetRegister extends AbstractCache {
private Map<String, PermissionSet> permissionSetMap = new HashMap<String, PermissionSet>();
@Override
protected void refresh() {
... |
Python | UTF-8 | 3,650 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | """Utilities for handling prefix dictionaries"""
from .util import U_EMPTY_STRING, U_PLUS
from .phonenumberutil import format_number, PhoneNumberFormat
_LOCALE_NORMALIZATION_MAP = {"zh_TW": "zh_Hant", "zh_HK": "zh_Hant", "zh_MO": "zh_Hant"}
def _may_fall_back_to_english(lang):
# Don't fall back to English if th... |
JavaScript | UTF-8 | 765 | 2.671875 | 3 | [] | no_license | import defaultExport from "../Settings.js"
let userZip
let userWeather = []
export const getWeather = () => {
return fetch(`http://api.openweathermap.org/data/2.5/weather?zip=${userZip[0].zipcode},US&units=imperial&appid=${defaultExport.weatherKey}`)
.then(response => response.json())
.then(
pars... |
Java | UTF-8 | 4,486 | 2.515625 | 3 | [
"MIT"
] | permissive | /*
* The MIT License
*
* Copyright 2017 Leif Lindbäck <leifl@kth.se>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* ... |
Markdown | UTF-8 | 1,259 | 2.765625 | 3 | [] | no_license | # yt-upload
A node package to upload videos on youtube from your terminal
# Install
```console
$ npm i -g yt-upload
```
# Getting Started
Follow the (Turn on the YouTube Data API, only a to g) steps shown here **https://developers.google.com/youtube/v3/quickstart/nodejs**
Move the downloaded file to **(C:\Users\<*yo... |
Markdown | UTF-8 | 10,815 | 3.171875 | 3 | [] | no_license | # Url Shortener REST API (AWS Version)
**Challenge:** Design and implement a RESTful API for a URL shortener.
**Requirements:**
1. Develop a RESTful API to create shorten URLs. This API should receive an URL and will return a shortened version of it.
2. Redirect to the original URL when the shortened URL is called.
... |
C | UTF-8 | 4,613 | 2.546875 | 3 | [] | no_license | /*
* footcount.c
*
* Created on: May 29, 2019
* Author: wjtjdrb
*/
#include <sensor.h>
#include <dlog.h>
#include <footcount_module.h>
#include "data_storage.h"
// STEPS means the values that will be used in getStepsCount(); tmpnum is just to use temporarily check and test.
int STEPS = -1;
sensor_recorder_o... |
Java | UTF-8 | 4,032 | 1.835938 | 2 | [] | no_license | package com.example;
import com.google.cloud.dataflow.sdk.Pipeline;
import com.google.cloud.dataflow.sdk.io.TextIO;
import com.google.cloud.dataflow.sdk.options.DataflowPipelineOptions;
import com.google.cloud.dataflow.sdk.runners.BlockingDataflowPipelineRunner;
import com.google.cloud.dataflow.sdk.options.Default;
imp... |
Python | UTF-8 | 1,322 | 2.875 | 3 | [] | no_license | """
@ OFDM仿真
@ 信道中,信号与信道特征卷积
@ DD
"""
import numpy as np
from GlobalParameter import SymbolLength # 调制后发入信道的ofdm符号长度
#
# two-tap channel
#
def getTwoTapChannel():
"""
:param: void
:return: generates a (2-tap) channel
"""
h_temp = np.array([np.random.rand() + 1j * np.random.rand(), (np.random.rand... |
Java | UTF-8 | 2,901 | 2.375 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.organizer.form;
import java.io.Serializable;
import javax.persistence.*;
import org.codehaus.jackson.annotate.JsonIgnore;
/**
*
* @author dejmien
*/
@Entity
@Table(name = "diary")
@NamedQueries({
@N... |
JavaScript | UTF-8 | 2,086 | 2.609375 | 3 | [] | no_license | class EditorData {
constructor( type, label ) {
this.type = type;
this.label = label;
this.source = {};
this.__labels = {};
this.__help_messages = {};
this.__gateway_attrs = {};
this.__messages = {};
}
setSource( config ) {
this.source = config;
return this;
}
setLabels( config ) {
this.__la... |
C++ | UTF-8 | 592 | 2.578125 | 3 | [] | no_license | #ifndef FLASHANIMATION_H
#define FLASHANIMATION_H
#include "Animation.h"
typedef unsigned char frame_t;
class FlashAnimation : public Animation{
frame_t repetitions;
delay_t hideDelay;
delay_t showDelay;
public:
FlashAnimation (frame_t n, delay_t show, delay_t hide, animid_t id );
~FlashAnimation(void);
... |
PHP | UTF-8 | 394 | 3.296875 | 3 | [] | no_license | <?php
class Student
{
private $roll=101;
private $stu_name='kuldeep';
private $f_name='shiv';
}
class Weakstudent extends Student
{
private $contact='8890834430';
function showData()
{
//echo $this->roll;
//echo $this->stu_name; //private member is not access in another class.
//echo $this->f_name;
... |
Markdown | UTF-8 | 543 | 2.5625 | 3 | [] | no_license | # twitchStreamsDisplay
Display the twitch streams in your web, 100% editable css so it can match your web styles.
IMPORTANT:
1.Remeber you will need to have a twitch API clientId in order to use this in your web, otherwise the API calls will never retrieve the information.
2.Here you have a TWICH blog post about whe... |
C++ | UTF-8 | 2,805 | 3.65625 | 4 | [] | no_license | // IFStatement.cpp:
/*An IF statement acts as a conditional GOTO statement.
It performs a comparison, and jumps to the specified line number
if the comparison is true.
An IF will always be followed by exactly five strings. The first is the
name of the variable, the second is the operator, the third is an integer,
... |
Java | UTF-8 | 1,093 | 2.125 | 2 | [] | no_license | package net.semsun.controller;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeratio... |
Python | UTF-8 | 817 | 3.265625 | 3 | [
"Unlicense"
] | permissive | # Unterdrückt die AVX2 Warnung
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
# Console.Write("Wie ist Dein Name? ");
# string name = Console.ReadLine();
#
# Console.Write("Gewicht in kg: ");
# double weight = double.Parse(Console.ReadLine());
#
# Console.Write("Größe in cm: ");
# int height... |
TypeScript | UTF-8 | 353 | 2.9375 | 3 | [
"MIT"
] | permissive | // Based on https://github.com/wilsonzlin/edgesearch/blob/d03816dd4b18d3d2eb6d08cb1ae14f96f046141d/demo/wiki/client/src/util/util.ts
// Ensures value is not null or undefined.
// != does no type validation so we don't need to explcitly check for undefined.
export function exists<T>(value: T | null | undefined): value ... |
Python | UTF-8 | 953 | 3.4375 | 3 | [] | no_license | class Solution:
def numIslands(self, grid) -> int:
if not grid or not grid[0]:
return 0
m, n = len(grid), len(grid[0])
count = 0
for i in range(m):
for j in range(n):
if grid[i][j] == '1':
self.bfs(grid, i, j, m, n)
... |
C++ | UTF-8 | 260 | 2.890625 | 3 | [] | no_license | #include "Cube.h"
bool Cube::validCube() const
{
if (a > 0.0 && b > 0.0 && c > 0.0)
{
return true;
}
return false;
}
double Cube::volume() const
{
return a * b * c;
}
Cube::Cube(const double a, const double b, const double c) :
a(a), b(b), c(c)
{
} |
Python | UTF-8 | 91 | 2.6875 | 3 | [] | no_license | # temp 이름의 비어있는 딕셔너리를 만들라.
temp = {}
print(temp, type(temp))
|
Python | UTF-8 | 3,411 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | # ###########################################################################
#
# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP)
# (C) Cloudera, Inc. 2020
# All rights reserved.
#
# Applicable Open Source License: Apache 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hu... |
C++ | UTF-8 | 4,490 | 2.546875 | 3 | [] | no_license |
//
// Name: CpuWorkload.cpp : implementation file
// Author: hieunt
// Description: Stress CPU with many workload
//
#include "stdafx.h"
#include "CpuWorkload.h"
#define ARR_LEN 2048
/// <summary>
/// Initializes a new instance of the <see cref="CpuWorkload"/> class.
/// </summary>
CpuWorkload::CpuWorkload()
{
... |
Python | UTF-8 | 16,310 | 3.515625 | 4 | [] | no_license |
import os
import pandas as pd
import numpy as np
import requests
import time
import re
# ---------------------------------------------------------------------
# Question #1
# ---------------------------------------------------------------------
def request_with_retries(url, max_retry, retry=0):
'''returns a http ... |
Java | UTF-8 | 686 | 1.953125 | 2 | [] | no_license | package com.example.android.journalapp.Activities;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.example.android.journalapp.Contract.ViewProfileContract;
import com.example.android.journalapp.R;
public class ViewProfileActivity extends AppCompatActivity implements ViewProfileC... |
Java | UTF-8 | 440 | 1.914063 | 2 | [
"Apache-2.0"
] | permissive | package io.xmeta.jetbrains.services;
import com.intellij.openapi.application.ModalityState;
import java.util.concurrent.Callable;
import java.util.function.Consumer;
public interface ExecutorService {
<T> void runInBackground(Callable<T> task, Consumer<T> onSuccess, Consumer<Exception> onFailure);
<T> void ... |
C++ | UTF-8 | 935 | 3.71875 | 4 | [] | no_license | #include <cstdio>
#include <cstring>
#include "employee.h"
employee::employee(const char *const first, const char *const last,
const date &birth, const date &hire)
// : birth_date(birth), hire_date(hire) // member initializer list
{
size_t len = strlen(first);
len = len < 25 ? len : 24;
strncpy(this->first_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.