language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 2,274 | 3.0625 | 3 | [
"MIT"
] | permissive | # [Cook — A Modern Build System](https://getcook.org/)
:snowflake: **Development is paused for now but may be resumed in the future.**
:zap: **This software is currently in alpha and not ready for production use.**
:heart: **Contributions to this project are very welcome!**
## Overview
Cook is an extensible, dyna... |
Ruby | UTF-8 | 1,534 | 3.203125 | 3 | [
"MIT"
] | permissive | #
# IRCUtil is a module that contains utility functions for use with the
# rest of Ruby-IRC. There is nothing required of the user to know or
# even use these functions, but they are useful for certain tasks
# regarding IRC connections.
#
module IRCUtil
#
# Matches hostmasks against hosts. Returns t/f on succe... |
Markdown | UTF-8 | 1,559 | 2.75 | 3 | [
"Apache-2.0"
] | permissive |
-----------
# APIResource unversioned
Group | Version | Kind
------------ | ---------- | -----------
Core | unversioned | APIResource
APIResource specifies the name of a resource and whether it is namespaced.
<aside class="notice">
Appears In <a href="#apiresourcelist-unversioned">APIResourceLis... |
Java | UTF-8 | 5,398 | 1.921875 | 2 | [
"Apache-2.0"
] | permissive | package org.mingy.jmud.ui;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FormAttachment;
im... |
JavaScript | UTF-8 | 1,497 | 3.25 | 3 | [
"MIT"
] | permissive | function Solve(input) {
var matrixSize = input[0].split(' ');
var startPositionRandC = input[1].split(' ');
var rows = parseInt(matrixSize[0]);
var cols = parseInt(matrixSize[1]);
var currentRow = parseInt(startPositionRandC[0]);
var currentCol = parseInt(startPositionRandC[1]);
var matr... |
C# | UTF-8 | 2,253 | 2.78125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
using System.Data;
namespace ParcialComputoII.Clases
{
class Account
{
Connection Connection = new Connection();
Crud crud = new Crud();
p... |
Java | UTF-8 | 1,134 | 1.929688 | 2 | [] | no_license | package com.example.masodikp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCre... |
JavaScript | UTF-8 | 3,027 | 2.796875 | 3 | [] | no_license | //Import the required modules.
const Course = require('../models/Course');
var fs = require('fs');
//Load instructor page with the courses.
exports.instructor = async (req, res) => {
const courses = await Course.find().sort({ title: 'asc' });
res.render('instructor', {
title: 'Instructor',
cour... |
TypeScript | UTF-8 | 3,780 | 2.53125 | 3 | [] | no_license | const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
export const firestore = admin.firestore();
const sendPushNotification = function(token:string,title:string,body:string,badge:string) {
const payload = {
notification... |
JavaScript | UTF-8 | 4,827 | 2.53125 | 3 | [] | no_license | /*
* Model.js
*/
'use strict';
const mysql = require('mysql');
const fs = require('fs');
const crypto = require('crypto');
const DBuser = require('./ConnectionInfo')
const connection = mysql.createConnection(DBuser.user);
connection.connect();
// Query sentences definition
// 1. Users
var allUser = 'SELECT * FROM us... |
JavaScript | UTF-8 | 995 | 2.75 | 3 | [] | no_license | import game from './_game';
import Cloud from './_Cloud';
class Sky {
constructor() {
this.mesh = new THREE.Object3D();
this.nClouds = 20;
this.clouds = [];
const stepAngle = (Math.PI * 2) / this.nClouds;
for (let i = 0; i < this.nClouds; i++) {
const cloud = new Cloud();
const angle... |
Python | UTF-8 | 2,615 | 2.953125 | 3 | [] | no_license | # Iman Rezaei
# UniqueProbsTotalCfas.py
# 4/22/16
# Create a CSV file with unique step names and their total CFAs
import numpy as np
import pandas as pd
import csv
# **************************************************************************
# import data file
dataFile = pd.read_csv("traindataFilteredByView20.csv... |
Python | UTF-8 | 301 | 4.0625 | 4 | [] | no_license | #Exercício 4
cat_op = 0.5
cat_adj = 5
tan_theta = (cat_op)/(cat_adj)
print ('A tangente do ângulo zenital vale' , tan_theta , '. Para ângulos pequenos, a tangente pode ser aproximada para o próprio ângulo. Portanto, o ângulo zenital é aproximadamente ' , tan_theta, 'radianos.')
|
Markdown | UTF-8 | 818 | 2.734375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | # DbMan command hierarchy
The command hierarchy is:
- config (manages dbman's configuration)
- show (shows the current configuration)
- delete (deletes a configuration set)
- list (list configuration sets)
- set (set a configuration value in the current configuration)
- use (use a specified config... |
C | UTF-8 | 428 | 2.84375 | 3 | [] | no_license | #include "allergies.h"
#ifdef USE_ALLERGIC_TO_FUNCTION
bool is_allergic_to(const allergen_t all, const uint32_t val)
{
return !!(val & (1 << all));
}
#endif
allergen_list_t get_allergens(uint32_t val)
{
allergen_list_t list = { .count = 0 };
allergen_t i;
for (i=0; i<ALLERGEN_COUNT; ++i) {
li... |
Java | UTF-8 | 213 | 1.882813 | 2 | [] | no_license | package hw20171227;
public class abc1 {
int age;
String name;
char sex;
public abc1(){
}
public abc1(int asd){
}
public abc1(String dsa){
}
}
|
Ruby | UTF-8 | 709 | 2.6875 | 3 | [] | no_license | class Story < ApplicationRecord
STORY_LENGTH = 5
belongs_to :user
has_many :characters
has_many :story_paragraphs
has_many :paragraphs, through: :story_paragraphs
has_many :plots, through: :paragraphs
has_many :genres, through: :plots
def create_content(genre, characters)
paragraphs = (1..STORY_L... |
Java | UTF-8 | 13,641 | 3.015625 | 3 | [] | no_license | package hospital;
import shared.Human;
import java.io.Reader;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
public class Hospital {
CarPark carPark;
Stack<Floor> floors;
private String name;
private int countHospitalGuest = 0;
private String encryptionKeyforCases= "vRMbp7k... |
Ruby | UTF-8 | 622 | 3.6875 | 4 | [] | no_license | def bubble_sort(array)
flag=false
while !flag
flag=true
for i in 0...((array.length) -1)
if array[i]>array[i+1]
array[i],array[i+1]=array[i+1],array[i]
flag=false
end
end
end
return array
end
print bubble_sort([4,3,78,2,0,2])
def bubble_sort_by(array)
flag=false
whi... |
Java | UTF-8 | 2,986 | 1.898438 | 2 | [] | no_license | package hdsec.web.project.secactivity.action;
import hdsec.web.project.activiti.model.ApproveProcess;
import hdsec.web.project.activiti.model.ProcessJob;
import hdsec.web.project.activiti.model.ProcessRecord;
import hdsec.web.project.burn.model.BurnFile;
import hdsec.web.project.common.CCLCMConstants;
import hd... |
Java | UTF-8 | 922 | 2.71875 | 3 | [] | no_license | import org.junit.Assert;
import org.junit.Test;
public class SolutionTest {
@Test
public void testExample1() {
Solution sol = new Solution();
Assert.assertEquals(2, sol.strStr("hello", "ll"));
}
@Test
public void testExample2() {
Solution sol = new Solution();
Asse... |
Python | UTF-8 | 216 | 4.03125 | 4 | [] | no_license |
my_dict = {'1': 1, '2': 2, '3': 2, '4': 2, '5': 5}
for value in my_dict.values():
print(value)
print("-" * 70)
# use a "set" to de-dupe dictionary values
for value in set(my_dict.values()):
print(value)
|
C# | UTF-8 | 1,703 | 3.4375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SearchAlgorithmsLib;
namespace Server
{
/// <summary>
/// Holds a solution and the number of nodes evaluated in it's search.
/// </summary>
/// <typeparam name="T">Type of state th... |
C | UTF-8 | 1,397 | 3.140625 | 3 | [
"MIT"
] | permissive | typedef Process Data;
typedef struct PriorityQueue
{
int capacity;
int size;
Data* arr;
}PriorityQueue;
typedef PriorityQueue* PQueue;
int isFull(PQueue Q)
{
return Q -> size == Q -> capacity;
}
int isEmpty(PQueue Q)
{
return Q -> size == 0;
}
PQueue createPQueue(const int maxsize)
{
... |
Swift | UTF-8 | 2,544 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// LoginTextField.swift
// ProofOfConcept
//
// Created by Stephen Vickers on 2/8/17.
// Copyright © 2017 Stephen Vickers. All rights reserved.
//
import UIKit
@IBDesignable
class UILoginTextField: UITextField {
@IBInspectable var leftImage : UIImage? {
didSet{
self.updateView()
... |
JavaScript | UTF-8 | 493 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
* This is not a Array Library,
* (this is just a tribute)
*
* This is just a set of helpers, to make code easier to maintain.
*
* D. Rimron <darran@xalior.com>
*/
if (djsex) {
if (djsex.math) {
djsex.array = {
randomIndex: function(arr) {
return djsex.math.randomint(0... |
Java | UTF-8 | 1,259 | 3.765625 | 4 | [] | no_license | package com.company.multithreading.exp1;
/*
19. public void interrupt()
This method of a thread is used to interrupt the currently executing thread. This method can only be called when
the thread is in sleeping or waiting state.
But if the thread is not in the sleeping or waiting state, then the... |
Java | UTF-8 | 2,860 | 2.28125 | 2 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | /*******************************************************************************
* Copyright (c) 2004, 2010 IBM Corporation.
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.a11y.utils.accprobe.accservice.... |
C# | UTF-8 | 976 | 2.5625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
namespace SecurityProj2.Models
{
public class PasswordKey
{
[Key]
public Guid PasswordId { get; set; }
public string UserName { g... |
Markdown | UTF-8 | 14,587 | 3.546875 | 4 | [
"Apache-2.0"
] | permissive | # The SDP Development Process
In SDP, you will use a **GitHub repository** as your navigation panel for the semester: issues, project board, and code.
The repository will allow you to track your progress and to communicate with your team and with the SDP staff.
This document will teach you how to manage your team's G... |
C++ | UTF-8 | 402 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
char a[50];
cin >> a;
int i=0;
if(a[i] == 9){
i++;
}
//iterate over remaining numbers
for ( ; a[i]!='\0';i++){
int digit = a[i] - '0'; // to convert ascii to integer
if(digit >= 5){
digit = 9-digit ;
... |
C++ | UTF-8 | 650 | 2.734375 | 3 | [] | no_license | /*
* CS585
*
* Team Bammm
* Alvaro Home
* Matt Konstantinou
* Michael Abramo
* Matt Witkowski
* Bradley Crusco
* Description:
* IWeaponType header file.
*
*/
#ifndef IWEAPONTYPE_H_
#define IWEAPONTYPE_H_
#include "../Weapons/WeaponData.h"
namespace bammm
{
class Actor;
class IWeaponType
{
prote... |
Python | UTF-8 | 358 | 3.578125 | 4 | [] | no_license | def outer(func):
cached = {}
def inner(x):
if x in cached:
return cached[x]
result = func(x)
cached[x] = result
return result
return inner
@outer
def calculate_something(x):
print("calculate_something(" + str(x) +")")
return x * x
print(calculate_somet... |
Markdown | UTF-8 | 1,077 | 4.03125 | 4 | [] | no_license | ### JavaScript uses prototype inheritance
In JavaScript, a sub-class inherite it's parent properties and methods through "prototype".
Every JS instance has a "\_\_proto\_\_" which pointing to it's parent prototype. For example, every
array instance pointing to Array.prototype.
const arr = [1, 2, 3]
> arr
... |
Python | UTF-8 | 1,700 | 3.765625 | 4 | [] | no_license | #the below code is for multiple groupings or mixed pairs
def test_groupings(li, _map={'(': ')', '[': ']', '{': '}'}):
stack = []
for el in li:
if el in _map:
# opening element, add to stack to look for matching close
stack.append(el)
elif not stack or _map[stack[-1]] != el:
# not an opening element; is ... |
Shell | UTF-8 | 1,416 | 3.46875 | 3 | [
"MIT"
] | permissive | #!/bin/bash
parallelism=4
while getopts j: flag
do
case "${flag}" in
j) parArg=${OPTARG};;
esac
done
if [ "$parArg" -eq "$parArg" ] 2>/dev/null
then
parallelism=$parArg
fi
echo -e "\033[1m* Building math libraries \033[0m"
make -s clean
make -s
echo -e "\033[1m\tBuilding done \033[0m"
echo -e "\... |
Java | UTF-8 | 38,241 | 2.015625 | 2 | [
"MIT"
] | permissive | /****************************************************************************
* Copyright (c) 2012-2015 Zachary L. Stauber
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without ... |
C | UTF-8 | 943 | 3.359375 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) 2017, Billie Soong <nonkr@hotmail.com>
* All rights reserved.
*
* This file is under MIT, see LICENSE for details.
*
* Author: Billie Soong <nonkr@hotmail.com>
* Datetime: 2018/1/22 15:45
*
*/
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <unistd.h>
int main()
{
// 使用... |
JavaScript | UTF-8 | 261 | 2.6875 | 3 | [] | no_license | const validatePassoword = (passoword) => {
const passwordRegex = /^[0-9]*$/;
(passoword < 4 || passoword > 8 || password.match(passwordRegex) === false)
? { status: 400, message: "Incorrect password" }
: 'OK';
};
module.exports = validatePassoword;
|
Python | UTF-8 | 1,304 | 2.734375 | 3 | [] | no_license | #Google kickstart 2020 round a "Plates"
cases = 0
testcases = int(input())
while cases != testcases:
suma2=0
spb2=[]
spb=[]
cases += 1
var=1
variables = input().split()
array=[]
stacknum=(variables[0])
stacknum=int(stacknum)
platenum=(variables[1])
plateswante... |
PHP | UTF-8 | 1,013 | 2.703125 | 3 | [] | no_license | <?php
function getFromUrl($url, $method = 'GET')
{
$ch = curl_init();
$agent = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)';
switch(strtoupper($method))
{
case 'GET':
curl_setopt($ch, CURLOPT_URL, $url);
break;
case 'POST':
... |
Python | UTF-8 | 7,208 | 2.734375 | 3 | [
"MIT"
] | permissive | from collections import Counter
from operator import itemgetter
from collections import OrderedDict
from random import choice, shuffle
from tqdm import tqdm
import itertools
import torch
import torch.utils.data as data
import torch.nn.functional as fn
from torch.utils.data import DataLoader, Dataset
from torch.utils.d... |
C++ | UTF-8 | 1,747 | 3.140625 | 3 | [
"MIT"
] | permissive | #include "../../include/Utils/MCString.hpp"
#include <cstring>
using namespace Utils;
MCString::MCString() : m_stringLength(0)
{
InitializeFromString("");
}
MCString::MCString(const std::string& str)
{
InitializeFromString(str);
}
// Copy constructor
MCString::MCString(const MCString& str)
{
... |
C++ | UTF-8 | 1,473 | 3.296875 | 3 | [] | no_license | #include "piece.hh"
#include <stdio.h>
const char* Piece::pieceNames[] = { "Pawn", "Rook", "Bishop", "Knight", "Queen", "King" };
const char* Piece::colorNames[] = { "white", "black" };
Piece::Piece(Board* board, ePieceColor color, ePieceType type) :
board(board),
color(color),
type(type),
field(NULL),
mov... |
Python | UTF-8 | 1,336 | 3.203125 | 3 | [] | no_license | with open('file16.in') as f:
content = f.readlines()
content = [x.strip() for x in content]
content = content[0].split(',')
dance = "abcdefghijklmnop"
def flipdance(first, second, dance):
if first < second:
temp = first
first = second
second = temp
return dance[:second] + dance[fir... |
C++ | UTF-8 | 8,037 | 3.109375 | 3 | [] | no_license | #include <cmath>
#include <exception>
#include <fstream>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include "mathio.hpp"
// Exception para Falha de Abertura de arquivo
class bad_arquivo : public std::exception {
public:
const char* what() const noexcept {return "Erro ao abrir arquivo\n"... |
JavaScript | UTF-8 | 507 | 4.09375 | 4 | [] | no_license | //!What is logged out?
var arr1 = [];
var arr2 = new Array(50);
var arr3 = new Array(1, 2, "three", 4, "five");
var arr4 = new Array([1, 2, 3, 4, 5]);
console.log('arr1: ', arr1); // []
console.log('arr2: ', arr2); // [<50 empty items>] array of length 50, but every element in the array is empty. That is how the ar... |
C# | UTF-8 | 21,400 | 2.765625 | 3 | [] | no_license | using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using TouhouCardEngine;
using TouhouCardEngine.Interfaces;
namespace TouhouHeartstone
{
public static class THHCard
{
public static THHPlayer getOwner(this Card card)
{
return card.owner as THHPlayer;... |
Python | UTF-8 | 2,193 | 2.734375 | 3 | [] | no_license | import easygui as g
import urllib.request
import urllib.error
import re
from urllib import parse
import socket
from bs4 import BeautifulSoup
import cloudscraper
titles = "快来搜搜 V1.2\t 作者:Henry Xue\t 邮箱:kidfullystar@gmail.com"
def open_url(url):
scraper = cloudscraper.create_scraper()
resp = sc... |
Java | UTF-8 | 1,776 | 3.203125 | 3 | [] | no_license | package hotel;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
public class Room {
private String name;
private int capacity;
private ObservableList<Event> events;
pub... |
Python | UTF-8 | 2,105 | 3.234375 | 3 | [] | no_license | from collections import deque
class MaxQueue:
def __init__(self):
self.p = list()
self.q = list()
pass
def __len__(self):
return len(self.p) + len(self.q)
def __add__(self, other):
return self.enqueue(other)
def enqueue(self, other):
min_val = other if... |
Java | ISO-8859-1 | 5,690 | 2.25 | 2 | [] | no_license | package com.example.domotique;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;
import com.example.utils.JSONParser;
import com.example.utils.User;
import android.app.Activity;
import andro... |
C# | UTF-8 | 1,235 | 2.6875 | 3 | [
"MIT"
] | permissive | using System.Text;
using System.Xml.Linq;
namespace PListFormatter
{
public class PListDataElement : PListElement
{
public PListDataElement(string key, object value)
: base(key, "data", value)
{ }
public PListDataElement(object value)
{
this.value = val... |
Markdown | UTF-8 | 1,043 | 2.6875 | 3 | [
"MIT"
] | permissive | # @nearform/trail-hapi-plugin
[![npm][npm-badge]][npm-url]
trail-hapi-plugin is a plugin to add the trail REST API to a [Hapi][hapi] server.
## Install
To install via npm:
```
npm install @nearform/trail-hapi-plugin
```
## Usage
```javascript
const main = async function() {
const server = require('hapi').Serve... |
JavaScript | UTF-8 | 2,536 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { Form, FormGroup, Input, Row, Col} from 'reactstrap';
import PregnancyvitalsBloodsugar from './AddBloodsugar';
import PregnancyvitalsThroid from './AddThyroid'
import PregnancyvitalsBloodpressure from './AddBloodpresssure'
// const desease = ["thyroid", "bloodPressure", "bloodSugar... |
JavaScript | UTF-8 | 383 | 3.125 | 3 | [] | no_license | "use strict";
const salary = 7500;
const friendSalaries = [7500, 12300, 17200, 9400, 8400];
const friends = ['sakib', 'tamim', 'musfiq', 'nokib'];
// friendSalaries[0] = 10500;
// friendSalaries.push(10700);
friends.push('akib');
friends[2] = ('akib');
// friends.push(34000);
let max = 0;
for (const salary of friendSal... |
Markdown | UTF-8 | 767 | 2.53125 | 3 | [] | no_license | ---
title : Week 2 of Art-A-Hack 2015
image : /images/og/2015-week-2.jpg
---
The pressure was on for our second week as teams delved into their individual and group projects together.
<figure class="video">
<iframe src="https://www.flickr.com/photos/125924023@N07/19059208352/in/set-72157654525286918/player/" allowful... |
Python | UTF-8 | 4,945 | 2.6875 | 3 | [] | no_license | import urllib3
import json
import traceback
import os
'''
原始URL
http://www.nmgtj.gov.cn/acmrdatashownmgpub/tablequery.htm?
m=QueryData&code=OA0C&wds=[{"wdcode":"reg","valuecode":"150000"},{"wdcode":"sj","valuecode":"201804"}]&fvrt_code=
'''
#通过控制,data_name,code,time 三个参数获取内蒙古地区的数据
def get_data(data_name,code,date_li... |
Java | UTF-8 | 1,768 | 1.71875 | 2 | [] | no_license | /*
* Copyright (C) 2010 eXo Platform SAS.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software i... |
C++ | UTF-8 | 380 | 2.875 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "MemCalculator.h"
// Factory
static MemCalculator MakeCalc()
{
return MemCalculator();
}
TEST( Sum, DefualtReturnZero )
{
MemCalculator calc;
int lastSum = calc.doSum();
EXPECT_EQ( 0, lastSum );
}
TEST( Sum, AddReturnChange )
{
MemCalculator calc = MakeCalc();
calc.doAdd( 1 )... |
C++ | UTF-8 | 855 | 2.953125 | 3 | [] | no_license | #include <avr/delay.h>
#include "AVRPortPin.h"
#define TRUE ((uint8_t)1)
#define FALSE ((uint8_t)0)
AVRPortPin::AVRPortPin(volatile uint8_t *ddr, volatile uint8_t *port, volatile uint8_t *inPort, uint8_t pin)
:_ddr(ddr),_port(port),_inPort(inPort), _pinMask(_BV(pin)), _pin(pin) {
}
AVRPortPin::~AVRPortPin(){
}
vo... |
C++ | UTF-8 | 3,063 | 2.78125 | 3 | [] | no_license | #pragma once
#include <type_traits>
#include "Array.h"
#include "GameObject.h"
#include "Logger.h"
#include "SceneComponent.h"
namespace Noble
{
typedef MemoryArena<BlockAllocator, DefaultTracking> GameMemoryArena;
class Controller;
/**
* The World class encompasses a "map" or area of play.
* Worlds hold al... |
Swift | UTF-8 | 981 | 2.984375 | 3 | [] | no_license | //
// ViewController.swift
// Destini-iOS13
//
// Created by Angela Yu on 08/08/2019.
// Copyright © 2019 The App Brewery. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var storyLabel: UILabel!
@IBOutlet weak var choice1Button: UIButton!
@IBOutlet w... |
PHP | UTF-8 | 3,231 | 2.75 | 3 | [] | no_license | <?php
namespace Fruitware\GabrielApi\Model;
interface SearchInterface
{
const LANG_RU = 'ru';
const LANG_RO = 'ro';
const LANG_EN = 'en';
const TYPE_ONE_WAY = 'oneway';
const TYPE_ROUND_TRIP = 'roundtrip';
const MAX_PASSENGERS_NUMBER = 9;
/**
* Set language ru|en|ro
*
* @... |
Shell | UTF-8 | 679 | 3.421875 | 3 | [
"MIT"
] | permissive | #!/bin/bash
# disableGuestAccount.sh
# disable the macOS guest account
# Last Edited: 6/19/18 Julian Thies
if [ "$(whoami)" != "root" ] ; then
echo "This script must be run as root or with sudo privileges"
exit
else
if [ -e "/Users/Guest" ] ; then
# use dscl to delete the account
dscl . -delete /Users/Guest
#... |
Java | UTF-8 | 454 | 2.25 | 2 | [] | no_license | import Domain.PersonValidator;
import Repository.PersonRepository;
import Service.PersonService;
import UI.Console;
public class Main {
public static void main(String[] args) {
PersonValidator validator= new PersonValidator();
PersonRepository repository = new PersonRepository(validator);
... |
Python | UTF-8 | 599 | 3.015625 | 3 | [] | no_license | import re
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
def validate_phone_number(phone_number):
phone_number = phone_number.strip()
if re.search('^[^0-9+-/]{17}$', phone_number):
raise ValidationError(
_('Phone numbe... |
JavaScript | UTF-8 | 1,234 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | /**
* ------------------------------------------------- CATALOG TEST -------------------------------------------
*
*/
function TestWindow() {
var win = Ti.UI.createWindow({
title : 'Prueba SCROLLVIEW',
backgroundColor : 'white'
});
var scrollView = Ti.UI.createScrollView({
cont... |
Markdown | UTF-8 | 1,393 | 2.546875 | 3 | [
"MIT"
] | permissive | ---
page_type: sample
languages:
- csharp
products:
- azure
- azure-hdinsight
name: Azure HDInsight SDK for .NET Samples
urlFragment: azure-hdinsight-sdk-for-dotnet-samples
description: "This repo provides samples for the Azure HDInsight SDK for .NET."
---
# Azure HDInsight SDK for .NET Samples
Th... |
Python | UTF-8 | 2,040 | 3.453125 | 3 | [
"MIT"
] | permissive | from dataclasses import dataclass,field
import csv
from typing import List
@dataclass
class Product:
name: str
price: float =0.0
@dataclass
class ProductStock:
product: Product
quantity: int
@dataclass
class Shop:
cash: float =0.0
stock: List[ProductStock] = field(default_factory=list)
@data... |
Python | UTF-8 | 1,210 | 2.5625 | 3 | [] | no_license | import numpy as np
import time
from copy import copy
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import JointState
from control_interfaces.msg import PositionCommand
class SimpleControllerNode(Node):
def __init__(self):
super().__init__('simple_robot_controller')
self._pub = sel... |
Java | UTF-8 | 1,330 | 3.53125 | 4 | [
"MIT"
] | permissive | package boj11650;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public class Main {
static class Coordinate implements Comparable<Coordinate> {
int x, y;
pu... |
Python | UTF-8 | 552 | 2.6875 | 3 | [] | no_license | """
This class is used for the SSA version of slithIR
It is similar to the non-SSA version of slithIR
as the TemporaryVariable are in SSA form in both version
"""
from fortress.slithir.variables.temporary import TemporaryVariable
class TemporaryVariableSSA(TemporaryVariable): # pylint: disable=too-few-pu... |
Python | UTF-8 | 3,110 | 3.125 | 3 | [] | no_license | from ClasePersona import Persona
from ClaseInscripcion import Inscripcion
import numpy as np
from ClaseTallerCapacitacion import TallerCapacitacion
import csv
#talleres = np.empty(3, dtype=TallerCapacitacion)
#print(puntos)
class ManejadorTalleres:
__talleres=None
__i=0
def __init__(self,dim... |
Python | UTF-8 | 1,193 | 3.359375 | 3 | [] | no_license | #
# @lc app=leetcode.cn id=13 lang=python3
#
# [13] 罗马数字转整数
#
# @lc code=start
class Solution:
def romanToInt(self, s: str) -> int:
d = {'I': 1, 'IV': -1, 'V': 5, 'IX': -1,
'X': 10, 'XL': -10, 'L': 50, 'XC': -10,
'C': 100, 'CD': -100, 'D': 500, 'CM': -100,
'M': 1000}
... |
Java | UTF-8 | 25,656 | 1.875 | 2 | [] | no_license | package priv.starfish.mall.manager.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import priv.starfish.common.annotation.Remark;
import priv.starfish.common.model.*;
import priv.starfish.common.model.Result.Type;
import priv.starfish.common.user.UserCont... |
Java | UTF-8 | 912 | 3.125 | 3 | [] | no_license | package by.dev.gui.core.struct;
public class Rect {
private int left;
private int top;
private int width;
private int height;
public Rect(int left, int top, int width, int height) {
this.left = left;
this.top = top;
this.width = width;
this.height = height;
}
public Rect(Rect rect) {
this.left =... |
Java | UTF-8 | 16,653 | 2.421875 | 2 | [] | no_license | /*
*
* Copyright (c) 2007, Sun Microsystems, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, ... |
C# | UTF-8 | 6,577 | 3.25 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using static T297_Hard_Tree_Design.Codec;
using System.Linq;
using System.Text;
namespace T297_Hard_Tree_Design
{
class Program
{
static void Main(string[] args)
{
Codec c = new Codec();
TreeNode root = new TreeNode(1);
... |
JavaScript | UTF-8 | 1,647 | 2.734375 | 3 | [] | no_license | //useful for debug until I have a real redirect coming in to read from.
var fakeParams = {
"identifierType" : "Gene",
"identifiers" : ["pparg", "GATA1", "AVP"],
"organism" : "H. sapiens"
}
//let's make the list of mines globally accessible
var mines;
//get all InterMines as soon as the DOM has loaded
document.a... |
Java | UTF-8 | 1,275 | 3.34375 | 3 | [] | no_license | package Day6;
public class Car {
int releaseYear;
String color;
String model;
public void setReleaseYear(int userReleaseYear){
if(userReleaseYear < 1900) {
System.out.println("Вы указали не верный год выпуска. Человечество еще не изобрело автомобиль");
} else {
... |
PHP | UTF-8 | 707 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Create_cars_table extends CI_Migration {
public function up() {
$this->dbforge->add_field('id');
$fields = array(
'name' => array(
'type' => 'VARCHAR',
'constraint' => '100',
),
'userId' => array(
'type... |
Markdown | UTF-8 | 1,948 | 2.71875 | 3 | [] | no_license | # WideBox
Design and implementation of a distributed and resilient very-large scale interactive system
## RMI Instructions for the labs
The servers MUST have the `-Djava.rmi.server.hostname=<public-ip-of-the-server>` property set AND the rmiregistry should be started previously (and thus, port 1099 should not be used,... |
C# | UTF-8 | 528 | 2.859375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
namespace ReadingBooties
{
class Program
{
static void Main(string[] args)
{
StreamReader sr = new StreamReader(@"C:\bootie.txt");
... |
Python | UTF-8 | 11,800 | 3.328125 | 3 | [] | no_license | # imports
import numpy as np
from proj1_helpers import *
##################################################################################
################################ Least Square GD ###############################
##################################################################################
def least_squ... |
Java | UTF-8 | 2,425 | 2.296875 | 2 | [] | no_license | package com.reviewdekho.like.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import or... |
Java | UTF-8 | 1,717 | 3.375 | 3 | [] | no_license | package generator;
import java.util.Random;
import java.util.UUID;
/**
* Created by iciuta on 7/7/2016.
*/
public class PasswordMaker {
private final int MAGIC_NUMBER = 7;
private final String MAGIC_STRING = UUID.randomUUID().toString(); /*UUID's are 32 chars. long*/
private String firstName, lastName;... |
Python | UTF-8 | 500 | 2.5625 | 3 | [] | no_license | import mysql.connector
conexion1=mysql.connector.connect(host="localhost",
user="root",
passwd="",
database="bd1")
cursor1=conexion1.cursor()
sql="insert into articulos(descripcion, precio) values (%s,%s)"
datos=("... |
Markdown | UTF-8 | 2,616 | 3.5 | 4 | [
"MIT"
] | permissive | ## 协议
计算机使用了非常多协议,大家接触得比较多的是HTTP, TCP/IP, FTP等,那么到底什么是协议呢?计算机中的协议和我们现实生活中签的协议其实挺像,双方都按照协议上的条约发送,接受数据。举个例子,你和你的朋友通过短信约定明天吃饭的时间地点。日常生活的话信息内容可以是
> 明天下午5点在我家等
或者
> 明天在我家等吧,下午5点
这两个信息大家都能理解,不过计算机就像强迫症的人一样,它们会先从一些流行的协议中找一个然后双方遵守,例如协议A
> 这条信息必须由两行组成,第一行是时间,时间必须是24小时制,第二行是地点,地点必须是我家,你家两个中的其中一个。
这样发出来的信息就会是:
明天17点
我家
... |
Java | UTF-8 | 2,565 | 2.890625 | 3 | [] | no_license | package com.github.gilz688.rccarserver.background;
import android.util.Log;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/*
* Handles requests ... |
Java | UTF-8 | 915 | 3.359375 | 3 | [] | no_license | package day15;
public class Exam1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Rect r = new Rect();
r.width = 10;
r.height = 5;
r.canterX = 0;
r.canterY = 0;
r.print();
System.out.println("-------------------");
r.move(5, 5);
r.print();
System.out.print... |
Shell | UTF-8 | 362 | 2.53125 | 3 | [] | no_license | #!/bin/bash
./gradlew clean build
docker build -t openservice/authentication-service:latest .
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_REPO_SLUG}" = "InteractiveLecture/authentication-service" ] ; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" -e="$DOCKER_EMAIL"
docker push openservi... |
Go | UTF-8 | 518 | 3.59375 | 4 | [] | no_license | /*
Buatlah program untuk membalikkan "semua kata-kata" (bukan huruf) yang terdapat dalam suatu kalimat.
Contoh:
# Input
makan nasi goreng
# Output
goreng nasi makan
*/
package main
import (
"fmt"
"strings"
)
func main() {
input := "makan nasi goreng"
fmt.Println(reverse(input))
}
func reverse(input string) ... |
Python | UTF-8 | 2,789 | 3.1875 | 3 | [
"MIT"
] | permissive | import unittest
class Score0_0():
def serverWin(self):
return Score15_0()
def receiverWin(self):
return Score0_15()
class Score15_0():
def serverWin(self):
return Score30_0()
class Score0_15():
def receiverWin(self):
return Score0_30()
class Score30_0():
def serve... |
JavaScript | UTF-8 | 1,324 | 3.09375 | 3 | [] | no_license | var area = require('./area.js');
// Valid test
test('Valid test - getArea([3, 4])', () => {
expect(area([3, 4])).toBe(12);
});
// Boundary test
test('Boundary test 1 - getArea([-1, 4])', () => {
expect(area([-1, 4])).toBe(-1);
});
test('Boundary test 2 - getArea([0, 4])', () => {
expect(area([0, 4])).toBe(0);
});... |
Python | UTF-8 | 251 | 3.3125 | 3 | [] | no_license | N = int(input())
def is_prime(n):
if n == 1:
return False
for i in range(2,int(n**0.5)+1):
if n % i == 0:
return False
return True
p = []
for i in range(2, 55555+1):
if is_prime(i) and i % 5 == 1:
p.append(i)
print(*p[:N]) |
Java | UTF-8 | 3,056 | 2.5625 | 3 | [] | no_license | package Manage;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Timestamp;
import java.text.ParseException;
import java.util.Date;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletR... |
PHP | UTF-8 | 418 | 2.65625 | 3 | [] | no_license | <?php
/**
* Session
*/
class Session
{
public function check($url){
if(!isset($_SESSION['quiz'])){
$_SESSION['quiz']['atual'] = 'inicio';
}
$session = $_SESSION['quiz'];
if($url !== $session['atual'] && $url !== 'error'){
$_SESSION['msg'] = 'Por favor, continue de onde vo... |
C++ | UTF-8 | 619 | 2.546875 | 3 | [] | no_license | #pragma once
#include "Collider.h"
class CPointCollider : public CCollider
{
friend class CCollider;
public:
CPointCollider() { myType = CCollider::EColliderType::Point; };
virtual bool IsColliding(const CCollider& aCollider) const override { return aCollider.IsColliding(*this); }
virtual bool IsCol... |
Java | UTF-8 | 3,353 | 1.773438 | 2 | [] | no_license | package com.wdq.micorestore.grocery;
import android.content.Context;
import android.content.Intent;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.