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 | 717 | 2.53125 | 3 | [] | no_license | //backend for watson Q/A handler
Meteor.startup(function(){
Meteor.methods({
watsonHandler:function(){
var watson = Meteor.npmRequire('watson-developer-cloud');
/* Appending data from Twilio input into watson,
returning watson's output into twilio for Q/A session */
var watsonInput;
... |
Java | UTF-8 | 942 | 2.296875 | 2 | [] | no_license | package ch.zli.m223.punchclock.service;
import ch.zli.m223.punchclock.domain.Entry;
import ch.zli.m223.punchclock.domain.User;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.transaction.Transactional;
import java.util.List;
@Applica... |
C# | UTF-8 | 897 | 2.546875 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
public class BombGenerator : MonoBehaviour
{
private float _time;
private float _timeForGeneration = 2.5f;
public Transform WhatToGenerate;
void Update ()
{
_time += Time.deltaTime;
if (_time >= _timeForGeneration)
{
... |
Java | UTF-8 | 705 | 3.4375 | 3 | [] | no_license | public class 最近公共祖先 {
public TreeNode lowestCommonAncestor(TreeNode cur, TreeNode p, TreeNode q) {
if(cur == null || cur == q || cur == p)return cur;
TreeNode left = lowestCommonAncestor(cur.left,p,q);
TreeNode right = lowestCommonAncestor(cur.right,p,q);
//如果left为空,说明这两个节点在cur结点的右子树... |
Java | UTF-8 | 264 | 2.5625 | 3 | [] | no_license | package ecote.Exceptions;
public class MacrosNotFound extends Exception {
public String getMessage(String macroName, int line){
return "Error!: Macros not found. Line<" + line + ">:\n\t\tMacros: <" + macroName + "> not found in the library!";
}
}
|
Java | UTF-8 | 1,056 | 2.84375 | 3 | [] | no_license | package ast;
import java.util.ArrayList;
public class Ast {
public static No root;
public static No currentNode;
public static boolean bloqueado = false;
public static ArrayList<No> posFixa = new ArrayList<>();
public static void init(No s) {
if (bloqueado) {
setCurrentNode(s);
} else {
... |
Python | UTF-8 | 129 | 2.875 | 3 | [] | no_license | import math
n=int( input())
a=100000
for i in range(n):
a+=a*0.05
a=math.ceil(a/1000)*1000
print(math.floor(a))
|
JavaScript | UTF-8 | 809 | 2.625 | 3 | [] | no_license | let chai = require('chai');
let chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
let expect = chai.expect;
/*
Scenario: Refering to EPAM in US
Given I am on referal page
When click on "submit" button with filled form
Then thanks for our submission is displayed
*/
Given("... |
C# | UTF-8 | 3,392 | 2.65625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using C1.Chart;
#if WINFORMS
using C1.Win.Chart;
#endif
#if WPF
using C1.WPF.Chart;
#endif
namespace C1.Chart.Serialization
{
/// <summary>
/// The OptionsModel class is used by the Fle... |
Python | UTF-8 | 358 | 4.21875 | 4 | [] | no_license | #Program to find the fibonnaci series using recursion:---
def fib(n):
if a==1:
return 0;
elif a==2:
return 1;
else:
return fib(n-1) +fib(n-2)
n=int(input('enter the number:'))
if n<=0:
print('please enter a positive number.')
else:
print('Fibonnci series')
f... |
Markdown | UTF-8 | 1,732 | 3.046875 | 3 | [
"MIT"
] | permissive | # jsmod
Module to replace contents of javascript file using AST traversal! :rocket:
## Getting Started
```
$ npm install jsmod
```
## Usage
```javascript
const jsmod = require("jsmod");
const { count, files } = await jsmod({
files: ["/path/to/file-1", "/path/to/file-2", "/path/to/file-3"],
filterFiles: ({... |
PHP | UTF-8 | 2,478 | 2.515625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
/*
* Generated by CRUDigniter v3.2
* www.crudigniter.com
*/
class Track_route extends CI_Controller{
function __construct()
{
parent::__construct();
$this->load->model('Track_route_model');
}
/*
* Listing of track_route
*/
function index()
{
$data... |
JavaScript | UTF-8 | 526 | 3.359375 | 3 | [] | no_license | // Error 通过Error的构造器可以创建一个错误对象。当运行时错误产生时,Error的实例对象会被抛出
// 语法 new Error(message, fileName, lineNumber) 参数都为可选
// message 人类可阅读的错误描述信息
// fileName 默认是调用Error构造器代码所在的文件的名字
// lineNumber 默认是调用Error构造器代码所在的文件的行号
try {
throw new Error("Whoops!");
} catch (e) {
console.log(e.name + ": " + e.message... |
C++ | UTF-8 | 30,791 | 2.5625 | 3 | [] | no_license | #include "game.h"
#include <SDL_mixer.h>
//you can write a game that two people can play
//theo https://tetris.fandom.com/wiki/Tetris_(NES,_Nintendo)
//https://lazyfoo.net/tutorials/SDL/index.php
//press d to disable music
//press r to resume music
/*
you may be wonder why i hold tetremino in board (not hold sh... |
Python | UTF-8 | 1,583 | 3.578125 | 4 | [] | no_license | def transpose_arr(pre_list):
n = len(pre_list)
transport = [[] for _ in range(n)]
for i in range(n):
for j in range(n):
transport[i].append(pre_list[j][i])
return transport
def list_triplets(pre_list):
"""returns lists of 3x3 elements"""
result = []
start, end = 0, 3
... |
Ruby | UTF-8 | 425 | 4.21875 | 4 | [] | no_license | # fibonacci.rb
def doubler(start)
puts start * 2
end
def doubler_2(start)
puts start
if start < 10
doubler_2(start * 2)
end
end
def fibonacci(number)
if number < 2
number
else
fibonacci(number - 1) + fibonacci(number - 2)
end
end
puts doubler(2)
puts "-------------------------------------... |
Java | UTF-8 | 1,393 | 2.4375 | 2 | [] | no_license | package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.retry.annotation.E... |
Shell | UTF-8 | 785 | 2.828125 | 3 | [
"MIT"
] | permissive | #!/bin/sh
#Just add the ips oh your linux boxes you would like to check ssh telnet
# Make as many as you want :
#By shachar@hotmail.com
#Edit <hostname or ip>
#Edit <EMAIL>
#Edot <Name> for description on what is tested
echo "Starting telneting <Name> & <Name> servers for ssh"
nc -z -w5 <HOSTNAME OR IP> 22... |
Python | UTF-8 | 748 | 2.84375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')... |
Markdown | UTF-8 | 1,278 | 3.046875 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Las matrices usadas como argumentos de atributo son necesarias para especificar explícitamente los valores de todos los elementos
ms.date: 07/20/2015
f1_keywords:
- vbc31110
- bc31110
helpviewer_keywords:
- BC31110
ms.assetid: 83d96c9d-cda9-44c0-accb-08c2d2f8db10
ms.openlocfilehash: daf117cab3a900b72... |
Python | UTF-8 | 20,289 | 2.84375 | 3 | [] | no_license | from collections import defaultdict
import itertools
import random
from envgenerator import EnvGenerator
from collections import defaultdict, Counter
from scipy import optimize
import numpy as np
import time
from collections import defaultdict
import random
import matplotlib.pyplot as plt
import math
import pickle
#C... |
C# | UTF-8 | 6,973 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using UnityEngine;
using static ICHelpers;
/* ItemControl (IC) are used to move items around the world
* An IC should have at least 1 input or output IC, and should hold at least 1 item
* TryAttach[In/Out]puts will try to attach an in-out pairing with an eligible legal... |
C++ | WINDOWS-1252 | 2,555 | 2.8125 | 3 | [] | no_license | #include <iostream>
using namespace std;
struct stu
{
int num,de,cai,sum;
};
int main()
{
int n,l,h,m=0,num,de,cai,*q;
stu *p;
cin>>n>>l>>h;
p=new stu[n];
for(int i=0;i<n;i++)
{
cin>>num>>de>>cai;
if(de>=l&&cai>=l)
{
p[m].num=num;
p[m].de=de;
p[m].cai=cai;
p[m].sum=de+cai;
m++;
}
}
q=new... |
Java | UTF-8 | 2,854 | 1.929688 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2020 Tianshu AI Platform. 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
*
* Unless required by a... |
Python | UTF-8 | 250 | 3.5625 | 4 | [] | no_license | #An array is given by user from 1-100 by missing one number
#let us take array name as 'a'
a=[]
for i in range(1,101):
if i!= 25:
a.append(i)
for i in range(1,101):
if i not in a:
print("misssing number is :",i)
break
|
Python | UTF-8 | 2,110 | 2.65625 | 3 | [] | no_license | import random
import jsonpath
import pytest
from Test_Demo_09day.demo2.tag import Tag
class TestTag():
def setup_class(self):
self.tag = Tag()
@pytest.mark.parametrize('tag_name,group_id',
(['test10', 'etxAOwDwAAnDxDV4csfHEhh9XUxUQRxA'],
... |
Python | UTF-8 | 3,414 | 2.53125 | 3 | [] | no_license | # Copyright (c) 2014 - 2016 Qualcomm Technologies International, Ltd.
# All Rights Reserved.
# Qualcomm Technologies International, Ltd. Confidential and Proprietary.
# Part of BlueLab-7.1-Release
# Part of the Python bindings for the kalaccess library.
from ctypes import c_int, c_char_p, c_uint, c_byte, c_void_... |
Java | UTF-8 | 659 | 2.125 | 2 | [] | no_license | package upeu.lcbm.com.yachary.baseDatos;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/**
* Created by ivan on 27/03/2015.
*/
public class YacharyHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1;
... |
Ruby | UTF-8 | 1,236 | 3.78125 | 4 | [] | no_license | def single_trip(line, origin, destination)
train = {
:N => ['Times Square', '34th', '28thN', '23rd', 'Union Square', '8thN'],
:L => ['8thL', '6th', 'Union Square', '3rd', '1st'],
6 => ['Grand Central', '33rd', '28th6', '23rd6', 'Union Square', 'Astor Place'],
:transit => ['Union Square']
}
origin... |
C# | UTF-8 | 1,179 | 3.625 | 4 | [] | no_license | using System;
using System.Threading;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Write("Value:");
string fibValue = Console.ReadLine();
int fibNumber;
Int32.TryParse(fibValue, out fibNumber);
int... |
Java | UTF-8 | 1,259 | 3.65625 | 4 | [] | no_license | public class ArrayManipulation {
public static void main(String[] args) {
int[] array=new int[5];
array[0]=25;
array[1]=36;
array[2]=16;
array[3]=26;
array[4]=47;
int[] array1= {12,50,2,5,55,25};
int biggest1=array[0];
for(int i=1;i<array.length;i++)
{
if(array[i]>b... |
JavaScript | UTF-8 | 1,000 | 2.890625 | 3 | [
"MIT"
] | permissive | 'use strict'
var validate = require('aproba')
var renderTemplate = require('./render-template.js')
var wideTruncate = require('./wide-truncate')
var stringWidth = require('string-width')
module.exports = function (theme, width, completed) {
validate('ONN', [theme, width, completed])
if (completed < 0) completed = ... |
TypeScript | UTF-8 | 457 | 2.640625 | 3 | [] | no_license | import { ErrorCodes } from './errors';
export class AzureAuthError extends Error {
constructor(private errorCode: ErrorCodes, private readonly errorMessage: string, private readonly originalException?: any) {
super(errorMessage);
}
getPrintableString(): string {
return JSON.stringify({
er... |
Python | UTF-8 | 830 | 3.28125 | 3 | [] | no_license | import re
import sys
from pyspark import SparkConf, SparkContext
# make all words lower
def f(word):
word = word.lower()
return word
conf = SparkConf()
sc = SparkContext(conf=conf)
lines = sc.textFile(sys.argv[1])
words = lines.flatMap(lambda l: re.split(r'[^\w]+', l))
words = words.map(f).distinct() #make a... |
Java | UTF-8 | 1,182 | 3.125 | 3 | [] | no_license | package org.noobiez;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class LoginProcessor {
private static Scanner cin;
private String userID;
/**
* Constructor with login user ID.
*
* @param String the user's ID number.
*/
... |
JavaScript | UTF-8 | 592 | 2.796875 | 3 | [] | no_license | var signin = function() {
var email = document.getElementById("signinEmail").innerHTML;
var password = document.getElementById("signinPassword").innerHTML;
var request = new XMLHttpRequest();
var url = "../letuscode/php/signin.php";
request.open("POST",url,true);
request.setReques... |
C# | UTF-8 | 3,311 | 3.328125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace BPO.Core
{
/// <summary>
/// 缓存访问Helper
/// </summary>
public static class CacheHelper
{
private static ICacheProvider CacheProvider
{
get
{
return new RedisProvider... |
Java | UTF-8 | 1,917 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | //Colm Woodlock G00341460
package com.geog.Controller;
import java.util.*;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;
import com.mysql.jdbc.CommunicationsException;
import com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationExcept... |
Java | UTF-8 | 1,024 | 2.03125 | 2 | [] | no_license | package com.example.githubprofile;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import java.io.IOException;
import java.io.InputStream;
imp... |
Java | UTF-8 | 183 | 1.734375 | 2 | [] | no_license | package lu.circl.mispbump.models.restModels;
import com.google.gson.annotations.SerializedName;
public class Version {
@SerializedName("version")
public String version;
}
|
C# | UTF-8 | 1,485 | 2.796875 | 3 | [] | no_license | /*
* Mark Diedericks
* 22/07/2018
* Version 1.0.0
* Manages execution engines' IO
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Excel_Macros_INTEROP.Engine
{
public class EngineIOManager
{
private... |
C# | UTF-8 | 1,592 | 2.515625 | 3 | [] | no_license | using MvcUygulama.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MvcUygulama.Controllers
{
public class ProductController : Controller
{
// GET: Product
NorthwindEntities pro = new NorthwindEntities();
public... |
Python | UTF-8 | 1,318 | 4.40625 | 4 | [] | no_license | ### SOAL 1 ###
## PROGRAM MENYIMPAN DAN MENAMPILKAN KONTAK ###
# dictionary list_contact
list_contact = []
# fungsi add_contact
def add_contact():
print("")
name = input("Nama: ")
phone = input("No Telepon: ")
contact = {
"nama": name,
"telepon": phone
}
return contact
# fungs... |
C++ | UTF-8 | 1,245 | 3.921875 | 4 | [
"MIT"
] | permissive | /*
1. Ruling Pair
Medium Accuracy: 100.0% Submissions: 621 Points: 4
Geek Land has a population of N people and each person's ability to rule the town is measured by a numeric value arr[i]. The two people that can together rule Geek Land must be compatible with each other i.e., the sum of digits of their ability arr[i... |
Python | UTF-8 | 3,031 | 3.1875 | 3 | [] | no_license | """Contains OverviewPage class."""
import os
from selenium import webdriver
from selenium.webdriver.support.ui import Select
class OverviewPage:
"""Represents the overview page of a year."""
def __init__(self, year, reload=False, driver=None):
"""Init the class.
Args:
year (int... |
Java | UTF-8 | 26,150 | 1.96875 | 2 | [] | no_license | // Generated from LafiteParser.g4 by ANTLR 4.8
package com.github.jobop.lafite.interpreter;
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**
* This interface defines a complete listener for a parse tree produced by
* {@link LafiteParser}.
*/
public interface LafiteParserListener extends ParseTreeListener {... |
PHP | UTF-8 | 2,992 | 3.09375 | 3 | [
"MIT"
] | permissive | <?php
namespace app\models\DataAccessLayer;
use app\models\DomainModel\Product;
use app\models\DomainModel\Pagination;
/**
* This class handles products and their information.
*
* It both hydrates the Product domain model object from the DB to be sent to the corresponding
* view, and persists the Product object ... |
C | UTF-8 | 6,791 | 3.84375 | 4 | [] | no_license | /*
============================================================================
Name : linked.c
Author : Ahmed ElDakhly
Date : 11/9/2019
Description : Linked List Exercises
============================================================================
*/
/***************************************... |
C# | UTF-8 | 2,641 | 2.59375 | 3 | [] | no_license | using System;
using System.Linq;
using System.Collections.ObjectModel;
using System.Windows;
using HuntAndPeck.Models;
using HuntAndPeck.Services.Interfaces;
using System.Collections.Generic;
namespace HuntAndPeck.ViewModels
{
internal class OverlayViewModel : NotifyPropertyChanged
{
private Rect _bou... |
Python | UTF-8 | 224 | 2.78125 | 3 | [] | no_license |
def grant_the_hint(txt):
words = txt.split()
strings = []
for i in range(max([len(word) for word in words]) + 1):
strings.append(' '.join([word[:i] + '_'*max(0, len(word)-i) for word in words]))
return strings
|
JavaScript | UTF-8 | 859 | 2.75 | 3 | [] | no_license | describe("Sample", function() {
beforeEach(function() {
loadFixtures('sample-fixture.html');
});
describe("Model", function() {
it("returns falsehood when handed false", function() {
expect(model.getMessage(false)).toBe('falsehood');
});
it("returns truth when handed true", f... |
Java | UTF-8 | 4,494 | 2.5625 | 3 | [] | no_license | package qc.veko.ranking.rank;
import java.util.*;
import java.util.stream.Collectors;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import qc.veko.ranking.manager.FactionFileManager;
import qc.veko.ranking.utils.PointsUtils;
import qc.veko.ranking.FactionRanking;
public class ... |
Java | UTF-8 | 2,205 | 2.03125 | 2 | [] | no_license | package com.example.exam;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.firebase.client.DataSnapsh... |
C++ | UTF-8 | 933 | 2.75 | 3 | [] | no_license | #ifndef CONVERTER_H
#define CONVERTER_H
#include <QtCore>
#include <QString>
/*
* 适用于网络字节序的quint8 Array
* 若转换主机字节序的数组,则打印顺序从低字节开始,会导致与预期结果相反
*/
class Converter
{
public:
Converter(const quint8 *ptr,qint32 size,QString sep = "",QString preFix = "0x",qint32 base = 16);
QString ConvertQuint8ArrayToHexStr();... |
Swift | UTF-8 | 3,262 | 2.9375 | 3 | [] | no_license | //
// Translation.swift
// TranslateKit
//
// Created by Jennifer on 13/02/2016.
// Copyright © 2016 weTranslate. All rights reserved.
//
import UIKit
public struct Translation: Equatable {
// MARK: - Properties
public let fromLanguage: Language
public let toLanguage: Language
public let searchT... |
C++ | UTF-8 | 1,594 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
#include <math.h>
#include <pango/pangocairo.h>
static void
draw_text(cairo_t *cr, std::string textmessage)
{
//#define FONT "Nimbus Sans Bold 36"
#define FONT "Neris Black 36"
PangoLayout *layout;
PangoFontDescription *desc;
int i;
/* Create a pango layout */
layout ... |
Java | UTF-8 | 407 | 1.914063 | 2 | [] | no_license | package com.message;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
@SuppressWarnings("serial")
public class Message extends Model<Message>{
public static final Message me = new Message();
public Page<Message> paginate(int pageNumber, int pageSize) {
return paginate(pag... |
Markdown | UTF-8 | 3,301 | 2.796875 | 3 | [] | no_license | ---
author:
name: Peter G.
picture: 109459
body: "Web typography is surely not as sophisticated as it's printed cousin (or should
it be mother?), but nevertheless, <a href=\"http://webtypography.net/\" title=\"The
Elements of Typographic Style Applied to the Web\">some</a> <a href=\"http://www.markboulton.co.uk... |
Java | UTF-8 | 2,620 | 2.203125 | 2 | [] | no_license | package com.piclib.web.service;
import com.piclib.web.dao.AdminMapper;
import com.piclib.web.dao.MaterialCategoryMapper;
import com.piclib.web.entity.MaterialCategory;
import com.piclib.web.entity.MaterialCategoryExample;
import com.piclib.web.model.CategoryItem;
import com.piclib.web.model.ItemListResp;
import org.sp... |
Java | ISO-8859-1 | 1,189 | 3.921875 | 4 | [] | no_license | package br.com.dio.calculadora;
import java.util.Scanner;
public class CalculadoraDigitoOperacao {
public static void main(String[] args) {
double n1;
double n2;
String operacao = "";
double control=0;
@SuppressWarnings("resource")
Scanner entrada = new Scanner(System.in);
System.out.print("... |
Markdown | UTF-8 | 1,212 | 2.875 | 3 | [] | no_license | [TOC]
### 0.写在学习算法之前的一些感言
我只会c的最基础的,指针域什么的没有上机操作过,c#、c++更加不会了。最常用的是Python。
2019年九月份,被各大厂的笔试碾压了一遍又一遍,学吧,没有什么是天生就会的,我想有一个好一点的coding能力,那么数据结构和算法是我必须得会的。
(我是本硕非计科)
最激励是这么一句话(送给各位码农):
- 通常说程序员往往到35岁到头了,是因为那些程序员不会数据结构
### 1.数组
### 2.线性表
[线性表](https://github.com/Lebhoryi/Algorithms/tree/master/2.%E7%BA%BF%E6%80%A7... |
Go | UTF-8 | 181 | 2.515625 | 3 | [
"MIT"
] | permissive | package shared
import (
"strings"
)
// GetRootEndpoint return a root of endpoint
func GetRootEndpoint(endpoint string) string {
s := strings.Split(endpoint, "/")
return s[1]
}
|
Java | UTF-8 | 3,972 | 2.15625 | 2 | [] | no_license | package com.vroy.trapper.menuscreens;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.widget.B... |
Swift | UTF-8 | 611 | 3.1875 | 3 | [] | no_license | //
// for_loop.swift
// swift_demo_T1000
//
// Created by mac on 05/03/1443 AH.
//
import Foundation
//var score = 0
//for _ in 0...4 {
// let x = Double(Int.random(in:1...10))
// let y = Double(Int.random(in:1...10))
// print("find the answer of",x,"/",y,"? " , terminator: "")
// let answer = Utils.rea... |
Java | UTF-8 | 676 | 2.90625 | 3 | [] | no_license | package contest;
import template.io.FastInput;
import template.io.FastOutput;
public class ADuffAndWeightLifting {
public void solve(int testNumber, FastInput in, FastOutput out) {
int n = in.ri();
int[] cnts = new int[(int) 1e6 + 1];
for (int i = 0; i < n; i++) {
int w = in.ri... |
PHP | UTF-8 | 288 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Service;
interface EncryptionServiceInterface
{
public function encrypt(string $data): string;
public function decrypt(string $data): string;
public function getServiceName(): string;
public function supports(?string $encryptionServiceName): bool;
}
|
Shell | UTF-8 | 2,110 | 3.453125 | 3 | [] | no_license | #!/bin/bash
function descartes() {
mvn eu.stamp-project:pitmp-maven-plugin:1.3.7-EXPERIMENTS:descartes -DoutputFormats=METHODS,JSON,CSV,XML -DtimestampedReports=false -DreportsDirectory=../results
}
function reneri_methods() {
mvn -X eu.stamp-project:reneri:1.0-EXPERIMENTS:observeMethods -DouputFolder=../resu... |
Python | UTF-8 | 3,058 | 3.015625 | 3 | [] | no_license | #评价词向量的好坏,将计算得到的词的分数存到字典中
# 输入:训练好的词向量,使用keyedVrctor加载,路径由embeddir指定,具体有sys.argv[1]指定
# 处理: 遍历vocabulary中的每一个词,对每个词取出most_similar_num个最相似的词,分别计算most_similar_num个词与该词的语义距离,然后对距离进行\
# 均值或加权平均,对每个词得到一个分数
# 输出:将{word:score}存储到词典中,路径由score_dict_dir指定
# 命令行参数:指定Word2vec模型路径
from nltk.corpus import wordnet ... |
C++ | UTF-8 | 1,369 | 2.953125 | 3 | [] | no_license | #ifndef CPP11NHF_MYSTRING_H
#define CPP11NHF_MYSTRING_H
#include <string>
#include <iostream>
#include <set>
enum Adopt { AdoptValue };
class StringValue {
public:
StringValue(const char *str);
StringValue(char *str, Adopt adopt);
StringValue();
char *getStr() const;
unsigned int getRefCount... |
Java | UTF-8 | 1,801 | 2.109375 | 2 | [
"Apache-2.0"
] | permissive | package com.newxton.nxtframework.controller.api.admin;
import com.newxton.nxtframework.entity.NxtWebPage;
import com.newxton.nxtframework.service.NxtWebPageService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.we... |
Java | UTF-8 | 1,446 | 2.296875 | 2 | [] | no_license | // Decompiled by DJ v3.5.5.77 Copyright 2003 Atanas Neshkov Date: 25.09.2003 09:25:04
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: Dimer.java
package netprimer;
public class Dimer
implements C... |
Ruby | UTF-8 | 1,899 | 3.109375 | 3 | [
"MIT"
] | permissive | require 'open-uri'
require 'time'
require 'rexml/document'
# Example:
#
# tada = Tada.new('http://<nick>.tadalist.com/lists/feed/<id>?token=<token>')
# tada.tasks.each do |task|
# puts "#{task.title} @ #{task.link} updated at #{task.date}"
# end
#
class Tada
include REXML
attr_accessor :url, :tasks, :link, :tit... |
Python | UTF-8 | 834 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env python
"""
Make a quick plot of the output file...
that's all folks.
"""
__author__ = "Martin De Kauwe"
__version__ = "1.0 (21.03.2011)"
__email__ = "mdekauwe@gmail.com"
import numpy as np
import sys
import matplotlib.pyplot as plt
mate = np.loadtxt("z")
#mate_water = np.loadtxt("zz")
bewdy = np.... |
Markdown | UTF-8 | 555 | 2.71875 | 3 | [] | no_license | # react-chat-app
This is a live chat app built using React.js, socket.io, and Node.js. The app is deployed live using Heroku for the backend and Netlify for the frontend. View live link here: https://vigilant-perlman-21e175.netlify.com/
On the homepage type in your name and the name of the room you wish to enter. You... |
Java | UTF-8 | 136 | 1.546875 | 2 | [] | no_license | import org.junit.Test;
/**
* Created by dragon on 11/26/2017.
*/
public class TestClass {
@Test
public void test(){
}
}
|
Markdown | UTF-8 | 272 | 3.03125 | 3 | [
"MIT"
] | permissive | ## Deal
|Field|Type|Primary key|Foreign key|Unique|Not null|
|:-----|:----:|:-----------:|:-----------:|:------:|:-------:|
|id_deal|int|+| |+|+|
|batch_id|int| |+| | |
|broker_id|int| |+| | |
|contract_id|int| |+| | |
|buyer_id|int| |+| | |
|deal_date|date| | | |+|
|
Java | UTF-8 | 885 | 2.6875 | 3 | [] | no_license | package web;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ActionServlet extends HttpServlet{
@Override
protected void s... |
Rust | UTF-8 | 15,676 | 3.765625 | 4 | [] | no_license | use std::collections::HashMap;
#[derive(Debug)]
pub struct Processor {
pub pc: i32, // program counter
pub cod_machine: i32, // codigo mauqina da instrucao
pub regs: [i32; 32], // arr com 32 registos [0..31] todos do tipo i32
}
impl Processor {
pub fn new() -> Processor {
Processor {... |
Markdown | UTF-8 | 5,403 | 2.796875 | 3 | [] | no_license | ---
slug: spring-boot-configuration-using-yaml
title: "Spring Boot Configuration using YAML"
published: true
date: 2017-06-26T09:00:06-04:00
tags: ['spring']
excerpt: "Spring Boot Configuration using YAML"
cover: './emile-perron-190221-760x428.jpg'
---
In this tutorial, we are going to look at a question from a studen... |
Java | UTF-8 | 5,233 | 2.609375 | 3 | [] | no_license | package com.jwt.userservice.util;
import com.jwt.userservice.common.exception.TechnicalException;
import lombok.extern.log4j.Log4j2;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.security.*;
i... |
C++ | UTF-8 | 987 | 2.53125 | 3 | [] | no_license | #ifndef UPDATEINFO_H
#define UPDATEINFO_H
#include <string>
#include <thread>
#include <mutex>
#include "updatecollection.h"
class updateinfo
{
public:
enum class State_t_LTSCtrl
{
IDLE = 0,CONFIGURED = 1, RUNNING = 2, STOPPED = 3, ERROR = 4, BUSSY = 5
};
updateinfo();
inline Corvuspo... |
Markdown | UTF-8 | 2,216 | 2.96875 | 3 | [] | no_license | ---
layout: post
title: "Mac で VirtualBox を利用して IE10, IE11, Microsoft Edge を試す"
categories: tech
date: "2019-04-15 00:00:00"
---
<div class="card">
<a href="https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/"></a>
<div class="card__header">
<a href="https://developer.microsoft.com/en-us/microsoft... |
Java | UTF-8 | 1,666 | 1.835938 | 2 | [] | no_license | package gov.uscis.web.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@Configuration
@EnableWebSecurity
pub... |
C++ | UTF-8 | 18,908 | 3.015625 | 3 | [] | no_license | #include "Scripting.hpp"
#include "Handle.hpp"
#include <vector>
#include <string>
#include "GameState.hpp"
#include "mymath.hpp"
#include <cmath>
#include "string_utils.hpp"
#include "Expression.hpp"
#ifdef DEBUG
#include "Log.hpp"
#include <fstream>
#include <sstream>
#endif
Expression* Script::r... |
Java | UTF-8 | 719 | 1.84375 | 2 | [] | no_license | package com.gzq.lib_bluetooth.utils;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleOwner;
import com.uber.autodispose.AutoDispose;
import com.uber.autodispose.AutoDisposeConverter;
import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider;
public class RxUtils {
... |
C++ | UTF-8 | 822 | 4.0625 | 4 | [] | no_license | /*50. Write a program in C++ to enter length in centimeter and convert it into meter and kilometer.
Sample Output:
Convert centimeter into meter and kilometer :
--------------------------------------------------
Input the distance in centimeter : 250000
The distance in meter is: 2500
The distance in kilometer is:... |
Markdown | UTF-8 | 832 | 2.796875 | 3 | [
"MIT"
] | permissive | # ListView
## Basic usage
{{#docs-demo as |demo|}}
{{#demo.example name="tr-listview.hbs"}}
{{#tr-listview items=items as |lv|}}
{{#lv.itemTemplate as |item|}}
This is the item "{{item.id}}"
{{/lv.itemTemplate}}
{{#lv.header header="My Header" subHeader="Content f... |
JavaScript | UTF-8 | 2,651 | 2.6875 | 3 | [] | no_license | import {isString, isEmpty, isNumber} from 'underscore';
const transformFromServerValue = (field, value) => {
switch (field.type) {
case 'multipleselectionlist':
return (isString(value) && value) ? value.split(',') : [];
case 'url': return value || {};
case 'entity':
... |
TypeScript | UTF-8 | 453 | 2.640625 | 3 | [] | no_license |
import { Pipe, PipeTransform } from '@angular/core';
import { Country } from '../shared/data.model';
@Pipe({
name: 'countryfilter'
})
export class countryfilterPipe implements PipeTransform {
transform( countries:Country[],SearchBar:string):Country[]
{
if(!countries || !SearchBar)
{
retur... |
Java | UTF-8 | 3,301 | 1.828125 | 2 | [] | no_license | package com.l9e.transaction.service.impl;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.l9e.transaction.dao.BookDao;
import com.l9e.transaction.service.BookService;
import com.l9e.transaction.vo.AreaVo;
import com.l9e.transac... |
Python | UTF-8 | 932 | 2.546875 | 3 | [] | no_license | #!/usr/bin/python2
import glob
import os
import math
files = glob.glob("*.png")
if len(files)>0:
t = 0.0
dT = 3.14 * 2 / float(len(files))
print "."
print " {_-_naughty_-_}"
print " .... compression..."
print " .."
print " ."
idx = 0
for filen in files:... |
Java | UTF-8 | 19,880 | 2.046875 | 2 | [
"BSD-2-Clause"
] | permissive | package com.zarbosoft.merman.editorcore;
import com.zarbosoft.merman.core.document.Atom;
import com.zarbosoft.merman.core.document.fields.FieldArray;
import com.zarbosoft.merman.core.document.fields.FieldPrimitive;
import com.zarbosoft.merman.core.syntax.FreeAtomType;
import com.zarbosoft.merman.core.syntax.Syntax;
im... |
C++ | UTF-8 | 1,530 | 3.671875 | 4 | [] | no_license | #pragma once
#include "node.h"
//Let's make an ascending ordered list
/*some tests?
add to an empty list
remove from an empty list
print an empty list
search in an empty list
add before head of list
add after head of list
add farther down the list (may be similar to previous test)
remove head
remove after head
remov... |
PHP | UTF-8 | 875 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Models\Formfactor;
class CreateFormfactorsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
... |
Java | UTF-8 | 1,526 | 2.34375 | 2 | [] | no_license | package com.sushnaya.telegrambot.user.state;
import com.sushnaya.telegrambot.Command;
import com.sushnaya.telegrambot.SushnayaBot;
import com.sushnaya.telegrambot.BotState;
import com.sushnaya.telegrambot.DefaultCancelHandler;
import com.sushnaya.telegrambot.UpdateHandler;
import com.sushnaya.telegrambot.user.updateha... |
C++ | UTF-8 | 4,081 | 2.828125 | 3 | [
"MIT"
] | permissive | /*
Lloyd.cpp - Implementation of the Lloyd algorithm for codebook generation
*/
#include <StdIO.h>
#include "Lloyd.h"
#include <StdLib.h>
#include <Math.h>
#include <Assert.h>
const long IterationLimit = 3;
long Lloyd::Execute(fCodebook &Source, fCodebook &Dest, long Target)
{
long i, Count, Cu... |
C++ | UTF-8 | 1,100 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <deque>
using namespace std;
using ll=long long;
deque<pair<ll,ll>> buffer;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n, l;
cin >> n >> l;
pair<ll, ll> min = make_pair(-1, -1);
for (ll i = 1; i <= n; i++) {
ll v;
cin >> v;
// minimum value alway... |
Markdown | UTF-8 | 4,236 | 3.15625 | 3 | [
"MIT"
] | permissive | # **Knock-Knock**
Knock-Knock is a *Python* coded and *Open-CV* based **Face Recognization Application** that will help the administration in keeping a
track of the people coming and going in a particular vicinity. It provides the authority with the option of keeping track
of movements of named individuals.
**Knock-K... |
C++ | UTF-8 | 4,383 | 2.984375 | 3 | [] | no_license | #include "camera.h"
#include <system/platform.h>
#include <graphics/sprite_renderer.h>
#include <graphics/font.h>
#include <system/debug_log.h>
#include <graphics/renderer_3d.h>
#include <graphics/mesh.h>
#include <maths/math_utils.h>
#include <input/sony_controller_input_manager.h>
#include <graphics/sprite.h>
#includ... |
C# | UTF-8 | 1,739 | 3.046875 | 3 | [] | no_license | using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Server
{
public class File
{
public string fileName;
public long fileSize;
public DateTime uploadTime;
[JsonIgn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.