language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 1,659 | 3.140625 | 3 | [
"MIT"
] | permissive | import pandas as pd
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import json
# import tensorflow
class Preprocessing:
def get_data(self, path):
with open(path) as json_file:
data = json.load(json_file)
self.dict_to_dataframe(data)
def dict_t... |
JavaScript | UTF-8 | 3,141 | 3.078125 | 3 | [] | no_license | const fastcsv = require('fast-csv');
const csv = require('csv-parser');
const fs = require('fs')
/* Get server time */
exports.getTime = () => {
return new Date();
}
/* sum return sum of a,b,c */
exports.sum = (a = 0, b = 0, c = 0) => {
let aInt = parseInt(a)
let bInt = parseInt(b)
let cInt = parseInt... |
Python | UTF-8 | 8,643 | 2.640625 | 3 | [] | no_license | import typing
from typing import List, Dict
from Agent import Agent
from Action import Action
from Listener import listener
import random
import math
# help mypy find symbol
if typing.TYPE_CHECKING:
from StockMarket import StockMarket
class Desire:
def __init__(self, action, strength):
self.action = ... |
Python | UTF-8 | 2,115 | 3.015625 | 3 | [] | no_license | """
Author:lixing
Data:2020-5-4
Blog:https://blog.csdn.net/sabrinalx
数据集:Mnist
训练集数量:60000
测试集数量:10000
------------------------------
运行结果:
正确率:99%
运行时长:124s(训练数据加载14s)
训练100s,测试0.05s
"""
import numpy as np
import time
from basemodel import Model
from basemodel import calTime
class ... |
Python | UTF-8 | 1,110 | 2.984375 | 3 | [
"BSD-3-Clause"
] | permissive | """
Clustering of Wind Mills
-------------------------------------------------------------------------
Clustering of monthly wind power for 12 months for a wind park near Tehachapi
with k-means clustering. It is remarkable that elements of the same cluster lie
together in all monthly comparison plots.
"""
import nump... |
JavaScript | UTF-8 | 7,188 | 2.84375 | 3 | [] | no_license | var MongoClient = require( 'mongodb' ).MongoClient;
var _db;
module.exports = {
//called once
connectToServer: function( callback ) {
MongoClient.connect( "mongodb://localhost:27017", function( err, client ) {
_db = client.db("teambot");
return callback( err );
} );
},
//returns instance of ... |
Python | UTF-8 | 210 | 2.609375 | 3 | [] | no_license | from enum import Enum
class PollStatus(Enum):
IN_PROGRESS = 0
CLOSED = 1
class OptionStatus(Enum):
YES = 0
NO = 1
MAYBE = 2
@staticmethod
def values():
return [0, 1, 2]
|
Java | UTF-8 | 145 | 2 | 2 | [] | no_license |
import java.rmi.*;
public interface Interface extends Remote
{
public double soma(double a, double b)
throws RemoteException;
}
|
PHP | UTF-8 | 3,807 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\controllers;
use app\models\Categories;
use app\models\Products;
class CatalogController extends \yii\web\Controller
{
public function actionItem($item_id){
$item = Products::GetItemById($item_id);
$cat = Categories::getParent($item['category']);
return $this->render('item', ['item' => $ite... |
Java | UTF-8 | 571 | 1.882813 | 2 | [] | no_license | package tr.com.getir.book.orderdomain.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import tr.com.getir.book.orderdomain.entity.OrderDetail;
import java.util.List;
impor... |
Java | UTF-8 | 260,666 | 2.109375 | 2 | [] | no_license | import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class RegressionTest5 {
public static boolean debug = false;
@Test
public void test2501() throws Throwable {
if (debug)
System.out.forma... |
Java | UTF-8 | 687 | 2.015625 | 2 | [] | no_license | package com.wby.Community.service;
import com.wby.Community.dao.CommentMapper;
import com.wby.Community.entity.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CommentService {
@Autowired
Commen... |
Java | UTF-8 | 512 | 2.953125 | 3 | [] | no_license | package javay.main.model.generating_pattern.singleton;
public class Singleton {
private static Singleton instance = null;
private Singleton() {
if (instance != null)
throw new AssertionError("Unauthorized access to create an object");
}
public static Singleton getInstance() {
... |
Markdown | UTF-8 | 499 | 2.75 | 3 | [] | no_license | # Male-Female-Face-Detection
Objective: Developing a face detection system from scratch that can differentiate between male and female faces.
Approach: Face detection and processing using OpenCV Haar Cascade Classifier to crop and extract face for easiar recognition.Extracted face is then fed to a supervised learning b... |
C | UTF-8 | 4,725 | 3.078125 | 3 | [
"MIT"
] | permissive | #ifndef SHOULD_H_
#define SHOULD_H_
/*!
* \file should.h
*
* \brief Minimal xUnit library for C programmers
* \author Hyunrae Cho (9beach@gmail.com)
* \date 2007/08/08
*/
#include <string.h>
#include <stdio.h>
/* FIXME: Probably configure script is the better place for the logic below. */
#ifdef _MSC_VER
# def... |
Java | UTF-8 | 343 | 2 | 2 | [] | no_license | package org.demo.pages;
import org.demo.tool.AutomationTool;
public class Page {
public static AutomationTool Tool;
protected String sUrlPage;
protected String sBrowserName;
protected String sCurrentUrl;
public Boolean OpenPage(){
return true;
}
public Boolean ClosePage(){
... |
C# | UTF-8 | 5,169 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using sales_system.DTO;
namespace sales_system.Logic
{
public class BusinessLogicTheSalesSystem
{
public static void SaleOfTheCheapestProduct(List<Dto_Sale> Sales)
{
int document = 0;
double valuesell = ... |
Markdown | UTF-8 | 2,407 | 3.1875 | 3 | [] | no_license | ### python实现描述性统计
- #### 导入python库和样例数据
```python
import numpy as np
import pandas as pd
data = pd.read_excel('实践一.xlsx')
data.head()
data.info()
```

- #### 集中趋势
- 众数
```python
data = data['data']
mode = data.... |
JavaScript | UTF-8 | 6,860 | 3.296875 | 3 | [] | no_license | import {expect, assert} from 'chai';
// object-literals - basics
// To do: make all tests pass, leave the assert lines unchanged!
describe('The object literal allows for new shorthands', () => {
const x = 1;
const y = 2;
describe('with variables', () => {
it.skip('the short version for `{x: x}` is {x}', (... |
C++ | UTF-8 | 1,393 | 3.421875 | 3 | [] | no_license | //
// Created by sarai on 20/01/2020.
//
#ifndef EX4_STATE_H
#define EX4_STATE_H
//class state
template<class T>
class State {
public:
//constructor- wraps a given object of generic type T
explicit State<T>(T st) {
this->value = st;
this->trailCost = 0;
this->cost = 0;
this->h... |
PHP | UTF-8 | 19,430 | 2.875 | 3 | [] | no_license | <?php
require_once "DBConnection.php";
class Object {
var $id;
var $cached_values;
function Object()
{
$this->using_cache = 1;
}
function get_id()
{
return $this->id;
}
function get_db_value($v)
{
$this = $this->get_object($this->get_id());
return $this->cached_valu... |
JavaScript | UTF-8 | 678 | 3.625 | 4 | [
"MIT"
] | permissive | 'use strict'
/*Reduce function for reference
function countWords(inputWords) {
return inputWords.reduce(function(wordObj, curr) {
if(wordObj.hasOwnProperty(curr)){
wordObj[curr] +=1;
}
else {
wordObj[curr] = 1;
}
return wordObj;
}, {}) //empty object is passed for .red... |
PHP | UTF-8 | 1,936 | 2.75 | 3 | [] | no_license | <?php
// configuration
require("../includes/helpers.php");
//http://www.phpeasystep.com/phptu/6.html
$host="localhost"; // Host name
$myusername="chibeta"; // Mysql username
$mypassword="v1kCjsvLYytrBTGV"; // Mysql password
$db_name="final"; // Database name
$tbl_name="users";... |
Java | UTF-8 | 1,956 | 2.78125 | 3 | [] | no_license | package com.udacity.sandwichclub.utils;
import com.udacity.sandwichclub.model.Sandwich;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class JsonUtils {
private static String NAME = "name";
private static String... |
Markdown | UTF-8 | 519 | 2.8125 | 3 | [] | no_license | ---
title: "Dodge Special"
date: 2020-04-21
url: /2020/04/21/dodge-special/
tags:
- Gin
- Cointreau
- Grape Juice
draft: false
---
The recipe from Savoy called for 1/2 part gin, 1/2 part Cointreau and a dash of Grape Juice. So what is 3 dashes? I went with a 1/4 oz and was happy with the result. The Milk & Hone... |
C++ | UTF-8 | 677 | 2.9375 | 3 | [] | no_license | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> pascalTriangle;
for (int row = 1; row <= numRows; row++) {
vector<int> rowVector;
rowVector.push_back(1);
int i = 1;
while (i < row-1) {
... |
Java | UTF-8 | 1,490 | 3.703125 | 4 | [] | no_license | package com.megetood.executor.search;
import com.megetood.executor.ArrayGenerator;
/**
* 线性查找
* 使用泛型,参数类型只能使用类对象(基本数据类型使用其包装类)
*
* @author chengdong.lei@hand-china.com 2020/08/21 13:13
*/
public class LinearSearch {
private LinearSearch() {
}
public static <E> int search(E[] data, E ... |
C++ | UTF-8 | 23,001 | 2.90625 | 3 | [] | no_license | #include <unordered_map>
#include <set>
#include <vector>
#include <string>
#include <cctype>
#include <algorithm>
#include <stack>
#include <ListNode.h>
using namespace std;
class Solution {
public:
vector<int> twoSum_1(vector<int> &nums, int target) {
unordered_map<int, int> remainAndIndex;
int ... |
Java | UTF-8 | 1,154 | 2.625 | 3 | [] | no_license | package com.app.shortURL.service;
import org.springframework.stereotype.Service;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.IntStream;
@Service
public class ShortUrlService {
public static final String HOST_URL = "http://localhost:8... |
Python | UTF-8 | 2,247 | 2.78125 | 3 | [
"MIT"
] | permissive | import unittest
from logging import Logger, getLogger
from numpy import eye, zeros, ndarray, newaxis, ones, allclose, array
from freq_used.logging_utils import set_logging_basic_config
from optmlstat.opt.special_solvers import (
strictly_convex_quadratic_with_linear_equality_constraints,
)
logger: Logger = getLo... |
Java | UTF-8 | 1,822 | 3.15625 | 3 | [] | no_license | package com.midgardabc.lesson_8Homework.frame_8Hw_3MagicSquare;
import java.awt.Dimension;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import javax.swing.JFrame;
public class Launcher implements MouseListener, MouseMotionListener {
public Magic... |
JavaScript | UTF-8 | 1,587 | 2.703125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import { Bar } from "react-chartjs-2";
import classes from "./chart.module.css";
const Chart = (props) => {
const [chartData, setChartData] = useState({});
const [option, setOption] = useState([]);
const [ansData, setAnsData] = useState([]);
const c... |
Markdown | UTF-8 | 4,678 | 3.6875 | 4 | [
"MIT"
] | permissive | # Reduce
`Array.prototype` 이 가지고 있는 `reduce`라는 함수다.
이 `reduce` 는 흔히 SUM의 기능을 가진다고 생각을 많이 한다. 그러나 생각보다 더 많은 기능을 구현할 수 있다.
<br/>
## 함수 설명
`Reduce` 는 구조가 좀 특이하다. 일단 파라미터로 두가지를 받을 수 있는데 콜백함수와 초기값이다. 그런데 이 콜백에 4가지 파라미터가 있으나 2개가 필수 2개가 `optinal` 이다. 보기쉽게 구조를 그려보자.
```md
- reduce
- callback
- total // 누적 값
... |
Markdown | UTF-8 | 2,623 | 3.015625 | 3 | [] | no_license | # evoTree
## Comment utiliser le site ?
**Nécessite** : Connexion internet
**Fichiers nécessaires** : index.html, tree-anim.js, tree-canvas.html, dossier JSON : avec un fichier .json (arbre), dossier CSS : stylesDivArbre.css, stylesStructureSite.css, dossier images.
Lancer le fichier index.html avec un navigateur w... |
Python | UTF-8 | 524 | 3.140625 | 3 | [] | no_license | class Solution:
def wordPattern(self, pattern: str, str: str) -> bool:
map1, map2 = {}, {}
string = str.split()
if len(pattern) != len(string):
return False
for i in range(len(pattern)):
if pattern[i] in map1 and string[i] != map1[pattern[i]]:
... |
JavaScript | UTF-8 | 363 | 2.625 | 3 | [] | no_license | function cargarform(id,nombre,apellido,usuario,rol,estado){
$("#txtApellido").val(apellido);
$("#txtNombre").val(nombre);
$("#txtUser").val(usuario);
$("#selTipo").val(rol);
$("#selEstado").val(estado);
$("#Id").val(id);
}
$('.input-number').on('input', function () {
this.value = th... |
C | UTF-8 | 144 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
int main(){
int *add = NULL;
int val;
scanf("%d %d", add, &val);
*add = val;
printf("%d", *add);
return 0;
}
|
Java | UTF-8 | 470 | 2.25 | 2 | [] | no_license | package com.zis.purchase.bean;
import java.util.HashMap;
import java.util.Map;
public class PurchasePlanStatus {
public static final String NORMAL = "normal";
public static final String USELESS = "useless";
private static final Map<String, String> map = new HashMap<String, String>();
static {
map.put(NORMAL, "... |
Python | UTF-8 | 4,933 | 2.5625 | 3 | [
"MIT"
] | permissive | """
__ __ _ _ _ _ _
\ \ / /__| |__ ___ _ __ ___ | |_ ___ | || |_ _ __| |_ _ __ _
\ \/\/ / -_) / _/ _ \ ' \/ -_) | _/ _ \ | __ | || / _` | '_/ _` |
\_/\_/\___|_\__\___/_|_|_\___| \__\___/ |_||_|\_, \__,_|_| \__,_|
... |
Java | UTF-8 | 3,425 | 1.921875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2006-2023 Prowide
*
* 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... |
Ruby | UTF-8 | 84 | 2.71875 | 3 | [] | no_license | input = gets.delete_suffix("\n")
print input
print " look were on the same line \n"
|
C | UTF-8 | 3,944 | 3.15625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#define SERVER_PORT 5100 /* 서버의 포트 번호 */
int main(int argc, char **argv)
{
int ssock;
socklen_t clen;
int n;
struct sockaddr_in servaddr, cliaddr;
char mesg[BUFSIZ];
fd_set readfd; /*... |
JavaScript | UTF-8 | 431 | 4.0625 | 4 | [] | no_license | /*Дан массив с элементами [2, 3, 4, 5]. С помощью цикла for найдите произведение элементов этого массива. Через for of*/
var Array = [2, 3, 4, 5];
var result = 1;
for (var i = 0; i < Array.length; i++)
{
result *=Array[i];
console.log(result);
}
console.log(result);
document.writeln(`Результат произведения - ... |
Java | UTF-8 | 949 | 3.359375 | 3 | [] | no_license | import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Scanner;
public class _02_sets_of_elements {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
int[] lengths = Arrays.stream(console.nextLine().split(" ")).mapToInt(Integer::parseInt).t... |
Python | UTF-8 | 5,744 | 3.65625 | 4 | [] | no_license | """
In uninformed_search.py, you will implement generic search algorithms
(using uninformed search approaches) which are called by
Pacman agents (in searchAgents.py).
"""
import util
import searchAgents
def tinyMazeSearch(problem):
"""
Returns a sequence of moves that solves tinyMaze. For any other maze, t... |
Markdown | UTF-8 | 2,587 | 2.875 | 3 | [] | no_license | ## Add interesting blogs you find over the internet here.
### WEB DEVELOPMENT AND DESIGNING
- [CSS Tricks](https://css-tricks.com/) - Daily articles about CSS, HTML, JavaScript, and all things related to web design and development.
- [SitePoint](https://www.sitepoint.com/) - SitePoint is an online community of web p... |
C# | UTF-8 | 4,648 | 3.671875 | 4 | [] | no_license | using GeometricShapeInterfaces.models;
using System;
namespace GeometricShapeInterfaces
{
class Program
{
static Shape _shape;
static void Main()
{
bool exit = false;
while (!exit)
{
Console.WriteLine("Enter command: ");
... |
Python | UTF-8 | 120 | 3.71875 | 4 | [] | no_license | n = int(input("Enter x value:"))
a = int(input("Enter y value:"))
for i in range(n,a+1):
if i%2==0:
print(i) |
Markdown | UTF-8 | 7,507 | 3.5625 | 4 | [
"MIT"
] | permissive | ---
layout: post
title: "Python系列(十)元类编程"
subtitle: ""
date: 2018-12-21 13:01:00
author: "YaPi"
header-img: ""
tags:
- Python
---
#### @property
使用@property添加一个没有定义的属性
使用@属性名.setter为添加的属性赋值
```text
from datetime import date, datetime
class User:
def __init__(self, name, birthday):
... |
Java | UTF-8 | 1,481 | 2.40625 | 2 | [] | no_license | package com.example.demo2;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpSession;
@Controller
public class NormalController {
@GetMapping("/index")
public String start(){
... |
Python | UTF-8 | 5,526 | 2.90625 | 3 | [] | no_license | import csv
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import copy
import matplotlib.pyplot as plt
import random
class Interpolate_welding:
def __init__(self, filename, test_flag):
self.csvfile = open(filename, 'r')
self.lookup_table = []
self.lookup_list = []
se... |
C++ | WINDOWS-1250 | 6,566 | 2.78125 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include "calerf.c"
#include <cmath>
using namespace std;
// stale wspolczynniki
double dx=0.1;//dx=0.005;
double dt=0.01;//=0.000025;
const double D=1;
const double tmax=2;
const double r=1;
const double a=10;
//double lambda=dt/dx/dx*D;
const double lambda=1;
/... |
Python | UTF-8 | 3,431 | 3.5625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 11 11:34:57 2014
@author: pruvolo
"""
from random import randint
from math import *
import Image
def build_random_function(min_depth, max_depth):
"""
creates a random function with its inputs as other random functions, with depth defined between min_depth and ma... |
Java | UTF-8 | 3,170 | 2.125 | 2 | [] | no_license | package com.andro.naveen.famousapp;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.andro.naveen.famousapp.database.DatabaseHelper;
import com.andro.naveen.famo... |
JavaScript | UTF-8 | 568 | 2.5625 | 3 | [] | no_license | const Discord = require('discord.js');
const bot = new Discord.Client();
bot.login("NzgwNDE2MTU2NzYyNTA1MjE3.X7uxLw.AF3PIMTkoFvn8lXBgACfiWoXuiU");
bot.once('ready', ()=> {
console.log('Bot online: ${bot.user.tag}!');
});
bot.on('guilderMemberAdd', membro=> {membro.send('E aê, Miauhumano! Seja bem vindo e curta o cont... |
Markdown | UTF-8 | 6,735 | 3.265625 | 3 | [] | no_license | ---
title: Golang 中预分配 slice 内存对性能的影响
date: 2023-07-19 10:48:09
tags: [性能, golang]
---
- [Slice 内存分配理论基础](#slice-内存分配理论基础)
- [定量测量](#定量测量)
- [Lint 工具 prealloc](#lint-工具-prealloc)
- [总结](#总结)
在我代码 review 的过程中经常会关注代码里 slice 的初始化是否分配了预期的内存空间,也就是凡是 `var init []int64` 的我都会要求尽可能改成 `init := make([]int64, 0, length)` 格式。但是这... |
C++ | UTF-8 | 411 | 2.9375 | 3 | [] | no_license | #pragma once
#include <string>
using namespace std;
class hNode {
public:
int key;
string data;
hNode(int key, string value) {
this->key = key;
this->data = value;
}
};
class hashing {
public:
hashing();
int hashFunc(int key);
void insert(int key, string data);
void find(int key);
voi... |
PHP | UTF-8 | 2,196 | 2.734375 | 3 | [] | no_license | <?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* DressCategory
*
* @ORM\Table(name="dress_category")
* @ORM\Entity("DressCategoryRepository")
*/
class DressCategory implements \App\Interfaces\ToStringInterface, \App\Interfaces\ToArrayObjectInterface
{
/**
* @var integer
*
* ... |
C++ | UTF-8 | 1,191 | 3.234375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<unordered_map>
#include<algorithm>
#define iipair pair<int,int>
using namespace std;
//题目叙述的有点复杂,说白了就是有两个数列,一个升序一个降序,
//求某一个索引,那两个数列中在这个索引位置的数字的最小值最大
//比如两个数列:
//1 2 4 5 8 9
//6 5 5 3 2 1
//在索引为3处(索引从1开始),有min(4,5) = 4,为最大值
//注意由于每天骑行的距离可能是个很大的数(虽然不太科学),
//所以不能用数组的方式来计数,只能用数... |
Markdown | UTF-8 | 2,147 | 3.703125 | 4 | [
"MIT"
] | permissive | # 430. 扁平化多级双向链表
[leetcode链接](https://leetcode-cn.com/problems/flatten-a-multilevel-doubly-linked-list/)
## 题目
多级双向链表中,除了指向下一个节点和前一个节点指针之外,它还有一个子链表指针,可能指向单独的双向链表。这些子列表也可能会有一个或多个自己的子项,依此类推,生成多级数据结构,如下面的示例所示。
给你位于列表第一级的头节点,请你扁平化列表,使所有结点出现在单级双链表中。
>示例 1:<br/>
输入:head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,1... |
C# | UTF-8 | 1,261 | 2.625 | 3 | [] | no_license | using BlogManagement.DataAccess.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace BlogManagement.DataAccess.Abstract
{
public interface IBlogRepository
{
Task<Blog> AddBlog(string name);
Task<Blog> UpdateBlog(int blogId, string name, string themeName);
... |
Java | UTF-8 | 9,099 | 4.0625 | 4 | [] | no_license | package datastructures;
import com.sun.corba.se.impl.orbutil.graph.Graph;
import java.util.*;
/**
* Created with ♥ by georgeplaton on 18.04.18.
*/
public class GraphAdjList
{
private int noVertices; // No. of vertices
private LinkedList<GraphNode> adj[]; // Adjacency Lists
// Constructor
public ... |
Markdown | UTF-8 | 693 | 2.59375 | 3 | [
"MIT"
] | permissive | ---
heading: Pages List
categories:
- theming
description: A nested pages list.
link: https://github.com/nliautaud/pico-pages-list
info:
By: "[nliautaud](https://github.com/nliautaud)"
License: "[The MIT License](https://github.com/nliautaud/pico-pages-list/blob/master/LICENCE.md)"
---
Create a nested HTML navig... |
Java | UTF-8 | 5,141 | 2.875 | 3 | [] | no_license | package gameObjects;
import java.awt.Color;
import java.awt.Graphics;
import paint.Game;
import paint.Input;
public abstract class GameObject {
public static GameObject[] recycle = new GameObject[20];
public static int index = 0;
protected double x;
protected double y;
protected double angle;
... |
JavaScript | UTF-8 | 488 | 2.796875 | 3 | [] | no_license | const newPost = async (event) => {
event.preventDefault();
const title = document.getElementById("title").value;
const content = document.getElementById("body").value;
await fetch(`/api/posts/${postId}`, {
method: "PUT",
body: JSON.stringify({ title, content }),
headers: { "Cont... |
PHP | UTF-8 | 672 | 2.59375 | 3 | [] | no_license | <?php
/*发送 post 数据
@param url $url 发送地址
@param data $data 发送的json数据*/
function http_curl($url,$data){
//1.初始化curl
$ch = curl_init();
//2.设置curl的参数
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, ... |
C++ | UTF-8 | 163 | 2.71875 | 3 | [] | no_license | #include<stdio.h>
#include <cmath>
#define PI 3.1416
int main (){
float x;
int z;
int w;
z=3;
w=7;
x= (float) w/z;
printf("Hola soy %f",x);
return 0;
}
|
Shell | UTF-8 | 3,775 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | MININIX_PKG_HOMEPAGE=https://httpd.apache.org
MININIX_PKG_DESCRIPTION="Apache Web Server"
MININIX_PKG_VERSION=2.4.37
MININIX_PKG_SHA256=3498dc5c6772fac2eb7307dc7963122ffe243b5e806e0be4fb51974ff759d726
MININIX_PKG_SRCURL=https://www.apache.org/dist/httpd/httpd-$MININIX_PKG_VERSION.tar.bz2
MININIX_PKG_DEPENDS="apr, apr-u... |
Markdown | UTF-8 | 2,124 | 2.828125 | 3 | [] | no_license | ---
title: 腾讯云服务器如何开放端口?
date: 2020-10-17 09:15:20
tags: 云服务
categories: 生产工具及环境的折腾
---
昨天在实现`httpserver`时,代码是运行在腾讯云的服务器上,我想通过`公网IP+端口`去访问,发现总是访问失败,但是我`ubuntu`中的防火墙已经关闭了呀.这个时候我一直认为是我代码写的有问题,折腾了好久,现在记录下如何开放腾讯云的端口.
<!--more-->
## 云服务上的接入层
云服务器的防火墙分为两层.
1. 云服务器接入层:即**服务商的安全组**,需要通过网页登录云服务商设置安全组
2. 系统主机的防火墙.
,
* Organizat... |
Markdown | UTF-8 | 8,107 | 3.90625 | 4 | [
"MIT"
] | permissive | ---
title: "[JAVA] 이것이 자바다_4"
excerpt: "열거 타입"
categories:
- JAVA
tags:
- JAVA
- 열거
- enum
toc: true
toc_sticky: true
toc_label: "열거 타입"
---
JAVA의 열거 타입에 대해 알아보자.
### 열거 타입이란?
- - -
데이터 중에는 몇 가지로 한정된 값만을 갖는 경우가 흔히 있다.
예를 들어 요일에 대한 데이터는 월, 화, 수, 목, 금, 토, 일이라는 일곱 개의 값만을 갖고,
계절에 대한 데이터는 봄, 여름, 가을, 겨울이라는 네 개의 값만을 가진... |
Java | UTF-8 | 1,158 | 2.265625 | 2 | [] | no_license | package com.g2academy.onetomany.controller;
import com.g2academy.onetomany.domain.Author;
import com.g2academy.onetomany.domain.Book;
import com.g2academy.onetomany.domain.Review;
import com.g2academy.onetomany.service.ReviewService;
import com.g2academy.onetomany.service.dto.AuthorDto;
import com.g2academy.onetomany.... |
Python | UTF-8 | 523 | 2.71875 | 3 | [] | no_license | # 時間オーバー
def combine(A):
global s
n = len(A)
for std in range(n):
for i in range(std, n-1):
v = A[std] + A[i+1]
s.append(v)
B = A[:]
B.pop(std)
B.pop(i)
B.insert(0, v)
combine(B)
n = int(input())
A = list(map(int,... |
C++ | UTF-8 | 1,019 | 3.75 | 4 | [] | no_license | #include <vector>
#include <string>
using namespace std;
/**
* For each letter encountered, process the last occurrence of that letter, extending the current partition [anchor, j] appropriately.
* We need an array last[char] -> index of S where char occurs last. Then, let anchor and j be the start and end of the cu... |
Shell | UTF-8 | 1,711 | 4.34375 | 4 | [] | no_license | #!/bin/bash
# check if there is an exported dir from NFS server
is_a_export_dir() {
local LOCAL_EXPORT_DIR=${1}
if showmount -e localhost | grep -q "${LOCAL_EXPORT_DIR}"; then
return 0
fi
return 1
}
setup_nfs_client() {
echo "--> Setting up the NFS Client"
local NFS_SERVER=${1}
local NFS_EXPORT_DIR=... |
Java | UTF-8 | 6,487 | 2.71875 | 3 | [] | no_license | package com.c3s;
import com.c3s.GUI.Panel;
import com.c3s.Utils.Helper;
import java.io.*;
import java.net.*;
import java.util.Date;
public class Node {
private int pid;
private boolean leader, failed, eligibleForElection;
private ServerSocket serverSocket;
private int n_process;
private Date las... |
C# | UTF-8 | 15,186 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
namespace Aula07
{
class Program
{
static void Main(string[] args)
{
////01
//List<string> dados = new List<string>();
//Console.WriteLine("Insira o dado 1");
//string input = Console.ReadLine();
... |
JavaScript | UTF-8 | 881 | 3.609375 | 4 | [] | no_license | binary = n => {
let num = 1;
bin = num.toString(2);
let binaries = [];
// find the first of correct length
while (bin.length < n) {
num++;
bin = num.toString(2);
}
// continue while length is good
while (bin.length === n) {
binaries.push(bin);
num++;
bin = num.toString(2);
}
b... |
C++ | UTF-8 | 1,059 | 2.734375 | 3 | [] | no_license | /**
* Modulo de definicao da classe TpvArray,
para ser usado como geometria extraida para a TopsView
*/
#ifndef TPV_ARRAY_H
#define TPV_ARRAY_H
#include <ds/array.h>
#include <tops/tops.h>
#include <topsview/defines.h>
#include <stdio.h>
#include <math.h>
/**
Defines a reference counted array.
... |
JavaScript | UTF-8 | 335 | 3.015625 | 3 | [] | no_license | function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
rectMode(CENTER);
}
function draw() {
background(235);
fill(255,0,0,100);
ellipse(mouseX, height/2,mouseY/2+10);
fill(255,255,255,100);
var inverseX = width-mouseX;
var inverseY = height-mouseY;
ellipse(inverseX, height/2,(inve... |
JavaScript | UTF-8 | 7,613 | 2.71875 | 3 | [
"MIT"
] | permissive | import React from 'react'
import TextBox from './'
import { shallow } from 'enzyme'
const mockSetCustomValidity = jest.fn(error => error.message)
describe('[Input Wizard] - Testing REQUIRED validation ', () => {
const component = shallow(
<TextBox value=''
rules={[ {name: 'required', message: 'This field ... |
C++ | UTF-8 | 1,423 | 3.25 | 3 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
class shopping
{
char it_name[50];
public:
int code;
int price;
int static count;
void read()
{
cout<<"Item name :";
cin>>it_name;
cout<<"code :";
cin>>code;
cout<<"price :";
cin>>price;
}
void display()
{
cout<<"\nname :"<<it_name... |
Markdown | UTF-8 | 9,804 | 2.90625 | 3 | [
"MIT"
] | permissive | # cohort7_structure
# Introduction
For the past 6 cohorts (since January 6th 2018), we have offered free machine learning classes to more than 600 Nigerians and we are excited to continue our long-standing tradition. However, in this cohort, we will be introducing our students to Machine Learning operations (MLOPS) to... |
Markdown | UTF-8 | 534 | 2.546875 | 3 | [
"MIT"
] | permissive | ---
layout: project_single
title: "Why You Need a Job Description for Yourself"
slug: "why-you-need-a-job-description-for-yourself"
parent: "business-development-manager-job-description"
---
Job descriptions seem few and far between for those running online businesses. Check out this post on why I think it's far past ... |
Shell | UTF-8 | 342 | 2.796875 | 3 | [] | no_license | #!/bin/bash
clear
ARQUIVO="/tmp/testNet.log"
DATA=$(date +%d/%m/%y-%H:%M:%S)
echo "Iniciando teste de velocidade"
echo ""
echo -e "Cliente: Solucionartec\nHorarioda Medição: $DATA" >> $ARQUIVO
speedtest --simple >> $ARQUIVO
echo "==========================" >> $ARQUIVO
echo -e "Coletando resultados\nAguarde..."
... |
Markdown | UTF-8 | 613 | 2.765625 | 3 | [
"MIT"
] | permissive | ## Solutions
#### 1
##### Source Code
```python
# problem name: Number of Different Integers in a String
# problem link: https://leetcode.com/contest/weekly-contest-234/problems/number-of-different-integers-in-a-string/
# contest link: https://leetcode.com/contest/weekly-contest-234/
# time: (?)
# author: reyad
# oth... |
C# | UTF-8 | 1,194 | 2.890625 | 3 | [] | no_license | using Newtonsoft.Json;
using SerializationContractResolverExample.ContractResolver;
using System;
namespace SerializationContractResolverExample
{
class Program
{
static void Main(string[] args)
{
CustomerInfo customerInfo = new CustomerInfo()
{
FirstNam... |
Python | UTF-8 | 7,659 | 3.015625 | 3 | [] | no_license | import tkinter as tk
from tkinter import ttk # 添加一个组件
from tkinter import scrolledtext
from tkinter import messagebox as mBox
from tkinter import Menu
from tkinter import Spinbox
##############################################################
# creating tooltips using Python
class ToolTip(object):
def ... |
Python | UTF-8 | 248 | 4.25 | 4 | [] | no_license | def add(a,b): #function declaration with 2 parameters separated by commas - DON'T forget the colon!
return a+b #add a and b and return the result
sum = add(1,1) #call the function to add 1 and 1
print "add(1,1) = "
print sum #print the result |
C | UTF-8 | 2,235 | 2.828125 | 3 | [] | no_license | #include "klib.h"
#include <stdarg.h>
#if !defined(__ISA_NATIVE__) || defined(__NATIVE_USE_KLIB__)
int printf(const char *fmt, ...) {
char buf[2560];
va_list args;
int n;
va_start(args, fmt);
n = vsprintf(buf, fmt, args);
va_end(args);
for(int i=0 ; buf[i]!='\0' ; i++ )
{
_putc(buf[i]);
}
return... |
Java | UTF-8 | 1,765 | 2.953125 | 3 | [] | no_license | import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import j... |
Markdown | UTF-8 | 812 | 2.640625 | 3 | [] | no_license | ---
title: "Open Robot Kit"
date: "2021-03-01"
---
# Open Robot Kit
Weavly (formerly the Inclusive Coding Environment) is being designed to work with a variety of coding robots. Off the shelf robots are often inaccessible for many learners. This is why Tetra Ryerson is creating an Open Robot Kit to enable educators t... |
C# | UTF-8 | 8,598 | 2.546875 | 3 | [
"MIT"
] | permissive | using SpiceSharp.Algebra;
using SpiceSharp.Attributes;
using SpiceSharp.Behaviors;
using SpiceSharp.Simulations;
namespace SpiceSharp.Components.SwitchBehaviors
{
/// <summary>
/// (DC) biasing behavior for switches.
/// </summary>
public class BiasingBehavior : Behavior, IBiasingBehavior
{
... |
Python | UTF-8 | 425 | 3.1875 | 3 | [] | no_license | from functools import reduce
numbers = list(filter(lambda n:
not (n % 3 and n % 5)
,range(1, 1000)))
result = 0
for n in list(numbers):
result += n
print("result: %d" % result)
sum = reduce(lambda acc, curr: acc + curr,
numbers)
print('lambda number %d' % sum)
sumReduce = reduce(
lambda acc, curr: (
ac... |
Python | UTF-8 | 494 | 3.28125 | 3 | [] | no_license | def count_positives_sum_negatives(arr):
#your code here
countera = 0
counterb = 0
cool = []
empty = []
for i in range(len(arr)):
if arr[i] > 0:
countera += 1
else:
counterb = counterb + arr[i]
cool.append(countera)
cool.append(counterb)
print(... |
C++ | UHC | 1,852 | 2.765625 | 3 | [] | no_license | #include "Transform.h"
void Transform::Move(DIRECTION direction)
{
switch (direction)
{
case FRONT:
break;
case BACK:
break;
case LEFT:
break;
case RIGHT:
break;
default:
break;
}
}
void Transform::RotateY(float degree)
{
}
void Transform::TransformUpdate()
{
float x, y, z;
D3DXQUATERNION quat... |
JavaScript | UTF-8 | 927 | 3.09375 | 3 | [
"MIT"
] | permissive | "use strict";
//~ /**
//~ * Does breath first tree search.
//~ *
//~ * Needless to say, it is only suitable for tree structures as it does not take repeated states into account. For graphs, it will run until it runs iut of memory.
//~ */
//~ module.exports.treeSearch = function (paramaters)
//~ {
//~ return function ... |
Ruby | UTF-8 | 1,597 | 2.515625 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | require "test_helper"
class LegacyWorldwideOfficeTypeTest < ActiveSupport::TestCase
test "should provide slugs for every worldwide office type" do
worldwide_office_types = WorldwideOfficeType.all
assert_equal worldwide_office_types.length, worldwide_office_types.map(&:slug).compact.length
end
test "shou... |
Swift | UTF-8 | 1,678 | 4.21875 | 4 | [] | no_license | //TODO:一、Closure Expressions
//MARK:1. The Sorted Function
let names = ["Charis", "Alex", "Ewa", "Barry", "Daniella"]
func backwards(s1:String, s2:String) -> Bool {
return s1 > s2
}
var reversed = sorted(names,backwards)
//MARK:2. Closure Expression Syntax
/*
{( parameters ) -> return type in
statement... |
Python | UTF-8 | 672 | 3.609375 | 4 | [] | no_license | # -*- coding:utf-8 -*-
import xlwt
'''
写入excel
'''
def write_excel():
workbook = xlwt.Workbook(encoding='utf-8')
booksheet = workbook.add_sheet('Sheet 1', cell_overwrite_ok=True)
# 存第一行cell(1,1)和cell(1,2)
booksheet.write(0, 0, 'Python开发')
booksheet.write(0, 1, 'Web前端')
# 存第二行cell(2,1)和cell(2,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.