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
16,540
2.140625
2
[]
no_license
package stefan.jovanovic.chatapplication; import android.content.Context; import android.content.SharedPreferences; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStr...
Python
UTF-8
905
2.765625
3
[]
no_license
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter from sklearn import mixture fig = plt.figure() ax = fig.gca(projection="3d") # prepare data delta = 0.5 #x = np...
PHP
UTF-8
2,163
2.625
3
[ "MIT" ]
permissive
<?php namespace App\Http\Controllers; use App\Award; use App\Http\Requests\MakeAwardRequest; use App\Repositories\Award\AwardRepository; use App\Repositories\Award\AwardRepositoryInterface; use App\Repositories\Personal\PersonalRepositoryInterface; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facad...
Java
UTF-8
2,602
2.28125
2
[]
no_license
package mundial.initics.martes; import android.content.Context; import android.content.SharedPreferences; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.Toast; import com.androgni...
Java
UTF-8
577
3.21875
3
[]
no_license
import java.util.Scanner; public class Ejercicio5 { public static void main (String args[]){ int edad; int media; int contador=0; int suma=0; Scanner teclado = new Scanner (System.in); System.out.println("Introduce la edad "); edad= teclado.nextInt(); whil...
Java
UTF-8
216
2.21875
2
[]
no_license
package Encapsulation; public class pembungkusan { public static void main(String[] args) { hewan h = new hewan(); h.set_tinggi(129); System.out.println(h.get_tinggi()); } }
TypeScript
UTF-8
968
3.96875
4
[]
no_license
interface ITypeFunction { (a:number, b:number):boolean; } var add: ITypeFunction; add = (varA:number, varB:number):boolean => { return true } interface IColor { (codeColor:string, title?:string):{codeColor:string, title?:string} } var getNewColor:IColor; getNewColor = function(codeColor:string, title?:st...
Python
UTF-8
6,466
2.65625
3
[ "MIT" ]
permissive
from FrictionlessDarwinCore import * from pathlib import Path import sys import shutil import requests import zipfile import tempfile import xml.etree.ElementTree as ET class DwCArchive: voc = DwCVocabulary() ns = {'dwc': 'http://rs.tdwg.org/dwc/text/'} def __init__(self, path_or_url): self.vali...
PHP
UTF-8
613
2.90625
3
[]
no_license
<?php class departments{ public function addDepartment($data){ $c=new Connect(); $connection=$c->connection(); $sql="INSERT INTO departments($id_user, name_department, updated_date) VALUES ('$data[0]', '$data[1]', '$data[2]' )"; return mysqli_query($connec...
Java
UTF-8
2,575
2.59375
3
[ "Apache-2.0" ]
permissive
package com.github.jjYBdx4IL.streaming.clients; import com.github.jjYBdx4IL.streaming.clients.twitch.TwitchIRCClient; import com.github.jjYBdx4IL.streaming.clients.twitch.api.Channel; import com.github.jjYBdx4IL.streaming.clients.twitch.api.TwitchRESTClient; import java.io.IOException; import java.util.Locale; impor...
Java
UTF-8
450
3
3
[]
no_license
public class CalculoSalario { public static void main(String[] args) { //variaveis double salario=1000, ano = 2005, aumento = 0.15; do{ salario = salario + (salario * aumento); aumento = aumento * 2; S...
Java
UTF-8
795
3
3
[]
no_license
package com.zhuanche.util; import java.security.SecureRandom; import java.util.Random; public final class NumberUtil { private static final String SEED_CHARS = "0123456789"; private static final Random rnd = new SecureRandom(); public static String genRandomCode( int length ) { StringBuffer sb = new StringBuf...
Python
UTF-8
298
3
3
[]
no_license
def iAddition(self): total = 0 while (current != None): total = total + current.getData() current = current.getNext() return total def rAddition(listPtr): if listPtr == None: return 0 else: return listPtr + rAddition(listPtr.getNext())
PHP
UTF-8
1,052
2.859375
3
[ "MIT" ]
permissive
<?php namespace App\Components\Message\Notifier; use App\Components\Message\MessageSendResult; use App\Components\Message\INotifier; use App\Components\Message\Message; use App\Components\Message\Manager; class GroupNotifier implements INotifier { /** * 发送消息 * * @param MessageGroup $message 消息对象,一个MessageGr...
Java
UTF-8
792
2.375
2
[]
no_license
package com.ibm.service; import com.ibm.model.EmailRequest; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class MessageBuilder { public static Message createNewMimeMsg(EmailRequest request) { M...
JavaScript
UTF-8
1,103
2.953125
3
[]
no_license
'use strict'; const Graph = require('../../graph/graph'); const getEdge = require('../getEdge'); describe('getEdge', () => { let graph; let cities; beforeEach(() => { graph = new Graph(); graph.addNode('Seattle'); graph.addNode('Bellevue'); graph.addNode('Renton'); ...
JavaScript
UTF-8
1,625
2.59375
3
[]
no_license
'use strict'; const checkboxes = document.querySelectorAll('.text input[type=checkbox]'); const sendRequest = document.querySelector('#send-request'); checkboxes.forEach((checkbox, i) => { checkbox.addEventListener('change', (e) => { checkboxes.forEach((checkbox) => { checkbox.checked = false; }); ...
Python
UTF-8
1,276
2.9375
3
[ "MIT" ]
permissive
import unittest from protectedblob.blob import PassphraseProtectedBlob from protectedblob.cipher_suites import AES256CBCSHA256 from protectedblob.key_derivation import PBKDF2SHA256AES256 class TestPassphraseProtectedBlob(unittest.TestCase): def test_roundtrip(self): plaintext = b'hello, world!' p...
C
UTF-8
208
2.5625
3
[]
no_license
#include <stdio.h> #include <string.h> int main(void) { char* p; char* c; p = "this is a test but very hard to"; c = "butteegergerfdsfgsdfgsdfgsdfgd"; printf("something -- \n ---- %i.\n", c-p); return 0; }
Java
UTF-8
1,794
2.5
2
[]
no_license
package com.goldgov.origin.core.web.validator.impl; import java.lang.reflect.Field; import java.util.Date; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.goldgov.origin.core.web.annotation.OperateType; import com.goldgov.origin.core.web.validator.Cons...
Go
UTF-8
980
3.109375
3
[]
no_license
package main import ( "fmt" "gopl-practise/ch4/4-10/github" "log" "os" "time" ) const ( lessOneMonth string = "less than a month" lessOneYear string = "less than a year" moreOneYear string = "more than a year" ) func main() { result, err := github.SearchIssues(os.Args[1:]) if err != nil { log.Fatal(err...
C++
UTF-8
2,027
3.078125
3
[]
no_license
#include<iostream> using namespace std; class book { private: int bookId, quantity, presentQuantity; char name[100], author[100], genre[100],pub[100]; public: book():bookId(-1),quantity(-1){} void new_book() { cout<<"BookID : "; cin>>...
Java
UTF-8
329
1.75
2
[]
no_license
package com.selenium.pages; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.How; public class MyAccountsPage { @FindBy(how = How.ID, using = "email") //@FindBy(how = How.XPATH, using = "//*[@id=\"email\"]") public static WebElement myAc...
Markdown
UTF-8
3,044
2.90625
3
[ "MIT" ]
permissive
Iron.Layout ============================================================================== Dynamic layout with support for rendering dynamic templates into regions. Iron.Layout is the page rendering engine for Iron.Router. Layouts can also be used independently for composing templates. For example, your app might have...
Java
UTF-8
6,765
3.640625
4
[]
no_license
package jvmConfig; public class HeapStack { /* Java堆空间 Java运行时使用Java堆空间将内存分配给Objects和JRE类。每当我们创建对象时,它总是在堆空间中创建。 垃圾回收在堆内存上运行以释放没有任何引用的对象使用的内存。在堆空间中创建的任何对象都具有全局访问权限,并且可以从应用程序的任何位置进行引用。 Java堆栈内存 Java Stack内存用于执行线程。它们包含短期的特定于方法的值以及对从该方法引用的堆中其他对象的引用。 堆栈存储器始终按LIFO(后进先出)顺序引用。每当调用方法时,都会在堆栈存储器中创...
Markdown
UTF-8
1,061
2.984375
3
[ "Apache-2.0" ]
permissive
# 代码埋点 传统代码埋点 实现方案:Coding阶段手动埋点。 代表解决方案:友盟、百度统计。 优点:灵活、准确,可以定制化。 缺点:业务埋点量非常大,开发成本高,不易维护,如果要修改、新增埋点,需要重新发版。 代码埋点是指在产品开发阶段,PM通过对产品上线后需要做的数据分析的场景,设计数据需求, 撰写数据需求文档,然后交由开发在每个需要采集的数据点写入代码,通过写入的代码进行数据监测与上报。 即在需要埋点的节点调用接口直接上传埋点数据,友盟、百度统计等第三方数据统计服务商大都采用这种方案。 ## 特点 代码埋点虽然使用起来灵活,但是开发成本较高,并且一旦上线就很难修改。 如果发生严重的数据问题,只能通过发热修复解决。 ...
Java
UTF-8
12,309
1.851563
2
[]
no_license
/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify i...
C++
UTF-8
693
2.609375
3
[]
no_license
#ifndef FSMANAGER_H #define FSMANAGER_H #include "interface/IFSManager.h" #include "interface/IConfiguration.h" #include <memory> /** * @brief Реализация воркера файловой системы. */ class FSManager : public IFSManager { public: /** * @brief Конструктор воркера ФС * * @param configuration - кон...
Java
UTF-8
1,186
2.53125
3
[]
no_license
package robert.trojan.entity; import javax.persistence.*; @Entity @Table(name = "defaultWord") public class DAODefaultWord { @GeneratedValue(strategy= GenerationType.AUTO) @Id @Column private Integer id; @Column private String word; @Column private String definition; @ManyToOne ...
C#
UTF-8
16,609
2.890625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace CoreMP { /// <summary> /// The LibraryScanController carries out the asynchronous actions involved in scanning a library /// </summary> internal class LibraryScanController { /// <summary> /// Asynchron...
C++
UTF-8
1,212
2.875
3
[]
no_license
//Name: Saurav Bhattarai //File: Alien.h #ifndef ALIEN_H #define ALIEN_H #include "Game_obj.h" #include "Laser.h" #include <string> class Alien: public Game_obj { protected: int full_health_; int health_; std::string state_; Image & image_; bool isalive_; int dx_; int dy_; int score_; ...
Java
UTF-8
9,340
2.53125
3
[ "BSD-2-Clause" ]
permissive
package jpaint; import javafx.application.Platform; import javafx.embed.swing.SwingFXUtils; import javafx.fxml.FXML; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.control.*; import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.stage....
Java
UTF-8
3,404
1.8125
2
[ "Apache-2.0" ]
permissive
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed u...
C
UTF-8
1,472
4.34375
4
[]
no_license
/* * Date: 2018-10-14 * * Description: * Maximize value of (a[i] - i) - (a[j] - j) in an unsorted array * * Approach: * Consider a[i] - i and a[j] - j as independent, idea is to find maximum and * minimum value of a[x] - x and subtract them to max required value. * * Complexity: * O(N) */ #include "stdio.h...
Python
UTF-8
173
2.84375
3
[]
no_license
i,j=1,1; while(i<=10): print("*Arquam"); i+=1; while(j<=10): if(j%2==0): print("\[]One-EXPLOITS's") j+=1; print("\n\ni===",i,"j==",j)
C#
UTF-8
1,063
2.75
3
[]
no_license
using AutoMapper; using BLL.Interface.Entities; using BLL.Interface.Factories; using System.Collections.Generic; using System.Linq; namespace BLL.Mappers { public static class EntitiesMapper { public static List<AbstractBankAccount> ToAbstractBankAccountList(List<DAL.Interface.DTO.BankAccount> accounts) { re...
C
UTF-8
746
3.078125
3
[ "MIT" ]
permissive
#include <stdio.h> #include <unistd.h> int main(){ int len,i,apipe[2]; char buf[BUFSIZ]; if(pipe(apipe) == -1){ perror("could not make pipe"); exit(1); } printf("got a pipe!it is file descriptors:{ %d %d }\n",apipe[0],apipe[1]); while(fgets(buf,BUFSIZ,stdin)){ len = strle...
C++
UTF-8
1,303
3.515625
4
[]
no_license
// // Created by ZachZhang on 2017/5/1. // #include <iostream> #include <vector> #include <cstdlib> using namespace std; class Solution { public: int findMinDifference(vector<string>& timePoints) { vector<string> times(timePoints); bool flag = false; for (auto str : timePoints) { ...
Python
UTF-8
6,831
2.734375
3
[]
no_license
#!/usr/bin python #coding=utf-8 ############################ # @author Jason Wong # @date 2013-12-08 ############################ # connect to aotm db # generate documents of songs ############################ import MySQLdb import sys import numpy import pylab as pl import logging import os from nltk.stem.lancaster i...
Ruby
UTF-8
1,607
3.046875
3
[ "MIT" ]
permissive
class GroupTrips attr_reader :llist def self.call(llist, traveller_home) new(llist).chunk(traveller_home) end def initialize(llist) @llist = llist end def output(traveller_home) @output ||= llist.select_by do |elem| case elem.datum.type when 'Flight' ...
Markdown
UTF-8
1,441
3.171875
3
[ "MIT" ]
permissive
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> **Table of Contents** - [Cursors](#cursors) - [Available cursor values](#available-cursor-values) <!-- END doctoc generated TOC please keep comment here to allow auto upd...
Java
UTF-8
2,834
2.421875
2
[]
no_license
package aglf.data.dao.commons; import org.hibernate.Criteria; import org.hibernate.FlushMode; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import java.io.Serializable; import java.util.List; /** * @param <IdT> * @param <E> */ pub...
Python
UTF-8
1,204
2.890625
3
[]
no_license
#!/usr/bin/env python3 from collections import OrderedDict from sys import stdin from build_table import parse_grammar, classify_terms, build label = lambda iterable: OrderedDict(map(reversed, enumerate(iterable))) def main(): rules, goal = parse_grammar(stdin) nonterminals, terminals = ...
C++
UTF-8
1,310
3.421875
3
[]
no_license
class Solution { public: bool isValid(string s) { return wellFormedBrackets(s, 0, s.size()); // finish code 14:49 } // True if well formed, false else. // Change to reference and see if it works. // [start, end[ bool wellFormedBrackets(string s, int start, int end, ){ if...
Java
UTF-8
181
1.820313
2
[]
no_license
package com.tencent.appframework.thread; public interface FutureListener<T> { public void onFutureBegin(Future<T> future); public void onFutureDone(Future<T> future); }
Java
ISO-8859-1
9,991
2.640625
3
[]
no_license
package cocktailprogramm; import java.awt.event.WindowEvent; import java.io.*; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.*; public class RezeptGUI extends JFrame implements Serializa...
Markdown
UTF-8
11,083
2.5625
3
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
# Default Product Ports This page describes the default ports used by each runtime of WSO2 API Manager. !!! Note If you [change the default runtime ports]({{base_path}}/install-and-setup/setup/deployment-best-practices/changing-the-default-ports-with-offset), most of the runtime ports change automatically based o...
C++
UTF-8
1,717
3.40625
3
[]
no_license
#include <deque> #include <iostream> #include <fstream> #include <string> #include <cstdlib> #include <iomanip> using namespace std; template<class T> class mergesort{ public: mergesort(string inFile, string outFile); private: int readInFile(ifstream &inputFile); void printFile(string inFile,deque<T> &data,bo...
Swift
UTF-8
199
2.625
3
[ "MIT" ]
permissive
import Foundation public protocol ReceiptProtocol { //associatedtype PurchaseItem; var code: Int { get } var receipt: String { get } var purchases: [PurchaseItemProtocol] { get } }
Markdown
UTF-8
1,292
3.1875
3
[]
no_license
在 前端的编程范式中有三种主流的异常处理风格。 ## 回调式 比如微信小程序的接口都是使用这种风格的。以 `wx.request` 为例。 一般是向下面这样使用: ```js wx.request({ url: "/test/", success: res => { // 请求成功 }, fail: error => { // 请求失败 } }); ``` ## Promise 的 then/catch 还是以上面的 `wx.request` 为便。我们可以将 `wx.request` 封装一下,然后返回 `Promise`, 这个封装的代码,可以参考 [promisify](http...
Markdown
UTF-8
7,635
2.765625
3
[ "MIT" ]
permissive
# ![logo](https://git.iglou.eu/Laboratory/gitRabbit/raw/branch/master/gitRabbit.png) *-* gitRabbit *Le reproducteur le plus rapide de l'ouest* **Papa lapin veille sur ses lapereaux et leurs fait faire beaucoup de choses, mais toujours avec amour :heart:** --- **gitRabbit**, est un petit script qui permet de déployer ...
Python
UTF-8
1,091
3.546875
4
[]
no_license
""" 맞게는 나오나 sort썼는데 문자열로 sort되서 그런지 숫자 크기순이 아니라 문자열 순서대로 나옴. 나머지는 다 맞으나 백준에서 시간초과됨 """ import random l=[] while(1): k=input() if(k=="0"): break l.append(k) for i in l: s1=int(i[0]) s2=i[2:] s2=s2.split() s3=s1 sum=1 p=0 while(1): sum*=s3 s3-=1 p+=1...
C#
UTF-8
440
2.53125
3
[ "MIT" ]
permissive
using System.Collections.Generic; namespace Toe.SPIRV.CodeGenerator.Views { public static class ExtensionMethods { public static IEnumerable<T> Concat<T>(this IEnumerable<T> items, T item) { if (items != null) { foreach (var i in items) {...
JavaScript
UTF-8
947
2.609375
3
[]
no_license
'use strict'; //操作:セーブ $('#btn-save').click(function () { memo.save(); }); //操作:アップデート $('#btn-update').on('click', function () { memo.update(); }); //操作:お気に入り登録 $('#btn-fav').click(function () { var fav = $('#btn-fav').attr('class'); if (!fav) { $('#btn-fav').attr('class', 'fav'); } else...
Python
UTF-8
245
2.703125
3
[]
no_license
from lxml import etree doc = etree.parse('provinciasypoblaciones.xml') # 2)Programa que lista todos los municipios raiz=doc.getroot() municipios=doc.findall("provincia/localidades/localidad") for localidad in municipios: print(localidad.text)
Python
UTF-8
171
3.421875
3
[]
no_license
phi = float(22/7) r = int(input("Masukan jari-jari: ")) luas = (phi*r*r) print("Luas lingkaran dengan jari-jari:",r,"cm adalah luas" ,"{:.2f}".format(luas), "cm\u00b2")
Python
UTF-8
1,361
2.703125
3
[]
no_license
import sys, json, re sys.path.append('./database/DAO') from DatabaseManager import DatabaseManager def main(): print "Reading minID" fp = open('ids.txt', 'r') for line in fp: ids = line.strip().split(",") minID = ids[0] maxID = ids[1] fp.close() print "minID: ", minID print "maxID: ", maxID dbm = Data...
Python
UTF-8
493
4.1875
4
[]
no_license
n = int(input('Enter the number of elements:')) arr = [] #taking input from the user for x in range(n): arr.append(int(input())) b=[] j=0#first index last = len(arr)#last index for i in range(len(arr)): if(arr[i]==0):#if the element is 0, then push it in the beginning b.insert(j,arr[i]) j+=1 ...
C++
UTF-8
1,933
3.234375
3
[]
no_license
/* ECFileIO Written by: Nate Fanning */ #include "ECFileIO.h" using namespace std; /* Class ECFileIO */ // Private methods ECFileIO:: ECFileIO(string path) { this->path = path; if(path == "None") { cerr << "No filename" << endl; exit(EXIT_FAILURE); } else { readMode(); } }...
C
UTF-8
706
3.75
4
[]
no_license
#include "myMathFunc.h" #include <stdio.h> int main(){ int a, b; printf("The program takes 2 integers and swaps them"); printf("-----"); printf ("Enter integer a: "); scanf ("%d", &a); printf ("Enter integer b: "); scanf ("%d", &b); int result = swap(&a,&b); printf("A = %d and B = %d; ",a,b); return result; int x, ...
C++
UTF-8
4,200
2.78125
3
[]
no_license
#include "bullet.h" #include <QTimer> #include <QDebug> #include <QList> #include <enemy.h> #include <viewgame.h> extern ViewGame* vgame; // объявили использование указателя на внешнюю глобальную переменную класса ViewGame (для того чтобы через нее можно было добраться до переменных и методов класса Game Bullet::Bul...
C++
UTF-8
411
3.015625
3
[ "MIT" ]
permissive
class Solution { public: vector<int> lexicalOrder(int n) { vector<int> res; solve(1, n, res); return res; } void solve(int target, int n, vector<int> &res) { if (target > n) { return; } res.push_back(target); solve(target * 10, n, res)...
Shell
UTF-8
2,047
3.796875
4
[]
no_license
#!/bin/sh # Abbreviated tree ID for this brain GITREF="$(git ls-tree -d --abbrev=8 HEAD brain | cut -f 1 | cut -f 3 -d' ')" # Depth of git history, for better sorting #GITDEPTH="$(git rev-list HEAD | wc -l)" #But let's use the time of the commit. Let's get it in unix format and format it ourselves, in UTC GITTIME="$(...
Python
UTF-8
9,193
2.8125
3
[ "MIT" ]
permissive
import os import time from astropy import units as u from astropy.time import Time from ..utils import current_time from ..utils import error from ..utils import listify class PanStateLogic(object): """ The enter and exit logic for each state. """ def __init__(self, **kwargs): self.logger.debug("S...
Java
UTF-8
2,654
2.484375
2
[ "Apache-2.0" ]
permissive
package com.lememo.sentinel.freqparamflow; import com.alibaba.csp.sentinel.Entry; import com.alibaba.csp.sentinel.EntryType; import com.alibaba.csp.sentinel.SphU; import com.alibaba.csp.sentinel.slots.block.BlockException; import com.alibaba.csp.sentinel.slots.block.RuleConstant; import com.alibaba.csp.sentinel.slots....
Java
UTF-8
255
3.0625
3
[]
no_license
public class objectTest { public static void main(String[] args) { person p=new person(); p.say("Hello"); } } class person { public String name; public int age; public void say(String content) { System.out.println(content); } }
TypeScript
UTF-8
2,944
2.890625
3
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
import global from './global'; import has from './has'; import { Handle } from './interfaces'; import { QueueItem } from './queue'; /** * Create macro-scheduler based nextTick function. */ function createMacroScheduler( schedule: ((callback: () => void, timeout?: number) => void), clearSchedule: ((handle: any) => ...
C#
UTF-8
488
2.96875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace Aula11_Exercicio2 { class Program { static void Main(string[] args) { int cont = 0; while(cont < 1000) { Cons...
JavaScript
UTF-8
951
3.296875
3
[]
no_license
class Enemy extends Drawable { constructor(sketch, config, x, y, type) { super(sketch, config, x, y); this.pictures = [ config.getImage(0, 16 * type, 16, 16), config.getImage(16, 16 * type, 16, 16)]; this.timer = 0; this.imageIndex = 0; this.hit =...
Markdown
UTF-8
1,799
3.921875
4
[]
no_license
<img src="morning-exercise.png" width="100%" /> # Morning Exercise Create a one page website, using semantic html (using `header`, `main`, `footer` tags as top level elements) where within the `main` tag you have 3 `section` elements. Content & Structure: - Each section should have an `id` starting with `section-[se...
Java
UTF-8
1,414
2.140625
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2012 M3, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
Python
UTF-8
5,993
2.71875
3
[]
no_license
'''Create database models. Profile -- A model used to add more fields to a user. Availability -- A model to model the availabily timings of users. Skill -- Used to model the skills of a user. Notification -- Used to model the notification sent to a user. ''' import uuid from django.db import models from django.cont...
PHP
UTF-8
2,393
2.671875
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); /* * ======================================= * Author : Jagdish * License : Protected * Email : dev@lastingerp.com * * ======================================= */ class Efs_api { public function api_init($url,$fiel...
Python
UTF-8
1,376
2.875
3
[ "MIT" ]
permissive
from django.test import TestCase from django.contrib.auth import get_user_model class ModelTest(TestCase): def test_create_user_with_email_succeful(self): """test that create a new user woth email is succefully done""" email = "test@test.com" password = "test123" user = get_user_m...
TypeScript
UTF-8
203
2.5625
3
[]
no_license
import dayjs from 'dayjs'; function formatTime(value: string, format = 'DD/MM/YYYY HH:mm') { if (!value) return null; else { return dayjs(value).format(format); } } export default formatTime;
C++
UTF-8
1,612
2.65625
3
[]
no_license
#include "gmock/gmock.h" #include "gtest/gtest.h" #include "previewentry.h" using namespace enlighten::lib; class PreviewEntryTest : public testing::Test { public: PreviewEntryTest() { fakeUuid = "3829E5FC-7F3F-4B22-94F3-FB5E2C796026"; fakeDigest = "07cc63f155500a902b21fef7be6585b5"; fakeLevels.push_back(...
C#
UTF-8
1,689
2.6875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using OOD.EMS.Users; namespace OOD.EMS.Execution { [Serializable()] public class OrganizationStructure { private static OrganizationStructure instance; private List<Departmen...
C#
UTF-8
16,697
2.96875
3
[]
no_license
using System; using System.Collections.Generic; using System.Globalization; namespace T.Pratico { public class Loja { // lista de clientes private List<Cliente> clientes = new List<Cliente>(); // lista de instrumentos private List<Instrumento> instrumentos = new ...
C
UTF-8
571
3.015625
3
[]
no_license
#include<stdio.h> int read_file(char path[20]){ FILE *fp = NULL; fp = fopen(path,"r"); char data[8192]; if (fp == NULL) { perror("文件打开失败:\n"); return -1; } fgets(data,8192,fp); fclose(fp); printf("%s\n", data); return 0; } int main(){ char contents[30] = ""; char path[30] = "test.log"; FILE *fd = NU...
C++
UTF-8
611
2.828125
3
[]
no_license
//#include <iostream> //#include <vector> //using namespace std; // //int main() { // int W, L; // cin >> W >> L; // if (W == 0 || L == 0) { // cout << 0 << endl; // return 0; // } // vector<int> v; // v.resize(L); // for (int i = 0; i < L; i++) { // cin >> v[i]; // } // ...
Java
UTF-8
694
2.734375
3
[]
no_license
package ru.universum.Server; /** * Created by Aleksandr on 23.02.17. */ public class Out { String parent = ""; public Out(String parent) { this.parent = parent; } public void printMessage(String string){ System.out.println("[СООБЩЕНИЕ]("+parent+"): " + string); } public voi...
JavaScript
UTF-8
3,757
2.59375
3
[]
no_license
import { Alert } from 'react-native'; import { openDatabase } from 'react-native-sqlite-storage'; var db = openDatabase({ name: 'tableSd.db' }); // This function will create currency table in database export const createTableForCurrency = () => { db.transaction(function (txn) { txn.executeSql( ...
Java
UTF-8
3,682
2.515625
3
[]
no_license
package _02_TripAndJournal.model.dao; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import _00_Misc.HibernateUtil_H4_Ver1; import _02_TripAndJournal.model.JournalDetailVO; import _02_TripAndJournal.model.JournalPhotoVO; public class JournalPhotoDAOHibernate { public...
C#
UTF-8
760
2.75
3
[]
no_license
using UnityEngine; using System.Collections; public class BoltSkill : BaseSkill { // Bolt skills are the most basic spell, ranged, single target, damage of a school type // These are generated at run time for whatever school you want. public BoltSkill(BaseSchool school) :base(){ this.Power = 20; this.Coold...
JavaScript
UTF-8
7,391
2.625
3
[]
no_license
window.addEventListener('load', init, false) let socket let slider, toolbox, info, picker, login let allowedToDraw = true let connected, started = false, loggedIn = false let typePlace, chatHeader, collapsable, chatWindow, chat let lineToDraw = { curr: { X: 0, Y: 0 }, prev: { X:...
C#
UTF-8
11,586
2.671875
3
[]
no_license
using BeanBag.Models; using BeanBag.Services; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using X.PagedList; namespace BeanBag.Controllers { /* This controller is used to send and retrieve data to...
Java
UTF-8
307
2.75
3
[ "Unlicense" ]
permissive
package com.github.diegopacheco.sandbox.scripts.scala.java; public class JavaUseScalaClass { public static void main(String[] args) { Person p = new Person(); p.setName("Diego Pacheco"); p.setAge(26); String toStringResult = p.toString() + " | Java add some string!"; p.show(toStringResult); } }
Java
UTF-8
3,750
1.945313
2
[]
no_license
package app.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.scheduling.annotation.Scheduled; import org.spr...
Markdown
UTF-8
1,471
2.59375
3
[ "Apache-2.0" ]
permissive
--- layout: post title: Beta assessment category: The HMRC Tax Platform --- The move from Alpha phase to Beta phase in HMRC has traditionally been a move from a small private Beta to a public Beta where the number of customers able to use the service is not artifically controlled. If your transition does not fit this ...
PHP
UTF-8
2,179
2.53125
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
<?php class JxAdmin_photos_albums extends JxAdmin { function JxAdmin_photos_albums() { $this->JxAdmin(); $this->table = 'photos_albums'; $this->label = 'photos_albums'; $this->primaryKey = 'albumID'; $this->titles = array('AlbumID', 'Title', ...
Java
UTF-8
956
2.953125
3
[]
no_license
package tw.com.ischool.oneknow.util; import android.text.TextUtils; public class StringUtil { public static final String EMPTY = ""; public static final String WHITESPACE = " "; public static Boolean isNullOrWhitespace(String string) { if (string == null) return true; if (string.equalsIgnoreCase("null")) ...
Shell
UTF-8
202
3.078125
3
[]
no_license
#!/usr/bin/env bash READELF=$(which readelf) GREP=$(which egrep) PROG=${1} [[ -z ${READELF} || -z ${GREP} ]] && exit 1 [[ -z ${PROG} ]] && exit 2 ${READELF} -s ${PROG} | ${GREP} -q "\s(_+)?mcount\b"
Markdown
UTF-8
1,222
2.640625
3
[ "Apache-2.0" ]
permissive
Before we start we need to configure Grafana to use InfluxDB as a data source and load some dashboards. To do this run the following command by clicking on the action block below. ```terminal:execute command: setup-grafana ``` The workshop uses these action blocks for various purposes. Anytime you see such a block wi...
PHP
UTF-8
999
2.59375
3
[ "MIT" ]
permissive
<?php include 'conexao.php'; $nome = $_POST['txtnome']; $email = $_POST['txtemail']; $senha = $_POST['txtsenha']; $cep = $_POST['txtcep']; $num = $_POST['txtnum']; //a variável global $_POST é usada pois o método do formulário é post. /* echo $nome .'<br>'; echo $email .'<br>'; echo $senha .'<br>'; echo $cep .'<br>'; ...
C#
UTF-8
1,774
2.921875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PatternOrientedRefactoring { class Parser { public NodeFactory nodeFactory { set; get; } public Boolean ShouldRemoveEscapeCharactor { set; get; } } public inte...
C++
WINDOWS-1250
4,470
2.625
3
[ "MIT" ]
permissive
#pragma once #define _CRT_SECURE_NO_WARNINGS #define WIN32_LEAN_AND_MEAN #define NOMINMAX #define STRICT #include <Windows.h> #include <vector> #include <string> #include <cassert> #include <cstdarg> #include <map> #include <algorithm> using std::vector; using std::string; using std::min; using std::max; typedef un...
Python
UTF-8
1,009
2.5625
3
[]
no_license
import shutil import os import sys def install_qt_menu_nib(): # For Qt to work on Mac, we need to put the qt_menu.nib directory # at the appropriate location.. #path_src = '/opt/local/Library/Frameworks/QtGui.framework/Versions/4/Resources/qt_menu.nib' path_src = None ...
Python
UTF-8
10,486
3.296875
3
[]
no_license
import math from scipy.integrate import quad from matplotlib import pyplot as plt import numpy as np f = open("20103082.txt", "r") f_out = open("20103082_output","w+") def estimate_parameters(pdf , data): n = len(data) if pdf == "Normal": # by method of Maximum Likelihood # calculate estimated param...
JavaScript
UTF-8
1,219
2.796875
3
[]
no_license
const linksSocialMedia = { github: "SandroJuniorr", instagram: "sandrorogeriojunior", facebook: "maykbrito", youtube: "Rocketseat", twitter: "Rocketseat", }; function changeSocialMediasLinks() { for (let li of socialLinks.children) { const social = li.getAttribute("class"); li.children[0].href = `h...
C
UTF-8
7,169
2.9375
3
[]
no_license
#include "Evolution.h" #include "Snake.h" #include "random.h" #include <stdlib.h> #include <math.h> static void randomInitializer(Matrix matrix, void* ctx) { for(matrix_index_t i = 0; i < matrix->size; i++) { matrix->values[i] = 2.0 * randomFloat() - 1.0; } } static Network makeRandomNetwork(Evoluti...