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
4,687
3.4375
3
[ "MIT" ]
permissive
package praktomatTask1; import java.util.*; public class TOHSolution { private static int numOfDiscs = 0, numOfMoves = 0, numOfDiscs_Post1 = 0, numOfDiscs_Post2 = 0, numOfDiscs_Post3 = 0; private static Stack<Integer> post_1 = new Stack<Integer>(); private static Stack<Integer> post_2 = new Stack<Integer>...
C
UTF-8
5,519
2.90625
3
[]
no_license
/* Example for Secure_2 Click Date : Jul 2017. Author : Djordje Rosic Test configuration KINETIS : MCU : MK64 Dev. Board : HEXIWEAR ARM Compiler ver : v5.1.0.0 Description : Following example demonstrates sending commands to Secure 2 click us...
Python
UTF-8
693
3.203125
3
[ "MIT" ]
permissive
""" Client Class """ import socket import json # localhost, free port (> 1023) HOST, PORT = '127.0.0.1', 1234 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((HOST, PORT)) s.sendall(str.encode('Hello, World')) data1 = s.recv(1024) orig_list = [1, 2, 3] l_string = json.dumps...
Shell
UTF-8
291
2.53125
3
[ "Apache-2.0" ]
permissive
#!/bin/bash set -e docker build -f "$DOCKERFILE_PATH" -t $DOCKER_REPO:${DOCKER_TAG//,/ -t $DOCKER_REPO:} . \ --build-arg "build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ --build-arg "vcs_ref=$SOURCE_COMMIT" \ --build-arg "image_version=$SOURCE_BRANCH"
Python
UTF-8
1,747
2.859375
3
[ "MIT" ]
permissive
""" Sample code to test timely3 """ import time from pprint import pprint from timely3 import timely3 import timely3 as timely3_module import logging log = logging.getLogger('timely3/simple') logging.basicConfig( format='[%(name)s:%(lineno)s][%(levelname)s] %(message)s', level=logging.DEBUG, ) log.setL...
Markdown
UTF-8
7,174
2.90625
3
[]
no_license
--- title: "GPIO Character Device" layout: post comments: true date: 2021-03-11 14:24 image: headerImage: tag: - Linux - GPIO star: false category: Linux author: jihun --- <!-- more --> # Overview The GPIO character device has been implemented since kernel 4.8. It will be replaces *sysfs*(`CONFIG_GPIO_SYSFS`) gpio i...
Java
UTF-8
880
1.898438
2
[ "Apache-2.0" ]
permissive
package com.event.discovery.agent.base.config; import com.event.discovery.agent.framework.utils.IDGenerator; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.spri...
Markdown
UTF-8
15,746
3.59375
4
[]
no_license
# ES6 In Depth: Modules ### By [Jason Orendorff](https://blog.mozilla.org/jorendorff/) Posted on August 14, 2015 in [ES6 In Depth](https://hacks.mozilla.org/category/es6-in-depth/), [Featured Article](https://hacks.mozilla.org/category/featured/), and [JavaScript](https://hacks.mozilla.org/category/javascript/) *...
Python
UTF-8
642
3.265625
3
[]
no_license
import numpy as np from numpy import linalg as la #相似度计算,若inA,inB都是行向量 #欧式距离 def euclidsimilar(inA,inB): return 1.0/(1.0+la.norm(inA-inB)) #皮尔逊相关系数 def pearsonsimilar(inA,inB): if len(inA)<3: return 1.0 return 0.5+0.5*np.corrcoef(inA,inB,rowvar=0)[0][1] #余弦相似度 def cossimilar(inA,inB): inA =...
JavaScript
UTF-8
618
2.5625
3
[]
no_license
var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { var location = req.param('location'); if( location === 'milano') { res.send('{"condizione":"soleggiato", "temperatura":"32°C"}'); } if( location === 'padova') { res.send(...
C++
GB18030
1,459
3.4375
3
[]
no_license
#include <iostream> #include <climits> //3,1ѧϰ͵ĴС //ʱ䣺2020112222:06:52 //int main() //{ // using namespace std; // int n_int = INT_MAX; // short n_short = SHRT_MAX; // long n_long = LONG_MAX; // long long n_llong = LLONG_MAX; // // cout << "short is " << sizeof(short) << " bytes." << endl; // cout << "int is " << sizeo...
Python
UTF-8
343
2.9375
3
[]
no_license
from PIL import Image im = Image.open('F:\相册\塞尔达\四英杰.png') # src_image.show() # print(src_image) rgb_pixels = list(im.getdata()) r_pixels = list(im.getdata(band=0)) g_pixels = list(im.getdata(band=1)) b_pixels = list(im.getdata(band=2)) print(rgb_pixels[:10]) print(r_pixels[:10]) print(g_pixels[:10]) print(b_pixels...
TypeScript
UTF-8
266
2.828125
3
[ "MIT" ]
permissive
import { AsyncSpecification } from '../index'; export class NumberIsPrime extends AsyncSpecification<number> { async isSatisfiedBy(n: number) { for (var i = 2; i < n; i++) { if (n % i === 0) { return false; } } return n > 1; } }
Python
UTF-8
491
2.5625
3
[]
no_license
import paramiko def login_ssh (ip, username, password, port = 22, cmd = 'ip address print'): ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(ip, port = port , username = username, password = password, timeout=5, compress=True)...
JavaScript
UTF-8
2,098
3.015625
3
[ "MIT" ]
permissive
define(function () { 'use strict'; var Characters = { SPACE: ' ', TAB: '\t' }; function TabConvertion(units) { this.units = units; } TabConvertion.prototype.getIndentation = function (wsCount, tabCount) { if (!wsCount) { return; } var newTabs = Math.floor(wsCount / this.u...
Java
UTF-8
2,227
2.59375
3
[]
no_license
package ui.controls; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.support.v4.math.MathUtils; import android.util.AttributeSet; import android.util.Log; import android.view.GestureDetector; import android.view.KeyEvent; impo...
Markdown
UTF-8
1,542
2.609375
3
[]
no_license
--- layout: post title: Tomcat URL 长度限制 date: 2015-08-06 16:54:54 categories: Tomcat --- * content {:toc} ## 原因 某次用户请求的url总长度为12364字符,tomcat直接报400错误 --- ## 分析 我之前一直知道一个"真理": get请求是限制长度的,而post请求是不限制长度的 在查询解决方案的过程中发现,上面的"真理"有问题: 在http协议中,其实并没有对url长度作出限制 url的最大长度和用户浏览器和Web服务器有关 一语惊醒梦中人啊 知道了原因问题就好解决了,由于我们是...
PHP
UTF-8
7,645
2.625
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
<?php class model_user extends CI_Model { function __construct() { // Call the Model constructor parent::__construct(); $this->load->helper(array('form','url')); $this->load->library(array('session', 'form_validation', 'email')); } //send verification e...
Java
UTF-8
2,693
2.84375
3
[ "MIT" ]
permissive
package se.iths.httpHandler; import se.iths.model.HttpRequest; import se.iths.model.HttpResponse; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.net.Socket; import java.nio.file.Files; import java.nio.file.Path; public class ResponseHandler { /** * Constructs our httpRes...
Python
UTF-8
1,837
2.65625
3
[]
no_license
import urllib.request import xml.etree.ElementTree as ET import pickle import difflib from pprint import pprint as pp def main(): # mid = '1f4p3zPa1uU_gRnbQzMAqCZTPzD4' # National Parks # mid = '1Zn_fIUf06TLnOshLtZCqdbbHLCo' # CA Parks # mid = '1_QU4xcCYTGTszmV4IXMgKeN4uPE' # DG Courses Small ...
C
UTF-8
3,098
3.046875
3
[]
no_license
#include <stdio.h> typedef struct { double prob; int prev_idx; }viterbi_node; #define RIGHT 0 #define LEFT 1 #define STOP 2 #define FORWARD 3 const char *states[] = {"RIGHT", "LEFT", "STOP", "FORWARD"}; // labels for states 0...3 #define NONE 0 #define H1 1 #define H2 2 #define H3 3 #define H4 4 const char *observ...
C++
UTF-8
1,239
3.109375
3
[]
no_license
/************************************************************************* > File Name: binaryinsertsort.h > Author: > Mail: > Created Time: Thu 06 Dec 2018 03:20:37 AM PST ************************************************************************/ #ifndef _BINARYINSERTSORT_H #define _BINARYINSERTSORT_H //gist:us...
Java
UTF-8
7,189
2.421875
2
[]
no_license
package com.visionbizsolutions; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileu...
Java
UTF-8
5,250
2.109375
2
[]
no_license
package ch.hsr.mge.gadgeothek.ui; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity;...
Swift
UTF-8
3,138
2.546875
3
[ "MIT" ]
permissive
// // Animation.swift // VPFramework // // Created by Vandan Patel on 11/4/17. // Copyright © 2017 Vandan Patel. All rights reserved. // import UIKit import UIKit let appIdeasAnimation = AppIdeasAnimation.sharedInstance class AppIdeasAnimation { static let sharedInstance = AppIdeasAnimation() ...
PHP
UTF-8
1,111
2.796875
3
[]
no_license
<?php namespace App\Database\Repositories; use App\Database\Eloquent\Repository; use App\Database\Models\User; use App\Helpers\RouteHelper; class RoomRepository extends Repository { /** * Return the model class name. * * @return string */ public function modelName() { return '...
C
UTF-8
3,672
3.953125
4
[]
no_license
#include <stdio.h> #include <stdlib.h> typedef struct TreeNode { int data; struct TreeNode *left; struct TreeNode *right; struct TreeNode *parent; }TreeNode; TreeNode *minVal(TreeNode *root) { while(root != NULL && root->left != NULL && root->right != NULL) { root = root->left; } return root; } TreeNode *ma...
Swift
UTF-8
3,972
2.515625
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// // UITextFieldProcessor.swift // XibProcessor // // Created by 张楠[产品技术中心] on 2018/6/6. // import Foundation import SWXMLHash class UITextFieldProcessor: UIControlProcessor { override func process(attrName: String, attrText: String) { if attrName == "text" { output[attrName] = attrText.qu...
Ruby
UTF-8
2,349
2.875
3
[ "MIT" ]
permissive
# frozen_string_literal: true require 'forwardable' require 'json' require 'stringio' require 'haml_lint/logger' require 'cc/engine/issue' module CC module Engine # Converts the +HamlLint+ report format to CodeClimate issues class ReportAdapter extend Forwardable include Enumerable # Inst...
Java
UTF-8
1,847
3.734375
4
[]
no_license
//给定一个字符串,逐个翻转字符串中的每个单词。 // // // // 示例 1: // // 输入: "the sky is blue" //输出: "blue is sky the" // // // 示例 2: // // 输入: "  hello world!  " //输出: "world! hello" //解释: 输入字符串可以在前面或者后面包含多余的空格,但是反转后的字符不能包括。 // // // 示例 3: // // 输入: "a good   example" //输出: "example good a" //解释: 如果两个单词间有多余的空格,将反转后单词间的空格减少到只含一个。 // /...
Java
UTF-8
708
2.015625
2
[]
no_license
package com.example.android_shopping.interfaces.googs; import com.example.android_shopping.interfaces.Callback; import com.example.android_shopping.interfaces.IBaseModel; import com.example.android_shopping.interfaces.IBasePresenter; import com.example.android_shopping.interfaces.IBaseView; import com.example.android_...
PHP
UTF-8
2,921
3.046875
3
[]
no_license
<?php // including the database connection file $servername = "lab.chrhjq7ibkz8.us-east-1.rds.amazonaws.com"; $username = "master"; $password = "lab-password"; $dbname = "lab"; $mysqli = mysqli_connect($servername, $username, $password, $dbname); if(isset($_POST['submit'])) { $id = $_POST['id']; $fname=$_POST...
Java
UTF-8
235
2.640625
3
[]
no_license
package optional; import java.util.Optional; public class OptionalExample { public static void main(String[] args) { String nullString = null; String optionalS = Optional.ofNullable(nullString).orElse(""); } }
Java
UTF-8
2,090
3.21875
3
[]
no_license
package study.patter.prototype.testclone; import study.patter.prototype.original.Desciption; import study.patter.prototype.original.Original; /* * date 20180712 * author suxin * desciptioni 深度克隆复制的不是一份引用,即新产生的对象和原始对象中的非基本数据类型的属性指向的不是同一个对象 * */ public class DeepClone { public static void main(String[] args) {...
Swift
UTF-8
988
3.125
3
[]
no_license
// // FaceExpression.swift // standford_view // // Created by Myeongjin kyeong on 2017. 6. 14.. // Copyright © 2017년 Myeongjin kyeong. All rights reserved. // import Foundation struct FacialExpression { let eyes: Eyes let mouth : Mouth enum Eyes : Int{ case open case clo...
Python
UTF-8
523
3.734375
4
[]
no_license
# Judge Route Circle class Solution(object): def judgeCircle(self, moves): """ :type moves: str :rtype: bool """ # Time Comp O( len(moves)) # Space Comp is O(1) x,y = 0,0 for m in moves: if m == "U": y += 1 eli...
Java
ISO-8859-13
650
3.140625
3
[]
no_license
package recurso; public class Pessoa { char sexo; float altura; float massa; String nome; public Pessoa(String n,char sexo) { nome=n; this.sexo=sexo; } public void andar(int passos) {System.out.println("Andei "+ passos+ " passos"); } public void falar(String oque){ Sys...
Markdown
UTF-8
2,673
2.59375
3
[]
no_license
> [Livre des monstres](tome_of_beasts_old.md) --- # Mi-Go - Source: (LDM p300)(TOB p287) - TOB: Mi-Go -  Plante de taille Moyenne (M), neutre mauvaise - **Classe d'armure** 17 (armure naturelle) - **Points de vie** 76 (8d8+40) - **Vitesse** 9 m, vol 18 m |FOR|DEX|CON|INT|SAG|CHA| |---|---|---|---|---|---| |16 (+3)...
C#
UTF-8
1,763
2.515625
3
[]
no_license
using ActivityMessaging; using MassTransit.Util; using Models; using System.Collections.Generic; namespace ServiceLayer { //service layer public class DMBus { //ovo treba da postane interfejs private static RabbitMqBus _bus; public DMBus(RabbitMqBus rabbit) { ...
PHP
UTF-8
2,468
2.5625
3
[ "MIT" ]
permissive
<?php namespace Crm\PaymentsModule\Hermes; use Crm\PaymentsModule\Repository\RetentionAnalysisJobsRepository; use Crm\PaymentsModule\Retention\RetentionAnalysis; use Nette\Localization\Translator; use Psr\Log\LoggerAwareTrait; use Tomaj\Hermes\Handler\HandlerInterface; use Tomaj\Hermes\MessageInterface; class Retent...
Java
UTF-8
1,342
2.171875
2
[ "Apache-2.0" ]
permissive
package com.imadcn.framework.lock.spring.schema; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.util.StringUtils; import org.w3c.dom.E...
Java
UTF-8
823
2.390625
2
[]
no_license
package com.abee.ftp; import com.abee.ftp.client.AdvancedOperationSet; import com.abee.ftp.client.BasicOperationSet; import com.abee.ftp.client.MyFtpClient; import com.abee.ftp.client.secure.Authenticator; import org.apache.commons.codec.DecoderException; import java.io.*; /** * @author xincong yao */ public class...
Python
UTF-8
3,318
3.09375
3
[ "MIT" ]
permissive
from dskc.visualization.graphs import bars, bars_target_proportion from dskc._util.string import get_display_text from dskc.visualization.terminal.jupyter import markdown_h2 from dskc._util.dates import get_weekdays from . import util def time_graphs(df, column, ylabel="", year=True, month=True, day=True, weekday=Tru...
Python
UTF-8
4,581
2.734375
3
[]
no_license
from app import app from flask import render_template @app.route('/') @app.route('/index') def index(): return render_template('index.html', title='Home') ######################################### ##### My Stuff Below ##### ######################################### @app.route('/test') def test(...
Markdown
UTF-8
1,010
3
3
[]
no_license
--- title: "great mens circle tonight" tags: [ "mkp", "circle" ] author: Rob Nugen date: 2018-08-14T22:50:52+09:00 --- ##### 22:50 Tuesday 14 August 2018 JST Four men in the circle tonight, including two relatively newcomers. I experienced beautiful facilitation to help me get the courage to implement my new idea. ...
Python
UTF-8
2,881
2.921875
3
[]
no_license
""" Project: File: main.py Created by: louise On: 10/13/17 At: 3:09 PM """ from __future__ import print_function import time import numpy as np from PIL import Image import matplotlib.pyplot as plt import torch from torch.autograd import Variable import torch.optim as optim import torchvisi...
Java
UTF-8
14,400
2.4375
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Thread; import com.monitorjbl.xlsx.StreamingReader; import java.io.DataOutputStream; import java.io.File; import java.io.FileI...
Java
UTF-8
1,073
2.125
2
[]
no_license
package com.kafka.producer.server; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.Producer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.Properties; @Configuration public class Produ...
Markdown
UTF-8
629
4.03125
4
[ "MIT" ]
permissive
# Caesar Cipher A simple [caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher) in Python. This script takes text input and rotates each character according to a predefined numeric offset. Disclaimer: This code is for learning purposes only and should never be used for practical purposes as it is easily revers...
Swift
UTF-8
3,554
2.65625
3
[ "MIT" ]
permissive
import NIO import NIOHTTP1 import NetService import Socket import class Foundation.RunLoop class MyServiceDelegate: NetServiceDelegate { func netServiceWillPublish(_ sender: NetService) { print("Will publish: \(sender)") } func netServiceDidPublish(_ sender: NetService) { print("Did pu...
JavaScript
UTF-8
354
2.6875
3
[]
no_license
import * as types from './action.type' const inniState = { number: 0 } export const reducer = (state = inniState, action) => { switch (action.type) { case types.PLUS: return { number: state.number + 1 } case types.MINUS: return { number: state.number - 1 } default...
SQL
UTF-8
829
3.46875
3
[]
no_license
drop table t_base_user_info_s_tbuserinfo_t_step3 ; create table t_base_user_info_s_tbuserinfo_t_step3 as select t3.*,prov as tel_prov,city as tel_city from ( SELECT uid as tb_id , regexp_replace(alipay, 'None', '-') as alipay, buycnt, verify, regtime, nick as tb_nick, location as tb_location , t1.tgender as q...
Java
UTF-8
429
1.890625
2
[]
no_license
package net.absolutioncraft.api.bukkit.rank; import com.google.inject.AbstractModule; import com.google.inject.Scopes; import net.absolutioncraft.api.bukkit.rank.expirer.RankExpirer; /** * @author MelonDev * @since 1.0.0 */ public class RankExpirationModule extends AbstractModule { @Override protected void...
Markdown
UTF-8
1,300
2.828125
3
[]
no_license
# jsonformat Simple chrome extension to format JSON responses. Load the extension and click the "J" icon to format a response. ## Installation This plugin hasn't been uploaded to the Chrome Web Store yet. Instead you can add this extension to Chrome by: 1. Downloading [the code](https://github.com/ColdHeat/jsonform...
Markdown
UTF-8
3,448
2.6875
3
[ "Apache-2.0" ]
permissive
[![Latest Stable](https://img.shields.io/github/downloads/biltudas1/the-private-torrent/latest/total?color=brightgreen&style=for-the-badge&label=Stable)](https://github.com/BiltuDas1/the-private-torrent/releases/latest) [![Latest Beta](https://img.shields.io/github/downloads-pre/biltudas1/the-private-torrent/latest/tot...
C#
UTF-8
782
2.59375
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; using Xamarin.Forms; namespace Workflow.Controls { public class GradientButton:Button { public BindableProperty StartColor { get; set; } public BindableProperty EndColor { get; set; } public Color Start { g...
Markdown
UTF-8
1,589
2.609375
3
[]
no_license
[Back to the Ling/Light_DatabaseInfo api](https://github.com/lingtalfi/Light_DatabaseInfo/blob/master/doc/api/Ling/Light_DatabaseInfo.md)<br> [Back to the Ling\Light_DatabaseInfo\Helper\TypeHelper class](https://github.com/lingtalfi/Light_DatabaseInfo/blob/master/doc/api/Ling/Light_DatabaseInfo/Helper/TypeHelper.md) ...
PHP
UTF-8
268
2.640625
3
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
<?php declare(strict_types=1); namespace JonVaughan\WebapiClient\Api\Data; interface ApiObjectInterface { /** * @return array|null */ public function getData(); /** * @param array $data */ public function setData(array $data); }
Java
UTF-8
1,166
3.140625
3
[]
no_license
public class LastViewedSeries { private String seriesName; private int lastViewedEpisode; private int[] viewedEpisodes = new int[]{0,0,0}; private boolean isSeriesFinishedToBeViewed; public LastViewedSeries(String seriesName) { this.seriesName = seriesName; } public String getSerie...
PHP
UTF-8
1,747
2.78125
3
[]
no_license
<?php namespace FormulaTG\Commands; use Exception; use FormulaTG\Utils\HelpInfo; use FormulaTG\Validators\Command\CountParams; class HelpCommand extends Command { protected function validate(): void { if (count($this->params) === 0) { return; } $validateParamsQuantity = n...
Java
UTF-8
538
2.1875
2
[]
no_license
package tw.com.useful.data.model; import com.mongodb.BasicDBObject; public class Field extends BasicDBObject { /** * */ private static final long serialVersionUID = 1L; public Field(String code, String name){ put("code", code); put("name", name); } public Field(){ } public String getName() ...
Markdown
UTF-8
2,494
3.1875
3
[]
no_license
# Simple Informational Only Scenario ## Table of Contents * [Scenario Motivation](#motivation) * [Scenario Technical Introduction](#introduction) * [Detailed Message Exchange](#message-exchange) * [Scenario Conclusion](#conclusion) ## Motivation This scenario is to avoid inteference with the neighouring nodes' tra...
C
UTF-8
1,718
3.234375
3
[]
no_license
/** \file logger.h * Functions to handle the logging of the gopher file transfers. * @file logger.c */ #ifndef LOGGER_H #define LOGGER_H #include "datatypes.h" #include "globals.h" #define LOGGER_SUCCESS 0 #define LOGGER_FAILURE -1 /** * A struct representing an instance of a transfer log */ ty...
TypeScript
UTF-8
1,667
2.859375
3
[]
no_license
import DecryptService from "@app/services/decrypt-service"; import EncryptService, { IEncrypt } from "@app/services/encrypt-service"; import EncrypterParams from '@app/services/encrypter-params'; import { PASS_LENGTH, SALT_LENGTH } from "@app/config/env"; import { KeyHelper } from '@app/helpers/key.util'; export class...
Java
UTF-8
3,039
2.1875
2
[]
no_license
package my.spring.siw.tud.controllers; import java.lang.reflect.InvocationTargetException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframewo...
Java
UTF-8
965
3.234375
3
[]
no_license
static void removeDups(LinkedListNode root){ LinkedListNode curr = root, prev = null; HashSet<Integer> set = new HashSet<>(); while(curr != null){ if(set.contains(curr.val)) prev.next = curr.next; else{ set.add(curr.val); ...
C
UTF-8
152
2.984375
3
[]
no_license
#include<stdio.h> main() { float a,b; int c; printf("Enter two floatting numbers : "); scanf("%f %f",&a,&b); c=a+b; printf("%f\n %f\n %i",a,b,c); }
Ruby
UTF-8
404
3.375
3
[]
no_license
class Sieve def initialize(max_number) @potential_primes = (2..max_number).to_a end def primes(remaining_nums = @potential_primes, found_primes = []) if remaining_nums.length.zero? found_primes else found_primes.push(remaining_nums.shift) remaining_nums.select!{|num| !(num % found...
C++
UTF-8
690
2.546875
3
[]
no_license
#include "guide_lan.h" #include "guide_lanmgr.h" namespace maxnet{ LanMgr::LanMgr(){ } LanMgr::~LanMgr(){ #if 1 Lan * if_lan = NULL; for(unsigned int i=0; i < node_list.size(); i++){ if_lan = (Lan *)node_list.at(i); if(!if_lan->isGroup()) delete if_lan; } node_list.clear(); #endif r...
Markdown
UTF-8
1,038
2.78125
3
[]
no_license
# Machine-Learning-Artificial-Intelligence-MSIS549 This repository stores my assignments and labs from the graduate curriculum - Machine Learning and Artificial Intelligence For Business Applications (MSIS 549). Assignment 1: Multi-class classification problem on Reuters Newswires Dataset. How to encode labels and sol...
Java
UTF-8
644
3.03125
3
[ "MIT" ]
permissive
package com.hit.basinfo.base_data_structure; import com.hit.common.ListNode; /** * author:Charies Gavin * date:2019/1/21,11:30 * https:github.com/guobinhit * description: Simple Stack */ public class SimpleStack { ListNode top; void push(Object item) { ListNode t = new ListNode(Integer.valueOf((...
Markdown
UTF-8
532
3.28125
3
[]
no_license
## Branches - Creating and naming a branch -> `git checkout -b <name of branch>` - Can also change with `git checkout <name of branch e.g. main>` back to another branch - Once in the branch, can add files to that branch with `git add .` `git commit -m "message"` and `git push origin <branch name>` ![](img/branch.PNG)...
Markdown
UTF-8
15,464
2.65625
3
[]
no_license
# SunSystems automated backups script This repository hosts the powershell backup & setup scripts. This repository provides: - documentation & installation information, - issue tracking and - full change/version control. Kindly contact trghelp@trginternational.com for any additional clarifications required. ## T...
C#
UTF-8
2,387
2.765625
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; namespace FileExplorer.WPF.BaseControls { /// <summary> /// Display ContentOn or ContentOff depends on whether IsSwitchOn is true. /// </...
C#
UTF-8
1,068
2.890625
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; /// <summary> /// this is an abstract class for all distributions that need to be rendered on screen /// </summary> public abstract class Distribution : MonoBehaviour { /// <summary> /// returns the proba...
Java
UTF-8
7,485
3.109375
3
[]
no_license
/** * AsteroidGame.java * @date Mar 31, 2012 * @author ricky barrette * * Copyright 2012 Richard Barrette * * 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...
C++
UTF-8
5,495
2.546875
3
[ "BSD-3-Clause" ]
permissive
// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ash/hud_display/data_source.h" #include <algorithm> #include "ash/hud_display/memory_status.h" #include "base/functional/bind.h" #include "base/threading/thread_res...
C#
UTF-8
1,001
3.53125
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace August2017 { class Program { static void Main(string[] args) { Queue<long> numbers = new Queue<long>(); List<long> list = new List<long>(); ...
Java
UTF-8
13,697
2.0625
2
[]
no_license
package com.example.btapp; import android.annotation.SuppressLint; import android.app.AlertDialog; import android.app.Dialog; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Di...
Markdown
UTF-8
1,250
2.640625
3
[ "Apache-2.0", "CC-BY-3.0" ]
permissive
--- name: Propose new content about: Use this ticket when you are submitting new content to the site. title: 'content: <Add your title>' labels: content proposal assignees: '' --- **A one to two sentence description of your post** What are you planning to teach folks in this post? **Target publish date:** `<yyyy-mm...
C
UTF-8
1,610
2.8125
3
[]
no_license
#include "rt.h" t_vec cam_vect_mult(t_vec cross_x, t_vec cross_y, t_vec dir, t_vec init_dir) { t_vec out; out.x = cross_x.x * init_dir.x + cross_y.x * init_dir.y + dir.x * init_dir.z; out.y = cross_x.y * init_dir.x + cross_y.y * init_dir.y + dir.y * init_dir.z; out.z = cross_x.z * init_dir.x + cross_y.z *...
TypeScript
UTF-8
599
2.515625
3
[]
no_license
import { IsArray, IsNotEmpty, IsNumber, ArrayNotEmpty, ValidateNested, Min, } from 'class-validator'; import { ApiProperty, getSchemaPath } from '@nestjs/swagger'; import { Type } from 'class-transformer'; export class ProductCartDto { @IsNumber() @Min(1) @ApiProperty() id: number; @IsNumber() ...
Java
UTF-8
816
3.34375
3
[]
no_license
package myapp; import lombok.extern.log4j.Log4j; @Log4j public class StringEqualExample { public static void main(String[] args) { String strVar1 = "신민철"; // 문자열 리터럴 저장 String strVar2 = "신민철"; // 문자열 리터럴 저장 //새로운 문자열 객체 생성 String strVar3 = new String("신민철"); // [ new 연산자 ] //지정된 타입의...
C++
UTF-8
3,310
3.09375
3
[]
no_license
/*Given a graph G = (V,E), a matching M in G is a set of pairwise non-adjacent edges; that is, no two edges share a common vertex. A maximum matching is a matching that contains the largest possible number of edges. There may be many maximum matchings. The matching number of a graph is the size of a maximum matchin...
Python
UTF-8
1,176
3.296875
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 26 13:20:25 2021 @author: eshasharma """# # import csv and random libraries import csv import random # for random example from datetime import datetime # Introductin to csv library and dict reader with open('BanditsData.csv', n...
PHP
UTF-8
913
3.078125
3
[ "BSD-3-Clause" ]
permissive
<?php class SiteMessageValidator extends RequiredFields { /** * Custom validation for the SiteMessage CMS form * @param Mixed $data * @return Boolean Returns TRUE/FALSE based on errors found in the validator */ function php($data) { $valid = TRUE; // If there is button text but no page to link t...
Markdown
UTF-8
9,152
2.875
3
[]
no_license
# Algorithmus Als Grundlage für die automatisch generierten Einkaufslisten wird das `last`-Array, das die letzten 10 abgeschlossenen Einkaufslisten enthält, verwendet. Die Einkaufslisten sind nach dem Abschlussdatum sortiert. Zu Beginn wird überprüft, ob die vom Benutzer eingestellte Zeitspanne seit der letzten Erstel...
Markdown
UTF-8
2,491
3.40625
3
[]
no_license
# Amazon_Vine_Analysis ## Overview of The Analysis PySpark was used to perform the ETL process and analyze Amazon review data on groceries written by members of the paid Amazon Vine program.The Amazon Vine program is a service that allows manufacturers and publishers to receive reviews for their products. Companies pa...
Python
UTF-8
289
3.34375
3
[]
no_license
#!/usr/bin/python3 """ Module contains inherits_from function """ def inherits_from(obj, a_class): """ checks if object is a direct or indirect instance of a_class """ if issubclass(type(obj), a_class) and a_class != type(obj): return True else: return False
Java
UTF-8
1,178
2.71875
3
[]
no_license
package ru.gurkin.spring.journal.actuator.health; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.stereotype.Component; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.util....
Java
UTF-8
4,110
2.359375
2
[]
no_license
package com.chhaichivon.backend.springbootangular2.controllers; import com.chhaichivon.backend.springbootangular2.models.Product; import com.chhaichivon.backend.springbootangular2.services.ProductService; import com.chhaichivon.backend.springbootangular2.utils.BaseController; import org.springframework.beans.factory.a...
Java
UTF-8
2,688
4.125
4
[]
no_license
package edu.northeastern.ccs.cs5500.homework5; import java.util.*; /** * Populates a deck of cards and handles various standard functionalities * on the deck of cards * @author adim * */ public class CardDecks { private Random getRand = new Random(); private ArrayList<Card> deckOfCards = new ArrayList<Card>();...
JavaScript
UTF-8
9,788
3.21875
3
[]
no_license
/** * varFn Date Picker * @author Fu Xiaochun */ (function() { // 根据时间戳获取时间信息。 function getDates(timeStamp) { var D = typeof timeStamp === 'undefined' ? new Date() : new Date(timeStamp); return { year: D.getFullYear(), month: D.getMonth() + 1, date: D.getDate(), day: D.getDay(), hour: D.getHou...
Java
UTF-8
155
1.507813
2
[]
no_license
package testPackage; public class test { public static void main(String[] args) { System.out.println("This is for GIT testing"); } }
C#
UTF-8
1,864
2.5625
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Mail; using System.Text; using System.Web; namespace BitCI.Models.BuildSteps { public class PostBuildEmailStep : IBuildStep { public int Id { get; set; } public int BuildId { get; set; } ...
JavaScript
UTF-8
1,070
2.75
3
[ "MIT" ]
permissive
document.addEventListener("DOMContentLoaded", function(event) { var productsCount = document.getElementById("products-count"); console.log(productsCount); var addToCartButtons = document.querySelectorAll(".add-to-cart") console.log(addToCartButtons); for( var i = 0; i < addToCartButtons.length; i++){ addToCa...
Java
UTF-8
1,918
3.15625
3
[]
no_license
/** * wxh Inc. * Copyright (c) 2006-2017 All Rights Reserved. */ package com.wxh.rmi; import java.net.MalformedURLException; import java.rmi.AlreadyBoundException; import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry; /** * 服务器 * 创建RMI注册表,启动RMI服务,并将远程对象注册...
Python
UTF-8
2,342
2.8125
3
[]
no_license
import sys import os import pprint root_dir = '/Users/mattfaus/dev/dev-git' def parse_logs(file_paths): # print 'Parsing ', file_paths # These files are generated with a command line like the following: # analytics@ip-10-0-0-108:~/kalogs/2013/04/10$ zgrep -e "UserData.*put" *.gz >> 2013.04.10-UserDataPut...
C
UTF-8
1,436
2.625
3
[]
no_license
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <signal.h> static sig_atomic_t sig_status = 0; void usr1_hand() { sig_status = 1; } int main(int argc, char **argv) { pid_t p, s; int i; ...
C
UTF-8
29,659
2.765625
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <string.h> #include <signal.h> #include "socket.h" #ifndef PORT #define PORT 50055 #endif #define LISTEN_SIZE 5 #define WELCOME_MSG ...