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 | 2,825 | 3.5 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Blackjack
{
public class Hand
{
public Card[] hand { get; private set; }
public string playerAndDealer { get; private set; }
public int score { get; private set... |
Java | UTF-8 | 8,006 | 2.5625 | 3 | [] | no_license | package cst338.p1.tests;
import static org.junit.Assert.*;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import cst338.p1.CourseDuplicateExceptio... |
JavaScript | UTF-8 | 253 | 2.8125 | 3 | [] | no_license |
class App extends React.Component {
constructor(props) {
super(props); // calls the constructor of the extended class
// which is React.Component
}
render() {
return <h2>Hello, this is the App component</h2>;
}
} |
Python | UTF-8 | 2,154 | 2.875 | 3 | [
"MIT"
] | permissive | import batma
from models import *
class Lose(batma.Scene):
def load_content(self):
self.label = batma.Text('Loser...', batma.display.center)
def update(self, tick):
if batma.mouse.is_any_pressed():
batma.game.new_game()
def draw(self):
self.label.draw()
class Win(bat... |
Python | UTF-8 | 2,114 | 2.578125 | 3 | [] | no_license | from matplotlib import pyplot as plt
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Dropout, Flatten, Dense
from tensorflow.keras.optimizers import Adam
from dataprocessor import data_process
import os
def build_model(model):
model.add(Conv2D(32, ... |
C | UTF-8 | 1,742 | 3.9375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
/**********
Crie uma struct palavra para armazenar um texto de no máximo 100 bytes,
quantidade de vogais e quantidade de consoantes. Crie um programa com uma
função leArquivo para ler palavras de um arquivo e preencher o vetor, alocado
dinamicamente, com en... |
Java | UTF-8 | 4,854 | 2.03125 | 2 | [] | no_license | package psd.stats;
import org.apache.flink.api.java.tuple.Tuple2;
import psd.alerts.*;
import java.util.ArrayList;
import java.util.List;
public class StatsChecker {
/**
* // For testing (first 100 samples):
* private static final double[] MEAN_THRESHOLD = {-0.006894507, 0.004927153, 0.00134661, -0.00113519... |
Go | UTF-8 | 2,380 | 3.171875 | 3 | [] | no_license | package main
import (
"context"
"fmt"
"genLink/proto/api"
"google.golang.org/grpc"
"log"
"os"
)
func Сhoice(cli api.GenLinkClient) {
file, err := os.OpenFile("log.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
if err != nil {
log.Fatal(err)
}
log.SetOutput(file)
var start string
const Create = "1"
... |
Markdown | UTF-8 | 8,616 | 3.328125 | 3 | [] | no_license | # Motivation
## Why bipedal walking?
* Robots should be able to navigate in environments made for humans:
* Little space
* Obstacles (e.g. stairs)
$\Rightarrow$ Wheeled base not flexible enough.
* **Problem:** How do you guarantee stability during walking?
## The Human Gait
* Of primary interest for stabi... |
Java | UTF-8 | 361 | 2.453125 | 2 | [] | no_license | package com.m2d2apps.catviewer.models;
import java.util.ArrayList;
import java.util.List;
public class PhotosList {
ArrayList<Photo> data;
public PhotosList() {
data = new ArrayList<Photo>();
}
public ArrayList<Photo> getPhotos() {
return data;
}
public void addPhoto(Photo p... |
JavaScript | UTF-8 | 2,597 | 3.03125 | 3 | [] | no_license | class MathFactsOutcome extends Phaser.Scene {
constructor() {
super({ key: 'MathFactsOutcome' });
}
init(data) {
this.numDone = data.completed;
this.playerTime = data.time;
this.correct = data.score;
this.operation = data.operator;
}
preload() {
this... |
C++ | UTF-8 | 190 | 2.6875 | 3 | [] | no_license | #include "stdio.h"
int main(){
int round = 0;
printf("Enter 2D = ");
scanf("%d",&round);
for(int i=0;i<round;i+=1){
for(int j=0;j<=i;j+=1){
printf("*");
}
printf("\n\n");
}
}
|
Java | UTF-8 | 1,239 | 3.640625 | 4 | [] | no_license | package com.carrysk.Demo06IOAndProperties;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
/**
* public abstract write(byte[] b) 将byte[] b 写入文件
* public abstrack write(byte[] b, int begin, int len); begin 就是开始下标 len 是写的长度
*
* 注意 字节在0~128之间是ascall 之外是系统... |
Java | UTF-8 | 339 | 2.9375 | 3 | [] | no_license | package strategy;
public class RubberDuck extends Duck {
public RubberDuck() {
this.flyingBehaviour = new FlyWithNoWings();
}
@Override
public void display() {
System.out.println("I am yellow and rubbery");
}
public void quack() {
System.out.println("Squeek ... |
Java | UHC | 6,974 | 2.828125 | 3 | [] | no_license | package cproject;
import java.util.*;
import java.util.regex.Pattern;
public class AdminHandler {
Scanner s;
User userList[] = new User[5];
//Admin adminList[] = new Admin[1];
Admin admin = new Admin();
int userCnt;
int AdminCheck;
int adminLoginCnt = 0;
int userLoginCnt = 0;
String adminID = ... |
C# | UTF-8 | 2,865 | 2.6875 | 3 | [] | no_license | using NUnit.Framework;
using RMays.Aoc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RMays.Aoc2020.Tests
{
[TestFixture]
public class Day4Tests
{
// Official final times:
// part 1: 12m25.54s
// part... |
Markdown | UTF-8 | 1,597 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | # IntersightClient::HyperflexServerFirmwareVersionEntryAllOf
## Properties
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **class_id** | **String** | The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload... |
JavaScript | UTF-8 | 172 | 3.296875 | 3 | [] | no_license | function printStars() {
let toPrint = "";
for (let i = 1; i < 6; i++) {
toPrint = toPrint.concat("*");
console.log(toPrint);
}
}
console.log(printStars());
|
JavaScript | UTF-8 | 5,479 | 3.84375 | 4 | [] | no_license | //**** variables & strings ****
//var firstName = "jack";
//var lastName = "jacob";
//var age = 23;
//
//
//var message = " hi, my name is " + firstName + " and I am " + age + " years old ";
//
//console.log(message);
//******** NUMBERS********
//var sum = 10 + 15;
//var sub = 15 - 10;
//var mul = 10 * 3;
//var... |
Go | UTF-8 | 18,772 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | package main
import (
"bytes"
"encoding/binary"
"math/rand"
"net"
"time"
)
// Start time for this instance, used to compute sysUptime
var StartTime = time.Now().UnixNano()
// current sysUptime in msec - recalculated in CreateNFlowHeader()
var sysUptime uint32 = 0
// Counter of flow packets that have been sent
... |
C++ | UTF-8 | 1,282 | 3.296875 | 3 | [] | no_license | #pragma once
#include <string>
#include <iostream>
using namespace std;
class Item
{
public:
// Constructors and destructors
Item();
Item(string id, string title, string rentType, string loanType, int stock, double rentFee); // Constructor for new games
Item(string id, string title, string rentType, string loanT... |
PHP | UTF-8 | 3,439 | 2.671875 | 3 | [] | no_license | <?php
require_once('dbinit.php');
require_once('customer.php');
require_once('order.php');
require_once('orderDetail.php');
function comboBoxHtml($label, $map, $selectedRowId) {
$html = "<select id='$label' name='$label'>";
foreach ($map as $id => $name) {
$selected = $id === intval($selecte... |
Python | UTF-8 | 2,929 | 2.75 | 3 | [] | no_license | import PlanNode as pn
import Parser as ps
def RelationTest():
test_schema = ["a", "b", "c"]
test_tuple_1 = [1, 2, 3]
test_tuple_2 = [4, 5, 6]
test_tuple_3 = [7, 8, 9]
test_tuples_1 = [test_tuple_1, test_tuple_2, test_tuple_3]
test_relation_1 = pn.Relation(test_schema, test_tuples_1, "test1")... |
Markdown | UTF-8 | 768 | 3 | 3 | [
"MIT"
] | permissive | # archive
Utils for archiving files.
## archive.extract
```python
extract(path, to_path='', ext='')
```
Unpack the tar or zip file at the specified path or file to the directory
specified by ``to_path``. It supports many extensions, like ``.tar``,
``.tar.bz2``, ``.tar.gz``, ``.tgz``, ``.tz2``, ``.zip``. If the file ... |
Java | UTF-8 | 3,988 | 3.0625 | 3 | [] | no_license | package com.smithforge.realty;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.D... |
JavaScript | UTF-8 | 2,841 | 4.15625 | 4 | [] | no_license | let userScore = 0;
let computerScore = 0;
// DOM elements:
const userScoreEl = document.getElementById("user-score");
const computerScoreEl = document.getElementById("computer-score");
const scoreBoardEl = document.querySelector(".score-board");
//getting the results p tag so that the styling does not go away
co... |
Shell | UTF-8 | 3,195 | 3.34375 | 3 | [] | no_license | #!/bin/bash
SQLITE_DBPATH=${SQLITE_DBPATH:-/data/pdns.sqlite}
API_KEY=${API_KEY:-genericapikey}
MASTER=${MASTER:-no}
SLAVE=${SLAVE:-yes}
SLAVE_RENOTIFY=${SLAVE_RENOTIFY:-no}
SLAVE_CYCLE_INTERVAL=${SLAVE_CYCLE_INTERVAL:-10}
DEFAULT_TTL=${DEFAULT_TTL:-3600}
DEFAULT_SOA_NAME=${DEFAULT_SOA_NAME:-$(hostname -f)}
DEFAULT_SO... |
C# | UTF-8 | 1,016 | 2.546875 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
public struct heart_beat {
public static ushort ID = 65500;
enum state_t
{
INTERACTIVE,
HEART_BEAT,
};
public void interactive()
{
m_mode = (long)state_t.INTERACTIVE;
m_future_time = System.DateTime.U... |
Java | UTF-8 | 1,987 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | package org.siouan.frontendgradleplugin.core;
import java.io.File;
import org.gradle.api.Task;
/**
* This abstract class provides the reusable logic to run a NPM/Yarn script.
*/
public class RunScriptJob extends AbstractTaskJob {
/**
* Executor use to run the script.
*/
private final Executor ex... |
Shell | UTF-8 | 464 | 3.421875 | 3 | [] | no_license | # Source: http://stackoverflow.com/a/14106707 by Keith Thompson
# ============
# Example:
# fileName="$(cond "$useDefault" "$defaultName" "$customName").txt"
# ============
# Instead of
# ============
# if [ $useDefault ]; then
# tmpname="$defaultName"
# else
# tmpname="$customName"
# fi
# fileName="$dirName/$tmpna... |
C# | UTF-8 | 2,594 | 3.015625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using WHMS.Commands.Contracts;
using WHMS.Services.Contracts;
namespace WHMS.Commands.Modifying
{
public class AddProductToOrderCommand : ICommand
{
private IOrderService orderService;
private IProductService productService;
private IProd... |
Swift | UTF-8 | 1,464 | 2.796875 | 3 | [
"MIT"
] | permissive | //
// BoundlessContext.swift
// BoundlessKit
//
// Created by Akash Desai on 3/8/18.
//
import Foundation
internal class BoundlessContext : NSObject {
static var locationEnabled = false
static var bluetoothEnabled = false
static let queue = DispatchQueue(label: NSStringFromClass(BoundlessContext.s... |
Java | UTF-8 | 753 | 3.046875 | 3 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Mathematics.Algorithm;
/**
* Interface for an
* <a href="http://en.wikipedia.org/wiki/Iterative">iterative</a>
* {@see Algorithm algorithm}.
* @author Rune Dahl Iversen
* @param <TypeOfValue> Type of value... |
C++ | UTF-8 | 7,463 | 2.515625 | 3 | [] | no_license | #include "test_runner.h"
#include "manager.h"
#include "utils.h"
#include "requests.h"
using namespace std;
const unordered_map<string, Request::ERequestType> ModifyRequestTypeByString = {
{"Stop", Request::ERequestType::ADD_STOP},
{"Bus", Request::ERequestType::ADD_BUS}
};
const unordered_map<string, Reque... |
C# | UTF-8 | 1,673 | 2.84375 | 3 | [] | no_license | using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using Cygni.DataTypes;
using Cygni.AST;
namespace Cygni.Extensions
{
/// <summary>
/// Description of Extension.
/// </summary>
public static class Extension
{
public static ... |
Markdown | UTF-8 | 1,593 | 3.078125 | 3 | [] | no_license | # C'est quoi un navigateur ?
## [Le fonctionnement de base du navigateur:](https://www.ntu.edu.sg/home/ehchua/programming/webprogramming/HTTP_Basics.html)
Le navigateur ne fait pas de magie : tout se passe sur le réseau. le navigateur interroge le serveur distant sur une socket, récupère la réponse, l'interprète, et... |
Java | UTF-8 | 539 | 3.046875 | 3 | [] | no_license | package IXL;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* Created by yuegu on 12/1/18.
*/
public class _518_CoinChange2 {
public int change(int amount, int[] coins) {
Map<Integer, Integer> map = new HashMap<>();
for(int i = 0; i < coins.length; i++) {
map.put(coins[... |
C# | UTF-8 | 2,474 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ClassLibraryData;
namespace ClassLibraryMethods
{
public class ServiceMethods
{
public List<FilmDTO> GetFilms()
{
List<FilmDTO> Films = new ... |
Java | UTF-8 | 1,715 | 2.40625 | 2 | [] | no_license | /**
* 26-feb-2015 - MyGochisDAO.java
* © Instituto Tecnológico de Informática, All Rights Reserved
*/
package es.iti.formacion.tecnogochi.persistence.dao;
import javax.persistence.EntityManager;
import javax.persistence.Persistence;
import javax.persistence.TypedQuery;
import es.iti.formacion.tecnogochi.model.MyG... |
C++ | UTF-8 | 9,565 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "CryptoUtil.h"
static const unsigned int _IV[5] = { 0x67452301, 0xefcdab89, 0x98badcfe,
0x10325476, 0xc3d2e1f0 };
static const unsigned int _K0 = 0x5a827999;
static const unsigned int _K1 = 0x6ed9eba1;
static const unsigned int _K2 = 0x8f1bbcdc;
static const unsigned int _K3 = 0xa953fd4e;
static const uns... |
Java | UTF-8 | 1,722 | 2.921875 | 3 | [] | no_license | package nullpointerexception.flexichess;
public class FitGirls {
public static String boardAsString(int[][] board) {
int radky = board.length;
int sloupce = board[0].length;
StringBuffer buffer = new StringBuffer();
buffer.append(" ");
for (int i = 0; i < sloupce;... |
Java | UTF-8 | 13,618 | 2.390625 | 2 | [] | no_license | package org.zywx.wbpalmstar.base.zip;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import java.util.zip.CRC32;
import java.util.zip.Deflater;
import java.util.zip.ZipException;
public class CnZipOutputStream exte... |
Python | UTF-8 | 608 | 5.15625 | 5 | [] | no_license | # Chapter-3: Arrays
# Array-Swap-Pairs
# Swap positions of successive pairs of values of given array. If length is odd, do not change the final element. e.g, for [1,2,3,4] return [2,1,4,3]. for ["Brendan", true, 42] return [true, "Brendan", 42]. Do this without using built-in methods
# Assume the array passed is a non... |
Java | UTF-8 | 606 | 2.09375 | 2 | [] | no_license | package com.neirx.stopwatchtimer.fragments;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.neirx.stopwatchtimer.R;
public class QueueFragment extends Fragment {
public static QueueFragment newInstanc... |
Java | UTF-8 | 1,707 | 3.171875 | 3 | [] | no_license | package com.zcc.thread_practise.Thread_example1;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
/**
* @author zcc
* @ClassName PhoneSearchMethon
* @description
* @date 2021/5/31 19:49
* @Ve... |
Markdown | UTF-8 | 7,663 | 2.8125 | 3 | [] | no_license | # Mirage Demo
This demo shows how [Mirage](https://github.com/SpectoLabs/mirage) can "record" responses from a third-party service, and then mimic the third-party service by "playing back" the recorded responses.
Please refer to the [Mirage documentation](https://github.com/SpectoLabs/mirage/wiki) for more informatio... |
C++ | UTF-8 | 731 | 2.75 | 3 | [] | no_license | #include "mbed.h"
#define BAUDRATE 115200
#define PC_BUFFER_SIZE 256
Serial pc( USBTX, USBRX, BAUDRATE );
char pc_buff[PC_BUFFER_SIZE];
volatile bool pc_msg = false; // valid message recieved from PC
// ISR to read Serial message from the PC bus
void echo(void)
{
// echo whatever you get
int i = 0;
char ... |
Java | UTF-8 | 3,755 | 2.578125 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) 2021 Dinusha Jayawardena. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
package service;
import model.Batch;
import model.Course;
import service.exception.NotFoundException;
import java.time.LocalDate;
import java.util.A... |
Python | UTF-8 | 15,996 | 4.1875 | 4 | [] | no_license | """
Implements a binary search tree in python
"""
class BinaryNode(object):
def __init__(self, left=None, right=None, value=None, parent=None):
self.left = left
self.right = right
self.value = value
self.parent = parent
def __eq__(self, other):
return self.value == oth... |
Python | UTF-8 | 1,031 | 2.71875 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import numpy as np
import pdb
def Time_of_flight(xpmin,xpmax,ZPmin,ZPmax,N,pitch,c2):
resolution=0.0001 # 0.0002 m, grid resolution
sarray=(N-1)*pitch #size of array
Gx,Gz,Xt=np.mgrid[xpmin:xpmax+resolution:resolution,ZPmin:ZPmax+resolution:re... |
Java | UTF-8 | 3,795 | 2.484375 | 2 | [] | no_license | package net.huawei.wisdomstudy.dao.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate5.HibernateCallback;
im... |
Python | UTF-8 | 66 | 2.65625 | 3 | [] | no_license | import numpy
# identity matrix array
arr=numpy.eye(3)
print(arr)
|
Python | UTF-8 | 6,047 | 3.59375 | 4 | [] | no_license | from pprint import pprint as pp
from random import randint, randrange, random, uniform
# Estructuras por extensión
numeros = [1,5,3,4,8,2,5,7]
edades = {'Juan': 30, 'Camila': 28}
# Estructuras por compresión
# numeros pares del 2 al 100
numerosPares = []
for num in range(2,101):
if num % 2 == 0:
numeros... |
C++ | UTF-8 | 4,147 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cstdio>
#include <vector>
#include <map>
#include "Ngram.h"
using namespace std;
void input_td(const char *, vector<string> &);
void input_mp(const char *, map< string, vector<string> > &);
double getBigramProb(const char*, const char*, Vocab &, Ngram &);
vector<string>... |
JavaScript | UTF-8 | 3,839 | 2.515625 | 3 | [] | no_license | var wxApiJs = {
bannerAd : null, // banner 对象
showBannerTime : 0,//banner显示时间
//获取微信
getWx(){
if (cc.sys.platform != cc.sys.WECHAT_GAME) {
return null;
}
return wx;
},
/**
* 发送信息打开微信排行榜
* @param {类型} _type
*/
postMessage:function(_type){
console.log("==pai=hb2")
cons... |
Markdown | UTF-8 | 1,837 | 3.15625 | 3 | [
"MIT"
] | permissive | # Progress 进度条
### 介绍
用于展示操作的当前进度。
### 引入
在`app.json`或`index.json`中引入组件,详细介绍见[快速上手](#/quickstart#yin-ru-zu-jian)。
```json
"usingComponents": {
"van-progress": "@vant/weapp/progress/index"
}
```
## 代码演示
### 基础用法
进度条默认为蓝色,使用`percentage`属性来设置当前进度。
```html
<van-progress percentage="50" />
```
### 线条粗细
通过`strok... |
Python | UTF-8 | 496 | 3.796875 | 4 | [] | no_license | import math
a=input("enter length")
b=input("enter base")
c=input("enter hypotenuse")
a=float(a)
b=float(b)
c=float(c)
if a==0 or b==0 or c==0:
print("invalid input")
elif a+b>c and b+c>a and a+c>b:
perimeter=a+b+c
s=perimeter/2
area=math.sqrt(s*(s-a)*(s-b)*(s-c))
# print("the area and perimeter o... |
Markdown | UTF-8 | 2,565 | 2.609375 | 3 | [] | no_license | <h1 align="center">Hi 👋, I'm Manon</h1>
<h3 align="center">A junior web developer from France</h3>
- 🔭 I’m currently working on **finding a job!**
- 🌱 I’m currently learning **React**
- 📫 How to reach me **manon.garnier.lehy@gmail.com**
<h3 align="left">Connect with me:</h3>
<p align="left">
<a href="https://li... |
Markdown | UTF-8 | 4,612 | 2.640625 | 3 | [
"MIT"
] | permissive |
#include <QTRSensors.h> // QTR Sensörü tanımlandı.
#define CW 0 // Motorların hangi durumda ne tarafa hareket
#define CCW 1 // edeceği belirlendi.
#define MOTOR_A 0
#define MOTOR_B 1
const byte PWMA = 3; // 1. motor hız pini
const byte PWMB = 11; // 2. motor hız pini
const byte DIRA = 12; // 1. motor yön pini
c... |
Python | UTF-8 | 3,666 | 2.640625 | 3 | [] | no_license | from google.cloud import documentai_v1beta2 as documentai
def parse_table(project_id='document-ai-project-291706',
input_uri='gs://analysis_report_samples/sample_ocr_1.pdf'):
client = documentai.DocumentUnderstandingServiceClient()
gcs_source = documentai.types.GcsSource(uri=input_uri)
... |
JavaScript | UTF-8 | 1,349 | 3.5625 | 4 | [] | no_license | import $ from 'jquery';
function postWords(word){
let cleanedWord = word.replace(/[^a-zA-Z ]/g, "");
console.log(cleanedWord);
let addWordsUrl = "https://wordwatch-api.herokuapp.com/api/v1/words"
let addWordsData = {
word: { value: cleanedWord }
}
$.post(addWordsUrl, addWordsData, function(data, st... |
Python | UTF-8 | 652 | 2.625 | 3 | [] | no_license | import csv
from pyspark import SparkContext
from pyspark.sql import SQLContext
sc = SparkContext()
sqlContext = SQLContext(sc)
csvfile = sc.textFile('cleanedData.csv')
data = csvfile.mapPartitions(lambda line: csv.reader(line, delimiter='*'))
header = data.first()
datatail = data.filter(lambda x: x!=header)
schema =... |
C++ | UTF-8 | 662 | 2.96875 | 3 | [] | no_license | #include<stdio.h>
void swap(int &a,int &b)
{
int tm = a;
a = b;
b = tm;
}
int main()
{
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
int T;
scanf("%d",&T);
for(int t = 0; t<T; t++)
{
int x,r,c;
scanf("%d%d%d",&x,&r,&c);
i... |
Java | UTF-8 | 174 | 2.953125 | 3 | [] | no_license | public class Nombre{
private String nombre;
public Nombre(String n){
this.nombre=n;
}
@Override
public String toString(){
return "La persona se llama "+nombre;
}
}
|
C | UTF-8 | 140 | 3.21875 | 3 | [] | no_license | #include <stdio.h>
void soma1(int *x)
{
*x = *x + 1;
}
void main()
{
int x = 0;
soma1(&x);
soma1(&x);
soma1(&x);
printf("%d", x);
}
|
Python | UTF-8 | 2,471 | 3.5 | 4 | [] | no_license | from simpleai.search import SearchProblem, astar, breadth_first
class Connection:
def __init__(self, src, dest, cost):
self.src = src
self.dest = dest
self.cost = cost
class Graph:
def __init__(self):
self.connections = []
def add_connection(self, node1, node2, cost):
... |
C++ | UTF-8 | 947 | 3.375 | 3 | [] | no_license | class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
stack<int> st1; // store l1
stack<int> st2; // store l2
ListNode* prev = NULL;
ListNode* head;
int sum = 0;
// push l1's elements into stack
while(l1) {
st1.push(l1->va... |
JavaScript | UTF-8 | 1,192 | 2.8125 | 3 | [] | no_license | const todo = (state = [], action) => {
switch (action.type) {
case 'ADD_TODO': {
return [
...state,
{
id: action.id,
text: action.text,
completed: false
},
]
}
case 'EDIT_TODO': {
return state.map((todo, id) => {
if(id === ac... |
C++ | UTF-8 | 823 | 2.6875 | 3 | [] | no_license | #include "timeitem.h"
timeItem::timeItem()
{
timeSting = QDateTime::currentDateTime().toString("yyyy/MM/dd dddd hh:mm:ss");
timeWidth = 300;
timeHeight = 100;
}
void timeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
QFont font;
font.setPixelSize(18);
font.setBo... |
Python | UTF-8 | 1,153 | 2.90625 | 3 | [] | no_license | import noise_modeling as nm
import stabilizer as st
# Initial parameters
ps = 0.000
pm = 0.000
pg = 0.1
system_size = 4
parity = "Z"
# Initialize objects
stab = st.Stabilizer(ps, pm, pg)
model = nm.NoiseModel(system_size, parity)
# Define function and apply superoperator
superoperator_function = stab.local_stabilize... |
Python | UTF-8 | 3,232 | 2.640625 | 3 | [] | no_license | #Standard Packages
from rest_framework.views import APIView
from rest_framework.response import Response
#Models
from dashboard.models.users import Users
from dashboard.models.ratings import Ratings
from dashboard.models.movies import Movies
from dashboard.models.genres_movies import GenresMovies
from dashboard.models... |
Java | UTF-8 | 245 | 1.835938 | 2 | [] | no_license | package edu.uta.sis.calendars.data.repository;
import edu.uta.sis.calendars.data.entities.LocationEntity;
/**
* Created by Hannu Lohtander on 10.5.2016.
*/
public interface LocationRepository {
public void save(LocationEntity locationEntity);
}
|
Java | UTF-8 | 1,009 | 2.625 | 3 | [] | no_license | public class Restaurant {
// import takeout.utils.PrintUtils;
//import static takeout.utils.PrintUtils.*;
public static void main(String[] args) {
Menu menu = new Menu();
menu.printMenu();
Order firstOrder = new Order("John Smith");
firstOrder.setOrderNumb... |
Shell | UTF-8 | 2,116 | 3.671875 | 4 | [] | no_license | #!/bin/bash
if [ $# -ne 1 ];then
echo "[*] Usage: $0 <github url>"
exit;
fi
if [[ $1 == "https://github.com/*" ]]; then
echo "[X] Can't extract data for non-github website"
exit;
fi
issue_data() {
issue_resp=$(echo "$1")
for issue in $(echo $issue_resp | jq -r '.[] | @base64'); do
title=$(echo "$issue" | ba... |
Python | UTF-8 | 392 | 2.9375 | 3 | [] | no_license | def findprimes(b):
A=[]
for i in range(0,b+1):
A.append(i)
for j in range(2,(b//2)+1):
n=2
if A[j]==0:
pass
else:
while n <= b/j:
A[j*n]=0
n=n+1
k=0
L=len(A)
while k<L:
if A[k]==0:
del A[k... |
JavaScript | UTF-8 | 339 | 3.640625 | 4 | [] | no_license | function maxNumber(input) {
let index = 0
let maxNum = Number(input[0])
while (input[index] !== 'Stop') {
let currentNum = Number(input[index]);
if (currentNum > maxNum) {
maxNum = currentNum;
}
index++;
}
console.log(maxNum);
}
maxNumber(['100', '101', '... |
JavaScript | UTF-8 | 436 | 3.25 | 3 | [] | no_license | var number=110;
switch(number){
case 1:
console.log("it is okay");
break;
case 10:
console.log('searching correct number');
break;
case 12:
console.log("evething is okay");
break;
case 100:
console.log('are you okay wit... |
Java | UTF-8 | 1,953 | 2.28125 | 2 | [] | no_license | /******************************************************************************
* Copyright (C) 2017 ShenZhen Powerdata Information Technology Co.,Ltd
* All Rights Reserved.
* 本软件为深圳博安达开发研制。未经本公司正式书面同意,其他任何个人、团体不得使用、
* 复制、修改或发布本软件.
*****************************************************************************/
package ... |
C | UTF-8 | 1,511 | 2.515625 | 3 | [] | no_license | #ifndef SIMPLE_TCP_H
#define SIMPLE_TCP_H
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
typedef struct simple_tcp simple_tcp;
typedef struct simple_tcp_msg simple_tcp_msg;
enum simple_tcp_er... |
JavaScript | UTF-8 | 3,176 | 3.21875 | 3 | [] | no_license | var $container = document.getElementById("container"),
$city = document.getElementById("city"),
$numberDegree = document.getElementById("numberDegree"),
$iconTemp= document.getElementById("iconTemp"),
$descriptionTemp = document.getElementById("descriptionTemp"),
$city_actual = document.getElem... |
PHP | UTF-8 | 3,979 | 2.734375 | 3 | [] | no_license | <?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDaycare";
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Create database
$sql = "CREATE... |
Markdown | UTF-8 | 1,016 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | # Search Commons
Search Commons maintains custom search engines.
The engines are powered by [Google Custom Search][1] and available at [SearchCommons.org][4].
## Contributing
Search engines are specified in folder [`websites`](websites). A search engine specification contains the following files:
* `include.txt`:... |
Java | UTF-8 | 16,181 | 1.5625 | 2 | [] | no_license | package com.cjm.spf.controllers;
import java.io.FileNotFoundException;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import com.cjm.spf.domain.*;
import com.cjm.spf.dao.DatosAgresorDao;... |
Java | UTF-8 | 1,309 | 1.992188 | 2 | [] | no_license | package cn.bc.identity.service;
import cn.bc.identity.domain.Duty;
import cn.bc.test.AbstractEntityCrudTest;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.Sprin... |
Python | UTF-8 | 1,237 | 2.6875 | 3 | [] | no_license | import numpy as np
import math
import random
import seaborn as sns
from scipy import stats
import pandas as pd
from jury import *
from matplotlib import pyplot as plt
SIMULATIONS = 100000
# SIMULATIONS = 10000
BANDWIDTH = .5
# BANDWIDTH = 'silverman'
# CUMULATIVE = False
CUMULATIVE = True
jury = JuryList()
def no... |
JavaScript | UTF-8 | 4,818 | 2.6875 | 3 | [] | no_license |
const targetsOrder = [
STRUCTURE_SPAWN,
STRUCTURE_TOWER,
STRUCTURE_ROAD,
STRUCTURE_CONTAINER,
STRUCTURE_STORAGE,
STRUCTURE_EXTENSION,
// STRUCTURE_WALL,
];
const roleUtil = require('./role.util');
const tools = require('./tools');
var roleRepairer = module.exports = {
levels: [
... |
Java | UTF-8 | 186 | 1.632813 | 2 | [] | no_license | package pacman;
public class NativeActivityAbortContext {
public NativeActivityAbortContext(ActivityInstance instance, ActivityExecutor executor, Exception terminationReason) {
}
}
|
Python | UTF-8 | 699 | 3.90625 | 4 | [] | no_license | # -*- coding:utf-8 -*-
print "Mary had a little lamb."#输出此句
print "Its fleece was white as %s."%'snow'#%s被‘snow’替代
print "And everywhere that Mary went."#输出此句
print "."*10 #what'd that do?#输出这句十倍,即输出十次
end1="C"#赋值
end2="h"#赋值
end3="e"#赋值
end4="e"#赋值
end5="s"#赋值
end6="e"#赋值
end7="B"#赋值
end8="u"#赋值
end9="r"#赋值
end10="g"... |
Python | UTF-8 | 463 | 3.734375 | 4 | [] | no_license | import random
print("Welcome to the Lottery numbers generator.")
number = input("Please enter how many random numbers would you like to have: ")
def loto(n):
new = []
for x in range(0, n):
ran = random.randint(1, 40)
if ran not in new:
new.append(ran)
else:
... |
Java | UTF-8 | 6,004 | 1.757813 | 2 | [] | no_license | //
// Decompiled by Procyon v0.5.30
//
package com.google.android.gms.internal;
import android.content.Context;
public class zzuy
{
private zzuz Uv;
private boolean zzaom;
public zzuy() {
this.zzaom = false;
this.Uv = null;
}
public void initialize(final Context p0) {
... |
Python | UTF-8 | 1,843 | 4.09375 | 4 | [] | no_license | import numpy as np
# ==========数组计算
a_array = np.array([10, 20, 30, 40])
b_array = np.arange(4)
# print(a_array, b_array) # [10 20 30 40] [0 1 2 3]
# 相加
result = a_array + b_array
# print(result) # [10 21 32 43]
# 幂运算
result = b_array ** 2
# print(result) # [0 1 4 9]
# 三角函数
result = 10 * np.sin(a_array)
# print(... |
PHP | UTF-8 | 5,841 | 2.53125 | 3 | [] | no_license | <?php
/**
* 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 3, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful... |
JavaScript | UTF-8 | 1,406 | 2.78125 | 3 | [] | no_license | const files = require("./../../utils/files");
let movies = files.loadMovies(moviesData => movies = moviesData);
function getMovies(req, res) {
res.json(movies);
}
function getMovie(id) {
return movies.find(movie => movie.id === id);
}
function getLike(req, res) {
const likeMovies = movies.filter(movie => movie... |
Markdown | UTF-8 | 3,099 | 2.6875 | 3 | [] | no_license | # hadoop hdfs missing blocks & 安全模式 - 数据之美的博客 - CSDN博客
2018年11月19日 11:31:28[看穿数据之美](https://me.csdn.net/oppo62258801)阅读数:523
近期在做磁盘有关的一些测试时,最先是发现habse出现了RIT而且还是meta表的RIT,查看hadoop,出现了hdfs missing blocks的问题,hadoop master上一上来就能看见报该问题。
```
There are 88 missing blocks. The following files may be corrupted:
blk_1076662996 /... |
C++ | UTF-8 | 2,593 | 3.015625 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef __RING_H__
#define __RING_H__
namespace CTF {
/**
* \addtogroup algstrct
* @{
*/
/**
* \brief Ring class defined by a datatype and addition and multiplicaton functions
* addition must have an identity, inverse, and be associative, does not need to be commutative
* multiplications m... |
Java | UTF-8 | 1,733 | 2.15625 | 2 | [] | no_license | package com.tech387.arch.main;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view... |
Python | UTF-8 | 1,847 | 4.3125 | 4 | [] | no_license | class Node:
def __init__(self, value=None, next_node=None):
# the value at this linked list node
self.value = value
# reference to the next node in the list
self.next_node = next_node
def get_value(self):
return self.value
def get_next(self):
return self.next_node
def set_next(self, n... |
JavaScript | UTF-8 | 2,578 | 2.734375 | 3 | [] | no_license | var fs = require('fs');
var exec = require('child_process').exec;
var path = require('path');
//////////////////////////////////
// ROUTES
//////////////////////////////////
module.exports = [
// Serve up index.html
{ method: 'GET',
path: '/',
config: { handler: serveIndex }
},
// Serve up png's
{ metho... |
Java | UTF-8 | 859 | 2.15625 | 2 | [] | no_license | package com.virtusa.myapp.teamg.vhelper;
import com.virtusa.myapp.teamg.model.CartLineItem;
import com.virtusa.myapp.teamg.vo.CartLineItemVO;
public class CartLineItemvHelper {
private static CartLineItemvHelper cvHelper;
private CartLineItemvHelper() {
// nothing
}
public static CartLineIt... |
Python | UTF-8 | 8,755 | 2.53125 | 3 | [] | no_license | from setuptools import setup
setup(name='9dt',
version='0.1',
description='players, games',
url='http://github.com/jayljohnson/9dt', ## 'http://github.com/.../...'
author='Jay L. Johnson',
author_email='jljohn00@gmail.com',
license='...',
packages=['...'],
zip... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.