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 | 15,633 | 2.8125 | 3 | [] | no_license | import sklearn.cluster as clus
import sklearn.decomposition as dc
import sklearn.preprocessing as pr
from scipy.cluster.hierarchy import dendrogram
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import pandas as pd
import os
if not(os.path.isdir("tarea")):
os.mkdir("tarea... |
TypeScript | UTF-8 | 926 | 2.84375 | 3 | [
"MIT"
] | permissive | import { Constants } from '../runtime/defs';
import { stop } from '../runtime/run';
import { add } from './add';
import { double } from './bignum';
import { multiply } from './multiply';
// power function for double precision floating point
export function dpow(base: number, expo: number) {
// divide by zero?
if (... |
Python | UTF-8 | 3,030 | 3.203125 | 3 | [] | no_license | '''
# NOTES
df access/structure mimics dictionary access (see ex. below) w/ keys being columns and values being arrays
sample df:
df1 = pd.DataFrame({"HPI":[80,85,88,85],
"Index": [0,1,2,3]})
# pickling serializes and saves bytecode of code modules/objects.
df = read_csv("newcsv4.csv", names=["Date", "Austin_HP... |
Python | UTF-8 | 2,360 | 2.90625 | 3 | [] | no_license | import sys
import re
class jsParser:
jsStringRe = "(?:\s*)(?:"\
"(?:'((?:(?:[^\\']|.'))*?)')|(?:\"((?:(?:[^\\\"]|.\"))*?)\")"\
")(?:\s*)(?:,*)(?:\s*)"
doubleChecker = re.compile("Localize\s*\(")
tables = {}
def __init__(self):
self.matcher = re.compile("Localize(?:\s*)\((?:" ... |
Python | UTF-8 | 625 | 3.328125 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
n = str(input("masukkan link/url: "))
url = n
#membuat requests
r = requests.get(url)
#hasil response
request = r.content
filename = "tes.txt"
f = open(filename, "w")
headers = "sumber : "+ url + "\n"
f.write(headers)
soup = BeautifulSoup(request, ... |
Java | UTF-8 | 1,624 | 2.140625 | 2 | [] | no_license | package br.com.milebrito.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.w... |
Java | UTF-8 | 1,202 | 2.46875 | 2 | [] | no_license | package com.example.kwy2868.practice.network;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class APIManager {
private static final String BASE_URL = "http://203.252.166.230";
private static... |
Java | UTF-8 | 6,507 | 2.34375 | 2 | [] | no_license | package uit.cnpm02.dkhp.controllers;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import... |
SQL | UTF-8 | 5,428 | 2.90625 | 3 | [] | no_license | CREATE TABLE profesion (
codigo tinyint(3) unsigned primary key,
descripcion varchar(40) not null,
status tinyint(1) unsigned not null default 1,
cod_usr_reg int unsigned not null,
fec_reg timestamp not null default current_timestamp,
cod_usr_mod int unsigned not null,
fec_mod timestamp not null DEFAULT 0,
for... |
Java | UTF-8 | 2,753 | 2.390625 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pClases;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Passw... |
JavaScript | UTF-8 | 45,393 | 2.5625 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
const Meal = require('../../models/Meal');
const Child = require('../../models/Child');
const passport = require('passport');
router.get("/seed", async (req, res)=>{
const password_digest = "$2a$10$jjDnk0HSq... |
Java | UTF-8 | 11,273 | 2.15625 | 2 | [] | no_license | package thegirlsteam.whatshappening.tabs;
import android.content.DialogInterface;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import... |
C++ | UTF-8 | 1,661 | 2.984375 | 3 | [] | no_license | #include "header.h"
#include "globals.h"
// determines if a critter can view given coordinates
bool in_line_of_sight(int critter_id, int level_id, int x, int y) {
int critter_x = game.critters[critter_id].x;
int critter_y = game.critters[critter_id].y;
int critter_level = game.critters[critter_id].level_id... |
Python | UTF-8 | 892 | 2.65625 | 3 | [] | no_license | #1-car-navigation
def name():
return '1-car navigation'
def problem():
# Discretize the navigation system at https://publish.illinois.edu/c2e2-tool/example/navigation-system/
A = [[1,0,0.1,0],
[0,1,0,0.1],
[0,0,0.8870, 0.0089],
[0,0, 0.0089, 0.8870]
]
B = [[0,0],[0,0],[1,0],[0,1]]
u_range... |
JavaScript | UTF-8 | 1,108 | 4.6875 | 5 | [] | no_license | // ==========================================
// FIND
// ==========================================
// returns the value of the first element in the provided array that satisfies the provided testing function
const array1 = [5, 12, 8, 130, 44];
const found = array1.find(element => element > 10);
console.log(found);... |
C++ | UTF-8 | 2,610 | 2.734375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <cstdint>
#include <glm/glm.hpp>
#include <vector>
#include "QuadTreeDefines.h"
class PlanetTileServer;
class QuadTreeNode
{
private:
public:
// Top-left bound of the node
glm::dvec2 min_point;
double size;
PlanetSide planetside;
QuadTreeQuadrant quad;
// Can be in another side o... |
Java | UTF-8 | 499 | 3.171875 | 3 | [] | no_license | package com.basic;
import java.util.*;
public class DuplicateSample{
public static void main(String a[])
{
int count=0;
Scanner scan=new Scanner(System.in);
System.out.println("enter something");
String one=scan.nextLine();
String two[]=one.split("\\s");
for(int i=0;i<two.length-1;i++)
{
for(int j=0;j... |
C++ | UTF-8 | 1,770 | 2.53125 | 3 | [
"BSD-2-Clause"
] | permissive | #pragma once
#include "rbtree.h"
#include "VKRenderer.h"
typedef enum VkResourceType {
VK_RESOURCE_TYPE_FREE = 0,
VK_RESOURCE_TYPE_UNKNOW,
VK_RESOURCE_TYPE_BUFFER,
VK_RESOURCE_TYPE_IMAGE_LINEAR,
VK_RESOURCE_TYPE_IMAGE_OPTIMAL,
} VkResourceType;
typedef struct mem_node {
mem_node(CVKMemory* pFreeMemory);
~mem_... |
C# | UTF-8 | 9,981 | 2.59375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Medi... |
Python | UTF-8 | 1,786 | 3.484375 | 3 | [] | no_license | from io import StringIO
import string
plaintext_ = string.ascii_lowercase
ciphertext_ = string.ascii_uppercase
#加密算法
def encryption(plaintext):
cipherarr = [0 for i in range(len(plaintext))]
plaintext_list = list(plaintext)
j = 0
for plaintext_item in plaintext_list:
for i in range(len(plai... |
Java | UTF-8 | 2,799 | 2.296875 | 2 | [
"Apache-2.0"
] | permissive | package io.smallrye.reactive.messaging.providers.connectors;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutionException;
import jakarta.enterprise.context.ApplicationScoped;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.rea... |
Java | UTF-8 | 3,171 | 2.25 | 2 | [
"MIT"
] | permissive | package ua.com.fielden.platform.web.centre.api.actions.multi;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import ua.com.fielden.platform.dom.DomElement;
import ua.com.fielden.platform.web.centre.api.actions.EntityActionConfig;
import ua.com.fielden.platform.web.centre.api.crit.i... |
C | UTF-8 | 4,502 | 2.6875 | 3 | [] | no_license | /*******************************************************************************
* @file Thread_LED.c
* @author Ashraf Suyyagh
* @version V1.0.0
* @date 17-January-2016
* @brief This file initializes one LED as an output, implements the LED thread
* which toggles and LED, and function which cr... |
Java | UTF-8 | 1,759 | 2.234375 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package eapli.ecafeteria.persistence.inmemory;
import eapli.ecafeteria.domain.pos.POS;
import eapli.ecafeteria.domain.pos.POSState;
im... |
C# | UTF-8 | 4,061 | 2.734375 | 3 | [] | no_license | using SQLite4Unity3d;
using UnityEngine;
#if !UNITY_EDITOR
using System.Collections;
using System.IO;
#endif
using System.Collections.Generic;
public class DataService {
private SQLiteConnection _connection;
public DataService(string DatabaseName){
#if UNITY_EDITOR
var dbPath = string.Format(@"Asset... |
Markdown | UTF-8 | 736 | 2.75 | 3 | [] | no_license | # [RPS Multiplayer](https://github.com/LMBoyle/rpsMultiplayer)
Play the game of rock, paper, scissors in the style of Avatar the Last Airbender
## Instructions
Enter your name then wait for someone else to join.
When there are two players choose your element, wait for your opponent to choose theirs and find out who w... |
Python | UTF-8 | 1,450 | 3.5 | 4 | [] | no_license | '''
Created on 2018. 12. 6.
MLP (다층 신경망) : 입력층과 출력층 사이에 중간층을
'''
from sklearn.neural_network import MLPClassifier
from sklearn.model_selection import train_test_split
x = [[0,0], [0,1], [1,0], [1,1]]
y = [0,1,1,0]
clf = MLPClassifier(hidden_layer_sizes=(3,2), random_state=0)
print(clf)
clf.fit(x,y)
x = [[1,1],[1,1],... |
Java | UTF-8 | 793 | 3.265625 | 3 | [] | no_license | package prg.clxmm;
import java.util.ArrayList;
import java.util.List;
/**
* @author clxmm
* @version 1.0
* @date 2021/1/27 8:06 下午
*/
public class Test02Atomicity {
/**
* 5个线程各执行1000次 i++;
* @param args
*/
private static int number = 0;
public static void main(String[] args) throws In... |
Java | UTF-8 | 18,598 | 1.890625 | 2 | [] | no_license | package com.example.a29149.yuyuan.ModelStudent.Me.Reward;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.View;
impo... |
C# | UTF-8 | 812 | 2.53125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace Radiator.Core
{
public abstract class CommandValidator<TCommand> where TCommand : Command
{
ValidationContext<TCommand> _context = new ValidationContext<TCommand>();
... |
C++ | UTF-8 | 5,009 | 3.46875 | 3 | [] | no_license | #include "FileHandler.h"
#include "Customers.h"
#include "Items.h"
#include <sstream>
#include <string>
FileHandler::FileHandler() {}
FileHandler ::~FileHandler() {}
bool FileHandler::isCustomerFile() // function to check for the customer file
{
ifstream _fcount;
_fcount.open("customers.txt");
if (_fcount) // chec... |
Java | UTF-8 | 4,554 | 2.640625 | 3 | [] | no_license | package ciclo3.doctor.entidades;
/**
* Entidad o modelo que define la tabla Doctor y sus relaciones con las demás
* entidades o tablas de la "base de datos" para el proyecto:
* Servicios médicos especializados.
* Esta tabla relaciona los nombres de los médicos, el departamento al cual
* pertenecen y su año de gr... |
Markdown | UTF-8 | 2,113 | 2.984375 | 3 | [] | no_license | ---
title: Django September Meetup
date: 2016-09-13 19:00:00 +0100
links:
meetup: http://www.meetup.com/djangolondon/events/233252435/
skills_matter: https://skillsmatter.com/meetups/8047-london-django-september-meetup
talks:
- title: Scaling task processing with Celery
speaker: Viren Rajput
description: >
... |
TypeScript | UTF-8 | 674 | 2.53125 | 3 | [
"MIT"
] | permissive | import Graph, {Attributes} from 'graphology-types';
type SubGraphFilter<NodeAttributes extends Attributes = Attributes> = (
key: string,
attributes: NodeAttributes
) => boolean;
type SubGraphNodes<NodeAttributes extends Attributes = Attributes> =
| Array<string>
| Set<string>
| SubGraphFilter<NodeAttributes... |
Java | UTF-8 | 2,251 | 1.976563 | 2 | [] | no_license | package bean;
public class CheckListBean {
private int RNUM;
private String CHECKLIST_ID;
private String CHECKLIST_DISCRIPTION;
private String AUDIT_KIND_ID;
private int CHECKLIST_FULLSCORE;
private String CHECKLIST_VALID;
private int AUDIT_SCORE;
private String AUDIT_ID;
public CheckListBean() ... |
JavaScript | UTF-8 | 2,103 | 2.578125 | 3 | [
"MIT"
] | permissive | import isLiteralOrUndefined from "./ast/is-literal-or-undefined";
import addStaticHoist from "./hoist-statics";
// Extracts attributes into the appropriate
// attribute array. Static attributes and the key
// are placed into static attributes, and expressions
// are placed into the variadic attributes.
export default ... |
Java | UTF-8 | 433 | 1.929688 | 2 | [] | no_license | package com.tomyang.domain;
import lombok.Data;
import javax.persistence.Entity;
/**
* Msg
* @author yc
* @date 2018/1/16
*/
@Data
public class Msg {
private String title;
private String content;
private String etraInfo;
public Msg() {
}
public Msg(String title, String content, String e... |
PHP | UTF-8 | 625 | 2.59375 | 3 | [] | no_license | <?php
include("jp_library/jp_lib.php");
$filename = readfile("filename.csv");
$ext=substr($filename,strrpos($filename,"."),(strlen($filename)-strrpos($filename,".")));
//we check,file must be have csv extention
if($ext=="csv"){
$file = fopen($filename, "r");
while (($emapData = fgetcsv($file, 10000... |
Java | UTF-8 | 460 | 1.9375 | 2 | [] | no_license | package com.lc.belajar.retrofit.services.service;
import com.lc.belajar.retrofit.entity.ResponseSerializer;
import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;
/**
* Created by eby on 07/09/16.
*/
public interface DataService {
@GET("api/tagihan-pln?idp=&th... |
C++ | UTF-8 | 419 | 2.515625 | 3 | [] | no_license | #ifndef TRIANGLE_H
#define TRIANGLE_H
#include "object.h"
#include "vector.h"
class Object;
class Ray;
class Material;
class Triangle : public Object {
Vector p1,p2,p3;
public:
Triangle(const Material& pmat, const Vector& pp1,
const Vector& pp2, const Vector& pp3);
Object* checkIntersection(Ray& r);
V... |
Python | UTF-8 | 795 | 3.375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Created by Ross on 19-1-25
def fist_1(n: int):
position = 0
while n > 0:
if n & 1:
return position
n >>= 1
position += 1
return -1
def is_bit(n: int, index: int):
n >>= index
return n & 1
def solve(array: list):
... |
Markdown | UTF-8 | 29,588 | 2.859375 | 3 | [] | no_license | # soal-shift-sisop-modul-4-I05-2021
**Rafi Akbar Rafsanjani - 05111942000004**
**Agustinus Aldi Irawan Rahardja - 05111942000010**
**Muhammad Rafi Hayla Arifa - 05111942000014**
Repository for the solution to the module's question :coffee:
```
Notes:
● It is not allowed to use system () and exec * (), unless there... |
C# | UTF-8 | 3,348 | 3 | 3 | [] | no_license | #region Using Statements
using System;
using Microsoft.Xna.Framework;
using MonoGameRPG.Gameplay;
#endregion
namespace MonoGameRPG.Physics
{
/// <summary>
/// An axis-aligned bounding box for determining collisions between objects.
/// </summary>
public class BoundingBoxAA : BoundingShape
{
... |
C# | UTF-8 | 528 | 2.515625 | 3 | [
"Unlicense"
] | permissive | namespace Playground.Blazor.Core.Utils
{
using System;
internal sealed class FunctionalDisposable : IDisposable
{
private readonly Action onDispose;
private bool objectDisposed;
public FunctionalDisposable(Action onDispose)
{
this.onDispose = onDispose;
... |
C# | UTF-8 | 931 | 3 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using PizzaSharp.Models;
namespace PizzaSharp.Interfaces
{
/// <summary>
/// Representation of allowed actions for a comment.
/// </summary>
public interface ICommentRepository
{
/// <summary>
/// Adds the given Comment to the reposit... |
Java | UTF-8 | 3,569 | 2.078125 | 2 | [] | no_license | /*
* Use twitter4j Library (Apache License 2.0) from
* http://twitter4j.org/ko/
* For twitter api
*
* Main developers: 한주형, 주세현
* Debuggers: 한주형, 주세현
*/
package com.example.twiddy_ui;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.In... |
Java | UTF-8 | 4,330 | 2.484375 | 2 | [
"CC0-1.0"
] | permissive | package com.hoopawolf.vrm.potion.sin;
import net.minecraft.block.BlockState;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectType;
import net.minecraft.entity.mob.MobEntity;
import net.mine... |
Python | UTF-8 | 3,578 | 2.578125 | 3 | [] | no_license | from config import config
from util import format_seconds
from usagelog import logged_command
from database import Base, dbsession
import math
from datetime import datetime
from sqlalchemy import Column, Integer, BigInteger, String, DateTime
from telegram.ext import CommandHandler
BLSTATUS_ACTIVE = 0
BLSTATUS_DELETED... |
Python | UTF-8 | 6,748 | 5.09375 | 5 | [] | no_license | # Broad but simple description of data types and data structures for mandatory assignment 1
print("Hello Claus! This is my presentation on the first mandatory assignment in Python!\n-----")
# Method to explain strings
def simple_types():
print("\n-----\nSTRINGS:\n-----\n")
string1 = "Hello Claus. "
pri... |
JavaScript | UTF-8 | 46 | 2.859375 | 3 | [] | no_license | var num = 4;
alert("my number is: " + num);
|
Java | UTF-8 | 4,571 | 2.3125 | 2 | [] | no_license | package com.yuntu.servlet;
import com.yuntu.biz.ScenicspotBiz;
import com.yuntu.pojo.Scenicspot;
import com.yuntu.util.PageUtil;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import javax.servlet.ServletException;
import javax.servlet... |
Python | UTF-8 | 2,211 | 2.53125 | 3 | [] | no_license | from IPython import embed
def prepare_folds(args):
ndays = args.ndays
nfolds = args.nfolds
t_size=args.ntrain
step=args.ntest
v_size = args.nval
set_fold = [];
for i in range(nfolds):
total = i * step + t_size;
training = range(total - v_size)
test = range(step);
validation = range(v_size);
j = 0;
... |
Java | UTF-8 | 2,387 | 2.484375 | 2 | [] | no_license | package cn.tedu.ttms.product.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import cn.tedu.ttms.common.dao.BaseDao;
import cn.tedu.ttms.common.vo.IdName;
import cn.tedu.ttms.product.entity.Project;
/**
* 项目模块的数据访问对象 1)负责数据的持久化 2)负责数据的查询然后执行映射操作
*/
public interface ProjectDao extends BaseD... |
Java | UTF-8 | 11,161 | 1.601563 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2015-2023 AsyncHttpClient Project. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE... |
Java | UTF-8 | 888 | 3.96875 | 4 | [] | no_license | package eos.java.practice.ppt;
/**
* 汉诺塔:始终保证小圆盘上不能放大圆盘,一次只能移动一个圆盘
*/
public class Hanoi {
private static int count = 1 ;
//有 A B C三个容器 A上放入N个圆盘
//目标是借助B容器,将A容器上的所有圆盘移动到C容器上
//每次取A中最大的圆盘,移到C中
public static void moveDisc(int n, char a, char b, char c) {
if( n == 1) {
System.ou... |
Python | UTF-8 | 9,861 | 2.515625 | 3 | [] | no_license | import tensorflow as tf
from tensorflow.keras import layers
from tensorflow_probability import distributions
from configuration.Hyperparameter import Hyperparameters
##
# Implementation based on: https://bit.ly/3oRMiQz
##
class Sampling(layers.Layer):
def call(self, inputs, **kwargs):
z_mean, z_log_var... |
C++ | UTF-8 | 1,130 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <time.h>
#include <sys/time.h>
#include <vector>
using namespace std;
#define FLT_MAX 3.402823466e+38F
int main() {
time_t t = time(NULL);
cout << t << endl;
cout << time(NULL) << endl;
cout << system("time") << endl;
struct timeval tv;
gettimeofday(&tv, N... |
PHP | UTF-8 | 883 | 2.671875 | 3 | [] | no_license | <?php
$num=$_POST['num'];
$titre=$_POST['titre'];
$duree=$_POST['duree'];
$res=$_POST['res'];
$dossier="../pochettes/";
$nomPochette=sha1($titre.time());
$pochette="avatar.jpg";
if(!$fic=fopen("../donnees/films.txt","a")){
echo "ERREUR: probleme avec le fichier";
exit;
}
if($_FILES['pochette']['tmp_name']... |
C++ | UTF-8 | 2,255 | 2.671875 | 3 | [] | no_license | #include <stdexcept>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <CTP7AlgoClient.hh>
#include <stdexcept>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <pthread.h>
#include <limits.h>
#include <errno.h>
#include <sys/stat.h>
#include <map>
const std::s... |
JavaScript | UTF-8 | 2,333 | 2.921875 | 3 | [] | no_license | class TeamMembers{
name;
address;
constructor(name , address){
this.name = name;
this.address = address;
}
}
class Support extends TeamMembers{
designation;
constructor( name, address, designation){
super(name, address);
this.designation = designation;
}
... |
Markdown | UTF-8 | 5,741 | 3.609375 | 4 | [] | no_license |
#初识redis
##数据结构简介
结构类型|结构存储的值|结构的读写能力
-------|------------|------------
STRING|可以是字符串、整数或则浮点数|对整个字符串或者字符串的其中一部分执行操作;对整数和浮点数执行自增或则自减操作
LIST|一个链表,链表上的每个节点都包含了一个字符串|从链表的两端推入或则弹出元素,根据偏移量对链表进行修剪;读取单个或则多个元素;根据值查找或则移除元素
SET|包含字符串的无序收集器,并且包含的每个字符串都是独一无二的、各不相同的|添加、获取、移除单个元素;检查一个元素是否存在于集合中;计算交集、并级、差集;从集合里面随机获取元素
HASH|包含键值对的无序列表... |
Python | UTF-8 | 471 | 3.375 | 3 | [
"MIT"
] | permissive | def BinarySearch(Arr,l,h,key):
n = len(Arr)
# l = 0
# h = n
mid = (l+h)//2
if n == 0:
return False
elif l >= h:
if Arr[0] == key:
return True
else:
if Arr[mid] == key:
return True
elif key < Arr[mid]:
return BinarySearch(Arr, l, mid, key)
else:
return BinarySearch(Arr, (mid+1), h, key)
Ar... |
Shell | UTF-8 | 2,407 | 2.796875 | 3 | [] | no_license | #!/bin/bash
github_black="#24292e"
github_yellow="#df5f11"
github_white="#feffff"
github_green="#22863a"
github_visual_grey="#41484f"
github_light_grey="#eceef1"
github_light_blue="#aedaf7"
time_format="%R"
date_format="%Y-%m-%d"
tmux set-option -gq status "on"
tmux set-option -gq status-justify "left"
tmux set-opt... |
Shell | UTF-8 | 1,405 | 4.1875 | 4 | [] | no_license | #!/bin/bash
###############################################################################
# Name : DeployToPCFDev.sh
# Author : Swarada Kalekar
# Created on : Jan 2017
# Description : Script is written to deploy the application
# on PCF Dev Environment. Script will accept
# User Details, Organizati... |
Python | UTF-8 | 22,651 | 2.546875 | 3 | [] | no_license | '''
Encapsulate the input, output variables, as well as some default configurations
'''
from dataclasses import dataclass
from typing import List, Dict
import json
import numpy as np
@dataclass
class Default:
'''some default configurations
'''
alpha = 3.5 # the slope of wireless signal depr... |
TypeScript | UTF-8 | 1,079 | 2.703125 | 3 | [] | no_license | import mongoose from "mongoose";
export interface ScanAttrs {
_id?: mongoose.Schema.Types.ObjectId;
scanContent: string;
timeStamp: Date;
errorCode?: string;
_line?: mongoose.Schema.Types.ObjectId;
_user?: mongoose.Schema.Types.ObjectId;
}
interface ScanModel extends mongoose.Model<ScanDoc> {
build(attr... |
Java | UTF-8 | 255 | 2.21875 | 2 | [] | no_license | package org.cen.vision.filters;
public class FilterInterruptor {
private boolean interrupted = false;
public boolean isInterrupted() {
return interrupted;
}
public void setInterrupted(boolean interrupted) {
this.interrupted = interrupted;
}
}
|
JavaScript | UTF-8 | 7,882 | 2.53125 | 3 | [] | no_license | // components/commoditSpecChoose/index.js
import { getShopDetailSkuList } from "../../services/home/shop";
Component({
/**
* 组件的属性列表
*/
properties: {
detail: {
type: Object,
value: {}
},
show: {
type: Boolean,
value: false
... |
Java | UTF-8 | 2,259 | 2.0625 | 2 | [] | no_license | package fr.toinetoine1.practice.events;
import fr.badblock.gameapi.BadListener;
import fr.badblock.gameapi.players.BadblockPlayer;
import fr.toinetoine1.practice.Practice;
import fr.toinetoine1.practice.data.PPlayer;
import fr.toinetoine1.practice.database.request.DataRequest;
import fr.toinetoine1.practice.scoreboard... |
C++ | UTF-8 | 1,251 | 3.78125 | 4 | [] | no_license | // searching -- regular -- O(n)
// searching -- bst -- O(log n)
// insertion -- regualr -- O(n)
// insertion -- bst -- O(n)
#include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node *left, *right;
};
Node *new_node(int value){
Node *temp = new Node;
temp->data = value;
temp->left = temp->r... |
PHP | UTF-8 | 1,775 | 2.609375 | 3 | [] | no_license | <?php
include("prod_conn.php");
//query for retreving individual certificates within a project
$query = "SELECT
DATE_FORMAT(PAYMENT_DATE,'%d-%b-%Y') \"Donation Date\",
DISPLAYNAME \"Donor Name\",
FORMAT(AMOUNT_FOR_PROJECT+AMOUNT_FOR_OPERATIONS_GRANT,0) \"Total Donation =\",
FORMAT(A... |
C++ | UTF-8 | 2,555 | 2.5625 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <iostream>
#include "parsing.h"
enum opcode {
AND = 0x00,
OR = 0x01,
XOR = 0x02,
NOT = 0x03,
ADD = 0x04,
ADC = 0x05,
SUB = 0x06,
MULT = 0x07,
DIV = 0x08,
CMP = 0x09,
XCHG = 0x0a,
MOV = 0x0b,
LOAD = 0x0c,
STORE = 0x0d,... |
Python | UTF-8 | 593 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | #Print unusual street names from the dataset
expected = ["Street", "Avenue", "Boulevard", "Drive", "Court", "Place", "Square", "Lane", "Road",
"Trail", "Parkway", "Commons", "Circle", "Way", "Extension", "Turnpike", "Broadway", "Terrace", "Plaza", "View"]
osm_file = open("albany.osm", "r")
for event, el... |
Ruby | UTF-8 | 296 | 3.609375 | 4 | [] | no_license | class Character
attr_reader(:name, :nick_name, :occupation)
def initialize(name, nick_name, occupation)
@name = name
@nick_name = nick_name
@occupation = occupation
end
def introduce
return "I'm #{name} but you can call me #{nick_name}. I'm a #{occupation}"
end
end
|
Java | UTF-8 | 2,429 | 2.203125 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package fr.afcepf.atod.wine.business.order.impl;
import fr.afcepf.atod.vin.data.exception.WineException;
import fr.afcepf.atod... |
Python | UTF-8 | 902 | 4.3125 | 4 | [] | no_license | """
File: ds09.py
Author: Ali Cope
Use Hash Tables (sets and dictionaries) in Python to solve problems.
Assignment: Write a program to read through a census file and keep track of the number of people in different education levels.
"""
def get_filename():
name = input("Please enter a filename: ")
retu... |
Shell | UTF-8 | 323 | 3.03125 | 3 | [] | no_license | #!/bin/bash
if [ -z $(docker images -q 03_sample:latest) ]
then
# Preventing error ADD failed: Forbidden path outside the build context: ../shared/conf/httpd.properties
cp -r ../shared/conf .
cp -r ../shared/www .
docker build -t 03_sample .
rm -rf ./conf ./www # Cleanup
fi
docker run -it 03_sam... |
SQL | UTF-8 | 40,415 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 15, 2018 at 01:18 PM
-- Server version: 5.6.38
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
Java | UTF-8 | 8,170 | 1.960938 | 2 | [] | no_license | package com.voidwhile.system.entity;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.voidwhile.common.util.SpringContextHelper;
import com.voidwhil... |
Markdown | UTF-8 | 1,223 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | title: ParseToDate
# ParseToDate Expression
`ParseToDate` is a link:spark-sql-Expression-RuntimeReplaceable.adoc[RuntimeReplaceable] expression that <<creating-instance, represents>> the link:spark-sql-functions-datetime.adoc#to_date[to_date] function (in logical query plans).
[source, scala]
----
// DEMO to_date(e:... |
Markdown | UTF-8 | 1,589 | 2.53125 | 3 | [] | no_license | # Article 1
Les modes de production raisonnés en agriculture consistent en la mise en oeuvre, par l'exploitant agricole sur l'ensemble de son exploitation dans une approche globale de celle-ci, de moyens techniques et de pratiques agricoles conformes aux exigences du référentiel de l'agriculture raisonnée.
Le référen... |
Java | UTF-8 | 3,715 | 1.601563 | 2 | [] | no_license | /*
* Decompiled with CFR 0.151.
*
* Could not load the following classes:
* android.os.Handler
*/
package com.zhiyun.renderengine.business.display;
import android.os.Handler;
import com.zhiyun.renderengine.bean.TextureFormat;
import com.zhiyun.renderengine.business.display.DisplayRender;
import com.zhiyun.rende... |
Java | UTF-8 | 5,150 | 2.71875 | 3 | [] | no_license |
package com.photon.codechallenge.shortestpath.utils;
import com.photon.codechallenge.shortestpath.utils.LowCostPathFinder;
import com.photon.codechallenge.shortestpath.utils.SampleInputs;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Tests to ... |
Java | UTF-8 | 3,127 | 2.078125 | 2 | [] | no_license | package hello;
import com.fasterxml.jackson.databind.ObjectMapper;
import hello.model.Media;
import hello.model.MediaEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.data.doma... |
JavaScript | UTF-8 | 2,644 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
class UserForm extends Component {
constructor() {
super();
this.state = {
fname: '',
lname: '',
email: '',
dob: '',
bio: ''
};
}
onChange = (e) => {
e.p... |
Python | UTF-8 | 3,457 | 2.859375 | 3 | [] | no_license | # -*- coding: utf-8 -*- #
import random
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def init_review_dict():
"""
Initializes the dictionary with the review data.
# Return... |
C# | UTF-8 | 1,116 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Controls;
namespace MapGenerator
{
public class Test
{
... |
PHP | UTF-8 | 559 | 2.703125 | 3 | [] | no_license | <?php
function smarty_function_grid_view($paras)
{
$gridview ="<table class='".$paras['css']."'><tr>";
foreach($paras['fields'] as $value){
$gridview.= "<td><strong>".strtoupper($value)."</strong></td>";
}
$gridview.= "</tr>";
for($i=0;$i<$paras['counts']; $i++)
... |
Python | UTF-8 | 2,155 | 3.90625 | 4 | [
"MIT"
] | permissive | '''
Description:
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
Example:
Input: [1,2,3,null,5,null,4]
Output: [1, 3, 4]
Explanation:
1 <---
/ \
2 3 <---
\ \
5 4 <---
'''
... |
Markdown | UTF-8 | 2,653 | 3.515625 | 4 | [] | no_license | # url命名:
## 为什么需要url命名?
因为url是经常变化的。如果在代码中写死可能会经常改代码。给url取个名字,以后使用url的时候就使用他的名字进行反转就可以了,就不需要写死url了。
## 如何给一个url指定名称?
在`path`函数中,传递一个`name`参数就可以指定。示例代码如下:
```python
urlpatterns = [
path('',views.index,name='index'),
path('login/',views.login,name='login')
]
```
## 应用命名空间:
在多个app之间,有可能产生同名的url。这时候为了避免反转url的时候产... |
C | UTF-8 | 1,514 | 2.953125 | 3 | [] | no_license | #include "shell.h"
/* global variable for ^C handling */
unsigned int sig_flag;
/**
* sig_handler - handles ^C signal interupt
* @uuv: unused variable (required for signal function prototype)
*
* Return: void
*/
static void sig_handler(int uuv)
{
(void) uuv;
if (sig_flag == 0)
_puts("\n$ ");
else
_puts("... |
Markdown | UTF-8 | 12,410 | 3.234375 | 3 | [] | no_license | 
# Rails View Templating
### Why is this important?
<!-- framing the "why" in big-picture/real world examples -->
*This workshop is important because:*
We want pages that users can see and interact with! And we want to ta... |
Java | UTF-8 | 2,196 | 2.453125 | 2 | [] | no_license | package yncrea.lab04.web.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import or... |
C | UTF-8 | 757 | 3.4375 | 3 | [] | no_license | //
// Created by PABLO on 08/05/2018.
//
#include <stdio.h>
int get_int(char s[30]);
int main(void){
int x=get_int("Introduzca la altura \n");
for (int i=0;i<=x;i++){
for (int j=x;j>=0;j--){
if (i<j){
printf(" ");
}
else{
printf("... |
Python | UTF-8 | 2,633 | 2.703125 | 3 | [] | no_license | import pandas as pd
import numpy as np
import chart_studio.plotly as py
import plotly.graph_objs as go
import plotly.express as px
df=pd.read_csv('D:/udemy_kurs_py/PyProj/214.agri.csv')
df.drop('text',axis=1,inplace=True)
df.drop('category',axis=1,inplace=True)
print(df.head())
print(df.columns)
print(df.... |
Java | UTF-8 | 9,922 | 2.140625 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package view.subarea;
import controller.SubareaController;
import java.awt.Color;
import java.util.logging.Level;
import java.util.log... |
Java | UTF-8 | 3,238 | 2.015625 | 2 | [] | no_license | package com.nebeek.newsstand.ui.bookmark;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.v... |
Java | UTF-8 | 1,314 | 3.28125 | 3 | [] | no_license | import java.util.ArrayList;
import java.util.Collection;
public class Dictionary<T,E> {
private ArrayList<E> keyArrL = new ArrayList<E>();
private ArrayList<T> valueArrL = new ArrayList<T>();
private int size = 0;
public Dictionary(){
}
public void put(E key, T value){
keyArrL.add(ke... |
Java | UTF-8 | 1,479 | 2.375 | 2 | [] | no_license | package com.dev.delta.dentic.entities;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="dentic_medicament")
public class Medicament {
@Id @GeneratedValue(strategy = Gen... |
Python | UTF-8 | 3,277 | 2.5625 | 3 | [] | no_license | import cv2
import json
import numpy as np
import socket
import struct
from playsound import playsound
from collections import defaultdict
##################################################
from yolo_module import Object_Detection
##################################################
class Recycling:
def __init__(se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.