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 | 1,353 | 3.484375 | 3 | [
"MIT"
] | permissive | #ifndef ISSTRPERMUTATION_HPP_
#define ISSTRPERMUTATION_HPP_
// Given two strings, write a method to decide if one is a permutation of the
// other
#include <string>
#include <algorithm>
#include <map>
namespace Algo::DS::String {
bool IsPermutationSort(const std::string& first, const std::string& second) {
... |
JavaScript | UTF-8 | 1,304 | 2.640625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var User = require('../models/db-user');
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});
router.post('/', (req, res)=>{
var user = {
name : "Nhat",
email : "email@gmail.com",
... |
Python | UTF-8 | 798 | 2.8125 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
def get_imdb_movie_ids(count):
try:
url = 'http://www.imdb.com/chart/top'
res = requests.get(url, verify=False)
movies_chart = BeautifulSoup(res.text, 'html.parser')
movies_list = movies_chart.body.find("tbody", {"class": "list... |
Java | UTF-8 | 224 | 1.515625 | 2 | [] | no_license | package org.openelis.portal.client.resources;
public interface IconCSS extends org.openelis.ui.resources.IconCSS {
String helpImage();
String reportImage();
String emailImage();
String spreadsheetImage();
}
|
PHP | UTF-8 | 1,315 | 3.15625 | 3 | [] | permissive | <?php
/*
* 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.
*/
$naziv = 'Algebra';
if ($naziv == 'PHP') {
echo 'Varijabla ima vrijednost PHP';
echo 'Varijabla ima neku drugu vrijed... |
Markdown | UTF-8 | 1,478 | 2.703125 | 3 | [
"MIT"
] | permissive | I am ZnBase64Encoder.
Base64 encoding is a technique to encode binary data as a string of characters that can be safely transported over various protocols. Basically, every 3 bytes are encoded using 4 characters from an alphabet of 64. Each encoded character represents 6 bits.
The most commonly used alphabet is 'ABCD... |
Java | UTF-8 | 3,087 | 2.140625 | 2 | [] | no_license | package com.index.medidor.activities;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.App... |
Python | UTF-8 | 2,717 | 3.015625 | 3 | [] | no_license | import matplotlib.pyplot as plt
import os
import random
from sklearn.tree import DecisionTreeRegressor
dataset_file = os.path.join(os.getcwd(),
'../../datasets/winequality-red.csv')
x_list = []
labels = []
names = []
header = True
with open(dataset_file, 'r') as f:
if header:
... |
Markdown | UTF-8 | 10,004 | 2.796875 | 3 | [] | no_license | ---
layout: layouts/post.njk
title: >
VoV 040: Fonts with Miriam Suzanne
date: 2018-12-04 11:00:51
episode_number: 040
duration: 51:15
audio_url: https://media.devchat.tv/viewsonvue/VoV_040_Fonts%20with%20Miriam_Suzanne.mp3
podcast: views-on-vue
tags:
- views_on_vue
- podcast
---
**Panel:**
- Joe Eames
-... |
Java | UTF-8 | 541 | 2.03125 | 2 | [
"Apache-2.0"
] | permissive | package com.italankin.placard.colorpicker;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.ColorInt;
import androidx.annotation.Nullable;
interface ColorModelController {
void init(ViewGroup root, LayoutInflater inflater);
void destroy();
void setColor(@Co... |
JavaScript | UTF-8 | 4,067 | 4.15625 | 4 | [
"MIT"
] | permissive | // Código del cuadrado
console.group("Cuadrados");
// const ladoCuadrado = 5;
// console.log("Los lados del cuadrado miden: " + ladoCuadrado + "cm");
function perimetroCuadrado(lado) {
return lado * 4;
}
// console.log("El perímetro del cuadrado es: " + perimetroCuadrado + "cm");
function areaCuadrado(lado) {
ret... |
JavaScript | UTF-8 | 783 | 3.859375 | 4 | [] | no_license |
const maxSubarraySum = (array, n) => {
if (n > array.length){
return null;
}
let maxSum = 0;
let tempSum = 0;
for (let i = 0; i< n; i++){
maxSum += array[i];
}
tempSum=maxSum;
for (let i = n; i < array.length; i++){
tempSum = tempSum - array[i-n] + array[i];
maxSum = Math.max(maxSum, t... |
TypeScript | UTF-8 | 550 | 3.125 | 3 | [
"MIT"
] | permissive |
async function* limiter(rps: number) {
while(true) {
let count: number = yield
await new Promise(resolve => setTimeout(resolve, 1000 / rps * (count || 1)))
}
}
interface LimiterFactory {
new(rps: number): AsyncGenerator<any, void, number>
(rps: number): AsyncGenerator<any, void, number>
}
interface Exports e... |
Java | UTF-8 | 642 | 3.3125 | 3 | [] | no_license | package array;
/**
* 描述:1207. 独一无二的出现次数
*
* @author zy
* @date 2019/10/14 8:55
*/
public class UniqueOccurrences {
public boolean uniqueOccurrences(int[] arr) {
int[] nums = new int[2001];
for (int i = 0; i < arr.length; i++) {
nums[arr[i] + 1000]++;
}
int[] rs = ne... |
C++ | UTF-8 | 4,766 | 2.796875 | 3 | [
"MIT"
] | permissive |
#include "Camera.h"
#include <iostream>
#include "../Transform.h"
//must be less than 90 to avoid gimbal lock
const float Camera::s_maxVerticalAngle = 85.0f;
const float Camera::s_minFov = 0.1f;
const float Camera::s_maxFov = 179.0f;
Camera::Camera()
: m_position(0.0f, 0.0f, 1.0f)
, m_viewMatrix(1.0f)
, m_proj... |
Java | UTF-8 | 1,015 | 2.546875 | 3 | [] | no_license | package main;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Alert.AlertType;
import javafx.stage.Stage;
public class Main extends Appli... |
C++ | UTF-8 | 8,389 | 3.6875 | 4 | [] | no_license | #include <Rcpp.h>
#include <vector>
// [[Rcpp::export]]
std::vector<int> NextPerm(std::vector<int> x, int n) {
// Compute the next permutation to x with maximum number at n
//
// Args:
// x : integer vector
// n : integer of the maximum x can have
//
// Returns:
// integer vector, same size a... |
Python | UTF-8 | 1,471 | 2.859375 | 3 | [] | no_license | from collections import defaultdict
from itertools import combinations
from sys import api_version
from typing import final
username = ["joe","joe","joe","james","james","james","james","mary","mary","mary"]
timestamp = [1,2,3,4,5,6,7,8,9,10]
website = ["home","about","career","home","cart","maps","home","home","about"... |
PHP | UTF-8 | 2,979 | 2.65625 | 3 | [] | no_license | <?php
function koneksi()
{
$conn = mysqli_connect("localhost", "root", "");
mysqli_select_db($conn, "tubes_193040043");
return $conn;
}
function query($sql)
{
$conn = koneksi();
$result = mysqli_query($conn, "$sql");
$books = [];
while ($book = mysqli_fetch_assoc($result)) ... |
JavaScript | UTF-8 | 5,033 | 2.921875 | 3 | [] | no_license | var API = require('./api'),
Post = require('./Post'),
_ = require('lodash');
var ViewController = function(model) {
this.model = model;
this.postCollection = [];
this.actions = [];
this.undoButton = document.getElementById('blog-undo-button');
var postTemplate = document.getElementById('blog-post-te... |
TypeScript | UTF-8 | 153 | 2.875 | 3 | [
"MIT"
] | permissive | export default function isUndefined<T>(value?: T | undefined): value is undefined {
if (value === undefined) {
return true;
}
return false;
}
|
SQL | UTF-8 | 1,905 | 3.6875 | 4 | [] | no_license | -- etaty, pracownicy, zespoly
select min(placa_pod), max(placa_pod), max(placa_pod) - min(placa_pod) from pracownicy;
select etat, avg(placa_pod) as srednia from pracownicy group by etat order by srednia desc;
select count(*) as profesorowie from pracownicy group by etat having etat = 'PROFESOR';
select id_zesp, sum... |
Python | UTF-8 | 3,065 | 3.859375 | 4 | [] | no_license | # (19)****************************Logistic Regression practical in machine learning*****************
# ----The formula which we use the Logistic Regression----y=1/1+e**-x-----y=1/1+e**-thita**T*X
# ----The formula which we use the Regression Line----y=Thita**T * X
# -----this is the formula to find out the probability... |
Markdown | UTF-8 | 8,877 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | # A more HTTP-like CouchDB client for Ruby
This client library is designed to be more familiar to those used to CouchDB's HTTP interface, as well as being a safe and efficient method of interacting with CouchDB for those just getting started.
It's based on the idea of _templates_ rather than _method calls_. Instead o... |
Markdown | UTF-8 | 1,889 | 3.09375 | 3 | [] | no_license | # README
This readme covers what you need to do to get hasura playing nicely with a
simple rails api. The goal is to make it easy to use hasura in development and
commit your changes to hasura metadata.
1. We will use rails for schema changes because Hasura's migrations are so
messy and the rails meta migration la... |
C# | UTF-8 | 674 | 2.515625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | using UnityEngine;
namespace Unity.VisualScripting
{
/// <summary>
/// Returns the component-wise quotient of two 4D vectors.
/// </summary>
[UnitCategory("Math/Vector 4")]
[UnitTitle("Divide")]
public sealed class Vector4Divide : Divide<Vector4>
{
protected override Vector4 default... |
Shell | UTF-8 | 233 | 2.578125 | 3 | [] | no_license | #!/usr/bin/env sh
# Terminate already running picom instances
killall -q picom
# Wait until the processes have been shut down
while pgrep -u $UID -x picom >/dev/null; do sleep 1; done
# Start picom
picom --experimental-backends &
|
C# | UTF-8 | 10,044 | 2.734375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
namespace DevToolsAndReferenceAnalyzer.TfsBindingCleanerClasses
{
/// <summary>
/// Class that implements the TFS Migration Cleaner feature functionality.
/// </summary>
public sealed class TfsMigrationMethods
{
/// <summary>... |
C# | UTF-8 | 1,555 | 2.96875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace MT
{
public class Task : INotifyPropertyChanged
{
public DateTime CreationDate { get; set; } = DateTime.Now;... |
Java | UTF-8 | 2,210 | 2.125 | 2 | [] | no_license | package at.rueckgr.chatbox.database.model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persiste... |
Java | UTF-8 | 718 | 2.34375 | 2 | [] | no_license | package org.objectscape.wilco;
import org.junit.Assert;
import org.junit.Test;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Created by Nutzer on 25.05.2015.
*/
public class AsyncTaskTest extends AbstractTest {
@Test
... |
Python | UTF-8 | 1,252 | 3.140625 | 3 | [
"MIT"
] | permissive | import hashlib
def Repr(obj):
return '\n'.join(['%s: %s' % (key, value)
for key, value in sorted(obj.__dict__.items())])
def HashKey(obj):
if hasattr(obj, 'HashKey'):
return obj.HashKey()
elif hasattr(obj, '__dict__'):
return HashKey(obj.__dict__)
elif isinstance(obj, (list, tupl... |
Java | UTF-8 | 2,589 | 3.953125 | 4 | [] | no_license | package binarytree;
public class BinarySearchTree {
private BinaryTreeNode root;
// insert
public void insert(int value) {
if (root == null) {
// first time insertion
root = new BinaryTreeNode(value, null, null);
} else {
insertNodeRecursively(value, root);
}
}
private void insertNodeRecursively(... |
TypeScript | UTF-8 | 2,505 | 2.640625 | 3 | [
"MIT"
] | permissive | import {AvaPwar} from './ava-pwar.js';
import {define} from 'xtal-element/define.js';
/**
* `ava-pwar-simple`
* Simple view of PWA Manifest
*
* @customElement
* @polymer
* @demo demo/index.html
*/
export class AvaPwarSimple extends AvaPwar{
static get is(){return 'ava-pwar-simple';}
set manifest(val){
... |
Python | UTF-8 | 1,249 | 3.453125 | 3 | [] | no_license | from sys import stdin
from collections import deque
# stdin = open('./input.txt', 'r')
def BFS(graph, v, visited):
# 큐 생성
queue = deque([v])
visited[v] = True
while queue:
# 큐에서 하나의 원소를 꺼낸 후
v = queue.popleft()
print(v, end = " ")
# graph에 v와 인접한 노드 중 방... |
C | UTF-8 | 5,601 | 2.71875 | 3 | [] | no_license | #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "LT_SPI.h"
#include "LTC6803.h"
// Function that writes configuration of LTC6803-2/-3
void LTC6803_wrcfg(uint8_t total_ic,uint8_t config[][6])
{
uint8_t BYTES_IN_REG = 6;
uint8_t CMD_LEN = 4+7;
uint8_t *cmd;
uint16_t cfg_pec;
uint8_t cmd_ind... |
PHP | UTF-8 | 6,566 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
class CompTags{
public static function resolve($html){
$html = self::suite($html);
$html = self::condition($html);
$html = self::http($html);
$html = self::breadcrumb($html);
$html = self::app($html);
return $html;
}
public function render($html = null){
$html = self::... |
Ruby | UTF-8 | 2,468 | 3.484375 | 3 | [] | no_license | class Defusal
def initialize
@running = true
end
def run
puts ' - Desarmar a bomba 💣 - '
puts "\n"
puts "\n"
while @running
display_instructions
defusal_sequence = gets.chomp
print `clear`
parsed_sequence = sequence_parser(defus... |
Java | UTF-8 | 384 | 2.765625 | 3 | [] | no_license | package com.Logic.Constructor;
import com.world.obstacle.Obstacle;
import com.world.obstacle.Square;
import com.world.obstacle.TriangleObstacle;
public class SquareObstacleFactory extends ObstacleFactory{
public Obstacle getObstacle(String obstacleType){
if(obstacleType.equals("SQUARE1")){
ret... |
PHP | UTF-8 | 604 | 2.75 | 3 | [] | no_license | <?php
function counting_rating($product_id,$c_id,$conn){
$output = 0;
$rate = mysqli_query($conn,"SELECT AVG(rating) AS prod_rate FROM rating WHERE product_fk = '$product_id'");
$result = mysqli_num_rows($rate);
$row = mysqli_fetch_assoc($rate);
if ($result > 0) {
foreach ($row as $value) {
... |
Java | UTF-8 | 1,613 | 2.484375 | 2 | [] | no_license | package com.trainings.rest_paging.dto;
import java.util.HashSet;
import java.util.Set;
/**
* @author jlising - 4/8/16.
*/
public class StudentInfo{
private String id;
private String student_no;
private String first_name;
private String middle_name;
private String last_name;
private AddressI... |
Shell | UTF-8 | 97 | 2.609375 | 3 | [] | no_license | #!/bin/bash
for file in *.txt;
do
mkdir -- "${file%.txt}";
mv -- "$file" "${file%.txt}";
done |
C# | UTF-8 | 2,865 | 3.5625 | 4 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic; // nice Авторско Решение
using System.Linq; // 100/100
using System.Text;
class AnonymousThreat
{
static void Main()
{
List<string> sensitiveData = Console.ReadLine().Split().ToList();
string inputLine = string.Empty;
... |
Java | UTF-8 | 2,039 | 2 | 2 | [] | no_license | package a.m.restaurant_automation;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.NavigationUI;
import com.googl... |
C++ | UTF-8 | 491 | 3.234375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int maxabsinlst(int[], int);
int main()
{
int lst[] = { -19, -3, 20, -1, 5, -25 }, size = 0;
size = sizeof(lst) / sizeof(int);
printf("%i", maxabsinlst(lst, size));
return 0;
}
int maxabsinlst(int lst[], int size)
{
int maximum = 0, tmpAbs = 0;
for(i... |
JavaScript | UTF-8 | 2,112 | 2.671875 | 3 | [
"MIT"
] | permissive |
var target_actual = {};
// SELECT
$(document).on("mousedown",".select .head_select", function(){
target_actual = $(this).parent();
var elemento = $(this);
var target = elemento.parent().find('.opciones');
console.log(target);
if (target.hasClass('slider_down')) {
target.hide();
targ... |
Java | UTF-8 | 336 | 1.867188 | 2 | [] | no_license | package com.lcz.blog.service;
import com.lcz.blog.bean.PermissionBean;
import java.util.List;
/**
* Created by luchunzhou on 15/12/9.
*/
public interface PermissionService {
/**
* 获取用户权限
* @param id
* @return
* @throws Exception
*/
List<PermissionBean> queryPermByUserId(Integer id)... |
Markdown | UTF-8 | 1,331 | 3.703125 | 4 | [
"MIT"
] | permissive | ### Java foreach原理
1. 常规写法
for(int i=0; i<list.size; i++){
//.....
}
2. 简单写法
List<String> list = new ArrayList<String>();
for(String e : list){
//
}
3. foreach原理
1. 对于list集合
List<String> a = new ArrayList<String>();
a.add("1")... |
Java | UTF-8 | 793 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package io.github.brandonjmitchell.amblur.dispatcher;
import java.lang.reflect.InvocationTargetException;
import javax.xml.stream.XMLStreamException;
import io.github.brandonjmitchell.amblur.event.ParserEvent;
import io.github.brandonjmitchell.amblur.exception.DispatcherException;
import io.github.brandonjmitchell.a... |
PHP | UTF-8 | 1,370 | 3.25 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
// 1 Od niza zadatih reči, napraviti niz čiji će svaki element ... |
Python | UTF-8 | 2,751 | 3.015625 | 3 | [] | no_license | import streamlit as st
import torch
from htbuilder import HtmlElement, div, ul, li, br, hr, a, p, img, styles, classes, fonts
from htbuilder.units import percent, px
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from PIL import Image
import numpy as np
import pandas as pd
from model... |
PHP | UTF-8 | 5,393 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
/*
* Copyright (c) 2015 Mihai Stancu <stancu.t.mihai@gmail.com>
*
* This source file is subject to the license that is bundled with this source
* code in the LICENSE.md file.
*/
namespace MS\RpcBundle\Service;
/**
* The ProxyGenerator takes an interface or a class as an input and generates a
* Proxy cla... |
Markdown | UTF-8 | 2,715 | 2.890625 | 3 | [
"ISC"
] | permissive |
## Customizing this release.
Currently, there are two basic ways of customizing epoch:
* Updating the official `sys.config` file
* Specifying your own config file at startup
Both methods require complying with the format of Erlang/OTP config files,
which will be briefly described by example below.
### The official... |
Ruby | UTF-8 | 2,555 | 3.59375 | 4 | [] | no_license |
def combine_anagrams(words)
# <YOUR CODE HERE>
#~ puts "Original"
#~ puts
#~ puts words
#~ puts words.size
#sort the letters into a sorted array
sorted = Array.new
x = String.new
y = String.new
for i in 0..words.size-1
x = words[i].to_str
y = x.downcase
#~ puts y
#~ abort("yup... |
C# | UTF-8 | 1,324 | 3 | 3 | [] | no_license | using DAL.DataContext;
using DAL.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
namespace DAL.Repository
{
public class BaseRepository<T> : IRepository<T> where T : class
{
RCContext db;
public BaseRepository(RCContext context)
{
db = context... |
Java | UTF-8 | 807 | 2.265625 | 2 | [] | no_license | package com.example.demo.core.applicationServices;
import com.example.demo.core.domainEntities.RfidCard;
import com.example.demo.core.domainEntities.RfidCard.State;
import com.example.demo.core.domainServices.IRfidCardRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframewor... |
C# | UTF-8 | 1,908 | 3 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
namespace PiaSharp.Core.Objects
{
/**
* A superpixel is the individual pixel of the output image.
* It is represented by a SINGLE position and SINGLE color at its core.
*/
public class Superpixel
{
// Location of the superpixel
public Pixel... |
Python | UTF-8 | 7,558 | 2.90625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
"""Script used to generate a cuboid dataset with cubes and rectangles under
various shapes, rotations, translations following the general format of
ShapeNet.
"""
import argparse
import random
import os
from string import ascii_letters, digits
import sys
import numpy as np
from progress.bar import... |
Markdown | UTF-8 | 3,082 | 2.609375 | 3 | [] | no_license | # Dockerized Shibboleth Service Provider
## Included
- Apache as Webserver
- Shibboleth Service Provider 2.6
- Ilias Version 5.2
- MySQL database
## Preconditions
For the host system, I recommend using a virtual machine with Debian Jessy. In addition you will need **Docker**, **Docker Compose** and **Git** on your h... |
Java | UTF-8 | 6,812 | 1.898438 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright 2002-2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... |
C++ | UTF-8 | 1,210 | 3.09375 | 3 | [] | no_license | #ifndef CAT_H
#define CAT_H
#include <QString>
#include <QChar>
#define MAX_SIZE_OF_NAME 22 //размер имени котика из БД
#define MAX_SIZE_OF_BREED 61 //размер породы котика из БД
#define CAT_SIZE 86 //размер одного котика для записи
class Cat
{
QString name; ... |
JavaScript | UTF-8 | 2,676 | 2.96875 | 3 | [] | no_license | $(function(){
/*Основные переменные*/
var btn = $('#btn');
var modal = $('.modal');
var docHeight = $(document).height();//Высота документа
/*Создаем обработчик события клик - вызов модального окна*/
btn.click(function(e){
e.preventDefault();//Отменяем стандартное событие
sW... |
Markdown | UTF-8 | 1,067 | 2.984375 | 3 | [
"MIT"
] | permissive |
# PHP Crypt
A PHP implementation of crypt methods like SHA1, SHA256, MD5 and etc. for Information Systems Bachelor (UNASP-HP)
## Hash strategy
The hash strategy that we decided to use was a mix of some algorithms: sha1, md5, and sha256. Basically, we generate a random MD5 salt that is used to concatenate with the u... |
JavaScript | UTF-8 | 610 | 2.75 | 3 | [
"MIT"
] | permissive | import { escapeHtml } from './escapeHtml.js'
describe('escapeHtml()', () => {
it('should escape quotes, ampersands, and smaller/greater than signs', () => {
expect(escapeHtml('<div id="me, myself & i"/>'))
.toBe('<div id="me, myself & i"/>')
})
it('should return an empty string if ... |
Python | UTF-8 | 4,657 | 3.703125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
-----------------------------------------------------------------------------
Spark with Python
Copyright : V2 Maestros @2016
Code Demo : Spark Machine Learning - Linear Regression
Problem Statement
*****************
The inp... |
Python | UTF-8 | 544 | 2.84375 | 3 | [] | no_license | import csv
import branchboundsearch as bb
import sys
data = {}
start = goal = str()
with open(sys.argv[1]) as f:
reader = csv.reader(f, delimiter=' ')
target = next(reader)
start = target[0]
goal = target[1]
headers = next(reader)
for row,header,i in zip(reader,headers,range(len(headers))):
... |
Shell | UTF-8 | 722 | 3.875 | 4 | [
"BSD-3-Clause"
] | permissive | #!/bin/bash -eu
DIST=$(find deploy -name 'image*lite.zip' | head -1)
if [ -z "$DIST" ]
then
echo "No distribution found. Exiting."
exit 1
fi
echo
echo "Currently mounted disks:"
diskutil list external | grep -A 2 external
DISK=$(diskutil list external | grep "/dev/disk" | head -1 | awk '{print $1}')
if [ -z "$DI... |
Markdown | UTF-8 | 2,159 | 2.828125 | 3 | [] | no_license | ---
directions: Mossley Community Centre
title: Mr Pickles Visits St John's
year: 1926
teaser: Mr. Pickles flew over Mossley looking at the queues of people outside the employment exchange.
lat: 53.52355
lon: -2.03838
---
{% include intro.html %}
Mr Pickles flew over Mossley looking at the queues of people outside th... |
Java | UTF-8 | 2,396 | 2.21875 | 2 | [
"Apache-2.0"
] | permissive | package org.cache2k.core;
/*
* #%L
* cache2k implementation
* %%
* Copyright (C) 2000 - 2020 headissue GmbH, Munich
* %%
* 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
*
* htt... |
C++ | UTF-8 | 764 | 2.703125 | 3 | [
"MIT"
] | permissive | //============================================
// Larduino w/ 328D
// DAC0 output demo
// DACO output ==> D4 on board
//============================================
#define SAMPLES 255
byte table[SAMPLES];
void setup() {
// put your setup code here, to run once:
for (int i = 0; i < SAMPLES; i++) {
table[i] = si... |
C# | UTF-8 | 746 | 2.625 | 3 | [] | no_license | using Microsoft.AspNetCore.Mvc;
using System.Reflection;
namespace SwaggerApp.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
/// <summary>
/// Get current Assembly name
/// </summary>
/// <remarks>
/// ... |
PHP | UTF-8 | 1,826 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace Microsoft\Graph\Beta\Generated\Financials\Companies\Item\SalesOrderLines\Item;
use Microsoft\Kiota\Abstractions\BaseRequestConfiguration;
use Microsoft\Kiota\Abstractions\RequestOption;
/**
* Configuration for the request such as headers, query parameters, and middleware options.
*/
class SalesOrder... |
Java | UTF-8 | 168 | 1.976563 | 2 | [
"Apache-2.0"
] | permissive | package com.daedafusion.sf;
/**
* Created by mphilpot on 7/2/14.
*/
public interface Base64Encoder
{
String encode(byte[] bytes);
byte[] decode(String s);
}
|
Java | UTF-8 | 1,185 | 1.945313 | 2 | [] | no_license | package fr.univrouen.cv21.model;
import java.util.Date;
import org.springframework.data.mongodb.core.mapping.Document;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.... |
Markdown | UTF-8 | 2,854 | 3.59375 | 4 | [
"MIT"
] | permissive | #Blitz-DB
Blitzdb (or simply blitz) is a document-oriented database for Python. It can be used either as a **stand-alone, flat-file database** or in conjunction with another database backend such as **MongoDB** or **MySQL**.
##Features
* multiple database backends (flat files, Mongo, ...)
* database transactions & ... |
PHP | UTF-8 | 1,611 | 3.234375 | 3 | [
"MIT"
] | permissive | <?php
/*
* RunTimer
* Фабрика таймеров, должна быть вызвана, чтобы потом сработал деструктор
*/
include 'Timer.php';
final class RunTimer {
private $_nameGeneralTimer;
private static $_listTimers = array();
public function __construct($name = 'TOTAL_TIMER') {
$this->_nameGeneralTimer = $name;
... |
JavaScript | UTF-8 | 1,037 | 3.90625 | 4 | [] | no_license | let button = document.getElementById("btn");
let hex = document.getElementById("hex");
let main = document.getElementById("mainDiv");
button.onclick = function() {
//Generate random color
let color = getRandomHex();
//set maindiv to random colour
main.style.backgroundColor = color;
//set hex content to ra... |
Python | UTF-8 | 139 | 3.703125 | 4 | [] | no_license | a=float(input('Radius? '))
print('area =',round(3.14*a,2))
b=float(input('enter the temperature '))
print(a,'C = ',round(1.8*b+32,2),'F')
|
Java | UTF-8 | 656 | 1.921875 | 2 | [] | no_license | package com.vika.way.srpc.constants;
/**
* @author chenwei.tjw
* @date 2022/5/12
*/
public class Constants {
public static final String DEFAULT_HOST = "127.0.0.1";
public static final int DEFAULT_PORT = 8080;
/**
* init method name
*/
public static String INIT_METHOD = "init";
/**
... |
Shell | UTF-8 | 2,489 | 3.5 | 4 | [
"Apache-2.0",
"CC-BY-4.0"
] | permissive | #!/bin/bash
#
# Copyright (c) 2016-2017 Intel Corporation
#
# 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... |
Python | UTF-8 | 627 | 4.28125 | 4 | [] | no_license | #6. take a string from the user and check contains only alphabets or not
import re
user_string = raw_input("Enter String:")
print "Without Regular Expressions"
for i in user_string:
if not i.isalpha():
flag = 0
break
else:
flag = 1
if flag == 1:
print "\nString contains only Alphabets"
els... |
Java | UTF-8 | 1,905 | 1.984375 | 2 | [] | no_license | package com.aichu.admin.vo.request;
import com.aichu.common.util.api.BasePageOrder;
import io.swagger.annotations.ApiModelProperty;
/**
* @program: ai-chu
* @description
* @author: Yuan.shuai
* @create: 2020-02-17 15:35
**/
public class AcOrderBaseRefundQueryRequest extends BasePageOrder {
@ApiModelProperty... |
Markdown | UTF-8 | 1,318 | 3.140625 | 3 | [] | no_license | # Production Problem 09: Usability Checklists
## The Problem
Usability checklists are typical, and sometimes mindless, tools/magic tricks used to find usability problems in web and other digital projects. What you are going to do for this Production Problem is to locate at least 2 different usability checklists of at... |
JavaScript | UTF-8 | 308 | 2.578125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
const Add = () => {
const [num, setNum] = useState(0);
useEffect(()=>{
alert("i am clicked")
})
return (
<button
onClick={() => {
setNum(num + 1);
}}
>
click me {num}
</button>
);
};
export default Add;
|
JavaScript | UTF-8 | 485 | 3.78125 | 4 | [] | no_license | function speedOmeter(speed) {
speed = Number(speed);
let result = "";
if (speed <= 10) {
result = "slow";
}
else if ((10 < speed) & (speed <= 50)) {
result = "average";
}
else if ((50 < speed) & (speed <= 150)) {
result = "fast";
}
else if ((150 < speed) & (sp... |
Swift | UTF-8 | 701 | 3.28125 | 3 | [] | no_license | //
// ingredients.swift
// Bootcamp_Recipe
//
// Created by Bakiza Zhanbatyrova on 2017-03-16.
// Copyright (c) 2017 Zavier Patrick David Aguila. All rights reserved.
//
import Foundation
class Ingredients{
init(food_quantity: Float, name: String, calories: Int){
self.food_quantity = food_quantity
... |
PHP | UTF-8 | 1,273 | 3.390625 | 3 | [] | no_license | <?php
// $handle = fopen('sampleInput.txt', 'r');
$handle = fopen('input.txt', 'r');
$twosCount = 0;
$threesCount = 0;
while (($line = fgets($handle, 4096)) !== false) {
// TODO remove newline? don't need to, only one per line, won't be dupes of it
// echo "raw line: $line";
$lineArray = str_split($line);
sor... |
Python | UTF-8 | 1,011 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/python
import os
import sys
import time
import termios
import fcntl
from Adafruit_PWM_Servo_Driver import PWM
# Terminal init stuff found on stackoverflow (SlashV)
fd = sys.stdin.fileno()
oldterm = termios.tcgetattr(fd)
newattr = termios.tcgetattr(fd)
newattr[3] = newattr[3] & ~termios.ICANON & ~termios.ECH... |
Java | UTF-8 | 18,476 | 2.234375 | 2 | [
"Apache-2.0",
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... |
Java | UTF-8 | 380 | 1.859375 | 2 | [] | no_license | package mapper;
import domain.ItemsCustom;
import domain.ItemsQueryVo;
import java.util.List;
public interface ItemsMapperCustom {
// 商品查询列表
List<ItemsCustom> findItemsList(ItemsQueryVo itemsQueryVo)
throws Exception;
ItemsCustom findItemsById(Integer id) throws Exception;
void updateItems(I... |
Shell | UTF-8 | 1,182 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
# set -x
if [ $# -ne 3 ]; then
echo "usage: ./self scheduler_node mpi.conf dir_of_mpi_node_sh"
exit -1;
fi
# support mpich and openmpi
# try mpirun -n 1 env to get all available environment
if [ ! -z ${PMI_RANK} ]; then
my_rank=${PMI_RANK}
elif [ ! -z ${OMPI_COMM_WORLD_RANK} ]; then
my_rank... |
C++ | UTF-8 | 981 | 3.65625 | 4 | [] | no_license | #include "max_heap.h"
max_heap::max_heap(int n)
{
data = new int[n];
node = 1;
length = 0;
}
void max_heap::shift_up(int index)
{
if(index > 1)
{
int temp = data[index];
data[index] = data[index/2];
data[index/2] = temp;
}
}
void max_heap::insert(int element)
{
data[node] = element;
int index = node;
... |
Python | UTF-8 | 1,437 | 4.5 | 4 | [] | no_license | #Creating a mapping of state to abbreviation
states = { #Create a dict for states
'Oregon': 'OR',
'Florida': 'FL',
'California': 'CA',
'New York': 'NY',
'Michigan': 'MI'
}
#create a basic set of states and some cities in them
cities = { #create a dict for cities
'CA': 'San Francisco',
'MI': 'Det... |
Python | UTF-8 | 1,220 | 2.625 | 3 | [] | no_license | import pymysql
from constants import *
def getQuery(tableName, tgtCol = 'evalCol'):
return 'SELECT * FROM ' + tableName + ' AS t1 INNER JOIN (SELECT max(' + tgtCol + ') as evalColMax FROM ' + tableName + ') AS t2 ON t1.' + tgtCol + ' = t2.evalColMax'
inputFileAttrs = open('data/dictOfAttributesFile.txt', 'r')
dictOf... |
Java | UTF-8 | 3,429 | 2.25 | 2 | [] | no_license | package com.MavenGitEclipse;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.KeyManagementException;
... |
C++ | UTF-8 | 3,712 | 2.640625 | 3 | [
"MIT"
] | permissive | /*!
* util.cc (https://github.com/SamsungDForum/NativePlayer)
* Copyright 2016, Samsung Electronics Co., Ltd
* Licensed under the MIT license
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRA... |
Java | UTF-8 | 5,917 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019 sulzbachr.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... |
Python | UTF-8 | 1,213 | 3.296875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 13 20:37:59 2018
@author: paulhuynh
"""
import os
import docx2txt
import pandas as pd
#set working directory
os.chdir('/Users/christophrico/documents/msds_453/corpus')
#function to retreive and turn document into text
def retrieve_DSI(file_name)... |
PHP | UTF-8 | 1,070 | 2.640625 | 3 | [] | no_license | <?php
session_start();
include('../connect.php');
$a = $_POST['caption'];
$b = $_POST['desc'];
// query
$vid = $_FILES["file"] ["name"];
$type = $_FILES["file"] ["type"];
$size = $_FILES["file"] ["size"];
$temp = $_FILES["file"] ["tmp_name"];
$error = $_FILES["file"] ["error"];
... |
Swift | UTF-8 | 1,297 | 2.921875 | 3 | [] | no_license | //
// Chat.swift
// RideAlong
//
// Created by Erin Flynn on 4/25/17.
//
//
import Foundation
import Firebase
class Chat {
private var chatsRef: FIRDatabaseReference!
private var _name: String?
private var _otherID: String?
private var _chatID: String?
private var _Key: String?
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.