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 | 3,035 | 3.984375 | 4 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# ### 파이썬 문자열
# In[1]:
a = '파이썬'
# In[2]:
print(a)
# In[3]:
b = "문자열"
# In[4]:
print(b)
# In[7]:
c = """
파이썬
문자열
"""
# In[8]:
print(c)
# In[10]:
# '파이썬' + 3
#파이썬은 +으로 문자열 연결 불가능
# In[11]:
d = '파이썬' + str(3)
# In[12]:
print(d)
# In[13]:
e = '*... |
Python | UTF-8 | 943 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib import style
from os import path
style.use('ggplot')
rcParams.update({'font.size': 9})
fig_size = plt.rcParams["figure.figsize"]
fig_size[0] = 10
fig_size[1] = 4.2
plt.rcParams["figure.figsize"] = fig_size
df = pd.read_... |
Python | UTF-8 | 419 | 4.03125 | 4 | [] | no_license | print('You will be prompted for 3 Test Scores below.')
print('======================')
score_1 = int(input('Enter test score:'))
score_2 = int(input('Enter test score:'))
score_3 = int(input('Enter test score:'))
print('=======================')
print('Your Scores: ', score_1, score_2, score_3)
total_score = score_1 ... |
Markdown | UTF-8 | 1,529 | 3.28125 | 3 | [] | no_license | # ComputerDialog
## Props
<!-- @vuese:ComputerDialog:props:start -->
|Name|Description|Type|Required|Default|
|---|---|---|---|---|
|edit|The computer that we are editing if any has been given|`any`|`false`|-|
|dialog|The dialog that controls if this component is showing or not|`boolean`|`false`|-|
<!-- @vuese:Compu... |
Java | UTF-8 | 616 | 2.40625 | 2 | [] | no_license | package com.controller.responce;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by vlad on 23.04.17.
*/
public class ForwardViewDispatcher implements Dispatcher {
private final String V... |
Python | UTF-8 | 2,515 | 3.328125 | 3 | [] | no_license |
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
from collections import OrderedDict
class Solution:
def recoverFromPreorder(self, S: str) -> TreeNode:
depth = 0
n = len(S)
i = 0
root = None
... |
Python | UTF-8 | 1,243 | 2.765625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# Usage:
# cd 2-visual_test
# cat ../1-data/training_images.txt | ../mapper.py | ../reducer.py > weights.txt
# ../evaluate_to_file.py weights.txt ../1-data/images.txt > prediction.txt
import logging
import sys
import numpy as np
# So we can use the same feature vectors.
from mapper import tran... |
C++ | UTF-8 | 447 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <string>
using namespace std;
int main() {
long t;
cin>>t;
queue<long> q;
string s;
while (t--) {
cin>>s;
if (s == "PUSH") {
long x;
cin>>x;
q.push(x);
}
if (s == "POP" && !q.empty()) {
q.pop();
}
if (s == "PRINTFRONT") {
... |
Python | UTF-8 | 119 | 3.09375 | 3 | [] | no_license | v1 = 80
v2 = 70
distanceB = 490
distanceE = 150
minutes = 60 * (distanceB - distanceE) / (v1 + v2)
print(minutes)
|
PHP | UTF-8 | 798 | 3.53125 | 4 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test numbers</title>
</head>
<body>
<?php
echo '<form method="POST">
<label>Enter a number larger than 10</label><br>
<input type="number" name="num"><br><br>
<input type="submit" value="Submit"><br><br>
</form>';
... |
JavaScript | UTF-8 | 1,103 | 2.625 | 3 | [
"MIT"
] | permissive | const { readdirSync } = require("fs");
const ascii = require("ascii-table");
const table = new ascii("Commands").setHeading("Command", "Load status"); // create the table
module.exports = (client) => {
readdirSync("./commands/").forEach((dir) => {
readdirSync(`./commands/${dir}/`).forEach((file) => {
... |
Python | UTF-8 | 117 | 2.71875 | 3 | [] | no_license | # Change the amount of text printed in cells in Pandas with .head() method
pd.set_option('display.max_colwidth', -1)
|
Python | UTF-8 | 353 | 2.9375 | 3 | [] | no_license | def quick(args):
if not args:
return []
small_list = []
big_list = []
middle = args[0]
for i in args[1:]:
if i <= middle:
small_list.append(i)
else:
big_list.append(i)
return quick(small_list) + [middle] + quick(big_list)
args = [2, 4, 1, 7, 2,... |
Python | UTF-8 | 4,707 | 2.59375 | 3 | [] | no_license | import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import pandas as pd
import plotly.graph_objs as go
import plotly.express as px
import dash_leaflet as dl
import dash_leaflet.express as dlx
from dash.dependencies import Input, Output, State
# Gen... |
C# | UTF-8 | 1,352 | 3.40625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
namespace Collections
{
class Program
{
static void Main(string[] args)
{
// int[] arr = {0,1,2,3,4,5,6,7,8,9,};
string[] names = new string[] {"Tim", "Martin", "Nikki", "Sara"};
// bool[] trueFalse ... |
PHP | UTF-8 | 839 | 2.890625 | 3 | [] | no_license | <?php
//
function unlinkr($dir, $pattern = "*") {
// find all files and folders matching pattern
$files = glob($dir . "/$pattern");
foreach($files as $file){
// if it's a directory, delete files inside it
if (is_dir($file) and !in_array($file, array('..',... |
PHP | UTF-8 | 294 | 2.53125 | 3 | [] | no_license | <?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
interface Response {
public function setStatus($status);
public function addHeader($name, $value);
public function write($data);
public function flush();
}
?>
|
Java | UTF-8 | 1,871 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | package qcri.dafna.dataModel.dataSetReader;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.NoSuchElementException;
import java.util.Scanner;
import qcri.dafna.dataModel.data... |
TypeScript | UTF-8 | 2,601 | 2.53125 | 3 | [
"MIT"
] | permissive | import React from "react";
import { CheckboxGroupProps } from "antd/lib/checkbox";
import { QueryObserverResult, UseQueryOptions } from "react-query";
import { useList } from "@hooks";
import {
CrudSorting,
Option,
BaseRecord,
GetListResponse,
CrudFilters,
SuccessErrorNotification,
HttpErro... |
Markdown | UTF-8 | 1,615 | 2.796875 | 3 | [] | no_license | # Lending Club

A loan prediction tool based on a machine learning model using lending club data inspired by a [Kaggle notebook](https://www.kaggle.com/pavl... |
Java | UTF-8 | 321 | 3.125 | 3 | [] | no_license | package org.selva.recursion;
public class WorkSheet {
public static void main(String[] args) {
String s = "fog";
stringReverse(s);
}
static void stringReverse(String s){
if(s.length() >0) {
stringReverse(s.substring(1));
System.out.print(s.substring(0, 1));
}
}
}
... |
Java | UTF-8 | 627 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive |
package org.springframework.format.datetime.joda;
import java.text.ParseException;
import java.util.Locale;
import org.joda.time.Period;
import org.springframework.format.Formatter;
/**
* {@link Formatter} implementation for a Joda-Time {@link Period},
* following Joda-Time's parsing rules for a Period.
*
* ... |
Markdown | UTF-8 | 2,455 | 2.796875 | 3 | [] | no_license | ## Go 语言常用包学习
#### 一、sync包
##### (一)waitgroup
- WaitGroup用于等待一组线程的结束。父线程调用Add方法来设定应等待的线程的数量。每个被等待的线程在结束时应调用Done方法。同时,主线程里可以调用Wait方法阻塞至所有线程的结束。
例如:
```go
func main() {
var wg sync.WaitGroup
for i := 0; i <= 10; i++ {
// increment the WaitGroup counter
wg.Add(1)
go func(i int) {
... |
Java | UTF-8 | 12,202 | 1.664063 | 2 | [] | no_license | /**
* NetXMS - open source network management system
* Copyright (C) 2003-2013 Victor Kirhenshtein
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ... |
C++ | UTF-8 | 2,697 | 2.71875 | 3 | [] | no_license | #include "Volume.h"
#include <GraphicsLibrary/TexPart.h>
#include "ClassContainer.h"
Volume::Volume()
{
level = 3;
btnUp = NULL;
btnDown = NULL;
for (unsigned i = 0; i < 5; i++)
imgLevel[i] = NULL;
}
Volume *Volume::Create()
{
ClassContainer *cc = ClassContainer::GetInstance();
Volume *ret = new Volume()... |
TypeScript | UTF-8 | 324 | 2.703125 | 3 | [] | no_license | import { Address } from "./types";
export interface Allocator<Data> {
getData(addr: Address, size: number): Data;
setData(addr: Address, data: Data, size: number): void;
memAlloc(size: number): Address | null;
memRealloc(addr: Address, size: number): Address | null;
memFree(addr: Address): void... |
C++ | UTF-8 | 1,199 | 2.78125 | 3 | [] | no_license | #include <queue>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
int openLock(vector<string>& deadends, string target) {
int target_int = stoi(target);
bool visited[10000] = {false};
for (auto dd : deadends) {
visited[stoi(dd)] = true;
... |
JavaScript | UTF-8 | 697 | 3.109375 | 3 | [] | no_license | // in the 01_simplest_webServer we didn't used any file, so in this section we read a html file and show it on the web page
const http = require('http');
const fs = require('fs'); // for read file
const hostname = '127.0.0.1';
const port = 3000;
fs.readFile('index.html', (err, html) =>{
if (err){
throw err;... |
Markdown | UTF-8 | 4,067 | 3.125 | 3 | [] | no_license | # ScrollMonitor-React
This is a React component that provides an API to the [scrollMonitor](https://github.com/stutrek/scrollMonitor).
It can call methods when a watched element enters or exits the viewport and adds `isInViewport`, `isAboveViewport`, `isBelowViewport`, and `isFullyInViewport` to `this.props`.
## Usa... |
Java | UTF-8 | 583 | 2.234375 | 2 | [] | no_license | package hibernateTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.man.spring.hibernate.entity.User;
import com.man.spring.hibernate.service.UserService;
public class hibernateTest {
public static void main(String[] a... |
Java | UTF-8 | 8,078 | 2.78125 | 3 | [] | no_license | package com.yubin.homework.utils;
import lombok.extern.slf4j.Slf4j;
import org.joda.time.DateTime;
import java.sql.*;
/**
* @program: homework
* @description:测试100万数据不同方式插入效率
* @author: Yu Bin
* @create: 2021-06-20 13:35
**/
@Slf4j
public class TestJdbcUtil {
//创建一些静态成员变量,用来存储数据库的连接信息
private static Str... |
JavaScript | UTF-8 | 1,241 | 2.75 | 3 | [] | no_license | /* This retuns the Resource Element Category
* @Author Yattong Wu
* @version 1.0.0
* @date 16/04/19
* @param {string} categoryPath - The Cateogry path for Resource Element.
* @return {resourceElementCategory} The Resource Element Category Object.
*/
// Set Standard Logging
var objType = "Action";
var objName = "restCa... |
Go | UTF-8 | 587 | 2.703125 | 3 | [] | no_license | package main
import "fmt"
func main() {
var n, k int
var s string
fmt.Scan(&n, &k, &s)
ans := 0
for l, r := -1, 0; r < len(s); r++ {
for r < len(s) && s[r] == '1' {
r++
}
for k > 0 {
k--
for r < len(s) && s[r] == '0' {
if r > len(s)-1 {
break
}
r++
}
for r < len(s) && s[r] ... |
C++ | UTF-8 | 2,529 | 3.484375 | 3 | [
"MIT"
] | permissive | #include"alert.h"
#include<vector>
#include<string>
#include<iostream>
using namespace std;
System AlertSystem;
struct vital
{
string vital_id;
float minLimit;
float maxLimit;
};
struct vital_array
{
string string_id;
float val;
};
class VitalList
{
vector<vital> vital_list;
public:
voi... |
Java | UTF-8 | 13,029 | 2.265625 | 2 | [] | no_license | package com.operation.business;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import java.util.Set;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;... |
Python | UTF-8 | 887 | 2.703125 | 3 | [] | no_license | dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]]
def BFS(start_node, target_row, target_col, maps):
global discovered
queue = [start_node + (1,)]
discovered[start_node[0]][start_node[1]] = 1
while queue:
cr, cc, w = queue.pop(0)
for r, c in dxy:
nr = cr + r
nc = cc + c
... |
Markdown | UTF-8 | 4,291 | 2.71875 | 3 | [
"CC-BY-4.0",
"CC-BY-NC-4.0",
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | ---
layout: post
title: "De Android à iOS"
ref: android-ios
lang: fr
date: 2020-08-06 16:30:00 -0500
author: Guillaume Charest
excerpt_separator: <!--more-->
---
Depuis la sortie du Nexus One de Google, j'ai eu presque exclusivement des téléphones Android, avec de très courts essais de certains modèles de iPhones. L... |
C | UTF-8 | 1,909 | 2.703125 | 3 | [
"LicenseRef-scancode-dco-1.1",
"MIT"
] | permissive | #include <aos/aos.h>
#include <spawn/process_manager.h>
/*------------------------------------------Implementations------------------------------------------------*/
/* private */
struct domain_info* process_manager_new_node(const char *name, coreid_t core, domainid_t domainid) {
assert(name != NULL);
assert(... |
C | ISO-8859-1 | 1,997 | 3.734375 | 4 | [] | no_license | #include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <locale.h>
/*2.3.2 Em uma empresa de saneamento bsico os servios
recebem uma numerao de acordo com sua natureza: 1 para
troca de tubulao, 2 para verificao de problemas de
vazamento, 3 para ligao de gua e esgoto. De acordo com o
problema, o se... |
Java | UTF-8 | 956 | 2.421875 | 2 | [] | no_license | package com.itsm.frontend.service;
import com.itsm.common.entity.Transaction;
import com.itsm.frontend.annotation.Auditable;
import com.itsm.frontend.storage.Storage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.persistence.EntityManager;
i... |
Ruby | UTF-8 | 666 | 2.765625 | 3 | [] | no_license | class Item::UserItemService
def initialize(player, user_item)
@player = player
@user_item = user_item
end
def name
return @user_item.item.name
end
def count
return @user_item.count
end
def sell_price
return @user_item.item.sell_price
end
# このアイテム売る
def sell
#先にアイテムを減らす。
... |
Java | UTF-8 | 5,724 | 2.125 | 2 | [] | no_license | package com.ecocitycraft.shopdb.controllers;
import com.ecocitycraft.shopdb.database.ChestShop;
import com.ecocitycraft.shopdb.database.Player;
import com.ecocitycraft.shopdb.database.Region;
import com.ecocitycraft.shopdb.models.PaginatedResponse;
import com.ecocitycraft.shopdb.models.chestshops.*;
import com.ecocity... |
JavaScript | UTF-8 | 4,623 | 3.1875 | 3 | [] | no_license | var library = {
tracks: { t01: { id: "t01",
name: "Code Monkey",
artist: "Jonathan Coulton",
album: "Thing a Week Three" },
t02: { id: "t02",
name: "Model View Controller",
artist: "James Dempsey",
... |
Java | UTF-8 | 2,220 | 2.296875 | 2 | [
"Apache-2.0"
] | permissive | /**
*
*/
package com.yueny.rapid.email.sender.internals.tacitly;
import com.yueny.rapid.email.sender.entity.MessageData;
import com.yueny.rapid.email.sender.listener.ConsoleEmailSendListener;
import com.yueny.rapid.email.sender.listener.IEmailSendListener;
import com.yueny.rapid.lang.thread.executor.AsyncLoadExecuto... |
Python | UTF-8 | 5,070 | 2.515625 | 3 | [
"MIT"
] | permissive | import os
import unittest
import shorttext
class TestVarNNEmbeddedVecClassifier(unittest.TestCase):
def setUp(self):
if not os.path.isfile("test_w2v_model"):
os.system("wget https://raw.githubusercontent.com/chinmayapancholi13/shorttext_test_data/master/test_w2v_model") # download w2v model
self.w2v_mo... |
Swift | UTF-8 | 357 | 2.53125 | 3 | [] | no_license | //
// Error.swift
// FlightSearch
//
// Created by Andrey Ovsyannikov on 19.02.2021.
// Copyright © 2021 home.com. All rights reserved.
//
import Foundation
enum LocalError: Error, LocalizedError {
case notFound
var errorDescription: String? {
switch self {
case .notFound:
... |
Java | UTF-8 | 3,881 | 1.828125 | 2 | [
"Apache-2.0"
] | permissive | package ru.ltst.u2020mvp.tests;
import android.test.ActivityInstrumentationTestCase2;
import com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers;
import com.squareup.spoon.Spoon;
import javax.inject.Inject;
import dagger.ObjectGraph;
import retrofit.MockRestAdapter;
import ru.ltst.u2020mvp.R;
im... |
Ruby | UTF-8 | 354 | 3.796875 | 4 | [] | no_license | print'Intro num_1: '
n1=gets.to_i
print'Intro num_2: '
n2=gets.to_i
print'Intro num_3: '
n3=gets.to_i
if n1 > n2 && n1>n3
print 'El mayor es: '
puts n1
else
if n2>n3
print 'El mayor es: '
puts n2
else
if n3>n1
print 'El mayor es: '
puts n3
... |
Java | UTF-8 | 844 | 2.703125 | 3 | [] | no_license | package spittr.data;
import org.springframework.stereotype.Component;
import spittr.Spittle;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Component
public class Spittles implements SpittleRepository {
private List<Spittle> list = new ArrayList<>();
public Spittles() {
... |
Ruby | UTF-8 | 267 | 2.59375 | 3 | [] | no_license | require './minion'
class SouthseaDeckhand < Minion
def initialize
super
self.name = "Southsea Deckhand"
self.cost = 1
self.attack = 2
self.max_health = 1
end
def charge
if owner.weapon
true
else
false
end
end
end
|
JavaScript | UTF-8 | 2,428 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | /**
* logger.js - HumanInput Logger: A really nice logging class
* Copyright (c) 2016, Dan McDougall
* @link https://github.com/liftoff/HumanInput/src/logger.js
* @license Apache-2.0
*/
import { noop, isFunction } from './utils';
const console = window.console;
const levels = {
40: 'ERROR', 30: 'WARNING', 20... |
Java | UTF-8 | 61 | 2.078125 | 2 | [] | no_license | public interface Measurable {
public double getSize();
}
|
PHP | UTF-8 | 542 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Observers;
use App\Models\Config;
class ConfigObserver
{
public function created()
{
$this->saveConfigToCache();
}
public function updated()
{
$this->saveConfigToCache();
}
public function saveConfigToCache()
{
//pluck 手册地址:查询构造器
... |
Markdown | UTF-8 | 33,515 | 3.0625 | 3 | [] | no_license | <p data-nodeid="1077" class="">今天我想和你聊一聊怎么用 Serverless 开发一个服务端渲染(SSR)应用。</p>
<p data-nodeid="1078">对前端工程师来说,Serverless 最大的应用场景之一就是开发服务端渲染(SSR)应用。因为传统的服务端渲染应用要由前端工程师负责服务器的运维,但往往前端工程师并不擅长这一点,基于 Serverless 开发服务端渲染应用的话,就可以减轻这个负担。希望你学完今天的内容之后,能够学会如何去使用 Serverless 开发一个服务端渲染应用。</p>
<p data-nodeid="1079">话不多说,我们开始今天的学习。</p>
<h... |
Markdown | UTF-8 | 1,218 | 3.015625 | 3 | [] | no_license | # ToyRobot
This is a happy path implementation of the [Toy Robot Problem](PROBLEM.md) written in Elixir.
## Compiling and running
Before starting ensure that you have the correct versions of Elixir and Erlang availble
```
elixir 1.12.2-otp-24
erlang 24.0.3
```
Tests can be run with with the following command
```
... |
JavaScript | UTF-8 | 9,802 | 2.640625 | 3 | [] | no_license |
var command_queue = [];
var action_queue = [];
var refresh_event = 100;
//===========================
// CORE: handle socket 'n update event queue
//===========================
function Core(socket, images, init) {
this.socket = socket;
this.images = images;
this.init = init;
this.modules = {
map: new MapDat... |
Python | UTF-8 | 5,429 | 2.6875 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | import torch
from torch import nn
from torchtuples import tuplefy
def init_embedding(emb):
"""Weight initialization of embeddings (in place).
Best practise from fastai
Arguments:
emb {torch.nn.Embedding} -- Embedding
"""
w = emb.weight.data
sc = 2 / (w.shape[1]+1)
w.uniform_(-s... |
Ruby | UTF-8 | 741 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | require 'facter/util/blockdevices/linux'
require 'facter/util/blockdevices/freebsd'
module Facter::Util::Blockdevices
IMPLEMENTATIONS = {
'FreeBSD' => FreeBSD,
'Linux' => Linux
}
module NoImplementation
def self.devices
[]
end
end
def self.implementation
IMPLEMENTATIONS[Facter.... |
Markdown | UTF-8 | 3,904 | 3.15625 | 3 | [] | no_license | +++
title = "零和博弈与囚徒困境"
postid = 2488
date = 2016-04-03T10:23:55+08:00
isCJKLanguage = true
toc = false
type = "post"
slug = "zreo-sum-game-and-prisoners-dilemma"
aliases = [ "/post/2488.html",]
category = [ "impressions",]
tag = [ "reading",]
lastmod = 2016-04-03T10:23:55+08:00
attachments = [ "2487",]
+++
![零和博弈][5... |
C# | UTF-8 | 1,228 | 2.796875 | 3 | [
"Unlicense"
] | permissive | using Ryujinx.Graphics.Gal;
using Ryujinx.Graphics.Gal.Shader;
using System;
using System.IO;
namespace Ryujinx.ShaderTools
{
class Program
{
static void Main(string[] args)
{
if (args.Length == 2)
{
GlslDecompiler Decompiler = new GlslDecompiler();
... |
C++ | UTF-8 | 441 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int i;
int len = nums.size();
for (i = 0; i < len; i++)
if (target <= nums[i])
break;
return i;
}
};
int main()
{
Solution... |
PHP | UTF-8 | 757 | 3.46875 | 3 | [] | no_license | <?php
class Post
{
private $title;
private $text;
public function __construct($title, $text)
{
$this->title = $title;
$this->text = $text;
}
public function getTitle()
{
return $this->title;
}
public function setTitle($title)
{
$this->title = $title;
}
public function getTex... |
Java | UTF-8 | 963 | 1.945313 | 2 | [] | no_license | package com.glacier.frame.dao.basicdatas;
import com.glacier.frame.entity.basicdatas.ParSellType;
import com.glacier.frame.entity.basicdatas.ParSellTypeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ParSellTypeMapper {
int countByExample(ParSellTypeExample example);
... |
C | UTF-8 | 694 | 3.359375 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int n, sum, dig, t, temp;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
temp=n;
while(temp!=1)
{
sum=0;
if(temp<10)
{
temp=temp*temp;
}
while(temp!=0)... |
PHP | UTF-8 | 1,581 | 2.9375 | 3 | [] | no_license | <?php
session_start ();
$login = htmlspecialchars($_POST['login']);
$password = htmlspecialchars($_POST['password']);
// Si le visiteur a bien entré un login et un mot de passe
if (isset($login) && isset($password)) {
// On ouvre la BDD pour consulter les clés login/password
include('head_and_footer/open... |
Python | UTF-8 | 1,629 | 2.828125 | 3 | [
"BSD-2-Clause"
] | permissive | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import pytest
from warnings import warn
from .context import apisample
from apisample.config import Config
from apisample.task import Task
from apisample.task_runner import TaskRunner
@pytest.fixture
def data():
try:
data = dict()
config = Config('./... |
Java | UTF-8 | 2,410 | 2.515625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-symphonysoft"
] | permissive | package org.mule.ide.core.samples;
/**
* Holds details about a sample project that can be loaded at Mule project creation.
*
* @author Derek Adams
*/
public class Sample {
/** Unique id for contributing plugin */
private String pluginId;
/** Description of the sample */
private String description;
/** Plu... |
C# | UTF-8 | 942 | 2.625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
namespace Microsoft.Maui.Controls.ControlGallery.GalleryPages.DragAndDropGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)... |
Java | UTF-8 | 1,853 | 2.625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package os.Clases;
/**
*
* @author Oscar
*/
public class Cliente {
private String nombre;
private String NIT;
private ... |
Java | UTF-8 | 1,871 | 3.140625 | 3 | [] | no_license | package cscd210Lab9;
import java.util.Scanner;
import cscd210Methods.CSCD210Lab9Methods;
import cscd210Methods.gameMethods.GuessTheWordGameMethods;
/**
* The CSCD210Lab9 class that contains the main method for playing the guess the word game
* <br> You may not change this class or the main method in any fashi... |
C# | UTF-8 | 1,588 | 2.75 | 3 | [] | no_license | using System.Collections.Generic;
using System.Linq;
using ANTIL.Domain.Core.Entities.Common;
using ANTIL.Domain.Dao.Interfaces.Common;
namespace ANTIL.Domain.Dao.Implementations.Common
{
public class GenericDao<T> : IGenericDao<T> where T : DomainObject
{
private readonly IDataAccessObject _dao;
... |
Markdown | UTF-8 | 1,979 | 2.640625 | 3 | [] | no_license | # Laravel + GraphQL + MongoDB Example
### About Project
The application was developed using Docker, PHP, MongoDB and GraphQL. To start you only need [docker](https://docs.docker.com/engine/install/ubuntu/)
and [docker-compose](https://docs.docker.com/compose/install/) installed on your machine.
#### How to start
`... |
Rust | UTF-8 | 4,587 | 3.390625 | 3 | [
"MIT"
] | permissive | //! Similar to `Arc<T>`, but is not allocated on heap.
//! This type panics if it gets dropped before all `Ref<T>`/`RefMut<T>` drops.
use core::ops::{Deref, DerefMut};
use core::ptr::NonNull;
use core::sync::atomic::{AtomicUsize, Ordering};
use super::strong_pin::StrongPinMut;
const BORROWED_MUT: usize = usize::MAX;
... |
Java | UTF-8 | 234 | 1.78125 | 2 | [] | no_license | package com.hrishikeshmishra.sb.spel;
import java.util.ArrayList;
import java.util.List;
/**
* Created by hrishikesh.mishra on 30/08/16.
*/
public class Simple {
public List<Boolean> booleanList = new ArrayList<Boolean>();
}
|
C | UTF-8 | 1,399 | 3.75 | 4 | [] | no_license | #include <stdio.h>
// SWEA_1970 쉬운 거스름돈
// 루프를 돌면서 마이너스 해주는 방법도 있으나
// 나눈다음 그 나온 몫 만큼 현재 금액에 곱하여 전체 금액에서 빼주는 방법이 더 효율적이다.
int main(void) {
int N;
scanf("%d",&N);
for(int i = 0 ; i<N ; i++){
int arr[8] = {0,};
int inp;
scanf("%d",&inp);
while(1){
if(inp == 0){ // ** break문을 맨처음에 걸지 않으면 in... |
Java | UTF-8 | 651 | 2.484375 | 2 | [] | no_license | package com.henteko07.androidlabteressampleapp.Model;
import com.henteko07.androidlabteressampleapp.Model.Blood;
import java.io.Serializable;
/**
* Created by kenta.imai on 2014/09/02.
*/
public class User implements Serializable {
public static final String USER_KEY = "first_user";
public static final Str... |
TypeScript | UTF-8 | 17,555 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | import { Component, Vue } from "vue-property-decorator";
import { DesktopFile, DesktopParser } from './DesktopParser';
import { readdir, readFile } from 'fs';
import fs from "fs";
import { exec } from "child_process";
import { ipcRenderer, app } from 'electron';
@Component({
components: {}
})
export default class ... |
C | UTF-8 | 6,437 | 2.875 | 3 | [] | no_license | /*
** TIME_MAKE derive 32-bit time value from TMX structure.
**
** Copyright (c) 1980, 1987 by Ken Harrenstien, SRI International.
**
** This code is quasi-public; it may be used freely in like software.
** It is not to be sold, nor used in licensed software without
** permission of the author.
** For everyon... |
JavaScript | UTF-8 | 927 | 4.6875 | 5 | [] | no_license | /**Common Suffix
constantly seeks words that end with the same letters. Write a function that, when given a word array, returns the largest suffix (word-end) common to all words in the array.
For inputs ["deforestation", "citation","conviction", "incarceration"], return "tion" (not all that creative a rhyming point). ... |
C# | UTF-8 | 993 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookShop
{
class NameRepository : Container
{
insert insert = new insert();
public static string []names = { "Sec... |
JavaScript | UTF-8 | 651 | 2.609375 | 3 | [] | no_license | const request = require('request')
const geocode = (address,callback)=>{
const url = "https://api.mapbox.com/geocoding/v5/mapbox.places/"+ encodeURIComponent(address)+ ".json?access_token=pk.eyJ1Ijoic3Vib2RoMTgiLCJhIjoiY2szNGptZjgzMDJ0MzNjbXYzMnpjbXZzciJ9.orvc9OFTHcRJuU7ec_ltig"
request({ url:url ,json: true }... |
PHP | UTF-8 | 1,240 | 2.53125 | 3 | [] | no_license | <?php
session_start();
include("config.php");
$username = mysql_real_escape_string($_POST['username']);
$realpassword = mysql_real_escape_string($_POST['password']);
$password = md5(mysql_real_escape_string($_POST['password']));
if (!isset($username) || !isset($password)) {
header("Location: logincriteria.php"); ... |
Java | UTF-8 | 1,386 | 2.59375 | 3 | [] | no_license | package ru.otus.dao;
import org.springframework.beans.factory.annotation.Autowired;
import ru.otus.datasets.*;
import java.util.*;
public class DBPreparation {
@Autowired
public DBPreparation(DBService dbService) {
UserDataSet user1 = new UserDataSet("tully", Collections.singletonList(new AddressDataSet("Mi... |
Java | UTF-8 | 1,375 | 2.171875 | 2 | [] | no_license | package com.tiger.golf.model;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
public class CustomerBodyInfo implements Serializable {
private Integer id;
private Integer cid;
private Integer height;
private Double weight;
private static final long serialVersionUID ... |
Java | UTF-8 | 133 | 1.867188 | 2 | [] | no_license | package com.baiyu.java;
public class Test04 {
public static void main(String[] args) {
System.out.println(7/2);
}
}
|
Python | UTF-8 | 1,694 | 2.640625 | 3 | [] | no_license |
import time
import json
from flask import Flask, request
from flask import jsonify
import os
import subprocess
app = Flask(__name__)
current_angle = 0
@app.route('/')
def homepage():
return "HI MAN HERRO"
@app.route('/api/v1/setup/camera')
def setup_camera():
if request.method == 'POST':
call(["./... |
Python | UTF-8 | 942 | 3.078125 | 3 | [] | no_license | import spacy
nlp = spacy.load('en')
#apply the pipeline to the sample sentence
doc = nlp(u'I want to place an order for a pizza.')
# extract the direct object and its transitive verb
dobj = ''
tverb = ''
for token in doc:
if token.dep_ == 'dobj':
dobj = token
tverb = token.head
# extract the verb for the inte... |
C# | UTF-8 | 944 | 2.890625 | 3 | [] | no_license | using ClassLibrary1;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
public static Test Test;
public static BackgroundWorker worker = new BackgroundW... |
Markdown | UTF-8 | 1,795 | 3 | 3 | [] | no_license | ---
layout: post
title: Ch 13 Discussion
---
A group decision system is being built over a network, which has inherent delays due to network lag. Suggest the longest acceptable amount of time the delay could last without affecting the user negatively. Provide an argument for the time you selected.
System confirming t... |
Java | UTF-8 | 3,768 | 2.859375 | 3 | [] | no_license | package com.cao.balance;
import com.alibaba.dubbo.common.json.JSON;
import com.alibaba.dubbo.common.utils.AtomicPositiveInteger;
import com.alibaba.dubbo.rpc.Invoker;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* @a... |
Java | UTF-8 | 1,865 | 1.773438 | 2 | [] | no_license | package com.duoweidu.cases.hsq.openapi;
import com.duoweidu.cases.interfaces.HsqInterfaceTest;
import com.duoweidu.config.sql.SqlDetail;
import com.duoweidu.model.hsq.UserEditcartskuData;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.testng.annotations.Test;
impor... |
Markdown | UTF-8 | 7,748 | 2.703125 | 3 | [] | no_license | # Robot Framework General Notes
A generic test automation framework for acceptance testing
Acceptance test-driven development (ATDD)
utilizes keyword-driven testing approach
Essentially, the script that is written in the IDE will be given to a webdriver which will then connect with the web for testing the s... |
C++ | SHIFT_JIS | 2,194 | 3.03125 | 3 | [] | no_license | #include "CSVConverter.h"
#include<fstream>
#include<sstream>
#include<stdexcept>
CSVConverter::CSVConverter(const std::string fileName) :
file_name_{ fileName }
{
Load();
}
void CSVConverter::Load()
{
std::ifstream file(file_name_);
//t@Cǂݍ߂Ȃ
if (!file)throw std::runtime_error("CSVt@CI[vł܂ł");
std::string line... |
Markdown | UTF-8 | 2,997 | 2.6875 | 3 | [] | no_license | # Customer Management System
このアプリケーションは顧客管理を目的としたアプリです。
氏名・住所・年齢などの情報や個人ごとにメモを残したりすることができます。
### 機能一覧
管理ユーザー登録機能/管理ユーザーログイン機能/顧客登録機能/顧客詳細表示機能/顧客編集機能/顧客検索機能/メモ投稿機能/地図表示機能/単体テスト機能
## 本番環境
URL: https://cm-system.herokuapp.com/<br>email: test@gmail.com<br>pass: test11
## DEMO
##### 顧客検索とメモ機能

class myCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs=None)... |
Python | UTF-8 | 308 | 3.421875 | 3 | [
"MIT"
] | permissive | #ENTRADA
algo = input('\033[35mDigite qualquer coisa: ')
print(type(algo))
#SAÍDA DE DADOS
print(algo.isupper())
print(algo.isnumeric())
print(algo.isalpha())
print(algo.islower())
print(algo.isascii())
print(algo.isdigit())
print(algo.isspace())
print(algo.isidentifier())
print(algo.istitle())
|
Go | UTF-8 | 42,119 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | package parser_test
import (
"strings"
"github.com/bytesparadise/libasciidoc/pkg/parser"
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"
log "github.com/sirupsen/logrus"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("tables",... |
Java | UTF-8 | 1,143 | 3.34375 | 3 | [] | no_license | package barriers;
import java.util.Random;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicIntegerArray;
public class Barriers {
private static final in... |
Python | UTF-8 | 1,038 | 2.71875 | 3 | [] | no_license | #!/usr/bin/python3
# encoding:utf-8
'''
@author: liyin
@file: testpolls.py
@time: 2018-09-29
'''
import unittest
import json
import requests
class Lesson3Test(unittest.TestCase):
def setUp(self):
self._url="http://127.0.0.1:8000"
def get_url(self, url):
r=requests.get(url)
return (r... |
Python | UTF-8 | 14,847 | 2.65625 | 3 | [] | no_license | class Halo() :
def __init__(self,id,aexp) :
self.id = id
self.aexp = aexp
def __repr__(self):
return 'Halo(id=%d, aexp=%6.4f)' % (self.id, self.aexp)
def getId(self) :
return self.id
def getAexpn(self) :
return self.aexp
def integrate_profile ( pro, rbins, rcore=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.