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 |
|---|---|---|---|---|---|---|---|
C++ | UTF-8 | 12,698 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include <winsock2.h>
#include <windows.h>
#include <fstream>
#include <sstream>
#include <assert.h>
#include <algorithm>
#include <limits.h>
#include <set>
#include <list>
#include <unistd.h>
#include "Exit.h"
#include "graphviewer.h"
#include "RoadNetwork.h"
#include "Algorithms... |
Markdown | UTF-8 | 1,249 | 3.15625 | 3 | [] | no_license | # 6.Weather_Dashboard
A weather dashboard to give you current temps, conditions, etc. of whatever city you search along with the 5 day forecast of that area.
This project had its ups and downs during development. I started with a basic HTML and CSS to get the layout down. Having a visual reference for what was going ... |
Markdown | UTF-8 | 6,878 | 3.125 | 3 | [
"CC-BY-4.0",
"CC-BY-3.0",
"Apache-2.0"
] | permissive | ---
layout: post
title: "Apache Camel Content Enricher Example"
description: ""
category: articles
tags: []
---
In a [previous article][1] I discussed why Apache Camel is a useful
tool for building small modules to perform integration independent
of any of the pieces being integrated. With that out of the way
I can go... |
Java | UTF-8 | 607 | 2.21875 | 2 | [
"Apache-2.0"
] | permissive | package com.jeremie.qicqfx.dto;
/**
* Created by jeremie on 2015/6/5.
*/
public class DisconnectDTO extends MessageDTO {
private String username;
private String reason;
public DisconnectDTO(boolean disconnected) {
status = disconnected ? Status.DISCONNECTED : Status.END_SIGNAL;
}
public... |
Java | UTF-8 | 780 | 2.03125 | 2 | [] | no_license | package com.wellsfargo.fsd.lms.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springfr... |
C | UTF-8 | 473 | 3.203125 | 3 | [] | no_license | #include"stdio.h"
#include"pthread.h"
void *runner(void * val)
{
int i = 0;
char *msg;
msg = (char *)val;
for(i = 0; i < 10; i ++)
{
sleep(1);
printf("Thread is %s and no is %d \n",msg,i);
}
pthread_exit(0);
}
int main()
{
pthread_t tid1;
pthread_t tid2;
char msg1[] = "tid1";
char msg2[] = "tid2";
... |
Java | UTF-8 | 2,754 | 2.4375 | 2 | [
"Apache-2.0"
] | permissive | package com.androidbegin.shareimagetutorial;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.grap... |
Java | UTF-8 | 290 | 1.640625 | 2 | [] | no_license | package ikigai.repository;
import ikigai.entity.Area;
import ikigai.entity.Dimension;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface DimensionRepository extends CrudRepository<Dimension, Long> {
}
|
Python | UTF-8 | 34,254 | 2.78125 | 3 | [] | no_license | '''
Copyright: Copyright (c) 2019
Created: 2019-4-19
Author: Zhang_Licheng
Title: complex tensor expression in dummy index summation
All rights reserved
'''
import re as regx
# (a+b)*c --> ['(','a','+','b',')','*','c']
def expr2list (expr):
expr_list = []
var = ''
for i in range(len(expr)):
... |
Java | UTF-8 | 2,882 | 2.40625 | 2 | [] | no_license | package ch.epfl.xblast;
import java.util.ArrayList;
import java.util.List;
import com.sun.jndi.url.iiopname.iiopnameURLContextFactory;
import com.sun.swing.internal.plaf.basic.resources.basic;
/**
* Class RunLengthEncoder
*
* @author Loïs Bilat (258560)
* @author Nicolas Jeitziner (258692)
*
*/
public final ... |
Python | UTF-8 | 890 | 3.390625 | 3 | [] | no_license | from flask import Flask, render_template
from random import sample
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/haedal")
def haedal():
return "This is Haedal"
@app.route("/greeting/<string:name>")
def greeting(name):
return f'반갑습니다. {name}!'
@app.route("/cube/<int:... |
C++ | UTF-8 | 580 | 3.703125 | 4 | [] | no_license | /* Program 3_9 :Compute tax */
#include <iostream>
#include <string>
using namespace std;
int main()
{
float Price, Tax, Total, Tax_Rate = 0.07f;
string ProductName;
cout << "Enter product name : ";
cin >> ProductName;
cout << "Enter product price : ";
cin >> Price;
cout << endl;
//case ... |
Java | UTF-8 | 2,864 | 2.265625 | 2 | [] | no_license | package ECP.handle;
import org.json.JSONObject;
import ECP.service.StoreService;
import csAsc.EIO.MsgEngine.CEIOMsgRouter.CParam;
public class StoreHandle extends CMsgBaseHandle {
private StoreService storeService;
public StoreHandle(){
storeService = new StoreService();
}
@Override
public int handleMsg(C... |
C# | UTF-8 | 933 | 3.78125 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Cap05_Ativ02
{
class Program
{
static void Main(string[] args)
{
int n;
Console.Write("Entre com um número: ");
n = int.Parse(Conso... |
Markdown | UTF-8 | 3,819 | 2.546875 | 3 | [] | no_license |
わからなかったら飛ばして脳死でコマンド打ってもOK
-------------------------
フロントエンド編(環境構築)
==============
やること
- nodeをインストール
- vue-cliをインストール
- vueを立ち上げて動作させてみる
Step1 環境構築
----------
めんどくさいですが環境構築から始めましょう
まずはnodenv
[https://qiita.com/1000ch/items/41ea7caffe8c42c5211c](https://qiita.com/1000ch/items/41ea7caffe8c42c5211c)
まずは上のリンク... |
Java | UTF-8 | 1,711 | 2.21875 | 2 | [
"MIT"
] | permissive | /*
* Copyright (C) 2017 Miles Talmey.
* Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
*/
package com.emarte.regurgitator.extensions;
import com.emarte.regurgitator.core.Log;
import com.emarte.regurgitator.core.Message;
import com.emarte.regurgitator.core.RegurgitatorEx... |
Python | UTF-8 | 938 | 2.515625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
from rdkit import Chem
from .pdb import *
from .ctab import *
T, F = True, False
class rawmol(object):
"""
read/write RDKit mol
"""
def __init__(self, zs, chgs, bom, coords):
na = len(zs)
self.na = na
self.zs = zs
self.chgs = chgs
... |
Java | UTF-8 | 3,733 | 2.359375 | 2 | [] | no_license | package com.hmd.util;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import andro... |
PHP | UTF-8 | 2,126 | 2.890625 | 3 | [] | no_license | <?php
namespace CatchOfTheDay\DevExamBundle\Manager;
use CatchOfTheDay\DevExamBundle\Model\TodoListItem;
use Symfony\Component\Filesystem\Filesystem;
class TodoListManager
{
const DATA_FILE = '@CatchOfTheDayDevExamBundle/Resources/data/todo-list.json';
/**
* @var \Symfony\Component\Config\FileLocatorInt... |
Python | UTF-8 | 566 | 3.390625 | 3 | [] | no_license | import random
def randInt(min=0, max=0):
if min == 0 and max == 0:
num = random.random()
return num
if min == 0 and max > 0:
num = random.random() * max
return num
if min > 0 and max > min:
num = random.random() * max
return num
if min > 0 and max > 0:
... |
Python | UTF-8 | 1,099 | 3.90625 | 4 | [
"MIT"
] | permissive |
__author__ = Rohit Kamal Saxena
__email__ = rohit_kamal2003@yahoo.com
"""
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be clos... |
C++ | UTF-8 | 5,962 | 3.234375 | 3 | [] | no_license | #ifndef MONITOR_HPP
#define MONITOR_HPP
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <pthread.h>
#include <unistd.h>
using namespace std;
/**
* Struct contendo as variáveis de condição para cada um dos 8 personagens do problema. Fazer
* um vetor de 8 posições se provou inefica... |
C++ | ISO-8859-1 | 738 | 3.90625 | 4 | [] | no_license | /*6. Escribe un programa que defina un vector de nmeros y calcule si existe algn
nmero en el vector cuyo valor equivale a la sula del resto de nmeros del vector.*/
#include <iostream>
#include <conio.h>
using namespace std;
int main() {
int numeros[5] = {1, 2, 3, 4, 10};
int suma = 0, mayor = 0;;
... |
Python | UTF-8 | 3,486 | 2.890625 | 3 | [] | no_license |
import sys
import os
SPARK_HOME = "/spark" # Set this to wherever you have compiled Spark
os.environ["SPARK_HOME"] = SPARK_HOME # Add Spark path
os.environ["SPARK_LOCAL_IP"] = "127.0.0.1" # Set Local IP
sys.path.append( SPARK_HOME + "/python") # Add python files to Python Path
sys.path.append( SPARK_HOME + "/python/li... |
SQL | UTF-8 | 877 | 2.78125 | 3 | [] | no_license | CREATE TABLE news (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(100),
link VARCHAR(100),
image VARCHAR(100),
likecount INT,
commentcount INT,
createddate DATE,
userId INT,
PRIMARY KEY ( id )
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE user (
id INT NOT NULL AUTO_... |
Java | UTF-8 | 3,606 | 2.96875 | 3 | [] | no_license | package com.nigiri.pokeapp.Utils;
import com.nigiri.pokeapp.Models.Monster;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class DatabaseConnection {
Connection db;
public DatabaseConnection() {
try {
this.db =
... |
PHP | UTF-8 | 698 | 2.71875 | 3 | [] | no_license | <?php
namespace antidrop;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerDropItemEvent;
use pocketmine\plugin\PluginBase;
class Main extends PluginBase implements Listener {
public function onEnable()
{
$this->getLogger()->notice("[ Anti Drop ] activé ! - Par UnNyanCat");
}
... |
C++ | UTF-8 | 427 | 2.640625 | 3 | [] | no_license | #include <util.hpp>
namespace masys {
u32 itoa( u32 n, char * dst, u8 base )
{
u32 l = 0;
if ( n == 0 )
{
dst[0] = '0';
++l;
}
while ( n > 0 )
{
u8 d = n % base;
for ( int i = l; i > 0; --i )
dst[ i ] = dst[ i - 1 ];
dst[ 0 ] = d + ( d > 9 ... |
Markdown | UTF-8 | 1,042 | 2.625 | 3 | [] | no_license | ## Part 5: Pipline and Dockerize
### Author: Yuning Song
### 1. [pipline.py](https://github.com/kinyang007/INFO_6105/blob/master/Assignment2/Part5/pipeline.py)
* Make the output of the get_learning_data.py as the input of the logistic_regression.py automaticly using luigi
* Input:
* [fintech_related_keywords.csv](ht... |
Markdown | UTF-8 | 2,279 | 2.96875 | 3 | [] | no_license | ---
title: sqlalchemy批量插入的坑
date: 2016-10-14 23:20:42
tags: python
---
默认提供的bulk_save_objects是在一次事务中提交多次save
需求:一个sql语句插入多个实体
直接上代码
models.py
from sqlalchemy import (Column, String, DateTime, UnicodeText, BigInteger, Boolean, Integer, Text, Float)
from sqlalchemy import TypeDecorator
fr... |
SQL | UTF-8 | 110,583 | 2.765625 | 3 | [] | no_license | # ************************************************************
# Sequel Pro SQL dump
# Version 5446
#
# https://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 8.0.23)
# Database: Weather_and_Music
# Generation Time: 2021-04-14 15:35:43 +0000
# ************************************... |
C | UTF-8 | 5,925 | 2.9375 | 3 | [] | no_license | #include "stdio.h"
#include "assert.h"
#include "fcntl.h"
#include "stdlib.h"
#include "unistd.h"
#include "string.h"
#include "errno.h"
#include "elf.h"
void read_elf_header(int32_t fd, Elf32_Ehdr *elf_header)
{
assert(lseek(fd, (off_t)0, SEEK_SET) == (off_t)0);
assert(read(fd, (void *)elf_header, sizeof(Elf32_Ehdr... |
Markdown | UTF-8 | 1,366 | 2.6875 | 3 | [] | no_license | ## Soru İsmi: Rengarenk Dosya
Hazırlayan: [penny](https://github.com/pennylaneparker)
## Soru Metni:
Online CTF'teki rengarenk string isimli sorunun aynısı gibi değil mi? Onu çözebildiysen bunu da rahatlıkla çözebilirsin bence :) Bizim TV ekranı renkli renkli karıncalandı. Saydım 103x54 kutucuk var. ilk kutucuktaki r... |
JavaScript | UTF-8 | 551 | 3.171875 | 3 | [] | no_license | /**
* @example
* // return ' boni!'
* binaryDecode('00100000 01100010 01101111 01101110 01101001 00100001');
* function binaryDecode returns an English translated sentence
* of the passed binary string
* @param {String} str, passed binary string
* @return {String} passed string translated to english
*/
function... |
C++ | UTF-8 | 396 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
// Complete the code.
int i;
long l;
char ch;
float f;
double d;
cin >> i >> l >> ch >> f >> d;
cout << i << endl;
cout << l << endl;
cout << ch << endl;
cout.precision(3);
cout << fixed << f << e... |
Swift | UTF-8 | 3,503 | 2.953125 | 3 | [] | no_license | //
// ViewController.swift
// CenterofGravity
//
// Created by Kyle Jones on 3/5/19.
// Copyright © 2019 Kyle Jones. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var heightTextField: UITextField!
@IBOutlet weak var baseWidthTextField: UITextField!
@IBOu... |
Markdown | UTF-8 | 7,221 | 2.578125 | 3 | [] | no_license | # Virtual Reality Portfolio // Spring 2021 // Rebecca Kent
All projects based on chapters of "Unity 2020 Virtual Reality Projects" by John Linowes
https://www.packtpub.com/product/unity-2020-virtual-reality-projects-third-edition/9781839217333
-----------------------------------------------------------------------... |
Python | UTF-8 | 22,827 | 3.453125 | 3 | [
"MIT"
] | permissive | import math
import colorama
colorama.init()
colors = {
"WHITE": 0,
"YELLOW": 1,
"BLUE": 2,
"GREEN": 3,
"RED": 4,
"PURPLE": 5
}
color_strings = {
0: colorama.Fore.WHITE + 'W',
1: colorama.Fore.YELLOW + 'Y',
2: colorama.Fore.BLUE + 'B',
3: colorama.Fore.GREEN + 'G',
4: colora... |
Markdown | UTF-8 | 1,044 | 2.59375 | 3 | [] | no_license | ---
title: Imperative
label: [Common,Frontend,Backend]
origin: Imperative
pronunciation: 임퍼러티브
mean: 명령적인
relation: [C,Java등대부분의프로그래밍언어 ,DeclarativeProgramming(명령형프로그래밍) ]
slug: /I/Imperative
---
<content>
<p>컴퓨터 과학에서 명령형 프로그래밍(Imperative programming)은 선언형 프로그래밍과 반대되는 개념으로, 프로그래밍의 <span style="color:#FFBF00; font-we... |
SQL | UTF-8 | 106 | 2.734375 | 3 | [] | no_license | SELECT COUNT(id) AS 'Number of movies that starts with "eX"'
FROM movies
WHERE title LIKE BINARY ('eX%');
|
C# | UTF-8 | 2,835 | 3.328125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LabsLINQ2._3._4
{
class Empleado
{
private int _idEmpleado;
private string _nomEmpleado;
private decimal _sueldoEmp;
public int IdEmp
... |
SQL | UTF-8 | 164 | 3.203125 | 3 | [] | no_license | select o.order_id, o.date, l.name, o.currency, o.amount, o.order_type, o.status
from orders o
join landing_pages l
on o.landing_id = l.id
where o.client_id = $1 |
Java | UTF-8 | 1,777 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | package cn.ieclipse.common;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class LimitArrayListTest {
private int limit = 3;
LimitArrayList<Integer> l... |
Rust | UTF-8 | 43,638 | 2.59375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | use std::rc::Rc;
use crate::co;
use crate::gui::events::func_store::FuncStore;
use crate::gui::very_unsafe_cell::VeryUnsafeCell;
use crate::handles::{HDC, HICON};
use crate::msg::{MsgSendRecv, wm, WndMsg};
/// The result of processing a message.
pub(crate) enum ProcessResult {
/// Message was not handled b... |
C++ | UTF-8 | 557 | 3.265625 | 3 | [] | no_license | #include <math.h>
#include "HW/HW01/point2.h"
// Copyright 2018 Prof. Keefe
using std::pow;
using std::sqrt;
Point2::Point2() {
x_ = 0.0;
y_ = 0.0;
}
Point2::Point2(float x, float y) {
x_ = x;
y_ = y;
}
Point2::~Point2() {}
float Point2::DistanceBetween(Point2 other_p) {
float d1 = pow(other_p.GetX() - x... |
Python | UTF-8 | 3,144 | 3.65625 | 4 | [] | no_license | import math
_handle = "test.txt"
_handle = "input.txt"
with open(_handle, 'r') as file:
_data = [[_[0], int(_[1:])] for _ in file.read().splitlines()]
# wanted to try out classes in this solution
class Ship:
def __init__(self, x, y, direction=1):
self.x = x
self.y = y
self.orientatio... |
JavaScript | UTF-8 | 897 | 2.921875 | 3 | [
"MIT"
] | permissive | //adds interactivity to change the item list to the correct partial's list
window.addEventListener('load', function() {
var proposalId = document.getElementById('proposalId').value;
if (document.getElementById('supplemental') !== null) {
document.getElementById('supplemental').onchange = changeSupplementalItems;... |
Python | UTF-8 | 1,120 | 4.125 | 4 | [] | no_license | class Dog:
def __init__(self, name, breed, age, color):
self.name = name
self.breed = breed
self.age = age
self.color = color
def eat(self, food):
print(food, '를 먹는다.')
def sleep(self):
print(self.name, '가 잠들다')
def play(self):
print(self.name, ... |
Java | UTF-8 | 1,747 | 2.515625 | 3 | [
"MIT"
] | permissive | package com.moxun.s2v.utils;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
public class SVGAttrParserTest {
@Test
public void rectToPath() {
assertThat(SVGAttrParser.rectToPath(10, 10.5, 100, 100, 0, 0),
is("M 10,10.5 L ... |
JavaScript | UTF-8 | 753 | 4.1875 | 4 | [] | no_license | // Given two strings needle and haystack, return the index of
// the first occurrence of needle in haystack, or -1 if needle
// is not part of haystack.
// time complexity = n(m-1) where n is length of the haystack
// and m is length of the needle
// evident in ex. w/ haystack = 'mississississississississippi',
// nee... |
TypeScript | UTF-8 | 547 | 2.59375 | 3 | [] | no_license | import {Point} from "../model/Point";
import {NameFactory} from "./NameFactory";
import {HashProvider} from "./HashProvider";
import {Location} from '../model/Location'
export class LocationFactory {
constructor(private hashProvider: HashProvider,
private nameFactory: NameFactory) {}
createLoc... |
Java | UTF-8 | 642 | 2.765625 | 3 | [] | no_license | package com.company.HomeWorkA;
import java.util.concurrent.CountDownLatch;
public class Uploader extends Thread{
private CountDownLatch countDownLatch;
private int sizeOfFile=500;
private int speedOfDownload=20;
public Uploader (CountDownLatch countDownLatch){
this.countDownLatch=countDownLa... |
Shell | UTF-8 | 1,427 | 3.734375 | 4 | [
"MIT"
] | permissive | #!/bin/sh
#
# 863gs Process Monitor
# restart 863gs process if it is killed or not working.
#
WORK_PATH=`pwd`
LOCK_GTSERVER="gt_server"
LOCK_SENSOR="split_hash"
RESTART_GTSERVER="${WORK_PATH}/${LOCK_GTSERVER} -f"
RESTART_SENSOR="${WORK_PATH}/${LOCK_SENSOR} -i eth2,eth3"
#RESTART_SENSOR="${WORK_PATH}/${LOCK_SENSOR} -... |
Java | UTF-8 | 1,203 | 2.03125 | 2 | [] | no_license | package cn.springmvc.service.impl.function;
import java.util.Map;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.springmvc.utils.RequestUtil;
import cn.springmvc.model.BasicMod... |
Java | UTF-8 | 4,971 | 2.09375 | 2 | [] | no_license | package com.notification.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persis... |
Java | UTF-8 | 4,019 | 2.015625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
* except in compliance with the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accomp... |
Java | UTF-8 | 1,738 | 1.828125 | 2 | [
"Apache-2.0"
] | permissive | package org.bian.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.bian.dto.SDCreditChargeCardRetrieveOutputModelServiceDomainOfferedServiceServiceDomainServi... |
Java | UTF-8 | 11,684 | 2.375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2016 The Android Open Source Project
*
* 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 app... |
Markdown | UTF-8 | 1,637 | 2.84375 | 3 | [] | no_license | ## Overview
TDSQL supports real-time online scaling. There are two scaling methods: adding new shards and scaling up existing shards. The entire scaling process is completely imperceptible to the business with no business interruption caused. Only the involved shards will become read-only (or interrupted) for just seco... |
C++ | UTF-8 | 1,031 | 3.078125 | 3 | [
"MIT"
] | permissive | #ifndef GAME_BOARD_HPP
#define GAME_BOARD_HPP
#include <cstdlib> // for size_t
#include <vector>
#include "GamePiece.hpp"
class GameBoard {
public:
explicit GameBoard(size_t inWidth = kDefaultWidth,
size_t inHeight = kDefaultHeight);
GameBoard(const GameBoard& src);
virtu... |
Python | UTF-8 | 6,815 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import click
import logging
import numpy as np
import matplotlib.pyplot as plt
import os
import skimage
from scipy import ndimage as ndi
from PIL import Image
import gzip
import matplotlib.patches as mpatches
from Segmentation_pipeline_helper import find, waters... |
Java | UTF-8 | 1,355 | 2.609375 | 3 | [] | no_license | package cn.logcode.xhufiveface.utils;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Objects;
public class Imagebase64 {
static BASE64Encoder encoder = new sun.misc.BASE64Encoder();
static BA... |
Python | UTF-8 | 4,281 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env python
import time
import sys, os
sys.path.append("../../litenc")
import litenc
import litenc_lxml
import lxml
import argparse
def main():
print("""
#Description: Demonstrate that ietf-yang-library is implemented.
#Procedure:
#1 - Verify ietf-yang-library is listed as capability in the hello message.
... |
Markdown | UTF-8 | 1,343 | 3.59375 | 4 | [
"MIT"
] | permissive | ## fs 文件系统
> * fs 文件系统提供了异步、同步两种方法来读取文件,如 `readFile()/readFileSync`
> * 异步读取的最后一个参数为回调函数,回调函数的第一个参为 err 错误提示,第二个参为 data 数据
> * 异步读取性能好,不阻塞
#### 同步操作文件(进程阻塞)
> * `fs.readFileSync(path)` 同步读取文件
> * `path` 路径
> * 无回调,直接回返回 `data`
```js
const path = ''
const fs = require('fs')
const data = fs.readFileSync(path)
```
##... |
Java | UTF-8 | 1,064 | 2.65625 | 3 | [] | no_license | package study1.behavior.objects.StrategyPattern.mes1;
public class Wip {
private String lotNo;
private String equipId;
private String orderId;
private String preWipId;
public String getEquipId() {
return equipId;
}
public void setEquipId(String equipId) {
this.equipId = e... |
Java | UTF-8 | 2,157 | 2.53125 | 3 | [] | no_license | package edu.cmu.sv.flight.rescheduler.entities;
/**
* Created by hsuantzl on 2015/4/28.
*/
public class Airport {
private Integer id; // Primary key
private String name;
private String city;
private String code;
private double latitude;
private double longitude;
private String timezone;
... |
JavaScript | UTF-8 | 689 | 2.546875 | 3 | [
"MIT"
] | permissive | import { reactive, toRefs } from 'vue'
const state = reactive({
error: null,
patients: null,
loaded: false,
loading: false,
})
export default function getPatients() {
const load = async () => {
if (!state.loaded) {
try {
const patientsResponse = await fetch('/ap... |
Java | UTF-8 | 2,287 | 2.21875 | 2 | [] | no_license | package com.teamide.idecomobility;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
impor... |
Java | UHC | 1,183 | 3.546875 | 4 | [] | no_license | package Test2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class StreamEx2_DB {
public static void main(String[] args) {
// TODO Auto-generated method stub
List<EmployeeData> list = new ArrayList<>();
Employee ep = new Employee();
list = ep.getEmpL... |
C++ | UTF-8 | 2,317 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
queue<pair<int, int> > q;
// 左上顺时针到左
int x0[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y0[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int n, m, k, l;
// 结果
int res[22][22];
// 炸弹位置
int boom[22][22];
// 翻开的点
int visited[22][22];
bool win() {
int sum = 0;
for (int i ... |
C# | UTF-8 | 3,698 | 3.484375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnderstandingLINQ
{
class Program
{
static void Main(string[] args)
{
List<Car> myCars = new List<Car>() {
new Car() { VIN= "A1", M... |
Python | UTF-8 | 516 | 3.21875 | 3 | [] | no_license | def can(a, b):
if not b:
return all(not x.isupper() for x in a)
elif not a and b:
return False
if a[0].isupper():
if a[0] == b[0]:
return can(a[1:], b[1:])
return False
if a[0] == b[0]:
return can(a[1:], b[1:]) or can(a[1:], b)
elif a[0].upper() =... |
Java | UTF-8 | 453 | 2.5625 | 3 | [] | no_license | package main;
import org.lwjgl.input.Mouse;
import org.lwjgl.util.vector.Vector2f;
public class Camera {
public static Camera single;
Vector2f pos;
float zoom;
public Camera(Vector2f pos, float zoom){
this.pos = pos;
this.zoom = zoom;
Camera.single = this;
}
public Vector2f getAbsoluteMouse(){
ret... |
Java | UTF-8 | 5,774 | 2.3125 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright 2019 BROCKHAUS AG
*
* 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 applicabl... |
Java | UTF-8 | 4,196 | 2.15625 | 2 | [] | no_license | package com.example.testtab;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.... |
PHP | UTF-8 | 3,404 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Http\Request;
use Image;
class RegisterController extends Controller
{
/*
... |
Shell | UTF-8 | 982 | 3.625 | 4 | [] | no_license | #!/bin/sh -f
if `test "$1" == ""`; then
echo "Usage: `basename ${0}` [pkg-config packages]"
fi
PACKAGES="${1}"
packages_dirs=`pkg-config --cflags "${PACKAGES}" | sed 's/^\(.\)/\ \1/g' | sed 's/\ \-[^I][^\ ]\+//g' | sed 's/\ \-I\(\/[^\ ]\+\)/\ \1/g'`
isystem="";
for package_dir in ${packages_dirs}
do
isystem="${isy... |
Python | UTF-8 | 193 | 2.71875 | 3 | [] | no_license | import unittest
from classes.guest import Guest
class TestGuest(unittest.TestCase):
def setUp(self):
self.guest_1 = Guest("Bruce", 50)
self.guest_2 = Guest("Sheila", 75)
|
Shell | UTF-8 | 841 | 3.046875 | 3 | [] | no_license | #!/usr/bin/sh
echo "running tests..."
# big one
for i in `seq 1 1 64`; do python3 ./generator.py -f data$i.txt -c 20050 -m 65536; done
../run $(ls -1 data*.txt | tr "\n" " ") 1>/dev/null
echo "test 1 (large input):"
python3 checker.py -f sequence.txt
rm *.txt
# different sizes
python3 generator.py -f data1.txt -c 16... |
Markdown | UTF-8 | 5,842 | 3.65625 | 4 | [] | no_license | # ASSESSMENT 1: Tech Interview Practice Questions
Answer the following questions.
First, without external resources. Challenge yourself to answer from memory as if you were in a job interview.
Then, research the question to expand on your answer. Even if you feel you have answered the question completely, there is al... |
C++ | GB18030 | 6,076 | 3.640625 | 4 | [] | no_license | /*
ñ㷨
㷨 Ԫ
@param beg ʼ
@param end
@param _callback صߺ
@return
for_each(iterator beg, iterator end, _callback);
transform㷨 ָԪذ˵һ
ע : transform Ŀڴ棬Ҫǰڴ
@param beg1 Դʼ
@param end1 Դ
@param beg2 Ŀʼ
@param _cakkback صߺ
@return Ŀ
transform(iterator beg1, iterator end1, iterator beg2, _callbakc)
ò㷨
... |
Python | UTF-8 | 3,399 | 3.796875 | 4 | [
"Apache-2.0"
] | permissive | __source__ = 'https://leetcode.com/problems/remove-element/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/remove-element.py
# Time: O(n)
# Space: O(1)
# Array
#
# Description: Leetcode # 27. Remove Element
#
# Given an array and a value, remove all instances of that value in place and return the new lengt... |
Python | UTF-8 | 100 | 3.265625 | 3 | [] | no_license | Contador = 1
while Contador < 3:
print("Hola")
Contador += 1
print("El ciclo se termino")
|
Python | UTF-8 | 1,870 | 3.078125 | 3 | [] | no_license | from Tests.UnitTests.LineParserTestCaseBase import LineParserTestCaseBase
from parsers.InsideParser.InsideSetArrayParser import InsideSetArrayParser
class TestInsideSetArrayParser(LineParserTestCaseBase):
_validSingleValueTest = "inside 'my.txt' set KEY with values 'value1'"
_validMultiValueTest = "inside 'my.txt' ... |
TypeScript | UTF-8 | 1,476 | 2.625 | 3 | [] | no_license | import { Injectable, Req, Res } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { Strategy } from 'passport-local';
import { AuthService } from '../auth.service';
import { AuthError } from '@exceptions';
@Injectable()
export class LocalStrategySignIn extends PassportStrategy(S... |
Java | UTF-8 | 1,816 | 3.421875 | 3 | [] | no_license | package Best_Time_to_Buy_and_Sell_Stock_IV;
/**
* @program: LeetCode
* @Description: 188. 买卖股票的最佳时机 IV dp经典解法
* @Author: SOYANGA
* @Create: 2019-06-29 02:09
* @Version 1.0
*/
public class Best_Time_to_Buy_and_Sell_Stock_IV {
class Solution {
public int maxProfit(int k, int[] prices) {
if(... |
Java | UTF-8 | 2,020 | 2.671875 | 3 | [] | no_license | package org.jaxen.pattern;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import org.jaxen.Context;
import org.jaxen.Navigator;
public class NameTest extends NodeTest {
private String name;
private short nodeType;
public double getPriority() {
return FirebaseRemoteConfig.DEFAULT_VA... |
Java | UTF-8 | 224 | 1.5 | 2 | [] | no_license | package com.met.account.dto.response;
import lombok.Data;
@Data
public class ExecuteTransactionResponse {
private String fromId;
private String toId;
private boolean success;
private String errorMessage;
}
|
C++ | UTF-8 | 340 | 2.765625 | 3 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n,i,count1=0,count2=0,k,l;
cin>>n;
int a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
if(a[i]%2==0)
{
count1++;
k=i+1;
continue;
}
else
{
count2++;
l=i+1;
continue;
}
}
if(count1<count2)
{
cout<<k;
}
else
{
cout... |
Java | UTF-8 | 209 | 1.5625 | 2 | [] | no_license | package com.example.administrator.xiazoliuxing.view.main;
import com.example.administrator.xiazoliuxing.base.BaseMvpView;
public interface VerifyView extends BaseMvpView {
void setData(String data);
}
|
Java | UTF-8 | 1,358 | 2.765625 | 3 | [] | no_license | package serverUtils;
/**
* This program creates requested object (factory pattern)
*
* @author Arsene INDAMUTSA
* <p>
* Andrew ID: aindamut
* <p>
* On my honor, as a Carnegie-Mellon Rwanda student, I have neither
* given nor received unauthorized assistance on this work.
*/
import util.Courrier;
public clas... |
Java | UTF-8 | 1,675 | 3.671875 | 4 | [] | no_license | /*
Problem Description
There is given an integer array A of size N denoting the heights of N trees.
Lumberjack Ojas needs to chop down B metres of wood. It is an easy job for him since
he has a nifty new woodcutting machine that can take down forests like wildfire. However, Ojas is only allowed to cut a single row o... |
Java | UTF-8 | 7,112 | 2.265625 | 2 | [] | no_license | package com.contactlist;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.sql.ResultSet;
import javax.swing.JButton;
import javax.swing.JLabel;
im... |
Java | UTF-8 | 1,210 | 3.78125 | 4 | [] | no_license | package Workshop7_5_3;
import java.util.ArrayList;
public class RandomService {
ArrayList<Integer> list1 = new ArrayList<Integer>();
ArrayList<Integer> list2 = new ArrayList<Integer>();
public ArrayList<Integer> makeRandomInt(ArrayList<Integer> list) { //비어있는 리스트받아서 아래 포문 호출 list1 했다가 list2작동
... |
TypeScript | UTF-8 | 725 | 2.546875 | 3 | [
"ISC"
] | permissive | import { Schema, model } from 'mongoose'
const UserSchema = new Schema({
name: {
type: String,
required: [true, 'Please add a name']
},
email: {
type: String,
required: [true, 'Please add an email'],
unique: true,
match: [
/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,
'Plea... |
Java | UTF-8 | 1,019 | 2.046875 | 2 | [] | no_license | package android.util.http;
/**
* Http
* <p/>
* Created by Haidy on 15/8/26.
*/
public class Http {
/**
* get
*/
public static final String GET = "GET";
/**
* post
*/
public static final String POST = "POST";
/**
* content type default name
*/
public static f... |
Swift | UTF-8 | 2,207 | 2.9375 | 3 | [
"MIT"
] | permissive | //
// CSVWriter+Test.swift
// swift-csv
//
// Created by Matthias Hochgatterer on 02/06/2017.
// Copyright © 2017 Matthias Hochgatterer. All rights reserved.
//
import XCTest
class CSVWriter_Test: XCTestCase {
var stream: OutputStream!
var writer: CSV.Writer!
override func setUp() {
supe... |
C# | UTF-8 | 2,131 | 2.625 | 3 | [
"MIT"
] | permissive | using API.Entities;
using API.Interfaces;
using API.DTOs;
using API.Helpers;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using AutoMapper.QueryableExtensions;
using AutoMapper;
namespace API.Data
{
public class UserRepository ... |
Markdown | UTF-8 | 2,105 | 2.765625 | 3 | [] | no_license | @title[git]

---
@title[What is git?]
### What is git?
#### The Basics

+++
@title[git basics]
```bash
git help
git init
git clone
git status
git show
git log
git branch
git checkout
git commit
git add
git rm
git mv
git reset
git revert
git d... |
PHP | UTF-8 | 4,848 | 3 | 3 | [
"MIT"
] | permissive | <?php
class ViewHelpers {
/* Inclui arquivos css
* Se o caminho começar com / deve ser considerado a partir da pasta ASSETS_FOLDER
* caso contrário a partir de ASSETS_FORLDER/css/
*/
public static function stylesheetIncludeTag() {
$params = func_get_args();
$links = "";
foreach($params as $p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.