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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 340 | 3.796875 | 4 | [] | no_license | var array = [1,2,3,3,4,6,6]
function duplicate(array){
for(let i=0;i<=array.length;i++){
let count = 0;
for(let j=0;j<array.length;j++){
if(array[i] ==array[j]){
count++;
}
}
if(count >1){
console.log(array[i])
}
}... |
Shell | UTF-8 | 3,858 | 4.09375 | 4 | [
"Unlicense"
] | permissive | #!/bin/sh
marker=**********
logFile=logs/log.txt
key=$(($RANDOM%99999+10000))
isLogFileFound=false
FILEFOLDERSIZE=0k
verifyLogFile () {
if [ -f "$1" ]; then
isLogFileFound=true
else
isLogFileFound=false
now=$(date +"%Y-%m-%d %T")
echo "${now}* logFile '${logFile}' does not exist."
fi
}
ver... |
Markdown | UTF-8 | 2,553 | 3.25 | 3 | [
"MIT"
] | permissive | # Material dashboard
## Getting started
Per aggiungere Angular/material, digitare il seguente comando:
`ng add @angular/material`
## Creare una dashboard in stile material
Per generare il componente utilizzando il Material design, digitare il seguente comando:
`ng generate @angular/material:material-dashboard --name ... |
Python | UTF-8 | 4,717 | 2.84375 | 3 | [] | no_license | import pygame
class MazeRender():
def __init__(self, screem_maze, terminal_maze, screem_maze_size, sizes, screem_maze_solve, terminal_maze_solve):
self.screem_maze = screem_maze
self.terminal_maze = terminal_maze
self.screem_maze_size = screem_maze_size
self.sizes = sizes
se... |
PHP | UTF-8 | 1,878 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Lydia\Services;
use Lydia\Entity\Credentials;
use Exception;
use Lydia\Entity\User;
/**
* Class Auth
*
* See https://homologation.lydia-app.com/doc/api/#api-Auth
*
*/
class Auth extends Requestor
{
/**
* Payments constructor.
* @param Credentials $credentials
* @param $url
... |
C# | UTF-8 | 7,807 | 2.71875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using PostCodes.IO.Wrapper;
namespace LifeInsurance
{
public class Calculator
{
private readonly ILocationFinder _locationFinder;
private Dictionary<BasePrice, decimal> _basePremiums;
private Dictionary<ExcerciseBracket... |
Java | UTF-8 | 2,220 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | /*******************************************************************************
* Copyright 2015-2016 - CNRS (Centre National de Recherche Scientifique)
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for ad... |
TypeScript | UTF-8 | 655 | 2.734375 | 3 | [
"MIT"
] | permissive | import { useContext, useEffect } from 'react';
import FacebookContext from '../components/FacebookContext';
import type { FacebookContextInterface } from '../components/FacebookContext';
export type UseFacebookProps = {
lazy?: boolean;
};
export default function useFacebook(props: UseFacebookProps = {}): FacebookCo... |
Markdown | UTF-8 | 282 | 2.671875 | 3 | [] | no_license | # fastpythonfibonacci
fastest fibonacci generator in python
uses dual assignments at once to cut out the middleman.
10,000 Fibonacci number in less than 4 ms on 2014 hardware:
```
MacBook Air 1.3GHz (2014)
$ %timeit -n 100 fib(10000)
100 loops, best of 3: 3.79 ms per loop
```
|
Java | UTF-8 | 3,879 | 3.40625 | 3 | [] | no_license | public class PassByValue {
public static void main(String[] commandLine) {
// init values that are to be transmogrified
int intArg = 17;
double doubleArg = 0.5;
String stringArg = "A Change Is Gonna Come";
int[] arrayArg = { intArg, intArg, };
OurType... |
JavaScript | UTF-8 | 167 | 2.6875 | 3 | [] | no_license | function Inc(){
let i=0;
//this.toString = function(){
// return ++i
//}
}
let inc = new Inc();
console.dir(inc);
alert(inc)
alert(inc)
alert(inc+inc+inc) |
Python | UTF-8 | 124 | 3.3125 | 3 | [] | no_license | def euclid(n, m):
if m == 0:
return n
return euclid(m, n % m)
gcd = euclid(123456789, 987654321)
print(gcd) |
Java | UTF-8 | 10,916 | 2.5625 | 3 | [] | no_license | /* JSON API for android appliation */
package com.shekkahmeng.fypapplication.rest;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.Collection;
im... |
Markdown | UTF-8 | 1,143 | 2.9375 | 3 | [
"MIT"
] | permissive | # Angular Challenge
This folder contains code for interactively displaying a data set, created as part of the Angular Challenge.
The below questions should be answered regarding your submission!
##### What is the purpose of your website (what are you trying to convey with your data)? What API does your application f... |
Java | UTF-8 | 430 | 1.726563 | 2 | [] | no_license | package com.ptit.tranhoangminh.newsharefood.views.CategoryViews.activities;
import com.ptit.tranhoangminh.newsharefood.models.Category;
import java.util.ArrayList;
/**
* Created by Lãng on 26/4/2018.
*/
public interface CategoryView {
public void showProgress();
public void hideProgress();
public vo... |
C# | UTF-8 | 6,918 | 2.84375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Diagnostics;
using SourceDemoParser.Engine;
namespace SourceDemoParser
{
[DebuggerDisplay("{CurrentByte,nq}")]
public class SourceBufferWriter
{
public byte[] Data => _data.ToArray();
public int CurrentBit => _currentBit;
... |
Python | UTF-8 | 289 | 4.59375 | 5 | [] | no_license | # Write a program that reads a number in miles, converts it to kilometres, and displays the result.
# One mile is 1.60934 kilometres. Display your answer correct to 3 decimal places.
Miles = int(input("Enter distance in miles: "))
Kilometres = Miles * 1.60934
print(round(Kilometres, 3))
|
Java | UTF-8 | 3,312 | 1.617188 | 2 | [] | no_license | package com.tencent.biz;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.tencent.mobileqq.hotpatch.NotVerifyClass;
import java.util.List;
public class PoiMapActivi... |
C++ | UTF-8 | 739 | 3.96875 | 4 | [] | no_license | ////////////////////////////////////////////////////
// Function name : Max()
// Description : find largest number from three numbers.
// Input : 10 20 30
// Output : 30
// Author : Shiaji das
// Date : 19 june 2021
///////////////////////////////////////////////////
#include... |
Go | UTF-8 | 295 | 2.515625 | 3 | [] | no_license | package events
import (
"github.com/artheus/go-events/internal"
"github.com/artheus/go-events/types"
"time"
)
// Create a new event type with provided timestamp and
// event object to provide to subscribers
func Event(t time.Time, o interface{}) types.Event {
return internal.Event(t, o)
} |
Swift | UTF-8 | 2,424 | 3.203125 | 3 | [] | no_license | //
// Extensions.swift
// GetUp
//
// Created by Omer Elimelech on 6/22/16.
// Copyright © 2108 Omer Elimelech All rights reserved.
//
import UIKit
extension Dictionary where Key: ExpressibleByStringLiteral, Value: Any {
public func allKeys() -> [String] {
var tempArrayKeys = [String]()
... |
Markdown | UTF-8 | 5,360 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | # TaskQ: A distributed task queue in Go
This is a simple distributed task queue using which you can:
* enqueue a task into a named queue.
* dequeue a task from a named queue.
* acknowledge a task in a named queue.
Tasks are either in "active" or "dequeued" state. TaskQ dequeue tasks
from the list of active tasks, retu... |
C++ | WINDOWS-1250 | 1,932 | 2.78125 | 3 | [] | no_license | #ifndef PRODUCTO_H
#define PRODUCTO_H
#define FILE_PRODUCTOS "Archivos/Productos.dat"
class Producto
{
private:
int id,codProv,planCta,stock,stockMin;
float precioCosto,iva;
bool estado;
char descripcion[50];
public:
void cargarProducto();
///SETTERS A
i... |
C# | UTF-8 | 677 | 3.03125 | 3 | [] | no_license | /*
* // Make the action take over the text of the button
// When the button is pushed, deduct the necessary resources if available
// Create a new text window that updates periodically w/ how long it is
// Have update reduce time remaining on new action pane 1x per second
// Goal: Have a button that you push, create... |
C# | UTF-8 | 1,887 | 2.546875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
const int maxInt = 255;
public float smoothing = 1;
public float restTime = 1;
public float restTimer = 0;
[HideInInspector] public Vector2 targetPos = new Vector2(1, 1); //player... |
Python | UTF-8 | 3,417 | 2.84375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" list.py
"""
import json
import optparse
import os
import sys
def main():
parser = optparse.OptionParser()
parser.add_option("-d", "--delete", action="store")
parser.add_option("-D", "--delete_both", action="store_true")
options, args = parser.parse_... |
Markdown | UTF-8 | 1,195 | 3.015625 | 3 | [] | no_license | jQuery Routes
=============
**Download:** [Development](https://github.com/syntacticx/routesjs/zipball/master) | [Production (6KB)](https://github.com/syntacticx/routesjs/raw/master/jquery.routes.min.js)
**See Also:** [jQuery View](http://viewjs.com/)
Rails style routing for jQuery. Enables back button support, deep... |
C# | UTF-8 | 9,342 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using ZooboxApplication.Data;
using ZooboxApplication.Models.Adoption... |
Java | UTF-8 | 168 | 1.75 | 2 | [] | no_license | package com.wissen.com.wissen.model;
public interface Message {
public String getPipelineNo();
public String getCompany();
public Integer getSeqence();
}
|
C++ | UTF-8 | 1,419 | 2.625 | 3 | [] | no_license | #include "plotData.h"
plotData::plotData(const char *fifoname,unsigned int size){
path="/home/suntao/workspace/gorobots/controllers/stbot/genesis/study-tool/fifo";
path += fifoname;
pathname =path.c_str();
char temp[100]="/home/suntao/workspace/gorobots/controllers/stbot/genesis/study-tool/studyPlot ";
strcat(tem... |
C | UTF-8 | 610 | 3.125 | 3 | [] | no_license | #include <stdio.h>
#include "libs/bitmap.h"
int main(int argc, char **argv) {
bmpImage* img = newBmpImage(10, 10);
img->data[0][0] = (pixel) {255, 0, 0};
img->data[0][1] = (pixel) {0, 255, 0};
img->data[0][2] = (pixel) {0, 0, 255};
img->data[1][0] = (pixel) {255, 0, 255};
img->data[2][0] = (p... |
Python | UTF-8 | 4,153 | 3.09375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | import numpy as np
from igraph import Graph, plot
from itertools import combinations
import matplotlib
matplotlib.use('SVG')
import sys
reload(sys) # Reload does the trick!
sys.setdefaultencoding('UTF8')
__author__ = 'Erica-Li'
class hash_tag_graph:
"""
hash tag graph class
"""
def __init__(self,... |
C++ | UTF-8 | 538,830 | 2.515625 | 3 | [] | no_license | #include "objectscript.h"
#include <time.h>
using namespace ObjectScript;
#define HASH_GROW_SHIFT 0
// =====================================================================
// =====================================================================
// ====================================================================... |
Python | UTF-8 | 3,250 | 2.921875 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
from sklearn import neighbors, mixture, model_selection
import sklearn
from scipy import stats
from mpl_toolkits.mplot3d import Axes3D
plt.style.use('classic')
def plot_2d_density(estimator, X_sample, orig_dens, model_dens, xmin, xmax):
fig, ax = plt.subp... |
Markdown | UTF-8 | 2,415 | 3.078125 | 3 | [] | no_license | # OWDataExtractor
Workshop tool for recording tournaments and exporting them as data
## Import code: F4M6WT
-------
### SPECIAL THANKS TO ZEZOMBYE FOR [OVERPY](https://github.com/Zezombye/overpy)
I use overpy's decompiler to extract the data. Without it this project would have been a *huge* pain in the ass.
-----... |
C | UTF-8 | 2,357 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 1999-2016 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
Java | UTF-8 | 692 | 2.515625 | 3 | [] | no_license | /*
* (c) 2016 tylerhyperHD
*/
package com.tylerhyperhd.profreedommod;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
public class ConfigGrabber {
private static ProFreedomMod plugin;
public ConfigGrabber(ProFreedomMod plugin) {
ConfigGrabber.plugin... |
Java | UTF-8 | 7,627 | 2.5625 | 3 | [] | no_license | /**
*
*/
package twt.controller.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.hibernate.Query;
import twt.controller.MyGlobal;
import twt.controller.dao.imp.IExpress;
import twt.model.Express;
impo... |
C# | UTF-8 | 275 | 2.734375 | 3 | [] | no_license | private delegate void YourDelegate(obj param1,obj param2);
private void YourFunction(obj param1,obj param2)
{
//Write Code Here
}
//Call this from your Thread
this.Invoke(new YourDelegate(YourFunction), new object[] { param1,param2});
|
Shell | UTF-8 | 402 | 2.59375 | 3 | [] | no_license | #!/bin/sh
VERSION=0.2.7
tar --files-from=file.list -xzvf ../libspectre-$VERSION.tar.gz
mv libspectre-$VERSION libspectre-$VERSION-orig
cp -rf ./libspectre-$VERSION-new ./libspectre-$VERSION
diff -b --unified -Nr libspectre-$VERSION-orig libspectre-$VERSION > libspectre-$VERSION-gs.patch
mv libspectre-$VERSION-gs... |
Swift | UTF-8 | 2,066 | 2.859375 | 3 | [
"MIT"
] | permissive | import Foundation
public struct TypeParser {
public static let `default` = TypeParser()
/// The types that will be used to parse data.
///
/// Types are used in order. The first one in this array that matches the field mode (binary or text) and type id will be used to parse the data. You can change how data wi... |
Go | UTF-8 | 1,927 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | package core
import (
"io"
"net"
log "github.com/kermitbu/grapes/log"
)
// InitConnectAsServer a
func (c *CoreServer) InitConnectAsServer() {
addr, err := net.ResolveTCPAddr("tcp", "127.0.0.1:"+*port)
if err != nil {
log.Fatal(err.Error())
}
listen, err := net.ListenTCP("tcp", addr)
defe... |
Java | UTF-8 | 1,082 | 2.40625 | 2 | [] | no_license | package support.user.controler;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author marciano
*/
public class NodoClient {
private String user;
private String addressIp;
private long time;
private Map<String, Boolean> mapListaUrl = new HashMap<String, Boolean>();
public void addUrl(String url, bo... |
Markdown | UTF-8 | 3,699 | 3.03125 | 3 | [] | no_license |
## 操作场景
云数据库 SQL Server 支持通过控制台的**数据库管理**页创建数据库,并支持对数据库授权帐号访问。
## 单实例可创建数据库数量
>!
>- 当双节点(原高可用版/集群版)实例的数据库数量大于100时,必须要设置参数 max worker threads 的值为20000。如果使用默认值0,则无法创建数量100以上的数据库。设置方法请参见 [设置实例参数](https://cloud.tencent.com/document/product/238/59255)。
>- 为保证实例的稳定性,当实例 CPU 核数等于1时,不建议放开数据库数量限制,保持为70个。
>
SQL Server 2008 R2 ... |
C# | UTF-8 | 1,630 | 2.546875 | 3 | [] | no_license | using UnityEngine;
namespace LastStand
{
public class SurvivorGenerator
{
private const int INITIAL_SURVIVORS = 3;
private const int GENERIC_SURVIVOR_STAT_VARIANCE = 6;
public static void GenerateInitialSurvivors()
{
GenerateHeroicSurvivorModel();
for ... |
Python | UTF-8 | 900 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | import numpy as np
import pytest
from kiez.neighbors import HNSW, NNG, Annoy, SklearnNN
rng = np.random.RandomState(2)
@pytest.mark.parametrize("algo_cls", [HNSW, SklearnNN, NNG, Annoy])
def test_str_rep(algo_cls, n_samples=20, n_features=5):
source = rng.rand(n_samples, n_features)
algo = algo_cls()
ass... |
JavaScript | UTF-8 | 3,668 | 2.53125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var User = require('./schema');
const jwt = require('jsonwebtoken'); // used to create, sign, and verify tokens
const config = require('../../config'); // get our config file
/**
* Register a new User
*/
router.post('/register', (req, res) => {
con... |
Python | UTF-8 | 453 | 2.953125 | 3 | [] | no_license | class OnMemoryRepository(dict):
def __init__(self, factory, keyfunc, dct={}):
super(OnMemoryRepository, self).__init__()
self.update(dct)
self.factory = factory
self.keyfunc = keyfunc
def get_many(self, keys):
return (value for key, value in self.items() if key in keys)
... |
C++ | UTF-8 | 6,751 | 2.625 | 3 | [] | no_license | #pragma once
#include "allscale/api/user/data/grid.h"
#include "ipic3d/app/vector.h"
#include "ipic3d/app/parameters.h"
#include <map>
namespace ipic3d {
using coordinate_type = allscale::api::user::data::GridPoint<3>;
namespace {
std::string getUseCaseName(const UseCase& useCase) {
switch(useCase) {
c... |
Markdown | UTF-8 | 9,334 | 3.15625 | 3 | [
"MIT"
] | permissive | ---
title: 20200420 알고리즘
date: 2020-04-21 01:04:57
category: algorithm
---
### 1. 실패율
<img src="https://user-images.githubusercontent.com/39187116/79473700-78baed00-8040-11ea-8449-9979047b947b.png" width="500" height="500"/>
슈퍼 게임 개발자 오렐리는 큰 고민에 빠졌다. 그녀가 만든 프랜즈 오천성이 대성공을 거뒀지만, 요즘 신규 사용자의 수가 급감한 것이다. 원인은 신규 사용자와 기존 사... |
PHP | UTF-8 | 360 | 2.515625 | 3 | [] | no_license | <?php
require_once('../db.php');
require_once('../classes/users.classes.php');
/*make sure request is coming from the ID associated with this session (TF)*/
if($_COOKIE['PHPSESSID'] == session_id()){
if ($_POST['get'] == "user" ) {
$userObj = new user($DBH);
return $userObj->getProfileFromID($_POST['ID'... |
C++ | UTF-8 | 3,965 | 3.21875 | 3 | [] | no_license | /*
* Name : lab_7.cpp
* Author : FILL IN
* Description : Working with File I/O
*/
#include <fstream>
#include <iostream>
#include <map>
#include <string>
using std::cout;
using std::ifstream;
using std::endl;
using std::string;
using std::map;
/*
* Open and read the contents of a text file. Each line ... |
JavaScript | UTF-8 | 589 | 2.53125 | 3 | [] | no_license | function tabEvt(el, num){
var num = num || 0;
var menu = $(el).children();
var con = $(el + 'Con').children();
var selectItem = $(menu).eq(num);
var i = num;
selectItem.addClass('active');
con.eq(num).addClass('current');
menu.click(function(){
if(selectItem !== null){
... |
Markdown | UTF-8 | 628 | 3.4375 | 3 | [] | no_license | 
```python
# The guess API is already defined for you.
# @param num, your guess
# @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
# def guess(num):
class Solution(object):
def myguess(self, curr, max):
resp = guess(curr)
print curr
... |
Java | UTF-8 | 700 | 2.21875 | 2 | [
"MIT"
] | permissive | package com.xzymon.persest.model;
public class Store {
private Long id;
private String name;
private String city;
private String street;
private String number;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(... |
C++ | UTF-8 | 483 | 3.875 | 4 | [] | no_license | #include <iostream>
using namespace std;
int Sum(int z){
for(int i = 1; i <= z; i++)
{
cout << "Sum of 1 to " << i << " is " << i*(i+1)/2 << endl;
}
return i;
}
int Product(int y){
for(int n = 1; n <= y; n++){
cout << "product of 1 to " << n << " is " << n*n << endl;
}
return n;
}
int ma... |
Java | UTF-8 | 2,682 | 2.640625 | 3 | [] | no_license | package com.example.myssd.note;
import android.content.Context;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextV... |
Markdown | UTF-8 | 2,052 | 2.953125 | 3 | [] | no_license |
## Movie Feast
An app that uses the [Movies.db API](https://www.themoviedb.org/?language=en) to find the popular movies,Top rated,Now playing and Up coming movies in realtime and inflate the activities with the data of those movies accordingly. <br />
**Things I've Learnt:**
* Working with [Movies API](https://ww... |
Python | UTF-8 | 1,218 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env python3
# No configuration required in here, unless you use Windows (see line 12)
import os
os.chdir('grader')
import grader.config
os.chdir('..')
AssignmentNumber = grader.config.ASSIGNMENT_NUMBER
import sys, platform, subprocess
EDITOR_CMD = os.environ['EDITOR'] if (platform.system() != 'Windows') ... |
Python | UTF-8 | 2,452 | 3.484375 | 3 | [] | no_license | class Board:
def __init__(self, input):
self.arr = [[x for x in l if x != '\n'] for l in input]
def show(self):
return '\n'.join(''.join(x) for x in self.arr)
def neighbors(self, y, x, radius=1):
return [
self.arr[i][j] if 0 <= i < len(self.arr) and 0 <= j < len(self.ar... |
C | UTF-8 | 1,591 | 3.671875 | 4 | [] | no_license | #include "rational_numbers.h"
#include <stdlib.h>
#include <math.h>
static int get_gcd(int a, int b) {
for (int i = abs(a); i >= 1; i--) {
if (a % i == 0 && b % i == 0) {
return i;
}
}
return 1;
}
rational_t reduce(rational_t r) {
if (r.numerator == 0) {
return (rational_t) { 0, 1 };
}
i... |
C++ | UTF-8 | 1,020 | 2.609375 | 3 | [
"MIT"
] | permissive |
#include <ArduinoMessenger.h>
Messenger messenger(Serial);
message m;
byte mes[] = "PUT\n{\"resource\":\"2000 2800 500 1500 100 3000 150 350 350 400 850 2500 2350 2550 600 1300 150 2850 1050 350 750 2700 250 400 950 450 100 2700 250 1900 150 3000 700 \",\"value\":\"38\"};";
//byte mes[] = "GET\n{\"request\":\"get_data... |
Java | UTF-8 | 875 | 3.015625 | 3 | [] | no_license | package com.ditedo.kagenoshinobi.naruto.collision;
import com.ditedo.kagenoshinobi.naruto.Position;
public class CollisionPoint implements Collision {
//ATTRIBUTES
protected Position position;
//CONSTRUCTOR
/** Create a point to test collision */
public CollisionPoint(Position position) {
this.position = posi... |
Java | UTF-8 | 2,636 | 3.03125 | 3 | [] | no_license | package tests;
import java.util.List;
import java.util.Random;
import org.testng.Assert;
import org.testng.annotations.Test;
import model.Design.*;
import model.Helper.MySQLConn;
public class AppointmentTest {
@Test
public void AppointmentTestNew()
{
//1:make new appointment by using a random id
//2:assert... |
Ruby | UTF-8 | 424 | 3.703125 | 4 | [] | no_license | print("年齢を入力してください\n")
age = gets.chomp.to_i
if age < 0 then
print("0以上の値を入力してください.\n")
elsif age >= 0 and age < 20 then
print("未成年です。まだ飲酒できません.\n")
elsif age >=20 and age < 40 then
print("飲酒できますが、飲み過ぎに注意しましょう.\n")
else
print("もうそろそろ飲酒を控えた方がいいですよ.\n")
end
|
PHP | UTF-8 | 809 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Boardy
*
* Simple PHP forum app.
*
* @package boardy
* @author Raphael Marco <pinodex@outlook.ph>
* @link http://pinodex.io
*/
namespace Boardy\Constraints;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
class RecordExistenceValidator exte... |
C++ | UTF-8 | 478 | 2.703125 | 3 | [] | no_license | #include"cajero.h"
int main(){
Cajero *b50 = new Billete50();
Cajero *b20 = new Billete20();
Cajero *b10 = new Billete10();
Cajero *b5 = new Billete5();
// Cajero *b5 = NULL; // el ultimo handler
b50->setNext(b20);
b20->setNext(b10);
b10->setNext(b5);
try{
b50->devuelveBi... |
Java | UTF-8 | 3,255 | 2.03125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Sibilla: a Java framework designed to support analysis of Collective
* Adaptive Systems.
*
* Copyright (C) 2020.
*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
... |
Python | UTF-8 | 2,518 | 3.0625 | 3 | [] | no_license | import regex as re
import markdown_to_text
from wiki import Entry
import reddit_utils
class Link:
"""Helper class to format links"""
def __init__(self, title, url, tooltip):
self.title = title
self.url = url
self.tooltip = tooltip
def __repr__(self):
n = Link.markdown_es... |
JavaScript | UTF-8 | 4,371 | 2.703125 | 3 | [] | no_license | /**
* NPM imports
*/
import React, { Component } from 'react'
import Grid from '@material-ui/core/Grid';
import TextField from '@material-ui/core/TextField';
/**
*
*/
import Buttom from '../components/button'
/**
*
*/
export default class CreateGroup extends Component {
constructor(props) {
super... |
Java | UTF-8 | 885 | 2.390625 | 2 | [] | no_license | package com.example.practice15.controllers;
import com.example.practice15.models.Level;
import com.example.practice15.services.LevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
public class LevelContr... |
PHP | UTF-8 | 385 | 2.734375 | 3 | [] | no_license | <?php
$servername = "localhost:81";
$username = "root";
$password = "";
$myDB="becas";
try {
$conn = new PDO("mysql:host:81=$servername;dbname=$myDB", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
#/echo "Conexión exitosa","<br>";
} catch(PDOException ... |
JavaScript | UTF-8 | 2,923 | 2.515625 | 3 | [] | no_license | import mocha from 'mocha';
import chai from 'chai';
import request from 'request-promise-native';
import sinon from 'sinon';
import { INVALID_COORDINATES } from '../src/geolib/GeolibError';
import checkLatLngInState from '../src/checkLatLngInState';
import mockNY from './mock/github/unitedstates/states/NY.json';
con... |
Markdown | UTF-8 | 7,482 | 3.046875 | 3 | [
"MIT"
] | permissive | ---
layout: project
title: "COCO: The Prototype"
author: kelseydesir
tags: [projects]
img: COCOChapter2WordCloud.png
description: >
---
### What is COCO?
[COCO (Characters of Color Organized)](https://docs.google.com/document/d/146NAXoe0QifXFBgJC-15JtdFAJKszeI_ZsfRRzONclE/edit?usp=sharing) --- the prototype is a data... |
Markdown | UTF-8 | 531 | 2.515625 | 3 | [] | no_license | # CINEMAADDICT
It's a service for fans of big movies. Detailed information about the latest hot movies, the ability to select and create your own list of films for viewing, discussion of movies and much more.
## Used technologies:
* JS (ECMAScript 6)
* ESLint
* Build process (Create React App)
* AJAX (Fetch)
* Used ... |
Python | UTF-8 | 2,939 | 3.609375 | 4 | [
"MIT"
] | permissive | import pygame
class Tile(object):
snake_head = 0
snake_body = 1
snake_bend_left = 2
snake_bend_right = 3
snake_tail = 4
apple = 5
def __init__(self, cell_width, cell_height):
self.filename = "../data/snake.png"
self.columns = 5
self.rows = 4
self.image = py... |
Go | UTF-8 | 1,746 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | package model
import (
"bytes"
"fmt"
"strings"
)
func (s *Service) translatePorts() {
for _, c := range s.Containers {
if c == nil {
// TODO: catch this earlier
continue
}
ports := []string{}
if c.Ports != nil {
for _, p := range c.Ports {
parts := strings.SplitN(p, ":", 4)
if len(parts... |
Java | UTF-8 | 9,531 | 2.671875 | 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 trabalho.poo.wm;
import java.util.ArrayList;
/**
*
* @author wilsonmielke
*/
public interface VendController extends Usefu... |
Java | GB18030 | 5,953 | 2.8125 | 3 | [] | no_license | package editor;
import javax.swing.undo.AbstractUndoableEdit;
import javax.swing.undo.UndoManager;
import javax.swing.undo.UndoableEdit;
/**
* ClipPicӡɾƶij
*/
public class ClipPicUndoManager extends UndoManager {
protected OneFrameDraw spriteManager;
private int used;
public ClipPicUndoManager(OneFrameDraw spri... |
C# | UTF-8 | 2,773 | 2.703125 | 3 | [] | no_license | namespace CompanySampleDataImporter.Importer.Importers
{
using System;
using System.Collections.Generic;
using CompanySampleDataImporter.Importer.Importers.Contracts;
using CompanySampleDataImporter.Data;
using System.IO;
using System.Linq;
public class ManagersImporter : IImporter
{
... |
Java | UTF-8 | 2,643 | 2.359375 | 2 | [] | no_license | package russo.it.newapp;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
public class SplashScreen extends Activity{
Im... |
Java | ISO-8859-1 | 4,717 | 2.15625 | 2 | [] | no_license | package com.cliente.view;
import java.util.Calendar;
import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.DatePickerDialog.OnDateSetListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
imp... |
Python | UTF-8 | 1,954 | 3.4375 | 3 | [] | no_license | #!/usr/bin/env python3
from math import cos, pi
#Retrourne une valeur pseudo aléatoire entre 0 et 1
def noise(var):
var = (var<<13)^var
return (((var * (var * var * 15731 + 789221) + 1376312589) & 0xfffffff) / 2147483648.0)
#Retourne un vecteur représentant une matrice 3D avec tous les bruits
def noise2D(x,y)... |
JavaScript | UTF-8 | 3,457 | 2.8125 | 3 | [] | no_license | /*-----Author:Tejashree Prabhu----References:CS546 Lecture 6 Codebase, CS546 Lecture 10 Codebase,stackoverflow-----*/
const express = require("express");
const router = express.Router();
const data = require("../data");
const moviesData = data.movies;
const commentsData = data.comments;
router.get("/", (req, res) =>... |
Java | UTF-8 | 1,021 | 2.46875 | 2 | [] | no_license | package type;
import input.Input;
import java.awt.Color;
import java.awt.Graphics;
import java.io.Serializable;
public abstract class Flag implements Serializable{
private static final long serialVersionUID = 7414458948479691583L;
/*private List<Flag> internal;
public Flag(){
internal = new ArrayList<Flag>()... |
C# | UTF-8 | 2,208 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ZedGraph;
namespace PlotComPlus.Gui
{
/// <summary>
/// Represents the popup window which contains a graph control
/// that a user can interact (zoom, sav... |
Java | UTF-8 | 621 | 3.4375 | 3 | [] | no_license | package j47_ioadvance;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class BufferReaderDemo {
public static void main(String [] args) throws IOException {
//System.in是inputStream类对象
//BufferedReader构造方法需要接收reader类对象
//InputStreamReader将... |
JavaScript | UTF-8 | 4,565 | 3.03125 | 3 | [
"MIT"
] | permissive | var tagInput=document.getElementById("tag-name");
var addTagButton=document.getElementById("add-tag");
var tagList=document.getElementById("tag-list");
var createNewTag=function(tagvalue){
var listItem=document.createElement("li");
var tagsCount=tagList.childElementCount
console.log('tags count ', tagsCount)
listI... |
C | UTF-8 | 823 | 2.71875 | 3 | [] | no_license | #include<stdio.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<unistd.h>
#include<netinet/in.h>
#include<netinet/ip.h>
struct st{
int op[10];
}v2;
main(int argc,char**argv){
int len,sfd,nsfd,i,j;
struct sockaddr_in v,v1;
sfd=socket(AF_INET,SOCK_STREAM,0);
if(sfd<0){
perror("SOCKET");
return;
}
perro... |
Markdown | UTF-8 | 2,938 | 2.65625 | 3 | [] | no_license | +++
title: "Chinese community must be vigilant to ensure that the Boards of Management furore is not a Barisan ‘smoke-screen’ to hide other provisions detrimental to Chinese education"
date: "1990-05-20"
tags:
+++
_By Parliamentary Opposition Leader, DAP Secretary-General and MP for Tanjung, Lim Kit Siang, in P... |
Markdown | UTF-8 | 7,059 | 2.765625 | 3 | [
"BSD-2-Clause"
] | permissive | # Access
Access to service is granted after Agent receives notification of new channel was created for his offering:
```text
event LogChannelCreated(address indexed _agent, address indexed _client, bytes32 indexed offering_hash, uint192 _deposit)
```
When Client receives same Ethereum event, he knows that he should ... |
C# | UTF-8 | 619 | 2.578125 | 3 | [] | no_license | using BattleShipLibrary.GameInit;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
// Pattern of unit tests:
// Arrange, Act, Assert
namespace BattleShip.Tests
{
public class GameInitTests
{
[Fact]
public void PopulateShotsFired_ShouldReturnGridOfFalseBools()
... |
Shell | UTF-8 | 2,340 | 3.796875 | 4 | [
"BSD-3-Clause",
"MIT"
] | permissive | #!/bin/bash
#
# Copyright(c) 2012-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
# The line below specified that line under it should be used as the test's short description when launching test via run_tests script.
# The text should not be longer than 80 chars - if it is, the script will strip addit... |
C++ | UTF-8 | 1,512 | 3.265625 | 3 | [
"MIT"
] | permissive | #include <fstream>
#include "../Algorithms/knapsack.hpp"
int main() {
std::vector<Product> prodAvailableM1;
std::vector<Product> prodAvailableM2;
int maxAvailableM1;
int sackSizeM1;
int maxAvailableM2;
int sackSizeM2;
int value;
int weight;
std::ifstream file;
// Creates the it... |
Markdown | UTF-8 | 991 | 2.578125 | 3 | [
"MIT"
] | permissive | # Cards test task for SEMrush 😊
Created interface for adding/deleting/editing cards.
### Try it out: https://cards-test-task.firebaseapp.com
### Features
1. User can add cards via modal window 'Add new' button
2. Modal fields are validated
3. Image can be uploaded from PC or drag'n'drop
4. Cards data is kept in local... |
Python | UTF-8 | 271 | 2.78125 | 3 | [] | no_license | n = int(input())
b = []
c = []
for i in map(int, input().split()):
if i % 2 == 0:
b.append(i)
else:
c.append(i)
if len(b) < 2 and len(c) < 2:
print('-1')
else:
b += [-1e18, -1e18]
c += [-1e18, -1e18]
b.sort()
c.sort()
print(max(b[-1] + b[-2], c[-1] + c[-2]))
|
C | UTF-8 | 747 | 4.25 | 4 | [] | no_license | /**
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 * 99.
Find the largest palindrome made from the product of two 3-digit numbers.
**/
#include<stdio.h>
int is_palindromic(unsigned int n);
int main(int argc, char** argv)
{
unsigned in... |
Swift | UTF-8 | 1,954 | 2.71875 | 3 | [
"MIT"
] | permissive | //
// JMExtension+Bundle.swift
// JMEpubReader
//
// Created by JunMing on 2021/3/30.
//
import Foundation
extension Bundle {
/// 当前项目bundle
static var bundle: Bundle {
return Bundle(for: JMBookContrller.self)
}
/// 获取bundle中文件路径
static func path(resource: String, ofType: String) -... |
Python | UTF-8 | 508 | 3.671875 | 4 | [] | no_license | """ Module to calculate prime numbers."""
import sys
def find_nth_prime(n, primes=None):
primes = primes or [2]
test = primes[-1]+1
while len(primes)<n:
for p in primes:
if p**2>test:
primes.append(test)
break
if test%p==0:
break... |
Ruby | UTF-8 | 376 | 3.296875 | 3 | [] | no_license | class Show
def show_board(board)
puts
puts " 1 2 3"
puts " -------------"
puts " A | #{board[0]} | #{board[1]} | #{board[2]} |"
puts " -------------"
puts " B | #{board[3]} | #{board[4]} | #{board[5]} |"
puts " -------------"
puts " C | #{board[6]} | #{board[7]} | #{boar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.