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
5,114
2.9375
3
[ "MIT" ]
permissive
package client; import utils.Utils; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.SocketChannel; import java.nio.file.Paths; import java.util.Iterator; class ClientFiles { ...
Java
UTF-8
401
1.578125
2
[]
no_license
package com.snow.config; import com.snow.pojo.User; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableMBeanExport; /** * @author Snow * @create 2021-03-11 16:41 */ @Configuration public class SnowCon...
Markdown
UTF-8
5,673
2.96875
3
[]
no_license
--- author: admin comments: true date: 2011-08-12 18:01:10+00:00 layout: note slug: on-planting-vegetables-by-myself title: 关于自己种菜的设想 wordpress_id: 4445 categories: - notes - 生活不是条件反射 --- 开始考虑自己种菜的问题。 如果真想自己种菜,首先要抛弃田园牧歌式的幻想,现在露天的菜地已经很少,如果想种菜,必须选择大棚。不知道有多少推友,亲自走进过大棚,那里面的温度和空气质量,至少不是城里的姑娘们可以想象的。 我在网上做了个小调查,大家最感兴趣的蔬菜是:...
Markdown
UTF-8
434
2.5625
3
[]
no_license
# Loi n° 91-715 du 26 juillet 1991 portant diverses dispositions relatives à la fonction publique (1) - [Titre Ier : Dispositions modifiant la loi n° 83-634 du 13 juillet 1983 portant droits et obligations des fonctionnaires.](titre-ier) - [Titre IV : Dispositions relatives à l'introduction d'un troisième concours d'e...
Java
UTF-8
318
1.945313
2
[]
no_license
package com.example.minu.movieapp.draggerSample; import javax.inject.Singleton; import dagger.Component; @Singleton @Component(modules = {AppModule.class,PresenterModule.class,NetworkModule.class}) public interface AppComponent { void inject(FilmActivity target); void inject(FilmPresenterImpl target); }
Java
UTF-8
925
2.015625
2
[]
no_license
package com.stang.game.service.impl; import java.util.List; import java.util.Map; import com.stang.game.dao.IRoleQuicktimeDao; import com.stang.game.dao.impl.RoleQuicktimeDaoImpl; import com.stang.game.entity.detail.RoleQuicktimeDetail; import com.stang.game.service.IRoleQuicktimeService; public class RoleQuicktime...
Python
UTF-8
99
3.03125
3
[]
no_license
h = open('123.txt') for g in h : g = g.rstrip() if g.startswith('abc') : print(g)
Shell
UTF-8
133
3.078125
3
[]
no_license
#!/bin/bash -x for i in mon tue wed thurs fri sat do echo weekday: "$i" if [ $i == thurs] then echo weekday: "$i+1" fi done
Java
ISO-8859-1
4,430
2.578125
3
[]
no_license
package Vista; import java.awt.EventQueue; import javax.swing.JFrame; import java.awt.GridBagLayout; import javax.swing.JTextField; import javax.swing.table.DefaultTableModel; import Modelo.DAOFuncionalidad; import Modelo.Funcionalidad; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JScro...
Java
UTF-8
12,669
1.726563
2
[]
no_license
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) package com.android.internal.textservice; import android.os.*; import android.view.textservice.SpellCheckerInfo; import android.view.textservice.SpellCheckerSub...
Java
UTF-8
4,559
2.53125
3
[]
no_license
package data; import org.newdawn.slick.opengl.Texture; import static controllers.Graphic.*; /** * Enum inaczej typ wyliczeniowy TowerType zawiera typy wież obronych i m.in. ich zasięg, szybkość wystrzału, koszt. * Wieża może się składać z wielu tekstur, dlatego została użyta tablica tekstur. */ public enum TowerTy...
Python
UTF-8
456
3.3125
3
[]
no_license
N = int(input()) srimes = input().split(" ") result = 0 before_srime = 0 # 右隣にあるものが同じかどうかを判定 for i, srime in enumerate(srimes): # if i > 1: # print("i : {}, srime : {}, before_srime : {}".format(i, srime, before_srime)) if before_srime == srime: # print("HIT!!!!!!!!!") result += 1 ...
Markdown
UTF-8
548
2.59375
3
[]
no_license
# Git 학습하기 ## 열심히하기 ### 계속하기 #### 또하기 ``` git config --global user.name "사용자이름" git config --global user. email "이메일주소" ``` ```html <h1>제목</h1> ``` ```css font-size: 12px; ``` [google](http:www.google.com) | 구분 | 영어 | 수학 | 역사 | 과학 | |----------|------|------|------|------| | 홍길동 | 70 | 50 | 100 | ...
C++
UTF-8
1,444
3.078125
3
[]
no_license
class Solution { private: unordered_map<int, vector<int>> map; public: int search_solution(int index, vector<int> arr, int l, int r) { if (l == r) { return abs(arr[l] - index); } if (l == r - 1) { return abs(arr[l] - index) < abs(arr[r] - index) ? abs(arr[l] - in...
Python
UTF-8
722
4.0625
4
[]
no_license
# problem: I have 100,000 QAR on a saving account. Every year my bank gives me 2.5% interest on my savings. In addition, the bank offers me a bonus of 5,000 QAR every 5 years. How much will I have in 10 years? 20 years? ##### Functions ##### def calculateCompoundInterest(amount,interest,years, bonus): for i in ra...
C++
UTF-8
1,604
2.6875
3
[]
no_license
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; #define ll long long #define bi __int128 std::ostream& operator<<( std::ostream& dest, __int128 value ) { std::ostream::sentry s( dest ); if ( s ) { __int128 tmp = value < 0 ? -value :...
Java
GB18030
30,155
2.0625
2
[]
no_license
package com.controller; import java.io.File; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import javax.servlet.http.HttpServletRequest; ...
C#
UTF-8
700
2.53125
3
[]
no_license
using OpenQA.Selenium; using OpenQA.Selenium.Support.PageObjects; using System; using System.Collections.Generic; using System.Text; namespace WordPressSpecflow.Pages { public class DashboardPObject { public static IWebDriver driver; public DashboardPObject(IWebDriver driver) { ...
C++
UTF-8
251
2.625
3
[ "MIT" ]
permissive
#include<bits/stdc++.h> using namespace std; int main(){ int size; cin>>size; int arr[size]; for(int i=0;i<size;i++){ cin>>arr[i]; } int sum=0; for(int i=0;i<size;i++){ sum+=arr[i]; } cout<<"Total sum "<<sum<<endl; }
Markdown
UTF-8
1,814
2.75
3
[]
no_license
# Podcast Transcribing This repository contains a tool used to: - Download podcast episodes from Soundcloud or an RSS feed - Convert all episodes to .mp4 - upload all episodes to Youtube - Wait for Youtube to transcribe it for us, adding auto captions - Download the auto-generated captions # Requirements ## ...
Python
UTF-8
446
2.703125
3
[]
no_license
import gym import scipy import numpy as np env = gym.make("Acrobot-v1") for episode in range(10): observation = env.reset() totalreward = 0 for _ in range(200): env.render() action = env.action_space.sample() observation, reward, done, info = env.step(action) totalreward ...
Python
UTF-8
192
3.328125
3
[]
no_license
n = int(input()) if n == 0 or n == 1: print(1) else: fibo = [[]] * n fibo[0], fibo[1] = 1, 1 for i in range(2, n): fibo[i] = fibo[i-1] + fibo[i-2] print(fibo[n-1])
C++
UTF-8
1,390
3.609375
4
[ "MIT" ]
permissive
/* 给定两个字符串 s1 和 s2,写一个函数来判断 s2 是否包含 s1 的排列。 换句话说,第一个字符串的排列之一是第二个字符串的子串。 示例1: 输入: s1 = "ab" s2 = "eidbaooo" 输出: True 解释: s2 包含 s1 的排列之一 ("ba"). */ #include<iostream> #include <cstring> #include <queue> #include <unordered_map> using namespace std ; // 判断 s 中是否存在 t 的排列 bool checkInclusion(string t, string s) { u...
Markdown
UTF-8
2,178
2.546875
3
[]
no_license
# Indices-Net Paper: Direct Multitype Cardiac Indices Estimation via Joint Representation and Regression Learning. https://arxiv.org/abs/1705.09307 Own implementation of the Indices-Net model proposed in [Xue et al, 2017]. This code was written as a baseline to compare with my own model presented in STACOM 2018 [Debu...
PHP
UTF-8
840
2.53125
3
[]
no_license
<?php include '../common/sqlconnect.php'; $conn = connectDB(); if($_POST["parent"]) { $sql = $conn->prepare( 'SELECT id, name, "categories" FROM Categories WHERE parent = ? UNION SELECT id, name, "topic" FROM Topics WHERE category = ?' ); $sql->bind_param('ss', $_POST["parent"], $_POST["parent"]); }...
C++
UTF-8
316
2.640625
3
[]
no_license
#ifndef SERIALCOMMUNICATOR_HPP #define SERIALCOMMUNICATOR_HPP class SerialCommunicator { public: SerialCommunicator(); void open(); bool receive(); void send(char data); char getData(); private: int fd; char data; }; #endif // SERIALCOMMUNICATOR_HPP
Markdown
UTF-8
5,276
2.734375
3
[]
no_license
--- title: Making YAML safe again date: 2013-01-24 published: true --- TL;DR: Check out my new gem, [SafeYAML](http://dtao.github.com/safe_yaml). It lets you parse YAML without exposing your app to security exploits via arbitrary object deserialization. *** There was [quite a stir in the Rails community recently](ht...
TypeScript
UTF-8
3,169
3.109375
3
[ "BSD-3-Clause" ]
permissive
import moment, { Moment } from 'moment'; import { Scalars } from 'generated/sdk'; function paddZero(num: number): string { if (num < 10) { // Adding leading zero to minutes return `0${num}`; } return num.toString(); } function getFormattedDate( date: Date, prefomattedDate?: string, hideYear = fa...
Python
UTF-8
1,527
3.5
4
[]
no_license
##################################################### # Chest Clinic Bayes net representatin library # ##################################################### #Ordem seguida pelo prior: Visitou Asia(Sim,Nao); Fuma(Sim,Nao); Tuberculose(Sim,Nao); Cancer Pulmao(Sim,Nao); Bronquite(Sim,Nao); Tuberculose ou Cancer(VER...
Python
UTF-8
134
3.171875
3
[]
no_license
# 关键字参数 def SaySome(name, words): print(name + '->' + words) SaySome(words='让编程改成世界', name='小甲鱼')
JavaScript
UTF-8
3,196
2.59375
3
[]
no_license
const express = require('express') const {Product} = require('../database/models') const ProductRouter = express.Router() ProductRouter.get('/', async (request, response) => { try { console.log('request') const allProducts = await Product.findAll() response.send(allProducts) } catch (e) {...
Swift
UTF-8
2,135
2.890625
3
[ "MIT" ]
permissive
// // Flip.swift // Jirassic // // Created by Baluta Cristian on 24/05/15. // Copyright (c) 2015 Cristian Baluta. All rights reserved. // import Cocoa class FlipAnimation: NSObject { var animationReachedMiddle: (() -> ())? var animationFinished: (() -> ())? var layer: CALayer? func startWithLayer (layer: C...
C++
UTF-8
633
3.28125
3
[]
no_license
#pragma once #include <iostream> #include <cstring> using namespace std; class MyString { private: char *str; // a pointer to a char public: MyString(); // default constructor MyString(const char *s); // constructor MyString(const MyString& other); // copy constructor ~MyString(); // destructor...
PHP
UTF-8
1,649
2.71875
3
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
<?php namespace App\Models; use App\View\Forms\RoleForm; use Grafite\Forms\Traits\HasForm; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Role extends Model { use HasFactory; use HasForm; public $form = RoleForm::class; public $timestamps = fals...
C#
UTF-8
3,943
2.5625
3
[]
no_license
using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using BikeRentalAgencyApi.Repository.Repositories; using BikeRentalAgencyApi.Models; using BikeRentalAgencyApi.Repository.Interfaces; namespace BikeRentalAgencyApi.Controllers { [Route(...
Java
UTF-8
2,155
2.09375
2
[]
no_license
package carworld.autolist; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.v7.app.AlertDialog; import android.support.v7.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import android.w...
Markdown
UTF-8
7,982
2.515625
3
[ "LicenseRef-scancode-public-domain" ]
permissive
> *The following text is extracted and transformed from the pitchrate.com privacy policy that was archived on 2018-08-28. Please check the [original snapshot on the Wayback Machine](https://web.archive.org/web/20180828055224id_/http%3A//pitchrate.com/content/privacy_policy.html) for the most accurate reproduction.* # ...
Java
WINDOWS-1250
1,970
2.546875
3
[]
no_license
/** * */ package br.com.simpleapp.rest; import java.io.Serializable; import java.util.List; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import br.com.simpleapp.domain.Person; import br.c...
PHP
UTF-8
1,109
2.515625
3
[ "Apache-2.0" ]
permissive
<?php /** * Created by IntelliJ IDEA. * User: Chenrongguang * Date: 2016-9-29 * Time: 14:26 * 基类 */ namespace app\home\controller; use Think\Controller; class Base extends \think\Controller { public function _initialize() { $this->login_check(); } //登录判断 public function login_check...
Markdown
UTF-8
355
3.078125
3
[]
no_license
# Estimating-an-individual-s-income-based-on-USA-s-census-data Using classification techniques such as logistic regression and random forest, a model was built to predict if an individual’s income falls above 50k or below. It was observed that people who were married and held a degree had a higher probability of earnin...
Swift
UTF-8
3,017
3.515625
4
[]
no_license
// // ViewController.swift // imageExample // // Created by 송지훈 on 2020/06/01. // Copyright © 2020 송지훈. All rights reserved. // import UIKit import Kingfisher // alamofire을 이용해 이미지 다운로드 가능하지만, // 들어가는 이미지 수가 많아 지게 되면, 매번 실행할때마다 버벅일 수 있음 // --> 그래서 캐시를 활용해 최초 다운로드 할때만 사용한다. // kingfihser 는 따로 이미지를 따올때 캐시를 활용해서 저...
Java
UTF-8
4,394
2.171875
2
[ "Apache-2.0" ]
permissive
package com.thecoderscorner.menu.editorui.generator.parameters; import com.thecoderscorner.menu.editorui.generator.applicability.AlwaysApplicable; import com.thecoderscorner.menu.editorui.generator.core.HeaderDefinition; import com.thecoderscorner.menu.editorui.generator.parameters.eeprom.*; import org.junit.jupiter.a...
PHP
UTF-8
828
2.890625
3
[]
no_license
<?php include "../part1/DBConnection.php"; $return_arr = array(); $query = "SELECT emp_id, emp_firstName, emp_lastName, emp_hireDate, emp_birthDate FROM employees ORDER BY emp_id"; $result = mysqli_query($conn,$query); while($row = mysqli_fetch_array($result)){ $emp_id = $row['emp_id']; $emp_firstName = $...
Java
UTF-8
487
2.03125
2
[]
no_license
package com.example.jpa.notice.repository; import com.example.jpa.notice.entity.NoticeLike; import com.example.jpa.user.entity.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository // 상속을 받을때 모델 타입과 모델의 PK 를 상속 받는다. ...
JavaScript
UTF-8
3,155
2.546875
3
[]
no_license
/* FormControl Interface fetch - Fetch control dependency render - Render control assign - Assign model to control apply - Sync control with model get - Get control value set - Set control value unset - Unset control value disable - Disable control enable - Enable control sync - Sync model with control build - B...
PHP
UTF-8
1,251
2.859375
3
[]
no_license
<?php class LayoutView { private static $login = 'LayoutView::Logout'; public function render($isLoggedIn, LoginView $v, DateTimeView $dtv, $msg, RegisterView $rv, $name) { if(!empty($_SESSION['reg'])) { $exit = '<form method="post" > <input type="submit" name="' . self::$login . '" value="back to login"...
JavaScript
UTF-8
11,792
3.421875
3
[ "MIT" ]
permissive
/** * Plugin registry of available functions that can be used in scalable layout directives. * * These "scale functions" are used during rendering to return output (eg color) based on input value * * @module LocusZoom_ScaleFunctions * @see {@link module:LocusZoom_DataLayers~ScalableParameter} for details on how s...
C#
UTF-8
3,058
2.734375
3
[ "MIT", "LicenseRef-scancode-generic-cla" ]
permissive
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT License. // See the LICENSE file in the project root for more information. // // Revision history: // // BD - January 2018 // using System; // NB: Used for XML doc comments. using System.Co...
PHP
UTF-8
4,142
2.578125
3
[ "MIT" ]
permissive
<?php namespace App\Http\Controllers; use App\semester; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class Semestercontroller extends Controller { public function __construct() { $this->middleware('auth'); } public static function asArray() { if (in_array(A...
Python
UTF-8
2,888
2.546875
3
[]
no_license
# MLP for Pima Indians Dataset with grid search via sklearn from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasClassifier from sklearn.model_selection import GridSearchCV import numpy import time # Fix for bug in keras 0.12.1 # http://stackoverflow.com/quest...
C++
UTF-8
1,645
3.25
3
[ "MIT" ]
permissive
#pragma once #include <cstdint> #include <vector> class FPSCounter { private: uint16_t _frameCount{ 0u }; uint16_t _numTrackedFrames{32u}; std::vector<float> _frameTimes; float _avgFrameTime{ 0.f }; float _denom{1.f / 32.f}; public: FPSCounter(uint16_t nFramesToTrack = 32u) { setNumTrackedFrames(nFramesToTr...
Java
UTF-8
2,539
3.25
3
[]
no_license
import org.omg.CORBA.Object; /* This is undebugged code!!! non-circled array deque */ public class ArrayDeque<Stuff> { private Stuff[] items; private int size; private int arrayLen; /* create empty deque*/ public ArrayDeque(){ items = (Stuff[]) new Object[8]; size = 0; a...
Java
UTF-8
830
4
4
[]
no_license
package com.javaex.reftype; public class StringFormatEx { public static void main(String[] args) { // %s, %d, %n String fruit = "Apple"; int total = 10; int eat = 3; System.out.println(total + "개의 " + fruit + "중에 " + eat + "개를 먹었다"); // -> format System.out.printf("%d개의 %s중에 %s개를 ...
Python
UTF-8
1,351
3.359375
3
[]
no_license
class kqueue: def __init__(self,k,n): self.k = k self.n = n self.free = 0 self.next = [i+1 for i in range(self.n)] self.next[n-1] = -1 self.front = [-1]*self.k self.rear = [-1] * self.k self.arr = [0]*self.n self.top = 0 def isFull(self): if self.free == -1: return True else: ...
Java
UTF-8
3,910
2.515625
3
[]
no_license
package cpw.mods.fml.common.versioning; import cpw.mods.fml.common.versioning.ComparableVersion$1; import cpw.mods.fml.common.versioning.ComparableVersion$IntegerItem; import cpw.mods.fml.common.versioning.ComparableVersion$Item; import cpw.mods.fml.common.versioning.ComparableVersion$ListItem; import cpw.mods.fml.com...
JavaScript
UTF-8
661
3.9375
4
[]
no_license
//思路:从前向后,若出现重复则跳过 let line; while (line = readline()) { let res = staggered01(line); print(res); } function staggered01(str) { if (!str) { return 0; } let curLen = 0; let maxLen = 0; let start = 0; let len = str.length; while (start < len - 1) { ...
PHP
UTF-8
1,212
2.796875
3
[]
no_license
<?php #INICIA SESSÃO session_start(); #USUÁRIOS DO SISTEMA $usuarios_app = [ ['email' => 'adm@teste.com.br', 'senha' => '123456'], ['email' => 'user@teste.com.br', 'senha' => 'abcd'], ]; #PRINT DOS USUÁRIOS /* echo '<pre>'; print_r($usuarios_app); ech...
Markdown
UTF-8
1,169
2.578125
3
[]
no_license
# NLW-4_Node.js ## O NLW é um evento online com muito código, desafios, networking e um único objetivo: te levar para o próximo nível. ## ![alt text](https://nextlevelweek.com/_next/image?url=%2Fimages%2Fcoding.png&w=640&q=75) ### Fiz a trilha de NodeJS onde foi desenvolvido uma API completa para realizar pesq...
JavaScript
UTF-8
862
3.046875
3
[ "MIT" ]
permissive
// Node's crypto library is used here to create an MD5 hash of the users email address const crypto = require('crypto'); // The Gravatar image service const gravatarUrl = 'https://s.gravatar.com/avatar'; // The size query. The chat needs 60px images const query = 's=60'; /** * @description Add a link to the Gravata...
C#
UTF-8
1,763
3.96875
4
[]
no_license
using System; namespace Dog_Challenge { public enum Gender {Male,Female}; class Dog { private string name; private string owner; private int age; private Gender gender; public Dog(string name, string owner, int age, Gender gender) { ...
C#
UTF-8
7,605
2.609375
3
[]
no_license
using ApiProyecto.Data; using ApiProyecto.Helpers; using ApiProyecto.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace ApiProyecto.Repositories { public class PartidosRepository { PartidosContext context; public PartidosRepo...
Ruby
UTF-8
474
2.859375
3
[]
no_license
require 'spec_helper' describe RomanNumerals do subject(:roman) {RomanNumerals.new} it 'converts 1 to I' do expect(roman.convert(1)).to eq "I" end it 'converts 5 to V' do expect(roman.convert(5)).to eq "V" end it 'converts 10 to X' do expect(roman.convert(10)).to eq "X" end it 'converts 35...
Java
UTF-8
1,140
3.234375
3
[]
no_license
package com.embeddedmicro.branch; public class Rectangle { Vector2D min, max; Rectangle(){ min = new Vector2D(); max = new Vector2D(); } Rectangle(Vector2D a, Vector2D b) { bounds(a.x, a.y, b.x, b.y); } Rectangle(float x1, float y1, float x2, float y2) { bounds(x1, y1, x2, y2); } private void boun...
PHP
UTF-8
3,734
3.09375
3
[]
no_license
<?php /** * Iubenda Consent Class. * * @category Iubenda * @package ConsentSolution * @subpackage Subject * @author Brando Meniconi <b.meniconi@silverbackstudio.it> * @license BSD-3-Clause https://opensource.org/licenses/BSD-3-Clause * @link https://github.com/silverbackstudio/php-iubenda-con...
Python
UTF-8
625
3.4375
3
[]
no_license
import csv def read_csv(file): '''reads telem data from csv into list of lists''' data = [] with open(file) as f: datareader = csv.reader(f, delimiter=",") for row in datareader: data.append(row) return data def delete_row(L): for row in L: del row[3] retu...
PHP
UTF-8
1,232
2.578125
3
[]
no_license
<?php session_start(); if ($_SERVER['REQUEST_METHOD'] == 'GET' && isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $data = array(); if (isset($_SESSION["loggedIn"]) && $_SESSION["loggedIn"] == true) { require_once "dbConnect.php"; ...
JavaScript
UTF-8
1,925
3
3
[]
no_license
/*global describe, it*/ var expect = require('expect.js'); var AttributeRequirement = require('../../src/Requirements/AttributeRequirement'), Character = require('../../src/Character'), Attribute = require('../../src/Attribute'), Edge = require('../../src/Edge'); describe('Given I have an attribute requir...
Shell
UTF-8
1,189
4.15625
4
[]
no_license
#!/bin/bash # make the script callable from anywhere by resolving symlinks to discover real directory SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && ...
Python
UTF-8
1,338
2.921875
3
[ "MIT" ]
permissive
import numpy as np def pad_axis0(array, value): return np.pad(array, pad_width=(0,1), mode='constant', constant_values=value) def shift(array): return pad_axis0(array, 0)[1:] def calculate_lambda_returns(rewards, qvalues, dones, mask, discount, lambd): dones = dones.astype(np.float32) qvalues[...
Markdown
UTF-8
6,068
3.25
3
[]
no_license
DCDB for Percona, MariaDB supports sub-tables, which means horizontally dividing a big table into multiple databases by using shardkeys. This document will explain how to create sub-tables: ## How to Select shardkey A shardkey cannot be easily changed once it is determined, so it is necessary for developers to evalu...
Python
UTF-8
12,372
2.71875
3
[]
no_license
import tkinter as tk from tkinter import ttk from tkinter import filedialog import generation as gen import graph import os import sys class Select(tk.Frame): sequenceType = ("Упорядоченная", "Из едениц", "Случайная", "Частичная", "Обратная") def __init__(self, master, index, **kw): super().__init__(...
Java
UTF-8
237
1.664063
2
[]
no_license
package com.fabrick.interceptors; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * * @author fabio.sgroi */ @Retention(RetentionPolicy.RUNTIME) public @interface RestrictAccess { }
Java
UTF-8
386
1.664063
2
[]
no_license
package com.bonc.mobile.saleclient.activity; import android.os.Bundle; import com.bonc.mobile.hbmclient.R; import com.bonc.mobile.hbmclient.activity.BITabActivity; public class SaleMainActivity extends BITabActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceStat...
C++
UTF-8
970
2.734375
3
[]
no_license
#pragma once #include "Product.h" #include <iostream> #include <iomanip> #include <string> #include <fstream> using namespace std; class EBook : public Product { private: string storageMemory; string RAM; string formatSupport; string operatingSystem; string displaySize; string displayType; ...
Java
UTF-8
681
2.953125
3
[]
no_license
package cn.lut.server.day3; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class ExecuteDemo { ExecutorService pool =Executors.newFixedThreadPool(2); class Task implements Runnable { @Override public void run() { Thread t = Thread.currentThread(); Sys...
PHP
UTF-8
1,110
2.703125
3
[]
no_license
<?php class gradeModel extends Model { public function grade_cache() { if (false !== F('grade_list')) { return F('grade_list'); } else{ $grades = $this->field("grade,min,max")->order("min asc,id asc")->select(); $grade_list = array(); foreach ...
Java
UTF-8
437
3.171875
3
[ "MIT" ]
permissive
public class PE8Obj{ private String word; private int score; //default constructor for initializing objects PE8Obj() { this.word = ""; this.score = 0; } public void setWord(String myWord) { this.word = myWord; } public void setScore(int myScore) { this.score = myScore; } pu...
Python
UTF-8
888
2.546875
3
[]
no_license
import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders def new_emailer(): msg = MIMEMultipart() msg['Subject'] = "Keylogs" msg['From'] = "botmailbot01@gmail.com" msg['To'] = "send_to@email.com"...
JavaScript
UTF-8
1,132
3.015625
3
[ "MIT" ]
permissive
import Extension from '../extension' export default class ExtensionManager { constructor() { /** * Available extensions * @type {Array} * @private */ this._extensions = [] } /** * Return all extensions * @returns {Extension[]} */ getExtensions() { return this._exte...
Java
UTF-8
19,004
1.726563
2
[ "Apache-2.0" ]
permissive
package com.coolweather.android; import android.annotation.SuppressLint; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.prefe...
Markdown
UTF-8
5,225
2.59375
3
[]
no_license
## 아키텍쳐 ### XML-Based Web Service 웹 서비스는 고유명사. 여러 기관들이 하나의 스탠다드하게 웹서비스라는 고유 명사를 만들었음. 서버쪽에 있는 서비스가 외부에서 접속해서 사용할 수 있도록 그것을 스탠다드화 시킨 프로토콜. 웹서비스는 프로토콜자체가 스탠다드. HTTP위에 올라간다. 인코딩 방식은 XML프로토콜을 SOAP을 이용한다. HTTP위에서 도큐멘드 오리엔티드하게 작업. 메세지 기반으로 서비스. RPC메세지도 가능하다. 이말은 XML도큐먼트로 RPC인보케이션을 부를수도 도큐멘트를 부를수도 있음. 모든 외부에서 접근 할 때 접근성과 ...
C++
UTF-8
6,530
2.75
3
[]
no_license
#ifndef SBFGRAB_H #define SBFGRAB_H #include <string> #include "ips.h" #ifdef sbfem_EXPORTS #define IPS_API __declspec(dllexport) #else #define IPS_API __declspec(dllimport) #endif namespace SBF { /** * Wrapper Class for the SBF::CGrab class * * This class internally uses the TS&I IPS API. * * The SBF::CGrab c...
PHP
UTF-8
1,237
2.84375
3
[]
no_license
<html> <head> <title>Tripcode Tester</title> <link rel="stylesheet" href="style.css"> <h1 class="header">Tripcode Tester</h1> <br> </head> <body> <p style="font-family: verdana;">Output:</p> <?php // Generates a random number for the post number between 11,000 and 99,000 $postnumber = rand(1,600000000); $min = rand(10,...
C#
UTF-8
238
3.078125
3
[]
no_license
using System; public struct Point{ public double X; public double Y; public Point(double x, double y){ X=x; Y=y; } public double getModule(){ return Math.Sqrt(X*X+Y*Y); } }
Markdown
UTF-8
5,000
2.96875
3
[]
no_license
# Cluster - A collection of nodes controlled by kubernetes - A cluster has a master node that is the effective brain and command center of the cluster # Node - A VM (Physical computer if on premise) that is in a cluster - A node runs an agent/software called **kubelet** which connects it the master node # Controller ...
Java
UTF-8
1,974
2.453125
2
[ "MIT" ]
permissive
package fr.eletutour.eweather.controller; import fr.eletutour.eweather.dto.Forecast; import fr.eletutour.eweather.services.IWeatherService; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; import org.spr...
Python
UTF-8
854
2.625
3
[]
no_license
import numpy as np # Read the data and remove the first Row train_data = np.genfromtxt('train_features.csv', delimiter = ',') train_data = train_data[1:] # Make an array of data arrays X = [[x00,x01,...,x09],...] X_all = np.array([row[2:] for row in train_data]) X_subgroups = np.array_split(X_all, len(X_all)/12) X_a...
Rust
UTF-8
794
2.8125
3
[]
no_license
use core::spectrum::Spectrum; use core::sampler::CameraSample; use core::types::Float; pub trait Film { fn add_sample(&mut self, sample: &CameraSample, l: &Spectrum); fn splat(&mut self, sample: &CameraSample, l: &Spectrum); fn get_sample_extent(&self) -> Extent; fn get_pixel_extent(&self) -> Extent;...
Markdown
UTF-8
6,364
3.484375
3
[]
no_license
# webpack原理学习札记 ### 原型分析 首先我们通过一个制作一个大包文件的原型。 假设有两个js模块,这里我们先假设这两个模块是复合commom.js标准的es5模块。 我们的目的是将这两个模块打包为一个能在浏览器运行的文件,这个文件其实叫bundle.js 例如: ```javascript // add.js exports.default = function(a, b) { return a + b } ``` ```javascript // index.js var add = require('./add.js').default console.log(add(1, 2)) ``` 这两段代...
Python
UTF-8
959
3.34375
3
[]
no_license
import images class BoxModel: """ This class defines a model of the box, it contains information on the type of box, whether it can be moved, destroyed and the sprite. """ def __init__(self, sprite, movable, destructable): self.sprite = sprite self.movable = movable self.destruc...
JavaScript
UTF-8
136
3.734375
4
[ "MIT" ]
permissive
let array = [3,2,1,10,20] array.sort() let maior = array[Number(array.length) - 1] console.log(`O maior valor informado foi ${maior}.`)
C++
UTF-8
465
2.796875
3
[]
no_license
/* What Template issues Why Lets look at how templates can fail How See below */ #include <QCoreApplication> #include <QDebug> template<class T, class F> T add(T valueT,F valueF) { return valueT + valueF; } int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qInf...
Markdown
UTF-8
787
3.25
3
[]
no_license
# todo-list A web-app built using Flask which helps you in tracking the tasks you want to complete. You can add a task in the list and can mark it as complete when you are done with it. The Application stores the data in a database built using SQLAlchemy. **Sample Image** ![Preview Image](https://github.com/apurva19/...
Swift
UTF-8
580
2.640625
3
[]
no_license
// // APIManager.swift // movieSearch // // Created by Satya on 30/07/16. // Copyright © 2016 My Company. All rights reserved. // import Foundation import UIKit typealias NetworkingOnFailure = (error: NSError?) -> Void typealias NetworkingOnSuccess = (result: AnyObject?) -> Void class APIManager: NSObject { ...
Python
UTF-8
441
3.796875
4
[]
no_license
class Campsite(): def __init__(self, campsite_id, name): self.id = campsite_id self.name = name self.reservations = [] def add_reservation(self, reservation): self.reservations.append(reservation) def print(self): print(f"Campsite ID: {self.id} Name: {sel...
C++
UTF-8
629
3.328125
3
[]
no_license
#include <iostream> using namespace std; int main(void) { int n = 0; cout << "입력할 사람 수를 정하세요: "; cin >> n; cin.ignore(); string *name = new string[n]; for(int i = 0; i < n; ++i){ cout << "이름: "; getline(cin, name[i], '\n'); } for(int i = n-1...
Python
UTF-8
385
3.390625
3
[]
no_license
## 高度检查器 # 对数组排序,统计排序前后数组不同位的个数 class Solution(object): def heightChecker(self, heights): """ :type heights: List[int] :rtype: int """ ans = 0 tmp = sorted(heights) for i in range(len(tmp)): if tmp[i] != heights[i]: ans += 1 ...
PHP
UTF-8
879
2.515625
3
[]
no_license
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use Illuminate\Foundation\Inspiring; use Illuminate\Support\Facades\DB; class SeedRoles extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'seed-roles'; ...
Markdown
UTF-8
9,076
2.59375
3
[]
no_license
# Snapshot report for `src/erc20.test.ts` The actual snapshot is saved in `erc20.test.ts.snap`. Generated by [AVA](https://avajs.dev). ## basic erc20 > Snapshot 1 `// SPDX-License-Identifier: MIT␊ pragma solidity ^0.8.0;␊ ␊ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";␊ ␊ contract...
PHP
UTF-8
470
2.578125
3
[]
no_license
<?PHP include "../entities/categorie.php"; include "../core/categorieC.php"; if ( isset($_POST['refe']) and isset($_POST['description']) and isset($_POST['affichage'])){ $categorie1=new categorie($_POST['refe'],$_POST['description'],$_POST['affichage']); //Partie2 /* var_dump($employe1); } */ //Partie3 $categorie1C=...