language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 3,708 | 2.515625 | 3 | [] | no_license | using DataOperations.DBEntity;
using DataOperations.DBEntityManager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
namespace CSOutreach.Pages.Common
{
... |
PHP | UTF-8 | 866 | 2.84375 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | <?php
include_once "config/database.php";
include_once "objects/product.php";
$db_conn = new Database();
$product = new Product($db_conn->getConnection());
$product_read = $product->read();
//var_dump($product_read->fetchAll());
//
while ($row = $product_read->fetch(PDO::FETCH_ASSOC)) {
// extract row
// this wil... |
Python | UTF-8 | 3,245 | 4.3125 | 4 | [] | no_license | # Demonstrates various list methods
from collections import deque
from functools import reduce
import bisect
# List names are plural by convention
# Lists are considered mutable objects, thus when var = list is used, the list
# is passed by reference instead of by value. As a result, any changes to list
# will affect ... |
Markdown | UTF-8 | 7,043 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | ---
parent: Conventions
---
# Action menus
## Kebab and resource Actions menus
- A resource's Actions menu is accessible from a number of places, such as:
1. List view kebab
2. Details page actions dropdown
3. Topology side panel
4. Topology right-click action on a resource
- By default, submenus will open t... |
JavaScript | UTF-8 | 958 | 3.046875 | 3 | [] | no_license | 'use strict';
(function () {
// Variables
var coatColors = ['rgb(101, 137, 164)', 'rgb(241, 43, 107)', 'rgb(146, 100, 161)', 'rgb(56, 159, 117)', 'rgb(215, 210, 55)', 'rgb(0, 0, 0)'];
var eyesColors = ['black', 'red', 'blue', 'yellow', 'green'];
var fireballColors = ['#ee4830', '#30a8ee', '#5ce6c0', '#e848d5... |
Ruby | UTF-8 | 3,170 | 3.203125 | 3 | [
"MIT"
] | permissive | Foo::bar
::Bar
puts ::Foo::Bar
foo[bar]
foo[*bar]
foo[* bar]
foo[]
foo["bar"]
foo[:bar]
foo[bar] = 1
()
;
yield
yield foo
yield foo, bar
not foo
foo and bar
foo or bar
a or b and c
defined? foo
defined? Foo.bar
defined?(foo)
defined?($foo)
defined?(@foo)
defined?(@äö)
x = y
x ... |
C | UTF-8 | 555 | 3.109375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void __gen_params(char *str, int n, int curpos, int l , int r) {
if(curpos == 2*n) {
str[curpos] = '\0';
printf("%s\n",str);
return;
}
if(l < n) {
str[curpos] = '(';
__gen_params(str, n , curpos+1, l+1, r);
}
if(r < l) {
str[curpos] = ')';
__ge... |
Markdown | UTF-8 | 7,348 | 2.828125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | ---
title: "Data Transformations with LINQ (C#) | Microsoft Docs"
ms.custom: ""
ms.date: "2015-07-20"
ms.prod: .net
ms.reviewer: ""
ms.suite: ""
ms.technology:
- "devlang-csharp"
ms.topic: "article"
dev_langs:
- "CSharp"
helpviewer_keywords:
- "LINQ [C#], data transformations"
- "source elements [LINQ in C#... |
Java | UTF-8 | 5,065 | 2.328125 | 2 | [] | no_license | package com.example.konrad.trainingtracker;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import com... |
JavaScript | UTF-8 | 1,863 | 3.21875 | 3 | [] | no_license | import { useState, useEffect, useRef } from "react";
import styles from "./Clock.module.css";
export default function Clock() {
const [time, setTime] = useState(() => new Date());
const intervalId = useRef(null);
useEffect(() => {
intervalId.current = setInterval(() => {
console.log("Это интервал кажд... |
Java | UTF-8 | 4,739 | 3.078125 | 3 | [] | no_license | package tk.simplaysgames.messenger;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
im... |
Python | UTF-8 | 3,700 | 3.296875 | 3 | [] | no_license | def getnumber(self):
#This function will be used to get the number of goals we want to reach at the end
rospy.init_node('listener', anonymous=True) #we create our code
while self.number < 1: #we don't want a number of goals less than 1 so we
#create a loop... |
JavaScript | UTF-8 | 682 | 4.21875 | 4 | [] | no_license | //function should return true or false if string is a palindrome
function isPalindrome(str) {
str = str.toLowerCase();
for (var i = 0; i < str.length; i++) {
if (str[i] === "!" || str[i] === "," || str[i] === "?" || str[i] === " ") {
str = str.replace(str[i], "");
i--;
... |
Java | UTF-8 | 836 | 3.484375 | 3 | [] | no_license | package gui.observer;
import java.util.ArrayList;
/**
* Klasa koja sadrzi listu observera koji ce biti
* odrzavani klasom Observable.
*
* @author Vanja Paunovic
*
*/
public class ObserverList {
private ArrayList<MainObserver> observers;
public ObserverList() {
observers = new ArrayList<>();
}
/**
... |
JavaScript | UTF-8 | 648 | 3.296875 | 3 | [
"MIT"
] | permissive | function solution(a, b) {
var temp = 0;
var result = b
.split('')
.map(val => {
if (val === 'U') {
temp = temp + 1
} else {
temp = temp - 1
}
return temp;
})
.reduce((acc, val, i, arr) => {
... |
Java | UTF-8 | 1,998 | 2.875 | 3 | [] | no_license | package com.mdoa.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.... |
Python | UTF-8 | 383 | 3.46875 | 3 | [] | no_license | # this program is used to safe open file
def safeopen(path):
try:
f = open(path, 'r')
return f
except IOError:
return None
def printf(f):
for line in f:
print line,
input_file = raw_input("input file name:")
f = safeopen(input_file)
if f is not None:
printf(f)
f.... |
C | UTF-8 | 1,084 | 3.671875 | 4 | [] | no_license | /*
** EPITECH PROJECT, 2018
** my_put_nbr.c
** File description:
** my_put_nbr
*/
#include <unistd.h>
#include "../../../include/my.h"
void print_nbr(void)
{
my_putchar('-');
my_putchar('2');
my_putchar('1');
my_putchar('4');
my_putchar('7');
my_putchar('4');
my_putchar('8');
my_putcha... |
Java | UTF-8 | 1,510 | 2.09375 | 2 | [
"BSD-3-Clause"
] | permissive | package de.wiosense.webauthn.util.database;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Transaction;
import androidx.room.Update;
import java.util.List;
import de.wiosense.webauthn.models.Publ... |
JavaScript | UTF-8 | 600 | 3.609375 | 4 | [] | no_license | function queryAb(str) {
if (!str || str.length < 2) {
return -1;
}
let i = 0;
while(i < str.length - 1) {
let curChar = str[i]
let nextChar = str[i + 1]
if (curChar === 'a') {
if (nextChar === 'b') {
return i;
} else {
... |
Java | UTF-8 | 1,405 | 2.078125 | 2 | [] | no_license | package com.sys.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.sys.model.DataGridResult;
import com.sys.m... |
Python | UTF-8 | 929 | 2.65625 | 3 | [] | no_license | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget
from PyQt5.QtCore import Qt, QUrl
from PyQt5.QtQuick import QQuickView
class MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.setWindowTitle("Qt Combo Demo")
widget= Q... |
C++ | UTF-8 | 1,603 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "renderer.h"
#include "shaders.h"
namespace gui
{
/*************************************************
** Basic Gui Renderer
*************************************************/
GuiRenderer::GuiRenderer(gl::Renderer glRenderer, gl::ShaderCreator shaderCreator, gl::IRenderer::Viewport viewport)
: glRenderer... |
Markdown | UTF-8 | 1,110 | 2.609375 | 3 | [] | no_license | Developing-Data-Products-Assignment
===================================
Coursera Course: Developing Data Products
Assignment Submission Files
- [ui.R](https://github.com/proshanta/DevelopingDataProductsAssignment/blob/master/ui.R)
- [server.R](https://github.com/proshanta/DevelopingDataProductsAssignment/blob/master/... |
Python | UTF-8 | 3,598 | 2.828125 | 3 | [] | no_license |
##########################
### Imports
##########################
## Standard Library
import os
## External Libraries
import joblib
import numpy as np
import pandas as pd
from langcodes import Language
## Local
from ..util.logging import initialize_logger
##########################
### Helpers
####################... |
Python | UTF-8 | 8,225 | 2.953125 | 3 | [] | no_license | #%%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
data = pd.read_csv('data/tick-levelII/bu1912 (6).csv', header=None)
#%%
plt.plot(data[4])
plt.show()
#%%
#思路:当价格达到一段时间内的最大值或者最小值,且做空、做空方,即卖方或买方前三档的挂单量明显大于对手方
#加减仓数手数,成交价格,开平仓,最新成交价, 总仓位,PNL
vol... |
Java | UTF-8 | 6,311 | 2.8125 | 3 | [] | no_license | package kr.gov.dao;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import kr.gov.dto.Product;
public class ProductRepository {
private ArrayList<Product> listOfProducts = new ArrayList<>();
//Pro... |
Markdown | UTF-8 | 2,650 | 2.859375 | 3 | [] | no_license | # insertPluginFunctionNameHere Noteplan Plugin
[You will delete this text and replace it with a readme about your plugin -- not ever seen by users, but good for people looking at your code. Before you delete though, you should know:]
You do not need all of this scaffolding for a basic NP plugin. As the instructions s... |
Java | UTF-8 | 1,685 | 3.109375 | 3 | [] | no_license | import java.io.*;
import java.util.*;
public class J {
public static Map<Character, Integer> v;
public static Map<Integer, Character> vInv;
public static void main(String [] args) throws IOException {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
initV();
int n = Integer.pa... |
Python | UTF-8 | 737 | 4.25 | 4 | [] | no_license | class Animal():
def walk(self):
print("걷는다")
def eat(self):
print("먹는다")
class Human(Animal):
def wave(self):
print("손을 흔든다")
class Dog(Animal):
def wave(self):
print("꼬리를 흔든다")
person = Human()
person.walk()
person.eat()
person.wave()
dog = Dog()
dog.walk()
dog... |
Ruby | UTF-8 | 304 | 2.53125 | 3 | [] | no_license | require "character_count"
describe "#character_count" do
specify do
expect(character_count(["a", "bc", "def"])).to eq(6)
end
it "calls itself" do
expect(self).to receive(:character_count)
.at_least(:twice)
.and_call_original
character_count(["a", "bc", "def"])
end
end
|
Java | UTF-8 | 4,367 | 2.171875 | 2 | [] | no_license | package steps.Qapter;
import cases.TestBase;
import com.aventstack.extentreports.Status;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import pageobjects.processstep.DamageCapturingPO;
import steps.DamageCapturing;
import java.util.List;
import java.util.Map;
import static utils.webd... |
Java | UTF-8 | 6,399 | 2.3125 | 2 | [
"Apache-2.0"
] | permissive | package com.diguits.domainmodeldesigner.template.models;
import javafx.beans.property.ListProperty;
import javafx.beans.property.SimpleListProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ListCha... |
Python | UTF-8 | 1,189 | 2.90625 | 3 | [] | no_license | import websockets
import asyncio
import json
class Connection:
def __init__(self):
self.url = "ws://127.0.0.1:7890"
self.player = {}
self.connect()
def getPlayer(self):
return self.player
def connect(self):
async def listen(self):
async with websockets... |
Markdown | UTF-8 | 791 | 2.953125 | 3 | [] | no_license | # 파라미터를 받는 방법들
## 파라미터로 전달
```java
@GetMapping(value= "vie")
public String vie(int no) {
// no 로 바로 접근
...
}
```
- @RequestParam을 사용하면 해당 파라미터 값이 없을때 해당 로직을 실행하지 않고 400err를 발생시킨다.
```java
@GetMapping(value= "vie")
public String vie(@RequestParam(value="cha_no") int no) ... |
C++ | UTF-8 | 1,084 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_CONNECTION_COLLECTION_H_
#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_CONNECTION_COLLECTION_H_
#include <cstdin... |
JavaScript | UTF-8 | 3,701 | 2.6875 | 3 | [] | no_license | import React, {useState, useEffect} from "react";
import Trailer from "./page2/Trailer";
import informationIcon from "../../assets/informationIcon.gif"
function Header({apiKey, apiUrl, totalPagesCount, moviesDataLength, poster_prefixURL, setSuffix, setmovieCateogry, broken_path, setMovie, movie, toggleHeaderInfo, setTo... |
PHP | UTF-8 | 3,846 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Match;
use App\Team;
use App\Standing;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class MatchController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function inde... |
Markdown | UTF-8 | 12,273 | 3.34375 | 3 | [] | no_license | # **SQL**
## **Reporting**
Some ways to handle data:
- Ordering (e.g. sort products alphabetically or by price, movies by year, articles by date, sorting contacts)
- Limiting (e.g. retrieve lastest articles, paging through archive)
- Manipulating Text (e.g. standarizing output: lowercase emails, uppercase last nam... |
Markdown | UTF-8 | 1,015 | 3.046875 | 3 | [] | no_license | # Watercooler Gossip: Dream or Nightmare?
**Advanced** level
### Chinese Text
开辟鸿蒙,谁为情种?都只为风月情浓。奈何天,伤怀日,寂寥时,试遣愚衷。因此上演出这悲金悼玉的“红楼梦”。
### Pinyin and Translation
|说人|句子|
|----|----|
||开辟鸿蒙,谁为情种?都只为风月情浓。奈何天,伤怀日,寂寥时,试遣愚衷。因此上演出这悲金悼玉的“红楼梦”。<blockquote><br /></blockquote>|
### Vocab
|汉子|拼音|英文|词类|
|----|----|----|----|
|丫鬟|yāhu... |
JavaScript | UTF-8 | 1,184 | 3 | 3 | [] | no_license | let http = require('http');
// http基于tcp
// let server = http.createServer(function(req,res){
// });
let server = http.createServer();
// 监听的方法和上面的方法等效;
server.on('connection', function (req, res) {
console.log('connection')
});
server.on('close', function (req, res) {
});
server.on('error', function (req, res) ... |
Python | UTF-8 | 8,862 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | # -*- python -*-
import requests
from . import writer
from . import reader
from . import metadata
from . import graphite
from . import deleter
class KairosDBConnection(object):
"""
:type server: str
:param server: the host to connect to that is running KairosDB
:type port: str
:param port: the por... |
Ruby | UTF-8 | 12,679 | 3.171875 | 3 | [
"MIT"
] | permissive | require 'pp'
module RbbCode
module CharCodes
CR_CODE = 13
LF_CODE = 10
L_BRACK_CODE = 91
R_BRACK_CODE = 93
SLASH_CODE = 47
LOWER_A_CODE = 97
LOWER_Z_CODE = 122
UPPER_A_CODE = 65
UPPER_Z_CODE = 90
end
class Node
def << (child)
@children << child
end
attr_accessor :children
... |
Ruby | UTF-8 | 1,214 | 2.953125 | 3 | [] | no_license | # Open and Read file
File.open("wordlist", "r") do |file|
file.each do |line|
puts line
end
end
File.open("wordlist", "r") do |file|
file.each_line do |line|
puts line
end
end
File.open("wordlist", "r") do |file|
while line = file.gets
puts line
end
end
File.open("wordlist", "r") do |file|
... |
Java | UTF-8 | 260 | 1.640625 | 2 | [] | no_license | package com.nespot2.springrestsample.item.repository;
import com.nespot2.springrestsample.item.domain.ItemDetail;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ItemDetailRepository extends JpaRepository<ItemDetail, Long> {
}
|
C++ | UTF-8 | 729 | 2.875 | 3 | [] | no_license | #include "Numeros_Complexos_Polares.h"
#include <cmath>
Numeros_Complexos_Polares::Numeros_Complexos_Polares(Numeros_Complexos um_numero_complexo)
{
this->Set_Real(um_numero_complexo.Get_Real());
this->Set_Imaginario(um_numero_complexo.Get_Imaginario());
Conformar_Numero();
}
void Numeros_Complexos_Polar... |
Python | UTF-8 | 12,449 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | import numpy as np
import keras.backend as T
from keras.metrics import categorical_accuracy, mean_squared_error
from ellipse_fit import get_ellipse_kaggle_par
def lr_function(e, lrs):
for i in xrange(e, -1, -1):
if i in lrs:
return lrs[i]
def kaggle_MultiRotMergeLayer_output(x, num_views=2):... |
Java | UTF-8 | 3,499 | 3.15625 | 3 | [] | no_license | package automail;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Stream;
/** This class represents the input properties of the simulation. */
public class Properties {
private Integer seed = null;
private int maxFloor;
private double... |
Go | UTF-8 | 2,535 | 2.609375 | 3 | [
"MIT"
] | permissive | package webhook_test
import (
"testing"
"github.com/manyminds/api2go/jsonapi"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/smartcontractkit/chainlink/core/services/job"
"github.com/smartcontractkit/chainlink/core/services/webhook"
)
func TestV... |
Java | UTF-8 | 5,675 | 2.453125 | 2 | [] | no_license | package com.bb.db;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.bb.... |
Python | UTF-8 | 1,177 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | import cryptanalib as ca
import feathermodules
def single_byte_xor_attack(ciphertexts):
options = dict(feathermodules.current_options)
results = []
print '[+] Running single-byte XOR brute force attack...'
try:
num_answers = int(options['number_of_answers'])
except:
return '[*] Could not int... |
Java | UTF-8 | 3,795 | 2.34375 | 2 | [] | no_license | package com.ceribit.android.lazynotes;
import android.database.Cursor;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.support.v4.app.Fragme... |
Java | UTF-8 | 690 | 2.203125 | 2 | [
"MIT"
] | permissive | package br.com.fatecmogidascruzes.config.captcha;
import java.util.HashMap;
import java.util.Map;
public class ReCaptchaUtil {
public static final Map<String, String> RECAPTCHA_ERROR_CODE = new HashMap<>();
static {
RECAPTCHA_ERROR_CODE.put("missing-input-secret", "The secret parameter is missing");
RECAPTCHA... |
Markdown | UTF-8 | 4,832 | 3.234375 | 3 | [] | no_license | ---
title: Overview
---
The XCaliber Gaming Platform API uses [OAuth 2](https://tools.ietf.org/html/rfc6749) for authentication and it implements some extensions to it for some advanced scenarios.
## What is OAuth 2?
OAuth 2 is an authorization framework that enables applications to obtain access to user accounts on ... |
JavaScript | UTF-8 | 1,234 | 3.703125 | 4 | [] | no_license | var cand1 = 0;
var cand2 = 0;
var votN = 0;
var votB = 0;
perCand1 = 0;
perCand2 = 0;
perBranco = 0;
perNulo = 0;
var soma = 0;
function votar() {
var voto = parseInt(document.getElementById('numero').value)
switch (voto) {
case 1:
cand1 = cand1 + 1;
alert("Você votou no candid... |
JavaScript | UTF-8 | 2,625 | 3.203125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const shuffle = require('../../../../src/common/utils/shuffle');
describe('shuffle', () => {
test('Should return a shuffle array (same size, different order)', async () => {
// arrange
const tArray = [1,2,3,4,5,6,7,8,9];
// act
const result = shuffle(tArray);
// assert
expect(result).toHaveLe... |
Markdown | UTF-8 | 942 | 2.8125 | 3 | [
"MIT"
] | permissive | # Adversarial Attack on Multimodal Fusion Systems
## Experiment plan 1 Baseline Attack-FGSM
### 1. Description
Simply modify the inputs based on backpropagation using FGSM in the trained model. The FGSM attacking method is given by the following formula

Where $\epsilon$ is the step size for... |
C++ | UTF-8 | 612 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | #ifndef __NET_SOCKET_H__
#define __NET_SOCKET_H__
#include <string>
using namespace std;
namespace net {
class PacketHead{
unsigned long dataLen;
char *data;
};
class Socket {
public:
Socket();
Socket(int sockfd);
~Socket();
void listen(int port);... |
JavaScript | UTF-8 | 166 | 2.875 | 3 | [] | no_license | function validTime(time) {
let hours = time.split(':')[0]
let minutes = time.split(':')[1]
return hours < 24 && minutes < 60
}
console.log(validTime("13:58")) |
JavaScript | UTF-8 | 1,741 | 2.546875 | 3 | [
"MIT"
] | permissive | import Audius from './audius';
import AbstractHTML5AudioPlayer from './abstract_html5_audio_player';
export default class AudiusStreamPlayer extends AbstractHTML5AudioPlayer {
constructor(song, options = {}) {
super();
this.disposed = false;
this.player = document.createElement('audio');
if (options.... |
Python | UTF-8 | 189 | 3.8125 | 4 | [] | no_license | def IsPointInSquare(x,y):
if (x**2+y**2)**0.5 <=(2)**0.5:
return 'Yes'
else:
return 'No'
x = float(input())
y = float(input())
print(IsPointInSquare(x,y))
|
Ruby | UTF-8 | 118 | 2.9375 | 3 | [] | no_license | puts "Comme tu t'apples? "
prenom = gets.chomp
puts "et ton nom? "
nom = gets.chomp
puts "salut #{ prenom } #{ nom }"
|
Rust | UTF-8 | 1,497 | 2.96875 | 3 | [
"BSD-2-Clause"
] | permissive | use crate::math::{Point, Vector};
use na::{RealField, Unit};
/// Kernel functions for performing approximations within the PBF/SPH methods.
pub trait Kernel: Send + Sync {
/// Evaluates the kernel for the given scalar `r` and the reference support length `h`.
fn scalar_apply<N: RealField>(r: N, h: N) -> N;
... |
Rust | UTF-8 | 2,217 | 2.828125 | 3 | [
"MIT"
] | permissive | // some code taken and adapted from RLS and cargo
#[derive(Debug, Default, Clone)]
pub struct Version {
pub major: u8,
pub minor: u8,
pub patch: u16,
pub dash_pre: String,
pub code_name: Option<String>,
pub commit_describe: Option<String>,
pub commit_date: Option<String>,
}
impl Version {
... |
Markdown | UTF-8 | 1,268 | 2.875 | 3 | [] | no_license | # The ROS2 OpenCV Camera Package
This is a ROS2 package with a publisher node that uses OpenCV to
publish raw images from a camera onto a topic called `image_raw`.
Since the package is based on OpenCV, any camera that's supported
in OpenCV can be used with this package. And because this package publishes raw camera i... |
PHP | UTF-8 | 1,463 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateResultsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('results', funct... |
Java | UTF-8 | 2,462 | 1.828125 | 2 | [
"Apache-2.0"
] | permissive | package io.sitoolkit.cv.core.app.crud;
import io.sitoolkit.cv.core.app.functionmodel.FunctionModelService;
import io.sitoolkit.cv.core.domain.classdef.ClassDef;
import io.sitoolkit.cv.core.domain.crud.CrudMatrix;
import io.sitoolkit.cv.core.domain.crud.CrudProcessor;
import io.sitoolkit.cv.core.domain.crud.SqlPe... |
Markdown | UTF-8 | 1,790 | 2.734375 | 3 | [] | no_license | # Article L264-1
L'exécution de tous travaux qui seraient de nature à compromettre la sécurité du réservoir souterrain ou à troubler son
exploitation est réglementée ou interdite par l'autorité administrative, même à l'égard du propriétaire des terrains, à
l'intérieur du périmètre de stockage et d'un périmètre de prot... |
Python | UTF-8 | 4,233 | 2.734375 | 3 | [] | no_license | from Queue import Queue
import wave
import math
import numpy as np
import struct
from itertools import izip
import operator
flatten = lambda l: [item for sublist in l for item in sublist]
def getChannel (data, ch):
pairs = zip(data[::2], data[1::2])
ret = []
ret.append(flatten(pairs[0::2]))
ret.appen... |
Markdown | UTF-8 | 6,921 | 2.8125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "Visual Studio Live: DC"
---

This year I decided to try to attend my first software development conference, and it ended up being [Visual Studio Live](http://vslive.com/) in Washington DC. The conference just conclu... |
Shell | UTF-8 | 1,595 | 3.328125 | 3 | [
"MIT"
] | permissive | # This script runs the (potentially parallel) algorithm to generate a 3D mesh and 1D fiber meshes for the biceps muscle.
# Input is a representation of the biceps surface which is already given in the input directory.
# Output is a *.bin file that contains the points of the fibers.
# parameters for this script
use_neu... |
C++ | UTF-8 | 405 | 3.34375 | 3 | [] | no_license | #include<stdio.h>
int strlen(const char* str){
int i=0;
while(str[i]!='\0')
i++;
return i;
}
void sub(char *dest,char *src,char ch){
int length=strlen(src);
int j=0;
for (int i = 0; i <= length; i++)
{
if(src[i]!=ch){
dest[j]=src[i];
j++;
}
else{
dest[j]=' ';
j++;
}
}
}
int main(){
char ... |
TypeScript | UTF-8 | 3,331 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
* Copyright (c) 2018 Bitbloq (BQ)
*
* License: MIT
*
* long description for the file
*
* @summary short description for the file
* @author David García <https://github.com/empoalp>, Alberto Valero <https://github.com/avalero>
*
* Created at : 2018-11-16 17:30:44
* Last modified : 2019-01-31 10:37:34... |
Python | UTF-8 | 540 | 2.640625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | import pandas as pd
import matplotlib.pyplot as plt
from mpldatacursor import datacursor
csv_GAN=pd.read_csv('Loss_G_GAN.csv')
csv_L1=pd.read_csv('Loss_G_L1.csv')
fig, ax = plt.subplots()
lines = ax.plot(csv_GAN.columns.astype(int),csv_GAN.get_values().reshape(len(csv_GAN.columns),), '*-')
datacursor(lin... |
Java | UTF-8 | 2,006 | 1.898438 | 2 | [] | no_license | package com.xiaodou.server.mapi.domain;
public class OfficialInfo {
private String realName;
private String gender;
private String phoneNum;
private String admissionCardCode;
private String identificationCardCode;
private String majorCode;
private String majorName;
private String courseCode;
... |
PHP | UTF-8 | 999 | 2.671875 | 3 | [] | no_license | <?php namespace BCD\Forms;
use Laracasts\Validation\FormValidator;
class RegisterGroupForm extends FormValidator {
/**
* Validation rules for registering a participant
*
* @var array
*/
protected $rules = [
'registration_type' => 'required',
'first_name_1' => 'required|max:60|min:2',
'middle_name_1' ... |
Java | UTF-8 | 1,607 | 3.6875 | 4 | [] | no_license | package com.leetcode.challenges.march;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class DollEnvelopes {
public int maxEnvelopes(int[][] envelopes) {
// l'entrée c'est un matrice de n lignes et 2 colonnes
// je calcule la surface d'un envelope
// je déclare un objet de... |
C++ | UTF-8 | 997 | 3.125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
template<typename T>
class Graph{
map<T,vector<T>> adjList;
public:
void addEdge(T x, T y){
adjList[x].push_back(y);
adjList[y].push_back(x);
}
void dfsHelper(T src,map<T,bool> &visited){
cout<<src<<" ";
visited[src] =... |
C++ | UTF-8 | 4,443 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef PQTABLE_PQ_TABLE_H
#define PQTABLE_PQ_TABLE_H
// PQTable
// Y. Matsui, T. Yamasaki, and K. Aizawa, "PQTable: Non-exhaustive Fast Search for
// Product-quantized Codes using Hash Tables", arXiv 2017
//
// Usage:
// vector<vector<float>> train_vecs = /* set vec */
// vector<vector<float>> base_vecs = /* set... |
C# | UTF-8 | 1,732 | 2.59375 | 3 | [
"MIT"
] | permissive | using System;
using System.Linq;
using System.Linq.Expressions;
namespace Atlassian.Jira.Linq
{
public class JiraQueryProvider : IQueryProvider
{
private readonly IJqlExpressionVisitor _translator;
private readonly IIssueService _issues;
public JiraQueryProvider(IJqlExpressionVisitor ... |
Python | UTF-8 | 3,181 | 3.953125 | 4 | [] | no_license | import numpy
'''
Experiment performed 10000 times
'''
x = numpy.zeros((10000,2))
y = numpy.zeros((10000,3))
z = numpy.zeros((10000,5))
'''
Convert this problem from 2-D to 1-D representation
Each point in 2-D mapped to a line segment 0 to 2*pi
Random selections of points from the circumference
'''... |
Markdown | UTF-8 | 3,372 | 2.625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Access from Container Instances
description: Learn how to provide access to images in your private container registry from Azure Container Instances by using an Azure Active Directory service principal.
ms.topic: article
ms.custom: devx-track-azurecli
author: tejaswikolli-web
ms.author: tejaswikolli
ms.date:... |
Swift | UTF-8 | 433 | 3.03125 | 3 | [] | no_license |
import Foundation
import SDWebImage
extension UIImageView {
enum UseType {
case assist
}
func nc_typeImage(url: String, type: UseType = .assist) {
nc_imageSet(url: url, placeImage: nil)
}
func nc_imageSet(url: String,placeImage: UIImage? = nil) {
... |
Swift | UTF-8 | 4,033 | 2.65625 | 3 | [
"MIT"
] | permissive | //
// NextLevel+Foundation.swift
// NextLevel (http://github.com/NextLevel/)
//
// Copyright (c) 2016-present patrick piemonte (http://patrickpiemonte.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to ... |
C++ | UTF-8 | 702 | 3.546875 | 4 | [] | no_license | class Solution{
public:
// arr: input array
// num: size of array
//Function to find maximum circular subarray sum.
int circularSubarraySum(int arr[], int num){
int max = arr[0];
int max_1 = arr[0];
int first_ele_pos = 0;
for (int i = 1; i < 2 * (num - 1); i++) {
int index = (i > ... |
Java | UTF-8 | 462 | 1.664063 | 2 | [] | no_license | package org.robins.io.pubnub.api.domain;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Integration {
@SerializedName("type")
@Expose
public String type;
@SerializedName("source")
@Expose
public String source;
@Serial... |
Python | UTF-8 | 2,257 | 2.5625 | 3 | [] | no_license | import os
import sys
import pandas as pd
ope = os.path.exists
opj = os.path.join
def read_and_format(path, source):
print(f"processing {path} {source}")
t = pd.read_csv(path, sep="\t", index_col="recordingmbid")
all_tags = []
genre_columns = [c for c in t.columns if "genre" in c]
for ts in zip(*... |
Java | UTF-8 | 147,432 | 1.5 | 2 | [] | no_license | package gov.noaa.nws.ncep.viz.resourceManager.ui.createRbd;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EventObject;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.Action;
im... |
Python | UTF-8 | 3,228 | 3.0625 | 3 | [] | no_license | import pygame
from pygame import locals as const
from constantes import *
class Selectors:
def __init__(self, ecran):
self.ecran = ecran
self.list = {}
def add(self, valName, values, pos):
self.list[valName] = Selector(self.ecran,valName,values,pos,SELECTOR_SIZE)
def collide(sel... |
Java | UTF-8 | 1,109 | 2.21875 | 2 | [] | no_license | package trong.lixco.com.jpa.entities;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import trong.lixco.com.jpa.entity.AbstractEntity;
@Entity
@Table(name = "skill")
public class Skill extends AbstractEntity {
private String name;
private String description;
pr... |
C++ | GB18030 | 1,214 | 2.625 | 3 | [] | no_license | #pragma once
#include "TGXML.h"
#include "GString.h"
typedef Cactus::vector<Cactus::String>::type StringVector;
COMMONUTIL_API extern StringVector split( const Cactus::String& str, const Cactus::String& delims = "\t\n ", unsigned int maxSplits = 0);
/*
XMLConfigReaderڶȡXMLãݴXMLPATHROOTµĽڵ㿪ʼңڣ
<root>
<net... |
C++ | UTF-8 | 2,770 | 2.890625 | 3 | [] | no_license | #include <functional>
#include <bits/stdc++.h>
using namespace std;
class ThreadPool{
private:
int size;
atomic<int> disponibles;
condition_variable cv;
mutex mtx,qmtx;
queue<function<void(void)>> tareas;
void waitforwork(){
}
public:
ThreadPool(int _size){
puts("voy a crear");
size=_size;
disponible... |
C# | UTF-8 | 1,649 | 3.546875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
namespace ShapeConsole
{
public class Circle : Shape2D
{
private Vector2 circleCenter;
private float circleArea;
private float circleCircumference;
private float circleRadius;
... |
Go | UTF-8 | 1,194 | 2.84375 | 3 | [] | no_license | package middleware_test
import (
"log"
"net/http"
"net/http/httptest"
"os"
"testing"
"github.com/gorilla/mux"
"github.com/maanijou/imageservice/middleware"
"github.com/maanijou/imageservice/monitoring"
)
var sm *mux.Router
func TestMain(m *testing.M) {
route, err := setup()
sm = route
if err != nil {
t... |
Java | UTF-8 | 4,261 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | package org.neuroph.imgrec.filter.impl;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.Serializable;
import org.neuroph.imgrec.ImageUtilities;
import org.neuroph.imgrec.filter.ImageFilter;
/**
* Otsu binarize filter serves to dynamically determine the threshold based on
* the ... |
Markdown | UTF-8 | 1,032 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | 3、修改Activity中的代码,内容如下:
```
LinearLayout mLinearLayout;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLinearLayout = new LinearLayout(this);
ImageView i = new ImageView(this);
i.setAdjustViewBounds(true);
i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONT... |
JavaScript | UTF-8 | 248 | 2.921875 | 3 | [] | no_license | document.write('<h1>Please Don\'t Do This</h1>');
document.write('<p><span class="code">document.write</span> is naughty,\n');
document.write('and should be avoided at all costs.</p>');
document.write('<p>Today\'s date is ' + new Date() + '.</p>'); |
Markdown | UTF-8 | 265 | 3.140625 | 3 | [
"ISC"
] | permissive | *
===
### Description
Multiplies two numbers.
### Input
Takes two numerical arguments.
### Output
Returns the product as a numerical result.
### Example
\* 3 4
output
12
### Exceptions
If the arguments are not numerical, an exception is thrown.
|
C++ | UTF-8 | 1,086 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
int main()
{
... |
JavaScript | UTF-8 | 772 | 3.0625 | 3 | [] | no_license | const quote = document.querySelector(".quote");
const author = document.querySelector(".author");
const new_quote = document.querySelector(".new_quote");
const twit = document.querySelector(".twit");
const random = "https://random-quote-generator.herokuapp.com/api/quotes/random";
const twitter = "https... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.