language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 2,969 | 2.734375 | 3 | [] | no_license | # 20-21_viagdi
<p align="center">
<img src="https://github.com/MCYP-UniversidadReyJuanCarlos/20-21_viagdi/blob/main/osint/catalog/static/images/CyberPeek.png" />
</p>
# Descripción del proyecto
CyberPeek es una herramienta de análisis de ciberinteligencia desarrollada para permitir la gestión de la información y l... |
PHP | UTF-8 | 1,858 | 2.859375 | 3 | [] | no_license | <?php
namespace Phluid\Middleware;
use Phluid\Middleware\Cookies\Cookie;
class Cookies {
function __invoke( $request, $response, $next ){
$cookie = $request->getHeader( 'Cookie' );
if ( $cookie && !property_exists( $request, 'cookies' ) ) {
$request->cookies = $this->parseCookie( $cookie );
} el... |
Java | UTF-8 | 473 | 2.875 | 3 | [] | no_license | package replit;
import java.util.Scanner;
public class Q64 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String word = scan.next();
int l = word.length();
if (l>=3 && l%2==1) {
System.out.println(word.charAt(l/2));
}if(l==1) {
System.out.println(word+word+word);
... |
Markdown | UTF-8 | 14,949 | 2.953125 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | ---
layout: lesson
title: "Managing data"
dimension: pf2.1
overview: |
Data is big business. Many contractors have learned that if they build a system that "locks in" the government, they not only "own" the data (potentially tying the government to them as a vendor in perpetuity), but the data itself becomes a valu... |
PHP | UTF-8 | 495 | 4.15625 | 4 | [
"MIT"
] | permissive | <?php
namespace Euler;
/**
* The prime factors of 13195 are 5, 7, 13 and 29.
* What is the largest prime factor of the number 600851475143 ?
*/
class P03
{
public static function largestPrimeFactors(int $number)
{
$prime_factors = [];
$next = gmp_nextprime(1);
for ($i = $next; $nex... |
Java | UTF-8 | 1,260 | 2.40625 | 2 | [
"Apache-2.0"
] | permissive | package com.ustore.fileMetadata.model;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax... |
Markdown | UTF-8 | 6,139 | 4.25 | 4 | [
"MIT"
] | permissive | # OOJS: Model an Orange Tree
## Summary
Remember the [orange tree][orange tree challenge] objects that we built in Ruby? We're going to build JavaScript objects with the same attributes and behaviors.
We're going to create orange trees through a constructor function. The constructor will initialize each tree with... |
C++ | UTF-8 | 20,647 | 2.953125 | 3 | [
"CC-BY-3.0",
"MIT"
] | permissive | #include "Reaction.h"
#include "Element.h"
//TODO: All of the ReactionNode stuff needs to be moved to separate files.
#define MAX_REACTION_DEPTH (sizeof(uint32) * 8 - 2)
#define ELEMENT_IN_USE_BIT (MAX_REACTION_DEPTH + 1)
//HACK: This is to get around ReactionNode not having a reference to the current reaction, make... |
Java | UTF-8 | 1,541 | 3.78125 | 4 | [] | no_license | package Question2;
import java.util.*;
public class SortingProblem {
public static void main(String[] args) {
System.out.println("How many student you want to take as input?");
Scanner in = new Scanner(System.in);
int testCases = Integer.parseInt(in.nextLine());
List<Student> s... |
Markdown | UTF-8 | 4,182 | 3.03125 | 3 | [] | no_license | <div class="inner">
<h2>Hindley-Milner 类型系统的根本性错误</h2>
<p>之前的一个时间,我曾经公开过这样一段<a href="http://www.tudou.com/programs/view/GU9GtDuWSMk">幻灯片</a>,它是2012年10月的时候,我在 Indiana 大学做的最后一次演讲。由于当时的委婉,我并没有直接说出这些结论的重要性。其实它揭示了 ML 和 Haskell 这类基于 Hindley-Milner 类型系统的语言的一个根本性的错误。</p>
<p>这个错误来源于对一阶逻辑的“全称量词”(universal quantifier,通常写作∀)与程序函数之... |
C | UTF-8 | 512 | 3.578125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
// 6.Informa a quantidade de notas para um saque.
int main()
{
int notas[6] = {2,5,10,20,50,100};
int saque, qtd_notas,cont;
printf ("Digite o valor desejado do saque: ");
scanf ("%i", &saque);
printf ("\n ------ \n");
for (cont=0; cont<6; c... |
Markdown | UTF-8 | 13,690 | 2.703125 | 3 | [
"LicenseRef-scancode-dco-1.1",
"Apache-2.0"
] | permissive | # Using the AWS Cost Explorer API with Cost Insights
Cost Insights currently does not provide a CostInsightsApi client out of the box, this is left up to the implementer. We plan to provide an open-source client and backend eventually that can pull cost data from different cloud providers. In the meantime, we briefly ... |
Python | UTF-8 | 1,815 | 3.15625 | 3 | [] | no_license | # python3
import sys, threading, os
sys.setrecursionlimit(10**7) # max depth of recursion
threading.stack_size(2**27) # new thread will get stack of such size
class TreeHeight:
def __init__(self):
self.n = 0
self.parent = None
self.cache = [0]
def set(self, file):
with open(... |
C++ | UTF-8 | 1,464 | 2.9375 | 3 | [] | no_license | /* ################################################################# */
/* FILE: TileFactory.h DATE: december 2010
/* PURPOSE: Factory design pattern
/* AUTHOR: Jonas ORINOVSKI, EZJONAS@GMAIL.COM or JORINOVSKI@GMAIL.COM
/* ################################################################# */
#include "stdafx.h"
... |
Java | UTF-8 | 297 | 2.25 | 2 | [] | no_license | package kalah;
/**
*
* @author Eugene Fong (efon103)
*/
public interface IGame {
public void next(int command);
public int move(int command);
public int nextTurn();
public int currentTurn();
public boolean endGame();
public GameBoard board();
public void gameOver();
}
|
Markdown | UTF-8 | 2,095 | 2.78125 | 3 | [] | no_license | ---
name: "Chocolate Ganache Tart Recipe"
slug: "chocolate-ganache-tart-recipe"
layout: 'RecipeLayout'
prepTime: "120"
cuisine: "Continental"
cuisineSlug: "continental"
image: "https://www.archanaskitchen.com/images/archanaskitchen/1-Author/Swayampurna_Mishra/Chocolate_ganache_tart_original-2.jpg"
excerpt: "To ... |
Python | UTF-8 | 1,425 | 3.46875 | 3 | [
"MIT"
] | permissive | #se copian las tablas de las bases aqui
class Tabla(object):
def __init__(self, basedatos,nombre,columna,modo):
self.base=basedatos #nombre base
self.tabla = nombre #nombre tabla
self.columnas = columna #numero de columnas
self.modo=modo #modo en que se guardo la tabla
... |
Markdown | UTF-8 | 10,766 | 3.140625 | 3 | [] | no_license | MySQL_Note_0
===
**提要**
* 内容目前到书籍《MySQL必知必会》第九章"使用正则表达式搜索"前为止
* 知识点顺序与书本不完全一致:先是命题,然后是SQL语句
* 表达方式可能不适应一般的阅读习惯
* 对 SQL 语句的书写方式,更推荐该书上的写法
**内容概览**
关键字 | 功能介绍 | 性质 | 注意点(规则) |
-|-|-|-
USE | 选择数据库 | 语句 |
SHOW | 了解数据库 | 语句 |
SELECT | 检索数据库 | 语句 |
DISTINCT | 检索不同的行 | 关键字 | 放置在要修饰的列名之前
LIMIT | 限定结果 | 子句 | 后跟... |
Python | UTF-8 | 2,025 | 3.328125 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup # из bs4 вытаскиваем BeautifulSoup
URL="https://obmen24.com.ua/" # адрес который будем парсить
HEADERS={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36', "accept":"*/*"}
#заголовки нужны... |
JavaScript | UTF-8 | 492 | 3.0625 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var deleteAndEarn = function (nums) {
var record = [], dp = []
var max = Math.max(...nums)
for (let i = 0; i <= max; i++) {
record[i] = 0
dp[i] = 0
}
nums.forEach(x => { record[x] += x })
var max = record[1]
dp[1] = record... |
JavaScript | UTF-8 | 403 | 3.625 | 4 | [] | no_license | function calFeet(meter) {
return (3.279 * meter);
}
function cal1() {
let input1 = document.getElementById("meter").value;
document.getElementById("result1").innerHTML = calFeet(input1);
}
function calMeter(feet) {
return (0.305 * feet);
}
function cal2() {
let input2 = document.getElementById("f... |
Python | UTF-8 | 2,412 | 2.84375 | 3 | [] | no_license | import socket
import argparse
import signal
import sys
from threading import Thread
def signal_handler(signal, frame):
print("terminating client...", flush=True)
sys.exit()
class messageThread(Thread):
def __init__(self, ip, name):
Thread.__init__(self)
self.ip = ip
self.name =... |
C++ | UTF-8 | 1,020 | 3.390625 | 3 | [] | no_license | #include<iostream>
#include<string>
#include <stdlib.h>
using namespace std;
// we assume the string length is 10
void replaceSpaces(string str, int trueLength){
int spaceCount =0, index, i=0;
for(int i=0; i<trueLength; i++){
if(str[i]==' '){
spaceCount++;
}
}
cout<<"space co... |
SQL | UTF-8 | 1,482 | 3.15625 | 3 | [] | no_license |
CREATE DATABASE dahuadb_face;
use dahuadb_face ;
CREATE TABLE `face_detection_camera`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`camera_name` varchar(100),
`camera_type` varchar(100),
`camera_ip` varchar(100),
`venue_id` varchar(50),
`device_id` varchar(100),
`created_at` datetime NOT NULL D... |
Ruby | UTF-8 | 447 | 3.921875 | 4 | [] | no_license | # Write a program that can calculate the Hamming difference
# between two DNA strands.
class DNA
def initialize(dna_one)
@dna_one = dna_one
end
def count_differences
count = 0
@dna_one.chars.zip(@dna_two.chars).each do |sub_ary|
next if sub_ary.compact.length < 2
count += 1 if sub_ary.u... |
Python | UTF-8 | 701 | 3.46875 | 3 | [] | no_license | import numpy as np
import time
numbers = list(range(1,1000001))
time1 = time.time()
for i in numbers:
pass
time2 = time.time()
array1 = np.array(numbers)
time3 = time.time()
for x in array1:
pass
time4 = time.time()
print("Time stamp for List: ",time2-time1)
print()
print("Time stamp for numpy: ",time4-tim... |
Java | UTF-8 | 1,571 | 2.375 | 2 | [] | no_license | package gmail.carlosparrilla32.com.init;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraft.entity.EntityList;
import gmail.carlosparrilla32.com.Main;
import gmail.carlosparrilla32.com.help.Reference;
import gmail.carlosparrilla32.com.help.RegisterHelper;
import gmail.carlosparrilla32.com.entity.... |
C# | UTF-8 | 5,120 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | using NUnit.Framework;
using OpenQA.Selenium.Internal;
namespace OpenQA.Selenium
{
[TestFixture]
public class WebElementTest : DriverTestFixture
{
[Test]
public void ElementShouldImplementWrapsDriver()
{
driver.Url = simpleTestPage;
IWebElement parent = drive... |
C# | UTF-8 | 4,656 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using BoomaEcommerce.Core;
namespace BoomaEcommerce.Data.InMemory
{
public static class RepoContainer
{
public static ... |
Markdown | ISO-8859-1 | 1,278 | 2.84375 | 3 | [] | no_license | # PHPUnit Logo Suggestions
During the PHPUnit Code Sprint in Hamburg we came up with the task of finding a (new) logo for PHPUnit. This repository holds ideas, sketches and suggestions for now.
## General approach
- it should be flat
- we like the idea of having separate colors for "PHP" and "Unit"
- ideally the log... |
Java | UTF-8 | 752 | 1.835938 | 2 | [
"Apache-2.0"
] | permissive | package com.oubowu.ipanda.viewmodel;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.ViewModel;
import com.oubowu.ipanda.bean.pandalive.TabList;
import com.oubowu.ipanda.repository.PandaLiveRepository;
import com.oubowu.ipanda.util.Resource;
import java.util.List;
import javax.inject.Inject;
... |
PHP | UTF-8 | 5,354 | 2.6875 | 3 | [] | no_license | <?php
namespace WordPressdotorg\GitHub\MakeInviter;
function render() {
$allowed_teams = get_allowed_teams();
$all_teams = get_teams();
$teams = [];
foreach ( $allowed_teams as $id ) {
$team = wp_list_filter( $all_teams, [ 'id' => $id ] );
if ( ! $team ) {
continue;
}
$team = array_shift( $... |
C++ | UTF-8 | 776 | 2.703125 | 3 | [] | no_license | #include "Arduino.h"
#include "Info.h"
Info::Info(int count)
{
fileName = new char*[count];
for(int i=0; i<count;i++)
{
fileName[i] = new char[12];
memset(fileName[i],0,12);
}
totalFile = count;
currentFile = 0;
}
void Info::inputFileName(int idx, char* name)
{
strcpy(fileName[idx], name);
}
char* In... |
Java | UTF-8 | 470 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package com.landenlabs;
public class JobSpec {
public boolean verbose;
public int jobCount;
public int period;
public String name;
public JobSpec(boolean verbose, int jobCount) {
this.verbose = verbose;
this.jobCount = jobCount;
}
public JobSpec setPeriod(int period) {
... |
Java | UHC | 4,926 | 2.640625 | 3 | [] | no_license | package JavaChat.Client;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.ConnectException;
import java.net.Socket;
import java.util.StringTokenizer;
import javax.net.ssl.SSLEngineResult.HandshakeStatus;
import javafx.application.Application;
import javafx.application.Platform;
import... |
Java | UTF-8 | 3,247 | 2.546875 | 3 | [] | no_license | /** Copyright 2012 University of Washington. All Rights Reserved.
* @author Sai Zhang
*/
package edu.washington.cs.dt.tools;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import edu.washington.cs.dt.OneTestExecResult;
import edu.washington.cs.dt.RESULT;
impor... |
C | UTF-8 | 2,143 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "mpi.h"
int printdatatype( MPI_Datatype datatype )
{
int *array_of_ints;
MPI_Aint *array_of_adds;
MPI_Datatype *array_of_dtypes;
int num_ints, num_adds, num_dtypes, combiner;
int i;
MPI_Type_get_envelope( datatype,
&num_... |
PHP | UTF-8 | 611 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
class StorageCostCalculatorService {
const STORAGE_MB_PER_STUDY = 10;
const STORAGE_GB_COST_PER_MONTH_IN_USD = 0.10;
const GB_TO_MB_SCALE = 1000;
const BCMATH_SCALE = 8;
public static function getMonthlyStorageCostPerStudy() : float
{
$monthlyStorageInMBC... |
Markdown | UTF-8 | 1,699 | 2.59375 | 3 | [] | no_license | ---
title: Apologies
date: 2004-05-22T07:42:11+00:00
excerpt: Firstly, I would like to apologize, especially to Gwildor, about my insensitive comments about bullying. I stand by my
layout: post
categories:
- Opinion
tags:
- bullying
- Seinfeld
- Superman
- weather
---
Firstly, I would like to apologize, espec... |
Java | UTF-8 | 3,742 | 1.90625 | 2 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | /*
* Copyright 2018 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... |
Java | UTF-8 | 4,887 | 2.203125 | 2 | [] | no_license | package com.wb.tracun.appacademiaarlivre;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
... |
JavaScript | UTF-8 | 529 | 4.625 | 5 | [] | no_license | // Primitives are copied by their value
// Objects are copied by their reference
// Primitive values
let x = 10;
let y = x;
x = 20;
// in console : x = 20, y = 10.
let number = 10;
function increase(number) {
number++;
}
increase(number);
console.log(number);// 10
// ------------------------------
// Refere... |
Java | UTF-8 | 2,191 | 2.671875 | 3 | [] | no_license | package com.qingcheng.mobilemanager.utils;
import android.util.Log;
/**
* Created by cunhuan.liu on 17/2/8.
*/
public class LogUtil {
//打印重要的log 使用HUAN
//只打印流程 使用-->
//打印所有 HUA
private static String TAG = "HUAN";
private static String FLOW_TAG = "-->";
public static boolean allowD = tru... |
Markdown | UTF-8 | 1,367 | 2.609375 | 3 | [
"MIT"
] | permissive | # Kendo UI for Angular 2 Proof of Concept — Northwind Dashboard
The goal of this project is to build a dashboard application with the following set of technologies:
* Angular 2
* NativeScript
* Kendo UI for Angular 2
* The [Kendo Bootstrap Theme](https://github.com/telerik/kendo-bootstrap)
It includes a web interfac... |
Java | UTF-8 | 4,118 | 2.84375 | 3 | [] | no_license | package helpers;
import static helpers.Handler.*;
import static org.lwjgl.glfw.GLFW.*;
import java.nio.*;
import org.lwjgl.*;
public class Mouse {
private static float x, y;
private static DoubleBuffer xTemp, yTemp;
private static boolean lastLeft = false, currentLeft = false;
private s... |
JavaScript | UTF-8 | 961 | 2.609375 | 3 | [] | no_license | import React from "react";
export default function ProductCard({ productData }) {
function getProductAllergens(product) {
if (Object.keys(product).length !== 0) {
if (product.allergens === "") {
return <p>Aucun allergène n'est associé à ce produit</p>;
} else {
let splittedAllergens =... |
Markdown | UTF-8 | 3,036 | 2.609375 | 3 | [] | no_license | +++
aliases = ["/changing-over-to-a-bluetooth-car-stereo-to-work-with-your-phone/","/2012/01/13/changing-over-to-a-bluetooth-car-stereo-to-work-with-your-phone"]
date = "2012-01-13T09:10:28Z"
draft = false
title = "Changing over to a Bluetooth car stereo to work with your phone"
description = ""
slug = "changing-over-t... |
C++ | UTF-8 | 206 | 2.734375 | 3 | [] | no_license | #pragma once
#include <vector>
using namespace std;
template<class T>
void ClearList(vector<T *> & t)
{
vector<T *>::iterator i = t.begin();
while ( i != t.end() )
{
delete *i;
++i;
}
t.clear();
} |
Python | UTF-8 | 203 | 3.984375 | 4 | [
"Unlicense"
] | permissive | num=int(input("Enter a number:"))
temp=num
rev=0
while(num>0):
dig=num%10
rev=rev*10+dig
num=num//10
if(temp==rev):
print("The number is palindrome!")
else:
print("Not a palindrome!") |
Java | UTF-8 | 448 | 2.734375 | 3 | [] | no_license | package lom;
import lombok.ToString;
@ToString(exclude = {"id","name"})
public class User {
private Integer id;
private String name;
private String phone;
User(Integer id, String name, String phone) {
this.id = id;
this.name = name;
this.phone = phone;
}
pub... |
JavaScript | UTF-8 | 1,292 | 3 | 3 | [] | no_license | // TEMP CODE FOR FETCHMYIP
// const { fetchMyIP } = require('./iss');
// fetchMyIP((error, ip) => {
// if (error) {
// console.log("It didn't work!" , error);
// return;
// }
// console.log('It worked! Returned IP:' , ip);
// });
// TEMP CODE FOR FETCHCOORDSBYIP
// const { fetchCoordsByIP } = require('... |
C# | UTF-8 | 6,051 | 2.515625 | 3 | [
"MIT"
] | permissive | using ABC.Models.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.Entity;
using System.Collections;
using PagedList;
namespace ABC.Controllers
{
public class PedidosController : Controller
{
private Db db = new Db();
... |
Markdown | UTF-8 | 3,002 | 3.015625 | 3 | [
"MIT"
] | permissive | # Adjust layout
This step of the tutorial uses the basic layout of your app, but adds an extra column for charts.
Let's create a new `Dashboard` folder under `/js/` to place the new files.
## Dashboard.js
This code will adjust the page layout, watch the **Viewer** and load the charts when the model date is loaded. ... |
Java | UTF-8 | 1,216 | 2.28125 | 2 | [] | no_license | package com.edcan.shareformproject.model;
public class UserModel {
private String nick, phone, bank, acc, uid, profile;
public UserModel(){}
public UserModel(String nick, String phone, String bank, String acc, String uid, String profile) {
this.nick = nick;
this.phone = phone;
th... |
Ruby | UTF-8 | 1,387 | 3.234375 | 3 | [] | no_license | require "minitest/autorun"
require_relative "cat.rb"
require_relative "dog.rb"
require_relative "fox.rb"
class TestAnimalSounds <Minitest::Test
def test_cat_name
animal = Cat.new("Kitty")
assert_equal("Kitty", animal.name)
end
def test_cat_sound
animal = Cat.n... |
Java | UTF-8 | 310 | 1.585938 | 2 | [] | no_license | package ddd.simple.service.ddd3util;
import java.util.List;
import java.util.Map;
import ddd.simple.action.ddd3util.TabInfo;
import ddd.simple.service.base.BaseServiceInterface;
public interface Ddd3utilService extends BaseServiceInterface
{
public String generatorFileds(List<TabInfo> tabs) ;
} |
Python | UTF-8 | 1,670 | 3.265625 | 3 | [] | no_license | board= [[7,8,0,4,0,0,1,2,0],
[6,0,0,0,7,5,0,0,9],
[0,0,0,6,0,1,0,7,8],
[0,0,7,0,4,0,2,6,0],
[0,0,1,0,5,0,9,3,0],
[9,0,4,0,6,0,0,0,5],
[0,7,0,3,0,0,0,1,2],
[1,2,0,0,0,7,4,0,0],
[0,4,9,2,0,6,0,0,7]]
def solve(board):
pos=check_empty(board)
if not pos:
return True
else:... |
JavaScript | UTF-8 | 2,775 | 2.71875 | 3 | [] | no_license | import React, {Component} from 'react';
import axios from 'axios';
import styled from 'styled-components';
class SmurfForm extends Component {
constructor(props) {
super(props);
this.state = {
id: 0,
name: '',
age: '',
height: '',
};
... |
JavaScript | UTF-8 | 6,395 | 2.859375 | 3 | [] | no_license |
var UIModule = (function () {
'use strict'
// landing page elements
var candidatesList = document.querySelector('.candidates-list');
var searchField = document.querySelector('input');
// reports page elements
var candidateName = document.querySelector('#name');
var candidateEmail = docume... |
Swift | UTF-8 | 2,285 | 2.859375 | 3 | [
"MIT"
] | permissive | //
// CGFloatRepresentable.swift
// AnchorKit
//
// Created by Eddie Kaiger on 5/13/17.
// Copyright © 2017 Weebly. All rights reserved.
//
import CoreGraphics
#if SWIFT_PACKAGE
import Foundation
#endif
/**
A protocol that converts different number types to a `CGFloat` equivalent.
TOOD: Improve in Swift 4 on... |
Swift | UTF-8 | 4,069 | 2.578125 | 3 | [] | no_license | //
// ThreeViewController.swift
// ios-project-ui
//
// Created by 李喜明 on 2019/9/28.
// Copyright © 2019 李喜明. All rights reserved.
//
import UIKit
class ThreeViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var data = [[[String: String]]]()
var keys = [String]()
var tabel:... |
Python | UTF-8 | 2,964 | 3.09375 | 3 | [] | no_license | import time
import math
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
import os
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
def calc(a):
return str(math.log(... |
C++ | UTF-8 | 2,091 | 2.5625 | 3 | [] | no_license | /*
* Gunner.cpp
*
* Created on: Aug 7, 2018
* Author: Samuel Tan
*/
#include <unit/Gunner.h>
#include "Renderer.h"
#include "../Battle.h"
namespace entity
{
// ugh this is gory
Gunner::Gunner(Battle* b, Team t, geometry::Vec2 position, geometry::Vec2 velocity, double angle)
: Unit(b, t... |
JavaScript | UTF-8 | 1,606 | 2.625 | 3 | [] | no_license | const VuelosIdaContainer = document.getElementById("ContenedorVuelosIda")
const VuelosRegresoContainer = document.getElementById("ContenedorVuelosRegreso")
if(VuelosIdaContainer){
VuelosIdaContainer.children[0].classList.add("radioSeleccionado");
a = VuelosIdaContainer.children[0].children[0].children[0].checked=... |
C++ | UTF-8 | 2,388 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include <math.h>
#include <windows.h>
/*
using namespace std;
main()
{
string galpon[3];
galpon[2]="pedro";
galpon[0]="maria";
galpon[1]="pedro";
//cout<<galpon[1];
for(int i=0;i<9;i++)
{
if(i>2)
{
cout<<"El indice ["<<i<<"] no existe"<<" \... |
C | UTF-8 | 329 | 2.984375 | 3 | [] | no_license | /*
* File: point.h
* -------------
* This file defines a structure that combines an x and a y coordinate
* value into a single entity.
*/
#ifndef _point_h
#define _point_h
/*
* Type: pointT
* ------------
* This simple structure contains a pair of x and y coordinate values.
*/
struct pointT {
int x, y;
};... |
Ruby | UTF-8 | 491 | 3.96875 | 4 | [
"Artistic-2.0"
] | permissive | #!/usr/bin/ruby
#
## http://rosettacode.org/wiki/Call_an_object_method
#
class MyClass {
method foo(arg) { arg }
}
var arg = 42;
# Class method
assert_eq(MyClass.(:foo)(arg), arg);
# Create an instance
var instance = MyClass();
# Instance method
assert_eq(instance.foo(arg), arg);
# Alternatively, by using an... |
JavaScript | UTF-8 | 2,270 | 3.40625 | 3 | [] | no_license | const ul1 = document.getElementById('ul1');
// ajax获取json数据并放入到DOM中
let xml = new XMLHttpRequest();
xml.open('get', './nav.json', true);
xml.onreadystatechange = () => {
if (xml.status === 200 && xml.readyState === 4) {
let data = JSON.parse(xml.responseText).data;
let li1 = '';
data.forEach... |
C# | UTF-8 | 2,863 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
namespace Paint
{
class Frame:PictureBox
{
public Label Border = new Label();
public Label FrameLabel = new Label();
st... |
Python | UTF-8 | 2,413 | 3.125 | 3 | [] | no_license | class LRUCache(object):
"""
queue to implement LRU in O(1) time
hashmap of
key --> node
for O(1) put and get
head, tail
ex:
size = 3
put(1,1)
[1,1]
{(1,[1,1])}
put (2,2)
[2,2]<->[1,1]
{
(1,[1,1]),
(2,[2,2])
}
put (3,3)
[3,3]<->[2,2]... |
Ruby | UTF-8 | 209 | 3.953125 | 4 | [] | no_license | # Use the dates from the previous example and store them in an array. Then make your program output the same thing as exercise 3.
movies = [2001, 2019, 1994]
puts movies[0]
puts movies[1]
puts movies[2]
|
Java | UTF-8 | 1,279 | 2.296875 | 2 | [] | no_license | package com.rescribe.doctor.model.chat;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class MQTTData implements Parcelable {
@SerializedName("mqttMessages")
@Expose
... |
PHP | UTF-8 | 372 | 3.078125 | 3 | [] | no_license | <?php
declare(strict_types=1);
require_once '../common.php';
require_once './functions.php';
$rows = readRows('input.txt');
$part1 = 0;
$part2 = 0;
foreach ($rows as $row) {
$words = explode(' ', $row);
$part1 += isValidPassPhrase($words, false) ? 1 : 0;
$part2 += isValidPassPhrase($words, true) ? 1 : 0;... |
Python | UTF-8 | 184 | 2.65625 | 3 | [] | no_license | def monta_mala(lista_de_peso):
while sum(lista_de_peso) > 25:
del lista_de_peso[-1]
print (lista_de_peso)
if sum(lista_de_peso)<25:
return lista_de_peso |
PHP | UTF-8 | 417 | 3.125 | 3 | [] | no_license | <?php
include '../modelo/distancia.class.php';
$b = new Distancia();
$b->setX1($_POST['numx1']);
$b->setY1($_POST['numy1']);
$b->setX2($_POST['numx2']);
$b->setY2($_POST['numy2']);
echo '<p>Valor de X: '.$b->getX1().
'<br>Valor de Y: '.$b->getY1().
'<br>Valor de X2: '.$b->getX2().
'<br>Valo... |
Swift | UTF-8 | 448 | 2.8125 | 3 | [] | no_license | //
// UInt8+Convert.swift
// FitBitChallenge
//
// Created by Andrew Meng on 2018-02-05.
// Copyright © 2018 Andrew Meng. All rights reserved.
//
import Foundation
extension UInt8 {
// Returns UInt8 value as if it would be represented by Int8
func convertToSignedEquivalent() -> Int16 {
if sel... |
Java | UTF-8 | 4,915 | 2.75 | 3 | [] | no_license | package kr.or.ddit.fileupload;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.ser... |
JavaScript | UTF-8 | 3,074 | 2.921875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import GithubProfileContainer from './GithubProfileContainer';
import Form from './Form';
import './App.css';
/*
Sections:
-Form and text input button
-GitHub Profile
Components:
-Form
-Avatar
-Username
-Bio
-MetricsContainer
... |
C | UTF-8 | 1,561 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <pmmintrin.h>
#include <immintrin.h>
#define N 512
int main()
{
double execTime;
double startTime, endTime;
float A[N * N]__attribute__((aligned(16)));
float B[N * N]__attribute__((aligned(16)));
float C[N * N]__attribute__((al... |
Java | UTF-8 | 255 | 2 | 2 | [] | no_license | package generic;
import java.util.List;
public class ParseService<T> {
private ResParse<T> parse;
public ParseService(ResParse<T> parse) {
this.parse = parse;
}
public List<T> getResult() throws Exception {
return parse.parse();
}
}
|
Python | UTF-8 | 1,425 | 2.828125 | 3 | [] | no_license | """
*(вместо 1) Написать регулярное выражение для парсинга файла логов web-сервера из ДЗ 6 урока nginx_logs.txt
(https://github.com/elastic/examples/raw/master/Common%20Data%20Formats/nginx_logs/nginx_logs) для получения информации
вида: (<remote_addr>, <request_datetime>, <request_type>, <requested_resource>, <resp... |
Python | UTF-8 | 1,224 | 3.3125 | 3 | [] | no_license | import threading
import numpy as np
class GameHistory():
'''Maintain a history of state-action-value tuples, replacing randomly
when we exceed the max storage'''
def __init__(self, features, max_size=50000):
self.max_size = max_size
self._lock = threading.Lock()
self._storage = np.z... |
C++ | UTF-8 | 4,050 | 2.734375 | 3 | [] | no_license | #include<bits/stdc++.h>
#define LL long long
#define ULL unsigned long long
#define MOD 1000000007
using namespace std;
const int maxn=100000+100 ;
LL power(LL x,int n)
{
if(n<=1) return n ? x : 1LL ;
LL t=power(x,n/2) ;
if(n%2) return (t*t%MOD)*x%MOD ;
else return t*t%MOD ;
}
ULL Rand()
{
static ... |
Java | UTF-8 | 600 | 2.390625 | 2 | [
"Apache-2.0"
] | permissive | package com.intellij.perlplugin.filters;
import com.intellij.perlplugin.Utils;
import com.intellij.perlplugin.language.Constants;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
/**
* Created by eli on 28-11-14.
*/
public class FileFilter implements FilenameFilter {
@Override
... |
Go | UTF-8 | 2,279 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | package baserpc
import (
"github.com/dming/lodos/rpc"
"sync"
"fmt"
"github.com/dming/lodos/rpc/pb"
"github.com/dming/lodos/log"
)
type localServer struct {
call_chan chan rpc.CallInfo // chan to rpc server
local_chan chan rpc.CallInfo // chan to local client
done chan error
isClose bool
lock *sync.Mutex
}
... |
Python | UTF-8 | 1,447 | 3.984375 | 4 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
统计Python之禅中所有字符出现的次数
"""
# python 之禅
this_str = """
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts... |
PHP | WINDOWS-1250 | 1,173 | 3.171875 | 3 | [] | no_license | <html>
<head>
</head>
<body>
<?php
//Funcion eliminar TILDES
function sinTildes($frase){
$cadBuscar = array("","","","","","","","","","");
$cadPoner = array("a","A","e","E","i","I","o","O","u","U");
$frase = str_replace ($cadBuscar, $cadPoner, $frase);
retur... |
PHP | UTF-8 | 1,030 | 2.96875 | 3 | [] | no_license | <?php
require 'vendor/autoload.php';
$inputFileType1 = 'Excel2007';
$inputFileName1 = 'uploads/sheet.xlsx';
$inputFileType2 = 'Excel2007';
$inputFileName2 = 'uploads/sheet1.xlsx';
$outputFileType = 'Excel2007';
$outputFileName = 'outputData.xlsx';
// Load the first workbook (an xlsx file)
$objPHPExcelReader1 = PHPExce... |
C# | UTF-8 | 8,063 | 2.828125 | 3 | [] | no_license | using System;
using System.IO;
using Microsoft.VisualBasic.FileIO;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace A00457100_Assignment1
{
class Program
{
static void Main(string[] args)
{
... |
PHP | UTF-8 | 1,273 | 2.71875 | 3 | [] | no_license | <?php
/*
* Openkvk outputs lists of rowtypes, column names and data. This converts it to an array of key-value pairs.
*/
function get_clean($raw) {
$results = json_decode($raw);
$clean = array();
foreach($results[0]->RESULT->ROWS AS $row) {
$new = array();
foreach($row AS $k => $v) {
... |
Shell | UTF-8 | 144 | 3.359375 | 3 | [
"MIT"
] | permissive | function get_last_version {
target_dir=$1
newest_file=$(ls -1 $target_dir |grep -E '^[0-9]+$' |sort -nr|head -1)
echo "${newest_file}"
}
|
Rust | UTF-8 | 1,262 | 3.328125 | 3 | [] | no_license | struct SnapshotArray {
arrays: Vec<Vec<(i32, i32)>>,
snap_id: i32,
}
/**
* `&self` means the method takes an immutable reference.
* If you need a mutable reference, change it to `&mut self` instead.
*/
impl SnapshotArray {
fn new(length: i32) -> Self {
Self {
arrays: vec![vec![(0,... |
Python | UTF-8 | 4,182 | 3.046875 | 3 | [
"BSD-2-Clause-Views"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 10:13:54 2017
@author: scd
"""
from __future__ import division
import numpy as np
from scipy.optimize import fsolve
from scipy.integrate import odeint
import matplotlib.pyplot as plt
# final time
tf = 1.0
# solve with ODEINT (for comparison)
def model(x,t):
u = 4... |
Java | UTF-8 | 2,038 | 2.6875 | 3 | [] | no_license | package com.example.spm1.Utils;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.example.spm1.Entities.Parcel;
import com.example.spm1.R;
import java.util.List;
... |
Java | UTF-8 | 353 | 3.078125 | 3 | [] | no_license | package b06.s71;
public class Person {
public String nome=" ";
public String cognome=" ";
public Person(String nome, String cognome) {
this.nome = nome;
this.cognome= cognome;
}
public String getNome() {
return nome;
}
public String getCognome() {
... |
Java | UTF-8 | 1,441 | 2.5 | 2 | [] | no_license | package thinlet.drafts;
import java.awt.*;
import thinlet.*;
/**
*
*/
public class Drafts extends Thinlet {
/**
*
*/
public Drafts() {
//setFont(new Font("Trebuchet MS", Font.PLAIN, 12));
try {
add(parse("drafts.xml"));
} catch (Exception exc) { exc.printStackTrace(); }
}
/**... |
Rust | UTF-8 | 708 | 3.171875 | 3 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /// Tile id
use std::fmt;
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, From, Serialize, Deserialize)]
pub struct Tile(u8);
impl Tile {
pub fn to_char(self) -> char {
self.0 as char
}
pub fn to_byte(self) -> u8 {
self.0
}
}
impl fmt::Display for Tile {
fn fmt(&self, f: &mut fmt... |
C++ | UTF-8 | 2,111 | 3.40625 | 3 | [
"MIT"
] | permissive | #include "stdio.h"
int letterCounter[8];
char validCharacters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890!@#$%^&*()_+[]{}:;<>,./?'";
char bruteString[9]; // One more to null terminate.
bool evaluateString(char *testString)
{
// Do something here, to test the zero terminated string... |
Python | UTF-8 | 1,975 | 3.140625 | 3 | [
"MIT"
] | permissive | '''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT... |
JavaScript | UTF-8 | 2,895 | 4.21875 | 4 | [] | no_license | // es5 类的写法
// let Animal = function (type) {
// this.type = type
// // this.eat = function () {
// // console.log('I am eating food')
// // }
// }
//
// // let dog = new Animal('dog')
// // let monkey = new Animal('monkey')
// // console.log(dog)
// // console.log(monkey)
// // monkey.eat = function () {
// ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.