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 |
|---|---|---|---|---|---|---|---|
C++ | UTF-8 | 5,116 | 2.875 | 3 | [
"BSD-2-Clause"
] | permissive | /* dc_motor.hpp
David Verdi
Created 4/16/2017
Modified 4/28/2017
This is the header file holding the function definitions for the dc_motor
class.
This is version 1.0 so only support for start flags, done flags, one
velocity-time vector, and one encoder.
The variable velocity_path is a po... |
Markdown | UTF-8 | 20,200 | 2.96875 | 3 | [] | no_license | # 猪都到哪儿去了——主流媒体谈猪色变,原因在哪里?
**若无猪,家将不家,何以华夏?**
导读:尊重少民不吃猪肉的民族习俗,底线是不强迫他们吃猪肉,这是本分,也是尊重之底线。至于听不得猪、见不得猪,这是典型的宗教极端化、原教旨化,这逆全世界宗教脱敏化潮流的,注定是反融合的,必然是与19大报告要求的各民族之间交往交流交融是格格不入,背道而驰的。结果多半是封闭隔离,平行社会,非国家之福。
恐猪是典型的宗教极端化,宗教信徒这么说就是宗教极端主义,非宗教信徒这么说就是极端主义和分裂分子的帮凶。
**备注:** 承接上面一篇
前面一篇已经介绍了,主流媒体谈猪色变的现象,这篇再从事理角度分析,猪为何对中国人那么重要?然而又... |
Java | UTF-8 | 2,329 | 2.265625 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Model;
import config.Conexion;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import jav... |
TypeScript | UTF-8 | 755 | 3.296875 | 3 | [
"Zlib",
"MIT"
] | permissive | let myInfo = function (text: string, newline: boolean) {
if (newline) {
console.log(text);
}
else {
process.stdout.write(text);
}
};
let myError = function (text: string, newline: boolean) {
if (newline) {
console.error(text);
}
else {
process.stderr.write(text);
}
};
export function... |
C# | UTF-8 | 449 | 2.578125 | 3 | [
"MIT"
] | permissive | using System.Linq;
namespace UnitGenerator
{
public class CommonFractionalUnitsCollection
{
public CommonFractionalUnitsCollection(CommonFractionalUnit[] items)
{
Items = items;
}
public CommonFractionalUnit[] GetBy(XUnitTypeName namesUnit)
{
ret... |
Python | UTF-8 | 1,027 | 2.75 | 3 | [] | no_license | userRatingTable = {'Ana':
{'Eleanor Rigby': 1,
'Mora na filosofia': 3,
'Wish You Were Here': 4,
'Nostalgia': 2,
'Within You Without You': 2,
'Comfortably Numb': 1},
'Leonardo':
{'Mora na filosofia': 15,
'Within You Without You': 3,
'Nostalgia': 9}
'Claudia':
{'Mora na filo... |
Python | UTF-8 | 2,287 | 2.703125 | 3 | [
"MIT"
] | permissive | import numpy as np
import matplotlib as mp
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.examples.tutorials.mnist import input_data
import math
def getActivations(layer,stimuli):
units = sess.run(layer,feed_dict={x:np.reshape(stimuli,[1,784],order='F... |
Java | UTF-8 | 1,294 | 1.96875 | 2 | [] | no_license | package com.aditya.pictattendanceTry.utils;
import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import com.aditya.pictattendanceTry.widget.WidgetListProvider;
import com.aditya.pictattendanceTry.widget.WidgetPercentProvider;
... |
JavaScript | UTF-8 | 1,413 | 2.515625 | 3 | [] | no_license | var db = require('../../config/db');
var messages = require('../../config/messages').Messages
module.exports = {
createCustomer,
getCustomerById
}
function createCustomer(req,res){
let data = req.body
console.log(data)
req.checkBody('name', 'name is required').notEmpty()
req.checkBody('phone_... |
JavaScript | UTF-8 | 2,957 | 2.546875 | 3 | [] | no_license | const URI = 'https://jinjiating.xyz'
const fetch = require('./fetch')
const baidu = require('./baidu.js')
function fetchApi(type, params) {
return fetch(URI, type, params)
}
function listCinemas(url, params, origin) {
var cinemas = fetchApi(url, params).then(res => {
if (res.data.length == 0) {
return [... |
Java | UTF-8 | 3,566 | 2.078125 | 2 | [] | no_license | package com.bjpowernode.crm.settings.web.controller;
import com.bjpowernode.crm.commons.contants.Contants;
import com.bjpowernode.crm.commons.domain.ReturnObject;
import com.bjpowernode.crm.settings.domain.DicType;
import com.bjpowernode.crm.settings.service.DicTypeService;
import org.springframework.beans.factory.ann... |
C++ | UTF-8 | 2,161 | 2.96875 | 3 | [] | no_license | #include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266WebServer.h>
#include <WiFiClient.h>
WiFiServer server(80);
const char* ssid = "ESP8266-Access-Point";
const char* password = "123456789";
//Your IP address or domain name with URL path
const char* serverName = "192.168.4.1";
const char* message... |
Java | UTF-8 | 4,596 | 2.9375 | 3 | [] | no_license | package phoenix.templatesearcher.highloadtests;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import phoenix.templatesearcher.algo.api.ICharComparator;
import phoenix.templatesearcher.api.IMetaTemplateMatcher;
import phoenix.templatesearcher.matchers.NaiveTemplateMatcher;
imp... |
Java | UTF-8 | 2,305 | 2.484375 | 2 | [] | no_license | package controllers;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import models.Contact;
import models.ContactStore;
import play.libs.Json;
import play.mvc.Controller;
import play.mvc.Result;
import java.util.Set;
import util.Util;
/**
* Created by Developers on ... |
PHP | UTF-8 | 11,166 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace Microsoft\Graph\Beta\Generated\Models;
use Microsoft\Kiota\Abstractions\Serialization\Parsable;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
class PrivilegedAccessGroupAssignmentScheduleRequest extends PrivilegedAccessSc... |
C# | UTF-8 | 2,561 | 2.5625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Window... |
Markdown | UTF-8 | 14,539 | 3.3125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: bandit learning介绍
description:
modified: 2021-05-20
tags:
---
# 摘要
隐式反馈(比如:用户点击)尽管在在线信息服务中非常丰富,但在用户评估系统输出方面并没有提供实质帮助。如果没有合理地进行建模,会误导模型估计,特别是在bandit learning setting中(feedback会即时获取)。在本工作中,我们会执行使用implicit feedback的contextual bandit learning,它会建模feedback作为用户结果查看(result examination)、以及相关评估(rela... |
Java | UTF-8 | 5,406 | 2.953125 | 3 | [] | no_license | package gr.demokritos.iit.irss.semagrow.base;
public class Estimation {
private Long currentEstimation;
private Long metric1;
private Long metric2;
private Long metric3;
private Long metric4;
private Long metric5;
private final static Integer maximumTimesLarger = 0; //set to zero if no limit
public Estimat... |
Markdown | UTF-8 | 701 | 2.796875 | 3 | [] | no_license | # TapSearch v1.0
TapSearch submission by Arnav Tiwari
## Usage
### Add paragraph(s)
Simply paste the paragraph in the paragraph field and click "Add Paragraph".
### Index paragraph(s)
**Before being searched, the paragraphs need to be indexed first.**
To index all the paragraphs, simply click "Index Paragraph" leavi... |
Java | UTF-8 | 584 | 2.296875 | 2 | [] | no_license | package utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.support.annotation.NonNull;
public class NetworkConnection {
/**
* CHECK WHETHER NETWORK CONNECTION IS AVAILABLE OR NOT
*/
public static boolean checkConnection(@NonNull Context context) {
... |
Go | UTF-8 | 1,551 | 3.625 | 4 | [
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-google-patent-license-golang",
"BSD-3-Clause"
] | permissive | // Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package slices implements various slice algorithms.
package slices
// Map turns a []T1 to a []T2 using a mapping function.
func Map[T1, T2 any](s []T1, f fu... |
Java | UTF-8 | 384 | 1.882813 | 2 | [] | no_license | package com.app.hupi.util;
import com.app.hupi.exception.KiteException;
import com.app.hupi.vo.UserVO;
public class UserUtil {
public static String getUserId() {
return "1";
}
public static UserVO getUserVO() {
UserVO vo=(UserVO) WebUtil.getSession().getAttribute("user");
if(vo==null) {
KiteExc... |
C++ | UTF-8 | 723 | 2.765625 | 3 | [] | no_license | /**
* Name: Joseph Lord
* Program: Table.cpp
* Class: CSE 461 Adv Operating Systems
* Date: 2019-10-22
* Purpose: Implementation of the Table class
**/
#include "Sdisk.h"
#include "Filesys.h"
#include "Table.h"
using namespace std;
Table::Table(string diskname, int numberofblocks, int blocksize, string flatfile... |
Markdown | UTF-8 | 2,906 | 2.65625 | 3 | [] | no_license | ---
ms.openlocfilehash: 2ec215727084d9ae144c1029c3e33beb15470af4
ms.translationtype: MT
ms.contentlocale: zh-CN
ms.lasthandoff: 04/24/2019
---
Azure Data Lake Storage is a Hadoop-compatible data repository that can store any size or type of data. This storage service is available as Generation 1 (Gen1) or Generation 2 ... |
Java | UTF-8 | 2,241 | 1.992188 | 2 | [] | no_license | package com.brightsconsulting.conoha4j.api.compute;
import java.io.IOException;
import org.apache.http.auth.AuthenticationException;
import org.apache.http.client.ClientProtocolException;
import org.junit.Test;
import com.brightsconsulting.conoha4j.BadRequestException;
import com.brightsconsulting.conoha4j.json.comm... |
C++ | GB18030 | 1,542 | 2.6875 | 3 | [] | no_license |
/*
ڵǣҲܵȴһȫɺʩһ
ĻϿܴڶͬͬķȻ֮зCDĴ
ڡ
ˣҪб
ǣҲʩչʱҲҪרŵʩչ
ЧĿꡣbuffࣩ֮
ȻʵǣΪÿ㵱ǰ״̬ռõʱDzɹƵģΪ
űʽڣԸmain.cpp۵붪ʧЧ
ӣӦÿǷһ̡߳
עⲻѤѤ̶ȶʱɵӰȾУȻȾ
ѾΪһ߳ˡӰʱֻǷĸӳ̶ȣ
пܰģڷűмSleepĿܡ
Script.cppҲ
*/
void CSpell::CastSpellHero(...);
void CSpell::CastSpellMonster(...);
// Ϊܶ෨гЧ÷űÿһ֡ıΪ
// ǵΪűĿײ⺯
void CSpe... |
JavaScript | UTF-8 | 763 | 2.828125 | 3 | [
"ISC"
] | permissive |
'use strict'
const tap = require('tap')
const objectFx = require('../index.js')
let flattened = null
// let expanded = null
/**
* Array of objects
*/
const arrayOfObjects = [{ a: 1 }, { b: 2 }, { c: 3 }]
flattened = objectFx.flatten(arrayOfObjects)
tap.strictSame(flattened, {
'0.a': 1,
'1.b': 2,
'2.c': 3
},... |
Markdown | UTF-8 | 1,875 | 2.578125 | 3 | [] | no_license |
## NETWORK
#### timeout
- 기본값: 0 (seconds)
클라이언트가 N초동안 유휴(idle)상태라면, 커넥션을 종료시킨다. `0`으로 설정하면 이 기능을 비활성화한다.
#### tcp-keepalive
- 기본값: 300 (seconds)
TCP keepalive 관련 설정.
이 값이 0이 아니라면, 커뮤니케이션이 없는 상태의 클라이언트에게 `TCP ACKs`를 보내기 위해서 `SO_KEEPALIVE`를 사용한다. 이것은 다음의 2가지 이유로 유용하다.
1. 연결이 죽어있는 상태를 발견한다.
2. 네트워크 장비 관점에서 커넥션이 살아있... |
Java | UTF-8 | 5,548 | 2.078125 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package airport.controller;
import de.grobmeier.jjson.JSONObject;
import de.grobmeier.jjson.JSONString;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.logging.... |
Markdown | UTF-8 | 2,893 | 2.859375 | 3 | [
"MIT"
] | permissive | ---
hrs_structure:
division: '5'
volume: '14'
title: '37'
chapter: '707'
section: 707-781
type: hrs_section
tags:
- Crime
- Criminal Proceeding
menu:
hrs:
identifier: HRS_0707-0781
parent: HRS0707
name: Chapter 707 Offenses Against the Person
weight: 21300
title: Offenses Against the Person
... |
JavaScript | UTF-8 | 11,611 | 2.546875 | 3 | [] | no_license | $(document).ready(function() {
var mode;
mode = "manual";
$("button[name=auto]").on("click", function() {
window.NN.randomize();
window.generations = [[]];
mode = "auto";
});
$("button[name=manual]").on("click", function() {
mode = "manual";
});
svg = docum... |
Python | UTF-8 | 2,416 | 2.71875 | 3 | [] | no_license | import cv2
import numpy as np
import seaborn as sns
from scipy.stats import norm
import matplotlib.pyplot as plt
import scipy.stats
import sklearn
# Open a simple image
img = cv2.imread("images/Hand_0000233.jpg")
img = cv2.resize(img, (360, 480))
cv2.imshow("Original", img)
# GMM Model for threshold calcultion
... |
Java | UTF-8 | 4,497 | 2.15625 | 2 | [
"Apache-2.0"
] | permissive | package cn.edu.sysu.workflow.engine.core.env.groovy;
import cn.edu.sysu.workflow.engine.core.Context;
import cn.edu.sysu.workflow.engine.core.env.SimpleContext;
import groovy.lang.Closure;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.*;
import java.util.Iterator;... |
C# | UTF-8 | 4,645 | 2.6875 | 3 | [
"MIT"
] | permissive | using JetBrains.Annotations;
namespace Vostok.Hercules.Client
{
/// <summary>
/// <see cref="HerculesSinkCounters"/> contain a set of cumulative counters describing internal processes of a <see cref="HerculesSink"/>.
/// </summary>
[PublicAPI]
public class HerculesSinkCounters
{
public ... |
C++ | UTF-8 | 1,828 | 2.8125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define inf 1e9
#define pb push_back
#define mp make_pair
#define MAXN 100010
vector<int> g[MAXN];
int in[MAXN];
int out[MAXN];
int diameter;
// in[u]: altura da subárvore do u com a raiz prefixada (raiz é sempre o 1)
// out[u]: altura fora da subárvore do u, pode ir pra... |
Python | UTF-8 | 3,036 | 3.515625 | 4 | [
"MIT"
] | permissive | # @auther Besir Kurtulmus
# coding: utf-8
'''
The MIT License (MIT)
Copyright (c) 2014 Ahmet Besir Kurtulmus
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without... |
Python | UTF-8 | 366 | 3.765625 | 4 | [] | no_license | import hashlib
def hashing():
name = input("Enter your name:")
print(name)
print("Your name is being hashed....")
hash1 = hashlib.md5(name.encode()) #hashing layer 1
hash2 = hashlib.sha1(hash1.digest()) #hashing layer 2
hash3 = hashlib.sha224(hash2.digest()) #hashing l... |
Java | UTF-8 | 1,022 | 2.015625 | 2 | [] | no_license | package com.epam.gpipko;
import com.epam.gpipko.dto.ProjectDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.Local... |
Markdown | UTF-8 | 2,011 | 2.90625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | # Submitting a PR
We appreciate your initiative and would love to integrate your work with the rest of the project! Here is how you can help us do it as quickly as possible.
- check, that your feature branch is up-to-date. If it's not, there is a risk of merge conflicts or other issues that will complicate merging yo... |
Java | GB18030 | 358 | 2.546875 | 3 | [] | no_license | package com.ysy.factory;
public class Demo4Action {
public String method1(){
System.out.println("ִеmethod1");
return "success";
}
public String method2(){
System.out.println("ִеmethod2");
return "error";
}
public String method3(){
System.out.println("ִеmethod3");
return "error";
}
}
|
JavaScript | UTF-8 | 3,178 | 3.03125 | 3 | [] | no_license |
//List of all FAQ questions
var Questions = [
["Can I put my restaurant through a short trial period", "If you would like to trial Quikbites, contact sales for a specialized support assistant to find the best option for you."],
["Which pricing plan should I choose?", "We understand that every restaurant is different... |
TypeScript | UTF-8 | 391 | 2.96875 | 3 | [] | no_license | // ANCHOR: Constant Import
import { USER_TOKEN_CONSTANT } from '@state/constants';
// ANCHOR: Interface
interface IAction {
type: string;
payload: string | null;
}
// ANCHOR: User Token Reducer
export const userTokenReducer = (state = null, action: IAction) => {
switch(action.type) {
case USER_TOKEN_CONSTAN... |
Python | UTF-8 | 428 | 3.140625 | 3 | [] | no_license | n = int(input())
if n > 1:
prev = int(input()) + int(input())
max = -1000000000000000000
for i in range(n - 1):
sum = int(input()) + int(input())
if max < abs(sum - prev):
max = abs(sum - prev)
prev = sum
if max == 0:
print("Yes, value=" + str(prev))
else:... |
Java | UTF-8 | 3,793 | 2.4375 | 2 | [] | no_license | package com.wei.scientificcalculator.models;
import android.support.annotation.IntDef;
public class Unit {
// units of length
public static final int INCH = 0;
public static final int FOOT = 1;
public static final int YARD = 2;
public static final int MILE = 3;
public static final int MILLIM... |
Java | UTF-8 | 722 | 2.0625 | 2 | [] | no_license | package com.xiaochen.listscroll;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;
import com.xiaochen.listscroll.adapter.ListViewAdapter;
import com.xiaochen.listscroll.data.MockData;
public class ListviewActivity extends AppCompatActivity {
ListView mLis... |
JavaScript | UTF-8 | 535 | 3.390625 | 3 | [] | no_license | function traverse(el, str) {
// Your code can go here - acting on the way down
// the tree towards the branches
for (var i = 0; i < el.childNodes.length; i++) {
traverse(el.childNodes[i], str);
}
// Or your code can go here - acting on the way back up
// the tree towards the root
... |
Ruby | UTF-8 | 302 | 3.40625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | def run_guessing_game
comp_guess = rand(5)+1
user_guess = prompt_user
if user_guess == 'exit'
puts "Goodbye!"
elsif user_guess.to_i == comp_guess
puts "You guessed the correct number!"
else
puts "Sorry! The computer guessed #{comp_guess}."
end
end
def prompt_user
gets
end |
C++ | UTF-8 | 3,102 | 3.109375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #include "Map.h"
#include "../utils/Utils.h"
#include "../libmgrs/utm.h"
#include <cstdio>
#include <cmath>
#include <limits>
#include <iostream>
double** Map::init_map_data(size_t rows, size_t cols) {
double** map;
map = (double**)malloc(rows * sizeof(double*));
for (size_t i = 0; i < rows; ++i) {
map[i] ... |
JavaScript | UTF-8 | 696 | 2.765625 | 3 | [] | no_license | const EventEmitter = require('events');
class EventPublisher extends EventEmitter {
constructor() {
super();
this.properties = {
data: [
"Chunk 1",
"Chunk 2",
"Chunk 3"
],
currentChunk: 0
}
}
sendChu... |
Markdown | UTF-8 | 4,226 | 2.640625 | 3 | [] | no_license | ---
title: Barney
layout: post
permalink: barney
published: true
---
The red light was on when Barney woke up. Shit! It had to be a drill or a malfunction of the measuring equipment or something. According to his panel, according to the big red light in the middle of it that was shining brightly, there had been a major... |
Python | UTF-8 | 393 | 3.296875 | 3 | [
"MIT"
] | permissive | # Time complexity: O(n)
# Approach: Accumulate the both ways. At each step, either we can take 2 steps or we can take 1 step excluding the corner cases.
class Solution:
def climbStairs(self, n: int) -> int:
if n==1 or n==2:
return n
dp = [0]*n
dp[0], dp[1] = 1, 2
for i i... |
Swift | UTF-8 | 5,957 | 2.640625 | 3 | [] | no_license | //
// TableViewController.swift
// mySection
//
// Created by CAUAD05 on 2018. 8. 8..
// Copyright © 2018년 ahnYeLim. All rights reserved.
//
import UIKit
class TableViewController: UITableViewController {
struct Section {
var sectionName:String
var records:[RecordFile]
}
var... |
C# | UTF-8 | 1,048 | 3.34375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Monopoly
{
public class Chest : Place
{
List<Card> Cards;
public Chest()
{
}
public Chest(String name, int price, List<Card> cards)
{
... |
JavaScript | UTF-8 | 3,973 | 2.8125 | 3 | [
"MIT"
] | permissive | var should = require("should");
var EventedObject = require('./object-events');
var poolSize = 2;
describe('object-events', function(){
describe('sets values', function(){
it('deep value', function(){
var ob = new EventedObject();
ob.set('user.name.first', 'Ed');
... |
C++ | UTF-8 | 920 | 2.796875 | 3 | [
"CC-BY-4.0"
] | permissive | #pragma once
struct api_judge_info
{
wchar_t * path;
int path_len;
wchar_t * input;
int input_len;
int32_t time_limit_ms;
float memory_limit_mb;
};
struct judge_info
{
judge_info(){}
judge_info(api_judge_info const &);
std::wstring path;
std::wstring input;
int64_t time_limit;
size_t memory_limit;
... |
JavaScript | UTF-8 | 479 | 3.921875 | 4 | [] | no_license | function fearNotLetter(str) {
var alphabet = "abcdefghijklmnopqrstuvwxyz";
var firstLetter = str[0];
var firstLetterIndice = alphabet.indexOf(firstLetter);
var compareStr = alphabet.slice(firstLetterIndice, firstLetterIndice + str.length);
for (var i = 0; i < str.length; i++) {
if(str === ... |
SQL | UTF-8 | 27,660 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 03, 2019 at 05:59 AM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
C++ | UTF-8 | 712 | 3.15625 | 3 | [] | no_license | #ifndef BOARD_HH
#define BOARD_HH
#include <iostream>
#include <cstdlib>
#include <vector>
using namespace std;
class Board
{
private:
int** board;
int size;
int winrow;
int movecount;
int last[2];
public:
// Konstruktor
Board() {
}
// Destruktor
virtual ~Board() {
delete... |
Java | UTF-8 | 6,795 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | package nagini.client.command;
import java.io.IOException;
import java.io.PrintStream;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import nagini.client.NaginiClient;
/**
* Implements all clean commands.
*/
public class NaginiCommandClean extends AbstractCommand {
/**
* Parses command-lin... |
Markdown | UTF-8 | 1,431 | 2.703125 | 3 | [] | no_license | # 部署:
部署就是把一件开发好的服务程序发布到生产机上,并运行。由于程序的开发环境与生产机的软件配置往往都不一样,也由于个个服务程序所依赖的环境也不一样。造成程序发布是一个艰难的过程,很多时候会出现软件在生产机上并不能顺利启动,或者出现这个那个的错误。后来出现了docker这个软件,docker可以为个个服务程序提供一个独立的运行环境,各个服务程序相互不影响。就很容易把这个问题解决了。可以很快速部署软件。只需把写好的软件放在docker中运行测试,测试通过后。就直接发布测试的镜像就可以了。
有了Docker对于微服务还是不够的,由于微服务的灵活多变,有时候需要编排不同的docker运行在不同的机器中,我们还需要一个docke... |
Go | UTF-8 | 10,994 | 3 | 3 | [
"MIT"
] | permissive | package examples
import (
"time"
"github.com/golang/protobuf/ptypes"
"go.uber.org/zap"
)
func ExampleTest() {
l := zap.NewExample()
l.Info("test", zap.Object("simple", &SimpleMessage{
StringValue: "xyz",
BoolValue: true,
}))
// output: {"level":"info","msg":"test","simple":{"string_value":"xyz","bool_va... |
Python | UTF-8 | 504 | 3.84375 | 4 | [] | no_license | """
Questão: Lista 1 14
Descrição: lê 3 notas e seus 3 pesos e devolve a media ponderada
"""
def main():
#entrada
nota1,nota2,nota3 = [float(i) for i in input("Ensira suas 3 notas: ").split()]
peso1,peso2,peso3 = [int(i) for i in input("Ensira os 3 pesos respectivos as notas inseridas anteriormente: ").split()]
... |
Java | UTF-8 | 875 | 3.15625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ch7_20210318.overwrite;
import ch7_20210318.extend1.*;
/**
*
* @author xvpow
*/
public class Student extends ... |
PHP | UTF-8 | 2,409 | 2.921875 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0", method="GET";>
<title>Login screen</title>
</head>
<body>
<?php
session_start();
$host="localhost"; // Navn på host
$username="root"; // Mysgl username (Stand... |
Ruby | UTF-8 | 1,976 | 3.71875 | 4 | [] | no_license | require 'sqlite3'
def divider
puts "\n ----------------------------------------------------------------------------------------"
end
3.times do divider end
def mill_to_min(mill)
mill/1000/60
end
def min_to_mill(min)
min*60*1000
end
# opens the database
DATABASE_PATH = "db/jukebox.sqlite"
db = SQLite3::Databa... |
Markdown | UTF-8 | 28,970 | 3.0625 | 3 | [
"MIT"
] | permissive | # `IDataView` Implementation
This document is intended as an essay on the best practices for `IDataView`
implementations. As a prerequisite, we suppose that someone has read, and
mostly understood, the following documents:
* [Design principles](IDataViewDesignPrinciples.md) and
* [Type system](IDataViewTypeSystem.md)... |
Java | UTF-8 | 90 | 2.203125 | 2 | [] | no_license | package interfaces;
public interface Tax {
void calcTax(double paymentWithoutTax);
}
|
Shell | UTF-8 | 4,944 | 2.828125 | 3 | [] | no_license | 一、安装pyenv
#系统环境
# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
1、安装git
# yum -y install git
2、安装pyenv
# curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
或者参考:https://github.com/yyuu/pyenv-installer
3、配置... |
Markdown | UTF-8 | 7,188 | 3.0625 | 3 | [] | no_license | 九十一
“老身可不管你什么来路,不在乎多杀一个……”
“恐怕没那么容易。”
眼一花,老妪直迫身前,好快的身法,方石坚愣了一愣,老妪伸左手便点,手影到三分之二时,突地幻起成无数手影,罩向中上盘所有要害穴道。方石坚吃一惊,本能地一掌推出。
闷哼声出,老妪向后弹身,而方石坚身上已中了五指之多,不由为之骇然,“千手观音”的确人如其说。真像有千只手同时而出。
但更感惊的却是“千手观音”对方连中数指竟然若无其事,而且掌力之沉厚,更不应该出现在像这年纪的人身上。
方石坚冷漠地道:“容在下问问住持人如何?”
武林人无论黑白两道。除了极少数外,都极珍惜羽毛,成名不易,保名更不易,“千手... |
C++ | UTF-8 | 1,506 | 2.515625 | 3 | [] | no_license | #define _HAS_ITERATOR_DEBUGGING 0
#define _SECURE_SCL 0
#include <boost/exception/detail/type_info.hpp>
#include <boost/range/algorithm_ext.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/range/numeric.hpp>
#include <boost/timer/timer.hpp>
#include <exception>
#include <io... |
C# | UTF-8 | 2,042 | 2.890625 | 3 | [
"MIT"
] | permissive | using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Axe.SimpleHttpMock.ServerImpl.ContentFormatter
{
class JsonContentFormatter : IContentSerializer, IContentDeserializer
{
const string MediaType = ... |
Markdown | UTF-8 | 1,244 | 2.65625 | 3 | [] | no_license | # SENTIMENT ANALYSIS ON TWITTER FOR STOCK MARKET MOVEMENTS ANTICIPATION
### DESCRIPTION
Natural language processing application to explore the relationships of causation between public sentiment expressed on microblogging platforms such as Twitter regarding current political issues (Brexit) and movements of l... |
Markdown | UTF-8 | 417 | 2.609375 | 3 | [] | no_license | # Miscellaneous
## Centroid decomposition
[Motivation](https://codeforces.com/problemset/problem/161/D): find all pairs of vertices in a graph which are excatly $$k$$ vertices from each other.
## Radius in graph
[Motivation](https://codeforces.com/contest/337/problem/D): find all vertices in a graph which can be in... |
Python | UTF-8 | 2,346 | 2.9375 | 3 | [] | no_license | import cv2
import numpy as np
def derive_graym(impath):
''' The intensity value m is calculated as (r+g+b)/3, yet
grayscalse will do same operation!
opencv uses default formula Y = 0.299 R + 0.587 G + 0.114 B
'''
# return cv2.imread(impath, cv2.CV_LOAD_IMAGE_GRAYSCALE)
return cv2.imrea... |
JavaScript | UTF-8 | 312 | 2.890625 | 3 | [
"JSON"
] | permissive | const today = new Date();
const Time = () => {
const year = today.getFullYear();
const month = today.getMonth() + 1;
const date = today.getDate();
// year = toString();
// month = toString();
// date = toString();
const time = `${month}/${date}/${year}`;
return time;
};
export default Time;
|
Java | UTF-8 | 963 | 2.3125 | 2 | [] | no_license | package org.hades.wechat_align_bottom.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;
/**
* Created by Hades on 17/2/4.
*/
public class MyListView extends ListView {
private OnReSizeListener listener;
public interface OnReSizeListener{
void o... |
Java | UTF-8 | 1,140 | 2.109375 | 2 | [
"Apache-2.0"
] | permissive | /** This class was generated by GenTest@Mobacar */
package artistry.services;
import artistry.models.Train;
import artistry.repositories.TrainRepository;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springfram... |
Java | UTF-8 | 677 | 2.046875 | 2 | [] | no_license | package android.example.googlebooks.Models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Item {
@SerializedName("volumeInfo")
@Expose
private VolumeInfo volumeInfo;
@SerializedName("searchInfo")
@Expose
private SearchInfo searchI... |
C | UTF-8 | 48,925 | 2.6875 | 3 | [
"MIT"
] | permissive | /* Partner 1 Dylan O'Neill donei003@ucr.edu:
* Partner 2 Alex Wong awong030@ucr.edu:
* Lab Section: 023
* Assignment: Custom Lab Project
* Exercise Description: Tetris
*
* I acknowledge all content contained herein, excluding template or example
* code, is my own original work.
*/
//---------------------------------GL... |
C# | UTF-8 | 779 | 3.671875 | 4 | [] | no_license | using System;
using System.Linq;
namespace _59A
{
class Program
{
static void Main(string[] args)
{
int counterUpper = 0;
int counterLower = 0;
string input = Console.ReadLine();
for(int i = 0; i < input.Length; i++)
{
... |
Markdown | UTF-8 | 1,825 | 3.421875 | 3 | [] | no_license | ---
title: Shell脚本流程控制
date: 2017-10-19 18:52:50
tags: [Linux, Shell]
categories: [Learning]
---
### if-else
``` sh
#! /bin/sh
a=1
if [ $1=$a ]
then
echo "you input 1"
elif [ $1=2 ]
then
echo "you input 2"
else
#do nothing
echo " you input $1"
fi
```
如果某个条件下的执行体为空, 就不能写这个条件,否则会报错;
[ ] 两边一定要加空格, 否则会报错;
注意: 实际上这里的... |
Shell | UTF-8 | 2,243 | 3.34375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | #!/usr/bin/env bats
load ../test_helper
export NAMESPACE=test
@test "Create non-replicated volume using driver ($driver)" {
run $prefix2 docker volume create --driver $driver --opt size=10 stress-sync
assert_success
}
@test "Confirm volume is created (volume ls) using driver ($driver)" {
run $prefix2 docker v... |
C++ | UTF-8 | 1,136 | 3.21875 | 3 | [] | no_license | #include "mainheader.h"
#include <stack>
int myconvert(string in, int& res){
res = 0;
switch (in[0]){
case '+':
return 1;
break;
case '-':
if (in.size() == 1)
return 2;
else{
for (int i = 1; i < in.size(); i++){
res = res * 10 + (in[i] - '0');
}
res = -res;
return 0;
}
break;
case '*... |
Shell | UTF-8 | 3,017 | 2.6875 | 3 | [] | no_license | #!/bin/bash
# This script is for use in the API Training Course
# Written by John Fitzpatrick, March 2013
#CLOUD="1" # Specify the Cloud to add the Server Array to
CLOUD=`grep CLOUD LabInfo | cut -c 7-|tr -d '\r'`
#SG="50K6AE2MB3LDL" #You can add the Sec Group ID Manually
SG=`grep Location output/01_S... |
Python | UTF-8 | 508 | 3.21875 | 3 | [] | no_license | import openpyxl
lst = [["test1", 'A'],
["test2", 'B'],
["test3", "C"],
["test4", 'D'],
["test5", "R"]]
def write_xls(lst):
wb = openpyxl.Workbook()
wb.create_sheet(title="Лист", index=0)
sheet = wb["Лист"]
for i in range(len(lst)):
for j in lst[i]:
value... |
JavaScript | UTF-8 | 1,816 | 3.109375 | 3 | [] | no_license | var count = 0;
var table = document.getElementById("table1");
var btn = document.getElementById("btn");
btn.addEventListener("click", function () {
var ourRequest = new XMLHttpRequest();
ourRequest.open('GET', 'https://srishti03.github.io/ajax-json/main.json');
ourRequest.onload = function (... |
Ruby | UTF-8 | 820 | 2.640625 | 3 | [] | no_license |
require 'error_manager'
class Remote
attr_accessor :remote, :branch
def initialize remote, branch
@remote = remote
@branch = branch
end
end
class GitManager
def initialize repo, location = nil
@repo = repo
@location = @repo.location unless @repo == nil
@location = location if @repo ==... |
JavaScript | UTF-8 | 6,742 | 2.875 | 3 | [] | no_license | $(document).ready(function () {
console.log("ready!");
var characterAttack;
var characterHealth;
var defenderAttack;
var defenderHealth;
$("#luke").data({
"health": 100,
"attack": 6,
})
$("#obi-wan").data({
"health": 120,
"attack": 10,
})
$("#da... |
C | UTF-8 | 514 | 3.65625 | 4 | [] | no_license | /* Illustrates declaring external variables. */
#include <stdio.h>
static int x = 200; /* Variable declearation and defination */
static void print_value( void );
/* 'static' global variables & functions are visible only within their
own source code file */
int main( void )
{
print_value();
extern int x; /... |
TypeScript | UTF-8 | 518 | 2.890625 | 3 | [] | no_license | import { isOdd, isEven, isNumeric } from '../../src/util/number';
describe('util / number', () => {
it('should know an odd number', () => {
expect(isOdd(3)).toBe(true);
expect(isOdd(4)).toBe(false);
});
it('should know an even number', () => {
expect(isEven(4)).toBe(true);
expect(isEven(3)).toBe... |
Python | UTF-8 | 918 | 3.109375 | 3 | [] | no_license | # lnkswbs.py
# Autograder: Following Links with BeautifulSoup on https://www.py4e.com/lessons/network
from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
import time
url = input('Enter URL: ')
# if len(url) < 1: url = 'http://py4e-data.dr-chuck.net/known_by_Fikret.html'
if len(url) < 1: url = ... |
JavaScript | UTF-8 | 1,550 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | /**
* Created by jakub.niezgoda on 09/08/2018.
*/
export default class ResourceStatus extends React.Component {
static unknown = 0;
static noActionRequired = 1;
static actionRequired = 2;
static errorOccurred = 3;
shouldComponentUpdate(nextProps) {
const { status, text } = this.props;... |
Java | UTF-8 | 1,039 | 3.875 | 4 | [] | no_license | package ru.job4j.design.game;
import java.util.Random;
/**
* An instance of this class stands for a playing square with 50 steps in total.
*/
public class Square50 implements Square {
private final int[] magicSquares;
private final int length = 50;
public Square50() {
Random random = new Rando... |
Markdown | UTF-8 | 2,139 | 3.53125 | 4 | [
"MIT"
] | permissive | 
### What are the 6 Phases of Web Design?:
1. Information Gathering
2. Planning
3. Design
4. Development
5. Testing and Delivery
6. Maintenance
### What is your site's primary goal or purpose? What kind of content will your site feature?:
The purpose of my site is to provide info... |
PHP | UTF-8 | 1,532 | 2.875 | 3 | [] | no_license | <?php
namespace Fitness\Model\Entity;
class Sucursal
{
private $id;
private $tipoCta;
private $moneda;
private $banco;
private $estado;
// public function __construct($datos=array())
// {
// $this->id = $datos['id'];
// $this->display = $datos['display'];
// $this->ubicacion= $datos['ubic... |
JavaScript | UTF-8 | 3,169 | 2.640625 | 3 | [] | no_license | import React from 'react';
import { Button, ErrorButton } from '../../../style/buttons';
import { Row, Column } from '../../../style/table';
import {
Text,
Calories,
Weight,
Fat,
Carbohydrate,
Protein,
Ethanol,
} from '../../../style/inputs';
export default class IngredientAdder extends React.Component {... |
Shell | UTF-8 | 394 | 3.546875 | 4 | [] | no_license | #!/bin/bash
#check for root
UID=$(id -u)
if [ x$UID != x0 ]
then
#Beware of how you compose the command
printf -v cmd_str '%q ' "$0" "$@"
exec sudo su -c "$cmd_str"
fi
cd /home/root/
wget -O AppsOne_5.0.5.tar.gz [URL]
for f in *.tar.gz
do
tar zxvf "$f"
done
ssh-keygen -t rsa -N "" -f my.key
for ip ... |
TypeScript | UTF-8 | 1,566 | 2.6875 | 3 | [
"MIT"
] | permissive | import * as media from '../media'
import { State as StateObject } from '../../'
const STATE1 = {
media: {
players: [
{
playing: false,
loop: false,
atBeginning: false,
clipFrame: 0
},
{
playing: true,
loop: false,
atBeginning: false,
clipFrame: 0
}
]
}
}
// const STATE... |
Java | UTF-8 | 5,383 | 3.921875 | 4 | [] | no_license | import java.util.Arrays;
import java.util.List;
class ArraysClass_1_ClassArrays
{
public static void main(String args[])
{
int arr1[] = {42, 11, 77, 16, 19, 1, -4, 87};
int arr2[] = {42, 11, 77, 16, 19, 1, -4, 87};
int arr3[] = {42, 11, 77, 16, 19, 1, -4, 87};
/*
* The string representation consists of ... |
Python | UTF-8 | 267 | 2.828125 | 3 | [] | no_license |
class ItemBase:
"""物品基类"""
def __init__(self):
NONE_TYPE = -1
STAFF_TYPE = 2
def loadFromDict(self, dictDatas):
"""
virtual method.
从字典中创建这个对象
"""
self._id = dictDatas.get('id', 0)
def getID(self):
return self._id
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.