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 | 1,721 | 2.890625 | 3 | [] | no_license | ### Creating A Buggy App
Wait, why are we creating a buggy app? Well, so we can fix it! This repo has a [CloudFormation](https://aws.amazon.com/cloudformation/) template we can deploy. The template describes the infrastructure of an app, and the CloudFormation service takes that template and provisions the app into you... |
C++ | UTF-8 | 650 | 3.40625 | 3 | [] | no_license | #include <iostream.h>
#include <conio.h>
int arr[10];
int binarySearch(int s, int e, int tst)
{
static int pos=NULL;
int m=(s+e)/2;
if(pos==m)
return pos;
else if(tst<arr[m]) e=m;
else if(tst>arr[m]) s=m;
else if(e==s+1) return NULL;
else pos=m;
binarySearch(s, e, tst);
}
void main()
{... |
C++ | WINDOWS-1252 | 22,739 | 2.890625 | 3 | [] | no_license | #include <windows.h>
#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <fstream>
#include "GestionTableau.h"
#include "Graphisme.h"
using namespace std;
//Dclaration de la fonction qui affichera un message d'erreur lorsque le nom dpasse 50 caractres
void afficheErreurTailleNom()
{
... |
C# | UTF-8 | 5,208 | 2.65625 | 3 | [] | no_license | using System.Reflection;
using AutoFixture.Idioms;
using Bstm.UnitTesting;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
namespace Bstm.DirectoryServices.UnitTests
{
public class SearchFilterTests : TestBase
{
public SearchFilterTests(ITestOutputHelper testOutputHelper) : base(testOut... |
SQL | UTF-8 | 3,054 | 3.25 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpg... |
Python | UTF-8 | 659 | 3.140625 | 3 | [] | no_license | import sys
import time
import logging
logging.basicConfig(format='%(message)s', level=logging.INFO)
PROBLEM = 'Reordering Train Cars'
def solve():
return ''
if __name__ == '__main__':
# Problem header
logging.info('@ '+PROBLEM)
global_time = time.time()
# Number of cases
cases = int(sys.st... |
Java | UTF-8 | 1,881 | 1.851563 | 2 | [] | no_license | package io.linx.prometheus;
import io.linx.prometheus.matchers.CustomMatchers;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.TestRestTemplate;
... |
Java | UTF-8 | 577 | 3.234375 | 3 | [] | no_license | package com.raf.calcul;
/**
* L'interface de notation.
*
* @param <T>
* la notation
* @author RAF
*/
public interface Notation<T> extends Comparable<T> {
/**
* Retourne une nouvelle notation résultant de l'ajout de la note à la notation.
*
* @param note
* la note
* @return l... |
Python | UTF-8 | 795 | 3.328125 | 3 | [] | no_license | class LRUCache(object):
def __init__(self, store, size=10):
self.store = store
self.size = size
self.keys = []
self.cache = {}
def access(self, key):
if key in self.cache:
to_remove = self.keys.index(key)
del self.keys[to_remove]
self.... |
C | UTF-8 | 1,046 | 2.828125 | 3 | [] | no_license | #include "interpreter.h"
int evaluate(beat_context* ctx){
int stack_memory[MAX_STACK];
stack s = {stack_memory, 0};
char* cp = ctx->expression;
token t;
int n;
while(1){
//skip whitespace
while(*cp == ' ' || *cp == '\n' || *cp == '\t') cp++;
if(*cp == 0x00) break;
t = get_token(cp);
//HARDCODE: the n... |
Java | UTF-8 | 1,336 | 2.265625 | 2 | [
"Apache-2.0"
] | permissive | package com.karcompany.productsearch.presenters;
import com.karcompany.productsearch.config.AppConfig;
import com.karcompany.productsearch.models.Result;
import com.karcompany.productsearch.models.productdetailsresponse.ProductDetails;
import com.karcompany.productsearch.views.ProductImagesView;
import com.karcompany.... |
Markdown | UTF-8 | 3,251 | 2.96875 | 3 | [
"MIT"
] | permissive | ---
status: "active"
title: "Validating dependencies in your project with depcheck package"
layout: post
author: Wilson Mendes
date: '2021-04-22T09:13:00.419Z'
path: /posts/validating-dependencies-in-your-project-with-depcheck-package/
category: "post"
lang: en
tags: ['frontend', 'javascript', 'frontend', 'tip', 'js', ... |
C | UTF-8 | 1,908 | 3.65625 | 4 | [
"MIT"
] | permissive | // Satvik Choudhary
// 111601021
// 10.64.1.174
// Serial number c
// Question 4
// Assumption - Answers in the file out.txt. I am just giving the row numbers of queens for each successive columns. To get the answer in terminal just comment the freopen function in main 2nd line.
// Logic - recursive search or backtrack... |
Markdown | UTF-8 | 11,836 | 3 | 3 | [] | no_license | # CS_Books/Videos/学习资源 小齐精选
现在计算机书籍很多,单纯的罗列没有意义。
一本好书,或许会改变我们的一生;而一本烂书,可能会把我们带偏。
在这个项目里,我会把我看过的、认可的好书、优质的视频分享出来,并给出推荐理由。
### **先给本仓库点个 Star,让我知道这个对你有帮助,以便督促我继续更新,感谢。**
如果不知道从哪里开始看起、不知道学习路线是怎样的,建议先读读我的这篇学习路线的文章: #TODO
如何系统的自学?https://teachyourselfcs.com/
强烈推荐计算机趣味入门视频:
**Crash Computer Science** [B站链接](https... |
Java | UTF-8 | 319 | 2.34375 | 2 | [] | no_license | package algorithms.sorting.heap.operations;
import lombok.Getter;
/**
* Created by Chen Li on 2018/2/10.
*/
public abstract class AbstractHeapOperations<K extends Comparable<K>> implements HeapOperations<K> {
@Getter
protected int compares = 0;
protected abstract boolean isHigherPriority(K key1, K key2);
}
|
Java | UTF-8 | 2,846 | 1.617188 | 2 | [] | no_license | package com.motoli.apps.allsubjects;
/**
* Part of Project Motoli All Subjects
* for Education Technology For Development
* created by Aaron D Michaelis Borsay
* on 8/12/2015.
*/
final class Constants {
static final String LOGCAT = "My Logs";
static final String GUEST_NAME="Guest";
st... |
Java | UTF-8 | 3,011 | 3.84375 | 4 | [
"MIT"
] | permissive | package opgave2;
import java.util.Arrays;
public class SorteretTabel {
//vi starter med at lave nogle variabler
int[] array;
int a;
//We make differnet constructors debending on what we want to do with the input. Java knows what constructor to use
//for certain input types
public SorteretTabel(SorteretTabel... |
C | UTF-8 | 3,945 | 2.515625 | 3 | [
"BSD-2-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | //------------------------------------------------------------------------------
// LAGr_SampleDegree: sample the degree median and mean
//------------------------------------------------------------------------------
// LAGraph, (c) 2019-2022 by The LAGraph Contributors, All Rights Reserved.
// SPDX-License-Identifie... |
SQL | UTF-8 | 2,340 | 3.3125 | 3 | [
"MIT"
] | permissive |
CREATE VIEW [Valid].[LearnerEmploymentStatusDenorm]
AS
SELECT
les.[UKPRN]
,les.[LearnRefNumber]
,les.[EmpStat]
,les.EmpId
,les.[DateEmpStatApp]
,les.[AgreeId]
,[EmpStatMon_BSI].ESMCode AS ESMCode_BSI
,[EmpStatMon_EII].ESMCode AS ESMCode_EII
,[EmpStatMon_LOE].ESMCode AS ESMCode_LOE
,[EmpStatMon_LOU].ESMC... |
Python | UTF-8 | 2,386 | 3.859375 | 4 | [] | no_license | # importing "heapq" to implement heap queue
import heapq
# initializing list
li = [5, 7, 9, 1, 3]
# using heapify to convert list into heap
heapq.heapify(li)
# printing created heap
print ("The created heap is : ",(list(li)))
heapq.heappush(li,8)
print ("The created heap is : ",(list(li)))
heapq.heappop(li)
print... |
Java | UTF-8 | 634 | 1.632813 | 2 | [] | no_license | package com.htsoft.oa.service.info;
import java.util.Date;
import java.util.List;
import com.htsoft.core.service.BaseService;
import com.htsoft.core.web.paging.PagingBean;
import com.htsoft.oa.model.info.Notice;
public abstract interface NoticeService extends BaseService<Notice> {
public abstract List<Not... |
JavaScript | UTF-8 | 994 | 2.6875 | 3 | [] | no_license | const notificationAtStart = ''
const initialState = notificationAtStart
const notificationReducer = (state = initialState, action) => {
console.log('state now: ', state)
console.log('action', action)
switch (action.type) {
case 'CREATE_NOTIFICATION':
return action.data
case... |
SQL | UTF-8 | 1,484 | 3.1875 | 3 | [] | no_license | CREATE TABLE CRM_T_BIZ_CHAIN_CONTACT
(
C_PID VARCHAR2(32) NOT NULL ENABLE,
C_ROLE VARCHAR2(10),
C_NAME VARCHAR2(20),
C_DUTY VARCHAR2(20),
C_PHONENUMBER VARCHAR2(20),
C_DECISION_WEIGHT VARCHAR2(20),
C_SUPPORT_LEVEL VARCHAR2(20),
C_BIZ_ORG_ID VARCHAR2(32)
)
tablespace TS_CRM
pctfree 10
in... |
Shell | UTF-8 | 702 | 3.203125 | 3 | [] | no_license | #!/bin/bash
# Install dependencies (debbootstrap)
sudo apt-get install debootstrap curl
# Fetch the latest Kali debootstrap script from git
curl "http://git.kali.org/gitweb/?p=packages/debootstrap.git;a=blob_plain;f=scripts/kali;h=50d7ef5b4e9e905cc6da8655416cdf3ef559911e;hb=refs/heads/kali/master" > kali-debootstrap ... |
JavaScript | UTF-8 | 5,329 | 3.015625 | 3 | [
"MIT"
] | permissive | const ticTacToe = {
playerNames: {
player1: "Player 1",
player2: "Player 2"
},
rows: 3,
columns: 3,
turns: [],
currentPlayerId: "player1",
firebase: {
createId: function() {
return firebase
.database()
.ref("games")
.push().key;
},
createGame: function(g... |
C | UTF-8 | 453 | 2.921875 | 3 | [] | no_license | /**
* \file Erreur.h
* \brief Macro Permettant d'affichier des erreurs
* \author PINTO Bruno
*
*
*/
#ifndef __ERREUR__
#define __ERREUR__
/* ### BIBLIOTHEQUE ### */
#include <stdio.h>
#include <stdlib.h>
/* ### MACRO ### */
#define ERROR(STR) fprintf(stderr, "%s ligne: %d dans %s\n", STR, __LINE__, __FILE... |
C++ | UTF-8 | 60,401 | 2.53125 | 3 | [
"MIT"
] | permissive | #define _WIN32_WINNT 0x0500
#include <iostream>
#include <windows.h>
#include <conio.h>
#include <time.h>
#include <queue>
#include <iomanip>
#include <sstream>
#include <fstream>
#define Void_Block 100
#define Grass_Block 101
#define Rabbit_Grass 102
#define Rabbit_Block 103
#define Hare_Grass 104
#def... |
Java | UTF-8 | 2,973 | 4.09375 | 4 | [] | no_license | import java.util.*;
/*
249. Group Shifted Strings
Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequence:
"abc" -> "bcd" -> ... -> "xyz"
Given a list of strings which contains only lowercase alphabets, group all strings... |
C# | UTF-8 | 887 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Adventure.Feature.EventSearchComponent.Filtering.Interfaces;
using Adventure.Feature.EventSearchComponent.Models;
namespace Adventure.Feature.EventSearchComponent.Filtering
{
public class SortByFilter : IFilter<Ev... |
Swift | UTF-8 | 450 | 2.953125 | 3 | [] | no_license | //
// WACurrentWeatherData.swift
// Weather-App
//
// Created by Дарья Астапова on 1.03.21.
//
import Foundation
struct WACurrentWeatherData: Decodable {
let name: String
let main: Main
let weather: [Weather]
}
struct Main: Decodable {
let temp: Double
let feelsLike: Double
enum Codin... |
Shell | UTF-8 | 509 | 2.640625 | 3 | [] | no_license | #!/bin/bash
# This script guides user through benchmarking process on Linux systems.
cd "${0%/*}" # This changes your current directory to the one where the file is placed
./make.sh
echo "Chess"
../build/benchmark ../extern/rbgGames/games/chess.rbg --depth 4
echo "Reversi"
../build/benchmark ../extern/rbgGames/games... |
C | UTF-8 | 218 | 2.6875 | 3 | [] | no_license | #include <stdio.h>
int main(int argc, char *argv[], char *envp[])
{
int i =0;
while(envp[i] != NULL)
{
if(strncmp(envp[i],"USER=", 5) ==0)
{
printf("Hello %s!\n", envp[i]+5);
}
i++;
}
return 0;
}
|
JavaScript | UTF-8 | 863 | 2.65625 | 3 | [] | no_license | import '@testing-library/jest-dom';
import {getHeroeById, getHeroesByOwner} from '../../base/08-imp-exp'
import heroes from '../../data/heroes'
// gives title
describe('08 test', () => {
//first test
test('return heros with id', ()=>{
const id = 1;
const hero = getHeroeById( id );
const heroeData = ... |
C++ | UTF-8 | 80,093 | 2.515625 | 3 | [] | no_license | // Universidade Federal do Rio Grande do Sul
// Instituto de Informática
// Departamento de Informática Aplicada
//
// INF01047 Fundamentos de Computação Gráfica
// Prof. Eduardo Gastal
//
// LABORATÓRIO 5
//
// Arquivos "headers" padrões de C podem ser incluído... |
C++ | UTF-8 | 2,580 | 2.796875 | 3 | [] | no_license | /*
Problema - Monitorando a Amazônia
http://br.spoj.com/problems/MONAMAZ/
Guilherme Leobas
*/
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <fst... |
C# | UTF-8 | 226 | 3.140625 | 3 | [] | no_license | private int myProperty;
public int MyProperty
{
get { return myProperty; }
set { myProperty = value; } // value is an implicit parameter containing the value being assigned to the property.
}
|
Python | UTF-8 | 1,710 | 2.828125 | 3 | [] | no_license | from os import makedirs
from os import listdir
from shutil import copyfile
from random import seed
from random import random
from CreateLabelsDictonary import create_labels_dictionary
from pathlib import PureWindowsPath, Path
from keras.preprocessing.image import ImageDataGenerator
l = 3
# set the location of the data... |
Java | UTF-8 | 368 | 1.640625 | 2 | [] | no_license | package com.course2go.model.notice;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NoticeCreateRequest {
private String noticeUid;
private Integer noticeType;
private String noticeFromUid;
private Integer... |
C | UTF-8 | 15,203 | 2.609375 | 3 | [] | no_license |
#include "ntpapis.h"
tspkt *timeanchor = NULL;
ntpinfo *ntp_anchor = NULL;
int prevOffset = INT_MAX;
//char payload[10] = "1234567890";
static const unsigned char payload[] = {
0x00,
};
/* calculate the T1 timestamping using SO_TI**** APIS*/
struct timeval sendTimeofPacket(int seqnum){
/* give me seq num and I... |
C# | UTF-8 | 3,150 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TranslatorService.Speech;
using HMF_KOMAI_CSHARP.Properties;
using SpeechLib;
namespace HMF_KOMAI_CSHARP.Services
{
public class UcommSpeaker
{
private SpeechSyn... |
C# | UTF-8 | 2,991 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
namespace MarioProgrammer
{
public enum HeroNames
{
Nerd,
Chewbacca,
Princess
}
public enum SkinNames... |
PHP | UTF-8 | 1,299 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
class UsersTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$param =[
'id' => '1',
'username' => 'sans',
'mail' => 'sans@gmail.com',
'password' =>... |
C# | UTF-8 | 3,693 | 3.21875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace XCRI.Validation.ContentValidation
{
/// <summary>
/// Validates that an element is (or is not, depending upon <see cref="EnforcementType"/>)
/// empty. Empty... |
Python | UTF-8 | 5,861 | 2.765625 | 3 | [] | no_license | from src.utils import museumpiece
__author__ = 'colin'
from sqlalchemy import Column, Integer, Date, func
from alchemical_base import Base
import bisect
import datetime
from models import *
class Month(Base):
"""A contiguous block of 28 days (in practice, but could be more or less),
not necessarily corresp... |
Python | UTF-8 | 863 | 2.890625 | 3 | [] | no_license | from nltk.corpus import wordnet
from tkinter import Tk,Label,Entry,Text,END,Button
root=Tk()
root.title("Dictionary")
root.geometry('1000x800')
root.configure(bg="orange")
label1 = Label(root, text="Search",font="Helvetica 20 bold",bg="orange")
E1 = Entry(root, bd =5,font="gotham",bg="white")
def code():
... |
Shell | UTF-8 | 532 | 2.921875 | 3 | [] | no_license | #!/bin/sh -xe
# 閏年は考慮していないし、31日に実行するとだめになる
CURRENT_MONTH=`date +"%m"`
DAY=30
if [ $CURRENT_MONTH = 03 ]; then
DAY=28
fi
YEAR=`date +"%Y" -D %s -d "$(($(date +%s) - 86400 * DAY))"`
MONTH=`date +"%m" -D %s -d "$(($(date +%s) - 86400 * DAY))"`
HOST=$1
ROSTERNAME=$2
./rads-cli -y $YEAR -m $MONTH -f $ROSTERNAME -H $... |
C# | UTF-8 | 1,974 | 3.078125 | 3 | [] | no_license | using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
namespace GraduationTracker.Tests.Unit
{
[TestClass]
public class RepositoryTests
{
[TestMethod]
public void GetRequirementById()
{
// Arrange
... |
Ruby | UTF-8 | 835 | 3.546875 | 4 | [] | no_license | require_relative 'board'
class WebGame
def initialize(computer_player)
@board = Board.new
@computer_player = computer_player
end
def board_matrix
@board.to_matrix.map do |row|
row.map do |cell|
_cell_format(cell)
end
end
end
def play(move)
if @board.available_moves.i... |
C# | UTF-8 | 3,670 | 2.515625 | 3 | [] | no_license | // ***********************************************************************
// Assembly : XianaCore.Infrastructure
// Author : Jhoel Aicardi
// Created : 09-29-2020
//
// Last Modified By : Jhoel Aicardi
// Last Modified On : 11-04-2020
// *****************************************************... |
Java | UTF-8 | 520 | 2.84375 | 3 | [] | no_license | package com.company;
import java.util.ArrayList;
import java.util.Objects;
/**
* Created by Coder on 12/9/2015.
*/
public class Database {
private ArrayList<DataTable> tables = new ArrayList<DataTable>();
private int totalTables = 0;
public void addTables(DataTable table){
tables.... |
C | UTF-8 | 289 | 2.765625 | 3 | [] | no_license | #include <stdio.h>
int main(void){
int m = 10, n, o;
int *z = &m;
printf("z store address = %#x\n", z);
printf("z = %d\n", *z);
printf("m address = %#x\n", &m);
printf("m = %d\n", m);
printf("n address = %#x\n", &n);
printf("o address = %#x\n", &o);
return 0;
}
|
Java | UTF-8 | 451 | 1.984375 | 2 | [] | no_license | package com.jcrspace.imageeditor.common;
/**
* Created by jiangchaoren on 2017/10/12.
*/
/**
* 图片编辑View的状态
*/
public enum ImageEditorState {
//选中
SELECTING,
//划线编辑中
LINE_EDITING,
//框选编辑中
RECT_EDITING,
//文本编辑中
TEXT_EDITING,
//新框选
NEW_RECT,
//新划线,
NEW_LINE,
//新文本,... |
C++ | UTF-8 | 1,065 | 2.609375 | 3 | [] | no_license | //
// Created by Robert on 01-Nov-19.
//
#ifndef SDA_LISTADUBLUINTALNTUITATEMPLATE_H
#define SDA_LISTADUBLUINTALNTUITATEMPLATE_H
#include "Program.h"
class ListaDubluIntalntuitaTemplate : public Program {
public:
void exe() override ;
void info() override ;
private:
typedef int Valoare;
struct Nod... |
Java | UTF-8 | 199 | 2.046875 | 2 | [] | no_license |
package utils;
public class ControleDeSaisieException extends Exception {
String msg;
public ControleDeSaisieException(String msg) {
super(msg);
this.msg = msg;
}
}
|
C++ | UTF-8 | 4,993 | 2.65625 | 3 | [] | no_license | /**
*
* @author G.Gilet, Guillaume.Gilet@unilim.fr
* @date 20 August 2017
* @version 1.0
*/
#ifndef _ENGINE_GL_H
#define _ENGINE_GL_H
#include <map>
#include <string>
#include <stack>
#include <GL/glew.h>
#include "Engine/Base/Engine.h"
#include "Engine/Base/NodeCollectors/StandardCollector.h"
#in... |
C# | UTF-8 | 585 | 3.171875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Constructors
{
public class Program
{
static void Main(string[] args)
{
const int id1 = 200;
var person1 = new Person("Bruce", id1);
... |
Python | UTF-8 | 163 | 2.671875 | 3 | [] | no_license | # https://www.acmicpc.net/problem/9085
T = int(input())
for i in range(T):
N = int(input())
array = list(map(int, input().split()))
print(sum(array))
|
Python | UTF-8 | 1,790 | 3.34375 | 3 | [] | no_license | #!/usr/bin/env python3
from copy import deepcopy
def is_occupied(seat_map, y, x):
if 0 <= y < len(seat_map) and 0 <= x < len(seat_map[0]):
return seat_map[y][x] == '#'
return False
def part1(seat_map, y, x):
return [
is_occupied(seat_map, yi, xi)
for yi in range(y - 1, y + 2)
for xi in ... |
Ruby | UTF-8 | 1,477 | 2.9375 | 3 | [] | no_license | # frozen_string_literal: true
split_for_nearby = INPUT.split("\n\nnearby tickets:\n")
nearby_tickets = split_for_nearby.last.each_line.map { |line| line.chomp.split(",").map(&:to_i) }
split_for_fields = split_for_nearby.first.split("\n\nyour ticket:\n")
your_ticket = split_for_fields.last.chomp.split(",").map(&:to_i)
... |
Markdown | UTF-8 | 3,000 | 3.65625 | 4 | [] | no_license | ---
title: Leetcode416分割等和子集
date: 2020-10-13
tags:
- 01背包
- 动态规划
categories:
- LeetCode
---
:::tip
给定一个**只包含正整数**的**非空**数组。是否可以将这个数组分割成两个子集,使得两个子集的元素和相等。
:::
<!-- more -->
## 题目
[416. 分割等和子集](https://leetcode-cn.com/problems/partition-equal-subset-sum/)
给定一个**只包含正整数**的**非空**数组。是否可以将这个数组分割成两个子集,使得两个子集的元素和相等。
... |
Swift | UTF-8 | 923 | 2.734375 | 3 | [] | no_license | //
// ViewController.swift
// StarWarsAPI-App
//
// Created by Agha Saad Rehman on 16/07/2021.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let api = StarWarsAPI()
// api.getOneWithId(resource: ... |
Java | UTF-8 | 2,669 | 3.46875 | 3 | [] | no_license | package wednesday;
import java.util.List;
import java.awt.*;
public class FunnyArraySorter {//@author Vasil Trifonov
enum Operations {//iskam da rabotish
Subtraction, Division, None
};
final private int mPivot;//dsa da sda fd
public FunnyArraySorter(final int pivot) {//field comment is required
mPivot = p... |
JavaScript | UTF-8 | 844 | 3.015625 | 3 | [] | no_license | /**
* Created by Purexo on 11/06/2017.
*/
$(function () {
var $excuse = $('#excuse');
$excuse.removeAttr('style');
var $button = $('#generate');
var $fills = [1,2,3,4,5,6].reduce(function (prev, value) {
prev.push($excuse.find('#tirage-' + value));
return prev;
}, []);
/**
* Retur... |
Java | UTF-8 | 2,844 | 2.1875 | 2 | [] | no_license | package com.bunakari.sambalpurifashion.adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android... |
Python | UTF-8 | 10,150 | 2.90625 | 3 | [] | no_license | from sys import exit
from random import randint
import webbrowser
new = 2
url = "http://i.imgur.com/C70LMTN.gif"
url2 = "https://youtu.be/TJI5EBxdP6k?t=1m4s"
url3 = "https://www.youtube.com/watch?v=-mPKV6-Zwlc"
url4 = "https://youtu.be/3-Rzb6fpwBc?t=14s"
url5 = "https://www.youtube.com/watch?v=hFeEALBfXUY"
url6 = "http... |
Ruby | UTF-8 | 1,636 | 2.96875 | 3 | [] | no_license | #!/usr/bin/env ruby
require 'rubygems'
require 'sudden_motion_sensor'
require 'gosu'
include Gosu
class GameWindow < Gosu::Window
def initialize
@window_x = 1024; @window_y = 768
@x_scale = ((@window_x/254)/2).ceil; @y_scale = ((@window_y/254)/2).ceil
@draw_dots=true
@dotsize = 2
@draw_lines... |
Ruby | UTF-8 | 648 | 2.953125 | 3 | [] | no_license | # Testing for exceptions is tricky business.
# Refactor the spec below to use the raise_error matcher with an expect block.
describe Zombie do
it 'raises a Zombie::NotSmartEnoughError if not able to make a decision' do
zombie = Zombie.new
begin
zombie.make_decision!
rescue Zombie::NotSmartEnoughErr... |
Python | UTF-8 | 981 | 2.6875 | 3 | [] | no_license | import vtk
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('filename')
args = parser.parse_args()
fn = args.filename
#create reader
imr = vtk.vtkMetaImageReader()
imr.SetFileName(fn)
imr.Update()
print imr
#create polydataalgorithm
#this operates on an image and
#returns a polydata object
mc ... |
Markdown | UTF-8 | 2,710 | 2.609375 | 3 | [] | no_license | # avro-cli-examples
Examples on how to use the command line tools in Avro Tools to read and write Avro files.
See my original article
[Reading and Writing Avro Files From the Command Line](http://www.michael-noll.com/blog/2013/03/17/reading-and-writing-avro-files-from-the-command-line/#json-to-binary-avro)
from April... |
C++ | UTF-8 | 591 | 3.109375 | 3 | [] | no_license | #include "UniversityReg.h"
#include <iostream>
#include <sstream>
#include <string>
int main(){
/*
//test cpy construktor
Person* p1 = new Student("name1", "email", 123);
Person* p2 = p1;
p1->toString;
p2->toString;
//test deep copying
p1->setName("BOB");
cout << p1->toString();
cout << p2->t... |
Java | UTF-8 | 232 | 1.914063 | 2 | [] | no_license | package com.android.structure.callbacks;
import com.android.structure.adapters.SpinnerDialogAdapter;
public interface OnSpinnerItemClickListener {
void onItemClick(int position, Object object, SpinnerDialogAdapter adapter);
}
|
Shell | UTF-8 | 657 | 3.328125 | 3 | [
"MIT"
] | permissive | #! /bin/bash
PRGNAME="patch"
### Patch
# Программа для изменения или создания файлов путем применения файлов *.patch,
# обычно создаваемых программой diff
# http://www.linuxfromscratch.org/lfs/view/stable/chapter05/patch.html
# Home page: https://savannah.gnu.org/projects/patch/
# Download: http://ftp.gnu.org/gnu/... |
JavaScript | UTF-8 | 622 | 2.609375 | 3 | [
"MIT"
] | permissive | import {
SIGNUP,
LOGIN
} from "../constants"
/*
user: [{
username: String,
firstName: String,
lastName: String,
password: String
}]
*/
const defaultState = {username: 'avik', firstName: 'Avik', lastName: 'Jain', 'password':'pass'};
export default function(state = defaultState, action) {
switch... |
Java | UTF-8 | 592 | 2.515625 | 3 | [] | no_license | package com.todos.model;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import com.todos.types.PhoneType;
@Embeddable
public class Phone {
@Column(name="number")
private String number;
@Column(name="type")
private PhoneType type;
public String getNumber() {
return number;
}
publi... |
Python | UTF-8 | 1,028 | 3.734375 | 4 | [
"MIT"
] | permissive | # a = [[1,2],[1,2,3]]
# print(a)
#
# b = (1,2,3)
# print(b)
# print(a[0])
# print(b[0])
# b[0]=4
# d = {"key":{"key2":"bob"}}
# d['key3'] = 4
# print(d.get("key4",0))
# x=4
# if x>3:
# print(x)
# elif x == 3:
# print(x+1)
# else:
# print(x-1)
# x=0
# while x<4:
# print(x)
# x+=1
def add(x,y):
... |
Markdown | UTF-8 | 871 | 2.90625 | 3 | [
"MIT"
] | permissive | ## Day 68
**Calculator -Part 4**
Our Calculator is almost finished. Pumped up !!!
I know you are ...so lets work!!!
**Challenge Description:**
1. Initialise the value for tips you want to offer.
2. Create a class component input initialise the state value as -- active: 0, keyInput: '' ;
3. Define method handleS... |
Java | UTF-8 | 3,830 | 3.40625 | 3 | [] | no_license | package com.szx.downFileInZip.util;
import java.io.File;
/**
*
* @author SHENZHIXAING418
*
*/
public class FileUtil {
/**
* 删除文件,可以是文件或文件夹
*
* @param fileName 要删除的文件名
* @return 删除成功返回true,否则返回false
*/
public static boolean delete(String fileName) {
File file = new File(fileName);
if (!file.exists... |
Java | UTF-8 | 925 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | package com.baidu.dsp.common.constraint.validation;
import java.math.BigDecimal;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import com.baidu.dsp.common.constraint.DoubleMax;
/**
* @author liaoqiqi
*/
public class MaxValidatorForDouble implements ConstraintVali... |
Markdown | UTF-8 | 7,422 | 2.765625 | 3 | [
"MIT"
] | permissive | # Open SAE J1939
SAE J1939 is a protocol for shaping the CAN-bus message in a specific way that suits industrial vehicles such as tractors, machinery, trucks and more.
SAE J1939 is a very easy protocol to use, but there is a lack of information about SAE J1939, due to the cost of the protocol document, available how ... |
Java | UTF-8 | 269 | 1.851563 | 2 | [] | no_license | package cn.naivenet.User;
class ControllerHeart extends NaiveNetController {
public ControllerHeart() {
super("heart");
}
@Override
public NaiveNetResponseData onRequest(NaiveNetMessage msg) {
msg.user.setPing(new String(msg.param));
return null;
}
}
|
Markdown | UTF-8 | 2,144 | 2.75 | 3 | [] | no_license | ```yaml
area: Hertfordshire
og:
description: Detectives investigating two burglaries in Bricket Wood are appealing for anyone with information to come forward.
publish:
date: 22 Dec 2017
title: Appeal for information following burglaries in Bricket Wood
url: https://www.herts.police.uk/news-and-appeals/appeal-for-i... |
Markdown | UTF-8 | 2,882 | 2.578125 | 3 | [] | no_license | ---
layout: post
title: '工作紀實 2018年 12月'
date: 2018-12-31 21:00
image: ''
description: ''
categories:
- 工作紀實
tags:
- 月報
- 知識科技
---
# MS & FSB 產品
由於 MS 當年採用效能不高的 PHP/MySQL 所開發,加上其架構設計並未考慮效率,以致於整體吞吐量有限(FSB 基於 MS)。
近期由於客戶的 LINE@ 帳號透過廣告推廣,同時湧入的消費者使得系統過載,影響所有客戶的操作。
為了避免已排程的廣告再次發生這樣的嚴重狀況,我製作一個*... |
Markdown | UTF-8 | 915 | 2.78125 | 3 | [] | no_license | # Article 74 B
Un décret fixe les conditions d'application des articles 74 et 74 A. Il précise en outre :
– les modalités de détermination du revenu imposable tel qu'il est défini à l'article 74 ;
– les conditions d'exercice et la durée de validité des options prévues à l'article 69 ;
– les règles applicables en ca... |
TypeScript | UTF-8 | 2,051 | 2.84375 | 3 | [] | no_license | import { BookStoreService } from "./book-store.service";
import { Observable} from "rxjs/Observable";
import 'rxjs/add/observable/of';
import { Book } from "./book";
describe('BookStoreService', () => {
let bookStoreService: BookStoreService,
mockHttp;
// dato che l'oggetto BookStoreService si aspetta di riceve... |
Go | UTF-8 | 863 | 3.0625 | 3 | [
"MIT"
] | permissive | package errors_test
import (
"net/http"
"testing"
"github.com/redpkg/errors/v2"
"github.com/stretchr/testify/assert"
)
func TestNew(t *testing.T) {
assert := assert.New(t)
err := errors.New(50000, "server error").
SetInternal(errors.New(40000, "foobar"))
assert.Equal(http.StatusInternalServerError, err.St... |
Python | UTF-8 | 1,023 | 3.46875 | 3 | [] | no_license | def convert(numerator, denominator):
result = str(numerator // denominator) + '.'
remainders = [numerator % denominator]
while 0 not in remainders:
numerator = numerator % denominator * 10
result += str(numerator // denominator)
if numerator % denominator in remainders:
i... |
Python | UTF-8 | 1,816 | 4.21875 | 4 | [] | no_license | # In tic tac toe board, "" means empty, x means x and o means o
board = [[" ", " ", " "], [" ", " ", " "], [" ", " ", " "]]
def check_mate():
# horizontal
for i in range(3):
if board[i][0] != " " and board[i][0] == board[i][1] and board[i][0] == board[i][2]:
return True
# verital
f... |
C++ | UTF-8 | 785 | 2.9375 | 3 | [] | no_license | #ifndef HAND_H_INCLUDED
#define HAND_H_INCLUDED
#include <memory>
#include <list>
#include <iostream>
#include "AnimalCard.h"
class Hand
{
std::list<std::shared_ptr<AnimalCard>>* playerHand;
public:
Hand();
Hand& operator += (std::shared_ptr<AnimalCard>);
Hand& operator -= (std::shared_ptr<AnimalCard>);
std::s... |
Python | UTF-8 | 6,948 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | from abc import ABC, abstractmethod
from collections import deque
from typing import Any
import z3
from .ast import AST, ASTNode
from ..dsl import Node, AtomNode
from ..logger import get_logger
logger = get_logger('forest')
class RegexEnumerator(ABC):
@abstractmethod
def __init__(self, dsl):
z3.Z3... |
C++ | UTF-8 | 754 | 3.5 | 4 | [] | no_license | /*
* 编译需要C++支持:
* g++ -std=c++11 example-05.cpp -o test05
*/
#include <iostream>
#include <memory> //declarations of std::auto_ptr
#include <utility> //declarations of std::unique_ptr
class Person
{
public:
Person(const int i):age(i)
{
std::cout<<"Person::Person()"<<std::endl;
}
~Person()
{
std::cout<... |
Java | UTF-8 | 630 | 2.375 | 2 | [] | no_license | package xyz.dicky99.rpc.registry;
import java.net.InetSocketAddress;
/**
* @author Ysj
* @version 1.0
* @description 服务注册表通用接口
* @date 2021/5/7 23:29
*/
public interface ServiceRegistry {
/**
* 将一个服务注册进注册表
* @param serviceName 待注册的服务名称
* @param inetSocketAddress 服务地址
*/
void register(... |
TypeScript | UTF-8 | 2,175 | 2.90625 | 3 | [] | no_license | module objects
{
export class Supply extends GameObject
{
// PRIVATE INSTANCE MEMBERS
private _verticalSpeed?:number;
private _activeTime: number =0;
// PUBLIC PROPERTIES
// CONSTRUCTOR
constructor()
{
super(config.Game.TEXTURE_ATLAS, "bullet1... |
C++ | UTF-8 | 781 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* MIT License
* Copyright (c) 2020 Adrian T. Visarra
**/
#include "baba/cancellable_task.h"
namespace baba {
cancellable_task_ptr cancellable_task_::create() noexcept {
return std::make_shared<cancellable_task_>(private_tag());
}
cancellable_task_::cancellable_task_(private_tag) noexcept : canc... |
Java | UTF-8 | 927 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | package com.sfe.ssm.quartz;
import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
/**
* @author 廖志群
* @version 1.00
* @date 八月 02 2017,14:45
* 重置JobFactory Quartz才能使用注入bean
*/
public ... |
Markdown | UTF-8 | 11,148 | 2.859375 | 3 | [] | no_license | # jfaker
Generate fake data, great for databases! Ported from stympy's Ruby gem: https://github.com/stympy/faker
# Usage
Install the package
```
$ npm i jfaker
```
Require then use jfaker in your JavaScript files
```js
const faker = require('jfaker')
```
To view all generators in a category you can use this (I... |
Swift | UTF-8 | 568 | 2.703125 | 3 | [
"MIT"
] | permissive | //
// LoginService.swift
// TPInjector_Example
//
// Created by Eliran Ben-Ezra on 4/8/18.
// Copyright © 2018 CocoaPods. All rights reserved.
//
import TPInjector
protocol LoginService {
func login()
}
class LoginServiceImpl: LoginService, Injectable {
private let networkService: NetworkService
init(net... |
C++ | UTF-8 | 1,986 | 4.125 | 4 | [
"MIT"
] | permissive | /*
100. Same Tree Easy
Given two binary trees, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical and the nodes have the same value.
Example 1:
Input: 1 1
/ \ / \
2 3 2 3
[... |
Markdown | UTF-8 | 1,681 | 2.578125 | 3 | [] | no_license | +++
title = "Contra 1cc"
date = "2014-01-03"
slug = "contra-1cc"
Categories = ["konami", "contra", "1cc"]
+++
I didn't play many games seriously in 2013, mostly due to work being very demanding and just not
having the time to really get into a game. Sadly, I didn't 1CC a single game in 2013 that I
hadn't 1CC'd before.... |
Java | UTF-8 | 2,465 | 2.546875 | 3 | [] | no_license | package me.viscar.townyrelationalcolors.townscoreboards;
import com.comphenix.protocol.events.PacketContainer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
public class WildernessTeamsContainer ext... |
Markdown | UTF-8 | 6,264 | 3 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"OpenSSL"
] | permissive | ---
title: CREATE SEQUENCE statement [YSQL]
headerTitle: CREATE SEQUENCE
linkTitle: CREATE SEQUENCE
description: Use the CREATE SEQUENCE statement to create a sequence in the current schema.
menu:
v2.14:
identifier: ddl_create_sequence
parent: statements
type: docs
---
## Synopsis
Use the `CREATE SEQUENCE` ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.