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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 3,681 | 2.828125 | 3 | [] | no_license | ---
title: ci 自动部署
date: 2017-10-31T07:44:00.000Z
tags:
- ci
- docker
- deploy
lastmod: 2017-10-31T07:44:00.000Z
categories:
- deploy
slug: ci-auto-deploy
draft: false
---
## 前言
很久没写博文了,最近正好公司内部需要进行 ci 自动部署,就写一篇 ci 自动部署。其中分为两种,公开项目,私有项目
<!--more-->
## 一、自动部署原理
现在的 git 自动部署都是通过推送钩子,触发第三方 ci 执行脚本,然后在脚本中进行部署。... |
Java | UTF-8 | 3,151 | 3.0625 | 3 | [] | no_license | import java.awt.Color;
import java.util.*;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.XYPlot;
import org.jfree.data.xy.... |
JavaScript | UTF-8 | 1,275 | 2.8125 | 3 | [] | no_license | var assert = require("assert");
var ReviewProcess = require("../processes/review");
var MembershipApplication = require("../membership_application");
var moment = require("moment"); //MomentJS module
describe("The review process test", function(){
describe("Receiving a valid application", function(){
//A... |
Java | UTF-8 | 479 | 2.546875 | 3 | [] | no_license | package jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class _ConnectToDatabase {
public static void main(String[] args) {
try {
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/databank", "root", "root");
try {
... |
C# | UTF-8 | 943 | 3.015625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace Planzy.Models.Util
{
class MyConverter : IValueConverter
{
public const string RED_COLOR = "#FFE05050";
public co... |
Go | UTF-8 | 610 | 3.109375 | 3 | [] | no_license | package main
func numIslands(grid [][]byte) int {
num := 0
for rowIndex, row := range grid {
for colIndex := range row {
if grid[rowIndex][colIndex] == '1' {
num++
dfs(rowIndex, colIndex, grid)
}
}
}
return num
}
func dfs(rowIndex, colIndex int, grid [][]byte) {
if rowIndex < 0 || colIndex < 0 ... |
Python | UTF-8 | 440 | 2.78125 | 3 | [] | no_license | import sys
sys.path.append('../')
import map_object
class Tower(map_object.Map_Object):
def _init_(self):
self.damage = 0
self.range = 0
self.position = [0,0]
#GET AND SET METHODS
def setDamage(self, nDamage):
self.damage = nDamage
def getDamage(self):
return sel... |
Python | UTF-8 | 814 | 3.65625 | 4 | [] | no_license | class student:
'''documentation'''
totalStd = 0 # class attribute
#constructor
def __init__(self,name,marks=0):
self.name = name #object attributes
self.__marks = marks #private object attribute
student.totalStd += 1
#class methods
def calculateGrade(self):
... |
C++ | UTF-8 | 3,489 | 2.9375 | 3 | [] | no_license | // (c) Michael Schoeffler 2018, http://www.mschoeffler.de
#include <SoftwareSerial.h>
const int BUFFER_SIZE = 14; // RFID DATA FRAME FORMAT: 1byte head (value: 2), 10byte data (2byte version + 8byte tag), 2byte checksum, 1byte tail (value: 3)
const int DATA_SIZE = 10; // 10byte data (2byte version + 8byte tag)
const in... |
Markdown | UTF-8 | 4,932 | 3.0625 | 3 | [] | no_license | ---
title: "Re-streaming video to a multicast address with VLC"
excerpt: "How to stream just about anything to a multicast address using VLC"
---
[VLC](https://www.videolan.org) is such a powerful tool. Excuse my ignorance but I have always seen it as just a media player that can play anything I throw at it. But it is... |
Python | UTF-8 | 1,358 | 2.8125 | 3 | [] | no_license | #read the data into dict from one source
#read the other source while comparing similarity
#1- check if we have the same
#if yes do nothing, join the records
#if no:
#check the similarity (word by word similarity should be good)
#if high -> match and join
... |
JavaScript | UTF-8 | 369 | 2.734375 | 3 | [] | no_license | /**
* created by wangyingchang 2019/11/10
* @param {*} date
*/
function date2String(date) {
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hour = date.getHours();
const seconds = date.getSeconds();
return year + '-' + month + '-' + day + ' ' + hou... |
Java | UHC | 4,188 | 3.796875 | 4 | [] | no_license | package hamilton;
//2015112232
public class hamilton {
public static void combination(int[][] matrix, int row, String[] array) {
// ϱ
int count = 1; // return
String s = array[row];// ó ڸ
for (int i = 0; i < matrix.length; i++) {
if (matrix[row][i] != 0) { // Ǵ ڸ
subcombination(matrix, i, array, s... |
Go | UTF-8 | 1,091 | 3.359375 | 3 | [] | no_license | package models
import (
"sort"
"strings"
"github.com/taciomcosta/cookify/pkg/recipepuppy"
)
// Recipe represts a recipe in the domain model.
type Recipe struct {
Title string `json:"title"`
Ingredients Ingredients `json:"ingredients"`
Link string `json:"link"`
Gif string `j... |
Java | UTF-8 | 281 | 1.9375 | 2 | [] | no_license | package com.kuki.common.eventbus;
/**
* author :yeton
* date : 2021/8/20 17:51
* package:com.kuki.common.eventbus
* description :
*/
public class LoginEvent {
public String userName;
public LoginEvent(String userName) {
this.userName = userName;
}
}
|
Java | UTF-8 | 4,980 | 2.078125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Project Scelight
*
* Copyright (c) 2013 Andras Belicza <iczaaa@gmail.com>
*
* This software is the property of Andras Belicza.
* Copying, modifying, distributing, refactoring without the author's permission
* is prohibited and protected by Law.
*/
package hu.sllauncher.service.registration;
i... |
C | UTF-8 | 752 | 2.5625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain"
] | permissive | #include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include "t_hashtable.h"
#include "t_assert.h"
#include "../str.h"
#include "../hashtable.h"
#include "../error.h"
#include "../bin.h"
#include "../alloc.h"
static unsigned long num_allocs = 0;
static void *count_malloc(unsigned long n)
{
++num_allocs;
re... |
Java | UTF-8 | 715 | 2.203125 | 2 | [] | no_license | package com.yaochen.tester.cases;
//public class RecaseV4 {
// @Test(dataProvider = "datas")
// public void test1(String search,String condition) {
// String url = "http://132.232.44.158:8080/morning/searchGoods";
// Map<String, String> data = new HashMap<String, String>();
// data.put("sear... |
JavaScript | UTF-8 | 351 | 3.671875 | 4 | [] | no_license | // JavaScript Document
// James McGorty
var strFirstName = "James";
var strLastName = "McGorty"
var strMiddle = "Britten";
// var strFullName = "James Britten McGorty";
var strFullName = strFirstName + " " + strMiddle + " " + strLastName;
var input = parseInt(prompt("Value", 3));
// parseFloat()
var iNum = 1 + 2 + ... |
Java | UTF-8 | 2,657 | 2.515625 | 3 | [] | no_license | package com.fh.plugin.websocketVideo;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import org.java_websocket.WebSocket;
import org.java_websocket.WebSocketImpl;
import org.java_websocket.framing.Framedata;
import org.java_websocket.handshake.ClientHands... |
Markdown | UTF-8 | 1,747 | 3.53125 | 4 | [] | no_license | # Byte Pair Encoding
## Introduction
Byte-pair encoding (BPE) is currently a popular technique to deal with this issue. The idea is to encode text using a set of automatically constructed types, instead of conventional word types. A type can be a character or a subword unit; and the types are built through a iterativ... |
Python | UTF-8 | 4,694 | 2.515625 | 3 | [] | no_license | #import math as M
import multiprocessing as mp
import threading
import time
import math
'''
Primes=[2,3,5,7,11,13]
EndPoint=Primes[-1]
iMainPrime=len(Primes)-2
NextMPrimeSqrd=Primes[iMainPrime+1]**2
print('1.5')
while True:
for dummy in range(700):
StartPoint=EndPoint+2
EndPoint+=Primes[iMainPrim... |
TypeScript | UTF-8 | 786 | 2.796875 | 3 | [
"MIT"
] | permissive | import isString from '@/isString'
import camelize from '@/camelize'
export const getCSS: {
/**
* 读取所有的css属性
* @param elt 元素
* @param pseudoElt 伪元素 'before' | 'after'
*/
(elt: HTMLElement, pseudoElt?: 'before' | 'after' | null): CSSStyleDeclaration
/**
* 读取css属性
* @param elt 元素
* @param prop ... |
C++ | UTF-8 | 33,462 | 2.625 | 3 | [] | no_license | #ifndef _SPITER_HPP
#define _SPITER_HPP
//============================================================================
// File: spiter.h
//
// Author: Bob Steagall
//
// History: Version 0.98
//
// Notes:
//
// Copyright (c) 1998 R.C. Elston
// All Rights Reserved
//===========================... |
C# | UTF-8 | 559 | 2.59375 | 3 | [] | no_license | using System;
using System.Runtime.InteropServices;
namespace Maze_Algorithm
{
class Util
{
[DllImport("kernel32.dll", ExactSpelling = true)]
private static extern IntPtr GetConsoleWindow();
private static IntPtr ThisConsole = GetConsoleWindow();
[DllImport("user32.dll", Char... |
Java | UTF-8 | 614 | 3.875 | 4 | [] | no_license | import java.util.Arrays;
public class ArraySort {
public static void main(String[] args) {
Integer[] integers = {4, 3, 6, 2, 5, 1};
Double[] doubles = {4.0, 3.0, 2.0, 5.0, 1.0};
sortArray(integers);
sortArray(doubles);
}
public static <T extends Number> void sortArray(T[] list) {
Arrays.sort... |
Java | UTF-8 | 3,384 | 2.46875 | 2 | [] | no_license | package Collectors;
import GlobalConstants.Enums;
import Interfaces.ICollectorIssuesContainer;
import Utils.GeneralFunctions;
import Utils.Logit;
import lycus.Host;
import GlobalConstants.Constants;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.util.HashMap;
import java.util.HashSet;... |
Python | UTF-8 | 200 | 2.9375 | 3 | [] | no_license | fp=open("unique_names.csv",'r')
fp1=open("sur.csv",'w')
while True:
line=fp.readline()
if not line:
break
k=line.split()
fp1.write(str(k[len(k)-1])+"\n")
fp.close()
fp1.close() |
Python | UTF-8 | 222 | 3.078125 | 3 | [
"Unlicense"
] | permissive | from sys import stdin
from collections import Counter
c = Counter()
for line in stdin:
words = line.split()
cand, votes = words[0], int(words[1])
c[cand] += votes
for key, val in c.items():
print(key, val)
|
Python | UTF-8 | 371 | 3.3125 | 3 | [] | no_license | from double_link_list import DoubleLinkList
class Stack():
def __init__(self):
self.__list = DoubleLinkList()
def push_item(self, value):
return self.__list.add(value)
def pop_item(self):
return self.__list.r
def __str__(self):
return self.__list.__str__()
obj = Stack(... |
JavaScript | UTF-8 | 1,602 | 3.46875 | 3 | [] | no_license | describe('Spaceship', function(){
describe('A space ship is created', function() {
it('ship should exist', function () {
var shipDiv = document.getElementById('ship');
expect(shipDiv.constructor.name).to.be('HTMLImageElement', 'You should be using an image tag for this exericse.');
});
it('should be an im... |
PHP | UTF-8 | 422 | 3 | 3 | [] | no_license | <?php
namespace JK\Console;
use JK\Console\IO\InputInterface;
use JK\Console\IO\OutputInterface;
/**
* Class Console [Excecute command]
*
* @package JK\Console\ConsoleInterface
*/
interface ConsoleInterface
{
/**
* Run and execute commands
*
* @param InputInterface $input
* @param OutputInterface $out... |
Rust | UTF-8 | 3,053 | 3.421875 | 3 | [] | no_license | use std::net::UdpSocket;
use std::io;
mod text;
pub struct Flaschen {
socket: UdpSocket,
host: String,
width: usize,
height: usize,
}
#[derive(Debug, Copy, Clone)]
pub struct Pixel {
pub r: u8,
pub g: u8,
pub b: u8,
}
impl Flaschen{
pub fn new(hostname: String, width: usize, height: ... |
Java | UTF-8 | 2,432 | 2.125 | 2 | [] | no_license | package com.example.pikot.sugophapp.Both;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.example.pikot.sugophapp.R;
import com.e... |
Shell | UTF-8 | 336 | 3.328125 | 3 | [] | no_license | #!/bin/bash
if [ -z "$1" ] ; then
echo "usage : $0 : <hosts files>"
exit 1
fi
files="$*"
remote_dir="hadoop-dns"
for host in $(cat $* | grep -v '#')
do
echo
echo "==== $host ==== "
rsync -avz --delete -e ssh a.jar run.sh $files "${host}:${remote_dir}"
ssh $host "cd ${remote_dir} ; sh run.... |
Markdown | UTF-8 | 881 | 2.671875 | 3 | [] | no_license | # Glozzom_bootstrap_website
To see live this wesite here is the link -- https://sazidhabib.github.io/Glozzom_bootstrap_website/
This Bootstrap website design look like this images and it is completely Responsive website for every device.
It have five page. Which is HOME, ABOUT US, SERVICES, BLOG, CONTACT. All are in ... |
JavaScript | UTF-8 | 2,642 | 2.53125 | 3 | [] | no_license | 'use strict';
const AWS = require('aws-sdk')
const db = new AWS.DynamoDB.DocumentClient({ apiVersion: '2012-08-10'})
const uuid = require('uuid').v4
const userTable = process.env.USER_TABLE
function response(statusCode, message) {
return {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Contr... |
Go | UTF-8 | 3,795 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | package values
import (
"reflect"
"testing"
"github.com/cortezaproject/corteza-server/compose/types"
)
func Test_sanitizer_Run(t *testing.T) {
tests := []struct {
name string
kind string
options map[string]interface{}
input string
output string
outref uint64
}{
{
name: "numbers shou... |
C# | UTF-8 | 2,045 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace Tsumugi.Localize
{
public class LocalizationTexts
{
public static readonly string CannotFindJumpTarget = "Cannot find label {0} to jump to.";
public static readonly string NotDefined = "{0} is not defined.";
p... |
PHP | UTF-8 | 7,642 | 2.515625 | 3 | [] | no_license | <?php
function PermissionPage()
{
require 'config.php';
mysql_connect($host, $name, $password);
mysql_select_db($db);
// Usage Permissions
echo '<table width="70%" class="tborder">';
echo '<thead><tr><td class="thead"><strong>Usage Permissions:</strong></td></tr></thead>';
echo '<tbody><tr>... |
Markdown | UTF-8 | 1,632 | 3.28125 | 3 | [] | no_license | [frontMatter]
title = "Simple Problem Redux"
tags = ["reduce"]
created = "2019-02-20 19:49:10"
description = ""
published = true
[meta]
swift_version = "5.0"
---
We can now go back to our initial count & average problem and try to
solve it with `reduce`.
# InfoFromState, take two
``` Swift
func infoFromState(sta... |
Java | UTF-8 | 3,153 | 2.3125 | 2 | [] | no_license | package generalutils;
import java.util.HashMap;
import java.util.List;
//import com.jayway.restassured.*;
//import com.jayway.restassured.response.Response;
import io.restassured.RestAssured;
import io.restassured.response.Response;
public class DataReset {
public static boolean call(String apiKey, Lis... |
PHP | UTF-8 | 376 | 2.546875 | 3 | [] | no_license | <?php
/**
* @author OnTheGo Systems
*/
/**
* @author OnTheGo Systems
*/
interface OTGS_Log {
/**
* @param string $entry
* @param int $level
* @param array $extra_data
*
* @return
*/
public function add( $entry, $level, array $extra_data = array() );
/**
* Get all entries
*
* @throws \OTGS... |
Markdown | UTF-8 | 735 | 2.609375 | 3 | [
"MIT"
] | permissive | I have a work project which, for a variety of reasons, has a custom nginx build. We were already using the nginx compile-time option `--with-openssl-opt=enabled-weak-ciphers` (because currently, we need to support `3DES`) but we also wanted to enable TLS1.3 so we needed to add another compile-time option `--with-openss... |
Markdown | UTF-8 | 3,027 | 2.84375 | 3 | [] | no_license | ---
tags: Bible, JST, NT, New_Translation, Old_Testament
---
[[nt/Ezekiel/Ezekiel 3|<< Ezekiel 3]] | [[nt/Ezekiel|Ezekiel]] | [[nt/Ezekiel/Ezekiel 5|Ezekiel 5 >>]]
### Ezekiel 4
1 Thou also, son of man, take thee a tile, and lay it before thee, and portray upon it the city, even Jerusalem; ^1
2 And lay siege again... |
Ruby | UTF-8 | 1,120 | 2.640625 | 3 | [] | no_license | class Adult < ActiveRecord::Base
belongs_to :family_group, :dependent => :destroy
belongs_to :editor, :class_name => "User", :foreign_key => "updated_by"
before_validation :set_income, :format_rut
after_validation :titleize_name
validates_presence_of :fathers_name, :mothers_name, :names, :sex
validates... |
PHP | UTF-8 | 6,620 | 3.09375 | 3 | [] | no_license | <?php
class User {
public $Username;
public $Password;
public $Fname;
public $Lname;
public $Library_Card;
public $Phone;
public $Email;
public $is_Admin;
public function __construct(String $Username, STring $Password, String $Fname, String $Lname,
String $Library_Card, String $Phone, String $Email, int $i... |
Python | UTF-8 | 4,131 | 2.71875 | 3 | [] | no_license | """
verinfo = グラフ表示
ver1.1 2018.11.18 check for ITC27
ver1.0 2018.11.** Developing codes
by H.Tsuchiya (NIFS)
"""
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D
#公開する関数を指定する
__all__ = ['SAVE_FIGURE_1',\
'SAVE_FIGURE_2',\
'SAVE_F... |
Java | UTF-8 | 632 | 3.65625 | 4 | [] | no_license | package lesson2;
public class LambdaMain {
public static void main(String[] args) {
int a = 5;
int b = 10;
MyFunction f = new MyFunctionImpl();
MyFunction f2 = new MyFunction() {
@Override
public int apply(int a, int b) {
return a + b;
... |
Java | UTF-8 | 269 | 2.6875 | 3 | [] | no_license | package com.zjn.designpattern.creative.factorymethod;
/**
* ProductB 借用简单工厂包中Product
*
* @author zjn
* @date 2019/8/28
**/
public class ProductB implements Product {
public ProductB(){
System.out.println("生产产品B");
}
}
|
Markdown | UTF-8 | 4,841 | 2.859375 | 3 | [] | no_license | ```
业精于勤而荒于戏,行成于思而毁于随。
```
#### TOF(Time of Flight)基本原理
ToF是Time of Flight的缩写,直译为飞行时间,通过给目标发送光,然后用传感器**接收从物体返回的光**,通过探测这些发射和接收光脉冲的**飞行(往返)时间**来得到**目标物距离**。
#### TOF相机的一般组成
ToF相机与普通相机成像过程类似,主要由**光源、感光芯片、镜头、传感器、驱动控制电路以及处理电路**等几部分关键单元组成。
ToF相机包括两部分核心模块,`发射照明模块`和`感光接收模块`,根据这两大核心模块之间的相互关联来生成深度信息。ToF相机的感光芯片根据像素单元的数量也分... |
Markdown | UTF-8 | 6,017 | 3.125 | 3 | [] | no_license | +++
date = "2015-08-29T18:15:08-05:00"
title = "Grails Example Project"
categories = ["techtalk","code","grails"]
tags = ["josdem","techtalks","programming","technology","grails"]
description = "Simple project in Grails"
+++
Simple project in Grails
## Project user story
As application owner I want to deliver my appl... |
Markdown | UTF-8 | 6,454 | 3.15625 | 3 | [] | no_license | # cdeps
Clojure + deps.edn, a basic guide.
After a rather long break from programming and Clojure I decided give them another go. When it comes to managing Clojure
projects, [Leiningen](https://leiningen.org/) is de-facto standard tool. Recently,
[Clojure CLI tools](https://clojure.org/guides/deps_and_cli) are becomin... |
C++ | UTF-8 | 806 | 3.109375 | 3 | [] | no_license | class Solution {
public:
vector<string> ans;
void dfs(vector<vector<char>>& space, int depth, string& s) {
if (depth == space.size()) {
ans.push_back(s);
return;
}
for (auto j : space[depth]) {
s.push_back(j);
dfs(space, depth + 1, s);
... |
Markdown | UTF-8 | 1,690 | 2.828125 | 3 | [] | no_license | # OAuth_Assignment_SSD
This repository created for SSD Assignment 2. This assignment mainly tested the knowledge of the OAuth 2.0. Authorization is a security way to access the levels or user privileges related to the system resources such as services, programs, data information and files.
OAuth 2.0 is the authorizati... |
Ruby | UTF-8 | 1,404 | 2.609375 | 3 | [] | no_license | class Rental < ApplicationRecord
belongs_to :customer
belongs_to :movie
validates :customer_id,
presence:
{ message: "Customer ID is required." },
numericality:
{only_integer: true, message: "Customer ID must be an integer."}
validates :movie_id,
presence:
{ message: "Movie ID is ... |
PHP | UTF-8 | 1,568 | 3 | 3 | [] | no_license | <?php
namespace Application\Form;
use Application\Form\Base\FormAdapter;
use Application\OCISchema\Util\Cipher;
use Application\Util\Validator;
/**
* Description of LogIn
*
* @author Roman
*/
class LogIn extends FormAdapter {
//Properties of LogIn
public $userId;
public $password;
... |
Java | UTF-8 | 157 | 1.945313 | 2 | [] | no_license | package com.lavamancer.car.util;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public interface Drawable {
void draw(SpriteBatch spriteBatch);
}
|
C# | UTF-8 | 2,767 | 2.515625 | 3 | [
"MIT"
] | permissive | using System;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using PixiEditor.Exceptions;
using PixiEditor.Models.IO;
using Xunit;
namespace PixiEditorTests.ModelsTests.IO
{
public class ImporterTests
{
private readonly string testImagePath;
private readonly string testCorrupt... |
Java | UTF-8 | 944 | 3.671875 | 4 | [] | no_license | package com.srm.lab02.java;
import java.util.Scanner;
public class ConvertUpToLow {
public static void main(String[] args) {
System.out.println("CONVERTING UPPERCASE TO LOWER WITHOUT BUILT-IN METHOD.");
System.out.println("------------------------------------------------------");
Scanner sc=new Scanner(S... |
Python | UTF-8 | 234 | 2.546875 | 3 | [] | no_license | readline = open(0).readline
N, M = map(int, readline().split())
A = [list(map(int, readline().split())) for i in range(N)]
B = [int(readline()) for i in range(M)]
print(*map((lambda Ai: sum(a*b for a, b in zip(Ai, B))), A), sep='\n')
|
C++ | UTF-8 | 847 | 3 | 3 | [] | no_license | /*
* Beispiel für ein Lauflicht
*
* TODO: Mache doch mal die Wartezeit kürzer und schaue was passiert.
*/
#define WAITTIME 100
//Die LED Pin in von Oben nach Unten
const uint8_t LEDPins[] = {5, 6, 7, 8, 9, 10, 11, 12, 13, A5, A4, A3, A2, A1, A0, 4 };
// setup: Wird aufgerufen, wenn das Programm startet (nach ... |
Markdown | UTF-8 | 3,048 | 3.359375 | 3 | [] | no_license | # Exercices types and boolean
Ces exercices devront tous être pushés sur un repository accessible depuis github.
Ce repository devra se nommer `exo-numbers-strings`
Vous devrez fournir ce lien dans le formulaire de rendus d'exercices suivant: https://docs.google.com/forms/d/e/1FAIpQLSc6C1su3FLwG1ESO4PfhWLjnOUe8dngO7... |
Java | UTF-8 | 2,184 | 2.125 | 2 | [] | no_license | package pe.edu.upc.dew.veterinaria.controller;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResp... |
Markdown | UTF-8 | 4,652 | 2.78125 | 3 | [
"CC-BY-4.0",
"OFL-1.1",
"MIT"
] | permissive | _model: page
---
_template: page-with-toc.html
---
title: Pull Request Guidelines
---
description: We ask that contributors to CC projects submit a pull request with your changes. If you're not familiar with pull requests, please read [this GitHub documentation](https://help.github.com/en/articles/about-pull-requests).... |
PHP | UTF-8 | 1,138 | 2.921875 | 3 | [] | no_license | <?php
require_once 'Product.php';
require_once 'Category.php';
require_once 'CategoryModel.php';
class ProductModel
{
private $pdo;
public function __construct()
{
try
{
$this->pdo = new PDO('mysql:host=localhost;dbname=wowfood', 'samdeb', 'admin');
$this->pdo->set... |
Java | UTF-8 | 2,236 | 2.46875 | 2 | [] | no_license | /*
* Copyright (c) 2006-2013 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... |
Markdown | UTF-8 | 16,830 | 3.875 | 4 | [] | no_license | ---
title: javascript菜鸟教程复习(二)
date: 2017-06-23 08:40:40
categories: 前端
tags: [javascript]
---
<Excerpt in index | 首页摘要>
<!-- more -->
<The rest of contents | 余下全文>
-----
网址:http://www.runoob.com/js/js-tutorial.html
#### 1.typeof
```html
typeof "John" // 返回 string
typeof 3.14 // 返回... |
JavaScript | UTF-8 | 472 | 2.5625 | 3 | [] | no_license |
// EXPORTANDO OS ARQUIVOS..
const moduloA = require('./aula2_sistemaDeModulos')
const moduloB = require('./aula2b_exportacao')
console.log(moduloA,moduloB)
console.log(moduloA.ola)
console.log(moduloB.boaNoite())
// Organização no Back end.
// Por PADRÃO tudo fica dentro do modulo e quando vc exporta aquilo fica d... |
Python | UTF-8 | 2,242 | 3.65625 | 4 | [] | no_license | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
"""
Runtime: 92 ms, faster than 27.57% of Python3 online submissions for Add Two Numbers.
Memory Usage: 13.4 MB, less than 12.52% of Python3 online submissions for ... |
Java | UTF-8 | 1,105 | 2.1875 | 2 | [] | no_license | package lk.autostreet.services.core;
import lk.autostreet.services.core.exception.UserNotCreatedException;
import lk.autostreet.services.core.model.User;
import lk.autostreet.services.core.model.UserType;
import lk.autostreet.services.core.service.UserService;
import org.springframework.beans.factory.annotation.Autowi... |
C++ | UTF-8 | 5,181 | 3.890625 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
/*
*冒泡排序
*时间复杂度 平均O(n^2) 最坏O(n^2) 最好O(n)
*比如12345,优化过的冒泡排序第一趟就发现,没有任何交换,则全部有序,相当于遍历一次
* 稳定
*/
void BubbleSort(vector<int> &v) {
int n = v.size();
bool isExchange = true;
for (int i = 0; i < n-1 && isExchange; i++) {
isExchange = fal... |
C | UTF-8 | 1,625 | 3.140625 | 3 | [] | no_license | // C Primier Plus Exercise8.11 Q5
#include<stdio.h>
int main(void)
{
int guest=50;
char user,tips;
char clear;
const int MAX=100;
const int MIN=0;
int max=MAX,min=MIN;
printf("I guess the magic number is %d,is it?\n",guest);
printf("If I correct then you key in y,otherwise you key in n\n"... |
Python | UTF-8 | 1,343 | 2.5625 | 3 | [] | no_license | from typing import Optional
# 選択肢とアイテムの種類は別な気がするが、二重に定義するのもなあ
# 選択肢がEnumじゃなくて、特定のリストを返すProtocolなら良いのかな・・・
# 選択肢の結果ともとれるか?うーん
from ..response.choices import AddContainerTypeChoice, AddItemTypeChoice
class Item:
item_type: AddItemTypeChoice
item_count: int
zone_number: Optional[int] = None
container_ty... |
PHP | UTF-8 | 1,800 | 2.71875 | 3 | [] | no_license | <?php
// this method call should be placed at the start (top) of every php file that uses session variables
session_start();
require_once ("../siteCommon2Pro.php");
// call the displayPageHeader method in siteCommon2.php
displayPageHeader("Home Page");
// the session array element "userInfo" will be set (see d10... |
Python | UTF-8 | 161 | 3.609375 | 4 | [] | no_license | if name == 'Alice':
print('Hi, Alice.')
elif age < 12:
print('You arenot Alice, kiddo.')
else:
print('You are neither Alice nor a lottle kid')
|
Swift | UTF-8 | 870 | 3.046875 | 3 | [] | no_license | //
// AuthUser.swift
// On The Map
//
// Created by Justin Kumpe on 7/19/20.
// Copyright © 2020 Justin Kumpe. All rights reserved.
//
import Foundation
//Struct holds Authenticated User's Info
struct AuthUser {
static var sessionId = ""
static var userId = ""
static var userFirstName = ""
static ... |
C++ | UTF-8 | 4,499 | 2.78125 | 3 | [] | no_license | #include "catch.hpp"
#include "server_lib.hpp"
#include "client_lib.hpp"
#include <nlohmann/json.hpp>
#include <boost/asio.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/asio/io_context.hpp>
#include <sstream>... |
C++ | UTF-8 | 2,009 | 2.609375 | 3 | [] | no_license | #ifndef TC_NETWORK_READER_H
#define TC_NETWORK_READER_H
#include "alias.h"
#include "../general/timer.hpp"
namespace tobilib{
namespace network{
struct ReaderOptions
{
double read_timeout = 0;
double inactive_warning = 0;
};
namespace detail{
// SocketType:
// boost::asio::i... |
JavaScript | UTF-8 | 480 | 3.1875 | 3 | [] | no_license | function isVisible(element){
if (element.offsetWidth > 0 && element.offsetHeight > 0)
return true;
}
var show = function(link, block, textShow, textHide){
var infoblock = document.querySelectorAll(block);
for (var j = 0; j < infoblock.length; j++) {
if (isVisible(infoblock[j])){
infoblock[j].style.display... |
Java | UTF-8 | 1,511 | 2.09375 | 2 | [] | no_license | package com.btw.helpservice;
import com.btw.helpservice.utils.ResultJsonUtil;
import com.btw.helpservice.utils.TokenVerifier;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.anno... |
JavaScript | UTF-8 | 3,284 | 3.015625 | 3 | [] | no_license | let employeesModel = [];
//Function: initializeEmployeesModel()
function initializeEmployeesModel() {
$.get("https://stormy-cliffs-97970.herokuapp.com/employees")
.done(function (data) {
employeesModel = data;
refreshEmployeeRows(employeesModel);
})
.fail(function ... |
Java | UTF-8 | 508 | 2.828125 | 3 | [] | no_license | package JUnitTest;
import model.Task;
import org.junit.jupiter.api.Test;
import java.time.LocalDate;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Unit test for Task class
*/
class TaskTest {
String content = "testString";
LocalDate date = LocalDate.now();
Task task = new Task(con... |
Python | UTF-8 | 433 | 4.28125 | 4 | [] | no_license | """
Problem: Leia um valor de volume em metros cúbicos e apresente-o em litros
A formula de conversão é:
L = 1000 * M
Sendo L o volume em litros e M o volume em metros cúbicos
Author: João Lucas
Pycamp
"""
print('======= Metros cúbicos em Litros =======')
m = float(input('Valor do metro ... |
Markdown | UTF-8 | 5,943 | 2.53125 | 3 | [] | no_license | # Algorithm-Design
Laboratory solutions for the Algorithm Design course @ Faculty of Automatic Control and Computer Science, Politehnica University of Bucharest.
* **Lab 1**:
* Divide et Impera [source](https://github.com/danserboi/Algorithm-Design/tree/master/laborator1)
* Count Occurrences [source](https://git... |
Java | UTF-8 | 1,982 | 2.140625 | 2 | [] | no_license | package tn.esprit.spring.control;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.sprin... |
Go | UTF-8 | 2,223 | 2.765625 | 3 | [] | no_license | package service
import (
"fmt"
"github.com/myrachanto/power/httperors"
"github.com/myrachanto/power/model"
r "github.com/myrachanto/power/repository"
"github.com/myrachanto/power/support"
)
var (
UserService userService = userService{}
)
type redirectUser interface{
Create(customer *model.User) (*model.User,... |
JavaScript | UTF-8 | 5,833 | 2.828125 | 3 | [] | no_license | var express = require('express');
var bodyParser = require('body-parser');
// Instanciamos a Express y definimos el puerto con el que trabajaremos.
var app = express();
var port = process.env.PORT || 3525;
// Convierte una petición recibida (POST-GET...) a objeto JSON.
app.use(bodyParser.urlencoded({extended:false}))... |
Java | UTF-8 | 368 | 2.359375 | 2 | [] | no_license | package com.cucci.service;
import com.cucci.annations.AutoWired;
import com.cucci.annations.Bean;
/**
* C服务
*
* @author shenyunwen
**/
@Bean
public class ServiceC {
@AutoWired
private ServiceA serviceA;
public void say() {
serviceA.say();
System.out.println("3333333333");
Sys... |
PHP | UTF-8 | 484 | 2.734375 | 3 | [
"BSD-4-Clause-UC",
"BSD-3-Clause",
"LicenseRef-scancode-other-permissive",
"TCL",
"ISC",
"Zlib",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"blessing",
"MIT"
] | permissive | --TEST--
Bug #72957: Null coalescing operator doesn't behave as expected with SimpleXMLElement
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip simplexml extension is not loaded"; ?>
--FILE--
<?php
$xml = new SimpleXMLElement('<root><elem>Text</elem></root>');
echo 'elem2 is: ' . ($xml->elem2 ?? 'back... |
Java | UTF-8 | 2,341 | 2.390625 | 2 | [] | no_license | package main.com.java.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table... |
Java | UTF-8 | 2,014 | 2.1875 | 2 | [] | no_license | package com.project.interfacebuilder.http.actions;
import java.util.Map;
import com.project.datasource.DataSource;
import com.project.inspection.FilterItem;
import com.project.interfacebuilder.Action;
import com.project.interfacebuilder.InterfaceException;
import com.project.interfacebuilder.http.HTTPControll... |
C# | UTF-8 | 943 | 3.296875 | 3 | [] | no_license | using P03._Database_Before.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace P03._Database_Before
{
class MemoryCourseData : ICourseData
{
private List<Course> courses;
public MemoryCourseData()
{
courses = new List<... |
JavaScript | UTF-8 | 1,585 | 3.96875 | 4 | [] | no_license | /* SOLUTION
Similar to findPermutation, but instead of returning true when the first match is found, continue to iterate over the entire string looking for all the matches and returning an array of the starting indices of the matches.
Time: O(n) where n is the length of the input string
Space: O(m) where m is the lengt... |
Java | UTF-8 | 1,477 | 2.125 | 2 | [] | no_license | package com.sukinsan.pixelgame.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.sukinsan.pixelgame.R;
import com.sukinsan.pixelgame.utils.SystemUtils;
public class MainActivity extends AppCompatActivity {
@Ove... |
Java | UTF-8 | 208 | 1.851563 | 2 | [] | no_license | package Lista_05_03_2018Exer2;
import java.util.List;
public class Localidade {
private String nome;
private String facilidadeDeTransporte;
private List<Localidade> localdiadeVizinhas;
} |
C++ | UTF-8 | 1,080 | 2.515625 | 3 | [] | no_license | #ifndef A_WINDOW_H
# define A_WINDOW_H
# include "IMonitorModule.hpp"
# include <ncurses.h>
# include <string>
class AWindow
{
public:
AWindow(void);
AWindow(int, int, int, int);
virtual ~AWindow(void);
AWindow(AWindow const &src);
AWindow& operator=(AWindow const &rhs);
virtual void init(void);
WINDOW ... |
Java | UTF-8 | 3,830 | 2.5 | 2 | [] | no_license | package onion.bookapp.DB.Impl;
import onion.bookapp.DB.DAO.GoodsDAO;
import onion.bookapp.mybean.data.Goods;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class GoodsDAOImpl implements GoodsDAO {
private Connection conn=null;
pr... |
C | UTF-8 | 458 | 3.59375 | 4 | [] | no_license | #include <stdio.h>
int main(void)
{
int i, n, niz[25], suma = 0; // Promenljive u vezi zadatka
printf("Unesite velicinu niza: ");
scanf("%d", &n);
for(i = 0; i < n; i++) {
printf("Unesite niz[%d] = ", i);
scanf("%d", &niz[i]);
suma = suma + niz[i]; // Racunanje sume el... |
Python | UTF-8 | 805 | 3.09375 | 3 | [] | no_license |
import numpy as np
def vipp(x, y, t, w):
"""
From original MATLAB code
See https://code.google.com/p/carspls/
#+++ vip=vipp(x,y,t,w);
#+++ t: scores, which can be obtained by pls_nipals.m
#+++ w: weight, which can be obtained by pls_nipals.m
#+++ to calculate the vip for each variable to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.