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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 845 | 2.78125 | 3 | [] | no_license | /**
* Created by Sascha on 12.11.15.
*/
(function () {
setInterval(apply, 250);
function apply() {
var messageContainers = $('.log_screen .messages .msg');
console.log('Apply log level styles to ' + messageContainers.length + ' message containers');
messageContainers.each(function... |
Markdown | UTF-8 | 1,031 | 3.234375 | 3 | [] | no_license | # 小程序列表渲染
1. 语法
1. 可以通过wx:for指令,遍历对应的data数据,从而产生多个节点
1. ```js
<swiper-item wx:for="{{banners}}" class="bannerItem">
```
2. 小程序会将遍历出来的内容默认存放在item变量上
3. 小程序会将遍历出来的下标默认存放在index变量上
4. 小程序可以通过wx:for-item可以自定义遍历数据存放变量的名称
5. 小程序可以通过wx:for-index可以自定义遍历下标存放变量的名称
6. 小程序需要给每个遍历生成的... |
Swift | UTF-8 | 2,924 | 2.984375 | 3 | [
"MIT"
] | permissive | import Foundation
public struct ACL {
public struct Full {
public var immutable : Bool = false
public var you : Bool = false
public var userIds : [String] = []
}
public struct Write {
public var anyUser : Bool = false
public var immutable : Bool = false
publ... |
Java | UTF-8 | 587 | 1.859375 | 2 | [] | no_license | package project.locators.example;
public class GoogleSignInPageLocators {
public static final String SIGNIN_EMAIL_INPUT = "//input[@id='identifierId']";
public static final String SIGNIN_PASSWORD_INPUT = "//*[@id='password']//input[@name='password']";
public static final String NEXT_BUTTON = "//*[text()... |
C++ | UTF-8 | 3,623 | 3.0625 | 3 | [] | no_license | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
//Method A:Using the flag to marked the accessed items
//Easy to understand, but not quick
/*
vector<int> ans;
if (matrix.size() == 0 || matrix[0].size() == 0)
... |
C++ | UTF-8 | 1,375 | 2.859375 | 3 | [] | no_license | #include "Ball.h"
#include <stdlib.h>
#include <time.h>
Ball::~Ball()
{}
bool Ball::isActivated() const
{
return myActivated;
}
Ball::Color Ball::GetColor() const
{
return myColor;
}
void Ball::Activate()
{
myActivated = true;
}
void Ball::RandomColor()
{
RandomColor((int)Ball::Count);
}
void Ball::RandomColo... |
Java | UTF-8 | 1,180 | 2.09375 | 2 | [] | no_license | package com.omelchenkoaleks.roomtest.notelist;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.omelchenkoaleks.roomtest.R;
import com.omelchenkoaleks.roo... |
Python | UTF-8 | 1,698 | 3.328125 | 3 | [] | no_license |
class RobotController():
"""
Class for receiving drive commands from the network
and sending a heart beat and sensor data back through the network.
"""
def __init__(self, networkManager, sensorManager, motorManager):
"""
Initializes the robot controller.
netwo... |
Markdown | UTF-8 | 1,265 | 2.6875 | 3 | [] | no_license |
Simple Files Server
-------------------
This program allows files to be uploaded, via HTTP-POST, and
later read back. It can be used to store files on the move.
You can upload a file like so:
curl --header X-Auth:123456 -X POST -F "file=@/etc/motd" http://localhost:8081/upload
Then get it back again like so:
... |
C# | UTF-8 | 4,879 | 2.53125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Polls.Models;
namespace Polls.UserControls.EditTest
{
public partial class EditTestSlidesUC : ... |
Java | UTF-8 | 745 | 1.5625 | 2 | [] | no_license | package edu.utcluj.sd.tema5.entity;
import javax.annotation.Generated;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="EclipseLink-2.5.2.v20140319-rNA", date="2015-01-03T20:25:48")
@StaticMetamodel(Appusers.class)
public class Appusers_ {
... |
SQL | UTF-8 | 3,624 | 3.5 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Erstellungszeit: 11. Dez 2019 um 16:49
-- Server-Version: 10.4.10-MariaDB
-- PHP-Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... |
Markdown | UTF-8 | 672 | 2.6875 | 3 | [] | no_license | # e-shop
● Clothing store e-shop
● Created a basic, HTML+CSS-only layout
● Implemented sticky navigation bar scrolling to sections.
● Implemented smooth scroll to sections
● Implemented slider
● Added slider initial items, text and link.
● Added dots to slider that user can use to navigate.
● Ad... |
JavaScript | UTF-8 | 446 | 2.578125 | 3 | [] | no_license | var http = require('http')
require("dotenv").config();
var port = process.env.port
http.createServer((req,res) => {
res.writeHead(200, {'Content-Type': 'text/plain'})
res.end('Hello, This is your response. Thank you!')
}).listen(port)
console.log('Server running in port, ', port)
console.log('process.cwd(), '... |
PHP | UTF-8 | 437 | 2.765625 | 3 | [
"Unlicense"
] | permissive | <?php
namespace Vaneves\Lottery;
class Timemania extends Lottery
{
public function listAwards()
{
$awards = parent::listAwards();
$all = $awards[0]->apportionments;
$awards[0]->apportionments = array_slice($all, 0, 5);
$award = new \stdClass;
$award->title = 'Time do... |
Markdown | UTF-8 | 753 | 2.609375 | 3 | [] | no_license | ---
title: Three free MySQL webinars
date: "2012-02-07"
url: /blog/2012/02/07/three-free-mysql-webinars/
categories:
- Databases
---
I'm scheduled to deliver several free MySQL webinars via [Percona][1] and [ODTUG][2] in the upcoming weeks. I hope you can join me:
* February 16 – [Verifying Replication Integ... |
Java | UTF-8 | 5,200 | 1.695313 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "licen... |
Java | UTF-8 | 875 | 3.890625 | 4 | [] | no_license | package javaAssignments;
import java.util.Arrays;
public class BubbleSort {
void bubbleSort(int arr[])
{
int n=arr.length;
for(int i=0; i<n-1;i++)
for (int j=0 ; j<n-i-1; j++)
if(arr[j]>arr[j+1])
{
int temp =arr[j];
arr[j] = arr[j+1];
arr[j+1] =temp;
}
}
void print... |
Python | UTF-8 | 512 | 2.984375 | 3 | [] | no_license | from backend.src.Room import Room
class Apartment(Room):
def __init__(self, Id, available, beds, price, doubleBeds, bathRooms):
self.doubleBeds = doubleBeds
self.bathRooms = bathRooms
super().__init__(Id, available, beds, price)
def __str__(self) -> str:
return "Apartment, id:... |
C++ | UTF-8 | 839 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <stack>
#include <algorithm>
#include <numeric> //accumulate
#define all(v) (v.begin()),(v.end()) //#define all(v) ((v).begin()),((v).end())
#define sz(v) ((int)(v).size()) //#define sz(v) ((int)(v.size()))
using namespace std ;
int main ()
{
stack <int> S;
... |
JavaScript | UTF-8 | 1,281 | 2.65625 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class EventEmittersClass {
stackEmitters = {};
proto;
constructor(proto) {
this.proto = proto;
}
addListeners(eventName, callback) {
if (eventName in this.stackEmitters) {
const findEmit = this.s... |
C# | UTF-8 | 2,566 | 2.59375 | 3 | [] | no_license | using System.Collections.Generic;
using System.Data;
using System.Linq;
using Dapper;
using Keepr.Models;
namespace Keepr.Repositories
{
public class VaultsRepository
{
private readonly IDbConnection _db;
public VaultsRepository(IDbConnection db)
{
_db = db;
}
public Vault Create(Vault n... |
Python | UTF-8 | 1,869 | 3.203125 | 3 | [] | no_license | import pickle
default_tokens = ["[PAD]", "[SOS]", "[EOS]", "[UNK]"]
class Lang:
""" Language dictionary """
def __init__(self, name, word2idx=None, wordcounter=None, idx2word=None):
self.name = name
self.word2idx = {} if word2idx is None else word2idx
self.wordcounter = {} if wordcou... |
Java | UTF-8 | 1,444 | 2.28125 | 2 | [] | no_license | package hg.pojo.dto.ems;
import java.io.Serializable;
import java.util.List;
/**
* 入库单收货确认回传(ems推送给我们)
* @author liujz
*
*/
@SuppressWarnings("serial")
public class WmsStockInConfirmDTO implements Serializable{
/**
* 货主编码
*/
private String owner_code;
/**
* 仓库编码
*/
private Str... |
Ruby | UTF-8 | 1,262 | 3.96875 | 4 | [] | no_license | =begin
+ plus
- minus
/ slash
* asterisk
% percent
< less-than
> greater-than
<= less-than-equal
>= greater-than-equal
=end
# prints text
puts "I will now count my chickens:"
#prints text and then adds 25 to 30 and divides the total by 6
puts "Hens #{25.0 + 30.0 / 6.0}"
#prints texts and then minuses 25 from 100, mul... |
Java | UTF-8 | 10,992 | 1.929688 | 2 | [] | no_license | package com.example.leand.bilanztracker.Activitys;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.InputFilter;
import android.view.View;
import android.widget.AdapterView;
imp... |
Python | UTF-8 | 4,434 | 2.765625 | 3 | [] | no_license | import urllib.request, urllib.parse, urllib.error
import json
import api_keys as keys
import lang_detection as langDet
import os
import webbrowser
def connect_to_api(url) :
request = urllib.request.Request(url)
request.add_header("X-Naver-Client-Id", keys.file_trans('client_id'))
request.add_header("X-Nave... |
C# | UTF-8 | 578 | 2.5625 | 3 | [] | no_license | using CodeFirst.Entities;
using Microsoft.EntityFrameworkCore;
namespace CodeFirst.DataAccess.Mappings
{
internal abstract class CourseMappings
{
internal static void Map(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Course>()
.Property(s => s.Id)
... |
Java | UTF-8 | 21,087 | 1.8125 | 2 | [] | no_license | package hudson.plugins.PerfPublisher.projectsAction;
import hudson.model.Run;
import hudson.model.FreeStyleProject;
import hudson.model.Job;
import hudson.model.Project;
import hudson.model.Result;
import hudson.model.Run;
import hudson.plugins.PerfPublisher.AbstractPerfPublisherAction;
import hudson.plugins.PerfPubli... |
C# | UTF-8 | 686 | 3.296875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EjerciciosDeFundamentosEnCchar
{
class Ejercicio06
{
public void PositioNegativo() {
int num;
Console.WriteLine("ingrese un numero");
num ... |
Python | UTF-8 | 666 | 2.96875 | 3 | [] | no_license | from math import exp
def ode_ralston_1step(dfunc, xi, yi, h):
k1 = dfunc(xi, yi)
k2 = dfunc(xi + 3*h/4, yi + 3*k1*h/4)
yip1 = yi + (k1/3 + 2*k2/3)*h
return yip1
def deriv(x, y):
return 4*exp(0.8*x) - 0.5*y
def exact_sol(x):
return 4.0/1.3*( exp(0.8*x) - exp(-0.5*x) ) + 2*exp(-0.5*x)
# Initia... |
Python | UTF-8 | 4,377 | 2.859375 | 3 | [] | no_license | import os
import glob
import psycopg2
import pandas as pd
import getpass
from sql_queries import *
def process_song_file(cur, filepath):
"""
Process the .json song file <filepath> using postgresql cursor <cur>.
If relevant, add entries into the song table and artist table.
"""
# open song file
... |
Java | UTF-8 | 13,368 | 2 | 2 | [] | no_license | /**
* Abiquo community edition
* cloud management application for hybrid clouds
* Copyright (C) 2008-2010 - Abiquo Holdings S.L.
*
* This application is free software; you can redistribute it and/or
* modify it under the terms of the GNU LESSER GENERAL PUBLIC
* LICENSE as published by the Free Software Foundatio... |
Markdown | UTF-8 | 2,083 | 2.59375 | 3 | [] | no_license |
# React Native Video Call Demo App with agora.io
A demo application made with React Native to show how to make a recorded video call with https://agora.io.
The purpose of the demo is just to build something that works, and is way far to be a complete app
## **WHAT'S INCLUDED?**
**REACT NATIVE APP**
I started from [th... |
PHP | UTF-8 | 7,316 | 2.765625 | 3 | [] | no_license | <?php
require_once 'Color.class.php';
require_once 'Vertex.class.php';
require_once 'Vector.class.php';
class Matrix
{
const IDENTITY = '0';
const SCALE = '1';
const RX = '2';
const RY = '3';
const RZ = '4';
const TRANSLATION = '5';
const PROJECTION = '6';
private $_matrix;
public static $verbose = ... |
Java | UTF-8 | 513 | 1.875 | 2 | [] | no_license | package br.com.rarp.control;
import java.sql.SQLException;
import br.com.rarp.model.Estado;
import br.com.rarp.model.bo.EstadoBusiness;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
public class EstadoCtrl {
public ObservableList<Estado> getEstados() throws SQLExcep... |
Go | UTF-8 | 3,529 | 3.234375 | 3 | [
"MIT"
] | permissive | package transformers_test
import (
"testing"
. "github.com/nikolaydubina/go-featureprocessing/transformers"
"github.com/stretchr/testify/assert"
)
func TestSampleNormalizserL1(t *testing.T) {
samples := []struct {
name string
input []float64
output []float64
}{
{"basic", []float64{1, 2, 3, 4}, []floa... |
Go | UTF-8 | 863 | 3.171875 | 3 | [] | no_license | package DFS
import "Go-datastructures-algorithm/Graph"
import "Go-datastructures-algorithm/Stack"
func UndirectedDfs(g *Graph.UndGraph, v Graph.VertexId, fn func(Graph.VertexId)) {
s := Stack.New()
s.Push(v)
visited := make(map[Graph.VertexId]bool)
for s.Len() > 0 {
v:=s.Pop().(Graph.VertexId)
if _,ok:=visi... |
C++ | UTF-8 | 4,713 | 4.0625 | 4 | [] | no_license | /**
* @author Yu Du, yd2am
* @filename topological.cpp
* @date 2019.11.30
* @details This is the program to find topological sort from a given text file storing edges.
*/
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <queue>
#include <vector>
#include <list>
#include <string>
using namespace std... |
Ruby | UTF-8 | 376 | 3.421875 | 3 | [] | no_license | #!/usr/bin/ruby
# Anagram exercise
class Anagram
def initialize(word)
@word = word.downcase
end
def match(wordlist)
wordchars = @word.chars.sort
matches = wordlist.each_with_object([]) do |test, list|
ltest = test.downcase
testchars = ltest.chars.sort
list.push(test) if test... |
C++ | UTF-8 | 781 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
int main(){
// char input[100];
// cout << "Enter first string : ";
// cin.getline(input, 100);
// int len = strlen(input);
// cout << "Length : " << len << endl ;
// char input1[100];
// cout << "Enter second string :";
// ci... |
Java | UTF-8 | 6,930 | 2.046875 | 2 | [] | no_license | package br.server.model.entities;
/*
* Document : Usuario.java
* Created on : 25/05/2013, 14:21:05
* Author : Caio
*/
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
im... |
Python | UTF-8 | 5,871 | 2.671875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 8 17:58:12 2017
@author: steinrob
"""
import copy
def xray_variables():
"""Gives the names of the two X ray bands included in the data, as well
as the associated variable for measuring emission in each band.
:return: list containing band names, and list con... |
Java | UTF-8 | 593 | 2.953125 | 3 | [] | no_license | package basic;
import java.util.Scanner;
public class ch25 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int input = sc.nextInt();
String [] arr = String.valueOf(input).split("");
String temp = "";
for(int i = 0; i < arr.length; i++) {
for(int j=i; j < ar... |
Java | UTF-8 | 1,219 | 2.171875 | 2 | [] | no_license | package by.shulga.softarex.questionnaireportal.entity;
import javax.persistence.*;
@Entity
public class ResponseEntry extends BaseEntity {
@Column
private String responseEntryValue;
@ManyToOne(optional = false, cascade = CascadeType.MERGE)
@JoinColumn(name = "field_id")
private Field field;
... |
JavaScript | UTF-8 | 8,478 | 2.546875 | 3 | [] | no_license | /**
* Script para generación automática de archivos sql
* ## Modo de uso
*
* node index.js rutaAlArchivoConFormato [rutaOutput] [rutaCSV]
*
* Ejemplo: node index.js formatos/postgres.json postgres.sql
*/
const fs = require('fs')
const path = require('path')
const readline = require('readline')
if (process.stdou... |
C++ | UTF-8 | 3,601 | 2.859375 | 3 | [] | no_license | #include "spooky.h"
#include "Murmurhash3.h"
#include "city.h"
#include <vector>
#include <map>
#include <fstream>
#include <string>
#include <sys/time.h>
using namespace std;
typedef struct timespec timespec;
class AutoTimer
{
public:
AutoTimer() {
gettimeofday(&startTime, NULL);
}
~AutoTimer() {
tim... |
Java | UTF-8 | 314 | 2.421875 | 2 | [] | no_license | package chap10;
/**
* 第67条:避免过度同步。
*
* 为了避免死锁和数据损坏,千万不要从同步区域内部调用外来方法。比如调用接口中的方法,这样你就失去了对客户端的控制。
* 另外还要限制同步区域内部的工作量。
*/
public class Law67 {
}
|
TypeScript | UTF-8 | 475 | 2.84375 | 3 | [] | no_license | export enum RequestMethodType {
GET = 'GET',
}
interface RequestConfig {
method: RequestMethodType;
}
export function fetchAPI(url: string, config: RequestConfig) {
const defaultConfig = getDefaultConfig();
return fetch(url, {
...defaultConfig,
method: config.method,
}).then((response) => {
ret... |
Python | UTF-8 | 177 | 2.515625 | 3 | [] | no_license | from fenetre import Fenetre
app = Fenetre() #création d'un objet fenete (cf constructeur de la classe pour voir ce que ca fait)
app.window.mainloop() #demarrage de la fenetre
|
Java | UTF-8 | 522 | 2.515625 | 3 | [] | no_license | package test;
import Entidades.Arreglo;
public class PruebaArreglo {
public static void main(String[] args) {
int arr1[]={1,2,3,4,5,6,7,8,9};
int arr2[][]={{1,2,3},{4,5,6},{71,8,9},{1},{15,11}};
String vocales="y? arraca o no arranca?";
... |
Java | UTF-8 | 1,254 | 2.40625 | 2 | [] | no_license | package com.rogy.smarte.fsu;
import com.rogy.smarte.entity.db1.Signalstype;
import com.rogy.smarte.entity.db1.Switch;
/**
* 断路器相关信息的Cache。
*/
public class SwitchCache {
private volatile int switchID;
private volatile Integer collectorID;
private volatile ZDataValue[] zDataValues;
private SwitchCache(int switch... |
JavaScript | UTF-8 | 1,129 | 2.515625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
// const auth = require('../../middleware/auth');
// Location Model
const Location = require('../../Models/Location');
// @route GET api/locations
// @desc Get All locations
// @access Public
router.get('/', (req, res) => {
Location.find()
... |
Java | UTF-8 | 3,232 | 2.1875 | 2 | [
"MIT"
] | permissive | /*
* This class is auto generated from the Infobip OpenAPI specification
* through the OpenAPI Specification Client API libraries (Re)Generator (OSCAR),
* powered by the OpenAPI Generator (https://openapi-generator.tech).
*
* Do not edit manually. To learn how to raise an issue, see the CONTRIBUTING guide
* or co... |
Ruby | UTF-8 | 431 | 3.28125 | 3 | [] | no_license | print "何月ですか:"
month = gets.to_f
if month > 12
puts "有効な数字ではありません"
end
case month
when 1 then
puts"一月"
when 2 then
puts"2月"
when 3 then
puts"3月"
when 4 then
puts"4月"
when 5 then
puts"5月"
when 6 then
puts"6月"
when 7 then
puts"7月"
when 8 then
puts"8月"
when 9 then
puts"9月"
when 10 then
puts"10月"
when... |
Java | UTF-8 | 2,931 | 2.921875 | 3 | [] | no_license | package com.eshop.model;
import java.util.Date;
/**
* User Class - Defines the attributes of a user.
*/
public class User {
/**
* The Enum USER_TYPE.
*/
public enum USER_TYPE {
/** User is an employee. */
EMPLOYEE,
/** User is an affiliate. */
AFFILIATE,
/** User is not an employee o... |
PHP | UTF-8 | 3,377 | 3.203125 | 3 | [
"MIT"
] | permissive | <?php
include_once("../config/variables.php");
include_once('../config/Database.php');
if (isset($_POST['signup'])) {
// echo $_POST['full_name'];
$full_name = htmlspecialchars($_POST['full_name']);
$email = htmlspecialchars($_POST['email']);
$password = htmlspecialchars($_POST['password']);
$pass... |
C++ | UTF-8 | 559 | 2.828125 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n, h=0, total=0;
bool wasBelow=false;
char d;
cin>>n;
while(n--){
cin>>d;
... |
JavaScript | UTF-8 | 1,159 | 2.96875 | 3 | [] | no_license | $('form').submit(function(e){
e.preventDefault();
console.log($(this).serialize());
$.ajax({
url: e.target.action, // form's action attribute, a URL on the API
method: 'post',
data: $(this).serialize(), // serialized form data
success: function(response){
console... |
C | UTF-8 | 689 | 2.71875 | 3 | [] | no_license | #ifndef _LIBLIST_H_
#define _LIBLIST_H_
enum {
list_eok = 0,
list_enullptr = -1,
list_enomem = -2,
list_eempty = -3,
};
typedef struct listnode_t {
void *data;
struct listnode_t *next;
struct listnode_t *prev;
struct listnode_t *top;
} listnode_t;
listnode_t *list_create(void);
listno... |
Python | UTF-8 | 1,918 | 3.203125 | 3 | [
"MIT"
] | permissive | from timex import ground,tag
from graph_representation.word import Word
from mx.DateTime.DateTime import gmt
def timexWrapper(text):
"""
wrap timex
@type text: list [word] (ordered by index)
@param text: the text to be tagged with time expressions
@rtype tuple (list [TimeE... |
JavaScript | UTF-8 | 2,116 | 2.546875 | 3 | [] | no_license | import $ from "jquery";
import Supaplex from '../../supaplex.js';
class KB
{
constructor()
{
this.keySpace = false;
this.keyLeft = false;
this.keyRight = false;
this.keyUp = false;
this.keyDown = false;
let k = this;
$(window).keydown(function(e) {
switch(e.keyCode) {
case 32: k.keySpace =... |
C | GB18030 | 2,236 | 3.609375 | 4 | [] | no_license | #include "list.h"
//ͷ巨
void listHeadInsert(pStudent_t *ppHead,Student_t **ppTail,int val)
{
pStudent_t pNew=(pStudent_t)calloc(1,sizeof(Student_t));
pNew->num=val;
if(NULL==*ppHead)//жǷΪ
{
*ppHead=pNew;
*ppTail=pNew;
}else{
pNew->pNext=*ppHead;
*ppHead=pNew;
}
}
//ӡ
void listPrint(pStudent_t pHead)
{
whi... |
TypeScript | UTF-8 | 447 | 2.59375 | 3 | [
"MIT"
] | permissive | import type {
NextFunction,
Request,
RequestHandler,
Response,
} from "../../deps.ts";
export const RE_FAVICON_ICO = /(favicon\.ico)($|\?)/;
export const isFavicon = (req: Request) => RE_FAVICON_ICO.test(req.url);
export function favicon(): RequestHandler {
return (req: Request, res: Response, next: NextFu... |
JavaScript | UTF-8 | 5,673 | 4.375 | 4 | [] | no_license | // Common data structure where elements are stored in a node.
// node has two pieces of information. The element itself(or the data) and the reference to the next node.
// Like arrays, linked list can be used to implement other data structures.
// Comparison
/*
Array Linked List
... |
PHP | UTF-8 | 3,295 | 2.578125 | 3 | [] | no_license | <?php
/**
* This is the model class for table "wiki_posts_abuses".
*
* The followings are the available columns in table 'wiki_posts_abuses':
* @property integer $post_data_id
* @property integer $user_id
*/
class WikiPostsAbuses extends CActiveRecord
{
/**
* Returns the static model of the specified AR class... |
Java | UTF-8 | 292 | 1.820313 | 2 | [] | no_license | package org.gradle.test.performance93_5;
import static org.junit.Assert.*;
public class Test93_430 {
private final Production93_430 production = new Production93_430("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} |
Python | UTF-8 | 3,184 | 2.625 | 3 | [] | no_license | from _datetime import datetime
import unittest, os
from flaskpoll import app, db, bcrypt
from flaskpoll.models import User, Poll
class UserModelCase(unittest.TestCase):
def setUp(self):
basedir = os.path.abspath(os.path.dirname(__file__))
app.config['SQLALCHEMY_DATABASE_URI']= \
... |
Rust | UTF-8 | 2,190 | 2.75 | 3 | [
"MIT"
] | permissive | use std::fs::File;
use std::io::Write;
use tempdir::TempDir;
use toy_core::prelude::*;
use toy_plugin_file::config::ReadConfig;
use toy_plugin_file::service::Read;
#[tokio::test]
async fn read_glob() {
let root = preapre_temp();
let mut f = File::create("test-1.csv").unwrap();
writeln!(f, "column1,column2... |
Python | UTF-8 | 6,326 | 2.703125 | 3 | [] | no_license | # coding=utf8
import logging
import sys
import xlrd
from django.db import transaction
from bigfish.utils.django.config_settings import config_django
config_django()
from bigfish.apps.textbooks.models import Unit, Textbook
from bigfish.apps.knowledgepoint.models import KnowledgePoint
logger = logging.getLogger('back... |
Markdown | UTF-8 | 4,556 | 2.8125 | 3 | [] | no_license | # What The Hack - Intro To Kubernetes
## Introduction
This intro level hack will help you get hands-on experience with Docker, Kubernetes and the Azure Kubernetes Service (AKS) on Microsoft Azure. Kubernetes has quickly gone from being the shiny new kid on the block to the defacto way to deploy and orchestrate containe... |
Java | UTF-8 | 1,212 | 2.296875 | 2 | [] | no_license | package com.naruto.didi2.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import com.naruto.didi2.R;
public class InstanceActivity extends AppCompatActivity implements View.OnClickListener {
private Button testbug;
... |
Python | UTF-8 | 2,068 | 3.015625 | 3 | [] | no_license | import requests
import random
url = 'https://www.nlotto.co.kr/common.do?method=getLottoNumber&drwNo=837'
response = requests.get(url, verify = False) #인증서에 대한 검사는 하지 않고 불러옴(생략가능)
lotto_data = response.json() # dic형
real_numbers = set([])
for key, value in lotto_data.items(): # item(): key와 value를 함께 추출함
if 'd... |
C# | UTF-8 | 1,746 | 3.53125 | 4 | [] | no_license | using System;
using System.Threading.Tasks;
namespace Chapter1
{
public static class Program6
{
public static void Main()
{
Console.WriteLine("Programming C#, Chapter 1:");
Console.WriteLine("Please choose a number to run the program.");
... |
Markdown | UTF-8 | 431 | 2.6875 | 3 | [] | no_license | ---
title: "Delete"
draft: false
---
Source: https://github.com/GoesToEleven/GolangTraining
{{% panel="Delete" header="Delete" theme="default" %}}
```go
func main() {
mySlice := []string{"Monday", "Tuesday"}
myOtherSlice := []string{"Wednesday", "Thursday", "Friday"}
mySlice = append(mySlice, myOtherSlice...)
fm... |
JavaScript | UTF-8 | 238 | 3.109375 | 3 | [] | no_license | var grades = {'yoondev01': 10, 'yoondev02': 20, 'yoondev03': 30};
/*
key: yoondev01 / value: 10
key: yoondev02 / value: 20
key: yoondev03 / value: 30
*/
for (key in grades) {
console.log("key: " + key + " / value: " + grades[key]);
} |
Shell | UTF-8 | 2,416 | 3.890625 | 4 | [] | no_license | #!/bin/bash
NEW_USER=${1}
NEW_UIDGID=${2}
usage() {
echo
}
sanity() {
# check variables
if [ -z "${NEW_USER}" ] ; then
echo "command *user/group* uid/gid"
get_next_available && exit 1
fi
if [ -z "${NEW_UIDGID}" ] ; then
echo "command user/group *uid/gid*"
get_next_ava... |
Python | UTF-8 | 11,412 | 3.125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module the handles python script execution
Manages, and creates BuildObjects that are tailored for executing python
scripts.
See Also:
makeprojects.cleanme, makeprojects.buildme
@package makeprojects.python
@var makeprojects.python.BUILD_LIST
Default build_rule... |
Java | UTF-8 | 1,455 | 3.375 | 3 | [] | no_license | package com.test;
public class DoubleU {
public static void main(String[] args) {
int a1 = 15;
int b = 4*a1-3;
DoubleU a= new DoubleU();
int[][] arr = a.initArray(a1);
/*
for (int i=0; i<arr.length; i++){
for (int j=0; j<arr[i].length;j++){
... |
JavaScript | UTF-8 | 3,951 | 2.640625 | 3 | [
"MIT"
] | permissive | //顶部导航栏横线移动
function moveNavPointer(i){
var moveWin = document.getElementById("nav_pointer");
var li1 = document.getElementById("nav1");
var li2 = document.getElementById("nav2");
var li3 = document.getElementById("nav3");
var li4 = document.getElementById("nav4");
var temp = 0;
switch (i){
case 1:
... |
JavaScript | UTF-8 | 2,289 | 2.796875 | 3 | [] | no_license | import mongoose from "mongoose";
//영상을 넣으면 DB가 무거워지기 때문에 text 데이터베이스로 활용함.
//여기서는 내 Video들의 형태를 정의함
//해야할것 하나는 model즉 document name이고 다른 하나느 schema(형태) 임, model은 실제 data임
//즉 파일은 fileUrl, title, description, views, createdAt, comment, creator를 가짐
const VideoSchema = new mongoose.Schema({
fileUrl: {
//video의 링크를 ... |
C++ | UTF-8 | 4,082 | 3.359375 | 3 | [] | no_license | #include "Array.h"
#include <iostream>
#include <stdexcept>
#include <exception>
using namespace std;
Array::Array(const Array::size_type& n)
throw(bad_alloc, invalid_argument)
{
First = 0;
Count = Size = n;
elems = new value_type[Size];
for (UINT i = 0; i < Size; i++)
elems[i] = 0;
}
Array::Array(const iterato... |
Shell | UTF-8 | 368 | 3.21875 | 3 | [] | no_license | #! /bin/sh
# This writes debug output to the text file below
exec > /tmp/debug-my-script.txt 2>&1
# This will run on startup on those scripts do not have a defined path
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
case "$1" in
start)
echo "Starting mo_co"
mo_co -id Linux &
;;
stop)
echo "Sto... |
PHP | UTF-8 | 4,106 | 2.9375 | 3 | [] | no_license | <?php
require_once 'testConfig.php';
// todo rearrange this for our project
/**
* To be used in setUp() and tearDown() methods for tests
*
* @param null
*
* @return null
*/
function createTestDatabase() {
$filename = '../softeng2Final.sql';
$mysqli = new mysqli(DBAddr, DBUser, DBPassword);
if ($mysqli->co... |
Java | UTF-8 | 3,753 | 2.390625 | 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 email;
import java.util.ArrayList;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.ma... |
Java | UTF-8 | 364 | 2 | 2 | [] | no_license | package com.ivoyant.stockexchange.service;
import com.ivoyant.stockexchange.model.StockOrder;
public interface StockService {
StockOrder addStockOrder(StockOrder StockOrder);
Iterable<StockOrder> getAllStockOrders();
StockOrder getStockOrderById(Long id);
StockOrder updateStockOrder(Long id, StockOrder StockOrder... |
PHP | UTF-8 | 2,510 | 2.53125 | 3 | [] | no_license | <?php
//put the codes in buffer and execute all at same time when flush
ob_start();
include "../php/config.php";
include "../php/secret_password.php";
$tb_name = 'Post';
$POST_ID=$_POST['POST_ID'];
$EMAIL=$_POST['EMAIL'];
$TITLE =$_POST['TITLE'];
$ISBN =$_POST['ISBN'];
$AUTHOR =$_POST['AUTHOR'];
$IMAGE_URL =$_POST[... |
TypeScript | UTF-8 | 1,390 | 2.875 | 3 | [] | no_license | import { Command } from './../common/Command';
import { EventDispatcher } from "../common/event/EventDispatcher";
import { CommandEvent } from "./event/CommandEvent";
export class Connection extends EventDispatcher
{
protected _address: string;
protected _command: Command;
protected _connection: WebSoc... |
Java | UTF-8 | 1,537 | 2.390625 | 2 | [] | no_license | package sk.fri.uniza.recyclerviewdemo.model;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.io.IOException;
import java.io.I... |
C++ | UTF-8 | 1,304 | 2.546875 | 3 | [
"MIT"
] | permissive | #ifndef SHARP_LATLONG_HPP
#define SHARP_LATLONG_HPP
#include<memory>
#include<cstdint>
#include<complex>
//header;
class SHT_LatLong
{
protected:
class Impl;
std::shared_ptr<Impl> impl;
public:
const size_t td_width;
const size_t td_height;
const size_t fd_lmax;
const size_t fd_mmax;
SHT_LatLong(uint32_t wid... |
TypeScript | UTF-8 | 6,378 | 2.59375 | 3 | [] | no_license | namespace check {
export interface ICheckCondiNode {
setKeyFlag(key: number, flag: boolean): boolean;
condiKeyColl: SparseArr<boolean>;
}
export function normalizeLvl(lvl: number = 0, transfer: number = 0, star: number = 0) {
return lvl + transfer * 100 + star;
}
export cla... |
C++ | WINDOWS-1250 | 7,232 | 3.09375 | 3 | [] | no_license | #include "Table.h"
static bool BuyOrSellChain(Player& player, bool optional) {
bool ret = false;
bool askExchange = true;
char answer = ' ';
if (player.getMaxNumChains() < 3) {
cout << "Voulez-vous acheter une nouvelle chaine? (y/n) ";
cin >> answer;
if (answer == 'y') {
try {
player.buyThirdChain();... |
JavaScript | UTF-8 | 4,404 | 2.90625 | 3 | [
"MIT"
] | permissive | /**********************************************************************
Matchmaker
The matchmaker takes free-floating players and fits them into game
sessions.
//********************************************************************/
// require is like python import
// module is "this file"
// everything blo... |
Java | UTF-8 | 421 | 1.796875 | 2 | [] | no_license | package org.scijava.ui.behaviour;
public interface InputTriggerAdder
{
public interface Factory
{
public InputTriggerAdder inputTriggerAdder( InputTriggerMap map, final String ... contexts );
}
public void put( final String behaviourName, final InputTrigger... defaultTriggers );
public void put( final String ... |
Java | UTF-8 | 104 | 1.648438 | 2 | [] | no_license | package io.requery.proxy;
public interface Property<E, V> {
V get(E e);
void set(E e, V v);
}
|
Java | UTF-8 | 2,745 | 1.710938 | 2 | [] | no_license | package com.tencent.p177mm.p230g.p711c;
import android.content.ContentValues;
import android.database.Cursor;
import com.tencent.p177mm.sdk.p603e.C4925c;
/* renamed from: com.tencent.mm.g.c.r */
public abstract class C9538r extends C4925c {
public static final String[] diI = new String[0];
private static fina... |
Markdown | UTF-8 | 4,613 | 3.0625 | 3 | [] | no_license | ---
id: 1359
title: 'Network Analysis: West Wing Pilot'
date: 2016-03-28T15:52:53+00:00
author: tannerm
layout: post
guid: http://lindsaythomas.net/engl4590/?p=1359
permalink: /2016/03/28/network-analysis-west-wing-pilot/
ample_page_layout:
- default_layout
categories:
- Lab 6
---
For Lab 6, I decided to take a dia... |
Java | UTF-8 | 441 | 1.648438 | 2 | [] | no_license |
package edu.furb.sistemanfe.business;
import br.gov.frameworkdemoiselle.stereotype.BusinessController;
import br.gov.frameworkdemoiselle.template.DelegateCrud;
import edu.furb.sistemanfe.domain.ItemNotaFiscal;
import edu.furb.sistemanfe.persistence.ItemNotaFiscalDAO;
@BusinessController
public class ItemNotaFiscalBC... |
Python | UTF-8 | 425 | 3 | 3 | [] | no_license | # 使用skleaen拟合一个函数
# y = x **2
import numpy as np
import random
import matplotlib.pyplot as plt
# 构造数据集
x = np.arange(1, 1000)
noise = x / 1000
y = x**2 + noise
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(x[:800], y[:800])
# y_p = model.predict(x[800:]) # 预测
score = mode... |
Markdown | UTF-8 | 5,005 | 3.171875 | 3 | [
"MIT"
] | permissive | # Extending Rabbus w/ Middleware
Rabbus message Producers and Consumers use a middleware system that allows you
to extend the capabilities of the bus. To use it, call the `.use` method of any
given message Consumer object (Receiver, Responder, Subscriber) or Producer
(Sender, Requester, Publisher).
The `use` meth... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.