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 | 1,353 | 2.25 | 2 | [] | no_license | package com.spring_gradle.springgradle.entity;
import java.time.LocalDate;
import java.time.LocalDateTime;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="tbl_hanRiverInfo")
public class HanRiver {
@Id
... |
Python | UTF-8 | 390 | 3.65625 | 4 | [] | no_license | #example code for slicing with positive indexing and negative indexing
#careful: You can also slice with negative indices.
#The same basic rule of starting from the start index and stopping one before
#the end index applies
s = "testing slicing 101"
print(len(s))
print(s[4:10])
print(s[2:10])
print(s[4:-7])
print(s[-7... |
Python | UTF-8 | 4,035 | 2.9375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 18 21:03:22 2021
@author: Administrator
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 18 18:16:49 2021
获取交易对的数据
@author: ljn
"""
import pandas as pd
import datetime
import os
import ccxt
import time
pd.set_option('expand_frame_repr', False) # 当列太多时不换行
pd.set_optio... |
C | UTF-8 | 983 | 4.125 | 4 | [] | no_license | //http://www.geeksforgeeks.org/minimum-number-of-squares-whose-sum-equals-to-given-number-n/
#include <stdio.h>
int
min (int a, int b)
{
if (a > b ) return a;
return b;
}
// Returns count of minimum squares that sum to n
int getMinSquares(unsigned int n)
{
// base cases
if (n <= 3)
return n;
... |
Java | UTF-8 | 8,579 | 2.1875 | 2 | [] | no_license | package psb.com.kidpaint.utils;
/*
* Created by AMiR Ehsan on 7/22/2017.
*/
import android.content.Context;
import android.content.SharedPreferences;
import psb.com.kidpaint.webApi.register.registerUserInfo.model.UserInfo;
public class UserProfile {
private static Context context;
private static String ... |
Java | UTF-8 | 6,869 | 2.046875 | 2 | [] | no_license | package com.swaaad.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
i... |
C++ | WINDOWS-1251 | 991 | 2.734375 | 3 | [] | no_license | #include<iostream> /// cin/cout
using namespace std;
void main() // , ,
{ //
setlocale(LC_ALL, "Russian");
cout << "\t\t\t\t\tHello \"World\"!\n";
cout << "!\n"" ";
cout << "\n";
cout << endl;
cout << " ";
cout << "C:\\Windows\\System32\\\n";
}
//cout (Console Out) - .
//<< -
/*
---------... |
Markdown | UTF-8 | 9,662 | 3.34375 | 3 | [] | no_license | # Part.7 Architecture
## CH.25 Layers and Boundaries
Architectural boundaries are everywhere from simple to complex systems. To achieve clean architecture, manifesting boundaries between system components and defining layers between them is important.
In the chapter the author walks through an example of a simple game... |
Java | UTF-8 | 2,343 | 3.734375 | 4 | [] | no_license | package com.gfg.array;
/*
Given an array A of size N, construct a Product Array P (of same size) such that P is equal to the
product of all the elements of A except A[i].
Input:
The first line of input contains an integer T denoting the number of test cases. T testcases follow.
Each testcase contains two lines of in... |
C | UTF-8 | 1,936 | 2.75 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* vec3.c :+: :+: :+: ... |
Markdown | UTF-8 | 1,044 | 2.90625 | 3 | [
"CC-BY-4.0"
] | permissive | ---
pageType: section
path: '/rules/naming'
title: '1. Naming rules'
---
GraphQL uses regexp `/[_A-Za-z][_0-9A-Za-z]*/` to validate property and type names. In other words, GraphQL lets you use multiple styles, such as camelCase, under_score, UpperCamelCase end CAPITALIZED_WITH_UNDERSCORES. Notice that that kebab-case... |
Java | UTF-8 | 951 | 2.84375 | 3 | [
"MIT"
] | permissive | package it.polimi.ingsw.utils;
/**
* Class containing colors used in CLI
*/
public class ConsoleColors {
// Reset
public static final String RESET = "\033[0m"; // Text Reset
// Regular Colors
public static final String RED = "\033[0;31m";
public static final String GREEN = "\033[0;32m";
pu... |
Shell | UTF-8 | 225 | 3 | 3 | [] | no_license | if [[ "$(pamixer --get-mute)" = "true" ]]; then
icon=""
color="#ffff00"
else
icon=""
color="#dddddd"
fi
vol=$(pamixer --get-volume)
printf "%s %s%%\n" "$icon" "$vol"
printf "Volume\n"
printf "$color\n"
|
Java | UTF-8 | 913 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | package com.opdar.gulosity.connection.protocol;
/**
* Created by Shey on 2016/8/19.
*/
public class HeaderProtocol implements Protocol {
private int bodyLength;
private byte sequence;
/**
Up to MySQL 3.22, 0xfe was followed by a 4-byte integer.
*/
public void fromBytes(byte[] data) {
... |
C++ | ISO-8859-3 | 812 | 2.703125 | 3 | [] | no_license | /**
* BOJ
* No.1166
* @author peter9378
* @date 2021.01.26
*/
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <map>
#include <queue>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <cstring>
#include <iterator>
#include ... |
Java | UTF-8 | 1,628 | 2.296875 | 2 | [] | no_license | package com.hasanemreerkek.services;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClientBuilder;
import org.springframework.stereotype.Service;
... |
Markdown | UTF-8 | 1,465 | 2.890625 | 3 | [] | no_license | # Crazy little thing called love
```
This thing called love, I just can't handle it
This thing called love, I must get round to it
I ain't ready
Crazy little thing called love
This thing (this thing)
Called love (called love)
It cries (like a baby)
In a cradle all night
It swings (woo woo)
It jives (woo woo)
It shakes... |
Java | UTF-8 | 2,263 | 2.203125 | 2 | [] | no_license | package ecorau.demo.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.... |
Python | UTF-8 | 1,821 | 2.671875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat May 30 14:23:29 2020
@author: Mariusz
"""
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 13:47:10 2020
Script to detect objects using Google Net classifier
it required following files:
bvlc_googlenet.prototxt
bvlc_googlenet.caffemodel
classifica... |
Markdown | UTF-8 | 1,448 | 2.6875 | 3 | [] | no_license | # Sparkify Udacity Data Scientist Nano Degree Capstone Project:
## Index:
Dependencies
Project Motivation
Files Description
Results
Acknowledgements
## Dependencies
The following libraries are used to implement this project:
Pandas
PySpark
Spark
Matplotlib
Seaborn
## Project Motivation
The current proj... |
C# | UTF-8 | 7,461 | 2.796875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using CommandController.Core;
namespace CommandController.FrontEnds.CommandLine
{
/// <summary>
/// Controller for the command line front-end.
/// </summary>
public class CommandLineControll... |
JavaScript | UTF-8 | 575 | 2.796875 | 3 | [] | no_license | import React from 'react'
import { render } from 'react-dom'
class ComplimentMachine extends React.Component{
constructor(props){
super(props)
this.state = {name : '________'}
}
handleInput(event){
this.setState({
name: event.target.value
})
console.log(event.target.value)
... |
Markdown | UTF-8 | 1,010 | 3.40625 | 3 | [] | no_license |
### Leetcode 78
#### [Subsets](https://leetcode.com/problems/subsets)
##### ***Problem:***
Given a set of distinct integers, nums, return all possible subsets.
The solution set must not contain duplicate subsets.
##### ***Example:***
Input: [1,2]
Output: [[], [1], [2], [1,2]]
##### *Met... |
C++ | UTF-8 | 1,582 | 2.59375 | 3 | [] | no_license | #ifndef PROCESSDATA_H
#define PROCESSDATA_H
#include <atomic>
#include <vector>
#include <map>
#include <boost/thread.hpp>
#include "IODataTypes.h"
class ProcessData
{
public:
ProcessData(unsigned int update_intervall);
std::atomic<bool> run_;
virtual ~ProcessData();
/**
* parsing ds buffer ... |
C | UTF-8 | 920 | 4.375 | 4 | [] | no_license | #include <stdio.h>
/* 描述: 直接插入排序,该函数最终将数据排列成升序。 */
void insert_sort(int *data, int nitems)
{
int sorted_pos = 0;
int cur_pos = 0;
int cur_data;
if (nitems == 1) {
return;
}
for (sorted_pos = 0; sorted_pos < nitems; sorted_pos ++)
{
cur_data = data[sorted_pos + 1];
for (cur_pos = sorted_pos ; cur_pos >= ... |
Java | UTF-8 | 2,392 | 2.75 | 3 | [] | no_license | // Copyright (C) 2016-2017 GWGW All rights reserved
package com.mmc.java.base.system.io.seria;
import java.io.Externalizable;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectInpu... |
Markdown | UTF-8 | 1,837 | 2.546875 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | <!--author=SharS last changed: 9/17/15-->
#### <a name="to-create-a-new-service"></a>创建新服务
1. 使用 Microsoft 帐户凭据登录到 [Microsoft Azure 政府门户](https://portal.azure.us/)。
2. 在政府门户中,单击 **+**,然后在应用商店中单击“查看所有”。 搜索“StorSimple 物理”。 选择并单击“StorSimple 物理设备系列”,单击“创建”。 或者,在政府门户中,单击 **+**,然后在“存储”下单击“StorSimple 物理设备系列”。
3. 在“StorSimpl... |
PHP | UTF-8 | 1,289 | 2.53125 | 3 | [] | no_license | <?php
namespace Tests\Unit;
use Tests\TestCase;
class ConverterTest extends TestCase
{
public function testI()
{
$response = $this->get('/api/convert?number=I');
$response->assertJson([
'result' => 1,
]);
}
public function testV()
{
$response = $this-... |
TypeScript | UTF-8 | 300 | 2.8125 | 3 | [] | no_license | export let pi2: number = Math.PI * 2;
export let angle270: number = Math.PI * 1.5;
export function getDistance (x1: number, y1: number, x2: number, y2: number): number {
let xDistance = x1 - x2;
let yDistance = y1 - y2;
let d = Math.sqrt(xDistance**2 + yDistance**2);
return d;
}
|
Markdown | UTF-8 | 827 | 2.890625 | 3 | [] | no_license | ## Tic Tac Toe with Allegro
### Presenteation
Le jeu de Tic Tac Toe implémenté en C avec la bibliothéque Allegro5.
Propose un mode Solo et un mode multijoueur.
Le mode Solo propose 3 niveaux :
* Easy (facile) : L'ordinateur joue de facon aléatoire (faut vraiment le vouloir pour perdre x) ).
* Medium (Moyen) : L'ordi... |
C | UTF-8 | 4,839 | 3.453125 | 3 | [] | no_license | #include <ctype.h>
#include <errno.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
enum { MAX_STRING_LENGTH = 63 };
char get_char(int is_input_file, FILE *stream) {
if (is_input_file) {
return fgetc_unlocked(stream);
} else {
return getchar_unlocked();
}
}
... |
C++ | UTF-8 | 456 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <ctime>
#include "model.h"
using namespace std;
int main(int argcc, char** argv)
{
srand48( time( NULL ) );
int num_part = 1000;
int MAX_ITER = 1000;
Model model;
model.initiate(num_part);
model.decompose_domain(5);
clock_t begin = clock();
model.simulate(MAX_ITER);
model.sav... |
Markdown | UTF-8 | 714 | 2.625 | 3 | [] | no_license | # Docker Config Server Example
> Simple Docker example of config server/service app
## config-server
Contain jar file of project config-server in this directory to create image
Run Dockerfile to create image
```
docker build -t “config-server:Dockerfile” .
```
## bank-account-service
Contain jar f... |
C++ | UTF-8 | 4,352 | 3.125 | 3 | [] | no_license | #ifndef _zString_H_
#define _zString_H_
#include <string>
namespace Tools
{
inline std::string& string_replace(std::string& str, const std::string& str_src, std::string& str_dst)
{
std::string::size_type pos(0);
std::string::size_type src_len = str_src.size();
std::string::size_type dst_len = str_dst.size();
... |
Markdown | UTF-8 | 1,644 | 3.40625 | 3 | [] | no_license | **Signup**
----
Register a new user account with the given email address and password, if they match the validation criterias (valid email format and password at least 6 characters including letters and numbers).
* **URL**
/v1/user/signup
* **Method:**
`POST`
* **URL Params**
* None
* **Data Params**
*... |
Rust | UTF-8 | 1,073 | 3.015625 | 3 | [
"BSD-3-Clause",
"MIT",
"Python-2.0"
] | permissive | use crate::geometry::Axis;
use crate::geometry::Ball;
use crate::geometry::Bone;
use crate::geometry::Vector;
use crate::render::GroupTracer;
use crate::render::WorldView;
#[derive(Clone, Debug)]
pub struct Leg {
pub hip: Ball,
pub knee: Ball,
pub hoof: Ball,
pub calf: Bone,
pub shin: Bone,
}
impl... |
Java | UTF-8 | 4,410 | 2.390625 | 2 | [] | no_license | package com.liger.myzhihu.model;
import java.util.List;
/**
* 最新新闻 实体类
* Created by Shuai on 2015/12/19.
*/
public class Latest {
/**
* date : 20151219
* stories : [{"images":["http://pic4.zhimg.com/9a79d6be3a24861e586c6eee89144d43.jpg"],"type":0,"id":7619784,
* "ga_prefix":"121909","title":"官员... |
Java | UTF-8 | 1,086 | 2.359375 | 2 | [] | no_license | package me.littlekey.update;
import android.content.Context;
import android.text.TextUtils;
/**
* A class to hold global update configure.
* <p/>
* Created by nengxiangzhou on 16/4/13.
*
*/
public class UpdateConfig {
private static final String PREFS_UMENG_UPDATE = "update";
private static final String KEY_... |
Markdown | UTF-8 | 1,526 | 3.703125 | 4 | [] | no_license | # 泛型和类型声明
## 泛型
在声明函数时不指定具体类型, 调用的时候再去指定
> 由于很多时候需要通用函数, 但是限制死参数过后, 函数就不够通用了, 因此我们需要将类型也变成一个统一的参数
如下:
```typeScript
// 但是这个函数只能创建数字类型的数组, 不能创建string类型的数组, 这一就不太行了
function createNumArr (lenght: number, vlaue: number): number[] {
return Array<number>(length).fill(value);
}
// 因此更合理的办法就是使用泛型, 就是将类型也变成参数
// 泛型就是使... |
Markdown | UTF-8 | 8,871 | 2.8125 | 3 | [] | no_license | 一零二
白奇点头承认:
“十足收齐,我的规矩,向来不赊不欠,一次头尾付清。”
靳百器沉重的道:
“没有考虑的余地了么?”
白奇语声颇有憾意:
“我们这一行的情形与传统,相信你不会陌生,接下买卖,收过代价,就算一锤敲定,天皇老子也扭不回转,靳百器,坦白说我对你的印象蛮好,要不是承诺在先,这笔生意我可能会重新考虑……”
靳百器平静的道:
“见到你,觉得你并不像一般杀手那样形色狰狞,张牙舞爪,我才希望你再加斟酌;白奇‘大龙会’姓赵的买凶前来谋害于我,已不止一遭了,可是,事实摆在眼前,我活着,那些个杀手却阴阳转世去了。”
白奇有点不大高兴的道:
“他们... |
PHP | UTF-8 | 2,711 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: compiler
* Date: 18-3-23
* Time: 下午8:40
*/
namespace app\api\controller\v1;
use app\api\controller\BaseController;
use app\api\model\UserAddressModel;
use app\api\model\UserModel;
use app\api\service\Token as TokenService;
use app\api\validate\AddressNew;
use app\lib\exc... |
Python | UTF-8 | 271 | 2.625 | 3 | [] | no_license | import sys
import requests
#print(sys.version)
print(sys.executable)
def greet(who_to_greet):
greeting = 'Hello, {}'.format(who_to_greet)
return greeting
print (greet('Life!'))
print(greet('Life!'))
r = requests.get('ht
tps://python.org')
print(r.status_code) |
Java | UTF-8 | 3,398 | 3.84375 | 4 | [] | no_license | package cn.skyjilygao.leetcode;
import java.util.Arrays;
/**
* 题目:给你两个有序整数数组 nums1 和 nums2,请你将 nums2 合并到 nums1 中,使 nums1 成为一个有序数组。
* <p> 说明:1. 初始化 nums1 和 nums2 的元素数量分别为 m 和 n 。
* <br> 2. 你可以假设 nums1 有足够的空间(空间大小大于或等于 m + n)来保存 nums2 中的元素。
* <p> Leetcode题: <a href="https://leetcode-cn.com/problems/merge-sorted-arr... |
Python | UTF-8 | 220 | 3.75 | 4 | [] | no_license | #replace() method
#find() method
string = ' she is beautiful and she is good dancer'
#print(string.replace('','_'))
print(string.replace('is','was',1))
pos_1 = string.find('is',)
print(string.find('is',pos_1+1))
|
JavaScript | UTF-8 | 1,616 | 2.625 | 3 | [] | no_license | function dump_model() {
var elemObjects = []
$("#main .component").each(function (idx, elem) {
var $elem = $(elem);
var nextElem = {
group : $elem.attr('group'),
type : $elem.attr('type'),
id: $elem.attr('id'),
title : $elem.text(),
fields : {},
x: parseInt... |
Markdown | UTF-8 | 1,607 | 2.671875 | 3 | [
"MIT"
] | permissive | ---
title: "Animal World"
category: "Education/Accessible Technology"
date: "2015"
order: 7
image: "../../images/animalworld-thumbnail@2x.jpg"
alt: "Kids Sensory Wall"
role: "Creative technologist"
tasks: "User centered design, circuit design, hardware design, fabrication, coding"
technology: "Arduino, Eagle, Othermill... |
PHP | UTF-8 | 2,026 | 2.515625 | 3 | [] | no_license | <?php
namespace app\models;
use MongoDate;
class friends extends \Phalcon\Mvc\Collection
{
public $ts;
public $uid;
public $fid;
public function getSource()
{
return 'friends';
}
public function beforeCreate()
... |
Java | UTF-8 | 501 | 3.25 | 3 | [] | no_license | package multithreading;
public class ThreadExample1 {
public static void main(String[] args) {
MyThreadClass t1 = new MyThreadClass();
MyThreadClass t2 = new MyThreadClass();
MyThreadClass t3 = new MyThreadClass();
MyThreadClass t4 = new MyThreadClass();
MyThreadClass t5 = new MyThreadClass();
t1.start()... |
Java | UTF-8 | 1,958 | 2.984375 | 3 | [] | no_license | package cs3500.animator.model;
import java.util.Iterator;
import java.util.List;
/**
* A ExCellence Model interface that does not allow for any mutation.
*/
public interface ImmutableModel {
/**
* Access a list of IShapes that appear in the given time frame.
* INVARIANT: the shapes are returned in the orde... |
Python | UTF-8 | 562 | 4.28125 | 4 | [] | no_license | # Replacing all 'my_x' type variable names with 'x' - shorter names
name = 'Zed A. Shaw'
age = 35 # years
height = 74 # inches
weight = 180 # lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
print(f"Let's talk about {name}.")
print(f"He's {height} inches tall.")
print(f"He's {weight} pounds heavy.")
print("Actually t... |
PHP | UTF-8 | 743 | 2.609375 | 3 | [] | no_license | <?php
namespace Bluegrass\Blues\Component\Widget\View;
use Bluegrass\Blues\Component\View\ViewModel;
/**
* Representa una estructura con la información necesaria para ser
* representada en una vista de un widget.
*
* @author ldelia
*/
class WidgetViewModel extends ViewModel
{
public function getTemplate()
... |
Python | UTF-8 | 370 | 3.625 | 4 | [] | no_license | import random
import time
def rand_boo():
rand_num = random.randint(0,10)
time.sleep(int(rand_num))
print("boo")
def rand_trt():
rand_numb = random.randint(1,2)
if rand_numb == 1:
print("TRICK")
if rand_numb == 2:
print("TREAT")
def string(sentence):
full_sentence = ("spo... |
JavaScript | UTF-8 | 565 | 3.1875 | 3 | [] | no_license | const eventsURL = "cckoga.json"
fetch(eventsURL)
.then ((response)=>response.json())
.then ((jsObject)=>{
const events = jsObject['events'];
for (let i = 1; i<4; i++){
let name = document.createElement('h3');
name.textContent = events[i].name;
let div = document.createElement('div');
div.className = "eventitem";
co... |
C# | UTF-8 | 1,511 | 2.703125 | 3 | [
"MIT"
] | permissive | namespace WDModernise.Core
{
public class WDSentinelLowLevel : IWDSentinel
{
/*
* This class does not work yet.
*
* The intent of the Low Level class is to write a complete implementation of the communication with the hardware components of
* the NAS. We don't want t... |
TypeScript | UTF-8 | 4,786 | 2.625 | 3 | [] | no_license | import { Expr, ExprArg } from 'faunadb'
/*
* Ideally we limit the amount of calls that come to Login.
*/
const faunadb = require('faunadb')
const q = faunadb.query
const {
If,
Epoch,
Match,
Index,
Update,
Collection,
Let,
Var,
Paginate,
Select,
TimeDiff,
Or,
GTE,
Abort,
Create,
IsEmpt... |
Java | UTF-8 | 1,705 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | package net.ssehub.easy.varModel.cst;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import net.ssehub.easy.varModel.model.datatypes.IntegerType;
import net.ssehub.easy.varModel.model.datatypes.OclKeyWords;
import net.ssehub.easy.varModel.model.values.Value;
import net.ssehub.easy.varModel.... |
Java | UTF-8 | 693 | 3.53125 | 4 | [] | no_license | package util;
/**
* Created with IntelliJ IDEA.
* User: melvinj
* Date: 12/17/14
* Time: 12:03 AM
* A utility class to help print different data structures
*/
public class PrintUtils {
public static void printArray(int[] array) {
for (int i = 0; i < array.length; i++) {
System.out.print(array[i] + "... |
PHP | UTF-8 | 10,149 | 2.875 | 3 | [] | no_license | <?php
namespace CIOS ;
class StarDate
{
public $Stardate ;
function __construct( $SDT = 0 )
{
$this -> StarDate ( $SDT ) ;
}
function __destruct()
{
}
public function StarDate ( $SDT )
{
if ( is_a ( $SDT , "CIOS\StarDate" ) ) {
$this -> Stardate = $SDT -> Stardate ;
} else ... |
Python | UTF-8 | 3,081 | 3.4375 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
"""TcEx Framework Redis Module"""
from builtins import str
import redis
class TcExRedis(object):
"""Create/Read Data in/from Redis"""
def __init__(self, host, port, rhash):
"""Initialize the Class properties.
Args:
host (string): The Redis host.
... |
Java | UTF-8 | 348 | 1.976563 | 2 | [] | no_license | package br.com.agendaAPI.service.exceptions;
public class ContactNotFound extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 2426058236132643557L;
public ContactNotFound(String mensagem) {
super(mensagem);
}
public ContactNotFound(String mensagem, Throwable error) {
s... |
JavaScript | UTF-8 | 495 | 2.546875 | 3 | [
"ISC"
] | permissive | 'use strict'
const humanizeNumber = require('humanize-number')
const pluralize = require('pluralize')
module.exports = (benchmark) => {
const ops = benchmark.hz // Can be null on the first run if it executes really quickly
? humanizeNumber(benchmark.hz.toFixed(benchmark.hz < 100 ? 2 : 0))
: 0
const marginO... |
Python | UTF-8 | 4,358 | 3.3125 | 3 | [] | no_license | import numpy as np
import itertools
import networkx as nx
import matplotlib.pyplot as plt
# Tested on Python 3.5, use with Python 3+
class UndirectedErdosRenyi:
def __init__(self, num_vertices, p_edge, rand_low, rand_high):
self.num_vertices = num_vertices
self.adjacency_matrix = [ [ None for j in... |
JavaScript | UTF-8 | 2,238 | 2.6875 | 3 | [
"MIT"
] | permissive | import fs from 'fs';
import path from 'path';
import semver from 'semver';
/**
* @param {Object} request {name: ?, scope: ?, version: ?}
* @param {Function} getPackageJson get package.json
* @param {Function} updatePackageJson update package.json
* @param {Function} removePackage remove package
* @param {String} ... |
Rust | UTF-8 | 1,332 | 3.09375 | 3 | [] | no_license | pub struct Solution;
// ------------------------------------------------------ snip ------------------------------------------------------ //
impl Solution {
pub fn find_max_consecutive_ones(nums: Vec<i32>) -> i32 {
let mut i = 0;
let mut result = 0;
while let Some(&num) = nums.get(i) {
... |
Python | UTF-8 | 881 | 2.953125 | 3 | [] | no_license | import pymysql as pm
try:
con = pm.connect(host='localhost', database='acadviewdb',\
user='root', password='root')
cursor = con.cursor()
query = 'create table zipcode(zipcodeid int(5) primary key, \
state varchar(10), city varchar(4)'
cursor.execute(qu... |
Java | UTF-8 | 801 | 3.21875 | 3 | [] | no_license | package com.dsalgo;
/**
* Created with IntelliJ IDEA.
* User: saikat
* Date: 8/10/13
* Time: 2:16 PM
* To change this template use File | Settings | File Templates.
*/
public class ArithmaticSequence {
public static void main(String[] args){
int[] a = {2,5,3,6,9,12,15,34,23};
findMaxArithma... |
PHP | UTF-8 | 608 | 2.78125 | 3 | [] | no_license | <?php
/**
* Description of sfWidgetFormChoiceBooleanRadio
* Widget affichant plusieurs radio buttons en une ligne (utilise une classe css)
* @author William
*/
class gridWidgetFormChoiceRadioAligne extends sfWidgetFormChoice{
public function __construct($options = array(), $attributes = array()) {
if (!arr... |
C++ | UTF-8 | 310 | 2.515625 | 3 | [] | no_license | #ifndef _STRING_CONVERT_H
#define _STRING_CONVERT_H
#include <string>
class StringConvert
{
public:
static int StringToInt(std::string strValue);
static std::string IntToString(long nValue);
static bool StringToBool(std::string strValue);
static std::string BoolToString(const bool bValue);
};
#endif
|
C++ | UTF-8 | 895 | 2.734375 | 3 | [] | no_license | #ifndef NAMEDBEANUSERNAMECOMPARATOR_H
#define NAMEDBEANUSERNAMECOMPARATOR_H
#include "comparatort.h"
#include "alphanumcomparator.h"
template<class B>
class NamedBeanUserNameComparator : public ComparatorT<B>
{
public:
NamedBeanUserNameComparator() {}
/*public*/ int compare(B n1, B n2) {
QString s1 = n1->getUse... |
Ruby | UTF-8 | 643 | 2.6875 | 3 | [
"MIT"
] | permissive | require 'json'
module Slurper
class Story
attr_accessor :attributes
def initialize(attrs={})
self.attributes = (attrs || {}).symbolize_keys
end
def to_post_params
{
name: name,
desc: description,
due: nil
}
end
def error_message; @response.body end... |
Java | UTF-8 | 600 | 2.203125 | 2 | [] | no_license | package main;
public class ReviewVO {
private String review_content, review_scope, member_nickname;
public String getReview_content() {
return review_content;
}
public void setReview_content(String review_content) {
this.review_content = review_content;
}
public String getReview_scope() {
return review_... |
Java | UTF-8 | 669 | 2.921875 | 3 | [] | no_license | package com.unindra.flq.data;
/**
* One question in challenge mode
*
*
*/
public class Question {
private String goodAnswer;
private String bad1;
private String bad2;
private String bad3;
private int image;
public Question(String goodAnswer, String bad1, String bad2, String bad3, int image){
this.goodA... |
Swift | UTF-8 | 5,035 | 2.640625 | 3 | [] | no_license | //
// LeftViewController.swift
// SlideMenuControllerSwift
//
// Created by Yuji Hato on 12/3/14.
//
import UIKit
enum LeftMenu: Int {
case main = 0
case peopleICanSee
case requestAccept
case profile
case setting
}
protocol LeftMenuProtocol : class
{
func changeViewController(_ menu: LeftM... |
C# | UTF-8 | 1,033 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Species
{
public class RowAndColumnSwapMutator : Mutator
{
public override void Mutate(Random random, int[] field, int w, int h, int mutations)
{
... |
Java | UTF-8 | 222 | 1.695313 | 2 | [] | no_license | package com.javarush.task.task15.task1523;
public class SubSolution extends Solution {
public SubSolution() {
super();
}
protected SubSolution(String s) {
}
SubSolution(double j) {
}
}
|
C | UTF-8 | 489 | 3.546875 | 4 | [] | no_license | #include <unistd.h>
/* echo - program wypisujacy na standardowe wyjscie dane przeczytane
* ze standardowego wejscia */
int main(int argc, char **argv)
{
char msg[] = "Wpisz \"x\" aby zakonczyc program\n";
char ch = 'y';
/* wypisuje komunikat na ekran - stdout*/
write(1, msg, sizeof(msg));
... |
Java | UTF-8 | 5,693 | 2.015625 | 2 | [] | no_license | package fr.liglab.adele.cube.extensions.joram.impl;
import java.util.Hashtable;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeoutException;
import java.lang.InterruptedException ;
import java.lang.Thread ;
import fr.liglab.adele.cube.AutonomicManager;
import fr.liglab.adele.cube... |
C++ | UTF-8 | 747 | 3.234375 | 3 | [] | no_license | //给定一个整数 (32 位有符号整数),请编写一个函数来判断它是否是 4 的幂次方。
//
// 示例 1:
//
// 输入: 16
//输出: true
//
//
// 示例 2:
//
// 输入: 5
//输出: false
//
// 进阶:
//你能不使用循环或者递归来完成本题吗?
// Related Topics 位运算
#include "header.h"
namespace LeetCode342 {
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
public:
... |
Markdown | UTF-8 | 3,961 | 2.765625 | 3 | [] | no_license | # Lyrics App - React Native
This mobile application was developed using React Native v0.63, Typescript and Redux. The data is retrieved from the https://api.lyrics.ovh/v1/ API.
This app has three sections:
- SEARCH:
- A screen with a form consisting of two text inputs: ‘artist’ and ‘song title’. After filling bot... |
Ruby | UTF-8 | 3,216 | 3.15625 | 3 | [] | no_license | #!/usr/bin/env ruby
##
# Parse a LinkedIn Sales Navigator HTML page of people to TSV.
#
# This script converts HTML to TSV (Tab Separated Values),
# which can be useful for spreadsheets such as Microsoft Excel.
#
# You can also edit this script to customize it for your needs,
# such as exporting CSV (Comma Separated V... |
C# | UTF-8 | 1,721 | 2.921875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Respawned
{
public class SellRule
{
private string _name;
private int _itemType;
private int _minIlvl;
private SellRuleCriteria[] _criterias;
private int _priority = -1;
... |
JavaScript | UTF-8 | 2,277 | 2.734375 | 3 | [] | no_license |
//home sliders
const homesliders=document.querySelector('.image-div')
db.collection('homesliders').onSnapshot(snap=>{
let count=0;
homesliders.innerHTML="";
snap.docs.forEach(nap => {
// console.log(nap.data().slider)
let slide=nap.data().sliders;
slide.forEach(cap=>{
... |
C | UTF-8 | 1,537 | 3.84375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
/**
* Perform a `strncat` into a too small buffer.
*
* Try:
* $ ./strcpy3 15 SummerCSC209
*
* Notice that `strncat` is NOT copying the NUL from `src` if `n < strlen(src)`:
*
* $ ./strcpy3 10 SummerCSC209
*
* The extra '#' padding characte... |
Swift | UTF-8 | 7,157 | 2.828125 | 3 | [] | no_license | //
// SpaceShip.swift
// SpaceCrash
//
// Created by Simas Abramovas on 27/03/15.
// Copyright (c) 2015 Simas Abramovas. All rights reserved.
//
import SpriteKit
class SpaceShip : SKSpriteNode {
let ATLAS_NAME = "SpaceShip"
let TEXTURE_NAME_FORMAT = "SpaceShip%d"
let ACTION_MOVEM... |
Java | UTF-8 | 298 | 1.6875 | 2 | [] | no_license | package hl7.pseudo.message;
import hl7.bean.Structure;
public class CSU_C11 extends hl7.model.V2_3.message.CSU_C11{
public CSU_C11(){
super();
}
public static CSU_C11 CLASS;
static{
CLASS = new CSU_C11();
}
public Structure[][] getComponents(){
return super.getComponents();
}
}
|
Java | UTF-8 | 1,055 | 2.265625 | 2 | [] | no_license | package com.project.Servlets;
import java.io.IOException;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servle... |
Markdown | UTF-8 | 728 | 2.703125 | 3 | [] | no_license | # bump-all
Permet de mettre à jour plusieurs projets d'une organisation github en même temps de de faire les PR
```bash
php app/console composer:update GITHUB_TOKEN ORGANISATION DEPENDENCY VERSION
```
## with docker
1/ Build the image
```bash
docker build -t bumper:latest .
```
2/ Run the command
```bash
docker ... |
Java | UTF-8 | 1,625 | 3.859375 | 4 | [] | no_license | package com.example.guozaiss.explain;
import java.util.Stack;
/**
* Created by guozaiss on 16/1/21.
* 处理与解释相关的一些业务
*/
public class Calculator {
//声明一个Stack栈存储并操作所有相关的解释器
public Stack<ArithmeticExpression> mExpStack = new Stack<ArithmeticExpression>();
/**
* 计算
*
* @param expression
... |
Go | UTF-8 | 1,453 | 4.25 | 4 | [] | no_license | package main
import (
"errors"
"fmt"
"math"
)
type person struct {
name string
age int
}
func main() {
fmt.Println("Hello World")
x := 20
fmt.Println(x)
a := [5]int{2, 3, 4, 5, 6}
a[2] = 3
fmt.Println(a)
//slices are an abstraction of arrays
b := []int{2, 3, 4, 5, 6}
b[2] = 3
fmt.Println(b)
list... |
SQL | UTF-8 | 1,246 | 3.65625 | 4 | [] | no_license | create database db_farmaciaDoBem;
use db_farmaciaDoBem;
create table tb_categoria(
id bigint not null auto_increment,
categoria varchar(20) not null,
promocao boolean not null,
primary key(id)
);
create table tb_produto(
id bigint not null auto_increment,
produto varchar(30) not null,
valor decimal (5,2) not null,
d... |
Java | UTF-8 | 1,141 | 2.203125 | 2 | [] | no_license | package ftp.client.controller;
import ftp.client.component.tab.TabWindowController;
import ftp.client.service.AnchorService;
import ftp.client.service.RouterService;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import javafx.scene.layout.Pane;
import java.net.URL;
import ja... |
JavaScript | UTF-8 | 913 | 2.578125 | 3 | [] | no_license | const axios = require('axios');
const URL = "https://api.smash.gg/gql/alpha";
async function run_query (query, variables, token) {
const data = {
query: query,
variables: variables
}
const headers = {
headers: {
"Content-Type": "application/json",
"Authoriza... |
C++ | UTF-8 | 3,459 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | /*
Copyright (c) 2012-2016, Kai Hugo Hustoft Endresen <kai.endresen@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, t... |
Java | UTF-8 | 1,081 | 2.234375 | 2 | [] | no_license | package com.test.searchplace.dao.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import com.test.searchplace.dao.PlaceDao;
import com.test.searchplace.model.Place;
import com.test.searchplace.model.Tag;
public class Place... |
PHP | UTF-8 | 361 | 2.640625 | 3 | [] | no_license | <?php
$str='host = localhost port=5432 dbname=test user=postgres password=329033';
$link = pg_connect($str);
$select='select name,job,dno from employee1';
$result=pg_query($link,$select);
$index=0;
while(@$res=pg_fetch_array($result,$index))
{
echo "employee $res[0] has job $res[1] and works for depa... |
Markdown | UTF-8 | 1,668 | 2.578125 | 3 | [] | no_license |
# BlinkdotNet
BlinkdotNet is the unofficial .NET implementation of the Blink Monitor Protocol as originally documented by MattTW [here](https://github.com/MattTW/BlinkMonitorProtocol).
BlinkdotNet allows developers to interact with Blink networks and cameras easily without the need for complicated REST calls.
## ... |
Ruby | UTF-8 | 76 | 2.765625 | 3 | [] | no_license | puts "私の名前は八島洋介です。年齢は" + 26.to_s + "歳です" |
Markdown | UTF-8 | 11,745 | 2.859375 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Monitor your StorSimple 8000 series device
description: Describes how to use the StorSimple Device Manager service to monitor usage, I/O performance, and capacity utilization.
author: alkohli
ms.service: storsimple
ms.topic: conceptual
ms.date: 10/17/2017
ms.author: alkohli
---
# Use the StorSimple Device M... |
C# | UTF-8 | 3,554 | 2.8125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | using FluentAssertions;
using Xunit;
namespace System.Linq.Dynamic.Core.Tests;
public partial class ExpressionTests
{
[Fact]
public void ExpressionTests_Add_Number()
{
// Arrange
var values = new[] { -1, 2 }.AsQueryable();
// Act
var result = values.Select<int>("it + 1");... |
Markdown | UTF-8 | 2,585 | 3.546875 | 4 | [] | no_license | [shovel coding #2 leetcode - Add Two Numbers]
> 원문 링크 : https://leetcode.com/problems/add-two-numbers/description/
## Description
You are given two non-empty linked lists representing two non-negative integers.
The digits are stored in reverse order and each of their nodes contain a single digit.
Add the two numbers an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.