language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 2,094 | 1.96875 | 2 | [] | no_license | package com.aroominn.aroom.presenter.impl;
import com.aroominn.aroom.base.BaseImpl;
import com.aroominn.aroom.base.BasicResponse;
import com.aroominn.aroom.bean.Comment;
import com.aroominn.aroom.bean.HomeInfo;
import com.aroominn.aroom.bean.Result;
import com.aroominn.aroom.bean.Story;
import com.aroominn.aroom.model... |
JavaScript | UTF-8 | 2,759 | 2.90625 | 3 | [
"MIT"
] | permissive | function initSelectors(measurements){
let names = Object.keys(measurements);
var container = document.getElementById("observationsContainer");
var listItems = "";
for (let i = 0; i < names.length; i++){
let curMeasurement = filteredMeasurements[names[i]];
let numObs = Object.keys(cur... |
C++ | UTF-8 | 270 | 3.046875 | 3 | [] | no_license | #include <iostream>
//this program breaks a spell by saying Abracadabra however many times the user input
using namespace std;
int main()
{
int days , i;
cin >> days;
for (i = 0; i < days; i++)
cout << i + 1 << " Abracadabra" << endl;
return 0;
} |
JavaScript | UTF-8 | 2,505 | 3.21875 | 3 | [] | no_license | (function () {
var alphabet = ["a", "b", "c", "d", "e", "f", "g",
"h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
"r", "s", "t", "u", "v", "w", "x", "y", "z"];
var upAlphabet = ["A", "B", "C", "D", "E", "F", "G",
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
"S", "T", "U", "V", "W", "X", "Y", "Z"];... |
Markdown | UTF-8 | 197 | 2.671875 | 3 | [
"MIT",
"CC-BY-SA-4.0"
] | permissive | # Add New Properties to a JavaScript Object
You can add new properties to existing JavaScript objects the same way you would modify them. Here is how:
```javascript
myDog.bark = "woof-woof";
```
|
C++ | UTF-8 | 678 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | #include <proton/container.hpp>
#include <proton/messaging_handler.hpp>
#include <iostream>
class ExampleHandler: public proton::messaging_handler {
const std::string url_;
void on_container_start(proton::container& c) override {
c.connect(url_);
}
void on_connection_open(proton::connect... |
Python | UTF-8 | 578 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | def learn(db_support):
print "Learning data"
def learn_name(messageToBot):
if(messageToBot.startswith("call me ")):
return "Clarissa: Okay. I will call you "+messageToBot.replace("call me ", "")
elif(messageToBot.startswith("Call me")):
return "Clarissa: Okay. I will call you "+messa... |
Shell | UTF-8 | 558 | 3.015625 | 3 | [] | no_license | #! /bin/bash
# Extracts FA information from processed data
# Requires $FSLDIR to be properly set
# Specify path to atlas and number of atlas regions
atlasPath = /usr/local/fsl/data/atlases/JHU/JHU-ICBM-labels-1mm.nii.gz
numroi = 48
for roinum in {1..$numroi}; do
fslmaths atlasPath -thr $roinum -uthr $roinum ... |
Markdown | UTF-8 | 3,533 | 2.890625 | 3 | [
"MIT"
] | permissive | ---
title: Learning JavaScript Properly pt. 1
author: andrew
date: 2013-09-14
template: article.jade
---
Only a few days have passed since embarking on my mission to [learn JavaScript properly](http://javascriptissexy.com/how-to-learn-javascript-properly/).
The schedule for the first two weeks was mostly review, so I... |
JavaScript | UTF-8 | 1,641 | 2.515625 | 3 | [] | no_license | var shortid = require("shortid");
var db = require("../db");
module.exports.see = function(req, res) {
var page = parseInt(req.query.page) || 1; //n
var perPage = 8; //x
var start = (page - 1) * perPage;
var end = page * perPage;
var drop = (page - 1) * perPage;
res.render("books/see", {
//books: ... |
Markdown | UTF-8 | 7,890 | 2.75 | 3 | [] | no_license | 八
“洒家把你们都杀光了,这件事还有谁知道。”
“你能把中原武林人全部杀光?”
“中原武林算得了什么,洒家站在这里不动,看你有什么本事尽管使出来,能不能伤到洒家一根汗毛!”
商七不由大怒道:“番僧无知,你不过仗着一点气功就以为天下无敌!”
红衣喇嘛裂嘴怪道:“你怎么不试试,洒家就站在这里,绝不还手。”
商七忍无可忍,一振铁算盘正待出手,半空中突然有人接口道:“商老板,你休息一下,让我来试试这位大喇嘛的气功!”
声落人现,是扈三娘,她和楚湘玲同时出手,把无类教埋伏在暗中一批暗器高手清除后,回来正好赶上红衣喇嘛和商七的对话。
扈三娘突然从空中降落,红衣喇嘛倒是颇感... |
Shell | UTF-8 | 8,090 | 2.90625 | 3 | [] | no_license | #!/bin/sh
###########################################################
# Script that:
# - Do DInSAR for each pair of SLCs.
# - GAMMA scripts are used all over this scr.
# Written by,
# -T.LI @ ISEIS, 29/04/2013
######################################
#!/bin/sh
###################################################... |
JavaScript | UTF-8 | 490 | 3.84375 | 4 | [] | no_license | const readlineSync = require("readline-sync");
class Circle {
constructor(xPos, yPos, radius) {
this.xPos = xPos;
this.yPos = yPos;
this.radius = radius;
}
get surface() {
return Math.PI * (this.radius * this.radius);
}
move(xOffset, yOffset) {
this.xPos += x... |
Shell | UTF-8 | 2,764 | 4.125 | 4 | [] | no_license | #!/bin/bash
get_ack() {
# https://djm.me/ask
local prompt default reply
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
default=Y
elif [ "${2:-}" = "N" ]; then
prompt="y/N"
default=N
else
prompt="y/n"
default=
fi
# Ask the question (not using "read -p" as it uses stderr not std... |
Java | UTF-8 | 1,464 | 3.140625 | 3 | [
"MIT"
] | permissive | package partytime;
public class Topic {
private String name;
private int interest;
private double importance;
private String [] statements; // List of statements about topic
private String [] replies; // List of responses
public Topic(Topic t) { this.name = t.name; this.interest = t.getInterest();
... |
C | GB18030 | 448 | 2.90625 | 3 | [] | no_license | #pragma once
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
typedef int DataType;
struct Node;
typedef struct Node* PtrToNode;
typedef PtrToNode Stack;
int IsEmpty(Stack S);
Stack CreatStack(); //һջ
void MakeEmpty(Stack S); //ջÿ
void Push(DataType x, Stack S); //ջ
DataType Top(Stack S); /... |
Java | UTF-8 | 1,111 | 2.078125 | 2 | [] | no_license | package br.edu.usj.ads.lpii.clientecrud;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import lombok.NoArgsConstructor;
@Entity
@NoArgsConstructor
public class Contato {
... |
PHP | UTF-8 | 5,662 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace backend\models;
use common\models\Website;
use Yii;
use yii\base\Model;
use yii\helpers\Html;
/**
* Website Contact form
*/
class WebsiteContactForm extends Model
{
public $contactTitle;
public $contactDescription;
public $contactMapEmbedCode;
public $contactFullname;
public $con... |
Java | UTF-8 | 12,494 | 1.679688 | 2 | [] | no_license | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2020.05.... |
Markdown | UTF-8 | 993 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | ```swift
extension GraphQLRequest {
static func getWithoutDescription(byId id: String) -> GraphQLRequest<Todo> {
let operationName = "getTodo"
let document = """
query getTodo($id: ID!) {
\(operationName)(id: $id) {
id
name
}
}
"""
... |
Markdown | UTF-8 | 1,887 | 2.90625 | 3 | [] | no_license | # Configure IFTTT to Send Alert
Our final step for this app is to send meaningful alerts to an external source - email, text, etc - letting us know that the trains r fucked.
There are many ways to achieve this, but we will specifically look into integrating with the [IFTTT Maker Webhook API](https://ifttt.com/maker_w... |
Python | UTF-8 | 1,820 | 4.1875 | 4 | [] | no_license | """
Numpy
Basics:
It provides a high performance multidimensional array object, and tools for working with these arrays
[1]. It provides option as:
[2]. Less Memory optimized
[3]. Fast performance
[4]. Convenient and easy to use
"""
import numpy as np
import matplotlib.pyplot as plt
... |
Python | UTF-8 | 872 | 2.9375 | 3 | [] | no_license | #pip install speechrecognition
#brew install portaudio
#pip install pyaudio
import speech_recognition as SRG
import time
import textblob
list = []
store = SRG.Recognizer()
with SRG.Microphone() as s:
print("Speak....")
audio_input = store.record(s, duration=5)
print("Recording time:",time.strftime("%I... |
PHP | UTF-8 | 197 | 2.875 | 3 | [] | no_license | <?php
//Turns text into html entities
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if(isset($_POST["msg"])) {
$altered_msg = htmlentities($_POST["msg"]);
echo $altered_msg;
}
}
?> |
Rust | UTF-8 | 2,369 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | use schema_core::{
commands::DiagnoseMigrationHistoryOutput,
commands::{diagnose_migration_history, DiagnoseMigrationHistoryInput},
schema_connector::SchemaConnector,
CoreError, CoreResult,
};
use tempfile::TempDir;
#[must_use = "This struct does nothing on its own. See DiagnoseMigrationHistory::send()... |
Java | UTF-8 | 197 | 1.578125 | 2 | [] | no_license | package com.gdw.afn02;
import com.gdw.afn01.AbstractAfn01;
import com.gdw.annotation.Item;
/**
* 退出登录
*/
@Item(name = "退出登录", fn = 2)
public class F2 extends AbstractAfn01 {
}
|
C# | UTF-8 | 832 | 2.859375 | 3 | [] | no_license | using Sirenix.OdinInspector;
using UnityEngine;
namespace Kit.Behaviours
{
/// <summary>Move the <see cref="Transform" /> in a given direction.</summary>
public class MoveInDirection: MonoBehaviour
{
/// <summary>Direction to move in.</summary>
[ShowInInspector]
[PropertyTooltip("Direction to move in.")]
pu... |
Java | UTF-8 | 1,677 | 1.828125 | 2 | [] | no_license | package com.oop.service;
import java.util.Date;
import java.util.List;
import com.oop.model.AppointmentModel;
import com.oop.model.UserAppointmentModel;
import com.oop.model.UserModel;
import com.oop.model.VehicleModel;
public interface AppointmentServices {
public AppointmentModel createAppointment(String userId ,... |
Swift | UTF-8 | 2,270 | 2.875 | 3 | [
"MIT"
] | permissive | //
// Binding.swift
// SwiftBindings
//
// Created by bakaneko on 21/11/2014.
// Copyright (c) 2014 nekonyan. All rights reserved.
//
import Foundation
import ObjectiveC
let bindingContext = UnsafeMutablePointer<()>()
/**
* Swift-based basic 2-way binding.
*/
public class BasicBinding<T: Equatable, O1: Mutable... |
Python | UTF-8 | 6,058 | 3 | 3 | [] | no_license | # 导入并行调度模块
import random
import rpc
# 导入Object Stream模块
import network
class Sum(rpc.AbsSimpleExecutor):
def __init__(self, node_id: int, working_group: set, initializer_id):
"""
构造函数接收的参数是固定的,无法增加新的参数,所需的其他数据要依赖 requests
方法在构造后请求。
:param node_id: 指示当前 Executor 在哪个 Worker... |
PHP | UTF-8 | 341 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php namespace common\models;
use yii\base\Model;
/**
* Class Route
* @package old_backend\models
*/
class Route extends Model
{
/**
* @var string Route value.
*/
public $route;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['route'], 'safe']... |
Markdown | UTF-8 | 913 | 2.765625 | 3 | [] | no_license | ---
layout: post
title: "github Permission denied (publickey)"
date: 2018-11-01 17:19:44 +0800
comments: true
categories: technology
keywords: Permission denied
---
今天重新生成了github的ssh key,添加完以后发现提示
``` ssh
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure y... |
C | UTF-8 | 333 | 3.609375 | 4 | [] | no_license | #include "holberton.h"
/**
* _strcmp - compares two strings.
*
* @s1: first string.
* @s2: second string.
* Return: Always 0.
*/
int _strcmp(char *s1, char *s2)
{
int result;
int i = 0;
while (s1[i] == s2[i])
{
if (s1[i] == '\0' && s2[i] == '\0')
{
break;
}
i++;
}
result = s1[i] - s2[i];
return... |
JavaScript | UTF-8 | 1,690 | 2.8125 | 3 | [
"MIT"
] | permissive |
// Read data from the filtered selection made bu the user
// and render as a table
d3.csv("../resources/filter/summaryData.csv", function(error, data) {
if (error) throw error;
var sortAscending = true;
var table = d3.select('#page-wrap').append('table');
var titles = d3.keys(data[0]);
var hea... |
JavaScript | UTF-8 | 3,166 | 4.53125 | 5 | [] | no_license | /*
The power of an integer x is defined as the number of steps needed to transform x into 1 using the following steps:
if x is even then x = x / 2
if x is odd then x = 3 * x + 1
For example, the power of x = 3 is 7 because 3 needs 7 steps to become 1 (3 --> 10 --> 5 --> 16 --> 8 --> 4 --> 2 --> 1).
Given three intege... |
Java | UTF-8 | 9,906 | 1.84375 | 2 | [] | no_license | package net.richardsprojects.teamod.main;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.c... |
Java | UTF-8 | 2,578 | 2.59375 | 3 | [] | no_license | package com.ssafy.edu.vue.dto;
import java.io.Serializable;
//com.ssafy.edu.vue.dto.EmployeeDto
public class EmployeeDto implements Serializable {
private int id;
private String name;
private String mailid;
private String start_date;
private int manager_id;
private String title;
private int dept_id;
private do... |
Java | UTF-8 | 1,001 | 2.40625 | 2 | [] | no_license | package com.jack.service.common.crawler.parse.factory.impl;
import com.jack.service.common.crawler.model.GrabType;
import com.jack.service.common.crawler.parse.Parser;
import com.jack.service.common.crawler.parse.factory.ParserFactory;
/**
*
* @ClassName: AbstractParserFactory
* @Description:
* @author lksoulman... |
C | UTF-8 | 1,286 | 4 | 4 | [] | no_license | #include<stdio.h>
int main(){
int n[10], input ; // declaring array 'n' and input number to be searched as 'input'
for(int i = 0 ; i<10 ; i++) // using -for- loop for iterating elements in array 'n'
{
scanf("%d,",&n[i]) ;
}
scanf("%d",&input) ; // taking 'input' from scanf
int a = 0 ... |
Markdown | UTF-8 | 1,052 | 2.546875 | 3 | [] | no_license | # Vue 3 新手夏令營
- [活動網址](https://www.hexschool.com/2021/07/07/2021-07-07-vue3-summer-camp/)
- [上課文件 | HackMD](https://hackmd.io/@dbFY0UD9SUeKmNXhWf01ew/BkJoW-hn_/%2Fa2b7-VbeR5KOsArLSRWy1Q)
- 上課影片
- [week1 : Vue.js 3 起手式教學](https://www.youtube.com/watch?v=gCd8Kg7avc0&t=8s&ab_channel=%E5%85%AD%E8%A7%92%E5%AD%B8%E9%99%A2... |
Python | UTF-8 | 805 | 2.96875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat May 9 12:13:15 2020
@author: leiya
"""
#注意用dp时候先给dp声明空间
#注意迭代公式里还有上步更新的dp值
class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
row = len(grid)
col = len(grid[0])
dp = [[0 for _ in range(col)] for _ in range(row)]
for i in r... |
Python | MacCentralEurope | 2,026 | 3.703125 | 4 | [] | no_license | # Python Optparse
# optparse Parser for command line options.
# optparse is a more convenient, flexible, and powerful library for parsing command-line options than the old getopt module.
# optparse uses a more declarative style of command-line parsing: you create an instance of OptionParser, populate it with option... |
Java | UTF-8 | 454 | 2.546875 | 3 | [] | no_license | package CommonClasses;
//public class LobbyInformationMessage extends Message{
//
// private enum StatusType {playerLogin, playerLogout };
// private StatusType state;
// private String playerName;
// private int playerID;
//
// public LobbyInformationMessage(String playerName, int playerID, StatusType s) {
// sup... |
C++ | UTF-8 | 1,468 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef V4L2_Capability
#define V4L2_Capability
/**
* Represents the capabilities of a V4L2 device.
* Must be associated with a particular Device*. (TODO: Is this good?)
*/
#include <string>
#include <linux/videodev2.h>
struct v4l2_capability;
namespace V4L2 {
class Device;
}
namespace V4L2 {
class Capability
... |
Java | UTF-8 | 826 | 2.15625 | 2 | [] | no_license | package br.ifmg.edu.trabalho_java_avancado.visao.Vendas;
import javax.swing.table.AbstractTableModel;
/**
*
* @author Vitor
*/
public class ItensVendaTableModel extends AbstractTableModel {
@Override
public int getRowCount() {
throw new UnsupportedOperationException("Not supported yet.... |
Java | UTF-8 | 608 | 2.671875 | 3 | [] | no_license | package br.fepi.si.interfaces;
public abstract class Pessoa implements ValidaIdentificacao {
private String cpf;
private String nome;
public static final int caracteres = 11;
/**
* @param cpf
* @param nome
*/
public Pessoa(String cpf, String nome) {
this.cpf = cpf;
this.nome = nome;
}
public ... |
Python | UTF-8 | 326 | 3.34375 | 3 | [] | no_license | #!/usr/bin/env python3
import sys
inPath = sys.argv[1]
with open(inPath) as file:
for line in file:
phrases = line.strip().split(',')
# print label in caps
print(phrases[0].upper(), end=" ")
for phrase in phrases[1:]:
print(phrase.replace(" ", "_"), end=" ")
pr... |
Java | UTF-8 | 335 | 2.65625 | 3 | [] | no_license | package packInterface;
public class ImplementierendeKlasse implements ISchnittstelle{
@Override
public void method01() {
System.out.println("method01()");
}
@Override
public void method02() {
System.out.println("method02()");
}
public void method03() {
System.out.println("method03()"... |
Python | UTF-8 | 2,989 | 3.171875 | 3 | [
"MIT"
] | permissive | #coding=utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import numpy as np
class LeNet5(nn.Module):
# 定义Net的初始化函数,这个函数定义了该神经网络的基本结构
def __init__(self):
super(LeNet5,... |
Markdown | UTF-8 | 2,541 | 2.890625 | 3 | [] | no_license | # Dockerfile Sources
Tool that given a list of repositories, it identifies all the Dockerfile files inside each repository, extracts the image names from the FROM statement, and returns a json with the aggregated information for all the repositories.
## Usage:
Install python3 and requirements on your machine:
```
pip3... |
Python | UTF-8 | 1,630 | 2.6875 | 3 | [] | no_license | from app.models import UserType
from app.postgres import nationality_functions
def create_user_type(identification_number, resident, last_address, nationality_id):
try:
_nationality_id = nationality_functions.find_nationality_by_id(nationality_id)
user_type = UserType(identification_number = identi... |
Java | UTF-8 | 233 | 1.820313 | 2 | [] | no_license | package modelo;
import javabeans.Cliente;
public interface GestionClientes {
boolean estaRegistrado(String user, String pass);
void registrar(Cliente c);
Cliente obtenerCliente(String usuario, String password);
} |
Java | GB18030 | 1,549 | 1.960938 | 2 | [] | no_license | package com.kingdee.eas.fdc.sellhouse;
import com.kingdee.bos.framework.ejb.EJBRemoteException;
import com.kingdee.bos.util.BOSObjectType;
import java.rmi.RemoteException;
import com.kingdee.bos.framework.AbstractBizCtrl;
import com.kingdee.bos.orm.template.ORMObject;
import com.kingdee.bos.util.*;
import com.kingdee... |
Markdown | UTF-8 | 4,485 | 3.453125 | 3 | [] | no_license | ### 第3章 流、元素与基本尺寸
##### 块级元素:里元素默认的display值是list-item,<table>元素默认的display值是table,但是他们均是“块级元素“,因为他们都符合块级元素的基本特征,
也就是一个水平流上只能单独显示一个元素,多个元素则换行显示。
由于块级元素的换行特性,所以他们可以配合clear属性来清除浮动带来的影响。
```
.clear:after{
content:"";
display:table;//也可以是block,或者是list-item
clear:both;
}
```
ie不支持伪元素的display值为list-item
##### 为什么li... |
Python | UTF-8 | 2,937 | 2.546875 | 3 | [] | no_license | #! /usr/bin/env python3
import os
import re
basedir = os.path.abspath(os.path.dirname(__file__))
f_path = basedir + '/static/axure/'
rootNodes = 'rootNodes'
pageName = 'pageName'
url = 'url'
type = 'type'
children = 'children'
class Axure:
def __init__(self, id):
path = f_path + str(id) + '/data/documen... |
C | UTF-8 | 836 | 3.5 | 4 | [] | no_license | #include <stdio.h>
#include <sys/time.h>
int main () {
double sum = 0;
double add = 1;
// Start measuring time
struct timeval begin, end;
gettimeofday(&begin, 0);
int iterations = 1000*100;
for (int i=0; i<iterations; i++) {
sum += add;
add /= 2.0;
}... |
Python | UTF-8 | 1,782 | 2.921875 | 3 | [] | no_license | import time
import datetime
import spidev as SPI
import SSD1306
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import matplotlib.pyplot as plt
from sklearn import datasets, svm, metrics
import numpy as np
RST = 19
DC = 16
bus = 0
device = 0
disp = SSD1306.SSD1306(rst=RST,dc=DC,spi=SPI.SpiDev... |
Python | UTF-8 | 238 | 2.671875 | 3 | [] | no_license | r,c=map(int,input().split())
m=[input().split() for i in range(r)]
for i in range(r):
for j in range(c):
if m[i][j]=='B':
m[i][j]='-'
m=[sorted(i) for i in list(zip(*m))]
m=list(zip(*m))
for i in m:
print(*i)
|
Java | UTF-8 | 1,695 | 2.546875 | 3 | [] | no_license | package wordnet.App.Service.Impl;
import org.springframework.stereotype.Component;
import wordnet.App.Service.ChooseMeanOfSynset;
import wordnet.ProcessDataInput.Model.Synset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Created by chien on 19/03/2018.
*/
pub... |
Java | UTF-8 | 471 | 1.898438 | 2 | [] | no_license | package currencyexchange.service;
import currencyexchange.model.ExchangeTransaction;
import currencyexchange.vo.TransactionsListVO;
public interface ExchangeTransactionService {
public void addTransaction(ExchangeTransaction exchangeTransaction);
public TransactionsListVO getTransactions(String userName);
... |
C++ | UTF-8 | 4,067 | 2.953125 | 3 | [] | no_license | /* *********************************************
* Programmer Name: Ashley De Lio
*
* Z-ID: Z1723695
*
* Class: CSCI 330 - 2
*
* Program: Assignment 9
*
* Purpose: Exercise TCP server socket system
* calls. Program implements a simple
* file server.
* *******************************************... |
Python | UTF-8 | 1,159 | 2.875 | 3 | [] | no_license | # coding=UTF-8
import numpy as np
class ConvolutionLayer(object):
def __init__(self, filter_size, filter_num, stride, padding=0):
self.filter_size = filter_size
self.filter_num = filter_num
self.stride = stride
self.padding = padding
# 使用均值为0、标准差为1的高斯分布初始化卷积核
# 组织... |
PHP | UTF-8 | 776 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace ComposerUnused\SymbolParser\Parser\PHP\Strategy;
use PhpParser\Node;
use PhpParser\Node\Expr\StaticCall;
final class StaticStrategy implements StrategyInterface
{
public function canHandle(Node $node): bool
{
if (!$node instanceof StaticCall) {
re... |
C | WINDOWS-1251 | 1,918 | 4.03125 | 4 | [] | no_license | #include "math.h"
#include "stdio.h"
#include "stdlib.h"
/* , sin(x) main*/
double Nextsin(double x, int i)
{
double result;
result = pow(-1, i) * pow(x, 2 * i) / (2 * i * (2 * i + 1));
return result;
}
/* , cos(x) main*/
double Nextcos(double x, int i)
{
double resu... |
Shell | UTF-8 | 224 | 2.9375 | 3 | [
"Unlicense"
] | permissive | #!/bin/bash
# Deletes all compiled junk from folders
_startdir=$(pwd)
for _fullpath in $(find . -type d -name 'target'); do
_path=$(dirname "$_fullpath")
cd "$_path"
cargo clean && echo "'cargo clean' run on $_path"
done
|
Java | UTF-8 | 546 | 2.84375 | 3 | [] | no_license | package pl.jedrik94.prototype_pattern;
import org.apache.commons.lang3.SerializationUtils;
import pl.jedrik94.prototype_pattern.model.Person;
import pl.jedrik94.prototype_pattern.model.Address;
public class AppPrototype {
public static void main(String[] args) {
Person jedrzej = new Person("Jedrzej", new ... |
Java | UTF-8 | 1,400 | 2.453125 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*
* Copyright 2019 ProximaX Limited. All rights reserved.
* Use of this source code is governed by the Apache 2.0
* license that can be found in the LICENSE file.
*/
package io.proximax.dfms.model.exceptions;
/**
* Types of errors that are returned by the HTTP API calls
*/
public enum ResponseErrorType {
/**... |
Java | UTF-8 | 1,313 | 2.578125 | 3 | [] | no_license | package com.example.dressassistant.database;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.content.Context;
import com.example.dressassistant.database.table.PersInfo;
/**
* Created by lyh on 2017-12-17.
*/
public class DataBaseHelper extends SQLite... |
C | UTF-8 | 960 | 3.390625 | 3 | [] | no_license | /*
LAbs week 8
Erik Grunner
Problem 3
*/
#include <stdio.h>
#define ROW 3
#define COL 2
int main()
{
int array[ROW][COL]={4,8,6,5,9,7};
int rowsum[ROW]={0};
int colsum[COL]={0};
int i,j;
int highest=0;
for(i=0;i<ROW;i++)
{
for(j=0;j<COL;j++)
{
rowsum[i]=rowsu... |
Python | UTF-8 | 842 | 2.84375 | 3 | [
"MIT"
] | permissive | import unittest
from acme import Product
from acme_report import generate_products, ADJECTIVES, NOUNS
class AcmeProductTests(unittest.TestCase):
"""Making sure Acme products are the tops!"""
def test_default_product_price(self):
"""Test default product price being 10."""
prod = Produc... |
Java | UTF-8 | 2,640 | 2.34375 | 2 | [] | no_license | /**
*
*/
package isa;
import arc_project.Global;
import arc_project.Instruction;
/**
* @author zzj
*
*/
public class InstructionSet_SRC extends Instruction {
/**
* Shift Register by Count
*/
public InstructionSet_SRC() {
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see arc_projec... |
Markdown | UTF-8 | 10,825 | 2.890625 | 3 | [] | no_license |
### Quick start
```
git clone https://github.com/ThomasLiu/comment.git
cd comment
npm install
```
### Run test
```
npm run test
```
运行test之前需要 通过 GET /api/appSecrets/new 获取 appId 和 appSecret 然后更新/config/sys.js 内的appId 和 appSecret
### Run
```
npm start
```
### Run pm2 for production
```
NODE_ENV=production pm2 s... |
Java | UTF-8 | 7,605 | 2.234375 | 2 | [] | no_license | package com.tencent.hz.utils;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.util.Log;
import android.widget.Toast;
import java.io.File;
import java.io.Fil... |
Java | UTF-8 | 484 | 1.984375 | 2 | [] | no_license | package com.example.awslambda.domain;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class StoreRepositoryTest {
@Autowired
... |
Python | UTF-8 | 3,733 | 2.53125 | 3 | [] | no_license | #coding:utf-8
import csv
import time
import datetime
import talib
import pandas
import numpy as np
from DBHelper import DBHelper
from DBConstants import DBConstants
READ_DB_PATH = "/home/k-sui/fxdata/fxdata.db"
WRITE_DB_PATH = "/home/k-sui/fxdata/fxdata.db"
# 各インジケータを近いレンジになるように整形する()
def formatIndicators():
#... |
PHP | UTF-8 | 197 | 2.65625 | 3 | [] | no_license | <?php
class randomTemplate {
public function randomize(){
$files = glob("templates" . '/*.*');
$file = array_rand($files);
copy($files[$file],"templates/style.css");
}
}
?> |
PHP | UTF-8 | 1,298 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Dvsa\Olcs\Api\Domain\CommandHandler\IrhpPermitWindow;
use Dvsa\Olcs\Api\Domain\CommandHandler\AbstractCommandHandler;
use Dvsa\Olcs\Api\Domain\Exception\NotFoundException;
use Dvsa\Olcs\Api\Domain\Exception\ValidationException;
use Dvsa\Olcs\Transfer\Command\CommandInterface;
/**
* Delete an IRHP Pe... |
TypeScript | UTF-8 | 4,519 | 3.03125 | 3 | [
"MIT"
] | permissive | import { tValues, cValues, binomialCoefficients } from "./bezier-values";
import { Point } from "./types";
export const cubicPoint = (xs: number[], ys: number[], t: number): Point => {
const x =
(1 - t) * (1 - t) * (1 - t) * xs[0] +
3 * (1 - t) * (1 - t) * t * xs[1] +
3 * (1 - t) * t * t * xs[2] +
t *... |
SQL | UTF-8 | 2,903 | 3.5 | 4 | [] | no_license | CREATE TABLE closet (
id SERIAL PRIMARY KEY,
closet_id integer,
clothing_item integer,
wearing boolean DEFAULT false
);
CREATE TABLE clothing_item (
id SERIAL PRIMARY KEY,
type integer,
icon character varying(50),
fit character varying(50),
color character varying(50),
length ch... |
C# | UTF-8 | 510 | 3.296875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GenericsInCShrap
{
class Program
{
static void Main(string[] args)
{
Comparision<int> comparison = new Comparision<int>();
Console.WriteLine(com... |
Python | UTF-8 | 362 | 2.75 | 3 | [] | no_license | import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
LIGHT = 4
GPIO.setup(LIGHT,GPIO.OUT)
try:
while True :
GPIO.output(LIGHT,True)
time.sleep(0.5)
GPIO.output(LIGHT,False)
time.sleep(0.5)
print("blink")
except KeyboardI... |
Markdown | UTF-8 | 3,214 | 2.5625 | 3 | [
"MIT"
] | permissive | ---
templateKey: blog-post
title: Comandos de Git que uso todos los dìas
date: 2021-01-18T17:16:47.524Z
description: >-
Recuerdo cuando empezaba a programar, hace mas o menos 8 años. La forma de
agregar features a mi software era usando un servidor FTP y alterar archivos
directo en el servidor. Hacìa backups dupl... |
C# | UTF-8 | 749 | 3.015625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ConsumerProducer
{
class Writer
{
private Data data;
private Random rnd;
private bool stopper;
public Writer(Data data)
... |
Java | UTF-8 | 653 | 2.625 | 3 | [
"MIT"
] | permissive | package biologicalparkticketsystem.model.course;
/**
* Interface to define criteria strategy used for path calculation
*/
public interface ICriteriaStrategy {
/**
* Method to retrieve the edge weight depending on the strategy
* @param connection connection to get weight
* @return ed... |
JavaScript | UTF-8 | 1,968 | 2.96875 | 3 | [] | no_license | const range = document.querySelector("#strength");
const circle = document.querySelector(".dot");
const color = (e) => {
if (e === "1") {
circle.style.backgroundColor = "#D7CCC8";
} else if (e === "2") {
circle.style.backgroundColor = "#BCAAA4";
} else if (e === "3") {
circle.style.... |
Java | UTF-8 | 116 | 2.34375 | 2 | [
"MIT"
] | permissive | interface Numbers {
static double twoDecimalPlaces(double number) {
return (int) (number * 100) / 100.;
}
}
|
Java | UTF-8 | 4,298 | 2.59375 | 3 | [] | no_license | package com.neo.headhunter.manager.bounty;
import com.neo.headhunter.HeadHunter;
import com.neo.headhunter.util.config.ConfigAccessor;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.ConfigurationSection;
import java.util.*;
public final class BountyManager extends ConfigAc... |
PHP | UTF-8 | 6,468 | 2.578125 | 3 | [] | no_license | <?php
/*==================================================
MODELE MVC DEVELOPPE PAR Ngor SECK
ngorsecka@gmail.com
(+221) 77 - 433 - 97 - 16
PERFECTIONNEZ CE MODEL ET FAITES MOI UN RETOUR
VOUS ETES LIBRE DE TOUTE UTILISATION
Document redefini par samane_ui_admin de Pierre Yem Mback dialrock3... |
C# | UTF-8 | 797 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Plugin.Connectivity;
namespace feelLuckyApp
{
public class CloudDataStore : IDataStore
{
HttpClient client;
public CloudDataStore()
{
... |
Java | UTF-8 | 417 | 2.453125 | 2 | [] | no_license | package com.anup.paint.command.exception;
import com.anup.paint.command.model.InputCommand;
public class CommandTypeNotSupportedBaseException extends InputCommandBaseException {
public CommandTypeNotSupportedBaseException(InputCommand input) {
super("Command type - "+input.getCommandType()+" not supported... |
PHP | UTF-8 | 1,131 | 2.640625 | 3 | [] | no_license | <?php
namespace app\modules\mediator\implementation\messages;
use app\modules\contactList\externalContracts\give\UserGetContactsInterface;
use app\modules\messages\externalContracts\get\UserContactListInterface;
use app\modules\user\externalContracts\give\UserFinderInterface;
class UserContactList implements UserCon... |
Python | UTF-8 | 3,107 | 2.703125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# created on 2014-03-31 19:07:37
"""
做成类似于Spring的@RequestParam注解的decorator形式,但是现在获得的函数参数有些问题
"""
__author__ = 'wangqunwhuhb@126.com'
import inspect
import logging
def str2IntList(s):
return map(int, s)
def request_param(method="GET", arg_offset=1, *args, **kwargs):
... |
Java | UTF-8 | 4,748 | 1.976563 | 2 | [] | no_license | package com.cczu.model.sbssgl.controller;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariab... |
C# | UTF-8 | 782 | 2.828125 | 3 | [] | no_license | using SocketsShared.DTOs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebSocketsService.Hubs;
namespace WebSocketsService.Mapper
{
public static class HubMapper
{
public static HubDto Map(this BaseHub hub)
{
return new HubD... |
Java | UTF-8 | 4,124 | 2.0625 | 2 | [] | no_license | package com.netmi.baselibrary.widget;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
import com.netmi.baselibrary.R;
import com.ne... |
C++ | UTF-8 | 371 | 3.390625 | 3 | [] | no_license | #include <string>
#include <algorithm>
#include <iostream>
using namespace std;
string convertToTitle(int columnNumber)
{
string ans;
while (columnNumber--)
{
ans += columnNumber % 26 + 'A';
columnNumber /= 26;
}
reverse(ans.begin(), ans.end());
return ans;
}
int main()
{
s... |
Python | UTF-8 | 161 | 2.796875 | 3 | [] | no_license | import turtle_square_using_function
repeat = 5;
while(repeat>0):
print("repeat : ",str(repeat));
turtle_square_using_function.square();
repeat -= 1
|
Markdown | UTF-8 | 1,478 | 2.90625 | 3 | [] | no_license | title: Swift设计模式之策略模式
categories: ios
tags: 设计模式
date: 2016-05-10 17:36:01
---
<!--head-->
**转自**
* [Swift设计模式](http://qefee.com/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/)
**原文**
* [Design-Patterns-In-Swift](https://github.com/ochococo/Design-Patterns-In-Swift#behavioral)
<!--more-->
<!--body-->
```swift
... |
Python | UTF-8 | 508 | 3.5625 | 4 | [] | no_license | #!/usr/bin/env python3
"""
Module to add matrices
"""
def add_matrices(mat1, mat2):
"""
Adds two matrices
"""
if len(mat1) != len(mat2):
return None
addMatrix = []
for i in range(len(mat1)):
if isinstance(mat1[i], list):
resultAxis = add_matrices(mat1[i], mat2[i])
... |
PHP | UTF-8 | 5,383 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace Bdf\Prime\Mapper\Info;
use Bdf\Prime\Mapper\Metadata;
use Bdf\Prime\Types\PhpTypeInterface;
use Bdf\Prime\Types\TypeInterface;
use Bdf\Prime\Types\TypesRegistryInterface;
use DateTimeInterface;
/**
* PropertyInfo
*/
class PropertyInfo implements InfoInterface
{
/**
* The property name
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.