language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 3,074 | 2.546875 | 3 | [] | no_license | # title
要允许中国互联网适度腐败
# author
老编辑
# publisher
老道消息
# date
2017-05
# chapter
游侠
# tag
创投, 管理, 社会
# remarks
某反腐大剧告诉我们,腐败的主要是农民的儿子、老领导的女婿,而干部家庭出身的领导不太容易腐败,通常是对手造谣,或者用错了人,替下面的腐败分子背锅。
所以《共享单车的名义》也严格按照这个套路创作。
摩拜创始人胡玮炜,出身浙江东阳,曾经靠乡镇企业致富的百强县,如今以横店闻名全国的县级市。
她是典型的小镇文艺女青年被理想主义感召去读了新闻,然后去大城市大媒体做记者。
而 ofo 的创始人戴威,北大浓眉大眼... |
Python | UTF-8 | 7,419 | 3.28125 | 3 | [] | no_license | import pygame
import numpy as np
import ChessBoard
import Piece
class ChessGraphics:
def __init__(self):
self.grid_s = 100
self.radius = round(self.grid_s / 8)
self.board_white = (200, 200, 200)
self.board_black = (10, 10, 90)
self.piece_white = (220, 150, 130)
self... |
Markdown | UTF-8 | 1,522 | 2.75 | 3 | [] | no_license | ---
layout: post
title: Road Trip - with my boy j
---
Jeremy (my boy j) called last night and we talked for over an hour… It
was awesome to hear how things are going for him now that he’s back with
his rents…
He is working two jobs. The first is construction with one of the guys
from the church he goes to… The second... |
C# | UTF-8 | 2,043 | 2.828125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// DDA Line Algorithm.
/// </summary>
public class CRayGridQuery2D
{
int _x;
int _y;
int _stepX;
int _stepY;
int _boundX;
int _boundY;
Vector2 _tMax;
Vector2 _tDelta;
/// <summary>
/// Construct a ... |
Python | UTF-8 | 4,143 | 3.0625 | 3 | [] | no_license | import sys
import hashlib
import json
from time import time
from uuid import uuid4
from flask import Flask, jsonify, request
import requests
from urllib.parse import urlparse
class Blockchain(object):
difficulty_target = "0000"
def hash_block(self, block):
block_encoded = json.dumps(block, sort_k... |
C# | UTF-8 | 10,388 | 3.203125 | 3 | [] | no_license | using System;
using System.Threading;
using System.Collections.Generic;
namespace _11.FallingRocks
{
class FallingRocks
{
// for game objects printing
static void PrintOnField(int col, int row, char sign,
ConsoleColor color = ConsoleColor.Gray)
{
Console.SetCurs... |
Java | UTF-8 | 2,369 | 2.21875 | 2 | [] | no_license | package com.mobiroller.views;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.widget.EditText;
import com.google.android.material.textfield.TextInputLayout;
import com.mobiroller.mobi942763453128.R;
import java.util.ArrayList;
public class CreditCardNumberTextWat... |
JavaScript | UTF-8 | 1,659 | 3.296875 | 3 | [
"CC-BY-3.0"
] | permissive | var Question = function (game, id, question, answer1, answer2, answer3, correctAnswer) {
this.game = game;
this.id = id;
this.question = question;
this.answer1 = answer1;
this.answer2 = answer2;
this.answer3 = answer3;
this.correctAnswer = correctAnswer;
this.questionText = game.add.text(20, 20, this.que... |
C++ | UTF-8 | 3,431 | 3.125 | 3 | [
"Zlib"
] | permissive | #ifndef PLAYER_H
#define PLAYER_H
#include "SDL.h"
#include "Texture.h"
#include "Generate.h"
#include <cmath>
#include <time.h>
const int PLAYER_MOVEMENT_SPEED = 1; //In number of blocks.
const int MOVEMENT_INTERVAL = 2;//In 15ms // was 10
const int KICKDOWNS = 3;
class Player
{
public:
//default ... |
TypeScript | UTF-8 | 2,147 | 3.4375 | 3 | [] | no_license | import { of, from, fromEvent } from 'rxjs';
import { map } from 'rxjs/operators';
import { MOCK_CARS, MOCK_USERS } from './mock-data';
console.clear();
/* Task 1 **/
// Data Source
const dataSource = [3, 1, '939', null, 3, { numb: 3 }, undefined, 'number'];
const source$ = from(dataSource);
// create variable resu... |
Java | UTF-8 | 2,452 | 2.390625 | 2 | [] | no_license | package com.G3Tingeso.PrivateServices.services;
import com.G3Tingeso.PrivateServices.repositories.Diplomado_docente_Repository;
import com.G3Tingeso.PrivateServices.models.Diplomado_docente;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import or... |
Markdown | UTF-8 | 5,474 | 2.765625 | 3 | [] | no_license | {{nurse-kun|12|15}}
## Part Fourteen (February 14th) ##
### 20543035 ###
Hey, /b/. I know this is considerably sooner than I've found tends to work well, but I did say yesterday that I'd check in today, to see if anyone had anymore valentine ideas for a certain limbs/eye-reduced little girl. If so, I can print them... |
C++ | UTF-8 | 549 | 2.640625 | 3 | [] | no_license | #include<cstdio>
#include<deque>
std::deque<int> dq;
int N, M, t, ret;
int main() {
scanf("%d%d", &N, &M);
for (int i = 1; i <= N; i++) dq.push_back(i);
while (M--) {
scanf("%d", &t);
int f, b;
for (f = 0; f < N; f++) if (dq[f] == t) break;
b = dq.size() - f;
if (f < b) {
ret += f;
for (int i = 0; i ... |
JavaScript | UTF-8 | 807 | 2.59375 | 3 | [] | no_license | const Elevator = require('./elevator.js');
const Person = require('./person.js');
var elevator = new Elevator();
const person1 = new Person("person1", 0, 2);
elevator.call(person1);
const person2 = new Person("person2", 0, 7);
elevator.call(person2);
const person3 = new Person("person3", 3, 2);
elevator.call(person3);... |
Java | UTF-8 | 1,489 | 2.234375 | 2 | [] | no_license | package den.graduation;
import den.graduation.model.Role;
import den.graduation.model.User;
import den.graduation.service.UserService;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import static org.assertj.core.api.Assertions.assertTha... |
Swift | UTF-8 | 1,234 | 2.546875 | 3 | [
"MIT"
] | permissive | //
// MainRouter.swift
// TodoManager
//
// Created by Anton Polyakov on 12/05/2018.
// Copyright © 2018 ton252. All rights reserved.
//
import UIKit
final class MainRouter: Router {
// MARK: - Public Methods
func initialViewController() -> UINavigationController {
let pm = TasksLis... |
JavaScript | UTF-8 | 9,875 | 2.828125 | 3 | [] | no_license | let id1;
//UPDATE EMPLOYEES
//SET VALUES INTO THE MODAL TABLE
$(document).on("click", ".btn-edit", function(){
fila = $(this).closest("tr");
id1= fila.find('td:eq(0)').text();
fname= fila.find('td:eq(1)').text();
lname= fila.find('td:eq(2)').text();
department= fila.find('td:eq(4)').text();
mai... |
PHP | UTF-8 | 18,979 | 2.609375 | 3 | [] | no_license | <?php
/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
/**
* Track access to ILIAS learning modules
*
* @author Alex Killing <alex.killing@gmx.de>
* @version $Id$
* @ingroup ModulesLearningModule
*/
class ilLMTracker
{
const NOT_ATTEMPTED = 0;
const IN_PROGRESS = 1;
const COMPL... |
Java | UTF-8 | 2,013 | 2.4375 | 2 | [] | no_license | package br.edu.ifce.cgt.application.controller.dialogs;
import br.edu.ifce.cgt.application.Main;
import br.edu.ifce.cgt.application.util.Config;
import cgt.game.CGTSpriteSheet;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
imp... |
Markdown | UTF-8 | 1,691 | 2.90625 | 3 | [] | no_license | # Creating Universal App Using Sencha ExtJS 6
## Overview
This CodeLab will introduce you to the Universal App concept introduced in Sencha Ext JS 6 and will walk you through the steps required to create, build, deply, and run an universal application.
### What you'll learn?
1. What is an Universal App?
2. What Class... |
C++ | UTF-8 | 664 | 2.96875 | 3 | [] | no_license | // ADCS_Eigen.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include "Eigen/Dense"
using Eigen::Matrix3d;
int main()
{
Matrix3d m = Matrix3d::Random();
std::cout << "Here is the randomly generated matrix:" << std::endl;
std::cout << ... |
Java | BIG5 | 39,813 | 1.570313 | 2 | [
"Apache-2.0"
] | permissive | /*
* TradingBot - A Java Trading system..
*
* Copyright (C) 2013 Philipz (philipzheng@gmail.com)
* http://www.tradingbot.com.tw/
* http://www.facebook.com/tradingbot
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
... |
Markdown | UTF-8 | 3,533 | 3.15625 | 3 | [] | no_license | # 챕터 2-2 : CSS Module
> 참고 : https://react.vlpt.us/styling/02-css-module.html
#### 📕 주로 배운 내용
- CSS Module 기본 개념
- **고유 클래스명**을 사용할 수 있도록 하는 서드파티 라이브러리
- 클래스명에 해쉬값을 붙여주므로 중복 된 클래스명으로 인한 충돌을 방지할 수 있다.
- 기존 레거시 프로젝트에 리액트를 도입할 때 유용하다.
- webpack 기본 내장 라이브러리이기에 CRA 프로젝트에서 설치 없이 사용 가능하다.
<br>
- 사용하기
- CSS 파... |
C++ | UTF-8 | 1,374 | 2.75 | 3 | [] | no_license | #include "monster.h"
#include <time.h>
monster::monster()
{
//ctor
}
void monster::moveMonster(int &MonsterX, int &MonsterY,int &PlayerX, int &PlayerY)
{
srand(time(0));
memcpy( tmp_map, m.map, sizeof(m.map) ); // tmp_map paverciam m.map perkopijuojam visus simbolius char
int distancex = Play... |
Java | UTF-8 | 3,016 | 2.953125 | 3 | [] | no_license | package dao;
import connection.JDBC;
import entities.Content;
import java.io.IOException;
import java.sql.*;
public class ContentDAO {
private String jdbcDriver;
private String jdbcURL;
private String jdbcUsername;
private String jdbcPassword;
public ContentDAO(String jdbcDriver, String jdbcURL,... |
Shell | UTF-8 | 149 | 2.78125 | 3 | [] | no_license | #!/bin/sh
# Toggle lemonbar
BAR_PID=$(pidof lemonbar)
if [ $BAR_PID ]; then
kill -9 $BAR_PID
herbstclient pad 0 0
else
$HOME/bin/bar &
fi
|
Java | UTF-8 | 2,559 | 2.046875 | 2 | [] | no_license | package site.imcoder.blog.controller.view.old;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import site.imcoder.blog.common.Utils;
import... |
C++ | UTF-8 | 220 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include "EAN.h"
using namespace std;
int main()
{
EAN e("9780674062313");
cout << e.isValid() << endl << endl << endl;
cout << e.convertISBNToEAN("ISBN 0-13-222220-5") << endl;
} |
Python | UTF-8 | 632 | 3.703125 | 4 | [] | no_license | #The ran python file will recieve a random number called 'seed' based on the question seed.
#You should then set 'question' equal to the question you wish to ask and 'answer' equal to the question's answer.
import sys
import math
import random
random.seed(int(seed))
posAns = random.randint(0,255)
def BinaryConvert... |
C# | UTF-8 | 659 | 2.71875 | 3 | [] | no_license | using FilmeOnline.Logica.Entidades;
using FilmeOnline.Logica.Utils;
namespace FilmeOnline.Logica.Repositorios
{
public abstract class Repositorio<T>
where T : Entidade
{
protected readonly UnitOfWork _unitOfWork;
protected Repositorio(UnitOfWork unitOfWork)
{
_unit... |
PHP | UTF-8 | 5,355 | 2.6875 | 3 | [] | no_license | <?php
/**
* @todo add support for Doctrine profiler
*/
abstract class ReportSqlQuery
{
/**
* @var Doctrine_Table
*/
protected $table;
/**
* @var string
*/
protected $tableName;
/**
* @var PDO
*/
protected $pdo;
/**
* @var PDOStatement
*/
protected $pdoStatement;
/**
* @va... |
C# | UTF-8 | 2,430 | 2.828125 | 3 | [
"MIT"
] | permissive | using NJsonSchema;
using NJsonSchema.CodeGeneration.CSharp;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JsonSchemaCodegen
{
internal static class CodeGenerator
{
public static void GenerateJsonSchema(Lis... |
Python | UTF-8 | 152 | 3.4375 | 3 | [
"MIT"
] | permissive | k = int(input())
count1 = 0
count2 = 0
for i in range(k):
if i % 2 != 0:
count1 += 1
else:
count2 += 1
print(count1 * count2)
|
Python | UTF-8 | 24,429 | 2.53125 | 3 | [
"CC0-1.0"
] | permissive | #!/usr/bin/env python3 -u
'''
Author: Yotam Gingold <yotam@yotamgingold.com>
Home: https://github.com/yig/mturk.py
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
'''
import boto3
from datetime import datetime
import xml.dom.minidom
## From: https://stackoverflow.c... |
Go | UTF-8 | 784 | 2.640625 | 3 | [] | no_license | package main
import (
"flag"
"fmt"
"log"
"os"
"github.com/ostlerc/voter/election"
)
var (
o = flag.String("o", "dot", "graph output type. [json,dot]")
i = flag.String("i", "json", "graph input type. ["+election.CSVFlat(election.Parsers())+"]")
)
func main() {
flag.Parse()
election.Setup()
if *o != "dot" ... |
Python | UTF-8 | 1,720 | 3.359375 | 3 | [] | no_license | # To run the program cd to the folder and the output of this program will be copied in the minisat solver.
def main():
alph = []
minisat = []
graph = []
alpha = 'a'
for i in range(0, 26):
alph.append(alpha)
alpha = chr(ord(alpha) + 1)
extra = [" ", "\n"]
name = input("Name ... |
C++ | UTF-8 | 901 | 2.6875 | 3 | [] | permissive | #include "GLFog.h"
#include "GL.h"
using namespace GLDraw;
GLFog::GLFog()
:type(None),start(0),end(1),density(1)
{
}
void GLFog::setCurrent()
{
glFogfv(GL_FOG_COLOR, color.rgba);
switch(type) {
case None:
glDisable(GL_FOG);
break;
case Linear:
glEnable(GL_FOG);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogf(GL... |
C# | UTF-8 | 679 | 2.515625 | 3 | [] | no_license | namespace AAA.Utils.CloudProvider
{
/// <summary>
/// Contains all supported types of cloud providers.
/// </summary>
public enum CloudTypeEnum
{
/// <summary>
/// Dropbox cloud provider.
/// </summary>
Dropbox,
/// <summary>
/// Flickr cloud provide... |
Markdown | UTF-8 | 23,377 | 3.109375 | 3 | [
"MulanPSL-2.0",
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ---
---
---
title: 况钟和周忱
---
一从《十五贯》说起
1956年浙江昆苏剧团上演了改编的昆曲《十五贯》之后,各地其他剧种也纷纷改编上演,况钟这个封建时代的好官,逐渐为成千上万的观众所熟识了。这戏中另一个好官周忱,是况钟的上司和同乡,也被赋予和况钟不同的性格,成为舞台上的人物。
《十五贯》成功地塑造了况钟这个历史人物,刻画了他的性格、思想感情。他通过具体分析,进行现场调查研究,得出正确结论,终于纠正了主观主义、官僚主义的错误判断,平反了冤狱,为人民办了好事。这个戏形象地突出了反对主观主义、反对官僚主义这个主题,是具有现实的教育意义的,是个好戏。
但是,《十五贯》这个故事,其实和况钟并不相干。
《... |
Markdown | UTF-8 | 1,810 | 2.890625 | 3 | [] | no_license | # Topics
- Bastion pattern
- NAT gateway pattern
### Additional command line parameter:
```--parameters ParameterKey=KeyPairName,ParameterValue=bar```
### Diagram

---
## Exercise 1
Create a VPC, IGW, RT, and public + private subnets
- Refer to previous exercise(s) if necessary.
**Verify:**
... |
Java | UTF-8 | 8,556 | 1.992188 | 2 | [] | no_license | package org.sputnikdev.esh.binding.bluetooth.handler;
import org.eclipse.smarthome.config.core.Configuration;
import org.eclipse.smarthome.core.thing.Channel;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.ThingStatus;
import o... |
Markdown | UTF-8 | 1,492 | 2.953125 | 3 | [] | no_license | # Prediction-Assignment-Writeup
[Prediction-Assignment-Writeup HTML](https://rpubs.com/groupejopa/728147)
## Summary
This document is the final report of the Peer Assessment project from the Practical Machine Learning course, which is a part of the Coursera John’s Hopkins University Data Science Specialization. It wa... |
Java | UTF-8 | 1,477 | 2.4375 | 2 | [] | no_license | /****************************************************************/
/* Nombre: Carlos Alberto Onorio Torres. */
/* Fecha de creación: 04/05/2018 */
/* Ultima modificación: 04/05/2018 */
/* Descripción: Detalles de una Experiencia Educativa con */
/* Exámenes parciales ingresados por ... |
Shell | UTF-8 | 519 | 2.625 | 3 | [] | no_license | # Clear any old environment that may conflict.
for key in $( set | awk '{FS="="} /^OS_/ {print $1}' ); do unset $key ; done
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=vQrxWEQqIohz1ZwBkhA1X... |
Java | UTF-8 | 5,548 | 1.679688 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2017 Syncleus, Inc.
* with portions copyright 2004-2017 Bo Zimmerman
*
* 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... |
PHP | UTF-8 | 787 | 2.546875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: programador
* Date: 31/05/18
* Time: 8:05
*/
namespace App\Application\Delivery\GetByOrderId;
use App\Domain\Services\Delivery\DeliveryGetByOrderIdService;
class DeliveryGetOrderId
{
private $deliveryGetOrderIdService;
public function __construct(DeliveryGetByO... |
Python | UTF-8 | 1,058 | 3.125 | 3 | [] | no_license | from ntsa.algorithms.solver import Solver
class RungeKutta(Solver):
"""4th Order Classical Runge Kutta ODE Solver."""
def __init__(self, t0, y0, h, dydt):
super().__init__(t0, y0, h, dydt)
def _get_initial_params(self, target_t):
h = self.h
n = int(abs(target_t - self.t0) / h)
... |
C# | UTF-8 | 2,196 | 2.6875 | 3 | [
"MIT"
] | permissive | // Copyright (C) 2005 Sebastian Faltoni
// Copyright (C) 2005 Riccardo Marzi
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License,... |
JavaScript | UTF-8 | 2,958 | 2.875 | 3 | [] | no_license | import React, { useState } from "react";
import axios from "axios";
import { Card } from "react-bootstrap";
import API from "../ApiKey";
import WeatherCard from "./WeatherCard";
import Header from "./Layout/Header";
import WeatherSearch from "./Layout/WeatherSearch";
import Error from "./Error";
import Context from "..... |
C | UTF-8 | 176 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
/*
* put a string on output stream.
*/
putstr(f, s, l)
register FILE *f;
register char *s;
register int l;
{
while (l--)
putc(*s++, f);
}
|
JavaScript | UTF-8 | 1,114 | 2.546875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { getData } from "./http/Get";
import Table from "./components/Table";
import Pagination from "./components/Pagination";
import "./App.css";
function App() {
const [data, setData] = useState([]);
const [loading, setLoading] = useState(false);
const [curr... |
C# | UTF-8 | 645 | 3.015625 | 3 | [] | no_license | using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
namespace DataAccessLayer
{
public static class DataListHelper
{
public static object ReadField(DataRowView DRV, string FieldName)
{
Object Ret = null;
int idx = DRV.Row.Table.Columns.IndexOf(FieldName);
Ret = (-1 != ... |
JavaScript | UTF-8 | 317 | 3.8125 | 4 | [] | no_license | //https://www.hackerrank.com/challenges/permutation-equation/problem
function permutationEquation(p) {
// Write your code here
const result = []
for (let i = 1; i < p.length + 1; i++) {
result.push(p.indexOf(p.indexOf(i) + 1) + 1)
}
return result
}
console.log(permutationEquation([5, 2, 1, 3, 4]))
|
Java | UTF-8 | 2,734 | 1.851563 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright 2023 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... |
PHP | UTF-8 | 4,213 | 2.921875 | 3 | [] | no_license | <?php
namespace Dao;
use Modelo\Usuario;
class UsuarioBdDao implements UsuarioIDao
{
protected $tabla = "usuarios";
protected $listado;
private static $instancia;
public static function getInstancia()
{
if (!self::$instancia instanceof self) {
self::$instancia = new self();
... |
C++ | UTF-8 | 3,317 | 3.703125 | 4 | [
"MIT"
] | permissive | /*
#面试刷题# 第94期
#Leetcode# Q0306 加性数字
加性数字是一个字符串,其数字可以形成加性数字序列。
有效的加性数字序列应至少包含三个数字。 除前两个数字外,
序列中的每个后续数字必须为前两个数字的和。
给定一个仅包含数字“ 0”-“ 9”的字符串,编写一个函数以确定它是否为加数。
注意:加法序列中的数字不能有前导零,因此序列1、2、03或1、02、3无效。
约束条件:
num仅由数字“ 0”-“ 9”组成。
1 <=数字长度<= 35
示例1:
Input: "112358"
Output: true
Explanation: The digits can form an additive sequenc... |
PHP | UTF-8 | 818 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace GuzabaPlatform\Cms\Models;
use Guzaba2\Base\Base;
class Pages extends Base
{
public static function get_by_page_group_id(?int $page_group_id, int $offset = 0, int $limit = 0): array
{
return Page::get_data_by( ['page_group_id' => $page_group_id], $offset, $l... |
C | UTF-8 | 1,234 | 2.984375 | 3 | [] | no_license | #include "io.h"
#include "serial.h"
#include "log.h"
#include <string.h>
void serial_init(int port_idx)
{
uint16_t port = SERIAL_PORT[port_idx];
io_outb(port + 1, 0x00); // Disable interrupts
io_outb(port + 3, 0x80); // Enable DLAB
io_outb(port + 0, 0x03); // (lo) Set divisor to 3
io_outb(port + 1, 0x00); // (hi... |
Java | UTF-8 | 625 | 2.046875 | 2 | [] | no_license | package br.com.bootcamp.mobile.steps;
import br.com.bootcamp.commons.AppiumRobot;
import br.com.bootcamp.funcionalidade.mobile.HomeFuncionalidade;
import cucumber.api.java.pt.Dado;
public class HomeSteps {
private HomeFuncionalidade homeFuncionalidade;
private AppiumRobot appiumRobot;
public HomeSteps()... |
Shell | UTF-8 | 958 | 3.921875 | 4 | [] | no_license | #!/bin/bash
# tell the shell to use the bash interpreter so we don't run into compatability issues.
#check if root user
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
#Install OpenSSH Server, a connectivity tool for remote login with SSH protocol.
# -y answers all prompts with ... |
Python | UTF-8 | 409 | 2.796875 | 3 | [] | no_license | from ..battle_entity import Entity
class Enemy(Entity):
def __init__(self, roomLocation):
self.roomLocation = roomLocation
self.detected = False
perception = 5
def __repr__(self):
return "%s at location %s." % (self.name, self.roomLocation)
stealth = 0
damageMult = 1
... |
Java | UTF-8 | 645 | 1.71875 | 2 | [] | no_license | package com.marriage.grapefruit;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.... |
Java | ISO-8859-13 | 4,091 | 2.5625 | 3 | [] | no_license | package it.MirkoGiacchini.menu;
import it.MirkoGiacchini.util.Util;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
impor... |
Python | UTF-8 | 2,136 | 3.703125 | 4 | [] | no_license | def f():
# non-local scope for inner functions
msg = "salam"
def test_local():
msg = "khoobi?"
print("in function: " + msg)
def test_nonlocal():
nonlocal msg
msg = "chetori?"
print("in function: " + msg)
def test_global():
global msg
msg = ... |
C# | UTF-8 | 3,507 | 2.84375 | 3 | [] | no_license | using System;
using System.ComponentModel;
using System.Net;
using System.Text;
using Newtonsoft.Json;
namespace OpenWeatherMap
{
public class OpenWeatherMapClient
{
public string AppId { get; }
public HttpStatusCode ResponseCode { get; private set; }
private const string OpenWeatherMa... |
Python | UTF-8 | 800 | 2.921875 | 3 | [] | no_license | import pymc3 as pm
import numpy as np
import matplotlib.pyplot as plt
def generateCauchyData(N, mean):
return (np.random.standard_cauchy(N) * 100. + mean)
data = generateCauchyData(10000, 42.)
plt.plot(data)
plt.show()
def frequentistCenter(data):
return np.mean(data)
X = frequentistCenter(data)
print("S... |
C++ | UTF-8 | 1,587 | 2.765625 | 3 | [] | no_license | #include <texture.hpp>
#include <GLAD/glad.h>
#include <stb_image.h>
#include <stdio.h>
Texture::Texture(std::string path, std::string type) {
int height, width, nChannels;
unsigned int texture, format;
unsigned char *imageData = stbi_load(path.c_str(), &width, &height, &nChannels, 0);
glGenTextures(1, &textur... |
Java | UTF-8 | 18,361 | 2.875 | 3 | [] | no_license | import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.*;
/**
* This class will make use of it's supplier classes
* and handle the UX design.
*
* @author Chris Hoffman
*/
public cla... |
Java | UTF-8 | 893 | 3.5 | 4 | [
"Apache-2.0"
] | permissive | package com.java.advanced.features.juc.c_020;
import java.util.concurrent.TimeUnit;
/**
* synchronized 是可重入锁
*
* @author wangzhichao
* @since 2020/3/31
*/
public class T01_ReentrantLock1 {
synchronized void m1() {
System.out.println("m1...........start");
for (int i = 0; i < 10; i++) {
... |
C++ | UTF-8 | 2,172 | 2.53125 | 3 | [
"MIT"
] | permissive | // -----------------------------------------------------------------------------
// CreativeCommons BY-SA 3.0 2013 <Thibault Coppex>
//
// -----------------------------------------------------------------------------
#ifndef AER_VIEW_CAMERA_INL_H_
#define AER_VIEW_CAMERA_INL_H_
namespace aer {
Camera::Camera(const ... |
C++ | UTF-8 | 531 | 2.671875 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int n,m,x;
vector<int>wt;
vector<int>color;
int solve(int index,int x,int k){
if(index==n){
return 0;
}
int q1=0;
if(wt[index]<=x&&k<=m){
q1=x-solve(index+1,k+1);
}
}
int main(){
cin>>n>>m>>x;
for(int i=0;i<n... |
Java | UTF-8 | 939 | 3.96875 | 4 | [] | no_license | package com.dengmin.demi.exception;
/**
* 面试题:下面方法体中输出的结果是多少?答案:100。
*
* 理由:方法体中的代码必须遵循自上而下顺序依次逐行执行!!!
*/
public class ExceptionTest04 {
public static void main(String[] args) {
int a = m();
System.out.println(a);
}
static int m() {
int i = 100;
try {
return ... |
Shell | UTF-8 | 831 | 2.6875 | 3 | [] | no_license | #!/bin/bash
. configs/main.cfg
cd $PATH_TO_WWW_BETA
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo $BRANCH
cd $PATH_TO_WWW_MASTER
git pull beta $BRANCH
rm $PATH_TO_SCRIPT_FOLDER/configs/database.beta.yml
rm $PATH_TO_SCRIPT_FOLDER/configs/configuration.yml
cp $PATH_TO_SCRIPT_FOLDER/configs/database.beta.yml $PATH_TO... |
Markdown | UTF-8 | 5,177 | 2.890625 | 3 | [] | no_license | 一五九
万紫琴大声道:
“琬妹请过来,他不听就算了!”
岳家宇搓搓手道:
“琴妹请等一下,我一会就来……。”
他肃然道:
“小弟,认为化解这三个招,应该……”
只闻司马龙在前面道:
“宇儿过来一下,为师指点一下你的轻功……”
岳家宇耸耸肩说:
“兰姐,待会再研究吧!”
谷中兰面色大变,她相信连司马龙也在怀疑她了,虽然深沉,毕竟搅不住内心的失望和忿慨,冷怒地道:
“岳郎,你去吧!也许轻功比技术更重要,因为必要时可以仗轻功逃命……”
岳家宇道:
“兰姐切莫误会,小弟只是因师命难违而已!”
岳家宇向前掠去,到了... |
SQL | UTF-8 | 294 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | -- Sub-sample of the donor dataset
SELECT
*
FROM
record_link.donors
WHERE MOD(ABS(FARM_FINGERPRINT(CAST(donor_id AS STRING))), 1000) = 0
-- Sub-sample of the contributions dataset
SELECT
*
FROM
record_link.donors
WHERE MOD(ABS(FARM_FINGERPRINT(CAST(donor_id AS STRING))), 1000) = 0
|
Shell | UTF-8 | 687 | 2.875 | 3 | [] | no_license | #/bin/sh
# This is a Jenkins setup script to ease getting up and running. Download by running
# "wget https://github.com/KarlMcBride/jenkins_playground/blob/master/jenkins_setup.sh && ./jenkins_setup.sh"
sudo apt install -y openjdk-11-jdk
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-ke... |
Python | UTF-8 | 2,042 | 3.65625 | 4 | [] | no_license | from turtle import Turtle, Screen
from random import randint
def expand_color(character):
color_dict = {
'r': "red",
'o': "orange",
'y': "yellow",
'g': "green",
'b': "blue",
'i': "indigo",
'v': "violet",
}
return color_dict[character]
... |
JavaScript | UTF-8 | 933 | 3.296875 | 3 | [] | no_license | 'use strict';
module.exports = tokens => {
let current = 0;
const walk = () => {
let token = tokens[current];
if (token.type === 'number') {
current++;
return {
type: 'NumberLiteral',
value: token.value
};
}
if (token.type === 'paren' && token.value === '(') {
... |
Java | UTF-8 | 762 | 1.96875 | 2 | [] | no_license | package com.valentsolutions.xml.statepattern.providedstates;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* @
*/
public class ProvidedStateTests
{
public static Test suite()
{
TestSuite suite =
new TestSuite("Test for com.valentsolutions.xml.statepattern.providedst... |
Java | UTF-8 | 709 | 2.046875 | 2 | [] | no_license | //package idv.woody.jgroup;
//
//import org.jgroups.JChannel;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Scope;
//import org.springframework.stereotype.Component;
//import org.springframework.stereotype.Service;
//
///**
// * Created by chun-chiao on... |
Java | UTF-8 | 3,440 | 2.28125 | 2 | [] | no_license | package cooble.ch.location;
import cooble.ch.core.Game;
import cooble.ch.entity.IMovable;
import cooble.ch.entity.Mover;
import cooble.ch.entity.Position;
import cooble.ch.entity.Weather;
import cooble.ch.event.LocationLoadEvent;
import cooble.ch.graphics.Bitmap;
import cooble.ch.graphics.BitmapProvider;
import cooble... |
Java | UTF-8 | 1,240 | 2.78125 | 3 | [] | no_license | package org.selliott.atm.server;
import org.apache.log4j.Logger;
import org.eclipse.jetty.server.Server;
import org.selliott.atm.common.Config;
/**
* Main entry point for the Jetty server.
*/
public class Main {
private static final Logger log = Logger.getLogger(Main.class);
/**
* Main entry point.
... |
Java | UTF-8 | 295 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | package eu.leads.crawler.concurrent;
/**
* Task interface
*/
public interface Task {
/**
* You can limit number of parallel processing task with the same sequence name.
* Limit is ignored if sequence name is {@code null}.
* @return
*/
String getSequenceName();
}
|
Ruby | UTF-8 | 966 | 3.3125 | 3 | [] | no_license | #---
# Excerpted from "Mazes for Programmers",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit http:... |
Python | UTF-8 | 1,367 | 4.125 | 4 | [] | no_license | poem = '''\
Programing is fun
when the work is done
if you wanna make your work also fun
use python!
'''
#以'w'riting方式打开文件
f = open('poem.txt', 'w')
#向文件编写文本
f.write(poem)
#关闭文件
f.close()
#如果没有特别指定,将启用默认的阅读('r'ead)模式
f = open('poem.txt')
while True:
line = f.readline()
#0长度指示
if len(line) == 0:
... |
JavaScript | UTF-8 | 3,977 | 2.546875 | 3 | [
"MIT"
] | permissive | var assert = require('assert');
var JsBarcode = require('../../bin/JsBarcode.js');
var Canvas = require("canvas");
describe('CODE128', function() {
it('should be able to include the encoder(s)', function () {
CODE128 = JsBarcode.getModule("CODE128");
CODE128A = JsBarcode.getModule("CODE128A");
CODE128B ... |
C++ | UTF-8 | 15,369 | 2.828125 | 3 | [] | no_license | #ifndef AUTOMATA_HPP
#define AUTOMATA_HPP
#include <iostream>
#include <vector>
#include "../parse/ast.hpp"
namespace rv_xjtu_yangyan
{
///////////////////////////////////////////////////////////
//数据结构的定义
///////////////////////////////////////////////////////////
struct automata_node;
str... |
C | UTF-8 | 1,427 | 2.578125 | 3 | [] | no_license |
PRACTICE
COMPETE
JOBS
LEADERBOARD
Search
shantanumallik
PracticeTutorials30 Days of CodeDay 0: Hello, World.
Day 0: Hello, World.
2 more challenges to get your first star!
Points: 0/2
Days of Code
Problem
Submissions
Leaderboard
Discussions
Editorial
Tutorial
You made this submission 2 years ago.
Score:30.00Status:Ac... |
C | UTF-8 | 11,998 | 3.1875 | 3 | [] | no_license | #include "hashmap.h"
#include "stdbool.h"
#define LOAD_FACTOR_ERR -1
#define VACANT -1
#define INSERT 5
#define DELETE 4
/**
* allocates a new buckets array for the hash map;
* @param hash_map a hash map
* @return a new buckets array
* @if_fail return NULL.
*/
vector** buckets_alloc(hashmap* hash_map){
//... |
C# | UTF-8 | 682 | 2.5625 | 3 | [
"MIT"
] | permissive | namespace Radical.Windows.Messaging
{
#pragma warning disable 0618
/// <summary>
/// Domain event that identifies that a view model has been closed.
/// </summary>
public class ViewModelClosed
{
/// <summary>
/// Initializes a new instance of the <see cref="ViewModelClosed"/> class.... |
Java | UTF-8 | 798 | 1.734375 | 2 | [] | no_license | package de.hawhamburg.microservices.composite.revenue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
/**
* Created by unknown on 27.10.15.
*/
//SOF TODO enable client in live system... |
C# | UTF-8 | 1,301 | 2.75 | 3 | [] | no_license | using Flower.Extensions.Validators;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
namespace Flower.Models
{
[Table("Customer")]
public class Customer
{
... |
Java | UTF-8 | 1,134 | 2.5 | 2 | [] | no_license | package com.example.thymeleaf.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import j... |
C++ | UTF-8 | 297 | 3.109375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int v = 10;
//program asks for the memory MMU
//then memory address is returned
int *address; //how to declare pointer
address = &v; //return address of the memory location
cout << address << endl; //outs location
return 0;
} |
TypeScript | UTF-8 | 8,384 | 2.921875 | 3 | [
"MIT"
] | permissive | import { timeWeek, timeDays, timeDay } from 'd3-time'
import { timeFormat } from 'd3-time-format'
import { DateOrString } from '../types'
import { isDate } from 'lodash'
// Interfaces
interface ComputeBaseProps {
direction: 'horizontal' | 'vertical'
}
interface ComputeBaseSpaceProps {
daySpacing: number
o... |
Java | UTF-8 | 1,425 | 3.703125 | 4 | [] | no_license | package easy.other;
/**
* @Time : 2020年2月26日00:00:17
* @Author : yyw@ustc
* @E-mail : yang0@mail.ustc.edu.cn
* @Github : https://github.com/ustcyyw
* @desc :
*/
import java.util.HashSet;
/**
* 给定一个非负整数 c ,你要判断是否存在两个整数 a 和 b,使得 a2 + b2 = c。
* <p>
* 示例1:
* <p>
* 输入: 5
* 输出: True
* 解释: 1 * 1 + 2 * 2 = 5
*... |
Java | UTF-8 | 3,657 | 2.59375 | 3 | [] | no_license | package create.data;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Random;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Model;
import org.eclipse.rdf4j.model.ValueFactory;
import org.eclipse.rdf4j.model.impl.TreeMode... |
Shell | UTF-8 | 335 | 2.734375 | 3 | [] | no_license | # run following function to remove carriage returns in Windows:
# d2u signJars.sh
shopt -s nullglob
# cd dist
for f in *.jar
do
jarsigner -keystore jnlpKey -storepass abcdef $f jdc
echo "signed dist/$f"
done
cd lib
for f in *.jar
do
jarsigner -keystore ../jnlpKey -storepass abcdef $f jdc
echo "signed dist/lib/$f... |
Markdown | UTF-8 | 1,893 | 2.671875 | 3 | [] | no_license | ---
date: 2015-03-15T19:22:05+09:00
draft: true
title: google-code-prettifyでコードブロックをかっこよくする
---
このライブラリ以外にも[SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter)とか強力なものもあるが、複数のスクリプトを読む必要があったり(結合すればいいんだが)でややめんどくさい。
その点、google-code-prettifyは1スクリプトの読み込みだけでOKだし、シンプルなのでこれで十分だと思ってる。
### 準備
下記スクリプトを追加しておく。
``... |
Python | UTF-8 | 1,069 | 4.25 | 4 | [] | no_license | def greet(name, time_of_day):
return "Good " + time_of_day + ", " + name
name_1 = "David"
time_of_day_1 = "afternoon"
greeting = greet(name_1, time_of_day_1)
print(greeting)
name_2 = "Kyle"
time_of_day_2 = "evening"
greeting = greet(name_2, time_of_day_2)
print(greeting)
chickens = [
{ "name": "Margaret", "a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.