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 | 405 | 3.796875 | 4 | [] | no_license | print("hello world")
message = "hello world"
print(message)
name = "add lovelace"
print(name.title())
print(name.upper())
print(name.lower())
first_name = "ada"
last_name = "lovelace"
full_name = first_name + " " + last_name
print(full_name)
print("\tPython")
print("\nPython")
favorite_language = "Python "
print(f... |
Java | UTF-8 | 2,484 | 2.65625 | 3 | [
"MIT"
] | permissive | package org.dmc.services;
import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.json.JSONObject;
public class ServiceLogger {
private static Fi... |
Python | UTF-8 | 861 | 3.5625 | 4 | [] | no_license | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: c:\Users\olivi.000\Dropbox\Public\My Library\IT\SW Programming\sego\Intro to Python\ch04\snippets_py\Exercise 4.9.py
# Project: c:\Users\olivi.000\Dropbox\Public\My Library\IT\SW Programming\sego\Intro to Python\ch04\snippets_py
# Created Date: Tuesday, April 21... |
Java | UTF-8 | 3,913 | 3.265625 | 3 | [] | no_license | package com.atcafuc.java;
import org.junit.Test;
import java.io.*;
/**
* 处理流之一:缓冲流的使用
*
* 1.缓冲流
* BufferedInputStream
* BufferedOutputStream
* BufferedReader
* BufferedWriter
*
* 2.作用:提供流的读取、写入的速度
* 提高读写速度的原因:内部提供了一个缓冲区
*
* @author jh
* @create 2021-08-26 14:21
*/
public class BufferedTest ... |
Java | UTF-8 | 2,494 | 4.125 | 4 | [] | no_license | package Q2;
class MyThread1 extends Thread{
MyThread1(String name){
super(name);
}
public void run() {
System.out.println("Hello this is thread: "+ this.getName());
System.out.println("Thread "+this.getName()+ " will now sleep:");
try {
Thread.sleep(100);
... |
Java | UTF-8 | 1,292 | 2.453125 | 2 | [
"MIT"
] | permissive | package de.aaaaaaah.velcom.backend.access.entities;
import java.time.Instant;
import java.util.Collection;
public class Commit {
private final RepoId repoId;
private final CommitHash hash;
private final Collection<CommitHash> parentHashes;
private final String author;
private final Instant authorDate;
private ... |
Python | UTF-8 | 556 | 2.984375 | 3 | [] | no_license | #!usr/bin/env python
import requests
target_url = ""//your target url
data_dict = {"username": "123", "password": "", "Login": "submit"}
with open("<file_for_passwords>", "r") as wordlist_file://put the password list inside the " < > "
for line in wordlist_file:
word = line.strip()
data_dict["p... |
Java | UTF-8 | 3,854 | 1.671875 | 2 | [] | no_license | /**
* generated by Xtext 2.13.0
*/
package uofa.lbirdsey.castle.casl.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore... |
Markdown | UTF-8 | 1,404 | 2.6875 | 3 | [] | no_license | 最近做的h5项目中有一个微信登录功能,将自己遇到的一些坑记录一下
前提:
1. 一个公众号
2. appid
首先就是在自己的vue项目中引入微信的接口
`<script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>`
接着我们就可以在自己的login.vue中调用微信函数`WxLogin`
在login.vue中的mounted
```javascript
var obj = new WxLogin({
id:"div", //div的id
... |
Markdown | UTF-8 | 4,144 | 3.484375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | +++
date = "2016-07-12T20:20:27+01:00"
description = "Tutorial on using find, a UNIX and Linux command for walking a file hierarchy. Examples of finding a file by name, finding and deleting a file, finding a directory and searching by modification time and permissions."
image = "images/covers/find.png"
caption = "The U... |
Rust | UTF-8 | 3,219 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | //! amqpr-api is AMQP client api library.
//! You can talk with AMQP server via channel controller provided by this crate.
//! There is two kind of channel controllers; GlobalChannelController and LocalChannelController.
//!
extern crate bytes;
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate futures;
... |
Java | UTF-8 | 8,088 | 1.96875 | 2 | [] | no_license | package com.dartrix.proyectoagenda;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.util.Log;
impo... |
JavaScript | UTF-8 | 142 | 2.9375 | 3 | [
"MIT"
] | permissive | async function(iter) {
var result = 0;
for (var value of iter) {
result += await value;
if (result > 10)
break;
}
return result;
}
|
C++ | UTF-8 | 6,717 | 2.796875 | 3 | [] | no_license | int Int = 11;
int S1 = 2;
int S2 = 3;
int S3 = 4;
byte com = 0;
int CG = 1;
void setup()
{
Serial.begin(9600);
pinMode(Int, OUTPUT); // lights up when command from group 1 is recognized
pinMode(S1, OUTPUT); // lights up when subgroup x command 1 is recognized
pinMode(S2, OUTPUT); // lights up when subgroup x command 2... |
C# | UTF-8 | 1,582 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Xml.Serialization;
using testFileUpload.Core.Types;
namespace testFileUpload.Core.Models
{
[Serializable]
[XmlRoot("Transaction")]
public class XmlTransaction
{
[XmlAttrib... |
PHP | UTF-8 | 1,119 | 2.953125 | 3 | [] | no_license |
<?php
require_once 'connectDB.php';
//$conn = connectDB();
$sql = "select cateId, cateName, modifyDate from category";
$result = mysqli_query($conn, $sql);
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>CATEGORY FORM </h2>
<p>This is function of adminstrator to insert, edit, delete one category.</p>
<p><a href... |
Java | UTF-8 | 2,913 | 3.09375 | 3 | [] | no_license | package hangman;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
public class EvilHangmanGame implements IEvilHangmanGame {
private KeyPartPair kpp;
public Partition mypart;... |
Python | UTF-8 | 2,347 | 2.625 | 3 | [
"MIT"
] | permissive | import importFile
import kmeans
import bisecting_kmeans
import fuzzyCmeans
import utils
from sklearn import metrics
import sys
def main(algorithm, data, cl_labels, min_k, max_k, max_iterations, epsilon):
results, silhouette, chs, ssws, ssbs, ars, hom, comp = [], [], [], [], [], [], [], []
membership, centroid... |
Java | UTF-8 | 427 | 2.703125 | 3 | [] | no_license | package com.saptar.dijkstra.driver;
import com.saptar.warshallflyod.engine.WarshallFlyod;
public class WarshallFlyodDriver {
final static int INF = 99999, V = 4;
public static void main(String[] args) {
int graph[][] = { { 0, 5, INF, 10 }, { INF, 0, 3, INF },
{ INF, INF, 0, 1 }, { INF, INF, INF, 0 }... |
Markdown | UTF-8 | 381 | 2.578125 | 3 | [] | no_license | # myASR
Final project for EE516 PMP at UW. Matlab implementation of a simple speaker independent, isolated word, whole-word model, single Gaussian per state, diagonal covariance Gaussian, automatic speech recognition (ASR) system, using the ten-word vocabulary W = {“zero”, “one”, “two”, “three”, ... "nine"}.
See Final... |
C# | UTF-8 | 498 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApp.Decorator
{
class ConcreteDecoratorB:Decorator
{
public override double Operation(double Prices)
{
Prices = Prices * 0.5;
AddedBehavior();
Console.WriteLine("打5折后值为:" + P... |
Python | UTF-8 | 16,765 | 3.265625 | 3 | [] | no_license | import numpy as np
import cPickle as pickle
def _list2UT(l, N):
"""Return a list of the rows of an NxN upper triangular"""
mat = []
start = 0
for i in range(N):
mat.append(l[start:start+N-i])
start += N-i
return mat
def _UT2list(m):
"""Return the elements of an NxN upper triang... |
C++ | UTF-8 | 7,279 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <fstream>
using namespace std;
class fraction{
public:
long long int x;
long long int y=1;
fraction(int a,int b){
x=a;
y=b;
}
fraction(int c){
x=c;
y=1;
}
fraction operator + (fraction f){
long long int t... |
C++ | UTF-8 | 1,412 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef STLPLUS_WILDCARD
#define STLPLUS_WILDCARD
////////////////////////////////////////////////////////////////////////////////
// Author: Andy Rushton
// Copyright: (c) Southampton University 1999-2004
// (c) Andy Rushton 2004 onwards
// License: BSD License, see ../docs/license.h... |
Java | UTF-8 | 585 | 2.21875 | 2 | [] | no_license | package org.intellij.trinkets.problemsView.problems;
import org.intellij.trinkets.problemsView.ui.TreeNodeElement;
import org.jetbrains.annotations.NotNull;
/**
* Problem.
*
* @author Alexey Efimov
*/
public interface Problem extends TreeNodeElement {
Problem[] EMPTY_PROBLEM_ARRAY = new Problem[]{}... |
JavaScript | UTF-8 | 540 | 2.59375 | 3 | [] | no_license | 'use strict';
// Remove focus away from the hero as the user scrolls by making it darker
var $mainHeader = $('main header');
$mainHeader.css({
background: 'rgba(0, 0, 0, .5)'
});
var scrollFade = function scrollFade() {
var winheight = $(window).height();
var scrollTop = $(window).scrollTop();
var trackLength... |
Java | UTF-8 | 2,619 | 2.484375 | 2 | [
"Apache-2.0"
] | permissive | package org.teiid.core.types.basic;
import java.math.BigDecimal;
import java.math.BigInteger;
import org.teiid.core.CorePlugin;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
public abstract class NumberToNumberTransform extends Transform {
private Class<?> sourceTyp... |
Python | UTF-8 | 674 | 3.109375 | 3 | [] | no_license | from typing import List
intervals=[[1,4], [4,5], [0,1]]
class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
if len(intervals)==0:
return intervals
addList=[]
hold=''
intervals=sorted(intervals, key=lambda x : x[0])
for i, v in enumerate... |
Markdown | UTF-8 | 3,804 | 3.25 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | ---
layout: post
title: "markdown语法初体验"
subtitle: "学习使我快乐"
date: 2018-08-01 12:00:00
author: "Yao Shengli"
header-img: "img/post-bg-nextgen-web-pwa.jpg"
header-mask: 0.3
catalog: true
tags:
- 知识学杂
---
## markdown 语法
### 概述
***
**宗旨**
Markdown 的目标是实现「易读易写」.
可读性,无论如何,都是最重要的。一份使用 Markdow... |
JavaScript | UTF-8 | 1,152 | 2.765625 | 3 | [
"MIT"
] | permissive | 'use strict'
const constants = require('./constants')
const min = 0
const isNil =
(val) => typeof val === 'undefined' || val === null
const isValidInRange =
(num, max) => !isNaN(num) && num >= min && num <= max
const isValid = (val, max) => {
if (!isValidInRange(val, max)) {
throw new Error(`'${val}' mus... |
PHP | UTF-8 | 729 | 2.609375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
require '../lib/mavenlink_api.php';
$mavenlinkApi = new MavenlinkApi('<oauthTokenHere>');
$workspacesJson = $mavenlinkApi->getWorkspaces();
$workspacesDecodedJson = json_decode($workspacesJson, true);
echo '<h1> Your workspaces: </h1>';
echo '<ul>';
$totalBudget = 0;
foreach ($workspacesDecodedJson[re... |
Markdown | UTF-8 | 1,572 | 3.015625 | 3 | [] | no_license | # Visual_tracking-based-on-CNN-and-RNN
### Motivation:
The key challenge in building a neural net is requirement of humongous training data. The next hindrance to deploy the model in embedded AI device is number of computaions,
thus demanding a lighter model. We hypothesized that training Re3 visual tracker with less n... |
C++ | UTF-8 | 550 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
static int a[101][101] = {0};
int uniquePaths(int m, int n) {
//m为列,n为行
if(m<=0 || n<=0) return 0;
else if(m==1||n==1) return 1;
else if(m==2 && n==2) return 2;
else if((m==3 && n==2) || (m==2 && n==3)) return 3;
if(a[m][n]>0) return a[m... |
Java | UTF-8 | 1,486 | 2.265625 | 2 | [] | no_license | import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
public class Main {
public static void main(String[] args) {
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
System.out.println(LocalDateTime.now());
LoginEngine<User> userLoginEngine = new LoginE... |
Java | UTF-8 | 8,642 | 2.328125 | 2 | [] | 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 dipit_game;
import dipit_game.GameWindowJFrame;
import java.io.File;
import java.io.FileNotFoundException;
import ja... |
Python | UTF-8 | 518 | 4.5 | 4 | [
"MIT"
] | permissive | '''Crie um programa onde o usuário possa digitar sete valores numéricos e cadastre-os em uma
lista única que mantenha separados os valores pares e ímpares. No final, mostre os valores
pares e ímpares em ordem crescente'''
valores = [[], []]
n = 0
for i in range(1, 8):
n = int(input(f'Digite o valor {i}: '))
if... |
Java | UTF-8 | 5,135 | 2.21875 | 2 | [] | no_license | package milu.gui.ctrl.schema;
import java.util.ResourceBundle;
import java.sql.SQLException;
import javafx.scene.control.SplitPane;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Ancho... |
TypeScript | UTF-8 | 3,299 | 2.953125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | import * as cormo from 'cormo';
export function Model(options: { connection?: cormo.Connection; name?: string; description?: string } = {}) {
const c = cormo.Model({ connection: options.connection, name: options.name, description: options.description });
return (ctor: typeof cormo.BaseModel) => {
c(ctor);
};... |
Shell | UTF-8 | 1,078 | 3.1875 | 3 | [] | no_license | #!/bin/bash
open ~/Databases/Hackage.sparsebundle
sleep 5
if ! quickping hackage.haskell.org; then
exit 1
fi
simple-mirror --from="http://hackage.haskell.org" --to="/Volumes/Hackage"
index=/Volumes/Hackage/00-index.tar.gz
if [[ -f $index ]]; then
echo Installing package database from local mirror...
siz... |
PHP | UTF-8 | 786 | 2.53125 | 3 | [] | no_license | <?php
/* Service class */
namespace AppBundle\Util;
use Doctrine\ORM\Mapping as ORM;
class Utility{
const DATE_FORMAT_DATE = 'yyyy-MM-dd';
const DATE_FORMAT_DATETIME = 'yyyy-MM-dd HH:mm:ss';
const FIELD_STYLE_SMALL = 'width:250px';
const FIELD_STYLE_MEDIUM = 'width:500px';
public function filterByName($qu... |
Python | UTF-8 | 1,445 | 3.203125 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Given a directory path, search all files in the path for a given text string
within the 'word/document.xml' section of a MSWord .dotm file.
"""
__author__ = "mprodhan/yabamov/madarp"
import os
import argparse
from zipfile import ZipFile
def create_parser():
parse... |
Markdown | UTF-8 | 2,317 | 2.828125 | 3 | [] | no_license | # [Gulp-imagemin](https://www.npmjs.com/package/gulp-imagemin) + [Imagemin-pngquant](https://www.npmjs.com/package/imagemin-pngquant) plugins
## Описание
Плагины для оптимизации изображений
## Install
`npm install --save-dev gulp-imagemin`
`npm install --save-dev imagemin-pngquant`
## Example
***gulp-imagemin***... |
Python | UTF-8 | 4,600 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | """Auxiliary functions."""
try:
import cPickle as pickle
except ImportError:
import pickle
import re
import os
from SPARQLWrapper import SPARQLWrapper, JSON
YAGO_ENPOINT_URL = "https://linkeddata1.calcul.u-psud.fr/sparql"
RESOURCE_PREFIX = 'http://yago-knowledge.org/resource/'
def safe_mkdir(dir_name):
... |
C++ | UTF-8 | 2,699 | 2.65625 | 3 | [] | no_license | /*
ID: j316chuck
PROG: milk3
LANG: C++
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <bitset>
#include <utility>
#inclu... |
Java | UTF-8 | 1,183 | 2.28125 | 2 | [] | no_license | package pl.skycash.zadanie_rekrutacyjne.crud_example.controller;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import pl.skycash.zadanie_rekrutacyjne.crud_example.controller.dto.BookConvertDTO;
import pl.skycash.zadanie_rekrutacyjne.crud_example.controller.dto.BookDTO;
import... |
C++ | UTF-8 | 1,879 | 2.625 | 3 | [] | no_license | #include "stdafx.h"
#include "CopyFileToDir.h"
#include <fstream>
#include <string>
#include <iostream>
#include <windows.h>
//??????????????(unicode -- > ascll)
#define WCHAR_TO_CHAR(lpW_Char,lpChar) WideCharToMultiByte(CP_ACP,NULL,lpW_Char,-1,lpChar,_countof(lpChar),NULL,FALSE);
//??????????????(unicode -- >... |
PHP | UTF-8 | 1,923 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Controllers;
use \Core\View;
use \App\Models\User;
use \App\Flash;
/**
* Signup controller
*
* PHP version 7.2
*/
class Signup extends \Core\Controller
{
/**
* Show the signup page
*
* @return void
*/
public function newAction()
{
View::renderTemplate('... |
JavaScript | UTF-8 | 856 | 2.9375 | 3 | [] | no_license | function piller(){
this.pos = {}
this.height = floor(random(100, 250))
this.width = 60
this.pos.x = 600
this.pos.y = 400-this.height
this.bottom = this.pos.y
this.space = 150
this.top = this.pos.y - this.space
this.speed = 6
this.pillerbottomImage = pillerbottomImage
this.pi... |
SQL | UTF-8 | 341 | 2.578125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS Items (id INTEGER PRIMARY KEY AUTOINCREMENT, name CHAR);
CREATE TABLE IF NOT EXISTS Purchase (id INTEGER PRIMARY KEY AUTOINCREMENT, date CHAR, invoice CHAR, item CHAR, quantity INTEGER);
CREATE TABLE IF NOT EXISTS Sale (id INTEGER PRIMARY KEY AUTOINCREMENT, date CHAR, invoice CHAR, item CHA... |
Ruby | UTF-8 | 189 | 3.625 | 4 | [] | no_license |
def d n
sum = 0
(1..n/2+1).each {|x|
sum += x if n%x == 0
}
sum
end
puts d 284
s = 0
(1..10000).each {|x|
y = d(x)
s += x if x!=y && d(d(x))==x
}
puts s
|
Markdown | UTF-8 | 4,082 | 3.828125 | 4 | [] | no_license | ```python
# random variables (no need to import random library)
# Solutions with variables converted to string
# Make sure you name the solution with part id at the end. e.g. 'solution1' will be solution for part 1.
solution1 = "4^2"
solution2 = "C(52-5,2) - C(52-5-4,2)"
solution3 = "C(52-5,2)"
solution4 = "(C(52-5,2)... |
C++ | UTF-8 | 1,099 | 2.84375 | 3 | [] | no_license | /*
* File: Alumno.h
* Author: alulab14
*
* Created on 6 de noviembre de 2015, 08:03 AM
*/
/*
* Nombre: Diego Alonso Guardia Ayala
* Codigo: 20125849
*/
#ifndef ALUMNO_H
#define ALUMNO_H
#include <cstdlib>
#include <cstring>
class Alumno {
public:
Alumno();
void SetCreditos(double creditos);
d... |
Java | UHC | 1,125 | 3.28125 | 3 | [] | no_license | import java.util.Scanner;
public class BFmatch {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("ؽƮ : ");
String s1 = sc.next();
System.out.print(" : ");
String s2 = sc.next();
int idx = bfMatch(s1,s2);
if(idx==-1)
System.out.println("ؽƮ ϴ... |
PHP | UTF-8 | 1,233 | 2.890625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: salerat
* Date: 4/9/14
* Time: 3:20 PM
*/
namespace kaz;
require 'Kaz.php';
if(!empty($_POST)) {
$kaz = new Kaz($_POST['word']);
$resultArray = $kaz->getFlectiveClass();
}
$word = '';
if(!empty($_POST['word'])) {
$word=$_POST['word'];
}
echo '<!doctype html>
<... |
Java | UTF-8 | 1,051 | 3.71875 | 4 | [] | no_license | package com.test17;
import java.util.Comparator;
import java.util.Scanner;
import java.util.TreeSet;
import com.student.Student;
public class Demo_StudentMassage {
/*
* 键盘录入5个学生信息(姓名,语文成绩,数学成绩,英语成绩),按学生总分进行排名
* 1.创建键盘录入对象
* 2.依次录入5名学生信息学生信息,存储在TreeSet集合中
*/
public static void main(String[] args) {
Scanne... |
C | UTF-8 | 452 | 3.9375 | 4 | [] | no_license | //Program to check whether all digits in a number in ascending order or not
#include<stdio.h>
#include<math.h>
int main()
{
int j,n,d,h,flag=1;
printf("Enter a number:");
scanf("%d",&n);
d=floor(log10(n));
while(d>0)
{
j=n/(int)(pow(10,d));
n=n%(int)(pow(10,d));
h=n/(int)(pow(10,d-1));
if(j>... |
TypeScript | UTF-8 | 1,364 | 2.5625 | 3 | [] | no_license | import { Injectable } from '@angular/core';
@Injectable()
export class FavoritoService {
name = "_f";
private favoritos = [];
constructor() { }
listar(){
if(!this.favoritos || this.favoritos.length == 0){
let lista = localStorage.getItem(this.name);
this.favoritos = l... |
C++ | UTF-8 | 931 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
bool compare(const int &a, const int &b)
{
return a > b;
}
int main()
{
int T, m, n, i, j, k, cnt, index;
string temp, str;
vector<string> strarr;
vector<int> answerarr;
cin >> T;
for (i = 1; i <= T; i++) {
cin... |
Java | UTF-8 | 695 | 2.5625 | 3 | [] | no_license | package schedule;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class MyListener implements ServletContextListener {
private ScheduledE... |
PHP | UTF-8 | 1,884 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace qtests\container;
use qing\facades\Container;
class AAA{
public $name='aaa';
}
class BBB{
public $name='bbb';
}
class CCC{
public $name='ccc';
public $aaa;
public $bbb;
}
/**
*
* @see app/config/main.php
* @author xiaowang <736523132@qq.com>
* @copyright Copyright (c) 2013 http://qingmvc.com
... |
C++ | UTF-8 | 388 | 2.5625 | 3 | [] | no_license | #pragma once
#include "AbstractMonster.hpp"
namespace patterns {
namespace abstract_factory {
class EasyMonster: public AbstractMonster
{
public:
virtual EasyMonster* clone() override {
return new EasyMonster();
}
virtual std::string text() const override {
return "Easy monster";
}
... |
C++ | UTF-8 | 3,610 | 3.21875 | 3 | [] | no_license | #include "LCDHelper.h"
#include <Arduino.h>
#include <Adafruit_RGBLCDShield.h>
LCDHelper::LCDHelper(Adafruit_RGBLCDShield &lcd) {
this->lcd = &lcd;
this->color = VIOLET;
this->clearDisplay = true;
this->displayUntil = 0;
this->nextScrollTime = 0;
this->scrollIndex = 0;
}
void LCDHelper::printNext(
... |
C | ISO-8859-1 | 755 | 3.5 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<locale.h>
/*
10 - So conhecidas as notas de um determinado aluno em uma determinada disciplina
durante um semestre letivo: p1, p2, t1 e t2 com pesos respectivamente 3, 5, 1, e 1. So
conhecidos tambm o total de aulas desta disciplina e a quantidade de aulas... |
Java | UTF-8 | 1,193 | 2.734375 | 3 | [] | no_license | import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.util.ArrayList;
/**
* Write a description of class Obstacles here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Obstacles extends Actor implements ISubject
{
private ObstacleType obs... |
Java | UTF-8 | 250 | 2.046875 | 2 | [] | no_license | package slug.soc.game.gameObjects.tiles.faction;
import java.awt.Color;
import slug.soc.game.gameObjects.tiles.GameTile;
public class TileVillage extends GameTile {
public TileVillage(Color color) {
super("village", color);
}
}
|
Java | UTF-8 | 2,393 | 3.875 | 4 | [] | no_license | package elementary_Data_Structures_Trees.BinaryTrees;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;
public class BinaryTree {
public static int startIndex = 0;
public Node crateBinaryTree(int[] values, Node root, int nullNum) {
int value = values[startIndex++];
// nullNum means ... |
Java | UTF-8 | 33,168 | 1.515625 | 2 | [] | no_license | package com.grgbanking.ct;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedH... |
C# | UTF-8 | 6,703 | 2.703125 | 3 | [] | no_license | using System.Text;
using FileServer.Core;
using Xunit;
namespace FileServer.Test
{
[Collection("Using IO")]
public class ProgramTest
{
[Theory]
[InlineData(-1)]
[InlineData(0)]
[InlineData(1000)]
[InlineData(1999)]
[InlineData(65001)]
[InlineData(999... |
JavaScript | UTF-8 | 1,165 | 2.96875 | 3 | [] | no_license | // a tree is a list of nodes
function find_bookmark_by_title(tree, title) {
if (!tree)
return null;
for (var i=0; i<tree.length; i++) {
var node = tree[i];
if (node.title == title)
return node;
}
// nothing at top-level, keep going
for (var i=0; i<tree.length; i++) {
var node = tree[... |
JavaScript | UTF-8 | 1,997 | 2.6875 | 3 | [] | no_license | $(document).ready(function() {
jQuery.fn.exists = function(){return this.length>0;}
$(".add").click(function (event) {
event.preventDefault();
var inputitem = $('#newitem').val();
if (inputitem == '')
{
var empty_item = confirm("Item is empty, do you want to add an empty item?");
if (empty... |
Python | UTF-8 | 135 | 2.609375 | 3 | [] | no_license | import datetime
d={'Cumpleaños':20,'Ricardo':2002,'Fecha':datetime.date.today()}
d.setdefault('Año minimo',datetime.MINYEAR)
print(d) |
C++ | UTF-8 | 479 | 2.765625 | 3 | [] | no_license | #include "DataStore.h"
#include <EEPROM\src\EEPROM.h>
/*
template < class T >
DataStore<T>::DataStore(uint16_t start, uint8_t maxdata ) :
startAddres(start),
maxData(maxdata)
{
lastData = 0;
}
*/
template < class T >
void DataStore<T>::pushBack(T data) {
uint8_t length = sizeof(T);
uint8_t * p = (uint8_t *) dat... |
Java | UTF-8 | 3,372 | 3.328125 | 3 | [] | no_license | package net.Programmers;
import java.util.Comparator;
import java.util.PriorityQueue;
public class Sonf {
//곡별로 음계 전체 만들기
static String[][] pattern = new String[][]{{"C#","c"},{"D#","d"},{"F#","f"},{"G#","g"},{"A#","a"}};
public String solution(String m, String[] musicinfos) {
String answer = "(No... |
Python | UTF-8 | 5,118 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | # Copyright (C) 2018 Alteryx, Inc. All rights reserved.
#
# 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 la... |
Python | UTF-8 | 854 | 2.5625 | 3 | [] | no_license | # data from:
# LIGO open science center
# www.gw-openscience.org/GW150914data/LOSC_Event_tutorial_GW150914.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.mlab import psd
from matplotlib import rc
data = [np.loadtxt('H-H1_LOSC_4_V2-1126259446-32.txt'),
np.loadtxt('L-L1_LOSC_4_V2-112... |
Markdown | UTF-8 | 9,289 | 2.984375 | 3 | [] | no_license | # Introduction
Ce document a pour but de vous expliquer en 5 minutes de lecture (et 5 autres de "digestion" ;) ) tout ce que vous devez savoir sur le XML et le XPATH utilisé par le Référentiel législatif de l'AN et les données en "OpenData" qui en sont issues.
Vous en saurez assez pour comprendre tout le XML et effect... |
Python | UTF-8 | 1,073 | 3.765625 | 4 | [] | no_license | def maxi(*l):
if len(l) == 0:
return 0
m = l[0]
for ix in range(1, len(l)):
if l[ix] > m:
m = l[ix]
return m
def mini(*l):
if len(l) == 0:
return 0
m = l[0]
for ix in range(1, len(l)):
if l[ix] < m:
m = l[ix]
return m
def media(*l):
if len(l) == 0:
return 0
suma = 0
for valor in l:
... |
C | UTF-8 | 1,209 | 2.875 | 3 | [] | no_license | #define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#include "jjp_lib.h"
int flag_18;
void fSIGSTP(int signum) {
if(flag_18==0) {
flag_18=1;
sigset_t mask;
sigfillset(&mask);
... |
Java | UTF-8 | 342 | 2.421875 | 2 | [
"Apache-2.0"
] | permissive | package base.components;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import base.model.Engine;
@Component("car")
public class Car {
Engine engine;
@Autowired
public void setEngine(Engine engine){
this.engine = engine;
System.out.println("ca... |
Java | UTF-8 | 1,798 | 3.765625 | 4 | [] | no_license | package lecture11;
public class ArrayDeque<E> implements Deque<E> {
private Object[] data;
private int first, size;
public ArrayDeque(int capacity) {
this.data = new Object[capacity];
this.first = 0;
this.size = 0;
}
@Override
public void addFirst(E e) {
if (this.size == this.data.length)
this.re... |
C# | UTF-8 | 3,875 | 2.65625 | 3 | [
"MIT"
] | permissive | using System;
using Skybrud.Social.Sonos.Endpoints;
using Skybrud.Social.Sonos.OAuth;
namespace Skybrud.Social.Sonos {
/// <summary>
/// Class working as an entry point to the Sonos API.
/// </summary>
public class SonosService {
#region Properties
/// <summary>
/// Gets a r... |
Python | UTF-8 | 341 | 2.71875 | 3 | [] | no_license | class Solution:
def isHappy(self, n: int) -> bool:
ht = dict()
while n:
if 1 in ht:
return True
if n in ht:
return False
ht[n] = 0
tmp = 0
while n:
tmp += (n%10) ** 2
n //= 10... |
Java | UTF-8 | 2,456 | 1.820313 | 2 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright © 2012-2014 Cask Data, Inc.
*
* 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 agr... |
C | ISO-8859-1 | 1,805 | 2.765625 | 3 | [] | no_license | /*
* Projeto: Teclado e Display 1
* Arquivo: App.c
* Autor: JABNeto
* Data: 10/02/2016
*/
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>
#include "Base_1.h"
#include "Oscilador.h"
//Prottipos das funes -----------------------------
void Timer0_Inicializacao (void);
void Timer0_Recarga (void);
//... |
Python | UTF-8 | 570 | 3.234375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
import time
import math
import numpy as np
x = [i for i in xrange(1000 * 1000)]
start = time.clock()
for i, t in enumerate(x):
x[i] = math.sin(t)
print "math.sin:", time.clock() - start
x = [i for i in xrange(1000 * 1000)]
x = np.array(x)
start = time.clock()
np.sin(x, x)... |
Python | UTF-8 | 804 | 2.59375 | 3 | [] | no_license | # connect
# close
# dinh nghia class db
# co self , nam, usr., host, db_password, 4 thong so
# """"db_host = localhost
# db_user = root
# db_name = cdcol
# db_password = root
# """
import MySQLdb
import ConfigLoader
class Database(object):
"""docstring for Database"""
def __init__(self, host, user, db, password):... |
Java | UTF-8 | 2,027 | 2.875 | 3 | [] | no_license | package com.finago.interview.fileProcessor;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import javax.xml.parsers.ParserConfigurationException;
import com.finago.interview.task.Constants;
/**
*
* @author Ajay Naik File P... |
Python | UTF-8 | 385 | 3.9375 | 4 | [] | no_license | #Multi line printing versions
#You can print with defining it into variable then print variable
message = """This message will
span several
lines."""
print(message)
#Or you can write you multi line printing into directly print function
print("""This message will span
several lines
of the text.""")
# Different String ... |
Java | UTF-8 | 6,933 | 2.234375 | 2 | [] | no_license | package com.ravisravan.capstone.UI;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Lo... |
Markdown | UTF-8 | 5,800 | 2.578125 | 3 | [] | no_license | # circos-utilities
Utility scripts for working with Circos.
# The scripts
* UCSC_chrom_sizes_2_circos_karyotype.py
> UCSC chrom.sizes files --> karyotype.tab file for use in Circos
Takes a URL for a UCSC `chrom.sizes` file and makes a `karyotype.tab` file from it for use with Circos.
Verified compatible with both ... |
Java | UTF-8 | 11,306 | 3.046875 | 3 | [] | no_license | import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
* in this class we design the interface of our calculator.
*
* @author Mahdi Hejarti 9723100
* @since 2020.04.23
*/
public class View {
private JFrame calFrame;
private JPanel standardMode;
private JPanel scientific... |
C++ | UTF-8 | 2,179 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <conio.h>
using namespace std;
template <typename T>
void prove(T a);
void fill_array(int** ary, const int N, const int M);
void solution(int** ary, const int N, const int M);
int main()
{
setlocale(LC_CTYPE, "rus");
srand(time(NU... |
JavaScript | UTF-8 | 1,574 | 3.578125 | 4 | [] | no_license | // PLEASE DON'T change function name
module.exports = function makeExchange(currency) {
// Your code goes here!
// Return an object containing the minimum number of coins needed to make change
currency = +currency;
let remainderH = 0, remainderQ = 0, remainderD = 0, remainderN = 0, remainderP = 0;
... |
Java | UTF-8 | 210 | 1.882813 | 2 | [] | no_license |
package base;
import org.openqa.selenium.WebElement;
public class PageElement {
private WebElement webElement;
private String elementType;
private String elementName;
int elementTimeout;
} |
Markdown | UTF-8 | 424 | 2.703125 | 3 | [] | no_license | Thank You for looking at my resume! If Markdown isn't your thing you can find links to other formats of the resume below:
- [PDF](https://github.com/justgage/resume/raw/master/resume-in-many-formats/GageKPetersonsResume.pdf)
- [Website (HTML)](http://justgage.github.io/resume/)
- [Markdown](https://github.com/justgag... |
Python | UTF-8 | 1,563 | 3.3125 | 3 | [] | no_license | from itertools import cycle
from player import Player
from poker import Poker
"""
def bet_loop(poker):
stay = poker.players
fold = set()
pool = cycle(stay)
for p in pool:
"""
if __name__ == "__main__":
p1 = Player('P1', 1000)
p2 = Player('P2', 1000)
p3 = Player('P3', 100... |
Rust | UTF-8 | 7,755 | 3.71875 | 4 | [
"BSD-2-Clause"
] | permissive | pub mod huffman {
use std::boxed::Box;
use std::cmp::Ordering;
use std::collections::*;
/// Node is a binary tree data structure.
/// It will be used by huffman compression algorithm
#[derive(Clone, PartialEq, Eq, Ord, std::fmt::Debug)]
struct Node {
letter: char,
freq: i32,
left: Option<Box<Node>>,
rig... |
C++ | UTF-8 | 3,069 | 2.71875 | 3 | [] | no_license | #include "receiver.h"
#include <iostream>
Receiver::Receiver(QWidget *parent) : QWidget(parent)
{
}
void Receiver::receiveValueHW1(int i)
{
if(scoreHW1 != i){
scoreHW1 = i;
double t = this->recalculate();
emit signalValue(t);
//emit two signals? or maybe emit calculated ... |
JavaScript | UTF-8 | 442 | 3.1875 | 3 | [] | no_license | export const format = (seconds) => {
if (isNaN(seconds)) return '...';
const minutes = Math.floor(seconds / 60);
seconds = Math.floor(seconds % 60);
if (seconds < 10) seconds = '0' + seconds;
return `${minutes}:${seconds}`;
}
export const timeToMiliSeconds = (time) => {
if (time === null || time === undefined)... |
Python | UTF-8 | 1,057 | 3.15625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 5 10:08:31 2018
@author: Tim
"""
#1. Board, Marble, 1D, Pitch/Roll
from sense_hat import SenseHat
sense = SenseHat()
b = (0,0,0)
w = (255,255,255)
board = [[b,b,b,b,b,b,b,b],
[b,b,b,b,b,b,b,b],
[b,b,b,b,b,b,b,b],
[b,b,b,b,b,b,b,b],
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.