language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 690 | 3.9375 | 4 | [] | no_license | # Stage 1. Matrix multiplication.
class Matrix:
def __init__(self, row, col):
self.row = int(row)
self.col = int(col)
self.matrix = []
def get_matrix(self):
i = 1
while i <= self.row:
matr = list(map(int, input().split()))
self.matrix.append(matr... |
Java | UTF-8 | 663 | 1.828125 | 2 | [] | no_license | package com.dianping.lion.dao;
import java.util.List;
import com.dianping.lion.entity.Service;
public interface ServiceDao {
public int updateService(Service service);
public int deleteService(Service service);
public int deleteServiceById(int id);
public Object createService(Servic... |
Java | UTF-8 | 3,381 | 2.53125 | 3 | [] | no_license | package me.safrain.validator;
import me.safrain.validator.expression.Expression;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Iterator;
public class Violation {
public enum Type {
EXCEPTION, SEGMENT_REJECTED, INVALID
}
private Method method;
private Expression e... |
Markdown | UTF-8 | 9,594 | 2.546875 | 3 | [] | no_license | ## 环境介绍:
本示例使用 `Vagrant` 工具模拟 Linux 环境
* 操作系统: CentOS/7
* 内存: 4G
* IP: 192.168.33.10/24
* Docker: docker-17.12.1
* Docker-compose:1.21.2
* Jenkins: 2.107.3
* Gitlab: gitlab-ce:10.7.3-ce.0
## Jenkins 安装
[详见 Jenkins 安装](install-jenkins.md)
## Gitlab 安装
Gitlab 默认启动在 80 端口,输入 IP:80 端口访问 Gitlab 服务,首次访问 Gi... |
Java | UTF-8 | 6,389 | 1.679688 | 2 | [
"MIT"
] | permissive | package qunar.tc.qconfig.server.config.longpolling.impl;
import com.google.common.base.Optional;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import qunar.tc.qconfig.client.Configura... |
Markdown | UTF-8 | 790 | 2.75 | 3 | [] | no_license | ---
title: Ideas and questions to be explored
author: franc
date: 2014-10-22
template: project.jade
---
*"I talk about the gods, I am an atheist. But I am an artist too, and therefore a liar. Distrust everything I say. I am telling the truth. The only truth I can understand or express is, logically defined, a lie. Psy... |
Java | UTF-8 | 3,507 | 2.03125 | 2 | [] | no_license | package com.cms.controller;
import com.cms.base.annotation.SystemLog;
import com.cms.base.controller.BaseCrudController;
import com.cms.base.query.PageQuery;
import com.cms.entity.CourseInfo;
import com.cms.entity.Score;
import com.cms.entity.Student;
import com.cms.entity.User;
import com.cms.service.*;
import com.cm... |
PHP | UTF-8 | 301 | 2.796875 | 3 | [] | no_license | <?php
session_start();
if(isset($_SESSION['visited'])){
echo "Welcome again! This is the ".$_SESSION['visited']." time you're coming!";
$_SESSION['visited'] += 1;
}else{
echo "Welcome!";
$_SESSION['visited'] =0;
$_SESSION['visited'] += 1;
}
?>
|
PHP | UTF-8 | 412 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace DiDom\Tests;
use DiDom\Document;
class DocumentFragmentTest extends TestCase
{
public function testAppendXml()
{
$document = new Document();
$documentFragment = $document->createDocumentFragment();
$documentFragment->appendXml('<foo>bar</foo... |
PHP | UTF-8 | 1,938 | 2.875 | 3 | [] | no_license | <?php
/**
* File for class AmazonS3StructAmazonCustomerByEmail
* @package AmazonS3
* @subpackage Structs
* @date 2013-09-04
* @author Mikaël DELSOL <contact@wsdltophp.com>
*/
/**
* This class stands for AmazonS3StructAmazonCustomerByEmail originally named AmazonCustomerByEmail
* Meta informations extr... |
Python | UTF-8 | 3,223 | 3.171875 | 3 | [
"MIT"
] | permissive | from tictactoe import TicTacToe, GameState, Cell_coord
from strategy import Strategy
from typing import Optional, Tuple
import strategies as st
def input_q(msg: str) -> str:
resp = input(msg)
if resp.upper() in ["Q", "QUIT"]:
raise SystemExit
else:
return resp
def create_board() -> Ti... |
JavaScript | UTF-8 | 1,679 | 3.21875 | 3 | [] | no_license | class Cell {
constructor(x, y) {
this.live = false;
this.nextGeneration = false;
this.adjacent = 0;
this.x = x;
this.y = y;
}
setLive() {
this.live = true;
}
setDead() {
this.live = false;
}
findNeighbors(board) {
if(this.live === true){
this.adjacent = -1
}else... |
Python | UTF-8 | 3,924 | 2.859375 | 3 | [] | no_license | #!/usr/bin/env python
# Silly Twitter API scraper thingy. Feed it a twitter api page on
# standard input
#
# ideal output follows. Currently 'response' is not generated,
# 'requires_auth' is a boolean (since most pages just say 'true' and
# 'false', and methods will only ever be a list of the first method
# found.
#
... |
Markdown | UTF-8 | 3,565 | 2.875 | 3 | [
"MIT"
] | permissive |
# 组件配置
## 组件配置
表单组件、行组件都是通过`render-custom-component`进行动态生成的。
每个字段的配置中有几处地方可以配置component:
1. column.form.component = 表单组件配置
2. column.component = 表格行展示组件配置
3. column.search.component = 查询表单组件配置
4. column.view.component = 查看表单组件配置
使用相关组件前,需要通过`Vue.use` 或 `Vue.component`引入组件
## 组件配置项
[d2-crud-x中的组件配... |
PHP | UTF-8 | 6,483 | 2.515625 | 3 | [] | no_license | <?php
//Reanudamos la sesión y controlamos que todo este bien
session_start();
if(!isset($_SESSION['usuario']) and $_SESSION['estado'] != 'Autorizado'){
echo 'Mal inicio de sesión;';
header('Location: ../index.php');
}else{
$usernick = $_SESSION['usuario'];
$user... |
C# | UTF-8 | 1,007 | 2.671875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "Event/FeastEvent")]
public class FeastEvent : Event
{
private int amtConsumed;
public override void Execute(int index)
{
GameController gc = GameController.Instance;
switch (index)
... |
Python | UTF-8 | 454 | 3.390625 | 3 | [] | no_license | # Day 2 - 2015
def transform_data(data):
return [[y for y in x.strip().split('x')] for x in data.strip().split()]
with open('day2.txt') as f:
data = transform_data(f.read())
total_paper = 0
for present in data:
l = int(present[0])
w = int(present[1])
h = int(present[2])
lw = (l*w)
wh = (... |
SQL | UTF-8 | 7,044 | 4.5625 | 5 | [] | no_license | /* 1. SQL 문은 다른 프로그래밍 언어와 마찬가지로 산술 연산자를 사용할 수 있다.
* 2. 산술연산자 종류)
* + 덧셈, - 뺄셈, * 곱셈, / 나눗셈
*
*/
--emp01 테이블 생성
create table emp01(
empno int primary key -- 사원번호, int는 정수숫자 타입
,ename varchar(50) -- 사원명
,sal int -- 월급
,comm int -- 보너스
);
insert into emp01 values(101,'홍길동',250,25);
insert into e... |
Java | UTF-8 | 2,860 | 1.960938 | 2 | [] | no_license | package controlador.competencia;
import java.util.List;
import modelo.DatoBasico;
import modelo.Liga;
import modelo.PersonalForaneo;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zk... |
Markdown | UTF-8 | 3,286 | 3.390625 | 3 | [] | no_license | ---
layout: post
title: "HTML/CSS Course: Session 5"
authors: ["Kat Li Yang"]
date: 2017-10-04 17:10:00 +0800
categories: HTML/CSS courses
---
From this session onwards, we will be starting to put what we have done in the past weeks online. We will be working with the popular platform Github with Github Pages. Gith... |
Python | UTF-8 | 6,980 | 2.53125 | 3 | [] | no_license | #!/usr/bin/env python
### Module imports ###
import sys
import math
import re
import numpy as np
from sklearn import linear_model, svm
from sklearn import preprocessing
from doc_utils import DocUtils, Query, CorpusInfo, ExtraFeaturesInfo
from pa3_utils import Pa3Utils
corpus = CorpusInfo()
corpus.load_doc_freqs()
ex... |
Java | UTF-8 | 4,738 | 2.453125 | 2 | [] | no_license | package com.codeoftheweb.salvo.controller;
import com.codeoftheweb.salvo.dto.*;
import com.codeoftheweb.salvo.model.*;
import com.codeoftheweb.salvo.repository.*;
import com.codeoftheweb.salvo.repository.util.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatu... |
PHP | UTF-8 | 2,290 | 2.703125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php declare(strict_types=1);
namespace Tests\Stefna\Mailchimp\Mocks;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
class Client extends \Stefna\Mailchimp\Client
{
public function response(ResponseInterface $response)
{
$this->saveResponse($response);
return parent::response($... |
JavaScript | UTF-8 | 1,022 | 2.53125 | 3 | [] | no_license | import _ from 'lodash';
function sanitize(data, keys) {
return keys.reduce((result, key) => {
const val = _.get(result, key);
if (!val || _.isArray(val) || _.isObject(val)) {
return result;
} else {
return _.set(_.cloneDeep(result), key, '[SANITIZED]');
}
}, data);
}
test('API call', a... |
Python | UTF-8 | 4,491 | 2.640625 | 3 | [] | no_license | from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.db.models import ObjectDoesNotExist
from json import dumps
from hrs.models import Dept, Emp, BlogsPost
import time
def index(request):
ctx = {
'greeting': '你好,世界!'
}
return render(request, 'index.html'... |
Swift | UTF-8 | 1,511 | 2.59375 | 3 | [] | no_license | //
// IndicatorView.swift
// Vipassana
//
// Created by Dasha Chastokolenko on 5/16/19.
// Copyright © 2019 Dasha Chastokolenko. All rights reserved.
//
import UIKit
import Lottie
class InStatIndicatorView: UIView {
let animationView = AnimationView(name: "InStatIndicator")
override func awakeFromNib... |
JavaScript | UTF-8 | 225 | 3.40625 | 3 | [
"MIT"
] | permissive | 'use strict';
function factorsOf(n) {
const factors = [];
for (let i = 1; i <= n; i++) { // change on this line
if (n / i === Math.floor(n / i)) {
factors.push(i);
}
} return factors;
} |
JavaScript | UTF-8 | 2,028 | 2.65625 | 3 | [] | no_license | $( function() {
$( "#slider-range1" ).slider({
range: true,
min: 0,
max: 6,
values: [ 3, 6 ],
slide: function( event, ui ) {
$( "#floor" ).val( ui.values[ 0 ] );
$( "#floor1" ).val( ui.values[ 1 ] );
}
});
$( "#floor" ).val( $( "#slider-range1" ).slider( "values", 0... |
Java | UTF-8 | 818 | 2 | 2 | [] | no_license | package week1.dianshangjinjie.bw.com.demo4.api;
import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Query;
import week1.dianshangjinjie.bw.com.demo4.bean.CarBean;
import week1.dianshangjinjie.bw.com.demo4.bean.Product;
import week1.dianshangjinjie.bw.com.demo4... |
Java | UTF-8 | 20,319 | 1.710938 | 2 | [
"Apache-2.0"
] | permissive | package com.rowland.onboarderwithstepperindicator.view;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import... |
Java | UTF-8 | 1,630 | 2.28125 | 2 | [
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"GPL-2.0-only",
"xpp",
"CC-BY-3.0",
"EPL-1.0",
"Classpath-exception-2.0",
"CPL-1.0",
"CDDL-1.0",
"MIT",
"LGPL-2.1-only",
"MPL-2.0",
"MPL-1.1",
"LicenseRef-scancode-unknown-license-reference",
... | permissive | /**
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in co... |
Java | UTF-8 | 2,188 | 3.59375 | 4 | [] | no_license | package com.ray.leetcode.resolved;
import com.ray.util.Out;
/**
* Verify Preorder Serialization of a Binary Tree
* -----------------------------------------------------------------------------
* One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node'... |
C++ | UTF-8 | 534 | 2.53125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Actor.h"
namespace bulletNS{
const float SCALE_X = .7;
const float SCALE_Y = .2;
const float SCALE_Z = .4;
const float LINESPAN = 1;
const float DAMAGE = 1;//Hits for 25 points of damage
};
class Bullet : public virtual Actor
{
private:
float lifeTime;
public:
void create(Vector3 pos){A... |
JavaScript | UTF-8 | 945 | 3.46875 | 3 | [
"MIT"
] | permissive | function unset() {
// http://kevin.vanzonneveld.net
// + original by: Brett Zamir (http://brett-zamir.me)
// * example 1: var arr = ['a', 'b', 'c'];
// * example 1: unset('arr[1]');
// * returns 1: undefined
// Must pass in a STRING to indicate the variable, not the variable itself (whether o... |
JavaScript | UTF-8 | 952 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | import Flickity from 'flickity';
const homeCarousel = document.querySelector('.home-intro');
const homeSlideCount = homeCarousel.childElementCount;
const prevButton = document.querySelector('.flickity-button.previous');
const nextButton = document.querySelector('.flickity-button.next');
const flkty = new Flickity(hom... |
C | UTF-8 | 2,221 | 3.03125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* validation.c :+: :+: :+: ... |
Java | UTF-8 | 457 | 1.515625 | 2 | [] | no_license | package com.nooblog;
import com.nooblog.mail.EmailUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.mail.javamail.JavaMailSender;
@SpringBootApplicatio... |
Python | UTF-8 | 453 | 3 | 3 | [] | no_license | from dictionary import *
def decompose(turn):
frags = turn.split(" ")
# FIND THE KEYWORD
key = []
for w in frags:
if(w in keywords):
key.append(w)
# CREATE PATTERN OUT OF FRAGMENTS
pattern = []
segment = ""
for token in frags:
if(token in key):
if(len(segment) > 0):
pattern.append(segment)
... |
TypeScript | UTF-8 | 3,669 | 2.671875 | 3 | [
"MIT"
] | permissive | import * as ts from 'typescript';
import { getNodeTags } from '../src';
describe('[code-analyzer] › utils › check node tags', () => {
test('normal node should return no node tags', () => {
const code = 'const VARIABLE = "test";';
const sourceFile = ts.createSourceFile('', code, ts.ScriptTarget.Latest, true)... |
Java | UTF-8 | 1,213 | 2.171875 | 2 | [] | no_license | package e.kiosque.appca.ModelData.PosteDetenteGaz;
import com.mapbox.geojson.Geometry;
import com.mapbox.geojson.Point;
public class PosteDetenteGaz {
private String nom;
private String commune;
private int insee;
private int idKey;
private Point geometry;
public PosteDetenteGaz(String nom, S... |
C# | UTF-8 | 810 | 2.6875 | 3 | [] | no_license | namespace AutoProcessor
{
public class BranchingProcess : Process
{
private Process _flagProcess;
private Process _ifFinished;
private Process _ifNotFinished;
public BranchingProcess(Process flagProcess, Process ifFinished, Process ifNotFinished)
{
_flagProc... |
Java | UTF-8 | 1,165 | 2.3125 | 2 | [] | no_license | package fr.tse.applicationDistrib.controller;
import java.util.List;
import org.json.JSONException;
import org.modelmapper.ModelMapper;
import org.modelmapper.TypeToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframe... |
C++ | UTF-8 | 565 | 3.28125 | 3 | [] | no_license | #include<stack>
using namespace std;
struct BinaryTreeNode {
int m_nValue;
BinaryTreeNode* m_pLeft;
BinaryTreeNode* m_pRight;
};
BinaryTreeNode* kthSmallestNode(BinaryTreeNode* root, int k) {
if (root == nullptr || k < 0) {
return nullptr;
}
stack<BinaryTreeNode*> stack;
BinaryTreeNode* pNode = root;
... |
Markdown | UTF-8 | 2,544 | 2.9375 | 3 | [
"BSD-3-Clause"
] | permissive | ---
title: "Ответ на \"C#: фильтрация ip-адресов\""
se.owner.user_id: 240512
se.owner.display_name: "MSDN.WhiteKnight"
se.owner.link: "https://ru.stackoverflow.com/users/240512/msdn-whiteknight"
se.answer_id: 830696
se.question_id: 830562
se.post_type: answer
se.is_accepted: True
---
<p>Добавьте ссылку на System.Manag... |
PHP | UTF-8 | 120 | 2.96875 | 3 | [] | no_license | <?php #p55
$hantei1 = ("99" == 99);
$hantei2 = ("99" != 99);
var_dump($hantei1);
var_dump($hantei2);
?> |
JavaScript | UTF-8 | 1,811 | 3.234375 | 3 | [
"MIT"
] | permissive | /*
This module has core functions for SLIP protocol:
https://tools.ietf.org/html/rfc1055
Author: Dmitry Myadzelets
Assumptions:
1. The beginning and the end of the data are unknown.Both encode and decode
functions operate on chunks of data. The upper level should add END
character at the end (and the be... |
C++ | UTF-8 | 177 | 2.625 | 3 | [] | no_license | #include <stdio.h>
main(){
int numero, sucessor;
printf("Digite um numero inteiro\n");
scanf("%d",&numero);
sucessor = numero+1;
printf("Sucessor =%d",sucessor);
}
|
TypeScript | UTF-8 | 2,006 | 3.109375 | 3 | [] | no_license | import * as Phaser from 'phaser'
type Config = {
scene: Phaser.Scene,
cols: number,
rows: number,
width: number,
height: number
}
class AlignGrid {
config: Config
scene: Phaser.Scene
cw: number
ch: number
numberSize: number = 24
colorHex: string = '#ff0000'
get color () {
return Phaser.Di... |
C | UTF-8 | 1,771 | 3.015625 | 3 | [
"BSD-2-Clause"
] | permissive | #include "THLogAdd.h"
#include <float.h>
#ifdef USE_DOUBLE
#define MINUS_LOG_THRESHOLD -39.14
#else
#define MINUS_LOG_THRESHOLD -18.42
#endif
const double THLog2Pi = 1.83787706640934548355;
const double THLogZero = -DBL_MAX;
const double THLogOne = 0;
double THLogAdd(double log_a, double log_b) {
double minusdif;... |
Java | UTF-8 | 864 | 2.0625 | 2 | [] | no_license | package com.ruinscraft.buildcomputil;
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory;
import com.github.intellectualsites.plotsquared.plot.commands.RequiredType;
import com.github.intellectualsites.plotsquared.p... |
TypeScript | UTF-8 | 4,553 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | import DragUtils from './DragUtils';
function makeItems(count = 5) {
const items = [];
for (let i = 0; i < count; i += 1) {
items.push(i);
}
return items;
}
describe('single item in single list', () => {
it('handles dragging item to the next index', () => {
const items = makeItems();
DragUtils... |
SQL | UTF-8 | 2,780 | 2.90625 | 3 | [] | no_license | -- MariaDB dump 10.17 Distrib 10.4.6-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: pendaftaran_5
-- ------------------------------------------------------
-- Server version 10.4.6-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@... |
Java | UTF-8 | 2,157 | 2.25 | 2 | [] | no_license | package com.example.news.navigation;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.provider.Settings;
import com.example.news.app.App;
import com.example.news.presentation.view.DetailActualActivity;
import com.example.news.presentation.view.DetailFavoriteActivity;
... |
Shell | UTF-8 | 596 | 2.515625 | 3 | [] | no_license | ui_print " Patching existing audio_effects files..."
for FILE in ${CFGS}; do
sed -i 's/^effects {/effects {\n v4a_standard_fx {\n library v4a_fx\n uuid 41d3c987-e6cf-11e3-a88a-11aba5d5c51b\n }/g' $AMLPATH$FILE
sed -i 's/^libraries {/libraries {\n v4a_fx {\n path \/system\/lib\/soundfx\/libv4a_fx_ics.... |
C | UTF-8 | 1,696 | 2.65625 | 3 | [] | no_license | /*
* debug.c
*
* Created on: 28 nov. 2017
* Author: thomas
*/
#include "debug.h"
#include "stm32f4xx_hal.h"
void unsign_print(UART_HandleTypeDef *huart_ptr, uint8_t var){
char str[32];
sprintf(str, "%u\n\r", var);
HAL_UART_Transmit(huart_ptr, (uint8_t *) str,strlen(str), 10);
}
void signed_print(UART... |
Shell | UTF-8 | 4,894 | 2.546875 | 3 | [] | no_license | #!/bin/sh
#
#PBS -N MPI-MZ_f77_641_128_MX
#PBS -l walltime=5:00:00
#PBS -l nodes=4:r641:ppn=32
#PBS -j oe
cd $HOME/ESC/TP1/NPB3.3-MZ-MPI
commands_output_dir=../scripts_ex2/Paralelo/commands_output
mkdir -p $commands_output_dir
module load gnu/openmpi_mx/1.8.4
module load gcc/5.3.0
set -x
export OMP_NUM_THREADS=2
cp... |
Java | UTF-8 | 4,708 | 2.28125 | 2 | [] | no_license | package com.sap.amd.authentication;
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import org.openqa.selenium.Cookie;
import com.sap.amd.utils.types... |
Python | UTF-8 | 735 | 3.3125 | 3 | [] | no_license | # from typing import Generator
# dict_couple={"bride":["marry","bella","linda"],"groom":["jack","robert","eric"]}
# def muruvvet(bride,groom):
# couple_list =[]
# for x in zip(bride,groom):
# couple_list.append(x)
# return couple_list
# print(muruvvet(** dict_couple))
# def muruvvet_2(bride,groo... |
Python | UTF-8 | 1,995 | 4.125 | 4 | [] | no_license | """Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.
As a reminder, a binary search tree is a tree that satisfies these constraints:
The left subtree of a node... |
Java | UTF-8 | 814 | 2.1875 | 2 | [] | no_license | package com.furniture.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.furniture.dao.UserDAOImpl;
import com.furniture.model.User;
@Service
@Transac... |
Markdown | UTF-8 | 7,151 | 3.1875 | 3 | [] | no_license | **Hardik Galiawala
B00777450
CSCI 5708
January 25, 2018**
# First Application: SplenDO
**Link to application:** https://play.google.com/store/apps/details?id=com.splendapps.splendo
SplenDO app comes under the Productivity category. It helps the user to manage their time in an efficient manner. The main idea of this ... |
Java | UTF-8 | 653 | 2.25 | 2 | [] | no_license | package org.cakepowered.mod.event;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import org.cakepowered.api.entity.Entity;
import org.cakepowered.api.event.PlayerInteractEntityEvent;
import org.cakepowered.mod.util.ForgeInterface;
public class ApiPlayerClickEntityEvent extends ApiPlayerInteractEv... |
Python | UTF-8 | 3,897 | 2.9375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | """ Defines the LegendTool class.
"""
# Enthought library imports
from traits.api import Bool, Enum
from enable.tools.drag_tool import DragTool
class LegendTool(DragTool):
""" A tool for interacting with legends.
Attach this tool to a legend by setting the tool's **component**
to the legend.
"""
... |
Swift | UTF-8 | 2,583 | 2.640625 | 3 | [] | no_license | // CookbookCollectionsView.swift
// RecipeMatcher
// Created by Eric Widjaja on 8/22/20.
// Copyright © 2020 Eric W. All rights reserved.
import UIKit
import Kingfisher
class CookbookCollectionsView: UIView {
//MARK: - Objects
lazy var myCollectionsCV: UICollectionView = {
let layout = UIColl... |
Markdown | UTF-8 | 7,386 | 3.671875 | 4 | [
"MIT"
] | permissive | # String
## Common used methods
- get substring with start index & end index: slice(startIndex, endIndex) => s[startIndex, endIndex)
- get substring with start index & length: substr(startIndex, length)
- a.localeCompare(b) 为按字母表升序
- charCodeAt(); String.fromCharCode();
## Common operations
### 判断是否是回文串
```js
f... |
C++ | UTF-8 | 1,100 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <string>
int main() {
std::map<std::string,int>patientList;
std::string request;
std::cout << "Input your request, or 'exit' for exit" << std::endl;
std::getline(std::cin,request);
int k = 0;
while(request != "exit"){
if(request == "Next"){... |
Shell | UTF-8 | 1,548 | 3.5625 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/bash
#usage: ./loadCsvToTable.sh csv db_addr username table_name db_type
postgres () {
CSV=$1
DB_ADDR=$2
USERNAME=$3
PWD=$4
TABLE_NAME=$5
echo $DB_ADDR $USERNAME $TABLE_NAME
#PGPASSWORD=postgres psql --user=${USERNAME} --dbname=$DB_ADDR -c "COPY "'"'$TABLE_NAME'"'" FROM '$CSV' DEL... |
Java | UTF-8 | 1,063 | 1.984375 | 2 | [] | no_license | package cn.sanleny.framework.auth.autoconfigure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.Arrays;
import java.util.Collection;
/**
* 认证相关
* @Author: LG
* @Date: 2020-09-22
* @Versi... |
C | UTF-8 | 420 | 3.234375 | 3 | [] | no_license | #include "ft_printf.h"
static int ft_intlen(unsigned int n)
{
int ilen;
if (n == 0)
ilen = 1;
else
ilen = ft_strlen(ft_itoa_unsint(n));
return (ilen);
}
static void ft_process_nbr(unsigned int n)
{
if (n >= 10)
{
ft_process_nbr(n / 10);
ft_process_nbr(n % 10);
}
else
ft_putchar(48 + n);
}
int ... |
Shell | UTF-8 | 6,560 | 3.796875 | 4 | [
"MIT"
] | permissive | #!/bin/bash
. "`dirname "$0"`/install-common.sh" || exit 1
PARENT_DIR="$(cd "$(dirname "$0")"; pwd -P)"
DEFAULT_REMOTE_SSH_PORT=22
DEFAULT_REMOTE_ADMIN=root
DEFAULT_REMOTE_USER=fwd
DEFAULT_SSH_KEY_NAME=fwd
DEFAULT_LOCAL_SSH_PORT=22
echo "Enter the URL or IP address of your remote server."
echo -n "> "
read REMOTE_SE... |
Swift | UTF-8 | 1,224 | 3.15625 | 3 | [
"BSD-3-Clause"
] | permissive | public func hasEntry<K, V>(_ keyMatcher: Matcher<K>, _ valueMatcher: Matcher<V>) -> Matcher<Dictionary<K, V>> {
return Matcher("a dictionary containing [\(keyMatcher.description) -> \(valueMatcher.description)]") { (dictionary: Dictionary<K, V>) -> Bool in
for (key, value) in dictionary {
if key... |
Python | UTF-8 | 1,743 | 3.390625 | 3 | [] | no_license | class Employee:
def __init__(self, employeeId, employeeName, department, salary, role):
self.employeeId = employeeId
self.employeeName = employeeName
self.department = department
self.salary = salary
self.role = role
def calculateIncentive(self, roleIncentivePercentage):... |
PHP | UTF-8 | 5,322 | 3.171875 | 3 | [] | no_license | <?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of DateOfBirth
*
* @author Bri
*/
namespace App\Models\Fatcha\Helpers;
class DateUtility {
private $current_num_year;
private $current_num_month;
private $current_num_day;
... |
JavaScript | UTF-8 | 1,113 | 2.734375 | 3 | [] | no_license | const clipImage = (src, imgW, imgH, cb) => {
// ‘canvas’为前面创建的canvas标签的canvas-id属性值
let ctx = wx.createCanvasContext('canvas');
let canvasW = 640,
canvasH = imgH;
if (imgW / imgH > 5 / 4) {
canvasW = imgH * 5 / 4;
console.log("imgW / imgH > 5 / 4");
} else if (imgW / imgH < 5 / 4) {
canvasH = ... |
Shell | UTF-8 | 493 | 3.71875 | 4 | [
"MIT"
] | permissive | #!/bin/sh
# This script updates the file if the public IP address has changed
ipaddr=""
if [[ $(cat ~/current_public_ip.txt) = $(curl -4s http://www.icanhazip.com) ]]
then
logger -p local0.info "No change to public IP address"
else
ipaddr=$(curl -4s http://www.icanhazip.com)
echo "IP address ... |
C# | UTF-8 | 800 | 2.828125 | 3 | [] | no_license | using System;
namespace Savchin.Data
{
/// <summary>
/// ParentObjectNotExistsException.
/// </summary>
///
[Serializable()]
public class ParentEntityNotExistsException : IntegrityException
{
private string name;
/// <summary>
/// Gets the name of the object.
/// <... |
Ruby | UTF-8 | 636 | 3.421875 | 3 | [
"MIT"
] | permissive | # Pascal's Triangle Total Accepted: 50771 Total Submissions: 168463
#
# Given numRows, generate the first numRows of Pascal's triangle.
#
# For example, given numRows = 5,
# Return
#
# [
# [1],
# [1,1],
# [1,2,1],
# [1,3,3,1],
# [1,4,6,4,1]
# ]
#
# Wrote in browser directly
#
# 15 / 15 test cas... |
C++ | UTF-8 | 1,252 | 2.875 | 3 | [] | no_license | /*
Create Task pinned to specific core using xTaskCreatePinnedToCore
Main Loop - Core 1
Blink LED Task - Core 0
*/
#include <Arduino.h>
#define LED 15
void Task1( void * parameter )
{
for (;;) {
Serial.print("Task1 runs on Core: ");
Serial.println(xPortGetCoreID());
digitalWrite(LED, HIGH);
Ser... |
Java | UTF-8 | 1,536 | 3.171875 | 3 | [] | no_license | package utils;
import models.Book;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class JsonPa... |
C++ | UTF-8 | 1,365 | 3.5625 | 4 | [] | no_license | // Serial sketch, read from serial port and blink LED according to the number that is transmitted over serial
/*
* In python:
*
* import serial
*
* ser = serial.Serial('/dev/ttyUSB0', 9600)
*
* ser.write('3'.encode('utf-8'))
*
* You should get '3' blinks on the arduino. Does not sanitize input for 1-9 on... |
Python | UTF-8 | 970 | 2.78125 | 3 | [] | no_license | import pandas as pd
from datetime import datetime
import math as m
def basicCalc(timeValue):
return m.ceil((timeValue+1)/5)
def multiCalc(timeValue):
return timeValue*12
def settingTheTimeLabel(timeValue):
sTime = str(timeValue)
if(len(sTime) < 3 ):
return basicCalc(int(sTime))
elif(... |
C# | UTF-8 | 2,043 | 2.765625 | 3 | [] | no_license | using Microsoft.AspNetCore.Mvc;
using Sample7.Models;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Sample7.Api.Actions
{
public sealed class EmployeeCsvResult : FileResult
{
private readonly IEnumerable<IModel> _data;
public Emp... |
Shell | UTF-8 | 7,716 | 3.5625 | 4 | [] | no_license | #! /bin/bash
ND_HOME=/home/cavisson/netdiagnostics
Controller_name=work
F1(){
read -p "Enter TierName: " TierName
read -p "Enter ServerName: " ServerName
read -p "Enter InstanceName: " InstanceName
read -p "Enter NDC_IP: " NDC_IP
read -p "Enter NDC_Port: " NDC_PORT
echo -e "t... |
Java | UTF-8 | 182 | 2.21875 | 2 | [] | no_license | public class New {
public static void main (String[] args){
int i = 500;
while (i < 785487643) {
System.out.println("Chizza");
}
}
}
|
C++ | UTF-8 | 5,443 | 2.515625 | 3 | [
"GPL-3.0-only"
] | permissive | #pragma once
#include "../../../../JString.hpp"
#include "./AtomicLong.def.hpp"
namespace java::util::concurrent::atomic
{
// Fields
// Constructors
inline AtomicLong::AtomicLong()
: java::lang::Number(
"java.util.concurrent.atomic.AtomicLong",
"()V"
) {}
inline AtomicLong::AtomicLong(jlong arg0)
: ... |
Markdown | UTF-8 | 13,494 | 3.0625 | 3 | [] | no_license | #Workflows
Each aggregate root tyoe in the system has an associated workflow which manages its state and transitions. It is possible to fully customise the workflow configuration. We can configure the states to meet the requirements in these files:
* `config/Owner/workflows.xml`
* `config/Account/workflows.xml`
* `... |
C | UTF-8 | 2,373 | 3.765625 | 4 | [] | no_license | /*
** unique_ptr.c
**/
#include <iostream>
#include <vector>
#include <memory>
#include <cstdio>
#include <fstream>
#include <cassert>
#include <functional>
struct B
{
virtual void bar() { std::cout << "B::bar\n"; }
virtual ~B() = default;
};
struct D : B
{
D() { std::cout << "D::D\n"; }
~D() { std::c... |
C++ | UTF-8 | 1,357 | 2.734375 | 3 | [] | no_license | #ifndef _GPIOCTRL_H_
#define _GPIOCTRL_H_
#include <climits>
#include <thread>
#include "globals.h"
extern globalVars globals;
// Set maximum number of controls
const int MaxControls = 20;
enum pinType {
Rot1 = 0,
Rot2 = 1,
Push = 2,
Toggle = 3,
Led = 4
};
class gpioctrl
{
private:
std::thr... |
Java | UTF-8 | 574 | 2.3125 | 2 | [] | no_license | package org.ajax4jsf.bean;
public class AjaxLogBean {
private boolean popup = false;
/**
* Gets value of popup field.
*
* @return value of popup field
*/
public boolean isPopup() {
return popup;
}
/**
* Set a new value for popup field.
*
* @param popu... |
C | UTF-8 | 1,102 | 3.1875 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int i,j,temp,n,b[10],totw=0,tott=0,wt[10],tat[10];
float avgwt, avgtat;
printf("FCFS scheduling\n");
printf("Enter the number of processes \n");
scanf("%d",&n);
printf("Enter the burst time of %d processes\n",n);
for(i=0;i<n;i++)
{
scanf("%d",&b[i]);
}
for(i=0;i<n;i++)
{
i... |
Markdown | UTF-8 | 1,146 | 2.609375 | 3 | [] | no_license | ## 二级存储
这里我们配置NFS服务作为CloudStack中用到的二级存储, 并在其上引入系统虚拟机模板。
### NFS服务器
在Management节点上,默认的nfs-utils已经被安装,所以我们只需要按照以下步骤配置:
```
# vim /etc/exports
/home/exports *(rw,async,no_root_squash,no_subtree_check)
# mkdir -p /home/exports
# chmod 777 -R /home/exports/
# chkconfig nfs on
# chkconfig rpcbind on
# service nfs ... |
Java | UTF-8 | 914 | 3.015625 | 3 | [] | no_license | package Day27_Wrappers.StaticPractice;
public class AmazonTest {
public static void main(String[] args) throws Exception {
AmozonUtils.navigate(Testdata.URL);
AmozonUtils.login(Testdata.username, Testdata.password);
AmozonUtils.search("Carpet");
String[] actualResult = {"carpet","rug","Turkish carpet"... |
Java | UTF-8 | 416 | 2.234375 | 2 | [] | no_license | package sample;
public enum Genres {
FPS("FPS"), ShootThemUp("Shoot 'em up"), Roguelike("Roguelike"), Roguelite("Roguelite"), RPG("RPG"), ActionRPG("ActionRPG"),
Platformer("Platformer"), Metroidvania("Metroidvania"), Simulator("Simulator"), Race("Race"), MMORPG("MMORPG"), RTS("RTS"), Strategy("Strategy"),
... |
C++ | UTF-8 | 1,131 | 2.609375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
char token[1024][512];
int tlen[1024];
int WIDTH, offset = 0, n = 0;
char buf[10<<20];
static int readtoken(char **ret) {
static const int N = 10<<20;
static char *end = buf, *token = NULL;
if(token == NULL) {
if((end = buf + fread(buf, 1, N, stdin)) == buf)
... |
Python | UTF-8 | 922 | 2.765625 | 3 | [] | no_license | def test(Tdentro,t):
Qsaida = (Tdentro-Tfora)/(espessura/(kar*Areainterna) + 1/(har*Areainterna))
Qentrada = o * emissividade * Areainterna * (Tpessoa**4-Tdentro**4)
dTdt = (Qentrada-Qsaida)/m0*cneve
print(Qsaida)
return dTdt
from math import pi
kar = 500
raio = 2
Areainterna = 4*pi*rai... |
PHP | UTF-8 | 3,077 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding yo... |
Java | UTF-8 | 628 | 2.203125 | 2 | [
"Unlicense"
] | permissive | package cc.novoline.events;
import cc.novoline.events.EventManager;
import java.lang.reflect.Method;
final class EventManager$MethodData {
private final Object source;
private final Method target;
private final byte priority;
public EventManager$MethodData(Object var1, Method var2, byte var3) {
Eve... |
C# | UTF-8 | 1,102 | 3.09375 | 3 | [] | no_license | using System.IO;
namespace lib
{
public class StringWriterWithEvent : StringWriter
{
public event OnFlushed Flushed;
public delegate void OnFlushed();
public event OnWritten Written;
public delegate void OnWritten(string str);
public bool AutoFlush { get; set; }
... |
Markdown | UTF-8 | 2,675 | 2.828125 | 3 | [] | no_license | #### 第四百零六章 愣严真传承 大法波罗尊
多耶波落嘎
愣严法身成就时候,炼成他时候,张口对虚空说,捏了一个法诀我知道这个意思
(愣严法身)召唤十方三世一切诸佛菩萨罗汉护
法眷属敕令
锅嘎
愣严金身成就时候也是张嘴说了这个,我也是记录自然知道他的意思,捏了一个诀
(愣严金身)命令一切众生
莫令
愣严法相成就时候也是如此,捏了一个诀,开口喝言,虚空沸腾振动……
(愣言法相)镇魔王
最后愣严法相开口,虚空沸腾振动,而成功修成,外面无数穿黄僧衣和尚泪流漫漫………
只是扣头不止………
多耶波落嘎,法身又捏诀说了一句,无数金刚护法出现,他将手一直,就是那害我的小人,那些金刚护法竖掌胸前一礼... |
TypeScript | UTF-8 | 631 | 3.59375 | 4 | [
"MIT",
"CC0-1.0"
] | permissive | import createMathOperation from './.internal/createMathOperation';
/**
* @ignore
*/
const internalAdd = createMathOperation((augend: any, addend: any) => augend + addend, 0);
/**
* Adds two numbers.
*
* @since 5.3.0
* @category Math
* @param augend The first number in an addition.
* @param addend The second n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.