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 | 216 | 1.984375 | 2 | [
"MIT"
] | permissive | package main.java.utils.os;
import main.java.Main;
public class ThisJar {
public static boolean checkJar(){
return !Main.class.getResource("Main.class").toString().split(":")[0].equals("file");
}
}
|
C++ | UTF-8 | 810 | 2.8125 | 3 | [] | no_license | /**
* @file timer.h
*
* @brief The Timer header file.
*
* This file is part of SDENV2, a 2D/3D OpenGL framework.
*
*/
#ifndef TIMER_H
#define TIMER_H
#include <iostream>
// include glew
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
/**
* @brief The Timer class
*/
class Timer
{
public:
Timer(); /... |
C# | UTF-8 | 1,144 | 3.4375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Numerics;
namespace NETFinals
{
class NegativeNumberException : Exception
{ }
class FinalsQuestion1
{
public List<int> GetAllPrimeNumbers(int input)
{
List<int> primeNumbersArr = new List<int>();
bool... |
Java | UTF-8 | 8,973 | 1.695313 | 2 | [] | no_license | package com.pnfsoftware.jeb.rcpclient.parts.units.code;
import com.pnfsoftware.jeb.client.api.IUnitFragment;
import com.pnfsoftware.jeb.core.actions.ActionContext;
import com.pnfsoftware.jeb.core.actions.ActionXrefsData;
import com.pnfsoftware.jeb.core.units.IInteractiveUnit;
import com.pnfsoftware.jeb.core.units.INat... |
Go | UTF-8 | 2,213 | 2.890625 | 3 | [
"BSD-3-Clause"
] | permissive | package hijinks
import (
"sort"
"net/http"
)
const (
ContentType = "application/x.hijinks-html-partial+xml"
)
type ResponseData interface {
http.ResponseWriter
// render the template with the supplied data
Data(interface{})
// load data from specified child handler
Delegate(string, *http.Request) (interface{... |
Markdown | UTF-8 | 575 | 2.828125 | 3 | [
"MIT"
] | permissive | # React Application: Video Browser from Youtube
This is my first attempt in learning React.js building a SPA to browse videos from Youtube website.
1 - In the "01_first_component" branch I create my first React component rendering it to the web page.
2 - In the "02_more_components_and_organization" branch I create th... |
Java | UTF-8 | 10,430 | 1.914063 | 2 | [] | no_license | package alcoholmod.Mathioks.Final.UtilityItems;
import alcoholmod.Mathioks.AlcoholMod;
import alcoholmod.Mathioks.ExtendedPlayer;
import alcoholmod.Mathioks.ExtraFunctions.SyncJutsuPointsMessage;
import alcoholmod.Mathioks.PacketDispatcher;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.re... |
Java | UTF-8 | 7,369 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package com.huaweicloud.sdk.mpc.v1.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collections;
import java.util.HashMap;
import ja... |
C++ | GB18030 | 2,982 | 2.515625 | 3 | [] | no_license | #include "pthread_list.h"
#include "server_socket.cpp"
#include <signal.h>
#define STATE 0
void create_epoll(struct thread_list_node*);
void setnumber(struct thread_list_node* head);
pthread_mutexattr_t mutexattr;
pthread_mutex_t mutex;
pthread_key_t mytmp;
struct thread_list_node* head =
new struct thread_list_node... |
Swift | UTF-8 | 4,636 | 2.671875 | 3 | [] | no_license | //
// DropDownList.swift
// ShoppingCartApp
//
// Created by Vikash Kumar on 22/07/17.
// Copyright © 2017 Vikash Kumar. All rights reserved.
//
import UIKit
//Class function
extension DropDownList {
class func show(in view: UIView, listFrame senderFrame: CGRect, listData: ([String], String), actionHandler: @... |
Java | UTF-8 | 499 | 3.09375 | 3 | [] | no_license | package ejemplo2;
public class Profesor extends Persona {
private String materia;
public Profesor(String nombre, String materia) {
super(nombre);
this.materia = materia;
}
public String getMateria() {
return materia;
}
public void setMateria(String mater... |
JavaScript | UTF-8 | 2,307 | 4.3125 | 4 | [] | no_license |
function hola(nombre, miCallback) {
setTimeout(function () {
console.log("Hola " + nombre);
miCallback(nombre)
}, 1000)
}
function hablar(callbackHablar) {
setTimeout(function () {
console.log("Bla bla bla...")
callbackHablar()
}, 100)
}
function adios(nombre, otroCallback) {
setTimeout(fun... |
C++ | UTF-8 | 1,588 | 3.328125 | 3 | [] | no_license | #include "dictionary.h"
#include <fstream>
using std::ifstream;
dictionary::dictionary() {}
dictionary::dictionary(string & fileName)
{
ifstream fin;
fin.open(fileName.ctr());
char content[100];
while (fin.getline(content, 100))
{
string new_word(content);
int k = key(new_word);
data[k].add(new_word);
}
... |
C | UTF-8 | 556 | 3.484375 | 3 | [] | no_license | #include <stdio.h>
void drawPine(int height, int width ){
for (int i = 0; i < height; ++i){
int starsLimit = i*2+1;
int spaceLimit = i+height-starsLimit;
for (int j = 0; j < spaceLimit; ++j){
printf(" ");
}
for (int j = 0; j < starsLimit; ++j){
printf("*");
}
printf("\n");
}
for (int k = 0... |
Python | UTF-8 | 11,691 | 3.703125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# Imports.
import numpy as np
import math
# Classes for a basic neural network.
# Class for a single neuron. Specialized to use with a multi-layer feed-
# forward neural network using the logistic sigmoid activation funcion.
class Neuron:
# Fields:
# _aWeights - Array of the neuron's ... |
Shell | UTF-8 | 1,881 | 3.4375 | 3 | [] | no_license | #!/bin/bash
#
##################################################################################################################
# Written to be used on 64 bits computers
# Author : Erik Dubois
# Website : http://www.erikdubois.be
#####################################################################################... |
C | UTF-8 | 1,720 | 2.53125 | 3 | [] | no_license | #include "app.h"
#include "debug.h"
#include "sock.h"
int debug;
int main(int argc, char *argv[]){
int retv, sockfd;
uint8_t mip_dst;
uint16_t port;
uint16_t filesize;
char *filename;
char *sockpath;
char *file;
retv = handle_argv(argc, argv, 5, 'c');
if(retv == -1)
exit(EXIT_SUCCESS);
mip_d... |
Java | UTF-8 | 411 | 2.265625 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package revisao_aula2;
/**
*
* @author matheusroberto
*/
class Aluno {
int idade;
String nome;
float nota;
pub... |
Python | UTF-8 | 460 | 2.796875 | 3 | [] | no_license | import sys
sys.stdin = open("같은모양찾기.txt")
T = int(input())
data = [list(map(int, input())) for _ in range(T)]
t = int(input())
target = [list(map(int, input())) for _ in range(t)]
find = 0
for i in range(T-t+1):
for j in range(T-t+1):
cnt = 0
for k in range(t):
for L in range(t):
... |
Java | UTF-8 | 2,399 | 2.609375 | 3 | [] | no_license | package me.togo.demo.disruptor.quickstart;
import com.lmax.disruptor.EventFactory;
import com.lmax.disruptor.YieldingWaitStrategy;
import com.lmax.disruptor.dsl.Disruptor;
import com.lmax.disruptor.dsl.ProducerType;
import me.togo.demo.disruptor.Const;
import me.togo.demo.disruptor.Data;
import org.junit.Test;
import... |
Java | UTF-8 | 2,090 | 2.859375 | 3 | [
"MIT"
] | permissive | package callete.api.services.music.model;
import org.apache.commons.lang.StringUtils;
/**
* The model that represents an album.
*/
public class Album extends Playlist {
private String artist;
private String genre;
private int year;
private String id;
public Album(String artist, String name) {
super(n... |
Markdown | UTF-8 | 2,318 | 2.8125 | 3 | [] | no_license | # ApkDecompiler
Linux版apk反编译工具,主要使用GUI包装了以下几个工具。
<br />
1、反编译资源(可能需要有此框架才能正常反编译:framework-res.apk)
./apktool/apktool d ./test.apk
```
usage: apktool
-advance,--advanced prints advance information.
-version,--version prints the version then exits
usage: apktool if|install-framework [optio... |
Java | UTF-8 | 1,219 | 2.640625 | 3 | [] | no_license | package org.cacheframework.memorystore.command;
import java.util.List;
import org.cacheframework.memorystore.annotations.Command;
import org.cacheframework.memorystore.annotations.ParamLength;
import org.cacheframework.memorystore.request.RequestData;
import org.cacheframework.memorystore.response.ResponseData;
impor... |
Python | UTF-8 | 4,599 | 2.546875 | 3 | [
"Artistic-1.0"
] | permissive | #!/usr/bin/env python3
import argparse
import fileinput
import sys
import os
import numpy as np
# author Giovanna Migliorelli
# version beta 02.06.2020
parser = argparse.ArgumentParser(description='Extract transcripts from some Ensembl annoation on the base of given chunks.')
parser.add_argument('-c', '--chunks',
... |
Java | UTF-8 | 3,566 | 1.945313 | 2 | [] | no_license | package com.maxcar.user.service.impl;
import com.maxcar.base.dao.BaseDao;
import com.maxcar.base.service.impl.BaseServiceImpl;
import com.maxcar.user.dao.ResourceMapper;
import com.maxcar.user.dao.RoleResourceMapper;
import com.maxcar.user.entity.Resource;
import com.maxcar.user.entity.ResourceOption;
import com.maxca... |
Ruby | UTF-8 | 893 | 2.625 | 3 | [] | no_license | class WeatherController < ApplicationController
def show
@weather = Weather.find(params[:id]) rescue nil
if @weather
render json: { weather: @weather }
else
render json: { error: 'That weather id does not exist.' }, status: :not_found
end
end
def by_location
if params[:latitude] ... |
Python | UTF-8 | 564 | 2.90625 | 3 | [
"MIT"
] | permissive | import time
class Timer:
def __init__(self):
self.startTime = time.time()
self.pauseTime = 0
self.invalidTime = 0
def setTime(self, t):
self.startTime = t
def getTime(self):
return time.time() - self.startTime - self.invalidTime
def getNow(self):
retur... |
Java | UTF-8 | 1,513 | 3.015625 | 3 | [] | no_license | import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
public class NonRandom {
private List<Vertex> vertices = new LinkedList<>();
int n;
public NonRandom(int n,int y) {
this.n=n;
//generate ring base
if(n>0) {
vertices.add(new Vertex(0));
for(int i=1... |
Markdown | UTF-8 | 1,889 | 3.296875 | 3 | [
"MIT"
] | permissive | # Walle.Excel.Extension
可以快速使用的跨平台Excel帮助类,可选NPOI版本和EPPLUS版本.
- 针对NCC社区的NPOI版本进行的一些扩展类.
- 针对EPPLUS进行的一些扩展类.
## 安装
https://www.nuget.org/packages/Walle.Excel.EPPlus.Extension/1.2.2
## 查看部分Demo 或运行测试项目
- 将你的实体类继承于```ISheetRow```接口,实体类Demo如下:
```csharp
public class Person : ISheetRow
{
... |
Python | UTF-8 | 412 | 3.625 | 4 | [] | no_license | def sort_array(source_array):
odds = []
for x in source_array:
if x % 2 == 1:
odds.append(x)
odds = sorted(odds)
index = 0
lens = len(source_array)
for i in range(len(source_array)):
if source_array[i] % 2 == 1:
source_array[i] = odds[index]
in... |
Python | UTF-8 | 2,492 | 3.140625 | 3 | [] | no_license | import sys
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as signal
import scipy.fftpack as fftpack
# proper ecgs
# 4
f = open("ecg_test_data5")
fig_size = (10, 6)
# process the input data
data = []
time = []
value = []
for line in f:
entry = line.strip().split(',')
x, y = entry
... |
Python | UTF-8 | 2,075 | 2.984375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import scrapy
# 导入item抓取的节点信息
from scrapy_demo.items import ScrapyDemoItem
'''
爬虫文件
'''
class DoubanSpidersSpider(scrapy.Spider):
# 爬虫名称
name = 'douban_spiders'
# 允许的域名 爬虫
allowed_domains = ['movie.douban.com']
# 入口url,扔到调度器
start_urls = ['http://movie.douban.com/top2... |
C++ | UTF-8 | 3,521 | 3.203125 | 3 | [] | no_license | #include "Mochila.hpp"
Mochila::Mochila(int capacidad)
{
if(capacidad > 0){
this->capacidad_maxima = capacidad;
this->volumen_usado = 0;
}else{
this->volumen_usado = 0;
}
};
Mochila::~Mochila()
{
this->volumen_usado = 0;
this->conjunto.clear();
};
float Mochila::getMochila... |
Markdown | UTF-8 | 1,483 | 2.734375 | 3 | [] | no_license | # restful-blog-microservices-phase3
This project is part of the transformation to microservices of project https://github.com/benjsicam/restful-blog, it was splitted in 4 stages for educational purposes
Take into account that for this stage you have to complete all stage 2, for this stage you will need to create thr... |
C++ | UTF-8 | 864 | 3.0625 | 3 | [] | no_license | #include <cstdlib>
#include <iostream>
#include "FragTrap.hpp"
FragTrap::FragTrap(std::string name)
{
_hitpt = 100;
_maxhitpt = 100;
_nrjpt = 100;
_maxnrjpt = 100;
_lvl = 1;
_name = name;
_meleedmg = 30;
_rangedmg = 20;
_armorreduc = 5;
std::cout << "FR4G-TP " << _name << " is born !" << std::endl;
}
FragTr... |
Java | UTF-8 | 357 | 2.171875 | 2 | [] | no_license | package dados;
import basicas.Usuario;
public class UsuarioDAO {
public void inserirUsuario (Usuario u){
}
public Usuario pesquisarUsuario (String login){
return null;
}
public boolean efetuarLogin (String log, String senha){
if (log.equals (senha)){
return true;
}else {
r... |
Python | UTF-8 | 132 | 2.515625 | 3 | [] | no_license | class ListNode:
def __init__(self, x):
self.val
class Solution:
def addTwoNumbers(self, l1, l2):
res = |
SQL | UTF-8 | 538 | 3.8125 | 4 | [] | no_license | -- Creates a stored procedure ComputeAverageWeightedScoreForUser that computes
-- and stores the average score for a student
-- Procedure AddBonus takes 1 input:
-- user_id, a users.id value, can assume user_id is linked to existing users
DELIMITER //
CREATE PROCEDURE ComputeAverageWeightedScoreForUser (IN user_... |
Java | UTF-8 | 12,917 | 3.046875 | 3 | [] | no_license | package parsleyj.arucoslam;
/**
* Collections of the all native methods used by the app, which were all collected here because the
* linking between Kotlin and the C++ JNI functions does not recognise the types of some parameters
* (in particular, {@code Array<Array<Double>>} were translated to {@code jobject[]} in... |
Java | UTF-8 | 4,348 | 2.71875 | 3 | [] | no_license | /**
*
*/
package com.doughalperin.scheduler;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* Tests Track class
*
*@see Track
*/
public class TrackTest {
final BlockFormat[][] passing = {
{
new BlockFormat("Morning Sessions", new TimeOffset(2, 9, 0), true, true, 180, 180),
new ... |
Java | UTF-8 | 454 | 2.3125 | 2 | [
"Apache-2.0"
] | permissive | package com.hiabby.flytools.gof.singleton;
/**
* @desc 静态内部类
* @date 2018/09/20
**/
public class HolderSingleton {
private static HolderSingleton singleton = null;
private HolderSingleton() {
}
public static HolderSingleton getSingleton() {
return singletonHolder.singleton;
}
;
... |
TypeScript | UTF-8 | 1,442 | 2.53125 | 3 | [] | no_license | import {Component, OnInit} from '@angular/core';
import {Task} from '../shared/models/task';
import * as _ from 'lodash';
import {TaskStorageService} from '../shared/services/task-storage.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
expor... |
C# | UTF-8 | 5,109 | 2.78125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Security.Cryptography;
using System.Web;
using System.Web.Mvc;
using UserTest.Models;
namespace UserTest.Controllers
{
public class PersonController : Controller
{
// GET: Person
... |
JavaScript | UTF-8 | 2,941 | 2.953125 | 3 | [] | no_license |
// Add smooth scrolling to all links
const smoothScroll = function () {
$("a").on('click', function (event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
... |
Java | UTF-8 | 1,698 | 2.328125 | 2 | [] | no_license | package com.yuniss.remotecarcontrol.model;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
@Entity(tableName = "cars")
public class Car {
public Car() {
}
@PrimaryKey(autoGenerate = true)
private int id;
@ColumnInfo(na... |
Java | UTF-8 | 1,033 | 2.4375 | 2 | [] | no_license | package com.googlecode.propidle.client.loaders;
import static com.googlecode.propidle.properties.Properties.compose;
import com.googlecode.totallylazy.Callables;
import com.googlecode.totallylazy.Sequence;
import static com.googlecode.totallylazy.Sequences.sequence;
import java.util.Properties;
import java.util.concu... |
Java | UTF-8 | 879 | 1.875 | 2 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | package org.crosswalk.engine;
import android.util.Log;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import org.apache.cordova.ResourceLoader;
import org.xwalk.core.XWalkView;
public class OfflineXWalkCordovaResourceClient extends XWalkCordovaResourceClient {
static final ... |
Java | UTF-8 | 2,389 | 1.992188 | 2 | [] | no_license | package com.viptrip.wetrip.controller;
import etuf.v1_0.common.Common;
import etuf.v1_0.common.Constant;
import etuf.v1_0.model.base.output.OutputResult;
import etuf.v1_0.model.base.output.OutputSimpleResult;
import com.viptrip.base.common.support.ApplicationContextHelper;
import com.viptrip.util.RegUtil;
import com.... |
JavaScript | UTF-8 | 340 | 2.5625 | 3 | [] | no_license | /**
* - đặt các export name vào trong dấu ngoặc nhọn {} đúng tên đã đặt bên export.
* - có thể đặt lại định danh khác khi import.
*
*/
import {PI, product as sanPham, tongHaiSo, student} from './module-export-name.js';
console.log(PI);
console.log(sanPham);
console.log(tongHaiSo(2,3));
new student(); |
C | UTF-8 | 249 | 2.703125 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int khaddo[5] = { 300, 1500, 600, 1000, 150 };
int a, ans=0, i;
for (i = 0; i < 5; ++i)
scanf("%d", &a), ans += a * khaddo[i];
ans += 225;
printf("%d\n", ans);
return 0;
}
|
Java | UTF-8 | 495 | 2.40625 | 2 | [
"NCSA"
] | permissive | /*
* - 04/2009: Class created by Nicolas Richasse
*/
package net.nlanr.jperf.core;
public enum IperfPacketSizeUnit
{
BITS("b", "Bits"), BYTES("B", "Bytes"), KBITS("k", "KBits"), KBYTES("K", "KBytes");
private String shortcut;
private String description;
IperfPacketSizeUnit(String shortcut, String descriptio... |
C | UTF-8 | 8,174 | 3.03125 | 3 | [] | no_license | #include "ast.h"
TreeNode* CreateTreeNode(Lex_Unit_Cont l_cont, char* value, int lineno) {
TreeNode* node = (TreeNode*)malloc(sizeof(TreeNode));
node->u_type = lex_unit;
node->s_cont = 0;
node->l_cont = l_cont;
node->childnum = 0;
node->child = NULL;
node->lineno = lineno;
switch (node->l_cont) {
c... |
Java | UTF-8 | 4,713 | 2.515625 | 3 | [] | no_license | package Modelos;
import java.time.LocalDate;
/**
*
* @author Grupo2
*/
public class Persona implements Comparable<Persona> {
private int idPersona = -1;
private Patologia patologia;
private int dni;
private String nombre;
private String apellido;
private String email;
private double pe... |
PHP | UTF-8 | 2,477 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
session_start();
//cek user login
if (!isset($_SESSION['userid'])) {
header("location:index.php");
}
//cekleveladmin
if ($_SESSION['level'] != "admin") {
die("ANDA BUKAN ADMIN");
}
?>
<?php
error_reporting(E_ALL ^ (E_NOTICE));
$batas = 20;
$halaman = $_GET['halaman'];
if (empty($halaman)) {
$posisi = 0;... |
C++ | UTF-8 | 3,238 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | #include "agd_record_reader.h"
namespace tensorflow {
using namespace errors;
using namespace std;
using namespace format;
// TODO we should probably do some more checks on this
AGDRecordReader::AGDRecordReader(ResourceContainer<Data>* resource, size_t num_records) :
num_records_(num_records) {
aut... |
Python | UTF-8 | 898 | 2.828125 | 3 | [
"MIT"
] | permissive | import sys
import socket
import time
# target_cmd = str(sys.argv[3]).lower()
server_address = (sys.argv[1], int(sys.argv[2]))
num_times = 1000
curri = 0
start = time.time()
while curri < num_times:
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# print "Starting to conne... |
Java | UTF-8 | 4,938 | 2.625 | 3 | [] | no_license | /*Notice: this program can only sort all the 7-character words by their frequency, but cant pick top 100s.
You may use command bin/hadoop fs -cat /output/part-r-00000 | head n100 to get the corrrect result.
I am still working on the code. */
/*Notice2: If you want to compile the code. Please use the command"javac -c... |
Java | UTF-8 | 1,332 | 2.1875 | 2 | [] | no_license | package kz.regto.json;
import android.os.AsyncTask;
import android.os.SystemClock;
import kz.regto.database.d_balance;
public class SupportBalance extends AsyncTask<String, Balance, Balance> {
Network ntw = new Network();
int currentBalance=0;
int currentID = 0;
@Override
protected void onPreEx... |
Java | UTF-8 | 4,842 | 2.703125 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | package org.sakaiproject.assignment2.logic;
import java.io.OutputStream;
import java.util.regex.Pattern;
import org.sakaiproject.assignment2.model.Assignment2;
public interface ZipExportLogic
{
/**
* The regular expression used for extracting identifying information from the
* folder names. This patte... |
C++ | UTF-8 | 758 | 2.796875 | 3 | [
"MIT"
] | permissive | #include "Application.h"
#include "Resource.h"
Resource::Resource(RESOURCE_TYPE _type, uint UID)
{
if (UID == 0)
id = App->GenerateNewId();
else
id = UID;
type = _type;
}
Resource::~Resource()
{
}
Resource::RESOURCE_TYPE Resource::GetType() const
{
return type;
}
uint Resource::GetId() const
{
return id;... |
Java | UTF-8 | 219 | 2.625 | 3 | [] | no_license | package datastructures.Tries.Contacts;
public class Trie {
TrieNode root;
public Trie() {
this.root = new TrieNode();
}
public void insert(String word) {
root.addWord(word);
}
}
|
Java | UTF-8 | 5,048 | 2.75 | 3 | [] | no_license | import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
class DirectoryServer extends TCPServer {
private InetAddress rightNeighbor;
... |
Markdown | UTF-8 | 415 | 2.5625 | 3 | [] | no_license | +++
title = "Prediction is the Essence of Intelligence"
author = ["Jethro Kuan"]
slug = "prediction_is_the_essence_of_intelligence"
draft = false
+++
We learn models of the world by making predictions. We know how our view of the
world changes when we move our heads and shift our eyes. This is how we obtain
our notion... |
C# | UTF-8 | 4,682 | 2.59375 | 3 | [
"MIT"
] | permissive | using Projeto3Camadas.Code.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using Projeto3Camadas.Code.DAL;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace Projeto3Camadas.Code.BLL
{
public class ClienteBL... |
TypeScript | UTF-8 | 169 | 2.65625 | 3 | [] | no_license | export interface Product {
id:number;
title:string;
description:string;
rating:rating;
}
export interface rating
{
rate:number;
count:number;
}
|
PHP | UTF-8 | 86 | 2.546875 | 3 | [] | no_license | <?php
interface IndentInterface
{
public function all();
public function get($id);
} |
PHP | UTF-8 | 5,499 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
/**
* {LIBRARY_NAME}
*
* PHP Version 5.3
*
* @copyright Emil Johansson 2013
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/emiljohansson
*/
//---------------------------------------------------------------
// Public class
//---------------------------------... |
Python | UTF-8 | 1,043 | 2.578125 | 3 | [
"MIT"
] | permissive | from pyecharts.charts import Line
from pyecharts import options as opts
import pandas as pd
import time
def charthtml(FileName):
data = pd.read_csv(FileName)
# 发布时间类别
category = list(set(data["发布时间"].values.tolist()))
line = Line()
# line.add_xaxis(data['当地时间'].tolist())
for i in cat... |
C++ | UTF-8 | 14,433 | 2.828125 | 3 | [] | no_license | //
// Created by 谢威宇 on 2019-06-07.
//
#include "genetic_worker.h"
#include <random>
#include <algorithm>
#define RAND(a, b) ((rand() % ((b)-(a)))+ (a))
genetic_worker::genetic_worker(port *port1) : worker_base(port1) {}
unsigned seed = time(nullptr);
void genetic_worker::work() {
//initialize the cargo_rule_g... |
Go | UTF-8 | 842 | 2.703125 | 3 | [
"MIT"
] | permissive | package proxy
import (
"io/ioutil"
"testing"
"github.com/stretchr/testify/assert"
)
const testdata = "testdata/avengers.txt"
func TestFileProxy(t *testing.T) {
fp := NewFileProxy(testdata)
data := make([]byte, 8)
n, err := fp.Read(data)
assert.NoError(t, err)
assert.Equal(t, 8, n)
assert.Equal(t, "Iron Ma... |
JavaScript | UTF-8 | 1,643 | 3.125 | 3 | [] | no_license | // El codigo se trajo desde el server.js para limpiar ese archivo
// importamos io desde server.js
const { io } = require('../server');
// Lanzar eventos con socket, el primero conecction, se envia al ciente desde el servidor
io.on('connection', function(socket) {
// Rescatar la ip
console.log("El cliente con... |
JavaScript | UTF-8 | 3,892 | 2.828125 | 3 | [
"MIT"
] | permissive |
d3.csv("tutorial_conposition.csv", function(dataset) {
function gridData() {
var data = new Array();
var xpos = 1; //starting xpos and ypos at 1 so the stroke will show when we make the grid below
var ypos = 1;
var width = 50;
var height = 50;
var click = 0;
// iterate for rows
//data.push(new Array())... |
C# | UTF-8 | 933 | 2.65625 | 3 | [] | no_license | using Shop.Domain.Infrastructure;
using System.Collections.Generic;
namespace Shop.Application.ProductsAdmin
{
[Service]
public class GetProducts
{
private readonly IProductManager _productManager;
public GetProducts(IProductManager productManager)
{
_productManager = ... |
C | UTF-8 | 2,818 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | #define N 10
#include <time.h>
#include <stdio.h>
#include <math.h>
#include <sys/time.h>
#include <stdlib.h>
#include <stddef.h>
#include "mpi.h"
#define posicao(I, J, COLUNAS) ((I)*(COLUNAS) + (J))
int *matrizA, *matrizB, *matrizC, *matrizP, *matrizD;
double speed_up(double ts, double tp)
{
return ts/tp;
}
vo... |
Java | UTF-8 | 1,218 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | package com.zakgof.actr.impl;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import com.zakgof.actr.IActorScheduler;
/**
* Scheduler that creates a single-t... |
Java | UTF-8 | 2,836 | 3.21875 | 3 | [] | no_license | package com.asp.kevinbell.numbershapes;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
public void makeToast(String str... |
Shell | UTF-8 | 382 | 2.671875 | 3 | [] | no_license | #!/bin/bash
echo "***********************"
echo "*******PUSH IMAGE******"
echo "***********************"
IMAGE=app
echo "*******LOGGING to docker********"
docker login -u chsunny548 -p $PASS
echo "***********Tagging image***********"
docker tag $IMAGE:$BUILD_TAG chsunny548/$IMAGE:$BUILD_TAG
echo "***********Pushin... |
Java | UTF-8 | 2,784 | 1.859375 | 2 | [] | no_license |
package com.ge.ef.ese.pocketmobile.europe.service;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotatio... |
C++ | UTF-8 | 4,261 | 2.578125 | 3 | [
"MIT"
] | permissive |
/*
* Copyright (c) 2009 Aleksander B. Demko
* This source code is distributed under the MIT license.
* See the accompanying file LICENSE.MIT.txt for details.
*/
#include <hydra/Thumb.h>
#include <assert.h>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <hydra/Engine.h>
#include <hydra/Exif.h>
... |
C# | UTF-8 | 2,318 | 2.640625 | 3 | [] | no_license | using Minesweeper;
using Xunit;
using Moq;
using Minesweeper.Factory;
using Minesweeper.Service;
namespace MinesweeperTests
{
public class EndToEndTests
{
private readonly Mock<IIO> io;
private readonly ConsoleGameController gameController;
public EndToEndTests()
{
... |
SQL | UTF-8 | 547 | 4.3125 | 4 | [
"Apache-2.0"
] | permissive | SELECT t.subject_id,
t.cohort_start_date,
coalesce(min(o.cohort_start_date), max(t.cohort_end_date)) AS event_date,
CASE WHEN min(o.cohort_start_date) IS NULL THEN 0 ELSE 1 END AS event
FROM @cohort_database_schema.@cohort_table t
LEFT JOIN @cohort_database_schema.@cohort_table o
ON t.subject_id = o.subject_id
... |
TypeScript | UTF-8 | 1,256 | 2.609375 | 3 | [] | no_license | import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { UtilsService } from "app/commons/services/utils.service";
export type SortOrder = {
sort: string,
order: string
}
@Component({
selector: 'app-sort-link',
templateUrl: 'sort-link.c... |
JavaScript | UTF-8 | 1,855 | 2.75 | 3 | [] | no_license | function causeTraverser(obj) {
if (obj.isRoot) {
return obj.stack
}
if (obj.causedBy) {
return causeTraverser(obj.causedBy)
}
return obj.stack
}
/**
* A sublcass of Error that is used to semantically communicate how an error
* should impact error tracking and messages to the client (UI messages)
*... |
C# | UTF-8 | 752 | 3.46875 | 3 | [] | no_license | using System.Collections;
/// <summary>
/// Applies an exponential smoothing filter determined by the
/// timeLag of the smoothed result.
/// </summary>
/// <remarks>
/// The behavior of the filter is independent of the frame rate.
/// Lower frame rates will have less filtering applied.
/// </remarks>
public class Sm... |
C# | UTF-8 | 2,467 | 3.734375 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//Declare the variable as private
//Then declare its public method with get and set accessors
//Notice the "value" keyword
//Auto implementaion - whenever we do not have any restriction on a field, e.g its value can be anything , w... |
Java | UTF-8 | 3,108 | 2.171875 | 2 | [] | no_license | package org.harper.otms.calendar.service;
import org.harper.otms.calendar.service.dto.CancelLessonDto;
import org.harper.otms.calendar.service.dto.ChangeLessonStatusDto;
import org.harper.otms.calendar.service.dto.ChangeLessonStatusResponseDto;
import org.harper.otms.calendar.service.dto.ConfirmCancelDto;
import org.h... |
Markdown | UTF-8 | 702 | 2.796875 | 3 | [
"MIT"
] | permissive | # Serverless Chaos Monkey
A lambda function that randomly chooses a running EC2 server and terminates it.
## Getting started
1. Generate the package
```bash
npm install
npm run package
```
2. upload the package `chaos-monkey.zip` to AWS Lambda.
3. Add and edit `EC2_AWS_REGION` as an env. variable for your funct... |
Java | UTF-8 | 292 | 2.71875 | 3 | [] | no_license | public class SunDemo {
public static void main(String[] args) {
Sun sun1 = Sun.getInstance();
Sun sun2 = Sun.getInstance();
System.out.println(sun1==sun2);
Car car1 = new Car();
Car car2 = new Car();
System.out.println(car1==car2);
}
}
|
Markdown | UTF-8 | 1,137 | 2.765625 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | permissive | The following steps must be taken for the example script to work.
0. Create wallet
0. Create account for gstio.token
0. Create account for scott
0. Create account for exchange
0. Set token contract on gstio.token
0. Create GST token
0. Issue initial tokens to scott
**Note**:
Deleting the `transactions.txt` file will ... |
Python | UTF-8 | 1,012 | 3.75 | 4 | [] | no_license | import pytest
from roman import RomanNumber
def test_zero():
with pytest.raises(ValueError):
RomanNumber.from_arabic(0)
def test_negative():
with pytest.raises(ValueError):
RomanNumber.from_arabic(-1)
def test_overflow():
with pytest.raises(ValueError):
RomanNumber.from_arabic(4... |
C++ | UTF-8 | 1,798 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
bool check[100][100][100] = { false, };
int tom[100][100][100];
int day[100][100][100] = { 0, };
struct bfs
{
int x;
int y;
int z;
};
int main()
{
bool nt = false;
int m, n, h, count=0,d, max=0;
cin >> m >> n >> h;
bfs t, cn;
queue<bf... |
PHP | UTF-8 | 1,449 | 2.5625 | 3 | [] | no_license | <?php
namespace app\controllers;
use vendor\core\Auth;
use vendor\core\Session;
use vendor\core\Request;
use vendor\core\View;
use app\models\Users;
class AuthController extends Auth
{
protected $view;
protected $request;
/*
* p - alxalxalx7
* l - g0l0va
* */
public function __constr... |
Java | UTF-8 | 849 | 3.328125 | 3 | [] | no_license | import java.util.*;
public class LC271 {
public String encode(List<String> strs) {
if (strs.size() == 0) return "empty";
StringBuilder sb = new StringBuilder();
sb.append("startbab");
for (String str:strs) {
str.replaceAll("a", "aa");
sb.append(str);
... |
Python | UTF-8 | 304 | 3.96875 | 4 | [] | no_license | from tkinter import *
def say_something1(thing):
print(thing)
def say_something2(a, b, c):
print(a, b, c)
window = Tk()
window.title("Window After")
window.config(padx=100, pady=50)
window.after(1000, say_something1, "Hello")
window.after(2000, say_something2, 3, 5, 8)
window.mainloop()
|
Swift | UTF-8 | 1,330 | 2.703125 | 3 | [] | no_license | //
// HTTPClient.swift
// structureCoversionDemo
//
// Created by Mobikasa on 09/10/17.
// Copyright © 2017 mobikasa. All rights reserved.
//
import Foundation
import UIKit
import Alamofire
import SwiftyJSON
class HTTPClient : NSObject{
static let shared = HTTPClient()
let CompletionHandler: (Da... |
C++ | UTF-8 | 1,217 | 2.796875 | 3 | [] | no_license | #pragma once
#include <vector>
#include "Car.h"
#include <algorithm>
#include <map>
using std::vector;
using std::ostream;
using std::map;
using std::unique_ptr;
class RepoException {
string msg;
public:
RepoException(string msg): msg{msg}{}
string getMessage() {
return msg;
}
};
class ... |
Java | UTF-8 | 170 | 2.34375 | 2 | [] | no_license | package plactice6;
public class CalcLogic {
public static int tasu(int a , int b) {
return(a + b);
}
public static int hiku(int a , int b){
return(a - b);
}
}
|
Ruby | UTF-8 | 4,351 | 2.84375 | 3 | [
"MIT"
] | permissive | # Module for lame quotes... or not
module Bronze
def self.quote
quotes = [
'El fútbol es como el ajedrez pero sin dados. *-Lukas Podolski*',
'Recibí un golpe en mi tobillo izquierdo. Pero algo me dijo que era mi derecho. *-Lee Hendrie*',
'Bueno, del país no puedo contarles nada... solo puedo ade... |
PHP | UTF-8 | 855 | 2.8125 | 3 | [] | no_license | <?php
define('DBHOST', 'localhost');
define('DBUSERNAME', 'learnphpuser');
define('DBPASSWORD', 'supersecret');
define('DBTABLE', 'myblog');
$dbc = FALSE;
function connectToDB() {
// Connect and select:
global $dbc;
if ( $dbc = @mysql_connect(DBHOST, DBUSERNAME, DBPASSWORD) ) {
return $dbc;
... |
JavaScript | UTF-8 | 2,112 | 3.90625 | 4 | [] | no_license | const BinarySearchTree = require('../../data-structures-algorithms/DSA-BTS/bst');
// linear search
function indexOf(array, value) {
for (let i = 0; i < array.length; i++) {
if (array[i] == value) {
return i;
}
}
return -1;
};
// binary search
function binarySearch(array, value... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.