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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 2,732 | 1.921875 | 2 | [] | no_license | package com.kinth.mmspeed;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
im... |
Markdown | UTF-8 | 554 | 2.78125 | 3 | [] | no_license | # Scrap-a-Rent!
## Purpose
This app is used to scrap data from multiple data sources to find a rent; that data will be sent through email to some targed people
and to a mobile app to be shown as notifications.
## Technologies
1. Node.js
2. Pupeteer
3. Node-cron
## Features
1. Scrap data from Facebook Groups, OLX,... |
Python | UTF-8 | 1,753 | 2.953125 | 3 | [
"MIT"
] | permissive | from PIL import Image
import numpy as np
from scipy.ndimage import filters
import matplotlib.pyplot as plt
import pickle
from carla import image_converter
def to_bgra_array(image):
"""Convert a CARLA raw image to a BGRA numpy array."""
array = np.frombuffer(image, dtype=np.dtype("uint8"))
array = np.reshap... |
C++ | UTF-8 | 782 | 2.9375 | 3 | [] | no_license | template<typename T>
struct CSum2D {
vector<vector<T> > d;
CSum2D(int h, int w):d(h+1, vector<T>(w+1,0)){}
void add(int y, int x, T v = 1) {
x++; y++;
assert(y < (int)d.size() && x < (int)d[0].size());
d[y][x] += v;
}
void build() {
for (int y = 0; y < (int)d.size(); ++y) {
for (int x = ... |
JavaScript | UTF-8 | 2,086 | 2.75 | 3 | [] | no_license | "use strict"
describe('TasksService', function() {
beforeEach(module('goalbusterApp'));
var TasksService, httpBackend, TasksFactory, task1, task2;
var apiURL = "https://goalbuster-api.herokuapp.com";
var taskData = [{name: "read notes", frequency: "monthly", id: 1, completed: false}, {name: "buy bike", freque... |
C++ | UTF-8 | 4,434 | 2.5625 | 3 | [
"BSD-3-Clause-Open-MPI",
"MIT",
"Zlib",
"LicenseRef-scancode-public-domain"
] | permissive | // shasta.
#include "MarkerFinder.hpp"
#include "LongBaseSequence.hpp"
#include "performanceLog.hpp"
#include "ReadId.hpp"
#include "timestamp.hpp"
using namespace shasta;
// Standard library.
#include <chrono>
#include <limits>
MarkerFinder::MarkerFinder(
size_t k,
const MemoryMapped::Vector<KmerInfo>& kmer... |
Java | SHIFT_JIS | 1,895 | 2.453125 | 2 | [] | no_license | package jp.co.recruit.mtl.sample.async;
import java.util.ArrayList;
import java.util.List;
import jp.co.recruit.mtl.sample.dto.Tweet;
import twitter4j.Paging;
import twitter4j.ResponseList;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import android.content.Context;
... |
JavaScript | UTF-8 | 4,682 | 2.84375 | 3 | [] | no_license | d3.json("data/samples.json").then((importedData) => {
console.log("Firs read", importedData);
let names = importedData.names;
let samples = importedData.samples;
let prueba = samples[0].sample_values
let prueba1 = samples[0].otu_ids
let prueba2 = samples[0].otu_labels
let metadata = imported... |
C# | UTF-8 | 516 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace OpenLab_04._09
{
class Class1
{
public List<string> RemoveDups(List<string> a)
{
for (int o = 0; o < a.Count; o++)
{
for (int i = 0; i < a.Count; i++)
{
... |
C++ | UTF-8 | 1,449 | 4.34375 | 4 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
//Here we initialize our function declarations
void showData(priority_queue <int> pq);
void showData(priority_queue <int, vector<int>, greater<int>> gq);
int main()
{
//priority_queue is the syntax we use to create a Priority Queue.
//Think of it similar t... |
C# | UTF-8 | 962 | 2.515625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using UnitTestCoder.Core.Formatting;
using UnitTestCoder.Population.Maker;
namespace UnitTestCoder.Population.Coder
{
public class ObjectPopulationCoder : IObjectPopulationCoder
{
private readonly IObjectPopulationMa... |
Java | UTF-8 | 1,172 | 2.6875 | 3 | [
"MIT"
] | permissive | package tafit3.cplibrary;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import static java.util.stream.Collectors.*;
import static tafit3.cplibrary.CartesianPowerDiagonally.*;
import static t... |
C | UTF-8 | 283 | 2.65625 | 3 | [
"MIT",
"BSD-2-Clause"
] | permissive | /* -*- Mode: C; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
#include "util.h"
int main(void) {
gid_t gid = getgid();
int err = setgid(gid);
atomic_printf("setgid returned: %d\n", err);
test_assert(0 == err);
atomic_puts("EXIT-SUCCESS");
return 0;
}
|
C++ | UTF-8 | 3,758 | 2.875 | 3 | [
"MIT"
] | permissive | // 1057. Campus Bikes
// https://leetcode.com/problems/campus-bikes/
// Runtime: 160 ms, faster than 81.19% of C++ online submissions for Campus Bikes.
// Memory Usage: 44.3 MB, less than 31.19% of C++ online submissions for Campus Bikes.
class Solution {
public:
vector<int> assignBikes(vector<vector<int>>& worke... |
C | UTF-8 | 1,538 | 2.71875 | 3 | [] | no_license | #include "HAL_USART.h"
void USART_Initialize(char usart_ch){
if(usart_ch == 2)
{
// Enable USART2 clock
RCC->APB1ENR |= RCC_APB1ENR_USART2EN;
// Enable GPIOA clock (PA2 is used as TX pin, PA3 as RX)
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
// Set pins PA2 and PA3 to alternate function mode
GPIOA->MODER |=... |
Java | UTF-8 | 1,681 | 2.875 | 3 | [] | no_license | package com.w205.sessions;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.concurrent.Callable;
import com.w205.utils.FileAccessFactory;
import com.w205.utils.Reader;
import com.w205.utils.Writer;
public class SingleFileOrderer implements Cal... |
Markdown | UTF-8 | 1,395 | 2.828125 | 3 | [
"MIT"
] | permissive | # Table Tennis Tournament Generator
A web app that randomly generates a tournament structure based on a user-submitted list of names.
## How to install
* You'll need [Yarn](https://yarnpkg.com/lang/en/docs/install) or [npm](https://www.npmjs.com/get-npm) installed, so follow the installation docs for whichever you c... |
Python | UTF-8 | 188 | 3.109375 | 3 | [] | no_license | a = int(input())
if a == 1:
print("ACL")
elif a == 2:
print("ACLACL")
elif a == 3:
print("ACLACLACL")
elif a == 4:
print("ACLACLACLACL")
else:
print("ACLACLACLACLACL") |
Java | UTF-8 | 3,399 | 2.078125 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2013 OpenBEL Consortium
*
* 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 o... |
Markdown | UTF-8 | 5,370 | 2.703125 | 3 | [] | no_license | # **API Spec - Fabric Grey**
# Feature
* JWT Auth
* MYSQL
# Build
- git clone reposotory
- composer update
- copy .env.example to .env
- php artisan jwt:secret
- php -S localhost:8000 -s public
## Authenticaion
All Api use this authentication
* Request:
- Header :
* Bearer-Token: "... |
Java | UTF-8 | 1,059 | 1.90625 | 2 | [] | no_license | package com.obpoo.gfsfabricsoftware.PUG.UI;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.obpoo.gfsfabricsoftware.PUG.MVP.NearestLocation.NLView;
import com.obpoo.gfsfabricsoftware.PUG.Model.NLD... |
PHP | UTF-8 | 3,565 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use App\Question;
class QuestionController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$questions = Question::a... |
Java | UTF-8 | 5,339 | 2.203125 | 2 | [] | no_license | package com.example.ebc003.tripolarcon.model;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import ... |
Markdown | UTF-8 | 19,988 | 2.9375 | 3 | [] | no_license | <p data-nodeid="2380" class=""><strong data-nodeid="2473">微服务设计最核心的难题是微服务的拆分</strong>,不合理的微服务拆分不仅不能提高研发效率,反倒还使得研发效率更低,因此要讲究“小而专”的设计。“小而专”的设计意味着微服务的设计不是简单拆分,而是对设计提出了更高的要求,要“<strong data-nodeid="2474">低耦合、高内聚</strong>”。那么,如何做到“低耦合、高内聚”,实现微服务的“小而专”呢?那就需要“领域驱动设计”作为方法论,来指导我们的开发。</p>
<p data-nodeid="2381">用“领域驱动设计”是业界普遍认可的解决... |
C | UTF-8 | 6,835 | 2.5625 | 3 | [] | no_license | /************************************************************************************
* *
* SKV data type Release 1.0 *
* Copyright (c) 2018 by Yonsz Information Technology Co. *
* Written by Mr. NieShuai *
* ... |
TypeScript | UTF-8 | 2,347 | 2.546875 | 3 | [] | no_license | import { Command } from 'discord-akairo';
import { MESSAGES } from '../../utils/constants';
import { HMessage } from '../../utils/classes/HMessage';
import { User, TextChannel } from 'discord.js';
export default class TrashCleanup extends Command {
public constructor() {
super('trash', {
aliase... |
Python | UTF-8 | 1,960 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | ## File Name: androidDBParser.py
##
## Author(s): Daniel "Albinohat" Mercado
##
## Purpose: This script open and parse through the databases used to store
## data for Android applications and store them as objects.
##
## TODO -
##
## Standard imports (Static)
import logging, platform, re, sqlite3, sys
## Thi... |
Java | UHC | 1,065 | 3.578125 | 4 | [] | no_license | package interfaceex;
public interface Calc {
// ܰ迡 ȴ.
double PI = 3.14;
int ERROR = -9999999;
int add(int num1,int num2);
int substract(int num1,int num2);
int times(int num1,int num2);
int divide(int num1,int num2);
//ȯ 뷫 ҵ Ʒ ۼ
// public void stringConcat(String s1,String s2);
... |
TypeScript | UTF-8 | 2,933 | 2.53125 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | import { Compilation, Compiler, WebpackError, WebpackPluginInstance } from 'webpack';
function maybeFetchPlugin(compiler: Compiler, name: string): WebpackPluginInstance | undefined {
return compiler.options?.plugins
?.map(({ constructor }) => constructor)
.find(constructor => constructor && constructor.name ... |
Java | UTF-8 | 7,056 | 2.296875 | 2 | [] | no_license | /*******************************************************************************
* 2018, All rights reserved.
*******************************************************************************/
package com.jp.insurance.entities;
import java.util.Date;
// Start of user code (user defined imports)
// End of user code
/... |
Markdown | UTF-8 | 14,386 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | import { Alert, Tabs, TabItem } from '@aws-amplify/ui-react';
One of the goals of Amplify is to be a good citizen of the environment it exists in. As such Amplify works hard to not interfere with other tools that are being used.
There are many CSS In JS libraries out there that give a number of benefits. Amplify does... |
Ruby | UTF-8 | 549 | 2.875 | 3 | [] | no_license | require 'open-uri'
require 'json'
my_course_sections = "CMSC131-0101,ENGL393-0101,ARTT100-0101"
data = open("http://api.umd.io/v0/courses/sections/#{my_course_sections}").read
sections = JSON.parse(data)
sections.each do |section|
course_id = section['course']
section['meetings'].each do |meet|
days = m... |
JavaScript | UTF-8 | 1,119 | 2.703125 | 3 | [] | no_license | const menu = document.getElementsByClassName("fa-bars")[0];
const mainMenu = document.getElementsByClassName("main-menu")[0];
const dropBtn = document.getElementsByClassName("drop-btn")[0];
const dropDown = document.getElementsByClassName("drop-down")[0];
const subDropBtn = document.getElementsByClassName("sub-drop-btn... |
C++ | UTF-8 | 1,681 | 2.953125 | 3 | [] | no_license | #include "relayControl.h"
#include <wiringPi.h>
#define RELAY_GPIO27_PIN 2
// Constructor
RelayControl::RelayControl () {
if (wiringPiSetup() == -1) {
cout << "RelayControl> wiringPi initialization failed" << endl;
// Indicate I/O subsystem problem
ioSubSystemHealth = IO_HEALTH_INIT_FA... |
C# | UTF-8 | 2,750 | 3 | 3 | [
"MIT"
] | permissive | // PennyLogger: Log event aggregation and filtering library
// See LICENSE in the project root for license information.
namespace PennyLogger.Internals.Estimator
{
/// <summary>
/// Generic interface for a probabilistic frequency estimator that maximizes space-efficiency at the expense of
/// accuracy. Pe... |
Python | UTF-8 | 1,091 | 3.40625 | 3 | [] | no_license | class Staff:
def __init__(self,name,salary,yob):
self.name=name
self.salary=salary
self.yob=yob
def showname(self):
print("name od the staff is:",self.name)
def showsalary(self):
print("salary of the staff is:",self.salary)
def showyob(self):
print("year o... |
SQL | UTF-8 | 636 | 3.71875 | 4 | [
"MIT"
] | permissive | SELECT event, repo.id, COUNT(*) as count FROM (
SELECT JSON_EXTRACT(payload, '$.action') as event, repo.id, repo.name, created_at as ts
FROM
[githubarchive:month.201801],
[githubarchive:month.201802],
[githubarchive:month.201803],
[githubarchive:month.201804],
[githubarchive:month.201805],
[githubarchiv... |
C++ | UTF-8 | 476 | 3.21875 | 3 | [] | no_license | /*
Simple math problem
n*(n+1)/2 = s
n^2+n=2*s
n^2+n+(-2*s)=0
Using quadratic equation ax^2+bx+c=0
del = sqrt(b*b-4*a*c) = sqrt(1-4*1*(-2s)) = sqrt(1+8s)
we know x = (-b(+-) del)/2a
Here i use only + value because del is always positive
so n = (-1+sqrt(1+8s))/2
*/
#include<bits/stdc++.h>
using namespace std;
main... |
Java | UTF-8 | 5,427 | 2.078125 | 2 | [] | no_license | package com.example.plantshop.helper;
import android.app.Application;
import android.content.SharedPreferences;
import android.os.Build;
import android.util.Log;
import android.webkit.WebView;
import com.tealium.internal.data.Dispatch;
import com.tealium.internal.listeners.WebViewLoadedListener;
import com.tealium.in... |
JavaScript | UTF-8 | 672 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
import classNames from 'classnames';
export default class Text extends Component {
constructor(props) {
super(props);
this.state = {
truncate: true
}
this.toggleBody = this.toggleBody.bind(this);
}
toggleBody(e) {
e.preventDefault();
e.stopP... |
Python | UTF-8 | 716 | 3.9375 | 4 | [] | no_license | #prints a line
print "I will now count my chickens:"
#counts hens then adds and divides
print "Hens", 25 + 30 /6
#counts roosters with MaTH~~~
print "Roosters", 100 - 25 * 3 % 4
#prints more
print "Now I will count the eggs:"
#does a lotta math
print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
#set up
print "Is it true that ... |
PHP | UTF-8 | 830 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Http\Repositories;
use App\Http\Traits\ApiResponse;
use App\Http\Models\CarbonFootprint;
use App\Http\Interfaces\CarbonFootprintInterface;
use DB;
class CarbonFootprintRepository implements CarbonFootprintInterface
{
// Use ResponseAPI Trait in this repository
use ApiResponse;
public... |
Markdown | UTF-8 | 11,555 | 2.9375 | 3 | [] | no_license | # Article 5
TEXTE
5.1. CENTRE D'ANNONCE DE ...
COMMENTAIRES
Chaque centre de prévision fera l'objet d'un sous-chapitre spécial.
TEXTE
5.1.1. Mission et organisation.
Le centre d'annonce des crues de ...
est placé sous l'autorité de ...
COMMENTAIRES
Indiquer l'ingénieur responsable du centre d'annonce par sa f... |
Java | UTF-8 | 2,870 | 1.898438 | 2 | [] | no_license | package com.xuyang.mapper;
import com.xuyang.model.GlobalAssortment;
import com.xuyang.model.GlobalAssortmentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface GlobalAssortmentMapper {
/**
* This method was generated by MyBatis Generator.
* This method correspon... |
Java | UTF-8 | 2,611 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... |
Markdown | UTF-8 | 1,277 | 2.671875 | 3 | [] | no_license | # i3
Super-Enter open terminal
Super-d exec dmenu_run
Super-Super-Shift-q kill
Super-<number> switch to workspace <number>
Super-Shift-<number> move window to workspace <number>
#### Split
Super-o split horizontal
Super-e split vertical
#### Change focus
... |
C# | UTF-8 | 338 | 3.3125 | 3 | [] | no_license | using System;
using System.Text;
class PrintIsoscelesTriangle
{
static void Main()
{
Console.OutputEncoding = Encoding.UTF8;
char c = '\u00A9';
Console.WriteLine(" {0}", c);
Console.WriteLine(" {0} {1} {2}", c, c, c);
Console.WriteLine("{0} {1} {2} {3} {4}", c, c, c... |
C++ | UTF-8 | 677 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
double alpha = 0.5, beta, input;
Mat src1, src2, dst;
if (argc != 3) {
cout << "Input two same sized images" << endl;
return -1;
}
cout << "Enter alpha[0-1]" << endl;
cin >> input;... |
JavaScript | UTF-8 | 449 | 3.046875 | 3 | [
"MIT"
] | permissive | const ObjectStringify = require('../src/stringify');
const obj1 = {};
console.log(ObjectStringify(obj1));
const obj2 = function () {};
console.log(ObjectStringify(obj2));
const obj3 = [];
console.log(ObjectStringify(obj3));
const obj4 = '';
console.log(ObjectStringify(obj4));
const obj5 = 1;
console.log(Objec... |
Markdown | UTF-8 | 486 | 2.578125 | 3 | [] | no_license | # React Recipe Application
A simple React appliaction that uses Edamam API to fetch recipes from the web. Upon searching for a certain keyword, relevant recipes are displayed with basic informations.
## Tools Used
- Visual Studio Code
- React 17.0.2
## Resources
- [YouTube - Dev Ed](https://www.youtube.com/cha... |
JavaScript | UTF-8 | 1,148 | 2.640625 | 3 | [] | no_license | const request = require('request');
const config = require('../config.js');
const db = require('../database/index.js');
let getReposByUsername = (username, cb) => {
// TODO - Use the request module to request repos for a specific
// user from the github API
// The options object has been provided to help you ou... |
Java | UTF-8 | 2,868 | 2.1875 | 2 | [] | no_license | package com.pfisterfarm.popularmovies.models;
import android.app.Activity;
import android.content.Context;
import android.media.Image;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android... |
Python | UTF-8 | 1,561 | 3.28125 | 3 | [] | no_license | #!/usr/bin/python3
"""this model contain square class that inheret from rectangle class"""
from models.rectangle import Rectangle
class Square(Rectangle):
"""class Square inheret from Rectangle"""
def __init__(self, size, x=0, y=0, id=None):
super().__init__(self, size, size, x, y, id)
... |
Markdown | UTF-8 | 1,211 | 2.71875 | 3 | [] | no_license | # What is PySpark?
PySpark is the collaboration Apache Spark and python.It is python API for spark.
# PySpark for Mac
Install spark using this link https://spark.apache.org/downloads.html
Choose your package type and download the associated tar file on your system.
Extract the tar file on system and move it to hom... |
Markdown | UTF-8 | 3,494 | 3.015625 | 3 | [] | no_license | # 后端语言初识
## 1. PHP
世界最好的语言 PHP,php 上手比较快,所以前端想了解服务端语言的话,php 可以作为服务端入门语言。
**特点:**
- 开放源码,免费
- 开发快捷,入门快
- 跨平台,配置简单
- 开源框架丰富
- 面向对象
**欠缺点:**
- 多线程不好
- 编码规范不统一
- 语法不严谨
PHP 属于脚本语言,不需要进行编译成包去运行,在特点的环境下就可以跑起来,一般的生产环境配置都是`Apache` + `MySql` + `PHP` + `Linux`。
**适用范围:**
- 中小型网站
- CMS
- 单用作后端接口
- 与前端代码混用
## 2. Java
最早主... |
Shell | UTF-8 | 305 | 2.84375 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #!/bin/bash -ex
pushd $(dirname $0) > /dev/null 2>&1;
#
# -c INI configuration file
# -t Document root
# -S Start a built-in PHP server on host:port
# router.php to configure 'rewrites'
#
php \
-c php.ini \
-t src/htdocs \
-S localhost:9040 \
$(pwd)/router.php
popd > /dev/null 2>&1;
exit 0;
|
C++ | UTF-8 | 1,515 | 2.859375 | 3 | [] | no_license | // ll_map
// Longitude & Latitude Map
// NOTES:
// 1 degree = 69 miles
// Burlington
// Lat: 44.476266
// Lon: -73.205509
#ifndef LL_MAP_H
#define LL_MAP_H
#include <iostream>
#include <math.h>
#include <sstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
nam... |
TypeScript | UTF-8 | 394 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | import { Derivable } from './derivable';
/**
* Unpacks a derivable or does nothing if `v` is not a derivable.
*
* @param v a value or derivable
*/
export function unpack<T>(v: T | Derivable<T>): T;
export function unpack<T>(v: T | Derivable<T> | undefined): T | undefined;
export function unpack<T>(v?: T | Derivabl... |
JavaScript | UTF-8 | 633 | 2.9375 | 3 | [
"MIT"
] | permissive | // profile lookup
var contacts = [
{
"firstName" : "pooya",
"lastName" : "panahi",
"id" : "212112"
},
{
"firstName" : "parham",
"lastName" : "panahijat",
"id" : "212156"
},
{
"firstName" : "pashmak",
"lastName" : "panahim",
"id" : "217812"
},
{
"firstName" : "pashmam",
"lastName" : "panahe... |
C# | UTF-8 | 4,498 | 2.53125 | 3 | [] | no_license | using UnityEngine;
using System;
namespace Reference
{
[RequireComponent(typeof(CharacterController))]
public class ProtoCharControl : MonoBehaviour
{
public BaseMotionVars Motion = new BaseMotionVars();
public GravityVars Gravity = new GravityVars();
protected float _xVel = 0f;
... |
Java | UTF-8 | 3,041 | 2.109375 | 2 | [] | no_license | package com.team3.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.springframework.beans.factory.annotation.Autowired;
import or... |
Python | UTF-8 | 2,574 | 3.015625 | 3 | [
"MIT"
] | permissive | """
Tests for botogram/utils.py
Copyright (c) 2015 Pietro Albini <pietro@pietroalbini.io>
Released under the MIT license
"""
import botogram.utils
import botogram.decorators
STRANGE_DOCSTRING = """ a
b
"""
def test_strip_urls():
# Standard HTTP url
assert botogram.utils.strip_urls("http:/... |
C++ | UTF-8 | 2,727 | 2.71875 | 3 | [
"MS-PL",
"BSL-1.0",
"MIT"
] | permissive | #pragma once
#include <condition_variable>
#include <functional>
#include <mutex>
namespace sptf
{
class AbortManager
{
private:
using Task = std::function<void()>;
struct AbortableTask
{
std::unique_ptr<Task> task;
abort_callback* pAbort;
};
public:
class AbortableScope
{
... |
Java | UTF-8 | 2,109 | 2.296875 | 2 | [] | no_license | package com.AlphaDevs.cloud.web.JSFBeans;
import com.AlphaDevs.cloud.web.Entities.Logger;
import com.AlphaDevs.cloud.web.Entities.Units;
import com.AlphaDevs.cloud.web.Enums.TransactionTypes;
import com.AlphaDevs.cloud.web.Helpers.EntityHelper;
import com.AlphaDevs.cloud.web.SessionBean.LoggerController;
import com.Al... |
Java | UTF-8 | 608 | 3.53125 | 4 | [] | no_license | package binarytree;
import tree.Node;
public class DeleteTree {
public static void main(String[] args) {
Node root = new Node(1);
root.left = new Node(2);
root.right = new Node(3);
root.left.left = new Node(4);
root.left.right = new Node(5);
root.right.left = new Node(6);
root.right.right =... |
Markdown | UTF-8 | 1,059 | 2.859375 | 3 | [
"MIT"
] | permissive | # Rank Scoring via Collaborative Filtering
Efficient implementation of User-User and Item-Item Collaborative Filtering in Python using parallelization for faster pre-processing.
## Collaborative Filtering
Collaborative Filtering is a scoring algorithm based on prior knowledge used in recommendation systems.
**User-Us... |
Go | UTF-8 | 3,158 | 2.609375 | 3 | [] | no_license | package main
import (
"ceph-tools/ceph_client"
"ceph-tools/host"
"fmt"
"github.com/liucxer/ceph-tools/pkg/cluster_client"
"sort"
"time"
)
type CephStatus struct {
Time time.Time `json:"time"`
HealthMinimalResp ceph_client.HealthMinimalResp `json:"health_minimal_resp"`
}
var m... |
PHP | UTF-8 | 3,016 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
/**
* KePHP, Keep PHP easy!
*
* @license https://opensource.org/licenses/MIT
* @copyright Copyright 2015 - 2020 KePHP Authors All Rights Reserved
* @link http://kephp.com ( https://git.oschina.net/kephp/kephp-core )
* @author 曾建凯 <janpoem@163.com>
*/
namespace Ke\Cli\Cmd;
use Ke\App;
use Ke\Cl... |
Swift | UTF-8 | 2,363 | 2.75 | 3 | [] | no_license | //
// PrivateCustomItem.swift
// SimpleNeteaseMusic
//
// Created by shenjie on 2021/1/13.
// Copyright © 2021 shenjie. All rights reserved.
//
import Foundation
import UIKit
let JJINTERVAL: CGFloat = 20
class PrivateCustomItem: UICollectionViewCell {
// stackView
private var stack: UIStackView!
... |
PHP | UTF-8 | 1,088 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BotUser extends Model
{
use HasFactory;
protected $fillable = [
'user_id', 'user_name', 'first_name', 'last_name',
'active', 'current_action', '... |
Markdown | UTF-8 | 2,220 | 3.0625 | 3 | [] | no_license | # Week 5 Journal: Brielle Purnell
This week my API was added to the main working code. I worked on the Cashier's App view and controller.
The two commits that show this work are below:
**Added API**
https://github.com/nguyensjsu/sp21-172-debuggers/commit/34101fe625dad4e799818c374d5c1b36114c16a5
**Updated Cashie... |
Python | UTF-8 | 514 | 3.640625 | 4 | [] | no_license | ############################################################
#
# assert statements
#
############################################################
def CalculateQuartile(percent):
assert type(percent).__name__ == 'int'
assert percent >= 0 and percent <= 100
quartile = 1
if percent > 25:
... |
C# | UTF-8 | 1,153 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media.Imaging;
namespace GravitatioanlSimulation.Writer
{
class GifWriter:IWriter
{
private GifBitmapEncoder _gifBitmapEn... |
Java | UTF-8 | 576 | 2.375 | 2 | [] | no_license | package com.branthragan.vending_machine.state;
import com.branthragan.vending_machine.inventory.InventoryItem;
import com.branthragan.vending_machine.machine.VendingMachine;
public interface VendingState {
String MAKE_A_SELECTION = "Please make a selection";
String SOLD_OUT = "Sold Out";
String INVALID_AC... |
C++ | UTF-8 | 1,641 | 3.015625 | 3 | [] | no_license | //baekjoon 1767
//N-Rook II
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int n, m, k;
long long d[101][101][101];
long long mod = 100001;
/*4가지 경우가 있다.
//d[n][m][k]일때 그 수는 크리 n x m의 상자에 rook을 k개 넣을 수 있는
//경우의 수이다. 룩은 안 넣거나, 1개 넣거나, 2개를 넣을 수 있다. 안 넣는 다면
//d[n-1][m][k-1]이다. 1개를 같은 columnㅇ에 공격하는 룩이... |
Java | UTF-8 | 1,647 | 2.734375 | 3 | [] | no_license | package com.study.utils;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* Created by zbl on 2017/6/23.
*
*/
public class CommonUtil {
/**
* 从request中获得参数Map,并返回可读的Map.
*
* @para... |
Java | UTF-8 | 2,610 | 2.40625 | 2 | [] | no_license | package no.acntech.rules.application.rules;
import no.acntech.rules.application.rules.basis.Person;
import org.jeasy.rules.api.*;
import org.junit.Before;
import org.junit.Test;
import java.time.LocalDate;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static ... |
Java | UTF-8 | 758 | 1.921875 | 2 | [] | no_license | package com.example.bmaz.coscproject;
import android.os.Bundle;
import android.support.v4.app.Fragment;
/**
* A simple {@link Fragment} subclass.
*/
public class LocalAttractionsTab extends ParentFragmentLayout {
public LocalAttractionsTab() {
// Required empty public constructor
}
@Override
... |
Python | UTF-8 | 2,608 | 3.125 | 3 | [] | no_license | #Import dependencies
import pandas as pd
import csv, sqlite3
from sqlite3 import Error
#Function to connect to database
def create_connection(db_file):
""" create a database connection to the SQLite database
specified by db_file
:param db_file: database file
:return: Connection object or None
"... |
PHP | UTF-8 | 3,710 | 2.671875 | 3 | [] | no_license | <?php
class SinaOauth {
private $_host = "http://api.t.sina.com.cn/";
private $_sha1Method;
private $_consumer;
private $_token;
public function accessTokenURL() {
return 'http://api.t.sina.com.cn/oauth/access_token';
}
public function authenticateURL() {
return 'http://api.t.sina... |
Java | UTF-8 | 589 | 2.859375 | 3 | [] | no_license | package com.example.administrator.myapp;
public class Events {
private String date;
private String time;
private String thing;
public Events(String date, String time,String thing){
this.date = date;
this.time = time;
this.thing = thing;
}
public String getDate(){return... |
Java | UTF-8 | 14,715 | 2.21875 | 2 | [] | no_license | package strategyimpl.fundrank;
import CalculateTool.CalculateTool;
import blimpl.CalculateDataHandler;
import com.mathworks.toolbox.javabuilder.MWException;
import com.mathworks.toolbox.javabuilder.MWNumericArray;
import dataservice.BaseInfoDataService;
import dataserviceimpl.DataServiceController;
import entities.Con... |
Python | UTF-8 | 2,608 | 2.8125 | 3 | [] | no_license | from os.path import dirname
import util
import inspect
import reader
from util import Struct
import sys
#simple requirement for Bhumibol Dam
#unit here M-m^3 = million m^3
#water lvl is betwen 13462(capacity) and 4000 M-m^3(historical low)
#out flow capacity is 60M-m^3/day but in rainy season maximum is 30M-m^3/day ... |
Java | UTF-8 | 994 | 2.15625 | 2 | [] | no_license | package com.exercise.gmsys.imp;
import com.exercise.gmsys.mapper.DepartmentMapper;
import com.exercise.gmsys.model.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class DepartmentServiceImp {
@Autowi... |
Java | UTF-8 | 1,968 | 3.015625 | 3 | [] | no_license | package suite04;
import org.junit.Test;
import srdk.theDrake.*;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import static org.junit.Assert.assertEquals;
public class ActionsTest {
private Set<Move> makeSet(Move ...moves) {
Set<Move> result = new HashSet<Move>();
for(Move m : ... |
Python | UTF-8 | 154 | 3 | 3 | [] | no_license | n = int(input())
a = map(int, input().split())
a = sorted(a)
a.reverse()
ans = 0
for i, v in enumerate(a):
if i % 2 == 0:
ans += v
print(ans)
|
JavaScript | UTF-8 | 2,268 | 4.09375 | 4 | [
"MIT"
] | permissive | // This is a solo challenge
// Your mission description:
// Move Theozy in an 'S' formation
// Execute an attack
// Move back to Theozy's original position
// Pseudocode
// Move object right
// Move object up
// Move object left
// Move object up
// Move object right
// Execute the attack method
// Move object left
... |
C# | UTF-8 | 509 | 2.515625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WaterCreator : MonoBehaviour
{
// Start is called before the first frame update
[SerializeField] GameObject water;
void Start()
{
for(int i = 0; i <= 50; i++)
{
for (int j = 0; j <= ... |
Java | UTF-8 | 5,708 | 1.960938 | 2 | [] | no_license | package com.example.myprivacy;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
//import com.squareup.picasso.Picasso;
import android.os.AsyncTask;
import a... |
Java | UTF-8 | 7,792 | 1.664063 | 2 | [] | no_license | package com.example.a69477.myapplication;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import... |
C# | UTF-8 | 4,911 | 3.25 | 3 | [] | no_license | namespace OutLookAR
{
public struct ArrayMat
{
double[,] _data;
public double[,] ToArray { get { return _data; } }
public int Rows { get { return _data.GetLength(0); } }
public int Cols { get { return _data.GetLength(1); } }
public double At(int row, int col) { return _d... |
Rust | UTF-8 | 1,021 | 3.09375 | 3 | [
"MIT"
] | permissive | //use utils;
//mod utils;
pub mod entities {
use utils::*;
use extra::time::Timespec;
#[deriving(Eq, ToStr)]
enum EntityType {
Hero,
Enemy
}
impl EntityType {
fn to_str(&self) -> ~str {
match *self {
Hero => ~"Hero",
Enemy => ~"Enemy",
}
}
}
#[deriving(Eq, ToStr)]
pub struct Entity... |
Java | UTF-8 | 2,520 | 2.84375 | 3 | [] | no_license | package main.component.chart.data;
import java.util.Collections;
import java.util.List;
import main.component.chart.data.calculator.ICalculator;
public class MetaData<N extends Number> implements IMetaDataSet{
private String name = "";
public List<N> data = Collections.emptyList();
public ICalculator<N> calculat... |
C++ | UTF-8 | 1,045 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <utility>
using namespace std;
#if defined(o1)
class Solution {
public:
void swap(int& a, int& b)
{
a = a ^ b;
b = a ^ b;
a = a ^ b;
}
void nextPermutation(vector<int>& nums) {
int size... |
Java | UTF-8 | 2,447 | 2.625 | 3 | [] | no_license | package cn.huhuiyu.dao;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import cn.huhuiyu.entity.TbGoods;
public class TbGoodsDAO extends BaseDAO {
public static final String INSERT = "insert into TbGoods(gname,ginfo,price,amount) values(?,?,?,?) ";
... |
Python | UTF-8 | 611 | 3.390625 | 3 | [] | no_license | from dados.observer import Observer
class Tabela(Observer):
"""
Classe responsavel por observar os dados e imprimi-los em forma de tabela.
"""
def __init__(self, dados):
"""
Inicializa os dados.
"""
super().__init__(dados)
def atualiza(self):
"""
... |
C# | UTF-8 | 1,608 | 3.09375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class Publisher
{
public string _pubid;
public string _pub;
public string _state;
public string _country;
public string _city;
... |
Java | UTF-8 | 1,498 | 2.203125 | 2 | [] | no_license | package mx.ipn.americamartinezandevelinecruz.login;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class... |
Java | UTF-8 | 925 | 2.640625 | 3 | [] | no_license | package bank;
import data.ManagerBank;
import data.ManagerUsers;
import utils.Utils;
import java.text.DecimalFormat;
import java.util.Scanner;
/**
* Created by user on 19/01/16.
*/
public class GetBankInformation {
ManagerBank mb;
ManagerUsers mu;
public GetBankInformation() {
this.mb = new M... |
Java | UTF-8 | 2,795 | 4.15625 | 4 | [] | no_license | /*
*Assignment 1, Movie Ratings
*
*For this assignment, write a program that will aggregate a set of movie ratings for a new film, entitled AP CSA: The Movie! Your program will compute an overall movie rating as a weighted average of ratings from a popular movie review website, ratings given by a private focus group... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.