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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 2,160 | 3.375 | 3 | [] | no_license | class Solution:
def __init__(self):
self.trace={
'N':0,
'S':0,
'E':0,
'W':0
}
def changeDirection(self,curr:chr,direction:chr)->chr:
temp={
0:'N',
1:'E',
2:'S',
3:'W'
}
if cur... |
PHP | UTF-8 | 787 | 3.078125 | 3 | [] | no_license | <?
/**
* Created by Nkconcept.
* Date: 14/05/2015
* Time: 11:14
*/
class Column {
private $index,
$value,
$type;
public function __construct( $index,$value )
{
$this->index = $index;
$this->value = $value;
$this->type = gettype( $value );
}
/**
* @... |
C | UTF-8 | 10,890 | 2.546875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <error.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#define BACKLOG 500
#define PUERTO 3090
#define TAMANIO 100
#include <unistd.h>
#include "funcionesListas.h"
int buscar (char *buffer); //funcion a la cual yo le mand... |
Java | UTF-8 | 6,556 | 1.851563 | 2 | [] | no_license | package com.youngo.core.common;
import java.util.HashMap;
import java.util.Map;
public class MimeTypeToFileType {
private final static Map<String, String> mimeTypeMap = new HashMap<String, String>();
static{
mimeTypeMap.put("application/envoy", "evy");
mimeTypeMap.put("application/fractals", "fif");
mimeTypeM... |
Markdown | UTF-8 | 1,286 | 2.59375 | 3 | [
"MIT"
] | permissive | ### Stewart Falls
[Map](https://www.google.com/maps/place/Stewart+Falls+Trail,+Provo,+UT+84604/@40.3940606,-111.6025517,15.15z/data=!4m5!3m4!1s0x874d8932cf416b57:0x4e60d2a2871d818e!8m2!3d40.3957103!4d-111.6017604)
#### Overall Rating
.
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const interceptor = r... |
C++ | UTF-8 | 574 | 3.09375 | 3 | [] | no_license | #include <QCoreApplication>
#include <QDebug>
enum Colors
{
white=0,
black=1,
red=2,
green=3,
blue=4
};
struct product
{
int weight;
double price;
Colors color;
};
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
product laptop;
laptop.weight=5;
l... |
TypeScript | UTF-8 | 715 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | /* Copyright 2020 Readium Foundation. All rights reserved.
* Use of this source code is governed by a BSD-style license,
* available in the LICENSE file present in the Github repository of the project.
*/
export class Properties {
public otherProperties: { [key: string]: any };
constructor(json: any) {
if ... |
Markdown | UTF-8 | 1,282 | 2.875 | 3 | [] | no_license | # Interview Scheduler
## Description
Interview Scheduler is a Single Page Application (SPA) built using React. It allows users to book and cancel interviews. Data is persisted by API server using a PostgreSQL database.
## Setup
Install dependencies with `npm install`.
## Running Webpack Development Server
```sh
np... |
Markdown | UTF-8 | 15,771 | 3.359375 | 3 | [
"MIT"
] | permissive | ---
author: chrisjmccormick
comments: true
date: 2013-08-15 22:40:19 -0800
layout: post
link: https://chrisjmccormick.wordpress.com/2013/08/15/radial-basis-function-network-rbfn-tutorial/
slug: radial-basis-function-network-rbfn-tutorial
title: Radial Basis Function Network (RBFN) Tutorial
wordpress_id: 5652
tags:
- Cl... |
Markdown | UTF-8 | 1,007 | 3.140625 | 3 | [] | no_license | ---
title: "Express で Basic 認証を有効にする"
date: "2013-10-29"
---
Express に標準で付属している、`basicAuth` ミドルウェアを使用すると、簡単に Basic 認証をかけることができます。
#### app.js
```javascript
var express = require('express');
var app = express();
app.use(express.basicAuth('user', 'pass'));
app.get('/', function(req, res) {
res.send('Private');
}... |
Markdown | UTF-8 | 1,402 | 2.625 | 3 | [
"MIT"
] | permissive | ---
layout: page
title: About Adam N England
permalink: /about/
---
<p>Adam N England is the Director of Engineering at <a href="http://www.rednovalabs.com">Red Nova Labs</a>, and a veteran of the Kansas City startup community. He dabbles in a variety of technologies, including mobile development, web development, Node... |
Java | UTF-8 | 858 | 2.90625 | 3 | [] | no_license |
package calificaciones;
public class CalificacionPractica extends Calificacion{
public CalificacionPractica() {
super();
this.t1 =0.0;
this.t2 = 0.0;
this.proyecto = 0.0;
}
private double t1;
private double t2;
private double proyecto;
public double ... |
C# | UTF-8 | 2,929 | 2.71875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
namespace Service.Infrastructure.Serialize
{
public class BinarySerialize : IBin... |
Java | UTF-8 | 973 | 2.671875 | 3 | [] | no_license | package teamway.shenzhen.utils;
import java.io.File;
import java.io.IOException;
import org.ini4j.Ini;
public class TestStore {
public static void main(String[] args) throws IOException {
File file = new File("d:\\ini");
if (!file.exists()) {
file.mkdirs();
}
file = new File("d:ini\\testSt... |
Python | UTF-8 | 6,375 | 2.859375 | 3 | [
"MIT"
] | permissive | """
Unit test for pipeline_logging module.
Ensures logging handlers are set up correctly by making sure:
1. The right number of expected handlers exists
2. The StreamHandler exists depending on test input
3. The log files that are configured point to the right file location
Original Issue = DC-637
"""
# ... |
Java | UTF-8 | 261 | 1.773438 | 2 | [] | no_license | package org.zpli.observer;
/**
* @Description: TODO
* @Copyright: Copyright © 深圳兆日科技股份有限公司(300333)
* @author: 李宗萍(0677)
* @Date: 2020/3/24 14:03
*/
public interface ObserverIface {
void readData(String data);
}
|
Markdown | UTF-8 | 14,146 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | ---
title: "Interesting Tidbits about Reddot Ruby Conference (rdrc) 2013 - Day One"
authors: ["gio"]
date: 2013-07-06T14:19:00+07:00
tags:
- conference
- ruby
---
It's been quite a month for me, after moving my office from Bandung to Jakarta, I just got married last week and now I'm sitting here in the middle of fores... |
PHP | UTF-8 | 3,548 | 2.5625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | <?php
namespace AlibabaCloud\Dm\V20151123;
use AlibabaCloud\Rpc;
/**
* Api SendTestByTemplate
*
* @method string getBirthday()
* @method string getResourceOwnerId()
* @method string getGender()
* @method string getResourceOwnerAccount()
* @method string getMobile()
* @method string getOwnerId()
* @method st... |
Markdown | UTF-8 | 10,778 | 2.578125 | 3 | [] | no_license | 2019-04-29 23:17:31
# 順序回路
* 組み合わせ回路:時間に依存しない回路。入力値の組み合わせだけで値が決定するもの。論理演算、算術演算の回路など
* 順序回路:時間に依存する回路。状態を持てる回路
フリップフロップという順序回路を用いることで、記憶素子を構成できる。
記憶素子には同期、クロッキング、フィードバックなどが関係する
フリップフロップによってコンピュータで使われる記憶装置全ては実装される。
* 2値素子 (1bit のレジスタ)
* レジスタ (n bit のレジスタ)
* メモリ
* カウンタ
の回路があれば、コンピュータ全体を構築できる
* 本書では予め用意されてるプリミティブの DFF... |
Java | UTF-8 | 1,424 | 3.65625 | 4 | [] | no_license | import java.util.concurrent.Semaphore;
public class BarberShop {
public static Semaphore lockShop = new Semaphore(5);
public static Semaphore lockBarber = new Semaphore(1);
static void customerComesIn() throws InterruptedException {
// TODO: 3/29/20 Synchronize this method, invoked by a Customer ... |
Java | ISO-8859-1 | 1,908 | 3.53125 | 4 | [] | no_license | package metier;
import java.io.File;
import java.util.Date;
public class Personne {
//Donnes membres
private String _nom, _prenom;
Date _datenaiss;
File _photo;
//Constructeur sans photo
public Personne(String nom, String prenom, Date datenaiss) {
try{
//tests
if(nom.isEmpty())
... |
Markdown | UTF-8 | 640 | 3.8125 | 4 | [] | no_license | ### 7.6 同步
竞争的最根本的源头在于临界区是个窗口,在这个窗口内,正确的程序行为要求线程不要交叉执行。为了阻止竞争条件,程序员需要在这个窗口内执行同步访问操作,确保对临界区以互斥的方式访问。
在计算机科学中,如果一个操作(或一组操作)不可分割,我们就称该操作是原子性的(atomic),不能和其他操作交叉。对于系统的其他部分而言,原子操作看起来是瞬间发生的,而这正是临界区的问题:这些区域不是不可分割,也不是瞬间发生的,它们不是原子的。
|
JavaScript | UTF-8 | 763 | 3.296875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | function logDriverNames(drivers){
drivers.forEach(driver => console.log(driver.name));
}
function logDriversByHometown(drivers, hometown){
const matched = drivers.filter(driver => driver.hometown === hometown);
logDriverNames(matched);
}
function driversByRevenue(drivers){
const newDrivers = [...drivers];
r... |
Python | UTF-8 | 634 | 3.09375 | 3 | [] | no_license | import numpy as np
def allocation_acre(acreage: np.ndarray, allocation: np.ndarray):
"""
Given acreage and allocation return allocation per acre
:param acreage:
:param allocation:
:return:
"""
assert acreage.shape == allocation.shape
return (1 / acreage) * allocation
def net_producti... |
Python | UTF-8 | 7,933 | 2.515625 | 3 | [] | no_license | #!/usr/bin/env python
import os, sys, getopt, signal, array
import gobject, gtk, pango, random, time
import treehand
import pyimgrec.imgrec as imgrec
# ------------------------------------------------------------------------
# This is open source image recognition program. Written in python.
version = 1.0
verbose ... |
Java | UTF-8 | 119 | 1.984375 | 2 | [] | no_license | package by.epam.pronovich.homework01.task03;
@FunctionalInterface
public interface Mortal {
boolean isAlive();
}
|
Java | UTF-8 | 113 | 1.796875 | 2 | [] | no_license | package com.tugbakaya.abstractfactorypattern.factories;
public enum FactoryLocation {
TURKEY,
USA,
ENGLAND
}
|
Markdown | UTF-8 | 1,579 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | # VM Escape Attacks
This type of attack occurs when an application escapes from the VM and gains control of VMM, as it escapes the VM privilege and obtains the root privilege.
## Definition
VM escape is where an application running on a VM can directly have access to the host machine by bypassing the hyperviso... |
C++ | UTF-8 | 777 | 2.625 | 3 | [] | no_license | #include <cstdio>
#include <memory.h>
#include <algorithm>
#define MAX_N 1005
#define MAX_G 105
#define MAX_MW 35
using namespace std;
int P[MAX_N];//price
int W[MAX_N];//weight
int MW[MAX_G];
int f[MAX_MW];//一维数组,长度为背包最大容积
int algo(int N, int G){
int result = 0;
for (int g = 0;g < G;g++){
memset(f, 0, sizeof(f));
... |
Python | UTF-8 | 563 | 2.625 | 3 | [] | no_license | import json
import unittest
import test_utils as tu
class TestWithDictionaryStructure(unittest.TestCase):
"""This demo utilizes dictionary structure"""
def setUp(self):
return
def tearDown(self):
return
def test_forget_all_3(self):
json_data = json.dumps(
{
... |
Python | UTF-8 | 1,338 | 3.4375 | 3 | [] | no_license | import requests
from .readers import get_config
from .readers import json2dict
def get_data(api_url):
"get text from api_url (str) and return content (str)"
return requests.get(api_url).text
def extract_latlon(data):
"extract latitudes and longitudes from data (list of dict) and return (tuple of two lis... |
Java | UTF-8 | 1,061 | 3.390625 | 3 | [] | no_license | package com.practice.merge.intervals;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
public class InsertIntoNonOverlappingInterval {
public static List<Interval> insertInterval(List<Interval> intervals, Interval interval){
List<Interval> merged... |
Python | UTF-8 | 1,167 | 3.5 | 4 | [] | no_license | from sortedcontainers import SortedList
class Leaderboard:
def __init__(self):
# Time Complexity: O(1) (init)
# Space Complexity: O(N) (overall)
self.scores = {}
self.sorted_scores = SortedList()
def addScore(self, playerId: int, score: int) -> None:
# Time Complexi... |
TypeScript | UTF-8 | 1,795 | 2.546875 | 3 | [
"MIT"
] | permissive | import path from 'path'
import * as Mustache from 'mustache'
import fs from 'fs'
import { ReactGenSettings, TemplateInfo } from './settings'
import { createFileSync } from './file-helpers'
import { changeCase } from './change-case'
interface TemplateModel {
directory: string
fileName: string
kebabName: string
... |
C++ | UTF-8 | 8,798 | 3.5 | 4 | [] | no_license | /* Author: Cody Girouard (codygirouard@my.unt.edu)
Description: This C++ program allows you to play a
simplified version of Stratego in Linux. The
board state can be saved at any time and can be
loaded any time after. Enemy AI controls red side
while the user controls blue side.
*/
#include "functions.h"
i... |
Java | UTF-8 | 3,718 | 2.9375 | 3 | [] | no_license | package chat;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Panel;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.... |
Python | UTF-8 | 1,954 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env/python
# _*_ coding:utf-8 _*_
# @Time : 2018/7/13 1:08
# @Author : Jingzeng Mo
# @Project: FTP_PROGRAM
import sys
# import math
#
# import subprocess
#
#
# def progress_bar(portion, total):
# """
# total 总数据大小,portion 已经传送的数据大小
# :param portion: 已经接收的数据量
# :param total: 总数据量
# :ret... |
C# | UTF-8 | 1,779 | 3.046875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TaskManager.DataLayer
{
public class UserDataLayer
{
public List<User> GetUsersList()
{
using (CapsuleEntities dbContext = new CapsuleEntities())
... |
Java | UTF-8 | 11,395 | 1.617188 | 2 | [] | no_license | package com.nongjinsuo.mimijinfu.activity;
import android.content.DialogInterface;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.ImageView;
import android.widge... |
JavaScript | UTF-8 | 1,231 | 2.859375 | 3 | [] | no_license | /*
post请求下载文件
@params 地址
@params 参数
@params header头
@params 成功回调
@params 失败回调
*/
export default (_URL, data = {}, _myHeaders = {}, successCb, errorCb) => {
const myHeaders = new Headers({
'Accept': 'application/json',
'Content-Type': 'application/json;charset=utf-8',
'X-Requested-With': 'XM... |
Java | UTF-8 | 982 | 3 | 3 | [] | no_license | package AdvanceJavaConcepts;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class JDBC_Demo {
//read the data from database
public static void main(String[] args) throws ClassNotFoundException, SQLException {... |
PHP | UTF-8 | 4,003 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of cloak.
*
* (c) Noritaka Horio <holy.shared.design@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace cloak\reporter;
use cloak\Result;
use cloak\result\File;
use cloak\writer\FileWriter;
use c... |
Markdown | UTF-8 | 7,517 | 3.328125 | 3 | [
"MIT"
] | permissive | # Data Binding
[TL;DR;](#tldr)
## One-Way + Angular
Custom element properties can be one-way bound easily and natively in Angular. After all, they're just properties. Origami is not needed for that.
```ts
import { Component, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-poly',
templ... |
C++ | UTF-8 | 2,504 | 2.625 | 3 | [
"MIT"
] | permissive | #include "pch.h"
#include "player.h"
#include "engine/core/input.h"
#include "engine/key_codes.h"
player::player() : m_timer(0.0f), m_speed(1.f)
{
}
player::~player()
{}
void player::initialise(engine::ref<engine::game_object> object)
{
m_object = object;
m_object->set_forward(glm::vec3(0.f, 0.f, -1.f));
m_o... |
JavaScript | UTF-8 | 1,123 | 2.671875 | 3 | [] | no_license | // @flow
import storage from 'electron-json-storage';
import * as StorageKeys from '../constants/storage';
import type { Data, MemoData } from '../types';
export default class Storage {
dataCache: Data;
constructor() {
this.dataCache = { memoList: [] };
}
saveMemo(id: number, content: string) {
co... |
Markdown | UTF-8 | 21,466 | 3.1875 | 3 | [] | no_license | # 《算法笔记上机训练实战指南》习题报告
### 作者:wuyangjun
### 时间:2019/7/9
### 主题:简单模拟
----
[TOC]
## [B1001害死人不偿命的(3n+1)猜想](<https://pintia.cn/problem-sets/994805260223102976/problems/994805325918486528>)
### 思路
1. n为1,结束
2. n大于1,若n为偶数,则令n除以2;否则令n为(3n+1)/2
### 代码
```c++
#include <cstdio>
int main() {
int n, cnt = 0;
scanf("%d"... |
Python | UTF-8 | 100 | 2.953125 | 3 | [] | no_license | A, B, V = map(int, input().split())
add = 1 if (V-A) % (A-B) == 0 else 2
print((V-A) // (A-B) + add) |
Java | UTF-8 | 1,804 | 3.546875 | 4 | [] | no_license | package com.rospena.webappgen.utils;
/**
* @author rospena
*/
public class Utils {
private static String className;
private static String getClassName() {
return className;
}
private static void setClassName(String className) {
Utils.className = className;
}
/**
* Este metodo conviert... |
C# | UTF-8 | 2,420 | 2.59375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Api.Models;
using Api.Repositories;
namespace Api.Controllers
{
public class GuestController : ApiController
{
private GuestRepo repo = new GuestRepo();
// ... |
JavaScript | UTF-8 | 1,191 | 2.703125 | 3 | [
"MIT"
] | permissive | import axios from 'axios'
// 一些请求的基本配置
const serviceHttp = axios.create({
baseURL: '', // 接口的域名地址
// timeout: 5000,
withCredentials: true,
headers: { 'Content-Type': 'application/json;charset=utf-8' }
})
// 添加一个请求拦截器 一般用于验证是否登陆
serviceHttp.interceptors.request.use(function(config) {
// Do something before re... |
Java | UTF-8 | 1,704 | 2.59375 | 3 | [] | no_license | package com.example.demo.services;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.que... |
JavaScript | UTF-8 | 1,845 | 2.859375 | 3 | [] | no_license | window.Sessions = {}
// Model
Sessions.model = function () {
this.username = m.prop('')
this.password = m.prop('')
}
Sessions.token = m.prop(localStorage.getItem('token'))
Sessions.signIn = function (username, password) {
// Stub success!
if (true || (username === 'ben') && (password === 'piano')){
retur... |
Python | UTF-8 | 786 | 4 | 4 | [] | no_license | """
1161. Maximum Level Sum of a Binary Tree
Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on.
Return the smallest level X such that the sum of all the values of nodes at level X is maximal.
"""
def maxLevelSum(root):
"""
:type root: TreeNode
:rtype:... |
SQL | ISO-8859-1 | 512,970 | 2.578125 | 3 | [] | no_license | START TRANSACTION;
INSERT INTO workplace (workplaceid, workplace_name)VALUES (1, "Abortmottagning");
INSERT INTO clinic (workplaceid)VALUES (1);
INSERT INTO workplace (workplaceid, workplace_name)VALUES (2, "Akutmottagningen");
INSERT INTO clinic (workplaceid)VALUES (2);
INSERT INTO workplace (workplaceid, workplace_na... |
JavaScript | UTF-8 | 932 | 3.03125 | 3 | [] | no_license | /* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
/* Close the dropdown if the user clicks outside of it*/
window.onclick = function(event) {
if (!event.target.matches('.dropbt... |
Java | UTF-8 | 689 | 2.578125 | 3 | [] | no_license | package me.destro.java.toolkit.serialization.moshi;
import com.squareup.moshi.FromJson;
import com.squareup.moshi.ToJson;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class JavaLocalDateTimeAdapter {
final DateTimeFormatter dateTimeFormatter;
public JavaLocalDateTimeAdap... |
PHP | UTF-8 | 1,904 | 2.71875 | 3 | [] | no_license | <?php
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
ob_start("ob_gzhandler");
else
ob_start();
?>
<?php
include('curl.php');
$time = time();
function go($url)
{
header('Location: ' . $url);
exit;
}
function input($text)
{
return trim(htmlspecialchars($text));
}
function output($text... |
Python | UTF-8 | 842 | 2.640625 | 3 | [] | no_license | import unittest
from handle.handle_driver import HandleDriver
import warnings
class TestMethod(unittest.TestCase):
@classmethod
def setUpClass(cls):
print("类执行之前的方法")
@classmethod
def tearDownClass(cls):
print("类执行之后的方法")
def setUp(self):
print("test-->setup")
war... |
Java | UTF-8 | 3,311 | 2.5 | 2 | [] | no_license | package java24.board.model;
import java.util.Date;
public class ModelArticle {
private Integer articleno = null;// ` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
private String boardcd = "";// ` V ARCHAR(20) NULL DEFAULT NULL,
private String title = "";// ... |
Java | UTF-8 | 968 | 3.71875 | 4 | [] | no_license | package tasksAIU;
import java.util.Scanner;
import java.util.ArrayList;
public class Primeness {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
ArrayList<Integer> primeNums = primesToN(n);
for (int i = 0; i < primeNums.size(); ... |
Python | UTF-8 | 3,919 | 2.875 | 3 | [
"MIT"
] | permissive | # coding=utf-8
"""
Send metrics to a [graphite](http://graphite.wikidot.com/) using the default
interface.
Graphite is an enterprise-scale monitoring tool that runs well on cheap
hardware. It was originally designed and written by Chris Davis at Orbitz in
2006 as side project that ultimately grew to be a foundational... |
Markdown | UTF-8 | 5,910 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | # AppWorks Example - AWAccelerometer
## Contents
1. [About appworks.js](#about-appworksjs)
2. [About this example app](#about-this-example)
3. [Usage](#usage)
4. [Installation](#installation)
## About appworks.js
appworks.js is a javascript (TypeScript) library for building feature rich, hybrid enterprise apps. The ... |
Java | UTF-8 | 3,167 | 1.773438 | 2 | [
"Apache-2.0"
] | permissive | /*
*
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* 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
*
... |
C# | UTF-8 | 1,429 | 2.84375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Multiton
{
class Program
{
static void Main(string[] args)
{
try
{
Console.WriteLine(IPCam.GetInstance("255.255.255.255").IPAddr... |
C++ | UTF-8 | 1,017 | 3.328125 | 3 | [] | no_license | #ifndef BIGINT_H
#define BIGINT_H
/**
Class: CECS 282 C++ for Java Developer
Filename: bigint.h
Purpose: Custom data type to store bigger integer values then the normal Integer datatype
@author Christian Schaf
@version 1.0 11/15/16
*/
#include<vector>
#include<map>
#include<string>
using namespace std;
class Bi... |
Java | UTF-8 | 3,307 | 2.984375 | 3 | [] | no_license | package main;
import main.graph.Graph;
import main.graph.command.CommandFactory;
import main.graph.strategy.direction.GraphDirectionStrategy;
import main.graph.strategy.direction.notoriented.UndirectedGraph;
import main.graph.strategy.direction.oriented.DirectedGraph;
import main.graph.strategy.parse.GraphWeightStrate... |
Java | UTF-8 | 2,866 | 2.171875 | 2 | [] | no_license | package br.com.devx.scenery.web;
import br.com.devx.scenery.manager.ScenerySet;
import br.com.devx.scenery.manager.Scenery;
import br.com.devx.scenery.TemplateAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletConfig;
import javax.servlet.... |
Java | UTF-8 | 1,033 | 2.640625 | 3 | [] | no_license | package edu.epam.compchain.parser.impl;
import edu.epam.compchain.composite.Component;
import edu.epam.compchain.composite.impl.Lexeme;
import edu.epam.compchain.composite.impl.Word;
import edu.epam.compchain.parser.Handler;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
p... |
Java | UTF-8 | 1,206 | 2.53125 | 3 | [] | no_license | package hu.palkonyves.ws.rest;
import hu.palkonyves.ws.rest.dto.ElapsedTime;
import java.util.logging.Logger;
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
@ApplicationScoped
@Path("longRunningService... |
Java | UTF-8 | 4,010 | 2.328125 | 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 hd.controller;
import hd.DAO.IdeaBookDAO;
import hd.DAO.IdeaBookPhotoDAO;
import hd.entity.IdeaBookPhoto;
import hd.entity.Use... |
Markdown | UTF-8 | 1,309 | 2.71875 | 3 | [] | no_license | # Bear Watcher
## Description
Each year between July and September brown bears in the Katmai National Park congregate along the Brooks River. This river is one of the main rivers that Sockeye Salmon swim up to spawn. The brown bears wait in the shallows of the river and catch the salmon as they jump over rocks. This... |
Markdown | UTF-8 | 1,107 | 3 | 3 | [] | no_license | ## Usage
To use:
```
cargo run
```
In a separate shell:
```
nc 127.0.0.1 33333
```
This connects to the rust server that you just started.
## Design
The idea is to have a set of corunning processes that cooperate via a database.
I've not thought this through too thoroughly but the processes might look something l... |
Java | UTF-8 | 1,979 | 2.046875 | 2 | [] | no_license | package com.ezb.jdb.controller.pc.admin;
import com.ezb.jdb.common.PageResult;
import com.ezb.jdb.model.TopicType;
import com.ezb.jdb.service.ITopicTypeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotatio... |
Python | UTF-8 | 1,488 | 3.203125 | 3 | [] | no_license | # 벡터의 차
import numpy as np
import matplotlib.pylab as plt
a = np.array([1,2])
b = np.array([2,1])
c = a - b
plt.annotate('', xy = a, xytext=(0,0), arrowprops=dict(facecolor='blue'))
plt.annotate('', xy =b, xytext=(0,0), arrowprops=dict(facecolor='blue'))
plt.annotate('',xy=a, xytext=b, arrowprops=dict(fa... |
JavaScript | UTF-8 | 5,691 | 2.9375 | 3 | [] | no_license | function FrozenUtils() {
this.load = function(property, defaultValue) {
loadedValue = localStorage[property];
if (localStorage[property] == undefined) {
return defaultValue;
}
return loadedValue;
};
this.loadBool = function(property, defaultValue) {
load... |
Python | UTF-8 | 7,458 | 2.609375 | 3 | [] | no_license | # the actual classifier script for predicting a sentiment using SVM
from __future__ import division
from sklearn import svm
from sklearn import cross_validation
import numpy as np
import features
import polarity
import ngramGenerator
import preprocessing
KERNEL_FUNCTION='linear'
print "Initializing dictionnaries"... |
Python | UTF-8 | 973 | 3.296875 | 3 | [] | no_license | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.ensemble import AdaBoostClassifier
from math import log, pow, e
d = pd.DataFrame({
'X1': [ 1, 2, 2, 2.5, 3],
'X2': [2, 1, 3, 2.5, 3],
'Y': [1, 1, -1, -1, 1]
})
X, Y = d[['X1', 'X2']], d['Y']
c= ['green' if l == -1 el... |
C++ | UTF-8 | 2,460 | 2.515625 | 3 | [
"MIT"
] | permissive | #include <CollisionExporter.h>
#include <Globals.h>
#include <RoomExporter.h>
#include <TextureExporter.h>
enum class ExporterFileMode
{
ModeExample1 = (int)ZFileMode::Custom + 1,
ModeExample2 = (int)ZFileMode::Custom + 2,
ModeExample3 = (int)ZFileMode::Custom + 3,
};
static void ExporterParseFileMode(const std::s... |
Python | UTF-8 | 1,563 | 3.34375 | 3 | [] | no_license | products = [
{'id': 101,'name':'Apple','price':85000,'color':'white'},
{'id': 102,'name':'Samsung','price':55000,'color':'silver'},
{'id': 103,'name':'Vivo','price':22000,'color':'silver'},
{'id': 104,'name':'Redmi','price':12000,'color':'black'},
{'id': 105,'name':'Apple','price':65000,'color'... |
Java | UTF-8 | 5,303 | 1.898438 | 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 com.spleefleague.annotations.processor;
import com.google.auto.service.AutoService;
import com.spleefleague.annotations.Argume... |
Java | UTF-8 | 4,003 | 2.15625 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"MIT",
"EPL-1.0",
"Classpath-exception-2.0",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
C++ | UTF-8 | 4,610 | 3.453125 | 3 | [] | no_license | /********************************************************************
** Author: Cuyler Frisby
** Date: 8/7/2017
** Description: This file contains the function definitions for the
** Board class. The declaration for this class can be
** found in "Board.hpp".
**********************************... |
C | UTF-8 | 1,059 | 3 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include "lib/tlse.h"
TLSE *rto(TLSE *l, int x)
{
TLSE *p = l->prox, *ant = l, *t = NULL;
if (!l)
return l;
while (p != l)
{
ant = p;
p = p->prox;
} // posiciona os ponteiros
while (1)
{
while (p->info != x)
{
... |
Python | UTF-8 | 965 | 3.359375 | 3 | [] | no_license | '''
347. Top K Frequent Elements
2018.1.31
'''
import collections
class Solution:
def topKFrequent(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
#http://blog.csdn.net/lilingyu520/article/details/51339878
#hash,得到<元素,频次>键值对
... |
Markdown | UTF-8 | 2,728 | 3.03125 | 3 | [
"MIT"
] | permissive | ---
title: "Create Subscription and Render Result"
metaTitle: "Vue Apollo Subscription Example | GraphQL Vue 2 Apollo Tutorial"
metaDescription: "Integrate Vue Apollo Smart Subscription to watch for changes in real-time data. We use GraphQL subscriptions as an example to get live data in the Vue app"
---
import Github... |
Java | UTF-8 | 287 | 2.984375 | 3 | [] | no_license | package com.logical.Inheritance.OOPS;
public class LogicalB extends LogicalA{
int i=12;
public void printName() {
System.out.println("PrintName Child"+i);
}
public static void main(String[] args) {
LogicalA a =new LogicalB();
a.printName();
System.out.println(a.i);
}
}
|
Markdown | UTF-8 | 1,742 | 3.15625 | 3 | [] | no_license | # mkdocs-rtd-lightbox
Readthedocs theme for mkdocs with Lightbox support
This is a fork of the [mkdocs](http://www.mkdocs.org) builtin Readthedocs theme which adds support for
[Lightbox](http://lokeshdhakar.com/projects/lightbox2/). Lightbox is small javascript library used to
overlay images on top of the current pa... |
Python | UTF-8 | 3,072 | 2.828125 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
from thesis import BaseGenerator
from sklearn.metrics import pairwise
class BaseModel(object):
def __init__(self, error_threshold):
self.error_threshold = error_threshold
def run(self, x, return_full_prediction=True):
"""
Given a seq... |
C# | UTF-8 | 4,689 | 2.640625 | 3 | [] | no_license | using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Forms;
namespace ForDeeplay
{
public partial class Form1 : Form
{
private static string connStr = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Дмитрий\source\repos\ForDeeplay\ForDeeplay\Database.mdf;In... |
Java | UTF-8 | 2,312 | 2.078125 | 2 | [] | no_license | /* */ package com.orange451.mcwarfare.commands;
/* */
/* */ import com.orange451.mcwarfare.KitPvP;
/* */ import com.orange451.mcwarfare.arena.KitGun;
/* */ import com.orange451.mcwarfare.arena.KitPlayer;
/* */ import com.orange451.mcwarfare.arena.KitProfile;
/* */ import java.util.ArrayList;
/* ... |
Java | UTF-8 | 623 | 2.25 | 2 | [] | no_license | package nl.hu.v2iac.webshopapp.infrastructure;
import java.util.List;
import model.Categorie;
public class CategorieService {
private CategorieDAO categorieDAO = new CategorieDAO(null);
public List<Categorie> listAll() {
return categorieDAO.listAll();
}
public Categorie findCategorie(int id) {
return cate... |
PHP | UTF-8 | 2,037 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DirigeEdicao extends Model
{
use HasFactory;
public $table = 'dirige_edicao';
public $timestamps = false;
protected $fillable = [
'anoLetivoInicial',
'an... |
Java | UTF-8 | 1,853 | 2.15625 | 2 | [
"MIT"
] | permissive | package vdsMain.transaction;
import generic.io.StreamWriter;
import generic.serialized.SeriableData;
import vdsMain.DataTypeToolkit;
import vdsMain.Util;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
//bqx
public class MerklePath extends SeriableData {
/*... |
C | UTF-8 | 223 | 3.1875 | 3 | [] | no_license | //Arrays
#include<stdio.h>
int main()
{
int a[3][3] = {1,2,3,4,5,6,7,8,9};
int i , j;
for (i=0; i<3; i++)
{
for (j=0; j<3;j++)
{
printf("%d\t",a[i][j]);
}
printf("\n");
}
return 0;
}
|
Java | UTF-8 | 353 | 1.882813 | 2 | [
"Apache-2.0"
] | permissive | package com.lucanet.packratcollector.consumers;
public interface MessageConsumer {
// ========================= Interface Variables =========================79
// ============================ Public Methods ===========================79
void run();
void stop();
// =========================== Default Methods... |
Java | UTF-8 | 1,284 | 2.09375 | 2 | [] | no_license | package com.example.reserve.service;
import java.util.List;
import javax.annotation.Nonnull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.reserve.domain.Gallery;
import com.example.reserve.repository.GalleryRepository;
@Service
pub... |
Java | UTF-8 | 5,577 | 1.953125 | 2 | [] | no_license | package br.com.cast.android.exp;
import java.util.List;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.OnActivityR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.