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 |
|---|---|---|---|---|---|---|---|
PHP | UTF-8 | 326 | 3.171875 | 3 | [
"MIT"
] | permissive | <?php
//variavel super global
//$nome = (int)$_GET["a"];
//na url após o endereço vem uma "?" ela separa as áreas
//get e post sempre vem string
//para tornar inteiro damos um "cast"
//var_dump($nome);
$ip = $_SERVER["REMOTE_ADDR"];
echo $ip;
echo "<br/>";echo "<br/>";
$nomme = $_SERVER["SCRIPT_NAME"];
echo $nomme... |
PHP | UTF-8 | 583 | 2.9375 | 3 | [] | no_license | <?php
namespace App\Classes;
abstract class Controller {
public $model;
public $view;
//Requiring a model by name
public function getModel($model) {
$model = "App\\Models\\".$model;
return new $model;
}
//Requiring a view by name and passing it data if needed
public func... |
Python | UTF-8 | 4,150 | 2.578125 | 3 | [] | no_license | # /usr/bin/python
import logging
import requests
import json
import os
database = None
mangasInfo = {}
chaptersInfo = {}
logger = logging.getLogger("mfetcher")
logger.addHandler(logging.StreamHandler())
# logger.setLevel("DEBUG")
base_mangaeden_url = "https://www.mangaeden.com/api"
base_images_url = "https://cdn.ma... |
C# | UTF-8 | 1,707 | 3.21875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Quine_McCluskey
{
public class InSet
{
public Boolean used = false; //合成に使われたか
public int[] pin; //入力情報
public int value = 0;
public Li... |
Go | UTF-8 | 1,163 | 2.78125 | 3 | [] | no_license | package shoppinglisthandler
import (
"fmt"
"net/http"
"github.com/alexandrecodigo/gorestapimysql/internal/app/grocery/repo/shoppinglistrepo"
"github.com/alexandrecodigo/gorestapimysql/internal/app/grocery/types"
"github.com/alexandrecodigo/gorestapimysql/internal/app/grocery/util"
"github.com/gin-gonic/gin"
)
... |
JavaScript | UTF-8 | 318 | 2.515625 | 3 | [] | no_license | function stageStart()
{
global.stagesCount=4;
for(var i=1;i<=global.stagesCount;i++)
{
global.stagesIndexs.push(i);
}
var stageIndex=global.stagesIndexs.splice(parseInt(global.stagesIndexs.length*Math.random()),1);
eval("stage"+stageIndex+"Define();");
global.stagesCount--;
global.currentStage.start();
}; |
JavaScript | UTF-8 | 164 | 2.75 | 3 | [] | no_license | // Adds a LI element to a list when the user
// clicks on the tag DIV#add_item
$('DIV#add_item').click(function () {
$('UL.my_list').append('<li>Item</li>');
});
|
Markdown | UTF-8 | 1,212 | 2.703125 | 3 | [
"MIT"
] | permissive | # articles
Command-line article search and tracking
Just a handy, low-maintenance tool to search thru articles by title, authors or year (and content? i forget). You manage the files on your own, and run the script as you want, no need to alert anything about changes you've made to the files.
Some much more thoughtfu... |
Python | UTF-8 | 3,423 | 3.359375 | 3 | [] | no_license | # -*- coding:utf-8 -*-
# python for data analysis 2.3 babynames data
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# names1880 = pd.read_csv('C:/Users/dell/Desktop/pydata/datasets/babynames/yob1880.txt', names=['name', 'sex', 'births'])
years = range(1880, 2011)
pieces = []
columns = ['name', ... |
Java | UTF-8 | 18,155 | 1.585938 | 2 | [] | no_license | package cn.honry.inner.statistics.monthlyDashboard.dao.impl;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;... |
C++ | UTF-8 | 3,239 | 2.578125 | 3 | [] | no_license | #ifndef _SCHEDULER_H
#define _SCHEDULER_H
#define OK 0
#define FAIL -1
#define SYSTEM_ERROR -2
#define MAIN_THREAD_ID 0
#define STACK_SIZE 4096
#define MAX_THREAD_NUM 100
#define USECS_IN_SEC 1000000
#include <iostream>
#include <list>
#include <memory>
#include <set>
#include <setjmp.h>
#include <signal.h>
#include ... |
Go | UTF-8 | 4,162 | 2.875 | 3 | [] | no_license | package handlers
import (
"database/sql"
"encoding/json"
"fmt"
"net/http"
"strconv"
"github.com/gorilla/mux"
"landing-place/models"
"landing-place/services"
)
func GetSites(w http.ResponseWriter, r *http.Request) {
rows, err := services.GetSites()
if err != nil {
fmt.Println(err)
}
defer rows.Close(... |
JavaScript | UTF-8 | 668 | 2.984375 | 3 | [
"MIT"
] | permissive | // //Vars
// postId =
// headline
// body
const editPost = (e) => {
const button = e.target
const postId = e.target.parentElement.parentElement.parentElement.dataset.postid
const headline = document.querySelector(`.id${postId} .text-section h2`).innerText
const body = document.querySelector(`.id${p... |
PHP | UTF-8 | 4,437 | 2.703125 | 3 | [] | no_license | <?php
// This file initializes Mokoala
require_once '../admin/library/com/mokoala/Mokoala.php';
if ($config->site->enable_tracking == true ) { //Tracking enabled.
$last_run = ( !empty( $config->beacon->lastrun ) ? intval($config->beacon->lastrun) : NULL ); //Get the last runtime.
$time_now = time();
... |
Java | UTF-8 | 1,737 | 2.859375 | 3 | [] | no_license | package wordsearch;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.u... |
Java | UTF-8 | 832 | 1.953125 | 2 | [] | no_license | package com.android.stanlyfang.chopstick.sample.ui.base;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import com.android.stanlyfang.chopstick.sample.R;
import dagger.android.AndroidInjection;
public a... |
C++ | UTF-8 | 2,042 | 2.890625 | 3 | [] | no_license | #include "Group.h"
Group::Group(int id, string name)
{
this->id = id;
this->name = name;
}
Group::~Group()
{
lstClient.clear();
}
string Group::getName()
{
return name;
}
void Group::setName(string name)
{
this->name = name;
}
int Group::getLstStream(vector<TCPStream*>& lstStream)
{
TCPCon... |
Python | UTF-8 | 587 | 2.71875 | 3 | [] | no_license | import mysql.connector
class MysqlMarkSixConnector():
def __init__(self):
self.mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="666666",
database="marksix")
def batch_insert_sql(self,sql,val):
mycursor = self.mydb.c... |
JavaScript | UTF-8 | 369 | 2.765625 | 3 | [
"MIT"
] | permissive | /**
* Created by Abbir on 4/19/2017.
*/
//Getting the present screen size
var size = {
width: window.innerWidth || document.body.clientWidth,
height: window.innerHeight || document.body.clientHeight
}
function adjustHeight(){
var container_element = document.getElementById('container_div');
contai... |
JavaScript | UTF-8 | 4,373 | 2.59375 | 3 | [] | no_license | var kolos = [];
var coloring = [];
var pm;
var sA;
var sS;
var sD;
var keythinga = false;
var keythings = false;
var keythingd = false;
var fadeA;
var fadeS;
var fadeD;
var payload;
var mqtt;
var reconnectTimeout = 100;
host = "mqtt.opensensors.io"
port = 443;
topic... |
Java | UTF-8 | 2,833 | 2.78125 | 3 | [] | no_license | package com.example.model.entity;
/**
* A model class for orders database table
*/
public class Order implements Entity {
private int id;
private int roomId;
private int userId;
private int daysNumber;
private int peoplesCount;
private double totalSum;
private OrderStatus status = OrderS... |
C# | UTF-8 | 3,403 | 2.640625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System;
public class sendData : MonoBehaviour {
public bool dataIsReady = false;
public string server = "localhost";
private bool refine... |
SQL | UTF-8 | 571 | 3.484375 | 3 | [
"BSD-2-Clause"
] | permissive |
-- +migrate Up
create table timing_new (
schedule_id text not null,
weekday_id integer default 0,
primary key (schedule_id, weekday_id)
);
insert into timing_new (schedule_id, weekday_id) select schedule_id, weekday_id from timing;
drop table timing;
alter table timing_new rename to timing;
-- +migrate Do... |
JavaScript | UTF-8 | 780 | 2.84375 | 3 | [] | no_license | /* --- Elements --- */
const $progressBar = document.querySelector(".wizard__progress-bar");
const $stage = document.querySelector("[data-stage='4']");
const $finishBuyBtn = document.querySelector(".finish-buyBtn");
let $finishForm = document.querySelector("#finish-form");
let $termsWarning = document.querySelector("#... |
Python | UTF-8 | 218 | 3.734375 | 4 | [] | no_license | ls = [x + 1 for x in range(5)]
def enumerator(lst):
for l in lst:
yield lst.index(l) + 1, l
for i in enumerator(ls):
print(i, end=' ')
print()
for i in enumerate(ls):
print(i, end=' ')
print()
|
C# | UTF-8 | 1,363 | 2.796875 | 3 | [] | no_license | using Domain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders ;
namespace Infraestructure.Persistance.PostgresSQL.EntityConfig
{
public class Act... |
Java | UTF-8 | 685 | 1.960938 | 2 | [] | no_license | package com.hy.wo.po;
import java.util.Date;
public class FaqRep {
private int id;
private Faq parent;
private String guy;
private String desc;
private Date cdate;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getGuy() {
return guy;
}
public void set... |
Shell | UTF-8 | 608 | 3.5 | 4 | [] | no_license | #!/bin/bash
#This script checks all mounts and will send an email alert if you reach a certain threshold
#You can add this as a cronjob to monitor all mountpoints
#mackyruiz
#
ADMIN="your@email.com"
df -h | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{print $5 " " $1 }' | while read output;
do
usep=$(echo $output | a... |
TypeScript | UTF-8 | 1,806 | 2.984375 | 3 | [] | no_license | import { err } from '../../common';
import CVImage from '../../CVImage';
import { Pixel } from '../../interfaces';
import { Perf } from '../../utils';
export function gaussian(
image: HTMLImageElement,
kernelSize: number,
sigma: number = 0
): HTMLCanvasElement {
const cvImage: CVImage = new CVImage(image);
... |
Python | UTF-8 | 489 | 3.0625 | 3 | [] | no_license | import re
def main():
pattern = re.compile(r'\d{3}[-\.\s]??\d{3}[-\.\s]??\d{4}|\(\d{3}\)\s*\d{3}[-\.\s]??\d{4}|\d{3}[-\.\s]??\d{4}|\d{3}[-\.\s]??\w{3}[-\.\s]??\w{4}')
input = open("test.txt", "r")
textToBeChanged = input.read()
results = pattern.findall(textToBeChanged)
for i in results:
p... |
Markdown | UTF-8 | 26,050 | 3.046875 | 3 | [] | no_license | ## 被疫情逼得gap year的完全菜鸡的春招之路。精烫
### author
JanShaw
### post-time
编辑于 2020-05-29 12:14:55
### content
<div class="post-topic-des nc-post-content">
<h3>
0、写在之前
</h3>
<div>
我知道,我的春招根本不算什么。和我的同学们相比,我只能说是平均水平罢了。但我觉得,我真的经历了很多很多,对我自己来说,我和三个月之前的我相比,我成长了很多很多。从一开始的懵懂无知,自暴自弃,再到后面的急躁,再到最后的淡然,再到后来的坚定。回忆起来,人终究是被社会毒打了一遍才能成长... |
C++ | UTF-8 | 736 | 3.203125 | 3 | [] | no_license | #pragma once
#include "Node.h"
#include "Capsule.h"
class AVLTree
{
private:
public:
int nodes;
int getHeight(Node* n) { return (n == nullptr ? -1 : n->height); }
int max(int left, int right){ return (left >= right) ? left : right; }
Node* root;
AVLTree();
~AVLTree() {}
Node* find(Node* root, string* word);
N... |
Java | UTF-8 | 18,161 | 2.40625 | 2 | [] | no_license | package gabrielleopoldino.tools;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLEngineResult;
import javax.net.ssl.SSLException;
import java.io.*;
import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.List;
import ja... |
SQL | UTF-8 | 511 | 2.828125 | 3 | [] | no_license | CREATE TABLE `customer` (
`id` bigint(16) unsigned NOT NULL AUTO_INCREMENT,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_by` varchar(32) NOT NULL DEFAULT '',
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_by` varchar(32) NOT NULL DEFAULT '',
`username` varchar(32) N... |
Python | UTF-8 | 2,145 | 2.71875 | 3 | [] | no_license | import random
import torch
import torch.utils.data as data
import torch.utils.data.dataset as dataset
import numpy as np
import pickle
from sklearn.preprocessing import MinMaxScaler, StandardScaler
class Nav_Dataset(dataset.Dataset):
def __init__(self):
self.full_data = np.genfromtxt('saved/training_data.... |
C++ | UTF-8 | 678 | 2.8125 | 3 | [] | no_license | #ifndef LU_DEBUG_H
#define LU_DEBUG_H
#include <iosfwd>
#include "Matrix.h"
inline
bool operator==(const Matrix &lhs, const Matrix &rhs) {
return lhs.size() == rhs.size()
and std::equal(lhs.begin(), lhs.end(), rhs.begin());
}
inline
std::ostream &operator<<(std::ostream &os, const Matrix &mat) {
... |
Java | UTF-8 | 229 | 1.898438 | 2 | [] | no_license | package services.category;
import java.util.List;
import org.springframework.stereotype.Service;
import entities.Category;
@Service
public interface CategoryService {
List<Category> findAll();
Category findById(Long id);
}
|
Python | UTF-8 | 365 | 4.03125 | 4 | [] | no_license | pizza_tooplings = ['onion','tomato']
if 'onion' in pizza_tooplings:
#这里只是一个简单的if语句,因此无论是否通过,都会继续执行下面的代码,而不是跳过后面的测试
print('只使用if的情况')
if 'tomato' in pizza_tooplings:
print('\n满足多个条件')
print('\n因为满足条件,上面的两条print都会输出')
|
C++ | UTF-8 | 925 | 2.5625 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <cstdlib>
#include <cstdlib>
using namespace std;
string a, b, list[120];
int T, n, m, cnt;
int main() {
cin >> T;
for (int t = 1; t <= T; ++t) {
cin >> n >> m;
map<string, string> ma;
for... |
PHP | UTF-8 | 4,700 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace Modules\MgTimecode\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
class MgTimecodeController extends Controller
{
/**
* Display a listing of the resource.
* @return Response
*/
public function index()
{
... |
TypeScript | UTF-8 | 357 | 3.671875 | 4 | [] | no_license | class Base
{
fun()
{
console.log("Inside Fun");
}
constructor(no1,no2)
{
console.log("Addition is : ",no1+no2);
}
}
class Derived extends Base
{
Gun()
{
console.log("Inside Derived Class")
}
}
var obj1=new Base(66,33);
// obj1.fun();
var ... |
Java | UTF-8 | 11,179 | 1.601563 | 2 | [
"Unlicense",
"CC-BY-3.0",
"LicenseRef-scancode-public-domain",
"CC0-1.0"
] | permissive | package crazypants.enderio.machine.painter.blocks;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.enderio.core.common.BlockEnder;
import crazypants.enderio.IModObject;
import crazypants.enderio.ModObject;
imp... |
Markdown | UTF-8 | 4,934 | 2.75 | 3 | [
"BSD-3-Clause"
] | permissive | ---
title: "PyGRB: A pure Python gamma-ray burst analysis package."
tags:
- python
- astrophysics
- cosmology
- gamma-ray bursts
- gravitational lensing
authors:
- name: James R. Paynter
orcid: 0000-0002-9672-4008
affiliation: 1
affiliations:
- name: School of Physics, University of Melbourne, Parkv... |
C | UTF-8 | 323 | 2.703125 | 3 | [] | no_license | #include "../inc/libmx.h"
int mx_strcmp(const char *s1, const char *s2) {
if (s1 == NULL || s2 == NULL)
return 0;
char *tmps1 = (char *) s1;
char *tmps2 = (char *) s2;
while (*tmps1 && *tmps2 && *tmps1 == *tmps2) {
tmps1++;
tmps2++;
}
return *tmps1 - *tmps2;
... |
Java | UTF-8 | 3,742 | 1.921875 | 2 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"Python-2.0",
"BSD-2-Clause"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
C# | UTF-8 | 1,882 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FlooringMastery.BLL;
using FlooringMastery.Models;
using FlooringMastery.UI.Workflows;
namespace FlooringMastery.UI
{
public class Menu
{
public void Execute()
... |
Markdown | UTF-8 | 17,284 | 2.96875 | 3 | [] | no_license | 第 27 章 管理者及其工作
是「白胡子老头儿」,还是「万能天才」──管理者如何开展工作──管理者的工作──信息:管理者的工具──善用时间──管理者的资源:人──对管理者的要求:为人正直──什么样的人才能当管理者──管理者又是教育者──管理者既要有洞察力,又要有道德责任感
为了完成任务,管理者必须善于发挥资源优势──尤其是人力资源方面的长处,以中和其短处。要创造真正的整体,只有采取这个办法。
因此,管理者必须能平衡和协调好三种企业的主要功能:管理企业、管理「管理者」以及管理员工和工作。任何决策或行动如果为了满足某个功能的需求,而削弱其他功能,那么将削弱整个企业的实力。企业的决策和行动必须能兼顾这三个领域的需求。
要创造真正的整体... |
Markdown | UTF-8 | 8,509 | 2.515625 | 3 | [] | no_license | ---
comments: true
date: "2013-12-14T00:00:00Z"
menu: true
tags:
- Notes
title: Supervisor笔记
---
Supervisor是一个C/S系统,用来监控和控制多个服务进程,只限于UNIX-like操作系统。
# 官方文档
http://supervisord.org/
# 安装
setuptools
```bash
pip install supervisor
# or
easy_install supervisor
```
# 初始使用
## 创建配置文件
需要以root身份执行
echo... |
Java | UTF-8 | 357 | 1.539063 | 2 | [] | no_license | package com.tencent.mm.plugin.talkroom.ui;
import android.os.Message;
import com.tencent.mm.sdk.platformtools.af;
class a$1 extends af {
final /* synthetic */ a scu;
a$1(a aVar) {
this.scu = aVar;
}
public final void handleMessage(Message message) {
super.handleMessage(message);
... |
Markdown | UTF-8 | 1,807 | 3.859375 | 4 | [] | no_license | # 表格操作
## 表格隔行换色
*商品分类的信息太多,如果每一行都显示一个颜色的话会让人眼花缭乱,为了提升用户体验,减少用户看错的情况,需要对表格的每行进行隔行换色*
* 通过js来实现
* 确定事件 onload ,页面加载完成后对页表格的颜色作一些修改
* 事件触发函数init()
* 函数操作:
修改表格每一行的背景颜色
```html
<script>
function init(){
//获得表格
var tab = document.getElementById("tab")
//获得表格行
var rows = tab.rows()
//遍历表格的每一行... |
PHP | UTF-8 | 377 | 2.53125 | 3 | [] | no_license | <?php
$message = "\n\nИмя: ".$_POST['name']."\r\nТелефон: ".$_POST['phone']."\r\nE-mail: ".$_POST['email'];
// На случай если какая-то строка письма длиннее 70 символов мы используем wordwrap()
$message = wordwrap($message, 70, "\r\n");
// Отправляем
mail('art.sandin@yandex.ru', 'Feedback Form', $message);
?> |
JavaScript | UTF-8 | 256 | 2.53125 | 3 | [] | no_license | class GameObject
{
constructor(position = {x:0,y:0}, name = "Empty", layer = 5)
{
this.position = position
this.name = name
this.layer = layer
this.active = true
}
start(){}
update(){}
draw(){}
} |
Java | UTF-8 | 1,184 | 2.078125 | 2 | [] | no_license | package pack;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
import javax.servlet.AsyncContext;
import javax.servlet.Dispat... |
SQL | UTF-8 | 395 | 3.296875 | 3 | [] | no_license | --
-- Non Foreign Key Constraints for Table VED_POD_ROW
--
ALTER TABLE MASTER.VED_POD_ROW ADD (
CHECK ("VED_POD_ID" IS NOT NULL)
DISABLE NOVALIDATE);
ALTER TABLE MASTER.VED_POD_ROW ADD (
CHECK ("NUM_CIST" IS NOT NULL)
DISABLE NOVALIDATE);
ALTER TABLE MASTER.VED_POD_ROW ADD (
CONSTRAINT VED_POD_ROW_PK
P... |
Markdown | UTF-8 | 523 | 2.515625 | 3 | [
"MIT"
] | permissive | ---
templateKey: project
name: Danielle Sheahan
title: (Anti)socialized
category: Short Film
thumbnail: ../thumbnails/danielle_antisocialized.jpg
intro: >-
(Anti)socialized is a short film that uses visual metaphor and storytelling to explore how gendered socialization impacts our sexual interactions. The film examin... |
Ruby | UTF-8 | 2,610 | 2.515625 | 3 | [
"MIT"
] | permissive | module PryStackExplorer
class WhenStartedHook
include Pry::Helpers::BaseHelpers
def caller_bindings(target)
bindings = binding.callers
pre_callers = Thread.current[:pre_callers]
bindings = bindings + pre_callers if pre_callers
bindings = remove_internal_frames(bindings)
mark_vap... |
Java | UTF-8 | 10,008 | 1.703125 | 2 | [] | no_license | package com.google.android.gms.drive.internal;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.drive.ChangeSequenceNumber;
import com.google.... |
PHP | UTF-8 | 2,647 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace VGirol\JsonApi\Services;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use VGirol\JsonApi\Contracts\ServiceContract;
abstract class AbstractService implements ServiceContract
{
/**
* @var Collection
*/
private $parameters;
/**
* Undocumented function
... |
Python | UTF-8 | 2,178 | 3.34375 | 3 | [] | no_license | from word import *
import logging
class WordStore(set):
def __init__(self, iter = list(), check_sign = True):
"""
iter: itérable de mot à ajouter, potentiellement vide
/!\ on a pas encore de crypto (peut-être pas nécessaire)
"""
# gen une clé RSA ou _hashT ?
set.__i... |
Swift | UTF-8 | 851 | 2.8125 | 3 | [] | no_license | //
// DomainViewModel.swift
// MVVMSample2
//
// Created by taehy.k on 2021/08/02.
//
import UIKit
class DomainViewModel: CellRepresentable {
var domain: Domain
var rowHeight: CGFloat = 60
var status: String {
switch domain.domainStatus {
case .Available:
return "Availa... |
Java | UTF-8 | 523 | 2.1875 | 2 | [
"MIT"
] | permissive | package net.login.handler;
import client.MapleClient;
import net.AbstractMaplePacketHandler;
import tools.data.input.SeekableLittleEndianAccessor;
public class CharlistRequestHandler extends AbstractMaplePacketHandler {
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClien... |
C++ | UTF-8 | 701 | 2.84375 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <map>
#include <vector>
int main(void)
{
int n;
while(std::cin >> n)
{
std::map<int, int> homeCnt, AwayCnt;
std::vector<int> homeRec, AwayRec;
for(int i = 0; i < n; ++i)
{
int homeKit, AwayKit;
scanf("%... |
JavaScript | UTF-8 | 608 | 2.859375 | 3 | [] | no_license | var $h1 = document.getElementsByTagName('h1')[0]
var url = location.href
var state = {}
// 刷新则重新返回index.html
if (url.indexOf('?') >= 0) {
url = url.split('?')[0]
history.replaceState(null, null, url)
$h1.innerHTML = '首页'
}
$('#content a').click(function () {
var index = $(this).index()
state.index = inde... |
Python | UTF-8 | 1,953 | 3.828125 | 4 | [] | no_license | import random
from state import State
class Model:
def __init__(self):
self.state = State()
self.populate()
self.populate()
def populate(self):
value = 2 if random.uniform(0, 1) < 0.9 else 4
row, col = self.state.get_random_empty_cell()
if (row != None) & (col != None):
self.state.fi... |
SQL | UTF-8 | 14,174 | 3.0625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 27, 2019 at 07:00 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
C | UTF-8 | 1,119 | 4.09375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node* left;
struct node* right;
};
struct node* newNode(int data)
{
struct node* node = (struct node*)malloc(sizeof(struct node));
node->data = data;
node->left = NULL;
node->right = NULL;
return(node);
}
... |
Shell | UTF-8 | 2,106 | 3.421875 | 3 | [] | no_license | #!/bin/bash
#
# script to plot the seazone bathy data
#
gmtset LABEL_FONT_SIZE=18 ANNOT_FONT_SIZE=18 HEADER_FONT_SIZE=18
gmtset PLOT_DATE_FORMAT=dd/mm/yyyy
gmtset D_FORMAT=%g
gmtset OUTPUT_DEGREE_FORMAT=+D PLOT_DEGREE_FORMAT=F
if [ -e ./Bathy/gridded_bathy/bathy.xyz ]; then
echo -n "make a single bathy file... "
... |
Shell | UTF-8 | 251 | 2.671875 | 3 | [] | no_license | #!/usr/bin/bash
REMOTE="fmallet@srv-aoste:/net/servers/www-sop/members/Frederic.Mallet/"
for i in $*
do
src="mallet20${i}.shtml"
echo "src=$src"
tgt="${REMOTE}/publis/20${i}/`date '+%y%m%d'`.shtml"
echo "dst=$tgt"
scp "$src" "$tgt"
done
|
PHP | UTF-8 | 577 | 3.609375 | 4 | [] | no_license | <h2>Ejemplo 3</h2>
<?php
/*crear un programa que imprima por pantalla los primeros
*20 números naturales
*/
$numero =1;
$contador =2;
while($contador <=20){
//$numero = $numero*$contador;
$numero *= $contador;
//desglozará cada multiplicación --++
echo $numero."<br>";
//sir... |
Java | UTF-8 | 933 | 2.46875 | 2 | [
"Apache-2.0"
] | permissive | package com.harrikirik.rescheck.dto;
import android.text.TextUtils;
import androidx.annotation.NonNull;
/**
* Category of an InfoItem
* Harri Kirik, harri35@gmail.com
*/
public class InfoCategory extends BaseInfoObject {
private static final long serialVersionUID = -9173790106163356722L;
private String na... |
Ruby | UTF-8 | 1,647 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env ruby
require 'sinatra'
require 'em-websocket'
EventMachine.run {
@channels = Hash.new{ |h,k| h[k] = { :channel => EM::Channel.new, :players => {} } }
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8882) do |socket|
sid = nil
roomname = nil
username = nil
... |
Java | UTF-8 | 400 | 2.015625 | 2 | [
"Apache-2.0"
] | permissive | package com.symtoms.checker.alexa.priaid.diagnosis.model;
public class DiagnosedSpecialisation extends HealthItem {
/// <summary>
/// ID of specialisation
/// </summary>
public Integer SpecialistID;
/// <summary>
/// Accuracy of specialisation
/// </summary>
public float Accuracy;
/// <summary>... |
C++ | UTF-8 | 5,324 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* A ROS package to control (With an array of joint values)
* the UR10 arm of our campero robotic platform (both simulation and physical robot).
*
* Laurent LEQUIEVRE
* Research Engineer, CNRS (France)
* Institut Pascal UMR6602
* laurent.lequievre@uca.fr
*
* This controller can be commanded by a to... |
PHP | UTF-8 | 4,428 | 2.96875 | 3 | [] | no_license | <?php
//create_cat.php
require 'connect.php';
include 'header.php';
echo '<h2>Create a topic</h2>';
if (!isset($_SESSION['signed_in']) || $_SESSION['signed_in'] == false) {
//the user is not signed in
echo 'Sorry, you have to be <a href="signin.php">signed in</a> to create a topic.';
} else {
//the user i... |
Java | UTF-8 | 507 | 2.4375 | 2 | [] | no_license | package com.example.codelabs.moviestage;
/**
* Created by varshaa on 21-01-2018.
*/
public class Trailer {
String trailerId;
String key;
String name;
public Trailer(String trailerId, String key, String name) {
this.trailerId = trailerId;
this.key = key;
this.name = name;
... |
SQL | UTF-8 | 714 | 3.09375 | 3 | [
"BSD-3-Clause"
] | permissive | --exceptional cases whenuseing function as an argument
--argument of string type
select year(time_format('10:17:66', '%H:%i:%s'));
select year(to_char(datetimetz'1111-10-55 12:23:22.111'));
--argument of timestamp type
select year(to_timestamp_tz('19:39:45 BM 12/12/2012 Europe/London'));
--argument of datetime typ... |
Java | UTF-8 | 5,257 | 3.0625 | 3 | [] | no_license | package csv;
import java.util.Objects;
public class Person
{
// 11 instances vars
private String firstName;
private String lastName;
private String companyName;
private String address;
private String city;
private String province;
private String postal;
private String phone1;
... |
Python | UTF-8 | 3,049 | 2.9375 | 3 | [] | no_license | import os
import json
import importlib
class PluginService:
"""
Klasa koja manipulise nad prosirenjima (pluginovima) u prosirivom okviru.
"""
def __init__(self):
"""
Inicijalizator servisne klase za pluginove.
"""
self._plugins = list()
def get_by_symbolic_name(self... |
Java | UTF-8 | 2,473 | 2.21875 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.j3a.sherpawebuser.dbEntityClasses;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.pers... |
C | UTF-8 | 2,911 | 2.703125 | 3 | [] | no_license | #ifndef BLOCK_H
#define BLOCK_H
#include <stdint.h>
#include "ST7735.h"
//#include "Images.h"
struct block{
uint32_t x; //x coordinate of bottom left corner
uint32_t y; //y coordinate of bottom right corner
uint32_t greatestY; // the y coordinate of the block that is the lowest on the screen
uint32_t g... |
JavaScript | UTF-8 | 6,579 | 3.09375 | 3 | [] | no_license | var xmlHttp = createXmlHttpRequestObject();
function createXmlHttpRequestObject() {
var xmlHttp;
if (window.ActiveXObject)
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (е) {
xmlHttp = false;
}
else
try {
xmlHttp ... |
C | UTF-8 | 634 | 3.71875 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
int main () {
char str[5][50], temp[50];
printf("Enter 5 words: ");
// Getting strings input
for (int i = 0; i < 5; ++i) {
fgets(str[i], sizeof(str[i]), stdin);
}
// storing strings in the lexicographical order
for (int i = 0; i < 5; ++i) {
for (int j = i + 1; j < ... |
Java | UTF-8 | 1,980 | 3.765625 | 4 | [] | no_license | package com.lc.algorithms.lc1189;
import java.util.Arrays;
/**
* @description: 1189. "气球"的最大数量
* 给你一个字符串 text,你需要使用 text 中的字母来拼凑尽可能多的单词 "balloon"(气球)。
* 字符串 text 中的每个字母最多只能被使用一次。请你返回最多可以拼凑出多少个单词 "balloon"。
* 示例 1:
* 输入:text = "nlaebolko"
* 输出:1
* 示例 2:
* 输入:text = "loonbalxballpoon"
* 输出:2
* 示例 3:
* 输入:tex... |
PHP | UTF-8 | 628 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Rudolf\Modules\Pages\One\Admin;
use Rudolf\Framework\View\AdminView;
class DelView extends AdminView
{
/**
* @var Page
*/
protected $page;
/**
* @var string
*/
protected $path;
/**
* Set data to delete page.
*
* @param array $page
*/
p... |
Python | UTF-8 | 561 | 2.84375 | 3 | [] | no_license | '''
执行用时:164 ms, 在所有 Python3 提交中击败了48.65% 的用户
内存消耗:15.1 MB, 在所有 Python3 提交中击败了40.99% 的用户
通过测试用例:57 / 57
'''
class Solution:
def repeatedStringMatch(self, a: str, b: str) -> int:
cnt = len(b) // len(a)
s0 = a * cnt
s1 = a * (cnt + 1)
s2 = a * (cnt + 2)
if b in s0:
... |
C++ | UTF-8 | 1,005 | 2.5625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
vector < int > input;
while(scanf("%d",&n)==1)
{
input.push_back(n);
}
int sz = input.size();
int compress_array[sz+5];
memset(compress_array, 0, sizeof compress_array);
int flag=0;
map < int, int > mp;
... |
Java | UTF-8 | 170 | 1.796875 | 2 | [] | no_license | package ThinkInJava.c14.c8.NullRobotProxy;
/**
* Created by zhao_yukuan@163.com
* on 2017/4/28
*/
public interface Operation {
String description();
void command();
}
|
Python | UTF-8 | 1,343 | 3.1875 | 3 | [] | no_license | def rotate(key):
n = len(key)
m = len(key[0])
result = [[0]*n for __ in range(m)]
for i in range(n):
for j in range(m):
result[j][n-i-1] = key[i][j]
return result
def check(new_lock):
lock_length = len(new_lock)//3
for i in range(lock_length, lock_length*2):
for ... |
Markdown | UTF-8 | 39 | 2.5625 | 3 | [] | no_license | # tugas-repository-github-reynald_perma |
Swift | UTF-8 | 3,549 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | //
// SignUpViewController.swift
// InstagramDemo
//
// Created by Daniel Ku on 2/24/17.
// Copyright © 2017 djku. All rights reserved.
//
import UIKit
import Parse
class SignUpViewController: UIViewController {
@IBOutlet weak var fullName: UITextField!
@IBOutlet weak var emailAddress: UITextField!
@I... |
JavaScript | UTF-8 | 6,354 | 3 | 3 | [
"MIT"
] | permissive | const { ipcRenderer } = require('electron')
// Request and parse data
ipcRenderer.send('request-init-data')
ipcRenderer.on('init-data', (event, data) => {
console.log(data);
fillFavoriteGames(data)
fillInstalledGames(data)
})
// Fill the favorite games dropdown
function fillFavoriteGames({favoriteGames, g... |
Python | UTF-8 | 899 | 4.25 | 4 | [] | no_license | class Restaurant:
"""a simple to stimulate a restaurant"""
def __init__(self, restaurant_name, cuisine_type):
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
"""will define what the restaurant is"""
print(self.restauran... |
Swift | UTF-8 | 713 | 2.671875 | 3 | [] | no_license | //
// RecipeListRepository.swift
// LetsCook
//
// Created by Luis David Goyes Garces on 5/2/20.
// Copyright © 2020 LuisGoyes. All rights reserved.
//
import RxSwift
final class RecipeListRepository: RecipeListRepositoryType {
let client: ClientType
init(client: ClientType) {
self.client = client... |
PHP | UTF-8 | 5,302 | 2.78125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: arthirajeev
* Date: 6/1/2018
* Time: 2:07 PM
*/
require_once RESOURCE_PATH . "/BaseDAO.class.php";
require_once RESOURCE_PATH . "/MenuType.class.php";
require_once RESOURCE_PATH . "/database.php";
class MenuTypeDAO extends BaseDAO
{
private $menuTypeMap = [
't... |
Markdown | UTF-8 | 1,095 | 3.3125 | 3 | [
"MIT"
] | permissive | # Chaser

JavaScript variable chaser
## Installation
```bash
npm install --save chaser
```
## Usage
```javascript
const chaser = require('chaser')
const myAnimatedVar = chaser(12) // 12 is our initial va... |
Java | UTF-8 | 989 | 2.1875 | 2 | [] | no_license | package com.stm.dao.impl;
import com.stm.dao.FilterDAO;
import com.stm.dao.rowMapper.FilterRowMapper;
import com.stm.domain.Filter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository... |
C# | UTF-8 | 1,736 | 2.59375 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public static class Pair
{
public static Pair<T> Create<T>(T left,T right)
{
return new Pair<T>() {
Left = left,
Right = right
};
}
public static Pair<T,U> Create<T,U>(T left,U right)
{
return new Pair<T,U>() ... |
Markdown | UTF-8 | 5,786 | 3.1875 | 3 | [] | no_license | ---
title: React一些路由
date: 2018-05-08 23:44:22
tags: [React,编程]
description:
copyright: true
categories: React
top:
---
React路由Prompt、Redirect、match、Switch。

<!--more-->
# 1、Prompt组件
> 除了Router、Route、Link这三个react路由的基础搭配使用... |
Java | UTF-8 | 1,792 | 2.28125 | 2 | [] | no_license | package com.complaint.model;
import java.io.Serializable;
/**
* 问题解决率
* @author peng
*昨天
*/
public class SolvingProbability implements Serializable {
private Integer areaid;//区域id
private String areaname;//区域名称
private Integer special;//归属专业id
private String specialName;//归属专业名称
private long co... |
TypeScript | UTF-8 | 2,286 | 2.8125 | 3 | [
"ISC"
] | permissive | import { Params, ServiceMethods } from '@feathersjs/feathers';
import Factory, { DataGenerator } from './Factory';
export default new class GlobalFactories {
/**
* Defined factories.
*/
public factories: { [s: string]: Factory<any, any> } = {};
/**
* Define a new factory.
*
* @pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.