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,759
2.84375
3
[]
no_license
#include <iostream> #include <vector> #include <utility> #include <queue> #include <ctype.h> #include<string.h> #include <fstream> using namespace std; struct functie { char nodinitial; char nodfinal; char muchie; } v[30]; int main() { int n, m, i, j, dim, tip, numar, k=0;//TAB!!! ...
C
UTF-8
461
2.609375
3
[]
no_license
#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> struct sockaddr_in ip,ip2; int main() { char str[INET_ADDRSTRLEN]; inet_pton(AF_INET,"127.0.0.1",&ip.sin_addr); inet_ntop(AF_INET,&ip.sin_addr,str,INET_ADDRSTRLEN); printf("%s\n",str); ip2.sin_addr.s_addr = inet_ad...
TypeScript
UTF-8
6,090
2.515625
3
[]
no_license
import { ImageDataAccess } from "../dataAccess/imageAccess"; import { FeedDataAccess } from "../dataAccess/feedAccess"; import { FeedItem } from "../models/FeedItem"; import { CreateFeedItemRequest } from "../requests/CreateFeedItemRequest"; import { UpdateFeedItemRequest } from "../requests/UpdateFeedItemtRequest"; im...
PHP
UTF-8
79
2.65625
3
[]
no_license
<?php require 'point.php'; $point = new Point(); $point = 3; echo $point; // 3
C#
UTF-8
1,294
2.65625
3
[]
no_license
using System; using System.Threading; using System.Threading.Tasks; using Amazon.DynamoDBv2; using Amazon.DynamoDBv2.DataModel; using CloudMemos.Logic.Models; namespace CloudMemos.Logic.DataAccess { public class MemoRepository : IMemoRepository { private readonly IAmazonDynamoDB _dynamoDbClient; ...
Java
ISO-8859-1
638
3.59375
4
[]
no_license
package br.edu.univas; import java.util.Scanner; public class Questao04 { public static void main(String[] args) { Scanner leia = new Scanner(System.in); System.out.println("Digite o 1 valor: "); int valor1 = leia.nextInt(); System.out.println("Digite o 2 valor: "); int valor2 = le...
C#
UTF-8
488
3
3
[]
no_license
using System; namespace AbstractClass { class Program { /* abstract modifer -> indicate that class or member is missing implementation, Sealse modifer -> prrevent derivation of class and override of methhod. // on derived class like the circle */ sta...
Markdown
UTF-8
857
2.625
3
[]
no_license
## 1. 全局安装 docsify-cli 工具 ``` npm i docsify-cli -g ``` ## 2. 初始化项目 ``` docsify init ./docs ``` ## 3. 本地预览 ``` docsify serve docs ``` ## 4. 手动初始化 - 如果不喜欢 npm 或者觉得安装工具太麻烦,我们可以直接手动创建一个 index.html 文件。 ```html <!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name...
Markdown
UTF-8
541
2.890625
3
[]
no_license
#### 1 组件创建 组件两种创建方式 1.函数创建 无状态 props通过参数形式接收 内部this undefined 没有生命周期 ```js function Xuxiaobing(){ return <div>徐晓冰</div> } ``` 2.类创建 有状态 属性通过 this.props 访问 内部this 指向当前组件 有生命周期 ```js class Xuxiaobing extends Component{ render(){ return <div>徐晓冰</div> } } ``` #### 2.组...
Shell
UTF-8
2,106
3.609375
4
[]
no_license
#!/bin/bash # Jacob Eaton - Dec 13th 2020 # Based on a script by James Chambers: https://github.com/TheRemote/RaspberryPiMinecraft # Terraria Server Stop Script # Check if server is running if ! screen -list | grep -q "terraria"; then echo "Server is not currently running!" exit 1 fi # Stop the server echo "Prepa...
Python
UTF-8
2,617
2.625
3
[ "MIT" ]
permissive
# !/usr/bin/env python # -*- coding: utf-8 -*- """Define non-SI-units. This module provides for now 2 dictionnaries of units : - custom_units : for user-defined units - imperial_units : retard units TODO : - create a function wrapper for dict creation ? - Should custom units and constants be in the same module...
Java
UTF-8
1,485
2.625
3
[]
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 rs.ac.bg.fon.silab.gui.example1.components.table.model; import java.util.List; import javax.swing.table.AbstractTableM...
JavaScript
UTF-8
3,328
3.15625
3
[]
no_license
'use strict'; import {mapWith, compose} from '../../js-allonge/unsorted/unsorted' export default (() => { const filterPunctuation = str => str.replace(/[^0-9a-z]/gi, '') const reverse = function reverse(str) { return str .split('') .reverse() .join('') } const factorialize = function f...
C++
UTF-8
2,322
2.765625
3
[]
no_license
#include <iostream> #include <GL\freeglut.h> #include <glm\gtc\type_ptr.hpp> #include "Mesh.h" void Mesh::draw(glm::mat4& localToWorldMatrix) { if (vertices.size() == 0) { std::cout << "Mesh has no vertices!" << std::endl; return; } bool useColours = colours.size() > 0 ? true : false; bool useUVs = texture...
Shell
UTF-8
1,895
2.890625
3
[]
no_license
#!/bin/bash LOG=/home/oracle/ilegra/scripts/dgdc2/logs/rebuild_dg_`date +%Y%m%d%H%M`.log echo "Starting Rebuild Standby Database for Dataguard at "`date +'%d/%m/%Y %H:%M'` >> $LOG echo "Shutdown Standby Varejo" >> $LOG . /home/oracle/varejo.env sqlplus -S / as sysdba <<EOF >> $LOG shutdown immediate; exit EOF echo ...
C++
UTF-8
751
3.203125
3
[]
no_license
#include <iostream> #include <vector> #include <cmath> int lengthOfCycle(int denom) { int rem = 1; std::vector<bool> rems(denom, false); rems[0] = true; int length = 0; while (true) { rem %= denom; if (rems[rem]) break; rems[rem] = true; rem *= 10; ...
Python
UTF-8
2,144
2.546875
3
[]
no_license
import praw import datetime from praw.models import MoreComments import csv reddit = praw.Reddit(client_id = '1epYXaQUEU0ayA', client_secret = 'T7-VTUva1G-E_kGa8yHKZBOKJNvlpg', username = 'Saurabh_Joshi_24', password = 'your_password', use...
TypeScript
UTF-8
1,933
2.609375
3
[]
no_license
import request from 'supertest'; import { app } from '../../app'; it('fails when an email that does not exist is supplied', async () => { await request(app) .post('/api/users/updatepassword') .set('Cookie', global.signin()) .send({ email: 'test@test.com', oldPassword: 'password', newPas...
Java
UTF-8
2,819
2.640625
3
[]
no_license
package com.gupao.edu.vip.netty; import io.netty.bootstrap.Bootstrap; import io.netty.channel.*; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; import io.netty.handler.codec.LengthFieldPrepender; import io....
SQL
UTF-8
2,298
4.125
4
[]
no_license
Create Database If Not Exists story_reading_website; use story_reading_website; Drop Table `account`; Create Table If Not Exists `account`( email nvarchar(50) primary key, `password` nvarchar(30) not null, last_name nvarchar(50), first_name nvarchar(50) ); Create Table If Not Exists ...
C++
BIG5
1,977
2.8125
3
[]
no_license
/** This source file is part of Forever * Copyright(c) 2012-2013 The DCI's Forever Team * * @file CActionEventHandler.h * @author Darren Chen (a) * @email darren.z32@msa.hinet.net * @date 2012/12/20 */ #ifndef _CACTIONEVENTHANDLER_H_ #define _CACTIONEVENTHANDLER_H_ #include "Common.h" #include "CAction...
Java
UTF-8
2,535
3.5
4
[ "MIT" ]
permissive
import org.junit.Test; import java.util.Stack; import java.util.StringTokenizer; /** * Created by earayu on 2017/6/26. */ public class test { @Test public void test1() { System.out.println(infix2Pos("(a.b)|c")); } public static String infix2Pos(String exp) { StringBuffer po...
Python
UTF-8
6,318
2.59375
3
[]
no_license
#!/usr/bin/env python # _*_ coding:utf-8 _*_ # ============================================ # @Time : 2020/02/08 19:24 # @Author : WanDaoYi # @FileName : cnn_mnist_train.py # ============================================ from datetime import datetime import tensorflow as tf from config import cfg from core.common...
PHP
UTF-8
1,619
2.734375
3
[]
no_license
<?php namespace Framework\Controller; use Framework\Manager\TokenManager; class TokenController { private $tokendb; public function __construct() { $this->tokendb = new TokenManager; } public function __invoke() { // Generate token $token = uniqid(rand(), true); ...
Markdown
UTF-8
5,582
2.796875
3
[]
no_license
## How to Connect to an OpenvCloud Environment ### Introduction ![](AdminArchitecture.png) The core of an OpenvCloud environment is the **master cloud space**, which consist of the following virtual machines or Docker containers: - **ovc_git** holding all configuration of your environment - **ovc_master** controllin...
Java
UTF-8
767
1.835938
2
[]
no_license
package com.eleganzit.msafiridriver.activity; import android.graphics.Path; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.eleganzit.msafiridriver.R; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps...
Go
UTF-8
1,586
2.828125
3
[]
no_license
package spider import( "bytes" "strings" "net/http" "strconv" "errors" "math/rand" "container/list" "golang.org/x/net/html" ) func autoID() string { prefix := "spider" id := prefix + strconv.Itoa(rand.Int()) return id } func IsHtml(data []byte) bool{ contentType := stri...
Java
UTF-8
1,176
2.375
2
[]
no_license
package com.eniso.FileType; import com.eniso.Utils.Trait; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileReader; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.apache.poi.xslf.u...
Python
UTF-8
1,396
4.25
4
[]
no_license
#subroutine to calculate number of stops between two stops on the victoria line def victoria_line(): victoria = ["Brixton", "Stockwell", "Vauxhall", "Pimlico", "Victoria", "Green Park", "Oxford Circus","Warren Street", "Euston","King's Cross","Highbury & Islington", "Finsbury Park","Seven Sisters","Tottenham Hale", "...
Python
UTF-8
347
2.515625
3
[]
no_license
#!/usr/bin/python import gi gi.require_version('Notify', '0.7') from gi.repository import Notify Notify.init("Hello world") tytul ="Cześć" zawart = "Cześć pytonie" #Hello = Notify.Notification.new("Hello world", "This is an example notification.", "dialog-information") Hello = Notify.Notification.new(tytul, zawart, "di...
C#
UTF-8
2,077
3.8125
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Exception_Handling { class Program { static void Main(string[] args) { try { List<int> numbers = new List<int> {55, 42, 23, 60, ...
Java
UTF-8
504
1.851563
2
[]
no_license
package com.dao; import com.po.Good; import com.po.Good_tag; import com.po.Good_type; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @Mapper public interface GoodDaos { List<Good> listGood(Map<String, Object> map); Integer...
Python
UTF-8
13,953
2.9375
3
[ "MIT" ]
permissive
# This is a work in progress and to hell with your warranty! # I wanted to use a Korg nanoKontrol2 as a joystick. Why? 'Cause buttons, dials & sliders for cheaper ($80 CDN). # This: http://www.korg.com/caen/products/computergear/nanokontrol2/ # To make this work we need to monitor the midi from the nanoKontrol2 and ...
JavaScript
UTF-8
1,332
3.265625
3
[]
no_license
function getData(countryname) { console.log(countryname.value) const url='https://restcountries.eu/rest/v2/name/'.concat(countryname.value); document.getElementById("container").innerHTML=''; fetch(url) .then(data => data.json()) .then(res =>{ console.log(res); res.forEach(temp=>{ let card = d...
Python
UTF-8
2,198
2.5625
3
[ "BSD-3-Clause" ]
permissive
# -*- coding: utf-8 -*- ''' Xml data source ==================== Loads data from xml file. Usage : baf = bakfu.Chain().load('data.xml', file='./data.xml', query='//answer', processor=lambda x:x.text, targets_processor=lambda x:x.attrib['label'] ) .. au...
C++
UTF-8
9,270
2.546875
3
[]
no_license
#define _USE_MATH_DEFINES #include "opencv2/opencv.hpp" #include <iostream> #include <cstdlib> #include <cmath> #include <vector> #include <algorithm> #include <numeric> #include <map> #include <tuple> #define Inf 100000000 #ifndef NEW_SMC #define NEW_SMC namespace common { template<typename V> cv::Mat Img2Mat(s...
Python
UTF-8
679
2.765625
3
[]
no_license
from sklearn.tree import DecisionTreeClassifier import numpy as np from sklearn.datasets import load_digits digits = load_digits() X=digits.data Y=digits.target X_train = X[0:1200, :] X_test = X[1200:, :] Y_train = Y[0:1200] Y_test = Y[1200:] classifier = DecisionTreeClassifier(max_depth=20, ...
C++
UTF-8
2,917
3.671875
4
[]
no_license
/*职责链:使多个对象都有机会处理请求,从而避免请求的发送者和接受者之间的耦合 关系,将这些对象形成一条链,并沿着这条链传递该请求,知道有一个对象处理它 为止*/ #include <iostream> using namespace std; typedef int Topic; const Topic NO_HELP_TOPIC = -1; const Topic PRINT_TOPIC = 1; const Topic PAPER_ORIENTATION_TOPIC = 2; const Topic APPLICATION_TOPIC = 3; //处理帮助请求的接口,维护一个帮助请求(缺省为空), //并保持对请...
JavaScript
UTF-8
1,299
3.109375
3
[]
no_license
/* Swich'as panasu kaip if'as tik jis lygina: tik lygu/nelygu. (Tuo metu if gali palyginti ir dar daugiau/maziau)*/ /* Console visada spausdina atsakyma iki kol pasiekia break */ const darzove = 'morka'; switch(darzove) { case 'morka': console.log('Labai gerai tavo regejimui'); break; case 'bulve':...
C++
UTF-8
2,015
3.75
4
[]
no_license
#include <iostream> using namespace std; struct stack{ int element[50]; int size; int top; }; void push(int x,struct stack &S){ if(S.top == S.size){cout << "The stack is full." << endl;} else{ S.top++; S.element[S.top] = x; } } int pop(struct stack &S){ i...
JavaScript
UTF-8
2,601
3.359375
3
[]
no_license
import React, { useState, useEffect } from 'react'; import shuffle from 'lodash.shuffle'; import './App.css'; // image for the pokemon // https://pokeres.bastionbot.org/images/pokemon/${pokemon.id}.png const pokemon = [ { id: 4, name: 'charizard' }, { id: 10, name: 'caterpie' }, { id: 77, name: 'ponyta' }, { ...
Java
UTF-8
743
3.59375
4
[]
no_license
package java2blog.DynamicProgramming; import java.util.Scanner; public class LongestCommonSubs { public static void main(String[] args) { Scanner scn = new Scanner(System.in); System.out.println("Enter the 1st word: "); String A = scn.nextLine(); System.out.println("Enter the 2nd word: "); ...
Java
UTF-8
4,020
3.46875
3
[]
no_license
import java.util.Scanner; public class HW_Edition { // Design a program for a grocery store. Ask at least 3 items id and quantity to user public static void main(String[] args) { Scanner myCart = new Scanner(System.in); System.out.println("\t \t id prices: \n"); System.out.println("\t \t...
Ruby
UTF-8
1,642
2.65625
3
[]
no_license
# == Schema Information # # Table name: sales # # id :bigint not null, primary key # created_at :datetime not null # updated_at :datetime not null # pos_datetime :datetime not null # pos_total :float not null # pos_fiscal_numbe...
PHP
UTF-8
2,653
2.875
3
[]
no_license
<?php /* * 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. */ /** * Description of sweetDB * * @author Paula */ class sweetDB { public static function get_sweetTypes(){ $db...
Python
UTF-8
820
3
3
[]
no_license
from __future__ import print_function from hamming_distance.hamming_distance import hamming_distance def approx_pattern_count(text, pattern, d): count = 0 pattern_len = len(pattern) for i in range(len(text) - (pattern_len-1)): substr = text[i:i+pattern_len] if hamming_distance(pattern, subs...
Java
UTF-8
878
3.0625
3
[]
no_license
import static java.lang.Character.toUpperCase; public enum Command { MOVE_BACKWARDS { @Override Rover executeOn(Rover rover) { return rover.moveBackward();} }, TURN_RIGHT { @Override Rover executeOn(Rover rover) { return rover.turnRight(); }}, TURN_LEFT { @Override Rover executeOn(Rover rover) { return rov...
TypeScript
UTF-8
1,904
3.09375
3
[]
no_license
// #region TYPES export const PUSH_ERROR = 'error/push'; export const SHIFT_ERROR = 'error/shift'; export interface Error { name: string; message: string; type: string; } export type ErrorState = Error[]; export interface ErrorPushAction { type: typeof PUSH_ERROR; payload: Error; } export interface ErrorSh...
Markdown
UTF-8
1,987
3.59375
4
[]
no_license
# problem >Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times. Example 1: ``` Input: s = "aaabb", k = 3 Output: 3 The longest substring is "aaa", as 'a' is repeated 3 times. ``` Example 2: ``` Input: s = "ababbc...
Java
UTF-8
415
2.203125
2
[]
no_license
package com.teamtrouble.choresapplication.web.service; import org.springframework.stereotype.Service; @Service public class LoginService { public boolean validateUser(String userId, String password) { // TODO: Validate against database with hashed password // For now, userId = admin and password = password ...
C#
UTF-8
684
3.296875
3
[]
no_license
using System; using System.Collections.Generic; namespace Homework_Class05.Classes { public class Car { public string Model { get; set; } public int Speed { get; set; } public Driver Driver { get; set; } public Car(string model, int speed) { Model = model...
Swift
UTF-8
1,142
3.03125
3
[ "MIT" ]
permissive
// // StubRequest.swift // Spider // // Created by Harry Tran on 7/16/19. // Copyright © 2019 Harry Tran. All rights reserved. // import Foundation public struct StubRequest: Equatable { public enum HTTPMethod: String { case GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH } ...
C#
UTF-8
3,238
2.984375
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; using UnitTestingTask; namespace TriangleXUnitTests { public class XUnitTests : IDisposable { static Logger logger = new Logger("xUnit"); readonly int Equilateral =...
Markdown
UTF-8
6,165
2.515625
3
[]
no_license
--- description: "Easiest Way to Make Perfect Spinach, Pork, Hijiki Seaweed Rice Bowl" title: "Easiest Way to Make Perfect Spinach, Pork, Hijiki Seaweed Rice Bowl" slug: 2584-easiest-way-to-make-perfect-spinach-pork-hijiki-seaweed-rice-bowl date: 2020-12-07T13:12:03.355Z image: https://img-global.cpcdn.com/recipes/4505...
Java
UTF-8
455
2.109375
2
[]
no_license
package studio7i.negocio; import studio7i.modelo.Persona; public class GestionCliente { public void RegistrarCliente(int id, String usuario, String clave, String dni, String nombres, String fechanacimiento, String email){ Persona ClienteNuevo = new Persona(); ClienteNuevo.setClave(clave); Client...
C#
UTF-8
15,597
2.8125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Ink; using System.Windows.Input; using Windows.Foundation; using Priority_Queue; namespace CLP.InkInterpretation { public class ClusterPoint : PriorityQueueNode { public const double UNDEFINED = -1.0; publ...
Python
UTF-8
2,313
2.921875
3
[ "MIT" ]
permissive
#Connect to ArchivesSpace database through SSH Tunnel import pymysql import yaml import csv import pandas as pd #add error handling, logging #don't forget to close the connection class DBConn(): """Class to connect to ArchivesSpace database via SSH and run queries.""" def __init__(self, config_file=None)...
C#
UTF-8
1,694
3.046875
3
[ "MIT" ]
permissive
using System; namespace sudokusolver.Solver { public class GridSolver { private readonly Grid _grid; public GridSolver(Grid grid) { _grid = grid; } public bool Solve() { var enumerator = new FrozenCellSkippingGridEnumer...
Java
UTF-8
1,095
3.5
4
[]
no_license
// Zachary Price //Chapter 9, #7 import java.io.*; import javax.swing.*; import java.util.*; public class Chap9_7 { public static void main(String[] args) throws FileNotFoundException { Scanner inFile = new Scanner(new FileReader("Chap9_7Data.txt")); PrintWriter outFile = new PrintWriter("Chap9_7Output.txt"); ...
Java
UTF-8
787
2.859375
3
[]
no_license
package ru.cetelem.com.patterns; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; public class TemplateMethod { public static void main(String[] args) { new BankWebSite().showPage(); } } class NewsWebSite extends WebSiteTemplate{ @Override protected void ...
JavaScript
UTF-8
2,113
2.546875
3
[]
no_license
import React from "react"; import "./table-rows.css"; const TableRows = ({ list, deleteBtn, onSort }) => { const renderList = () => { if (list.length > 0) { return list.map((item, index) => { return ( <tr key={item.id}> <th scope="row">{index + 1}</th> <td>{item.fi...
Shell
UTF-8
203
2.65625
3
[]
no_license
#!/bin/sh set -e xwininfo | awk -F: ' /Absolute upper-left X/{x=$2} /Absolute upper-left Y/{y=$2} /Width/{w=$2} /Height/{h=$2} END{ printf "-s %dx%d -i %s.0+%d,%d", w, h, ENVIRON["DISPLAY"], x, y } '
Java
UTF-8
3,274
2.109375
2
[]
no_license
package com.extrabux.tests.daigou; import static org.testng.Assert.assertTrue; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.openqa.selenium.WebDriver; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import com.extrabux.pages.daigou.CartSummar...
C++
UTF-8
7,809
3.21875
3
[ "MIT" ]
permissive
// // Created by Tom on 04/12/2017. // #include "SpinState.h" /** Constructor for the SpinState class where the number of nuclear spins on both radicals are specified. * * @param [in] num_nuc_spins_1_in number of nuclear spins on radical 1 * @param [in] num_nuc_spins_2_in number of nuclear spins on radical 2 */ S...
Java
UTF-8
585
3.40625
3
[]
no_license
package Contructor; public class RctangleHW2 { int length; int breadth; public RctangleHW2() { length=0; breadth=0; } RctangleHW2(int num1, int num2) { length=num1; breadth=num2; } RctangleHW2(int num1) { length=breadth=num1; } void area() { System.out.println(" Area ...
PHP
UTF-8
515
2.796875
3
[]
no_license
<!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="/PHP/style.css"> <title>php-ex-2</title> </head> <body> <?php $password= $_GET['password']; var_dump($password); ?> <?php if ($password == 'Boolean') {?> <h1 class ='...
C++
UTF-8
2,289
2.703125
3
[]
no_license
#pragma once #include <windows.h> //#define YIELD_CPU SwitchToThread() //#define YIELD_CPU Sleep(0) //#define YIELD_CPU YieldProcessor() #define YIELD_CPU template<class T, size_t LEN> class RingQueueMT { public: RingQueueMT(void) { m_in = m_out = m_len = 0; #ifdef PROFILING m_ignorePopSpinning = false; #endif ...
PHP
UTF-8
670
2.53125
3
[ "MIT" ]
permissive
<?php namespace QuarkCMS\QuarkAdmin\Models; use Illuminate\Database\Eloquent\Model; class File extends Model { /** * 该模型是否被自动维护时间戳 * * @var bool */ public $timestamps = true; protected $casts = [ 'created_at' => 'datetime:Y-m-d H:i:s', 'updated_at' => 'datetime:Y...
Markdown
UTF-8
2,404
2.671875
3
[ "MIT", "CC-BY-4.0", "CC-BY-NC-SA-4.0", "CC-BY-SA-4.0" ]
permissive
--- sidebar_position: 7 id: plugin-google-gtag title: '📦 plugin-google-gtag' slug: '/api/plugins/@docusaurus/plugin-google-gtag' --- The default [Global Site Tag (gtag.js)](https://developers.google.com/analytics/devguides/collection/gtagjs/) plugin. It is a JavaScript tagging framework and API that allows you to sen...
Java
UTF-8
373
2.03125
2
[]
no_license
package com.ms.env; import org.springframework.core.env.Environment; import com.system.comm.utils.FrameSpringBeanUtil; public class EnvUtil { /** * 获取属性的值 * @param env * @return */ public static String get(Env env) { Environment environment = FrameSpringBeanUtil.getBean(Environment.class); return envi...
C#
UTF-8
3,676
2.671875
3
[]
no_license
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using SecondHandBook.Models; namespace SecondHandBook { [Rou...
JavaScript
UTF-8
1,350
2.84375
3
[]
no_license
define(function(require) { var Vector2D = require('lib/vector2d'); function createPlayerView(c) { return new Kinetic.Rect({ x: c.x, y: c.y, width: c.width, height: c.height, offset: { x: 1 * (c.width / 2), y: 1 * (c.height / 2), }, fill: "green", ...
Java
UTF-8
1,127
2.203125
2
[]
no_license
package com.pommert.jedidiah.bouncecraft2.items; import java.util.TreeMap; import net.minecraftforge.oredict.ShapedOreRecipe; import com.pommert.jedidiah.bouncecraft2.creativetabs.BCCreativeTabs; import com.pommert.jedidiah.bouncecraft2.ref.ModRef; import cpw.mods.fml.common.registry.GameRegistry; public class BCI...
Java
UTF-8
962
2.15625
2
[]
no_license
package com.spring.demo; import javax.inject.Inject; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.spring.dao.MemberDAO; import com.spring.vo.MemberVO; ...
C#
UTF-8
3,053
3.28125
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WinAppParabolicShoot { class CParabolicShoot { private float mVelocity, mTheta, mDistance, mHigh, mTime; private const float G =...
C++
UTF-8
1,273
3.234375
3
[]
no_license
#ifndef _GAMEROLE_ #define _GAMEROLE_ #include <string> #include <iostream> class GameRole{ int hp; std::string name; int mana; int attack; public: void useMana(){ std::cout << "Dark squeeze! mana-10" << std::endl; mana = mana-10; } void changeHP(int ...
Markdown
UTF-8
3,267
2.875
3
[]
no_license
To improve php performance, it's good to start profiling the application you are working on, as there might be some bad code that heavily decreases performance. One tool to do this with, is Xhprof. Xhprof is a tool that helps you detect possible code issues, it accomplishes this by showing you what function get called...
C++
UTF-8
2,786
3.4375
3
[]
no_license
#ifndef BINARY_SEARCH_TREE_H #define BINARY_SEARCH_TREE_H #include "TreeNode.h" //"Jack" Daniel Kinne /* Incomplete BST. We will fill this out more in future lectures. */ template <typename T> class BinarySearchTree { private: TreeNode<T> *_root = nullptr; protected: virtual TreeNode<T> *fi...
Markdown
UTF-8
968
3.84375
4
[]
no_license
## Position Improved Positioning your cat with calculations is handy. However there is another way to do this, where you don't need to do all those calculations by yourself. (Why didn't I tell you this earlier, right?) The solution is a function called `translate` that is part of the drawing context. By calling it yo...
Shell
UTF-8
1,504
3.6875
4
[]
no_license
#! /bin/bash set -eu # Execute terraform graph and output results as svg file. # Terraform gaph output a 'dot' file. # Docker image is use as 'dot' file requires Graphviz tool to convert to another format, eg svg # # Execute terraform graph beautifier and output results as html file. # # Arguments: ...
PHP
UTF-8
1,267
2.609375
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
<?php final class PhabricatorRepositoryGitLFSRefQuery extends PhabricatorCursorPagedPolicyAwareQuery { private $ids; private $repositoryPHIDs; private $objectHashes; public function withIDs(array $ids) { $this->ids = $ids; return $this; } public function withRepositoryPHIDs(array $phids) { ...
Python
UTF-8
940
3.296875
3
[]
no_license
from collections import Counter input_ = "...^^^^^..^...^...^^^^^^...^.^^^.^.^.^^.^^^.....^.^^^...^^^^^^.....^.^^...^^^^^...^.^^^.^^......^^^^" def expand(start, rows, log=False): traps = [start] while True: old_traps = "." + traps[-1] + "." new_traps = "" for idx, trap in enumerate(ol...
C++
UTF-8
986
2.8125
3
[]
no_license
#ifndef MICROPHONE_H_ #define MICROPHONE_H_ #include "GlobalConfig.h" #include "Utils.h" namespace Beam{ class Microphone { public: Microphone(int _id, float _x, float _y, float _z, int _type, float _direction, float _elevation); ~Microphone(); /// microphone id. int id; /// coordinates of the microphone....
Java
UTF-8
1,293
3.546875
4
[]
no_license
package gameoflife.model; import java.util.LinkedList; import java.util.ListIterator; public class Cell { private boolean alive; private boolean nextAlive; private int amountOfAliveNeighbours; private LinkedList<Cell> neighboursCells; public Cell() { alive = false; nextAlive = fal...
JavaScript
UTF-8
6,376
3.703125
4
[]
no_license
var square = []; // Objects made for all the square divs var k = 6; // It is the number of squares presently on the board, 6 for hard mode 3 for easy var pickedColor; // It will contain the color of the div that needs to be clicked for winning for(var i = 1; i <= k; i++) { square[i - 1] = document.querySelector("#a" +...
Markdown
UTF-8
12,854
3.1875
3
[]
no_license
Confoo Two-Factor Demo ====================== This Express route is where I've put in all the code for my little demonstration of authentication using Google Authenticator and a Yubikey. This is a literate coffee-script file, which is a new feature of coffee-script 1.5.0. This means that this document is written in Mar...
Python
UTF-8
328
2.875
3
[ "MIT" ]
permissive
import os dir_path = os.path.dirname(os.path.realpath(__file__)) for file in os.listdir(dir_path): if file.endswith(".pdf"): # print(os.path.join(dir_path, file)) # print("Converting file:", str(file)) cmd = "pdftotext '" + os.path.join(dir_path, file) + "'" print(cmd) os.sys...
Python
UTF-8
266
3.84375
4
[]
no_license
numbers = [[], []] for i in range(0, 7): number = int(input('number: ')) if number % 2 == 0: numbers[0].append(number) else: numbers[1].append(number) numbers[0].sort() numbers[1].sort() print(f'Pares: {numbers[0]}') print(f'Impares: {numbers[1]}')
Markdown
UTF-8
2,012
3.609375
4
[]
no_license
MySQL OOP Class PHP (v.1.0) ------------ This is a simple to use MySQL class that easily bolts on to any existing PHP application, streamlining your MySQL interactions. Setup ----- Simply include this class into your project like so: ```php <?php //Simply include this file on your page require_once("MySQL.class.p...
Markdown
UTF-8
4,991
2.84375
3
[ "Apache-2.0" ]
permissive
+++ title = "Design" description = "Dive into key design elements" +++ Read more [about the goals](../goals/) first if necessary. # Registries ## Driver registry The core of extensibility is implemented as an in-process driver registry. The things that make it work are: - Clear priority classes via explicit depe...
Java
UTF-8
1,449
2.65625
3
[]
no_license
package ru.toolkas.jshell.lang; import ru.toolkas.jshell.runtime.JShellContext; import ru.toolkas.jshell.runtime.JShellRuntimeException; import ru.toolkas.jshell.runtime.TypeCastException; import java.io.File; public class NullValue implements Value { @Override public Type type() { return Type.UNDEFI...
TypeScript
UTF-8
1,312
2.59375
3
[ "MIT" ]
permissive
import { Card } from '../../../interfaces' import Set from '../Primal Clash' const card: Card = { name: { en: "Weedle", fr: "Aspicot", es: "Weedle", it: "Weedle", pt: "Weedle", de: "Hornliu" }, illustrator: "Midori Harada", rarity: "Common", category: "Pokemon", set: Set, dexId: [ 13, ], hp: 50...
Markdown
UTF-8
669
3.1875
3
[ "MIT" ]
permissive
Multiplies a scalar times a `Tensor` or `IndexedSlices` object. ``` tf.compat.v1.scalar_mul( scalar, x, name=None) ``` Intended for use in gradient code which might deal with `IndexedSlices` objects, which are easy to multiply by a scalar but more expensive tomultiply with arbitrary tensors. #### 参数:...
Python
UTF-8
1,741
2.59375
3
[]
no_license
import numpy as np import math import matplotlib.pyplot as plt import vtk from matplotlib import pyplot from matplotlib import collections as mc from matplotlib.patches import Circle, Wedge, Polygon from matplotlib.collections import PatchCollection from vtk.util.numpy_support import vtk_to_numpy def create_horizontal...
Java
UTF-8
747
2.234375
2
[]
no_license
package com.stech.csw.crawler.news.api.repository; import com.stech.csw.crawler.news.api.model.News; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interfa...
PHP
UTF-8
3,866
2.65625
3
[]
no_license
<?php declare(strict_types=1); /** * Saito - The Threaded Web Forum * * @copyright Copyright (c) the Saito Project Developers * @link https://github.com/Schlaefer/Saito * @license http://opensource.org/licenses/MIT */ namespace App\Controller\Component; use App\Model\Entity\Entry; use App\Model\Table\EntriesT...
Markdown
UTF-8
2,163
3
3
[]
no_license
--- title: Desktop Notifier by Python date: 2017-07-28 16:37:40 tags: - Python --- This article show how to send desktop notice using Python ![simpleNotification](https://raw.githubusercontent.com/xibuka/git_pics/master/simpleNotification.png) # Install requirments we need to install `notify2` by pip ``` # pip inst...
Java
UTF-8
660
3.59375
4
[]
no_license
package com.company; import com.sun.source.util.SourcePositions; public class DefineBasicInfo { public static void main(String[] args) { // Define several things as a variable then print their values // Your name as a string // Your age as an integer // Your height in meters as a d...
Java
UTF-8
1,973
3.6875
4
[]
no_license
//Scanner import java.util.Scanner; public class Lab { public static void main(String[] args) { // Scanner scan = new Scanner(System.in); // System.out.println("Are you in NY "); // String userName = scan; // boolean whereAreYou = scan.nextBoolean(); // // System.out.println("...
Python
UTF-8
151
3.203125
3
[]
no_license
s = input() now = "" ans = 0 for i in range(len(s)): if i == 0: now = s[0] continue if s[i] != now: ans += 1 now = s[i] print(ans)