language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,362 | 2.515625 | 3 | [] | no_license | package ru.relex.restaurant.db.entity;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;
import java.util.Objects;
@Embeddable
public class DishIngredientId implements Serializable {
//default serial version id, required for serializable classes.
private static fin... |
Markdown | UTF-8 | 2,089 | 2.765625 | 3 | [] | no_license | # dataplatform--teradata
## Script teradatagit.sh
### Prérequis
Le flow Git utilisé dans le cadre de ce Repo transverse est différent de l'usage classique.
Il est donc important d'avoir pris connaissance du <a href="https://training-dot-lmfr-ddp-dcp-prd.appspot.com/codelabs/how-to-work-with-Git-on-teradata-project/"... |
Python | UTF-8 | 3,491 | 2.640625 | 3 | [] | no_license | import urllib.request
import urllib
import re
import random
#from urllib import request
#url=r"http://www.baidu.com/"
wd={"wd":"北京"}
url="http://www.baidu.com/s?" #url 编码
#构造url 编码*********
wdcode=urllib.parse.urlencode(wd)
url=url+wdcode
# print(url)
#伪装PC机QQ浏览器/Android 华为Mate 10 Pro/vivo/火狐/360进行访问 注意分行时使用\(反斜线)... |
C++ | UTF-8 | 5,785 | 3.46875 | 3 | [] | no_license | #pragma once
#include "GameManager.h"
// @param level - name ot .txt file
// @param saveFile - name of binary file
GameManager& GameManager::getInstance(const char* level, const char* saveFile)
{
static GameManager instance(level, saveFile);
return instance;
}
// @param level - name ot .txt file
// @param saveFil... |
Python | UTF-8 | 997 | 3.578125 | 4 | [] | no_license | class Node:
def __init__(self, initdata=None):
self.data = initdata
self.next = None
class Queue:
def __init__(self, node=None):
self.__front = node
self.last = node
def remove(self):
if self.__front is None:
raise IndexError('Remove from empty q... |
Java | UTF-8 | 26,762 | 1.585938 | 2 | [] | no_license | package com.hll.jxtapp;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.hl... |
Java | UTF-8 | 354 | 2.0625 | 2 | [] | no_license | package oop.inherit4;
public class Test01 {
public static void main(String[] args) {
// chrome
Chrome c = new Chrome();
c.setUrl("ㅇㅇ");
c.setVersion("ㅇㅇ");
c.move();
c.back();
c.store();
// firefox
Firefox f = new Firefox();
f.setUrl("ㅇㅇ");
f.setVersion("ㅇㅇ");
f.move();
f.back();
... |
C | UTF-8 | 1,075 | 3.421875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
int main(int argc, char const *argv[]) {
int quantidade = 0;
int vetor[20];
printf("digite 20 números\n");
for (int i = 0; i < 20; i++) {
scanf("%d", &vetor[i]);
}
int indexVerificado = 0;
int vetorNumerosVerificados[20];... |
Java | UTF-8 | 4,013 | 2.21875 | 2 | [] | no_license | /*
* CoadunationTypeManagerConsole: The type management console.
* Copyright (C) 2010 2015 Burntjam
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the L... |
Markdown | UTF-8 | 9,954 | 2.984375 | 3 | [] | no_license | ---
title: Angels
permalink: wiki/Angels/
layout: wiki
---
### Angels
Angels are a humanoid spacefaring race that’s older than most, their clear difference being their massive wings, along with their genetic propensity for unusual eye colors. They also have quite the range of height, able to grow up to seven feet tal... |
JavaScript | UTF-8 | 325 | 3.21875 | 3 | [] | no_license | /**
* @param {number[]} costs
* @param {number} coins
* @return {number}
*/
var maxIceCream = function (costs, coins) {
// 挑便宜的买,小男孩Tony从小就很会过日子
costs.sort((x, y) => x - y);
let head = 0;
while (coins >= costs[head]) {
coins -= costs[head];
head++;
}
return head;
};
|
JavaScript | UTF-8 | 853 | 4.375 | 4 | [] | no_license | function main() {
// Put your code here
console.log("Let's roll some dice, baby!")
console.log("---------------------------")
for(let i = 0; i < 10; i++){
let die1 = Roll()
let die2= Roll()
let message = `${Die(die1)} + ${Die(die2)} == ${die1 + die2}`
if (die1 === die2){
message += " DOUBLES"
}
cons... |
Java | UTF-8 | 675 | 3.71875 | 4 | [] | no_license | package complexnumberdemo;
public class ComplexNumberDemo {
public static void main(String[] args) {
ComplexNumber x = new ComplexNumber(4, 5);
ComplexNumber y = new ComplexNumber(2, 3);
System.out.printf("x = ");
x.print();
System.out.printf("y = ");
... |
Python | UTF-8 | 1,439 | 2.546875 | 3 | [] | no_license | ### Calculate nucleotide diversity from MSA of refseq(assembled) data
# require
import os, sys
from utilities3.basic import *
from utilities3.custom_classes import *
from joblib import Parallel, delayed
# start clock
start = time()
# number of threads
nt = int(sys.argv[1])
### Generate instances of class MSA ###
# ... |
JavaScript | UTF-8 | 3,043 | 2.671875 | 3 | [] | no_license | import React from 'react'
import Fade from 'grommet/components/Animate';
import Heading from 'grommet/components/Heading';
class Animate extends React.Component {
constructor(props) {
super(props);
this.state = {
currentQuestion: 'test',
visible: true,
showFull: false
}
}
compon... |
Java | UTF-8 | 805 | 2.4375 | 2 | [
"Apache-2.0"
] | permissive | package io.agent.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* A parameter annotated with @Returned can be used in a Hook's @After method to capture the return value of the instrument... |
Java | UTF-8 | 397 | 2.328125 | 2 | [] | no_license | package midianet.digital.modelo.validador;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
public class CepValidador implements ConstraintValidator<Cep, String> {
@Override
public void initialize(final Cep cep) {
}
@Override
public boolean isValid(final Str... |
Shell | UTF-8 | 1,331 | 2.859375 | 3 | [] | no_license | #!/bin/sh
# Copyright (C) 2008 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public Licens... |
Python | UTF-8 | 10,372 | 2.6875 | 3 | [] | no_license | import getpass
import requests
import urllib3
import yaml
from invoke import UnexpectedExit
from requests.auth import HTTPBasicAuth
from yaml.loader import SafeLoader
from time import sleep
from fabric import Connection, Config
from paramiko.ssh_exception import NoValidConnectionsError, AuthenticationException
# Read ... |
Python | UTF-8 | 1,396 | 3.40625 | 3 | [
"Apache-2.0"
] | permissive | import numpy as np
def central_difference_z(grid, Nz, Nx, dz, order=1):
"""
Take the differentiation in z of a "2D z-x grid" via central difference.
"""
if (order==1):
grid_temp = np.vstack((np.zeros(Nx), grid, np.zeros(Nx)))
prime_grid = (grid_temp[2:Nz+2] - grid_temp[0:Nz]) / (2*dz)... |
Java | UTF-8 | 249 | 1.765625 | 2 | [] | no_license | package cj.netos.exchange;
import cj.netos.exchange.bo.SelectKey;
import cj.netos.exchange.model.WenyPurchRecord;
import java.util.List;
public interface IPurchaseService {
List<WenyPurchRecord> page(SelectKey key, int limit, long offset);
}
|
C++ | UTF-8 | 5,410 | 2.640625 | 3 | [] | no_license | # include "stdafx.h"
/***************************************************************************
**
** INVOCATION NAME: G123DSTR
**
** PURPOSE: TO RETRIEVE A STRING INTO A CHARACTER BUFFER BASED ON DELIMITOR
**
** INVOCATION METHOD: G123DSTR(IN_STR, BUF_STR, DELIM)
**
** ARGUMENT LIST:
** NAME T... |
Python | UTF-8 | 1,685 | 3.71875 | 4 | [] | no_license | import logging
RIGHT = "R"
class Rover(object):
def __init__(self, x, y, facing):
self.facing = facing
self.position = (x, y)
def go(self, instructions):
for instruction in list(instructions):
self.execute(instruction)
def execute(self, instruction):
if ins... |
Shell | UTF-8 | 2,639 | 3.4375 | 3 | [] | no_license | #!/bin/bash
output_file="result.log"
seed=0
problem_set=xing.problem.CircularProblem
while (( $# ))
do
case $1 in
--output)
shift
output_file=$1
;;
--seed)
shift
seed=$1
;;
--problem-set)
shift
pr... |
Java | UTF-8 | 2,506 | 2.046875 | 2 | [] | no_license | package com.examples.twitterapp;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.widget.RelativeLayout;
import com.examples.twitterapp.main.ui.MainActivity;
import com.twitter.sdk.android.core.Callb... |
Markdown | UTF-8 | 769 | 2.875 | 3 | [
"MIT"
] | permissive | # elm-brunch
Brunch plugin to compile Elm code
# Install Elm
[Elm instalation instructions](http://elm-lang.org/Install.elm)
# Tips
Update the "source-directories" property in the elm-package.json file if you want to compile multifile elm projects.
Then configure elm-brunch:
```
// Configure your plugins
plugi... |
Java | UTF-8 | 781 | 1.945313 | 2 | [] | no_license | package Pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
/**
* Created by User on 2/29/2016.
*/
public class BoutiqueListPage extends BasePage { //список бутиков в админке
public static final By addNewBoutique = By.xpath("//span[te... |
Java | UTF-8 | 8,517 | 2.40625 | 2 | [] | no_license | package model.tester;
import model.CSMT;
import model.CSMTImpl;
import model.TestUtils;
import model.node.LeafNode;
import model.proof.MembershipProof;
import model.proof.Proof;
import org.junit.Test;
import java.math.BigInteger;
import java.util.Iterator;
import java.util.List;
import static org.junit.Assert.assert... |
Java | UTF-8 | 861 | 2.3125 | 2 | [] | no_license | package ru.netology.test.geo;
import org.junit.jupiter.api.Assertions;
import ru.netology.entity.Country;
import ru.netology.entity.Location;
import ru.netology.geo.GeoServiceImpl;
public class GeoServiceImplTest {
@org.junit.jupiter.api.Test
void GeoServiceImplTest() {
//given
String ipMoscow... |
JavaScript | UTF-8 | 5,779 | 2.625 | 3 | [] | no_license | 'use strict';
//The graph object draws the graph and interpolates its axis boundaries based on the data it is fed
function scatterPlot(argv) {
scatterPlot.superClass.constructor.call(this, argv);
this.mainSvg = this.canvasPtr;
this.miniCanvasPtr = null;
this.baseCSSClass = 'scatterPoint';
this.fadeCSSClass = 'fade... |
Java | UTF-8 | 1,005 | 2.140625 | 2 | [] | no_license | package com.example.lb1;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
sup... |
C# | UTF-8 | 1,220 | 2.796875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace CodeTheWay.Models
{
public class FinancialDonor
{
[Key]
public int Id { get; set; }
[DisplayName("First Name")]
... |
Markdown | UTF-8 | 14,937 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | ## 1、java中在参数传递时有2种方式
按值传递:值传递是指在调用函数时将实际参数复制一份传递到函数中,这样在函数中如果对参数进行修改,将不会影响到实际参数。
按引用传递:引用传递其实就弥补了上面说的不足,如果每次传参数的时候都复制一份的话,如果这个参数占用的内存空间太大的话,运行效率会很底下,所以引用传递就是直接把内存地址传过去,也就是说引用传递时,操作的其实都是源数据。
## 2、corePoolSize 、maximumPoolSize
线程池的基本大小,即在没有任务需要执行的时候线程池的大小,并且只有在工作队列满了的情况下才会创建超出这个数量的线程。这里需要注意的是:在刚刚创建ThreadPoolExecut... |
Markdown | UTF-8 | 4,424 | 2.65625 | 3 | [] | no_license | ---
description: "Recipe of Any-night-of-the-week Springy and Fluffy Whole Wheat Bread with Lots of Soy Milk"
title: "Recipe of Any-night-of-the-week Springy and Fluffy Whole Wheat Bread with Lots of Soy Milk"
slug: 299-recipe-of-any-night-of-the-week-springy-and-fluffy-whole-wheat-bread-with-lots-of-soy-milk
date: 202... |
Python | UTF-8 | 485 | 3.4375 | 3 | [] | no_license | # Pivoting on one variable
import numpy as np
# Pivot for mean weekly_sales for each store type
mean_sales_by_type = sales.pivot_table(values='weekly_sales', index='type')
# Print mean_sales_by_type
print(mean_sales_by_type)
# Fill in missing values and sum values with pivot tables
# Print mean weekly_sales by depar... |
C# | UTF-8 | 2,842 | 3.234375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Problem2SoftUniKaraoke
{
class SoftUniKaraoke
{
static void Main(string[] args)
{
var participantsList = new List<string>();
var songsList = new... |
Java | UTF-8 | 4,745 | 2.296875 | 2 | [] | no_license | package com.serverside;
import gvjava.org.json.JSONArray;
import gvjava.org.json.JSONObject;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletException;
import javax.serv... |
C++ | UTF-8 | 1,154 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | /***************************************************************
* @date: 2007-10-19
* @author: BrucePeng
* @brief: Define the file object(being downloaded)
*/
#include "KDownloadFile.h"
bool CDownloadFile::Create(const char *pszPathFileName)
{
if(NULL == pszPathFileName)
return false;
... |
Java | UTF-8 | 989 | 2.359375 | 2 | [] | no_license | package com.test.kafka.kafka;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import java.util.Random... |
Markdown | UTF-8 | 1,954 | 4.1875 | 4 | [] | no_license | [74. Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/)
* Amazon, Microsoft, Facebook, Uber, Apple
* Array, Binary Search
* Similar Questions:
* Search a 2D Matrix II
## Method 1. My Solution
```java
class Solution {
public boolean searchMatrix(int[][] matrix, int target) {
... |
C# | UTF-8 | 700 | 3.3125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
internal class Program
{
public void PrintProgram(string[] args)
{
Console.WriteLine("hello:) Main() ");
const string strMsg = "string messag";
MsgWr... |
TypeScript | UTF-8 | 1,541 | 2.765625 | 3 | [
"MIT"
] | permissive | import _, { Dictionary } from "lodash";
import { DBTables } from "../generated/ghost-db-tables";
import { Context } from "../data-sources/Context";
import { QueryBuilder } from "knex";
export function byColumnLoader<
Tbl extends keyof DBTables,
Key extends Extract<keyof DBTables[Tbl], string>,
KeyType extends Ex... |
Python | UTF-8 | 417 | 2.546875 | 3 | [] | no_license | # Create your tasks here
# from __future__ import absolute_import, unicode_literals
from celery import shared_task
@shared_task(name="function1")
def add(x, y):
print("inside add 1")
return x+y
@shared_task(name="function2")
def mul(x, y):
return x+y
def sum(x, y):
# to use for diff queue
# ad... |
C++ | UTF-8 | 1,596 | 2.875 | 3 | [
"MIT"
] | permissive | #include "stactiverecord/stactive_record.h"
using namespace stactiverecord;
using namespace std;
/**
Here are some example database connections strings:
// open an sqlite db in memory
Sar_Dbi * Sar_Dbi::dbi = Sar_Dbi::makeStorage("sqlite://:memory:");
// open PostgreSQL db with username and pass... |
C# | UTF-8 | 7,145 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace... |
Java | UTF-8 | 3,504 | 2.1875 | 2 | [
"BSD-2-Clause",
"BSD-2-Clause-Views"
] | permissive | /**
* Copyright (c) 2011, SOCIETIES Consortium
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
* conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list... |
Java | UTF-8 | 1,095 | 3 | 3 | [] | no_license | package com.mygdx.game;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import java.util.Vector;
public class Background {
class DoublePicture {
private Texture tx;
private Vector2 pos;
public DoublePicture... |
JavaScript | UTF-8 | 1,181 | 2.765625 | 3 | [
"MIT"
] | permissive | import * as THREE from '../../libs/three.module.js';
/**
* トロッコクラスです。
*/
export default class Truck extends THREE.Object3D {
/**
* コンストラクターです。
* @constructor
*/
constructor() {
super();
// 本体
const body = new THREE.Mesh(
new THREE.BoxGeometry(3, 3, 6),
new THREE.MeshPhongMateria... |
C++ | GB18030 | 31,876 | 2.546875 | 3 | [] | no_license | #ifndef __CONF_HALL_H__
#define __CONF_HALL_H__
#include "ConfManager.h"
#include "ConfGameSetting.h"
//////////////////////////////////////////////////////////////////////////
class AchieveItem
{
public:
int ID; //ɾID
int Title; //ɾͱ
int Desc; //
int UnLockLv; //ȼ
int Show; //Ƿʾ
i... |
Python | UTF-8 | 564 | 2.640625 | 3 | [] | no_license | N,K=map(int,input().split())
List = list(map(int, input().split()))
INF = 10000000000
expList = [INF]*1001
def expectationF(num):
if expList[num] == INF:
exp = 0
for i in range(1,num+1):
exp += i/num
expList[num] = exp
return expList[num]
res = 0
mid = 0
midList=[]
for i in range(N):
if i>=1:
... |
Markdown | UTF-8 | 3,158 | 3.375 | 3 | [] | no_license | # Milestone 6 - Refactoring Report
**Team members:**
Isabel Bolger and Lynnsey Martin
**Github team/repo:**
Edhelen: https://github.ccs.neu.edu/CS4500-S21/Edhelen
## Plan
List areas of your code/design you'd like to improve with brief descriptions,
anything that comes to mind. Tip: translate this list into Github I... |
Java | UTF-8 | 10,955 | 2.4375 | 2 | [] | no_license | package ru.ivanludvig.ship;
import ru.ivanludvig.starstorm.Gam;
import ru.ivanludvig.tween.SpriteTween;
import ru.ivanludvig.tween.SputnikTween;
import aurelienribon.tweenengine.Tween;
import aurelienribon.tweenengine.TweenEquation;
import aurelienribon.tweenengine.TweenEquations;
import aurelienribon.tweenengine.equa... |
C++ | UTF-8 | 370 | 3.109375 | 3 | [] | no_license |
/* Programm is searching how many 0 does number N have?*/
#include <iostream>
using namespace std;
int main()
{
unsigned int N;
int f = 0;
cin >> N;
if (N == 0) {
cout << 1;
return 0;
}
for (;N != 0; N /= 10) {
if (N % 10 / 1 == 0) {
f++;
}
}
if (f == 0) {
cout << " None ";... |
C++ | UTF-8 | 365 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
#define INF 100000000
int main()
{
int n;
while(cin >> n, n)
{
int Min = INF, Max = 0;
while(n--)
{
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
int sum = a + b + c + d + e;
Min = min(Min, sum);
Max = max(Max, sum);
}
cout <... |
Java | UTF-8 | 5,452 | 2.21875 | 2 | [] | no_license | package com.testyantra.emp.servlets;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.serv... |
Java | UTF-8 | 7,876 | 2.015625 | 2 | [] | no_license | package com.orel.ltg;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBarActivity;
import android.support.... |
Python | UTF-8 | 888 | 2.734375 | 3 | [
"MIT"
] | permissive | #In[1]:
import pymongo
from pymongo import MongoClient
#In[2]:
client = MongoClient()
db = client.test
#In[3]:
#Inserción:
db.users.insert_one({ 'name' : 'Cristal P' })
#In[4]:
users_to_create = [ {'name':'Holly'}, {'name':'Pete'} ]
db.users.insert_many( users_to_create )
#In[5]:
result = db.users.insert_one(
... |
JavaScript | UTF-8 | 1,887 | 2.875 | 3 | [] | no_license | const fs = require('fs');
const path = require('path');
const prettierRcPath = path.resolve(__dirname, '.prettierrc');
const prettierRcCopyPath = path.resolve(__dirname, '.prettierrc.copy');
// Version synchrone
try {
const content = fs.readFileSync(prettierRcPath, { encoding: 'utf-8' });
fs.writeFileSync(prettie... |
Java | UTF-8 | 2,107 | 2.453125 | 2 | [] | no_license | /*
* @Title: ApiResponse.java
* @Package: com.carrefour.vos
* @author: rick_wanshihua@carrefour.com.cn
* @CreateDate:Aug 21, 2019 11:16:18 AM
* @UpdateUser: rick_wanshihua@carrefour.com.cn
* @UpdateDate: Aug 21, 2019 11:16:18 AM
* @UpdateRemark:第一版
* @Description: 后台调用结果类
* @Version: [V1.0]
*/
package org.... |
Python | UTF-8 | 666 | 2.828125 | 3 | [] | no_license | from . import labdb
import pylab
import numpy
import scipy
import os
# get a list of all videos with 'time.txt'
db = labdb.LabDB()
rows = db.execute('SELECT video_id FROM video')
fps = []
for video_id, in rows:
filename = '/Volumes/HD3/video_data/%d/time.txt' % video_id
if os.path.exists('/Volumes/HD3/video_da... |
Java | UTF-8 | 284 | 2.1875 | 2 | [] | no_license | package state;
import main.Game;
public abstract class State {
protected Game mainGame;
public State(Game main){
mainGame = main;
}
public abstract void escIsDown();
public abstract void goBack();
public abstract String enterIsDown();
public abstract void isShow();
}
|
Markdown | UTF-8 | 2,435 | 3.296875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 代理、缓存、网关、隧道
tags:
- HTTP
categories: HTTP
description: 代理、缓存、网关、隧道
---
# HTTP代理、缓存、网关、隧道
通信数据转发程序:代理、网关、隧道
# 代理-agent
**位于客户端和服务器之间的HTTP中间实体。**
代理是一种有转发功能的应用程序。接收由客户端发送的请求并转发给服务器,同时也接收服务器返回的响应并转发给客户端。
<div class="rd">
<img src="/assets/images/2017/10-11-12/10-31-1.png" alt="">
</div>
... |
Java | UTF-8 | 3,778 | 2.390625 | 2 | [] | no_license | package com.shahidfoy.reactiveblog;
import com.shahidfoy.reactiveblog.models.Post;
import com.shahidfoy.reactiveblog.models.User;
import com.shahidfoy.reactiveblog.repositories.PostRepository;
import com.shahidfoy.reactiveblog.repositories.UserRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.bo... |
C# | UTF-8 | 1,610 | 2.53125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using DotnetAPI.Models;
using DotnetAPI.Services;
namespace DotnetMovieAPI.Controllers
{
public class MovieController : Controller
{
... |
Swift | UTF-8 | 1,602 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright © 2018 μSwift Authors. All Rights Reserved.
// SPDX-License-Identifier: BSD-3
@frozen
public struct Bool {
@usableFromInline
internal var _value: Builtin.Int1
@_transparent
public init() {
let zero: Int8 = 0
self._value = Builtin.trunc_Int8_Int1(zero._value)
}
@_transparent
@usabl... |
C++ | UTF-8 | 2,816 | 3.34375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include "NbAleatBorne.h"
#include "NbAleat.h"
using namespace std;
class TabAleat {
private:
int _n;
int _nMax; // On va partir sur le principe qu'on augmente la taille en puissance de 2 pour "gagner" du temps
NbAleat** _tab;
int findNextPowerOfTwo(int nb) {
... |
TypeScript | UTF-8 | 1,354 | 2.6875 | 3 | [] | no_license |
import csv = require('csvtojson');
import PDFDocument = require('pdfkit');
import fs = require('fs');
const csvFilePath='items.csv';
async function test(){
return csv({noheader:true}).fromFile(csvFilePath);
}
async function test2(){
const jsonArray= await test();
var doc = new PDFDocument();
doc.pipe(fs... |
PHP | UTF-8 | 4,864 | 2.53125 | 3 | [] | no_license | <?php
/**
* module Remote Session for Application
* @package Kutu
*
*/
class Pandamp_Session_SaveHandler_Remote implements Zend_Session_SaveHandler_Interface
{
/**
* Open Session - retrieve resources
*
* @param string $save_path
* @param string $name
*/
public function open($save_path, $name)
{
r... |
C++ | UTF-8 | 402 | 3.296875 | 3 | [
"MIT"
] | permissive | // Copyright (c) Andreas Fertig.
// SPDX-License-Identifier: MIT
#include <type_traits>
template<typename T>
auto Calculate(T& t)
{
return t;
}
template<typename T>
auto SomeFunction(T& value)
{
// ...
auto x = Calculate(value);
static_assert(std::is_integral_v<decltype(x)>,
"Only ... |
C# | UTF-8 | 6,992 | 2.5625 | 3 | [] | no_license | using DozorDatabaseLib;
using DozorDatabaseLib.DataClasses;
using DozorWeb.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace DozorWeb.Controllers
{
public class MessageController : Controller
{
public ActionResult MessageSendin... |
Java | UTF-8 | 7,664 | 2.03125 | 2 | [] | permissive | /* $This file is distributed under the terms of the license in LICENSE$ */
package edu.cornell.mannlib.vitro.webapp.controller.edit.listing;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Ht... |
Java | WINDOWS-1250 | 935 | 3.015625 | 3 | [] | no_license | /* Soubor Kap14\02\vokno\Vokno.java
* Nastaven rozmr, polohy a titulku okna
*/
package vokno;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Vokno extends JFrame
{
public Vokno()
{
//enableEvents(AWTEvent.WINDOW_EVENT_MASK); /* JDK 1.0 */
Dimension obrazovka = To... |
Java | UTF-8 | 370 | 2.203125 | 2 | [] | no_license | package AppointmentCalendar.model;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
public class CustomerList {
private static ObservableList<Customer> customerList = FXCollections.observableArrayList();
public static ObservableList<Customer> getCustomerList(){
... |
Python | UTF-8 | 426 | 2.796875 | 3 | [] | no_license | #!/usr/bin/env python
# coding=utf-8
class People(object):
guoji = 'china'
def __init__(self):
self.name = '小明'
def get_name(self):
return self.name
@classmethod
def get_guoji(cls):
return cls.guoji
people01 = People()
print (people01.guoji)
people01.guoji = 'usa'
print (Peo... |
TypeScript | UTF-8 | 2,064 | 2.625 | 3 | [] | no_license | import { Express } from 'express'
import { MongoClient, MongoClientOptions } from 'mongodb'
import { IS_TEST_ENV, MONGO_DB_NAME, MONGO_DB_URL } from '../consts'
import { createCollections } from './collections'
/**
* Defines a mongo client options object
*
* @see `MongoClientOptions`
*/
const mongoClientOptions: ... |
C# | UTF-8 | 5,778 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace ScriptureParseApi.Models
{
public static class ScriptureOps
{
public static List<Scripture> ParseScriptureFromString(this string unparsedScriptures)
{
var scriptures = new Lis... |
C# | UTF-8 | 1,149 | 2.578125 | 3 | [] | no_license | using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
namespace wedding_planner.Models
{
public class Wedding : BaseEntity
{
public Wedding()
{
Guests = new List<User>();
}
[Key]
public int ID { get; set; }
[Re... |
C | UTF-8 | 534 | 2.859375 | 3 | [] | no_license | #include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
pid_t pid;
int main(int argc, char **argv){
int pid, status;
pid = fork();
switch(pid){
case -1:
exit(-1);
case 0:
if(argc > 1){
printf("Soy el hijo y tengo argumentos para hacer un berrinchito.\n");
sleep(1);
... |
Python | UTF-8 | 1,544 | 2.875 | 3 | [] | no_license | # -*- coding: UTF-8 -*-
"""http处理模块
"""
import requests
import json
from . import BaseHandler
class HttpHandler(BaseHandler):
"""使用http上报机器信息数据
属性:
upload_url: 数据提交接口地址
"""
def __init__(self, config):
self.upload_url = config["uploadUrl"]
def handle_data(self, modules, data):
... |
C++ | UTF-8 | 1,003 | 2.625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <memory>
#define PARAMDEFINE(type , prefix,prarm_name) private:\
type m_##prefix##prarm_name;\
public:\
void Set_##prarm_name(type v_##prarm_name){m_##prefix##prarm_name = v_##prarm_name;};\
type Get_##prarm_name(){return m_##prefix##prar... |
Java | UTF-8 | 3,060 | 2.75 | 3 | [] | no_license | package managers;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.StringTokenizer;
import router.Link;
import router.RouteTable;
import router.Router;
public class ... |
Java | UTF-8 | 8,764 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | package cn.zhuhongqing.utils.date;
import java.util.Calendar;
import java.util.Locale;
import cn.zhuhongqing.utils.StringUtil;
import cn.zhuhongqing.utils.LocaleUtil;
import cn.zhuhongqing.utils.NumberUtil;
import cn.zhuhongqing.utils.TimeZoneUtil;
/**
* <b>GMT</b> specification, enhanced by some custom patterns. F... |
Python | UTF-8 | 9,806 | 3.078125 | 3 | [] | no_license | from tkinter import *
from tkinter import ttk
import sqlite3
# function to open the product page
# and configuration of the page.
def click():
global view
view=Toplevel()
view.title("Product Page")
view.iconbitmap("D:/200269_AyushaShrestha_FSMS-master/fashion.ico")
width = 1000
height = 550
... |
Shell | UTF-8 | 432 | 3.46875 | 3 | [] | no_license | #!/bin/sh
#
ws () {
local ws
ws=$(cat ~/.ws_list | xargs -n1 | fzy)
[ "$ws" = "" ] && return 1
ws=$(echo $ws | sed "s,^~,$HOME,")
cd $ws
}
register_ws () {
echo $(pwd | sed "s,^$HOME,~,") >> ~/.ws_list
}
unregister_ws () {
local ws
ws=$(cat ~/.ws_list | xargs -n1 | fzy)
[ "$ws" = "" ] && return 1
... |
Java | UTF-8 | 4,263 | 2.3125 | 2 | [] | no_license | package com.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;
import javax.ws.rs.core.MediaType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bi... |
C | UTF-8 | 171 | 3.15625 | 3 | [] | no_license | #include <unistd.h>
int main(void)
{
int a;
int b;
a = '0';
b = '9';
while(b >= a)
{
write(1, &b, 1);
b -= 1; // or b--
}
write(1, "\n", 1);
}
|
Java | UTF-8 | 375 | 1.945313 | 2 | [
"Apache-2.0"
] | permissive | package com.wanhuiyuan.szoa.bean;
public class MeetingVisit {
private String meetingId = "";
private String perId = "";
public String getMeetingId() {
return meetingId;
}
public void setMeetingId(String meetingId) {
this.meetingId = meetingId;
}
public String getPerId() {
return perId;
}
public void s... |
Java | UTF-8 | 920 | 2.8125 | 3 | [] | no_license | package Models;
public class Product {
private int codigo;
private String descricao;
private Double valorUnitario;
private AdditionalProduct marcaProduto;
public Product(int codigo, String descricao, Double valorUnitario) {
this.codigo = codigo;
this.descricao = descricao;
this.valorUnitario = valorUnitar... |
Java | UTF-8 | 1,513 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | package com.noi.utility.bean;
import java.beans.XMLDecoder;
import java.beans.XMLEncoder;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
public class BeanSerializer {
/*
* This class will encode/seria... |
Java | UTF-8 | 3,572 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package com.mmrx.yunliao.model.bean.sms;/**
* Created by mmrx on 16/3/8.
*/
import android.database.Cursor;
import com.mmrx.yunliao.presenter.util.MiddlewareProxy;
/**
* 创建人: mmrx
* 时间: 16/3/8下午12:51
* 描述: sms数据库表实体对象
*/
public class SmsBean {
private int _id;//短信序号
private int thread_id;//对话的... |
Java | UTF-8 | 2,786 | 1.835938 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019 NexCloud Co.,Ltd.
*
* 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 applicable law or agreed to in ... |
Markdown | UTF-8 | 7,716 | 2.8125 | 3 | [] | no_license | ---
title: Iris Choc/Kailh Low-Profile
---
This guide applies to just the Iris PCB for Kailh Low-Profile switches, where the order of the build steps are slightly different. If you're looking for the guide to the normal PCB, see [Iris Build Guide](iris-rev2-build-guide.md)
Note that some pictures from the normal Iris... |
JavaScript | UTF-8 | 1,654 | 2.6875 | 3 | [] | no_license | import { StaticEntity } from "./static-entity";
import { Assets } from "../../gfx/assets";
export default class Machine extends StaticEntity {
constructor(handler, x, y){
super(handler, x, y);
this.type = 'm';
this.keys = [];
// this.keys = ['test', 'test', 'test', 'test'];
... |
C | UTF-8 | 239 | 3.671875 | 4 | [] | no_license | #include <stdio.h>
int main()
{
char str[50];
printf("Enter a string : ");
gets(str); //as you can see the gets is like scanf. often times, it's used in strings.
printf("You entered: %s", str);
return(0);
}
|
C++ | UTF-8 | 3,077 | 2.671875 | 3 | [
"MIT"
] | permissive |
#pragma once
#include <sstream>
#ifdef _WIN32
#include <sys/timeb.h>
#else
#include <time.h>
#endif
#ifdef _MSC_VER
#define LN_FUNC_MACRO __FUNCTION__
#else
#define LN_FUNC_MACRO __PRETTY_FUNCTION__
#endif
#define LN_LOG(level) !(::ln::detail::Logger::getInstance() && ::ln::detail::Logger::getInstance()->CheckL... |
Python | UTF-8 | 1,141 | 3.21875 | 3 | [] | no_license | """
@author: Shaun
"""
import constants
def get_movie_url(id):
return constants.TMDB_MOVIE_URL.format(movie_id = id)
def get_company_url(id):
return constants.TMDB_COMPANY_URL.format(company_id = id)
def trim_dict(dict, keys, list_keys):
"""
Make dict smaller - as we need only some details
"""
... |
JavaScript | UTF-8 | 1,108 | 2.828125 | 3 | [] | no_license | define(["./exceptions"],
function (Exceptions) {
var inherit = function(currentClass, parentClassOrObject){
if (parentClassOrObject.constructor == Function) {
//Normal Inheritance
currentClass.prototype = new parentClassOrObject;
currentClass.prototype.constructor = currentClass;
cur... |
JavaScript | UTF-8 | 406 | 2.921875 | 3 | [] | no_license | const nightBtn = document.querySelector('.night-mode-btn');
const body = document.querySelector('body');
nightBtn.addEventListener('click', function() {
if(body.className === 'night') {
body.className = '';
nightBtn.textContent = 'Включить ночной режим';
} else {
body.className = 'night';
nightBtn.... |
JavaScript | UTF-8 | 1,082 | 3.640625 | 4 | [] | no_license | // var d = new Date();
// d.toLocaleTimeString();
// console.log(d);
// t = d.toLocaleString('en-US', {timeZone: 'America/New_York'});
// console.log(t);
const hourHand = document.getElementById("h");
const minuteHand = document.getElementById("m");
const secondHand = document.getElementById("s");
class Clock{
co... |
Python | UTF-8 | 185 | 3.03125 | 3 | [] | no_license | import myclass
a1=input('enter num1 :')
b1=input('enter num2 :')
print('Add :',myclass.myclass.add(a1,b1))
mul = myclass.myclass.mul(a1,b1)
print('multiplication :',mul) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.