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 | 766 | 2.640625 | 3 | [] | no_license | import cv2
from imagePCA import fullProcess, trial2
numberFrames = 120
numberComponents = 200
FPS = 24
width = 1920
height = 1080
fourcc = cv2.VideoWriter_fourcc(*'MP42')
video = cv2.VideoWriter('compressedCars_200.avi', fourcc, float(FPS), (width, height))
# Function to extract frames
def compressVideo(path):
... |
Python | UTF-8 | 1,674 | 2.703125 | 3 | [] | no_license | import os, os.path, datetime, re
from pieberry.pieobject import PieObject
from pieberry.pieobject.diagnostic import determine_file_type
re_dateprefix = re.compile(r'^[12][0-9]{3}[01][0-9][0123][0-9]')
def get_fake_metadata(fn):
m = re_dateprefix.match(os.path.basename(fn))
if m:
# if it has a date pr... |
Go | UTF-8 | 1,652 | 3.015625 | 3 | [
"Unlicense"
] | permissive | package model
import "time"
//RouteOwnershipStore store which server know which token
type RouteOwnershipStore struct {
whoKnows map[ /*token*/ string] /*addr*/ string //store data include self data for easier clone to other new join machine
whenExpire map[int64][] /*token*/ string
}
var sharedRouteOwnershipStor... |
Java | UTF-8 | 16,195 | 2.078125 | 2 | [] | no_license | package com.service.suspect.impl;
import com.common.utils.StringHelp;
import com.entity.DicCommon;
import com.entity.DicUnit;
import com.entity.suspect.EtGang;
import com.entity.suspect.EtSuspect;
import com.entity.suspect.OperSuspectVo;
import com.mapper.suspect.EtGangMapper;
import com.mapper.suspect.EtSuspectMapper... |
JavaScript | UTF-8 | 943 | 3.21875 | 3 | [] | no_license | /**
* A simple wrapper for short Audio playback, used to play
* FX sounds such as the sound played when you hit the wall.
* @param {String} path URL / relative path to sound file.
* @param {Number} volume A volume level between 0 and 1, defaults to 1
*/
export default class Sound {
const... |
TypeScript | UTF-8 | 2,216 | 2.8125 | 3 | [] | no_license | /*
file handles updating users details
*/
import { User } from "../entity/User";
import { getConnection } from "typeorm";
import { InputUpdateUser, UpdateUser } from "./users-interface";
import { passwordHash } from "./users-helpers";
import { existingEmailCheck, regexEmailCheck } from "./users-helpers";
import { ... |
Java | UTF-8 | 2,468 | 2.5625 | 3 | [] | no_license | package protocol.subprotocol.handler;
import protocol.Chunk;
import protocol.Peer;
import java.util.concurrent.TimeUnit;
import static protocol.subprotocol.Subprotocol.PUTCHUNK;
public class PutchunkHandler extends Handler implements Runnable {
private static final int MAX_PUTCHUNK_REPEAT = 5;
private stat... |
Shell | UTF-8 | 1,590 | 4.125 | 4 | [] | no_license | #!/usr/bin/env bash
# outputs md5s of files in a given directory
# depending on mode and cpu it could be faster if run on parallel mode
# use the time to see the difference
# in my simple experiment, the parallel was 4 times faster
function showHelp()
{
echo "parallel_md5.sh [-s] /path/to/dir "
exit 1
}
para... |
C++ | UTF-8 | 2,356 | 2.65625 | 3 | [] | no_license | #ifndef PARTICLE_H
#define PARTICLE_H
#include<iostream>
#include<fstream>
#include<stdlib.h>
#include<math.h>
using namespace std;
class CParticle{
public:
CParticle(){
init();
}
void init(){
kn=1e+6;
cn=0;//1e+2;
x=0; y=0; r=1;
vx=0; vy=0;
ax=0; ay=0;
ax0=0; ay0=0;
q=0;w=0;
aq=0; aq=0;
... |
Java | UTF-8 | 18,681 | 1.710938 | 2 | [] | no_license | package es.pfctonimartos.tpms;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.Bluetoo... |
Python | UTF-8 | 21,051 | 2.9375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 8 14:15:54 2014
@author: Brian Donovan (briandonovan100@gmail.com)
"""
from routing.BiDirectionalSearch import bidirectional_search
from routing.Map import Map
from Trip import Trip
from datetime import datetime
import csv
import math
from multiprocessing import Pool
f... |
C++ | UTF-8 | 476 | 2.96875 | 3 | [] | no_license | /*****************************************************
PROGRAMA QUE CALCULA LA VELOCIDAD DE UNA PARTICULA
Nombre: Nicolás Cano Botero
MARZO 22/2021
******************************************************/
#include <iostream>
using namespace std;
int main ()
{
float d , t;
float velocidad;
cout... |
Java | UTF-8 | 2,848 | 2.875 | 3 | [] | no_license | package StudentBAL;
import StudentBean.CourseBean;
import connection.DBConnection;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;... |
Python | UTF-8 | 1,356 | 2.953125 | 3 | [] | no_license |
# coding: utf-8
# In[141]:
import math
from collections import Counter
import pandas as pd
import numpy as np
import os
import sys
import getopt
import csv
def entropy_single(seq):
seq=seq.upper()
num, length = Counter(seq), len(seq)
return -sum( freq/length * math.log(freq/length, 2) for freq in num.... |
Markdown | UTF-8 | 613 | 2.90625 | 3 | [] | no_license | # BangDreamSongRandom
[NOT FOR SALE] Just random data in an Excel file
<br><br>
Directory Structure:
<br>
|SomeFolder <br>
|-------|BandoriRandomSong.exe <-- Run this file<br>
|-------|src <br>
|-------|---|song_list.xlsx
<br><br>
=== GUI ===<br>

<br><br>
=== HOW TO USE === <br>
1.Set songs in... |
Java | UTF-8 | 2,607 | 2.265625 | 2 | [] | no_license | package com.cdancy.jenkins.rest.domain.job;
import org.jclouds.javax.annotation.Nullable;
import javax.annotation.Generated;
/**
* @author: seal
* @Description:
* @company: xingfeiinc
* @e-mail: linxiao@xingfeiinc.com
* @date: 2018-10-29 16:50
*/
@Generated("com.google.auto.value.processor.AutoValueProcessor")... |
Python | UTF-8 | 9,990 | 2.59375 | 3 | [] | no_license | __author__ = 'kevin'
# import statistics as stat
import networkx as nx
import os
from attacksurfacemeter.call import Call
from attacksurfacemeter.call_graph import CallGraph
from attacksurfacemeter.environments import Environments
from attacksurfacemeter.loaders.javacg_loader import JavaCGLoader
class AndroidCallGr... |
Python | UTF-8 | 276 | 2.890625 | 3 | [] | no_license | # https://github.com/joaohelis/n_ary_tree_with_python/blob/master/n_ary_tree.py
from trees.n_ary_trees.Node import Node
class NAryTree(Node):
def __init__(self):
self.root = None
self.size = 0
def insert(self, key, parent_key):
pass |
C++ | UTF-8 | 908 | 2.96875 | 3 | [] | no_license | #include "CircularIslandMaskFilter.hh"
CircularIslandMaskFilter::CircularIslandMaskFilter(float innerRadius, float outerRadius, PerlinNoiseGenerator &perlin):
mPerlin(perlin),
mInnerRadius(innerRadius / 2.0f),
mOuterRadius(outerRadius / 2.0f)
{
}
double CircularIslandMaskFilter::filter(double x, double y... |
Java | UTF-8 | 3,440 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | package java_hadoop.chapter9;
import java.io.File;
import java.io.IOException;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mappe... |
SQL | UTF-8 | 755 | 2.53125 | 3 | [] | no_license | --1----------------
declare
v_date date;
v_no number:=10;
v_name varchar2(100) not null:='khaled'; --when you use not null then you should give value
begin
dbms_output.put_line(v_date);
dbms_output.put_line(v_no);
dbms_output.put_line(v_name);
v_no:=v_no+10;
v_name:='carla';
dbms_output.put_line(v_name);
v_date:='10-Ma... |
Python | UTF-8 | 11,299 | 2.828125 | 3 | [] | no_license | #/usr/bin/python3
#~/anaconda3/bin/python
'''This module takes a list of barcodes as input. It searches ArchivesSpace and
Voyager for those barcodes and returns collection information. This application
is used for Yale MSSA's LSF transfer process.'''
import csv
import json
import logging
import sys
impo... |
Python | UTF-8 | 4,215 | 2.859375 | 3 | [
"MIT"
] | permissive | # -*- coding:utf-8 -*-
import numpy as np
from scipy.stats import multinomial
from scipy.stats import dirichlet
def cumulative_algorithm(p: list) -> int:
p = np.array(p)
for i in range(1, len(p)):
p[i] = p[i-1] + p[i]
u = np.random.uniform(0, 1) * p[-1]
i = 0
while i < len(p):
... |
SQL | UTF-8 | 16,555 | 2.75 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 29, 2018 at 07:12 PM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
Markdown | UTF-8 | 1,401 | 2.984375 | 3 | [] | no_license | 当你设置节点的渲染状态时,这个状态将被赋予当前的节点及其子节点。如 果子节点对同一个渲染状态设置了不同的属性参数,那么新的子节点状态参数将会覆盖原有的。换句话说,缺省情况下子节点可以改变自身的某个状态参数,或者继承父节点的同一个状态。
这种继承的特性在许多情况下都非常实用。但是有时候渲染可能需要更多特性。假设场景图形中有一个包含了实体多边形几何体的节点。如果要以线框模式来渲染场景图形,你的程序就需要覆盖这种多边形渲染模式状态,不论它出现在什么位置。
OSG 允许用户根据场景图形中任意位置的渲染属性和模式需求,而单独改变原有的状态继承特性。用户可以选择以下这几种枚举形式:
- osg::StateAttribute:: OVERR... |
Shell | UTF-8 | 116 | 3.328125 | 3 | [] | no_license | #!/bin/bash
a=0
while [ $a -lt 25 ]
do
echo "Hello World, the cirrent value of a : $a"
a=`expr $a + 1`
done
|
Java | UTF-8 | 588 | 2.5 | 2 | [] | no_license | package com.adonax.sivi;
import javax.swing.JTextPane;
public class AboutPane
{
static private String txt =
"SiVi was written by Phil Freihofner\n"
+ "with contributions from Sumio Kiyooki.\n"
+ "\n"
+ "Simplex Noise was originally developed by \n"
+ "Ken Perlin. We make use of an implementation \n"... |
PHP | UTF-8 | 2,463 | 2.625 | 3 | [] | no_license | <?php
//View plans and comment on them
include_once "class_player.inc.php";
include_once("class_planner.inc.php");
include_once("class_plan.inc.php");
if (isset($_SESSION['user_id'])) {
$currentUser = $_SESSION['user_id'];
include_once "header2.inc.php";
}
else {
$currentUser = 0;
include_once "header.inc.php";
}... |
Java | UTF-8 | 257 | 1.609375 | 2 | [] | no_license | package cn.talianshe.android.bean;
import org.parceler.Parcel;
@Parcel
public class AssociationActivityInfo {
public String associationName;
public String associationId;
public String activityName;
public String activityId;
}
|
Shell | UTF-8 | 1,853 | 4.03125 | 4 | [
"MIT"
] | permissive | #!/bin/bash
usage() {
echo
echo "USAGE: $0 <archive_format> <student_media_dir>[,<student_media_dir>,...]"
echo
echo " Archive Formats:"
echo " 7z -7zip with LZMA compression split into 2G files"
echo " 7zma2 -7zip with LZMA2 compression split into 2G files"
echo " 7zcopy -7zip wi... |
C | UTF-8 | 17,568 | 2.71875 | 3 | [
"BSD-2-Clause"
] | permissive | /*
* UNIBA/Ampere 1.3
* Gruppo n.16 - Marco Furone, Michele Barile, Nicolo' Cucinotta, Simone Cervino
* Progetto universitario di gruppo intento alla creazione di un gestore dati per la musica, es: WinAmp
* da realizzare nell'ambito del corso di studi di Laboratorio di Informatica, a.a. 2019/20.
* Maggiori informa... |
Java | UTF-8 | 9,130 | 1.539063 | 2 | [
"MIT"
] | permissive | package io.onedev.server.web.component.issue.authorizations;
import static io.onedev.server.model.IssueAuthorization.PROP_ISSUE;
import static io.onedev.server.model.IssueAuthorization.PROP_USER;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.lang.StringUtils;... |
Go | UTF-8 | 618 | 2.578125 | 3 | [] | no_license | package models
import(
"fmt"
"github.com/astaxie/beego/orm"
_"github.com/go-sql-driver/mysql"
)
type Page struct {
Id int
Website string
Email string
}
func init() {
// 注册数据库
orm.RegisterDataBase("default","mysql",
"root@123456@tcp(127.0.0.1:3306)/test?charset=utf8")
orm.RegisterModel(new(Page))
}
func ... |
TypeScript | UTF-8 | 1,470 | 3.640625 | 4 | [
"MIT"
] | permissive | export interface BoomProps {
min: number,
max: number,
s1: string,
s2: string
}
/**
* Provide to find boom number
*/
export default class Boom {
/**
* props holds general properties to find boom number.
*/
private props: BoomProps;
/**
*
* @param props
*/
pub... |
JavaScript | UTF-8 | 602 | 3.109375 | 3 | [] | no_license | 'use strict';
(function () {
// Урезанный полифилл для insertAdjacentElement позиции afterend (других не использовал). В старой мозилле этот метод не работает. Пришлось на коленке изобретать свой.
if (!Element.prototype.insertAdjacentElement) {
Element.prototype.insertAdjacentElement = function (position, elem... |
Markdown | UTF-8 | 3,026 | 2.921875 | 3 | [] | no_license | ---
layout: doc
title: MMT Statistics Exporter
---
This adds the build target 'statistics' to MMT producing statistical information about an archive, an mmt document or a theory. The statistics are generated from the relational data files in an archive and are written to JSON files in export/statistics, one file per M... |
C++ | UTF-8 | 783 | 2.921875 | 3 | [] | no_license | #pragma once
#include <vector>
#include <map>
using namespace std;
class Solution {
public:
string findCommonStringOnRightBox(vector<string>& boxIds) {
string returnString = "";
for (int i = 0; i < boxIds.size(); i++)
{
for (int j = i+1; j < boxIds.size(); j++)
{
int numberOfDifferentLetters = 0... |
JavaScript | UTF-8 | 1,785 | 2.984375 | 3 | [] | no_license | import React, { useState } from 'react'
import ReactDOM from 'react-dom'
const Statistics = (props) => {
if (props.total === 0 && props.alert === true) {
return (
<tr>
<td>No feedback given</td>
</tr>
)
}
else if (props.total === 0) {
return (
<tr></tr>
)
}
else re... |
Markdown | UTF-8 | 812 | 2.96875 | 3 | [] | no_license | Question: https://leetcode.com/problems/palindromic-substrings/
---
try_1.py: O(n^2) O(n)
* Runtime: 220 ms, faster than 49.96% of Python3 online submissions for Palindromic Substrings.
* Memory Usage: 22.1 MB, less than 27.39% of Python3 online submissions for Palindromic Substrings.
> dp[i][j] = i~j is palindrone... |
Java | UTF-8 | 7,119 | 1.5625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2017 HugeGraph Authors
*
* 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, Ve... |
C# | UTF-8 | 1,914 | 3.265625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Media;
namespace LearningRobot
{
class Time : INotifyPropertyChanged
{
// These fields hold the values for the public properties.
private int allTime = 0;... |
Markdown | UTF-8 | 12,361 | 2.75 | 3 | [
"MIT"
] | permissive | # 引言
## 一、需求方面
### 故事一
长沙21岁大学生和女友在网吧上通宵网时,女友手机被偷。为帮女友找回手机,小李在网吧兼职做夜班网管,蹲守了13个通宵后,小李终于等到窃贼,将其抓获。女朋友知道后十分感动但是她已经跟了送她爱疯5的学长。
### 结论
(这是一个产品经理和用户需求的故事。)法海不懂爱,难免,但素素却一定要知道其心结所在,不然过一段时间又来次水浸金山,那不如去威利斯更浪漫些吧。
### 故事二
一个学生看见一只乌龟艰难地在河边陡坡上挣扎前行,心想这只可怜的乌龟本应呆在水中,一定是被碎石困住了。于是他拎起它,放回水里。旁边的教授说:"你知道它花了多大努力才爬上岸来产卵吗?"。
### 结论
做市... |
Python | UTF-8 | 3,463 | 2.578125 | 3 | [] | no_license | from pathlib import Path
from flask import g, current_app
from sketchbook.db import get_db
from werkzeug.utils import secure_filename
from werkzeug.exceptions import abort
def load_projects():
"""Load projects of a logged in user and keep in g to make available for menu etc"""
if not g.user:
g.projects = None
el... |
Swift | UTF-8 | 9,237 | 3.203125 | 3 | [] | no_license | //
// Day5.swift
// Year2019
//
// Created by PJ COOK on 05/12/2019.
// Copyright © 2019 Software101. All rights reserved.
//
import Foundation
import InputReader
public class AdvancedIntCodeComputer {
private var data: [Int]
public var readData: [Int] { return data }
public init(data: [Int]) {
... |
PHP | UTF-8 | 2,026 | 3.5 | 4 | [] | no_license | <?php
/*
Realizar una clase llamada “Auto” que posea los siguientes atributos privados:
_color (String)
_precio (Double)
_marca (String).
_fecha (DateTime)
Realizar un constructor capaz de poder instanciar objetos pasándole todos los parámetros:
Realizar un método de instancia llamado “AgregarImpuestos”, que recibirá u... |
Markdown | UTF-8 | 2,727 | 2.84375 | 3 | [] | no_license | ---
title: "Cómo: Trabajar con diccionarios mediante LINQ to XML (C#) | Microsoft Docs"
ms.custom:
ms.date: 2015-07-20
ms.prod: .net
ms.reviewer:
ms.suite:
ms.technology:
- devlang-csharp
ms.topic: article
dev_langs:
- CSharp
ms.assetid: 57bcefe3-8433-4d3b-935a-511c9bcbdfa8
caps.latest.revision: 3
auth... |
Rust | UTF-8 | 2,507 | 2.921875 | 3 | [] | no_license | use super::biome::{Biome, BiomeLibrary};
use super::layers::{Layer, SoilLayer, TileLayer};
use super::tile::{Soil, Tile};
use crate::wg_utils::point_2d::Point2D;
use tcod::console::Console;
pub struct Map {
pub width: i32,
pub height: i32,
pub soils: SoilLayer,
pub tiles: TileLayer,
pub biome: Biom... |
Markdown | UTF-8 | 1,150 | 2.71875 | 3 | [
"MIT"
] | permissive | <text lang="cn">
#### 预加载的卡片
数据读入前会有文本块样式。
</text>
```html
<template>
<div>
<s-switch on-change='onChange' />
<s-card
title="Card title"
hoverable="{{true}}"
style="width: 300px;margin-top: 16px;"
loading="{{loading}}"
>
<template ... |
C | UTF-8 | 248 | 3.734375 | 4 | [] | no_license | #include<stdio.h>
int fact(int);
void main()
{
int n,factorial;
printf("Enter the number: ");
scanf("%d",&n);
factorial=fact(n);
printf("factorial is %d",factorial);
}
int fact(m)
{
if(m==0)
return(1);
else
return(m*fact(m-1));
}
|
Markdown | UTF-8 | 3,188 | 4.375 | 4 | [] | no_license | ### LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.
get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
put(key, value) - Set or insert the value if the key is n... |
C++ | UTF-8 | 3,421 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | /*
* CodeBuffer.cpp
*
* Created on: March 3, 2010
* Author: lawrence.daniels@gmail.com
*/
#include <stdio.h>
#include "CodeBuffer.h"
/**
* Constructor
*/
CodeBuffer::CodeBuffer( int initialSize, int growth ): ByteBuffer( initialSize, growth ) {
// do nothing
}
/**
* Constructor
*/
CodeBuffer::CodeB... |
Java | UTF-8 | 966 | 2.8125 | 3 | [] | no_license | package com.Authorization;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class CodeGenerator {
private String macAddr;
private String addCode;
public CodeGenerator(String macAddr){
this.macAddr = macAddr;
}
public CodeGenerator(String macAddr, String addCode){
th... |
Java | UTF-8 | 425 | 2.25 | 2 | [] | no_license | package customer;
import java.util.List;
public interface CustomerService {
//CRUD (Create, Read, Update, Delete)
void customer_insert(CustomerVO vo); //고객 정보 신규 저장
List<CustomerVO> customer_list(); //고객 목록 조회
CustomerVO customer_detail(int id); //고객 상세 조회
void customer_update(CustomerVO vo); //고객 정보 변경
void ... |
Markdown | UTF-8 | 2,761 | 2.953125 | 3 | [] | no_license | # Disclaimer
Wrote this in my free time as a **private person**. **This is not affiliated with SAP!**
# Purpose
The purpose of this tool is to allow a **oAuth user grant flow JWT retrieval** been automated within a CLI tool.
Most tools only implemented client credentials flow.
This CLI tool will boostrap a small ht... |
Java | UTF-8 | 1,514 | 3.078125 | 3 | [] | 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 lab7b_2;
/**
*
* @author andro
*/
interface TVStation {
String SATELLITE_NAME = "SKY Network";
String CABLE_TV_NAM... |
Java | UTF-8 | 1,184 | 3.703125 | 4 | [] | no_license | package arithmetic;
/**
* @ClassName LongestSequence
* @Description 输入一串数字,找出最长序列长度
* @Author Cao.Zhuang
* @Date 2019/9/26 9:34
*/
public class LongestSequence {
public static void main(String[] args) {
int[] nums = {5, 2, 4, 3, 9, 10};
int[] dp = new int[nums.length];
... |
JavaScript | UTF-8 | 1,052 | 3.25 | 3 | [] | no_license | const express = require('express');
const app = express();
// "/" => "Hi there"
app.get("/", (req, res) => res.send("Hi there, welcome to my assignment!"));
app.get("/speak/:animal", (req, res) => {
const sounds = {
dog: "woof",
pig: "oink",
cat: "I hate you human",
cow: "moo",
... |
PHP | UTF-8 | 584 | 2.53125 | 3 | [] | no_license | <?php
session_start();
$name = $_POST['name'];
$phone = $_POST['phone'];
$arr = array();
$con = mysqli_connect('localhost','root','','access');
// trying to acccess the data of both the table in one array and storing it in session
$data = "SELECT * FROM customer,account where customer.Name = account.Nam... |
C# | UTF-8 | 774 | 3.765625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
public static class RotationalCipher
{
private static char rotateChar(char ch, int rot)
{
bool isUpper = char.IsUpper(ch);
int currVal = char.ToLower(ch) - 'a';
int newVal = (currVal + rot) % 26;
char newCh = (char)('a' + newVal);
... |
C++ | UTF-8 | 1,328 | 2.546875 | 3 | [] | no_license | #include "stdafx.h"
#include "LayoutUI.h"
#include "EightEngine\EventManager\EventManager.h"
#include "EightEngine\EventManager\Events\ChangeMenuScreenEventData.h"
void LayoutUI::KeyDown(UINT keyCode)
{
}
void LayoutUI::MoveEvent(const DirectX::XMFLOAT3 &movingDirection)
{
EIGHT_ASSERT(!(movingDirection.z < -1.f || ... |
JavaScript | UTF-8 | 5,663 | 2.609375 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"GPL-1.0-or-later",
"MIT",
"CPL-1.0",
"NPL-1.1",
"MPL-1.1"
] | permissive | /*
* Copyright 2008 The Closure Compiler 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 applicable ... |
Java | UTF-8 | 1,677 | 2.125 | 2 | [] | no_license | package com.changuang.domain.entity;
// Generated 2017-12-1 14:27:22 by Hibernate Tools 4.0.0.Final
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence... |
Python | UTF-8 | 229 | 3.3125 | 3 | [] | no_license | list1 = [int(i) for i in input()]
count = 0
for i in range(0, len(list1)):
if (list1[i] == 1):
count = count + 1
if (count % 2 == 0):
list1.append(0)
else:
list1.append(1)
for i in list1:
print(i, end="")
|
TypeScript | UTF-8 | 1,680 | 2.5625 | 3 | [] | no_license | 'use strict';
class DianPing {
from = '';
txHash = '';
time = 0;
dpType = '0';
link = '';
name = '';
score = '';
content = '';
constructor(text) {
if (!text) {
return;
}
const o = JSON.parse(text);
this.from = o.from;
this.txHash = o.txHash;
this.time = o.time;
th... |
Markdown | UTF-8 | 5,321 | 3.484375 | 3 | [
"MIT"
] | permissive | ---
date: 2021-12-22
title: 'System Design: SQL vs NoSQL'
---
When deciding what type of database to use for an application system, it's important to know about the strengths and weaknesses of your options. The main two types are SQL (relational database) and NoSQL (non-relational / distributed database).
## SQL
SQL... |
Swift | UTF-8 | 392 | 2.609375 | 3 | [] | no_license | class Solution {
func canCompleteCircuit(_ gas: [Int], _ cost: [Int]) -> Int {
var rest = 0
var run = 0
var res = 0
for i in gas.indices {
run += gas[i] - cost[i]
rest += gas[i] - cost[i]
if run < 0 {
res = i + 1
run... |
JavaScript | UTF-8 | 3,205 | 3.390625 | 3 | [] | no_license | // var apiKey = "0b52128a7a6341f58a4008807c5a9bca";
// var apiKey = "a4665615a30f4922b1cdd9ba14a85e5c";
var apiKey = "872bc99d756a4f50a85f8f88f801cdb5";
// var apiKey = "ad074955fa2a4c79a5b3f5d5a65fc461";
var ingredientButton = document.getElementById("submit-button");
//Input button on click
// var ingredient= "i... |
JavaScript | UTF-8 | 711 | 3.28125 | 3 | [] | no_license | /**
* getViewport() returns the workable width and height of your system
* First element in the array returns the innerWidth
* Second element in the array returns the innerHeight
* @returns {*[]}
*/
function getViewport() {
var a, b;
void 0 !== typeof window.innerWidth ? (a = window.innerWidth, b = window... |
Java | UTF-8 | 3,409 | 2.65625 | 3 | [] | no_license | package ru.job4j.solid.srp;
import org.junit.Test;
import ru.job4j.solid.srp.report.Report;
import ru.job4j.solid.srp.report.ReportBUH;
import ru.job4j.solid.srp.report.ReportHR;
import ru.job4j.solid.srp.report.ReportIT;
import ru.job4j.solid.srp.store.MemStore;
import java.util.Calendar;
import static org.hamcrest... |
Markdown | UTF-8 | 1,211 | 3.078125 | 3 | [] | no_license | ---
layout: post
title: "Book review: Spring Boot in Action"
date: 2017-02-11 14:30:00 +0100
categories: jekyll update
---
Spring is a widely used application framework. However, configuring a Spring application can be pretty painful.
Spring Boot heavily simplifies the development by embedding a lot that is needed. ... |
C# | UTF-8 | 4,117 | 2.734375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
using System.IO;
namespace DataBaseProject
{
... |
PHP | UTF-8 | 2,452 | 2.828125 | 3 | [] | no_license | <?php
require_once "ConectBD.php";
class ManipulacaoDados extends \Classes\ConectBD{
public $mes;
public $dia;
public $ano;
private $caminho,$arquivo;
public function __construct(){
parent::__construct();
$this->mes = date("m");
$this->dia = date("d");
$this->ano =... |
C | GB18030 | 487 | 3.90625 | 4 | [] | no_license | #include<stdio.h>
int main() {
char c;
//c = getchar();
int count1=0, count2=0, count3=0, count4=0;
printf("һַ\n");
while ((c = getchar()) != '\n') {
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
count1++;
else if (c == ' ')
count2++;
else if (c >= '0' && c <= '9')
count3++;
e... |
Java | UTF-8 | 527 | 3.515625 | 4 | [
"MIT"
] | permissive | package di.anno02;
import javax.annotation.Resource;
public class Car {
private Tire tire;
public Car() {
System.out.println("Car()...");
}
// @Resource -> 생성자에는 붙일수 없음
public Car(Tire tire) {
this.tire = tire;
System.out.println("Car(Tire)...");
}
@Resource // Resource : set에만 할수있음
public void set... |
Python | UTF-8 | 738 | 3.359375 | 3 | [] | no_license | # Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def isPalindrome(self, head: ListNode) -> bool:
counter = 0
curr = head
while curr:
counter += 1
cur... |
Markdown | UTF-8 | 1,639 | 3.8125 | 4 | [] | no_license | # Unit 3: Javascript Fundamentals
## Module 3.1
### Course Material
* 3.1 [Think like a computer: the logic of programming](https://openclassrooms.com/en/courses/5261196-think-like-a-computer-the-logic-of-programming)
* OC course time: 4 hrs
### Mini-Projects
* Included in OC course:
* Mini-Project 3.1a:
... |
Java | UTF-8 | 2,040 | 2.265625 | 2 | [] | no_license | package SampleMaven.SampleMaven.Pages;
import java.util.List;
import java.util.Set;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import SampleMaven.SampleMaven.SeleniumPractice.testSuite.BaseTest;
public class H... |
Java | UTF-8 | 788 | 4.0625 | 4 | [] | no_license | /**
*
* @author David Lambropolos
*
* If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
* Find the sum of all the multiples of 3 or 5 below 1000.
*
*/
public class MultiplesOf3and5
{
public static void main(String[] args)
{
l... |
Markdown | UTF-8 | 574 | 2.921875 | 3 | [] | no_license | # shuffle-quest
## About
Sometimes when I shuffle cards, it is bad. I only take some random small number of cards off of the top and the bottom, then put those cards collectively either on the top or bottom of the deck. Basically I am just cutting the deck over and over, in disguise as something else.
I have taught T... |
C# | UTF-8 | 1,895 | 2.609375 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent (typeof(Ball))]
public class BallDragLaunch : MonoBehaviour {
private Ball ball;
private Vector3 dragStart, dragEnd;
private float startTime, endTime;
void Start () {
ball = GetComponent<Ball>()... |
JavaScript | UTF-8 | 254 | 2.671875 | 3 | [] | no_license | class pizza(s,m,v){
this.size = s;
this.meatToppings = m;
this.veggieToppings = v;
//type construct below
sizeCost (){
if(this.size = "Small")
return sizecost = "7.99"
//type instance functions below
//type class functions below
}
|
Java | UTF-8 | 10,544 | 1.71875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
Python | UTF-8 | 347 | 3.5625 | 4 | [] | no_license | #Naive Approach
A="abcb"
def first_recur(A):
for i in xrange(len(A)):
if A[i] in [k for k in A[i+1:]]:
#print i
return A[i]
return None
#print (first_recur(A))
#print A[1:]
#Better Approach
def fRecur(A):
d={}
for i in A:
if (i in d):
return i
else:
d[i]=i
retur... |
C++ | UTF-8 | 10,278 | 3.25 | 3 | [] | no_license | //
// main.cpp
// HoughTransform
//
// Created by Angelo Gonzalez on 12/17/14.
// Copyright (c) 2014 Angelo Gonzalez. All rights reserved.
//
#include <iostream>
#include <opencv2/opencv.hpp>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
using namespace cv;
//polar line equation: ... |
C | UTF-8 | 211 | 3 | 3 | [] | no_license |
#include <stdio.h>
#include<string.h>
void main()
{
char a[10];
int m;
scanf("%s",a);
m=strlen(a);
if(m%2==0)
{
a[m/2]='*';
a[(m/2)-1]='*';
}
else
{
a[m/2]='*';
}
printf("%s",a);
getch();
}
|
Java | UTF-8 | 4,440 | 2.90625 | 3 | [] | no_license | package driver;
import device.Device;
import scanTools.NetScan;
import scanTools.PortScan;
import utils.Gateway;
import utils.LocalHost;
import javax.swing.*;
import java.util.ArrayList;
public class GUI extends JFrame {
private JPanel rootPanel;
private JPanel topPanel;
private JPanel leftPanel;
pr... |
Java | UTF-8 | 1,672 | 2.140625 | 2 | [] | no_license | package com.rsw.servlet.mycourse;
import com.google.gson.Gson;
import com.rsw.dao.Imp.userTeacherImp;
import com.rsw.entity.BaseResponse;
import com.rsw.entity.UserCourse;
import com.rsw.entity.UserTeacher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Ht... |
Python | UTF-8 | 2,495 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | '''
A logistic regression learning algorithm example using TensorFlow library.
This example is using the MNIST database of handwritten digits (http://yann.lecun.com/exdb/mnist/)
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
'''
import numpy as np
import tensorflow as tf
# assert ... |
Shell | UTF-8 | 1,835 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
# Copyright 2019 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... |
Python | UTF-8 | 1,580 | 2.578125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | import vampytest
from ....oauth2 import Oauth2Scope
from ....permission import Permission
from ..application_install_parameters import ApplicationInstallParameters
from .test__ApplicationInstallParameters__constructor import _assert_is_every_attribute_set
def test__ApplicationInstallParameters__from_data():
""... |
Java | UTF-8 | 475 | 2.640625 | 3 | [] | no_license | package com.dradest.designpatterns.factorypattern.carfactory;
import com.dradest.designpatterns.factorypattern.carparts.chassis.Chassis;
import com.dradest.designpatterns.factorypattern.carparts.electricity.Electricity;
import com.dradest.designpatterns.factorypattern.carparts.tyres.Tyres;
public interface CarFactory... |
Java | UTF-8 | 273 | 3.484375 | 3 | [] | no_license | public class FiniteSum {
public static void main(String[] args) {
// To find the finite sum of the numbers
int n = 100,sum=0;
for (int i=0;i<n;i++)
{
sum+=i;
}
System.out.print("The sum of the numbers from 0 to 99 is : ");
System.out.println(sum);
}
}
|
Swift | UTF-8 | 1,014 | 3.84375 | 4 | [] | no_license | //: [Previous](@previous)
import Foundation
// 创建树
// 根节点
let tree = TreeNode(15)
// 第二层
let one = TreeNode(1)
tree.add(one)
let seventeen = TreeNode(17)
tree.add(seventeen)
let twenty = TreeNode(20)
tree.add(twenty)
// 第三层
let one2 = TreeNode(1)
let five = TreeNode(5)
let zero = TreeNode(0)
one.add(one2)
one.add(f... |
Java | UTF-8 | 1,141 | 4.21875 | 4 | [] | no_license | package anonymous_classes_enums.task1;
//Создайте перечислительный тип (enum) Animals, содержащий конструктор,
// который должен принимать целочисленное значение (возраст животного),
// и содержать перегруженный метод toString(), который должен возвращать
// название экземпляра и возраст животного.
enum Animals{
... |
Markdown | UTF-8 | 8,366 | 3.21875 | 3 | [] | no_license | ---
layout: post
title: 读《Emotional Intelligence:Why it can matter more than IQ》
category: 读后感
---
这是2019年读的第020本书,Daniel Goleman 著,累计用时16小时
>All emotions are, in essence, impulses to act, the instant plans for handling life that evolution has instilled in us. The very root of the word emotion is motere, the Latin ver... |
Java | UTF-8 | 404 | 2.078125 | 2 | [] | no_license | package services.orders;
import customerproductorder.models.Customer;
import customerproductorder.models.Order;
import java.util.List;
public interface OrderServiceInterface {
public void create(Order newOrder);
public Order get(Customer customer);
public Order get(int id);
public List<Order> getA... |
C# | UTF-8 | 18,084 | 3.015625 | 3 | [
"CC-BY-NC-4.0",
"CC-BY-NC-SA-4.0"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests
{
using HeroFight;
[TestClass]
public class StructureTests
{
private static readonly Assembly ProjectAssembly = typeof(StartUp).... |
C# | UTF-8 | 1,302 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace DiffWords
{
public class OrfoepicDict : IPrimaryForm
{
private List<List<string>> Nouns;
public OrfoepicDict()
{
Nouns = ReadDict(... |
Markdown | UTF-8 | 6,500 | 3.203125 | 3 | [
"MIT"
] | permissive | ---
description: Dans ce TP nous allons découvrir l'utilisation de VueJS sans Webpack. Nous allons donc utiliser directement le CDN de VueJS.
---
# Prise en main de VueJS 2.0
Dans ce TP nous allons découvrir l'utilisation de VueJS sans Webpack. Nous allons donc utiliser directement le CDN de VueJS.
::: details Table... |
Python | UTF-8 | 620 | 3.53125 | 4 | [
"MIT"
] | permissive | class Argentina:
def getPresident(self):
president = self.whoisinpower()
return "The current president is {}".format(president)
def whoisinpower(self):
return "Mauricio Macri"
def getPopulation(self):
return "45 Million"
def getCapital(self):
return "Buenos Ai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.