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 | 993 | 3.140625 | 3 | [] | no_license | from pathlib import Path
import urllib.request
site = 'https://pt.wikipedia.org'
def html_encode(text):
letters = []
for byte in text.encode('utf-8'):
if byte == 0x20: # Space
letter = '_'
elif 0x20 <= byte <= 0x7E: # Printable ASCII range
letter = chr(byte)
e... |
Python | UTF-8 | 3,882 | 3.59375 | 4 | [
"MIT"
] | permissive | """
A demonstration of what can be done with SimpleSim
Runs a simulation of the front counter of a restaurant,
which is a single-server system (M/G/1) in this case
Customers arrive in groups according to the Poisson process at a
specified rate (lambda) and pay for their meal first
The amount of customers in a grou... |
Markdown | UTF-8 | 2,758 | 3.015625 | 3 | [] | no_license | ---
layout: post
title: "Debugging Javascript"
date: 2012-08-04 15:19
comments: true
categories: Javascript
---
讀了一個很棒的 JavaScript/jQuery Debug [投影片](http://fixingthesejquery.com),
做個筆記。
首先,要認識各個瀏覽器的 Debugger。
Firefox,Chrome,甚至 IE,都有它們自己的 Debugger。
這些 Debugger 長得都很像,熟悉了其中一種,其他都大同小异。
各個 Debugger 預設的啟動快捷鍵大都是`F12`。
Fir... |
Python | UTF-8 | 478 | 2.609375 | 3 | [] | no_license | import os
from pathlib import Path
import shutil
def host_replace(path):
os.rename('C:\Windows\System32\drivers\etc\hosts', 'hosts.bak')
shutil.copyfile(path, 'C:\Windows\System32\drivers\etc\host')
def host_recover():
file = Path('C:\Windows\System32\drivers\etc\hosts.bak')
if file.is_file():
... |
Shell | UTF-8 | 516 | 3.4375 | 3 | [] | no_license | #!/bin/sh
############################################################
# Dockerfile to build Data Volume Container images
# Based on Ubuntu
############################################################
# Set the base image to Ubuntu
FROM ubuntu
# File Author / Maintainer
MAINTAINER Ashish Kashinath
#Mounting the Vol... |
Java | UTF-8 | 822 | 1.890625 | 2 | [
"Apache-2.0"
] | permissive | package com.mfx.blog.dao;
import com.mfx.blog.modal.entity.PermissionDO;
import com.mfx.blog.modal.vo.PermissionRouteMap;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author zhuxiaolong
*/
@Mapper
public interface Permi... |
Java | UTF-8 | 14,710 | 1.75 | 2 | [] | no_license | package com.hbrb.spider.pageprocessor;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.atomic.AtomicIntegerArray;
import java.util.regex.Matcher;
import java.util.reg... |
Markdown | UTF-8 | 2,402 | 3.21875 | 3 | [
"MIT"
] | permissive | # Purses.jl 👛
[](https://dalum.github.io/Purses.jl/dev)
[](https://travis-ci.org/dalum/Purses.jl)
[](https://codecov... |
C# | UTF-8 | 5,375 | 2.578125 | 3 | [] | no_license | using UnityEngine;
using System.Collections.Generic;
using System.Collections;
public class LandscapeScript : MonoBehaviour
{
// The array of the landscape map
public float[,] landscape;
// The level of the landscape
public int level;
// The initial seed value
public float seed;
public flo... |
Python | UTF-8 | 1,386 | 3.09375 | 3 | [] | no_license | #!/usr/bin/env python3.8
import requests
import sys
import json
import os
import re
from argparse import ArgumentParser
parser = ArgumentParser(description='Accepts a URL and destination file name, write the contents of the page to the destination')
parser.add_argument('url', help='url of the page to be saved')
pars... |
C# | UTF-8 | 1,706 | 2.890625 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/**
Data structure to hold info about a pinned lobby option.
*/
public class Pinned
{
public int page = 0;
public int x = 0;
public int y = 0;
public int width { get; private set; }
public int height { get; private set; }
public str... |
C | UTF-8 | 3,405 | 3.265625 | 3 | [] | no_license | /*
Author: Joshua Kluthe
Description: This program unit tests the card "Smithy" found in dominion.c
*/
#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
//verbose = 1 for print statements
#define VERBOSE 0
int compare(... |
Python | UTF-8 | 1,012 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env python
from __future__ import print_function
import sys, pdb
import numpy as np
def war(l):
d= np.array(l)
troop = np.zeros_like(d)
troop[0]=1
#pdb.set_trace()
for i in range(1, len( l )):
j = i-1
if d[i] < d[j]:
if troop[j] > 1:
troop[i]=1
else:
troop[i]=1
while (d[j]... |
Python | UTF-8 | 108 | 3.0625 | 3 | [] | no_license | import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5, 6]
y = [1, 2, 3, 4, 5, 6]
plt.plot(x,y)
plt.show() |
C++ | UTF-8 | 2,175 | 3.25 | 3 | [] | no_license | /*
看到这道题的时候有木有感觉看到了一种数字三角形的感觉?
其实就是一个变形了
只不过是把向前的三种走法变成了同一行的左右不走三种走法
所以我们先来考虑第二问
不可能接到的礼物这里需要注意有两种情况
首先是H%v!=0 这样的话它不可能在某个整秒时间恰好落在格点上自然也不可能取到
还有就是abs(r-P)>t+(H/v) 意思就是下落距离太大了哪怕一直向那个方向走也赶不上
然后我们建立价值图
w[i][j]表示在第i时间在第j格所能取到的价值
那么我们注意单独处理每个物品的时候
我们先判断有没有可能取到
如果可以取到的话我们就可以加入价值中去
w[t+H/v][r]+=s同时记录下所有可以接到的物品的最大... |
Python | UTF-8 | 389 | 4.21875 | 4 | [
"MIT"
] | permissive | num = int(input('Informe um numero inteiro: '))
tot = 0
for c in range(1, num+1):
if num % c == 0:
print('\033[33m', end=' ')
tot += 1
else:
print('\033[31m', end=' ')
print(f'{c}', end=' ')
print(f'\n\033[mO numero {num} foi divisivel {tot} vezes.')
if tot == 2:
print(f'O numero... |
PHP | UTF-8 | 2,033 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace App\Http;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\UriInterface;
interface RouterInterface
{
/**
* @param ServerRequestInterface $current_request
*/
public function setCurrentRequest(ServerRequestInterface $current_request): void;
/**
* @return Serv... |
PHP | UTF-8 | 1,337 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Console\Commands;
use App\Http\Controllers\EnvioDiario;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
class EnvioAutomatico extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:e... |
Python | UTF-8 | 11,789 | 2.75 | 3 | [] | no_license |
# coding: utf-8
# In[371]:
import matplotlib.pyplot as plt
import random
import numpy as np
import time
import copy
import array as arr
# In[372]:
W=6;
L=6;
n=W*L*12;
S=np.zeros((n,3));
Pe=0.1;
s0=[1,3,5];
s1=[5,4,2];
s1n=[5,5,4];
s2=[5,4,2];
# In[373]:
#####1a
# In[374]:
for i in range(n):
S[i][0... |
Python | UTF-8 | 981 | 3.71875 | 4 | [] | no_license | import random, time
def partition(arr, low, high):
i = (low - 1)
pivote = arr[high]
for j in range(low, high):
if arr[j] <= pivote:
i = i + 1
arr[i], arr[j] = arr[j], arr[i]
arr[i + 1], arr[high] = arr[high], arr[i + 1]
return (i + 1)
def Qui... |
Java | UTF-8 | 1,805 | 3.25 | 3 | [] | no_license | /**
* Dec 27, 2015 7:35:10 PM
* PrjName: Cf337B
* @semprathlon
*/
import java.io.*;
import java.util.*;
public class Main {
static Vector<Integer> v=new Vector<>();
public static void main(String[] args) throws IOException{
InputReader in=new InputReader(System.in);
PrintWriter out=new PrintWriter(System.out)... |
C++ | UTF-8 | 737 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | #include "add.h"
#include <cmath>
#include <boost/random.hpp>
namespace math
{
int add(const int a, const int b)
{
constexpr size_t RV_SIZE = 100;
std::vector<double> random_values(RV_SIZE);
boost::random::mt19937 gen;
boost::random::uniform_real_distribution<double> dist(0.0,... |
Markdown | UTF-8 | 9,260 | 3.21875 | 3 | [] | no_license | ### Loading and preprocessing the data
1.Load the data (i.e. read.csv())
download.file("http://d396qusza40orc.cloudfront.net/repdata%2Fdata%2Factivity.zip", "activity.zip")
unzip("activity.zip")
rawdata <- read.csv("activity.csv", header=TRUE, sep = ",", dec = ".")
2.Process/transform the data (if necess... |
Markdown | UTF-8 | 599 | 2.53125 | 3 | [] | no_license | # SchoolForumAPP
SchoolForumAPP<br>
该项目使用了HttpURLConnection进行联网,发帖时使用json进行数据传输,将帖子 信息传输到服务器端使用传参的输出流,相反从后台传过来的参数使用InputStream输入流来接受。<br>
会员模块的实现中,设计了UserAction类,编写了UserDAO以达到对数据库访问的目的。 <br>
项目整体使用了两个适配器,分别为MainAdapter、LookAdapter作为主界面和帖子界面的适配器,分别重写了getView方法,处理了listview中每个item的布局用来显示每个帖子。<br>
|
C | UTF-8 | 1,799 | 2.625 | 3 | [] | no_license | #ifndef __MYZ_H__
#define __MYZ_H__
// for boolean type
typedef int myzBoolean;
#define MYZ_TRUE (1 == 1)
#define MYZ_FALSE (! MYZ_TRUE)
// for 'ForEach'
#ifndef ForEach
#define ForEach(var, start, end) for(var=start; var<=end; var++)
#endif //ForEach
#ifndef rForEach
#define rForEach(var, start, end) for(var=star... |
Python | UTF-8 | 396 | 3.84375 | 4 | [] | no_license | import matplotlib.pyplot as plt
data_x = [2, 6]
data_y = [81, 91]
a = (data_y[1]-data_y[0]) / (data_x[1]-data_x[0])
b = data_y[1]-data_x[1]*a
print(f'직선 y = {a}x+{b}')
# (x, y1)과 직선 사이의 오차를 보고 이를 줄여나가는 것이 목표.
x = [2, 4, 6, 8]
y1 = [81, 93, 91, 97]
y2 = [a*i+b for i in x]
fig, ax = plt.subplots()
plt.scatter(x, y... |
JavaScript | UTF-8 | 3,227 | 2.625 | 3 | [] | no_license | let info = {
"About": [{
"Title": "5x Chico - O Velho e Suas Histórias",
"Directorcall": "Directed by:",
"Director": "Ana Rieper, Camilo Cavalcante, Eduardo Goldenstein, Eduardo Nunes e Gustavo Spolidoro",
"Descriptioncall": "About the movie:",
"Descriptio... |
JavaScript | UTF-8 | 1,557 | 2.703125 | 3 | [] | no_license | $(document).ready(function(){
//click function targets tags on the testimonlial page
$(document).on("click", ".down-arrow", function(){
var parent= $(this).parent();
parent.children(".collapse-text").slideToggle(500);
});
//click function targets tags on the testimonlial page
$(document).on("click", "... |
Python | UTF-8 | 2,571 | 2.625 | 3 | [] | no_license | '''
Memcached version of Google App Engine asynchronous urlfetch.
Just get the returned rpc object and use it as it was the original one.
Author: fjsj - flaviojuvenal@gmail.com
'''
from google.appengine.api import urlfetch, memcache
from google.appengine.api.urlfetch import GET
import simplejson as json
import logging... |
Markdown | UTF-8 | 2,452 | 3.171875 | 3 | [] | no_license | +++
issue = "014"
title = "Allowing Mistakes, Deceiving Marks"
author = "Lindsey Hack"
date = "2009-03-09"
+++
**What is your favorite 'move' for breaking the mark? How do you do it, and in
what situations do you find it most useful?**
To break the mark, I typically like to convince, or deceive, the mark that I
a... |
TypeScript | UTF-8 | 4,592 | 2.78125 | 3 | [] | no_license | import MathHelpers from "../MathUtilities";
import { ItemConsumable, ItemEquip } from "./Item";
export class Drop {
public Id: number;
public Name: string;
public GoldP1 : number;
public GoldP2 : number;
public GoldP3 : number;
public ConsumP1 : number;
public ConsumP2 : number;
public ... |
Java | UTF-8 | 2,494 | 2.34375 | 2 | [
"MIT"
] | permissive | package com.library.mslibrary.ws.controller;
import com.library.mslibrary.api.ApiRegistration;
import com.library.mslibrary.config.ApplicationPropertiesConfig;
import com.library.mslibrary.entities.Book;
import com.library.mslibrary.service.BookService;
import com.library.mslibrary.ws.exception.NoSuchResultExcep... |
Python | UTF-8 | 1,588 | 3.5625 | 4 | [] | no_license | #!/usr/bin/env python
'''
Problem: https://community.topcoder.com/stat?c=problem_statement&pm=1889
Author: Paras Chetal
Enrollment No. 15114049
'''
def main():
arr = [[0 for x in range(0, 101)] for y in range(0, 101)]
width = int(input("Width: "))
height = int(input("Height: "))
bad = []
print("En... |
Python | UTF-8 | 6,233 | 3.15625 | 3 | [] | no_license | # write your code here
import re
from collections import deque
def process_math_operation(math_operation):
final_operation = math_operation[0]
if final_operation == '-':
for i in range(1, len(math_operation)):
if final_operation == '-':
final_operation = '+'
eli... |
JavaScript | UTF-8 | 1,801 | 3.046875 | 3 | [
"MIT"
] | permissive | // 1. The easiest way to initialize flickity is by passing the data-flickity attribute a valid JSON with valid parameters in your html. But this is just TOO EASY for a beginner because it doesn't use any JS at all
// data-flickity='{ "cellAlign": "left", "contain": true, "initialIndex": "0", "freeScroll": "false" }'
... |
C++ | UTF-8 | 6,208 | 2.90625 | 3 | [
"MIT"
] | permissive | //
// Created by alice on 23.04.21.
//
#ifndef LDPC4QKD_HELPERS_FOR_TESTING_HPP
#define LDPC4QKD_HELPERS_FOR_TESTING_HPP
#include <fstream>
#include <iostream>
#include <random>
namespace HelpersForTests {
using Bit = bool;
/*!
* This is only used for the tests to verify agreement between vectors loaded by
*... |
C++ | UTF-8 | 270 | 2.640625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n; cin >> n;
int ans = 0;
for (char cur, prev = ' '; n--; prev = cur)
{
cin >> cur;
if (cur != prev) continue;
else ++ans;
}
cout << ans << endl;
}
|
Java | UTF-8 | 587 | 2.21875 | 2 | [] | no_license | package ru.kuzmina.service;
import ru.kuzmina.model.WebBookFilter;
import ru.kuzmina.model.WebPhoneBook;
/**
* Канальный сервис для работы с книгой
*/
public interface PhoneBookWebService {
/**
*
* Получение книги по
* @param filter фильтрация
* @return кинга
*/
WebPhoneBook getPho... |
PHP | UTF-8 | 988 | 2.609375 | 3 | [] | no_license | <?php
namespace GergelyPolonkai\SmsSenderBundle\Model;
use Doctrine\ORM\Mapping as ORM;
/**
* Entity to spool SMS messages
*
* @ORM\MappedSuperclass
*/
class SpooledSms
{
/**
* The recipient's mobile phone number
*
* @var string $recipient
*
* @ORM\Column(type="string", length=30, nul... |
TypeScript | UTF-8 | 2,079 | 2.578125 | 3 | [
"MIT"
] | permissive | import * as vscode from 'vscode';
import opn = require('open');
/**
* Activates the extension.
*/
export function activate(context: vscode.ExtensionContext): void {
const controller = new OpenController();
context.subscriptions.push(controller);
}
/**
* Controller for handling file opens.
*/
class OpenControl... |
Java | UTF-8 | 1,080 | 2.09375 | 2 | [] | no_license | package com.reliant.nest.test;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
public class Digest3 {
public... |
Java | UTF-8 | 5,547 | 1.984375 | 2 | [] | no_license | /*
* Copyleft 2007-2011 Ozgur Yazilim A.S.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* http://www.gnu.org/licenses/lgpl.html
*
* www.tekir.com.tr
* www.ozguryazilim.com.tr
*
*/
package com.ut.tekir.stock;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Ma... |
C | GB18030 | 1,133 | 4.03125 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
//дһжһַǷΪһַתַ֮
//
//磺s1 = aabcds2 = bcdaa1
//s1 = abcds2 = acbd0.
//
//aabcdһַõabcda
//aabcdַõbcdaa
//aabcdһַõdaabc
//תַ 1 , 0
int Isrotatingstr(char arr[], char str[]) {
char arr1[1024] = { 0 };
strcpy(arr1, arr); //ַ , Ѻַ(arr) ֵ ǰַ(ar... |
Java | UTF-8 | 8,406 | 2.171875 | 2 | [] | no_license | package com.bobmowzie.mowziesmobs.server.world.feature.structure;
import com.bobmowzie.mowziesmobs.server.config.ConfigHandler;
import com.mojang.serialization.Codec;
import net.minecraft.util.Direction;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Mutable... |
JavaScript | UTF-8 | 1,359 | 2.734375 | 3 | [] | no_license | /*importar as configurações do servidor*/
var app = require("./config/server.js");
/* parametrizar a porta de escuta */
var server = app.listen(8081, function(){
console.log("Server ON");
});
/*instanciar websocket e coloca-lo ouvindo a mesma porta da aplicação*/
var io = require("socket.io").listen(server);
/*defi... |
Markdown | UTF-8 | 4,789 | 3.0625 | 3 | [] | no_license | # ISLR: Chapter 2
## Conceptual questions
1. Flexible vs. Inflexible
A. (flexible is worse) For large n and small p, we are in danger of overfitting if we use a model that is too flexible. We could eliminate bias, but we would do so at the cost of high variance. I would advocate for using an *inflexible* model
B.... |
PHP | UTF-8 | 760 | 2.609375 | 3 | [] | no_license | <?php
session_start();
include 'database.php';
$conn = getDataBaseConnection();
$username = $_POST['username'];
$password = sha1($_POST['password']);
$sql = "SELECT *
FROM admin
WHERE userName = :username
AND password = :password" ;
$namedParameters = array();
$namedParameters[':usern... |
Java | UTF-8 | 853 | 2.359375 | 2 | [] | no_license | package pl.agh.bookstore.model;
public class OrderDetails {
private int order_id;
private int book_id;
private double unitprice;
private int quantity;
private double discount;
public int getOrder_id() {
return order_id;
}
public void setOrder_id(int order_id) {
this.order_id = order_id;
... |
Python | UTF-8 | 478 | 3.375 | 3 | [] | no_license | #PF-Assgn-33
def find_common_characters(msg1,msg2):
common_characters=''
for i in msg1:
if i in msg2 and i!=" " and (i not in common_characters):
common_characters+=i
if(len(common_characters)>0):
return common_characters
else:
return -1
#Provide... |
Python | UTF-8 | 1,174 | 2.75 | 3 | [] | no_license | from evolver import *
from toolkit import simplify, Multiplication
from selection import ElitistSelection, StochasticUniversalSampling
def fitness(tree):
fit = 0
for data in generateDataSet(lambda x: 2*x+1+x, 50):
if tree.evaluate(data[0])==data[1]:
fit+=1
return fit
def generateDa... |
C# | UTF-8 | 4,446 | 2.671875 | 3 | [] | no_license | using RezerwacjaSal;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
usin... |
JavaScript | UTF-8 | 2,574 | 2.875 | 3 | [] | no_license | const app = new PIXI.Application();
document.body.appendChild(app.view);
app.stop();
// loader option to specify textures
let atlasLoaderOptions = { metadata: {
images: {
"page_0": PIXI.BaseTexture.fromImage(spriteTextureLink),
"page_1": PIXI.BaseTexture.fromImage(spriteWeaponLink)
}
}};
// load s... |
Java | UTF-8 | 128 | 1.617188 | 2 | [] | no_license | class First_Module
{
public static void main(String args[])
{
System.out.println("This is my first module for my project");
}
}
|
Ruby | UTF-8 | 9,254 | 2.8125 | 3 | [] | no_license | class IssueAPIController < ApplicationController
# /api/v1/issue
before do
if request.post? or request.patch? or request.put?
payload_body = request.body.read
@payload = JSON.parse(payload_body).symbolize_keys
puts "---------> Here's our payload: "
pp @payload
end
end
# ============== Issues on... |
JavaScript | UTF-8 | 722 | 2.75 | 3 | [] | no_license | define(function(require) {
var easel = require("easel");
return {
// Dimensions
'height': 800,
'width': 940,
// Framerate
'framerate': 60,
'frameinterval': 10,
'speedPerTick': .75,
// Text
fontNormal: "13px 'Helvetica Neue', Helvetica, Arial, sans-serif",
fontBold: "bold 13px 'Helvetica Neue',... |
Java | UTF-8 | 1,687 | 2.015625 | 2 | [] | no_license | package me.mortuza.edetailingclone;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.util.Linkify;
import android.wi... |
JavaScript | UTF-8 | 7,008 | 2.609375 | 3 | [] | no_license | import React from 'react';
import books from './books.json';
import endings from './endings.json';
import image0 from './assets/0.jpg';
import image1 from './assets/1.jpg';
import image2 from './assets/2.jpg';
import image3 from './assets/3.jpg';
import './books.css';
import StarRatingComponent from 'react-star-rating-... |
Swift | UTF-8 | 604 | 2.546875 | 3 | [
"MIT"
] | permissive | //
// SecurityCode.swift
// SwiftAsyncWebsocket
//
// Created by chouheiwa on 2019/2/1.
// Copyright © 2019 chouheiwa. All rights reserved.
//
import Foundation
func randomData(_ length: Int) -> Data {
let data = Data(count: length);
let result = Security.SecRandomCopyBytes(kSecRandomDefault,
... |
C# | UTF-8 | 862 | 3.5625 | 4 | [] | no_license | using System;
using System.Globalization;
namespace lacofor
{
class Program
{
static void Main(string[] args)
{
Console.Write("Informe a quantidade de casos de testes: ");
int N = int.Parse(Console.ReadLine());
for (int i = 1; i <= N; i++)
... |
Markdown | UTF-8 | 3,985 | 2.953125 | 3 | [] | no_license | #7750
如何发挥主动性又遵守规则
小男孩和小女孩的区别
小男孩:跑步、照相
如何把小男孩聚拢起来
#7751
点评田野笔记
关于田野笔记:要写的具体,好记性不如烂笔头
性别区隔较大,如何形成一个团队
小女孩,弱视,于是给了她可以摸的书,打开了小女孩的内心。可以作为典型个案重点关注
- 小朱:观察是为了看被观察者自己的态度
信息学院做了什么
#7752
对比的视角
多问一句两句可以引出很多新的由头
六年级的小朋友去做小志愿者的能力没有问题,但是如何调动积极性是一个问题
如何挖掘六年级的主体性是一个问题
**身体**的重要性,身体的接触也是意识的认同
效果好的活动可以推广到其他组
第一次组队不管怎样,认识就好,下次活动不会更... |
Java | UTF-8 | 3,453 | 2.515625 | 3 | [] | no_license | package com.accenture.web.servlet;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Ht... |
PHP | UTF-8 | 2,389 | 2.671875 | 3 | [] | no_license | <?php session_start(); ?>
<!DOCTYPE html>
<html>
<head>
<titre>Informations</titre>
</head>
<body>
<!-- Menu de navigation
<?php include 'menu_navigation.php'; ?>
-->
<form method="post">
Votre nom :
<input type="text" name="nom" id="nom" placeholder="Nom" required>
<br />
Votre Entreprise :
<input... |
PHP | UTF-8 | 667 | 3.0625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
class checkSpam
{
public $spamStr = 'FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG';
/**
* is include spam string data?
* @param string $str
* @return boolean
*/
public function isSpamData($str = '')
{
if (empty($str)) {
return false;
}
return (strpos($str, $this->spamStr) !== false) ? true : false;
... |
Swift | UTF-8 | 971 | 2.515625 | 3 | [] | no_license | //
// API.swift
// AliceX
//
// Created by lmcmz on 19/7/19.
// Copyright © 2019 lmcmz. All rights reserved.
//
import Foundation
import HandyJSON
import Moya
import PromiseKit
public protocol BasicResponseProtocol: HandyJSON {}
enum MyError: Error {
case FoundNil(String)
}
func API<T: HandyJSON, U: TargetT... |
Markdown | UTF-8 | 4,927 | 3.09375 | 3 | [] | no_license | Httpdoc is a very simple documentation generator for generating public API documentation for an HTTP-based web service, parsed from comments embedded in Ruby source code. It's API philosophy-agnostic and supports REST and such if you like. For example, an HTTP API can be described like so:
## List stuff.
#
... |
C# | UTF-8 | 3,728 | 3.0625 | 3 | [] | no_license | using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.InteropServices;
using System.Threading;
using ConwaysGameOfLifeKata.Kata;
namespace ConwaysGameOfLife.Kata
{
class Program
{
static void Main()
{
ExecuteConwaysGameOfLife();
}
private ... |
Shell | UTF-8 | 686 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
# setup Go paths
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
echo "export GOROOT=$GOROOT" >> ~/.bashrc
echo "export GOPATH=$GOPATH" >> ~/.bashrc
echo "export PATH=$PATH" >> ~/.bashrc
mkdir $GOPATH
# install golint, gvt & Glide
go get -u github.com/golang/li... |
C++ | UTF-8 | 4,293 | 3.875 | 4 | [] | no_license | #include <iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node(int val)
{
data = val;
next = NULL;
}
};
int getlength(node* &head) {
int count = 0;
node *temp=head;
while(temp->next!=head){
temp=temp->next;
count++;
}
r... |
C++ | UTF-8 | 260 | 3.078125 | 3 | [] | no_license | #include<iostream>
void print(const int ia[]);
int main(int argc,char **argcv)
{
int ia[10];
for(int i=0;i<10;i++)
ia[i]=i;
print(ia);
}
void print(const int ia[10])
{
for(size_t i=0;i!=10;++i)
std::cout<<ia[i]<<std::endl;
}
|
Markdown | UTF-8 | 660 | 2.609375 | 3 | [
"BSD-2-Clause"
] | permissive | > this is a document for seqlist
for seqlist, I design for a array list in first.
so arraylist support thoes function:
```
bool insertVal(int pos,int val);
bool deleteVal(int pos,int *val);
bool modifyVal(int pos,int val);
bool getVal(int pos,int *val);
```
> just like add and reduce and modify and get four opera... |
Shell | UTF-8 | 2,087 | 3.453125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | #!/bin/sh
#
# Copyright 2020 Google LLC
#
# 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 | 2,706 | 2.953125 | 3 | [
"MIT",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"Apache-2.0",
"UPL-1.0"
] | permissive | ---
title: "Runnning OIG Utilities"
weight: 3
pre : "<b>3. </b>"
description: "Describes the steps for running OIG utilities in Kubernetes."
---
Run OIG utlities inside the OIG Kubernetes cluster.
### Run utilities in an interactive bash shell
1. Access a bash shell inside the `oimcluster-oim-server1` pod:
```ba... |
Markdown | UTF-8 | 1,881 | 3.046875 | 3 | [] | no_license | # 租房子也要找仲介
我現在覺得租房子實在要找仲介幫忙弄。方便太多了。雖然要付半個月服務費,但真是解決太多麻煩事了。
解決事情包括:
#### 1. 跟房東談租金...
仲介幫我殺價,主動談到我心目中一個合理的價格。
#### 2. 跟房東談判很難凹的事情
591 上我看到的是有一些家具的,上面有別人問可不可以不要那些家具,但他們被拒絕了。我實際表明想租,仲介幫我凹到房東說可以扔掉或搬走,然後仲介自己會幫我處理掉那些家具。(仲介私下會幫手上的案件交流掉搬家家具,於是我得到了一套新餐椅,然後送走一張床和一個書桌)
另外我覺得客廳的冷氣和臥房的冷氣舊了蠻吵的,然後臥房的壁紙也變色了。最後也是凹到換兩台新的冷氣和整個臥房重漆... |
Java | UTF-8 | 13,601 | 2.125 | 2 | [] | no_license | package astrocloud.zw.co.astrocloud.adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
impor... |
JavaScript | UTF-8 | 918 | 3.890625 | 4 | [
"MIT",
"BSD-3-Clause"
] | permissive | // Color each point
function fillVoronoi (tiles, players) {
/*
Modify the `site` property of *each* tile according to be a *reference* to one of the players
given as parameter. The tile must be in that player's Voronoi site.
ex:
tiles[0].site = players[0];
tiles[1].site = players[1];
Then... |
Markdown | UTF-8 | 6,081 | 3.796875 | 4 | [] | no_license | # Chapter 43
# Channels
A channel is an easy way to use many threads that send to one place. You can create a channel in Rust with ```std::sync::mpsc```. ```mpsc``` means "multiple producer, single consumer", so "many threads sending to one place". To start a channel, you use ```channel()```. This creates a ```Sender`... |
C# | UTF-8 | 10,300 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
namespace PHTC.Model
{
[Serializable]
public class TemperatureCalculate
{
double temperature;
Class1Bou... |
Python | UTF-8 | 1,532 | 4.21875 | 4 | [] | no_license |
def compare_content(item1, item2):
return item1 == item2
def compare_content_list(list1, list2, compare_order=True):
"""Compare 2 list if content is already inside other list or not
list1 = [1,2,3]
list2 = [1,2,3]
list 3 = [3,1,2]
list4 = [1,2,3,1]
-> compare_content_list(list1, list2) ... |
C++ | UTF-8 | 146 | 2.75 | 3 | [] | no_license | #include "Unit.h"
#include <iostream>
Unit::Unit(size_t x, size_t y)
:x(x), y(y), type(eNone)
{
std::cout << "Call Ctor Unit x,y" << x << y;
}
|
Python | UTF-8 | 1,080 | 3 | 3 | [] | no_license | #!/usr/bin/python3
import sys
sys.path.append("yig_filter_bank_controller/py/")
import yig_controller
class VoltageGenerator:
def __init__(self, dev):
self.c = yig_controller.YigController(dev)
self.setA(0)
self.setB(0)
def setA(self, value):
self.c.yigA.set(6, int(32767*value... |
Go | UTF-8 | 127 | 2.859375 | 3 | [] | no_license | package main
import (
"fmt"
"time"
)
func main() {
for i:=0; i<10; i++ {
go fmt.Println(i)
}
time.Sleep(time.Second)
} |
TypeScript | UTF-8 | 614 | 2.65625 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { User } from './user';
@Injectable()
export class UsersService {
users: User[] = [
{ name: 'Santiago', lastName: 'Losada Borrajo', country: 'España', email: 'email@string.com' },
{ name: 'Jason', lastName: 'Franco Quinteiro', country: 'España', email: 'yeah... |
JavaScript | UTF-8 | 753 | 4.03125 | 4 | [] | no_license | function text(str) {
let counter = 0;
for (let i = 0; i < str.length; i++) {
if (str[i] === '(') {
counter++;
}
else if (str[i] === ')') {
counter--;
if (counter < 0) {
return false;
}
}
}
return counter === ... |
C# | UTF-8 | 2,728 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace HBS.Data.Entities.TimeTracking.Models
{
public class CustomTimeTrack
{
public CustomTimeTrack()
{
DailyTimeTracks = new List<DailyTimeTrack>();
}
public string EmployeeName { get; set; }
... |
C++ | UTF-8 | 6,985 | 2.921875 | 3 | [] | no_license | #include <bits/stdc++.h>
//Ques-1 Spiral matrix
vector<vector<int> > Solution::prettyPrint(int A) {
int n = 2*A-1;
int t = 0, l = 0;
int b = n-1, r = n-1;
int count = 0, k;
vector<vector<int>> res(n, vector<int>(n, 0));
//We will go in spiral until we get count = n*n or A=0
while(l<=r and t... |
Java | UTF-8 | 2,407 | 2.3125 | 2 | [] | no_license | package com.comtech.pos_system1.builder;
import com.comtech.pos_system1.dto.CustomerDto;
import com.comtech.pos_system1.dto.ItemDto;
import com.comtech.pos_system1.dto.OrderDTO;
import com.comtech.pos_system1.dto.OrderDetailDTO;
import com.comtech.pos_system1.entity.Customer;
import com.comtech.pos_system1.entity.Item... |
Python | UTF-8 | 1,231 | 4.1875 | 4 | [] | no_license | import random
print("\tДобро пожаловать в игру 'Отгадай число'!")
print("Компьютер загадал натуральное число из диапазона от 1 до 100.")
print("Вам нужно угадать его за максимум 5 попыток.\n")
# Начальные значения
the_number = random.randint(1, 100)
guess = int(input("Ваше предположение: "))
tries = 0
# Цикл отга... |
JavaScript | UTF-8 | 4,479 | 2.796875 | 3 | [
"MIT"
] | permissive | 'use strict'; // jshint ignore:line
// jshint esversion: 6
/* globals require: true, __dirname: true, process: true, console: true, module: true */
var BitFinexAPI = require('.');
var options = {
events: false,
refresh: 10, // Refresh time in seconds (Default: 60)
currency: 'USD' // Convert price t... |
Java | UTF-8 | 2,697 | 2.03125 | 2 | [] | no_license | package com.fire.broadcastdemo.ui;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import com.fire.broadcastdemo.R;
/**
* 静态注册广播,常驻类型。检测网络连接状态
*/
public class MainActivity extends AppCompatActivity {
@Override
protected v... |
Swift | UTF-8 | 1,340 | 2.90625 | 3 | [] | no_license | //
// FinalView.swift
// SwiftUI_EnvironmentObject
//
// Created by Seogun Kim on 2021/05/16.
//
import SwiftUI
struct FinalView: View {
@EnvironmentObject var viewModel: EnvironmentViewModel
var body: some View {
ZStack {
AngularGradient(gradient:
Gradie... |
Java | UTF-8 | 11,201 | 2.734375 | 3 | [] | no_license | package codeelit.datascience;
import android.graphics.drawable.ColorDrawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import java.util.ArrayList;
import jav... |
Java | UTF-8 | 4,894 | 2.140625 | 2 | [] | no_license | package com.example.olahbence.sporttracker.Friends.Search;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.example.olahbence.spor... |
Ruby | UTF-8 | 1,807 | 3.640625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
#
# @lc app=leetcode id=449 lang=ruby
#
# [449] Serialize and Deserialize BST
#
# https://leetcode.com/problems/serialize-and-deserialize-bst/description/
#
# Serialization is the process of converting a data structure or
# object into a sequence of bits so that it can be stored in a file or
# m... |
Java | UTF-8 | 3,163 | 2.375 | 2 | [] | no_license | package com.example.mobfinalmenuplusnavbar.db;
import com.example.mobfinalmenuplusnavbar.R;
import java.util.ArrayList;
import java.util.List;
public class Icon {
private String name;
private int id;
static ArrayList<Icon> categoryIcons;
static ArrayList<Icon> accountIcons;
public Icon(String na... |
Python | UTF-8 | 736 | 2.671875 | 3 | [
"MIT"
] | permissive | import pandas as pd
from binance.client import Client
import pprint, talib, Config
def get_hist_indicator(ma_period):
"""Get historical values of indicator on booting
"""
my_mod = Client(Config.API_KEY, Config.API_SECRET)
my_mod.API_URL = Config.API_URL
candlesticks = my_mod.get_historical_klines("... |
Ruby | UTF-8 | 135 | 3.15625 | 3 | [] | no_license | class Grains
def self.square(n)
2**(n - 1)
end
def self.total
1.upto(64).reduce { |sum, s| sum + 2**(s - 1) }
end
end
|
Java | UTF-8 | 378 | 2.015625 | 2 | [
"MIT"
] | permissive | package everyos.bot.luwu.core.entity.event;
import everyos.bot.chat4j.event.ChatEvent;
import everyos.bot.luwu.core.entity.Connection;
import everyos.bot.luwu.core.entity.Member;
public abstract class MemberEvent extends Event {
public MemberEvent(Connection connection, ChatEvent event) {
super(connection,... |
C++ | UTF-8 | 1,009 | 3.125 | 3 | [] | no_license | #include <omp.h>
#include <cstdio>
#include <cstdlib>
void main()
{
double v1[100];
double v2[100];
double v3[100];
double v4[100];
for (int i = 0; i < 100; i++)
{
v1[i] = i;
v2[i] = i * 2.0;
v3[i] = 0;
v4[i] = 0;
}
printf("[COMIENZO]\n");
#pragma omp parallel num_threads(4)
{
int id = omp_get_th... |
Markdown | UTF-8 | 18,323 | 2.546875 | 3 | [
"MulanPSL-2.0",
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ---
---
---
title: 十六、宋义布的局,项羽把他杀了也没能走出去
---
《三国演义》里脍炙人口的改编之一,魏国司徒王朗榜上有名。罗贯中给他增加了两段历史上没有的剧情。其中最有名的自然是诸葛亮骂死王朗,这段原创剧情随着年青一代“鬼畜文化”的兴起可谓人尽皆知。
另一段知名度略小一些,但读起来更让人惊讶:孙策平定东南时,当时镇守一方的王朗曾经“拍马舞刀”,和太史慈廛战。
看来,王司徒年轻时武力很强大,能和太史慈单挑而不分胜负。可惜他老了之后就打不动了,只能靠嘴大战诸葛亮,还落得个惨败。
王朗这一场文斗一场武斗,都属于罗贯中给他加的戏。但历史上还真有这么一个人,年轻时候在游侠圈里是顶级存在,曾经参与荆轲刺秦时... |
Markdown | UTF-8 | 6,066 | 2.828125 | 3 | [] | no_license | ---
date: '2022-09-23T16:44:51+0800'
aliases: ["Set the Minimum Width of the Active Pane in Obsidian"]
---
# Set the Minimum Width of the Active Pane in Obsidian
#obsidian
**Status**:: #x
**Zettel**:: #zettel/permanent
**Created**:: [[2022-09-23]]
**Reference**:: [[Obsidian QuickAdd Plugin]]
**Reference**:: [[Obsidi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.