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 | 11,396 | 2.515625 | 3 | [] | no_license | from agent_dir.agent import Agent
import scipy
import numpy as np
import tensorflow as tf
import os
# Ref: https://github.com/openai/baselines/blob/master/baselines/ppo2/ppo2.py
# Simplified version of PPO2 (Ignore vloss in original paper)
# Action values to send to gym environment to move paddle up/down
UP_ACTION ... |
Python | UTF-8 | 517 | 2.953125 | 3 | [
"MIT"
] | permissive | import hashlib, sys, glob, argparse
import os
def read_txt(fname):
f = open(fname, 'r')
content = f.readlines()
print(content)
return content
def sha1(fname):
sha1hash = hashlib.sha1()
with open(fname,errors='ignore') as handle: #opening the file one line at a time for memory considerations
... |
Markdown | UTF-8 | 12,789 | 2.78125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: "Другие конструкции в регулярных выражениях | Microsoft Docs"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net"
ms.reviewer: ""
ms.suite: ""
ms.technology:
- "dotnet-standard"
ms.tgt_pltfrm: ""
ms.topic: "article"
helpviewer_keywords:
- "регулярные выражения .NET Framework, прочие констру... |
Python | UTF-8 | 9,199 | 3.078125 | 3 | [
"MIT"
] | permissive | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import pdb
class MagnetLoss(nn.Module):
"""
Magnet loss technique presented in the paper:
''Metric Learning with Adaptive Density Discrimination'' by Oren Rippel, Manohar Paluri, Piotr... |
Python | UTF-8 | 1,698 | 3.265625 | 3 | [] | no_license | global stackEnd;
global stackDataLength;
stackEnd = 8;
stackDataLength = 4;
class Stack:
def __init__(self,items):
self.items = items
#items = [[itemSize, item], [itemSize, ...] ...]
def error_check(self):
for i in range(0,len(self.items)):
#returns error message if error enc... |
Java | UTF-8 | 849 | 2.71875 | 3 | [] | no_license | package com.dkit.oopca5.core;
import java.time.LocalDate;
public class Student {
private int caoNumber;
private String dateOfBirth;
private String password;
public Student(int caoNumber, String dateOfBirth, String password) {
this.caoNumber = caoNumber;
this.dateOfBirth = dateOfBirth;... |
Java | UTF-8 | 1,836 | 2.65625 | 3 | [] | no_license | package br.edu.infnet.dominio;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
public class Time {
private ArrayList<Profissional> profissionais;
private Confederacao confederacao;
private String nome;
private String nacionalidade;
private boolean ligaProf... |
Markdown | UTF-8 | 7,057 | 2.671875 | 3 | [] | no_license | # Block Generation FAQ
This article describes possible solutions for the issues that can happen during block generation.
## My node is running but it does not generate blocks
**Question**: My node is running fine (appending microblocks) and the block height signatures compared with [wavesexplorer.com](https://wavese... |
Java | UTF-8 | 6,967 | 2 | 2 | [
"Apache-2.0"
] | permissive | package com.xd.demi.view;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation... |
Markdown | UTF-8 | 2,876 | 2.859375 | 3 | [] | no_license | # Tucil4-StrAlgo -- Ekstraksi Informasi dari Artikel Berita dengan Algoritma Pencocokan String
Program ini adalah contoh pengaplikasian strategi algoritma Knuth-Morris-Pratt (KMP), Boyer-Moore (BM) dan Regular Expression untuk mengektraksi informasi dari sebuah artikel berita berdasarkan keyword yang dimasukkan
## Ins... |
Python | UTF-8 | 4,223 | 2.890625 | 3 | [] | no_license | # -*- coding: Latin-1 -*-
#
# This file created July 7 2015 by Jim Kornelsen
#
# 13-Jul-15 JDK "Load" methods don't return a value.
# 06-Aug-15 JDK Fixed bug: Don't call setText() unless needed.
# 24-Aug-15 JDK Don't need a special copy method for this class.
# 18-Dec-15 JDK Added comparison methods.
# 11-Feb-16 JD... |
Python | UTF-8 | 6,234 | 2.6875 | 3 | [] | no_license | #!/usr/bin/python
#
# mem-usage.py - detailed process memory statistics.
#
# Based on mem_usage perl script in public domain by Andy Wingo <wingo@pobox.com>
#
# 2015 Nelson Yen, Simplified BSD License
#
import argparse
import re
# CONSTANTS
INODE_NONE = 0
class ProcMaps:
# Supported 'keys'
all_keys = ('writeabl... |
PHP | UTF-8 | 1,072 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services\Device;
use App\Models\Device;
class DeviceService
{
public function getCreateDevice($request)
{
return Device::query()->create([
'name'=>$request->name,
'filial_name'=>$request->filial_name,
'company_id'=>$request->company_id,
'code'=>$request->code,
'cocoa'=>'100',
... |
C | UTF-8 | 801 | 3.53125 | 4 | [] | no_license | /*************************************************************************
> File Name: 10-max_int.c
> Author: chenyueze
> Mail: chen_buzhou@163.com
> Created Time: 三 9/ 2 20:58:46 2020
************************************************************************/
#include <stdarg.h>
#include <inttypes.h>
#include<std... |
Python | UTF-8 | 4,070 | 2.859375 | 3 | [] | no_license | import cv2 # working with, mainly resizing, images
import numpy as np # dealing with arrays
import os # dealing with directories
import tflearn # dealing with making CNN model
import sys # Package to deal with commandline arguments
import tensorf... |
Java | UTF-8 | 4,168 | 1.8125 | 2 | [] | no_license | package ca.uoguelph.socs.uog_mobile.ui.activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.T... |
C++ | UTF-8 | 3,201 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
class Node{
public:
char* text;
Node* next;
};
class TextList{
public:
Node* head;
TextList(){
head = nullptr;
};
TextList(const TextList &o1){
Node *tmp = o1.head,*gdzie;
head = new Node;
size_t si... |
Java | UHC | 1,264 | 2.890625 | 3 | [] | no_license | package Controller;
import java.util.ArrayList;
import java.util.Vector;
import Entity.RoomInfo;
// 濡 ϴ Ʈѷ
public class RoomController {
public ArrayList<RoomInfo> allRoom(){
return RoomInfo.getRoomList();
}
public RoomInfo getRoom(int roomNum){
RoomInfo ri = new RoomInfo();
return ri.getRoom(roomNum);... |
SQL | UTF-8 | 160 | 3.625 | 4 | [] | no_license | SELECT Customers.CustomerName, Orders.OrderName
FROM Customers
FULL OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID
ORDER BY CustomerS.CustomerName; |
Go | UTF-8 | 2,465 | 2.609375 | 3 | [] | no_license | package sqs_test
import (
"encoding/json"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
sqsSDK "github.com/aws/aws-sdk-go/service/sqs"
"github.com/ngavinsir/golangtraining"
"github.com/ngavinsir/golangtraining/internal/sqs"
"github.com/pkg/errors"
"github.com/stretchr/test... |
Python | UTF-8 | 123 | 4.15625 | 4 | [] | no_license | def repeater(string, n):
repeated = string * n
return '"{}" repeated {} times is: "{}"'.format(string, n, repeated) |
C++ | UTF-8 | 17,027 | 2.65625 | 3 | [] | no_license | #include "gamestate.h"
#include <SDL_ttf.h>
#include "util.h"
#include "mazeoflife.h"
#include "highscore.h"
#include "titlestate.h"
#include <fstream>
#include "hslist.h"
#include <set>
#include <bitset>
#include <tuple>
#include <algorithm>
#include <vector>
#include <deque>
#include <iostream>
#include <sstream>
#in... |
Python | UTF-8 | 1,465 | 3.90625 | 4 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/8/31 10:27
# @Author : tc
# @File : PermutationsII.py
"""
给定一个可包含重复数字的序列,返回所有不重复的全排列。
Input1:[1,1,2]
Output1:
[
[1,1,2],
[1,2,1],
[2,1,1]
]
关键:回溯+剪
"一个数组中去掉重复元素,除了使用哈希表,更容易想到的是将原始数组排序"
参考:https://leetcode-cn.com/problems/permutations-ii/solution... |
C++ | UTF-8 | 4,497 | 4.09375 | 4 | [] | no_license | /*******************************************************************
* Filename: lab7.cpp
* Email: kniffina@oregonstate.edu
* Author: Adam Kniffin
* Email: kniffina@oregonstate.edu
* Date: 2/18/2016
* Description: This is the cpp file for lab7 of CS 199. It contains two function
* declarations, binarySearch, and... |
JavaScript | UTF-8 | 4,097 | 2.75 | 3 | [] | no_license | import React, {Component} from "react";
import PropTypes from 'prop-types';
import styled from "styled-components";
import gotService from "../../services/gotServices";
import Spinner from "../spinner";
import ErrorMessage from "../error";
export default class RandomChar extends Component {
gotService = new gotServi... |
Java | UTF-8 | 3,260 | 3.171875 | 3 | [] | no_license | package com.lando.gameoflife.models;
import java.util.ArrayList;
import com.lando.gameoflife.utils.EnumUtils;
public class GameStateData {
private static final String ARGUMENT_EXCEPTION_MESSAGE = "Indicies out of bounds for the grid";
public final int width;
public final int height;
private final Li... |
Python | UTF-8 | 104 | 2.75 | 3 | [] | no_license | array = ["one", "two", "one"]
oneset = set(array)
print (oneset)
if "one" in oneset:
print("great")
|
Java | UTF-8 | 720 | 2.234375 | 2 | [] | no_license | package com.bookstore.dao.Impl;
import com.bookstore.dao.BookDAO;
import com.bookstore.model.Book;
import com.bookstore.util.HibernateUtil;
import java.util.List;
/**
* Created by googo on 19/03/2017.
*/
public class BookDAOImpl{
public boolean addBook(Book book){
//todo
return HibernateUtil.sa... |
C++ | UTF-8 | 2,386 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <pthread.h>
#include <chrono>
using namespace std;
const unsigned long N = 900000;
void one_thread_sum(long* begin, long* end)
{
auto tstart = chrono::high_resolution_clock::now();
unsigned long sum = 0;
for(; begin < end; ++begin)
sum += *begin;
auto tend = ch... |
Java | UTF-8 | 9,626 | 1.804688 | 2 | [
"Apache-2.0"
] | permissive | /*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://duracloud.org/license/
*/
package org.duracloud.security.vote;
import java.util.HashMap;
import java.util.List;
import java.ut... |
Java | UTF-8 | 490 | 1.984375 | 2 | [] | no_license | package kz.akmarzhan.nationaltest.bus.events;
import java.util.List;
import kz.akmarzhan.nationaltest.models.UserPredmet;
/**
* Created by Akmarzhan Raushanova on 5/20/2017.
* Working on NationalTest. MobiLabs
* You can contact me at: akmarzhan.raushnanova@is.sdu.edu.kz
*/
public class UserPredmetsLoadedEvent {... |
Java | UTF-8 | 2,280 | 2.03125 | 2 | [] | no_license | /*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the "License"). You may not use this file except
* in compliance with the License.
*
* You can obtain a copy of the license at
* https://jwsdp.dev.java.net/CDDLv1.0.html
* See the License for the sp... |
JavaScript | UTF-8 | 1,244 | 2.6875 | 3 | [] | no_license | 'use strict';
// process links. currently they have no geometry information
module.exports = function(nodes, lookup) {
var removeList = [];
nodes.forEach(function(node){
if( node.geometry !== null ) {
return;
}
if( node.properties.origin && node.properties.terminus ) {
var origin = looku... |
PHP | UTF-8 | 1,986 | 2.609375 | 3 | [] | no_license | <?php
namespace App\Entity\Admin;
use App\Entity\Admin\Permission;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass="App\Repository\Admin\Sub... |
Java | UTF-8 | 1,035 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | package org.openstack4j.model.common;
/**
* Represents an identifier which can either be an ID or Name
*
* @author Jeremy Unruh
*/
public class Identifier {
private final Type type;
private final String id;
private Identifier(Type type, String id) {
this.type = type;
this.id = id;
... |
PHP | UTF-8 | 6,332 | 2.8125 | 3 | [] | no_license | <?php
class crudUmum {
private $db;
public $sel_q="";
public $table_q="";
public $where_q="";
public $join_q="";
public $query="";
function __construct($DB_con) {
$this->db = $DB_con;
$this->query="";
}
public function query() {
if (!$this->sel_q) {
$this->sel_q='SELECT * ';
}
if (!$this->table_q... |
C++ | UTF-8 | 500 | 3.109375 | 3 | [] | no_license | //
// Created by Karl on 12/12/2015.
//
#include "position.h"
int Position::posX() {
return x;
}
int Position::posY() {
return y;
}
int Position::posZ() {
return z;
}
Position::Position() {
x = y = z = 0;
}
Position::Position(int suppliedX, int suppliedY, int suppliedZ) {
x = suppliedX;
y ... |
Python | UTF-8 | 3,028 | 2.703125 | 3 | [] | no_license | import scaling_model
from testutil import gae_model
#from testutil import testsize
#import logging
from google.appengine.ext import ndb
class VotesCounter(scaling_model.ScalingModel):
"""An example of something that might be sharded.
If a lot of people will be voting on an item then it could easily cause
... |
Python | UTF-8 | 1,084 | 3.828125 | 4 | [] | no_license | # 一、叠加多个装饰器的加载,运行分析
def deco1(func):
def wrapper1(*args, **kwargs):
print('正在运行===>deco1.wrapper1')
res1 = func(*args, **kwargs)
return res1
return wrapper1
def deco2(func):
def wrapper2(*args, **kwargs):
print('正在运行===>deco2.wrapper2')
res2 = func(*args, **kwargs... |
Java | UTF-8 | 3,547 | 2.015625 | 2 | [] | no_license | package com.nexttech.easybusinesscard.Fragments;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
... |
C++ | UTF-8 | 8,480 | 3.296875 | 3 | [] | no_license | // Project Name: Final Project
// Name: Allysa Sewell
// Date: 6/9/18
// Class: CS 172
#include <iostream>
#include <iomanip>
#include <fstream>
#include "Ecosystem.h"
#include "Species.h"
#include "IndependentSpecies.h"
#include "PredatorPrey.h"
using namespace std;
//displays the genetic makeup of a p... |
Java | UTF-8 | 96 | 1.523438 | 2 | [
"Apache-2.0"
] | permissive | package com.p2p.directions;
//. by Haseem Saheed
public interface Parser {
public Route parse();
} |
Java | UTF-8 | 1,959 | 1.820313 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2010-2020 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... |
JavaScript | UTF-8 | 883 | 2.5625 | 3 | [] | no_license | const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
const { Wizard } = require('./models');
const model = require('./models');
app.use('/*', async (req, res) => {
let transaction = await model.sequelize.transaction();
try {
const createdWizard = await Wiza... |
Shell | UTF-8 | 1,214 | 2.984375 | 3 | [] | no_license | #!/bin/bash
# install python3
apt-get install python3.9 python3-pip
# install docker
apt-get install \\n apt-transport-https \\n ca-certificates \\n curl \\n gnupg \\n lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
e... |
C# | UTF-8 | 781 | 3.03125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using WildFarm.Foods;
namespace WildFarm.Animals
{
public class Dog : Mammal
{
private static double GainValue = 0.4;
public Dog(string name, double weight, string livingRegion)
: base(name, weight, livingRegion)
... |
Java | UTF-8 | 9,402 | 2.890625 | 3 | [] | no_license | package com.example.lenovo.textviewspannerdalogexercise.utils;
import android.text.TextUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
public class DateUtils {
public static final String FORMAT_YYYYMMDDHHMMSS =... |
PHP | UTF-8 | 1,391 | 2.53125 | 3 | [] | no_license | <?php
class Login extends Controller
{
public function index()
{
if (isset($_SESSION['pseudo'])) {
header('Location: ' . WEBROOT);
}
$data = array(
'error' => "",
'pseudo' => "",
'password' => "",
);
$this->loadModel('UserM... |
Python | UTF-8 | 1,536 | 2.953125 | 3 | [
"MIT"
] | permissive | """Map postonal chord names to symbols commonly found on lead sheets."""
from copy import deepcopy
from music21.chord import Chord
from orbichord.identify import chordSymbolIndex
from orbichord.maps import SYMBOL_INDEX_TO_FIGURE
def hasChordSymbolFigure(chord : Chord) -> bool:
"""Return true if the chord has fig... |
Ruby | UTF-8 | 2,429 | 3.546875 | 4 | [] | no_license | # frozen_string_literal: true
module ConnectFour
# Board handles the state of the board
class Board
def initialize
@board = Array.new(6) { Array.new(7) { '.' } }
end
def display
display = "\n"
@board.each do |line|
line.each_with_index do |e, i|
display += '| ' if i... |
Shell | UTF-8 | 589 | 2.625 | 3 | [] | no_license | #!/usr/bin/env bash
echo "initializing submodules"
git submodule init
git submodule update
echo "Deleting the old files"
rm ~/.bashrc
rm ~/.bash_prompt
rm ~/.gitconfig
rm ~/.gitignore
rm ~/.githelpers
rm ~/bin
rm ~/.inputrc
echo "Symlinking files"
ln -s `pwd`/bashrc ~/.bashrc
ln -s `pwd`/bash_prompt ~/.bash_prompt
l... |
Java | UTF-8 | 347 | 2.390625 | 2 | [] | no_license | import org.jetbrains.annotations.Contract;
public class Task_5 {
@Contract("_ -> fail")
public static void main(String[] args) {
iCanThrowException();
}
@Contract(" -> fail")
private static void iCanThrowException() {
Object ref = null;
assert false;
final String s... |
Python | UTF-8 | 233 | 2.640625 | 3 | [] | no_license | secret = [0x46,0x4D,0x43,0x4A,0x31,0x7C,0x6E,0x3B,0x7C,0x68,0x3E,0x6A,0x79,0x40,0x81,0x82,0xA1]
string = ''
for i in range(len(secret)):
print(secret[i])
print(i)
print(chr(secret[i]-i))
string += chr(secret[i]-i)
print(string) |
Java | UTF-8 | 935 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | package com.kevoroid.andhackernews.helpers;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* Created by kevin on 5/27/17.
*/
public class TimeHelper {
public static long getCurrentEpochTime() {
return System.currentTimeMillis();
}
public static long get... |
Java | UTF-8 | 2,472 | 2.65625 | 3 | [] | no_license | package com.alimuya.kevvy.reflect.field;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.VarInsnNode;
import com.alimuya.kevvy.reflect.utils.AsmUtils;
/**
* @author ov... |
Markdown | UTF-8 | 606 | 2.671875 | 3 | [] | no_license | # Carplanner
REST API for making reservations for a rent car
## Setting up the enviroment
These instuction are made as a simple reminder how to install pyton virtual enviroment. Also how to get started on your localmachine
to create a virtual enviroment:
```
python3 -m venv [NAME OF THE ENVIROMENT]
```
How to start... |
Java | UTF-8 | 369 | 1.945313 | 2 | [] | no_license | package com.hkk.toolsmanage.lickdog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class LickDogBiz {
@Autowired
private LickDogManager lickDogManager;
/**
* 新增学生信息
*/
public void addStudent() {
l... |
Python | UTF-8 | 1,339 | 3.40625 | 3 | [
"MIT"
] | permissive | import sys
from PyQt5.QtWidgets import *
class Window(QWidget):
def __init__(self):
super().__init__()
# Set the window size
self.setGeometry(50, 50, 600, 400)
# Set the window title
self.setWindowTitle("Window")
self.UI()
def UI(self):
# Creating... |
Java | UTF-8 | 166 | 1.765625 | 2 | [] | no_license | package com.yue.service;
import java.util.List;
import com.yue.model.Teacher;
public interface ITeacherService {
public List<Teacher> queryTeachers();
}
|
SQL | UTF-8 | 454 | 2.5625 | 3 | [] | no_license | set search_path to kaggle_see_click_predict_fix;
create view votes_labels as select num_votes from raw_train order by id asc;
create view comments_labels as select num_comments from raw_train order by id asc;
create view views_labels as select num_views from raw_train order by id asc;
\copy (select * from votes_label... |
PHP | UTF-8 | 777 | 3.296875 | 3 | [] | no_license | <?php
/*
Listing 15-2
A PHP Nested Array Being First Encoded to JSON and Then Decoded Back to PHP
*/
$books = array(
array("author" => "Lewis Carroll",
"title" => "Alice's Adventures in Wonderland",
"year" => 1865),
array("author" => "Yann Martel",
"title" => "Life of Pi",
"year" => 2001),
array("author" =>"Junot... |
SQL | UTF-8 | 3,713 | 2.90625 | 3 | [
"MIT"
] | permissive | drop sequence weather.zseq_vantage_pro_loop_data;
create sequence weather.zseq_vantage_pro_loop_data
increment by 1
no minvalue
no maxvalue
cache 1
start 1;
drop table weather.vantage_pro_loop_data;
create table weather.vantage_pro_loop_data (
id bigint,
eventtime timestamp with time zone not null,
bar... |
C++ | UTF-8 | 771 | 2.578125 | 3 | [] | no_license | #include<stdio.h>
#define for(p,x,y) for(p=x;p<=y;p++)
#define ll long long int
ll num=0;
bool check(ll a)
{
if (a<0||a>9)
return false;
return true;
}
int solve(ll p,ll q,ll r,ll s)
{
ll a,b,c,d,count=0;
for(a,0,9)
{
if(check(b=p-a))
if(check(c=q-a))
if(check(d=r-b))
if(c+d==s)
count... |
Markdown | UTF-8 | 12,571 | 2.921875 | 3 | [
"MIT"
] | permissive | # stduuid
A C++17 cross-platform single-header library implementation **for universally unique identifiers**, simply know as either UUID or GUID (mostly on Windows). A UUID is a 128-bit number used to uniquely identify information in computer systems, such as database table keys, COM interfaces, classes and type librar... |
Java | UTF-8 | 1,506 | 2.875 | 3 | [] | no_license | /**
* Guitar.java
* 22-Feb-2014 : 11:13:26 pm
*
*/
package head.first.OOAD.chapter01.RicksGuitarV01;
/**
* @author ubuntu
* @packageName = head.first.OOAD.chapter01.RicksGuitarV01:Guitar.java
* @createdOn: 22-Feb-2014 : 11:13:26 pm
*
* This is a file for my practice and notes of "Head First
* OOAD, 1nd edi... |
JavaScript | UTF-8 | 8,579 | 3.015625 | 3 | [] | no_license | 'use strict'
var gCurrScore;
var gBoard = [];
var gLevel = {
SIZE: 8,
MINES: 15
};
var gState = {
score: 0,
marked: 0
}
var gCellExpandedCounter = 0;
var gIsGameOver = false;
var gIsGameWon = false;
var isTimerOn = false;
var unsetTime = false;
var MINE = '*';
var EMPTY = ' ';
var MAXSHOWNCELLS = (gLev... |
Markdown | UTF-8 | 3,520 | 2.828125 | 3 | [] | no_license | ---
title: How to configure this blog
layout: page
comments: yes
---
There are three big steps listed below to construct a jekyll
blog if I understand right.
* Accomplish the first step, you can write blogs already.
* For me, the second step is only used for testing. A local server
may also be useful for... |
TypeScript | UTF-8 | 4,721 | 2.96875 | 3 | [
"MIT"
] | permissive | import { mat4 as glMat4, vec3 as glVec3, quat as glQuat, vec4 as glVec4 } from "gl-matrix";
import { quat } from "./quat";
import { vec3 } from "./vec3";
import { vec4 } from "./vec4";
import { vec2 } from "./vec2";
export type mat4 = glMat4;
export function Matrix4x4(values: number[])
{
const mat = g... |
Markdown | UTF-8 | 1,051 | 2.703125 | 3 | [] | no_license | 如果你看到这个页你可以关注下{79px}
====
可以直接在这里看Demo:http://eternityspring.github.io/79px-html/
<del>这里的东西是{79px}的静态框架。终于花时间整理了一下。大家可以自己下载学习和使用这里的代码和设计。
接下来我会专心的整理基于这里静态页的Drupal模版。然后开始着手下一次的改版。因为我打算每年改版一次,一年就那么任性的折腾自己一次。</del>
<del>当然,如果时间允许,我也会考虑基于这个静态文件做一个WordPress主题。当然了,接下来做的Drupal和WordPress主题不是开源的。可能会考虑收费。价格待定。不过肯定在365*2¥以内</... |
TypeScript | UTF-8 | 517 | 2.96875 | 3 | [] | no_license | import oneEditAway from "./exercicio1";
import getCharAndCount from "./exercicio2";
//Exercicio 1
console.log(oneEditAway("banan", "banana"));
console.log(oneEditAway("bananak", "banana"));
console.log(oneEditAway("banara", "banana"));
console.log(oneEditAway("bananaaa", "banana"));
//Exercicio 2
console.log(getCharA... |
C# | UTF-8 | 1,297 | 2.8125 | 3 | [
"MIT"
] | permissive | using System;
using MyCompiler.Core.Exceptions;
using MyCompiler.Core.Models.ConstructionSubsets;
using MyCompiler.Core.Models.LexicalAnalyzer;
using MyCompiler.Core.Models.SyntacticAnalyzes;
namespace MyCompiler.RegularExpressionApp
{
public class Program
{
private static void Main(string[] args)
... |
Markdown | UTF-8 | 27,464 | 3.09375 | 3 | [] | no_license | # 6 작동 위임
Prototoype 체계 - 한 객체가 다른 객체를 참조하기 위한 내부 링크. 이러한 링크는 처음 참조하는 객체에 존재하지 않는 프로퍼티/메서드를 참조하려고 할 경우에 활용됨
엔진은 Prototype 링크를 따라가며 연결된 객체마다 프로퍼티/메서드가 있는지 탐색. 발견되지 않으면 다음 Prototype 링크에 연결된 객체를 타고 이동하며 수색 - 한 무더기의 객체 간 연결고리가 '프로토타입 연쇄'
자바스크립트의 가장 중요한 핵심 기능이자 실제적인 체계는 '객체를 다른 객체와 연결하는 것'에서 비롯
## 6.1 위임 지향 디자인으로 ... |
Shell | UTF-8 | 3,763 | 2.921875 | 3 | [] | no_license | unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY
unset AWS_SESSION_TOKEN
DURATION=3600
NAME="${4:-$LOGNAME@`hostname -s`}"
echo
echo
USER=$(aws sts get-caller-identity --profile default --query 'Arn' --output text | awk -F: '{print $6}' | awk -F/ '{print $2}')
echo
echo -e "Hey, \e[1;32m$USER\e[0m!"
echo
echo "Pleas... |
C# | UTF-8 | 2,180 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using backEnd.Models;
using backEnd.Persistence.IRepositories;
using Microsoft.EntityFrameworkCore;
namespace backEnd.Persistence.Repositories
{
public class EmployeeDesignationRepository... |
Java | UTF-8 | 39,103 | 2.0625 | 2 | [] | no_license | package com.artqiyi.dahuashai.payment.domain;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.Generated;
@Generated("coin_translog")
public class CoinTranslogExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> o... |
Markdown | UTF-8 | 1,667 | 3.109375 | 3 | [] | no_license | # Prettier
代码格式化程序。
## 使用方式
1. 在`Visual Studio Code`中安装插件[Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)。
2. 在`Visual Studio Code`系统设置中,将选择`editor.formatOnSave`改为`true`;同时选项`files.autoSave`的值不能为`autoSaveDelay`。
3. 在项目中使用命令`yarn add prettier --dev`或`npm install ... |
Java | UTF-8 | 189 | 1.585938 | 2 | [
"Apache-2.0"
] | permissive | package com.stackroute.bookingservice.service;
import com.stackroute.kafka.domain.CardDetails;
public interface CardService {
CardDetails saveCardDetails(CardDetails cardDetails);
} |
Markdown | UTF-8 | 952 | 3.078125 | 3 | [
"MIT"
] | permissive | ### Clonando ramas remotas
Primero tenemos que clonar el repositorio git correspondiente y meternos en su carpeta:
$ git clone git://example.com/myproject
$ cd myproject
Luego, miramos las ramas que tenemos en local:
$ git branch
* master
Si hubiera alguna rama remota, esta no aparece. Para ver qué... |
Java | UTF-8 | 5,982 | 2.296875 | 2 | [] | no_license | package org.hopto.eriksen.controller;
import org.hopto.eriksen.domain.SshLogEntry;
import org.hopto.eriksen.domain.UserNameStatistics;
import org.hopto.eriksen.service.SshLogEntryRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import o... |
C# | UTF-8 | 4,205 | 3 | 3 | [
"BSD-2-Clause"
] | permissive | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace LargeSort
{
class Program
{
static void Main(string[] args)
{
FileInfo tSortFile = new FileInfo("data.dat");
int tSortFileLines = 18765432;
... |
Java | UTF-8 | 191 | 2.640625 | 3 | [] | no_license |
public class Hellojava2 {
public static void main(String[] args) {
int i = 100;
double d = 10.5555;
boolean b = true;
System.out.println(i);
System.out.println(d);
}
}
|
Java | UTF-8 | 2,410 | 2.453125 | 2 | [] | no_license | package test;
import domain.User2;
import junit.framework.TestCase;
import mappertest9_23.UserMapper;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import java.io.InputS... |
Java | ISO-8859-2 | 2,207 | 2.6875 | 3 | [] | no_license | package H2;
import H2.Profiler.Profiles;
import Other.UTools;
import ij.ImagePlus;
import ij.gui.Plot;
import ij.io.FileSaver;
import ij.io.Opener;
public class E2 {
public static void main(String[] args) {
String PATH = "C:/Users/walup/Documents/Imgenes/skeleton.png";
String PATH_2 = "C:/Users/walup/D... |
C++ | UTF-8 | 1,981 | 3.25 | 3 | [] | no_license | #include <algorithm>
#include "line_segment.h"
LineSegment::LineSegment(const Point3& p1,
const Point3& p2) : _p1(p1), _p2(p2) {
}
std::string LineSegment::to_str(void) const {
return _p1.to_str() + std::string(" -- ") + _p2.to_str();
}
static inline double clamp(const double val,
... |
Java | UTF-8 | 2,092 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | package org.esupportail.ws.remote.beans;
import java.io.Serializable;
/**
* The class that represents accounts.
*/
public class MsgIdAndPhone implements Serializable {
/**
*
*/
private static final long serialVersionUID = -7187358986757940568L;
/**
* message Id
*/
private java.lang.I... |
C++ | UTF-8 | 1,023 | 2.78125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int a[32],b[32];
struct tree{
int n;
tree *l,*r;
}*root;
void build(int as,int ae,int bs,int be,tree*& root)
{
root->n=b[bs];
int t=find(a+as,a+ae,b[bs])-a;
if(t-1<as) root->l=NULL;
else{
root->l = new tree;
build(as,t-1,... |
Python | UTF-8 | 1,338 | 3.390625 | 3 | [
"ISC"
] | permissive | # -*- coding: utf-8 -*-
"""Defines `json.JSONEncoder` subclass
that makes parsed object (including bytes and bitarray) JSON-serializable
"""
import bitarray
import json
import sys
class JSONEncoder(json.JSONEncoder):
"""JSON encoder with additional support for bytes and bitarray
Examples:
>>> JSON... |
C++ | UTF-8 | 1,121 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int fence(int left, int right);
vector<int> stick;
int main(){
int c;
cin >> c;
vector<int> result;
while(c--){
int n;
cin >> n;
stick.clear();
for(int i=0; i<n; i++){
int temp... |
Shell | UTF-8 | 2,325 | 3.53125 | 4 | [] | no_license | # Get SSL Certificates from Let's Encrypt who provides Free SSL Certificates.
# Refer to the details for Let's Encrypt official site below.
# ⇒ https://letsencrypt.org/
# By the way, expiration date of a cert is 90 days, so you must update within next 90 days later.
#
## Install Certbot Client which is the tool to g... |
JavaScript | UTF-8 | 2,936 | 2.640625 | 3 | [] | no_license | // ***********************************
// React:
// ***********************************
import React, {useState,useEffect,useReducer} from 'react';
// ***********************************
// Components:
// ***********************************
import RenderProductCard from './RenderProductCard';
import Filter from './... |
JavaScript | UTF-8 | 1,228 | 4.25 | 4 | [] | no_license | //Destructuring Assignment array
// let number = [1,2,3,4];
// let [a,b,c,d] = number;
// console.log(4);
// Destructuring Assignment Object
// const mhs = {
// nama: `Fadli`,
// nim: 20102050051,
// email: `stupidlearner0407@gmail.com`
// }
// const {nama,nim,email} = mhs;
// console.log(n... |
C++ | UTF-8 | 4,717 | 2.625 | 3 | [] | no_license | #include "mpfi.h"
#ifndef INTERVAL_H
#define INTERVAL_H
class Interval
{
mpfi_t x;
bool leftexact;
bool rightexact;
public:
Interval();
Interval(const mp_prec_t);
Interval(const mpfi_t);
Interval(const double);
Interval(const double,const mp_prec_t);
Interval(double,double);
Interval(double,double,cons... |
Markdown | UTF-8 | 5,432 | 2.78125 | 3 | [] | no_license | # Impression Calculator
Project solves a [knapsack problem](https://en.wikipedia.org/wiki/Knapsack_problem) with repetition via async REST API.
The knapsack problem is optimized by reducing input data and finding common divisor for size of knapsack and item.
The application is a microservice created in [Dropwizard fr... |
Shell | UTF-8 | 1,410 | 3.796875 | 4 | [
"MIT"
] | permissive | #!/bin/sh
### BEGIN INIT INFO
# Provides: looker
# Required-Start: $remote_fs $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Looker Web Application
### END INIT INFO
# /etc/init.d/looker: start and stop the Looker Web application
test -x {{ deploy_dir }}/looker || exi... |
Markdown | UTF-8 | 3,265 | 3.84375 | 4 | [] | no_license | # 426. Binary Tree Vertical Order Traversal
Given a binary tree, return the vertical order traversal of its nodes' values. \(ie, from top to bottom, column by column\).
If two nodes are in the same row and column, the order should be from left to right.
Examples:
1. Given binary tree `[3,9,20,null,null,15,7]`,... |
JavaScript | UTF-8 | 1,242 | 2.875 | 3 | [] | no_license | window.onload=function(){
writeAll();
document.getElementById("search").addEventListener("blur", function(){
$.ajax({
url:"course.php",
dataType:"json",
method:"post",
success:function(data){
let html=$("#search").val();
dat... |
JavaScript | UTF-8 | 105 | 3.046875 | 3 | [] | no_license | let lowerCaseString = str => str.toLowerCase();
let test = lowerCaseString("AsHkAn");
console.log(test); |
C++ | UTF-8 | 23,109 | 2.515625 | 3 | [] | no_license | #ifndef __SUBFUNC_CPP__
#define __SUBFUNC_CPP__
#include "ConstPara.h"
#include "matrix3D.h"
// #include <math.h>
#include <cmath>
using namespace std;
// ##########################
// Define initial condition
// ##########################
matrix InitialCondition(double x, double y, double z)
{ // Sod shoc... |
Python | UTF-8 | 938 | 2.6875 | 3 | [] | no_license | import asyncio
from confluent_kafka import Consumer
import logging
logger = logging.getLogger(__name__)
BROKER_URL = "PLAINTEXT://localhost:9092"
TOPIC = "com.udacity.crime"
async def consume(topic_name):
c = Consumer({"bootstrap.servers": BROKER_URL, "group.id": "31", 'auto.offset.reset': 'earliest'})
c.sub... |
Markdown | UTF-8 | 3,190 | 3.140625 | 3 | [] | no_license | [上一章](./第5章.md)
# 库和API设计
## 第53条 保持一致的约定
- 在变量命名和函数形参中使用一致的约定
- 不要偏离用户在他们的开发平台中很可能遇到的约定
## 第54条 将undefined看作没有值
- 使用描述性的字符串或者命名布尔属性的对象, 而不要使用undefined或null来代表特定应用标志
- 提供参数默认值应当采用测试undefined的方式,而不是检查arguments.length
## 第55条 接收关键字参数的选项对象
- 使用选项对象使得API更具可读性,更容易记忆
- 所有通过选项对象提供的参数应当被视为可选的,如果有一两个必选参数,最好使他们独立于选项对象
- 使用ex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.