language
stringclasses
15 values
src_encoding
stringclasses
34 values
length_bytes
int64
6
7.85M
score
float64
1.5
5.69
int_score
int64
2
5
detected_licenses
listlengths
0
160
license_type
stringclasses
2 values
text
stringlengths
9
7.85M
Python
UTF-8
2,079
4.34375
4
[ "Giftware" ]
permissive
# Problem Set 4A # Name: <your name here> # Collaborators: # Time Spent: x:xx def get_permutations(sequence): ''' Enumerate all permutations of a given string sequence (string): an arbitrary string to permute. Assume that it is a non-empty string. You MUST use recursion for this par...
Swift
UTF-8
3,274
2.6875
3
[]
no_license
// // collect.swift // TestProject // // Created by Anysa Manhas on 2018-10-24. // Copyright © 2018 Anysa Manhas. All rights reserved. import Foundation import CoreMotion class DataRun { let motionManager : CMMotionManager fileprivate var rot_rate : [(Double, Double, Double)] = [] fileprivate var...
Python
UTF-8
166
2.96875
3
[]
no_license
# -*- coding: utf-8 -*- n=int(input('n:')) soma=0 for i in range(1,n+1,1): idade=int(input('idade:')) soma=soma+idade media=soam/n print('%.2f' % media)
C#
UTF-8
1,056
3.546875
4
[]
no_license
using System; using System.Linq; namespace QuestionOne { class Program { public static Func<int, bool> isEven = (i) => i % 2 == 0; public static Func<int[], int> howManyEvens = (l) => l.Count(i => i % 2 == 0); static void Main(string[] args) { int[] arr = new int[] { 1,2...
Java
UTF-8
3,211
2.28125
2
[]
no_license
package com.isp.controller; import com.isp.entity.License; import com.isp.entity.School; import com.isp.service.SchoolsService; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import or...
Markdown
UTF-8
1,371
3.84375
4
[]
no_license
An integer N is given, representing the area of some rectangle. The area of a rectangle whose sides are of length A and B is A * B, and the perimeter is 2 * (A + B). The goal is to find the minimal perimeter of any rectangle whose area equals N. The sides of this rectangle should be only integers. For example, given...
Java
UTF-8
6,431
1.703125
2
[ "Apache-2.0" ]
permissive
/* * 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 agreed to in writing, software * distributed u...
JavaScript
UTF-8
778
3.203125
3
[ "MIT" ]
permissive
SessionVar = function(key, initialValue){ if (! (this instanceof SessionVar)) // called without `new` return new SessionVar(key, initialValue); this.key = key; // check if already defined if( SessionVar.keys.indexOf(key) !== -1 ) console.warn('SessionVar(' + key + ') defined twice!...
Java
UTF-8
3,199
1.882813
2
[]
no_license
package br.com.j4business.saga.fornecedorcontrato.repository; import java.util.List; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; imp...
Java
UTF-8
348
3.03125
3
[]
no_license
package com.maurofokker.design.patterns.creational.abstractfactory.products; /** * Concrete Product */ public class CaliforniaOilSauce implements Sauce { public CaliforniaOilSauce() { prepareSauce(); } @Override public void prepareSauce() { System.out.println("Preparing california o...
Java
UTF-8
1,516
2.3125
2
[]
no_license
/* * Copyright 2015 the original author or authors. * * 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 applica...
Java
UTF-8
343
1.867188
2
[]
no_license
package com.lz.mapper; import com.lz.entity.Product; import org.apache.ibatis.annotations.Param; import java.util.List; public interface CartMapper { List<Product> list(int uid); void add(@Param("uid") int uid,@Param("pid") int pid, @Param("quantity") int quantity); void delete (@Param("uid") int uid,@Pa...
Shell
ISO-8859-4
17,223
3.46875
3
[]
no_license
############################## # PsyTools # # # # Copyright 2006-2008 Psyjo # ############################## # # Parts by Gentoo Foundation # # Distributed under the terms of the GNU General Public License v2 #:begin_version #Version 1.2.9 #:end_version #!begin_version #Vers...
Ruby
UTF-8
2,239
2.90625
3
[ "MIT" ]
permissive
require 'socket' require 'cloudbridge' module CloudBridge # This class emulates the behaviour of TCPServer, but 'listens' on a cloudbridge # server rather than a local interface. Otherwise attempts to have an identical # interface to TCPServer. At least as far as mongrel uses it. class Server def initialize(cl...
C
ISO-8859-1
15,199
3.09375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "utn.h" #include "menu.h" #include "empleados.h" #define LIBRE 0 #define OCUPADO 1 void initEmpleados(eEmpleado lista[], int limite) { int i; for(i = 0 ; i < limite ; i++) { lista[i].isEmpt...
C++
UTF-8
468
3.09375
3
[]
no_license
#ifndef LINK_H #define LINK_H #include <cstddef> class Link { public: Link() = default; Link(const std::size_t firstVertex, const std::size_t secondVertex); Link(const Link &link) = default; ~Link() = default; std::size_t getFirst() const; std::size_t getSecond() const; void setFirst(co...
Python
UTF-8
2,105
3.34375
3
[]
no_license
def is_integer(n): try: float(n) except ValueError: return False else: return float(n).is_integer() def extract_colours(bag_list): extracted = {} for lst in bag_list: lst = lst.split(' ') i = 0 colour = "" main_colour = "" num = 0 ...
Python
UTF-8
11,904
2.921875
3
[]
no_license
#from odlib import * import numpy as np import math obs1 = 1 #ENTER WHICH OBSERVATIONS YOU WANT TO USE HERE -- USE LINE NUMBERS ON LakhaniInput.txt FILE, NOT INDEX IN ARRAY obs2 = 2 obs3 = 3 num_root = 1 #ENTER NUMBER OF ROOT YOU WISH TO USE HERE (first, second, third, etc.) def magnitude(vector): return (vector...
Java
UTF-8
1,993
2.953125
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 colabancariadelasuerte; /** * * @author ederj */ public class Cola { Nodo inicio=null; Nodo fin=null; ...
C++
UTF-8
341
3.703125
4
[]
no_license
#include<iostream> using namespace std; int sum_n(int num, int sum=0) //tail recursion. { if (num==0) return sum; return sum_n(num-1, sum+num); } int sums(int num) { if (num==0) return 0; return (num + sums(num-1)); } int main() { cout<<sum_n(10)<<endl; // shows sum of first 10 terms from 1 to 10. cout<<s...
Swift
UTF-8
1,744
2.765625
3
[]
no_license
// // DeviceSelectItemViewModel.swift // rxswiftExampleApp // // Created by Serhiy on 2/15/18. // Copyright © 2018 Serhiy. All rights reserved. // import Foundation import RxSwift protocol DeviceSelectItemViewModelType { var id: Int { get } var description: String { get } var isChecked: Bool { get } }...
Java
UTF-8
1,907
3.1875
3
[]
no_license
package controller; import cs3500.animator.view.IView; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Timer; import model.IAnimatorModel; /** * Represents the controller of the interactive animation. It also implements the ActionListener in * order to register button cli...
Swift
UTF-8
1,372
2.765625
3
[ "Apache-2.0" ]
permissive
// // CreatedManager.swift // awesome_notifications // // Created by Rafael Setragni on 15/09/20. // import Foundation public class CreatedManager { static let shared:SharedManager = SharedManager(tag: Definitions.SHARED_CREATED) public static func removeCreated(id:Int) -> Bool { return s...
Python
UTF-8
2,006
4.0625
4
[]
no_license
""" # Evolutionary Computation HW #06 # Binary tournament selection experiment - Student ID: 7110064490 - Name: Huang Sin-Cyuan(黃新荃) - Email: dec880126@icloud.com """ from random import Random import matplotlib.pyplot as plt # A few useful constants # pop_size = 20 generations = 10 fit_range = 40 # Init the ran...
Java
UTF-8
1,234
2.421875
2
[]
no_license
package com.u2d.model; import com.u2d.pattern.Onion; import java.util.Map; import java.util.HashMap; /** * Created by IntelliJ IDEA. * User: eitan * Date: Sep 22, 2005 * Time: 10:30:36 AM */ public class AtomicType { private static transient Map<Class, AtomicType> _typeCache = new HashMap<Class, AtomicType>()...
Python
UTF-8
1,551
2.734375
3
[ "MIT" ]
permissive
"""Post messages to a specific queue dependent on their load.""" from celery_queue_rabbit.queues import custom_exchange, my_queues import celery_queue_rabbit.celery_app as app import celery def send_custom_message(producer=None): """Send a custom message to our exchange with routing key high.""" id = celery.u...
TypeScript
UTF-8
2,090
2.734375
3
[]
no_license
import {Component,OnInit} from "@angular/core"; import {Response} from "@angular/http"; import {HttpService} from "./http.service"; import {User} from './user'; @Component({ selector:'htt', template:`<div> <ul> <li *ngFor="let user of users" > <p> Name of user : {{user?.name}}<...
PHP
UTF-8
2,317
3.375
3
[]
no_license
<?php namespace classes\towns; session_start(); session_destroy(); class Country { private $listTown = []; public function __construct() { if(!empty($_SESSION['country']) && $_SESSION['country'] = []){ foreach ($_SESSION['country'] as $item){ $this->listTown[] = unseri...
Java
UTF-8
287
1.789063
2
[]
no_license
package by.deniskruglik.soapwebservice.dao; import by.deniskruglik.soapwebservice.service.models.Message; import org.springframework.stereotype.Component; @Component public class MessageDAO extends AbstractDAO<Message> { public MessageDAO() { super(Message.class); } }
Python
UTF-8
1,525
3.5
4
[ "MIT" ]
permissive
#!/usr/bin/env python #!/usr/bin/env python """ SimpleMatcherModel.py: (part of speech, spelling) probability model Usage: from SimpleMatcherModel import SimpleMatcherModel as Model m = Model("hillary_train") m2 = Model("trump_train") score = m.score(m2, test_file.read()) """ __author__ = "Prakhar Sahay" __date_...
PHP
UTF-8
293
2.890625
3
[]
no_license
<?php namespace App\Model; class Product { public $name = ''; public $price = 0; public $image = ''; public function __construct($name, $price = 0, $image = 'https://picsum.photos/200'){ $this->name = $name; $this->price = $price; $this->image = $image; new \Exception(); } }
Java
UTF-8
18,358
1.78125
2
[]
no_license
package com.sketchproject.scheduler.fragment; import android.app.ProgressDialog; import android.content.Context; import android.graphics.Point; import android.graphics.drawable.AnimationDrawable; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; impo...
TypeScript
UTF-8
560
2.5625
3
[]
no_license
export declare type GoogleErrorType = 'InvalidGrant' | 'UnauthorizedClient' | 'NotACalendarUser'; export interface InvalidGrant { kind: 'InvalidGrant'; err: Error; } export interface UnauthorizedClient { kind: 'UnauthorizedClient'; err: Error; } export interface NotACalendarUser { kind: 'NotACalenda...
Java
UTF-8
5,464
1.953125
2
[]
no_license
package com.example.covidtracker; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.Spinner; import android.widget.AdapterView; import android.wi...
Java
UTF-8
1,433
2.328125
2
[]
no_license
package com.hotniao.live.model; import com.hn.library.http.BaseResponseModel; import java.util.List; /** * 首页分类 * 作者:Mr.X * 时间:11:06 */ public class HnHomeLiveCateModel extends BaseResponseModel { /** * d : [{"icon":"3","id":"3","is_food":"0","name":"第一个类型"},{"icon":"4","id":"4","is_food":"0","name":"...
Shell
UTF-8
1,575
4.28125
4
[]
no_license
#!/bin/bash ################## # ============== # # Volume Control # # ============== # ################## # Raises or lowers volume of default sink with pactl, but also clamps it to an upper/lower limit # Useage: # volume.sh <up|down> # Config file stored in ~/.config/volume.conf config_dir=~/.config/sound/ confi...
C
UTF-8
1,902
3.125
3
[]
no_license
/* * Copyright (C) 1986,1987,1988,1989,1990 Sun Microsystems, Inc. * All rights reserved. */ #ident "@(#)getname.c 1.5 96/04/25 SMI" /* SMI4.1 1.3 */ #include <stdio.h> #include <string.h> #define iseol(c) (c == 0 || c == '\n' || strchr(com, c) != NULL) #define issep(c) (strchr(sep, c) != NULL) #defin...
JavaScript
UTF-8
1,458
3.21875
3
[ "MIT" ]
permissive
function drawCoordinates(P, pointSize=1) { ctx.fillStyle = "blue"; ctx.beginPath(); ctx.arc(P[0], P[1], pointSize, 0, Math.PI * 2, true); ctx.fill(); } function findMidPoint(P1, P2) { var MP = [0,0] MP[0] = Math.floor((P1[0]+P2[0])/2); MP[1] = Math.floor((P1[1]+P2[1])/2); return MP; } functi...
C
UTF-8
2,756
2.578125
3
[]
no_license
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* rev_algorithm1.c :+: :+: :+: ...
C#
UTF-8
1,232
3.875
4
[]
no_license
using System; using System.Linq; using System.Text.RegularExpressions; namespace MatchPhoneNumber { class Program { static void Main(string[] args) { // A valid phone number from Sofia has the following characteristics: // - It starts with "+359" // - Then, ...
JavaScript
UTF-8
6,265
2.84375
3
[ "MIT" ]
permissive
var csvStringState; async function readTextFile() { await fetch('http://34.69.40.232:5000/prueba2.txt', {mode: 'no-cors'}) //35.188.134.148 .then(response => response.text()) .then(data=> { var someText = data.replace(/(\r\n|\n|\r)/gm, "\n" ); csvStringState = someText.split("`"); ...
PHP
UTF-8
2,662
2.765625
3
[]
no_license
<?php // Create connection $db = new mysqli($dbhost, $dbuser, $dbpass, $dbname); // Check connection if ($db->connect_error) { die("Connection failed: " . $db->connect_error); } // this function get the tasks count and echo the message and control render table function echo_allocate_count($db){ $check_em...
Java
UTF-8
2,099
2.078125
2
[]
no_license
package io.anotherwise.tarefarealm; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import io.anotherwise.taref...
Java
UTF-8
800
2.078125
2
[]
no_license
package com.huang.springbootdemo.service.Pro_Choice.Impl; import com.huang.springbootdemo.entity.Pro_Choice; import com.huang.springbootdemo.mapper.Pro_ChoiceMapper; import com.huang.springbootdemo.service.Pro_Choice.Pro_ChoiceService; import org.springframework.stereotype.Service; import javax.annotation.Resource; i...
Python
UTF-8
205
2.59375
3
[]
no_license
from unittest import TestCase from vit import * class TestVat(TestCase): def test_vat(self): list = [0.2, 0.5, 4.59, 6] self.assertAlmostEqual(vat_faktura(list),vat_paragon(list),1)
C++
UTF-8
2,486
2.5625
3
[]
no_license
#ifndef CAR_H__ #define CAR_H__ #include "V2XDataSource.hpp" namespace v2x { class Car : public V2XDataSource { public: Car(); virtual ~Car(); virtual const CTempId getTempId() const override; virtual const CLatitude getLatitude() const override; virtual const CLongitude getLongitude() const ov...
Markdown
UTF-8
1,078
3.59375
4
[]
no_license
# Android-hangman-game The application is developed for the course Application Development for Android at NTNU. ### Game description This is a hangman word game. The game generates a word for the player to guess. The player guesses the word by choosing one and one letter. If guessed letter is in the word, then th...
Java
UTF-8
170
1.734375
2
[ "MIT" ]
permissive
package io.lansing.mcjslib; public abstract class RunningModule { public abstract void onEnable(); public abstract void onDisable(); public abstract void onLoad(); }
PHP
UTF-8
655
2.609375
3
[]
no_license
<?php namespace ModuleInstaller; use Privilege\Privilege; class ModuleInstallerModule { public static function decorateUri2PagesMap(array &$uri2pagesMap) { $uri2pagesMap[ModuleInstallerConfig::getUri()] = ModuleInstallerConfig::getPage(); } public static function displayToolsLeftMenuLink...
C++
UTF-8
154
2.53125
3
[]
no_license
#include <iostream> using namespace std; int main() { int counter = 1; while( counter <=10 ) { cout<<counter<< " "; ++counter; } cout<<endl; }
Java
UTF-8
5,325
2.3125
2
[ "Apache-2.0" ]
permissive
package org.dcsa.api_validator.ovs.v1.schedules; import org.dcsa.api_validator.conf.Configuration; import org.everit.json.schema.Schema; import org.everit.json.schema.loader.SchemaLoader; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONTokener; import org.testng.Assert; import org.testng...
JavaScript
UTF-8
1,778
2.8125
3
[]
no_license
import React, { Component } from "react"; import { connect } from "react-redux"; import { getCityName } from "./../../../actions/actions"; import "./Search.scss"; class Search extends Component { state = { value: "" }; /** * Store the user-entered value in the state value */ handleChange = () => { thi...
Markdown
UTF-8
2,779
3.109375
3
[]
no_license
# 一、实验目标 1. 掌握数据库操作方法 2. 掌握界面设计方法 # 二、实验内容 1. 更新页面组件 # 三、实验步骤 1. 修饰界面 ```java package edu.hzuapps.myapplication; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ImageView; import android...
Python
UTF-8
2,381
3.09375
3
[ "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
from math import sqrt import sys import time start_Time = time.time() def main(): PointArray = [] buildArray(PointArray) BruteForce(PointArray) def buildArray(PointArray): openFile = open(sys.argv[1], "r+") value = openFile.read().split() for i in value: if i != ' ' and i != '\n': #...
Java
UTF-8
808
2.015625
2
[ "Apache-2.0" ]
permissive
package com.github.mostroverkhov.r2.autoconfigure.server.endpoints; import com.github.mostroverkhov.r2.autoconfigure.internal.server.endpoints.EndpointResult; import java.util.Objects; import reactor.core.publisher.Flux; public class ServerControls { private final Flux<EndpointResult> endpointStarts; private fin...
Shell
UTF-8
220
2.71875
3
[ "Apache-2.0" ]
permissive
#!/bin/bash ### # # Author: Pierre Gilet # Version: 1.0 # Date: 2012-01-19 # # Description: # Print to stdout the total disk space. # ### df -h --block-size=M | grep "/$" | tr -s " " " " | cut -d " " -f 2 | sed "s/M$/ MB/"
Java
UTF-8
1,238
3.5
4
[]
no_license
package divide_etc_0807; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class QuickSort2 { // static int L, R, pivot; static int a[]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedR...
Python
UTF-8
357
3.484375
3
[]
no_license
import numpy as np import matplotlib.pyplot as plt x = np.arange(-20, 20) y = x**2 px = np.array([-5, 15]) py = px**2 print(px) print(py) a = (py[1] - py[0]) / (px[1] - px[0]) b = py[0] - a * px[0] y2 = a * x + b print(a) plt.figure(0) plt.plot(x, y, 'b-', label='f1') plt.plot(px, py, 'ro') plt.plot(x, y2, 'r-',...
Java
UTF-8
6,970
2.21875
2
[]
no_license
package cs4620.framework; import java.awt.Component; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLContext; impor...
C++
UTF-8
1,072
2.6875
3
[]
no_license
#include "acquisitionconverter.h" AcquisitionConverter::AcquisitionConverter(QObject *parent) : QObject(parent) { } void AcquisitionConverter::processFrame(const cv::Mat &frame) { if (m_processAll) process(frame); else queue(frame); } void AcquisitionConverter::setProcessAll(bool all) { m_processAll = all; ...
TypeScript
UTF-8
390
2.53125
3
[]
no_license
import { Pipe, PipeTransform } from '@angular/core'; import { IFighter } from '../../models/fighter.model'; @Pipe({ name: 'dateRanking', }) export class DateRankingPipe implements PipeTransform { transform(fighters: IFighter[], date: string | Date): IFighter[] { if (date === 'all') return fighters; return ...
PHP
UTF-8
4,927
3.09375
3
[]
no_license
<?php /** * Project : OPEN ADMIN * File Author : BryZe NtZa * File Description : Application utilities functions * Date : Mai 2018 * Copyright XDEV WORKGROUP * */ namespace OpenAdmin\Library; Class DateLib { public static function getIDDate($date) { try { if ($date == '') { return 0; exit(); ...
Markdown
UTF-8
11,097
2.578125
3
[]
no_license
# NVIDIA-Position **2018.05.06 Carra Zhou in Shanghai** ##### 不定期更新NV部分职位,有想了解更多可以follow me,或者发邮件给我,carraz@nvidia.com ## Web Development Position ### Frontend Developer(Jupyter) waiting for update ### Architecture Data Engineer - We are looking for an extraordinary data engineer to help us build a next-generation int...
Markdown
UTF-8
6,028
2.625
3
[ "MIT", "BSD-3-Clause" ]
permissive
## Project Description The Scalable Vector Graphics (SVG) is an XML-based standard file format for creating graphics on the web, and is supported by most modern browsers. This project provides a C# library for parsing, converting and viewing the SVG files in WPF applications. The [Scalable Vector Graphics (SVG)](http...
Markdown
UTF-8
1,888
3.796875
4
[]
no_license
#include <iostream> #include <string> #include<iomanip> using namespace std; void Menu(); float Area(const float R); //วงกลม int Area(const int w,int l,int h); //ปริมาตร float Area(const float L,const float W); //สี่เหลี่ยม double Area(const double based1,double based2, double h); //คางหมู int main(){ char C; bool F...
Swift
UTF-8
298
2.765625
3
[ "MIT" ]
permissive
import UIKit internal extension Presenter { internal func addController(presentation:PresentationProtocol) { guard let controller:UIViewController = presentation.controller else { return } self.addChildViewController(controller) } }
C++
UTF-8
1,249
3.03125
3
[]
no_license
#ifndef GRAAL_H #define GRAAL_H #include <utility> using std::pair; #include <iterator> using std::distance; #include <algorithm> using std::sort; #include <iostream> using std::cout; namespace graal { /*! * Exemplo de documentação seguindo o formato Doxygen * * @tparam Itr iterator para o range. * @tparam Com...
Python
UTF-8
2,419
2.703125
3
[]
no_license
import torch from src.utils import fit_shape def calc_stats(features, labels): grams = [] for k_cluster in range(0, int(labels.max().item() + 1)): arr = features[:, labels == k_cluster] grams.append(torch.mm(arr, arr.T)/arr.shape[1]) return grams def calc_dist(content_grams, style_grams): dist = torch.zeros(...
C++
UTF-8
548
2.6875
3
[]
no_license
#ifndef _FLYING_OBJECT_H_ #define _FLYING_OBJECT_H_ class flyingObject{ public: flyingObject(); flyingObject(float* s); flyingObject(float* s, float* axis); flyingObject(float* s, float* axis, float* v); flyingObject(float* s, float* axis, float* v, float* a); ~flyingObject(); void setPosition(float...
Python
UTF-8
598
3
3
[]
no_license
from typing import List class Solution: def combination(self, A, sum_, i, cur_sum): if sum(cur_sum) > sum_: return 0 if i == len(A): if sum(cur_sum) == sum_: self.ans.append(cur_sum) return take = self.combination(A, sum_, i, cur_sum + ...
C#
UTF-8
5,167
2.625
3
[ "Apache-2.0" ]
permissive
using System; using System.Collections.Generic; using System.Data.Linq.Mapping; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel.DataAnnotations; namespace System { /// <summary> /// 模型类接口,在类中实现时包含一个签名为ID的公用自增量属性 /// </summary> public interface IModelID<T...
JavaScript
UTF-8
781
2.578125
3
[ "MIT" ]
permissive
const serialize = (item) => { if (typeof item.toJSON === 'function') { return item.toJSON(); } return item; }; export default () => { return function (hook) { switch (hook.method) { case 'find': if (hook.result.data) { hook.result.data = hook.result.data.map(serialize); ...
PHP
UTF-8
1,211
2.859375
3
[]
no_license
<?php require_once 'inc/constants.php'; function get_user($value, $key){ $users = get_users(); foreach ($users as $user) { if ($user[$key] === $value) { return $user; } } return false; } function get_users(){ return get_db()['users']; } function store_user($user_details){ $current_db_data = get_db(); ...
C
UTF-8
1,305
3.203125
3
[ "MIT" ]
permissive
/* * * MPI Scatter and Gather examples. * */ #include <mpi.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv){ int rank; int size; int sendcount = 1; int recvcount = sendcount; int sendbuf[4]; int recvbuf; int finalbuf[4]; int ROOT = 0; MPI_Init(NULL, N...
Markdown
UTF-8
3,240
3.125
3
[ "MIT" ]
permissive
--- id: reference_form title: <form> sidebar_label: <form> --- The `<form>` element represents a group of input elements that should be serialized into the request. Any behaviors within the `<form>` that result in a remote request will include the form's input values. This applies to both update and navigation actions...
Python
UTF-8
911
2.84375
3
[]
no_license
from database.repository import db from marshmallow import Schema, fields, post_load class Employee(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(255), nullable=False) surname = db.Column(db.String(255), nullable=False) age = db.Column(db.Integer, nullable=False) ...
Java
UTF-8
371
2.15625
2
[]
no_license
package Gauss; import java.util.Arrays; public class App { public static void main( String[] args ) { double[][] matrix = {{ 3, 4, -9, 5}, {-15, -12, 50, -16}, {-27, -36, 73, 8}, { 9, 12,-10, -16}}; ...
Java
UTF-8
11,057
2.140625
2
[]
no_license
package mock02.dao; import java.sql.Blob; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import mock02.model.Assignment; import mock02.model.Member; import mock02.model.Score; import mock02.mod...
Markdown
UTF-8
700
2.625
3
[ "MIT" ]
permissive
This repo contains the source code for a talk on bash scripting. ## dependencies - unpaper - tesseract - libtiff - poppler - netpbm ## usage ./process_document_dir.sh ~/documents/pdfs The script takes a single directory as an argument, expecting its structure to be: pdfs: pdfname: 1.pd...
C++
UTF-8
952
2.765625
3
[]
no_license
#include<iostream> int gray[101][101]; int map[101][101]; int n; int min; int dx[] = { 1,-1,0,0 }; int dy[] = { 0,0,-1,1 }; bool isInMap(int x, int y) { if (x < 1 || y>n || x > n || y < 1) { return false; } else return true; } void solve(int x, int y, int t) { if (x == n && y == n) { if (min > t) { min...
Markdown
UTF-8
2,661
2.625
3
[ "MIT", "BSD-3-Clause" ]
permissive
# 说明 这是我在空闲时间用yii2-basic来练手的项目,目前还在学习中,在此分享给大家,希望能得到些指点和建议,多学到点东西,也希望有同样热爱yii2的同学和我多多交流,互相学习,我的QQ是494364222。 写了很多注释,主要的都在`Music`相关的代码里了,如果哪里看不懂或者代码还有更好的写法的话,就多多和我交流吧。 另外就是我强迫症很严重,所以有可能会经常把代码简化,或者把一些封装方式和方法的顺序以及一些命名会经常改来改去的,请见谅。 除了框架本身的**入口文件**/web/index.php和**配置文件**/config/web.php以及**数据库配置文件**/config/db.php以外(这句话写给...
C#
UTF-8
3,144
2.6875
3
[ "MIT" ]
permissive
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; // AudioAnchor - Audio Management and Playing Singleton public class AudioAnchorScript : MonoBehaviour { public static AudioAnchorScript inst = null; // The singleton instance [HideInInspector] public...
Rust
UTF-8
634
3.109375
3
[ "MIT" ]
permissive
use my_des; fn main() { let sample_inp: Vec<u64> = vec![ 0x0123456789ABCDEF, 0x0123456789ABCDEF, 0x0123456789ABCDEF ]; let sample_key: u64 = 0x85E813540F0AB405; println!("Sample input: {:?}", sample_inp); let mut mode: Box<dyn my_des::Cipher> = Box::new(my_des::ECB::new())...
Java
UTF-8
951
2.078125
2
[]
no_license
package com.example.calender; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.EditText; public class eventPage extends AppCompatActivity { public static final String msg = "com.example.calender.MainActivity...
PHP
UTF-8
1,291
3.015625
3
[ "MIT" ]
permissive
<?php namespace NoMoreWar\Casualties\Commands; use Dotenv\Dotenv; use NoMoreWar\Casualties\Exceptions\DatabaseException; use PDO; use PDOException; use Symfony\Component\Console\Command\Command; class BaseCommand extends Command { /** * Connection variable for the database server. * * @var PDO $p...
Swift
UTF-8
464
3.015625
3
[]
no_license
// // Question.swift // QuizApp // // Created by yumi on 2020/06/02. // Copyright © 2020 Yumi Takahashi. All rights reserved. // import Foundation // クイズの構成を記載 struct Question { let text: String var answers: [String] let rightAnswer: String let label: Int init(q: String, a: [String],...
Markdown
UTF-8
5,121
3.375
3
[]
no_license
# 表单校验 > 校验都是必须的过程, 只是具体该怎么校验才比较好,是值得深掘的过程, 现在一般分两种。 - 提交前校验,在每个字段下方进行校验,及时提示 - 在提交时校验,不通过再进行提示(谷歌在注册账号时,用的是后端校验,直接将错误信息展现在对应的输入框位置) > ============== - 录入数据是进行表单校验 - 已有数据,初步不进行表单校验,等有数据再进行表单校验, 输入框颜色变化 - 动态创建表单 进行校验 - 表单非必填是 表单校验 - 表单依据状态动态 变为 必填项 非必填项 ### 新知 - 红色星号 `el-form-item`这个组件的类名中 添加 `is-...
JavaScript
UTF-8
445
2.859375
3
[]
no_license
function displayPage(){ var param = document.getElementsByTagName("param"); for(var i = 0; i < param.length; i++){ param[i].value = ""; } } //another stop load time //若載入影片失效時,可以註解上面的方法,改用這個方法。 /* jQuery(document).ready(function(){ var param = document.getElementsByTagName("param"); alert("Video is ready!")...
Python
UTF-8
4,985
2.546875
3
[]
no_license
import os os.environ["CUDA_VISIBLE_DEVICES"] = "0" import tensorflow as tf config = tf.ConfigProto() config.gpu_options.allow_growth = True # 不全部占满显存,按需分配 # config.gpu_options.per_process_gpu_memory_fraction = 0.3 session = tf.Session(config=config) import numpy as np from sklearn import metrics from keras.models impo...
Java
GB18030
13,002
2.484375
2
[]
no_license
package com.lixh.basecode.util; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; im...
Python
UTF-8
41,974
3.703125
4
[ "LicenseRef-scancode-unknown-license-reference", "CC-BY-4.0", "MIT", "LicenseRef-scancode-public-domain" ]
permissive
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=Mathematics/IntervalsAndInequalities/in...
JavaScript
UTF-8
2,679
3.859375
4
[]
no_license
/* Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such that: Only one letter can be changed at a time Each transformed word must exist in the word list. Note that beginWord is not a transformed word. Note: Return an empty ...
JavaScript
UTF-8
1,144
3.609375
4
[]
no_license
/** * title: 解构赋值 * date: 2017/12/07 * author: Silvester */ // destructuring(解构赋值) // 1.数组 // 匹配模式 { let [a, b, c] = [1, 2, 3] let [foo, [[bar], baz]] = [1, [[2], 3]] let [, , third] = ['foo', 'bar', 'baz'] let [d, , e] = [1, 2, 3] let [head, ...tail] = [1, 2, 3, 4, 5] let [x, y, ...z]...
Markdown
UTF-8
15,170
3.28125
3
[]
no_license
# Local-Help-Centre Assignment Instructions: Assignment 2: A Help Centre Queueing System Due: October 17, 2018 4 p.m. Introduction The Department of Computer Science has an undergraduate help centre where students can ask questions about their course work. Students swipe their T-cards to enter a software queue and w...
Java
UTF-8
1,746
2.34375
2
[]
no_license
package com.strangeiron.endoftheline.screen; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.strangeiron.endoftheline.EotlInputManager; import com.strangeiron.endoftheline.EotlNetwork; import com.strangeiron.endoftheline.EotlWorld; import com.strangeiron.endofthel...
Java
UTF-8
3,153
2.328125
2
[]
no_license
package com.udacity.jwdnd.course1.cloudstorage.pages; import org.junit.jupiter.api.Assertions; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedConditions...
Python
UTF-8
459
2.640625
3
[]
no_license
#!/usr/bin/env python import os import sys if len(sys.argv) < 2: print("Find files in current directory") print("Usage: f ([directory]) [reg-exp] ([reg-exp] ..)") sys.exit("") if "-name" in sys.argv: sys.argv.remove("-name") directory = "." if os.path.isdir(sys.argv[1]): directory = sys.argv[1] de...
C#
UTF-8
2,101
3.21875
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Cell_Phone_Test { public partial class Form1 : Form { public Form1() { InitializeCompone...
Python
UTF-8
1,084
3.71875
4
[]
no_license
class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def reverseBetween(self, head: ListNode, left: int, right: int) -> ListNode: node = head stack = [] start = None tail = None index = 1 while node...
JavaScript
UTF-8
2,634
2.859375
3
[]
no_license
var backdrop, jungle, monkey, monkeyAnimation, rock, rockImage, banana, bananaImage, ground, invisibleGround, bananaGroup, rockGroup, score; function preload(){ jungle = loadImage("jungle.jpg"); rockImage = loadImage("stone.png"); bananaImage = loadImage("banana.png"); monkeyAnimation = loadAnimation ("Mon...